@persona/design-system 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +3 -3
- package/dist/{Action-CnNf5T-l.d.mts → Action-DL3kHI9Z.d.mts} +3 -3
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +3 -3
- package/dist/AdvancedFilterRulesPopover.d.mts +3 -3
- package/dist/ArrayValueControl.d.mts +1 -1
- package/dist/Attribute.d.mts +5 -5
- package/dist/AttributeGrid.d.mts +1 -1
- package/dist/{Badge-BqS6Nk4J.mjs → Badge-BL0J5oMa.mjs} +3 -3
- package/dist/{Badge-BqS6Nk4J.mjs.map → Badge-BL0J5oMa.mjs.map} +1 -1
- package/dist/Banner.d.mts +1 -1
- package/dist/BooleanValueControl.d.mts +1 -1
- package/dist/{Breadcrumb-DEwZFJHF.d.mts → Breadcrumb-Czgdi0xf.d.mts} +1 -1
- package/dist/Breadcrumb.d.mts +1 -1
- package/dist/{Breadcrumbs-CqKtnZqu.mjs → Breadcrumbs-ed4wRDS7.mjs} +12 -12
- package/dist/{Breadcrumbs-CqKtnZqu.mjs.map → Breadcrumbs-ed4wRDS7.mjs.map} +1 -1
- package/dist/{Breadcrumbs-0e_3v9FF.d.mts → Breadcrumbs-zei-cpdU.d.mts} +2 -2
- package/dist/Breadcrumbs.d.mts +1 -1
- package/dist/{Button-C0F0F2IL.d.mts → Button-CKzNTpPL.d.mts} +4 -4
- package/dist/Button.d.mts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/{Calendar-BvLNcHQM.d.mts → Calendar-CcxN7y3e.d.mts} +2 -2
- package/dist/Calendar.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-BMCB9eFC.mjs → Card-CKrJtn1f.mjs} +4 -4
- package/dist/{Card-BMCB9eFC.mjs.map → Card-CKrJtn1f.mjs.map} +1 -1
- package/dist/{Card-BxNoIQWw.d.mts → Card-pr4FQWjn.d.mts} +4 -4
- package/dist/Card.d.mts +1 -1
- package/dist/Card2.d.mts +3 -3
- package/dist/{CardV2-B0ZweQYk.mjs → CardV2-D3m5EKlp.mjs} +19 -19
- package/dist/{CardV2-B0ZweQYk.mjs.map → CardV2-D3m5EKlp.mjs.map} +1 -1
- package/dist/{Checkbox-Bm8exUfH.d.mts → Checkbox-Bmm-r5ei.d.mts} +1 -1
- package/dist/{Checkbox-DAvbgZgO.mjs → Checkbox-Ccuicmlo.mjs} +8 -8
- package/dist/{Checkbox-DAvbgZgO.mjs.map → Checkbox-Ccuicmlo.mjs.map} +1 -1
- package/dist/Checkbox.d.mts +1 -1
- package/dist/CheckboxGroupField.d.mts +2 -2
- package/dist/ChoicesValueControl.d.mts +1 -1
- package/dist/{Combobox-xBrxiUAu.mjs → Combobox-BGRyr_-L.mjs} +22 -22
- package/dist/Combobox-BGRyr_-L.mjs.map +1 -0
- package/dist/{Combobox-C8ue0cBP.d.mts → Combobox-Bf_Xe1BG.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-DJGTMf1_.d.mts → ComboboxBase-CWzN8GML.d.mts} +8 -8
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-D7A2bbWU.d.mts → ComboboxMultiSelect-iSuvyOx2.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-D1uzEyKj.d.mts → ComboboxSingleSelect-DVRFKPi1.d.mts} +4 -4
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-DMuvqaV5.d.mts → CompactBar-C_61pgp7.d.mts} +3 -3
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ConfigFormGroup-D2_sajXe.mjs → ConfigFormGroup-DGCTW3by.mjs} +4 -4
- package/dist/{ConfigFormGroup-D2_sajXe.mjs.map → ConfigFormGroup-DGCTW3by.mjs.map} +1 -1
- package/dist/{ControlBar-Dg8JeU8f.d.mts → ControlBar-0XwbM4yC.d.mts} +2 -2
- package/dist/ControlBar.d.mts +1 -1
- package/dist/DataTable.d.mts +4 -4
- package/dist/{DateField-Com9f2-j.d.mts → DateField-CKeSIhGy.d.mts} +2 -2
- package/dist/DateField.d.mts +1 -1
- package/dist/{DatePicker-BGO6doLx.d.mts → DatePicker-B1iWrqR5.d.mts} +2 -2
- package/dist/{DatePicker-BlnE2MBD.mjs → DatePicker-BNnZ6L1y.mjs} +29 -12
- package/dist/DatePicker-BNnZ6L1y.mjs.map +1 -0
- package/dist/DatePicker.d.mts +1 -1
- package/dist/{DateRangePicker-DfRBm9z4.d.mts → DateRangePicker-BmF9eH9R.d.mts} +2 -2
- package/dist/DateRangePicker.d.mts +1 -1
- package/dist/DateRangeValueControl.d.mts +2 -2
- package/dist/DateValueControl.d.mts +1 -1
- package/dist/{DropdownButton-CpWNRUma.mjs → DropdownButton-BlVeFbJ0.mjs} +3 -3
- package/dist/{DropdownButton-CpWNRUma.mjs.map → DropdownButton-BlVeFbJ0.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-BCyV8nC0.mjs → DropdownMenu-82xH1AZr.mjs} +4 -4
- package/dist/{DropdownMenu-BCyV8nC0.mjs.map → DropdownMenu-82xH1AZr.mjs.map} +1 -1
- package/dist/{DropdownMenu-CnaK78rP.d.mts → DropdownMenu-DuTnq9j7.d.mts} +3 -3
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-CN2XjaOX.d.mts → ErrorProps-DX50vo-U.d.mts} +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/{FieldRegistry-DdA63Vnh.d.mts → FieldRegistry-D1vghSC_.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-CxNsBVrn.d.mts → FilterBar-Ck085Dic.d.mts} +4 -4
- package/dist/FilterBar.d.mts +1 -1
- package/dist/FilterPickerMenu.d.mts +3 -3
- package/dist/FilterPill.d.mts +1 -1
- package/dist/FilterPopover.d.mts +2 -2
- package/dist/FloatValueControl.d.mts +1 -1
- package/dist/FloatingPanel.d.mts +1 -1
- package/dist/FloatingPanelContext.d.mts +1 -1
- package/dist/{FormControl-Doj2gvF0.d.mts → FormControl-CfpwZGlD.d.mts} +4 -4
- package/dist/{FormControl-HVzZEqJH.mjs → FormControl-D1HIqDKm.mjs} +6 -6
- package/dist/{FormControl-HVzZEqJH.mjs.map → FormControl-D1HIqDKm.mjs.map} +1 -1
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +2 -2
- package/dist/{FormField-D8dHbqZZ.d.mts → FormField-0p4y0sS5.d.mts} +2 -2
- package/dist/{FormField-B9P3BWvS.mjs → FormField-CVnbsNvU.mjs} +22 -22
- package/dist/FormField-CVnbsNvU.mjs.map +1 -0
- package/dist/FormField.d.mts +1 -1
- package/dist/{Header-CBlB65NY.d.mts → Header-gDUTQgWj.d.mts} +2 -2
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-C28h1zFl.d.mts → HelperTooltip-CqhiRb5g.d.mts} +3 -3
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/{HoverCopyableField-0Bzygbp9.mjs → HoverCopyableField-HWshrU_1.mjs} +31 -20
- package/dist/HoverCopyableField-HWshrU_1.mjs.map +1 -0
- package/dist/HoverCopyableField.d.mts +15 -4
- package/dist/{IconButton-BfDlic2K.mjs → IconButton-BgL3QUVO.mjs} +9 -9
- package/dist/{IconButton-BfDlic2K.mjs.map → IconButton-BgL3QUVO.mjs.map} +1 -1
- package/dist/{IconButton-CBcW7ZU8.d.mts → IconButton-CLsHdYm7.d.mts} +2 -2
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.mts +2 -2
- package/dist/InlineCombobox.d.mts +2 -2
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Input-CVdjkX88.d.mts → Input-BHHWpSKN.d.mts} +6 -6
- package/dist/{Input-Bimw8KFj.mjs → Input-DoB8YswA.mjs} +6 -6
- package/dist/{Input-Bimw8KFj.mjs.map → Input-DoB8YswA.mjs.map} +1 -1
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-BwKkmImn.d.mts → InputProps-sHxlDiss.d.mts} +2 -2
- package/dist/InputProps.d.mts +1 -1
- package/dist/IntegerValueControl.d.mts +1 -1
- package/dist/LayoutLoadingSpinner.d.mts +11 -0
- package/dist/Link.d.mts +3 -3
- package/dist/{ListBox-DKZpGYjo.mjs → ListBox-B9uuMt2R.mjs} +15 -15
- package/dist/{ListBox-DKZpGYjo.mjs.map → ListBox-B9uuMt2R.mjs.map} +1 -1
- package/dist/{ListBox-CDl5oZPX.d.mts → ListBox-BrY1bQ5-.d.mts} +5 -5
- package/dist/ListBox.d.mts +1 -1
- package/dist/ListBoxField.d.mts +3 -3
- package/dist/{LoadingShimmer-DC2vqicd.mjs → LoadingShimmer-dsBWRdTU.mjs} +2 -2
- package/dist/{LoadingShimmer-DC2vqicd.mjs.map → LoadingShimmer-dsBWRdTU.mjs.map} +1 -1
- package/dist/LoadingShimmer.d.mts +2 -2
- package/dist/{LogicRow-CkbyvrUw.d.mts → LogicRow-9a_klV2v.d.mts} +4 -4
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +2 -2
- package/dist/MatchHighlight.d.mts +1 -1
- package/dist/{Menu-Dir03WA9.mjs → Menu-CHbUf9PQ.mjs} +6 -6
- package/dist/{Menu-Dir03WA9.mjs.map → Menu-CHbUf9PQ.mjs.map} +1 -1
- package/dist/{Menu-CYRdEnfo.d.mts → Menu-D4Y_J-QI.d.mts} +4 -4
- package/dist/Menu.d.mts +1 -1
- package/dist/{MiddleTruncatedText-GXI-CPvs.mjs → MiddleTruncatedText-DnF7F_1D.mjs} +4 -4
- package/dist/{MiddleTruncatedText-GXI-CPvs.mjs.map → MiddleTruncatedText-DnF7F_1D.mjs.map} +1 -1
- package/dist/Modal.d.mts +4 -5
- package/dist/{PageHeader-C2IUKhCg.mjs → PageHeader-XxGsFLHb.mjs} +4 -4
- package/dist/{PageHeader-C2IUKhCg.mjs.map → PageHeader-XxGsFLHb.mjs.map} +1 -1
- package/dist/PageHeader.d.mts +2 -2
- package/dist/PageLayout.d.mts +1 -1
- package/dist/{PageSelector-vay4jpMp.d.mts → PageSelector-BDo3ge1E.d.mts} +3 -3
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-ygLutOst.d.mts → Pagination-Dcmv7bVe.d.mts} +2 -2
- package/dist/{Pagination-0VhVdXv0.mjs → Pagination-DvVKQLdC.mjs} +8 -8
- package/dist/{Pagination-0VhVdXv0.mjs.map → Pagination-DvVKQLdC.mjs.map} +1 -1
- package/dist/Pagination.d.mts +1 -1
- package/dist/{Pii-C7pA72Bh.mjs → Pii-BD48BtZ0.mjs} +2 -2
- package/dist/{Pii-C7pA72Bh.mjs.map → Pii-BD48BtZ0.mjs.map} +1 -1
- package/dist/Pii.d.mts +1 -1
- package/dist/PillShell.d.mts +1 -1
- package/dist/{Popover-BkDpDdaO.mjs → Popover-DNH8Jx1-.mjs} +6 -6
- package/dist/{Popover-BkDpDdaO.mjs.map → Popover-DNH8Jx1-.mjs.map} +1 -1
- package/dist/Popover.d.mts +1 -1
- package/dist/ProgressBar.d.mts +1 -1
- package/dist/ProgressIndicator.d.mts +1 -1
- package/dist/{PseudoClassProps-CcSlKNev.d.mts → PseudoClassProps-DgT5G_z5.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-BaFutxgV.mjs → Radio-DSMPX5_2.mjs} +5 -5
- package/dist/{Radio-BaFutxgV.mjs.map → Radio-DSMPX5_2.mjs.map} +1 -1
- package/dist/{RadioGroup-ClMzOZl0.mjs → RadioGroup-D5IITQLz.mjs} +4 -4
- package/dist/{RadioGroup-ClMzOZl0.mjs.map → RadioGroup-D5IITQLz.mjs.map} +1 -1
- package/dist/{RadioGroup-BuJaitgG.d.mts → RadioGroup-Jl1yAvGu.d.mts} +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/RangeCalendar.d.mts +1 -1
- package/dist/RangeCalendarPresets.d.mts +1 -1
- package/dist/RuleEditorFields.d.mts +3 -3
- package/dist/RulesPill.d.mts +1 -1
- package/dist/{SearchInput-Ca3_np5e.d.mts → SearchInput-CaKHRC_s.d.mts} +3 -3
- package/dist/SearchInput.d.mts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-DgyJL4uN.mjs → SegmentedControl-JUgRw_M-.mjs} +5 -5
- package/dist/{SegmentedControl-DgyJL4uN.mjs.map → SegmentedControl-JUgRw_M-.mjs.map} +1 -1
- package/dist/{SegmentedControl-_I4sWeD7.d.mts → SegmentedControl-e6xDtoHC.d.mts} +2 -2
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-vwXGlHuW.d.mts → Select-CPYztD4m.d.mts} +4 -4
- package/dist/{Select-D6MqSYVa.mjs → Select-DX3toj6M.mjs} +12 -12
- package/dist/{Select-D6MqSYVa.mjs.map → Select-DX3toj6M.mjs.map} +1 -1
- package/dist/Select.d.mts +1 -1
- package/dist/Slider.d.mts +1 -1
- package/dist/SliderRHF.d.mts +1 -1
- package/dist/SliderThumb.d.mts +1 -1
- package/dist/{Spacer-CJp0lwkL.mjs → Spacer-BsK8tTwA.mjs} +2 -2
- package/dist/{Spacer-CJp0lwkL.mjs.map → Spacer-BsK8tTwA.mjs.map} +1 -1
- package/dist/{Spinner-BgBCCHGo.mjs → Spinner-D3wXIoXN.mjs} +3 -3
- package/dist/{Spinner-BgBCCHGo.mjs.map → Spinner-D3wXIoXN.mjs.map} +1 -1
- package/dist/{Stack-Bl54WmhY.mjs → Stack-Bre2oiov.mjs} +2 -2
- package/dist/{Stack-Bl54WmhY.mjs.map → Stack-Bre2oiov.mjs.map} +1 -1
- package/dist/{Stack-CkV7k7TE.d.mts → Stack-DHaK1-dw.d.mts} +2 -2
- package/dist/Stack.d.mts +1 -1
- package/dist/StatusIndicator.d.mts +1 -1
- package/dist/{Sticker-xtDMuOoN.mjs → Sticker-CQ6sOKUj.mjs} +6 -6
- package/dist/{Sticker-xtDMuOoN.mjs.map → Sticker-CQ6sOKUj.mjs.map} +1 -1
- package/dist/{Sticker-Dhx2wqTL.d.mts → Sticker-DnSemOcW.d.mts} +6 -6
- package/dist/Sticker.d.mts +1 -1
- package/dist/StringValueControl.d.mts +1 -1
- package/dist/SwatchPicker.d.mts +1 -1
- package/dist/Tab.d.mts +3 -3
- package/dist/{TabBar-D6UocZXi.mjs → TabBar-sYllYizt.mjs} +7 -7
- package/dist/{TabBar-D6UocZXi.mjs.map → TabBar-sYllYizt.mjs.map} +1 -1
- package/dist/TabBarIconButton.d.mts +2 -2
- package/dist/{Table-D1WyUQuv.mjs → Table-C2pkP5Xg.mjs} +8 -8
- package/dist/{Table-D1WyUQuv.mjs.map → Table-C2pkP5Xg.mjs.map} +1 -1
- package/dist/{Table-cO7ZwGPM.d.mts → Table-CFbPINKr.d.mts} +1 -1
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-CirMgfAV.d.mts → TableBody-BQsGc4Lw.d.mts} +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/{TableBox-C5qWhr82.mjs → TableBox-CaTHcR4F.mjs} +16 -16
- package/dist/{TableBox-C5qWhr82.mjs.map → TableBox-CaTHcR4F.mjs.map} +1 -1
- package/dist/TableBox.d.mts +2 -2
- package/dist/{TableBoxCell-DmVX_tgn.d.mts → TableBoxCell-52g97gEg.d.mts} +8 -8
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/TableBoxField.d.mts +4 -4
- package/dist/{TableBoxRow-nwq41Bpi.d.mts → TableBoxRow-DnoumHIE.d.mts} +4 -4
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-B4_ojiQo.d.mts → TableBoxRowActions-CDcREhP4.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/TableCell.d.mts +1 -1
- package/dist/{TableControls-CZ9iu3ma.mjs → TableControls-3bXyd8gS.mjs} +104 -79
- package/dist/TableControls-3bXyd8gS.mjs.map +1 -0
- package/dist/{TableControls-RwIPBxyU.d.mts → TableControls-CrGGlkEG.d.mts} +5 -9
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-D_SBFZN1.d.mts → TableControlsContext-BKZt2Jid.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableHead-DMq_q_W0.d.mts → TableHead-CqVIJfjh.d.mts} +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-C2pqXBYO.d.mts → TableHeaderCell-DK4R8vdK.d.mts} +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-DQKu6Rcj.d.mts → TableLayout-BcIazRB-.d.mts} +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-CPqZ8DK3.d.mts → TableRow-DdJcjG2b.d.mts} +2 -2
- package/dist/TableRow.d.mts +1 -1
- package/dist/TableTH.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-BYPh4dIP.d.mts → TableViewConfigurationDropdown-CHBOjw7O.d.mts} +5 -3
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{TechnicalSticker-DTjg6d2F.mjs → TechnicalSticker-D3eeGMDR.mjs} +6 -6
- package/dist/{TechnicalSticker-DTjg6d2F.mjs.map → TechnicalSticker-D3eeGMDR.mjs.map} +1 -1
- package/dist/TechnicalSticker.d.mts +1 -1
- package/dist/{Text-RcEfNFLx.mjs → Text-B0orb-cZ.mjs} +2 -2
- package/dist/{Text-RcEfNFLx.mjs.map → Text-B0orb-cZ.mjs.map} +1 -1
- package/dist/{Text-CfIFUyHt.d.mts → Text-BIgrwIdS.d.mts} +4 -4
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-DhPBI_1-.d.mts → TextArea-CiLttt0s.d.mts} +2 -2
- package/dist/{TextArea-ZMgbE_Lh.mjs → TextArea-DWXuV2aZ.mjs} +4 -4
- package/dist/{TextArea-ZMgbE_Lh.mjs.map → TextArea-DWXuV2aZ.mjs.map} +1 -1
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-BzmmiJlC.d.mts → TextUnderlineTooltip-_7mIrZ2-.d.mts} +3 -3
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.mts +2 -2
- package/dist/Toast.d.mts +1 -1
- package/dist/{Toggle-BGGQ4Ukl.d.mts → Toggle-Cav7bMxg.d.mts} +1 -1
- package/dist/{Toggle-BPgfSjuu.mjs → Toggle-e8DCYa6i.mjs} +7 -7
- package/dist/{Toggle-BPgfSjuu.mjs.map → Toggle-e8DCYa6i.mjs.map} +1 -1
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-D_a-RwAN.d.mts → Tooltip-DX-N-szt.d.mts} +3 -3
- package/dist/{Tooltip-BvDbmXak.mjs → Tooltip-iJcfJqxn.mjs} +5 -5
- package/dist/{Tooltip-BvDbmXak.mjs.map → Tooltip-iJcfJqxn.mjs.map} +1 -1
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-BJnowVTx.d.mts → TruncatedText-D2R7uy_y.d.mts} +2 -2
- package/dist/components/Attribute/index.mjs +7 -7
- package/dist/components/Attribute/index.mjs.map +1 -1
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Banner/index.mjs +3 -3
- package/dist/components/Breadcrumbs/index.d.mts +1 -1
- package/dist/components/Breadcrumbs/index.mjs +1 -1
- package/dist/components/Button/index.d.mts +2 -2
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/ButtonGroup/index.mjs +4 -4
- package/dist/components/Card/index.d.mts +2 -2
- package/dist/components/Card/index.mjs +1 -1
- package/dist/components/CardV2/index.d.mts +1 -1
- package/dist/components/CardV2/index.mjs +1 -1
- package/dist/components/Checkbox/index.d.mts +1 -1
- package/dist/components/Checkbox/index.mjs +1 -1
- package/dist/components/Combobox/index.d.mts +2 -2
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/ConfigFormGroup/index.mjs +2 -2
- package/dist/components/DataTable/TableControls/index.d.mts +15 -15
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.mjs +25 -25
- package/dist/components/DataTable/index.mjs.map +1 -1
- package/dist/components/DataTable/types.d.mts +2 -2
- package/dist/components/DatePicker/index.d.mts +4 -4
- package/dist/components/DatePicker/index.mjs +1 -1
- package/dist/components/DropdownButton/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/DropdownMenu/index.mjs +1 -1
- package/dist/components/FloatingPanel/index.mjs +8 -8
- package/dist/components/FloatingPanel/index.mjs.map +1 -1
- package/dist/components/FormControl/index.d.mts +2 -2
- package/dist/components/FormControl/index.mjs +2 -2
- package/dist/components/FormField/index.d.mts +1 -1
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/HoverCopyableField/index.d.mts +2 -2
- package/dist/components/HoverCopyableField/index.mjs +2 -2
- package/dist/components/ImageTile/index.mjs +10 -10
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Link/index.mjs +4 -4
- package/dist/components/Link/index.mjs.map +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/LoadingShimmer/index.mjs +1 -1
- package/dist/components/MaskedInput/index.mjs +2 -2
- package/dist/components/MatchHighlight/index.mjs +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Menu/index.mjs +1 -1
- package/dist/components/Modal/index.mjs +42 -12
- package/dist/components/Modal/index.mjs.map +1 -1
- package/dist/components/PageHeader/index.mjs +1 -1
- package/dist/components/Pagination/index.d.mts +3 -3
- package/dist/components/Pagination/index.mjs +1 -1
- package/dist/components/Pii/index.mjs +1 -1
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/ProgressBar/index.mjs +2 -2
- package/dist/components/ProgressIndicator/index.mjs +2 -2
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.d.mts +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/SegmentedControl/index.d.mts +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Slider/index.mjs +4 -4
- package/dist/components/Spacer/index.mjs +1 -1
- package/dist/components/Spinner/index.mjs +1 -1
- package/dist/components/Stack/index.d.mts +1 -1
- package/dist/components/Stack/index.mjs +1 -1
- package/dist/components/StatusIndicator/index.mjs +2 -2
- package/dist/components/Sticker/index.d.mts +1 -1
- package/dist/components/Sticker/index.mjs +1 -1
- package/dist/components/SwatchPicker/index.mjs +1 -1
- package/dist/components/TabBar/index.mjs +1 -1
- package/dist/components/Table/index.d.mts +7 -7
- package/dist/components/Table/index.mjs +1 -1
- package/dist/components/TableBox/index.d.mts +2 -2
- package/dist/components/TableBox/index.mjs +1 -1
- package/dist/components/TechnicalSticker/index.mjs +1 -1
- package/dist/components/Text/index.d.mts +1 -1
- package/dist/components/Text/index.mjs +1 -1
- package/dist/components/TextArea/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Tile/index.mjs +5 -5
- package/dist/components/Toast/index.mjs +5 -5
- package/dist/components/Toggle/index.d.mts +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/components/Tooltip/index.mjs +1 -1
- package/dist/compound-expression.d.mts +1 -1
- package/dist/{constants-BASogfT_.d.mts → constants-bA9kCzRQ.d.mts} +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/display.d.mts +1 -1
- package/dist/fieldPickerOptions.d.mts +2 -2
- package/dist/{filter-size-context-Bw5F7082.d.mts → filter-size-context-C7injfBh.d.mts} +2 -2
- package/dist/filter-size-context.d.mts +1 -1
- package/dist/helpers.d.mts +1 -1
- package/dist/{index--5Mfhlkj.d.mts → index-BPfK-u7y.d.mts} +2 -2
- package/dist/{index-DiCnyORA.d.mts → index-BxBsQi2S.d.mts} +5 -5
- package/dist/{index-C1bz13uw.d.mts → index-d_fTFuMM.d.mts} +5 -5
- package/dist/index.d.mts +1 -1
- package/dist/index2.d.mts +1 -1
- package/dist/index3.d.mts +3 -3
- package/dist/index4.d.mts +10 -10
- package/dist/{input-CzO-6_1V.d.mts → input-D9FuQmlI.d.mts} +3 -3
- package/dist/inputFields.d.mts +11 -11
- package/dist/{intersperse-yd3oMrQl.mjs → intersperse-CLkblj9A.mjs} +1 -1
- package/dist/{intersperse-yd3oMrQl.mjs.map → intersperse-CLkblj9A.mjs.map} +1 -1
- package/dist/lib/GlobalStyles.mjs +1 -1
- package/dist/lib/HeadlessAriaButton.mjs +1 -1
- package/dist/lib/MiddleTruncatedText.mjs +1 -1
- package/dist/lib/PDSProvider.d.mts +1 -1
- package/dist/lib/PDSProvider.mjs +1 -1
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedText.mjs +2 -2
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.mjs +2 -2
- package/dist/lib/embeddedSurfaceProtocol.d.mts +13 -1
- package/dist/lib/embeddedSurfaceProtocol.mjs +32 -5
- package/dist/lib/embeddedSurfaceProtocol.mjs.map +1 -1
- package/dist/lib/message.d.mts +1 -1
- package/dist/lib/pseudoClass.d.mts +8 -8
- package/dist/lib/useEmbeddedSurface.d.mts +31 -3
- package/dist/lib/useEmbeddedSurface.mjs +118 -13
- package/dist/lib/useEmbeddedSurface.mjs.map +1 -1
- package/dist/{message-Cu84fcqB.d.mts → message-CqKB5mko.d.mts} +1 -1
- package/dist/mixins/focus.d.mts +1 -1
- package/dist/mixins/focus.mjs +1 -1
- package/dist/mixins/hoverable.d.mts +2 -2
- package/dist/mixins/hoverable.mjs +2 -2
- package/dist/mixins/input.d.mts +1 -1
- package/dist/mixins/input.mjs +2 -2
- package/dist/mixins/menuItem.d.mts +2 -2
- package/dist/mixins/menuItem.mjs +1 -1
- package/dist/mixins/print/index.mjs +1 -1
- package/dist/mixins/text.d.mts +1 -1
- package/dist/mixins/text.mjs +1 -1
- package/dist/{operators-CmSqHnTH.d.mts → operators-CgcsYzfy.d.mts} +2 -2
- package/dist/operators.d.mts +1 -1
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +6 -6
- package/dist/patterns/LayoutLoadingSpinner/index.d.mts +2 -0
- package/dist/patterns/LayoutLoadingSpinner/index.mjs +56 -0
- package/dist/patterns/LayoutLoadingSpinner/index.mjs.map +1 -0
- package/dist/patterns/PageLayout/index.mjs +1 -1
- package/dist/styledComponentsInterop-8zScIQyC.mjs +33 -0
- package/dist/styledComponentsInterop-8zScIQyC.mjs.map +1 -0
- package/dist/{text-BaQdW8qa.d.mts → text-xwtyWIbE.d.mts} +1 -1
- package/dist/{theme-D9Y6NOzb.d.mts → theme-Ftogn9Wo.d.mts} +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/{types-DEh_pXgS.d.mts → types-0_9G0kWg.d.mts} +3 -1
- package/dist/{types-NJtAxsU1.d.mts → types-BrNreYUU.d.mts} +2 -2
- package/dist/{types-C-TkDdkG.d.mts → types-D55MZSyx.d.mts} +1 -1
- package/dist/{types-TV9nVfSe.d.mts → types-DVsBRqjZ.d.mts} +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types2.d.mts +1 -1
- package/dist/types3.d.mts +1 -1
- package/dist/types4.d.mts +1 -1
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useFilterStateV2-C4itmN4S.d.mts → useFilterStateV2-D8Q8QKhS.d.mts} +3 -3
- package/dist/useFilterStateV2.d.mts +1 -1
- package/dist/{useFormField-B2U4GOH4.d.mts → useFormField-BBbq1izo.d.mts} +2 -2
- package/dist/{useFormField-eftOPiXj.mjs → useFormField-Bz2iMPBO.mjs} +2 -2
- package/dist/{useFormField-eftOPiXj.mjs.map → useFormField-Bz2iMPBO.mjs.map} +1 -1
- package/dist/useFormField.d.mts +1 -1
- package/dist/{useFormGroup-BMukAMAd.mjs → useFormGroup-CaTiD_Yt.mjs} +1 -1
- package/dist/{useFormGroup-BMukAMAd.mjs.map → useFormGroup-CaTiD_Yt.mjs.map} +1 -1
- package/dist/{useTableBoxDragAndDrop-CpemHLhL.d.mts → useTableBoxDragAndDrop-Bye8gJTl.d.mts} +1 -1
- package/dist/useTableBoxDragAndDrop.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/{utilities-DnSIlR1i.d.mts → utilities-Bmwk_DRn.d.mts} +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utils/storybook.mjs +1 -1
- package/dist/utils/testing.d.mts +1 -1
- package/dist/utils/testing.mjs +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils2.d.mts +12 -1
- package/dist/{validation-B5IXsdkE.d.mts → validation-CAtTuHO9.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/{value-control-resolver-BPlTeIX7.d.mts → value-control-resolver-DadI8r9a.d.mts} +2 -2
- package/dist/value-control-resolver.d.mts +1 -1
- package/dist/variables/keyframes.mjs +1 -1
- package/llms.txt +4 -4
- package/package.json +4 -2
- package/skills/ui-authoring/COMPONENTS.md +69 -305
- package/skills/ui-authoring/PATTERNS.md +362 -0
- package/skills/ui-authoring/SKILL.md +15 -147
- package/skills/ui-authoring/TOKENS.md +400 -0
- package/dist/Combobox-xBrxiUAu.mjs.map +0 -1
- package/dist/DatePicker-BlnE2MBD.mjs.map +0 -1
- package/dist/FormField-B9P3BWvS.mjs.map +0 -1
- package/dist/HoverCopyableField-0Bzygbp9.mjs.map +0 -1
- package/dist/TableControls-CZ9iu3ma.mjs.map +0 -1
- package/skills/ui-authoring/EXAMPLES.md +0 -370
- package/skills/ui-authoring/REFERENCE.md +0 -293
- /package/dist/{index-7rWKHdox.d.mts → index-0-W_aPej.d.mts} +0 -0
- /package/dist/{index-BMBcfD_R.d.mts → index-7in8TPrM.d.mts} +0 -0
- /package/dist/{index-BOn0AAue.d.mts → index-BINnViIh.d.mts} +0 -0
- /package/dist/{index-BYd3Btr1.d.mts → index-BNRXMhlr.d.mts} +0 -0
- /package/dist/{index-CKKoxA9V.d.mts → index-BO_854F2.d.mts} +0 -0
- /package/dist/{index-CNxS4Tlu.d.mts → index-BSVhZrWN.d.mts} +0 -0
- /package/dist/{index-CRo77wc3.d.mts → index-BrGZHEgX.d.mts} +0 -0
- /package/dist/{index-CWB6exYm.d.mts → index-BwAfCVZH2.d.mts} +0 -0
- /package/dist/{index-CtJuGxUp.d.mts → index-CCt0lwyI.d.mts} +0 -0
- /package/dist/{index-CzItj62a.d.mts → index-CDGG7lCB.d.mts} +0 -0
- /package/dist/{index-D4DUvwPf.d.mts → index-CFhUdAHM.d.mts} +0 -0
- /package/dist/{index-D5tSVhTd.d.mts → index-CREkvfw9.d.mts} +0 -0
- /package/dist/{index-DGsJdI5l.d.mts → index-CROz1VSV.d.mts} +0 -0
- /package/dist/{index-DkrC-i1D.d.mts → index-CzUpNo0e.d.mts} +0 -0
- /package/dist/{index-DztUdPP_.d.mts → index-DA6_cwf8.d.mts} +0 -0
- /package/dist/{index-Es5nKSSL.d.mts → index-DM6vVDZD.d.mts} +0 -0
- /package/dist/{index-FtE8MXJ_.d.mts → index-DeVKzGce.d.mts} +0 -0
- /package/dist/{index-IE5cwTAE2.d.mts → index-Jh0C5PIG.d.mts} +0 -0
- /package/dist/{index-e6k85DKM.d.mts → index-PWQavSPf.d.mts} +0 -0
- /package/dist/{index-ehD5GjMH.d.mts → index-sViox9YW.d.mts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FormControlProps, l as HelperText, n as ErrorText, s as FormLabel, u as WarningText } from "./FormControl-
|
|
1
|
+
import { a as FormControlProps, l as HelperText, n as ErrorText, s as FormLabel, u as WarningText } from "./FormControl-CfpwZGlD.mjs";
|
|
2
2
|
import * as _$react from "react";
|
|
3
3
|
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
4
4
|
|
|
@@ -66,4 +66,4 @@ interface FormFieldProps extends Omit<FormControlProps, 'children'>, FormFieldBa
|
|
|
66
66
|
declare const FormField: _$react.ForwardRefExoticComponent<FormFieldProps & _$react.RefAttributes<HTMLDivElement>>;
|
|
67
67
|
//#endregion
|
|
68
68
|
export { FormFieldBaseProps as n, FormFieldProps as r, FormField as t };
|
|
69
|
-
//# sourceMappingURL=FormField-
|
|
69
|
+
//# sourceMappingURL=FormField-0p4y0sS5.d.mts.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { t as HStack } from "./Stack-
|
|
2
|
-
import { t as IconButton } from "./IconButton-
|
|
3
|
-
import { n as useFormGroup } from "./useFormGroup-
|
|
4
|
-
import { t as FormControlContext } from "./useFormField-
|
|
1
|
+
import { t as HStack } from "./Stack-Bre2oiov.mjs";
|
|
2
|
+
import { t as IconButton } from "./IconButton-BgL3QUVO.mjs";
|
|
3
|
+
import { n as useFormGroup } from "./useFormGroup-CaTiD_Yt.mjs";
|
|
4
|
+
import { t as FormControlContext } from "./useFormField-Bz2iMPBO.mjs";
|
|
5
5
|
import Input_default from "./components/Input/index.mjs";
|
|
6
|
-
import { n as DropdownMenu_default } from "./DropdownMenu-
|
|
7
|
-
import { t as Checkbox } from "./Checkbox-
|
|
8
|
-
import { t as Combobox } from "./Combobox-
|
|
9
|
-
import { n as Select } from "./Select-
|
|
10
|
-
import { t as Toggle } from "./Toggle-
|
|
11
|
-
import { a as FormLabel, i as FormInputContainer, n as ErrorText, o as HelperText, r as FormControl, s as WarningText } from "./FormControl-
|
|
12
|
-
import { t as ListBox } from "./ListBox-
|
|
13
|
-
import { t as RadioGroup } from "./RadioGroup-
|
|
14
|
-
import { t as SegmentedControl } from "./SegmentedControl-
|
|
15
|
-
import { t as TextAreaWithStyle } from "./TextArea-
|
|
16
|
-
import { t as TableBox } from "./TableBox-
|
|
6
|
+
import { n as DropdownMenu_default } from "./DropdownMenu-82xH1AZr.mjs";
|
|
7
|
+
import { t as Checkbox } from "./Checkbox-Ccuicmlo.mjs";
|
|
8
|
+
import { t as Combobox } from "./Combobox-BGRyr_-L.mjs";
|
|
9
|
+
import { n as Select } from "./Select-DX3toj6M.mjs";
|
|
10
|
+
import { t as Toggle } from "./Toggle-e8DCYa6i.mjs";
|
|
11
|
+
import { a as FormLabel, i as FormInputContainer, n as ErrorText, o as HelperText, r as FormControl, s as WarningText } from "./FormControl-D1HIqDKm.mjs";
|
|
12
|
+
import { t as ListBox } from "./ListBox-B9uuMt2R.mjs";
|
|
13
|
+
import { t as RadioGroup } from "./RadioGroup-D5IITQLz.mjs";
|
|
14
|
+
import { t as SegmentedControl } from "./SegmentedControl-JUgRw_M-.mjs";
|
|
15
|
+
import { t as TextAreaWithStyle } from "./TextArea-DWXuV2aZ.mjs";
|
|
16
|
+
import { t as TableBox } from "./TableBox-CaTHcR4F.mjs";
|
|
17
17
|
import { Spacing } from "@persona/design-tokens";
|
|
18
|
-
import { Fragment,
|
|
19
|
-
import {
|
|
18
|
+
import { Children, Fragment, cloneElement, createContext, forwardRef, useContext, useMemo, useRef, useState } from "react";
|
|
19
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
20
20
|
import { MoreIcon, PlusIcon } from "@persona/icons";
|
|
21
21
|
import { uniqueId } from "lodash-es";
|
|
22
22
|
import { mergeProps, useCheckboxGroup, useCheckboxGroupItem } from "react-aria";
|
|
@@ -318,7 +318,7 @@ const ListBoxField = ({ label, helperText, errorText, warningText, labelProps, h
|
|
|
318
318
|
warningProps,
|
|
319
319
|
inputId,
|
|
320
320
|
configField,
|
|
321
|
-
rightActions: configField && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
321
|
+
rightActions: configField && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
322
322
|
menuActions.length > 0 && /* @__PURE__ */ jsx(DropdownMenu_default, {
|
|
323
323
|
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
324
324
|
"aria-label": "Actions",
|
|
@@ -406,7 +406,7 @@ const TableBoxField = ({ label, helperText, errorText, warningText, labelProps:
|
|
|
406
406
|
errorProps,
|
|
407
407
|
warningProps,
|
|
408
408
|
inputId,
|
|
409
|
-
rightActions: configField && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
409
|
+
rightActions: configField && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
410
410
|
visibleMenuActions.length > 0 && /* @__PURE__ */ jsx(DropdownMenu_default, {
|
|
411
411
|
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
412
412
|
"aria-label": "Actions",
|
|
@@ -417,7 +417,7 @@ const TableBoxField = ({ label, helperText, errorText, warningText, labelProps:
|
|
|
417
417
|
portal: true,
|
|
418
418
|
children: visibleMenuActions.map((entry, entryIndex) => {
|
|
419
419
|
const previousEntry = visibleMenuActions[entryIndex - 1];
|
|
420
|
-
if (isActionGroup(entry)) return /* @__PURE__ */ jsxs(Fragment
|
|
420
|
+
if (isActionGroup(entry)) return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
421
421
|
entryIndex > 0 && /* @__PURE__ */ jsx(DropdownMenu_default.Divider, {}),
|
|
422
422
|
/* @__PURE__ */ jsx(DropdownMenu_default.Heading, {
|
|
423
423
|
size: "sm",
|
|
@@ -431,7 +431,7 @@ const TableBoxField = ({ label, helperText, errorText, warningText, labelProps:
|
|
|
431
431
|
children: action.label
|
|
432
432
|
}, action.label))
|
|
433
433
|
] }, `${entry.heading}-${entryIndex}`);
|
|
434
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
434
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [previousEntry && isActionGroup(previousEntry) && /* @__PURE__ */ jsx(DropdownMenu_default.Divider, {}), /* @__PURE__ */ jsx(DropdownMenu_default.Item, {
|
|
435
435
|
...entry,
|
|
436
436
|
disabled: disabled || entry.disabled,
|
|
437
437
|
onClick: () => entry.onClick(selectedKey),
|
|
@@ -474,4 +474,4 @@ TableBoxField.Cell = TableBox.Cell;
|
|
|
474
474
|
//#endregion
|
|
475
475
|
export { CheckboxField as a, SegmentedControlField as c, TextField as d, ToggleField as f, CheckboxGroupField as i, SelectField as l, FormField as m, TableBoxField as n, ComboboxField as o, splitOutFormFieldProps as p, ListBoxField as r, RadioGroupField as s, TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL as t, TextAreaField as u };
|
|
476
476
|
|
|
477
|
-
//# sourceMappingURL=FormField-
|
|
477
|
+
//# sourceMappingURL=FormField-CVnbsNvU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormField-CVnbsNvU.mjs","names":["Input","TextArea","DropdownMenu","DropdownMenu"],"sources":["../components/FormField/FormField.tsx","../components/FormField/inputFields.tsx","../components/FormField/CheckboxGroupField.tsx","../components/FormField/ListBoxField.tsx","../components/FormField/TableBoxField.tsx"],"sourcesContent":["import { type ComponentPropsWithRef, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport { Spacing } from '@persona/design-tokens';\nimport useFormGroup from 'design-system/components/ConfigFormGroup/useFormGroup';\nimport FormControl, {\n ErrorText,\n type FormControlProps,\n FormInputContainer,\n FormLabel,\n HelperText,\n WarningText,\n} from 'design-system/components/FormControl';\nimport { HStack } from 'design-system/components/Stack';\n\nexport interface FormFieldBaseProps {\n /**\n * Renders `<Label>` above input\n */\n label?: ReactNode;\n\n /**\n * ID of the input element. Providing this will automatically link the label to the input.\n */\n inputId?: string;\n\n /**\n * Renders `<HelperText>` below input\n */\n helperText?: ReactNode;\n\n /**\n * Renders `<ErrorText>` below input and helper text.\n */\n errorText?: ReactNode;\n\n /**\n * Renders `<WarningText>` below input and helper text.\n */\n warningText?: ReactNode;\n\n /**\n * Should be an input of some sort\n */\n children?: ReactElement;\n\n labelProps?: ComponentPropsWithRef<typeof FormLabel>;\n helperProps?: ComponentPropsWithRef<typeof HelperText>;\n warningProps?: ComponentPropsWithRef<typeof WarningText>;\n errorProps?: ComponentPropsWithRef<typeof ErrorText>;\n\n /**\n * Whether to render the form field as a config field.\n * This will render the helper text as a tooltip.\n */\n configField?: boolean;\n\n /**\n * Override the width of the input area when `configField` is true.\n * Accepts any valid CSS width value (e.g. `'33%'`, `'66.67%'`).\n * Defaults to `'50%'`.\n */\n configFieldInputWidth?: string;\n\n /**\n * Renders actions to the right of the label.\n */\n rightActions?: ReactNode;\n}\n\nexport interface FormFieldProps extends Omit<FormControlProps, 'children'>, FormFieldBaseProps {}\n\n/**\n * > **Please do not use in production! This component is subject to API and style changes.**\n *\n * Helper components with preset slots for label, input, and helper texts.\n * Fully composed components with different form input types are available.\n * This is the recommended way to implement form elements.\n * You can use `<FormControl>` if you require more flexibility.\n *\n * ## Usage\n *\n * ```tsx\n * import FormField from 'design-system/components/FormField';\n * ```\n */\nexport const FormField = forwardRef<HTMLDivElement, FormFieldProps>(function FormField(\n {\n label,\n children,\n helperText,\n warningText,\n errorText,\n labelProps,\n helperProps,\n warningProps,\n errorProps,\n configField: configFieldProp,\n configFieldInputWidth,\n rightActions,\n ...props\n }: FormFieldProps,\n ref,\n) {\n const { configField: configFieldFormGroup } = useFormGroup();\n const configField = configFieldProp ?? configFieldFormGroup;\n\n const labelElement = label ? (\n <FormLabel tooltip={configField && helperText ? helperText : undefined} {...labelProps}>\n {label}\n </FormLabel>\n ) : null;\n\n return (\n <FormControl\n hasError={!!errorText}\n hasWarning={!!warningText}\n ref={ref}\n configField={configField}\n hasRightActions={!!rightActions}\n configFieldInputWidth={configFieldInputWidth}\n {...props}\n >\n {rightActions ? (\n <HStack justify='space-between' align='center'>\n {labelElement}\n <HStack spacing={Spacing[1]}>{rightActions}</HStack>\n </HStack>\n ) : (\n labelElement\n )}\n <FormInputContainer>{children}</FormInputContainer>\n {!configField && helperText && <HelperText {...helperProps}>{helperText}</HelperText>}\n {!configField && warningText && <WarningText {...warningProps}>{warningText}</WarningText>}\n {!configField && errorText && <ErrorText {...errorProps}>{errorText}</ErrorText>}\n </FormControl>\n );\n});\n\nexport default FormField;\n","import { uniqueId } from 'lodash-es';\nimport { forwardRef, useMemo } from 'react';\n\nimport Checkbox, { type CheckboxProps } from 'design-system/components/Checkbox';\nimport Combobox from 'design-system/components/Combobox';\nimport type { ComboboxMultiSelectProps } from 'design-system/components/Combobox/ComboboxMultiSelect';\nimport type { ComboboxSingleSelectProps } from 'design-system/components/Combobox/ComboboxSingleSelect';\nimport FormField, { type FormFieldBaseProps } from 'design-system/components/FormField/FormField';\nimport Input, { type InputProps } from 'design-system/components/Input';\nimport RadioGroup, { type RadioGroupProps } from 'design-system/components/RadioGroup';\nimport SegmentedControl, {\n type SegmentedControlProps,\n} from 'design-system/components/SegmentedControl';\nimport Select, { type SelectProps } from 'design-system/components/Select';\nimport TextArea, { type TextAreaProps } from 'design-system/components/TextArea';\nimport Toggle, { type ToggleProps } from 'design-system/components/Toggle';\n\nexport type ImplementsFormField = Omit<FormFieldBaseProps, 'children'>;\n\ntype ExtractFormFieldProps<T extends ImplementsFormField> = Pick<\n T,\n | 'label'\n | 'inputId'\n | 'helperText'\n | 'errorText'\n | 'warningText'\n | 'labelProps'\n | 'helperProps'\n | 'warningProps'\n | 'errorProps'\n | 'configField'\n | 'configFieldInputWidth'\n | 'rightActions'\n>;\ntype OmitFormFieldProps<T extends ImplementsFormField> = Omit<T, keyof ExtractFormFieldProps<T>>;\n\n/**\n * Helper to split out props that are sent to the FormField component from props sent\n * to the underlying input component.\n */\nexport const splitOutFormFieldProps = <T extends ImplementsFormField>(\n props: T,\n): {\n formFieldProps: ExtractFormFieldProps<T>;\n inputProps: OmitFormFieldProps<T>;\n} => {\n const {\n label,\n inputId,\n helperText,\n errorText,\n warningText,\n labelProps,\n helperProps,\n warningProps,\n errorProps,\n configField,\n configFieldInputWidth,\n rightActions,\n ...inputProps\n } = props;\n\n return {\n formFieldProps: {\n label,\n inputId,\n helperText,\n errorText,\n warningText,\n labelProps,\n helperProps,\n warningProps,\n errorProps,\n configField,\n configFieldInputWidth,\n rightActions,\n },\n inputProps,\n };\n};\n\nexport interface TextFieldProps extends ImplementsFormField, InputProps {}\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(props, ref) {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n const { id, ...rest } = inputProps;\n\n return (\n <FormField\n {...formFieldProps}\n labelProps={{ size: props.size, ...formFieldProps.labelProps }}\n inputId={formFieldProps.inputId ?? id}\n >\n <Input {...rest} ref={ref} />\n </FormField>\n );\n },\n);\n\nexport interface TextAreaFieldProps extends ImplementsFormField, TextAreaProps {}\n\nexport const TextAreaField = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>(\n function TextAreaField(props, ref) {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n const { id, ...rest } = inputProps;\n\n return (\n <FormField\n {...formFieldProps}\n labelProps={{ size: props.size, ...formFieldProps.labelProps }}\n inputId={formFieldProps.inputId ?? id}\n >\n <TextArea {...rest} ref={ref} />\n </FormField>\n );\n },\n);\n\nexport interface SelectFieldProps extends ImplementsFormField, SelectProps {}\n\nexport const SelectField = ({ id, children, ...props }: SelectFieldProps) => {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n const linkedId = useMemo(\n () => formFieldProps.inputId ?? id ?? uniqueId('pds-form-field-input-fields-select__'),\n [formFieldProps.inputId, id],\n );\n\n return (\n <FormField\n {...formFieldProps}\n inputId={linkedId}\n labelProps={{ htmlFor: linkedId, size: inputProps.size, ...formFieldProps.labelProps }}\n >\n <Select {...inputProps} id={linkedId}>\n {children}\n </Select>\n </FormField>\n );\n};\n\nexport interface RadioGroupFieldProps\n extends Omit<ImplementsFormField, 'configField'>, RadioGroupProps {}\n\nexport const RadioGroupField = ({\n label,\n helperText,\n errorText,\n warningText,\n children,\n ...props\n}: RadioGroupFieldProps) => {\n return (\n <FormField\n label={label}\n helperText={helperText}\n warningText={warningText}\n errorText={errorText}\n >\n <RadioGroup {...props}>{children}</RadioGroup>\n </FormField>\n );\n};\n\nexport interface CheckboxFieldProps extends ImplementsFormField, CheckboxProps {\n checkboxLabel?: CheckboxProps['label'];\n}\n\nexport const CheckboxField = ({\n label,\n helperText,\n errorText,\n warningText,\n checkboxLabel,\n configField,\n labelProps,\n ...props\n}: CheckboxFieldProps) => {\n return (\n <FormField\n label={label}\n helperText={helperText}\n warningText={warningText}\n errorText={errorText}\n configField={configField}\n labelProps={labelProps}\n >\n <Checkbox label={checkboxLabel} {...props} />\n </FormField>\n );\n};\n\nexport interface ToggleFieldProps extends ImplementsFormField, ToggleProps {}\n\nexport const ToggleField = forwardRef<HTMLDivElement, ToggleFieldProps>(\n function ToggleField(props, ref) {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n\n return (\n <FormField\n {...formFieldProps}\n labelProps={{ size: inputProps.size, ...formFieldProps.labelProps }}\n >\n <Toggle {...inputProps} ref={ref} />\n </FormField>\n );\n },\n);\n\nexport interface SegmentedControlFieldProps\n extends ImplementsFormField, Omit<SegmentedControlProps, 'children'> {\n children?: SegmentedControlProps['children'];\n}\n\nexport const SegmentedControlField = forwardRef<HTMLDivElement, SegmentedControlFieldProps>(\n function SegmentedControlField(\n { label, helperText, errorText, warningText, configField, children, labelProps, ...props },\n ref,\n ) {\n return (\n <FormField\n label={label}\n helperText={helperText}\n warningText={warningText}\n errorText={errorText}\n configField={configField}\n labelProps={labelProps}\n >\n <SegmentedControl fullWidth {...props} ref={ref}>\n {children}\n </SegmentedControl>\n </FormField>\n );\n },\n);\n\nexport type ComboboxSingleSelectFieldProps<T = string> = ImplementsFormField &\n ComboboxSingleSelectProps<T>;\nexport type ComboboxMultiSelectFieldProps<T = string> = ImplementsFormField &\n ComboboxMultiSelectProps<T>;\n\nexport const ComboboxField = (\n props: ComboboxSingleSelectFieldProps | ComboboxMultiSelectFieldProps,\n) => {\n // `Combobox` registers its own id with the surrounding `FormControl`, which is what links the\n // label to it, so the field only forwards an explicit `inputId` when one is given. Each mode is\n // split separately: `multiple` discriminates the two, and a union split at once loses that.\n if (props.multiple) {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n\n return (\n <FormField {...formFieldProps}>\n <Combobox {...inputProps} />\n </FormField>\n );\n }\n\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n\n return (\n <FormField {...formFieldProps}>\n <Combobox {...inputProps} />\n </FormField>\n );\n};\n","import {\n Children,\n cloneElement,\n type ComponentPropsWithRef,\n createContext,\n type ReactElement,\n type ReactNode,\n useContext,\n useRef,\n} from 'react';\nimport {\n type AriaCheckboxGroupProps,\n mergeProps,\n useCheckboxGroup,\n useCheckboxGroupItem,\n} from 'react-aria';\nimport innerText from 'react-innertext';\nimport { type CheckboxGroupState, useCheckboxGroupState } from 'react-stately';\n\nimport type { CheckboxProps } from 'design-system/components/Checkbox';\nimport type Checkbox from 'design-system/components/Checkbox';\nimport { FormControlContext } from 'design-system/components/FormControl/useFormField';\nimport FormField from 'design-system/components/FormField/FormField';\nimport type { ImplementsFormField } from 'design-system/components/FormField/inputFields';\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst CheckboxGroupContext = createContext<CheckboxGroupState>(null);\n\n/** Preserves the parent FormControl context (disabled, hasError, etc.) but clears\n * inputId so each Checkbox inside the group generates its own unique id. */\nconst ClearGroupInputId = ({ children }: { children: ReactNode }) => {\n const parentContext = useContext(FormControlContext);\n return (\n <FormControlContext.Provider value={{ ...parentContext, inputId: undefined }}>\n {children}\n </FormControlContext.Provider>\n );\n};\n\ninterface CheckboxGroupItemProps {\n children: ReactElement<ComponentPropsWithRef<typeof Checkbox>>;\n}\n\nconst CheckboxGroupItem = (props: CheckboxGroupItemProps) => {\n const { children } = props;\n const checkboxProps = children.props;\n\n const state = useContext(CheckboxGroupContext);\n const ref = useRef();\n const { inputProps } = useCheckboxGroupItem(\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n {\n ...checkboxProps,\n onChange: undefined,\n isDisabled: checkboxProps.disabled,\n isReadOnly: checkboxProps.readOnly,\n isRequired: checkboxProps.required,\n isIndeterminate: checkboxProps.indeterminate,\n value: String(children.props.value),\n 'aria-label': innerText(checkboxProps.label),\n },\n state,\n ref,\n );\n\n return cloneElement(\n children,\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n mergeProps(inputProps, {\n onChange: checkboxProps.onChange,\n disabled: state.isDisabled || checkboxProps.disabled,\n checked: state.isSelected(String(inputProps.value)),\n ref,\n } as ComponentPropsWithRef<typeof Checkbox>),\n );\n};\n\ninterface CheckboxGroupFieldProps\n extends\n Omit<ImplementsFormField, 'configField'>,\n Omit<\n AriaCheckboxGroupProps,\n 'description' | 'disabled' | 'isReadOnly' | 'isRequired' | 'errorMessage'\n > {\n children?: ReactElement<CheckboxProps>[];\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n}\n\nconst CheckboxGroupField = ({\n children,\n name,\n onChange,\n disabled,\n readOnly,\n required,\n ...props\n}: CheckboxGroupFieldProps) => {\n const reactAriaProps = {\n ...props,\n description: props.helperText,\n errorMessage: props.errorText,\n onChange,\n name,\n isDisabled: disabled,\n isReadOnly: readOnly,\n isRequired: required,\n };\n const state = useCheckboxGroupState(reactAriaProps);\n const { groupProps, labelProps, descriptionProps, errorMessageProps } = useCheckboxGroup(\n reactAriaProps,\n state,\n );\n\n return (\n <FormField\n labelProps={labelProps}\n helperProps={descriptionProps}\n errorProps={errorMessageProps}\n disabled={disabled}\n {...groupProps}\n {...props}\n >\n <ClearGroupInputId>\n <CheckboxGroupContext.Provider value={state}>\n {Children.map(children, (checkbox) => (\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n <CheckboxGroupItem>{checkbox}</CheckboxGroupItem>\n ))}\n </CheckboxGroupContext.Provider>\n </ClearGroupInputId>\n </FormField>\n );\n};\n\nexport default CheckboxGroupField;\n","import { type ReactNode, useState } from 'react';\n\nimport { MoreIcon, PlusIcon } from '@persona/icons';\nimport { IconButton } from 'design-system/components/Button';\nimport useFormGroup from 'design-system/components/ConfigFormGroup/useFormGroup';\nimport DropdownMenu from 'design-system/components/DropdownMenu';\nimport FormField from 'design-system/components/FormField/FormField';\nimport type { ImplementsFormField } from 'design-system/components/FormField/inputFields';\nimport ListBox, { type ListBoxProps } from 'design-system/components/ListBox';\nimport type { MenuItemProps } from 'design-system/components/Menu';\n\ninterface ListBoxFieldAction extends Omit<MenuItemProps, 'children'> {\n label: string;\n onClick: (selectedKeys: ListBoxProps<any>['selectedKeys']) => void;\n}\n\ninterface AddDropdownConfig {\n options: ({ label: ReactNode; value: string } & Omit<MenuItemProps, 'children'>)[];\n onSelection: (value: string) => void;\n}\n\ninterface ListBoxFieldProps<T extends object> extends ImplementsFormField, ListBoxProps<T> {\n actions?: ListBoxFieldAction[];\n addDropdownConfig?: AddDropdownConfig;\n /** Disables the add button, e.g. while the list is read-only. */\n addDisabled?: boolean;\n}\n\nconst ListBoxField = <T extends object>({\n label,\n helperText,\n errorText,\n warningText,\n labelProps,\n helperProps,\n errorProps,\n warningProps,\n inputId,\n onAdd,\n onDelete,\n deleteDisabled,\n configField: configFieldProp,\n size = 'md',\n actions = [],\n addDropdownConfig,\n addDisabled,\n selectedKeys: selectedKeysProp,\n onSelectionChange,\n defaultSelectedKeys,\n ...props\n}: ListBoxFieldProps<T>) => {\n const { configField } = useFormGroup({ configField: configFieldProp });\n const menuActions: ListBoxFieldAction[] = [...actions];\n const [selectedKeysState, setSelectedKeys] = useState(defaultSelectedKeys);\n const selectedKeys = selectedKeysProp ?? selectedKeysState;\n const effectiveSize = configField ? 'sm' : size;\n\n if (onDelete) {\n menuActions.unshift({\n label: 'Delete',\n onClick: () => onDelete(selectedKeys),\n disabled:\n deleteDisabled ||\n selectedKeys == null ||\n (typeof selectedKeys === 'object' && [...selectedKeys].length === 0),\n });\n }\n\n const addButton = (\n <IconButton size='sm' onClick={onAdd} aria-label='Add item to list' disabled={addDisabled}>\n <PlusIcon />\n </IconButton>\n );\n\n return (\n <FormField\n label={label}\n helperText={helperText}\n errorText={errorText}\n warningText={warningText}\n labelProps={labelProps}\n helperProps={helperProps}\n errorProps={errorProps}\n warningProps={warningProps}\n inputId={inputId}\n configField={configField}\n rightActions={\n configField && (\n <>\n {menuActions.length > 0 && (\n <DropdownMenu\n trigger={\n <IconButton aria-label='Actions' size='sm'>\n <MoreIcon />\n </IconButton>\n }\n portal\n >\n {menuActions.map((action) => (\n <DropdownMenu.Item\n key={action.label}\n {...action}\n onClick={() => action.onClick(selectedKeys)}\n size={effectiveSize}\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n {onAdd && !addDropdownConfig && addButton}\n {addDropdownConfig && (\n <DropdownMenu trigger={addButton} align='start' portal>\n {addDropdownConfig.options.map((option) => (\n <DropdownMenu.Item\n key={option.value}\n {...option}\n onClick={() => addDropdownConfig.onSelection(option.value)}\n size={effectiveSize}\n >\n {option.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n </>\n )\n }\n >\n <ListBox\n id={inputId}\n fullWidth={configField}\n size={effectiveSize}\n deleteDisabled={deleteDisabled}\n // We have to control the keys so we can power the `rightActions`\n selectedKeys={selectedKeys}\n onSelectionChange={(keys) => {\n onSelectionChange?.(keys);\n setSelectedKeys(keys);\n }}\n {...props}\n />\n </FormField>\n );\n};\n\nexport default ListBoxField;\n","import { Fragment, type MouseEvent, type ReactNode, useState } from 'react';\n\nimport { IconButton } from '@persona/design-system/components/Button';\nimport { useFormGroup } from '@persona/design-system/components/ConfigFormGroup';\nimport DropdownMenu from '@persona/design-system/components/DropdownMenu';\nimport type { FormLabelProps } from '@persona/design-system/components/FormControl';\nimport type { MenuItemProps } from '@persona/design-system/components/Menu';\nimport TableBox, { type TableBoxProps } from '@persona/design-system/components/TableBox';\nimport { MoreIcon, PlusIcon } from '@persona/icons';\n\nimport FormField from './FormField';\nimport type { ImplementsFormField } from './inputFields';\n\nexport interface TableBoxFieldAction extends Omit<MenuItemProps, 'children'> {\n label: string;\n onClick: (selectedKey: TableBoxProps['selectedKey']) => void;\n}\n\nexport interface TableBoxFieldActionGroup {\n type: 'group';\n heading: string;\n actions: TableBoxFieldAction[];\n}\n\nexport type TableBoxFieldActionEntry = TableBoxFieldAction | TableBoxFieldActionGroup;\n\n/** Aria-label on TableBoxField's + button. Consumers that style or detect that\n * button (e.g. popover toggle guards) should import this rather than redefining it. */\nexport const TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL = 'Add item to table';\n\nconst isActionGroup = (action: TableBoxFieldActionEntry): action is TableBoxFieldActionGroup =>\n 'type' in action && action.type === 'group';\n\ninterface AddDropdownConfig {\n options: Array<{ label: string; value: string }>;\n onSelection: (value: string) => void;\n}\n\ninterface TableBoxFieldProps<T extends object = object>\n extends ImplementsFormField, Omit<TableBoxProps<T>, 'aria-label' | 'onCreateNewRow'> {\n onAdd?: (e: MouseEvent<HTMLButtonElement>) => void;\n onDelete?: (selectedKey: string | null) => void;\n deleteDisabled?: boolean;\n /** Actions and labeled action groups rendered in order. Empty groups are omitted. */\n actions?: TableBoxFieldActionEntry[];\n addDropdownConfig?: AddDropdownConfig;\n\n /**\n * Callback to create a new row and add it to the rows array\n * Should return the id of the newly created row\n */\n createNewRow?: () => string;\n children?: ReactNode;\n}\n\nconst TableBoxField = <T extends object = object>({\n label,\n helperText,\n errorText,\n warningText,\n labelProps: labelPropsProp,\n helperProps,\n errorProps,\n warningProps,\n inputId,\n onAdd,\n onDelete,\n deleteDisabled,\n configField: configFieldProp = true,\n actions = [],\n addDropdownConfig,\n selectedKey: selectedKeyProp,\n onSelectionChange,\n defaultSelectedKey,\n selectionMode,\n disabled,\n createNewRow,\n children,\n emptyText = 'No data',\n ...props\n}: TableBoxFieldProps<T>) => {\n const { configField } = useFormGroup({ configField: configFieldProp });\n const menuActions: TableBoxFieldActionEntry[] = [...actions];\n const [selectedKeyState, setSelectedKey] = useState(defaultSelectedKey);\n const selectedKey = selectedKeyProp ?? selectedKeyState;\n const [newRowId, setNewRowId] = useState<string | null>(null);\n const labelProps: FormLabelProps = { size: 'sm', ...labelPropsProp };\n\n const handleCreateNewRow = () => {\n if (createNewRow) {\n setNewRowId(createNewRow());\n }\n };\n\n // Handle add button click\n const handleAddClick = (e: MouseEvent<HTMLButtonElement>) => {\n if (createNewRow) {\n handleCreateNewRow();\n } else if (onAdd) {\n onAdd(e);\n }\n };\n\n if (onDelete) {\n menuActions.unshift({\n label: 'Delete',\n onClick: () => selectedKey && onDelete(selectedKey),\n disabled: deleteDisabled || selectedKey == null,\n });\n }\n const visibleMenuActions = menuActions.filter(\n (action) => !isActionGroup(action) || action.actions.length > 0,\n );\n\n const addButton = (\n <IconButton\n size='sm'\n onClick={handleAddClick}\n aria-label={TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL}\n disabled={disabled}\n >\n <PlusIcon />\n </IconButton>\n );\n\n return (\n <FormField\n label={label}\n helperText={helperText}\n errorText={errorText}\n warningText={warningText}\n labelProps={labelProps}\n helperProps={helperProps}\n errorProps={errorProps}\n warningProps={warningProps}\n inputId={inputId}\n rightActions={\n configField && (\n <>\n {visibleMenuActions.length > 0 && (\n <DropdownMenu\n trigger={\n <IconButton aria-label='Actions' size='sm' disabled={disabled}>\n <MoreIcon />\n </IconButton>\n }\n portal\n >\n {visibleMenuActions.map((entry, entryIndex) => {\n const previousEntry = visibleMenuActions[entryIndex - 1];\n if (isActionGroup(entry)) {\n return (\n <Fragment key={`${entry.heading}-${entryIndex}`}>\n {entryIndex > 0 && <DropdownMenu.Divider />}\n <DropdownMenu.Heading size='sm'>{entry.heading}</DropdownMenu.Heading>\n {entry.actions.map((action) => (\n <DropdownMenu.Item\n key={action.label}\n {...action}\n disabled={disabled || action.disabled}\n onClick={() => action.onClick(selectedKey)}\n size='sm'\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </Fragment>\n );\n }\n\n return (\n <Fragment key={`${entry.label}-${entryIndex}`}>\n {previousEntry && isActionGroup(previousEntry) && <DropdownMenu.Divider />}\n <DropdownMenu.Item\n {...entry}\n disabled={disabled || entry.disabled}\n onClick={() => entry.onClick(selectedKey)}\n size='sm'\n >\n {entry.label}\n </DropdownMenu.Item>\n </Fragment>\n );\n })}\n </DropdownMenu>\n )}\n {(onAdd || createNewRow) && !addDropdownConfig && addButton}\n {addDropdownConfig && (\n <DropdownMenu trigger={addButton} portal>\n {addDropdownConfig.options.map((option) => (\n <DropdownMenu.Item\n key={option.value}\n {...option}\n onClick={() => addDropdownConfig.onSelection(option.value)}\n size='sm'\n >\n {option.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n </>\n )\n }\n >\n <TableBox\n aria-label={`${label} table`}\n // We have to control the keys so we can power the `rightActions`\n selectedKey={selectedKey}\n onSelectionChange={(key) => {\n onSelectionChange?.(key);\n setSelectedKey(key);\n }}\n selectionMode={selectionMode}\n newRowId={newRowId}\n onCreateNewRow={createNewRow ? handleCreateNewRow : undefined}\n emptyText={emptyText}\n disabled={disabled}\n {...props}\n >\n {children}\n </TableBox>\n </FormField>\n );\n};\n\n// Attach subcomponents to TableBoxField\nTableBoxField.Row = TableBox.Row;\nTableBoxField.Cell = TableBox.Cell;\n\nexport default TableBoxField;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,MAAa,YAAY,WAA2C,SAAS,UAC3E,EACE,OACA,UACA,YACA,aACA,WACA,YACA,aACA,cACA,YACA,aAAa,iBACb,uBACA,cACA,GAAG,SAEL,KACA;CACA,MAAM,EAAE,aAAa,yBAAyB,cAAc;CAC5D,MAAM,cAAc,mBAAmB;CAEvC,MAAM,eAAe,QACnB,oBAAC,WAAD;EAAW,SAAS,eAAe,aAAa,aAAa,KAAA;EAAW,GAAI;YACzE;EACS,CAAA,GACV;AAEJ,QACE,qBAAC,aAAD;EACE,UAAU,CAAC,CAAC;EACZ,YAAY,CAAC,C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dI,GAAG,MAAM,QAAQ,GAAG,aAcxB;AAIf,YACE,qBAAC,UAAD,EAAA,UAAA,CACG,iBAAiB,cAAc,cAAc,IAAI,oBAACA,qBAAa,SAAd,EAAwB,CAAA,EAC1E,oBAACA,qBAAa,MAAd;MACE,GAAI;MACJ,UAAU,YAAY,MAAM;MAC5B,eAAe,MAAM,QAAQ,YAAY;MACzC,MAAK;gBAEJ,MAAM;MACW,CAAA,CACX,EAAA,EAVI,GAAG,MAAM,MAAM,GAAG,aAUtB;MAEb;IACW,CAAA;IAEf,SAAS,iBAAiB,CAAC,qBAAqB;GACjD,qBACC,oBAACA,sBAAD;IAAc,SAAS;IAAW,QAAA;cAC/B,kBAAkB,QAAQ,KAAK,WAC9B,oBAACA,qBAAa,MAAd;KAEE,GAAI;KACJ,eAAe,kBAAkB,YAAY,OAAO,MAAM;KAC1D,MAAK;eAEJ,OAAO;KACU,EANb,OAAO,MAMM,CACpB;IACW,CAAA;GAEhB,EAAA,CAAA;YAIP,oBAAC,UAAD;GACE,cAAY,GAAG,MAAM;GAER;GACb,oBAAoB,QAAQ;AAC1B,wBAAoB,IAAI;AACxB,mBAAe,IAAI;;GAEN;GACL;GACV,gBAAgB,eAAe,qBAAqB,KAAA;GACzC;GACD;GACV,GAAI;GAEH;GACQ,CAAA;EACD,CAAA;;AAKhB,cAAc,MAAM,SAAS;AAC7B,cAAc,OAAO,SAAS"}
|
package/dist/FormField.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FormFieldBaseProps, r as FormFieldProps, t as FormField } from "./FormField-
|
|
1
|
+
import { n as FormFieldBaseProps, r as FormFieldProps, t as FormField } from "./FormField-0p4y0sS5.mjs";
|
|
2
2
|
export { FormField, FormField as default, FormFieldBaseProps, FormFieldProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
1
2
|
import * as _$styled_components0 from "styled-components";
|
|
2
3
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region components/Card/Header/Header.d.ts
|
|
6
6
|
interface HeaderProps {
|
|
@@ -32,4 +32,4 @@ declare const Root: ({
|
|
|
32
32
|
}: HeaderProps & ComponentPropsWithoutRef<"div">) => _$react_jsx_runtime0.JSX.Element;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { Root as a, HeaderProps as i, Header as n, Title as o, HeaderContainer as r, TitleContainer as s, ActionsContainer as t };
|
|
35
|
-
//# sourceMappingURL=Header-
|
|
35
|
+
//# sourceMappingURL=Header-gDUTQgWj.d.mts.map
|
package/dist/Header.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Root, i as HeaderProps, n as Header, o as Title, r as HeaderContainer, s as TitleContainer, t as ActionsContainer } from "./Header-
|
|
1
|
+
import { a as Root, i as HeaderProps, n as Header, o as Title, r as HeaderContainer, s as TitleContainer, t as ActionsContainer } from "./Header-gDUTQgWj.mjs";
|
|
2
2
|
export { ActionsContainer, HeaderContainer, HeaderProps, Root, Title, TitleContainer, Header as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as TooltipWithIconProps } from "./Tooltip-
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { i as TooltipWithIconProps } from "./Tooltip-DX-N-szt.mjs";
|
|
3
2
|
import { ReactNode } from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region components/Tooltip/HelperTooltip.d.ts
|
|
6
6
|
interface HelperTooltipProps extends Omit<TooltipWithIconProps, 'iconTrigger'> {
|
|
@@ -17,4 +17,4 @@ declare const HelperTooltip: ({
|
|
|
17
17
|
}: HelperTooltipProps) => _$react_jsx_runtime0.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { HelperTooltipProps as n, HelperTooltip as t };
|
|
20
|
-
//# sourceMappingURL=HelperTooltip-
|
|
20
|
+
//# sourceMappingURL=HelperTooltip-CqhiRb5g.d.mts.map
|
package/dist/HelperTooltip.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as HelperTooltipProps, t as HelperTooltip } from "./HelperTooltip-
|
|
1
|
+
import { n as HelperTooltipProps, t as HelperTooltip } from "./HelperTooltip-CqhiRb5g.mjs";
|
|
2
2
|
export { HelperTooltipProps, HelperTooltip as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { t as Card_default } from "./Card-
|
|
3
|
-
import { i as Paragraph } from "./Text-
|
|
1
|
+
import { a as styled } from "./styledComponentsInterop-8zScIQyC.mjs";
|
|
2
|
+
import { t as Card_default } from "./Card-CKrJtn1f.mjs";
|
|
3
|
+
import { i as Paragraph } from "./Text-B0orb-cZ.mjs";
|
|
4
4
|
import { t as useToggle } from "./useToggle-Bo3yd14Y.mjs";
|
|
5
5
|
import { fadeIn } from "./variables/keyframes.mjs";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
6
|
+
import "./variables/transitions.mjs";
|
|
7
|
+
import { n as Button } from "./IconButton-BgL3QUVO.mjs";
|
|
8
|
+
import { s as Popover_default } from "./Popover-DNH8Jx1-.mjs";
|
|
8
9
|
import { Spacing } from "@persona/design-tokens";
|
|
9
|
-
import styled from "styled-components";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { CopyIcon } from "@persona/icons";
|
|
12
12
|
//#region components/HoverCopyableField/HoverCopyableField.tsx
|
|
@@ -20,6 +20,13 @@ const copyToClipboard = async (text) => {
|
|
|
20
20
|
return false;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
const clickOrigin = (e) => {
|
|
24
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
25
|
+
return {
|
|
26
|
+
clientX: e.clientX !== 0 || e.clientY !== 0 ? e.clientX : rect.left + rect.width / 2,
|
|
27
|
+
clientY: rect.top
|
|
28
|
+
};
|
|
29
|
+
};
|
|
23
30
|
const CopyableFieldContainer = styled.div`
|
|
24
31
|
display: flex;
|
|
25
32
|
gap: ${Spacing[1]};
|
|
@@ -48,23 +55,30 @@ const StyledCard = styled(Card_default)`
|
|
|
48
55
|
padding: 6px;
|
|
49
56
|
margin: 0;
|
|
50
57
|
`;
|
|
51
|
-
const HoverCopyableField = ({ copyValue, confirmationText = "Copied", children }) => {
|
|
58
|
+
const HoverCopyableField = ({ copyValue, confirmationText = "Copied", onCopySuccess, children }) => {
|
|
52
59
|
const [copyButtonActive, { enable: showCopyButton, disable: hideCopyButton }] = useToggle(false);
|
|
53
60
|
const [confirmationActive, { enable: showConfirmation, disable: hideConfirmation }] = useToggle(false);
|
|
54
|
-
const copyTextToClipboard = async () => {
|
|
61
|
+
const copyTextToClipboard = async (origin) => {
|
|
55
62
|
if (copyValue == null) return;
|
|
56
|
-
if (await copyToClipboard(copyValue))
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
63
|
+
if (!await copyToClipboard(copyValue)) return;
|
|
64
|
+
if (onCopySuccess) {
|
|
65
|
+
onCopySuccess({
|
|
66
|
+
text: copyValue,
|
|
67
|
+
...origin
|
|
68
|
+
});
|
|
69
|
+
hideCopyButton();
|
|
70
|
+
return;
|
|
62
71
|
}
|
|
72
|
+
showConfirmation();
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
hideCopyButton();
|
|
75
|
+
hideConfirmation();
|
|
76
|
+
}, 1200);
|
|
63
77
|
};
|
|
64
78
|
const copyField = (e) => {
|
|
65
79
|
e.preventDefault();
|
|
66
80
|
e.stopPropagation();
|
|
67
|
-
copyTextToClipboard();
|
|
81
|
+
copyTextToClipboard(clickOrigin(e));
|
|
68
82
|
};
|
|
69
83
|
return copyValue != null && copyValue.trim().length > 0 ? /* @__PURE__ */ jsxs(CopyableFieldContainer, {
|
|
70
84
|
onMouseEnter: showCopyButton,
|
|
@@ -95,9 +109,6 @@ const HoverCopyableField = ({ copyValue, confirmationText = "Copied", children }
|
|
|
95
109
|
}) : null;
|
|
96
110
|
};
|
|
97
111
|
//#endregion
|
|
98
|
-
|
|
99
|
-
var HoverCopyableField_default = HoverCopyableField;
|
|
100
|
-
//#endregion
|
|
101
|
-
export { HoverCopyableField_default as t };
|
|
112
|
+
export { HoverCopyableField as t };
|
|
102
113
|
|
|
103
|
-
//# sourceMappingURL=HoverCopyableField-
|
|
114
|
+
//# sourceMappingURL=HoverCopyableField-HWshrU_1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HoverCopyableField-HWshrU_1.mjs","names":["Card","Popover"],"sources":["../components/HoverCopyableField/HoverCopyableField.tsx"],"sourcesContent":["import type { MouseEvent, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { CopyIcon } from '@persona/icons';\nimport Button from 'design-system/components/Button';\nimport Card from 'design-system/components/Card';\nimport Popover from 'design-system/components/Popover';\nimport { Paragraph } from 'design-system/components/Text';\nimport useToggle from 'design-system/lib/useToggle';\nimport { fadeIn } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nexport type CopySuccessDetail = {\n text: string;\n clientX: number;\n clientY: number;\n};\n\nexport type HoverCopyableFieldProps = {\n copyValue: string | undefined;\n confirmationText?: string;\n /**\n * Called after a successful clipboard write. When provided, the Copied\n * popover is skipped so the host can own post-copy UX.\n */\n onCopySuccess?: (detail: CopySuccessDetail) => void;\n children: ReactNode;\n};\n\nconst copyToClipboard = async (text: string): Promise<boolean> => {\n try {\n if ('clipboard' in navigator) {\n await navigator.clipboard.writeText(text);\n return true;\n } else {\n return document.execCommand('copy', true, text);\n }\n } catch {\n return false;\n }\n};\n\nconst clickOrigin = (e: MouseEvent<HTMLButtonElement>): { clientX: number; clientY: number } => {\n const rect = e.currentTarget.getBoundingClientRect();\n const hasPointer = e.clientX !== 0 || e.clientY !== 0;\n return {\n clientX: hasPointer ? e.clientX : rect.left + rect.width / 2,\n clientY: rect.top,\n };\n};\n\nconst CopyableFieldContainer = styled.div`\n display: flex;\n gap: ${Spacing[1]};\n align-items: center;\n`;\n\nconst CopyButton = styled(Button).attrs(() => ({\n type: 'button',\n variant: 'inverse',\n width: 'icon',\n}))<{ isActive: boolean }>`\n height: ${Spacing[5]};\n width: ${Spacing[5]};\n visibility: ${({ isActive }) => (isActive ? 'visible' : 'hidden')};\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n svg {\n width: 14px;\n height: 14px;\n }\n`;\n\nconst StyledCard = styled(Card)`\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n padding: 6px;\n margin: 0;\n`;\n\nconst HoverCopyableField = ({\n copyValue,\n confirmationText = 'Copied',\n onCopySuccess,\n children,\n}: HoverCopyableFieldProps) => {\n const [copyButtonActive, { enable: showCopyButton, disable: hideCopyButton }] = useToggle(false);\n const [confirmationActive, { enable: showConfirmation, disable: hideConfirmation }] =\n useToggle(false);\n\n const copyTextToClipboard = async (origin: { clientX: number; clientY: number }) => {\n if (copyValue == null) {\n return;\n }\n const copyWasSuccessful = await copyToClipboard(copyValue);\n if (!copyWasSuccessful) {\n return;\n }\n if (onCopySuccess) {\n onCopySuccess({ text: copyValue, ...origin });\n hideCopyButton();\n return;\n }\n showConfirmation();\n setTimeout(() => {\n hideCopyButton();\n hideConfirmation();\n }, 1200);\n };\n\n const copyField = (e: MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n e.stopPropagation();\n void copyTextToClipboard(clickOrigin(e));\n };\n\n return copyValue != null && copyValue.trim().length > 0 ? (\n <CopyableFieldContainer onMouseEnter={showCopyButton} onMouseLeave={hideCopyButton}>\n {children}\n <Popover open={confirmationActive}>\n <Popover.Anchor asChild>\n <CopyButton\n id='hover-copyable-field__copy-button'\n isActive={copyButtonActive || confirmationActive}\n onClick={copyField}\n >\n <CopyIcon width={16} height={16} />\n </CopyButton>\n </Popover.Anchor>\n <Popover.Content side='top' align='center' style={{ zIndex: 2 }}>\n <StyledCard elevated>\n <Paragraph>{confirmationText}</Paragraph>\n </StyledCard>\n </Popover.Content>\n </Popover>\n </CopyableFieldContainer>\n ) : null;\n};\n\nexport default HoverCopyableField;\n"],"mappings":";;;;;;;;;;;;AA8BA,MAAM,kBAAkB,OAAO,SAAmC;AAChE,KAAI;AACF,MAAI,eAAe,WAAW;AAC5B,SAAM,UAAU,UAAU,UAAU,KAAK;AACzC,UAAO;QAEP,QAAO,SAAS,YAAY,QAAQ,MAAM,KAAK;SAE3C;AACN,SAAO;;;AAIX,MAAM,eAAe,MAA2E;CAC9F,MAAM,OAAO,EAAE,cAAc,uBAAuB;AAEpD,QAAO;EACL,SAFiB,EAAE,YAAY,KAAK,EAAE,YAAY,IAE5B,EAAE,UAAU,KAAK,OAAO,KAAK,QAAQ;EAC3D,SAAS,KAAK;EACf;;AAGH,MAAM,yBAAyB,OAAO,GAAG;;SAEhC,QAAQ,GAAG;;;AAIpB,MAAM,aAAa,OAAO,OAAO,CAAC,aAAa;CAC7C,MAAM;CACN,SAAS;CACT,OAAO;CACR,EAAE;YACS,QAAQ,GAAG;WACZ,QAAQ,GAAG;iBACL,EAAE,eAAgB,WAAW,YAAY,SAAU;eACrD,OAAO,GAAA,QAA6B;;;;;;AAOnD,MAAM,aAAa,OAAOA,aAAK;;;;;eAKhB,OAAO,GAAA,QAA6B;;;;AAKnD,MAAM,sBAAsB,EAC1B,WACA,mBAAmB,UACnB,eACA,eAC6B;CAC7B,MAAM,CAAC,kBAAkB,EAAE,QAAQ,gBAAgB,SAAS,oBAAoB,UAAU,MAAM;CAChG,MAAM,CAAC,oBAAoB,EAAE,QAAQ,kBAAkB,SAAS,sBAC9D,UAAU,MAAM;CAElB,MAAM,sBAAsB,OAAO,WAAiD;AAClF,MAAI,aAAa,KACf;AAGF,MAAI,CAAC,MAD2B,gBAAgB,UAAU,CAExD;AAEF,MAAI,eAAe;AACjB,iBAAc;IAAE,MAAM;IAAW,GAAG;IAAQ,CAAC;AAC7C,mBAAgB;AAChB;;AAEF,oBAAkB;AAClB,mBAAiB;AACf,mBAAgB;AAChB,qBAAkB;KACjB,KAAK;;CAGV,MAAM,aAAa,MAAqC;AACtD,IAAE,gBAAgB;AAClB,IAAE,iBAAiB;AACd,sBAAoB,YAAY,EAAE,CAAC;;AAG1C,QAAO,aAAa,QAAQ,UAAU,MAAM,CAAC,SAAS,IACpD,qBAAC,wBAAD;EAAwB,cAAc;EAAgB,cAAc;YAApE,CACG,UACD,qBAACC,iBAAD;GAAS,MAAM;aAAf,CACE,oBAACA,gBAAQ,QAAT;IAAgB,SAAA;cACd,oBAAC,YAAD;KACE,IAAG;KACH,UAAU,oBAAoB;KAC9B,SAAS;eAET,oBAAC,UAAD;MAAU,OAAO;MAAI,QAAQ;MAAM,CAAA;KACxB,CAAA;IACE,CAAA,EACjB,oBAACA,gBAAQ,SAAT;IAAiB,MAAK;IAAM,OAAM;IAAS,OAAO,EAAE,QAAQ,GAAG;cAC7D,oBAAC,YAAD;KAAY,UAAA;eACV,oBAAC,WAAD,EAAA,UAAY,kBAA6B,CAAA;KAC9B,CAAA;IACG,CAAA,CACV;KACa;MACvB"}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region components/HoverCopyableField/HoverCopyableField.d.ts
|
|
5
|
-
|
|
5
|
+
type CopySuccessDetail = {
|
|
6
|
+
text: string;
|
|
7
|
+
clientX: number;
|
|
8
|
+
clientY: number;
|
|
9
|
+
};
|
|
10
|
+
type HoverCopyableFieldProps = {
|
|
6
11
|
copyValue: string | undefined;
|
|
7
12
|
confirmationText?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Called after a successful clipboard write. When provided, the Copied
|
|
15
|
+
* popover is skipped so the host can own post-copy UX.
|
|
16
|
+
*/
|
|
17
|
+
onCopySuccess?: (detail: CopySuccessDetail) => void;
|
|
8
18
|
children: ReactNode;
|
|
9
|
-
}
|
|
19
|
+
};
|
|
10
20
|
declare const HoverCopyableField: ({
|
|
11
21
|
copyValue,
|
|
12
22
|
confirmationText,
|
|
23
|
+
onCopySuccess,
|
|
13
24
|
children
|
|
14
25
|
}: HoverCopyableFieldProps) => _$react_jsx_runtime0.JSX.Element | null;
|
|
15
26
|
//#endregion
|
|
16
|
-
export { HoverCopyableField as default };
|
|
27
|
+
export { CopySuccessDetail, HoverCopyableFieldProps, HoverCopyableField as default };
|
|
17
28
|
//# sourceMappingURL=HoverCopyableField.d.mts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { focusOutlineControlled } from "./mixins/focus.mjs";
|
|
3
|
-
import "./variables/transitions.mjs";
|
|
4
|
-
import { printMixins } from "./mixins/print/index.mjs";
|
|
1
|
+
import { a as styled, r as css } from "./styledComponentsInterop-8zScIQyC.mjs";
|
|
5
2
|
import { paragraphMixins } from "./mixins/text.mjs";
|
|
6
3
|
import { t as useToggle } from "./useToggle-Bo3yd14Y.mjs";
|
|
7
4
|
import { rotate } from "./variables/keyframes.mjs";
|
|
5
|
+
import "./variables/transitions.mjs";
|
|
6
|
+
import { isDisabled, isHovered, isNotDisabled } from "./lib/pseudoClass.mjs";
|
|
7
|
+
import { focusOutlineControlled } from "./mixins/focus.mjs";
|
|
8
|
+
import { printMixins } from "./mixins/print/index.mjs";
|
|
8
9
|
import { BorderRadius, Color, Spacing } from "@persona/design-tokens";
|
|
9
|
-
import styled, { css } from "styled-components";
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { Link } from "react-router-dom";
|
|
12
10
|
import { forwardRef, useCallback } from "react";
|
|
11
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
12
|
import { LoaderIcon } from "@persona/icons";
|
|
13
|
+
import { Link } from "react-router-dom";
|
|
14
14
|
import { isEmpty, isFunction } from "lodash-es";
|
|
15
15
|
//#region components/Button/Button.tsx
|
|
16
16
|
const noop$1 = () => void 0;
|
|
@@ -284,7 +284,7 @@ const Button = forwardRef(function Button({ id, children, prefixIcon, suffixIcon
|
|
|
284
284
|
}), /* @__PURE__ */ jsxs(ButtonChildren, {
|
|
285
285
|
isPending: loading,
|
|
286
286
|
children: [
|
|
287
|
-
prefixIcon != null && /* @__PURE__ */ jsxs(Fragment, { children: [prefixIconType === "basic" && /* @__PURE__ */ jsx(PrefixIconContainer, { children: prefixIcon }), prefixIconType === "inherit" && /* @__PURE__ */ jsx(InheritPrefixIconContainer, { children: prefixIcon })] }),
|
|
287
|
+
prefixIcon != null && /* @__PURE__ */ jsxs(Fragment$1, { children: [prefixIconType === "basic" && /* @__PURE__ */ jsx(PrefixIconContainer, { children: prefixIcon }), prefixIconType === "inherit" && /* @__PURE__ */ jsx(InheritPrefixIconContainer, { children: prefixIcon })] }),
|
|
288
288
|
children && /* @__PURE__ */ jsx(ButtonText, {
|
|
289
289
|
width,
|
|
290
290
|
size,
|
|
@@ -338,4 +338,4 @@ const IconButton = forwardRef(function IconButton({ size = "xs", ...props }, ref
|
|
|
338
338
|
//#endregion
|
|
339
339
|
export { SuffixIconContainer as a, StyledButton as i, Button as n, ButtonChildren as r, IconButton as t };
|
|
340
340
|
|
|
341
|
-
//# sourceMappingURL=IconButton-
|
|
341
|
+
//# sourceMappingURL=IconButton-BgL3QUVO.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton-BfDlic2K.mjs","names":["noop"],"sources":["../components/Button/Button.tsx","../components/Button/IconButton.tsx"],"sourcesContent":["import { isEmpty, isFunction } from 'lodash-es';\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type MouseEvent,\n type ReactNode,\n type Ref,\n useCallback,\n} from 'react';\nimport { Link, type LinkProps } from 'react-router-dom';\nimport styled, {\n css,\n type DefaultTheme,\n type FlattenInterpolation,\n type ThemeProps,\n} from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { LoaderIcon } from '@persona/icons';\nimport { isDisabled, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport useToggle from 'design-system/lib/useToggle';\nimport { focusOutlineControlled } from 'design-system/mixins/focus';\nimport { printMixins } from 'design-system/mixins/print';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\nimport { rotate } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst noop = (): void => undefined;\n\n// TODO(joseph): Bring this fix back to pseudoClass\nconst isActive = ({ active }: PseudoClassProps) => (active ? '' : ':active:enabled');\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst sizeStyles: Record<ButtonProps['size'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n md: css`\n ${paragraphMixins.md}\n height: ${({ theme }) => theme.button.height.md};\n padding: ${Spacing[2]};\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n sm: css`\n ${paragraphMixins.sm}\n height: ${({ theme }) => theme.button.height.sm};\n padding: ${Spacing[1]} 6px;\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n};\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst widthStyles: Record<ButtonProps['width'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n full: css`\n width: 100%;\n `,\n auto: css`\n width: auto;\n `,\n // TODO: rename this prop to 'element' as a standard unresponsive element width\n button: css`\n width: ${({ theme }) => theme.element.width.md};\n `,\n icon: css<ButtonProps>`\n width: ${({ theme, size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.button.height[size];\n }};\n padding: 0;\n flex: none;\n `,\n};\n\ninterface ButtonPropsWithTransientProps extends Omit<ButtonProps, 'isPending'> {\n $isPending: boolean;\n $onSecondaryBackground?: boolean;\n}\n\nexport const StyledButton = styled.button.attrs<ButtonPropsWithTransientProps>(({ to, target }) => {\n if (isEmpty(to)) {\n return 'button';\n } else if (typeof to === 'string' && to.startsWith('https://')) {\n return {\n as: 'a',\n href: to,\n target: target ?? '_blank',\n rel: 'noreferrer',\n };\n } else {\n return {\n as: Link,\n };\n }\n})<ButtonPropsWithTransientProps>`\n cursor: pointer;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n ${({ theme, variant }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const palette = theme.color.variants[variant] as any;\n return css`\n &:disabled {\n background-color: ${palette.disabled};\n color: ${palette.textDisabled};\n svg path {\n stroke: ${palette.textDisabled};\n }\n\n /* For backwards compatibility with current coloring scheme (targeting stroke property) */\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n /* Support icons with stroke */\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n user-select: none;\n }\n `;\n }}\n\n ${({ variant }) =>\n variant === 'outline' &&\n css`\n border: 1px solid ${({ theme }) => theme.color.border.input};\n `}\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* To properly position loading spinner */\n position: relative;\n\n border-radius: ${({ theme }) => theme.button.borderRadius};\n\n transition-duration: ${TransitionDuration.Fast};\n transition-property: background-color, color, border-color, width, height;\n\n ${({ size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return sizeStyles[size];\n }}\n ${({ width }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return widthStyles[width];\n }}\n\n /* Variant styling */\n ${({ theme, variant, $isPending, $onSecondaryBackground }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n let palette = theme.color.variants[variant] as any;\n\n if (variant === 'basic' && $onSecondaryBackground) {\n palette = {\n ...palette,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n default: Color.CoreSlate300,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n hover: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n active: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n disabled: Color.CoreSlate100,\n };\n }\n\n return css`\n background-color: ${palette.default};\n color: ${palette.text};\n svg path {\n stroke: ${palette.text};\n }\n\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n &${isHovered}${isNotDisabled} {\n background-color: ${palette.hover};\n }\n\n &${isDisabled} {\n cursor: not-allowed;\n }\n\n &${isActive} {\n background-color: ${palette.active};\n }\n\n ${focusOutlineControlled}\n\n ${\n $isPending &&\n css`\n cursor: default;\n background-color: ${palette.active};\n &:disabled {\n background-color: ${({ theme }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.color.variants[variant].active;\n }};\n user-select: none;\n }\n\n svg path {\n stroke: ${palette.highlightDark};\n }\n\n // For backwards compatibility with current coloring scheme (targeting stroke property)\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n `\n }\n `;\n }}\n\n\n ${printMixins.hide}\n`;\n\ntype WithPendingProps = Pick<ButtonProps, 'isPending'>;\n\nconst LoaderContainer = styled.div<WithPendingProps>`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 2s;\n opacity: ${({ isPending }) => (isPending ? '1' : '0')};\n`;\n\nconst Loader = styled(LoaderIcon)`\n animation: ${rotate} linear 1s infinite;\n`;\n\nexport const ButtonChildren = styled('div').attrs(({ isPending }: WithPendingProps) => ({\n ['aria-hidden']: isPending,\n}))<WithPendingProps>`\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: center;\n transition: opacity ${TransitionDuration.Fast};\n opacity: ${({ isPending }) => (isPending ? '0' : '1')};\n gap: ${Spacing[1]};\n`;\n\nconst PrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst InheritPrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n\n & svg {\n width: inherit;\n height: inherit;\n }\n`;\n\nexport const SuffixIconContainer = styled(PrefixIconContainer)`\n margin-right: 0;\n flex-grow: 1;\n justify-content: flex-end;\n`;\n\nconst ButtonText = styled.span<{ size: 'md' | 'sm'; width: 'full' | 'auto' | 'button' | 'icon' }>`\n position: relative;\n\n /* Needed to align for browsers that don't support text-box yet\n (which at this time, is firefox, and opera, and a few niche browsers)\n This checks firefox. Otherwise, it will default back to the original\n which is a slightly misaligned button\n */\n\n /* Was trying to use this with @supports not, but genuinely could not figure out why this wouldn't\n work */\n\n line-height: ${({ width }) => (width === 'icon' ? '0' : 'inherit')};\n @-moz-document url-prefix() {\n top: ${({ size }) => (size === 'md' ? '1px' : '0.5px')};\n }\n\n @supports (text-box: cap alphabetic) {\n text-box: ${({ width }) => (width === 'icon' ? 'normal' : 'cap alphabetic')};\n }\n`;\n\ntype MaybePromise =\n | ((e: MouseEvent<HTMLButtonElement>) => void)\n | ((e: MouseEvent<HTMLButtonElement>) => Promise<void>);\n\nexport interface ButtonProps\n extends ComponentPropsWithoutRef<'button'>, Omit<PseudoClassProps, 'checked'> {\n /**\n * Visual style of the button.\n *\n * - `primary` – filled brand colour, for the primary action on a surface.\n * - `basic` – subtle grey fill, for secondary actions.\n * - `outline` – transparent with a border, alternative secondary style.\n * - `text` – no background or border, for tertiary / inline actions.\n * - `inverse` – inverted fill for use on dark/coloured backgrounds.\n * - `danger` – red fill, for destructive actions.\n *\n * @defaultValue 'primary'\n */\n variant?: 'basic' | 'primary' | 'inverse' | 'danger' | 'text' | 'outline';\n /**\n * Shows a loading spinner and disables the button. Also triggers automatically\n * when `onClick` returns a Promise, clearing once the promise settles.\n */\n isPending?: boolean;\n /**\n * Icon rendered to the left of the button label.\n * Import from `@persona/icons`.\n */\n prefixIcon?: ReactNode;\n /**\n * Controls how the prefix icon inherits sizing.\n *\n * - `basic` – icon is rendered inside a fixed-size container.\n * - `inherit` – icon stretches to fill the surrounding element's dimensions.\n *\n * @defaultValue 'basic'\n */\n prefixIconType?: 'basic' | 'inherit';\n\n /**\n * Icon rendered to the right of the button label.\n * Import from `@persona/icons`.\n */\n suffixIcon?: ReactNode;\n\n /**\n * Height and typography scale of the button.\n *\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n\n /**\n * Changes the button into a link.\n * Pass a relative path to use `react-router-dom` `<Link>`, or an absolute\n * `https://` URL to render an `<a>` tag that opens in a new tab.\n */\n to?: LinkProps['to'];\n\n /**\n * Overrides the target of the link if `to` is provided and is an external link.\n */\n target?: LinkProps['target'];\n\n /**\n * Note: we may want to default this to 'button' in the future, but many instances of this Button component\n * in dashboard currently rely on the default 'submit' behavior that occurs when using this in redux-form\n * so we'll have to comb through and manually add the type='submit' prop.\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Controls the width of the button.\n *\n * - `full` – stretches to fill its container (`width: 100%`).\n * - `auto` – shrinks to fit its content.\n * - `button` – a fixed medium element width (from design tokens).\n * - `icon` – square, sized to match the button height; use for icon-only buttons.\n *\n * @defaultValue 'full'\n */\n width?: 'full' | 'auto' | 'button' | 'icon';\n onClick?: MaybePromise;\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * In some cases we render a button on a secondary background, which needs an adjustment\n * for certain variants.\n */\n onSecondaryBackground?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n id,\n children,\n prefixIcon,\n suffixIcon,\n disabled,\n isPending,\n type = 'button',\n prefixIconType = 'basic',\n variant = 'primary',\n size = 'md',\n width = 'full',\n onClick,\n onSecondaryBackground,\n ...props\n }: ButtonProps,\n ref,\n) {\n const [isResolving, { enable, disable }] = useToggle(false);\n const innerOnClick: MaybePromise = isFunction(onClick) ? onClick : noop;\n const loading = isPending || isResolving;\n\n const handleClick = useCallback(\n async (e: MouseEvent<HTMLButtonElement>) => {\n if (loading) {\n return;\n }\n\n const maybePromise = innerOnClick(e);\n\n if (maybePromise instanceof Promise) {\n enable();\n await maybePromise;\n disable();\n }\n },\n [loading, innerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n type={type}\n data-test={'button__' + variant}\n variant={variant}\n size={size}\n width={width}\n disabled={disabled || loading}\n $isPending={loading}\n $onSecondaryBackground={onSecondaryBackground}\n {...props}\n onClick={handleClick}\n ref={ref}\n >\n {loading && (\n <LoaderContainer isPending={loading}>\n <Loader aria-label={`Loading ${props['aria-label'] || ''}`} />\n </LoaderContainer>\n )}\n <ButtonChildren isPending={loading}>\n {prefixIcon != null && (\n <>\n {prefixIconType === 'basic' && <PrefixIconContainer>{prefixIcon}</PrefixIconContainer>}\n {prefixIconType === 'inherit' && (\n <InheritPrefixIconContainer>{prefixIcon}</InheritPrefixIconContainer>\n )}\n </>\n )}\n {children && (\n <ButtonText width={width} size={size}>\n {children}\n </ButtonText>\n )}\n {suffixIcon != null && <SuffixIconContainer>{suffixIcon}</SuffixIconContainer>}\n </ButtonChildren>\n </StyledButton>\n );\n});\n\nexport default Button;\n","import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius } from '@persona/design-tokens';\n\nimport Button, { type ButtonProps } from './Button';\n\nconst BUTTON_SIZE_MAP = {\n xs: '16px',\n sm: '24px',\n md: '32px',\n};\n\nconst ICON_SIZE_MAP = {\n xs: '12px',\n sm: '16px',\n md: '16px',\n};\n\ntype IconBtnSize = keyof typeof BUTTON_SIZE_MAP;\n\nconst IconBtn = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n border-radius: ${BorderRadius.Md};\n\n ${({ size }) => css`\n height: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n width: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n\n svg {\n width: ${ICON_SIZE_MAP[size as IconBtnSize]};\n height: ${ICON_SIZE_MAP[size as IconBtnSize]};\n }\n `}\n`;\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'width' | 'prefixIcon' | 'prefixIconType' | 'suffixIcon' | 'variant' | 'size'\n> {\n /**\n * `xs` - 16px. `sm` - 24px. `md` - 32px.\n * Pair with a PDS icon in the prescribed size.\n */\n size?: IconBtnSize;\n}\n\n/**\n * Use to render icon-only buttons. Ensure buttons have proper aria properties.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { size = 'xs', ...props },\n ref,\n) {\n return <IconBtn size={size as ButtonProps['size']} ref={ref} {...props} />;\n});\n\nexport default IconButton;\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAMA,eAAmB,KAAA;AAGzB,MAAM,YAAY,EAAE,aAAgC,SAAS,KAAK;AAGlE,MAAM,aAA0F;CAC9F,IAAI,GAAG;MACH,gBAAgB,GAAG;eACV,EAAE,YAAY,MAAM,OAAO,OAAO,GAAG;eACrC,QAAQ,GAAG;;;;;;CAMxB,IAAI,GAAG;MACH,gBAAgB,GAAG;eACV,EAAE,YAAY,MAAM,OAAO,OAAO,GAAG;eACrC,QAAQ,GAAG;;;;;;CAMzB;AAGD,MAAM,cAA4F;CAChG,MAAM,GAAG;;;CAGT,MAAM,GAAG;;;CAIT,QAAQ,GAAG;cACC,EAAE,YAAY,MAAM,QAAQ,MAAM,GAAG;;CAEjD,MAAM,GAAgB;cACV,EAAE,OAAO,WAAW;AAE5B,SAAO,MAAM,OAAO,OAAO;GAC3B;;;;CAIL;AAOD,MAAa,eAAe,OAAO,OAAO,OAAsC,EAAE,IAAI,aAAa;AACjG,KAAI,QAAQ,GAAG,CACb,QAAO;UACE,OAAO,OAAO,YAAY,GAAG,WAAW,WAAW,CAC5D,QAAO;EACL,IAAI;EACJ,MAAM;EACN,QAAQ,UAAU;EAClB,KAAK;EACN;KAED,QAAO,EACL,IAAI,MACL;EAEH;;;;;KAKG,EAAE,OAAO,cAAc;CAExB,MA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,EAAA,UAA6B,YAAwC,CAAA,CAEtE,EAAA,CAAA;IAEJ,YACC,oBAAC,YAAD;KAAmB;KAAa;KAC7B;KACU,CAAA;IAEd,cAAc,QAAQ,oBAAC,qBAAD,EAAA,UAAsB,YAAiC,CAAA;IAC/D;KACJ;;EAEjB;;;AC/dF,MAAM,kBAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,MAAM,gBAAgB;CACpB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAID,MAAM,UAAU,OAAO,OAAO,CAAC,MAAM;CACnC,OAAO;CACP,SAAS;CACV,CAAC;;;mBAGiB,aAAa,GAAG;;KAE9B,EAAE,WAAW,GAAG;cACP,gBAAgB,MAAqB;aACtC,gBAAgB,MAAqB;;;eAGnC,cAAc,MAAqB;gBAClC,cAAc,MAAqB;;IAE/C;;;;;AAiBJ,MAAM,aAAa,WAA+C,SAAS,WACzE,EAAE,OAAO,MAAM,GAAG,SAClB,KACA;AACA,QAAO,oBAAC,SAAD;EAAe;EAAkC;EAAK,GAAI;EAAS,CAAA;EAC1E"}
|
|
1
|
+
{"version":3,"file":"IconButton-BgL3QUVO.mjs","names":["noop"],"sources":["../components/Button/Button.tsx","../components/Button/IconButton.tsx"],"sourcesContent":["import { isEmpty, isFunction } from 'lodash-es';\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type MouseEvent,\n type ReactNode,\n type Ref,\n useCallback,\n} from 'react';\nimport { Link, type LinkProps } from 'react-router-dom';\nimport styled, {\n css,\n type DefaultTheme,\n type FlattenInterpolation,\n type ThemeProps,\n} from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { LoaderIcon } from '@persona/icons';\nimport { isDisabled, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport useToggle from 'design-system/lib/useToggle';\nimport { focusOutlineControlled } from 'design-system/mixins/focus';\nimport { printMixins } from 'design-system/mixins/print';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\nimport { rotate } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst noop = (): void => undefined;\n\n// TODO(joseph): Bring this fix back to pseudoClass\nconst isActive = ({ active }: PseudoClassProps) => (active ? '' : ':active:enabled');\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst sizeStyles: Record<ButtonProps['size'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n md: css`\n ${paragraphMixins.md}\n height: ${({ theme }) => theme.button.height.md};\n padding: ${Spacing[2]};\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n sm: css`\n ${paragraphMixins.sm}\n height: ${({ theme }) => theme.button.height.sm};\n padding: ${Spacing[1]} 6px;\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n};\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst widthStyles: Record<ButtonProps['width'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n full: css`\n width: 100%;\n `,\n auto: css`\n width: auto;\n `,\n // TODO: rename this prop to 'element' as a standard unresponsive element width\n button: css`\n width: ${({ theme }) => theme.element.width.md};\n `,\n icon: css<ButtonProps>`\n width: ${({ theme, size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.button.height[size];\n }};\n padding: 0;\n flex: none;\n `,\n};\n\ninterface ButtonPropsWithTransientProps extends Omit<ButtonProps, 'isPending'> {\n $isPending: boolean;\n $onSecondaryBackground?: boolean;\n}\n\nexport const StyledButton = styled.button.attrs<ButtonPropsWithTransientProps>(({ to, target }) => {\n if (isEmpty(to)) {\n return 'button';\n } else if (typeof to === 'string' && to.startsWith('https://')) {\n return {\n as: 'a',\n href: to,\n target: target ?? '_blank',\n rel: 'noreferrer',\n };\n } else {\n return {\n as: Link,\n };\n }\n})<ButtonPropsWithTransientProps>`\n cursor: pointer;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n ${({ theme, variant }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const palette = theme.color.variants[variant] as any;\n return css`\n &:disabled {\n background-color: ${palette.disabled};\n color: ${palette.textDisabled};\n svg path {\n stroke: ${palette.textDisabled};\n }\n\n /* For backwards compatibility with current coloring scheme (targeting stroke property) */\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n /* Support icons with stroke */\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n user-select: none;\n }\n `;\n }}\n\n ${({ variant }) =>\n variant === 'outline' &&\n css`\n border: 1px solid ${({ theme }) => theme.color.border.input};\n `}\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* To properly position loading spinner */\n position: relative;\n\n border-radius: ${({ theme }) => theme.button.borderRadius};\n\n transition-duration: ${TransitionDuration.Fast};\n transition-property: background-color, color, border-color, width, height;\n\n ${({ size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return sizeStyles[size];\n }}\n ${({ width }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return widthStyles[width];\n }}\n\n /* Variant styling */\n ${({ theme, variant, $isPending, $onSecondaryBackground }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n let palette = theme.color.variants[variant] as any;\n\n if (variant === 'basic' && $onSecondaryBackground) {\n palette = {\n ...palette,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n default: Color.CoreSlate300,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n hover: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n active: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n disabled: Color.CoreSlate100,\n };\n }\n\n return css`\n background-color: ${palette.default};\n color: ${palette.text};\n svg path {\n stroke: ${palette.text};\n }\n\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n &${isHovered}${isNotDisabled} {\n background-color: ${palette.hover};\n }\n\n &${isDisabled} {\n cursor: not-allowed;\n }\n\n &${isActive} {\n background-color: ${palette.active};\n }\n\n ${focusOutlineControlled}\n\n ${\n $isPending &&\n css`\n cursor: default;\n background-color: ${palette.active};\n &:disabled {\n background-color: ${({ theme }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.color.variants[variant].active;\n }};\n user-select: none;\n }\n\n svg path {\n stroke: ${palette.highlightDark};\n }\n\n // For backwards compatibility with current coloring scheme (targeting stroke property)\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n `\n }\n `;\n }}\n\n\n ${printMixins.hide}\n`;\n\ntype WithPendingProps = Pick<ButtonProps, 'isPending'>;\n\nconst LoaderContainer = styled.div<WithPendingProps>`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 2s;\n opacity: ${({ isPending }) => (isPending ? '1' : '0')};\n`;\n\nconst Loader = styled(LoaderIcon)`\n animation: ${rotate} linear 1s infinite;\n`;\n\nexport const ButtonChildren = styled('div').attrs(({ isPending }: WithPendingProps) => ({\n ['aria-hidden']: isPending,\n}))<WithPendingProps>`\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: center;\n transition: opacity ${TransitionDuration.Fast};\n opacity: ${({ isPending }) => (isPending ? '0' : '1')};\n gap: ${Spacing[1]};\n`;\n\nconst PrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst InheritPrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n\n & svg {\n width: inherit;\n height: inherit;\n }\n`;\n\nexport const SuffixIconContainer = styled(PrefixIconContainer)`\n margin-right: 0;\n flex-grow: 1;\n justify-content: flex-end;\n`;\n\nconst ButtonText = styled.span<{ size: 'md' | 'sm'; width: 'full' | 'auto' | 'button' | 'icon' }>`\n position: relative;\n\n /* Needed to align for browsers that don't support text-box yet\n (which at this time, is firefox, and opera, and a few niche browsers)\n This checks firefox. Otherwise, it will default back to the original\n which is a slightly misaligned button\n */\n\n /* Was trying to use this with @supports not, but genuinely could not figure out why this wouldn't\n work */\n\n line-height: ${({ width }) => (width === 'icon' ? '0' : 'inherit')};\n @-moz-document url-prefix() {\n top: ${({ size }) => (size === 'md' ? '1px' : '0.5px')};\n }\n\n @supports (text-box: cap alphabetic) {\n text-box: ${({ width }) => (width === 'icon' ? 'normal' : 'cap alphabetic')};\n }\n`;\n\ntype MaybePromise =\n | ((e: MouseEvent<HTMLButtonElement>) => void)\n | ((e: MouseEvent<HTMLButtonElement>) => Promise<void>);\n\nexport interface ButtonProps\n extends ComponentPropsWithoutRef<'button'>, Omit<PseudoClassProps, 'checked'> {\n /**\n * Visual style of the button.\n *\n * - `primary` – filled brand colour, for the primary action on a surface.\n * - `basic` – subtle grey fill, for secondary actions.\n * - `outline` – transparent with a border, alternative secondary style.\n * - `text` – no background or border, for tertiary / inline actions.\n * - `inverse` – inverted fill for use on dark/coloured backgrounds.\n * - `danger` – red fill, for destructive actions.\n *\n * @defaultValue 'primary'\n */\n variant?: 'basic' | 'primary' | 'inverse' | 'danger' | 'text' | 'outline';\n /**\n * Shows a loading spinner and disables the button. Also triggers automatically\n * when `onClick` returns a Promise, clearing once the promise settles.\n */\n isPending?: boolean;\n /**\n * Icon rendered to the left of the button label.\n * Import from `@persona/icons`.\n */\n prefixIcon?: ReactNode;\n /**\n * Controls how the prefix icon inherits sizing.\n *\n * - `basic` – icon is rendered inside a fixed-size container.\n * - `inherit` – icon stretches to fill the surrounding element's dimensions.\n *\n * @defaultValue 'basic'\n */\n prefixIconType?: 'basic' | 'inherit';\n\n /**\n * Icon rendered to the right of the button label.\n * Import from `@persona/icons`.\n */\n suffixIcon?: ReactNode;\n\n /**\n * Height and typography scale of the button.\n *\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n\n /**\n * Changes the button into a link.\n * Pass a relative path to use `react-router-dom` `<Link>`, or an absolute\n * `https://` URL to render an `<a>` tag that opens in a new tab.\n */\n to?: LinkProps['to'];\n\n /**\n * Overrides the target of the link if `to` is provided and is an external link.\n */\n target?: LinkProps['target'];\n\n /**\n * Note: we may want to default this to 'button' in the future, but many instances of this Button component\n * in dashboard currently rely on the default 'submit' behavior that occurs when using this in redux-form\n * so we'll have to comb through and manually add the type='submit' prop.\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Controls the width of the button.\n *\n * - `full` – stretches to fill its container (`width: 100%`).\n * - `auto` – shrinks to fit its content.\n * - `button` – a fixed medium element width (from design tokens).\n * - `icon` – square, sized to match the button height; use for icon-only buttons.\n *\n * @defaultValue 'full'\n */\n width?: 'full' | 'auto' | 'button' | 'icon';\n onClick?: MaybePromise;\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * In some cases we render a button on a secondary background, which needs an adjustment\n * for certain variants.\n */\n onSecondaryBackground?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n id,\n children,\n prefixIcon,\n suffixIcon,\n disabled,\n isPending,\n type = 'button',\n prefixIconType = 'basic',\n variant = 'primary',\n size = 'md',\n width = 'full',\n onClick,\n onSecondaryBackground,\n ...props\n }: ButtonProps,\n ref,\n) {\n const [isResolving, { enable, disable }] = useToggle(false);\n const innerOnClick: MaybePromise = isFunction(onClick) ? onClick : noop;\n const loading = isPending || isResolving;\n\n const handleClick = useCallback(\n async (e: MouseEvent<HTMLButtonElement>) => {\n if (loading) {\n return;\n }\n\n const maybePromise = innerOnClick(e);\n\n if (maybePromise instanceof Promise) {\n enable();\n await maybePromise;\n disable();\n }\n },\n [loading, innerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n type={type}\n data-test={'button__' + variant}\n variant={variant}\n size={size}\n width={width}\n disabled={disabled || loading}\n $isPending={loading}\n $onSecondaryBackground={onSecondaryBackground}\n {...props}\n onClick={handleClick}\n ref={ref}\n >\n {loading && (\n <LoaderContainer isPending={loading}>\n <Loader aria-label={`Loading ${props['aria-label'] || ''}`} />\n </LoaderContainer>\n )}\n <ButtonChildren isPending={loading}>\n {prefixIcon != null && (\n <>\n {prefixIconType === 'basic' && <PrefixIconContainer>{prefixIcon}</PrefixIconContainer>}\n {prefixIconType === 'inherit' && (\n <InheritPrefixIconContainer>{prefixIcon}</InheritPrefixIconContainer>\n )}\n </>\n )}\n {children && (\n <ButtonText width={width} size={size}>\n {children}\n </ButtonText>\n )}\n {suffixIcon != null && <SuffixIconContainer>{suffixIcon}</SuffixIconContainer>}\n </ButtonChildren>\n </StyledButton>\n );\n});\n\nexport default Button;\n","import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius } from '@persona/design-tokens';\n\nimport Button, { type ButtonProps } from './Button';\n\nconst BUTTON_SIZE_MAP = {\n xs: '16px',\n sm: '24px',\n md: '32px',\n};\n\nconst ICON_SIZE_MAP = {\n xs: '12px',\n sm: '16px',\n md: '16px',\n};\n\ntype IconBtnSize = keyof typeof BUTTON_SIZE_MAP;\n\nconst IconBtn = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n border-radius: ${BorderRadius.Md};\n\n ${({ size }) => css`\n height: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n width: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n\n svg {\n width: ${ICON_SIZE_MAP[size as IconBtnSize]};\n height: ${ICON_SIZE_MAP[size as IconBtnSize]};\n }\n `}\n`;\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'width' | 'prefixIcon' | 'prefixIconType' | 'suffixIcon' | 'variant' | 'size'\n> {\n /**\n * `xs` - 16px. `sm` - 24px. `md` - 32px.\n * Pair with a PDS icon in the prescribed size.\n */\n size?: IconBtnSize;\n}\n\n/**\n * Use to render icon-only buttons. Ensure buttons have proper aria properties.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { size = 'xs', ...props },\n ref,\n) {\n return <IconBtn size={size as ButtonProps['size']} ref={ref} {...props} />;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BAGiB,aAAa,GAAG;;KAE9B,EAAE,WAAW,GAAG;cACP,gBAAgB,MAAqB;aACtC,gBAAgB,MAAqB;;;eAGnC,cAAc,MAAqB;gBAClC,cAAc,MAAqB;;IAE/C;;;;;AAiBJ,MAAM,aAAa,WAA+C,SAAS,WACzE,EAAE,OAAO,MAAM,GAAG,SAClB,KACA;AACA,QAAO,oBAAC,SAAD;EAAe;EAAkC;EAAK,GAAI;EAAS,CAAA;EAC1E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as ButtonProps } from "./Button-
|
|
1
|
+
import { r as ButtonProps } from "./Button-CKzNTpPL.mjs";
|
|
2
2
|
import * as _$react from "react";
|
|
3
3
|
|
|
4
4
|
//#region components/Button/IconButton.d.ts
|
|
@@ -21,4 +21,4 @@ interface IconButtonProps extends Omit<ButtonProps, 'width' | 'prefixIcon' | 'pr
|
|
|
21
21
|
declare const IconButton: _$react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & _$react.RefAttributes<HTMLButtonElement>>;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { IconButtonProps as n, IconButton as t };
|
|
24
|
-
//# sourceMappingURL=IconButton-
|
|
24
|
+
//# sourceMappingURL=IconButton-CLsHdYm7.d.mts.map
|
package/dist/IconButton.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as IconButtonProps, t as IconButton } from "./IconButton-
|
|
1
|
+
import { n as IconButtonProps, t as IconButton } from "./IconButton-CLsHdYm7.mjs";
|
|
2
2
|
export { IconButtonProps, IconButton as default };
|
package/dist/ImageTile.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as TextAction } from "./Action-
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { i as TextAction } from "./Action-DL3kHI9Z.mjs";
|
|
3
2
|
import { ComponentPropsWithoutRef, MouseEvent, ReactNode } from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region components/ImageTile/ImageTile.d.ts
|
|
6
6
|
interface ImageTileProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as InlineEditConfig } from "./TableBoxCell-
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { r as InlineEditConfig } from "./TableBoxCell-52g97gEg.mjs";
|
|
3
2
|
import { RefObject } from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region components/TableBox/InlineCombobox.d.ts
|
|
6
6
|
interface InlineComboboxProps {
|
package/dist/InlineInput.d.mts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { t as PseudoClassProps } from "./PseudoClassProps-
|
|
2
|
-
import { r as ButtonProps } from "./Button-
|
|
3
|
-
import { n as InputSizes, t as InputMixinProps } from "./input-
|
|
4
|
-
import * as _$styled_components0 from "styled-components";
|
|
1
|
+
import { t as PseudoClassProps } from "./PseudoClassProps-DgT5G_z5.mjs";
|
|
2
|
+
import { r as ButtonProps } from "./Button-CKzNTpPL.mjs";
|
|
3
|
+
import { n as InputSizes, t as InputMixinProps } from "./input-D9FuQmlI.mjs";
|
|
5
4
|
import * as _$react from "react";
|
|
6
5
|
import { ComponentPropsWithoutRef, MouseEventHandler, ReactElement, ReactNode } from "react";
|
|
6
|
+
import * as _$styled_components0 from "styled-components";
|
|
7
7
|
|
|
8
8
|
//#region components/Input/Input.d.ts
|
|
9
9
|
declare const ClearButton: _$styled_components0.StyledComponent<_$react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & _$react.RefAttributes<HTMLButtonElement>>, any, {
|
|
10
10
|
width: "icon";
|
|
11
11
|
variant: "basic";
|
|
12
|
-
} & PseudoClassProps, "
|
|
12
|
+
} & PseudoClassProps, "variant" | "width">;
|
|
13
13
|
interface StyledInputProps extends InputMixinProps {
|
|
14
14
|
$leftIcon?: ReactNode;
|
|
15
15
|
$hasRightItem?: boolean;
|
|
@@ -62,4 +62,4 @@ interface InputGroupProps extends ComponentPropsWithoutRef<'div'>, Omit<InputMix
|
|
|
62
62
|
declare const InputGroup: _$react.ForwardRefExoticComponent<InputGroupProps & _$react.RefAttributes<HTMLDivElement>>;
|
|
63
63
|
//#endregion
|
|
64
64
|
export { InputProps as a, InputGroupProps as i, Input as n, InputGroup as r, ClearButton as t };
|
|
65
|
-
//# sourceMappingURL=Input-
|
|
65
|
+
//# sourceMappingURL=Input-BHHWpSKN.d.mts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { a as styled, r as css } from "./styledComponentsInterop-8zScIQyC.mjs";
|
|
2
|
+
import { i as Paragraph } from "./Text-B0orb-cZ.mjs";
|
|
1
3
|
import { isHovered, isNotDisabled } from "./lib/pseudoClass.mjs";
|
|
2
4
|
import inputMixin from "./mixins/input.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as useFormField, t as FormControlContext } from "./useFormField-eftOPiXj.mjs";
|
|
5
|
+
import { n as Button } from "./IconButton-BgL3QUVO.mjs";
|
|
6
|
+
import { n as useFormField, t as FormControlContext } from "./useFormField-Bz2iMPBO.mjs";
|
|
6
7
|
import { BorderRadius, Color, Spacing } from "@persona/design-tokens";
|
|
7
|
-
import styled, { css } from "styled-components";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { cloneElement, forwardRef, useEffect, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { CircleXInverseIcon } from "@persona/icons";
|
|
11
11
|
import { CircleXInverseIcon as CircleXInverseIcon$1 } from "@persona/icons/12px";
|
|
12
12
|
//#region components/Input/Input.tsx
|
|
@@ -187,4 +187,4 @@ const InputGroup = forwardRef(function InputGroup({ size = "md", leftIcon, onCle
|
|
|
187
187
|
//#endregion
|
|
188
188
|
export { Input as n, InputGroup as r, ClearButton as t };
|
|
189
189
|
|
|
190
|
-
//# sourceMappingURL=Input-
|
|
190
|
+
//# sourceMappingURL=Input-DoB8YswA.mjs.map
|