@persona/design-system 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +3 -3
- package/dist/{Action-CnNf5T-l.d.mts → Action-CcAyQpYN.d.mts} +3 -3
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +5 -5
- package/dist/AdvancedFilterRulesPopover.d.mts +4 -4
- 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/BottomPanel.d.mts +32 -0
- package/dist/{Breadcrumb-DEwZFJHF.d.mts → Breadcrumb-Df06cTnA.d.mts} +1 -1
- package/dist/Breadcrumb.d.mts +1 -1
- package/dist/{Breadcrumbs-0e_3v9FF.d.mts → Breadcrumbs-D_Gzd4_J.d.mts} +2 -2
- package/dist/{Breadcrumbs-CqKtnZqu.mjs → Breadcrumbs-Zi5p0HDR.mjs} +12 -12
- package/dist/{Breadcrumbs-CqKtnZqu.mjs.map → Breadcrumbs-Zi5p0HDR.mjs.map} +1 -1
- package/dist/Breadcrumbs.d.mts +1 -1
- package/dist/{Button-C0F0F2IL.d.mts → Button-BrI1s2-r.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-DjnoZVcT.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-mZDNFaJy.d.mts} +4 -4
- package/dist/Card.d.mts +1 -1
- package/dist/Card2.d.mts +3 -3
- package/dist/{CardV2-B0ZweQYk.mjs → CardV2-CXxzl1EZ.mjs} +20 -20
- package/dist/{CardV2-B0ZweQYk.mjs.map → CardV2-CXxzl1EZ.mjs.map} +1 -1
- package/dist/{Checkbox-Bm8exUfH.d.mts → Checkbox-CwPXPLCi.d.mts} +1 -1
- package/dist/{Checkbox-DAvbgZgO.mjs → Checkbox-DxNHp59y.mjs} +8 -8
- package/dist/{Checkbox-DAvbgZgO.mjs.map → Checkbox-DxNHp59y.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-BUtqtzKl.mjs} +22 -22
- package/dist/Combobox-BUtqtzKl.mjs.map +1 -0
- package/dist/{Combobox-C8ue0cBP.d.mts → Combobox-C9QBItsc.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-DJGTMf1_.d.mts → ComboboxBase-BkSpdmsT.d.mts} +8 -8
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-D7A2bbWU.d.mts → ComboboxMultiSelect-DkVfwSKH.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-D1uzEyKj.d.mts → ComboboxSingleSelect-CpumBcDn.d.mts} +4 -4
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-DMuvqaV5.d.mts → CompactBar-COxu_FDd.d.mts} +3 -3
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ConfigFormGroup-D2_sajXe.mjs → ConfigFormGroup-aSdn2r6Z.mjs} +4 -4
- package/dist/{ConfigFormGroup-D2_sajXe.mjs.map → ConfigFormGroup-aSdn2r6Z.mjs.map} +1 -1
- package/dist/{ControlBar-Dg8JeU8f.d.mts → ControlBar-DwAhPcb5.d.mts} +12 -2
- package/dist/ControlBar.d.mts +1 -1
- package/dist/DataTable.d.mts +5 -4
- package/dist/{DateField-Com9f2-j.d.mts → DateField-tOyrGcx1.d.mts} +2 -2
- package/dist/DateField.d.mts +1 -1
- package/dist/{DatePicker-BGO6doLx.d.mts → DatePicker-Bs9JODNg.d.mts} +2 -2
- package/dist/{DatePicker-BlnE2MBD.mjs → DatePicker-CLP-ajza.mjs} +95 -23
- package/dist/DatePicker-CLP-ajza.mjs.map +1 -0
- package/dist/DatePicker.d.mts +1 -1
- package/dist/{DateRangePicker-DfRBm9z4.d.mts → DateRangePicker-BT6-j8V7.d.mts} +24 -4
- package/dist/DateRangePicker.d.mts +2 -2
- package/dist/DateRangeValueControl.d.mts +8 -4
- package/dist/DateValueControl.d.mts +1 -1
- package/dist/{DropdownButton-CpWNRUma.mjs → DropdownButton-CCAfNZ9h.mjs} +3 -3
- package/dist/{DropdownButton-CpWNRUma.mjs.map → DropdownButton-CCAfNZ9h.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-CnaK78rP.d.mts → DropdownMenu-BoatixlO.d.mts} +3 -3
- package/dist/{DropdownMenu-BCyV8nC0.mjs → DropdownMenu-CUnf420M.mjs} +4 -4
- package/dist/{DropdownMenu-BCyV8nC0.mjs.map → DropdownMenu-CUnf420M.mjs.map} +1 -1
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-CN2XjaOX.d.mts → ErrorProps-C9T857Wk.d.mts} +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/{FieldRegistry-DdA63Vnh.d.mts → FieldRegistry-D6niLExM.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-CxNsBVrn.d.mts → FilterBar-DfBV7yKM.d.mts} +10 -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-0H0Jeind.d.mts} +4 -4
- package/dist/{FormControl-HVzZEqJH.mjs → FormControl-1BmoYFCu.mjs} +6 -6
- package/dist/{FormControl-HVzZEqJH.mjs.map → FormControl-1BmoYFCu.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-BcaFdmo5.d.mts} +2 -2
- package/dist/{FormField-B9P3BWvS.mjs → FormField-oBKH25qf.mjs} +22 -22
- package/dist/FormField-oBKH25qf.mjs.map +1 -0
- package/dist/FormField.d.mts +1 -1
- package/dist/Grid.d.mts +38 -0
- package/dist/GridItem.d.mts +17 -0
- package/dist/{Header-CBlB65NY.d.mts → Header-BjSoTEX_.d.mts} +2 -2
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-C28h1zFl.d.mts → HelperTooltip-S20wVFCS.d.mts} +3 -3
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/{HoverCopyableField-0Bzygbp9.mjs → HoverCopyableField-GMXeF-3J.mjs} +31 -20
- package/dist/HoverCopyableField-GMXeF-3J.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-BpyOr8Ev.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-Bimw8KFj.mjs → Input-BWlvBYB3.mjs} +6 -6
- package/dist/{Input-Bimw8KFj.mjs.map → Input-BWlvBYB3.mjs.map} +1 -1
- package/dist/{Input-CVdjkX88.d.mts → Input-qlQVD5h0.d.mts} +5 -5
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-BwKkmImn.d.mts → InputProps-D_7MnQfE.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-9jHHEaqW.mjs} +15 -15
- package/dist/{ListBox-DKZpGYjo.mjs.map → ListBox-9jHHEaqW.mjs.map} +1 -1
- package/dist/{ListBox-CDl5oZPX.d.mts → ListBox-ZE3MYMt6.d.mts} +5 -5
- package/dist/ListBox.d.mts +1 -1
- package/dist/ListBoxField.d.mts +3 -3
- package/dist/{LoadingShimmer-DC2vqicd.mjs → LoadingShimmer-a2Hv0kAq.mjs} +2 -2
- package/dist/{LoadingShimmer-DC2vqicd.mjs.map → LoadingShimmer-a2Hv0kAq.mjs.map} +1 -1
- package/dist/LoadingShimmer.d.mts +2 -2
- package/dist/{LogicRow-CkbyvrUw.d.mts → LogicRow-CbMmaWXU.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-38UCGcte.mjs} +6 -6
- package/dist/{Menu-Dir03WA9.mjs.map → Menu-38UCGcte.mjs.map} +1 -1
- package/dist/{Menu-CYRdEnfo.d.mts → Menu-ZShdhNd7.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-B2-Slzhl.mjs} +4 -4
- package/dist/{PageHeader-C2IUKhCg.mjs.map → PageHeader-B2-Slzhl.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-BcZx4nqe.d.mts} +3 -3
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-0VhVdXv0.mjs → Pagination-CtUz0gdA.mjs} +8 -8
- package/dist/{Pagination-0VhVdXv0.mjs.map → Pagination-CtUz0gdA.mjs.map} +1 -1
- package/dist/{Pagination-ygLutOst.d.mts → Pagination-j4hF7GOk.d.mts} +2 -2
- package/dist/Pagination.d.mts +1 -1
- package/dist/{Pii-C7pA72Bh.mjs → Pii-RwKn-K84.mjs} +2 -2
- package/dist/{Pii-C7pA72Bh.mjs.map → Pii-RwKn-K84.mjs.map} +1 -1
- package/dist/Pii.d.mts +1 -1
- package/dist/PillShell.d.mts +1 -1
- package/dist/{Popover-BkDpDdaO.mjs → Popover-DlXyKYL5.mjs} +6 -6
- package/dist/{Popover-BkDpDdaO.mjs.map → Popover-DlXyKYL5.mjs.map} +1 -1
- package/dist/Popover.d.mts +1 -1
- package/dist/ProgressBar.d.mts +1 -1
- package/dist/ProgressIndicator.d.mts +6 -4
- package/dist/{PseudoClassProps-CcSlKNev.d.mts → PseudoClassProps-BPdn-ofQ.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-BaFutxgV.mjs → Radio-cLL9oatf.mjs} +5 -5
- package/dist/{Radio-BaFutxgV.mjs.map → Radio-cLL9oatf.mjs.map} +1 -1
- package/dist/{RadioGroup-ClMzOZl0.mjs → RadioGroup-BGo_kXKh.mjs} +4 -4
- package/dist/{RadioGroup-ClMzOZl0.mjs.map → RadioGroup-BGo_kXKh.mjs.map} +1 -1
- package/dist/{RadioGroup-BuJaitgG.d.mts → RadioGroup-BqULCH-D.d.mts} +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/RangeCalendar.d.mts +6 -1
- package/dist/RangeCalendarPresets.d.mts +13 -3
- package/dist/ResizableVerticalPanel.d.mts +22 -0
- package/dist/ResizeHandle.d.mts +19 -0
- package/dist/RightPanel.d.mts +41 -0
- package/dist/RightPanelLoadingContent.d.mts +7 -0
- package/dist/RightPanelResizeHandle.d.mts +14 -0
- package/dist/RuleEditorFields.d.mts +5 -5
- package/dist/RulesPill.d.mts +1 -1
- package/dist/{SearchInput-Ca3_np5e.d.mts → SearchInput-Dc90GLTF.d.mts} +3 -3
- package/dist/SearchInput.d.mts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-DgyJL4uN.mjs → SegmentedControl-CvWJGhwy.mjs} +5 -5
- package/dist/{SegmentedControl-DgyJL4uN.mjs.map → SegmentedControl-CvWJGhwy.mjs.map} +1 -1
- package/dist/{SegmentedControl-_I4sWeD7.d.mts → SegmentedControl-Db78Pzo_.d.mts} +2 -2
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-D6MqSYVa.mjs → Select-U_vQhK1A.mjs} +12 -13
- package/dist/Select-U_vQhK1A.mjs.map +1 -0
- package/dist/{Select-vwXGlHuW.d.mts → Select-bafAe2wd.d.mts} +4 -4
- 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-BTyc6glU.mjs} +3 -3
- package/dist/{Spinner-BgBCCHGo.mjs.map → Spinner-BTyc6glU.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-_JcvIE31.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-OKVOQt_C.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-B5NtgtgC.mjs} +7 -7
- package/dist/{TabBar-D6UocZXi.mjs.map → TabBar-B5NtgtgC.mjs.map} +1 -1
- package/dist/TabBarIconButton.d.mts +2 -2
- package/dist/{Table-cO7ZwGPM.d.mts → Table-BcAgCIWq.d.mts} +1 -1
- package/dist/{Table-D1WyUQuv.mjs → Table-DfUD3I2s.mjs} +8 -8
- package/dist/{Table-D1WyUQuv.mjs.map → Table-DfUD3I2s.mjs.map} +1 -1
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-CirMgfAV.d.mts → TableBody-D-RDBun9.d.mts} +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/{TableBox-C5qWhr82.mjs → TableBox-0GvWjRln.mjs} +27 -21
- package/dist/{TableBox-C5qWhr82.mjs.map → TableBox-0GvWjRln.mjs.map} +1 -1
- package/dist/TableBox.d.mts +2 -2
- package/dist/{TableBoxCell-DmVX_tgn.d.mts → TableBoxCell-WXc57DwN.d.mts} +12 -9
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/TableBoxField.d.mts +4 -4
- package/dist/{TableBoxRow-nwq41Bpi.d.mts → TableBoxRow-BQz0a9vr.d.mts} +4 -4
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-B4_ojiQo.d.mts → TableBoxRowActions-DfewtLrn.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/TableCell.d.mts +1 -1
- package/dist/{TableControls-RwIPBxyU.d.mts → TableControls-C26vGkWZ.d.mts} +6 -9
- package/dist/{TableControls-CZ9iu3ma.mjs → TableControls-WUNbzSNq.mjs} +331 -113
- package/dist/TableControls-WUNbzSNq.mjs.map +1 -0
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-D_SBFZN1.d.mts → TableControlsContext-ChFsFEjR.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableHead-DMq_q_W0.d.mts → TableHead-PPaqXC0K.d.mts} +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-C2pqXBYO.d.mts → TableHeaderCell-K_avn-rR.d.mts} +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-DQKu6Rcj.d.mts → TableLayout-_Hd-Tvto.d.mts} +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-CPqZ8DK3.d.mts → TableRow-BTWf9xVC.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-BqB7pOh8.d.mts} +5 -3
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{TechnicalSticker-DTjg6d2F.mjs → TechnicalSticker-ClRR_6Ly.mjs} +6 -6
- package/dist/{TechnicalSticker-DTjg6d2F.mjs.map → TechnicalSticker-ClRR_6Ly.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-CAKHcXSd.d.mts} +4 -4
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-DhPBI_1-.d.mts → TextArea-NjdArapc.d.mts} +2 -2
- package/dist/{TextArea-ZMgbE_Lh.mjs → TextArea-n4IKHJKo.mjs} +4 -4
- package/dist/{TextArea-ZMgbE_Lh.mjs.map → TextArea-n4IKHJKo.mjs.map} +1 -1
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-BzmmiJlC.d.mts → TextUnderlineTooltip-Duzxfc_r.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-BPgfSjuu.mjs → Toggle-e8DCYa6i.mjs} +7 -7
- package/dist/{Toggle-BPgfSjuu.mjs.map → Toggle-e8DCYa6i.mjs.map} +1 -1
- package/dist/{Toggle-BGGQ4Ukl.d.mts → Toggle-fh80PA8P.d.mts} +1 -1
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-D_a-RwAN.d.mts → Tooltip-DabloV0o.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-B1W4BivL.d.mts} +2 -2
- package/dist/codec-B0dZTwlG.d.mts +29 -0
- package/dist/codec.d.mts +2 -0
- 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/BottomPanel/index.d.mts +2 -0
- package/dist/components/BottomPanel/index.mjs +293 -0
- package/dist/components/BottomPanel/index.mjs.map +1 -0
- 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 +19 -16
- package/dist/components/DataTable/TableControls/index.mjs +2 -2
- 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 +5 -5
- 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/Grid/index.d.mts +3 -0
- package/dist/components/Grid/index.mjs +85 -0
- package/dist/components/Grid/index.mjs.map +1 -0
- 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 +14 -10
- package/dist/components/ProgressIndicator/index.mjs.map +1 -1
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.d.mts +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/RightPanel/index.d.mts +2 -0
- package/dist/components/RightPanel/index.mjs +294 -0
- package/dist/components/RightPanel/index.mjs.map +1 -0
- 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-DcJ3tnwY.d.mts} +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/date-filter-BbWgAXy3.mjs +176 -0
- package/dist/date-filter-BbWgAXy3.mjs.map +1 -0
- package/dist/date-range-rule-value-DBEEWTQp.d.mts +17 -0
- package/dist/date-range-rule-value.d.mts +2 -0
- package/dist/date-rule-intent-BArNGT2E.d.mts +20 -0
- package/dist/date-rule-intent.d.mts +2 -0
- package/dist/display.d.mts +2 -2
- package/dist/fieldPickerOptions.d.mts +2 -2
- package/dist/{filter-size-context-Bw5F7082.d.mts → filter-size-context-D1UhTwOG.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-DASkW991.d.mts} +2 -2
- package/dist/{index-C1bz13uw.d.mts → index-Dc_BgmPv.d.mts} +5 -5
- package/dist/{index-DiCnyORA.d.mts → index-Dpo-RP6S.d.mts} +5 -5
- package/dist/index-dhjtMp5F.d.mts +1 -0
- package/dist/index-uY8Qbwfx.d.mts +1 -0
- 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 +14 -11
- package/dist/{input-CzO-6_1V.d.mts → input-M7BEIewR.d.mts} +3 -3
- package/dist/inputFields.d.mts +11 -11
- package/dist/{intersperse-yd3oMrQl.mjs → intersperse-DQAyfeEw.mjs} +1 -1
- package/dist/{intersperse-yd3oMrQl.mjs.map → intersperse-DQAyfeEw.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/date-filter/index.d.mts +3 -0
- package/dist/lib/date-filter/index.mjs +2 -0
- 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/lib/useResizablePanel.d.mts +49 -0
- package/dist/lib/useResizablePanel.mjs +75 -0
- package/dist/lib/useResizablePanel.mjs.map +1 -0
- package/dist/{message-Cu84fcqB.d.mts → message-DaiDXonE.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-BsSl7gPE.d.mts} +10 -3
- package/dist/operators.d.mts +2 -2
- 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/relative-date-label.d.mts +15 -0
- package/dist/styledComponentsInterop-8zScIQyC.mjs +33 -0
- package/dist/styledComponentsInterop-8zScIQyC.mjs.map +1 -0
- package/dist/{text-BaQdW8qa.d.mts → text-DjTGRUM1.d.mts} +1 -1
- package/dist/{theme-D9Y6NOzb.d.mts → theme-Biwx2eJZ.d.mts} +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/{types-NJtAxsU1.d.mts → types-B5VmRRMR.d.mts} +5 -3
- package/dist/types-Bsf1VsW6.d.mts +24 -0
- package/dist/{types-TV9nVfSe.d.mts → types-Cg3aXHUh2.d.mts} +1 -1
- package/dist/{types-DEh_pXgS.d.mts → types-Df0D37uh.d.mts} +3 -1
- package/dist/{types-C-TkDdkG.d.mts → types-V8UJX-rk.d.mts} +14 -2
- package/dist/types.d.mts +1 -1
- package/dist/types2.d.mts +2 -2
- package/dist/types3.d.mts +2 -2
- package/dist/types4.d.mts +2 -2
- package/dist/types5.d.mts +2 -0
- package/dist/url-state-ektb0HnB.d.mts +42 -0
- package/dist/url-state.d.mts +2 -0
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useFilterStateV2-C4itmN4S.d.mts → useFilterStateV2-BB14vCC-.d.mts} +3 -3
- package/dist/useFilterStateV2.d.mts +1 -1
- 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-B2U4GOH4.d.mts → useFormField-CQo08dR4.d.mts} +2 -2
- 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-B-Dev5D6.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-BHMNnJ8h.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-B22QjCrV.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/{value-control-resolver-BPlTeIX7.d.mts → value-control-resolver-qKTH1ErF.d.mts} +5 -3
- package/dist/value-control-resolver.d.mts +1 -1
- package/dist/variables/keyframes.mjs +1 -1
- package/llms.txt +6 -6
- package/package.json +14 -2
- package/skills/ui-authoring/COMPONENTS.md +71 -305
- package/skills/ui-authoring/PATTERNS.md +364 -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/Select-D6MqSYVa.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-BMBcfD_R.d.mts → index-8SLBz2NH.d.mts} +0 -0
- /package/dist/{index-BOn0AAue.d.mts → index-BINnViIh.d.mts} +0 -0
- /package/dist/{index-BYd3Btr1.d.mts → index-B_BBnMou.d.mts} +0 -0
- /package/dist/{index-CKKoxA9V.d.mts → index-BcsXXrHq.d.mts} +0 -0
- /package/dist/{index-CNxS4Tlu.d.mts → index-Bt4QNofW.d.mts} +0 -0
- /package/dist/{index-CWB6exYm.d.mts → index-BwFl_eS0.d.mts} +0 -0
- /package/dist/{index-CsuikFeJ.d.mts → index-CDGG7lCB.d.mts} +0 -0
- /package/dist/{index-CtJuGxUp.d.mts → index-CMuRFTR3.d.mts} +0 -0
- /package/dist/{index-CzItj62a.d.mts → index-CX869wwk.d.mts} +0 -0
- /package/dist/{index-D5tSVhTd.d.mts → index-CliqZ9rj.d.mts} +0 -0
- /package/dist/{index-DGsJdI5l.d.mts → index-CuheJfs-.d.mts} +0 -0
- /package/dist/{index-DkrC-i1D.d.mts → index-DBGd4WeR.d.mts} +0 -0
- /package/dist/{index-Es5nKSSL.d.mts → index-DDdPqD_H.d.mts} +0 -0
- /package/dist/{index-FtE8MXJ_.d.mts → index-DMRtRo7y.d.mts} +0 -0
- /package/dist/{index-IE5cwTAE2.d.mts → index-Dflz2i1X.d.mts} +0 -0
- /package/dist/{index-Oio5ygqN.d.mts → index-DvmLVvRD.d.mts} +0 -0
- /package/dist/{index-ehD5GjMH.d.mts → index-Wc1llEvP.d.mts} +0 -0
|
@@ -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-DlXyKYL5.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-GMXeF-3J.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HoverCopyableField-GMXeF-3J.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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;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,G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A;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} />;\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,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EAEpB,qBAAC,gBAAD;GAAgB,WAAW;aAA3B;IACG,cAAc,QACb,qBAAA,YAAA,EAAA,UAAA,CACG,mBAAmB,WAAW,oBAAC,qBAAD,EAAA,UAAsB,YAAiC,CAAA,EACrF,mBAAmB,aAClB,oBAAC,4BAAD,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,4 +1,4 @@
|
|
|
1
|
-
import { r as ButtonProps } from "./Button-
|
|
1
|
+
import { r as ButtonProps } from "./Button-BrI1s2-r.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-BpyOr8Ev.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-BpyOr8Ev.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-CcAyQpYN.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-WXc57DwN.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,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-BWlvBYB3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input-Bimw8KFj.mjs","names":["SmallCircleXInverseIcon"],"sources":["../components/Input/Input.tsx"],"sourcesContent":["import {\n cloneElement,\n type ComponentPropsWithoutRef,\n type CSSProperties,\n forwardRef,\n type MouseEventHandler,\n type ReactElement,\n type ReactNode,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius, Color, Spacing } from '@persona/design-tokens';\nimport { CircleXInverseIcon } from '@persona/icons';\nimport { CircleXInverseIcon as SmallCircleXInverseIcon } from '@persona/icons/12px';\nimport Button, { type ButtonProps } from 'design-system/components/Button';\nimport useFormField, {\n FormControlContext,\n} from 'design-system/components/FormControl/useFormField';\nimport { Paragraph } from 'design-system/components/Text';\nimport { isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport inputMixin, { type InputMixinProps, type InputSizes } from 'design-system/mixins/input';\n\nconst Container = styled.div`\n display: flex;\n position: relative;\n width: 100%;\n`;\n\nconst LeftIcon = styled.div<{ $size?: InputSizes }>`\n position: absolute;\n left: ${Spacing[2]};\n top: 50%;\n transform: translateY(-50%);\n margin: 0;\n font-size: 0px;\n color: ${Color.BorderIconSecondary};\n height: ${({ $size }) => ($size === 'sm' ? '12px' : '16px')};\n width: ${({ $size }) => ($size === 'sm' ? '12px' : '16px')};\n pointer-events: none;\n\n svg {\n height: 100%;\n width: 100%;\n }\n`;\n\nconst InputButtonContainer = styled.div<{ $size?: InputSizes }>`\n position: absolute;\n display: flex;\n gap: ${Spacing[2]};\n right: ${({ $size }) => ($size === 'sm' ? '3px' : Spacing[1])};\n top: 50%;\n transform: translateY(-50%);\n margin: 0;\n font-size: 0px;\n`;\n\nexport const ClearButton = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n height: ${({ size }) => (size === 'sm' ? '18px' : '24px')};\n width: ${({ size }) => (size === 'sm' ? '18px' : '24px')};\n border-radius: ${BorderRadius.Md};\n color: ${Color.BorderIconSecondary};\n\n ${({ disabled }) =>\n disabled &&\n css`\n color: ${Color.BorderIconDisabled};\n `}\n\n &${isHovered}${isNotDisabled} {\n background-color: transparent;\n }\n\n svg {\n height: ${({ size }) => (size === 'sm' ? '12px' : '16px')};\n width: ${({ size }) => (size === 'sm' ? '12px' : '16px')};\n }\n`;\n\nconst SuffixTextContainer = styled.div<{ $size: InputSizes }>`\n position: absolute;\n right: ${Spacing[2]};\n top: ${({ $size }) => ($size === 'sm' ? '2px' : '6px')};\n`;\n\ninterface StyledInputProps extends InputMixinProps {\n $leftIcon?: ReactNode;\n $hasRightItem?: boolean;\n}\n\nexport interface InputProps\n extends Omit<ComponentPropsWithoutRef<'input'>, 'size'>, Omit<InputMixinProps, '$size'> {\n /**\n * Size of the input. If you need the HTML size attr, use inputSize.\n */\n size?: InputSizes;\n\n /**\n * `size` HTML attr on `<input>`\n */\n inputSize?: ComponentPropsWithoutRef<'input'>['size'];\n\n leftIcon?: StyledInputProps['$leftIcon'];\n hasRightItem?: boolean;\n}\n\nconst InputBase = styled.input<StyledInputProps>`\n ${inputMixin};\n line-height: 1;\n\n &::placeholder {\n color: ${({ theme }) => theme.color.text.secondary};\n }\n\n ${({ $size, $leftIcon, $hasRightItem }) => {\n let btnSpacing: string;\n switch ($size) {\n default:\n case 'md':\n btnSpacing = `calc(${Spacing[3]} + 16px + ${Spacing[1]})`;\n return css`\n padding-right: ${$hasRightItem ? btnSpacing : Spacing[3]};\n padding-left: ${$leftIcon ? btnSpacing : Spacing[3]};\n `;\n case 'sm':\n btnSpacing = `calc(${Spacing[2]} + 16px + ${Spacing[1]})`;\n return css`\n padding-right: ${$hasRightItem ? btnSpacing : Spacing[2]};\n padding-left: ${$leftIcon ? btnSpacing : Spacing[2]};\n `;\n }\n }}\n`;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { size, leftIcon, hasRightItem, id, hasWarning, hasError, disabled, maxLength, ...props },\n ref,\n) {\n const field = useFormField({ hasWarning, hasError, disabled, inputId: id, maxLength });\n\n return (\n <InputBase\n $size={size}\n $leftIcon={leftIcon}\n $hasRightItem={hasRightItem}\n ref={ref}\n id={field.inputId}\n aria-describedby={`${field.helperTextId}${field.hasWarning ? ` ${field.warningTextId}` : ''}`}\n aria-errormessage={field.hasError ? field.errorTextId : undefined}\n aria-invalid={field.hasError}\n hasWarning={field.hasWarning}\n hasError={field.hasError}\n disabled={field.disabled}\n maxLength={field.maxLength}\n {...props}\n size={props.inputSize}\n />\n );\n});\n\nexport interface InputGroupProps\n extends ComponentPropsWithoutRef<'div'>, Omit<InputMixinProps, '$size'> {\n /**\n * Input\n */\n children: ReactElement<InputProps>;\n\n /**\n * Size of the input. If you need the HTML size attr, use inputSize.\n */\n size?: InputSizes;\n\n /**\n * Icon to render to the left of the input field.\n *\n * Import icon from `@persona/icons`. Use 24px for `lg` input size.\n */\n leftIcon?: ReactNode;\n\n /**\n * Renders clear button to the right and calls function upon click.\n */\n onClear?: MouseEventHandler<HTMLButtonElement>;\n\n /**\n * Button to be rendered to the right of the input\n */\n rightButton?: ReactElement<ButtonProps>;\n\n /**\n * Disabled prop will be passed down to `<Input>`\n */\n disabled?: boolean;\n\n /**\n * Suffix text to be shown to the right of the input (inside the input field)\n */\n suffix?: string;\n}\n\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function InputGroup(\n {\n size = 'md',\n leftIcon,\n onClear,\n rightButton,\n children,\n disabled,\n hasWarning,\n hasError,\n suffix,\n ...props\n },\n ref,\n) {\n const field = useFormField({ hasWarning, hasError, disabled });\n const inputButtonContainerRef = useRef<HTMLDivElement>();\n const [inputPaddingRight, setInputPaddingRight] = useState<string | null>(null);\n\n const suffixContainerRef = useRef<HTMLDivElement | null>(null);\n const [suffixPaddingRight, setSuffixPaddingRight] = useState<string | null>(null);\n\n useEffect(() => {\n // We only need to calculate padding in presence of the right button\n if (rightButton && inputButtonContainerRef.current) {\n setInputPaddingRight(`${12 + inputButtonContainerRef.current.offsetWidth + 4}px`);\n }\n }, [setInputPaddingRight]);\n\n useEffect(() => {\n if (suffix && suffixContainerRef.current) {\n // 12px is 8px padding to the right, plus the 4px gap between the suffix and the input.\n setSuffixPaddingRight(`${12 + suffixContainerRef.current.offsetWidth}px`);\n }\n }, [suffix, setSuffixPaddingRight]);\n\n const rightButtonStyles: CSSProperties =\n size === 'sm'\n ? {\n height: '18px',\n }\n : {};\n\n return (\n <FormControlContext.Provider value={field}>\n <Container ref={ref} {...props}>\n {leftIcon && <LeftIcon $size={size}>{leftIcon}</LeftIcon>}\n {cloneElement(children, {\n size,\n leftIcon: leftIcon,\n ...(rightButton ? { rightButton } : {}),\n hasRightItem: onClear || suffix,\n style:\n inputPaddingRight || suffixPaddingRight\n ? {\n paddingRight: inputPaddingRight || suffixPaddingRight,\n }\n : {},\n })}\n\n {/* Renders only if there's a suffix and NO button */}\n {/* At some point, this should be moved so that it's not absolutely positioned, and\n these are both wrapped within an \"input\" container */}\n {suffix && !(onClear || rightButton) && (\n <SuffixTextContainer $size={size} ref={suffixContainerRef}>\n <Paragraph size={size}>{suffix}</Paragraph>\n </SuffixTextContainer>\n )}\n\n {(onClear || rightButton) && ( // TODO: Render only if value is present\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n <InputButtonContainer ref={inputButtonContainerRef} $size={size}>\n {onClear && (\n <ClearButton\n onClick={onClear}\n disabled={field.disabled}\n aria-label='Clear'\n size={size}\n >\n {size === 'sm' ? <SmallCircleXInverseIcon /> : <CircleXInverseIcon />}\n </ClearButton>\n )}\n {rightButton &&\n cloneElement(rightButton, {\n size: 'sm',\n width: rightButton.props.width || 'auto',\n style: rightButtonStyles,\n })}\n </InputButtonContainer>\n )}\n </Container>\n </FormControlContext.Provider>\n );\n});\n\nexport default Input;\n"],"mappings":";;;;;;;;;;;;AAyBA,MAAM,YAAY,OAAO,GAAG;;;;;AAM5B,MAAM,WAAW,OAAO,GAA2B;;UAEzC,QAAQ,GAAG;;;;;WAKV,MAAM,oBAAoB;aACxB,EAAE,YAAa,UAAU,OAAO,SAAS,OAAQ;YAClD,EAAE,YAAa,UAAU,OAAO,SAAS,OAAQ;;;;;;;;AAS7D,MAAM,uBAAuB,OAAO,GAA2B;;;SAGtD,QAAQ,GAAG;YACR,EAAE,YAAa,UAAU,OAAO,QAAQ,QAAQ,GAAI;;;;;;AAOhE,MAAa,cAAc,OAAO,OAAO,CAAC,MAAM;CAC9C,OAAO;CACP,SAAS;CACV,CAAC;;;aAGW,EAAE,WAAY,SAAS,OAAO,SAAS,OAAQ;YAChD,EAAE,WAAY,SAAS,OAAO,SAAS,OAAQ;mBACxC,aAAa,GAAG;WACxB,MAAM,oBAA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AAW;MACL;gBAEL,SAAS,OAAO,oBAACA,sBAAD,EAA2B,CAAA,GAAG,oBAAC,oBAAD,EAAsB,CAAA;MACzD,CAAA,EAEf,eACC,aAAa,aAAa;MACxB,MAAM;MACN,OAAO,YAAY,MAAM,SAAS;MAClC,OAAO;MACR,CAAC,CACiB;;IAEf;;EACgB,CAAA;EAEhC"}
|
|
1
|
+
{"version":3,"file":"Input-BWlvBYB3.mjs","names":["SmallCircleXInverseIcon"],"sources":["../components/Input/Input.tsx"],"sourcesContent":["import {\n cloneElement,\n type ComponentPropsWithoutRef,\n type CSSProperties,\n forwardRef,\n type MouseEventHandler,\n type ReactElement,\n type ReactNode,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius, Color, Spacing } from '@persona/design-tokens';\nimport { CircleXInverseIcon } from '@persona/icons';\nimport { CircleXInverseIcon as SmallCircleXInverseIcon } from '@persona/icons/12px';\nimport Button, { type ButtonProps } from 'design-system/components/Button';\nimport useFormField, {\n FormControlContext,\n} from 'design-system/components/FormControl/useFormField';\nimport { Paragraph } from 'design-system/components/Text';\nimport { isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport inputMixin, { type InputMixinProps, type InputSizes } from 'design-system/mixins/input';\n\nconst Container = styled.div`\n display: flex;\n position: relative;\n width: 100%;\n`;\n\nconst LeftIcon = styled.div<{ $size?: InputSizes }>`\n position: absolute;\n left: ${Spacing[2]};\n top: 50%;\n transform: translateY(-50%);\n margin: 0;\n font-size: 0px;\n color: ${Color.BorderIconSecondary};\n height: ${({ $size }) => ($size === 'sm' ? '12px' : '16px')};\n width: ${({ $size }) => ($size === 'sm' ? '12px' : '16px')};\n pointer-events: none;\n\n svg {\n height: 100%;\n width: 100%;\n }\n`;\n\nconst InputButtonContainer = styled.div<{ $size?: InputSizes }>`\n position: absolute;\n display: flex;\n gap: ${Spacing[2]};\n right: ${({ $size }) => ($size === 'sm' ? '3px' : Spacing[1])};\n top: 50%;\n transform: translateY(-50%);\n margin: 0;\n font-size: 0px;\n`;\n\nexport const ClearButton = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n height: ${({ size }) => (size === 'sm' ? '18px' : '24px')};\n width: ${({ size }) => (size === 'sm' ? '18px' : '24px')};\n border-radius: ${BorderRadius.Md};\n color: ${Color.BorderIconSecondary};\n\n ${({ disabled }) =>\n disabled &&\n css`\n color: ${Color.BorderIconDisabled};\n `}\n\n &${isHovered}${isNotDisabled} {\n background-color: transparent;\n }\n\n svg {\n height: ${({ size }) => (size === 'sm' ? '12px' : '16px')};\n width: ${({ size }) => (size === 'sm' ? '12px' : '16px')};\n }\n`;\n\nconst SuffixTextContainer = styled.div<{ $size: InputSizes }>`\n position: absolute;\n right: ${Spacing[2]};\n top: ${({ $size }) => ($size === 'sm' ? '2px' : '6px')};\n`;\n\ninterface StyledInputProps extends InputMixinProps {\n $leftIcon?: ReactNode;\n $hasRightItem?: boolean;\n}\n\nexport interface InputProps\n extends Omit<ComponentPropsWithoutRef<'input'>, 'size'>, Omit<InputMixinProps, '$size'> {\n /**\n * Size of the input. If you need the HTML size attr, use inputSize.\n */\n size?: InputSizes;\n\n /**\n * `size` HTML attr on `<input>`\n */\n inputSize?: ComponentPropsWithoutRef<'input'>['size'];\n\n leftIcon?: StyledInputProps['$leftIcon'];\n hasRightItem?: boolean;\n}\n\nconst InputBase = styled.input<StyledInputProps>`\n ${inputMixin};\n line-height: 1;\n\n &::placeholder {\n color: ${({ theme }) => theme.color.text.secondary};\n }\n\n ${({ $size, $leftIcon, $hasRightItem }) => {\n let btnSpacing: string;\n switch ($size) {\n default:\n case 'md':\n btnSpacing = `calc(${Spacing[3]} + 16px + ${Spacing[1]})`;\n return css`\n padding-right: ${$hasRightItem ? btnSpacing : Spacing[3]};\n padding-left: ${$leftIcon ? btnSpacing : Spacing[3]};\n `;\n case 'sm':\n btnSpacing = `calc(${Spacing[2]} + 16px + ${Spacing[1]})`;\n return css`\n padding-right: ${$hasRightItem ? btnSpacing : Spacing[2]};\n padding-left: ${$leftIcon ? btnSpacing : Spacing[2]};\n `;\n }\n }}\n`;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { size, leftIcon, hasRightItem, id, hasWarning, hasError, disabled, maxLength, ...props },\n ref,\n) {\n const field = useFormField({ hasWarning, hasError, disabled, inputId: id, maxLength });\n\n return (\n <InputBase\n $size={size}\n $leftIcon={leftIcon}\n $hasRightItem={hasRightItem}\n ref={ref}\n id={field.inputId}\n aria-describedby={`${field.helperTextId}${field.hasWarning ? ` ${field.warningTextId}` : ''}`}\n aria-errormessage={field.hasError ? field.errorTextId : undefined}\n aria-invalid={field.hasError}\n hasWarning={field.hasWarning}\n hasError={field.hasError}\n disabled={field.disabled}\n maxLength={field.maxLength}\n {...props}\n size={props.inputSize}\n />\n );\n});\n\nexport interface InputGroupProps\n extends ComponentPropsWithoutRef<'div'>, Omit<InputMixinProps, '$size'> {\n /**\n * Input\n */\n children: ReactElement<InputProps>;\n\n /**\n * Size of the input. If you need the HTML size attr, use inputSize.\n */\n size?: InputSizes;\n\n /**\n * Icon to render to the left of the input field.\n *\n * Import icon from `@persona/icons`. Use 24px for `lg` input size.\n */\n leftIcon?: ReactNode;\n\n /**\n * Renders clear button to the right and calls function upon click.\n */\n onClear?: MouseEventHandler<HTMLButtonElement>;\n\n /**\n * Button to be rendered to the right of the input\n */\n rightButton?: ReactElement<ButtonProps>;\n\n /**\n * Disabled prop will be passed down to `<Input>`\n */\n disabled?: boolean;\n\n /**\n * Suffix text to be shown to the right of the input (inside the input field)\n */\n suffix?: string;\n}\n\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function InputGroup(\n {\n size = 'md',\n leftIcon,\n onClear,\n rightButton,\n children,\n disabled,\n hasWarning,\n hasError,\n suffix,\n ...props\n },\n ref,\n) {\n const field = useFormField({ hasWarning, hasError, disabled });\n const inputButtonContainerRef = useRef<HTMLDivElement>();\n const [inputPaddingRight, setInputPaddingRight] = useState<string | null>(null);\n\n const suffixContainerRef = useRef<HTMLDivElement | null>(null);\n const [suffixPaddingRight, setSuffixPaddingRight] = useState<string | null>(null);\n\n useEffect(() => {\n // We only need to calculate padding in presence of the right button\n if (rightButton && inputButtonContainerRef.current) {\n setInputPaddingRight(`${12 + inputButtonContainerRef.current.offsetWidth + 4}px`);\n }\n }, [setInputPaddingRight]);\n\n useEffect(() => {\n if (suffix && suffixContainerRef.current) {\n // 12px is 8px padding to the right, plus the 4px gap between the suffix and the input.\n setSuffixPaddingRight(`${12 + suffixContainerRef.current.offsetWidth}px`);\n }\n }, [suffix, setSuffixPaddingRight]);\n\n const rightButtonStyles: CSSProperties =\n size === 'sm'\n ? {\n height: '18px',\n }\n : {};\n\n return (\n <FormControlContext.Provider value={field}>\n <Container ref={ref} {...props}>\n {leftIcon && <LeftIcon $size={size}>{leftIcon}</LeftIcon>}\n {cloneElement(children, {\n size,\n leftIcon: leftIcon,\n ...(rightButton ? { rightButton } : {}),\n hasRightItem: onClear || suffix,\n style:\n inputPaddingRight || suffixPaddingRight\n ? {\n paddingRight: inputPaddingRight || suffixPaddingRight,\n }\n : {},\n })}\n\n {/* Renders only if there's a suffix and NO button */}\n {/* At some point, this should be moved so that it's not absolutely positioned, and\n these are both wrapped within an \"input\" container */}\n {suffix && !(onClear || rightButton) && (\n <SuffixTextContainer $size={size} ref={suffixContainerRef}>\n <Paragraph size={size}>{suffix}</Paragraph>\n </SuffixTextContainer>\n )}\n\n {(onClear || rightButton) && ( // TODO: Render only if value is present\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n <InputButtonContainer ref={inputButtonContainerRef} $size={size}>\n {onClear && (\n <ClearButton\n onClick={onClear}\n disabled={field.disabled}\n aria-label='Clear'\n size={size}\n >\n {size === 'sm' ? <SmallCircleXInverseIcon /> : <CircleXInverseIcon />}\n </ClearButton>\n )}\n {rightButton &&\n cloneElement(rightButton, {\n size: 'sm',\n width: rightButton.props.width ||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Q,sBAAsB,CAAC;CAEnC,MAAM,oBACJ,SAAS,OACL,EACE,QAAQ,QACT,GACD,EAAE;AAER,QACE,oBAAC,mBAAmB,UAApB;EAA6B,OAAO;YAClC,qBAAC,WAAD;GAAgB;GAAK,GAAI;aAAzB;IACG,YAAY,oBAAC,UAAD;KAAU,OAAO;eAAO;KAAoB,CAAA;IACxD,aAAa,UAAU;KACtB;KACU;KACV,GAAI,cAAc,EAAE,aAAa,GAAG,EAAE;KACtC,cAAc,WAAW;KACzB,OACE,qBAAqB,qBACjB,EACE,cAAc,qBAAqB,oBACpC,GACD,EAAE;KACT,CAAC;IAKD,UAAU,EAAE,WAAW,gBACtB,oBAAC,qBAAD;KAAqB,OAAO;KAAM,KAAK;eACrC,oBAAC,WAAD;MAAiB;gBAAO;MAAmB,CAAA;KACvB,CAAA;KAGtB,WAAW,gBAEX,qBAAC,sBAAD;KAAsB,KAAK;KAAyB,OAAO;eAA3D,CACG,WACC,oBAAC,aAAD;MACE,SAAS;MACT,UAAU,MAAM;MAChB,cAAW;MACL;gBAEL,SAAS,OAAO,oBAACA,sBAAD,EAA2B,CAAA,GAAG,oBAAC,oBAAD,EAAsB,CAAA;MACzD,CAAA,EAEf,eACC,aAAa,aAAa;MACxB,MAAM;MACN,OAAO,YAAY,MAAM,SAAS;MAClC,OAAO;MACR,CAAC,CACiB;;IAEf;;EACgB,CAAA;EAEhC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
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-BPdn-ofQ.mjs";
|
|
2
|
+
import { r as ButtonProps } from "./Button-BrI1s2-r.mjs";
|
|
3
|
+
import { n as InputSizes, t as InputMixinProps } from "./input-M7BEIewR.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, {
|
|
@@ -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-qlQVD5h0.d.mts.map
|
package/dist/Input.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as InputProps, i as InputGroupProps, n as Input, r as InputGroup, t as ClearButton } from "./Input-
|
|
1
|
+
import { a as InputProps, i as InputGroupProps, n as Input, r as InputGroup, t as ClearButton } from "./Input-qlQVD5h0.mjs";
|
|
2
2
|
export { ClearButton, Input, Input as default, InputGroup, InputGroupProps, InputProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as InputSizes, t as InputMixinProps } from "./input-
|
|
1
|
+
import { n as InputSizes, t as InputMixinProps } from "./input-M7BEIewR.mjs";
|
|
2
2
|
|
|
3
3
|
//#region types/InputProps.d.ts
|
|
4
4
|
interface InputProps extends Omit<InputMixinProps, '$size'> {
|
|
@@ -13,4 +13,4 @@ interface InputProps extends Omit<InputMixinProps, '$size'> {
|
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
export { InputProps as t };
|
|
16
|
-
//# sourceMappingURL=InputProps-
|
|
16
|
+
//# sourceMappingURL=InputProps-D_7MnQfE.d.mts.map
|
package/dist/InputProps.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as InputProps } from "./InputProps-
|
|
1
|
+
import { t as InputProps } from "./InputProps-D_7MnQfE.mjs";
|
|
2
2
|
export { InputProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ValueControlProps } from "./types-
|
|
1
|
+
import { t as ValueControlProps } from "./types-B5VmRRMR.mjs";
|
|
2
2
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region components/DataTable/TableControls/FiltersV2/value-controls/IntegerValueControl/IntegerValueControl.d.ts
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region patterns/LayoutLoadingSpinner/LayoutLoadingSpinner.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Centered 120px loading ring that fills its container. Use as the loading state for a page or
|
|
6
|
+
* embedded app when no layout-specific shimmer exists.
|
|
7
|
+
*/
|
|
8
|
+
declare const LayoutLoadingSpinner: () => _$react_jsx_runtime0.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { LayoutLoadingSpinner };
|
|
11
|
+
//# sourceMappingURL=LayoutLoadingSpinner.d.mts.map
|
package/dist/Link.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ReactNode } from "react";
|
|
1
2
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
3
|
import { LinkProps as LinkProps$1 } from "react-router-dom";
|
|
3
|
-
import { AnchorHTMLAttributes, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region components/Link/Link.d.ts
|
|
6
6
|
type Target = '_blank' | '_self' | '_parent' | '_top';
|
|
@@ -18,7 +18,7 @@ interface BaseLinkProps {
|
|
|
18
18
|
}
|
|
19
19
|
interface ExternalLinkProps extends BaseLinkProps, AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
20
20
|
/**
|
|
21
|
-
* The URL to navigate to. Can be internal (e.g., "/
|
|
21
|
+
* The URL to navigate to. Can be internal (e.g., "/settings") or external (e.g., "https://example.com").
|
|
22
22
|
*/
|
|
23
23
|
url: string;
|
|
24
24
|
/**
|
|
@@ -28,7 +28,7 @@ interface ExternalLinkProps extends BaseLinkProps, AnchorHTMLAttributes<HTMLAnch
|
|
|
28
28
|
}
|
|
29
29
|
interface InternalLinkProps extends BaseLinkProps, Omit<LinkProps$1, 'to'> {
|
|
30
30
|
/**
|
|
31
|
-
* The URL to navigate to. Should be an internal route (e.g., "/
|
|
31
|
+
* The URL to navigate to. Should be an internal route (e.g., "/settings").
|
|
32
32
|
*/
|
|
33
33
|
url: string;
|
|
34
34
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { paragraphMixins } from "./mixins/text.mjs";
|
|
3
|
-
import { n as Stack } from "./Stack-Bl54WmhY.mjs";
|
|
1
|
+
import { a as styled, r as css } from "./styledComponentsInterop-8zScIQyC.mjs";
|
|
4
2
|
import { HeadlessAriaButton } from "./lib/HeadlessAriaButton.mjs";
|
|
3
|
+
import { paragraphMixins } from "./mixins/text.mjs";
|
|
4
|
+
import { isFocused, isHovered, isNotDisabled } from "./lib/pseudoClass.mjs";
|
|
5
5
|
import { findIndexByKey, moveItemByIndex } from "./lib/reorderItems.mjs";
|
|
6
6
|
import { Z_INDICES } from "./lib/zindex.mjs";
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
7
|
+
import { n as Stack } from "./Stack-Bre2oiov.mjs";
|
|
8
|
+
import { n as Button$1, t as IconButton } from "./IconButton-BgL3QUVO.mjs";
|
|
9
|
+
import { a as StyledTruncatedText, i as StickerContentContainer, n as Sticker, r as StickerContainer } from "./Sticker-CQ6sOKUj.mjs";
|
|
10
|
+
import { t as FormGroupContext } from "./useFormGroup-CaTiD_Yt.mjs";
|
|
11
|
+
import { o as MenuHeading, r as ListItem } from "./Menu-38UCGcte.mjs";
|
|
12
|
+
import { n as DropdownMenu_default } from "./DropdownMenu-CUnf420M.mjs";
|
|
13
|
+
import { s as Popover_default } from "./Popover-DlXyKYL5.mjs";
|
|
14
|
+
import { t as Container } from "./FormControl-1BmoYFCu.mjs";
|
|
14
15
|
import { BorderRadius, Color, Spacing, Typography } from "@persona/design-tokens";
|
|
15
|
-
import styled, { css } from "styled-components";
|
|
16
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
import { DropIndicator, GridList, GridListItem, Header, ListBoxSection, useDragAndDrop } from "react-aria-components";
|
|
18
16
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
17
|
+
import { DropIndicator, GridList, GridListItem, Header, ListBoxSection, useDragAndDrop } from "react-aria-components";
|
|
18
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
import { DragIcon } from "@persona/icons";
|
|
20
20
|
import { MoreIcon as MoreIcon$1, XIcon as XIcon$1 } from "@persona/icons/12px";
|
|
21
21
|
import { uniqueId } from "lodash-es";
|
|
@@ -424,7 +424,7 @@ const LogicRow = ({ condition, attributeName, operator, matchLevelName, editable
|
|
|
424
424
|
children: /* @__PURE__ */ jsxs(LogicRuleContainer, {
|
|
425
425
|
$hideCondition: hideCondition,
|
|
426
426
|
$size: size,
|
|
427
|
-
children: [!hideCondition && (condition || "\xA0"), attributeName && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
427
|
+
children: [!hideCondition && (condition || "\xA0"), attributeName && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
428
428
|
/* @__PURE__ */ jsx(LogicRowSticker, {
|
|
429
429
|
disabled: !editable,
|
|
430
430
|
children: attributeName
|
|
@@ -444,4 +444,4 @@ const ListBox = Object.assign(ListBox$1, { LogicRow });
|
|
|
444
444
|
//#endregion
|
|
445
445
|
export { useListBoxContext as n, ListBox as t };
|
|
446
446
|
|
|
447
|
-
//# sourceMappingURL=ListBox-
|
|
447
|
+
//# sourceMappingURL=ListBox-9jHHEaqW.mjs.map
|