@krizaka/ui 4.7.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/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 +1 -1
- package/dist/architecture-diagram.js.map +1 -1
- package/dist/argument-card.d.ts +2 -2
- package/dist/argument-card.js +6 -6
- 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/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 +10 -10
- 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 +11 -11
- 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-Dkn0uX72.d.ts → schema-Dd05m48Q.d.ts} +1 -1
- 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 +3 -3
- 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 +7 -7
- package/registry/account-settings.json +17 -17
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +3 -3
- package/registry/activity-feed.json +2 -2
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +6 -6
- package/registry/app-header.json +4 -4
- package/registry/app-shell.json +2 -2
- package/registry/architecture-diagram.json +1 -1
- package/registry/argument-card.json +3 -3
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +3 -3
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +2 -2
- package/registry/chapter.json +2 -2
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +2 -2
- package/registry/choice-grid.json +2 -2
- package/registry/cn.json +1 -1
- package/registry/code-block.json +2 -2
- package/registry/collection-switcher.json +2 -2
- package/registry/columns.json +1 -1
- package/registry/combobox.json +2 -2
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/copy-button.json +2 -2
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +3 -3
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +2 -2
- package/registry/data-table.json +4 -4
- package/registry/date-picker.json +8 -8
- package/registry/decision-list.json +2 -2
- package/registry/description-list.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +2 -2
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +2 -2
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +2 -2
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/entity-header.json +2 -2
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +4 -4
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +64 -64
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +2 -2
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/identity-card.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +8 -8
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +2 -2
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +3 -3
- package/registry/list.json +2 -2
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +7 -7
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +2 -2
- package/registry/mascots.json +3 -3
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +2 -2
- package/registry/media-gallery.json +4 -4
- package/registry/meter.json +1 -1
- package/registry/money-input.json +1 -1
- package/registry/nav-bar.json +8 -8
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +2 -2
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +3 -3
- package/registry/page-index.json +2 -2
- package/registry/page.json +1 -1
- package/registry/pagination.json +2 -2
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/price-catalogue-editor.json +1 -1
- package/registry/pricing-page.json +2 -2
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +3 -3
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/qr-code.json +2 -2
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +14 -14
- package/registry/rail-nav.json +8 -8
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +3 -3
- package/registry/schema-form.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +2 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +3 -3
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +3 -3
- package/registry/shop-gallery.json +1 -1
- package/registry/shop.json +17 -17
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +2 -2
- package/registry/site-footer.json +10 -10
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +2 -2
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +2 -2
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +2 -2
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +2 -2
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +2 -2
- package/registry/text-style.json +8 -8
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +2 -2
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +2 -2
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +2 -2
- package/registry/video-player.json +2 -2
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +3 -3
- package/registry/wall.json +1 -1
- package/registry/waveform.json +1 -1
- 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/radio-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/radio-group/radio-group.tsx"],"sourcesContent":["// Client (a context). Radix RadioGroup: role=\"radiogroup\" / \"radio\", one tab stop, the arrows move and select, a\n// hidden input inside a form. Four looks, one behaviour:\n// - `RadioGroup.Item`: a dot and its words (a settings list);\n// - `RadioGroup.Card`: a whole card is the radio — an amount, a pack, a plan — its check lit when chosen;\n// - `RadioGroup.Button`: a tactile key that presses in — raised on a ledge, sunk when chosen (a size, a tip, a level);\n// - `RadioGroup.Segment` in `<RadioGroup.Root variant=\"segmented\">`: a segmented control, one light gliding to the choice.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { CheckGlyph } from \"../glyphs\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { tv } from \"../tv\";\n\nexport const radioGroup = tv({\n slots: {\n root: \"grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap\",\n item:\n \"peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-control bg-surface-1 inset-shadow-well transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:shadow-glow aria-invalid:border-danger\",\n dot: \"h-2 w-2 rounded-full bg-on-accent\",\n label: \"flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-70\",\n card:\n \"group relative flex min-w-0 flex-col items-start gap-1 rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 pr-10 text-left text-sm text-fg inset-shadow-edge \" +\n \"transition-[border-color,background-color,box-shadow,transform] duration-200 hover:border-border-strong active:scale-[0.99] motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft data-[state=checked]:shadow-glow\",\n // The card's check: an empty ring at rest, the accent filled with its check once chosen.\n cardCheck:\n \"absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-control bg-surface-1 text-on-accent transition-colors \" +\n \"group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent\",\n // The tactile key: on a ledge (its lower edge), its hairline stronger on hover, pressed in while held and once chosen.\n button:\n \"relative inline-flex min-h-12 min-w-12 select-none flex-col items-center justify-center gap-0.5 rounded-xl border border-border-default bg-surface-2 bg-sheen px-4 py-2 \" +\n \"text-sm font-semibold text-fg inset-shadow-edge shadow-[0_4px_0_0_var(--kz-border-strong)] \" +\n \"transition-[transform,box-shadow,background-color,border-color,color] duration-100 ease-out motion-reduce:transition-none \" +\n \"hover:border-border-strong \" +\n \"active:translate-y-[3px] active:shadow-[0_1px_0_0_var(--kz-border-strong)] \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:translate-y-[3px] data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:bg-fill-shade \" +\n \"data-[state=checked]:text-on-accent data-[state=checked]:inset-shadow-edge-fill data-[state=checked]:shadow-[0_1px_0_0_var(--kz-accent-hover)]\",\n buttonHint: \"text-[11px] font-medium text-fg-secondary group-data-[state=checked]:text-on-accent\",\n segmented:\n \"relative isolate inline-grid auto-cols-fr grid-flow-col gap-1 rounded-xl border border-border-default bg-surface-2 p-1 inset-shadow-well \" +\n \"before:pointer-events-none before:absolute before:left-0 before:top-0 before:-z-10 before:h-(--kz-ind-h) before:w-(--kz-ind-w) \" +\n \"before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:border before:border-border-default before:bg-surface-0 before:bg-sheen \" +\n \"before:opacity-0 before:shadow-raised before:transition-[translate,width,height,opacity] before:duration-300 motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n segment:\n \"inline-flex min-h-9 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3.5 text-sm font-semibold text-fg-secondary transition-colors \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border data-[state=checked]:border-border-default data-[state=checked]:bg-surface-0 data-[state=checked]:text-fg data-[state=checked]:shadow-raised \" +\n \"group-data-[indicator=on]/seg:data-[state=checked]:border-transparent group-data-[indicator=on]/seg:data-[state=checked]:bg-transparent group-data-[indicator=on]/seg:data-[state=checked]:shadow-none\",\n },\n variants: {\n variant: {\n list: {},\n cards: { root: \"grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-3\" },\n buttons: { root: \"flex flex-wrap gap-2.5 pb-1\" },\n segmented: {},\n },\n },\n defaultVariants: { variant: \"list\" },\n});\nconst s = radioGroup();\n\nexport type RadioGroupRootProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n /** The group's accessible name — passed translated (or `aria-labelledby` a visible heading). */\n label?: string;\n /** Marks every radio invalid: aria-invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n /**\n * The layout of the radios: `list` (dots), `cards` (a grid of `Card`s), `buttons` (a row of tactile `Button`s), or\n * `segmented` (a track of `Segment`s, one light gliding to the choice).\n * @default \"list\"\n */\n variant?: \"list\" | \"cards\" | \"buttons\" | \"segmented\";\n /** Binds the choice to this search parameter of the URL (`?kind=…`): the URL is the state — for a view's selection (a segmented switch), not a form field. */\n routeKey?: string;\n /** The values the parameter may hold (the radios' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form, `variant` for the layout. */\nexport function RadioGroupRoot({ label, invalid, variant = \"list\", className, routeKey, routeValues, ...rest }: RadioGroupRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=radio]\", active: \"[role=radio][data-state=checked]\" });\n const segmented = variant === \"segmented\";\n return (\n <RadioGroupPrimitive.Root\n ref={segmented ? ref : undefined}\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-variant={variant}\n orientation={segmented ? \"horizontal\" : props.orientation}\n className={segmented ? s.segmented({ className: [\"group/seg\", className].filter(Boolean).join(\" \") }) : radioGroup({ variant }).root({ className })}\n {...props}\n />\n );\n}\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Item>, \"children\"> & {\n /** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */\n children?: React.ReactNode;\n};\n\n/** A radio: a dot, and its words when given. */\nexport function RadioGroupItem({ className, children, ...props }: RadioGroupItemProps) {\n const item = (\n <RadioGroupPrimitive.Item className={s.item({ className: children ? \"mt-0.5\" : className })} {...props}>\n <RadioGroupPrimitive.Indicator className={s.dot()} />\n </RadioGroupPrimitive.Item>\n );\n if (!children) return item;\n return (\n <label className={s.label({ className })}>\n {item}\n <span className=\"min-w-0\">{children}</span>\n </label>\n );\n}\n\n/** A whole card as the radio: its content is the radio's name; its check lights up when chosen. */\nexport function RadioGroupCard({ className, children, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item className={s.card({ className })} {...props}>\n {children}\n <span aria-hidden className={s.cardCheck()}>\n <RadioGroupPrimitive.Indicator forceMount className=\"inline-flex data-[state=unchecked]:hidden\">\n <CheckGlyph className=\"h-3 w-3\" />\n </RadioGroupPrimitive.Indicator>\n </span>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport type RadioGroupButtonProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {\n /** A second line under the words (\"+15 %\"), part of the radio's name. */\n hint?: React.ReactNode;\n};\n\n/** A tactile key: raised on its ledge, pressed in while held and once chosen — sizes, a tip, a level. */\nexport function RadioGroupButton({ className, children, hint, ...props }: RadioGroupButtonProps) {\n return (\n <RadioGroupPrimitive.Item className={s.button({ className: [\"group\", className].filter(Boolean).join(\" \") })} {...props}>\n <span>{children}</span>\n {hint ? <span className={s.buttonHint()}>{hint}</span> : null}\n </RadioGroupPrimitive.Item>\n );\n}\n\n/** A segment of a `variant=\"segmented\"` group: equal widths, one light gliding to the choice. */\nexport function RadioGroupSegment({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return <RadioGroupPrimitive.Item className={s.segment({ className })} {...props} />;\n}\n\n/** `RadioGroup.Root/Item/Card/Button/Segment`. */\nexport const RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupCard, Button: RadioGroupButton, Segment: RadioGroupSegment };\n"],"mappings":";;;;;;;;;;;;;AAMA,SAAS,cAAc,2BAA2B;AAIlD,SAAS,uBAAuB;AA+E5B,cA2BA,YA3BA;AA3EG,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MACE;AAAA,IAGF,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MACE;AAAA;AAAA,IAKF,WACE;AAAA;AAAA,IAGF,QACE;AAAA,IAQF,YAAY;AAAA,IACZ,WACE;AAAA,IAIF,SACE;AAAA,EAIJ;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM,CAAC;AAAA,MACP,OAAO,EAAE,MAAM,uDAAuD;AAAA,MACtE,SAAS,EAAE,MAAM,8BAA8B;AAAA,MAC/C,WAAW,CAAC;AAAA,IACd;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,OAAO;AACrC,CAAC;AACD,IAAM,IAAI,WAAW;AAoBd,SAAS,eAAe,EAAE,OAAO,SAAS,UAAU,QAAQ,WAAW,UAAU,aAAa,GAAG,KAAK,GAAwB;AACnI,QAAM,QAAQ,gBAAgB,UAAU,aAAa,IAAI;AACzD,QAAM,EAAE,IAAI,IAAI,oBAAoC,EAAE,MAAM,gBAAgB,QAAQ,mCAAmC,CAAC;AACxH,QAAM,YAAY,YAAY;AAC9B,SACE;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EAAyB,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,SAAS,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAAE,CAAC,GAAI,GAAG,OAChH;AAAA,wBAAC,UAAM,UAAS;AAAA,IACf,OAAO,oBAAC,UAAK,WAAW,EAAE,WAAW,GAAI,gBAAK,IAAU;AAAA,KAC3D;AAEJ;AAGO,SAAS,kBAAkB,EAAE,WAAW,GAAG,MAAM,GAA0D;AAChH,SAAO,oBAAC,oBAAoB,MAApB,EAAyB,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AACnF;AAGO,IAAM,aAAa,EAAE,MAAM,gBAAgB,MAAM,gBAAgB,MAAM,gBAAgB,QAAQ,kBAAkB,SAAS,kBAAkB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/radio-group/radio-group.tsx"],"sourcesContent":["// Client (a context). Radix RadioGroup: role=\"radiogroup\" / \"radio\", one tab stop, the arrows move and select, a\n// hidden input inside a form. Four looks, one behaviour:\n// - `RadioGroup.Item`: a dot and its words (a settings list);\n// - `RadioGroup.Card`: a whole card is the radio — an amount, a pack, a plan — its check lit when chosen;\n// - `RadioGroup.Button`: a tactile key that presses in — raised on a ledge, sunk when chosen (a size, a tip, a level);\n// - `RadioGroup.Segment` in `<RadioGroup.Root variant=\"segmented\">`: a segmented control, one light gliding to the choice.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { CheckGlyph } from \"../glyphs\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { tv } from \"../tv\";\n\nexport const radioGroup = tv({\n slots: {\n root: \"grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap\",\n item:\n \"peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-control bg-surface-1 inset-shadow-well transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:shadow-glow aria-invalid:border-danger\",\n dot: \"h-2 w-2 rounded-full bg-on-accent\",\n label: \"flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-70\",\n card:\n \"group relative flex min-w-0 flex-col items-start gap-1 rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 pr-10 text-left text-sm text-fg inset-shadow-edge \" +\n \"transition-[border-color,background-color,box-shadow,transform] duration-200 hover:border-border-strong active:scale-[0.99] motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft data-[state=checked]:shadow-glow\",\n // The card's check: an empty ring at rest, the accent filled with its check once chosen.\n cardCheck:\n \"absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-control bg-surface-1 text-on-accent transition-colors \" +\n \"group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent\",\n // The tactile key: on a ledge (its lower edge), its hairline stronger on hover, pressed in while held and once chosen.\n button:\n \"relative inline-flex min-h-12 min-w-12 select-none flex-col items-center justify-center gap-0.5 rounded-xl border border-border-default bg-surface-2 bg-sheen px-4 py-2 \" +\n \"text-sm font-semibold text-fg inset-shadow-edge shadow-[0_4px_0_0_var(--kz-border-strong)] \" +\n \"transition-[transform,box-shadow,background-color,border-color,color] duration-100 ease-out motion-reduce:transition-none \" +\n \"hover:border-border-strong \" +\n \"active:translate-y-[3px] active:shadow-[0_1px_0_0_var(--kz-border-strong)] \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:translate-y-[3px] data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:bg-fill-shade \" +\n \"data-[state=checked]:text-on-accent data-[state=checked]:inset-shadow-edge-fill data-[state=checked]:shadow-[0_1px_0_0_var(--kz-accent-hover)]\",\n buttonHint: \"text-[11px] font-medium text-fg-secondary group-data-[state=checked]:text-on-accent\",\n segmented:\n \"relative isolate inline-grid auto-cols-fr grid-flow-col gap-1 rounded-xl border border-border-default bg-surface-2 p-1 inset-shadow-well \" +\n \"before:pointer-events-none before:absolute before:left-0 before:top-0 before:-z-10 before:h-(--kz-ind-h) before:w-(--kz-ind-w) \" +\n \"before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:border before:border-border-default before:bg-surface-0 before:bg-sheen \" +\n \"before:opacity-0 before:shadow-raised before:transition-[translate,width,height,opacity] before:duration-300 motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n segment:\n \"inline-flex min-h-9 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3.5 text-sm font-semibold text-fg-secondary transition-colors \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border data-[state=checked]:border-border-default data-[state=checked]:bg-surface-0 data-[state=checked]:text-fg data-[state=checked]:shadow-raised \" +\n \"group-data-[indicator=on]/seg:data-[state=checked]:border-transparent group-data-[indicator=on]/seg:data-[state=checked]:bg-transparent group-data-[indicator=on]/seg:data-[state=checked]:shadow-none\",\n },\n variants: {\n variant: {\n list: {},\n cards: { root: \"grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-3\" },\n buttons: { root: \"flex flex-wrap gap-2.5 pb-1\" },\n segmented: {},\n },\n },\n defaultVariants: { variant: \"list\" },\n});\nconst s = radioGroup();\n\nexport type RadioGroupRootProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n /** The group's accessible name — passed translated (or `aria-labelledby` a visible heading). */\n label?: string;\n /** Marks every radio invalid: aria-invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n /**\n * The layout of the radios: `list` (dots), `cards` (a grid of `Card`s), `buttons` (a row of tactile `Button`s), or\n * `segmented` (a track of `Segment`s, one light gliding to the choice).\n * @default \"list\"\n */\n variant?: \"list\" | \"cards\" | \"buttons\" | \"segmented\";\n /** Binds the choice to this search parameter of the URL (`?kind=…`): the URL is the state — for a view's selection (a segmented switch), not a form field. */\n routeKey?: string;\n /** The values the parameter may hold (the radios' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form, `variant` for the layout. */\nexport function RadioGroupRoot({ label, invalid, variant = \"list\", className, routeKey, routeValues, ...rest }: Readonly<RadioGroupRootProps>) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=radio]\", active: \"[role=radio][data-state=checked]\" });\n const segmented = variant === \"segmented\";\n return (\n <RadioGroupPrimitive.Root\n ref={segmented ? ref : undefined}\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-variant={variant}\n orientation={segmented ? \"horizontal\" : props.orientation}\n className={segmented ? s.segmented({ className: [\"group/seg\", className].filter(Boolean).join(\" \") }) : radioGroup({ variant }).root({ className })}\n {...props}\n />\n );\n}\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Item>, \"children\"> & {\n /** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */\n children?: React.ReactNode;\n};\n\n/** A radio: a dot, and its words when given. */\nexport function RadioGroupItem({ className, children, ...props }: Readonly<RadioGroupItemProps>) {\n const item = (\n <RadioGroupPrimitive.Item className={s.item({ className: children ? \"mt-0.5\" : className })} {...props}>\n <RadioGroupPrimitive.Indicator className={s.dot()} />\n </RadioGroupPrimitive.Item>\n );\n if (!children) return item;\n return (\n <label className={s.label({ className })}>\n {item}\n <span className=\"min-w-0\">{children}</span>\n </label>\n );\n}\n\n/** A whole card as the radio: its content is the radio's name; its check lights up when chosen. */\nexport function RadioGroupCard({ className, children, ...props }: Readonly<React.ComponentProps<typeof RadioGroupPrimitive.Item>>) {\n return (\n <RadioGroupPrimitive.Item className={s.card({ className })} {...props}>\n {children}\n <span aria-hidden className={s.cardCheck()}>\n <RadioGroupPrimitive.Indicator forceMount className=\"inline-flex data-[state=unchecked]:hidden\">\n <CheckGlyph className=\"h-3 w-3\" />\n </RadioGroupPrimitive.Indicator>\n </span>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport type RadioGroupButtonProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {\n /** A second line under the words (\"+15 %\"), part of the radio's name. */\n hint?: React.ReactNode;\n};\n\n/** A tactile key: raised on its ledge, pressed in while held and once chosen — sizes, a tip, a level. */\nexport function RadioGroupButton({ className, children, hint, ...props }: Readonly<RadioGroupButtonProps>) {\n return (\n <RadioGroupPrimitive.Item className={s.button({ className: [\"group\", className].filter(Boolean).join(\" \") })} {...props}>\n <span>{children}</span>\n {hint ? <span className={s.buttonHint()}>{hint}</span> : null}\n </RadioGroupPrimitive.Item>\n );\n}\n\n/** A segment of a `variant=\"segmented\"` group: equal widths, one light gliding to the choice. */\nexport function RadioGroupSegment({ className, ...props }: Readonly<React.ComponentProps<typeof RadioGroupPrimitive.Item>>) {\n return <RadioGroupPrimitive.Item className={s.segment({ className })} {...props} />;\n}\n\n/** `RadioGroup.Root/Item/Card/Button/Segment`. */\nexport const RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupCard, Button: RadioGroupButton, Segment: RadioGroupSegment };\n"],"mappings":";;;;;;;;;;;;;AAMA,SAAS,cAAc,2BAA2B;AAIlD,SAAS,uBAAuB;AA+E5B,cA2BA,YA3BA;AA3EG,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MACE;AAAA,IAGF,KAAK;AAAA,IACL,OAAO;AAAA,IAC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;
|
|
113
113
|
/** The frame of the page: the rail, then `RailNav.Body` (the header and the content). A row on a desktop. */
|
|
114
|
-
declare function RailNavShell({ className, ...props }: React.ComponentProps<"div"
|
|
114
|
+
declare function RailNavShell({ className, ...props }: Readonly<React.ComponentProps<"div">>): React.JSX.Element;
|
|
115
115
|
/** The column beside the rail: the `AppHeader`, then the content. On a phone it keeps clear of the tab bar. */
|
|
116
|
-
declare function RailNavBody({ className, ...props }: React.ComponentProps<"div"
|
|
116
|
+
declare function RailNavBody({ className, ...props }: Readonly<React.ComponentProps<"div">>): React.JSX.Element;
|
|
117
117
|
type RailNavRootProps = Omit<React.ComponentProps<"nav">, "children"> & {
|
|
118
118
|
/** The navigation's accessible name (`Sovkora`, `Studio`). */
|
|
119
119
|
label: string;
|
|
@@ -141,7 +141,7 @@ type RailNavRootProps = Omit<React.ComponentProps<"nav">, "children"> & {
|
|
|
141
141
|
expandLabels?: readonly [string, string];
|
|
142
142
|
};
|
|
143
143
|
/** The rail: a vertical column of icons on a desktop, a bottom tab bar on a phone. */
|
|
144
|
-
declare function RailNavRoot({ label, mark, accent, children, footer, shortcuts, shortcutsLabel, expandable, expanded: controlled, defaultExpanded, onExpandedChange, expandLabels, className, onKeyDown, ...props }: RailNavRootProps): React.JSX.Element;
|
|
144
|
+
declare function RailNavRoot({ label, mark, accent, children, footer, shortcuts, shortcutsLabel, expandable, expanded: controlled, defaultExpanded, onExpandedChange, expandLabels, className, onKeyDown, ...props }: Readonly<RailNavRootProps>): React.JSX.Element;
|
|
145
145
|
type RailNavItemProps = Omit<React.ComponentProps<"a">, "children"> & {
|
|
146
146
|
/** The item's icon (a signature icon of `@krizaka/icons`): all that shows on a desktop rail. */
|
|
147
147
|
icon: React.ReactNode;
|
|
@@ -158,7 +158,7 @@ type RailNavItemProps = Omit<React.ComponentProps<"a">, "children"> & {
|
|
|
158
158
|
children?: React.ReactElement;
|
|
159
159
|
};
|
|
160
160
|
/** A destination of the rail. */
|
|
161
|
-
declare function RailNavItem({ icon, label, current, badge, badgeLabel, asChild, children, className, ...props }: RailNavItemProps): React.JSX.Element;
|
|
161
|
+
declare function RailNavItem({ icon, label, current, badge, badgeLabel, asChild, children, className, ...props }: Readonly<RailNavItemProps>): React.JSX.Element;
|
|
162
162
|
declare const RailNav: {
|
|
163
163
|
Shell: typeof RailNavShell;
|
|
164
164
|
Root: typeof RailNavRoot;
|
package/dist/rail-nav.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Tooltip
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WVZF6WK3.js";
|
|
5
5
|
import {
|
|
6
6
|
ChevronGlyph
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3TCHVNNB.js";
|
|
8
8
|
import {
|
|
9
9
|
cn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HHBTM4AU.js";
|
|
11
11
|
|
|
12
12
|
// src/rail-nav/rail-nav.tsx
|
|
13
13
|
import { Slot } from "radix-ui";
|
package/dist/rail-nav.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rail-nav/rail-nav.tsx"],"sourcesContent":["// Client (the expand state, the arrow keys, the tooltip). The compact navigation of an application, read from Sovkora's\n// web client: a vertical rail of icons on a desktop — the product's mark on top, a tooltip on each icon, the current one\n// marked by an accent bar on its left edge, a footer for settings and the account — that becomes a bottom tab bar on a\n// phone. The same nodes in both: only the layout changes, so the items, their order and their words are written once.\n// The mark lives in the rail on a desktop; on a phone, where the rail has no room for it, `AppHeader` shows it (the rule\n// « one mark visible at every width »). Brand-aware through the tokens: `accent` scopes `.brand-<id>`.\nimport { Tooltip } from \"@krizaka/ui/tooltip\";\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { ChevronGlyph } from \"../glyphs\";\nimport type { BrandId } from \"../marks/ProductLogo\";\n\nexport const railNav = tv({\n slots: {\n shell: \"flex min-h-dvh w-full bg-surface-0 text-fg\",\n root:\n // Phone: a bottom tab bar, clear of the home indicator. Desktop: a sticky column that is only as wide as its icons.\n \"fixed inset-x-0 bottom-0 z-40 flex h-[calc(3.5rem+env(safe-area-inset-bottom))] flex-row border-t border-border-subtle bg-surface-1 pb-[env(safe-area-inset-bottom)] \" +\n \"md:sticky md:overflow-x-clip md:inset-auto md:top-0 md:bottom-auto md:z-auto md:h-dvh md:w-14 md:shrink-0 md:flex-col md:border-t-0 md:border-r md:bg-surface-1 md:pb-0 \" +\n \"md:transition-[width] md:duration-300 motion-reduce:md:transition-none md:data-expanded:w-56\",\n // The mark is the rail's on a desktop; hidden on a phone (the header carries it there).\n mark: \"hidden h-14 w-full shrink-0 items-center overflow-hidden justify-center md:flex md:group-data-expanded/rail:justify-start md:group-data-expanded/rail:px-4\",\n group: \"flex min-w-0 flex-row items-stretch md:flex-col md:items-center md:gap-1 md:px-1.5 md:group-data-expanded/rail:items-stretch\",\n main: \"max-md:grow-(--rail-n) md:flex-1 md:py-2\",\n foot: \"max-md:grow-(--rail-n) md:border-t md:border-border-subtle md:py-2\",\n // The shortcuts: the product's quick ways in (a saved view, a client, « new invoice »), desktop only — a phone's tab bar\n // keeps its five destinations. Their heading shows once the rail is expanded; collapsed, it names the group.\n shortcuts: \"hidden md:flex md:border-t md:border-border-subtle md:py-2\",\n shortcutsHeading: \"sr-only md:group-data-expanded/rail:not-sr-only md:group-data-expanded/rail:px-3.5 md:group-data-expanded/rail:pb-1 md:group-data-expanded/rail:pt-1 text-[11px] font-semibold text-fg-secondary\",\n item:\n \"group/item relative flex min-w-0 flex-1 flex-col items-center justify-center gap-0.5 px-1 text-[11px] font-medium text-fg-secondary no-underline transition-colors \" +\n \"hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring-inset \" +\n \"aria-[current=page]:bg-accent-soft aria-[current=page]:text-fg-accent \" +\n // The accent bar: on the top edge of a tab, on the left edge of a rail item.\n \"before:absolute before:inset-x-3 before:top-0 before:h-[3px] before:rounded-b-full before:bg-accent before:opacity-0 before:transition-opacity aria-[current=page]:before:opacity-100 \" +\n \"md:h-10 md:w-full md:flex-none md:flex-row md:justify-center md:gap-3 md:rounded-none md:px-0 md:text-sm \" +\n \"md:before:inset-x-auto md:before:inset-y-2 md:before:left-0 md:before:top-2 md:before:h-auto md:before:w-[3px] md:before:rounded-r-full md:before:rounded-b-none \" +\n \"md:group-data-expanded/rail:justify-start md:group-data-expanded/rail:px-3.5 [&>svg]:h-5 [&>svg]:w-5 [&>svg]:shrink-0\",\n icon: \"relative inline-flex shrink-0 items-center justify-center [&>svg]:h-5 [&>svg]:w-5\",\n label: \"max-w-full truncate leading-none md:sr-only md:text-sm md:leading-normal md:group-data-expanded/rail:not-sr-only\",\n badge:\n \"absolute -right-2 -top-1.5 inline-flex min-w-4 items-center justify-center rounded-sm bg-accent px-1 text-[10px] font-bold leading-4 text-on-accent after:content-[attr(data-count)]\",\n toggle:\n \"hidden h-10 w-full items-center justify-center gap-3 text-xs font-medium text-fg-secondary hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring-inset md:flex \" +\n \"md:group-data-expanded/rail:justify-start md:group-data-expanded/rail:px-3.5\",\n body: \"flex min-w-0 flex-1 flex-col max-md:pb-[calc(3.5rem+env(safe-area-inset-bottom))]\",\n },\n});\nconst s = railNav();\n\ninterface RailState {\n expanded: boolean;\n}\nconst RailContext = React.createContext<RailState | null>(null);\nconst useRail = () => {\n const ctx = React.useContext(RailContext);\n if (!ctx) throw new Error(\"RailNav parts must be inside <RailNav.Root>\");\n return ctx;\n};\n\n/** The frame of the page: the rail, then `RailNav.Body` (the header and the content). A row on a desktop. */\nexport function RailNavShell({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.shell({ className })} {...props} />;\n}\n\n/** The column beside the rail: the `AppHeader`, then the content. On a phone it keeps clear of the tab bar. */\nexport function RailNavBody({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.body({ className })} {...props} />;\n}\n\nexport type RailNavRootProps = Omit<React.ComponentProps<\"nav\">, \"children\"> & {\n /** The navigation's accessible name (`Sovkora`, `Studio`). */\n label: string;\n /** The product's mark on top of the rail, as a link home (`<Link href=\"/\"><ProductLogo id=\"sovkora\" /></Link>`); named by the app (its `aria-label`). Hidden on a phone: `AppHeader` shows it there. */\n mark?: React.ReactNode;\n /** The product's brand: scopes its colours (`brand-sovkora`…) over the rail, so the accent follows. Omit it inside a page that already wears the brand. */\n accent?: BrandId;\n /** The main destinations: `RailNav.Item`, the ones you work in. Five at most so that they fit a phone's tab bar. */\n children: React.ReactNode;\n /** At the foot of the rail (settings, account), after the main items; on a phone they follow them in the same bar. `RailNav.Item`s or a control with `data-rail-item`. */\n footer?: React.ReactNode;\n /** The product's shortcuts (`RailNav.Item`s: a saved view, a client, « New invoice »), a group above the footer and the expand toggle. Desktop only: a phone's tab bar keeps its destinations. */\n shortcuts?: React.ReactNode;\n /** The shortcuts' heading (« Raccourcis », « Shortcuts ») — passed translated: the group's name, shown once the rail is expanded. */\n shortcutsLabel?: string;\n /** Adds a button that widens the rail to show the words (desktop only). Needs `expandLabels`. */\n expandable?: boolean;\n /** Controlled width (pair with `onExpandedChange` to keep the choice). */\n expanded?: boolean;\n /** The starting width when uncontrolled. Unset: expanded from 1280 px (the words fit there), narrow below — until the person toggles it. */\n defaultExpanded?: boolean;\n /** Called when the toggle widens or narrows the rail. */\n onExpandedChange?: (expanded: boolean) => void;\n /** The toggle's words, `[expand, collapse]`. */\n expandLabels?: readonly [string, string];\n};\n\nconst count = (node: React.ReactNode) => React.Children.toArray(node).length;\n\n// The width from which an expandable rail shows its words by default — 80 rem (1280 px), Tailwind's `xl`.\nconst WIDE = \"(min-width: 80rem)\";\nconst subscribeWide = (onChange: () => void) => {\n if (globalThis.window === undefined || !globalThis.matchMedia) return () => undefined;\n const query = globalThis.matchMedia(WIDE);\n query.addEventListener(\"change\", onChange);\n return () => query.removeEventListener(\"change\", onChange);\n};\nconst isWide = () => globalThis.window !== undefined && Boolean(globalThis.matchMedia?.(WIDE).matches);\n/** Whether the window is 1280 px wide or more; `false` on the server (the rail then widens before the first paint). */\nfunction useWide() {\n return React.useSyncExternalStore(subscribeWide, isWide, () => false);\n}\n\n/** Moves the focus along the rail's items with the arrows (↑ ↓ on the rail, ← → on the tab bar; both always work), Home and End. */\nfunction moveFocus(event: React.KeyboardEvent<HTMLElement>) {\n const keys: Record<string, number> = { ArrowDown: 1, ArrowRight: 1, ArrowUp: -1, ArrowLeft: -1 };\n const step = keys[event.key];\n if (step === undefined && event.key !== \"Home\" && event.key !== \"End\") return;\n const items = [...event.currentTarget.querySelectorAll<HTMLElement>(\"[data-rail-item]\")];\n if (items.length === 0) return;\n const here = items.findIndex((el) => el === document.activeElement || el.contains(document.activeElement));\n let next: number;\n if (event.key === \"Home\") next = 0;\n else if (event.key === \"End\") next = items.length - 1;\n else if (here < 0) next = step > 0 ? 0 : items.length - 1;\n else next = (here + step + items.length) % items.length;\n event.preventDefault();\n items[next]?.focus();\n}\n\n/** The rail: a vertical column of icons on a desktop, a bottom tab bar on a phone. */\nexport function RailNavRoot({\n label, mark, accent, children, footer, shortcuts, shortcutsLabel, expandable, expanded: controlled, defaultExpanded, onExpandedChange, expandLabels, className, onKeyDown, ...props\n}: RailNavRootProps) {\n const [own, setOwn] = React.useState<boolean | undefined>(defaultExpanded);\n const wide = useWide();\n const headingId = React.useId();\n const expanded = expandable ? (controlled ?? own ?? wide) : false;\n const toggle = () => {\n if (controlled === undefined) setOwn(!expanded);\n onExpandedChange?.(!expanded);\n };\n const value = React.useMemo(() => ({ expanded }), [expanded]);\n return (\n <RailContext.Provider value={value}>\n <nav\n aria-label={label}\n data-expanded={expanded ? \"\" : undefined}\n className={cn(\"group/rail\", accent && \"brand-\" + accent, s.root({ className }))}\n onKeyDown={(e) => {\n onKeyDown?.(e);\n if (!e.defaultPrevented) moveFocus(e);\n }}\n {...props}\n >\n {mark && (\n <div data-brand-mark className={s.mark()}>\n {mark}\n </div>\n )}\n <div className={s.group({ className: s.main() })} style={{ [\"--rail-n\" as string]: Math.max(count(children), 1) }}>\n {children}\n </div>\n {shortcuts && (\n <div role=\"group\" aria-labelledby={shortcutsLabel ? headingId : undefined} data-rail-shortcuts=\"\" className={s.group({ className: s.shortcuts() })}>\n {shortcutsLabel && (\n <p id={headingId} className={s.shortcutsHeading()}>\n {shortcutsLabel}\n </p>\n )}\n {shortcuts}\n </div>\n )}\n {(footer || expandable) && (\n <div className={s.group({ className: s.foot() })} style={{ [\"--rail-n\" as string]: Math.max(count(footer), 1) }}>\n {footer}\n {expandable && expandLabels && (\n <button type=\"button\" data-rail-item className={s.toggle()} aria-expanded={expanded} onClick={toggle}>\n <ChevronGlyph direction={expanded ? \"left\" : \"right\"} className=\"h-4 w-4 shrink-0\" />\n <span className={expanded ? undefined : \"sr-only\"}>{expanded ? expandLabels[1] : expandLabels[0]}</span>\n </button>\n )}\n </div>\n )}\n </nav>\n </RailContext.Provider>\n );\n}\n\nexport type RailNavItemProps = Omit<React.ComponentProps<\"a\">, \"children\"> & {\n /** The item's icon (a signature icon of `@krizaka/icons`): all that shows on a desktop rail. */\n icon: React.ReactNode;\n /** Its words: the accessible name, the tooltip, the tab's caption on a phone, the row's text when the rail is expanded. */\n label: string;\n /** This is the section the user is in: `aria-current=\"page\"`, the accent bar and the accent colour. */\n current?: boolean;\n /** A count (unread, pending) on the icon. Say it in words with `badgeLabel`. */\n badge?: React.ReactNode;\n /** The count in words (« 3 unread »), appended to the accessible name. */\n badgeLabel?: string;\n /** Renders your router's link with the item's look: pass it as the only child. */\n asChild?: boolean;\n children?: React.ReactElement;\n};\n\n/** A destination of the rail. */\nexport function RailNavItem({ icon, label, current, badge, badgeLabel, asChild, children, className, ...props }: RailNavItemProps) {\n const { expanded } = useRail();\n const Comp = asChild ? Slot.Root : \"a\";\n const inner = (\n <>\n <span className={s.icon()}>\n {icon}\n {badge != null && (typeof badge === \"string\" || typeof badge === \"number\") ? (\n // Drawn by CSS, so the count is no text of the link: the visible text stays the label, which the name `Chat, 2 unread` contains.\n <span className={s.badge()} data-count={badge} aria-hidden />\n ) : (\n badge != null && <span className={s.badge()} aria-hidden>{badge}</span>\n )}\n </span>\n <span className={s.label()}>{label}</span>\n </>\n );\n const link = (\n <Comp data-rail-item aria-label={badgeLabel ? `${label}, ${badgeLabel}` : label} aria-current={current ? \"page\" : undefined} className={s.item({ className })} {...props}>\n {asChild && children ? React.cloneElement(children, undefined, inner) : inner}\n </Comp>\n );\n // Expanded, the words are on the row; collapsed, the tooltip says them (Escape dismisses it, the keyboard focus shows it).\n return expanded ? link : <Tooltip content={label} side=\"right\">{link}</Tooltip>;\n}\n\nexport const RailNav = {\n Shell: RailNavShell,\n Root: RailNavRoot,\n Item: RailNavItem,\n Body: RailNavBody,\n};\n"],"mappings":";;;;;;;;;;;;AAOA,SAAS,YAAY;AACrB,YAAY,WAAW;AACvB,SAAS,UAAU;AAwDV,SAoJL,UApJK,KAsGC,YAtGD;AAlDF,IAAM,UAAU,GAAG;AAAA,EACxB,OAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA;AAAA,MAEE;AAAA;AAAA;AAAA,IAIF,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA;AAAA;AAAA,IAGN,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,MACE;AAAA,IAQF,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OACE;AAAA,IACF,QACE;AAAA,IAEF,MAAM;AAAA,EACR;AACF,CAAC;AACD,IAAM,IAAI,QAAQ;AAKlB,IAAM,cAAoB,oBAAgC,IAAI;AAC9D,IAAM,UAAU,MAAM;AACpB,QAAM,MAAY,iBAAW,WAAW;AACxC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,6CAA6C;AACvE,SAAO;AACT;AAGO,SAAS,aAAa,EAAE,WAAW,GAAG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AAC,UAAK,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,KACrC;AAEF,QAAM,OACJ,oBAAC,QAAK,kBAAc,MAAC,cAAY,aAAa,GAAG,KAAK,KAAK,UAAU,KAAK,OAAO,gBAAc,UAAU,SAAS,QAAW,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAChK,qBAAW,WAAiB,mBAAa,UAAU,QAAW,KAAK,IAAI,OAC1E;AAGF,SAAO,WAAW,OAAO,oBAAC,WAAQ,SAAS,OAAO,MAAK,SAAS,gBAAK;AACvE;AAEO,IAAM,UAAU;AAAA,EACrB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/rail-nav/rail-nav.tsx"],"sourcesContent":["// Client (the expand state, the arrow keys, the tooltip). The compact navigation of an application, read from Sovkora's\n// web client: a vertical rail of icons on a desktop — the product's mark on top, a tooltip on each icon, the current one\n// marked by an accent bar on its left edge, a footer for settings and the account — that becomes a bottom tab bar on a\n// phone. The same nodes in both: only the layout changes, so the items, their order and their words are written once.\n// The mark lives in the rail on a desktop; on a phone, where the rail has no room for it, `AppHeader` shows it (the rule\n// « one mark visible at every width »). Brand-aware through the tokens: `accent` scopes `.brand-<id>`.\nimport { Tooltip } from \"@krizaka/ui/tooltip\";\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { ChevronGlyph } from \"../glyphs\";\nimport type { BrandId } from \"../marks/ProductLogo\";\n\nexport const railNav = tv({\n slots: {\n shell: \"flex min-h-dvh w-full bg-surface-0 text-fg\",\n root:\n // Phone: a bottom tab bar, clear of the home indicator. Desktop: a sticky column that is only as wide as its icons.\n \"fixed inset-x-0 bottom-0 z-40 flex h-[calc(3.5rem+env(safe-area-inset-bottom))] flex-row border-t border-border-subtle bg-surface-1 pb-[env(safe-area-inset-bottom)] \" +\n \"md:sticky md:overflow-x-clip md:inset-auto md:top-0 md:bottom-auto md:z-auto md:h-dvh md:w-14 md:shrink-0 md:flex-col md:border-t-0 md:border-r md:bg-surface-1 md:pb-0 \" +\n \"md:transition-[width] md:duration-300 motion-reduce:md:transition-none md:data-expanded:w-56\",\n // The mark is the rail's on a desktop; hidden on a phone (the header carries it there).\n mark: \"hidden h-14 w-full shrink-0 items-center overflow-hidden justify-center md:flex md:group-data-expanded/rail:justify-start md:group-data-expanded/rail:px-4\",\n group: \"flex min-w-0 flex-row items-stretch md:flex-col md:items-center md:gap-1 md:px-1.5 md:group-data-expanded/rail:items-stretch\",\n main: \"max-md:grow-(--rail-n) md:flex-1 md:py-2\",\n foot: \"max-md:grow-(--rail-n) md:border-t md:border-border-subtle md:py-2\",\n // The shortcuts: the product's quick ways in (a saved view, a client, « new invoice »), desktop only — a phone's tab bar\n // keeps its five destinations. Their heading shows once the rail is expanded; collapsed, it names the group.\n shortcuts: \"hidden md:flex md:border-t md:border-border-subtle md:py-2\",\n shortcutsHeading: \"sr-only md:group-data-expanded/rail:not-sr-only md:group-data-expanded/rail:px-3.5 md:group-data-expanded/rail:pb-1 md:group-data-expanded/rail:pt-1 text-[11px] font-semibold text-fg-secondary\",\n item:\n \"group/item relative flex min-w-0 flex-1 flex-col items-center justify-center gap-0.5 px-1 text-[11px] font-medium text-fg-secondary no-underline transition-colors \" +\n \"hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring-inset \" +\n \"aria-[current=page]:bg-accent-soft aria-[current=page]:text-fg-accent \" +\n // The accent bar: on the top edge of a tab, on the left edge of a rail item.\n \"before:absolute before:inset-x-3 before:top-0 before:h-[3px] before:rounded-b-full before:bg-accent before:opacity-0 before:transition-opacity aria-[current=page]:before:opacity-100 \" +\n \"md:h-10 md:w-full md:flex-none md:flex-row md:justify-center md:gap-3 md:rounded-none md:px-0 md:text-sm \" +\n \"md:before:inset-x-auto md:before:inset-y-2 md:before:left-0 md:before:top-2 md:before:h-auto md:before:w-[3px] md:before:rounded-r-full md:before:rounded-b-none \" +\n \"md:group-data-expanded/rail:justify-start md:group-data-expanded/rail:px-3.5 [&>svg]:h-5 [&>svg]:w-5 [&>svg]:shrink-0\",\n icon: \"relative inline-flex shrink-0 items-center justify-center [&>svg]:h-5 [&>svg]:w-5\",\n label: \"max-w-full truncate leading-none md:sr-only md:text-sm md:leading-normal md:group-data-expanded/rail:not-sr-only\",\n badge:\n \"absolute -right-2 -top-1.5 inline-flex min-w-4 items-center justify-center rounded-sm bg-accent px-1 text-[10px] font-bold leading-4 text-on-accent after:content-[attr(data-count)]\",\n toggle:\n \"hidden h-10 w-full items-center justify-center gap-3 text-xs font-medium text-fg-secondary hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring-inset md:flex \" +\n \"md:group-data-expanded/rail:justify-start md:group-data-expanded/rail:px-3.5\",\n body: \"flex min-w-0 flex-1 flex-col max-md:pb-[calc(3.5rem+env(safe-area-inset-bottom))]\",\n },\n});\nconst s = railNav();\n\ninterface RailState {\n expanded: boolean;\n}\nconst RailContext = React.createContext<RailState | null>(null);\nconst useRail = () => {\n const ctx = React.useContext(RailContext);\n if (!ctx) throw new Error(\"RailNav parts must be inside <RailNav.Root>\");\n return ctx;\n};\n\n/** The frame of the page: the rail, then `RailNav.Body` (the header and the content). A row on a desktop. */\nexport function RailNavShell({ className, ...props }: Readonly<React.ComponentProps<\"div\">>) {\n return <div className={s.shell({ className })} {...props} />;\n}\n\n/** The column beside the rail: the `AppHeader`, then the content. On a phone it keeps clear of the tab bar. */\nexport function RailNavBody({ className, ...props }: Readonly<React.ComponentProps<\"div\">>) {\n return <div className={s.body({ className })} {...props} />;\n}\n\nexport type RailNavRootProps = Omit<React.ComponentProps<\"nav\">, \"children\"> & {\n /** The navigation's accessible name (`Sovkora`, `Studio`). */\n label: string;\n /** The product's mark on top of the rail, as a link home (`<Link href=\"/\"><ProductLogo id=\"sovkora\" /></Link>`); named by the app (its `aria-label`). Hidden on a phone: `AppHeader` shows it there. */\n mark?: React.ReactNode;\n /** The product's brand: scopes its colours (`brand-sovkora`…) over the rail, so the accent follows. Omit it inside a page that already wears the brand. */\n accent?: BrandId;\n /** The main destinations: `RailNav.Item`, the ones you work in. Five at most so that they fit a phone's tab bar. */\n children: React.ReactNode;\n /** At the foot of the rail (settings, account), after the main items; on a phone they follow them in the same bar. `RailNav.Item`s or a control with `data-rail-item`. */\n footer?: React.ReactNode;\n /** The product's shortcuts (`RailNav.Item`s: a saved view, a client, « New invoice »), a group above the footer and the expand toggle. Desktop only: a phone's tab bar keeps its destinations. */\n shortcuts?: React.ReactNode;\n /** The shortcuts' heading (« Raccourcis », « Shortcuts ») — passed translated: the group's name, shown once the rail is expanded. */\n shortcutsLabel?: string;\n /** Adds a button that widens the rail to show the words (desktop only). Needs `expandLabels`. */\n expandable?: boolean;\n /** Controlled width (pair with `onExpandedChange` to keep the choice). */\n expanded?: boolean;\n /** The starting width when uncontrolled. Unset: expanded from 1280 px (the words fit there), narrow below — until the person toggles it. */\n defaultExpanded?: boolean;\n /** Called when the toggle widens or narrows the rail. */\n onExpandedChange?: (expanded: boolean) => void;\n /** The toggle's words, `[expand, collapse]`. */\n expandLabels?: readonly [string, string];\n};\n\nconst count = (node: React.ReactNode) => React.Children.toArray(node).length;\n\n// The width from which an expandable rail shows its words by default — 80 rem (1280 px), Tailwind's `xl`.\nconst WIDE = \"(min-width: 80rem)\";\nconst subscribeWide = (onChange: () => void) => {\n if (globalThis.window === undefined || !globalThis.matchMedia) return () => undefined;\n const query = globalThis.matchMedia(WIDE);\n query.addEventListener(\"change\", onChange);\n return () => query.removeEventListener(\"change\", onChange);\n};\nconst isWide = () => globalThis.window !== undefined && Boolean(globalThis.matchMedia?.(WIDE).matches);\n/** Whether the window is 1280 px wide or more; `false` on the server (the rail then widens before the first paint). */\nfunction useWide() {\n return React.useSyncExternalStore(subscribeWide, isWide, () => false);\n}\n\n/** Moves the focus along the rail's items with the arrows (↑ ↓ on the rail, ← → on the tab bar; both always work), Home and End. */\nfunction moveFocus(event: React.KeyboardEvent<HTMLElement>) {\n const keys: Record<string, number> = { ArrowDown: 1, ArrowRight: 1, ArrowUp: -1, ArrowLeft: -1 };\n const step = keys[event.key];\n if (step === undefined && event.key !== \"Home\" && event.key !== \"End\") return;\n const items = [...event.currentTarget.querySelectorAll<HTMLElement>(\"[data-rail-item]\")];\n if (items.length === 0) return;\n const here = items.findIndex((el) => el === document.activeElement || el.contains(document.activeElement));\n let next: number;\n if (event.key === \"Home\") next = 0;\n else if (event.key === \"End\") next = items.length - 1;\n else if (here < 0) next = step > 0 ? 0 : items.length - 1;\n else next = (here + step + items.length) % items.length;\n event.preventDefault();\n items[next]?.focus();\n}\n\n/** The rail: a vertical column of icons on a desktop, a bottom tab bar on a phone. */\nexport function RailNavRoot({\n label, mark, accent, children, footer, shortcuts, shortcutsLabel, expandable, expanded: controlled, defaultExpanded, onExpandedChange, expandLabels, className, onKeyDown, ...props\n}: Readonly<RailNavRootProps>) {\n const [own, setOwn] = React.useState<boolean | undefined>(defaultExpanded);\n const wide = useWide();\n const headingId = React.useId();\n const expanded = expandable ? (controlled ?? own ?? wide) : false;\n const toggle = () => {\n if (controlled === undefined) setOwn(!expanded);\n onExpandedChange?.(!expanded);\n };\n const value = React.useMemo(() => ({ expanded }), [expanded]);\n return (\n <RailContext.Provider value={value}>\n <nav\n aria-label={label}\n data-expanded={expanded ? \"\" : undefined}\n className={cn(\"group/rail\", accent && \"brand-\" + accent, s.root({ className }))}\n onKeyDown={(e) => {\n onKeyDown?.(e);\n if (!e.defaultPrevented) moveFocus(e);\n }}\n {...props}\n >\n {mark && (\n <div data-brand-mark className={s.mark()}>\n {mark}\n </div>\n )}\n <div className={s.group({ className: s.main() })} style={{ [\"--rail-n\" as string]: Math.max(count(children), 1) }}>\n {children}\n </div>\n {shortcuts && (\n <div role=\"group\" aria-labelledby={shortcutsLabel ? headingId : undefined} data-rail-shortcuts=\"\" className={s.group({ className: s.shortcuts() })}>\n {shortcutsLabel && (\n <p id={headingId} className={s.shortcutsHeading()}>\n {shortcutsLabel}\n </p>\n )}\n {shortcuts}\n </div>\n )}\n {(footer || expandable) && (\n <div className={s.group({ className: s.foot() })} style={{ [\"--rail-n\" as string]: Math.max(count(footer), 1) }}>\n {footer}\n {expandable && expandLabels && (\n <button type=\"button\" data-rail-item className={s.toggle()} aria-expanded={expanded} onClick={toggle}>\n <ChevronGlyph direction={expanded ? \"left\" : \"right\"} className=\"h-4 w-4 shrink-0\" />\n <span className={expanded ? undefined : \"sr-only\"}>{expanded ? expandLabels[1] : expandLabels[0]}</span>\n </button>\n )}\n </div>\n )}\n </nav>\n </RailContext.Provider>\n );\n}\n\nexport type RailNavItemProps = Omit<React.ComponentProps<\"a\">, \"children\"> & {\n /** The item's icon (a signature icon of `@krizaka/icons`): all that shows on a desktop rail. */\n icon: React.ReactNode;\n /** Its words: the accessible name, the tooltip, the tab's caption on a phone, the row's text when the rail is expanded. */\n label: string;\n /** This is the section the user is in: `aria-current=\"page\"`, the accent bar and the accent colour. */\n current?: boolean;\n /** A count (unread, pending) on the icon. Say it in words with `badgeLabel`. */\n badge?: React.ReactNode;\n /** The count in words (« 3 unread »), appended to the accessible name. */\n badgeLabel?: string;\n /** Renders your router's link with the item's look: pass it as the only child. */\n asChild?: boolean;\n children?: React.ReactElement;\n};\n\n/** A destination of the rail. */\nexport function RailNavItem({ icon, label, current, badge, badgeLabel, asChild, children, className, ...props }: Readonly<RailNavItemProps>) {\n const { expanded } = useRail();\n const Comp = asChild ? Slot.Root : \"a\";\n const inner = (\n <>\n <span className={s.icon()}>\n {icon}\n {badge != null && (typeof badge === \"string\" || typeof badge === \"number\") ? (\n // Drawn by CSS, so the count is no text of the link: the visible text stays the label, which the name `Chat, 2 unread` contains.\n <span className={s.badge()} data-count={badge} aria-hidden />\n ) : (\n badge != null && <span className={s.badge()} aria-hidden>{badge}</span>\n )}\n </span>\n <span className={s.label()}>{label}</span>\n </>\n );\n const link = (\n <Comp data-rail-item aria-label={badgeLabel ? `${label}, ${badgeLabel}` : label} aria-current={current ? \"page\" : undefined} className={s.item({ className })} {...props}>\n {asChild && children ? React.cloneElement(children, undefined, inner) : inner}\n </Comp>\n );\n // Expanded, the words are on the row; collapsed, the tooltip says them (Escape dismisses it, the keyboard focus shows it).\n return expanded ? link : <Tooltip content={label} side=\"right\">{link}</Tooltip>;\n}\n\nexport const RailNav = {\n Shell: RailNavShell,\n Root: RailNavRoot,\n Item: RailNavItem,\n Body: RailNavBody,\n};\n"],"mappings":";;;;;;;;;;;;AAOA,SAAS,YAAY;AACrB,YAAY,WAAW;AACvB,SAAS,UAAU;AAwDV,SAoJL,UApJK,KAsGC,YAtGD;AAlDF,IAAM,UAAU,GAAG;AAAA,EACxB,OAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA;AAAA,MAEE;AAAA;AAAA;AAAA,IAIF,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA;AAAA;AAAA,IAGN,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,MACE;AAAA,IAQF,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OACE;AAAA,IACF,QACE;AAAA,IAEF,MAAM;AAAA,EACR;AACF,CAAC;AACD,IAAM,IAAI,QAAQ;AAKlB,IAAM,cAAoB,oBAAgC,IAAI;AAC9D,IAAM,UAAU,MAAM;AACpB,QAAM,MAAY,iBAAW,WAAW;AACxC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,6CAA6C;AACvE,SAAO;AACT;AAGO,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAA0C;AAC3F,SAAO,oBAAC,SAAI,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC5D;AAGO,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAA0C;AAC1F,SAAO,oBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,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AChK,qBAAW,WAAiB,mBAAa,UAAU,QAAW,KAAK,IAAI,OAC1E;AAGF,SAAO,WAAW,OAAO,oBAAC,WAAQ,SAAS,OAAO,MAAK,SAAS,gBAAK;AACvE;AAEO,IAAM,UAAU;AAAA,EACrB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;","names":[]}
|
package/dist/recipes.js
CHANGED
|
@@ -50,7 +50,7 @@ var words = (value) => typeof value === "string" ? value.split(/\s+/).filter(Boo
|
|
|
50
50
|
function withAlpha(color, opacity) {
|
|
51
51
|
const hex = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);
|
|
52
52
|
if (!hex) return color;
|
|
53
|
-
const [r, g, b] = hex.slice(1).map((part) => parseInt(part, 16));
|
|
53
|
+
const [r, g, b] = hex.slice(1).map((part) => Number.parseInt(part, 16));
|
|
54
54
|
return `rgba(${r},${g},${b},${opacity})`;
|
|
55
55
|
}
|
|
56
56
|
function slotNames(config) {
|
package/dist/recipes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/recipes/roles.ts","../src/recipes/native.ts"],"sourcesContent":["// The colour roles a recipe may name, by the Tailwind utility suffix the preset gives them (`bg-accent`,\n// `text-fg-secondary`, `border-border-default`) → the key of the same role in the native theme (`accent`, `textSecondary`,\n// `borderDefault`). One table: the web class and the native colour cannot name different tokens. `recipes.test.ts`\n// checks that every key of the right-hand side exists in the real native theme (@krizaka/tokens/native).\nexport const ROLES = {\n \"surface-0\": \"surface0\",\n \"surface-1\": \"surface1\",\n \"surface-2\": \"surface2\",\n \"surface-3\": \"surface3\",\n media: \"media\",\n scrim: \"scrim\",\n \"scrim-strong\": \"scrimStrong\",\n overlay: \"overlay\",\n \"border-subtle\": \"borderSubtle\",\n \"border-default\": \"borderDefault\",\n \"border-strong\": \"borderStrong\",\n fg: \"textPrimary\",\n \"fg-secondary\": \"textSecondary\",\n \"fg-muted\": \"textMuted\",\n \"fg-on-media\": \"textOnMedia\",\n \"fg-accent\": \"accentText\",\n \"fg-success\": \"successText\",\n \"fg-warning\": \"warningText\",\n \"fg-danger\": \"dangerText\",\n \"fg-info\": \"infoText\",\n accent: \"accent\",\n \"accent-hover\": \"accentHover\",\n \"accent-soft\": \"accentSoft\",\n \"accent-2\": \"accent2\",\n \"on-accent\": \"onAccent\",\n ring: \"ring\",\n success: \"success\",\n warning: \"warning\",\n danger: \"danger\",\n info: \"info\",\n \"success-soft\": \"successSoft\",\n \"warning-soft\": \"warningSoft\",\n \"danger-soft\": \"dangerSoft\",\n glass: \"glassBg\",\n \"glass-border\": \"glassBorder\",\n} as const;\n\nexport type RoleName = keyof typeof ROLES;\n\n/** Tailwind's type scale, in points (`text-xs` → 12). */\nexport const TEXT_SIZES = { xs: 12, sm: 14, base: 16, lg: 18, xl: 20, \"2xl\": 24, \"3xl\": 30 } as const;\n\nexport const FONT_WEIGHTS = { normal: \"400\", medium: \"500\", semibold: \"600\", bold: \"700\", extrabold: \"800\", black: \"900\" } as const;\n\n/** `tracking-*`, in em (React Native takes points: the resolver multiplies by the font size). */\nexport const TRACKING = { tighter: -0.05, tight: -0.025, normal: 0, wide: 0.025, wider: 0.05, widest: 0.1 } as const;\n","// The native side of a recipe: the classes of its variants, read into the styles React Native takes, on the roles of the\n// theme. Pure (no React Native, no theme import): the components wrap the result in `StyleSheet` and pass the theme.\n// What a phone has no use for (`hover:`, `focus-visible:`, shadows, transitions, the layout classes) is returned in\n// `ignored`, so a test can tell the classes that only the web has from the ones that were forgotten.\nimport { FONT_WEIGHTS, type RoleName, ROLES, TEXT_SIZES, TRACKING } from \"./roles\";\n\n/** The colour roles of a native theme (`Theme` of `@krizaka/ui/native`): a key, a colour. */\nexport type ThemeColors = Readonly<Record<string, string>>;\n\nexport type NativeFrame = {\n backgroundColor?: string;\n borderColor?: string;\n borderWidth?: number;\n height?: number;\n width?: number;\n minWidth?: number;\n paddingHorizontal?: number;\n paddingVertical?: number;\n padding?: number;\n gap?: number;\n opacity?: number;\n};\n\nexport type NativeText = {\n color?: string;\n fontSize?: number;\n fontWeight?: \"400\" | \"500\" | \"600\" | \"700\" | \"800\" | \"900\";\n letterSpacing?: number;\n textTransform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n};\n\n/** What one part of a component looks like: its frame (a View), its text, and the states that change them. */\nexport type NativeLook = {\n frame: NativeFrame;\n text: NativeText;\n /** `bg-<role>` of the part's dot (`[&>[data-dot]]:bg-accent`): the colour of a status dot. */\n dot?: string;\n /** `bg-linear-to-r from-<role> to-<role>`: the two stops of a gradient fill. */\n gradient?: readonly [string, string];\n /** `disabled:` — the frame and text while disabled. */\n disabled: { frame: NativeFrame; text: NativeText };\n /** `data-[state=on]:` — the frame and text while selected / pressed on. */\n on: { frame: NativeFrame; text: NativeText };\n /** The classes with no native meaning (the web's pointer states, shadows, layout…). */\n ignored: string[];\n};\n\ntype Props = Readonly<Record<string, string | number | boolean | null | undefined>>;\ntype Slot = string | readonly unknown[] | null | undefined;\ntype Config = {\n base?: Slot;\n slots?: Readonly<Record<string, Slot>>;\n variants?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;\n defaultVariants?: Readonly<Record<string, unknown>>;\n compoundVariants?: readonly Readonly<Record<string, unknown>>[];\n};\n\nconst BASE = \"base\";\n\nconst words = (value: unknown): string[] => (typeof value === \"string\" ? value.split(/\\s+/).filter(Boolean) : Array.isArray(value) ? value.flatMap(words) : []);\n\n/** `#rrggbb` at an opacity (`rgba()`); any other form passes through. */\nexport function withAlpha(color: string, opacity: number): string {\n const hex = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);\n if (!hex) return color;\n const [r, g, b] = hex.slice(1).map((part) => parseInt(part, 16));\n return `rgba(${r},${g},${b},${opacity})`;\n}\n\n/** The slots of a config: `slots` when it has some, else the single `base`. */\nfunction slotNames(config: Config): string[] {\n return config.slots ? Object.keys(config.slots) : [BASE];\n}\n\n/** The classes of each slot for some props: base, the chosen variants (defaults first), then the compound ones. */\nfunction classesFor(config: Config, props: Props): Record<string, string[]> {\n const names = slotNames(config);\n const out: Record<string, string[]> = Object.fromEntries(names.map((name) => [name, config.slots ? words(config.slots[name]) : words(config.base)]));\n // A string (or a list) is for the base; an object names the slots it is for.\n const add = (value: unknown) => {\n if (typeof value === \"string\" || Array.isArray(value)) (out[BASE] ??= []).push(...words(value));\n else if (value && typeof value === \"object\") for (const [name, classes] of Object.entries(value)) (out[name] ??= []).push(...words(classes));\n };\n const chosen = { ...config.defaultVariants, ...Object.fromEntries(Object.entries(props).filter(([, v]) => v !== undefined)) } as Record<string, unknown>;\n for (const [dimension, values] of Object.entries(config.variants ?? {})) {\n const key = String(chosen[dimension]);\n if (key in values) add(values[key]);\n }\n for (const compound of config.compoundVariants ?? []) {\n const { class: a, className: b, ...conditions } = compound as Record<string, unknown>;\n const matches = Object.entries(conditions).every(([dimension, expected]) => (Array.isArray(expected) ? expected.map(String).includes(String(chosen[dimension])) : String(chosen[dimension]) === String(expected)));\n if (matches) add(a ?? b);\n }\n return out;\n}\n\nconst empty = (): NativeLook => ({ frame: {}, text: {}, disabled: { frame: {}, text: {} }, on: { frame: {}, text: {} }, ignored: [] });\n\n/** `3` → 12, `0.5` → 2, `3.5` → 14: Tailwind's spacing unit is 4. */\nconst unit = (value: string): number | undefined => (/^\\d+(\\.\\d+)?$/.test(value) ? Number(value) * 4 : undefined);\n\n/** `accent`, `accent/40`, `transparent` → a colour of the theme, or `undefined` when it is not a role. */\nfunction colour(name: string, theme: ThemeColors): string | undefined {\n const [role, percent] = name.split(\"/\");\n if (role === \"transparent\") return \"transparent\";\n if (!role || !(role in ROLES)) return undefined;\n const resolved = theme[ROLES[role as RoleName]];\n if (resolved === undefined) return undefined;\n return percent === undefined ? resolved : withAlpha(resolved, Number(percent) / 100);\n}\n\n/** Reads one class into a look. Returns `false` when the class means nothing natively. */\nfunction apply(look: NativeLook, cls: string, theme: ThemeColors): boolean {\n // States: `disabled:` and `data-[state=on]:` are kept apart; every other prefix is a pointer, focus or media state.\n let target: { frame: NativeFrame; text: NativeText } = look;\n let utility = cls;\n if (cls.startsWith(\"disabled:\")) {\n target = look.disabled;\n utility = cls.slice(\"disabled:\".length);\n } else if (cls.startsWith(\"data-[state=on]:\")) {\n target = look.on;\n utility = cls.slice(\"data-[state=on]:\".length);\n } else if (cls.startsWith(\"[&>[data-dot]]:bg-\")) {\n const dot = colour(cls.slice(\"[&>[data-dot]]:bg-\".length), theme);\n if (dot === undefined) return false;\n look.dot = dot;\n return true;\n }\n if (utility.includes(\":\") || utility.startsWith(\"[&\")) return false;\n\n const { frame, text } = target;\n let match: RegExpExecArray | null;\n if (utility.startsWith(\"bg-linear-to-\")) return true;\n if ((match = /^bg-(.+)$/.exec(utility))) {\n const value = colour(match[1]!, theme);\n if (value === undefined) return false;\n frame.backgroundColor = value;\n return true;\n }\n if ((match = /^text-(.+)$/.exec(utility))) {\n const arbitrary = /^\\[(\\d+(?:\\.\\d+)?)px\\]$/.exec(match[1]!);\n if (arbitrary) return ((text.fontSize = Number(arbitrary[1])), true);\n if (match[1]! in TEXT_SIZES) return ((text.fontSize = TEXT_SIZES[match[1] as keyof typeof TEXT_SIZES]), true);\n const value = colour(match[1]!, theme);\n if (value === undefined) return false;\n text.color = value;\n return true;\n }\n if (utility === \"border\") return ((frame.borderWidth = 1), true);\n if ((match = /^(?:border|ring)-(.+)$/.exec(utility))) {\n if (match[1] === \"1\") return ((frame.borderWidth = 1), true);\n if (match[1] === \"inset\") return true;\n const value = colour(match[1]!, theme);\n if (value === undefined) return false;\n frame.borderColor = value;\n return true;\n }\n if (utility === \"ring-inset\") return true;\n if ((match = /^(h|w|min-w|px|py|p|gap)-(\\d+(?:\\.\\d+)?)$/.exec(utility))) {\n const points = unit(match[2]!)!;\n const key = { h: \"height\", w: \"width\", \"min-w\": \"minWidth\", px: \"paddingHorizontal\", py: \"paddingVertical\", p: \"padding\", gap: \"gap\" }[match[1]!] as keyof NativeFrame;\n (frame as Record<string, number>)[key] = points;\n return true;\n }\n if ((match = /^opacity-(\\d+)$/.exec(utility))) return ((frame.opacity = Number(match[1]) / 100), true);\n if ((match = /^font-(.+)$/.exec(utility)) && match[1]! in FONT_WEIGHTS) return ((text.fontWeight = FONT_WEIGHTS[match[1] as keyof typeof FONT_WEIGHTS]), true);\n if ((match = /^tracking-(.+)$/.exec(utility)) && match[1]! in TRACKING) return ((text.letterSpacing = TRACKING[match[1] as keyof typeof TRACKING]), true);\n if (utility === \"uppercase\" || utility === \"lowercase\" || utility === \"capitalize\") return ((text.textTransform = utility), true);\n if ((match = /^(from|to)-(.+)$/.exec(utility))) {\n const value = colour(match[2]!, theme);\n if (value === undefined) return false;\n const stops = [...(look.gradient ?? [\"transparent\", \"transparent\"])] as [string, string];\n stops[match[1] === \"from\" ? 0 : 1] = value;\n look.gradient = stops;\n return true;\n }\n return false;\n}\n\n/** `tracking-*` is in em; React Native wants points. */\nfunction finish(look: NativeLook): NativeLook {\n for (const part of [look, look.disabled, look.on]) {\n if (part.text.letterSpacing !== undefined) part.text.letterSpacing = part.text.letterSpacing * (part.text.fontSize ?? look.text.fontSize ?? 14);\n }\n return look;\n}\n\nexport type NativeRecipe = {\n /** The looks of each slot (`base` for a recipe without slots) for these variants, on this theme. */\n resolve: (props: Props, theme: ThemeColors) => Record<string, NativeLook>;\n};\n\n/** The native side of a recipe (`defineRecipe`): what its variants look like on a theme. */\nexport function nativeRecipe(config: Config): NativeRecipe {\n return {\n resolve(props, theme) {\n const looks: Record<string, NativeLook> = {};\n for (const [slot, classes] of Object.entries(classesFor(config, props))) {\n const look = empty();\n for (const cls of classes) if (!apply(look, cls, theme)) look.ignored.push(cls);\n looks[slot] = finish(look);\n }\n return looks;\n },\n };\n}\n"],"mappings":";;;;;AAIO,IAAM,QAAQ;AAAA,EACnB,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,OAAO;AAAA,EACP,OAAO;A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AO,MAAM;AACnB,mBAAW,OAAO,QAAS,KAAI,CAAC,MAAM,MAAM,KAAK,KAAK,EAAG,MAAK,QAAQ,KAAK,GAAG;AAC9E,cAAM,IAAI,IAAI,OAAO,IAAI;AAAA,MAC3B;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/recipes/roles.ts","../src/recipes/native.ts"],"sourcesContent":["// The colour roles a recipe may name, by the Tailwind utility suffix the preset gives them (`bg-accent`,\n// `text-fg-secondary`, `border-border-default`) → the key of the same role in the native theme (`accent`, `textSecondary`,\n// `borderDefault`). One table: the web class and the native colour cannot name different tokens. `recipes.test.ts`\n// checks that every key of the right-hand side exists in the real native theme (@krizaka/tokens/native).\nexport const ROLES = {\n \"surface-0\": \"surface0\",\n \"surface-1\": \"surface1\",\n \"surface-2\": \"surface2\",\n \"surface-3\": \"surface3\",\n media: \"media\",\n scrim: \"scrim\",\n \"scrim-strong\": \"scrimStrong\",\n overlay: \"overlay\",\n \"border-subtle\": \"borderSubtle\",\n \"border-default\": \"borderDefault\",\n \"border-strong\": \"borderStrong\",\n fg: \"textPrimary\",\n \"fg-secondary\": \"textSecondary\",\n \"fg-muted\": \"textMuted\",\n \"fg-on-media\": \"textOnMedia\",\n \"fg-accent\": \"accentText\",\n \"fg-success\": \"successText\",\n \"fg-warning\": \"warningText\",\n \"fg-danger\": \"dangerText\",\n \"fg-info\": \"infoText\",\n accent: \"accent\",\n \"accent-hover\": \"accentHover\",\n \"accent-soft\": \"accentSoft\",\n \"accent-2\": \"accent2\",\n \"on-accent\": \"onAccent\",\n ring: \"ring\",\n success: \"success\",\n warning: \"warning\",\n danger: \"danger\",\n info: \"info\",\n \"success-soft\": \"successSoft\",\n \"warning-soft\": \"warningSoft\",\n \"danger-soft\": \"dangerSoft\",\n glass: \"glassBg\",\n \"glass-border\": \"glassBorder\",\n} as const;\n\nexport type RoleName = keyof typeof ROLES;\n\n/** Tailwind's type scale, in points (`text-xs` → 12). */\nexport const TEXT_SIZES = { xs: 12, sm: 14, base: 16, lg: 18, xl: 20, \"2xl\": 24, \"3xl\": 30 } as const;\n\nexport const FONT_WEIGHTS = { normal: \"400\", medium: \"500\", semibold: \"600\", bold: \"700\", extrabold: \"800\", black: \"900\" } as const;\n\n/** `tracking-*`, in em (React Native takes points: the resolver multiplies by the font size). */\nexport const TRACKING = { tighter: -0.05, tight: -0.025, normal: 0, wide: 0.025, wider: 0.05, widest: 0.1 } as const;\n","// The native side of a recipe: the classes of its variants, read into the styles React Native takes, on the roles of the\n// theme. Pure (no React Native, no theme import): the components wrap the result in `StyleSheet` and pass the theme.\n// What a phone has no use for (`hover:`, `focus-visible:`, shadows, transitions, the layout classes) is returned in\n// `ignored`, so a test can tell the classes that only the web has from the ones that were forgotten.\nimport { FONT_WEIGHTS, type RoleName, ROLES, TEXT_SIZES, TRACKING } from \"./roles\";\n\n/** The colour roles of a native theme (`Theme` of `@krizaka/ui/native`): a key, a colour. */\nexport type ThemeColors = Readonly<Record<string, string>>;\n\nexport type NativeFrame = {\n backgroundColor?: string;\n borderColor?: string;\n borderWidth?: number;\n height?: number;\n width?: number;\n minWidth?: number;\n paddingHorizontal?: number;\n paddingVertical?: number;\n padding?: number;\n gap?: number;\n opacity?: number;\n};\n\nexport type NativeText = {\n color?: string;\n fontSize?: number;\n fontWeight?: \"400\" | \"500\" | \"600\" | \"700\" | \"800\" | \"900\";\n letterSpacing?: number;\n textTransform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n};\n\n/** What one part of a component looks like: its frame (a View), its text, and the states that change them. */\nexport type NativeLook = {\n frame: NativeFrame;\n text: NativeText;\n /** `bg-<role>` of the part's dot (`[&>[data-dot]]:bg-accent`): the colour of a status dot. */\n dot?: string;\n /** `bg-linear-to-r from-<role> to-<role>`: the two stops of a gradient fill. */\n gradient?: readonly [string, string];\n /** `disabled:` — the frame and text while disabled. */\n disabled: { frame: NativeFrame; text: NativeText };\n /** `data-[state=on]:` — the frame and text while selected / pressed on. */\n on: { frame: NativeFrame; text: NativeText };\n /** The classes with no native meaning (the web's pointer states, shadows, layout…). */\n ignored: string[];\n};\n\ntype Props = Readonly<Record<string, string | number | boolean | null | undefined>>;\ntype Slot = string | readonly unknown[] | null | undefined;\ntype Config = {\n base?: Slot;\n slots?: Readonly<Record<string, Slot>>;\n variants?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;\n defaultVariants?: Readonly<Record<string, unknown>>;\n compoundVariants?: readonly Readonly<Record<string, unknown>>[];\n};\n\nconst BASE = \"base\";\n\nconst words = (value: unknown): string[] => (typeof value === \"string\" ? value.split(/\\s+/).filter(Boolean) : Array.isArray(value) ? value.flatMap(words) : []);\n\n/** `#rrggbb` at an opacity (`rgba()`); any other form passes through. */\nexport function withAlpha(color: string, opacity: number): string {\n const hex = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);\n if (!hex) return color;\n const [r, g, b] = hex.slice(1).map((part) => Number.parseInt(part, 16));\n return `rgba(${r},${g},${b},${opacity})`;\n}\n\n/** The slots of a config: `slots` when it has some, else the single `base`. */\nfunction slotNames(config: Config): string[] {\n return config.slots ? Object.keys(config.slots) : [BASE];\n}\n\n/** The classes of each slot for some props: base, the chosen variants (defaults first), then the compound ones. */\nfunction classesFor(config: Config, props: Props): Record<string, string[]> {\n const names = slotNames(config);\n const out: Record<string, string[]> = Object.fromEntries(names.map((name) => [name, config.slots ? words(config.slots[name]) : words(config.base)]));\n // A string (or a list) is for the base; an object names the slots it is for.\n const add = (value: unknown) => {\n if (typeof value === \"string\" || Array.isArray(value)) (out[BASE] ??= []).push(...words(value));\n else if (value && typeof value === \"object\") for (const [name, classes] of Object.entries(value)) (out[name] ??= []).push(...words(classes));\n };\n const chosen = { ...config.defaultVariants, ...Object.fromEntries(Object.entries(props).filter(([, v]) => v !== undefined)) } as Record<string, unknown>;\n for (const [dimension, values] of Object.entries(config.variants ?? {})) {\n const key = String(chosen[dimension]);\n if (key in values) add(values[key]);\n }\n for (const compound of config.compoundVariants ?? []) {\n const { class: a, className: b, ...conditions } = compound as Record<string, unknown>;\n const matches = Object.entries(conditions).every(([dimension, expected]) => (Array.isArray(expected) ? expected.map(String).includes(String(chosen[dimension])) : String(chosen[dimension]) === String(expected)));\n if (matches) add(a ?? b);\n }\n return out;\n}\n\nconst empty = (): NativeLook => ({ frame: {}, text: {}, disabled: { frame: {}, text: {} }, on: { frame: {}, text: {} }, ignored: [] });\n\n/** `3` → 12, `0.5` → 2, `3.5` → 14: Tailwind's spacing unit is 4. */\nconst unit = (value: string): number | undefined => (/^\\d+(\\.\\d+)?$/.test(value) ? Number(value) * 4 : undefined);\n\n/** `accent`, `accent/40`, `transparent` → a colour of the theme, or `undefined` when it is not a role. */\nfunction colour(name: string, theme: ThemeColors): string | undefined {\n const [role, percent] = name.split(\"/\");\n if (role === \"transparent\") return \"transparent\";\n if (!role || !(role in ROLES)) return undefined;\n const resolved = theme[ROLES[role as RoleName]];\n if (resolved === undefined) return undefined;\n return percent === undefined ? resolved : withAlpha(resolved, Number(percent) / 100);\n}\n\n/** Reads one class into a look. Returns `false` when the class means nothing natively. */\nfunction apply(look: NativeLook, cls: string, theme: ThemeColors): boolean {\n // States: `disabled:` and `data-[state=on]:` are kept apart; every other prefix is a pointer, focus or media state.\n let target: { frame: NativeFrame; text: NativeText } = look;\n let utility = cls;\n if (cls.startsWith(\"disabled:\")) {\n target = look.disabled;\n utility = cls.slice(\"disabled:\".length);\n } else if (cls.startsWith(\"data-[state=on]:\")) {\n target = look.on;\n utility = cls.slice(\"data-[state=on]:\".length);\n } else if (cls.startsWith(\"[&>[data-dot]]:bg-\")) {\n const dot = colour(cls.slice(\"[&>[data-dot]]:bg-\".length), theme);\n if (dot === undefined) return false;\n look.dot = dot;\n return true;\n }\n if (utility.includes(\":\") || utility.startsWith(\"[&\")) return false;\n\n const { frame, text } = target;\n let match: RegExpExecArray | null;\n if (utility.startsWith(\"bg-linear-to-\")) return true;\n if ((match = /^bg-(.+)$/.exec(utility))) {\n const value = colour(match[1]!, theme);\n if (value === undefined) return false;\n frame.backgroundColor = value;\n return true;\n }\n if ((match = /^text-(.+)$/.exec(utility))) {\n const arbitrary = /^\\[(\\d+(?:\\.\\d+)?)px\\]$/.exec(match[1]!);\n if (arbitrary) return ((text.fontSize = Number(arbitrary[1])), true);\n if (match[1]! in TEXT_SIZES) return ((text.fontSize = TEXT_SIZES[match[1] as keyof typeof TEXT_SIZES]), true);\n const value = colour(match[1]!, theme);\n if (value === undefined) return false;\n text.color = value;\n return true;\n }\n if (utility === \"border\") return ((frame.borderWidth = 1), true);\n if ((match = /^(?:border|ring)-(.+)$/.exec(utility))) {\n if (match[1] === \"1\") return ((frame.borderWidth = 1), true);\n if (match[1] === \"inset\") return true;\n const value = colour(match[1]!, theme);\n if (value === undefined) return false;\n frame.borderColor = value;\n return true;\n }\n if (utility === \"ring-inset\") return true;\n if ((match = /^(h|w|min-w|px|py|p|gap)-(\\d+(?:\\.\\d+)?)$/.exec(utility))) {\n const points = unit(match[2]!)!;\n const key = { h: \"height\", w: \"width\", \"min-w\": \"minWidth\", px: \"paddingHorizontal\", py: \"paddingVertical\", p: \"padding\", gap: \"gap\" }[match[1]!] as keyof NativeFrame;\n (frame as Record<string, number>)[key] = points;\n return true;\n }\n if ((match = /^opacity-(\\d+)$/.exec(utility))) return ((frame.opacity = Number(match[1]) / 100), true);\n if ((match = /^font-(.+)$/.exec(utility)) && match[1]! in FONT_WEIGHTS) return ((text.fontWeight = FONT_WEIGHTS[match[1] as keyof typeof FONT_WEIGHTS]), true);\n if ((match = /^tracking-(.+)$/.exec(utility)) && match[1]! in TRACKING) return ((text.letterSpacing = TRACKING[match[1] as keyof typeof TRACKING]), true);\n if (utility === \"uppercase\" || utility === \"lowercase\" || utility === \"capitalize\") return ((text.textTransform = utility), true);\n if ((match = /^(from|to)-(.+)$/.exec(utility))) {\n const value = colour(match[2]!, theme);\n if (value === undefined) return false;\n const stops = [...(look.gradient ?? [\"transparent\", \"transparent\"])] as [string, string];\n stops[match[1] === \"from\" ? 0 : 1] = value;\n look.gradient = stops;\n return true;\n }\n return false;\n}\n\n/** `tracking-*` is in em; React Native wants points. */\nfunction finish(look: NativeLook): NativeLook {\n for (const part of [look, look.disabled, look.on]) {\n if (part.text.letterSpacing !== undefined) part.text.letterSpacing = part.text.letterSpacing * (part.text.fontSize ?? look.text.fontSize ?? 14);\n }\n return look;\n}\n\nexport type NativeRecipe = {\n /** The looks of each slot (`base` for a recipe without slots) for these variants, on this theme. */\n resolve: (props: Props, theme: ThemeColors) => Record<string, NativeLook>;\n};\n\n/** The native side of a recipe (`defineRecipe`): what its variants look like on a theme. */\nexport function nativeRecipe(config: Config): NativeRecipe {\n return {\n resolve(props, theme) {\n const looks: Record<string, NativeLook> = {};\n for (const [slot, classes] of Object.entries(classesFor(config, props))) {\n const look = empty();\n for (const cls of classes) if (!apply(look, cls, theme)) look.ignored.push(cls);\n looks[slot] = finish(look);\n }\n return looks;\n },\n };\n}\n"],"mappings":";;;;;AAIO,IAAM,QAAQ;AAAA,EACnB,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,IAAI;AAAA,EACJ,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,gBAAgB;AAAA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,aAAc,QAAS,KAAK,gBAAgB,SAAU;AAC5H,MAAK,QAAQ,mBAAmB,KAAK,OAAO,GAAI;AAC9C,UAAM,QAAQ,OAAO,MAAM,CAAC,GAAI,KAAK;AACrC,QAAI,UAAU,OAAW,QAAO;AAChC,UAAM,QAAQ,CAAC,GAAI,KAAK,YAAY,CAAC,eAAe,aAAa,CAAE;AACnE,UAAM,MAAM,CAAC,MAAM,SAAS,IAAI,CAAC,IAAI;AACrC,SAAK,WAAW;AAChB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAGA,SAAS,OAAO,MAA8B;AAC5C,aAAW,QAAQ,CAAC,MAAM,KAAK,UAAU,KAAK,EAAE,GAAG;AACjD,QAAI,KAAK,KAAK,kBAAkB,OAAW,MAAK,KAAK,gBAAgB,KAAK,KAAK,iBAAiB,KAAK,KAAK,YAAY,KAAK,KAAK,YAAY;AAAA,EAC9I;AACA,SAAO;AACT;AAQO,SAAS,aAAa,QAA8B;AACzD,SAAO;AAAA,IACL,QAAQ,OAAO,OAAO;AACpB,YAAM,QAAoC,CAAC;AAC3C,iBAAW,CAAC,MAAM,OAAO,KAAK,OAAO,QAAQ,WAAW,QAAQ,KAAK,CAAC,GAAG;AACvE,cAAM,OAAO,MAAM;AACnB,mBAAW,OAAO,QAAS,KAAI,CAAC,MAAM,MAAM,KAAK,KAAK,EAAG,MAAK,QAAQ,KAAK,GAAG;AAC9E,cAAM,IAAI,IAAI,OAAO,IAAI;AAAA,MAC3B;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|
|
@@ -145,6 +145,6 @@ type PlaylistProps = {
|
|
|
145
145
|
setIndex: (i: number) => void;
|
|
146
146
|
index: number;
|
|
147
147
|
};
|
|
148
|
-
declare function PlaylistScreen({ playlist, transition, labels, muted, autoPlay, renderEmbed, onMutedChange, onIndexChange, title, reduced, setMutedState, setIndex, index }: PlaylistProps): React.JSX.Element;
|
|
148
|
+
declare function PlaylistScreen({ playlist, transition, labels, muted, autoPlay, renderEmbed, onMutedChange, onIndexChange, title, reduced, setMutedState, setIndex, index }: Readonly<PlaylistProps>): React.JSX.Element;
|
|
149
149
|
|
|
150
150
|
export { PlaylistScreen };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/retro-tv/playlist-screen.tsx","../src/glyphs.tsx","../src/media.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { CaptionsGlyph, PauseGlyph, PlayGlyph, VolumeGlyph } from \"../glyphs\";\nimport { formatClock, playSafely, useInView } from \"../media\";\nimport type { RetroTvLabels, RetroTvSource, RetroTvTransition } from \"./retro-tv\";\n\nconst styles = `.kz-rtv-layer{position:absolute;inset:0;background:var(--kz-scrim-strong)}\n.kz-rtv-layer video,.kz-rtv-layer img,.kz-rtv-layer .kz-embed{width:100%;height:100%;object-fit:contain;aspect-ratio:auto}\n.kz-rtv-layer[data-role=out]{z-index:1}.kz-rtv-layer[data-role=in]{z-index:2}\n.kz-rtv-static{position:absolute;inset:0;z-index:4;overflow:hidden;pointer-events:none}\n.kz-rtv-static:after{position:absolute;inset:-20% 0 auto;height:18%;background:linear-gradient(transparent,color-mix(in srgb,var(--kz-text-on-media) 55%,transparent),transparent);content:\"\"}\n.kz-rtv-chip,.kz-rtv-bar button{display:inline-flex;min-width:2.25rem;min-height:2.25rem;align-items:center;justify-content:center;gap:.35rem;padding:0 .55rem;border:1px solid color-mix(in srgb,var(--kz-text-on-media) 30%,transparent);border-radius:999px;background:color-mix(in srgb,var(--kz-scrim-strong) 82%,transparent);color:var(--kz-text-on-media);font:600 .72rem/1 var(--kz-font-mono,monospace);cursor:pointer}\n.kz-rtv-chip{position:absolute;z-index:8;top:.5rem;left:.5rem}\n.kz-rtv-chip:focus-visible,.kz-rtv-bar button:focus-visible,.kz-rtv-seek:focus-visible{outline:2px solid var(--kz-ring);outline-offset:2px}\n.kz-rtv-bar{position:absolute;z-index:8;inset:auto 0 0;display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;padding:1.6rem .6rem .6rem;background:linear-gradient(transparent,color-mix(in srgb,var(--kz-scrim-strong) 85%,transparent));opacity:0;transition:opacity .25s}\n.kz-rtv-screen[data-active=true] .kz-rtv-bar,.kz-rtv-screen:focus-within .kz-rtv-bar,.kz-rtv-screen:hover .kz-rtv-bar{opacity:1}\n.kz-rtv-bar svg{width:1rem;height:1rem}\n.kz-rtv-time{padding:.2rem .45rem;border-radius:4px;background:var(--kz-scrim-strong);color:var(--kz-text-on-media);font:600 .75rem/1 var(--kz-font-mono,monospace);font-variant-numeric:tabular-nums}\n.kz-rtv-seek{flex:1 1 6rem;min-width:5rem;height:1.5rem;accent-color:var(--kz-accent);cursor:pointer}\n.kz-rtv-progress{position:absolute;z-index:7;inset:auto 0 0;height:3px;background:color-mix(in srgb,var(--kz-text-on-media) 25%,transparent)}\n.kz-rtv-progress i{display:block;height:100%;background:var(--kz-accent);transform-origin:left;transform:scaleX(var(--kz-rtv-p,0))}\n@keyframes kz-rtv-in{from{opacity:0}to{opacity:1}}@keyframes kz-rtv-out{from{opacity:1}to{opacity:0}}\n@keyframes kz-rtv-sin{from{transform:translateX(100%)}to{transform:none}}@keyframes kz-rtv-sout{from{transform:none}to{transform:translateX(-100%)}}\n@keyframes kz-rtv-tune{0%{transform:translateY(-12%) scaleY(1.15);filter:contrast(2) brightness(1.6)}100%{transform:none;filter:none}}\n@keyframes kz-rtv-roll{from{transform:translateY(0)}to{transform:translateY(700%)}}\n@media (prefers-reduced-motion:no-preference){\n.kz-rtv-layer[data-role=in][data-tr=crossfade]{animation:kz-rtv-in .6s both}.kz-rtv-layer[data-role=out][data-tr=crossfade]{animation:kz-rtv-out .6s both}\n.kz-rtv-layer[data-role=in][data-tr=slide]{animation:kz-rtv-sin .5s ease-out both}.kz-rtv-layer[data-role=out][data-tr=slide]{animation:kz-rtv-sout .5s ease-out both}\n.kz-rtv-layer[data-role=in][data-tr=channel]{animation:kz-rtv-tune .55s steps(8,end) both}\n.kz-rtv-static{animation:kz-rtv-in .55s reverse both}.kz-rtv-static:after{animation:kz-rtv-roll .55s linear both}}\n`;\n\ntype PlaylistProps = { playlist: readonly RetroTvSource[]; transition: RetroTvTransition; labels: RetroTvLabels; muted: boolean; autoPlay: boolean; renderEmbed?: (source: RetroTvSource) => React.ReactNode; onMutedChange?: (muted: boolean) => void; onIndexChange?: (index: number) => void; title?: string; reduced: boolean; setMutedState: (m: boolean) => void; setIndex: (i: number) => void; index: number };\n\nexport function PlaylistScreen({ playlist, transition, labels, muted, autoPlay, renderEmbed, onMutedChange, onIndexChange, title, reduced, setMutedState, setIndex, index }: PlaylistProps) {\n const region = React.useRef<HTMLDivElement>(null);\n const video = React.useRef<HTMLVideoElement>(null);\n const [prev, setPrev] = React.useState<number | null>(null);\n const [seen, setSeen] = React.useState(false);\n const [playing, setPlaying] = React.useState(false);\n const [time, setTime] = React.useState({ t: 0, d: 0 });\n const [active, setActive] = React.useState(false);\n const [captionsOn, setCaptionsOn] = React.useState(false);\n const n = playlist.length;\n const current = playlist[index];\n const wake = React.useCallback(() => setActive(true), []);\n\n useInView(region, (v) => { if (v) setSeen(true); else video.current?.pause(); });\n React.useEffect(() => { if (!active) return; const id = setTimeout(() => setActive(false), 2500); return () => clearTimeout(id); }, [active]);\n React.useEffect(() => { if (prev === null) return; const id = setTimeout(() => setPrev(null), reduced ? 0 : 650); return () => clearTimeout(id); }, [prev, reduced]);\n React.useEffect(() => { if (seen && autoPlay && !reduced && current?.src) playSafely(video.current); }, [seen, autoPlay, reduced, index, current?.src]);\n React.useEffect(() => { const list = video.current?.textTracks; if (list) Array.from(list).forEach((track, i) => { track.mode = captionsOn && i === 0 ? \"showing\" : \"disabled\"; }); }, [captionsOn, index]);\n\n const go = (to: number) => {\n const next = ((to % n) + n) % n;\n if (next === index && n > 1) return;\n if (!reduced && n > 1) setPrev(index);\n setIndex(next);\n setTime({ t: 0, d: 0 });\n onIndexChange?.(next);\n };\n const toggle = () => { const v = video.current; if (!v) return; if (v.paused) playSafely(v); else v.pause(); };\n const setMuted = (m: boolean) => { setMutedState(m); onMutedChange?.(m); };\n const onKey = (e: React.KeyboardEvent) => {\n if (e.target !== e.currentTarget) return;\n const v = video.current;\n const act: Record<string, () => void> = { \" \": toggle, k: toggle, m: () => setMuted(!muted), n: () => go(index + 1), p: () => go(index - 1), ArrowRight: () => { if (v) v.currentTime += 5; }, ArrowLeft: () => { if (v) v.currentTime -= 5; } };\n const fn = act[e.key.length === 1 ? e.key.toLowerCase() : e.key];\n if (fn) { e.preventDefault(); fn(); wake(); }\n };\n const layer = (i: number, role: \"in\" | \"out\") => {\n const src = playlist[i];\n if (!src) return null;\n return (\n <div className=\"kz-rtv-layer\" key={src.id} data-role={role} data-tr={transition}>\n {src.src ? (\n role === \"in\" ? (\n <video ref={video} src={seen ? src.src : undefined} poster={src.poster} muted={muted} playsInline preload={seen ? \"auto\" : \"none\"} loop={n === 1} aria-label={src.title}\n onPlay={() => setPlaying(true)} onPause={() => setPlaying(false)} onEnded={() => { if (n > 1) go(index + 1); }}\n onTimeUpdate={(e) => setTime({ t: e.currentTarget.currentTime, d: e.currentTarget.duration || 0 })} onLoadedMetadata={(e) => setTime({ t: 0, d: e.currentTarget.duration || 0 })}>\n {src.tracks?.map((t) => <track key={t.src} kind=\"captions\" src={t.src} srcLang={t.srcLang} label={t.label} />)}\n </video>\n ) : src.poster ? <img src={src.poster} alt=\"\" /> : null\n ) : role === \"in\" ? renderEmbed?.(src) : null}\n </div>\n );\n };\n const p = time.d ? Math.min(1, time.t / time.d) : 0;\n const hasCaptions = !!current?.tracks?.length;\n return (\n <>\n <style>{styles}</style>\n <div ref={region} role=\"region\" aria-label={title ?? current?.title} tabIndex={0} className=\"kz-rtv-playlist\" data-active={active ? \"true\" : undefined} onKeyDown={onKey} onPointerMove={wake} onPointerDown={wake} onFocus={wake} style={{ position: \"absolute\", inset: 0, \"--kz-rtv-p\": p } as React.CSSProperties}>\n {prev !== null && layer(prev, \"out\")}\n {layer(index, \"in\")}\n {prev !== null && transition === \"channel\" && <div className=\"kz-rtv-static\" aria-hidden=\"true\"><span className=\"kz-rtv-noise\" style={{ position: \"absolute\", inset: 0, background: \"repeating-linear-gradient(0deg,var(--kz-text-on-media) 0 1px,var(--kz-scrim-strong) 1px 3px)\" }} /></div>}\n <button type=\"button\" className=\"kz-rtv-chip\" aria-pressed={!muted} aria-label={muted ? labels.soundOff : labels.soundOn} onClick={() => setMuted(!muted)}><VolumeGlyph muted={muted} /></button>\n <div className=\"kz-rtv-progress\" aria-hidden=\"true\"><i /></div>\n <div className=\"kz-rtv-bar\">\n <button type=\"button\" aria-label={labels.previous} onClick={() => go(index - 1)} disabled={n < 2}>«</button>\n <button type=\"button\" aria-label={playing ? labels.pause : labels.play} onClick={toggle} disabled={!current?.src}>{playing ? <PauseGlyph /> : <PlayGlyph />}</button>\n <button type=\"button\" aria-label={labels.next} onClick={() => go(index + 1)} disabled={n < 2}>»</button>\n <span className=\"kz-rtv-time\">{formatClock(time.t)} / {formatClock(time.d)}</span>\n <input className=\"kz-rtv-seek\" type=\"range\" aria-label={labels.seek} min={0} max={Math.max(1, Math.floor(time.d))} value={Math.floor(time.t)} disabled={!time.d} onChange={(e) => { if (video.current) video.current.currentTime = Number(e.target.value); }} />\n {hasCaptions && <button type=\"button\" aria-label={labels.captions} aria-pressed={captionsOn} onClick={() => setCaptionsOn(!captionsOn)}><CaptionsGlyph /></button>}\n </div>\n <span className=\"sr-only\" aria-live=\"polite\">{labels.nowPlaying}: {current?.title} ({index + 1}/{n})</span>\n </div>\n </>\n );\n}\n","// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" }) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\nexport const PencilGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 20h4L19 9a2.8 2.8 0 0 0-4-4L4 16v4zM13.5 6.5l4 4\" />\n </Glyph>\n);\n","// Shared by the data and media primitives (client): the clock format, the reduced-motion preference, the\n// in-view observer, a debounced callback. Never an entry of its own.\nimport * as React from \"react\";\n\n/** Seconds as a clock: `75` → `1:15`, `3725` → `1:02:05`. Negative or unknown values read `0:00`. */\nexport function formatClock(seconds: number): string {\n const s = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const rest = String(s % 60).padStart(2, \"0\");\n return h > 0 ? `${h}:${String(m).padStart(2, \"0\")}:${rest}` : `${m}:${rest}`;\n}\n\n/** Clamps `value` between `min` and `max`. */\nexport const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst REDUCE = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduce = (notify: () => void) => {\n if (typeof window === \"undefined\" || !window.matchMedia) return () => undefined;\n const query = window.matchMedia(REDUCE);\n query.addEventListener?.(\"change\", notify);\n return () => query.removeEventListener?.(\"change\", notify);\n};\n\n/** `true` when the person asked for less motion (`prefers-reduced-motion: reduce`); follows a change of the setting. */\nexport function usePrefersReducedMotion(): boolean {\n return React.useSyncExternalStore(\n subscribeReduce,\n () => (typeof window !== \"undefined\" && window.matchMedia ? window.matchMedia(REDUCE).matches : false),\n () => false,\n );\n}\n\n/** The latest value of a callback, for an effect or an event that must not re-subscribe when it changes. */\nexport function useLatest<T>(value: T) {\n const ref = React.useRef(value);\n React.useLayoutEffect(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/** Calls `onChange(visible)` when at least `threshold` of the element enters or leaves the viewport. */\nexport function useInView(ref: React.RefObject<Element | null>, onChange: (visible: boolean) => void, enabled = true, threshold = 0.25) {\n const latest = useLatest(onChange);\n React.useEffect(() => {\n const element = ref.current;\n if (!enabled || !element || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => entry && latest.current(entry.isIntersecting), { threshold });\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled, threshold, latest]);\n}\n\n/** A value controlled by a prop when it is given, held inside otherwise; `set` calls `onChange` either way. */\nexport function useControllable<T>(value: T | undefined, defaultValue: T, onChange?: (next: T) => void) {\n const [inner, setInner] = React.useState(defaultValue);\n const controlled = value !== undefined;\n const current = controlled ? value : inner;\n const set = React.useCallback(\n (next: T) => {\n if (!controlled) setInner(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [current, set] as const;\n}\n\n/** Starts a media element without an unhandled rejection (autoplay refused, the source replaced meanwhile). */\nexport function playSafely(media: HTMLMediaElement | null | undefined) {\n try {\n const started = media?.play() as Promise<void> | undefined;\n started?.catch?.(() => undefined);\n } catch {\n // Not playable here (no media support): the controls stay as they are.\n }\n}\n\nconst subscribeLoad = (notify: () => void) => {\n window.addEventListener(\"load\", notify);\n return () => window.removeEventListener(\"load\", notify);\n};\n/** `true` once the page has finished loading: a clip or a loop is not worth bytes before it (the page's LCP comes first). */\nexport function usePageLoaded(): boolean {\n return React.useSyncExternalStore(subscribeLoad, () => document.readyState === \"complete\", () => false);\n}\n\ntype SaveDataNavigator = Navigator & { connection?: { saveData?: boolean } };\n/** `true` when the person asked for less motion or less data: nothing plays, the posters stay. */\nexport function useCalm(): boolean {\n const reduce = usePrefersReducedMotion();\n return reduce || (typeof navigator !== \"undefined\" && Boolean((navigator as SaveDataNavigator).connection?.saveData));\n}\n\nconst subscribeVisibility = (notify: () => void) => {\n document.addEventListener(\"visibilitychange\", notify);\n return () => document.removeEventListener(\"visibilitychange\", notify);\n};\n/** `true` while the tab is hidden: what moves waits for it. */\nexport function usePageHidden(): boolean {\n return React.useSyncExternalStore(subscribeVisibility, () => document.visibilityState === \"hidden\", () => false);\n}\n"],"mappings":";;;;AAEA,YAAYA,YAAW;;;ACOnB,cAsBF,YAtBE;AAFJ,SAAS,M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A,sBAAY,KAAK,CAAC;AAAA,UAAE;AAAA,UAAI,YAAY,KAAK,CAAC;AAAA,WAAE;AAAA,QAC3E,gBAAAD,KAAC,WAAM,WAAU,eAAc,MAAK,SAAQ,cAAY,OAAO,MAAM,KAAK,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,CAAC,CAAC,GAAG,OAAO,KAAK,MAAM,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM;AAAE,cAAI,MAAM,QAAS,OAAM,QAAQ,cAAc,OAAO,EAAE,OAAO,KAAK;AAAA,QAAG,GAAG;AAAA,QAC7P,eAAe,gBAAAA,KAAC,YAAO,MAAK,UAAS,cAAY,OAAO,UAAU,gBAAc,YAAY,SAAS,MAAM,cAAc,CAAC,UAAU,GAAG,0BAAAA,KAAC,iBAAc,GAAE;AAAA,SAC3J;AAAA,MACA,gBAAAC,MAAC,UAAK,WAAU,WAAU,aAAU,UAAU;AAAA,eAAO;AAAA,QAAW;AAAA,QAAG,SAAS;AAAA,QAAM;AAAA,QAAG,QAAQ;AAAA,QAAE;AAAA,QAAE;AAAA,QAAE;AAAA,SAAC;AAAA,OACtG;AAAA,KACA;AAEJ;","names":["React","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../src/retro-tv/playlist-screen.tsx","../src/glyphs.tsx","../src/media.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { CaptionsGlyph, PauseGlyph, PlayGlyph, VolumeGlyph } from \"../glyphs\";\nimport { formatClock, playSafely, useInView } from \"../media\";\nimport type { RetroTvLabels, RetroTvSource, RetroTvTransition } from \"./retro-tv\";\n\nconst styles = `.kz-rtv-layer{position:absolute;inset:0;background:var(--kz-scrim-strong)}\n.kz-rtv-layer video,.kz-rtv-layer img,.kz-rtv-layer .kz-embed{width:100%;height:100%;object-fit:contain;aspect-ratio:auto}\n.kz-rtv-layer[data-role=out]{z-index:1}.kz-rtv-layer[data-role=in]{z-index:2}\n.kz-rtv-static{position:absolute;inset:0;z-index:4;overflow:hidden;pointer-events:none}\n.kz-rtv-static:after{position:absolute;inset:-20% 0 auto;height:18%;background:linear-gradient(transparent,color-mix(in srgb,var(--kz-text-on-media) 55%,transparent),transparent);content:\"\"}\n.kz-rtv-chip,.kz-rtv-bar button{display:inline-flex;min-width:2.25rem;min-height:2.25rem;align-items:center;justify-content:center;gap:.35rem;padding:0 .55rem;border:1px solid color-mix(in srgb,var(--kz-text-on-media) 30%,transparent);border-radius:999px;background:color-mix(in srgb,var(--kz-scrim-strong) 82%,transparent);color:var(--kz-text-on-media);font:600 .72rem/1 var(--kz-font-mono,monospace);cursor:pointer}\n.kz-rtv-chip{position:absolute;z-index:8;top:.5rem;left:.5rem}\n.kz-rtv-chip:focus-visible,.kz-rtv-bar button:focus-visible,.kz-rtv-seek:focus-visible{outline:2px solid var(--kz-ring);outline-offset:2px}\n.kz-rtv-bar{position:absolute;z-index:8;inset:auto 0 0;display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;padding:1.6rem .6rem .6rem;background:linear-gradient(transparent,color-mix(in srgb,var(--kz-scrim-strong) 85%,transparent));opacity:0;transition:opacity .25s}\n.kz-rtv-screen[data-active=true] .kz-rtv-bar,.kz-rtv-screen:focus-within .kz-rtv-bar,.kz-rtv-screen:hover .kz-rtv-bar{opacity:1}\n.kz-rtv-bar svg{width:1rem;height:1rem}\n.kz-rtv-time{padding:.2rem .45rem;border-radius:4px;background:var(--kz-scrim-strong);color:var(--kz-text-on-media);font:600 .75rem/1 var(--kz-font-mono,monospace);font-variant-numeric:tabular-nums}\n.kz-rtv-seek{flex:1 1 6rem;min-width:5rem;height:1.5rem;accent-color:var(--kz-accent);cursor:pointer}\n.kz-rtv-progress{position:absolute;z-index:7;inset:auto 0 0;height:3px;background:color-mix(in srgb,var(--kz-text-on-media) 25%,transparent)}\n.kz-rtv-progress i{display:block;height:100%;background:var(--kz-accent);transform-origin:left;transform:scaleX(var(--kz-rtv-p,0))}\n@keyframes kz-rtv-in{from{opacity:0}to{opacity:1}}@keyframes kz-rtv-out{from{opacity:1}to{opacity:0}}\n@keyframes kz-rtv-sin{from{transform:translateX(100%)}to{transform:none}}@keyframes kz-rtv-sout{from{transform:none}to{transform:translateX(-100%)}}\n@keyframes kz-rtv-tune{0%{transform:translateY(-12%) scaleY(1.15);filter:contrast(2) brightness(1.6)}100%{transform:none;filter:none}}\n@keyframes kz-rtv-roll{from{transform:translateY(0)}to{transform:translateY(700%)}}\n@media (prefers-reduced-motion:no-preference){\n.kz-rtv-layer[data-role=in][data-tr=crossfade]{animation:kz-rtv-in .6s both}.kz-rtv-layer[data-role=out][data-tr=crossfade]{animation:kz-rtv-out .6s both}\n.kz-rtv-layer[data-role=in][data-tr=slide]{animation:kz-rtv-sin .5s ease-out both}.kz-rtv-layer[data-role=out][data-tr=slide]{animation:kz-rtv-sout .5s ease-out both}\n.kz-rtv-layer[data-role=in][data-tr=channel]{animation:kz-rtv-tune .55s steps(8,end) both}\n.kz-rtv-static{animation:kz-rtv-in .55s reverse both}.kz-rtv-static:after{animation:kz-rtv-roll .55s linear both}}\n`;\n\ntype PlaylistProps = { playlist: readonly RetroTvSource[]; transition: RetroTvTransition; labels: RetroTvLabels; muted: boolean; autoPlay: boolean; renderEmbed?: (source: RetroTvSource) => React.ReactNode; onMutedChange?: (muted: boolean) => void; onIndexChange?: (index: number) => void; title?: string; reduced: boolean; setMutedState: (m: boolean) => void; setIndex: (i: number) => void; index: number };\n\nexport function PlaylistScreen({ playlist, transition, labels, muted, autoPlay, renderEmbed, onMutedChange, onIndexChange, title, reduced, setMutedState, setIndex, index }: Readonly<PlaylistProps>) {\n const region = React.useRef<HTMLDivElement>(null);\n const video = React.useRef<HTMLVideoElement>(null);\n const [prev, setPrev] = React.useState<number | null>(null);\n const [seen, setSeen] = React.useState(false);\n const [playing, setPlaying] = React.useState(false);\n const [time, setTime] = React.useState({ t: 0, d: 0 });\n const [active, setActive] = React.useState(false);\n const [captionsOn, setCaptionsOn] = React.useState(false);\n const n = playlist.length;\n const current = playlist[index];\n const wake = React.useCallback(() => setActive(true), []);\n\n useInView(region, (v) => { if (v) setSeen(true); else video.current?.pause(); });\n React.useEffect(() => { if (!active) return; const id = setTimeout(() => setActive(false), 2500); return () => clearTimeout(id); }, [active]);\n React.useEffect(() => { if (prev === null) return; const id = setTimeout(() => setPrev(null), reduced ? 0 : 650); return () => clearTimeout(id); }, [prev, reduced]);\n React.useEffect(() => { if (seen && autoPlay && !reduced && current?.src) playSafely(video.current); }, [seen, autoPlay, reduced, index, current?.src]);\n React.useEffect(() => { const list = video.current?.textTracks; if (list) Array.from(list).forEach((track, i) => { track.mode = captionsOn && i === 0 ? \"showing\" : \"disabled\"; }); }, [captionsOn, index]);\n\n const go = (to: number) => {\n const next = ((to % n) + n) % n;\n if (next === index && n > 1) return;\n if (!reduced && n > 1) setPrev(index);\n setIndex(next);\n setTime({ t: 0, d: 0 });\n onIndexChange?.(next);\n };\n const toggle = () => { const v = video.current; if (!v) return; if (v.paused) playSafely(v); else v.pause(); };\n const setMuted = (m: boolean) => { setMutedState(m); onMutedChange?.(m); };\n const onKey = (e: React.KeyboardEvent) => {\n if (e.target !== e.currentTarget) return;\n const v = video.current;\n const act: Record<string, () => void> = { \" \": toggle, k: toggle, m: () => setMuted(!muted), n: () => go(index + 1), p: () => go(index - 1), ArrowRight: () => { if (v) v.currentTime += 5; }, ArrowLeft: () => { if (v) v.currentTime -= 5; } };\n const fn = act[e.key.length === 1 ? e.key.toLowerCase() : e.key];\n if (fn) { e.preventDefault(); fn(); wake(); }\n };\n const layer = (i: number, role: \"in\" | \"out\") => {\n const src = playlist[i];\n if (!src) return null;\n return (\n <div className=\"kz-rtv-layer\" key={src.id} data-role={role} data-tr={transition}>\n {src.src ? (\n role === \"in\" ? (\n <video ref={video} src={seen ? src.src : undefined} poster={src.poster} muted={muted} playsInline preload={seen ? \"auto\" : \"none\"} loop={n === 1} aria-label={src.title}\n onPlay={() => setPlaying(true)} onPause={() => setPlaying(false)} onEnded={() => { if (n > 1) go(index + 1); }}\n onTimeUpdate={(e) => setTime({ t: e.currentTarget.currentTime, d: e.currentTarget.duration || 0 })} onLoadedMetadata={(e) => setTime({ t: 0, d: e.currentTarget.duration || 0 })}>\n {src.tracks?.map((t) => <track key={t.src} kind=\"captions\" src={t.src} srcLang={t.srcLang} label={t.label} />)}\n </video>\n ) : src.poster ? <img src={src.poster} alt=\"\" /> : null\n ) : role === \"in\" ? renderEmbed?.(src) : null}\n </div>\n );\n };\n const p = time.d ? Math.min(1, time.t / time.d) : 0;\n const hasCaptions = !!current?.tracks?.length;\n return (\n <>\n <style>{styles}</style>\n <div ref={region} role=\"region\" aria-label={title ?? current?.title} tabIndex={0} className=\"kz-rtv-playlist\" data-active={active ? \"true\" : undefined} onKeyDown={onKey} onPointerMove={wake} onPointerDown={wake} onFocus={wake} style={{ position: \"absolute\", inset: 0, \"--kz-rtv-p\": p } as React.CSSProperties}>\n {prev !== null && layer(prev, \"out\")}\n {layer(index, \"in\")}\n {prev !== null && transition === \"channel\" && <div className=\"kz-rtv-static\" aria-hidden=\"true\"><span className=\"kz-rtv-noise\" style={{ position: \"absolute\", inset: 0, background: \"repeating-linear-gradient(0deg,var(--kz-text-on-media) 0 1px,var(--kz-scrim-strong) 1px 3px)\" }} /></div>}\n <button type=\"button\" className=\"kz-rtv-chip\" aria-pressed={!muted} aria-label={muted ? labels.soundOff : labels.soundOn} onClick={() => setMuted(!muted)}><VolumeGlyph muted={muted} /></button>\n <div className=\"kz-rtv-progress\" aria-hidden=\"true\"><i /></div>\n <div className=\"kz-rtv-bar\">\n <button type=\"button\" aria-label={labels.previous} onClick={() => go(index - 1)} disabled={n < 2}>«</button>\n <button type=\"button\" aria-label={playing ? labels.pause : labels.play} onClick={toggle} disabled={!current?.src}>{playing ? <PauseGlyph /> : <PlayGlyph />}</button>\n <button type=\"button\" aria-label={labels.next} onClick={() => go(index + 1)} disabled={n < 2}>»</button>\n <span className=\"kz-rtv-time\">{formatClock(time.t)} / {formatClock(time.d)}</span>\n <input className=\"kz-rtv-seek\" type=\"range\" aria-label={labels.seek} min={0} max={Math.max(1, Math.floor(time.d))} value={Math.floor(time.t)} disabled={!time.d} onChange={(e) => { if (video.current) video.current.currentTime = Number(e.target.value); }} />\n {hasCaptions && <button type=\"button\" aria-label={labels.captions} aria-pressed={captionsOn} onClick={() => setCaptionsOn(!captionsOn)}><CaptionsGlyph /></button>}\n </div>\n <span className=\"sr-only\" aria-live=\"polite\">{labels.nowPlaying}: {current?.title} ({index + 1}/{n})</span>\n </div>\n </>\n );\n}\n","// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: Readonly<GlyphProps & { fill?: boolean; children: React.ReactNode }>) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: Readonly<GlyphProps & { muted?: boolean }>) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: Readonly<GlyphProps & { exit?: boolean }>) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: Readonly<GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }>) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: Readonly<GlyphProps & { direction?: \"ascending\" | \"descending\" }>) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: Readonly<GlyphProps & { direction?: \"left\" | \"right\" }>) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\nexport const PencilGlyph = (p: Readonly<GlyphProps>) => (\n <Glyph {...p}>\n <path d=\"M4 20h4L19 9a2.8 2.8 0 0 0-4-4L4 16v4zM13.5 6.5l4 4\" />\n </Glyph>\n);\n","// Shared by the data and media primitives (client): the clock format, the reduced-motion preference, the\n// in-view observer, a debounced callback. Never an entry of its own.\nimport * as React from \"react\";\n\n/** Seconds as a clock: `75` → `1:15`, `3725` → `1:02:05`. Negative or unknown values read `0:00`. */\nexport function formatClock(seconds: number): string {\n const s = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const rest = String(s % 60).padStart(2, \"0\");\n return h > 0 ? `${h}:${String(m).padStart(2, \"0\")}:${rest}` : `${m}:${rest}`;\n}\n\n/** Clamps `value` between `min` and `max`. */\nexport const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst REDUCE = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduce = (notify: () => void) => {\n if (typeof window === \"undefined\" || !window.matchMedia) return () => undefined;\n const query = window.matchMedia(REDUCE);\n query.addEventListener?.(\"change\", notify);\n return () => query.removeEventListener?.(\"change\", notify);\n};\n\n/** `true` when the person asked for less motion (`prefers-reduced-motion: reduce`); follows a change of the setting. */\nexport function usePrefersReducedMotion(): boolean {\n return React.useSyncExternalStore(\n subscribeReduce,\n () => (typeof window !== \"undefined\" && window.matchMedia ? window.matchMedia(REDUCE).matches : false),\n () => false,\n );\n}\n\n/** The latest value of a callback, for an effect or an event that must not re-subscribe when it changes. */\nexport function useLatest<T>(value: T) {\n const ref = React.useRef(value);\n React.useLayoutEffect(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/** Calls `onChange(visible)` when at least `threshold` of the element enters or leaves the viewport. */\nexport function useInView(ref: React.RefObject<Element | null>, onChange: (visible: boolean) => void, enabled = true, threshold = 0.25) {\n const latest = useLatest(onChange);\n React.useEffect(() => {\n const element = ref.current;\n if (!enabled || !element || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => entry && latest.current(entry.isIntersecting), { threshold });\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled, threshold, latest]);\n}\n\n/** A value controlled by a prop when it is given, held inside otherwise; `set` calls `onChange` either way. */\nexport function useControllable<T>(value: T | undefined, defaultValue: T, onChange?: (next: T) => void) {\n const [inner, setInner] = React.useState(defaultValue);\n const controlled = value !== undefined;\n const current = controlled ? value : inner;\n const set = React.useCallback(\n (next: T) => {\n if (!controlled) setInner(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [current, set] as const;\n}\n\n/** Starts a media element without an unhandled rejection (autoplay refused, the source replaced meanwhile). */\nexport function playSafely(media: HTMLMediaElement | null | undefined) {\n try {\n const started = media?.play() as Promise<void> | undefined;\n started?.catch?.(() => undefined);\n } catch {\n // Not playable here (no media support): the controls stay as they are.\n }\n}\n\nconst subscribeLoad = (notify: () => void) => {\n window.addEventListener(\"load\", notify);\n return () => window.removeEventListener(\"load\", notify);\n};\n/** `true` once the page has finished loading: a clip or a loop is not worth bytes before it (the page's LCP comes first). */\nexport function usePageLoaded(): boolean {\n return React.useSyncExternalStore(subscribeLoad, () => document.readyState === \"complete\", () => false);\n}\n\ntype SaveDataNavigator = Navigator & { connection?: { saveData?: boolean } };\n/** `true` when the person asked for less motion or less data: nothing plays, the posters stay. */\nexport function useCalm(): boolean {\n const reduce = usePrefersReducedMotion();\n return reduce || (typeof navigator !== \"undefined\" && Boolean((navigator as SaveDataNavigator).connection?.saveData));\n}\n\nconst subscribeVisibility = (notify: () => void) => {\n document.addEventListener(\"visibilitychange\", notify);\n return () => document.removeEventListener(\"visibilitychange\", notify);\n};\n/** `true` while the tab is hidden: what moves waits for it. */\nexport function usePageHidden(): boolean {\n return React.useSyncExternalStore(subscribeVisibility, () => document.visibilityState === \"hidden\", () => false);\n}\n"],"mappings":";;;;AAEA,YAAYA,YAAW;;;ACOnB,cAsBF,YAtBE;AAFJ,SAAS,MAAM,EAAE,YAAY,WAAW,MAAM,SAAS,GAAyE;AAC9H,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR;AAAA,MACA,MAAM,OAAO,iBAAiB;AAAA,MAC9B,QAAQ,OAAO,SAAS;AAAA,MACxB,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAW;AAAA,MACX,WAAU;AAAA,MAET;AAAA;AAAA,EACH;AAEJ;AAEO,IAAM,YAAY,CAAC,MACxB,oBAAC,SAAO,GAAG,GAAG,MAAI,MAChB,8BAAC,UAAK,GAAE,kFAAiF,GAC3F;AAEK,IAAM,aAAa,CAAC,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A,KAAC,YAAO,MAAK,UAAS,cAAY,OAAO,UAAU,gBAAc,YAAY,SAAS,MAAM,cAAc,CAAC,UAAU,GAAG,0BAAAA,KAAC,iBAAc,GAAE;AAAA,SAC3J;AAAA,MACA,gBAAAC,MAAC,UAAK,WAAU,WAAU,aAAU,UAAU;AAAA,eAAO;AAAA,QAAW;AAAA,QAAG,SAAS;AAAA,QAAM;AAAA,QAAG,QAAQ;AAAA,QAAE;AAAA,QAAE;AAAA,QAAE;AAAA,SAAC;AAAA,OACtG;AAAA,KACA;AAEJ;","names":["React","jsx","jsxs"]}
|
package/dist/retro-tv.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
VideoPlayer
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-KCU45KQ3.js";
|
|
5
|
+
import "./chunk-7MA3UODW.js";
|
|
6
|
+
import "./chunk-DTGRZXYO.js";
|
|
7
|
+
import "./chunk-HHBTM4AU.js";
|
|
8
8
|
import {
|
|
9
9
|
useInView,
|
|
10
10
|
usePrefersReducedMotion
|
|
11
11
|
} from "./chunk-ZSCNMFE6.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QKL5TECH.js";
|
|
13
13
|
|
|
14
14
|
// src/retro-tv/retro-tv.tsx
|
|
15
15
|
import * as React from "react";
|
|
@@ -85,7 +85,7 @@ function RetroTv({
|
|
|
85
85
|
const root = React.useRef(null);
|
|
86
86
|
const [powered, setPowered] = React.useState(false);
|
|
87
87
|
const reducedMotion = usePrefersReducedMotion();
|
|
88
|
-
const uid = React.useId().
|
|
88
|
+
const uid = React.useId().replaceAll(/[^a-zA-Z0-9_-]/g, "");
|
|
89
89
|
const noiseId = `${uid}-noise`;
|
|
90
90
|
const glassId = `${uid}-glass`;
|
|
91
91
|
const shineId = `${uid}-shine`;
|
package/dist/retro-tv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/retro-tv/retro-tv.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { useInView, usePrefersReducedMotion } from \"../media\";\nimport { VideoPlayer, type VideoPlayerProps } from \"../video-player/video-player\";\n\n/**\n * The playlist (transitions, bar, seek, captions, sound chip) is its own chunk, loaded only when a `playlist` is given: the\n * single clip (a shop's video, an embed) never downloads it.\n */\nconst PlaylistScreen = React.lazy(() => import(\"./playlist-screen\").then((m) => ({ default: m.PlaylistScreen })));\n\nconst styles = `\n.kz-rtv{container-type:inline-size;width:100%;max-width:100%;color:var(--kz-text-primary)}\n.kz-rtv-frame{position:relative;isolation:isolate;width:100%;aspect-ratio:4/5}\n@container (min-width:44rem){.kz-rtv-frame{aspect-ratio:16/10}.kz-rtv-bezel{width:72%}.kz-rtv-screen{width:66%}.kz-rtv-controls{width:18%;right:5%}.kz-rtv-speaker{width:18%;right:5%}}\n.kz-rtv-cabinet{position:absolute;inset:0;overflow:hidden}\n.kz-rtv-body{position:absolute;inset:4% 4% 16%;border:1px solid var(--kz-border-strong);border-radius:8% / 6%;background:linear-gradient(145deg,var(--kz-surface-sheen),transparent 35%),linear-gradient(145deg,color-mix(in srgb,var(--kz-warning) 18%,var(--kz-surface-3)),color-mix(in srgb,var(--kz-warning-text) 10%,var(--kz-surface-2)) 48%,var(--kz-surface-1));box-shadow:inset 0 1px 0 var(--kz-surface-sheen),inset 0 -3px 6px color-mix(in srgb,var(--kz-scrim-strong) 30%,transparent),0 1.2rem 2rem color-mix(in srgb,var(--kz-scrim-strong) 24%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-body{border-radius:12% / 8%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-2) 55%,var(--kz-surface-3))}\n.kz-rtv-body:after{position:absolute;inset:0;border-radius:inherit;background:repeating-linear-gradient(115deg,transparent 0 7px,color-mix(in srgb,var(--kz-border-subtle) 35%,transparent) 8px 9px);content:\"\";opacity:.4;pointer-events:none}\n.kz-rtv-bezel{position:absolute;top:0;bottom:0;left:6%;width:61%;border:1px solid var(--kz-border-strong);border-radius:14% / 7%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 2px 5px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 1px 2px color-mix(in srgb,var(--kz-surface-sheen) 60%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-bezel{border-radius:19% / 9%;background:linear-gradient(145deg,var(--kz-surface-0),var(--kz-surface-2))}\n.kz-rtv-controls{position:absolute;top:16%;right:7%;display:flex;width:23%;flex-direction:column;align-items:center;gap:1.1rem}\n.kz-rtv-knob{position:relative;display:block;width:2.3rem;max-width:70%;aspect-ratio:1;border:2px solid var(--kz-border-strong);border-radius:50%;background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 -2px 3px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 2px 4px color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent);color:var(--kz-accent)}\n.kz-rtv-knob[data-hue=accent]{background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-accent-text),var(--kz-accent))}\n.kz-rtv-knob{transform:rotate(var(--kz-rtv-angle,0deg));transition:transform .4s cubic-bezier(.3,1.4,.5,1)}\n.kz-rtv-knob:before{position:absolute;inset:-.35rem;border-radius:50%;background:repeating-conic-gradient(from -135deg,var(--kz-border-strong) 0 2deg,transparent 2deg 27deg);content:\"\";-webkit-mask:radial-gradient(circle,transparent 62%,#000 64%);mask:radial-gradient(circle,transparent 62%,#000 64%);transform:rotate(calc(var(--kz-rtv-angle,0deg)*-1))}\n.kz-rtv-knob:after{position:absolute;top:14%;left:calc(50% - 1px);width:2px;height:27%;border-radius:2px;background:var(--kz-on-accent);content:\"\"}\n.kz-rtv[data-variant=portable] .kz-rtv-knob{width:1.9rem}\n.kz-rtv-speaker{position:absolute;right:7%;bottom:9%;display:flex;width:23%;flex-direction:column;gap:3px}\n.kz-rtv-speaker i{height:2px;border-radius:2px;background:var(--kz-border-strong);box-shadow:0 1px 0 var(--kz-surface-sheen)}\n.kz-rtv[data-variant=portable] .kz-rtv-speaker{display:none}\n.kz-rtv-stand{position:absolute;bottom:4%;left:36%;width:28%;height:12%;border-bottom:1px solid var(--kz-border-strong);border-radius:0 0 30% 30%;background:linear-gradient(180deg,var(--kz-surface-2),var(--kz-surface-3));clip-path:polygon(25% 0,75% 0,88% 78%,100% 100%,0 100%,12% 78%)}\n.kz-rtv[data-variant=portable] .kz-rtv-stand{left:40%;width:20%;height:8%;border-radius:50%;clip-path:ellipse(50% 50% at 50% 50%)}\n.kz-rtv-screen{position:absolute;top:4%;left:9.5%;width:56%;height:80%;overflow:hidden;border:2px solid color-mix(in srgb,var(--kz-border-strong) 72%,var(--kz-accent));border-radius:13% / 7%;background:var(--kz-scrim-strong);box-shadow:0 0 1.1rem color-mix(in srgb,var(--kz-accent) 30%,transparent),inset 0 0 1.2rem var(--kz-scrim-strong)}\n.kz-rtv[data-variant=portable] .kz-rtv-screen{border-radius:18% / 9%}\n.kz-rtv-screen .kz-rtv-player{height:100%;width:100%;border-radius:inherit}\n.kz-rtv-screen .kz-embed{height:100%;width:100%;aspect-ratio:auto;border-radius:inherit}\n.kz-rtv-player video,.kz-rtv-player img{object-fit:cover}\n.kz-rtv-effects{position:absolute;z-index:5;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none}\n.kz-rtv-effects:before{position:absolute;inset:0;background:repeating-linear-gradient(to bottom,transparent 0 3px,color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent) 4px 5px);content:\"\";opacity:.46}\n.kz-rtv-effects:after{position:absolute;inset:-1px;background:radial-gradient(ellipse at center,transparent 55%,var(--kz-scrim-strong) 100%);content:\"\";opacity:.52}\n.kz-rtv-glow{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,color-mix(in srgb,var(--kz-accent) 14%,transparent),transparent 68%);opacity:.7}\n.kz-rtv-noise{position:absolute;inset:0;height:100%;width:100%;opacity:.55;filter:contrast(1.3) brightness(.85)}\n.kz-rtv-glass{position:absolute;inset:0;height:100%;width:100%;opacity:.28}\n.kz-rtv-power{position:absolute;inset:0;background:var(--kz-text-on-media);opacity:0;transform:scaleY(.01);transform-origin:center;pointer-events:none}\n.kz-rtv[data-powered=true] .kz-rtv-power{animation:kz-rtv-power .65s ease-out both}\n.kz-rtv-channel{position:absolute;z-index:7;top:8%;right:5%;width:24%;overflow:hidden;padding:.25em .4em;border:1px solid var(--kz-border-strong);border-radius:3px;background:var(--kz-surface-1);box-shadow:inset 0 1px 0 var(--kz-surface-sheen);color:var(--kz-text-primary);font:700 clamp(.5rem,1.4cqw,.7rem)/1.2 var(--kz-font-mono,monospace);letter-spacing:.12em;text-transform:uppercase;text-align:center;text-overflow:ellipsis;white-space:nowrap}\n.kz-rtv[data-variant=portable] .kz-rtv-channel{top:7%}\n.kz-rtv:focus-within .kz-rtv-screen{outline:2px solid var(--kz-ring);outline-offset:3px}\n@keyframes kz-rtv-power{0%{opacity:1;transform:scaleY(.01)}45%{opacity:.9;transform:scaleY(1)}100%{opacity:0;transform:scaleY(1)}}\n@keyframes kz-rtv-noise{0%,100%{opacity:.38}50%{opacity:.62}}\n@media (prefers-reduced-motion:no-preference){.kz-rtv[data-off=true] .kz-rtv-noise{animation:kz-rtv-noise .18s steps(2,end) infinite}}\n@media (prefers-reduced-motion:reduce){.kz-rtv-power{display:none!important}.kz-rtv-noise{animation:none!important}}\n\n`;\n\n\n/** One programme of the playlist: an uploaded video (`src`) or, without `src`, a slot the host fills with `renderEmbed`. */\nexport interface RetroTvSource {\n id: string;\n title: string;\n src?: string;\n poster?: string;\n /** WebVTT captions of this video. */\n tracks?: VideoPlayerProps[\"tracks\"];\n}\nexport type RetroTvTransition = \"channel\" | \"crossfade\" | \"slide\";\nexport interface RetroTvLabels { play: string; pause: string; next: string; previous: string; soundOff: string; soundOn: string; captions: string; seek: string; nowPlaying: string }\nexport const retroTvLabels: RetroTvLabels = { play: \"Play\", pause: \"Pause\", next: \"Next video\", previous: \"Previous video\", soundOff: \"Sound off: turn on\", soundOn: \"Sound on: turn off\", captions: \"Captions\", seek: \"Seek\", nowPlaying: \"Now playing\" };\nexport const retroTvLabelsFr: RetroTvLabels = { play: \"Lecture\", pause: \"Pause\", next: \"Vidéo suivante\", previous: \"Vidéo précédente\", soundOff: \"Son coupé : activer\", soundOn: \"Son activé : couper\", captions: \"Sous-titres\", seek: \"Position\", nowPlaying: \"En cours\" };\n\n/** A vertical video in a CSS-and-SVG television cabinet. */\nexport interface RetroTvProps extends Omit<VideoPlayerProps, \"aspectRatio\" | \"labels\" | \"autoPlay\" | \"className\" | \"loop\" | \"muted\" | \"preload\" | \"src\"> {\n /** The video's address. Optional when the screen shows `children`. */\n src?: VideoPlayerProps[\"src\"];\n /** What the screen shows instead of the video player: an `EmbedFacade` for a platform's short video. */\n children?: React.ReactNode;\n /** The cabinet style. */\n variant?: \"cabinet\" | \"portable\";\n /** A short channel label shown on the cabinet, for example `\"CH 3 · Plateau\"`. */\n channel?: string;\n /** Shows animated static instead of loading or playing the video. */\n off?: boolean;\n /** Starts muted and plays only while on screen; reduced motion waits for a gesture. Default `true`. */\n autoPlay?: boolean;\n /** Starts the player muted. Default `true`. */\n muted?: boolean;\n /** Plays the video again from the start when it ends. Default `true`. */\n loop?: boolean;\n /** How much to fetch before playback. Default `none` for lazy loading. */\n preload?: VideoPlayerProps[\"preload\"];\n /** Additional classes on the television frame. */\n className?: string;\n /** Programmes played in order, then again from the first. Replaces `src` and `children`. */\n playlist?: readonly RetroTvSource[];\n /** How one programme gives way to the next; a cut under reduced motion. Default `channel`. */\n transition?: RetroTvTransition;\n /** The host fills the screen of a source that has no `src` (an embed behind its own consent gate); the library loads no third-party script. */\n renderEmbed?: (source: RetroTvSource) => React.ReactNode;\n /** Told when the visitor turns the sound on or off, so the host can remember the choice. */\n onMutedChange?: (muted: boolean) => void;\n /** Told when another programme starts. */\n onIndexChange?: (index: number) => void;\n /** The controls' words; `retroTvLabelsFr` for French. */\n labels?: Partial<RetroTvLabels>;\n}\n\n/**\n * A vertical video presented in an old-school television; the existing player remains fully accessible.\n */\nexport function RetroTv({\n variant = \"cabinet\",\n channel,\n off = false,\n autoPlay = true,\n muted = true,\n loop = true,\n preload = \"none\",\n className,\n children,\n src,\n playlist,\n transition = \"channel\",\n renderEmbed,\n onMutedChange,\n onIndexChange,\n labels,\n ...playerProps\n}: Readonly<RetroTvProps>) {\n const [index, setIndex] = React.useState(0);\n const [mutedState, setMutedState] = React.useState(muted);\n const root = React.useRef<HTMLDivElement>(null);\n const [powered, setPowered] = React.useState(false);\n const reducedMotion = usePrefersReducedMotion();\n const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const noiseId = `${uid}-noise`;\n const glassId = `${uid}-glass`;\n const shineId = `${uid}-shine`;\n\n useInView(root, setPowered);\n const player = src ? <VideoPlayer {...playerProps} src={src} className=\"kz-rtv-player\" aspectRatio=\"9 / 16\" autoPlay={autoPlay} muted={muted} loop={loop} preload={preload} /> : null;\n const knob = { channel: index * 50, sound: mutedState ? -50 : 50 };\n const screen = playlist?.length ? (\n <React.Suspense fallback={null}><PlaylistScreen playlist={playlist} transition={transition} labels={{ ...retroTvLabels, ...labels }} muted={mutedState} autoPlay={autoPlay} renderEmbed={renderEmbed} onMutedChange={onMutedChange} onIndexChange={onIndexChange} title={playerProps.title} reduced={reducedMotion} setMutedState={setMutedState} setIndex={setIndex} index={index} /></React.Suspense>\n ) : children ?? player;\n\n return (\n <div ref={root} className={[\"kz-rtv\", className].filter(Boolean).join(\" \")} data-variant={variant} data-powered={powered && !reducedMotion ? \"true\" : undefined} data-off={off ? \"true\" : undefined}>\n <style>{styles}</style>\n <div className=\"kz-rtv-frame\">\n <div className=\"kz-rtv-cabinet\" aria-hidden=\"true\">\n <div className=\"kz-rtv-body\">\n <div className=\"kz-rtv-bezel\" />\n <div className=\"kz-rtv-controls\">\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" style={{ \"--kz-rtv-angle\": `${knob.channel}deg` } as React.CSSProperties} />\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" style={{ \"--kz-rtv-angle\": `${knob.sound}deg` } as React.CSSProperties} />\n </div>\n <div className=\"kz-rtv-speaker\">{Array.from({ length: 7 }, (_, index) => <i key={index} />)}</div>\n </div>\n <div className=\"kz-rtv-stand\" />\n </div>\n {channel && <span className=\"kz-rtv-channel\">{channel}</span>}\n <div className=\"kz-rtv-screen\">\n {off ? (\n <svg className=\"kz-rtv-noise\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n <filter id={noiseId}><feTurbulence type=\"fractalNoise\" baseFrequency=\".85\" numOctaves=\"2\" stitchTiles=\"stitch\" /><feColorMatrix type=\"saturate\" values=\"0\" /></filter>\n <rect width=\"100%\" height=\"100%\" filter={`url(#${noiseId})`} />\n </svg>\n ) : (\n screen\n )}\n <div className=\"kz-rtv-effects\" aria-hidden=\"true\">\n <svg className=\"kz-rtv-glass\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\">\n <defs>\n <radialGradient id={shineId} cx=\"50%\" cy=\"42%\" r=\"68%\">\n <stop offset=\"0\" stopColor=\"var(--kz-surface-sheen)\" stopOpacity=\".12\" />\n <stop offset=\"1\" stopColor=\"var(--kz-scrim-strong)\" stopOpacity=\".2\" />\n </radialGradient>\n <filter id={glassId}>\n <feTurbulence baseFrequency=\".01 .04\" numOctaves=\"1\" seed=\"2\" result=\"curve\" />\n <feDisplacementMap in=\"SourceGraphic\" in2=\"curve\" scale=\"1.2\" xChannelSelector=\"R\" yChannelSelector=\"G\" />\n </filter>\n </defs>\n <rect width=\"100\" height=\"100\" fill={`url(#${shineId})`} filter={`url(#${glassId})`} />\n </svg>\n <span className=\"kz-rtv-glow\" />\n <span className=\"kz-rtv-power\" />\n </div>\n </div>\n {off && <span className=\"sr-only\">{playerProps.title}</span>}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA,YAAY,WAAW;AA4IA,cAab,YAba;AAnIvB,IAAM,iBAAuB,WAAK,MAAM,OAAO,wBAAmB,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAEhH,IAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDR,IAAM,gBAA+B,EAAE,MAAM,QAAQ,OAAO,SAAS,MAAM,cAAc,UAAU,kBAAkB,UAAU,sBAAsB,SAAS,sBAAsB,UAAU,YAAY,MAAM,QAAQ,YAAY,cAAc;AAClP,IAAM,kBAAiC,EAAE,MAAM,WAAW,OAAO,SAAS,MAAM,qBAAkB,UAAU,6BAAoB,UAAU,0BAAuB,SAAS,0BAAuB,UAAU,eAAe,MAAM,YAAY,YAAY,WAAW;AAyCnQ,SAAS,QAAQ;AAAA,EACtB,UAAU;AAAA,EACV;AAAA,EACA,MAAM;AAAA,EACN,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA2B;AACzB,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAS,CAAC;AAC1C,QAAM,CAAC,YAAY,aAAa,IAAU,eAAS,KAAK;AACxD,QAAM,OA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G;AAAA,eACF;AAAA,YACA,oBAAC,UAAK,OAAM,OAAM,QAAO,OAAM,MAAM,QAAQ,OAAO,KAAK,QAAQ,QAAQ,OAAO,KAAK;AAAA,aACvF;AAAA,UACA,oBAAC,UAAK,WAAU,eAAc;AAAA,UAC9B,oBAAC,UAAK,WAAU,gBAAe;AAAA,WACjC;AAAA,SACF;AAAA,MACC,OAAO,oBAAC,UAAK,WAAU,WAAW,sBAAY,OAAM;AAAA,OACrD;AAAA,KACF;AAEJ;","names":["index"]}
|
|
1
|
+
{"version":3,"sources":["../src/retro-tv/retro-tv.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { useInView, usePrefersReducedMotion } from \"../media\";\nimport { VideoPlayer, type VideoPlayerProps } from \"../video-player/video-player\";\n\n/**\n * The playlist (transitions, bar, seek, captions, sound chip) is its own chunk, loaded only when a `playlist` is given: the\n * single clip (a shop's video, an embed) never downloads it.\n */\nconst PlaylistScreen = React.lazy(() => import(\"./playlist-screen\").then((m) => ({ default: m.PlaylistScreen })));\n\nconst styles = `\n.kz-rtv{container-type:inline-size;width:100%;max-width:100%;color:var(--kz-text-primary)}\n.kz-rtv-frame{position:relative;isolation:isolate;width:100%;aspect-ratio:4/5}\n@container (min-width:44rem){.kz-rtv-frame{aspect-ratio:16/10}.kz-rtv-bezel{width:72%}.kz-rtv-screen{width:66%}.kz-rtv-controls{width:18%;right:5%}.kz-rtv-speaker{width:18%;right:5%}}\n.kz-rtv-cabinet{position:absolute;inset:0;overflow:hidden}\n.kz-rtv-body{position:absolute;inset:4% 4% 16%;border:1px solid var(--kz-border-strong);border-radius:8% / 6%;background:linear-gradient(145deg,var(--kz-surface-sheen),transparent 35%),linear-gradient(145deg,color-mix(in srgb,var(--kz-warning) 18%,var(--kz-surface-3)),color-mix(in srgb,var(--kz-warning-text) 10%,var(--kz-surface-2)) 48%,var(--kz-surface-1));box-shadow:inset 0 1px 0 var(--kz-surface-sheen),inset 0 -3px 6px color-mix(in srgb,var(--kz-scrim-strong) 30%,transparent),0 1.2rem 2rem color-mix(in srgb,var(--kz-scrim-strong) 24%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-body{border-radius:12% / 8%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-2) 55%,var(--kz-surface-3))}\n.kz-rtv-body:after{position:absolute;inset:0;border-radius:inherit;background:repeating-linear-gradient(115deg,transparent 0 7px,color-mix(in srgb,var(--kz-border-subtle) 35%,transparent) 8px 9px);content:\"\";opacity:.4;pointer-events:none}\n.kz-rtv-bezel{position:absolute;top:0;bottom:0;left:6%;width:61%;border:1px solid var(--kz-border-strong);border-radius:14% / 7%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 2px 5px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 1px 2px color-mix(in srgb,var(--kz-surface-sheen) 60%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-bezel{border-radius:19% / 9%;background:linear-gradient(145deg,var(--kz-surface-0),var(--kz-surface-2))}\n.kz-rtv-controls{position:absolute;top:16%;right:7%;display:flex;width:23%;flex-direction:column;align-items:center;gap:1.1rem}\n.kz-rtv-knob{position:relative;display:block;width:2.3rem;max-width:70%;aspect-ratio:1;border:2px solid var(--kz-border-strong);border-radius:50%;background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 -2px 3px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 2px 4px color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent);color:var(--kz-accent)}\n.kz-rtv-knob[data-hue=accent]{background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-accent-text),var(--kz-accent))}\n.kz-rtv-knob{transform:rotate(var(--kz-rtv-angle,0deg));transition:transform .4s cubic-bezier(.3,1.4,.5,1)}\n.kz-rtv-knob:before{position:absolute;inset:-.35rem;border-radius:50%;background:repeating-conic-gradient(from -135deg,var(--kz-border-strong) 0 2deg,transparent 2deg 27deg);content:\"\";-webkit-mask:radial-gradient(circle,transparent 62%,#000 64%);mask:radial-gradient(circle,transparent 62%,#000 64%);transform:rotate(calc(var(--kz-rtv-angle,0deg)*-1))}\n.kz-rtv-knob:after{position:absolute;top:14%;left:calc(50% - 1px);width:2px;height:27%;border-radius:2px;background:var(--kz-on-accent);content:\"\"}\n.kz-rtv[data-variant=portable] .kz-rtv-knob{width:1.9rem}\n.kz-rtv-speaker{position:absolute;right:7%;bottom:9%;display:flex;width:23%;flex-direction:column;gap:3px}\n.kz-rtv-speaker i{height:2px;border-radius:2px;background:var(--kz-border-strong);box-shadow:0 1px 0 var(--kz-surface-sheen)}\n.kz-rtv[data-variant=portable] .kz-rtv-speaker{display:none}\n.kz-rtv-stand{position:absolute;bottom:4%;left:36%;width:28%;height:12%;border-bottom:1px solid var(--kz-border-strong);border-radius:0 0 30% 30%;background:linear-gradient(180deg,var(--kz-surface-2),var(--kz-surface-3));clip-path:polygon(25% 0,75% 0,88% 78%,100% 100%,0 100%,12% 78%)}\n.kz-rtv[data-variant=portable] .kz-rtv-stand{left:40%;width:20%;height:8%;border-radius:50%;clip-path:ellipse(50% 50% at 50% 50%)}\n.kz-rtv-screen{position:absolute;top:4%;left:9.5%;width:56%;height:80%;overflow:hidden;border:2px solid color-mix(in srgb,var(--kz-border-strong) 72%,var(--kz-accent));border-radius:13% / 7%;background:var(--kz-scrim-strong);box-shadow:0 0 1.1rem color-mix(in srgb,var(--kz-accent) 30%,transparent),inset 0 0 1.2rem var(--kz-scrim-strong)}\n.kz-rtv[data-variant=portable] .kz-rtv-screen{border-radius:18% / 9%}\n.kz-rtv-screen .kz-rtv-player{height:100%;width:100%;border-radius:inherit}\n.kz-rtv-screen .kz-embed{height:100%;width:100%;aspect-ratio:auto;border-radius:inherit}\n.kz-rtv-player video,.kz-rtv-player img{object-fit:cover}\n.kz-rtv-effects{position:absolute;z-index:5;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none}\n.kz-rtv-effects:before{position:absolute;inset:0;background:repeating-linear-gradient(to bottom,transparent 0 3px,color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent) 4px 5px);content:\"\";opacity:.46}\n.kz-rtv-effects:after{position:absolute;inset:-1px;background:radial-gradient(ellipse at center,transparent 55%,var(--kz-scrim-strong) 100%);content:\"\";opacity:.52}\n.kz-rtv-glow{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,color-mix(in srgb,var(--kz-accent) 14%,transparent),transparent 68%);opacity:.7}\n.kz-rtv-noise{position:absolute;inset:0;height:100%;width:100%;opacity:.55;filter:contrast(1.3) brightness(.85)}\n.kz-rtv-glass{position:absolute;inset:0;height:100%;width:100%;opacity:.28}\n.kz-rtv-power{position:absolute;inset:0;background:var(--kz-text-on-media);opacity:0;transform:scaleY(.01);transform-origin:center;pointer-events:none}\n.kz-rtv[data-powered=true] .kz-rtv-power{animation:kz-rtv-power .65s ease-out both}\n.kz-rtv-channel{position:absolute;z-index:7;top:8%;right:5%;width:24%;overflow:hidden;padding:.25em .4em;border:1px solid var(--kz-border-strong);border-radius:3px;background:var(--kz-surface-1);box-shadow:inset 0 1px 0 var(--kz-surface-sheen);color:var(--kz-text-primary);font:700 clamp(.5rem,1.4cqw,.7rem)/1.2 var(--kz-font-mono,monospace);letter-spacing:.12em;text-transform:uppercase;text-align:center;text-overflow:ellipsis;white-space:nowrap}\n.kz-rtv[data-variant=portable] .kz-rtv-channel{top:7%}\n.kz-rtv:focus-within .kz-rtv-screen{outline:2px solid var(--kz-ring);outline-offset:3px}\n@keyframes kz-rtv-power{0%{opacity:1;transform:scaleY(.01)}45%{opacity:.9;transform:scaleY(1)}100%{opacity:0;transform:scaleY(1)}}\n@keyframes kz-rtv-noise{0%,100%{opacity:.38}50%{opacity:.62}}\n@media (prefers-reduced-motion:no-preference){.kz-rtv[data-off=true] .kz-rtv-noise{animation:kz-rtv-noise .18s steps(2,end) infinite}}\n@media (prefers-reduced-motion:reduce){.kz-rtv-power{display:none!important}.kz-rtv-noise{animation:none!important}}\n\n`;\n\n/** One programme of the playlist: an uploaded video (`src`) or, without `src`, a slot the host fills with `renderEmbed`. */\nexport interface RetroTvSource {\n id: string;\n title: string;\n src?: string;\n poster?: string;\n /** WebVTT captions of this video. */\n tracks?: VideoPlayerProps[\"tracks\"];\n}\nexport type RetroTvTransition = \"channel\" | \"crossfade\" | \"slide\";\nexport interface RetroTvLabels { play: string; pause: string; next: string; previous: string; soundOff: string; soundOn: string; captions: string; seek: string; nowPlaying: string }\nexport const retroTvLabels: RetroTvLabels = { play: \"Play\", pause: \"Pause\", next: \"Next video\", previous: \"Previous video\", soundOff: \"Sound off: turn on\", soundOn: \"Sound on: turn off\", captions: \"Captions\", seek: \"Seek\", nowPlaying: \"Now playing\" };\nexport const retroTvLabelsFr: RetroTvLabels = { play: \"Lecture\", pause: \"Pause\", next: \"Vidéo suivante\", previous: \"Vidéo précédente\", soundOff: \"Son coupé : activer\", soundOn: \"Son activé : couper\", captions: \"Sous-titres\", seek: \"Position\", nowPlaying: \"En cours\" };\n\n/** A vertical video in a CSS-and-SVG television cabinet. */\nexport interface RetroTvProps extends Omit<VideoPlayerProps, \"aspectRatio\" | \"labels\" | \"autoPlay\" | \"className\" | \"loop\" | \"muted\" | \"preload\" | \"src\"> {\n /** The video's address. Optional when the screen shows `children`. */\n src?: VideoPlayerProps[\"src\"];\n /** What the screen shows instead of the video player: an `EmbedFacade` for a platform's short video. */\n children?: React.ReactNode;\n /** The cabinet style. */\n variant?: \"cabinet\" | \"portable\";\n /** A short channel label shown on the cabinet, for example `\"CH 3 · Plateau\"`. */\n channel?: string;\n /** Shows animated static instead of loading or playing the video. */\n off?: boolean;\n /** Starts muted and plays only while on screen; reduced motion waits for a gesture. Default `true`. */\n autoPlay?: boolean;\n /** Starts the player muted. Default `true`. */\n muted?: boolean;\n /** Plays the video again from the start when it ends. Default `true`. */\n loop?: boolean;\n /** How much to fetch before playback. Default `none` for lazy loading. */\n preload?: VideoPlayerProps[\"preload\"];\n /** Additional classes on the television frame. */\n className?: string;\n /** Programmes played in order, then again from the first. Replaces `src` and `children`. */\n playlist?: readonly RetroTvSource[];\n /** How one programme gives way to the next; a cut under reduced motion. Default `channel`. */\n transition?: RetroTvTransition;\n /** The host fills the screen of a source that has no `src` (an embed behind its own consent gate); the library loads no third-party script. */\n renderEmbed?: (source: RetroTvSource) => React.ReactNode;\n /** Told when the visitor turns the sound on or off, so the host can remember the choice. */\n onMutedChange?: (muted: boolean) => void;\n /** Told when another programme starts. */\n onIndexChange?: (index: number) => void;\n /** The controls' words; `retroTvLabelsFr` for French. */\n labels?: Partial<RetroTvLabels>;\n}\n\n/**\n * A vertical video presented in an old-school television; the existing player remains fully accessible.\n */\nexport function RetroTv({\n variant = \"cabinet\",\n channel,\n off = false,\n autoPlay = true,\n muted = true,\n loop = true,\n preload = \"none\",\n className,\n children,\n src,\n playlist,\n transition = \"channel\",\n renderEmbed,\n onMutedChange,\n onIndexChange,\n labels,\n ...playerProps\n}: Readonly<RetroTvProps>) {\n const [index, setIndex] = React.useState(0);\n const [mutedState, setMutedState] = React.useState(muted);\n const root = React.useRef<HTMLDivElement>(null);\n const [powered, setPowered] = React.useState(false);\n const reducedMotion = usePrefersReducedMotion();\n const uid = React.useId().replaceAll(/[^a-zA-Z0-9_-]/g, \"\");\n const noiseId = `${uid}-noise`;\n const glassId = `${uid}-glass`;\n const shineId = `${uid}-shine`;\n\n useInView(root, setPowered);\n const player = src ? <VideoPlayer {...playerProps} src={src} className=\"kz-rtv-player\" aspectRatio=\"9 / 16\" autoPlay={autoPlay} muted={muted} loop={loop} preload={preload} /> : null;\n const knob = { channel: index * 50, sound: mutedState ? -50 : 50 };\n const screen = playlist?.length ? (\n <React.Suspense fallback={null}><PlaylistScreen playlist={playlist} transition={transition} labels={{ ...retroTvLabels, ...labels }} muted={mutedState} autoPlay={autoPlay} renderEmbed={renderEmbed} onMutedChange={onMutedChange} onIndexChange={onIndexChange} title={playerProps.title} reduced={reducedMotion} setMutedState={setMutedState} setIndex={setIndex} index={index} /></React.Suspense>\n ) : children ?? player;\n\n return (\n <div ref={root} className={[\"kz-rtv\", className].filter(Boolean).join(\" \")} data-variant={variant} data-powered={powered && !reducedMotion ? \"true\" : undefined} data-off={off ? \"true\" : undefined}>\n <style>{styles}</style>\n <div className=\"kz-rtv-frame\">\n <div className=\"kz-rtv-cabinet\" aria-hidden=\"true\">\n <div className=\"kz-rtv-body\">\n <div className=\"kz-rtv-bezel\" />\n <div className=\"kz-rtv-controls\">\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" style={{ \"--kz-rtv-angle\": `${knob.channel}deg` } as React.CSSProperties} />\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" style={{ \"--kz-rtv-angle\": `${knob.sound}deg` } as React.CSSProperties} />\n </div>\n <div className=\"kz-rtv-speaker\">{Array.from({ length: 7 }, (_, index) => <i key={index} />)}</div>\n </div>\n <div className=\"kz-rtv-stand\" />\n </div>\n {channel && <span className=\"kz-rtv-channel\">{channel}</span>}\n <div className=\"kz-rtv-screen\">\n {off ? (\n <svg className=\"kz-rtv-noise\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n <filter id={noiseId}><feTurbulence type=\"fractalNoise\" baseFrequency=\".85\" numOctaves=\"2\" stitchTiles=\"stitch\" /><feColorMatrix type=\"saturate\" values=\"0\" /></filter>\n <rect width=\"100%\" height=\"100%\" filter={`url(#${noiseId})`} />\n </svg>\n ) : (\n screen\n )}\n <div className=\"kz-rtv-effects\" aria-hidden=\"true\">\n <svg className=\"kz-rtv-glass\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\">\n <defs>\n <radialGradient id={shineId} cx=\"50%\" cy=\"42%\" r=\"68%\">\n <stop offset=\"0\" stopColor=\"var(--kz-surface-sheen)\" stopOpacity=\".12\" />\n <stop offset=\"1\" stopColor=\"var(--kz-scrim-strong)\" stopOpacity=\".2\" />\n </radialGradient>\n <filter id={glassId}>\n <feTurbulence baseFrequency=\".01 .04\" numOctaves=\"1\" seed=\"2\" result=\"curve\" />\n <feDisplacementMap in=\"SourceGraphic\" in2=\"curve\" scale=\"1.2\" xChannelSelector=\"R\" yChannelSelector=\"G\" />\n </filter>\n </defs>\n <rect width=\"100\" height=\"100\" fill={`url(#${shineId})`} filter={`url(#${glassId})`} />\n </svg>\n <span className=\"kz-rtv-glow\" />\n <span className=\"kz-rtv-power\" />\n </div>\n </div>\n {off && <span className=\"sr-only\">{playerProps.title}</span>}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA,YAAY,WAAW;AA2IA,cAab,YAba;AAlIvB,IAAM,iBAAuB,WAAK,MAAM,OAAO,wBAAmB,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAEhH,IAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwDR,IAAM,gBAA+B,EAAE,MAAM,QAAQ,OAAO,SAAS,MAAM,cAAc,UAAU,kBAAkB,UAAU,sBAAsB,SAAS,sBAAsB,UAAU,YAAY,MAAM,QAAQ,YAAY,cAAc;AAClP,IAAM,kBAAiC,EAAE,MAAM,WAAW,OAAO,SAAS,MAAM,qBAAkB,UAAU,6BAAoB,UAAU,0BAAuB,SAAS,0BAAuB,UAAU,eAAe,MAAM,YAAY,YAAY,WAAW;AAyCnQ,SAAS,QAAQ;AAAA,EACtB,UAAU;AAAA,EACV;AAAA,EACA,MAAM;AAAA,EACN,WAAW;AAAA,EACX,QAAQ;A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