@blukavantui/community 0.0.0-stage → 1.1.0
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/LICENSE.txt +103 -0
- package/README.md +177 -2
- package/THIRD_PARTY_NOTICES.txt +58 -0
- package/assets/fonts/dm-sans-LICENSE.txt +93 -0
- package/assets/fonts/dm-sans-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/dm-sans-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/dm-sans-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/dm-sans-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-LICENSE.txt +93 -0
- package/assets/fonts/ibm-plex-mono-latin-100-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-100-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-200-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-200-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-300-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-300-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-400-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-500-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-600-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-700-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-700-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-100-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-100-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-200-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-200-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-300-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-300-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-400-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-500-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-600-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-600-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-700-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-700-normal.woff2 +0 -0
- package/assets/fonts/inter-LICENSE.txt +93 -0
- package/assets/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-LICENSE.txt +93 -0
- package/assets/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/lora-LICENSE.txt +93 -0
- package/assets/fonts/lora-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/lora-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/lora-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/lora-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/manifest.json +618 -0
- package/assets/fonts/manrope-LICENSE.txt +93 -0
- package/assets/fonts/manrope-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/manrope-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/merriweather-LICENSE.txt +93 -0
- package/assets/fonts/merriweather-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/merriweather-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/merriweather-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/merriweather-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/montserrat-LICENSE.txt +93 -0
- package/assets/fonts/montserrat-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/montserrat-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/montserrat-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/montserrat-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/playfair-display-LICENSE.txt +93 -0
- package/assets/fonts/playfair-display-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/playfair-display-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/playfair-display-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/playfair-display-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/roboto-LICENSE.txt +93 -0
- package/assets/fonts/roboto-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/roboto-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/roboto-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/roboto-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/source-sans-3-LICENSE.txt +93 -0
- package/assets/fonts/source-sans-3-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/source-sans-3-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/source-sans-3-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/source-sans-3-latin-wght-normal.woff2 +0 -0
- package/dist/advanced-types.d.ts +114 -0
- package/dist/app-layout.css +115 -0
- package/dist/app-layout.d.ts +2 -0
- package/dist/app-layout.js +1 -0
- package/dist/badge.css +131 -0
- package/dist/badge.d.ts +2 -0
- package/dist/badge.js +1 -0
- package/dist/bluui-community-grid.js +72 -0
- package/dist/bluui-community.js +1 -0
- package/dist/breadcrumbs.css +77 -0
- package/dist/breadcrumbs.d.ts +2 -0
- package/dist/breadcrumbs.js +1 -0
- package/dist/build-audit.json +516 -0
- package/dist/button.css +625 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +1 -0
- package/dist/card.css +119 -0
- package/dist/card.d.ts +2 -0
- package/dist/card.js +1 -0
- package/dist/cascader.css +152 -0
- package/dist/cascader.d.ts +2 -0
- package/dist/cascader.js +1 -0
- package/dist/chat-widget.css +121 -0
- package/dist/chat-widget.d.ts +2 -0
- package/dist/chat-widget.js +1 -0
- package/dist/chat.css +66 -0
- package/dist/chat.d.ts +2 -0
- package/dist/chat.js +1 -0
- package/dist/checkbox.css +1 -0
- package/dist/checkbox.d.ts +2 -0
- package/dist/checkbox.js +1 -0
- package/dist/chip-group.css +44 -0
- package/dist/chip-group.d.ts +2 -0
- package/dist/chip-group.js +1 -0
- package/dist/chip.css +191 -0
- package/dist/chip.d.ts +2 -0
- package/dist/chip.js +1 -0
- package/dist/chunk-2HFI6CC6.js +0 -0
- package/dist/chunk-2MQNFEGJ.js +1 -0
- package/dist/chunk-3LWXPCWY.js +1 -0
- package/dist/chunk-3PNBQVYS.js +1 -0
- package/dist/chunk-3ZS5YITP.js +1 -0
- package/dist/chunk-4RM3B4L7.js +1 -0
- package/dist/chunk-4USJBOSC.js +1 -0
- package/dist/chunk-5ENZVZGF.js +0 -0
- package/dist/chunk-5TEIXA4R.js +1 -0
- package/dist/chunk-64LOE3FU.js +1 -0
- package/dist/chunk-6EHKOVZK.js +1 -0
- package/dist/chunk-6EJIIQNF.js +1 -0
- package/dist/chunk-6XOMFIPU.js +1 -0
- package/dist/chunk-75BQYII5.js +1 -0
- package/dist/chunk-7HXX66DB.js +3 -0
- package/dist/chunk-7KMRDQZG.js +0 -0
- package/dist/chunk-AICXIQKD.js +1 -0
- package/dist/chunk-AL2ETLJV.js +1 -0
- package/dist/chunk-BLDXIO7P.js +1 -0
- package/dist/chunk-BN3PDE5G.js +0 -0
- package/dist/chunk-C3CLLZH2.js +1 -0
- package/dist/chunk-CZXYS6CY.js +1 -0
- package/dist/chunk-EOKNLCNS.js +1 -0
- package/dist/chunk-EPZGLHPD.js +0 -0
- package/dist/chunk-FNX33PDD.js +0 -0
- package/dist/chunk-GEG3TNB4.js +1 -0
- package/dist/chunk-GK3INPAZ.js +1 -0
- package/dist/chunk-GXHANADL.js +1 -0
- package/dist/chunk-H5IEGCAK.js +72 -0
- package/dist/chunk-H7ETPJVW.js +1 -0
- package/dist/chunk-HO6CYWED.js +0 -0
- package/dist/chunk-IHKCC6WJ.js +1 -0
- package/dist/chunk-IIKSMXQE.js +1 -0
- package/dist/chunk-IJ62ILKE.js +0 -0
- package/dist/chunk-IO22GWON.js +0 -0
- package/dist/chunk-IZJN3EF7.js +1 -0
- package/dist/chunk-J7BV4KHG.js +1 -0
- package/dist/chunk-JVE6CXCJ.js +1 -0
- package/dist/chunk-K2P2BHV5.js +1 -0
- package/dist/chunk-KBOMPMSI.js +1 -0
- package/dist/chunk-KR3UUTB2.js +1 -0
- package/dist/chunk-LGJVLEAH.js +1 -0
- package/dist/chunk-LJ4O6YTN.js +1 -0
- package/dist/chunk-MBC4UVTS.js +1 -0
- package/dist/chunk-MCVO25PZ.js +1 -0
- package/dist/chunk-MEEQNPGM.js +1 -0
- package/dist/chunk-MSMNEIWA.js +0 -0
- package/dist/chunk-MYVLBALF.js +1 -0
- package/dist/chunk-MZBB5ROJ.js +1 -0
- package/dist/chunk-NB5PGEDY.js +1 -0
- package/dist/chunk-NTFHNL7T.js +1 -0
- package/dist/chunk-O3MRWAI5.js +1 -0
- package/dist/chunk-OPMD7QNV.js +1 -0
- package/dist/chunk-RGTLYBOY.js +3 -0
- package/dist/chunk-RWBLICYX.js +0 -0
- package/dist/chunk-RYD6RHRX.js +0 -0
- package/dist/chunk-RZ5YSY7Y.js +0 -0
- package/dist/chunk-SDMH2EVD.js +1 -0
- package/dist/chunk-SEJUHKS5.js +1 -0
- package/dist/chunk-SIU7DSOA.js +1 -0
- package/dist/chunk-T45UAWNI.js +3 -0
- package/dist/chunk-TIXCZTJ7.js +0 -0
- package/dist/chunk-U4ZP73V4.js +1 -0
- package/dist/chunk-U73BNLZ3.js +1 -0
- package/dist/chunk-UEOCR2C3.js +2 -0
- package/dist/chunk-UN2SLVFG.js +1 -0
- package/dist/chunk-UUZ4HU7L.js +0 -0
- package/dist/chunk-VBRSAI3K.js +1 -0
- package/dist/chunk-VJVFHL6P.js +0 -0
- package/dist/chunk-W27NAI62.js +1 -0
- package/dist/chunk-W4SW4RWX.js +1 -0
- package/dist/chunk-WHA6UO5X.js +1 -0
- package/dist/chunk-XIOI5PKM.js +1 -0
- package/dist/chunk-XWXEH3SW.js +1 -0
- package/dist/chunk-Y4TCT2K6.js +1 -0
- package/dist/chunk-Y4WEMSE4.js +0 -0
- package/dist/chunk-YCLR3IE3.js +0 -0
- package/dist/collection-layout.css +30 -0
- package/dist/collection-layout.d.ts +2 -0
- package/dist/collection-layout.js +1 -0
- package/dist/colors.d.ts +2 -0
- package/dist/columns2.css +1 -0
- package/dist/columns2.d.ts +2 -0
- package/dist/columns2.js +1 -0
- package/dist/columns3.css +1 -0
- package/dist/columns3.d.ts +2 -0
- package/dist/columns3.js +1 -0
- package/dist/columns4.css +1 -0
- package/dist/columns4.d.ts +2 -0
- package/dist/columns4.js +1 -0
- package/dist/command-palette.css +35 -0
- package/dist/command-palette.d.ts +2 -0
- package/dist/command-palette.js +1 -0
- package/dist/component-factories/app-layout.d.ts +2 -0
- package/dist/component-factories/breadcrumbs.d.ts +2 -0
- package/dist/component-factories/cascader.d.ts +2 -0
- package/dist/component-factories/chat-widget.d.ts +2 -0
- package/dist/component-factories/chat.d.ts +2 -0
- package/dist/component-factories/collection-layout.d.ts +2 -0
- package/dist/component-factories/command-palette.d.ts +2 -0
- package/dist/component-factories/content-carousel.d.ts +2 -0
- package/dist/component-factories/dashboard-canvas.d.ts +3 -0
- package/dist/component-factories/dashboard-panel.d.ts +3 -0
- package/dist/component-factories/date-picker.d.ts +2 -0
- package/dist/component-factories/date-range-picker.d.ts +2 -0
- package/dist/component-factories/date-time-picker.d.ts +2 -0
- package/dist/component-factories/descriptions.d.ts +2 -0
- package/dist/component-factories/drawer.d.ts +2 -0
- package/dist/component-factories/float-button.d.ts +2 -0
- package/dist/component-factories/font-provider.d.ts +2 -0
- package/dist/component-factories/hero-section.d.ts +2 -0
- package/dist/component-factories/image-compare.d.ts +2 -0
- package/dist/component-factories/logo-cloud.d.ts +2 -0
- package/dist/component-factories/media-card.d.ts +2 -0
- package/dist/component-factories/media-image.d.ts +2 -0
- package/dist/component-factories/modal.d.ts +2 -0
- package/dist/component-factories/notification-center.d.ts +3 -0
- package/dist/component-factories/notification.d.ts +5 -0
- package/dist/component-factories/page-header.d.ts +2 -0
- package/dist/component-factories/page-layout.d.ts +2 -0
- package/dist/component-factories/pagination.d.ts +2 -0
- package/dist/component-factories/profile-card.d.ts +2 -0
- package/dist/component-factories/qr-code.d.ts +2 -0
- package/dist/component-factories/quote-card.d.ts +2 -0
- package/dist/component-factories/shape-mask.d.ts +2 -0
- package/dist/component-factories/sidebar.d.ts +2 -0
- package/dist/component-factories/sparkline.d.ts +2 -0
- package/dist/component-factories/split-section.d.ts +2 -0
- package/dist/component-factories/splitter.d.ts +2 -0
- package/dist/component-factories/statistic.d.ts +2 -0
- package/dist/component-factories/text-highlight.d.ts +2 -0
- package/dist/component-factories/time-picker.d.ts +2 -0
- package/dist/component-factories/timeline.d.ts +2 -0
- package/dist/component-factories/tour.d.ts +2 -0
- package/dist/component-factories/transfer-list.d.ts +2 -0
- package/dist/component-factories/tree-select.d.ts +2 -0
- package/dist/component-factories/tree-view.d.ts +2 -0
- package/dist/component-factories/upload-manager.d.ts +2 -0
- package/dist/component-factories/video-lightbox.d.ts +2 -0
- package/dist/component-factories/video-player.d.ts +2 -0
- package/dist/component-runtime.d.ts +2 -0
- package/dist/content-carousel.css +34 -0
- package/dist/content-carousel.d.ts +2 -0
- package/dist/content-carousel.js +1 -0
- package/dist/content.css +2085 -0
- package/dist/content.d.ts +13 -0
- package/dist/content.js +1 -0
- package/dist/core.css +1070 -0
- package/dist/core.d.ts +6 -0
- package/dist/core.js +1 -0
- package/dist/dashboard-canvas.css +49 -0
- package/dist/dashboard-canvas.d.ts +2 -0
- package/dist/dashboard-canvas.js +1 -0
- package/dist/dashboard-panel.css +2 -0
- package/dist/dashboard-panel.d.ts +2 -0
- package/dist/dashboard-panel.js +1 -0
- package/dist/data.css +876 -0
- package/dist/data.d.ts +10 -0
- package/dist/data.js +1 -0
- package/dist/date-picker.css +78 -0
- package/dist/date-picker.d.ts +2 -0
- package/dist/date-picker.js +1 -0
- package/dist/date-range-picker.css +78 -0
- package/dist/date-range-picker.d.ts +2 -0
- package/dist/date-range-picker.js +1 -0
- package/dist/date-time-picker.css +78 -0
- package/dist/date-time-picker.d.ts +2 -0
- package/dist/date-time-picker.js +1 -0
- package/dist/descriptions.css +113 -0
- package/dist/descriptions.d.ts +2 -0
- package/dist/descriptions.js +1 -0
- package/dist/dom.d.ts +7 -0
- package/dist/draft-components.json +77 -0
- package/dist/drawer.css +215 -0
- package/dist/drawer.d.ts +2 -0
- package/dist/drawer.js +1 -0
- package/dist/empty-state.css +110 -0
- package/dist/empty-state.d.ts +2 -0
- package/dist/empty-state.js +1 -0
- package/dist/essentials.css +1295 -0
- package/dist/essentials.d.ts +11 -0
- package/dist/essentials.js +1 -0
- package/dist/feedback.css +1136 -0
- package/dist/feedback.d.ts +10 -0
- package/dist/feedback.js +1 -0
- package/dist/float-button.css +28 -0
- package/dist/float-button.d.ts +2 -0
- package/dist/float-button.js +1 -0
- package/dist/font-provider.css +5 -0
- package/dist/font-provider.d.ts +2 -0
- package/dist/font-provider.js +1 -0
- package/dist/fonts/dm-sans-LICENSE.txt +93 -0
- package/dist/fonts/dm-sans-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/dm-sans-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/dm-sans-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/dm-sans-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-LICENSE.txt +93 -0
- package/dist/fonts/ibm-plex-mono-latin-100-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-100-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-200-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-200-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-300-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-300-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-400-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-500-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-600-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-700-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-700-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-100-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-100-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-200-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-200-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-300-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-300-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-400-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-500-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-600-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-600-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-700-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-700-normal.woff2 +0 -0
- package/dist/fonts/inter-LICENSE.txt +93 -0
- package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-LICENSE.txt +93 -0
- package/dist/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/lora-LICENSE.txt +93 -0
- package/dist/fonts/lora-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/lora-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/lora-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/lora-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/manifest.json +618 -0
- package/dist/fonts/manrope-LICENSE.txt +93 -0
- package/dist/fonts/manrope-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/manrope-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/merriweather-LICENSE.txt +93 -0
- package/dist/fonts/merriweather-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/merriweather-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/merriweather-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/merriweather-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/montserrat-LICENSE.txt +93 -0
- package/dist/fonts/montserrat-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/montserrat-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/montserrat-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/montserrat-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/playfair-display-LICENSE.txt +93 -0
- package/dist/fonts/playfair-display-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/playfair-display-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/playfair-display-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/playfair-display-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/roboto-LICENSE.txt +93 -0
- package/dist/fonts/roboto-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/roboto-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/roboto-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/roboto-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/source-sans-3-LICENSE.txt +93 -0
- package/dist/fonts/source-sans-3-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/source-sans-3-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/source-sans-3-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/source-sans-3-latin-wght-normal.woff2 +0 -0
- package/dist/form-field.css +1 -0
- package/dist/form-field.d.ts +2 -0
- package/dist/form-field.js +1 -0
- package/dist/form-layout/choice.d.ts +15 -0
- package/dist/form-layout/layout.d.ts +12 -0
- package/dist/form-layout/select.d.ts +3 -0
- package/dist/form-layout/shared.d.ts +21 -0
- package/dist/form-layout/table.d.ts +20 -0
- package/dist/form-layout/text.d.ts +3 -0
- package/dist/form-layout/types.d.ts +151 -0
- package/dist/form-layout.css +62 -0
- package/dist/form-layout.d.ts +12 -0
- package/dist/form-layout.js +1 -0
- package/dist/grid-basic.css +12 -0
- package/dist/grid-basic.d.ts +10 -0
- package/dist/grid-basic.js +1 -0
- package/dist/grid-spec.d.ts +37 -0
- package/dist/grid.css +12 -0
- package/dist/grid.d.ts +1 -0
- package/dist/grid.js +1 -0
- package/dist/hero-section.css +41 -0
- package/dist/hero-section.d.ts +2 -0
- package/dist/hero-section.js +1 -0
- package/dist/image-compare.css +35 -0
- package/dist/image-compare.d.ts +2 -0
- package/dist/image-compare.js +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +1 -0
- package/dist/inputs.css +1587 -0
- package/dist/inputs.d.ts +16 -0
- package/dist/inputs.js +1 -0
- package/dist/layout.css +907 -0
- package/dist/layout.d.ts +11 -0
- package/dist/layout.js +1 -0
- package/dist/logo-cloud.css +33 -0
- package/dist/logo-cloud.d.ts +2 -0
- package/dist/logo-cloud.js +1 -0
- package/dist/marketing-template-layout.css +30 -0
- package/dist/media-card.css +41 -0
- package/dist/media-card.d.ts +2 -0
- package/dist/media-card.js +1 -0
- package/dist/media-image.css +531 -0
- package/dist/media-image.d.ts +2 -0
- package/dist/media-image.js +1 -0
- package/dist/modal.css +210 -0
- package/dist/modal.d.ts +2 -0
- package/dist/modal.js +1 -0
- package/dist/native/app-layout.js +1 -0
- package/dist/native/cascader.js +1 -0
- package/dist/native/chat-widget.js +3 -0
- package/dist/native/chat.js +3 -0
- package/dist/native/collection-layout.js +1 -0
- package/dist/native/command-palette.js +1 -0
- package/dist/native/content-carousel.js +1 -0
- package/dist/native/dashboard-canvas.js +1 -0
- package/dist/native/date-picker.js +1 -0
- package/dist/native/date-range-picker.js +1 -0
- package/dist/native/date-time-picker.js +1 -0
- package/dist/native/descriptions.js +1 -0
- package/dist/native/drawer.js +1 -0
- package/dist/native/float-button.js +1 -0
- package/dist/native/font-provider.js +1 -0
- package/dist/native/form-layout.js +1 -0
- package/dist/native/hero-section.js +1 -0
- package/dist/native/image-compare.js +1 -0
- package/dist/native/logo-cloud.js +1 -0
- package/dist/native/media-card.js +1 -0
- package/dist/native/media-image.js +1 -0
- package/dist/native/modal.js +1 -0
- package/dist/native/notification-center.js +1 -0
- package/dist/native/notification.js +2 -0
- package/dist/native/page-layout.js +1 -0
- package/dist/native/pagination.js +1 -0
- package/dist/native/profile-card.js +1 -0
- package/dist/native/qr-code.js +3 -0
- package/dist/native/quote-card.js +1 -0
- package/dist/native/shape-mask.js +1 -0
- package/dist/native/sparkline.js +1 -0
- package/dist/native/split-section.js +1 -0
- package/dist/native/splitter.js +1 -0
- package/dist/native/statistic.js +1 -0
- package/dist/native/text-highlight.js +1 -0
- package/dist/native/time-picker.js +1 -0
- package/dist/native/timeline.js +1 -0
- package/dist/native/tour.js +1 -0
- package/dist/native/transfer-list.js +1 -0
- package/dist/native/tree-select.js +1 -0
- package/dist/native/tree-view.js +1 -0
- package/dist/native/upload-manager.js +1 -0
- package/dist/native/video-lightbox.js +1 -0
- package/dist/native/video-player.js +1 -0
- package/dist/native-base.d.ts +1 -0
- package/dist/native-components/app-layout.d.ts +1 -0
- package/dist/native-components/cascader.d.ts +1 -0
- package/dist/native-components/chat-widget.d.ts +1 -0
- package/dist/native-components/chat.d.ts +1 -0
- package/dist/native-components/collection-layout.d.ts +1 -0
- package/dist/native-components/command-palette.d.ts +1 -0
- package/dist/native-components/content-carousel.d.ts +1 -0
- package/dist/native-components/dashboard-canvas.d.ts +1 -0
- package/dist/native-components/date-picker.d.ts +1 -0
- package/dist/native-components/date-range-picker.d.ts +1 -0
- package/dist/native-components/date-time-picker.d.ts +1 -0
- package/dist/native-components/descriptions.d.ts +1 -0
- package/dist/native-components/drawer.d.ts +1 -0
- package/dist/native-components/float-button.d.ts +1 -0
- package/dist/native-components/font-provider.d.ts +1 -0
- package/dist/native-components/form-layout.d.ts +1 -0
- package/dist/native-components/hero-section.d.ts +1 -0
- package/dist/native-components/image-compare.d.ts +1 -0
- package/dist/native-components/logo-cloud.d.ts +1 -0
- package/dist/native-components/media-card.d.ts +1 -0
- package/dist/native-components/media-image.d.ts +1 -0
- package/dist/native-components/modal.d.ts +1 -0
- package/dist/native-components/notification-center.d.ts +1 -0
- package/dist/native-components/notification.d.ts +1 -0
- package/dist/native-components/page-layout.d.ts +1 -0
- package/dist/native-components/pagination.d.ts +1 -0
- package/dist/native-components/profile-card.d.ts +1 -0
- package/dist/native-components/qr-code.d.ts +1 -0
- package/dist/native-components/quote-card.d.ts +1 -0
- package/dist/native-components/shape-mask.d.ts +1 -0
- package/dist/native-components/sparkline.d.ts +1 -0
- package/dist/native-components/split-section.d.ts +1 -0
- package/dist/native-components/splitter.d.ts +1 -0
- package/dist/native-components/statistic.d.ts +1 -0
- package/dist/native-components/text-highlight.d.ts +1 -0
- package/dist/native-components/time-picker.d.ts +1 -0
- package/dist/native-components/timeline.d.ts +1 -0
- package/dist/native-components/tour.d.ts +1 -0
- package/dist/native-components/transfer-list.d.ts +1 -0
- package/dist/native-components/tree-select.d.ts +1 -0
- package/dist/native-components/tree-view.d.ts +1 -0
- package/dist/native-components/upload-manager.d.ts +1 -0
- package/dist/native-components/video-lightbox.d.ts +1 -0
- package/dist/native-components/video-player.d.ts +1 -0
- package/dist/native-grid.d.ts +1 -0
- package/dist/native.d.ts +1 -0
- package/dist/notification-center.css +49 -0
- package/dist/notification-center.d.ts +2 -0
- package/dist/notification-center.js +1 -0
- package/dist/notification.css +155 -0
- package/dist/notification.d.ts +2 -0
- package/dist/notification.js +1 -0
- package/dist/page-header.css +184 -0
- package/dist/page-header.d.ts +2 -0
- package/dist/page-header.js +1 -0
- package/dist/page-layout.css +117 -0
- package/dist/page-layout.d.ts +2 -0
- package/dist/page-layout.js +1 -0
- package/dist/pagination.css +127 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +1 -0
- package/dist/primitives.d.ts +1 -0
- package/dist/profile-card.css +484 -0
- package/dist/profile-card.d.ts +2 -0
- package/dist/profile-card.js +1 -0
- package/dist/qr-code.css +125 -0
- package/dist/qr-code.d.ts +2 -0
- package/dist/qr-code.js +1 -0
- package/dist/quote-card.css +30 -0
- package/dist/quote-card.d.ts +2 -0
- package/dist/quote-card.js +1 -0
- package/dist/radio-button.css +1 -0
- package/dist/radio-button.d.ts +2 -0
- package/dist/radio-button.js +1 -0
- package/dist/radio-group.css +1 -0
- package/dist/radio-group.d.ts +2 -0
- package/dist/radio-group.js +1 -0
- package/dist/select.css +1 -0
- package/dist/select.d.ts +2 -0
- package/dist/select.js +1 -0
- package/dist/shape-mask.css +10 -0
- package/dist/shape-mask.d.ts +2 -0
- package/dist/shape-mask.js +1 -0
- package/dist/sidebar.css +183 -0
- package/dist/sidebar.d.ts +2 -0
- package/dist/sidebar.js +1 -0
- package/dist/sizes.json +1194 -0
- package/dist/skeleton.css +69 -0
- package/dist/skeleton.d.ts +2 -0
- package/dist/skeleton.js +1 -0
- package/dist/sparkline.css +38 -0
- package/dist/sparkline.d.ts +2 -0
- package/dist/sparkline.js +1 -0
- package/dist/split-section.css +34 -0
- package/dist/split-section.d.ts +2 -0
- package/dist/split-section.js +1 -0
- package/dist/splitter.css +32 -0
- package/dist/splitter.d.ts +2 -0
- package/dist/splitter.js +1 -0
- package/dist/statistic.css +107 -0
- package/dist/statistic.d.ts +2 -0
- package/dist/statistic.js +1 -0
- package/dist/styles.css +8945 -0
- package/dist/switch.css +1 -0
- package/dist/switch.d.ts +2 -0
- package/dist/switch.js +1 -0
- package/dist/table.css +1 -0
- package/dist/table.d.ts +2 -0
- package/dist/table.js +1 -0
- package/dist/text-area.css +1 -0
- package/dist/text-area.d.ts +2 -0
- package/dist/text-area.js +1 -0
- package/dist/text-highlight.css +49 -0
- package/dist/text-highlight.d.ts +2 -0
- package/dist/text-highlight.js +1 -0
- package/dist/text-input.css +1 -0
- package/dist/text-input.d.ts +2 -0
- package/dist/text-input.js +1 -0
- package/dist/theme-runtime.d.ts +1 -0
- package/dist/theme.css +1391 -0
- package/dist/theme.d.ts +10 -0
- package/dist/theme.js +1 -0
- package/dist/time-picker.css +78 -0
- package/dist/time-picker.d.ts +2 -0
- package/dist/time-picker.js +1 -0
- package/dist/timeline.css +126 -0
- package/dist/timeline.d.ts +2 -0
- package/dist/timeline.js +1 -0
- package/dist/tour.css +138 -0
- package/dist/tour.d.ts +2 -0
- package/dist/tour.js +1 -0
- package/dist/transfer-list.css +878 -0
- package/dist/transfer-list.d.ts +2 -0
- package/dist/transfer-list.js +1 -0
- package/dist/tree-select.css +135 -0
- package/dist/tree-select.d.ts +2 -0
- package/dist/tree-select.js +1 -0
- package/dist/tree-view.css +118 -0
- package/dist/tree-view.d.ts +2 -0
- package/dist/tree-view.js +1 -0
- package/dist/types.d.ts +1284 -0
- package/dist/upload-manager.css +40 -0
- package/dist/upload-manager.d.ts +2 -0
- package/dist/upload-manager.js +1 -0
- package/dist/video-lightbox.css +639 -0
- package/dist/video-lightbox.d.ts +2 -0
- package/dist/video-lightbox.js +1 -0
- package/dist/video-player.css +92 -0
- package/dist/video-player.d.ts +2 -0
- package/dist/video-player.js +1 -0
- package/docs/FORM-LAYOUT-ESSENTIALS.md +122 -0
- package/docs/PUBLISHING.md +129 -0
- package/draft-components.json +77 -0
- package/edition.json +282 -0
- package/npm-shrinkwrap.json +554 -0
- package/package.json +457 -4
- package/scripts/build.mjs +42 -0
- package/scripts/verify-package.mjs +136 -0
- package/src/advanced-types.ts +89 -0
- package/src/app-layout.ts +2 -0
- package/src/badge.ts +2 -0
- package/src/breadcrumbs.ts +2 -0
- package/src/button.ts +2 -0
- package/src/card.ts +2 -0
- package/src/cascader.ts +2 -0
- package/src/chat-widget.ts +2 -0
- package/src/chat.ts +2 -0
- package/src/checkbox.ts +2 -0
- package/src/chip-group.ts +2 -0
- package/src/chip.ts +2 -0
- package/src/collection-layout.ts +2 -0
- package/src/colors.ts +3 -0
- package/src/columns2.ts +2 -0
- package/src/columns3.ts +2 -0
- package/src/columns4.ts +2 -0
- package/src/command-palette.ts +2 -0
- package/src/component-factories/app-layout.ts +8 -0
- package/src/component-factories/breadcrumbs.ts +45 -0
- package/src/component-factories/cascader.ts +11 -0
- package/src/component-factories/chat-widget.ts +12 -0
- package/src/component-factories/chat.ts +10 -0
- package/src/component-factories/collection-layout.ts +5 -0
- package/src/component-factories/command-palette.ts +79 -0
- package/src/component-factories/content-carousel.ts +5 -0
- package/src/component-factories/dashboard-canvas.ts +11 -0
- package/src/component-factories/dashboard-panel.ts +9 -0
- package/src/component-factories/date-picker.ts +6 -0
- package/src/component-factories/date-range-picker.ts +6 -0
- package/src/component-factories/date-time-picker.ts +6 -0
- package/src/component-factories/descriptions.ts +11 -0
- package/src/component-factories/drawer.ts +12 -0
- package/src/component-factories/float-button.ts +7 -0
- package/src/component-factories/font-provider.ts +6 -0
- package/src/component-factories/hero-section.ts +5 -0
- package/src/component-factories/image-compare.ts +5 -0
- package/src/component-factories/logo-cloud.ts +5 -0
- package/src/component-factories/media-card.ts +5 -0
- package/src/component-factories/media-image.ts +5 -0
- package/src/component-factories/modal.ts +12 -0
- package/src/component-factories/notification-center.ts +13 -0
- package/src/component-factories/notification.ts +16 -0
- package/src/component-factories/page-header.ts +73 -0
- package/src/component-factories/page-layout.ts +8 -0
- package/src/component-factories/pagination.ts +11 -0
- package/src/component-factories/profile-card.ts +5 -0
- package/src/component-factories/qr-code.ts +11 -0
- package/src/component-factories/quote-card.ts +5 -0
- package/src/component-factories/shape-mask.ts +6 -0
- package/src/component-factories/sidebar.ts +98 -0
- package/src/component-factories/sparkline.ts +8 -0
- package/src/component-factories/split-section.ts +5 -0
- package/src/component-factories/splitter.ts +105 -0
- package/src/component-factories/statistic.ts +10 -0
- package/src/component-factories/text-highlight.ts +5 -0
- package/src/component-factories/time-picker.ts +6 -0
- package/src/component-factories/timeline.ts +11 -0
- package/src/component-factories/tour.ts +13 -0
- package/src/component-factories/transfer-list.ts +159 -0
- package/src/component-factories/tree-select.ts +83 -0
- package/src/component-factories/tree-view.ts +115 -0
- package/src/component-factories/upload-manager.ts +76 -0
- package/src/component-factories/video-lightbox.ts +5 -0
- package/src/component-factories/video-player.ts +5 -0
- package/src/component-runtime.ts +20 -0
- package/src/content-carousel.ts +2 -0
- package/src/content.ts +13 -0
- package/src/core.ts +6 -0
- package/src/dashboard-canvas.ts +2 -0
- package/src/dashboard-panel.ts +2 -0
- package/src/data.ts +10 -0
- package/src/date-picker.ts +2 -0
- package/src/date-range-picker.ts +2 -0
- package/src/date-time-picker.ts +2 -0
- package/src/descriptions.ts +2 -0
- package/src/dom.ts +65 -0
- package/src/drawer.ts +2 -0
- package/src/empty-state.ts +2 -0
- package/src/essentials.ts +180 -0
- package/src/feedback.ts +10 -0
- package/src/float-button.ts +2 -0
- package/src/font-provider.ts +2 -0
- package/src/form-field.ts +2 -0
- package/src/form-layout/choice.ts +66 -0
- package/src/form-layout/layout.ts +40 -0
- package/src/form-layout/select.ts +97 -0
- package/src/form-layout/shared.ts +57 -0
- package/src/form-layout/table.ts +86 -0
- package/src/form-layout/text.ts +73 -0
- package/src/form-layout/types.ts +59 -0
- package/src/form-layout.ts +12 -0
- package/src/grid-basic.ts +46 -0
- package/src/grid-spec.ts +93 -0
- package/src/grid.ts +1 -0
- package/src/hero-section.ts +2 -0
- package/src/image-compare.ts +2 -0
- package/src/index.ts +58 -0
- package/src/inputs.ts +16 -0
- package/src/layout.ts +11 -0
- package/src/logo-cloud.ts +2 -0
- package/src/media-card.ts +2 -0
- package/src/media-image.ts +2 -0
- package/src/modal.ts +2 -0
- package/src/native-base.ts +20 -0
- package/src/native-components/app-layout.ts +2 -0
- package/src/native-components/cascader.ts +2 -0
- package/src/native-components/chat-widget.ts +2 -0
- package/src/native-components/chat.ts +2 -0
- package/src/native-components/collection-layout.ts +2 -0
- package/src/native-components/command-palette.ts +2 -0
- package/src/native-components/content-carousel.ts +2 -0
- package/src/native-components/dashboard-canvas.ts +2 -0
- package/src/native-components/date-picker.ts +2 -0
- package/src/native-components/date-range-picker.ts +2 -0
- package/src/native-components/date-time-picker.ts +2 -0
- package/src/native-components/descriptions.ts +2 -0
- package/src/native-components/drawer.ts +2 -0
- package/src/native-components/float-button.ts +2 -0
- package/src/native-components/font-provider.ts +2 -0
- package/src/native-components/form-layout.ts +21 -0
- package/src/native-components/hero-section.ts +2 -0
- package/src/native-components/image-compare.ts +2 -0
- package/src/native-components/logo-cloud.ts +2 -0
- package/src/native-components/media-card.ts +2 -0
- package/src/native-components/media-image.ts +2 -0
- package/src/native-components/modal.ts +2 -0
- package/src/native-components/notification-center.ts +2 -0
- package/src/native-components/notification.ts +2 -0
- package/src/native-components/page-layout.ts +2 -0
- package/src/native-components/pagination.ts +2 -0
- package/src/native-components/profile-card.ts +2 -0
- package/src/native-components/qr-code.ts +2 -0
- package/src/native-components/quote-card.ts +2 -0
- package/src/native-components/shape-mask.ts +2 -0
- package/src/native-components/sparkline.ts +2 -0
- package/src/native-components/split-section.ts +2 -0
- package/src/native-components/splitter.ts +2 -0
- package/src/native-components/statistic.ts +2 -0
- package/src/native-components/text-highlight.ts +2 -0
- package/src/native-components/time-picker.ts +2 -0
- package/src/native-components/timeline.ts +2 -0
- package/src/native-components/tour.ts +2 -0
- package/src/native-components/transfer-list.ts +2 -0
- package/src/native-components/tree-select.ts +2 -0
- package/src/native-components/tree-view.ts +2 -0
- package/src/native-components/upload-manager.ts +2 -0
- package/src/native-components/video-lightbox.ts +2 -0
- package/src/native-components/video-player.ts +2 -0
- package/src/native-grid.ts +3 -0
- package/src/native.ts +3 -0
- package/src/notification-center.ts +2 -0
- package/src/notification.ts +2 -0
- package/src/page-header.ts +2 -0
- package/src/page-layout.ts +2 -0
- package/src/pagination.ts +2 -0
- package/src/primitives.ts +1 -0
- package/src/profile-card.ts +2 -0
- package/src/qr-code.ts +2 -0
- package/src/quote-card.ts +2 -0
- package/src/radio-button.ts +2 -0
- package/src/radio-group.ts +2 -0
- package/src/runtime/app-layout.d.ts +1 -0
- package/src/runtime/app-layout.js +168 -0
- package/src/runtime/cascader.d.ts +1 -0
- package/src/runtime/cascader.js +381 -0
- package/src/runtime/chat-widget.d.ts +1 -0
- package/src/runtime/chat-widget.js +630 -0
- package/src/runtime/chat.d.ts +1 -0
- package/src/runtime/chat.js +461 -0
- package/src/runtime/collection-layout.d.ts +1 -0
- package/src/runtime/collection-layout.js +269 -0
- package/src/runtime/command-palette.d.ts +1 -0
- package/src/runtime/command-palette.js +302 -0
- package/src/runtime/content-carousel.d.ts +1 -0
- package/src/runtime/content-carousel.js +282 -0
- package/src/runtime/dashboard-canvas.d.ts +1 -0
- package/src/runtime/dashboard-canvas.js +493 -0
- package/src/runtime/date-picker.d.ts +1 -0
- package/src/runtime/date-picker.js +826 -0
- package/src/runtime/date-range-picker.d.ts +1 -0
- package/src/runtime/date-range-picker.js +826 -0
- package/src/runtime/date-time-picker.d.ts +1 -0
- package/src/runtime/date-time-picker.js +826 -0
- package/src/runtime/descriptions.d.ts +1 -0
- package/src/runtime/descriptions.js +220 -0
- package/src/runtime/drawer.d.ts +1 -0
- package/src/runtime/drawer.js +287 -0
- package/src/runtime/empty-state.d.ts +1 -0
- package/src/runtime/empty-state.js +178 -0
- package/src/runtime/float-button.d.ts +1 -0
- package/src/runtime/float-button.js +171 -0
- package/src/runtime/font-provider.d.ts +1 -0
- package/src/runtime/font-provider.js +694 -0
- package/src/runtime/hero-section.d.ts +1 -0
- package/src/runtime/hero-section.js +186 -0
- package/src/runtime/image-compare.d.ts +1 -0
- package/src/runtime/image-compare.js +242 -0
- package/src/runtime/kernel.js +8 -0
- package/src/runtime/logo-cloud.d.ts +1 -0
- package/src/runtime/logo-cloud.js +163 -0
- package/src/runtime/media-card.d.ts +1 -0
- package/src/runtime/media-card.js +189 -0
- package/src/runtime/media-image.d.ts +1 -0
- package/src/runtime/media-image.js +480 -0
- package/src/runtime/modal.d.ts +1 -0
- package/src/runtime/modal.js +287 -0
- package/src/runtime/notification-center.d.ts +1 -0
- package/src/runtime/notification-center.js +417 -0
- package/src/runtime/notification.d.ts +1 -0
- package/src/runtime/notification.js +347 -0
- package/src/runtime/page-layout.d.ts +1 -0
- package/src/runtime/page-layout.js +105 -0
- package/src/runtime/pagination.d.ts +1 -0
- package/src/runtime/pagination.js +274 -0
- package/src/runtime/profile-card.d.ts +1 -0
- package/src/runtime/profile-card.js +512 -0
- package/src/runtime/qr-code.d.ts +1 -0
- package/src/runtime/qr-code.js +1942 -0
- package/src/runtime/quote-card.d.ts +1 -0
- package/src/runtime/quote-card.js +153 -0
- package/src/runtime/shape-mask.d.ts +1 -0
- package/src/runtime/shape-mask.js +211 -0
- package/src/runtime/sparkline.d.ts +1 -0
- package/src/runtime/sparkline.js +197 -0
- package/src/runtime/split-section.d.ts +1 -0
- package/src/runtime/split-section.js +148 -0
- package/src/runtime/splitter.d.ts +1 -0
- package/src/runtime/splitter.js +278 -0
- package/src/runtime/statistic.d.ts +1 -0
- package/src/runtime/statistic.js +204 -0
- package/src/runtime/text-highlight.d.ts +1 -0
- package/src/runtime/text-highlight.js +194 -0
- package/src/runtime/time-picker.d.ts +1 -0
- package/src/runtime/time-picker.js +826 -0
- package/src/runtime/timeline.d.ts +1 -0
- package/src/runtime/timeline.js +213 -0
- package/src/runtime/tour.d.ts +1 -0
- package/src/runtime/tour.js +412 -0
- package/src/runtime/transfer.d.ts +1 -0
- package/src/runtime/transfer.js +88 -0
- package/src/runtime/tree-select.d.ts +1 -0
- package/src/runtime/tree-select.js +420 -0
- package/src/runtime/tree.d.ts +1 -0
- package/src/runtime/tree.js +302 -0
- package/src/runtime/upload-manager.d.ts +1 -0
- package/src/runtime/upload-manager.js +408 -0
- package/src/runtime/video-lightbox.d.ts +1 -0
- package/src/runtime/video-lightbox.js +1117 -0
- package/src/runtime/video-player.d.ts +1 -0
- package/src/runtime/video-player.js +770 -0
- package/src/select.ts +2 -0
- package/src/shape-mask.ts +2 -0
- package/src/sidebar.ts +2 -0
- package/src/skeleton.ts +2 -0
- package/src/sparkline.ts +2 -0
- package/src/split-section.ts +2 -0
- package/src/splitter.ts +2 -0
- package/src/statistic.ts +2 -0
- package/src/switch.ts +2 -0
- package/src/table.ts +2 -0
- package/src/text-area.ts +2 -0
- package/src/text-highlight.ts +2 -0
- package/src/text-input.ts +2 -0
- package/src/theme-runtime.ts +70 -0
- package/src/theme.ts +32 -0
- package/src/time-picker.ts +2 -0
- package/src/timeline.ts +2 -0
- package/src/tour.ts +2 -0
- package/src/transfer-list.ts +2 -0
- package/src/tree-select.ts +2 -0
- package/src/tree-view.ts +2 -0
- package/src/types.ts +1287 -0
- package/src/upload-manager.ts +2 -0
- package/src/video-lightbox.ts +2 -0
- package/src/video-player.ts +2 -0
- package/styles/app-layout.css +115 -0
- package/styles/badge.css +131 -0
- package/styles/breadcrumbs.css +77 -0
- package/styles/button.css +625 -0
- package/styles/card.css +119 -0
- package/styles/cascader.css +152 -0
- package/styles/chat-widget.css +121 -0
- package/styles/chat.css +66 -0
- package/styles/checkbox.css +1 -0
- package/styles/chip-group.css +44 -0
- package/styles/chip.css +191 -0
- package/styles/collection-layout.css +30 -0
- package/styles/columns2.css +1 -0
- package/styles/columns3.css +1 -0
- package/styles/columns4.css +1 -0
- package/styles/command-palette.css +35 -0
- package/styles/content-carousel.css +34 -0
- package/styles/dashboard-canvas.css +49 -0
- package/styles/dashboard-panel.css +2 -0
- package/styles/date-picker.css +78 -0
- package/styles/date-range-picker.css +78 -0
- package/styles/date-time-picker.css +78 -0
- package/styles/descriptions.css +113 -0
- package/styles/drawer.css +215 -0
- package/styles/empty-state.css +110 -0
- package/styles/float-button.css +28 -0
- package/styles/font-provider.css +5 -0
- package/styles/form-field.css +1 -0
- package/styles/form-layout.css +62 -0
- package/styles/grid-basic.css +12 -0
- package/styles/hero-section.css +41 -0
- package/styles/image-compare.css +35 -0
- package/styles/logo-cloud.css +33 -0
- package/styles/marketing-template-layout.css +30 -0
- package/styles/media-card.css +41 -0
- package/styles/media-image.css +531 -0
- package/styles/modal.css +210 -0
- package/styles/notification-center.css +49 -0
- package/styles/notification.css +155 -0
- package/styles/page-header.css +184 -0
- package/styles/page-layout.css +117 -0
- package/styles/pagination.css +127 -0
- package/styles/profile-card.css +484 -0
- package/styles/qr-code.css +125 -0
- package/styles/quote-card.css +30 -0
- package/styles/radio-button.css +1 -0
- package/styles/radio-group.css +1 -0
- package/styles/select.css +1 -0
- package/styles/shape-mask.css +10 -0
- package/styles/sidebar.css +183 -0
- package/styles/skeleton.css +69 -0
- package/styles/sparkline.css +38 -0
- package/styles/split-section.css +34 -0
- package/styles/splitter.css +32 -0
- package/styles/statistic.css +107 -0
- package/styles/switch.css +1 -0
- package/styles/table.css +1 -0
- package/styles/text-area.css +1 -0
- package/styles/text-highlight.css +49 -0
- package/styles/text-input.css +1 -0
- package/styles/theme.css +1391 -0
- package/styles/time-picker.css +78 -0
- package/styles/timeline.css +126 -0
- package/styles/tour.css +138 -0
- package/styles/transfer-list.css +878 -0
- package/styles/tree-select.css +135 -0
- package/styles/tree-view.css +118 -0
- package/styles/upload-manager.css +40 -0
- package/styles/video-lightbox.css +639 -0
- package/styles/video-player.css +92 -0
- package/test/contracts.test.mjs +8 -0
- package/test/form-layout.test.mjs +28 -0
- package/test/isolation.test.mjs +36 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { el, attr, frame, lifecycle, common } from './shared.js';
|
|
2
|
+
import type { SelectOptions, FieldEvents, FieldComponent } from './types.js';
|
|
3
|
+
|
|
4
|
+
/** A styled listbox backed by a form-associated select; the native menu is never shown. */
|
|
5
|
+
export function createSelect(host: HTMLElement, initial: SelectOptions, events: FieldEvents<string> = {}): FieldComponent<SelectOptions, string> {
|
|
6
|
+
let p = { ...initial }, open = false, active = -1, prefix = '', prefixAt = 0;
|
|
7
|
+
const f = frame(host, p), shell = el('div', 'blu-select'), control = el('select', 'blu-select__native');
|
|
8
|
+
const trigger = el('button', 'blu-select__trigger'), clear = el('button', 'blu-text__action', '×'), popup = el('div', 'blu-select__popup');
|
|
9
|
+
const search = el('input', 'blu-select__search'), list = el('div', 'blu-select__list'), empty = el('p', 'blu-field__help', 'No matching options');
|
|
10
|
+
control.tabIndex = -1; control.setAttribute('aria-hidden', 'true'); control.dataset.enhanced = 'true';
|
|
11
|
+
trigger.type = clear.type = 'button'; trigger.id = f.id; trigger.setAttribute('role', 'combobox'); trigger.setAttribute('aria-haspopup', 'listbox');
|
|
12
|
+
list.id = f.id + '-list'; list.setAttribute('role', 'listbox'); trigger.setAttribute('aria-controls', list.id);
|
|
13
|
+
search.type = 'search'; search.placeholder = 'Search options'; search.setAttribute('role', 'combobox'); search.setAttribute('aria-autocomplete', 'list'); search.setAttribute('aria-controls', list.id);
|
|
14
|
+
popup.hidden = true; popup.append(search, list, empty); shell.append(control, trigger, clear, popup); f.body.append(shell);
|
|
15
|
+
const hasPopover = typeof popup.showPopover === 'function'; if (hasPopover) popup.setAttribute('popover', 'manual');
|
|
16
|
+
const life = lifecycle(f.root, reset); let visible: number[] = [];
|
|
17
|
+
function position() {
|
|
18
|
+
if (!open || !hasPopover) return; const r = trigger.getBoundingClientRect();
|
|
19
|
+
const below = window.innerHeight - r.bottom - 12, above = r.top - 12;
|
|
20
|
+
const up = below < 220 && above > below, height = Math.min(320, Math.max(100, up ? above : below));
|
|
21
|
+
popup.style.cssText = `position:fixed;inset:auto;margin:0;left:${Math.max(8, Math.min(r.left, window.innerWidth - r.width - 8))}px;width:${Math.min(r.width, window.innerWidth - 16)}px;max-height:${height}px;${up ? 'bottom:' + (window.innerHeight - r.top + 6) : 'top:' + (r.bottom + 6)}px;`;
|
|
22
|
+
}
|
|
23
|
+
function activeOption(index: number) {
|
|
24
|
+
active = index; list.querySelectorAll<HTMLElement>('[role=option]').forEach(node => {
|
|
25
|
+
const isActive = Number(node.dataset.index) === active; node.dataset.active = String(isActive);
|
|
26
|
+
if (isActive) node.scrollIntoView({ block: 'nearest' });
|
|
27
|
+
});
|
|
28
|
+
const id = active < 0 ? undefined : f.id + '-option-' + active;
|
|
29
|
+
attr(trigger, 'aria-activedescendant', open ? id : undefined); attr(search, 'aria-activedescendant', open ? id : undefined);
|
|
30
|
+
}
|
|
31
|
+
function renderOptions() {
|
|
32
|
+
visible = p.Options.map((_, i) => i).filter(i => p.Options[i].Label.toLocaleLowerCase().includes(search.value.toLocaleLowerCase()));
|
|
33
|
+
list.replaceChildren();
|
|
34
|
+
for (const i of visible) {
|
|
35
|
+
const o = p.Options[i], row = el('div', 'blu-select__option', o.Label); row.id = f.id + '-option-' + i;
|
|
36
|
+
row.setAttribute('role', 'option'); row.dataset.index = String(i); row.setAttribute('aria-selected', String(o.Value === control.value));
|
|
37
|
+
row.setAttribute('aria-disabled', String(!!o.Disabled)); if (o.Description) row.append(el('small', 'blu-choice__description', o.Description));
|
|
38
|
+
row.onpointerdown = event => event.preventDefault(); row.onclick = () => { if (!o.Disabled) choose(i); }; list.append(row);
|
|
39
|
+
}
|
|
40
|
+
empty.hidden = !!visible.length;
|
|
41
|
+
const enabled = visible.filter(i => !p.Options[i].Disabled);
|
|
42
|
+
activeOption(enabled.includes(active) ? active : (enabled.find(i => p.Options[i].Value === control.value) ?? enabled[0] ?? -1));
|
|
43
|
+
}
|
|
44
|
+
function show(value: boolean, focus = true) {
|
|
45
|
+
if (value && (p.Disabled || p.ReadOnly)) return;
|
|
46
|
+
open = value; trigger.setAttribute('aria-expanded', String(open)); search.setAttribute('aria-expanded', String(open));
|
|
47
|
+
if (open) { popup.hidden = false; if (hasPopover && !popup.matches(':popover-open')) popup.showPopover(); search.value = ''; active = -1; renderOptions(); position(); if (p.Searchable) search.focus(); }
|
|
48
|
+
else { if (hasPopover && popup.matches(':popover-open')) popup.hidePopover(); popup.hidden = true; activeOption(-1); if (focus) trigger.focus(); }
|
|
49
|
+
}
|
|
50
|
+
function choose(index: number) { p.Value = index < 0 ? '' : p.Options[index].Value; control.value = p.Value; paintValue(); show(false); events.Change?.(p.Value); }
|
|
51
|
+
function paintValue() {
|
|
52
|
+
trigger.textContent = p.Options.find(o => o.Value === control.value)?.Label || p.Placeholder || 'Choose an option';
|
|
53
|
+
trigger.dataset.placeholder = String(!control.value); clear.hidden = !p.Clearable || !control.value || !!p.ReadOnly;
|
|
54
|
+
if (control.validity.valid && !p.Error) { f.error.hidden = true; f.error.textContent = ''; f.paint(p, [trigger]); }
|
|
55
|
+
}
|
|
56
|
+
function update(patch: Partial<SelectOptions>) {
|
|
57
|
+
life.check(); p = { ...p, ...patch };
|
|
58
|
+
if (p.Options.some(o => !o.Value) || new Set(p.Options.map(o => o.Value)).size !== p.Options.length) throw Error('Select option values must be non-empty and unique.');
|
|
59
|
+
common(control, p); f.paint(p, [trigger]); control.id = f.id + '-native';
|
|
60
|
+
const placeholder = el('option', '', p.Placeholder || 'Choose an option'); placeholder.value = '';
|
|
61
|
+
control.replaceChildren(placeholder, ...p.Options.map(o => { const option = el('option', '', o.Label); option.value = o.Value; option.disabled = !!o.Disabled; return option; }));
|
|
62
|
+
control.value = p.Options.some(o => o.Value === p.Value) ? p.Value! : ''; p.Value = control.value;
|
|
63
|
+
trigger.disabled = clear.disabled = !!p.Disabled; attr(trigger, 'aria-readonly', p.ReadOnly ? 'true' : undefined);
|
|
64
|
+
clear.setAttribute('aria-label', 'Clear ' + (p.Label || 'selection')); search.setAttribute('aria-label', 'Search ' + (p.Label || 'options'));
|
|
65
|
+
list.setAttribute('aria-label', p.Label || 'Options'); search.hidden = !p.Searchable;
|
|
66
|
+
if (p.Disabled || p.ReadOnly) show(false, false); else if (open) { renderOptions(); position(); }
|
|
67
|
+
trigger.setAttribute('aria-expanded', String(open)); paintValue();
|
|
68
|
+
}
|
|
69
|
+
function key(event: KeyboardEvent) {
|
|
70
|
+
if (p.Disabled || p.ReadOnly) return;
|
|
71
|
+
const enabled = visible.filter(i => !p.Options[i].Disabled), from = enabled.indexOf(active);
|
|
72
|
+
if (event.key === 'Escape' && open) { event.preventDefault(); show(false); }
|
|
73
|
+
else if (event.key === 'Tab') show(false, false);
|
|
74
|
+
else if (['ArrowDown','ArrowUp','Home','End'].includes(event.key)) {
|
|
75
|
+
if (!open) { event.preventDefault(); show(true); return; }
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
const next = event.key === 'Home' ? 0 : event.key === 'End' ? enabled.length - 1 : Math.max(0, Math.min(enabled.length - 1, from + (event.key === 'ArrowDown' ? 1 : -1)));
|
|
78
|
+
activeOption(enabled[next] ?? -1);
|
|
79
|
+
} else if (event.key === 'Enter' || (event.key === ' ' && event.target !== search)) {
|
|
80
|
+
event.preventDefault(); if (!open) show(true); else if (active >= 0) choose(active);
|
|
81
|
+
} else if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && event.target !== search) {
|
|
82
|
+
event.preventDefault(); if (!open) show(true);
|
|
83
|
+
prefix = Date.now() - prefixAt > 650 ? event.key : prefix + event.key; prefixAt = Date.now();
|
|
84
|
+
const next = visible.find(i => !p.Options[i].Disabled && p.Options[i].Label.toLocaleLowerCase().startsWith(prefix.toLocaleLowerCase())); if (next !== undefined) activeOption(next);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function reset() { update({ Value: initial.Value || '' }); show(false, false); }
|
|
88
|
+
trigger.addEventListener('click', () => show(!open), { signal: life.signal }); clear.addEventListener('click', () => choose(-1), { signal: life.signal });
|
|
89
|
+
shell.addEventListener('keydown', key, { signal: life.signal }); search.addEventListener('input', renderOptions, { signal: life.signal });
|
|
90
|
+
document.addEventListener('pointerdown', e => { if (open && !f.root.contains(e.target as Node)) show(false, false); }, { signal: life.signal });
|
|
91
|
+
shell.addEventListener('focusout', e => { if (!shell.contains(e.relatedTarget as Node)) { show(false, false); events.Blur?.(); } }, { signal: life.signal });
|
|
92
|
+
window.addEventListener('resize', position, { signal: life.signal }); window.addEventListener('scroll', position, { signal: life.signal, capture: true });
|
|
93
|
+
control.addEventListener('invalid', e => { e.preventDefault(); attr(trigger, 'aria-invalid', 'true'); f.error.textContent = control.validationMessage; f.error.hidden = false; attr(trigger, 'aria-describedby', f.error.id); trigger.focus(); }, { signal: life.signal });
|
|
94
|
+
control.addEventListener('change', () => { p.Value = control.value; paintValue(); events.Change?.(control.value); }, { signal: life.signal });
|
|
95
|
+
update({});
|
|
96
|
+
return { element: f.root, control, update, reset, getValue: () => control.value, focus: () => trigger.focus(), validate: () => control.reportValidity(), destroy() { show(false, false); life.destroy(); } };
|
|
97
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { FieldOptions } from './types.js';
|
|
2
|
+
export function el<K extends keyof HTMLElementTagNameMap>(tag: K, cls = '', text?: string) {
|
|
3
|
+
const node = document.createElement(tag); node.className = cls;
|
|
4
|
+
if (text !== undefined) node.textContent = text;
|
|
5
|
+
return node;
|
|
6
|
+
}
|
|
7
|
+
let sequence = 0;
|
|
8
|
+
export function uid() { return 'blu-field-' + (++sequence) + '-' + Math.random().toString(36).slice(2, 8); }
|
|
9
|
+
export function attr(node: Element, name: string, value?: string | number | boolean) {
|
|
10
|
+
if (value === undefined || value === false || value === '') node.removeAttribute(name);
|
|
11
|
+
else node.setAttribute(name, String(value));
|
|
12
|
+
}
|
|
13
|
+
export function frame(host: HTMLElement, options: FieldOptions, group = false) {
|
|
14
|
+
const root = el(group ? 'fieldset' : 'div', 'blu-field');
|
|
15
|
+
const label = el(group ? 'legend' : 'label', 'blu-field__label');
|
|
16
|
+
const body = el('div', 'blu-field__body'), description = el('div', 'blu-field__help'), error = el('div', 'blu-field__error');
|
|
17
|
+
const id = options.Id || uid(); description.id = id + '-help'; error.id = id + '-error'; error.setAttribute('aria-live', 'polite');
|
|
18
|
+
root.append(label, body, description, error); host.append(root);
|
|
19
|
+
function paint(p: FieldOptions, controls: HTMLElement[]) {
|
|
20
|
+
root.className = 'blu-field blu-field--' + (p.Size || 'Medium').toLowerCase() + (p.ExtendedClass ? ' ' + p.ExtendedClass : '');
|
|
21
|
+
root.dataset.invalid = String(!!p.Error); root.dataset.disabled = String(!!p.Disabled);
|
|
22
|
+
label.textContent = (p.Label || '') + (p.Required ? ' *' : ''); label.hidden = !p.Label;
|
|
23
|
+
if (!group && controls[0]) { controls[0].id ||= id; label.setAttribute('for', controls[0].id); }
|
|
24
|
+
description.textContent = p.Description || ''; description.hidden = !p.Description;
|
|
25
|
+
error.textContent = p.Error || ''; error.hidden = !p.Error;
|
|
26
|
+
const described = [p.Description ? description.id : '', p.Error ? error.id : ''].filter(Boolean).join(' ');
|
|
27
|
+
for (const control of controls) {
|
|
28
|
+
attr(control, 'aria-describedby', described); attr(control, 'aria-invalid', p.Error ? 'true' : undefined);
|
|
29
|
+
attr(control, 'aria-required', p.Required ? 'true' : undefined);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return { root, label, body, description, error, id, paint };
|
|
33
|
+
}
|
|
34
|
+
export function lifecycle(root: HTMLElement, reset: () => void) {
|
|
35
|
+
const abort = new AbortController(); let disposed = false;
|
|
36
|
+
// Native form reset is cancelable and restores values after event dispatch.
|
|
37
|
+
const form = root.closest('form');
|
|
38
|
+
form?.addEventListener('reset', event => queueMicrotask(() => { if (!disposed && !event.defaultPrevented) reset(); }), { signal: abort.signal });
|
|
39
|
+
return {
|
|
40
|
+
signal: abort.signal,
|
|
41
|
+
check() { if (disposed) throw Error('Component is destroyed.'); },
|
|
42
|
+
destroy() { if (disposed) return; disposed = true; abort.abort(); root.remove(); },
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function common(control: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement, p: FieldOptions) {
|
|
46
|
+
control.name = p.Name || ''; control.disabled = !!p.Disabled; control.required = !!p.Required;
|
|
47
|
+
if ('readOnly' in control) control.readOnly = !!p.ReadOnly;
|
|
48
|
+
control.setCustomValidity(p.Error || '');
|
|
49
|
+
}
|
|
50
|
+
export function bound(value: number | undefined, fallback: number, min: number, max: number) {
|
|
51
|
+
return Number.isFinite(value) ? Math.max(min, Math.min(max, value!)) : fallback;
|
|
52
|
+
}
|
|
53
|
+
export function imageUrl(value: string) {
|
|
54
|
+
const url = new URL(value, document.baseURI);
|
|
55
|
+
if (!['http:', 'https:'].includes(url.protocol)) throw Error('Adornment images must use an HTTP(S) or relative URL.');
|
|
56
|
+
return url.href;
|
|
57
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { el, bound, uid } from './shared.js';
|
|
2
|
+
import type { TableOptions, TableEvents } from './types.js';
|
|
3
|
+
|
|
4
|
+
export function tableRows<Row extends object>(options: TableOptions<Row>) {
|
|
5
|
+
const rows = [...options.Rows], key = options.SortKey;
|
|
6
|
+
if (key && options.Columns.some(c => c.Key === key && c.Sortable)) rows.sort((a, b) => {
|
|
7
|
+
const x = a[key], y = b[key]; if (x == null || y == null) return x == null ? (y == null ? 0 : 1) : -1;
|
|
8
|
+
const difference = typeof x === 'number' && typeof y === 'number' ? x - y : String(x).localeCompare(String(y), undefined, { numeric: true, sensitivity: 'base' });
|
|
9
|
+
return options.SortDirection === 'Descending' ? -difference : difference;
|
|
10
|
+
});
|
|
11
|
+
const size = options.PageSize ? Math.floor(bound(options.PageSize, 10, 1, 10000)) : Math.max(1, rows.length);
|
|
12
|
+
const pages = Math.max(1, Math.ceil(rows.length / size)), page = Math.floor(bound(options.Page, 1, 1, pages));
|
|
13
|
+
return { rows: rows.slice((page - 1) * size, page * size), page, pages, total: rows.length, start: rows.length ? (page - 1) * size + 1 : 0, end: Math.min(page * size, rows.length) };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Semantic HTML table, client-side sorting/paging, no grid engine or editing model. */
|
|
17
|
+
export function createTable<Row extends object>(host: HTMLElement, initial: TableOptions<Row>, events: TableEvents<Row> = {}) {
|
|
18
|
+
let p = { ...initial }, disposed = false; const root = el('div', 'blu-table'), scroll = el('div', 'blu-table__scroll');
|
|
19
|
+
const table = el('table'), caption = el('caption'), head = el('thead'), body = el('tbody'), footer = el('div', 'blu-table__footer');
|
|
20
|
+
const status = el('span'), previous = el('button', 'blu-table-button', 'Previous'), next = el('button', 'blu-table-button', 'Next');
|
|
21
|
+
let headerSignature = '';
|
|
22
|
+
caption.id = uid(); scroll.tabIndex = 0; scroll.setAttribute('role', 'region'); scroll.setAttribute('aria-labelledby', caption.id);
|
|
23
|
+
previous.type = next.type = 'button'; status.setAttribute('role', 'status'); footer.append(status, previous, next); table.append(caption, head, body); scroll.append(table); root.append(scroll, footer); host.append(root);
|
|
24
|
+
function update(patch: Partial<TableOptions<Row>>) {
|
|
25
|
+
if (disposed) throw Error('Component is destroyed.'); p = { ...p, ...patch };
|
|
26
|
+
if (!p.Columns.length) throw Error('Table needs at least one column.');
|
|
27
|
+
if (new Set(p.Columns.map(c => c.Key)).size !== p.Columns.length) throw Error('Table column keys must be unique.');
|
|
28
|
+
root.className = 'blu-table' + (p.ExtendedClass ? ' ' + p.ExtendedClass : ''); root.dataset.density = p.Density || 'Comfortable'; root.dataset.striped = String(!!p.Striped);
|
|
29
|
+
table.setAttribute('aria-busy', String(!!p.Loading)); caption.textContent = p.Caption;
|
|
30
|
+
const focused = document.activeElement instanceof HTMLElement && root.contains(document.activeElement) ? document.activeElement.dataset.focusKey : undefined;
|
|
31
|
+
const focusedPagination = document.activeElement === next ? next : document.activeElement === previous ? previous : undefined;
|
|
32
|
+
const nextHeaderSignature = JSON.stringify([p.Columns.map(c => [c.Key, c.Header, !!c.Sortable, c.Align || 'Left']), !!p.Actions?.length]);
|
|
33
|
+
// Retain sortable header controls during sorting, paging and row updates.
|
|
34
|
+
// VoiceOver can activate a header without moving DOM keyboard focus to it.
|
|
35
|
+
if (nextHeaderSignature !== headerSignature) {
|
|
36
|
+
headerSignature = nextHeaderSignature;
|
|
37
|
+
head.replaceChildren(); const tr = el('tr'); head.append(tr);
|
|
38
|
+
for (const column of p.Columns) {
|
|
39
|
+
const th = el('th'); th.scope = 'col'; th.style.textAlign = (column.Align || 'Left').toLowerCase();
|
|
40
|
+
if (column.Sortable) {
|
|
41
|
+
const button = el('button', 'blu-table__sort', column.Header); button.type = 'button'; button.dataset.focusKey = 'sort-' + column.Key;
|
|
42
|
+
const glyph = el('span'); glyph.setAttribute('aria-hidden', 'true'); button.append(glyph);
|
|
43
|
+
button.onclick = () => { const direction = p.SortKey === column.Key && p.SortDirection !== 'Descending' ? 'Descending' : 'Ascending'; update({ SortKey: column.Key, SortDirection: direction, Page: 1 } as Partial<TableOptions<Row>>); events.SortChanged?.(column.Key, direction); };
|
|
44
|
+
th.append(button);
|
|
45
|
+
} else th.textContent = column.Header; tr.append(th);
|
|
46
|
+
}
|
|
47
|
+
if (p.Actions?.length) { const th = el('th', '', 'Actions'); th.scope = 'col'; tr.append(th); }
|
|
48
|
+
}
|
|
49
|
+
p.Columns.forEach((column, index) => {
|
|
50
|
+
if (!column.Sortable) return;
|
|
51
|
+
const th = head.rows[0].cells[index];
|
|
52
|
+
th.setAttribute('aria-sort', p.SortKey === column.Key ? (p.SortDirection || 'Ascending').toLowerCase() : 'none');
|
|
53
|
+
th.querySelector('span')!.textContent = p.SortKey === column.Key ? (p.SortDirection === 'Descending' ? '↓' : '↑') : '↕';
|
|
54
|
+
});
|
|
55
|
+
const state = tableRows(p); p.Page = state.page; body.replaceChildren();
|
|
56
|
+
if (p.Loading || !state.rows.length) {
|
|
57
|
+
const row = el('tr'), cell = el('td', 'blu-table__empty', p.Loading ? 'Loading records…' : (p.EmptyMessage || 'No records yet.')); cell.colSpan = p.Columns.length + (p.Actions?.length ? 1 : 0); row.append(cell); body.append(row);
|
|
58
|
+
} else for (const [index, row] of state.rows.entries()) {
|
|
59
|
+
const rowEl = el('tr'); for (const column of p.Columns) {
|
|
60
|
+
const cell = el('td'); cell.style.textAlign = (column.Align || 'Left').toLowerCase();
|
|
61
|
+
cell.textContent = column.Format ? column.Format(row[column.Key], row) : String(row[column.Key] ?? '—'); rowEl.append(cell);
|
|
62
|
+
}
|
|
63
|
+
if (p.Actions?.length) { const cell = el('td'), actions = el('div', 'blu-table__actions');
|
|
64
|
+
for (const action of p.Actions) {
|
|
65
|
+
const button = el('button', 'blu-table-button', action.Label); button.type = 'button'; button.disabled = typeof action.Disabled === 'function' ? action.Disabled(row) : !!action.Disabled;
|
|
66
|
+
button.dataset.focusKey = 'row-' + String(p.RowKey ? row[p.RowKey] : index) + '-' + action.Key;
|
|
67
|
+
if (p.RowKey) button.setAttribute('aria-label', action.Label + ' ' + String(row[p.RowKey]));
|
|
68
|
+
button.onclick = () => events.RowAction?.(action.Key, row); actions.append(button);
|
|
69
|
+
} cell.append(actions); rowEl.append(cell);
|
|
70
|
+
} body.append(rowEl);
|
|
71
|
+
}
|
|
72
|
+
status.textContent = p.Loading ? 'Loading records…' : `${state.start}–${state.end} of ${state.total} records`;
|
|
73
|
+
previous.hidden = next.hidden = !p.PageSize; previous.disabled = !!p.Loading || state.page <= 1; next.disabled = !!p.Loading || state.page >= state.pages;
|
|
74
|
+
previous.onclick = () => { update({ Page: state.page - 1 } as Partial<TableOptions<Row>>); events.PageChanged?.(p.Page!); };
|
|
75
|
+
next.onclick = () => { update({ Page: state.page + 1 } as Partial<TableOptions<Row>>); events.PageChanged?.(p.Page!); };
|
|
76
|
+
if (focused) Array.from(root.querySelectorAll<HTMLElement>('[data-focus-key]')).find(node => node.dataset.focusKey === focused)?.focus();
|
|
77
|
+
// Safari restarts Tab navigation at the page top if the focused pagination
|
|
78
|
+
// button becomes disabled. Keep the user at the available adjacent control.
|
|
79
|
+
if (!p.Loading && p.PageSize) {
|
|
80
|
+
if (focusedPagination === next && next.disabled) (previous.disabled ? scroll : previous).focus();
|
|
81
|
+
else if (focusedPagination === previous && previous.disabled) (next.disabled ? scroll : next).focus();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
try { update({}); } catch (error) { root.remove(); throw error; }
|
|
85
|
+
return { element: root, update, getState: () => ({ Page: p.Page || 1, SortKey: p.SortKey, SortDirection: p.SortDirection || 'Ascending' }), destroy() { if (disposed) return; disposed = true; root.remove(); } };
|
|
86
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { el, attr, frame, lifecycle, common, bound, imageUrl } from './shared.js';
|
|
2
|
+
import type { Adornment, TextInputOptions, TextInputEvents, TextAreaOptions, FieldEvents, FieldComponent } from './types.js';
|
|
3
|
+
|
|
4
|
+
export function createTextInput(host: HTMLElement, initial: TextInputOptions = {}, events: TextInputEvents = {}): FieldComponent<TextInputOptions, string> {
|
|
5
|
+
let p = { ...initial }, revealed = false;
|
|
6
|
+
const f = frame(host, p), shell = el('div', 'blu-text'), input = el('input', 'blu-text__input');
|
|
7
|
+
const leading = el('span', 'blu-text__adornment'), trailing = el('span', 'blu-text__adornment');
|
|
8
|
+
const clear = el('button', 'blu-text__action', '×'), reveal = el('button', 'blu-text__action', 'Show');
|
|
9
|
+
clear.type = reveal.type = 'button'; clear.setAttribute('aria-label', 'Clear ' + (p.Label || 'text'));
|
|
10
|
+
shell.append(leading, input, trailing, clear, reveal); f.body.append(shell);
|
|
11
|
+
const life = lifecycle(f.root, reset);
|
|
12
|
+
const adornmentKinds = new WeakMap<HTMLElement, Adornment['Kind']>();
|
|
13
|
+
function adorn(target: HTMLElement, value?: Adornment) {
|
|
14
|
+
// Keep an existing action alive while validation/state updates run. Replacing
|
|
15
|
+
// the focused button leaves VoiceOver pointing at a detached control.
|
|
16
|
+
if (adornmentKinds.get(target) !== value?.Kind) target.replaceChildren();
|
|
17
|
+
target.removeAttribute('role'); target.removeAttribute('aria-label'); target.removeAttribute('aria-hidden'); target.hidden = !value;
|
|
18
|
+
if (!value) { adornmentKinds.delete(target); return; }
|
|
19
|
+
adornmentKinds.set(target, value.Kind);
|
|
20
|
+
if (value.Kind === 'Image') { const img = target.querySelector('img') || el('img'); const src = imageUrl(value.Src); if (img.src !== src) img.src = src; img.alt = value.Alt; if (!img.parentNode) target.append(img); }
|
|
21
|
+
else if (value.Kind === 'Action') {
|
|
22
|
+
const button = target.querySelector('button') || el('button', 'blu-text__action'); button.type = 'button'; button.textContent = value.Text; button.setAttribute('aria-label', value.Label);
|
|
23
|
+
button.disabled = !!p.Disabled || !!p.ReadOnly; button.onclick = () => events.Action?.(value.Key, input.value); if (!button.parentNode) target.append(button);
|
|
24
|
+
} else { target.textContent = value.Text; if (value.Kind === 'Icon') { attr(target, 'role', value.Label ? 'img' : undefined); attr(target, 'aria-label', value.Label); attr(target, 'aria-hidden', value.Label ? undefined : 'true'); } }
|
|
25
|
+
}
|
|
26
|
+
function refreshActions() { clear.hidden = !p.Clearable || !input.value || !!p.ReadOnly; reveal.hidden = !p.RevealPassword || p.Type !== 'password'; }
|
|
27
|
+
function update(patch: Partial<TextInputOptions>) {
|
|
28
|
+
life.check(); p = { ...p, ...patch }; f.paint(p, [input]); common(input, p);
|
|
29
|
+
input.type = p.Type === 'password' && revealed ? 'text' : (p.Type || 'text');
|
|
30
|
+
if (input.value !== (p.Value || '')) input.value = p.Value || '';
|
|
31
|
+
input.placeholder = p.Placeholder || ''; attr(input, 'maxlength', p.MaxLength === undefined ? undefined : Math.max(0, Math.floor(p.MaxLength)));
|
|
32
|
+
attr(input, 'autocomplete', p.Autocomplete); adorn(leading, p.Leading); adorn(trailing, p.Trailing);
|
|
33
|
+
clear.disabled = reveal.disabled = !!p.Disabled; clear.setAttribute('aria-label', 'Clear ' + (p.Label || 'text'));
|
|
34
|
+
reveal.textContent = revealed ? 'Hide' : 'Show'; reveal.setAttribute('aria-label', revealed ? 'Hide password' : 'Show password');
|
|
35
|
+
reveal.setAttribute('aria-pressed', String(revealed)); refreshActions();
|
|
36
|
+
}
|
|
37
|
+
function changed() { p.Value = input.value; refreshActions(); events.Change?.(input.value); }
|
|
38
|
+
function reset() { revealed = false; update({ Value: initial.Value || '' }); }
|
|
39
|
+
input.addEventListener('input', changed, { signal: life.signal });
|
|
40
|
+
input.addEventListener('blur', () => events.Blur?.(), { signal: life.signal });
|
|
41
|
+
clear.addEventListener('click', () => { input.value = ''; changed(); input.focus(); }, { signal: life.signal });
|
|
42
|
+
reveal.addEventListener('click', () => { revealed = !revealed; update({}); input.focus(); }, { signal: life.signal });
|
|
43
|
+
update({});
|
|
44
|
+
return { element: f.root, control: input, update, reset, getValue: () => input.value, focus: () => input.focus(), validate: () => input.reportValidity(), destroy: life.destroy };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function createTextArea(host: HTMLElement, initial: TextAreaOptions = {}, events: FieldEvents<string> = {}): FieldComponent<TextAreaOptions, string> {
|
|
48
|
+
let p = { ...initial };
|
|
49
|
+
const f = frame(host, p), input = el('textarea', 'blu-textarea'), count = el('div', 'blu-field__count');
|
|
50
|
+
count.id = f.id + '-count'; f.body.append(input, count); const life = lifecycle(f.root, reset);
|
|
51
|
+
function resize() {
|
|
52
|
+
count.hidden = !p.ShowCount; count.textContent = input.value.length + (p.MaxLength === undefined ? ' characters' : ' / ' + p.MaxLength);
|
|
53
|
+
input.style.maxHeight = p.AutoGrow ? bound(p.MaxHeight, 320, 80, 2000) + 'px' : '';
|
|
54
|
+
input.style.resize = p.AutoGrow ? 'none' : 'vertical';
|
|
55
|
+
input.style.height = ''; if (p.AutoGrow) input.style.height = Math.min(input.scrollHeight + 2, bound(p.MaxHeight, 320, 80, 2000)) + 'px';
|
|
56
|
+
}
|
|
57
|
+
function update(patch: Partial<TextAreaOptions>) {
|
|
58
|
+
life.check(); p = { ...p, ...patch }; f.paint(p, [input]); common(input, p);
|
|
59
|
+
input.rows = Math.floor(bound(p.Rows, 4, 1, 30)); input.placeholder = p.Placeholder || '';
|
|
60
|
+
attr(input, 'maxlength', p.MaxLength === undefined ? undefined : Math.max(0, Math.floor(p.MaxLength)));
|
|
61
|
+
if (input.value !== (p.Value || '')) input.value = p.Value || '';
|
|
62
|
+
if (p.ShowCount) attr(input, 'aria-describedby', [input.getAttribute('aria-describedby'), count.id].filter(Boolean).join(' '));
|
|
63
|
+
resize();
|
|
64
|
+
}
|
|
65
|
+
function reset() { update({ Value: initial.Value || '' }); }
|
|
66
|
+
input.addEventListener('input', () => { p.Value = input.value; resize(); events.Change?.(input.value); }, { signal: life.signal });
|
|
67
|
+
input.addEventListener('blur', () => events.Blur?.(), { signal: life.signal });
|
|
68
|
+
let lastWidth = 0;
|
|
69
|
+
// Observe the host width only; height changes from auto-grow must not feed back.
|
|
70
|
+
const widthObserver = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(entries => { const w = entries[0].contentRect.width; if (w !== lastWidth) { lastWidth = w; resize(); } }) : undefined;
|
|
71
|
+
widthObserver?.observe(f.root); update({});
|
|
72
|
+
return { element: f.root, control: input, update, reset, getValue: () => input.value, focus: () => input.focus(), validate: () => input.reportValidity(), destroy() { widthObserver?.disconnect(); life.destroy(); } };
|
|
73
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Local Community additions. Not present in the published 1.0.1 package. */
|
|
2
|
+
export type FieldSize = 'Small' | 'Medium' | 'Large';
|
|
3
|
+
export interface FieldOptions {
|
|
4
|
+
Id?: string; Name?: string; Label?: string; Description?: string; Error?: string;
|
|
5
|
+
Required?: boolean; Disabled?: boolean; ReadOnly?: boolean; Size?: FieldSize;
|
|
6
|
+
ExtendedClass?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FieldEvents<T> { Change?: (value: T) => void; Blur?: () => void; }
|
|
9
|
+
export interface FieldComponent<P, T> {
|
|
10
|
+
element: HTMLElement; control: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
|
|
11
|
+
update(patch: Partial<P>): void; getValue(): T; reset(): void; focus(): void;
|
|
12
|
+
validate(): boolean; destroy(): void;
|
|
13
|
+
}
|
|
14
|
+
export type Adornment =
|
|
15
|
+
| { Kind: 'Text'; Text: string }
|
|
16
|
+
| { Kind: 'Icon'; Text: string; Label?: string }
|
|
17
|
+
| { Kind: 'Image'; Src: string; Alt: string }
|
|
18
|
+
| { Kind: 'Action'; Text: string; Label: string; Key: string };
|
|
19
|
+
export interface TextInputOptions extends FieldOptions {
|
|
20
|
+
Value?: string; Type?: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url';
|
|
21
|
+
Placeholder?: string; MaxLength?: number; Autocomplete?: string;
|
|
22
|
+
Leading?: Adornment; Trailing?: Adornment; Clearable?: boolean; RevealPassword?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface TextInputEvents extends FieldEvents<string> { Action?: (key: string, value: string) => void; }
|
|
25
|
+
export interface TextAreaOptions extends FieldOptions {
|
|
26
|
+
Value?: string; Placeholder?: string; Rows?: number; MaxLength?: number;
|
|
27
|
+
AutoGrow?: boolean; MaxHeight?: number; ShowCount?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface CheckboxOptions extends FieldOptions { Checked?: boolean; Indeterminate?: boolean; Value?: string; }
|
|
30
|
+
export interface SwitchOptions extends FieldOptions { Checked?: boolean; OnText?: string; OffText?: string; }
|
|
31
|
+
export interface RadioButtonOptions extends FieldOptions { Checked?: boolean; Value: string; }
|
|
32
|
+
export interface Choice { Value: string; Label: string; Description?: string; Disabled?: boolean; }
|
|
33
|
+
export interface RadioGroupOptions extends FieldOptions { Value?: string; Options: Choice[]; Direction?: 'Horizontal' | 'Vertical'; }
|
|
34
|
+
export interface SelectOptions extends FieldOptions { Value?: string; Options: Choice[]; Placeholder?: string; Clearable?: boolean; Searchable?: boolean; }
|
|
35
|
+
export interface FormFieldOptions extends FieldOptions { Control?: HTMLElement; }
|
|
36
|
+
export interface ColumnsOptions {
|
|
37
|
+
Ratio?: 'Equal' | 'OneThirdTwoThirds' | 'TwoThirdsOneThird' | 'OneQuarterThreeQuarters' | 'ThreeQuartersOneQuarter' | 'WideCenter';
|
|
38
|
+
/** Match column heights within a row and stretch a single content wrapper. Stacked rows keep natural height. */
|
|
39
|
+
EqualHeight?: boolean;
|
|
40
|
+
Gap?: number; Align?: 'Start' | 'Center' | 'End' | 'Stretch';
|
|
41
|
+
StackAt?: 'Small' | 'Medium' | 'Large'; ExtendedClass?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ColumnsComponent { element: HTMLElement; columns: HTMLElement[]; update(patch: Partial<ColumnsOptions>): void; destroy(): void; }
|
|
44
|
+
export interface TableColumn<Row extends object> {
|
|
45
|
+
Key: Extract<keyof Row, string>; Header: string; Sortable?: boolean; Align?: 'Left' | 'Center' | 'Right';
|
|
46
|
+
Format?: (value: Row[Extract<keyof Row, string>], row: Row) => string;
|
|
47
|
+
}
|
|
48
|
+
export interface TableAction<Row> { Key: string; Label: string; Disabled?: boolean | ((row: Row) => boolean); }
|
|
49
|
+
export interface TableOptions<Row extends object> {
|
|
50
|
+
Columns: TableColumn<Row>[]; Rows: Row[]; Caption: string; RowKey?: Extract<keyof Row, string>;
|
|
51
|
+
Actions?: TableAction<Row>[]; Loading?: boolean; EmptyMessage?: string;
|
|
52
|
+
PageSize?: number; Page?: number; SortKey?: Extract<keyof Row, string>; SortDirection?: 'Ascending' | 'Descending';
|
|
53
|
+
Density?: 'Compact' | 'Comfortable'; Striped?: boolean; ExtendedClass?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface TableEvents<Row> {
|
|
56
|
+
RowAction?: (key: string, row: Row) => void;
|
|
57
|
+
SortChanged?: (key: Extract<keyof Row, string>, direction: 'Ascending' | 'Descending') => void;
|
|
58
|
+
PageChanged?: (page: number) => void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './checkbox.js';
|
|
2
|
+
export * from './text-input.js';
|
|
3
|
+
export * from './text-area.js';
|
|
4
|
+
export * from './radio-button.js';
|
|
5
|
+
export * from './radio-group.js';
|
|
6
|
+
export * from './switch.js';
|
|
7
|
+
export * from './select.js';
|
|
8
|
+
export * from './form-field.js';
|
|
9
|
+
export * from './columns2.js';
|
|
10
|
+
export * from './columns3.js';
|
|
11
|
+
export * from './columns4.js';
|
|
12
|
+
export * from './table.js';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** BluGrid Basic — a deliberately small, read-only Community adapter. */
|
|
2
|
+
import {createGrid,themeQuartz,ClientSideRowModelModule,TextFilterModule,NumberFilterModule,DateFilterModule,RenderApiModule,PaginationModule,RowSelectionModule,ColumnAutoSizeModule,CellStyleModule,type ColDef,type GridApi} from 'ag-grid-community';
|
|
3
|
+
import {normalizeOptions,formatValue,parseDate,type Row,type GridBasicOptions,type GridBasicEvents,type NormalizedOptions} from './grid-spec.js';
|
|
4
|
+
export type {BasicColumn,ColumnType,Row,GridBasicOptions,GridBasicEvents} from './grid-spec.js';
|
|
5
|
+
export interface GridBasic {
|
|
6
|
+
readonly element:HTMLElement;
|
|
7
|
+
/** Validated input update. The underlying grid API is intentionally private. */
|
|
8
|
+
update(patch:Partial<GridBasicOptions>):void;
|
|
9
|
+
clearSelection():void;
|
|
10
|
+
destroy():void;
|
|
11
|
+
}
|
|
12
|
+
const modules=[ClientSideRowModelModule,TextFilterModule,NumberFilterModule,DateFilterModule,RenderApiModule,PaginationModule,RowSelectionModule,ColumnAutoSizeModule,CellStyleModule];
|
|
13
|
+
const theme=themeQuartz.withParams({accentColor:'var(--bluui-primary, #5144ed)',backgroundColor:'var(--bluui-surface, #fff)',foregroundColor:'var(--bluui-text, #182333)',borderColor:'var(--bluui-border, #dce3ed)',headerBackgroundColor:'var(--bluui-surface-muted, #f4f6fa)',headerTextColor:'var(--bluui-text-muted, #68758b)',rowHoverColor:'var(--bluui-surface-muted, #f4f6fa)',selectedRowBackgroundColor:'var(--bluui-primary-soft, #edeaff)',fontFamily:'var(--blu-font-family, system-ui)',fontSize:14,headerFontSize:12,headerFontWeight:600,rowHeight:44,headerHeight:44,wrapperBorderRadius:12,browserColorScheme:'inherit'});
|
|
14
|
+
const copy=(r:Row|undefined)=>r?{...r}:null;
|
|
15
|
+
function columns(p:NormalizedOptions):ColDef<Row>[] {
|
|
16
|
+
return p.Columns.map(c=>{const type=c.Type||'Text';const isDate=type==='Date'||type==='DateTime';return {
|
|
17
|
+
field:c.Field,colId:c.Field,headerName:c.Header??c.Field,minWidth:c.MinWidth||100,width:c.Width,flex:c.Width?undefined:1,
|
|
18
|
+
sortable:c.IsSortable!==false,filter:c.IsFilterable===false?false:(isDate?'agDateColumnFilter':type==='Number'||type==='Currency'?'agNumberColumnFilter':'agTextColumnFilter'),
|
|
19
|
+
editable:false,cellDataType:false,suppressMovable:true,lockPinned:true,
|
|
20
|
+
valueFormatter:({value})=>formatValue(value,type,p),
|
|
21
|
+
filterValueGetter:({data})=>isDate?parseDate(data?.[c.Field],type==='DateTime'):type==='Boolean'?formatValue(data?.[c.Field],type,p):data?.[c.Field],
|
|
22
|
+
filterParams:{maxNumConditions:1,...(isDate?{comparator:(local:Date,v:unknown)=>{if(!(v instanceof Date))return -1;const parts=new Intl.DateTimeFormat('en-CA',{timeZone:type==='Date'?'UTC':p.TimeZone,year:'numeric',month:'2-digit',day:'2-digit'}).formatToParts(v);const val=(k:string)=>Number(parts.find(x=>x.type===k)?.value);const t=new Date(val('year'),val('month')-1,val('day')).getTime();return Math.sign(t-local.getTime());}}:{})},
|
|
23
|
+
cellClass:type==='Number'||type==='Currency'?'blu-grid-basic__number':undefined,
|
|
24
|
+
};});
|
|
25
|
+
}
|
|
26
|
+
export function createGridBasic(host:HTMLElement,input:GridBasicOptions,events:GridBasicEvents={}):GridBasic {
|
|
27
|
+
let p=normalizeOptions(input),disposed=false,api:GridApi<Row>;
|
|
28
|
+
if(!host.isConnected)throw Error('Mount BluGrid Basic into a connected element.');
|
|
29
|
+
const root=document.createElement('div');host.append(root);
|
|
30
|
+
const appearance=()=>{root.className='blu-grid-basic'+(p.ExtendedClass?' '+p.ExtendedClass:'');root.style.height=p.Height;};appearance();
|
|
31
|
+
try { api=createGrid<Row>(root,{
|
|
32
|
+
theme,rowData:p.Rows,columnDefs:columns(p),getRowId:({data})=>String(data[p.RowKeyField]),
|
|
33
|
+
rowModelType:'clientSide',pagination:p.EnablePagination,paginationPageSize:p.PageSize,paginationPageSizeSelector:false,
|
|
34
|
+
rowSelection:p.EnableSelection?{mode:'singleRow',enableClickSelection:true,checkboxes:false}:undefined,
|
|
35
|
+
suppressMultiSort:true,suppressMovableColumns:true,animateRows:false,ensureDomOrder:true,
|
|
36
|
+
defaultColDef:{resizable:true,editable:false},enableCellTextSelection:true,
|
|
37
|
+
onGridReady:()=>events.Ready?.(),onRowClicked:e=>{if(e.data)events.RowClicked?.({...e.data});},
|
|
38
|
+
onSelectionChanged:e=>events.SelectionChanged?.(copy(e.api.getSelectedRows()[0])),
|
|
39
|
+
},{modules});api.setGridAriaProperty('label',p.AccessibleLabel);
|
|
40
|
+
}catch(error){root.remove();throw error;}
|
|
41
|
+
return {element:root,update(patch){if(disposed)throw Error('Grid is destroyed.');const next=normalizeOptions({...p,...patch});if(next.RowKeyField!==p.RowKeyField)throw Error('RowKeyField cannot change after initialization.');const changeColumns=JSON.stringify(next.Columns)!==JSON.stringify(p.Columns)||next.Locale!==p.Locale||next.Currency!==p.Currency||next.TimeZone!==p.TimeZone;
|
|
42
|
+
const selectionChanged=next.EnableSelection!==p.EnableSelection;p=next;appearance();
|
|
43
|
+
api.updateGridOptions({rowData:p.Rows,...(changeColumns?{columnDefs:columns(p)}:{}),pagination:p.EnablePagination,paginationPageSize:p.PageSize,...(selectionChanged?{rowSelection:p.EnableSelection?{mode:'singleRow' as const,enableClickSelection:true,checkboxes:false}:undefined}:{})});
|
|
44
|
+
if(selectionChanged&&!p.EnableSelection)api.deselectAll();api.setGridAriaProperty('label',p.AccessibleLabel);
|
|
45
|
+
},clearSelection(){if(!disposed)api.deselectAll();},destroy(){if(disposed)return;disposed=true;api.destroy();root.remove();}};
|
|
46
|
+
}
|
package/src/grid-spec.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/** Closed, read-only contract. No AG Grid options or engine API escape hatch. */
|
|
2
|
+
export type Row = Record<string, string | number | boolean | null>;
|
|
3
|
+
export type ColumnType = 'Text' | 'Number' | 'Currency' | 'Date' | 'DateTime' | 'Boolean';
|
|
4
|
+
export interface BasicColumn {
|
|
5
|
+
Field: string;
|
|
6
|
+
Header?: string;
|
|
7
|
+
Type?: ColumnType;
|
|
8
|
+
Width?: number;
|
|
9
|
+
MinWidth?: number;
|
|
10
|
+
IsSortable?: boolean;
|
|
11
|
+
IsFilterable?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface GridBasicOptions {
|
|
14
|
+
Columns: BasicColumn[];
|
|
15
|
+
Rows: Row[];
|
|
16
|
+
RowKeyField?: string;
|
|
17
|
+
Height?: string;
|
|
18
|
+
PageSize?: number;
|
|
19
|
+
EnablePagination?: boolean;
|
|
20
|
+
EnableSelection?: boolean;
|
|
21
|
+
Locale?: string;
|
|
22
|
+
Currency?: string;
|
|
23
|
+
TimeZone?: string;
|
|
24
|
+
AccessibleLabel?: string;
|
|
25
|
+
ExtendedClass?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface GridBasicEvents {
|
|
28
|
+
Ready?: () => void;
|
|
29
|
+
RowClicked?: (row: Row) => void;
|
|
30
|
+
SelectionChanged?: (row: Row | null) => void;
|
|
31
|
+
Error?: (message: string) => void;
|
|
32
|
+
}
|
|
33
|
+
export type NormalizedOptions = Required<GridBasicOptions>;
|
|
34
|
+
const blocked = new Set(['__proto__', 'prototype', 'constructor']);
|
|
35
|
+
function record(value: unknown): value is Record<string,unknown> {
|
|
36
|
+
return !!value && typeof value === 'object' && !Array.isArray(value) && [Object.prototype,null].includes(Object.getPrototypeOf(value));
|
|
37
|
+
}
|
|
38
|
+
function fields(value: Record<string,unknown>, allowed: readonly string[], scope: string) {
|
|
39
|
+
for (const key of Object.keys(value)) if (!allowed.includes(key) || blocked.has(key)) throw Error(`${scope}: unsupported property ${key}.`);
|
|
40
|
+
}
|
|
41
|
+
function text(value: unknown, label: string, empty = false): asserts value is string {
|
|
42
|
+
if (typeof value !== 'string' || (!empty && !value.trim())) throw Error(`${label} must be text${empty?'':' and nonempty'}.`);
|
|
43
|
+
}
|
|
44
|
+
function boolean(value:unknown,label:string) { if(typeof value !== 'boolean') throw Error(`${label} must be Boolean.`); }
|
|
45
|
+
const optionKeys = ['Columns','Rows','RowKeyField','Height','PageSize','EnablePagination','EnableSelection','Locale','Currency','TimeZone','AccessibleLabel','ExtendedClass'];
|
|
46
|
+
const columnKeys = ['Field','Header','Type','Width','MinWidth','IsSortable','IsFilterable'];
|
|
47
|
+
export function normalizeOptions(input:GridBasicOptions):NormalizedOptions {
|
|
48
|
+
if(!record(input)) throw Error('Grid options must be an object.');
|
|
49
|
+
fields(input,optionKeys,'Grid');
|
|
50
|
+
const p:NormalizedOptions = {RowKeyField:'Id',Height:'480px',PageSize:25,EnablePagination:true,EnableSelection:true,Locale:'en-US',Currency:'USD',TimeZone:'UTC',AccessibleLabel:'Data table',ExtendedClass:'',...input};
|
|
51
|
+
for(const key of ['RowKeyField','Height','Locale','Currency','TimeZone','AccessibleLabel'] as const)text(p[key],key);
|
|
52
|
+
text(p.ExtendedClass,'ExtendedClass',true);
|
|
53
|
+
if(blocked.has(p.RowKeyField))throw Error('Invalid RowKeyField.');
|
|
54
|
+
if(!/^\d+(\.\d+)?(px|rem|vh|dvh|%)$/.test(p.Height))throw Error('Height must be a nonnegative CSS length (px, rem, vh, dvh or %).');
|
|
55
|
+
if(!Number.isSafeInteger(p.PageSize)||p.PageSize<1||p.PageSize>10000)throw Error('PageSize must be an integer from 1 to 10000.');
|
|
56
|
+
boolean(p.EnablePagination,'EnablePagination');boolean(p.EnableSelection,'EnableSelection');
|
|
57
|
+
new Intl.NumberFormat(p.Locale,{style:'currency',currency:p.Currency});
|
|
58
|
+
new Intl.DateTimeFormat(p.Locale,{timeZone:p.TimeZone});
|
|
59
|
+
if(!Array.isArray(p.Columns)||!p.Columns.length)throw Error('Columns must contain at least one column.');
|
|
60
|
+
const seen=new Set<string>();
|
|
61
|
+
p.Columns=p.Columns.map(c=>{
|
|
62
|
+
if(!record(c))throw Error('Each column must be an object.');fields(c,columnKeys,'Column');text(c.Field,'Column.Field');
|
|
63
|
+
if(blocked.has(c.Field)||seen.has(c.Field))throw Error('Column fields must be unique and safe.');seen.add(c.Field);
|
|
64
|
+
if(c.Header!==undefined)text(c.Header,'Column.Header',true);
|
|
65
|
+
if(c.Type!==undefined&&!['Text','Number','Currency','Date','DateTime','Boolean'].includes(c.Type))throw Error('Invalid column Type.');
|
|
66
|
+
for(const k of ['Width','MinWidth'] as const)if(c[k]!==undefined&&(!Number.isFinite(c[k])||c[k]!<40||c[k]!>4000))throw Error(`${k} must be from 40 to 4000.`);
|
|
67
|
+
for(const k of ['IsSortable','IsFilterable'] as const)if(c[k]!==undefined)boolean(c[k],k);
|
|
68
|
+
return {...c};
|
|
69
|
+
});
|
|
70
|
+
if(!Array.isArray(p.Rows))throw Error('Rows must be a list.');
|
|
71
|
+
const ids=new Set<string>();
|
|
72
|
+
p.Rows=p.Rows.map(r=>{
|
|
73
|
+
if(!record(r))throw Error('Every row must be an object.');
|
|
74
|
+
for(const [k,v]of Object.entries(r))if(blocked.has(k)||!(v===null||typeof v==='string'||typeof v==='boolean'||(typeof v==='number'&&Number.isFinite(v))))throw Error(`Invalid value in row field ${k}.`);
|
|
75
|
+
const id=r[p.RowKeyField];if(!['string','number'].includes(typeof id)||String(id)===''||ids.has(String(id)))throw Error('Rows need unique, nonempty keys in RowKeyField.');ids.add(String(id));
|
|
76
|
+
return {...r};
|
|
77
|
+
});
|
|
78
|
+
return p;
|
|
79
|
+
}
|
|
80
|
+
/** Date-only values never shift across zones. Invalid values display as blank. */
|
|
81
|
+
export function parseDate(value:unknown,instant=false):Date|null {
|
|
82
|
+
if(typeof value!=='string'||!value)return null;
|
|
83
|
+
if(!instant){if(!/^\d{4}-\d{2}-\d{2}$/.test(value))return null;const d=new Date(value+'T00:00:00Z');return Number.isFinite(d.getTime())&&d.toISOString().slice(0,10)===value?d:null;}
|
|
84
|
+
if(!/^\d{4}-\d{2}-\d{2}T.*(?:Z|[+-]\d{2}:\d{2})$/.test(value))return null;
|
|
85
|
+
const d=new Date(value);return Number.isFinite(d.getTime())?d:null;
|
|
86
|
+
}
|
|
87
|
+
export function formatValue(value:unknown,type:ColumnType,p:NormalizedOptions):string {
|
|
88
|
+
if(value===null||value===undefined)return '';
|
|
89
|
+
if(type==='Boolean')return value===true?'Yes':value===false?'No':'';
|
|
90
|
+
if(type==='Number'||type==='Currency')return typeof value==='number'&&Number.isFinite(value)?new Intl.NumberFormat(p.Locale,type==='Currency'?{style:'currency',currency:p.Currency}:{}).format(value):'';
|
|
91
|
+
if(type==='Date'||type==='DateTime'){const d=parseDate(value,type==='DateTime');return d?new Intl.DateTimeFormat(p.Locale,{dateStyle:'medium',...(type==='DateTime'?{timeStyle:'short',timeZone:p.TimeZone}:{timeZone:'UTC'})}).format(d):'';}
|
|
92
|
+
return String(value);
|
|
93
|
+
}
|
package/src/grid.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './grid-basic.js';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export * from './theme.js';
|
|
2
|
+
export * from './button.js';
|
|
3
|
+
export * from './badge.js';
|
|
4
|
+
export * from './chip.js';
|
|
5
|
+
export * from './card.js';
|
|
6
|
+
export * from './breadcrumbs.js';
|
|
7
|
+
export * from './page-header.js';
|
|
8
|
+
export * from './sidebar.js';
|
|
9
|
+
export * from './skeleton.js';
|
|
10
|
+
export * from './tree-select.js';
|
|
11
|
+
export * from './command-palette.js';
|
|
12
|
+
export * from './upload-manager.js';
|
|
13
|
+
export * from './splitter.js';
|
|
14
|
+
export * from './tree-view.js';
|
|
15
|
+
export * from './transfer-list.js';
|
|
16
|
+
export * from './timeline.js';
|
|
17
|
+
export * from './modal.js';
|
|
18
|
+
export * from './drawer.js';
|
|
19
|
+
export * from './notification.js';
|
|
20
|
+
export * from './pagination.js';
|
|
21
|
+
export * from './cascader.js';
|
|
22
|
+
export * from './statistic.js';
|
|
23
|
+
export * from './qr-code.js';
|
|
24
|
+
export * from './tour.js';
|
|
25
|
+
export * from './empty-state.js';
|
|
26
|
+
export * from './descriptions.js';
|
|
27
|
+
export * from './sparkline.js';
|
|
28
|
+
export * from './app-layout.js';
|
|
29
|
+
export * from './page-layout.js';
|
|
30
|
+
export * from './dashboard-canvas.js';
|
|
31
|
+
export * from './notification-center.js';
|
|
32
|
+
export * from './dashboard-panel.js';
|
|
33
|
+
export * from './video-player.js';
|
|
34
|
+
export * from './video-lightbox.js';
|
|
35
|
+
export * from './media-image.js';
|
|
36
|
+
export * from './media-card.js';
|
|
37
|
+
export * from './image-compare.js';
|
|
38
|
+
export * from './text-highlight.js';
|
|
39
|
+
export * from './content-carousel.js';
|
|
40
|
+
export * from './profile-card.js';
|
|
41
|
+
export * from './quote-card.js';
|
|
42
|
+
export * from './collection-layout.js';
|
|
43
|
+
export * from './hero-section.js';
|
|
44
|
+
export * from './split-section.js';
|
|
45
|
+
export * from './logo-cloud.js';
|
|
46
|
+
export * from './chat.js';
|
|
47
|
+
export * from './chat-widget.js';
|
|
48
|
+
export * from './float-button.js';
|
|
49
|
+
export * from './date-picker.js';
|
|
50
|
+
export * from './time-picker.js';
|
|
51
|
+
export * from './date-time-picker.js';
|
|
52
|
+
export * from './date-range-picker.js';
|
|
53
|
+
export * from './font-provider.js';
|
|
54
|
+
export * from './shape-mask.js';
|
|
55
|
+
export * from './chip-group.js';
|
|
56
|
+
export * from './grid-basic.js';
|
|
57
|
+
|
|
58
|
+
export * from './form-layout.js';
|