@persona/design-system 0.1.5-pre.4 → 0.1.6
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 +42 -111
- package/dist/{Action-B10lxofb.d.mts → Action-DSg3yZck.d.mts} +3 -3
- package/dist/Action.d.mts +1 -1
- package/dist/Attribute.d.mts +4 -4
- package/dist/AttributeGrid.d.mts +1 -1
- package/dist/{Badge-BwAZD9BH.cjs → Badge-CvdUyXSH.cjs} +3 -3
- package/dist/{Badge-BwAZD9BH.cjs.map → Badge-CvdUyXSH.cjs.map} +1 -1
- package/dist/{Badge-BqLnhb4n.mjs → Badge-pq6B-3ue.mjs} +2 -2
- package/dist/{Badge-BqLnhb4n.mjs.map → Badge-pq6B-3ue.mjs.map} +1 -1
- package/dist/Banner.d.mts +1 -1
- package/dist/{Button-DqDLGURJ.d.mts → Button-DcTUxRNI.d.mts} +2 -2
- package/dist/Button.d.mts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/Calendar.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-DeJSt5ys.mjs → Card-CLTkZLKr.mjs} +4 -4
- package/dist/{Card-DeJSt5ys.mjs.map → Card-CLTkZLKr.mjs.map} +1 -1
- package/dist/{Card-CyCKL-M5.cjs → Card-CaOItkgL.cjs} +5 -5
- package/dist/{Card-CyCKL-M5.cjs.map → Card-CaOItkgL.cjs.map} +1 -1
- package/dist/{Card-CcU9cKCd.d.mts → Card-YzGS3nQI.d.mts} +4 -4
- package/dist/Card.d.mts +1 -1
- package/dist/Card2.d.cts +3 -3
- package/dist/Card2.d.mts +1 -1
- package/dist/{Checkbox-D4nv7eNs.cjs → Checkbox-B83WfsOZ.cjs} +6 -6
- package/dist/{Checkbox-D4nv7eNs.cjs.map → Checkbox-B83WfsOZ.cjs.map} +1 -1
- package/dist/{Checkbox-BWJNAP27.d.mts → Checkbox-Bc2kzl9q.d.mts} +1 -1
- package/dist/{Checkbox-C5bGcb-r.mjs → Checkbox-UWdk4pqb.mjs} +5 -5
- package/dist/{Checkbox-C5bGcb-r.mjs.map → Checkbox-UWdk4pqb.mjs.map} +1 -1
- package/dist/Checkbox.d.mts +1 -1
- package/dist/CheckboxGroupField.d.mts +2 -2
- package/dist/{Combobox-DjbJYK_u.d.mts → Combobox-DtD1XXaf.d.mts} +3 -3
- package/dist/Combobox-Dx1u-L1A.d.cts +11 -0
- package/dist/{Combobox-B_-swcix.mjs → Combobox-I44W5oX0.mjs} +26 -30
- package/dist/Combobox-I44W5oX0.mjs.map +1 -0
- package/dist/{Combobox-B_oe33Re.cjs → Combobox-R3_NDBi3.cjs} +18 -22
- package/dist/Combobox-R3_NDBi3.cjs.map +1 -0
- package/dist/Combobox.d.cts +3 -12
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-D2wypeXf.d.cts → ComboboxBase-d98GJD-k.d.cts} +2 -2
- package/dist/{ComboboxBase-INya0Csa.d.mts → ComboboxBase-sRVxlTJw.d.mts} +7 -7
- package/dist/ComboboxBase.d.cts +1 -1
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-Dn8cRZ6Z.d.cts → ComboboxMultiSelect-CRHf5TI-.d.cts} +2 -2
- package/dist/{ComboboxMultiSelect-Dq9DGH8S.d.mts → ComboboxMultiSelect-CdLQDBMN.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.cts +1 -1
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-WwBJRb0e.d.mts → ComboboxSingleSelect-CxiQ2o6t.d.mts} +4 -4
- package/dist/{ComboboxSingleSelect-D8YM7GKP.d.cts → ComboboxSingleSelect-DvK8QioK.d.cts} +3 -3
- package/dist/ComboboxSingleSelect.d.cts +1 -1
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/CompactBar-ODUl2Q6G.d.cts +21 -0
- package/dist/CompactBar-k-rhZ5Z-.d.mts +21 -0
- package/dist/CompactBar.d.cts +2 -0
- package/dist/CompactBar.d.mts +2 -0
- package/dist/ConfigFormGroup-BhO9nm3P.cjs +35 -0
- package/dist/ConfigFormGroup-BhO9nm3P.cjs.map +1 -0
- package/dist/ConfigFormGroup-_yCksmZo.mjs +28 -0
- package/dist/ConfigFormGroup-_yCksmZo.mjs.map +1 -0
- package/dist/ControlBar-9m-DNImB.d.mts +151 -0
- package/dist/ControlBar-oT-I2y6E.d.cts +151 -0
- package/dist/ControlBar.d.cts +2 -0
- package/dist/ControlBar.d.mts +2 -0
- package/dist/DataTable.d.cts +372 -0
- package/dist/DataTable.d.mts +372 -0
- package/dist/DateField.d.cts +23 -2
- package/dist/DateField.d.mts +23 -2
- package/dist/DatePicker.d.cts +1 -1
- package/dist/DatePicker.d.mts +2 -2
- package/dist/DateRangePicker.d.cts +2 -1
- package/dist/DateRangePicker.d.mts +4 -4
- package/dist/{DropdownButton-k9kEcexu.mjs → DropdownButton-BS1QfVX_.mjs} +3 -4
- package/dist/{DropdownButton-k9kEcexu.mjs.map → DropdownButton-BS1QfVX_.mjs.map} +1 -1
- package/dist/{DropdownButton-DO4NqvWR.cjs → DropdownButton-Dpiy5v-R.cjs} +4 -5
- package/dist/{DropdownButton-DO4NqvWR.cjs.map → DropdownButton-Dpiy5v-R.cjs.map} +1 -1
- package/dist/DropdownButton.d.cts +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-rWgROxQe.d.mts → DropdownMenu-COkpUmIO.d.mts} +4 -4
- package/dist/{DropdownMenu-D2fzpkX2.cjs → DropdownMenu-CeqZAxjs.cjs} +4 -4
- package/dist/{DropdownMenu-D2fzpkX2.cjs.map → DropdownMenu-CeqZAxjs.cjs.map} +1 -1
- package/dist/{DropdownMenu-Bm2QqLEq.d.cts → DropdownMenu-D1E1jpZu.d.cts} +3 -3
- package/dist/{DropdownMenu-BTk--LWo.mjs → DropdownMenu-cN_AnKAT.mjs} +3 -3
- package/dist/{DropdownMenu-BTk--LWo.mjs.map → DropdownMenu-cN_AnKAT.mjs.map} +1 -1
- package/dist/DropdownMenu.d.cts +1 -1
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-DYUKygmd.d.mts → ErrorProps-DBw1_Z0a.d.mts} +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/FloatingActionBar.d.cts +40 -0
- package/dist/FloatingActionBar.d.mts +41 -0
- package/dist/{FormControl-DiR2e7Od.cjs → FormControl-DjxkL5Ft.cjs} +6 -6
- package/dist/{FormControl-DiR2e7Od.cjs.map → FormControl-DjxkL5Ft.cjs.map} +1 -1
- package/dist/{FormControl-KkeIYuBa.d.cts → FormControl-OqBTbSwv.d.cts} +1 -1
- package/dist/{FormControl-BXHqI_2D.mjs → FormControl-fK4HA_yF.mjs} +5 -5
- package/dist/{FormControl-BXHqI_2D.mjs.map → FormControl-fK4HA_yF.mjs.map} +1 -1
- package/dist/{FormControl-CM7wTn1P.d.mts → FormControl-vfFzrYhv.d.mts} +3 -3
- package/dist/FormControl.d.cts +1 -1
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +14 -0
- package/dist/{FormField-CdMru4s5.d.mts → FormField-24UPuoL6.d.mts} +2 -2
- package/dist/{FormField-19ownwjH.d.cts → FormField-Cqwi_PyR.d.cts} +2 -2
- package/dist/FormField.d.cts +1 -1
- package/dist/FormField.d.mts +1 -1
- package/dist/{Header-t1plnZc0.d.mts → Header-WNGlG541.d.mts} +2 -2
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-Cd7I0Ucq.d.mts → HelperTooltip-Bd5pQLqL.d.mts} +3 -3
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/HoverCopyableField-DBkYvwii.mjs +103 -0
- package/dist/HoverCopyableField-DBkYvwii.mjs.map +1 -0
- package/dist/HoverCopyableField-DyW2iZuo.cjs +110 -0
- package/dist/HoverCopyableField-DyW2iZuo.cjs.map +1 -0
- package/dist/HoverCopyableField.d.cts +16 -0
- package/dist/HoverCopyableField.d.mts +17 -0
- package/dist/{IconButton-C28qxOdi.mjs → IconButton-DC4rh6ow.mjs} +5 -5
- package/dist/{IconButton-C28qxOdi.mjs.map → IconButton-DC4rh6ow.mjs.map} +1 -1
- package/dist/{IconButton-B1ZL8BqW.cjs → IconButton-DNy7g5zh.cjs} +5 -5
- package/dist/{IconButton-B1ZL8BqW.cjs.map → IconButton-DNy7g5zh.cjs.map} +1 -1
- package/dist/{IconButton-DsXbc3nQ.d.mts → IconButton-DggxojBH.d.mts} +2 -2
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.mts +2 -2
- package/dist/InlineCombobox.d.mts +42 -0
- package/dist/InlineInput.d.mts +36 -0
- package/dist/{Input-eoFk39bE.mjs → Input-Bl7633Ux.mjs} +5 -6
- package/dist/{Input-eoFk39bE.mjs.map → Input-Bl7633Ux.mjs.map} +1 -1
- package/dist/{Input-DHOsR4cl.cjs → Input-DQS-BEym.cjs} +6 -7
- package/dist/{Input-DHOsR4cl.cjs.map → Input-DQS-BEym.cjs.map} +1 -1
- package/dist/{Input-Cv5qieRg.d.mts → Input-DW7oacjc.d.mts} +5 -5
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-CitGo8QA.d.cts → InputProps-7rEMxBED.d.cts} +1 -1
- package/dist/{InputProps-BHu05fX0.d.mts → InputProps-DQpb2_E3.d.mts} +2 -2
- package/dist/InputProps.d.cts +1 -1
- package/dist/InputProps.d.mts +1 -1
- package/dist/Inserter.d.cts +12 -0
- package/dist/Inserter.d.mts +12 -0
- package/dist/Link.d.mts +1 -1
- package/dist/{ListBox-CE3mfDSB.cjs → ListBox-B4uoo_PT.cjs} +10 -14
- package/dist/{ListBox-CE3mfDSB.cjs.map → ListBox-B4uoo_PT.cjs.map} +1 -1
- package/dist/{ListBox-Z1y0LG1H.mjs → ListBox-B7sbubm5.mjs} +9 -13
- package/dist/{ListBox-Z1y0LG1H.mjs.map → ListBox-B7sbubm5.mjs.map} +1 -1
- package/dist/{ListBox-AyjzT6ra.d.mts → ListBox-CVvKa5sc.d.mts} +4 -4
- package/dist/{ListBox-DbyZFy2W.d.cts → ListBox-DeVmbXeC.d.cts} +2 -2
- package/dist/ListBox.d.cts +1 -1
- package/dist/ListBox.d.mts +1 -1
- package/dist/ListBoxField.d.cts +2 -2
- package/dist/ListBoxField.d.mts +3 -3
- package/dist/{LoadingShimmer-CNE6JUVF.mjs → LoadingShimmer-b430vgof.mjs} +2 -2
- package/dist/{LoadingShimmer-CNE6JUVF.mjs.map → LoadingShimmer-b430vgof.mjs.map} +1 -1
- package/dist/{LoadingShimmer-DMK9RC4N.cjs → LoadingShimmer-uG2UzYQd.cjs} +4 -4
- package/dist/{LoadingShimmer-DMK9RC4N.cjs.map → LoadingShimmer-uG2UzYQd.cjs.map} +1 -1
- package/dist/LoadingShimmer.d.mts +2 -2
- package/dist/MaskedInput.d.cts +1 -1
- package/dist/MaskedInput.d.mts +1 -1
- package/dist/{Menu-BpkjNO81.cjs → Menu-BLbEcodU.cjs} +4 -4
- package/dist/{Menu-BpkjNO81.cjs.map → Menu-BLbEcodU.cjs.map} +1 -1
- package/dist/{Menu-DNRHo2i_.mjs → Menu-BbSyWxFD.mjs} +3 -3
- package/dist/{Menu-DNRHo2i_.mjs.map → Menu-BbSyWxFD.mjs.map} +1 -1
- package/dist/{Menu-DIFkRQ6x.d.mts → Menu-CSgCXX0k.d.mts} +4 -4
- package/dist/{Menu-DPrNMatb.d.cts → Menu-C_NOsHAm.d.cts} +2 -2
- package/dist/Menu.d.cts +1 -1
- package/dist/Menu.d.mts +1 -1
- package/dist/MiddleTruncatedText-BIzKECv9.cjs +178 -0
- package/dist/MiddleTruncatedText-BIzKECv9.cjs.map +1 -0
- package/dist/MiddleTruncatedText-Bzpg3zAU.mjs +171 -0
- package/dist/MiddleTruncatedText-Bzpg3zAU.mjs.map +1 -0
- package/dist/Modal.d.mts +2 -2
- package/dist/PageHeader.d.mts +1 -1
- package/dist/PageSelector-COqR1tdA.d.cts +30 -0
- package/dist/PageSelector-mn6q4SKY.d.mts +30 -0
- package/dist/PageSelector.d.cts +2 -30
- package/dist/PageSelector.d.mts +2 -30
- package/dist/Pagination-BUjpYIwq.d.mts +33 -0
- package/dist/Pagination-CeoHVtYD.d.cts +33 -0
- package/dist/Pagination-DEZFb552.cjs +232 -0
- package/dist/Pagination-DEZFb552.cjs.map +1 -0
- package/dist/Pagination-F8ofIWnG.mjs +201 -0
- package/dist/Pagination-F8ofIWnG.mjs.map +1 -0
- package/dist/Pagination.d.cts +2 -33
- package/dist/Pagination.d.mts +2 -33
- package/dist/Pii--c8IxKI0.cjs +25 -0
- package/dist/Pii--c8IxKI0.cjs.map +1 -0
- package/dist/Pii-B_gBVAak.mjs +19 -0
- package/dist/Pii-B_gBVAak.mjs.map +1 -0
- package/dist/Pii.d.mts +1 -1
- package/dist/{Popover-BSdyxuja.mjs → Popover-D4_aqKlm.mjs} +5 -5
- package/dist/{Popover-BSdyxuja.mjs.map → Popover-D4_aqKlm.mjs.map} +1 -1
- package/dist/{Popover-C2dBSwiU.cjs → Popover-jHZICnQt.cjs} +5 -5
- package/dist/{Popover-C2dBSwiU.cjs.map → Popover-jHZICnQt.cjs.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-mZgO_iZJ.d.mts → PseudoClassProps--MiDp2l2.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-mFfT6G3d.cjs → Radio-BN9FLRHy.cjs} +4 -4
- package/dist/{Radio-mFfT6G3d.cjs.map → Radio-BN9FLRHy.cjs.map} +1 -1
- package/dist/{Radio-w-L3Otuk.mjs → Radio-DnnJl87b.mjs} +3 -3
- package/dist/{Radio-w-L3Otuk.mjs.map → Radio-DnnJl87b.mjs.map} +1 -1
- package/dist/{RadioGroup-B8htTzsS.mjs → RadioGroup-BDHhFlmy.mjs} +3 -3
- package/dist/{RadioGroup-B8htTzsS.mjs.map → RadioGroup-BDHhFlmy.mjs.map} +1 -1
- package/dist/{RadioGroup-D5ueuC6a.d.cts → RadioGroup-BDO3pTgP.d.cts} +1 -1
- package/dist/{RadioGroup-BjDmweRK.cjs → RadioGroup-D28hdlhz.cjs} +4 -4
- package/dist/{RadioGroup-BjDmweRK.cjs.map → RadioGroup-D28hdlhz.cjs.map} +1 -1
- package/dist/{RadioGroup-Ls0vPsP_.d.mts → RadioGroup-DfhvXpi3.d.mts} +1 -1
- package/dist/RadioGroup.d.cts +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/RangeCalendar.d.mts +1 -1
- package/dist/RangeCalendarPresets.d.mts +2 -2
- package/dist/SearchInput-2lsv5_R6.d.mts +46 -0
- package/dist/SearchInput-B6d2Qyzb.d.cts +46 -0
- package/dist/SearchInput.d.cts +2 -0
- package/dist/SearchInput.d.mts +2 -0
- package/dist/Section.d.mts +1 -1
- package/dist/{SectionHeading-QvAmhVmD.d.mts → SectionHeading-BLDimf5d.d.mts} +5 -6
- package/dist/{SectionHeading-DVSXofwK.d.cts → SectionHeading-DZyfNPn0.d.cts} +4 -5
- package/dist/SectionHeading.d.cts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-Dk5S4Dhz.d.mts → SegmentedControl-1QD2zH3l.d.mts} +1 -1
- package/dist/{SegmentedControl-DRtXdbLe.d.cts → SegmentedControl-C51htGBp.d.cts} +1 -1
- package/dist/{SegmentedControl-CvznPXgC.cjs → SegmentedControl-DTkFgjac.cjs} +4 -4
- package/dist/{SegmentedControl-CvznPXgC.cjs.map → SegmentedControl-DTkFgjac.cjs.map} +1 -1
- package/dist/{SegmentedControl-DnwNjYre.mjs → SegmentedControl-pRkMcMXe.mjs} +3 -3
- package/dist/{SegmentedControl-DnwNjYre.mjs.map → SegmentedControl-pRkMcMXe.mjs.map} +1 -1
- package/dist/SegmentedControl.d.cts +1 -1
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-DRnRqMAL.d.mts → Select-BysJW9mH.d.mts} +5 -5
- package/dist/{Select-CVB-Q1g1.cjs → Select-CowngLd7.cjs} +9 -13
- package/dist/{Select-CVB-Q1g1.cjs.map → Select-CowngLd7.cjs.map} +1 -1
- package/dist/{Select-Cl3AOq0-.mjs → Select-Fg2z5J-p.mjs} +9 -13
- package/dist/{Select-Cl3AOq0-.mjs.map → Select-Fg2z5J-p.mjs.map} +1 -1
- package/dist/{Select-BdPdgtfU.d.cts → Select-XN23Ui_j.d.cts} +3 -3
- package/dist/Select.d.cts +1 -1
- package/dist/Select.d.mts +1 -1
- package/dist/Slider.d.cts +51 -2
- package/dist/Slider.d.mts +51 -2
- package/dist/SliderRHF.d.cts +18 -2
- package/dist/SliderRHF.d.mts +19 -2
- package/dist/SliderThumb.d.mts +2 -119
- package/dist/{Spacer-DWGkX170.cjs → Spacer-GYHbk-dS.cjs} +2 -2
- package/dist/{Spacer-DWGkX170.cjs.map → Spacer-GYHbk-dS.cjs.map} +1 -1
- package/dist/{Spacer-DxH_sQrV.mjs → Spacer-Ln3KChb5.mjs} +1 -1
- package/dist/{Spacer-DxH_sQrV.mjs.map → Spacer-Ln3KChb5.mjs.map} +1 -1
- package/dist/{Spinner-C05An_fn.mjs → Spinner-D9-u_5zS.mjs} +1 -1
- package/dist/Spinner-D9-u_5zS.mjs.map +1 -0
- package/dist/{Spinner-z7DrPE1d.cjs → Spinner-DaSlM4kU.cjs} +2 -2
- package/dist/Spinner-DaSlM4kU.cjs.map +1 -0
- package/dist/{Stack-toDRLy--.d.cts → Stack-B5VYkPBe.d.cts} +5 -5
- package/dist/{Stack-BHb3ZB2A.cjs → Stack-BF-9YjA1.cjs} +2 -2
- package/dist/Stack-BF-9YjA1.cjs.map +1 -0
- package/dist/{Stack-BntgUvsW.d.mts → Stack-Du7tLSPC.d.mts} +6 -6
- package/dist/{Stack-hwgS2FU1.mjs → Stack-ckRN7LrP.mjs} +1 -1
- package/dist/Stack-ckRN7LrP.mjs.map +1 -0
- package/dist/Stack.d.cts +1 -1
- package/dist/Stack.d.mts +1 -1
- package/dist/StatusIndicator.d.mts +1 -1
- package/dist/{Sticker-D6bwBTGr.mjs → Sticker-B0TbkV4o.mjs} +3 -5
- package/dist/{Sticker-D6bwBTGr.mjs.map → Sticker-B0TbkV4o.mjs.map} +1 -1
- package/dist/{Sticker-D_dutvp_.cjs → Sticker-D0jIU2Dt.cjs} +4 -6
- package/dist/{Sticker-D_dutvp_.cjs.map → Sticker-D0jIU2Dt.cjs.map} +1 -1
- package/dist/{Sticker-S6QWjlEJ.d.cts → Sticker-D9HjFQ6e.d.cts} +3 -3
- package/dist/{Sticker-Bd7KkekO.d.mts → Sticker-XfyoDEod.d.mts} +5 -5
- package/dist/Sticker.d.cts +1 -1
- package/dist/Sticker.d.mts +1 -1
- package/dist/StyledIconDrag.d.mts +13 -0
- package/dist/SwatchPicker.d.mts +1 -1
- package/dist/Tab.d.mts +2 -2
- package/dist/{TabBar-Bf89XksH.mjs → TabBar-CAv10XAF.mjs} +6 -7
- package/dist/TabBar-CAv10XAF.mjs.map +1 -0
- package/dist/{TabBar-BMv8dAS3.cjs → TabBar-D8WCGYd5.cjs} +7 -8
- package/dist/TabBar-D8WCGYd5.cjs.map +1 -0
- package/dist/TabBarIconButton.d.mts +1 -1
- package/dist/Table-B3FJsvXP.cjs +478 -0
- package/dist/Table-B3FJsvXP.cjs.map +1 -0
- package/dist/{Table-DkAA1lt_.d.cts → Table-C8D4lpSa.d.mts} +1 -1
- package/dist/Table-CGtyWI6V.mjs +387 -0
- package/dist/Table-CGtyWI6V.mjs.map +1 -0
- package/dist/{Table-34f5m7w5.d.mts → Table-D4SMuVIR.d.cts} +1 -1
- package/dist/Table.d.cts +1 -1
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-5QcVMPP_.d.cts → TableBody-0cd50RuX.d.mts} +1 -1
- package/dist/{TableBody-Clf34yzJ.d.mts → TableBody-BLmn5h3y.d.cts} +1 -1
- package/dist/TableBody.d.cts +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/TableBox-CPCWzwSl.mjs +1188 -0
- package/dist/TableBox-CPCWzwSl.mjs.map +1 -0
- package/dist/TableBox-D_B9atn2.cjs +1202 -0
- package/dist/TableBox-D_B9atn2.cjs.map +1 -0
- package/dist/TableBox.d.cts +3 -0
- package/dist/TableBox.d.mts +3 -0
- package/dist/TableBoxCell-CEvOcGYa.d.mts +242 -0
- package/dist/TableBoxCell-DJz423uN.d.cts +242 -0
- package/dist/TableBoxCell.d.cts +2 -0
- package/dist/TableBoxCell.d.mts +2 -0
- package/dist/TableBoxField.d.cts +84 -0
- package/dist/TableBoxField.d.mts +85 -0
- package/dist/TableBoxRow-CZwVgei6.d.cts +77 -0
- package/dist/TableBoxRow-LyHvITwZ.d.mts +77 -0
- package/dist/TableBoxRow.d.cts +2 -0
- package/dist/TableBoxRow.d.mts +2 -0
- package/dist/TableBoxRowActions-C8SAxrYG.d.mts +57 -0
- package/dist/TableBoxRowActions-VDAOxNDG.d.cts +57 -0
- package/dist/TableBoxRowActions.d.cts +2 -0
- package/dist/TableBoxRowActions.d.mts +2 -0
- package/dist/TableBoxRowContext.d.mts +20 -0
- package/dist/TableCell.d.cts +1 -1
- package/dist/TableCell.d.mts +1 -1
- package/dist/TableControls-B2ZsNlr6.mjs +1029 -0
- package/dist/TableControls-B2ZsNlr6.mjs.map +1 -0
- package/dist/TableControls-B4gpAvl7.d.mts +70 -0
- package/dist/TableControls-B7QEAzru.cjs +1080 -0
- package/dist/TableControls-B7QEAzru.cjs.map +1 -0
- package/dist/TableControls-BG0OKwjj.d.cts +70 -0
- package/dist/TableControls.d.cts +2 -0
- package/dist/TableControls.d.mts +2 -0
- package/dist/TableControlsContext-CanIAaLW.d.cts +21 -0
- package/dist/TableControlsContext-NdzzGevw.d.mts +21 -0
- package/dist/TableControlsContext.d.cts +2 -0
- package/dist/TableControlsContext.d.mts +2 -0
- package/dist/{TableHead-9LLM1B8I.d.cts → TableHead-CuHNOeCj.d.mts} +1 -1
- package/dist/{TableHead-DJBGHoUD.d.mts → TableHead-roexW17v.d.cts} +1 -1
- package/dist/TableHead.d.cts +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-25lC9tNk.d.cts → TableHeaderCell-BTGuqVXy.d.cts} +1 -1
- package/dist/{TableHeaderCell-DzYZq7SG.d.mts → TableHeaderCell-Cflho9R2.d.mts} +1 -1
- package/dist/TableHeaderCell.d.cts +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-BA3jbdbi.d.mts → TableLayout-BvVsuUVb.d.cts} +1 -1
- package/dist/{TableLayout-CmDKOu10.d.cts → TableLayout-D9BGrjRs.d.mts} +1 -1
- package/dist/TableLayout.d.cts +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-IPjQnK2q.d.cts → TableRow-BfGJSGZH.d.cts} +1 -1
- package/dist/{TableRow-CBKpDeUV.d.mts → TableRow-CjQmDmfx.d.mts} +2 -2
- package/dist/TableRow.d.cts +1 -1
- package/dist/TableRow.d.mts +1 -1
- package/dist/TableTH.d.cts +1 -1
- package/dist/TableTH.d.mts +1 -1
- package/dist/TableViewConfigurationDropdown-BaQ1IsYM.d.cts +32 -0
- package/dist/TableViewConfigurationDropdown-DMeFkVUa.d.mts +32 -0
- package/dist/TableViewConfigurationDropdown.d.cts +2 -0
- package/dist/TableViewConfigurationDropdown.d.mts +2 -0
- package/dist/TechnicalSticker.d.cts +51 -0
- package/dist/TechnicalSticker.d.mts +51 -0
- package/dist/{Text-CnXedFut.d.mts → Text-CPd0r0w2.d.mts} +3 -3
- package/dist/{Text-DVz8erdF.cjs → Text-CzN0DOXV.cjs} +2 -2
- package/dist/{Text-DVz8erdF.cjs.map → Text-CzN0DOXV.cjs.map} +1 -1
- package/dist/{Text-DOTYjIt0.mjs → Text-hEoPeOc9.mjs} +1 -1
- package/dist/{Text-DOTYjIt0.mjs.map → Text-hEoPeOc9.mjs.map} +1 -1
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-B1kitxCl.mjs → TextArea-CJJlw3rV.mjs} +3 -3
- package/dist/{TextArea-B1kitxCl.mjs.map → TextArea-CJJlw3rV.mjs.map} +1 -1
- package/dist/{TextArea-1bHvaq9p.d.mts → TextArea-Dl9_Zizx.d.cts} +2 -2
- package/dist/{TextArea-j43fhp2P.d.cts → TextArea-J1MD_8rK.d.mts} +2 -2
- package/dist/{TextArea-MVgGGM6r.cjs → TextArea-p3oek3Zq.cjs} +4 -4
- package/dist/{TextArea-MVgGGM6r.cjs.map → TextArea-p3oek3Zq.cjs.map} +1 -1
- package/dist/TextArea.d.cts +1 -1
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-z4sSGL91.d.mts → TextUnderlineTooltip-D8GFsk5C.d.mts} +3 -3
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.cts +1 -1
- package/dist/Tile.d.mts +2 -2
- package/dist/Toast.d.cts +2 -6
- package/dist/Toast.d.mts +2 -6
- package/dist/{Toggle-CVdg5iQ0.cjs → Toggle-7o-n5vF6.cjs} +6 -6
- package/dist/{Toggle-CVdg5iQ0.cjs.map → Toggle-7o-n5vF6.cjs.map} +1 -1
- package/dist/{Toggle-B3Cdyf7T.d.mts → Toggle-CY67yh4T.d.mts} +1 -1
- package/dist/{Toggle-8GNRxyvE.mjs → Toggle-DOo0cLmI.mjs} +5 -5
- package/dist/{Toggle-8GNRxyvE.mjs.map → Toggle-DOo0cLmI.mjs.map} +1 -1
- package/dist/{Toggle-BjkbL_uf.d.cts → Toggle-Dw4hisXm.d.cts} +1 -1
- package/dist/Toggle.d.cts +1 -1
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-T7RQpy_a.mjs → Tooltip-CDvOu1UN.mjs} +3 -3
- package/dist/{Tooltip-T7RQpy_a.mjs.map → Tooltip-CDvOu1UN.mjs.map} +1 -1
- package/dist/{Tooltip-C0PS5InA.d.mts → Tooltip-DtWJO_kU.d.mts} +3 -3
- package/dist/{Tooltip-0i_15ysU.cjs → Tooltip-vylydKVv.cjs} +4 -4
- package/dist/{Tooltip-0i_15ysU.cjs.map → Tooltip-vylydKVv.cjs.map} +1 -1
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-D8f3AiBL.d.cts → TruncatedText-BBoWmFii.d.mts} +2 -2
- package/dist/{TruncatedText-0Tf8CwFX.d.mts → TruncatedText-DMpR-yaJ.d.cts} +2 -2
- package/dist/{chunk-CoPdw6nB.cjs → chunk-CKQMccvm.cjs} +0 -36
- package/dist/components/Attribute/index.cjs +8 -8
- package/dist/components/Attribute/index.cjs.map +1 -1
- package/dist/components/Attribute/index.mjs +10 -10
- package/dist/components/Attribute/index.mjs.map +1 -1
- package/dist/components/Badge/index.cjs +1 -2
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Banner/index.cjs +2 -3
- package/dist/components/Banner/index.cjs.map +1 -1
- package/dist/components/Banner/index.mjs +1 -2
- package/dist/components/Banner/index.mjs.map +1 -1
- package/dist/components/Button/index.cjs +1 -2
- package/dist/components/Button/index.d.mts +2 -2
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/ButtonGroup/index.cjs +4 -4
- package/dist/components/ButtonGroup/index.cjs.map +1 -1
- package/dist/components/ButtonGroup/index.mjs +3 -3
- package/dist/components/ButtonGroup/index.mjs.map +1 -1
- package/dist/components/Card/index.cjs +1 -2
- package/dist/components/Card/index.d.mts +2 -2
- package/dist/components/Card/index.mjs +1 -1
- package/dist/components/CardV2/index.cjs +13 -89
- package/dist/components/CardV2/index.cjs.map +1 -1
- package/dist/components/CardV2/index.d.mts +1 -1
- package/dist/components/CardV2/index.mjs +17 -100
- package/dist/components/CardV2/index.mjs.map +1 -1
- package/dist/components/Checkbox/index.cjs +1 -2
- package/dist/components/Checkbox/index.d.mts +1 -1
- package/dist/components/Checkbox/index.mjs +1 -1
- package/dist/components/Combobox/index.cjs +1 -2
- package/dist/components/Combobox/index.d.cts +3 -3
- package/dist/components/Combobox/index.d.mts +3 -3
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/ConfigFormGroup/index.cjs +4 -31
- package/dist/components/ConfigFormGroup/index.mjs +2 -27
- package/dist/components/DataTable/TableControls/index.cjs +13 -0
- package/dist/components/DataTable/TableControls/index.d.cts +6 -0
- package/dist/components/DataTable/TableControls/index.d.mts +6 -0
- package/dist/components/DataTable/TableControls/index.mjs +2 -0
- package/dist/components/DataTable/index.cjs +1435 -0
- package/dist/components/DataTable/index.cjs.map +1 -0
- package/dist/components/DataTable/index.d.cts +8 -0
- package/dist/components/DataTable/index.d.mts +8 -0
- package/dist/components/DataTable/index.mjs +1408 -0
- package/dist/components/DataTable/index.mjs.map +1 -0
- package/dist/components/DataTable/types.d.cts +159 -0
- package/dist/components/DataTable/types.d.mts +159 -0
- package/dist/components/DataTable/types.mjs +0 -0
- package/dist/components/DatePicker/index.cjs +235 -10836
- package/dist/components/DatePicker/index.cjs.map +1 -1
- package/dist/components/DatePicker/index.d.cts +1 -1
- package/dist/components/DatePicker/index.d.mts +1 -1
- package/dist/components/DatePicker/index.mjs +230 -10830
- package/dist/components/DatePicker/index.mjs.map +1 -1
- package/dist/components/DropdownButton/index.cjs +1 -2
- package/dist/components/DropdownButton/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.cjs +1 -2
- package/dist/components/DropdownMenu/index.d.cts +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/DropdownMenu/index.mjs +1 -1
- package/dist/components/FormControl/index.cjs +2 -3
- package/dist/components/FormControl/index.d.cts +2 -2
- package/dist/components/FormControl/index.d.mts +2 -2
- package/dist/components/FormControl/index.mjs +2 -2
- package/dist/components/FormField/index.cjs +109 -22
- package/dist/components/FormField/index.cjs.map +1 -1
- package/dist/components/FormField/index.d.cts +3 -2
- package/dist/components/FormField/index.d.mts +3 -2
- package/dist/components/FormField/index.mjs +109 -23
- package/dist/components/FormField/index.mjs.map +1 -1
- package/dist/components/HoverCopyableField/index.cjs +2 -0
- package/dist/components/HoverCopyableField/index.d.cts +2 -0
- package/dist/components/HoverCopyableField/index.d.mts +2 -0
- package/dist/components/HoverCopyableField/index.mjs +2 -0
- package/dist/components/ImageTile/index.cjs +9 -12
- package/dist/components/ImageTile/index.cjs.map +1 -1
- package/dist/components/ImageTile/index.mjs +8 -11
- package/dist/components/ImageTile/index.mjs.map +1 -1
- package/dist/components/Input/index.cjs +1 -2
- package/dist/components/Input/index.cjs.map +1 -1
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Link/index.cjs +2 -2
- package/dist/components/Link/index.cjs.map +1 -1
- package/dist/components/Link/index.mjs +1 -1
- package/dist/components/Link/index.mjs.map +1 -1
- package/dist/components/ListBox/index.cjs +1 -2
- package/dist/components/ListBox/index.d.cts +1 -1
- package/dist/components/ListBox/index.d.mts +1 -1
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/LoadingShimmer/index.cjs +1 -2
- package/dist/components/LoadingShimmer/index.mjs +1 -1
- package/dist/components/MaskedInput/index.cjs +3 -3
- package/dist/components/MaskedInput/index.mjs +2 -2
- package/dist/components/MatchHighlight/index.cjs +1 -1
- package/dist/components/MatchHighlight/index.cjs.map +1 -1
- package/dist/components/MatchHighlight/index.mjs.map +1 -1
- package/dist/components/Menu/index.cjs +1 -2
- package/dist/components/Menu/index.d.cts +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Menu/index.mjs +1 -1
- package/dist/components/Modal/index.cjs +31 -30
- package/dist/components/Modal/index.cjs.map +1 -1
- package/dist/components/Modal/index.mjs +30 -29
- package/dist/components/Modal/index.mjs.map +1 -1
- package/dist/components/PageHeader/index.cjs +2 -2
- package/dist/components/PageHeader/index.cjs.map +1 -1
- package/dist/components/PageHeader/index.mjs +1 -1
- package/dist/components/PageHeader/index.mjs.map +1 -1
- package/dist/components/Pagination/index.cjs +6 -207
- package/dist/components/Pagination/index.d.cts +4 -3
- package/dist/components/Pagination/index.d.mts +4 -3
- package/dist/components/Pagination/index.mjs +2 -203
- package/dist/components/Pii/index.cjs +2 -20
- package/dist/components/Pii/index.mjs +1 -18
- package/dist/components/Popover/index.cjs +1 -2
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/ProgressBar/index.cjs +2 -2
- package/dist/components/ProgressBar/index.cjs.map +1 -1
- package/dist/components/ProgressBar/index.mjs +1 -1
- package/dist/components/ProgressBar/index.mjs.map +1 -1
- package/dist/components/ProgressIndicator/index.cjs +1 -1
- package/dist/components/ProgressIndicator/index.cjs.map +1 -1
- package/dist/components/ProgressIndicator/index.mjs.map +1 -1
- package/dist/components/Radio/index.cjs +1 -2
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.cjs +1 -2
- package/dist/components/RadioGroup/index.d.cts +1 -1
- package/dist/components/RadioGroup/index.d.mts +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/SegmentedControl/index.cjs +1 -2
- package/dist/components/SegmentedControl/index.d.cts +1 -1
- package/dist/components/SegmentedControl/index.d.mts +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.cjs +1 -2
- package/dist/components/Select/index.d.cts +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Slider/index.cjs +20 -1282
- package/dist/components/Slider/index.cjs.map +1 -1
- package/dist/components/Slider/index.d.cts +2 -2
- package/dist/components/Slider/index.d.mts +2 -2
- package/dist/components/Slider/index.mjs +18 -1279
- package/dist/components/Slider/index.mjs.map +1 -1
- package/dist/components/Spacer/index.cjs +1 -2
- package/dist/components/Spacer/index.mjs +1 -1
- package/dist/components/Spinner/index.cjs +1 -2
- package/dist/components/Spinner/index.mjs +1 -1
- package/dist/components/Stack/index.cjs +1 -2
- package/dist/components/Stack/index.d.cts +1 -1
- package/dist/components/Stack/index.d.mts +1 -1
- package/dist/components/Stack/index.mjs +1 -1
- package/dist/components/StatusIndicator/index.cjs +1 -1
- package/dist/components/StatusIndicator/index.cjs.map +1 -1
- package/dist/components/StatusIndicator/index.mjs.map +1 -1
- package/dist/components/Sticker/index.cjs +1 -2
- package/dist/components/Sticker/index.d.cts +1 -1
- package/dist/components/Sticker/index.d.mts +1 -1
- package/dist/components/Sticker/index.mjs +1 -1
- package/dist/components/SwatchPicker/index.cjs +3 -5
- package/dist/components/SwatchPicker/index.cjs.map +1 -1
- package/dist/components/SwatchPicker/index.mjs +2 -4
- package/dist/components/SwatchPicker/index.mjs.map +1 -1
- package/dist/components/TabBar/index.cjs +1 -2
- package/dist/components/TabBar/index.mjs +1 -1
- package/dist/components/Table/index.cjs +17 -396
- package/dist/components/Table/index.d.cts +7 -7
- package/dist/components/Table/index.d.mts +7 -7
- package/dist/components/Table/index.mjs +1 -378
- package/dist/components/TableBox/index.cjs +7 -0
- package/dist/components/TableBox/index.d.cts +3 -0
- package/dist/components/TableBox/index.d.mts +3 -0
- package/dist/components/TableBox/index.mjs +2 -0
- package/dist/components/TechnicalSticker/index.cjs +239 -0
- package/dist/components/TechnicalSticker/index.cjs.map +1 -0
- package/dist/components/TechnicalSticker/index.d.cts +2 -0
- package/dist/components/TechnicalSticker/index.d.mts +2 -0
- package/dist/components/TechnicalSticker/index.mjs +232 -0
- package/dist/components/TechnicalSticker/index.mjs.map +1 -0
- package/dist/components/Text/index.cjs +1 -2
- package/dist/components/Text/index.d.mts +1 -1
- package/dist/components/Text/index.mjs +1 -1
- package/dist/components/TextArea/index.cjs +1 -2
- package/dist/components/TextArea/index.d.cts +1 -1
- package/dist/components/TextArea/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Tile/index.cjs +5 -6
- package/dist/components/Tile/index.cjs.map +1 -1
- package/dist/components/Tile/index.mjs +4 -5
- package/dist/components/Tile/index.mjs.map +1 -1
- package/dist/components/Toast/index.cjs +5 -12
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts +2 -2
- package/dist/components/Toast/index.d.mts +2 -2
- package/dist/components/Toast/index.mjs +4 -10
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/Toggle/index.cjs +1 -2
- package/dist/components/Toggle/index.d.cts +1 -1
- package/dist/components/Toggle/index.d.mts +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/Tooltip/index.cjs +1 -2
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/components/Tooltip/index.mjs +1 -1
- package/dist/constants-CnkpDWTv.d.mts +6 -0
- package/dist/constants-D5CkrHza.d.cts +6 -0
- package/dist/constants.d.cts +2 -0
- package/dist/constants.d.mts +2 -5
- package/dist/constants2.d.cts +10 -0
- package/dist/constants2.d.mts +10 -0
- package/dist/helpers.d.cts +76 -0
- package/dist/helpers.d.mts +76 -0
- package/dist/{TableCell-DIs9h97h.d.cts → index-Bp3vEph6.d.cts} +3 -3
- package/dist/{TableCell-Dog4Blfq.d.mts → index-BwWgmaXZ.d.mts} +4 -4
- package/dist/index-c55Utzva.d.mts +1 -0
- package/dist/index-dC-i2r_u.d.cts +1 -0
- package/dist/index-e6k85DKM.d.mts +1 -0
- package/dist/index-gpCH5158.d.mts +1 -0
- package/dist/index-kDNN3kX_2.d.mts +1 -0
- package/dist/index-luywJTzJ.d.mts +1 -0
- package/dist/index-qCd8f7Um.d.cts +1 -0
- package/dist/index-uTS5iDq_.d.cts +1 -0
- package/dist/index.cjs +0 -1
- package/dist/index.d.mts +1 -1
- package/dist/index2.d.cts +2 -1
- package/dist/index2.d.mts +2 -1
- package/dist/index3.d.cts +1 -0
- package/dist/index3.d.mts +1 -0
- package/dist/{input-BCmP106-.d.mts → input-FEaQ66an.d.mts} +3 -3
- package/dist/inputFields.d.cts +8 -8
- package/dist/inputFields.d.mts +11 -11
- package/dist/lib/ConfigContext.cjs +1 -1
- package/dist/lib/GlobalStyles.cjs +57 -0
- package/dist/lib/GlobalStyles.cjs.map +1 -0
- package/dist/lib/GlobalStyles.d.cts +8 -0
- package/dist/lib/GlobalStyles.d.mts +8 -0
- package/dist/lib/GlobalStyles.mjs +51 -0
- package/dist/lib/GlobalStyles.mjs.map +1 -0
- package/dist/lib/HeadlessAriaButton.cjs +1 -1
- package/dist/lib/MiddleTruncatedText.cjs +7 -0
- package/dist/lib/MiddleTruncatedText.d.cts +14 -0
- package/dist/lib/MiddleTruncatedText.d.mts +14 -0
- package/dist/lib/MiddleTruncatedText.mjs +2 -0
- package/dist/lib/PDSProvider.cjs +5 -12
- package/dist/lib/PDSProvider.cjs.map +1 -1
- package/dist/lib/PDSProvider.d.cts +0 -2
- package/dist/lib/PDSProvider.d.mts +1 -3
- package/dist/lib/PDSProvider.mjs +4 -11
- package/dist/lib/PDSProvider.mjs.map +1 -1
- package/dist/lib/TruncatedText.cjs +2 -2
- package/dist/lib/TruncatedText.d.cts +1 -1
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedText.mjs +1 -1
- package/dist/lib/TruncatedTextWithTooltip.cjs +3 -3
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.mjs +2 -2
- package/dist/lib/comboboxHelper.cjs +6 -6
- package/dist/lib/comboboxHelper.cjs.map +1 -1
- package/dist/lib/comboboxHelper.mjs +1 -1
- package/dist/lib/copyTextToClipboard.cjs +33 -0
- package/dist/lib/copyTextToClipboard.cjs.map +1 -0
- package/dist/lib/copyTextToClipboard.d.cts +4 -0
- package/dist/lib/copyTextToClipboard.d.mts +5 -0
- package/dist/lib/copyTextToClipboard.mjs +33 -0
- package/dist/lib/copyTextToClipboard.mjs.map +1 -0
- package/dist/lib/datePickerHelper.cjs +9 -3541
- package/dist/lib/datePickerHelper.cjs.map +1 -1
- package/dist/lib/datePickerHelper.mjs +3 -3537
- package/dist/lib/datePickerHelper.mjs.map +1 -1
- package/dist/lib/message.cjs +12 -0
- package/dist/lib/message.cjs.map +1 -0
- package/dist/lib/message.d.cts +2 -0
- package/dist/lib/message.d.mts +2 -0
- package/dist/lib/message.mjs +11 -0
- package/dist/lib/message.mjs.map +1 -0
- package/dist/lib/pseudoClass.cjs +0 -1
- package/dist/lib/pseudoClass.cjs.map +1 -1
- package/dist/lib/pseudoClass.d.mts +1 -1
- package/dist/lib/reorderItems.cjs +0 -1
- package/dist/lib/reorderItems.cjs.map +1 -1
- package/dist/lib/selectHelper.cjs +4 -4
- package/dist/lib/selectHelper.cjs.map +1 -1
- package/dist/lib/selectHelper.mjs +1 -1
- package/dist/lib/useControlled.cjs +1 -1
- package/dist/lib/useIsOverflow.cjs +1 -1
- package/dist/lib/useOutsideClick.cjs +1 -1
- package/dist/lib/useScrollOverflow.cjs +61 -0
- package/dist/lib/useScrollOverflow.cjs.map +1 -0
- package/dist/lib/useScrollOverflow.d.cts +36 -0
- package/dist/lib/useScrollOverflow.d.mts +36 -0
- package/dist/lib/useScrollOverflow.mjs +59 -0
- package/dist/lib/useScrollOverflow.mjs.map +1 -0
- package/dist/lib/zindex.cjs +0 -1
- package/dist/lib/zindex.cjs.map +1 -1
- package/dist/message-CWEGi3Xg.d.cts +9 -0
- package/dist/message-SITKO6JZ.d.mts +9 -0
- package/dist/middleTruncateText.d.mts +13 -0
- package/dist/mixins/focus.cjs +1 -1
- package/dist/mixins/focus.cjs.map +1 -1
- package/dist/mixins/focus.d.mts +1 -1
- package/dist/mixins/focus.mjs.map +1 -1
- package/dist/mixins/hoverable.cjs +1 -1
- package/dist/mixins/hoverable.d.mts +2 -2
- package/dist/mixins/input.cjs +1 -1
- package/dist/mixins/input.cjs.map +1 -1
- package/dist/mixins/input.d.mts +1 -1
- package/dist/mixins/input.mjs.map +1 -1
- package/dist/mixins/menuItem.cjs +1 -1
- package/dist/mixins/menuItem.cjs.map +1 -1
- package/dist/mixins/menuItem.d.mts +2 -2
- package/dist/mixins/menuItem.mjs.map +1 -1
- package/dist/mixins/print/index.cjs +1 -1
- package/dist/mixins/text.cjs +1 -1
- package/dist/mixins/text.cjs.map +1 -1
- package/dist/mixins/text.d.mts +1 -1
- package/dist/mixins/text.mjs.map +1 -1
- package/dist/positioning.d.mts +11 -0
- package/dist/tableBoxKeyboardNavigation.d.mts +8 -0
- package/dist/{text-BrSUs-88.d.mts → text-BEKhEWTa.d.mts} +1 -1
- package/dist/{theme-DGAqgnUa.d.mts → theme-q9fNLtcA.d.mts} +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/types-BG21GgBe.d.cts +25 -0
- package/dist/types-ChCqSD9N.d.mts +25 -0
- package/dist/types-CmnKGG5I.d.cts +10 -0
- package/dist/types-DMjr-u_o.d.mts +10 -0
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types2.d.cts +2 -0
- package/dist/types2.d.mts +2 -0
- package/dist/useColumnWidthLock.d.mts +28 -0
- package/dist/{useFormField-DN3gpEEV.cjs → useFormField-BpYf3CAW.cjs} +3 -3
- package/dist/{useFormField-DN3gpEEV.cjs.map → useFormField-BpYf3CAW.cjs.map} +1 -1
- package/dist/{useFormField-BmtItl8y.d.mts → useFormField-CVmt-ti2.d.mts} +2 -2
- package/dist/{useFormField-eftOPiXj.mjs → useFormField-D0RTrPld.mjs} +2 -2
- package/dist/{useFormField-eftOPiXj.mjs.map → useFormField-D0RTrPld.mjs.map} +1 -1
- package/dist/{useFormField-Ba0CQ43u.d.cts → useFormField-DLGEZ1kD.d.cts} +1 -1
- package/dist/useFormField.d.cts +1 -1
- package/dist/useFormField.d.mts +1 -1
- package/dist/{useFormGroup-B_mFNoN9.cjs → useFormGroup-DQJdKaL9.cjs} +2 -2
- package/dist/{useFormGroup-B_mFNoN9.cjs.map → useFormGroup-DQJdKaL9.cjs.map} +1 -1
- package/dist/{useFormGroup-BMukAMAd.mjs → useFormGroup-z0epBxXn.mjs} +1 -1
- package/dist/{useFormGroup-BMukAMAd.mjs.map → useFormGroup-z0epBxXn.mjs.map} +1 -1
- package/dist/useTableBoxDragAndDrop-DXqy_AMP.d.mts +69 -0
- package/dist/useTableBoxDragAndDrop-hrESBhKb.d.cts +69 -0
- package/dist/useTableBoxDragAndDrop.d.cts +2 -0
- package/dist/useTableBoxDragAndDrop.d.mts +2 -0
- package/dist/useTableColumns.d.cts +72 -0
- package/dist/useTableColumns.d.mts +72 -0
- package/dist/{useToggle-0zLL1E7s.mjs → useToggle-3k3EkV8V.mjs} +1 -1
- package/dist/{useToggle-0zLL1E7s.mjs.map → useToggle-3k3EkV8V.mjs.map} +1 -1
- package/dist/{useToggle-DNrEsTpr.cjs → useToggle-CSkZWXtQ.cjs} +2 -2
- package/dist/{useToggle-DNrEsTpr.cjs.map → useToggle-CSkZWXtQ.cjs.map} +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/{utilities-w1K54IAy.d.mts → utilities-DT-Hh45R.d.mts} +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utils/storybook.cjs +2 -3
- package/dist/utils/storybook.cjs.map +1 -1
- package/dist/utils/storybook.mjs +1 -2
- package/dist/utils/storybook.mjs.map +1 -1
- package/dist/utils/testing.cjs +5 -5
- package/dist/utils/testing.cjs.map +1 -1
- package/dist/utils/testing.d.cts +5 -357
- package/dist/utils/testing.d.mts +4 -356
- package/dist/utils/testing.mjs +2 -2
- package/dist/utils/testing.mjs.map +1 -1
- package/dist/utils.d.mts +9 -0
- package/dist/variables/color.cjs +0 -1
- package/dist/variables/color.cjs.map +1 -1
- package/dist/variables/effect.cjs +1 -1
- package/dist/variables/keyframes.cjs +1 -1
- package/dist/variables/spacing.cjs +0 -1
- package/dist/variables/spacing.cjs.map +1 -1
- package/dist/variables/text.cjs +0 -1
- package/dist/variables/text.cjs.map +1 -1
- package/dist/variables/transitions.cjs +0 -1
- package/dist/variables/transitions.cjs.map +1 -1
- package/package.json +125 -89
- package/dist/Combobox-B_-swcix.mjs.map +0 -1
- package/dist/Combobox-B_oe33Re.cjs.map +0 -1
- package/dist/DateField-Bwe_0qm9.d.cts +0 -24
- package/dist/DateField-Chko9oLb.d.mts +0 -24
- package/dist/RegisterComponent-BDb43KvI.d.mts +0 -34
- package/dist/RegisterComponent-CpXIR-51.d.cts +0 -34
- package/dist/Slider-D3gz7otf.d.mts +0 -56
- package/dist/Slider-uH5MOu2D.d.cts +0 -56
- package/dist/SliderRHF-Cc-9RuPe.d.cts +0 -984
- package/dist/SliderRHF-DIV-tCEv.d.mts +0 -984
- package/dist/Spinner-C05An_fn.mjs.map +0 -1
- package/dist/Spinner-z7DrPE1d.cjs.map +0 -1
- package/dist/Stack-BHb3ZB2A.cjs.map +0 -1
- package/dist/Stack-hwgS2FU1.mjs.map +0 -1
- package/dist/TabBar-BMv8dAS3.cjs.map +0 -1
- package/dist/TabBar-Bf89XksH.mjs.map +0 -1
- package/dist/chunk-Bpcn9VDT.mjs +0 -39
- package/dist/components/ConfigFormGroup/index.cjs.map +0 -1
- package/dist/components/ConfigFormGroup/index.mjs.map +0 -1
- package/dist/components/Pagination/index.cjs.map +0 -1
- package/dist/components/Pagination/index.mjs.map +0 -1
- package/dist/components/Pii/index.cjs.map +0 -1
- package/dist/components/Pii/index.mjs.map +0 -1
- package/dist/components/Table/index.cjs.map +0 -1
- package/dist/components/Table/index.mjs.map +0 -1
- package/dist/ids-Cr-NW2RJ.d.mts +0 -11
- package/dist/ids-e4V5Y3Ub.d.cts +0 -11
- package/dist/index-8R9vlM2B.d.mts +0 -83
- package/dist/index-BM1DqNZf.d.cts +0 -628
- package/dist/index-CExuKKOI.d.cts +0 -218
- package/dist/index-CKu60b9I.d.mts +0 -154
- package/dist/index-DQvVmqvS.d.mts +0 -628
- package/dist/lib/register/RegisterComponent.cjs +0 -91
- package/dist/lib/register/RegisterComponent.cjs.map +0 -1
- package/dist/lib/register/RegisterComponent.d.cts +0 -2
- package/dist/lib/register/RegisterComponent.d.mts +0 -2
- package/dist/lib/register/RegisterComponent.mjs +0 -88
- package/dist/lib/register/RegisterComponent.mjs.map +0 -1
- package/dist/lib/register/ids.cjs +0 -31
- package/dist/lib/register/ids.cjs.map +0 -1
- package/dist/lib/register/ids.d.cts +0 -2
- package/dist/lib/register/ids.d.mts +0 -2
- package/dist/lib/register/ids.mjs +0 -28
- package/dist/lib/register/ids.mjs.map +0 -1
- package/dist/lib/register/index.cjs +0 -8
- package/dist/lib/register/index.d.cts +0 -4
- package/dist/lib/register/index.d.mts +0 -4
- package/dist/lib/register/index.mjs +0 -3
- package/dist/lib/register/types.cjs +0 -1
- package/dist/lib/register/types.d.cts +0 -2
- package/dist/lib/register/types.d.mts +0 -2
- package/dist/mergeRefs-BZinWopc.cjs +0 -31
- package/dist/mergeRefs-BZinWopc.cjs.map +0 -1
- package/dist/mergeRefs-BgcbK0Qy.mjs +0 -26
- package/dist/mergeRefs-BgcbK0Qy.mjs.map +0 -1
- package/dist/motion-DoikasqZ.mjs +0 -7483
- package/dist/motion-DoikasqZ.mjs.map +0 -1
- package/dist/motion-QW6imSxE.cjs +0 -7488
- package/dist/motion-QW6imSxE.cjs.map +0 -1
- package/dist/react.esm-C-es35jP.cjs +0 -11441
- package/dist/react.esm-C-es35jP.cjs.map +0 -1
- package/dist/react.esm-Dv1lMDRs.mjs +0 -11397
- package/dist/react.esm-Dv1lMDRs.mjs.map +0 -1
- package/dist/types-DzHQ5MGm.d.mts +0 -69
- package/dist/types-N-cXznfM.d.cts +0 -69
- package/dist/useLabel-BcbghpIU.cjs +0 -1465
- package/dist/useLabel-BcbghpIU.cjs.map +0 -1
- package/dist/useLabel-DHGzNIKw.mjs +0 -1212
- package/dist/useLabel-DHGzNIKw.mjs.map +0 -1
- /package/dist/{lib/register/types.mjs → components/DataTable/types.cjs} +0 -0
- /package/dist/{index-7in8TPrM.d.mts → index-8SLBz2NH.d.mts} +0 -0
- /package/dist/{index-B2KLYYkM.d.cts → index-BIAn8oQh.d.cts} +0 -0
- /package/dist/{index-BBDa5smF.d.cts → index-BSVhZrWN.d.mts} +0 -0
- /package/dist/{index-BJ8-FA6N.d.cts → index-BlwcRiXv.d.cts} +0 -0
- /package/dist/{index-BPiqSRRl.d.mts → index-C4zERU4O.d.cts} +0 -0
- /package/dist/{index-BUYyA1Xh.d.cts → index-C6yvNuzO.d.cts} +0 -0
- /package/dist/{index-CCt0lwyI.d.mts → index-CDAfh8Ew.d.cts} +0 -0
- /package/dist/{index-CEDY7cmG.d.cts → index-CMuRFTR3.d.mts} +0 -0
- /package/dist/{index-CEqOS-7M.d.mts → index-CTBW75wG2.d.cts} +0 -0
- /package/dist/{index-CIBxlpQo.d.mts → index-CswGToRr2.d.mts} +0 -0
- /package/dist/{index-CRo77wc3.d.mts → index-D8dPsry7.d.mts} +0 -0
- /package/dist/{index-CsuikFeJ.d.mts → index-D9XihFV1.d.mts} +0 -0
- /package/dist/{index-Cz6N-KeS.d.cts → index-DBQaKYAL2.d.cts} +0 -0
- /package/dist/{index-D-BciAtf.d.cts → index-DFKoAoY2.d.cts} +0 -0
- /package/dist/{index-D26lpgQi.d.cts → index-DZlqSwCF.d.mts} +0 -0
- /package/dist/{index-D2HUTZ-d.d.cts → index-Dflz2i1X.d.mts} +0 -0
- /package/dist/{index-D4DUvwPf.d.mts → index-Dpmi5zcN.d.cts} +0 -0
- /package/dist/{index-DcU87nuJ2.d.cts → index-DwBYcw1r.d.cts} +0 -0
- /package/dist/{index-DkrC-i1D.d.mts → index-LhFpnU-f.d.mts} +0 -0
- /package/dist/{index-DvuJXuAN.d.mts → index-N-OgGgfF.d.mts} +0 -0
- /package/dist/{index-OEBbnNdr.d.mts → index-PWQavSPf.d.mts} +0 -0
- /package/dist/{index-QbUkWSLh.d.mts → index-_1bfRgi2.d.cts} +0 -0
|
@@ -0,0 +1,1188 @@
|
|
|
1
|
+
import { focusOutline } from "./mixins/focus.mjs";
|
|
2
|
+
import "./variables/effect.mjs";
|
|
3
|
+
import "./variables/transitions.mjs";
|
|
4
|
+
import { paragraphMixins } from "./mixins/text.mjs";
|
|
5
|
+
import { findIndexByKey, moveItemByIndex } from "./lib/reorderItems.mjs";
|
|
6
|
+
import { useScrollOverflow } from "./lib/useScrollOverflow.mjs";
|
|
7
|
+
import { Z_INDICES } from "./lib/zindex.mjs";
|
|
8
|
+
import { n as Stack, t as HStack } from "./Stack-ckRN7LrP.mjs";
|
|
9
|
+
import { t as IconButton } from "./IconButton-DC4rh6ow.mjs";
|
|
10
|
+
import { t as FormGroupContext } from "./useFormGroup-z0epBxXn.mjs";
|
|
11
|
+
import { s as MenuItem } from "./Menu-BbSyWxFD.mjs";
|
|
12
|
+
import { n as DropdownMenu_default } from "./DropdownMenu-cN_AnKAT.mjs";
|
|
13
|
+
import { n as CaretButton, t as Combobox } from "./Combobox-I44W5oX0.mjs";
|
|
14
|
+
import { h as Table, m as TableHeaderCell, n as TableBody, p as TableRow, r as TableHead, s as TableCell } from "./Table-CGtyWI6V.mjs";
|
|
15
|
+
import { s as Popover_default } from "./Popover-D4_aqKlm.mjs";
|
|
16
|
+
import { t as Container } from "./FormControl-fK4HA_yF.mjs";
|
|
17
|
+
import { BorderRadius, Color, Spacing, Typography } from "@persona/design-tokens";
|
|
18
|
+
import styled, { css } from "styled-components";
|
|
19
|
+
import { Children, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { DragIcon } from "@persona/icons";
|
|
22
|
+
import { MoreIcon as MoreIcon$1, XIcon as XIcon$1 } from "@persona/icons/12px";
|
|
23
|
+
import uniqueId from "lodash/fp/uniqueId.js";
|
|
24
|
+
import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
25
|
+
import { SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
26
|
+
//#region components/TableBox/tableBoxKeyboardNavigation.ts
|
|
27
|
+
const INLINE_EDITOR_SELECTOR = "[data-tablebox-inline-edit-trigger], input[role=\"combobox\"]";
|
|
28
|
+
const findInlineEditor = (cell) => cell?.querySelector(INLINE_EDITOR_SELECTOR) ?? null;
|
|
29
|
+
const isCaretAtNavigationBoundary = (input, direction) => {
|
|
30
|
+
const { selectionStart, selectionEnd, value } = input;
|
|
31
|
+
if (selectionStart == null || selectionEnd == null || selectionStart !== selectionEnd) return false;
|
|
32
|
+
return direction === "left" ? selectionStart === 0 : selectionEnd === value.length;
|
|
33
|
+
};
|
|
34
|
+
const focusAdjacentInlineEditor = (target, direction) => {
|
|
35
|
+
const currentCell = target.closest("td");
|
|
36
|
+
const currentRow = currentCell?.closest("tr");
|
|
37
|
+
if (!(currentCell instanceof HTMLTableCellElement) || currentRow == null) return false;
|
|
38
|
+
if (direction === "up" || direction === "down") {
|
|
39
|
+
const adjacentRow = direction === "up" ? currentRow.previousElementSibling : currentRow.nextElementSibling;
|
|
40
|
+
if (!(adjacentRow instanceof HTMLTableRowElement)) return false;
|
|
41
|
+
const adjacentEditor = findInlineEditor(adjacentRow.cells.item(currentCell.cellIndex));
|
|
42
|
+
adjacentEditor?.focus();
|
|
43
|
+
return adjacentEditor != null;
|
|
44
|
+
}
|
|
45
|
+
let adjacentCell = direction === "left" ? currentCell.previousElementSibling : currentCell.nextElementSibling;
|
|
46
|
+
while (adjacentCell instanceof HTMLTableCellElement) {
|
|
47
|
+
const adjacentEditor = findInlineEditor(adjacentCell);
|
|
48
|
+
if (adjacentEditor != null) {
|
|
49
|
+
adjacentEditor.focus();
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
adjacentCell = direction === "left" ? adjacentCell.previousElementSibling : adjacentCell.nextElementSibling;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region components/TableBox/InlineCombobox.tsx
|
|
58
|
+
const StyledCombobox = styled(Combobox)`
|
|
59
|
+
border: none;
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
|
|
62
|
+
/* Suppress the focus outline — it extends outside the input and is clipped
|
|
63
|
+
by the scroll container. Use && for specificity. */
|
|
64
|
+
&& input,
|
|
65
|
+
&& input:focus-visible:not(:disabled) {
|
|
66
|
+
outline: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
${({ $hideText }) => $hideText && `
|
|
70
|
+
input {
|
|
71
|
+
color: transparent;
|
|
72
|
+
caret-color: transparent;
|
|
73
|
+
}
|
|
74
|
+
input::placeholder {
|
|
75
|
+
color: transparent;
|
|
76
|
+
}
|
|
77
|
+
`}
|
|
78
|
+
`;
|
|
79
|
+
const ChildrenOverlay = styled.div`
|
|
80
|
+
position: absolute;
|
|
81
|
+
left: ${Spacing[2]};
|
|
82
|
+
top: 50%;
|
|
83
|
+
transform: translateY(-50%);
|
|
84
|
+
z-index: 1;
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
|
|
87
|
+
// ${Spacing[5]} matches the sm ComboboxInput padding-right, keeping the text clear of the caret.
|
|
88
|
+
${({ $truncate }) => $truncate && `
|
|
89
|
+
right: ${Spacing[5]};
|
|
90
|
+
`}
|
|
91
|
+
`;
|
|
92
|
+
const ComboboxWrapper = styled.div`
|
|
93
|
+
position: relative;
|
|
94
|
+
width: 100%;
|
|
95
|
+
`;
|
|
96
|
+
const InlineCombobox = ({ itemId, value, columnKey, inlineEditConfig, children, rowRef }) => {
|
|
97
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
98
|
+
const context = useContext(TableBoxContext);
|
|
99
|
+
const onEditingChange = context?.onEditingChange;
|
|
100
|
+
const currentColumn = context?.columns?.find((c) => c.key === columnKey);
|
|
101
|
+
const placeholder = inlineEditConfig?.placeholder || currentColumn?.title || "";
|
|
102
|
+
const portalContainerRef = (inlineEditConfig?.fullWidthComboboxDropdown || false) && rowRef ? rowRef : void 0;
|
|
103
|
+
const showOverlay = !isOpen && !!children;
|
|
104
|
+
const handleOpenChange = useCallback((open) => {
|
|
105
|
+
setIsOpen(open);
|
|
106
|
+
onEditingChange?.(open);
|
|
107
|
+
}, [onEditingChange]);
|
|
108
|
+
return /* @__PURE__ */ jsxs(ComboboxWrapper, {
|
|
109
|
+
onKeyDownCapture: (event) => {
|
|
110
|
+
if (isOpen || event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
111
|
+
const direction = event.key === "ArrowLeft" ? "left" : "right";
|
|
112
|
+
if (!(event.target instanceof HTMLInputElement) || !isCaretAtNavigationBoundary(event.target, direction)) return;
|
|
113
|
+
if (focusAdjacentInlineEditor(event.currentTarget, direction)) {
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
event.stopPropagation();
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
children: [showOverlay && /* @__PURE__ */ jsx(ChildrenOverlay, {
|
|
119
|
+
$truncate: inlineEditConfig?.truncateDisplay,
|
|
120
|
+
children
|
|
121
|
+
}), /* @__PURE__ */ jsx(StyledCombobox, {
|
|
122
|
+
$hideText: showOverlay,
|
|
123
|
+
value,
|
|
124
|
+
options: inlineEditConfig?.options || [],
|
|
125
|
+
onChange: (newValue) => {
|
|
126
|
+
if (inlineEditConfig?.onChange && newValue !== value && typeof newValue === "string") inlineEditConfig.onChange(itemId, newValue);
|
|
127
|
+
},
|
|
128
|
+
onOpenChange: handleOpenChange,
|
|
129
|
+
placeholder,
|
|
130
|
+
size: "sm",
|
|
131
|
+
portal: inlineEditConfig?.useComboboxPortal || false,
|
|
132
|
+
portalContainerRef
|
|
133
|
+
})]
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region components/TableBox/TableBoxRowContext.ts
|
|
138
|
+
const TableBoxRowContext = createContext(null);
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region components/TableBox/InlineInput.tsx
|
|
141
|
+
const sharedInputStyles = css`
|
|
142
|
+
font: inherit;
|
|
143
|
+
color: inherit;
|
|
144
|
+
outline: none;
|
|
145
|
+
border: none;
|
|
146
|
+
padding: 0;
|
|
147
|
+
pointer-events: auto;
|
|
148
|
+
width: 100%;
|
|
149
|
+
background: transparent;
|
|
150
|
+
line-height: ${Typography.TextSmall.lineHeight};
|
|
151
|
+
`;
|
|
152
|
+
const InlineEditInput = styled.input`
|
|
153
|
+
${sharedInputStyles}
|
|
154
|
+
`;
|
|
155
|
+
const InlineEditTextarea = styled.textarea`
|
|
156
|
+
${sharedInputStyles}
|
|
157
|
+
resize: none;
|
|
158
|
+
overflow-y: auto;
|
|
159
|
+
min-height: ${Typography.TextSmall.lineHeight};
|
|
160
|
+
scrollbar-width: none;
|
|
161
|
+
`;
|
|
162
|
+
const InlineEditDisplay = styled.div`
|
|
163
|
+
cursor: text;
|
|
164
|
+
outline: none;
|
|
165
|
+
width: 100%;
|
|
166
|
+
height: 100%;
|
|
167
|
+
min-height: ${Typography.TextSmall.lineHeight};
|
|
168
|
+
line-height: ${Typography.TextSmall.lineHeight};
|
|
169
|
+
|
|
170
|
+
${({ $multiline }) => $multiline ? css`
|
|
171
|
+
display: -webkit-box;
|
|
172
|
+
-webkit-line-clamp: 2;
|
|
173
|
+
-webkit-box-orient: vertical;
|
|
174
|
+
overflow: hidden;
|
|
175
|
+
text-overflow: ellipsis;
|
|
176
|
+
white-space: pre-wrap;
|
|
177
|
+
word-break: break-word;
|
|
178
|
+
` : css`
|
|
179
|
+
white-space: nowrap;
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
text-overflow: ellipsis;
|
|
182
|
+
`}
|
|
183
|
+
`;
|
|
184
|
+
const InlineInput = ({ itemId, value, columnKey, inlineEditConfig, children }) => {
|
|
185
|
+
const { columns, newRowId, onEditingChange, scheduleCreateNewRowAfterCommit } = useContext(TableBoxContext) ?? {};
|
|
186
|
+
const rowContext = useContext(TableBoxRowContext);
|
|
187
|
+
const [isInlineEditing, setIsInlineEditing] = useState(itemId === newRowId && columnKey === columns?.[0]?.key);
|
|
188
|
+
const [editValue, setEditValue] = useState(value);
|
|
189
|
+
const inputRef = useRef(null);
|
|
190
|
+
const textareaRef = useRef(null);
|
|
191
|
+
const cancelledRef = useRef(false);
|
|
192
|
+
const isMultiline = inlineEditConfig?.multiline === true;
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
return () => {
|
|
195
|
+
cancelledRef.current = false;
|
|
196
|
+
};
|
|
197
|
+
}, []);
|
|
198
|
+
useLayoutEffect(() => {
|
|
199
|
+
if (isInlineEditing && isMultiline && textareaRef.current) {
|
|
200
|
+
const textarea = textareaRef.current;
|
|
201
|
+
textarea.style.height = "auto";
|
|
202
|
+
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
203
|
+
}
|
|
204
|
+
}, [
|
|
205
|
+
isInlineEditing,
|
|
206
|
+
editValue,
|
|
207
|
+
isMultiline
|
|
208
|
+
]);
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
if (isInlineEditing && isMultiline && textareaRef.current) {
|
|
211
|
+
const length = textareaRef.current.value.length;
|
|
212
|
+
textareaRef.current.setSelectionRange(length, length);
|
|
213
|
+
}
|
|
214
|
+
}, [isInlineEditing, isMultiline]);
|
|
215
|
+
const placeholder = useMemo(() => {
|
|
216
|
+
const column = columns?.find((c) => c.key === columnKey);
|
|
217
|
+
return column?.inlineEditConfig?.placeholder || column?.title || "";
|
|
218
|
+
}, [columns, columnKey]);
|
|
219
|
+
const handleInlineEditKeyDown = (e) => {
|
|
220
|
+
const isFirstCell = columnKey === columns?.[0]?.key;
|
|
221
|
+
if ((e.key === "Delete" || e.key === "Backspace") && isFirstCell && editValue === "" && rowContext?.isBlank && rowContext.onDelete) {
|
|
222
|
+
e.preventDefault();
|
|
223
|
+
e.stopPropagation();
|
|
224
|
+
cancelledRef.current = true;
|
|
225
|
+
onEditingChange?.(false);
|
|
226
|
+
if (!(focusAdjacentInlineEditor(e.currentTarget, "down") || focusAdjacentInlineEditor(e.currentTarget, "up"))) e.currentTarget.closest("table")?.focus();
|
|
227
|
+
rowContext.onDelete();
|
|
228
|
+
} else if (!isMultiline && (e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
229
|
+
const direction = e.key === "ArrowUp" ? "up" : e.key === "ArrowDown" ? "down" : e.key === "ArrowLeft" ? "left" : "right";
|
|
230
|
+
if ((direction === "up" || direction === "down" || e.currentTarget instanceof HTMLInputElement && isCaretAtNavigationBoundary(e.currentTarget, direction)) && focusAdjacentInlineEditor(e.currentTarget, direction)) {
|
|
231
|
+
e.preventDefault();
|
|
232
|
+
e.stopPropagation();
|
|
233
|
+
}
|
|
234
|
+
} else if (e.key === "Enter") if (isMultiline) {
|
|
235
|
+
if (e.ctrlKey || e.metaKey) {
|
|
236
|
+
e.preventDefault();
|
|
237
|
+
e.stopPropagation();
|
|
238
|
+
handleInlineEditConfirm();
|
|
239
|
+
setIsInlineEditing(false);
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
e.preventDefault();
|
|
243
|
+
e.stopPropagation();
|
|
244
|
+
handleInlineEditConfirm();
|
|
245
|
+
setIsInlineEditing(false);
|
|
246
|
+
const isLastCell = columnKey === columns?.at(-1)?.key;
|
|
247
|
+
const currentRow = e.currentTarget.closest("tr");
|
|
248
|
+
const isLastRow = currentRow != null && currentRow.nextElementSibling == null;
|
|
249
|
+
if (isLastCell && isLastRow) scheduleCreateNewRowAfterCommit?.();
|
|
250
|
+
}
|
|
251
|
+
else if (e.key === "Tab") handleInlineEditConfirm();
|
|
252
|
+
else if (e.key === "Escape") {
|
|
253
|
+
e.preventDefault();
|
|
254
|
+
e.stopPropagation();
|
|
255
|
+
handleInlineEditCancel();
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const handleInlineEditConfirm = () => {
|
|
259
|
+
if (inlineEditConfig?.onChange && editValue !== value) inlineEditConfig.onChange(itemId, editValue);
|
|
260
|
+
};
|
|
261
|
+
const handleInlineEditCancel = () => {
|
|
262
|
+
cancelledRef.current = true;
|
|
263
|
+
setEditValue(value);
|
|
264
|
+
setIsInlineEditing(false);
|
|
265
|
+
onEditingChange?.(false);
|
|
266
|
+
};
|
|
267
|
+
const handleInlineEditBlur = () => {
|
|
268
|
+
if (!cancelledRef.current) handleInlineEditConfirm();
|
|
269
|
+
cancelledRef.current = false;
|
|
270
|
+
setIsInlineEditing(false);
|
|
271
|
+
onEditingChange?.(false);
|
|
272
|
+
};
|
|
273
|
+
return isInlineEditing ? isMultiline ? /* @__PURE__ */ jsx(InlineEditTextarea, {
|
|
274
|
+
ref: textareaRef,
|
|
275
|
+
value: editValue,
|
|
276
|
+
onChange: (e) => setEditValue(e.target.value),
|
|
277
|
+
onBlur: handleInlineEditBlur,
|
|
278
|
+
onKeyDown: handleInlineEditKeyDown,
|
|
279
|
+
placeholder,
|
|
280
|
+
autoFocus: true,
|
|
281
|
+
rows: 1
|
|
282
|
+
}) : /* @__PURE__ */ jsx(InlineEditInput, {
|
|
283
|
+
ref: inputRef,
|
|
284
|
+
value: editValue,
|
|
285
|
+
onChange: (e) => setEditValue(e.target.value),
|
|
286
|
+
onBlur: handleInlineEditBlur,
|
|
287
|
+
onKeyDown: handleInlineEditKeyDown,
|
|
288
|
+
placeholder,
|
|
289
|
+
autoFocus: true
|
|
290
|
+
}) : /* @__PURE__ */ jsx(InlineEditDisplay, {
|
|
291
|
+
tabIndex: 0,
|
|
292
|
+
"data-tablebox-inline-edit-trigger": true,
|
|
293
|
+
$multiline: isMultiline,
|
|
294
|
+
onFocus: () => {
|
|
295
|
+
setEditValue(value);
|
|
296
|
+
onEditingChange?.(true);
|
|
297
|
+
setIsInlineEditing(true);
|
|
298
|
+
},
|
|
299
|
+
children: children || value
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region components/TableBox/TableBoxRowActions.tsx
|
|
304
|
+
const IconButtonWidth = 16;
|
|
305
|
+
const BackgroundFadeWidth = 12;
|
|
306
|
+
const RowActionsContainerWithFadeWidth = BackgroundFadeWidth + (parseInt(Spacing[1]) + IconButtonWidth + parseInt(Spacing[2]));
|
|
307
|
+
/**
|
|
308
|
+
* Container for row-level actions (`actions` menu and/or delete `X`). Used
|
|
309
|
+
* in two layouts:
|
|
310
|
+
*
|
|
311
|
+
* - **Dedicated trailing column** (`$inDedicatedColumn=true`, the default
|
|
312
|
+
* for horizontal-scroll mode): laid out in normal flow inside
|
|
313
|
+
* `PinnedActionsCell`.
|
|
314
|
+
* - **Overlaid in last data cell** (`$inDedicatedColumn=false`,
|
|
315
|
+
* `disableHorizontalScroll` mode): absolutely positioned on top of the
|
|
316
|
+
* last cell's content with a fade gradient so it overlaps text on hover.
|
|
317
|
+
*
|
|
318
|
+
* Other variant props:
|
|
319
|
+
* - `$hasCombobox` — last data column is an inline combobox; we use auto
|
|
320
|
+
* width so the caret↔first-action gap matches the action↔delete gap, and
|
|
321
|
+
* we drop the gradient so there's no fade running over the caret.
|
|
322
|
+
* - `$hasDelete` — fade the container in only on hover, mirroring the
|
|
323
|
+
* legacy "show delete on hover" behavior.
|
|
324
|
+
*/
|
|
325
|
+
const RowActionsContainer = styled.div`
|
|
326
|
+
width: ${({ $hasCombobox }) => $hasCombobox ? "auto" : `${RowActionsContainerWithFadeWidth}px`};
|
|
327
|
+
position: ${({ $hasCombobox, $inDedicatedColumn }) => $hasCombobox || $inDedicatedColumn ? "static" : "absolute"};
|
|
328
|
+
right: ${Spacing[2]};
|
|
329
|
+
top: 0;
|
|
330
|
+
height: 100%;
|
|
331
|
+
display: flex;
|
|
332
|
+
gap: ${Spacing[1]};
|
|
333
|
+
align-items: center;
|
|
334
|
+
justify-content: end;
|
|
335
|
+
transition: opacity ${"200ms"} ease-out;
|
|
336
|
+
background: linear-gradient(
|
|
337
|
+
to right,
|
|
338
|
+
transparent,
|
|
339
|
+
${Color.BackgroundPrimary} ${BackgroundFadeWidth}px
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
/* Combobox cells render actions inline next to the caret. The padding-left
|
|
343
|
+
keeps the caret↔first-action gap visually balanced with the gap between
|
|
344
|
+
the actions themselves. */
|
|
345
|
+
${({ $hasCombobox }) => $hasCombobox && css`
|
|
346
|
+
background: none;
|
|
347
|
+
padding-right: ${Spacing[2]};
|
|
348
|
+
padding-left: ${Spacing[1]};
|
|
349
|
+
`}
|
|
350
|
+
|
|
351
|
+
/* PinnedActionsCell is transparent (so scrolling content can pass under it);
|
|
352
|
+
owning the right gutter here keeps the container's opaque gradient flush
|
|
353
|
+
to the cell's right edge. */
|
|
354
|
+
${({ $inDedicatedColumn, $hasCombobox }) => $inDedicatedColumn && !$hasCombobox && css`
|
|
355
|
+
padding-right: ${Spacing[2]};
|
|
356
|
+
`}
|
|
357
|
+
|
|
358
|
+
/* Hide on hover only when delete is present (matches legacy behavior). */
|
|
359
|
+
${({ $hasDelete }) => $hasDelete && css`
|
|
360
|
+
opacity: 0;
|
|
361
|
+
`}
|
|
362
|
+
|
|
363
|
+
/* Make room for both buttons; combobox cells use auto width so they can sit
|
|
364
|
+
inline next to the caret. */
|
|
365
|
+
${({ $hasActions, $hasDelete, $hasCombobox }) => $hasActions && $hasDelete && !$hasCombobox && css`
|
|
366
|
+
width: ${RowActionsContainerWithFadeWidth + parseInt(Spacing[1]) + IconButtonWidth}px;
|
|
367
|
+
`}
|
|
368
|
+
`;
|
|
369
|
+
/**
|
|
370
|
+
* Renders the actions menu and/or delete icon button inside a
|
|
371
|
+
* `RowActionsContainer`. Used both as an absolute overlay inside the
|
|
372
|
+
* last data cell (fixed-layout mode) and as static content inside the
|
|
373
|
+
* dedicated sticky trailing column (horizontal scroll mode).
|
|
374
|
+
*/
|
|
375
|
+
const RowActions = ({ actions, onDelete, inDedicatedColumn, inCombobox }) => {
|
|
376
|
+
const hasActions = !!actions?.length;
|
|
377
|
+
if (!hasActions && !onDelete) return null;
|
|
378
|
+
return /* @__PURE__ */ jsxs(RowActionsContainer, {
|
|
379
|
+
$hasActions: hasActions,
|
|
380
|
+
$hasDelete: !!onDelete,
|
|
381
|
+
$hasCombobox: inCombobox,
|
|
382
|
+
$inDedicatedColumn: inDedicatedColumn,
|
|
383
|
+
onClick: (e) => e.stopPropagation(),
|
|
384
|
+
children: [hasActions && /* @__PURE__ */ jsx(DropdownMenu_default, {
|
|
385
|
+
portal: true,
|
|
386
|
+
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
387
|
+
"aria-label": "Actions",
|
|
388
|
+
children: /* @__PURE__ */ jsx(MoreIcon$1, {})
|
|
389
|
+
}),
|
|
390
|
+
children: actions?.map(({ label, onClick, ...rest }) => /* @__PURE__ */ jsx(MenuItem, {
|
|
391
|
+
...rest,
|
|
392
|
+
onClick,
|
|
393
|
+
size: "sm",
|
|
394
|
+
children: label
|
|
395
|
+
}, label))
|
|
396
|
+
}), onDelete && /* @__PURE__ */ jsx(IconButton, {
|
|
397
|
+
"aria-label": "Delete",
|
|
398
|
+
onClick: onDelete,
|
|
399
|
+
children: /* @__PURE__ */ jsx(XIcon$1, {})
|
|
400
|
+
})]
|
|
401
|
+
});
|
|
402
|
+
};
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region components/TableBox/TableBoxCell.tsx
|
|
405
|
+
const CELL_VERTICAL_PADDING = Spacing[1];
|
|
406
|
+
const CELL_HEIGHT = `calc(${Typography.TextSmall.lineHeight} + (${CELL_VERTICAL_PADDING} * 2))`;
|
|
407
|
+
const StyledCell = styled(TableCell)`
|
|
408
|
+
${paragraphMixins.sm};
|
|
409
|
+
// height acts as min-height for table cells
|
|
410
|
+
height: ${CELL_HEIGHT};
|
|
411
|
+
padding: ${({ $noPadding }) => $noPadding ? Spacing[0] : `${CELL_VERTICAL_PADDING} ${Spacing[2]}`};
|
|
412
|
+
border-bottom: 1px solid ${Color.BorderHairline};
|
|
413
|
+
position: relative;
|
|
414
|
+
`;
|
|
415
|
+
const StyledCellContent = styled.div`
|
|
416
|
+
white-space: nowrap;
|
|
417
|
+
overflow: hidden;
|
|
418
|
+
text-overflow: ellipsis;
|
|
419
|
+
flex-grow: 1;
|
|
420
|
+
min-width: 0;
|
|
421
|
+
`;
|
|
422
|
+
const TableBoxCell = ({ children, itemId = "", value = "", columnKey, isLastCell = false, actions, onDelete, inlineEditConfigOverride, ...props }) => {
|
|
423
|
+
const context = useContext(TableBoxContext);
|
|
424
|
+
const rowContext = useContext(TableBoxRowContext);
|
|
425
|
+
if (context == null) throw new Error("TableBox context is not set");
|
|
426
|
+
const columnConfig = context.columns.find((c) => c.key === columnKey)?.inlineEditConfig;
|
|
427
|
+
let inlineEditConfig = context.disabled || columnConfig == null ? void 0 : inlineEditConfigOverride ? {
|
|
428
|
+
...columnConfig,
|
|
429
|
+
...inlineEditConfigOverride
|
|
430
|
+
} : columnConfig;
|
|
431
|
+
if (inlineEditConfig?.type === "combobox" && (context.hasHorizontalOverflow || inlineEditConfig?.fullWidthComboboxDropdown)) inlineEditConfig = {
|
|
432
|
+
...inlineEditConfig,
|
|
433
|
+
useComboboxPortal: true
|
|
434
|
+
};
|
|
435
|
+
const handleDelete = () => {
|
|
436
|
+
if (onDelete && itemId) onDelete(itemId);
|
|
437
|
+
};
|
|
438
|
+
return /* @__PURE__ */ jsx(StyledCell, {
|
|
439
|
+
...props,
|
|
440
|
+
$noPadding: inlineEditConfig?.type === "combobox",
|
|
441
|
+
tabIndex: -1,
|
|
442
|
+
children: /* @__PURE__ */ jsxs(HStack, {
|
|
443
|
+
align: "center",
|
|
444
|
+
spacing: Spacing[0],
|
|
445
|
+
children: [inlineEditConfig ? inlineEditConfig.type === "combobox" ? /* @__PURE__ */ jsx(InlineCombobox, {
|
|
446
|
+
itemId,
|
|
447
|
+
value,
|
|
448
|
+
columnKey,
|
|
449
|
+
inlineEditConfig,
|
|
450
|
+
rowRef: rowContext?.rowRef,
|
|
451
|
+
children: /* @__PURE__ */ jsx(StyledCellContent, { children })
|
|
452
|
+
}) : /* @__PURE__ */ jsx(InlineInput, {
|
|
453
|
+
itemId,
|
|
454
|
+
value,
|
|
455
|
+
columnKey,
|
|
456
|
+
inlineEditConfig,
|
|
457
|
+
children
|
|
458
|
+
}) : /* @__PURE__ */ jsx(StyledCellContent, { children }), isLastCell && !context.disabled && /* @__PURE__ */ jsx(RowActions, {
|
|
459
|
+
actions,
|
|
460
|
+
onDelete: onDelete ? handleDelete : void 0,
|
|
461
|
+
inCombobox: inlineEditConfig?.type === "combobox"
|
|
462
|
+
})]
|
|
463
|
+
})
|
|
464
|
+
});
|
|
465
|
+
};
|
|
466
|
+
//#endregion
|
|
467
|
+
//#region components/TableBox/TableBoxRow.tsx
|
|
468
|
+
const StyledRow = styled(TableRow)`
|
|
469
|
+
cursor: ${({ $isSelectable }) => $isSelectable ? "pointer" : "default"};
|
|
470
|
+
position: relative;
|
|
471
|
+
/* Give every row a solid background so sticky first-column cells (which
|
|
472
|
+
inherit the row's background) remain opaque during horizontal scroll. */
|
|
473
|
+
background-color: ${Color.BackgroundPrimary};
|
|
474
|
+
|
|
475
|
+
/* Dim the dragged row in place. A floating clone rendered by @dnd-kit's
|
|
476
|
+
DragOverlay provides the fully-opaque representation that follows the
|
|
477
|
+
pointer. */
|
|
478
|
+
${({ $isDragging }) => $isDragging && css`
|
|
479
|
+
opacity: 0.5;
|
|
480
|
+
`}
|
|
481
|
+
|
|
482
|
+
/* 2px brand-colored drop indicator applied to each cell via inset
|
|
483
|
+
box-shadow so the line spans the full row width without affecting
|
|
484
|
+
layout. box-shadow on <td> renders reliably across modern browsers,
|
|
485
|
+
unlike pseudo-elements on <tr>. */
|
|
486
|
+
${({ $dropIndicatorPosition, theme }) => $dropIndicatorPosition === "top" && css`
|
|
487
|
+
td {
|
|
488
|
+
box-shadow: inset 0 2px 0 ${theme.color.text.brand};
|
|
489
|
+
}
|
|
490
|
+
`}
|
|
491
|
+
|
|
492
|
+
${({ $dropIndicatorPosition, theme }) => $dropIndicatorPosition === "bottom" && css`
|
|
493
|
+
td {
|
|
494
|
+
box-shadow: inset 0 -2px 0 ${theme.color.text.brand};
|
|
495
|
+
}
|
|
496
|
+
`}
|
|
497
|
+
|
|
498
|
+
${CaretButton} {
|
|
499
|
+
opacity: 0;
|
|
500
|
+
transition: opacity ${"200ms"} ease-out;
|
|
501
|
+
|
|
502
|
+
/* Allow button to shrink to caret SVG height and width, and adjust alignment to remain vertically centered */
|
|
503
|
+
width: auto;
|
|
504
|
+
height: auto;
|
|
505
|
+
top: 50%;
|
|
506
|
+
transform: translateY(-50%);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
&:last-child {
|
|
510
|
+
td {
|
|
511
|
+
border-bottom: none;
|
|
512
|
+
&:first-child {
|
|
513
|
+
border-bottom-left-radius: ${BorderRadius.Md};
|
|
514
|
+
}
|
|
515
|
+
&:last-child {
|
|
516
|
+
border-bottom-right-radius: ${BorderRadius.Md};
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
&[aria-selected='true'] {
|
|
522
|
+
background: ${({ theme }) => theme.color.background.highlight};
|
|
523
|
+
color: ${({ theme }) => theme.color.text.brand};
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
&:hover:not([aria-selected='true']) {
|
|
527
|
+
cursor: ${({ $isSelectable }) => $isSelectable ? "pointer" : "default"};
|
|
528
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
529
|
+
background: ${Color.BackgroundSecondary};
|
|
530
|
+
|
|
531
|
+
${RowActionsContainer} {
|
|
532
|
+
opacity: 1;
|
|
533
|
+
background: linear-gradient(to right, transparent, ${Color.BackgroundSecondary} 12px);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
${CaretButton} {
|
|
537
|
+
opacity: 1;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
&:has(input:focus),
|
|
542
|
+
&:has(textarea:focus),
|
|
543
|
+
&:has(input[role='combobox'][aria-expanded='true']),
|
|
544
|
+
&:has(input:focus):hover,
|
|
545
|
+
&:has(textarea:focus):hover,
|
|
546
|
+
&:has(input[role='combobox'][aria-expanded='true']):hover,
|
|
547
|
+
&:has(button:focus),
|
|
548
|
+
&:has(button:focus):hover {
|
|
549
|
+
color: ${({ theme }) => theme.color.text.brand};
|
|
550
|
+
background-color: ${({ theme }) => theme.color.background.highlight};
|
|
551
|
+
|
|
552
|
+
${RowActionsContainer} {
|
|
553
|
+
opacity: 1;
|
|
554
|
+
background: linear-gradient(
|
|
555
|
+
to right,
|
|
556
|
+
transparent,
|
|
557
|
+
${({ theme }) => theme.color.background.highlight} ${parseInt(Spacing[3])}px
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
${CaretButton} {
|
|
562
|
+
opacity: 1;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
`;
|
|
566
|
+
const DragHandleCell = styled(TableCell)`
|
|
567
|
+
width: 24px;
|
|
568
|
+
padding: ${Spacing[0]} ${Spacing[1]};
|
|
569
|
+
border-bottom: 1px solid ${Color.BorderHairline};
|
|
570
|
+
vertical-align: middle;
|
|
571
|
+
text-align: center;
|
|
572
|
+
`;
|
|
573
|
+
const DragHandleButton = styled.button.attrs({ type: "button" })`
|
|
574
|
+
background: none;
|
|
575
|
+
border: none;
|
|
576
|
+
padding: 0;
|
|
577
|
+
display: inline-flex;
|
|
578
|
+
align-items: center;
|
|
579
|
+
justify-content: center;
|
|
580
|
+
cursor: grab;
|
|
581
|
+
touch-action: none;
|
|
582
|
+
color: ${Color.TextSecondary};
|
|
583
|
+
${focusOutline}
|
|
584
|
+
|
|
585
|
+
&:hover {
|
|
586
|
+
color: ${Color.TextPrimary};
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
&:active {
|
|
590
|
+
cursor: grabbing;
|
|
591
|
+
}
|
|
592
|
+
`;
|
|
593
|
+
const DropdownPopoverHeading = styled.div`
|
|
594
|
+
${Typography.TextSmallBold};
|
|
595
|
+
border-bottom: 1px solid ${Color.BorderHairline};
|
|
596
|
+
padding: ${Spacing[2]} ${Spacing[3]} ${Spacing[1]};
|
|
597
|
+
`;
|
|
598
|
+
const DropdownPopoverContent = styled(Stack)`
|
|
599
|
+
min-width: var(--radix-popover-trigger-width);
|
|
600
|
+
padding: ${Spacing[3]};
|
|
601
|
+
|
|
602
|
+
${Container} {
|
|
603
|
+
min-width: 0;
|
|
604
|
+
}
|
|
605
|
+
`;
|
|
606
|
+
const DropdownPopoverFooter = styled.div`
|
|
607
|
+
border-top: 1px solid ${Color.BorderHairline};
|
|
608
|
+
padding: ${Spacing[1]};
|
|
609
|
+
`;
|
|
610
|
+
/**
|
|
611
|
+
* Computes the drop-indicator position for a sortable row. Direction mirrors
|
|
612
|
+
* `HoverCardPropertiesEditTable` / `ListBox`: dragging from above places the
|
|
613
|
+
* line on the hovered row's bottom edge, dragging from below places it on the
|
|
614
|
+
* top edge. The dragged row itself never shows an indicator.
|
|
615
|
+
*
|
|
616
|
+
* `closestCenter` has a "dead zone" while the pointer is still over the
|
|
617
|
+
* dragged row's own slot (`overIndex === activeIndex`). We use the drag
|
|
618
|
+
* direction to show the indicator on the immediate neighbor so the
|
|
619
|
+
* "immediately before/after original" positions still get feedback.
|
|
620
|
+
*/
|
|
621
|
+
const getDropIndicatorPosition = ({ isDragging, index, activeIndex, overIndex, draggedDirection }) => {
|
|
622
|
+
if (isDragging || activeIndex === -1) return;
|
|
623
|
+
if (overIndex === index && overIndex !== activeIndex) return activeIndex < index ? "bottom" : "top";
|
|
624
|
+
if (overIndex === activeIndex) {
|
|
625
|
+
if (draggedDirection === "up" && index === activeIndex - 1) return "bottom";
|
|
626
|
+
if (draggedDirection === "down" && index === activeIndex + 1) return "top";
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
/**
|
|
630
|
+
* Inner row component used when drag-and-drop is enabled on the parent
|
|
631
|
+
* TableBox. Subscribes to the surrounding SortableContext via useSortable and
|
|
632
|
+
* renders a leading drag-handle cell.
|
|
633
|
+
*/
|
|
634
|
+
const SortableTableBoxRowContent = ({ id, isSelected, isSelectable, onClick, rowRef, draggedDirection, children, ...props }) => {
|
|
635
|
+
const { attributes, listeners, setNodeRef, isDragging, activeIndex, overIndex, index } = useSortable({ id: String(id) });
|
|
636
|
+
const setRefs = (element) => {
|
|
637
|
+
rowRef.current = element;
|
|
638
|
+
setNodeRef(element);
|
|
639
|
+
};
|
|
640
|
+
const dropIndicatorPosition = getDropIndicatorPosition({
|
|
641
|
+
isDragging,
|
|
642
|
+
index,
|
|
643
|
+
activeIndex,
|
|
644
|
+
overIndex,
|
|
645
|
+
draggedDirection
|
|
646
|
+
});
|
|
647
|
+
return /* @__PURE__ */ jsxs(StyledRow, {
|
|
648
|
+
...props,
|
|
649
|
+
ref: setRefs,
|
|
650
|
+
id: String(id),
|
|
651
|
+
onClick,
|
|
652
|
+
disableHoverBackground: true,
|
|
653
|
+
"aria-selected": isSelected,
|
|
654
|
+
$isSelectable: isSelectable,
|
|
655
|
+
$isDragging: isDragging,
|
|
656
|
+
$dropIndicatorPosition: dropIndicatorPosition,
|
|
657
|
+
children: [/* @__PURE__ */ jsx(DragHandleCell, { children: /* @__PURE__ */ jsx(DragHandleButton, {
|
|
658
|
+
"aria-label": "Drag to reorder",
|
|
659
|
+
...attributes,
|
|
660
|
+
...listeners,
|
|
661
|
+
onClick: (e) => e.stopPropagation(),
|
|
662
|
+
children: /* @__PURE__ */ jsx(DragIcon, {})
|
|
663
|
+
}) }), children]
|
|
664
|
+
});
|
|
665
|
+
};
|
|
666
|
+
const TableBoxRow = ({ children, actions, onDelete, id, dropdownFormFields, dropdownContent, dropdownHeadingText, dropdownFooter, ...props }) => {
|
|
667
|
+
const context = useContext(TableBoxContext);
|
|
668
|
+
const isSelected = context?.selectedKey === id;
|
|
669
|
+
const isSelectable = context?.selectionMode === "single";
|
|
670
|
+
const isReorderable = context?.isReorderable ?? false;
|
|
671
|
+
const rowRegistry = context?.rowRegistry ?? null;
|
|
672
|
+
const draggedDirection = context?.draggedDirection ?? null;
|
|
673
|
+
const hasActionsColumn = context?.hasActionsColumn ?? false;
|
|
674
|
+
const isDisabled = context?.disabled ?? false;
|
|
675
|
+
const rowRef = useRef(null);
|
|
676
|
+
const effectiveActions = isDisabled ? void 0 : actions;
|
|
677
|
+
const effectiveOnDelete = isDisabled ? void 0 : onDelete;
|
|
678
|
+
const isBlank = Children.toArray(children).every((child) => isValidElement(child) && child.props.value === "");
|
|
679
|
+
const handleClick = () => {
|
|
680
|
+
if (context?.onRowClick && id && isSelectable) context.onRowClick(id);
|
|
681
|
+
};
|
|
682
|
+
const handleDelete = useCallback(() => {
|
|
683
|
+
if (effectiveOnDelete && id != null) effectiveOnDelete(id);
|
|
684
|
+
}, [effectiveOnDelete, id]);
|
|
685
|
+
const rowContextValue = useMemo(() => ({
|
|
686
|
+
rowRef,
|
|
687
|
+
onDelete: effectiveOnDelete && id != null ? handleDelete : void 0,
|
|
688
|
+
isBlank
|
|
689
|
+
}), [
|
|
690
|
+
effectiveOnDelete,
|
|
691
|
+
handleDelete,
|
|
692
|
+
id,
|
|
693
|
+
isBlank
|
|
694
|
+
]);
|
|
695
|
+
const lastColumnIsCombobox = context?.columns?.at(-1)?.inlineEditConfig?.type === "combobox";
|
|
696
|
+
const trailingActionsCell = useMemo(() => hasActionsColumn ? /* @__PURE__ */ jsx(PinnedActionsCell, { children: /* @__PURE__ */ jsx(RowActions, {
|
|
697
|
+
actions: effectiveActions,
|
|
698
|
+
onDelete: effectiveOnDelete ? handleDelete : void 0,
|
|
699
|
+
inDedicatedColumn: true,
|
|
700
|
+
inCombobox: lastColumnIsCombobox
|
|
701
|
+
}) }) : null, [
|
|
702
|
+
hasActionsColumn,
|
|
703
|
+
effectiveActions,
|
|
704
|
+
effectiveOnDelete,
|
|
705
|
+
handleDelete,
|
|
706
|
+
lastColumnIsCombobox
|
|
707
|
+
]);
|
|
708
|
+
const renderedChildren = useMemo(() => {
|
|
709
|
+
if (hasActionsColumn) return children;
|
|
710
|
+
const childrenArray = Array.isArray(children) ? children : [children];
|
|
711
|
+
const lastChildIndex = childrenArray.length - 1;
|
|
712
|
+
return childrenArray.map((child, index) => {
|
|
713
|
+
if (!isValidElement(child) || index !== lastChildIndex) return child;
|
|
714
|
+
return cloneElement(child, {
|
|
715
|
+
isLastCell: true,
|
|
716
|
+
actions: effectiveActions,
|
|
717
|
+
onDelete: effectiveOnDelete,
|
|
718
|
+
...id != null && { itemId: String(id) }
|
|
719
|
+
});
|
|
720
|
+
});
|
|
721
|
+
}, [
|
|
722
|
+
hasActionsColumn,
|
|
723
|
+
children,
|
|
724
|
+
effectiveActions,
|
|
725
|
+
effectiveOnDelete,
|
|
726
|
+
id
|
|
727
|
+
]);
|
|
728
|
+
const rowChildrenWithContext = useMemo(() => /* @__PURE__ */ jsxs(TableBoxRowContext.Provider, {
|
|
729
|
+
value: rowContextValue,
|
|
730
|
+
children: [renderedChildren, trailingActionsCell]
|
|
731
|
+
}), [
|
|
732
|
+
renderedChildren,
|
|
733
|
+
trailingActionsCell,
|
|
734
|
+
rowContextValue
|
|
735
|
+
]);
|
|
736
|
+
useEffect(() => {
|
|
737
|
+
if (!rowRegistry || id == null) return;
|
|
738
|
+
const key = String(id);
|
|
739
|
+
const registry = rowRegistry.current;
|
|
740
|
+
registry.set(key, rowChildrenWithContext);
|
|
741
|
+
return () => {
|
|
742
|
+
registry.delete(key);
|
|
743
|
+
};
|
|
744
|
+
}, [
|
|
745
|
+
id,
|
|
746
|
+
rowChildrenWithContext,
|
|
747
|
+
rowRegistry
|
|
748
|
+
]);
|
|
749
|
+
const shouldRenderDropdown = dropdownFormFields || dropdownContent;
|
|
750
|
+
const rowContent = isReorderable ? /* @__PURE__ */ jsx(SortableTableBoxRowContent, {
|
|
751
|
+
...props,
|
|
752
|
+
id,
|
|
753
|
+
isSelected,
|
|
754
|
+
isSelectable,
|
|
755
|
+
onClick: handleClick,
|
|
756
|
+
rowRef,
|
|
757
|
+
draggedDirection,
|
|
758
|
+
children: rowChildrenWithContext
|
|
759
|
+
}) : /* @__PURE__ */ jsx(StyledRow, {
|
|
760
|
+
...props,
|
|
761
|
+
ref: rowRef,
|
|
762
|
+
id,
|
|
763
|
+
onClick: handleClick,
|
|
764
|
+
disableHoverBackground: true,
|
|
765
|
+
"aria-selected": isSelected,
|
|
766
|
+
$isSelectable: isSelectable,
|
|
767
|
+
children: rowChildrenWithContext
|
|
768
|
+
});
|
|
769
|
+
if (shouldRenderDropdown) return /* @__PURE__ */ jsx(Popover_default, {
|
|
770
|
+
trigger: rowContent,
|
|
771
|
+
open: isSelected,
|
|
772
|
+
children: /* @__PURE__ */ jsxs(Popover_default.Card, {
|
|
773
|
+
id: context?.rowDropdownId,
|
|
774
|
+
noPadding: true,
|
|
775
|
+
style: { zIndex: Z_INDICES.modalDropdown },
|
|
776
|
+
children: [
|
|
777
|
+
dropdownHeadingText && /* @__PURE__ */ jsx(DropdownPopoverHeading, { children: dropdownHeadingText }),
|
|
778
|
+
dropdownFormFields && /* @__PURE__ */ jsx(DropdownPopoverContent, {
|
|
779
|
+
spacing: Spacing[2],
|
|
780
|
+
children: /* @__PURE__ */ jsx(FormGroupContext.Provider, {
|
|
781
|
+
value: {
|
|
782
|
+
configField: true,
|
|
783
|
+
labelTooltipZIndex: Z_INDICES.modalDropdownTooltip
|
|
784
|
+
},
|
|
785
|
+
children: dropdownFormFields
|
|
786
|
+
})
|
|
787
|
+
}),
|
|
788
|
+
dropdownContent && /* @__PURE__ */ jsx(DropdownPopoverContent, {
|
|
789
|
+
spacing: Spacing[3],
|
|
790
|
+
children: dropdownContent
|
|
791
|
+
}),
|
|
792
|
+
dropdownFooter && /* @__PURE__ */ jsx(DropdownPopoverFooter, { children: dropdownFooter })
|
|
793
|
+
]
|
|
794
|
+
})
|
|
795
|
+
});
|
|
796
|
+
return rowContent;
|
|
797
|
+
};
|
|
798
|
+
const OverlayTable = styled.table`
|
|
799
|
+
width: 100%;
|
|
800
|
+
table-layout: fixed;
|
|
801
|
+
border-collapse: separate;
|
|
802
|
+
border-spacing: 0;
|
|
803
|
+
border: 1px solid ${Color.BorderDivider};
|
|
804
|
+
border-radius: ${BorderRadius.Md};
|
|
805
|
+
background: ${Color.BackgroundPrimary};
|
|
806
|
+
box-shadow: ${"0px 2px 10px 0px rgba(0, 0, 0, 0.04), 0px 5px 20px 0px rgba(0, 0, 0, 0.06), 0px 10px 40px 0px rgba(0, 0, 0, 0.08)"};
|
|
807
|
+
`;
|
|
808
|
+
/**
|
|
809
|
+
* Visual clone of a `TableBoxRow` used inside `@dnd-kit`'s `DragOverlay`.
|
|
810
|
+
* Renders a minimal table wrapper with a static drag-handle cell followed by
|
|
811
|
+
* the original row's cells, so the portaled overlay looks identical to the
|
|
812
|
+
* dragged row while it follows the pointer.
|
|
813
|
+
*
|
|
814
|
+
* `cellWidths` is the measured width (in px) of each `<td>` in the source
|
|
815
|
+
* row at drag start, in source order (drag handle cell first, then content
|
|
816
|
+
* cells). Applied via a `<colgroup>` with `table-layout: fixed` so the
|
|
817
|
+
* overlay's columns align 1:1 with the source table instead of re-flowing
|
|
818
|
+
* to the single row's content.
|
|
819
|
+
*/
|
|
820
|
+
const TableBoxRowOverlay = ({ children, cellWidths }) => /* @__PURE__ */ jsxs(OverlayTable, {
|
|
821
|
+
"aria-hidden": "true",
|
|
822
|
+
children: [/* @__PURE__ */ jsx("colgroup", { children: cellWidths.map((width, i) => /* @__PURE__ */ jsx("col", { style: { width: `${width}px` } }, i)) }), /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs(StyledRow, {
|
|
823
|
+
disableHoverBackground: true,
|
|
824
|
+
children: [/* @__PURE__ */ jsx(DragHandleCell, { children: /* @__PURE__ */ jsx(DragHandleButton, {
|
|
825
|
+
tabIndex: -1,
|
|
826
|
+
"aria-hidden": "true",
|
|
827
|
+
children: /* @__PURE__ */ jsx(DragIcon, {})
|
|
828
|
+
}) }), children]
|
|
829
|
+
}) })]
|
|
830
|
+
});
|
|
831
|
+
//#endregion
|
|
832
|
+
//#region components/TableBox/useColumnWidthLock.ts
|
|
833
|
+
/**
|
|
834
|
+
* Captures the live `<th>` widths of a table the moment inline editing starts
|
|
835
|
+
* and clears them when editing ends.
|
|
836
|
+
*
|
|
837
|
+
* Consumers render a `<colgroup>` from `lockedColWidths` and switch the table
|
|
838
|
+
* to `table-layout: fixed` for the duration of the edit so the input swap
|
|
839
|
+
* doesn't reflow the columns.
|
|
840
|
+
*/
|
|
841
|
+
const useColumnWidthLock = (tableRef, { enabled = true } = {}) => {
|
|
842
|
+
const [lockedColWidths, setLockedColWidths] = useState(null);
|
|
843
|
+
return {
|
|
844
|
+
lockedColWidths,
|
|
845
|
+
onEditingChange: useCallback((isEditing) => {
|
|
846
|
+
if (!enabled) return;
|
|
847
|
+
if (!isEditing) {
|
|
848
|
+
setLockedColWidths(null);
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
const ths = Array.from(tableRef.current?.querySelectorAll(":scope > thead > tr > th") ?? []);
|
|
852
|
+
if (ths.length > 0) setLockedColWidths(ths.map((th) => th.getBoundingClientRect().width));
|
|
853
|
+
}, [tableRef, enabled])
|
|
854
|
+
};
|
|
855
|
+
};
|
|
856
|
+
//#endregion
|
|
857
|
+
//#region components/TableBox/useTableBoxDragAndDrop.ts
|
|
858
|
+
const DRAG_DIRECTION_THRESHOLD = 4;
|
|
859
|
+
/**
|
|
860
|
+
* Bundles the `@dnd-kit` wiring TableBox needs to support row reordering:
|
|
861
|
+
* sensors, lifecycle handlers, the dragged row's overlay content, and the
|
|
862
|
+
* pointer direction used by rows to position drop indicators in dnd-kit's
|
|
863
|
+
* "dead zone" (overIndex === activeIndex).
|
|
864
|
+
*
|
|
865
|
+
* Also forces a `grabbing` cursor on `<body>` while a row is active so the
|
|
866
|
+
* cursor persists when the pointer leaves the drag handle.
|
|
867
|
+
*/
|
|
868
|
+
const useTableBoxDragAndDrop = ({ tableRef, reorderConfig }) => {
|
|
869
|
+
const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
870
|
+
const rowRegistry = useRef(/* @__PURE__ */ new Map());
|
|
871
|
+
const [activeId, setActiveId] = useState(null);
|
|
872
|
+
const [draggedDirection, setDraggedDirection] = useState(null);
|
|
873
|
+
const [overlayCellWidths, setOverlayCellWidths] = useState(null);
|
|
874
|
+
useEffect(() => {
|
|
875
|
+
if (activeId == null) return;
|
|
876
|
+
const previous = document.body.style.cursor;
|
|
877
|
+
document.body.style.cursor = "grabbing";
|
|
878
|
+
return () => {
|
|
879
|
+
document.body.style.cursor = previous;
|
|
880
|
+
};
|
|
881
|
+
}, [activeId]);
|
|
882
|
+
const sortableIds = useMemo(() => {
|
|
883
|
+
if (!reorderConfig) return [];
|
|
884
|
+
return reorderConfig.items.map((item) => String(item[reorderConfig.itemKeyPath]));
|
|
885
|
+
}, [reorderConfig]);
|
|
886
|
+
const handleDragStart = useCallback((event) => {
|
|
887
|
+
const id = String(event.active.id);
|
|
888
|
+
setActiveId(id);
|
|
889
|
+
setDraggedDirection(null);
|
|
890
|
+
const rowElement = tableRef.current?.querySelector(`tr[id="${CSS.escape(id)}"]`);
|
|
891
|
+
if (rowElement) setOverlayCellWidths(Array.from(rowElement.children).filter((child) => child.tagName === "TD").map((td) => td.getBoundingClientRect().width));
|
|
892
|
+
else setOverlayCellWidths(null);
|
|
893
|
+
}, [tableRef]);
|
|
894
|
+
const handleDragMove = useCallback((event) => {
|
|
895
|
+
const { y } = event.delta;
|
|
896
|
+
const next = y < -DRAG_DIRECTION_THRESHOLD ? "up" : y > DRAG_DIRECTION_THRESHOLD ? "down" : null;
|
|
897
|
+
setDraggedDirection((prev) => prev === next ? prev : next);
|
|
898
|
+
}, []);
|
|
899
|
+
const resetDragState = useCallback(() => {
|
|
900
|
+
setActiveId(null);
|
|
901
|
+
setDraggedDirection(null);
|
|
902
|
+
setOverlayCellWidths(null);
|
|
903
|
+
}, []);
|
|
904
|
+
return {
|
|
905
|
+
activeId,
|
|
906
|
+
overlayCellWidths,
|
|
907
|
+
draggedDirection,
|
|
908
|
+
sortableIds,
|
|
909
|
+
rowRegistry,
|
|
910
|
+
dndContextProps: {
|
|
911
|
+
sensors,
|
|
912
|
+
collisionDetection: closestCenter,
|
|
913
|
+
onDragStart: handleDragStart,
|
|
914
|
+
onDragMove: handleDragMove,
|
|
915
|
+
onDragEnd: useCallback((event) => {
|
|
916
|
+
resetDragState();
|
|
917
|
+
if (!reorderConfig) return;
|
|
918
|
+
const { active, over } = event;
|
|
919
|
+
if (!over || active.id === over.id) return;
|
|
920
|
+
const { items, itemKeyPath, onReorder } = reorderConfig;
|
|
921
|
+
const fromIndex = findIndexByKey(items, itemKeyPath, String(active.id));
|
|
922
|
+
const toIndex = findIndexByKey(items, itemKeyPath, String(over.id));
|
|
923
|
+
if (fromIndex === -1 || toIndex === -1) return;
|
|
924
|
+
onReorder(moveItemByIndex(items, fromIndex, toIndex));
|
|
925
|
+
}, [reorderConfig, resetDragState]),
|
|
926
|
+
onDragCancel: resetDragState
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
//#endregion
|
|
931
|
+
//#region components/TableBox/TableBox.tsx
|
|
932
|
+
const TableBoxContext = createContext(null);
|
|
933
|
+
const DRAG_HANDLE_CELL_WIDTH = 24;
|
|
934
|
+
const RIGHT_FADE_WIDTH = 48;
|
|
935
|
+
const HEADER_HEIGHT_PX = parseInt(Spacing[1], 10) * 2 + parseInt(Typography.TextSmall.lineHeight, 10) + 1;
|
|
936
|
+
const TableScrollContainer = styled.div`
|
|
937
|
+
border: 1px solid ${Color.BorderDivider};
|
|
938
|
+
border-radius: ${BorderRadius.Md};
|
|
939
|
+
overflow-x: ${({ $fixedLayout, $hasHorizontalOverflow }) => $fixedLayout ? "visible" : $hasHorizontalOverflow ? "auto" : "visible"};
|
|
940
|
+
overscroll-behavior-x: none;
|
|
941
|
+
`;
|
|
942
|
+
const ScrollAffordanceWrapper = styled.div`
|
|
943
|
+
position: relative;
|
|
944
|
+
`;
|
|
945
|
+
const RightFadeOverlay = styled.div`
|
|
946
|
+
position: absolute;
|
|
947
|
+
top: 1px;
|
|
948
|
+
right: 1px;
|
|
949
|
+
bottom: 1px;
|
|
950
|
+
width: ${RIGHT_FADE_WIDTH}px;
|
|
951
|
+
/* Sits above the sticky first column (z-index 2) but below the pinned
|
|
952
|
+
row actions (z-index 4) so action buttons stay legible. */
|
|
953
|
+
z-index: 3;
|
|
954
|
+
pointer-events: none;
|
|
955
|
+
background:
|
|
956
|
+
linear-gradient(to right, transparent, ${Color.BackgroundSecondary}) top left / 100%
|
|
957
|
+
${Math.max(0, HEADER_HEIGHT_PX - 1)}px no-repeat,
|
|
958
|
+
linear-gradient(to right, transparent, ${Color.BackgroundPrimary}) bottom left / 100%
|
|
959
|
+
calc(100% - ${HEADER_HEIGHT_PX}px) no-repeat;
|
|
960
|
+
border-top-right-radius: ${BorderRadius.Md};
|
|
961
|
+
border-bottom-right-radius: ${BorderRadius.Md};
|
|
962
|
+
opacity: ${({ $visible }) => $visible ? 1 : 0};
|
|
963
|
+
transition: opacity ${"200ms"} ease-out;
|
|
964
|
+
`;
|
|
965
|
+
const stickyContentColumn = (isReorderable) => css`
|
|
966
|
+
&& thead th:first-child,
|
|
967
|
+
&& tbody td:first-child {
|
|
968
|
+
position: sticky;
|
|
969
|
+
left: 0;
|
|
970
|
+
z-index: 2;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
&& tbody td:first-child {
|
|
974
|
+
background-color: inherit;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
${isReorderable && css`
|
|
978
|
+
&& thead th:nth-child(2),
|
|
979
|
+
&& tbody td:nth-child(2) {
|
|
980
|
+
position: sticky;
|
|
981
|
+
left: ${DRAG_HANDLE_CELL_WIDTH}px;
|
|
982
|
+
z-index: 2;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
&& tbody td:nth-child(2) {
|
|
986
|
+
background-color: inherit;
|
|
987
|
+
}
|
|
988
|
+
`}
|
|
989
|
+
`;
|
|
990
|
+
const StyledTable = styled(Table)`
|
|
991
|
+
caret-color: ${Color.BorderFocus};
|
|
992
|
+
|
|
993
|
+
&::selection {
|
|
994
|
+
background: ${Color.BackgroundLabelPurple};
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
${({ $fixedLayout, $isReorderable }) => $fixedLayout ? css`
|
|
998
|
+
/* Legacy: truncate long cell content to container width. */
|
|
999
|
+
table-layout: fixed;
|
|
1000
|
+
` : stickyContentColumn($isReorderable)}
|
|
1001
|
+
|
|
1002
|
+
/* Lock column widths while inline editing to prevent layout reflow. */
|
|
1003
|
+
${({ $fixedLayout, $lockedWidth }) => !$fixedLayout && $lockedWidth != null && css`
|
|
1004
|
+
table-layout: fixed;
|
|
1005
|
+
width: ${$lockedWidth}px;
|
|
1006
|
+
`}
|
|
1007
|
+
|
|
1008
|
+
/* Subtle right border on the sticky column when content extends off-screen
|
|
1009
|
+
— inset shadow keeps it layout-neutral. */
|
|
1010
|
+
${({ $hasHorizontalOverflow, $isReorderable, $fixedLayout }) => $hasHorizontalOverflow && !$fixedLayout && css`
|
|
1011
|
+
${$isReorderable ? `&& thead th:nth-child(2), && tbody td:nth-child(2)` : `&& thead th:first-child, && tbody td:first-child`} {
|
|
1012
|
+
box-shadow: inset -1px 0 0 ${Color.BorderDivider};
|
|
1013
|
+
}
|
|
1014
|
+
`}
|
|
1015
|
+
|
|
1016
|
+
/* When the header is hidden, round the first body row's outer corners so
|
|
1017
|
+
they line up with the surrounding container's rounded border. */
|
|
1018
|
+
${({ $hideHeader }) => $hideHeader && css`
|
|
1019
|
+
&& tbody tr:first-child td:first-child {
|
|
1020
|
+
border-top-left-radius: ${BorderRadius.Md};
|
|
1021
|
+
}
|
|
1022
|
+
&& tbody tr:first-child td:last-child {
|
|
1023
|
+
border-top-right-radius: ${BorderRadius.Md};
|
|
1024
|
+
}
|
|
1025
|
+
`}
|
|
1026
|
+
`;
|
|
1027
|
+
const StyledTableHeaderCell = styled(TableHeaderCell)`
|
|
1028
|
+
padding: ${Spacing[1]} ${Spacing[2]};
|
|
1029
|
+
border-bottom: 1px solid ${Color.BorderDivider};
|
|
1030
|
+
${paragraphMixins.sm};
|
|
1031
|
+
|
|
1032
|
+
/* Border radius for corner cells */
|
|
1033
|
+
&:first-child {
|
|
1034
|
+
border-radius: ${BorderRadius.Md} 0 0 0;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
&:last-child {
|
|
1038
|
+
border-radius: 0 ${BorderRadius.Md} 0 0;
|
|
1039
|
+
}
|
|
1040
|
+
`;
|
|
1041
|
+
const DragHandleHeaderCell = styled(StyledTableHeaderCell)`
|
|
1042
|
+
width: 24px;
|
|
1043
|
+
padding: ${Spacing[1]} ${Spacing[0]};
|
|
1044
|
+
`;
|
|
1045
|
+
const PinnedActionsCell = styled(TableCell)`
|
|
1046
|
+
position: sticky;
|
|
1047
|
+
right: 0;
|
|
1048
|
+
z-index: 4;
|
|
1049
|
+
background: transparent;
|
|
1050
|
+
border-bottom: 1px solid ${Color.BorderHairline};
|
|
1051
|
+
padding: 0;
|
|
1052
|
+
width: ${RowActionsContainerWithFadeWidth}px;
|
|
1053
|
+
height: 1px; /* dummy height lets the child use height: 100% */
|
|
1054
|
+
`;
|
|
1055
|
+
const EmptyStateCell = styled(TableCell)`
|
|
1056
|
+
${paragraphMixins.sm};
|
|
1057
|
+
padding: ${Spacing[2]};
|
|
1058
|
+
color: ${Color.TextSecondary};
|
|
1059
|
+
border-bottom: none;
|
|
1060
|
+
`;
|
|
1061
|
+
const TableBox = ({ children, emptyText, selectedKey, defaultSelectedKey, columns, onSelectionChange, selectionMode = "none", newRowId, onCreateNewRow: onCreateNewRowProp, disabled = false, reorderConfig, disableHorizontalScroll: disableHorizontalScrollProp = false, hideHeader = false, "aria-label": ariaLabel, ...props }) => {
|
|
1062
|
+
const tableRef = useRef(null);
|
|
1063
|
+
const scrollContainerRef = useRef(null);
|
|
1064
|
+
const tableBoxId = useMemo(() => uniqueId("tablebox-"), []);
|
|
1065
|
+
const rowDropdownId = `${tableBoxId}-row-dropdown`;
|
|
1066
|
+
const hasInlineEditableColumn = columns.some((c) => c.inlineEditConfig != null);
|
|
1067
|
+
const disableHorizontalScroll = disableHorizontalScrollProp || hasInlineEditableColumn;
|
|
1068
|
+
const { hasHorizontalOverflow, hasMoreScrollRight } = useScrollOverflow(scrollContainerRef, { enabled: !disableHorizontalScroll });
|
|
1069
|
+
const { lockedColWidths, onEditingChange } = useColumnWidthLock(tableRef, { enabled: !disableHorizontalScroll });
|
|
1070
|
+
const [internalSelectedKey, setInternalSelectedKey] = useState(defaultSelectedKey ?? null);
|
|
1071
|
+
const [shouldCreateNewRowAfterCommit, setShouldCreateNewRowAfterCommit] = useState(false);
|
|
1072
|
+
const currentSelectedKey = selectedKey ?? internalSelectedKey;
|
|
1073
|
+
const scheduleCreateNewRowAfterCommit = () => {
|
|
1074
|
+
setShouldCreateNewRowAfterCommit(true);
|
|
1075
|
+
};
|
|
1076
|
+
const handleRowClick = useCallback((rowId) => {
|
|
1077
|
+
if (selectionMode === "none") return;
|
|
1078
|
+
if (!onSelectionChange) setInternalSelectedKey(rowId);
|
|
1079
|
+
else onSelectionChange(rowId);
|
|
1080
|
+
}, [onSelectionChange, selectionMode]);
|
|
1081
|
+
const handleOutsideClick = useCallback((event) => {
|
|
1082
|
+
if (!document.querySelector(`[id="${rowDropdownId}"][data-state="open"]`)) return;
|
|
1083
|
+
const target = event.target;
|
|
1084
|
+
const isOutsideTableBox = tableRef.current && !tableRef.current.contains(target);
|
|
1085
|
+
const isOnRowDropdownContent = target.closest(`[id="${rowDropdownId}"]`);
|
|
1086
|
+
if (isOutsideTableBox && !isOnRowDropdownContent && currentSelectedKey != null) if (!onSelectionChange) setInternalSelectedKey(null);
|
|
1087
|
+
else onSelectionChange(null);
|
|
1088
|
+
}, [
|
|
1089
|
+
currentSelectedKey,
|
|
1090
|
+
onSelectionChange,
|
|
1091
|
+
rowDropdownId
|
|
1092
|
+
]);
|
|
1093
|
+
useEffect(() => {
|
|
1094
|
+
document.addEventListener("mousedown", handleOutsideClick);
|
|
1095
|
+
return () => {
|
|
1096
|
+
document.removeEventListener("mousedown", handleOutsideClick);
|
|
1097
|
+
};
|
|
1098
|
+
}, [handleOutsideClick]);
|
|
1099
|
+
useEffect(() => {
|
|
1100
|
+
if (!shouldCreateNewRowAfterCommit) return;
|
|
1101
|
+
setShouldCreateNewRowAfterCommit(false);
|
|
1102
|
+
onCreateNewRowProp?.();
|
|
1103
|
+
}, [onCreateNewRowProp, shouldCreateNewRowAfterCommit]);
|
|
1104
|
+
const { activeId, overlayCellWidths, draggedDirection, sortableIds, rowRegistry, dndContextProps } = useTableBoxDragAndDrop({
|
|
1105
|
+
tableRef,
|
|
1106
|
+
reorderConfig: disabled ? void 0 : reorderConfig
|
|
1107
|
+
});
|
|
1108
|
+
const isReorderable = !disabled && reorderConfig != null;
|
|
1109
|
+
const hasActionsColumn = !disableHorizontalScroll;
|
|
1110
|
+
const contextValue = {
|
|
1111
|
+
disabled,
|
|
1112
|
+
newRowId,
|
|
1113
|
+
columns,
|
|
1114
|
+
selectedKey: currentSelectedKey,
|
|
1115
|
+
selectionMode,
|
|
1116
|
+
onRowClick: handleRowClick,
|
|
1117
|
+
tableBoxId,
|
|
1118
|
+
rowDropdownId,
|
|
1119
|
+
isReorderable,
|
|
1120
|
+
rowRegistry: isReorderable ? rowRegistry : null,
|
|
1121
|
+
draggedDirection,
|
|
1122
|
+
hasActionsColumn,
|
|
1123
|
+
hasHorizontalOverflow,
|
|
1124
|
+
onEditingChange,
|
|
1125
|
+
scheduleCreateNewRowAfterCommit: onCreateNewRowProp ? scheduleCreateNewRowAfterCommit : void 0
|
|
1126
|
+
};
|
|
1127
|
+
const isEmpty = Array.isArray(children) ? children.length === 0 : children == null;
|
|
1128
|
+
const totalColumnCount = columns.length + (isReorderable ? 1 : 0) + (hasActionsColumn ? 1 : 0);
|
|
1129
|
+
const activeRowContent = activeId ? rowRegistry.current.get(activeId) ?? null : null;
|
|
1130
|
+
const tableContent = /* @__PURE__ */ jsxs(ScrollAffordanceWrapper, { children: [/* @__PURE__ */ jsx(TableScrollContainer, {
|
|
1131
|
+
ref: scrollContainerRef,
|
|
1132
|
+
$fixedLayout: disableHorizontalScroll,
|
|
1133
|
+
$hasHorizontalOverflow: hasHorizontalOverflow,
|
|
1134
|
+
children: /* @__PURE__ */ jsxs(StyledTable, {
|
|
1135
|
+
ref: tableRef,
|
|
1136
|
+
size: "md",
|
|
1137
|
+
"aria-label": ariaLabel,
|
|
1138
|
+
tabIndex: -1,
|
|
1139
|
+
$isReorderable: isReorderable,
|
|
1140
|
+
$hasHorizontalOverflow: hasHorizontalOverflow,
|
|
1141
|
+
$fixedLayout: disableHorizontalScroll,
|
|
1142
|
+
$hideHeader: hideHeader,
|
|
1143
|
+
$lockedWidth: lockedColWidths != null ? lockedColWidths.reduce((sum, w) => sum + w, 0) : void 0,
|
|
1144
|
+
...props,
|
|
1145
|
+
children: [
|
|
1146
|
+
lockedColWidths && /* @__PURE__ */ jsx("colgroup", { children: lockedColWidths.map((w, i) => /* @__PURE__ */ jsx("col", { style: { width: `${w}px` } }, i)) }),
|
|
1147
|
+
!hideHeader && /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
1148
|
+
isReorderable && /* @__PURE__ */ jsx(DragHandleHeaderCell, { "aria-hidden": "true" }),
|
|
1149
|
+
columns.map((column) => /* @__PURE__ */ jsx(StyledTableHeaderCell, { children: column.title }, column.key)),
|
|
1150
|
+
hasActionsColumn && /* @__PURE__ */ jsx(StyledTableHeaderCell, {
|
|
1151
|
+
"aria-hidden": "true",
|
|
1152
|
+
style: { padding: 0 }
|
|
1153
|
+
})
|
|
1154
|
+
] }) }),
|
|
1155
|
+
/* @__PURE__ */ jsx(TableBody, { children: isEmpty ? /* @__PURE__ */ jsx(TableRow, {
|
|
1156
|
+
disableHoverBackground: true,
|
|
1157
|
+
children: /* @__PURE__ */ jsx(EmptyStateCell, {
|
|
1158
|
+
colSpan: totalColumnCount,
|
|
1159
|
+
children: emptyText || "No data available."
|
|
1160
|
+
})
|
|
1161
|
+
}) : children })
|
|
1162
|
+
]
|
|
1163
|
+
})
|
|
1164
|
+
}), !disableHorizontalScroll && /* @__PURE__ */ jsx(RightFadeOverlay, {
|
|
1165
|
+
"aria-hidden": "true",
|
|
1166
|
+
$visible: hasMoreScrollRight
|
|
1167
|
+
})] });
|
|
1168
|
+
return /* @__PURE__ */ jsx(TableBoxContext.Provider, {
|
|
1169
|
+
value: contextValue,
|
|
1170
|
+
children: isReorderable ? /* @__PURE__ */ jsxs(DndContext, {
|
|
1171
|
+
...dndContextProps,
|
|
1172
|
+
children: [/* @__PURE__ */ jsx(SortableContext, {
|
|
1173
|
+
items: sortableIds,
|
|
1174
|
+
strategy: verticalListSortingStrategy,
|
|
1175
|
+
children: tableContent
|
|
1176
|
+
}), /* @__PURE__ */ jsx(DragOverlay, { children: activeRowContent && overlayCellWidths && /* @__PURE__ */ jsx(TableBoxRowOverlay, {
|
|
1177
|
+
cellWidths: overlayCellWidths,
|
|
1178
|
+
children: activeRowContent
|
|
1179
|
+
}) })]
|
|
1180
|
+
}) : tableContent
|
|
1181
|
+
});
|
|
1182
|
+
};
|
|
1183
|
+
TableBox.Row = TableBoxRow;
|
|
1184
|
+
TableBox.Cell = TableBoxCell;
|
|
1185
|
+
//#endregion
|
|
1186
|
+
export { TableBoxContext as n, TableBox as t };
|
|
1187
|
+
|
|
1188
|
+
//# sourceMappingURL=TableBox-CPCWzwSl.mjs.map
|