@kerfjs/ui 5.0.0-beta.6 → 5.0.0-beta.60
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 +493 -138
- package/ai/application-ui-diagnostic-ids-v1.json +109 -0
- package/ai/application-ui-profile-sync.cjs +529 -0
- package/ai/application-ui-profile.d.mts +1 -0
- package/ai/application-ui-profile.d.ts +102 -0
- package/ai/application-ui-profile.defaults.json +96 -0
- package/ai/application-ui-profile.mjs +626 -0
- package/ai/application-ui-profile.schema.json +130 -0
- package/ai/catalog-authoring.json +36 -0
- package/ai/catalog-authoring.schema.json +109 -0
- package/ai/compile-time-contracts-v1.json +149 -0
- package/ai/compile-time-contracts-v1.schema.json +52 -0
- package/ai/component-catalog-extension.schema.json +79 -0
- package/ai/component-catalog.json +3947 -607
- package/ai/component-catalog.schema.json +78 -1
- package/ai/component-class-owners.cjs +83 -0
- package/ai/component-composition-extension.d.ts +7 -0
- package/ai/component-composition-extension.schema.json +7 -0
- package/ai/component-composition-rules.json +516 -0
- package/ai/component-composition.d.ts +115 -0
- package/ai/component-composition.json +6972 -0
- package/ai/component-composition.schema.json +354 -0
- package/ai/components/README.md +170 -0
- package/ai/components/application-tabs.md +65 -0
- package/ai/components/badge.md +72 -0
- package/ai/components/collapsible-panel.md +102 -0
- package/ai/components/content-item.md +90 -0
- package/ai/components/disclosure-arrow.md +77 -0
- package/ai/components/document-baseline.md +75 -0
- package/ai/components/empty-state.md +80 -0
- package/ai/components/feedback.md +71 -0
- package/ai/components/floating-toolbar.md +82 -0
- package/ai/components/foundation.md +65 -0
- package/ai/components/grid.md +93 -0
- package/ai/components/headers.md +63 -0
- package/ai/components/layout.md +75 -0
- package/ai/components/list-action-row.md +91 -0
- package/ai/components/list-header.md +89 -0
- package/ai/components/list-inset-control.md +74 -0
- package/ai/components/list-inset-text.md +72 -0
- package/ai/components/list-item.md +91 -0
- package/ai/components/list.md +103 -0
- package/ai/components/loading-spinner.md +72 -0
- package/ai/components/lucide-icon.md +66 -0
- package/ai/components/nav-stack.md +103 -0
- package/ai/components/pane.md +100 -0
- package/ai/components/popup-menu.md +171 -0
- package/ai/components/recipe-app-shell.md +57 -0
- package/ai/components/recipe-collapsible-sidebar.md +57 -0
- package/ai/components/recipe-compact-toolbar.md +57 -0
- package/ai/components/recipe-composer-form.md +57 -0
- package/ai/components/recipe-list-detail-dialog.md +57 -0
- package/ai/components/recipe-list-workspace-states.md +57 -0
- package/ai/components/recipe-loading-inspector.md +57 -0
- package/ai/components/recipe-navigation-sidebar.md +57 -0
- package/ai/components/recipe-navigation-stack.md +57 -0
- package/ai/components/recipe-workspace-header.md +57 -0
- package/ai/components/resize.md +106 -0
- package/ai/components/row.md +96 -0
- package/ai/components/segmented-control.md +82 -0
- package/ai/components/select.md +109 -0
- package/ai/components/skeleton.md +84 -0
- package/ai/components/spacer.md +86 -0
- package/ai/components/split-view.md +102 -0
- package/ai/components/state-banner.md +94 -0
- package/ai/components/sunken-panel.md +79 -0
- package/ai/components/surface-scaffold.md +78 -0
- package/ai/components/tab-bar.md +112 -0
- package/ai/components/tab-scaffold.md +94 -0
- package/ai/components/tabs.md +91 -0
- package/ai/components/text.md +83 -0
- package/ai/components/token-search-field.md +103 -0
- package/ai/components/toolbar-control-group.md +102 -0
- package/ai/components/toolbar-text.md +78 -0
- package/ai/components/toolbar.md +96 -0
- package/ai/components/value-table.md +73 -0
- package/ai/components/wa-accordion-item.md +55 -0
- package/ai/components/wa-accordion.md +65 -0
- package/ai/components/wa-animated-image.md +55 -0
- package/ai/components/wa-animation.md +55 -0
- package/ai/components/wa-avatar.md +55 -0
- package/ai/components/wa-badge.md +55 -0
- package/ai/components/wa-breadcrumb-item.md +53 -0
- package/ai/components/wa-breadcrumb.md +55 -0
- package/ai/components/wa-button-group.md +59 -0
- package/ai/components/wa-button.md +55 -0
- package/ai/components/wa-callout.md +58 -0
- package/ai/components/wa-card.md +59 -0
- package/ai/components/wa-carousel-item.md +53 -0
- package/ai/components/wa-carousel.md +55 -0
- package/ai/components/wa-checkbox-group.md +55 -0
- package/ai/components/wa-checkbox.md +55 -0
- package/ai/components/wa-color-picker.md +55 -0
- package/ai/components/wa-comparison.md +55 -0
- package/ai/components/wa-copy-button.md +55 -0
- package/ai/components/wa-details.md +61 -0
- package/ai/components/wa-dialog.md +59 -0
- package/ai/components/wa-divider.md +53 -0
- package/ai/components/wa-drawer.md +55 -0
- package/ai/components/wa-dropdown-item.md +60 -0
- package/ai/components/wa-dropdown.md +60 -0
- package/ai/components/wa-format-bytes.md +53 -0
- package/ai/components/wa-format-date.md +53 -0
- package/ai/components/wa-format-number.md +53 -0
- package/ai/components/wa-icon.md +58 -0
- package/ai/components/wa-include.md +53 -0
- package/ai/components/wa-input.md +59 -0
- package/ai/components/wa-intersection-observer.md +53 -0
- package/ai/components/wa-known-date.md +53 -0
- package/ai/components/wa-markdown.md +53 -0
- package/ai/components/wa-mutation-observer.md +53 -0
- package/ai/components/wa-number-input.md +55 -0
- package/ai/components/wa-option.md +59 -0
- package/ai/components/wa-otp-input.md +53 -0
- package/ai/components/wa-page.md +53 -0
- package/ai/components/wa-pagination.md +55 -0
- package/ai/components/wa-popover.md +55 -0
- package/ai/components/wa-popup.md +53 -0
- package/ai/components/wa-progress-bar.md +53 -0
- package/ai/components/wa-progress-ring.md +53 -0
- package/ai/components/wa-qr-code.md +53 -0
- package/ai/components/wa-radio-group.md +59 -0
- package/ai/components/wa-radio.md +55 -0
- package/ai/components/wa-random-content.md +53 -0
- package/ai/components/wa-rating.md +55 -0
- package/ai/components/wa-relative-time.md +53 -0
- package/ai/components/wa-resize-observer.md +53 -0
- package/ai/components/wa-scroller.md +53 -0
- package/ai/components/wa-select.md +63 -0
- package/ai/components/wa-skeleton.md +53 -0
- package/ai/components/wa-slider.md +55 -0
- package/ai/components/wa-spinner.md +58 -0
- package/ai/components/wa-split-panel.md +58 -0
- package/ai/components/wa-switch.md +53 -0
- package/ai/components/wa-tab-group.md +69 -0
- package/ai/components/wa-tab-panel.md +60 -0
- package/ai/components/wa-tab.md +59 -0
- package/ai/components/wa-tag.md +59 -0
- package/ai/components/wa-textarea.md +53 -0
- package/ai/components/wa-time-input.md +55 -0
- package/ai/components/wa-toast-item.md +60 -0
- package/ai/components/wa-toast.md +60 -0
- package/ai/components/wa-tooltip.md +55 -0
- package/ai/components/wa-tree-item.md +55 -0
- package/ai/components/wa-tree.md +55 -0
- package/ai/components/wa-zoomable-frame.md +55 -0
- package/ai/components/workbench.md +114 -0
- package/ai/public-api-signatures-v1.md +2528 -197
- package/ai/skill.md +241 -65
- package/ai/webawesome-jsx-signatures-v1.md +9 -2
- package/analyzer/cli.mjs +49 -0
- package/analyzer/component-ownership.d.mts +56 -0
- package/analyzer/component-ownership.mjs +184 -0
- package/analyzer/index.d.mts +49 -0
- package/analyzer/index.mjs +1458 -0
- package/analyzer/loud-pairs.d.mts +49 -0
- package/analyzer/loud-pairs.mjs +357 -0
- package/analyzer/report.schema.json +66 -0
- package/analyzer/selectors.d.mts +21 -0
- package/analyzer/selectors.mjs +212 -0
- package/dist/app-tab.d.ts +31 -4
- package/dist/app-tab.js +3 -1
- package/dist/badge.d.ts +52 -0
- package/dist/badge.js +3 -0
- package/dist/badge.js.map +1 -0
- package/dist/browser/app-tab.js +1 -0
- package/dist/browser/badge.js +3 -0
- package/dist/browser/catalog.js +25 -0
- package/dist/browser/collapsible-panel.js +7 -0
- package/dist/browser/content-item.js +3 -0
- package/dist/browser/floating-toolbar.js +3 -0
- package/dist/browser/grid.js +3 -0
- package/dist/browser/list-action-row.js +5 -0
- package/dist/browser/list-header.js +8 -0
- package/dist/browser/list-inset-control.js +3 -0
- package/dist/browser/list-inset-text.js +3 -0
- package/dist/browser/list-item.js +5 -0
- package/dist/browser/list.js +3 -0
- package/dist/browser/{panel-header.js → nav-stack.js} +4 -2
- package/dist/browser/pane.js +3 -0
- package/dist/browser/popup-menu.js +3 -0
- package/dist/browser/row.js +3 -0
- package/dist/browser/select.js +2 -0
- package/dist/browser/skeleton.js +3 -0
- package/dist/browser/spacer.js +3 -0
- package/dist/browser/split-view.js +10 -0
- package/dist/browser/state-banner.js +2 -0
- package/dist/browser/sunken-panel.js +3 -0
- package/dist/browser/surface-scaffold.js +3 -0
- package/dist/browser/tab-scaffold.js +4 -0
- package/dist/browser/text.js +3 -0
- package/dist/browser/toolbar-text.js +1 -0
- package/dist/browser/value-table.js +1 -0
- package/dist/browser/workbench.js +10 -0
- package/dist/catalog-resources.d.ts +46 -0
- package/dist/catalog-resources.js +22 -0
- package/dist/catalog-resources.js.map +1 -0
- package/dist/catalog.d.ts +90 -0
- package/dist/catalog.js +501 -0
- package/dist/catalog.js.map +1 -0
- package/dist/chunk-2G2ZJQYK.js +152 -0
- package/dist/chunk-2G2ZJQYK.js.map +1 -0
- package/dist/chunk-2OXQHM7I.js +418 -0
- package/dist/chunk-2OXQHM7I.js.map +1 -0
- package/dist/chunk-3SXMEK3B.js +43 -0
- package/dist/chunk-3SXMEK3B.js.map +1 -0
- package/dist/{chunk-MQIZAD4A.js → chunk-46263QLK.js} +126 -22
- package/dist/chunk-46263QLK.js.map +1 -0
- package/dist/{chunk-W2FK7ZNY.js → chunk-4R777DUZ.js} +10 -2
- package/dist/chunk-4R777DUZ.js.map +1 -0
- package/dist/chunk-5I7OHCIP.js +96 -0
- package/dist/chunk-5I7OHCIP.js.map +1 -0
- package/dist/chunk-5I7QGQVT.js +24 -0
- package/dist/chunk-5I7QGQVT.js.map +1 -0
- package/dist/chunk-5PESG2VP.js +115 -0
- package/dist/chunk-5PESG2VP.js.map +1 -0
- package/dist/chunk-5Q3N6EV7.js +156 -0
- package/dist/chunk-5Q3N6EV7.js.map +1 -0
- package/dist/chunk-6ZXOQEAN.js +27 -0
- package/dist/chunk-6ZXOQEAN.js.map +1 -0
- package/dist/chunk-7JUBXOIV.js +103 -0
- package/dist/chunk-7JUBXOIV.js.map +1 -0
- package/dist/chunk-A3CKOW2R.js +622 -0
- package/dist/chunk-A3CKOW2R.js.map +1 -0
- package/dist/chunk-AGXQQFKZ.js +62 -0
- package/dist/chunk-AGXQQFKZ.js.map +1 -0
- package/dist/chunk-AHEG27M7.js +66 -0
- package/dist/chunk-AHEG27M7.js.map +1 -0
- package/dist/chunk-AUKT3KMG.js +37 -0
- package/dist/chunk-AUKT3KMG.js.map +1 -0
- package/dist/chunk-AYUHMAI6.js +48 -0
- package/dist/chunk-AYUHMAI6.js.map +1 -0
- package/dist/chunk-BFPBS5Y4.js +250 -0
- package/dist/chunk-BFPBS5Y4.js.map +1 -0
- package/dist/chunk-DG6G5EPF.js +35 -0
- package/dist/chunk-DG6G5EPF.js.map +1 -0
- package/dist/chunk-E36EVCKG.js +34 -0
- package/dist/chunk-E36EVCKG.js.map +1 -0
- package/dist/chunk-EZVNC4J6.js +104 -0
- package/dist/chunk-EZVNC4J6.js.map +1 -0
- package/dist/chunk-F4QMLOXJ.js +135 -0
- package/dist/chunk-F4QMLOXJ.js.map +1 -0
- package/dist/chunk-F7F7KRO2.js +187 -0
- package/dist/chunk-F7F7KRO2.js.map +1 -0
- package/dist/chunk-GLDWRCAM.js +49 -0
- package/dist/chunk-GLDWRCAM.js.map +1 -0
- package/dist/chunk-I3Q7KKYM.js +33 -0
- package/dist/chunk-I3Q7KKYM.js.map +1 -0
- package/dist/chunk-IA7TMD4Y.js +288 -0
- package/dist/chunk-IA7TMD4Y.js.map +1 -0
- package/dist/chunk-JCV4GXWB.js +249 -0
- package/dist/chunk-JCV4GXWB.js.map +1 -0
- package/dist/chunk-K47P7QZC.js +17 -0
- package/dist/chunk-K47P7QZC.js.map +1 -0
- package/dist/chunk-KLJKU6ZL.js +109 -0
- package/dist/chunk-KLJKU6ZL.js.map +1 -0
- package/dist/{chunk-56RJXPHG.js → chunk-KROD7KZK.js} +7 -4
- package/dist/chunk-KROD7KZK.js.map +1 -0
- package/dist/chunk-MA73TA6D.js +42 -0
- package/dist/chunk-MA73TA6D.js.map +1 -0
- package/dist/chunk-MERWRTBG.js +45 -0
- package/dist/chunk-MERWRTBG.js.map +1 -0
- package/dist/chunk-MEY33VWB.js +44 -0
- package/dist/chunk-MEY33VWB.js.map +1 -0
- package/dist/chunk-MP2GDBQZ.js +50 -0
- package/dist/chunk-MP2GDBQZ.js.map +1 -0
- package/dist/chunk-N3GKMPDW.js +51 -0
- package/dist/chunk-N3GKMPDW.js.map +1 -0
- package/dist/chunk-NAPE7WUS.js +75 -0
- package/dist/chunk-NAPE7WUS.js.map +1 -0
- package/dist/chunk-NN6GYOA2.js +47 -0
- package/dist/chunk-NN6GYOA2.js.map +1 -0
- package/dist/chunk-NNMLEDMD.js +399 -0
- package/dist/chunk-NNMLEDMD.js.map +1 -0
- package/dist/chunk-P7D3EMXM.js +52 -0
- package/dist/chunk-P7D3EMXM.js.map +1 -0
- package/dist/chunk-PSHUSWQH.js +18 -0
- package/dist/chunk-PSHUSWQH.js.map +1 -0
- package/dist/chunk-RRB26JRJ.js +247 -0
- package/dist/chunk-RRB26JRJ.js.map +1 -0
- package/dist/{chunk-7BR3DO2A.js → chunk-SRSJO5QE.js} +13 -4
- package/dist/chunk-SRSJO5QE.js.map +1 -0
- package/dist/chunk-T57AXDFM.js +95 -0
- package/dist/chunk-T57AXDFM.js.map +1 -0
- package/dist/chunk-T66UNBXL.js +129 -0
- package/dist/chunk-T66UNBXL.js.map +1 -0
- package/dist/chunk-UIDKY4UB.js +14 -0
- package/dist/chunk-UIDKY4UB.js.map +1 -0
- package/dist/chunk-UWONG4QE.js +127 -0
- package/dist/chunk-UWONG4QE.js.map +1 -0
- package/dist/chunk-VZOFZPSO.js +71 -0
- package/dist/chunk-VZOFZPSO.js.map +1 -0
- package/dist/chunk-WPLIO5WJ.js +184 -0
- package/dist/chunk-WPLIO5WJ.js.map +1 -0
- package/dist/{chunk-TRNBHPNW.js → chunk-X5QSICJ3.js} +13 -7
- package/dist/chunk-X5QSICJ3.js.map +1 -0
- package/dist/chunk-ZLWQZUGF.js +27 -0
- package/dist/chunk-ZLWQZUGF.js.map +1 -0
- package/dist/collapsible-panel.d.ts +122 -0
- package/dist/collapsible-panel.js +115 -0
- package/dist/collapsible-panel.js.map +1 -0
- package/dist/content-item.d.ts +46 -0
- package/dist/content-item.js +4 -0
- package/dist/content-item.js.map +1 -0
- package/dist/css-values.d.ts +107 -0
- package/dist/css-values.js +3 -0
- package/dist/css-values.js.map +1 -0
- package/dist/device-class.js +33 -5
- package/dist/device-class.js.map +1 -1
- package/dist/disclosure-arrow.d.ts +6 -1
- package/dist/disclosure-arrow.js +1 -1
- package/dist/empty-state.d.ts +5 -2
- package/dist/empty-state.js +1 -1
- package/dist/flex-alignment-4ms8ZbV8.d.ts +5 -0
- package/dist/floating-toolbar.d.ts +51 -0
- package/dist/floating-toolbar.js +3 -0
- package/dist/floating-toolbar.js.map +1 -0
- package/dist/grid.d.ts +34 -0
- package/dist/grid.js +5 -0
- package/dist/grid.js.map +1 -0
- package/dist/help-tags-register.d.ts +13 -0
- package/dist/help-tags-register.js +9 -0
- package/dist/help-tags-register.js.map +1 -0
- package/dist/index.d.ts +34 -14
- package/dist/index.js +42 -22
- package/dist/list-action-row.d.ts +64 -0
- package/dist/list-action-row.js +8 -0
- package/dist/list-action-row.js.map +1 -0
- package/dist/list-header.d.ts +99 -0
- package/dist/list-header.js +10 -0
- package/dist/list-header.js.map +1 -0
- package/dist/list-inset-control.d.ts +22 -0
- package/dist/list-inset-control.js +3 -0
- package/dist/list-inset-control.js.map +1 -0
- package/dist/list-inset-text.d.ts +30 -0
- package/dist/list-inset-text.js +4 -0
- package/dist/list-inset-text.js.map +1 -0
- package/dist/list-item.d.ts +52 -0
- package/dist/list-item.js +8 -0
- package/dist/list-item.js.map +1 -0
- package/dist/list.d.ts +59 -0
- package/dist/list.js +6 -0
- package/dist/list.js.map +1 -0
- package/dist/loading-spinner.d.ts +3 -1
- package/dist/loading-spinner.js +1 -1
- package/dist/lucide-icon.d.ts +3 -1
- package/dist/lucide-icon.js +1 -1
- package/dist/nav-stack.d.ts +60 -10
- package/dist/nav-stack.js +6 -1
- package/dist/pane.d.ts +102 -0
- package/dist/pane.js +4 -0
- package/dist/pane.js.map +1 -0
- package/dist/panel-toolbar-DqwtBxQL.d.ts +63 -0
- package/dist/popup-menu-register.d.ts +9 -0
- package/dist/popup-menu-register.js +31 -0
- package/dist/popup-menu-register.js.map +1 -0
- package/dist/popup-menu.d.ts +99 -0
- package/dist/popup-menu.js +3 -0
- package/dist/popup-menu.js.map +1 -0
- package/dist/resizable-region.d.ts +32 -3
- package/dist/resizable-region.js +1 -1
- package/dist/row.d.ts +48 -0
- package/dist/row.js +6 -0
- package/dist/row.js.map +1 -0
- package/dist/segmented-control.d.ts +13 -8
- package/dist/segmented-control.js +1 -1
- package/dist/select-register.d.ts +5 -1
- package/dist/select-register.js +197 -2
- package/dist/select-register.js.map +1 -1
- package/dist/select.d.ts +87 -8
- package/dist/select.js +4 -1
- package/dist/semantic-content-BbzjvSu9.d.ts +14 -0
- package/dist/sides-BPSWde0A.d.ts +4 -0
- package/dist/skeleton.d.ts +31 -0
- package/dist/skeleton.js +4 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/spacer.d.ts +18 -0
- package/dist/spacer.js +4 -0
- package/dist/spacer.js.map +1 -0
- package/dist/split-view.d.ts +39 -7
- package/dist/split-view.js +120 -10
- package/dist/split-view.js.map +1 -1
- package/dist/state-banner.d.ts +19 -5
- package/dist/state-banner.js +4 -1
- package/dist/styles/app-tab.css +69 -0
- package/dist/styles/badge.css +118 -0
- package/dist/styles/catalog/components/catalog-example-stack.css +9 -0
- package/dist/styles/catalog/components/catalog-example.css +164 -0
- package/dist/styles/catalog/components/catalog-stage.css +55 -0
- package/dist/styles/catalog/components/catalog.css +12 -0
- package/dist/styles/catalog.css +5 -0
- package/dist/styles/collapsible-panel.css +575 -0
- package/dist/styles/content-item.css +30 -0
- package/dist/styles/document.css +23 -0
- package/dist/styles/floating-toolbar.css +119 -0
- package/dist/styles/foundation.css +178 -40
- package/dist/styles/grid.css +21 -0
- package/dist/styles/layout.css +3 -41
- package/dist/styles/list-action-row.css +257 -0
- package/dist/styles/list-header.css +228 -0
- package/dist/styles/list-inset-control.css +30 -0
- package/dist/styles/list-inset-text.css +29 -0
- package/dist/styles/list-item.css +240 -0
- package/dist/styles/list.css +133 -0
- package/dist/styles/nav-stack.css +158 -50
- package/dist/styles/pane.css +229 -0
- package/dist/styles/popup-menu.css +270 -0
- package/dist/styles/resizable-region.css +429 -4
- package/dist/styles/row.css +111 -0
- package/dist/styles/segmented-control.css +31 -8
- package/dist/styles/select.css +232 -9
- package/dist/styles/skeleton.css +92 -0
- package/dist/styles/spacer.css +11 -0
- package/dist/styles/split-view.css +108 -3
- package/dist/styles/state-banner.css +94 -19
- package/dist/styles/styles.css +13 -4
- package/dist/styles/sunken-panel.css +22 -0
- package/dist/styles/surface-scaffold.css +56 -0
- package/dist/styles/tab-bar.css +132 -9
- package/dist/styles/tab-scaffold.css +113 -3
- package/dist/styles/text.css +65 -0
- package/dist/styles/token-search-field.css +49 -43
- package/dist/styles/toolbar-control-group.css +465 -28
- package/dist/styles/toolbar-text.css +88 -4
- package/dist/styles/toolbar.css +319 -11
- package/dist/styles/value-table.css +34 -4
- package/dist/styles/webawesome.css +348 -10
- package/dist/styles/workbench.css +828 -7
- package/dist/sunken-panel.d.ts +22 -0
- package/dist/sunken-panel.js +3 -0
- package/dist/sunken-panel.js.map +1 -0
- package/dist/surface-scaffold.d.ts +30 -0
- package/dist/surface-scaffold.js +3 -0
- package/dist/surface-scaffold.js.map +1 -0
- package/dist/tab-bar.d.ts +31 -6
- package/dist/tab-bar.js +1 -1
- package/dist/tab-scaffold.d.ts +54 -7
- package/dist/tab-scaffold.js +82 -9
- package/dist/tab-scaffold.js.map +1 -1
- package/dist/text.d.ts +38 -0
- package/dist/text.js +3 -0
- package/dist/text.js.map +1 -0
- package/dist/token-search-field-CCke1yvQ.d.ts +126 -0
- package/dist/token-search-field.d.ts +3 -43
- package/dist/token-search-field.js +1 -1
- package/dist/token-search-model.d.ts +3 -0
- package/dist/token-search-model.js +3 -0
- package/dist/token-search-model.js.map +1 -0
- package/dist/toolbar-control-group.d.ts +65 -7
- package/dist/toolbar-control-group.js +1 -1
- package/dist/toolbar-text.d.ts +37 -4
- package/dist/toolbar-text.js +3 -1
- package/dist/toolbar.d.ts +56 -7
- package/dist/toolbar.js +1 -1
- package/dist/types-BuHELdXR.d.ts +117 -0
- package/dist/value-table.d.ts +13 -3
- package/dist/value-table.js +3 -1
- package/dist/webawesome.d.ts +8 -1
- package/dist/wire-catalog.d.ts +82 -0
- package/dist/wire-catalog.js +327 -0
- package/dist/wire-catalog.js.map +1 -0
- package/dist/wire-nav-stack.d.ts +4 -1
- package/dist/wire-nav-stack.js +147 -7
- package/dist/wire-nav-stack.js.map +1 -1
- package/dist/wire-resizable-regions.d.ts +2 -1
- package/dist/wire-resizable-regions.js +2 -1
- package/dist/wire-scroll-dividers.d.ts +69 -0
- package/dist/wire-scroll-dividers.js +3 -0
- package/dist/wire-scroll-dividers.js.map +1 -0
- package/dist/wire-sidebar.d.ts +63 -0
- package/dist/wire-sidebar.js +231 -0
- package/dist/wire-sidebar.js.map +1 -0
- package/dist/wire-tab-bars.d.ts +19 -2
- package/dist/wire-tab-bars.js +1 -1
- package/dist/wire-tab-scaffold.js +9 -4
- package/dist/wire-tab-scaffold.js.map +1 -1
- package/dist/wire-token-search-fields.d.ts +65 -3
- package/dist/wire-token-search-fields.js +1 -1
- package/dist/wire-workbench.d.ts +109 -0
- package/dist/wire-workbench.js +6 -0
- package/dist/wire-workbench.js.map +1 -0
- package/dist/workbench.d.ts +218 -7
- package/dist/workbench.js +13 -15
- package/dist/workbench.js.map +1 -1
- package/docs/accessibility.md +386 -22
- package/docs/app-layouts.md +106 -8
- package/docs/catalog.md +440 -0
- package/docs/collapsible-panel.md +363 -0
- package/docs/component-contract.md +555 -52
- package/docs/component-integration.md +75 -0
- package/docs/component-selection.md +359 -89
- package/docs/design/templates/empty-state/filtered-dark.svg +1 -0
- package/docs/design/templates/empty-state/filtered.svg +1 -0
- package/docs/design/templates/empty-state/with-action-dark.svg +1 -0
- package/docs/design/templates/empty-state/with-action.svg +1 -0
- package/docs/design/templates/empty-state-dark.svg +1 -0
- package/docs/design/templates/empty-state.svg +1 -0
- package/docs/design/templates/list/compact-dark.svg +1 -0
- package/docs/design/templates/list/compact.svg +1 -0
- package/docs/design/templates/list/stack-dark.svg +1 -0
- package/docs/design/templates/list/stack.svg +1 -0
- package/docs/design/templates/list-action-row/default-dark.svg +1 -0
- package/docs/design/templates/list-action-row/default.svg +1 -0
- package/docs/design/templates/list-action-row/selected-dark.svg +1 -0
- package/docs/design/templates/list-action-row/selected.svg +1 -0
- package/docs/design/templates/list-action-row-dark.svg +1 -0
- package/docs/design/templates/list-action-row.svg +1 -0
- package/docs/design/templates/list-dark.svg +1 -0
- package/docs/design/templates/list-header/action-dark.svg +1 -0
- package/docs/design/templates/list-header/action.svg +1 -0
- package/docs/design/templates/list-header/count-dark.svg +1 -0
- package/docs/design/templates/list-header/count.svg +1 -0
- package/docs/design/templates/list-header/inline-action-dark.svg +1 -0
- package/docs/design/templates/list-header/inline-action.svg +1 -0
- package/docs/design/templates/list-header/toggle-collapsed-dark.svg +1 -0
- package/docs/design/templates/list-header/toggle-collapsed.svg +1 -0
- package/docs/design/templates/list-header/toggle-expanded-dark.svg +1 -0
- package/docs/design/templates/list-header/toggle-expanded.svg +1 -0
- package/docs/design/templates/list-header-dark.svg +1 -0
- package/docs/design/templates/list-header.svg +1 -0
- package/docs/design/templates/list-item/default-dark.svg +1 -0
- package/docs/design/templates/list-item/default.svg +1 -0
- package/docs/design/templates/list-item/multiline-dark.svg +1 -0
- package/docs/design/templates/list-item/multiline.svg +1 -0
- package/docs/design/templates/list-item/selected-dark.svg +1 -0
- package/docs/design/templates/list-item/selected.svg +1 -0
- package/docs/design/templates/list-item/trailing-dark.svg +1 -0
- package/docs/design/templates/list-item/trailing.svg +1 -0
- package/docs/design/templates/list-item-dark.svg +1 -0
- package/docs/design/templates/list-item.svg +1 -0
- package/docs/design/templates/list.svg +1 -0
- package/docs/design/templates/segmented-control/equal-dark.svg +1 -0
- package/docs/design/templates/segmented-control/equal.svg +1 -0
- package/docs/design/templates/segmented-control/pill-small-dark.svg +1 -0
- package/docs/design/templates/segmented-control/pill-small.svg +1 -0
- package/docs/design/templates/segmented-control-dark.svg +1 -0
- package/docs/design/templates/segmented-control.svg +1 -0
- package/docs/design/templates/skeleton/avatar-dark.svg +1 -0
- package/docs/design/templates/skeleton/avatar.svg +1 -0
- package/docs/design/templates/skeleton/block-dark.svg +1 -0
- package/docs/design/templates/skeleton/block.svg +1 -0
- package/docs/design/templates/skeleton/lines-dark.svg +1 -0
- package/docs/design/templates/skeleton/lines.svg +1 -0
- package/docs/design/templates/skeleton-dark.svg +1 -0
- package/docs/design/templates/skeleton.svg +1 -0
- package/docs/design/templates/state-banner/danger-dark.svg +1 -0
- package/docs/design/templates/state-banner/danger.svg +1 -0
- package/docs/design/templates/state-banner/info-badge-dark.svg +1 -0
- package/docs/design/templates/state-banner/info-badge.svg +1 -0
- package/docs/design/templates/state-banner/info-dark.svg +1 -0
- package/docs/design/templates/state-banner/info.svg +1 -0
- package/docs/design/templates/state-banner/success-dark.svg +1 -0
- package/docs/design/templates/state-banner/success.svg +1 -0
- package/docs/design/templates/state-banner/warning-dark.svg +1 -0
- package/docs/design/templates/state-banner/warning.svg +1 -0
- package/docs/design/templates/state-banner-dark.svg +1 -0
- package/docs/design/templates/state-banner.svg +1 -0
- package/docs/design/templates/tab-bar/workspace-tabs-dark.svg +1 -0
- package/docs/design/templates/tab-bar/workspace-tabs.svg +1 -0
- package/docs/design/templates/tab-bar-dark.svg +1 -0
- package/docs/design/templates/tab-bar.svg +1 -0
- package/docs/design/templates/token-search-field/empty-dark.svg +1 -0
- package/docs/design/templates/token-search-field/empty.svg +1 -0
- package/docs/design/templates/token-search-field/tokens-dark.svg +1 -0
- package/docs/design/templates/token-search-field/tokens.svg +1 -0
- package/docs/design/templates/token-search-field-dark.svg +1 -0
- package/docs/design/templates/token-search-field.svg +1 -0
- package/docs/design/templates/toolbar/title-and-actions-dark.svg +1 -0
- package/docs/design/templates/toolbar/title-and-actions.svg +1 -0
- package/docs/design/templates/toolbar-control-group/borderless-single-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/borderless-single.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-buttons-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/icon-buttons.svg +1 -0
- package/docs/design/templates/toolbar-control-group/push-buttons-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/push-buttons.svg +1 -0
- package/docs/design/templates/toolbar-control-group/with-text-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group/with-text.svg +1 -0
- package/docs/design/templates/toolbar-control-group-dark.svg +1 -0
- package/docs/design/templates/toolbar-control-group.svg +1 -0
- package/docs/design/templates/toolbar-dark.svg +1 -0
- package/docs/design/templates/toolbar-text/default-dark.svg +1 -0
- package/docs/design/templates/toolbar-text/default.svg +1 -0
- package/docs/design/templates/toolbar-text/large-dark.svg +1 -0
- package/docs/design/templates/toolbar-text/large.svg +1 -0
- package/docs/design/templates/toolbar-text/small-dark.svg +1 -0
- package/docs/design/templates/toolbar-text/small.svg +1 -0
- package/docs/design/templates/toolbar-text-dark.svg +1 -0
- package/docs/design/templates/toolbar-text.svg +1 -0
- package/docs/design/templates/toolbar.svg +1 -0
- package/docs/design/templates/value-table/details-dark.svg +1 -0
- package/docs/design/templates/value-table/details.svg +1 -0
- package/docs/design/templates/value-table-dark.svg +1 -0
- package/docs/design/templates/value-table.svg +1 -0
- package/docs/design/templates.md +138 -0
- package/docs/design-philosophy.md +48 -20
- package/docs/device-class.md +10 -9
- package/docs/document-baseline.md +38 -0
- package/docs/examples/application-ui-profile.json +60 -0
- package/docs/examples/command-palette-adapter.tsx +69 -17
- package/docs/examples/component-catalog-extension.json +45 -0
- package/docs/examples/component-composition-extension.json +80 -0
- package/docs/layout.md +398 -59
- package/docs/nav-stack.md +126 -14
- package/docs/recipes.md +137 -54
- package/docs/split-view.md +69 -6
- package/docs/sunken-panel.md +53 -0
- package/docs/surface-scaffold.md +25 -0
- package/docs/tab-scaffold.md +94 -10
- package/docs/type-contracts.md +134 -0
- package/docs/ui-analyzer.md +306 -0
- package/docs/ui-doctor.md +107 -0
- package/docs/ui-evaluator.md +139 -0
- package/docs/ux-demo.md +40 -16
- package/docs/webawesome-theme.md +143 -16
- package/docs/workbench.md +534 -12
- package/doctor/cli.mjs +115 -0
- package/doctor/config.schema.json +68 -0
- package/doctor/eslint-diagnostics.d.mts +24 -0
- package/doctor/eslint-diagnostics.mjs +24 -0
- package/doctor/index.d.mts +116 -0
- package/doctor/index.mjs +1277 -0
- package/doctor/report.schema.json +118 -0
- package/evaluator/cli.mjs +89 -0
- package/evaluator/index.d.mts +90 -0
- package/evaluator/index.mjs +1203 -0
- package/evaluator/report.schema.json +152 -0
- package/llms.txt +395 -42
- package/package.json +235 -37
- package/traversal-exclusions.mjs +27 -0
- package/ux-demo/recipes/app-shell.tsx +205 -17
- package/ux-demo/recipes/collapsible-sidebar.tsx +260 -0
- package/ux-demo/recipes/compact-toolbar.tsx +135 -14
- package/ux-demo/recipes/composer-form.tsx +133 -21
- package/ux-demo/recipes/list-detail-dialog.tsx +282 -0
- package/ux-demo/recipes/list-workspace-states.tsx +183 -11
- package/ux-demo/recipes/loaders.ts +15 -5
- package/ux-demo/recipes/loading-inspector.tsx +204 -0
- package/ux-demo/recipes/mount-recipe.ts +28 -10
- package/ux-demo/recipes/navigation-sidebar.tsx +139 -13
- package/ux-demo/recipes/navigation-stack.tsx +79 -24
- package/ux-demo/recipes/types.ts +23 -2
- package/ux-demo/recipes/workspace-header.tsx +86 -5
- package/dist/browser/menu-action-row.js +0 -3
- package/dist/browser/menu-header.js +0 -5
- package/dist/browser/menu-item.js +0 -3
- package/dist/chunk-24Z2XE6C.js +0 -10
- package/dist/chunk-24Z2XE6C.js.map +0 -1
- package/dist/chunk-2RJBFNB6.js +0 -172
- package/dist/chunk-2RJBFNB6.js.map +0 -1
- package/dist/chunk-55DATV3A.js +0 -10
- package/dist/chunk-55DATV3A.js.map +0 -1
- package/dist/chunk-56RJXPHG.js.map +0 -1
- package/dist/chunk-7BR3DO2A.js.map +0 -1
- package/dist/chunk-7LDCTU7D.js +0 -134
- package/dist/chunk-7LDCTU7D.js.map +0 -1
- package/dist/chunk-AQNKJRFH.js +0 -79
- package/dist/chunk-AQNKJRFH.js.map +0 -1
- package/dist/chunk-CTQKI2XL.js +0 -28
- package/dist/chunk-CTQKI2XL.js.map +0 -1
- package/dist/chunk-DAFFDO33.js +0 -14
- package/dist/chunk-DAFFDO33.js.map +0 -1
- package/dist/chunk-EGHL5S4P.js +0 -33
- package/dist/chunk-EGHL5S4P.js.map +0 -1
- package/dist/chunk-KZKSBUKC.js +0 -19
- package/dist/chunk-KZKSBUKC.js.map +0 -1
- package/dist/chunk-M5JRI6MN.js +0 -27
- package/dist/chunk-M5JRI6MN.js.map +0 -1
- package/dist/chunk-MBR3TYNL.js +0 -14
- package/dist/chunk-MBR3TYNL.js.map +0 -1
- package/dist/chunk-MFKMHK5W.js +0 -10
- package/dist/chunk-MFKMHK5W.js.map +0 -1
- package/dist/chunk-MQIZAD4A.js.map +0 -1
- package/dist/chunk-NPPD2A6O.js +0 -40
- package/dist/chunk-NPPD2A6O.js.map +0 -1
- package/dist/chunk-R6JHHBKQ.js +0 -19
- package/dist/chunk-R6JHHBKQ.js.map +0 -1
- package/dist/chunk-RBTVBGRD.js +0 -23
- package/dist/chunk-RBTVBGRD.js.map +0 -1
- package/dist/chunk-S3TPM2LP.js +0 -23
- package/dist/chunk-S3TPM2LP.js.map +0 -1
- package/dist/chunk-TRNBHPNW.js.map +0 -1
- package/dist/chunk-VHW5YNIB.js +0 -17
- package/dist/chunk-VHW5YNIB.js.map +0 -1
- package/dist/chunk-W2FK7ZNY.js.map +0 -1
- package/dist/chunk-WVPYVDXY.js +0 -15
- package/dist/chunk-WVPYVDXY.js.map +0 -1
- package/dist/chunk-XZXRLY5Q.js +0 -33
- package/dist/chunk-XZXRLY5Q.js.map +0 -1
- package/dist/menu-action-row.d.ts +0 -50
- package/dist/menu-action-row.js +0 -4
- package/dist/menu-action-row.js.map +0 -1
- package/dist/menu-header.d.ts +0 -41
- package/dist/menu-header.js +0 -6
- package/dist/menu-header.js.map +0 -1
- package/dist/menu-item.d.ts +0 -31
- package/dist/menu-item.js +0 -4
- package/dist/menu-item.js.map +0 -1
- package/dist/panel-header.d.ts +0 -26
- package/dist/panel-header.js +0 -6
- package/dist/panel-header.js.map +0 -1
- package/dist/styles/menu-action-row.css +0 -160
- package/dist/styles/menu-header.css +0 -160
- package/dist/styles/menu-item.css +0 -123
- package/dist/styles/panel-header.css +0 -59
- package/ux-demo/recipes/master-detail-dialog.tsx +0 -45
- package/ux-demo/recipes/recipes.css +0 -355
|
@@ -1,11 +1,124 @@
|
|
|
1
1
|
# Public API signatures for the UI authoring corpus
|
|
2
2
|
|
|
3
|
-
Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.
|
|
3
|
+
Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.60` and `kerfjs@5.0.0-beta.60`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
|
|
4
|
+
|
|
5
|
+
## `@kerfjs/ui/css-values`
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
declare const cssValueBrand: unique symbol;
|
|
9
|
+
declare const cssLengthBrand: unique symbol;
|
|
10
|
+
declare const cssLengthExpressionBrand: unique symbol;
|
|
11
|
+
declare const cssFlexBrand: unique symbol;
|
|
12
|
+
declare const cssColorBrand: unique symbol;
|
|
13
|
+
declare const cssForegroundColorBrand: unique symbol;
|
|
14
|
+
/**
|
|
15
|
+
* A complete typed CSS value minted by a property-specific Kerf UI builder.
|
|
16
|
+
*
|
|
17
|
+
* This brand is an authoring correctness aid, not a sanitizer or security
|
|
18
|
+
* boundary. Prefer the narrower property grammar, such as {@link CssLength},
|
|
19
|
+
* whenever one is available.
|
|
20
|
+
*/
|
|
21
|
+
type CssValue = string & {
|
|
22
|
+
readonly [cssValueBrand]: 'CssValue';
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A complete CSS length-percentage value suitable for dimension-valued UI
|
|
26
|
+
* props. Despite the concise name, percentages are intentionally included.
|
|
27
|
+
*/
|
|
28
|
+
type CssLength = CssValue & {
|
|
29
|
+
readonly [cssLengthBrand]: 'CssLength';
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* An incomplete arithmetic expression. Wrap it with {@link calc} before
|
|
33
|
+
* passing it to a prop that accepts {@link CssLength}.
|
|
34
|
+
*/
|
|
35
|
+
type CssLengthExpression = string & {
|
|
36
|
+
readonly [cssLengthExpressionBrand]: 'CssLengthExpression';
|
|
37
|
+
};
|
|
38
|
+
/** A complete CSS `flex` shorthand. It is not interchangeable with a length. */
|
|
39
|
+
type CssFlex = CssValue & {
|
|
40
|
+
readonly [cssFlexBrand]: 'CssFlex';
|
|
41
|
+
};
|
|
42
|
+
/** A complete CSS color value. It is not interchangeable with a length. */
|
|
43
|
+
type CssColor = CssValue & {
|
|
44
|
+
readonly [cssColorBrand]: 'CssColor';
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* A complete CSS color meant to paint a foreground: text or an icon drawn over
|
|
48
|
+
* a surface. Mint it with {@link uiColor} and a foreground token name
|
|
49
|
+
* ({@link UiForegroundColorName}) or with {@link foregroundColorVar}. It is a
|
|
50
|
+
* {@link CssColor}, but a plain `CssColor` is not a foreground color: fill,
|
|
51
|
+
* border, and surface tokens are pale backgrounds that leave a foreground
|
|
52
|
+
* nearly invisible.
|
|
53
|
+
*/
|
|
54
|
+
type CssForegroundColor = CssColor & {
|
|
55
|
+
readonly [cssForegroundColorBrand]: 'CssForegroundColor';
|
|
56
|
+
};
|
|
57
|
+
type CssFlexKeyword = 'none' | 'auto' | 'initial';
|
|
58
|
+
type CssFlexBasis = CssLength | 'auto' | 'content' | 'min-content' | 'max-content' | 'fit-content';
|
|
59
|
+
type CssSizeKeyword = 'auto' | 'min-content' | 'max-content' | 'fit-content';
|
|
60
|
+
/** A complete width/height value accepted by dimension-valued UI props. */
|
|
61
|
+
type CssSize = CssLength | CssSizeKeyword;
|
|
62
|
+
declare const uiColorNames: readonly ["brand-border-loud", "brand-border-normal", "brand-border-quiet", "brand-fill-loud", "brand-fill-normal", "brand-fill-quiet", "brand-on-fill", "brand-on-loud", "brand-on-normal", "brand-on-quiet", "danger-border-loud", "danger-border-normal", "danger-border-quiet", "danger-fill-loud", "danger-fill-normal", "danger-fill-quiet", "danger-on-fill", "danger-on-loud", "danger-on-normal", "danger-on-quiet", "neutral-border-loud", "neutral-border-normal", "neutral-border-quiet", "neutral-fill-loud", "neutral-fill-normal", "neutral-fill-quiet", "neutral-on-loud", "neutral-on-normal", "neutral-on-quiet", "pop-border-loud", "pop-border-normal", "pop-border-quiet", "pop-fill-loud", "pop-fill-normal", "pop-fill-quiet", "pop-on-fill", "pop-on-loud", "pop-on-normal", "pop-on-quiet", "success-border-loud", "success-border-normal", "success-border-quiet", "success-fill-loud", "success-fill-normal", "success-fill-quiet", "success-on-fill", "success-on-loud", "success-on-normal", "success-on-quiet", "surface", "surface-lowered", "surface-raised", "text", "text-link", "text-quiet", "warning-border-loud", "warning-border-normal", "warning-border-quiet", "warning-fill-loud", "warning-fill-normal", "warning-fill-quiet", "warning-on-fill", "warning-on-loud", "warning-on-normal", "warning-on-quiet"];
|
|
63
|
+
/** Names of the public `--kui-color-*` semantic tokens. */
|
|
64
|
+
type UiColorName = (typeof uiColorNames)[number];
|
|
65
|
+
/** The semantic tokens that paint a foreground: the `*-on-*` and text roles. */
|
|
66
|
+
type UiForegroundColorName = Extract<UiColorName, `${string}-on-${string}` | 'text' | 'text-quiet' | 'text-link'>;
|
|
67
|
+
/** Kerf UI's complete spacing-token vocabulary. `s` and `xl` are exceptions. */
|
|
68
|
+
type UiSpaceName = 'none' | '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
69
|
+
/** Create a complete pixel length. */
|
|
70
|
+
declare function px(value: number): CssLength;
|
|
71
|
+
/** Create a complete root-font-relative length. */
|
|
72
|
+
declare function rem(value: number): CssLength;
|
|
73
|
+
/** Converts a pixel value into rem units by dividing by 16. */
|
|
74
|
+
declare function remify(value: number): CssLength;
|
|
75
|
+
/** Create a complete current-font-relative length. */
|
|
76
|
+
declare function em(value: number): CssLength;
|
|
77
|
+
/** Create a complete percentage length. */
|
|
78
|
+
declare function pct(value: number): CssLength;
|
|
79
|
+
/** Resolve a Kerf UI spacing step to its public custom property. */
|
|
80
|
+
declare function space(name: UiSpaceName): CssLength;
|
|
81
|
+
/**
|
|
82
|
+
* Reference an application-owned custom property whose contract is a CSS
|
|
83
|
+
* length-percentage. The deliberately narrow name grammar keeps this helper
|
|
84
|
+
* from becoming an arbitrary CSS-string constructor.
|
|
85
|
+
*/
|
|
86
|
+
declare function lengthVar(name: `--${string}`, fallback?: CssLength): CssLength;
|
|
87
|
+
/** Combine two or more complete lengths into a non-standalone sum. */
|
|
88
|
+
declare function plus(first: CssLength, second: CssLength, ...rest: readonly CssLength[]): CssLengthExpression;
|
|
89
|
+
/** Turn a typed length expression into a complete CSS `calc()` value. */
|
|
90
|
+
declare function calc(expression: CssLengthExpression): CssLength;
|
|
91
|
+
/** Build a complete, structured CSS flex shorthand. */
|
|
92
|
+
declare function flex(grow: number, shrink?: number, basis?: CssFlexBasis): CssFlex;
|
|
93
|
+
/**
|
|
94
|
+
* The brand {@link uiColor} returns for a token name: a
|
|
95
|
+
* {@link CssForegroundColor} for a foreground token, otherwise a plain
|
|
96
|
+
* {@link CssColor}.
|
|
97
|
+
*/
|
|
98
|
+
type UiColor<Name extends UiColorName> = Name extends UiForegroundColorName ? CssForegroundColor : CssColor;
|
|
99
|
+
/**
|
|
100
|
+
* Resolve a public Kerf UI semantic color token. A foreground token name
|
|
101
|
+
* (`success-on-quiet`, `text-quiet`, …) returns a {@link CssForegroundColor};
|
|
102
|
+
* any other token returns a plain {@link CssColor}.
|
|
103
|
+
*/
|
|
104
|
+
declare function uiColor<Name extends UiColorName>(name: Name): UiColor<Name>;
|
|
105
|
+
/** Reference an application-owned custom property whose contract is a color. */
|
|
106
|
+
declare function colorVar(name: `--${string}`, fallback?: CssColor): CssColor;
|
|
107
|
+
/**
|
|
108
|
+
* Reference an application-owned custom property whose contract is a
|
|
109
|
+
* foreground color (text or an icon over a surface). Use it where a prop
|
|
110
|
+
* accepts only {@link CssForegroundColor}, such as `SelectChoice.color`.
|
|
111
|
+
*/
|
|
112
|
+
declare function foregroundColorVar(name: `--${string}`, fallback?: CssForegroundColor): CssForegroundColor;
|
|
113
|
+
|
|
114
|
+
export { type CssColor, type CssFlex, type CssFlexBasis, type CssFlexKeyword, type CssForegroundColor, type CssLength, type CssLengthExpression, type CssSize, type CssSizeKeyword, type CssValue, type UiColor, type UiColorName, type UiForegroundColorName, type UiSpaceName, calc, colorVar, em, flex, foregroundColorVar, lengthVar, pct, plus, px, rem, remify, space, uiColor };
|
|
115
|
+
```
|
|
4
116
|
|
|
5
117
|
## `@kerfjs/ui/disclosure-arrow`
|
|
6
118
|
|
|
7
119
|
```ts
|
|
8
120
|
import { SafeHtml } from 'kerfjs';
|
|
121
|
+
import { CssLength } from './css-values.js';
|
|
9
122
|
|
|
10
123
|
type DisclosureDirection = 'up' | 'down' | 'left' | 'right';
|
|
11
124
|
interface DisclosureArrowProps {
|
|
@@ -14,9 +127,13 @@ interface DisclosureArrowProps {
|
|
|
14
127
|
closedDirection?: DisclosureDirection;
|
|
15
128
|
/** Replacement icons should use right as their unrotated orientation. */
|
|
16
129
|
icon?: SafeHtml;
|
|
130
|
+
/** Typed box size for the square visual. Default: `remify(18px)`. */
|
|
131
|
+
size?: CssLength;
|
|
17
132
|
className?: string;
|
|
133
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
134
|
+
slot?: string;
|
|
18
135
|
}
|
|
19
|
-
declare function DisclosureArrow({ open, openDirection, closedDirection, icon, className, }: DisclosureArrowProps): SafeHtml;
|
|
136
|
+
declare function DisclosureArrow({ open, openDirection, closedDirection, icon, size, className, slot, }: DisclosureArrowProps): SafeHtml;
|
|
20
137
|
|
|
21
138
|
export { DisclosureArrow, type DisclosureArrowProps, type DisclosureDirection };
|
|
22
139
|
```
|
|
@@ -24,19 +141,68 @@ export { DisclosureArrow, type DisclosureArrowProps, type DisclosureDirection };
|
|
|
24
141
|
## `@kerfjs/ui/toolbar`
|
|
25
142
|
|
|
26
143
|
```ts
|
|
27
|
-
import
|
|
144
|
+
import * as kerfjs from 'kerfjs';
|
|
145
|
+
import { PaneSeparatorSide } from './pane.js';
|
|
146
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
147
|
+
import { S as Sides } from './sides-BPSWde0A.js';
|
|
28
148
|
|
|
29
149
|
interface ToolbarProps {
|
|
30
|
-
leading?:
|
|
31
|
-
center?:
|
|
32
|
-
trailing?:
|
|
150
|
+
leading?: KerfUiContent;
|
|
151
|
+
center?: KerfUiContent;
|
|
152
|
+
trailing?: KerfUiContent;
|
|
33
153
|
label?: string;
|
|
34
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Physical divider edges in canonical top/right/bottom/left order, drawn
|
|
156
|
+
* always. Defaults to none: a toolbar pinned over or under scrolling content
|
|
157
|
+
* gets its divider from the scroll state instead — a `Pane` draws the line
|
|
158
|
+
* between its chrome and content while content is scrolled away beneath it,
|
|
159
|
+
* and `wireScrollDividers` `targets` can name a toolbar as chrome, which
|
|
160
|
+
* then draws its facing side the same way.
|
|
161
|
+
*/
|
|
162
|
+
dividerSides?: Sides;
|
|
163
|
+
/** Horizontal treatment of the center zone. Defaults to centered content. */
|
|
164
|
+
centerAlign?: 'center' | 'stretch';
|
|
165
|
+
/**
|
|
166
|
+
* Component-owned responsive layout; applications choose the policy rather
|
|
167
|
+
* than restyling toolbar internals. Under every policy the trailing zone
|
|
168
|
+
* wraps its groups instead of clipping an action, and the center zone keeps
|
|
169
|
+
* its whole content width: when the zones do not fit one row, the leading
|
|
170
|
+
* title truncates with an ellipsis rather than the center overlapping it.
|
|
171
|
+
* - `none` keeps one row; the leading identity truncates first.
|
|
172
|
+
* - `stack` stacks the zones at `responsiveAt`, wrapping stacked control
|
|
173
|
+
* groups onto further rows.
|
|
174
|
+
* - `wrap` keeps one row while every zone fits at its natural width, and
|
|
175
|
+
* otherwise moves the trailing zone below a whole leading identity.
|
|
176
|
+
* - `center-priority` gives an expanded center control the full row.
|
|
177
|
+
* - `trailing-priority` moves an expanded trailing control to a full row
|
|
178
|
+
* below the leading identity at `responsiveAt`.
|
|
179
|
+
*/
|
|
180
|
+
responsive?: 'none' | 'stack' | 'wrap' | 'center-priority' | 'trailing-priority';
|
|
181
|
+
/** Container width at which `stack` or `trailing-priority` activates. */
|
|
182
|
+
responsiveAt?: 'compact' | 'narrow';
|
|
183
|
+
/**
|
|
184
|
+
* Screen edges this toolbar claims for device safe-area compensation, for an
|
|
185
|
+
* app bar or bottom bar that sits directly at a screen edge rather than in a
|
|
186
|
+
* Pane header or footer. Each listed side pads by the inset its surrounding
|
|
187
|
+
* layout reports through `--kui-edge-inset-*`, or the full device inset when
|
|
188
|
+
* nothing routes that edge, while the toolbar's box and dividers paint
|
|
189
|
+
* through. Omitted, the toolbar pads only the inline edges an owner such as
|
|
190
|
+
* a Pane header hands it, and never a block edge.
|
|
191
|
+
*/
|
|
192
|
+
safeAreaEdges?: readonly PaneSeparatorSide[];
|
|
35
193
|
className?: string;
|
|
194
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
195
|
+
slot?: string;
|
|
36
196
|
}
|
|
37
|
-
|
|
197
|
+
/**
|
|
198
|
+
* A toolbar's configuration, apart from its content: the props a composite
|
|
199
|
+
* that renders a `Toolbar` for the app (a Workbench or CollapsiblePanel
|
|
200
|
+
* toolbar) forwards, so the app configures that toolbar instead of styling it.
|
|
201
|
+
*/
|
|
202
|
+
type ToolbarConfig = Pick<ToolbarProps, 'dividerSides' | 'centerAlign' | 'responsive' | 'responsiveAt' | 'safeAreaEdges'>;
|
|
203
|
+
declare function Toolbar({ leading, center, trailing, label, dividerSides, centerAlign, responsive, responsiveAt, safeAreaEdges, className, slot, }: ToolbarProps): kerfjs.SafeHtml;
|
|
38
204
|
|
|
39
|
-
export { Toolbar, type ToolbarProps };
|
|
205
|
+
export { Sides, Toolbar, type ToolbarConfig, type ToolbarProps };
|
|
40
206
|
```
|
|
41
207
|
|
|
42
208
|
## `@kerfjs/ui/toolbar-text`
|
|
@@ -44,112 +210,495 @@ export { Toolbar, type ToolbarProps };
|
|
|
44
210
|
```ts
|
|
45
211
|
import * as kerfjs from 'kerfjs';
|
|
46
212
|
|
|
47
|
-
type ToolbarTextSize = 'xlarge' | 'large' | 'default' | 'small';
|
|
48
|
-
|
|
213
|
+
type ToolbarTextSize = 'xlarge' | 'large' | 'default' | 'small' | 'xsmall';
|
|
214
|
+
/** ARIA heading level for a title exposed as a heading landmark. */
|
|
215
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
216
|
+
interface ToolbarTextBaseProps {
|
|
49
217
|
text: string;
|
|
50
218
|
size?: ToolbarTextSize;
|
|
51
219
|
className?: string;
|
|
52
220
|
/** Optional id, e.g. so a dialog can reference the title via aria-labelledby. */
|
|
53
221
|
id?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Expose heading semantics (`role="heading"` + `aria-level`) so the text acts as
|
|
224
|
+
* a heading landmark — e.g. a page's primary title. Omit to keep the plain span
|
|
225
|
+
* (the default), which suits a dialog title referenced via `aria-labelledby`.
|
|
226
|
+
*/
|
|
227
|
+
headingLevel?: HeadingLevel;
|
|
228
|
+
/** Render the text as an unanimated loading skeleton instead of its value. */
|
|
229
|
+
placeholder?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Show a trailing ellipsis (…) where the text is truncated — on the single line
|
|
232
|
+
* (default), or at the `maxLines` boundary when wrapping. Set false to hard-clip
|
|
233
|
+
* instead. Default true.
|
|
234
|
+
*/
|
|
235
|
+
ellipsis?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Grow to fill the free space of the flex row it sits in (a Toolbar zone),
|
|
238
|
+
* truncating at the space left by its siblings instead of taking only its
|
|
239
|
+
* text's width. Default false.
|
|
240
|
+
*/
|
|
241
|
+
fill?: boolean;
|
|
242
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
243
|
+
slot?: string;
|
|
54
244
|
}
|
|
55
|
-
|
|
245
|
+
type ToolbarTextWrappingProps = {
|
|
246
|
+
/** Wrap onto multiple lines; combine with `maxLines` to cap them. */
|
|
247
|
+
wrap: true;
|
|
248
|
+
maxLines?: number | null;
|
|
249
|
+
} | {
|
|
250
|
+
wrap?: false;
|
|
251
|
+
maxLines?: never;
|
|
252
|
+
};
|
|
253
|
+
type ToolbarTextProps = ToolbarTextBaseProps & ToolbarTextWrappingProps;
|
|
254
|
+
declare function ToolbarText({ text, size, className, id, headingLevel, placeholder, wrap, ellipsis, maxLines, fill, slot, }: ToolbarTextProps): kerfjs.SafeHtml;
|
|
56
255
|
|
|
57
|
-
export { ToolbarText, type ToolbarTextProps, type ToolbarTextSize };
|
|
256
|
+
export { type HeadingLevel, ToolbarText, type ToolbarTextProps, type ToolbarTextSize };
|
|
58
257
|
```
|
|
59
258
|
|
|
60
259
|
## `@kerfjs/ui/toolbar-control-group`
|
|
61
260
|
|
|
62
261
|
```ts
|
|
63
|
-
import
|
|
64
|
-
|
|
262
|
+
import * as kerfjs from 'kerfjs';
|
|
263
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
264
|
+
|
|
265
|
+
type ToolbarControlGroupAppearance = 'contained' | 'borderless';
|
|
266
|
+
type ToolbarControlGroupTone = 'default' | 'dark';
|
|
267
|
+
type ToolbarControlGroupButtonAppearance = 'plain' | 'push';
|
|
268
|
+
type ToolbarControlGroupShape = 'pill' | 'rounded';
|
|
269
|
+
type ToolbarControlGroupSize = 'default' | 'compact';
|
|
270
|
+
type ToolbarControlGroupDensity = 'comfortable' | 'tight';
|
|
271
|
+
type ToolbarControlGroupContent = 'icon' | 'text' | 'mixed' | 'avatar' | 'search';
|
|
272
|
+
type ToolbarControlGroupFocusRing = 'control' | 'outline' | 'halo';
|
|
273
|
+
type ToolbarControlGroupSelectedChrome = 'raised' | 'filled' | 'outline';
|
|
274
|
+
type ToolbarControlGroupSelectedTone = 'brand' | 'neutral' | 'pop';
|
|
275
|
+
type ToolbarControlGroupOverflow = 'visible' | 'scroll';
|
|
276
|
+
type ToolbarControlGroupMenuInset = 'standard' | 'compact' | 'list-zero';
|
|
277
|
+
type ToolbarControlGroupVisibility = 'always' | 'compact-only';
|
|
278
|
+
interface ToolbarActionLinkProps {
|
|
279
|
+
href: string;
|
|
280
|
+
label: string;
|
|
281
|
+
icon?: KerfUiContent;
|
|
282
|
+
/** Optional machine-readable detail hidden visually but included in the default accessible name. */
|
|
283
|
+
detail?: string;
|
|
284
|
+
/** Override the accessible name when surrounding context is needed. */
|
|
285
|
+
ariaLabel?: string;
|
|
286
|
+
/** Open in a new tab with a safe rel and announce that behavior. */
|
|
287
|
+
external?: boolean;
|
|
288
|
+
className?: string;
|
|
289
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
290
|
+
slot?: string;
|
|
291
|
+
}
|
|
292
|
+
/** A semantic anchor with ToolbarControlGroup-owned action geometry. */
|
|
293
|
+
declare function ToolbarActionLink({ href, label, icon, detail, ariaLabel, external, className, slot, }: ToolbarActionLinkProps): kerfjs.SafeHtml;
|
|
65
294
|
interface ToolbarControlGroupProps {
|
|
66
|
-
children:
|
|
295
|
+
children: KerfUiContent;
|
|
67
296
|
label?: string;
|
|
68
297
|
className?: string;
|
|
69
298
|
expanded?: boolean;
|
|
70
299
|
single?: boolean;
|
|
71
|
-
appearance?:
|
|
72
|
-
tone?:
|
|
73
|
-
buttonAppearance?:
|
|
300
|
+
appearance?: ToolbarControlGroupAppearance;
|
|
301
|
+
tone?: ToolbarControlGroupTone;
|
|
302
|
+
buttonAppearance?: ToolbarControlGroupButtonAppearance;
|
|
303
|
+
/** Corner shape: fully round `pill` (default) or a softer `rounded` rectangle. */
|
|
304
|
+
shape?: ToolbarControlGroupShape;
|
|
305
|
+
size?: ToolbarControlGroupSize;
|
|
306
|
+
density?: ToolbarControlGroupDensity;
|
|
307
|
+
content?: ToolbarControlGroupContent;
|
|
308
|
+
/** Whether controls paint focus individually or the group paints an outline/halo on focus-within. */
|
|
309
|
+
focusRing?: ToolbarControlGroupFocusRing;
|
|
310
|
+
selectedChrome?: ToolbarControlGroupSelectedChrome;
|
|
311
|
+
selectedTone?: ToolbarControlGroupSelectedTone;
|
|
312
|
+
/** Size a nested Web Awesome dropdown trigger as part of this group. */
|
|
313
|
+
nestedDropdown?: boolean;
|
|
314
|
+
/** Configure the nested dropdown menu inset without consumer ::part() CSS. */
|
|
315
|
+
menuInset?: ToolbarControlGroupMenuInset;
|
|
316
|
+
/** Keep an overlong row of actions inside the available width with horizontal scrolling. */
|
|
317
|
+
overflow?: ToolbarControlGroupOverflow;
|
|
318
|
+
/** Responsive visibility owned by the enclosing Toolbar container. */
|
|
319
|
+
visibility?: ToolbarControlGroupVisibility;
|
|
320
|
+
/** Move this group into the work-area toolbar when its panel collapses. */
|
|
321
|
+
relocateOnCollapse?: boolean;
|
|
322
|
+
/** Add contrast behind photo-backed avatar content. */
|
|
323
|
+
scrim?: boolean;
|
|
324
|
+
/**
|
|
325
|
+
* Avatar image URL. A single-control group paints it on the group; a
|
|
326
|
+
* multi-control group paints it only on the pressed selection highlight.
|
|
327
|
+
*/
|
|
328
|
+
avatarImage?: string;
|
|
329
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
330
|
+
slot?: string;
|
|
331
|
+
}
|
|
332
|
+
declare function ToolbarControlGroup({ children, label, className, expanded, single, appearance, tone, buttonAppearance, shape, size, density, content, focusRing, selectedChrome, selectedTone, nestedDropdown, menuInset, overflow, visibility, relocateOnCollapse, scrim, avatarImage, slot, }: ToolbarControlGroupProps): kerfjs.SafeHtml;
|
|
333
|
+
|
|
334
|
+
export { ToolbarActionLink, type ToolbarActionLinkProps, ToolbarControlGroup, type ToolbarControlGroupAppearance, type ToolbarControlGroupButtonAppearance, type ToolbarControlGroupContent, type ToolbarControlGroupDensity, type ToolbarControlGroupFocusRing, type ToolbarControlGroupMenuInset, type ToolbarControlGroupOverflow, type ToolbarControlGroupProps, type ToolbarControlGroupSelectedChrome, type ToolbarControlGroupSelectedTone, type ToolbarControlGroupShape, type ToolbarControlGroupSize, type ToolbarControlGroupTone, type ToolbarControlGroupVisibility };
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## `@kerfjs/ui/floating-toolbar`
|
|
338
|
+
|
|
339
|
+
```ts
|
|
340
|
+
import * as kerfjs from 'kerfjs';
|
|
341
|
+
import { CssLength } from './css-values.js';
|
|
342
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
343
|
+
|
|
344
|
+
/** Where a {@link FloatingToolbar} floats within its positioned container. */
|
|
345
|
+
type FloatingToolbarPosition = 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end';
|
|
346
|
+
interface FloatingToolbarProps {
|
|
347
|
+
/** Toolbar contents — normally one or more `ToolbarControlGroup`s. */
|
|
348
|
+
children: KerfUiContent;
|
|
349
|
+
/** Accessible name for the toolbar (required — it exposes `role="toolbar"`). */
|
|
350
|
+
label: string;
|
|
351
|
+
/**
|
|
352
|
+
* Corner or edge it floats to inside its nearest positioned ancestor.
|
|
353
|
+
* Default: `'bottom-end'`.
|
|
354
|
+
*/
|
|
355
|
+
position?: FloatingToolbarPosition;
|
|
356
|
+
/** Keep the toolbar in normal document flow instead of floating over content. */
|
|
357
|
+
placement?: 'floating' | 'inline';
|
|
358
|
+
/**
|
|
359
|
+
* Distance from the container edges named by `position`. Default:
|
|
360
|
+
* `space('m')` (16px, 8px past a top toolbar's own inset). Omit it inside a
|
|
361
|
+
* `Workbench`, `CollapsiblePanel`, or `ResizableRegion` restore corner: the
|
|
362
|
+
* corner owns the inset there and sets it to zero.
|
|
363
|
+
*/
|
|
364
|
+
inset?: CssLength;
|
|
365
|
+
/** Add device or layout-routed safe-area insets to the positioned edges. */
|
|
366
|
+
safeAreaInsets?: boolean;
|
|
367
|
+
className?: string;
|
|
368
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
369
|
+
slot?: string;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* A toolbar that floats above the main content of its nearest positioned
|
|
373
|
+
* ancestor — a transparent, forced-dark cluster of controls (e.g. a drawer
|
|
374
|
+
* restore button) that sits over the content but NOT over dialogs or overlays
|
|
375
|
+
* (it is not in the top layer). It is inset from the container edges by
|
|
376
|
+
* `inset` (default `--kui-space-m`, i.e. 8px more than a top toolbar's own
|
|
377
|
+
* inset); pass a typed length to move it. Inside a `Workbench`, `CollapsiblePanel`, or
|
|
378
|
+
* `ResizableRegion` restore corner the corner owns the inset, so the toolbar
|
|
379
|
+
* floats from the corner's own position. While one of those layouts has a
|
|
380
|
+
* side overlay open over the toolbar's region (a Workbench rail overlay, a
|
|
381
|
+
* `wireSidebar` compact overlay, an overlay `CollapsiblePanel` or horizontal
|
|
382
|
+
* `ResizableRegion`), the toolbar is hidden — unfocusable and out of the
|
|
383
|
+
* accessibility tree — until the overlay closes. The app owns the controls
|
|
384
|
+
* and their behavior — wire them with `delegate()` as usual. Set
|
|
385
|
+
* `placement="inline"` for normal flow when an owner already positions the
|
|
386
|
+
* control; floating placement can add safe-area insets to its per-edge tokens.
|
|
387
|
+
*/
|
|
388
|
+
declare function FloatingToolbar({ children, label, position, placement, inset, safeAreaInsets, className, slot, }: FloatingToolbarProps): kerfjs.SafeHtml;
|
|
389
|
+
|
|
390
|
+
export { FloatingToolbar, type FloatingToolbarPosition, type FloatingToolbarProps };
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## `@kerfjs/ui/popup-menu`
|
|
394
|
+
|
|
395
|
+
```ts
|
|
396
|
+
import { SafeHtml } from 'kerfjs';
|
|
397
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
398
|
+
|
|
399
|
+
type PopupMenuPlacement = 'bottom-start' | 'bottom' | 'bottom-end' | 'top-start' | 'top' | 'top-end';
|
|
400
|
+
type PopupMenuDataAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
401
|
+
'data-action'?: never;
|
|
402
|
+
'data-component'?: never;
|
|
403
|
+
'data-key'?: never;
|
|
404
|
+
'data-morph-skip-children'?: never;
|
|
405
|
+
}>;
|
|
406
|
+
/** One command in the menu. */
|
|
407
|
+
interface PopupMenuItem {
|
|
408
|
+
kind?: 'item';
|
|
409
|
+
label: string;
|
|
410
|
+
/** Delegated `data-action` the app handles when the item is chosen. */
|
|
411
|
+
action?: string;
|
|
412
|
+
/** Native `wa-dropdown-item` value, reported by its `wa-select` event. */
|
|
413
|
+
value?: string;
|
|
414
|
+
/** Leading icon, typically a `LucideIcon`; it is placed in the item's icon slot. */
|
|
415
|
+
icon?: SafeHtml;
|
|
416
|
+
/** A checked menu choice, including nested choices. */
|
|
417
|
+
checked?: boolean;
|
|
418
|
+
/** Trailing safe content, such as a selected-choice tick. */
|
|
419
|
+
details?: SafeHtml;
|
|
420
|
+
/** Destructive command styling. */
|
|
421
|
+
tone?: 'default' | 'danger';
|
|
422
|
+
disabled?: boolean;
|
|
423
|
+
/** Native tooltip text for a disabled command. */
|
|
424
|
+
disabledReason?: string;
|
|
425
|
+
/** Application `data-*` metadata such as a record id. */
|
|
426
|
+
attributes?: PopupMenuDataAttributes;
|
|
427
|
+
/** Child commands opened by hover or keyboard navigation. */
|
|
428
|
+
submenu?: readonly PopupMenuItem[];
|
|
429
|
+
}
|
|
430
|
+
/** A labeled group heading; items that follow it belong to the group. */
|
|
431
|
+
interface PopupMenuHeading {
|
|
432
|
+
kind: 'heading';
|
|
433
|
+
label: string;
|
|
434
|
+
}
|
|
435
|
+
/** A separator between groups of items. */
|
|
436
|
+
interface PopupMenuDivider {
|
|
437
|
+
kind: 'divider';
|
|
74
438
|
}
|
|
75
|
-
|
|
439
|
+
type PopupMenuEntry = PopupMenuItem | PopupMenuHeading | PopupMenuDivider;
|
|
440
|
+
type PopupMenuTriggerName = {
|
|
441
|
+
/** Visible trigger text, which is also its accessible name. */
|
|
442
|
+
text: string;
|
|
443
|
+
label?: never;
|
|
444
|
+
} | {
|
|
445
|
+
text?: never;
|
|
446
|
+
/**
|
|
447
|
+
* Accessible name of an icon-only trigger, rendered as visually hidden
|
|
448
|
+
* slotted text (a Web Awesome button takes its name from its content).
|
|
449
|
+
*/
|
|
450
|
+
label: string;
|
|
451
|
+
};
|
|
452
|
+
type PopupMenuTrigger = (PopupMenuTriggerName & {
|
|
453
|
+
context?: false;
|
|
454
|
+
}) | {
|
|
455
|
+
context: true;
|
|
456
|
+
label: string;
|
|
457
|
+
text?: never;
|
|
458
|
+
icon?: never;
|
|
459
|
+
caret?: never;
|
|
460
|
+
disabled?: never;
|
|
461
|
+
};
|
|
462
|
+
type PopupMenuProps = PopupMenuTrigger & {
|
|
463
|
+
/** Trigger icon, typically a `LucideIcon`, before any visible text. */
|
|
464
|
+
icon?: KerfUiContent;
|
|
465
|
+
items: readonly PopupMenuEntry[];
|
|
466
|
+
/** Where the menu opens relative to its trigger. Defaults to `bottom-start`. */
|
|
467
|
+
placement?: PopupMenuPlacement;
|
|
468
|
+
/** Show the disclosure caret after the trigger content. Defaults to true. */
|
|
469
|
+
caret?: boolean;
|
|
470
|
+
disabled?: boolean;
|
|
471
|
+
/** Application `data-*` metadata on the menu root. */
|
|
472
|
+
rootAttributes?: PopupMenuDataAttributes;
|
|
473
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
474
|
+
slot?: string;
|
|
475
|
+
};
|
|
476
|
+
/** A rendered context PopupMenu with Web Awesome's controlled open state. */
|
|
477
|
+
type PopupMenuElement = HTMLElement & {
|
|
478
|
+
open: boolean;
|
|
479
|
+
};
|
|
480
|
+
/** Open a context PopupMenu at viewport pointer coordinates. */
|
|
481
|
+
declare function openPopupMenuAt(menu: PopupMenuElement, x: number, y: number): void;
|
|
482
|
+
/** Close a programmatically opened PopupMenu. */
|
|
483
|
+
declare function closePopupMenu(menu: PopupMenuElement): void;
|
|
484
|
+
/**
|
|
485
|
+
* An action menu: a trigger button that opens a list of commands. Renders the
|
|
486
|
+
* `wa-dropdown` root directly, so a `single` `ToolbarControlGroup` (with
|
|
487
|
+
* `nestedDropdown`) or a `PopupSurface` sizes and insets it as usual. Items
|
|
488
|
+
* dispatch through delegated `data-action`s; the app owns the commands and any
|
|
489
|
+
* open-state reaction. Import `@kerfjs/ui/popup-menu/register` once to register
|
|
490
|
+
* the Web Awesome elements.
|
|
491
|
+
*/
|
|
492
|
+
declare function PopupMenu({ text, label, icon, items, placement, caret, disabled, rootAttributes, slot, context, }: PopupMenuProps): SafeHtml;
|
|
76
493
|
|
|
77
|
-
export {
|
|
494
|
+
export { PopupMenu, type PopupMenuDivider, type PopupMenuElement, type PopupMenuEntry, type PopupMenuHeading, type PopupMenuItem, type PopupMenuPlacement, type PopupMenuProps, closePopupMenu, openPopupMenuAt };
|
|
78
495
|
```
|
|
79
496
|
|
|
80
|
-
## `@kerfjs/ui/
|
|
497
|
+
## `@kerfjs/ui/list-header`
|
|
81
498
|
|
|
82
499
|
```ts
|
|
83
500
|
import { SafeHtml } from 'kerfjs';
|
|
501
|
+
import { HeadingLevel } from './toolbar-text.js';
|
|
84
502
|
|
|
85
|
-
type
|
|
503
|
+
type ListHeaderRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
86
504
|
'data-component'?: never;
|
|
87
505
|
'data-action'?: never;
|
|
88
506
|
'data-has-badge'?: never;
|
|
89
507
|
'data-has-count'?: never;
|
|
508
|
+
'data-density'?: never;
|
|
509
|
+
'data-divider'?: never;
|
|
510
|
+
'data-inline'?: never;
|
|
511
|
+
'data-width'?: never;
|
|
512
|
+
'data-indicator-tone'?: never;
|
|
90
513
|
'data-toggle'?: never;
|
|
91
514
|
}>;
|
|
92
|
-
type
|
|
515
|
+
type ListHeaderTriggerAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
93
516
|
'data-action'?: never;
|
|
517
|
+
'data-kui-disabled'?: never;
|
|
94
518
|
popoverTarget?: string;
|
|
95
519
|
popoverTargetAction?: 'toggle' | 'show' | 'hide';
|
|
96
520
|
'aria-controls'?: string;
|
|
97
521
|
'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | 'true';
|
|
98
522
|
}>;
|
|
99
|
-
interface
|
|
523
|
+
interface ListHeaderBaseProps {
|
|
100
524
|
label: string;
|
|
101
|
-
|
|
102
|
-
|
|
525
|
+
density?: 'standard' | 'compact';
|
|
526
|
+
divider?: 'none' | 'before' | 'after' | 'both';
|
|
527
|
+
/** Shrink-wrap the header without its default outer margin, border, or padding. */
|
|
528
|
+
inline?: boolean;
|
|
529
|
+
/** Fill the available row or shrink-wrap while retaining normal header geometry. */
|
|
530
|
+
width?: 'fill' | 'content';
|
|
531
|
+
indicatorTone?: 'neutral' | 'accent' | 'pop' | 'danger';
|
|
532
|
+
/** Render as an unanimated loading skeleton: keep the label and action affordance, disable interaction. */
|
|
533
|
+
placeholder?: boolean;
|
|
534
|
+
rootAttributes?: ListHeaderRootAttributes;
|
|
535
|
+
triggerAttributes?: ListHeaderTriggerAttributes;
|
|
536
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
537
|
+
slot?: string;
|
|
538
|
+
}
|
|
539
|
+
type ListHeaderModeProps = {
|
|
540
|
+
/** Render the title as a controlled disclosure trigger. */
|
|
541
|
+
toggle: true;
|
|
542
|
+
/** A toggle's label is its button text, not a heading. */
|
|
543
|
+
headingLevel?: never;
|
|
544
|
+
action: string;
|
|
545
|
+
expanded: boolean;
|
|
103
546
|
actionIcon?: SafeHtml;
|
|
547
|
+
actionLabel?: never;
|
|
104
548
|
actionDisabled?: boolean;
|
|
105
549
|
disabledReason?: string;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
550
|
+
} | {
|
|
551
|
+
/** Render a separately named trailing action. */
|
|
552
|
+
toggle?: false;
|
|
553
|
+
/**
|
|
554
|
+
* Native heading level (`h1`–`h6`) of the label. Default `2`. Match the
|
|
555
|
+
* document outline; the visual treatment does not change.
|
|
556
|
+
*/
|
|
557
|
+
headingLevel?: HeadingLevel;
|
|
558
|
+
action: string;
|
|
559
|
+
actionLabel: string;
|
|
560
|
+
actionIcon: SafeHtml;
|
|
561
|
+
expanded?: never;
|
|
562
|
+
actionDisabled?: boolean;
|
|
563
|
+
disabledReason?: string;
|
|
564
|
+
} | {
|
|
565
|
+
/** Render a passive section heading. */
|
|
566
|
+
toggle?: false;
|
|
567
|
+
/**
|
|
568
|
+
* Native heading level (`h1`–`h6`) of the label. Default `2`. Match the
|
|
569
|
+
* document outline; the visual treatment does not change.
|
|
570
|
+
*/
|
|
571
|
+
headingLevel?: HeadingLevel;
|
|
572
|
+
action?: never;
|
|
573
|
+
actionLabel?: never;
|
|
574
|
+
actionIcon?: never;
|
|
575
|
+
expanded?: never;
|
|
576
|
+
actionDisabled?: never;
|
|
577
|
+
disabledReason?: never;
|
|
578
|
+
};
|
|
579
|
+
type ListHeaderIndicatorProps = {
|
|
112
580
|
count: number;
|
|
113
581
|
countLabel: string;
|
|
114
582
|
badge?: never;
|
|
583
|
+
status?: never;
|
|
584
|
+
} | {
|
|
585
|
+
count?: never;
|
|
586
|
+
countLabel?: never;
|
|
587
|
+
badge: SafeHtml;
|
|
588
|
+
status?: never;
|
|
115
589
|
} | {
|
|
116
590
|
count?: never;
|
|
117
591
|
countLabel?: never;
|
|
118
|
-
badge?:
|
|
592
|
+
badge?: never;
|
|
593
|
+
status?: SafeHtml;
|
|
119
594
|
};
|
|
120
|
-
type
|
|
121
|
-
declare function
|
|
595
|
+
type ListHeaderProps = ListHeaderBaseProps & ListHeaderIndicatorProps & ListHeaderModeProps;
|
|
596
|
+
declare function ListHeader({ label, headingLevel, count, countLabel, badge, status, density, divider, inline, width, indicatorTone, action, actionLabel, actionIcon, actionDisabled, disabledReason, expanded, toggle, placeholder, rootAttributes, triggerAttributes, slot, }: ListHeaderProps): SafeHtml;
|
|
597
|
+
|
|
598
|
+
export { ListHeader, type ListHeaderProps };
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
## `@kerfjs/ui/list`
|
|
602
|
+
|
|
603
|
+
```ts
|
|
604
|
+
import * as kerfjs from 'kerfjs';
|
|
605
|
+
import { UiSpaceName, CssLength, CssFlexKeyword, CssFlex } from './css-values.js';
|
|
606
|
+
import { H as HorizontalAlignment, L as ListVerticalAlignment } from './flex-alignment-4ms8ZbV8.js';
|
|
607
|
+
export { V as VerticalAlignment } from './flex-alignment-4ms8ZbV8.js';
|
|
608
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
609
|
+
import { S as Sides } from './sides-BPSWde0A.js';
|
|
610
|
+
|
|
611
|
+
type ListRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
612
|
+
'data-component'?: never;
|
|
613
|
+
'data-gap'?: never;
|
|
614
|
+
'data-flex'?: never;
|
|
615
|
+
'data-fill'?: never;
|
|
616
|
+
'data-h-align'?: never;
|
|
617
|
+
'data-v-align'?: never;
|
|
618
|
+
'data-scrollable'?: never;
|
|
619
|
+
'data-text-insets'?: never;
|
|
620
|
+
'data-control-insets'?: never;
|
|
621
|
+
}>;
|
|
622
|
+
interface ListProps {
|
|
623
|
+
children?: KerfUiContent;
|
|
624
|
+
/** Use the standard item gap, a named UI spacing token, or a typed CSS length. Defaults to no gap. */
|
|
625
|
+
gap?: boolean | UiSpaceName | CssLength;
|
|
626
|
+
/** Allow this list to grow/shrink, use a keyword, or supply a typed CSS flex shorthand. */
|
|
627
|
+
flex?: boolean | CssFlexKeyword | CssFlex;
|
|
628
|
+
/**
|
|
629
|
+
* Fill the height of a parent with a definite height, such as an app root or
|
|
630
|
+
* a fixed-height frame, when this list is that parent's layout root. Inside a
|
|
631
|
+
* flex layout use `flex` instead. Defaults to false.
|
|
632
|
+
*/
|
|
633
|
+
fill?: boolean;
|
|
634
|
+
/** Horizontal alignment. Defaults to full to preserve stretch-aligned list children. */
|
|
635
|
+
hAlign?: HorizontalAlignment;
|
|
636
|
+
/** Vertical distribution. Defaults to top. */
|
|
637
|
+
vAlign?: ListVerticalAlignment;
|
|
638
|
+
/** Own vertical scrolling and overscroll containment. */
|
|
639
|
+
scrollable?: boolean;
|
|
640
|
+
/** Physical divider edges in canonical top/right/bottom/left order. */
|
|
641
|
+
dividerSides?: Sides;
|
|
642
|
+
/** Physical sides that receive the standard 17px text inset. */
|
|
643
|
+
textInsets?: Sides;
|
|
644
|
+
/** Physical sides that receive the standard 8px control inset. Text insets win on overlap. */
|
|
645
|
+
controlInsets?: Sides;
|
|
646
|
+
className?: string;
|
|
647
|
+
/** Safe `data-*` metadata; List-owned structural attributes remain protected. */
|
|
648
|
+
rootAttributes?: ListRootAttributes;
|
|
649
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
650
|
+
slot?: string;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* A list's configuration, apart from its content and styling hooks: the props a
|
|
654
|
+
* composite that renders a `List` for the app (the Workbench's `mainHeader` /
|
|
655
|
+
* `mainFooter` chrome) forwards, so the app configures that list instead of
|
|
656
|
+
* styling it. An omitted or `undefined` field keeps the composite's default.
|
|
657
|
+
*/
|
|
658
|
+
type ListConfig = Pick<ListProps, 'gap' | 'hAlign' | 'vAlign' | 'dividerSides' | 'textInsets' | 'controlInsets'>;
|
|
659
|
+
/** A stretch-aligned vertical stack with optional gap, flex, fill, scroll, and dividers. */
|
|
660
|
+
declare function List({ children, gap, flex, fill, hAlign, vAlign, scrollable, dividerSides, textInsets, controlInsets, className, rootAttributes, slot, }: ListProps): kerfjs.SafeHtml;
|
|
122
661
|
|
|
123
|
-
export {
|
|
662
|
+
export { CssFlex, CssFlexKeyword, CssLength, HorizontalAlignment, List, type ListConfig, type ListProps, ListVerticalAlignment, Sides, UiSpaceName };
|
|
124
663
|
```
|
|
125
664
|
|
|
126
|
-
## `@kerfjs/ui/
|
|
665
|
+
## `@kerfjs/ui/list-action-row`
|
|
127
666
|
|
|
128
667
|
```ts
|
|
129
668
|
import { SafeHtml } from 'kerfjs';
|
|
130
669
|
|
|
131
|
-
type
|
|
670
|
+
type ListActionRowRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
132
671
|
'data-component'?: never;
|
|
133
672
|
'data-action'?: never;
|
|
134
673
|
'data-item-id'?: never;
|
|
135
674
|
'data-has-icon'?: never;
|
|
136
675
|
'data-multiline'?: never;
|
|
676
|
+
'data-density'?: never;
|
|
677
|
+
'data-divider'?: never;
|
|
678
|
+
'data-busy'?: never;
|
|
679
|
+
'data-trailing-visibility'?: never;
|
|
137
680
|
'data-state'?: never;
|
|
138
681
|
'data-selected'?: never;
|
|
139
682
|
'data-pressed'?: never;
|
|
140
683
|
}>;
|
|
141
|
-
type
|
|
684
|
+
type ListActionRowTrailingAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
142
685
|
'data-component'?: never;
|
|
143
686
|
'data-action'?: never;
|
|
144
687
|
'data-item-id'?: never;
|
|
688
|
+
'data-kui-disabled'?: never;
|
|
145
689
|
popoverTarget?: string;
|
|
146
690
|
popoverTargetAction?: 'toggle' | 'show' | 'hide';
|
|
147
691
|
'aria-controls'?: string;
|
|
148
692
|
'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | 'true';
|
|
149
693
|
}>;
|
|
150
|
-
interface
|
|
694
|
+
interface ListActionRowProps {
|
|
151
695
|
/** Visible dormant content for the primary button. Must not contain interactive descendants. */
|
|
152
696
|
label: string | SafeHtml;
|
|
697
|
+
description?: string | SafeHtml;
|
|
698
|
+
status?: string | SafeHtml;
|
|
699
|
+
busy?: boolean;
|
|
700
|
+
density?: 'standard' | 'compact';
|
|
701
|
+
divider?: 'none' | 'before' | 'after' | 'both';
|
|
153
702
|
/** Decorative dormant content for the primary button. Must not contain interactive descendants. */
|
|
154
703
|
icon?: SafeHtml;
|
|
155
704
|
action: string;
|
|
@@ -162,108 +711,225 @@ interface MenuActionRowProps {
|
|
|
162
711
|
state?: string;
|
|
163
712
|
disabled?: boolean;
|
|
164
713
|
tabIndex?: number;
|
|
714
|
+
/** Render as an unanimated loading skeleton, disabling both actions: label, description, icon, and status text become skeletons; the `busy` indicator stays live. */
|
|
715
|
+
placeholder?: boolean;
|
|
165
716
|
trailingAction: string;
|
|
166
717
|
trailingActionLabel: string;
|
|
167
718
|
/** Decorative dormant content for the trailing button. Must not contain interactive descendants. */
|
|
168
719
|
trailingActionIcon: SafeHtml;
|
|
169
720
|
trailingActionDisabled?: boolean;
|
|
170
721
|
trailingActionTitle?: string;
|
|
722
|
+
trailingActionVisibility?: 'always' | 'interaction';
|
|
171
723
|
className?: string;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
724
|
+
rootAttributes?: ListActionRowRootAttributes;
|
|
725
|
+
trailingActionAttributes?: ListActionRowTrailingAttributes;
|
|
726
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
727
|
+
slot?: string;
|
|
175
728
|
}
|
|
176
|
-
declare function
|
|
729
|
+
declare function ListActionRow({ label, description, status, busy, density, divider, icon, action, itemId, selected, pressed, accessibleLabel, title, multiline, state, disabled, tabIndex, placeholder, trailingAction, trailingActionLabel, trailingActionIcon, trailingActionDisabled, trailingActionTitle, trailingActionVisibility, className, rootAttributes, trailingActionAttributes, slot, }: ListActionRowProps): SafeHtml;
|
|
177
730
|
|
|
178
|
-
export {
|
|
731
|
+
export { ListActionRow, type ListActionRowProps };
|
|
179
732
|
```
|
|
180
733
|
|
|
181
|
-
## `@kerfjs/ui/
|
|
734
|
+
## `@kerfjs/ui/list-item`
|
|
182
735
|
|
|
183
736
|
```ts
|
|
184
737
|
import { SafeHtml } from 'kerfjs';
|
|
738
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
185
739
|
|
|
186
|
-
type
|
|
740
|
+
type ListItemRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
187
741
|
'data-component'?: never;
|
|
188
742
|
'data-action'?: never;
|
|
189
743
|
'data-item-id'?: never;
|
|
190
744
|
'data-has-icon'?: never;
|
|
745
|
+
'data-has-description'?: never;
|
|
191
746
|
'data-multiline'?: never;
|
|
747
|
+
'data-density'?: never;
|
|
748
|
+
'data-divider'?: never;
|
|
749
|
+
'data-busy'?: never;
|
|
192
750
|
'data-state'?: never;
|
|
751
|
+
'data-kui-disabled'?: never;
|
|
752
|
+
'data-icon-align'?: never;
|
|
193
753
|
}>;
|
|
194
|
-
interface
|
|
754
|
+
interface ListItemProps {
|
|
195
755
|
label: string | SafeHtml;
|
|
756
|
+
/** App-owned supporting text rendered in the component's stable label stack. */
|
|
757
|
+
description?: string | SafeHtml;
|
|
196
758
|
icon?: SafeHtml;
|
|
197
|
-
|
|
759
|
+
/** Dormant author content at the row's end; a placeholder renders it as a skeleton. */
|
|
760
|
+
trailing?: KerfUiContent;
|
|
761
|
+
/** Dormant status metadata rendered before trailing content; a placeholder renders it as a skeleton. */
|
|
762
|
+
status?: string | SafeHtml;
|
|
763
|
+
/** Show a progress indicator and expose the row as busy without replacing its content; a placeholder keeps the indicator. */
|
|
764
|
+
busy?: boolean;
|
|
765
|
+
density?: 'standard' | 'compact' | 'spacious';
|
|
766
|
+
divider?: 'none' | 'before' | 'after' | 'both';
|
|
198
767
|
selected?: boolean;
|
|
199
768
|
action: string;
|
|
200
769
|
itemId?: string;
|
|
201
770
|
className?: string;
|
|
202
|
-
style?: string;
|
|
203
771
|
pressed?: boolean;
|
|
204
772
|
accessibleLabel?: string;
|
|
205
773
|
title?: string;
|
|
206
774
|
multiline?: boolean;
|
|
775
|
+
/** Alignment of an icon beside a wrapped label. Defaults to its first line. */
|
|
776
|
+
multilineIconAlign?: 'first-line' | 'center';
|
|
207
777
|
state?: string;
|
|
208
778
|
disabled?: boolean;
|
|
209
779
|
tabIndex?: number;
|
|
210
|
-
|
|
780
|
+
/** Render the row as an unanimated loading skeleton, disabling its action: label, description, icon, status, and trailing content become skeletons; the `busy` indicator stays live. */
|
|
781
|
+
placeholder?: boolean;
|
|
782
|
+
rootAttributes?: ListItemRootAttributes;
|
|
783
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
784
|
+
slot?: string;
|
|
211
785
|
}
|
|
212
|
-
declare function
|
|
786
|
+
declare function ListItem({ label, description, icon, trailing, status, busy, density, divider, selected, action, itemId, className, pressed, accessibleLabel, title, multiline, multilineIconAlign, state, disabled, tabIndex, placeholder, rootAttributes, slot, }: ListItemProps): SafeHtml;
|
|
213
787
|
|
|
214
|
-
export {
|
|
788
|
+
export { ListItem, type ListItemProps };
|
|
215
789
|
```
|
|
216
790
|
|
|
217
|
-
## `@kerfjs/ui/
|
|
791
|
+
## `@kerfjs/ui/list-inset-control`
|
|
218
792
|
|
|
219
793
|
```ts
|
|
220
|
-
import
|
|
794
|
+
import * as kerfjs from 'kerfjs';
|
|
795
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
796
|
+
import { S as Sides } from './sides-BPSWde0A.js';
|
|
797
|
+
|
|
798
|
+
interface ListInsetControlProps {
|
|
799
|
+
/** Control(s) that own their own border and padding (e.g. an input, a `wa-*`). */
|
|
800
|
+
children: KerfUiContent;
|
|
801
|
+
/** Physical inset sides in canonical top/right/bottom/left order. Defaults to all sides. */
|
|
802
|
+
sides?: Sides;
|
|
803
|
+
className?: string;
|
|
804
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
805
|
+
slot?: string;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Insets a control into a pane/list content region: an 8px inline margin (so its
|
|
809
|
+
* edges line up with `.kui-content` items) and a stretch flex row with an 8px gap.
|
|
810
|
+
* Use it for controls that carry their own border and padding but no outer margin
|
|
811
|
+
* — the wrapper adds only the alignment margin and layout, not a second inset.
|
|
812
|
+
*/
|
|
813
|
+
declare function ListInsetControl({ children, sides, className, slot, }: ListInsetControlProps): kerfjs.SafeHtml;
|
|
221
814
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
815
|
+
export { ListInsetControl, type ListInsetControlProps, Sides };
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
## `@kerfjs/ui/list-inset-text`
|
|
819
|
+
|
|
820
|
+
```ts
|
|
821
|
+
import * as kerfjs from 'kerfjs';
|
|
822
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
823
|
+
import { S as Sides } from './sides-BPSWde0A.js';
|
|
824
|
+
|
|
825
|
+
type ListInsetTextRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
826
|
+
'data-component'?: never;
|
|
827
|
+
'data-sides'?: never;
|
|
828
|
+
}>;
|
|
829
|
+
interface ListInsetTextProps {
|
|
830
|
+
/** Text (or inline content) that carries no margin, border, or padding of its own. */
|
|
831
|
+
children: KerfUiContent | string;
|
|
832
|
+
/** Physical inset sides in canonical top/right/bottom/left order. Defaults to all sides. */
|
|
833
|
+
sides?: Sides;
|
|
834
|
+
className?: string;
|
|
835
|
+
/** Safe `data-*` metadata; component-owned structural attributes stay protected. */
|
|
836
|
+
rootAttributes?: ListInsetTextRootAttributes;
|
|
837
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
838
|
+
slot?: string;
|
|
230
839
|
}
|
|
231
840
|
/**
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
841
|
+
* Gives bare text the content-item geometry — an 8px inline margin, a 1px
|
|
842
|
+
* transparent border, and 8px padding — so a plain string lines up with
|
|
843
|
+
* bordered `.kui-content` items (its text edge lands at the same 17px inset).
|
|
844
|
+
* Use it for text elements that have no margin, border, or padding of their own.
|
|
845
|
+
* Pass `sides="rl"` to keep the horizontal inset but drop the vertical box
|
|
846
|
+
* space for tight text layout.
|
|
847
|
+
*/
|
|
848
|
+
declare function ListInsetText({ children, sides, className, rootAttributes, slot, }: ListInsetTextProps): kerfjs.SafeHtml;
|
|
849
|
+
|
|
850
|
+
export { ListInsetText, type ListInsetTextProps, Sides };
|
|
851
|
+
```
|
|
852
|
+
|
|
853
|
+
## `@kerfjs/ui/content-item`
|
|
854
|
+
|
|
855
|
+
```ts
|
|
856
|
+
import * as kerfjs from 'kerfjs';
|
|
857
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
858
|
+
|
|
859
|
+
/** Whether the item's always-reserved 1px border is transparent or visible. */
|
|
860
|
+
type ContentItemFrame = 'none' | 'framed';
|
|
861
|
+
/** Corner shape: the 12px rounded rectangle or the 22px pill. */
|
|
862
|
+
type ContentItemShape = 'rounded' | 'pill';
|
|
863
|
+
type ContentItemRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
864
|
+
'data-component'?: never;
|
|
865
|
+
}>;
|
|
866
|
+
interface ContentItemProps {
|
|
867
|
+
/** Item content; a plain string is allowed for bare copy. */
|
|
868
|
+
children?: KerfUiContent | string;
|
|
869
|
+
/**
|
|
870
|
+
* `framed` paints the standard neutral border in the 1px the item always
|
|
871
|
+
* reserves, so framing never changes geometry. Frame only an item that
|
|
872
|
+
* marks a real distinction. Defaults to `none` (transparent border).
|
|
873
|
+
*/
|
|
874
|
+
frame?: ContentItemFrame;
|
|
875
|
+
/** Corner shape. Defaults to `rounded`. */
|
|
876
|
+
shape?: ContentItemShape;
|
|
877
|
+
/**
|
|
878
|
+
* Names the item as a distinct region (`role="region"`). Omit it for an
|
|
879
|
+
* ordinary item, which stays a non-landmark grouping.
|
|
880
|
+
*/
|
|
881
|
+
ariaLabel?: string;
|
|
882
|
+
/**
|
|
883
|
+
* Makes the item a programmatic focus target (`tabindex="-1"`, never a tab
|
|
884
|
+
* stop), for example the preferred initial focus of a NavStack view when
|
|
885
|
+
* combined with `data-nav-focus` in `rootAttributes`.
|
|
886
|
+
*/
|
|
887
|
+
focusTarget?: boolean;
|
|
888
|
+
className?: string;
|
|
889
|
+
/** Safe `data-*` metadata; component-owned structural attributes stay protected. */
|
|
890
|
+
rootAttributes?: ContentItemRootAttributes;
|
|
891
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
892
|
+
slot?: string;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* One self-contained `.kui-content` child: an 8px inline margin, a real 1px
|
|
896
|
+
* border (transparent unless `framed`), 8px padding, and a rounded or pill
|
|
897
|
+
* radius. It owns that whole geometry, so wrappers must not add more.
|
|
242
898
|
*/
|
|
243
|
-
declare function
|
|
899
|
+
declare function ContentItem({ children, frame, shape, ariaLabel, focusTarget, className, rootAttributes, slot, }: ContentItemProps): kerfjs.SafeHtml;
|
|
244
900
|
|
|
245
|
-
export {
|
|
901
|
+
export { ContentItem, type ContentItemFrame, type ContentItemProps, type ContentItemShape };
|
|
246
902
|
```
|
|
247
903
|
|
|
248
904
|
## `@kerfjs/ui/value-table`
|
|
249
905
|
|
|
250
906
|
```ts
|
|
907
|
+
import * as kerfjs from 'kerfjs';
|
|
251
908
|
import { SafeHtml } from 'kerfjs';
|
|
909
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
252
910
|
|
|
253
911
|
interface ValueTableRowProps {
|
|
254
912
|
label: string | SafeHtml;
|
|
255
913
|
value: string | SafeHtml;
|
|
256
914
|
icon?: SafeHtml;
|
|
257
915
|
className?: string;
|
|
916
|
+
/** Render the value as an unanimated loading skeleton, keeping the field label. */
|
|
917
|
+
placeholder?: boolean;
|
|
918
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
919
|
+
slot?: string;
|
|
258
920
|
}
|
|
259
|
-
declare function ValueTableRow({ label, value, icon, className }: ValueTableRowProps): SafeHtml;
|
|
921
|
+
declare function ValueTableRow({ label, value, icon, className, placeholder, slot, }: ValueTableRowProps): SafeHtml;
|
|
260
922
|
|
|
261
923
|
interface ValueTableProps {
|
|
262
924
|
label: string;
|
|
925
|
+
/** Compact row spacing for metadata-dense surfaces. */
|
|
926
|
+
density?: 'default' | 'compact';
|
|
263
927
|
className?: string;
|
|
264
|
-
children:
|
|
928
|
+
children: KerfUiContent;
|
|
929
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
930
|
+
slot?: string;
|
|
265
931
|
}
|
|
266
|
-
declare function ValueTable({ label, className, children }: ValueTableProps): SafeHtml;
|
|
932
|
+
declare function ValueTable({ label, density, className, children, slot, }: ValueTableProps): kerfjs.SafeHtml;
|
|
267
933
|
|
|
268
934
|
export { ValueTable, type ValueTableProps, ValueTableRow, type ValueTableRowProps };
|
|
269
935
|
```
|
|
@@ -272,6 +938,7 @@ export { ValueTable, type ValueTableProps, ValueTableRow, type ValueTableRowProp
|
|
|
272
938
|
|
|
273
939
|
```ts
|
|
274
940
|
import { SafeHtml } from 'kerfjs';
|
|
941
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
275
942
|
|
|
276
943
|
type AppTabRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
277
944
|
'data-component'?: never;
|
|
@@ -280,49 +947,104 @@ type AppTabRootAttributes = Readonly<Record<`data-${string}`, string | undefined
|
|
|
280
947
|
'data-selected'?: never;
|
|
281
948
|
'data-tab-dragging'?: never;
|
|
282
949
|
'data-tab-drop-position'?: never;
|
|
950
|
+
'data-attention'?: never;
|
|
283
951
|
}>;
|
|
952
|
+
type AppTabPresentation = 'pill' | 'segmented' | 'icon-only';
|
|
953
|
+
type AppTabSize = 'default' | 'compact';
|
|
284
954
|
interface AppTabProps {
|
|
285
955
|
id: string;
|
|
286
956
|
name: string;
|
|
287
957
|
selected?: boolean;
|
|
958
|
+
/** Emphasize the visible tab name with the attention color token. */
|
|
959
|
+
attention?: boolean;
|
|
288
960
|
closable?: boolean;
|
|
289
961
|
draggable?: boolean;
|
|
290
|
-
leading?:
|
|
291
|
-
trailing?:
|
|
962
|
+
leading?: KerfUiContent;
|
|
963
|
+
trailing?: KerfUiContent;
|
|
964
|
+
/** Visual treatment within a TabBar. Icon-only tabs retain `name` as their accessible name. */
|
|
965
|
+
presentation?: AppTabPresentation;
|
|
966
|
+
/** Compact tabs use the 32px application-rail height. */
|
|
967
|
+
size?: AppTabSize;
|
|
968
|
+
/** Maximum visible label width in CSS pixels before ellipsis. */
|
|
969
|
+
labelMaxWidth?: number;
|
|
292
970
|
/** Decorative dormant content for the close button. Must not contain interactive descendants. */
|
|
293
971
|
closeIcon?: SafeHtml;
|
|
294
972
|
selectAction?: string;
|
|
295
973
|
closeAction?: string;
|
|
296
974
|
className?: string;
|
|
975
|
+
/** Render as an unanimated loading skeleton, disabling select/close and dragging. */
|
|
976
|
+
placeholder?: boolean;
|
|
977
|
+
/**
|
|
978
|
+
* Named and still opening: the tab is known but its content is loading.
|
|
979
|
+
* Keeps `name` visible in the quiet text color and as the tab's accessible
|
|
980
|
+
* name, shows `trailing` (for example a `LoadingSpinner`), and marks the
|
|
981
|
+
* tab `aria-busy`. Unlike `placeholder` it stays selectable — the
|
|
982
|
+
* application shows placeholder content in its panel until loading
|
|
983
|
+
* completes — while close and dragging stay disabled. Same pill geometry
|
|
984
|
+
* as the live tab, so swapping it in place does not shift the bar.
|
|
985
|
+
* `placeholder` wins when both are set.
|
|
986
|
+
*/
|
|
987
|
+
pending?: boolean;
|
|
297
988
|
rootAttributes?: AppTabRootAttributes;
|
|
989
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
990
|
+
slot?: string;
|
|
298
991
|
}
|
|
299
|
-
declare function AppTab({ id, name, selected, closable, draggable, leading, trailing, closeIcon, selectAction, closeAction, className, rootAttributes }: AppTabProps): SafeHtml;
|
|
992
|
+
declare function AppTab({ id, name, selected, attention, closable, draggable, leading, trailing, presentation, size, labelMaxWidth, closeIcon, selectAction, closeAction, className, placeholder, pending, rootAttributes, slot, }: AppTabProps): SafeHtml;
|
|
300
993
|
|
|
301
|
-
export { AppTab, type AppTabProps };
|
|
994
|
+
export { AppTab, type AppTabPresentation, type AppTabProps, type AppTabSize };
|
|
302
995
|
```
|
|
303
996
|
|
|
304
997
|
## `@kerfjs/ui/tab-bar`
|
|
305
998
|
|
|
306
999
|
```ts
|
|
307
|
-
import
|
|
1000
|
+
import * as kerfjs from 'kerfjs';
|
|
1001
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
308
1002
|
|
|
1003
|
+
type TabActivation = 'automatic' | 'manual';
|
|
1004
|
+
type TabBarAllocation = 'intrinsic' | 'fill';
|
|
1005
|
+
type TabBarPresentation = 'rail' | 'segmented' | 'inspector';
|
|
1006
|
+
type TabBarTrailingPlacement = 'separate' | 'adjacent';
|
|
309
1007
|
interface TabBarProps {
|
|
310
1008
|
id: string;
|
|
311
1009
|
label: string;
|
|
312
|
-
children:
|
|
313
|
-
leading?:
|
|
314
|
-
trailing?:
|
|
1010
|
+
children: KerfUiContent;
|
|
1011
|
+
leading?: KerfUiContent;
|
|
1012
|
+
trailing?: KerfUiContent;
|
|
1013
|
+
/**
|
|
1014
|
+
* Action pinned to the far edge of the bar. Combine with an adjacent `trailing`
|
|
1015
|
+
* action when the tab-local and workspace-level actions must remain distinct.
|
|
1016
|
+
*/
|
|
1017
|
+
end?: KerfUiContent;
|
|
315
1018
|
className?: string;
|
|
1019
|
+
/**
|
|
1020
|
+
* Keyboard activation mode for this strip, emitted as `data-tab-activation` for
|
|
1021
|
+
* `wireTabBars` to read (overrides its `activation` option). `'automatic'` (default)
|
|
1022
|
+
* selects on arrow / Home / End; `'manual'` moves roving focus only and the user
|
|
1023
|
+
* selects with Enter / Space / click — use it when selecting a tab is a heavy action.
|
|
1024
|
+
*/
|
|
1025
|
+
activation?: TabActivation;
|
|
1026
|
+
/** How available strip width is allocated across child AppTabs. */
|
|
1027
|
+
allocation?: TabBarAllocation;
|
|
1028
|
+
/** Named strip chrome for application rails, segmented tabs, or inspectors. */
|
|
1029
|
+
presentation?: TabBarPresentation;
|
|
1030
|
+
/** Keep a trailing action beside the final tab or at the far edge of the bar. */
|
|
1031
|
+
trailingPlacement?: TabBarTrailingPlacement;
|
|
1032
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
1033
|
+
slot?: string;
|
|
316
1034
|
}
|
|
317
1035
|
/** Render a controlled tab strip. The application owns selection, order, and persistence. */
|
|
318
|
-
declare function TabBar({ id, label, children, leading, trailing, className }: TabBarProps): SafeHtml;
|
|
1036
|
+
declare function TabBar({ id, label, children, leading, trailing, end, className, activation, allocation, presentation, trailingPlacement, slot, }: TabBarProps): kerfjs.SafeHtml;
|
|
319
1037
|
|
|
320
|
-
export { TabBar, type TabBarProps };
|
|
1038
|
+
export { type TabActivation, TabBar, type TabBarAllocation, type TabBarPresentation, type TabBarProps, type TabBarTrailingPlacement };
|
|
321
1039
|
```
|
|
322
1040
|
|
|
323
1041
|
## `@kerfjs/ui/wire-tab-bars`
|
|
324
1042
|
|
|
325
1043
|
```ts
|
|
1044
|
+
import { TabActivation } from './tab-bar.js';
|
|
1045
|
+
import 'kerfjs';
|
|
1046
|
+
import './semantic-content-BbzjvSu9.js';
|
|
1047
|
+
|
|
326
1048
|
type TabReorderSource = 'pointer' | 'keyboard';
|
|
327
1049
|
type TabDropPosition = 'before' | 'after';
|
|
328
1050
|
interface TabReorder {
|
|
@@ -332,20 +1054,112 @@ interface TabReorder {
|
|
|
332
1054
|
position: TabDropPosition;
|
|
333
1055
|
source: TabReorderSource;
|
|
334
1056
|
}
|
|
1057
|
+
|
|
335
1058
|
interface WireTabBarsOptions {
|
|
336
1059
|
onReorder: (change: TabReorder) => void;
|
|
1060
|
+
/**
|
|
1061
|
+
* How arrow / Home / End keys activate tabs (default `'automatic'`):
|
|
1062
|
+
* - `'automatic'` moves roving focus **and** selects the focused tab (clicks it).
|
|
1063
|
+
* - `'manual'` moves roving focus only; the user selects with Enter / Space / click
|
|
1064
|
+
* (the ARIA Tabs manual-activation pattern). Use this when activation is a heavy or
|
|
1065
|
+
* side-effecting action (e.g. a tab that loads a project) so arrowing through the
|
|
1066
|
+
* strip doesn't trigger it on every tab.
|
|
1067
|
+
*
|
|
1068
|
+
* A per-bar `data-tab-activation="manual" | "automatic"` attribute (see the `TabBar`
|
|
1069
|
+
* `activation` prop) overrides this option for that strip.
|
|
1070
|
+
*/
|
|
1071
|
+
activation?: TabActivation;
|
|
337
1072
|
}
|
|
338
1073
|
declare function reorderTabs<T>(items: readonly T[], getId: (item: T) => string, sourceId: string, targetId: string, position: TabDropPosition): T[];
|
|
339
1074
|
/** Wire reordering and keyboard navigation while leaving controlled state in the application. */
|
|
340
|
-
declare function wireTabBars(root: HTMLElement | Document, { onReorder }: WireTabBarsOptions): () => void;
|
|
1075
|
+
declare function wireTabBars(root: HTMLElement | Document, { onReorder, activation }: WireTabBarsOptions): () => void;
|
|
341
1076
|
|
|
342
|
-
export { type TabDropPosition, type TabReorder, type TabReorderSource, type WireTabBarsOptions, reorderTabs, wireTabBars };
|
|
1077
|
+
export { TabActivation, type TabDropPosition, type TabReorder, type TabReorderSource, type WireTabBarsOptions, reorderTabs, wireTabBars };
|
|
1078
|
+
```
|
|
1079
|
+
|
|
1080
|
+
## `@kerfjs/ui/wire-scroll-dividers`
|
|
1081
|
+
|
|
1082
|
+
```ts
|
|
1083
|
+
/**
|
|
1084
|
+
* An app-owned scroll arrangement outside a `Pane`: the `id` of the element
|
|
1085
|
+
* that scrolls and the `id`s of the pinned chrome on each physical side of it.
|
|
1086
|
+
* Each named chrome element shows its divider on the side facing the scroller
|
|
1087
|
+
* while content is scrolled away beyond that side. Ids are resolved below the
|
|
1088
|
+
* wired root on every refresh, so a re-render that replaces an element keeps
|
|
1089
|
+
* the pairing.
|
|
1090
|
+
*/
|
|
1091
|
+
interface ScrollDividerTarget {
|
|
1092
|
+
/** The `id` of the scrolling element. */
|
|
1093
|
+
scroller: string;
|
|
1094
|
+
/** Chrome above the scroller: shows its bottom divider once scrolled down. */
|
|
1095
|
+
top?: string;
|
|
1096
|
+
/**
|
|
1097
|
+
* Chrome right of the scroller: shows its left divider while content is
|
|
1098
|
+
* hidden beyond the scroller's right edge (never when nothing overflows).
|
|
1099
|
+
*/
|
|
1100
|
+
right?: string;
|
|
1101
|
+
/**
|
|
1102
|
+
* Chrome below the scroller: shows its top divider while content is hidden
|
|
1103
|
+
* beyond the scroller's bottom edge (never when nothing overflows).
|
|
1104
|
+
*/
|
|
1105
|
+
bottom?: string;
|
|
1106
|
+
/** Chrome left of the scroller: shows its right divider once scrolled right. */
|
|
1107
|
+
left?: string;
|
|
1108
|
+
}
|
|
1109
|
+
interface WireScrollDividersOptions {
|
|
1110
|
+
/**
|
|
1111
|
+
* App-owned scroll arrangements to pair beyond the ones found by structure
|
|
1112
|
+
* (every `Pane`'s header and footer around its content, every `NavStack`'s
|
|
1113
|
+
* and `TabScaffold`'s chrome around its active region, and every `TabBar`
|
|
1114
|
+
* strip).
|
|
1115
|
+
*/
|
|
1116
|
+
targets?: readonly ScrollDividerTarget[];
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* Wire scroll dividers below `root`: a divider between pinned chrome and the
|
|
1120
|
+
* content that scrolls beside it shows only while content is scrolled away
|
|
1121
|
+
* from that edge. Near edges (top, left) hide at the scroll start; far edges
|
|
1122
|
+
* (bottom, right) hide at the scroll end and whenever nothing overflows.
|
|
1123
|
+
*
|
|
1124
|
+
* The wiring only reports scroll state; each component draws its own divider
|
|
1125
|
+
* from it. It writes `data-scroll-overflow` (the edges with hidden content, in
|
|
1126
|
+
* canonical `t`/`r`/`b`/`l` order) on each scroller, and `data-scroll-divider`
|
|
1127
|
+
* (the sides to draw) on each paired chrome element:
|
|
1128
|
+
*
|
|
1129
|
+
* - every `Pane` with a header or footer: its header shows a bottom divider and
|
|
1130
|
+
* its footer a top divider (drawn by the Pane, per its `chromeDividers`);
|
|
1131
|
+
* - every `NavStack`'s top chrome and bottom toolbar around its active view,
|
|
1132
|
+
* and every `TabScaffold`'s bar under its active scene: the chrome shows a
|
|
1133
|
+
* bottom (top chrome) or top (bottom toolbar, bar) divider. The scroller is
|
|
1134
|
+
* whichever element actually scrolls there: the view or scene itself, or,
|
|
1135
|
+
* through a sole child with no chrome of its own on that edge, a `Pane`'s
|
|
1136
|
+
* content or a nested `NavStack` / `TabScaffold` region (a Pane's own header
|
|
1137
|
+
* or footer draws that boundary instead);
|
|
1138
|
+
* - every `TabBar` strip: the bar draws a divider on each side of the strip
|
|
1139
|
+
* whose tabs are scrolled out of view;
|
|
1140
|
+
* - each app-owned `targets` pairing: a `Toolbar` or `List` named as chrome
|
|
1141
|
+
* draws the divider on its facing side.
|
|
1142
|
+
*
|
|
1143
|
+
* Structure is re-read after every DOM change below root (a re-render that
|
|
1144
|
+
* drops the attributes gets them back before paint), scroll is tracked with
|
|
1145
|
+
* one capturing listener, and size changes of each scroller and its children
|
|
1146
|
+
* with a `ResizeObserver`. Returns a disposer that removes every attribute it
|
|
1147
|
+
* wrote. See `docs/23-app-layouts.md` §3.7.
|
|
1148
|
+
*/
|
|
1149
|
+
declare function wireScrollDividers(root: HTMLElement | Document, { targets }?: WireScrollDividersOptions): () => void;
|
|
1150
|
+
|
|
1151
|
+
export { type ScrollDividerTarget, type WireScrollDividersOptions, wireScrollDividers };
|
|
343
1152
|
```
|
|
344
1153
|
|
|
345
1154
|
## `@kerfjs/ui/nav-stack`
|
|
346
1155
|
|
|
347
1156
|
```ts
|
|
348
|
-
import
|
|
1157
|
+
import * as kerfjs from 'kerfjs';
|
|
1158
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
1159
|
+
import { ToolbarConfig } from './toolbar.js';
|
|
1160
|
+
import { ToolbarTextSize, HeadingLevel } from './toolbar-text.js';
|
|
1161
|
+
import './pane.js';
|
|
1162
|
+
import './sides-BPSWde0A.js';
|
|
349
1163
|
|
|
350
1164
|
/**
|
|
351
1165
|
* One entry in a {@link NavStack}. The app owns the stack as an array (usually a
|
|
@@ -354,11 +1168,30 @@ import { SafeHtml } from 'kerfjs';
|
|
|
354
1168
|
interface NavStackView {
|
|
355
1169
|
/** Stable identity for keyed reconcile and transition direction. */
|
|
356
1170
|
key: string;
|
|
357
|
-
content:
|
|
1171
|
+
content: KerfUiContent;
|
|
358
1172
|
/** Title shown in the top toolbar for this view. */
|
|
359
1173
|
title?: string;
|
|
1174
|
+
/** Leading groups for this view's top toolbar, after the back control and before the title. */
|
|
1175
|
+
leading?: KerfUiContent;
|
|
1176
|
+
/** Center content for this view's top toolbar (placed per `toolbarConfig.centerAlign`). */
|
|
1177
|
+
center?: KerfUiContent;
|
|
360
1178
|
/** Trailing actions for this view's top toolbar. */
|
|
361
|
-
toolbar?:
|
|
1179
|
+
toolbar?: KerfUiContent;
|
|
1180
|
+
/** Bottom toolbar for this view. Cross-fades with the top chrome on navigation. */
|
|
1181
|
+
bottomToolbar?: KerfUiContent;
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* The top toolbar's configuration. Its `ToolbarConfig` forwards to the real
|
|
1185
|
+
* `Toolbar` the stack renders; by default that toolbar draws no divider and
|
|
1186
|
+
* claims the top and side safe-area edges the stack still touches.
|
|
1187
|
+
*/
|
|
1188
|
+
interface NavStackToolbarConfig extends ToolbarConfig {
|
|
1189
|
+
/** Accessible name of the top toolbar (default: none). */
|
|
1190
|
+
label?: string;
|
|
1191
|
+
/** Size of the view title's `ToolbarText` (default `large`). */
|
|
1192
|
+
titleSize?: ToolbarTextSize;
|
|
1193
|
+
/** Expose the view title as a heading at this level (default: a plain span). */
|
|
1194
|
+
headingLevel?: HeadingLevel;
|
|
362
1195
|
}
|
|
363
1196
|
interface NavStackProps {
|
|
364
1197
|
id: string;
|
|
@@ -366,23 +1199,49 @@ interface NavStackProps {
|
|
|
366
1199
|
label: string;
|
|
367
1200
|
/** The stack, root first; the last entry is the active top view. */
|
|
368
1201
|
views: NavStackView[];
|
|
369
|
-
/** Accessible label for the back control (default "Back"). */
|
|
1202
|
+
/** Accessible label for the icon-only back control (default "Back"). */
|
|
370
1203
|
backLabel?: string;
|
|
1204
|
+
/** The back control's icon (default a chevron-left `LucideIcon`). */
|
|
1205
|
+
backIcon?: KerfUiContent;
|
|
1206
|
+
/**
|
|
1207
|
+
* Visible text beside the back icon, such as the previous view's title
|
|
1208
|
+
* (default: icon only). When set, the text names the control and
|
|
1209
|
+
* `backLabel` is not used.
|
|
1210
|
+
*/
|
|
1211
|
+
backText?: string;
|
|
1212
|
+
/** The top toolbar's configuration, forwarded to its `Toolbar`. */
|
|
1213
|
+
toolbarConfig?: NavStackToolbarConfig;
|
|
371
1214
|
/** Hide the top toolbar entirely (rare — a fully custom-chrome view). */
|
|
372
1215
|
hideToolbar?: boolean;
|
|
373
|
-
/** Optional persistent bottom toolbar. */
|
|
374
|
-
bottomToolbar?:
|
|
1216
|
+
/** Optional persistent bottom toolbar used when the active view does not provide one. */
|
|
1217
|
+
bottomToolbar?: KerfUiContent;
|
|
1218
|
+
/**
|
|
1219
|
+
* The line under the top chrome and over the bottom toolbar, where they
|
|
1220
|
+
* meet the active view. `scroll` (default) shows the chrome's line only
|
|
1221
|
+
* while the view's content is scrolled beneath it, and the bottom
|
|
1222
|
+
* toolbar's only while more content lies below — never when the content
|
|
1223
|
+
* fits — once `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is
|
|
1224
|
+
* wired above the stack; unwired, neither shows. `always` shows both
|
|
1225
|
+
* without the wiring; `none` neither, even when wired. The line is drawn
|
|
1226
|
+
* inside the chrome, so no state moves the chrome or the content. A
|
|
1227
|
+
* `toolbarConfig.dividerSides` edge is the Toolbar's own and is unaffected.
|
|
1228
|
+
*/
|
|
1229
|
+
chromeDividers?: 'scroll' | 'always' | 'none';
|
|
375
1230
|
className?: string;
|
|
1231
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
1232
|
+
slot?: string;
|
|
376
1233
|
}
|
|
377
1234
|
/**
|
|
378
1235
|
* A navigation stack (iOS-style push/pop). Renders every entry stacked, the last
|
|
379
1236
|
* one active; `@kerfjs/ui/wire-nav-stack`'s `wireNavStack` slides the content and
|
|
380
|
-
* cross-fades the chrome across a change.
|
|
381
|
-
*
|
|
1237
|
+
* cross-fades the chrome across a change. Its top chrome is a real `Toolbar`: the
|
|
1238
|
+
* back control and title lead, the active view's `leading` / `center` / `toolbar`
|
|
1239
|
+
* content fills the zones, and `toolbarConfig` configures it. A single-pane
|
|
1240
|
+
* layout is a `NavStack` with one entry. See `docs/23-app-layouts.md` §3.1.
|
|
382
1241
|
*/
|
|
383
|
-
declare function NavStack({ id, label, views, backLabel, hideToolbar, bottomToolbar, className }: NavStackProps): SafeHtml;
|
|
1242
|
+
declare function NavStack({ id, label, views, backLabel, backIcon, backText, toolbarConfig, hideToolbar, bottomToolbar, chromeDividers, className, slot, }: NavStackProps): kerfjs.SafeHtml;
|
|
384
1243
|
|
|
385
|
-
export { NavStack, type NavStackProps, type NavStackView };
|
|
1244
|
+
export { NavStack, type NavStackProps, type NavStackToolbarConfig, type NavStackView };
|
|
386
1245
|
```
|
|
387
1246
|
|
|
388
1247
|
## `@kerfjs/ui/wire-nav-stack`
|
|
@@ -398,7 +1257,10 @@ interface WireNavStackOptions {
|
|
|
398
1257
|
* Animate a `NavStack`'s push/pop transitions and wire its back control. The app
|
|
399
1258
|
* owns the stack (a signal of `NavStackView[]`) and re-renders `NavStack` when it
|
|
400
1259
|
* changes; this helper slides the content and settles the chrome across each
|
|
401
|
-
* change,
|
|
1260
|
+
* change, moves focus into every new top view, restores that view's last focused
|
|
1261
|
+
* descendant on pop, and calls `onBack` when the back control is used. Mark a
|
|
1262
|
+
* preferred initial target with `data-nav-focus`; otherwise the first focusable
|
|
1263
|
+
* descendant (or the view itself) receives focus. Returns a disposer.
|
|
402
1264
|
*/
|
|
403
1265
|
declare function wireNavStack(root: Element, options?: WireNavStackOptions): () => void;
|
|
404
1266
|
|
|
@@ -408,20 +1270,48 @@ export { type WireNavStackOptions, wireNavStack };
|
|
|
408
1270
|
## `@kerfjs/ui/split-view`
|
|
409
1271
|
|
|
410
1272
|
```ts
|
|
411
|
-
import
|
|
1273
|
+
import * as kerfjs from 'kerfjs';
|
|
1274
|
+
import { NavStackProps, NavStackView } from './nav-stack.js';
|
|
1275
|
+
import { ResizableRegionProps } from './resizable-region.js';
|
|
1276
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
1277
|
+
import './toolbar.js';
|
|
1278
|
+
import './pane.js';
|
|
1279
|
+
import './sides-BPSWde0A.js';
|
|
1280
|
+
import './toolbar-text.js';
|
|
1281
|
+
import './css-values.js';
|
|
412
1282
|
|
|
413
|
-
|
|
1283
|
+
/**
|
|
1284
|
+
* The roomy list pane's `ResizableRegion`: its committed `size` and `min` /
|
|
1285
|
+
* `max` limits, plus the region configuration that forwards unchanged
|
|
1286
|
+
* (`separator`, `handleIcon`, `contentOverflow`, and collapse:
|
|
1287
|
+
* `collapsed`, `transitioning`, `collapseMotion`, `restoreControl`,
|
|
1288
|
+
* `restorePosition`). Omitted options keep the region's defaults.
|
|
1289
|
+
*/
|
|
1290
|
+
interface SplitViewResizable extends Pick<ResizableRegionProps, 'separator' | 'handleIcon' | 'contentOverflow' | 'collapsed' | 'transitioning' | 'collapseMotion' | 'restoreControl' | 'restorePosition'> {
|
|
414
1291
|
size: number;
|
|
415
1292
|
min: number;
|
|
416
1293
|
max: number;
|
|
417
1294
|
}
|
|
1295
|
+
/** One compact view's top- and bottom-toolbar content (see `NavStackView`). */
|
|
1296
|
+
type SplitViewCompactViewToolbars = Pick<NavStackView, 'leading' | 'center' | 'toolbar' | 'bottomToolbar'>;
|
|
1297
|
+
/**
|
|
1298
|
+
* The compact `NavStack`'s configuration: its toolbar configuration, back
|
|
1299
|
+
* control, persistent bottom toolbar, and chrome dividers forward to the
|
|
1300
|
+
* stack, and `list` / `detail` give each view its own toolbar groups.
|
|
1301
|
+
*/
|
|
1302
|
+
interface SplitViewCompactStack extends Pick<NavStackProps, 'toolbarConfig' | 'backIcon' | 'backText' | 'hideToolbar' | 'bottomToolbar' | 'chromeDividers'> {
|
|
1303
|
+
/** Toolbar content for the list (root) view. */
|
|
1304
|
+
list?: SplitViewCompactViewToolbars;
|
|
1305
|
+
/** Toolbar content for the pushed detail view. */
|
|
1306
|
+
detail?: SplitViewCompactViewToolbars;
|
|
1307
|
+
}
|
|
418
1308
|
interface SplitViewProps {
|
|
419
1309
|
id: string;
|
|
420
1310
|
label: string;
|
|
421
1311
|
/** The list (primary) pane. */
|
|
422
|
-
list:
|
|
1312
|
+
list: KerfUiContent;
|
|
423
1313
|
/** The detail (secondary) pane. */
|
|
424
|
-
detail:
|
|
1314
|
+
detail: KerfUiContent;
|
|
425
1315
|
/**
|
|
426
1316
|
* Compact ("one pane at a time") classes — a handset or portrait tablet.
|
|
427
1317
|
* Derive from `deviceClass().value.compact`. When true the split collapses to
|
|
@@ -436,81 +1326,759 @@ interface SplitViewProps {
|
|
|
436
1326
|
detailTitle?: string;
|
|
437
1327
|
/** Back label for the compact NavStack (default "Back"). */
|
|
438
1328
|
backLabel?: string;
|
|
1329
|
+
/** Compact NavStack configuration and per-view toolbars. */
|
|
1330
|
+
compactStack?: SplitViewCompactStack;
|
|
439
1331
|
/** A resizable separator on roomy classes (min/max px). Omit for a fixed split. */
|
|
440
1332
|
resizable?: SplitViewResizable;
|
|
441
1333
|
className?: string;
|
|
1334
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
1335
|
+
slot?: string;
|
|
442
1336
|
}
|
|
443
1337
|
/**
|
|
444
|
-
* A list-detail
|
|
1338
|
+
* A list-detail split. On roomy classes it shows both panes side
|
|
445
1339
|
* by side with an optional resizable separator; on compact classes it collapses
|
|
446
1340
|
* to a `NavStack` (list → detail). See `docs/23-app-layouts.md` §3.2. Compose the
|
|
447
1341
|
* resizable wiring with `wireResizableRegions` and the compact back with
|
|
448
1342
|
* `wireNavStack`.
|
|
449
1343
|
*/
|
|
450
|
-
declare function SplitView({ id, label, list, detail, compact, detailActive, listTitle, detailTitle, backLabel, resizable, className }: SplitViewProps): SafeHtml;
|
|
1344
|
+
declare function SplitView({ id, label, list, detail, compact, detailActive, listTitle, detailTitle, backLabel, compactStack, resizable, className, slot, }: SplitViewProps): kerfjs.SafeHtml;
|
|
1345
|
+
|
|
1346
|
+
export { SplitView, type SplitViewCompactStack, type SplitViewCompactViewToolbars, type SplitViewProps, type SplitViewResizable };
|
|
1347
|
+
```
|
|
1348
|
+
|
|
1349
|
+
## `@kerfjs/ui/pane`
|
|
1350
|
+
|
|
1351
|
+
```ts
|
|
1352
|
+
import * as kerfjs from 'kerfjs';
|
|
1353
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* Logical pane sides: where a {@link Pane} can show a separator and where it can
|
|
1357
|
+
* compensate for a device safe-area inset.
|
|
1358
|
+
*/
|
|
1359
|
+
type PaneSeparatorSide = 'block-start' | 'block-end' | 'inline-start' | 'inline-end';
|
|
1360
|
+
/** Semantic root elements supported by {@link Pane}. */
|
|
1361
|
+
type PaneElement = 'article' | 'aside' | 'div' | 'main' | 'section';
|
|
1362
|
+
/** Semantic elements supported by the scrolling content slot. */
|
|
1363
|
+
type PaneContentElement = 'div' | 'main' | 'nav' | 'section';
|
|
1364
|
+
type PaneRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
1365
|
+
'data-component'?: never;
|
|
1366
|
+
'data-separator-block-start'?: never;
|
|
1367
|
+
'data-separator-block-end'?: never;
|
|
1368
|
+
'data-separator-inline-start'?: never;
|
|
1369
|
+
'data-separator-inline-end'?: never;
|
|
1370
|
+
'data-safe-area-block-start'?: never;
|
|
1371
|
+
'data-safe-area-block-end'?: never;
|
|
1372
|
+
'data-safe-area-inline-start'?: never;
|
|
1373
|
+
'data-safe-area-inline-end'?: never;
|
|
1374
|
+
'data-chrome-placement'?: never;
|
|
1375
|
+
'data-chrome-dividers'?: never;
|
|
1376
|
+
}>;
|
|
1377
|
+
/** How a Pane's header and footer relate to its scrolling content. */
|
|
1378
|
+
type PaneChromePlacement = 'fixed' | 'auto';
|
|
1379
|
+
/**
|
|
1380
|
+
* When a Pane draws the divider between its pinned header or footer and its
|
|
1381
|
+
* scrolling content: `scroll` while content is scrolled away beneath that
|
|
1382
|
+
* chrome, as `wireScrollDividers` reports; `always`; or `none`.
|
|
1383
|
+
*/
|
|
1384
|
+
type PaneChromeDividers = 'scroll' | 'always' | 'none';
|
|
1385
|
+
interface PaneProps {
|
|
1386
|
+
/** Optional fixed chrome above the scrolling content, arranged vertically. */
|
|
1387
|
+
header?: KerfUiContent;
|
|
1388
|
+
/** The pane's primary vertical, scrolling content stack. */
|
|
1389
|
+
children?: KerfUiContent;
|
|
1390
|
+
/** Optional fixed chrome below the scrolling content. */
|
|
1391
|
+
footer?: KerfUiContent;
|
|
1392
|
+
/**
|
|
1393
|
+
* Whether the header and footer stay pinned around the scrolling content.
|
|
1394
|
+
* `fixed` (default) always pins them. `auto` pins them while the pane is
|
|
1395
|
+
* tall enough, and below 480px of height (30rem, so it scales with the text
|
|
1396
|
+
* size) lets the whole pane scroll as one column, so tall chrome can never
|
|
1397
|
+
* squeeze the content to nothing.
|
|
1398
|
+
*/
|
|
1399
|
+
chromePlacement?: PaneChromePlacement;
|
|
1400
|
+
/**
|
|
1401
|
+
* The divider under the header and over the footer, where they meet the
|
|
1402
|
+
* scrolling content. `scroll` (default) shows the header's divider only
|
|
1403
|
+
* while the content is scrolled down, and the footer's only while more
|
|
1404
|
+
* content lies below — never when the content fits — once
|
|
1405
|
+
* `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is wired above
|
|
1406
|
+
* the pane; unwired, neither shows. `always` shows both; `none` neither.
|
|
1407
|
+
* The line is drawn inside the chrome, so no state moves the content.
|
|
1408
|
+
*/
|
|
1409
|
+
chromeDividers?: PaneChromeDividers;
|
|
1410
|
+
/** Root semantics. Defaults to `div`. */
|
|
1411
|
+
element?: PaneElement;
|
|
1412
|
+
/** Scrolling content semantics. Defaults to `div`. */
|
|
1413
|
+
contentElement?: PaneContentElement;
|
|
1414
|
+
/** Independent logical-edge separator lines. Defaults to none. */
|
|
1415
|
+
separators?: readonly PaneSeparatorSide[];
|
|
1416
|
+
/**
|
|
1417
|
+
* Sides on which the pane may compensate for a device safe-area inset.
|
|
1418
|
+
* Defaults to every side: the pane pads its slots for each side that still
|
|
1419
|
+
* reaches an unsafe screen edge, as its surrounding layout reports, while its
|
|
1420
|
+
* background and separators paint through. List only the sides an app-owned
|
|
1421
|
+
* layout places at a screen edge, or pass `[]` to opt out.
|
|
1422
|
+
*/
|
|
1423
|
+
safeAreaEdges?: readonly PaneSeparatorSide[];
|
|
1424
|
+
id?: string;
|
|
1425
|
+
/** Accessible name for a landmark root such as `aside` or `main`. */
|
|
1426
|
+
label?: string;
|
|
1427
|
+
/** Accessible name for a landmark scrolling slot such as `nav`. */
|
|
1428
|
+
contentLabel?: string;
|
|
1429
|
+
className?: string;
|
|
1430
|
+
headerClassName?: string;
|
|
1431
|
+
contentClassName?: string;
|
|
1432
|
+
footerClassName?: string;
|
|
1433
|
+
/** Safe `data-*` metadata; Pane-owned structural attributes remain protected. */
|
|
1434
|
+
rootAttributes?: PaneRootAttributes;
|
|
1435
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
1436
|
+
slot?: string;
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* A pane's configuration, apart from its content and styling hooks: the props a
|
|
1440
|
+
* composite that renders a `Pane` for the app (a Workbench panel or work area,
|
|
1441
|
+
* or a CollapsiblePanel) forwards, so the app configures that pane instead of
|
|
1442
|
+
* styling it. An omitted or `undefined` field keeps the composite's default.
|
|
1443
|
+
*/
|
|
1444
|
+
type PaneConfig = Pick<PaneProps, 'contentElement' | 'contentLabel' | 'separators' | 'safeAreaEdges' | 'chromeDividers'>;
|
|
1445
|
+
/**
|
|
1446
|
+
* An unpadded application column with optional fixed header/footer slots and one
|
|
1447
|
+
* scrolling vertical content owner. Separator lines are independently opt-in on
|
|
1448
|
+
* each logical edge, so the same component works as a sidebar, main area,
|
|
1449
|
+
* inspector, or dialog column.
|
|
1450
|
+
*/
|
|
1451
|
+
declare function Pane({ header, children, footer, chromePlacement, chromeDividers, element, contentElement, separators, safeAreaEdges, id, label, contentLabel, className, headerClassName, contentClassName, footerClassName, rootAttributes, slot, }: PaneProps): kerfjs.SafeHtml;
|
|
451
1452
|
|
|
452
|
-
export {
|
|
1453
|
+
export { Pane, type PaneChromeDividers, type PaneChromePlacement, type PaneConfig, type PaneContentElement, type PaneElement, type PaneProps, type PaneSeparatorSide };
|
|
453
1454
|
```
|
|
454
1455
|
|
|
455
1456
|
## `@kerfjs/ui/workbench`
|
|
456
1457
|
|
|
457
1458
|
```ts
|
|
458
1459
|
import { SafeHtml } from 'kerfjs';
|
|
1460
|
+
import { ListConfig } from './list.js';
|
|
1461
|
+
import { PaneConfig } from './pane.js';
|
|
1462
|
+
import { ResizableRegionSeparator, ResizableRegionCollapseMotion, ResizableRegionContentOverflow, ResizableRegionPresentation, ResizableRegionRestorePosition } from './resizable-region.js';
|
|
1463
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
1464
|
+
import { a as PanelToolbar, b as PanelToggle } from './panel-toolbar-DqwtBxQL.js';
|
|
1465
|
+
import { ToolbarConfig } from './toolbar.js';
|
|
1466
|
+
import './css-values.js';
|
|
1467
|
+
import './flex-alignment-4ms8ZbV8.js';
|
|
1468
|
+
import './sides-BPSWde0A.js';
|
|
1469
|
+
import './lucide-icon.js';
|
|
1470
|
+
import 'lucide';
|
|
1471
|
+
|
|
1472
|
+
/** The standard toggle a Workbench renders for a panel (see {@link PanelToggle}). */
|
|
1473
|
+
type WorkbenchPanelToggle = PanelToggle;
|
|
1474
|
+
/**
|
|
1475
|
+
* A Workbench panel's top toolbar, composed by the Workbench so its groups can
|
|
1476
|
+
* follow the panel's open state (see {@link PanelToolbar} for the roles).
|
|
1477
|
+
* A collapsed rail's marked groups and toggle go to the leading edge of
|
|
1478
|
+
* `mainToolbar` (left rail) or its trailing edge (right rail); a collapsed
|
|
1479
|
+
* drawer's go to the trailing edge of `mainBottomToolbar`, else to a
|
|
1480
|
+
* `FloatingToolbar` in the work area's bottom-end corner.
|
|
1481
|
+
*/
|
|
1482
|
+
type WorkbenchPanelToolbar = PanelToolbar;
|
|
1483
|
+
/**
|
|
1484
|
+
* The work area's top toolbar; collapsed rails add their groups to it. Its
|
|
1485
|
+
* configuration forwards to its `Toolbar`. It draws no divider of its own by
|
|
1486
|
+
* default: the work area's `Pane` draws one under its header chrome, wherever
|
|
1487
|
+
* that chrome ends, while `main` is scrolled (`mainPane.chromeDividers`).
|
|
1488
|
+
*/
|
|
1489
|
+
interface WorkbenchMainToolbar extends ToolbarConfig {
|
|
1490
|
+
label: string;
|
|
1491
|
+
/** The work area's title, usually an extra-large `ToolbarText`. */
|
|
1492
|
+
title?: KerfUiContent;
|
|
1493
|
+
/** Groups after the title. */
|
|
1494
|
+
leading?: KerfUiContent;
|
|
1495
|
+
center?: KerfUiContent;
|
|
1496
|
+
/** Groups at the trailing edge, before a collapsed right rail's groups. */
|
|
1497
|
+
trailing?: KerfUiContent;
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* The work area's bottom toolbar; a collapsed drawer adds its groups to it.
|
|
1501
|
+
* Its configuration forwards to its `Toolbar`. It draws no divider of its own
|
|
1502
|
+
* by default: the work area's `Pane` draws one over its footer chrome while
|
|
1503
|
+
* more of `main` lies below (`mainPane.chromeDividers`).
|
|
1504
|
+
*/
|
|
1505
|
+
interface WorkbenchMainBottomToolbar extends ToolbarConfig {
|
|
1506
|
+
label: string;
|
|
1507
|
+
leading?: KerfUiContent;
|
|
1508
|
+
center?: KerfUiContent;
|
|
1509
|
+
trailing?: KerfUiContent;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Whether the work area's header or footer chrome stays pinned (`fixed`),
|
|
1513
|
+
* scrolls away with the content (`scroll`), or stays pinned while the work
|
|
1514
|
+
* area is tall enough and scrolls with the content when it is short (`auto`,
|
|
1515
|
+
* the Pane's `chromePlacement="auto"`; it applies to the pinned header and
|
|
1516
|
+
* footer together).
|
|
1517
|
+
*/
|
|
1518
|
+
type WorkbenchChromePlacement = 'fixed' | 'scroll' | 'auto';
|
|
459
1519
|
|
|
1520
|
+
/**
|
|
1521
|
+
* The Workbench container breakpoint below which a panel presents as an
|
|
1522
|
+
* overlay: `narrow` (704px or less) or `compact` (448px or less) — the same
|
|
1523
|
+
* breakpoints as `ResizableRegion`'s `responsiveFillAt` — or `never` to keep
|
|
1524
|
+
* it inline at every width.
|
|
1525
|
+
*/
|
|
1526
|
+
type WorkbenchResponsiveOverlayAt = 'compact' | 'narrow' | 'never';
|
|
1527
|
+
/**
|
|
1528
|
+
* How wide a rail's overlay is in a compact (448px or less) Workbench: `inset`
|
|
1529
|
+
* fills the Workbench less a dismiss margin on the side away from the rail's
|
|
1530
|
+
* edge, so a press beside it closes it; `full` fills the Workbench.
|
|
1531
|
+
*/
|
|
1532
|
+
type WorkbenchCompactOverlay = 'inset' | 'full';
|
|
1533
|
+
/** Drag-resize limits for a resizable Workbench panel, in px. */
|
|
1534
|
+
interface WorkbenchPanelResizable {
|
|
1535
|
+
/** Smallest size (default 180 for a rail, 120 for the drawer). */
|
|
1536
|
+
min?: number;
|
|
1537
|
+
/** Largest size (default 480). */
|
|
1538
|
+
max?: number;
|
|
1539
|
+
}
|
|
460
1540
|
/** A collapsible Workbench panel — a side rail or the bottom drawer. */
|
|
461
1541
|
interface WorkbenchPanel {
|
|
462
|
-
content:
|
|
1542
|
+
content: KerfUiContent;
|
|
1543
|
+
/**
|
|
1544
|
+
* The panel's top toolbar, composed by the Workbench: its marked groups
|
|
1545
|
+
* and standard `toggle` move to the work area's toolbar while the panel is
|
|
1546
|
+
* collapsed. With it, `content` renders in a `Pane` below the toolbar.
|
|
1547
|
+
*/
|
|
1548
|
+
toolbar?: WorkbenchPanelToolbar;
|
|
1549
|
+
/** Optional bottom toolbar under a `toolbar` panel's content. */
|
|
1550
|
+
footer?: KerfUiContent;
|
|
1551
|
+
/**
|
|
1552
|
+
* Configuration for a `toolbar` panel's `Pane` (`contentElement`,
|
|
1553
|
+
* `contentLabel`, `separators`, `safeAreaEdges`, `chromeDividers`) — for example
|
|
1554
|
+
* `{ contentElement: 'nav', contentLabel: 'Sections' }` for a navigation
|
|
1555
|
+
* rail. Omitted or `undefined` fields keep the `Pane` defaults. Ignored
|
|
1556
|
+
* without a `toolbar`, where `content` renders as given.
|
|
1557
|
+
*/
|
|
1558
|
+
pane?: PaneConfig;
|
|
463
1559
|
/** Whether the panel is currently collapsed (the app owns this). */
|
|
464
1560
|
collapsed?: boolean;
|
|
465
|
-
/**
|
|
1561
|
+
/**
|
|
1562
|
+
* Rail width, or drawer height, in px. Overrides the CSS default. For a
|
|
1563
|
+
* resizable panel it is the current size (default 280 for a rail, 220 for
|
|
1564
|
+
* the drawer), clamped to the limits; the app owns it and `wireWorkbench`
|
|
1565
|
+
* reports each resize.
|
|
1566
|
+
*/
|
|
466
1567
|
size?: number;
|
|
1568
|
+
/**
|
|
1569
|
+
* Opt in to drag and keyboard resizing on the panel's inner separator:
|
|
1570
|
+
* `true` for the default limits, or `{ min, max }`. Off by default. Pair it
|
|
1571
|
+
* with `wireWorkbench` from `@kerfjs/ui/wire-workbench`.
|
|
1572
|
+
*/
|
|
1573
|
+
resizable?: boolean | WorkbenchPanelResizable;
|
|
467
1574
|
/** Accessible name for the panel region. */
|
|
468
1575
|
label?: string;
|
|
1576
|
+
separator?: ResizableRegionSeparator;
|
|
1577
|
+
collapseMotion?: ResizableRegionCollapseMotion;
|
|
1578
|
+
contentOverflow?: ResizableRegionContentOverflow;
|
|
1579
|
+
presentation?: ResizableRegionPresentation;
|
|
1580
|
+
/**
|
|
1581
|
+
* Present the panel as an overlay, without a separator, below a Workbench
|
|
1582
|
+
* container breakpoint, and inline above it — the CSS decides, so the app
|
|
1583
|
+
* needs no device-class check. A rail overlays from its side at full
|
|
1584
|
+
* height, over the work area and an open drawer; the bottom drawer
|
|
1585
|
+
* overlays the bottom of the work-area column. Rails default to `narrow`
|
|
1586
|
+
* (pass `never` to keep one inline); the drawer defaults to inline.
|
|
1587
|
+
*/
|
|
1588
|
+
responsiveOverlayAt?: WorkbenchResponsiveOverlayAt;
|
|
1589
|
+
/**
|
|
1590
|
+
* A rail's overlay width in a compact Workbench (default `inset`: the
|
|
1591
|
+
* Workbench less `--kui-workbench-overlay-dismiss-margin`, 44px). Ignored
|
|
1592
|
+
* by the drawer.
|
|
1593
|
+
*/
|
|
1594
|
+
compactOverlay?: WorkbenchCompactOverlay;
|
|
1595
|
+
/**
|
|
1596
|
+
* Control shown while collapsed, in a safe-area-aware corner of the
|
|
1597
|
+
* Workbench (not the viewport); the bottom drawer's sits in the work-area
|
|
1598
|
+
* column. Prefer `toolbar.toggle`, which the Workbench relocates into the
|
|
1599
|
+
* work area's toolbar (or this corner when that toolbar is absent).
|
|
1600
|
+
*/
|
|
1601
|
+
restoreControl?: SafeHtml;
|
|
1602
|
+
restorePosition?: ResizableRegionRestorePosition;
|
|
1603
|
+
}
|
|
1604
|
+
interface WorkbenchProps {
|
|
1605
|
+
/**
|
|
1606
|
+
* The Workbench's `id`. Each panel's `id` derives from it —
|
|
1607
|
+
* `<id>-left-rail`, `<id>-right-rail`, `<id>-bottom-drawer` — so a toggle
|
|
1608
|
+
* can name the panel it shows and hides with `aria-controls`.
|
|
1609
|
+
*/
|
|
1610
|
+
id: string;
|
|
1611
|
+
label: string;
|
|
1612
|
+
/** The central work area. */
|
|
1613
|
+
main: KerfUiContent;
|
|
1614
|
+
/**
|
|
1615
|
+
* The work area's top toolbar. A collapsed left rail's marked groups
|
|
1616
|
+
* and toggle lead it; a collapsed right rail's trail it. With it, `main`
|
|
1617
|
+
* renders in a `Pane` below the toolbar.
|
|
1618
|
+
*/
|
|
1619
|
+
mainToolbar?: WorkbenchMainToolbar;
|
|
1620
|
+
/**
|
|
1621
|
+
* Fixed content under `mainToolbar` — supporting copy such as a
|
|
1622
|
+
* description — divided from the scrolling `main` below it.
|
|
1623
|
+
*/
|
|
1624
|
+
mainHeader?: KerfUiContent;
|
|
1625
|
+
/**
|
|
1626
|
+
* Fixed content over `mainBottomToolbar` — a status line or a resource
|
|
1627
|
+
* toolbar — divided from the scrolling `main` above it.
|
|
1628
|
+
*/
|
|
1629
|
+
mainFooter?: KerfUiContent;
|
|
1630
|
+
/**
|
|
1631
|
+
* The work area's bottom toolbar. A collapsed drawer's marked groups and
|
|
1632
|
+
* toggle trail it; without it they float in the work area's corner.
|
|
1633
|
+
*/
|
|
1634
|
+
mainBottomToolbar?: WorkbenchMainBottomToolbar;
|
|
1635
|
+
/**
|
|
1636
|
+
* Whether `mainToolbar` and `mainHeader` stay pinned (`fixed`, default),
|
|
1637
|
+
* scroll away with `main` (`scroll`) — useful where large text would leave
|
|
1638
|
+
* pinned chrome little room — or stay pinned while the work area is tall
|
|
1639
|
+
* enough and scroll with `main` when it is short (`auto`).
|
|
1640
|
+
*/
|
|
1641
|
+
mainHeaderPlacement?: WorkbenchChromePlacement;
|
|
1642
|
+
/** The same for `mainFooter` and `mainBottomToolbar` (default `fixed`). */
|
|
1643
|
+
mainFooterPlacement?: WorkbenchChromePlacement;
|
|
1644
|
+
/**
|
|
1645
|
+
* Configuration for the work area's `Pane` (`contentElement`,
|
|
1646
|
+
* `contentLabel`, `separators`, `safeAreaEdges`, `chromeDividers`), which it has whenever it
|
|
1647
|
+
* has a toolbar, `mainHeader`, or `mainFooter`; without that chrome, `main`
|
|
1648
|
+
* renders as given and this is ignored. Omitted or `undefined` fields keep
|
|
1649
|
+
* the `Pane` defaults.
|
|
1650
|
+
*/
|
|
1651
|
+
mainPane?: PaneConfig;
|
|
1652
|
+
/**
|
|
1653
|
+
* Configuration for the `List` that holds `mainHeader` (`gap`, `hAlign`,
|
|
1654
|
+
* `vAlign`, `dividerSides`, `textInsets`, `controlInsets`). Omitted or
|
|
1655
|
+
* `undefined` fields keep the defaults (no divider: the work area's
|
|
1656
|
+
* `Pane` draws the line under its header chrome).
|
|
1657
|
+
*/
|
|
1658
|
+
mainHeaderList?: ListConfig;
|
|
1659
|
+
/**
|
|
1660
|
+
* The same for the `List` that holds `mainFooter` (no divider by default:
|
|
1661
|
+
* the work area's `Pane` draws the line over its footer chrome).
|
|
1662
|
+
*/
|
|
1663
|
+
mainFooterList?: ListConfig;
|
|
1664
|
+
leftRail?: WorkbenchPanel;
|
|
1665
|
+
rightRail?: WorkbenchPanel;
|
|
1666
|
+
bottomDrawer?: WorkbenchPanel;
|
|
1667
|
+
/**
|
|
1668
|
+
* Minimum width, in px, the work area keeps beside the inline rails, fixed
|
|
1669
|
+
* or `resizable` (default 320; `0` turns it off). Resizing a rail stops
|
|
1670
|
+
* where the work area would drop below it, and inline rails shrink
|
|
1671
|
+
* proportionally when the Workbench gets narrower. Workbenches without a
|
|
1672
|
+
* rail ignore it.
|
|
1673
|
+
*/
|
|
1674
|
+
mainMinSize?: number;
|
|
1675
|
+
/**
|
|
1676
|
+
* Minimum height, in px, the work area keeps above an inline bottom drawer,
|
|
1677
|
+
* fixed or `resizable` (default 120; `0` turns it off) — the drawer's
|
|
1678
|
+
* counterpart of `mainMinSize`. Resizing the drawer stops where the work
|
|
1679
|
+
* area would drop below it, and the drawer shrinks when the Workbench gets
|
|
1680
|
+
* shorter. Workbenches without a drawer ignore it.
|
|
1681
|
+
*/
|
|
1682
|
+
mainMinHeight?: number;
|
|
1683
|
+
className?: string;
|
|
1684
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
1685
|
+
slot?: string;
|
|
1686
|
+
}
|
|
1687
|
+
/**
|
|
1688
|
+
* The Xcode-like multi-panel workspace: a collapsible left rail, right rail, and
|
|
1689
|
+
* bottom drawer around a central work area (any absent). Collapsing snaps the
|
|
1690
|
+
* panel's track to zero in one reflow while its fixed-size content slides out via
|
|
1691
|
+
* a composited transform — the instant-width / sliding-content technique, so the
|
|
1692
|
+
* work area relayouts once, not per frame. Bottom-drawer content stays anchored
|
|
1693
|
+
* to the shell's stable bottom edge throughout that transition. The app owns
|
|
1694
|
+
* each `collapsed` flag; the collapse is pure CSS. A collapsed panel renders
|
|
1695
|
+
* `inert` and `aria-hidden`, so neither Tab nor assistive technology reaches
|
|
1696
|
+
* controls that have slid out of view or an empty landmark (its restore control
|
|
1697
|
+
* lives outside it and stays reachable). A panel may opt in to drag and keyboard resizing with
|
|
1698
|
+
* `resizable`, which `wireWorkbench` drives. See `docs/23-app-layouts.md` §3.3.
|
|
1699
|
+
*/
|
|
1700
|
+
declare function Workbench({ id, label, main, leftRail, rightRail, bottomDrawer, mainToolbar, mainHeader, mainFooter, mainBottomToolbar, mainHeaderPlacement, mainFooterPlacement, mainPane, mainHeaderList, mainFooterList, mainMinSize, mainMinHeight, className, slot, }: WorkbenchProps): SafeHtml;
|
|
1701
|
+
|
|
1702
|
+
export { Workbench, type WorkbenchChromePlacement, type WorkbenchCompactOverlay, type WorkbenchMainBottomToolbar, type WorkbenchMainToolbar, type WorkbenchPanel, type WorkbenchPanelResizable, type WorkbenchPanelToggle, type WorkbenchPanelToolbar, type WorkbenchProps, type WorkbenchResponsiveOverlayAt };
|
|
1703
|
+
```
|
|
1704
|
+
|
|
1705
|
+
## `@kerfjs/ui/wire-workbench`
|
|
1706
|
+
|
|
1707
|
+
```ts
|
|
1708
|
+
import { Signal, ReadonlySignal } from 'kerfjs';
|
|
1709
|
+
import { DeviceClass } from './device-class.js';
|
|
1710
|
+
|
|
1711
|
+
/** A Workbench panel slot, named after its `WorkbenchProps` prop. */
|
|
1712
|
+
type WorkbenchPanelKey = 'leftRail' | 'rightRail' | 'bottomDrawer';
|
|
1713
|
+
|
|
1714
|
+
/** Minimal `localStorage`-shaped store, so the persistence hook is testable. */
|
|
1715
|
+
interface WorkbenchStorage {
|
|
1716
|
+
getItem(key: string): string | null;
|
|
1717
|
+
setItem(key: string, value: string): void;
|
|
1718
|
+
}
|
|
1719
|
+
/** One Workbench panel's app-owned state. */
|
|
1720
|
+
interface WireWorkbenchPanel {
|
|
1721
|
+
/**
|
|
1722
|
+
* The app-owned size signal a `resizable` panel renders as its `size`.
|
|
1723
|
+
* `wireWorkbench` writes each committed resize here; collapsing never
|
|
1724
|
+
* touches it, so an expanded panel returns at the size it had. Omit it for
|
|
1725
|
+
* a panel that is not resizable.
|
|
1726
|
+
*/
|
|
1727
|
+
size?: Signal<number>;
|
|
1728
|
+
/**
|
|
1729
|
+
* When set with `size`, the size is loaded from and saved to `storage`
|
|
1730
|
+
* under this key, so the panel remembers the user's size.
|
|
1731
|
+
*/
|
|
1732
|
+
storageKey?: string;
|
|
1733
|
+
/**
|
|
1734
|
+
* The app-owned signal the panel renders as its `collapsed`. With it (and
|
|
1735
|
+
* `dismissOverlays`, on by default) `wireWorkbench` treats the panel as a
|
|
1736
|
+
* transient overlay while it presents as one: it collapses when its
|
|
1737
|
+
* `responsiveOverlayAt` breakpoint begins to apply and gets its inline state
|
|
1738
|
+
* back when the breakpoint stops applying, an open overlay takes focus and
|
|
1739
|
+
* keeps Tab inside it, and it closes on Escape or a press outside it.
|
|
1740
|
+
*/
|
|
1741
|
+
collapsed?: Signal<boolean>;
|
|
1742
|
+
}
|
|
1743
|
+
/** A resize the user made, after `wireWorkbench` wrote it to the size signal. */
|
|
1744
|
+
interface WorkbenchResize {
|
|
1745
|
+
panel: WorkbenchPanelKey;
|
|
1746
|
+
size: number;
|
|
1747
|
+
source: 'keyboard' | 'pointer';
|
|
1748
|
+
}
|
|
1749
|
+
interface WireWorkbenchOptions {
|
|
1750
|
+
/** The `id` the `Workbench` was rendered with. */
|
|
1751
|
+
id: string;
|
|
1752
|
+
/**
|
|
1753
|
+
* The wired panels, keyed like the `Workbench` props. Render a panel given
|
|
1754
|
+
* a `size` with `resizable` and `size={panel.size.value}`, and one given a
|
|
1755
|
+
* `collapsed` signal with `collapsed={panel.collapsed.value}`.
|
|
1756
|
+
*/
|
|
1757
|
+
panels: Partial<Record<WorkbenchPanelKey, WireWorkbenchPanel>>;
|
|
1758
|
+
/**
|
|
1759
|
+
* When provided, resizing is suspended while `deviceClass.compact` is true —
|
|
1760
|
+
* the classes where rails become overlay drawers or are replaced.
|
|
1761
|
+
*/
|
|
1762
|
+
deviceClass?: ReadonlySignal<DeviceClass>;
|
|
1763
|
+
/** Persistence store (default `globalThis.localStorage`, if present). */
|
|
1764
|
+
storage?: WorkbenchStorage;
|
|
1765
|
+
/** Keyboard step in px (default 16). */
|
|
1766
|
+
step?: number;
|
|
1767
|
+
/** Shift+arrow step in px (default 64). */
|
|
1768
|
+
largeStep?: number;
|
|
1769
|
+
/** Called after each committed resize. */
|
|
1770
|
+
onResize?: (change: WorkbenchResize) => void;
|
|
1771
|
+
/**
|
|
1772
|
+
* Treat the panels given a `collapsed` signal as transient overlays while
|
|
1773
|
+
* they present as overlays (default `true`), like `wireSidebar`'s compact
|
|
1774
|
+
* overlay: a panel whose `responsiveOverlayAt` breakpoint begins to apply
|
|
1775
|
+
* starts collapsed, with no collapse motion, and gets its inline collapsed
|
|
1776
|
+
* state back when the breakpoint stops applying (and on disposal); an open
|
|
1777
|
+
* overlay panel, responsive or `presentation: "overlay"`, closes on Escape
|
|
1778
|
+
* or a press that starts and ends outside it. A panel that opens as an
|
|
1779
|
+
* overlay takes focus on its first focusable control, and while it is open
|
|
1780
|
+
* Tab and Shift+Tab cycle through its controls instead of reaching the
|
|
1781
|
+
* work area it covers (the ARIA dialog pattern of `wireSidebar`'s compact
|
|
1782
|
+
* overlay); inline panels never move focus. Focus stranded in a closing
|
|
1783
|
+
* panel — however it closed, the app's own control inside it included —
|
|
1784
|
+
* returns to the control that had it when the panel opened, else to the
|
|
1785
|
+
* panel's restore control, else to a control outside the panel whose
|
|
1786
|
+
* `aria-controls` names it (each panel's `id` is its region id, e.g.
|
|
1787
|
+
* `studio-left-rail`) — the fallback for a panel already open at wire-up.
|
|
1788
|
+
* An opener inside a panel that has closed since is skipped. `false` leaves
|
|
1789
|
+
* every `collapsed` write and all focus handling to the app.
|
|
1790
|
+
*/
|
|
1791
|
+
dismissOverlays?: boolean;
|
|
1792
|
+
/**
|
|
1793
|
+
* Keep overlays exclusive (default `true`), like `wireSidebar`'s
|
|
1794
|
+
* `exclusiveCompact`: when a panel opens while it presents as an overlay,
|
|
1795
|
+
* every other open overlay panel — rails and the bottom drawer alike —
|
|
1796
|
+
* closes, so one overlay never covers another's controls. Panels presenting
|
|
1797
|
+
* inline are never closed by it. Applies only with `dismissOverlays`.
|
|
1798
|
+
*/
|
|
1799
|
+
exclusiveOverlays?: boolean;
|
|
1800
|
+
}
|
|
1801
|
+
/**
|
|
1802
|
+
* Wire a `Workbench`'s panels. For `resizable` panels given a `size` signal:
|
|
1803
|
+
* pointer drags and arrow / Shift+arrow / Home / End on each panel's
|
|
1804
|
+
* separator, clamped to the panel's limits and to the room that leaves the
|
|
1805
|
+
* work area its minimum width and height, committed to the app-owned size signals.
|
|
1806
|
+
* Optional persistence loads and saves each size; optional `deviceClass`
|
|
1807
|
+
* suspends resizing on compact classes. Collapse stays the app's `collapsed`
|
|
1808
|
+
* flag and never changes a size. For panels given a `collapsed` signal,
|
|
1809
|
+
* overlays are transient (`dismissOverlays`): a responsive overlay starts
|
|
1810
|
+
* collapsed, an open overlay takes focus and keeps Tab inside it, it closes
|
|
1811
|
+
* on Escape or an outside press, and
|
|
1812
|
+
* opening one overlay closes the others (`exclusiveOverlays`). Returns a disposer. See `docs/23-app-layouts.md` §3.3.
|
|
1813
|
+
*/
|
|
1814
|
+
declare function wireWorkbench(root: HTMLElement, { id, panels, deviceClass, storage, step, largeStep, onResize, dismissOverlays, exclusiveOverlays, }: WireWorkbenchOptions): () => void;
|
|
1815
|
+
|
|
1816
|
+
export { type WireWorkbenchOptions, type WireWorkbenchPanel, type WorkbenchPanelKey, type WorkbenchResize, type WorkbenchStorage, wireWorkbench };
|
|
1817
|
+
```
|
|
1818
|
+
|
|
1819
|
+
## `@kerfjs/ui/collapsible-panel`
|
|
1820
|
+
|
|
1821
|
+
```ts
|
|
1822
|
+
import { SafeHtml } from 'kerfjs';
|
|
1823
|
+
import { PaneConfig } from './pane.js';
|
|
1824
|
+
import { P as PanelSide, a as PanelToolbar, b as PanelToggle } from './panel-toolbar-DqwtBxQL.js';
|
|
1825
|
+
export { c as collapsiblePanelToggleIcon } from './panel-toolbar-DqwtBxQL.js';
|
|
1826
|
+
import { ResizableRegionSeparator, ResizableRegionCollapseMotion, ResizableRegionContentOverflow, ResizableRegionPresentation, ResizableRegionRestorePosition } from './resizable-region.js';
|
|
1827
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
1828
|
+
import './lucide-icon.js';
|
|
1829
|
+
import 'lucide';
|
|
1830
|
+
import './toolbar.js';
|
|
1831
|
+
import './sides-BPSWde0A.js';
|
|
1832
|
+
import './css-values.js';
|
|
1833
|
+
|
|
1834
|
+
/** Which edge a {@link CollapsiblePanel} docks to. */
|
|
1835
|
+
type CollapsiblePanelSide = PanelSide;
|
|
1836
|
+
/** The standard toggle a panel toolbar renders (see {@link CollapsiblePanelToolbar}). */
|
|
1837
|
+
type CollapsiblePanelToolbarToggle = PanelToggle;
|
|
1838
|
+
/**
|
|
1839
|
+
* A panel's composed top toolbar. Its groups occupy `leading`, `center`, and
|
|
1840
|
+
* `trailing` while open; groups marked `relocateOnCollapse` and the standard
|
|
1841
|
+
* toggle move to the work-area toolbar through
|
|
1842
|
+
* {@link CollapsiblePanelRelocated} while it is collapsed.
|
|
1843
|
+
*/
|
|
1844
|
+
type CollapsiblePanelToolbar = PanelToolbar;
|
|
1845
|
+
interface CollapsiblePanelToggleProps {
|
|
1846
|
+
/** The panel this toggle controls. */
|
|
1847
|
+
side: CollapsiblePanelSide;
|
|
1848
|
+
/** The panel's current collapsed state (drives the icon direction). */
|
|
1849
|
+
collapsed: boolean;
|
|
1850
|
+
/** `data-action` the button carries so `wireSidebar` can delegate its click. */
|
|
1851
|
+
action: string;
|
|
1852
|
+
/** The panel id the button targets (`data-tab-panel`-style: `data-collapsible-panel`). */
|
|
1853
|
+
panelId?: string;
|
|
1854
|
+
/** Accessible label; defaults to "Collapse"/"Expand". */
|
|
1855
|
+
label?: string;
|
|
1856
|
+
className?: string;
|
|
1857
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
1858
|
+
slot?: string;
|
|
1859
|
+
}
|
|
1860
|
+
/**
|
|
1861
|
+
* A standard collapse/expand toggle button for a {@link CollapsiblePanel}: the
|
|
1862
|
+
* recognizable per-side icon (see {@link collapsiblePanelToggleIcon}) plus the
|
|
1863
|
+
* `data-action` / `aria-expanded` `wireSidebar` reads. Placement is the app's —
|
|
1864
|
+
* put it in the panel's own header (to collapse) and somewhere always-visible
|
|
1865
|
+
* (to expand while collapsed).
|
|
1866
|
+
*/
|
|
1867
|
+
declare function CollapsiblePanelToggle({ side, collapsed, action, panelId, label, className, slot, }: CollapsiblePanelToggleProps): SafeHtml;
|
|
1868
|
+
interface CollapsiblePanelProps {
|
|
1869
|
+
/** A stable id for the panel — `wireSidebar` targets it and toggles reference it. */
|
|
1870
|
+
id: string;
|
|
1871
|
+
/** Which edge the panel docks to: a left/right rail or a bottom drawer. */
|
|
1872
|
+
side: CollapsiblePanelSide;
|
|
1873
|
+
/** Whether the panel is currently collapsed (the app owns this signal). */
|
|
1874
|
+
collapsed?: boolean;
|
|
1875
|
+
/** Rail width or drawer height in px. Overrides the CSS default. */
|
|
1876
|
+
size?: number;
|
|
1877
|
+
/** Accessible label for the panel region. */
|
|
1878
|
+
label?: string;
|
|
1879
|
+
/** Panel content. */
|
|
1880
|
+
children?: KerfUiContent;
|
|
1881
|
+
/**
|
|
1882
|
+
* The panel's top toolbar, composed so its groups follow the panel's open
|
|
1883
|
+
* state. With it, `children` renders in a `Pane` below the toolbar; render
|
|
1884
|
+
* {@link CollapsiblePanelRelocated} in the app's work-area toolbar so the
|
|
1885
|
+
* marked groups and toggle stay reachable while the panel is collapsed.
|
|
1886
|
+
*/
|
|
1887
|
+
toolbar?: CollapsiblePanelToolbar;
|
|
1888
|
+
/** Optional bottom toolbar under a `toolbar` panel's content. */
|
|
1889
|
+
footer?: KerfUiContent;
|
|
1890
|
+
/**
|
|
1891
|
+
* Configuration for a `toolbar` panel's `Pane` (`contentElement`,
|
|
1892
|
+
* `contentLabel`, `separators`, `safeAreaEdges`, `chromeDividers`) — for example
|
|
1893
|
+
* `{ contentElement: 'nav', contentLabel: 'Sections' }` for a navigation
|
|
1894
|
+
* rail. Omitted or `undefined` fields keep the `Pane` defaults. Ignored
|
|
1895
|
+
* without a `toolbar`, where `children` renders as given.
|
|
1896
|
+
*/
|
|
1897
|
+
pane?: PaneConfig;
|
|
1898
|
+
separator?: ResizableRegionSeparator;
|
|
1899
|
+
collapseMotion?: ResizableRegionCollapseMotion;
|
|
1900
|
+
contentOverflow?: ResizableRegionContentOverflow;
|
|
1901
|
+
presentation?: ResizableRegionPresentation;
|
|
1902
|
+
/** Control shown while collapsed, in a safe-area-aware corner of the panel's container (not the viewport). */
|
|
1903
|
+
restoreControl?: SafeHtml;
|
|
1904
|
+
restorePosition?: ResizableRegionRestorePosition;
|
|
1905
|
+
className?: string;
|
|
1906
|
+
}
|
|
1907
|
+
/**
|
|
1908
|
+
* A standalone collapsible side rail or bottom drawer, outside the full
|
|
1909
|
+
* {@link Workbench} shell. It owns only the presentation: a fixed-size content
|
|
1910
|
+
* area that stays laid out while the panel's track snaps to zero and the content
|
|
1911
|
+
* slides out via `transform` (one reflow, composited — the same technique
|
|
1912
|
+
* `Workbench` and the catalog sidebar use). Bottom-drawer content stays anchored
|
|
1913
|
+
* to the panel's fixed bottom edge, so the track cannot move its layout origin
|
|
1914
|
+
* underneath the transform transition. A collapsed panel renders `inert` (with
|
|
1915
|
+
* `aria-hidden`), so neither Tab, pointer, nor assistive technology reaches
|
|
1916
|
+
* content that has slid out of view; its `restoreControl` renders outside the
|
|
1917
|
+
* panel and stays reachable.
|
|
1918
|
+
* The app owns the `collapsed` signal;
|
|
1919
|
+
* pair it with `wireSidebar` for the toggle, focus, compact-overlay, keyboard,
|
|
1920
|
+
* and persistence semantics, and with `CollapsiblePanelToggle` for the standard
|
|
1921
|
+
* affordance. See `ui/docs/collapsible-panel.md` and `docs/23-app-layouts.md`.
|
|
1922
|
+
*/
|
|
1923
|
+
declare function CollapsiblePanel({ id, side, collapsed, size, label, children, toolbar, footer, pane, separator, collapseMotion, contentOverflow, presentation, restoreControl, restorePosition, className, }: CollapsiblePanelProps): SafeHtml;
|
|
1924
|
+
interface CollapsiblePanelRelocatedProps {
|
|
1925
|
+
/** The panel's `id`. */
|
|
1926
|
+
panelId: string;
|
|
1927
|
+
side: CollapsiblePanelSide;
|
|
1928
|
+
/** The panel's current collapsed state. */
|
|
1929
|
+
collapsed: boolean;
|
|
1930
|
+
/** The same `toolbar` the panel receives. */
|
|
1931
|
+
toolbar: CollapsiblePanelToolbar;
|
|
1932
|
+
}
|
|
1933
|
+
/**
|
|
1934
|
+
* A collapsed {@link CollapsiblePanel}'s marked groups and standard
|
|
1935
|
+
* toggle, for the app's work-area toolbar — nothing while the panel is open.
|
|
1936
|
+
* Put it first in the leading zone for a left rail, last in the trailing zone
|
|
1937
|
+
* for a right rail, and last in a bottom toolbar (or a `FloatingToolbar`
|
|
1938
|
+
* `restoreControl`) for a bottom drawer. `wireSidebar` hands focus to it when
|
|
1939
|
+
* the panel closes from its own toggle.
|
|
1940
|
+
*/
|
|
1941
|
+
declare function CollapsiblePanelRelocated({ panelId, side, collapsed, toolbar, }: CollapsiblePanelRelocatedProps): SafeHtml;
|
|
1942
|
+
|
|
1943
|
+
export { CollapsiblePanel, type CollapsiblePanelProps, CollapsiblePanelRelocated, type CollapsiblePanelRelocatedProps, type CollapsiblePanelSide, CollapsiblePanelToggle, type CollapsiblePanelToggleProps, type CollapsiblePanelToolbar, type CollapsiblePanelToolbarToggle };
|
|
1944
|
+
```
|
|
1945
|
+
|
|
1946
|
+
## `@kerfjs/ui/wire-sidebar`
|
|
1947
|
+
|
|
1948
|
+
```ts
|
|
1949
|
+
import { Signal, ReadonlySignal } from 'kerfjs';
|
|
1950
|
+
import { DeviceClass } from './device-class.js';
|
|
1951
|
+
|
|
1952
|
+
/** Minimal `localStorage`-shaped store, so the persistence hook is testable. */
|
|
1953
|
+
interface SidebarStorage {
|
|
1954
|
+
getItem(key: string): string | null;
|
|
1955
|
+
setItem(key: string, value: string): void;
|
|
469
1956
|
}
|
|
470
|
-
interface
|
|
1957
|
+
interface WireSidebarPanel {
|
|
1958
|
+
/** The panel id — matches `CollapsiblePanel`'s `id` and a toggle's `panelId`. */
|
|
471
1959
|
id: string;
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
1960
|
+
/** The app-owned collapsed signal. `wireSidebar` reads it (focus, overlay) and
|
|
1961
|
+
* writes it (toggle, Escape, backdrop, persistence). */
|
|
1962
|
+
collapsed: Signal<boolean>;
|
|
1963
|
+
/** `data-action` value the panel's toggle button(s) carry. */
|
|
1964
|
+
toggleAction: string;
|
|
1965
|
+
/** When set, the panel's inline collapsed state is loaded from and saved to
|
|
1966
|
+
* `storage` under this key (a persistence hook), so the panel remembers the
|
|
1967
|
+
* user's inline choice. A compact overlay's open/closed state is transient
|
|
1968
|
+
* and is never persisted. */
|
|
1969
|
+
storageKey?: string;
|
|
1970
|
+
/** The panel's inline (non-compact) collapsed state when `storage` holds no
|
|
1971
|
+
* choice for it; wire-up seeds the signal with it. Defaults to the signal's
|
|
1972
|
+
* own value. Set it when the app seeds the signal from the device class
|
|
1973
|
+
* (`signal(device.value.compact)`) so a compact first render already starts
|
|
1974
|
+
* collapsed while a later crossing to a wide class still restores this
|
|
1975
|
+
* inline default. */
|
|
1976
|
+
inlineCollapsed?: boolean;
|
|
1977
|
+
}
|
|
1978
|
+
interface WireSidebarOptions {
|
|
1979
|
+
panels: readonly WireSidebarPanel[];
|
|
1980
|
+
/**
|
|
1981
|
+
* When provided, the sidebar adopts a compact **overlay** presentation while
|
|
1982
|
+
* `deviceClass.compact` is true: an open panel floats over the content with a
|
|
1983
|
+
* dismissable backdrop, Escape and backdrop-click collapse it, and focus is
|
|
1984
|
+
* trapped within the open panel (the ARIA dialog pattern). Without it the panel
|
|
1985
|
+
* is always inline.
|
|
1986
|
+
*
|
|
1987
|
+
* An overlay is transient and user-initiated: whenever the compact overlay
|
|
1988
|
+
* presentation begins (wire-up on a compact device, or a crossing from a wide
|
|
1989
|
+
* class), every panel starts collapsed so nothing blocks the page until the
|
|
1990
|
+
* user opens it. The inline state is remembered and restored when the device
|
|
1991
|
+
* crosses back to a wide class (and on disposal).
|
|
1992
|
+
*/
|
|
1993
|
+
deviceClass?: ReadonlySignal<DeviceClass>;
|
|
1994
|
+
/** Compact devices either overlay the panels (default) or hide them in favor
|
|
1995
|
+
* of an application-owned responsive replacement. */
|
|
1996
|
+
compactPresentation?: 'overlay' | 'hidden';
|
|
1997
|
+
/** Collapse the other panels when one opens in compact overlay mode. */
|
|
1998
|
+
exclusiveCompact?: boolean;
|
|
1999
|
+
/** Persistence store (default `globalThis.localStorage`, if present). */
|
|
2000
|
+
storage?: SidebarStorage;
|
|
479
2001
|
}
|
|
480
2002
|
/**
|
|
481
|
-
* The
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* the collapse is pure CSS (no wire). See `docs/23-app-layouts.md` §3.3.
|
|
2003
|
+
* The reusable sidebar-semantics layer for {@link CollapsiblePanel}s: toggle
|
|
2004
|
+
* delegation with focus restore, focus-into on open, an optional compact overlay
|
|
2005
|
+
* (backdrop + Escape + focus trap) driven by {@link deviceClass}, and an optional
|
|
2006
|
+
* persistence hook. The app owns each `collapsed` signal and the layout; this wire
|
|
2007
|
+
* owns the interaction. Returns a disposer. See `ui/docs/collapsible-panel.md` and `docs/23-app-layouts.md`.
|
|
487
2008
|
*/
|
|
488
|
-
declare function
|
|
2009
|
+
declare function wireSidebar(root: HTMLElement, { panels, deviceClass, compactPresentation, exclusiveCompact, storage, }: WireSidebarOptions): () => void;
|
|
489
2010
|
|
|
490
|
-
export {
|
|
2011
|
+
export { type SidebarStorage, type WireSidebarOptions, type WireSidebarPanel, wireSidebar };
|
|
491
2012
|
```
|
|
492
2013
|
|
|
493
2014
|
## `@kerfjs/ui/tab-scaffold`
|
|
494
2015
|
|
|
495
2016
|
```ts
|
|
496
2017
|
import { SafeHtml } from 'kerfjs';
|
|
2018
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
497
2019
|
|
|
498
|
-
interface
|
|
499
|
-
id:
|
|
2020
|
+
interface TabScaffoldTabBase<Id extends string> {
|
|
2021
|
+
id: Id;
|
|
500
2022
|
label: string;
|
|
501
2023
|
/** Decorative icon shown above the label in the bottom bar. */
|
|
502
2024
|
icon?: SafeHtml;
|
|
503
2025
|
/** The tab's content — typically a `NavStack` so each tab keeps its own stack. */
|
|
504
|
-
content:
|
|
2026
|
+
content: KerfUiContent;
|
|
2027
|
+
}
|
|
2028
|
+
/** A tab with an optional count or short-status badge. */
|
|
2029
|
+
interface TabScaffoldTabCountBadge {
|
|
2030
|
+
/**
|
|
2031
|
+
* Optional count or short status shown as a solid danger `Badge` at the
|
|
2032
|
+
* top-trailing corner of the tab icon (the iOS tab-bar badge). Omitted, `''`,
|
|
2033
|
+
* or non-finite numbers render no badge. The visual badge is `aria-hidden`;
|
|
2034
|
+
* its meaning reaches assistive technology through `badgeLabel`.
|
|
2035
|
+
*
|
|
2036
|
+
* Pass `true` instead for the text-free dot (new content without a count).
|
|
2037
|
+
*/
|
|
2038
|
+
badge?: string | number;
|
|
2039
|
+
/**
|
|
2040
|
+
* Localized phrase folded into the tab's accessible name as
|
|
2041
|
+
* `"<label>, <badgeLabel>"` (for example `"3 unread"` → `"Inbox, 3 unread"`).
|
|
2042
|
+
* Defaults to the badge text itself. Ignored when no badge renders.
|
|
2043
|
+
*/
|
|
2044
|
+
badgeLabel?: string;
|
|
2045
|
+
}
|
|
2046
|
+
/** A tab with the text-free dot badge (new content without a count). */
|
|
2047
|
+
interface TabScaffoldTabDotBadge {
|
|
2048
|
+
/**
|
|
2049
|
+
* `true` shows a solid danger dot `Badge` at the top-trailing corner of the
|
|
2050
|
+
* tab icon — the iOS tab-bar dot for new content without a count.
|
|
2051
|
+
*/
|
|
2052
|
+
badge: true;
|
|
2053
|
+
/**
|
|
2054
|
+
* Required localized phrase folded into the tab's accessible name as
|
|
2055
|
+
* `"<label>, <badgeLabel>"` (for example `"New activity"` →
|
|
2056
|
+
* `"Feed, New activity"`). A dot has no text, so this is its only meaning.
|
|
2057
|
+
*/
|
|
2058
|
+
badgeLabel: string;
|
|
505
2059
|
}
|
|
506
|
-
|
|
2060
|
+
/** One bottom-bar destination: its label, optional icon and badge, and content. */
|
|
2061
|
+
type TabScaffoldTab<Id extends string = string> = TabScaffoldTabBase<Id> & (TabScaffoldTabCountBadge | TabScaffoldTabDotBadge);
|
|
2062
|
+
interface TabScaffoldProps<Id extends string = string> {
|
|
507
2063
|
id: string;
|
|
508
2064
|
/** Accessible name for the tab bar. */
|
|
509
2065
|
label: string;
|
|
510
|
-
tabs: TabScaffoldTab[];
|
|
2066
|
+
tabs: readonly TabScaffoldTab<Id>[];
|
|
511
2067
|
/** The controlled active tab id (the app owns selection). */
|
|
512
|
-
active:
|
|
2068
|
+
active: NoInfer<Id>;
|
|
2069
|
+
/**
|
|
2070
|
+
* The line over the tab bar, where it meets the active scene. `scroll`
|
|
2071
|
+
* (default) shows it only while more of the scene's content lies below —
|
|
2072
|
+
* never at the scroll end or when the content fits — once
|
|
2073
|
+
* `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is wired above
|
|
2074
|
+
* the scaffold; unwired, it does not show. `always` shows it without the
|
|
2075
|
+
* wiring; `none` never, even when wired. The line is the bar's own 1px top
|
|
2076
|
+
* border, so no state moves the bar or a tab.
|
|
2077
|
+
*/
|
|
2078
|
+
chromeDividers?: 'scroll' | 'always' | 'none';
|
|
513
2079
|
className?: string;
|
|
2080
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2081
|
+
slot?: string;
|
|
514
2082
|
}
|
|
515
2083
|
/**
|
|
516
2084
|
* A mobile-first, iOS-like bottom tab scaffold: a bottom tab bar that switches
|
|
@@ -520,7 +2088,7 @@ interface TabScaffoldProps {
|
|
|
520
2088
|
* On larger classes, promote the tabs to a `Workbench` rail or sidebar instead of
|
|
521
2089
|
* a bottom bar. See `docs/23-app-layouts.md` §3.4.
|
|
522
2090
|
*/
|
|
523
|
-
declare function TabScaffold({ id, label, tabs, active, className }: TabScaffoldProps): SafeHtml;
|
|
2091
|
+
declare function TabScaffold<Id extends string>({ id, label, tabs, active, chromeDividers, className, slot, }: TabScaffoldProps<Id>): SafeHtml;
|
|
524
2092
|
|
|
525
2093
|
export { TabScaffold, type TabScaffoldProps, type TabScaffoldTab };
|
|
526
2094
|
```
|
|
@@ -545,9 +2113,17 @@ export { type WireTabScaffoldOptions, wireTabScaffold };
|
|
|
545
2113
|
|
|
546
2114
|
```ts
|
|
547
2115
|
import { SafeHtml } from 'kerfjs';
|
|
2116
|
+
import { CssLength } from './css-values.js';
|
|
2117
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
548
2118
|
|
|
549
2119
|
type ResizableRegionAxis = 'horizontal' | 'vertical';
|
|
550
2120
|
type ResizableRegionEdge = 'start' | 'end';
|
|
2121
|
+
type ResizableRegionSeparator = 'auto' | 'hidden';
|
|
2122
|
+
type ResizableRegionCollapseMotion = 'none' | 'slide' | 'fade-slide';
|
|
2123
|
+
type ResizableRegionContentOverflow = 'clip' | 'auto' | 'visible';
|
|
2124
|
+
type ResizableRegionPresentation = 'inline' | 'overlay' | 'hidden';
|
|
2125
|
+
type ResizableRegionRestorePosition = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
|
|
2126
|
+
type ResizableRegionResponsiveFillAt = 'compact' | 'narrow';
|
|
551
2127
|
interface ResizableRegionProps {
|
|
552
2128
|
id: string;
|
|
553
2129
|
label: string;
|
|
@@ -556,17 +2132,38 @@ interface ResizableRegionProps {
|
|
|
556
2132
|
max: number;
|
|
557
2133
|
axis?: ResizableRegionAxis;
|
|
558
2134
|
edge?: ResizableRegionEdge;
|
|
2135
|
+
/** Snap the track to zero. The region renders `inert` and `aria-hidden`
|
|
2136
|
+
* while collapsed, so neither Tab nor assistive technology reaches it or
|
|
2137
|
+
* lands on an empty landmark; `restoreControl` renders outside the region. */
|
|
559
2138
|
collapsed?: boolean;
|
|
560
2139
|
transitioning?: boolean;
|
|
2140
|
+
/** Whether the separator line is painted. The resize hit target remains available. */
|
|
2141
|
+
separator?: ResizableRegionSeparator;
|
|
2142
|
+
/** Keep the track change instant while optionally sliding the fixed-size content. */
|
|
2143
|
+
collapseMotion?: ResizableRegionCollapseMotion;
|
|
2144
|
+
/** Use `visible` while an anchored popup must escape the content box; it raises the region to the popup layer. */
|
|
2145
|
+
contentOverflow?: ResizableRegionContentOverflow;
|
|
2146
|
+
/** Inline layout, an edge overlay, or a responsive replacement that removes the region. */
|
|
2147
|
+
presentation?: ResizableRegionPresentation;
|
|
2148
|
+
/** Always-available control rendered while collapsed, outside the clipped region. */
|
|
2149
|
+
restoreControl?: SafeHtml;
|
|
2150
|
+
/** Safe-area-aware corner of the region's container (not the viewport) for `restoreControl`. */
|
|
2151
|
+
restorePosition?: ResizableRegionRestorePosition;
|
|
2152
|
+
/** Position a restore control in its container corner or leave it in normal flow. */
|
|
2153
|
+
restorePlacement?: 'corner' | 'inline';
|
|
2154
|
+
/** Corner distance before the container's safe-area inset. */
|
|
2155
|
+
restoreInset?: CssLength;
|
|
2156
|
+
/** Fill the available inline track and hide the separator below a container breakpoint. */
|
|
2157
|
+
responsiveFillAt?: ResizableRegionResponsiveFillAt;
|
|
561
2158
|
/** Decorative dormant content for the separator handle. Must not contain interactive descendants. */
|
|
562
2159
|
handleIcon?: SafeHtml;
|
|
563
|
-
children:
|
|
2160
|
+
children: KerfUiContent;
|
|
564
2161
|
}
|
|
565
2162
|
declare const clampRegionSize: (size: number, min: number, max: number) => number;
|
|
566
2163
|
declare const resizeRegionFromPointer: (startSize: number, delta: number, edge: ResizableRegionEdge) => number;
|
|
567
|
-
declare function ResizableRegion({ id, label, size, min, max, axis, edge, collapsed, transitioning, handleIcon, children }: ResizableRegionProps): SafeHtml;
|
|
2164
|
+
declare function ResizableRegion({ id, label, size, min, max, axis, edge, collapsed, transitioning, separator, collapseMotion, contentOverflow, presentation, restoreControl, restorePosition, restorePlacement, restoreInset, responsiveFillAt, handleIcon, children, }: ResizableRegionProps): SafeHtml;
|
|
568
2165
|
|
|
569
|
-
export { ResizableRegion, type ResizableRegionAxis, type ResizableRegionEdge, type ResizableRegionProps, clampRegionSize, resizeRegionFromPointer };
|
|
2166
|
+
export { ResizableRegion, type ResizableRegionAxis, type ResizableRegionCollapseMotion, type ResizableRegionContentOverflow, type ResizableRegionEdge, type ResizableRegionPresentation, type ResizableRegionProps, type ResizableRegionResponsiveFillAt, type ResizableRegionRestorePosition, type ResizableRegionSeparator, clampRegionSize, resizeRegionFromPointer };
|
|
570
2167
|
```
|
|
571
2168
|
|
|
572
2169
|
## `@kerfjs/ui/wire-resizable-regions`
|
|
@@ -583,8 +2180,9 @@ interface WireResizableRegionsOptions {
|
|
|
583
2180
|
onPreview?: (change: ResizeCommit) => void;
|
|
584
2181
|
onCommit: (change: ResizeCommit) => void;
|
|
585
2182
|
}
|
|
2183
|
+
|
|
586
2184
|
/** Wire pointer and separator-keyboard behavior for every ResizableRegion below root. */
|
|
587
|
-
declare function wireResizableRegions(root: HTMLElement,
|
|
2185
|
+
declare function wireResizableRegions(root: HTMLElement, options: WireResizableRegionsOptions): () => void;
|
|
588
2186
|
|
|
589
2187
|
export { type ResizeCommit, type WireResizableRegionsOptions, wireResizableRegions };
|
|
590
2188
|
```
|
|
@@ -656,73 +2254,440 @@ declare function deviceClass(options?: DeviceClassOptions): ReadonlySignal<Devic
|
|
|
656
2254
|
export { DEFAULT_BREAKPOINTS, type DeviceBreakpoints, type DeviceClass, type DeviceClassOptions, type DeviceOrientation, type DeviceSize, type Viewport, classifyViewport, deviceClass };
|
|
657
2255
|
```
|
|
658
2256
|
|
|
659
|
-
## `@kerfjs/ui/
|
|
2257
|
+
## `@kerfjs/ui/catalog`
|
|
660
2258
|
|
|
661
2259
|
```ts
|
|
2260
|
+
import * as kerfjs from 'kerfjs';
|
|
662
2261
|
import { SafeHtml } from 'kerfjs';
|
|
2262
|
+
import { a as CatalogProps } from './types-BuHELdXR.js';
|
|
2263
|
+
export { b as CatalogBrand, c as CatalogEntry, d as CatalogRelated, C as CatalogResource, e as CatalogSecondaryGroup, f as CatalogSection, g as CatalogStageRootAttributes } from './types-BuHELdXR.js';
|
|
2264
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
2265
|
+
import './toolbar.js';
|
|
2266
|
+
import './pane.js';
|
|
2267
|
+
import './sides-BPSWde0A.js';
|
|
2268
|
+
import './workbench.js';
|
|
2269
|
+
import './list.js';
|
|
2270
|
+
import './css-values.js';
|
|
2271
|
+
import './flex-alignment-4ms8ZbV8.js';
|
|
2272
|
+
import './resizable-region.js';
|
|
2273
|
+
import './panel-toolbar-DqwtBxQL.js';
|
|
2274
|
+
import './lucide-icon.js';
|
|
2275
|
+
import 'lucide';
|
|
2276
|
+
|
|
2277
|
+
/**
|
|
2278
|
+
* Controlled, stateless component-catalog shell: a `Workbench` whose left rail
|
|
2279
|
+
* is the catalog navigation and whose work area is the active entry — its
|
|
2280
|
+
* toolbar, description, preview stage, and resource footer. The sidebar's
|
|
2281
|
+
* standard toggle moves into the entry toolbar while it is collapsed, and on
|
|
2282
|
+
* a small screen the sidebar overlays the stage like any Workbench rail.
|
|
2283
|
+
*/
|
|
2284
|
+
declare function Catalog({ id, brand, sections, active, content, collapsed, theme, headerActions, secondarySections, sidebarFooter, status, geometryOverlay, stageRootAttributes, selectAction, toggleSidebarAction, toggleThemeAction, toggleSecondaryAction, headerPlacement, footerPlacement, sidebar, mainToolbar, footerToolbar, className, slot, }: CatalogProps): kerfjs.SafeHtml;
|
|
2285
|
+
|
|
2286
|
+
/** How a specimen aligns its visible edge with its `ListHeader` label. */
|
|
2287
|
+
type CatalogExampleAlign = 'glyph' | 'inline-control' | 'none';
|
|
2288
|
+
interface CatalogExampleViewport {
|
|
2289
|
+
layout?: 'grid' | 'flex' | 'flex-column';
|
|
2290
|
+
width?: 'full' | 'compact' | 'medium' | 'wide' | 'text' | 'control';
|
|
2291
|
+
/** Fixed specimen height; `app` frames an application-sized recipe or layout.
|
|
2292
|
+
* A fixed height is definite, so a child that fills with `height: 100%`
|
|
2293
|
+
* (a horizontal `ResizableRegion`, say) spans the whole frame. */
|
|
2294
|
+
height?: 'short' | 'reduced' | 'medium' | 'tall' | 'app';
|
|
2295
|
+
/** A minimum the frame may grow past. It is not a definite height: a child
|
|
2296
|
+
* sized with `height: 100%` falls back to its content height, so use
|
|
2297
|
+
* `height` when the specimen must fill the frame. */
|
|
2298
|
+
minHeight?: 'short' | 'medium';
|
|
2299
|
+
frame?: 'solid' | 'dashed';
|
|
2300
|
+
surface?: 'default' | 'lowered';
|
|
2301
|
+
overflow?: 'hidden' | 'auto-x';
|
|
2302
|
+
responsive?: 'roomy-only';
|
|
2303
|
+
shadow?: boolean;
|
|
2304
|
+
/** Public component custom properties applied to the specimen viewport. */
|
|
2305
|
+
tokens?: Readonly<Record<`--${string}`, string>>;
|
|
2306
|
+
}
|
|
2307
|
+
type CatalogExampleRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
2308
|
+
'data-catalog-example'?: never;
|
|
2309
|
+
'data-catalog-example-stack'?: never;
|
|
2310
|
+
'data-catalog-example-label'?: never;
|
|
2311
|
+
'data-catalog-example-note'?: never;
|
|
2312
|
+
'data-align'?: never;
|
|
2313
|
+
}>;
|
|
2314
|
+
interface CatalogExampleProps {
|
|
2315
|
+
label?: string;
|
|
2316
|
+
note?: SafeHtml | string;
|
|
2317
|
+
align?: CatalogExampleAlign;
|
|
2318
|
+
/** Optional catalog-owned constraints for demonstrating layout components. */
|
|
2319
|
+
viewport?: CatalogExampleViewport;
|
|
2320
|
+
/** Replacement guidance shown when a roomy-only viewport is hidden. */
|
|
2321
|
+
compactFallback?: SafeHtml | string;
|
|
2322
|
+
rootAttributes?: CatalogExampleRootAttributes;
|
|
2323
|
+
className?: string;
|
|
2324
|
+
children?: KerfUiContent;
|
|
2325
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2326
|
+
slot?: string;
|
|
2327
|
+
}
|
|
2328
|
+
/** A labeled catalog specimen with optional explanatory text and alignment. */
|
|
2329
|
+
declare function CatalogExample({ label, note, align, viewport, compactFallback, rootAttributes, className, children, slot, }: CatalogExampleProps): SafeHtml;
|
|
2330
|
+
|
|
2331
|
+
type CatalogExampleStackRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
2332
|
+
'data-catalog-example'?: never;
|
|
2333
|
+
'data-catalog-example-stack'?: never;
|
|
2334
|
+
'data-catalog-example-label'?: never;
|
|
2335
|
+
'data-catalog-example-note'?: never;
|
|
2336
|
+
'data-align'?: never;
|
|
2337
|
+
}>;
|
|
2338
|
+
interface CatalogExampleStackProps {
|
|
2339
|
+
label?: string;
|
|
2340
|
+
rootAttributes?: CatalogExampleStackRootAttributes;
|
|
2341
|
+
className?: string;
|
|
2342
|
+
children?: KerfUiContent;
|
|
2343
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2344
|
+
slot?: string;
|
|
2345
|
+
}
|
|
2346
|
+
/** A vertically stacked group of catalog examples. */
|
|
2347
|
+
declare function CatalogExampleStack({ label, rootAttributes, className, children, slot, }: CatalogExampleStackProps): kerfjs.SafeHtml;
|
|
2348
|
+
|
|
2349
|
+
export { Catalog, CatalogExample, type CatalogExampleAlign, type CatalogExampleProps, CatalogExampleStack, type CatalogExampleStackProps, type CatalogExampleViewport, CatalogProps };
|
|
2350
|
+
```
|
|
2351
|
+
|
|
2352
|
+
## `@kerfjs/ui/catalog-resources`
|
|
2353
|
+
|
|
2354
|
+
```ts
|
|
2355
|
+
import { C as CatalogResource } from './types-BuHELdXR.js';
|
|
2356
|
+
import './semantic-content-BbzjvSu9.js';
|
|
2357
|
+
import 'kerfjs';
|
|
2358
|
+
import './toolbar.js';
|
|
2359
|
+
import './pane.js';
|
|
2360
|
+
import './sides-BPSWde0A.js';
|
|
2361
|
+
import './workbench.js';
|
|
2362
|
+
import './list.js';
|
|
2363
|
+
import './css-values.js';
|
|
2364
|
+
import './flex-alignment-4ms8ZbV8.js';
|
|
2365
|
+
import './resizable-region.js';
|
|
2366
|
+
import './panel-toolbar-DqwtBxQL.js';
|
|
2367
|
+
import './lucide-icon.js';
|
|
2368
|
+
import 'lucide';
|
|
2369
|
+
|
|
2370
|
+
/**
|
|
2371
|
+
* Standard resource labels for a Kerf catalog detail footer. Keep these labels
|
|
2372
|
+
* stable across catalogs so people and AI-generated integrations see the same
|
|
2373
|
+
* choices in the same vocabulary.
|
|
2374
|
+
*/
|
|
2375
|
+
type CatalogResourceKind = 'demoSource' | 'componentSource' | 'designTemplate' | 'guidance' | 'integrationGuidance';
|
|
2376
|
+
type CatalogGuidanceKind = 'guidance' | 'integrationGuidance';
|
|
2377
|
+
interface CatalogResourceTarget {
|
|
2378
|
+
href: string;
|
|
2379
|
+
/** Optional monospace detail, normally the repository-relative source path. */
|
|
2380
|
+
detail?: string;
|
|
2381
|
+
}
|
|
2382
|
+
interface CatalogResourcesInput {
|
|
2383
|
+
/** Required source for the runnable demonstration. */
|
|
2384
|
+
demoSource: CatalogResourceTarget;
|
|
2385
|
+
/** Source for the production component; omit for recipes and integrations. */
|
|
2386
|
+
componentSource?: CatalogResourceTarget;
|
|
2387
|
+
/** Optional design-tool template associated with the component. */
|
|
2388
|
+
designTemplate?: CatalogResourceTarget;
|
|
2389
|
+
/** Required UI or integration guidance. */
|
|
2390
|
+
guidance: CatalogResourceTarget;
|
|
2391
|
+
/** Use `integrationGuidance` when the component implementation is upstream. */
|
|
2392
|
+
guidanceKind?: CatalogGuidanceKind;
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* Build the standard catalog resource group in its canonical order: demo,
|
|
2396
|
+
* component, optional design template, then guidance.
|
|
2397
|
+
*/
|
|
2398
|
+
declare function catalogResources(input: CatalogResourcesInput): CatalogResource[];
|
|
2399
|
+
|
|
2400
|
+
export { type CatalogGuidanceKind, type CatalogResourceKind, type CatalogResourceTarget, type CatalogResourcesInput, catalogResources };
|
|
2401
|
+
```
|
|
2402
|
+
|
|
2403
|
+
## `@kerfjs/ui/wire-catalog`
|
|
2404
|
+
|
|
2405
|
+
```ts
|
|
2406
|
+
import { Signal } from 'kerfjs';
|
|
2407
|
+
|
|
2408
|
+
interface WireCatalogOptions {
|
|
2409
|
+
/** Invoked with the entry id when a sidebar item or a related-entry option is chosen. */
|
|
2410
|
+
onSelect: (id: string) => void;
|
|
2411
|
+
/** Invoked when the sidebar collapse/expand control is activated. */
|
|
2412
|
+
onToggleSidebar?: () => void;
|
|
2413
|
+
/** Invoked when the theme toggle is activated. */
|
|
2414
|
+
onToggleTheme?: () => void;
|
|
2415
|
+
/** Invoked when the secondary (ecosystem) group's disclosure toggle is activated. */
|
|
2416
|
+
onToggleSecondary?: () => void;
|
|
2417
|
+
/** When set, `?<urlParam>=<id>` is written on select via `history.replaceState`. */
|
|
2418
|
+
urlParam?: string;
|
|
2419
|
+
/**
|
|
2420
|
+
* Reveal the chosen sidebar row after selection. `true` uses desktop-safe
|
|
2421
|
+
* defaults; pass options to customize scroll alignment or the media guard.
|
|
2422
|
+
*/
|
|
2423
|
+
revealSelection?: boolean | CatalogRevealOptions;
|
|
2424
|
+
selectAction?: string;
|
|
2425
|
+
toggleSidebarAction?: string;
|
|
2426
|
+
toggleThemeAction?: string;
|
|
2427
|
+
toggleSecondaryAction?: string;
|
|
2428
|
+
/**
|
|
2429
|
+
* The sidebar's app-owned collapsed flag. With it, the catalog's Workbench
|
|
2430
|
+
* sidebar is wired like any Workbench rail: it becomes a transient overlay
|
|
2431
|
+
* on a small screen (collapsed as the breakpoint applies, closed on Escape
|
|
2432
|
+
* or a press outside, focus handed back), and choosing an entry from the
|
|
2433
|
+
* open overlay closes it.
|
|
2434
|
+
*/
|
|
2435
|
+
collapsed?: Signal<boolean>;
|
|
2436
|
+
/**
|
|
2437
|
+
* The app-owned sidebar width signal for a Catalog rendered with
|
|
2438
|
+
* `sidebar={{ resizable: true, size: sidebarSize.value }}`. Each committed
|
|
2439
|
+
* drag or keyboard resize is written to it.
|
|
2440
|
+
*/
|
|
2441
|
+
sidebarSize?: Signal<number>;
|
|
2442
|
+
/**
|
|
2443
|
+
* With `sidebarSize`, load and save the width under this storage key so the
|
|
2444
|
+
* catalog remembers the user's sidebar width.
|
|
2445
|
+
*/
|
|
2446
|
+
sidebarStorageKey?: string;
|
|
2447
|
+
/** The Catalog's `id`, when it is not the default `kui-catalog`. */
|
|
2448
|
+
id?: string;
|
|
2449
|
+
}
|
|
2450
|
+
interface CatalogRevealOptions {
|
|
2451
|
+
/** Scroll alignment within the sidebar. Default `'nearest'`. */
|
|
2452
|
+
block?: ScrollLogicalPosition;
|
|
2453
|
+
/** Cross-axis alignment. Default `'nearest'`. */
|
|
2454
|
+
inline?: ScrollLogicalPosition;
|
|
2455
|
+
/** Scroll behavior. Default `'auto'`. */
|
|
2456
|
+
behavior?: ScrollBehavior;
|
|
2457
|
+
/**
|
|
2458
|
+
* Only reveal when this media query matches. Defaults to the Catalog's
|
|
2459
|
+
* desktop layout; pass `false` to reveal at every viewport size.
|
|
2460
|
+
*/
|
|
2461
|
+
media?: string | false;
|
|
2462
|
+
}
|
|
2463
|
+
/**
|
|
2464
|
+
* Reveal one Catalog sidebar entry after the controlled render settles without
|
|
2465
|
+
* moving focus. Returns a cancellation function for rapid selection changes.
|
|
2466
|
+
*/
|
|
2467
|
+
declare function revealCatalogEntry(root: HTMLElement, id: string, { block, inline, behavior, media, }?: CatalogRevealOptions): () => void;
|
|
2468
|
+
/**
|
|
2469
|
+
* Keep a Catalog's opt-in geometry overlay synchronized with its preview.
|
|
2470
|
+
* Specimens receive computed border highlights (or a dashed bound when they
|
|
2471
|
+
* have no border and are transparent), while positive computed margins use
|
|
2472
|
+
* devtools-style orange bands. CSS/stylesheet-only changes are observed too.
|
|
2473
|
+
* Returns a disposer.
|
|
2474
|
+
*/
|
|
2475
|
+
declare function wireCatalogGeometryOverlay(root: HTMLElement): () => void;
|
|
2476
|
+
/**
|
|
2477
|
+
* Wire a {@link Catalog}'s interactions with one delegated listener set: sidebar
|
|
2478
|
+
* item selection (and the related-entry popup menu), the sidebar collapse toggle, and
|
|
2479
|
+
* the theme toggle. The app owns the `active`/`collapsed`/`theme` signals and updates
|
|
2480
|
+
* them in the callbacks; optionally mirror the active id into the URL via `urlParam`.
|
|
2481
|
+
* It also wires the scroll dividers below root (`wireScrollDividers`), so the
|
|
2482
|
+
* catalog's panes and every example in it show their chrome dividers only
|
|
2483
|
+
* while scrolled. Returns a disposer.
|
|
2484
|
+
*/
|
|
2485
|
+
declare function wireCatalog(root: HTMLElement, { onSelect, onToggleSidebar, onToggleTheme, onToggleSecondary, urlParam, revealSelection, selectAction, toggleSidebarAction, toggleThemeAction, toggleSecondaryAction, collapsed, sidebarSize, sidebarStorageKey, id: catalogId, }: WireCatalogOptions): () => void;
|
|
2486
|
+
|
|
2487
|
+
export { type CatalogRevealOptions, type WireCatalogOptions, revealCatalogEntry, wireCatalog, wireCatalogGeometryOverlay };
|
|
2488
|
+
```
|
|
2489
|
+
|
|
2490
|
+
## `@kerfjs/ui/segmented-control`
|
|
2491
|
+
|
|
2492
|
+
```ts
|
|
2493
|
+
import * as kerfjs from 'kerfjs';
|
|
2494
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
663
2495
|
|
|
664
2496
|
type SegmentedControlAppearance = 'filled' | 'outlined' | 'toolbar';
|
|
665
2497
|
type SegmentedControlShape = 'rounded' | 'pill';
|
|
666
2498
|
type SegmentedControlSize = 'small' | 'default';
|
|
667
2499
|
type SegmentedControlLayout = 'content' | 'equal';
|
|
668
|
-
interface SegmentedControlChoice {
|
|
669
|
-
value:
|
|
2500
|
+
interface SegmentedControlChoice<Value extends string = string> {
|
|
2501
|
+
value: Value;
|
|
670
2502
|
label: string;
|
|
671
|
-
content?:
|
|
2503
|
+
content?: KerfUiContent;
|
|
672
2504
|
title?: string;
|
|
673
2505
|
disabled?: boolean;
|
|
674
2506
|
}
|
|
675
|
-
interface SegmentedControlProps {
|
|
2507
|
+
interface SegmentedControlProps<Value extends string = string> {
|
|
676
2508
|
id: string;
|
|
677
2509
|
label: string;
|
|
678
|
-
value:
|
|
679
|
-
choices: readonly SegmentedControlChoice[];
|
|
2510
|
+
value: NoInfer<Value>;
|
|
2511
|
+
choices: readonly SegmentedControlChoice<Value>[];
|
|
680
2512
|
action?: string;
|
|
681
2513
|
appearance?: SegmentedControlAppearance;
|
|
682
2514
|
shape?: SegmentedControlShape;
|
|
683
2515
|
size?: SegmentedControlSize;
|
|
684
2516
|
layout?: SegmentedControlLayout;
|
|
685
2517
|
className?: string;
|
|
2518
|
+
/** Render as a loading placeholder: every choice keeps its live label or icon, none is selected, and every segment is disabled. */
|
|
2519
|
+
placeholder?: boolean;
|
|
2520
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2521
|
+
slot?: string;
|
|
686
2522
|
}
|
|
687
|
-
declare function SegmentedControl({ id, label, value, choices, action, appearance, shape, size, layout, className, }: SegmentedControlProps): SafeHtml;
|
|
2523
|
+
declare function SegmentedControl<Value extends string>({ id, label, value, choices, action, appearance, shape, size, layout, className, placeholder, slot, }: SegmentedControlProps<Value>): kerfjs.SafeHtml;
|
|
688
2524
|
|
|
689
2525
|
export { SegmentedControl, type SegmentedControlAppearance, type SegmentedControlChoice, type SegmentedControlLayout, type SegmentedControlProps, type SegmentedControlShape, type SegmentedControlSize };
|
|
690
2526
|
```
|
|
691
2527
|
|
|
2528
|
+
## `@kerfjs/ui/select`
|
|
2529
|
+
|
|
2530
|
+
```ts
|
|
2531
|
+
import { SafeHtml } from 'kerfjs';
|
|
2532
|
+
import { CssForegroundColor } from './css-values.js';
|
|
2533
|
+
import { LucideNode } from './lucide-icon.js';
|
|
2534
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
2535
|
+
import 'lucide';
|
|
2536
|
+
|
|
2537
|
+
interface SelectChoice<Value extends string = string> {
|
|
2538
|
+
value: Value;
|
|
2539
|
+
label: string;
|
|
2540
|
+
icon?: LucideNode;
|
|
2541
|
+
iconName?: string;
|
|
2542
|
+
/**
|
|
2543
|
+
* Foreground color for the optional icon: a semantic foreground token such
|
|
2544
|
+
* as `uiColor('success-on-quiet')`, or an application-owned
|
|
2545
|
+
* `foregroundColorVar('--app-icon-color')`. Fill tokens such as
|
|
2546
|
+
* `uiColor('success-fill-quiet')` are pale background tints and do not
|
|
2547
|
+
* type-check.
|
|
2548
|
+
*/
|
|
2549
|
+
color?: CssForegroundColor;
|
|
2550
|
+
group?: string;
|
|
2551
|
+
/**
|
|
2552
|
+
* Draw a divider between this choice and the previous choice in the same
|
|
2553
|
+
* list. A group boundary is already a separator, so the first choice of a
|
|
2554
|
+
* group (or of the whole menu) never draws a second one.
|
|
2555
|
+
*/
|
|
2556
|
+
separatorBefore?: boolean;
|
|
2557
|
+
}
|
|
2558
|
+
type SelectAccessibleName = {
|
|
2559
|
+
label: string;
|
|
2560
|
+
ariaLabel?: string;
|
|
2561
|
+
} | {
|
|
2562
|
+
label?: never;
|
|
2563
|
+
ariaLabel: string;
|
|
2564
|
+
};
|
|
2565
|
+
type SelectPresentation = 'form' | 'toolbar-borderless' | 'navigation';
|
|
2566
|
+
type SelectSize = 'default' | 'compact';
|
|
2567
|
+
type SelectSelectedPresentation = 'label' | 'icon-only';
|
|
2568
|
+
type SelectFocusRingOwner = 'select' | 'group';
|
|
2569
|
+
type SelectTriggerWidth = 'fit-content' | 'max-content' | 'fill';
|
|
2570
|
+
interface SelectBaseProps<Value extends string = string> {
|
|
2571
|
+
name: string;
|
|
2572
|
+
choices: readonly SelectChoice<Value>[];
|
|
2573
|
+
className?: string;
|
|
2574
|
+
/** Empty-value hint text shown in the closed control (the native select placeholder). */
|
|
2575
|
+
placeholderText?: string;
|
|
2576
|
+
/** Supporting text shown below the control and associated with its combobox. */
|
|
2577
|
+
hint?: string;
|
|
2578
|
+
disabled?: boolean;
|
|
2579
|
+
fitMenu?: boolean;
|
|
2580
|
+
/** Render as an unanimated loading skeleton: the label above a static, empty control box. */
|
|
2581
|
+
placeholder?: boolean;
|
|
2582
|
+
/** Form (default), borderless toolbar, or intrinsic navigation chrome. */
|
|
2583
|
+
presentation?: SelectPresentation;
|
|
2584
|
+
size?: SelectSize;
|
|
2585
|
+
/** Closed trigger width; omit to keep the presentation's default. */
|
|
2586
|
+
triggerWidth?: SelectTriggerWidth;
|
|
2587
|
+
/** Let an enclosing ToolbarControlGroup paint the composed focus ring. */
|
|
2588
|
+
focusRingOwner?: SelectFocusRingOwner;
|
|
2589
|
+
/** Maximum closed-control label width in CSS pixels before ellipsis. */
|
|
2590
|
+
labelMaxWidth?: number;
|
|
2591
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2592
|
+
slot?: string;
|
|
2593
|
+
}
|
|
2594
|
+
/** One chosen value (the default). */
|
|
2595
|
+
interface SelectSingleValueProps<Value extends string = string> {
|
|
2596
|
+
multiple?: false;
|
|
2597
|
+
value: NoInfer<Value>;
|
|
2598
|
+
renderSelected?: (choice: SelectChoice<Value>) => SafeHtml;
|
|
2599
|
+
/** Show only the selected choice icon while retaining the Select's accessible name. */
|
|
2600
|
+
selectedPresentation?: SelectSelectedPresentation;
|
|
2601
|
+
triggerIcon?: never;
|
|
2602
|
+
}
|
|
2603
|
+
/**
|
|
2604
|
+
* Any number of chosen values. The popup stays open while the person toggles
|
|
2605
|
+
* choices and closes on an outside click, Escape, or focus leaving; the closed
|
|
2606
|
+
* control summarizes the chosen labels in choice order.
|
|
2607
|
+
*/
|
|
2608
|
+
interface SelectMultipleLabelProps<Value extends string = string> {
|
|
2609
|
+
multiple: true;
|
|
2610
|
+
value: readonly NoInfer<Value>[];
|
|
2611
|
+
renderSelected?: never;
|
|
2612
|
+
selectedPresentation?: 'label';
|
|
2613
|
+
triggerIcon?: never;
|
|
2614
|
+
}
|
|
2615
|
+
/**
|
|
2616
|
+
* A multiple Select drawn as an icon-only toolbar trigger, such as a
|
|
2617
|
+
* "Filter by label" funnel. No single choice is selected, so the trigger shows
|
|
2618
|
+
* a fixed `triggerIcon` naming the menu's purpose; while any choice is chosen
|
|
2619
|
+
* a count badge sits beside it, and the combobox's accessible name ends with
|
|
2620
|
+
* the chosen labels in choice order.
|
|
2621
|
+
*/
|
|
2622
|
+
interface SelectMultipleIconProps<Value extends string = string> {
|
|
2623
|
+
multiple: true;
|
|
2624
|
+
value: readonly NoInfer<Value>[];
|
|
2625
|
+
renderSelected?: never;
|
|
2626
|
+
selectedPresentation: 'icon-only';
|
|
2627
|
+
/**
|
|
2628
|
+
* The trigger's fixed icon, typically a `LucideIcon` naming the menu's
|
|
2629
|
+
* purpose (a funnel for a filter), independent of the selection.
|
|
2630
|
+
*/
|
|
2631
|
+
triggerIcon: KerfUiContent;
|
|
2632
|
+
}
|
|
2633
|
+
type SelectMultipleValueProps<Value extends string = string> = SelectMultipleLabelProps<Value> | SelectMultipleIconProps<Value>;
|
|
2634
|
+
type SelectProps<Value extends string = string> = SelectBaseProps<Value> & SelectAccessibleName & (SelectSingleValueProps<Value> | SelectMultipleValueProps<Value>);
|
|
2635
|
+
declare function Select<Value extends string>(props: SelectProps<Value>): SafeHtml;
|
|
2636
|
+
|
|
2637
|
+
export { Select, type SelectChoice, type SelectFocusRingOwner, type SelectMultipleIconProps, type SelectMultipleLabelProps, type SelectMultipleValueProps, type SelectPresentation, type SelectProps, type SelectSelectedPresentation, type SelectSingleValueProps, type SelectSize, type SelectTriggerWidth };
|
|
2638
|
+
```
|
|
2639
|
+
|
|
692
2640
|
## `@kerfjs/ui/state-banner`
|
|
693
2641
|
|
|
694
2642
|
```ts
|
|
695
2643
|
import { SafeHtml } from 'kerfjs';
|
|
2644
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
696
2645
|
|
|
697
|
-
type StateBannerTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
2646
|
+
type StateBannerTone = 'neutral' | 'info' | 'pop' | 'success' | 'warning' | 'danger';
|
|
2647
|
+
type StateBannerUrgency = 'status' | 'alert';
|
|
2648
|
+
type StateBannerCopyLayout = 'inline' | 'stacked';
|
|
2649
|
+
type StateBannerActionPlacement = 'trailing' | 'below';
|
|
698
2650
|
interface StateBannerProps {
|
|
699
2651
|
title: string;
|
|
700
2652
|
detail?: string;
|
|
2653
|
+
/** Optional compact status or count shown beside the title. */
|
|
2654
|
+
badge?: string;
|
|
701
2655
|
icon?: SafeHtml;
|
|
702
|
-
action?:
|
|
2656
|
+
action?: KerfUiContent;
|
|
703
2657
|
tone?: StateBannerTone;
|
|
704
|
-
urgency?:
|
|
2658
|
+
urgency?: StateBannerUrgency;
|
|
2659
|
+
/** Keep the detail beside the title, or give it its own line. */
|
|
2660
|
+
copyLayout?: StateBannerCopyLayout;
|
|
2661
|
+
/** Place the action beside the copy or on a separate trailing row. */
|
|
2662
|
+
actionPlacement?: StateBannerActionPlacement;
|
|
705
2663
|
className?: string;
|
|
2664
|
+
/** Render the title, badge, and detail as unanimated loading skeletons, keeping the icon and tone. The detail line appears only when `detail` is set, as in the live banner. */
|
|
2665
|
+
placeholder?: boolean;
|
|
2666
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2667
|
+
slot?: string;
|
|
706
2668
|
}
|
|
707
|
-
declare function StateBanner({ title, detail, icon, action, tone, urgency, className }: StateBannerProps): SafeHtml;
|
|
2669
|
+
declare function StateBanner({ title, detail, badge, icon, action, tone, urgency, copyLayout, actionPlacement, className, placeholder, slot, }: StateBannerProps): SafeHtml;
|
|
708
2670
|
|
|
709
|
-
export { StateBanner, type StateBannerProps, type StateBannerTone };
|
|
2671
|
+
export { StateBanner, type StateBannerActionPlacement, type StateBannerCopyLayout, type StateBannerProps, type StateBannerTone, type StateBannerUrgency };
|
|
710
2672
|
```
|
|
711
2673
|
|
|
712
2674
|
## `@kerfjs/ui/empty-state`
|
|
713
2675
|
|
|
714
2676
|
```ts
|
|
715
2677
|
import { SafeHtml } from 'kerfjs';
|
|
2678
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
716
2679
|
|
|
717
2680
|
interface EmptyStateProps {
|
|
718
2681
|
title: string;
|
|
719
2682
|
detail?: string;
|
|
720
2683
|
icon?: SafeHtml;
|
|
721
|
-
action?:
|
|
2684
|
+
action?: KerfUiContent;
|
|
722
2685
|
busy?: boolean;
|
|
723
2686
|
className?: string;
|
|
2687
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2688
|
+
slot?: string;
|
|
724
2689
|
}
|
|
725
|
-
declare function EmptyState({ title, detail, icon, action, busy, className }: EmptyStateProps): SafeHtml;
|
|
2690
|
+
declare function EmptyState({ title, detail, icon, action, busy, className, slot, }: EmptyStateProps): SafeHtml;
|
|
726
2691
|
|
|
727
2692
|
export { EmptyState, type EmptyStateProps };
|
|
728
2693
|
```
|
|
@@ -735,70 +2700,142 @@ import * as kerfjs from 'kerfjs';
|
|
|
735
2700
|
interface LoadingSpinnerProps {
|
|
736
2701
|
className?: string;
|
|
737
2702
|
label?: string;
|
|
2703
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2704
|
+
slot?: string;
|
|
738
2705
|
}
|
|
739
2706
|
/** Stable viewBox-centered progress ring based on svg-spinners' MIT-licensed 180-ring. */
|
|
740
|
-
declare function LoadingSpinner({ className, label }: LoadingSpinnerProps): kerfjs.SafeHtml;
|
|
2707
|
+
declare function LoadingSpinner({ className, label, slot, }: LoadingSpinnerProps): kerfjs.SafeHtml;
|
|
741
2708
|
|
|
742
2709
|
export { LoadingSpinner, type LoadingSpinnerProps };
|
|
743
2710
|
```
|
|
744
2711
|
|
|
745
|
-
## `@kerfjs/ui/
|
|
2712
|
+
## `@kerfjs/ui/skeleton`
|
|
746
2713
|
|
|
747
2714
|
```ts
|
|
748
|
-
import
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
collapsible?: boolean;
|
|
767
|
-
/** Keep an empty collapsible field open while the application owns focus. */
|
|
768
|
-
expanded?: boolean;
|
|
769
|
-
expandAction?: string;
|
|
770
|
-
expandLabel?: string;
|
|
771
|
-
leading?: SafeHtml;
|
|
772
|
-
trailing?: SafeHtml;
|
|
773
|
-
editAction?: string;
|
|
774
|
-
removeAction?: string;
|
|
775
|
-
clearAction?: string;
|
|
776
|
-
clearLabel?: string;
|
|
2715
|
+
import * as kerfjs from 'kerfjs';
|
|
2716
|
+
import { CssSize, CssLength } from './css-values.js';
|
|
2717
|
+
|
|
2718
|
+
interface SkeletonProps {
|
|
2719
|
+
/** Typed width or intrinsic sizing keyword. Defaults to filling its slot. */
|
|
2720
|
+
width?: CssSize;
|
|
2721
|
+
/** Typed height or intrinsic sizing keyword. Defaults to a single text line. */
|
|
2722
|
+
height?: CssSize;
|
|
2723
|
+
/** Typed corner-radius override. Defaults to the small radius token. */
|
|
2724
|
+
radius?: CssLength;
|
|
2725
|
+
/** Render this many stacked lines (the last one shorter), for multi-line text. */
|
|
2726
|
+
lines?: number;
|
|
2727
|
+
/** Lay the block out as `display: block` instead of the default
|
|
2728
|
+
* `inline-block`, so it takes no text line of its own: no baseline gap
|
|
2729
|
+
* below it, and it centers like an icon in a slot. Defaults to `false`. */
|
|
2730
|
+
block?: boolean;
|
|
2731
|
+
/** Accessible label. Omit to keep the block decorative (`aria-hidden`). */
|
|
2732
|
+
label?: string;
|
|
777
2733
|
className?: string;
|
|
778
|
-
|
|
2734
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2735
|
+
slot?: string;
|
|
779
2736
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
2737
|
+
/**
|
|
2738
|
+
* A subtle, deliberately **unanimated** loading placeholder block. Use it for a
|
|
2739
|
+
* value slot whose content is not yet known, on its own or via a component's
|
|
2740
|
+
* `placeholder` prop. Decorative by default (`aria-hidden`); pass `label` to
|
|
2741
|
+
* announce it. Sizes to its slot unless `width`/`height` are given.
|
|
2742
|
+
*/
|
|
2743
|
+
declare function Skeleton({ width, height, radius, lines, block, label, className, slot, }: SkeletonProps): kerfjs.SafeHtml;
|
|
2744
|
+
|
|
2745
|
+
export { Skeleton, type SkeletonProps };
|
|
2746
|
+
```
|
|
2747
|
+
|
|
2748
|
+
## `@kerfjs/ui/sunken-panel`
|
|
2749
|
+
|
|
2750
|
+
```ts
|
|
2751
|
+
import * as kerfjs from 'kerfjs';
|
|
2752
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
2753
|
+
|
|
2754
|
+
type SunkenPanelShape = 'rounded' | 'square';
|
|
2755
|
+
interface SunkenPanelProps {
|
|
2756
|
+
children?: KerfUiContent;
|
|
2757
|
+
/** Optional accessible landmark name for a distinct application region. */
|
|
2758
|
+
ariaLabel?: string;
|
|
2759
|
+
/** Corner shape: a rounded rectangle (default) or square corners. */
|
|
2760
|
+
shape?: SunkenPanelShape;
|
|
2761
|
+
className?: string;
|
|
2762
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2763
|
+
slot?: string;
|
|
783
2764
|
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
2765
|
+
/**
|
|
2766
|
+
* A lowered application surface with one compact inset and a vertical content
|
|
2767
|
+
* stack. The panel owns its background and padding; children own their own
|
|
2768
|
+
* borders and internal geometry.
|
|
2769
|
+
*/
|
|
2770
|
+
declare function SunkenPanel({ children, ariaLabel, shape, className, slot, }: SunkenPanelProps): kerfjs.SafeHtml;
|
|
2771
|
+
|
|
2772
|
+
export { SunkenPanel, type SunkenPanelProps, type SunkenPanelShape };
|
|
2773
|
+
```
|
|
789
2774
|
|
|
790
|
-
|
|
2775
|
+
## `@kerfjs/ui/token-search-field`
|
|
2776
|
+
|
|
2777
|
+
```ts
|
|
2778
|
+
import 'kerfjs';
|
|
2779
|
+
import './semantic-content-BbzjvSu9.js';
|
|
2780
|
+
export { T as TokenSearchEditorAttributes, a as TokenSearchField, b as TokenSearchFieldProps, c as TokenSearchFieldValue, j as TokenSearchToken, p as placeTokenSearchCaret, r as readTokenSearchField } from './token-search-field-CCke1yvQ.js';
|
|
791
2781
|
```
|
|
792
2782
|
|
|
793
2783
|
## `@kerfjs/ui/wire-token-search-fields`
|
|
794
2784
|
|
|
795
2785
|
```ts
|
|
796
2786
|
import { Signal } from 'kerfjs';
|
|
2787
|
+
import { d as TokenSearchModel } from './token-search-field-CCke1yvQ.js';
|
|
2788
|
+
import './semantic-content-BbzjvSu9.js';
|
|
797
2789
|
|
|
798
2790
|
interface TokenSearchSubmit {
|
|
799
2791
|
id: string;
|
|
800
2792
|
editor: HTMLElement;
|
|
801
2793
|
}
|
|
2794
|
+
/** Reported to {@link WireTokenSearchFieldsOptions.onEdit} on every editor input. */
|
|
2795
|
+
interface TokenSearchEdit extends TokenSearchSubmit {
|
|
2796
|
+
/**
|
|
2797
|
+
* The `InputEvent` that mutated the editor — read `event.inputType` / `event.data`
|
|
2798
|
+
* to gate commit behavior (e.g. only parse a chip on whitespace-terminated input)
|
|
2799
|
+
* without keeping a separate `input` listener.
|
|
2800
|
+
*/
|
|
2801
|
+
event: InputEvent;
|
|
2802
|
+
}
|
|
2803
|
+
/** Reported when adjacent-token keyboard deletion asks the app to drop a chip. */
|
|
2804
|
+
interface TokenSearchTokenRemoval {
|
|
2805
|
+
id: string;
|
|
2806
|
+
/** The `data-token-value` of the token the app should remove from its state. */
|
|
2807
|
+
value: string;
|
|
2808
|
+
editor: HTMLElement;
|
|
2809
|
+
/** `'backward'` = the token before the caret (Backspace); `'forward'` = after (Delete). */
|
|
2810
|
+
direction: 'backward' | 'forward';
|
|
2811
|
+
}
|
|
2812
|
+
/**
|
|
2813
|
+
* Opt-in keyboard behavior for the atomic token chips. Off unless `keyboard` is
|
|
2814
|
+
* set; each piece defaults on once opted in. The helper never mutates app state:
|
|
2815
|
+
* a removal is reported through {@link TokenSearchKeyboardOptions.onRemoveToken}
|
|
2816
|
+
* for the caller to apply, while caret movement past a chip is a pure ephemeral
|
|
2817
|
+
* mechanic the helper performs itself.
|
|
2818
|
+
*/
|
|
2819
|
+
interface TokenSearchKeyboardBaseOptions {
|
|
2820
|
+
/**
|
|
2821
|
+
* From a collapsed caret with no selection, Backspace removes the token
|
|
2822
|
+
* immediately before it and Delete the token immediately after — reported via
|
|
2823
|
+
* `onRemoveToken` — instead of deleting a character. Default: true.
|
|
2824
|
+
*/
|
|
2825
|
+
/**
|
|
2826
|
+
* ArrowRight moves the caret past a trailing atomic token so text typed next
|
|
2827
|
+
* lands after the chip. Default: true.
|
|
2828
|
+
*/
|
|
2829
|
+
moveCaretPastToken?: boolean;
|
|
2830
|
+
}
|
|
2831
|
+
type TokenSearchKeyboardOptions = TokenSearchKeyboardBaseOptions & ({
|
|
2832
|
+
removeAdjacentToken?: true;
|
|
2833
|
+
/** Apply the reported removal to your controlled state, then re-render. */
|
|
2834
|
+
onRemoveToken: (removal: TokenSearchTokenRemoval) => void;
|
|
2835
|
+
} | {
|
|
2836
|
+
removeAdjacentToken: false;
|
|
2837
|
+
onRemoveToken?: never;
|
|
2838
|
+
});
|
|
802
2839
|
/**
|
|
803
2840
|
* Managed collapsible behavior for the iconic TokenSearchField. Every piece is on
|
|
804
2841
|
* by default; disable a specific one to own it in the app. Provide `signals` to
|
|
@@ -811,15 +2848,30 @@ interface TokenSearchCollapsibleOptions {
|
|
|
811
2848
|
collapseOnEmptyBlur?: boolean;
|
|
812
2849
|
/** Collapse an empty field on Escape and restore focus to its trigger. Default: true. */
|
|
813
2850
|
collapseOnEscape?: boolean;
|
|
814
|
-
/** Focus the editor on expand and the trigger on Escape-collapse. Default: true. */
|
|
2851
|
+
/** Focus the editor on expand/controlled clear and the trigger on Escape-collapse. Default: true. */
|
|
815
2852
|
manageFocus?: boolean;
|
|
2853
|
+
/**
|
|
2854
|
+
* Keep an empty field expanded when focus moves to a caller-owned surface
|
|
2855
|
+
* rendered outside the field — a suggestions dropdown, date picker, or help
|
|
2856
|
+
* popover shown beside it. Return true for any focus target that must NOT
|
|
2857
|
+
* trigger collapse-on-empty-blur. An element carrying `data-token-search-keep-open`
|
|
2858
|
+
* (or any node inside one) is always exempt, so this predicate is only needed
|
|
2859
|
+
* for surfaces you cannot mark declaratively.
|
|
2860
|
+
*/
|
|
2861
|
+
keepOpenOn?: (target: Node | null) => boolean;
|
|
816
2862
|
/** App-owned `expanded` signals keyed by field id; adopted instead of helper-created. */
|
|
817
2863
|
signals?: Readonly<Record<string, Signal<boolean>>>;
|
|
818
2864
|
}
|
|
819
2865
|
interface WireTokenSearchFieldsOptions {
|
|
2866
|
+
/** Optional automatic grammar/suggestion models, keyed by TokenSearchField id. */
|
|
2867
|
+
models?: Readonly<Record<string, TokenSearchModel>>;
|
|
820
2868
|
onSubmit?: (submission: TokenSearchSubmit) => void;
|
|
2869
|
+
/** Fired on every editor `input`, after the browser mutates it, so a caller can drop its own `input` listener. */
|
|
2870
|
+
onEdit?: (edit: TokenSearchEdit) => void;
|
|
821
2871
|
/** Managed collapsible transient behavior. `true`/omitted = on with defaults; `false` = fully off. */
|
|
822
2872
|
collapsible?: boolean | TokenSearchCollapsibleOptions;
|
|
2873
|
+
/** Opt-in atomic-chip keyboard behavior (off by default). */
|
|
2874
|
+
keyboard?: false | TokenSearchKeyboardOptions;
|
|
823
2875
|
}
|
|
824
2876
|
/**
|
|
825
2877
|
* The value returned from {@link wireTokenSearchFields}: call it (or `dispose()`) to
|
|
@@ -843,9 +2895,9 @@ interface TokenSearchFieldsHandle {
|
|
|
843
2895
|
* expand/collapse/focus. Returns a {@link TokenSearchFieldsHandle} — a disposer that also
|
|
844
2896
|
* exposes the managed `expanded` state per field id.
|
|
845
2897
|
*/
|
|
846
|
-
declare function wireTokenSearchFields(root: HTMLElement, { onSubmit, collapsible }?: WireTokenSearchFieldsOptions): TokenSearchFieldsHandle;
|
|
2898
|
+
declare function wireTokenSearchFields(root: HTMLElement, { models, onSubmit, onEdit, collapsible, keyboard, }?: WireTokenSearchFieldsOptions): TokenSearchFieldsHandle;
|
|
847
2899
|
|
|
848
|
-
export { type TokenSearchCollapsibleOptions, type TokenSearchFieldsHandle, type TokenSearchSubmit, type WireTokenSearchFieldsOptions, wireTokenSearchFields };
|
|
2900
|
+
export { type TokenSearchCollapsibleOptions, type TokenSearchEdit, type TokenSearchFieldsHandle, type TokenSearchKeyboardOptions, type TokenSearchSubmit, type TokenSearchTokenRemoval, type WireTokenSearchFieldsOptions, wireTokenSearchFields };
|
|
849
2901
|
```
|
|
850
2902
|
|
|
851
2903
|
## `kerfjs/actions`
|
|
@@ -924,3 +2976,282 @@ declare function delegateActions<E extends Element = Element>(root: HTMLElement,
|
|
|
924
2976
|
|
|
925
2977
|
export { type ActionHandler, type DelegateActionsOptions, action, delegateActions };
|
|
926
2978
|
```
|
|
2979
|
+
|
|
2980
|
+
## `@kerfjs/ui/badge`
|
|
2981
|
+
|
|
2982
|
+
```ts
|
|
2983
|
+
import { SafeHtml } from 'kerfjs';
|
|
2984
|
+
|
|
2985
|
+
type BadgeTone = 'neutral' | 'brand' | 'pop' | 'success' | 'warning' | 'danger';
|
|
2986
|
+
type BadgeAppearance = 'quiet' | 'solid' | 'outline';
|
|
2987
|
+
type BadgeShape = 'pill' | 'rounded';
|
|
2988
|
+
/** Size of a text badge. A text-free dot is the separate `size: 'dot'` form. */
|
|
2989
|
+
type BadgeSize = 'compact' | 'default';
|
|
2990
|
+
interface BadgeCommonProps {
|
|
2991
|
+
tone?: BadgeTone;
|
|
2992
|
+
className?: string;
|
|
2993
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
2994
|
+
slot?: string;
|
|
2995
|
+
}
|
|
2996
|
+
/** A badge that shows a short status, count, or category as visible text. */
|
|
2997
|
+
interface BadgeTextProps extends BadgeCommonProps {
|
|
2998
|
+
children: SafeHtml | string | number;
|
|
2999
|
+
appearance?: BadgeAppearance;
|
|
3000
|
+
shape?: BadgeShape;
|
|
3001
|
+
size?: BadgeSize;
|
|
3002
|
+
/** Optional accessible name when the visible content is abbreviated. */
|
|
3003
|
+
label?: string;
|
|
3004
|
+
/** Hide a repeated visual badge from assistive technology. */
|
|
3005
|
+
ariaHidden?: boolean;
|
|
3006
|
+
}
|
|
3007
|
+
/** A labeled dot, announced as an image with its own accessible name. */
|
|
3008
|
+
interface BadgeDotLabeled {
|
|
3009
|
+
/** Accessible name for the dot, for example `"New activity"`. */
|
|
3010
|
+
label: string;
|
|
3011
|
+
ariaHidden?: false;
|
|
3012
|
+
}
|
|
3013
|
+
/** A decorative dot whose meaning the owning component already announces. */
|
|
3014
|
+
interface BadgeDotDecorative {
|
|
3015
|
+
label?: never;
|
|
3016
|
+
ariaHidden: true;
|
|
3017
|
+
}
|
|
3018
|
+
/**
|
|
3019
|
+
* A text-free status dot (the iOS "new content" dot): a small solid circle in
|
|
3020
|
+
* the badge's tone. It has no visible text, so it must either carry its own
|
|
3021
|
+
* accessible `label` (exposed as an image) or be `ariaHidden` because the
|
|
3022
|
+
* surrounding component already folds its meaning into an accessible name.
|
|
3023
|
+
*/
|
|
3024
|
+
type BadgeDotProps = BadgeCommonProps & {
|
|
3025
|
+
size: 'dot';
|
|
3026
|
+
children?: never;
|
|
3027
|
+
appearance?: never;
|
|
3028
|
+
shape?: never;
|
|
3029
|
+
} & (BadgeDotLabeled | BadgeDotDecorative);
|
|
3030
|
+
type BadgeProps = BadgeTextProps | BadgeDotProps;
|
|
3031
|
+
/** Compact, non-interactive metadata whose tone, emphasis, and shape are configured by props. */
|
|
3032
|
+
declare function Badge(props: BadgeProps): SafeHtml;
|
|
3033
|
+
|
|
3034
|
+
export { Badge, type BadgeAppearance, type BadgeDotProps, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeTextProps, type BadgeTone };
|
|
3035
|
+
```
|
|
3036
|
+
|
|
3037
|
+
## `@kerfjs/ui/lucide-icon`
|
|
3038
|
+
|
|
3039
|
+
```ts
|
|
3040
|
+
import * as kerfjs from 'kerfjs';
|
|
3041
|
+
import { IconNode } from 'lucide';
|
|
3042
|
+
|
|
3043
|
+
type LucideNode = IconNode;
|
|
3044
|
+
interface LucideIconProps {
|
|
3045
|
+
icon: LucideNode;
|
|
3046
|
+
name: string;
|
|
3047
|
+
className?: string;
|
|
3048
|
+
label?: string;
|
|
3049
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
3050
|
+
slot?: string;
|
|
3051
|
+
}
|
|
3052
|
+
/** Render a Lucide-compatible icon node without copying icon SVG strings. */
|
|
3053
|
+
declare function LucideIcon({ icon, name, className, label, slot, }: LucideIconProps): kerfjs.SafeHtml;
|
|
3054
|
+
|
|
3055
|
+
export { LucideIcon, type LucideIconProps, type LucideNode };
|
|
3056
|
+
```
|
|
3057
|
+
|
|
3058
|
+
## `@kerfjs/ui/surface-scaffold`
|
|
3059
|
+
|
|
3060
|
+
```ts
|
|
3061
|
+
import * as kerfjs from 'kerfjs';
|
|
3062
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
3063
|
+
|
|
3064
|
+
type DialogSurfaceSize = 'small' | 'medium' | 'large';
|
|
3065
|
+
type DialogSurfacePresentation = 'modal' | 'side-sheet' | 'fullscreen';
|
|
3066
|
+
type SurfaceInset = 'none' | 'compact' | 'comfortable';
|
|
3067
|
+
interface DialogSurfaceProps {
|
|
3068
|
+
children: KerfUiContent;
|
|
3069
|
+
size?: DialogSurfaceSize;
|
|
3070
|
+
presentation?: DialogSurfacePresentation;
|
|
3071
|
+
bodyInset?: SurfaceInset;
|
|
3072
|
+
footerInset?: SurfaceInset;
|
|
3073
|
+
className?: string;
|
|
3074
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
3075
|
+
slot?: string;
|
|
3076
|
+
}
|
|
3077
|
+
/** Configure recurring Web Awesome dialog geometry without consumer ::part() CSS. */
|
|
3078
|
+
declare function DialogSurface({ children, size, presentation, bodyInset, footerInset, className, slot, }: DialogSurfaceProps): kerfjs.SafeHtml;
|
|
3079
|
+
type PopupSurfaceInset = 'standard' | 'compact' | 'list-zero';
|
|
3080
|
+
interface PopupSurfaceProps {
|
|
3081
|
+
children: KerfUiContent;
|
|
3082
|
+
inset?: PopupSurfaceInset;
|
|
3083
|
+
className?: string;
|
|
3084
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
3085
|
+
slot?: string;
|
|
3086
|
+
}
|
|
3087
|
+
/** Configure recurring Web Awesome dropdown-menu geometry without consumer ::part() CSS. */
|
|
3088
|
+
declare function PopupSurface({ children, inset, className, slot, }: PopupSurfaceProps): kerfjs.SafeHtml;
|
|
3089
|
+
|
|
3090
|
+
export { DialogSurface, type DialogSurfacePresentation, type DialogSurfaceProps, type DialogSurfaceSize, PopupSurface, type PopupSurfaceInset, type PopupSurfaceProps, type SurfaceInset };
|
|
3091
|
+
```
|
|
3092
|
+
|
|
3093
|
+
## `@kerfjs/ui/text`
|
|
3094
|
+
|
|
3095
|
+
```ts
|
|
3096
|
+
import * as kerfjs from 'kerfjs';
|
|
3097
|
+
import { KerfBaseAttrs } from 'kerfjs/jsx-runtime';
|
|
3098
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
3099
|
+
|
|
3100
|
+
type TextVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
3101
|
+
type TextTone = 'default' | 'quiet' | 'danger';
|
|
3102
|
+
type TextSize = 'compact' | 'default' | 'large' | 'xlarge';
|
|
3103
|
+
type TextFont = 'default' | 'monospace';
|
|
3104
|
+
type TextBorder = 'transparent' | 'none';
|
|
3105
|
+
type TextLineHeight = 'default' | 'tight';
|
|
3106
|
+
type TextContent = KerfUiContent | string | number | readonly TextContent[];
|
|
3107
|
+
type TextProps = Omit<KerfBaseAttrs, 'children' | 'class' | 'className'> & {
|
|
3108
|
+
/** Native heading, paragraph, or inline span element to render. Defaults to `p`. */
|
|
3109
|
+
variant?: TextVariant;
|
|
3110
|
+
/** Semantic foreground treatment. Defaults to the inherited foreground. */
|
|
3111
|
+
tone?: TextTone;
|
|
3112
|
+
/** Text sizing independent of the native semantic element. */
|
|
3113
|
+
size?: TextSize;
|
|
3114
|
+
/** Font family independent of the native semantic element. */
|
|
3115
|
+
font?: TextFont;
|
|
3116
|
+
/** Transparent alignment border or no border when embedded in owner chrome. */
|
|
3117
|
+
border?: TextBorder;
|
|
3118
|
+
/** Remove the block variant's item padding and border in compact content. */
|
|
3119
|
+
flush?: boolean;
|
|
3120
|
+
/** Use compact leading for short dialog or metadata copy. */
|
|
3121
|
+
lineHeight?: TextLineHeight;
|
|
3122
|
+
children: TextContent;
|
|
3123
|
+
class?: string;
|
|
3124
|
+
className?: string;
|
|
3125
|
+
};
|
|
3126
|
+
/**
|
|
3127
|
+
* Semantic heading, paragraph, or inline text. Block variants use the standard
|
|
3128
|
+
* content-item padding; `span` adds no box geometry.
|
|
3129
|
+
* All ordinary native heading/paragraph attributes pass through to the element.
|
|
3130
|
+
*/
|
|
3131
|
+
declare function Text({ variant: Variant, tone, size, font, border, flush, lineHeight, children, class: classValue, className, ...attributes }: TextProps): kerfjs.SafeHtml;
|
|
3132
|
+
|
|
3133
|
+
export { Text, type TextBorder, type TextContent, type TextFont, type TextLineHeight, type TextProps, type TextSize, type TextTone, type TextVariant };
|
|
3134
|
+
```
|
|
3135
|
+
|
|
3136
|
+
## `@kerfjs/ui/row`
|
|
3137
|
+
|
|
3138
|
+
```ts
|
|
3139
|
+
import * as kerfjs from 'kerfjs';
|
|
3140
|
+
import { UiSpaceName, CssLength, CssFlexKeyword, CssFlex } from './css-values.js';
|
|
3141
|
+
import { H as HorizontalAlignment, V as VerticalAlignment } from './flex-alignment-4ms8ZbV8.js';
|
|
3142
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
3143
|
+
import { S as Sides } from './sides-BPSWde0A.js';
|
|
3144
|
+
|
|
3145
|
+
type RowRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
3146
|
+
'data-component'?: never;
|
|
3147
|
+
'data-h-align'?: never;
|
|
3148
|
+
'data-v-align'?: never;
|
|
3149
|
+
'data-flex'?: never;
|
|
3150
|
+
'data-fill'?: never;
|
|
3151
|
+
'data-wrap'?: never;
|
|
3152
|
+
'data-text-insets'?: never;
|
|
3153
|
+
'data-control-insets'?: never;
|
|
3154
|
+
}>;
|
|
3155
|
+
interface RowProps {
|
|
3156
|
+
children?: KerfUiContent;
|
|
3157
|
+
/** Horizontal distribution. Defaults to left. */
|
|
3158
|
+
hAlign?: HorizontalAlignment;
|
|
3159
|
+
/** Vertical alignment and wrapped-line distribution. Defaults to full. */
|
|
3160
|
+
vAlign?: VerticalAlignment;
|
|
3161
|
+
/** A named UI spacing token or typed CSS length. Defaults to xs. */
|
|
3162
|
+
gap?: UiSpaceName | CssLength;
|
|
3163
|
+
/** Allow this row to grow/shrink, use a keyword, or supply a typed CSS flex shorthand. */
|
|
3164
|
+
flex?: boolean | CssFlexKeyword | CssFlex;
|
|
3165
|
+
/**
|
|
3166
|
+
* Fill the height of a parent with a definite height, such as an app root or
|
|
3167
|
+
* a fixed-height frame, when this row is that parent's layout root. Inside a
|
|
3168
|
+
* flex layout use `flex` instead. Defaults to false.
|
|
3169
|
+
*/
|
|
3170
|
+
fill?: boolean;
|
|
3171
|
+
/** Allow children to wrap onto additional lines. */
|
|
3172
|
+
wrap?: boolean;
|
|
3173
|
+
/** Physical sides that receive the standard 17px text inset. */
|
|
3174
|
+
textInsets?: Sides;
|
|
3175
|
+
/** Physical sides that receive the standard 8px control inset. Text insets win on overlap. */
|
|
3176
|
+
controlInsets?: Sides;
|
|
3177
|
+
className?: string;
|
|
3178
|
+
/** Safe `data-*` metadata; Row-owned structural attributes remain protected. */
|
|
3179
|
+
rootAttributes?: RowRootAttributes;
|
|
3180
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
3181
|
+
slot?: string;
|
|
3182
|
+
}
|
|
3183
|
+
/** A horizontal flex row with explicit physical-axis alignment and spacing. */
|
|
3184
|
+
declare function Row({ children, hAlign, vAlign, gap, flex, fill, wrap, textInsets, controlInsets, className, rootAttributes, slot, }: RowProps): kerfjs.SafeHtml;
|
|
3185
|
+
|
|
3186
|
+
export { CssFlex, CssFlexKeyword, CssLength, HorizontalAlignment, Row, type RowProps, Sides, UiSpaceName, VerticalAlignment };
|
|
3187
|
+
```
|
|
3188
|
+
|
|
3189
|
+
## `@kerfjs/ui/grid`
|
|
3190
|
+
|
|
3191
|
+
```ts
|
|
3192
|
+
import * as kerfjs from 'kerfjs';
|
|
3193
|
+
import { UiSpaceName, CssLength, CssFlexKeyword, CssFlex } from './css-values.js';
|
|
3194
|
+
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
3195
|
+
|
|
3196
|
+
type GridRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
3197
|
+
'data-component'?: never;
|
|
3198
|
+
'data-columns'?: never;
|
|
3199
|
+
'data-flex'?: never;
|
|
3200
|
+
'data-fill'?: never;
|
|
3201
|
+
}>;
|
|
3202
|
+
interface GridProps {
|
|
3203
|
+
children?: KerfUiContent;
|
|
3204
|
+
/** Number of equal-width columns. Must be a positive safe integer. */
|
|
3205
|
+
columns: number;
|
|
3206
|
+
/** A named UI spacing token or typed CSS length. Defaults to xs. */
|
|
3207
|
+
gap?: UiSpaceName | CssLength;
|
|
3208
|
+
/** Allow this grid to grow/shrink, use a keyword, or supply a typed CSS flex shorthand. */
|
|
3209
|
+
flex?: boolean | CssFlexKeyword | CssFlex;
|
|
3210
|
+
/**
|
|
3211
|
+
* Fill the height of a parent with a definite height, such as an app root or
|
|
3212
|
+
* a fixed-height frame, when this grid is that parent's layout root. Inside a
|
|
3213
|
+
* flex layout use `flex` instead. Defaults to false.
|
|
3214
|
+
*/
|
|
3215
|
+
fill?: boolean;
|
|
3216
|
+
className?: string;
|
|
3217
|
+
/** Safe `data-*` metadata; Grid-owned structural attributes remain protected. */
|
|
3218
|
+
rootAttributes?: GridRootAttributes;
|
|
3219
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
3220
|
+
slot?: string;
|
|
3221
|
+
}
|
|
3222
|
+
/** A fixed-count grid whose columns share the available width equally. */
|
|
3223
|
+
declare function Grid({ children, columns, gap, flex, fill, className, rootAttributes, slot, }: GridProps): kerfjs.SafeHtml;
|
|
3224
|
+
|
|
3225
|
+
export { CssFlex, CssFlexKeyword, CssLength, Grid, type GridProps, UiSpaceName };
|
|
3226
|
+
```
|
|
3227
|
+
|
|
3228
|
+
## `@kerfjs/ui/spacer`
|
|
3229
|
+
|
|
3230
|
+
```ts
|
|
3231
|
+
import * as kerfjs from 'kerfjs';
|
|
3232
|
+
import { UiSpaceName, CssLength } from './css-values.js';
|
|
3233
|
+
|
|
3234
|
+
interface SpacerProps {
|
|
3235
|
+
/** Grow and shrink to fill the available space along a parent's flex axis. */
|
|
3236
|
+
flex?: boolean;
|
|
3237
|
+
/** A named UI spacing token or typed physical width. */
|
|
3238
|
+
width?: UiSpaceName | CssLength;
|
|
3239
|
+
/** A named UI spacing token or typed physical height. */
|
|
3240
|
+
height?: UiSpaceName | CssLength;
|
|
3241
|
+
className?: string;
|
|
3242
|
+
/** Native named-slot assignment when composed inside a web component. */
|
|
3243
|
+
slot?: string;
|
|
3244
|
+
}
|
|
3245
|
+
/** A decorative fixed-size or flexible gap for Row, List, and other flex layouts. */
|
|
3246
|
+
declare function Spacer({ flex, width, height, className, slot, }: SpacerProps): kerfjs.SafeHtml;
|
|
3247
|
+
|
|
3248
|
+
export { CssLength, Spacer, type SpacerProps, UiSpaceName };
|
|
3249
|
+
```
|
|
3250
|
+
|
|
3251
|
+
## `@kerfjs/ui/token-search-model`
|
|
3252
|
+
|
|
3253
|
+
```ts
|
|
3254
|
+
import 'kerfjs';
|
|
3255
|
+
export { d as TokenSearchModel, e as TokenSearchModelOptions, f as TokenSearchResolvedToken, g as TokenSearchRule, h as TokenSearchState, i as TokenSearchSuggestion, k as createTokenSearchModel } from './token-search-field-CCke1yvQ.js';
|
|
3256
|
+
import './semantic-content-BbzjvSu9.js';
|
|
3257
|
+
```
|