@krizaka/ui 4.6.0 → 4.7.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 +1 -0
- package/dist/{RotatingWord-D3tpDLE4.d.ts → RotatingWord-CkDcPH9x.d.ts} +2 -2
- package/dist/account-menu.js +2 -2
- package/dist/account-menu.js.map +1 -1
- package/dist/account-settings.d.ts +9 -9
- package/dist/account-settings.js +4 -4
- package/dist/account-settings.js.map +1 -1
- package/dist/achievement.d.ts +3 -3
- package/dist/achievement.js +1 -1
- package/dist/achievement.js.map +1 -1
- package/dist/action-bar.d.ts +1 -1
- package/dist/action-bar.js +5 -5
- package/dist/action-bar.js.map +1 -1
- package/dist/activity-feed.d.ts +2 -2
- package/dist/activity-feed.js +1 -1
- package/dist/activity-feed.js.map +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js.map +1 -1
- package/dist/analysis-report.d.ts +1 -1
- package/dist/analysis-report.js +4 -4
- package/dist/analysis-report.js.map +1 -1
- package/dist/anatomy-plate.d.ts +1 -1
- package/dist/anatomy-plate.js +1 -1
- package/dist/anatomy-plate.js.map +1 -1
- package/dist/app-header/search.d.ts +1 -1
- package/dist/app-header/search.js +2 -2
- package/dist/app-header/search.js.map +1 -1
- package/dist/app-header.d.ts +2 -2
- package/dist/app-header.js.map +1 -1
- package/dist/app-shell.d.ts +8 -8
- package/dist/app-shell.js +4 -4
- package/dist/app-shell.js.map +1 -1
- package/dist/architecture-diagram.d.ts +46 -0
- package/dist/architecture-diagram.js +324 -0
- package/dist/architecture-diagram.js.map +1 -0
- package/dist/argument-card.d.ts +2 -2
- package/dist/argument-card.js +8 -8
- package/dist/argument-card.js.map +1 -1
- package/dist/auth-layout.d.ts +1 -1
- package/dist/auth-layout.js.map +1 -1
- package/dist/avatar.d.ts +2 -2
- package/dist/avatar.js.map +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/badge.js +1 -1
- package/dist/bird-plate.d.ts +1 -1
- package/dist/bird-plate.js +2 -2
- package/dist/bird-plate.js.map +1 -1
- package/dist/blocks.css +33 -0
- package/dist/button.d.ts +2 -2
- package/dist/button.js +3 -3
- package/dist/captcha.d.ts +2 -2
- package/dist/captcha.js +3 -3
- package/dist/captcha.js.map +1 -1
- package/dist/card-grid.d.ts +1 -1
- package/dist/card-grid.js +1 -1
- package/dist/card-grid.js.map +1 -1
- package/dist/card.d.ts +9 -9
- package/dist/card.js +1 -1
- package/dist/card.js.map +1 -1
- package/dist/catalogue-page.d.ts +2 -2
- package/dist/catalogue-page.js.map +1 -1
- package/dist/changelog-page.d.ts +1 -1
- package/dist/changelog-page.js +2 -2
- package/dist/changelog-page.js.map +1 -1
- package/dist/chapter.d.ts +3 -3
- package/dist/chapter.js +2 -2
- package/dist/chapter.js.map +1 -1
- package/dist/chat.d.ts +3 -3
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/chip-link.d.ts +1 -1
- package/dist/chip-link.js +1 -1
- package/dist/chip-row.d.ts +2 -2
- package/dist/chip-row.js +1 -1
- package/dist/chip-row.js.map +1 -1
- package/dist/chip.d.ts +4 -5
- package/dist/chip.js +2 -2
- package/dist/choice-grid.d.ts +1 -1
- package/dist/choice-grid.js +2 -2
- package/dist/choice-grid.js.map +1 -1
- package/dist/{chunk-S6NYGOJT.js → chunk-22IORLB5.js} +1 -1
- package/dist/chunk-22IORLB5.js.map +1 -0
- package/dist/{chunk-QA3WETWT.js → chunk-2P7Y3LNN.js} +1 -1
- package/dist/chunk-2P7Y3LNN.js.map +1 -0
- package/dist/{chunk-OGWB76BR.js → chunk-3CEMOJBL.js} +2 -2
- package/dist/chunk-3CEMOJBL.js.map +1 -0
- package/dist/{chunk-WC3SO4CE.js → chunk-3SWWUJJL.js} +2 -2
- package/dist/chunk-3SWWUJJL.js.map +1 -0
- package/dist/{chunk-S2O4NSN5.js → chunk-3TCHVNNB.js} +1 -1
- package/dist/chunk-3TCHVNNB.js.map +1 -0
- package/dist/{chunk-7P7I5OQV.js → chunk-5KBYZLU4.js} +2 -2
- package/dist/chunk-5KBYZLU4.js.map +1 -0
- package/dist/{chunk-WKQ5CB3I.js → chunk-6ARAO3TR.js} +1 -1
- package/dist/{chunk-WKQ5CB3I.js.map → chunk-6ARAO3TR.js.map} +1 -1
- package/dist/{chunk-QHVV2JGF.js → chunk-6LF6IZZM.js} +2 -2
- package/dist/chunk-6LF6IZZM.js.map +1 -0
- package/dist/{chunk-HP7BDMVK.js → chunk-7B5Q76JR.js} +2 -2
- package/dist/chunk-7B5Q76JR.js.map +1 -0
- package/dist/{chunk-F2UZ2WWL.js → chunk-7KIIAOQH.js} +1 -1
- package/dist/{chunk-F2UZ2WWL.js.map → chunk-7KIIAOQH.js.map} +1 -1
- package/dist/{chunk-ADRUEPYC.js → chunk-7MA3UODW.js} +2 -2
- package/dist/{chunk-ADRUEPYC.js.map → chunk-7MA3UODW.js.map} +1 -1
- package/dist/{chunk-KH3JOEPY.js → chunk-7PVLEALV.js} +1 -1
- package/dist/chunk-7PVLEALV.js.map +1 -0
- package/dist/{chunk-QVHSV6RA.js → chunk-7UBLUGNW.js} +1 -1
- package/dist/chunk-7UBLUGNW.js.map +1 -0
- package/dist/{chunk-YTYNKMNS.js → chunk-BKMHN4UA.js} +5 -5
- package/dist/chunk-BKMHN4UA.js.map +1 -0
- package/dist/{chunk-4QH6CP2Y.js → chunk-BRYRZWLV.js} +1 -1
- package/dist/{chunk-4QH6CP2Y.js.map → chunk-BRYRZWLV.js.map} +1 -1
- package/dist/{chunk-43PTCDTL.js → chunk-BVN7JFOP.js} +1 -1
- package/dist/chunk-BVN7JFOP.js.map +1 -0
- package/dist/{chunk-5RWHDX5J.js → chunk-BYKA3FHX.js} +2 -2
- package/dist/chunk-BYKA3FHX.js.map +1 -0
- package/dist/{chunk-5PFCELGW.js → chunk-DIOAQOR5.js} +1 -1
- package/dist/chunk-DIOAQOR5.js.map +1 -0
- package/dist/{chunk-HJFRHYCI.js → chunk-DTGRZXYO.js} +2 -2
- package/dist/{chunk-P7AFIKWG.js → chunk-DVC4YQI2.js} +2 -2
- package/dist/chunk-DVC4YQI2.js.map +1 -0
- package/dist/{chunk-V5RO6JYI.js → chunk-E3LFHTUV.js} +2 -2
- package/dist/chunk-E3LFHTUV.js.map +1 -0
- package/dist/{chunk-WEVYKZIF.js → chunk-EAXIDRMB.js} +1 -1
- package/dist/chunk-EAXIDRMB.js.map +1 -0
- package/dist/{chunk-WU4VLSEA.js → chunk-EYMS6VRF.js} +1 -1
- package/dist/chunk-EYMS6VRF.js.map +1 -0
- package/dist/{chunk-LH5J3VLZ.js → chunk-F7EJZV53.js} +1 -1
- package/dist/chunk-F7EJZV53.js.map +1 -0
- package/dist/{chunk-VPO27AFS.js → chunk-G3L7AKZJ.js} +1 -1
- package/dist/chunk-G3L7AKZJ.js.map +1 -0
- package/dist/{chunk-EB45EVPJ.js → chunk-G5NROYGK.js} +3 -3
- package/dist/chunk-G5NROYGK.js.map +1 -0
- package/dist/{chunk-HKEAYSFS.js → chunk-GQMINKT3.js} +1 -1
- package/dist/{chunk-ENOS6ETI.js.map → chunk-GQMINKT3.js.map} +1 -1
- package/dist/{chunk-3X3OF4TI.js → chunk-H4NXYAL7.js} +1 -1
- package/dist/{chunk-3X3OF4TI.js.map → chunk-H4NXYAL7.js.map} +1 -1
- package/dist/{chunk-KR2W4ONJ.js → chunk-H7I6YLI6.js} +1 -1
- package/dist/chunk-H7I6YLI6.js.map +1 -0
- package/dist/{chunk-PJNR4NTS.js → chunk-HC2TY45B.js} +4 -4
- package/dist/{chunk-NSLXEDIS.js → chunk-HHBTM4AU.js} +1 -1
- package/dist/chunk-HHBTM4AU.js.map +1 -0
- package/dist/{chunk-XVRKKYWU.js → chunk-HVUR3UNK.js} +2 -2
- package/dist/{chunk-XVRKKYWU.js.map → chunk-HVUR3UNK.js.map} +1 -1
- package/dist/{chunk-V7W4RLRW.js → chunk-HWIDTLLO.js} +3 -3
- package/dist/chunk-HWIDTLLO.js.map +1 -0
- package/dist/{chunk-W675RFOA.js → chunk-ISC2QBXJ.js} +1 -1
- package/dist/chunk-ISC2QBXJ.js.map +1 -0
- package/dist/{chunk-7DYZTEE3.js → chunk-IWPB6SSW.js} +1 -1
- package/dist/chunk-IWPB6SSW.js.map +1 -0
- package/dist/{chunk-TVLRE7S3.js → chunk-JDVWUF5W.js} +2 -2
- package/dist/{chunk-TVLRE7S3.js.map → chunk-JDVWUF5W.js.map} +1 -1
- package/dist/{chunk-757ZTGU5.js → chunk-JE2NY4XE.js} +4 -4
- package/dist/chunk-JE2NY4XE.js.map +1 -0
- package/dist/{chunk-HLEBSAGC.js → chunk-KBSZ6JRF.js} +2 -2
- package/dist/chunk-KBSZ6JRF.js.map +1 -0
- package/dist/{chunk-Y3P5B4XS.js → chunk-KCU45KQ3.js} +3 -3
- package/dist/chunk-KCU45KQ3.js.map +1 -0
- package/dist/{chunk-ST5P5HNI.js → chunk-L4YBG5US.js} +4 -4
- package/dist/{chunk-ST5P5HNI.js.map → chunk-L4YBG5US.js.map} +1 -1
- package/dist/{chunk-NG6G6V5E.js → chunk-LFH3LEWR.js} +1 -1
- package/dist/chunk-LFH3LEWR.js.map +1 -0
- package/dist/{chunk-YATTFMDV.js → chunk-LSQQSJ6J.js} +2 -2
- package/dist/{chunk-YATTFMDV.js.map → chunk-LSQQSJ6J.js.map} +1 -1
- package/dist/{chunk-LNAAWT4Y.js → chunk-MJWOZ3JI.js} +1 -1
- package/dist/chunk-MJWOZ3JI.js.map +1 -0
- package/dist/{chunk-KID32IRJ.js → chunk-MXHJMTZ5.js} +1 -1
- package/dist/{chunk-KID32IRJ.js.map → chunk-MXHJMTZ5.js.map} +1 -1
- package/dist/{chunk-GHAN7OOE.js → chunk-N6LAWI4F.js} +2 -2
- package/dist/chunk-N6LAWI4F.js.map +1 -0
- package/dist/{chunk-5VZ37TY3.js → chunk-NFJWD5BT.js} +2 -2
- package/dist/chunk-NFJWD5BT.js.map +1 -0
- package/dist/{chunk-ZPOVOEO3.js → chunk-NJLIHGU4.js} +2 -2
- package/dist/chunk-NJLIHGU4.js.map +1 -0
- package/dist/{chunk-PRD7JRQX.js → chunk-ONCQWOTH.js} +4 -4
- package/dist/{chunk-PRD7JRQX.js.map → chunk-ONCQWOTH.js.map} +1 -1
- package/dist/{chunk-ENOS6ETI.js → chunk-OZC6CDZF.js} +1 -1
- package/dist/{chunk-HKEAYSFS.js.map → chunk-OZC6CDZF.js.map} +1 -1
- package/dist/{chunk-TXFX4PMN.js → chunk-OZY4C4W5.js} +1 -1
- package/dist/{chunk-TXFX4PMN.js.map → chunk-OZY4C4W5.js.map} +1 -1
- package/dist/{chunk-NPMGYLJV.js → chunk-PIRYDEX2.js} +3 -3
- package/dist/chunk-PIRYDEX2.js.map +1 -0
- package/dist/{chunk-C57KK5VB.js → chunk-PM23USOC.js} +1 -1
- package/dist/chunk-PM23USOC.js.map +1 -0
- package/dist/{chunk-PGBF3UBX.js → chunk-QKL5TECH.js} +1 -1
- package/dist/chunk-QKL5TECH.js.map +1 -0
- package/dist/{chunk-Z47KIPCT.js → chunk-QY5JEUJT.js} +1 -1
- package/dist/chunk-QY5JEUJT.js.map +1 -0
- package/dist/{chunk-FVGFPB73.js → chunk-RPVKF4RR.js} +1 -1
- package/dist/{chunk-FVGFPB73.js.map → chunk-RPVKF4RR.js.map} +1 -1
- package/dist/{chunk-NM2DEHFZ.js → chunk-RXYKJIC4.js} +1 -1
- package/dist/chunk-RXYKJIC4.js.map +1 -0
- package/dist/{chunk-W64RAX4N.js → chunk-TKYNYIJS.js} +5 -5
- package/dist/chunk-TKYNYIJS.js.map +1 -0
- package/dist/{chunk-S4TLZRGZ.js → chunk-UMXWOA3I.js} +1 -1
- package/dist/chunk-UMXWOA3I.js.map +1 -0
- package/dist/{chunk-VA4NPCUQ.js → chunk-VD7QFUAP.js} +3 -3
- package/dist/chunk-VD7QFUAP.js.map +1 -0
- package/dist/{chunk-MDSP7DJR.js → chunk-VQELCPQJ.js} +5 -5
- package/dist/chunk-VQELCPQJ.js.map +1 -0
- package/dist/{chunk-2FCQCWIK.js → chunk-VXNBXW3P.js} +5 -5
- package/dist/chunk-VXNBXW3P.js.map +1 -0
- package/dist/{chunk-B47WSPMP.js → chunk-WPUDPH2Q.js} +1 -1
- package/dist/chunk-WPUDPH2Q.js.map +1 -0
- package/dist/{chunk-SG2RKUVJ.js → chunk-WTZUMVJI.js} +5 -5
- package/dist/chunk-WTZUMVJI.js.map +1 -0
- package/dist/{chunk-EDQLPCM4.js → chunk-WVZF6WK3.js} +2 -2
- package/dist/chunk-WVZF6WK3.js.map +1 -0
- package/dist/{chunk-5D7NMUF6.js → chunk-XDAETKWM.js} +2 -2
- package/dist/chunk-XDAETKWM.js.map +1 -0
- package/dist/{chunk-QD6SNXF5.js → chunk-XDWSGNL4.js} +3 -3
- package/dist/chunk-XDWSGNL4.js.map +1 -0
- package/dist/{chunk-SB5WSVPI.js → chunk-ZFH2BYXW.js} +2 -2
- package/dist/chunk-ZFH2BYXW.js.map +1 -0
- package/dist/{chunk-XVLWVTQA.js → chunk-ZI7K742O.js} +1 -1
- package/dist/{chunk-XVLWVTQA.js.map → chunk-ZI7K742O.js.map} +1 -1
- package/dist/{chunk-NQENOT6L.js → chunk-ZRRWSKV3.js} +8 -8
- package/dist/chunk-ZRRWSKV3.js.map +1 -0
- package/dist/cn.js +1 -1
- package/dist/code-block.d.ts +2 -2
- package/dist/code-block.js +2 -2
- package/dist/code-block.js.map +1 -1
- package/dist/collection-switcher.d.ts +1 -1
- package/dist/collection-switcher.js +1 -1
- package/dist/collection-switcher.js.map +1 -1
- package/dist/columns.d.ts +2 -2
- package/dist/columns.js.map +1 -1
- package/dist/combobox.js +4 -4
- package/dist/command.d.ts +10 -10
- package/dist/command.js +4 -4
- package/dist/command.js.map +1 -1
- package/dist/comparison-table.d.ts +1 -1
- package/dist/comparison-table.js +1 -1
- package/dist/comparison-table.js.map +1 -1
- package/dist/component-page.d.ts +1 -1
- package/dist/component-page.js.map +1 -1
- package/dist/confirm-button.d.ts +1 -1
- package/dist/confirm-button.js +4 -4
- package/dist/contact-page.d.ts +1 -1
- package/dist/contact-page.js.map +1 -1
- package/dist/continue-prompt.d.ts +1 -1
- package/dist/continue-prompt.js +1 -1
- package/dist/continue-prompt.js.map +1 -1
- package/dist/copy-button.d.ts +1 -1
- package/dist/copy-button.js +4 -4
- package/dist/copy-button.js.map +1 -1
- package/dist/countdown.d.ts +1 -1
- package/dist/countdown.js.map +1 -1
- package/dist/cover-hero.d.ts +1 -1
- package/dist/cover-hero.js +5 -5
- package/dist/cover-hero.js.map +1 -1
- package/dist/cta-panel.d.ts +1 -1
- package/dist/cta-panel.js +1 -1
- package/dist/cta-panel.js.map +1 -1
- package/dist/dashboard-layout.d.ts +2 -2
- package/dist/dashboard-layout.js.map +1 -1
- package/dist/data-table.d.ts +5 -5
- package/dist/data-table.js +9 -9
- package/dist/date-picker.d.ts +11 -11
- package/dist/date-picker.js +5 -5
- package/dist/date-picker.js.map +1 -1
- package/dist/decision-list.d.ts +1 -1
- package/dist/decision-list.js +2 -2
- package/dist/decision-list.js.map +1 -1
- package/dist/description-list.d.ts +2 -2
- package/dist/description-list.js.map +1 -1
- package/dist/detail-layout.d.ts +5 -5
- package/dist/detail-layout.js +1 -1
- package/dist/detail-layout.js.map +1 -1
- package/dist/{dialog-DpUwec2g.d.ts → dialog-CFnxFGyn.d.ts} +7 -7
- package/dist/dialog.d.ts +2 -2
- package/dist/dialog.js +4 -4
- package/dist/dialog.js.map +1 -1
- package/dist/docs-article-page.d.ts +1 -1
- package/dist/docs-article-page.js.map +1 -1
- package/dist/docs-hub-page.d.ts +1 -1
- package/dist/docs-hub-page.js.map +1 -1
- package/dist/docs-layout.d.ts +1 -1
- package/dist/docs-layout.js +1 -1
- package/dist/docs-layout.js.map +1 -1
- package/dist/docs-nav.d.ts +1 -1
- package/dist/docs-nav.js +1 -1
- package/dist/docs-nav.js.map +1 -1
- package/dist/document-viewer.d.ts +2 -2
- package/dist/document-viewer.js +3 -3
- package/dist/document-viewer.js.map +1 -1
- package/dist/doodle.d.ts +1 -1
- package/dist/doodle.js +1 -1
- package/dist/doodle.js.map +1 -1
- package/dist/drop-overlay.d.ts +1 -1
- package/dist/drop-overlay.js +1 -1
- package/dist/drop-overlay.js.map +1 -1
- package/dist/dropdown-menu.d.ts +8 -8
- package/dist/dropdown-menu.js +2 -2
- package/dist/embed-facade.js +1 -1
- package/dist/empty-state.d.ts +1 -1
- package/dist/empty-state.js.map +1 -1
- package/dist/engine-flow.d.ts +1 -1
- package/dist/engine-flow.js +1 -1
- package/dist/engine-flow.js.map +1 -1
- package/dist/entity-header.d.ts +1 -1
- package/dist/entity-header.js +1 -1
- package/dist/entity-header.js.map +1 -1
- package/dist/environment-notice.d.ts +1 -1
- package/dist/environment-notice.js.map +1 -1
- package/dist/error-page.d.ts +1 -1
- package/dist/error-page.js +1 -1
- package/dist/error-page.js.map +1 -1
- package/dist/field.d.ts +3 -3
- package/dist/field.js +1 -1
- package/dist/field.js.map +1 -1
- package/dist/file-upload.d.ts +1 -1
- package/dist/file-upload.js +1 -1
- package/dist/file-upload.js.map +1 -1
- package/dist/filter-bar.d.ts +2 -2
- package/dist/filter-bar.js +4 -4
- package/dist/flock.d.ts +1 -1
- package/dist/flock.js +2 -2
- package/dist/flock.js.map +1 -1
- package/dist/footnote.d.ts +3 -3
- package/dist/footnote.js +1 -1
- package/dist/footnote.js.map +1 -1
- package/dist/force-update-screen.d.ts +1 -1
- package/dist/force-update-screen.js +3 -3
- package/dist/force-update-screen.js.map +1 -1
- package/dist/form/server.js.map +1 -1
- package/dist/form.d.ts +12 -12
- package/dist/form.js +4 -4
- package/dist/form.js.map +1 -1
- package/dist/{frame-CmDztC_y.d.ts → frame-D5HU_cG8.d.ts} +2 -2
- package/dist/gallery-page.d.ts +1 -1
- package/dist/gallery-page.js +1 -1
- package/dist/gallery-page.js.map +1 -1
- package/dist/genui.d.ts +2 -2
- package/dist/genui.js +9 -9
- package/dist/genui.js.map +1 -1
- package/dist/glossary-term.js +2 -2
- package/dist/glow-card.d.ts +1 -1
- package/dist/glow-card.js +1 -1
- package/dist/glow-card.js.map +1 -1
- package/dist/goal-gauge.d.ts +1 -1
- package/dist/goal-gauge.js +1 -1
- package/dist/goal-gauge.js.map +1 -1
- package/dist/grade-stamp.d.ts +1 -1
- package/dist/grade-stamp.js +2 -2
- package/dist/grade-stamp.js.map +1 -1
- package/dist/identity-card.d.ts +1 -1
- package/dist/identity-card.js +5 -5
- package/dist/identity-card.js.map +1 -1
- package/dist/image-cropper.d.ts +1 -1
- package/dist/image-cropper.js +3 -3
- package/dist/image-cropper.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/kanban.d.ts +1 -1
- package/dist/kanban.js.map +1 -1
- package/dist/kbd.d.ts +1 -1
- package/dist/kbd.js.map +1 -1
- package/dist/kind-config-editor.js +8 -8
- package/dist/kind-config-editor.js.map +1 -1
- package/dist/kpi-explained.js +1 -1
- package/dist/kpi-explained.js.map +1 -1
- package/dist/landing-page.d.ts +1 -1
- package/dist/landing-page.js.map +1 -1
- package/dist/landscape.d.ts +1 -1
- package/dist/landscape.js +2 -2
- package/dist/landscape.js.map +1 -1
- package/dist/language-switch.d.ts +1 -1
- package/dist/language-switch.js +1 -1
- package/dist/legal-page.d.ts +1 -1
- package/dist/legal-page.js.map +1 -1
- package/dist/{lightbox-MRB2YZEP.js → lightbox-JLWASIJC.js} +4 -4
- package/dist/link-card.d.ts +1 -1
- package/dist/link-card.js +4 -4
- package/dist/list.d.ts +1 -1
- package/dist/list.js +2 -2
- package/dist/list.js.map +1 -1
- package/dist/loader.d.ts +2 -2
- package/dist/loader.js +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/longform-page.d.ts +1 -1
- package/dist/longform-page.js +1 -1
- package/dist/longform-page.js.map +1 -1
- package/dist/maintenance-screen.d.ts +1 -1
- package/dist/maintenance-screen.js +3 -3
- package/dist/maintenance-screen.js.map +1 -1
- package/dist/map/cards.d.ts +2 -2
- package/dist/map/cards.js +1 -1
- package/dist/map/cards.js.map +1 -1
- package/dist/map/pin.js +1 -1
- package/dist/map/sheet.d.ts +1 -1
- package/dist/map/sheet.js +1 -1
- package/dist/map/sheet.js.map +1 -1
- package/dist/map.d.ts +5 -5
- package/dist/map.js +4 -4
- package/dist/map.js.map +1 -1
- package/dist/margin-layout.d.ts +2 -2
- package/dist/margin-layout.js.map +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/marketing-layout.d.ts +1 -1
- package/dist/marketing-layout.js.map +1 -1
- package/dist/mascot-quote.d.ts +1 -1
- package/dist/mascot-quote.js +2 -2
- package/dist/mascot-quote.js.map +1 -1
- package/dist/mascot-state.d.ts +5 -5
- package/dist/mascot-state.js +1 -1
- package/dist/mascot-state.js.map +1 -1
- package/dist/mascots.d.ts +2 -2
- package/dist/mascots.js +2 -2
- package/dist/mascots.js.map +1 -1
- package/dist/match-dialog.d.ts +1 -1
- package/dist/match-dialog.js +4 -4
- package/dist/match-dialog.js.map +1 -1
- package/dist/media-capture.d.ts +1 -1
- package/dist/media-capture.js +1 -1
- package/dist/media-capture.js.map +1 -1
- package/dist/media-carousel.js +5 -5
- package/dist/media-carousel.js.map +1 -1
- package/dist/media-gallery.d.ts +1 -1
- package/dist/media-gallery.js +1 -1
- package/dist/media-gallery.js.map +1 -1
- package/dist/media-player.d.ts +1 -1
- package/dist/media-player.js +4 -4
- package/dist/meter.d.ts +2 -2
- package/dist/meter.js +1 -1
- package/dist/money-input.d.ts +1 -1
- package/dist/money-input.js +3 -3
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +1 -1
- package/dist/native/form.d.ts +12 -12
- package/dist/native/form.js +4 -4
- package/dist/native/form.js.map +1 -1
- package/dist/native/list.d.ts +1 -1
- package/dist/native/list.js.map +1 -1
- package/dist/native/map.d.ts +4 -4
- package/dist/native/map.js +2 -2
- package/dist/native/map.js.map +1 -1
- package/dist/native/markdown.js.map +1 -1
- package/dist/native/media-capture.d.ts +1 -1
- package/dist/native/media-capture.js.map +1 -1
- package/dist/native/media-picker.d.ts +1 -1
- package/dist/native/media-picker.js.map +1 -1
- package/dist/native/vertical-video.d.ts +2 -2
- package/dist/native/vertical-video.js.map +1 -1
- package/dist/native/video-player.d.ts +1 -1
- package/dist/native/video-player.js.map +1 -1
- package/dist/native.d.ts +95 -95
- package/dist/native.js +13 -13
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.d.ts +13 -13
- package/dist/nav-bar.js +5 -5
- package/dist/nav-bar.js.map +1 -1
- package/dist/notification-preferences.js +3 -3
- package/dist/number-ticker.d.ts +1 -1
- package/dist/number-ticker.js +1 -1
- package/dist/number-ticker.js.map +1 -1
- package/dist/opening-hours.d.ts +1 -1
- package/dist/opening-hours.js +1 -1
- package/dist/opening-hours.js.map +1 -1
- package/dist/{page-DPHDmDAQ.d.ts → page-Ufnb5TrQ.d.ts} +5 -5
- package/dist/page-header.d.ts +1 -1
- package/dist/page-header.js.map +1 -1
- package/dist/page-hero.d.ts +1 -1
- package/dist/page-hero.js +5 -5
- package/dist/page-hero.js.map +1 -1
- package/dist/page-index.d.ts +1 -1
- package/dist/page-index.js +2 -2
- package/dist/page-index.js.map +1 -1
- package/dist/page.d.ts +1 -1
- package/dist/page.js +3 -3
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/pausable-loop.js +2 -2
- package/dist/{player-lightbox-BYQ57OXT.js → player-lightbox-SJR3GB7U.js} +5 -5
- package/dist/player-lightbox-SJR3GB7U.js.map +1 -0
- package/dist/pointer-light.d.ts +1 -1
- package/dist/pointer-light.js.map +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/popover.js.map +1 -1
- package/dist/price-catalogue-editor.js +8 -8
- package/dist/price-catalogue-editor.js.map +1 -1
- package/dist/pricing-page.d.ts +1 -1
- package/dist/pricing-page.js +1 -1
- package/dist/pricing-page.js.map +1 -1
- package/dist/product-page.d.ts +1 -1
- package/dist/product-page.js +1 -1
- package/dist/product-page.js.map +1 -1
- package/dist/profile-card.d.ts +3 -3
- package/dist/profile-card.js +1 -1
- package/dist/profile-card.js.map +1 -1
- package/dist/progress.d.ts +1 -1
- package/dist/progress.js.map +1 -1
- package/dist/promise-card.d.ts +1 -1
- package/dist/promise-card.js +1 -1
- package/dist/promise-card.js.map +1 -1
- package/dist/promo-code-field.js +4 -4
- package/dist/proposal.js +5 -5
- package/dist/qr-code.js +6 -6
- package/dist/qr-code.js.map +1 -1
- package/dist/quota-meter.d.ts +1 -1
- package/dist/quota-meter.js +1 -1
- package/dist/quota-meter.js.map +1 -1
- package/dist/radio-group.d.ts +5 -5
- package/dist/radio-group.js +3 -3
- package/dist/radio-group.js.map +1 -1
- package/dist/rail-nav.d.ts +4 -4
- package/dist/rail-nav.js +3 -3
- package/dist/rail-nav.js.map +1 -1
- package/dist/recipes.js +1 -1
- package/dist/recipes.js.map +1 -1
- package/dist/retro-tv-playlist.d.ts +1 -1
- package/dist/retro-tv-playlist.js.map +1 -1
- package/dist/retro-tv.js +6 -6
- package/dist/retro-tv.js.map +1 -1
- package/dist/reviews.js +3 -3
- package/dist/schema-form.js +7 -7
- package/dist/schema-form.js.map +1 -1
- package/dist/scroll-stage.d.ts +2 -2
- package/dist/scroll-stage.js +2 -2
- package/dist/scroll-stage.js.map +1 -1
- package/dist/search-field.d.ts +1 -1
- package/dist/search-field.js +2 -2
- package/dist/section-backdrop.d.ts +1 -1
- package/dist/section-backdrop.js +1 -1
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js.map +1 -1
- package/dist/service-card.d.ts +1 -1
- package/dist/service-card.js +6 -6
- package/dist/service-card.js.map +1 -1
- package/dist/settings-layout.d.ts +3 -3
- package/dist/settings-layout.js +2 -2
- package/dist/shop/booking.d.ts +1 -1
- package/dist/shop/booking.js +4 -4
- package/dist/shop/booking.js.map +1 -1
- package/dist/shop/bulletin.d.ts +1 -1
- package/dist/shop/bulletin.js +2 -2
- package/dist/shop/bulletin.js.map +1 -1
- package/dist/shop/faq.d.ts +1 -1
- package/dist/shop/faq.js +3 -3
- package/dist/shop/faq.js.map +1 -1
- package/dist/shop/gallery.d.ts +1 -1
- package/dist/shop/gallery.js +3 -3
- package/dist/shop/gallery.js.map +1 -1
- package/dist/shop/hero.d.ts +1 -1
- package/dist/shop/hero.js +2 -2
- package/dist/shop/hero.js.map +1 -1
- package/dist/shop/policies.d.ts +1 -1
- package/dist/shop/policies.js +2 -2
- package/dist/shop/policies.js.map +1 -1
- package/dist/shop/reviews.d.ts +1 -1
- package/dist/shop/reviews.js +2 -2
- package/dist/shop/reviews.js.map +1 -1
- package/dist/shop/services.d.ts +1 -1
- package/dist/shop/services.js +4 -4
- package/dist/shop/services.js.map +1 -1
- package/dist/shop/social.d.ts +1 -1
- package/dist/shop/social.js +2 -2
- package/dist/shop/social.js.map +1 -1
- package/dist/shop/story.d.ts +1 -1
- package/dist/shop/story.js +2 -2
- package/dist/shop/story.js.map +1 -1
- package/dist/shop/team.d.ts +1 -1
- package/dist/shop/team.js +2 -2
- package/dist/shop/team.js.map +1 -1
- package/dist/shop/video.d.ts +1 -1
- package/dist/shop/video.js +2 -2
- package/dist/shop/video.js.map +1 -1
- package/dist/shop/visit.d.ts +1 -1
- package/dist/shop/visit.js +2 -2
- package/dist/shop/visit.js.map +1 -1
- package/dist/shop-composer.js +2 -2
- package/dist/shop-composer.js.map +1 -1
- package/dist/shop-gallery.d.ts +1 -1
- package/dist/shop-gallery.js +2 -2
- package/dist/shop-gallery.js.map +1 -1
- package/dist/shop.d.ts +1 -1
- package/dist/shop.js +2 -2
- package/dist/showcase.d.ts +1 -1
- package/dist/showcase.js +6 -6
- package/dist/showcase.js.map +1 -1
- package/dist/signature.d.ts +1 -1
- package/dist/signature.js +2 -2
- package/dist/signature.js.map +1 -1
- package/dist/site-cahier.d.ts +3 -3
- package/dist/site-cahier.js +10 -10
- package/dist/site-cahier.js.map +1 -1
- package/dist/site-footer.d.ts +4 -4
- package/dist/site-footer.js +1 -1
- package/dist/site-footer.js.map +1 -1
- package/dist/skeleton.d.ts +3 -3
- package/dist/skeleton.js.map +1 -1
- package/dist/skip-link.d.ts +1 -1
- package/dist/skip-link.js +1 -1
- package/dist/slider.d.ts +1 -1
- package/dist/slider.js +2 -2
- package/dist/slider.js.map +1 -1
- package/dist/slot-picker.d.ts +1 -1
- package/dist/slot-picker.js +1 -1
- package/dist/slot-picker.js.map +1 -1
- package/dist/specimen-tag.d.ts +2 -2
- package/dist/specimen-tag.js +2 -2
- package/dist/speed-lines.d.ts +1 -1
- package/dist/speed-lines.js +1 -1
- package/dist/speed-lines.js.map +1 -1
- package/dist/spinner.d.ts +2 -2
- package/dist/spinner.js +1 -1
- package/dist/spinner.js.map +1 -1
- package/dist/split-view.d.ts +1 -1
- package/dist/split-view.js.map +1 -1
- package/dist/stage-banner.d.ts +1 -1
- package/dist/stage-banner.js +1 -1
- package/dist/stage-banner.js.map +1 -1
- package/dist/stat.d.ts +2 -2
- package/dist/stat.js +1 -1
- package/dist/status-chip.js +4 -4
- package/dist/status-chip.js.map +1 -1
- package/dist/status-page.d.ts +1 -1
- package/dist/status-page.js.map +1 -1
- package/dist/step-progress.d.ts +1 -1
- package/dist/step-progress.js.map +1 -1
- package/dist/step-showcase.d.ts +2 -2
- package/dist/step-showcase.js +3 -3
- package/dist/step-showcase.js.map +1 -1
- package/dist/stepper.d.ts +1 -1
- package/dist/stepper.js +1 -1
- package/dist/stepper.js.map +1 -1
- package/dist/sticky-action.d.ts +1 -1
- package/dist/sticky-action.js.map +1 -1
- package/dist/stuck.d.ts +1 -1
- package/dist/stuck.js +1 -1
- package/dist/stuck.js.map +1 -1
- package/dist/swipe-deck.d.ts +2 -2
- package/dist/swipe-deck.js.map +1 -1
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +1 -1
- package/dist/tabs.d.ts +6 -6
- package/dist/tabs.js +1 -1
- package/dist/tabs.js.map +1 -1
- package/dist/tag-input.d.ts +1 -1
- package/dist/tag-input.js +4 -4
- package/dist/tag-input.js.map +1 -1
- package/dist/tag-selector.d.ts +1 -1
- package/dist/tag-selector.js +3 -3
- package/dist/tag-selector.js.map +1 -1
- package/dist/taped-photo.d.ts +1 -1
- package/dist/taped-photo.js +2 -2
- package/dist/terminal-replay.d.ts +1 -1
- package/dist/terminal-replay.js +3 -3
- package/dist/terminal-replay.js.map +1 -1
- package/dist/text-style/server.d.ts +1 -1
- package/dist/text-style/server.js.map +1 -1
- package/dist/text-style.d.ts +2 -2
- package/dist/text-style.js.map +1 -1
- package/dist/theme.d.ts +3 -3
- package/dist/theme.js +3 -3
- package/dist/theme.js.map +1 -1
- package/dist/toast.d.ts +1 -1
- package/dist/toast.js +2 -2
- package/dist/toast.js.map +1 -1
- package/dist/toc.d.ts +2 -2
- package/dist/toc.js +1 -1
- package/dist/toc.js.map +1 -1
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +2 -2
- package/dist/tree-view.d.ts +1 -1
- package/dist/tree-view.js +2 -2
- package/dist/tree-view.js.map +1 -1
- package/dist/update-prompt.d.ts +1 -1
- package/dist/update-prompt.js +3 -3
- package/dist/update-prompt.js.map +1 -1
- package/dist/upload-queue.d.ts +2 -2
- package/dist/upload-queue.js +1 -1
- package/dist/upload-queue.js.map +1 -1
- package/dist/usage.d.ts +4 -4
- package/dist/usage.js +3 -3
- package/dist/usage.js.map +1 -1
- package/dist/verified-badge.d.ts +1 -1
- package/dist/verified-badge.js.map +1 -1
- package/dist/versus-card.d.ts +1 -1
- package/dist/versus-card.js +2 -2
- package/dist/versus-card.js.map +1 -1
- package/dist/vertical-video.d.ts +2 -2
- package/dist/vertical-video.js +6 -6
- package/dist/vertical-video.js.map +1 -1
- package/dist/video-player.d.ts +1 -1
- package/dist/video-player.js +5 -5
- package/dist/video-trimmer.d.ts +1 -1
- package/dist/video-trimmer.js.map +1 -1
- package/dist/virtual.d.ts +2 -2
- package/dist/virtual.js +1 -1
- package/dist/wall.js +2 -2
- package/dist/wall.js.map +1 -1
- package/dist/waveform.d.ts +1 -1
- package/dist/waveform.js.map +1 -1
- package/package.json +26 -7
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +18 -18
- package/registry/achievement.json +2 -2
- package/registry/action-bar.json +4 -4
- package/registry/activity-feed.json +3 -3
- package/registry/agenda.json +1 -1
- package/registry/alert.json +2 -2
- package/registry/analysis-report.json +2 -2
- package/registry/anatomy-plate.json +2 -2
- package/registry/app-frame.json +7 -7
- package/registry/app-header.json +5 -5
- package/registry/app-shell.json +3 -3
- package/registry/architecture-diagram.json +239 -0
- package/registry/argument-card.json +4 -4
- package/registry/auth-layout.json +2 -2
- package/registry/avatar.json +4 -4
- package/registry/badge.json +2 -2
- package/registry/bird-plate.json +2 -2
- package/registry/button.json +2 -2
- package/registry/captcha.json +2 -2
- package/registry/card-grid.json +2 -2
- package/registry/card.json +2 -2
- package/registry/catalogue-page.json +2 -2
- package/registry/changelog-page.json +3 -3
- package/registry/chapter.json +3 -3
- package/registry/chat.json +2 -2
- package/registry/checkbox.json +2 -2
- package/registry/chip-link.json +2 -2
- package/registry/chip-row.json +2 -2
- package/registry/chip.json +3 -3
- package/registry/choice-grid.json +3 -3
- package/registry/cn.json +1 -1
- package/registry/code-block.json +3 -3
- package/registry/collection-switcher.json +3 -3
- package/registry/columns.json +2 -2
- package/registry/combobox.json +3 -3
- package/registry/command.json +2 -2
- package/registry/comparison-table.json +2 -2
- package/registry/component-page.json +2 -2
- package/registry/confirm-button.json +2 -2
- package/registry/contact-page.json +2 -2
- package/registry/continue-prompt.json +2 -2
- package/registry/copy-button.json +3 -3
- package/registry/countdown.json +2 -2
- package/registry/cover-hero.json +4 -4
- package/registry/cta-panel.json +2 -2
- package/registry/dashboard-layout.json +3 -3
- package/registry/data-table.json +5 -5
- package/registry/date-picker.json +9 -9
- package/registry/decision-list.json +3 -3
- package/registry/description-list.json +2 -2
- package/registry/desktop-window.json +1 -1
- package/registry/detail-layout.json +2 -2
- package/registry/dialog.json +3 -3
- package/registry/docs-article-page.json +2 -2
- package/registry/docs-hub-page.json +2 -2
- package/registry/docs-layout.json +3 -3
- package/registry/docs-nav.json +2 -2
- package/registry/document-viewer.json +3 -3
- package/registry/doodle.json +2 -2
- package/registry/drop-overlay.json +2 -2
- package/registry/dropdown-menu.json +2 -2
- package/registry/elephant.json +1 -1
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +2 -2
- package/registry/engine-flow.json +2 -2
- package/registry/entity-header.json +3 -3
- package/registry/environment-notice.json +2 -2
- package/registry/error-page.json +2 -2
- package/registry/examples/architecture-diagram/containers.d.ts +4 -0
- package/registry/examples/architecture-diagram/containers.js +28 -0
- package/registry/examples/architecture-diagram/containers.tsx +24 -0
- package/registry/examples/architecture-diagram/context.d.ts +4 -0
- package/registry/examples/architecture-diagram/context.js +26 -0
- package/registry/examples/architecture-diagram/context.tsx +22 -0
- package/registry/examples/architecture-diagram/dynamic.d.ts +4 -0
- package/registry/examples/architecture-diagram/dynamic.js +27 -0
- package/registry/examples/architecture-diagram/dynamic.tsx +23 -0
- package/registry/field.json +2 -2
- package/registry/file-upload.json +3 -3
- package/registry/filter-bar.json +5 -5
- package/registry/flock.json +2 -2
- package/registry/footnote.json +2 -2
- package/registry/force-update-screen.json +2 -2
- package/registry/form.json +65 -65
- package/registry/gallery-page.json +2 -2
- package/registry/genui.json +3 -3
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +2 -2
- package/registry/goal-gauge.json +2 -2
- package/registry/grade-stamp.json +2 -2
- package/registry/identity-card.json +2 -2
- package/registry/image-cropper.json +2 -2
- package/registry/index.json +37 -8
- package/registry/kanban.json +2 -2
- package/registry/kbd.json +2 -2
- package/registry/kind-config-editor.json +3 -3
- package/registry/kpi-explained.json +2 -2
- package/registry/landing-page.json +2 -2
- package/registry/landscape.json +2 -2
- package/registry/language-switch.json +2 -2
- package/registry/legal-page.json +2 -2
- package/registry/link-card.json +4 -4
- package/registry/list.json +3 -3
- package/registry/loader.json +2 -2
- package/registry/longform-page.json +2 -2
- package/registry/maintenance-screen.json +2 -2
- package/registry/map.json +8 -8
- package/registry/margin-layout.json +2 -2
- package/registry/markdown.json +2 -2
- package/registry/marketing-layout.json +2 -2
- package/registry/mascot-quote.json +2 -2
- package/registry/mascot-state.json +3 -3
- package/registry/mascots.json +4 -4
- package/registry/match-dialog.json +2 -2
- package/registry/media-capture.json +3 -3
- package/registry/media-gallery.json +5 -5
- package/registry/meter.json +2 -2
- package/registry/money-input.json +2 -2
- package/registry/nav-bar.json +9 -9
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +2 -2
- package/registry/opening-hours.json +3 -3
- package/registry/page-header.json +2 -2
- package/registry/page-hero.json +4 -4
- package/registry/page-index.json +3 -3
- package/registry/page.json +2 -2
- package/registry/pagination.json +3 -3
- package/registry/pointer-light.json +2 -2
- package/registry/popover.json +2 -2
- package/registry/price-catalogue-editor.json +2 -2
- package/registry/pricing-page.json +3 -3
- package/registry/product-page.json +2 -2
- package/registry/profile-card.json +4 -4
- package/registry/progress.json +2 -2
- package/registry/promise-card.json +2 -2
- package/registry/promo-code-field.json +1 -1
- package/registry/proposal.json +1 -1
- package/registry/qr-code.json +3 -3
- package/registry/quota-meter.json +2 -2
- package/registry/radio-group.json +15 -15
- package/registry/rail-nav.json +9 -9
- package/registry/recipes.json +2 -2
- package/registry/retro-tv.json +4 -4
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/schema-form.json +2 -2
- package/registry/scroll-stage.json +2 -2
- package/registry/search-field.json +3 -3
- package/registry/section-backdrop.json +2 -2
- package/registry/separator.json +2 -2
- package/registry/service-card.json +4 -4
- package/registry/settings-layout.json +2 -2
- package/registry/shop-composer.json +4 -4
- package/registry/shop-gallery.json +2 -2
- package/registry/shop.json +18 -18
- package/registry/showcase.json +2 -2
- package/registry/signature.json +2 -2
- package/registry/site-cahier.json +3 -3
- package/registry/site-footer.json +11 -11
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +2 -2
- package/registry/skip-link.json +2 -2
- package/registry/slider.json +2 -2
- package/registry/slot-picker.json +3 -3
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +2 -2
- package/registry/speed-lines.json +2 -2
- package/registry/spinner.json +3 -3
- package/registry/split-view.json +2 -2
- package/registry/stage-banner.json +2 -2
- package/registry/stat.json +2 -2
- package/registry/status-chip.json +3 -3
- package/registry/status-page.json +2 -2
- package/registry/step-progress.json +2 -2
- package/registry/step-showcase.json +3 -3
- package/registry/stepper.json +2 -2
- package/registry/sticky-action.json +2 -2
- package/registry/stuck.json +2 -2
- package/registry/swipe-deck.json +2 -2
- package/registry/switch.json +2 -2
- package/registry/tabs.json +2 -2
- package/registry/tag-input.json +2 -2
- package/registry/tag-selector.json +2 -2
- package/registry/taped-photo.json +2 -2
- package/registry/terminal-replay.json +3 -3
- package/registry/text-style.json +9 -9
- package/registry/theme.json +2 -2
- package/registry/toast.json +2 -2
- package/registry/toc.json +2 -2
- package/registry/tooltip.json +2 -2
- package/registry/tree-view.json +3 -3
- package/registry/update-prompt.json +2 -2
- package/registry/upload-queue.json +2 -2
- package/registry/usage.json +3 -3
- package/registry/verified-badge.json +2 -2
- package/registry/versus-card.json +2 -2
- package/registry/vertical-video.json +3 -3
- package/registry/video-player.json +3 -3
- package/registry/video-trimmer.json +2 -2
- package/registry/virtual.json +4 -4
- package/registry/wall.json +2 -2
- package/registry/waveform.json +2 -2
- package/dist/chunk-2FCQCWIK.js.map +0 -1
- package/dist/chunk-43PTCDTL.js.map +0 -1
- package/dist/chunk-5D7NMUF6.js.map +0 -1
- package/dist/chunk-5PFCELGW.js.map +0 -1
- package/dist/chunk-5RWHDX5J.js.map +0 -1
- package/dist/chunk-5VZ37TY3.js.map +0 -1
- package/dist/chunk-757ZTGU5.js.map +0 -1
- package/dist/chunk-7DYZTEE3.js.map +0 -1
- package/dist/chunk-7P7I5OQV.js.map +0 -1
- package/dist/chunk-B47WSPMP.js.map +0 -1
- package/dist/chunk-C57KK5VB.js.map +0 -1
- package/dist/chunk-EB45EVPJ.js.map +0 -1
- package/dist/chunk-EDQLPCM4.js.map +0 -1
- package/dist/chunk-GHAN7OOE.js.map +0 -1
- package/dist/chunk-HLEBSAGC.js.map +0 -1
- package/dist/chunk-HP7BDMVK.js.map +0 -1
- package/dist/chunk-KH3JOEPY.js.map +0 -1
- package/dist/chunk-KR2W4ONJ.js.map +0 -1
- package/dist/chunk-LH5J3VLZ.js.map +0 -1
- package/dist/chunk-LNAAWT4Y.js.map +0 -1
- package/dist/chunk-MDSP7DJR.js.map +0 -1
- package/dist/chunk-NG6G6V5E.js.map +0 -1
- package/dist/chunk-NM2DEHFZ.js.map +0 -1
- package/dist/chunk-NPMGYLJV.js.map +0 -1
- package/dist/chunk-NQENOT6L.js.map +0 -1
- package/dist/chunk-NSLXEDIS.js.map +0 -1
- package/dist/chunk-OGWB76BR.js.map +0 -1
- package/dist/chunk-P7AFIKWG.js.map +0 -1
- package/dist/chunk-PGBF3UBX.js.map +0 -1
- package/dist/chunk-QA3WETWT.js.map +0 -1
- package/dist/chunk-QD6SNXF5.js.map +0 -1
- package/dist/chunk-QHVV2JGF.js.map +0 -1
- package/dist/chunk-QVHSV6RA.js.map +0 -1
- package/dist/chunk-S2O4NSN5.js.map +0 -1
- package/dist/chunk-S4TLZRGZ.js.map +0 -1
- package/dist/chunk-S6NYGOJT.js.map +0 -1
- package/dist/chunk-SB5WSVPI.js.map +0 -1
- package/dist/chunk-SG2RKUVJ.js.map +0 -1
- package/dist/chunk-V5RO6JYI.js.map +0 -1
- package/dist/chunk-V7W4RLRW.js.map +0 -1
- package/dist/chunk-VA4NPCUQ.js.map +0 -1
- package/dist/chunk-VPO27AFS.js.map +0 -1
- package/dist/chunk-W64RAX4N.js.map +0 -1
- package/dist/chunk-W675RFOA.js.map +0 -1
- package/dist/chunk-WC3SO4CE.js.map +0 -1
- package/dist/chunk-WEVYKZIF.js.map +0 -1
- package/dist/chunk-WU4VLSEA.js.map +0 -1
- package/dist/chunk-Y3P5B4XS.js.map +0 -1
- package/dist/chunk-YTYNKMNS.js.map +0 -1
- package/dist/chunk-Z47KIPCT.js.map +0 -1
- package/dist/chunk-ZPOVOEO3.js.map +0 -1
- package/dist/player-lightbox-BYQ57OXT.js.map +0 -1
- /package/dist/{chunk-HJFRHYCI.js.map → chunk-DTGRZXYO.js.map} +0 -0
- /package/dist/{chunk-PJNR4NTS.js.map → chunk-HC2TY45B.js.map} +0 -0
- /package/dist/{lightbox-MRB2YZEP.js.map → lightbox-JLWASIJC.js.map} +0 -0
package/dist/flock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flock/flock.tsx","../src/flock/scenes.tsx"],"sourcesContent":["\"use client\";\n\n// The flock, alive: birds standing on a stage, each at ease in character (Mascot `life`), and the moments between\n// them — two birds glance at each other, the pigeon carries its parcel across, a bird looks up when you come near or tap\n// it. Transform and opacity only: CSS for each bird's own life, a timer for the moments (no frame loop), and nothing at\n// all when the flock is off screen, the tab is hidden or the person asked for less motion.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport type { MascotBird, MascotLook } from \"../mascots\";\nimport { Mascot } from \"../mascots\";\nimport { BEATS, neighbourOf, Prop, receive, type Shown, type Stage } from \"./scenes\";\n\nexport interface FlockBird {\n /** Which bird. */\n bird: MascotBird;\n /** Where its feet are, across the stage: 0 to 100 (% of the stage's width). */\n x: number;\n /** Where its feet are, down the stage: 0 to 100 (% of the stage's height). */\n y: number;\n /** How wide it is: % of the stage's width. */\n size: number;\n}\n\nexport interface FlockMoments {\n /** Two neighbours look at each other now and then. Default `true`. */\n glance?: boolean;\n /** The pigeon, when the flock has one, carries its parcel across to another bird and comes back. Default `true`. */\n courier?: boolean;\n /** A bird looks up when the pointer comes near, and jumps a little when tapped. Default `true`. */\n react?: boolean;\n /**\n * Scenes, true to each bird's promise: the owl reads a book, the flamingo and the lovebird talk with a speech mark, the\n * crane steps and bows, the beaver taps a log, the magpie takes a shiny point, the duck builds, the falcon scans — and the\n * pigeon hands its parcel over, which the receiver opens in its own way. One at a time, at random. Default `false`.\n */\n scenes?: boolean;\n}\n\nexport type FlockProps = Omit<React.ComponentProps<\"div\">, \"children\"> &\n FlockMoments & {\n /** The birds on the stage. */\n birds: readonly FlockBird[];\n /** The stage's shape, width over height (default 16 / 9). It keeps its ratio at any width, so the birds keep their places. */\n ratio?: number;\n /** The birds' colours: the host's accent (`brand`, default) or the Krizaka story's (`own`). */\n tone?: \"brand\" | \"own\";\n /** The source of chance (default `Math.random`): give it a fixed one in a test. */\n random?: () => number;\n /** How lively the moments are: 1 is calm (default), 2 doubles how often neighbours glance and the pigeon delivers. */\n tempo?: number;\n /** A bird the page points at (a product the reader is on): it looks up and jumps once each time it changes. */\n active?: MascotBird | null;\n /** The birds greet the reader once as the flock first comes into view: each jumps in turn, left to right. */\n greet?: boolean;\n };\n\n// @fixed: the rhythm of the moments — how long a glance lasts, how often one happens, how long a delivery takes. A\n// choreography's pace, not a business parameter.\nconst GLANCE_HOLD_MS = [1500, 2400] as const;\nconst GLANCE_EVERY_MS = [4200, 9000] as const;\nconst COURIER_FIRST_MS = 9000;\nconst COURIER_EVERY_MS = [26000, 38000] as const;\nconst FLIGHT_MS = 2600;\nconst HAND_OVER_MS = 1300;\nconst LOOK_BACK_MS = 1600;\n\nconst between = (random: () => number, [lo, hi]: readonly [number, number], tempo = 1) => (lo + random() * (hi - lo)) / tempo;\n// @fixed: the scenes' pace — the wait between two beats, and the rarer long pause.\nconst SCENE_EVERY_MS = [2600, 5200] as const;\nconst SCENE_PAUSE_MS = [8000, 12000] as const;\nconst GREET_STEP_MS = 110;\nconst POKE_MS = 700;\n\n/** `true` while the page may move: no reduced-motion request, the tab visible. */\nfunction useMayMove(): boolean {\n const [may, setMay] = React.useState(false);\n React.useEffect(() => {\n const query = globalThis.matchMedia(\"(prefers-reduced-motion: reduce)\");\n // The page settles first: `html[data-motion=\"settling\"]` (MotionObserver) holds every loop until it is `ready`.\n const settled = () => document.documentElement.getAttribute(\"data-motion\") !== \"settling\";\n const update = () => setMay(!query.matches && document.visibilityState !== \"hidden\" && settled());\n update();\n query.addEventListener(\"change\", update);\n document.addEventListener(\"visibilitychange\", update);\n const watch = typeof MutationObserver === \"undefined\" ? null : new MutationObserver(update);\n watch?.observe(document.documentElement, { attributes: true, attributeFilter: [\"data-motion\"] });\n return () => {\n query.removeEventListener(\"change\", update);\n document.removeEventListener(\"visibilitychange\", update);\n watch?.disconnect();\n };\n }, []);\n return may;\n}\n\n/** `true` while the element is on screen. */\nfunction useOnScreen(ref: React.RefObject<Element | null>): boolean {\n const [on, setOn] = React.useState(false);\n React.useEffect(() => {\n const el = ref.current;\n if (!el || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => setOn(Boolean(entry?.isIntersecting)), { threshold: 0.1 });\n observer.observe(el);\n return () => observer.disconnect();\n }, [ref]);\n return on;\n}\n\n/** The updater that drops one shown item (kept out of the component: it would nest the callbacks too deep). */\nconst without = (id: number) => (all: Shown[]) => all.filter((x) => x.id !== id);\n\n/**\n * The flock on its stage, alive. Decorative (`aria-hidden`): put the words beside it. Each bird idles in character; every\n * few seconds two neighbours glance at each other; every half minute the pigeon carries its parcel to another bird and\n * returns; a bird looks up when you come near. All of it pauses off screen and in a hidden tab, and the flock is still\n * under `prefers-reduced-motion`.\n */\nexport function Flock({ birds, ratio = 16 / 9, tone = \"brand\", glance = true, courier = true, react = true, scenes = false, random = Math.random, tempo = 1, active = null, greet = false, className, style, ...props }: FlockProps) {\n const stage = React.useRef<HTMLDivElement>(null);\n const bodies = React.useRef<(HTMLDivElement | null)[]>([]);\n const may = useMayMove();\n const onScreen = useOnScreen(stage);\n const running = may && onScreen;\n const [looks, setLooks] = React.useState<Record<number, MascotLook>>({});\n const [flying, setFlying] = React.useState<{ index: number; bank: number } | null>(null);\n const [poked, setPoked] = React.useState<Record<number, boolean>>({});\n const [shown, setShown] = React.useState<Shown[]>([]);\n const [empty, setEmpty] = React.useState<Record<number, boolean>>({});\n // Birds a scene holds (a glance or a trip leaves them alone), and the scene or the trip in progress.\n const held = React.useRef(new Set<number>());\n const busy = React.useRef<\"scene\" | \"trip\" | null>(null);\n const ids = React.useRef(0);\n\n // Left to right: a bird's neighbours are the birds beside it on the stage.\n const order = React.useMemo(() => birds.map((_, i) => i).sort((a, b) => birds[a]!.x - birds[b]!.x), [birds]);\n const look = React.useCallback((index: number, to: MascotLook) => setLooks((l) => (l[index] === to ? l : { ...l, [index]: to })), []);\n const rest = React.useCallback((...indexes: number[]) => setLooks((l) => Object.fromEntries(Object.entries(l).filter(([k]) => !indexes.includes(Number(k))))), []);\n\n // What a scene can do, bound to one run of an effect: every timer and animation it starts ends with the run.\n const stageFor = React.useCallback((run: { timers: Set<ReturnType<typeof setTimeout>>; anims: Set<Animation> }): Stage => {\n const later = (fn: () => void, ms: number) => {\n const t = setTimeout(() => {\n run.timers.delete(t);\n fn();\n }, ms);\n run.timers.add(t);\n };\n const poke = (index: number, ms = POKE_MS) => {\n setPoked((p) => ({ ...p, [index]: true }));\n later(() => setPoked((p) => ({ ...p, [index]: false })), ms);\n };\n const show = (index: number, kind: Shown[\"kind\"], ms: number, side?: 1 | -1, mark?: string) => {\n const item: Shown = { id: ++ids.current, at: index, kind, ms, side, mark };\n setShown((all) => [...all, item]);\n later(() => setShown(without(item.id)), ms);\n };\n return {\n birds,\n order,\n random,\n look,\n rest,\n poke,\n show,\n say: (index, mark, ms) => show(index, \"say\", ms, undefined, mark),\n wait: (ms) => new Promise<void>((resolve) => later(resolve, ms)),\n move: async (index, keyframes, ms) => {\n const el = bodies.current[index];\n if (!el || typeof el.animate !== \"function\") return;\n const animation = el.animate(keyframes, { duration: ms });\n run.anims.add(animation);\n await animation.finished.catch(() => undefined);\n run.anims.delete(animation);\n },\n };\n }, [birds, order, random, look, rest]);\n\n // Glances: two neighbours turn towards each other, hold, and look away.\n React.useEffect(() => {\n if (!running || !glance || order.length < 2) return;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let back: ReturnType<typeof setTimeout> | undefined;\n const next = () => {\n timer = setTimeout(() => {\n const at = Math.floor(random() * (order.length - 1));\n const [a, b] = [order[at]!, order[at + 1]!];\n if (held.current.has(a) || held.current.has(b)) return next();\n look(a, \"right\");\n look(b, \"left\");\n back = setTimeout(() => {\n rest(a, b);\n next();\n }, between(random, GLANCE_HOLD_MS));\n }, between(random, GLANCE_EVERY_MS, tempo));\n };\n next();\n return () => {\n clearTimeout(timer);\n clearTimeout(back);\n };\n }, [running, glance, order, random, tempo, look, rest]);\n\n // The delivery: the pigeon takes its parcel across to the farthest bird, hands it over, and flies back.\n React.useEffect(() => {\n const pigeon = birds.findIndex((b) => b.bird === \"pigeon\");\n if (!running || !courier || pigeon < 0 || birds.length < 2) return;\n let alive = true;\n const heldNow = held.current;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let animation: Animation | undefined;\n const run = { timers: new Set<ReturnType<typeof setTimeout>>(), anims: new Set<Animation>() };\n // The farthest bird from the pigeon, so the parcel crosses the whole stage.\n const from = birds[pigeon]!;\n const target = birds.reduce((far, b, i) => (i !== pigeon && Math.abs(b.x - from.x) > Math.abs(birds[far]!.x - from.x) ? i : far), pigeon === 0 ? 1 : 0);\n const wait = (ms: number) => new Promise<void>((resolve) => (timer = setTimeout(resolve, ms)));\n const trip = async () => {\n // With scenes, the trip waits for the beat in progress and holds the stage while it lasts.\n while (alive && scenes && busy.current === \"scene\") await wait(400);\n if (!alive) return;\n busy.current = \"trip\";\n const el = bodies.current[pigeon];\n const box = stage.current?.getBoundingClientRect();\n if (!el || !box || typeof el.animate !== \"function\") return;\n const to = birds[target]!;\n const side = to.x > from.x ? 1 : -1;\n // It lands beside the receiver, not on it.\n const dx = ((to.x - from.x) / 100) * box.width - side * (to.size / 100) * box.width * 0.55;\n const lift = (from.size / 100) * box.width * 0.35;\n const fly = async (fromX: number, toX: number) => {\n setFlying({ index: pigeon, bank: Math.sign(toX - fromX) });\n animation = el.animate(\n [\n { transform: `translate(${fromX}px, 0)`, easing: \"ease-out\" },\n { transform: `translate(${(fromX + toX) / 2}px, ${-lift}px)`, easing: \"ease-in\", offset: 0.5 },\n { transform: `translate(${toX}px, 0)` },\n ],\n { duration: FLIGHT_MS, fill: \"forwards\" },\n );\n await animation.finished.catch(() => undefined);\n setFlying(null);\n };\n look(target, side > 0 ? \"left\" : \"right\");\n held.current.add(target);\n await fly(0, dx);\n if (!alive) return;\n // The hand-over: the receiver looks at the pigeon, the pigeon hops on the doorstep.\n setPoked((p) => ({ ...p, [pigeon]: true }));\n if (scenes) {\n // …and the parcel changes hands: the receiver takes it and reacts in character, the pigeon flies back light.\n setEmpty((e) => ({ ...e, [pigeon]: true }));\n const reaction = receive(stageFor(run), target, pigeon);\n await wait(HAND_OVER_MS);\n if (!alive) return;\n setPoked((p) => ({ ...p, [pigeon]: false }));\n await reaction;\n } else {\n await wait(HAND_OVER_MS);\n if (!alive) return;\n setPoked((p) => ({ ...p, [pigeon]: false }));\n }\n if (!alive) return;\n look(target, \"up\");\n await fly(dx, 0);\n animation?.cancel();\n setEmpty((e) => ({ ...e, [pigeon]: false }));\n rest(target);\n };\n const schedule = (ms: number) => {\n timer = setTimeout(async () => {\n await trip();\n busy.current = null;\n held.current.delete(target);\n if (alive) schedule(between(random, COURIER_EVERY_MS, tempo));\n }, ms);\n };\n schedule(COURIER_FIRST_MS / tempo);\n return () => {\n alive = false;\n clearTimeout(timer);\n animation?.cancel();\n run.timers.forEach(clearTimeout);\n run.anims.forEach((a) => a.cancel());\n if (scenes) {\n setShown([]);\n setEmpty({});\n heldNow.clear();\n busy.current = null;\n }\n setFlying(null);\n };\n }, [running, courier, birds, random, tempo, scenes, stageFor, look, rest]);\n\n // The scenes: one beat at a time, picked at random from what the flock holds — never the same bird twice in a row, never\n // at a regular beat (short waits, now and then a long pause) — so the minute is never the same twice.\n React.useEffect(() => {\n if (!running || !scenes || birds.length < 1) return;\n let alive = true;\n const heldNow = held.current;\n const run = { timers: new Set<ReturnType<typeof setTimeout>>(), anims: new Set<Animation>() };\n const st = stageFor(run);\n const beats = BEATS.flatMap((beat) => birds.flatMap((b, i) => (b.bird === beat.bird ? [{ beat, index: i }] : [])));\n if (!beats.length) return;\n let last = -1;\n const next = async () => {\n const long = random() < 0.2;\n await st.wait(between(random, long ? SCENE_PAUSE_MS : SCENE_EVERY_MS, tempo));\n while (alive && busy.current === \"trip\") await st.wait(600);\n if (!alive) return;\n const pool = beats.filter((x) => x.index !== last);\n const pick = (pool.length ? pool : beats)[Math.floor(random() * (pool.length ? pool.length : beats.length))]!;\n last = pick.index;\n busy.current = \"scene\";\n // The scene's birds are held, so no glance cuts across it.\n const near = neighbourOf(st, pick.index);\n held.current.add(pick.index);\n if (near !== null) held.current.add(near);\n await pick.beat.run(st, pick.index);\n held.current.delete(pick.index);\n if (near !== null) held.current.delete(near);\n if (busy.current === \"scene\") busy.current = null;\n if (alive) void next();\n };\n void next();\n return () => {\n alive = false;\n run.timers.forEach(clearTimeout);\n run.anims.forEach((a) => a.cancel());\n setShown([]);\n heldNow.clear();\n busy.current = null;\n };\n }, [running, scenes, birds, random, tempo, stageFor]);\n\n // The greeting: the first time the flock is on screen, each bird jumps in turn.\n const greeted = React.useRef(false);\n React.useEffect(() => {\n if (!running || !greet || greeted.current) return;\n greeted.current = true;\n const timers: ReturnType<typeof setTimeout>[] = [];\n order.forEach((index, n) => {\n timers.push(\n setTimeout(() => setPoked((p) => ({ ...p, [index]: true })), n * GREET_STEP_MS),\n setTimeout(() => setPoked((p) => ({ ...p, [index]: false })), n * GREET_STEP_MS + POKE_MS),\n );\n });\n return () => timers.forEach(clearTimeout);\n }, [running, greet, order]);\n\n // The bird the page points at looks up and jumps.\n React.useEffect(() => {\n const index = active ? birds.findIndex((b) => b.bird === active) : -1;\n if (!running || index < 0) return;\n const start = setTimeout(() => {\n look(index, \"up\");\n setPoked((p) => ({ ...p, [index]: true }));\n }, 0);\n const t = setTimeout(() => setPoked((p) => ({ ...p, [index]: false })), POKE_MS);\n return () => {\n clearTimeout(start);\n clearTimeout(t);\n setPoked((p) => ({ ...p, [index]: false }));\n rest(index);\n };\n }, [active, running, birds, look, rest]);\n\n // A bird looks up when you come near, and jumps when you tap it.\n const hover = (index: number, event: React.PointerEvent) => {\n if (!running || !react || event.pointerType !== \"mouse\") return;\n look(index, \"up\");\n };\n const leave = (index: number) => {\n if (!react) return;\n rest(index);\n };\n const tap = (index: number) => {\n if (!running || !react) return;\n look(index, \"up\");\n setPoked((p) => ({ ...p, [index]: true }));\n setTimeout(() => {\n setPoked((p) => ({ ...p, [index]: false }));\n rest(index);\n }, LOOK_BACK_MS);\n };\n\n return (\n <div\n ref={stage}\n aria-hidden\n data-flock=\"\"\n data-running={running ? \"\" : undefined}\n data-motion-scope=\"\"\n className={cn(\"relative w-full\", className)}\n style={{ aspectRatio: String(ratio), containerType: \"inline-size\", ...style }}\n {...props}\n >\n {birds.map((b, i) => (\n <div\n key={`${b.bird}-${i}`}\n ref={(el) => {\n bodies.current[i] = el;\n }}\n data-flock-bird={b.bird}\n className=\"absolute touch-manipulation\"\n style={{ left: `${b.x - b.size / 2}%`, width: `${b.size}%`, top: `calc(${b.y}% - ${b.size * 0.9}cqw)`, aspectRatio: \"1\", pointerEvents: react ? \"auto\" : \"none\" }}\n onPointerEnter={(event) => hover(i, event)}\n onPointerLeave={() => leave(i)}\n onPointerDown={() => tap(i)}\n >\n <Mascot\n bird={b.bird}\n tone={tone}\n life\n look={looks[i]}\n flying={flying?.index === i}\n bank={flying?.index === i ? flying.bank : 0}\n poked={poked[i]}\n carrying={!empty[i]}\n size={120}\n style={{ width: \"100%\", height: \"100%\", display: \"block\", overflow: \"visible\" }}\n />\n {shown\n .filter((x) => x.at === i)\n .map((x) => (\n <Prop key={x.id} shown={x} size={b.size} />\n ))}\n </div>\n ))}\n </div>\n );\n}\n","\"use client\";\n\n// The flock's scenes: what a bird does between the idle motions, each one true to the promise it carries — the owl reads\n// (a book, a leaf turned), the flamingo and the lovebird answer (a speech mark, a reply), the crane steps and bows, the\n// beaver carries a log and taps it, the magpie spots a shiny point and takes it, the duck builds, the falcon scans — and the\n// pigeon's parcel changes hands: the receiver reacts in its own way. A director picks one beat at a time from what the\n// flock holds, with chance in the waits and in the choice, so it never loops the same minute twice. Transform and opacity\n// only (Web Animations on a few small elements, timers between beats); nothing runs off screen or under reduced motion.\nimport * as React from \"react\";\n\nimport type { MascotBird, MascotLook } from \"../mascots\";\nimport { PARCEL } from \"../mascots/geometry\";\n\nexport type PropKind = \"say\" | \"book\" | \"log\" | \"glint\" | \"gift\";\n\n/** A small thing a bird shows for a while: a speech mark, a book, a log, a shiny point, a parcel. */\nexport interface Shown {\n id: number;\n /** Index of the bird it belongs to. */\n at: number;\n kind: PropKind;\n /** How long it stays (ms). */\n ms: number;\n /** The mark of a speech bubble. */\n mark?: string;\n /** Which side it comes from (1: right, -1: left). */\n side?: 1 | -1;\n}\n\n/** What a beat can do on the stage (built by `Flock`; every wait ends when the flock stops). */\nexport interface Stage {\n birds: readonly { bird: MascotBird; x: number; y: number; size: number }[];\n /** Indexes left to right. */\n order: readonly number[];\n random: () => number;\n look: (index: number, to: MascotLook) => void;\n rest: (...indexes: number[]) => void;\n poke: (index: number, ms?: number) => void;\n say: (index: number, mark: string, ms: number) => void;\n show: (index: number, kind: PropKind, ms: number, side?: 1 | -1) => void;\n /** Move a bird's body for a while (transform only). */\n move: (index: number, keyframes: Keyframe[], ms: number) => Promise<void>;\n wait: (ms: number) => Promise<void>;\n}\n\nconst side = (s: Stage, i: number, j: number): 1 | -1 => (s.birds[j]!.x >= s.birds[i]!.x ? 1 : -1);\nconst towards = (s: Stage, from: number, to: number): MascotLook => (side(s, from, to) > 0 ? \"right\" : \"left\");\n/** Where a bird is among its neighbours, left to right: the one beside it (the nearer one when there are two). */\nexport function neighbourOf(s: Stage, i: number): number | null {\n const at = s.order.indexOf(i);\n const near = [s.order[at - 1], s.order[at + 1]].filter((n): n is number => n !== undefined);\n if (!near.length) return null;\n const gap = (n: number) => Math.abs(s.birds[n]!.x - s.birds[i]!.x);\n return near.reduce((a, b) => (gap(a) <= gap(b) ? a : b), near[0]!);\n}\n\n// @fixed: the choreography's pace — how long each beat lasts. A rhythm to the eye, not a business parameter.\nconst BOOK_MS = 4800;\nconst LOG_MS = 3800;\nconst GLINT_MS = 3400;\nconst SAY_MS = 1500;\n\n/** The owl reads: it looks down at its book, a leaf turns, and it turns another. A neighbour glances over. */\nasync function read(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n s.look(i, \"left\");\n s.show(i, \"book\", BOOK_MS);\n await s.wait(BOOK_MS * 0.45);\n if (j !== null && s.random() < 0.5) {\n s.look(j, towards(s, j, i));\n await s.wait(1100);\n s.rest(j);\n }\n await s.wait(BOOK_MS * 0.5);\n s.rest(i);\n}\n\n/** The flamingo or the lovebird speaks; its neighbour listens, then answers, and they both light up. */\nasync function chat(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n s.look(i, j === null ? \"up\" : towards(s, i, j));\n s.say(i, \"…\", SAY_MS);\n await s.wait(SAY_MS * 0.6);\n if (j === null) {\n await s.wait(SAY_MS * 0.6);\n s.rest(i);\n return;\n }\n s.look(j, towards(s, j, i));\n await s.wait(SAY_MS * 0.7);\n s.say(j, s.random() < 0.5 ? \"!\" : \"?\", SAY_MS);\n s.poke(j);\n await s.wait(SAY_MS * 0.5);\n s.poke(i);\n await s.wait(SAY_MS * 0.7);\n s.rest(i, j);\n}\n\n/** The crane steps out of the line, bows to its neighbour, and steps back. */\nasync function bow(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n const dir = j === null ? 1 : side(s, i, j);\n const step = `${(s.birds[i]!.size * 0.14 * dir).toFixed(2)}cqw`;\n const lean = `rotate(${dir * 11}deg)`;\n const at = (x: string, r: string) => `translateX(${x}) ${r}`;\n const run = s.move(\n i,\n [\n { transform: at(\"0cqw\", \"rotate(0deg)\"), easing: \"ease-in-out\" },\n { transform: at(step, \"rotate(0deg)\"), offset: 0.22, easing: \"ease-in-out\" },\n { transform: at(step, lean), offset: 0.42, easing: \"ease-in-out\" },\n { transform: at(step, lean), offset: 0.6, easing: \"ease-in-out\" },\n { transform: at(step, \"rotate(0deg)\"), offset: 0.74, easing: \"ease-in-out\" },\n { transform: at(\"0cqw\", \"rotate(0deg)\") },\n ],\n 3800,\n );\n if (j !== null) {\n await s.wait(1700);\n s.look(j, towards(s, j, i));\n await s.wait(1200);\n s.poke(j);\n await s.wait(500);\n s.rest(j);\n }\n await run;\n}\n\n/** The beaver brings a log, taps it into place three times, and takes it away. */\nasync function tap(s: Stage, i: number) {\n s.show(i, \"log\", LOG_MS, s.birds[i]!.x > 50 ? 1 : -1);\n await s.wait(LOG_MS * 0.3);\n for (let n = 0; n < 3; n++) {\n s.poke(i, 420);\n await s.wait(520);\n }\n await s.wait(LOG_MS * 0.3);\n}\n\n/** The magpie sees something shiny on the ground, looks, hops, and takes it. */\nasync function shine(s: Stage, i: number) {\n const dir: 1 | -1 = s.birds[i]!.x > 50 ? -1 : 1;\n const to: MascotLook = dir > 0 ? \"right\" : \"left\";\n s.show(i, \"glint\", GLINT_MS, dir);\n await s.wait(GLINT_MS * 0.28);\n s.look(i, to);\n await s.wait(GLINT_MS * 0.3);\n s.poke(i);\n await s.wait(GLINT_MS * 0.25);\n s.look(i, \"up\");\n await s.wait(GLINT_MS * 0.2);\n s.rest(i);\n}\n\n/** The duck builds: quick nods in a burst, like typing a block into place. */\nasync function build(s: Stage, i: number) {\n for (let n = 0; n < 4; n++) {\n s.poke(i, 300);\n await s.wait(380);\n }\n}\n\n/** The falcon watches: a slow scan, left then right, and a look up. */\nasync function scan(s: Stage, i: number) {\n for (const to of [\"left\", \"up\", \"right\"] as const) {\n s.look(i, to);\n await s.wait(1100);\n }\n s.rest(i);\n}\n\n/** The pigeon's parcel has just been handed over: the receiver reacts in its own way (about 2 s). */\nexport async function receive(s: Stage, i: number, from: number) {\n const bird = s.birds[i]!.bird;\n s.look(i, towards(s, i, from));\n s.show(i, \"gift\", 2400);\n await s.wait(350);\n if (bird === \"crane\") await bow(s, i);\n else if (bird === \"magpie\") {\n s.poke(i);\n await s.wait(700);\n s.show(i, \"glint\", GLINT_MS * 0.6, side(s, i, from));\n await s.wait(1200);\n } else if (bird === \"beaver\" || bird === \"duck\") {\n s.poke(i, 420);\n await s.wait(520);\n s.poke(i, 420);\n await s.wait(900);\n } else if (bird === \"owl\") {\n s.say(i, \"?\", SAY_MS);\n await s.wait(900);\n s.poke(i);\n await s.wait(700);\n } else {\n s.say(i, \"!\", SAY_MS);\n s.poke(i);\n await s.wait(1500);\n }\n}\n\nexport interface Beat {\n id: string;\n bird: MascotBird;\n run: (s: Stage, index: number) => Promise<void>;\n}\n\n/** What each bird of the flock can do on its own (the pigeon's trip is the flock's courier). */\nexport const BEATS: readonly Beat[] = [\n { id: \"read\", bird: \"owl\", run: read },\n { id: \"chat\", bird: \"flamingo\", run: chat },\n { id: \"chat\", bird: \"lovebird\", run: chat },\n { id: \"bow\", bird: \"crane\", run: bow },\n { id: \"tap\", bird: \"beaver\", run: tap },\n { id: \"shine\", bird: \"magpie\", run: shine },\n { id: \"build\", bird: \"duck\", run: build },\n { id: \"scan\", bird: \"falcon\", run: scan },\n];\n\n// ─── The small things a bird shows ───────────────────────────────────────────────────────────────\n\nconst PAPER = \"var(--kz-surface-1)\";\nconst INK = \"var(--kz-text-primary)\";\nconst LINE = \"var(--kz-border-strong, currentColor)\";\n\n/** One thing, in its own frame: it comes in, stays for `ms`, and goes (opacity and transform only). */\nfunction lifeFrames(from: string, to: string): Keyframe[] {\n return [\n { opacity: 0, transform: from, offset: 0 },\n { opacity: 1, transform: \"none\", offset: 0.14 },\n { opacity: 1, transform: \"none\", offset: 0.84 },\n { opacity: 0, transform: to, offset: 1 },\n ];\n}\n\nconst LEAF: Keyframe[] = [\n { transform: \"scaleX(1)\", offset: 0 },\n { transform: \"scaleX(1)\", offset: 0.25 },\n { transform: \"scaleX(-1)\", offset: 0.38 },\n { transform: \"scaleX(1)\", offset: 0.39 },\n { transform: \"scaleX(1)\", offset: 0.62 },\n { transform: \"scaleX(-1)\", offset: 0.75 },\n { transform: \"scaleX(-1)\", offset: 1 },\n];\n\nexport function Prop({ shown, size }: Readonly<{ shown: Shown; size: number }>) {\n const ref = React.useRef<HTMLDivElement>(null);\n const leaf = React.useRef<HTMLDivElement>(null);\n const dir = shown.side ?? 1;\n React.useEffect(() => {\n const el = ref.current;\n if (!el || typeof el.animate !== \"function\") return;\n const from: Record<PropKind, [string, string]> = {\n say: [\"translateY(30%) scale(.5)\", \"translateY(-12%) scale(.9)\"],\n book: [\"translateY(40%) scale(.8)\", \"translateY(20%) scale(.9)\"],\n log: [`translateX(${190 * dir}%)`, `translateX(${190 * dir}%)`],\n glint: [\"scale(.2) rotate(-60deg)\", `translate(${-90 * dir}%, -170%) scale(.2) rotate(60deg)`],\n gift: [\"translateY(40%) scale(.3)\", \"translateY(-30%) scale(1.4)\"],\n };\n const [a, b] = from[shown.kind];\n const animations = [el.animate(lifeFrames(a, b), { duration: shown.ms, fill: \"both\", easing: \"ease-out\" })];\n if (shown.kind === \"book\" && leaf.current) animations.push(leaf.current.animate(LEAF, { duration: shown.ms, fill: \"both\", easing: \"ease-in-out\" }));\n if (shown.kind === \"glint\") animations.push(el.firstElementChild!.animate([{ transform: \"scale(1)\" }, { transform: \"scale(1.35)\" }, { transform: \"scale(1)\" }], { duration: 700, iterations: Math.ceil(shown.ms / 700), easing: \"ease-in-out\" }));\n return () => animations.forEach((x) => x.cancel());\n }, [shown, dir]);\n\n const unit = (n: number) => `calc(${size}cqw * ${n})`;\n const base: React.CSSProperties = { position: \"absolute\", pointerEvents: \"none\", opacity: 0 };\n\n if (shown.kind === \"say\")\n return (\n <div ref={ref} data-flock-prop=\"say\" style={{ ...base, left: \"58%\", top: \"-6%\", width: unit(0.34), height: unit(0.24), transformOrigin: \"20% 100%\" }}>\n <span\n style={{ position: \"absolute\", inset: 0, display: \"grid\", placeItems: \"center\", background: PAPER, border: `1.5px solid ${LINE}`, borderRadius: \"999px\", color: INK, font: `600 ${unit(0.17)}/1 var(--font-mono, ui-monospace, monospace)` }}\n >\n {shown.mark ?? \"…\"}\n </span>\n <span style={{ position: \"absolute\", left: \"14%\", bottom: \"-12%\", width: unit(0.07), height: unit(0.07), background: PAPER, borderRight: `1.5px solid ${LINE}`, borderBottom: `1.5px solid ${LINE}`, transform: \"rotate(45deg)\" }} />\n </div>\n );\n\n if (shown.kind === \"book\")\n return (\n <div ref={ref} data-flock-prop=\"book\" style={{ ...base, left: \"17%\", bottom: \"-2%\", width: \"66%\", height: unit(0.2), transformOrigin: \"50% 100%\" }}>\n {[0, 1].map((n) => (\n <span key={n} style={{ position: \"absolute\", top: 0, bottom: 0, [n ? \"right\" : \"left\"]: 0, width: \"50%\", background: `repeating-linear-gradient(${PAPER} 0 18%, ${LINE} 18% 24%)`, border: `1.5px solid ${LINE}`, borderRadius: n ? \"0 3px 3px 0\" : \"3px 0 0 3px\" }} />\n ))}\n <div ref={leaf} style={{ position: \"absolute\", top: 0, bottom: 0, left: \"50%\", width: \"50%\", transformOrigin: \"0 50%\", background: PAPER, border: `1.5px solid ${LINE}`, borderRadius: \"0 3px 3px 0\" }} />\n </div>\n );\n\n if (shown.kind === \"log\")\n return (\n <div ref={ref} data-flock-prop=\"log\" style={{ ...base, left: \"22%\", bottom: \"-3%\", width: \"56%\", height: unit(0.17), background: PARCEL[2], borderRadius: \"999px\", boxShadow: `inset -${unit(0.04)} 0 0 ${PARCEL[1]}` }}>\n <span style={{ position: \"absolute\", left: 0, top: 0, bottom: 0, aspectRatio: \"1\", borderRadius: \"50%\", background: `radial-gradient(${PARCEL[0]} 0 25%, ${PARCEL[1]} 26% 55%, ${PARCEL[2]} 56%)`, border: `1px solid ${PARCEL[2]}` }} />\n </div>\n );\n\n if (shown.kind === \"glint\")\n return (\n <div ref={ref} data-flock-prop=\"glint\" style={{ ...base, [dir > 0 ? \"left\" : \"right\"]: \"94%\", bottom: \"2%\", width: unit(0.2), height: unit(0.2) }}>\n <span style={{ position: \"absolute\", inset: 0, background: PARCEL[0], clipPath: \"polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%)\" }} />\n </div>\n );\n\n return (\n <div ref={ref} data-flock-prop=\"gift\" style={{ ...base, left: \"58%\", top: \"2%\", width: unit(0.26), height: unit(0.22), background: PARCEL[0], border: `1.5px solid ${PARCEL[2]}`, borderRadius: 2 }}>\n <span style={{ position: \"absolute\", left: \"44%\", top: 0, bottom: 0, width: \"12%\", background: PARCEL[2] }} />\n <span style={{ position: \"absolute\", top: \"42%\", left: 0, right: 0, height: \"16%\", background: PARCEL[2] }} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAMA,YAAYA,YAAW;;;ACEvB,YAAY,WAAW;AAsQjB,SACE,KADF;AAjON,IAAM,OAAO,CAAC,GAAU,GAAW,MAAuB,EAAE,MAAM,CAAC,EAAG,KAAK,EAAE,MAAM,CAAC,EAAG,IAAI,IAAI;AAC/F,IAAM,UAAU,CAAC,GAAU,MAAc,OAA4B,KAAK,GAAG,MAAM,EAAE,IAAI,IAAI,UAAU;AAEhG,SAAS,YAAY,GAAU,GAA0B;AAC9D,QAAM,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5B,QAAM,OAAO,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,MAAmB,MAAM,MAAS;AAC1F,MAAI,CAAC,KAAK,OAAQ,QAAO;AACzB,QAAM,MAAM,CAAC,MAAc,KAAK,IAAI,EAAE,MAAM,CAAC,EAAG,IAAI,EAAE,MAAM,CAAC,EAAG,CAAC;AACjE,SA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K,OAAO,GAAG,EAAE,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,aAAa,KAAK,eAAe,QAAQ,SAAS,OAAO;AAAA,UAChK,gBAAgB,CAAC,UAAU,MAAM,GAAG,KAAK;AAAA,UACzC,gBAAgB,MAAM,MAAM,CAAC;AAAA,UAC7B,eAAe,MAAME,KAAI,CAAC;AAAA,UAE1B;AAAA,4BAAAH;AAAA,cAAC;AAAA;AAAA,gBACC,MAAM,EAAE;AAAA,gBACR;AAAA,gBACA,MAAI;AAAA,gBACJ,MAAM,MAAM,CAAC;AAAA,gBACb,QAAQ,QAAQ,UAAU;AAAA,gBAC1B,MAAM,QAAQ,UAAU,IAAI,OAAO,OAAO;AAAA,gBAC1C,OAAO,MAAM,CAAC;AAAA,gBACd,UAAU,CAAC,MAAM,CAAC;AAAA,gBAClB,MAAM;AAAA,gBACN,OAAO,EAAE,OAAO,QAAQ,QAAQ,QAAQ,SAAS,SAAS,UAAU,UAAU;AAAA;AAAA,YAChF;AAAA,YACC,MACE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EACxB,IAAI,CAAC,MACJ,gBAAAA,KAAC,QAAgB,OAAO,GAAG,MAAM,EAAE,QAAxB,EAAE,EAA4B,CAC1C;AAAA;AAAA;AAAA,QA3BE,GAAG,EAAE,IAAI,IAAI,CAAC;AAAA,MA4BrB,CACD;AAAA;AAAA,EACH;AAEJ;","names":["React","jsx","jsxs","side","tap"]}
|
|
1
|
+
{"version":3,"sources":["../src/flock/flock.tsx","../src/flock/scenes.tsx"],"sourcesContent":["\"use client\";\n\n// The flock, alive: birds standing on a stage, each at ease in character (Mascot `life`), and the moments between\n// them — two birds glance at each other, the pigeon carries its parcel across, a bird looks up when you come near or tap\n// it. Transform and opacity only: CSS for each bird's own life, a timer for the moments (no frame loop), and nothing at\n// all when the flock is off screen, the tab is hidden or the person asked for less motion.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport type { MascotBird, MascotLook } from \"../mascots\";\nimport { Mascot } from \"../mascots\";\nimport { BEATS, neighbourOf, Prop, receive, type Shown, type Stage } from \"./scenes\";\n\nexport interface FlockBird {\n /** Which bird. */\n bird: MascotBird;\n /** Where its feet are, across the stage: 0 to 100 (% of the stage's width). */\n x: number;\n /** Where its feet are, down the stage: 0 to 100 (% of the stage's height). */\n y: number;\n /** How wide it is: % of the stage's width. */\n size: number;\n}\n\nexport interface FlockMoments {\n /** Two neighbours look at each other now and then. Default `true`. */\n glance?: boolean;\n /** The pigeon, when the flock has one, carries its parcel across to another bird and comes back. Default `true`. */\n courier?: boolean;\n /** A bird looks up when the pointer comes near, and jumps a little when tapped. Default `true`. */\n react?: boolean;\n /**\n * Scenes, true to each bird's promise: the owl reads a book, the flamingo and the lovebird talk with a speech mark, the\n * crane steps and bows, the beaver taps a log, the magpie takes a shiny point, the duck builds, the falcon scans — and the\n * pigeon hands its parcel over, which the receiver opens in its own way. One at a time, at random. Default `false`.\n */\n scenes?: boolean;\n}\n\nexport type FlockProps = Omit<React.ComponentProps<\"div\">, \"children\"> &\n FlockMoments & {\n /** The birds on the stage. */\n birds: readonly FlockBird[];\n /** The stage's shape, width over height (default 16 / 9). It keeps its ratio at any width, so the birds keep their places. */\n ratio?: number;\n /** The birds' colours: the host's accent (`brand`, default) or the Krizaka story's (`own`). */\n tone?: \"brand\" | \"own\";\n /** The source of chance (default `Math.random`): give it a fixed one in a test. */\n random?: () => number;\n /** How lively the moments are: 1 is calm (default), 2 doubles how often neighbours glance and the pigeon delivers. */\n tempo?: number;\n /** A bird the page points at (a product the reader is on): it looks up and jumps once each time it changes. */\n active?: MascotBird | null;\n /** The birds greet the reader once as the flock first comes into view: each jumps in turn, left to right. */\n greet?: boolean;\n };\n\n// @fixed: the rhythm of the moments — how long a glance lasts, how often one happens, how long a delivery takes. A\n// choreography's pace, not a business parameter.\nconst GLANCE_HOLD_MS = [1500, 2400] as const;\nconst GLANCE_EVERY_MS = [4200, 9000] as const;\nconst COURIER_FIRST_MS = 9000;\nconst COURIER_EVERY_MS = [26000, 38000] as const;\nconst FLIGHT_MS = 2600;\nconst HAND_OVER_MS = 1300;\nconst LOOK_BACK_MS = 1600;\n\nconst between = (random: () => number, [lo, hi]: readonly [number, number], tempo = 1) => (lo + random() * (hi - lo)) / tempo;\n// @fixed: the scenes' pace — the wait between two beats, and the rarer long pause.\nconst SCENE_EVERY_MS = [2600, 5200] as const;\nconst SCENE_PAUSE_MS = [8000, 12000] as const;\nconst GREET_STEP_MS = 110;\nconst POKE_MS = 700;\n\n/** `true` while the page may move: no reduced-motion request, the tab visible. */\nfunction useMayMove(): boolean {\n const [may, setMay] = React.useState(false);\n React.useEffect(() => {\n const query = globalThis.matchMedia(\"(prefers-reduced-motion: reduce)\");\n // The page settles first: `html[data-motion=\"settling\"]` (MotionObserver) holds every loop until it is `ready`.\n const settled = () => document.documentElement.getAttribute(\"data-motion\") !== \"settling\";\n const update = () => setMay(!query.matches && document.visibilityState !== \"hidden\" && settled());\n update();\n query.addEventListener(\"change\", update);\n document.addEventListener(\"visibilitychange\", update);\n const watch = typeof MutationObserver === \"undefined\" ? null : new MutationObserver(update);\n watch?.observe(document.documentElement, { attributes: true, attributeFilter: [\"data-motion\"] });\n return () => {\n query.removeEventListener(\"change\", update);\n document.removeEventListener(\"visibilitychange\", update);\n watch?.disconnect();\n };\n }, []);\n return may;\n}\n\n/** `true` while the element is on screen. */\nfunction useOnScreen(ref: React.RefObject<Element | null>): boolean {\n const [on, setOn] = React.useState(false);\n React.useEffect(() => {\n const el = ref.current;\n if (!el || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => setOn(Boolean(entry?.isIntersecting)), { threshold: 0.1 });\n observer.observe(el);\n return () => observer.disconnect();\n }, [ref]);\n return on;\n}\n\n/** The updater that drops one shown item (kept out of the component: it would nest the callbacks too deep). */\nconst without = (id: number) => (all: Shown[]) => all.filter((x) => x.id !== id);\n\n/**\n * The flock on its stage, alive. Decorative (`aria-hidden`): put the words beside it. Each bird idles in character; every\n * few seconds two neighbours glance at each other; every half minute the pigeon carries its parcel to another bird and\n * returns; a bird looks up when you come near. All of it pauses off screen and in a hidden tab, and the flock is still\n * under `prefers-reduced-motion`.\n */\nexport function Flock({ birds, ratio = 16 / 9, tone = \"brand\", glance = true, courier = true, react = true, scenes = false, random = Math.random, tempo = 1, active = null, greet = false, className, style, ...props }: Readonly<FlockProps>) {\n const stage = React.useRef<HTMLDivElement>(null);\n const bodies = React.useRef<(HTMLDivElement | null)[]>([]);\n const may = useMayMove();\n const onScreen = useOnScreen(stage);\n const running = may && onScreen;\n const [looks, setLooks] = React.useState<Record<number, MascotLook>>({});\n const [flying, setFlying] = React.useState<{ index: number; bank: number } | null>(null);\n const [poked, setPoked] = React.useState<Record<number, boolean>>({});\n const [shown, setShown] = React.useState<Shown[]>([]);\n const [empty, setEmpty] = React.useState<Record<number, boolean>>({});\n // Birds a scene holds (a glance or a trip leaves them alone), and the scene or the trip in progress.\n const held = React.useRef(new Set<number>());\n const busy = React.useRef<\"scene\" | \"trip\" | null>(null);\n const ids = React.useRef(0);\n\n // Left to right: a bird's neighbours are the birds beside it on the stage.\n const order = React.useMemo(() => birds.map((_, i) => i).sort((a, b) => birds[a]!.x - birds[b]!.x), [birds]);\n const look = React.useCallback((index: number, to: MascotLook) => setLooks((l) => (l[index] === to ? l : { ...l, [index]: to })), []);\n const rest = React.useCallback((...indexes: number[]) => setLooks((l) => Object.fromEntries(Object.entries(l).filter(([k]) => !indexes.includes(Number(k))))), []);\n\n // What a scene can do, bound to one run of an effect: every timer and animation it starts ends with the run.\n const stageFor = React.useCallback((run: { timers: Set<ReturnType<typeof setTimeout>>; anims: Set<Animation> }): Stage => {\n const later = (fn: () => void, ms: number) => {\n const t = setTimeout(() => {\n run.timers.delete(t);\n fn();\n }, ms);\n run.timers.add(t);\n };\n const poke = (index: number, ms = POKE_MS) => {\n setPoked((p) => ({ ...p, [index]: true }));\n later(() => setPoked((p) => ({ ...p, [index]: false })), ms);\n };\n const show = (index: number, kind: Shown[\"kind\"], ms: number, side?: 1 | -1, mark?: string) => {\n const item: Shown = { id: ++ids.current, at: index, kind, ms, side, mark };\n setShown((all) => [...all, item]);\n later(() => setShown(without(item.id)), ms);\n };\n return {\n birds,\n order,\n random,\n look,\n rest,\n poke,\n show,\n say: (index, mark, ms) => show(index, \"say\", ms, undefined, mark),\n wait: (ms) => new Promise<void>((resolve) => later(resolve, ms)),\n move: async (index, keyframes, ms) => {\n const el = bodies.current[index];\n if (!el || typeof el.animate !== \"function\") return;\n const animation = el.animate(keyframes, { duration: ms });\n run.anims.add(animation);\n await animation.finished.catch(() => undefined);\n run.anims.delete(animation);\n },\n };\n }, [birds, order, random, look, rest]);\n\n // Glances: two neighbours turn towards each other, hold, and look away.\n React.useEffect(() => {\n if (!running || !glance || order.length < 2) return;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let back: ReturnType<typeof setTimeout> | undefined;\n const next = () => {\n timer = setTimeout(() => {\n const at = Math.floor(random() * (order.length - 1));\n const [a, b] = [order[at]!, order[at + 1]!];\n if (held.current.has(a) || held.current.has(b)) return next();\n look(a, \"right\");\n look(b, \"left\");\n back = setTimeout(() => {\n rest(a, b);\n next();\n }, between(random, GLANCE_HOLD_MS));\n }, between(random, GLANCE_EVERY_MS, tempo));\n };\n next();\n return () => {\n clearTimeout(timer);\n clearTimeout(back);\n };\n }, [running, glance, order, random, tempo, look, rest]);\n\n // The delivery: the pigeon takes its parcel across to the farthest bird, hands it over, and flies back.\n React.useEffect(() => {\n const pigeon = birds.findIndex((b) => b.bird === \"pigeon\");\n if (!running || !courier || pigeon < 0 || birds.length < 2) return;\n let alive = true;\n const heldNow = held.current;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let animation: Animation | undefined;\n const run = { timers: new Set<ReturnType<typeof setTimeout>>(), anims: new Set<Animation>() };\n // The farthest bird from the pigeon, so the parcel crosses the whole stage.\n const from = birds[pigeon]!;\n const target = birds.reduce((far, b, i) => (i !== pigeon && Math.abs(b.x - from.x) > Math.abs(birds[far]!.x - from.x) ? i : far), pigeon === 0 ? 1 : 0);\n const wait = (ms: number) => new Promise<void>((resolve) => (timer = setTimeout(resolve, ms)));\n const trip = async () => {\n // With scenes, the trip waits for the beat in progress and holds the stage while it lasts.\n while (alive && scenes && busy.current === \"scene\") await wait(400);\n if (!alive) return;\n busy.current = \"trip\";\n const el = bodies.current[pigeon];\n const box = stage.current?.getBoundingClientRect();\n if (!el || !box || typeof el.animate !== \"function\") return;\n const to = birds[target]!;\n const side = to.x > from.x ? 1 : -1;\n // It lands beside the receiver, not on it.\n const dx = ((to.x - from.x) / 100) * box.width - side * (to.size / 100) * box.width * 0.55;\n const lift = (from.size / 100) * box.width * 0.35;\n const fly = async (fromX: number, toX: number) => {\n setFlying({ index: pigeon, bank: Math.sign(toX - fromX) });\n animation = el.animate(\n [\n { transform: `translate(${fromX}px, 0)`, easing: \"ease-out\" },\n { transform: `translate(${(fromX + toX) / 2}px, ${-lift}px)`, easing: \"ease-in\", offset: 0.5 },\n { transform: `translate(${toX}px, 0)` },\n ],\n { duration: FLIGHT_MS, fill: \"forwards\" },\n );\n await animation.finished.catch(() => undefined);\n setFlying(null);\n };\n look(target, side > 0 ? \"left\" : \"right\");\n held.current.add(target);\n await fly(0, dx);\n if (!alive) return;\n // The hand-over: the receiver looks at the pigeon, the pigeon hops on the doorstep.\n setPoked((p) => ({ ...p, [pigeon]: true }));\n if (scenes) {\n // …and the parcel changes hands: the receiver takes it and reacts in character, the pigeon flies back light.\n setEmpty((e) => ({ ...e, [pigeon]: true }));\n const reaction = receive(stageFor(run), target, pigeon);\n await wait(HAND_OVER_MS);\n if (!alive) return;\n setPoked((p) => ({ ...p, [pigeon]: false }));\n await reaction;\n } else {\n await wait(HAND_OVER_MS);\n if (!alive) return;\n setPoked((p) => ({ ...p, [pigeon]: false }));\n }\n if (!alive) return;\n look(target, \"up\");\n await fly(dx, 0);\n animation?.cancel();\n setEmpty((e) => ({ ...e, [pigeon]: false }));\n rest(target);\n };\n const schedule = (ms: number) => {\n timer = setTimeout(async () => {\n await trip();\n busy.current = null;\n held.current.delete(target);\n if (alive) schedule(between(random, COURIER_EVERY_MS, tempo));\n }, ms);\n };\n schedule(COURIER_FIRST_MS / tempo);\n return () => {\n alive = false;\n clearTimeout(timer);\n animation?.cancel();\n run.timers.forEach(clearTimeout);\n run.anims.forEach((a) => a.cancel());\n if (scenes) {\n setShown([]);\n setEmpty({});\n heldNow.clear();\n busy.current = null;\n }\n setFlying(null);\n };\n }, [running, courier, birds, random, tempo, scenes, stageFor, look, rest]);\n\n // The scenes: one beat at a time, picked at random from what the flock holds — never the same bird twice in a row, never\n // at a regular beat (short waits, now and then a long pause) — so the minute is never the same twice.\n React.useEffect(() => {\n if (!running || !scenes || birds.length < 1) return;\n let alive = true;\n const heldNow = held.current;\n const run = { timers: new Set<ReturnType<typeof setTimeout>>(), anims: new Set<Animation>() };\n const st = stageFor(run);\n const beats = BEATS.flatMap((beat) => birds.flatMap((b, i) => (b.bird === beat.bird ? [{ beat, index: i }] : [])));\n if (!beats.length) return;\n let last = -1;\n const next = async () => {\n const long = random() < 0.2;\n await st.wait(between(random, long ? SCENE_PAUSE_MS : SCENE_EVERY_MS, tempo));\n while (alive && busy.current === \"trip\") await st.wait(600);\n if (!alive) return;\n const pool = beats.filter((x) => x.index !== last);\n const pick = (pool.length ? pool : beats)[Math.floor(random() * (pool.length ? pool.length : beats.length))]!;\n last = pick.index;\n busy.current = \"scene\";\n // The scene's birds are held, so no glance cuts across it.\n const near = neighbourOf(st, pick.index);\n held.current.add(pick.index);\n if (near !== null) held.current.add(near);\n await pick.beat.run(st, pick.index);\n held.current.delete(pick.index);\n if (near !== null) held.current.delete(near);\n if (busy.current === \"scene\") busy.current = null;\n if (alive) void next();\n };\n void next();\n return () => {\n alive = false;\n run.timers.forEach(clearTimeout);\n run.anims.forEach((a) => a.cancel());\n setShown([]);\n heldNow.clear();\n busy.current = null;\n };\n }, [running, scenes, birds, random, tempo, stageFor]);\n\n // The greeting: the first time the flock is on screen, each bird jumps in turn.\n const greeted = React.useRef(false);\n React.useEffect(() => {\n if (!running || !greet || greeted.current) return;\n greeted.current = true;\n const timers: ReturnType<typeof setTimeout>[] = [];\n order.forEach((index, n) => {\n timers.push(\n setTimeout(() => setPoked((p) => ({ ...p, [index]: true })), n * GREET_STEP_MS),\n setTimeout(() => setPoked((p) => ({ ...p, [index]: false })), n * GREET_STEP_MS + POKE_MS),\n );\n });\n return () => timers.forEach(clearTimeout);\n }, [running, greet, order]);\n\n // The bird the page points at looks up and jumps.\n React.useEffect(() => {\n const index = active ? birds.findIndex((b) => b.bird === active) : -1;\n if (!running || index < 0) return;\n const start = setTimeout(() => {\n look(index, \"up\");\n setPoked((p) => ({ ...p, [index]: true }));\n }, 0);\n const t = setTimeout(() => setPoked((p) => ({ ...p, [index]: false })), POKE_MS);\n return () => {\n clearTimeout(start);\n clearTimeout(t);\n setPoked((p) => ({ ...p, [index]: false }));\n rest(index);\n };\n }, [active, running, birds, look, rest]);\n\n // A bird looks up when you come near, and jumps when you tap it.\n const hover = (index: number, event: React.PointerEvent) => {\n if (!running || !react || event.pointerType !== \"mouse\") return;\n look(index, \"up\");\n };\n const leave = (index: number) => {\n if (!react) return;\n rest(index);\n };\n const tap = (index: number) => {\n if (!running || !react) return;\n look(index, \"up\");\n setPoked((p) => ({ ...p, [index]: true }));\n setTimeout(() => {\n setPoked((p) => ({ ...p, [index]: false }));\n rest(index);\n }, LOOK_BACK_MS);\n };\n\n return (\n <div\n ref={stage}\n aria-hidden\n data-flock=\"\"\n data-running={running ? \"\" : undefined}\n data-motion-scope=\"\"\n className={cn(\"relative w-full\", className)}\n style={{ aspectRatio: String(ratio), containerType: \"inline-size\", ...style }}\n {...props}\n >\n {birds.map((b, i) => (\n <div\n key={`${b.bird}-${i}`}\n ref={(el) => {\n bodies.current[i] = el;\n }}\n data-flock-bird={b.bird}\n className=\"absolute touch-manipulation\"\n style={{ left: `${b.x - b.size / 2}%`, width: `${b.size}%`, top: `calc(${b.y}% - ${b.size * 0.9}cqw)`, aspectRatio: \"1\", pointerEvents: react ? \"auto\" : \"none\" }}\n onPointerEnter={(event) => hover(i, event)}\n onPointerLeave={() => leave(i)}\n onPointerDown={() => tap(i)}\n >\n <Mascot\n bird={b.bird}\n tone={tone}\n life\n look={looks[i]}\n flying={flying?.index === i}\n bank={flying?.index === i ? flying.bank : 0}\n poked={poked[i]}\n carrying={!empty[i]}\n size={120}\n style={{ width: \"100%\", height: \"100%\", display: \"block\", overflow: \"visible\" }}\n />\n {shown\n .filter((x) => x.at === i)\n .map((x) => (\n <Prop key={x.id} shown={x} size={b.size} />\n ))}\n </div>\n ))}\n </div>\n );\n}\n","\"use client\";\n\n// The flock's scenes: what a bird does between the idle motions, each one true to the promise it carries — the owl reads\n// (a book, a leaf turned), the flamingo and the lovebird answer (a speech mark, a reply), the crane steps and bows, the\n// beaver carries a log and taps it, the magpie spots a shiny point and takes it, the duck builds, the falcon scans — and the\n// pigeon's parcel changes hands: the receiver reacts in its own way. A director picks one beat at a time from what the\n// flock holds, with chance in the waits and in the choice, so it never loops the same minute twice. Transform and opacity\n// only (Web Animations on a few small elements, timers between beats); nothing runs off screen or under reduced motion.\nimport * as React from \"react\";\n\nimport type { MascotBird, MascotLook } from \"../mascots\";\nimport { PARCEL } from \"../mascots/geometry\";\n\nexport type PropKind = \"say\" | \"book\" | \"log\" | \"glint\" | \"gift\";\n\n/** A small thing a bird shows for a while: a speech mark, a book, a log, a shiny point, a parcel. */\nexport interface Shown {\n id: number;\n /** Index of the bird it belongs to. */\n at: number;\n kind: PropKind;\n /** How long it stays (ms). */\n ms: number;\n /** The mark of a speech bubble. */\n mark?: string;\n /** Which side it comes from (1: right, -1: left). */\n side?: 1 | -1;\n}\n\n/** What a beat can do on the stage (built by `Flock`; every wait ends when the flock stops). */\nexport interface Stage {\n birds: readonly { bird: MascotBird; x: number; y: number; size: number }[];\n /** Indexes left to right. */\n order: readonly number[];\n random: () => number;\n look: (index: number, to: MascotLook) => void;\n rest: (...indexes: number[]) => void;\n poke: (index: number, ms?: number) => void;\n say: (index: number, mark: string, ms: number) => void;\n show: (index: number, kind: PropKind, ms: number, side?: 1 | -1) => void;\n /** Move a bird's body for a while (transform only). */\n move: (index: number, keyframes: Keyframe[], ms: number) => Promise<void>;\n wait: (ms: number) => Promise<void>;\n}\n\nconst side = (s: Stage, i: number, j: number): 1 | -1 => (s.birds[j]!.x >= s.birds[i]!.x ? 1 : -1);\nconst towards = (s: Stage, from: number, to: number): MascotLook => (side(s, from, to) > 0 ? \"right\" : \"left\");\n/** Where a bird is among its neighbours, left to right: the one beside it (the nearer one when there are two). */\nexport function neighbourOf(s: Stage, i: number): number | null {\n const at = s.order.indexOf(i);\n const near = [s.order[at - 1], s.order[at + 1]].filter((n): n is number => n !== undefined);\n if (!near.length) return null;\n const gap = (n: number) => Math.abs(s.birds[n]!.x - s.birds[i]!.x);\n return near.reduce((a, b) => (gap(a) <= gap(b) ? a : b), near[0]!);\n}\n\n// @fixed: the choreography's pace — how long each beat lasts. A rhythm to the eye, not a business parameter.\nconst BOOK_MS = 4800;\nconst LOG_MS = 3800;\nconst GLINT_MS = 3400;\nconst SAY_MS = 1500;\n\n/** The owl reads: it looks down at its book, a leaf turns, and it turns another. A neighbour glances over. */\nasync function read(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n s.look(i, \"left\");\n s.show(i, \"book\", BOOK_MS);\n await s.wait(BOOK_MS * 0.45);\n if (j !== null && s.random() < 0.5) {\n s.look(j, towards(s, j, i));\n await s.wait(1100);\n s.rest(j);\n }\n await s.wait(BOOK_MS * 0.5);\n s.rest(i);\n}\n\n/** The flamingo or the lovebird speaks; its neighbour listens, then answers, and they both light up. */\nasync function chat(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n s.look(i, j === null ? \"up\" : towards(s, i, j));\n s.say(i, \"…\", SAY_MS);\n await s.wait(SAY_MS * 0.6);\n if (j === null) {\n await s.wait(SAY_MS * 0.6);\n s.rest(i);\n return;\n }\n s.look(j, towards(s, j, i));\n await s.wait(SAY_MS * 0.7);\n s.say(j, s.random() < 0.5 ? \"!\" : \"?\", SAY_MS);\n s.poke(j);\n await s.wait(SAY_MS * 0.5);\n s.poke(i);\n await s.wait(SAY_MS * 0.7);\n s.rest(i, j);\n}\n\n/** The crane steps out of the line, bows to its neighbour, and steps back. */\nasync function bow(s: Stage, i: number) {\n const j = neighbourOf(s, i);\n const dir = j === null ? 1 : side(s, i, j);\n const step = `${(s.birds[i]!.size * 0.14 * dir).toFixed(2)}cqw`;\n const lean = `rotate(${dir * 11}deg)`;\n const at = (x: string, r: string) => `translateX(${x}) ${r}`;\n const run = s.move(\n i,\n [\n { transform: at(\"0cqw\", \"rotate(0deg)\"), easing: \"ease-in-out\" },\n { transform: at(step, \"rotate(0deg)\"), offset: 0.22, easing: \"ease-in-out\" },\n { transform: at(step, lean), offset: 0.42, easing: \"ease-in-out\" },\n { transform: at(step, lean), offset: 0.6, easing: \"ease-in-out\" },\n { transform: at(step, \"rotate(0deg)\"), offset: 0.74, easing: \"ease-in-out\" },\n { transform: at(\"0cqw\", \"rotate(0deg)\") },\n ],\n 3800,\n );\n if (j !== null) {\n await s.wait(1700);\n s.look(j, towards(s, j, i));\n await s.wait(1200);\n s.poke(j);\n await s.wait(500);\n s.rest(j);\n }\n await run;\n}\n\n/** The beaver brings a log, taps it into place three times, and takes it away. */\nasync function tap(s: Stage, i: number) {\n s.show(i, \"log\", LOG_MS, s.birds[i]!.x > 50 ? 1 : -1);\n await s.wait(LOG_MS * 0.3);\n for (let n = 0; n < 3; n++) {\n s.poke(i, 420);\n await s.wait(520);\n }\n await s.wait(LOG_MS * 0.3);\n}\n\n/** The magpie sees something shiny on the ground, looks, hops, and takes it. */\nasync function shine(s: Stage, i: number) {\n const dir: 1 | -1 = s.birds[i]!.x > 50 ? -1 : 1;\n const to: MascotLook = dir > 0 ? \"right\" : \"left\";\n s.show(i, \"glint\", GLINT_MS, dir);\n await s.wait(GLINT_MS * 0.28);\n s.look(i, to);\n await s.wait(GLINT_MS * 0.3);\n s.poke(i);\n await s.wait(GLINT_MS * 0.25);\n s.look(i, \"up\");\n await s.wait(GLINT_MS * 0.2);\n s.rest(i);\n}\n\n/** The duck builds: quick nods in a burst, like typing a block into place. */\nasync function build(s: Stage, i: number) {\n for (let n = 0; n < 4; n++) {\n s.poke(i, 300);\n await s.wait(380);\n }\n}\n\n/** The falcon watches: a slow scan, left then right, and a look up. */\nasync function scan(s: Stage, i: number) {\n for (const to of [\"left\", \"up\", \"right\"] as const) {\n s.look(i, to);\n await s.wait(1100);\n }\n s.rest(i);\n}\n\n/** The pigeon's parcel has just been handed over: the receiver reacts in its own way (about 2 s). */\nexport async function receive(s: Stage, i: number, from: number) {\n const bird = s.birds[i]!.bird;\n s.look(i, towards(s, i, from));\n s.show(i, \"gift\", 2400);\n await s.wait(350);\n if (bird === \"crane\") await bow(s, i);\n else if (bird === \"magpie\") {\n s.poke(i);\n await s.wait(700);\n s.show(i, \"glint\", GLINT_MS * 0.6, side(s, i, from));\n await s.wait(1200);\n } else if (bird === \"beaver\" || bird === \"duck\") {\n s.poke(i, 420);\n await s.wait(520);\n s.poke(i, 420);\n await s.wait(900);\n } else if (bird === \"owl\") {\n s.say(i, \"?\", SAY_MS);\n await s.wait(900);\n s.poke(i);\n await s.wait(700);\n } else {\n s.say(i, \"!\", SAY_MS);\n s.poke(i);\n await s.wait(1500);\n }\n}\n\nexport interface Beat {\n id: string;\n bird: MascotBird;\n run: (s: Stage, index: number) => Promise<void>;\n}\n\n/** What each bird of the flock can do on its own (the pigeon's trip is the flock's courier). */\nexport const BEATS: readonly Beat[] = [\n { id: \"read\", bird: \"owl\", run: read },\n { id: \"chat\", bird: \"flamingo\", run: chat },\n { id: \"chat\", bird: \"lovebird\", run: chat },\n { id: \"bow\", bird: \"crane\", run: bow },\n { id: \"tap\", bird: \"beaver\", run: tap },\n { id: \"shine\", bird: \"magpie\", run: shine },\n { id: \"build\", bird: \"duck\", run: build },\n { id: \"scan\", bird: \"falcon\", run: scan },\n];\n\n// ─── The small things a bird shows ───────────────────────────────────────────────────────────────\n\nconst PAPER = \"var(--kz-surface-1)\";\nconst INK = \"var(--kz-text-primary)\";\nconst LINE = \"var(--kz-border-strong, currentColor)\";\n\n/** One thing, in its own frame: it comes in, stays for `ms`, and goes (opacity and transform only). */\nfunction lifeFrames(from: string, to: string): Keyframe[] {\n return [\n { opacity: 0, transform: from, offset: 0 },\n { opacity: 1, transform: \"none\", offset: 0.14 },\n { opacity: 1, transform: \"none\", offset: 0.84 },\n { opacity: 0, transform: to, offset: 1 },\n ];\n}\n\nconst LEAF: Keyframe[] = [\n { transform: \"scaleX(1)\", offset: 0 },\n { transform: \"scaleX(1)\", offset: 0.25 },\n { transform: \"scaleX(-1)\", offset: 0.38 },\n { transform: \"scaleX(1)\", offset: 0.39 },\n { transform: \"scaleX(1)\", offset: 0.62 },\n { transform: \"scaleX(-1)\", offset: 0.75 },\n { transform: \"scaleX(-1)\", offset: 1 },\n];\n\nexport function Prop({ shown, size }: Readonly<{ shown: Shown; size: number }>) {\n const ref = React.useRef<HTMLDivElement>(null);\n const leaf = React.useRef<HTMLDivElement>(null);\n const dir = shown.side ?? 1;\n React.useEffect(() => {\n const el = ref.current;\n if (!el || typeof el.animate !== \"function\") return;\n const from: Record<PropKind, [string, string]> = {\n say: [\"translateY(30%) scale(.5)\", \"translateY(-12%) scale(.9)\"],\n book: [\"translateY(40%) scale(.8)\", \"translateY(20%) scale(.9)\"],\n log: [`translateX(${190 * dir}%)`, `translateX(${190 * dir}%)`],\n glint: [\"scale(.2) rotate(-60deg)\", `translate(${-90 * dir}%, -170%) scale(.2) rotate(60deg)`],\n gift: [\"translateY(40%) scale(.3)\", \"translateY(-30%) scale(1.4)\"],\n };\n const [a, b] = from[shown.kind];\n const animations = [el.animate(lifeFrames(a, b), { duration: shown.ms, fill: \"both\", easing: \"ease-out\" })];\n if (shown.kind === \"book\" && leaf.current) animations.push(leaf.current.animate(LEAF, { duration: shown.ms, fill: \"both\", easing: \"ease-in-out\" }));\n if (shown.kind === \"glint\") animations.push(el.firstElementChild!.animate([{ transform: \"scale(1)\" }, { transform: \"scale(1.35)\" }, { transform: \"scale(1)\" }], { duration: 700, iterations: Math.ceil(shown.ms / 700), easing: \"ease-in-out\" }));\n return () => animations.forEach((x) => x.cancel());\n }, [shown, dir]);\n\n const unit = (n: number) => `calc(${size}cqw * ${n})`;\n const base: React.CSSProperties = { position: \"absolute\", pointerEvents: \"none\", opacity: 0 };\n\n if (shown.kind === \"say\")\n return (\n <div ref={ref} data-flock-prop=\"say\" style={{ ...base, left: \"58%\", top: \"-6%\", width: unit(0.34), height: unit(0.24), transformOrigin: \"20% 100%\" }}>\n <span\n style={{ position: \"absolute\", inset: 0, display: \"grid\", placeItems: \"center\", background: PAPER, border: `1.5px solid ${LINE}`, borderRadius: \"999px\", color: INK, font: `600 ${unit(0.17)}/1 var(--font-mono, ui-monospace, monospace)` }}\n >\n {shown.mark ?? \"…\"}\n </span>\n <span style={{ position: \"absolute\", left: \"14%\", bottom: \"-12%\", width: unit(0.07), height: unit(0.07), background: PAPER, borderRight: `1.5px solid ${LINE}`, borderBottom: `1.5px solid ${LINE}`, transform: \"rotate(45deg)\" }} />\n </div>\n );\n\n if (shown.kind === \"book\")\n return (\n <div ref={ref} data-flock-prop=\"book\" style={{ ...base, left: \"17%\", bottom: \"-2%\", width: \"66%\", height: unit(0.2), transformOrigin: \"50% 100%\" }}>\n {[0, 1].map((n) => (\n <span key={n} style={{ position: \"absolute\", top: 0, bottom: 0, [n ? \"right\" : \"left\"]: 0, width: \"50%\", background: `repeating-linear-gradient(${PAPER} 0 18%, ${LINE} 18% 24%)`, border: `1.5px solid ${LINE}`, borderRadius: n ? \"0 3px 3px 0\" : \"3px 0 0 3px\" }} />\n ))}\n <div ref={leaf} style={{ position: \"absolute\", top: 0, bottom: 0, left: \"50%\", width: \"50%\", transformOrigin: \"0 50%\", background: PAPER, border: `1.5px solid ${LINE}`, borderRadius: \"0 3px 3px 0\" }} />\n </div>\n );\n\n if (shown.kind === \"log\")\n return (\n <div ref={ref} data-flock-prop=\"log\" style={{ ...base, left: \"22%\", bottom: \"-3%\", width: \"56%\", height: unit(0.17), background: PARCEL[2], borderRadius: \"999px\", boxShadow: `inset -${unit(0.04)} 0 0 ${PARCEL[1]}` }}>\n <span style={{ position: \"absolute\", left: 0, top: 0, bottom: 0, aspectRatio: \"1\", borderRadius: \"50%\", background: `radial-gradient(${PARCEL[0]} 0 25%, ${PARCEL[1]} 26% 55%, ${PARCEL[2]} 56%)`, border: `1px solid ${PARCEL[2]}` }} />\n </div>\n );\n\n if (shown.kind === \"glint\")\n return (\n <div ref={ref} data-flock-prop=\"glint\" style={{ ...base, [dir > 0 ? \"left\" : \"right\"]: \"94%\", bottom: \"2%\", width: unit(0.2), height: unit(0.2) }}>\n <span style={{ position: \"absolute\", inset: 0, background: PARCEL[0], clipPath: \"polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%)\" }} />\n </div>\n );\n\n return (\n <div ref={ref} data-flock-prop=\"gift\" style={{ ...base, left: \"58%\", top: \"2%\", width: unit(0.26), height: unit(0.22), background: PARCEL[0], border: `1.5px solid ${PARCEL[2]}`, borderRadius: 2 }}>\n <span style={{ position: \"absolute\", left: \"44%\", top: 0, bottom: 0, width: \"12%\", background: PARCEL[2] }} />\n <span style={{ position: \"absolute\", top: \"42%\", left: 0, right: 0, height: \"16%\", background: PARCEL[2] }} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAMA,YAAYA,YAAW;;;ACEvB,YAAY,WAAW;AAsQjB,SACE,KADF;AAjON,IAAM,OAAO,CAAC,GAAU,GAAW,MAAuB,EAAE,MAAM,CAAC,EAAG,KAAK,EAAE,MAAM,CAAC,EAAG,IAAI,IAAI;AAC/F,IAAM,UAAU,CAAC,GAAU,MAAc,OAA4B,KAA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IAAI,CAAC;AAAA,MA4BrB,CACD;AAAA;AAAA,EACH;AAEJ;","names":["React","jsx","jsxs","side","tap"]}
|
package/dist/footnote.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ type CaptionProps = React.HTMLAttributes<HTMLElement> & {
|
|
|
7
7
|
as?: "figcaption" | "p";
|
|
8
8
|
};
|
|
9
9
|
/** A caption in the typewriter face: the figure's number, a dash, what it shows. */
|
|
10
|
-
declare function Caption({ figure, as: Tag, className, children, ...props }: CaptionProps): React.JSX.Element;
|
|
10
|
+
declare function Caption({ figure, as: Tag, className, children, ...props }: Readonly<CaptionProps>): React.JSX.Element;
|
|
11
11
|
type FootnoteRefProps = Omit<React.HTMLAttributes<HTMLElement>, "id"> & {
|
|
12
12
|
/** The note's number. */
|
|
13
13
|
n: number;
|
|
@@ -15,7 +15,7 @@ type FootnoteRefProps = Omit<React.HTMLAttributes<HTMLElement>, "id"> & {
|
|
|
15
15
|
prefix?: string;
|
|
16
16
|
};
|
|
17
17
|
/** The superscript number in the text, linked to its note (and the note's link back lands here). */
|
|
18
|
-
declare function FootnoteRef({ n, prefix, className, ...props }: FootnoteRefProps): React.JSX.Element;
|
|
18
|
+
declare function FootnoteRef({ n, prefix, className, ...props }: Readonly<FootnoteRefProps>): React.JSX.Element;
|
|
19
19
|
type FootnotesProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
20
20
|
/** The notes, in order: the first is note 1. */
|
|
21
21
|
notes: readonly React.ReactNode[];
|
|
@@ -27,7 +27,7 @@ type FootnotesProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
|
27
27
|
backLabel?: string;
|
|
28
28
|
};
|
|
29
29
|
/** The notes at the foot of a page: a short rule, numbered notes in small print, each with its way back to the text. */
|
|
30
|
-
declare function Footnotes({ notes, prefix, label, backLabel, className, ...props }: FootnotesProps): React.JSX.Element;
|
|
30
|
+
declare function Footnotes({ notes, prefix, label, backLabel, className, ...props }: Readonly<FootnotesProps>): React.JSX.Element;
|
|
31
31
|
|
|
32
32
|
export { Caption, FootnoteRef, Footnotes };
|
|
33
33
|
export type { CaptionProps, FootnoteRefProps, FootnotesProps };
|
package/dist/footnote.js
CHANGED
package/dist/footnote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/footnote/footnote.tsx"],"sourcesContent":["// Server-safe. The footnote and the caption of the Cahier (ADR-004, blocks.css): what a page says in small print. A\n// `Caption` names a figure (`fig. 2 — The owl reads every line`); a `FootnoteRef` is the superscript number in the text,\n// linked to its note; `Footnotes` lists the notes at the foot, each with its way back to the text.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type CaptionProps = React.HTMLAttributes<HTMLElement> & {\n /** The figure's number, typed before the text: `fig. 2`. */\n figure?: React.ReactNode;\n /** `figcaption` inside a `<figure>`, `p` elsewhere. @default \"figcaption\" */\n as?: \"figcaption\" | \"p\";\n};\n\n/** A caption in the typewriter face: the figure's number, a dash, what it shows. */\nexport function Caption({ figure, as: Tag = \"figcaption\", className, children, ...props }: CaptionProps) {\n return (\n <Tag className={cn(\"kz-caption\", className)} {...props}>\n {figure && <b className=\"kz-caption-figure\">{figure}</b>}\n {figure && \" — \"}\n {children}\n </Tag>\n );\n}\n\nexport type FootnoteRefProps = Omit<React.HTMLAttributes<HTMLElement>, \"id\"> & {\n /** The note's number. */\n n: number;\n /** The prefix of the ids, when a page has several sets of notes. @default \"fn\" */\n prefix?: string;\n};\n\n/** The superscript number in the text, linked to its note (and the note's link back lands here). */\nexport function FootnoteRef({ n, prefix = \"fn\", className, ...props }: FootnoteRefProps) {\n return (\n <sup id={`${prefix}-ref-${n}`} className={cn(\"kz-fnref\", className)} {...props}>\n <a href={`#${prefix}-${n}`} aria-label={`Note ${n}`}>\n {n}\n </a>\n </sup>\n );\n}\n\nexport type FootnotesProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The notes, in order: the first is note 1. */\n notes: readonly React.ReactNode[];\n /** The prefix of the ids (the same as the refs'). @default \"fn\" */\n prefix?: string;\n /** The heading of the notes, for assistive technology (visually a rule). @default \"Notes\" */\n label?: string;\n /** The label of the way back to the text. @default \"Back to the text\" */\n backLabel?: string;\n};\n\n/** The notes at the foot of a page: a short rule, numbered notes in small print, each with its way back to the text. */\nexport function Footnotes({ notes, prefix = \"fn\", label = \"Notes\", backLabel = \"Back to the text\", className, ...props }: FootnotesProps) {\n return (\n <section aria-label={label} className={cn(\"kz-footnotes\", className)} {...props}>\n <ol>\n {notes.map((note, i) => (\n <li key={i} id={`${prefix}-${i + 1}`}>\n {note}{\" \"}\n <a href={`#${prefix}-ref-${i + 1}`} className=\"kz-fn-back\" aria-label={`${backLabel} (${i + 1})`}>\n ↩\n </a>\n </li>\n ))}\n </ol>\n </section>\n );\n}\n"],"mappings":";;;;;AAiBI,SACa,KADb;AAFG,SAAS,QAAQ,EAAE,QAAQ,IAAI,MAAM,cAAc,WAAW,UAAU,GAAG,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/footnote/footnote.tsx"],"sourcesContent":["// Server-safe. The footnote and the caption of the Cahier (ADR-004, blocks.css): what a page says in small print. A\n// `Caption` names a figure (`fig. 2 — The owl reads every line`); a `FootnoteRef` is the superscript number in the text,\n// linked to its note; `Footnotes` lists the notes at the foot, each with its way back to the text.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type CaptionProps = React.HTMLAttributes<HTMLElement> & {\n /** The figure's number, typed before the text: `fig. 2`. */\n figure?: React.ReactNode;\n /** `figcaption` inside a `<figure>`, `p` elsewhere. @default \"figcaption\" */\n as?: \"figcaption\" | \"p\";\n};\n\n/** A caption in the typewriter face: the figure's number, a dash, what it shows. */\nexport function Caption({ figure, as: Tag = \"figcaption\", className, children, ...props }: Readonly<CaptionProps>) {\n return (\n <Tag className={cn(\"kz-caption\", className)} {...props}>\n {figure && <b className=\"kz-caption-figure\">{figure}</b>}\n {figure && \" — \"}\n {children}\n </Tag>\n );\n}\n\nexport type FootnoteRefProps = Omit<React.HTMLAttributes<HTMLElement>, \"id\"> & {\n /** The note's number. */\n n: number;\n /** The prefix of the ids, when a page has several sets of notes. @default \"fn\" */\n prefix?: string;\n};\n\n/** The superscript number in the text, linked to its note (and the note's link back lands here). */\nexport function FootnoteRef({ n, prefix = \"fn\", className, ...props }: Readonly<FootnoteRefProps>) {\n return (\n <sup id={`${prefix}-ref-${n}`} className={cn(\"kz-fnref\", className)} {...props}>\n <a href={`#${prefix}-${n}`} aria-label={`Note ${n}`}>\n {n}\n </a>\n </sup>\n );\n}\n\nexport type FootnotesProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The notes, in order: the first is note 1. */\n notes: readonly React.ReactNode[];\n /** The prefix of the ids (the same as the refs'). @default \"fn\" */\n prefix?: string;\n /** The heading of the notes, for assistive technology (visually a rule). @default \"Notes\" */\n label?: string;\n /** The label of the way back to the text. @default \"Back to the text\" */\n backLabel?: string;\n};\n\n/** The notes at the foot of a page: a short rule, numbered notes in small print, each with its way back to the text. */\nexport function Footnotes({ notes, prefix = \"fn\", label = \"Notes\", backLabel = \"Back to the text\", className, ...props }: Readonly<FootnotesProps>) {\n return (\n <section aria-label={label} className={cn(\"kz-footnotes\", className)} {...props}>\n <ol>\n {notes.map((note, i) => (\n <li key={i} id={`${prefix}-${i + 1}`}>\n {note}{\" \"}\n <a href={`#${prefix}-ref-${i + 1}`} className=\"kz-fn-back\" aria-label={`${backLabel} (${i + 1})`}>\n ↩\n </a>\n </li>\n ))}\n </ol>\n </section>\n );\n}\n"],"mappings":";;;;;AAiBI,SACa,KADb;AAFG,SAAS,QAAQ,EAAE,QAAQ,IAAI,MAAM,cAAc,WAAW,UAAU,GAAG,MAAM,GAA2B;AACjH,SACE,qBAAC,OAAI,WAAW,GAAG,cAAc,SAAS,GAAI,GAAG,OAC9C;AAAA,cAAU,oBAAC,OAAE,WAAU,qBAAqB,kBAAO;AAAA,IACnD,UAAU;AAAA,IACV;AAAA,KACH;AAEJ;AAUO,SAAS,YAAY,EAAE,GAAG,SAAS,MAAM,WAAW,GAAG,MAAM,GAA+B;AACjG,SACE,oBAAC,SAAI,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OACvE,8BAAC,OAAE,MAAM,IAAI,MAAM,IAAI,CAAC,IAAI,cAAY,QAAQ,CAAC,IAC9C,aACH,GACF;AAEJ;AAcO,SAAS,UAAU,EAAE,OAAO,SAAS,MAAM,QAAQ,SAAS,YAAY,oBAAoB,WAAW,GAAG,MAAM,GAA6B;AAClJ,SACE,oBAAC,aAAQ,cAAY,OAAO,WAAW,GAAG,gBAAgB,SAAS,GAAI,GAAG,OACxE,8BAAC,QACE,gBAAM,IAAI,CAAC,MAAM,MAChB,qBAAC,QAAW,IAAI,GAAG,MAAM,IAAI,IAAI,CAAC,IAC/B;AAAA;AAAA,IAAM;AAAA,IACP,oBAAC,OAAE,MAAM,IAAI,MAAM,QAAQ,IAAI,CAAC,IAAI,WAAU,cAAa,cAAY,GAAG,SAAS,KAAK,IAAI,CAAC,KAAK,oBAElG;AAAA,OAJO,CAKT,CACD,GACH,GACF;AAEJ;","names":[]}
|
|
@@ -79,7 +79,7 @@ type ForceUpdateScreenProps = Omit<React.ComponentProps<"main">, "title"> & {
|
|
|
79
79
|
* The forced update: one thing to do, and the way to do it.
|
|
80
80
|
* @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.
|
|
81
81
|
*/
|
|
82
|
-
declare function ForceUpdateScreen({ title, message, versionLabel, mark, updateLabel, onUpdate, retryLabel, onRetry, className, ...props }: ForceUpdateScreenProps): React.JSX.Element;
|
|
82
|
+
declare function ForceUpdateScreen({ title, message, versionLabel, mark, updateLabel, onUpdate, retryLabel, onRetry, className, ...props }: Readonly<ForceUpdateScreenProps>): React.JSX.Element;
|
|
83
83
|
|
|
84
84
|
export { ForceUpdateScreen, forceUpdateScreen };
|
|
85
85
|
export type { ForceUpdateScreenProps };
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
import "./chunk-TDG7ED2W.js";
|
|
5
5
|
import {
|
|
6
6
|
Button
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-G5NROYGK.js";
|
|
8
|
+
import "./chunk-BVN7JFOP.js";
|
|
9
9
|
import "./chunk-2VNYHG4E.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-ISC2QBXJ.js";
|
|
11
11
|
|
|
12
12
|
// src/force-update-screen/force-update-screen.tsx
|
|
13
13
|
import { tv } from "tailwind-variants";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/force-update-screen/force-update-screen.tsx"],"sourcesContent":["// Server-safe. The blocking screen: this version can no longer run. It replaces the app, it is not laid over it —\n// nothing behind it is reachable. Every word is a prop; the store URL and the versions come from the backend.\nimport { Button } from \"@krizaka/ui/button\";\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { warnDeprecated } from \"../deprecated\";\n\n/** @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0. */\nexport const forceUpdateScreen = tv({\n slots: {\n root: \"mx-auto flex min-h-dvh w-full max-w-md flex-col items-center justify-center gap-4 px-6 py-12 text-center text-fg\",\n mark: \"flex h-24 w-24 items-center justify-center [&>svg]:h-24 [&>svg]:w-24\",\n title: \"text-2xl font-semibold text-fg\",\n message: \"text-fg-secondary\",\n version: \"font-mono text-xs text-fg-tertiary\",\n actions: \"mt-2 flex w-full flex-col gap-2\",\n },\n});\n\nexport type ForceUpdateScreenProps = Omit<React.ComponentProps<\"main\">, \"title\"> & {\n /** The headline (“Update to keep going”). */\n title: React.ReactNode;\n /** Why, in a sentence — the backend's localized `message`. */\n message?: React.ReactNode;\n /** The versions, in words and mono (“You have 1.1.0 · 1.2.0 or later is required”). */\n versionLabel?: React.ReactNode;\n /** The product's mark or mascot (decorative). */\n mark?: React.ReactNode;\n /** The button that updates (“Update the app”). */\n updateLabel: string;\n /** Opens the store page. */\n onUpdate: () => void;\n /** A secondary way (“Check again”) once the update is installed — optional. */\n retryLabel?: string;\n /** Checks the backend again. */\n onRetry?: () => void;\n};\n\n/**\n * The forced update: one thing to do, and the way to do it.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function ForceUpdateScreen({ title, message, versionLabel, mark, updateLabel, onUpdate, retryLabel, onRetry, className, ...props }: ForceUpdateScreenProps) {\n warnDeprecated(\"force-update-screen\");\n const s = forceUpdateScreen();\n return (\n <main data-kind=\"update-force\" className={s.root({ className })} {...props}>\n {mark && (\n <div aria-hidden className={s.mark()}>\n {mark}\n </div>\n )}\n <h1 className={s.title()}>{title}</h1>\n {message && <p className={s.message()}>{message}</p>}\n {versionLabel && <p className={s.version()}>{versionLabel}</p>}\n <div className={s.actions()}>\n <Button variant=\"primary\" size=\"lg\" autoFocus onClick={onUpdate}>\n {updateLabel}\n </Button>\n {retryLabel && onRetry && (\n <Button variant=\"ghost\" onClick={onRetry}>\n {retryLabel}\n </Button>\n )}\n </div>\n </main>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAIA,SAAS,UAAU;AA6CX,cAOF,YAPE;AAxCD,IAAM,oBAAoB,GAAG;AAAA,EAClC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AACF,CAAC;AAyBM,SAAS,kBAAkB,EAAE,OAAO,SAAS,cAAc,MAAM,aAAa,UAAU,YAAY,SAAS,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/force-update-screen/force-update-screen.tsx"],"sourcesContent":["// Server-safe. The blocking screen: this version can no longer run. It replaces the app, it is not laid over it —\n// nothing behind it is reachable. Every word is a prop; the store URL and the versions come from the backend.\nimport { Button } from \"@krizaka/ui/button\";\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { warnDeprecated } from \"../deprecated\";\n\n/** @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0. */\nexport const forceUpdateScreen = tv({\n slots: {\n root: \"mx-auto flex min-h-dvh w-full max-w-md flex-col items-center justify-center gap-4 px-6 py-12 text-center text-fg\",\n mark: \"flex h-24 w-24 items-center justify-center [&>svg]:h-24 [&>svg]:w-24\",\n title: \"text-2xl font-semibold text-fg\",\n message: \"text-fg-secondary\",\n version: \"font-mono text-xs text-fg-tertiary\",\n actions: \"mt-2 flex w-full flex-col gap-2\",\n },\n});\n\nexport type ForceUpdateScreenProps = Omit<React.ComponentProps<\"main\">, \"title\"> & {\n /** The headline (“Update to keep going”). */\n title: React.ReactNode;\n /** Why, in a sentence — the backend's localized `message`. */\n message?: React.ReactNode;\n /** The versions, in words and mono (“You have 1.1.0 · 1.2.0 or later is required”). */\n versionLabel?: React.ReactNode;\n /** The product's mark or mascot (decorative). */\n mark?: React.ReactNode;\n /** The button that updates (“Update the app”). */\n updateLabel: string;\n /** Opens the store page. */\n onUpdate: () => void;\n /** A secondary way (“Check again”) once the update is installed — optional. */\n retryLabel?: string;\n /** Checks the backend again. */\n onRetry?: () => void;\n};\n\n/**\n * The forced update: one thing to do, and the way to do it.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function ForceUpdateScreen({ title, message, versionLabel, mark, updateLabel, onUpdate, retryLabel, onRetry, className, ...props }: Readonly<ForceUpdateScreenProps>) {\n warnDeprecated(\"force-update-screen\");\n const s = forceUpdateScreen();\n return (\n <main data-kind=\"update-force\" className={s.root({ className })} {...props}>\n {mark && (\n <div aria-hidden className={s.mark()}>\n {mark}\n </div>\n )}\n <h1 className={s.title()}>{title}</h1>\n {message && <p className={s.message()}>{message}</p>}\n {versionLabel && <p className={s.version()}>{versionLabel}</p>}\n <div className={s.actions()}>\n <Button variant=\"primary\" size=\"lg\" autoFocus onClick={onUpdate}>\n {updateLabel}\n </Button>\n {retryLabel && onRetry && (\n <Button variant=\"ghost\" onClick={onRetry}>\n {retryLabel}\n </Button>\n )}\n </div>\n </main>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAIA,SAAS,UAAU;AA6CX,cAOF,YAPE;AAxCD,IAAM,oBAAoB,GAAG;AAAA,EAClC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AACF,CAAC;AAyBM,SAAS,kBAAkB,EAAE,OAAO,SAAS,cAAc,MAAM,aAAa,UAAU,YAAY,SAAS,WAAW,GAAG,MAAM,GAAqC;AAC3K,iBAAe,qBAAqB;AACpC,QAAM,IAAI,kBAAkB;AAC5B,SACE,qBAAC,UAAK,aAAU,gBAAe,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAClE;AAAA,YACC,oBAAC,SAAI,eAAW,MAAC,WAAW,EAAE,KAAK,GAChC,gBACH;AAAA,IAEF,oBAAC,QAAG,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,IAChC,WAAW,oBAAC,OAAE,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,IAC/C,gBAAgB,oBAAC,OAAE,WAAW,EAAE,QAAQ,GAAI,wBAAa;AAAA,IAC1D,qBAAC,SAAI,WAAW,EAAE,QAAQ,GACxB;AAAA,0BAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,WAAS,MAAC,SAAS,UACpD,uBACH;AAAA,MACC,cAAc,WACb,oBAAC,UAAO,SAAQ,SAAQ,SAAS,SAC9B,sBACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
package/dist/form/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/errors.ts","../../src/form/server.ts"],"sourcesContent":["// Platform-neutral and server-safe: no React, no DOM, no React Native. The errors of a Krizaka form — a schema's issues,\n// a server's Problem Details, an availability check — as one shape, `FormFieldError`, whose words come from a key of the\n// app's catalogue (`form.errors.tooShort`), never from the validation engine's English.\n\n/** A value a message placeholder takes (`{minimum}`, `{suggestion}`). */\nexport type FormMessageValue = string | number;\n\n/** An error of a field or of the whole form: the key of its words in the app's catalogue, and what fills them in. */\nexport interface FormFieldError {\n /** The i18n key: `form.errors.required`, or the key a schema names (`z.string().min(3, \"signUp.username.short\")`). */\n key: string;\n /** The placeholders of the message (`{ minimum: 3 }`). */\n values?: Readonly<Record<string, FormMessageValue>>;\n /** The server's own words, in English: shown only when the catalogue has no message for the key. */\n message?: string;\n /** A value to offer instead (a free username): a button under the error sets it. Its label is passed translated. */\n suggestion?: { readonly label: string; readonly value: unknown };\n /** Shown at once, while the person types (an availability check), not only once they leave the field. */\n immediate?: boolean;\n /** Where it comes from: the schema (default), a field's check, or the server's answer (kept until the field changes). */\n source?: \"schema\" | \"check\" | \"server\";\n}\n\n/** The English defaults of the generic errors, by code — the words a form shows when the app's catalogue has none. */\nexport const formMessages: Readonly<Record<string, string>> = {\n required: \"This field is required.\",\n tooShort: \"Use at least {minimum} characters.\",\n tooLong: \"Use at most {maximum} characters.\",\n tooSmall: \"Enter {minimum} or more.\",\n tooBig: \"Enter {maximum} or less.\",\n tooFew: \"Choose at least {minimum}.\",\n tooMany: \"Choose at most {maximum}.\",\n invalidEmail: \"Enter an e-mail address, like name@example.com.\",\n invalidUrl: \"Enter a web address, like https://example.com.\",\n invalidDate: \"Enter a real date.\",\n invalidNumber: \"Enter a number.\",\n invalidFormat: \"Check the format of this field.\",\n invalidChoice: \"Choose one of the options.\",\n invalid: \"Check this field.\",\n // The whole form (a server's answer without fields): the codes of @krizaka/query's KrizakaApiError.\n network: \"No connection. Check your network and try again.\",\n \"rate-limited\": \"Too many tries. Wait a moment and try again.\",\n unauthorized: \"Your session has ended. Sign in again.\",\n forbidden: \"You are not allowed to do this.\",\n conflict: \"This was changed meanwhile. Reload and try again.\",\n \"validation-failed\": \"Some fields need your attention.\",\n unavailable: \"The service is unavailable for a moment. Try again shortly.\",\n server: \"Something went wrong on our side. Try again.\",\n};\n\n/** How a form finds its words: the app's translate function, and the prefixes of its keys. */\nexport interface FormI18n {\n /** The app's translate function (`(key, values) => t(key, values)`): a string, or `undefined` when the key is missing. */\n t?: (key: string, values?: Readonly<Record<string, FormMessageValue>>) => string | undefined;\n /** The prefix of the generic field errors. Default `form.errors` (→ `form.errors.tooShort`). */\n prefix?: string;\n /** The prefix of the server's codes for the whole form, as `KrizakaApiError.messageKey()`. Default `apiErrors`. */\n apiPrefix?: string;\n /** The locale of numbers, money and dates. Default `en`. */\n locale?: string;\n}\n\nconst KEY = /^[\\w-]+(\\.[\\w-]+)+$/;\n\nconst fill = (text: string, values?: Readonly<Record<string, FormMessageValue>>) =>\n values ? text.replace(/\\{(\\w+)\\}/g, (all, name: string) => (values[name] === undefined ? all : String(values[name]))) : text;\n\n/** The words of an error: the app's catalogue, else the English default of its code, else the server's words, else the key. */\nexport function formMessage(error: FormFieldError | string, i18n: FormI18n = {}): string {\n const e = typeof error === \"string\" ? { key: error } : error;\n const translated = i18n.t?.(e.key, e.values);\n if (translated && translated !== e.key) return translated;\n const code = e.key.slice(e.key.lastIndexOf(\".\") + 1);\n const fallback = formMessages[code];\n // The server's words beat a generic default (a refusal without a code), never a default for its own code.\n if (e.message && (code === \"invalid\" || !fallback)) return e.message;\n if (fallback && (e.key.startsWith(`${i18n.prefix ?? \"form.errors\"}.`) || e.key.startsWith(`${i18n.apiPrefix ?? \"apiErrors\"}.`))) return fill(fallback, e.values);\n return e.message ?? (KEY.test(e.key) ? fill(fallback ?? formMessages.invalid!, e.values) : e.key);\n}\n\n/** One issue of a Standard Schema (zod 4, valibot, arktype): zod adds its `code` and limits, read when present. */\nexport interface SchemaIssue {\n readonly message: string;\n readonly path?: ReadonlyArray<PropertyKey | { readonly key: PropertyKey }>;\n readonly code?: string;\n readonly minimum?: number | bigint;\n readonly maximum?: number | bigint;\n readonly origin?: string;\n readonly format?: string;\n readonly input?: unknown;\n readonly expected?: string;\n}\n\n/** A field's name from an issue's path, as the form writes it: `links[0].url`. */\nexport function pathName(path: SchemaIssue[\"path\"]): string {\n let name = \"\";\n for (const part of path ?? []) {\n const key = typeof part === \"object\" && part !== null ? part.key : part;\n if (typeof key === \"number\") name += `[${key}]`;\n else name += name ? `.${String(key)}` : String(key);\n }\n return name;\n}\n\nconst num = (value: number | bigint | undefined) => (value === undefined ? undefined : Number(value));\n\n/** The key and values of an issue: the schema's own key when it names one, else the generic code of what failed. */\nexport function issueError(issue: SchemaIssue, prefix = \"form.errors\"): FormFieldError {\n if (KEY.test(issue.message)) return { key: issue.message };\n const key = (code: string, values?: Record<string, FormMessageValue>) => ({ key: `${prefix}.${code}`, ...(values ? { values } : {}) });\n const collection = issue.origin === \"array\" || issue.origin === \"set\";\n switch (issue.code) {\n case \"invalid_type\":\n return issue.input === undefined || issue.input === null || issue.input === \"\" ? key(\"required\") : issue.expected === \"number\" ? key(\"invalidNumber\") : issue.expected === \"date\" ? key(\"invalidDate\") : key(\"invalid\");\n case \"too_small\": {\n const minimum = num(issue.minimum)!;\n if (issue.origin === \"string\") return minimum <= 1 ? key(\"required\") : key(\"tooShort\", { minimum });\n if (collection) return minimum <= 1 ? key(\"required\") : key(\"tooFew\", { minimum });\n return key(\"tooSmall\", { minimum });\n }\n case \"too_big\": {\n const maximum = num(issue.maximum)!;\n return issue.origin === \"string\" ? key(\"tooLong\", { maximum }) : collection ? key(\"tooMany\", { maximum }) : key(\"tooBig\", { maximum });\n }\n case \"invalid_format\":\n if (issue.format === \"email\") return key(\"invalidEmail\");\n if (issue.format === \"url\") return key(\"invalidUrl\");\n if (issue.format === \"date\" || issue.format === \"datetime\") return key(\"invalidDate\");\n return key(\"invalidFormat\");\n case \"invalid_value\":\n // `z.literal(true)`: a box that must be ticked.\n return issue.input === false || issue.input === undefined ? key(\"required\") : key(\"invalidChoice\");\n case \"invalid_union\":\n case \"invalid_key\":\n case \"invalid_element\":\n return key(\"invalidChoice\");\n default:\n return key(\"invalid\");\n }\n}\n\n/** The first error of each field of a schema's issues (an issue without a path is the whole form's: `\"\"`). */\nexport function issuesToFields(issues: readonly SchemaIssue[], prefix?: string): Record<string, FormFieldError> {\n const fields: Record<string, FormFieldError> = {};\n for (const issue of issues) {\n const name = pathName(issue.path);\n if (!(name in fields)) fields[name] = { ...issueError(issue, prefix), source: \"schema\" };\n }\n return fields;\n}\n\n/**\n * A refusal the form shows, serialisable (a Server Action returns it): the shape of `KrizakaApiError` of @krizaka/query —\n * a `KrizakaApiError` *is* a `FormProblem`. `fields` go under their fields, the rest above the submit button.\n */\nexport interface FormProblem {\n /** The HTTP status (0 when no response arrived). */\n status?: number;\n /** The stable code of the refusal (`rate-limited`, `conflict`, `ACCOUNT_EXISTS`): the key of its words. */\n code?: string;\n /** The server's sentence, in English: shown only when the catalogue has no message for the code. */\n detail?: string;\n /** The refused fields, by name: a server's `{ code, message }`, or an error the form already knows (`key`). */\n fields?: Readonly<Record<string, { code?: string; message: string } | FormFieldError | string>>;\n /** Epoch ms before which the same call is refused (a 429). */\n retryAt?: number;\n}\n\n/** True for what a form can read as a problem: a `KrizakaApiError`, a `FormProblem`, an `{ ok: false, problem }` result. */\nexport function isFormProblem(value: unknown): value is FormProblem {\n return typeof value === \"object\" && value !== null && (\"fields\" in value || \"code\" in value || \"status\" in value);\n}\n\n/** A problem as field errors (by name) and the whole form's error (or `null` when every refusal has its field). */\nexport function problemToErrors(\n problem: FormProblem,\n i18n: FormI18n = {},\n known?: (name: string) => boolean,\n codeFields: Readonly<Record<string, string>> = {},\n): { fields: Record<string, FormFieldError>; form: FormFieldError | null } {\n const prefix = i18n.prefix ?? \"form.errors\";\n const fields: Record<string, FormFieldError> = {};\n let unplaced = false;\n // A refusal named by a code that belongs to a field (`UNDERAGE` → `dateOfBirth`): under that field, in its words.\n const owner = problem.code ? codeFields[problem.code] : undefined;\n if (owner && (!known || known(owner)) && !problem.fields?.[owner]) {\n fields[owner] = { key: `${prefix}.${problem.code}`, ...(problem.detail ? { message: problem.detail } : {}), source: \"server\" };\n if (!problem.fields || Object.keys(problem.fields).length === 0) return { fields, form: null };\n }\n for (const [name, refusal] of Object.entries(problem.fields ?? {})) {\n if (known && !known(name)) {\n unplaced = true;\n continue;\n }\n const error: FormFieldError =\n typeof refusal === \"string\"\n ? { key: refusal }\n : \"key\" in refusal\n ? refusal\n : { key: refusal.code ? (KEY.test(refusal.code) ? refusal.code : `${prefix}.${refusal.code}`) : `${prefix}.invalid`, message: refusal.message };\n fields[name] = { ...error, source: \"server\" };\n }\n const placed = Object.keys(fields).length > 0;\n if (placed && !unplaced) return { fields, form: null };\n const code = problem.code ?? (problem.status === 0 ? \"network\" : problem.status && problem.status >= 500 ? \"server\" : \"invalid\");\n const retryIn = problem.retryAt ? Math.max(1, Math.ceil((problem.retryAt - Date.now()) / 1000)) : undefined;\n return {\n fields,\n form: { key: KEY.test(code) ? code : `${i18n.apiPrefix ?? \"apiErrors\"}.${code}`, ...(problem.detail ? { message: problem.detail } : {}), ...(retryIn ? { values: { seconds: retryIn } } : {}), source: \"server\" },\n };\n}\n","/**\n * @krizaka/ui/form/server — the server side of a Krizaka form, for a Server Action or a route handler (no \"use client\",\n * no React): `validateForm` parses with the form's own schema and answers the errors with the same keys the form shows,\n * `formProblem` turns a thrown error (a `KrizakaApiError` of @krizaka/query) into the serialisable refusal a form reads.\n */\nimport { type FormFieldError, type FormProblem, issuesToFields, type SchemaIssue } from \"./errors\";\n\nexport type { FormFieldError, FormProblem } from \"./errors\";\n\n/** What a Server Action answers a form: done (with what it made), or a refusal (`fields` under their fields). */\nexport type FormActionResult<T = unknown> = { ok: true; data?: T } | { ok: false; problem: FormProblem };\n\ntype Schema<O> = { readonly \"~standard\": { validate: (value: unknown) => { value?: O; issues?: readonly SchemaIssue[] } | Promise<{ value?: O; issues?: readonly SchemaIssue[] }> } };\n\n/**\n * Parses what a form sent with its schema (never trust the client): the value, or a `validation-failed` problem whose\n * fields carry the keys the form would show (`form.errors.tooShort`, the schema's own keys).\n */\nexport async function validateForm<O>(schema: Schema<O>, input: unknown, options: { prefix?: string } = {}): Promise<{ ok: true; value: O } | { ok: false; problem: FormProblem }> {\n const result = await schema[\"~standard\"].validate(input);\n if (!result.issues?.length) return { ok: true, value: result.value as O };\n const fields: Record<string, FormFieldError> = issuesToFields(result.issues, options.prefix);\n const general = fields[\"\"];\n delete fields[\"\"];\n return { ok: false, problem: { status: 422, code: general ? general.key : \"validation-failed\", fields } };\n}\n\n/** A thrown error as a refusal a form reads — a `KrizakaApiError` keeps its status, code, fields and retry time. */\nexport function formProblem(error: unknown): FormProblem {\n if (error && typeof error === \"object\") {\n const e = error as { status?: unknown; code?: unknown; detail?: unknown; fields?: unknown; retryAt?: unknown };\n if (typeof e.status === \"number\" || typeof e.code === \"string\") {\n return {\n ...(typeof e.status === \"number\" ? { status: e.status } : {}),\n ...(typeof e.code === \"string\" ? { code: e.code } : {}),\n ...(typeof e.detail === \"string\" ? { detail: e.detail } : {}),\n ...(e.fields && typeof e.fields === \"object\" ? { fields: JSON.parse(JSON.stringify(e.fields)) as FormProblem[\"fields\"] } : {}),\n ...(typeof e.retryAt === \"number\" ? { retryAt: e.retryAt } : {}),\n };\n }\n }\n return { status: 500, code: \"server\" };\n}\n"],"mappings":";AA8DA,IAAM,MAAM;AAgCL,SAAS,SAAS,MAAmC;AAC1D,MAAI,OAAO;AACX,aAAW,QAAQ,QAAQ,CAAC,GAAG;AAC7B,UAAM,MAAM,OAAO,SAAS,YAAY,SAAS,OAAO,KAAK,MAAM;AACnE,QAAI,OAAO,QAAQ,SAAU,SAAQ,IAAI,GAAG;AAAA,QACvC,SAAQ,OAAO,IAAI,OAAO,GAAG,CAAC,KAAK,OAAO,GAAG;AAAA,EACpD;AACA,SAAO;AACT;AAEA,IAAM,MAAM,CAAC,UAAwC,UAAU,SAAY,SAAY,OAAO,KAAK;AA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AAI,CAAC;AAAA,QAC3D,GAAI,EAAE,UAAU,OAAO,EAAE,WAAW,WAAW,EAAE,QAAQ,KAAK,MAAM,KAAK,UAAU,EAAE,MAAM,CAAC,EAA2B,IAAI,CAAC;AAAA,QAC5H,GAAI,OAAO,EAAE,YAAY,WAAW,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACA,SAAO,EAAE,QAAQ,KAAK,MAAM,SAAS;AACvC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/form/errors.ts","../../src/form/server.ts"],"sourcesContent":["// Platform-neutral and server-safe: no React, no DOM, no React Native. The errors of a Krizaka form — a schema's issues,\n// a server's Problem Details, an availability check — as one shape, `FormFieldError`, whose words come from a key of the\n// app's catalogue (`form.errors.tooShort`), never from the validation engine's English.\n\n/** A value a message placeholder takes (`{minimum}`, `{suggestion}`). */\nexport type FormMessageValue = string | number;\n\n/** An error of a field or of the whole form: the key of its words in the app's catalogue, and what fills them in. */\nexport interface FormFieldError {\n /** The i18n key: `form.errors.required`, or the key a schema names (`z.string().min(3, \"signUp.username.short\")`). */\n key: string;\n /** The placeholders of the message (`{ minimum: 3 }`). */\n values?: Readonly<Record<string, FormMessageValue>>;\n /** The server's own words, in English: shown only when the catalogue has no message for the key. */\n message?: string;\n /** A value to offer instead (a free username): a button under the error sets it. Its label is passed translated. */\n suggestion?: { readonly label: string; readonly value: unknown };\n /** Shown at once, while the person types (an availability check), not only once they leave the field. */\n immediate?: boolean;\n /** Where it comes from: the schema (default), a field's check, or the server's answer (kept until the field changes). */\n source?: \"schema\" | \"check\" | \"server\";\n}\n\n/** The English defaults of the generic errors, by code — the words a form shows when the app's catalogue has none. */\nexport const formMessages: Readonly<Record<string, string>> = {\n required: \"This field is required.\",\n tooShort: \"Use at least {minimum} characters.\",\n tooLong: \"Use at most {maximum} characters.\",\n tooSmall: \"Enter {minimum} or more.\",\n tooBig: \"Enter {maximum} or less.\",\n tooFew: \"Choose at least {minimum}.\",\n tooMany: \"Choose at most {maximum}.\",\n invalidEmail: \"Enter an e-mail address, like name@example.com.\",\n invalidUrl: \"Enter a web address, like https://example.com.\",\n invalidDate: \"Enter a real date.\",\n invalidNumber: \"Enter a number.\",\n invalidFormat: \"Check the format of this field.\",\n invalidChoice: \"Choose one of the options.\",\n invalid: \"Check this field.\",\n // The whole form (a server's answer without fields): the codes of @krizaka/query's KrizakaApiError.\n network: \"No connection. Check your network and try again.\",\n \"rate-limited\": \"Too many tries. Wait a moment and try again.\",\n unauthorized: \"Your session has ended. Sign in again.\",\n forbidden: \"You are not allowed to do this.\",\n conflict: \"This was changed meanwhile. Reload and try again.\",\n \"validation-failed\": \"Some fields need your attention.\",\n unavailable: \"The service is unavailable for a moment. Try again shortly.\",\n server: \"Something went wrong on our side. Try again.\",\n};\n\n/** How a form finds its words: the app's translate function, and the prefixes of its keys. */\nexport interface FormI18n {\n /** The app's translate function (`(key, values) => t(key, values)`): a string, or `undefined` when the key is missing. */\n t?: (key: string, values?: Readonly<Record<string, FormMessageValue>>) => string | undefined;\n /** The prefix of the generic field errors. Default `form.errors` (→ `form.errors.tooShort`). */\n prefix?: string;\n /** The prefix of the server's codes for the whole form, as `KrizakaApiError.messageKey()`. Default `apiErrors`. */\n apiPrefix?: string;\n /** The locale of numbers, money and dates. Default `en`. */\n locale?: string;\n}\n\nconst KEY = /^[\\w-]+(\\.[\\w-]+)+$/;\n\nconst fill = (text: string, values?: Readonly<Record<string, FormMessageValue>>) =>\n values ? text.replaceAll(/\\{(\\w+)\\}/g, (all, name: string) => (values[name] === undefined ? all : String(values[name]))) : text;\n\n/** The words of an error: the app's catalogue, else the English default of its code, else the server's words, else the key. */\nexport function formMessage(error: FormFieldError | string, i18n: FormI18n = {}): string {\n const e = typeof error === \"string\" ? { key: error } : error;\n const translated = i18n.t?.(e.key, e.values);\n if (translated && translated !== e.key) return translated;\n const code = e.key.slice(e.key.lastIndexOf(\".\") + 1);\n const fallback = formMessages[code];\n // The server's words beat a generic default (a refusal without a code), never a default for its own code.\n if (e.message && (code === \"invalid\" || !fallback)) return e.message;\n if (fallback && (e.key.startsWith(`${i18n.prefix ?? \"form.errors\"}.`) || e.key.startsWith(`${i18n.apiPrefix ?? \"apiErrors\"}.`))) return fill(fallback, e.values);\n return e.message ?? (KEY.test(e.key) ? fill(fallback ?? formMessages.invalid!, e.values) : e.key);\n}\n\n/** One issue of a Standard Schema (zod 4, valibot, arktype): zod adds its `code` and limits, read when present. */\nexport interface SchemaIssue {\n readonly message: string;\n readonly path?: ReadonlyArray<PropertyKey | { readonly key: PropertyKey }>;\n readonly code?: string;\n readonly minimum?: number | bigint;\n readonly maximum?: number | bigint;\n readonly origin?: string;\n readonly format?: string;\n readonly input?: unknown;\n readonly expected?: string;\n}\n\n/** A field's name from an issue's path, as the form writes it: `links[0].url`. */\nexport function pathName(path: SchemaIssue[\"path\"]): string {\n let name = \"\";\n for (const part of path ?? []) {\n const key = typeof part === \"object\" && part !== null ? part.key : part;\n if (typeof key === \"number\") name += `[${key}]`;\n else name += name ? `.${String(key)}` : String(key);\n }\n return name;\n}\n\nconst num = (value: number | bigint | undefined) => (value === undefined ? undefined : Number(value));\n\n/** The key and values of an issue: the schema's own key when it names one, else the generic code of what failed. */\nexport function issueError(issue: SchemaIssue, prefix = \"form.errors\"): FormFieldError {\n if (KEY.test(issue.message)) return { key: issue.message };\n const key = (code: string, values?: Record<string, FormMessageValue>) => ({ key: `${prefix}.${code}`, ...(values ? { values } : {}) });\n const collection = issue.origin === \"array\" || issue.origin === \"set\";\n switch (issue.code) {\n case \"invalid_type\":\n return issue.input === undefined || issue.input === null || issue.input === \"\" ? key(\"required\") : issue.expected === \"number\" ? key(\"invalidNumber\") : issue.expected === \"date\" ? key(\"invalidDate\") : key(\"invalid\");\n case \"too_small\": {\n const minimum = num(issue.minimum)!;\n if (issue.origin === \"string\") return minimum <= 1 ? key(\"required\") : key(\"tooShort\", { minimum });\n if (collection) return minimum <= 1 ? key(\"required\") : key(\"tooFew\", { minimum });\n return key(\"tooSmall\", { minimum });\n }\n case \"too_big\": {\n const maximum = num(issue.maximum)!;\n return issue.origin === \"string\" ? key(\"tooLong\", { maximum }) : collection ? key(\"tooMany\", { maximum }) : key(\"tooBig\", { maximum });\n }\n case \"invalid_format\":\n if (issue.format === \"email\") return key(\"invalidEmail\");\n if (issue.format === \"url\") return key(\"invalidUrl\");\n if (issue.format === \"date\" || issue.format === \"datetime\") return key(\"invalidDate\");\n return key(\"invalidFormat\");\n case \"invalid_value\":\n // `z.literal(true)`: a box that must be ticked.\n return issue.input === false || issue.input === undefined ? key(\"required\") : key(\"invalidChoice\");\n case \"invalid_union\":\n case \"invalid_key\":\n case \"invalid_element\":\n return key(\"invalidChoice\");\n default:\n return key(\"invalid\");\n }\n}\n\n/** The first error of each field of a schema's issues (an issue without a path is the whole form's: `\"\"`). */\nexport function issuesToFields(issues: readonly SchemaIssue[], prefix?: string): Record<string, FormFieldError> {\n const fields: Record<string, FormFieldError> = {};\n for (const issue of issues) {\n const name = pathName(issue.path);\n if (!(name in fields)) fields[name] = { ...issueError(issue, prefix), source: \"schema\" };\n }\n return fields;\n}\n\n/**\n * A refusal the form shows, serialisable (a Server Action returns it): the shape of `KrizakaApiError` of @krizaka/query —\n * a `KrizakaApiError` *is* a `FormProblem`. `fields` go under their fields, the rest above the submit button.\n */\nexport interface FormProblem {\n /** The HTTP status (0 when no response arrived). */\n status?: number;\n /** The stable code of the refusal (`rate-limited`, `conflict`, `ACCOUNT_EXISTS`): the key of its words. */\n code?: string;\n /** The server's sentence, in English: shown only when the catalogue has no message for the code. */\n detail?: string;\n /** The refused fields, by name: a server's `{ code, message }`, or an error the form already knows (`key`). */\n fields?: Readonly<Record<string, { code?: string; message: string } | FormFieldError | string>>;\n /** Epoch ms before which the same call is refused (a 429). */\n retryAt?: number;\n}\n\n/** True for what a form can read as a problem: a `KrizakaApiError`, a `FormProblem`, an `{ ok: false, problem }` result. */\nexport function isFormProblem(value: unknown): value is FormProblem {\n return typeof value === \"object\" && value !== null && (\"fields\" in value || \"code\" in value || \"status\" in value);\n}\n\n/** A problem as field errors (by name) and the whole form's error (or `null` when every refusal has its field). */\nexport function problemToErrors(\n problem: FormProblem,\n i18n: FormI18n = {},\n known?: (name: string) => boolean,\n codeFields: Readonly<Record<string, string>> = {},\n): { fields: Record<string, FormFieldError>; form: FormFieldError | null } {\n const prefix = i18n.prefix ?? \"form.errors\";\n const fields: Record<string, FormFieldError> = {};\n let unplaced = false;\n // A refusal named by a code that belongs to a field (`UNDERAGE` → `dateOfBirth`): under that field, in its words.\n const owner = problem.code ? codeFields[problem.code] : undefined;\n if (owner && (!known || known(owner)) && !problem.fields?.[owner]) {\n fields[owner] = { key: `${prefix}.${problem.code}`, ...(problem.detail ? { message: problem.detail } : {}), source: \"server\" };\n if (!problem.fields || Object.keys(problem.fields).length === 0) return { fields, form: null };\n }\n for (const [name, refusal] of Object.entries(problem.fields ?? {})) {\n if (known && !known(name)) {\n unplaced = true;\n continue;\n }\n const error: FormFieldError =\n typeof refusal === \"string\"\n ? { key: refusal }\n : \"key\" in refusal\n ? refusal\n : { key: refusal.code ? (KEY.test(refusal.code) ? refusal.code : `${prefix}.${refusal.code}`) : `${prefix}.invalid`, message: refusal.message };\n fields[name] = { ...error, source: \"server\" };\n }\n const placed = Object.keys(fields).length > 0;\n if (placed && !unplaced) return { fields, form: null };\n const code = problem.code ?? (problem.status === 0 ? \"network\" : problem.status && problem.status >= 500 ? \"server\" : \"invalid\");\n const retryIn = problem.retryAt ? Math.max(1, Math.ceil((problem.retryAt - Date.now()) / 1000)) : undefined;\n return {\n fields,\n form: { key: KEY.test(code) ? code : `${i18n.apiPrefix ?? \"apiErrors\"}.${code}`, ...(problem.detail ? { message: problem.detail } : {}), ...(retryIn ? { values: { seconds: retryIn } } : {}), source: \"server\" },\n };\n}\n","/**\n * @krizaka/ui/form/server — the server side of a Krizaka form, for a Server Action or a route handler (no \"use client\",\n * no React): `validateForm` parses with the form's own schema and answers the errors with the same keys the form shows,\n * `formProblem` turns a thrown error (a `KrizakaApiError` of @krizaka/query) into the serialisable refusal a form reads.\n */\nimport { type FormFieldError, type FormProblem, issuesToFields, type SchemaIssue } from \"./errors\";\n\nexport type { FormFieldError, FormProblem } from \"./errors\";\n\n/** What a Server Action answers a form: done (with what it made), or a refusal (`fields` under their fields). */\nexport type FormActionResult<T = unknown> = { ok: true; data?: T } | { ok: false; problem: FormProblem };\n\ntype Schema<O> = { readonly \"~standard\": { validate: (value: unknown) => { value?: O; issues?: readonly SchemaIssue[] } | Promise<{ value?: O; issues?: readonly SchemaIssue[] }> } };\n\n/**\n * Parses what a form sent with its schema (never trust the client): the value, or a `validation-failed` problem whose\n * fields carry the keys the form would show (`form.errors.tooShort`, the schema's own keys).\n */\nexport async function validateForm<O>(schema: Schema<O>, input: unknown, options: { prefix?: string } = {}): Promise<{ ok: true; value: O } | { ok: false; problem: FormProblem }> {\n const result = await schema[\"~standard\"].validate(input);\n if (!result.issues?.length) return { ok: true, value: result.value as O };\n const fields: Record<string, FormFieldError> = issuesToFields(result.issues, options.prefix);\n const general = fields[\"\"];\n delete fields[\"\"];\n return { ok: false, problem: { status: 422, code: general ? general.key : \"validation-failed\", fields } };\n}\n\n/** A thrown error as a refusal a form reads — a `KrizakaApiError` keeps its status, code, fields and retry time. */\nexport function formProblem(error: unknown): FormProblem {\n if (error && typeof error === \"object\") {\n const e = error as { status?: unknown; code?: unknown; detail?: unknown; fields?: unknown; retryAt?: unknown };\n if (typeof e.status === \"number\" || typeof e.code === \"string\") {\n return {\n ...(typeof e.status === \"number\" ? { status: e.status } : {}),\n ...(typeof e.code === \"string\" ? { code: e.code } : {}),\n ...(typeof e.detail === \"string\" ? { detail: e.detail } : {}),\n ...(e.fields && typeof e.fields === \"object\" ? { fields: JSON.parse(JSON.stringify(e.fields)) as FormProblem[\"fields\"] } : {}),\n ...(typeof e.retryAt === \"number\" ? { retryAt: e.retryAt } : {}),\n };\n }\n }\n return { status: 500, code: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AAO,EAAE;AAC1G;AAGO,SAAS,YAAY,OAA6B;AACvD,MAAI,SAAS,OAAO,UAAU,UAAU;AACtC,UAAM,IAAI;AACV,QAAI,OAAO,EAAE,WAAW,YAAY,OAAO,EAAE,SAAS,UAAU;AAC9D,aAAO;AAAA,QACL,GAAI,OAAO,EAAE,WAAW,WAAW,EAAE,QAAQ,EAAE,OAAO,IAAI,CAAC;AAAA,QAC3D,GAAI,OAAO,EAAE,SAAS,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;AAAA,QACrD,GAAI,OAAO,EAAE,WAAW,WAAW,EAAE,QAAQ,EAAE,OAAO,IAAI,CAAC;AAAA,QAC3D,GAAI,EAAE,UAAU,OAAO,EAAE,WAAW,WAAW,EAAE,QAAQ,KAAK,MAAM,KAAK,UAAU,EAAE,MAAM,CAAC,EAA2B,IAAI,CAAC;AAAA,QAC5H,GAAI,OAAO,EAAE,YAAY,WAAW,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACA,SAAO,EAAE,QAAQ,KAAK,MAAM,SAAS;AACvC;","names":[]}
|
package/dist/form.d.ts
CHANGED
|
@@ -313,7 +313,7 @@ type SubmitProps = Omit<ButtonProps, "type" | "loading"> & {
|
|
|
313
313
|
children: React.ReactNode;
|
|
314
314
|
};
|
|
315
315
|
/** The submit button: busy while the form is sent (not pressable twice), never disabled for an invalid form. */
|
|
316
|
-
declare function Submit({ variant, children, ...props }: SubmitProps): React.JSX.Element;
|
|
316
|
+
declare function Submit({ variant, children, ...props }: Readonly<SubmitProps>): React.JSX.Element;
|
|
317
317
|
type FormErrorProps = {
|
|
318
318
|
/** A headline above the message ("We could not create your account"), passed translated. */
|
|
319
319
|
title?: string;
|
|
@@ -321,7 +321,7 @@ type FormErrorProps = {
|
|
|
321
321
|
className?: string;
|
|
322
322
|
};
|
|
323
323
|
/** The whole form's error — a refusal of the server that belongs to no field (a conflict, too many tries, no network). */
|
|
324
|
-
declare function FormError({ title, className }: FormErrorProps): React.JSX.Element | null;
|
|
324
|
+
declare function FormError({ title, className }: Readonly<FormErrorProps>): React.JSX.Element | null;
|
|
325
325
|
type TextFieldProps = Base & {
|
|
326
326
|
/** `text` (default), `email`, `password`, `url`, `tel`, `search`: the right keyboard on a phone. */
|
|
327
327
|
type?: "text" | "email" | "password" | "url" | "tel" | "search";
|
|
@@ -347,7 +347,7 @@ type TextFieldProps = Base & {
|
|
|
347
347
|
start?: React.ReactNode;
|
|
348
348
|
};
|
|
349
349
|
/** A text field of the form: label, input, hint or error, an optional check on the server. */
|
|
350
|
-
declare function TextField({ name, label, hint, disabled, className, type, transform, validateAsync, asyncDebounceMs, availableHint, checkingLabel, start, ...input }: TextFieldProps): React.JSX.Element;
|
|
350
|
+
declare function TextField({ name, label, hint, disabled, className, type, transform, validateAsync, asyncDebounceMs, availableHint, checkingLabel, start, ...input }: Readonly<TextFieldProps>): React.JSX.Element;
|
|
351
351
|
type TextAreaProps = Base & {
|
|
352
352
|
/** An example of a value, passed translated. */
|
|
353
353
|
placeholder?: string;
|
|
@@ -363,9 +363,9 @@ type CheckboxProps = Omit<Base, "label"> & {
|
|
|
363
363
|
label: React.ReactNode;
|
|
364
364
|
};
|
|
365
365
|
/** A box of the form (`boolean`): terms to accept, an option. */
|
|
366
|
-
declare function Checkbox({ name, label, hint, disabled, className }: CheckboxProps): React.JSX.Element;
|
|
366
|
+
declare function Checkbox({ name, label, hint, disabled, className }: Readonly<CheckboxProps>): React.JSX.Element;
|
|
367
367
|
/** An on/off setting of the form (`boolean`): the label and its hint beside the switch. */
|
|
368
|
-
declare function Switch({ name, label, hint, disabled, className }: Base): React.JSX.Element;
|
|
368
|
+
declare function Switch({ name, label, hint, disabled, className }: Readonly<Base>): React.JSX.Element;
|
|
369
369
|
/** A choice of the form: the value stored, its words (passed translated), a line under them. */
|
|
370
370
|
type FormOption = {
|
|
371
371
|
value: string;
|
|
@@ -386,7 +386,7 @@ type RadioGroupProps = Base & {
|
|
|
386
386
|
orientation?: "vertical" | "horizontal";
|
|
387
387
|
};
|
|
388
388
|
/** One choice among a few, all visible. */
|
|
389
|
-
declare function RadioGroup({ name, label, hint, disabled, className, options, variant, orientation }: RadioGroupProps): React.JSX.Element;
|
|
389
|
+
declare function RadioGroup({ name, label, hint, disabled, className, options, variant, orientation }: Readonly<RadioGroupProps>): React.JSX.Element;
|
|
390
390
|
type SelectProps = Base & {
|
|
391
391
|
/** The choices, in the platform's own menu (a country, a category). */
|
|
392
392
|
options: readonly FormOption[];
|
|
@@ -410,7 +410,7 @@ type ComboboxProps = Base & {
|
|
|
410
410
|
labels?: Partial<ComboboxLabels>;
|
|
411
411
|
};
|
|
412
412
|
/** A choice among many, typed to filter or fetched: one value (`string`) or several (`string[]`). */
|
|
413
|
-
declare function Combobox({ name, label, hint, disabled, className, options, onSearch, multiple, creatable, placeholder, labels }: ComboboxProps): React.JSX.Element;
|
|
413
|
+
declare function Combobox({ name, label, hint, disabled, className, options, onSearch, multiple, creatable, placeholder, labels }: Readonly<ComboboxProps>): React.JSX.Element;
|
|
414
414
|
type DateFieldProps = Base & {
|
|
415
415
|
/**
|
|
416
416
|
* `calendar` (default: a date near today — a publication, an appointment), `parts` (day · month · year typed: a
|
|
@@ -427,10 +427,10 @@ type DateFieldProps = Base & {
|
|
|
427
427
|
autoComplete?: "bday" | "off";
|
|
428
428
|
};
|
|
429
429
|
/** A date of the form (`YYYY-MM-DD`, `""` for none): a calendar, day · month · year typed, or wheels. */
|
|
430
|
-
declare function DateField({ name, label, hint, disabled, className, entry, min, max, labels, autoComplete }: DateFieldProps): React.JSX.Element;
|
|
430
|
+
declare function DateField({ name, label, hint, disabled, className, entry, min, max, labels, autoComplete }: Readonly<DateFieldProps>): React.JSX.Element;
|
|
431
431
|
type TagsProps = Base & Pick<TagInputProps, "suggestions" | "normalize" | "max" | "separators" | "placeholder" | "labels">;
|
|
432
432
|
/** Free words of the form as chips (`string[]`): tags, keywords. */
|
|
433
|
-
declare function TagInput({ name, label, hint, disabled, className, ...props }: TagsProps): React.JSX.Element;
|
|
433
|
+
declare function TagInput({ name, label, hint, disabled, className, ...props }: Readonly<TagsProps>): React.JSX.Element;
|
|
434
434
|
type FileUploadProps = Omit<Base, "hint"> & {
|
|
435
435
|
/** The title in the zone ("Drop your video here"), passed translated. */
|
|
436
436
|
title: string;
|
|
@@ -452,7 +452,7 @@ type FileUploadProps = Omit<Base, "hint"> & {
|
|
|
452
452
|
refusalLabel?: React.ComponentProps<typeof Dropzone>["refusalLabel"];
|
|
453
453
|
};
|
|
454
454
|
/** Files of the form (`File[]`): a drop zone, then the chosen files, each removable. */
|
|
455
|
-
declare function FileUpload({ name, label, hint, disabled, className, title, browseLabel, accept, maxSize, multiple, maxFiles, removeLabel, refusalLabel }: FileUploadProps): React.JSX.Element;
|
|
455
|
+
declare function FileUpload({ name, label, hint, disabled, className, title, browseLabel, accept, maxSize, multiple, maxFiles, removeLabel, refusalLabel }: Readonly<FileUploadProps>): React.JSX.Element;
|
|
456
456
|
type MoneyProps = Base & {
|
|
457
457
|
/** The currency (ISO 4217: `USD`, `EUR`, `JPY`): its sign before the amount, its decimals. */
|
|
458
458
|
currency: string;
|
|
@@ -460,7 +460,7 @@ type MoneyProps = Base & {
|
|
|
460
460
|
placeholder?: string;
|
|
461
461
|
};
|
|
462
462
|
/** An amount of the form, stored as integer minor units (cents: `1250` = 12.50), typed the locale's way. */
|
|
463
|
-
declare function Money({ name, label, hint, disabled, className, currency, placeholder }: MoneyProps): React.JSX.Element;
|
|
463
|
+
declare function Money({ name, label, hint, disabled, className, currency, placeholder }: Readonly<MoneyProps>): React.JSX.Element;
|
|
464
464
|
type SliderProps = Base & {
|
|
465
465
|
/** The lowest value. Default 0. */
|
|
466
466
|
min?: number;
|
|
@@ -478,7 +478,7 @@ type SliderProps = Base & {
|
|
|
478
478
|
marks?: readonly SliderMark[];
|
|
479
479
|
};
|
|
480
480
|
/** A number (or a range) of the form, chosen by feel: a share, a volume, a price range — the value floats while it is touched. */
|
|
481
|
-
declare function Slider({ name, label, hint, disabled, className, min, max, step, formatValue, thumbLabels, ticks, marks }: SliderProps): React.JSX.Element;
|
|
481
|
+
declare function Slider({ name, label, hint, disabled, className, min, max, step, formatValue, thumbLabels, ticks, marks }: Readonly<SliderProps>): React.JSX.Element;
|
|
482
482
|
/**
|
|
483
483
|
* A form, defined once: its schema (zod 4) and default values — the same schema the server parses with. In a component,
|
|
484
484
|
* `signUp.useForm({ onSubmit })` gives the form and its fields, typed by the schema: `<form.Form>`, `<form.TextField
|
package/dist/form.js
CHANGED
|
@@ -55,7 +55,7 @@ var formMessages = {
|
|
|
55
55
|
server: "Something went wrong on our side. Try again."
|
|
56
56
|
};
|
|
57
57
|
var KEY = /^[\w-]+(\.[\w-]+)+$/;
|
|
58
|
-
var fill = (text, values) => values ? text.
|
|
58
|
+
var fill = (text, values) => values ? text.replaceAll(/\{(\w+)\}/g, (all, name) => values[name] === void 0 ? all : String(values[name])) : text;
|
|
59
59
|
function formMessage(error, i18n = {}) {
|
|
60
60
|
const e = typeof error === "string" ? { key: error } : error;
|
|
61
61
|
const translated = i18n.t?.(e.key, e.values);
|
|
@@ -310,7 +310,7 @@ function useFormStatus() {
|
|
|
310
310
|
}
|
|
311
311
|
function getPath(source, path) {
|
|
312
312
|
let current = source;
|
|
313
|
-
for (const part of path.
|
|
313
|
+
for (const part of path.replaceAll(/\[(\d+)\]/g, ".$1").split(".")) {
|
|
314
314
|
if (current === null || typeof current !== "object") return void 0;
|
|
315
315
|
current = current[part];
|
|
316
316
|
}
|
|
@@ -376,7 +376,7 @@ function currencySymbol(currency, locale) {
|
|
|
376
376
|
}
|
|
377
377
|
function parseMoney(text, currency, locale = "en") {
|
|
378
378
|
const digits = currencyDigits(currency);
|
|
379
|
-
const t = text.
|
|
379
|
+
const t = text.replaceAll(/[\s\u00a0\u202f']/g, "");
|
|
380
380
|
if (!t) return void 0;
|
|
381
381
|
const negative = t.startsWith("-");
|
|
382
382
|
const body = negative ? t.slice(1) : t;
|
|
@@ -393,7 +393,7 @@ function parseMoney(text, currency, locale = "en") {
|
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
if (!/^(\d*|\d{1,3}([.,]\d{3})+)$/.test(int)) return null;
|
|
396
|
-
int = int.
|
|
396
|
+
int = int.replaceAll(/[.,]/g, "");
|
|
397
397
|
if (!int && !frac) return null;
|
|
398
398
|
const units = BigInt(int || "0") * 10n ** BigInt(digits) + BigInt((frac || "").padEnd(digits, "0") || "0");
|
|
399
399
|
const value = Number(negative ? -units : units);
|