@nldd/design-system 0.26.1 → 0.26.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/custom-elements.json +5615 -1321
- package/dist/cdn/autoloader.js +141 -141
- package/dist/cdn/chunks/{accordion-item-Ca1o93cq.js → accordion-item-BXEHwzcv.js} +7 -7
- package/dist/cdn/chunks/{accordion-DA4IlxS5.js → accordion-qXirmNBj.js} +6 -6
- package/dist/cdn/chunks/{activity-indicator-Cj4H0Mbz.js → activity-indicator-DP61AhsJ.js} +13 -13
- package/dist/cdn/chunks/{admonition-CdZSoO8O.js → admonition-RnRSNAri.js} +11 -11
- package/dist/cdn/chunks/{avatar-Dhqn-Dmv.js → avatar-DsexiOhH.js} +18 -18
- package/dist/cdn/chunks/{avatar-group-B017eF-u.js → avatar-group-BrfrpXvd.js} +42 -40
- package/dist/cdn/chunks/{badge-Bep5B0_g.js → badge-BiQFOq2l.js} +15 -15
- package/dist/cdn/chunks/{banner-DGpIXuE2.js → banner-42zIYAEN.js} +16 -16
- package/dist/cdn/chunks/{bar-split-view-CKwJxd3e.js → bar-split-view-CjYEp276.js} +8 -8
- package/dist/cdn/chunks/{blockquote-ChMgaOuI.js → blockquote-qf4hJYvm.js} +8 -8
- package/dist/cdn/chunks/{box-BRmziG-6.js → box-CWyg7sbR.js} +5 -5
- package/dist/cdn/chunks/{breadcrumbs-BeVO8bkQ.js → breadcrumbs-BaHjYdz8.js} +13 -13
- package/dist/cdn/chunks/{button-cHBkq_s7.js → button-CKV-jwGY.js} +53 -54
- package/dist/cdn/chunks/{button-bar-CLxOdalJ.js → button-bar-DeJ81759.js} +8 -8
- package/dist/cdn/chunks/{button-group-BIvKtEIX.js → button-group-CuRkiHR5.js} +6 -6
- package/dist/cdn/chunks/{card-B5gp9Zly.js → card-DxeUNE3V.js} +10 -10
- package/dist/cdn/chunks/{cell-D4Nrd5Z9.js → cell-QaG8b-Qk.js} +13 -13
- package/dist/cdn/chunks/{checkbox-CeLTJhAc.js → checkbox-V0YerUKf.js} +26 -43
- package/dist/cdn/chunks/{checkbox-field-C8cU8fuf.js → checkbox-field-DeySECgv.js} +35 -43
- package/dist/cdn/chunks/checkbox-group-DFNy1y-A.js +91 -0
- package/dist/cdn/chunks/choice-group-AZsqoheP.js +64 -0
- package/dist/cdn/chunks/{class-map-xzscTu4B.js → class-map-CmgI2Tu-.js} +1 -1
- package/dist/cdn/chunks/{code-editor-BNhlXTSl.js → code-editor-BBMbUJ4d.js} +11 -11
- package/dist/cdn/chunks/{code-viewer-D_JwouYO.js → code-viewer-B8jse0-5.js} +25 -28
- package/dist/cdn/chunks/{codemirror-input-DJ0wgYrc.js → codemirror-input-BEotDTtZ.js} +5 -5
- package/dist/cdn/chunks/{collection-BXvz_OtU.js → collection-DRoS7Ona.js} +19 -19
- package/dist/cdn/chunks/{combo-box-8kbmoStb.js → combo-box-DA1ZQJJS.js} +69 -87
- package/dist/cdn/chunks/{container-Dq-2uHd5.js → container-F1i2pmko.js} +48 -48
- package/dist/cdn/chunks/{custom-element-DeaCQ2NP.js → custom-element-DD4ffKRs.js} +2 -2
- package/dist/cdn/chunks/{date-field-CQg1_73u.js → date-field-DVgisQnm.js} +33 -40
- package/dist/cdn/chunks/{date-picker-CTMxGOiA.js → date-picker-BaDTota3.js} +17 -17
- package/dist/cdn/chunks/{decorate-CCYde2ES.js → decorate-CeGXihRM.js} +1 -1
- package/dist/cdn/chunks/deep-active-element-DgiHjYGG.js +7 -0
- package/dist/cdn/chunks/{described-by-mixin-BYFim7aO.js → described-by-mixin-qFatR9dF.js} +2 -2
- package/dist/cdn/chunks/{description-cell-GcVeCz2_.js → description-cell-D45N4P1X.js} +12 -12
- package/dist/cdn/chunks/{dev-checks-CSlbfDuF.js → dev-checks-CkCD0tPh.js} +972 -922
- package/dist/cdn/chunks/{directive-helpers-DgaADFyY.js → directive-helpers-B9pcQxsE.js} +1 -1
- package/dist/cdn/chunks/{dist-CyDpBAaD.js → dist-BS_pQgb6.js} +2 -2
- package/dist/cdn/chunks/{dist-D4SViUJx.js → dist-Cl-rXzh7.js} +1 -1
- package/dist/cdn/chunks/{dist-1OQdP4ho.js → dist-DJQUgOKW.js} +3 -3
- package/dist/cdn/chunks/{dist-VCymi0hs.js → dist-DjlGttcc.js} +1 -1
- package/dist/cdn/chunks/{dist-DBxjWahH.js → dist-Dsyc1RGG.js} +1 -1
- package/dist/cdn/chunks/{dist-CcpLhc4y.js → dist-jTL_Kil1.js} +1 -1
- package/dist/cdn/chunks/{dist-B23jHvJ5.js → dist-mxb0NzAU.js} +1 -1
- package/dist/cdn/chunks/{dist-DLtwMUDc.js → dist-n8aCu6Kg.js} +2 -2
- package/dist/cdn/chunks/{dist-CNy2sPTt.js → dist-rjQNj-KZ.js} +2 -2
- package/dist/cdn/chunks/{dist-5vPsM2aV.js → dist-v62GtoI6.js} +1 -1
- package/dist/cdn/chunks/{dist-Da_liXcd.js → dist-v7yvd26H.js} +3 -3
- package/dist/cdn/chunks/{divider-8XD3xTbl.js → divider-CtMx3Byp.js} +2 -2
- package/dist/cdn/chunks/{document-tab-bar-RBAmckHS.js → document-tab-bar-SKSf69FX.js} +42 -53
- package/dist/cdn/chunks/{dropdown-DVlxPcjr.js → dropdown-se1zjYlw.js} +14 -14
- package/dist/cdn/chunks/{file-field-BrHnFplX.js → file-field-DW_Xt5O3.js} +42 -40
- package/dist/cdn/chunks/{floating-ui.dom-BvAAdCVe.js → floating-ui.dom-CB34tcZx.js} +1 -1
- package/dist/cdn/chunks/{form-DGHeGEIr.js → form-C9-eW3zc.js} +1 -1
- package/dist/cdn/chunks/{form-actions-CHwWKfMM.js → form-actions-Cy5tH1nk.js} +4 -4
- package/dist/cdn/chunks/form-associated-mixin-CA0F9CPx.js +123 -0
- package/dist/cdn/chunks/{form-field-CdTSI-8h.js → form-field-BMWm8VGS.js} +55 -11
- package/dist/cdn/chunks/{form-section-CjECOIiZ.js → form-section-DrrXc4wZ.js} +1 -1
- package/dist/cdn/chunks/{full-bleed-section-CQgq4iGQ.js → full-bleed-section-6QL0av4x.js} +5 -5
- package/dist/cdn/chunks/{hero-DhdcYt2N.js → hero-BThWV3MR.js} +19 -19
- package/dist/cdn/chunks/{icon-qpmEfU9B.js → icon-CVM6X_F1.js} +8 -8
- package/dist/cdn/chunks/{icon-button-DT_Bi4Ac.js → icon-button-h_sEz0Ia.js} +41 -38
- package/dist/cdn/chunks/{icon-cell-C-qrZAlN.js → icon-cell-C3Ygercd.js} +10 -10
- package/dist/cdn/chunks/{identity-DFmvuPkl.js → identity-BR0KxjM5.js} +12 -12
- package/dist/cdn/chunks/{if-defined-BINBE69I.js → if-defined-CvQli6P0.js} +1 -1
- package/dist/cdn/chunks/{image-B4M3h1xJ.js → image-D8H73DIj.js} +21 -21
- package/dist/cdn/chunks/{inline-dialog-L-NvjANF.js → inline-dialog-Dlu3bneh.js} +16 -16
- package/dist/cdn/chunks/interest-intent-Bk3i_upv.js +63 -0
- package/dist/cdn/chunks/{interest-controller-Ban-3NrX.js → interest-invoker-CfOJaqZQ.js} +28 -38
- package/dist/cdn/chunks/{just-in-time-education-CWplH4r9.js → just-in-time-education-DG0teV5g.js} +14 -14
- package/dist/cdn/chunks/{kanban-B6Wa-2aM.js → kanban-MNLyqki_.js} +25 -29
- package/dist/cdn/chunks/{kanban-column-D2-Xq79_.js → kanban-column-CGF_4Q0N.js} +10 -10
- package/dist/cdn/chunks/{keyboard-shortcut-Ci95olxF.js → keyboard-shortcut-DZDtndhS.js} +13 -13
- package/dist/cdn/chunks/{languages-C9AGuuSS.js → languages-BCn4J5Ck.js} +12 -12
- package/dist/cdn/chunks/{link-BJB2a_fG.js → link-CTj3dTmJ.js} +18 -18
- package/dist/cdn/chunks/{link-group-aNoedLZo.js → link-group--C486tYV.js} +7 -7
- package/dist/cdn/chunks/{list-CZWX62tH.js → list-DApLHKj-.js} +110 -95
- package/dist/cdn/chunks/{list-item-DHzsbK_S.js → list-item-BN9uuvXr.js} +50 -29
- package/dist/cdn/chunks/{list-item-segment-CHLlU9Gg.js → list-item-segment-CvdZT9Ni.js} +23 -20
- package/dist/cdn/chunks/{menu-NGpB1SKq.js → menu-2-9LtMLY.js} +113 -101
- package/dist/cdn/chunks/{menu-bar-CJazkmY7.js → menu-bar-g-O3_TNl.js} +59 -60
- package/dist/cdn/chunks/{menu-bar-item-CSqXWNKE.js → menu-bar-item-tOFEx-lS.js} +35 -35
- package/dist/cdn/chunks/{menu-divider-Cn1hTpcM.js → menu-divider-Dmv0lMHV.js} +3 -3
- package/dist/cdn/chunks/{menu-group-C71K1Vmv.js → menu-group-Ci9QUUwZ.js} +4 -4
- package/dist/cdn/chunks/{menu-item-TqBlQfI2.js → menu-item-BnIbV4yo.js} +4 -4
- package/dist/cdn/chunks/{menu.template-DthELYky.js → menu.template-sPjaMfc8.js} +4 -4
- package/dist/cdn/chunks/{modal-dialog-0V2HsrJC.js → modal-dialog-D-jAbabe.js} +28 -78
- package/dist/cdn/chunks/modal-overlay-Bx0bYzF3.js +95 -0
- package/dist/cdn/chunks/{multi-line-text-field-BV4uUDoK.js → multi-line-text-field-uBZqAdr6.js} +28 -45
- package/dist/cdn/chunks/{navigation-split-view-tPhkxEVD.js → navigation-split-view-DARbBPq-.js} +10 -10
- package/dist/cdn/chunks/{notification-CZccv6qx.js → notification-CntIGoYh.js} +12 -12
- package/dist/cdn/chunks/{number-field-4R2blHda.js → number-field-C0MTabLP.js} +26 -32
- package/dist/cdn/chunks/{one-half-one-half-section-h2fLPQfP.js → one-half-one-half-section-DYzf6LtU.js} +6 -6
- package/dist/cdn/chunks/{one-third-two-thirds-section-mqUAH5lK.js → one-third-two-thirds-section-AAiaxCHH.js} +6 -6
- package/dist/cdn/chunks/{one-time-code-field-Bf_qymKd.js → one-time-code-field-CCILuCy1.js} +25 -38
- package/dist/cdn/chunks/overflow-menu-DFoh3xL_.js +83 -0
- package/dist/cdn/chunks/overlay-invoker-Dj6MQAtF.js +97 -0
- package/dist/cdn/chunks/{page-Kipfvmi6.js → page-BDXLREou.js} +41 -19
- package/dist/cdn/chunks/{page-footer-DxE966Oe.js → page-footer-BsVMZCXs.js} +13 -13
- package/dist/cdn/chunks/{page-section-mixin-DpF9JDpd.js → page-section-mixin-L0bl3wCm.js} +21 -21
- package/dist/cdn/chunks/{pagination-DUFFhaU8.js → pagination-DLwbSZdO.js} +13 -13
- package/dist/cdn/chunks/{password-field-DdYAVmF3.js → password-field-DKTJgEyb.js} +28 -45
- package/dist/cdn/chunks/{popover-CRHxyhGx.js → popover-RB7uLASo.js} +66 -65
- package/dist/cdn/chunks/{progress-bar-BuYsjmSo.js → progress-bar-DnXWbmiw.js} +26 -26
- package/dist/cdn/chunks/{progress-circle-Cvu1bfNG.js → progress-circle-S89MUtU8.js} +24 -24
- package/dist/cdn/chunks/{radio-button-B_4AxWDx.js → radio-button-B31lAjlk.js} +17 -26
- package/dist/cdn/chunks/{radio-button-field-D7jIg6Oi.js → radio-button-field-BF4MHiOQ.js} +29 -37
- package/dist/cdn/chunks/radio-button-group-BQUqV8wJ.js +112 -0
- package/dist/cdn/chunks/{render-marked-CIuiSS_8.js → render-marked-ChJNzktf.js} +1 -1
- package/dist/cdn/chunks/{reorder-handle-cell-DNPaZjSC.js → reorder-handle-cell-SEERkeh7.js} +7 -7
- package/dist/cdn/chunks/{reorder-handle-mixin-CgvWq4fF.js → reorder-handle-mixin-tWe9XTjZ.js} +2 -2
- package/dist/cdn/chunks/{repeat-DfVuWl6o.js → repeat-CdCK17GF.js} +2 -2
- package/dist/cdn/chunks/{return-focus-D0fF2hjd.js → return-focus-CpwHVxYU.js} +10 -14
- package/dist/cdn/chunks/{rich-text-CVHlMQY6.js → rich-text-vVWOndD2.js} +3 -3
- package/dist/cdn/chunks/{row-header-mixin-B25JK2B3.js → row-header-mixin-6MoJ5Mjq.js} +2 -2
- package/dist/cdn/chunks/{scroll-fade-Dv57rTww.js → scroll-fade-Cr7_IXpU.js} +4 -4
- package/dist/cdn/chunks/{search-field-hmD_DXbG.js → search-field-C9urWH_J.js} +33 -58
- package/dist/cdn/chunks/{segmented-control-e8e-jYSw.js → segmented-control-DkILAMOJ.js} +92 -103
- package/dist/cdn/chunks/{shadow-resets-CRdvf-Ei.js → shadow-resets-9v6K-Fie.js} +2 -2
- package/dist/cdn/chunks/{sheet-D09y3J45.js → sheet-D89xI-KY.js} +40 -90
- package/dist/cdn/chunks/{shell-CV3gooGg.js → shell-CFmfUD0_.js} +5 -5
- package/dist/cdn/chunks/{side-by-side-split-view-Ckz1C9zk.js → side-by-side-split-view-ir9c0mwZ.js} +8 -8
- package/dist/cdn/chunks/{sidebar-section-CdyD-x4t.js → sidebar-section-BhJXels3.js} +14 -14
- package/dist/cdn/chunks/{simple-section-CEf38rBZ.js → simple-section-CMoYuLYV.js} +7 -7
- package/dist/cdn/chunks/{skip-link-DMRhATWw.js → skip-link-rUQq0D-l.js} +7 -7
- package/dist/cdn/chunks/{slider-Db3FPiP6.js → slider-CIQqjKUo.js} +30 -37
- package/dist/cdn/chunks/{spacer-BPFIYueo.js → spacer-CD85egxE.js} +8 -8
- package/dist/cdn/chunks/{spacer-cell-kITa3CDV.js → spacer-cell-B33mGdru.js} +6 -6
- package/dist/cdn/chunks/{split-button-CJs9-Nha.js → split-button-COL7r-wa.js} +21 -21
- package/dist/cdn/chunks/{split-view-divider-lHlM1Ss8.js → split-view-divider-DVBuBzeO.js} +5 -5
- package/dist/cdn/chunks/{split-view-pane-DlsbZtyo.js → split-view-pane-CSvIzeBg.js} +7 -7
- package/dist/cdn/chunks/{stacked-split-view-uRSVhrMd.js → stacked-split-view-onSk2QEi.js} +8 -8
- package/dist/cdn/chunks/{static-html-BahSPV_4.js → static-html-Cyhp44gp.js} +1 -1
- package/dist/cdn/chunks/{status-bar-DCJLVpsW.js → status-bar-CjYXOQAX.js} +8 -8
- package/dist/cdn/chunks/{step-bar-CRR2jiyo.js → step-bar-D-To0TEw.js} +18 -18
- package/dist/cdn/chunks/{step-cell-CbtKxJNJ.js → step-cell-B7sVGixc.js} +15 -15
- package/dist/cdn/chunks/{stepper-Con1_CnB.js → stepper-h6boMOhz.js} +16 -26
- package/dist/cdn/chunks/{style-map-uOwLerwV.js → style-map-BrdTV34-.js} +1 -1
- package/dist/cdn/chunks/{swatch-picker-Bqn0eaC9.js → swatch-picker-gQ3m3y9U.js} +63 -69
- package/dist/cdn/chunks/{switch-CMQcLEBJ.js → switch-DC-BTi9E.js} +25 -42
- package/dist/cdn/chunks/{switch-field-D9kWq4Kw.js → switch-field-D82mLobj.js} +19 -32
- package/dist/cdn/chunks/{tab-bar-DXzyZI3V.js → tab-bar-sKiFzvfj.js} +34 -29
- package/dist/cdn/chunks/{table-CWACLpHx.js → table-CuxZfCZD.js} +15 -15
- package/dist/cdn/chunks/{tag-Bo4yJbtF.js → tag-DP_ome5l.js} +11 -11
- package/dist/cdn/chunks/{term-CQ379ZbN.js → term-BdiTV-Jk.js} +42 -39
- package/dist/cdn/chunks/{text-D-dFoj6N.js → text-C-b1ygHI.js} +29 -29
- package/dist/cdn/chunks/{text-cell-Be1hStxp.js → text-cell-DfRh7JqZ.js} +23 -23
- package/dist/cdn/chunks/{text-editor-BjzQEBWm.js → text-editor-DuT9Rrpv.js} +12 -12
- package/dist/cdn/chunks/{text-field-DA8nirp6.js → text-field-kAbXzkUj.js} +28 -45
- package/dist/cdn/chunks/{time-field-Dd_TxJuf.js → time-field-DUz9ifmn.js} +65 -153
- package/dist/cdn/chunks/{time-picker-B0-rv1qp.js → time-picker-DGOKwC9T.js} +119 -40
- package/dist/cdn/chunks/{title-DOoPdG_i.js → title-BA-SUyAq.js} +12 -12
- package/dist/cdn/chunks/{title-cell-BzCNOMGr.js → title-cell-Cu5NFNUu.js} +23 -23
- package/dist/cdn/chunks/{toggle-button-9PbDHviQ.js → toggle-button-J6UapeqB.js} +41 -54
- package/dist/cdn/chunks/{toggle-button-group-C-H-xp0M.js → toggle-button-group-wrps-tL9.js} +40 -54
- package/dist/cdn/chunks/{token-CMKFC3gz.js → token-DJkyJz-k.js} +32 -35
- package/dist/cdn/chunks/{token-field-D4-XHfnG.js → token-field-SiBFPD8-.js} +67 -57
- package/dist/cdn/chunks/{toolbar-z9OhEE5l.js → toolbar-be8hoSAz.js} +34 -78
- package/dist/cdn/chunks/{toolbar-item-ZYoyKOyy.js → toolbar-item-DPizdgYi.js} +3 -3
- package/dist/cdn/chunks/{toolbar-title-FKtQ8ZC4.js → toolbar-title-CB4IJFGv.js} +4 -4
- package/dist/cdn/chunks/{toolbar.styles-DDjpdCHV.js → toolbar.styles-vmMPyzS_.js} +3 -3
- package/dist/cdn/chunks/{tooltip-BvRNYRo3.js → tooltip-Bg2ovCCg.js} +116 -80
- package/dist/cdn/chunks/{top-navigation-bar-BHPQntER.js → top-navigation-bar-vA8wpJXS.js} +29 -29
- package/dist/cdn/chunks/{top-title-bar-BVjegLlh.js → top-title-bar-BAJGmgnj.js} +16 -16
- package/dist/cdn/chunks/{translations-cJjO6nQV.js → translations-Cjd13Xb6.js} +1 -1
- package/dist/cdn/chunks/{two-thirds-one-third-section-BdBHQuXc.js → two-thirds-one-third-section-D1FvorKO.js} +6 -6
- package/dist/cdn/chunks/{validation-list-5E3-3_95.js → validation-list-D3rKnfTu.js} +12 -12
- package/dist/cdn/chunks/{visibility-mixin-DvRe3O8t.js → visibility-mixin-BRMACV1l.js} +14 -14
- package/dist/cdn/chunks/{visually-hidden-F85D_HcR.js → visually-hidden-BukWRiJA.js} +2 -2
- package/dist/cdn/chunks/{window-CabW35M1.js → window-C9njVzzK.js} +44 -80
- package/dist/cdn/chunks/{with-translations-BHDG37HJ.js → with-translations-BLzHPSUF.js} +3 -3
- package/dist/components/actions/button/button.d.ts +15 -13
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +15 -14
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.template.js +1 -1
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/button-bar/button-bar.d.ts +7 -4
- package/dist/components/actions/button-bar/button-bar.d.ts.map +1 -1
- package/dist/components/actions/button-bar/button-bar.js +6 -4
- package/dist/components/actions/button-bar/button-bar.js.map +1 -1
- package/dist/components/actions/button-group/button-group.d.ts +4 -2
- package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.js +4 -2
- package/dist/components/actions/button-group/button-group.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +13 -11
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +13 -12
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.js +4 -0
- package/dist/components/actions/icon-button/icon-button.styles.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu-group.d.ts +1 -1
- package/dist/components/actions/menu/menu-group.js +1 -1
- package/dist/components/actions/menu/menu-item.d.ts +4 -4
- package/dist/components/actions/menu/menu-item.js +4 -4
- package/dist/components/actions/menu/menu.d.ts +61 -38
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +92 -102
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/split-button/split-button.d.ts +5 -3
- package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.js +6 -4
- package/dist/components/actions/split-button/split-button.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar-item.d.ts +1 -1
- package/dist/components/actions/toolbar/toolbar-item.js +1 -1
- package/dist/components/actions/toolbar/toolbar-title.d.ts +1 -1
- package/dist/components/actions/toolbar/toolbar-title.js +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +10 -8
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +11 -9
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.js +5 -9
- package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
- package/dist/components/content/accordion/accordion.d.ts +2 -0
- package/dist/components/content/accordion/accordion.d.ts.map +1 -1
- package/dist/components/content/accordion/accordion.js +2 -0
- package/dist/components/content/accordion/accordion.js.map +1 -1
- package/dist/components/content/admonition/admonition.d.ts +2 -0
- package/dist/components/content/admonition/admonition.d.ts.map +1 -1
- package/dist/components/content/admonition/admonition.js +2 -0
- package/dist/components/content/admonition/admonition.js.map +1 -1
- package/dist/components/content/avatar/avatar.d.ts +3 -1
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +3 -1
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts +8 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.js +10 -9
- package/dist/components/content/avatar-group/avatar-group.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.js +0 -1
- package/dist/components/content/avatar-group/avatar-group.template.js.map +1 -1
- package/dist/components/content/blockquote/blockquote.d.ts +3 -1
- package/dist/components/content/blockquote/blockquote.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.js +3 -1
- package/dist/components/content/blockquote/blockquote.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts +1 -0
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +9 -9
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/icon/icon.d.ts +4 -3
- package/dist/components/content/icon/icon.d.ts.map +1 -1
- package/dist/components/content/icon/icon.js +4 -3
- package/dist/components/content/icon/icon.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts +4 -1
- package/dist/components/content/identity/identity.d.ts.map +1 -1
- package/dist/components/content/identity/identity.js +4 -1
- package/dist/components/content/identity/identity.js.map +1 -1
- package/dist/components/content/image/image.d.ts +11 -9
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +10 -8
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/image/lqip-encoder-element.d.ts +1 -1
- package/dist/components/content/image/lqip-encoder-element.js +1 -1
- package/dist/components/content/image/lqip-encoder.d.ts +3 -3
- package/dist/components/content/image/lqip-encoder.js +6 -6
- package/dist/components/content/image/lqip-encoder.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts +6 -5
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js +6 -5
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +3 -1
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +3 -1
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/tag/tag.d.ts +5 -3
- package/dist/components/content/tag/tag.d.ts.map +1 -1
- package/dist/components/content/tag/tag.js +5 -3
- package/dist/components/content/tag/tag.js.map +1 -1
- package/dist/components/content/term/term.d.ts +7 -5
- package/dist/components/content/term/term.d.ts.map +1 -1
- package/dist/components/content/term/term.js +24 -23
- package/dist/components/content/term/term.js.map +1 -1
- package/dist/components/content/term/term.template.js +1 -1
- package/dist/components/content/term/term.template.js.map +1 -1
- package/dist/components/content/text/text.d.ts +9 -7
- package/dist/components/content/text/text.d.ts.map +1 -1
- package/dist/components/content/text/text.js +9 -7
- package/dist/components/content/text/text.js.map +1 -1
- package/dist/components/content/title/title.d.ts +2 -0
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +2 -0
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/content/token/token.d.ts +11 -9
- package/dist/components/content/token/token.d.ts.map +1 -1
- package/dist/components/content/token/token.js +36 -37
- package/dist/components/content/token/token.js.map +1 -1
- package/dist/components/content/token/token.template.js +1 -1
- package/dist/components/content/token/token.template.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +27 -8
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +122 -127
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.template.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.template.js +2 -1
- package/dist/components/content/tooltip/tooltip.template.js.map +1 -1
- package/dist/components/content/visually-hidden/visually-hidden.d.ts +3 -1
- package/dist/components/content/visually-hidden/visually-hidden.d.ts.map +1 -1
- package/dist/components/content/visually-hidden/visually-hidden.js +3 -1
- package/dist/components/content/visually-hidden/visually-hidden.js.map +1 -1
- package/dist/components/forms/form/form.d.ts +2 -2
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +20 -16
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-actions/form-actions.d.ts +15 -11
- package/dist/components/forms/form-actions/form-actions.d.ts.map +1 -1
- package/dist/components/forms/form-actions/form-actions.js +15 -11
- package/dist/components/forms/form-actions/form-actions.js.map +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +9 -5
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +13 -6
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.js +44 -0
- package/dist/components/forms/form-field/form-field.styles.js.map +1 -1
- package/dist/components/forms/form-section/form-section.d.ts.map +1 -1
- package/dist/components/forms/form-section/form-section.js +34 -30
- package/dist/components/forms/form-section/form-section.js.map +1 -1
- package/dist/components/forms/validation-list/validation-list.d.ts +1 -0
- package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.js +1 -0
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.d.ts +4 -5
- package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.js +6 -24
- package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts +3 -5
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.js +10 -17
- package/dist/components/inputs/checkbox-field/checkbox-field.js.map +1 -1
- package/dist/components/inputs/checkbox-group/checkbox-group.d.ts +3 -9
- package/dist/components/inputs/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-group/checkbox-group.js +20 -59
- package/dist/components/inputs/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.d.ts +2 -1
- package/dist/components/inputs/code-editor/code-editor.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts +11 -10
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +30 -61
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.d.ts +8 -5
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.js +11 -17
- package/dist/components/inputs/date-field/date-field.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.d.ts +8 -0
- package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.js +8 -0
- package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts +7 -5
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +7 -5
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts +10 -6
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.js +19 -21
- package/dist/components/inputs/file-field/file-field.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts +7 -8
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js +9 -27
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js.map +1 -1
- package/dist/components/inputs/number-field/number-field.d.ts +7 -4
- package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.js +15 -17
- package/dist/components/inputs/number-field/number-field.js.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts +5 -6
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js +6 -19
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.d.ts +4 -5
- package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.js +6 -24
- package/dist/components/inputs/password-field/password-field.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.d.ts +3 -5
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +3 -11
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts +4 -6
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.js +7 -14
- package/dist/components/inputs/radio-button-field/radio-button-field.js.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts +3 -10
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.js +19 -74
- package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts +5 -6
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +9 -37
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +13 -14
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +18 -52
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/slider/slider.d.ts +4 -5
- package/dist/components/inputs/slider/slider.d.ts.map +1 -1
- package/dist/components/inputs/slider/slider.js +4 -15
- package/dist/components/inputs/slider/slider.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.d.ts +3 -4
- package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.js +4 -14
- package/dist/components/inputs/stepper/stepper.js.map +1 -1
- package/dist/components/inputs/swatch-picker/swatch-picker.d.ts +6 -6
- package/dist/components/inputs/swatch-picker/swatch-picker.d.ts.map +1 -1
- package/dist/components/inputs/swatch-picker/swatch-picker.js +10 -31
- package/dist/components/inputs/swatch-picker/swatch-picker.js.map +1 -1
- package/dist/components/inputs/switch/switch.d.ts +6 -7
- package/dist/components/inputs/switch/switch.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.js +8 -25
- package/dist/components/inputs/switch/switch.js.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.d.ts +3 -4
- package/dist/components/inputs/switch-field/switch-field.d.ts.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.js +4 -16
- package/dist/components/inputs/switch-field/switch-field.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.d.ts +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.commands.d.ts +3 -3
- package/dist/components/inputs/text-editor/text-editor.commands.js +5 -5
- package/dist/components/inputs/text-editor/text-editor.commands.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.d.ts +6 -6
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +10 -8
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.d.ts +2 -2
- package/dist/components/inputs/text-editor/text-editor.links.js +2 -2
- package/dist/components/inputs/text-editor/text-editor.mention.d.ts +3 -3
- package/dist/components/inputs/text-editor/text-editor.mention.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mention.js +3 -3
- package/dist/components/inputs/text-editor/text-editor.mention.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.d.ts +7 -8
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.js +9 -27
- package/dist/components/inputs/text-field/text-field.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.d.ts +11 -3
- package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.js +26 -15
- package/dist/components/inputs/time-field/time-field.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.styles.js +0 -7
- package/dist/components/inputs/time-field/time-field.styles.js.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.d.ts +13 -7
- package/dist/components/inputs/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.js +21 -14
- package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts +6 -7
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +9 -21
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts +3 -11
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js +24 -78
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.d.ts +29 -25
- package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.js +50 -50
- package/dist/components/inputs/token-field/token-field.js.map +1 -1
- package/dist/components/layout/box/box.d.ts +4 -2
- package/dist/components/layout/box/box.d.ts.map +1 -1
- package/dist/components/layout/box/box.js +4 -2
- package/dist/components/layout/box/box.js.map +1 -1
- package/dist/components/layout/card/card.d.ts +3 -1
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.js +3 -1
- package/dist/components/layout/card/card.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +3 -1
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +3 -1
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +7 -5
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +7 -5
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/divider/divider.d.ts +2 -0
- package/dist/components/layout/divider/divider.d.ts.map +1 -1
- package/dist/components/layout/divider/divider.js +2 -0
- package/dist/components/layout/divider/divider.js.map +1 -1
- package/dist/components/layout/kanban/kanban.d.ts +1 -1
- package/dist/components/layout/kanban/kanban.d.ts.map +1 -1
- package/dist/components/layout/kanban/kanban.js +3 -7
- package/dist/components/layout/kanban/kanban.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +12 -3
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +49 -3
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page/page.styles.d.ts.map +1 -1
- package/dist/components/layout/page/page.styles.js +7 -0
- package/dist/components/layout/page/page.styles.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts +1 -0
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +1 -0
- package/dist/components/layout/page-footer/page-footer.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +1 -0
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +1 -0
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +1 -0
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +1 -0
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +1 -0
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js +1 -0
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +1 -0
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +1 -0
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +7 -5
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +7 -5
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +2 -0
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.js +2 -0
- package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +1 -0
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +1 -0
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts +30 -6
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +50 -129
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/popover/popover.styles.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.styles.js +6 -0
- package/dist/components/layout/popover/popover.styles.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +9 -38
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +15 -174
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.js +1 -0
- package/dist/components/layout/sheet/sheet.styles.js.map +1 -1
- package/dist/components/layout/sheet/sheet.template.js +5 -5
- package/dist/components/layout/sheet/sheet.template.js.map +1 -1
- package/dist/components/layout/shell/shell.d.ts +2 -1
- package/dist/components/layout/shell/shell.d.ts.map +1 -1
- package/dist/components/layout/shell/shell.js +2 -1
- package/dist/components/layout/shell/shell.js.map +1 -1
- package/dist/components/layout/spacer/spacer.d.ts +7 -5
- package/dist/components/layout/spacer/spacer.d.ts.map +1 -1
- package/dist/components/layout/spacer/spacer.js +7 -5
- package/dist/components/layout/spacer/spacer.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +3 -2
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +3 -2
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +5 -3
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +5 -3
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +4 -2
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +4 -2
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js.map +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.d.ts +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.js +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.d.ts +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts +2 -0
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js +2 -0
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +4 -30
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +14 -139
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/layout/window/window.template.d.ts.map +1 -1
- package/dist/components/layout/window/window.template.js +5 -4
- package/dist/components/layout/window/window.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts +2 -2
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js +2 -2
- package/dist/components/lists-and-tables/cells/reorder-handle-cell/reorder-handle-cell.d.ts +2 -1
- package/dist/components/lists-and-tables/cells/reorder-handle-cell/reorder-handle-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/reorder-handle-cell/reorder-handle-cell.js +2 -1
- package/dist/components/lists-and-tables/cells/reorder-handle-cell/reorder-handle-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.d.ts +1 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.js +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts +2 -2
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js +2 -2
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +7 -7
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +7 -7
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +3 -3
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +3 -3
- package/dist/components/lists-and-tables/list/list.d.ts +42 -64
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +71 -168
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.roving.d.ts +79 -0
- package/dist/components/lists-and-tables/list/list.roving.d.ts.map +1 -0
- package/dist/components/lists-and-tables/list/list.roving.js +122 -0
- package/dist/components/lists-and-tables/list/list.roving.js.map +1 -0
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +63 -47
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +68 -55
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +12 -11
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +13 -13
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +8 -5
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +8 -5
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +1 -0
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js +1 -0
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +7 -6
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +15 -64
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +14 -9
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +6 -4
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.js +6 -4
- package/dist/components/navigation/link/link.js.map +1 -1
- package/dist/components/navigation/link-group/link-group.d.ts +3 -3
- package/dist/components/navigation/link-group/link-group.js +3 -3
- package/dist/components/navigation/menu-bar/menu-bar.d.ts +14 -18
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +47 -72
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.template.js +2 -2
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +5 -6
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +17 -33
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.d.ts +4 -3
- package/dist/components/navigation/pagination/pagination.d.ts.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +4 -3
- package/dist/components/navigation/pagination/pagination.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.d.ts +1 -0
- package/dist/components/navigation/skip-link/skip-link.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.js +1 -0
- package/dist/components/navigation/skip-link/skip-link.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +12 -4
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +22 -6
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js +4 -2
- package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +2 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +2 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +2 -0
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +2 -0
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.styles.js +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +10 -8
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +11 -9
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.d.ts +3 -1
- package/dist/components/status-and-feedback/badge/badge.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.js +3 -1
- package/dist/components/status-and-feedback/badge/badge.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.d.ts +7 -5
- package/dist/components/status-and-feedback/banner/banner.d.ts.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.js +6 -4
- package/dist/components/status-and-feedback/banner/banner.js.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts +5 -3
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +5 -3
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts +4 -2
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js +4 -2
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +5 -23
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +7 -125
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.js +5 -3
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts +3 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +3 -1
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts +5 -3
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js +5 -3
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts +4 -2
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js +4 -2
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +2 -0
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.js +2 -0
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +2 -0
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.js +2 -0
- package/dist/components/status-and-feedback/step-bar/step-bar.js.map +1 -1
- package/dist/css/document-reset.css +9 -0
- package/dist/nldd.min.js +929 -865
- package/dist/types/react.d.ts +156 -62
- package/dist/types/vue.d.ts +255 -74
- package/dist/utilities/ancestor-scroll.d.ts +15 -0
- package/dist/utilities/ancestor-scroll.d.ts.map +1 -0
- package/dist/utilities/ancestor-scroll.js +24 -0
- package/dist/utilities/ancestor-scroll.js.map +1 -0
- package/dist/utilities/choice-group.d.ts +91 -0
- package/dist/utilities/choice-group.d.ts.map +1 -0
- package/dist/utilities/choice-group.js +135 -0
- package/dist/utilities/choice-group.js.map +1 -0
- package/dist/utilities/deep-active-element.d.ts +6 -0
- package/dist/utilities/deep-active-element.d.ts.map +1 -0
- package/dist/utilities/deep-active-element.js +11 -0
- package/dist/utilities/deep-active-element.js.map +1 -0
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
- package/dist/utilities/dev-rules.generated.js +972 -922
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/form-associated-mixin.d.ts +21 -5
- package/dist/utilities/form-associated-mixin.d.ts.map +1 -1
- package/dist/utilities/form-associated-mixin.js +86 -5
- package/dist/utilities/form-associated-mixin.js.map +1 -1
- package/dist/utilities/interest-intent.d.ts +63 -0
- package/dist/utilities/interest-intent.d.ts.map +1 -0
- package/dist/utilities/interest-intent.js +139 -0
- package/dist/utilities/interest-intent.js.map +1 -0
- package/dist/utilities/{interest-controller.d.ts → interest-invoker.d.ts} +5 -14
- package/dist/utilities/interest-invoker.d.ts.map +1 -0
- package/dist/utilities/{interest-controller.js → interest-invoker.js} +39 -97
- package/dist/utilities/interest-invoker.js.map +1 -0
- package/dist/utilities/modal-overlay.d.ts +73 -0
- package/dist/utilities/modal-overlay.d.ts.map +1 -0
- package/dist/utilities/modal-overlay.js +219 -0
- package/dist/utilities/modal-overlay.js.map +1 -0
- package/dist/utilities/overflow-menu.d.ts +97 -0
- package/dist/utilities/overflow-menu.d.ts.map +1 -0
- package/dist/utilities/overflow-menu.js +209 -0
- package/dist/utilities/overflow-menu.js.map +1 -0
- package/dist/utilities/overlay-invoker.d.ts +185 -0
- package/dist/utilities/overlay-invoker.d.ts.map +1 -0
- package/dist/utilities/overlay-invoker.js +329 -0
- package/dist/utilities/overlay-invoker.js.map +1 -0
- package/dist/utilities/page-section-mixin.d.ts +11 -0
- package/dist/utilities/page-section-mixin.d.ts.map +1 -1
- package/dist/utilities/page-section-mixin.js +11 -0
- package/dist/utilities/page-section-mixin.js.map +1 -1
- package/dist/utilities/return-focus.d.ts +0 -2
- package/dist/utilities/return-focus.d.ts.map +1 -1
- package/dist/utilities/return-focus.js +1 -7
- package/dist/utilities/return-focus.js.map +1 -1
- package/dist/utilities/with-translations.d.ts +3 -0
- package/dist/utilities/with-translations.d.ts.map +1 -1
- package/dist/utilities/with-translations.js +3 -0
- package/dist/utilities/with-translations.js.map +1 -1
- package/lint/data.generated.json +1 -1
- package/lint/engine.js +4 -114
- package/lint/fix.js +53 -136
- package/lint/frontends.js +68 -6
- package/lint/linter.js +1 -0
- package/lint/main.js +21 -123
- package/lint/project.js +31 -0
- package/lint/rule-compiler.js +318 -0
- package/lint/rule-index.js +33 -1
- package/lint/rule.schema.json +1 -1
- package/lint/session.js +127 -0
- package/lint/tree.js +46 -0
- package/package.json +11 -19
- package/dist/cdn/chunks/checkbox-group-CC72cq-P.js +0 -103
- package/dist/cdn/chunks/form-associated-mixin-BtStDDYA.js +0 -73
- package/dist/cdn/chunks/open-when-rendered-CW_2_WUZ.js +0 -20
- package/dist/cdn/chunks/popover-target-B25dxnmt.js +0 -10
- package/dist/cdn/chunks/popup-anchor-controller-VZw0bXf2.js +0 -30
- package/dist/cdn/chunks/radio-button-group-D_OezDhB.js +0 -124
- package/dist/components/actions/toolbar/toolbar.overflow-menu.d.ts +0 -52
- package/dist/components/actions/toolbar/toolbar.overflow-menu.d.ts.map +0 -1
- package/dist/components/actions/toolbar/toolbar.overflow-menu.js +0 -105
- package/dist/components/actions/toolbar/toolbar.overflow-menu.js.map +0 -1
- package/dist/utilities/interest-controller.d.ts.map +0 -1
- package/dist/utilities/interest-controller.js.map +0 -1
- package/dist/utilities/open-when-rendered.d.ts +0 -21
- package/dist/utilities/open-when-rendered.d.ts.map +0 -1
- package/dist/utilities/open-when-rendered.js +0 -30
- package/dist/utilities/open-when-rendered.js.map +0 -1
- package/dist/utilities/popover-target.d.ts +0 -25
- package/dist/utilities/popover-target.d.ts.map +0 -1
- package/dist/utilities/popover-target.js +0 -48
- package/dist/utilities/popover-target.js.map +0 -1
- package/dist/utilities/popup-anchor-controller.d.ts +0 -63
- package/dist/utilities/popup-anchor-controller.d.ts.map +0 -1
- package/dist/utilities/popup-anchor-controller.js +0 -72
- package/dist/utilities/popup-anchor-controller.js.map +0 -1
package/lint/main.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/** The `nldd` command, started from cli.js. */
|
|
1
|
+
/** The `nldd` command, started from cli.js: arguments in, formatted findings out. What it checks is lint/session.js. */
|
|
2
2
|
|
|
3
|
-
import { existsSync, readFileSync
|
|
4
|
-
import { dirname,
|
|
3
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join, relative, resolve } from 'node:path';
|
|
5
5
|
import { parseArgs } from 'node:util';
|
|
6
|
-
import { applyFixes, linesNaming, renameReferences } from './fix.js';
|
|
7
|
-
import { declarations, TOKEN_PREFIX } from './css.js';
|
|
8
6
|
import { formatGithub, formatJson, formatStatistics, formatText } from './format.js';
|
|
9
7
|
import { BUILT_IN_RULES, createCanonical, loadData, GROUPS, OPT_IN_GROUPS, resolveSeverities } from './rule-data.js';
|
|
10
8
|
import { rulesAboutTag } from './rule-index.js';
|
|
11
|
-
import { applyBaseline,
|
|
9
|
+
import { applyBaseline, looseInBaseline, tightenBaseline, readBaseline, readConfig, writeBaseline } from './project.js';
|
|
10
|
+
import { knownKeys, lintProject } from './session.js';
|
|
12
11
|
|
|
13
12
|
const USAGE = `Usage:
|
|
14
13
|
nldd lint [paths...] check files; without paths, the whole project
|
|
@@ -86,68 +85,6 @@ function noteOtherVersion(root) {
|
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
|
|
89
|
-
/** Writing back what was read as UTF-8 would destroy any other encoding. */
|
|
90
|
-
function isUtf8(filename) {
|
|
91
|
-
const bytes = readFileSync(filename);
|
|
92
|
-
return bytes.equals(Buffer.from(bytes.toString('utf8')));
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/** The tag is gone from the markup; what still names it would break or stop matching. */
|
|
96
|
-
function fixReferences(renamedTags, paths, root, exclude) {
|
|
97
|
-
const isBuilt = (file) => relative(root, file).split(sep).some((part) => IGNORED_DIRECTORIES.has(part));
|
|
98
|
-
const inMarkup = findFiles(paths, root, exclude);
|
|
99
|
-
const elsewhere = findFiles(paths, root, exclude, REFERENCE_EXTENSIONS).filter((file) => REFERENCE_EXTENSIONS.includes(extname(file)) && !inMarkup.includes(file));
|
|
100
|
-
let fixed = 0;
|
|
101
|
-
let files = 0;
|
|
102
|
-
const remaining = [];
|
|
103
|
-
const kindOf = (file) => (/\.(css|scss|less)$/.test(file) ? 'styles' : /\.[cm]?[jt]s$/.test(file) || !inMarkup.includes(file) ? 'script' : 'markup');
|
|
104
|
-
for (const list of [inMarkup, elsewhere]) {
|
|
105
|
-
for (const filename of list.filter((file) => !/\.min\.[cm]?js$/.test(file))) {
|
|
106
|
-
const source = readFileSync(filename, 'utf8');
|
|
107
|
-
const change = isBuilt(filename) ? { source, fixed: 0 } : renameReferences(source, renamedTags, kindOf(filename));
|
|
108
|
-
if (change.fixed > 0 && isUtf8(filename)) {
|
|
109
|
-
writeFileSync(filename, change.source);
|
|
110
|
-
fixed += change.fixed;
|
|
111
|
-
files += 1;
|
|
112
|
-
}
|
|
113
|
-
for (const line of linesNaming(change.source, renamedTags)) remaining.push(`${relative(root, filename)}:${line}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return { fixed, files, remaining };
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* A script a bundler wrote: the linter reads a build through its HTML, and a bundle
|
|
121
|
-
* carries the styles of the components as if they were the app's. Minified code
|
|
122
|
-
* has few lines for its size; one long line, such as an inline SVG, does not make
|
|
123
|
-
* a file of the app a bundle.
|
|
124
|
-
*/
|
|
125
|
-
function isBundle(filename, source) {
|
|
126
|
-
if (!/\.[cm]?js$/.test(filename)) return false;
|
|
127
|
-
return /\.min\.[cm]?js$/.test(filename) || source.length / source.split('\n').length > MINIFIED_LINE_LENGTH;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/** The average line length above which a script counts as minified. */
|
|
131
|
-
const MINIFIED_LINE_LENGTH = 500;
|
|
132
|
-
|
|
133
|
-
const MAX_FIX_PASSES = 10;
|
|
134
|
-
|
|
135
|
-
/** One fix can open the way for the next: a renamed tag has rules of its own. */
|
|
136
|
-
async function fixUntilStable(linter, original, filename) {
|
|
137
|
-
let source = original;
|
|
138
|
-
let fixed = 0;
|
|
139
|
-
const renamedTags = new Map();
|
|
140
|
-
for (let pass = 0; pass < MAX_FIX_PASSES; pass++) {
|
|
141
|
-
const { findings } = await linter.lintSource(source, filename);
|
|
142
|
-
const change = applyFixes(source, findings);
|
|
143
|
-
if (change.fixed === 0) return { source, fixed, renamedTags, findings };
|
|
144
|
-
source = change.source;
|
|
145
|
-
fixed += change.fixed;
|
|
146
|
-
for (const [from, to] of change.renamedTags) renamedTags.set(from, to);
|
|
147
|
-
}
|
|
148
|
-
return { source, fixed, renamedTags, findings: (await linter.lintSource(source, filename)).findings };
|
|
149
|
-
}
|
|
150
|
-
|
|
151
88
|
async function runLint(data, paths, options) {
|
|
152
89
|
if (!/^\d+$/.test(options['max-warnings'] ?? '0')) throw new Error('--max-warnings takes a whole number, 0 or more.');
|
|
153
90
|
const formatName = options.format ?? 'text';
|
|
@@ -166,7 +103,7 @@ async function runLint(data, paths, options) {
|
|
|
166
103
|
if (options.fix && (options.stdin || options['update-baseline'])) {
|
|
167
104
|
throw new Error('--fix writes files, so it takes no --stdin or --update-baseline.');
|
|
168
105
|
}
|
|
169
|
-
const known =
|
|
106
|
+
const known = knownKeys(data);
|
|
170
107
|
const list = (value) => value?.split(',').map((key) => key.trim());
|
|
171
108
|
const select = list(options.select);
|
|
172
109
|
const ignore = list(options.ignore);
|
|
@@ -176,63 +113,24 @@ async function runLint(data, paths, options) {
|
|
|
176
113
|
const config = readConfig(root, known);
|
|
177
114
|
noteOtherVersion(root);
|
|
178
115
|
const canonical = createCanonical(data);
|
|
179
|
-
|
|
180
116
|
const severities = resolveSeverities(data, config.rules, { select, ignore, optIn: options.pure ? OPT_IN_GROUPS : [] });
|
|
181
|
-
// An app that is to be pure has to be read in full: a file without a single component
|
|
182
|
-
// is the least pure of all, and a stylesheet is one too.
|
|
183
|
-
const pure = data.rules.some((rule) => OPT_IN_GROUPS.includes(rule.group) && severities[rule.id] !== 'off');
|
|
184
|
-
const extensions = [...DEFAULT_EXTENSIONS, ...STYLESHEET_EXTENSIONS];
|
|
185
117
|
|
|
186
|
-
const inputs = options.stdin
|
|
187
|
-
? [{ filename: resolve(root, options.filename ?? 'stdin.html'), source: readFileSync(0, 'utf8') }]
|
|
188
|
-
: findFiles(paths, root, config.exclude, extensions).map((filename) => ({
|
|
189
|
-
filename,
|
|
190
|
-
source: readFileSync(filename, 'utf8'),
|
|
191
|
-
})).filter(({ filename, source }) => !isBundle(filename, source));
|
|
192
|
-
|
|
193
|
-
// Most files in an app use no component at all, and those need no parser either.
|
|
194
118
|
// Tightening has to see every file the baseline names, also one without a component left.
|
|
195
119
|
const inBaseline = options['tighten-baseline'] ? new Set(Object.keys(readBaseline(root, canonical))) : new Set();
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
let fixed = 0;
|
|
211
|
-
let fixedFiles = 0;
|
|
212
|
-
const renamedTags = new Map();
|
|
213
|
-
if (relevant.length > 0) {
|
|
214
|
-
const { createLinter } = await import('./linter.js');
|
|
215
|
-
const linter = createLinter(data, { wrappers: config.wrappers, severities, projectTokens });
|
|
216
|
-
for (const { filename, source } of relevant) {
|
|
217
|
-
const canWrite = options.fix && isUtf8(filename);
|
|
218
|
-
if (options.fix && !canWrite) console.error(`Skipped ${relative(root, filename)}: it is not UTF-8.`);
|
|
219
|
-
if (!canWrite) {
|
|
220
|
-
results.push({ filename, source, ...(await linter.lintSource(source, filename)) });
|
|
221
|
-
continue;
|
|
222
|
-
}
|
|
223
|
-
const change = await fixUntilStable(linter, source, filename);
|
|
224
|
-
if (change.fixed > 0) {
|
|
225
|
-
writeFileSync(filename, change.source);
|
|
226
|
-
fixed += change.fixed;
|
|
227
|
-
fixedFiles += 1;
|
|
228
|
-
for (const [from, to] of change.renamedTags) renamedTags.set(from, to);
|
|
229
|
-
}
|
|
230
|
-
results.push({ filename, source: change.source, findings: change.findings });
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
if (options.fix) console.error(`Fixed ${fixed} in ${fixedFiles} of ${counted} files.`);
|
|
234
|
-
if (renamedTags.size > 0) {
|
|
235
|
-
const references = fixReferences(renamedTags, paths, root, config.exclude);
|
|
120
|
+
const session = await lintProject(data, {
|
|
121
|
+
root,
|
|
122
|
+
paths,
|
|
123
|
+
config,
|
|
124
|
+
severities,
|
|
125
|
+
input: options.stdin ? { filename: options.filename ?? 'stdin.html', source: readFileSync(0, 'utf8') } : undefined,
|
|
126
|
+
fix: options.fix,
|
|
127
|
+
keep: (filename) => inBaseline.has(relative(root, filename)),
|
|
128
|
+
});
|
|
129
|
+
const { results } = session;
|
|
130
|
+
for (const filename of session.notUtf8) console.error(`Skipped ${relative(root, filename)}: it is not UTF-8.`);
|
|
131
|
+
if (options.fix) console.error(`Fixed ${session.fixed} in ${session.fixedFiles} of ${session.files} files.`);
|
|
132
|
+
if (session.references) {
|
|
133
|
+
const { references } = session;
|
|
236
134
|
if (references.fixed > 0) console.error(`Renamed ${references.fixed} imports, classes and selectors of old tags in ${references.files} files.`);
|
|
237
135
|
for (const place of references.remaining) console.error(`Still names an old tag: ${place}`);
|
|
238
136
|
if (paths.some((path) => resolve(root, path) !== root)) {
|
|
@@ -265,7 +163,7 @@ async function runLint(data, paths, options) {
|
|
|
265
163
|
|
|
266
164
|
const context = {
|
|
267
165
|
root,
|
|
268
|
-
files:
|
|
166
|
+
files: session.files,
|
|
269
167
|
ms: Math.round(performance.now() - started),
|
|
270
168
|
skipped,
|
|
271
169
|
loose: looseInBaseline(results, baseline, root, ran),
|
package/lint/project.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { execFileSync } from 'node:child_process';
|
|
4
4
|
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';
|
|
5
5
|
import { extname, join, relative, resolve } from 'node:path';
|
|
6
|
+
import { declarations, TOKEN_PREFIX } from './css.js';
|
|
6
7
|
|
|
7
8
|
export const IGNORED_DIRECTORIES = new Set(['node_modules', 'dist', 'build', 'coverage', '.git', '.next', '.nuxt']);
|
|
8
9
|
/** Markdown is linted on request: documentation is full of deliberately wrong examples. */
|
|
@@ -59,6 +60,36 @@ export function findFiles(paths, root, exclude = [], extensions = DEFAULT_EXTENS
|
|
|
59
60
|
return [...new Set(files)].filter((file) => existsSync(file) && !matchesExclude(relative(root, file), exclude));
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
/** The average line length above which a script counts as minified. */
|
|
64
|
+
const MINIFIED_LINE_LENGTH = 500;
|
|
65
|
+
|
|
66
|
+
/** A built or minified script: not the app's own source, and no use to lint. */
|
|
67
|
+
export function isBundle(filename, source) {
|
|
68
|
+
if (!/\.[cm]?js$/.test(filename)) return false;
|
|
69
|
+
return /\.min\.[cm]?js$/.test(filename) || source.length / source.split('\n').length > MINIFIED_LINE_LENGTH;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const isStylesheet = (filename) => STYLESHEET_EXTENSIONS.includes(extname(filename));
|
|
73
|
+
const namesTokens = (source) => /var\(\s*--(primitives|semantics|components|context)-|--_[a-z]/.test(source);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Whether a file is worth a parser when the group pure is off: most files in
|
|
77
|
+
* an app use no component at all. A stylesheet counts for the tokens it names
|
|
78
|
+
* and the variables it sets, and only then. `keep` says a file has to be read
|
|
79
|
+
* anyway, as one the baseline names.
|
|
80
|
+
*/
|
|
81
|
+
export function isRelevant({ filename, source }, { wrappers, keep = () => false } = {}) {
|
|
82
|
+
if (keep(filename)) return true;
|
|
83
|
+
if (isStylesheet(filename)) return namesTokens(source);
|
|
84
|
+
return /nldd-|Nldd/.test(source) || namesTokens(source) || Boolean(wrappers);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** What the project declares itself, in any file read, is its own token and not a typo. */
|
|
88
|
+
export function projectTokens(inputs) {
|
|
89
|
+
const names = inputs.flatMap(({ source }) => (/--(primitives|semantics|components|context)-/.test(source) ? declarations(source).map(({ name }) => name) : []));
|
|
90
|
+
return [...new Set(names.filter((name) => TOKEN_PREFIX.test(name)))];
|
|
91
|
+
}
|
|
92
|
+
|
|
62
93
|
const CONFIG_FILE = '.nldd-lint.json';
|
|
63
94
|
|
|
64
95
|
export function readConfig(root, knownRules) {
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a rule means where it runs: in source, through the engine, and on a
|
|
3
|
+
* running page, as plain CSS for `el.matches()`.
|
|
4
|
+
*
|
|
5
|
+
* A rule is a selector, and most of it is CSS that means the same in both. The
|
|
6
|
+
* pseudo-classes the design system adds are not: each one here says what it
|
|
7
|
+
* means in source and what the browser gets instead. A class of tags becomes
|
|
8
|
+
* `:is()` of its tags, `:named-by-field` is dropped because on a running page
|
|
9
|
+
* the field has set the attribute, and what only source can judge has no
|
|
10
|
+
* browser form at all. A selector that cannot be compiled is refused, so a rule
|
|
11
|
+
* never silently stops running in the browser.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { parse, stringify } from 'css-what';
|
|
15
|
+
import { OPT_IN_GROUPS } from './rule-data.js';
|
|
16
|
+
import { isDesignSystemCss } from './css.js';
|
|
17
|
+
import { BOUND } from './tree.js';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A member of a tag class that counts only in part. A hidden input has no box
|
|
21
|
+
* and no place in the accessibility tree, so it is no form input, though its
|
|
22
|
+
* tag is (#421).
|
|
23
|
+
*/
|
|
24
|
+
const CLASS_EXCEPTIONS = {
|
|
25
|
+
'form-input': { input: { attribute: 'type', value: 'hidden' } },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function excepted(className, node) {
|
|
29
|
+
const exception = CLASS_EXCEPTIONS[className]?.[node.name];
|
|
30
|
+
return Boolean(exception) && node.attrs.get(exception.attribute) === exception.value;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Pseudo-classes of CSS itself, which mean the same everywhere. */
|
|
34
|
+
const CSS_PSEUDOS = new Set(['is', 'not', 'has', 'where', 'matches']);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Whether a field hands its label to `target`, as _findInput in nldd-form-field does:
|
|
38
|
+
* the first input in document order, helper text left out. The answer is `maybe` when
|
|
39
|
+
* something before it may or may not be an input that renders.
|
|
40
|
+
*/
|
|
41
|
+
function findsInput(node, target, isInput, uncertain = false) {
|
|
42
|
+
let maybe = uncertain;
|
|
43
|
+
for (const child of node.children) {
|
|
44
|
+
if (child.name === 'nldd-form-field-help-text') continue;
|
|
45
|
+
const unsure = maybe || child.conditional || child.repeated;
|
|
46
|
+
if (child === target) return maybe ? 'maybe' : 'yes';
|
|
47
|
+
if (isInput(child)) {
|
|
48
|
+
if (!unsure) return 'no';
|
|
49
|
+
maybe = true;
|
|
50
|
+
}
|
|
51
|
+
if (child.opaque) maybe = true;
|
|
52
|
+
const inside = findsInput(child, target, isInput, unsure);
|
|
53
|
+
if (inside !== 'absent') return inside;
|
|
54
|
+
}
|
|
55
|
+
return 'absent';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function fieldLabelCheck(isInput, allowMaybe) {
|
|
59
|
+
return (node) => {
|
|
60
|
+
for (let parent = node.parent; parent; parent = parent.parent) {
|
|
61
|
+
if (parent.name === 'nldd-form-field') {
|
|
62
|
+
const label = parent.attrs.get('label');
|
|
63
|
+
const unknownLabel = label === BOUND || parent.spread;
|
|
64
|
+
if (!unknownLabel && !label) return false;
|
|
65
|
+
const found = findsInput(parent, node, isInput);
|
|
66
|
+
if (found === 'yes' && !unknownLabel) return true;
|
|
67
|
+
return allowMaybe && found !== 'no';
|
|
68
|
+
}
|
|
69
|
+
if (parent.opaque) return allowMaybe;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Whether the nearest component around a plain element styles it, as nldd-dropdown
|
|
77
|
+
* does its <select> and nldd-rich-text everything in it. Each component says so
|
|
78
|
+
* with `@accepts` in its JSDoc.
|
|
79
|
+
*
|
|
80
|
+
* What a file renders is judged in that file: that a parent elsewhere might put it
|
|
81
|
+
* inside an nldd-rich-text does not make plain HTML written here the design system's. A
|
|
82
|
+
* tree the file builds under a name (a helper component, a variable) is judged where
|
|
83
|
+
* the file uses that name. Used nowhere here, or under a component of the app, it is
|
|
84
|
+
* unknown.
|
|
85
|
+
*/
|
|
86
|
+
function acceptedCheck(tags, allowUnknown) {
|
|
87
|
+
// `chain` holds the plain elements between the node and the component: the
|
|
88
|
+
// component styles its own children (::slotted) or descendants of what it styles,
|
|
89
|
+
// so each of them has to be accepted too. `seen` keeps a component that places
|
|
90
|
+
// itself from going round in circles.
|
|
91
|
+
const accepted = (node, from, chain, seen) => {
|
|
92
|
+
for (let parent = from; parent; parent = parent.parent) {
|
|
93
|
+
if (parent.name === '#root') {
|
|
94
|
+
if (!parent.detached) return false;
|
|
95
|
+
if (!parent.placements) return allowUnknown;
|
|
96
|
+
if (seen.has(parent)) return false;
|
|
97
|
+
const next = new Set(seen).add(parent);
|
|
98
|
+
// Accepted in any of the places the file uses it is enough.
|
|
99
|
+
return parent.placements.some((place) => accepted(node, place.parent, chain, next));
|
|
100
|
+
}
|
|
101
|
+
if (parent.opaque) return allowUnknown;
|
|
102
|
+
if (!parent.name.startsWith('nldd-')) {
|
|
103
|
+
chain.push(parent.name);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const accepts = tags[parent.name]?.accepts ?? [];
|
|
107
|
+
return accepts.includes('*') || [node.name, ...chain].every((name) => accepts.includes(name));
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
};
|
|
111
|
+
return (node) => accepted(node, node.parent, [], new Set());
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Whether the children of an element are of more than one kind. A kind is a
|
|
116
|
+
* tag, except that every form input and form field is one kind: the fields of
|
|
117
|
+
* a form share one rhythm. A spacer is the space itself and counts for none.
|
|
118
|
+
* In W- only what certainly renders counts; in W+ also what may, and content
|
|
119
|
+
* this file cannot see may be any kind.
|
|
120
|
+
*/
|
|
121
|
+
function mixedCheck(isInput, favorable) {
|
|
122
|
+
const kindOf = (child) => (isInput(child) || child.name === 'nldd-form-field' ? 'field' : child.name);
|
|
123
|
+
return (node) => {
|
|
124
|
+
const kinds = new Set();
|
|
125
|
+
for (const child of node.children) {
|
|
126
|
+
if (child.name === 'nldd-spacer') continue;
|
|
127
|
+
if (child.opaque) {
|
|
128
|
+
if (favorable) return true;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (!favorable && (child.conditional || child.toggled)) continue;
|
|
132
|
+
kinds.add(kindOf(child));
|
|
133
|
+
}
|
|
134
|
+
return kinds.size > 1;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The pseudo-classes a rule may use besides those of CSS and the tag classes.
|
|
140
|
+
*
|
|
141
|
+
* - `source` is what it means in the engine, made from the linter data.
|
|
142
|
+
* - `favorable` is what it means in W+, where whatever is unknown may hold.
|
|
143
|
+
* - `browser` is `native` (CSS knows it), `drop` (leave the alternative out of
|
|
144
|
+
* its list) or absent (source only).
|
|
145
|
+
* - `optIn` keeps it to the groups a project turns on itself: it judges a file
|
|
146
|
+
* by itself, which a rule that runs unasked may not do.
|
|
147
|
+
*/
|
|
148
|
+
const VOCABULARY = {
|
|
149
|
+
// Only exists on a running page, so in source it is never true.
|
|
150
|
+
state: { source: () => () => false, browser: 'native' },
|
|
151
|
+
// On a running page the field has set the attribute, so no exception is needed.
|
|
152
|
+
'named-by-field': {
|
|
153
|
+
source: ({ isInput }) => fieldLabelCheck(isInput, false),
|
|
154
|
+
favorable: ({ isInput }) => fieldLabelCheck(isInput, true),
|
|
155
|
+
browser: 'drop',
|
|
156
|
+
},
|
|
157
|
+
// Children of more than one kind; source only, so for hints.
|
|
158
|
+
mixed: {
|
|
159
|
+
source: ({ isInput }) => mixedCheck(isInput, false),
|
|
160
|
+
favorable: ({ isInput }) => mixedCheck(isInput, true),
|
|
161
|
+
},
|
|
162
|
+
accepted: {
|
|
163
|
+
source: ({ tags }) => acceptedCheck(tags, false),
|
|
164
|
+
favorable: ({ tags }) => acceptedCheck(tags, true),
|
|
165
|
+
optIn: true,
|
|
166
|
+
},
|
|
167
|
+
// The attribute is in the markup, with a value or bound to one. `[class]` asks for a
|
|
168
|
+
// value we can read, so a bound class would only ever be cantTell.
|
|
169
|
+
written: { source: () => (node, name) => node.attrs.has(name), optIn: true },
|
|
170
|
+
// No element and no text: an empty mount point such as <div id="app"></div>.
|
|
171
|
+
blank: { source: () => (node) => node.children.length === 0 && !node.text, optIn: true },
|
|
172
|
+
// Inside an element of this name in this file. A drawing's own classes and styles are its business.
|
|
173
|
+
within: {
|
|
174
|
+
source: () => (node, name) => {
|
|
175
|
+
for (let parent = node.parent; parent; parent = parent.parent) if (parent.name === name) return true;
|
|
176
|
+
return false;
|
|
177
|
+
},
|
|
178
|
+
optIn: true,
|
|
179
|
+
},
|
|
180
|
+
// CSS the design system ships: a block it recognizes, or a stylesheet with nothing else in it.
|
|
181
|
+
'design-system': {
|
|
182
|
+
source: ({ designSystemCss }) => (node) => node.designSystem ?? (node.css !== undefined && isDesignSystemCss(node.css, designSystemCss)),
|
|
183
|
+
optIn: true,
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/** The name a pseudo-class goes by in W+, or the name itself when unknown changes nothing. */
|
|
188
|
+
export function favorableName(name) {
|
|
189
|
+
return VOCABULARY[name]?.favorable ? `may-be-${name}` : name;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** What each pseudo-class means in source, for css-select. */
|
|
193
|
+
export function sourcePseudos({ classes = {}, tags = {}, designSystemCss = {} } = {}) {
|
|
194
|
+
const shared = Object.fromEntries(
|
|
195
|
+
Object.entries(classes).map(([name, members]) => {
|
|
196
|
+
const set = new Set(members);
|
|
197
|
+
return [name, (node) => set.has(node.name) && !excepted(name, node)];
|
|
198
|
+
}),
|
|
199
|
+
);
|
|
200
|
+
const context = { tags, designSystemCss, isInput: shared['form-input'] ?? (() => false) };
|
|
201
|
+
const own = Object.entries(VOCABULARY).flatMap(([name, entry]) => [
|
|
202
|
+
[name, entry.source(context)],
|
|
203
|
+
...(entry.favorable ? [[favorableName(name), entry.favorable(context)]] : []),
|
|
204
|
+
]);
|
|
205
|
+
return { ...shared, ...Object.fromEntries(own) };
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Whether a rule runs on a running page. A hint is advice for whoever writes the
|
|
210
|
+
* source, and components write `style`, `id` and more on a live page that it would
|
|
211
|
+
* take for the app's own. An opt-in group judges the app's own markup and is off
|
|
212
|
+
* unless a project turns it on. A `ref` follows an id and is no selector.
|
|
213
|
+
*/
|
|
214
|
+
export function runsInBrowser(rule) {
|
|
215
|
+
return !rule.ref && rule.severity !== 'hint' && !OPT_IN_GROUPS.includes(rule.group);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function pseudoNames(selector) {
|
|
219
|
+
const names = [];
|
|
220
|
+
const visit = (tokens) => {
|
|
221
|
+
for (const token of tokens) {
|
|
222
|
+
if (token.type !== 'pseudo') continue;
|
|
223
|
+
names.push(token.name);
|
|
224
|
+
if (Array.isArray(token.data)) token.data.forEach(visit);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
parse(selector).forEach(visit);
|
|
228
|
+
return names;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function compileList(list, classes, selector) {
|
|
232
|
+
const kept = list.filter((tokens) => {
|
|
233
|
+
const [only] = tokens;
|
|
234
|
+
return !(tokens.length === 1 && only.type === 'pseudo' && VOCABULARY[only.name]?.browser === 'drop');
|
|
235
|
+
});
|
|
236
|
+
if (kept.length === 0) throw new Error(`${selector}: nothing is left of it in the browser.`);
|
|
237
|
+
return kept.map((tokens) => tokens.map((token) => compileToken(token, classes, selector)));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function compileToken(token, classes, selector) {
|
|
241
|
+
if (token.type !== 'pseudo') return token;
|
|
242
|
+
if (classes[token.name]) {
|
|
243
|
+
return { type: 'pseudo', name: 'is', data: classes[token.name].map((name) => {
|
|
244
|
+
const tag = { type: 'tag', name, namespace: null };
|
|
245
|
+
const exception = CLASS_EXCEPTIONS[token.name]?.[name];
|
|
246
|
+
if (!exception) return [tag];
|
|
247
|
+
const attribute = { type: 'attribute', name: exception.attribute, action: 'equals', value: exception.value, namespace: null, ignoreCase: null };
|
|
248
|
+
return [tag, { type: 'pseudo', name: 'not', data: [[attribute]] }];
|
|
249
|
+
}) };
|
|
250
|
+
}
|
|
251
|
+
const browser = CSS_PSEUDOS.has(token.name) ? 'native' : VOCABULARY[token.name]?.browser;
|
|
252
|
+
if (browser === 'drop') throw new Error(`${selector}: :${token.name} can only stand on its own in a list.`);
|
|
253
|
+
if (browser !== 'native') throw new Error(`${selector}: the browser has no :${token.name}.`);
|
|
254
|
+
return Array.isArray(token.data) ? { ...token, data: compileList(token.data, classes, selector) } : token;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** The selector as plain CSS. Throws when the browser cannot run it. */
|
|
258
|
+
export function forBrowser(selector, classes = {}) {
|
|
259
|
+
return stringify(compileList(parse(selector), classes, selector));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const toProperty = (name) => name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* `[accessible-label]` in an assert also holds for the property `accessibleLabel`,
|
|
266
|
+
* which a selector cannot see. Not inside a `:not()`: there the attribute is what may
|
|
267
|
+
* not be there, and a property that is set does not excuse it.
|
|
268
|
+
*/
|
|
269
|
+
export function assertProperties(assert) {
|
|
270
|
+
const names = [];
|
|
271
|
+
const visit = (tokens, negated) => {
|
|
272
|
+
for (const token of tokens) {
|
|
273
|
+
if (token.type === 'attribute' && token.action === 'exists' && !negated) names.push(toProperty(token.name));
|
|
274
|
+
if (token.type === 'pseudo' && Array.isArray(token.data)) {
|
|
275
|
+
for (const inner of token.data) visit(inner, token.name === 'not' ? !negated : negated);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
parse(assert).forEach((tokens) => visit(tokens, false));
|
|
280
|
+
return [...new Set(names)];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** A rule as the browser runs it, or null for one that only runs on source. */
|
|
284
|
+
export function compileForBrowser(rule, classes = {}) {
|
|
285
|
+
if (!runsInBrowser(rule)) return null;
|
|
286
|
+
const { id, message, context, assert, report, count } = rule;
|
|
287
|
+
const css = (selector) => forBrowser(selector, classes);
|
|
288
|
+
return {
|
|
289
|
+
id,
|
|
290
|
+
message,
|
|
291
|
+
context: css(context),
|
|
292
|
+
...(assert ? { assert: css(assert), properties: assertProperties(css(assert)) } : {}),
|
|
293
|
+
...(report ? { report: css(report) } : {}),
|
|
294
|
+
...(count ? { count: { ...count, of: css(count.of) } } : {}),
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/** What is wrong with the selectors of a rule, for where it runs. */
|
|
299
|
+
export function ruleProblems(rule, classes = {}) {
|
|
300
|
+
const problems = [];
|
|
301
|
+
const selectors = [rule.context, rule.assert, rule.report, rule.count?.of, rule.ref?.target].filter(Boolean);
|
|
302
|
+
for (const name of new Set(selectors.flatMap(pseudoNames))) {
|
|
303
|
+
if (CSS_PSEUDOS.has(name) || classes[name]) continue;
|
|
304
|
+
const entry = VOCABULARY[name];
|
|
305
|
+
if (!entry) problems.push(`:${name} does not exist.`);
|
|
306
|
+
else if (entry.optIn && !OPT_IN_GROUPS.includes(rule.group)) {
|
|
307
|
+
problems.push(`:${name} is for the opt-in groups (${OPT_IN_GROUPS.join(', ')}) only.`);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (problems.length === 0) {
|
|
311
|
+
try {
|
|
312
|
+
compileForBrowser(rule, classes);
|
|
313
|
+
} catch (error) {
|
|
314
|
+
problems.push(error.message);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return problems;
|
|
318
|
+
}
|
package/lint/rule-index.js
CHANGED
|
@@ -4,9 +4,41 @@ export function selectorsOf(rule) {
|
|
|
4
4
|
return [rule.context, rule.assert, rule.report, rule.count?.of, rule.ref?.target].filter(Boolean);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
/** The end of the parenthesis that opens at `open`. */
|
|
8
|
+
function closing(selector, open) {
|
|
9
|
+
let depth = 0;
|
|
10
|
+
for (let i = open; i < selector.length; i++) {
|
|
11
|
+
if (selector[i] === '(') depth++;
|
|
12
|
+
else if (selector[i] === ')' && --depth === 0) return i;
|
|
13
|
+
}
|
|
14
|
+
return selector.length;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A selector without what it excludes: `:not(nldd-sheet *)` is not about a
|
|
19
|
+
* sheet. What it requires stays, so `:not(:has(nldd-breadcrumbs))`, a missing
|
|
20
|
+
* breadcrumb, is about the breadcrumbs.
|
|
21
|
+
*/
|
|
22
|
+
function withoutExclusions(selector) {
|
|
23
|
+
let out = '';
|
|
24
|
+
for (let i = 0; i < selector.length; i++) {
|
|
25
|
+
if (!selector.startsWith(':not(', i)) {
|
|
26
|
+
out += selector[i];
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const end = closing(selector, i + 4);
|
|
30
|
+
const inner = selector.slice(i + 5, end);
|
|
31
|
+
for (let at = inner.indexOf(':has('); at !== -1; at = inner.indexOf(':has(', at + 1)) {
|
|
32
|
+
out += ` ${withoutExclusions(inner.slice(at, closing(inner, at + 4) + 1))}`;
|
|
33
|
+
}
|
|
34
|
+
i = end;
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
|
|
7
39
|
/** Every component a rule is about, so a rule on two components shows up at both. */
|
|
8
40
|
export function tagsOf(rule) {
|
|
9
|
-
const named = selectorsOf(rule).flatMap((selector) => selector.match(/nldd-[a-z0-9-]+/g) ?? []);
|
|
41
|
+
const named = selectorsOf(rule).flatMap((selector) => withoutExclusions(selector).match(/nldd-[a-z0-9-]+/g) ?? []);
|
|
10
42
|
return [...new Set([...(rule.tags ?? []), ...named])];
|
|
11
43
|
}
|
|
12
44
|
|
package/lint/rule.schema.json
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"message": { "type": "string", "description": "What is wrong here, in English, for the developer." },
|
|
54
|
-
"see": { "type": "string", "pattern": "^(patronen|ontwerprichtlijnen)/", "description": "Where the why is explained." },
|
|
54
|
+
"see": { "type": "string", "pattern": "^(patronen|ontwerprichtlijnen|componenten)/", "description": "Where the why is explained: a pattern, a section of the guidelines, or the page of the component that explains it." },
|
|
55
55
|
"aliases": { "type": "array", "items": { "type": "string" }, "description": "Former ids, so baselines and suppressions keep working." },
|
|
56
56
|
"examples": {
|
|
57
57
|
"type": "object",
|