@ngrok/mantle 0.94.1 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/CaretDown-MgTrjdYK.js +1 -0
- package/dist/CaretLeft-CZIqCyEF.js +1 -0
- package/dist/CaretRight-BKz4JHCI.js +1 -0
- package/dist/Check-C5a1hX4x.js +1 -0
- package/dist/CheckCircle-Bi4tSau6.js +1 -0
- package/dist/CircleNotch-BKE0NAIr.js +1 -0
- package/dist/Copy-BYWMO6PW.js +1 -0
- package/dist/Desktop-BaSlSeg2.js +1 -0
- package/dist/Eye-C38LQkZ_.js +1 -0
- package/dist/EyeClosed-BvOq-W8o.js +1 -0
- package/dist/FileText-CqAezJDn.js +1 -0
- package/dist/Info-weHV1B4q.js +1 -0
- package/dist/MagnifyingGlass-DCAoDH5_.js +1 -0
- package/dist/Megaphone-Cir2KHXa.js +1 -0
- package/dist/Minus-KBzmC4_K.js +1 -0
- package/dist/Moon-hn_oivM6.js +1 -0
- package/dist/Plus-D90-H9Ei.js +1 -0
- package/dist/Question-BhvEyO0K.js +1 -0
- package/dist/SidebarSimple-BXKgNz4l.js +1 -0
- package/dist/SortAscending-CEk4rgu_.js +1 -0
- package/dist/SortDescending-C0cE7hpU.js +1 -0
- package/dist/Sun-C3SaXdLl.js +1 -0
- package/dist/Terminal-aKZ6Y9Lk.js +1 -0
- package/dist/Warning-DTwF27_O.js +1 -0
- package/dist/WarningDiamond-BwpdVJ34.js +1 -0
- package/dist/X-BPGjP4b6.js +1 -0
- package/dist/accordion-BmDXs1-q.js +1 -0
- package/dist/accordion-NpJz3Uer.js +1 -0
- package/dist/accordion-parts.d.ts +268 -0
- package/dist/accordion-parts.js +1 -0
- package/dist/accordion.d.ts +4 -395
- package/dist/accordion.js +1 -1
- package/dist/agent.json +409 -42
- package/dist/alert-DCGSrVTa.js +1 -0
- package/dist/{alert-D0zRRUHV.d.ts → alert-Dz541Ve9.d.ts} +7 -193
- package/dist/alert-center-Bb39SBqJ.js +1 -0
- package/dist/alert-center-CGBbqO-y.d.ts +391 -0
- package/dist/alert-center-parts.d.ts +6 -0
- package/dist/alert-center-parts.js +1 -0
- package/dist/alert-center.d.ts +6 -587
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog-CtKnvX5N.js +1 -0
- package/dist/alert-dialog-parts.d.ts +569 -0
- package/dist/alert-dialog-parts.js +1 -0
- package/dist/alert-dialog.d.ts +2 -1065
- package/dist/alert-dialog.js +1 -1
- package/dist/alert-parts.d.ts +6 -0
- package/dist/alert-parts.js +1 -0
- package/dist/alert.d.ts +43 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-DW5_Gb-1.js +1 -0
- package/dist/anchor.d.ts +1 -1
- package/dist/anchor.js +1 -1
- package/dist/app-layout-D7kwv9su.js +1 -0
- package/dist/app-layout-k6UjK30v.d.ts +1167 -0
- package/dist/app-layout-parts.d.ts +6 -0
- package/dist/app-layout-parts.js +1 -0
- package/dist/app-layout.d.ts +98 -1883
- package/dist/app-layout.js +1 -1
- package/dist/area-chart-C6lKu7Un.d.ts +390 -0
- package/dist/area-chart-SAaGaZFD.js +1 -0
- package/dist/area-chart-parts.d.ts +6 -0
- package/dist/area-chart-parts.js +1 -0
- package/dist/area-chart.d.ts +4 -579
- package/dist/area-chart.js +1 -1
- package/dist/avatar-BMZ81f_5.js +1 -0
- package/dist/avatar-Ti8GKSnS.d.ts +201 -0
- package/dist/avatar-parts.d.ts +6 -0
- package/dist/avatar-parts.js +1 -0
- package/dist/avatar.d.ts +3 -275
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +3 -2
- package/dist/badge.js +1 -1
- package/dist/bar-chart-C0Ra1ZpG.js +1 -0
- package/dist/bar-chart-Cb5fA8V7.d.ts +386 -0
- package/dist/bar-chart-parts.d.ts +6 -0
- package/dist/bar-chart-parts.js +1 -0
- package/dist/bar-chart.d.ts +4 -583
- package/dist/bar-chart.js +1 -1
- package/dist/behaviors-BW8RjkkS.js +1 -0
- package/dist/behaviors-BbOq5SFv.js +1 -0
- package/dist/behaviors-C7R7ZIoN.js +1 -0
- package/dist/behaviors-CHF5PT3C.js +1 -0
- package/dist/behaviors-CSZQSSfL.js +1 -0
- package/dist/behaviors-CcjvGa0d.js +1 -0
- package/dist/behaviors-CnarRd47.js +1 -0
- package/dist/behaviors-CoNi6Rd-.js +1 -0
- package/dist/behaviors-D9VIyDk1.js +1 -0
- package/dist/behaviors-DHVC34f9.js +1 -0
- package/dist/behaviors-DkCIgQ8w.js +1 -0
- package/dist/behaviors-Mkc_HjTB.js +1 -0
- package/dist/breadcrumb-CAzq3SlR.js +1 -0
- package/dist/breadcrumb-parts.d.ts +287 -0
- package/dist/breadcrumb-parts.js +1 -0
- package/dist/breadcrumb.d.ts +53 -543
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only-CokCtIvB.js +1 -0
- package/dist/browser-only.js +1 -1
- package/dist/button-Bqm7U0OC.js +1 -0
- package/dist/{button-5Pc7Mby_.d.ts → button-C6-6TecO.d.ts} +4 -4
- package/dist/{button-DnYv7IOT.d.ts → button-CL17Dxza.d.ts} +7 -5
- package/dist/button-CRCiBPEF.js +1 -0
- package/dist/{button-Ddj6yr10.d.ts → button-CRMoQyum.d.ts} +2 -3
- package/dist/button-Cr2iY2cI.js +1 -0
- package/dist/button-DhoE-BbZ.js +1 -0
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar-DQtapcSC.js +1 -0
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card-DbtGVKyo.d.ts +129 -0
- package/dist/card-parts.d.ts +6 -0
- package/dist/card-parts.js +1 -0
- package/dist/card.d.ts +3 -228
- package/dist/card.js +1 -1
- package/dist/centered-layout-parts.d.ts +169 -0
- package/dist/centered-layout-parts.js +1 -0
- package/dist/centered-layout.d.ts +2 -299
- package/dist/centered-layout.js +1 -1
- package/dist/chart-B0n2xyYi.js +1 -0
- package/dist/chart-BPsMxs1f.js +1 -0
- package/dist/chart-BmZoTjRu.js +1 -0
- package/dist/chart-Bybyh2Dc.js +1 -0
- package/dist/chart-CACfdGlp.d.ts +86 -0
- package/dist/chart-CBQJUTIX.js +1 -0
- package/dist/chart-Cb0MBaZx.js +1 -0
- package/dist/chart-CmMcfDmv.js +1 -0
- package/dist/chart-Dlp9FidW.js +2 -0
- package/dist/{chart-Dl8gFo_D.d.ts → chart-XvStK-oM.d.ts} +3 -79
- package/dist/chart-wTwYzUMJ.js +1 -0
- package/dist/checkbox-DH7WFfuR.js +1 -0
- package/dist/checkbox-DsVXD96X.js +1 -0
- package/dist/checkbox-TX74-Iep.js +1 -0
- package/dist/checkbox-group-parts.d.ts +197 -0
- package/dist/checkbox-group-parts.js +1 -0
- package/dist/checkbox.d.ts +59 -8
- package/dist/checkbox.js +1 -1
- package/dist/{choice-CNiOSzqV.d.ts → choice-BekuLm-b.d.ts} +16 -204
- package/dist/choice-DGI8VNR9.d.ts +1 -0
- package/dist/choice-PDT386cc.js +1 -0
- package/dist/choice-parts.d.ts +7 -0
- package/dist/choice-parts.js +1 -0
- package/dist/choice.d.ts +63 -1
- package/dist/choice.js +1 -1
- package/dist/code-UKPv6LVP.js +1 -0
- package/dist/{code-block-CKzsAMzj.js → code-block-B-xD4_RW.js} +3 -3
- package/dist/code-block-B7XPzZnp.js +1 -0
- package/dist/code-block-BXXceNVo.js +1 -0
- package/dist/code-block-C7uzLs8t.js +1 -0
- package/dist/{code-block-BDw6MEwH.d.ts → code-block-Cs1Lcmdr.d.ts} +81 -252
- package/dist/code-block-Erv7wuWW.d.ts +173 -0
- package/dist/code-block-parts.d.ts +380 -0
- package/dist/code-block-parts.js +1 -0
- package/dist/code-block.d.ts +66 -691
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.d.ts +2 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +1 -1
- package/dist/code.js +1 -1
- package/dist/combobox-6LXe1cLx.js +1 -0
- package/dist/combobox-parts.d.ts +303 -0
- package/dist/combobox-parts.js +1 -0
- package/dist/combobox.d.ts +2 -465
- package/dist/combobox.js +1 -1
- package/dist/command-B8L-zjGt.js +1 -0
- package/dist/command-CCMWCjAK.js +1 -0
- package/dist/command-VKj84zAX.d.ts +859 -0
- package/dist/command-cbgO9CiG.js +1 -0
- package/dist/command-parts.d.ts +6 -0
- package/dist/command-parts.js +1 -0
- package/dist/command.d.ts +71 -1115
- package/dist/command.js +1 -1
- package/dist/compose-refs-Ce1vWUz0.js +1 -0
- package/dist/cx-CfAFHj5_.js +73 -0
- package/dist/cx-DhYnQ07J.js +1 -0
- package/dist/cx.d.ts +20 -14
- package/dist/cx.js +1 -1
- package/dist/data-table-C-FgaN3_.js +1 -0
- package/dist/data-table-Cw9dUo1w.js +1 -0
- package/dist/data-table-CwqrMtp0.js +1 -0
- package/dist/data-table-GUbt8mzo.d.ts +38 -0
- package/dist/data-table-parts.d.ts +763 -0
- package/dist/data-table-parts.js +1 -0
- package/dist/data-table.d.ts +12 -1208
- package/dist/data-table.js +1 -1
- package/dist/description-list-CjcKOOnr.d.ts +110 -0
- package/dist/description-list-parts.d.ts +6 -0
- package/dist/description-list-parts.js +1 -0
- package/dist/description-list.d.ts +3 -183
- package/dist/description-list.js +1 -1
- package/dist/dialog-4Ed3U7hz.js +1 -0
- package/dist/dialog-BDb_obii.d.ts +166 -0
- package/dist/dialog-BaR9D58J.js +1 -0
- package/dist/dialog-BkNxAcol.d.ts +467 -0
- package/dist/dialog-DSYuhFD5.js +1 -0
- package/dist/dialog-fXMCxM9W.js +1 -0
- package/dist/dialog-parts.d.ts +6 -0
- package/dist/dialog-parts.js +1 -0
- package/dist/dialog.d.ts +88 -2
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-BuluRn0Z.js +1 -0
- package/dist/dropdown-menu-CDXlp0QT.d.ts +507 -0
- package/dist/dropdown-menu-parts.d.ts +6 -0
- package/dist/dropdown-menu-parts.js +1 -0
- package/dist/dropdown-menu.d.ts +57 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty-parts.d.ts +120 -0
- package/dist/empty-parts.js +1 -0
- package/dist/empty.d.ts +2 -216
- package/dist/empty.js +1 -1
- package/dist/field-BRYypbjO.js +1 -0
- package/dist/field-BVMx7HoG.js +1 -0
- package/dist/field-BwCq1b9R.js +1 -0
- package/dist/field-CYAaNexp.js +1 -0
- package/dist/field-DRHAcM1s.js +1 -0
- package/dist/field-parts.d.ts +767 -0
- package/dist/field-parts.js +1 -0
- package/dist/field.d.ts +21 -1201
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +1 -1
- package/dist/flag.js +1 -1
- package/dist/float-C_vwTtzU.js +1 -0
- package/dist/float-JmSzKDHd.js +1 -0
- package/dist/float-OhVY3cf4.js +1 -0
- package/dist/hooks-B-Cd15iL.js +1 -0
- package/dist/hooks-BP_uqBsI.js +1 -0
- package/dist/hooks-BsOjpTgs.js +1 -0
- package/dist/hooks-BybaGF7O.js +1 -0
- package/dist/hooks-C9b-2wGy.js +1 -0
- package/dist/hooks-CMmpICCH.js +1 -0
- package/dist/hooks-CUYIUcp6.js +1 -0
- package/dist/hooks-DKbOd_pQ.js +1 -0
- package/dist/hooks-DejuqCNF.js +1 -0
- package/dist/hooks-GsDfo7Zl.js +1 -0
- package/dist/hooks-PsYFJkz2.js +1 -0
- package/dist/hooks-lDz_S9UG.js +1 -0
- package/dist/hooks.d.ts +96 -7
- package/dist/hooks.js +1 -1
- package/dist/hover-card-BEC5EQiH.js +1 -0
- package/dist/hover-card-parts.d.ts +160 -0
- package/dist/hover-card-parts.js +1 -0
- package/dist/hover-card.d.ts +8 -280
- package/dist/hover-card.js +1 -1
- package/dist/icon-0RoVrpGj.js +1 -0
- package/dist/icon-BSGMvJ0W.js +1 -0
- package/dist/icon-DIiKxRTh.js +1 -0
- package/dist/{icon-QCm1ui29.d.ts → icon-Dqn_LLrR.d.ts} +1 -1
- package/dist/{icon-DuIYoyft.d.ts → icon-KTcDR4--.d.ts} +1 -1
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons-CVgj9Whd.js +1 -0
- package/dist/icons-D_4cZaL1.js +1 -0
- package/dist/icons-DucrvIOa.js +1 -0
- package/dist/icons.js +1 -1
- package/dist/{index-KJ06KK6t.d.ts → index-CCkilmv8.d.ts} +1 -1
- package/dist/input-83xaPZWK.js +1 -0
- package/dist/input-B78ah4AB.js +1 -0
- package/dist/{input-DC4nW0Sr.d.ts → input-Bvpu3ruQ.d.ts} +1 -1
- package/dist/input.d.ts +2 -2
- package/dist/input.js +1 -1
- package/dist/kbd-Bz_Rbpv8.js +1 -0
- package/dist/kbd.d.ts +1 -1
- package/dist/kbd.js +1 -1
- package/dist/{label-epgtywRz.d.ts → label-DZpKu3Pu.d.ts} +1 -1
- package/dist/label-DmkAp9xI.js +1 -0
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/layer-container-DDOZJ0fn.js +1 -0
- package/dist/layer-container.d.ts +9 -1
- package/dist/layer-container.js +1 -1
- package/dist/line-chart-CBL7eCqF.js +1 -0
- package/dist/line-chart-CIDFDkyb.d.ts +380 -0
- package/dist/line-chart-parts.d.ts +6 -0
- package/dist/line-chart-parts.js +1 -0
- package/dist/line-chart.d.ts +4 -568
- package/dist/line-chart.js +1 -1
- package/dist/list-CC3Pi__V.js +1 -0
- package/dist/list-Cx4KNfgC.d.ts +286 -0
- package/dist/list-FiFQJ0BU.js +1 -0
- package/dist/list-parts.d.ts +6 -0
- package/dist/list-parts.js +1 -0
- package/dist/list.d.ts +3 -400
- package/dist/list.js +1 -1
- package/dist/live-region-78gbKwlB.js +1 -0
- package/dist/live-region.d.ts +1 -1
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +33 -10
- package/dist/main-9d96oUPG.js +1 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +1287 -893
- package/dist/media-object-parts.d.ts +65 -0
- package/dist/media-object-parts.js +1 -0
- package/dist/media-object.d.ts +2 -118
- package/dist/media-object.js +1 -1
- package/dist/migrations/0017-select-owned-behavior.yml +117 -0
- package/dist/migrations/0018-combobox-owned-behavior.yml +1661 -0
- package/dist/migrations/0019-multi-select-owned-behavior.yml +1414 -0
- package/dist/migrations/0020-native-floats.yml +823 -0
- package/dist/migrations/0021-native-radio-group.yml +397 -0
- package/dist/migrations/0024-command-owned-behavior.yml +66 -0
- package/dist/migrations/0026-native-dropdown-menu.yml +351 -0
- package/dist/migrations/0029-data-attribute-contract.yml +1707 -0
- package/dist/migrations/0030-between-variant.yml +1954 -0
- package/dist/multi-select-parts.d.ts +487 -0
- package/dist/multi-select-parts.js +1 -0
- package/dist/multi-select-qC0BuYKD.js +1 -0
- package/dist/multi-select.d.ts +6 -803
- package/dist/multi-select.js +1 -1
- package/dist/otp-input-LPdkb_Fg.js +1 -0
- package/dist/otp-input-parts.d.ts +211 -0
- package/dist/otp-input-parts.js +1 -0
- package/dist/otp-input-zl6MVio6.js +1 -0
- package/dist/otp-input.d.ts +11 -252
- package/dist/otp-input.js +1 -1
- package/dist/overlay-prompt-BIzMQvx7.js +1 -0
- package/dist/overlay-prompt-CDnhSoPJ.js +1 -0
- package/dist/overlay-prompt.d.ts +57 -0
- package/dist/overlay-prompt.js +1 -0
- package/dist/pagination-B2ESEbMI.d.ts +171 -0
- package/dist/pagination-CxaLKZcE.js +1 -0
- package/dist/pagination-Df1gTCN-.js +1 -0
- package/dist/pagination-cursor-pagination-parts.d.ts +6 -0
- package/dist/pagination-cursor-pagination-parts.js +1 -0
- package/dist/pagination.d.ts +38 -303
- package/dist/pagination.js +1 -1
- package/dist/popover-DOd6zLvE.d.ts +226 -0
- package/dist/popover-DWvHbepV.js +1 -0
- package/dist/popover-parts.d.ts +6 -0
- package/dist/popover-parts.js +1 -0
- package/dist/popover.d.ts +60 -2
- package/dist/popover.js +1 -1
- package/dist/position-Cv3XpSur.d.ts +5 -0
- package/dist/progress-BE0c8GW8.js +1 -0
- package/dist/progress-ZhFJhv9u.js +1 -0
- package/dist/progress-bar-parts.d.ts +86 -0
- package/dist/progress-bar-parts.js +1 -0
- package/dist/progress-donut-parts.d.ts +94 -0
- package/dist/progress-donut-parts.js +1 -0
- package/dist/progress-mJQMhxMX.js +1 -0
- package/dist/progress-zDpT3TY4.d.ts +2 -0
- package/dist/progress.d.ts +4 -268
- package/dist/progress.js +1 -1
- package/dist/qr-code-0zh10iIE.d.ts +148 -0
- package/dist/qr-code-BOOubA9x.js +1 -0
- package/dist/qr-code-D8tBKtjP.js +1 -0
- package/dist/qr-code-DzJjumoc.d.ts +46 -0
- package/dist/qr-code-encoder.browser.d.ts +15 -0
- package/dist/qr-code-encoder.browser.js +1 -0
- package/dist/qr-code-encoder.d.ts +15 -0
- package/dist/qr-code-encoder.js +1 -0
- package/dist/qr-code-parts.d.ts +6 -0
- package/dist/qr-code-parts.js +1 -0
- package/dist/qr-code.d.ts +4 -227
- package/dist/qr-code.js +1 -1
- package/dist/query-C0e5VYNp.d.ts +440 -0
- package/dist/query-V5NifJGs.js +1 -0
- package/dist/query-filter.js +1 -1
- package/dist/query-parts.d.ts +6 -0
- package/dist/query-parts.js +1 -0
- package/dist/query.d.ts +3 -637
- package/dist/query.js +1 -1
- package/dist/radio-group-B9jtIbV1.d.ts +39 -0
- package/dist/radio-group-f3ThXQCx.js +1 -0
- package/dist/radio-group-parts.d.ts +249 -0
- package/dist/radio-group-parts.js +1 -0
- package/dist/radio-group-zA5DjlLg.js +1 -0
- package/dist/radio-group.d.ts +7 -399
- package/dist/radio-group.js +1 -1
- package/dist/sandbar-Cm2yMjEZ.js +1 -0
- package/dist/sandbar-DU4wpKRc.d.ts +345 -0
- package/dist/sandbar-parts.d.ts +6 -0
- package/dist/sandbar-parts.js +1 -0
- package/dist/sandbar.d.ts +3 -438
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click-Cg3lewoG.js +1 -0
- package/dist/sandboxed-on-click-DOw_Jkhk.js +1 -0
- package/dist/sandboxed-on-click.d.ts +1 -1
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot-1vFxkpjT.js +1 -0
- package/dist/scatter-plot-D25jLIVw.d.ts +388 -0
- package/dist/scatter-plot-parts.d.ts +6 -0
- package/dist/scatter-plot-parts.js +1 -0
- package/dist/scatter-plot.d.ts +4 -573
- package/dist/scatter-plot.js +1 -1
- package/dist/segmented-control-DuiDPKDZ.js +1 -0
- package/dist/segmented-control-parts.d.ts +72 -0
- package/dist/segmented-control-parts.js +1 -0
- package/dist/segmented-control.d.ts +4 -100
- package/dist/segmented-control.js +1 -1
- package/dist/select-08IEtypH.js +1 -0
- package/dist/select-DM2wWfOO.d.ts +478 -0
- package/dist/select-parts.d.ts +6 -0
- package/dist/select-parts.js +1 -0
- package/dist/select.d.ts +63 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list-Ax5F2Gz1.js +1 -0
- package/dist/selectable-list-CyLc3EEt.d.ts +407 -0
- package/dist/selectable-list-GcpbbRM1.js +1 -0
- package/dist/selectable-list-parts.d.ts +6 -0
- package/dist/selectable-list-parts.js +1 -0
- package/dist/selectable-list.d.ts +3 -643
- package/dist/selectable-list.js +1 -1
- package/dist/separator-BB1ohsjn.js +1 -0
- package/dist/{separator-Ck4sPrdN.d.ts → separator-BzHNVyyv.d.ts} +1 -1
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/sheet-5JgxVaWC.js +1 -0
- package/dist/sheet-parts.d.ts +732 -0
- package/dist/sheet-parts.js +1 -0
- package/dist/sheet-qYPi5MP8.js +1 -0
- package/dist/sheet.d.ts +11 -1224
- package/dist/sheet.js +1 -1
- package/dist/sidebar-CsC9fyPL.js +1 -0
- package/dist/sidebar-HDVxTNPi.js +1 -0
- package/dist/sidebar-OBA7L42d.d.ts +1480 -0
- package/dist/sidebar-parts.d.ts +6 -0
- package/dist/sidebar-parts.js +1 -0
- package/dist/sidebar.d.ts +108 -2518
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-DB0oQyAx.js +1 -0
- package/dist/skeleton.d.ts +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link-BGhAWSqB.js +1 -0
- package/dist/skip-to-main-link.d.ts +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider-YlBozcPQ.js +1 -0
- package/dist/slider.d.ts +149 -15
- package/dist/slider.js +1 -1
- package/dist/slot-5ZSmrISx.d.ts +19 -0
- package/dist/slot-BxngGBJ2.js +1 -0
- package/dist/slot-CBcGhRdV.js +1 -0
- package/dist/{slot-BEMQMbk3.d.ts → slot-tuk2J6bY.d.ts} +6 -23
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button-DvJHD7cZ.js +1 -0
- package/dist/split-button-parts.d.ts +178 -0
- package/dist/split-button-parts.js +1 -0
- package/dist/split-button.d.ts +2 -314
- package/dist/split-button.js +1 -1
- package/dist/strata-parts.d.ts +256 -0
- package/dist/strata-parts.js +1 -0
- package/dist/strata.d.ts +4 -493
- package/dist/strata.js +1 -1
- package/dist/switch-DajWYrq3.js +1 -0
- package/dist/switch.d.ts +36 -4
- package/dist/switch.js +1 -1
- package/dist/{table-Ii9hHUWN.d.ts → table-C2KnE83u.d.ts} +5 -444
- package/dist/table-DJHK48-8.js +1 -0
- package/dist/table-parts.d.ts +6 -0
- package/dist/table-parts.js +1 -0
- package/dist/table.d.ts +81 -1
- package/dist/table.js +1 -1
- package/dist/tabs-36-4SlRo.js +1 -0
- package/dist/tabs-CC_HAqr4.d.ts +193 -0
- package/dist/tabs-DayeszXP.js +1 -0
- package/dist/tabs-headless-tabs-parts.d.ts +6 -0
- package/dist/tabs-headless-tabs-parts.js +1 -0
- package/dist/tabs-parts.d.ts +237 -0
- package/dist/tabs-parts.js +1 -0
- package/dist/tabs.d.ts +43 -420
- package/dist/tabs.js +1 -1
- package/dist/text-area-D29JTaZg.js +1 -0
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-D6rP5Fy8.js +1 -0
- package/dist/theme-switcher-PKMCyJxT.js +1 -0
- package/dist/theme-switcher.d.ts +23 -19
- package/dist/theme-switcher.js +1 -1
- package/dist/theme-xoFnLba6.js +1 -0
- package/dist/theme.d.ts +70 -65
- package/dist/theme.js +1 -1
- package/dist/time-zone-CpWYKHdp.js +1 -0
- package/dist/time-zone-DZ4hUJ8K.js +1 -0
- package/dist/time-zone.d.ts +190 -0
- package/dist/time-zone.js +1 -0
- package/dist/toast-BJZ__22c.js +1 -0
- package/dist/toast-Cb9IN-6e.d.ts +185 -0
- package/dist/toast-DM_oq-3E.js +1 -0
- package/dist/toast-parts.d.ts +6 -0
- package/dist/toast-parts.js +1 -0
- package/dist/toast.d.ts +7 -256
- package/dist/toast.js +1 -1
- package/dist/tokens.dark.json +31 -266
- package/dist/tokens.json +139 -205
- package/dist/tooltip-D4HZn19B.js +1 -0
- package/dist/tooltip-DP6Lz6jv.d.ts +180 -0
- package/dist/tooltip-Uy-kz0rK.d.ts +1 -0
- package/dist/tooltip-parts.d.ts +7 -0
- package/dist/tooltip-parts.js +1 -0
- package/dist/tooltip.d.ts +57 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text-B5u2AlNg.js +1 -0
- package/dist/truncated-text-BoXHP-cD.js +1 -0
- package/dist/truncated-text.d.ts +3 -5
- package/dist/truncated-text.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/typography-C2BmSH12.d.ts +148 -0
- package/dist/typography-parts.d.ts +6 -0
- package/dist/typography-parts.js +1 -0
- package/dist/typography.d.ts +52 -0
- package/dist/typography.js +1 -0
- package/dist/use-combobox-OhIEVioc.d.ts +23 -0
- package/dist/use-float-WEqqhXBE.d.ts +18 -0
- package/dist/use-listbox-D4uIonSN.d.ts +1 -0
- package/dist/utils-BN3rwHzz.js +1 -0
- package/dist/utils-BlLYcYik.js +1 -0
- package/dist/utils-C4astHJG.js +1 -0
- package/dist/utils-CPSttKPD.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +1 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +2 -2
- package/dist/well.js +1 -1
- package/dist/world-map-BDd3N_Ap.d.ts +424 -0
- package/dist/world-map-D3c8Pq-h.js +1 -0
- package/dist/world-map-parts.d.ts +6 -0
- package/dist/world-map-parts.js +1 -0
- package/dist/world-map-t9U-IMKS.js +1 -0
- package/dist/world-map.d.ts +80 -0
- package/dist/world-map.js +1 -0
- package/package.json +15 -18
- package/dist/alert-BkJHDx9X.js +0 -1
- package/dist/anchor-Dc6IgvXV.js +0 -1
- package/dist/browser-only-CZfkNw5A.js +0 -1
- package/dist/button-B9bChDgl.js +0 -1
- package/dist/button-BQZ6eoD3.js +0 -1
- package/dist/button-D8jixIbH.js +0 -1
- package/dist/button-DNLTJ32M.js +0 -1
- package/dist/chart-BLCqzt56.js +0 -1
- package/dist/chart-CChZiCrt.js +0 -1
- package/dist/chart-CUmSu9d7.js +0 -1
- package/dist/chart-DtgZBAas.js +0 -2
- package/dist/checkbox-Cu5cgZmk.js +0 -1
- package/dist/choice-CCVG2hb9.js +0 -1
- package/dist/clsx-DUGZgXfJ.js +0 -1
- package/dist/clsx-Dj3RWZ2l.js +0 -1
- package/dist/code-BPKNY1_w.js +0 -1
- package/dist/cx-CK7o_rVv.js +0 -1
- package/dist/dialog-CIEuwNys.d.ts +0 -958
- package/dist/dialog-CbEEA0fl.d.ts +0 -32
- package/dist/dialog-DmzoDfY3.js +0 -1
- package/dist/dropdown-menu-CeY498yk.d.ts +0 -775
- package/dist/dropdown-menu-uheL0prz.js +0 -1
- package/dist/field-Bpvn4tQp.js +0 -1
- package/dist/field-Cai_4c1l.js +0 -1
- package/dist/icon-BudQMD2S.js +0 -1
- package/dist/icon-xb7d9M7X.js +0 -1
- package/dist/icons-DEDCLZ8B.js +0 -1
- package/dist/icons-DXadFwpo.js +0 -1
- package/dist/icons-DcesO4Ng.js +0 -1
- package/dist/input-DQyN6gN0.js +0 -1
- package/dist/input-fW8QSZEO.js +0 -1
- package/dist/interactive-target-BXScNeOr.js +0 -1
- package/dist/kbd-P1nQshWo.js +0 -1
- package/dist/label-DO1RlMKl.js +0 -1
- package/dist/layer-container-DL4yclOu.js +0 -1
- package/dist/list-cQZPSjfz.js +0 -1
- package/dist/live-region-Dhapu8a5.js +0 -1
- package/dist/main-CHyWYDak.js +0 -1
- package/dist/popover-Bei0jyfH.d.ts +0 -357
- package/dist/popover-DhgunktK.js +0 -1
- package/dist/popover-T2EyaqGK.d.ts +0 -1
- package/dist/primitive-D8CzV_Ft.js +0 -1
- package/dist/radio-group-BJQ6EOqh.d.ts +0 -27
- package/dist/radio-group-ggEkCi0V.js +0 -1
- package/dist/sandboxed-on-click-D4PL5_GR.js +0 -1
- package/dist/select-1xuUx_os.js +0 -1
- package/dist/select-BpaXHxJm.d.ts +0 -890
- package/dist/separator-DnvhwY2J.js +0 -1
- package/dist/shake-CAUpKBHe.js +0 -1
- package/dist/sheet-DHy_vlme.js +0 -1
- package/dist/skeleton-DHfyjuQi.js +0 -1
- package/dist/slot-B7rwscwd.js +0 -1
- package/dist/table-BnLdXUai.js +0 -1
- package/dist/theme-BNdZl352.js +0 -1
- package/dist/tooltip-CstGDKwy.d.ts +0 -283
- package/dist/tooltip-DQO40Mrq.js +0 -1
- package/dist/use-breakpoint-B4Kh0xE6.js +0 -1
- package/dist/use-callback-ref-DiOXFQzM.js +0 -1
- package/dist/use-composed-refs-DPYmLDSe.js +0 -1
- package/dist/use-copy-to-clipboard-hBL6_65i.js +0 -1
- package/dist/use-inert-siblings-C4RHXrZc.js +0 -1
- package/dist/use-is-apple-platform-Bq6_KbVX.js +0 -1
- package/dist/use-is-hydrated-after-paint-CrHt3OHw.js +0 -1
- package/dist/use-isomorphic-layout-effect-CL6iq0Bj.js +0 -1
- package/dist/use-matches-media-query-FfvtNKQe.js +0 -1
- package/dist/use-prefers-reduced-motion-Ck6dnOM9.js +0 -1
- package/dist/use-swipe-to-dismiss-BYdlca8r.js +0 -1
- /package/dist/{use-is-hydrated-BeLOGKwE.js → hooks-BeLOGKwE.js} +0 -0
- /package/dist/{suggestions-Ciz2vaJO.js → query-filter-Ciz2vaJO.js} +0 -0
- /package/dist/{direction-CvDpql3O.js → sorting-CvDpql3O.js} +0 -0
- /package/dist/{booleanish-BfvnW6vy.js → types-BfvnW6vy.js} +0 -0
- /package/dist/{css-properties-D85fCNV3.js → types-D85fCNV3.js} +0 -0
- /package/dist/{alternate-announcement-BkH4bOKp.js → utils-BkH4bOKp.js} +0 -0
- /package/dist/{copy-to-clipboard-Dd83caRw.js → utils-Dd83caRw.js} +0 -0
- /package/dist/{in-view-Dxv_GrUU.js → utils-Dxv_GrUU.js} +0 -0
- /package/dist/{data-slot-EM6s2WEU.js → utils-EM6s2WEU.js} +0 -0
- /package/dist/{cookie-ca4g5CKp.js → utils-ca4g5CKp.js} +0 -0
package/dist/data-table.d.ts
CHANGED
|
@@ -3,631 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/data-display/data-table
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { i as IconButtonIntent, r as IconButtonAppearance, t as IconButton } from "./button-DnYv7IOT.js";
|
|
10
|
-
import { t as Table$1 } from "./table-Ii9hHUWN.js";
|
|
11
|
-
import { ComponentProps, ReactNode } from "react";
|
|
12
|
-
import { CellData, Column, Column_RowSorting, Row as Row$1, RowData, Row_RowExpanding, StockFeatures, Table, TableFeatures } from "@tanstack/react-table";
|
|
6
|
+
import * as DataTableParts from "./data-table-parts.js";
|
|
7
|
+
import { Row, RowData, TableFeatures } from "@tanstack/react-table";
|
|
8
|
+
import { t as DataTableColumnMeta } from "./data-table-GUbt8mzo.js";
|
|
13
9
|
export * from "@tanstack/react-table";
|
|
14
|
-
declare const sortDirections: readonly ["asc", "desc", "unsorted"];
|
|
15
|
-
type SortDirection = (typeof sortDirections)[number];
|
|
16
|
-
/**
|
|
17
|
-
* How wide a `DataTable` column renders. `"fit"` makes the column only as wide
|
|
18
|
-
* as its widest content, on one line, and gives the spare width to the other
|
|
19
|
-
* columns.
|
|
20
|
-
*/
|
|
21
|
-
type ColumnWidth = "fit";
|
|
22
|
-
/**
|
|
23
|
-
* The column `meta` fields that `DataTable.Header` and `DataTable.Cell` read
|
|
24
|
-
* through their `column` prop. Tables with no `columnMeta` slot get these
|
|
25
|
-
* fields from the global `ColumnMeta` interface. A table with a `columnMeta`
|
|
26
|
-
* slot must add them to the slot type, because the slot replaces the global
|
|
27
|
-
* interface.
|
|
28
|
-
*
|
|
29
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#sizing-a-column-to-its-content
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* type PaymentsColumnMeta = DataTableColumnMeta & { align?: "start" | "end" };
|
|
34
|
-
*
|
|
35
|
-
* const features = tableFeatures({
|
|
36
|
-
* columnMeta: metaHelper<PaymentsColumnMeta>(),
|
|
37
|
-
* });
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
type DataTableColumnMeta = {
|
|
41
|
-
/**
|
|
42
|
-
* How wide the column renders. When omitted, the browser shares the
|
|
43
|
-
* table's spare width across every column.
|
|
44
|
-
*/
|
|
45
|
-
width?: ColumnWidth;
|
|
46
|
-
};
|
|
47
|
-
declare module "@tanstack/react-table" {
|
|
48
|
-
interface ColumnMeta<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData = CellData> extends DataTableColumnMeta {}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* The table features a sortable column needs. `DataTable.HeaderSortButton`
|
|
52
|
-
* calls the column's sorting API, which exists only when the table registers
|
|
53
|
-
* `rowSortingFeature`.
|
|
54
|
-
*/
|
|
55
|
-
type SortableTableFeatures = Pick<StockFeatures, "rowSortingFeature">;
|
|
56
|
-
/**
|
|
57
|
-
* The table features an expandable row needs. `DataTable.RowExpandButton`
|
|
58
|
-
* calls the row's expansion API, which exists only when the table registers
|
|
59
|
-
* `rowExpandingFeature`.
|
|
60
|
-
*/
|
|
61
|
-
type ExpandableTableFeatures = Pick<StockFeatures, "rowExpandingFeature">;
|
|
62
|
-
/** A column from a table that registers `rowSortingFeature`. */
|
|
63
|
-
type SortableColumn<TFeatures extends SortableTableFeatures, TData extends RowData, TValue extends CellData> = Column<TFeatures, TData, TValue> & Column_RowSorting<TFeatures, TData>;
|
|
64
|
-
/** A row from a table that registers `rowExpandingFeature`. */
|
|
65
|
-
type ExpandableRow<TFeatures extends ExpandableTableFeatures, TData extends RowData> = Row$1<TFeatures, TData> & Row_RowExpanding;
|
|
66
|
-
type DataTableProps<TFeatures extends TableFeatures, TData extends RowData> = ComponentProps<typeof Table$1.Root> & {
|
|
67
|
-
/**
|
|
68
|
-
* The TanStack Table instance from `useTable`. Every other `DataTable` part
|
|
69
|
-
* reads it through context.
|
|
70
|
-
*/
|
|
71
|
-
table: Table<TFeatures, TData>;
|
|
72
|
-
} & WithDataSlot;
|
|
73
|
-
/**
|
|
74
|
-
* The root container for a data table. Wraps all other `DataTable`
|
|
75
|
-
* sub-components and provides the table context to its descendants.
|
|
76
|
-
*
|
|
77
|
-
* REQUIRED: Construct a TanStack Table instance via `useTable` (from
|
|
78
|
-
* `@tanstack/react-table`, also re-exported from `@ngrok/mantle/data-table`)
|
|
79
|
-
* and pass it through the `table` prop. The instance owns columns, data, and
|
|
80
|
-
* any sorting / filtering / pagination state. The wrapper components read
|
|
81
|
-
* from it.
|
|
82
|
-
*
|
|
83
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableroot
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* ```tsx
|
|
87
|
-
* import {
|
|
88
|
-
* DataTable,
|
|
89
|
-
* createColumnHelper,
|
|
90
|
-
* tableFeatures,
|
|
91
|
-
* useTable,
|
|
92
|
-
* } from "@ngrok/mantle/data-table";
|
|
93
|
-
*
|
|
94
|
-
* type Row = { id: string; name: string };
|
|
95
|
-
* const features = tableFeatures({});
|
|
96
|
-
* const columnHelper = createColumnHelper<typeof features, Row>();
|
|
97
|
-
* const columns = columnHelper.columns([
|
|
98
|
-
* columnHelper.accessor("name", {
|
|
99
|
-
* id: "name",
|
|
100
|
-
* header: () => <DataTable.Header>Name</DataTable.Header>,
|
|
101
|
-
* cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,
|
|
102
|
-
* }),
|
|
103
|
-
* ]);
|
|
104
|
-
*
|
|
105
|
-
* function MyTable({ data }: { data: Row[] }) {
|
|
106
|
-
* const table = useTable({ features, data, columns });
|
|
107
|
-
* const rows = table.getRowModel().rows;
|
|
108
|
-
*
|
|
109
|
-
* return (
|
|
110
|
-
* <DataTable.Root table={table}>
|
|
111
|
-
* <DataTable.Head />
|
|
112
|
-
* <DataTable.Body>
|
|
113
|
-
* {rows.length > 0
|
|
114
|
-
* ? rows.map((row) => <DataTable.Row key={row.id} row={row} />)
|
|
115
|
-
* : <DataTable.EmptyRow>No results.</DataTable.EmptyRow>}
|
|
116
|
-
* </DataTable.Body>
|
|
117
|
-
* </DataTable.Root>
|
|
118
|
-
* );
|
|
119
|
-
* }
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
declare function Root<TFeatures extends TableFeatures, TData extends RowData>({ "data-slot": dataSlot, children, table, ...props }: DataTableProps<TFeatures, TData>): import("react").JSX.Element;
|
|
123
|
-
type DataTableHeaderSortButtonProps<TFeatures extends SortableTableFeatures, TData extends RowData, TValue extends CellData> = Omit<ComponentProps<typeof Button>, "appearance" | "icon" | "intent"> & {
|
|
124
|
-
/**
|
|
125
|
-
* The TanStack Table column this button sorts (`props.column` in `header`).
|
|
126
|
-
* The table must register `rowSortingFeature`.
|
|
127
|
-
*/
|
|
128
|
-
column: SortableColumn<TFeatures, TData, TValue>;
|
|
129
|
-
/**
|
|
130
|
-
* The visual style of the sort button. Optional: the header sort button's
|
|
131
|
-
* design is a ghost button, so the wrapper defaults it.
|
|
132
|
-
* @default "ghost"
|
|
133
|
-
*/
|
|
134
|
-
appearance?: ButtonAppearance;
|
|
135
|
-
/**
|
|
136
|
-
* The tone of the sort button. Optional: the header sort button's design
|
|
137
|
-
* is neutral-toned, so the wrapper defaults it.
|
|
138
|
-
* @default "neutral"
|
|
139
|
-
*/
|
|
140
|
-
intent?: ButtonIntent;
|
|
141
|
-
} & ({
|
|
142
|
-
/**
|
|
143
|
-
* Disable sorting for this column.
|
|
144
|
-
* It will prevent the sorting direction from being toggled and any icon
|
|
145
|
-
* from being shown.
|
|
146
|
-
*/
|
|
147
|
-
disableSorting: true;
|
|
148
|
-
/**
|
|
149
|
-
* Use this to render a custom sort icon for the column if it is sortable
|
|
150
|
-
* and you want to override the default sort icon
|
|
151
|
-
*/
|
|
152
|
-
sortIcon?: undefined;
|
|
153
|
-
/**
|
|
154
|
-
* The sorting mode of the column, whether it is alphanumeric or time based.
|
|
155
|
-
*/
|
|
156
|
-
sortingMode?: undefined;
|
|
157
|
-
} | {
|
|
158
|
-
disableSorting?: false;
|
|
159
|
-
/**
|
|
160
|
-
* Use this to render a custom sort icon for the column if it is sortable
|
|
161
|
-
* and you want to override the default sort icon
|
|
162
|
-
*/
|
|
163
|
-
sortIcon?: (sortDirection: SortDirection) => ReactNode;
|
|
164
|
-
/**
|
|
165
|
-
* The sorting mode of the column, whether it is alphanumeric or time based.
|
|
166
|
-
*/
|
|
167
|
-
sortingMode: SortingMode;
|
|
168
|
-
}) & WithDataSlot;
|
|
169
|
-
/**
|
|
170
|
-
* A sortable button toggle for a column header in a data table. Renders a sort
|
|
171
|
-
* icon that reflects the current direction and cycles through sort states on
|
|
172
|
-
* click. The button's accessible name is the column label and does not change
|
|
173
|
-
* with the sort state; pass `column` to the surrounding `DataTable.Header` so
|
|
174
|
-
* the header cell exposes the state through `aria-sort`.
|
|
175
|
-
*
|
|
176
|
-
* Each click cycles through:
|
|
177
|
-
* - For `"alphanumeric"` sorting: `unsorted → ascending → descending → unsorted`
|
|
178
|
-
* - For `"time"` sorting: `unsorted → newest-first → oldest-first → unsorted`
|
|
179
|
-
*
|
|
180
|
-
* The table must register `rowSortingFeature`; the `column` prop's type rejects a
|
|
181
|
-
* column from a table without it. Pair it with `sortedRowModel: createSortedRowModel()`,
|
|
182
|
-
* or the button toggles the icon and never reorders a row. Register a `sortFns` slot
|
|
183
|
-
* too: without one, auto-sort falls back to `sortFn_basic`.
|
|
184
|
-
*
|
|
185
|
-
* When the column cannot sort (`disableSorting`, or `enableSorting: false` on
|
|
186
|
-
* the column), the part renders the label as plain text in a `<span>`: no
|
|
187
|
-
* button, no icon. The other props, `ref` included, land on that span.
|
|
188
|
-
* `onClick` does not, because plain text takes no click.
|
|
189
|
-
*
|
|
190
|
-
* For right-aligned numeric columns, pass `className="justify-end"` and
|
|
191
|
-
* `iconPlacement="start"` so the sort icon stays paired with the label.
|
|
192
|
-
*
|
|
193
|
-
* | Data Attribute | Value | Description |
|
|
194
|
-
* | -------------------------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
195
|
-
* | `data-sort-direction` | `"asc"`, `"desc"`, or `"unsorted"` | The column's current sort direction. Always `"unsorted"` on the plain-text span. |
|
|
196
|
-
* | `data-table-header-action` | present on the button | Presence-only. `DataTable.Header` drops its horizontal padding when a descendant carries it. Absent on the plain-text span. |
|
|
197
|
-
*
|
|
198
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableheadersortbutton
|
|
199
|
-
*
|
|
200
|
-
* @example
|
|
201
|
-
* ```tsx
|
|
202
|
-
* const features = tableFeatures({
|
|
203
|
-
* rowSortingFeature,
|
|
204
|
-
* sortedRowModel: createSortedRowModel(),
|
|
205
|
-
* sortFns: {
|
|
206
|
-
* alphanumeric: sortFn_alphanumeric,
|
|
207
|
-
* datetime: sortFn_datetime,
|
|
208
|
-
* text: sortFn_text,
|
|
209
|
-
* },
|
|
210
|
-
* });
|
|
211
|
-
* const columnHelper = createColumnHelper<typeof features, Row>();
|
|
212
|
-
*
|
|
213
|
-
* columnHelper.accessor("email", {
|
|
214
|
-
* id: "email",
|
|
215
|
-
* header: (props) => (
|
|
216
|
-
* <DataTable.Header column={props.column}>
|
|
217
|
-
* <DataTable.HeaderSortButton column={props.column} sortingMode="alphanumeric">
|
|
218
|
-
* Email
|
|
219
|
-
* </DataTable.HeaderSortButton>
|
|
220
|
-
* </DataTable.Header>
|
|
221
|
-
* ),
|
|
222
|
-
* cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,
|
|
223
|
-
* });
|
|
224
|
-
* ```
|
|
225
|
-
*/
|
|
226
|
-
declare function HeaderSortButton<TFeatures extends SortableTableFeatures, TData extends RowData, TValue extends CellData>({ "data-slot": dataSlot, appearance, children, className, column, disableSorting, iconPlacement, intent, sortingMode, sortIcon: propSortIcon, onClick, ...props }: DataTableHeaderSortButtonProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
227
|
-
type DataTableHeaderProps<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData> = ComponentProps<typeof Table$1.Header> & {
|
|
228
|
-
/**
|
|
229
|
-
* The TanStack Table column this cell heads (`props.column` in `header`).
|
|
230
|
-
* When the column is sorted, the cell carries `aria-sort`. When the
|
|
231
|
-
* column's `meta.width` is `"fit"`, the cell carries `data-column-width="fit"`.
|
|
232
|
-
*/
|
|
233
|
-
column?: Column<TFeatures, TData, TValue>;
|
|
234
|
-
} & WithDataSlot;
|
|
235
|
-
/**
|
|
236
|
-
* A `<th>` optimized for header actions. Wrap each column's header content in
|
|
237
|
-
* this; for sortable columns, nest a `DataTable.HeaderSortButton` inside and
|
|
238
|
-
* pass the same `column` here, so the cell carries `aria-sort` while the column
|
|
239
|
-
* is sorted. Non-sortable columns can render plain text. The `column` prop
|
|
240
|
-
* also applies the column's `meta.width`.
|
|
241
|
-
*
|
|
242
|
-
* **Data attributes:**
|
|
243
|
-
*
|
|
244
|
-
* | Data Attribute | Value | Description |
|
|
245
|
-
* | --- | --- | --- |
|
|
246
|
-
* | `data-slot` | `"data-table-header table-header"` | On the `<th>`, joined ahead of `Table.Header`'s own slot. |
|
|
247
|
-
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The header does not wrap its content, and the column shrinks to fit it. |
|
|
248
|
-
*
|
|
249
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableheader
|
|
250
|
-
*
|
|
251
|
-
* @example
|
|
252
|
-
* ```tsx
|
|
253
|
-
* columnHelper.accessor("name", {
|
|
254
|
-
* id: "name",
|
|
255
|
-
* header: (props) => (
|
|
256
|
-
* <DataTable.Header column={props.column}>
|
|
257
|
-
* <DataTable.HeaderSortButton column={props.column} sortingMode="alphanumeric">
|
|
258
|
-
* Name
|
|
259
|
-
* </DataTable.HeaderSortButton>
|
|
260
|
-
* </DataTable.Header>
|
|
261
|
-
* ),
|
|
262
|
-
* cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,
|
|
263
|
-
* });
|
|
264
|
-
* ```
|
|
265
|
-
*/
|
|
266
|
-
declare function Header<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData>({ "data-slot": dataSlot, children, className, column, ...props }: DataTableHeaderProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
267
|
-
type DataTableCellProps<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData> = ComponentProps<typeof Table$1.Cell> & {
|
|
268
|
-
/**
|
|
269
|
-
* The TanStack Table column this cell belongs to (`props.column` in `cell`).
|
|
270
|
-
* When the column's `meta.width` is `"fit"`, the cell carries
|
|
271
|
-
* `data-column-width="fit"`.
|
|
272
|
-
*/
|
|
273
|
-
column?: Column<TFeatures, TData, TValue>;
|
|
274
|
-
} & WithDataSlot;
|
|
275
|
-
/**
|
|
276
|
-
* A `<td>` for one data cell. Wrap the output of each column's `cell`
|
|
277
|
-
* function in this; a raw `<td>` skips mantle typography and padding. Pass
|
|
278
|
-
* `column` to apply the column's `meta.width`, and pass the same `column` to
|
|
279
|
-
* the column's `DataTable.Header`, so the header and every cell agree.
|
|
280
|
-
*
|
|
281
|
-
* **Data attributes:**
|
|
282
|
-
*
|
|
283
|
-
* | Data Attribute | Value | Description |
|
|
284
|
-
* | --- | --- | --- |
|
|
285
|
-
* | `data-slot` | `"data-table-cell table-cell"` | On the `<td>`, joined ahead of `Table.Cell`'s own slot. |
|
|
286
|
-
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The cell does not wrap its content, and the column shrinks to fit it. |
|
|
287
|
-
*
|
|
288
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecell
|
|
289
|
-
*
|
|
290
|
-
* @example
|
|
291
|
-
* ```tsx
|
|
292
|
-
* columnHelper.accessor("createdAt", {
|
|
293
|
-
* id: "createdAt",
|
|
294
|
-
* meta: { width: "fit" },
|
|
295
|
-
* header: (props) => <DataTable.Header column={props.column}>Created</DataTable.Header>,
|
|
296
|
-
* cell: (props) => <DataTable.Cell column={props.column}>{props.getValue()}</DataTable.Cell>,
|
|
297
|
-
* });
|
|
298
|
-
* ```
|
|
299
|
-
*/
|
|
300
|
-
declare function Cell<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData>({ "data-slot": dataSlot, className, column, ...props }: DataTableCellProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
301
|
-
/**
|
|
302
|
-
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
303
|
-
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is no data.
|
|
304
|
-
*
|
|
305
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablebody
|
|
306
|
-
*
|
|
307
|
-
* @example
|
|
308
|
-
* ```tsx
|
|
309
|
-
* const table = useTable({ features, data, columns });
|
|
310
|
-
* const rows = table.getRowModel().rows;
|
|
311
|
-
*
|
|
312
|
-
* <DataTable.Root table={table}>
|
|
313
|
-
* <DataTable.Head />
|
|
314
|
-
* <DataTable.Body>
|
|
315
|
-
* {rows.length > 0
|
|
316
|
-
* ? rows.map((row) => <DataTable.Row key={row.id} row={row} />)
|
|
317
|
-
* : <DataTable.EmptyRow>No results.</DataTable.EmptyRow>}
|
|
318
|
-
* </DataTable.Body>
|
|
319
|
-
* </DataTable.Root>
|
|
320
|
-
* ```
|
|
321
|
-
*/
|
|
322
|
-
declare const Body: ({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Table$1.Body> & WithDataSlot) => import("react").JSX.Element;
|
|
323
|
-
type DataTableHeadProps = Omit<ComponentProps<typeof Table$1.Head>, "children"> & WithDataSlot;
|
|
324
|
-
/**
|
|
325
|
-
* The `<thead>` container that renders column headers automatically from
|
|
326
|
-
* `table.getHeaderGroups()`. Does not accept children: the headers come from
|
|
327
|
-
* each column's `header` definition on the TanStack Table column config.
|
|
328
|
-
*
|
|
329
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablehead
|
|
330
|
-
*
|
|
331
|
-
* @example
|
|
332
|
-
* ```tsx
|
|
333
|
-
* const table = useTable({ features, data, columns });
|
|
334
|
-
* const rows = table.getRowModel().rows;
|
|
335
|
-
*
|
|
336
|
-
* <DataTable.Root table={table}>
|
|
337
|
-
* <DataTable.Head />
|
|
338
|
-
* <DataTable.Body>
|
|
339
|
-
* {rows.length > 0
|
|
340
|
-
* ? rows.map((row) => <DataTable.Row key={row.id} row={row} />)
|
|
341
|
-
* : <DataTable.EmptyRow>No results.</DataTable.EmptyRow>}
|
|
342
|
-
* </DataTable.Body>
|
|
343
|
-
* </DataTable.Root>
|
|
344
|
-
* ```
|
|
345
|
-
*/
|
|
346
|
-
declare function Head({ "data-slot": dataSlot, ...props }: DataTableHeadProps): import("react").JSX.Element;
|
|
347
|
-
type DataTableRowProps<TFeatures extends TableFeatures, TData extends RowData> = Omit<ComponentProps<typeof Table$1.Row>, "children"> & {
|
|
348
|
-
/** The TanStack Table row instance to render. */
|
|
349
|
-
row: Row$1<TFeatures, TData>;
|
|
350
|
-
/**
|
|
351
|
-
* Renders an inline detail panel beneath the row. Called only while the row is
|
|
352
|
-
* expanded (`row.getIsExpanded()`), so the panel (and any expensive work it
|
|
353
|
-
* does) stays lazy. Mantle wraps the returned content in a sibling
|
|
354
|
-
* `DataTable.ExpandedRow` spanning every visible column, so return the
|
|
355
|
-
* panel content (not a `<tr>`). Requires the table to register
|
|
356
|
-
* `rowExpandingFeature`, plus `getRowCanExpand` for detail panels; pair it
|
|
357
|
-
* with a `DataTable.RowExpandButton` toggle in a leading column. Add
|
|
358
|
-
* `expandedRowModel: createExpandedRowModel()` when rows have sub-rows. For
|
|
359
|
-
* full control over the detail row (custom `colSpan`,
|
|
360
|
-
* multiple panels), omit this and render `DataTable.ExpandedRow` yourself.
|
|
361
|
-
*/
|
|
362
|
-
renderExpanded?: (row: Row$1<TFeatures, TData>) => ReactNode;
|
|
363
|
-
} & WithDataSlot;
|
|
364
|
-
/**
|
|
365
|
-
* A single data table body row rendered from a TanStack Table row instance.
|
|
366
|
-
* Does not accept children: cells come from each column's `cell` definition.
|
|
367
|
-
*
|
|
368
|
-
* When `onClick` is set, the row receives `cursor-pointer` and `data-clickable`.
|
|
369
|
-
* Pass a different `cursor-*` class via `className` (e.g. `cursor-default`,
|
|
370
|
-
* `cursor-wait`) to override the cursor. The row runs `onClick` only for a
|
|
371
|
-
* plain primary click. A modified click (`⌘`, `Ctrl`, `Shift`, `Alt`), a
|
|
372
|
-
* non-primary button, and a click that ends a text selection inside the row
|
|
373
|
-
* all skip it. The link inside the row answers a modified click with a new
|
|
374
|
-
* tab, and a selection copies text, so neither is a request to navigate.
|
|
375
|
-
*
|
|
376
|
-
* A `<tr>` is not focusable, so also render a `<Link>` inside the primary cell.
|
|
377
|
-
* The link is the keyboard and screen-reader path to the same destination, not
|
|
378
|
-
* a redundancy. The row keeps its structural `role="row"`: a `<tr onClick>`
|
|
379
|
-
* around a link is not nested interactive content, because the row has no
|
|
380
|
-
* widget role. Never add `tabIndex` or `role="button"` to the row, because a
|
|
381
|
-
* widget role that contains a focusable link is nested interactive content.
|
|
382
|
-
* Never reach for `role="grid"`, because it commits the table to roving focus
|
|
383
|
-
* and arrow-key navigation. Wrap the link in
|
|
384
|
-
* `<SandboxedOnClick asChild allowClickEventDefault>` so its click does not
|
|
385
|
-
* also run the row handler. `DataTable.ActionCell`, `DataTable.ControlCell`,
|
|
386
|
-
* and `DataTable.RowExpandButton` stop their own clicks. Put a selection
|
|
387
|
-
* checkbox in a `DataTable.ControlCell`.
|
|
388
|
-
*
|
|
389
|
-
* Pass `renderExpanded` to give the row an inline detail panel: when the row is
|
|
390
|
-
* expanded the row renders its data `<tr>` plus a sibling `DataTable.ExpandedRow`
|
|
391
|
-
* holding the returned content. Pair it with a `DataTable.RowExpandButton`
|
|
392
|
-
* toggle and register `rowExpandingFeature` and `getRowCanExpand` on the
|
|
393
|
-
* table.
|
|
394
|
-
*
|
|
395
|
-
* A sub-row (`row.depth > 0`) fades in when `DataTable.RowExpandButton`
|
|
396
|
-
* expands its parent and fades out when it collapses it, unless the user
|
|
397
|
-
* prefers reduced motion.
|
|
398
|
-
*
|
|
399
|
-
* The row subscribes to the whole table state and to the table options. It
|
|
400
|
-
* re-renders its cells when any state slice changes or when `useTable` receives
|
|
401
|
-
* new options, so a column's `cell` renderer can read state through `row` or
|
|
402
|
-
* `cell` (`row.getIsSelected()`) and close over your component's values.
|
|
403
|
-
*
|
|
404
|
-
* | Data Attribute | Value | Description |
|
|
405
|
-
* | ---------------- | ----------------------------- | ------------------------------------------------------- |
|
|
406
|
-
* | `data-clickable` | present when `onClick` is set | Presence-only. The row runs a handler on a plain click. |
|
|
407
|
-
* | `data-expanded` | present when expanded | Presence-only. The row's detail panel is open. |
|
|
408
|
-
*
|
|
409
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablerow
|
|
410
|
-
*
|
|
411
|
-
* @example
|
|
412
|
-
* Clickable row navigating to a detail page:
|
|
413
|
-
* ```tsx
|
|
414
|
-
* const navigate = useNavigate();
|
|
415
|
-
*
|
|
416
|
-
* {rows.map((row) => (
|
|
417
|
-
* <DataTable.Row
|
|
418
|
-
* key={row.id}
|
|
419
|
-
* row={row}
|
|
420
|
-
* onClick={() => navigate(href("/payments/:id", { id: row.original.id }))}
|
|
421
|
-
* />
|
|
422
|
-
* ))}
|
|
423
|
-
* ```
|
|
424
|
-
*
|
|
425
|
-
* @example
|
|
426
|
-
* Expandable row with an inline JSON detail panel (lazy: built only when open):
|
|
427
|
-
* ```tsx
|
|
428
|
-
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
429
|
-
*
|
|
430
|
-
* {rows.map((row) => (
|
|
431
|
-
* <DataTable.Row
|
|
432
|
-
* key={row.id}
|
|
433
|
-
* row={row}
|
|
434
|
-
* renderExpanded={(row) => (
|
|
435
|
-
* <CodeBlock.Root>
|
|
436
|
-
* <CodeBlock.Body>
|
|
437
|
-
* <CodeBlock.CopyButton />
|
|
438
|
-
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
439
|
-
* </CodeBlock.Body>
|
|
440
|
-
* </CodeBlock.Root>
|
|
441
|
-
* )}
|
|
442
|
-
* />
|
|
443
|
-
* ))}
|
|
444
|
-
* ```
|
|
445
|
-
*/
|
|
446
|
-
declare function Row<TFeatures extends TableFeatures, TData extends RowData>({ "data-slot": dataSlot, className, onClick, renderExpanded, row, ...props }: DataTableRowProps<TFeatures, TData>): import("react").JSX.Element;
|
|
447
|
-
type DataTableEmptyRowProps = ComponentProps<typeof Table$1.Row> & WithDataSlot;
|
|
448
|
-
/**
|
|
449
|
-
* An empty-state row that spans every column. Render this as the `else` branch
|
|
450
|
-
* when `rows.length === 0` to keep the table's frame intact instead of
|
|
451
|
-
* collapsing to an empty `<tbody>`. The cell `colSpan` is computed from the
|
|
452
|
-
* TanStack Table instance via context, so no manual column count is needed.
|
|
453
|
-
*
|
|
454
|
-
* Host an `Empty` for a real empty state, and branch on whether a filter is
|
|
455
|
-
* active so the user sees the right message (and a way out when filtered):
|
|
456
|
-
*
|
|
457
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableemptyrow
|
|
458
|
-
* @see https://mantle.ngrok.com/components/feedback/empty
|
|
459
|
-
*
|
|
460
|
-
* @example
|
|
461
|
-
* ```tsx
|
|
462
|
-
* import { DataTable } from "@ngrok/mantle/data-table";
|
|
463
|
-
* import { Empty } from "@ngrok/mantle/empty";
|
|
464
|
-
* import { Button } from "@ngrok/mantle/button";
|
|
465
|
-
* import { MagnifyingGlassIcon } from "@phosphor-icons/react/MagnifyingGlass";
|
|
466
|
-
* import { TrayIcon } from "@phosphor-icons/react/Tray";
|
|
467
|
-
*
|
|
468
|
-
* // `table` is your useTable instance; derive everything else from it.
|
|
469
|
-
* const rows = table.getRowModel().rows;
|
|
470
|
-
* const isFiltered = (table.state.globalFilter ?? "") !== "";
|
|
471
|
-
*
|
|
472
|
-
* // EmptyRow already spans every column and Empty.Root centers itself. Drop a
|
|
473
|
-
* // single Empty.Root in as the child; don't hand-roll a <td> or any centering.
|
|
474
|
-
* <DataTable.Body>
|
|
475
|
-
* {rows.length > 0 ? (
|
|
476
|
-
* rows.map((row) => <DataTable.Row key={row.id} row={row} />)
|
|
477
|
-
* ) : isFiltered ? (
|
|
478
|
-
* <DataTable.EmptyRow>
|
|
479
|
-
* <Empty.Root>
|
|
480
|
-
* <Empty.Icon svg={<MagnifyingGlassIcon />} />
|
|
481
|
-
* <Empty.Title>No results match your filter</Empty.Title>
|
|
482
|
-
* <Empty.Actions>
|
|
483
|
-
* <Button
|
|
484
|
-
* type="button"
|
|
485
|
-
* appearance="outlined"
|
|
486
|
-
* intent="neutral"
|
|
487
|
-
* onClick={() => table.setGlobalFilter("")}
|
|
488
|
-
* >
|
|
489
|
-
* Clear filters
|
|
490
|
-
* </Button>
|
|
491
|
-
* </Empty.Actions>
|
|
492
|
-
* </Empty.Root>
|
|
493
|
-
* </DataTable.EmptyRow>
|
|
494
|
-
* ) : (
|
|
495
|
-
* <DataTable.EmptyRow>
|
|
496
|
-
* <Empty.Root>
|
|
497
|
-
* <Empty.Icon svg={<TrayIcon />} />
|
|
498
|
-
* <Empty.Title>No endpoints yet</Empty.Title>
|
|
499
|
-
* </Empty.Root>
|
|
500
|
-
* </DataTable.EmptyRow>
|
|
501
|
-
* )}
|
|
502
|
-
* </DataTable.Body>
|
|
503
|
-
* ```
|
|
504
|
-
*/
|
|
505
|
-
declare function EmptyRow({ "data-slot": dataSlot, children, ...props }: DataTableEmptyRowProps): import("react").JSX.Element;
|
|
506
|
-
type DataTableActionCellProps = ComponentProps<typeof Table$1.Cell> & WithDataSlot;
|
|
507
|
-
/**
|
|
508
|
-
* A sticky-right `<td>` for per-row action buttons (typically an `IconButton`
|
|
509
|
-
* that opens a `DropdownMenu`). Pair with `DataTable.ActionHeader`.
|
|
510
|
-
*
|
|
511
|
-
* A click inside the cell never reaches a clickable row: the cell stops
|
|
512
|
-
* propagation and keeps the click's default action, so an action menu opens
|
|
513
|
-
* without the row navigating. Your own `onClick` still runs. The `<td>` keeps
|
|
514
|
-
* its `role="cell"`.
|
|
515
|
-
*
|
|
516
|
-
* **Structure.** `children` render inside a
|
|
517
|
-
* `<span data-slot="data-table-action-cell-label">`. The sticky-column indicator is a permanent element sibling,
|
|
518
|
-
* so without the span a bare text child is never a lone child: a browser
|
|
519
|
-
* translation engine reparents that text node, and the removal React runs when
|
|
520
|
-
* the content changes shape or goes away throws. The span is
|
|
521
|
-
* `display: contents`, so it adds no box and the cell's layout is unchanged.
|
|
522
|
-
*
|
|
523
|
-
* **Data attributes:**
|
|
524
|
-
*
|
|
525
|
-
* | Data Attribute | Value | Description |
|
|
526
|
-
* | --- | --- | --- |
|
|
527
|
-
* | `data-slot` | `"data-table-action-cell table-cell"` | On the cell element, joined ahead of `Table.Cell`'s own slot. |
|
|
528
|
-
* | `data-slot` | `"data-table-action-cell-label"` | On the `<span>` wrapping `children`. |
|
|
529
|
-
*
|
|
530
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableactioncell
|
|
531
|
-
*
|
|
532
|
-
* @example
|
|
533
|
-
* ```tsx
|
|
534
|
-
* columnHelper.display({
|
|
535
|
-
* id: "actions",
|
|
536
|
-
* header: () => <DataTable.ActionHeader />,
|
|
537
|
-
* cell: () => (
|
|
538
|
-
* <DataTable.ActionCell>
|
|
539
|
-
* <DropdownMenu.Root>...</DropdownMenu.Root>
|
|
540
|
-
* </DataTable.ActionCell>
|
|
541
|
-
* ),
|
|
542
|
-
* });
|
|
543
|
-
* ```
|
|
544
|
-
*/
|
|
545
|
-
declare function ActionCell({ "data-slot": dataSlot, children, className, onClick, ...props }: DataTableActionCellProps): import("react").JSX.Element;
|
|
546
|
-
type DataTableActionHeaderProps = ComponentProps<typeof Table$1.Header> & WithDataSlot;
|
|
547
|
-
/**
|
|
548
|
-
* A sticky header cell that pairs with `DataTable.ActionCell`. Use this as the
|
|
549
|
-
* header for the action column so the pinned column visually aligns across the
|
|
550
|
-
* header and every body row when the table scrolls horizontally. Renders a
|
|
551
|
-
* screen-reader-only "Actions" label by default, so the column has a name while
|
|
552
|
-
* it stays visually empty.
|
|
553
|
-
*
|
|
554
|
-
* **Structure.** `children` render inside a
|
|
555
|
-
* `<span data-slot="data-table-action-header-label">`. The indicator and the fallback `sr-only` label both sit beside `children`,
|
|
556
|
-
* so without the span a bare text child is never a lone child: a browser
|
|
557
|
-
* translation engine reparents that text node, and the removal React runs when
|
|
558
|
-
* the content changes shape or goes away throws. The span is
|
|
559
|
-
* `display: contents`, so it adds no box and the cell's layout is unchanged.
|
|
560
|
-
*
|
|
561
|
-
* **Data attributes:**
|
|
562
|
-
*
|
|
563
|
-
* | Data Attribute | Value | Description |
|
|
564
|
-
* | --- | --- | --- |
|
|
565
|
-
* | `data-slot` | `"data-table-action-header table-header"` | On the cell element, joined ahead of `Table.Header`'s own slot. |
|
|
566
|
-
* | `data-slot` | `"data-table-action-header-label"` | On the `<span>` wrapping `children`. |
|
|
567
|
-
*
|
|
568
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableactionheader
|
|
569
|
-
*
|
|
570
|
-
* @example
|
|
571
|
-
* ```tsx
|
|
572
|
-
* columnHelper.display({
|
|
573
|
-
* id: "actions",
|
|
574
|
-
* header: () => <DataTable.ActionHeader />,
|
|
575
|
-
* cell: () => <DataTable.ActionCell>{...}</DataTable.ActionCell>,
|
|
576
|
-
* })
|
|
577
|
-
* ```
|
|
578
|
-
*/
|
|
579
|
-
declare function ActionHeader({ "data-slot": dataSlot, children, className, ...props }: DataTableActionHeaderProps): import("react").JSX.Element;
|
|
580
|
-
type DataTableControlCellProps = ComponentProps<typeof Table$1.Cell> & WithDataSlot;
|
|
581
|
-
/**
|
|
582
|
-
* A `<td>` for a row's own control: a `DataTable.RowExpandButton` or a
|
|
583
|
-
* selection `Checkbox`. The whole cell is the control's pointer target, and a
|
|
584
|
-
* click anywhere in it never runs a clickable row's `onClick`.
|
|
585
|
-
*
|
|
586
|
-
* - A click on the cell's padding focuses and clicks the control, so a click
|
|
587
|
-
* that misses a small control still toggles it instead of navigating.
|
|
588
|
-
* - When the cell holds no enabled control (a leaf row's `RowExpandButton`
|
|
589
|
-
* renders nothing, or the checkbox is disabled), the click reaches the row
|
|
590
|
-
* as usual.
|
|
591
|
-
* - The cell shows a pointer cursor only while it holds an enabled control.
|
|
592
|
-
* An empty cell keeps the row's cursor.
|
|
593
|
-
* - The control aligns with the first line of text, so it stays beside a
|
|
594
|
-
* two-line primary cell. On a one-line row, it is centered.
|
|
595
|
-
*
|
|
596
|
-
* The padding click is a pointer convenience only. The cell keeps its
|
|
597
|
-
* `role="cell"` and gets no `tabIndex`, so keyboard and screen-reader users
|
|
598
|
-
* reach the control itself. Never add a role or `tabIndex` to the cell.
|
|
599
|
-
*
|
|
600
|
-
* Your own `onClick` runs first, once for each click. Call
|
|
601
|
-
* `event.preventDefault()` in it to stop the padding click from reaching the
|
|
602
|
-
* control.
|
|
603
|
-
*
|
|
604
|
-
* **Structure.** `children` render inside a
|
|
605
|
-
* `<span data-slot="data-table-control-cell-label">` that is one line of text
|
|
606
|
-
* tall and centers the control in it.
|
|
607
|
-
*
|
|
608
|
-
* **Data attributes:**
|
|
609
|
-
*
|
|
610
|
-
* | Data Attribute | Value | Description |
|
|
611
|
-
* | --- | --- | --- |
|
|
612
|
-
* | `data-slot` | `"data-table-control-cell table-cell"` | On the cell element, joined ahead of `Table.Cell`'s own slot. |
|
|
613
|
-
* | `data-slot` | `"data-table-control-cell-label"` | On the `<span>` wrapping `children`. |
|
|
614
|
-
*
|
|
615
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecontrolcell
|
|
616
|
-
*
|
|
617
|
-
* @example
|
|
618
|
-
* ```tsx
|
|
619
|
-
* columnHelper.display({
|
|
620
|
-
* id: "expander",
|
|
621
|
-
* header: () => <DataTable.ExpandHeader />,
|
|
622
|
-
* cell: (props) => (
|
|
623
|
-
* <DataTable.ControlCell>
|
|
624
|
-
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
625
|
-
* </DataTable.ControlCell>
|
|
626
|
-
* ),
|
|
627
|
-
* });
|
|
628
|
-
* ```
|
|
629
|
-
*/
|
|
630
|
-
declare function ControlCell({ "data-slot": dataSlot, children, className, onClick, ...props }: DataTableControlCellProps): import("react").JSX.Element;
|
|
631
10
|
/**
|
|
632
11
|
* Compute the stable DOM `id` for a row's expanded detail row. Shared by
|
|
633
12
|
* `DataTable.RowExpandButton` (as its `aria-controls` target) and
|
|
@@ -649,180 +28,13 @@ declare function ControlCell({ "data-slot": dataSlot, children, className, onCli
|
|
|
649
28
|
* // ...renders id={expandedRowId(row)}, the same value, so they stay associated.
|
|
650
29
|
* ```
|
|
651
30
|
*/
|
|
652
|
-
declare function expandedRowId<TFeatures extends TableFeatures, TData extends RowData>(row: Row
|
|
653
|
-
type DataTableExpandHeaderProps = Omit<ComponentProps<typeof Table$1.Header>, "children"> & {
|
|
654
|
-
/**
|
|
655
|
-
* Optional header content, e.g. an "expand all" toggle wired to
|
|
656
|
-
* `table.getToggleAllRowsExpandedHandler()`. Defaults to a screen-reader-only
|
|
657
|
-
* label so the column is announced while staying visually empty.
|
|
658
|
-
*/
|
|
659
|
-
children?: ReactNode;
|
|
660
|
-
} & WithDataSlot;
|
|
661
|
-
/**
|
|
662
|
-
* A narrow `<th>` for the leading expand-toggle column, mirroring
|
|
663
|
-
* `DataTable.ActionHeader`. Renders a screen-reader-only label by default so the
|
|
664
|
-
* column is announced to assistive tech while staying visually empty; pass
|
|
665
|
-
* `children` to render an "expand all" control instead.
|
|
666
|
-
*
|
|
667
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableexpandheader
|
|
668
|
-
*
|
|
669
|
-
* @example
|
|
670
|
-
* ```tsx
|
|
671
|
-
* columnHelper.display({
|
|
672
|
-
* id: "expander",
|
|
673
|
-
* header: () => <DataTable.ExpandHeader />,
|
|
674
|
-
* cell: (props) => (
|
|
675
|
-
* <DataTable.ControlCell>
|
|
676
|
-
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
677
|
-
* </DataTable.ControlCell>
|
|
678
|
-
* ),
|
|
679
|
-
* });
|
|
680
|
-
* ```
|
|
681
|
-
*/
|
|
682
|
-
declare function ExpandHeader({ "data-slot": dataSlot, children, className, ...props }: DataTableExpandHeaderProps): import("react").JSX.Element;
|
|
683
|
-
type DataTableRowExpandButtonProps<TFeatures extends ExpandableTableFeatures, TData extends RowData> = Omit<ComponentProps<typeof IconButton>, "appearance" | "aria-controls" | "aria-expanded" | "icon" | "intent" | "label"> & {
|
|
684
|
-
/**
|
|
685
|
-
* The visual style of the expand toggle. Optional: the row expand button's
|
|
686
|
-
* design is a ghost button, so the wrapper defaults it.
|
|
687
|
-
* @default "ghost"
|
|
688
|
-
*/
|
|
689
|
-
appearance?: IconButtonAppearance;
|
|
690
|
-
/**
|
|
691
|
-
* The tone of the expand toggle. Optional: the row expand button's design
|
|
692
|
-
* is neutral-toned, so the wrapper defaults it, and it is the only tone
|
|
693
|
-
* `IconButton` draws.
|
|
694
|
-
* @default "neutral"
|
|
695
|
-
*/
|
|
696
|
-
intent?: IconButtonIntent;
|
|
697
|
-
/**
|
|
698
|
-
* The TanStack Table row this button toggles. The table must register
|
|
699
|
-
* `rowExpandingFeature`, plus `getRowCanExpand: () => true` for custom detail
|
|
700
|
-
* panels, which have no sub-rows.
|
|
701
|
-
*/
|
|
702
|
-
row: ExpandableRow<TFeatures, TData>;
|
|
703
|
-
/**
|
|
704
|
-
* A human-readable name for the row, woven into the accessible label:
|
|
705
|
-
* `Show details for {label}` / `Hide details for {label}` for a detail panel,
|
|
706
|
-
* and `Expand {label}` / `Collapse {label}` for a row with sub-rows.
|
|
707
|
-
*/
|
|
708
|
-
label: string;
|
|
709
|
-
/**
|
|
710
|
-
* Icon shown while the row is collapsed (activating it expands the row).
|
|
711
|
-
* @default <PlusIcon weight="bold" />
|
|
712
|
-
*/
|
|
713
|
-
expandIcon?: ReactNode;
|
|
714
|
-
/**
|
|
715
|
-
* Icon shown while the row is expanded (activating it collapses the row).
|
|
716
|
-
* @default <MinusIcon weight="bold" />
|
|
717
|
-
*/
|
|
718
|
-
collapseIcon?: ReactNode;
|
|
719
|
-
} & WithDataSlot;
|
|
720
|
-
/**
|
|
721
|
-
* An accessible +/- toggle that expands or collapses a row's detail panel or
|
|
722
|
-
* its sub-rows. Drop it inside a `DataTable.ControlCell` in a leading
|
|
723
|
-
* `columnHelper.display` column. For a detail panel, pair it with
|
|
724
|
-
* `DataTable.ExpandedRow`. For sub-rows (`getSubRows` on `useTable`), the
|
|
725
|
-
* expanded row model puts each child in `table.getRowModel().rows` after its
|
|
726
|
-
* parent, so `DataTable.Row` renders it.
|
|
727
|
-
*
|
|
728
|
-
* Renders a real `<button>` (keyboard operable) that sets `aria-expanded` and,
|
|
729
|
-
* while a detail panel is open, `aria-controls` pointing at the
|
|
730
|
-
* `DataTable.ExpandedRow`. A row with sub-rows has no panel, so it gets no
|
|
731
|
-
* `aria-controls`. It stops click propagation so it never triggers a row-level
|
|
732
|
-
* `onClick` (e.g. row navigation), and renders nothing when
|
|
733
|
-
* `row.getCanExpand()` is false so a `getRowCanExpand` predicate cleanly hides
|
|
734
|
-
* it. Forwards `IconButton` props, so pass `onClick` to run side effects before
|
|
735
|
-
* the toggle (call `event.preventDefault()` to veto it).
|
|
736
|
-
*
|
|
737
|
-
* The table must register `rowExpandingFeature`; the `row` prop's type rejects a row
|
|
738
|
-
* from a table without it. Add `expandedRowModel: createExpandedRowModel()` when rows
|
|
739
|
-
* have sub-rows; a detail panel expands without it.
|
|
740
|
-
*
|
|
741
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablerowexpandbutton
|
|
742
|
-
*
|
|
743
|
-
* @example
|
|
744
|
-
* ```tsx
|
|
745
|
-
* const features = tableFeatures({
|
|
746
|
-
* rowExpandingFeature,
|
|
747
|
-
* expandedRowModel: createExpandedRowModel(),
|
|
748
|
-
* });
|
|
749
|
-
* const columnHelper = createColumnHelper<typeof features, Row>();
|
|
750
|
-
*
|
|
751
|
-
* columnHelper.display({
|
|
752
|
-
* id: "expander",
|
|
753
|
-
* header: () => <DataTable.ExpandHeader />,
|
|
754
|
-
* cell: (props) => (
|
|
755
|
-
* <DataTable.ControlCell>
|
|
756
|
-
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
757
|
-
* </DataTable.ControlCell>
|
|
758
|
-
* ),
|
|
759
|
-
* });
|
|
760
|
-
* ```
|
|
761
|
-
*/
|
|
762
|
-
declare function RowExpandButton<TFeatures extends ExpandableTableFeatures, TData extends RowData>({ "data-slot": dataSlot, appearance, className, collapseIcon, expandIcon, intent, label, onClick, row, size, ...props }: DataTableRowExpandButtonProps<TFeatures, TData>): import("react").JSX.Element;
|
|
763
|
-
type DataTableExpandedRowProps<TFeatures extends TableFeatures, TData extends RowData> = Omit<ComponentProps<typeof Table$1.Row>, "children"> & {
|
|
764
|
-
/** The row whose detail panel this displays. */
|
|
765
|
-
row: Row$1<TFeatures, TData>;
|
|
766
|
-
/**
|
|
767
|
-
* Override the cell's `colSpan`. Defaults to the row's visible-cell count so
|
|
768
|
-
* the panel spans every visible column (visibility- and pinning-aware).
|
|
769
|
-
*/
|
|
770
|
-
colSpan?: number;
|
|
771
|
-
/** The detail content rendered inside the full-width panel. */
|
|
772
|
-
children: ReactNode;
|
|
773
|
-
} & WithDataSlot;
|
|
774
|
-
/**
|
|
775
|
-
* The sibling `<tr>` that renders a row's expanded detail panel. For the common
|
|
776
|
-
* case, prefer `DataTable.Row`'s `renderExpanded` prop, which renders this for
|
|
777
|
-
* you. Reach for `ExpandedRow` directly when you need full control: a custom
|
|
778
|
-
* `colSpan`, multiple panels, or bespoke markup. Render it directly after the
|
|
779
|
-
* parent `DataTable.Row`, wrapped in a `Fragment` and never a DOM element (a node
|
|
780
|
-
* between `<tbody>` and `<tr>` is invalid HTML). Render it only when
|
|
781
|
-
* `row.getIsExpanded()` is true.
|
|
782
|
-
*
|
|
783
|
-
* The single cell spans every visible column (override with `colSpan`), carries
|
|
784
|
-
* the `id` that `DataTable.RowExpandButton` targets via `aria-controls`, and
|
|
785
|
-
* sits on an opaque card surface so horizontally-scrolled content never shows
|
|
786
|
-
* through a sticky action column. Its top divider is suppressed so it reads as
|
|
787
|
-
* one block with its parent row; the panel itself does not change on hover (only
|
|
788
|
-
* the parent data row reacts to hover). It fades in on mount and fades out
|
|
789
|
-
* when `DataTable.RowExpandButton` collapses its row, unless the user prefers
|
|
790
|
-
* reduced motion. Exposes `data-expanded-content` for styling hooks.
|
|
791
|
-
*
|
|
792
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableexpandedrow
|
|
793
|
-
*
|
|
794
|
-
* @example
|
|
795
|
-
* Render the row's underlying object as JSON (a common detail-panel use case).
|
|
796
|
-
* `jsonCodeBlockValue` highlights the JSON entirely on the client (no Shiki
|
|
797
|
-
* runtime, no build-time plugin, no server roundtrip), so it works for runtime
|
|
798
|
-
* data and matches server/build-time highlighting:
|
|
799
|
-
* ```tsx
|
|
800
|
-
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
801
|
-
* import { Fragment } from "react";
|
|
802
|
-
*
|
|
803
|
-
* {table.getRowModel().rows.map((row) => (
|
|
804
|
-
* <Fragment key={row.id}>
|
|
805
|
-
* <DataTable.Row row={row} />
|
|
806
|
-
* {row.getIsExpanded() && (
|
|
807
|
-
* <DataTable.ExpandedRow row={row}>
|
|
808
|
-
* <CodeBlock.Root>
|
|
809
|
-
* <CodeBlock.Body>
|
|
810
|
-
* <CodeBlock.CopyButton />
|
|
811
|
-
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
812
|
-
* </CodeBlock.Body>
|
|
813
|
-
* </CodeBlock.Root>
|
|
814
|
-
* </DataTable.ExpandedRow>
|
|
815
|
-
* )}
|
|
816
|
-
* </Fragment>
|
|
817
|
-
* ))}
|
|
818
|
-
* ```
|
|
819
|
-
*/
|
|
820
|
-
declare function ExpandedRow<TFeatures extends TableFeatures, TData extends RowData>({ "data-slot": dataSlot, children, className, colSpan, row, ...props }: DataTableExpandedRowProps<TFeatures, TData>): import("react").JSX.Element;
|
|
31
|
+
declare function expandedRowId<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): string;
|
|
821
32
|
/**
|
|
822
33
|
* Use `DataTable` for INTERACTIVE tabular data: sorting, filtering, pagination,
|
|
823
|
-
* row selection,
|
|
824
|
-
* the consumer MUST construct a
|
|
825
|
-
* `@tanstack/react-table` and pass it to
|
|
34
|
+
* row selection, expandable rows (a detail panel or sub-rows), and server-side
|
|
35
|
+
* or client-side data. Built on TanStack Table; the consumer MUST construct a
|
|
36
|
+
* `useTable` instance from `@tanstack/react-table` and pass it to
|
|
37
|
+
* `DataTable.Root` via the `table` prop.
|
|
826
38
|
* Every TanStack export (`useTable`, `tableFeatures`, `createColumnHelper`, the
|
|
827
39
|
* `*Feature` objects, the `create*RowModel` factories, the `sortFn_*` and `filterFn_*` comparators,
|
|
828
40
|
* …) is re-exported from `@ngrok/mantle/data-table` so a single import covers
|
|
@@ -843,10 +55,11 @@ declare function ExpandedRow<TFeatures extends TableFeatures, TData extends RowD
|
|
|
843
55
|
* - Paginate before you virtualize. A page of 100 rows mounts fast, and the
|
|
844
56
|
* browser's find in page still sees every row on it.
|
|
845
57
|
*
|
|
846
|
-
* @useWhen Show rows of application data that the user sorts, filters, pages through, or
|
|
58
|
+
* @useWhen Show rows of application data that the user sorts, filters, pages through, selects, or
|
|
59
|
+
* expands with a row button into a detail panel or sub-rows.
|
|
847
60
|
*
|
|
848
61
|
* @siblings
|
|
849
|
-
* - `Table`: the data is static, with no sorting, filtering, pagination, or
|
|
62
|
+
* - `Table`: the data is static, with no sorting, filtering, pagination, selection, or row expansion.
|
|
850
63
|
* - `DescriptionList`: one record shows as label and value pairs.
|
|
851
64
|
*
|
|
852
65
|
* @see https://mantle.ngrok.com/components/data-display/data-table
|
|
@@ -1204,414 +417,5 @@ declare function ExpandedRow<TFeatures extends TableFeatures, TData extends RowD
|
|
|
1204
417
|
* });
|
|
1205
418
|
* ```
|
|
1206
419
|
*/
|
|
1207
|
-
declare const DataTable:
|
|
1208
|
-
/**
|
|
1209
|
-
* The root container of the data table component. REQUIRED: pass a
|
|
1210
|
-
* `useTable` instance (from `@tanstack/react-table`, also re-exported
|
|
1211
|
-
* from `@ngrok/mantle/data-table`) via the `table` prop. Every other
|
|
1212
|
-
* `DataTable.*` part reads from it through context.
|
|
1213
|
-
*
|
|
1214
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableroot
|
|
1215
|
-
*
|
|
1216
|
-
* @example
|
|
1217
|
-
* ```tsx
|
|
1218
|
-
* const table = useTable({ features, data, columns });
|
|
1219
|
-
* const rows = table.getRowModel().rows;
|
|
1220
|
-
*
|
|
1221
|
-
* <DataTable.Root table={table}>
|
|
1222
|
-
* <DataTable.Head />
|
|
1223
|
-
* <DataTable.Body>
|
|
1224
|
-
* {rows.length > 0
|
|
1225
|
-
* ? rows.map((row) => <DataTable.Row key={row.id} row={row} />)
|
|
1226
|
-
* : <DataTable.EmptyRow>No results.</DataTable.EmptyRow>}
|
|
1227
|
-
* </DataTable.Body>
|
|
1228
|
-
* </DataTable.Root>
|
|
1229
|
-
* ```
|
|
1230
|
-
*/
|
|
1231
|
-
readonly Root: typeof Root;
|
|
1232
|
-
/**
|
|
1233
|
-
* A sticky action cell positioned at the end of each row, typically holding
|
|
1234
|
-
* an `IconButton` that opens a `DropdownMenu`. Pair with `DataTable.ActionHeader`.
|
|
1235
|
-
*
|
|
1236
|
-
* A click inside the cell never reaches a clickable row: the cell stops
|
|
1237
|
-
* propagation and keeps the click's default action, so an action menu opens
|
|
1238
|
-
* without the row navigating.
|
|
1239
|
-
*
|
|
1240
|
-
* **Structure.** `children` render inside a
|
|
1241
|
-
* `<span data-slot="data-table-action-cell-label">`. The sticky-column indicator is a permanent element sibling,
|
|
1242
|
-
* so without the span a bare text child is never a lone child: a browser
|
|
1243
|
-
* translation engine reparents that text node, and the removal React runs when
|
|
1244
|
-
* the content changes shape or goes away throws. The span is
|
|
1245
|
-
* `display: contents`, so it adds no box and the cell's layout is unchanged.
|
|
1246
|
-
*
|
|
1247
|
-
* **Data attributes:**
|
|
1248
|
-
*
|
|
1249
|
-
* | Data Attribute | Value | Description |
|
|
1250
|
-
* | --- | --- | --- |
|
|
1251
|
-
* | `data-slot` | `"data-table-action-cell table-cell"` | On the cell element, joined ahead of `Table.Cell`'s own slot. |
|
|
1252
|
-
* | `data-slot` | `"data-table-action-cell-label"` | On the `<span>` wrapping `children`. |
|
|
1253
|
-
*
|
|
1254
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableactioncell
|
|
1255
|
-
*
|
|
1256
|
-
* @example
|
|
1257
|
-
* ```tsx
|
|
1258
|
-
* columnHelper.display({
|
|
1259
|
-
* id: "actions",
|
|
1260
|
-
* header: () => <DataTable.ActionHeader />,
|
|
1261
|
-
* cell: () => (
|
|
1262
|
-
* <DataTable.ActionCell>
|
|
1263
|
-
* <DropdownMenu.Root>...</DropdownMenu.Root>
|
|
1264
|
-
* </DataTable.ActionCell>
|
|
1265
|
-
* ),
|
|
1266
|
-
* });
|
|
1267
|
-
* ```
|
|
1268
|
-
*/
|
|
1269
|
-
readonly ActionCell: typeof ActionCell;
|
|
1270
|
-
/**
|
|
1271
|
-
* A sticky header cell that pairs with `DataTable.ActionCell`. Use this as the
|
|
1272
|
-
* header for the action column so the pinned column visually aligns across the
|
|
1273
|
-
* header and every body row when the table scrolls horizontally. Renders a
|
|
1274
|
-
* screen-reader-only "Actions" label by default, so the column has a name while
|
|
1275
|
-
* it stays visually empty.
|
|
1276
|
-
*
|
|
1277
|
-
* **Structure.** `children` render inside a
|
|
1278
|
-
* `<span data-slot="data-table-action-header-label">`. The indicator and the fallback `sr-only` label both sit beside `children`,
|
|
1279
|
-
* so without the span a bare text child is never a lone child: a browser
|
|
1280
|
-
* translation engine reparents that text node, and the removal React runs when
|
|
1281
|
-
* the content changes shape or goes away throws. The span is
|
|
1282
|
-
* `display: contents`, so it adds no box and the cell's layout is unchanged.
|
|
1283
|
-
*
|
|
1284
|
-
* **Data attributes:**
|
|
1285
|
-
*
|
|
1286
|
-
* | Data Attribute | Value | Description |
|
|
1287
|
-
* | --- | --- | --- |
|
|
1288
|
-
* | `data-slot` | `"data-table-action-header table-header"` | On the cell element, joined ahead of `Table.Header`'s own slot. |
|
|
1289
|
-
* | `data-slot` | `"data-table-action-header-label"` | On the `<span>` wrapping `children`. |
|
|
1290
|
-
*
|
|
1291
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableactionheader
|
|
1292
|
-
*
|
|
1293
|
-
* @example
|
|
1294
|
-
* ```tsx
|
|
1295
|
-
* columnHelper.display({
|
|
1296
|
-
* id: "actions",
|
|
1297
|
-
* header: () => <DataTable.ActionHeader />,
|
|
1298
|
-
* cell: () => (
|
|
1299
|
-
* <DataTable.ActionCell>
|
|
1300
|
-
* <DropdownMenu.Root>...</DropdownMenu.Root>
|
|
1301
|
-
* </DataTable.ActionCell>
|
|
1302
|
-
* ),
|
|
1303
|
-
* });
|
|
1304
|
-
* ```
|
|
1305
|
-
*/
|
|
1306
|
-
readonly ActionHeader: typeof ActionHeader;
|
|
1307
|
-
/**
|
|
1308
|
-
* A `<td>` for one data cell. Wrap the output of each column's `cell`
|
|
1309
|
-
* function in this; a raw `<td>` skips mantle typography and padding. Pass
|
|
1310
|
-
* `column` to apply the column's `meta.width`, and pass the same `column` to
|
|
1311
|
-
* the column's `DataTable.Header`, so the header and every cell agree.
|
|
1312
|
-
*
|
|
1313
|
-
* **Data attributes:**
|
|
1314
|
-
*
|
|
1315
|
-
* | Data Attribute | Value | Description |
|
|
1316
|
-
* | --- | --- | --- |
|
|
1317
|
-
* | `data-slot` | `"data-table-cell table-cell"` | On the `<td>`, joined ahead of `Table.Cell`'s own slot. |
|
|
1318
|
-
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The cell does not wrap its content, and the column shrinks to fit it. |
|
|
1319
|
-
*
|
|
1320
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecell
|
|
1321
|
-
*
|
|
1322
|
-
* @example
|
|
1323
|
-
* ```tsx
|
|
1324
|
-
* columnHelper.accessor("createdAt", {
|
|
1325
|
-
* id: "createdAt",
|
|
1326
|
-
* meta: { width: "fit" },
|
|
1327
|
-
* header: (props) => <DataTable.Header column={props.column}>Created</DataTable.Header>,
|
|
1328
|
-
* cell: (props) => <DataTable.Cell column={props.column}>{props.getValue()}</DataTable.Cell>,
|
|
1329
|
-
* });
|
|
1330
|
-
* ```
|
|
1331
|
-
*/
|
|
1332
|
-
readonly Cell: typeof Cell;
|
|
1333
|
-
/**
|
|
1334
|
-
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
1335
|
-
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is
|
|
1336
|
-
* no data.
|
|
1337
|
-
*
|
|
1338
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablebody
|
|
1339
|
-
*
|
|
1340
|
-
* @example
|
|
1341
|
-
* ```tsx
|
|
1342
|
-
* <DataTable.Body>
|
|
1343
|
-
* {rows.length > 0
|
|
1344
|
-
* ? rows.map((row) => <DataTable.Row key={row.id} row={row} />)
|
|
1345
|
-
* : <DataTable.EmptyRow>No results.</DataTable.EmptyRow>}
|
|
1346
|
-
* </DataTable.Body>
|
|
1347
|
-
* ```
|
|
1348
|
-
*/
|
|
1349
|
-
readonly Body: typeof Body;
|
|
1350
|
-
/**
|
|
1351
|
-
* An empty-state row that spans every column. Render this as the `else`
|
|
1352
|
-
* branch when `rows.length === 0` to keep the table's frame intact instead
|
|
1353
|
-
* of collapsing to an empty `<tbody>`.
|
|
1354
|
-
*
|
|
1355
|
-
* Drop an `Empty` in as the child for a real empty state: `EmptyRow` spans
|
|
1356
|
-
* every column and `Empty.Root` centers itself, so no `<td>` or centering
|
|
1357
|
-
* markup is needed.
|
|
1358
|
-
*
|
|
1359
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableemptyrow
|
|
1360
|
-
* @see https://mantle.ngrok.com/components/feedback/empty
|
|
1361
|
-
*
|
|
1362
|
-
* @example
|
|
1363
|
-
* ```tsx
|
|
1364
|
-
* import { DataTable } from "@ngrok/mantle/data-table";
|
|
1365
|
-
* import { Empty } from "@ngrok/mantle/empty";
|
|
1366
|
-
* import { TrayIcon } from "@phosphor-icons/react/Tray";
|
|
1367
|
-
*
|
|
1368
|
-
* <DataTable.EmptyRow>
|
|
1369
|
-
* <Empty.Root>
|
|
1370
|
-
* <Empty.Icon svg={<TrayIcon />} />
|
|
1371
|
-
* <Empty.Title>No endpoints yet</Empty.Title>
|
|
1372
|
-
* </Empty.Root>
|
|
1373
|
-
* </DataTable.EmptyRow>
|
|
1374
|
-
* ```
|
|
1375
|
-
*/
|
|
1376
|
-
readonly EmptyRow: typeof EmptyRow;
|
|
1377
|
-
/**
|
|
1378
|
-
* The `<thead>` container that renders column headers automatically from
|
|
1379
|
-
* `table.getHeaderGroups()`. Does not accept children: the headers come from
|
|
1380
|
-
* each column's `header` definition.
|
|
1381
|
-
*
|
|
1382
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablehead
|
|
1383
|
-
*
|
|
1384
|
-
* @example
|
|
1385
|
-
* ```tsx
|
|
1386
|
-
* <DataTable.Root table={table}>
|
|
1387
|
-
* <DataTable.Head />
|
|
1388
|
-
* <DataTable.Body>...</DataTable.Body>
|
|
1389
|
-
* </DataTable.Root>
|
|
1390
|
-
* ```
|
|
1391
|
-
*/
|
|
1392
|
-
readonly Head: typeof Head;
|
|
1393
|
-
/**
|
|
1394
|
-
* A `<th>` optimized for header actions. Wrap each column's header content in
|
|
1395
|
-
* this; for sortable columns, nest a `DataTable.HeaderSortButton` inside and
|
|
1396
|
-
* pass the same `column` here, so the cell carries `aria-sort` while the column
|
|
1397
|
-
* is sorted. Non-sortable columns can render plain text. The `column` prop
|
|
1398
|
-
* also applies the column's `meta.width`.
|
|
1399
|
-
*
|
|
1400
|
-
* **Data attributes:**
|
|
1401
|
-
*
|
|
1402
|
-
* | Data Attribute | Value | Description |
|
|
1403
|
-
* | --- | --- | --- |
|
|
1404
|
-
* | `data-slot` | `"data-table-header table-header"` | On the `<th>`, joined ahead of `Table.Header`'s own slot. |
|
|
1405
|
-
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The header does not wrap its content, and the column shrinks to fit it. |
|
|
1406
|
-
*
|
|
1407
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableheader
|
|
1408
|
-
*
|
|
1409
|
-
* @example
|
|
1410
|
-
* ```tsx
|
|
1411
|
-
* columnHelper.accessor("name", {
|
|
1412
|
-
* id: "name",
|
|
1413
|
-
* header: (props) => (
|
|
1414
|
-
* <DataTable.Header column={props.column}>
|
|
1415
|
-
* <DataTable.HeaderSortButton column={props.column} sortingMode="alphanumeric">
|
|
1416
|
-
* Name
|
|
1417
|
-
* </DataTable.HeaderSortButton>
|
|
1418
|
-
* </DataTable.Header>
|
|
1419
|
-
* ),
|
|
1420
|
-
* cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,
|
|
1421
|
-
* });
|
|
1422
|
-
* ```
|
|
1423
|
-
*/
|
|
1424
|
-
readonly Header: typeof Header;
|
|
1425
|
-
/**
|
|
1426
|
-
* A sortable button toggle for a column header in a data table. Renders a sort
|
|
1427
|
-
* icon that reflects the current direction and cycles through sort states on
|
|
1428
|
-
* click. The button's accessible name is the column label and does not change
|
|
1429
|
-
* with the sort state; pass `column` to the surrounding `DataTable.Header` so
|
|
1430
|
-
* the header cell exposes the state through `aria-sort`.
|
|
1431
|
-
*
|
|
1432
|
-
* Each click cycles through:
|
|
1433
|
-
* - For `"alphanumeric"` sorting: `unsorted → ascending → descending → unsorted`
|
|
1434
|
-
* - For `"time"` sorting: `unsorted → newest-first → oldest-first → unsorted`
|
|
1435
|
-
*
|
|
1436
|
-
* The table must register `rowSortingFeature`; the `column` prop's type rejects a
|
|
1437
|
-
* column from a table without it. Pair it with `sortedRowModel: createSortedRowModel()`,
|
|
1438
|
-
* or the button toggles the icon and never reorders a row. Register a `sortFns` slot
|
|
1439
|
-
* too: without one, auto-sort falls back to `sortFn_basic`.
|
|
1440
|
-
*
|
|
1441
|
-
* When the column cannot sort (`disableSorting`, or `enableSorting: false` on
|
|
1442
|
-
* the column), the part renders the label as plain text: no button, no icon.
|
|
1443
|
-
*
|
|
1444
|
-
* For right-aligned numeric columns, pass `className="justify-end"` and
|
|
1445
|
-
* `iconPlacement="start"` so the sort icon stays paired with the label.
|
|
1446
|
-
*
|
|
1447
|
-
* | Data Attribute | Value | Description |
|
|
1448
|
-
* | -------------------------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
1449
|
-
* | `data-sort-direction` | `"asc"`, `"desc"`, or `"unsorted"` | The column's current sort direction. Always `"unsorted"` on the plain-text span. |
|
|
1450
|
-
* | `data-table-header-action` | present on the button | Presence-only. `DataTable.Header` drops its horizontal padding when a descendant carries it. Absent on the plain-text span. |
|
|
1451
|
-
*
|
|
1452
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableheadersortbutton
|
|
1453
|
-
*
|
|
1454
|
-
* @example
|
|
1455
|
-
* ```tsx
|
|
1456
|
-
* const features = tableFeatures({
|
|
1457
|
-
* rowSortingFeature,
|
|
1458
|
-
* sortedRowModel: createSortedRowModel(),
|
|
1459
|
-
* sortFns: {
|
|
1460
|
-
* alphanumeric: sortFn_alphanumeric,
|
|
1461
|
-
* datetime: sortFn_datetime,
|
|
1462
|
-
* text: sortFn_text,
|
|
1463
|
-
* },
|
|
1464
|
-
* });
|
|
1465
|
-
* const columnHelper = createColumnHelper<typeof features, Row>();
|
|
1466
|
-
*
|
|
1467
|
-
* columnHelper.accessor("email", {
|
|
1468
|
-
* id: "email",
|
|
1469
|
-
* header: (props) => (
|
|
1470
|
-
* <DataTable.Header column={props.column}>
|
|
1471
|
-
* <DataTable.HeaderSortButton column={props.column} sortingMode="alphanumeric">
|
|
1472
|
-
* Email
|
|
1473
|
-
* </DataTable.HeaderSortButton>
|
|
1474
|
-
* </DataTable.Header>
|
|
1475
|
-
* ),
|
|
1476
|
-
* cell: (props) => <DataTable.Cell>{props.getValue()}</DataTable.Cell>,
|
|
1477
|
-
* });
|
|
1478
|
-
* ```
|
|
1479
|
-
*/
|
|
1480
|
-
readonly HeaderSortButton: typeof HeaderSortButton;
|
|
1481
|
-
/**
|
|
1482
|
-
* A single data table body row rendered from a TanStack Table row instance.
|
|
1483
|
-
* Does not accept children: cells come from each column's `cell` definition.
|
|
1484
|
-
*
|
|
1485
|
-
* When `onClick` is set, the row receives `cursor-pointer` and `data-clickable`.
|
|
1486
|
-
* It runs the handler only for a plain primary click: a modified click, a
|
|
1487
|
-
* non-primary button, and a click that ends a text selection in the row skip
|
|
1488
|
-
* it. Pass a different `cursor-*` class via `className` to override the
|
|
1489
|
-
* cursor. A `<tr>` is not focusable, so also render a `<Link>` inside the
|
|
1490
|
-
* primary cell as the keyboard and screen-reader path.
|
|
1491
|
-
*
|
|
1492
|
-
* Pass `renderExpanded` to give the row an inline detail panel: the row then
|
|
1493
|
-
* renders a sibling `DataTable.ExpandedRow` (only while expanded) holding the
|
|
1494
|
-
* returned content. Pair with `DataTable.RowExpandButton`.
|
|
1495
|
-
*
|
|
1496
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablerow
|
|
1497
|
-
*
|
|
1498
|
-
* @example
|
|
1499
|
-
* ```tsx
|
|
1500
|
-
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
1501
|
-
*
|
|
1502
|
-
* {rows.map((row) => (
|
|
1503
|
-
* <DataTable.Row
|
|
1504
|
-
* key={row.id}
|
|
1505
|
-
* row={row}
|
|
1506
|
-
* renderExpanded={(row) => (
|
|
1507
|
-
* <CodeBlock.Root>
|
|
1508
|
-
* <CodeBlock.Body>
|
|
1509
|
-
* <CodeBlock.CopyButton />
|
|
1510
|
-
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
1511
|
-
* </CodeBlock.Body>
|
|
1512
|
-
* </CodeBlock.Root>
|
|
1513
|
-
* )}
|
|
1514
|
-
* />
|
|
1515
|
-
* ))}
|
|
1516
|
-
* ```
|
|
1517
|
-
*/
|
|
1518
|
-
readonly Row: typeof Row;
|
|
1519
|
-
/**
|
|
1520
|
-
* A narrow `<th>` for the leading expand-toggle column, mirroring
|
|
1521
|
-
* `DataTable.ActionHeader`. Renders a screen-reader-only label by default so
|
|
1522
|
-
* the column is announced while staying visually empty.
|
|
1523
|
-
*
|
|
1524
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableexpandheader
|
|
1525
|
-
*
|
|
1526
|
-
* @example
|
|
1527
|
-
* ```tsx
|
|
1528
|
-
* columnHelper.display({
|
|
1529
|
-
* id: "expander",
|
|
1530
|
-
* header: () => <DataTable.ExpandHeader />,
|
|
1531
|
-
* cell: (props) => (
|
|
1532
|
-
* <DataTable.ControlCell>
|
|
1533
|
-
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1534
|
-
* </DataTable.ControlCell>
|
|
1535
|
-
* ),
|
|
1536
|
-
* });
|
|
1537
|
-
* ```
|
|
1538
|
-
*/
|
|
1539
|
-
readonly ExpandHeader: typeof ExpandHeader;
|
|
1540
|
-
/**
|
|
1541
|
-
* A `<td>` for a row's own control: a `DataTable.RowExpandButton` or a
|
|
1542
|
-
* selection `Checkbox`. A click on its padding focuses and clicks the
|
|
1543
|
-
* control, a click anywhere in it never runs a clickable row's `onClick`,
|
|
1544
|
-
* and the control aligns with the first line of text. The cell keeps its
|
|
1545
|
-
* `role="cell"`; keyboard users reach the control itself.
|
|
1546
|
-
*
|
|
1547
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecontrolcell
|
|
1548
|
-
*
|
|
1549
|
-
* @example
|
|
1550
|
-
* ```tsx
|
|
1551
|
-
* columnHelper.display({
|
|
1552
|
-
* id: "expander",
|
|
1553
|
-
* header: () => <DataTable.ExpandHeader />,
|
|
1554
|
-
* cell: (props) => (
|
|
1555
|
-
* <DataTable.ControlCell>
|
|
1556
|
-
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1557
|
-
* </DataTable.ControlCell>
|
|
1558
|
-
* ),
|
|
1559
|
-
* });
|
|
1560
|
-
* ```
|
|
1561
|
-
*/
|
|
1562
|
-
readonly ControlCell: typeof ControlCell;
|
|
1563
|
-
/**
|
|
1564
|
-
* An accessible +/- toggle that expands or collapses a row's detail panel or
|
|
1565
|
-
* its sub-rows. Place it inside a `DataTable.ControlCell` in a leading
|
|
1566
|
-
* `columnHelper.display` column. Sets `aria-expanded`, and `aria-controls`
|
|
1567
|
-
* while a detail panel is open. A row with only sub-rows has no panel, so it
|
|
1568
|
-
* gets no `aria-controls`. Stops click propagation so it never fires a
|
|
1569
|
-
* row-level `onClick`, and renders nothing when `row.getCanExpand()` is
|
|
1570
|
-
* false. The table must register `rowExpandingFeature`; the `row` prop's
|
|
1571
|
-
* type rejects a row from a table without it.
|
|
1572
|
-
*
|
|
1573
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablerowexpandbutton
|
|
1574
|
-
*
|
|
1575
|
-
* @example
|
|
1576
|
-
* ```tsx
|
|
1577
|
-
* <DataTable.ControlCell>
|
|
1578
|
-
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1579
|
-
* </DataTable.ControlCell>
|
|
1580
|
-
* ```
|
|
1581
|
-
*/
|
|
1582
|
-
readonly RowExpandButton: typeof RowExpandButton;
|
|
1583
|
-
/**
|
|
1584
|
-
* The sibling `<tr>` that renders a row's expanded detail panel. Render it
|
|
1585
|
-
* directly after the parent `DataTable.Row` (wrapped in a `Fragment`, never a
|
|
1586
|
-
* DOM element) and only when `row.getIsExpanded()` is true. Spans every
|
|
1587
|
-
* visible column, carries the `id` that `DataTable.RowExpandButton` targets,
|
|
1588
|
-
* and sits on an opaque card surface so it coexists with a sticky action
|
|
1589
|
-
* column.
|
|
1590
|
-
*
|
|
1591
|
-
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableexpandedrow
|
|
1592
|
-
*
|
|
1593
|
-
* @example
|
|
1594
|
-
* ```tsx
|
|
1595
|
-
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
1596
|
-
* import { Fragment } from "react";
|
|
1597
|
-
*
|
|
1598
|
-
* {table.getRowModel().rows.map((row) => (
|
|
1599
|
-
* <Fragment key={row.id}>
|
|
1600
|
-
* <DataTable.Row row={row} />
|
|
1601
|
-
* {row.getIsExpanded() && (
|
|
1602
|
-
* <DataTable.ExpandedRow row={row}>
|
|
1603
|
-
* <CodeBlock.Root>
|
|
1604
|
-
* <CodeBlock.Body>
|
|
1605
|
-
* <CodeBlock.CopyButton />
|
|
1606
|
-
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
1607
|
-
* </CodeBlock.Body>
|
|
1608
|
-
* </CodeBlock.Root>
|
|
1609
|
-
* </DataTable.ExpandedRow>
|
|
1610
|
-
* )}
|
|
1611
|
-
* </Fragment>
|
|
1612
|
-
* ))}
|
|
1613
|
-
* ```
|
|
1614
|
-
*/
|
|
1615
|
-
readonly ExpandedRow: typeof ExpandedRow;
|
|
1616
|
-
};
|
|
420
|
+
declare const DataTable: typeof DataTableParts;
|
|
1617
421
|
export { DataTable, type DataTableColumnMeta, expandedRowId };
|