@tmorrow/cre8-wc 2.0.7 → 2.0.8
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/a2ui/catalog +5 -5
- package/a2ui/catalog-kg.json +156 -20
- package/a2ui/catalog.json +393 -34
- package/a2ui/catalog.svg +2445 -2445
- package/a2ui/examples/compound-families.json +298 -0
- package/a2ui/examples/llm-observability.json +678 -650
- package/a2ui/generate-catalog.mjs +116 -3
- package/a2ui/inert-props.json +32 -0
- package/a2ui/render-audit.mjs +294 -0
- package/a2ui/renderer.d.ts +2 -1
- package/a2ui/renderer.js +1 -1
- package/a2ui/renderer.ts +1 -1
- package/a2ui/smoke-test.mjs +3 -3
- package/a2ui/stream/diff-test.mjs +299 -0
- package/a2ui/stream/diff.d.ts +28 -0
- package/a2ui/stream/diff.js +130 -0
- package/a2ui/stream/diff.ts +145 -0
- package/a2ui/stream/index.d.ts +11 -0
- package/a2ui/stream/index.js +11 -0
- package/a2ui/stream/index.ts +43 -0
- package/a2ui/stream/model.d.ts +66 -0
- package/a2ui/stream/model.js +429 -0
- package/a2ui/stream/model.ts +472 -0
- package/a2ui/stream/pointer.d.ts +34 -0
- package/a2ui/stream/pointer.js +146 -0
- package/a2ui/stream/pointer.ts +147 -0
- package/a2ui/stream/renderer.d.ts +51 -0
- package/a2ui/stream/renderer.js +282 -0
- package/a2ui/stream/renderer.ts +291 -0
- package/a2ui/stream/stream-test.mjs +592 -0
- package/a2ui/stream/types.d.ts +173 -0
- package/a2ui/stream/types.js +17 -0
- package/a2ui/stream/types.ts +127 -0
- package/cdn/cre8-wc.esm.js +3527 -3226
- package/cdn/cre8-wc.esm.js.map +1 -1
- package/cdn/cre8-wc.min.js +289 -289
- package/cdn/cre8-wc.min.js.map +1 -1
- package/dist/assets/{Changelog-Documentation-BguNswiM.js → Changelog-Documentation-CeOetLxK.js} +1 -1
- package/dist/assets/{Code-Guidelines-BM3dZyzL.js → Code-Guidelines-BjdezAjj.js} +1 -1
- package/dist/assets/{Color-6AOWCN3U-C4AEGNk3.js → Color-6AOWCN3U-DPFGZitI.js} +1 -1
- package/dist/assets/{Contributing-Guidelines-DZURVehh.js → Contributing-Guidelines-B1M2V1hW.js} +1 -1
- package/dist/assets/{DocsRenderer-JROSPFPF-DeZmCI9u.js → DocsRenderer-JROSPFPF-BBy8KWNl.js} +1 -1
- package/dist/assets/{Tokens-Documentation-ZecGbtQg.js → Tokens-Documentation-CdTxFDLe.js} +1 -1
- package/dist/assets/{WithTooltip-7X4HQR7L-2Hfrkir-.js → WithTooltip-7X4HQR7L-DZzTNMQ7.js} +1 -1
- package/dist/assets/{accordion-item.stories-D-MjrX5G.js → accordion-item.stories-Bl26JlHp.js} +1 -9
- package/dist/assets/{accordion.stories-icgNa1dl.js → accordion.stories-DjoLApQw.js} +3 -11
- package/dist/assets/{alert.stories-BzDaXtj-.js → alert.stories-pO1y3YCQ.js} +15 -31
- package/dist/assets/{badge-C5wOWgyg.js → badge-BTxW3bN2.js} +3 -11
- package/dist/assets/{badge.stories-5GfB4jVI.js → badge.stories-vqh63RJ2.js} +1 -1
- package/dist/assets/{band.stories-DhXaP_kL.js → band.stories-CjKRppSb.js} +1 -9
- package/dist/assets/{blocks-DhUVut8Z.js → blocks-1be_-L6v.js} +5 -5
- package/dist/assets/{breadcrumbs.stories-CrPUBVk1.js → breadcrumbs.stories-Doyfy3V9.js} +2 -18
- package/dist/assets/{button-CJL8yzAT.js → button-CgaWukz0.js} +1 -9
- package/dist/assets/{button-group-BgwgtSFC.js → button-group-G7qN4MwM.js} +1 -9
- package/dist/assets/{button-group.stories-W-07gO63.js → button-group.stories-cL3Kay6M.js} +1 -1
- package/dist/assets/{button.stories-BPzJ-sCv.js → button.stories-C9HSpxWb.js} +6 -6
- package/dist/assets/{card.stories-mlFGY2Xn.js → card.stories-BbU8YymD.js} +3 -11
- package/dist/assets/{chart.stories-C8yuHHeK.js → chart.stories-BL4FxIA_.js} +1 -1
- package/dist/assets/{checkbox-field-item-iHcdmTNw.js → checkbox-field-item-DIMHcWM0.js} +1 -9
- package/dist/assets/{checkbox-field-item.stories-D1aVLDXn.js → checkbox-field-item.stories-XbB4x_lO.js} +1 -1
- package/dist/assets/{checkbox-field.stories-BoVB2jCx.js → checkbox-field.stories-YnqFUI4K.js} +2 -10
- package/dist/assets/{cre8-element-DfmMtHJO.js → cre8-element-B35i4Lyg.js} +1 -1
- package/dist/assets/{cre8-form-element-bQpK8UYN.js → cre8-form-element-Cfc5VeYV.js} +1 -1
- package/dist/assets/{danger-button.stories-Cb4ljnhQ.js → danger-button.stories-xh25hmfd.js} +1 -9
- package/dist/assets/{date-picker.stories-Cje3qk8D.js → date-picker.stories-DD_ctzEF.js} +1 -49
- package/dist/assets/{divider-B_PXBGWD.js → divider-xZ2KARHf.js} +2 -10
- package/dist/assets/{divider.stories-CtfeBqVV.js → divider.stories-Bk9oF-OV.js} +1 -1
- package/dist/assets/{dropdown-Cgwne34I.js → dropdown-BEP5x3CW.js} +6 -22
- package/dist/assets/{dropdown-item.stories-pXkDLRuv.js → dropdown-item.stories-Iaw_UrEP.js} +1 -1
- package/dist/assets/{dropdown.stories-DZnmHieY.js → dropdown.stories-B0OlKD7h.js} +1 -1
- package/dist/assets/{example-drug-card.stories-DTzLXTFx.js → example-drug-card.stories-Bp5JIeE_.js} +1 -1
- package/dist/assets/{f-po-C2WpbOFJ.js → f-po-BdPzDRD-.js} +1 -1
- package/dist/assets/{feature.stories-DffXdJch.js → feature.stories-DYE1Js70.js} +1 -9
- package/dist/assets/{field-DzYRqQb2.js → field-BpUYyRW1.js} +1 -9
- package/dist/assets/{field-note-DKXZiXLU.js → field-note-fccBckVl.js} +3 -11
- package/dist/assets/{field-note.stories-DS_0bQul.js → field-note.stories-BH9AZMbF.js} +1 -1
- package/dist/assets/{field.stories-BvXn0oG6.js → field.stories-BQPtmziK.js} +1 -1
- package/dist/assets/{footer.stories-C3ZibisU.js → footer.stories-DCWEciqD.js} +1 -9
- package/dist/assets/{form-example.stories-C-TuOeF2.js → form-example.stories-9IDC0AgX.js} +1 -1
- package/dist/assets/{formatter-L2YTDE3Q-CJVnxOUW.js → formatter-L2YTDE3Q-B9u1AOWn.js} +1 -1
- package/dist/assets/{global-nav-item-xQL7wVjY.js → global-nav-item-T4htN-yO.js} +6 -14
- package/dist/assets/{global-nav-item.stories-Dp9TE3aR.js → global-nav-item.stories-2dWRfCXv.js} +1 -1
- package/dist/assets/{global-nav.stories-B5Nk8JZ0.js → global-nav.stories-Fh1gScqg.js} +2 -10
- package/dist/assets/{grid-DYgnZBsd.js → grid-C5CKMXNe.js} +3 -19
- package/dist/assets/{grid.stories-BFiXTq2C.js → grid.stories-BLmCNdeA.js} +1 -1
- package/dist/assets/{header.stories-D1f7xhjV.js → header.stories-BkDrjJtj.js} +1 -9
- package/dist/assets/{heading-485Jz7JZ.js → heading-Dbka33DK.js} +2 -10
- package/dist/assets/{heading.stories-gPF_SmTc.js → heading.stories-Be40_bmG.js} +1 -1
- package/dist/assets/{hero.stories-BHlFNdvF.js → hero.stories-vRu7PZG9.js} +1 -9
- package/dist/assets/{icon-DeTLDzTS.js → icon-ChfRWXWy.js} +2 -10
- package/dist/assets/{icon-description-o-YaiEjK.js → icon-description-BBSwDykJ.js} +1 -1
- package/dist/assets/{icon-description.stories-BdPRvEwe.js → icon-description.stories-Cg6ekOme.js} +1 -1
- package/dist/assets/{icon.stories-BxWpqxT5.js → icon.stories-Cj4U7L5G.js} +1 -1
- package/dist/assets/if-defined-Bxnzk64Q.js +1 -0
- package/dist/assets/{iframe-dHvya7sk.js → iframe-BNJP6ovU.js} +35 -35
- package/dist/assets/{inline-alert.stories-FH0bQ0jh.js → inline-alert.stories-CygBYI02.js} +1 -9
- package/dist/assets/{layout-container.stories-D6Z6Kx78.js → layout-container.stories-TMyIJteJ.js} +2 -10
- package/dist/assets/{layout.stories-CNYuwC_r.js → layout.stories-ylRM-ANL.js} +7 -23
- package/dist/assets/{linelength-container.stories-pCRXZvxS.js → linelength-container.stories-Br2v8jXE.js} +1 -9
- package/dist/assets/{link-BpCiLxNW.js → link-CRE0Eqdo.js} +1 -9
- package/dist/assets/{link-list.stories-12vsAa1P.js → link-list.stories--y-urrVo.js} +7 -23
- package/dist/assets/{link.stories-DAoQtY4_.js → link.stories-C3WQOgkY.js} +2 -2
- package/dist/assets/{list.stories-D0N3yBIf.js → list.stories-Bd2bxkxn.js} +7 -23
- package/dist/assets/{loading-spinner-g6iJajXH.js → loading-spinner-C52KNq6y.js} +4 -12
- package/dist/assets/{loading-spinner.stories-B6_mgPxB.js → loading-spinner.stories-DPRGEeHT.js} +1 -1
- package/dist/assets/{logo.stories-BvMwN2qg.js → logo.stories-2LBqqraT.js} +1 -9
- package/dist/assets/{main.stories-pL4zefbs.js → main.stories-BQzD7iWD.js} +2 -10
- package/dist/assets/{medication-card.stories-DK1XGJic.js → medication-card.stories-Wc-hA0-s.js} +5 -5
- package/dist/assets/{medication-form.stories-Bj5dLp5S.js → medication-form.stories-DfFOCDaU.js} +1 -1
- package/dist/assets/{modal-CO0M4e_8.js → modal-CCfbY4fF.js} +1 -9
- package/dist/assets/{modal-BNu8xy08.js → modal-GglWRNJp.js} +1 -1
- package/dist/assets/{modal.stories-CHYBrq_E.js → modal.stories-CpybCs79.js} +1 -1
- package/dist/assets/{multi-select.stories-C9XXsWio.js → multi-select.stories-BhzEKRui.js} +1 -9
- package/dist/assets/{nav-container.stories-DU9fhvDu.js → nav-container.stories-Be1YlegP.js} +3 -11
- package/dist/assets/{page-header.stories-BrstKiEY.js → page-header.stories-BOVLQ0YF.js} +1 -9
- package/dist/assets/{pagination.stories-Bw2M2iOn.js → pagination.stories-D62sa_1K.js} +9 -25
- package/dist/assets/{percent-bar.stories-UQRXYUqd.js → percent-bar.stories-CYi4El7T.js} +1 -9
- package/dist/assets/{popover.stories-ZkwrRFpR.js → popover.stories-B9O8F4yv.js} +1 -9
- package/dist/assets/{primary-nav.stories-wqOKwgQn.js → primary-nav.stories-Bt-o7h45.js} +1 -17
- package/dist/assets/{progress-meter-TzASasu0.js → progress-meter-Dit59091.js} +1 -9
- package/dist/assets/{progress-meter.stories-qfJALZf8.js → progress-meter.stories-CYnOCmjo.js} +1 -1
- package/dist/assets/{progress-steps-item-KvW1d_7L.js → progress-steps-item-CWJsad0s.js} +1 -9
- package/dist/assets/{progress-steps-item.stories-uOn6tJ1W.js → progress-steps-item.stories-ePn_6bPn.js} +1 -1
- package/dist/assets/{progress-steps.stories-CKFPx8D0.js → progress-steps.stories-CblrEcXF.js} +1 -9
- package/dist/assets/{radio-field-item-CTaR50XR.js → radio-field-item-Bm-0RWPe.js} +5 -21
- package/dist/assets/{radio-field-item.stories-DQSLj8W1.js → radio-field-item.stories-y_TrTRIW.js} +1 -1
- package/dist/assets/{radio-field.stories-Btmc_Iep.js → radio-field.stories-CSWrbUrn.js} +1 -1
- package/dist/assets/{remove-tag-BSEZ7VT8.js → remove-tag-lCr57c5r.js} +1 -9
- package/dist/assets/{remove-tag.stories-diRKi7Ua.js → remove-tag.stories-CDfwCdvZ.js} +1 -1
- package/dist/assets/{request-prescription.stories-DQvra7ia.js → request-prescription.stories-O4zqokfb.js} +1 -1
- package/dist/assets/{sample-modal.stories-deE1EBfZ.js → sample-modal.stories-BZ4N2R2Z.js} +1 -1
- package/dist/assets/{section.stories-DF4mcy2O.js → section.stories-D_1InThX.js} +1 -9
- package/dist/assets/{select-tile-D-C8oSrm.js → select-tile-BqqB3ZtE.js} +2 -10
- package/dist/assets/{select-tile-list.stories-vsBQUIcl.js → select-tile-list.stories-Di4ILgV8.js} +1 -9
- package/dist/assets/{select-tile.stories-CqHzN5fc.js → select-tile.stories-D3h_6zlV.js} +6 -6
- package/dist/assets/{select.stories-8aOGxTtr.js → select.stories-BB2phP9A.js} +1 -9
- package/dist/assets/{skeleton-loader.stories-CwR2-aC5.js → skeleton-loader.stories-y4uml_kV.js} +5 -13
- package/dist/assets/{split-button.stories-CyfdrK4u.js → split-button.stories-C_82I4ME.js} +2 -10
- package/dist/assets/{spread-BPiNgQQF.js → spread-CnPic3C2.js} +1 -1
- package/dist/assets/state-DkQhleoO.js +1 -0
- package/dist/assets/{submenu.stories-CDhNzZzh.js → submenu.stories-UDtaREr1.js} +2 -18
- package/dist/assets/{syntaxhighlighter-T5IQBZDB-BzI6WxUR.js → syntaxhighlighter-T5IQBZDB-D-I_s_yD.js} +1 -1
- package/dist/assets/{table-header-CfcchoYz.js → table-header-2837i43H.js} +3 -51
- package/dist/assets/{table-object.stories-Bd5qdfMU.js → table-object.stories-D4KoI-wA.js} +1 -9
- package/dist/assets/{table.stories-DxuBe9dJ.js → table.stories-DUJDibEp.js} +1 -1
- package/dist/assets/{tabs.stories-Cpc3OHJx.js → tabs.stories-C06SngOF.js} +5 -29
- package/dist/assets/{tag-list.stories-BmyCmrTF.js → tag-list.stories-Du-IoYzu.js} +2 -10
- package/dist/assets/{tag-vQFuZneb.js → tag-oHGdclJl.js} +1 -9
- package/dist/assets/{tag.stories-DGzrNUbb.js → tag.stories-C5D5IbuK.js} +1 -1
- package/dist/assets/{tertiary-nav.stories-D4q5K-am.js → tertiary-nav.stories-B1GU8Zi4.js} +3 -19
- package/dist/assets/{text-link-4qLRIeJB.js → text-link-B3m3KEqY.js} +1 -9
- package/dist/assets/{text-link.stories-D6BRm2I5.js → text-link.stories-4O6qn82H.js} +1 -1
- package/dist/assets/{text-passage-DGaI5i2I.js → text-passage-xQVosjOr.js} +3 -19
- package/dist/assets/{text-passage.stories-DkmXVUhH.js → text-passage.stories-Da1nspwG.js} +1 -1
- package/dist/assets/{tooltip.stories-B7ADDq7o.js → tooltip.stories-DLKyyeKn.js} +6 -14
- package/dist/assets/{utility-nav.stories-ffXVvyLp.js → utility-nav.stories-B6xBFe7z.js} +5 -21
- package/dist/design-tokens/brands/cre8/css/tokens_brand.css +1 -1
- package/dist/design-tokens/core/scss/theming/component.css +1 -1
- package/dist/design-tokens/core/scss/theming/variables.css +1 -7
- package/dist/design-tokens/core/scss/theming/variables.scss +0 -11
- package/dist/icons/cre8-icons.svg +1 -1
- package/dist/iframe.html +1 -24
- package/dist/index.html +25 -77
- package/dist/project.json +1 -1
- package/lib/a2ui/renderer.d.ts +2 -1
- package/lib/a2ui/renderer.d.ts.map +1 -1
- package/lib/a2ui/renderer.js +1 -1
- package/lib/a2ui/renderer.js.map +1 -1
- package/lib/a2ui/stream/diff.d.ts +29 -0
- package/lib/a2ui/stream/diff.d.ts.map +1 -0
- package/lib/a2ui/stream/diff.js +131 -0
- package/lib/a2ui/stream/diff.js.map +1 -0
- package/lib/a2ui/stream/index.d.ts +12 -0
- package/lib/a2ui/stream/index.d.ts.map +1 -0
- package/lib/a2ui/stream/index.js +12 -0
- package/lib/a2ui/stream/index.js.map +1 -0
- package/lib/a2ui/stream/model.d.ts +67 -0
- package/lib/a2ui/stream/model.d.ts.map +1 -0
- package/lib/a2ui/stream/model.js +423 -0
- package/lib/a2ui/stream/model.js.map +1 -0
- package/lib/a2ui/stream/pointer.d.ts +35 -0
- package/lib/a2ui/stream/pointer.d.ts.map +1 -0
- package/lib/a2ui/stream/pointer.js +147 -0
- package/lib/a2ui/stream/pointer.js.map +1 -0
- package/lib/a2ui/stream/renderer.d.ts +52 -0
- package/lib/a2ui/stream/renderer.d.ts.map +1 -0
- package/lib/a2ui/stream/renderer.js +279 -0
- package/lib/a2ui/stream/renderer.js.map +1 -0
- package/lib/a2ui/stream/types.d.ts +174 -0
- package/lib/a2ui/stream/types.d.ts.map +1 -0
- package/lib/a2ui/stream/types.js +18 -0
- package/lib/a2ui/stream/types.js.map +1 -0
- package/lib/components/accordion/accordion.d.ts +15 -0
- package/lib/components/accordion/accordion.d.ts.map +1 -1
- package/lib/components/accordion/accordion.js +23 -0
- package/lib/components/accordion/accordion.js.map +1 -1
- package/lib/components/badge/badge.d.ts +4 -17
- package/lib/components/badge/badge.d.ts.map +1 -1
- package/lib/components/badge/badge.js +0 -15
- package/lib/components/badge/badge.js.map +1 -1
- package/lib/components/breadcrumbs/breadcrumbs.d.ts +14 -0
- package/lib/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/lib/components/breadcrumbs/breadcrumbs.js +21 -0
- package/lib/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/lib/components/chart/chart.d.ts +3 -3
- package/lib/components/chart/chart.js +6 -6
- package/lib/components/chart/chart.js.map +1 -1
- package/lib/components/checkbox-field/checkbox-field.d.ts +19 -0
- package/lib/components/checkbox-field/checkbox-field.d.ts.map +1 -1
- package/lib/components/checkbox-field/checkbox-field.js +28 -0
- package/lib/components/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/components/cre8-element.d.ts +19 -0
- package/lib/components/cre8-element.d.ts.map +1 -1
- package/lib/components/cre8-element.js +51 -2
- package/lib/components/cre8-element.js.map +1 -1
- package/lib/components/divider/divider.d.ts +1 -1
- package/lib/components/divider/divider.d.ts.map +1 -1
- package/lib/components/divider/divider.js.map +1 -1
- package/lib/components/dropdown/dropdown.d.ts +13 -0
- package/lib/components/dropdown/dropdown.d.ts.map +1 -1
- package/lib/components/dropdown/dropdown.js +19 -0
- package/lib/components/dropdown/dropdown.js.map +1 -1
- package/lib/components/dropdown-item/dropdown-item.d.ts +1 -1
- package/lib/components/dropdown-item/dropdown-item.js +2 -2
- package/lib/components/dropdown-item/dropdown-item.js.map +1 -1
- package/lib/components/heading/heading.d.ts +3 -5
- package/lib/components/heading/heading.d.ts.map +1 -1
- package/lib/components/heading/heading.js +2 -4
- package/lib/components/heading/heading.js.map +1 -1
- package/lib/components/link-list/link-list.d.ts +19 -0
- package/lib/components/link-list/link-list.d.ts.map +1 -1
- package/lib/components/link-list/link-list.js +19 -0
- package/lib/components/link-list/link-list.js.map +1 -1
- package/lib/components/list/list.d.ts +13 -0
- package/lib/components/list/list.d.ts.map +1 -1
- package/lib/components/list/list.js +15 -0
- package/lib/components/list/list.js.map +1 -1
- package/lib/components/modal/modal.d.ts +2 -2
- package/lib/components/modal/modal.js +2 -2
- package/lib/components/modal/modal.js.map +1 -1
- package/lib/components/multi-select/multi-select.d.ts +2 -2
- package/lib/components/multi-select/multi-select.js +5 -5
- package/lib/components/multi-select/multi-select.js.map +1 -1
- package/lib/components/pagination/pagination.d.ts +1 -1
- package/lib/components/pagination/pagination.js +2 -2
- package/lib/components/pagination/pagination.js.map +1 -1
- package/lib/components/percent-bar/percent-bar.d.ts +2 -0
- package/lib/components/percent-bar/percent-bar.d.ts.map +1 -1
- package/lib/components/percent-bar/percent-bar.js +3 -1
- package/lib/components/percent-bar/percent-bar.js.map +1 -1
- package/lib/components/popover/popover.d.ts +6 -7
- package/lib/components/popover/popover.d.ts.map +1 -1
- package/lib/components/popover/popover.js +4 -4
- package/lib/components/popover/popover.js.map +1 -1
- package/lib/components/progress-meter/progress-meter.d.ts +0 -8
- package/lib/components/progress-meter/progress-meter.d.ts.map +1 -1
- package/lib/components/progress-meter/progress-meter.js +0 -7
- package/lib/components/progress-meter/progress-meter.js.map +1 -1
- package/lib/components/progress-steps/progress-steps.d.ts +16 -0
- package/lib/components/progress-steps/progress-steps.d.ts.map +1 -1
- package/lib/components/progress-steps/progress-steps.js +25 -0
- package/lib/components/progress-steps/progress-steps.js.map +1 -1
- package/lib/components/progress-steps-item/progress-steps-item.d.ts +1 -3
- package/lib/components/progress-steps-item/progress-steps-item.d.ts.map +1 -1
- package/lib/components/progress-steps-item/progress-steps-item.js +0 -1
- package/lib/components/progress-steps-item/progress-steps-item.js.map +1 -1
- package/lib/components/radio-field/radio-field.d.ts +33 -0
- package/lib/components/radio-field/radio-field.d.ts.map +1 -1
- package/lib/components/radio-field/radio-field.js +62 -0
- package/lib/components/radio-field/radio-field.js.map +1 -1
- package/lib/components/remove-tag/remove-tag.d.ts +1 -1
- package/lib/components/remove-tag/remove-tag.js +3 -3
- package/lib/components/remove-tag/remove-tag.js.map +1 -1
- package/lib/components/split-button/split-button.d.ts +3 -0
- package/lib/components/split-button/split-button.d.ts.map +1 -1
- package/lib/components/split-button/split-button.js +5 -2
- package/lib/components/split-button/split-button.js.map +1 -1
- package/lib/components/tab/tab.d.ts +1 -1
- package/lib/components/tab/tab.js +3 -3
- package/lib/components/tab/tab.js.map +1 -1
- package/lib/components/table/table.d.ts +36 -0
- package/lib/components/table/table.d.ts.map +1 -1
- package/lib/components/table/table.js +55 -0
- package/lib/components/table/table.js.map +1 -1
- package/lib/components/tabs/tabs.d.ts +20 -3
- package/lib/components/tabs/tabs.d.ts.map +1 -1
- package/lib/components/tabs/tabs.js +33 -5
- package/lib/components/tabs/tabs.js.map +1 -1
- package/lib/components/tag-list/tag-list.d.ts +17 -0
- package/lib/components/tag-list/tag-list.d.ts.map +1 -1
- package/lib/components/tag-list/tag-list.js +25 -0
- package/lib/components/tag-list/tag-list.js.map +1 -1
- package/lib/components/tooltip/tooltip.d.ts +2 -2
- package/lib/components/tooltip/tooltip.js +4 -4
- package/lib/components/tooltip/tooltip.js.map +1 -1
- package/lib/components/utils/light-children.d.ts +40 -0
- package/lib/components/utils/light-children.d.ts.map +1 -0
- package/lib/components/utils/light-children.js +100 -0
- package/lib/components/utils/light-children.js.map +1 -0
- package/lib/directives/if-truthy.d.ts +1 -1
- package/lib/light-children-TlEXev5S.js +39 -0
- package/lib/scripts/generate-react-wrappers.d.ts +8 -1
- package/lib/scripts/generate-react-wrappers.d.ts.map +1 -1
- package/lib/scripts/generate-react-wrappers.js +45 -1
- package/lib/scripts/generate-react-wrappers.js.map +1 -1
- package/mcp-manifest.json +162 -52
- package/package.json +11 -4
- package/react-manifest.json +153 -47
- package/dist/assets/if-defined-HKKhGupN.js +0 -1
- package/dist/assets/iframe-CWwoGI65.css +0 -1
- package/dist/assets/state-CfuknrX8.js +0 -1
- package/dist/fonts/PlusJakartaSans-Bold.woff2 +0 -0
- package/dist/fonts/PlusJakartaSans-Medium.woff2 +0 -0
- package/dist/fonts/PlusJakartaSans-Regular.woff2 +0 -0
- package/dist/fonts/PlusJakartaSans-SemiBold.woff2 +0 -0
- package/dist/logo.svg +0 -1
- package/dist/sb-addons/storybook-4/manager-bundle.js +0 -8
- /package/dist/icons/{express-scripts copy.svg → pharmacy copy.svg} +0 -0
- /package/dist/icons/{express-scripts.svg → pharmacy.svg} +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { Cre8Element } from '../cre8-element';
|
|
2
2
|
import '../field-note/field-note';
|
|
3
|
+
/** One option in a data-driven radio field. */
|
|
4
|
+
export interface Cre8RadioItemData {
|
|
5
|
+
label: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}
|
|
3
11
|
/**
|
|
4
12
|
* Radio Field is the parent container for `radio-field-item`.
|
|
5
13
|
* It is required to allow for grouping numerous radio fields that need additional context (in the form of `<legend>`).
|
|
@@ -45,6 +53,31 @@ export declare class Cre8RadioField extends Cre8Element {
|
|
|
45
53
|
* Radio field legend label
|
|
46
54
|
*/
|
|
47
55
|
label?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Options for a data-driven radio field. Each becomes a
|
|
58
|
+
* `cre8-radio-field-item` sharing the field's `name`, which is what the form
|
|
59
|
+
* submits under. Exclusivity is enforced by the field itself — see
|
|
60
|
+
* `enforceSingleSelection`, and do not assume `name` alone does it.
|
|
61
|
+
*/
|
|
62
|
+
items?: Cre8RadioItemData[];
|
|
63
|
+
/** Form control name shared by every generated option. */
|
|
64
|
+
name?: string;
|
|
65
|
+
/** The composition the data property stands for. */
|
|
66
|
+
private buildComposition;
|
|
67
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
68
|
+
connectedCallback(): void;
|
|
69
|
+
disconnectedCallback(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Keep the group to one selection.
|
|
72
|
+
*
|
|
73
|
+
* A native radio group is formed by `name`, but only within one tree scope —
|
|
74
|
+
* and each `cre8-radio-field-item` keeps its `input` in its own shadow root,
|
|
75
|
+
* so the browser never sees them as siblings and every option stays checked
|
|
76
|
+
* once clicked. That is true of a hand-written field too, not just a generated
|
|
77
|
+
* one, which is why the fix lives here on the group rather than in the
|
|
78
|
+
* flattened path.
|
|
79
|
+
*/
|
|
80
|
+
private enforceSingleSelection;
|
|
48
81
|
render(): import("lit-html").TemplateResult<1>;
|
|
49
82
|
}
|
|
50
83
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-field.d.ts","sourceRoot":"","sources":["../../../components/radio-field/radio-field.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"radio-field.d.ts","sourceRoot":"","sources":["../../../components/radio-field/radio-field.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,0BAA0B,CAAC;AAGlC,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;GAQG;AAGH,qBAAa,cAAe,SAAQ,WAAW;IAC3C,MAAM,CAAC,MAAM,4BAAY;IAE3B;;;OAGG;IAEC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IAEC,eAAe,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IAEC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IAEC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IAEC,SAAS,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IAEC,OAAO,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IAEC,KAAK,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IAEC,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAEhC,0DAA0D;IAEtD,IAAI,CAAC,EAAE,MAAM,CAAC;IAElB,oDAAoD;IACpD,OAAO,CAAC,gBAAgB;IAexB,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAMtD,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAK5B;;;;;;;;;OASG;IACH,OAAO,CAAC,sBAAsB,CAS5B;IAGF,MAAM;CAwBP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { html, } from 'lit';
|
|
|
8
8
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { Cre8Element } from '../cre8-element';
|
|
11
|
+
import { syncLightChildren } from '../utils/light-children';
|
|
11
12
|
import '../field-note/field-note';
|
|
12
13
|
import styles from './radio-field.styles.js';
|
|
13
14
|
/**
|
|
@@ -20,6 +21,61 @@ import styles from './radio-field.styles.js';
|
|
|
20
21
|
* @slot - The component content, which should be a set of `radio-field-item`s
|
|
21
22
|
*/
|
|
22
23
|
export class Cre8RadioField extends Cre8Element {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
/**
|
|
27
|
+
* Keep the group to one selection.
|
|
28
|
+
*
|
|
29
|
+
* A native radio group is formed by `name`, but only within one tree scope —
|
|
30
|
+
* and each `cre8-radio-field-item` keeps its `input` in its own shadow root,
|
|
31
|
+
* so the browser never sees them as siblings and every option stays checked
|
|
32
|
+
* once clicked. That is true of a hand-written field too, not just a generated
|
|
33
|
+
* one, which is why the fix lives here on the group rather than in the
|
|
34
|
+
* flattened path.
|
|
35
|
+
*/
|
|
36
|
+
this.enforceSingleSelection = (event) => {
|
|
37
|
+
const source = event.target;
|
|
38
|
+
if (!source)
|
|
39
|
+
return;
|
|
40
|
+
const items = [...this.querySelectorAll('cre8-radio-field-item')];
|
|
41
|
+
const selected = items.find((item) => item === source || item.contains(source));
|
|
42
|
+
if (!selected)
|
|
43
|
+
return;
|
|
44
|
+
for (const item of items) {
|
|
45
|
+
if (item !== selected)
|
|
46
|
+
item.checked = false;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** The composition the data property stands for. */
|
|
51
|
+
buildComposition() {
|
|
52
|
+
if (!this.items)
|
|
53
|
+
return null;
|
|
54
|
+
return this.items.map((item) => ({
|
|
55
|
+
tag: 'cre8-radio-field-item',
|
|
56
|
+
props: {
|
|
57
|
+
label: item.label,
|
|
58
|
+
value: item.value,
|
|
59
|
+
checked: item.checked,
|
|
60
|
+
disabled: item.disabled,
|
|
61
|
+
required: item.required,
|
|
62
|
+
name: this.name,
|
|
63
|
+
},
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
updated(changed) {
|
|
67
|
+
if (['items', 'name'].some((key) => changed.has(key))) {
|
|
68
|
+
syncLightChildren(this, this.buildComposition());
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
connectedCallback() {
|
|
72
|
+
super.connectedCallback();
|
|
73
|
+
this.addEventListener('change', this.enforceSingleSelection);
|
|
74
|
+
}
|
|
75
|
+
disconnectedCallback() {
|
|
76
|
+
this.removeEventListener('change', this.enforceSingleSelection);
|
|
77
|
+
super.disconnectedCallback();
|
|
78
|
+
}
|
|
23
79
|
render() {
|
|
24
80
|
const componentClassNames = this.componentClassNames('cre8-c-radio-field', {});
|
|
25
81
|
return html `
|
|
@@ -66,6 +122,12 @@ __decorate([
|
|
|
66
122
|
__decorate([
|
|
67
123
|
property()
|
|
68
124
|
], Cre8RadioField.prototype, "label", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
property({ type: Array })
|
|
127
|
+
], Cre8RadioField.prototype, "items", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
property()
|
|
130
|
+
], Cre8RadioField.prototype, "name", void 0);
|
|
69
131
|
if (customElements.get('cre8-radio-field') === undefined) {
|
|
70
132
|
customElements.define('cre8-radio-field', Cre8RadioField);
|
|
71
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-field.js","sourceRoot":"","sources":["../../../components/radio-field/radio-field.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,0BAA0B,CAAC;AAClC,OAAO,MAAM,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"radio-field.js","sourceRoot":"","sources":["../../../components/radio-field/radio-field.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAkB,MAAM,yBAAyB,CAAC;AAC5E,OAAO,0BAA0B,CAAC;AAClC,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAW7C;;;;;;;;GAQG;AAGH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAA/C;;QA+FE;;;;;;;;;WASG;QACK,2BAAsB,GAAG,CAAC,KAAY,EAAQ,EAAE;YACpD,MAAM,MAAM,GAAG,KAAK,CAAC,MAA4B,CAAC;YAClD,IAAI,CAAC,MAAM;gBAAE,OAAO;YACpB,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,gBA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EAAE,CAAC;6CACM;AAI5B;IADH,QAAQ,EAAE;4CACO;AAkFpB,IAAI,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,SAAS,EAAE,CAAC;IACvD,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;AAC9D,CAAC;AAQD,eAAe,cAAc,CAAC","sourcesContent":["import { html, } from 'lit';\nimport { ifDefined } from 'lit-html/directives/if-defined.js';\nimport { property } from 'lit/decorators.js';\nimport { Cre8Element } from '../cre8-element';\nimport { syncLightChildren, type ChildSpec } from '../utils/light-children';\nimport '../field-note/field-note';\nimport styles from './radio-field.styles.js';\n\n/** One option in a data-driven radio field. */\nexport interface Cre8RadioItemData {\n label: string;\n value?: string;\n checked?: boolean;\n disabled?: boolean;\n required?: boolean;\n}\n\n/**\n * Radio Field is the parent container for `radio-field-item`.\n * It is required to allow for grouping numerous radio fields that need additional context (in the form of `<legend>`).\n * It also provides accessibility roles, aria attributes and field note messaging on the group.\n *\n * See [radio-field-item](?path=/story/cre8-components-radio-field-item--default) for more guidance on its usage.\n *\n * @slot - The component content, which should be a set of `radio-field-item`s\n */\n\n\nexport class Cre8RadioField extends Cre8Element {\n static styles = [styles];\n\n /**\n * Radio Field Note\n * @attr {string}\n */\n @property()\n fieldNote?: string;\n\n /**\n * Radio container fieldnote aria describe by\n * @attr {string}\n */\n @property()\n ariaDescribedBy?: string;\n\n /**\n * Radio container fieldnote icon name\n * @attr {string}\n */\n @property()\n fieldNoteIconName?: string;\n\n /**\n * Radio container fieldnote knockout\n * @attr {boolean}\n */\n @property({ type: Boolean, reflect: true })\n fieldNoteKnockout?: boolean;\n\n /**\n * Radio container fieldnote isSuccess\n * @attr {boolean}\n */\n @property({ type: Boolean, reflect: true })\n isSuccess?: boolean;\n\n /**\n * Radio container fieldnote isError\n * @attr {boolean}\n */\n @property({ type: Boolean, reflect: true })\n isError?: boolean;\n\n /**\n * Radio field legend label\n */\n @property()\n label?: string;\n /**\n * Options for a data-driven radio field. Each becomes a\n * `cre8-radio-field-item` sharing the field's `name`, which is what the form\n * submits under. Exclusivity is enforced by the field itself — see\n * `enforceSingleSelection`, and do not assume `name` alone does it.\n */\n @property({ type: Array })\n items?: Cre8RadioItemData[];\n\n /** Form control name shared by every generated option. */\n @property()\n name?: string;\n\n /** The composition the data property stands for. */\n private buildComposition(): ChildSpec[] | null {\n if (!this.items) return null;\n return this.items.map((item) => ({\n tag: 'cre8-radio-field-item',\n props: {\n label: item.label,\n value: item.value,\n checked: item.checked,\n disabled: item.disabled,\n required: item.required,\n name: this.name,\n },\n }));\n }\n\n protected updated(changed: Map<string, unknown>): void {\n if (['items', 'name'].some((key) => changed.has(key))) {\n syncLightChildren(this, this.buildComposition());\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('change', this.enforceSingleSelection as EventListener);\n }\n\n disconnectedCallback(): void {\n this.removeEventListener('change', this.enforceSingleSelection as EventListener);\n super.disconnectedCallback();\n }\n\n /**\n * Keep the group to one selection.\n *\n * A native radio group is formed by `name`, but only within one tree scope —\n * and each `cre8-radio-field-item` keeps its `input` in its own shadow root,\n * so the browser never sees them as siblings and every option stays checked\n * once clicked. That is true of a hand-written field too, not just a generated\n * one, which is why the fix lives here on the group rather than in the\n * flattened path.\n */\n private enforceSingleSelection = (event: Event): void => {\n const source = event.target as HTMLElement | null;\n if (!source) return;\n const items = [...this.querySelectorAll('cre8-radio-field-item')];\n const selected = items.find((item) => item === source || item.contains(source));\n if (!selected) return;\n for (const item of items) {\n if (item !== selected) (item as HTMLElement & { checked?: boolean }).checked = false;\n }\n };\n\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-radio-field', {});\n\n return html`\n <fieldset class=\"${componentClassNames}\" aria-describedby=\"${ifDefined(this.ariaDescribedBy)}\">\n <legend class=\"cre8-c-radio-field__legend\">${this.label}</legend>\n <div class=\"cre8-c-radio-field__body\">\n <ul class=\"cre8-c-radio-field__list\" role=\"list\">\n <slot></slot>\n </ul>\n </div>\n ${this.fieldNote\n ? html`<cre8-field-note\n ?inverted=${this.fieldNoteKnockout}\n id=${ifDefined(this.ariaDescribedBy)}\n iconName=${ifDefined(this.fieldNoteIconName)}\n ?isSuccess=${this.isSuccess}\n ?isError=${this.isError}\n >\n ${this.fieldNote}\n </cre8-field-note>` : ''}\n </fieldset>\n `;\n }\n}\n\nif (customElements.get('cre8-radio-field') === undefined) {\n customElements.define('cre8-radio-field', Cre8RadioField);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-radio-field': Cre8RadioField;\n }\n}\n\nexport default Cre8RadioField;\n"]}
|
|
@@ -13,7 +13,7 @@ export declare enum Color {
|
|
|
13
13
|
* Clicking a Remove Tag causes it to disappear from the page or field (in the case of Multi-Select).
|
|
14
14
|
* These tags always display a "Close" icon.
|
|
15
15
|
*
|
|
16
|
-
* @fires
|
|
16
|
+
* @fires remove-tag-click - Fires when the remove tag is clicked.
|
|
17
17
|
*/
|
|
18
18
|
export declare class Cre8RemoveTag extends Cre8Element {
|
|
19
19
|
static styles: import("lit").CSSResult[];
|
|
@@ -26,7 +26,7 @@ export var Color;
|
|
|
26
26
|
* Clicking a Remove Tag causes it to disappear from the page or field (in the case of Multi-Select).
|
|
27
27
|
* These tags always display a "Close" icon.
|
|
28
28
|
*
|
|
29
|
-
* @fires
|
|
29
|
+
* @fires remove-tag-click - Fires when the remove tag is clicked.
|
|
30
30
|
*/
|
|
31
31
|
export class Cre8RemoveTag extends Cre8Element {
|
|
32
32
|
constructor() {
|
|
@@ -51,12 +51,12 @@ export class Cre8RemoveTag extends Cre8Element {
|
|
|
51
51
|
* Dispatches an event when the tag is clicked
|
|
52
52
|
*/
|
|
53
53
|
_handleRemoveTagClicked() {
|
|
54
|
-
const customEvent = new CustomEvent('
|
|
54
|
+
const customEvent = new CustomEvent('remove-tag-click', {
|
|
55
55
|
detail: { message: 'Remove Tag clicked.' },
|
|
56
56
|
bubbles: true,
|
|
57
57
|
composed: true,
|
|
58
58
|
});
|
|
59
|
-
this.
|
|
59
|
+
this.dispatchWithLegacyAlias(customEvent);
|
|
60
60
|
}
|
|
61
61
|
render() {
|
|
62
62
|
const componentClassName = classnames('cre8-c-remove-tag', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tag.js","sourceRoot":"","sources":["../../../components/remove-tag/remove-tag.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,QAAQ,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,cAAc,CAAC;AACtB,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,wBAAe,CAAA;IACf,0BAAiB,CAAA;AACnB,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB;AAED,MAAM,CAAN,IAAY,KAIX;AAJD,WAAY,KAAK;IACf,4BAAmB,CAAA;IACnB,4BAAmB,CAAA;IACnB,yCAAgC,CAAA;AAClC,CAAC,EAJW,KAAK,KAAL,KAAK,QAIhB;AAED;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QASE;;;;;;WAMG;QAEC,UAAK,GAAwD,KAAK,CAAC,OAAO,CAAC;QAE/E;;;;;WAKG;QAEC,UAAK,GAA+B,KAAK,CAAC,KAAK,CAAC;IA6CtD,CAAC;IArCC;;OAEG;IACK,uBAAuB;QAC3B,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,kBAAkB,EAAE;YACpD,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;YAC1C,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,I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AC,KAAK,KAAK,SAAS;YACtD,4BAA4B,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS;YACtD,mCAAmC,EAAE,IAAI,CAAC,KAAK,KAAK,gBAAgB;YACpE,0BAA0B,EAAE,IAAI,CAAC,KAAK,KAAK,OAAO;YAClD,2BAA2B,EAAE,IAAI,CAAC,KAAK,KAAK,QAAQ;SACvD,CAAC,CAAC;QAEH,OAAO,IAAI,CAAA;eACF,kBAAkB;gBACjB,IAAI,CAAC,uBAAuB;kBAC1B,IAAI,CAAC,QAAQ;;cAEjB,IAAI,CAAC,IAAI;;;;;iBAKN,QAAQ;;;;cAIX,CAAC;IACb,CAAC;;AArEQ,oBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAMvB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACT;AAUd;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACoD;AAS3E;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACyB;AAMhD;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACL;AAyCzB,IAAI,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,SAAS,EAAE,CAAC;IACtD,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;AAC5D,CAAC;AAQD,eAAe,aAAa,CAAC","sourcesContent":["import classnames from 'classnames';\nimport { html, } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport svgClose from '@tmorrow/cre8-wc/icons/Close.svg?raw';\nimport { Cre8Element } from '../cre8-element';\nimport '../icon/icon';\nimport styles from './remove-tag.styles.js';\n\nexport enum Shape {\n Round = 'round',\n Square = 'square',\n}\n\nexport enum Color {\n Neutral = 'neutral',\n Branded = 'branded',\n NeutralHybrid = 'neutral-hybrid',\n}\n\n/**\n * Clicking a Remove Tag causes it to disappear from the page or field (in the case of Multi-Select).\n * These tags always display a \"Close\" icon.\n *\n * @fires remove-tag-click - Fires when the remove tag is clicked.\n */\nexport class Cre8RemoveTag extends Cre8Element {\n static styles = [styles];\n\n /**\n * The tag text\n */\n @property({ type: String })\n text?: string;\n\n /**\n * The tag color scheme\n *\n * - **neutral** should be used when doing non-link actions such as filters or multi-select, within forms, etc.\n * - **neutral-hybrid** should be used for when tags are doing an action like a button or a link\n * - **branded** should be used like Neutral, but for marketing / actionable items\n */\n @property({ type: String })\n color: Color.Neutral | Color.Branded | Color.NeutralHybrid = Color.Neutral;\n\n /**\n * The tag shape\n *\n * - **round** will give the tag a rounded border\n * - **square** will give the tag a squared border\n */\n @property({ type: String })\n shape: Shape.Round | Shape.Square = Shape.Round;\n\n /**\n * Disabled state for remove tag\n */\n @property({ type: Boolean })\n disabled?: boolean;\n\n /**\n * Dispatches an event when the tag is clicked\n */\n private _handleRemoveTagClicked() {\n const customEvent = new CustomEvent('remove-tag-click', {\n detail: { message: 'Remove Tag clicked.' },\n bubbles: true,\n composed: true,\n });\n this.dispatchWithLegacyAlias(customEvent);\n }\n\n render() {\n const componentClassName = classnames('cre8-c-remove-tag', {\n 'cre8-c-remove-tag--neutral': this.color === 'neutral',\n 'cre8-c-remove-tag--branded': this.color === 'branded',\n 'cre8-c-remove-tag--neutral-hybrid': this.color === 'neutral-hybrid',\n 'cre8-c-remove-tag--round': this.shape === 'round',\n 'cre8-c-remove-tag--square': this.shape === 'square',\n });\n\n return html` <button\n class=\"${componentClassName}\"\n @click=\"${this._handleRemoveTagClicked}\"\n ?disabled=${this.disabled}\n >\n <span>${this.text}</span>\n <div class=\"cre8-c-remove-tag-item__icon\">\n <cre8-icon\n width=\"16\"\n height=\"16\"\n svg=\"${svgClose}\"\n aria-hidden=\"true\"\n ></cre8-icon>\n </div>\n </button>`;\n }\n}\n\nif (customElements.get('cre8-remove-tag') === undefined) {\n customElements.define('cre8-remove-tag', Cre8RemoveTag);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-remove-tag': Cre8RemoveTag;\n }\n}\n\nexport default Cre8RemoveTag;\n"]}
|
|
@@ -2,6 +2,9 @@ import { Cre8Element } from '../cre8-element';
|
|
|
2
2
|
import '../button/button';
|
|
3
3
|
/**
|
|
4
4
|
* @slot - The component content , this will consist of the dropdown when the user clicks the caret
|
|
5
|
+
*
|
|
6
|
+
* @fires split-button-text-click - Fires when the main text button is clicked.
|
|
7
|
+
* @fires split-button-dropdown-click - Fires when the dropdown toggle is clicked.
|
|
5
8
|
*/
|
|
6
9
|
export declare class Cre8SplitButton extends Cre8Element {
|
|
7
10
|
static styles: import("lit").CSSResult[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../components/split-button/split-button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,kBAAkB,CAAC;AAG1B
|
|
1
|
+
{"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../components/split-button/split-button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,kBAAkB,CAAC;AAG1B;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC5C,MAAM,CAAC,MAAM,4BAAY;IAGvB,YAAY,UAAS;IAEzB;;OAEG;IAEC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;;;OAQG;IAEC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEvB;;OAEG;IAEC,UAAU,EAAE,MAAM,CAAC;IAEvB,MAAM;IAiCN,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,cAAc;CAIvB;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -11,6 +11,9 @@ import '../button/button';
|
|
|
11
11
|
import styles from './split-button.styles.js';
|
|
12
12
|
/**
|
|
13
13
|
* @slot - The component content , this will consist of the dropdown when the user clicks the caret
|
|
14
|
+
*
|
|
15
|
+
* @fires split-button-text-click - Fires when the main text button is clicked.
|
|
16
|
+
* @fires split-button-dropdown-click - Fires when the dropdown toggle is clicked.
|
|
14
17
|
*/
|
|
15
18
|
export class Cre8SplitButton extends Cre8Element {
|
|
16
19
|
constructor() {
|
|
@@ -49,11 +52,11 @@ export class Cre8SplitButton extends Cre8Element {
|
|
|
49
52
|
`;
|
|
50
53
|
}
|
|
51
54
|
_textClick(e) {
|
|
52
|
-
this.
|
|
55
|
+
this.dispatchWithLegacyAlias(new Event('split-button-text-click', e));
|
|
53
56
|
}
|
|
54
57
|
_dropdownClick(e) {
|
|
55
58
|
this.dropdownOpen = !this.dropdownOpen;
|
|
56
|
-
this.
|
|
59
|
+
this.dispatchWithLegacyAlias(new Event('split-button-dropdown-click', e));
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
Cre8SplitButton.styles = [styles];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.js","sourceRoot":"","sources":["../../../components/split-button/split-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,kBAAkB,CAAC;AAC1B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C
|
|
1
|
+
{"version":3,"file":"split-button.js","sourceRoot":"","sources":["../../../components/split-button/split-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAA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;IADH,QAAQ,EAAE;6CACY;AAMnB;IADH,QAAQ,EAAE;mDACY;AA6CzB,IAAI,cAAc,CAAC,GAAG,CAAC,mBAAmB,CAAC,KAAK,SAAS,EAAE,CAAC;IACxD,cAAc,CAAC,MAAM,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;AAChE,CAAC;AAQD,eAAe,eAAe,CAAC","sourcesContent":["import { html, } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { Cre8Element } from '../cre8-element';\nimport '../button/button';\nimport styles from './split-button.styles.js';\n\n/**\n * @slot - The component content , this will consist of the dropdown when the user clicks the caret\n *\n * @fires split-button-text-click - Fires when the main text button is clicked.\n * @fires split-button-dropdown-click - Fires when the dropdown toggle is clicked.\n */\nexport class Cre8SplitButton extends Cre8Element {\n static styles = [styles];\n\n @state()\n dropdownOpen = false;\n\n /**\n * Disables both the main button and the dropdown toggle.\n */\n @property({ type: Boolean, reflect: true })\n disabled?: boolean;\n\n /**\n * Size variant\n * <cre8-text-passage size=\"sm\">\n * <ul>\n * <li>**sm** shrinks the button typography and overall size</li>\n * <li>**lg** increases the button typography size and overall size</li>\n * </ul>\n * </cre8-text-passage>\n */\n @property()\n size?: 'sm' | 'lg';\n\n /**\n * Display text on the button\n */\n @property()\n buttonText: string;\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-split-button', {});\n\n return html`\n <div class=\"${componentClassNames}\">\n <div class=\"cre8-c-split-button__button-container\">\n <cre8-button\n class=\"cre8-c-split-button__text-button\"\n variant=\"secondary\"\n splitButtonType=\"text\"\n ?disabled=${this.disabled}\n text=\"${this.buttonText}\"\n size=\"${this.size}\"\n @click=\"${this._textClick}\"\n >\n </cre8-button>\n <cre8-button\n class=\"cre8-c-split-button__arrow-button\"\n variant=\"icon-only secondary\"\n splitButtonType=\"caret\"\n iconName=\"${this.dropdownOpen ? 'delta-down' : 'delta-up'}\"\n ?disabled=${this.disabled}\n hideText=\"true\"\n size=\"${this.size}\"\n @click=\"${this._dropdownClick}\"\n >\n </cre8-button>\n </div>\n ${this.dropdownOpen ? html`<slot></slot>` : ''}\n </div>\n `;\n }\n\n private _textClick(e: MouseEvent) {\n this.dispatchWithLegacyAlias(new Event('split-button-text-click', e));\n }\n\n private _dropdownClick(e: MouseEvent) {\n this.dropdownOpen = !this.dropdownOpen;\n this.dispatchWithLegacyAlias(new Event('split-button-dropdown-click', e));\n }\n}\n\nif (customElements.get('cre8-split-button') === undefined) {\n customElements.define('cre8-split-button', Cre8SplitButton);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-split-button': Cre8SplitButton;\n }\n}\n\nexport default Cre8SplitButton;\n"]}
|
|
@@ -3,7 +3,7 @@ import { Cre8Element } from '../cre8-element';
|
|
|
3
3
|
/**
|
|
4
4
|
* @slot - The component content
|
|
5
5
|
*
|
|
6
|
-
* @fires
|
|
6
|
+
* @fires tab-select - Fires when the tab is clicked. `event.detail.index` is the tab's index.
|
|
7
7
|
*/
|
|
8
8
|
export declare class Cre8Tab extends Cre8Element {
|
|
9
9
|
static styles: import("lit").CSSResult[];
|
|
@@ -11,7 +11,7 @@ import styles from './tab.styles.js';
|
|
|
11
11
|
/**
|
|
12
12
|
* @slot - The component content
|
|
13
13
|
*
|
|
14
|
-
* @fires
|
|
14
|
+
* @fires tab-select - Fires when the tab is clicked. `event.detail.index` is the tab's index.
|
|
15
15
|
*/
|
|
16
16
|
export class Cre8Tab extends Cre8Element {
|
|
17
17
|
/**
|
|
@@ -36,14 +36,14 @@ export class Cre8Tab extends Cre8Element {
|
|
|
36
36
|
* 1. Fire the custom event on click of a tab.
|
|
37
37
|
*/
|
|
38
38
|
_handleTabSelected() {
|
|
39
|
-
const customEvent = new CustomEvent('
|
|
39
|
+
const customEvent = new CustomEvent('tab-select', {
|
|
40
40
|
detail: {
|
|
41
41
|
index: this.index,
|
|
42
42
|
},
|
|
43
43
|
bubbles: true,
|
|
44
44
|
composed: true,
|
|
45
45
|
});
|
|
46
|
-
this.
|
|
46
|
+
this.dispatchWithLegacyAlias(customEvent);
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
49
|
const componentClassNames = this.componentClassNames('cre8-c-tab', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../../components/tab/tab.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC;;;;GAIG;AAEH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IA2CtC;;;;;OAKG;IACM,OAAO,CAAC,iBAAiC;QAChD,OAAO;QACL,IAAI,iBAAiB,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC1C,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC1D,CAAC;QACH,OAAO;QACL,IAAI,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACnE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpE,CAAC;IACL,CAAC;IAED;;;OAGG;IAEK,kBAAkB;QACtB,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../../components/tab/tab.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3C,O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;;;;;iBAMA,mBAAmB;iBACnB,IAAI,CAAC,kBAAkB;;;;KAInC,CAAC;IACJ,CAAC;;AA9FQ,cAAM,GAAG,CAAC,MAAM,CAAC,CAAC;AAUvB;IADH,QAAQ,EAAE;qCACK;AAQZ;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACpB;AAQnB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCACR;AAQf;IADH,QAAQ,EAAE;+CACiB;AAMxB;IADH,KAAK,CAAC,aAAa,CAAC;yCACW;AAyDlC,IAAI,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE,CAAC;IAC/C,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AAQD,eAAe,OAAO,CAAC","sourcesContent":["import { html, PropertyValues } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { Cre8Element } from '../cre8-element';\nimport styles from './tab.styles.js';\n\n/**\n * @slot - The component content\n *\n * @fires tab-select - Fires when the tab is clicked. `event.detail.index` is the tab's index.\n */\n\nexport class Cre8Tab extends Cre8Element {\n static styles = [styles];\n\n /**\n * Tab sizes\n * - **default** displays the tab text with cre8-typography-label-default\n * - **sm** displays the tab text with cre8-typography-label-small and decrease padding\n *\n * _*This property is dynamically set_\n */\n @property()\n size?: 'sm';\n\n /**\n * If is true, tab has active state and cooresponding tab panel is visible.\n *\n * _*This property is dynamically set_\n */\n @property({ type: Boolean, reflect: true })\n isActive?: boolean;\n\n /**\n * Used to align the tab with the tab panel\n *\n * _*This property is dynamically set_\n */\n @property({ type: Number })\n index?: number;\n\n /**\n * Used to connect tab trigger and tab panel for accessibility\n *\n * _*This property is dynamically set_\n */\n @property()\n ariaLabelledBy?: string;\n\n /**\n * Query the tab element\n */\n @query('.cre8-c-tab')\n _Cre8Tab: HTMLButtonElement;\n\n /**\n * Updated\n * 1. Called when the element's DOM has been updated and rendered.\n * 2. If has ariaLabelledBy, then set the tab ID with the value.\n * 3. If the tab is active, set the tabindex to 0 and aria-selected to true.\n */\n override updated(changedProperties: PropertyValues) {\n /* 2 */\n if (changedProperties.has('ariaLabelledBy')) {\n this._Cre8Tab.setAttribute('id', this.ariaLabelledBy);\n }\n /* 3 */\n if (changedProperties.has('isActive')) {\n this._Cre8Tab.setAttribute('tabindex', this.isActive ? '0' : '-1');\n this._Cre8Tab.setAttribute('aria-selected', `${this.isActive}`);\n }\n }\n\n /**\n * Handle Tab Selected\n * 1. Fire the custom event on click of a tab.\n */\n\n private _handleTabSelected() {\n const customEvent = new CustomEvent('tab-select', {\n detail: {\n index: this.index,\n },\n bubbles: true,\n composed: true,\n });\n this.dispatchWithLegacyAlias(customEvent);\n }\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-tab', {\n 'cre8-is-active': this.isActive,\n 'cre8-c-tab--small': this.size === 'sm',\n });\n\n return html`\n <button\n role=\"tab\"\n tabindex=\"-1\"\n aria-selected=\"false\"\n type=\"button\"\n class=\"${componentClassNames}\"\n @click=${this._handleTabSelected}\n >\n <slot></slot>\n </button>\n `;\n }\n}\n\nif (customElements.get('cre8-tab') === undefined) {\n customElements.define('cre8-tab', Cre8Tab);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-tab': Cre8Tab;\n }\n}\n\nexport default Cre8Tab;\n"]}
|
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
import { Cre8Element } from '../cre8-element';
|
|
2
|
+
/**
|
|
3
|
+
* One row in a data-driven table: either an object keyed by column `key`, or a
|
|
4
|
+
* plain array of cell values positioned to match `columns`.
|
|
5
|
+
*/
|
|
6
|
+
export type Cre8TableRowData = Record<string, string | number> | Array<string | number>;
|
|
7
|
+
/** One column in a data-driven table. */
|
|
8
|
+
export interface Cre8TableColumn {
|
|
9
|
+
/** Header text. Also stamped onto every cell beneath it as `dataHeader`. */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Key to read each row's value from, when rows are objects. */
|
|
12
|
+
key?: string;
|
|
13
|
+
/** Inline width for the column, e.g. `"20%"`. */
|
|
14
|
+
width?: string;
|
|
15
|
+
}
|
|
2
16
|
/**
|
|
3
17
|
* @slot - The component content
|
|
4
18
|
*/
|
|
5
19
|
export declare class Cre8Table extends Cre8Element {
|
|
6
20
|
static styles: import("lit").CSSResult[];
|
|
21
|
+
/**
|
|
22
|
+
* Columns for a data-driven table. Set this with `rows` and the table builds
|
|
23
|
+
* its own header, body, rows and cells — the same composition you would write
|
|
24
|
+
* by hand, generated into the light DOM, so nothing about styling or
|
|
25
|
+
* behaviour changes.
|
|
26
|
+
*
|
|
27
|
+
* Leave both unset to compose the table yourself with `cre8-table-header`,
|
|
28
|
+
* `cre8-table-body` and friends. Do not do both on one table.
|
|
29
|
+
*/
|
|
30
|
+
columns?: Cre8TableColumn[];
|
|
31
|
+
/**
|
|
32
|
+
* Rows for a data-driven table. Each row is either an object keyed by the
|
|
33
|
+
* columns' `key`, or an array of values positioned to match `columns`.
|
|
34
|
+
*/
|
|
35
|
+
rows?: Cre8TableRowData[];
|
|
7
36
|
/**
|
|
8
37
|
* Specifies the caption/title of the table, visible to all users.
|
|
9
38
|
* Increases accessibility of table.
|
|
@@ -32,6 +61,13 @@ export declare class Cre8Table extends Cre8Element {
|
|
|
32
61
|
* </cre8-text-passage>
|
|
33
62
|
*/
|
|
34
63
|
variant?: 'striped';
|
|
64
|
+
/**
|
|
65
|
+
* The composition `columns` and `rows` stand for. Kept as data rather than
|
|
66
|
+
* markup so the reconciler can update a cell in place instead of rebuilding
|
|
67
|
+
* the table under the user's cursor.
|
|
68
|
+
*/
|
|
69
|
+
private buildComposition;
|
|
70
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
35
71
|
render(): import("lit-html").TemplateResult<1>;
|
|
36
72
|
}
|
|
37
73
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../components/table/table.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../components/table/table.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;AAExF,yCAAyC;AACzC,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AAEH,qBAAa,SAAU,SAAQ,WAAW;IACtC,MAAM,CAAC,MAAM,4BAAY;IAE3B;;;;;;;;OAQG;IAEC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAEhC;;;OAGG;IAEC,IAAI,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAE9B;;;OAGG;IAEC,OAAO,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;OAOG;IAEC,QAAQ,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IAEC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;;;OAOG;IAEC,OAAO,CAAC,EAAE,SAAS,CAAC;IAExB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IA2CxB,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAMtD,MAAM;CAkBP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -7,11 +7,60 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { html, } from 'lit';
|
|
8
8
|
import { property } from 'lit/decorators.js';
|
|
9
9
|
import { Cre8Element } from '../cre8-element';
|
|
10
|
+
import { syncLightChildren } from '../utils/light-children';
|
|
10
11
|
import styles from './table.styles.js';
|
|
11
12
|
/**
|
|
12
13
|
* @slot - The component content
|
|
13
14
|
*/
|
|
14
15
|
export class Cre8Table extends Cre8Element {
|
|
16
|
+
/**
|
|
17
|
+
* The composition `columns` and `rows` stand for. Kept as data rather than
|
|
18
|
+
* markup so the reconciler can update a cell in place instead of rebuilding
|
|
19
|
+
* the table under the user's cursor.
|
|
20
|
+
*/
|
|
21
|
+
buildComposition() {
|
|
22
|
+
if (!this.columns && !this.rows)
|
|
23
|
+
return null;
|
|
24
|
+
const columns = this.columns ?? [];
|
|
25
|
+
const rows = this.rows ?? [];
|
|
26
|
+
const cell = (value, column, header = false) => ({
|
|
27
|
+
tag: header ? 'cre8-table-header-cell' : 'cre8-table-cell',
|
|
28
|
+
props: header
|
|
29
|
+
? { width: column?.width }
|
|
30
|
+
// `behavior="responsive"` stacks each cell under a repeat of its
|
|
31
|
+
// column header, which the cell reads from `dataHeader`. Writing
|
|
32
|
+
// that by hand means restating every header on every row.
|
|
33
|
+
: { dataHeader: column?.label },
|
|
34
|
+
text: value === undefined || value === null ? '' : String(value),
|
|
35
|
+
});
|
|
36
|
+
const composition = [];
|
|
37
|
+
if (columns.length) {
|
|
38
|
+
composition.push({
|
|
39
|
+
tag: 'cre8-table-header',
|
|
40
|
+
children: [
|
|
41
|
+
{
|
|
42
|
+
tag: 'cre8-table-row',
|
|
43
|
+
children: columns.map((column) => cell(column.label, column, true)),
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
composition.push({
|
|
49
|
+
tag: 'cre8-table-body',
|
|
50
|
+
children: rows.map((row) => ({
|
|
51
|
+
tag: 'cre8-table-row',
|
|
52
|
+
children: Array.isArray(row)
|
|
53
|
+
? row.map((value, i) => cell(value, columns[i]))
|
|
54
|
+
: columns.map((column) => cell(row[column.key ?? column.label], column)),
|
|
55
|
+
})),
|
|
56
|
+
});
|
|
57
|
+
return composition;
|
|
58
|
+
}
|
|
59
|
+
updated(changed) {
|
|
60
|
+
if (changed.has('columns') || changed.has('rows')) {
|
|
61
|
+
syncLightChildren(this, this.buildComposition());
|
|
62
|
+
}
|
|
63
|
+
}
|
|
15
64
|
render() {
|
|
16
65
|
const componentClassNames = this.componentClassNames('cre8-c-table', {
|
|
17
66
|
'cre8-c-table--hoverable': this.isHoverable,
|
|
@@ -31,6 +80,12 @@ export class Cre8Table extends Cre8Element {
|
|
|
31
80
|
}
|
|
32
81
|
}
|
|
33
82
|
Cre8Table.styles = [styles];
|
|
83
|
+
__decorate([
|
|
84
|
+
property({ type: Array })
|
|
85
|
+
], Cre8Table.prototype, "columns", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
property({ type: Array })
|
|
88
|
+
], Cre8Table.prototype, "rows", void 0);
|
|
34
89
|
__decorate([
|
|
35
90
|
property()
|
|
36
91
|
], Cre8Table.prototype, "caption", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../components/table/table.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,MAAM,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../components/table/table.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,GAAI,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAA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ACd,CAAC,CAAC,IAAI,CAAA;cACA,IAAI,CAAC,OAAO;qBACL;YACb,CAAC,CAAC,EAAE;UACF,IAAI,CAAA,eAAe;;KAExB,CAAC;IACJ,CAAC;;AAhIQ,gBAAM,GAAG,CAAC,MAAM,CAAC,CAAC;AAYvB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;0CACM;AAO5B;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;uCACI;AAO1B;IADH,QAAQ,EAAE;0CACU;AAWjB;IADH,QAAQ,EAAE;2CACiB;AAOxB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACjB;AAWtB;IADH,QAAQ,EAAE;0CACa;AA4E1B,IAAI,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,SAAS,EAAE,CAAC;IACjD,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AACnD,CAAC;AAQD,eAAe,SAAS,CAAC","sourcesContent":["import { html, } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Cre8Element } from '../cre8-element';\nimport { syncLightChildren, type ChildSpec } from '../utils/light-children';\nimport styles from './table.styles.js';\n\n\n/**\n * One row in a data-driven table: either an object keyed by column `key`, or a\n * plain array of cell values positioned to match `columns`.\n */\nexport type Cre8TableRowData = Record<string, string | number> | Array<string | number>;\n\n/** One column in a data-driven table. */\nexport interface Cre8TableColumn {\n /** Header text. Also stamped onto every cell beneath it as `dataHeader`. */\n label: string;\n /** Key to read each row's value from, when rows are objects. */\n key?: string;\n /** Inline width for the column, e.g. `\"20%\"`. */\n width?: string;\n}\n\n/**\n * @slot - The component content\n */\n\nexport class Cre8Table extends Cre8Element {\n static styles = [styles];\n\n /**\n * Columns for a data-driven table. Set this with `rows` and the table builds\n * its own header, body, rows and cells — the same composition you would write\n * by hand, generated into the light DOM, so nothing about styling or\n * behaviour changes.\n *\n * Leave both unset to compose the table yourself with `cre8-table-header`,\n * `cre8-table-body` and friends. Do not do both on one table.\n */\n @property({ type: Array })\n columns?: Cre8TableColumn[];\n\n /**\n * Rows for a data-driven table. Each row is either an object keyed by the\n * columns' `key`, or an array of values positioned to match `columns`.\n */\n @property({ type: Array })\n rows?: Cre8TableRowData[];\n\n /**\n * Specifies the caption/title of the table, visible to all users.\n * Increases accessibility of table.\n */\n @property()\n caption?: string;\n\n /**\n * Behavior variants\n * <cre8-text-passage size=\"sm\">\n * <ul>\n * <li>**responsive** stacks column headers with respective table cells on small screens</li>\n * </ul>\n * </cre8-text-passage>\n */\n @property()\n behavior?: 'responsive';\n\n /**\n * Hoverable rows variant\n * 1) Allows the table rows to be styled on hover\n */\n @property({ type: Boolean, reflect: true })\n isHoverable?: boolean;\n\n /**\n * Style variants\n * <cre8-text-passage size=\"sm\">\n * <ul>\n * <li>**striped** add zebra-striping to table rows within the `<tbody>`</li>\n * </ul>\n * </cre8-text-passage>\n */\n @property()\n variant?: 'striped';\n\n /**\n * The composition `columns` and `rows` stand for. Kept as data rather than\n * markup so the reconciler can update a cell in place instead of rebuilding\n * the table under the user's cursor.\n */\n private buildComposition(): ChildSpec[] | null {\n if (!this.columns && !this.rows) return null;\n const columns = this.columns ?? [];\n const rows = this.rows ?? [];\n\n const cell = (value: unknown, column?: Cre8TableColumn, header = false): ChildSpec => ({\n tag: header ? 'cre8-table-header-cell' : 'cre8-table-cell',\n props: header\n ? { width: column?.width }\n // `behavior=\"responsive\"` stacks each cell under a repeat of its\n // column header, which the cell reads from `dataHeader`. Writing\n // that by hand means restating every header on every row.\n : { dataHeader: column?.label },\n text: value === undefined || value === null ? '' : String(value),\n });\n\n const composition: ChildSpec[] = [];\n\n if (columns.length) {\n composition.push({\n tag: 'cre8-table-header',\n children: [\n {\n tag: 'cre8-table-row',\n children: columns.map((column) => cell(column.label, column, true)),\n },\n ],\n });\n }\n\n composition.push({\n tag: 'cre8-table-body',\n children: rows.map((row) => ({\n tag: 'cre8-table-row',\n children: Array.isArray(row)\n ? row.map((value, i) => cell(value, columns[i]))\n : columns.map((column) => cell(row[column.key ?? column.label], column)),\n })),\n });\n\n return composition;\n }\n\n protected updated(changed: Map<string, unknown>): void {\n if (changed.has('columns') || changed.has('rows')) {\n syncLightChildren(this, this.buildComposition());\n }\n }\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-table', {\n 'cre8-c-table--hoverable': this.isHoverable,\n 'cre8-c-table--striped': this.variant === 'striped',\n 'cre8-c-table--responsive': this.behavior === 'responsive',\n });\n\n return html`\n <table role=\"table\" class=\"${componentClassNames}\">\n ${this.caption\n ? html`<caption class=\"cre8-c-table__caption\">\n ${this.caption}\n </caption>`\n : ''}\n ${html`<slot></slot>`}\n </table>\n `;\n }\n}\n\nif (customElements.get('cre8-table') === undefined) {\n customElements.define('cre8-table', Cre8Table);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-table': Cre8Table;\n }\n}\n\nexport default Cre8Table;\n"]}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Cre8Element } from '../cre8-element';
|
|
2
2
|
import { Cre8TabPanel } from '../tab-panel/tab-panel';
|
|
3
3
|
import { Cre8Tab } from '../tab/tab';
|
|
4
|
+
/** One tab and its panel in a data-driven tab set. */
|
|
5
|
+
export interface Cre8TabItemData {
|
|
6
|
+
label: string;
|
|
7
|
+
/** Panel content. Omit to supply the panel yourself. */
|
|
8
|
+
content?: string;
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* Tabs are used to quickly navigate back and forth between views.
|
|
6
12
|
* The Tab design and interaction varies depending on the requirements for your organization and project.
|
|
@@ -27,6 +33,8 @@ import { Cre8Tab } from '../tab/tab';
|
|
|
27
33
|
*
|
|
28
34
|
* @slot default - Default, unnamed slot container for each `cre8-tab` button
|
|
29
35
|
* @slot panel - Container for each `cre8-tab-panel` content item
|
|
36
|
+
*
|
|
37
|
+
* @fires tab-change - Fires when the active tab changes. `event.detail` is `{ value, activeTabIndex }`.
|
|
30
38
|
*/
|
|
31
39
|
export declare class Cre8Tabs extends Cre8Element {
|
|
32
40
|
static styles: import("lit").CSSResult[];
|
|
@@ -185,7 +193,7 @@ export declare class Cre8Tabs extends Cre8Element {
|
|
|
185
193
|
* 2. If tab is active, make the previous selected tab inactive.
|
|
186
194
|
* 3. Set the clicked tab active.
|
|
187
195
|
* 4. Emit the custom event.
|
|
188
|
-
* @fires
|
|
196
|
+
* @fires tab-select
|
|
189
197
|
*/
|
|
190
198
|
handleTabSelected(event: MouseEvent): void;
|
|
191
199
|
/**
|
|
@@ -205,7 +213,7 @@ export declare class Cre8Tabs extends Cre8Element {
|
|
|
205
213
|
* 2. If current activeIndex is in first position then move the tab focus to last tab.
|
|
206
214
|
* 3. Set the active tab and focus.
|
|
207
215
|
* 4. Emit custom event.
|
|
208
|
-
* @fires
|
|
216
|
+
* @fires tab-change
|
|
209
217
|
*/
|
|
210
218
|
setSelectedToPreviousTab(currentTab: Cre8Tab): void;
|
|
211
219
|
/**
|
|
@@ -214,7 +222,7 @@ export declare class Cre8Tabs extends Cre8Element {
|
|
|
214
222
|
* 2. If current activeIndex is in last position then move the tab focus to first tab.
|
|
215
223
|
* 3. Set the active tab and focus.
|
|
216
224
|
* 4. Emit custom event.
|
|
217
|
-
* @fires
|
|
225
|
+
* @fires tab-change
|
|
218
226
|
*/
|
|
219
227
|
setSelectedToNextTab(currentTab: Cre8Tab): void;
|
|
220
228
|
/**
|
|
@@ -227,6 +235,15 @@ export declare class Cre8Tabs extends Cre8Element {
|
|
|
227
235
|
* Emit custom event
|
|
228
236
|
*/
|
|
229
237
|
emitEvent(): void;
|
|
238
|
+
/**
|
|
239
|
+
* Tabs for a data-driven tab set. Each entry becomes a `cre8-tab` in the
|
|
240
|
+
* default slot *and* a `cre8-tab-panel` in the `panel` slot, with matching
|
|
241
|
+
* indices — two slots kept in step, which is the part that goes wrong when
|
|
242
|
+
* these are written by hand.
|
|
243
|
+
*/
|
|
244
|
+
items?: Cre8TabItemData[];
|
|
245
|
+
/** The composition the data property stands for. */
|
|
246
|
+
private buildComposition;
|
|
230
247
|
render(): import("lit-html").TemplateResult<1>;
|
|
231
248
|
}
|
|
232
249
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../components/tabs/tabs.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../components/tabs/tabs.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC,sDAAsD;AACtD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,qBAAa,QAAS,SAAQ,WAAW;IACrC,MAAM,CAAC,MAAM,4BAAY;IAEzB;;;;;;OAMG;IAEH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;OAGG;IAEH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IAEH,WAAW,CAAC,EAAE,MAAM,CAAK;IAEzB;;;;OAIG;IAEH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IAEH,OAAO,CAAC,EAAE,OAAO,CAAQ;IAEzB;;;;;OAKG;IAEH,KAAK,CAAC,EAAE,OAAO,CAAS;IAExB;;OAEG;IAEH,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAE9B;;OAEG;IAEH,cA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