@persona/design-system 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/{Action-CVtzREhU.d.mts → Action-DnR0YTxO.d.mts} +3 -3
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +3 -3
- package/dist/AdvancedFilterRulesPopover.d.mts +3 -3
- package/dist/ArrayValueControl.d.mts +1 -1
- package/dist/Attribute.d.mts +4 -4
- package/dist/AttributeGrid.d.mts +1 -1
- package/dist/{Badge-DEVbRlJX.mjs → Badge-DRn_r6is.mjs} +2 -2
- package/dist/{Badge-DEVbRlJX.mjs.map → Badge-DRn_r6is.mjs.map} +1 -1
- package/dist/Banner.d.mts +1 -1
- package/dist/BooleanValueControl.d.mts +1 -1
- package/dist/{Breadcrumb-lziQ1FX9.d.mts → Breadcrumb-DEwZFJHF.d.mts} +10 -2
- package/dist/Breadcrumb.d.mts +1 -1
- package/dist/{Breadcrumbs-DJ5qqqRD.d.mts → Breadcrumbs-0e_3v9FF.d.mts} +2 -2
- package/dist/{Breadcrumbs-W8hIhdHD.mjs → Breadcrumbs-Byf2ye6H.mjs} +43 -26
- package/dist/Breadcrumbs-Byf2ye6H.mjs.map +1 -0
- package/dist/Breadcrumbs.d.mts +1 -1
- package/dist/{Button-Vd5O4DUp.d.mts → Button-DkjwN_Op.d.mts} +3 -3
- 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-BMCB9eFC.mjs → Card-CLTkZLKr.mjs} +4 -4
- package/dist/{Card-BMCB9eFC.mjs.map → Card-CLTkZLKr.mjs.map} +1 -1
- package/dist/{Card-CqnG--CU.d.mts → Card-DxFajLnx.d.mts} +4 -4
- package/dist/Card.d.mts +1 -1
- package/dist/Card2.d.mts +1 -1
- package/dist/{CardV2-C0fcOUdp.mjs → CardV2-m9yOInMU.mjs} +16 -16
- package/dist/{CardV2-C0fcOUdp.mjs.map → CardV2-m9yOInMU.mjs.map} +1 -1
- package/dist/{Checkbox-Bm8exUfH.d.mts → Checkbox-Bmm-r5ei.d.mts} +1 -1
- package/dist/{Checkbox-BcuiFvK7.mjs → Checkbox-CU27-Aa8.mjs} +6 -6
- package/dist/{Checkbox-BcuiFvK7.mjs.map → Checkbox-CU27-Aa8.mjs.map} +1 -1
- package/dist/Checkbox.d.mts +1 -1
- package/dist/CheckboxGroupField.d.mts +2 -2
- package/dist/ChoicesValueControl.d.mts +1 -1
- package/dist/{Combobox-BaD0f2Du.d.mts → Combobox-BgKEHP9p.d.mts} +3 -3
- package/dist/{Combobox-B6JyLog8.mjs → Combobox-DhTUY8JT.mjs} +55 -31
- package/dist/Combobox-DhTUY8JT.mjs.map +1 -0
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-BsPf8BZh.d.mts → ComboboxBase-Dmzn8a53.d.mts} +7 -7
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-DhLzCWbz.d.mts → ComboboxMultiSelect-BLKUKNEW.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-P0r5rs_u.d.mts → ComboboxSingleSelect-Kpl-iOok.d.mts} +4 -4
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-CXqlVKy7.d.mts → CompactBar-E9hPDRvI.d.mts} +3 -3
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ConfigFormGroup-yhb2jldT.mjs → ConfigFormGroup-GgzSDzgL.mjs} +3 -3
- package/dist/{ConfigFormGroup-yhb2jldT.mjs.map → ConfigFormGroup-GgzSDzgL.mjs.map} +1 -1
- package/dist/{ControlBar-tOCQnbAl.d.mts → ControlBar-DYrjBDzu.d.mts} +2 -2
- package/dist/ControlBar.d.mts +1 -1
- package/dist/DataTable.d.mts +4 -4
- package/dist/DateField.d.mts +1 -1
- package/dist/{DatePicker-Bw79p-Lx.mjs → DatePicker-DpGvo7Bd.mjs} +23 -23
- package/dist/DatePicker-DpGvo7Bd.mjs.map +1 -0
- package/dist/DatePicker.d.mts +1 -1
- package/dist/DateRangePicker.d.mts +2 -1
- package/dist/DateValueControl.d.mts +1 -1
- package/dist/{DropdownButton-BI3IFJun.mjs → DropdownButton-DGgfGW_o.mjs} +3 -3
- package/dist/{DropdownButton-BI3IFJun.mjs.map → DropdownButton-DGgfGW_o.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-D6nfAsi0.d.mts → DropdownMenu-B2t3Bwky.d.mts} +3 -3
- package/dist/{DropdownMenu-D25WBCah.mjs → DropdownMenu-DZIFSJXD.mjs} +3 -3
- package/dist/{DropdownMenu-D25WBCah.mjs.map → DropdownMenu-DZIFSJXD.mjs.map} +1 -1
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-CN2XjaOX.d.mts → ErrorProps-DX50vo-U.d.mts} +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/{FieldRegistry-rqSkjchY.d.mts → FieldRegistry-COyIA4VU.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-D3LiIy1-.d.mts → FilterBar-CS2YjiTr.d.mts} +8 -5
- package/dist/FilterBar.d.mts +1 -1
- package/dist/FilterPickerMenu.d.mts +3 -3
- package/dist/FilterPill.d.mts +1 -1
- package/dist/FilterPopover.d.mts +13 -3
- package/dist/FloatValueControl.d.mts +1 -1
- package/dist/{FormControl-CFU9uKF7.mjs → FormControl-BIXJ-FPI.mjs} +5 -5
- package/dist/{FormControl-CFU9uKF7.mjs.map → FormControl-BIXJ-FPI.mjs.map} +1 -1
- package/dist/{FormControl-DH3bgqaB.d.mts → FormControl-CZFmub1N.d.mts} +3 -3
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +1 -1
- package/dist/{FormField-BugkBvN4.d.mts → FormField-8rlT8pm0.d.mts} +2 -2
- package/dist/{FormField-DdmgSWq4.mjs → FormField-DcGQvgNW.mjs} +32 -31
- package/dist/FormField-DcGQvgNW.mjs.map +1 -0
- package/dist/FormField.d.mts +1 -1
- package/dist/{Header-CDTYK1XJ.d.mts → Header-OLZuv8fF.d.mts} +2 -2
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-B7Ysh8B3.d.mts → HelperTooltip-CJDG7Ugp.d.mts} +3 -3
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/{HoverCopyableField-7TWP0Y1Z.mjs → HoverCopyableField-BHdCaR-R.mjs} +6 -6
- package/dist/{HoverCopyableField-7TWP0Y1Z.mjs.map → HoverCopyableField-BHdCaR-R.mjs.map} +1 -1
- package/dist/HoverCopyableField.d.mts +1 -1
- package/dist/{IconButton-P8w0JDI5.mjs → IconButton-DC4rh6ow.mjs} +5 -5
- package/dist/{IconButton-P8w0JDI5.mjs.map → IconButton-DC4rh6ow.mjs.map} +1 -1
- package/dist/{IconButton-BHCmHIx5.d.mts → IconButton-Dc17jZPG.d.mts} +2 -2
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.mts +2 -2
- package/dist/InlineCombobox.d.mts +2 -2
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Input-DMgVyZyq.d.mts → Input-DsS4J78T.d.mts} +5 -5
- package/dist/{Input-QC6xla6I.mjs → Input-PWfwMSJ7.mjs} +5 -5
- package/dist/{Input-QC6xla6I.mjs.map → Input-PWfwMSJ7.mjs.map} +1 -1
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-BnjxrdWQ.d.mts → InputProps-Buxtnz77.d.mts} +2 -2
- package/dist/InputProps.d.mts +1 -1
- package/dist/IntegerValueControl.d.mts +1 -1
- package/dist/LayoutLoadingShimmer.d.mts +1 -1
- package/dist/Link.d.mts +1 -1
- package/dist/{ListBox-TrL3Tb7X.mjs → ListBox-BwD-q7wF.mjs} +12 -12
- package/dist/{ListBox-TrL3Tb7X.mjs.map → ListBox-BwD-q7wF.mjs.map} +1 -1
- package/dist/{ListBox-D09N1a5D.d.mts → ListBox-Nl9aOBeh.d.mts} +5 -5
- package/dist/ListBox.d.mts +1 -1
- package/dist/ListBoxField.d.mts +3 -3
- package/dist/{LoadingShimmer-Dsc_RCCf.mjs → LoadingShimmer-BPYPtFE1.mjs} +1 -1
- package/dist/{LoadingShimmer-Dsc_RCCf.mjs.map → LoadingShimmer-BPYPtFE1.mjs.map} +1 -1
- package/dist/LoadingShimmer.d.mts +2 -2
- package/dist/{LogicRow-BcuiSTHN.d.mts → LogicRow-BAREMenx.d.mts} +4 -4
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +1 -1
- package/dist/{Menu-Bv8dsrz6.d.mts → Menu-DM9OoZ71.d.mts} +4 -4
- package/dist/{Menu-DmeMgN-i.mjs → Menu-DpM8o234.mjs} +4 -4
- package/dist/{Menu-DmeMgN-i.mjs.map → Menu-DpM8o234.mjs.map} +1 -1
- package/dist/Menu.d.mts +1 -1
- package/dist/{MiddleTruncatedText-GXI-CPvs.mjs → MiddleTruncatedText-Bzpg3zAU.mjs} +3 -3
- package/dist/{MiddleTruncatedText-GXI-CPvs.mjs.map → MiddleTruncatedText-Bzpg3zAU.mjs.map} +1 -1
- package/dist/Modal.d.mts +3 -3
- package/dist/{PageHeader-jSLud2JI.mjs → PageHeader-Dq-J3san.mjs} +3 -3
- package/dist/{PageHeader-jSLud2JI.mjs.map → PageHeader-Dq-J3san.mjs.map} +1 -1
- package/dist/PageHeader.d.mts +2 -2
- package/dist/PageLayout.d.mts +16 -0
- package/dist/{PageSelector-vay4jpMp.d.mts → PageSelector-Ca4TcyxG.d.mts} +3 -3
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-ygLutOst.d.mts → Pagination-Dcmv7bVe.d.mts} +2 -2
- package/dist/{Pagination-BeYukNCj.mjs → Pagination-GALyid4q.mjs} +7 -7
- package/dist/{Pagination-BeYukNCj.mjs.map → Pagination-GALyid4q.mjs.map} +1 -1
- package/dist/Pagination.d.mts +1 -1
- package/dist/{Pii-QsTrz8wn.mjs → Pii-BalLvfze.mjs} +2 -2
- package/dist/{Pii-QsTrz8wn.mjs.map → Pii-BalLvfze.mjs.map} +1 -1
- package/dist/Pii.d.mts +1 -1
- package/dist/PillShell.d.mts +1 -1
- package/dist/{Popover-BkDpDdaO.mjs → Popover-BZ5Bs80y.mjs} +5 -5
- package/dist/{Popover-BkDpDdaO.mjs.map → Popover-BZ5Bs80y.mjs.map} +1 -1
- package/dist/Popover.d.mts +1 -1
- package/dist/ProgressBar.d.mts +1 -1
- package/dist/ProgressIndicator.d.mts +1 -1
- package/dist/{PseudoClassProps-DLxPxo7T.d.mts → PseudoClassProps-CcSlKNev.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-CSX2eO-O.mjs → Radio-CtPz3EzX.mjs} +3 -3
- package/dist/{Radio-CSX2eO-O.mjs.map → Radio-CtPz3EzX.mjs.map} +1 -1
- package/dist/{RadioGroup-DKqbSfju.d.mts → RadioGroup-Xn46ovrV.d.mts} +1 -1
- package/dist/{RadioGroup-CnK0opBd.mjs → RadioGroup-sjBzFE_-.mjs} +3 -3
- package/dist/{RadioGroup-CnK0opBd.mjs.map → RadioGroup-sjBzFE_-.mjs.map} +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/RangeCalendar.d.mts +3 -1
- package/dist/RangeCalendarPresets.d.mts +1 -1
- package/dist/RuleEditorFields.d.mts +3 -3
- package/dist/RulesPill.d.mts +1 -1
- package/dist/{SearchInput-Bp2yjaE1.d.mts → SearchInput-Try11aJD.d.mts} +10 -3
- package/dist/SearchInput.d.mts +1 -1
- package/dist/Section.d.mts +1 -1
- package/dist/{SectionHeading-Q-rx2LEd.d.mts → SectionHeading-DvP9NEgN.d.mts} +2 -2
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-CgDQIVll.mjs → SegmentedControl-BugnH-h2.mjs} +4 -4
- package/dist/{SegmentedControl-CgDQIVll.mjs.map → SegmentedControl-BugnH-h2.mjs.map} +1 -1
- package/dist/{SegmentedControl-DrjdUOU9.d.mts → SegmentedControl-DckAdhcD.d.mts} +2 -2
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-Bk27TgN8.d.mts → Select-BmJ1OjXA.d.mts} +4 -4
- package/dist/{Select-C1ZoRk39.mjs → Select-DL-AjL0Q.mjs} +9 -9
- package/dist/{Select-C1ZoRk39.mjs.map → Select-DL-AjL0Q.mjs.map} +1 -1
- package/dist/Select.d.mts +1 -1
- package/dist/Slider.d.mts +1 -1
- package/dist/SliderRHF.d.mts +1 -1
- package/dist/SliderThumb.d.mts +1 -1
- package/dist/{Spacer-CJp0lwkL.mjs → Spacer-Ln3KChb5.mjs} +1 -1
- package/dist/{Spacer-CJp0lwkL.mjs.map → Spacer-Ln3KChb5.mjs.map} +1 -1
- package/dist/{Spinner-BEPF42RW.mjs → Spinner-BgBCCHGo.mjs} +1 -1
- package/dist/{Spinner-BEPF42RW.mjs.map → Spinner-BgBCCHGo.mjs.map} +1 -1
- package/dist/{Stack-CkV7k7TE.d.mts → Stack-CbcJykx9.d.mts} +2 -2
- package/dist/{Stack-Bl54WmhY.mjs → Stack-ckRN7LrP.mjs} +1 -1
- package/dist/{Stack-Bl54WmhY.mjs.map → Stack-ckRN7LrP.mjs.map} +1 -1
- package/dist/Stack.d.mts +1 -1
- package/dist/StatusIndicator.d.mts +1 -1
- package/dist/{Sticker-CyGb9dEu.mjs → Sticker-B0TbkV4o.mjs} +3 -3
- package/dist/{Sticker-CyGb9dEu.mjs.map → Sticker-B0TbkV4o.mjs.map} +1 -1
- package/dist/{Sticker-Bs25ISz7.d.mts → Sticker-BIVuastf.d.mts} +5 -5
- package/dist/Sticker.d.mts +1 -1
- package/dist/StringValueControl.d.mts +1 -1
- package/dist/SwatchPicker.d.mts +1 -1
- package/dist/Tab.d.mts +2 -2
- package/dist/{TabBar-Bn8PHHBZ.mjs → TabBar-DLf4Hwa4.mjs} +4 -4
- package/dist/{TabBar-Bn8PHHBZ.mjs.map → TabBar-DLf4Hwa4.mjs.map} +1 -1
- package/dist/TabBarIconButton.d.mts +1 -1
- package/dist/{Table-BNScLj9g.d.mts → Table-8jXlKYLy.d.mts} +1 -1
- package/dist/{Table-BfontAeY.mjs → Table-C-mx8Uj0.mjs} +5 -5
- package/dist/{Table-BfontAeY.mjs.map → Table-C-mx8Uj0.mjs.map} +1 -1
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-CrDNMyT8.d.mts → TableBody-ByEcFueE.d.mts} +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/{TableBox-bmrKh_ax.mjs → TableBox-DGjKVQFO.mjs} +65 -55
- package/dist/TableBox-DGjKVQFO.mjs.map +1 -0
- package/dist/TableBox.d.mts +2 -2
- package/dist/{TableBoxCell-CvjLYhTV.d.mts → TableBoxCell-BmoPs1u1.d.mts} +7 -7
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/TableBoxField.d.mts +4 -4
- package/dist/{TableBoxRow-BzXECgid.d.mts → TableBoxRow-BAYvEDjT.d.mts} +4 -4
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-BAiFXiCh.d.mts → TableBoxRowActions-DRs4MdK0.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/TableCell.d.mts +1 -1
- package/dist/{TableControls-DVTtNAPo.mjs → TableControls-BK8DCsqi.mjs} +139 -67
- package/dist/TableControls-BK8DCsqi.mjs.map +1 -0
- package/dist/{TableControls-BehR7CKS.d.mts → TableControls-DscP6fyt.d.mts} +4 -4
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-D_SBFZN1.d.mts → TableControlsContext-BeJ7GHPN.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableHead-LxvG0e9k.d.mts → TableHead-g3afLl5B.d.mts} +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-Br8ZE3Xe.d.mts → TableHeaderCell-CWTMf2Fe.d.mts} +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-BZeP8qfg.d.mts → TableLayout-hPlVO3dD.d.mts} +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-BvS4yjo6.d.mts → TableRow-lvjbVccA.d.mts} +2 -2
- package/dist/TableRow.d.mts +1 -1
- package/dist/TableTH.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-BYPh4dIP.d.mts → TableViewConfigurationDropdown-Ccxtk5dA.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/TechnicalSticker-BrvR0zhC.mjs +266 -0
- package/dist/TechnicalSticker-BrvR0zhC.mjs.map +1 -0
- package/dist/TechnicalSticker.d.mts +7 -1
- package/dist/{Text-DNPbAuUG.d.mts → Text-CfIFUyHt.d.mts} +3 -3
- package/dist/{Text-RcEfNFLx.mjs → Text-hEoPeOc9.mjs} +1 -1
- package/dist/{Text-RcEfNFLx.mjs.map → Text-hEoPeOc9.mjs.map} +1 -1
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-NCLsW-03.mjs → TextArea-BFsXUkuj.mjs} +3 -3
- package/dist/{TextArea-NCLsW-03.mjs.map → TextArea-BFsXUkuj.mjs.map} +1 -1
- package/dist/{TextArea-B89wtTsF.d.mts → TextArea-DiKEhpfD.d.mts} +2 -2
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-5-0D8s4z.d.mts → TextUnderlineTooltip-Bs6Jn5yr.d.mts} +3 -3
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.mts +2 -2
- package/dist/Toast.d.mts +1 -1
- package/dist/{Toggle-Bie9zCem.mjs → Toggle-CC2FTAKS.mjs} +5 -5
- package/dist/{Toggle-Bie9zCem.mjs.map → Toggle-CC2FTAKS.mjs.map} +1 -1
- package/dist/{Toggle-DzYLgxGk.d.mts → Toggle-oukvAn6V.d.mts} +1 -1
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-CUC-JuRL.d.mts → Tooltip-0iXDCV2O.d.mts} +3 -3
- package/dist/{Tooltip-BvDbmXak.mjs → Tooltip-CDvOu1UN.mjs} +3 -3
- package/dist/{Tooltip-BvDbmXak.mjs.map → Tooltip-CDvOu1UN.mjs.map} +1 -1
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-BJnowVTx.d.mts → TruncatedText-CdeU19Ev.d.mts} +1 -1
- package/dist/components/Attribute/index.mjs +10 -10
- package/dist/components/Attribute/index.mjs.map +1 -1
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Banner/index.mjs +1 -1
- package/dist/components/Breadcrumbs/index.d.mts +1 -1
- package/dist/components/Breadcrumbs/index.mjs +1 -1
- package/dist/components/Button/index.d.mts +2 -2
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/ButtonGroup/index.mjs +3 -3
- package/dist/components/Card/index.d.mts +2 -2
- package/dist/components/Card/index.mjs +1 -1
- package/dist/components/CardV2/index.d.mts +1 -1
- package/dist/components/CardV2/index.mjs +1 -1
- package/dist/components/Checkbox/index.d.mts +1 -1
- package/dist/components/Checkbox/index.mjs +1 -1
- package/dist/components/Combobox/index.d.mts +2 -2
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/ConfigFormGroup/index.mjs +2 -2
- package/dist/components/DataTable/TableControls/index.d.mts +15 -15
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.mjs +21 -21
- package/dist/components/DataTable/index.mjs.map +1 -1
- package/dist/components/DataTable/types.d.mts +2 -2
- package/dist/components/DatePicker/index.mjs +1 -1
- package/dist/components/DropdownButton/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/DropdownMenu/index.mjs +1 -1
- package/dist/components/FormControl/index.d.mts +2 -2
- package/dist/components/FormControl/index.mjs +2 -2
- package/dist/components/FormField/index.d.mts +1 -1
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/HoverCopyableField/index.mjs +1 -1
- package/dist/components/ImageTile/index.mjs +8 -8
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Link/index.mjs +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/LoadingShimmer/index.mjs +1 -1
- package/dist/components/MaskedInput/index.mjs +2 -2
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Menu/index.mjs +1 -1
- package/dist/components/Modal/index.mjs +16 -8
- package/dist/components/Modal/index.mjs.map +1 -1
- package/dist/components/PageHeader/index.mjs +1 -1
- package/dist/components/Pagination/index.d.mts +3 -3
- package/dist/components/Pagination/index.mjs +1 -1
- package/dist/components/Pii/index.mjs +1 -1
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/ProgressBar/index.mjs +1 -1
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.d.mts +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/SegmentedControl/index.d.mts +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Slider/index.mjs +2 -2
- package/dist/components/Spacer/index.mjs +1 -1
- package/dist/components/Spinner/index.mjs +1 -1
- package/dist/components/Stack/index.d.mts +1 -1
- package/dist/components/Stack/index.mjs +1 -1
- package/dist/components/Sticker/index.d.mts +1 -1
- package/dist/components/Sticker/index.mjs +1 -1
- package/dist/components/TabBar/index.mjs +1 -1
- package/dist/components/Table/index.d.mts +7 -7
- package/dist/components/Table/index.mjs +1 -1
- package/dist/components/TableBox/index.d.mts +2 -2
- package/dist/components/TableBox/index.mjs +1 -1
- package/dist/components/TechnicalSticker/index.mjs +1 -231
- package/dist/components/Text/index.d.mts +1 -1
- package/dist/components/Text/index.mjs +1 -1
- package/dist/components/TextArea/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Tile/index.mjs +4 -4
- package/dist/components/Toast/index.mjs +1 -1
- package/dist/components/Toggle/index.d.mts +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/components/Tooltip/index.mjs +1 -1
- package/dist/compound-expression.d.mts +1 -1
- package/dist/{constants-BASogfT_.d.mts → constants-bA9kCzRQ.d.mts} +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/containers.d.mts +1 -1
- package/dist/display.d.mts +1 -1
- package/dist/fieldPickerOptions.d.mts +2 -2
- package/dist/{filter-size-context-Blw6Sd69.d.mts → filter-size-context-C1TvrE_O.d.mts} +2 -2
- package/dist/filter-size-context.d.mts +1 -1
- package/dist/helpers.d.mts +1 -1
- package/dist/{index-4_B2yRzD.d.mts → index-BC4edEsD.d.mts} +2 -2
- package/dist/{index-BxXTpeUb2.d.mts → index-CdaoOvFH.d.mts} +5 -5
- package/dist/{index-DDbjWdk0.d.mts → index-DJn4AeE4.d.mts} +4 -4
- package/dist/index.d.mts +1 -1
- package/dist/index2.d.mts +1 -1
- package/dist/index3.d.mts +3 -3
- package/dist/index4.d.mts +10 -10
- package/dist/{input-Bv5fKt5J.d.mts → input-D3Qd6dI8.d.mts} +3 -3
- package/dist/inputFields.d.mts +11 -11
- package/dist/{intersperse-vOYvFOfF.mjs → intersperse-yd3oMrQl.mjs} +1 -1
- package/dist/{intersperse-vOYvFOfF.mjs.map → intersperse-yd3oMrQl.mjs.map} +1 -1
- package/dist/lib/MiddleTruncatedText.mjs +1 -1
- package/dist/lib/PDSProvider.d.mts +1 -1
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedText.mjs +1 -1
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.mjs +2 -2
- package/dist/lib/embeddedSurfaceProtocol.d.mts +29 -0
- package/dist/lib/embeddedSurfaceProtocol.mjs +74 -0
- package/dist/lib/embeddedSurfaceProtocol.mjs.map +1 -0
- package/dist/lib/embeddedSurfaceRegistry.d.mts +11 -0
- package/dist/lib/embeddedSurfaceRegistry.mjs +19 -0
- package/dist/lib/embeddedSurfaceRegistry.mjs.map +1 -0
- package/dist/lib/message.d.mts +1 -1
- package/dist/lib/pseudoClass.d.mts +1 -1
- package/dist/lib/useEmbeddedSurface.d.mts +6 -0
- package/dist/lib/useEmbeddedSurface.mjs +135 -0
- package/dist/lib/useEmbeddedSurface.mjs.map +1 -0
- package/dist/lib/zindex.d.mts +2 -0
- package/dist/lib/zindex.mjs +2 -0
- package/dist/lib/zindex.mjs.map +1 -1
- package/dist/{message-CMHvlPGn.d.mts → message-CsK3sIq0.d.mts} +1 -1
- package/dist/mixins/focus.d.mts +1 -1
- package/dist/mixins/hoverable.d.mts +2 -2
- package/dist/mixins/input.d.mts +1 -1
- package/dist/mixins/menuItem.d.mts +2 -2
- package/dist/mixins/text.d.mts +1 -1
- package/dist/{operators-Bo31xlc2.d.mts → operators-C_xPzItk.d.mts} +2 -2
- package/dist/operators.d.mts +1 -1
- package/dist/{layouts → patterns}/LayoutLoadingShimmer/index.mjs +7 -7
- package/dist/patterns/LayoutLoadingShimmer/index.mjs.map +1 -0
- package/dist/patterns/PageLayout/index.d.mts +2 -0
- package/dist/patterns/PageLayout/index.mjs +35 -0
- package/dist/patterns/PageLayout/index.mjs.map +1 -0
- package/dist/{text-B21s9mRZ.d.mts → text-BaQdW8qa.d.mts} +1 -1
- package/dist/{theme-BzBpJXhO.d.mts → theme-D9Y6NOzb.d.mts} +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/{types-D7ppqnNj.d.mts → types-BKEwt0uq.d.mts} +2 -2
- package/dist/{types-DEh_pXgS.d.mts → types-CjHuZoVJ.d.mts} +1 -1
- package/dist/{types-TV9nVfSe.d.mts → types-DVsBRqjZ.d.mts} +1 -1
- package/dist/{types-D58IoRx6.d.mts → types-mb3woqzE.d.mts} +6 -7
- package/dist/types.d.mts +1 -1
- package/dist/types2.d.mts +1 -1
- package/dist/types3.d.mts +1 -1
- package/dist/types4.d.mts +1 -1
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useFilterStateV2-DCQghouq.d.mts → useFilterStateV2-CGzRyv0i.d.mts} +3 -3
- package/dist/useFilterStateV2.d.mts +1 -1
- package/dist/{useFormField-D8mLsiQc.d.mts → useFormField-DhwEi45-.d.mts} +2 -2
- package/dist/{useFormField-DhYd6bNn.mjs → useFormField-eftOPiXj.mjs} +2 -2
- package/dist/{useFormField-DhYd6bNn.mjs.map → useFormField-eftOPiXj.mjs.map} +1 -1
- package/dist/useFormField.d.mts +1 -1
- package/dist/{useFormGroup-DWVW7A9f.mjs → useFormGroup-BMukAMAd.mjs} +1 -1
- package/dist/{useFormGroup-DWVW7A9f.mjs.map → useFormGroup-BMukAMAd.mjs.map} +1 -1
- package/dist/{useTableBoxDragAndDrop-BMo-iaUF.d.mts → useTableBoxDragAndDrop-CsnN52lx.d.mts} +1 -1
- package/dist/useTableBoxDragAndDrop.d.mts +1 -1
- package/dist/{useToggle-Bo3yd14Y.mjs → useToggle-3k3EkV8V.mjs} +1 -1
- package/dist/{useToggle-Bo3yd14Y.mjs.map → useToggle-3k3EkV8V.mjs.map} +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/{utilities-BO_95qFA.d.mts → utilities-DnSIlR1i.d.mts} +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utils/storybook.mjs +1 -1
- package/dist/utils/testing.d.mts +1 -1
- package/dist/utils/testing.mjs +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/{validation-vLh3t2dk.d.mts → validation-BdP2vajF.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/{value-control-resolver-CE-bqdAl.d.mts → value-control-resolver-CiGEHQAc.d.mts} +2 -2
- package/dist/value-control-resolver.d.mts +1 -1
- package/llms.txt +43 -0
- package/package.json +14 -5
- package/skills/ui-authoring/SKILL.md +27 -1
- package/dist/Breadcrumbs-W8hIhdHD.mjs.map +0 -1
- package/dist/Combobox-B6JyLog8.mjs.map +0 -1
- package/dist/DatePicker-Bw79p-Lx.mjs.map +0 -1
- package/dist/FormField-DdmgSWq4.mjs.map +0 -1
- package/dist/TableBox-bmrKh_ax.mjs.map +0 -1
- package/dist/TableControls-DVTtNAPo.mjs.map +0 -1
- package/dist/components/TechnicalSticker/index.mjs.map +0 -1
- package/dist/layouts/LayoutLoadingShimmer/index.mjs.map +0 -1
- /package/dist/{index--p6oQT9I.d.mts → index-0-W_aPej.d.mts} +0 -0
- /package/dist/{index-BYd3Btr1.d.mts → index-7in8TPrM.d.mts} +0 -0
- /package/dist/{index-CDGG7lCB.d.mts → index-7rWKHdox.d.mts} +0 -0
- /package/dist/{index-CMuRFTR3.d.mts → index-B4woaFSm.d.mts} +0 -0
- /package/dist/{index-CNxS4Tlu.d.mts → index-BINnViIh.d.mts} +0 -0
- /package/dist/{index-CWB6exYm.d.mts → index-BNRXMhlr.d.mts} +0 -0
- /package/dist/{index-CzItj62a.d.mts → index-BO_854F2.d.mts} +0 -0
- /package/dist/{index-D4DUvwPf.d.mts → index-BOn0AAue.d.mts} +0 -0
- /package/dist/{index-D5tSVhTd.d.mts → index-CCt0lwyI.d.mts} +0 -0
- /package/dist/{index-DGsJdI5l.d.mts → index-CREkvfw9.d.mts} +0 -0
- /package/dist/{index-DM6vVDZD.d.mts → index-CRo77wc3.d.mts} +0 -0
- /package/dist/{index-DWfPppPU.d.mts → index-Ci-uuV07.d.mts} +0 -0
- /package/dist/{index-DXJd7-2Z.d.mts → index-CsuikFeJ.d.mts} +0 -0
- /package/dist/{index-DkrC-i1D.d.mts → index-CzUpNo0e.d.mts} +0 -0
- /package/dist/{index-DvuJXuAN.d.mts → index-DDdPqD_H.d.mts} +0 -0
- /package/dist/{index-Iujpc9_6.d.mts → index-DeVKzGce.d.mts} +0 -0
- /package/dist/{index-PWQavSPf.d.mts → index-Es5nKSSL.d.mts} +0 -0
- /package/dist/{index-e6k85DKM.d.mts → index-FtE8MXJ_.d.mts} +0 -0
- /package/dist/{index-lIMqGGJz.d.mts → index-ehD5GjMH.d.mts} +0 -0
- /package/dist/{index-sViox9YW.d.mts → index-uMNhmxEh.d.mts} +0 -0
- /package/dist/{layouts → patterns}/LayoutLoadingShimmer/index.d.mts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardV2-C0fcOUdp.mjs","names":["CardLoadingShimmer","Heading","Button","DropdownMenu"],"sources":["../components/CardV2/SectionHeading.tsx","../components/CardV2/Section.tsx","../components/CardV2/Card.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, FC, ReactElement, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport { ChevronDownIcon, MoreIcon } from '@persona/icons';\nimport Button, { IconButton } from 'design-system/components/Button';\nimport DropdownButton from 'design-system/components/DropdownButton';\nimport DropdownMenu from 'design-system/components/DropdownMenu';\nimport { LoadingShimmer } from 'design-system/components/LoadingShimmer';\nimport { HStack } from 'design-system/components/Stack';\nimport { Heading } from 'design-system/components/Text';\nimport Tooltip from 'design-system/components/Tooltip';\nimport { HeadlessAriaButton } from 'design-system/lib/HeadlessAriaButton';\nimport { TruncatedText } from 'design-system/lib/TruncatedText';\nimport { focusStyle } from 'design-system/mixins/focus';\nimport type { HeadingSize } from 'design-system/mixins/text';\nimport type { IconAction, MenuAction, TextAction } from 'design-system/types/Action';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst CardLoadingShimmer = styled(LoadingShimmer)`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n`;\n\nconst StickerContainer = styled.div`\n display: flex;\n max-width: 180px;\n`;\n\ntype AccordionContainerProps = {\n $isTopSection: boolean;\n $expanded: boolean;\n};\nconst AccordionContainer = styled.div<AccordionContainerProps>`\n transition: opacity ${TransitionDuration.Faster};\n position: absolute;\n opacity: 0;\n\n height: 12px;\n width: 12px;\n display: flex;\n align-items: center;\n /* Because of padding in the top section heading we need to offset differently. */\n /* We want a 12px icon to be off-center in 24px padding, 4px on the right and 8px on the left */\n left: ${({ $isTopSection }) => ($isTopSection ? '8px' : '-16px')};\n /* center the icon vertically */\n top: calc(50% - 6px);\n\n border-radius: 1px;\n\n & svg {\n transition: transform ${TransitionDuration.Faster} ease-out;\n transform: rotate(${({ $expanded }) => ($expanded ? '0' : '-90deg')});\n }\n`;\n\nconst HeaderButton = styled(HeadlessAriaButton)`\n min-width: 0;\n flex: 1;\n\n &:hover ~ ${AccordionContainer} {\n opacity: 1;\n }\n\n &:focus-visible ~ ${AccordionContainer} {\n opacity: 1;\n ${focusStyle}\n }\n`;\n\ntype HeadingContainerProps = {\n $isTopSection: boolean;\n $divider: boolean;\n $hasFooter: boolean;\n $isExpanded: boolean;\n};\nconst HeadingContainer = styled(HStack)<HeadingContainerProps>`\n position: relative;\n\n ${({ $isTopSection }) =>\n $isTopSection &&\n css`\n padding: ${Spacing[4]} ${Spacing[5]};\n `}\n ${({ $divider }) =>\n $divider &&\n css`\n border-bottom: 1px solid ${Color.BorderDivider};\n `}\n ${({ $isTopSection, $hasFooter, $isExpanded }) =>\n $isTopSection &&\n !$hasFooter &&\n !$isExpanded &&\n css`\n // We apply 4px of whitespace to the bottom of the card container so that content has a buffer\n // when being scrolled and still appears inside the card. Here we adjust, subtracting\n // 4px from the 16px padding.\n padding-bottom: ${Spacing[3]};\n `}\n`;\n\ntype StyledHeadingProps = {\n $isCollapsible: boolean;\n $isTopSection: boolean;\n size: HeadingSize;\n};\nconst StyledHeading = styled(Heading)<StyledHeadingProps>`\n flex: 1;\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n line-height: 24px; // We want an adjusted line-height to hit the target header size.\n overflow: hidden;\n\n ${({ $isCollapsible }) => $isCollapsible && 'cursor: pointer;'}\n ${({ $isTopSection }) =>\n !$isTopSection &&\n css`\n ${Typography.TextLargeBold};\n `}\n`;\n\nconst isIconAction = (action: IconAction | TextAction): action is IconAction => 'icon' in action;\n\nconst ButtonRow: FC<{\n actions: (IconAction | TextAction)[];\n menuActions: MenuAction[];\n}> = ({ actions, menuActions }) => {\n const buttons = actions\n .filter((action) => !action.hidden)\n .map((action, i) => {\n const key = isIconAction(action)\n ? (action.id ?? action.ariaLabel ?? `action-${i}`)\n : (action.id ?? action.label ?? `action-${i}`);\n\n const button = isIconAction(action) ? (\n <IconButton\n id={action.id}\n key={key}\n to={action.to}\n onClick={(e) => {\n e.stopPropagation();\n return action.onClick?.(e);\n }}\n disabled={action.disabled}\n aria-label={action.ariaLabel}\n size='sm'\n >\n {action.icon}\n </IconButton>\n ) : (\n <Button\n id={action.id}\n key={key}\n aria-label={action.ariaLabel}\n to={action.to}\n onClick={(e) => {\n e.stopPropagation();\n return action.onClick?.(e);\n }}\n disabled={action.disabled}\n variant={action.variant ?? 'basic'}\n size='sm'\n width='auto'\n prefixIcon={action.prefixIcon}\n suffixIcon={action.suffixIcon}\n >\n {action.label}\n </Button>\n );\n\n return action.tooltip ? (\n <Tooltip key={key} {...action.tooltipProps} trigger={button}>\n {action.tooltip}\n </Tooltip>\n ) : (\n button\n );\n });\n\n return (\n <HStack>\n {buttons}\n {menuActions.length > 0 && (\n <DropdownButton\n variant='text'\n width='icon'\n size='sm'\n suffixIcon={undefined}\n style={{ justifySelf: 'flex-end' }}\n aria-label='More actions'\n menuProps={{\n portal: true,\n }}\n menuItems={menuActions\n .filter((action) => !action.hidden)\n .map((action) => (\n <DropdownMenu.Item\n id={action.id ?? action.label}\n key={action.id ?? action.label}\n onClick={action.onClick}\n disabled={action.disabled}\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n >\n <MoreIcon />\n </DropdownButton>\n )}\n </HStack>\n );\n};\n\n/**\n * Private component for rendering the heading of a section, both the primary card heading and\n * section headings.\n */\nexport const SectionHeading: FC<{\n /**\n * Whether this is the top-level section of the card which has different visual treatment.\n */\n isTopSection: boolean;\n\n /**\n * Whether this heading's section has content.\n */\n sectionHasContent: boolean;\n\n /**\n * Whether this heading's section has a footer.\n */\n hasFooter: boolean;\n\n loading: boolean;\n\n /**\n * Title text to render in the heading.\n */\n title: string;\n\n /**\n * Optional sticker to render after the title.\n */\n sticker?: ReactElement;\n\n /**\n * Optional icon to render before the title text.\n *\n * Usage of this icon slot should be avoided if possible to maintain left-text alignement. If\n * using this icon slot for a section heading use it for all sections.\n */\n leftDecorativeIcon?: ReactElement;\n\n /**\n * Optional actions to render in the heading.\n * Only accepts IconButton or Button components with specific prop restrictions.\n */\n actions?: (IconAction | TextAction | undefined)[];\n\n /**\n * Optional actions to render in the heading in a menu.\n */\n menuActions?: (MenuAction | undefined)[];\n\n /**\n * Optional custom content to render in the heading in the button row. Prefer setting `actions` or\n * `menuActions` if possible.\n */\n headerActionsRowContent?: ReactNode;\n\n /**\n * Callback to toggle collapsed state of the section. Omit to disable collapsing.\n */\n toggle?: () => void;\n\n /**\n * Whether the section is currently expanded or collapsed.\n */\n isExpanded: boolean;\n\n /**\n * Optional props to pass to the heading element. Accepts an `as` key to override the\n * rendered heading level. Defaults to `h2` for the top-level card heading and `h3` for\n * section headings so that the document heading hierarchy reflects the visual hierarchy.\n */\n headingProps?: Omit<ComponentPropsWithoutRef<'span'>, 'color'> & {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n };\n}> = ({\n isTopSection,\n sectionHasContent,\n hasFooter,\n loading,\n title,\n actions = [],\n menuActions = [],\n headerActionsRowContent,\n sticker,\n leftDecorativeIcon,\n toggle,\n isExpanded,\n headingProps,\n}) => {\n const renderButtonRow = actions.length > 0 || menuActions.length > 0;\n const { as: headingAs, ...restHeadingProps } = headingProps ?? {};\n\n return (\n <HeadingContainer\n $isTopSection={isTopSection}\n $hasFooter={hasFooter}\n $isExpanded={isExpanded}\n $divider={isTopSection && isExpanded && sectionHasContent}\n align='center'\n justify='space-between'\n spacing={Spacing[2]}\n >\n {loading ? (\n <CardLoadingShimmer height='24px' width='200px' />\n ) : (\n <>\n {/* https://github.com/adobe/react-spectrum/issues/7444 */}\n <HeaderButton slot='trigger' isDisabled={!toggle}>\n <StyledHeading\n forwardedAs={headingAs ?? (isTopSection ? 'h2' : 'h3')}\n size='xsm'\n $isCollapsible={!!toggle}\n $isTopSection={isTopSection}\n aria-label={title}\n {...restHeadingProps}\n >\n {leftDecorativeIcon}\n <TruncatedText>{title}</TruncatedText>\n {sticker && <StickerContainer>{sticker}</StickerContainer>}\n </StyledHeading>\n </HeaderButton>\n {headerActionsRowContent}\n {renderButtonRow && (\n <ButtonRow\n actions={actions.filter((action) => action != null)}\n menuActions={menuActions.filter((action) => action != null)}\n />\n )}\n {toggle && (\n <AccordionContainer $isTopSection={isTopSection} $expanded={isExpanded}>\n <ChevronDownIcon />\n </AccordionContainer>\n )}\n </>\n )}\n </HeadingContainer>\n );\n};\n","import type { ComponentProps, FC, ReactNode } from 'react';\nimport { Disclosure, DisclosurePanel } from 'react-aria-components';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { SectionHeading } from 'design-system/components/CardV2/SectionHeading';\nimport { LoadingShimmer } from 'design-system/components/LoadingShimmer';\nimport { HStack } from 'design-system/components/Stack';\nimport { Paragraph } from 'design-system/components/Text';\nimport { intersperse } from 'design-system/lib/intersperse';\nimport { Z_INDICES } from 'design-system/lib/zindex';\n\nconst FooterParagraph = styled(Paragraph)`\n line-height: 16px;\n`;\n\ntype FooterContainerProps = {\n $divider: boolean;\n};\nconst FooterContainer = styled.div<FooterContainerProps>`\n ${({ $divider }) =>\n $divider &&\n css`\n border-top: 1px solid ${Color.BorderDivider};\n `}\n padding: ${Spacing[3]} ${Spacing[5]} ${Spacing[2]};\n`;\n\ntype MaybeStickyContainerProps = {\n $enabled: boolean;\n $bottom?: boolean;\n};\nconst MaybeStickyContainer = styled.div<MaybeStickyContainerProps>`\n ${({ $enabled }) =>\n $enabled &&\n css`\n // We are using sticky positioning here to have consistent scrollbar behavior between\n // different card configurations. Usage of sticky allows us to keep the scroll container at\n // the top of the card DOM structure regardless of whether the heading or footer is sticky.\n //\n // This also afaict helps eliminate the need to carry height values through the card DOM\n // structure to the content container (and possibly needing to adjust heights for heading and footer).\n position: sticky;\n top: 0;\n background-color: ${({ theme }) => theme.color.background.primary};\n z-index: ${Z_INDICES.sticky};\n `}\n\n ${({ $bottom = false }) =>\n $bottom &&\n css`\n top: unset;\n bottom: 0;\n `}\n`;\n\ntype StyledDisclosureProps = {\n $fullHeight: boolean;\n};\nconst StyledDisclosure = styled(Disclosure)<StyledDisclosureProps>`\n display: flex;\n flex-direction: column;\n gap: 0;\n ${({ $fullHeight }) =>\n $fullHeight &&\n css`\n height: 100%;\n `}\n`;\n\ntype StyledDisclosurePanelProps = {\n $isTopSection: boolean;\n};\nconst StyledDisclosurePanel = styled(DisclosurePanel)<StyledDisclosurePanelProps>`\n flex: 1;\n ${({ $isTopSection }) =>\n $isTopSection &&\n css`\n // Safari does not support hidden='until-found' so react-aria uses display: none instead.\n // Since react-aria is using display to hide content we need to not set display ourselves.\n &:not([aria-hidden='true']) {\n display: flex;\n }\n `}\n`;\n\nconst CardLoadingShimmer = styled(LoadingShimmer)`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n`;\n\ntype SectionContentContainerProps = {\n $isTopSection: boolean;\n $hasHeading: boolean;\n $hasFooter: boolean;\n};\nconst SectionContentContainer = styled.div<SectionContentContainerProps>`\n ${({ $isTopSection }) =>\n $isTopSection &&\n css`\n padding: ${Spacing[5]};\n display: flex;\n flex-direction: column;\n gap: ${Spacing[5]};\n flex: 1;\n /* Prevent grid blowout https://css-tricks.com/preventing-a-grid-blowout/ */\n min-width: 0;\n `}\n\n ${({ $isTopSection, $hasHeading }) =>\n !$isTopSection &&\n $hasHeading &&\n css`\n padding-top: ${Spacing[3]};\n `}\n\n ${({ $isTopSection, $hasFooter }) =>\n $isTopSection &&\n !$hasFooter &&\n css`\n // We apply 4px of whitespace to the bottom of the card container so that content has a buffer\n // when being scrolled and still appears inside the card. Here we adjust, subtracting\n // 4px from the 24px padding.\n padding-bottom: 20px;\n `}\n`;\n\n/**\n * Private component for rendering sections of the card, both the primary card section and\n * individual sections.\n */\nexport const Section: FC<{\n children?: ReactNode;\n\n /**\n * Whether this is the top-level section of the card which has different visual treatment.\n */\n isTopSection: boolean;\n\n /**\n * Available props for the section's heading.\n */\n heading?: Pick<\n ComponentProps<typeof SectionHeading>,\n | 'title'\n | 'actions'\n | 'menuActions'\n | 'headerActionsRowContent'\n | 'sticker'\n | 'leftDecorativeIcon'\n | 'headingProps'\n >;\n\n /**\n * Optional footer to render at the bottom of the card. Footer content is rendered as a\n * paragraph with the items separated by a dot.\n */\n footer?: ReactNode[];\n\n /**\n * Optional arbitrary footer content to render as-is.\n */\n footerContent?: ReactNode;\n\n /**\n * Whether the section is collapsible.\n */\n collapsible?: boolean;\n\n /**\n * Whether the section heading and footer are sticky.\n */\n sticky?: boolean;\n\n /**\n * Whether the section is initially collapsed.\n */\n defaultCollapsed?: boolean;\n\n /**\n * If true, the section will be rendered in a loading state.\n */\n loading?: boolean;\n\n /**\n * Set height of the loading state.\n */\n loadingProps?: {\n height?: string;\n };\n\n /**\n * Control display of the empty state.\n */\n empty?: boolean;\n\n /**\n * Props for the empty state.\n */\n emptyProps?: {\n /**\n * Empty state message.\n */\n message?: string;\n };\n\n fullHeight?: boolean;\n}> = ({\n children,\n isTopSection,\n heading,\n footer,\n footerContent,\n loading = false,\n loadingProps,\n empty = false,\n emptyProps,\n defaultCollapsed = false,\n collapsible = false,\n sticky = false,\n fullHeight = false,\n}) => {\n let content: ReactNode;\n if (loading) {\n content = <CardLoadingShimmer height={loadingProps?.height ?? '200px'} width='100%' />;\n } else if (empty) {\n content = <Paragraph>{emptyProps?.message ?? 'No data collected'}</Paragraph>;\n } else {\n content = children;\n }\n\n const hasFooter = !!(footer || footerContent);\n const hasContent = !!content;\n\n // Normally we would have `isDisabled` as well but there's a react-aria-components quirk\n // that sets `hidden` on the disclosure panel if both `defaultExpanded` and `isDisabled` are true.\n // https://github.com/adobe/react-spectrum/issues/7444\n return (\n <StyledDisclosure defaultExpanded={!defaultCollapsed} $fullHeight={fullHeight}>\n {({ isExpanded, state }) => (\n <>\n {heading && (\n <MaybeStickyContainer $enabled={sticky}>\n <SectionHeading\n isTopSection={isTopSection}\n hasFooter={hasFooter}\n sectionHasContent={hasContent}\n loading={loading}\n toggle={collapsible ? state.toggle : undefined}\n isExpanded={isExpanded}\n {...heading}\n />\n </MaybeStickyContainer>\n )}\n {hasContent && (\n <StyledDisclosurePanel $isTopSection={isTopSection}>\n <SectionContentContainer\n $isTopSection={isTopSection}\n $hasHeading={!!heading}\n $hasFooter={hasFooter}\n >\n {content}\n </SectionContentContainer>\n </StyledDisclosurePanel>\n )}\n {hasFooter && (\n <MaybeStickyContainer $enabled={sticky} $bottom>\n <FooterContainer $divider={hasContent}>\n {loading ? (\n <HStack>\n <CardLoadingShimmer height='16px' width='120px' />\n <CardLoadingShimmer height='16px' width='120px' />\n </HStack>\n ) : (\n <>\n {footer && (\n <FooterParagraph size='sm'>\n <HStack spacing={Spacing[1]}>\n {intersperse(\n footer\n .filter((item) => item != null)\n .map((item, i) => <span key={`footer-item-${i}`}>{item}</span>),\n (i) => (\n <span key={i}>•</span>\n ),\n )}\n </HStack>\n </FooterParagraph>\n )}\n {footerContent}\n </>\n )}\n </FooterContainer>\n </MaybeStickyContainer>\n )}\n </>\n )}\n </StyledDisclosure>\n );\n};\n","import { type ComponentProps, createContext, type FC, type ReactNode, useContext } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport styled from 'styled-components';\n\nimport { Color } from '@persona/design-tokens';\nimport { Section } from 'design-system/components/CardV2/Section';\nimport { Paragraph } from 'design-system/components/Text';\nimport ConfigContext from 'design-system/lib/ConfigContext';\nimport { intersperse } from 'design-system/lib/intersperse';\n\nconst CardContainer = styled.div`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n background-color: ${({ theme }) => theme.color.background.primary};\n // Height has been tricky here.\n // inherit seems to work well for both grid and flexbox layouts. In a grid we want this\n // container to receive the full cell height, In a flexbox we want this container to flex, maintaining\n // the minimum height for it's content.\n height: inherit;\n overflow-y: auto;\n\n box-sizing: border-box;\n // Small buffer so that content is not scrolling right on the edge of the card.\n border-bottom: 4px solid ${({ theme }) => theme.color.background.primary};\n`;\n\nconst CardContext = createContext<{ isStacked?: boolean }>({});\n\nconst Divider = styled.hr`\n margin: 0;\n border: none;\n border-top: 1px solid ${Color.BorderDivider};\n`;\n\n/**\n * Renders a card section.\n */\nconst PublicSection: FC<\n Pick<\n ComponentProps<typeof Section>,\n | 'children'\n | 'collapsible'\n | 'defaultCollapsed'\n | 'heading'\n | 'loading'\n | 'loadingProps'\n | 'empty'\n | 'emptyProps'\n >\n> = (props) => {\n return <Section isTopSection={false} {...props} />;\n};\n\n/**\n * Render the card in a \"stacked\" mode. Used for rendering multiple cards on top of each other\n * that appear visually as a single card.\n */\nconst Stacked: FC<{\n children: ReactNode[];\n}> = ({ children }) => {\n return (\n <CardContext.Provider value={{ isStacked: true }}>\n <CardContainer>\n {intersperse(children, (i) => (\n <Divider key={i} />\n ))}\n </CardContainer>\n </CardContext.Provider>\n );\n};\n\nconst DEFAULT_ERROR_MESSAGE = '🔍 Oops, something went wrong loading this card.';\n\n/**\n * Renders a PDS Card.\n *\n * To render sections of the card use `<Card.Section>...</Card.Section>`\n */\nconst Card: FC<\n {\n /**\n * Optional footer to render at the bottom of the card. Footer content is rendered as a\n * paragraph with the items separated by a dot.\n */\n footer?: ReactNode[];\n\n /**\n * Optional arbitrary footer content to render as-is.\n */\n footerContent?: ReactNode;\n\n /**\n * Whether the card heading and footer are sticky.\n */\n sticky?: boolean;\n\n /**\n * Force the card to render in an errored state. Errors bubbling up from children will also\n * render the errored state.\n */\n errored?: boolean;\n\n /**\n * Props for the errored state.\n */\n erroredProps?: {\n /**\n * Message to render in the errored state.\n */\n message?: string;\n /**\n * Callback to handle errors. Note this callback is only called when the error is bubbled up\n * from children, not when `errored` is set to true.\n */\n onError?: (error: Error) => void;\n };\n\n containerProps?: ComponentProps<typeof CardContainer>;\n\n /**\n * Whether the card should render its content with 100% height. This is a bit of a hack for cards\n * that want full control of their content and don't use sections.\n */\n fullHeight?: boolean;\n } & ComponentProps<typeof PublicSection>\n> = ({ children, errored, erroredProps, containerProps, sticky = true, ...sectionProps }) => {\n const { isStacked = false } = useContext(CardContext);\n const { captureException } = useContext(ConfigContext);\n\n const errorFallback = (\n <Section isTopSection {...sectionProps}>\n <Paragraph>{erroredProps?.message ?? DEFAULT_ERROR_MESSAGE}</Paragraph>\n </Section>\n );\n\n const section = (\n <Section isTopSection sticky={sticky} {...sectionProps}>\n {children}\n </Section>\n );\n\n return (\n <ErrorBoundary\n fallback={\n isStacked ? (\n errorFallback\n ) : (\n <CardContainer {...containerProps}>{errorFallback}</CardContainer>\n )\n }\n onError={erroredProps?.onError ?? ((error) => captureException(error))}\n >\n {isStacked ? (\n <>{errored ? <>{errorFallback}</> : <>{section}</>}</>\n ) : (\n <CardContainer {...containerProps}>\n {errored ? <>{errorFallback}</> : <>{section}</>}\n </CardContainer>\n )}\n </ErrorBoundary>\n );\n};\n\nexport default Object.assign(Card, {\n Section: PublicSection,\n Stacked: Stacked,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,uBAAqB,OAAO,eAAe;oBAC7B,EAAE,YAAY,MAAM,KAAK,aAAa;;AAG1D,MAAM,mBAAmB,OAAO,GAAG;;;;AASnC,MAAM,qBAAqB,OAAO,GAA4B;gCACZ;;;;;;;;;;WAUvC,EAAE,oBAAqB,gBAAgB,QAAQ,QAAS;;;;;;;oCAOb;yBAC7B,EAAE,gBAAiB,YAAY,MAAM,SA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E,YACE,gBAEA,oBAAC,eAAD;GAAe,GAAI;aAAiB;GAA8B,CAAA;EAGtE,SAAS,cAAc,aAAa,UAAU,iBAAiB,MAAM;YAEpE,YACC,oBAAA,UAAA,EAAA,UAAG,UAAU,oBAAA,UAAA,EAAA,UAAG,eAAiB,CAAA,GAAG,oBAAA,UAAA,EAAA,UAAG,SAAW,CAAA,EAAI,CAAA,GAEtD,oBAAC,eAAD;GAAe,GAAI;aAChB,UAAU,oBAAA,UAAA,EAAA,UAAG,eAAiB,CAAA,GAAG,oBAAA,UAAA,EAAA,UAAG,SAAW,CAAA;GAClC,CAAA;EAEJ,CAAA;;AAIpB,IAAA,eAAe,OAAO,OAAO,MAAM;CACjC,SAAS;CACA;CACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"CardV2-m9yOInMU.mjs","names":["CardLoadingShimmer","Heading","Button","DropdownMenu"],"sources":["../components/CardV2/SectionHeading.tsx","../components/CardV2/Section.tsx","../components/CardV2/Card.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, FC, ReactElement, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport { ChevronDownIcon, MoreIcon } from '@persona/icons';\nimport Button, { IconButton } from 'design-system/components/Button';\nimport DropdownButton from 'design-system/components/DropdownButton';\nimport DropdownMenu from 'design-system/components/DropdownMenu';\nimport { LoadingShimmer } from 'design-system/components/LoadingShimmer';\nimport { HStack } from 'design-system/components/Stack';\nimport { Heading } from 'design-system/components/Text';\nimport Tooltip from 'design-system/components/Tooltip';\nimport { HeadlessAriaButton } from 'design-system/lib/HeadlessAriaButton';\nimport { TruncatedText } from 'design-system/lib/TruncatedText';\nimport { focusStyle } from 'design-system/mixins/focus';\nimport type { HeadingSize } from 'design-system/mixins/text';\nimport type { IconAction, MenuAction, TextAction } from 'design-system/types/Action';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst CardLoadingShimmer = styled(LoadingShimmer)`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n`;\n\nconst StickerContainer = styled.div`\n display: flex;\n max-width: 180px;\n`;\n\ntype AccordionContainerProps = {\n $isTopSection: boolean;\n $expanded: boolean;\n};\nconst AccordionContainer = styled.div<AccordionContainerProps>`\n transition: opacity ${TransitionDuration.Faster};\n position: absolute;\n opacity: 0;\n\n height: 12px;\n width: 12px;\n display: flex;\n align-items: center;\n /* Because of padding in the top section heading we need to offset differently. */\n /* We want a 12px icon to be off-center in 24px padding, 4px on the right and 8px on the left */\n left: ${({ $isTopSection }) => ($isTopSection ? '8px' : '-16px')};\n /* center the icon vertically */\n top: calc(50% - 6px);\n\n border-radius: 1px;\n\n & svg {\n transition: transform ${TransitionDuration.Faster} ease-out;\n transform: rotate(${({ $expanded }) => ($expanded ? '0' : '-90deg')});\n }\n`;\n\nconst HeaderButton = styled(HeadlessAriaButton)`\n min-width: 0;\n flex: 1;\n\n &:hover ~ ${AccordionContainer} {\n opacity: 1;\n }\n\n &:focus-visible ~ ${AccordionContainer} {\n opacity: 1;\n ${focusStyle}\n }\n`;\n\ntype HeadingContainerProps = {\n $isTopSection: boolean;\n $divider: boolean;\n $hasFooter: boolean;\n $isExpanded: boolean;\n};\nconst HeadingContainer = styled(HStack)<HeadingContainerProps>`\n position: relative;\n\n ${({ $isTopSection }) =>\n $isTopSection &&\n css`\n padding: ${Spacing[4]} ${Spacing[5]};\n `}\n ${({ $divider }) =>\n $divider &&\n css`\n border-bottom: 1px solid ${Color.BorderDivider};\n `}\n ${({ $isTopSection, $hasFooter, $isExpanded }) =>\n $isTopSection &&\n !$hasFooter &&\n !$isExpanded &&\n css`\n // We apply 4px of whitespace to the bottom of the card container so that content has a buffer\n // when being scrolled and still appears inside the card. Here we adjust, subtracting\n // 4px from the 16px padding.\n padding-bottom: ${Spacing[3]};\n `}\n`;\n\ntype StyledHeadingProps = {\n $isCollapsible: boolean;\n $isTopSection: boolean;\n size: HeadingSize;\n};\nconst StyledHeading = styled(Heading)<StyledHeadingProps>`\n flex: 1;\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n line-height: 24px; // We want an adjusted line-height to hit the target header size.\n overflow: hidden;\n\n ${({ $isCollapsible }) => $isCollapsible && 'cursor: pointer;'}\n ${({ $isTopSection }) =>\n !$isTopSection &&\n css`\n ${Typography.TextLargeBold};\n `}\n`;\n\nconst isIconAction = (action: IconAction | TextAction): action is IconAction => 'icon' in action;\n\nconst ButtonRow: FC<{\n actions: (IconAction | TextAction)[];\n menuActions: MenuAction[];\n}> = ({ actions, menuActions }) => {\n const buttons = actions\n .filter((action) => !action.hidden)\n .map((action, i) => {\n const key = isIconAction(action)\n ? (action.id ?? action.ariaLabel ?? `action-${i}`)\n : (action.id ?? action.label ?? `action-${i}`);\n\n const button = isIconAction(action) ? (\n <IconButton\n id={action.id}\n key={key}\n to={action.to}\n onClick={(e) => {\n e.stopPropagation();\n return action.onClick?.(e);\n }}\n disabled={action.disabled}\n aria-label={action.ariaLabel}\n size='sm'\n >\n {action.icon}\n </IconButton>\n ) : (\n <Button\n id={action.id}\n key={key}\n aria-label={action.ariaLabel}\n to={action.to}\n onClick={(e) => {\n e.stopPropagation();\n return action.onClick?.(e);\n }}\n disabled={action.disabled}\n variant={action.variant ?? 'basic'}\n size='sm'\n width='auto'\n prefixIcon={action.prefixIcon}\n suffixIcon={action.suffixIcon}\n >\n {action.label}\n </Button>\n );\n\n return action.tooltip ? (\n <Tooltip key={key} {...action.tooltipProps} trigger={button}>\n {action.tooltip}\n </Tooltip>\n ) : (\n button\n );\n });\n\n return (\n <HStack>\n {buttons}\n {menuActions.length > 0 && (\n <DropdownButton\n variant='text'\n width='icon'\n size='sm'\n suffixIcon={undefined}\n style={{ justifySelf: 'flex-end' }}\n aria-label='More actions'\n menuProps={{\n portal: true,\n }}\n menuItems={menuActions\n .filter((action) => !action.hidden)\n .map((action) => (\n <DropdownMenu.Item\n id={action.id ?? action.label}\n key={action.id ?? action.label}\n onClick={action.onClick}\n disabled={action.disabled}\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n >\n <MoreIcon />\n </DropdownButton>\n )}\n </HStack>\n );\n};\n\n/**\n * Private component for rendering the heading of a section, both the primary card heading and\n * section headings.\n */\nexport const SectionHeading: FC<{\n /**\n * Whether this is the top-level section of the card which has different visual treatment.\n */\n isTopSection: boolean;\n\n /**\n * Whether this heading's section has content.\n */\n sectionHasContent: boolean;\n\n /**\n * Whether this heading's section has a footer.\n */\n hasFooter: boolean;\n\n loading: boolean;\n\n /**\n * Title text to render in the heading.\n */\n title: string;\n\n /**\n * Optional sticker to render after the title.\n */\n sticker?: ReactElement;\n\n /**\n * Optional icon to render before the title text.\n *\n * Usage of this icon slot should be avoided if possible to maintain left-text alignement. If\n * using this icon slot for a section heading use it for all sections.\n */\n leftDecorativeIcon?: ReactElement;\n\n /**\n * Optional actions to render in the heading.\n * Only accepts IconButton or Button components with specific prop restrictions.\n */\n actions?: (IconAction | TextAction | undefined)[];\n\n /**\n * Optional actions to render in the heading in a menu.\n */\n menuActions?: (MenuAction | undefined)[];\n\n /**\n * Optional custom content to render in the heading in the button row. Prefer setting `actions` or\n * `menuActions` if possible.\n */\n headerActionsRowContent?: ReactNode;\n\n /**\n * Callback to toggle collapsed state of the section. Omit to disable collapsing.\n */\n toggle?: () => void;\n\n /**\n * Whether the section is currently expanded or collapsed.\n */\n isExpanded: boolean;\n\n /**\n * Optional props to pass to the heading element. Accepts an `as` key to override the\n * rendered heading level. Defaults to `h2` for the top-level card heading and `h3` for\n * section headings so that the document heading hierarchy reflects the visual hierarchy.\n */\n headingProps?: Omit<ComponentPropsWithoutRef<'span'>, 'color'> & {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n };\n}> = ({\n isTopSection,\n sectionHasContent,\n hasFooter,\n loading,\n title,\n actions = [],\n menuActions = [],\n headerActionsRowContent,\n sticker,\n leftDecorativeIcon,\n toggle,\n isExpanded,\n headingProps,\n}) => {\n const renderButtonRow = actions.length > 0 || menuActions.length > 0;\n const { as: headingAs, ...restHeadingProps } = headingProps ?? {};\n\n return (\n <HeadingContainer\n $isTopSection={isTopSection}\n $hasFooter={hasFooter}\n $isExpanded={isExpanded}\n $divider={isTopSection && isExpanded && sectionHasContent}\n align='center'\n justify='space-between'\n spacing={Spacing[2]}\n >\n {loading ? (\n <CardLoadingShimmer height='24px' width='200px' />\n ) : (\n <>\n {/* https://github.com/adobe/react-spectrum/issues/7444 */}\n <HeaderButton slot='trigger' isDisabled={!toggle}>\n <StyledHeading\n forwardedAs={headingAs ?? (isTopSection ? 'h2' : 'h3')}\n size='xsm'\n $isCollapsible={!!toggle}\n $isTopSection={isTopSection}\n aria-label={title}\n {...restHeadingProps}\n >\n {leftDecorativeIcon}\n <TruncatedText>{title}</TruncatedText>\n {sticker && <StickerContainer>{sticker}</StickerContainer>}\n </StyledHeading>\n </HeaderButton>\n {headerActionsRowContent}\n {renderButtonRow && (\n <ButtonRow\n actions={actions.filter((action) => action != null)}\n menuActions={menuActions.filter((action) => action != null)}\n />\n )}\n {toggle && (\n <AccordionContainer $isTopSection={isTopSection} $expanded={isExpanded}>\n <ChevronDownIcon />\n </AccordionContainer>\n )}\n </>\n )}\n </HeadingContainer>\n );\n};\n","import type { ComponentProps, FC, ReactNode } from 'react';\nimport { Disclosure, DisclosurePanel } from 'react-aria-components';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { SectionHeading } from 'design-system/components/CardV2/SectionHeading';\nimport { LoadingShimmer } from 'design-system/components/LoadingShimmer';\nimport { HStack } from 'design-system/components/Stack';\nimport { Paragraph } from 'design-system/components/Text';\nimport { intersperse } from 'design-system/lib/intersperse';\nimport { Z_INDICES } from 'design-system/lib/zindex';\n\nconst FooterParagraph = styled(Paragraph)`\n line-height: 16px;\n`;\n\ntype FooterContainerProps = {\n $divider: boolean;\n};\nconst FooterContainer = styled.div<FooterContainerProps>`\n ${({ $divider }) =>\n $divider &&\n css`\n border-top: 1px solid ${Color.BorderDivider};\n `}\n padding: ${Spacing[3]} ${Spacing[5]} ${Spacing[2]};\n`;\n\ntype MaybeStickyContainerProps = {\n $enabled: boolean;\n $bottom?: boolean;\n};\nconst MaybeStickyContainer = styled.div<MaybeStickyContainerProps>`\n ${({ $enabled }) =>\n $enabled &&\n css`\n // We are using sticky positioning here to have consistent scrollbar behavior between\n // different card configurations. Usage of sticky allows us to keep the scroll container at\n // the top of the card DOM structure regardless of whether the heading or footer is sticky.\n //\n // This also afaict helps eliminate the need to carry height values through the card DOM\n // structure to the content container (and possibly needing to adjust heights for heading and footer).\n position: sticky;\n top: 0;\n background-color: ${({ theme }) => theme.color.background.primary};\n z-index: ${Z_INDICES.sticky};\n `}\n\n ${({ $bottom = false }) =>\n $bottom &&\n css`\n top: unset;\n bottom: 0;\n `}\n`;\n\ntype StyledDisclosureProps = {\n $fullHeight: boolean;\n};\nconst StyledDisclosure = styled(Disclosure)<StyledDisclosureProps>`\n display: flex;\n flex-direction: column;\n gap: 0;\n ${({ $fullHeight }) =>\n $fullHeight &&\n css`\n height: 100%;\n `}\n`;\n\ntype StyledDisclosurePanelProps = {\n $isTopSection: boolean;\n};\nconst StyledDisclosurePanel = styled(DisclosurePanel)<StyledDisclosurePanelProps>`\n flex: 1;\n ${({ $isTopSection }) =>\n $isTopSection &&\n css`\n // Safari does not support hidden='until-found' so react-aria uses display: none instead.\n // Since react-aria is using display to hide content we need to not set display ourselves.\n &:not([aria-hidden='true']) {\n display: flex;\n }\n `}\n`;\n\nconst CardLoadingShimmer = styled(LoadingShimmer)`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n`;\n\ntype SectionContentContainerProps = {\n $isTopSection: boolean;\n $hasHeading: boolean;\n $hasFooter: boolean;\n};\nconst SectionContentContainer = styled.div<SectionContentContainerProps>`\n ${({ $isTopSection }) =>\n $isTopSection &&\n css`\n padding: ${Spacing[5]};\n display: flex;\n flex-direction: column;\n gap: ${Spacing[5]};\n flex: 1;\n /* Prevent grid blowout https://css-tricks.com/preventing-a-grid-blowout/ */\n min-width: 0;\n `}\n\n ${({ $isTopSection, $hasHeading }) =>\n !$isTopSection &&\n $hasHeading &&\n css`\n padding-top: ${Spacing[3]};\n `}\n\n ${({ $isTopSection, $hasFooter }) =>\n $isTopSection &&\n !$hasFooter &&\n css`\n // We apply 4px of whitespace to the bottom of the card container so that content has a buffer\n // when being scrolled and still appears inside the card. Here we adjust, subtracting\n // 4px from the 24px padding.\n padding-bottom: 20px;\n `}\n`;\n\n/**\n * Private component for rendering sections of the card, both the primary card section and\n * individual sections.\n */\nexport const Section: FC<{\n children?: ReactNode;\n\n /**\n * Whether this is the top-level section of the card which has different visual treatment.\n */\n isTopSection: boolean;\n\n /**\n * Available props for the section's heading.\n */\n heading?: Pick<\n ComponentProps<typeof SectionHeading>,\n | 'title'\n | 'actions'\n | 'menuActions'\n | 'headerActionsRowContent'\n | 'sticker'\n | 'leftDecorativeIcon'\n | 'headingProps'\n >;\n\n /**\n * Optional footer to render at the bottom of the card. Footer content is rendered as a\n * paragraph with the items separated by a dot.\n */\n footer?: ReactNode[];\n\n /**\n * Optional arbitrary footer content to render as-is.\n */\n footerContent?: ReactNode;\n\n /**\n * Whether the section is collapsible.\n */\n collapsible?: boolean;\n\n /**\n * Whether the section heading and footer are sticky.\n */\n sticky?: boolean;\n\n /**\n * Whether the section is initially collapsed.\n */\n defaultCollapsed?: boolean;\n\n /**\n * If true, the section will be rendered in a loading state.\n */\n loading?: boolean;\n\n /**\n * Set height of the loading state.\n */\n loadingProps?: {\n height?: string;\n };\n\n /**\n * Control display of the empty state.\n */\n empty?: boolean;\n\n /**\n * Props for the empty state.\n */\n emptyProps?: {\n /**\n * Empty state message.\n */\n message?: string;\n };\n\n fullHeight?: boolean;\n}> = ({\n children,\n isTopSection,\n heading,\n footer,\n footerContent,\n loading = false,\n loadingProps,\n empty = false,\n emptyProps,\n defaultCollapsed = false,\n collapsible = false,\n sticky = false,\n fullHeight = false,\n}) => {\n let content: ReactNode;\n if (loading) {\n content = <CardLoadingShimmer height={loadingProps?.height ?? '200px'} width='100%' />;\n } else if (empty) {\n content = <Paragraph>{emptyProps?.message ?? 'No data collected'}</Paragraph>;\n } else {\n content = children;\n }\n\n const hasFooter = !!(footer || footerContent);\n const hasContent = !!content;\n\n // Normally we would have `isDisabled` as well but there's a react-aria-components quirk\n // that sets `hidden` on the disclosure panel if both `defaultExpanded` and `isDisabled` are true.\n // https://github.com/adobe/react-spectrum/issues/7444\n return (\n <StyledDisclosure defaultExpanded={!defaultCollapsed} $fullHeight={fullHeight}>\n {({ isExpanded, state }) => (\n <>\n {heading && (\n <MaybeStickyContainer $enabled={sticky}>\n <SectionHeading\n isTopSection={isTopSection}\n hasFooter={hasFooter}\n sectionHasContent={hasContent}\n loading={loading}\n toggle={collapsible ? state.toggle : undefined}\n isExpanded={isExpanded}\n {...heading}\n />\n </MaybeStickyContainer>\n )}\n {hasContent && (\n <StyledDisclosurePanel $isTopSection={isTopSection}>\n <SectionContentContainer\n $isTopSection={isTopSection}\n $hasHeading={!!heading}\n $hasFooter={hasFooter}\n >\n {content}\n </SectionContentContainer>\n </StyledDisclosurePanel>\n )}\n {hasFooter && (\n <MaybeStickyContainer $enabled={sticky} $bottom>\n <FooterContainer $divider={hasContent}>\n {loading ? (\n <HStack>\n <CardLoadingShimmer height='16px' width='120px' />\n <CardLoadingShimmer height='16px' width='120px' />\n </HStack>\n ) : (\n <>\n {footer && (\n <FooterParagraph size='sm'>\n <HStack spacing={Spacing[1]}>\n {intersperse(\n footer\n .filter((item) => item != null)\n .map((item, i) => <span key={`footer-item-${i}`}>{item}</span>),\n (i) => (\n <span key={i}>•</span>\n ),\n )}\n </HStack>\n </FooterParagraph>\n )}\n {footerContent}\n </>\n )}\n </FooterContainer>\n </MaybeStickyContainer>\n )}\n </>\n )}\n </StyledDisclosure>\n );\n};\n","import { type ComponentProps, createContext, type FC, type ReactNode, useContext } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport styled from 'styled-components';\n\nimport { Color } from '@persona/design-tokens';\nimport { Section } from 'design-system/components/CardV2/Section';\nimport { Paragraph } from 'design-system/components/Text';\nimport ConfigContext from 'design-system/lib/ConfigContext';\nimport { intersperse } from 'design-system/lib/intersperse';\n\nconst CardContainer = styled.div`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n background-color: ${({ theme }) => theme.color.background.primary};\n // Height has been tricky here.\n // inherit seems to work well for both grid and flexbox layouts. In a grid we want this\n // container to receive the full cell height, In a flexbox we want this container to flex, maintaining\n // the minimum height for it's content.\n height: inherit;\n overflow-y: auto;\n\n box-sizing: border-box;\n // Small buffer so that content is not scrolling right on the edge of the card.\n border-bottom: 4px solid ${({ theme }) => theme.color.background.primary};\n`;\n\nconst CardContext = createContext<{ isStacked?: boolean }>({});\n\nconst Divider = styled.hr`\n margin: 0;\n border: none;\n border-top: 1px solid ${Color.BorderDivider};\n`;\n\n/**\n * Renders a card section.\n */\nconst PublicSection: FC<\n Pick<\n ComponentProps<typeof Section>,\n | 'children'\n | 'collapsible'\n | 'defaultCollapsed'\n | 'heading'\n | 'loading'\n | 'loadingProps'\n | 'empty'\n | 'emptyProps'\n >\n> = (props) => {\n return <Section isTopSection={false} {...props} />;\n};\n\n/**\n * Render the card in a \"stacked\" mode. Used for rendering multiple cards on top of each other\n * that appear visually as a single card.\n */\nconst Stacked: FC<{\n children: ReactNode[];\n}> = ({ children }) => {\n return (\n <CardContext.Provider value={{ isStacked: true }}>\n <CardContainer>\n {intersperse(children, (i) => (\n <Divider key={i} />\n ))}\n </CardContainer>\n </CardContext.Provider>\n );\n};\n\nconst DEFAULT_ERROR_MESSAGE = '🔍 Oops, something went wrong loading this card.';\n\n/**\n * Renders a PDS Card.\n *\n * To render sections of the card use `<Card.Section>...</Card.Section>`\n */\nconst Card: FC<\n {\n /**\n * Optional footer to render at the bottom of the card. Footer content is rendered as a\n * paragraph with the items separated by a dot.\n */\n footer?: ReactNode[];\n\n /**\n * Optional arbitrary footer content to render as-is.\n */\n footerContent?: ReactNode;\n\n /**\n * Whether the card heading and footer are sticky.\n */\n sticky?: boolean;\n\n /**\n * Force the card to render in an errored state. Errors bubbling up from children will also\n * render the errored state.\n */\n errored?: boolean;\n\n /**\n * Props for the errored state.\n */\n erroredProps?: {\n /**\n * Message to render in the errored state.\n */\n message?: string;\n /**\n * Callback to handle errors. Note this callback is only called when the error is bubbled up\n * from children, not when `errored` is set to true.\n */\n onError?: (error: Error) => void;\n };\n\n containerProps?: ComponentProps<typeof CardContainer>;\n\n /**\n * Whether the card should render its content with 100% height. This is a bit of a hack for cards\n * that want full control of their content and don't use sections.\n */\n fullHeight?: boolean;\n } & ComponentProps<typeof PublicSection>\n> = ({ children, errored, erroredProps, containerProps, sticky = true, ...sectionProps }) => {\n const { isStacked = false } = useContext(CardContext);\n const { captureException } = useContext(ConfigContext);\n\n const errorFallback = (\n <Section isTopSection {...sectionProps}>\n <Paragraph>{erroredProps?.message ?? DEFAULT_ERROR_MESSAGE}</Paragraph>\n </Section>\n );\n\n const section = (\n <Section isTopSection sticky={sticky} {...sectionProps}>\n {children}\n </Section>\n );\n\n return (\n <ErrorBoundary\n fallback={\n isStacked ? (\n errorFallback\n ) : (\n <CardContainer {...containerProps}>{errorFallback}</CardContainer>\n )\n }\n onError={erroredProps?.onError ?? ((error) => captureException(error))}\n >\n {isStacked ? (\n <>{errored ? <>{errorFallback}</> : <>{section}</>}</>\n ) : (\n <CardContainer {...containerProps}>\n {errored ? <>{errorFallback}</> : <>{section}</>}\n </CardContainer>\n )}\n </ErrorBoundary>\n );\n};\n\nexport default Object.assign(Card, {\n Section: PublicSection,\n Stacked: Stacked,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,uBAAqB,OAAO,eAAe;oBAC7B,EAAE,YAAY,MAAM,KAAK,aAAa;;AAG1D,MAAM,mBAAmB,OAAO,GAAG;;;;AASnC,MAAM,qBAAqB,OAAO,GAA4B;gCACZ;;;;;;;;;;WAUvC,EAAE,oBAAqB,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AA;EAAqB;EAAQ,GAAI;EACvC;EACO,CAAA;AAGZ,QACE,oBAAC,eAAD;EACE,UACE,YACE,gBAEA,oBAAC,eAAD;GAAe,GAAI;aAAiB;GAA8B,CAAA;EAGtE,SAAS,cAAc,aAAa,UAAU,iBAAiB,MAAM;YAEpE,YACC,oBAAA,YAAA,EAAA,UAAG,UAAU,oBAAA,YAAA,EAAA,UAAG,eAAiB,CAAA,GAAG,oBAAA,YAAA,EAAA,UAAG,SAAW,CAAA,EAAI,CAAA,GAEtD,oBAAC,eAAD;GAAe,GAAI;aAChB,UAAU,oBAAA,YAAA,EAAA,UAAG,eAAiB,CAAA,GAAG,oBAAA,YAAA,EAAA,UAAG,SAAW,CAAA;GAClC,CAAA;EAEJ,CAAA;;AAIpB,IAAA,eAAe,OAAO,OAAO,MAAM;CACjC,SAAS;CACA;CACV,CAAC"}
|
|
@@ -43,4 +43,4 @@ interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'value'
|
|
|
43
43
|
declare const Checkbox: _$react.ForwardRefExoticComponent<CheckboxProps & _$react.RefAttributes<HTMLInputElement>>;
|
|
44
44
|
//#endregion
|
|
45
45
|
export { CheckboxProps as n, Checkbox as t };
|
|
46
|
-
//# sourceMappingURL=Checkbox-
|
|
46
|
+
//# sourceMappingURL=Checkbox-Bmm-r5ei.d.mts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { isChecked, isDisabled, isFocusedVisible, isHovered, isIndeterminate, isNotDisabled } from "./lib/pseudoClass.mjs";
|
|
2
2
|
import { focusStyle } from "./mixins/focus.mjs";
|
|
3
3
|
import "./variables/transitions.mjs";
|
|
4
|
-
import { n as
|
|
5
|
-
import { a as Tooltip, n as TextWithDashedUnderline } from "./Tooltip-BvDbmXak.mjs";
|
|
4
|
+
import { a as Tooltip, n as TextWithDashedUnderline } from "./Tooltip-CDvOu1UN.mjs";
|
|
6
5
|
import useControlled from "./lib/useControlled.mjs";
|
|
7
|
-
import { n as
|
|
6
|
+
import { n as Stack } from "./Stack-ckRN7LrP.mjs";
|
|
7
|
+
import { n as useFormField } from "./useFormField-eftOPiXj.mjs";
|
|
8
8
|
import { Color, Spacing, Typography } from "@persona/design-tokens";
|
|
9
9
|
import styled, { css } from "styled-components";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { InputCheckIcon, InputDashIcon } from "@persona/icons";
|
|
13
13
|
import { uniqueId } from "lodash";
|
|
14
14
|
//#region components/Checkbox/Checkbox.tsx
|
|
@@ -132,7 +132,7 @@ const Checkbox = forwardRef(function Checkbox({ className, disabled, indetermina
|
|
|
132
132
|
children: [
|
|
133
133
|
/* @__PURE__ */ jsx(CheckboxInput, {
|
|
134
134
|
id: inputId,
|
|
135
|
-
ref:
|
|
135
|
+
ref: inputRef,
|
|
136
136
|
"data-test": dataTest && `${dataTest}-input`,
|
|
137
137
|
disabled: field.disabled,
|
|
138
138
|
type: "checkbox",
|
|
@@ -173,4 +173,4 @@ const Checkbox = forwardRef(function Checkbox({ className, disabled, indetermina
|
|
|
173
173
|
//#endregion
|
|
174
174
|
export { Checkbox as t };
|
|
175
175
|
|
|
176
|
-
//# sourceMappingURL=Checkbox-
|
|
176
|
+
//# sourceMappingURL=Checkbox-CU27-Aa8.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox-BcuiFvK7.mjs","names":[],"sources":["../components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { uniqueId } from 'lodash';\nimport {\n type ChangeEvent,\n type ComponentPropsWithoutRef,\n forwardRef,\n type ReactNode,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport { InputCheckIcon, InputDashIcon } from '@persona/icons';\nimport useFormField from 'design-system/components/FormControl/useFormField';\nimport Stack from 'design-system/components/Stack/Stack';\nimport Tooltip from 'design-system/components/Tooltip';\nimport { TextWithDashedUnderline } from 'design-system/components/Tooltip/TextUnderlineTooltip';\nimport {\n isChecked,\n isDisabled,\n isFocusedVisible,\n isHovered,\n isIndeterminate,\n isNotDisabled,\n} from 'design-system/lib/pseudoClass';\nimport useControlled from 'design-system/lib/useControlled';\nimport { focusStyle } from 'design-system/mixins/focus';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst Container = styled(Stack)<{ size: 'md' | 'sm'; disabled?: boolean }>`\n position: relative;\n cursor: pointer;\n\n flex-wrap: nowrap;\n\n ${({ size }) =>\n size === 'sm' &&\n css`\n height: 16px;\n `}\n\n &${isDisabled} {\n cursor: default;\n }\n`;\n\nconst CheckboxBox = styled.div<{ disabled?: boolean; checked?: boolean }>`\n cursor: pointer;\n display: flex;\n flex: 0 0 16px;\n justify-content: center;\n align-items: center;\n transition:\n box-shadow ${TransitionDuration.Fast},\n background-color ${TransitionDuration.Fast},\n border-color ${TransitionDuration.Fast};\n border-radius: 3px;\n height: ${Spacing[4]};\n width: ${Spacing[4]};\n box-sizing: border-box;\n border: 1px solid ${Color.BorderInputCheckbox};\n background: ${Color.BackgroundInputDefault};\n\n svg {\n color: ${Color.BorderIconInverse};\n }\n\n &${isDisabled} {\n cursor: default;\n background: ${Color.BackgroundInputDisabled};\n border-color: ${Color.BorderInputDisabled};\n }\n\n ${({ checked }) =>\n checked &&\n css`\n border-color: ${Color.BackgroundInputActive};\n background: ${Color.BackgroundInputActive};\n\n &${isDisabled} {\n border-color: ${Color.BackgroundInputActiveDisabled};\n background: ${Color.BackgroundInputActiveDisabled};\n }\n `}\n`;\n\nconst CheckboxInput = styled.input`\n cursor: inherit;\n height: 16px;\n width: 16px;\n margin: 0;\n border: 0;\n opacity: 0;\n overflow: hidden;\n position: absolute;\n\n &${isHovered}${isNotDisabled} ~ ${CheckboxBox} {\n border-color: ${Color.BorderInputCheckboxHover};\n }\n\n &${isChecked}, &${isIndeterminate} {\n &${isHovered}${isNotDisabled} ~ ${CheckboxBox} {\n background: ${Color.BackgroundInputActiveHover};\n border-color: ${Color.BackgroundInputActiveHover};\n }\n }\n\n &${isFocusedVisible}${isNotDisabled} ~ ${CheckboxBox} {\n ${focusStyle}\n }\n`;\n\nconst Label = styled.label<{ disabled: boolean; size: 'md' | 'sm' }>`\n cursor: inherit;\n color: ${Color.TextPrimary};\n\n ${({ size }) =>\n size === 'sm'\n ? css`\n ${Typography.TextSmall};\n line-height: 16px;\n `\n : css`\n ${Typography.TextMedium};\n\n /** Nudge text for visual alignment */\n position: relative;\n bottom: -1px;\n `}\n\n ${({ theme, disabled }) =>\n disabled &&\n css`\n cursor: default;\n color: ${theme.color.text.disabled};\n `}\n`;\n\nexport interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'size'> {\n /**\n * `id` for the underlying `<input>`. If not provided a unique ID is generated\n * automatically and linked to the label.\n */\n id?: string;\n /** Called whenever the checked state changes. */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Visible label rendered to the right of the checkbox box. */\n label?: ReactNode;\n /** Disables interaction and renders the checkbox in a muted style. */\n disabled?: boolean;\n /**\n * When true the checkbox displays a dash (−) instead of a tick, indicating a\n * mixed / partially-selected state. Sets `aria-checked=\"mixed\"` for screen readers.\n */\n indeterminate?: boolean;\n /**\n * Controlled checked state. Omit (or pass `undefined`) to let the component\n * manage state internally via `defaultChecked`.\n */\n checked?: boolean;\n /** Value submitted with a form. */\n value?: unknown;\n 'data-test'?: string;\n /** Additional props forwarded to the outer container `<div>`. */\n containerProps?: ComponentPropsWithoutRef<'div'>;\n /**\n * Size of the checkbox and its label text.\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n /**\n * Tooltip content to display when hovering over the label.\n * When provided, the label will be wrapped in a tooltip.\n */\n tooltip?: ReactNode;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n {\n className,\n disabled,\n indeterminate,\n onChange,\n checked: checkedProp,\n defaultChecked,\n id,\n label,\n 'data-test': dataTest,\n containerProps,\n value,\n size = 'md',\n tooltip,\n ...elemProps\n },\n ref,\n) {\n const field = useFormField({ disabled });\n const [checked, setChecked] = useControlled({\n controlledValue: checkedProp,\n default: defaultChecked,\n });\n const generatedId = useMemo(() => uniqueId('pds_checkbox__'), []);\n const inputRef = useRef<HTMLInputElement>();\n\n // Use the inputId from FormControl context if available, otherwise use the provided id or generate one\n const inputId = field.inputId || id || generatedId;\n\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n useImperativeHandle(ref, () => inputRef.current, [inputRef]);\n\n useEffect(() => {\n if (inputRef.current) {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n inputRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate, inputRef]);\n\n return (\n <Container\n direction='horizontal'\n className={className}\n data-test={dataTest}\n disabled={field.disabled}\n align='center'\n size={size}\n {...containerProps}\n >\n <CheckboxInput\n id={inputId}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref || inputRef}\n data-test={dataTest && `${dataTest}-input`}\n disabled={field.disabled}\n type='checkbox'\n checked={checkedProp == null ? undefined : checked}\n defaultChecked={defaultChecked}\n onChange={(e) => {\n setChecked(e.target.checked);\n if (onChange) {\n onChange(e);\n }\n }}\n aria-checked={indeterminate ? 'mixed' : checked}\n value={value as unknown as string}\n {...elemProps}\n />\n <CheckboxBox\n aria-hidden='true'\n disabled={field.disabled}\n checked={(checked != null && checked) || indeterminate}\n >\n {indeterminate ? <InputDashIcon /> : checked ? <InputCheckIcon /> : null}\n </CheckboxBox>\n {label &&\n (tooltip ? (\n <Tooltip\n size={size}\n trigger={\n <Label htmlFor={inputId} disabled={!!field.disabled} size={size}>\n <TextWithDashedUnderline>{label}</TextWithDashedUnderline>\n </Label>\n }\n >\n {tooltip}\n </Tooltip>\n ) : (\n <Label htmlFor={inputId} disabled={!!field.disabled} size={size}>\n {label}\n </Label>\n ))}\n </Container>\n );\n});\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;;;;AA+BA,MAAM,YAAY,OAAO,MAAM;;;;;;KAM1B,EAAE,WACH,SAAS,QACT,GAAG;;MAED;;KAED,WAAW;;;;AAKhB,MAAM,cAAc,OAAO,GAA8C;;;;;;;yBAOhC;+BACM;2BACJ;;YAE/B,QAAQ,GAAG;WACZ,QAAQ,GAAG;;sBAEA,MAAM,oBAAoB;gBAChC,MAAM,uBAAuB;;;aAGhC,MAAM,kBAAkB;;;KAGhC,WAAW;;kBAEE,MAAM,wBAAwB;oBAC5B,MAAM,oBAAoB;;;KAGzC,EAAE,cACH,WACA,GAAG;sBACe,MAAM,sBAAsB;oBAC9B,MAAM,sBAAsB;;SAEvC,WAAW;wBACI,MAAM,8BAA8B;sBACtC,MAAM,8BAA8B;;MAEpD;;AAGN,MAAM,gBAAgB,OAAO,KAAK;;;;;;;;;;KAU7B,YAAY,cAAc,KAAK,YAAY;oBAC5B,MAAM,yBAAyB;;;KAG9C,UAAU,KAAK,gBAAgB;OAC7B,YAAY,cAAc,KAAK,YAAY;oBAC9B,MAAM,2BAA2B;sBAC/B,MAAM,2BAA2B;;;;KAIlD,mBAAmB,cAAc,KAAK,YAAY;MACjD,WAAW;;;AAIjB,MAAM,QAAQ,OAAO,KAA+C;;WAEzD,MAAM,YAAY;;KAExB,EAAE,WACH,SAAS,OACL,GAAG;YACC,WAAW,UAAU;;YAGzB,GAAG;YACC,WAAW,WAAW;;;;;UAKxB;;KAEL,EAAE,OAAO,eACV,YACA,GAAG;;eAEQ,MAAM,MAAM,KAAK,SAAS;MACnC;;AA0CN,MAAa,WAAW,WAA4C,SAAS,SAC3E,EACE,WACA,UACA,eACA,UACA,SAAS,aACT,gBACA,IACA,OACA,aAAa,UACb,gBACA,OACA,OAAO,MACP,SACA,GAAG,aAEL,KACA;CACA,MAAM,QAAQ,aAAa,EAAE,UAAU,CA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s","names":[],"sources":["../components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { uniqueId } from 'lodash';\nimport {\n type ChangeEvent,\n type ComponentPropsWithoutRef,\n forwardRef,\n type ReactNode,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport { InputCheckIcon, InputDashIcon } from '@persona/icons';\nimport useFormField from 'design-system/components/FormControl/useFormField';\nimport Stack from 'design-system/components/Stack/Stack';\nimport Tooltip from 'design-system/components/Tooltip';\nimport { TextWithDashedUnderline } from 'design-system/components/Tooltip/TextUnderlineTooltip';\nimport {\n isChecked,\n isDisabled,\n isFocusedVisible,\n isHovered,\n isIndeterminate,\n isNotDisabled,\n} from 'design-system/lib/pseudoClass';\nimport useControlled from 'design-system/lib/useControlled';\nimport { focusStyle } from 'design-system/mixins/focus';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst Container = styled(Stack)<{ size: 'md' | 'sm'; disabled?: boolean }>`\n position: relative;\n cursor: pointer;\n\n flex-wrap: nowrap;\n\n ${({ size }) =>\n size === 'sm' &&\n css`\n height: 16px;\n `}\n\n &${isDisabled} {\n cursor: default;\n }\n`;\n\nconst CheckboxBox = styled.div<{ disabled?: boolean; checked?: boolean }>`\n cursor: pointer;\n display: flex;\n flex: 0 0 16px;\n justify-content: center;\n align-items: center;\n transition:\n box-shadow ${TransitionDuration.Fast},\n background-color ${TransitionDuration.Fast},\n border-color ${TransitionDuration.Fast};\n border-radius: 3px;\n height: ${Spacing[4]};\n width: ${Spacing[4]};\n box-sizing: border-box;\n border: 1px solid ${Color.BorderInputCheckbox};\n background: ${Color.BackgroundInputDefault};\n\n svg {\n color: ${Color.BorderIconInverse};\n }\n\n &${isDisabled} {\n cursor: default;\n background: ${Color.BackgroundInputDisabled};\n border-color: ${Color.BorderInputDisabled};\n }\n\n ${({ checked }) =>\n checked &&\n css`\n border-color: ${Color.BackgroundInputActive};\n background: ${Color.BackgroundInputActive};\n\n &${isDisabled} {\n border-color: ${Color.BackgroundInputActiveDisabled};\n background: ${Color.BackgroundInputActiveDisabled};\n }\n `}\n`;\n\nconst CheckboxInput = styled.input`\n cursor: inherit;\n height: 16px;\n width: 16px;\n margin: 0;\n border: 0;\n opacity: 0;\n overflow: hidden;\n position: absolute;\n\n &${isHovered}${isNotDisabled} ~ ${CheckboxBox} {\n border-color: ${Color.BorderInputCheckboxHover};\n }\n\n &${isChecked}, &${isIndeterminate} {\n &${isHovered}${isNotDisabled} ~ ${CheckboxBox} {\n background: ${Color.BackgroundInputActiveHover};\n border-color: ${Color.BackgroundInputActiveHover};\n }\n }\n\n &${isFocusedVisible}${isNotDisabled} ~ ${CheckboxBox} {\n ${focusStyle}\n }\n`;\n\nconst Label = styled.label<{ disabled: boolean; size: 'md' | 'sm' }>`\n cursor: inherit;\n color: ${Color.TextPrimary};\n\n ${({ size }) =>\n size === 'sm'\n ? css`\n ${Typography.TextSmall};\n line-height: 16px;\n `\n : css`\n ${Typography.TextMedium};\n\n /** Nudge text for visual alignment */\n position: relative;\n bottom: -1px;\n `}\n\n ${({ theme, disabled }) =>\n disabled &&\n css`\n cursor: default;\n color: ${theme.color.text.disabled};\n `}\n`;\n\nexport interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'size'> {\n /**\n * `id` for the underlying `<input>`. If not provided a unique ID is generated\n * automatically and linked to the label.\n */\n id?: string;\n /** Called whenever the checked state changes. */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Visible label rendered to the right of the checkbox box. */\n label?: ReactNode;\n /** Disables interaction and renders the checkbox in a muted style. */\n disabled?: boolean;\n /**\n * When true the checkbox displays a dash (−) instead of a tick, indicating a\n * mixed / partially-selected state. Sets `aria-checked=\"mixed\"` for screen readers.\n */\n indeterminate?: boolean;\n /**\n * Controlled checked state. Omit (or pass `undefined`) to let the component\n * manage state internally via `defaultChecked`.\n */\n checked?: boolean;\n /** Value submitted with a form. */\n value?: unknown;\n 'data-test'?: string;\n /** Additional props forwarded to the outer container `<div>`. */\n containerProps?: ComponentPropsWithoutRef<'div'>;\n /**\n * Size of the checkbox and its label text.\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n /**\n * Tooltip content to display when hovering over the label.\n * When provided, the label will be wrapped in a tooltip.\n */\n tooltip?: ReactNode;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n {\n className,\n disabled,\n indeterminate,\n onChange,\n checked: checkedProp,\n defaultChecked,\n id,\n label,\n 'data-test': dataTest,\n containerProps,\n value,\n size = 'md',\n tooltip,\n ...elemProps\n },\n ref,\n) {\n const field = useFormField({ disabled });\n const [checked, setChecked] = useControlled({\n controlledValue: checkedProp,\n default: defaultChecked,\n });\n const generatedId = useMemo(() => uniqueId('pds_checkbox__'), []);\n const inputRef = useRef<HTMLInputElement>();\n\n // Use the inputId from FormControl context if available, otherwise use the provided id or generate one\n const inputId = field.inputId || id || generatedId;\n\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n useImperativeHandle(ref, () => inputRef.current, [inputRef]);\n\n useEffect(() => {\n if (inputRef.current) {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n inputRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate, inputRef]);\n\n return (\n <Container\n direction='horizontal'\n className={className}\n data-test={dataTest}\n disabled={field.disabled}\n align='center'\n size={size}\n {...containerProps}\n >\n <CheckboxInput\n id={inputId}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={inputRef}\n data-test={dataTest && `${dataTest}-input`}\n disabled={field.disabled}\n type='checkbox'\n checked={checkedProp == null ? undefined : checked}\n defaultChecked={defaultChecked}\n onChange={(e) => {\n setChecked(e.target.checked);\n if (onChange) {\n onChange(e);\n }\n }}\n aria-checked={indeterminate ? 'mixed' : checked}\n value={value as unknown as string}\n {...elemProps}\n />\n <CheckboxBox\n aria-hidden='true'\n disabled={field.disabled}\n checked={(checked != null && checked) || indeterminate}\n >\n {indeterminate ? <InputDashIcon /> : checked ? <InputCheckIcon /> : null}\n </CheckboxBox>\n {label &&\n (tooltip ? (\n <Tooltip\n size={size}\n trigger={\n <Label htmlFor={inputId} disabled={!!field.disabled} size={size}>\n <TextWithDashedUnderline>{label}</TextWithDashedUnderline>\n </Label>\n }\n >\n {tooltip}\n </Tooltip>\n ) : (\n <Label htmlFor={inputId} disabled={!!field.disabled} size={size}>\n {label}\n </Label>\n ))}\n </Container>\n );\n});\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;;;;AA+BA,MAAM,YAAY,OAAO,MAAM;;;;;;KAM1B,EAAE,WACH,SAAS,QACT,GAAG;;MAED;;KAED,WAAW;;;;AAKhB,MAAM,cAAc,OAAO,GAA8C;;;;;;;yBAOhC;+BACM;2BACJ;;YAE/B,QAAQ,GAAG;WACZ,QAAQ,GAAG;;sBAEA,MAAM,oBAAoB;gBAChC,MAAM,uBAAuB;;;aAGhC,MAAM,kBAAkB;;;KAGhC,WAAW;;kBAEE,MAAM,wBAAwB;oBAC5B,MAAM,oBAAoB;;;KAGzC,EAAE,cACH,WACA,GAAG;sBACe,MAAM,sBAAsB;oBAC9B,MAAM,sBAAsB;;SAEvC,WAAW;wBACI,MAAM,8BAA8B;sBACtC,MAAM,8BAA8B;;MAEpD;;AAGN,MAAM,gBAAgB,OAAO,KAAK;;;;;;;;;;KAU7B,YAAY,cAAc,KAAK,YAAY;oBAC5B,MAAM,yBAAyB;;;KAG9C,UAAU,KAAK,gBAAgB;OAC7B,YAAY,cAAc,KAAK,YAAY;oBAC9B,MAAM,2BAA2B;sBAC/B,MAAM,2BAA2B;;;;KAIlD,mBAAmB,cAAc,KAAK,YAAY;MACjD,WAAW;;;AAIjB,MAAM,QAAQ,OAAO,KAA+C;;WAEzD,MAAM,YAAY;;KAExB,EAAE,WACH,SAAS,OACL,GAAG;YACC,WAAW,UAAU;;YAGzB,GAAG;YACC,WAAW,WAA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SAAS;KAAS,UAAU,CAAC,CAAC,MAAM;KAAgB;eACzD,oBAAC,yBAAD,EAAA,UAA0B,OAAgC,CAAA;KACpD,CAAA;cAGT;IACO,CAAA,GAEV,oBAAC,OAAD;IAAO,SAAS;IAAS,UAAU,CAAC,CAAC,MAAM;IAAgB;cACxD;IACK,CAAA;GAEF;;EAEd"}
|
package/dist/Checkbox.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CheckboxProps, t as Checkbox } from "./Checkbox-
|
|
1
|
+
import { n as CheckboxProps, t as Checkbox } from "./Checkbox-Bmm-r5ei.mjs";
|
|
2
2
|
export { Checkbox, Checkbox as default, CheckboxProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as CheckboxProps } from "./Checkbox-
|
|
1
|
+
import { n as CheckboxProps } from "./Checkbox-Bmm-r5ei.mjs";
|
|
2
2
|
import { ImplementsFormField } from "./inputFields.mjs";
|
|
3
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
3
|
import { ReactElement } from "react";
|
|
4
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
import { AriaCheckboxGroupProps } from "react-aria";
|
|
6
6
|
|
|
7
7
|
//#region components/FormField/CheckboxGroupField.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ValueControlProps } from "./types-
|
|
1
|
+
import { t as ValueControlProps } from "./types-BKEwt0uq.mjs";
|
|
2
2
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region components/DataTable/TableControls/FiltersV2/value-controls/ChoicesValueControl/ChoicesValueControl.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-
|
|
2
|
-
import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-
|
|
1
|
+
import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-BLKUKNEW.mjs";
|
|
2
|
+
import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-Kpl-iOok.mjs";
|
|
3
3
|
|
|
4
4
|
//#region components/Combobox/Combobox.d.ts
|
|
5
5
|
type ComboboxProps<T = string> = ComboboxSingleSelectProps<T> | ComboboxMultiSelectProps<T>;
|
|
@@ -8,4 +8,4 @@ declare const Combobox: <T = string>(props: ComboboxProps<T> & {
|
|
|
8
8
|
}) => React.ReactElement;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { ComboboxProps as n, Combobox as t };
|
|
11
|
-
//# sourceMappingURL=Combobox-
|
|
11
|
+
//# sourceMappingURL=Combobox-BgKEHP9p.d.mts.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { focusStyle } from "./mixins/focus.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { i as Paragraph } from "./Text-RcEfNFLx.mjs";
|
|
2
|
+
import { i as Paragraph } from "./Text-hEoPeOc9.mjs";
|
|
4
3
|
import { useOutsideClick } from "./lib/useOutsideClick.mjs";
|
|
5
4
|
import { Z_INDICES } from "./lib/zindex.mjs";
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { n as
|
|
9
|
-
import {
|
|
5
|
+
import { n as Stack } from "./Stack-ckRN7LrP.mjs";
|
|
6
|
+
import { n as Button } from "./IconButton-DC4rh6ow.mjs";
|
|
7
|
+
import { n as Sticker } from "./Sticker-B0TbkV4o.mjs";
|
|
8
|
+
import { n as useFormField } from "./useFormField-eftOPiXj.mjs";
|
|
9
|
+
import { r as InputGroup } from "./Input-PWfwMSJ7.mjs";
|
|
10
10
|
import Input_default from "./components/Input/index.mjs";
|
|
11
|
-
import { t as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
11
|
+
import { t as Checkbox } from "./Checkbox-CU27-Aa8.mjs";
|
|
12
|
+
import { c as MenuList, n as IconContainer, o as MenuHeading, s as MenuItem, t as FloatingCard } from "./Menu-DpM8o234.mjs";
|
|
13
|
+
import { t as Spinner } from "./Spinner-BgBCCHGo.mjs";
|
|
14
14
|
import { Color, Spacing, Typography } from "@persona/design-tokens";
|
|
15
15
|
import styled, { css } from "styled-components";
|
|
16
|
-
import { Fragment,
|
|
17
|
-
import { Fragment as Fragment$1,
|
|
16
|
+
import { Fragment, cloneElement, forwardRef, isValidElement, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
17
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
18
18
|
import { ArrowLeftIcon, CaretDownIcon, ChevronRightIcon, CircleXInverseIcon, SearchIcon } from "@persona/icons";
|
|
19
19
|
import Fuse from "fuse.js";
|
|
20
20
|
import { createPortal } from "react-dom";
|
|
@@ -241,7 +241,7 @@ function renderOptionsWithGroups({ options, filteredOptions, renderOption, virtu
|
|
|
241
241
|
if (item.nested) return null;
|
|
242
242
|
const visibleLeaves = flattenOptions(item.options).filter((opt) => filteredOptions.some((filtered) => filtered.value === opt.value));
|
|
243
243
|
if (visibleLeaves.length === 0) return null;
|
|
244
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
244
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuHeading, { children: item.label }), visibleLeaves.map((option) => {
|
|
245
245
|
flatIndex++;
|
|
246
246
|
return renderOption(option, flatIndex);
|
|
247
247
|
})] }, `group-${groupIndex}`);
|
|
@@ -480,7 +480,7 @@ function DropdownPortalWrapper({ children, portal }) {
|
|
|
480
480
|
"data-react-aria-top-layer": "true",
|
|
481
481
|
children
|
|
482
482
|
}), portalRoot.current);
|
|
483
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
483
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
484
484
|
}
|
|
485
485
|
//#endregion
|
|
486
486
|
//#region components/Combobox/useComboboxFooterAction.ts
|
|
@@ -756,6 +756,7 @@ function ComboboxMultiSelectComponent({ size = "md", options: rawOptions, isOpti
|
|
|
756
756
|
inputId: id
|
|
757
757
|
});
|
|
758
758
|
const [inputValue, setInputValue] = useState("");
|
|
759
|
+
const [embeddedOpen, setEmbeddedOpen] = useState(false);
|
|
759
760
|
const searchInputRef = useRef(null);
|
|
760
761
|
const comboboxInputRef = useRef(null);
|
|
761
762
|
const caretButtonRef = useRef(null);
|
|
@@ -764,6 +765,9 @@ function ComboboxMultiSelectComponent({ size = "md", options: rawOptions, isOpti
|
|
|
764
765
|
const selectedItemsContainerRef = useRef(null);
|
|
765
766
|
const measurementStickerRefs = useRef([]);
|
|
766
767
|
const measurementTruncatorRef = useRef(null);
|
|
768
|
+
useEffect(() => {
|
|
769
|
+
setEmbeddedOpen(embedded);
|
|
770
|
+
}, [embedded]);
|
|
767
771
|
const portalContainerRef = externalPortalContainerRef || comboboxContainerRef;
|
|
768
772
|
const flatOptions = useMemo(() => flattenOptions(options), [options]);
|
|
769
773
|
const selectedItems = flatOptions.filter((option) => values.includes(option.value));
|
|
@@ -925,7 +929,7 @@ function ComboboxMultiSelectComponent({ size = "md", options: rawOptions, isOpti
|
|
|
925
929
|
items: navigableItems,
|
|
926
930
|
itemToString,
|
|
927
931
|
getItemId: getOptionId,
|
|
928
|
-
isOpen: embedded ?
|
|
932
|
+
isOpen: embedded ? embeddedOpen : void 0,
|
|
929
933
|
selectedItem: null,
|
|
930
934
|
initialHighlightedIndex: 0,
|
|
931
935
|
defaultHighlightedIndex: 0,
|
|
@@ -1030,7 +1034,7 @@ function ComboboxMultiSelectComponent({ size = "md", options: rawOptions, isOpti
|
|
|
1030
1034
|
children: option.labelStickerVariant ? /* @__PURE__ */ jsx(Sticker, {
|
|
1031
1035
|
variant: option.labelStickerVariant,
|
|
1032
1036
|
children: option.label
|
|
1033
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(OptionLabel, {
|
|
1037
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(OptionLabel, {
|
|
1034
1038
|
title: option.label,
|
|
1035
1039
|
$labelStyle: option.PLEASE_DO_NOT_USE_labelFontStyle,
|
|
1036
1040
|
children: option.label
|
|
@@ -1078,9 +1082,12 @@ function ComboboxMultiSelectComponent({ size = "md", options: rawOptions, isOpti
|
|
|
1078
1082
|
setHighlightedIndex
|
|
1079
1083
|
]);
|
|
1080
1084
|
const searchInputId = `${field.inputId}-search`;
|
|
1085
|
+
useLayoutEffect(() => {
|
|
1086
|
+
if (embedded && isMenuOpen && searchInputRef.current) searchInputRef.current.focus({ preventScroll: true });
|
|
1087
|
+
}, [embedded, isMenuOpen]);
|
|
1081
1088
|
useEffect(() => {
|
|
1082
|
-
if (isMenuOpen && searchInputRef.current) searchInputRef.current.focus();
|
|
1083
|
-
}, [isMenuOpen]);
|
|
1089
|
+
if (!embedded && isMenuOpen && searchInputRef.current) searchInputRef.current.focus();
|
|
1090
|
+
}, [embedded, isMenuOpen]);
|
|
1084
1091
|
const handleSearchInputKeyDown = useCallback((e) => {
|
|
1085
1092
|
if (handleFooterKeyDown(e)) return;
|
|
1086
1093
|
if (e.key === "ArrowDown" && navigableItems.length > 0) {
|
|
@@ -1276,7 +1283,7 @@ function ComboboxMultiSelectComponent({ size = "md", options: rawOptions, isOpti
|
|
|
1276
1283
|
$minWidth: externalTrigger ? EXTERNAL_TRIGGER_DROPDOWN_MIN_WIDTH$1 : void 0,
|
|
1277
1284
|
...getMenuProps(),
|
|
1278
1285
|
"aria-multiselectable": "true",
|
|
1279
|
-
children: [isMenuOpen && /* @__PURE__ */ jsx(SearchInputContainer, {
|
|
1286
|
+
children: [(embedded || isMenuOpen) && /* @__PURE__ */ jsx(SearchInputContainer, {
|
|
1280
1287
|
$embedded: embedded,
|
|
1281
1288
|
children: /* @__PURE__ */ jsx(InputGroup, {
|
|
1282
1289
|
leftIcon: embedded ? void 0 : /* @__PURE__ */ jsx(SearchIcon, {}),
|
|
@@ -1302,7 +1309,7 @@ function ComboboxMultiSelectComponent({ size = "md", options: rawOptions, isOpti
|
|
|
1302
1309
|
$embedded: embedded,
|
|
1303
1310
|
tabIndex: -1,
|
|
1304
1311
|
ref: scrollableListRef,
|
|
1305
|
-
children: isMenuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [isOptionsLoading ? /* @__PURE__ */ jsx(LoadingContainer, { children: /* @__PURE__ */ jsx(Spinner, { size: "md" }) }) : navigableItems.length > 0 ? renderOptionsWithGroups({
|
|
1312
|
+
children: isMenuOpen && /* @__PURE__ */ jsxs(Fragment$1, { children: [isOptionsLoading ? /* @__PURE__ */ jsx(LoadingContainer, { children: /* @__PURE__ */ jsx(Spinner, { size: "md" }) }) : navigableItems.length > 0 ? renderOptionsWithGroups({
|
|
1306
1313
|
options: optionsToRender,
|
|
1307
1314
|
filteredOptions: navigableItems,
|
|
1308
1315
|
renderOption,
|
|
@@ -1400,11 +1407,20 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1400
1407
|
inputId: id
|
|
1401
1408
|
});
|
|
1402
1409
|
const [inputValue, setInputValue] = useState("");
|
|
1403
|
-
const [isDropdownOpen, setIsDropdownOpen] = useState(
|
|
1410
|
+
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
1404
1411
|
const [navigationPath, setNavigationPath] = useState([]);
|
|
1405
1412
|
const comboboxInputRef = useRef(null);
|
|
1406
1413
|
const internalContainerRef = useRef(null);
|
|
1407
1414
|
const pendingDescentRef = useRef(null);
|
|
1415
|
+
const committedLabelRef = useRef(null);
|
|
1416
|
+
const lastValueRef = useRef(value);
|
|
1417
|
+
useEffect(() => {
|
|
1418
|
+
setIsDropdownOpen(embedded);
|
|
1419
|
+
}, [embedded]);
|
|
1420
|
+
if (lastValueRef.current !== value) {
|
|
1421
|
+
lastValueRef.current = value;
|
|
1422
|
+
committedLabelRef.current = null;
|
|
1423
|
+
}
|
|
1408
1424
|
const portalContainerRef = externalPortalContainerRef || internalContainerRef;
|
|
1409
1425
|
useImperativeHandle(ref, () => ({ ...comboboxInputRef.current }), []);
|
|
1410
1426
|
const isSearching = inputValue.trim() !== "";
|
|
@@ -1491,7 +1507,7 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1491
1507
|
const { isOpen, getToggleButtonProps, getMenuProps, getInputProps, getItemProps, highlightedIndex, setHighlightedIndex, openMenu } = useCombobox({
|
|
1492
1508
|
items: downshiftItems,
|
|
1493
1509
|
itemToString,
|
|
1494
|
-
isOpen: embedded ?
|
|
1510
|
+
isOpen: embedded ? isDropdownOpen : void 0,
|
|
1495
1511
|
selectedItem: isDropdownOpen ? null : selectedNavigableItem,
|
|
1496
1512
|
inputValue,
|
|
1497
1513
|
onInputValueChange({ inputValue: newInputValue }) {
|
|
@@ -1503,12 +1519,13 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1503
1519
|
if (embedded) return;
|
|
1504
1520
|
setIsDropdownOpen(newIsOpen);
|
|
1505
1521
|
if (newIsOpen) {
|
|
1506
|
-
if (selectedOption || value && inputValue === flatOptionsForFallback.find((opt) => opt.value === value)?.label) setInputValue("");
|
|
1507
|
-
} else setInputValue(selectedOption?.label
|
|
1522
|
+
if (selectedOption || committedLabelRef.current != null || value && inputValue === flatOptionsForFallback.find((opt) => opt.value === value)?.label) setInputValue("");
|
|
1523
|
+
} else setInputValue(committedLabelRef.current ?? selectedOption?.label ?? "");
|
|
1508
1524
|
},
|
|
1509
1525
|
onSelectedItemChange: ({ selectedItem: newSelectedItem }) => {
|
|
1510
1526
|
if (newSelectedItem == null || newSelectedItem.kind !== "leaf") return;
|
|
1511
1527
|
const leaf = newSelectedItem.option;
|
|
1528
|
+
committedLabelRef.current = leaf.label;
|
|
1512
1529
|
onChange?.(leaf.value);
|
|
1513
1530
|
setInputValue(leaf.label);
|
|
1514
1531
|
},
|
|
@@ -1564,7 +1581,7 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1564
1581
|
const labelContent = option.labelStickerVariant ? /* @__PURE__ */ jsx(Sticker, {
|
|
1565
1582
|
variant: option.labelStickerVariant,
|
|
1566
1583
|
children: option.label
|
|
1567
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(OptionLabel, {
|
|
1584
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(OptionLabel, {
|
|
1568
1585
|
title: option.label,
|
|
1569
1586
|
$labelStyle: option.PLEASE_DO_NOT_USE_labelFontStyle,
|
|
1570
1587
|
children: option.label
|
|
@@ -1626,7 +1643,7 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1626
1643
|
if (node.nested) {
|
|
1627
1644
|
if (!downshiftItems.some((i) => i.kind === "group" && i.group === node)) return null;
|
|
1628
1645
|
navIndex++;
|
|
1629
|
-
return /* @__PURE__ */ jsx(Fragment
|
|
1646
|
+
return /* @__PURE__ */ jsx(Fragment, { children: renderNestedGroupRow(node, navIndex) }, key);
|
|
1630
1647
|
}
|
|
1631
1648
|
const childNodes = [];
|
|
1632
1649
|
for (let i = 0; i < node.options.length; i++) {
|
|
@@ -1634,7 +1651,7 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1634
1651
|
if (rendered != null) childNodes.push(rendered);
|
|
1635
1652
|
}
|
|
1636
1653
|
if (childNodes.length === 0) return null;
|
|
1637
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
1654
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuHeading, { children: node.label }), childNodes] }, key);
|
|
1638
1655
|
}
|
|
1639
1656
|
if (!downshiftItems.some((i) => i.kind === "leaf" && i.option === node)) return null;
|
|
1640
1657
|
navIndex++;
|
|
@@ -1648,6 +1665,9 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1648
1665
|
]);
|
|
1649
1666
|
const renderOption = useCallback((option, currentIndex) => renderLeaf(option, currentIndex), [renderLeaf]);
|
|
1650
1667
|
const isMenuOpen = isOpen;
|
|
1668
|
+
useLayoutEffect(() => {
|
|
1669
|
+
if (embedded && isMenuOpen && comboboxInputRef.current) comboboxInputRef.current.focus({ preventScroll: true });
|
|
1670
|
+
}, [embedded, isMenuOpen]);
|
|
1651
1671
|
const dropdownPosition = useDropdownPosition(portalContainerRef, isMenuOpen, embedded ? false : portal);
|
|
1652
1672
|
const { isFooterHighlighted, footerActionId, showFooterAction, handleFooterKeyDown } = useComboboxFooterAction({
|
|
1653
1673
|
footerAction,
|
|
@@ -1697,8 +1717,12 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1697
1717
|
onOpenChange?.(isMenuOpen);
|
|
1698
1718
|
}, [isMenuOpen, onOpenChange]);
|
|
1699
1719
|
useEffect(() => {
|
|
1700
|
-
if (!isMenuOpen) setInputValue(selectedOption?.label
|
|
1701
|
-
}, [
|
|
1720
|
+
if (!embedded && !isMenuOpen) setInputValue(committedLabelRef.current ?? selectedOption?.label ?? "");
|
|
1721
|
+
}, [
|
|
1722
|
+
embedded,
|
|
1723
|
+
selectedOption,
|
|
1724
|
+
isMenuOpen
|
|
1725
|
+
]);
|
|
1702
1726
|
useEffect(() => {
|
|
1703
1727
|
if (isMenuOpen && downshiftItems.length > 0 && !isFooterHighlighted) {
|
|
1704
1728
|
if (highlightedIndex === -1 || highlightedIndex >= downshiftItems.length) setHighlightedIndex(0);
|
|
@@ -1710,7 +1734,7 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1710
1734
|
isFooterHighlighted,
|
|
1711
1735
|
setHighlightedIndex
|
|
1712
1736
|
]);
|
|
1713
|
-
const displayValue = isMenuOpen ? inputValue : selectedOption?.label
|
|
1737
|
+
const displayValue = isMenuOpen ? inputValue : committedLabelRef.current ?? selectedOption?.label ?? "";
|
|
1714
1738
|
const hasSticker = !isMenuOpen && selectedOption?.labelStickerVariant;
|
|
1715
1739
|
const InputComponent = hasSticker ? StickerComboboxInput : ComboboxInput;
|
|
1716
1740
|
const showBackRow = isMenuOpen && navigationPath.length > 0 && !isSearching;
|
|
@@ -1803,7 +1827,7 @@ function ComboboxSingleSelectComponent({ size = "md", options, isOptionsLoading,
|
|
|
1803
1827
|
}), /* @__PURE__ */ jsx(SingleSelectScrollableMenuList, {
|
|
1804
1828
|
$embedded: embedded,
|
|
1805
1829
|
tabIndex: -1,
|
|
1806
|
-
children: isMenuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1830
|
+
children: isMenuOpen && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1807
1831
|
showBackRow && /* @__PURE__ */ jsxs(BackRow, {
|
|
1808
1832
|
type: "button",
|
|
1809
1833
|
tabIndex: -1,
|
|
@@ -1860,4 +1884,4 @@ const Combobox = forwardRef(ComboboxComponent);
|
|
|
1860
1884
|
//#endregion
|
|
1861
1885
|
export { CaretButton as n, flattenOptions as r, Combobox as t };
|
|
1862
1886
|
|
|
1863
|
-
//# sourceMappingURL=Combobox-
|
|
1887
|
+
//# sourceMappingURL=Combobox-DhTUY8JT.mjs.map
|