@kerfjs/ui 5.0.0-beta.131 → 5.0.0-beta.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -14
- package/ai/application-ui-profile-sync.cjs +5 -14
- package/ai/application-ui-profile.d.ts +0 -2
- package/ai/application-ui-profile.defaults.json +0 -4
- package/ai/application-ui-profile.mjs +5 -14
- package/ai/application-ui-profile.schema.json +0 -4
- package/ai/choice-wiring-mode.cjs +68 -0
- package/ai/component-catalog.json +13 -9
- package/ai/component-composition-rules.json +2 -10
- package/ai/component-composition.d.ts +0 -17
- package/ai/component-composition.json +9 -12
- package/ai/component-composition.schema.json +0 -59
- package/ai/components/combobox.md +1 -1
- package/ai/components/disclosure.md +2 -0
- package/ai/components/form.md +1 -2
- package/ai/components/popup-menu.md +1 -0
- package/ai/components/switch.md +1 -1
- package/ai/components/tab-panel.md +0 -1
- package/ai/components/toolbar-control-group.md +2 -2
- package/ai/public-api-signatures-v1.md +218 -205
- package/ai/skill.md +3 -20
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/backdrop-image.d.ts +1 -1
- package/dist/backdrop-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +1 -1
- package/dist/catalog-library.d.ts +26 -0
- package/dist/catalog-library.js +2484 -0
- package/dist/catalog-library.js.map +1 -0
- package/dist/catalog-resources.d.ts +3 -3
- package/dist/catalog-resources.js +1 -20
- package/dist/catalog-resources.js.map +1 -1
- package/dist/catalog.d.ts +5 -4
- package/dist/catalog.js +151 -24
- package/dist/catalog.js.map +1 -1
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip.js +1 -1
- package/dist/choice-chips.d.ts +3 -3
- package/dist/choice-chips.js +1 -1
- package/dist/{chunk-Q5BPZPCO.js → chunk-22T7FFCL.js} +2 -2
- package/dist/{chunk-Q5BPZPCO.js.map → chunk-22T7FFCL.js.map} +1 -1
- package/dist/{chunk-BCHK33XL.js → chunk-27NEAPV7.js} +2 -2
- package/dist/{chunk-BCHK33XL.js.map → chunk-27NEAPV7.js.map} +1 -1
- package/dist/{chunk-76BLSFEA.js → chunk-2OYMXGW2.js} +6 -5
- package/dist/chunk-2OYMXGW2.js.map +1 -0
- package/dist/{chunk-EHR7R7YP.js → chunk-3DPHCZQB.js} +2 -2
- package/dist/{chunk-EHR7R7YP.js.map → chunk-3DPHCZQB.js.map} +1 -1
- package/dist/{chunk-RPJOLDSR.js → chunk-3UIZ36BP.js} +3 -3
- package/dist/{chunk-RPJOLDSR.js.map → chunk-3UIZ36BP.js.map} +1 -1
- package/dist/{chunk-QZA75NOK.js → chunk-42NLFCIN.js} +6 -6
- package/dist/{chunk-QZA75NOK.js.map → chunk-42NLFCIN.js.map} +1 -1
- package/dist/{chunk-UPHPFKAD.js → chunk-4GGIML4E.js} +2 -2
- package/dist/{chunk-UPHPFKAD.js.map → chunk-4GGIML4E.js.map} +1 -1
- package/dist/{chunk-5KWXM5O7.js → chunk-5C34PAUY.js} +2 -2
- package/dist/{chunk-5KWXM5O7.js.map → chunk-5C34PAUY.js.map} +1 -1
- package/dist/{chunk-6PHG2DMG.js → chunk-6OH734CG.js} +2 -2
- package/dist/{chunk-6PHG2DMG.js.map → chunk-6OH734CG.js.map} +1 -1
- package/dist/{chunk-E7ZRBMVQ.js → chunk-7XIY7G4K.js} +3 -3
- package/dist/{chunk-E7ZRBMVQ.js.map → chunk-7XIY7G4K.js.map} +1 -1
- package/dist/{chunk-OKZTLRGG.js → chunk-B5Q3KE4Z.js} +2 -2
- package/dist/{chunk-OKZTLRGG.js.map → chunk-B5Q3KE4Z.js.map} +1 -1
- package/dist/{chunk-SGYBIKQA.js → chunk-BADEZQ3V.js} +4 -4
- package/dist/chunk-BADEZQ3V.js.map +1 -0
- package/dist/{chunk-CJAKN2KZ.js → chunk-BLBMUD2W.js} +2 -2
- package/dist/{chunk-CJAKN2KZ.js.map → chunk-BLBMUD2W.js.map} +1 -1
- package/dist/{chunk-TRJS7M2H.js → chunk-BNRH7XG5.js} +2 -2
- package/dist/{chunk-TRJS7M2H.js.map → chunk-BNRH7XG5.js.map} +1 -1
- package/dist/{chunk-NA4LKVPX.js → chunk-BNXJQB2Y.js} +2 -2
- package/dist/{chunk-NA4LKVPX.js.map → chunk-BNXJQB2Y.js.map} +1 -1
- package/dist/{chunk-CCPWJDRW.js → chunk-BQHGXQVA.js} +2 -2
- package/dist/{chunk-CCPWJDRW.js.map → chunk-BQHGXQVA.js.map} +1 -1
- package/dist/{chunk-COQI4OMZ.js → chunk-BRDTP3RT.js} +1 -1
- package/dist/chunk-BRDTP3RT.js.map +1 -0
- package/dist/{chunk-RGB4DPMN.js → chunk-DGYGRMES.js} +3 -3
- package/dist/chunk-DGYGRMES.js.map +1 -0
- package/dist/{chunk-V3IXAI4L.js → chunk-DNNHT7RB.js} +2 -2
- package/dist/{chunk-V3IXAI4L.js.map → chunk-DNNHT7RB.js.map} +1 -1
- package/dist/{chunk-UU37OR3D.js → chunk-DT7KOBQJ.js} +1 -1
- package/dist/chunk-DT7KOBQJ.js.map +1 -0
- package/dist/{chunk-CUUW57WB.js → chunk-DXZA7OC6.js} +58 -14
- package/dist/chunk-DXZA7OC6.js.map +1 -0
- package/dist/{chunk-4OH6JSGU.js → chunk-F25UMYDX.js} +2 -2
- package/dist/{chunk-4OH6JSGU.js.map → chunk-F25UMYDX.js.map} +1 -1
- package/dist/{chunk-76VCWWUA.js → chunk-HSMSTCNZ.js} +2 -2
- package/dist/{chunk-76VCWWUA.js.map → chunk-HSMSTCNZ.js.map} +1 -1
- package/dist/{chunk-ECVTRAXN.js → chunk-IQOO3ZQK.js} +2 -2
- package/dist/{chunk-ECVTRAXN.js.map → chunk-IQOO3ZQK.js.map} +1 -1
- package/dist/{chunk-2FA3SX57.js → chunk-IXT2ARIM.js} +4 -4
- package/dist/{chunk-2FA3SX57.js.map → chunk-IXT2ARIM.js.map} +1 -1
- package/dist/{chunk-DBP3N6E5.js → chunk-JBL6SCNN.js} +3 -3
- package/dist/{chunk-DBP3N6E5.js.map → chunk-JBL6SCNN.js.map} +1 -1
- package/dist/{chunk-7KN5OQVN.js → chunk-JNQBPRAA.js} +2 -2
- package/dist/{chunk-7KN5OQVN.js.map → chunk-JNQBPRAA.js.map} +1 -1
- package/dist/{chunk-CPTQABDQ.js → chunk-JNSPYECP.js} +2 -2
- package/dist/{chunk-CPTQABDQ.js.map → chunk-JNSPYECP.js.map} +1 -1
- package/dist/{chunk-E7Q6UNCB.js → chunk-KBDYXGYT.js} +2 -2
- package/dist/{chunk-E7Q6UNCB.js.map → chunk-KBDYXGYT.js.map} +1 -1
- package/dist/{chunk-WVQDIOD7.js → chunk-KKMZP3YL.js} +2 -2
- package/dist/{chunk-WVQDIOD7.js.map → chunk-KKMZP3YL.js.map} +1 -1
- package/dist/{chunk-WSPXSWFG.js → chunk-KZEHTRPC.js} +3 -3
- package/dist/chunk-KZEHTRPC.js.map +1 -0
- package/dist/{chunk-KACJOE2N.js → chunk-LH5V6XGH.js} +2 -2
- package/dist/{chunk-KACJOE2N.js.map → chunk-LH5V6XGH.js.map} +1 -1
- package/dist/{chunk-VBXKYT4O.js → chunk-LH7YRRY7.js} +2 -2
- package/dist/{chunk-VBXKYT4O.js.map → chunk-LH7YRRY7.js.map} +1 -1
- package/dist/{chunk-QXXLDY6I.js → chunk-LI7AQ5NQ.js} +4 -4
- package/dist/{chunk-QXXLDY6I.js.map → chunk-LI7AQ5NQ.js.map} +1 -1
- package/dist/{chunk-CAB5IWV7.js → chunk-LSFPZR52.js} +4 -4
- package/dist/{chunk-CAB5IWV7.js.map → chunk-LSFPZR52.js.map} +1 -1
- package/dist/{chunk-CRHKWHTA.js → chunk-LUWZ7UZQ.js} +4 -4
- package/dist/{chunk-CRHKWHTA.js.map → chunk-LUWZ7UZQ.js.map} +1 -1
- package/dist/{chunk-CMG4OZPV.js → chunk-LWWIBUDK.js} +2 -2
- package/dist/{chunk-CMG4OZPV.js.map → chunk-LWWIBUDK.js.map} +1 -1
- package/dist/{chunk-LOW7J7SE.js → chunk-MHF2NK7F.js} +4 -4
- package/dist/{chunk-LOW7J7SE.js.map → chunk-MHF2NK7F.js.map} +1 -1
- package/dist/{chunk-JHUEYWWI.js → chunk-MPM6YBOM.js} +2 -2
- package/dist/{chunk-JHUEYWWI.js.map → chunk-MPM6YBOM.js.map} +1 -1
- package/dist/{chunk-3UEMBHBK.js → chunk-MPT6Y7Z2.js} +2 -2
- package/dist/{chunk-3UEMBHBK.js.map → chunk-MPT6Y7Z2.js.map} +1 -1
- package/dist/{chunk-OZKBIPXU.js → chunk-NO2XO7S6.js} +3 -3
- package/dist/{chunk-OZKBIPXU.js.map → chunk-NO2XO7S6.js.map} +1 -1
- package/dist/{chunk-FQETQ7CM.js → chunk-NSNQWDJ4.js} +2 -2
- package/dist/{chunk-FQETQ7CM.js.map → chunk-NSNQWDJ4.js.map} +1 -1
- package/dist/{chunk-UOBC36FL.js → chunk-OW2ODKHN.js} +2 -2
- package/dist/{chunk-UOBC36FL.js.map → chunk-OW2ODKHN.js.map} +1 -1
- package/dist/{chunk-PVKAIVKE.js → chunk-P427MACE.js} +63 -74
- package/dist/chunk-P427MACE.js.map +1 -0
- package/dist/{chunk-LET362AM.js → chunk-PBXTHYB4.js} +2 -2
- package/dist/chunk-PBXTHYB4.js.map +1 -0
- package/dist/{chunk-C4FBYP2D.js → chunk-PIYFVFPL.js} +9 -3
- package/dist/chunk-PIYFVFPL.js.map +1 -0
- package/dist/{chunk-FR5G77K5.js → chunk-PJKH2GZ3.js} +2 -2
- package/dist/{chunk-FR5G77K5.js.map → chunk-PJKH2GZ3.js.map} +1 -1
- package/dist/{chunk-FNJA4S6J.js → chunk-QNA27ABY.js} +3 -3
- package/dist/{chunk-FNJA4S6J.js.map → chunk-QNA27ABY.js.map} +1 -1
- package/dist/{chunk-RHMY45DK.js → chunk-QNB5DKKP.js} +5 -5
- package/dist/{chunk-RHMY45DK.js.map → chunk-QNB5DKKP.js.map} +1 -1
- package/dist/{chunk-XO5IOPM5.js → chunk-QWAAR5JX.js} +8 -8
- package/dist/{chunk-XO5IOPM5.js.map → chunk-QWAAR5JX.js.map} +1 -1
- package/dist/{chunk-6BXPN5SC.js → chunk-RO3TSZ5W.js} +3 -3
- package/dist/{chunk-6BXPN5SC.js.map → chunk-RO3TSZ5W.js.map} +1 -1
- package/dist/{chunk-4IXG6XCT.js → chunk-RUCUU7Z7.js} +2 -2
- package/dist/{chunk-4IXG6XCT.js.map → chunk-RUCUU7Z7.js.map} +1 -1
- package/dist/{chunk-QSJAIXLM.js → chunk-SDQZYSCA.js} +3 -3
- package/dist/{chunk-QSJAIXLM.js.map → chunk-SDQZYSCA.js.map} +1 -1
- package/dist/{chunk-3XSY5LAB.js → chunk-SXZTDJMG.js} +4 -4
- package/dist/{chunk-3XSY5LAB.js.map → chunk-SXZTDJMG.js.map} +1 -1
- package/dist/{chunk-LJV2FNOC.js → chunk-T7M5FKCE.js} +3 -3
- package/dist/{chunk-LJV2FNOC.js.map → chunk-T7M5FKCE.js.map} +1 -1
- package/dist/{chunk-KS7EXW4P.js → chunk-TIRBSPP2.js} +2 -2
- package/dist/{chunk-KS7EXW4P.js.map → chunk-TIRBSPP2.js.map} +1 -1
- package/dist/{chunk-2GEGIPDR.js → chunk-U5SQOZNK.js} +4 -4
- package/dist/{chunk-2GEGIPDR.js.map → chunk-U5SQOZNK.js.map} +1 -1
- package/dist/{chunk-Y4VR6VNM.js → chunk-UPOS666Q.js} +2 -2
- package/dist/{chunk-Y4VR6VNM.js.map → chunk-UPOS666Q.js.map} +1 -1
- package/dist/{chunk-YE6KCAIN.js → chunk-USSGJ3MD.js} +2 -2
- package/dist/{chunk-YE6KCAIN.js.map → chunk-USSGJ3MD.js.map} +1 -1
- package/dist/{chunk-4UWLHKNU.js → chunk-UWLJ7UEK.js} +3 -3
- package/dist/{chunk-4UWLHKNU.js.map → chunk-UWLJ7UEK.js.map} +1 -1
- package/dist/{chunk-SNUDT6AX.js → chunk-VHAYQGWR.js} +2 -2
- package/dist/{chunk-SNUDT6AX.js.map → chunk-VHAYQGWR.js.map} +1 -1
- package/dist/{chunk-DV6GE57V.js → chunk-VWGRAE2Q.js} +2 -2
- package/dist/chunk-VWGRAE2Q.js.map +1 -0
- package/dist/{chunk-4L5ZIKDZ.js → chunk-W7J3MQNV.js} +2 -2
- package/dist/{chunk-4L5ZIKDZ.js.map → chunk-W7J3MQNV.js.map} +1 -1
- package/dist/{chunk-MVWR5WRX.js → chunk-WWDDKUDW.js} +3 -3
- package/dist/{chunk-MVWR5WRX.js.map → chunk-WWDDKUDW.js.map} +1 -1
- package/dist/{chunk-4CYCJ3NY.js → chunk-XNSYDA6G.js} +10 -10
- package/dist/{chunk-4CYCJ3NY.js.map → chunk-XNSYDA6G.js.map} +1 -1
- package/dist/{chunk-WEQNPYVA.js → chunk-XXKRHKFH.js} +2 -2
- package/dist/{chunk-WEQNPYVA.js.map → chunk-XXKRHKFH.js.map} +1 -1
- package/dist/{chunk-OQFWF7Q7.js → chunk-XZ253TGP.js} +3 -3
- package/dist/{chunk-OQFWF7Q7.js.map → chunk-XZ253TGP.js.map} +1 -1
- package/dist/{chunk-3TBMGGTA.js → chunk-Y672Z7QY.js} +2 -2
- package/dist/{chunk-3TBMGGTA.js.map → chunk-Y672Z7QY.js.map} +1 -1
- package/dist/chunk-YM7VF5SY.js +22 -0
- package/dist/chunk-YM7VF5SY.js.map +1 -0
- package/dist/{chunk-S7QB5KMM.js → chunk-YRQ4KKLG.js} +29 -56
- package/dist/chunk-YRQ4KKLG.js.map +1 -0
- package/dist/{chunk-MMOQR426.js → chunk-YS3H6DEQ.js} +2 -2
- package/dist/{chunk-MMOQR426.js.map → chunk-YS3H6DEQ.js.map} +1 -1
- package/dist/{chunk-QR7MGGOM.js → chunk-YVGHWCMY.js} +3 -3
- package/dist/{chunk-QR7MGGOM.js.map → chunk-YVGHWCMY.js.map} +1 -1
- package/dist/{chunk-IPYQYLSX.js → chunk-ZDI5I2HT.js} +6 -6
- package/dist/{chunk-IPYQYLSX.js.map → chunk-ZDI5I2HT.js.map} +1 -1
- package/dist/{chunk-JAC6AVZN.js → chunk-ZIZXXYXM.js} +3 -3
- package/dist/{chunk-JAC6AVZN.js.map → chunk-ZIZXXYXM.js.map} +1 -1
- package/dist/collapsible-panel.d.ts +5 -5
- package/dist/collapsible-panel.js +4 -4
- package/dist/collapsible-panel.js.map +1 -1
- package/dist/color-field.js +2 -2
- package/dist/color-picker.js +1 -1
- package/dist/color-swatches.js +1 -1
- package/dist/column-explorer.d.ts +2 -2
- package/dist/column-explorer.js +166 -21
- package/dist/column-explorer.js.map +1 -1
- package/dist/column-track.d.ts +1 -1
- package/dist/column-track.js +1 -1
- package/dist/combobox.d.ts +8 -4
- package/dist/combobox.js +1 -1
- package/dist/compose-B_GFfFhm.d.ts +36 -0
- package/dist/content-item.d.ts +1 -1
- package/dist/content-item.js +1 -1
- package/dist/content-swap.d.ts +3 -3
- package/dist/content-swap.js +1 -1
- package/dist/corner-status.d.ts +3 -3
- package/dist/corner-status.js +1 -1
- package/dist/device-class.js +101 -1
- package/dist/device-class.js.map +1 -1
- package/dist/disclosure-arrow.d.ts +3 -3
- package/dist/disclosure-arrow.js +1 -1
- package/dist/disclosure.d.ts +14 -2
- package/dist/disclosure.js +13 -4
- package/dist/disclosure.js.map +1 -1
- package/dist/edge-activity-indicator.d.ts +3 -3
- package/dist/edge-activity-indicator.js +1 -1
- package/dist/empty-state.d.ts +3 -3
- package/dist/empty-state.js +1 -1
- package/dist/{extension-attributes-IJ4decoa.d.ts → extension-attributes-CnqvBmj3.d.ts} +1 -1
- package/dist/file-picker.d.ts +3 -3
- package/dist/file-picker.js +1 -1
- package/dist/floating-toolbar.d.ts +3 -3
- package/dist/floating-toolbar.js +1 -1
- package/dist/form.d.ts +3 -3
- package/dist/form.js +1 -1
- package/dist/framed-list.js +1 -1
- package/dist/gauge.js +1 -1
- package/dist/grid.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +66 -66
- package/dist/list-action-row.js +1 -1
- package/dist/list-detail-dialog.d.ts +3 -3
- package/dist/list-detail-dialog.js +7 -7
- package/dist/list-detail-dialog.js.map +1 -1
- package/dist/list-header.d.ts +1 -1
- package/dist/list-header.js +1 -1
- package/dist/list-inset-control.d.ts +3 -3
- package/dist/list-inset-control.js +1 -1
- package/dist/list-inset-text.js +1 -1
- package/dist/list-item.js +1 -1
- package/dist/list.d.ts +1 -1
- package/dist/list.js +1 -1
- package/dist/loading-spinner.d.ts +3 -3
- package/dist/loading-spinner.js +1 -1
- package/dist/lucide-icon.d.ts +3 -3
- package/dist/lucide-icon.js +1 -1
- package/dist/message-composer.js +1 -1
- package/dist/{nav-stack-DKrvqFjA.d.ts → nav-stack-IKSMxo2A.d.ts} +3 -3
- package/dist/nav-stack.d.ts +2 -2
- package/dist/nav-stack.js +1 -1
- package/dist/paged-view.d.ts +3 -3
- package/dist/paged-view.js +1 -1
- package/dist/paged-view.js.map +1 -1
- package/dist/pane.js +1 -1
- package/dist/popup-menu-register.js +7 -1
- package/dist/popup-menu-register.js.map +1 -1
- package/dist/popup-menu.d.ts +3 -20
- package/dist/popup-menu.js +1 -1
- package/dist/progress-bar.js +1 -1
- package/dist/progress-ring.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/resizable-region.d.ts +3 -3
- package/dist/resizable-region.js +1 -1
- package/dist/row.d.ts +1 -1
- package/dist/row.js +1 -1
- package/dist/scroll-effect.d.ts +1 -1
- package/dist/scroll-effect.js +1 -1
- package/dist/{search-field-7wLt3Bd5.d.ts → search-field-BA48RaJY.d.ts} +3 -3
- package/dist/search-field-model.d.ts +2 -2
- package/dist/search-field.d.ts +2 -2
- package/dist/search-field.js +1 -1
- package/dist/segmented-control.d.ts +3 -3
- package/dist/segmented-control.js +1 -1
- package/dist/select-register.js +3 -2
- package/dist/select-register.js.map +1 -1
- package/dist/select.d.ts +3 -13
- package/dist/select.js +1 -1
- package/dist/sized-region.d.ts +3 -3
- package/dist/sized-region.js +1 -1
- package/dist/skeleton.d.ts +3 -3
- package/dist/skeleton.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/spacer.d.ts +3 -3
- package/dist/spacer.js +1 -1
- package/dist/split-button.js +1 -1
- package/dist/split-view.d.ts +4 -4
- package/dist/split-view.js +1 -1
- package/dist/state-banner.js +1 -1
- package/dist/styles/components/actions/popup-menu/popup-menu.css +12 -125
- package/dist/styles/components/actions/toolbar/toolbar.css +0 -7
- package/dist/styles/components/data-display/value-table/value-table.css +3 -1
- package/dist/styles/components/forms/select/select.css +0 -60
- package/dist/styles/components/forms/switch/switch.css +9 -0
- package/dist/styles/components/forms/text-field/text-field.css +1 -1
- package/dist/styles/components/surfaces/disclosure/disclosure.css +24 -4
- package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +1 -1
- package/dist/styles/disclosure.css +24 -4
- package/dist/styles/popup-menu.css +12 -125
- package/dist/styles/select.css +0 -60
- package/dist/styles/surface-scaffold.css +1 -1
- package/dist/styles/switch.css +9 -0
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/toolbar.css +0 -7
- package/dist/styles/value-table.css +3 -1
- package/dist/styles/webawesome.css +7 -0
- package/dist/summary-row.js +1 -1
- package/dist/sunken-panel.d.ts +3 -3
- package/dist/sunken-panel.js +1 -1
- package/dist/surface-scaffold.d.ts +9 -5
- package/dist/surface-scaffold.js +1 -1
- package/dist/switch.d.ts +3 -1
- package/dist/switch.js +1 -1
- package/dist/tab-bar-item.js +1 -1
- package/dist/tab-bar.d.ts +3 -3
- package/dist/tab-bar.js +1 -1
- package/dist/tab-navigator.d.ts +3 -3
- package/dist/tab-navigator.js +2 -2
- package/dist/tab-navigator.js.map +1 -1
- package/dist/tab-panel.d.ts +3 -3
- package/dist/tab-panel.js +1 -1
- package/dist/tag-field.d.ts +3 -3
- package/dist/tag-field.js +1 -1
- package/dist/text-field.d.ts +2 -2
- package/dist/text-field.js +1 -1
- package/dist/text.d.ts +1 -1
- package/dist/text.js +1 -1
- package/dist/toolbar-control-group.d.ts +7 -7
- package/dist/toolbar-control-group.js +1 -1
- package/dist/toolbar-text.d.ts +3 -3
- package/dist/toolbar-text.js +1 -1
- package/dist/toolbar.d.ts +3 -3
- package/dist/toolbar.js +1 -1
- package/dist/tree-list.d.ts +3 -3
- package/dist/tree-list.js +151 -3
- package/dist/tree-list.js.map +1 -1
- package/dist/{tree-rows-Bms5QJvG.d.ts → tree-rows-BXChApji.d.ts} +1 -1
- package/dist/{types-DmHWkSd6.d.ts → types-CuKf5G87.d.ts} +6 -2
- package/dist/value-preview.d.ts +3 -3
- package/dist/value-preview.js +1 -1
- package/dist/value-table.d.ts +5 -5
- package/dist/value-table.js +1 -1
- package/dist/wire-catalog.d.ts +5 -5
- package/dist/wire-catalog.js +13 -4
- package/dist/wire-catalog.js.map +1 -1
- package/dist/wire-color-fields.js +73 -2
- package/dist/wire-color-fields.js.map +1 -1
- package/dist/wire-color-pickers.js +1 -1
- package/dist/wire-column-explorer.js +92 -1
- package/dist/wire-column-explorer.js.map +1 -1
- package/dist/wire-content-items.js +204 -1
- package/dist/wire-content-items.js.map +1 -1
- package/dist/wire-nav-stack.js +423 -1
- package/dist/wire-nav-stack.js.map +1 -1
- package/dist/wire-resizable-regions.js +1 -1
- package/dist/wire-search-fields.d.ts +2 -2
- package/dist/wire-search-fields.js +1 -1
- package/dist/wire-sidebar.js +228 -1
- package/dist/wire-sidebar.js.map +1 -1
- package/dist/wire-sliders.js +29 -1
- package/dist/wire-sliders.js.map +1 -1
- package/dist/wire-tab-bars.d.ts +1 -1
- package/dist/wire-tab-navigator.js +150 -1
- package/dist/wire-tab-navigator.js.map +1 -1
- package/dist/wire-tag-fields.js +252 -2
- package/dist/wire-tag-fields.js.map +1 -1
- package/dist/wire-tree-list.js +186 -1
- package/dist/wire-tree-list.js.map +1 -1
- package/dist/wire-workbench.js +1 -1
- package/dist/workbench-dialog.d.ts +3 -3
- package/dist/workbench-dialog.js +5 -5
- package/dist/workbench-dialog.js.map +1 -1
- package/dist/workbench.d.ts +4 -4
- package/dist/workbench.js +1 -1
- package/docs/accessibility.md +1 -1
- package/docs/catalog.md +59 -0
- package/docs/component-contract.md +4 -3
- package/docs/component-selection.md +7 -2
- package/docs/disclosure.md +22 -0
- package/docs/examples/composed-catalog.tsx +113 -0
- package/docs/examples/scoped-combobox.ts +99 -0
- package/docs/examples/typed-action-table.tsx +34 -0
- package/docs/forms-and-validation.md +2 -0
- package/docs/investigations/combobox-seed-ownership.md +49 -0
- package/docs/investigations/measure-scoped-combobox.mjs +87 -0
- package/docs/investigations/scoped-combobox.md +98 -0
- package/docs/list-detail-dialog.md +2 -3
- package/docs/scroll-effect.md +2 -2
- package/docs/surface-scaffold.md +5 -6
- package/docs/switch.md +21 -0
- package/docs/ui-doctor.md +16 -0
- package/docs/workbench-dialog.md +2 -3
- package/doctor/cli.mjs +38 -25
- package/doctor/explain-use.mjs +320 -0
- package/llms.txt +3 -44
- package/package.json +6 -33
- package/ux-demo/recipes/app-shell.tsx +141 -48
- package/ux-demo/recipes/collapsible-sidebar.tsx +169 -43
- package/ux-demo/recipes/compact-toolbar.tsx +114 -22
- package/ux-demo/recipes/composer-form.tsx +104 -14
- package/ux-demo/recipes/list-detail-dialog.tsx +84 -38
- package/ux-demo/recipes/list-workspace-states.tsx +152 -29
- package/ux-demo/recipes/loading-inspector.tsx +174 -30
- package/ux-demo/recipes/media-detail.tsx +146 -29
- package/ux-demo/recipes/navigation-sidebar.tsx +113 -24
- package/ux-demo/recipes/navigation-stack.tsx +43 -7
- package/ux-demo/recipes/workspace-header.tsx +66 -2
- package/ai/component-props-overlay.json +0 -8910
- package/ai/component-props-overlay.schema.json +0 -82
- package/ai/component-props.json +0 -34289
- package/ai/component-props.schema.json +0 -408
- package/ai/view-document.schema.json +0 -467
- package/dist/browser/editor.js +0 -50
- package/dist/chunk-3K5V3ZSD.js +0 -77
- package/dist/chunk-3K5V3ZSD.js.map +0 -1
- package/dist/chunk-63TJH2RF.js +0 -231
- package/dist/chunk-63TJH2RF.js.map +0 -1
- package/dist/chunk-6V6UHPJD.js +0 -153
- package/dist/chunk-6V6UHPJD.js.map +0 -1
- package/dist/chunk-76BLSFEA.js.map +0 -1
- package/dist/chunk-C4FBYP2D.js.map +0 -1
- package/dist/chunk-COQI4OMZ.js.map +0 -1
- package/dist/chunk-CUUW57WB.js.map +0 -1
- package/dist/chunk-D2KHQNJ6.js +0 -155
- package/dist/chunk-D2KHQNJ6.js.map +0 -1
- package/dist/chunk-DV6GE57V.js.map +0 -1
- package/dist/chunk-FCO7BT4P.js +0 -256
- package/dist/chunk-FCO7BT4P.js.map +0 -1
- package/dist/chunk-GHV36C6I.js +0 -94
- package/dist/chunk-GHV36C6I.js.map +0 -1
- package/dist/chunk-HPOXLOVC.js +0 -184
- package/dist/chunk-HPOXLOVC.js.map +0 -1
- package/dist/chunk-I2K4OQKB.js +0 -426
- package/dist/chunk-I2K4OQKB.js.map +0 -1
- package/dist/chunk-LET362AM.js.map +0 -1
- package/dist/chunk-PVKAIVKE.js.map +0 -1
- package/dist/chunk-RGB4DPMN.js.map +0 -1
- package/dist/chunk-S7QB5KMM.js.map +0 -1
- package/dist/chunk-SGYBIKQA.js.map +0 -1
- package/dist/chunk-TXBNPEIJ.js +0 -31
- package/dist/chunk-TXBNPEIJ.js.map +0 -1
- package/dist/chunk-UU37OR3D.js.map +0 -1
- package/dist/chunk-WCMGPAY2.js +0 -103
- package/dist/chunk-WCMGPAY2.js.map +0 -1
- package/dist/chunk-WSPXSWFG.js.map +0 -1
- package/dist/chunk-X43QQWVC.js +0 -208
- package/dist/chunk-X43QQWVC.js.map +0 -1
- package/dist/chunk-YA6OAJY6.js +0 -155
- package/dist/chunk-YA6OAJY6.js.map +0 -1
- package/dist/editor.d.ts +0 -447
- package/dist/editor.js +0 -15608
- package/dist/editor.js.map +0 -1
- package/dist/styles/editor/editor.css +0 -585
- package/dist/styles/editor.css +0 -4
- package/dist/view-runtime.d.ts +0 -9
- package/dist/view-runtime.js +0 -8
- package/dist/view-runtime.js.map +0 -1
- package/docs/editor-host.md +0 -397
- package/docs/view.md +0 -314
- package/props/cli.d.mts +0 -1
- package/props/cli.mjs +0 -142
- package/props/component-props.d.mts +0 -180
- package/props/component-props.mjs +0 -1208
- package/view/catalog.mjs +0 -229
- package/view/child-kind.mjs +0 -22
- package/view/cli.d.mts +0 -18
- package/view/cli.mjs +0 -316
- package/view/contract.mjs +0 -418
- package/view/css-grammar.mjs +0 -93
- package/view/generate.d.mts +0 -16
- package/view/generate.mjs +0 -739
- package/view/index.d.mts +0 -491
- package/view/index.mjs +0 -36
- package/view/interpret.mjs +0 -339
- package/view/project-types-worker.mjs +0 -55
- package/view/project-types.d.mts +0 -43
- package/view/project-types.mjs +0 -618
- package/view/type-expression.d.mts +0 -15
- package/view/type-expression.mjs +0 -162
- package/view/types.mjs +0 -165
- package/view/validate-move.mjs +0 -353
- package/view/validate.mjs +0 -1649
- package/vite-editor.d.mts +0 -173
- package/vite-editor.mjs +0 -548
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/surfaces/content-item/content-item.tsx"],"names":[],"mappings":";;;;;AAwEA,SAAS,cAAc,KAAA,EAAsC;AAC3D,EAAA,IAAI,KAAA,KAAU,QAAQ,OAAO,CAAA;AAC7B,EAAA,IAAI,KAAA,KAAU,UAAU,OAAO,IAAA;AAC/B,EAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,IAAK,KAAA,GAAQ,KAAK,KAAA,GAAQ,CAAA;AAClD,IAAA,MAAM,IAAI,WAAW,iDAAiD,CAAA;AACxE,EAAA,OAAO,KAAA;AACT;AAEA,IAAM,cAAA,uBAAqB,GAAA,CAA2B;AAAA,EACpD,QAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAC,C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d,OAAO,KAAA,CAAM,KAAA;AAAA,gBACb,KAAK,KAAA,CAAM,GAAA;AAAA,gBACX,WAAA,EAAa,KAAA,CAAM,WAAA,IAAe,EAAA,GAAK,CAAA;AAAA,gBACvC,UAAU,KAAA,CAAM,QAAA;AAAA,gBAChB,QAAA,EAAU,MAAM,QAAA,IAAY,QAAA;AAAA,gBAC5B,IAAA,EACE,MAAM,IAAA,KACL,KAAA,CAAM,aAAa,EAAE,UAAA,EAAY,KAAA,CAAM,UAAA,EAAW,GAAI,MAAA,CAAA;AAAA,gBAEzD,gBAAgB,KAAA,CAAM,cAAA;AAAA,gBACtB,QAAQ,KAAA,CAAM,MAAA;AAAA,gBACd,SAAS,KAAA,CAAM,OAAA;AAAA,gBACf,OAAO,KAAA,CAAM,KAAA;AAAA,gBACb,OAAA,EAAQ,MAAA;AAAA,gBACR,WAAA,EAAa;AAAA;AAAA;AACf;AAAA,SACF,GACE,IAAA;AAAA,QACH,KAAA,mBACC,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAM,wBAAA;AAAA,YACN,MACG,WAAA,IAAe,aAAA,KAAkB,cACjC,CAAC,WAAA,IAAe,UACb,UAAA,GACA,MAAA;AAAA,YAGL;AAAA;AAAA,SACH,GACG,WAAA,IAAe,aAAA,KAAkB,UAAA,IACnC,CAAC,WAAA,IAAe,OAAA,mBACjB,GAAA,CAAC,KAAA,EAAA,EAAI,IAAA,EAAK,UAAA,EAAY,QAAA,EAAS,CAAA,GAE/B;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-DBP3N6E5.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport { filterDataAttributes } from '../../../shared/dom/extension-attributes.js';\nimport type { CssColor } from '../../../shared/styles/css-values.js';\nimport type { SemanticTone } from '../../../shared/styles/semantic-tone.js';\nimport {\n type SurfaceTint,\n surfaceTintAttributes,\n type SurfaceTintScheme,\n} from '../../../shared/styles/surface-tint.js';\nimport {\n BackdropImage,\n type BackdropImageBlur,\n type BackdropImageParallax,\n type BackdropImagePosition,\n type BackdropImageScrim,\n} from '../backdrop-image/backdrop-image.js';\n\nexport type { SemanticTone } from '../../../shared/styles/semantic-tone.js';\n\n/**\n * Base surface treatment, semantic status colors, or `brand-loud`: the solid\n * brand fill with its on-loud foreground (a transcript's own messages).\n */\nexport type ContentItemAppearance =\n 'transparent' | 'surface' | 'brand-loud' | SemanticTone;\n\n/**\n * A chat-bubble layout for transcripts: the item fits its content up to 80%\n * of the row and sits at the `start` (other participants) or `end` (the\n * person's own messages) of the line.\n */\nexport type ContentItemBubble = 'start' | 'end';\n\n/** Whether the item's always-reserved 1px border is transparent or visible. */\nexport type ContentItemFrame = 'none' | 'framed';\n\n/** Corner shape: the 12px rounded rectangle or the 22px pill. */\nexport type ContentItemShape = 'rounded' | 'pill';\n/** `single` uses an option; `multiple` uses a grid row; `toggle` uses a pressed button. */\nexport type ContentItemSelectionMode =\n 'none' | 'single' | 'multiple' | 'toggle';\n\n/** One card-owned lead image in the containing feed's shared scrollport. */\nexport interface ContentItemMedia {\n src: string;\n alt: string;\n srcset?: string;\n sizes?: string;\n /** Width divided by height; reserves the image block before it loads. Default 16/9. */\n aspectRatio?: number;\n position?: BackdropImagePosition;\n /** Default subtle (35% lag); set none for a static lead image. */\n parallax?: BackdropImageParallax;\n /** App-supplied soft copy; its opacity changes, never its blur filter. */\n blurredSrc?: string;\n /** Shared BackdropImage blur behavior; use instead of `blurredSrc`. */\n blur?: BackdropImageBlur;\n /**\n * Skip offscreen media painting in long feeds while retaining card geometry.\n * A large scroll jump paints newly visible heroes blank for a frame.\n */\n deferOffscreen?: boolean;\n /** Color the image dissolves into and the card body continues on. */\n fadeTo?: CssColor;\n /** Content layered over the image, including native controls. */\n overlay?: KerfUiContent;\n /** Dim the image behind overlay content. */\n scrim?: BackdropImageScrim;\n /** Extend the image to the card's top, left, and right inner edges. */\n edgeToEdge?: boolean;\n}\n\nfunction mediaParallax(value: BackdropImageParallax): number {\n if (value === 'none') return 0;\n if (value === 'subtle') return 0.35;\n if (!Number.isFinite(value) || value < 0 || value > 1)\n throw new RangeError('ContentItem media.parallax must be from 0 to 1.');\n return value;\n}\n\nconst mediaPositions = new Set<BackdropImagePosition>([\n 'center',\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'top left',\n 'top right',\n 'bottom left',\n 'bottom right',\n]);\n\nfunction roleForSelectionMode(\n mode: ContentItemSelectionMode,\n): 'option' | 'row' | 'button' {\n switch (mode) {\n case 'single':\n return 'option';\n case 'multiple':\n return 'row';\n case 'none':\n case 'toggle':\n return 'button';\n }\n}\n\nconst contentItemProtectedAttributes = new Set([\n 'data-component',\n 'data-appearance',\n 'data-outlined',\n 'data-bubble',\n 'data-grid-row',\n 'data-media-state',\n 'data-media-edge',\n 'data-media-fade',\n 'data-kui-tint',\n 'data-kui-tint-accent',\n]);\nconst interactiveProtectedAttributes = new Set([\n 'data-component',\n 'data-appearance',\n 'data-outlined',\n 'data-bubble',\n 'data-grid-row',\n 'data-media-state',\n 'data-media-edge',\n 'data-media-fade',\n 'data-kui-tint',\n 'data-kui-tint-accent',\n 'data-action',\n 'data-item-id',\n 'data-interactive',\n 'data-selected',\n 'data-disabled',\n 'data-selection-mode',\n 'data-kui-pressed',\n]);\n\ntype ContentItemRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-appearance'?: never;\n 'data-outlined'?: never;\n 'data-bubble'?: never;\n 'data-grid-row'?: never;\n 'data-media-state'?: never;\n 'data-media-edge'?: never;\n 'data-media-fade'?: never;\n 'data-kui-tint'?: never;\n 'data-kui-tint-accent'?: never;\n }\n>;\n\ntype ContentItemInteractiveRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-appearance'?: never;\n 'data-outlined'?: never;\n 'data-bubble'?: never;\n 'data-grid-row'?: never;\n 'data-media-state'?: never;\n 'data-media-edge'?: never;\n 'data-media-fade'?: never;\n 'data-kui-tint'?: never;\n 'data-kui-tint-accent'?: never;\n 'data-action'?: never;\n 'data-item-id'?: never;\n 'data-interactive'?: never;\n 'data-selected'?: never;\n 'data-disabled'?: never;\n 'data-selection-mode'?: never;\n 'data-kui-pressed'?: never;\n }\n>;\n\ninterface ContentItemBaseProps {\n /**\n * Coordinated background, border, and foreground colors. `transparent`\n * preserves the surrounding surface; `surface` paints the base surface;\n * semantic values match StateBanner. Defaults to `transparent`.\n */\n appearance?: ContentItemAppearance;\n /** Reserved lead image with a per-image scroll timeline. Wire the containing root with `wireContentItems`. */\n media?: ContentItemMedia;\n /** App-sampled image color, scoped to this card once its image loads. */\n tint?: SurfaceTint;\n /**\n * Scope this surface and its subtree to the light or dark palette, whatever\n * the page's scheme (a light card on a dark page). A `tint` already sets\n * its scheme; pass `scheme` alone for the plain palette, or with a tint\n * only when they agree.\n */\n scheme?: SurfaceTintScheme;\n /** Item content; a plain string is allowed for bare copy. */\n children?: KerfUiContent | string;\n /**\n * `framed` paints the standard neutral border in the 1px the item always\n * reserves, so framing never changes geometry. Frame only an item that\n * marks a real distinction. Defaults to `none` (transparent border).\n */\n frame?: ContentItemFrame;\n /** Remove block padding and block borders while retaining inline geometry. */\n flush?: boolean;\n /** Corner shape. Defaults to `rounded`. */\n shape?: ContentItemShape;\n /**\n * Lay the item out as a chat bubble: content width up to 80% of the row,\n * at the `start` or `end` of the line. Pair `end` with `brand-loud` for the\n * person's own messages. Omit for an ordinary full-width item.\n */\n bubble?: ContentItemBubble;\n /** Native hover tooltip. */\n title?: string;\n /**\n * Names the item as a distinct region (`role=\"region\"`). Omit it for an\n * ordinary item, which stays a non-landmark grouping.\n */\n ariaLabel?: string;\n /**\n * Makes the item a programmatic focus target (`tabindex=\"-1\"`, never a tab\n * stop), for example the preferred initial focus of a NavStack view when\n * combined with `data-nav-focus` in `rootAttributes`.\n */\n focusTarget?: boolean;\n /** Keep the standard focus outline visible, such as for a drop target. */\n outlined?: boolean;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\nexport type ContentItemProps = ContentItemBaseProps &\n (\n | {\n interactive?: false;\n action?: never;\n itemId?: never;\n selectionMode?: never;\n selected?: never;\n disabled?: never;\n /** Opt into keyboard (`0`) or programmatic (`-1`) focus. */\n tabIndex?: 0 | -1;\n /**\n * A non-selectable row of a multi-select `List` or `Grid`: renders\n * `role=\"row\"` around a `gridcell`, with no `aria-selected` and no\n * Tab stop of its own, for content between selectable rows (an\n * activity group, a \"messages skipped\" divider). Its controls stay\n * reachable by Tab; arrow keys skip it.\n */\n gridRow?: boolean;\n /** Existing static `data-*` metadata remains available. */\n rootAttributes?: ContentItemRootAttributes;\n }\n | {\n /** Enable a keyboard reachable card; wire `wireContentItems` once on its containing root. */\n interactive: true;\n /** Delegated action dispatched by pointer, Enter, or Space. */\n action: string;\n itemId?: string;\n selectionMode?: ContentItemSelectionMode;\n selected?: boolean;\n disabled?: boolean;\n tabIndex?: never;\n /** An interactive item is already a row in a multi-select grid. */\n gridRow?: never;\n /** Safe app metadata; interaction attributes are component-owned. */\n rootAttributes?: ContentItemInteractiveRootAttributes;\n }\n );\n\n/**\n * One self-contained `.kui-content` child: an 8px inline margin, a real 1px\n * border (transparent unless `framed`), 8px padding, and a rounded or pill\n * radius. It owns that whole geometry, so wrappers must not add more.\n */\nexport function ContentItem({\n appearance = 'transparent',\n media,\n tint,\n scheme,\n children,\n frame = 'none',\n flush = false,\n shape = 'rounded',\n bubble,\n title,\n ariaLabel,\n focusTarget = false,\n outlined = false,\n tabIndex,\n gridRow = false,\n interactive = false,\n action,\n itemId,\n selectionMode = 'none',\n selected = false,\n disabled = false,\n className = '',\n rootAttributes = {},\n slot,\n}: ContentItemProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n interactive\n ? interactiveProtectedAttributes\n : contentItemProtectedAttributes,\n );\n if (interactive && !action) {\n throw new Error('Interactive ContentItem requires an action');\n }\n if (interactive && selected && selectionMode === 'none') {\n throw new Error('Selected ContentItem requires a selectionMode');\n }\n if (\n media?.aspectRatio !== undefined &&\n (!Number.isFinite(media.aspectRatio) || media.aspectRatio <= 0)\n )\n throw new RangeError('ContentItem media.aspectRatio must be positive.');\n if (media?.position !== undefined && !mediaPositions.has(media.position))\n throw new TypeError(\n 'ContentItem media.position must be a supported position.',\n );\n if (media?.blur !== undefined && media.blurredSrc !== undefined)\n throw new TypeError(\n 'ContentItem media.blur and blurredSrc cannot be combined.',\n );\n if (media) mediaParallax(media.parallax ?? 'subtle');\n const tinted = surfaceTintAttributes(media ? tint : undefined, scheme);\n const fadeStyle =\n media?.fadeTo === undefined\n ? undefined\n : `--_kui-content-item-media-fade-to:${media.fadeTo}`;\n const cls = [\n 'kui-content-item',\n shape === 'pill' ? 'kui-content-item--pill' : '',\n frame === 'framed' ? 'kui-content-item--framed' : '',\n flush ? 'kui-content-item--flush' : '',\n tinted.className,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n const interactiveAttributes = interactive\n ? {\n 'data-interactive': 'true',\n 'data-action': disabled ? undefined : action,\n 'data-item-id': itemId,\n 'data-selection-mode': selectionMode,\n 'data-selected':\n selectionMode === 'none' ? undefined : String(selected),\n 'data-disabled': disabled ? 'true' : undefined,\n }\n : {};\n let role: 'option' | 'row' | 'button' | 'region' | undefined = ariaLabel\n ? 'region'\n : undefined;\n if (interactive) role = roleForSelectionMode(selectionMode);\n else if (gridRow) role = 'row';\n return (\n <div\n {...safeRootAttributes}\n {...interactiveAttributes}\n class={cls}\n style={[tinted.style, fadeStyle].filter(Boolean).join(';') || undefined}\n title={title}\n data-component=\"content-item\"\n data-appearance={appearance}\n data-outlined={outlined ? 'true' : undefined}\n data-bubble={bubble}\n data-grid-row={!interactive && gridRow ? 'true' : undefined}\n data-media-state={media ? 'pending' : undefined}\n data-media-edge={media?.edgeToEdge ? 'true' : undefined}\n data-media-fade={media?.fadeTo === undefined ? undefined : 'true'}\n data-kui-tint={tinted['data-kui-tint']}\n data-kui-tint-accent={tinted['data-kui-tint-accent']}\n data-kui-scheme={tinted['data-kui-scheme']}\n data-scheme={scheme}\n role={role}\n aria-label={ariaLabel}\n aria-selected={\n interactive &&\n (selectionMode === 'single' || selectionMode === 'multiple')\n ? String(selected)\n : undefined\n }\n aria-pressed={\n interactive && selectionMode === 'toggle' ? String(selected) : undefined\n }\n aria-disabled={interactive && disabled ? 'true' : undefined}\n tabindex={\n interactive\n ? disabled\n ? '-1'\n : '0'\n : (tabIndex ?? (focusTarget ? '-1' : undefined))\n }\n slot={slot}\n >\n {media ? (\n <div\n class=\"kui-content-item__media\"\n data-tint-scheme={tinted['data-kui-tint']}\n data-tint-accent={tinted['data-kui-tint-accent']}\n >\n <BackdropImage\n src={media.src}\n srcset={media.srcset}\n sizes={media.sizes}\n alt={media.alt}\n aspectRatio={media.aspectRatio ?? 16 / 9}\n position={media.position}\n parallax={media.parallax ?? 'subtle'}\n blur={\n media.blur ??\n (media.blurredSrc ? { blurredSrc: media.blurredSrc } : undefined)\n }\n deferOffscreen={media.deferOffscreen}\n fadeTo={media.fadeTo}\n overlay={media.overlay}\n scrim={media.scrim}\n loading=\"lazy\"\n bleedInline={false}\n />\n </div>\n ) : null}\n {media ? (\n <div\n class=\"kui-content-item__body\"\n role={\n (interactive && selectionMode === 'multiple') ||\n (!interactive && gridRow)\n ? 'gridcell'\n : undefined\n }\n >\n {children}\n </div>\n ) : (interactive && selectionMode === 'multiple') ||\n (!interactive && gridRow) ? (\n <div role=\"gridcell\">{children}</div>\n ) : (\n children\n )}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/surfaces/content-item/content-item.tsx"],"names":[],"mappings":";;;;;AAwEA,SAAS,cAAc,KAAA,EAAsC;AAC3D,EAAA,IAAI,KAAA,KAAU,QAAQ,OAAO,CAAA;AAC7B,EAAA,IAAI,KAAA,KAAU,UAAU,OAAO,IAAA;AAC/B,EAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,IAAK,KAAA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AAA,GAE/B;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-JBL6SCNN.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport { filterDataAttributes } from '../../../shared/dom/extension-attributes.js';\nimport type { CssColor } from '../../../shared/styles/css-values.js';\nimport type { SemanticTone } from '../../../shared/styles/semantic-tone.js';\nimport {\n type SurfaceTint,\n surfaceTintAttributes,\n type SurfaceTintScheme,\n} from '../../../shared/styles/surface-tint.js';\nimport {\n BackdropImage,\n type BackdropImageBlur,\n type BackdropImageParallax,\n type BackdropImagePosition,\n type BackdropImageScrim,\n} from '../backdrop-image/backdrop-image.js';\n\nexport type { SemanticTone } from '../../../shared/styles/semantic-tone.js';\n\n/**\n * Base surface treatment, semantic status colors, or `brand-loud`: the solid\n * brand fill with its on-loud foreground (a transcript's own messages).\n */\nexport type ContentItemAppearance =\n 'transparent' | 'surface' | 'brand-loud' | SemanticTone;\n\n/**\n * A chat-bubble layout for transcripts: the item fits its content up to 80%\n * of the row and sits at the `start` (other participants) or `end` (the\n * person's own messages) of the line.\n */\nexport type ContentItemBubble = 'start' | 'end';\n\n/** Whether the item's always-reserved 1px border is transparent or visible. */\nexport type ContentItemFrame = 'none' | 'framed';\n\n/** Corner shape: the 12px rounded rectangle or the 22px pill. */\nexport type ContentItemShape = 'rounded' | 'pill';\n/** `single` uses an option; `multiple` uses a grid row; `toggle` uses a pressed button. */\nexport type ContentItemSelectionMode =\n 'none' | 'single' | 'multiple' | 'toggle';\n\n/** One card-owned lead image in the containing feed's shared scrollport. */\nexport interface ContentItemMedia {\n src: string;\n alt: string;\n srcset?: string;\n sizes?: string;\n /** Width divided by height; reserves the image block before it loads. Default 16/9. */\n aspectRatio?: number;\n position?: BackdropImagePosition;\n /** Default subtle (35% lag); set none for a static lead image. */\n parallax?: BackdropImageParallax;\n /** App-supplied soft copy; its opacity changes, never its blur filter. */\n blurredSrc?: string;\n /** Shared BackdropImage blur behavior; use instead of `blurredSrc`. */\n blur?: BackdropImageBlur;\n /**\n * Skip offscreen media painting in long feeds while retaining card geometry.\n * A large scroll jump paints newly visible heroes blank for a frame.\n */\n deferOffscreen?: boolean;\n /** Color the image dissolves into and the card body continues on. */\n fadeTo?: CssColor;\n /** Content layered over the image, including native controls. */\n overlay?: KerfUiContent;\n /** Dim the image behind overlay content. */\n scrim?: BackdropImageScrim;\n /** Extend the image to the card's top, left, and right inner edges. */\n edgeToEdge?: boolean;\n}\n\nfunction mediaParallax(value: BackdropImageParallax): number {\n if (value === 'none') return 0;\n if (value === 'subtle') return 0.35;\n if (!Number.isFinite(value) || value < 0 || value > 1)\n throw new RangeError('ContentItem media.parallax must be from 0 to 1.');\n return value;\n}\n\nconst mediaPositions = new Set<BackdropImagePosition>([\n 'center',\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'top left',\n 'top right',\n 'bottom left',\n 'bottom right',\n]);\n\nfunction roleForSelectionMode(\n mode: ContentItemSelectionMode,\n): 'option' | 'row' | 'button' {\n switch (mode) {\n case 'single':\n return 'option';\n case 'multiple':\n return 'row';\n case 'none':\n case 'toggle':\n return 'button';\n }\n}\n\nconst contentItemProtectedAttributes = new Set([\n 'data-component',\n 'data-appearance',\n 'data-outlined',\n 'data-bubble',\n 'data-grid-row',\n 'data-media-state',\n 'data-media-edge',\n 'data-media-fade',\n 'data-kui-tint',\n 'data-kui-tint-accent',\n]);\nconst interactiveProtectedAttributes = new Set([\n 'data-component',\n 'data-appearance',\n 'data-outlined',\n 'data-bubble',\n 'data-grid-row',\n 'data-media-state',\n 'data-media-edge',\n 'data-media-fade',\n 'data-kui-tint',\n 'data-kui-tint-accent',\n 'data-action',\n 'data-item-id',\n 'data-interactive',\n 'data-selected',\n 'data-disabled',\n 'data-selection-mode',\n 'data-kui-pressed',\n]);\n\ntype ContentItemRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-appearance'?: never;\n 'data-outlined'?: never;\n 'data-bubble'?: never;\n 'data-grid-row'?: never;\n 'data-media-state'?: never;\n 'data-media-edge'?: never;\n 'data-media-fade'?: never;\n 'data-kui-tint'?: never;\n 'data-kui-tint-accent'?: never;\n }\n>;\n\ntype ContentItemInteractiveRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-appearance'?: never;\n 'data-outlined'?: never;\n 'data-bubble'?: never;\n 'data-grid-row'?: never;\n 'data-media-state'?: never;\n 'data-media-edge'?: never;\n 'data-media-fade'?: never;\n 'data-kui-tint'?: never;\n 'data-kui-tint-accent'?: never;\n 'data-action'?: never;\n 'data-item-id'?: never;\n 'data-interactive'?: never;\n 'data-selected'?: never;\n 'data-disabled'?: never;\n 'data-selection-mode'?: never;\n 'data-kui-pressed'?: never;\n }\n>;\n\ninterface ContentItemBaseProps {\n /**\n * Coordinated background, border, and foreground colors. `transparent`\n * preserves the surrounding surface; `surface` paints the base surface;\n * semantic values match StateBanner. Defaults to `transparent`.\n */\n appearance?: ContentItemAppearance;\n /** Reserved lead image with a per-image scroll timeline. Wire the containing root with `wireContentItems`. */\n media?: ContentItemMedia;\n /** App-sampled image color, scoped to this card once its image loads. */\n tint?: SurfaceTint;\n /**\n * Scope this surface and its subtree to the light or dark palette, whatever\n * the page's scheme (a light card on a dark page). A `tint` already sets\n * its scheme; pass `scheme` alone for the plain palette, or with a tint\n * only when they agree.\n */\n scheme?: SurfaceTintScheme;\n /** Item content; a plain string is allowed for bare copy. */\n children?: KerfUiContent | string;\n /**\n * `framed` paints the standard neutral border in the 1px the item always\n * reserves, so framing never changes geometry. Frame only an item that\n * marks a real distinction. Defaults to `none` (transparent border).\n */\n frame?: ContentItemFrame;\n /** Remove block padding and block borders while retaining inline geometry. */\n flush?: boolean;\n /** Corner shape. Defaults to `rounded`. */\n shape?: ContentItemShape;\n /**\n * Lay the item out as a chat bubble: content width up to 80% of the row,\n * at the `start` or `end` of the line. Pair `end` with `brand-loud` for the\n * person's own messages. Omit for an ordinary full-width item.\n */\n bubble?: ContentItemBubble;\n /** Native hover tooltip. */\n title?: string;\n /**\n * Names the item as a distinct region (`role=\"region\"`). Omit it for an\n * ordinary item, which stays a non-landmark grouping.\n */\n ariaLabel?: string;\n /**\n * Makes the item a programmatic focus target (`tabindex=\"-1\"`, never a tab\n * stop), for example the preferred initial focus of a NavStack view when\n * combined with `data-nav-focus` in `rootAttributes`.\n */\n focusTarget?: boolean;\n /** Keep the standard focus outline visible, such as for a drop target. */\n outlined?: boolean;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\nexport type ContentItemProps = ContentItemBaseProps &\n (\n | {\n interactive?: false;\n action?: never;\n itemId?: never;\n selectionMode?: never;\n selected?: never;\n disabled?: never;\n /** Opt into keyboard (`0`) or programmatic (`-1`) focus. */\n tabIndex?: 0 | -1;\n /**\n * A non-selectable row of a multi-select `List` or `Grid`: renders\n * `role=\"row\"` around a `gridcell`, with no `aria-selected` and no\n * Tab stop of its own, for content between selectable rows (an\n * activity group, a \"messages skipped\" divider). Its controls stay\n * reachable by Tab; arrow keys skip it.\n */\n gridRow?: boolean;\n /** Existing static `data-*` metadata remains available. */\n rootAttributes?: ContentItemRootAttributes;\n }\n | {\n /** Enable a keyboard reachable card; wire `wireContentItems` once on its containing root. */\n interactive: true;\n /** Delegated action dispatched by pointer, Enter, or Space. */\n action: string;\n itemId?: string;\n selectionMode?: ContentItemSelectionMode;\n selected?: boolean;\n disabled?: boolean;\n tabIndex?: never;\n /** An interactive item is already a row in a multi-select grid. */\n gridRow?: never;\n /** Safe app metadata; interaction attributes are component-owned. */\n rootAttributes?: ContentItemInteractiveRootAttributes;\n }\n );\n\n/**\n * One self-contained `.kui-content` child: an 8px inline margin, a real 1px\n * border (transparent unless `framed`), 8px padding, and a rounded or pill\n * radius. It owns that whole geometry, so wrappers must not add more.\n */\nexport function ContentItem({\n appearance = 'transparent',\n media,\n tint,\n scheme,\n children,\n frame = 'none',\n flush = false,\n shape = 'rounded',\n bubble,\n title,\n ariaLabel,\n focusTarget = false,\n outlined = false,\n tabIndex,\n gridRow = false,\n interactive = false,\n action,\n itemId,\n selectionMode = 'none',\n selected = false,\n disabled = false,\n className = '',\n rootAttributes = {},\n slot,\n}: ContentItemProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n interactive\n ? interactiveProtectedAttributes\n : contentItemProtectedAttributes,\n );\n if (interactive && !action) {\n throw new Error('Interactive ContentItem requires an action');\n }\n if (interactive && selected && selectionMode === 'none') {\n throw new Error('Selected ContentItem requires a selectionMode');\n }\n if (\n media?.aspectRatio !== undefined &&\n (!Number.isFinite(media.aspectRatio) || media.aspectRatio <= 0)\n )\n throw new RangeError('ContentItem media.aspectRatio must be positive.');\n if (media?.position !== undefined && !mediaPositions.has(media.position))\n throw new TypeError(\n 'ContentItem media.position must be a supported position.',\n );\n if (media?.blur !== undefined && media.blurredSrc !== undefined)\n throw new TypeError(\n 'ContentItem media.blur and blurredSrc cannot be combined.',\n );\n if (media) mediaParallax(media.parallax ?? 'subtle');\n const tinted = surfaceTintAttributes(media ? tint : undefined, scheme);\n const fadeStyle =\n media?.fadeTo === undefined\n ? undefined\n : `--_kui-content-item-media-fade-to:${media.fadeTo}`;\n const cls = [\n 'kui-content-item',\n shape === 'pill' ? 'kui-content-item--pill' : '',\n frame === 'framed' ? 'kui-content-item--framed' : '',\n flush ? 'kui-content-item--flush' : '',\n tinted.className,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n const interactiveAttributes = interactive\n ? {\n 'data-interactive': 'true',\n 'data-action': disabled ? undefined : action,\n 'data-item-id': itemId,\n 'data-selection-mode': selectionMode,\n 'data-selected':\n selectionMode === 'none' ? undefined : String(selected),\n 'data-disabled': disabled ? 'true' : undefined,\n }\n : {};\n let role: 'option' | 'row' | 'button' | 'region' | undefined = ariaLabel\n ? 'region'\n : undefined;\n if (interactive) role = roleForSelectionMode(selectionMode);\n else if (gridRow) role = 'row';\n return (\n <div\n {...safeRootAttributes}\n {...interactiveAttributes}\n class={cls}\n style={[tinted.style, fadeStyle].filter(Boolean).join(';') || undefined}\n title={title}\n data-component=\"content-item\"\n data-appearance={appearance}\n data-outlined={outlined ? 'true' : undefined}\n data-bubble={bubble}\n data-grid-row={!interactive && gridRow ? 'true' : undefined}\n data-media-state={media ? 'pending' : undefined}\n data-media-edge={media?.edgeToEdge ? 'true' : undefined}\n data-media-fade={media?.fadeTo === undefined ? undefined : 'true'}\n data-kui-tint={tinted['data-kui-tint']}\n data-kui-tint-accent={tinted['data-kui-tint-accent']}\n data-kui-scheme={tinted['data-kui-scheme']}\n data-scheme={scheme}\n role={role}\n aria-label={ariaLabel}\n aria-selected={\n interactive &&\n (selectionMode === 'single' || selectionMode === 'multiple')\n ? String(selected)\n : undefined\n }\n aria-pressed={\n interactive && selectionMode === 'toggle' ? String(selected) : undefined\n }\n aria-disabled={interactive && disabled ? 'true' : undefined}\n tabindex={\n interactive\n ? disabled\n ? '-1'\n : '0'\n : (tabIndex ?? (focusTarget ? '-1' : undefined))\n }\n slot={slot}\n >\n {media ? (\n <div\n class=\"kui-content-item__media\"\n data-tint-scheme={tinted['data-kui-tint']}\n data-tint-accent={tinted['data-kui-tint-accent']}\n >\n <BackdropImage\n src={media.src}\n srcset={media.srcset}\n sizes={media.sizes}\n alt={media.alt}\n aspectRatio={media.aspectRatio ?? 16 / 9}\n position={media.position}\n parallax={media.parallax ?? 'subtle'}\n blur={\n media.blur ??\n (media.blurredSrc ? { blurredSrc: media.blurredSrc } : undefined)\n }\n deferOffscreen={media.deferOffscreen}\n fadeTo={media.fadeTo}\n overlay={media.overlay}\n scrim={media.scrim}\n loading=\"lazy\"\n bleedInline={false}\n />\n </div>\n ) : null}\n {media ? (\n <div\n class=\"kui-content-item__body\"\n role={\n (interactive && selectionMode === 'multiple') ||\n (!interactive && gridRow)\n ? 'gridcell'\n : undefined\n }\n >\n {children}\n </div>\n ) : (interactive && selectionMode === 'multiple') ||\n (!interactive && gridRow) ? (\n <div role=\"gridcell\">{children}</div>\n ) : (\n children\n )}\n </div>\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { scrollEffectLayerStyle, SCROLL_TIMELINE_ATTRIBUTE } from './chunk-4K7XXSOX.js';
|
|
2
|
-
import { filterDataAttributes } from './chunk-
|
|
2
|
+
import { filterDataAttributes } from './chunk-BRDTP3RT.js';
|
|
3
3
|
import { jsx, jsxs } from 'kerfjs/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
var SCROLL_EFFECT_PROTECTED = /* @__PURE__ */ new Set([
|
|
@@ -154,4 +154,4 @@ function ScrollEffect({
|
|
|
154
154
|
|
|
155
155
|
export { ScrollEffect };
|
|
156
156
|
|
|
157
|
-
//# sourceMappingURL=chunk-
|
|
157
|
+
//# sourceMappingURL=chunk-JNQBPRAA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/surfaces/scroll-effect/scroll-effect.tsx"],"names":[],"mappings":";;;;AAgGA,IAAM,uBAAA,uBAA8B,GAAA,CAAI;AAAA,EACtC,gBAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,UAAA,GAAa,IAAA;AACnB,IAAM,MAAA,uBAAkC,GAAA,CAAI;AAAA,EAC1C,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAC,CAAA;AACD,IAAM,aAAA,GAA6D;AAAA,EACjE,QAAA,EAAU,MAAA;AAAA,EACV,MAAA,EAAQ,OAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK;AACP,CAAA;AAEA,SAAS,OAAA,CACP,KAAA,EACA,GAAA,EACA,GAAA,EACA,OAAA,EACQ;AACR,EAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,IAAK,KAAA,GAAQ,OAAO,KAAA,GAAQ,GAAA;AACpD,IAAA,MAAM,IAAI,UAAA,CAAW,CA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AAAA,QAElC,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,IAEF;AAAA,GACF;AACA,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,oBAAA,CAAqB,cAAA,EAAgB,uBAAuB,CAAA;AAAA,MAChE,KAAA,EAAM,mBAAA;AAAA,MACN,gBAAA,EAAe,eAAA;AAAA,MACf,0BAAA,EAAyB,EAAA;AAAA,MACzB,WAAA,EAAW,OAAO,MAAA,GAAS,MAAA;AAAA,MAE1B,QAAA,EAAA;AAAA,QAAA,OAAA;AAAA,QACA,IAAA,CAAK,GAAA,CAAI,CAAC,GAAA,qBACT,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAM,wBAAA;AAAA,YACN,aAAA,EAAY,MAAA;AAAA,YACZ,0BAAwB,GAAA,CAAI,MAAA;AAAA,YAC5B,KAAA,EAAO,uBAAuB,GAAG;AAAA;AAAA,SAEpC;AAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-7KN5OQVN.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport {\n SCROLL_TIMELINE_ATTRIBUTE,\n type ScrollEffectLayer,\n scrollEffectLayerStyle,\n} from '../../../shared/styles/scroll-effect-layer.js';\n\n/**\n * The part of the wrapper's view timeline an effect runs over, as the CSS\n * named timeline ranges: `entry` while it scrolls into view, `exit` while it\n * scrolls out, `cover` from first to last visible pixel, and `contain` while\n * it is fully in view (or fully covers the view).\n */\nexport type ScrollEffectRange = 'entry' | 'exit' | 'cover' | 'contain';\n\n/** Where an effect runs, shared by every preset. */\nexport interface ScrollEffectRangeOptions {\n /** The timeline range. Each preset has its own default. */\n range?: ScrollEffectRange;\n /** Where the effect starts within `range`, from 0 to 100 percent. Default 0. */\n rangeStart?: number;\n /** Where the effect ends within `range`, from 0 to 100 percent. Default 100. */\n rangeEnd?: number;\n}\n\n/**\n * The content lags the scroll by `lag` (0 to 1; `subtle` is 0.35), the way\n * BackdropImage's parallax does. Over `exit` (the default) it moves by the lag\n * times its own height, which is exactly the lag factor of the scroll there;\n * over `entry` it settles into place, and over `cover` or `contain` it passes\n * its resting place halfway. The wrapper clips the moving content.\n */\nexport interface ScrollEffectParallax extends ScrollEffectRangeOptions {\n kind: 'parallax';\n lag?: number | 'subtle';\n}\n\n/** The content fades in from transparent. Default range `entry`. */\nexport interface ScrollEffectReveal extends ScrollEffectRangeOptions {\n kind: 'reveal';\n}\n\n/** The content fades out to transparent. Default range `exit`. */\nexport interface ScrollEffectFade extends ScrollEffectRangeOptions {\n kind: 'fade';\n}\n\n/**\n * The content scales from `from` to `to` (each above 0, at most 2; defaults\n * 0.96 and 1) around its center. Default range `entry`. The wrapper clips a\n * scale above 1.\n */\nexport interface ScrollEffectScale extends ScrollEffectRangeOptions {\n kind: 'scale';\n from?: number;\n to?: number;\n}\n\n/**\n * A black layer over the content ramps to opacity `to` (0 to 1; default\n * 0.5). Default range `exit`.\n */\nexport interface ScrollEffectDim extends ScrollEffectRangeOptions {\n kind: 'dim';\n to?: number;\n}\n\n/** One scroll-linked effect preset. */\nexport type ScrollEffectSpec =\n | ScrollEffectParallax\n | ScrollEffectReveal\n | ScrollEffectFade\n | ScrollEffectScale\n | ScrollEffectDim;\n\nexport type ScrollEffectKind = ScrollEffectSpec['kind'];\n\nexport interface ScrollEffectProps {\n /**\n * The effects. They compose: transforms stack in array order (the first is\n * outermost) and opacities multiply, so `reveal` on `entry` with `fade` on\n * `exit` fades content in and out. Repeating a kind stacks it the same way\n * (each `dim` adds its own overlay).\n */\n effects: readonly ScrollEffectSpec[];\n /** The content the effects apply to. */\n children?: KerfUiContent;\n /** Application `data-*` metadata on the root, such as an editor node\n * marker; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst SCROLL_EFFECT_PROTECTED = new Set([\n 'data-component',\n 'data-clip',\n SCROLL_TIMELINE_ATTRIBUTE,\n]);\n\nconst SUBTLE_LAG = 0.35;\nconst RANGES: ReadonlySet<string> = new Set([\n 'entry',\n 'exit',\n 'cover',\n 'contain',\n]);\nconst DEFAULT_RANGE: Record<ScrollEffectKind, ScrollEffectRange> = {\n parallax: 'exit',\n reveal: 'entry',\n fade: 'exit',\n scale: 'entry',\n dim: 'exit',\n};\n\nfunction inRange(\n value: number,\n min: number,\n max: number,\n message: string,\n): number {\n if (!Number.isFinite(value) || value < min || value > max)\n throw new RangeError(`ScrollEffect ${message}`);\n return value;\n}\n\nfunction positiveScale(value: number, name: string): number {\n if (!Number.isFinite(value) || value <= 0 || value > 2)\n throw new RangeError(\n `ScrollEffect scale.${name} must be above 0 and at most 2.`,\n );\n return value;\n}\n\nfunction animationRange(effect: ScrollEffectSpec): {\n name: ScrollEffectRange;\n css: string;\n} {\n const name = effect.range ?? DEFAULT_RANGE[effect.kind];\n if (!RANGES.has(name))\n throw new TypeError(\n `ScrollEffect ${effect.kind}.range must be entry, exit, cover, or contain.`,\n );\n const start = inRange(\n effect.rangeStart ?? 0,\n 0,\n 100,\n `${effect.kind}.rangeStart must be from 0 to 100.`,\n );\n const end = inRange(\n effect.rangeEnd ?? 100,\n 0,\n 100,\n `${effect.kind}.rangeEnd must be from 0 to 100.`,\n );\n if (start >= end)\n throw new RangeError(\n `ScrollEffect ${effect.kind}.rangeStart must be below rangeEnd.`,\n );\n return {\n name,\n css: `${name} ${String(start)}% ${name} ${String(end)}%`,\n };\n}\n\n/** The shared-layer configuration for one validated effect. */\nfunction scrollEffectLayer(effect: ScrollEffectSpec): ScrollEffectLayer {\n if (!Object.hasOwn(DEFAULT_RANGE, effect.kind))\n throw new TypeError(\n 'ScrollEffect effect kind must be parallax, reveal, fade, scale, or dim.',\n );\n const range = animationRange(effect);\n switch (effect.kind) {\n case 'parallax': {\n const lag =\n effect.lag === 'subtle' || effect.lag === undefined\n ? SUBTLE_LAG\n : inRange(\n effect.lag,\n 0,\n 1,\n 'parallax.lag must be subtle or a number from 0 to 1.',\n );\n // The offset rises by the lag across the range, resting at 0 where the\n // content sits in place: the start of exit, the end of entry, and the\n // middle of cover or contain.\n const from =\n range.name === 'exit' ? 0 : range.name === 'entry' ? -lag : -lag / 2;\n return {\n family: 'translate',\n from,\n to: from + lag,\n range: range.css,\n };\n }\n case 'reveal':\n return { family: 'opacity', from: 0, to: 1, range: range.css };\n case 'fade':\n return { family: 'opacity', from: 1, to: 0, range: range.css };\n case 'scale':\n return {\n family: 'scale',\n from: positiveScale(effect.from ?? 0.96, 'from'),\n to: positiveScale(effect.to ?? 1, 'to'),\n range: range.css,\n };\n case 'dim':\n return {\n family: 'opacity',\n from: 0,\n to: inRange(effect.to ?? 0.5, 0, 1, 'dim.to must be from 0 to 1.'),\n range: range.css,\n };\n }\n}\n\n/**\n * Applies scroll-linked effects to any content without a scroll listener:\n * each effect animates only `transform` or `opacity` on the wrapper's own\n * CSS view timeline, which the compositor runs. Kerf owns the static\n * fallbacks: the content rests in place, fully visible and undimmed, without\n * scroll-driven animation support, under reduced motion, under\n * `data-kui-effects=\"static\"`, on slow-update displays, and under reduced\n * transparency, increased contrast, or forced colors.\n */\nexport function ScrollEffect({\n effects,\n children,\n rootAttributes = {},\n}: ScrollEffectProps) {\n const layers: ScrollEffectLayer[] = [];\n const dims: ScrollEffectLayer[] = [];\n let clip = false;\n for (const effect of effects) {\n const layer = scrollEffectLayer(effect);\n (effect.kind === 'dim' ? dims : layers).push(layer);\n if (\n effect.kind === 'parallax' ||\n (layer.family === 'scale' &&\n Math.max(Number(layer.from), Number(layer.to)) > 1)\n )\n clip = true;\n }\n const content = layers.reduceRight<KerfUiContent>(\n (inner, layer) => (\n <div\n class=\"kui-scroll-effect__layer\"\n data-kui-scroll-effect={layer.family}\n style={scrollEffectLayerStyle(layer)}\n >\n {inner}\n </div>\n ),\n children,\n );\n return (\n <div\n {...filterDataAttributes(rootAttributes, SCROLL_EFFECT_PROTECTED)}\n class=\"kui-scroll-effect\"\n data-component=\"scroll-effect\"\n data-kui-scroll-timeline=\"\"\n data-clip={clip ? 'true' : undefined}\n >\n {content}\n {dims.map((dim) => (\n <div\n class=\"kui-scroll-effect__dim\"\n aria-hidden=\"true\"\n data-kui-scroll-effect={dim.family}\n style={scrollEffectLayerStyle(dim)}\n />\n ))}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/surfaces/scroll-effect/scroll-effect.tsx"],"names":[],"mappings":";;;;AAgGA,IAAM,uBAAA,uBAA8B,GAAA,CAAI;AAAA,EACtC,gBAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,UAAA,GAAa,IAAA;AACnB,IAAM,MAAA,uBAAkC,GAAA,CAAI;AAAA,EAC1C,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAC,CAAA;AACD,IAAM,aAAA,GAA6D;AAAA,EACjE,QAAA,EAAU,MAAA;AAAA,EACV,MAAA,EAAQ,OAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK;AACP,CAAA;AAEA,SAAS,OAAA,CACP,KAAA,EACA,GAAA,EACA,GAAA,EACA,OAAA,EACQ;AACR,EAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,IAAK,KAAA,GAAQ,OAAO,KAAA,GAAQ,GAAA;AACpD,IAAA,MAAM,IAAI,UAAA,CAAW,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAE,CAAA;AAChD,EAAA,OAAO,KAAA;AACT;AAEA,SAAS,aAAA,CAAc,OAAe,IAAA,EAAsB;AAC1D,EAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,IAAK,KAAA,IAAS,KAAK,KAAA,GAAQ,CAAA;AACnD,IAAA,MAAM,IAAI,UAAA;AAAA,MACR,sBAAsB,IAAI,CAAA,+BAAA;AAAA,K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AAO,MAAA,GAAS,MAAA;AAAA,MAE1B,QAAA,EAAA;AAAA,QAAA,OAAA;AAAA,QACA,IAAA,CAAK,GAAA,CAAI,CAAC,GAAA,qBACT,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAM,wBAAA;AAAA,YACN,aAAA,EAAY,MAAA;AAAA,YACZ,0BAAwB,GAAA,CAAI,MAAA;AAAA,YAC5B,KAAA,EAAO,uBAAuB,GAAG;AAAA;AAAA,SAEpC;AAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-JNQBPRAA.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport {\n SCROLL_TIMELINE_ATTRIBUTE,\n type ScrollEffectLayer,\n scrollEffectLayerStyle,\n} from '../../../shared/styles/scroll-effect-layer.js';\n\n/**\n * The part of the wrapper's view timeline an effect runs over, as the CSS\n * named timeline ranges: `entry` while it scrolls into view, `exit` while it\n * scrolls out, `cover` from first to last visible pixel, and `contain` while\n * it is fully in view (or fully covers the view).\n */\nexport type ScrollEffectRange = 'entry' | 'exit' | 'cover' | 'contain';\n\n/** Where an effect runs, shared by every preset. */\nexport interface ScrollEffectRangeOptions {\n /** The timeline range. Each preset has its own default. */\n range?: ScrollEffectRange;\n /** Where the effect starts within `range`, from 0 to 100 percent. Default 0. */\n rangeStart?: number;\n /** Where the effect ends within `range`, from 0 to 100 percent. Default 100. */\n rangeEnd?: number;\n}\n\n/**\n * The content lags the scroll by `lag` (0 to 1; `subtle` is 0.35), the way\n * BackdropImage's parallax does. Over `exit` (the default) it moves by the lag\n * times its own height, which is exactly the lag factor of the scroll there;\n * over `entry` it settles into place, and over `cover` or `contain` it passes\n * its resting place halfway. The wrapper clips the moving content.\n */\nexport interface ScrollEffectParallax extends ScrollEffectRangeOptions {\n kind: 'parallax';\n lag?: number | 'subtle';\n}\n\n/** The content fades in from transparent. Default range `entry`. */\nexport interface ScrollEffectReveal extends ScrollEffectRangeOptions {\n kind: 'reveal';\n}\n\n/** The content fades out to transparent. Default range `exit`. */\nexport interface ScrollEffectFade extends ScrollEffectRangeOptions {\n kind: 'fade';\n}\n\n/**\n * The content scales from `from` to `to` (each above 0, at most 2; defaults\n * 0.96 and 1) around its center. Default range `entry`. The wrapper clips a\n * scale above 1.\n */\nexport interface ScrollEffectScale extends ScrollEffectRangeOptions {\n kind: 'scale';\n from?: number;\n to?: number;\n}\n\n/**\n * A black layer over the content ramps to opacity `to` (0 to 1; default\n * 0.5). Default range `exit`.\n */\nexport interface ScrollEffectDim extends ScrollEffectRangeOptions {\n kind: 'dim';\n to?: number;\n}\n\n/** One scroll-linked effect preset. */\nexport type ScrollEffectSpec =\n | ScrollEffectParallax\n | ScrollEffectReveal\n | ScrollEffectFade\n | ScrollEffectScale\n | ScrollEffectDim;\n\nexport type ScrollEffectKind = ScrollEffectSpec['kind'];\n\nexport interface ScrollEffectProps {\n /**\n * The effects. They compose: transforms stack in array order (the first is\n * outermost) and opacities multiply, so `reveal` on `entry` with `fade` on\n * `exit` fades content in and out. Repeating a kind stacks it the same way\n * (each `dim` adds its own overlay).\n */\n effects: readonly ScrollEffectSpec[];\n /** The content the effects apply to. */\n children?: KerfUiContent;\n /** Application `data-*` metadata on the root, such as an editor node\n * marker; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst SCROLL_EFFECT_PROTECTED = new Set([\n 'data-component',\n 'data-clip',\n SCROLL_TIMELINE_ATTRIBUTE,\n]);\n\nconst SUBTLE_LAG = 0.35;\nconst RANGES: ReadonlySet<string> = new Set([\n 'entry',\n 'exit',\n 'cover',\n 'contain',\n]);\nconst DEFAULT_RANGE: Record<ScrollEffectKind, ScrollEffectRange> = {\n parallax: 'exit',\n reveal: 'entry',\n fade: 'exit',\n scale: 'entry',\n dim: 'exit',\n};\n\nfunction inRange(\n value: number,\n min: number,\n max: number,\n message: string,\n): number {\n if (!Number.isFinite(value) || value < min || value > max)\n throw new RangeError(`ScrollEffect ${message}`);\n return value;\n}\n\nfunction positiveScale(value: number, name: string): number {\n if (!Number.isFinite(value) || value <= 0 || value > 2)\n throw new RangeError(\n `ScrollEffect scale.${name} must be above 0 and at most 2.`,\n );\n return value;\n}\n\nfunction animationRange(effect: ScrollEffectSpec): {\n name: ScrollEffectRange;\n css: string;\n} {\n const name = effect.range ?? DEFAULT_RANGE[effect.kind];\n if (!RANGES.has(name))\n throw new TypeError(\n `ScrollEffect ${effect.kind}.range must be entry, exit, cover, or contain.`,\n );\n const start = inRange(\n effect.rangeStart ?? 0,\n 0,\n 100,\n `${effect.kind}.rangeStart must be from 0 to 100.`,\n );\n const end = inRange(\n effect.rangeEnd ?? 100,\n 0,\n 100,\n `${effect.kind}.rangeEnd must be from 0 to 100.`,\n );\n if (start >= end)\n throw new RangeError(\n `ScrollEffect ${effect.kind}.rangeStart must be below rangeEnd.`,\n );\n return {\n name,\n css: `${name} ${String(start)}% ${name} ${String(end)}%`,\n };\n}\n\n/** The shared-layer configuration for one validated effect. */\nfunction scrollEffectLayer(effect: ScrollEffectSpec): ScrollEffectLayer {\n if (!Object.hasOwn(DEFAULT_RANGE, effect.kind))\n throw new TypeError(\n 'ScrollEffect effect kind must be parallax, reveal, fade, scale, or dim.',\n );\n const range = animationRange(effect);\n switch (effect.kind) {\n case 'parallax': {\n const lag =\n effect.lag === 'subtle' || effect.lag === undefined\n ? SUBTLE_LAG\n : inRange(\n effect.lag,\n 0,\n 1,\n 'parallax.lag must be subtle or a number from 0 to 1.',\n );\n // The offset rises by the lag across the range, resting at 0 where the\n // content sits in place: the start of exit, the end of entry, and the\n // middle of cover or contain.\n const from =\n range.name === 'exit' ? 0 : range.name === 'entry' ? -lag : -lag / 2;\n return {\n family: 'translate',\n from,\n to: from + lag,\n range: range.css,\n };\n }\n case 'reveal':\n return { family: 'opacity', from: 0, to: 1, range: range.css };\n case 'fade':\n return { family: 'opacity', from: 1, to: 0, range: range.css };\n case 'scale':\n return {\n family: 'scale',\n from: positiveScale(effect.from ?? 0.96, 'from'),\n to: positiveScale(effect.to ?? 1, 'to'),\n range: range.css,\n };\n case 'dim':\n return {\n family: 'opacity',\n from: 0,\n to: inRange(effect.to ?? 0.5, 0, 1, 'dim.to must be from 0 to 1.'),\n range: range.css,\n };\n }\n}\n\n/**\n * Applies scroll-linked effects to any content without a scroll listener:\n * each effect animates only `transform` or `opacity` on the wrapper's own\n * CSS view timeline, which the compositor runs. Kerf owns the static\n * fallbacks: the content rests in place, fully visible and undimmed, without\n * scroll-driven animation support, under reduced motion, under\n * `data-kui-effects=\"static\"`, on slow-update displays, and under reduced\n * transparency, increased contrast, or forced colors.\n */\nexport function ScrollEffect({\n effects,\n children,\n rootAttributes = {},\n}: ScrollEffectProps) {\n const layers: ScrollEffectLayer[] = [];\n const dims: ScrollEffectLayer[] = [];\n let clip = false;\n for (const effect of effects) {\n const layer = scrollEffectLayer(effect);\n (effect.kind === 'dim' ? dims : layers).push(layer);\n if (\n effect.kind === 'parallax' ||\n (layer.family === 'scale' &&\n Math.max(Number(layer.from), Number(layer.to)) > 1)\n )\n clip = true;\n }\n const content = layers.reduceRight<KerfUiContent>(\n (inner, layer) => (\n <div\n class=\"kui-scroll-effect__layer\"\n data-kui-scroll-effect={layer.family}\n style={scrollEffectLayerStyle(layer)}\n >\n {inner}\n </div>\n ),\n children,\n );\n return (\n <div\n {...filterDataAttributes(rootAttributes, SCROLL_EFFECT_PROTECTED)}\n class=\"kui-scroll-effect\"\n data-component=\"scroll-effect\"\n data-kui-scroll-timeline=\"\"\n data-clip={clip ? 'true' : undefined}\n >\n {content}\n {dims.map((dim) => (\n <div\n class=\"kui-scroll-effect__dim\"\n aria-hidden=\"true\"\n data-kui-scroll-effect={dim.family}\n style={scrollEffectLayerStyle(dim)}\n />\n ))}\n </div>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { filterDataAttributes } from './chunk-
|
|
1
|
+
import { filterDataAttributes } from './chunk-BRDTP3RT.js';
|
|
2
2
|
import { jsx } from 'kerfjs/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
var CORNER_STATUS_PROTECTED = /* @__PURE__ */ new Set([
|
|
@@ -33,4 +33,4 @@ function CornerStatus({
|
|
|
33
33
|
|
|
34
34
|
export { CornerStatus };
|
|
35
35
|
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-JNSPYECP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/feedback/corner-status/corner-status.tsx"],"names":[],"mappings":";;;AAmCA,IAAM,uBAAA,uBAA8B,GAAA,CAAI;AAAA,EACtC,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAC,CAAA;AAUM,SAAS,YAAA,CAAa;AAAA,EAC3B,EAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA,GAAY,YAAA;AAAA,EACZ,YAAA,GAAe,SAAA;AAAA,EACf,SAAA,GAAY,EAAA;AAAA,EACZ,IAAA;AAAA,EACA,iBAAiB;AACnB,CAAA,EAAsB;AACpB,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,oBAAA,CAAqB,cAAA,EAAgB,uBAAuB,CAAA;AAAA,MAChE,EAAA;AAAA,MACA,KAAA,EAAO,CAAA,kBAAA,EAAqB,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MAC7C,gBAAA,EAAe,eAAA;AAAA,MACf,gBAAA,EAAgB,SAAA;AAAA,MAChB,mBAAA,EAAmB,YAAA;AAAA,MACnB,OAAA,EAAS,YAAA,KAAiB,SAAA,GAAY,QAAA,GAAW,MAAA;AAAA,MACjD,IAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/components/feedback/corner-status/corner-status.tsx"],"names":[],"mappings":";;;AAmCA,IAAM,uBAAA,uBAA8B,GAAA,CAAI;AAAA,EACtC,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAC,CAAA;AAUM,SAAS,YAAA,CAAa;AAAA,EAC3B,EAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA,GAAY,YAAA;AAAA,EACZ,YAAA,GAAe,SAAA;AAAA,EACf,SAAA,GAAY,EAAA;AAAA,EACZ,IAAA;AAAA,EACA,iBAAiB;AACnB,CAAA,EAAsB;AACpB,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,oBAAA,CAAqB,cAAA,EAAgB,uBAAuB,CAAA;AAAA,MAChE,EAAA;AAAA,MACA,KAAA,EAAO,CAAA,kBAAA,EAAqB,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MAC7C,gBAAA,EAAe,eAAA;AAAA,MACf,gBAAA,EAAgB,SAAA;AAAA,MAChB,mBAAA,EAAmB,YAAA;AAAA,MACnB,OAAA,EAAS,YAAA,KAAiB,SAAA,GAAY,QAAA,GAAW,MAAA;AAAA,MACjD,IAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"chunk-JNSPYECP.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\n\n/** The viewport corner a CornerStatus occupies, in logical (RTL-aware) terms. */\nexport type CornerStatusPlacement =\n 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';\n\n/** Where a CornerStatus appears: the top layer, or in flow. */\nexport type CornerStatusPresentation = 'overlay' | 'embedded';\n\nexport interface CornerStatusProps {\n /** The root id: what a `popovertarget` control or `getElementById` names. */\n id?: string;\n /** One or more `StateBanner`s, typically `urgency=\"status\"`; they stack. */\n children: KerfUiContent;\n /** Viewport corner; defaults to `bottom-end`. */\n placement?: CornerStatusPlacement;\n /**\n * `overlay` (default) is a native `popover=\"manual\"` host in the top layer,\n * opened by `wireCornerStatus`: above fixed and z-indexed page chrome,\n * never focused, and with no close button, light dismiss, or Escape.\n * `embedded` renders the same stack in flow for a catalog or inline use.\n */\n presentation?: CornerStatusPresentation;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or a\n * test hook; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst CORNER_STATUS_PROTECTED = new Set([\n 'data-component',\n 'data-placement',\n 'data-presentation',\n]);\n\n/**\n * A non-dismissible status surface pinned to a viewport corner — \"Loading…\",\n * \"Updating Tickets… 3 of 12\" — for app-level progress that has no better\n * home beside the affected work. The application owns its lifetime: render it\n * while the work runs and remove it when the work ends. It carries no role of\n * its own; the composed `StateBanner` is the polite live region. Use a toast\n * for transient, dismissible confirmation instead.\n */\nexport function CornerStatus({\n id,\n children,\n placement = 'bottom-end',\n presentation = 'overlay',\n className = '',\n slot,\n rootAttributes = {},\n}: CornerStatusProps) {\n return (\n <div\n {...filterDataAttributes(rootAttributes, CORNER_STATUS_PROTECTED)}\n id={id}\n class={`kui-corner-status ${className}`.trim()}\n data-component=\"corner-status\"\n data-placement={placement}\n data-presentation={presentation}\n popover={presentation === 'overlay' ? 'manual' : undefined}\n slot={slot}\n >\n {children}\n </div>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { filterDataAttributes } from './chunk-
|
|
1
|
+
import { filterDataAttributes } from './chunk-BRDTP3RT.js';
|
|
2
2
|
import { jsx } from 'kerfjs/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
var FLOATING_TOOLBAR_PROTECTED = /* @__PURE__ */ new Set([
|
|
@@ -38,4 +38,4 @@ function FloatingToolbar({
|
|
|
38
38
|
|
|
39
39
|
export { FloatingToolbar };
|
|
40
40
|
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-KBDYXGYT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/actions/floating-toolbar/floating-toolbar.tsx"],"names":[],"mappings":";;;AAwCA,IAAM,0BAAA,uBAAiC,GAAA,CAAI;AAAA,EACzC,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC,CAAA;AAmBM,SAAS,eAAA,CAAgB;AAAA,EAC9B,QAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,GAAW,YAAA;AAAA,EACX,SAAA,GAAY,UAAA;AAAA,EACZ,KAAA;AAAA,EACA,cAAA,GAAiB,KAAA;AAAA,EACjB,SAAA,GAAY,EAAA;AAAA,EACZ,IAAA;AAAA,EACA,iBAAiB;AACnB,CAAA,EAAyB;AACvB,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,oBAAA,CAAqB,cAAA,EAAgB,0BAA0B,CAAA;AAAA,MACnE,KAAA,EAAO,CAAA,qBAAA,EAAwB,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MAChD,gBAAA,EAAe,kBAAA;AAAA,MACf,eAAA,EAAe,QAAA;AAAA,MACf,gBAAA,EAAgB,SAAA;AAAA,MAChB,uBAAA,EAAuB,iBAAiB,MAAA,GAAS,MAAA;AAAA,MACjD,IAAA,EAAK,SAAA;AAAA,MACL,YAAA,EAAY,KAAA;AAAA,MACZ,KAAA,EAAO,KAAA,GAAQ,CAAA,6BAAA,EAAgC,KAAK,CAAA,CAAA,GAAK,MAAA;AAAA,MACzD,IAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/components/actions/floating-toolbar/floating-toolbar.tsx"],"names":[],"mappings":";;;AAwCA,IAAM,0BAAA,uBAAiC,GAAA,CAAI;AAAA,EACzC,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC,CAAA;AAmBM,SAAS,eAAA,CAAgB;AAAA,EAC9B,QAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,GAAW,YAAA;AAAA,EACX,SAAA,GAAY,UAAA;AAAA,EACZ,KAAA;AAAA,EACA,cAAA,GAAiB,KAAA;AAAA,EACjB,SAAA,GAAY,EAAA;AAAA,EACZ,IAAA;AAAA,EACA,iBAAiB;AACnB,CAAA,EAAyB;AACvB,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,oBAAA,CAAqB,cAAA,EAAgB,0BAA0B,CAAA;AAAA,MACnE,KAAA,EAAO,CAAA,qBAAA,EAAwB,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MAChD,gBAAA,EAAe,kBAAA;AAAA,MACf,eAAA,EAAe,QAAA;AAAA,MACf,gBAAA,EAAgB,SAAA;AAAA,MAChB,uBAAA,EAAuB,iBAAiB,MAAA,GAAS,MAAA;AAAA,MACjD,IAAA,EAAK,SAAA;AAAA,MACL,YAAA,EAAY,KAAA;AAAA,MACZ,KAAA,EAAO,KAAA,GAAQ,CAAA,6BAAA,EAAgC,KAAK,CAAA,CAAA,GAAK,MAAA;AAAA,MACzD,IAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"chunk-KBDYXGYT.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport type { CssLength } from '../../../shared/styles/css-values.js';\n\n/** Where a {@link FloatingToolbar} floats within its positioned container. */\nexport type FloatingToolbarPosition =\n 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end';\n\nexport interface FloatingToolbarProps {\n /** Toolbar contents — normally one or more `ToolbarControlGroup`s. */\n children: KerfUiContent;\n /** Accessible name for the toolbar (required — it exposes `role=\"toolbar\"`). */\n label: string;\n /**\n * Corner or edge it floats to inside its nearest positioned ancestor.\n * Default: `'bottom-end'`.\n */\n position?: FloatingToolbarPosition;\n /** Keep the toolbar in normal document flow instead of floating over content. */\n placement?: 'floating' | 'inline';\n /**\n * Distance from the container edges named by `position`. Default:\n * `space('m')` (16px, 8px past a top toolbar's own inset). Omit it inside a\n * `Workbench`, `CollapsiblePanel`, or `ResizableRegion` restore corner: the\n * corner owns the inset there and sets it to zero.\n */\n inset?: CssLength;\n /** Add device or layout-routed safe-area insets to the positioned edges. */\n safeAreaInsets?: boolean;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or a\n * test hook; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst FLOATING_TOOLBAR_PROTECTED = new Set([\n 'data-component',\n 'data-placement',\n 'data-position',\n 'data-safe-area-insets',\n]);\n\n/**\n * A toolbar that floats above the main content of its nearest positioned\n * ancestor — a transparent, forced-dark cluster of controls (e.g. a drawer\n * restore button) that sits over the content but NOT over dialogs or overlays\n * (it is not in the top layer). It is inset from the container edges by\n * `inset` (default `--kui-space-m`, i.e. 8px more than a top toolbar's own\n * inset); pass a typed length to move it. Inside a `Workbench`, `CollapsiblePanel`, or\n * `ResizableRegion` restore corner the corner owns the inset, so the toolbar\n * floats from the corner's own position. While one of those layouts has a\n * side overlay open over the toolbar's region (a Workbench rail overlay, a\n * `wireSidebar` compact overlay, an overlay `CollapsiblePanel` or horizontal\n * `ResizableRegion`), the toolbar is hidden — unfocusable and out of the\n * accessibility tree — until the overlay closes. The app owns the controls\n * and their behavior — wire them with `delegate()` as usual. Set\n * `placement=\"inline\"` for normal flow when an owner already positions the\n * control; floating placement can add safe-area insets to its per-edge tokens.\n */\nexport function FloatingToolbar({\n children,\n label,\n position = 'bottom-end',\n placement = 'floating',\n inset,\n safeAreaInsets = false,\n className = '',\n slot,\n rootAttributes = {},\n}: FloatingToolbarProps) {\n return (\n <div\n {...filterDataAttributes(rootAttributes, FLOATING_TOOLBAR_PROTECTED)}\n class={`kui-floating-toolbar ${className}`.trim()}\n data-component=\"floating-toolbar\"\n data-position={position}\n data-placement={placement}\n data-safe-area-insets={safeAreaInsets ? 'true' : undefined}\n role=\"toolbar\"\n aria-label={label}\n style={inset ? `--kui-floating-toolbar-inset:${inset}` : undefined}\n slot={slot}\n >\n {children}\n </div>\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { verticalAlignment, horizontalAlignment } from './chunk-D4MXSAMI.js';
|
|
2
2
|
import { gapLength } from './chunk-MHMWQ7RB.js';
|
|
3
|
-
import { filterRootAttributes } from './chunk-
|
|
3
|
+
import { filterRootAttributes } from './chunk-BRDTP3RT.js';
|
|
4
4
|
import { jsx } from 'kerfjs/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
var listRoleAttributes = [
|
|
@@ -145,4 +145,4 @@ function List({
|
|
|
145
145
|
|
|
146
146
|
export { List };
|
|
147
147
|
|
|
148
|
-
//# sourceMappingURL=chunk-
|
|
148
|
+
//# sourceMappingURL=chunk-KKMZP3YL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/collections/list/list.tsx"],"names":[],"mappings":";;;;;AAsBA,IAAM,kBAAA,GAAqB;AAAA,EACzB,MAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAM,uBAAA,uBAA8B,GAAA,CAAI;AAAA,EACtC,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,uBAAA;AAAA,EACA,YAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,oBAAA;AAAA,EACA,oBAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACF,CAAC,CAAA;AAmRD,SAAS,iBAAA,CACP,IAAA,EACA,QAAA,EACA,SAAA,EACA,UAAA,EACoC;AACpC,EAAA,IAAI,QAAA,KAAa,MAAA;AACf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,uBAAqB,aAAA,IAAiB,MAAA;AAAA,MACtC,OAAO,KAAA,IAAS,MAAA;AAAA,MAChB,IAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"chunk-WVQDIOD7.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterRootAttributes,\n type StructuralRootAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport {\n type HorizontalAlignment,\n horizontalAlignment,\n type ListVerticalAlignment,\n verticalAlignment,\n} from '../../../shared/layout/flex-alignment.js';\nimport { gapLength } from '../../../shared/layout/gap.js';\nimport type { ScrollClearance } from '../../../shared/layout/scroll-clearance.js';\nimport type { Sides } from '../../../shared/layout/sides.js';\nimport {\n type CssFlex,\n type CssFlexKeyword,\n type CssLength,\n type UiGap,\n} from '../../../shared/styles/css-values.js';\n\n/** Attributes a selectable or landmark List owns: its role and name. */\nconst listRoleAttributes = [\n 'role',\n 'aria-label',\n 'aria-labelledby',\n 'aria-multiselectable',\n];\n\nconst listProtectedAttributes = new Set([\n 'data-component',\n 'data-gap',\n 'data-flex',\n 'data-fill',\n 'data-h-align',\n 'data-v-align',\n 'data-scrollable',\n 'data-scroll-clearance',\n 'data-frame',\n 'data-surface',\n 'data-inset',\n 'data-content-width',\n 'data-content-align',\n 'data-text-insets',\n 'data-control-insets',\n]);\n\ntype ListRootAttributes = StructuralRootAttributes &\n Readonly<{\n 'data-component'?: never;\n 'data-gap'?: never;\n 'data-flex'?: never;\n 'data-fill'?: never;\n 'data-h-align'?: never;\n 'data-v-align'?: never;\n 'data-scrollable'?: never;\n 'data-scroll-clearance'?: never;\n 'data-frame'?: never;\n 'data-surface'?: never;\n 'data-inset'?: never;\n 'data-content-width'?: never;\n 'data-content-align'?: never;\n 'data-text-insets'?: never;\n 'data-control-insets'?: never;\n }>;\n\n/**\n * A solid surface painted behind a List: `base` is the page surface\n * (`--kui-color-surface`), `raised` the raised surface\n * (`--kui-color-surface-raised`). A lowered region is a `SunkenPanel`.\n */\nexport type ListSurface = 'base' | 'raised';\n\n/**\n * A preset inset on all four sides. `document` is the reading inset for long\n * content such as a reader view: 24px block and 32px inline, narrowing to\n * 16px inline below 576px. It replaces any `textInsets`/`controlInsets`.\n */\nexport type ListInset = 'document';\n\n/**\n * A readable measure for a page's content column: `compact` 440px, `medium`\n * 640px, or `wide` 864px of content, the same steps as a catalog example's\n * `contentWidth`.\n */\nexport type ListContentWidth = 'compact' | 'medium' | 'wide';\n\n/**\n * How a List's rows are selected: `single` makes it a labeled\n * `role=\"listbox\"` of options (`SummaryRow`, `ContentItem\n * selectionMode=\"single\"`); `multiple` makes it a labeled multi-select grid\n * of `ContentItem selectionMode=\"multiple\"` rows.\n */\nexport type ListSelectionMode = 'single' | 'multiple';\n\n/**\n * A landmark a List names itself as: `region` renders `role=\"region\"`, for a\n * stack people navigate to by name (a reader, a result picker, a board\n * column); `group` renders `role=\"group\"`, for content that belongs together\n * under one name (a read-only field preview named by its `FieldLabel`). Either\n * takes a name: `ariaLabel`, or `labelledBy`, the id of a visible label.\n */\nexport type ListLandmark = 'region' | 'group';\n\ninterface ListBaseProps {\n children?: KerfUiContent;\n /** Standard gap (`true`), one spacing value, or separate column and row values. Defaults to no gap. */\n gap?: boolean | UiGap;\n /** Allow this list to grow/shrink, use a keyword, or supply a typed CSS flex shorthand. */\n flex?: boolean | CssFlexKeyword | CssFlex;\n /**\n * Fill the height of a parent with a definite height, such as an app root or\n * a fixed-height frame, when this list is that parent's layout root. Inside a\n * flex layout use `flex` instead. Defaults to false.\n */\n fill?: boolean;\n /** Horizontal alignment. Defaults to full to preserve stretch-aligned list children. */\n hAlign?: HorizontalAlignment;\n /** Vertical distribution. Defaults to top. */\n vAlign?: ListVerticalAlignment;\n /**\n * Own vertical scrolling and overscroll containment. Children keep their\n * natural height and scroll instead of shrinking. To bound the list by a\n * `max-height` ancestor (no definite height), give that ancestor a flex\n * column and use `flex`; `fill` needs a definite-height parent.\n */\n scrollable?: boolean;\n /**\n * Clear chrome that lies over this scrollable List's block-start and/or\n * block-end edge, such as a `DialogSurface` floating footer. The List adds\n * the inherited `--kui-scroll-clearance-block-*` context that chrome\n * publishes to its own block padding and `scroll-padding`, so its rows\n * scroll visibly beneath the chrome while the first and last rows (and any\n * row focused or scrolled into view) can still rest clear of it. Opt in only\n * the one scroller that reaches the covered edge. Defaults to none.\n */\n scrollClearance?: ScrollClearance;\n /**\n * Draw a bordered, rounded frame around the stack: a 1px neutral border,\n * the standard control radius, and a 4px inset on every side that keeps the\n * first and last rows' focus rings inside a scrolling frame's clip. It\n * replaces any `inset`/`textInsets`/`controlInsets`. With `scrollable` and\n * `maxHeight` it is a bounded result picker of `ListItem` rows.\n */\n frame?: boolean;\n /**\n * The List's maximum block size, a typed `CssLength` from\n * `@kerfjs/ui/css-values` (such as `rem(14)`). Pair it with `scrollable` so\n * rows beyond it scroll; it bounds the List without a flex-column ancestor.\n */\n maxHeight?: CssLength;\n /**\n * The List's minimum block size, a typed `CssLength` (such as `rem(4.25)`),\n * so a short or empty result set keeps a stable box. Defaults to no minimum.\n */\n minHeight?: CssLength;\n /**\n * Paint a solid surface behind the stack, including its insets: for a strip\n * of chrome (a banner above a sunken work area) that must not show the\n * lowered tint around its content. Omitted, the List is transparent.\n */\n surface?: ListSurface;\n /** Physical divider edges in canonical top/right/bottom/left order. */\n dividerSides?: Sides;\n /** A preset four-sided inset; see `ListInset`. */\n /**\n * Cap the list's content at a readable measure, plus its insets, so a page\n * column needs no application CSS. Composes with `inset=\"document\"`.\n */\n contentWidth?: ListContentWidth;\n /** Where a `contentWidth` column sits: `center` (default) or `start`. */\n contentAlign?: 'start' | 'center';\n inset?: ListInset;\n /** Physical sides that receive the standard 17px text inset. */\n textInsets?: Sides;\n /** Physical sides that receive the standard 8px control inset. Text insets win on overlap. */\n controlInsets?: Sides;\n className?: string;\n /**\n * The list's id, so app code can address it: name it as a\n * `wireScrollDividers` scroller (with a `Toolbar` above it as its chrome),\n * or find it in tests.\n */\n id?: string;\n /**\n * Hide the list (`hidden`), as the region a `ListHeader` toggle with\n * `controls` collapses.\n */\n hidden?: boolean;\n /**\n * Safe `data-*`, `aria-*`, and structural `role` metadata (`aria-busy`, a\n * drop target's role); List-owned structural attributes remain protected,\n * and a selectable or landmark List owns its role and name. Name a region\n * or group with `landmark` and `ariaLabel` or `labelledBy`, which a view\n * document can carry.\n */\n rootAttributes?: ListRootAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\nexport type ListProps = ListBaseProps &\n (\n | {\n /**\n * Make this list a labeled single-select `role=\"listbox\"` of options\n * (`single`) or a labeled multi-select grid of `ContentItem\n * selectionMode=\"multiple\"` rows (`multiple`). Omitted, the List is\n * layout only.\n */\n selectionMode?: never;\n /**\n * Name this list as a landmark: `region` or `group` renders that role,\n * named by `ariaLabel` or `labelledBy`. Not combined with\n * `selectionMode`.\n */\n landmark?: never;\n /**\n * Accessible name for the listbox, grid, or landmark; required with\n * `selectionMode`, or with `landmark` unless `labelledBy` names it.\n */\n ariaLabel?: string;\n /**\n * The id of the visible element that names a landmark List (a\n * `FieldLabel id`), rendered as `aria-labelledby`, in place of\n * `ariaLabel`.\n */\n labelledBy?: never;\n }\n | {\n /**\n * Make this list a labeled single-select `role=\"listbox\"` of options\n * (`single`) or a labeled multi-select grid of `ContentItem\n * selectionMode=\"multiple\"` rows (`multiple`). Omitted, the List is\n * layout only.\n */\n selectionMode: ListSelectionMode;\n /**\n * Name this list as a landmark: `region` or `group` renders that role,\n * named by `ariaLabel` or `labelledBy`. Not combined with\n * `selectionMode`.\n */\n landmark?: never;\n /**\n * Accessible name for the listbox, grid, or landmark; required with\n * `selectionMode`, or with `landmark` unless `labelledBy` names it.\n */\n ariaLabel: string;\n /**\n * The id of the visible element that names a landmark List (a\n * `FieldLabel id`), rendered as `aria-labelledby`, in place of\n * `ariaLabel`.\n */\n labelledBy?: never;\n }\n | {\n /**\n * Make this list a labeled single-select `role=\"listbox\"` of options\n * (`single`) or a labeled multi-select grid of `ContentItem\n * selectionMode=\"multiple\"` rows (`multiple`). Omitted, the List is\n * layout only.\n */\n selectionMode?: never;\n /**\n * Name this list as a landmark: `region` or `group` renders that role,\n * named by `ariaLabel` or `labelledBy`. Not combined with\n * `selectionMode`.\n */\n landmark: ListLandmark;\n /**\n * Accessible name for the listbox, grid, or landmark; required with\n * `selectionMode`, or with `landmark` unless `labelledBy` names it.\n */\n ariaLabel: string;\n /**\n * The id of the visible element that names a landmark List (a\n * `FieldLabel id`), rendered as `aria-labelledby`, in place of\n * `ariaLabel`.\n */\n labelledBy?: never;\n }\n | {\n /**\n * Make this list a labeled single-select `role=\"listbox\"` of options\n * (`single`) or a labeled multi-select grid of `ContentItem\n * selectionMode=\"multiple\"` rows (`multiple`). Omitted, the List is\n * layout only.\n */\n selectionMode?: never;\n /**\n * Name this list as a landmark: `region` or `group` renders that role,\n * named by `ariaLabel` or `labelledBy`. Not combined with\n * `selectionMode`.\n */\n landmark: ListLandmark;\n /**\n * Accessible name for the listbox, grid, or landmark; required with\n * `selectionMode`, or with `landmark` unless `labelledBy` names it.\n */\n ariaLabel?: never;\n /**\n * The id of the visible element that names a landmark List (a\n * `FieldLabel id`), rendered as `aria-labelledby`, in place of\n * `ariaLabel`.\n */\n labelledBy: string;\n }\n );\n\n/**\n * A list's configuration, apart from its content and styling hooks: the props a\n * composite that renders a `List` for the app (the Workbench's `mainHeader` /\n * `mainFooter` chrome) forwards, so the app configures that list instead of\n * styling it. An omitted or `undefined` field keeps the composite's default.\n */\nexport type ListConfig = Pick<\n ListProps,\n 'gap' | 'hAlign' | 'vAlign' | 'dividerSides' | 'textInsets' | 'controlInsets'\n>;\n\nfunction roleAttributesFor(\n mode: ListSelectionMode | undefined,\n landmark: ListLandmark | undefined,\n ariaLabel: string | undefined,\n labelledBy: string | undefined,\n): Record<string, string | undefined> {\n if (landmark !== undefined)\n return {\n role: landmark,\n 'aria-label': ariaLabel,\n 'aria-labelledby': labelledBy,\n };\n switch (mode) {\n case 'single':\n return { role: 'listbox', 'aria-label': ariaLabel };\n case 'multiple':\n return {\n role: 'grid',\n 'aria-label': ariaLabel,\n 'aria-multiselectable': 'true',\n };\n case undefined:\n return {};\n }\n}\n\n/** A stretch-aligned vertical stack with optional gap, flex, fill, scroll, and dividers. */\nexport function List({\n children,\n selectionMode,\n landmark,\n ariaLabel,\n labelledBy,\n gap = false,\n flex = false,\n fill = false,\n hAlign = 'full',\n vAlign = 'top',\n scrollable = false,\n scrollClearance,\n frame = false,\n maxHeight,\n minHeight,\n surface,\n inset,\n contentWidth,\n contentAlign = 'center',\n dividerSides = '',\n textInsets = '',\n controlInsets = '',\n className = '',\n id,\n hidden = false,\n rootAttributes = {},\n slot,\n}: ListProps) {\n if (selectionMode === 'multiple' && !ariaLabel) {\n throw new Error('Multi-select List requires an ariaLabel');\n }\n if (selectionMode === 'single' && !ariaLabel) {\n throw new Error('Single-select List requires an ariaLabel');\n }\n if (landmark !== undefined) {\n if (selectionMode !== undefined) {\n throw new Error('A List landmark cannot also set a selectionMode');\n }\n if (!ariaLabel && !labelledBy)\n throw new Error('List landmark requires an ariaLabel or labelledBy');\n if (ariaLabel && labelledBy)\n throw new Error(\n 'A List landmark takes ariaLabel or labelledBy, not both',\n );\n } else if (labelledBy !== undefined) {\n throw new Error('List labelledBy names a landmark; set landmark too');\n }\n const safeRootAttributes = filterRootAttributes(\n rootAttributes,\n selectionMode || landmark\n ? new Set([...listProtectedAttributes, ...listRoleAttributes])\n : listProtectedAttributes,\n );\n const roleAttributes = roleAttributesFor(\n selectionMode,\n landmark,\n ariaLabel,\n labelledBy,\n );\n const gapStyle =\n gap === true\n ? '--_kui-list-gap:var(--kui-list-gap)'\n : gap === false\n ? ''\n : typeof gap === 'string'\n ? `--_kui-list-gap:${gapLength(gap)}`\n : `--_kui-list-column-gap:${gapLength(gap.column)};--_kui-list-row-gap:${gapLength(gap.row)}`;\n const flexValue = flex === true ? '1 1 auto' : flex || undefined;\n const style = [\n gapStyle,\n flexValue ? `--_kui-list-flex:${flexValue}` : '',\n maxHeight === undefined ? '' : `--_kui-list-max-height:${maxHeight}`,\n minHeight === undefined ? '' : `--_kui-list-min-height:${minHeight}`,\n ]\n .filter(Boolean)\n .join(';');\n\n return (\n <div\n {...safeRootAttributes}\n {...roleAttributes}\n id={id}\n hidden={hidden || undefined}\n class={`kui-list ${className}`.trim()}\n data-component=\"list\"\n data-gap={String(Boolean(gap))}\n data-flex={String(Boolean(flex))}\n data-fill={fill ? 'true' : undefined}\n data-h-align={horizontalAlignment(hAlign)}\n data-v-align={verticalAlignment(vAlign)}\n data-scrollable={String(scrollable)}\n data-scroll-clearance={scrollClearance}\n data-frame={frame ? 'true' : undefined}\n data-surface={surface}\n data-inset={inset}\n data-content-width={contentWidth}\n data-content-align={contentWidth === undefined ? undefined : contentAlign}\n divider-sides={dividerSides || undefined}\n data-text-insets={textInsets || undefined}\n data-control-insets={controlInsets || undefined}\n style={style || undefined}\n slot={slot}\n >\n {children}\n </div>\n );\n}\n\nexport type {\n HorizontalAlignment,\n ListVerticalAlignment,\n VerticalAlignment,\n} from '../../../shared/layout/flex-alignment.js';\nexport type { ScrollClearance } from '../../../shared/layout/scroll-clearance.js';\nexport type { Sides } from '../../../shared/layout/sides.js';\nexport type {\n CssFlex,\n CssFlexKeyword,\n CssLength,\n UiGap,\n UiGapValue,\n UiSpaceName,\n} from '../../../shared/styles/css-values.js';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/collections/list/list.tsx"],"names":[],"mappings":";;;;;AAsBA,IAAM,kBAAA,GAAqB;AAAA,EACzB,MAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAM,uBAAA,uBAA8B,GAAA,CAAI;AAAA,EACtC,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,uBAAA;AAAA,EACA,YAAA;AAAA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AAA,MACd,YAAA,EAAY,KAAA;AAAA,MACZ,oBAAA,EAAoB,YAAA;AAAA,MACpB,oBAAA,EAAoB,YAAA,KAAiB,MAAA,GAAY,MAAA,GAAY,YAAA;AAAA,MAC7D,iBAAe,YAAA,IAAgB,MAAA;AAAA,MAC/B,oBAAkB,UAAA,IAAc,MAAA;AAAA,MAChC,uBAAqB,aAAA,IAAiB,MAAA;AAAA,MACtC,OAAO,KAAA,IAAS,MAAA;AAAA,MAChB,IAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"chunk-KKMZP3YL.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterRootAttributes,\n type StructuralRootAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport {\n type HorizontalAlignment,\n horizontalAlignment,\n type ListVerticalAlignment,\n verticalAlignment,\n} from '../../../shared/layout/flex-alignment.js';\nimport { gapLength } from '../../../shared/layout/gap.js';\nimport type { ScrollClearance } from '../../../shared/layout/scroll-clearance.js';\nimport type { Sides } from '../../../shared/layout/sides.js';\nimport {\n type CssFlex,\n type CssFlexKeyword,\n type CssLength,\n type UiGap,\n} from '../../../shared/styles/css-values.js';\n\n/** Attributes a selectable or landmark List owns: its role and name. */\nconst listRoleAttributes = [\n 'role',\n 'aria-label',\n 'aria-labelledby',\n 'aria-multiselectable',\n];\n\nconst listProtectedAttributes = new Set([\n 'data-component',\n 'data-gap',\n 'data-flex',\n 'data-fill',\n 'data-h-align',\n 'data-v-align',\n 'data-scrollable',\n 'data-scroll-clearance',\n 'data-frame',\n 'data-surface',\n 'data-inset',\n 'data-content-width',\n 'data-content-align',\n 'data-text-insets',\n 'data-control-insets',\n]);\n\ntype ListRootAttributes = StructuralRootAttributes &\n Readonly<{\n 'data-component'?: never;\n 'data-gap'?: never;\n 'data-flex'?: never;\n 'data-fill'?: never;\n 'data-h-align'?: never;\n 'data-v-align'?: never;\n 'data-scrollable'?: never;\n 'data-scroll-clearance'?: never;\n 'data-frame'?: never;\n 'data-surface'?: never;\n 'data-inset'?: never;\n 'data-content-width'?: never;\n 'data-content-align'?: never;\n 'data-text-insets'?: never;\n 'data-control-insets'?: never;\n }>;\n\n/**\n * A solid surface painted behind a List: `base` is the page surface\n * (`--kui-color-surface`), `raised` the raised surface\n * (`--kui-color-surface-raised`). A lowered region is a `SunkenPanel`.\n */\nexport type ListSurface = 'base' | 'raised';\n\n/**\n * A preset inset on all four sides. `document` is the reading inset for long\n * content such as a reader view: 24px block and 32px inline, narrowing to\n * 16px inline below 576px. It replaces any `textInsets`/`controlInsets`.\n */\nexport type ListInset = 'document';\n\n/**\n * A readable measure for a page's content column: `compact` 440px, `medium`\n * 640px, or `wide` 864px of content, the same steps as a catalog example's\n * `contentWidth`.\n */\nexport type ListContentWidth = 'compact' | 'medium' | 'wide';\n\n/**\n * How a List's rows are selected: `single` makes it a labeled\n * `role=\"listbox\"` of options (`SummaryRow`, `ContentItem\n * selectionMode=\"single\"`); `multiple` makes it a labeled multi-select grid\n * of `ContentItem selectionMode=\"multiple\"` rows.\n */\nexport type ListSelectionMode = 'single' | 'multiple';\n\n/**\n * A landmark a List names itself as: `region` renders `role=\"region\"`, for a\n * stack people navigate to by name (a reader, a result picker, a board\n * column); `group` renders `role=\"group\"`, for content that belongs together\n * under one name (a read-only field preview named by its `FieldLabel`). Either\n * takes a name: `ariaLabel`, or `labelledBy`, the id of a visible label.\n */\nexport type ListLandmark = 'region' | 'group';\n\ninterface ListBaseProps {\n children?: KerfUiContent;\n /** Standard gap (`true`), one spacing value, or separate column and row values. Defaults to no gap. */\n gap?: boolean | UiGap;\n /** Allow this list to grow/shrink, use a keyword, or supply a typed CSS flex shorthand. */\n flex?: boolean | CssFlexKeyword | CssFlex;\n /**\n * Fill the height of a parent with a definite height, such as an app root or\n * a fixed-height frame, when this list is that parent's layout root. Inside a\n * flex layout use `flex` instead. Defaults to false.\n */\n fill?: boolean;\n /** Horizontal alignment. Defaults to full to preserve stretch-aligned list children. */\n hAlign?: HorizontalAlignment;\n /** Vertical distribution. Defaults to top. */\n vAlign?: ListVerticalAlignment;\n /**\n * Own vertical scrolling and overscroll containment. Children keep their\n * natural height and scroll instead of shrinking. To bound the list by a\n * `max-height` ancestor (no definite height), give that ancestor a flex\n * column and use `flex`; `fill` needs a definite-height parent.\n */\n scrollable?: boolean;\n /**\n * Clear chrome that lies over this scrollable List's block-start and/or\n * block-end edge, such as a `DialogSurface` floating footer. The List adds\n * the inherited `--kui-scroll-clearance-block-*` context that chrome\n * publishes to its own block padding and `scroll-padding`, so its rows\n * scroll visibly beneath the chrome while the first and last rows (and any\n * row focused or scrolled into view) can still rest clear of it. Opt in only\n * the one scroller that reaches the covered edge. Defaults to none.\n */\n scrollClearance?: ScrollClearance;\n /**\n * Draw a bordered, rounded frame around the stack: a 1px neutral border,\n * the standard control radius, and a 4px inset on every side that keeps the\n * first and last rows' focus rings inside a scrolling frame's clip. It\n * replaces any `inset`/`textInsets`/`controlInsets`. With `scrollable` and\n * `maxHeight` it is a bounded result picker of `ListItem` rows.\n */\n frame?: boolean;\n /**\n * The List's maximum block size, a typed `CssLength` from\n * `@kerfjs/ui/css-values` (such as `rem(14)`). Pair it with `scrollable` so\n * rows beyond it scroll; it bounds the List without a flex-column ancestor.\n */\n maxHeight?: CssLength;\n /**\n * The List's minimum block size, a typed `CssLength` (such as `rem(4.25)`),\n * so a short or empty result set keeps a stable box. Defaults to no minimum.\n */\n minHeight?: CssLength;\n /**\n * Paint a solid surface behind the stack, including its insets: for a strip\n * of chrome (a banner above a sunken work area) that must not show the\n * lowered tint around its content. Omitted, the List is transparent.\n */\n surface?: ListSurface;\n /** Physical divider edges in canonical top/right/bottom/left order. */\n dividerSides?: Sides;\n /** A preset four-sided inset; see `ListInset`. */\n /**\n * Cap the list's content at a readable measure, plus its insets, so a page\n * column needs no application CSS. Composes with `inset=\"document\"`.\n */\n contentWidth?: ListContentWidth;\n /** Where a `contentWidth` column sits: `center` (default) or `start`. */\n contentAlign?: 'start' | 'center';\n inset?: ListInset;\n /** Physical sides that receive the standard 17px text inset. */\n textInsets?: Sides;\n /** Physical sides that receive the standard 8px control inset. Text insets win on overlap. */\n controlInsets?: Sides;\n className?: string;\n /**\n * The list's id, so app code can address it: name it as a\n * `wireScrollDividers` scroller (with a `Toolbar` above it as its chrome),\n * or find it in tests.\n */\n id?: string;\n /**\n * Hide the list (`hidden`), as the region a `ListHeader` toggle with\n * `controls` collapses.\n */\n hidden?: boolean;\n /**\n * Safe `data-*`, `aria-*`, and structural `role` metadata (`aria-busy`, a\n * drop target's role); List-owned structural attributes remain protected,\n * and a selectable or landmark List owns its role and name. Name a region\n * or group with `landmark` and `ariaLabel` or `labelledBy`, which a view\n * document can carry.\n */\n rootAttributes?: ListRootAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\nexport type ListProps = ListBaseProps &\n (\n | {\n /**\n * Make this list a labeled single-select `role=\"listbox\"` of options\n * (`single`) or a labeled multi-select grid of `ContentItem\n * selectionMode=\"multiple\"` rows (`multiple`). Omitted, the List is\n * layout only.\n */\n selectionMode?: never;\n /**\n * Name this list as a landmark: `region` or `group` renders that role,\n * named by `ariaLabel` or `labelledBy`. Not combined with\n * `selectionMode`.\n */\n landmark?: never;\n /**\n * Accessible name for the listbox, grid, or landmark; required with\n * `selectionMode`, or with `landmark` unless `labelledBy` names it.\n */\n ariaLabel?: string;\n /**\n * The id of the visible element that names a landmark List (a\n * `FieldLabel id`), rendered as `aria-labelledby`, in place of\n * `ariaLabel`.\n */\n labelledBy?: never;\n }\n | {\n /**\n * Make this list a labeled single-select `role=\"listbox\"` of options\n * (`single`) or a labeled multi-select grid of `ContentItem\n * selectionMode=\"multiple\"` rows (`multiple`). Omitted, the List is\n * layout only.\n */\n selectionMode: ListSelectionMode;\n /**\n * Name this list as a landmark: `region` or `group` renders that role,\n * named by `ariaLabel` or `labelledBy`. Not combined with\n * `selectionMode`.\n */\n landmark?: never;\n /**\n * Accessible name for the listbox, grid, or landmark; required with\n * `selectionMode`, or with `landmark` unless `labelledBy` names it.\n */\n ariaLabel: string;\n /**\n * The id of the visible element that names a landmark List (a\n * `FieldLabel id`), rendered as `aria-labelledby`, in place of\n * `ariaLabel`.\n */\n labelledBy?: never;\n }\n | {\n /**\n * Make this list a labeled single-select `role=\"listbox\"` of options\n * (`single`) or a labeled multi-select grid of `ContentItem\n * selectionMode=\"multiple\"` rows (`multiple`). Omitted, the List is\n * layout only.\n */\n selectionMode?: never;\n /**\n * Name this list as a landmark: `region` or `group` renders that role,\n * named by `ariaLabel` or `labelledBy`. Not combined with\n * `selectionMode`.\n */\n landmark: ListLandmark;\n /**\n * Accessible name for the listbox, grid, or landmark; required with\n * `selectionMode`, or with `landmark` unless `labelledBy` names it.\n */\n ariaLabel: string;\n /**\n * The id of the visible element that names a landmark List (a\n * `FieldLabel id`), rendered as `aria-labelledby`, in place of\n * `ariaLabel`.\n */\n labelledBy?: never;\n }\n | {\n /**\n * Make this list a labeled single-select `role=\"listbox\"` of options\n * (`single`) or a labeled multi-select grid of `ContentItem\n * selectionMode=\"multiple\"` rows (`multiple`). Omitted, the List is\n * layout only.\n */\n selectionMode?: never;\n /**\n * Name this list as a landmark: `region` or `group` renders that role,\n * named by `ariaLabel` or `labelledBy`. Not combined with\n * `selectionMode`.\n */\n landmark: ListLandmark;\n /**\n * Accessible name for the listbox, grid, or landmark; required with\n * `selectionMode`, or with `landmark` unless `labelledBy` names it.\n */\n ariaLabel?: never;\n /**\n * The id of the visible element that names a landmark List (a\n * `FieldLabel id`), rendered as `aria-labelledby`, in place of\n * `ariaLabel`.\n */\n labelledBy: string;\n }\n );\n\n/**\n * A list's configuration, apart from its content and styling hooks: the props a\n * composite that renders a `List` for the app (the Workbench's `mainHeader` /\n * `mainFooter` chrome) forwards, so the app configures that list instead of\n * styling it. An omitted or `undefined` field keeps the composite's default.\n */\nexport type ListConfig = Pick<\n ListProps,\n 'gap' | 'hAlign' | 'vAlign' | 'dividerSides' | 'textInsets' | 'controlInsets'\n>;\n\nfunction roleAttributesFor(\n mode: ListSelectionMode | undefined,\n landmark: ListLandmark | undefined,\n ariaLabel: string | undefined,\n labelledBy: string | undefined,\n): Record<string, string | undefined> {\n if (landmark !== undefined)\n return {\n role: landmark,\n 'aria-label': ariaLabel,\n 'aria-labelledby': labelledBy,\n };\n switch (mode) {\n case 'single':\n return { role: 'listbox', 'aria-label': ariaLabel };\n case 'multiple':\n return {\n role: 'grid',\n 'aria-label': ariaLabel,\n 'aria-multiselectable': 'true',\n };\n case undefined:\n return {};\n }\n}\n\n/** A stretch-aligned vertical stack with optional gap, flex, fill, scroll, and dividers. */\nexport function List({\n children,\n selectionMode,\n landmark,\n ariaLabel,\n labelledBy,\n gap = false,\n flex = false,\n fill = false,\n hAlign = 'full',\n vAlign = 'top',\n scrollable = false,\n scrollClearance,\n frame = false,\n maxHeight,\n minHeight,\n surface,\n inset,\n contentWidth,\n contentAlign = 'center',\n dividerSides = '',\n textInsets = '',\n controlInsets = '',\n className = '',\n id,\n hidden = false,\n rootAttributes = {},\n slot,\n}: ListProps) {\n if (selectionMode === 'multiple' && !ariaLabel) {\n throw new Error('Multi-select List requires an ariaLabel');\n }\n if (selectionMode === 'single' && !ariaLabel) {\n throw new Error('Single-select List requires an ariaLabel');\n }\n if (landmark !== undefined) {\n if (selectionMode !== undefined) {\n throw new Error('A List landmark cannot also set a selectionMode');\n }\n if (!ariaLabel && !labelledBy)\n throw new Error('List landmark requires an ariaLabel or labelledBy');\n if (ariaLabel && labelledBy)\n throw new Error(\n 'A List landmark takes ariaLabel or labelledBy, not both',\n );\n } else if (labelledBy !== undefined) {\n throw new Error('List labelledBy names a landmark; set landmark too');\n }\n const safeRootAttributes = filterRootAttributes(\n rootAttributes,\n selectionMode || landmark\n ? new Set([...listProtectedAttributes, ...listRoleAttributes])\n : listProtectedAttributes,\n );\n const roleAttributes = roleAttributesFor(\n selectionMode,\n landmark,\n ariaLabel,\n labelledBy,\n );\n const gapStyle =\n gap === true\n ? '--_kui-list-gap:var(--kui-list-gap)'\n : gap === false\n ? ''\n : typeof gap === 'string'\n ? `--_kui-list-gap:${gapLength(gap)}`\n : `--_kui-list-column-gap:${gapLength(gap.column)};--_kui-list-row-gap:${gapLength(gap.row)}`;\n const flexValue = flex === true ? '1 1 auto' : flex || undefined;\n const style = [\n gapStyle,\n flexValue ? `--_kui-list-flex:${flexValue}` : '',\n maxHeight === undefined ? '' : `--_kui-list-max-height:${maxHeight}`,\n minHeight === undefined ? '' : `--_kui-list-min-height:${minHeight}`,\n ]\n .filter(Boolean)\n .join(';');\n\n return (\n <div\n {...safeRootAttributes}\n {...roleAttributes}\n id={id}\n hidden={hidden || undefined}\n class={`kui-list ${className}`.trim()}\n data-component=\"list\"\n data-gap={String(Boolean(gap))}\n data-flex={String(Boolean(flex))}\n data-fill={fill ? 'true' : undefined}\n data-h-align={horizontalAlignment(hAlign)}\n data-v-align={verticalAlignment(vAlign)}\n data-scrollable={String(scrollable)}\n data-scroll-clearance={scrollClearance}\n data-frame={frame ? 'true' : undefined}\n data-surface={surface}\n data-inset={inset}\n data-content-width={contentWidth}\n data-content-align={contentWidth === undefined ? undefined : contentAlign}\n divider-sides={dividerSides || undefined}\n data-text-insets={textInsets || undefined}\n data-control-insets={controlInsets || undefined}\n style={style || undefined}\n slot={slot}\n >\n {children}\n </div>\n );\n}\n\nexport type {\n HorizontalAlignment,\n ListVerticalAlignment,\n VerticalAlignment,\n} from '../../../shared/layout/flex-alignment.js';\nexport type { ScrollClearance } from '../../../shared/layout/scroll-clearance.js';\nexport type { Sides } from '../../../shared/layout/sides.js';\nexport type {\n CssFlex,\n CssFlexKeyword,\n CssLength,\n UiGap,\n UiGapValue,\n UiSpaceName,\n} from '../../../shared/styles/css-values.js';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Skeleton } from './chunk-
|
|
1
|
+
import { Skeleton } from './chunk-LH7YRRY7.js';
|
|
2
2
|
import { em } from './chunk-IQSRHXZR.js';
|
|
3
|
-
import { filterDataAttributes } from './chunk-
|
|
3
|
+
import { filterDataAttributes } from './chunk-BRDTP3RT.js';
|
|
4
4
|
import { jsxs, jsx } from 'kerfjs/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
var VALUE_TABLE_ROW_PROTECTED = /* @__PURE__ */ new Set([
|
|
@@ -73,4 +73,4 @@ function ValueTable({
|
|
|
73
73
|
|
|
74
74
|
export { ValueTable, ValueTableRow };
|
|
75
75
|
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-KZEHTRPC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/value-table/internal/value-table-row.tsx","../src/components/data-display/value-table/value-table.tsx"],"names":["jsx"],"mappings":";;;;;AAuBA,IAAM,yBAAA,uBAAgC,GAAA,CAAI;AAAA,EACxC,gBAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC,CAAA;AAEM,SAAS,aAAA,CAAc;AAAA,EAC5B,KAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,WAAA,GAAc,KAAA;AAAA,EACd,IAAA;AAAA,EACA,iBAAiB;AACnB,CAAA,EAAuB;AACrB,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,oBAAA,CAAqB,cAAA,EAAgB,yBAAyB,CAAA;AAAA,MAClE,KAAA,EAAO,CAAA,qBAAA,EAAwB,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MAChD,eAAA,EAAe,MAAA,CAAO,OAAA,CAAQ,IAAI,CAAC,CAAA;AAAA,MACnC,kBAAA,EAAkB,cAAc,MAAA,GAAS,MAAA;AAAA,MACzC,IAAA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,IAAA,EAAA,EACE,QAAA,EAAA;AAAA,UAAA,IAAA,oBAAQ,GAAA,CAAC,M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AAA,MAEhD,YAAA,EAAY,KAAA;AAAA,MACZ,IAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"chunk-KZEHTRPC.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../../shared/dom/extension-attributes.js';\nimport { em } from '../../../../shared/styles/css-values.js';\nimport { Skeleton } from '../../../feedback/skeleton/skeleton.js';\n\nexport interface ValueTableRowProps {\n label: string | SafeHtml;\n value: string | SafeHtml;\n icon?: SafeHtml;\n className?: string;\n /** Render the value as an unanimated loading skeleton, keeping the field label. */\n placeholder?: boolean;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or a\n * test hook; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst VALUE_TABLE_ROW_PROTECTED = new Set([\n 'data-component',\n 'data-has-icon',\n 'data-placeholder',\n]);\n\nexport function ValueTableRow({\n label,\n value,\n icon,\n className = '',\n placeholder = false,\n slot,\n rootAttributes = {},\n}: ValueTableRowProps) {\n return (\n <div\n {...filterDataAttributes(rootAttributes, VALUE_TABLE_ROW_PROTECTED)}\n class={`kui-value-table__row ${className}`.trim()}\n data-has-icon={String(Boolean(icon))}\n data-placeholder={placeholder ? 'true' : undefined}\n slot={slot}\n >\n <dt>\n {icon && <span class=\"kui-value-table__icon\">{icon}</span>}\n <span class=\"kui-value-table__label\">{label}</span>\n </dt>\n <dd>{placeholder ? <Skeleton width={em(10)} /> : value}</dd>\n </div>\n );\n}\n","import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport type { CssLength } from '../../../shared/styles/css-values.js';\n\nexport {\n ValueTableRow,\n type ValueTableRowProps,\n} from './internal/value-table-row.js';\n\n/** `columns` keeps label and value side by side; `stacked` puts each value under its label. */\nexport type ValueTablePresentation = 'columns' | 'stacked';\n/** Table width below which columns stack: `compact` is 512px, `narrow` 576px. */\nexport type ValueTableStackBelow = 'compact' | 'narrow';\n\nexport interface ValueTableProps {\n label: string;\n /** Compact row spacing for metadata-dense surfaces. */\n density?: 'default' | 'compact';\n /**\n * Minimum width of the label column (for example `px(160)`); the value then\n * takes the rest of the row. Omitted, label and value share the row by\n * content.\n */\n labelWidth?: CssLength;\n /** Side-by-side columns (default) or values stacked under their labels. */\n presentation?: ValueTablePresentation;\n /**\n * Stack the rows only while the table itself is narrower than the preset,\n * so one table reads as columns in a wide dialog and stacks on a phone.\n */\n stackBelow?: ValueTableStackBelow;\n className?: string;\n children: KerfUiContent;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or a\n * test hook; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst VALUE_TABLE_PROTECTED = new Set([\n 'data-component',\n 'data-density',\n 'data-label-width',\n 'data-presentation',\n 'data-stack-below',\n]);\n\nexport function ValueTable({\n label,\n density = 'default',\n labelWidth,\n presentation = 'columns',\n stackBelow,\n className = '',\n children,\n slot,\n rootAttributes = {},\n}: ValueTableProps) {\n return (\n <dl\n {...filterDataAttributes(rootAttributes, VALUE_TABLE_PROTECTED)}\n class={`kui-value-table ${className}`.trim()}\n data-component=\"value-table\"\n data-density={density}\n data-presentation={presentation}\n data-stack-below={stackBelow}\n data-label-width={labelWidth === undefined ? undefined : ''}\n style={\n labelWidth === undefined\n ? undefined\n : `--_kui-value-table-label-min:${labelWidth}`\n }\n aria-label={label}\n slot={slot}\n >\n {children}\n </dl>\n );\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { checkedAnchorName } from './chunk-DKPYHVIV.js';
|
|
|
2
2
|
import { scrollEdgeAttributes } from './chunk-IRC5N7FA.js';
|
|
3
3
|
import { ensureSunkenTexture } from './chunk-IKS72C6P.js';
|
|
4
4
|
import { surfaceTintAttributes, joinStyles } from './chunk-M72QLDUO.js';
|
|
5
|
-
import { filterDataAttributes } from './chunk-
|
|
5
|
+
import { filterDataAttributes } from './chunk-BRDTP3RT.js';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'kerfjs/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
var paneProtectedAttributes = /* @__PURE__ */ new Set([
|
|
@@ -167,4 +167,4 @@ function Pane({
|
|
|
167
167
|
|
|
168
168
|
export { Pane };
|
|
169
169
|
|
|
170
|
-
//# sourceMappingURL=chunk-
|
|
170
|
+
//# sourceMappingURL=chunk-LH5V6XGH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/layout/pane/pane.tsx"],"names":[],"mappings":";;;;;;;AAiCA,IAAM,uBAAA,uBAA8B,GAAA,CAAI;AAAA,EACtC,gBAAA;AAAA,EACA,uBAAA;AAAA,EACA,WAAA;AAAA,EACA,uBAAA;AAAA,EACA,qBAAA;AAAA,EACA,qBAAA;AAAA,EACA,0BAAA;AAAA,EACA,0BAAA;AAAA,EACA,sBAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,sBAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,uBAAA;AAAA,EACA,0BAAA;AAAA,EACA,sBAAA;AAAA,EACA,kBAAA;AAAA,EACA,2BAAA;AAAA,EACA,qBAAA;AAAA,EACA,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,6BAAA;AAAA,EACA,2BAAA;AAAA,EACA,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,6BAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,YAAA,GAA6C;AAAA,EACjD,aAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAiRA,SAAS,WAAA,CACP,OAAA,EACA,QAAA,EACA,SAAA,EACA,KAAA,EACA;AACA,EAAA,MAAM,UAAA,GAAa;AAAA,IACjB,KAAA,EAAO,CAAA,8BAAA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ACjE,EAAA,IAAI,YAAY,OAAA,EAAS,2BAAQ,OAAA,EAAA,EAAO,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AAC7D,EAAA,IAAI,YAAY,MAAA,EAAQ,2BAAQ,MAAA,EAAA,EAAM,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AAC3D,EAAA,IAAI,YAAY,SAAA,EAAW,2BAAQ,SAAA,EAAA,EAAS,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AACjE,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAK,GAAG,UAAA,EAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AACpC","file":"chunk-KACJOE2N.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport { filterDataAttributes } from '../../../shared/dom/extension-attributes.js';\nimport type { ScrollClearance } from '../../../shared/layout/scroll-clearance.js';\nimport {\n type ScrollEdge,\n scrollEdgeAttributes,\n} from '../../../shared/layout/scroll-edge.js';\nimport {\n type AnchorName,\n checkedAnchorName,\n} from '../../../shared/styles/anchor-name.js';\nimport type { CssColor } from '../../../shared/styles/css-values.js';\nimport { ensureSunkenTexture } from '../../../shared/styles/sunken-texture.js';\nimport {\n joinStyles,\n type SurfaceTint,\n surfaceTintAttributes,\n type SurfaceTintScheme,\n} from '../../../shared/styles/surface-tint.js';\n\n/**\n * Logical pane sides: where a {@link Pane} can show a separator and where it can\n * compensate for a device safe-area inset.\n */\nexport type PaneSeparatorSide =\n 'block-start' | 'block-end' | 'inline-start' | 'inline-end';\n\n/** Semantic root elements supported by {@link Pane}. */\nexport type PaneElement = 'article' | 'aside' | 'div' | 'main' | 'section';\n\n/** Semantic elements supported by the scrolling content slot. */\nexport type PaneContentElement = 'div' | 'main' | 'nav' | 'section';\n\nconst paneProtectedAttributes = new Set([\n 'data-component',\n 'data-scroll-anchoring',\n 'data-fill',\n 'data-chrome-placement',\n 'data-compact-header',\n 'data-compact-footer',\n 'data-compact-header-open',\n 'data-compact-footer-open',\n 'data-chrome-dividers',\n 'data-appearance',\n 'data-background',\n 'data-kui-tint',\n 'data-kui-tint-accent',\n 'data-deep-inset',\n 'data-outlined',\n 'data-scroll-clearance',\n 'data-header-presentation',\n 'data-header-material',\n 'data-scroll-edge',\n 'data-scroll-edge-distance',\n 'data-header-overlay',\n 'data-separator-block-start',\n 'data-separator-block-end',\n 'data-separator-inline-start',\n 'data-separator-inline-end',\n 'data-safe-area-block-start',\n 'data-safe-area-block-end',\n 'data-safe-area-inline-start',\n 'data-safe-area-inline-end',\n]);\n\nconst allPaneSides: readonly PaneSeparatorSide[] = [\n 'block-start',\n 'block-end',\n 'inline-start',\n 'inline-end',\n];\n\ntype PaneRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-fill'?: never;\n 'data-separator-block-start'?: never;\n 'data-separator-block-end'?: never;\n 'data-separator-inline-start'?: never;\n 'data-separator-inline-end'?: never;\n 'data-safe-area-block-start'?: never;\n 'data-safe-area-block-end'?: never;\n 'data-safe-area-inline-start'?: never;\n 'data-safe-area-inline-end'?: never;\n 'data-chrome-placement'?: never;\n 'data-chrome-dividers'?: never;\n 'data-appearance'?: never;\n 'data-background'?: never;\n 'data-kui-tint'?: never;\n 'data-kui-tint-accent'?: never;\n 'data-deep-inset'?: never;\n 'data-outlined'?: never;\n 'data-scroll-clearance'?: never;\n 'data-header-presentation'?: never;\n 'data-header-material'?: never;\n 'data-scroll-edge'?: never;\n 'data-scroll-edge-distance'?: never;\n 'data-header-overlay'?: never;\n 'data-compact-header'?: never;\n 'data-compact-footer'?: never;\n 'data-compact-header-open'?: never;\n 'data-compact-footer-open'?: never;\n }\n>;\n\n/** How a Pane's header and footer relate to its scrolling content. */\nexport type PaneChromePlacement = 'fixed' | 'auto';\n\n/**\n * How a header or footer behaves when the pane's container presents\n * compactly (a `NavStack` view, a `TabNavigator` scene, a full-screen dialog,\n * or a compact `Workbench`): `fixed` stays docked and shrinks the content\n * area; `scroll` sits inline with the content (a footer settles at the end\n * and scrolls past when the content is longer); `overlay` lies over the\n * content on the chrome material, shown only while the app opens it.\n */\nexport type PaneCompactChrome = 'fixed' | 'scroll' | 'overlay';\n\n/** The compact chrome policy for a Pane's header and footer. */\nexport interface PaneCompactChromePolicy {\n header?: PaneCompactChrome;\n footer?: PaneCompactChrome;\n}\n\n/**\n * When a Pane draws the divider between its pinned header or footer and its\n * scrolling content: `scroll` while content is scrolled away beneath that\n * chrome, as `wireScrollDividers` reports; `always`; or `none`.\n */\nexport type PaneChromeDividers = 'scroll' | 'always' | 'none';\n\n/**\n * How a Pane's header relates to its scrolling content: `docked` in its own\n * row above the content, or `overlay` laid over the content's top edge on the\n * translucent chrome material, so content scrolls visibly beneath it.\n * `clear` lays it over\n * the same edge fully transparent, for chrome over imagery: legibility comes\n * from glass control groups or a scrim, and with `scrollEdge=\"material\"` the\n * chrome material fades in once content scrolls beneath it.\n */\nexport type PaneHeaderPresentation = 'docked' | 'overlay' | 'clear';\n\n/** Background treatment of the Pane's scrolling work surface. */\nexport type PaneAppearance = 'default' | 'sunken';\n\n/** Whether a Pane's scrolling content keeps the browser's scroll anchoring. */\nexport type PaneScrollAnchoring = 'auto' | 'none';\n\nexport interface PaneProps {\n /** Optional fixed chrome above the scrolling content, arranged vertically. */\n header?: KerfUiContent;\n /** The pane's primary vertical, scrolling content stack. */\n children?: KerfUiContent;\n /** Optional fixed chrome below the scrolling content. */\n footer?: KerfUiContent;\n /**\n * Fill the height of a parent with a definite height, such as an app root\n * (`.kui-app-root`), a `SizedRegion`, or a grid cell, or take the rest of a\n * flex column. The header and footer stay pinned and the content scrolls\n * between them, as in a NavStack view or Workbench region (which fill their\n * Pane without this prop). Defaults to false: the pane takes its content's\n * height.\n */\n fill?: boolean;\n /**\n * Whether the header and footer stay pinned around the scrolling content.\n * `fixed` (default) always pins them. `auto` pins them while the pane is\n * tall enough, and below 480px of height (30rem, so it scales with the text\n * size) lets the whole pane scroll as one column, so tall chrome can never\n * squeeze the content to nothing.\n */\n chromePlacement?: PaneChromePlacement;\n /**\n * The divider under the header and over the footer, where they meet the\n * scrolling content. Omitted defaults to `scroll` for a plain pane and\n * `always` for `appearance=\"sunken\"`. `scroll` shows the header's divider only\n * while the content is scrolled down, and the footer's only while more\n * content lies below — never when the content fits — once\n * `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is wired above\n * the pane; unwired, neither shows. `always` shows both; `none` neither.\n * The line is drawn inside the chrome, so no state moves the content.\n */\n chromeDividers?: PaneChromeDividers;\n /**\n * `docked` (default) gives the header its own row above the scrolling\n * content. `overlay` lays the header over the content's top edge on the\n * translucent chrome material (`--kui-chrome-material`, opaque under\n * `prefers-reduced-transparency`, forced colors, or without\n * `backdrop-filter`), so content scrolls visibly beneath it. Once\n * `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is wired above\n * the pane it measures the header and publishes its height as the\n * `--kui-scroll-clearance-block-start` context, which the content adds to\n * its block-start padding and `scroll-padding` without any\n * `scrollClearance` prop, so the first item, and anything focused or\n * scrolled into view, rests clear of the header. Until then, and with\n * `chromePlacement=\"auto\"`, the header stays docked. Keep overlay header\n * text in the normal text color: quiet text can fall below AA over the\n * content passing beneath it.\n */\n /**\n * What the header and footer do when the pane's container presents\n * compactly (default `fixed`); roomy containers ignore it. The container\n * interprets it, so set it on panes inside a `NavStack`, `TabNavigator`,\n * full-screen dialog, or `Workbench`.\n */\n compactChrome?: PaneCompactChromePolicy;\n /**\n * Which `overlay` compact chrome is showing. The app owns it and flips it\n * from a control the person can reach while the chrome is hidden.\n */\n compactChromeOpen?: { header?: boolean; footer?: boolean };\n headerPresentation?: PaneHeaderPresentation;\n /**\n * With `headerPresentation=\"clear\"`, `material` fades the chrome material\n * in behind the header once content scrolls beneath it (default `none`).\n */\n scrollEdge?: ScrollEdge;\n /**\n * The scroll distance, in CSS pixels, over which the scroll edge fades in\n * (default 60).\n */\n scrollEdgeDistance?: number;\n /** Paint the scrolling work surface with the shared lowered-surface color. */\n appearance?: PaneAppearance;\n /**\n * Paint the whole pane, header and footer included, in an app-chosen color\n * (`uiColor('surface-raised')`, `fillColor('#1f2a44')`, or `colorVar(…)`\n * from `@kerfjs/ui/css-values`). It replaces the appearance's fill: a sunken\n * pane drops its lowered color and grain. Omitted, the pane keeps its\n * default (transparent, or the sunken surface). Forced colors paint\n * `Canvas`. Keep text at AA over the color; a dark color needs a matching\n * tint or dark tones for its content.\n */\n background?: CssColor;\n /**\n * A scoped tint: `{ color, scheme }`, the app's color and the scheme it\n * belongs to. The pane paints the tinted surface (unless `background` is\n * set) and its whole subtree, chrome material and quiet fills included,\n * re-derives its surface and text tokens from the color with lightness\n * clamped to keep text at WCAG AA. Without relative color syntax, or under\n * `prefers-contrast: more`, the scope keeps the plain palette in the\n * declared scheme.\n */\n tint?: SurfaceTint;\n /**\n * Scope this surface and its subtree to the light or dark palette, whatever\n * the page's scheme (a light card on a dark page). A `tint` already sets\n * its scheme; pass `scheme` alone for the plain palette, or with a tint\n * only when they agree.\n */\n scheme?: SurfaceTintScheme;\n /**\n * Clear chrome that lies over the scrolling content's block-start and/or\n * block-end edge, such as a `DialogSurface` floating footer over a filling\n * Pane. The content scroller adds the inherited\n * `--kui-scroll-clearance-block-*` context that chrome publishes to its block\n * padding and `scroll-padding`, so content scrolls visibly beneath the chrome\n * while its first and last items (and anything focused or scrolled into\n * view) can still rest clear of it. Defaults to none.\n */\n scrollClearance?: ScrollClearance;\n /** Add 8px to every side of scrolling content (default: false). */\n deepInset?: boolean;\n /** Opt into keyboard (`0`) or programmatic (`-1`) focus on the Pane root. */\n tabIndex?: 0 | -1;\n /**\n * Names the Pane root as a CSS anchor (`anchor-name`): a dashed ident such\n * as `--app-main`. A surface that docks to a named anchor, such as a\n * `PopoverDialogSurface` with the same `anchorName`, then docks to this\n * pane, so the app names its main column without CSS. A Workbench work\n * area, panel, or NavStack view takes it through its `PaneConfig`.\n */\n anchorName?: AnchorName;\n /**\n * The scrolling content's CSS scroll anchoring (`overflow-anchor`). `auto`\n * (the default) keeps the browser's anchoring, which holds visible content\n * still when something above it grows or shrinks. `none` opts the pane\n * out: use it for a pane whose own edits insert or remove rows above the\n * reader, where Safari can apply a late anchoring jump on an unrelated\n * reflow, such as an inspector. A Workbench panel, work area, or NavStack\n * view takes it through its `PaneConfig`.\n */\n scrollAnchoring?: PaneScrollAnchoring;\n /** Keep the standard focus outline visible, such as for a drop target. */\n outlined?: boolean;\n /** Root semantics. Defaults to `div`. */\n element?: PaneElement;\n /** Scrolling content semantics. Defaults to `div`. */\n contentElement?: PaneContentElement;\n /** Independent logical-edge separator lines. Defaults to none. */\n separators?: readonly PaneSeparatorSide[];\n /**\n * Sides on which the pane may compensate for a device safe-area inset.\n * Defaults to every side: the pane pads its slots for each side that still\n * reaches an unsafe screen edge, as its surrounding layout reports, while its\n * background and separators paint through. List only the sides an app-owned\n * layout places at a screen edge, or pass `[]` to opt out.\n */\n safeAreaEdges?: readonly PaneSeparatorSide[];\n id?: string;\n /** Accessible name for a landmark root such as `aside` or `main`. */\n label?: string;\n /** Accessible name for a landmark scrolling slot such as `nav`. */\n contentLabel?: string;\n className?: string;\n headerClassName?: string;\n contentClassName?: string;\n footerClassName?: string;\n /** Safe `data-*` metadata; Pane-owned structural attributes remain protected. */\n rootAttributes?: PaneRootAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/**\n * A pane's configuration, apart from its content and styling hooks: the props a\n * composite that renders a `Pane` for the app (a Workbench panel or work area,\n * or a CollapsiblePanel) forwards, so the app configures that pane instead of\n * styling it. An omitted or `undefined` field keeps the composite's default.\n */\nexport type PaneConfig = Pick<\n PaneProps,\n | 'contentElement'\n | 'contentLabel'\n | 'separators'\n | 'safeAreaEdges'\n | 'chromeDividers'\n | 'compactChrome'\n | 'compactChromeOpen'\n | 'headerPresentation'\n | 'scrollEdge'\n | 'scrollEdgeDistance'\n | 'appearance'\n | 'background'\n | 'tint'\n | 'deepInset'\n | 'scrollClearance'\n | 'tabIndex'\n | 'outlined'\n | 'anchorName'\n | 'scrollAnchoring'\n>;\n\nfunction paneContent(\n element: PaneContentElement,\n children: KerfUiContent,\n className: string,\n label: string | undefined,\n) {\n const attributes = {\n class: `kui-pane__content kui-content ${className}`.trim(),\n 'aria-label': label,\n };\n if (element === 'main') return <main {...attributes}>{children}</main>;\n if (element === 'nav') return <nav {...attributes}>{children}</nav>;\n if (element === 'section')\n return <section {...attributes}>{children}</section>;\n return <div {...attributes}>{children}</div>;\n}\n\n/**\n * An unpadded application column with optional fixed header/footer slots and one\n * scrolling vertical content owner. Separator lines are independently opt-in on\n * each logical edge, so the same component works as a sidebar, main area,\n * inspector, or dialog column.\n */\nexport function Pane({\n header,\n children,\n footer,\n fill = false,\n chromePlacement = 'fixed',\n chromeDividers,\n compactChrome = {},\n compactChromeOpen = {},\n headerPresentation = 'docked',\n scrollEdge = 'none',\n scrollEdgeDistance,\n appearance = 'default',\n background,\n tint,\n scheme,\n deepInset = false,\n scrollClearance,\n tabIndex,\n anchorName,\n scrollAnchoring = 'auto',\n outlined = false,\n element = 'div',\n contentElement = 'div',\n separators = [],\n safeAreaEdges = allPaneSides,\n id,\n label,\n contentLabel,\n className = '',\n headerClassName = '',\n contentClassName = '',\n footerClassName = '',\n rootAttributes = {},\n slot,\n}: PaneProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n paneProtectedAttributes,\n );\n const content = paneContent(\n contentElement,\n children,\n contentClassName,\n contentLabel,\n );\n const resolvedChromeDividers =\n chromeDividers ?? (appearance === 'sunken' ? 'always' : 'scroll');\n if (appearance === 'sunken' && background === undefined)\n ensureSunkenTexture();\n const tinted = surfaceTintAttributes(tint, scheme);\n const clearHeader = headerPresentation === 'clear' && header !== undefined;\n const body = (\n <>\n {header === undefined ? null : (\n <header\n class={`kui-pane__header kui-pane__toolbar ${headerClassName}`.trim()}\n >\n {header}\n </header>\n )}\n {content}\n {footer === undefined ? null : (\n <footer class={`kui-pane__footer ${footerClassName}`.trim()}>\n {footer}\n </footer>\n )}\n </>\n );\n const attributes = {\n ...safeRootAttributes,\n class: `kui-pane ${tinted.className} ${className}`\n .replace(/\\s+/g, ' ')\n .trim(),\n id,\n 'data-component': 'pane',\n 'data-fill': fill ? 'true' : undefined,\n 'data-appearance': appearance === 'sunken' ? 'sunken' : undefined,\n 'data-background': background === undefined ? undefined : '',\n 'data-kui-tint': tinted['data-kui-tint'],\n 'data-kui-tint-accent': tinted['data-kui-tint-accent'],\n 'data-kui-scheme': tinted['data-kui-scheme'],\n style: joinStyles(\n background === undefined\n ? undefined\n : `--_kui-pane-background:${background}`,\n tinted.style,\n anchorName === undefined\n ? undefined\n : `anchor-name:${checkedAnchorName(anchorName, 'Pane anchorName')}`,\n ),\n 'data-deep-inset': deepInset ? 'true' : undefined,\n 'data-outlined': outlined ? 'true' : undefined,\n 'data-scroll-anchoring': scrollAnchoring === 'none' ? 'none' : undefined,\n 'data-scroll-clearance': scrollClearance,\n 'data-header-presentation':\n headerPresentation !== 'docked' && header !== undefined\n ? 'overlay'\n : undefined,\n 'data-header-material': clearHeader ? 'clear' : undefined,\n ...scrollEdgeAttributes(scrollEdge, scrollEdgeDistance, clearHeader),\n 'data-chrome-placement': chromePlacement === 'auto' ? 'auto' : undefined,\n 'data-compact-header':\n header !== undefined && compactChrome.header !== 'fixed'\n ? compactChrome.header\n : undefined,\n 'data-compact-footer':\n footer !== undefined && compactChrome.footer !== 'fixed'\n ? compactChrome.footer\n : undefined,\n 'data-compact-header-open':\n compactChrome.header === 'overlay' && compactChromeOpen.header\n ? ''\n : undefined,\n 'data-compact-footer-open':\n compactChrome.footer === 'overlay' && compactChromeOpen.footer\n ? ''\n : undefined,\n 'data-chrome-dividers':\n resolvedChromeDividers === 'always' || resolvedChromeDividers === 'none'\n ? resolvedChromeDividers\n : undefined,\n 'data-separator-block-start': String(separators.includes('block-start')),\n 'data-separator-block-end': String(separators.includes('block-end')),\n 'data-separator-inline-start': String(separators.includes('inline-start')),\n 'data-separator-inline-end': String(separators.includes('inline-end')),\n 'data-safe-area-block-start': String(safeAreaEdges.includes('block-start')),\n 'data-safe-area-block-end': String(safeAreaEdges.includes('block-end')),\n 'data-safe-area-inline-start': String(\n safeAreaEdges.includes('inline-start'),\n ),\n 'data-safe-area-inline-end': String(safeAreaEdges.includes('inline-end')),\n 'aria-label': label,\n tabindex: tabIndex,\n slot,\n };\n\n if (element === 'article') return <article {...attributes}>{body}</article>;\n if (element === 'aside') return <aside {...attributes}>{body}</aside>;\n if (element === 'main') return <main {...attributes}>{body}</main>;\n if (element === 'section') return <section {...attributes}>{body}</section>;\n return <div {...attributes}>{body}</div>;\n}\n\nexport type { ScrollClearance } from '../../../shared/layout/scroll-clearance.js';\nexport type { ScrollEdge } from '../../../shared/layout/scroll-edge.js';\nexport type {\n SurfaceTint,\n SurfaceTintScheme,\n} from '../../../shared/styles/surface-tint.js';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/layout/pane/pane.tsx"],"names":[],"mappings":";;;;;;;AAiCA,IAAM,uBAAA,uBAA8B,GAAA,CAAI;AAAA,EACtC,gBAAA;AAAA,EACA,uBAAA;AAAA,EACA,WAAA;AAAA,EACA,uBAAA;AAAA,EACA,qBAAA;AAAA,EACA,qBAAA;AAAA,EACA,0BAAA;AAAA,EACA,0BAAA;AAAA,EACA,sBAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,sBAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,uBAAA;AAAA,EACA,0BAAA;AAAA,EACA,sBAAA;AAAA,EACA,kBAAA;AAAA,EACA,2BAAA;AAAA,EACA,qBAAA;AAAA,EACA,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,6BAAA;AAAA,EACA,2BAAA;AAAA,EACA,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,6BAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,YAAA,GAA6C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S,YAAY,CAAC,CAAA;AAAA,IACxE,YAAA,EAAc,KAAA;AAAA,IACd,QAAA,EAAU,QAAA;AAAA,IACV;AAAA,GACF;AAEA,EAAA,IAAI,YAAY,SAAA,EAAW,2BAAQ,SAAA,EAAA,EAAS,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AACjE,EAAA,IAAI,YAAY,OAAA,EAAS,2BAAQ,OAAA,EAAA,EAAO,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AAC7D,EAAA,IAAI,YAAY,MAAA,EAAQ,2BAAQ,MAAA,EAAA,EAAM,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AAC3D,EAAA,IAAI,YAAY,SAAA,EAAW,2BAAQ,SAAA,EAAA,EAAS,GAAG,YAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AACjE,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAK,GAAG,UAAA,EAAa,QAAA,EAAA,IAAA,EAAK,CAAA;AACpC","file":"chunk-LH5V6XGH.js","sourcesContent":["import type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport { filterDataAttributes } from '../../../shared/dom/extension-attributes.js';\nimport type { ScrollClearance } from '../../../shared/layout/scroll-clearance.js';\nimport {\n type ScrollEdge,\n scrollEdgeAttributes,\n} from '../../../shared/layout/scroll-edge.js';\nimport {\n type AnchorName,\n checkedAnchorName,\n} from '../../../shared/styles/anchor-name.js';\nimport type { CssColor } from '../../../shared/styles/css-values.js';\nimport { ensureSunkenTexture } from '../../../shared/styles/sunken-texture.js';\nimport {\n joinStyles,\n type SurfaceTint,\n surfaceTintAttributes,\n type SurfaceTintScheme,\n} from '../../../shared/styles/surface-tint.js';\n\n/**\n * Logical pane sides: where a {@link Pane} can show a separator and where it can\n * compensate for a device safe-area inset.\n */\nexport type PaneSeparatorSide =\n 'block-start' | 'block-end' | 'inline-start' | 'inline-end';\n\n/** Semantic root elements supported by {@link Pane}. */\nexport type PaneElement = 'article' | 'aside' | 'div' | 'main' | 'section';\n\n/** Semantic elements supported by the scrolling content slot. */\nexport type PaneContentElement = 'div' | 'main' | 'nav' | 'section';\n\nconst paneProtectedAttributes = new Set([\n 'data-component',\n 'data-scroll-anchoring',\n 'data-fill',\n 'data-chrome-placement',\n 'data-compact-header',\n 'data-compact-footer',\n 'data-compact-header-open',\n 'data-compact-footer-open',\n 'data-chrome-dividers',\n 'data-appearance',\n 'data-background',\n 'data-kui-tint',\n 'data-kui-tint-accent',\n 'data-deep-inset',\n 'data-outlined',\n 'data-scroll-clearance',\n 'data-header-presentation',\n 'data-header-material',\n 'data-scroll-edge',\n 'data-scroll-edge-distance',\n 'data-header-overlay',\n 'data-separator-block-start',\n 'data-separator-block-end',\n 'data-separator-inline-start',\n 'data-separator-inline-end',\n 'data-safe-area-block-start',\n 'data-safe-area-block-end',\n 'data-safe-area-inline-start',\n 'data-safe-area-inline-end',\n]);\n\nconst allPaneSides: readonly PaneSeparatorSide[] = [\n 'block-start',\n 'block-end',\n 'inline-start',\n 'inline-end',\n];\n\ntype PaneRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-fill'?: never;\n 'data-separator-block-start'?: never;\n 'data-separator-block-end'?: never;\n 'data-separator-inline-start'?: never;\n 'data-separator-inline-end'?: never;\n 'data-safe-area-block-start'?: never;\n 'data-safe-area-block-end'?: never;\n 'data-safe-area-inline-start'?: never;\n 'data-safe-area-inline-end'?: never;\n 'data-chrome-placement'?: never;\n 'data-chrome-dividers'?: never;\n 'data-appearance'?: never;\n 'data-background'?: never;\n 'data-kui-tint'?: never;\n 'data-kui-tint-accent'?: never;\n 'data-deep-inset'?: never;\n 'data-outlined'?: never;\n 'data-scroll-clearance'?: never;\n 'data-header-presentation'?: never;\n 'data-header-material'?: never;\n 'data-scroll-edge'?: never;\n 'data-scroll-edge-distance'?: never;\n 'data-header-overlay'?: never;\n 'data-compact-header'?: never;\n 'data-compact-footer'?: never;\n 'data-compact-header-open'?: never;\n 'data-compact-footer-open'?: never;\n }\n>;\n\n/** How a Pane's header and footer relate to its scrolling content. */\nexport type PaneChromePlacement = 'fixed' | 'auto';\n\n/**\n * How a header or footer behaves when the pane's container presents\n * compactly (a `NavStack` view, a `TabNavigator` scene, a full-screen dialog,\n * or a compact `Workbench`): `fixed` stays docked and shrinks the content\n * area; `scroll` sits inline with the content (a footer settles at the end\n * and scrolls past when the content is longer); `overlay` lies over the\n * content on the chrome material, shown only while the app opens it.\n */\nexport type PaneCompactChrome = 'fixed' | 'scroll' | 'overlay';\n\n/** The compact chrome policy for a Pane's header and footer. */\nexport interface PaneCompactChromePolicy {\n header?: PaneCompactChrome;\n footer?: PaneCompactChrome;\n}\n\n/**\n * When a Pane draws the divider between its pinned header or footer and its\n * scrolling content: `scroll` while content is scrolled away beneath that\n * chrome, as `wireScrollDividers` reports; `always`; or `none`.\n */\nexport type PaneChromeDividers = 'scroll' | 'always' | 'none';\n\n/**\n * How a Pane's header relates to its scrolling content: `docked` in its own\n * row above the content, or `overlay` laid over the content's top edge on the\n * translucent chrome material, so content scrolls visibly beneath it.\n * `clear` lays it over\n * the same edge fully transparent, for chrome over imagery: legibility comes\n * from glass control groups or a scrim, and with `scrollEdge=\"material\"` the\n * chrome material fades in once content scrolls beneath it.\n */\nexport type PaneHeaderPresentation = 'docked' | 'overlay' | 'clear';\n\n/** Background treatment of the Pane's scrolling work surface. */\nexport type PaneAppearance = 'default' | 'sunken';\n\n/** Whether a Pane's scrolling content keeps the browser's scroll anchoring. */\nexport type PaneScrollAnchoring = 'auto' | 'none';\n\nexport interface PaneProps {\n /** Optional fixed chrome above the scrolling content, arranged vertically. */\n header?: KerfUiContent;\n /** The pane's primary vertical, scrolling content stack. */\n children?: KerfUiContent;\n /** Optional fixed chrome below the scrolling content. */\n footer?: KerfUiContent;\n /**\n * Fill the height of a parent with a definite height, such as an app root\n * (`.kui-app-root`), a `SizedRegion`, or a grid cell, or take the rest of a\n * flex column. The header and footer stay pinned and the content scrolls\n * between them, as in a NavStack view or Workbench region (which fill their\n * Pane without this prop). Defaults to false: the pane takes its content's\n * height.\n */\n fill?: boolean;\n /**\n * Whether the header and footer stay pinned around the scrolling content.\n * `fixed` (default) always pins them. `auto` pins them while the pane is\n * tall enough, and below 480px of height (30rem, so it scales with the text\n * size) lets the whole pane scroll as one column, so tall chrome can never\n * squeeze the content to nothing.\n */\n chromePlacement?: PaneChromePlacement;\n /**\n * The divider under the header and over the footer, where they meet the\n * scrolling content. Omitted defaults to `scroll` for a plain pane and\n * `always` for `appearance=\"sunken\"`. `scroll` shows the header's divider only\n * while the content is scrolled down, and the footer's only while more\n * content lies below — never when the content fits — once\n * `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is wired above\n * the pane; unwired, neither shows. `always` shows both; `none` neither.\n * The line is drawn inside the chrome, so no state moves the content.\n */\n chromeDividers?: PaneChromeDividers;\n /**\n * `docked` (default) gives the header its own row above the scrolling\n * content. `overlay` lays the header over the content's top edge on the\n * translucent chrome material (`--kui-chrome-material`, opaque under\n * `prefers-reduced-transparency`, forced colors, or without\n * `backdrop-filter`), so content scrolls visibly beneath it. Once\n * `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is wired above\n * the pane it measures the header and publishes its height as the\n * `--kui-scroll-clearance-block-start` context, which the content adds to\n * its block-start padding and `scroll-padding` without any\n * `scrollClearance` prop, so the first item, and anything focused or\n * scrolled into view, rests clear of the header. Until then, and with\n * `chromePlacement=\"auto\"`, the header stays docked. Keep overlay header\n * text in the normal text color: quiet text can fall below AA over the\n * content passing beneath it.\n */\n /**\n * What the header and footer do when the pane's container presents\n * compactly (default `fixed`); roomy containers ignore it. The container\n * interprets it, so set it on panes inside a `NavStack`, `TabNavigator`,\n * full-screen dialog, or `Workbench`.\n */\n compactChrome?: PaneCompactChromePolicy;\n /**\n * Which `overlay` compact chrome is showing. The app owns it and flips it\n * from a control the person can reach while the chrome is hidden.\n */\n compactChromeOpen?: { header?: boolean; footer?: boolean };\n headerPresentation?: PaneHeaderPresentation;\n /**\n * With `headerPresentation=\"clear\"`, `material` fades the chrome material\n * in behind the header once content scrolls beneath it (default `none`).\n */\n scrollEdge?: ScrollEdge;\n /**\n * The scroll distance, in CSS pixels, over which the scroll edge fades in\n * (default 60).\n */\n scrollEdgeDistance?: number;\n /** Paint the scrolling work surface with the shared lowered-surface color. */\n appearance?: PaneAppearance;\n /**\n * Paint the whole pane, header and footer included, in an app-chosen color\n * (`uiColor('surface-raised')`, `fillColor('#1f2a44')`, or `colorVar(…)`\n * from `@kerfjs/ui/css-values`). It replaces the appearance's fill: a sunken\n * pane drops its lowered color and grain. Omitted, the pane keeps its\n * default (transparent, or the sunken surface). Forced colors paint\n * `Canvas`. Keep text at AA over the color; a dark color needs a matching\n * tint or dark tones for its content.\n */\n background?: CssColor;\n /**\n * A scoped tint: `{ color, scheme }`, the app's color and the scheme it\n * belongs to. The pane paints the tinted surface (unless `background` is\n * set) and its whole subtree, chrome material and quiet fills included,\n * re-derives its surface and text tokens from the color with lightness\n * clamped to keep text at WCAG AA. Without relative color syntax, or under\n * `prefers-contrast: more`, the scope keeps the plain palette in the\n * declared scheme.\n */\n tint?: SurfaceTint;\n /**\n * Scope this surface and its subtree to the light or dark palette, whatever\n * the page's scheme (a light card on a dark page). A `tint` already sets\n * its scheme; pass `scheme` alone for the plain palette, or with a tint\n * only when they agree.\n */\n scheme?: SurfaceTintScheme;\n /**\n * Clear chrome that lies over the scrolling content's block-start and/or\n * block-end edge, such as a `DialogSurface` floating footer over a filling\n * Pane. The content scroller adds the inherited\n * `--kui-scroll-clearance-block-*` context that chrome publishes to its block\n * padding and `scroll-padding`, so content scrolls visibly beneath the chrome\n * while its first and last items (and anything focused or scrolled into\n * view) can still rest clear of it. Defaults to none.\n */\n scrollClearance?: ScrollClearance;\n /** Add 8px to every side of scrolling content (default: false). */\n deepInset?: boolean;\n /** Opt into keyboard (`0`) or programmatic (`-1`) focus on the Pane root. */\n tabIndex?: 0 | -1;\n /**\n * Names the Pane root as a CSS anchor (`anchor-name`): a dashed ident such\n * as `--app-main`. A surface that docks to a named anchor, such as a\n * `PopoverDialogSurface` with the same `anchorName`, then docks to this\n * pane, so the app names its main column without CSS. A Workbench work\n * area, panel, or NavStack view takes it through its `PaneConfig`.\n */\n anchorName?: AnchorName;\n /**\n * The scrolling content's CSS scroll anchoring (`overflow-anchor`). `auto`\n * (the default) keeps the browser's anchoring, which holds visible content\n * still when something above it grows or shrinks. `none` opts the pane\n * out: use it for a pane whose own edits insert or remove rows above the\n * reader, where Safari can apply a late anchoring jump on an unrelated\n * reflow, such as an inspector. A Workbench panel, work area, or NavStack\n * view takes it through its `PaneConfig`.\n */\n scrollAnchoring?: PaneScrollAnchoring;\n /** Keep the standard focus outline visible, such as for a drop target. */\n outlined?: boolean;\n /** Root semantics. Defaults to `div`. */\n element?: PaneElement;\n /** Scrolling content semantics. Defaults to `div`. */\n contentElement?: PaneContentElement;\n /** Independent logical-edge separator lines. Defaults to none. */\n separators?: readonly PaneSeparatorSide[];\n /**\n * Sides on which the pane may compensate for a device safe-area inset.\n * Defaults to every side: the pane pads its slots for each side that still\n * reaches an unsafe screen edge, as its surrounding layout reports, while its\n * background and separators paint through. List only the sides an app-owned\n * layout places at a screen edge, or pass `[]` to opt out.\n */\n safeAreaEdges?: readonly PaneSeparatorSide[];\n id?: string;\n /** Accessible name for a landmark root such as `aside` or `main`. */\n label?: string;\n /** Accessible name for a landmark scrolling slot such as `nav`. */\n contentLabel?: string;\n className?: string;\n headerClassName?: string;\n contentClassName?: string;\n footerClassName?: string;\n /** Safe `data-*` metadata; Pane-owned structural attributes remain protected. */\n rootAttributes?: PaneRootAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/**\n * A pane's configuration, apart from its content and styling hooks: the props a\n * composite that renders a `Pane` for the app (a Workbench panel or work area,\n * or a CollapsiblePanel) forwards, so the app configures that pane instead of\n * styling it. An omitted or `undefined` field keeps the composite's default.\n */\nexport type PaneConfig = Pick<\n PaneProps,\n | 'contentElement'\n | 'contentLabel'\n | 'separators'\n | 'safeAreaEdges'\n | 'chromeDividers'\n | 'compactChrome'\n | 'compactChromeOpen'\n | 'headerPresentation'\n | 'scrollEdge'\n | 'scrollEdgeDistance'\n | 'appearance'\n | 'background'\n | 'tint'\n | 'deepInset'\n | 'scrollClearance'\n | 'tabIndex'\n | 'outlined'\n | 'anchorName'\n | 'scrollAnchoring'\n>;\n\nfunction paneContent(\n element: PaneContentElement,\n children: KerfUiContent,\n className: string,\n label: string | undefined,\n) {\n const attributes = {\n class: `kui-pane__content kui-content ${className}`.trim(),\n 'aria-label': label,\n };\n if (element === 'main') return <main {...attributes}>{children}</main>;\n if (element === 'nav') return <nav {...attributes}>{children}</nav>;\n if (element === 'section')\n return <section {...attributes}>{children}</section>;\n return <div {...attributes}>{children}</div>;\n}\n\n/**\n * An unpadded application column with optional fixed header/footer slots and one\n * scrolling vertical content owner. Separator lines are independently opt-in on\n * each logical edge, so the same component works as a sidebar, main area,\n * inspector, or dialog column.\n */\nexport function Pane({\n header,\n children,\n footer,\n fill = false,\n chromePlacement = 'fixed',\n chromeDividers,\n compactChrome = {},\n compactChromeOpen = {},\n headerPresentation = 'docked',\n scrollEdge = 'none',\n scrollEdgeDistance,\n appearance = 'default',\n background,\n tint,\n scheme,\n deepInset = false,\n scrollClearance,\n tabIndex,\n anchorName,\n scrollAnchoring = 'auto',\n outlined = false,\n element = 'div',\n contentElement = 'div',\n separators = [],\n safeAreaEdges = allPaneSides,\n id,\n label,\n contentLabel,\n className = '',\n headerClassName = '',\n contentClassName = '',\n footerClassName = '',\n rootAttributes = {},\n slot,\n}: PaneProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n paneProtectedAttributes,\n );\n const content = paneContent(\n contentElement,\n children,\n contentClassName,\n contentLabel,\n );\n const resolvedChromeDividers =\n chromeDividers ?? (appearance === 'sunken' ? 'always' : 'scroll');\n if (appearance === 'sunken' && background === undefined)\n ensureSunkenTexture();\n const tinted = surfaceTintAttributes(tint, scheme);\n const clearHeader = headerPresentation === 'clear' && header !== undefined;\n const body = (\n <>\n {header === undefined ? null : (\n <header\n class={`kui-pane__header kui-pane__toolbar ${headerClassName}`.trim()}\n >\n {header}\n </header>\n )}\n {content}\n {footer === undefined ? null : (\n <footer class={`kui-pane__footer ${footerClassName}`.trim()}>\n {footer}\n </footer>\n )}\n </>\n );\n const attributes = {\n ...safeRootAttributes,\n class: `kui-pane ${tinted.className} ${className}`\n .replace(/\\s+/g, ' ')\n .trim(),\n id,\n 'data-component': 'pane',\n 'data-fill': fill ? 'true' : undefined,\n 'data-appearance': appearance === 'sunken' ? 'sunken' : undefined,\n 'data-background': background === undefined ? undefined : '',\n 'data-kui-tint': tinted['data-kui-tint'],\n 'data-kui-tint-accent': tinted['data-kui-tint-accent'],\n 'data-kui-scheme': tinted['data-kui-scheme'],\n style: joinStyles(\n background === undefined\n ? undefined\n : `--_kui-pane-background:${background}`,\n tinted.style,\n anchorName === undefined\n ? undefined\n : `anchor-name:${checkedAnchorName(anchorName, 'Pane anchorName')}`,\n ),\n 'data-deep-inset': deepInset ? 'true' : undefined,\n 'data-outlined': outlined ? 'true' : undefined,\n 'data-scroll-anchoring': scrollAnchoring === 'none' ? 'none' : undefined,\n 'data-scroll-clearance': scrollClearance,\n 'data-header-presentation':\n headerPresentation !== 'docked' && header !== undefined\n ? 'overlay'\n : undefined,\n 'data-header-material': clearHeader ? 'clear' : undefined,\n ...scrollEdgeAttributes(scrollEdge, scrollEdgeDistance, clearHeader),\n 'data-chrome-placement': chromePlacement === 'auto' ? 'auto' : undefined,\n 'data-compact-header':\n header !== undefined && compactChrome.header !== 'fixed'\n ? compactChrome.header\n : undefined,\n 'data-compact-footer':\n footer !== undefined && compactChrome.footer !== 'fixed'\n ? compactChrome.footer\n : undefined,\n 'data-compact-header-open':\n compactChrome.header === 'overlay' && compactChromeOpen.header\n ? ''\n : undefined,\n 'data-compact-footer-open':\n compactChrome.footer === 'overlay' && compactChromeOpen.footer\n ? ''\n : undefined,\n 'data-chrome-dividers':\n resolvedChromeDividers === 'always' || resolvedChromeDividers === 'none'\n ? resolvedChromeDividers\n : undefined,\n 'data-separator-block-start': String(separators.includes('block-start')),\n 'data-separator-block-end': String(separators.includes('block-end')),\n 'data-separator-inline-start': String(separators.includes('inline-start')),\n 'data-separator-inline-end': String(separators.includes('inline-end')),\n 'data-safe-area-block-start': String(safeAreaEdges.includes('block-start')),\n 'data-safe-area-block-end': String(safeAreaEdges.includes('block-end')),\n 'data-safe-area-inline-start': String(\n safeAreaEdges.includes('inline-start'),\n ),\n 'data-safe-area-inline-end': String(safeAreaEdges.includes('inline-end')),\n 'aria-label': label,\n tabindex: tabIndex,\n slot,\n };\n\n if (element === 'article') return <article {...attributes}>{body}</article>;\n if (element === 'aside') return <aside {...attributes}>{body}</aside>;\n if (element === 'main') return <main {...attributes}>{body}</main>;\n if (element === 'section') return <section {...attributes}>{body}</section>;\n return <div {...attributes}>{body}</div>;\n}\n\nexport type { ScrollClearance } from '../../../shared/layout/scroll-clearance.js';\nexport type { ScrollEdge } from '../../../shared/layout/scroll-edge.js';\nexport type {\n SurfaceTint,\n SurfaceTintScheme,\n} from '../../../shared/styles/surface-tint.js';\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pct } from './chunk-IQSRHXZR.js';
|
|
2
|
-
import { filterDataAttributes } from './chunk-
|
|
2
|
+
import { filterDataAttributes } from './chunk-BRDTP3RT.js';
|
|
3
3
|
import { jsx } from 'kerfjs/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
function blockStyle(width, height, radius) {
|
|
@@ -68,4 +68,4 @@ function Skeleton({
|
|
|
68
68
|
|
|
69
69
|
export { Skeleton };
|
|
70
70
|
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMappingURL=chunk-LH7YRRY7.js.map
|