@persona/design-system 0.3.0 → 0.3.1
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/CHANGELOG.md +9 -0
- package/README.md +3 -3
- package/dist/{Action-CnNf5T-l.d.mts → Action-DL3kHI9Z.d.mts} +3 -3
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +3 -3
- package/dist/AdvancedFilterRulesPopover.d.mts +3 -3
- package/dist/ArrayValueControl.d.mts +1 -1
- package/dist/Attribute.d.mts +5 -5
- package/dist/AttributeGrid.d.mts +1 -1
- package/dist/{Badge-BqS6Nk4J.mjs → Badge-BL0J5oMa.mjs} +3 -3
- package/dist/{Badge-BqS6Nk4J.mjs.map → Badge-BL0J5oMa.mjs.map} +1 -1
- package/dist/Banner.d.mts +1 -1
- package/dist/BooleanValueControl.d.mts +1 -1
- package/dist/{Breadcrumb-DEwZFJHF.d.mts → Breadcrumb-Czgdi0xf.d.mts} +1 -1
- package/dist/Breadcrumb.d.mts +1 -1
- package/dist/{Breadcrumbs-CqKtnZqu.mjs → Breadcrumbs-ed4wRDS7.mjs} +12 -12
- package/dist/{Breadcrumbs-CqKtnZqu.mjs.map → Breadcrumbs-ed4wRDS7.mjs.map} +1 -1
- package/dist/{Breadcrumbs-0e_3v9FF.d.mts → Breadcrumbs-zei-cpdU.d.mts} +2 -2
- package/dist/Breadcrumbs.d.mts +1 -1
- package/dist/{Button-C0F0F2IL.d.mts → Button-CKzNTpPL.d.mts} +4 -4
- package/dist/Button.d.mts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/{Calendar-BvLNcHQM.d.mts → Calendar-CcxN7y3e.d.mts} +2 -2
- package/dist/Calendar.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-BMCB9eFC.mjs → Card-CKrJtn1f.mjs} +4 -4
- package/dist/{Card-BMCB9eFC.mjs.map → Card-CKrJtn1f.mjs.map} +1 -1
- package/dist/{Card-BxNoIQWw.d.mts → Card-pr4FQWjn.d.mts} +4 -4
- package/dist/Card.d.mts +1 -1
- package/dist/Card2.d.mts +3 -3
- package/dist/{CardV2-B0ZweQYk.mjs → CardV2-D3m5EKlp.mjs} +19 -19
- package/dist/{CardV2-B0ZweQYk.mjs.map → CardV2-D3m5EKlp.mjs.map} +1 -1
- package/dist/{Checkbox-Bm8exUfH.d.mts → Checkbox-Bmm-r5ei.d.mts} +1 -1
- package/dist/{Checkbox-DAvbgZgO.mjs → Checkbox-Ccuicmlo.mjs} +8 -8
- package/dist/{Checkbox-DAvbgZgO.mjs.map → Checkbox-Ccuicmlo.mjs.map} +1 -1
- package/dist/Checkbox.d.mts +1 -1
- package/dist/CheckboxGroupField.d.mts +2 -2
- package/dist/ChoicesValueControl.d.mts +1 -1
- package/dist/{Combobox-xBrxiUAu.mjs → Combobox-BGRyr_-L.mjs} +22 -22
- package/dist/Combobox-BGRyr_-L.mjs.map +1 -0
- package/dist/{Combobox-C8ue0cBP.d.mts → Combobox-Bf_Xe1BG.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-DJGTMf1_.d.mts → ComboboxBase-CWzN8GML.d.mts} +8 -8
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-D7A2bbWU.d.mts → ComboboxMultiSelect-iSuvyOx2.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-D1uzEyKj.d.mts → ComboboxSingleSelect-DVRFKPi1.d.mts} +4 -4
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-DMuvqaV5.d.mts → CompactBar-C_61pgp7.d.mts} +3 -3
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ConfigFormGroup-D2_sajXe.mjs → ConfigFormGroup-DGCTW3by.mjs} +4 -4
- package/dist/{ConfigFormGroup-D2_sajXe.mjs.map → ConfigFormGroup-DGCTW3by.mjs.map} +1 -1
- package/dist/{ControlBar-Dg8JeU8f.d.mts → ControlBar-0XwbM4yC.d.mts} +2 -2
- package/dist/ControlBar.d.mts +1 -1
- package/dist/DataTable.d.mts +4 -4
- package/dist/{DateField-Com9f2-j.d.mts → DateField-CKeSIhGy.d.mts} +2 -2
- package/dist/DateField.d.mts +1 -1
- package/dist/{DatePicker-BGO6doLx.d.mts → DatePicker-B1iWrqR5.d.mts} +2 -2
- package/dist/{DatePicker-BlnE2MBD.mjs → DatePicker-BNnZ6L1y.mjs} +29 -12
- package/dist/DatePicker-BNnZ6L1y.mjs.map +1 -0
- package/dist/DatePicker.d.mts +1 -1
- package/dist/{DateRangePicker-DfRBm9z4.d.mts → DateRangePicker-BmF9eH9R.d.mts} +2 -2
- package/dist/DateRangePicker.d.mts +1 -1
- package/dist/DateRangeValueControl.d.mts +2 -2
- package/dist/DateValueControl.d.mts +1 -1
- package/dist/{DropdownButton-CpWNRUma.mjs → DropdownButton-BlVeFbJ0.mjs} +3 -3
- package/dist/{DropdownButton-CpWNRUma.mjs.map → DropdownButton-BlVeFbJ0.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-BCyV8nC0.mjs → DropdownMenu-82xH1AZr.mjs} +4 -4
- package/dist/{DropdownMenu-BCyV8nC0.mjs.map → DropdownMenu-82xH1AZr.mjs.map} +1 -1
- package/dist/{DropdownMenu-CnaK78rP.d.mts → DropdownMenu-DuTnq9j7.d.mts} +3 -3
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-CN2XjaOX.d.mts → ErrorProps-DX50vo-U.d.mts} +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/{FieldRegistry-DdA63Vnh.d.mts → FieldRegistry-D1vghSC_.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-CxNsBVrn.d.mts → FilterBar-Ck085Dic.d.mts} +4 -4
- package/dist/FilterBar.d.mts +1 -1
- package/dist/FilterPickerMenu.d.mts +3 -3
- package/dist/FilterPill.d.mts +1 -1
- package/dist/FilterPopover.d.mts +2 -2
- package/dist/FloatValueControl.d.mts +1 -1
- package/dist/FloatingPanel.d.mts +1 -1
- package/dist/FloatingPanelContext.d.mts +1 -1
- package/dist/{FormControl-Doj2gvF0.d.mts → FormControl-CfpwZGlD.d.mts} +4 -4
- package/dist/{FormControl-HVzZEqJH.mjs → FormControl-D1HIqDKm.mjs} +6 -6
- package/dist/{FormControl-HVzZEqJH.mjs.map → FormControl-D1HIqDKm.mjs.map} +1 -1
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +2 -2
- package/dist/{FormField-D8dHbqZZ.d.mts → FormField-0p4y0sS5.d.mts} +2 -2
- package/dist/{FormField-B9P3BWvS.mjs → FormField-CVnbsNvU.mjs} +22 -22
- package/dist/FormField-CVnbsNvU.mjs.map +1 -0
- package/dist/FormField.d.mts +1 -1
- package/dist/{Header-CBlB65NY.d.mts → Header-gDUTQgWj.d.mts} +2 -2
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-C28h1zFl.d.mts → HelperTooltip-CqhiRb5g.d.mts} +3 -3
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/{HoverCopyableField-0Bzygbp9.mjs → HoverCopyableField-HWshrU_1.mjs} +31 -20
- package/dist/HoverCopyableField-HWshrU_1.mjs.map +1 -0
- package/dist/HoverCopyableField.d.mts +15 -4
- package/dist/{IconButton-BfDlic2K.mjs → IconButton-BgL3QUVO.mjs} +9 -9
- package/dist/{IconButton-BfDlic2K.mjs.map → IconButton-BgL3QUVO.mjs.map} +1 -1
- package/dist/{IconButton-CBcW7ZU8.d.mts → IconButton-CLsHdYm7.d.mts} +2 -2
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.mts +2 -2
- package/dist/InlineCombobox.d.mts +2 -2
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Input-CVdjkX88.d.mts → Input-BHHWpSKN.d.mts} +6 -6
- package/dist/{Input-Bimw8KFj.mjs → Input-DoB8YswA.mjs} +6 -6
- package/dist/{Input-Bimw8KFj.mjs.map → Input-DoB8YswA.mjs.map} +1 -1
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-BwKkmImn.d.mts → InputProps-sHxlDiss.d.mts} +2 -2
- package/dist/InputProps.d.mts +1 -1
- package/dist/IntegerValueControl.d.mts +1 -1
- package/dist/LayoutLoadingSpinner.d.mts +11 -0
- package/dist/Link.d.mts +3 -3
- package/dist/{ListBox-DKZpGYjo.mjs → ListBox-B9uuMt2R.mjs} +15 -15
- package/dist/{ListBox-DKZpGYjo.mjs.map → ListBox-B9uuMt2R.mjs.map} +1 -1
- package/dist/{ListBox-CDl5oZPX.d.mts → ListBox-BrY1bQ5-.d.mts} +5 -5
- package/dist/ListBox.d.mts +1 -1
- package/dist/ListBoxField.d.mts +3 -3
- package/dist/{LoadingShimmer-DC2vqicd.mjs → LoadingShimmer-dsBWRdTU.mjs} +2 -2
- package/dist/{LoadingShimmer-DC2vqicd.mjs.map → LoadingShimmer-dsBWRdTU.mjs.map} +1 -1
- package/dist/LoadingShimmer.d.mts +2 -2
- package/dist/{LogicRow-CkbyvrUw.d.mts → LogicRow-9a_klV2v.d.mts} +4 -4
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +2 -2
- package/dist/MatchHighlight.d.mts +1 -1
- package/dist/{Menu-Dir03WA9.mjs → Menu-CHbUf9PQ.mjs} +6 -6
- package/dist/{Menu-Dir03WA9.mjs.map → Menu-CHbUf9PQ.mjs.map} +1 -1
- package/dist/{Menu-CYRdEnfo.d.mts → Menu-D4Y_J-QI.d.mts} +4 -4
- package/dist/Menu.d.mts +1 -1
- package/dist/{MiddleTruncatedText-GXI-CPvs.mjs → MiddleTruncatedText-DnF7F_1D.mjs} +4 -4
- package/dist/{MiddleTruncatedText-GXI-CPvs.mjs.map → MiddleTruncatedText-DnF7F_1D.mjs.map} +1 -1
- package/dist/Modal.d.mts +4 -5
- package/dist/{PageHeader-C2IUKhCg.mjs → PageHeader-XxGsFLHb.mjs} +4 -4
- package/dist/{PageHeader-C2IUKhCg.mjs.map → PageHeader-XxGsFLHb.mjs.map} +1 -1
- package/dist/PageHeader.d.mts +2 -2
- package/dist/PageLayout.d.mts +1 -1
- package/dist/{PageSelector-vay4jpMp.d.mts → PageSelector-BDo3ge1E.d.mts} +3 -3
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-ygLutOst.d.mts → Pagination-Dcmv7bVe.d.mts} +2 -2
- package/dist/{Pagination-0VhVdXv0.mjs → Pagination-DvVKQLdC.mjs} +8 -8
- package/dist/{Pagination-0VhVdXv0.mjs.map → Pagination-DvVKQLdC.mjs.map} +1 -1
- package/dist/Pagination.d.mts +1 -1
- package/dist/{Pii-C7pA72Bh.mjs → Pii-BD48BtZ0.mjs} +2 -2
- package/dist/{Pii-C7pA72Bh.mjs.map → Pii-BD48BtZ0.mjs.map} +1 -1
- package/dist/Pii.d.mts +1 -1
- package/dist/PillShell.d.mts +1 -1
- package/dist/{Popover-BkDpDdaO.mjs → Popover-DNH8Jx1-.mjs} +6 -6
- package/dist/{Popover-BkDpDdaO.mjs.map → Popover-DNH8Jx1-.mjs.map} +1 -1
- package/dist/Popover.d.mts +1 -1
- package/dist/ProgressBar.d.mts +1 -1
- package/dist/ProgressIndicator.d.mts +1 -1
- package/dist/{PseudoClassProps-CcSlKNev.d.mts → PseudoClassProps-DgT5G_z5.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-BaFutxgV.mjs → Radio-DSMPX5_2.mjs} +5 -5
- package/dist/{Radio-BaFutxgV.mjs.map → Radio-DSMPX5_2.mjs.map} +1 -1
- package/dist/{RadioGroup-ClMzOZl0.mjs → RadioGroup-D5IITQLz.mjs} +4 -4
- package/dist/{RadioGroup-ClMzOZl0.mjs.map → RadioGroup-D5IITQLz.mjs.map} +1 -1
- package/dist/{RadioGroup-BuJaitgG.d.mts → RadioGroup-Jl1yAvGu.d.mts} +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/RangeCalendar.d.mts +1 -1
- package/dist/RangeCalendarPresets.d.mts +1 -1
- package/dist/RuleEditorFields.d.mts +3 -3
- package/dist/RulesPill.d.mts +1 -1
- package/dist/{SearchInput-Ca3_np5e.d.mts → SearchInput-CaKHRC_s.d.mts} +3 -3
- package/dist/SearchInput.d.mts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-DgyJL4uN.mjs → SegmentedControl-JUgRw_M-.mjs} +5 -5
- package/dist/{SegmentedControl-DgyJL4uN.mjs.map → SegmentedControl-JUgRw_M-.mjs.map} +1 -1
- package/dist/{SegmentedControl-_I4sWeD7.d.mts → SegmentedControl-e6xDtoHC.d.mts} +2 -2
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-vwXGlHuW.d.mts → Select-CPYztD4m.d.mts} +4 -4
- package/dist/{Select-D6MqSYVa.mjs → Select-DX3toj6M.mjs} +12 -12
- package/dist/{Select-D6MqSYVa.mjs.map → Select-DX3toj6M.mjs.map} +1 -1
- package/dist/Select.d.mts +1 -1
- package/dist/Slider.d.mts +1 -1
- package/dist/SliderRHF.d.mts +1 -1
- package/dist/SliderThumb.d.mts +1 -1
- package/dist/{Spacer-CJp0lwkL.mjs → Spacer-BsK8tTwA.mjs} +2 -2
- package/dist/{Spacer-CJp0lwkL.mjs.map → Spacer-BsK8tTwA.mjs.map} +1 -1
- package/dist/{Spinner-BgBCCHGo.mjs → Spinner-D3wXIoXN.mjs} +3 -3
- package/dist/{Spinner-BgBCCHGo.mjs.map → Spinner-D3wXIoXN.mjs.map} +1 -1
- package/dist/{Stack-Bl54WmhY.mjs → Stack-Bre2oiov.mjs} +2 -2
- package/dist/{Stack-Bl54WmhY.mjs.map → Stack-Bre2oiov.mjs.map} +1 -1
- package/dist/{Stack-CkV7k7TE.d.mts → Stack-DHaK1-dw.d.mts} +2 -2
- package/dist/Stack.d.mts +1 -1
- package/dist/StatusIndicator.d.mts +1 -1
- package/dist/{Sticker-xtDMuOoN.mjs → Sticker-CQ6sOKUj.mjs} +6 -6
- package/dist/{Sticker-xtDMuOoN.mjs.map → Sticker-CQ6sOKUj.mjs.map} +1 -1
- package/dist/{Sticker-Dhx2wqTL.d.mts → Sticker-DnSemOcW.d.mts} +6 -6
- package/dist/Sticker.d.mts +1 -1
- package/dist/StringValueControl.d.mts +1 -1
- package/dist/SwatchPicker.d.mts +1 -1
- package/dist/Tab.d.mts +3 -3
- package/dist/{TabBar-D6UocZXi.mjs → TabBar-sYllYizt.mjs} +7 -7
- package/dist/{TabBar-D6UocZXi.mjs.map → TabBar-sYllYizt.mjs.map} +1 -1
- package/dist/TabBarIconButton.d.mts +2 -2
- package/dist/{Table-D1WyUQuv.mjs → Table-C2pkP5Xg.mjs} +8 -8
- package/dist/{Table-D1WyUQuv.mjs.map → Table-C2pkP5Xg.mjs.map} +1 -1
- package/dist/{Table-cO7ZwGPM.d.mts → Table-CFbPINKr.d.mts} +1 -1
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-CirMgfAV.d.mts → TableBody-BQsGc4Lw.d.mts} +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/{TableBox-C5qWhr82.mjs → TableBox-CaTHcR4F.mjs} +16 -16
- package/dist/{TableBox-C5qWhr82.mjs.map → TableBox-CaTHcR4F.mjs.map} +1 -1
- package/dist/TableBox.d.mts +2 -2
- package/dist/{TableBoxCell-DmVX_tgn.d.mts → TableBoxCell-52g97gEg.d.mts} +8 -8
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/TableBoxField.d.mts +4 -4
- package/dist/{TableBoxRow-nwq41Bpi.d.mts → TableBoxRow-DnoumHIE.d.mts} +4 -4
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-B4_ojiQo.d.mts → TableBoxRowActions-CDcREhP4.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/TableCell.d.mts +1 -1
- package/dist/{TableControls-CZ9iu3ma.mjs → TableControls-3bXyd8gS.mjs} +104 -79
- package/dist/TableControls-3bXyd8gS.mjs.map +1 -0
- package/dist/{TableControls-RwIPBxyU.d.mts → TableControls-CrGGlkEG.d.mts} +5 -9
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-D_SBFZN1.d.mts → TableControlsContext-BKZt2Jid.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableHead-DMq_q_W0.d.mts → TableHead-CqVIJfjh.d.mts} +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-C2pqXBYO.d.mts → TableHeaderCell-DK4R8vdK.d.mts} +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-DQKu6Rcj.d.mts → TableLayout-BcIazRB-.d.mts} +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-CPqZ8DK3.d.mts → TableRow-DdJcjG2b.d.mts} +2 -2
- package/dist/TableRow.d.mts +1 -1
- package/dist/TableTH.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-BYPh4dIP.d.mts → TableViewConfigurationDropdown-CHBOjw7O.d.mts} +5 -3
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{TechnicalSticker-DTjg6d2F.mjs → TechnicalSticker-D3eeGMDR.mjs} +6 -6
- package/dist/{TechnicalSticker-DTjg6d2F.mjs.map → TechnicalSticker-D3eeGMDR.mjs.map} +1 -1
- package/dist/TechnicalSticker.d.mts +1 -1
- package/dist/{Text-RcEfNFLx.mjs → Text-B0orb-cZ.mjs} +2 -2
- package/dist/{Text-RcEfNFLx.mjs.map → Text-B0orb-cZ.mjs.map} +1 -1
- package/dist/{Text-CfIFUyHt.d.mts → Text-BIgrwIdS.d.mts} +4 -4
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-DhPBI_1-.d.mts → TextArea-CiLttt0s.d.mts} +2 -2
- package/dist/{TextArea-ZMgbE_Lh.mjs → TextArea-DWXuV2aZ.mjs} +4 -4
- package/dist/{TextArea-ZMgbE_Lh.mjs.map → TextArea-DWXuV2aZ.mjs.map} +1 -1
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-BzmmiJlC.d.mts → TextUnderlineTooltip-_7mIrZ2-.d.mts} +3 -3
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.mts +2 -2
- package/dist/Toast.d.mts +1 -1
- package/dist/{Toggle-BGGQ4Ukl.d.mts → Toggle-Cav7bMxg.d.mts} +1 -1
- package/dist/{Toggle-BPgfSjuu.mjs → Toggle-e8DCYa6i.mjs} +7 -7
- package/dist/{Toggle-BPgfSjuu.mjs.map → Toggle-e8DCYa6i.mjs.map} +1 -1
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-D_a-RwAN.d.mts → Tooltip-DX-N-szt.d.mts} +3 -3
- package/dist/{Tooltip-BvDbmXak.mjs → Tooltip-iJcfJqxn.mjs} +5 -5
- package/dist/{Tooltip-BvDbmXak.mjs.map → Tooltip-iJcfJqxn.mjs.map} +1 -1
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-BJnowVTx.d.mts → TruncatedText-D2R7uy_y.d.mts} +2 -2
- package/dist/components/Attribute/index.mjs +7 -7
- package/dist/components/Attribute/index.mjs.map +1 -1
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Banner/index.mjs +3 -3
- package/dist/components/Breadcrumbs/index.d.mts +1 -1
- package/dist/components/Breadcrumbs/index.mjs +1 -1
- package/dist/components/Button/index.d.mts +2 -2
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/ButtonGroup/index.mjs +4 -4
- package/dist/components/Card/index.d.mts +2 -2
- package/dist/components/Card/index.mjs +1 -1
- package/dist/components/CardV2/index.d.mts +1 -1
- package/dist/components/CardV2/index.mjs +1 -1
- package/dist/components/Checkbox/index.d.mts +1 -1
- package/dist/components/Checkbox/index.mjs +1 -1
- package/dist/components/Combobox/index.d.mts +2 -2
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/ConfigFormGroup/index.mjs +2 -2
- package/dist/components/DataTable/TableControls/index.d.mts +15 -15
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.mjs +25 -25
- package/dist/components/DataTable/index.mjs.map +1 -1
- package/dist/components/DataTable/types.d.mts +2 -2
- package/dist/components/DatePicker/index.d.mts +4 -4
- package/dist/components/DatePicker/index.mjs +1 -1
- package/dist/components/DropdownButton/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/DropdownMenu/index.mjs +1 -1
- package/dist/components/FloatingPanel/index.mjs +8 -8
- package/dist/components/FloatingPanel/index.mjs.map +1 -1
- package/dist/components/FormControl/index.d.mts +2 -2
- package/dist/components/FormControl/index.mjs +2 -2
- package/dist/components/FormField/index.d.mts +1 -1
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/HoverCopyableField/index.d.mts +2 -2
- package/dist/components/HoverCopyableField/index.mjs +2 -2
- package/dist/components/ImageTile/index.mjs +10 -10
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Link/index.mjs +4 -4
- package/dist/components/Link/index.mjs.map +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/LoadingShimmer/index.mjs +1 -1
- package/dist/components/MaskedInput/index.mjs +2 -2
- package/dist/components/MatchHighlight/index.mjs +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Menu/index.mjs +1 -1
- package/dist/components/Modal/index.mjs +42 -12
- package/dist/components/Modal/index.mjs.map +1 -1
- package/dist/components/PageHeader/index.mjs +1 -1
- package/dist/components/Pagination/index.d.mts +3 -3
- package/dist/components/Pagination/index.mjs +1 -1
- package/dist/components/Pii/index.mjs +1 -1
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/ProgressBar/index.mjs +2 -2
- package/dist/components/ProgressIndicator/index.mjs +2 -2
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.d.mts +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/SegmentedControl/index.d.mts +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Slider/index.mjs +4 -4
- package/dist/components/Spacer/index.mjs +1 -1
- package/dist/components/Spinner/index.mjs +1 -1
- package/dist/components/Stack/index.d.mts +1 -1
- package/dist/components/Stack/index.mjs +1 -1
- package/dist/components/StatusIndicator/index.mjs +2 -2
- package/dist/components/Sticker/index.d.mts +1 -1
- package/dist/components/Sticker/index.mjs +1 -1
- package/dist/components/SwatchPicker/index.mjs +1 -1
- package/dist/components/TabBar/index.mjs +1 -1
- package/dist/components/Table/index.d.mts +7 -7
- package/dist/components/Table/index.mjs +1 -1
- package/dist/components/TableBox/index.d.mts +2 -2
- package/dist/components/TableBox/index.mjs +1 -1
- package/dist/components/TechnicalSticker/index.mjs +1 -1
- package/dist/components/Text/index.d.mts +1 -1
- package/dist/components/Text/index.mjs +1 -1
- package/dist/components/TextArea/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Tile/index.mjs +5 -5
- package/dist/components/Toast/index.mjs +5 -5
- package/dist/components/Toggle/index.d.mts +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/components/Tooltip/index.mjs +1 -1
- package/dist/compound-expression.d.mts +1 -1
- package/dist/{constants-BASogfT_.d.mts → constants-bA9kCzRQ.d.mts} +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/display.d.mts +1 -1
- package/dist/fieldPickerOptions.d.mts +2 -2
- package/dist/{filter-size-context-Bw5F7082.d.mts → filter-size-context-C7injfBh.d.mts} +2 -2
- package/dist/filter-size-context.d.mts +1 -1
- package/dist/helpers.d.mts +1 -1
- package/dist/{index--5Mfhlkj.d.mts → index-BPfK-u7y.d.mts} +2 -2
- package/dist/{index-DiCnyORA.d.mts → index-BxBsQi2S.d.mts} +5 -5
- package/dist/{index-C1bz13uw.d.mts → index-d_fTFuMM.d.mts} +5 -5
- package/dist/index.d.mts +1 -1
- package/dist/index2.d.mts +1 -1
- package/dist/index3.d.mts +3 -3
- package/dist/index4.d.mts +10 -10
- package/dist/{input-CzO-6_1V.d.mts → input-D9FuQmlI.d.mts} +3 -3
- package/dist/inputFields.d.mts +11 -11
- package/dist/{intersperse-yd3oMrQl.mjs → intersperse-CLkblj9A.mjs} +1 -1
- package/dist/{intersperse-yd3oMrQl.mjs.map → intersperse-CLkblj9A.mjs.map} +1 -1
- package/dist/lib/GlobalStyles.mjs +1 -1
- package/dist/lib/HeadlessAriaButton.mjs +1 -1
- package/dist/lib/MiddleTruncatedText.mjs +1 -1
- package/dist/lib/PDSProvider.d.mts +1 -1
- package/dist/lib/PDSProvider.mjs +1 -1
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedText.mjs +2 -2
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.mjs +2 -2
- package/dist/lib/embeddedSurfaceProtocol.d.mts +13 -1
- package/dist/lib/embeddedSurfaceProtocol.mjs +32 -5
- package/dist/lib/embeddedSurfaceProtocol.mjs.map +1 -1
- package/dist/lib/message.d.mts +1 -1
- package/dist/lib/pseudoClass.d.mts +8 -8
- package/dist/lib/useEmbeddedSurface.d.mts +31 -3
- package/dist/lib/useEmbeddedSurface.mjs +118 -13
- package/dist/lib/useEmbeddedSurface.mjs.map +1 -1
- package/dist/{message-Cu84fcqB.d.mts → message-CqKB5mko.d.mts} +1 -1
- package/dist/mixins/focus.d.mts +1 -1
- package/dist/mixins/focus.mjs +1 -1
- package/dist/mixins/hoverable.d.mts +2 -2
- package/dist/mixins/hoverable.mjs +2 -2
- package/dist/mixins/input.d.mts +1 -1
- package/dist/mixins/input.mjs +2 -2
- package/dist/mixins/menuItem.d.mts +2 -2
- package/dist/mixins/menuItem.mjs +1 -1
- package/dist/mixins/print/index.mjs +1 -1
- package/dist/mixins/text.d.mts +1 -1
- package/dist/mixins/text.mjs +1 -1
- package/dist/{operators-CmSqHnTH.d.mts → operators-CgcsYzfy.d.mts} +2 -2
- package/dist/operators.d.mts +1 -1
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +6 -6
- package/dist/patterns/LayoutLoadingSpinner/index.d.mts +2 -0
- package/dist/patterns/LayoutLoadingSpinner/index.mjs +56 -0
- package/dist/patterns/LayoutLoadingSpinner/index.mjs.map +1 -0
- package/dist/patterns/PageLayout/index.mjs +1 -1
- package/dist/styledComponentsInterop-8zScIQyC.mjs +33 -0
- package/dist/styledComponentsInterop-8zScIQyC.mjs.map +1 -0
- package/dist/{text-BaQdW8qa.d.mts → text-xwtyWIbE.d.mts} +1 -1
- package/dist/{theme-D9Y6NOzb.d.mts → theme-Ftogn9Wo.d.mts} +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/{types-DEh_pXgS.d.mts → types-0_9G0kWg.d.mts} +3 -1
- package/dist/{types-NJtAxsU1.d.mts → types-BrNreYUU.d.mts} +2 -2
- package/dist/{types-C-TkDdkG.d.mts → types-D55MZSyx.d.mts} +1 -1
- package/dist/{types-TV9nVfSe.d.mts → types-DVsBRqjZ.d.mts} +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types2.d.mts +1 -1
- package/dist/types3.d.mts +1 -1
- package/dist/types4.d.mts +1 -1
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useFilterStateV2-C4itmN4S.d.mts → useFilterStateV2-D8Q8QKhS.d.mts} +3 -3
- package/dist/useFilterStateV2.d.mts +1 -1
- package/dist/{useFormField-B2U4GOH4.d.mts → useFormField-BBbq1izo.d.mts} +2 -2
- package/dist/{useFormField-eftOPiXj.mjs → useFormField-Bz2iMPBO.mjs} +2 -2
- package/dist/{useFormField-eftOPiXj.mjs.map → useFormField-Bz2iMPBO.mjs.map} +1 -1
- package/dist/useFormField.d.mts +1 -1
- package/dist/{useFormGroup-BMukAMAd.mjs → useFormGroup-CaTiD_Yt.mjs} +1 -1
- package/dist/{useFormGroup-BMukAMAd.mjs.map → useFormGroup-CaTiD_Yt.mjs.map} +1 -1
- package/dist/{useTableBoxDragAndDrop-CpemHLhL.d.mts → useTableBoxDragAndDrop-Bye8gJTl.d.mts} +1 -1
- package/dist/useTableBoxDragAndDrop.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/{utilities-DnSIlR1i.d.mts → utilities-Bmwk_DRn.d.mts} +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utils/storybook.mjs +1 -1
- package/dist/utils/testing.d.mts +1 -1
- package/dist/utils/testing.mjs +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils2.d.mts +12 -1
- package/dist/{validation-B5IXsdkE.d.mts → validation-CAtTuHO9.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/{value-control-resolver-BPlTeIX7.d.mts → value-control-resolver-DadI8r9a.d.mts} +2 -2
- package/dist/value-control-resolver.d.mts +1 -1
- package/dist/variables/keyframes.mjs +1 -1
- package/llms.txt +4 -4
- package/package.json +4 -2
- package/skills/ui-authoring/COMPONENTS.md +69 -305
- package/skills/ui-authoring/PATTERNS.md +362 -0
- package/skills/ui-authoring/SKILL.md +15 -147
- package/skills/ui-authoring/TOKENS.md +400 -0
- package/dist/Combobox-xBrxiUAu.mjs.map +0 -1
- package/dist/DatePicker-BlnE2MBD.mjs.map +0 -1
- package/dist/FormField-B9P3BWvS.mjs.map +0 -1
- package/dist/HoverCopyableField-0Bzygbp9.mjs.map +0 -1
- package/dist/TableControls-CZ9iu3ma.mjs.map +0 -1
- package/skills/ui-authoring/EXAMPLES.md +0 -370
- package/skills/ui-authoring/REFERENCE.md +0 -293
- /package/dist/{index-7rWKHdox.d.mts → index-0-W_aPej.d.mts} +0 -0
- /package/dist/{index-BMBcfD_R.d.mts → index-7in8TPrM.d.mts} +0 -0
- /package/dist/{index-BOn0AAue.d.mts → index-BINnViIh.d.mts} +0 -0
- /package/dist/{index-BYd3Btr1.d.mts → index-BNRXMhlr.d.mts} +0 -0
- /package/dist/{index-CKKoxA9V.d.mts → index-BO_854F2.d.mts} +0 -0
- /package/dist/{index-CNxS4Tlu.d.mts → index-BSVhZrWN.d.mts} +0 -0
- /package/dist/{index-CRo77wc3.d.mts → index-BrGZHEgX.d.mts} +0 -0
- /package/dist/{index-CWB6exYm.d.mts → index-BwAfCVZH2.d.mts} +0 -0
- /package/dist/{index-CtJuGxUp.d.mts → index-CCt0lwyI.d.mts} +0 -0
- /package/dist/{index-CzItj62a.d.mts → index-CDGG7lCB.d.mts} +0 -0
- /package/dist/{index-D4DUvwPf.d.mts → index-CFhUdAHM.d.mts} +0 -0
- /package/dist/{index-D5tSVhTd.d.mts → index-CREkvfw9.d.mts} +0 -0
- /package/dist/{index-DGsJdI5l.d.mts → index-CROz1VSV.d.mts} +0 -0
- /package/dist/{index-DkrC-i1D.d.mts → index-CzUpNo0e.d.mts} +0 -0
- /package/dist/{index-DztUdPP_.d.mts → index-DA6_cwf8.d.mts} +0 -0
- /package/dist/{index-Es5nKSSL.d.mts → index-DM6vVDZD.d.mts} +0 -0
- /package/dist/{index-FtE8MXJ_.d.mts → index-DeVKzGce.d.mts} +0 -0
- /package/dist/{index-IE5cwTAE2.d.mts → index-Jh0C5PIG.d.mts} +0 -0
- /package/dist/{index-e6k85DKM.d.mts → index-PWQavSPf.d.mts} +0 -0
- /package/dist/{index-ehD5GjMH.d.mts → index-sViox9YW.d.mts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBox-C5qWhr82.mjs","names":["DropdownMenu","MoreIcon","XIcon","CircleAlertIcon","FormControlContainer","Popover"],"sources":["../components/TableBox/tableBoxKeyboardNavigation.ts","../components/TableBox/InlineCombobox.tsx","../components/TableBox/TableBoxRowContext.ts","../components/TableBox/InlineInput.tsx","../components/TableBox/TableBoxRowActions.tsx","../components/TableBox/useDelayedInlineEditError.ts","../components/TableBox/TableBoxCell.tsx","../components/TableBox/TableBoxRow.tsx","../components/TableBox/useColumnWidthLock.ts","../components/TableBox/useTableBoxDragAndDrop.ts","../components/TableBox/TableBox.tsx"],"sourcesContent":["export type TableBoxNavigationDirection = 'up' | 'down' | 'left' | 'right';\nexport type HorizontalTableBoxNavigationDirection = Extract<\n TableBoxNavigationDirection,\n 'left' | 'right'\n>;\n\nconst INLINE_EDITOR_SELECTOR = '[data-tablebox-inline-edit-trigger], input[role=\"combobox\"]';\n\nconst findInlineEditor = (cell: HTMLTableCellElement | null) =>\n cell?.querySelector<HTMLElement>(INLINE_EDITOR_SELECTOR) ?? null;\n\nexport const isCaretAtNavigationBoundary = (\n input: HTMLInputElement,\n direction: HorizontalTableBoxNavigationDirection,\n) => {\n const { selectionStart, selectionEnd, value } = input;\n if (selectionStart == null || selectionEnd == null || selectionStart !== selectionEnd) {\n return false;\n }\n return direction === 'left' ? selectionStart === 0 : selectionEnd === value.length;\n};\n\nexport const focusAdjacentInlineEditor = (\n target: HTMLElement,\n direction: TableBoxNavigationDirection,\n) => {\n const currentCell = target.closest('td');\n const currentRow = currentCell?.closest('tr');\n if (!(currentCell instanceof HTMLTableCellElement) || currentRow == null) {\n return false;\n }\n\n if (direction === 'up' || direction === 'down') {\n const adjacentRow =\n direction === 'up' ? currentRow.previousElementSibling : currentRow.nextElementSibling;\n if (!(adjacentRow instanceof HTMLTableRowElement)) {\n return false;\n }\n\n const adjacentEditor = findInlineEditor(adjacentRow.cells.item(currentCell.cellIndex));\n adjacentEditor?.focus();\n return adjacentEditor != null;\n }\n\n let adjacentCell =\n direction === 'left' ? currentCell.previousElementSibling : currentCell.nextElementSibling;\n while (adjacentCell instanceof HTMLTableCellElement) {\n const adjacentEditor = findInlineEditor(adjacentCell);\n if (adjacentEditor != null) {\n adjacentEditor.focus();\n return true;\n }\n adjacentCell =\n direction === 'left' ? adjacentCell.previousElementSibling : adjacentCell.nextElementSibling;\n }\n\n return false;\n};\n","import { type RefObject, useCallback, useContext, useState } from 'react';\nimport styled from 'styled-components';\n\nimport Combobox from '@persona/design-system/components/Combobox';\nimport { Spacing } from '@persona/design-tokens';\n\nimport { type InlineEditConfig, TableBoxContext } from './TableBox';\nimport {\n focusAdjacentInlineEditor,\n isCaretAtNavigationBoundary,\n} from './tableBoxKeyboardNavigation';\n\ninterface InlineComboboxProps {\n /**\n * The id of the item the cell belongs to\n */\n itemId: string;\n /**\n * Initial value for the cell\n */\n value: string;\n /**\n * The column key this cell belongs to\n */\n columnKey?: string;\n /**\n * The inline edit configuration for this cell\n */\n inlineEditConfig?: InlineEditConfig;\n /**\n * The content to display when not editing. If no children are passed, the value will be displayed.\n */\n children?: React.ReactNode;\n /**\n * Reference to the table row element. Used for full-width combobox dropdowns.\n */\n rowRef?: RefObject<HTMLTableRowElement>;\n /** Whether the closed display is preceded by an error icon. */\n hasLeadingError?: boolean;\n}\n\nconst StyledCombobox = styled(Combobox)<{ $hideText?: boolean }>`\n border: none;\n background-color: transparent;\n\n /* Suppress the focus outline — it extends outside the input and is clipped\n by the scroll container. Use && for specificity. */\n && input,\n && input:focus-visible:not(:disabled) {\n outline: none;\n }\n\n ${({ $hideText }) =>\n $hideText &&\n `\n input {\n color: transparent;\n caret-color: transparent;\n }\n input::placeholder {\n color: transparent;\n }\n `}\n`;\n\nconst ChildrenOverlay = styled.div<{ $hasLeadingError?: boolean; $truncate?: boolean }>`\n position: absolute;\n left: ${({ $hasLeadingError }) => ($hasLeadingError ? Spacing[1] : Spacing[2])};\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n pointer-events: none;\n\n // ${Spacing[5]} matches the sm ComboboxInput padding-right, keeping the text clear of the caret.\n ${({ $truncate }) =>\n $truncate &&\n `\n right: ${Spacing[5]};\n `}\n`;\n\nconst ComboboxWrapper = styled.div`\n position: relative;\n width: 100%;\n`;\n\nconst InlineCombobox = ({\n itemId,\n value,\n columnKey,\n inlineEditConfig,\n children,\n rowRef,\n hasLeadingError,\n}: InlineComboboxProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const context = useContext(TableBoxContext);\n const setColumnWidthsLocked = context?.setColumnWidthsLocked;\n const currentColumn = context?.columns?.find((c) => c.key === columnKey);\n const placeholder = inlineEditConfig?.placeholder || currentColumn?.title || '';\n const fullWidthComboboxDropdown = inlineEditConfig?.fullWidthComboboxDropdown || false;\n\n // Use rowRef as portalContainerRef when fullWidthComboboxDropdown is enabled\n const portalContainerRef = fullWidthComboboxDropdown && rowRef ? rowRef : undefined;\n\n const showOverlay = !isOpen && !!children;\n\n // Mirror `InlineInput`'s edit-lifecycle contract so the parent TableBox\n // can lock column widths while the combobox is open. Without this, the\n // text→input swap (`$hideText`) and the focus-driven `RowActionsContainer`\n // appearing in the cell can reflow data columns when the dropdown opens.\n //\n // useCallback is critical here: ComboboxSingleSelect calls onOpenChange from\n // a useEffect with [isOpen, onOpenChange] deps. A new function reference on\n // every render would cause that effect to fire spuriously, calling\n // setColumnWidthsLocked(false) and wiping out lockedColWidths set by a sibling\n // text-input cell — causing the text-input column to shift when clicked.\n const handleOpenChange = useCallback(\n (open: boolean) => {\n setIsOpen(open);\n setColumnWidthsLocked?.(open);\n },\n [setColumnWidthsLocked],\n );\n\n return (\n <ComboboxWrapper\n onKeyDownCapture={(event) => {\n if (isOpen || (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')) {\n return;\n }\n const direction = event.key === 'ArrowLeft' ? 'left' : 'right';\n if (\n !(event.target instanceof HTMLInputElement) ||\n !isCaretAtNavigationBoundary(event.target, direction)\n ) {\n return;\n }\n const movedFocus = focusAdjacentInlineEditor(event.currentTarget, direction);\n if (movedFocus) {\n event.preventDefault();\n event.stopPropagation();\n }\n }}\n >\n {showOverlay && (\n <ChildrenOverlay\n $hasLeadingError={hasLeadingError}\n $truncate={inlineEditConfig?.truncateDisplay}\n >\n {children}\n </ChildrenOverlay>\n )}\n <StyledCombobox\n $hideText={showOverlay}\n value={value}\n options={inlineEditConfig?.options || []}\n onChange={(newValue) => {\n if (inlineEditConfig?.onChange && newValue !== value && typeof newValue === 'string') {\n inlineEditConfig.onChange(itemId, newValue);\n }\n }}\n onOpenChange={handleOpenChange}\n placeholder={placeholder}\n size='sm'\n portal={inlineEditConfig?.useComboboxPortal || false}\n portalContainerRef={portalContainerRef}\n />\n </ComboboxWrapper>\n );\n};\n\nexport default InlineCombobox;\n","import { createContext, type RefObject } from 'react';\n\ninterface TableBoxRowContextValue {\n /**\n * Ref to the surrounding `<tr>`. Used by inline-edit comboboxes that opt\n * into `fullWidthComboboxDropdown` so they can portal their dropdown\n * positioned to the row.\n */\n rowRef: RefObject<HTMLTableRowElement>;\n /** Deletes this row when keyboard editing identifies it as removable. */\n onDelete?: () => void;\n /** Notifies the row that a descendant inline editor committed or canceled. */\n onEditingEnd: () => void;\n /** True when every data cell after the first has an explicitly empty value. */\n areOtherCellsBlank: boolean;\n}\n\nexport const TableBoxRowContext = createContext<TableBoxRowContextValue | null>(null);\n","import { useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Typography } from '@persona/design-tokens';\n\nimport { type InlineEditConfig, TableBoxContext } from './TableBox';\nimport {\n focusAdjacentInlineEditor,\n isCaretAtNavigationBoundary,\n} from './tableBoxKeyboardNavigation';\nimport { TableBoxRowContext } from './TableBoxRowContext';\n\ninterface InlineInputProps {\n /**\n * The id of the item the cell belongs to\n */\n itemId: string;\n /**\n * Initial value for the cell\n */\n value: string;\n /**\n * The column key this cell belongs to\n */\n columnKey?: string;\n /**\n * The inline edit configuration for this cell\n */\n inlineEditConfig?: InlineEditConfig;\n /** Notifies the cell that this inline editor committed or canceled. */\n onEditingEnd?: () => void;\n /**\n * The content to display when not editing. If no children are passed, the value will be displayed.\n */\n children?: React.ReactNode;\n}\n\nconst sharedInputStyles = css`\n font: inherit;\n color: inherit;\n outline: none;\n border: none;\n padding: 0;\n pointer-events: auto;\n width: 100%;\n background: transparent;\n line-height: ${Typography.TextSmall.lineHeight};\n`;\n\nconst InlineEditInput = styled.input`\n ${sharedInputStyles}\n`;\n\nconst InlineEditTextarea = styled.textarea`\n ${sharedInputStyles}\n resize: none;\n overflow-y: auto;\n min-height: ${Typography.TextSmall.lineHeight};\n scrollbar-width: none;\n`;\n\nconst InlineEditDisplay = styled.div<{ $multiline?: boolean }>`\n cursor: text;\n outline: none;\n width: 100%;\n height: 100%;\n min-height: ${Typography.TextSmall.lineHeight};\n line-height: ${Typography.TextSmall.lineHeight};\n\n ${({ $multiline }) =>\n $multiline\n ? css`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n word-break: break-word;\n `\n : css`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n`;\n\nconst InlineInput = ({\n itemId,\n value,\n columnKey,\n inlineEditConfig,\n onEditingEnd,\n children,\n}: InlineInputProps) => {\n const { columns, newRowId, setColumnWidthsLocked, scheduleCreateNewRowAfterCommit } =\n useContext(TableBoxContext) ?? {};\n const rowContext = useContext(TableBoxRowContext);\n // Check if this cell should render in inline edit mode (first cell of newly created row)\n const initialInlineEditState = itemId === newRowId && columnKey === columns?.[0]?.key;\n const [isInlineEditing, setIsInlineEditing] = useState(initialInlineEditState);\n const [editValue, setEditValue] = useState(value);\n const inputRef = useRef<HTMLInputElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const cancelledRef = useRef(false);\n\n const isMultiline = inlineEditConfig?.multiline === true;\n\n // set the cancelledRef to false when the component unmounts\n useEffect(() => {\n return () => {\n cancelledRef.current = false;\n };\n }, []);\n\n // Auto-resize textarea to fit content. useLayoutEffect runs before paint so the\n // intermediate height: auto state is never visible, eliminating flicker.\n useLayoutEffect(() => {\n if (isInlineEditing && isMultiline && textareaRef.current) {\n const textarea = textareaRef.current;\n textarea.style.height = 'auto';\n textarea.style.height = `${textarea.scrollHeight}px`;\n }\n }, [isInlineEditing, editValue, isMultiline]);\n\n // Position cursor at end of textarea when editing starts\n useEffect(() => {\n if (isInlineEditing && isMultiline && textareaRef.current) {\n const length = textareaRef.current.value.length;\n textareaRef.current.setSelectionRange(length, length);\n }\n }, [isInlineEditing, isMultiline]);\n\n const placeholder = useMemo(() => {\n const column = columns?.find((c) => c.key === columnKey);\n return column?.inlineEditConfig?.placeholder || column?.title || '';\n }, [columns, columnKey]);\n\n const notifyEditingEnd = () => {\n onEditingEnd?.();\n rowContext?.onEditingEnd();\n setColumnWidthsLocked?.(false);\n };\n\n const handleInlineEditKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n const isFirstCell = columnKey === columns?.[0]?.key;\n if (\n (e.key === 'Delete' || e.key === 'Backspace') &&\n isFirstCell &&\n editValue === '' &&\n rowContext?.areOtherCellsBlank &&\n rowContext.onDelete\n ) {\n e.preventDefault();\n e.stopPropagation();\n cancelledRef.current = true;\n setColumnWidthsLocked?.(false);\n const focusedAdjacentRow =\n focusAdjacentInlineEditor(e.currentTarget, 'down') ||\n focusAdjacentInlineEditor(e.currentTarget, 'up');\n if (!focusedAdjacentRow) {\n e.currentTarget.closest('table')?.focus();\n }\n rowContext.onDelete();\n } else if (\n !isMultiline &&\n (e.key === 'ArrowUp' ||\n e.key === 'ArrowDown' ||\n e.key === 'ArrowLeft' ||\n e.key === 'ArrowRight')\n ) {\n const direction =\n e.key === 'ArrowUp'\n ? 'up'\n : e.key === 'ArrowDown'\n ? 'down'\n : e.key === 'ArrowLeft'\n ? 'left'\n : 'right';\n const canMoveFocus =\n direction === 'up' ||\n direction === 'down' ||\n (e.currentTarget instanceof HTMLInputElement &&\n isCaretAtNavigationBoundary(e.currentTarget, direction));\n const movedFocus = canMoveFocus && focusAdjacentInlineEditor(e.currentTarget, direction);\n if (movedFocus) {\n e.preventDefault();\n e.stopPropagation();\n }\n } else if (e.key === 'Enter') {\n if (isMultiline) {\n // In multiline mode, Ctrl+Enter or Cmd+Enter saves\n if (e.ctrlKey || e.metaKey) {\n e.preventDefault();\n e.stopPropagation();\n handleInlineEditConfirm();\n notifyEditingEnd();\n setIsInlineEditing(false);\n }\n // Regular Enter adds a newline (default behavior)\n } else {\n // In single-line mode, Enter saves\n e.preventDefault();\n e.stopPropagation();\n handleInlineEditConfirm();\n notifyEditingEnd();\n setIsInlineEditing(false);\n const isLastCell = columnKey === columns?.at(-1)?.key;\n const currentRow = e.currentTarget.closest('tr');\n const isLastRow = currentRow != null && currentRow.nextElementSibling == null;\n if (isLastCell && isLastRow) {\n scheduleCreateNewRowAfterCommit?.();\n }\n }\n } else if (e.key === 'Tab') {\n handleInlineEditConfirm();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n handleInlineEditCancel();\n }\n };\n\n const handleInlineEditConfirm = () => {\n if (inlineEditConfig?.onChange && editValue !== value) {\n inlineEditConfig.onChange(itemId, editValue);\n }\n };\n\n const handleInlineEditCancel = () => {\n cancelledRef.current = true;\n setEditValue(value);\n notifyEditingEnd();\n setIsInlineEditing(false);\n };\n\n const handleInlineEditBlur = () => {\n // Only save on blur if the user didn't press Escape\n if (!cancelledRef.current) {\n handleInlineEditConfirm();\n }\n cancelledRef.current = false;\n setIsInlineEditing(false);\n setColumnWidthsLocked?.(false);\n };\n\n return isInlineEditing ? (\n isMultiline ? (\n <InlineEditTextarea\n ref={textareaRef}\n value={editValue}\n onChange={(e) => setEditValue(e.target.value)}\n onBlur={handleInlineEditBlur}\n onKeyDown={handleInlineEditKeyDown}\n placeholder={placeholder}\n autoFocus\n // without this, the textarea will be 2 lines high by default,\n // even when there's only one line of text\n rows={1}\n />\n ) : (\n <InlineEditInput\n ref={inputRef}\n value={editValue}\n onChange={(e) => setEditValue(e.target.value)}\n onBlur={handleInlineEditBlur}\n onKeyDown={handleInlineEditKeyDown}\n placeholder={placeholder}\n autoFocus\n />\n )\n ) : (\n <InlineEditDisplay\n tabIndex={0}\n data-tablebox-inline-edit-trigger\n $multiline={isMultiline}\n onFocus={() => {\n setEditValue(value);\n setColumnWidthsLocked?.(true);\n setIsInlineEditing(true);\n }}\n >\n {children || value}\n </InlineEditDisplay>\n );\n};\n\nexport default InlineInput;\n","import styled, { css } from 'styled-components';\n\nimport { IconButton } from '@persona/design-system/components/Button';\nimport DropdownMenu from '@persona/design-system/components/DropdownMenu';\nimport type { MenuItemProps } from '@persona/design-system/components/Menu';\nimport { TransitionDuration } from '@persona/design-system/variables/transitions';\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { MoreIcon, XIcon } from '@persona/icons/12px';\n\nexport type RowAction = {\n label: string;\n onClick: () => void;\n} & Omit<MenuItemProps, 'children'>;\n\nconst IconButtonWidth = 16;\nconst BackgroundFadeWidth = 12;\nconst RowActionsContainerBaseWidth = parseInt(Spacing[1]) + IconButtonWidth + parseInt(Spacing[2]);\nexport const RowActionsContainerWithFadeWidth = BackgroundFadeWidth + RowActionsContainerBaseWidth;\n\n/**\n * Container for row-level actions (`actions` menu and/or delete `X`). Used\n * in two layouts:\n *\n * - **Dedicated trailing column** (`$inDedicatedColumn=true`, the default\n * for horizontal-scroll mode): laid out in normal flow inside\n * `PinnedActionsCell`.\n * - **Overlaid in last data cell** (`$inDedicatedColumn=false`,\n * `disableHorizontalScroll` mode): absolutely positioned on top of the\n * last cell's content with a fade gradient so it overlaps text on hover.\n *\n * Other variant props:\n * - `$hasCombobox` — last data column is an inline combobox; we use auto\n * width so the caret↔first-action gap matches the action↔delete gap, and\n * we drop the gradient so there's no fade running over the caret.\n * - `$hasDelete` — fade the container in only on hover, mirroring the\n * legacy \"show delete on hover\" behavior.\n */\nexport const RowActionsContainer = styled.div<{\n $hasActions?: boolean;\n $hasDelete?: boolean;\n $hasCombobox?: boolean;\n $inDedicatedColumn?: boolean;\n}>`\n width: ${({ $hasCombobox }) => ($hasCombobox ? 'auto' : `${RowActionsContainerWithFadeWidth}px`)};\n position: ${({ $hasCombobox, $inDedicatedColumn }) =>\n $hasCombobox || $inDedicatedColumn ? 'static' : 'absolute'};\n right: ${Spacing[2]};\n top: 0;\n height: 100%;\n display: flex;\n gap: ${Spacing[1]};\n align-items: center;\n justify-content: end;\n transition: opacity ${TransitionDuration.Fast} ease-out;\n background: linear-gradient(\n to right,\n transparent,\n ${Color.BackgroundPrimary} ${BackgroundFadeWidth}px\n );\n\n /* Combobox cells render actions inline next to the caret. The padding-left\n keeps the caret↔first-action gap visually balanced with the gap between\n the actions themselves. */\n ${({ $hasCombobox }) =>\n $hasCombobox &&\n css`\n background: none;\n padding-right: ${Spacing[2]};\n padding-left: ${Spacing[1]};\n `}\n\n /* PinnedActionsCell is transparent (so scrolling content can pass under it);\n owning the right gutter here keeps the container's opaque gradient flush\n to the cell's right edge. */\n ${({ $inDedicatedColumn, $hasCombobox }) =>\n $inDedicatedColumn &&\n !$hasCombobox &&\n css`\n padding-right: ${Spacing[2]};\n `}\n\n /* Hide on hover only when delete is present (matches legacy behavior). */\n ${({ $hasDelete }) =>\n $hasDelete &&\n css`\n opacity: 0;\n `}\n\n /* Make room for both buttons; combobox cells use auto width so they can sit\n inline next to the caret. */\n ${({ $hasActions, $hasDelete, $hasCombobox }) =>\n $hasActions &&\n $hasDelete &&\n !$hasCombobox &&\n css`\n width: ${RowActionsContainerWithFadeWidth + parseInt(Spacing[1]) + IconButtonWidth}px;\n `}\n`;\n\ninterface RowActionsProps {\n actions?: RowAction[];\n onDelete?: () => void;\n /** When true, sizes/positions for the dedicated sticky trailing column. */\n inDedicatedColumn?: boolean;\n /** When true, sizes/positions inline alongside a combobox caret. */\n inCombobox?: boolean;\n}\n\n/**\n * Renders the actions menu and/or delete icon button inside a\n * `RowActionsContainer`. Used both as an absolute overlay inside the\n * last data cell (fixed-layout mode) and as static content inside the\n * dedicated sticky trailing column (horizontal scroll mode).\n */\nexport const RowActions = ({\n actions,\n onDelete,\n inDedicatedColumn,\n inCombobox,\n}: RowActionsProps) => {\n const hasActions = !!actions?.length;\n\n if (!hasActions && !onDelete) {\n return null;\n }\n return (\n <RowActionsContainer\n $hasActions={hasActions}\n $hasDelete={!!onDelete}\n $hasCombobox={inCombobox}\n $inDedicatedColumn={inDedicatedColumn}\n onClick={(e) => e.stopPropagation()}\n >\n {hasActions && (\n <DropdownMenu\n // Escape `PinnedActionsCell`'s stacking context — without portaling\n // subsequent rows' sticky cells paint over the menu.\n portal\n trigger={\n <IconButton aria-label='Actions'>\n <MoreIcon />\n </IconButton>\n }\n >\n {actions?.map(({ label, onClick, ...rest }) => (\n <DropdownMenu.Item key={label} {...rest} onClick={onClick} size='sm'>\n {label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n {onDelete && (\n <IconButton aria-label='Delete' onClick={onDelete}>\n <XIcon />\n </IconButton>\n )}\n </RowActionsContainer>\n );\n};\n","import { type FocusEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nconst ERROR_DELAY_MS = 500;\n\nconst isEditableTarget = (target: EventTarget | null) =>\n target instanceof HTMLElement && (target.matches('input, textarea') || target.isContentEditable);\n\nconst useDelayedInlineEditError = (errorText?: string) => {\n const errorTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const lastEditingEndAtRef = useRef<number | null>(null);\n const isEditingRef = useRef(false);\n const errorTextRef = useRef(errorText);\n errorTextRef.current = errorText;\n const [isErrorVisible, setIsErrorVisible] = useState(Boolean(errorText));\n\n const clearErrorTimer = useCallback(() => {\n if (errorTimerRef.current != null) {\n clearTimeout(errorTimerRef.current);\n errorTimerRef.current = null;\n }\n }, []);\n\n const scheduleError = useCallback(\n (delay = ERROR_DELAY_MS) => {\n clearErrorTimer();\n if (!errorTextRef.current) {\n return;\n }\n\n errorTimerRef.current = setTimeout(() => {\n if (errorTextRef.current && !isEditingRef.current) {\n setIsErrorVisible(true);\n }\n errorTimerRef.current = null;\n }, delay);\n },\n [clearErrorTimer],\n );\n\n useEffect(() => {\n if (!errorText) {\n clearErrorTimer();\n setIsErrorVisible(false);\n return;\n }\n\n if (isEditingRef.current) {\n setIsErrorVisible(false);\n return;\n }\n\n if (lastEditingEndAtRef.current == null) {\n clearErrorTimer();\n setIsErrorVisible(true);\n } else if (!isErrorVisible) {\n const elapsed = Date.now() - lastEditingEndAtRef.current;\n scheduleError(Math.max(0, ERROR_DELAY_MS - elapsed));\n }\n }, [clearErrorTimer, errorText, isErrorVisible, scheduleError]);\n\n useEffect(() => clearErrorTimer, [clearErrorTimer]);\n\n const onFocus = useCallback(\n (event: FocusEvent<HTMLElement>) => {\n if (!isEditableTarget(event.target)) {\n return;\n }\n\n isEditingRef.current = true;\n lastEditingEndAtRef.current = null;\n clearErrorTimer();\n setIsErrorVisible(false);\n },\n [clearErrorTimer],\n );\n\n const onEditingEnd = useCallback(() => {\n if (!isEditingRef.current) {\n return;\n }\n\n isEditingRef.current = false;\n lastEditingEndAtRef.current = Date.now();\n scheduleError();\n }, [scheduleError]);\n\n const onBlur = useCallback(\n (event: FocusEvent<HTMLElement>) => {\n if (!isEditableTarget(event.target)) {\n return;\n }\n\n onEditingEnd();\n },\n [onEditingEnd],\n );\n\n return { isErrorVisible, onBlur, onEditingEnd, onFocus };\n};\n\nexport default useDelayedInlineEditError;\n","import { type ComponentPropsWithoutRef, type FocusEvent, useContext } from 'react';\nimport styled from 'styled-components';\n\nimport { HStack } from '@persona/design-system/components/Stack';\nimport { TableCell } from '@persona/design-system/components/Table';\nimport Tooltip from '@persona/design-system/components/Tooltip';\nimport { paragraphMixins } from '@persona/design-system/mixins/text';\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport { CircleAlertIcon } from '@persona/icons/12px';\n\nimport InlineCombobox from './InlineCombobox';\nimport InlineInput from './InlineInput';\nimport { type InlineEditConfig, TableBoxContext } from './TableBox';\nimport { type RowAction, RowActions } from './TableBoxRowActions';\nimport { TableBoxRowContext } from './TableBoxRowContext';\nimport useDelayedInlineEditError from './useDelayedInlineEditError';\n\nexport interface TableBoxCellProps extends ComponentPropsWithoutRef<typeof TableCell> {\n /** The id of the item the cell belongs to */\n itemId?: string;\n /** Initial value for the cell */\n value?: string;\n /** The column key this cell belongs to. Used to look up the change handler from context. */\n columnKey?: string;\n /**\n * Error shown immediately until inline editing begins. Focusing the cell's editable input hides\n * the error, and ending the inline edit resurfaces it after 500ms.\n */\n errorText?: string;\n /**\n * Whether this is the last cell in the row. Set automatically by\n * `TableBoxRow` so that, in fixed-layout mode (no dedicated trailing\n * actions column), the cell can host the row's actions / delete button.\n */\n isLastCell?: boolean;\n /**\n * Row actions, only injected by `TableBoxRow` when actions live inside\n * the last data cell (fixed-layout mode).\n */\n actions?: RowAction[];\n /**\n * Delete handler, only injected by `TableBoxRow` when delete lives inside\n * the last data cell (fixed-layout mode).\n */\n onDelete?: (id: string | number) => void;\n /**\n * Cell-specific inline edit configuration.\n * Properties provided here will override the column-level configuration.\n * Useful for per-row customization of options, onChange handlers, etc.\n */\n inlineEditConfigOverride?: Partial<InlineEditConfig>;\n /** @internal Visible row-wide error injected into the first cell by `TableBoxRow`. */\n rowErrorText?: string;\n}\n\nconst CELL_VERTICAL_PADDING = Spacing[1];\nconst CELL_HEIGHT = `calc(${Typography.TextSmall.lineHeight} + (${CELL_VERTICAL_PADDING} * 2))`;\n\nconst StyledCell = styled(TableCell)<{ $noPadding?: boolean }>`\n ${paragraphMixins.sm};\n // height acts as min-height for table cells\n height: ${CELL_HEIGHT};\n padding: ${({ $noPadding }) => ($noPadding ? Spacing[0] : `${CELL_VERTICAL_PADDING} ${Spacing[2]}`)};\n border-bottom: 1px solid ${Color.BorderHairline};\n position: relative;\n`;\n\nconst StyledCellContent = styled.div`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-grow: 1;\n min-width: 0;\n`;\n\nconst CellErrorContainer = styled.span<{ $inset?: boolean }>`\n display: inline-block;\n line-height: ${Typography.TextSmall.lineHeight};\n margin-right: ${({ $inset }) => ($inset ? Spacing[0] : Spacing[1])};\n padding-left: ${({ $inset }) => ($inset ? Spacing[2] : Spacing[0])};\n position: relative;\n /* Optically center the 12px alert glyph against the text's visual bounds. */\n top: 1px;\n`;\n\nconst TableBoxCell = ({\n children,\n itemId = '',\n value = '',\n columnKey,\n errorText,\n isLastCell = false,\n actions,\n onDelete,\n inlineEditConfigOverride,\n rowErrorText,\n onBlur,\n onFocus,\n ...props\n}: TableBoxCellProps) => {\n const context = useContext(TableBoxContext);\n const rowContext = useContext(TableBoxRowContext);\n const {\n isErrorVisible,\n onBlur: handleDelayedErrorBlur,\n onEditingEnd: handleDelayedErrorEditingEnd,\n onFocus: handleDelayedErrorFocus,\n } = useDelayedInlineEditError(errorText);\n\n if (context == null) {\n throw new Error('TableBox context is not set');\n }\n\n const column = context.columns.find((c) => c.key === columnKey);\n const columnConfig = column?.inlineEditConfig;\n\n // Cell-level overrides shallow-merge over the column-level config.\n let inlineEditConfig =\n context.disabled || columnConfig == null\n ? undefined\n : inlineEditConfigOverride\n ? { ...columnConfig, ...inlineEditConfigOverride }\n : columnConfig;\n\n // Portal combobox dropdowns when the scroll container clips overflow\n // (`overflow-x: auto` from horizontal overflow, or `overflow-y: auto` from\n // maxHeight). When the table fits with no height cap we leave them\n // un-portaled to avoid ancestor RAC modals marking them aria-hidden.\n // fullWidthComboboxDropdown callers always need the portal.\n if (\n inlineEditConfig?.type === 'combobox' &&\n (context.clipsOverflow || inlineEditConfig?.fullWidthComboboxDropdown)\n ) {\n inlineEditConfig = {\n ...inlineEditConfig,\n useComboboxPortal: true,\n };\n }\n\n const handleDelete = () => {\n if (onDelete && itemId) {\n onDelete(itemId);\n }\n };\n\n const handleFocus = (event: FocusEvent<HTMLTableCellElement>) => {\n handleDelayedErrorFocus(event);\n onFocus?.(event);\n };\n\n const handleBlur = (event: FocusEvent<HTMLTableCellElement>) => {\n handleDelayedErrorBlur(event);\n onBlur?.(event);\n };\n\n const visibleErrorText = isErrorVisible && errorText ? errorText : rowErrorText;\n\n return (\n <StyledCell\n {...props}\n $noPadding={inlineEditConfig?.type === 'combobox'}\n tabIndex={-1}\n onBlur={handleBlur}\n onFocus={handleFocus}\n >\n <HStack align='center' spacing={Spacing[0]}>\n {visibleErrorText != null && (\n <CellErrorContainer $inset={inlineEditConfig?.type === 'combobox'}>\n <Tooltip\n aria-label={`Error: ${visibleErrorText}`}\n iconTrigger={<CircleAlertIcon color={Color.BorderIconDanger} size='12' />}\n side='top'\n size='sm'\n >\n {visibleErrorText}\n </Tooltip>\n </CellErrorContainer>\n )}\n {inlineEditConfig ? (\n inlineEditConfig.type === 'combobox' ? (\n <InlineCombobox\n itemId={itemId}\n value={value}\n columnKey={columnKey}\n inlineEditConfig={inlineEditConfig}\n rowRef={rowContext?.rowRef}\n hasLeadingError={visibleErrorText != null}\n >\n <StyledCellContent>{children}</StyledCellContent>\n </InlineCombobox>\n ) : (\n <InlineInput\n itemId={itemId}\n value={value}\n columnKey={columnKey}\n inlineEditConfig={inlineEditConfig}\n onEditingEnd={handleDelayedErrorEditingEnd}\n >\n {children}\n </InlineInput>\n )\n ) : (\n <StyledCellContent>{children}</StyledCellContent>\n )}\n {isLastCell && !context.disabled && (\n <RowActions\n actions={actions}\n onDelete={onDelete ? handleDelete : undefined}\n inCombobox={inlineEditConfig?.type === 'combobox'}\n />\n )}\n </HStack>\n </StyledCell>\n );\n};\n\nexport default TableBoxCell;\n","import { useSortable } from '@dnd-kit/sortable';\nimport {\n Children,\n cloneElement,\n type ComponentPropsWithoutRef,\n type FocusEvent,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { CaretButton } from '@persona/design-system/components/Combobox';\nimport { FormGroupContext } from '@persona/design-system/components/ConfigFormGroup';\nimport { Container as FormControlContainer } from '@persona/design-system/components/FormControl';\nimport type { MenuItemProps } from '@persona/design-system/components/Menu';\nimport Popover from '@persona/design-system/components/Popover';\nimport Stack from '@persona/design-system/components/Stack';\nimport { TableCell, TableRow } from '@persona/design-system/components/Table';\nimport { Z_INDICES } from '@persona/design-system/lib/zindex';\nimport { focusOutline } from '@persona/design-system/mixins/focus';\nimport { Elevation } from '@persona/design-system/variables/effect';\nimport { TransitionDuration } from '@persona/design-system/variables/transitions';\nimport { BorderRadius, Color, Spacing, Typography } from '@persona/design-tokens';\nimport { DragIcon } from '@persona/icons';\n\nimport { PinnedActionsCell, TableBoxContext } from './TableBox';\nimport { RowActions, RowActionsContainer } from './TableBoxRowActions';\nimport { TableBoxRowContext } from './TableBoxRowContext';\nimport useDelayedInlineEditError from './useDelayedInlineEditError';\nimport type { DragDirection } from './useTableBoxDragAndDrop';\n\nexport interface TableBoxRowProps extends ComponentPropsWithoutRef<typeof TableRow> {\n /**\n * Row-wide error shown immediately in the first cell until inline editing begins. Focusing any\n * editable input in the row hides the error, and ending the active inline edit resurfaces it\n * after 500ms.\n */\n errorText?: string;\n\n /**\n * Actions to display in a dropdown menu.\n * Supports all props from `MenuItem`.\n */\n actions?: Array<\n {\n label: string;\n onClick: () => void;\n } & Omit<MenuItemProps, 'children'>\n >;\n\n /**\n * Called when the delete (X) icon is clicked. Only renders item-level delete icon if this prop is present.\n * Receives the item's id as a parameter.\n */\n onDelete?: (id: string | number) => void;\n\n /**\n * Form fields to be rendered inside a row dropdown popover.\n * The configField prop will be set to true for all fields via FormGroupContext.\n * Dropdown will be opened when the row is selected.\n */\n dropdownFormFields?: ReactNode;\n\n /**\n * Content to be rendered inside the row dropdown popover.\n * Dropdown will be opened when the row is selected.\n */\n dropdownContent?: ReactNode;\n\n /**\n * Optional heading text to display in the row dropdown popover.\n * Either dropdownFormFields or dropdownContent must also be provided,\n * otherwise the dropdown will not be rendered.\n */\n dropdownHeadingText?: string;\n\n /**\n * Footer to be rendered inside the row dropdown popover.\n * Either dropdownFormFields or dropdownContent must also be provided,\n * otherwise the dropdown will not be rendered.\n */\n dropdownFooter?: ReactNode;\n}\n\nconst StyledRow = styled(TableRow)<{\n $isSelectable?: boolean;\n $isDragging?: boolean;\n $dropIndicatorPosition?: 'top' | 'bottom';\n}>`\n cursor: ${({ $isSelectable }) => ($isSelectable ? 'pointer' : 'default')};\n position: relative;\n /* Give every row a solid background so sticky first-column cells (which\n inherit the row's background) remain opaque during horizontal scroll. */\n background-color: ${Color.BackgroundPrimary};\n\n /* Dim the dragged row in place. A floating clone rendered by @dnd-kit's\n DragOverlay provides the fully-opaque representation that follows the\n pointer. */\n ${({ $isDragging }) =>\n $isDragging &&\n css`\n opacity: 0.5;\n `}\n\n /* 2px brand-colored drop indicator applied to each cell via inset\n box-shadow so the line spans the full row width without affecting\n layout. box-shadow on <td> renders reliably across modern browsers,\n unlike pseudo-elements on <tr>. */\n ${({ $dropIndicatorPosition, theme }) =>\n $dropIndicatorPosition === 'top' &&\n css`\n td {\n box-shadow: inset 0 2px 0 ${theme.color.text.brand};\n }\n `}\n\n ${({ $dropIndicatorPosition, theme }) =>\n $dropIndicatorPosition === 'bottom' &&\n css`\n td {\n box-shadow: inset 0 -2px 0 ${theme.color.text.brand};\n }\n `}\n\n ${CaretButton} {\n opacity: 0;\n transition: opacity ${TransitionDuration.Fast} ease-out;\n\n /* Allow button to shrink to caret SVG height and width, and adjust alignment to remain vertically centered */\n width: auto;\n height: auto;\n top: 50%;\n transform: translateY(-50%);\n }\n\n &:last-child {\n td {\n border-bottom: none;\n &:first-child {\n border-bottom-left-radius: ${BorderRadius.Md};\n }\n &:last-child {\n border-bottom-right-radius: ${BorderRadius.Md};\n }\n }\n }\n\n &[aria-selected='true'] {\n background: ${({ theme }) => theme.color.background.highlight};\n color: ${({ theme }) => theme.color.text.brand};\n }\n\n /* Hover and edit feedback is scoped to rows that respond to a pointer.\n Display-only tables (no selection, reordering, actions or inline editing)\n would otherwise read as clickable. */\n &[data-interactive] {\n &:hover:not([aria-selected='true']) {\n cursor: ${({ $isSelectable }) => ($isSelectable ? 'pointer' : 'default')};\n color: ${({ theme }) => theme.color.text.primary};\n background: ${Color.BackgroundSecondary};\n\n ${RowActionsContainer} {\n opacity: 1;\n background: linear-gradient(to right, transparent, ${Color.BackgroundSecondary} 12px);\n }\n\n ${CaretButton} {\n opacity: 1;\n }\n }\n\n &:has(input:focus),\n &:has(textarea:focus),\n &:has(input[role='combobox'][aria-expanded='true']),\n &:has(input:focus):hover,\n &:has(textarea:focus):hover,\n &:has(input[role='combobox'][aria-expanded='true']):hover,\n &:has(button:focus),\n &:has(button:focus):hover {\n color: ${({ theme }) => theme.color.text.brand};\n background-color: ${({ theme }) => theme.color.background.highlight};\n\n ${RowActionsContainer} {\n opacity: 1;\n background: linear-gradient(\n to right,\n transparent,\n ${({ theme }) => theme.color.background.highlight} ${parseInt(Spacing[3])}px\n );\n }\n\n ${CaretButton} {\n opacity: 1;\n }\n }\n\n /* In fixed-layout mode the actions overlay lives inside the furthest-right\n column's cell, so revealing the delete (X) on focus would park it on top\n of the text being edited. While that column's inline input holds focus,\n keep it hidden; hovering the row still brings it back. */\n &:not(:hover):has(\n td:last-child :is(input:not([role='combobox']), textarea):focus\n ) {\n ${RowActionsContainer} {\n opacity: 0;\n }\n }\n }\n`;\n\nconst DragHandleCell = styled(TableCell)`\n width: 24px;\n padding: ${Spacing[0]} ${Spacing[1]};\n border-bottom: 1px solid ${Color.BorderHairline};\n vertical-align: middle;\n text-align: center;\n`;\n\n// The `grabbing` cursor during an active drag is applied globally via\n// `document.body.style.cursor` in TableBox, so this button only needs to\n// declare the resting `grab` cursor. `:active` covers the brief interval\n// between mousedown and dnd-kit promoting it to an active drag.\nconst DragHandleButton = styled.button.attrs({ type: 'button' })`\n background: none;\n border: none;\n padding: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: grab;\n touch-action: none;\n color: ${Color.TextSecondary};\n ${focusOutline}\n\n &:hover {\n color: ${Color.TextPrimary};\n }\n\n &:active {\n cursor: grabbing;\n }\n`;\n\nconst DropdownPopoverHeading = styled.div`\n ${Typography.TextSmallBold};\n border-bottom: 1px solid ${Color.BorderHairline};\n padding: ${Spacing[2]} ${Spacing[3]} ${Spacing[1]};\n`;\n\nconst DropdownPopoverContent = styled(Stack)`\n min-width: var(--radix-popover-trigger-width);\n padding: ${Spacing[3]};\n\n ${FormControlContainer} {\n min-width: 0;\n }\n`;\n\nconst DropdownPopoverFooter = styled.div`\n border-top: 1px solid ${Color.BorderHairline};\n padding: ${Spacing[1]};\n`;\n\ntype SortableTableBoxRowContentProps = Omit<ComponentPropsWithoutRef<typeof StyledRow>, 'ref'> & {\n id: string | number;\n isSelected: boolean;\n isSelectable: boolean;\n onClick: () => void;\n rowRef: React.MutableRefObject<HTMLTableRowElement | null>;\n draggedDirection: DragDirection;\n};\n\n/**\n * Computes the drop-indicator position for a sortable row. Direction mirrors\n * `HoverCardPropertiesEditTable` / `ListBox`: dragging from above places the\n * line on the hovered row's bottom edge, dragging from below places it on the\n * top edge. The dragged row itself never shows an indicator.\n *\n * `closestCenter` has a \"dead zone\" while the pointer is still over the\n * dragged row's own slot (`overIndex === activeIndex`). We use the drag\n * direction to show the indicator on the immediate neighbor so the\n * \"immediately before/after original\" positions still get feedback.\n */\nconst getDropIndicatorPosition = ({\n isDragging,\n index,\n activeIndex,\n overIndex,\n draggedDirection,\n}: {\n isDragging: boolean;\n index: number;\n activeIndex: number;\n overIndex: number;\n draggedDirection: DragDirection;\n}): 'top' | 'bottom' | undefined => {\n if (isDragging || activeIndex === -1) {\n return undefined;\n }\n if (overIndex === index && overIndex !== activeIndex) {\n return activeIndex < index ? 'bottom' : 'top';\n }\n if (overIndex === activeIndex) {\n if (draggedDirection === 'up' && index === activeIndex - 1) {\n return 'bottom';\n }\n if (draggedDirection === 'down' && index === activeIndex + 1) {\n return 'top';\n }\n }\n return undefined;\n};\n\n/**\n * Inner row component used when drag-and-drop is enabled on the parent\n * TableBox. Subscribes to the surrounding SortableContext via useSortable and\n * renders a leading drag-handle cell.\n */\nconst SortableTableBoxRowContent = ({\n id,\n isSelected,\n isSelectable,\n onClick,\n rowRef,\n draggedDirection,\n children,\n ...props\n}: SortableTableBoxRowContentProps) => {\n const { attributes, listeners, setNodeRef, isDragging, activeIndex, overIndex, index } =\n useSortable({ id: String(id) });\n\n const setRefs = (element: HTMLTableRowElement | null) => {\n rowRef.current = element;\n setNodeRef(element);\n };\n\n const dropIndicatorPosition = getDropIndicatorPosition({\n isDragging,\n index,\n activeIndex,\n overIndex,\n draggedDirection,\n });\n\n return (\n <StyledRow\n {...props}\n ref={setRefs}\n id={String(id)}\n onClick={onClick}\n disableHoverBackground={true}\n aria-selected={isSelected}\n $isSelectable={isSelectable}\n $isDragging={isDragging}\n $dropIndicatorPosition={dropIndicatorPosition}\n >\n <DragHandleCell>\n <DragHandleButton\n aria-label='Drag to reorder'\n {...attributes}\n {...listeners}\n onClick={(e) => e.stopPropagation()}\n >\n <DragIcon />\n </DragHandleButton>\n </DragHandleCell>\n {children}\n </StyledRow>\n );\n};\n\nconst TableBoxRow = ({\n children,\n actions,\n onDelete,\n errorText,\n id,\n dropdownFormFields,\n dropdownContent,\n dropdownHeadingText,\n dropdownFooter,\n onBlur,\n onFocus,\n ...props\n}: TableBoxRowProps) => {\n const context = useContext(TableBoxContext);\n const isSelected = context?.selectedKey === (id as string);\n const isSelectable = context?.selectionMode === 'single';\n const isReorderable = context?.isReorderable ?? false;\n const rowRegistry = context?.rowRegistry ?? null;\n const draggedDirection = context?.draggedDirection ?? null;\n const hasActionsColumn = context?.hasActionsColumn ?? false;\n const isDisabled = context?.disabled ?? false;\n const rowRef = useRef<HTMLTableRowElement>(null);\n const {\n isErrorVisible,\n onBlur: handleDelayedErrorBlur,\n onEditingEnd: handleDelayedErrorEditingEnd,\n onFocus: handleDelayedErrorFocus,\n } = useDelayedInlineEditError(errorText);\n const effectiveActions = isDisabled ? undefined : actions;\n const effectiveOnDelete = isDisabled ? undefined : onDelete;\n const hasRowDropdown = Boolean(dropdownFormFields || dropdownContent);\n // A disabled table keeps its rows viewable and selectable; only inline\n // editing stops, and reordering and actions are already suppressed above.\n const hasInlineEditableColumn =\n !isDisabled && (context?.columns?.some((column) => column.inlineEditConfig != null) ?? false);\n // A row dropdown opens through selection, so it never adds interactivity that\n // `isSelectable` does not already cover.\n const isInteractive =\n isSelectable ||\n isReorderable ||\n hasInlineEditableColumn ||\n (effectiveActions?.length ?? 0) > 0 ||\n effectiveOnDelete != null;\n const dataCells = Children.toArray(children).filter(\n (child): child is ReactElement<{ value?: string }> => isValidElement<{ value?: string }>(child),\n );\n const areOtherCellsBlank = dataCells.slice(1).every((cell) => cell.props.value === '');\n\n const handleFocus = (event: FocusEvent<HTMLTableRowElement>) => {\n handleDelayedErrorFocus(event);\n onFocus?.(event);\n };\n\n const handleBlur = (event: FocusEvent<HTMLTableRowElement>) => {\n handleDelayedErrorBlur(event);\n onBlur?.(event);\n };\n\n const handleClick = () => {\n if (context?.onRowClick && id && isSelectable) {\n context.onRowClick(id as string);\n }\n };\n\n const handleDelete = useCallback(() => {\n if (effectiveOnDelete && id != null) {\n effectiveOnDelete(id);\n }\n }, [effectiveOnDelete, id]);\n const rowContextValue = useMemo(\n () => ({\n rowRef,\n onDelete: effectiveOnDelete && id != null ? handleDelete : undefined,\n onEditingEnd: handleDelayedErrorEditingEnd,\n areOtherCellsBlank,\n }),\n [areOtherCellsBlank, effectiveOnDelete, handleDelayedErrorEditingEnd, handleDelete, id],\n );\n\n // When the last data column is a combobox, lay out the dedicated actions\n // cell with `width: auto` so the caret↔actions gap matches the\n // actions↔delete gap instead of `justify-content: end` parking all the\n // slack on the left.\n const lastColumnIsCombobox = context?.columns?.at(-1)?.inlineEditConfig?.type === 'combobox';\n\n // In horizontal-scroll mode (default) actions live in a dedicated trailing\n // sticky cell. In `disableHorizontalScroll` (legacy) mode there is no\n // trailing column, so we instead inject `actions`/`onDelete`/`itemId`/\n // `isLastCell` into the last data cell via `cloneElement` so the cell can\n // overlay them on top of its content.\n const trailingActionsCell = useMemo(\n () =>\n hasActionsColumn ? (\n <PinnedActionsCell>\n <RowActions\n actions={effectiveActions}\n onDelete={effectiveOnDelete ? handleDelete : undefined}\n inDedicatedColumn\n inCombobox={lastColumnIsCombobox}\n />\n </PinnedActionsCell>\n ) : null,\n [hasActionsColumn, effectiveActions, effectiveOnDelete, handleDelete, lastColumnIsCombobox],\n );\n\n const renderedChildren = useMemo(() => {\n if (hasActionsColumn && !isErrorVisible) {\n return children;\n }\n\n const childrenArray = Children.toArray(children);\n const firstChildIndex = isErrorVisible ? childrenArray.findIndex(isValidElement) : -1;\n const lastChildIndex = childrenArray.length - 1;\n return childrenArray.map((child, index) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n const isFirstCell = index === firstChildIndex;\n const isLastCell = !hasActionsColumn && index === lastChildIndex;\n if (!isFirstCell && !isLastCell) {\n return child;\n }\n\n return cloneElement(child as ReactElement, {\n ...(isFirstCell && { rowErrorText: errorText }),\n ...(isLastCell && {\n isLastCell: true,\n actions: effectiveActions,\n onDelete: effectiveOnDelete,\n }),\n // The cell-side `handleDelete` falsy-checks `itemId` before invoking\n // `onDelete`, so we must seed it from the row id — otherwise delete\n // in fixed-layout mode silently no-ops.\n ...(isLastCell && id != null && { itemId: String(id) }),\n });\n });\n }, [\n hasActionsColumn,\n children,\n effectiveActions,\n effectiveOnDelete,\n errorText,\n id,\n isErrorVisible,\n ]);\n\n // Provider sits between `<tr>` and the `<td>` cells (a React-only wrapper)\n // so the row itself is still a single DOM element. This matters for the\n // Popover trigger below: Radix's `<PopoverTrigger asChild>` clones the\n // trigger element to attach a ref, and `Context.Provider` doesn't forward\n // refs, so we cannot wrap the whole row with the Provider.\n const rowChildrenWithContext = useMemo(\n () => (\n <TableBoxRowContext.Provider value={rowContextValue}>\n {renderedChildren}\n {trailingActionsCell}\n </TableBoxRowContext.Provider>\n ),\n [renderedChildren, trailingActionsCell, rowContextValue],\n );\n\n // Register the row's content with the drag overlay registry so the\n // `DragOverlay` clone can mirror this row when it becomes active. Updating\n // in an effect (rather than during render) keeps render side-effect-free.\n // The registered subtree includes the `TableBoxRowContext` provider so the\n // overlay clone's cells can still resolve `rowRef` (used by inline\n // comboboxes with `fullWidthComboboxDropdown`).\n useEffect(() => {\n if (!rowRegistry || id == null) {\n return undefined;\n }\n const key = String(id);\n const registry = rowRegistry.current;\n registry.set(key, rowChildrenWithContext);\n return () => {\n registry.delete(key);\n };\n }, [id, rowChildrenWithContext, rowRegistry]);\n\n const rowContent = isReorderable ? (\n <SortableTableBoxRowContent\n {...props}\n data-interactive={isInteractive || undefined}\n id={id as string | number}\n isSelected={isSelected}\n isSelectable={isSelectable}\n onClick={handleClick}\n onBlur={handleBlur}\n onFocus={handleFocus}\n rowRef={rowRef}\n draggedDirection={draggedDirection}\n >\n {rowChildrenWithContext}\n </SortableTableBoxRowContent>\n ) : (\n <StyledRow\n {...props}\n data-interactive={isInteractive || undefined}\n ref={rowRef}\n id={id}\n onClick={handleClick}\n onBlur={handleBlur}\n onFocus={handleFocus}\n disableHoverBackground={true}\n aria-selected={isSelected}\n $isSelectable={isSelectable}\n >\n {rowChildrenWithContext}\n </StyledRow>\n );\n\n if (hasRowDropdown) {\n return (\n <Popover trigger={rowContent} open={isSelected}>\n <Popover.Card\n id={context?.rowDropdownId}\n noPadding\n style={{ zIndex: Z_INDICES.modalDropdown }}\n >\n {dropdownHeadingText && (\n <DropdownPopoverHeading>{dropdownHeadingText}</DropdownPopoverHeading>\n )}\n {dropdownFormFields && (\n <DropdownPopoverContent spacing={Spacing[2]}>\n <FormGroupContext.Provider\n value={{\n configField: true,\n labelTooltipZIndex: Z_INDICES.modalDropdownTooltip,\n }}\n >\n {dropdownFormFields}\n </FormGroupContext.Provider>\n </DropdownPopoverContent>\n )}\n {dropdownContent && (\n <DropdownPopoverContent spacing={Spacing[3]}>{dropdownContent}</DropdownPopoverContent>\n )}\n {dropdownFooter && <DropdownPopoverFooter>{dropdownFooter}</DropdownPopoverFooter>}\n </Popover.Card>\n </Popover>\n );\n }\n\n return rowContent;\n};\n\n// Styled wrapper that lets a single `<tr>` be portaled by dnd-kit's\n// DragOverlay while preserving the TableBox's table-based styling. Uses\n// `table-layout: fixed` so the widths declared in the accompanying\n// `<colgroup>` are authoritative and columns line up 1:1 with the source\n// row (which would otherwise re-flow via auto layout).\nconst OverlayTable = styled.table`\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n border: 1px solid ${Color.BorderDivider};\n border-radius: ${BorderRadius.Md};\n background: ${Color.BackgroundPrimary};\n box-shadow: ${Elevation.High};\n`;\n\n/**\n * Visual clone of a `TableBoxRow` used inside `@dnd-kit`'s `DragOverlay`.\n * Renders a minimal table wrapper with a static drag-handle cell followed by\n * the original row's cells, so the portaled overlay looks identical to the\n * dragged row while it follows the pointer.\n *\n * `cellWidths` is the measured width (in px) of each `<td>` in the source\n * row at drag start, in source order (drag handle cell first, then content\n * cells). Applied via a `<colgroup>` with `table-layout: fixed` so the\n * overlay's columns align 1:1 with the source table instead of re-flowing\n * to the single row's content.\n */\nexport const TableBoxRowOverlay = ({\n children,\n cellWidths,\n}: {\n children: ReactNode;\n cellWidths: number[];\n}) => (\n <OverlayTable aria-hidden='true'>\n <colgroup>\n {cellWidths.map((width, i) => (\n <col key={i} style={{ width: `${width}px` }} />\n ))}\n </colgroup>\n <tbody>\n <StyledRow data-interactive disableHoverBackground={true}>\n <DragHandleCell>\n <DragHandleButton tabIndex={-1} aria-hidden='true'>\n <DragIcon />\n </DragHandleButton>\n </DragHandleCell>\n {children}\n </StyledRow>\n </tbody>\n </OverlayTable>\n);\n\nexport default TableBoxRow;\n","import { type RefObject, useCallback, useState } from 'react';\n\ninterface UseColumnWidthLockOptions {\n /**\n * When false, the hook becomes a no-op — `lockedColWidths` stays `null`\n * and `setColumnWidthsLocked` does nothing. Use when the table is already in\n * `table-layout: fixed` mode, where the input swap can't reflow columns.\n */\n enabled?: boolean;\n}\n\n/**\n * Captures the live `<th>` widths of a table the moment inline editing starts\n * and clears them when editing ends.\n *\n * Consumers render a `<colgroup>` from `lockedColWidths` and switch the table\n * to `table-layout: fixed` for the duration of the edit so the input swap\n * doesn't reflow the columns.\n */\nexport const useColumnWidthLock = (\n tableRef: RefObject<HTMLTableElement>,\n { enabled = true }: UseColumnWidthLockOptions = {},\n) => {\n const [lockedColWidths, setLockedColWidths] = useState<number[] | null>(null);\n\n const setColumnWidthsLocked = useCallback(\n (isLocked: boolean) => {\n if (!enabled) {\n return;\n }\n if (!isLocked) {\n setLockedColWidths(null);\n return;\n }\n const ths = Array.from(\n tableRef.current?.querySelectorAll<HTMLTableCellElement>(':scope > thead > tr > th') ?? [],\n );\n if (ths.length > 0) {\n setLockedColWidths(ths.map((th) => th.getBoundingClientRect().width));\n }\n },\n [tableRef, enabled],\n );\n\n return { lockedColWidths, setColumnWidthsLocked };\n};\n","import {\n closestCenter,\n type DndContextProps,\n type DragEndEvent,\n type DragMoveEvent,\n type DragStartEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport { sortableKeyboardCoordinates } from '@dnd-kit/sortable';\nimport {\n type ReactNode,\n type RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { findIndexByKey, moveItemByIndex } from '@persona/design-system/lib/reorderItems';\n\n/**\n * Vertical direction of an active drag relative to its starting position.\n * `null` means the pointer hasn't moved far enough from the drag origin to\n * infer a direction.\n */\nexport type DragDirection = 'up' | 'down' | null;\n\n// Small threshold so tiny pointer jitter at rest doesn't toggle the\n// indicator on and off.\nconst DRAG_DIRECTION_THRESHOLD = 4;\n\nexport interface ReorderConfig<T extends object> {\n items: T[];\n itemKeyPath: keyof T & string;\n onReorder: (reorderedItems: T[]) => void;\n}\n\ninterface UseTableBoxDragAndDropArgs<T extends object> {\n tableRef: RefObject<HTMLTableElement>;\n reorderConfig: ReorderConfig<T> | undefined;\n}\n\ninterface UseTableBoxDragAndDropResult {\n /**\n * `id` of the row currently being dragged, or `null` when no drag is active.\n * Use this to derive the DragOverlay content via the `rowRegistry`.\n */\n activeId: string | null;\n /**\n * Cell widths captured at drag start, in source order. Apply via a\n * `<colgroup>` with `table-layout: fixed` on the overlay table so its\n * columns line up 1:1 with the source row.\n */\n overlayCellWidths: number[] | null;\n /**\n * Current vertical direction of the active drag. Rows use this to place\n * the drop indicator on a neighbor when the pointer is still within the\n * dragged row's slot.\n */\n draggedDirection: DragDirection;\n /**\n * Sortable ids in source order. Pass to the `SortableContext`'s `items`.\n */\n sortableIds: string[];\n /**\n * Registry of row content keyed by row id, populated by each `TableBoxRow`\n * and read when rendering the DragOverlay clone. Always non-null when\n * drag-and-drop is enabled (i.e. `reorderConfig` is set).\n */\n rowRegistry: React.MutableRefObject<Map<string, ReactNode>>;\n /**\n * Spread on `DndContext`. Includes sensors, collision detection, and the\n * lifecycle handlers that update the rest of this hook's state.\n */\n dndContextProps: Pick<\n DndContextProps,\n 'sensors' | 'collisionDetection' | 'onDragStart' | 'onDragMove' | 'onDragEnd' | 'onDragCancel'\n >;\n}\n\n/**\n * Bundles the `@dnd-kit` wiring TableBox needs to support row reordering:\n * sensors, lifecycle handlers, the dragged row's overlay content, and the\n * pointer direction used by rows to position drop indicators in dnd-kit's\n * \"dead zone\" (overIndex === activeIndex).\n *\n * Also forces a `grabbing` cursor on `<body>` while a row is active so the\n * cursor persists when the pointer leaves the drag handle.\n */\nexport const useTableBoxDragAndDrop = <T extends object>({\n tableRef,\n reorderConfig,\n}: UseTableBoxDragAndDropArgs<T>): UseTableBoxDragAndDropResult => {\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),\n );\n\n const rowRegistry = useRef<Map<string, ReactNode>>(new Map());\n const [activeId, setActiveId] = useState<string | null>(null);\n const [draggedDirection, setDraggedDirection] = useState<DragDirection>(null);\n const [overlayCellWidths, setOverlayCellWidths] = useState<number[] | null>(null);\n\n useEffect(() => {\n if (activeId == null) {\n return undefined;\n }\n const previous = document.body.style.cursor;\n document.body.style.cursor = 'grabbing';\n return () => {\n document.body.style.cursor = previous;\n };\n }, [activeId]);\n\n const sortableIds = useMemo(() => {\n if (!reorderConfig) {\n return [];\n }\n return reorderConfig.items.map((item) => String(item[reorderConfig.itemKeyPath]));\n }, [reorderConfig]);\n\n const handleDragStart = useCallback(\n (event: DragStartEvent) => {\n const id = String(event.active.id);\n setActiveId(id);\n setDraggedDirection(null);\n\n // Scope to tableRef so we don't match unrelated elements sharing the id.\n const rowElement = tableRef.current?.querySelector<HTMLTableRowElement>(\n `tr[id=\"${CSS.escape(id)}\"]`,\n );\n if (rowElement) {\n const widths = Array.from(rowElement.children)\n .filter((child): child is HTMLTableCellElement => child.tagName === 'TD')\n .map((td) => td.getBoundingClientRect().width);\n setOverlayCellWidths(widths);\n } else {\n setOverlayCellWidths(null);\n }\n },\n [tableRef],\n );\n\n const handleDragMove = useCallback((event: DragMoveEvent) => {\n const { y } = event.delta;\n const next: DragDirection =\n y < -DRAG_DIRECTION_THRESHOLD ? 'up' : y > DRAG_DIRECTION_THRESHOLD ? 'down' : null;\n setDraggedDirection((prev) => (prev === next ? prev : next));\n }, []);\n\n const resetDragState = useCallback(() => {\n setActiveId(null);\n setDraggedDirection(null);\n setOverlayCellWidths(null);\n }, []);\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n resetDragState();\n if (!reorderConfig) {\n return;\n }\n const { active, over } = event;\n if (!over || active.id === over.id) {\n return;\n }\n const { items, itemKeyPath, onReorder } = reorderConfig;\n const fromIndex = findIndexByKey(items, itemKeyPath, String(active.id));\n const toIndex = findIndexByKey(items, itemKeyPath, String(over.id));\n if (fromIndex === -1 || toIndex === -1) {\n return;\n }\n onReorder(moveItemByIndex(items, fromIndex, toIndex));\n },\n [reorderConfig, resetDragState],\n );\n\n return {\n activeId,\n overlayCellWidths,\n draggedDirection,\n sortableIds,\n rowRegistry,\n dndContextProps: {\n sensors,\n collisionDetection: closestCenter,\n onDragStart: handleDragStart,\n onDragMove: handleDragMove,\n onDragEnd: handleDragEnd,\n onDragCancel: resetDragState,\n },\n };\n};\n","import { DndContext, DragOverlay } from '@dnd-kit/core';\nimport { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';\nimport { uniqueId } from 'lodash-es';\nimport {\n createContext,\n type PropsWithChildren,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { ComboboxOptionsOrGroups } from '@persona/design-system/components/Combobox';\nimport Table, {\n TableBody,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableRow,\n} from '@persona/design-system/components/Table';\nimport { useScrollOverflow } from '@persona/design-system/lib/useScrollOverflow';\nimport { Z_INDICES } from '@persona/design-system/lib/zindex';\nimport { focusOutline } from '@persona/design-system/mixins/focus';\nimport { paragraphMixins } from '@persona/design-system/mixins/text';\nimport { TransitionDuration } from '@persona/design-system/variables/transitions';\nimport { BorderRadius, Color, Spacing, Typography } from '@persona/design-tokens';\n\nimport TableBoxCell from './TableBoxCell';\nimport TableBoxRow, { TableBoxRowOverlay } from './TableBoxRow';\nimport { RowActionsContainerWithFadeWidth } from './TableBoxRowActions';\nimport { useColumnWidthLock } from './useColumnWidthLock';\nimport {\n type DragDirection,\n type ReorderConfig,\n useTableBoxDragAndDrop,\n} from './useTableBoxDragAndDrop';\n\nexport type { DragDirection } from './useTableBoxDragAndDrop';\n\nexport interface InlineEditConfig {\n type: 'text' | 'combobox';\n options?: ComboboxOptionsOrGroups;\n /**\n * Whether to render the combobox dropdown in a portal (breaks out of overflow containers)\n */\n useComboboxPortal?: boolean;\n /**\n * When true, the combobox dropdown will use the table row as the containerRef,\n * allowing the dropdown to span the full width of the row. Passing true will also\n * automatically set useComboboxPortal to true, since the positioning logic relies on\n * portaling. Defaults to false.\n */\n fullWidthComboboxDropdown?: boolean;\n /**\n * Whether to support multiline text input. When true, renders a textarea instead of input.\n * Default state: limits display to 2 lines with ellipsis.\n * Focused/editing state: expands to show all lines.\n * Only applies when type is 'text'. Defaults to false.\n */\n multiline?: boolean;\n /** Ellipsize the closed-state display instead of letting it overflow. Combobox only; off by default to preserve existing layouts. */\n truncateDisplay?: boolean;\n placeholder?: string;\n onChange: (id: string, value: string) => void;\n}\n\ninterface TableBoxContextValue {\n disabled: boolean;\n newRowId?: string | null;\n columns: Array<{\n key: string;\n title: string;\n inlineEditConfig?: InlineEditConfig;\n }>;\n selectedKey: string | null;\n selectionMode: 'single' | 'none';\n onRowClick: (rowId: string) => void;\n tableBoxId: string;\n rowDropdownId: string;\n /**\n * True when the TableBox has a `reorderConfig` set. Rows use this to know\n * whether to render a leading drag-handle cell and wire up `useSortable`.\n */\n isReorderable: boolean;\n /**\n * Current vertical direction of the active drag, or `null` when no drag is\n * in progress. Rows use this to position the drop indicator on a neighbor\n * when the pointer is in dnd-kit's \"dead zone\" (`overIndex === activeIndex`).\n */\n draggedDirection: DragDirection;\n /**\n * Registry of row content keyed by row id. Rows write their content here so\n * the DragOverlay can render the dragged row. `null` when reordering is\n * disabled.\n */\n rowRegistry: React.MutableRefObject<Map<string, React.ReactNode>> | null;\n /**\n * True when the TableBox renders a dedicated sticky trailing column for\n * row actions. False when `disableHorizontalScroll` is set, in which case\n * actions are injected into the last data cell instead.\n */\n hasActionsColumn: boolean;\n /**\n * True when the scroll container is using `overflow-x: auto`. Drives the\n * sticky-column edge shadow and right-edge fade affordance.\n */\n hasHorizontalOverflow: boolean;\n /**\n * True when the scroll container clips overflowing content — either\n * because content is wider than the box (`overflow-x: auto`) or because\n * `maxHeight` forced `overflow-y: auto` (which also computes\n * `overflow-x: visible` to `auto` per CSS Overflow §3). Cells force\n * inline-edit combobox dropdowns into a portal in this case so they\n * aren't clipped.\n */\n clipsOverflow: boolean;\n /**\n * Locks or unlocks measured column widths (`table-layout: fixed`) so\n * inline-edit input swaps don't cause a layout reflow.\n */\n setColumnWidthsLocked: (isLocked: boolean) => void;\n /** Schedules row creation after the current inline edit has rendered. */\n scheduleCreateNewRowAfterCommit?: () => void;\n}\n\nexport const TableBoxContext = createContext<TableBoxContextValue | null>(null);\n\nexport interface TableBoxProps<T extends object = object> {\n /** Text to display if no rows are available. */\n emptyText?: string;\n /** Selected key for the table. */\n selectedKey?: string | null;\n /** Default selected key for the table (uncontrolled mode). */\n defaultSelectedKey?: string | null;\n /** Called when selection changes. */\n onSelectionChange?: (selectedKey: string | null) => void;\n /**\n * Selection mode for the table. 'single' allows one row to be selected at a time,\n * 'none' disables row selection entirely.\n */\n selectionMode?: 'single' | 'none';\n /** ARIA label for the table. */\n 'aria-label': string;\n /** Column definitions for the table headers. */\n columns: Array<{\n key: string;\n title: string;\n /** Inline edit configuration for this column */\n inlineEditConfig?: InlineEditConfig;\n }>;\n /** ID of the newly created row that should be focused */\n newRowId?: string | null;\n /** Creates a row after a single-line inline edit is committed with Enter. */\n onCreateNewRow?: () => void;\n /** When true, table content remains viewable but row mutations and inline editing are disabled. */\n disabled?: boolean;\n /**\n * Opt out of the horizontally-scrolling layout and restore the legacy\n * behavior where the table is locked to its container width and long cell\n * values are truncated (`table-layout: fixed`, `width: 100%`, no sticky\n * first column, no horizontal overflow).\n *\n * Use this for callers that expect the table to always fit inside a\n * narrow container and don't benefit from a scroll affordance — e.g.\n * small summary tables whose content is known to fit.\n *\n * Defaults to `false` (horizontal scrolling + sticky first column).\n * Automatically forced to `true` when any column declares\n * `inlineEditConfig`, since inline editing requires a stable\n * non-scrolling layout.\n */\n disableHorizontalScroll?: boolean;\n /**\n * When provided, enables drag and drop row reordering. Mirrors the\n * `reorderConfig` API on `ListBox`, but since `TableBox` renders rows from\n * children rather than an `items` prop, the item array lives inside\n * `reorderConfig`.\n */\n reorderConfig?: ReorderConfig<T>;\n /**\n * Hide the column header row. Useful for single-column tables where the\n * surrounding `FormField` label already describes the data, so the column\n * title would be visually redundant.\n *\n * When true, the first body row's top corners are rounded to match the\n * outer container, since there's no header cell to provide that rounding.\n *\n * Defaults to `false`.\n */\n hideHeader?: boolean;\n /**\n * Caps the table body height and scrolls vertically inside the bordered\n * container. The column header stays pinned while rows scroll.\n */\n maxHeight?: number | string;\n}\n\n// Must match `DragHandleHeaderCell`/`DragHandleCell` so the sticky offset aligns.\nconst DRAG_HANDLE_CELL_WIDTH = 24;\n\nconst RIGHT_FADE_WIDTH = 48;\n\n// Must match `TableScrollContainer`'s border so the fades sit flush inside it.\nconst CONTAINER_BORDER_WIDTH_PX = 1;\n\n// Paint order for the overlapping pieces, lowest first — compose from\n// Z_INDICES.sticky per lib/zindex.ts. Each fade strip is layered against the\n// row band it covers: the body fade stays under the row actions so buttons\n// remain legible, while the header fade tops the stack because the header band\n// holds no interactive content.\nconst STICKY_COLUMN_Z_INDEX = Z_INDICES.sticky;\nconst BODY_FADE_Z_INDEX = Z_INDICES.sticky + 1;\nconst PINNED_ACTIONS_Z_INDEX = Z_INDICES.sticky + 2;\nconst STICKY_HEADER_Z_INDEX = Z_INDICES.sticky + 3;\nconst STICKY_CORNER_Z_INDEX = Z_INDICES.sticky + 4;\nconst HEADER_FADE_Z_INDEX = Z_INDICES.sticky + 5;\n\n// Spacing[1] top/bottom padding and 1px border from TableHeaderCell, plus\n// line height (which never wraps).\nconst HEADER_HEIGHT_PX =\n parseInt(Spacing[1], 10) * 2 + parseInt(Typography.TextSmall.lineHeight, 10) + 1;\n\n// `overflow-x` stays `visible` until overflow is detected so inline combobox\n// dropdowns can escape without portaling (portaled dropdowns get aria-hidden by\n// ancestor RAC modals). `overflow-y` stays `visible` unless `maxHeight` is set\n// — pairing `overflow-y: auto` with `overflow-x: visible` would compute both\n// axes to `auto` (CSS Overflow §3) and clip those same dropdowns.\nconst TableScrollContainer = styled.div<{\n $fixedLayout: boolean;\n $hasHorizontalOverflow: boolean;\n $maxHeight?: number | string;\n}>`\n border: ${CONTAINER_BORDER_WIDTH_PX}px solid ${Color.BorderDivider};\n border-radius: ${BorderRadius.Md};\n overflow-x: ${({ $fixedLayout, $hasHorizontalOverflow }) =>\n $fixedLayout ? 'visible' : $hasHorizontalOverflow ? 'auto' : 'visible'};\n overflow-y: ${({ $maxHeight }) => ($maxHeight != null ? 'auto' : 'visible')};\n overscroll-behavior-x: none;\n ${({ $maxHeight }) =>\n $maxHeight != null &&\n css`\n max-height: ${typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n `}\n`;\n\n// Anchors the fade overlay outside the scroll container. Anchoring it to the\n// container itself would make it scroll along with the table content.\nconst ScrollAffordanceWrapper = styled.div`\n position: relative;\n`;\n\n// Right-edge fade affordance. The header and body bands fade to their own\n// backgrounds and are split into separate strips so each can be layered against\n// the content it covers. The 1px gap between them keeps the <thead>'s bottom\n// border uninterrupted.\nconst RightFadeOverlay = styled.div<{ $visible: boolean; $scrollbarWidth: number }>`\n position: absolute;\n right: ${({ $scrollbarWidth }) => CONTAINER_BORDER_WIDTH_PX + $scrollbarWidth}px;\n width: ${RIGHT_FADE_WIDTH}px;\n pointer-events: none;\n opacity: ${({ $visible }) => ($visible ? 1 : 0)};\n transition: opacity ${TransitionDuration.Fast} ease-out;\n`;\n\nconst HeaderFadeOverlay = styled(RightFadeOverlay).attrs({\n 'data-scroll-affordance': 'header-fade',\n})`\n top: ${CONTAINER_BORDER_WIDTH_PX}px;\n height: ${Math.max(0, HEADER_HEIGHT_PX - CONTAINER_BORDER_WIDTH_PX)}px;\n z-index: ${HEADER_FADE_Z_INDEX};\n background: linear-gradient(to right, transparent, ${Color.BackgroundSecondary});\n border-top-right-radius: ${BorderRadius.Md};\n`;\n\nconst BodyFadeOverlay = styled(RightFadeOverlay).attrs({\n 'data-scroll-affordance': 'body-fade',\n})<{\n $hideHeader: boolean;\n $scrollbarHeight: number;\n}>`\n top: ${({ $hideHeader }) =>\n $hideHeader\n ? `${CONTAINER_BORDER_WIDTH_PX}px`\n : `${CONTAINER_BORDER_WIDTH_PX + HEADER_HEIGHT_PX}px`};\n bottom: ${({ $scrollbarHeight }) => CONTAINER_BORDER_WIDTH_PX + $scrollbarHeight}px;\n z-index: ${BODY_FADE_Z_INDEX};\n background: linear-gradient(to right, transparent, ${Color.BackgroundPrimary});\n border-bottom-right-radius: ${BorderRadius.Md};\n ${({ $hideHeader }) =>\n $hideHeader &&\n css`\n border-top-right-radius: ${BorderRadius.Md};\n `}\n`;\n\n// Pins the leading sticky column(s) during horizontal scroll. In reorderable\n// mode the drag handle (col 1) and the first content column (col 2) are\n// BOTH sticky and sit flush — the handle at `left: 0`, content at\n// `left: DRAG_HANDLE_CELL_WIDTH`. Otherwise only the first content column\n// (col 1) is sticky.\nconst stickyContentColumn = (isReorderable: boolean, stickyHeader: boolean) => css`\n && thead th:first-child,\n && tbody td:first-child {\n position: sticky;\n left: 0;\n z-index: ${STICKY_COLUMN_Z_INDEX};\n }\n\n && tbody td:first-child {\n background-color: inherit;\n }\n\n ${\n isReorderable &&\n css`\n && thead th:nth-child(2),\n && tbody td:nth-child(2) {\n position: sticky;\n left: ${DRAG_HANDLE_CELL_WIDTH}px;\n z-index: ${STICKY_COLUMN_Z_INDEX};\n }\n\n && tbody td:nth-child(2) {\n background-color: inherit;\n }\n `\n }\n\n ${\n stickyHeader &&\n css`\n && thead th {\n position: sticky;\n top: 0;\n z-index: ${STICKY_HEADER_Z_INDEX};\n background-color: ${Color.BackgroundSecondary};\n }\n\n ${isReorderable ? `&& thead th:nth-child(-n+2)` : `&& thead th:first-child`} {\n z-index: ${STICKY_CORNER_Z_INDEX};\n }\n `\n }\n`;\n\nconst StyledTable = styled(Table)<{\n $isReorderable: boolean;\n $hasHorizontalOverflow: boolean;\n $fixedLayout: boolean;\n $lockedWidth: number | undefined;\n $hideHeader: boolean;\n $stickyHeader: boolean;\n}>`\n caret-color: ${Color.BorderFocus};\n\n &::selection {\n background: ${Color.BackgroundLabelPurple};\n }\n\n ${({ $fixedLayout, $isReorderable, $stickyHeader }) =>\n $fixedLayout\n ? css`\n /* Legacy: truncate long cell content to container width. */\n table-layout: fixed;\n\n ${\n $stickyHeader &&\n css`\n && thead th {\n position: sticky;\n top: 0;\n z-index: ${STICKY_HEADER_Z_INDEX};\n background-color: ${Color.BackgroundSecondary};\n }\n `\n }\n `\n : stickyContentColumn($isReorderable, $stickyHeader)}\n\n /* Lock column widths while inline editing to prevent layout reflow. */\n ${({ $fixedLayout, $lockedWidth }) =>\n !$fixedLayout &&\n $lockedWidth != null &&\n css`\n table-layout: fixed;\n width: ${$lockedWidth}px;\n `}\n\n /* Subtle right border on the sticky column when content extends off-screen\n — inset shadow keeps it layout-neutral. */\n ${({ $hasHorizontalOverflow, $isReorderable, $fixedLayout }) =>\n $hasHorizontalOverflow &&\n !$fixedLayout &&\n css`\n ${\n $isReorderable\n ? `&& thead th:nth-child(2), && tbody td:nth-child(2)`\n : `&& thead th:first-child, && tbody td:first-child`\n } {\n box-shadow: inset -1px 0 0 ${Color.BorderDivider};\n }\n `}\n\n /* When the header is hidden, round the first body row's outer corners so\n they line up with the surrounding container's rounded border. */\n ${({ $hideHeader }) =>\n $hideHeader &&\n css`\n && tbody tr:first-child td:first-child {\n border-top-left-radius: ${BorderRadius.Md};\n }\n && tbody tr:first-child td:last-child {\n border-top-right-radius: ${BorderRadius.Md};\n }\n `}\n`;\n\nconst StyledTableHeaderCell = styled(TableHeaderCell)`\n padding: ${Spacing[1]} ${Spacing[2]};\n border-bottom: 1px solid ${Color.BorderDivider};\n ${paragraphMixins.sm};\n\n /* Border radius for corner cells */\n &:first-child {\n border-radius: ${BorderRadius.Md} 0 0 0;\n }\n\n &:last-child {\n border-radius: 0 ${BorderRadius.Md} 0 0;\n }\n`;\n\n// Narrow leading column that holds the drag handle when drag-and-drop is enabled.\nconst DragHandleHeaderCell = styled(StyledTableHeaderCell)`\n width: 24px;\n padding: ${Spacing[1]} ${Spacing[0]};\n`;\n\n// Trailing sticky column for row actions (horizontal scroll mode only).\nexport const PinnedActionsCell = styled(TableCell)`\n position: sticky;\n right: 0;\n z-index: ${PINNED_ACTIONS_Z_INDEX};\n background: transparent;\n border-bottom: 1px solid ${Color.BorderHairline};\n padding: 0;\n width: ${RowActionsContainerWithFadeWidth}px;\n height: 1px; /* dummy height lets the child use height: 100% */\n`;\n\nconst EmptyStateCell = styled(TableCell)`\n ${paragraphMixins.sm};\n /* Same vertical padding as TableBoxCell so empty and populated tables share a\n stable row height. */\n padding: ${Spacing[1]} ${Spacing[2]};\n color: ${Color.TextSecondary};\n border-bottom: none;\n`;\n\nconst EmptyStateButton = styled.button`\n ${paragraphMixins.sm};\n padding: 0;\n color: inherit;\n background: none;\n border: none;\n cursor: pointer;\n ${focusOutline}\n`;\n\nconst TableBox = <T extends object>({\n children,\n emptyText,\n selectedKey,\n defaultSelectedKey,\n columns,\n onSelectionChange,\n selectionMode = 'none',\n newRowId,\n onCreateNewRow: onCreateNewRowProp,\n disabled = false,\n reorderConfig,\n disableHorizontalScroll: disableHorizontalScrollProp = false,\n hideHeader = false,\n maxHeight,\n 'aria-label': ariaLabel,\n ...props\n}: PropsWithChildren<TableBoxProps<T>>) => {\n const tableRef = useRef<HTMLTableElement>(null);\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const tableBoxId = useMemo(() => uniqueId('tablebox-'), []);\n const rowDropdownId = `${tableBoxId}-row-dropdown`;\n\n // Inline editing swaps inputs in/out of cells, which requires a stable\n // non-scrolling layout; fall back to fixed layout regardless of caller intent.\n const hasInlineEditableColumn = columns.some((c) => c.inlineEditConfig != null);\n const disableHorizontalScroll = disableHorizontalScrollProp || hasInlineEditableColumn;\n\n const { hasHorizontalOverflow, hasMoreScrollRight, scrollbarSize } = useScrollOverflow(\n scrollContainerRef,\n { enabled: !disableHorizontalScroll },\n );\n const { lockedColWidths, setColumnWidthsLocked } = useColumnWidthLock(tableRef, {\n enabled: !disableHorizontalScroll,\n });\n\n // Selection — controlled if `selectedKey` is set, otherwise internal.\n const [internalSelectedKey, setInternalSelectedKey] = useState<string | null>(\n defaultSelectedKey ?? null,\n );\n const [shouldCreateNewRowAfterCommit, setShouldCreateNewRowAfterCommit] = useState(false);\n const currentSelectedKey = selectedKey ?? internalSelectedKey;\n const scheduleCreateNewRowAfterCommit = () => {\n setShouldCreateNewRowAfterCommit(true);\n };\n\n const handleRowClick = useCallback(\n (rowId: string) => {\n if (selectionMode === 'none') {\n return;\n }\n if (!onSelectionChange) {\n setInternalSelectedKey(rowId);\n } else {\n onSelectionChange(rowId);\n }\n },\n [onSelectionChange, selectionMode],\n );\n\n // Deselect rows when clicking outside the TableBox while a row dropdown is open.\n const handleOutsideClick = useCallback(\n (event: MouseEvent) => {\n const rowDropdownIsOpen = document.querySelector(\n `[id=\"${rowDropdownId}\"][data-state=\"open\"]`,\n );\n if (!rowDropdownIsOpen) {\n return;\n }\n const target = event.target as HTMLElement;\n const isOutsideTableBox = tableRef.current && !tableRef.current.contains(target);\n const isOnRowDropdownContent = target.closest(`[id=\"${rowDropdownId}\"]`);\n if (isOutsideTableBox && !isOnRowDropdownContent && currentSelectedKey != null) {\n if (!onSelectionChange) {\n setInternalSelectedKey(null);\n } else {\n onSelectionChange(null);\n }\n }\n },\n [currentSelectedKey, onSelectionChange, rowDropdownId],\n );\n\n useEffect(() => {\n document.addEventListener('mousedown', handleOutsideClick);\n return () => {\n document.removeEventListener('mousedown', handleOutsideClick);\n };\n }, [handleOutsideClick]);\n\n useEffect(() => {\n if (!shouldCreateNewRowAfterCommit) {\n return;\n }\n // The cell edit and row creation may both replace a caller-owned array.\n // Create after the edit render so the callback reads the updated array.\n setShouldCreateNewRowAfterCommit(false);\n onCreateNewRowProp?.();\n }, [onCreateNewRowProp, shouldCreateNewRowAfterCommit]);\n\n const {\n activeId,\n overlayCellWidths,\n draggedDirection,\n sortableIds,\n rowRegistry,\n dndContextProps,\n } = useTableBoxDragAndDrop({ tableRef, reorderConfig: disabled ? undefined : reorderConfig });\n\n const isReorderable = !disabled && reorderConfig != null;\n const hasActionsColumn = !disableHorizontalScroll;\n // Only `maxHeight` makes the container a vertical scrollport. Without one, a\n // sticky header would pin against the page scroller while the rest of the\n // table scrolls past it.\n const stickyHeader = maxHeight != null && !hideHeader;\n\n const contextValue: TableBoxContextValue = {\n disabled,\n newRowId,\n columns,\n selectedKey: currentSelectedKey,\n selectionMode,\n onRowClick: handleRowClick,\n tableBoxId,\n rowDropdownId,\n isReorderable,\n rowRegistry: isReorderable ? rowRegistry : null,\n draggedDirection,\n hasActionsColumn,\n hasHorizontalOverflow,\n clipsOverflow: hasHorizontalOverflow || maxHeight != null,\n setColumnWidthsLocked,\n scheduleCreateNewRowAfterCommit: onCreateNewRowProp\n ? scheduleCreateNewRowAfterCommit\n : undefined,\n };\n\n const isEmpty = Array.isArray(children) ? children.length === 0 : children == null;\n const totalColumnCount = columns.length + (isReorderable ? 1 : 0) + (hasActionsColumn ? 1 : 0);\n\n const activeRowContent = activeId ? (rowRegistry.current.get(activeId) ?? null) : null;\n\n const tableContent = (\n <ScrollAffordanceWrapper>\n <TableScrollContainer\n ref={scrollContainerRef}\n $fixedLayout={disableHorizontalScroll}\n $hasHorizontalOverflow={hasHorizontalOverflow}\n $maxHeight={maxHeight}\n >\n <StyledTable\n ref={tableRef}\n size='md'\n aria-label={ariaLabel}\n tabIndex={-1}\n $isReorderable={isReorderable}\n $hasHorizontalOverflow={hasHorizontalOverflow}\n $fixedLayout={disableHorizontalScroll}\n $hideHeader={hideHeader}\n $stickyHeader={stickyHeader}\n $lockedWidth={\n lockedColWidths != null ? lockedColWidths.reduce((sum, w) => sum + w, 0) : undefined\n }\n {...props}\n >\n {lockedColWidths && (\n <colgroup>\n {lockedColWidths.map((w, i) => (\n <col key={i} style={{ width: `${w}px` }} />\n ))}\n </colgroup>\n )}\n {!hideHeader && (\n <TableHead>\n <TableRow>\n {isReorderable && <DragHandleHeaderCell aria-hidden='true' />}\n {columns.map((column) => (\n <StyledTableHeaderCell key={column.key}>{column.title}</StyledTableHeaderCell>\n ))}\n {hasActionsColumn && (\n <StyledTableHeaderCell aria-hidden='true' style={{ padding: 0 }} />\n )}\n </TableRow>\n </TableHead>\n )}\n <TableBody>\n {isEmpty ? (\n <TableRow disableHoverBackground>\n <EmptyStateCell colSpan={totalColumnCount}>\n {onCreateNewRowProp && !disabled ? (\n <EmptyStateButton type='button' onClick={onCreateNewRowProp}>\n {emptyText || 'No data available.'}\n </EmptyStateButton>\n ) : (\n emptyText || 'No data available.'\n )}\n </EmptyStateCell>\n </TableRow>\n ) : (\n children\n )}\n </TableBody>\n </StyledTable>\n </TableScrollContainer>\n {!disableHorizontalScroll && (\n <>\n {!hideHeader && (\n <HeaderFadeOverlay\n aria-hidden='true'\n $visible={hasMoreScrollRight}\n $scrollbarWidth={scrollbarSize.vertical}\n />\n )}\n <BodyFadeOverlay\n aria-hidden='true'\n $visible={hasMoreScrollRight}\n $hideHeader={hideHeader}\n $scrollbarWidth={scrollbarSize.vertical}\n $scrollbarHeight={scrollbarSize.horizontal}\n />\n </>\n )}\n </ScrollAffordanceWrapper>\n );\n\n return (\n <TableBoxContext.Provider value={contextValue}>\n {isReorderable ? (\n <DndContext {...dndContextProps}>\n <SortableContext items={sortableIds} strategy={verticalListSortingStrategy}>\n {tableContent}\n </SortableContext>\n <DragOverlay>\n {activeRowContent && overlayCellWidths && (\n <TableBoxRowOverlay cellWidths={overlayCellWidths}>\n {activeRowContent}\n </TableBoxRowOverlay>\n )}\n </DragOverlay>\n </DndContext>\n ) : (\n tableContent\n )}\n </TableBoxContext.Provider>\n );\n};\n\nTableBox.Row = TableBoxRow;\nTableBox.Cell = TableBoxCell;\n\nexport default TableBox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,yBAAyB;AAE/B,MAAM,oBAAoB,SACxB,MAAM,cAA2B,uBAAuB,IAAI;AAE9D,MAAa,+BACX,OACA,cACG;CACH,MAAM,EAAE,gBAAgB,cAAc,UAAU;AAChD,KAAI,kBAAkB,QAAQ,gBAAgB,QAAQ,mBAAmB,aACvE,QAAO;AAET,QAAO,cAAc,SAAS,mBAAmB,IAAI,iBAAiB,MAAM;;AAG9E,MAAa,6BACX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BACC,oBAAC,uBAAD;MAAuB,eAAY;MAAO,OAAO,EAAE,SAAS,GAAG;MAAI,CAAA;KAE5D,EAAA,CAAA,EACD,CAAA;IAEd,oBAAC,WAAD,EAAA,UACG,UACC,oBAAC,UAAD;KAAU,wBAAA;eACR,oBAAC,gBAAD;MAAgB,SAAS;gBACtB,sBAAsB,CAAC,WACtB,oBAAC,kBAAD;OAAkB,MAAK;OAAS,SAAS;iBACtC,aAAa;OACG,CAAA,GAEnB,aAAa;MAEA,CAAA;KACR,CAAA,GAEX,UAEQ,CAAA;IACA;;EACO,CAAA,EACtB,CAAC,2BACA,qBAAA,UAAA,EAAA,UAAA,CACG,CAAC,cACA,oBAAC,mBAAD;EACE,eAAY;EACZ,UAAU;EACV,iBAAiB,cAAc;EAC/B,CAAA,EAEJ,oBAAC,iBAAD;EACE,eAAY;EACZ,UAAU;EACV,aAAa;EACb,iBAAiB,cAAc;EAC/B,kBAAkB,cAAc;EAChC,CAAA,CACD,EAAA,CAAA,CAEmB,EAAA,CAAA;AAG5B,QACE,oBAAC,gBAAgB,UAAjB;EAA0B,OAAO;YAC9B,gBACC,qBAAC,YAAD;GAAY,GAAI;aAAhB,CACE,oBAAC,iBAAD;IAAiB,OAAO;IAAa,UAAU;cAC5C;IACe,CAAA,EAClB,oBAAC,aAAD,EAAA,UACG,oBAAoB,qBACnB,oBAAC,oBAAD;IAAoB,YAAY;cAC7B;IACkB,CAAA,EAEX,CAAA,CACH;OAEb;EAEuB,CAAA;;AAI/B,SAAS,MAAM;AACf,SAAS,OAAO"}
|
|
1
|
+
{"version":3,"file":"TableBox-CaTHcR4F.mjs","names":["DropdownMenu","MoreIcon","XIcon","CircleAlertIcon","FormControlContainer","Popover"],"sources":["../components/TableBox/tableBoxKeyboardNavigation.ts","../components/TableBox/InlineCombobox.tsx","../components/TableBox/TableBoxRowContext.ts","../components/TableBox/InlineInput.tsx","../components/TableBox/TableBoxRowActions.tsx","../components/TableBox/useDelayedInlineEditError.ts","../components/TableBox/TableBoxCell.tsx","../components/TableBox/TableBoxRow.tsx","../components/TableBox/useColumnWidthLock.ts","../components/TableBox/useTableBoxDragAndDrop.ts","../components/TableBox/TableBox.tsx"],"sourcesContent":["export type TableBoxNavigationDirection = 'up' | 'down' | 'left' | 'right';\nexport type HorizontalTableBoxNavigationDirection = Extract<\n TableBoxNavigationDirection,\n 'left' | 'right'\n>;\n\nconst INLINE_EDITOR_SELECTOR = '[data-tablebox-inline-edit-trigger], input[role=\"combobox\"]';\n\nconst findInlineEditor = (cell: HTMLTableCellElement | null) =>\n cell?.querySelector<HTMLElement>(INLINE_EDITOR_SELECTOR) ?? null;\n\nexport const isCaretAtNavigationBoundary = (\n input: HTMLInputElement,\n direction: HorizontalTableBoxNavigationDirection,\n) => {\n const { selectionStart, selectionEnd, value } = input;\n if (selectionStart == null || selectionEnd == null || selectionStart !== selectionEnd) {\n return false;\n }\n return direction === 'left' ? selectionStart === 0 : selectionEnd === value.length;\n};\n\nexport const focusAdjacentInlineEditor = (\n target: HTMLElement,\n direction: TableBoxNavigationDirection,\n) => {\n const currentCell = target.closest('td');\n const currentRow = currentCell?.closest('tr');\n if (!(currentCell instanceof HTMLTableCellElement) || currentRow == null) {\n return false;\n }\n\n if (direction === 'up' || direction === 'down') {\n const adjacentRow =\n direction === 'up' ? currentRow.previousElementSibling : currentRow.nextElementSibling;\n if (!(adjacentRow instanceof HTMLTableRowElement)) {\n return false;\n }\n\n const adjacentEditor = findInlineEditor(adjacentRow.cells.item(currentCell.cellIndex));\n adjacentEditor?.focus();\n return adjacentEditor != null;\n }\n\n let adjacentCell =\n direction === 'left' ? currentCell.previousElementSibling : currentCell.nextElementSibling;\n while (adjacentCell instanceof HTMLTableCellElement) {\n const adjacentEditor = findInlineEditor(adjacentCell);\n if (adjacentEditor != null) {\n adjacentEditor.focus();\n return true;\n }\n adjacentCell =\n direction === 'left' ? adjacentCell.previousElementSibling : adjacentCell.nextElementSibling;\n }\n\n return false;\n};\n","import { type RefObject, useCallback, useContext, useState } from 'react';\nimport styled from 'styled-components';\n\nimport Combobox from '@persona/design-system/components/Combobox';\nimport { Spacing } from '@persona/design-tokens';\n\nimport { type InlineEditConfig, TableBoxContext } from './TableBox';\nimport {\n focusAdjacentInlineEditor,\n isCaretAtNavigationBoundary,\n} from './tableBoxKeyboardNavigation';\n\ninterface InlineComboboxProps {\n /**\n * The id of the item the cell belongs to\n */\n itemId: string;\n /**\n * Initial value for the cell\n */\n value: string;\n /**\n * The column key this cell belongs to\n */\n columnKey?: string;\n /**\n * The inline edit configuration for this cell\n */\n inlineEditConfig?: InlineEditConfig;\n /**\n * The content to display when not editing. If no children are passed, the value will be displayed.\n */\n children?: React.ReactNode;\n /**\n * Reference to the table row element. Used for full-width combobox dropdowns.\n */\n rowRef?: RefObject<HTMLTableRowElement>;\n /** Whether the closed display is preceded by an error icon. */\n hasLeadingError?: boolean;\n}\n\nconst StyledCombobox = styled(Combobox)<{ $hideText?: boolean }>`\n border: none;\n background-color: transparent;\n\n /* Suppress the focus outline — it extends outside the input and is clipped\n by the scroll container. Use && for specificity. */\n && input,\n && input:focus-visible:not(:disabled) {\n outline: none;\n }\n\n ${({ $hideText }) =>\n $hideText &&\n `\n input {\n color: transparent;\n caret-color: transparent;\n }\n input::placeholder {\n color: transparent;\n }\n `}\n`;\n\nconst ChildrenOverlay = styled.div<{ $hasLeadingError?: boolean; $truncate?: boolean }>`\n position: absolute;\n left: ${({ $hasLeadingError }) => ($hasLeadingError ? Spacing[1] : Spacing[2])};\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n pointer-events: none;\n\n // ${Spacing[5]} matches the sm ComboboxInput padding-right, keeping the text clear of the caret.\n ${({ $truncate }) =>\n $truncate &&\n `\n right: ${Spacing[5]};\n `}\n`;\n\nconst ComboboxWrapper = styled.div`\n position: relative;\n width: 100%;\n`;\n\nconst InlineCombobox = ({\n itemId,\n value,\n columnKey,\n inlineEditConfig,\n children,\n rowRef,\n hasLeadingError,\n}: InlineComboboxProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const context = useContext(TableBoxContext);\n const setColumnWidthsLocked = context?.setColumnWidthsLocked;\n const currentColumn = context?.columns?.find((c) => c.key === columnKey);\n const placeholder = inlineEditConfig?.placeholder || currentColumn?.title || '';\n const fullWidthComboboxDropdown = inlineEditConfig?.fullWidthComboboxDropdown || false;\n\n // Use rowRef as portalContainerRef when fullWidthComboboxDropdown is enabled\n const portalContainerRef = fullWidthComboboxDropdown && rowRef ? rowRef : undefined;\n\n const showOverlay = !isOpen && !!children;\n\n // Mirror `InlineInput`'s edit-lifecycle contract so the parent TableBox\n // can lock column widths while the combobox is open. Without this, the\n // text→input swap (`$hideText`) and the focus-driven `RowActionsContainer`\n // appearing in the cell can reflow data columns when the dropdown opens.\n //\n // useCallback is critical here: ComboboxSingleSelect calls onOpenChange from\n // a useEffect with [isOpen, onOpenChange] deps. A new function reference on\n // every render would cause that effect to fire spuriously, calling\n // setColumnWidthsLocked(false) and wiping out lockedColWidths set by a sibling\n // text-input cell — causing the text-input column to shift when clicked.\n const handleOpenChange = useCallback(\n (open: boolean) => {\n setIsOpen(open);\n setColumnWidthsLocked?.(open);\n },\n [setColumnWidthsLocked],\n );\n\n return (\n <ComboboxWrapper\n onKeyDownCapture={(event) => {\n if (isOpen || (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')) {\n return;\n }\n const direction = event.key === 'ArrowLeft' ? 'left' : 'right';\n if (\n !(event.target instanceof HTMLInputElement) ||\n !isCaretAtNavigationBoundary(event.target, direction)\n ) {\n return;\n }\n const movedFocus = focusAdjacentInlineEditor(event.currentTarget, direction);\n if (movedFocus) {\n event.preventDefault();\n event.stopPropagation();\n }\n }}\n >\n {showOverlay && (\n <ChildrenOverlay\n $hasLeadingError={hasLeadingError}\n $truncate={inlineEditConfig?.truncateDisplay}\n >\n {children}\n </ChildrenOverlay>\n )}\n <StyledCombobox\n $hideText={showOverlay}\n value={value}\n options={inlineEditConfig?.options || []}\n onChange={(newValue) => {\n if (inlineEditConfig?.onChange && newValue !== value && typeof newValue === 'string') {\n inlineEditConfig.onChange(itemId, newValue);\n }\n }}\n onOpenChange={handleOpenChange}\n placeholder={placeholder}\n size='sm'\n portal={inlineEditConfig?.useComboboxPortal || false}\n portalContainerRef={portalContainerRef}\n />\n </ComboboxWrapper>\n );\n};\n\nexport default InlineCombobox;\n","import { createContext, type RefObject } from 'react';\n\ninterface TableBoxRowContextValue {\n /**\n * Ref to the surrounding `<tr>`. Used by inline-edit comboboxes that opt\n * into `fullWidthComboboxDropdown` so they can portal their dropdown\n * positioned to the row.\n */\n rowRef: RefObject<HTMLTableRowElement>;\n /** Deletes this row when keyboard editing identifies it as removable. */\n onDelete?: () => void;\n /** Notifies the row that a descendant inline editor committed or canceled. */\n onEditingEnd: () => void;\n /** True when every data cell after the first has an explicitly empty value. */\n areOtherCellsBlank: boolean;\n}\n\nexport const TableBoxRowContext = createContext<TableBoxRowContextValue | null>(null);\n","import { useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Typography } from '@persona/design-tokens';\n\nimport { type InlineEditConfig, TableBoxContext } from './TableBox';\nimport {\n focusAdjacentInlineEditor,\n isCaretAtNavigationBoundary,\n} from './tableBoxKeyboardNavigation';\nimport { TableBoxRowContext } from './TableBoxRowContext';\n\ninterface InlineInputProps {\n /**\n * The id of the item the cell belongs to\n */\n itemId: string;\n /**\n * Initial value for the cell\n */\n value: string;\n /**\n * The column key this cell belongs to\n */\n columnKey?: string;\n /**\n * The inline edit configuration for this cell\n */\n inlineEditConfig?: InlineEditConfig;\n /** Notifies the cell that this inline editor committed or canceled. */\n onEditingEnd?: () => void;\n /**\n * The content to display when not editing. If no children are passed, the value will be displayed.\n */\n children?: React.ReactNode;\n}\n\nconst sharedInputStyles = css`\n font: inherit;\n color: inherit;\n outline: none;\n border: none;\n padding: 0;\n pointer-events: auto;\n width: 100%;\n background: transparent;\n line-height: ${Typography.TextSmall.lineHeight};\n`;\n\nconst InlineEditInput = styled.input`\n ${sharedInputStyles}\n`;\n\nconst InlineEditTextarea = styled.textarea`\n ${sharedInputStyles}\n resize: none;\n overflow-y: auto;\n min-height: ${Typography.TextSmall.lineHeight};\n scrollbar-width: none;\n`;\n\nconst InlineEditDisplay = styled.div<{ $multiline?: boolean }>`\n cursor: text;\n outline: none;\n width: 100%;\n height: 100%;\n min-height: ${Typography.TextSmall.lineHeight};\n line-height: ${Typography.TextSmall.lineHeight};\n\n ${({ $multiline }) =>\n $multiline\n ? css`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n word-break: break-word;\n `\n : css`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n`;\n\nconst InlineInput = ({\n itemId,\n value,\n columnKey,\n inlineEditConfig,\n onEditingEnd,\n children,\n}: InlineInputProps) => {\n const { columns, newRowId, setColumnWidthsLocked, scheduleCreateNewRowAfterCommit } =\n useContext(TableBoxContext) ?? {};\n const rowContext = useContext(TableBoxRowContext);\n // Check if this cell should render in inline edit mode (first cell of newly created row)\n const initialInlineEditState = itemId === newRowId && columnKey === columns?.[0]?.key;\n const [isInlineEditing, setIsInlineEditing] = useState(initialInlineEditState);\n const [editValue, setEditValue] = useState(value);\n const inputRef = useRef<HTMLInputElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const cancelledRef = useRef(false);\n\n const isMultiline = inlineEditConfig?.multiline === true;\n\n // set the cancelledRef to false when the component unmounts\n useEffect(() => {\n return () => {\n cancelledRef.current = false;\n };\n }, []);\n\n // Auto-resize textarea to fit content. useLayoutEffect runs before paint so the\n // intermediate height: auto state is never visible, eliminating flicker.\n useLayoutEffect(() => {\n if (isInlineEditing && isMultiline && textareaRef.current) {\n const textarea = textareaRef.current;\n textarea.style.height = 'auto';\n textarea.style.height = `${textarea.scrollHeight}px`;\n }\n }, [isInlineEditing, editValue, isMultiline]);\n\n // Position cursor at end of textarea when editing starts\n useEffect(() => {\n if (isInlineEditing && isMultiline && textareaRef.current) {\n const length = textareaRef.current.value.length;\n textareaRef.current.setSelectionRange(length, length);\n }\n }, [isInlineEditing, isMultiline]);\n\n const placeholder = useMemo(() => {\n const column = columns?.find((c) => c.key === columnKey);\n return column?.inlineEditConfig?.placeholder || column?.title || '';\n }, [columns, columnKey]);\n\n const notifyEditingEnd = () => {\n onEditingEnd?.();\n rowContext?.onEditingEnd();\n setColumnWidthsLocked?.(false);\n };\n\n const handleInlineEditKeyDown = (\n e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n const isFirstCell = columnKey === columns?.[0]?.key;\n if (\n (e.key === 'Delete' || e.key === 'Backspace') &&\n isFirstCell &&\n editValue === '' &&\n rowContext?.areOtherCellsBlank &&\n rowContext.onDelete\n ) {\n e.preventDefault();\n e.stopPropagation();\n cancelledRef.current = true;\n setColumnWidthsLocked?.(false);\n const focusedAdjacentRow =\n focusAdjacentInlineEditor(e.currentTarget, 'down') ||\n focusAdjacentInlineEditor(e.currentTarget, 'up');\n if (!focusedAdjacentRow) {\n e.currentTarget.closest('table')?.focus();\n }\n rowContext.onDelete();\n } else if (\n !isMultiline &&\n (e.key === 'ArrowUp' ||\n e.key === 'ArrowDown' ||\n e.key === 'ArrowLeft' ||\n e.key === 'ArrowRight')\n ) {\n const direction =\n e.key === 'ArrowUp'\n ? 'up'\n : e.key === 'ArrowDown'\n ? 'down'\n : e.key === 'ArrowLeft'\n ? 'left'\n : 'right';\n const canMoveFocus =\n direction === 'up' ||\n direction === 'down' ||\n (e.currentTarget instanceof HTMLInputElement &&\n isCaretAtNavigationBoundary(e.currentTarget, direction));\n const movedFocus = canMoveFocus && focusAdjacentInlineEditor(e.currentTarget, direction);\n if (movedFocus) {\n e.preventDefault();\n e.stopPropagation();\n }\n } else if (e.key === 'Enter') {\n if (isMultiline) {\n // In multiline mode, Ctrl+Enter or Cmd+Enter saves\n if (e.ctrlKey || e.metaKey) {\n e.preventDefault();\n e.stopPropagation();\n handleInlineEditConfirm();\n notifyEditingEnd();\n setIsInlineEditing(false);\n }\n // Regular Enter adds a newline (default behavior)\n } else {\n // In single-line mode, Enter saves\n e.preventDefault();\n e.stopPropagation();\n handleInlineEditConfirm();\n notifyEditingEnd();\n setIsInlineEditing(false);\n const isLastCell = columnKey === columns?.at(-1)?.key;\n const currentRow = e.currentTarget.closest('tr');\n const isLastRow = currentRow != null && currentRow.nextElementSibling == null;\n if (isLastCell && isLastRow) {\n scheduleCreateNewRowAfterCommit?.();\n }\n }\n } else if (e.key === 'Tab') {\n handleInlineEditConfirm();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n handleInlineEditCancel();\n }\n };\n\n const handleInlineEditConfirm = () => {\n if (inlineEditConfig?.onChange && editValue !== value) {\n inlineEditConfig.onChange(itemId, editValue);\n }\n };\n\n const handleInlineEditCancel = () => {\n cancelledRef.current = true;\n setEditValue(value);\n notifyEditingEnd();\n setIsInlineEditing(false);\n };\n\n const handleInlineEditBlur = () => {\n // Only save on blur if the user didn't press Escape\n if (!cancelledRef.current) {\n handleInlineEditConfirm();\n }\n cancelledRef.current = false;\n setIsInlineEditing(false);\n setColumnWidthsLocked?.(false);\n };\n\n return isInlineEditing ? (\n isMultiline ? (\n <InlineEditTextarea\n ref={textareaRef}\n value={editValue}\n onChange={(e) => setEditValue(e.target.value)}\n onBlur={handleInlineEditBlur}\n onKeyDown={handleInlineEditKeyDown}\n placeholder={placeholder}\n autoFocus\n // without this, the textarea will be 2 lines high by default,\n // even when there's only one line of text\n rows={1}\n />\n ) : (\n <InlineEditInput\n ref={inputRef}\n value={editValue}\n onChange={(e) => setEditValue(e.target.value)}\n onBlur={handleInlineEditBlur}\n onKeyDown={handleInlineEditKeyDown}\n placeholder={placeholder}\n autoFocus\n />\n )\n ) : (\n <InlineEditDisplay\n tabIndex={0}\n data-tablebox-inline-edit-trigger\n $multiline={isMultiline}\n onFocus={() => {\n setEditValue(value);\n setColumnWidthsLocked?.(true);\n setIsInlineEditing(true);\n }}\n >\n {children || value}\n </InlineEditDisplay>\n );\n};\n\nexport default InlineInput;\n","import styled, { css } from 'styled-components';\n\nimport { IconButton } from '@persona/design-system/components/Button';\nimport DropdownMenu from '@persona/design-system/components/DropdownMenu';\nimport type { MenuItemProps } from '@persona/design-system/components/Menu';\nimport { TransitionDuration } from '@persona/design-system/variables/transitions';\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { MoreIcon, XIcon } from '@persona/icons/12px';\n\nexport type RowAction = {\n label: string;\n onClick: () => void;\n} & Omit<MenuItemProps, 'children'>;\n\nconst IconButtonWidth = 16;\nconst BackgroundFadeWidth = 12;\nconst RowActionsContainerBaseWidth = parseInt(Spacing[1]) + IconButtonWidth + parseInt(Spacing[2]);\nexport const RowActionsContainerWithFadeWidth = BackgroundFadeWidth + RowActionsContainerBaseWidth;\n\n/**\n * Container for row-level actions (`actions` menu and/or delete `X`). Used\n * in two layouts:\n *\n * - **Dedicated trailing column** (`$inDedicatedColumn=true`, the default\n * for horizontal-scroll mode): laid out in normal flow inside\n * `PinnedActionsCell`.\n * - **Overlaid in last data cell** (`$inDedicatedColumn=false`,\n * `disableHorizontalScroll` mode): absolutely positioned on top of the\n * last cell's content with a fade gradient so it overlaps text on hover.\n *\n * Other variant props:\n * - `$hasCombobox` — last data column is an inline combobox; we use auto\n * width so the caret↔first-action gap matches the action↔delete gap, and\n * we drop the gradient so there's no fade running over the caret.\n * - `$hasDelete` — fade the container in only on hover, mirroring the\n * legacy \"show delete on hover\" behavior.\n */\nexport const RowActionsContainer = styled.div<{\n $hasActions?: boolean;\n $hasDelete?: boolean;\n $hasCombobox?: boolean;\n $inDedicatedColumn?: boolean;\n}>`\n width: ${({ $hasCombobox }) => ($hasCombobox ? 'auto' : `${RowActionsContainerWithFadeWidth}px`)};\n position: ${({ $hasCombobox, $inDedicatedColumn }) =>\n $hasCombobox || $inDedicatedColumn ? 'static' : 'absolute'};\n right: ${Spacing[2]};\n top: 0;\n height: 100%;\n display: flex;\n gap: ${Spacing[1]};\n align-items: center;\n justify-content: end;\n transition: opacity ${TransitionDuration.Fast} ease-out;\n background: linear-gradient(\n to right,\n transparent,\n ${Color.BackgroundPrimary} ${BackgroundFadeWidth}px\n );\n\n /* Combobox cells render actions inline next to the caret. The padding-left\n keeps the caret↔first-action gap visually balanced with the gap between\n the actions themselves. */\n ${({ $hasCombobox }) =>\n $hasCombobox &&\n css`\n background: none;\n padding-right: ${Spacing[2]};\n padding-left: ${Spacing[1]};\n `}\n\n /* PinnedActionsCell is transparent (so scrolling content can pass under it);\n owning the right gutter here keeps the container's opaque gradient flush\n to the cell's right edge. */\n ${({ $inDedicatedColumn, $hasCombobox }) =>\n $inDedicatedColumn &&\n !$hasCombobox &&\n css`\n padding-right: ${Spacing[2]};\n `}\n\n /* Hide on hover only when delete is present (matches legacy behavior). */\n ${({ $hasDelete }) =>\n $hasDelete &&\n css`\n opacity: 0;\n `}\n\n /* Make room for both buttons; combobox cells use auto width so they can sit\n inline next to the caret. */\n ${({ $hasActions, $hasDelete, $hasCombobox }) =>\n $hasActions &&\n $hasDelete &&\n !$hasCombobox &&\n css`\n width: ${RowActionsContainerWithFadeWidth + parseInt(Spacing[1]) + IconButtonWidth}px;\n `}\n`;\n\ninterface RowActionsProps {\n actions?: RowAction[];\n onDelete?: () => void;\n /** When true, sizes/positions for the dedicated sticky trailing column. */\n inDedicatedColumn?: boolean;\n /** When true, sizes/positions inline alongside a combobox caret. */\n inCombobox?: boolean;\n}\n\n/**\n * Renders the actions menu and/or delete icon button inside a\n * `RowActionsContainer`. Used both as an absolute overlay inside the\n * last data cell (fixed-layout mode) and as static content inside the\n * dedicated sticky trailing column (horizontal scroll mode).\n */\nexport const RowActions = ({\n actions,\n onDelete,\n inDedicatedColumn,\n inCombobox,\n}: RowActionsProps) => {\n const hasActions = !!actions?.length;\n\n if (!hasActions && !onDelete) {\n return null;\n }\n return (\n <RowActionsContainer\n $hasActions={hasActions}\n $hasDelete={!!onDelete}\n $hasCombobox={inCombobox}\n $inDedicatedColumn={inDedicatedColumn}\n onClick={(e) => e.stopPropagation()}\n >\n {hasActions && (\n <DropdownMenu\n // Escape `PinnedActionsCell`'s stacking context — without portaling\n // subsequent rows' sticky cells paint over the menu.\n portal\n trigger={\n <IconButton aria-label='Actions'>\n <MoreIcon />\n </IconButton>\n }\n >\n {actions?.map(({ label, onClick, ...rest }) => (\n <DropdownMenu.Item key={label} {...rest} onClick={onClick} size='sm'>\n {label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n {onDelete && (\n <IconButton aria-label='Delete' onClick={onDelete}>\n <XIcon />\n </IconButton>\n )}\n </RowActionsContainer>\n );\n};\n","import { type FocusEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nconst ERROR_DELAY_MS = 500;\n\nconst isEditableTarget = (target: EventTarget | null) =>\n target instanceof HTMLElement && (target.matches('input, textarea') || target.isContentEditable);\n\nconst useDelayedInlineEditError = (errorText?: string) => {\n const errorTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const lastEditingEndAtRef = useRef<number | null>(null);\n const isEditingRef = useRef(false);\n const errorTextRef = useRef(errorText);\n errorTextRef.current = errorText;\n const [isErrorVisible, setIsErrorVisible] = useState(Boolean(errorText));\n\n const clearErrorTimer = useCallback(() => {\n if (errorTimerRef.current != null) {\n clearTimeout(errorTimerRef.current);\n errorTimerRef.current = null;\n }\n }, []);\n\n const scheduleError = useCallback(\n (delay = ERROR_DELAY_MS) => {\n clearErrorTimer();\n if (!errorTextRef.current) {\n return;\n }\n\n errorTimerRef.current = setTimeout(() => {\n if (errorTextRef.current && !isEditingRef.current) {\n setIsErrorVisible(true);\n }\n errorTimerRef.current = null;\n }, delay);\n },\n [clearErrorTimer],\n );\n\n useEffect(() => {\n if (!errorText) {\n clearErrorTimer();\n setIsErrorVisible(false);\n return;\n }\n\n if (isEditingRef.current) {\n setIsErrorVisible(false);\n return;\n }\n\n if (lastEditingEndAtRef.current == null) {\n clearErrorTimer();\n setIsErrorVisible(true);\n } else if (!isErrorVisible) {\n const elapsed = Date.now() - lastEditingEndAtRef.current;\n scheduleError(Math.max(0, ERROR_DELAY_MS - elapsed));\n }\n }, [clearErrorTimer, errorText, isErrorVisible, scheduleError]);\n\n useEffect(() => clearErrorTimer, [clearErrorTimer]);\n\n const onFocus = useCallback(\n (event: FocusEvent<HTMLElement>) => {\n if (!isEditableTarget(event.target)) {\n return;\n }\n\n isEditingRef.current = true;\n lastEditingEndAtRef.current = null;\n clearErrorTimer();\n setIsErrorVisible(false);\n },\n [clearErrorTimer],\n );\n\n const onEditingEnd = useCallback(() => {\n if (!isEditingRef.current) {\n return;\n }\n\n isEditingRef.current = false;\n lastEditingEndAtRef.current = Date.now();\n scheduleError();\n }, [scheduleError]);\n\n const onBlur = useCallback(\n (event: FocusEvent<HTMLElement>) => {\n if (!isEditableTarget(event.target)) {\n return;\n }\n\n onEditingEnd();\n },\n [onEditingEnd],\n );\n\n return { isErrorVisible, onBlur, onEditingEnd, onFocus };\n};\n\nexport default useDelayedInlineEditError;\n","import { type ComponentPropsWithoutRef, type FocusEvent, useContext } from 'react';\nimport styled from 'styled-components';\n\nimport { HStack } from '@persona/design-system/components/Stack';\nimport { TableCell } from '@persona/design-system/components/Table';\nimport Tooltip from '@persona/design-system/components/Tooltip';\nimport { paragraphMixins } from '@persona/design-system/mixins/text';\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport { CircleAlertIcon } from '@persona/icons/12px';\n\nimport InlineCombobox from './InlineCombobox';\nimport InlineInput from './InlineInput';\nimport { type InlineEditConfig, TableBoxContext } from './TableBox';\nimport { type RowAction, RowActions } from './TableBoxRowActions';\nimport { TableBoxRowContext } from './TableBoxRowContext';\nimport useDelayedInlineEditError from './useDelayedInlineEditError';\n\nexport interface TableBoxCellProps extends ComponentPropsWithoutRef<typeof TableCell> {\n /** The id of the item the cell belongs to */\n itemId?: string;\n /** Initial value for the cell */\n value?: string;\n /** The column key this cell belongs to. Used to look up the change handler from context. */\n columnKey?: string;\n /**\n * Error shown immediately until inline editing begins. Focusing the cell's editable input hides\n * the error, and ending the inline edit resurfaces it after 500ms.\n */\n errorText?: string;\n /**\n * Whether this is the last cell in the row. Set automatically by\n * `TableBoxRow` so that, in fixed-layout mode (no dedicated trailing\n * actions column), the cell can host the row's actions / delete button.\n */\n isLastCell?: boolean;\n /**\n * Row actions, only injected by `TableBoxRow` when actions live inside\n * the last data cell (fixed-layout mode).\n */\n actions?: RowAction[];\n /**\n * Delete handler, only injected by `TableBoxRow` when delete lives inside\n * the last data cell (fixed-layout mode).\n */\n onDelete?: (id: string | number) => void;\n /**\n * Cell-specific inline edit configuration.\n * Properties provided here will override the column-level configuration.\n * Useful for per-row customization of options, onChange handlers, etc.\n */\n inlineEditConfigOverride?: Partial<InlineEditConfig>;\n /** @internal Visible row-wide error injected into the first cell by `TableBoxRow`. */\n rowErrorText?: string;\n}\n\nconst CELL_VERTICAL_PADDING = Spacing[1];\nconst CELL_HEIGHT = `calc(${Typography.TextSmall.lineHeight} + (${CELL_VERTICAL_PADDING} * 2))`;\n\nconst StyledCell = styled(TableCell)<{ $noPadding?: boolean }>`\n ${paragraphMixins.sm};\n // height acts as min-height for table cells\n height: ${CELL_HEIGHT};\n padding: ${({ $noPadding }) => ($noPadding ? Spacing[0] : `${CELL_VERTICAL_PADDING} ${Spacing[2]}`)};\n border-bottom: 1px solid ${Color.BorderHairline};\n position: relative;\n`;\n\nconst StyledCellContent = styled.div`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-grow: 1;\n min-width: 0;\n`;\n\nconst CellErrorContainer = styled.span<{ $inset?: boolean }>`\n display: inline-block;\n line-height: ${Typography.TextSmall.lineHeight};\n margin-right: ${({ $inset }) => ($inset ? Spacing[0] : Spacing[1])};\n padding-left: ${({ $inset }) => ($inset ? Spacing[2] : Spacing[0])};\n position: relative;\n /* Optically center the 12px alert glyph against the text's visual bounds. */\n top: 1px;\n`;\n\nconst TableBoxCell = ({\n children,\n itemId = '',\n value = '',\n columnKey,\n errorText,\n isLastCell = false,\n actions,\n onDelete,\n inlineEditConfigOverride,\n rowErrorText,\n onBlur,\n onFocus,\n ...props\n}: TableBoxCellProps) => {\n const context = useContext(TableBoxContext);\n const rowContext = useContext(TableBoxRowContext);\n const {\n isErrorVisible,\n onBlur: handleDelayedErrorBlur,\n onEditingEnd: handleDelayedErrorEditingEnd,\n onFocus: handleDelayedErrorFocus,\n } = useDelayedInlineEditError(errorText);\n\n if (context == null) {\n throw new Error('TableBox context is not set');\n }\n\n const column = context.columns.find((c) => c.key === columnKey);\n const columnConfig = column?.inlineEditConfig;\n\n // Cell-level overrides shallow-merge over the column-level config.\n let inlineEditConfig =\n context.disabled || columnConfig == null\n ? undefined\n : inlineEditConfigOverride\n ? { ...columnConfig, ...inlineEditConfigOverride }\n : columnConfig;\n\n // Portal combobox dropdowns when the scroll container clips overflow\n // (`overflow-x: auto` from horizontal overflow, or `overflow-y: auto` from\n // maxHeight). When the table fits with no height cap we leave them\n // un-portaled to avoid ancestor RAC modals marking them aria-hidden.\n // fullWidthComboboxDropdown callers always need the portal.\n if (\n inlineEditConfig?.type === 'combobox' &&\n (context.clipsOverflow || inlineEditConfig?.fullWidthComboboxDropdown)\n ) {\n inlineEditConfig = {\n ...inlineEditConfig,\n useComboboxPortal: true,\n };\n }\n\n const handleDelete = () => {\n if (onDelete && itemId) {\n onDelete(itemId);\n }\n };\n\n const handleFocus = (event: FocusEvent<HTMLTableCellElement>) => {\n handleDelayedErrorFocus(event);\n onFocus?.(event);\n };\n\n const handleBlur = (event: FocusEvent<HTMLTableCellElement>) => {\n handleDelayedErrorBlur(event);\n onBlur?.(event);\n };\n\n const visibleErrorText = isErrorVisible && errorText ? errorText : rowErrorText;\n\n return (\n <StyledCell\n {...props}\n $noPadding={inlineEditConfig?.type === 'combobox'}\n tabIndex={-1}\n onBlur={handleBlur}\n onFocus={handleFocus}\n >\n <HStack align='center' spacing={Spacing[0]}>\n {visibleErrorText != null && (\n <CellErrorContainer $inset={inlineEditConfig?.type === 'combobox'}>\n <Tooltip\n aria-label={`Error: ${visibleErrorText}`}\n iconTrigger={<CircleAlertIcon color={Color.BorderIconDanger} size='12' />}\n side='top'\n size='sm'\n >\n {visibleErrorText}\n </Tooltip>\n </CellErrorContainer>\n )}\n {inlineEditConfig ? (\n inlineEditConfig.type === 'combobox' ? (\n <InlineCombobox\n itemId={itemId}\n value={value}\n columnKey={columnKey}\n inlineEditConfig={inlineEditConfig}\n rowRef={rowContext?.rowRef}\n hasLeadingError={visibleErrorText != null}\n >\n <StyledCellContent>{children}</StyledCellContent>\n </InlineCombobox>\n ) : (\n <InlineInput\n itemId={itemId}\n value={value}\n columnKey={columnKey}\n inlineEditConfig={inlineEditConfig}\n onEditingEnd={handleDelayedErrorEditingEnd}\n >\n {children}\n </InlineInput>\n )\n ) : (\n <StyledCellContent>{children}</StyledCellContent>\n )}\n {isLastCell && !context.disabled && (\n <RowActions\n actions={actions}\n onDelete={onDelete ? handleDelete : undefined}\n inCombobox={inlineEditConfig?.type === 'combobox'}\n />\n )}\n </HStack>\n </StyledCell>\n );\n};\n\nexport default TableBoxCell;\n","import { useSortable } from '@dnd-kit/sortable';\nimport {\n Children,\n cloneElement,\n type ComponentPropsWithoutRef,\n type FocusEvent,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { CaretButton } from '@persona/design-system/components/Combobox';\nimport { FormGroupContext } from '@persona/design-system/components/ConfigFormGroup';\nimport { Container as FormControlContainer } from '@persona/design-system/components/FormControl';\nimport type { MenuItemProps } from '@persona/design-system/components/Menu';\nimport Popover from '@persona/design-system/components/Popover';\nimport Stack from '@persona/design-system/components/Stack';\nimport { TableCell, TableRow } from '@persona/design-system/components/Table';\nimport { Z_INDICES } from '@persona/design-system/lib/zindex';\nimport { focusOutline } from '@persona/design-system/mixins/focus';\nimport { Elevation } from '@persona/design-system/variables/effect';\nimport { TransitionDuration } from '@persona/design-system/variables/transitions';\nimport { BorderRadius, Color, Spacing, Typography } from '@persona/design-tokens';\nimport { DragIcon } from '@persona/icons';\n\nimport { PinnedActionsCell, TableBoxContext } from './TableBox';\nimport { RowActions, RowActionsContainer } from './TableBoxRowActions';\nimport { TableBoxRowContext } from './TableBoxRowContext';\nimport useDelayedInlineEditError from './useDelayedInlineEditError';\nimport type { DragDirection } from './useTableBoxDragAndDrop';\n\nexport interface TableBoxRowProps extends ComponentPropsWithoutRef<typeof TableRow> {\n /**\n * Row-wide error shown immediately in the first cell until inline editing begins. Focusing any\n * editable input in the row hides the error, and ending the active inline edit resurfaces it\n * after 500ms.\n */\n errorText?: string;\n\n /**\n * Actions to display in a dropdown menu.\n * Supports all props from `MenuItem`.\n */\n actions?: Array<\n {\n label: string;\n onClick: () => void;\n } & Omit<MenuItemProps, 'children'>\n >;\n\n /**\n * Called when the delete (X) icon is clicked. Only renders item-level delete icon if this prop is present.\n * Receives the item's id as a parameter.\n */\n onDelete?: (id: string | number) => void;\n\n /**\n * Form fields to be rendered inside a row dropdown popover.\n * The configField prop will be set to true for all fields via FormGroupContext.\n * Dropdown will be opened when the row is selected.\n */\n dropdownFormFields?: ReactNode;\n\n /**\n * Content to be rendered inside the row dropdown popover.\n * Dropdown will be opened when the row is selected.\n */\n dropdownContent?: ReactNode;\n\n /**\n * Optional heading text to display in the row dropdown popover.\n * Either dropdownFormFields or dropdownContent must also be provided,\n * otherwise the dropdown will not be rendered.\n */\n dropdownHeadingText?: string;\n\n /**\n * Footer to be rendered inside the row dropdown popover.\n * Either dropdownFormFields or dropdownContent must also be provided,\n * otherwise the dropdown will not be rendered.\n */\n dropdownFooter?: ReactNode;\n}\n\nconst StyledRow = styled(TableRow)<{\n $isSelectable?: boolean;\n $isDragging?: boolean;\n $dropIndicatorPosition?: 'top' | 'bottom';\n}>`\n cursor: ${({ $isSelectable }) => ($isSelectable ? 'pointer' : 'default')};\n position: relative;\n /* Give every row a solid background so sticky first-column cells (which\n inherit the row's background) remain opaque during horizontal scroll. */\n background-color: ${Color.BackgroundPrimary};\n\n /* Dim the dragged row in place. A floating clone rendered by @dnd-kit's\n DragOverlay provides the fully-opaque representation that follows the\n pointer. */\n ${({ $isDragging }) =>\n $isDragging &&\n css`\n opacity: 0.5;\n `}\n\n /* 2px brand-colored drop indicator applied to each cell via inset\n box-shadow so the line spans the full row width without affecting\n layout. box-shadow on <td> renders reliably across modern browsers,\n unlike pseudo-elements on <tr>. */\n ${({ $dropIndicatorPosition, theme }) =>\n $dropIndicatorPosition === 'top' &&\n css`\n td {\n box-shadow: inset 0 2px 0 ${theme.color.text.brand};\n }\n `}\n\n ${({ $dropIndicatorPosition, theme }) =>\n $dropIndicatorPosition === 'bottom' &&\n css`\n td {\n box-shadow: inset 0 -2px 0 ${theme.color.text.brand};\n }\n `}\n\n ${CaretButton} {\n opacity: 0;\n transition: opacity ${TransitionDuration.Fast} ease-out;\n\n /* Allow button to shrink to caret SVG height and width, and adjust alignment to remain vertically centered */\n width: auto;\n height: auto;\n top: 50%;\n transform: translateY(-50%);\n }\n\n &:last-child {\n td {\n border-bottom: none;\n &:first-child {\n border-bottom-left-radius: ${BorderRadius.Md};\n }\n &:last-child {\n border-bottom-right-radius: ${BorderRadius.Md};\n }\n }\n }\n\n &[aria-selected='true'] {\n background: ${({ theme }) => theme.color.background.highlight};\n color: ${({ theme }) => theme.color.text.brand};\n }\n\n /* Hover and edit feedback is scoped to rows that respond to a pointer.\n Display-only tables (no selection, reordering, actions or inline editing)\n would otherwise read as clickable. */\n &[data-interactive] {\n &:hover:not([aria-selected='true']) {\n cursor: ${({ $isSelectable }) => ($isSelectable ? 'pointer' : 'default')};\n color: ${({ theme }) => theme.color.text.primary};\n background: ${Color.BackgroundSecondary};\n\n ${RowActionsContainer} {\n opacity: 1;\n background: linear-gradient(to right, transparent, ${Color.BackgroundSecondary} 12px);\n }\n\n ${CaretButton} {\n opacity: 1;\n }\n }\n\n &:has(input:focus),\n &:has(textarea:focus),\n &:has(input[role='combobox'][aria-expanded='true']),\n &:has(input:focus):hover,\n &:has(textarea:focus):hover,\n &:has(input[role='combobox'][aria-expanded='true']):hover,\n &:has(button:focus),\n &:has(button:focus):hover {\n color: ${({ theme }) => theme.color.text.brand};\n background-color: ${({ theme }) => theme.color.background.highlight};\n\n ${RowActionsContainer} {\n opacity: 1;\n background: linear-gradient(\n to right,\n transparent,\n ${({ theme }) => theme.color.background.highlight} ${parseInt(Spacing[3])}px\n );\n }\n\n ${CaretButton} {\n opacity: 1;\n }\n }\n\n /* In fixed-layout mode the actions overlay lives inside the furthest-right\n column's cell, so revealing the delete (X) on focus would park it on top\n of the text being edited. While that column's inline input holds focus,\n keep it hidden; hovering the row still brings it back. */\n &:not(:hover):has(\n td:last-child :is(input:not([role='combobox']), textarea):focus\n ) {\n ${RowActionsContainer} {\n opacity: 0;\n }\n }\n }\n`;\n\nconst DragHandleCell = styled(TableCell)`\n width: 24px;\n padding: ${Spacing[0]} ${Spacing[1]};\n border-bottom: 1px solid ${Color.BorderHairline};\n vertical-align: middle;\n text-align: center;\n`;\n\n// The `grabbing` cursor during an active drag is applied globally via\n// `document.body.style.cursor` in TableBox, so this button only needs to\n// declare the resting `grab` cursor. `:active` covers the brief interval\n// between mousedown and dnd-kit promoting it to an active drag.\nconst DragHandleButton = styled.button.attrs({ type: 'button' })`\n background: none;\n border: none;\n padding: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: grab;\n touch-action: none;\n color: ${Color.TextSecondary};\n ${focusOutline}\n\n &:hover {\n color: ${Color.TextPrimary};\n }\n\n &:active {\n cursor: grabbing;\n }\n`;\n\nconst DropdownPopoverHeading = styled.div`\n ${Typography.TextSmallBold};\n border-bottom: 1px solid ${Color.BorderHairline};\n padding: ${Spacing[2]} ${Spacing[3]} ${Spacing[1]};\n`;\n\nconst DropdownPopoverContent = styled(Stack)`\n min-width: var(--radix-popover-trigger-width);\n padding: ${Spacing[3]};\n\n ${FormControlContainer} {\n min-width: 0;\n }\n`;\n\nconst DropdownPopoverFooter = styled.div`\n border-top: 1px solid ${Color.BorderHairline};\n padding: ${Spacing[1]};\n`;\n\ntype SortableTableBoxRowContentProps = Omit<ComponentPropsWithoutRef<typeof StyledRow>, 'ref'> & {\n id: string | number;\n isSelected: boolean;\n isSelectable: boolean;\n onClick: () => void;\n rowRef: React.MutableRefObject<HTMLTableRowElement | null>;\n draggedDirection: DragDirection;\n};\n\n/**\n * Computes the drop-indicator position for a sortable row. Direction mirrors\n * `HoverCardPropertiesEditTable` / `ListBox`: dragging from above places the\n * line on the hovered row's bottom edge, dragging from below places it on the\n * top edge. The dragged row itself never shows an indicator.\n *\n * `closestCenter` has a \"dead zone\" while the pointer is still over the\n * dragged row's own slot (`overIndex === activeIndex`). We use the drag\n * direction to show the indicator on the immediate neighbor so the\n * \"immediately before/after original\" positions still get feedback.\n */\nconst getDropIndicatorPosition = ({\n isDragging,\n index,\n activeIndex,\n overIndex,\n draggedDirection,\n}: {\n isDragging: boolean;\n index: number;\n activeIndex: number;\n overIndex: number;\n draggedDirection: DragDirection;\n}): 'top' | 'bottom' | undefined => {\n if (isDragging || activeIndex === -1) {\n return undefined;\n }\n if (overIndex === index && overIndex !== activeIndex) {\n return activeIndex < index ? 'bottom' : 'top';\n }\n if (overIndex === activeIndex) {\n if (draggedDirection === 'up' && index === activeIndex - 1) {\n return 'bottom';\n }\n if (draggedDirection === 'down' && index === activeIndex + 1) {\n return 'top';\n }\n }\n return undefined;\n};\n\n/**\n * Inner row component used when drag-and-drop is enabled on the parent\n * TableBox. Subscribes to the surrounding SortableContext via useSortable and\n * renders a leading drag-handle cell.\n */\nconst SortableTableBoxRowContent = ({\n id,\n isSelected,\n isSelectable,\n onClick,\n rowRef,\n draggedDirection,\n children,\n ...props\n}: SortableTableBoxRowContentProps) => {\n const { attributes, listeners, setNodeRef, isDragging, activeIndex, overIndex, index } =\n useSortable({ id: String(id) });\n\n const setRefs = (element: HTMLTableRowElement | null) => {\n rowRef.current = element;\n setNodeRef(element);\n };\n\n const dropIndicatorPosition = getDropIndicatorPosition({\n isDragging,\n index,\n activeIndex,\n overIndex,\n draggedDirection,\n });\n\n return (\n <StyledRow\n {...props}\n ref={setRefs}\n id={String(id)}\n onClick={onClick}\n disableHoverBackground={true}\n aria-selected={isSelected}\n $isSelectable={isSelectable}\n $isDragging={isDragging}\n $dropIndicatorPosition={dropIndicatorPosition}\n >\n <DragHandleCell>\n <DragHandleButton\n aria-label='Drag to reorder'\n {...attributes}\n {...listeners}\n onClick={(e) => e.stopPropagation()}\n >\n <DragIcon />\n </DragHandleButton>\n </DragHandleCell>\n {children}\n </StyledRow>\n );\n};\n\nconst TableBoxRow = ({\n children,\n actions,\n onDelete,\n errorText,\n id,\n dropdownFormFields,\n dropdownContent,\n dropdownHeadingText,\n dropdownFooter,\n onBlur,\n onFocus,\n ...props\n}: TableBoxRowProps) => {\n const context = useContext(TableBoxContext);\n const isSelected = context?.selectedKey === (id as string);\n const isSelectable = context?.selectionMode === 'single';\n const isReorderable = context?.isReorderable ?? false;\n const rowRegistry = context?.rowRegistry ?? null;\n const draggedDirection = context?.draggedDirection ?? null;\n const hasActionsColumn = context?.hasActionsColumn ?? false;\n const isDisabled = context?.disabled ?? false;\n const rowRef = useRef<HTMLTableRowElement>(null);\n const {\n isErrorVisible,\n onBlur: handleDelayedErrorBlur,\n onEditingEnd: handleDelayedErrorEditingEnd,\n onFocus: handleDelayedErrorFocus,\n } = useDelayedInlineEditError(errorText);\n const effectiveActions = isDisabled ? undefined : actions;\n const effectiveOnDelete = isDisabled ? undefined : onDelete;\n const hasRowDropdown = Boolean(dropdownFormFields || dropdownContent);\n // A disabled table keeps its rows viewable and selectable; only inline\n // editing stops, and reordering and actions are already suppressed above.\n const hasInlineEditableColumn =\n !isDisabled && (context?.columns?.some((column) => column.inlineEditConfig != null) ?? false);\n // A row dropdown opens through selection, so it never adds interactivity that\n // `isSelectable` does not already cover.\n const isInteractive =\n isSelectable ||\n isReorderable ||\n hasInlineEditableColumn ||\n (effectiveActions?.length ?? 0) > 0 ||\n effectiveOnDelete != null;\n const dataCells = Children.toArray(children).filter(\n (child): child is ReactElement<{ value?: string }> => isValidElement<{ value?: string }>(child),\n );\n const areOtherCellsBlank = dataCells.slice(1).every((cell) => cell.props.value === '');\n\n const handleFocus = (event: FocusEvent<HTMLTableRowElement>) => {\n handleDelayedErrorFocus(event);\n onFocus?.(event);\n };\n\n const handleBlur = (event: FocusEvent<HTMLTableRowElement>) => {\n handleDelayedErrorBlur(event);\n onBlur?.(event);\n };\n\n const handleClick = () => {\n if (context?.onRowClick && id && isSelectable) {\n context.onRowClick(id as string);\n }\n };\n\n const handleDelete = useCallback(() => {\n if (effectiveOnDelete && id != null) {\n effectiveOnDelete(id);\n }\n }, [effectiveOnDelete, id]);\n const rowContextValue = useMemo(\n () => ({\n rowRef,\n onDelete: effectiveOnDelete && id != null ? handleDelete : undefined,\n onEditingEnd: handleDelayedErrorEditingEnd,\n areOtherCellsBlank,\n }),\n [areOtherCellsBlank, effectiveOnDelete, handleDelayedErrorEditingEnd, handleDelete, id],\n );\n\n // When the last data column is a combobox, lay out the dedicated actions\n // cell with `width: auto` so the caret↔actions gap matches the\n // actions↔delete gap instead of `justify-content: end` parking all the\n // slack on the left.\n const lastColumnIsCombobox = context?.columns?.at(-1)?.inlineEditConfig?.type === 'combobox';\n\n // In horizontal-scroll mode (default) actions live in a dedicated trailing\n // sticky cell. In `disableHorizontalScroll` (legacy) mode there is no\n // trailing column, so we instead inject `actions`/`onDelete`/`itemId`/\n // `isLastCell` into the last data cell via `cloneElement` so the cell can\n // overlay them on top of its content.\n const trailingActionsCell = useMemo(\n () =>\n hasActionsColumn ? (\n <PinnedActionsCell>\n <RowActions\n actions={effectiveActions}\n onDelete={effectiveOnDelete ? handleDelete : undefined}\n inDedicatedColumn\n inCombobox={lastColumnIsCombobox}\n />\n </PinnedActionsCell>\n ) : null,\n [hasActionsColumn, effectiveActions, effectiveOnDelete, handleDelete, lastColumnIsCombobox],\n );\n\n const renderedChildren = useMemo(() => {\n if (hasActionsColumn && !isErrorVisible) {\n return children;\n }\n\n const childrenArray = Children.toArray(children);\n const firstChildIndex = isErrorVisible ? childrenArray.findIndex(isValidElement) : -1;\n const lastChildIndex = childrenArray.length - 1;\n return childrenArray.map((child, index) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n const isFirstCell = index === firstChildIndex;\n const isLastCell = !hasActionsColumn && index === lastChildIndex;\n if (!isFirstCell && !isLastCell) {\n return child;\n }\n\n return cloneElement(child as ReactElement, {\n ...(isFirstCell && { rowErrorText: errorText }),\n ...(isLastCell && {\n isLastCell: true,\n actions: effectiveActions,\n onDelete: effectiveOnDelete,\n }),\n // The cell-side `handleDelete` falsy-checks `itemId` before invoking\n // `onDelete`, so we must seed it from the row id — otherwise delete\n // in fixed-layout mode silently no-ops.\n ...(isLastCell && id != null && { itemId: String(id) }),\n });\n });\n }, [\n hasActionsColumn,\n children,\n effectiveActions,\n effectiveOnDelete,\n errorText,\n id,\n isErrorVisible,\n ]);\n\n // Provider sits between `<tr>` and the `<td>` cells (a React-only wrapper)\n // so the row itself is still a single DOM element. This matters for the\n // Popover trigger below: Radix's `<PopoverTrigger asChild>` clones the\n // trigger element to attach a ref, and `Context.Provider` doesn't forward\n // refs, so we cannot wrap the whole row with the Provider.\n const rowChildrenWithContext = useMemo(\n () => (\n <TableBoxRowContext.Provider value={rowContextValue}>\n {renderedChildren}\n {trailingActionsCell}\n </TableBoxRowContext.Provider>\n ),\n [renderedChildren, trailingActionsCell, rowContextValue],\n );\n\n // Register the row's content with the drag overlay registry so the\n // `DragOverlay` clone can mirror this row when it becomes active. Updating\n // in an effect (rather than during render) keeps render side-effect-free.\n // The registered subtree includes the `TableBoxRowContext` provider so the\n // overlay clone's cells can still resolve `rowRef` (used by inline\n // comboboxes with `fullWidthComboboxDropdown`).\n useEffect(() => {\n if (!rowRegistry || id == null) {\n return undefined;\n }\n const key = String(id);\n const registry = rowRegistry.current;\n registry.set(key, rowChildrenWithContext);\n return () => {\n registry.delete(key);\n };\n }, [id, rowChildrenWithContext, rowRegistry]);\n\n const rowContent = isReorderable ? (\n <SortableTableBoxRowContent\n {...props}\n data-interactive={isInteractive || undefined}\n id={id as string | number}\n isSelected={isSelected}\n isSelectable={isSelectable}\n onClick={handleClick}\n onBlur={handleBlur}\n onFocus={handleFocus}\n rowRef={rowRef}\n draggedDirection={draggedDirection}\n >\n {rowChildrenWithContext}\n </SortableTableBoxRowContent>\n ) : (\n <StyledRow\n {...props}\n data-interactive={isInteractive || undefined}\n ref={rowRef}\n id={id}\n onClick={handleClick}\n onBlur={handleBlur}\n onFocus={handleFocus}\n disableHoverBackground={true}\n aria-selected={isSelected}\n $isSelectable={isSelectable}\n >\n {rowChildrenWithContext}\n </StyledRow>\n );\n\n if (hasRowDropdown) {\n return (\n <Popover trigger={rowContent} open={isSelected}>\n <Popover.Card\n id={context?.rowDropdownId}\n noPadding\n style={{ zIndex: Z_INDICES.modalDropdown }}\n >\n {dropdownHeadingText && (\n <DropdownPopoverHeading>{dropdownHeadingText}</DropdownPopoverHeading>\n )}\n {dropdownFormFields && (\n <DropdownPopoverContent spacing={Spacing[2]}>\n <FormGroupContext.Provider\n value={{\n configField: true,\n labelTooltipZIndex: Z_INDICES.modalDropdownTooltip,\n }}\n >\n {dropdownFormFields}\n </FormGroupContext.Provider>\n </DropdownPopoverContent>\n )}\n {dropdownContent && (\n <DropdownPopoverContent spacing={Spacing[3]}>{dropdownContent}</DropdownPopoverContent>\n )}\n {dropdownFooter && <DropdownPopoverFooter>{dropdownFooter}</DropdownPopoverFooter>}\n </Popover.Card>\n </Popover>\n );\n }\n\n return rowContent;\n};\n\n// Styled wrapper that lets a single `<tr>` be portaled by dnd-kit's\n// DragOverlay while preserving the TableBox's table-based styling. Uses\n// `table-layout: fixed` so the widths declared in the accompanying\n// `<colgroup>` are authoritative and columns line up 1:1 with the source\n// row (which would otherwise re-flow via auto layout).\nconst OverlayTable = styled.table`\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n border: 1px solid ${Color.BorderDivider};\n border-radius: ${BorderRadius.Md};\n background: ${Color.BackgroundPrimary};\n box-shadow: ${Elevation.High};\n`;\n\n/**\n * Visual clone of a `TableBoxRow` used inside `@dnd-kit`'s `DragOverlay`.\n * Renders a minimal table wrapper with a static drag-handle cell followed by\n * the original row's cells, so the portaled overlay looks identical to the\n * dragged row while it follows the pointer.\n *\n * `cellWidths` is the measured width (in px) of each `<td>` in the source\n * row at drag start, in source order (drag handle cell first, then content\n * cells). Applied via a `<colgroup>` with `table-layout: fixed` so the\n * overlay's columns align 1:1 with the source table instead of re-flowing\n * to the single row's content.\n */\nexport const TableBoxRowOverlay = ({\n children,\n cellWidths,\n}: {\n children: ReactNode;\n cellWidths: number[];\n}) => (\n <OverlayTable aria-hidden='true'>\n <colgroup>\n {cellWidths.map((width, i) => (\n <col key={i} style={{ width: `${width}px` }} />\n ))}\n </colgroup>\n <tbody>\n <StyledRow data-interactive disableHoverBackground={true}>\n <DragHandleCell>\n <DragHandleButton tabIndex={-1} aria-hidden='true'>\n <DragIcon />\n </DragHandleButton>\n </DragHandleCell>\n {children}\n </StyledRow>\n </tbody>\n </OverlayTable>\n);\n\nexport default TableBoxRow;\n","import { type RefObject, useCallback, useState } from 'react';\n\ninterface UseColumnWidthLockOptions {\n /**\n * When false, the hook becomes a no-op — `lockedColWidths` stays `null`\n * and `setColumnWidthsLocked` does nothing. Use when the table is already in\n * `table-layout: fixed` mode, where the input swap can't reflow columns.\n */\n enabled?: boolean;\n}\n\n/**\n * Captures the live `<th>` widths of a table the moment inline editing starts\n * and clears them when editing ends.\n *\n * Consumers render a `<colgroup>` from `lockedColWidths` and switch the table\n * to `table-layout: fixed` for the duration of the edit so the input swap\n * doesn't reflow the columns.\n */\nexport const useColumnWidthLock = (\n tableRef: RefObject<HTMLTableElement>,\n { enabled = true }: UseColumnWidthLockOptions = {},\n) => {\n const [lockedColWidths, setLockedColWidths] = useState<number[] | null>(null);\n\n const setColumnWidthsLocked = useCallback(\n (isLocked: boolean) => {\n if (!enabled) {\n return;\n }\n if (!isLocked) {\n setLockedColWidths(null);\n return;\n }\n const ths = Array.from(\n tableRef.current?.querySelectorAll<HTMLTableCellElement>(':scope > thead > tr > th') ?? [],\n );\n if (ths.length > 0) {\n setLockedColWidths(ths.map((th) => th.getBoundingClientRect().width));\n }\n },\n [tableRef, enabled],\n );\n\n return { lockedColWidths, setColumnWidthsLocked };\n};\n","import {\n closestCenter,\n type DndContextProps,\n type DragEndEvent,\n type DragMoveEvent,\n type DragStartEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport { sortableKeyboardCoordinates } from '@dnd-kit/sortable';\nimport {\n type ReactNode,\n type RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { findIndexByKey, moveItemByIndex } from '@persona/design-system/lib/reorderItems';\n\n/**\n * Vertical direction of an active drag relative to its starting position.\n * `null` means the pointer hasn't moved far enough from the drag origin to\n * infer a direction.\n */\nexport type DragDirection = 'up' | 'down' | null;\n\n// Small threshold so tiny pointer jitter at rest doesn't toggle the\n// indicator on and off.\nconst DRAG_DIRECTION_THRESHOLD = 4;\n\nexport interface ReorderConfig<T extends object> {\n items: T[];\n itemKeyPath: keyof T & string;\n onReorder: (reorderedItems: T[]) => void;\n}\n\ninterface UseTableBoxDragAndDropArgs<T extends object> {\n tableRef: RefObject<HTMLTableElement>;\n reorderConfig: ReorderConfig<T> | undefined;\n}\n\ninterface UseTableBoxDragAndDropResult {\n /**\n * `id` of the row currently being dragged, or `null` when no drag is active.\n * Use this to derive the DragOverlay content via the `rowRegistry`.\n */\n activeId: string | null;\n /**\n * Cell widths captured at drag start, in source order. Apply via a\n * `<colgroup>` with `table-layout: fixed` on the overlay table so its\n * columns line up 1:1 with the source row.\n */\n overlayCellWidths: number[] | null;\n /**\n * Current vertical direction of the active drag. Rows use this to place\n * the drop indicator on a neighbor when the pointer is still within the\n * dragged row's slot.\n */\n draggedDirection: DragDirection;\n /**\n * Sortable ids in source order. Pass to the `SortableContext`'s `items`.\n */\n sortableIds: string[];\n /**\n * Registry of row content keyed by row id, populated by each `TableBoxRow`\n * and read when rendering the DragOverlay clone. Always non-null when\n * drag-and-drop is enabled (i.e. `reorderConfig` is set).\n */\n rowRegistry: React.MutableRefObject<Map<string, ReactNode>>;\n /**\n * Spread on `DndContext`. Includes sensors, collision detection, and the\n * lifecycle handlers that update the rest of this hook's state.\n */\n dndContextProps: Pick<\n DndContextProps,\n 'sensors' | 'collisionDetection' | 'onDragStart' | 'onDragMove' | 'onDragEnd' | 'onDragCancel'\n >;\n}\n\n/**\n * Bundles the `@dnd-kit` wiring TableBox needs to support row reordering:\n * sensors, lifecycle handlers, the dragged row's overlay content, and the\n * pointer direction used by rows to position drop indicators in dnd-kit's\n * \"dead zone\" (overIndex === activeIndex).\n *\n * Also forces a `grabbing` cursor on `<body>` while a row is active so the\n * cursor persists when the pointer leaves the drag handle.\n */\nexport const useTableBoxDragAndDrop = <T extends object>({\n tableRef,\n reorderConfig,\n}: UseTableBoxDragAndDropArgs<T>): UseTableBoxDragAndDropResult => {\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),\n );\n\n const rowRegistry = useRef<Map<string, ReactNode>>(new Map());\n const [activeId, setActiveId] = useState<string | null>(null);\n const [draggedDirection, setDraggedDirection] = useState<DragDirection>(null);\n const [overlayCellWidths, setOverlayCellWidths] = useState<number[] | null>(null);\n\n useEffect(() => {\n if (activeId == null) {\n return undefined;\n }\n const previous = document.body.style.cursor;\n document.body.style.cursor = 'grabbing';\n return () => {\n document.body.style.cursor = previous;\n };\n }, [activeId]);\n\n const sortableIds = useMemo(() => {\n if (!reorderConfig) {\n return [];\n }\n return reorderConfig.items.map((item) => String(item[reorderConfig.itemKeyPath]));\n }, [reorderConfig]);\n\n const handleDragStart = useCallback(\n (event: DragStartEvent) => {\n const id = String(event.active.id);\n setActiveId(id);\n setDraggedDirection(null);\n\n // Scope to tableRef so we don't match unrelated elements sharing the id.\n const rowElement = tableRef.current?.querySelector<HTMLTableRowElement>(\n `tr[id=\"${CSS.escape(id)}\"]`,\n );\n if (rowElement) {\n const widths = Array.from(rowElement.children)\n .filter((child): child is HTMLTableCellElement => child.tagName === 'TD')\n .map((td) => td.getBoundingClientRect().width);\n setOverlayCellWidths(widths);\n } else {\n setOverlayCellWidths(null);\n }\n },\n [tableRef],\n );\n\n const handleDragMove = useCallback((event: DragMoveEvent) => {\n const { y } = event.delta;\n const next: DragDirection =\n y < -DRAG_DIRECTION_THRESHOLD ? 'up' : y > DRAG_DIRECTION_THRESHOLD ? 'down' : null;\n setDraggedDirection((prev) => (prev === next ? prev : next));\n }, []);\n\n const resetDragState = useCallback(() => {\n setActiveId(null);\n setDraggedDirection(null);\n setOverlayCellWidths(null);\n }, []);\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n resetDragState();\n if (!reorderConfig) {\n return;\n }\n const { active, over } = event;\n if (!over || active.id === over.id) {\n return;\n }\n const { items, itemKeyPath, onReorder } = reorderConfig;\n const fromIndex = findIndexByKey(items, itemKeyPath, String(active.id));\n const toIndex = findIndexByKey(items, itemKeyPath, String(over.id));\n if (fromIndex === -1 || toIndex === -1) {\n return;\n }\n onReorder(moveItemByIndex(items, fromIndex, toIndex));\n },\n [reorderConfig, resetDragState],\n );\n\n return {\n activeId,\n overlayCellWidths,\n draggedDirection,\n sortableIds,\n rowRegistry,\n dndContextProps: {\n sensors,\n collisionDetection: closestCenter,\n onDragStart: handleDragStart,\n onDragMove: handleDragMove,\n onDragEnd: handleDragEnd,\n onDragCancel: resetDragState,\n },\n };\n};\n","import { DndContext, DragOverlay } from '@dnd-kit/core';\nimport { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';\nimport { uniqueId } from 'lodash-es';\nimport {\n createContext,\n type PropsWithChildren,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { ComboboxOptionsOrGroups } from '@persona/design-system/components/Combobox';\nimport Table, {\n TableBody,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableRow,\n} from '@persona/design-system/components/Table';\nimport { useScrollOverflow } from '@persona/design-system/lib/useScrollOverflow';\nimport { Z_INDICES } from '@persona/design-system/lib/zindex';\nimport { focusOutline } from '@persona/design-system/mixins/focus';\nimport { paragraphMixins } from '@persona/design-system/mixins/text';\nimport { TransitionDuration } from '@persona/design-system/variables/transitions';\nimport { BorderRadius, Color, Spacing, Typography } from '@persona/design-tokens';\n\nimport TableBoxCell from './TableBoxCell';\nimport TableBoxRow, { TableBoxRowOverlay } from './TableBoxRow';\nimport { RowActionsContainerWithFadeWidth } from './TableBoxRowActions';\nimport { useColumnWidthLock } from './useColumnWidthLock';\nimport {\n type DragDirection,\n type ReorderConfig,\n useTableBoxDragAndDrop,\n} from './useTableBoxDragAndDrop';\n\nexport type { DragDirection } from './useTableBoxDragAndDrop';\n\nexport interface InlineEditConfig {\n type: 'text' | 'combobox';\n options?: ComboboxOptionsOrGroups;\n /**\n * Whether to render the combobox dropdown in a portal (breaks out of overflow containers)\n */\n useComboboxPortal?: boolean;\n /**\n * When true, the combobox dropdown will use the table row as the containerRef,\n * allowing the dropdown to span the full width of the row. Passing true will also\n * automatically set useComboboxPortal to true, since the positioning logic relies on\n * portaling. Defaults to false.\n */\n fullWidthComboboxDropdown?: boolean;\n /**\n * Whether to support multiline text input. When true, renders a textarea instead of input.\n * Default state: limits display to 2 lines with ellipsis.\n * Focused/editing state: expands to show all lines.\n * Only applies when type is 'text'. Defaults to false.\n */\n multiline?: boolean;\n /** Ellipsize the closed-state display instead of letting it overflow. Combobox only; off by default to preserve existing layouts. */\n truncateDisplay?: boolean;\n placeholder?: string;\n onChange: (id: string, value: string) => void;\n}\n\ninterface TableBoxContextValue {\n disabled: boolean;\n newRowId?: string | null;\n columns: Array<{\n key: string;\n title: string;\n inlineEditConfig?: InlineEditConfig;\n }>;\n selectedKey: string | null;\n selectionMode: 'single' | 'none';\n onRowClick: (rowId: string) => void;\n tableBoxId: string;\n rowDropdownId: string;\n /**\n * True when the TableBox has a `reorderConfig` set. Rows use this to know\n * whether to render a leading drag-handle cell and wire up `useSortable`.\n */\n isReorderable: boolean;\n /**\n * Current vertical direction of the active drag, or `null` when no drag is\n * in progress. Rows use this to position the drop indicator on a neighbor\n * when the pointer is in dnd-kit's \"dead zone\" (`overIndex === activeIndex`).\n */\n draggedDirection: DragDirection;\n /**\n * Registry of row content keyed by row id. Rows write their content here so\n * the DragOverlay can render the dragged row. `null` when reordering is\n * disabled.\n */\n rowRegistry: React.MutableRefObject<Map<string, React.ReactNode>> | null;\n /**\n * True when the TableBox renders a dedicated sticky trailing column for\n * row actions. False when `disableHorizontalScroll` is set, in which case\n * actions are injected into the last data cell instead.\n */\n hasActionsColumn: boolean;\n /**\n * True when the scroll container is using `overflow-x: auto`. Drives the\n * sticky-column edge shadow and right-edge fade affordance.\n */\n hasHorizontalOverflow: boolean;\n /**\n * True when the scroll container clips overflowing content — either\n * because content is wider than the box (`overflow-x: auto`) or because\n * `maxHeight` forced `overflow-y: auto` (which also computes\n * `overflow-x: visible` to `auto` per CSS Overflow §3). Cells force\n * inline-edit combobox dropdowns into a portal in this case so they\n * aren't clipped.\n */\n clipsOverflow: boolean;\n /**\n * Locks or unlocks measured column widths (`table-layout: fixed`) so\n * inline-edit input swaps don't cause a layout reflow.\n */\n setColumnWidthsLocked: (isLocked: boolean) => void;\n /** Schedules row creation after the current inline edit has rendered. */\n scheduleCreateNewRowAfterCommit?: () => void;\n}\n\nexport const TableBoxContext = createContext<TableBoxContextValue | null>(null);\n\nexport interface TableBoxProps<T extends object = object> {\n /** Text to display if no rows are available. */\n emptyText?: string;\n /** Selected key for the table. */\n selectedKey?: string | null;\n /** Default selected key for the table (uncontrolled mode). */\n defaultSelectedKey?: string | null;\n /** Called when selection changes. */\n onSelectionChange?: (selectedKey: string | null) => void;\n /**\n * Selection mode for the table. 'single' allows one row to be selected at a time,\n * 'none' disables row selection entirely.\n */\n selectionMode?: 'single' | 'none';\n /** ARIA label for the table. */\n 'aria-label': string;\n /** Column definitions for the table headers. */\n columns: Array<{\n key: string;\n title: string;\n /** Inline edit configuration for this column */\n inlineEditConfig?: InlineEditConfig;\n }>;\n /** ID of the newly created row that should be focused */\n newRowId?: string | null;\n /** Creates a row after a single-line inline edit is committed with Enter. */\n onCreateNewRow?: () => void;\n /** When true, table content remains viewable but row mutations and inline editing are disabled. */\n disabled?: boolean;\n /**\n * Opt out of the horizontally-scrolling layout and restore the legacy\n * behavior where the table is locked to its container width and long cell\n * values are truncated (`table-layout: fixed`, `width: 100%`, no sticky\n * first column, no horizontal overflow).\n *\n * Use this for callers that expect the table to always fit inside a\n * narrow container and don't benefit from a scroll affordance — e.g.\n * small summary tables whose content is known to fit.\n *\n * Defaults to `false` (horizontal scrolling + sticky first column).\n * Automatically forced to `true` when any column declares\n * `inlineEditConfig`, since inline editing requires a stable\n * non-scrolling layout.\n */\n disableHorizontalScroll?: boolean;\n /**\n * When provided, enables drag and drop row reordering. Mirrors the\n * `reorderConfig` API on `ListBox`, but since `TableBox` renders rows from\n * children rather than an `items` prop, the item array lives inside\n * `reorderConfig`.\n */\n reorderConfig?: ReorderConfig<T>;\n /**\n * Hide the column header row. Useful for single-column tables where the\n * surrounding `FormField` label already describes the data, so the column\n * title would be visually redundant.\n *\n * When true, the first body row's top corners are rounded to match the\n * outer container, since there's no header cell to provide that rounding.\n *\n * Defaults to `false`.\n */\n hideHeader?: boolean;\n /**\n * Caps the table body height and scrolls vertically inside the bordered\n * container. The column header stays pinned while rows scroll.\n */\n maxHeight?: number | string;\n}\n\n// Must match `DragHandleHeaderCell`/`DragHandleCell` so the sticky offset aligns.\nconst DRAG_HANDLE_CELL_WIDTH = 24;\n\nconst RIGHT_FADE_WIDTH = 48;\n\n// Must match `TableScrollContainer`'s border so the fades sit flush inside it.\nconst CONTAINER_BORDER_WIDTH_PX = 1;\n\n// Paint order for the overlapping pieces, lowest first — compose from\n// Z_INDICES.sticky per lib/zindex.ts. Each fade strip is layered against the\n// row band it covers: the body fade stays under the row actions so buttons\n// remain legible, while the header fade tops the stack because the header band\n// holds no interactive content.\nconst STICKY_COLUMN_Z_INDEX = Z_INDICES.sticky;\nconst BODY_FADE_Z_INDEX = Z_INDICES.sticky + 1;\nconst PINNED_ACTIONS_Z_INDEX = Z_INDICES.sticky + 2;\nconst STICKY_HEADER_Z_INDEX = Z_INDICES.sticky + 3;\nconst STICKY_CORNER_Z_INDEX = Z_INDICES.sticky + 4;\nconst HEADER_FADE_Z_INDEX = Z_INDICES.sticky + 5;\n\n// Spacing[1] top/bottom padding and 1px border from TableHeaderCell, plus\n// line height (which never wraps).\nconst HEADER_HEIGHT_PX =\n parseInt(Spacing[1], 10) * 2 + parseInt(Typography.TextSmall.lineHeight, 10) + 1;\n\n// `overflow-x` stays `visible` until overflow is detected so inline combobox\n// dropdowns can escape without portaling (portaled dropdowns get aria-hidden by\n// ancestor RAC modals). `overflow-y` stays `visible` unless `maxHeight` is set\n// — pairing `overflow-y: auto` with `overflow-x: visible` would compute both\n// axes to `auto` (CSS Overflow §3) and clip those same dropdowns.\nconst TableScrollContainer = styled.div<{\n $fixedLayout: boolean;\n $hasHorizontalOverflow: boolean;\n $maxHeight?: number | string;\n}>`\n border: ${CONTAINER_BORDER_WIDTH_PX}px solid ${Color.BorderDivider};\n border-radius: ${BorderRadius.Md};\n overflow-x: ${({ $fixedLayout, $hasHorizontalOverflow }) =>\n $fixedLayout ? 'visible' : $hasHorizontalOverflow ? 'auto' : 'visible'};\n overflow-y: ${({ $maxHeight }) => ($maxHeight != null ? 'auto' : 'visible')};\n overscroll-behavior-x: none;\n ${({ $maxHeight }) =>\n $maxHeight != null &&\n css`\n max-height: ${typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n `}\n`;\n\n// Anchors the fade overlay outside the scroll container. Anchoring it to the\n// container itself would make it scroll along with the table content.\nconst ScrollAffordanceWrapper = styled.div`\n position: relative;\n`;\n\n// Right-edge fade affordance. The header and body bands fade to their own\n// backgrounds and are split into separate strips so each can be layered against\n// the content it covers. The 1px gap between them keeps the <thead>'s bottom\n// border uninterrupted.\nconst RightFadeOverlay = styled.div<{ $visible: boolean; $scrollbarWidth: number }>`\n position: absolute;\n right: ${({ $scrollbarWidth }) => CONTAINER_BORDER_WIDTH_PX + $scrollbarWidth}px;\n width: ${RIGHT_FADE_WIDTH}px;\n pointer-events: none;\n opacity: ${({ $visible }) => ($visible ? 1 : 0)};\n transition: opacity ${TransitionDuration.Fast} ease-out;\n`;\n\nconst HeaderFadeOverlay = styled(RightFadeOverlay).attrs({\n 'data-scroll-affordance': 'header-fade',\n})`\n top: ${CONTAINER_BORDER_WIDTH_PX}px;\n height: ${Math.max(0, HEADER_HEIGHT_PX - CONTAINER_BORDER_WIDTH_PX)}px;\n z-index: ${HEADER_FADE_Z_INDEX};\n background: linear-gradient(to right, transparent, ${Color.BackgroundSecondary});\n border-top-right-radius: ${BorderRadius.Md};\n`;\n\nconst BodyFadeOverlay = styled(RightFadeOverlay).attrs({\n 'data-scroll-affordance': 'body-fade',\n})<{\n $hideHeader: boolean;\n $scrollbarHeight: number;\n}>`\n top: ${({ $hideHeader }) =>\n $hideHeader\n ? `${CONTAINER_BORDER_WIDTH_PX}px`\n : `${CONTAINER_BORDER_WIDTH_PX + HEADER_HEIGHT_PX}px`};\n bottom: ${({ $scrollbarHeight }) => CONTAINER_BORDER_WIDTH_PX + $scrollbarHeight}px;\n z-index: ${BODY_FADE_Z_INDEX};\n background: linear-gradient(to right, transparent, ${Color.BackgroundPrimary});\n border-bottom-right-radius: ${BorderRadius.Md};\n ${({ $hideHeader }) =>\n $hideHeader &&\n css`\n border-top-right-radius: ${BorderRadius.Md};\n `}\n`;\n\n// Pins the leading sticky column(s) during horizontal scroll. In reorderable\n// mode the drag handle (col 1) and the first content column (col 2) are\n// BOTH sticky and sit flush — the handle at `left: 0`, content at\n// `left: DRAG_HANDLE_CELL_WIDTH`. Otherwise only the first content column\n// (col 1) is sticky.\nconst stickyContentColumn = (isReorderable: boolean, stickyHeader: boolean) => css`\n && thead th:first-child,\n && tbody td:first-child {\n position: sticky;\n left: 0;\n z-index: ${STICKY_COLUMN_Z_INDEX};\n }\n\n && tbody td:first-child {\n background-color: inherit;\n }\n\n ${\n isReorderable &&\n css`\n && thead th:nth-child(2),\n && tbody td:nth-child(2) {\n position: sticky;\n left: ${DRAG_HANDLE_CELL_WIDTH}px;\n z-index: ${STICKY_COLUMN_Z_INDEX};\n }\n\n && tbody td:nth-child(2) {\n background-color: inherit;\n }\n `\n }\n\n ${\n stickyHeader &&\n css`\n && thead th {\n position: sticky;\n top: 0;\n z-index: ${STICKY_HEADER_Z_INDEX};\n background-color: ${Color.BackgroundSecondary};\n }\n\n ${isReorderable ? `&& thead th:nth-child(-n+2)` : `&& thead th:first-child`} {\n z-index: ${STICKY_CORNER_Z_INDEX};\n }\n `\n }\n`;\n\nconst StyledTable = styled(Table)<{\n $isReorderable: boolean;\n $hasHorizontalOverflow: boolean;\n $fixedLayout: boolean;\n $lockedWidth: number | undefined;\n $hideHeader: boolean;\n $stickyHeader: boolean;\n}>`\n caret-color: ${Color.BorderFocus};\n\n &::selection {\n background: ${Color.BackgroundLabelPurple};\n }\n\n ${({ $fixedLayout, $isReorderable, $stickyHeader }) =>\n $fixedLayout\n ? css`\n /* Legacy: truncate long cell content to container width. */\n table-layout: fixed;\n\n ${\n $stickyHeader &&\n css`\n && thead th {\n position: sticky;\n top: 0;\n z-index: ${STICKY_HEADER_Z_INDEX};\n background-color: ${Color.BackgroundSecondary};\n }\n `\n }\n `\n : stickyContentColumn($isReorderable, $stickyHeader)}\n\n /* Lock column widths while inline editing to prevent layout reflow. */\n ${({ $fixedLayout, $lockedWidth }) =>\n !$fixedLayout &&\n $lockedWidth != null &&\n css`\n table-layout: fixed;\n width: ${$lockedWidth}px;\n `}\n\n /* Subtle right border on the sticky column when content extends off-screen\n — inset shadow keeps it layout-neutral. */\n ${({ $hasHorizontalOverflow, $isReorderable, $fixedLayout }) =>\n $hasHorizontalOverflow &&\n !$fixedLayout &&\n css`\n ${\n $isReorderable\n ? `&& thead th:nth-child(2), && tbody td:nth-child(2)`\n : `&& thead th:first-child, && tbody td:first-child`\n } {\n box-shadow: inset -1px 0 0 ${Color.BorderDivider};\n }\n `}\n\n /* When the header is hidden, round the first body row's outer corners so\n they line up with the surrounding container's rounded border. */\n ${({ $hideHeader }) =>\n $hideHeader &&\n css`\n && tbody tr:first-child td:first-child {\n border-top-left-radius: ${BorderRadius.Md};\n }\n && tbody tr:first-child td:last-child {\n border-top-right-radius: ${BorderRadius.Md};\n }\n `}\n`;\n\nconst StyledTableHeaderCell = styled(TableHeaderCell)`\n padding: ${Spacing[1]} ${Spacing[2]};\n border-bottom: 1px solid ${Color.BorderDivider};\n ${paragraphMixins.sm};\n\n /* Border radius for corner cells */\n &:first-child {\n border-radius: ${BorderRadius.Md} 0 0 0;\n }\n\n &:last-child {\n border-radius: 0 ${BorderRadius.Md} 0 0;\n }\n`;\n\n// Narrow leading column that holds the drag handle when drag-and-drop is enabled.\nconst DragHandleHeaderCell = styled(StyledTableHeaderCell)`\n width: 24px;\n padding: ${Spacing[1]} ${Spacing[0]};\n`;\n\n// Trailing sticky column for row actions (horizontal scroll mode only).\nexport const PinnedActionsCell = styled(TableCell)`\n position: sticky;\n right: 0;\n z-index: ${PINNED_ACTIONS_Z_INDEX};\n background: transparent;\n border-bottom: 1px solid ${Color.BorderHairline};\n padding: 0;\n width: ${RowActionsContainerWithFadeWidth}px;\n height: 1px; /* dummy height lets the child use height: 100% */\n`;\n\nconst EmptyStateCell = styled(TableCell)`\n ${paragraphMixins.sm};\n /* Same vertical padding as TableBoxCell so empty and populated tables share a\n stable row height. */\n padding: ${Spacing[1]} ${Spacing[2]};\n color: ${Color.TextSecondary};\n border-bottom: none;\n`;\n\nconst EmptyStateButton = styled.button`\n ${paragraphMixins.sm};\n padding: 0;\n color: inherit;\n background: none;\n border: none;\n cursor: pointer;\n ${focusOutline}\n`;\n\nconst TableBox = <T extends object>({\n children,\n emptyText,\n selectedKey,\n defaultSelectedKey,\n columns,\n onSelectionChange,\n selectionMode = 'none',\n newRowId,\n onCreateNewRow: onCreateNewRowProp,\n disabled = false,\n reorderConfig,\n disableHorizontalScroll: disableHorizontalScrollProp = false,\n hideHeader = false,\n maxHeight,\n 'aria-label': ariaLabel,\n ...props\n}: PropsWithChildren<TableBoxProps<T>>) => {\n const tableRef = useRef<HTMLTableElement>(null);\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const tableBoxId = useMemo(() => uniqueId('tablebox-'), []);\n const rowDropdownId = `${tableBoxId}-row-dropdown`;\n\n // Inline editing swaps inputs in/out of cells, which requires a stable\n // non-scrolling layout; fall back to fixed layout regardless of caller intent.\n const hasInlineEditableColumn = columns.some((c) => c.inlineEditConfig != null);\n const disableHorizontalScroll = disableHorizontalScrollProp || hasInlineEditableColumn;\n\n const { hasHorizontalOverflow, hasMoreScrollRight, scrollbarSize } = useScrollOverflow(\n scrollContainerRef,\n { enabled: !disableHorizontalScroll },\n );\n const { lockedColWidths, setColumnWidthsLocked } = useColumnWidthLock(tableRef, {\n enabled: !disableHorizontalScroll,\n });\n\n // Selection — controlled if `selectedKey` is set, otherwise internal.\n const [internalSelectedKey, setInternalSelectedKey] = useState<string | null>(\n defaultSelectedKey ?? null,\n );\n const [shouldCreateNewRowAfterCommit, setShouldCreateNewRowAfterCommit] = useState(false);\n const currentSelectedKey = selectedKey ?? internalSelectedKey;\n const scheduleCreateNewRowAfterCommit = () => {\n setShouldCreateNewRowAfterCommit(true);\n };\n\n const handleRowClick = useCallback(\n (rowId: string) => {\n if (selectionMode === 'none') {\n return;\n }\n if (!onSelectionChange) {\n setInternalSelectedKey(rowId);\n } else {\n onSelectionChange(rowId);\n }\n },\n [onSelectionChange, selectionMode],\n );\n\n // Deselect rows when clicking outside the TableBox while a row dropdown is open.\n const handleOutsideClick = useCallback(\n (event: MouseEvent) => {\n const rowDropdownIsOpen = document.querySelector(\n `[id=\"${rowDropdownId}\"][data-state=\"open\"]`,\n );\n if (!rowDropdownIsOpen) {\n return;\n }\n const target = event.target as HTMLElement;\n const isOutsideTableBox = tableRef.current && !tableRef.current.contains(target);\n const isOnRowDropdownContent = target.closest(`[id=\"${rowDropdownId}\"]`);\n if (isOutsideTableBox && !isOnRowDropdownContent && currentSelectedKey != null) {\n if (!onSelectionChange) {\n setInternalSelectedKey(null);\n } else {\n onSelectionChange(null);\n }\n }\n },\n [currentSelectedKey, onSelectionChange, rowDropdownId],\n );\n\n useEffect(() => {\n document.addEventListener('mousedown', handleOutsideClick);\n return () => {\n document.removeEventListener('mousedown', handleOutsideClick);\n };\n }, [handleOutsideClick]);\n\n useEffect(() => {\n if (!shouldCreateNewRowAfterCommit) {\n return;\n }\n // The cell edit and row creation may both replace a caller-owned array.\n // Create after the edit render so the callback reads the updated array.\n setShouldCreateNewRowAfterCommit(false);\n onCreateNewRowProp?.();\n }, [onCreateNewRowProp, shouldCreateNewRowAfterCommit]);\n\n const {\n activeId,\n overlayCellWidths,\n draggedDirection,\n sortableIds,\n rowRegistry,\n dndContextProps,\n } = useTableBoxDragAndDrop({ tableRef, reorderConfig: disabled ? undefined : reorderConfig });\n\n const isReorderable = !disabled && reorderConfig != null;\n const hasActionsColumn = !disableHorizontalScroll;\n // Only `maxHeight` makes the container a vertical scrollport. Without one, a\n // sticky header would pin against the page scroller while the rest of the\n // table scrolls past it.\n const stickyHeader = maxHeight != null && !hideHeader;\n\n const contextValue: TableBoxContextValue = {\n disabled,\n newRowId,\n columns,\n selectedKey: currentSelectedKey,\n selectionMode,\n onRowClick: handleRowClick,\n tableBoxId,\n rowDropdownId,\n isReorderable,\n rowRegistry: isReorderable ? rowRegistry : null,\n draggedDirection,\n hasActionsColumn,\n hasHorizontalOverflow,\n clipsOverflow: hasHorizontalOverflow || maxHeight != null,\n setColumnWidthsLocked,\n scheduleCreateNewRowAfterCommit: onCreateNewRowProp\n ? scheduleCreateNewRowAfterCommit\n : undefined,\n };\n\n const isEmpty = Array.isArray(children) ? children.length === 0 : children == null;\n const totalColumnCount = columns.length + (isReorderable ? 1 : 0) + (hasActionsColumn ? 1 : 0);\n\n const activeRowContent = activeId ? (rowRegistry.current.get(activeId) ?? null) : null;\n\n const tableContent = (\n <ScrollAffordanceWrapper>\n <TableScrollContainer\n ref={scrollContainerRef}\n $fixedLayout={disableHorizontalScroll}\n $hasHorizontalOverflow={hasHorizontalOverflow}\n $maxHeight={maxHeight}\n >\n <StyledTable\n ref={tableRef}\n size='md'\n aria-label={ariaLabel}\n tabIndex={-1}\n $isReorderable={isReorderable}\n $hasHorizontalOverflow={hasHorizontalOverflow}\n $fixedLayout={disableHorizontalScroll}\n $hideHeader={hideHeader}\n $stickyHeader={stickyHeader}\n $lockedWidth={\n lockedColWidths != null ? lockedColWidths.reduce((sum, w) => sum + w, 0) : undefined\n }\n {...props}\n >\n {lockedColWidths && (\n <colgroup>\n {lockedColWidths.map((w, i) => (\n <col key={i} style={{ width: `${w}px` }} />\n ))}\n </colgroup>\n )}\n {!hideHeader && (\n <TableHead>\n <TableRow>\n {isReorderable && <DragHandleHeaderCell aria-hidden='true' />}\n {columns.map((column) => (\n <StyledTableHeaderCell key={column.key}>{column.title}</StyledTableHeaderCell>\n ))}\n {hasActionsColumn && (\n <StyledTableHeaderCell aria-hidden='true' style={{ padding: 0 }} />\n )}\n </TableRow>\n </TableHead>\n )}\n <TableBody>\n {isEmpty ? (\n <TableRow disableHoverBackground>\n <EmptyStateCell colSpan={totalColumnCount}>\n {onCreateNewRowProp && !disabled ? (\n <EmptyStateButton type='button' onClick={onCreateNewRowProp}>\n {emptyText || 'No data available.'}\n </EmptyStateButton>\n ) : (\n emptyText || 'No data available.'\n )}\n </EmptyStateCell>\n </TableRow>\n ) : (\n children\n )}\n </TableBody>\n </StyledTable>\n </TableScrollContainer>\n {!disableHorizontalScroll && (\n <>\n {!hideHeader && (\n <HeaderFadeOverlay\n aria-hidden='true'\n $visible={hasMoreScrollRight}\n $scrollbarWidth={scrollbarSize.vertical}\n />\n )}\n <BodyFadeOverlay\n aria-hidden='true'\n $visible={hasMoreScrollRight}\n $hideHeader={hideHeader}\n $scrollbarWidth={scrollbarSize.vertical}\n $scrollbarHeight={scrollbarSize.horizontal}\n />\n </>\n )}\n </ScrollAffordanceWrapper>\n );\n\n return (\n <TableBoxContext.Provider value={contextValue}>\n {isReorderable ? (\n <DndContext {...dndContextProps}>\n <SortableContext items={sortableIds} strategy={verticalListSortingStrategy}>\n {tableContent}\n </SortableContext>\n <DragOverlay>\n {activeRowContent && overlayCellWidths && (\n <TableBoxRowOverlay cellWidths={overlayCellWidths}>\n {activeRowContent}\n </TableBoxRowOverlay>\n )}\n </DragOverlay>\n </DndContext>\n ) : (\n tableContent\n )}\n </TableBoxContext.Provider>\n );\n};\n\nTableBox.Row = TableBoxRow;\nTableBox.Cell = TableBoxCell;\n\nexport default TableBox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,yBAAyB;AAE/B,MAAM,oBAAoB,SACxB,MAAM,cAA2B,uBAAuB,IAAI;AAE9D,MAAa,+BACX,OACA,cACG;CACH,MAAM,EAAE,gBAAgB,cAAc,UAAU;AAChD,KAAI,kBAAkB,QAAQ,gBAAgB,QAAQ,mBAAmB,aACvE,QAAO;AAET,QAAO,cAAc,SAAS,mBAAmB,IAAI,iBAAiB,MAAM;;AAG9E,MAAa,6BACX,QACA,cACG;CACH,MAAM,cAAc,OAAO,QAAQ,KAAK;CACxC,MAAM,aAAa,aAAa,QAAQ,KAAK;AAC7C,KAAI,EAAE,uBAAuB,yBAAyB,cAAc,KAClE,QAAO;AAGT,KAAI,cAAc,QAAQ,c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;eACR,oBAAC,gBAAD;MAAgB,SAAS;gBACtB,sBAAsB,CAAC,WACtB,oBAAC,kBAAD;OAAkB,MAAK;OAAS,SAAS;iBACtC,aAAa;OACG,CAAA,GAEnB,aAAa;MAEA,CAAA;KACR,CAAA,GAEX,UAEQ,CAAA;IACA;;EACO,CAAA,EACtB,CAAC,2BACA,qBAAA,YAAA,EAAA,UAAA,CACG,CAAC,cACA,oBAAC,mBAAD;EACE,eAAY;EACZ,UAAU;EACV,iBAAiB,cAAc;EAC/B,CAAA,EAEJ,oBAAC,iBAAD;EACE,eAAY;EACZ,UAAU;EACV,aAAa;EACb,iBAAiB,cAAc;EAC/B,kBAAkB,cAAc;EAChC,CAAA,CACD,EAAA,CAAA,CAEmB,EAAA,CAAA;AAG5B,QACE,oBAAC,gBAAgB,UAAjB;EAA0B,OAAO;YAC9B,gBACC,qBAAC,YAAD;GAAY,GAAI;aAAhB,CACE,oBAAC,iBAAD;IAAiB,OAAO;IAAa,UAAU;cAC5C;IACe,CAAA,EAClB,oBAAC,aAAD,EAAA,UACG,oBAAoB,qBACnB,oBAAC,oBAAD;IAAoB,YAAY;cAC7B;IACkB,CAAA,EAEX,CAAA,CACH;OAEb;EAEuB,CAAA;;AAI/B,SAAS,MAAM;AACf,SAAS,OAAO"}
|
package/dist/TableBox.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as DragDirection } from "./useTableBoxDragAndDrop-
|
|
2
|
-
import { a as TableBox, i as PinnedActionsCell, o as TableBoxContext, r as InlineEditConfig, s as TableBoxProps } from "./TableBoxCell-
|
|
1
|
+
import { t as DragDirection } from "./useTableBoxDragAndDrop-Bye8gJTl.mjs";
|
|
2
|
+
import { a as TableBox, i as PinnedActionsCell, o as TableBoxContext, r as InlineEditConfig, s as TableBoxProps } from "./TableBoxCell-52g97gEg.mjs";
|
|
3
3
|
export { DragDirection, InlineEditConfig, PinnedActionsCell, TableBoxContext, TableBoxProps, TableBox as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-
|
|
2
|
-
import { a as TableCellProps, i as TableCell } from "./index-
|
|
3
|
-
import { r as TableBoxRowProps } from "./TableBoxRow-
|
|
4
|
-
import { n as ReorderConfig, t as DragDirection } from "./useTableBoxDragAndDrop-
|
|
5
|
-
import { t as RowAction } from "./TableBoxRowActions-
|
|
6
|
-
import * as _$styled_components0 from "styled-components";
|
|
7
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-CWzN8GML.mjs";
|
|
2
|
+
import { a as TableCellProps, i as TableCell } from "./index-d_fTFuMM.mjs";
|
|
3
|
+
import { r as TableBoxRowProps } from "./TableBoxRow-DnoumHIE.mjs";
|
|
4
|
+
import { n as ReorderConfig, t as DragDirection } from "./useTableBoxDragAndDrop-Bye8gJTl.mjs";
|
|
5
|
+
import { t as RowAction } from "./TableBoxRowActions-CDcREhP4.mjs";
|
|
8
6
|
import * as _$react from "react";
|
|
9
7
|
import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
|
|
8
|
+
import * as _$styled_components0 from "styled-components";
|
|
9
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
10
10
|
|
|
11
11
|
//#region components/TableBox/TableBox.d.ts
|
|
12
12
|
interface InlineEditConfig {
|
|
@@ -270,4 +270,4 @@ declare const TableBoxCell: ({
|
|
|
270
270
|
}: TableBoxCellProps) => _$react_jsx_runtime0.JSX.Element;
|
|
271
271
|
//#endregion
|
|
272
272
|
export { TableBox as a, PinnedActionsCell as i, TableBoxCellProps as n, TableBoxContext as o, InlineEditConfig as r, TableBoxProps as s, TableBoxCell as t };
|
|
273
|
-
//# sourceMappingURL=TableBoxCell-
|
|
273
|
+
//# sourceMappingURL=TableBoxCell-52g97gEg.d.mts.map
|
package/dist/TableBoxCell.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TableBoxCellProps, t as TableBoxCell } from "./TableBoxCell-
|
|
1
|
+
import { n as TableBoxCellProps, t as TableBoxCell } from "./TableBoxCell-52g97gEg.mjs";
|
|
2
2
|
export { TableBoxCellProps, TableBoxCell as default };
|