@persona/design-system 0.3.1 → 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 +19 -0
- package/README.md +1 -1
- package/dist/{Action-DL3kHI9Z.d.mts → Action-CcAyQpYN.d.mts} +3 -3
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +4 -4
- package/dist/AdvancedFilterRulesPopover.d.mts +3 -3
- package/dist/ArrayValueControl.d.mts +1 -1
- package/dist/Attribute.d.mts +3 -3
- package/dist/BooleanValueControl.d.mts +1 -1
- package/dist/BottomPanel.d.mts +32 -0
- package/dist/{Breadcrumb-Czgdi0xf.d.mts → Breadcrumb-Df06cTnA.d.mts} +1 -1
- package/dist/Breadcrumb.d.mts +1 -1
- package/dist/{Breadcrumbs-zei-cpdU.d.mts → Breadcrumbs-D_Gzd4_J.d.mts} +2 -2
- package/dist/{Breadcrumbs-ed4wRDS7.mjs → Breadcrumbs-Zi5p0HDR.mjs} +3 -3
- package/dist/{Breadcrumbs-ed4wRDS7.mjs.map → Breadcrumbs-Zi5p0HDR.mjs.map} +1 -1
- package/dist/Breadcrumbs.d.mts +1 -1
- package/dist/{Button-CKzNTpPL.d.mts → Button-BrI1s2-r.d.mts} +2 -2
- package/dist/Button.d.mts +1 -1
- package/dist/{Calendar-CcxN7y3e.d.mts → Calendar-DjnoZVcT.d.mts} +1 -1
- package/dist/Calendar.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-pr4FQWjn.d.mts → Card-mZDNFaJy.d.mts} +3 -3
- package/dist/Card.d.mts +1 -1
- package/dist/{CardV2-D3m5EKlp.mjs → CardV2-CXxzl1EZ.mjs} +6 -6
- package/dist/{CardV2-D3m5EKlp.mjs.map → CardV2-CXxzl1EZ.mjs.map} +1 -1
- package/dist/{Checkbox-Bmm-r5ei.d.mts → Checkbox-CwPXPLCi.d.mts} +1 -1
- package/dist/{Checkbox-Ccuicmlo.mjs → Checkbox-DxNHp59y.mjs} +1 -1
- package/dist/{Checkbox-Ccuicmlo.mjs.map → Checkbox-DxNHp59y.mjs.map} +1 -1
- package/dist/Checkbox.d.mts +1 -1
- package/dist/CheckboxGroupField.d.mts +1 -1
- package/dist/ChoicesValueControl.d.mts +1 -1
- package/dist/{Combobox-BGRyr_-L.mjs → Combobox-BUtqtzKl.mjs} +5 -5
- package/dist/{Combobox-BGRyr_-L.mjs.map → Combobox-BUtqtzKl.mjs.map} +1 -1
- package/dist/{Combobox-Bf_Xe1BG.d.mts → Combobox-C9QBItsc.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-CWzN8GML.d.mts → ComboboxBase-BkSpdmsT.d.mts} +6 -6
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-iSuvyOx2.d.mts → ComboboxMultiSelect-DkVfwSKH.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-DVRFKPi1.d.mts → ComboboxSingleSelect-CpumBcDn.d.mts} +4 -4
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-C_61pgp7.d.mts → CompactBar-COxu_FDd.d.mts} +3 -3
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ConfigFormGroup-DGCTW3by.mjs → ConfigFormGroup-aSdn2r6Z.mjs} +1 -1
- package/dist/{ConfigFormGroup-DGCTW3by.mjs.map → ConfigFormGroup-aSdn2r6Z.mjs.map} +1 -1
- package/dist/{ControlBar-0XwbM4yC.d.mts → ControlBar-DwAhPcb5.d.mts} +12 -2
- package/dist/ControlBar.d.mts +1 -1
- package/dist/DataTable.d.mts +4 -3
- package/dist/{DateField-CKeSIhGy.d.mts → DateField-tOyrGcx1.d.mts} +2 -2
- package/dist/DateField.d.mts +1 -1
- package/dist/{DatePicker-B1iWrqR5.d.mts → DatePicker-Bs9JODNg.d.mts} +2 -2
- package/dist/{DatePicker-BNnZ6L1y.mjs → DatePicker-CLP-ajza.mjs} +71 -16
- package/dist/DatePicker-CLP-ajza.mjs.map +1 -0
- package/dist/DatePicker.d.mts +1 -1
- package/dist/{DateRangePicker-BmF9eH9R.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-BlVeFbJ0.mjs → DropdownButton-CCAfNZ9h.mjs} +2 -2
- package/dist/{DropdownButton-BlVeFbJ0.mjs.map → DropdownButton-CCAfNZ9h.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-DuTnq9j7.d.mts → DropdownMenu-BoatixlO.d.mts} +2 -2
- package/dist/{DropdownMenu-82xH1AZr.mjs → DropdownMenu-CUnf420M.mjs} +2 -2
- package/dist/{DropdownMenu-82xH1AZr.mjs.map → DropdownMenu-CUnf420M.mjs.map} +1 -1
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-DX50vo-U.d.mts → ErrorProps-C9T857Wk.d.mts} +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/{FieldRegistry-D1vghSC_.d.mts → FieldRegistry-D6niLExM.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-Ck085Dic.d.mts → FilterBar-DfBV7yKM.d.mts} +10 -4
- package/dist/FilterBar.d.mts +1 -1
- package/dist/FilterPickerMenu.d.mts +2 -2
- package/dist/FilterPill.d.mts +1 -1
- package/dist/FilterPopover.d.mts +1 -1
- package/dist/FloatValueControl.d.mts +1 -1
- package/dist/{FormControl-CfpwZGlD.d.mts → FormControl-0H0Jeind.d.mts} +2 -2
- package/dist/{FormControl-D1HIqDKm.mjs → FormControl-1BmoYFCu.mjs} +1 -1
- package/dist/{FormControl-D1HIqDKm.mjs.map → FormControl-1BmoYFCu.mjs.map} +1 -1
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +1 -1
- package/dist/{FormField-0p4y0sS5.d.mts → FormField-BcaFdmo5.d.mts} +2 -2
- package/dist/{FormField-CVnbsNvU.mjs → FormField-oBKH25qf.mjs} +11 -11
- package/dist/{FormField-CVnbsNvU.mjs.map → FormField-oBKH25qf.mjs.map} +1 -1
- package/dist/FormField.d.mts +1 -1
- package/dist/Grid.d.mts +38 -0
- package/dist/GridItem.d.mts +17 -0
- package/dist/{Header-gDUTQgWj.d.mts → Header-BjSoTEX_.d.mts} +1 -1
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-CqhiRb5g.d.mts → HelperTooltip-S20wVFCS.d.mts} +2 -2
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/{HoverCopyableField-HWshrU_1.mjs → HoverCopyableField-GMXeF-3J.mjs} +2 -2
- package/dist/{HoverCopyableField-HWshrU_1.mjs.map → HoverCopyableField-GMXeF-3J.mjs.map} +1 -1
- package/dist/{IconButton-CLsHdYm7.d.mts → IconButton-BpyOr8Ev.d.mts} +2 -2
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.mts +1 -1
- package/dist/InlineCombobox.d.mts +1 -1
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Input-DoB8YswA.mjs → Input-BWlvBYB3.mjs} +1 -1
- package/dist/{Input-DoB8YswA.mjs.map → Input-BWlvBYB3.mjs.map} +1 -1
- package/dist/{Input-BHHWpSKN.d.mts → Input-qlQVD5h0.d.mts} +5 -5
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-sHxlDiss.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/{ListBox-B9uuMt2R.mjs → ListBox-9jHHEaqW.mjs} +5 -5
- package/dist/{ListBox-B9uuMt2R.mjs.map → ListBox-9jHHEaqW.mjs.map} +1 -1
- package/dist/{ListBox-BrY1bQ5-.d.mts → ListBox-ZE3MYMt6.d.mts} +3 -3
- package/dist/ListBox.d.mts +1 -1
- package/dist/ListBoxField.d.mts +2 -2
- package/dist/{LoadingShimmer-dsBWRdTU.mjs → LoadingShimmer-a2Hv0kAq.mjs} +1 -1
- package/dist/{LoadingShimmer-dsBWRdTU.mjs.map → LoadingShimmer-a2Hv0kAq.mjs.map} +1 -1
- package/dist/LoadingShimmer.d.mts +1 -1
- package/dist/{LogicRow-9a_klV2v.d.mts → LogicRow-CbMmaWXU.d.mts} +3 -3
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +2 -2
- package/dist/{Menu-CHbUf9PQ.mjs → Menu-38UCGcte.mjs} +1 -1
- package/dist/{Menu-CHbUf9PQ.mjs.map → Menu-38UCGcte.mjs.map} +1 -1
- package/dist/{Menu-D4Y_J-QI.d.mts → Menu-ZShdhNd7.d.mts} +3 -3
- package/dist/Menu.d.mts +1 -1
- package/dist/Modal.d.mts +1 -1
- package/dist/{PageHeader-XxGsFLHb.mjs → PageHeader-B2-Slzhl.mjs} +2 -2
- package/dist/{PageHeader-XxGsFLHb.mjs.map → PageHeader-B2-Slzhl.mjs.map} +1 -1
- package/dist/PageHeader.d.mts +1 -1
- package/dist/{PageSelector-BDo3ge1E.d.mts → PageSelector-BcZx4nqe.d.mts} +3 -3
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-DvVKQLdC.mjs → Pagination-CtUz0gdA.mjs} +3 -3
- package/dist/{Pagination-DvVKQLdC.mjs.map → Pagination-CtUz0gdA.mjs.map} +1 -1
- package/dist/{Pagination-Dcmv7bVe.d.mts → Pagination-j4hF7GOk.d.mts} +2 -2
- package/dist/Pagination.d.mts +1 -1
- package/dist/{Pii-BD48BtZ0.mjs → Pii-RwKn-K84.mjs} +1 -1
- package/dist/{Pii-BD48BtZ0.mjs.map → Pii-RwKn-K84.mjs.map} +1 -1
- package/dist/PillShell.d.mts +1 -1
- package/dist/{Popover-DNH8Jx1-.mjs → Popover-DlXyKYL5.mjs} +1 -1
- package/dist/{Popover-DNH8Jx1-.mjs.map → Popover-DlXyKYL5.mjs.map} +1 -1
- package/dist/ProgressIndicator.d.mts +5 -3
- package/dist/{PseudoClassProps-DgT5G_z5.d.mts → PseudoClassProps-BPdn-ofQ.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-DSMPX5_2.mjs → Radio-cLL9oatf.mjs} +1 -1
- package/dist/{Radio-DSMPX5_2.mjs.map → Radio-cLL9oatf.mjs.map} +1 -1
- package/dist/{RadioGroup-D5IITQLz.mjs → RadioGroup-BGo_kXKh.mjs} +2 -2
- package/dist/{RadioGroup-D5IITQLz.mjs.map → RadioGroup-BGo_kXKh.mjs.map} +1 -1
- package/dist/{RadioGroup-Jl1yAvGu.d.mts → RadioGroup-BqULCH-D.d.mts} +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/RangeCalendar.d.mts +5 -0
- package/dist/RangeCalendarPresets.d.mts +12 -2
- 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 +4 -4
- package/dist/RulesPill.d.mts +1 -1
- package/dist/{SearchInput-CaKHRC_s.d.mts → SearchInput-Dc90GLTF.d.mts} +2 -2
- package/dist/SearchInput.d.mts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-JUgRw_M-.mjs → SegmentedControl-CvWJGhwy.mjs} +1 -1
- package/dist/{SegmentedControl-JUgRw_M-.mjs.map → SegmentedControl-CvWJGhwy.mjs.map} +1 -1
- package/dist/{SegmentedControl-e6xDtoHC.d.mts → SegmentedControl-Db78Pzo_.d.mts} +1 -1
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-DX3toj6M.mjs → Select-U_vQhK1A.mjs} +3 -4
- package/dist/Select-U_vQhK1A.mjs.map +1 -0
- package/dist/{Select-CPYztD4m.d.mts → Select-bafAe2wd.d.mts} +3 -3
- package/dist/Select.d.mts +1 -1
- package/dist/{Spinner-D3wXIoXN.mjs → Spinner-BTyc6glU.mjs} +1 -1
- package/dist/{Spinner-D3wXIoXN.mjs.map → Spinner-BTyc6glU.mjs.map} +1 -1
- package/dist/{Stack-DHaK1-dw.d.mts → Stack-_JcvIE31.d.mts} +1 -1
- package/dist/Stack.d.mts +1 -1
- package/dist/{Sticker-DnSemOcW.d.mts → Sticker-OKVOQt_C.d.mts} +4 -4
- package/dist/Sticker.d.mts +1 -1
- package/dist/StringValueControl.d.mts +1 -1
- package/dist/Tab.d.mts +1 -1
- package/dist/{TabBar-sYllYizt.mjs → TabBar-B5NtgtgC.mjs} +1 -1
- package/dist/{TabBar-sYllYizt.mjs.map → TabBar-B5NtgtgC.mjs.map} +1 -1
- package/dist/TabBarIconButton.d.mts +1 -1
- package/dist/{Table-CFbPINKr.d.mts → Table-BcAgCIWq.d.mts} +1 -1
- package/dist/{Table-C2pkP5Xg.mjs → Table-DfUD3I2s.mjs} +2 -2
- package/dist/{Table-C2pkP5Xg.mjs.map → Table-DfUD3I2s.mjs.map} +1 -1
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-BQsGc4Lw.d.mts → TableBody-D-RDBun9.d.mts} +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/{TableBox-CaTHcR4F.mjs → TableBox-0GvWjRln.mjs} +18 -12
- package/dist/{TableBox-CaTHcR4F.mjs.map → TableBox-0GvWjRln.mjs.map} +1 -1
- package/dist/TableBox.d.mts +2 -2
- package/dist/{TableBoxCell-52g97gEg.d.mts → TableBoxCell-WXc57DwN.d.mts} +10 -7
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/TableBoxField.d.mts +3 -3
- package/dist/{TableBoxRow-DnoumHIE.d.mts → TableBoxRow-BQz0a9vr.d.mts} +3 -3
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-CDcREhP4.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-CrGGlkEG.d.mts → TableControls-C26vGkWZ.d.mts} +4 -3
- package/dist/{TableControls-3bXyd8gS.mjs → TableControls-WUNbzSNq.mjs} +238 -45
- package/dist/TableControls-WUNbzSNq.mjs.map +1 -0
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-BKZt2Jid.d.mts → TableControlsContext-ChFsFEjR.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableHead-CqVIJfjh.d.mts → TableHead-PPaqXC0K.d.mts} +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-DK4R8vdK.d.mts → TableHeaderCell-K_avn-rR.d.mts} +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-BcIazRB-.d.mts → TableLayout-_Hd-Tvto.d.mts} +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-DdJcjG2b.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-CHBOjw7O.d.mts → TableViewConfigurationDropdown-BqB7pOh8.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{TechnicalSticker-D3eeGMDR.mjs → TechnicalSticker-ClRR_6Ly.mjs} +1 -1
- package/dist/{TechnicalSticker-D3eeGMDR.mjs.map → TechnicalSticker-ClRR_6Ly.mjs.map} +1 -1
- package/dist/{Text-BIgrwIdS.d.mts → Text-CAKHcXSd.d.mts} +3 -3
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-CiLttt0s.d.mts → TextArea-NjdArapc.d.mts} +2 -2
- package/dist/{TextArea-DWXuV2aZ.mjs → TextArea-n4IKHJKo.mjs} +1 -1
- package/dist/{TextArea-DWXuV2aZ.mjs.map → TextArea-n4IKHJKo.mjs.map} +1 -1
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-_7mIrZ2-.d.mts → TextUnderlineTooltip-Duzxfc_r.d.mts} +2 -2
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.mts +1 -1
- package/dist/Toast.d.mts +1 -1
- package/dist/{Toggle-Cav7bMxg.d.mts → Toggle-fh80PA8P.d.mts} +1 -1
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-DX-N-szt.d.mts → Tooltip-DabloV0o.d.mts} +2 -2
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-D2R7uy_y.d.mts → TruncatedText-B1W4BivL.d.mts} +1 -1
- package/dist/codec-B0dZTwlG.d.mts +29 -0
- package/dist/codec.d.mts +2 -0
- 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/Card/index.d.mts +2 -2
- 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 +1 -1
- 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 +7 -7
- 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/FormControl/index.d.mts +2 -2
- package/dist/components/FormControl/index.mjs +1 -1
- 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.mjs +1 -1
- package/dist/components/ImageTile/index.mjs +3 -3
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/LoadingShimmer/index.mjs +1 -1
- package/dist/components/MaskedInput/index.mjs +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 +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/ProgressIndicator/index.mjs +12 -8
- 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/Spinner/index.mjs +1 -1
- package/dist/components/Stack/index.d.mts +1 -1
- package/dist/components/Sticker/index.d.mts +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/TextArea/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Toggle/index.d.mts +1 -1
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/compound-expression.d.mts +1 -1
- package/dist/{constants-bA9kCzRQ.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-C7injfBh.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-BPfK-u7y.d.mts → index-DASkW991.d.mts} +2 -2
- package/dist/{index-d_fTFuMM.d.mts → index-Dc_BgmPv.d.mts} +3 -3
- package/dist/{index-BxBsQi2S.d.mts → index-Dpo-RP6S.d.mts} +3 -3
- package/dist/index-e6k85DKM.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-D9FuQmlI.d.mts → input-M7BEIewR.d.mts} +3 -3
- package/dist/inputFields.d.mts +10 -10
- package/dist/{intersperse-CLkblj9A.mjs → intersperse-DQAyfeEw.mjs} +1 -1
- package/dist/{intersperse-CLkblj9A.mjs.map → intersperse-DQAyfeEw.mjs.map} +1 -1
- package/dist/lib/PDSProvider.d.mts +1 -1
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/date-filter/index.d.mts +3 -0
- package/dist/lib/date-filter/index.mjs +2 -0
- package/dist/lib/message.d.mts +1 -1
- package/dist/lib/pseudoClass.d.mts +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-CqKB5mko.d.mts → message-DaiDXonE.d.mts} +1 -1
- package/dist/mixins/focus.d.mts +1 -1
- package/dist/mixins/hoverable.d.mts +2 -2
- package/dist/mixins/input.d.mts +1 -1
- package/dist/mixins/menuItem.d.mts +2 -2
- package/dist/mixins/text.d.mts +1 -1
- package/dist/{operators-CgcsYzfy.d.mts → operators-BsSl7gPE.d.mts} +10 -3
- package/dist/operators.d.mts +2 -2
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +4 -4
- package/dist/relative-date-label.d.mts +15 -0
- package/dist/{text-xwtyWIbE.d.mts → text-DjTGRUM1.d.mts} +1 -1
- package/dist/{theme-Ftogn9Wo.d.mts → theme-Biwx2eJZ.d.mts} +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/{types-BrNreYUU.d.mts → types-B5VmRRMR.d.mts} +5 -3
- package/dist/types-Bsf1VsW6.d.mts +24 -0
- package/dist/{types-DVsBRqjZ.d.mts → types-Cg3aXHUh2.d.mts} +1 -1
- package/dist/{types-0_9G0kWg.d.mts → types-Df0D37uh.d.mts} +1 -1
- package/dist/{types-D55MZSyx.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-D8Q8QKhS.d.mts → useFilterStateV2-BB14vCC-.d.mts} +3 -3
- package/dist/useFilterStateV2.d.mts +1 -1
- package/dist/{useFormField-BBbq1izo.d.mts → useFormField-CQo08dR4.d.mts} +2 -2
- package/dist/useFormField.d.mts +1 -1
- package/dist/{useTableBoxDragAndDrop-Bye8gJTl.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-Bmwk_DRn.d.mts → utilities-BHMNnJ8h.d.mts} +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/{validation-CAtTuHO9.d.mts → validation-B22QjCrV.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/{value-control-resolver-DadI8r9a.d.mts → value-control-resolver-qKTH1ErF.d.mts} +5 -3
- package/dist/value-control-resolver.d.mts +1 -1
- package/llms.txt +3 -3
- package/package.json +11 -1
- package/skills/ui-authoring/COMPONENTS.md +2 -0
- package/skills/ui-authoring/PATTERNS.md +3 -1
- package/skills/ui-authoring/SKILL.md +2 -2
- package/dist/DatePicker-BNnZ6L1y.mjs.map +0 -1
- package/dist/Select-DX3toj6M.mjs.map +0 -1
- package/dist/TableControls-3bXyd8gS.mjs.map +0 -1
- /package/dist/{index-0-W_aPej.d.mts → index-7rWKHdox.d.mts} +0 -0
- /package/dist/{index-7in8TPrM.d.mts → index-8SLBz2NH.d.mts} +0 -0
- /package/dist/{index-BNRXMhlr.d.mts → index-B_BBnMou.d.mts} +0 -0
- /package/dist/{index-BO_854F2.d.mts → index-BcsXXrHq.d.mts} +0 -0
- /package/dist/{index-BSVhZrWN.d.mts → index-Bt4QNofW.d.mts} +0 -0
- /package/dist/{index-BrGZHEgX.d.mts → index-BwFl_eS0.d.mts} +0 -0
- /package/dist/{index-BwAfCVZH2.d.mts → index-CMuRFTR3.d.mts} +0 -0
- /package/dist/{index-CCt0lwyI.d.mts → index-CRo77wc3.d.mts} +0 -0
- /package/dist/{index-CFhUdAHM.d.mts → index-CX869wwk.d.mts} +0 -0
- /package/dist/{index-CREkvfw9.d.mts → index-CliqZ9rj.d.mts} +0 -0
- /package/dist/{index-CROz1VSV.d.mts → index-CuheJfs-.d.mts} +0 -0
- /package/dist/{index-CsuikFeJ.d.mts → index-D4DUvwPf.d.mts} +0 -0
- /package/dist/{index-CzUpNo0e.d.mts → index-DBGd4WeR.d.mts} +0 -0
- /package/dist/{index-DA6_cwf8.d.mts → index-DDdPqD_H.d.mts} +0 -0
- /package/dist/{index-DM6vVDZD.d.mts → index-DMRtRo7y.d.mts} +0 -0
- /package/dist/{index-DeVKzGce.d.mts → index-Dflz2i1X.d.mts} +0 -0
- /package/dist/{index-Jh0C5PIG.d.mts → index-DvmLVvRD.d.mts} +0 -0
- /package/dist/{index-Oio5ygqN.d.mts → index-DztUdPP_.d.mts} +0 -0
- /package/dist/{index-PWQavSPf.d.mts → index-Wc1llEvP.d.mts} +0 -0
- /package/dist/{index-sViox9YW.d.mts → index-dhjtMp5F.d.mts} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { a as styled, r as css } from "../../styledComponentsInterop-8zScIQyC.mjs";
|
|
2
|
+
import { Spacing } from "@persona/design-tokens";
|
|
3
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region components/Grid/Grid.tsx
|
|
6
|
+
const GRID_BREAKPOINTS = {
|
|
7
|
+
sm: 768,
|
|
8
|
+
md: 1024,
|
|
9
|
+
lg: 1408
|
|
10
|
+
};
|
|
11
|
+
const getBreakpoint = (width) => {
|
|
12
|
+
if (width >= GRID_BREAKPOINTS.lg) return "lg";
|
|
13
|
+
if (width >= GRID_BREAKPOINTS.md) return "md";
|
|
14
|
+
if (width >= GRID_BREAKPOINTS.sm) return "sm";
|
|
15
|
+
return "xs";
|
|
16
|
+
};
|
|
17
|
+
const useGridBreakpoint = (ref) => {
|
|
18
|
+
const [breakpoint, setBreakpoint] = useState("md");
|
|
19
|
+
useLayoutEffect(() => {
|
|
20
|
+
const node = ref.current;
|
|
21
|
+
if (!node) return;
|
|
22
|
+
const update = () => setBreakpoint(getBreakpoint(node.offsetWidth));
|
|
23
|
+
update();
|
|
24
|
+
const observer = new ResizeObserver(update);
|
|
25
|
+
observer.observe(node);
|
|
26
|
+
return () => observer.disconnect();
|
|
27
|
+
}, [ref]);
|
|
28
|
+
return breakpoint;
|
|
29
|
+
};
|
|
30
|
+
const Root = styled.div`
|
|
31
|
+
display: grid;
|
|
32
|
+
width: 100%;
|
|
33
|
+
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
|
|
36
|
+
${({ $breakpoint }) => $breakpoint === "xs" && css`
|
|
37
|
+
min-width: ${GRID_BREAKPOINTS.sm - 1}px;
|
|
38
|
+
`}
|
|
39
|
+
|
|
40
|
+
${({ $breakpoint }) => $breakpoint === "xs" || $breakpoint === "sm" ? css`
|
|
41
|
+
gap: ${Spacing[3]};
|
|
42
|
+
padding-inline: ${Spacing[5]};
|
|
43
|
+
` : css`
|
|
44
|
+
gap: ${Spacing[4]};
|
|
45
|
+
padding-inline: ${Spacing[6]};
|
|
46
|
+
`}
|
|
47
|
+
|
|
48
|
+
// max-width equals the lg threshold; offsetWidth reads the clamped border-box width and getBreakpoint uses >=, so the clamp stays 'lg'
|
|
49
|
+
${({ $mode, $breakpoint }) => $mode === "fixed" && $breakpoint === "lg" && css`
|
|
50
|
+
max-width: ${GRID_BREAKPOINTS.lg}px;
|
|
51
|
+
margin-inline: auto;
|
|
52
|
+
`}
|
|
53
|
+
`;
|
|
54
|
+
/**
|
|
55
|
+
* Provides a 12-column CSS grid that measures its own width with a ResizeObserver for responsive
|
|
56
|
+
* horizontal margins and gutters. Vertical spacing is left to the consumer.
|
|
57
|
+
*
|
|
58
|
+
* The grid measures breakpoints against its own width rather than the viewport. Use `fixed` to
|
|
59
|
+
* center the grid at its large-screen maximum width, or `fluid` to keep it at 100% width.
|
|
60
|
+
*/
|
|
61
|
+
const Grid = ({ mode, children, ...rest }) => {
|
|
62
|
+
const ref = useRef(null);
|
|
63
|
+
return /* @__PURE__ */ jsx(Root, {
|
|
64
|
+
ref,
|
|
65
|
+
$mode: mode,
|
|
66
|
+
$breakpoint: useGridBreakpoint(ref),
|
|
67
|
+
...rest,
|
|
68
|
+
children
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region components/Grid/GridItem.tsx
|
|
73
|
+
const Item = styled.div`
|
|
74
|
+
grid-column: span ${({ $span }) => $span};
|
|
75
|
+
min-width: 0;
|
|
76
|
+
`;
|
|
77
|
+
const GridItem = ({ span, children, ...rest }) => /* @__PURE__ */ jsx(Item, {
|
|
78
|
+
$span: span,
|
|
79
|
+
...rest,
|
|
80
|
+
children
|
|
81
|
+
});
|
|
82
|
+
//#endregion
|
|
83
|
+
export { GRID_BREAKPOINTS, Grid, Grid as default, GridItem };
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../components/Grid/Grid.tsx","../../../components/Grid/GridItem.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ReactNode,\n type RefObject,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\n\nexport const GRID_BREAKPOINTS = { sm: 768, md: 1024, lg: 1408 } as const;\n\ntype Breakpoint = 'xs' | 'sm' | 'md' | 'lg';\n\nconst getBreakpoint = (width: number): Breakpoint => {\n if (width >= GRID_BREAKPOINTS.lg) {\n return 'lg';\n }\n if (width >= GRID_BREAKPOINTS.md) {\n return 'md';\n }\n if (width >= GRID_BREAKPOINTS.sm) {\n return 'sm';\n }\n return 'xs';\n};\n\nconst useGridBreakpoint = (ref: RefObject<HTMLDivElement>) => {\n const [breakpoint, setBreakpoint] = useState<Breakpoint>('md');\n useLayoutEffect(() => {\n const node = ref.current;\n if (!node) {\n return;\n }\n const update = () => setBreakpoint(getBreakpoint(node.offsetWidth));\n update();\n const observer = new ResizeObserver(update);\n observer.observe(node);\n return () => observer.disconnect();\n }, [ref]);\n return breakpoint;\n};\n\nconst Root = styled.div<{ $mode: GridProps['mode']; $breakpoint: Breakpoint }>`\n display: grid;\n width: 100%;\n grid-template-columns: repeat(12, minmax(0, 1fr));\n box-sizing: border-box;\n\n ${({ $breakpoint }) =>\n $breakpoint === 'xs' &&\n css`\n min-width: ${GRID_BREAKPOINTS.sm - 1}px;\n `}\n\n ${({ $breakpoint }) =>\n $breakpoint === 'xs' || $breakpoint === 'sm'\n ? css`\n gap: ${Spacing[3]};\n padding-inline: ${Spacing[5]};\n `\n : css`\n gap: ${Spacing[4]};\n padding-inline: ${Spacing[6]};\n `}\n\n // max-width equals the lg threshold; offsetWidth reads the clamped border-box width and getBreakpoint uses >=, so the clamp stays 'lg'\n ${({ $mode, $breakpoint }) =>\n $mode === 'fixed' &&\n $breakpoint === 'lg' &&\n css`\n max-width: ${GRID_BREAKPOINTS.lg}px;\n margin-inline: auto;\n `}\n`;\n\nexport interface GridProps extends ComponentPropsWithoutRef<'div'> {\n /**\n * Selects the grid width behavior at the large breakpoint. `fixed` centers the grid at a\n * maximum width of 1408px, while `fluid` fills the available width.\n *\n * Breakpoints:\n * - ≤767px: 12 columns, 24px margins, 12px gutters, and a 767px minimum width.\n * - 768–1023px: 12 columns, 24px margins, 12px gutters, and 100% width.\n * - 1024–1407px: 12 columns, 32px margins, 16px gutters, and 100% width.\n * - ≥1408px: 12 columns, 32px margins, 16px gutters, and either fixed or fluid width.\n */\n mode: 'fixed' | 'fluid';\n children: ReactNode;\n}\n\n/**\n * Provides a 12-column CSS grid that measures its own width with a ResizeObserver for responsive\n * horizontal margins and gutters. Vertical spacing is left to the consumer.\n *\n * The grid measures breakpoints against its own width rather than the viewport. Use `fixed` to\n * center the grid at its large-screen maximum width, or `fluid` to keep it at 100% width.\n */\nexport const Grid = ({ mode, children, ...rest }: GridProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const breakpoint = useGridBreakpoint(ref);\n return (\n <Root ref={ref} $mode={mode} $breakpoint={breakpoint} {...rest}>\n {children}\n </Root>\n );\n};\n\nexport default Grid;\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nexport type GridSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\nexport interface GridItemProps extends ComponentPropsWithoutRef<'div'> {\n span: GridSpan;\n children: ReactNode;\n}\n\nconst Item = styled.div<{ $span: GridSpan }>`\n grid-column: span ${({ $span }) => $span};\n min-width: 0;\n`;\n\nexport const GridItem = ({ span, children, ...rest }: GridItemProps) => (\n <Item $span={span} {...rest}>\n {children}\n </Item>\n);\n\nexport default GridItem;\n"],"mappings":";;;;;AAYA,MAAa,mBAAmB;CAAE,IAAI;CAAK,IAAI;CAAM,IAAI;CAAM;AAI/D,MAAM,iBAAiB,UAA8B;AACnD,KAAI,SAAS,iBAAiB,GAC5B,QAAO;AAET,KAAI,SAAS,iBAAiB,GAC5B,QAAO;AAET,KAAI,SAAS,iBAAiB,GAC5B,QAAO;AAET,QAAO;;AAGT,MAAM,qBAAqB,QAAmC;CAC5D,MAAM,CAAC,YAAY,iBAAiB,SAAqB,KAAK;AAC9D,uBAAsB;EACpB,MAAM,OAAO,IAAI;AACjB,MAAI,CAAC,KACH;EAEF,MAAM,eAAe,cAAc,cAAc,KAAK,YAAY,CAAC;AACnE,UAAQ;EACR,MAAM,WAAW,IAAI,eAAe,OAAO;AAC3C,WAAS,QAAQ,KAAK;AACtB,eAAa,SAAS,YAAY;IACjC,CAAC,IAAI,CAAC;AACT,QAAO;;AAGT,MAAM,OAAO,OAAO,GAA0D;;;;;;KAMzE,EAAE,kBACH,gBAAgB,QAChB,GAAG;mBACY,iBAAiB,KAAK,EAAE;MACrC;;KAED,EAAE,kBACH,gBAAgB,QAAQ,gBAAgB,OACpC,GAAG;iBACM,QAAQ,GAAG;4BACA,QAAQ,GAAG;YAE/B,GAAG;iBACM,QAAQ,GAAG;4BACA,QAAQ,GAAG;UAC7B;;;KAGL,EAAE,OAAO,kBACV,UAAU,WACV,gBAAgB,QAChB,GAAG;mBACY,iBAAiB,GAAG;;MAEjC;;;;;;;;;AAyBN,MAAa,QAAQ,EAAE,MAAM,UAAU,GAAG,WAAsB;CAC9D,MAAM,MAAM,OAAuB,KAAK;AAExC,QACE,oBAAC,MAAD;EAAW;EAAK,OAAO;EAAM,aAFZ,kBAAkB,IAEiB;EAAE,GAAI;EACvD;EACI,CAAA;;;;AChGX,MAAM,OAAO,OAAO,GAAwB;uBACrB,EAAE,YAAY,MAAM;;;AAI3C,MAAa,YAAY,EAAE,MAAM,UAAU,GAAG,WAC5C,oBAAC,MAAD;CAAM,OAAO;CAAM,GAAI;CACpB;CACI,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as HoverCopyableField } from "../../HoverCopyableField-
|
|
1
|
+
import { t as HoverCopyableField } from "../../HoverCopyableField-GMXeF-3J.mjs";
|
|
2
2
|
export { HoverCopyableField as default };
|
|
@@ -5,9 +5,9 @@ import { a as Tooltip } from "../../Tooltip-iJcfJqxn.mjs";
|
|
|
5
5
|
import { focusOutline } from "../../mixins/focus.mjs";
|
|
6
6
|
import { n as Stack } from "../../Stack-Bre2oiov.mjs";
|
|
7
7
|
import { t as IconButton } from "../../IconButton-BgL3QUVO.mjs";
|
|
8
|
-
import { n as DropdownMenu_default } from "../../DropdownMenu-
|
|
9
|
-
import { t as LoadingShimmer } from "../../LoadingShimmer-
|
|
10
|
-
import { t as Checkbox } from "../../Checkbox-
|
|
8
|
+
import { n as DropdownMenu_default } from "../../DropdownMenu-CUnf420M.mjs";
|
|
9
|
+
import { t as LoadingShimmer } from "../../LoadingShimmer-a2Hv0kAq.mjs";
|
|
10
|
+
import { t as Checkbox } from "../../Checkbox-DxNHp59y.mjs";
|
|
11
11
|
import { Color, Spacing } from "@persona/design-tokens";
|
|
12
12
|
import { useEffect, useState } from "react";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -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 { i as useListBoxContext, n as ListBoxItemProps, r as ListBoxProps } from "../../ListBox-
|
|
2
|
-
import { n as LogicRowProps } from "../../LogicRow-
|
|
3
|
-
import { t as ListBox } from "../../index-
|
|
1
|
+
import { i as useListBoxContext, n as ListBoxItemProps, r as ListBoxProps } from "../../ListBox-ZE3MYMt6.mjs";
|
|
2
|
+
import { n as LogicRowProps } from "../../LogicRow-CbMmaWXU.mjs";
|
|
3
|
+
import { t as ListBox } from "../../index-Dpo-RP6S.mjs";
|
|
4
4
|
export { ListBox, ListBox as default, ListBoxItemProps, ListBoxProps, LogicRowProps, useListBoxContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useListBoxContext, t as ListBox } from "../../ListBox-
|
|
1
|
+
import { n as useListBoxContext, t as ListBox } from "../../ListBox-9jHHEaqW.mjs";
|
|
2
2
|
export { ListBox, ListBox as default, useListBoxContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as MaybeLoadingShimmer, n as LoadingShimmerHeading, r as LoadingShimmerParagraph, t as LoadingShimmer } from "../../LoadingShimmer-
|
|
1
|
+
import { i as MaybeLoadingShimmer, n as LoadingShimmerHeading, r as LoadingShimmerParagraph, t as LoadingShimmer } from "../../LoadingShimmer-a2Hv0kAq.mjs";
|
|
2
2
|
export { LoadingShimmer, LoadingShimmerHeading, LoadingShimmerParagraph, MaybeLoadingShimmer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MenuDivider, c as MenuItem, d as MenuList, f as MenuProps, i as Menu, l as MenuItemProps, n as IconContainer, o as MenuHeading, r as ListItem, s as MenuHeadingProps, t as FloatingCard, u as MenuItemType } from "../../Menu-
|
|
1
|
+
import { a as MenuDivider, c as MenuItem, d as MenuList, f as MenuProps, i as Menu, l as MenuItemProps, n as IconContainer, o as MenuHeading, r as ListItem, s as MenuHeadingProps, t as FloatingCard, u as MenuItemType } from "../../Menu-ZShdhNd7.mjs";
|
|
2
2
|
export { FloatingCard, IconContainer, ListItem, Menu, Menu as default, MenuDivider, MenuHeading, MenuHeadingProps, MenuItem, MenuItemProps, MenuItemType, MenuList, MenuProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MenuDivider, c as MenuList, i as Menu, n as IconContainer, o as MenuHeading, r as ListItem, s as MenuItem, t as FloatingCard } from "../../Menu-
|
|
1
|
+
import { a as MenuDivider, c as MenuList, i as Menu, n as IconContainer, o as MenuHeading, r as ListItem, s as MenuItem, t as FloatingCard } from "../../Menu-38UCGcte.mjs";
|
|
2
2
|
export { FloatingCard, IconContainer, ListItem, Menu, Menu as default, MenuDivider, MenuHeading, MenuItem, MenuList };
|
|
@@ -4,7 +4,7 @@ import { n as Heading$1 } from "../../Text-B0orb-cZ.mjs";
|
|
|
4
4
|
import useEmbeddedSurface, { useEmbeddedSurfaceGate, useEmbeddedSurfaceId } from "../../lib/useEmbeddedSurface.mjs";
|
|
5
5
|
import { n as Stack, t as HStack } from "../../Stack-Bre2oiov.mjs";
|
|
6
6
|
import { n as Button$1 } from "../../IconButton-BgL3QUVO.mjs";
|
|
7
|
-
import { i as TabBar, r as Tab } from "../../TabBar-
|
|
7
|
+
import { i as TabBar, r as Tab } from "../../TabBar-B5NtgtgC.mjs";
|
|
8
8
|
import { Color, Spacing } from "@persona/design-tokens";
|
|
9
9
|
import { forwardRef, useContext, useEffect, useRef, useState } from "react";
|
|
10
10
|
import { Button, Dialog, DialogTrigger, Heading, Modal, ModalOverlay, OverlayTriggerStateContext, Pressable } from "react-aria-components";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as PageHeaderContainer, t as PageHeader } from "../../PageHeader-
|
|
1
|
+
import { n as PageHeaderContainer, t as PageHeader } from "../../PageHeader-B2-Slzhl.mjs";
|
|
2
2
|
export { PageHeaderContainer, PageHeader as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Pagination } from "../../Pagination-
|
|
2
|
-
import { r as PageSelector, t as PAGE_LIMIT_BEFORE_SCROLL_MODE } from "../../PageSelector-
|
|
3
|
-
import { n as MIN_PAGE_SIZE, t as DEFAULT_PAGE_SIZE_OPTIONS } from "../../constants-
|
|
1
|
+
import { t as Pagination } from "../../Pagination-j4hF7GOk.mjs";
|
|
2
|
+
import { r as PageSelector, t as PAGE_LIMIT_BEFORE_SCROLL_MODE } from "../../PageSelector-BcZx4nqe.mjs";
|
|
3
|
+
import { n as MIN_PAGE_SIZE, t as DEFAULT_PAGE_SIZE_OPTIONS } from "../../constants-DcJ3tnwY.mjs";
|
|
4
4
|
export { DEFAULT_PAGE_SIZE_OPTIONS, MIN_PAGE_SIZE, PAGE_LIMIT_BEFORE_SCROLL_MODE, PageSelector, Pagination as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MIN_PAGE_SIZE, i as DEFAULT_PAGE_SIZE_OPTIONS, n as PAGE_LIMIT_BEFORE_SCROLL_MODE, r as PageSelector, t as Pagination_default } from "../../Pagination-
|
|
1
|
+
import { a as MIN_PAGE_SIZE, i as DEFAULT_PAGE_SIZE_OPTIONS, n as PAGE_LIMIT_BEFORE_SCROLL_MODE, r as PageSelector, t as Pagination_default } from "../../Pagination-CtUz0gdA.mjs";
|
|
2
2
|
export { DEFAULT_PAGE_SIZE_OPTIONS, MIN_PAGE_SIZE, PAGE_LIMIT_BEFORE_SCROLL_MODE, PageSelector, Pagination_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Pii_default } from "../../Pii-
|
|
1
|
+
import { t as Pii_default } from "../../Pii-RwKn-K84.mjs";
|
|
2
2
|
export { Pii_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PopoverPortal, i as PopoverContent, n as PopoverCard, o as PopoverTrigger, r as PopoverClose, s as Popover_default, t as PopoverAnchor } from "../../Popover-
|
|
1
|
+
import { a as PopoverPortal, i as PopoverContent, n as PopoverCard, o as PopoverTrigger, r as PopoverClose, s as Popover_default, t as PopoverAnchor } from "../../Popover-DlXyKYL5.mjs";
|
|
2
2
|
export { PopoverAnchor, PopoverCard, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Popover_default as default };
|
|
@@ -3,28 +3,30 @@ import { paragraphMixins } from "../../mixins/text.mjs";
|
|
|
3
3
|
import { focusOutline } from "../../mixins/focus.mjs";
|
|
4
4
|
import { BorderRadius, Color, Spacing } from "@persona/design-tokens";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
6
|
+
import { CircleCheckFillIcon, CircleFillIcon, CircleNullIcon, CircleWarningFillIcon, WarningFillIcon } from "@persona/icons";
|
|
7
7
|
//#region components/ProgressIndicator/ProgressIndicator.tsx
|
|
8
8
|
/**
|
|
9
|
-
* Completed and error steps can be navigated back to.
|
|
10
|
-
* The current step (first uncompleted) is also clickable so the user can
|
|
9
|
+
* Completed, warning, and error steps can be navigated back to.
|
|
10
|
+
* The current step (first uncompleted or error) is also clickable so the user can
|
|
11
11
|
* return to it after navigating back to an earlier step.
|
|
12
12
|
* Active and upcoming steps (beyond the current) are not clickable.
|
|
13
13
|
*/
|
|
14
14
|
function resolveClickable(status, isActive, isDisabled, isCurrent) {
|
|
15
15
|
if (isDisabled || isActive) return false;
|
|
16
|
-
return status === "completed" || status === "error" || isCurrent;
|
|
16
|
+
return status === "completed" || status === "warning" || status === "error" || isCurrent;
|
|
17
17
|
}
|
|
18
18
|
function resolveIcon(status, isCurrent) {
|
|
19
19
|
if (status === "completed") return CircleCheckFillIcon;
|
|
20
|
-
if (status === "
|
|
20
|
+
if (status === "warning") return WarningFillIcon;
|
|
21
|
+
if (status === "error") return CircleWarningFillIcon;
|
|
21
22
|
if (isCurrent) return CircleFillIcon;
|
|
22
23
|
return CircleNullIcon;
|
|
23
24
|
}
|
|
24
25
|
function resolveIconColor(status, isActive, isDisabled) {
|
|
25
26
|
if (isDisabled) return Color.BorderIconDisabled;
|
|
26
27
|
if (status === "completed") return Color.BorderIconSuccess;
|
|
27
|
-
if (status === "
|
|
28
|
+
if (status === "warning") return Color.BorderIconWarning;
|
|
29
|
+
if (status === "error") return Color.BorderIconDanger;
|
|
28
30
|
return isActive ? Color.BorderIconActive : Color.BorderIconSecondary;
|
|
29
31
|
}
|
|
30
32
|
function resolveTextColor(status, isActive, isDisabled) {
|
|
@@ -135,7 +137,9 @@ const Step = ({ step, isActive, isCurrent, layout, onStepClick }) => {
|
|
|
135
137
|
* ProgressIndicator guides users through a sequence of steps.
|
|
136
138
|
*
|
|
137
139
|
* Interaction rules:
|
|
138
|
-
* - **Completed / error** steps are clickable — navigate back to review or fix.
|
|
140
|
+
* - **Completed / warning / error** steps are clickable — navigate back to review or fix.
|
|
141
|
+
* - **Warning** does not block forward progression; later uncompleted steps remain reachable.
|
|
142
|
+
* - **Error** blocks forward progression — treat it as the terminal step in the sequence.
|
|
139
143
|
* - **Active** step is not clickable — the user is already there.
|
|
140
144
|
* - **Upcoming (uncompleted)** steps are not clickable — sequential progression required.
|
|
141
145
|
*
|
|
@@ -157,7 +161,7 @@ const Step = ({ step, isActive, isCurrent, layout, onStepClick }) => {
|
|
|
157
161
|
* ```
|
|
158
162
|
*/
|
|
159
163
|
const ProgressIndicator = ({ steps, activeStepId, layout = "vertical", onStepClick, "aria-label": ariaLabel = "Progress", ...rest }) => {
|
|
160
|
-
const currentStepId = steps.find(({ status = "uncompleted" }) => status
|
|
164
|
+
const currentStepId = steps.find(({ status = "uncompleted" }) => status === "uncompleted" || status === "error")?.id;
|
|
161
165
|
return /* @__PURE__ */ jsx(StepList, {
|
|
162
166
|
$layout: layout,
|
|
163
167
|
role: "list",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../components/ProgressIndicator/ProgressIndicator.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { focusOutline } from '@persona/design-system/mixins/focus';\nimport { paragraphMixins } from '@persona/design-system/mixins/text';\nimport { BorderRadius, Color, Spacing } from '@persona/design-tokens';\nimport {\n CircleAlertIcon,\n CircleCheckFillIcon,\n CircleFillIcon,\n CircleNullIcon,\n} from '@persona/icons';\nimport type { PDSIconComponent } from '@persona/icons/types';\n\nexport type StepStatus = 'uncompleted' | 'completed' | 'error';\n\nexport interface ProgressIndicatorStep {\n id: string;\n label: string;\n /** @default 'uncompleted' */\n status?: StepStatus;\n disabled?: boolean;\n}\n\nexport interface ProgressIndicatorProps extends ComponentPropsWithoutRef<'ol'> {\n steps: ProgressIndicatorStep[];\n /** id of the step that should receive the active visual state */\n activeStepId?: string;\n /** @default 'vertical' */\n layout?: 'vertical' | 'horizontal';\n /**\n * Called when a clickable step is activated via click or keyboard.\n *\n * Clickability rules:\n * - `completed` and `error` steps are clickable (navigate back to review/edit)\n * - The active step is not clickable (user is already there)\n * - Upcoming `uncompleted` steps are not clickable (sequential progression required)\n */\n onStepClick?: (stepId: string) => void;\n}\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\n/**\n * Completed and error steps can be navigated back to.\n * The current step (first uncompleted) is also clickable so the user can\n * return to it after navigating back to an earlier step.\n * Active and upcoming steps (beyond the current) are not clickable.\n */\nfunction resolveClickable(\n status: StepStatus,\n isActive: boolean,\n isDisabled: boolean,\n isCurrent: boolean,\n): boolean {\n if (isDisabled || isActive) {\n return false;\n }\n return status === 'completed' || status === 'error' || isCurrent;\n}\n\nfunction resolveIcon(status: StepStatus, isCurrent: boolean): PDSIconComponent {\n if (status === 'completed') {\n return CircleCheckFillIcon;\n }\n if (status === 'error') {\n return CircleAlertIcon;\n }\n if (isCurrent) {\n return CircleFillIcon;\n }\n return CircleNullIcon;\n}\n\nfunction resolveIconColor(status: StepStatus, isActive: boolean, isDisabled: boolean): Color {\n if (isDisabled) {\n return Color.BorderIconDisabled;\n }\n if (status === 'completed') {\n return Color.BorderIconSuccess;\n }\n if (status === 'error') {\n return Color.BorderIconWarning;\n }\n return isActive ? Color.BorderIconActive : Color.BorderIconSecondary;\n}\n\nfunction resolveTextColor(status: StepStatus, isActive: boolean, isDisabled: boolean): Color {\n if (isDisabled) {\n return Color.TextDisabled;\n }\n if (isActive) {\n return Color.TextActive;\n }\n if (status === 'uncompleted') {\n return Color.TextSecondary;\n }\n return Color.TextPrimary;\n}\n\n// ─── Styled components ────────────────────────────────────────────────────────\n\nconst StepList = styled.ol<{ $layout: 'vertical' | 'horizontal' }>`\n display: flex;\n flex-direction: ${({ $layout }) => ($layout === 'horizontal' ? 'row' : 'column')};\n gap: ${({ $layout }) => ($layout === 'horizontal' ? Spacing[2] : '0px')};\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nconst StepItem = styled.li<{ $layout: 'vertical' | 'horizontal' }>`\n display: flex;\n align-items: center;\n\n ${({ $layout }) =>\n $layout === 'horizontal' &&\n css`\n width: fit-content;\n white-space: nowrap;\n `}\n`;\n\nconst StepContent = styled.button<{\n $isActive: boolean;\n $isClickable: boolean;\n $interactive: boolean;\n}>`\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n width: 100%;\n padding: ${Spacing[2]};\n border-radius: ${BorderRadius.Md};\n border: none;\n margin: 0;\n font: inherit;\n color: inherit;\n text-align: left;\n outline: none;\n cursor: ${({ $isClickable, $interactive }) => ($interactive && $isClickable ? 'pointer' : 'default')};\n\n ${({ $isActive, $isClickable, $interactive }) => {\n if ($isActive) {\n return css`background-color: ${Color.BackgroundInteractiveActive};`;\n }\n if ($interactive && $isClickable) {\n return css`\n background-color: ${Color.BackgroundInteractiveDefault};\n &:hover {\n background-color: ${Color.BackgroundInteractiveHover};\n }\n `;\n }\n return css`\n background-color: transparent;\n `;\n }}\n\n ${focusOutline}\n\n &:focus-visible {\n position: relative;\n z-index: 1;\n }\n`;\n\nconst IconWrapper = styled.span<{ $color: Color }>`\n display: inline-flex;\n flex-shrink: 0;\n width: 16px;\n height: 16px;\n color: ${({ $color }) => $color};\n line-height: 0;\n`;\n\nconst StepLabel = styled.span<{ $isActive: boolean; $color: Color }>`\n ${({ $isActive }) => ($isActive ? paragraphMixins.mdBold : paragraphMixins.md)};\n color: ${({ $color }) => $color};\n`;\n\n// ─── Step ─────────────────────────────────────────────────────────────────────\n\ninterface StepProps {\n step: ProgressIndicatorStep;\n isActive: boolean;\n isCurrent: boolean;\n layout: 'vertical' | 'horizontal';\n onStepClick?: (stepId: string) => void;\n}\n\nconst Step = ({ step, isActive, isCurrent, layout, onStepClick }: StepProps) => {\n const { id, label, status = 'uncompleted', disabled = false } = step;\n\n const interactive = Boolean(onStepClick);\n const isClickable = resolveClickable(status, isActive, disabled, isCurrent);\n const isInteractionDisabled = disabled || (!isActive && !isCurrent && status === 'uncompleted');\n const iconColor = resolveIconColor(status, isActive, disabled);\n const textColor = resolveTextColor(status, isActive, disabled);\n\n const Icon = resolveIcon(status, isCurrent);\n\n return (\n <StepItem\n $layout={layout}\n aria-current={!interactive && isActive ? 'step' : undefined}\n aria-disabled={!interactive && isInteractionDisabled ? true : undefined}\n >\n <StepContent\n {...(interactive && isClickable\n ? { type: 'button' as const, onClick: () => onStepClick?.(id) }\n : { as: 'div' as const })}\n aria-current={interactive && isActive ? 'step' : undefined}\n aria-disabled={interactive && isInteractionDisabled ? true : undefined}\n $isActive={isActive}\n $isClickable={isClickable}\n $interactive={interactive}\n >\n <IconWrapper $color={iconColor} aria-hidden='true'>\n <Icon />\n </IconWrapper>\n <StepLabel $isActive={isActive} $color={textColor}>\n {label}\n </StepLabel>\n </StepContent>\n </StepItem>\n );\n};\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * ProgressIndicator guides users through a sequence of steps.\n *\n * Interaction rules:\n * - **Completed / error** steps are clickable — navigate back to review or fix.\n * - **Active** step is not clickable — the user is already there.\n * - **Upcoming (uncompleted)** steps are not clickable — sequential progression required.\n *\n * Navigation does not clear later steps. If a change on an earlier step\n * invalidates later data, the affected steps should be flagged and require\n * re-confirmation before submission — this logic lives in the consuming component.\n *\n * @example\n * ```tsx\n * <ProgressIndicator\n * steps={[\n * { id: 'identity', label: 'Identity', status: 'completed' },\n * { id: 'address', label: 'Address', status: 'uncompleted' },\n * { id: 'review', label: 'Review', status: 'uncompleted' },\n * ]}\n * activeStepId=\"address\"\n * onStepClick={(id) => navigate(id)}\n * />\n * ```\n */\nexport const ProgressIndicator = ({\n steps,\n activeStepId,\n layout = 'vertical',\n onStepClick,\n 'aria-label': ariaLabel = 'Progress',\n ...rest\n}: ProgressIndicatorProps) => {\n // The \"current\" step is the first uncompleted step — where the user should work next.\n // This is independent of activeStepId, which only controls the visual highlight.\n const currentStepId = steps.find(({ status = 'uncompleted' }) => status !== 'completed')?.id;\n\n return (\n <StepList $layout={layout} role='list' aria-label={ariaLabel} {...rest}>\n {steps.map((step) => (\n <Step\n key={step.id}\n step={step}\n isActive={step.id === activeStepId}\n isCurrent={step.id === currentStepId}\n layout={layout}\n onStepClick={onStepClick}\n />\n ))}\n </StepList>\n );\n};\n\nexport default ProgressIndicator;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../components/ProgressIndicator/ProgressIndicator.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { focusOutline } from '@persona/design-system/mixins/focus';\nimport { paragraphMixins } from '@persona/design-system/mixins/text';\nimport { BorderRadius, Color, Spacing } from '@persona/design-tokens';\nimport {\n CircleCheckFillIcon,\n CircleFillIcon,\n CircleNullIcon,\n CircleWarningFillIcon,\n WarningFillIcon,\n} from '@persona/icons';\nimport type { PDSIconComponent } from '@persona/icons/types';\n\nexport type StepStatus = 'uncompleted' | 'completed' | 'warning' | 'error';\n\nexport interface ProgressIndicatorStep {\n id: string;\n label: string;\n /** @default 'uncompleted' */\n status?: StepStatus;\n disabled?: boolean;\n}\n\nexport interface ProgressIndicatorProps extends ComponentPropsWithoutRef<'ol'> {\n steps: ProgressIndicatorStep[];\n /** id of the step that should receive the active visual state */\n activeStepId?: string;\n /** @default 'vertical' */\n layout?: 'vertical' | 'horizontal';\n /**\n * Called when a clickable step is activated via click or keyboard.\n *\n * Clickability rules:\n * - `completed`, `warning`, and `error` steps are clickable (navigate back to review/edit)\n * - The active step is not clickable (user is already there)\n * - Upcoming `uncompleted` steps are not clickable (sequential progression required)\n */\n onStepClick?: (stepId: string) => void;\n}\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\n/**\n * Completed, warning, and error steps can be navigated back to.\n * The current step (first uncompleted or error) is also clickable so the user can\n * return to it after navigating back to an earlier step.\n * Active and upcoming steps (beyond the current) are not clickable.\n */\nfunction resolveClickable(\n status: StepStatus,\n isActive: boolean,\n isDisabled: boolean,\n isCurrent: boolean,\n): boolean {\n if (isDisabled || isActive) {\n return false;\n }\n return status === 'completed' || status === 'warning' || status === 'error' || isCurrent;\n}\n\nfunction resolveIcon(status: StepStatus, isCurrent: boolean): PDSIconComponent {\n if (status === 'completed') {\n return CircleCheckFillIcon;\n }\n if (status === 'warning') {\n return WarningFillIcon;\n }\n if (status === 'error') {\n return CircleWarningFillIcon;\n }\n if (isCurrent) {\n return CircleFillIcon;\n }\n return CircleNullIcon;\n}\n\nfunction resolveIconColor(status: StepStatus, isActive: boolean, isDisabled: boolean): Color {\n if (isDisabled) {\n return Color.BorderIconDisabled;\n }\n if (status === 'completed') {\n return Color.BorderIconSuccess;\n }\n if (status === 'warning') {\n return Color.BorderIconWarning;\n }\n if (status === 'error') {\n return Color.BorderIconDanger;\n }\n return isActive ? Color.BorderIconActive : Color.BorderIconSecondary;\n}\n\nfunction resolveTextColor(status: StepStatus, isActive: boolean, isDisabled: boolean): Color {\n if (isDisabled) {\n return Color.TextDisabled;\n }\n if (isActive) {\n return Color.TextActive;\n }\n if (status === 'uncompleted') {\n return Color.TextSecondary;\n }\n return Color.TextPrimary;\n}\n\n// ─── Styled components ────────────────────────────────────────────────────────\n\nconst StepList = styled.ol<{ $layout: 'vertical' | 'horizontal' }>`\n display: flex;\n flex-direction: ${({ $layout }) => ($layout === 'horizontal' ? 'row' : 'column')};\n gap: ${({ $layout }) => ($layout === 'horizontal' ? Spacing[2] : '0px')};\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nconst StepItem = styled.li<{ $layout: 'vertical' | 'horizontal' }>`\n display: flex;\n align-items: center;\n\n ${({ $layout }) =>\n $layout === 'horizontal' &&\n css`\n width: fit-content;\n white-space: nowrap;\n `}\n`;\n\nconst StepContent = styled.button<{\n $isActive: boolean;\n $isClickable: boolean;\n $interactive: boolean;\n}>`\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n width: 100%;\n padding: ${Spacing[2]};\n border-radius: ${BorderRadius.Md};\n border: none;\n margin: 0;\n font: inherit;\n color: inherit;\n text-align: left;\n outline: none;\n cursor: ${({ $isClickable, $interactive }) => ($interactive && $isClickable ? 'pointer' : 'default')};\n\n ${({ $isActive, $isClickable, $interactive }) => {\n if ($isActive) {\n return css`background-color: ${Color.BackgroundInteractiveActive};`;\n }\n if ($interactive && $isClickable) {\n return css`\n background-color: ${Color.BackgroundInteractiveDefault};\n &:hover {\n background-color: ${Color.BackgroundInteractiveHover};\n }\n `;\n }\n return css`\n background-color: transparent;\n `;\n }}\n\n ${focusOutline}\n\n &:focus-visible {\n position: relative;\n z-index: 1;\n }\n`;\n\nconst IconWrapper = styled.span<{ $color: Color }>`\n display: inline-flex;\n flex-shrink: 0;\n width: 16px;\n height: 16px;\n color: ${({ $color }) => $color};\n line-height: 0;\n`;\n\nconst StepLabel = styled.span<{ $isActive: boolean; $color: Color }>`\n ${({ $isActive }) => ($isActive ? paragraphMixins.mdBold : paragraphMixins.md)};\n color: ${({ $color }) => $color};\n`;\n\n// ─── Step ─────────────────────────────────────────────────────────────────────\n\ninterface StepProps {\n step: ProgressIndicatorStep;\n isActive: boolean;\n isCurrent: boolean;\n layout: 'vertical' | 'horizontal';\n onStepClick?: (stepId: string) => void;\n}\n\nconst Step = ({ step, isActive, isCurrent, layout, onStepClick }: StepProps) => {\n const { id, label, status = 'uncompleted', disabled = false } = step;\n\n const interactive = Boolean(onStepClick);\n const isClickable = resolveClickable(status, isActive, disabled, isCurrent);\n const isInteractionDisabled = disabled || (!isActive && !isCurrent && status === 'uncompleted');\n const iconColor = resolveIconColor(status, isActive, disabled);\n const textColor = resolveTextColor(status, isActive, disabled);\n\n const Icon = resolveIcon(status, isCurrent);\n\n return (\n <StepItem\n $layout={layout}\n aria-current={!interactive && isActive ? 'step' : undefined}\n aria-disabled={!interactive && isInteractionDisabled ? true : undefined}\n >\n <StepContent\n {...(interactive && isClickable\n ? { type: 'button' as const, onClick: () => onStepClick?.(id) }\n : { as: 'div' as const })}\n aria-current={interactive && isActive ? 'step' : undefined}\n aria-disabled={interactive && isInteractionDisabled ? true : undefined}\n $isActive={isActive}\n $isClickable={isClickable}\n $interactive={interactive}\n >\n <IconWrapper $color={iconColor} aria-hidden='true'>\n <Icon />\n </IconWrapper>\n <StepLabel $isActive={isActive} $color={textColor}>\n {label}\n </StepLabel>\n </StepContent>\n </StepItem>\n );\n};\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * ProgressIndicator guides users through a sequence of steps.\n *\n * Interaction rules:\n * - **Completed / warning / error** steps are clickable — navigate back to review or fix.\n * - **Warning** does not block forward progression; later uncompleted steps remain reachable.\n * - **Error** blocks forward progression — treat it as the terminal step in the sequence.\n * - **Active** step is not clickable — the user is already there.\n * - **Upcoming (uncompleted)** steps are not clickable — sequential progression required.\n *\n * Navigation does not clear later steps. If a change on an earlier step\n * invalidates later data, the affected steps should be flagged and require\n * re-confirmation before submission — this logic lives in the consuming component.\n *\n * @example\n * ```tsx\n * <ProgressIndicator\n * steps={[\n * { id: 'identity', label: 'Identity', status: 'completed' },\n * { id: 'address', label: 'Address', status: 'uncompleted' },\n * { id: 'review', label: 'Review', status: 'uncompleted' },\n * ]}\n * activeStepId=\"address\"\n * onStepClick={(id) => navigate(id)}\n * />\n * ```\n */\nexport const ProgressIndicator = ({\n steps,\n activeStepId,\n layout = 'vertical',\n onStepClick,\n 'aria-label': ariaLabel = 'Progress',\n ...rest\n}: ProgressIndicatorProps) => {\n // The \"current\" step is the first uncompleted or error step — where the user should work next.\n // Warning steps are skipped so forward progression is not blocked.\n // This is independent of activeStepId, which only controls the visual highlight.\n const currentStepId = steps.find(\n ({ status = 'uncompleted' }) => status === 'uncompleted' || status === 'error',\n )?.id;\n\n return (\n <StepList $layout={layout} role='list' aria-label={ariaLabel} {...rest}>\n {steps.map((step) => (\n <Step\n key={step.id}\n step={step}\n isActive={step.id === activeStepId}\n isCurrent={step.id === currentStepId}\n layout={layout}\n onStepClick={onStepClick}\n />\n ))}\n </StepList>\n );\n};\n\nexport default ProgressIndicator;\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Radio } from "../../Radio-
|
|
1
|
+
import { t as Radio } from "../../Radio-cLL9oatf.mjs";
|
|
2
2
|
export { Radio, Radio as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadioGroupProps, t as RadioGroup } from "../../RadioGroup-
|
|
1
|
+
import { n as RadioGroupProps, t as RadioGroup } from "../../RadioGroup-BqULCH-D.mjs";
|
|
2
2
|
export { RadioGroup, RadioGroup as default, RadioGroupProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as RadioGroup } from "../../RadioGroup-
|
|
1
|
+
import { t as RadioGroup } from "../../RadioGroup-BGo_kXKh.mjs";
|
|
2
2
|
export { RadioGroup, RadioGroup as default };
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { a as styled } from "../../styledComponentsInterop-8zScIQyC.mjs";
|
|
2
|
+
import { i as Paragraph } from "../../Text-B0orb-cZ.mjs";
|
|
3
|
+
import { n as Stack, t as HStack } from "../../Stack-Bre2oiov.mjs";
|
|
4
|
+
import { t as IconButton } from "../../IconButton-BgL3QUVO.mjs";
|
|
5
|
+
import { t as LoadingShimmer } from "../../LoadingShimmer-a2Hv0kAq.mjs";
|
|
6
|
+
import { Color, Spacing } from "@persona/design-tokens";
|
|
7
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { XIcon } from "@persona/icons";
|
|
10
|
+
import { mergeProps, useMove } from "react-aria";
|
|
11
|
+
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
|
|
12
|
+
//#region components/RightPanel/RightPanelLoadingContent.tsx
|
|
13
|
+
const RightPanelLoadingContent = () => /* @__PURE__ */ jsxs(Stack, {
|
|
14
|
+
spacing: Spacing[5],
|
|
15
|
+
"aria-label": "Loading panel content",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsxs(Stack, {
|
|
18
|
+
spacing: Spacing[2],
|
|
19
|
+
children: [/* @__PURE__ */ jsx(LoadingShimmer, {
|
|
20
|
+
width: "30%",
|
|
21
|
+
height: "16px"
|
|
22
|
+
}), /* @__PURE__ */ jsx(LoadingShimmer, {
|
|
23
|
+
width: "100%",
|
|
24
|
+
height: "40px"
|
|
25
|
+
})]
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsxs(Stack, {
|
|
28
|
+
spacing: Spacing[2],
|
|
29
|
+
children: [/* @__PURE__ */ jsx(LoadingShimmer, {
|
|
30
|
+
width: "35%",
|
|
31
|
+
height: "16px"
|
|
32
|
+
}), /* @__PURE__ */ jsx(LoadingShimmer, {
|
|
33
|
+
width: "100%",
|
|
34
|
+
height: "200px"
|
|
35
|
+
})]
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ jsx(HStack, {
|
|
38
|
+
justify: "flex-end",
|
|
39
|
+
children: /* @__PURE__ */ jsx(LoadingShimmer, {
|
|
40
|
+
width: "80px",
|
|
41
|
+
height: "32px"
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region components/RightPanel/RightPanelResizeHandle.tsx
|
|
48
|
+
const DRAGGING_CLASSNAME = "dragging";
|
|
49
|
+
const KEYBOARD_RESIZE_STEP = 10;
|
|
50
|
+
const KEYBOARD_RESIZE_STEP_LARGE = 40;
|
|
51
|
+
const Handle = styled.div`
|
|
52
|
+
touch-action: none;
|
|
53
|
+
cursor: col-resize;
|
|
54
|
+
position: absolute;
|
|
55
|
+
z-index: 1;
|
|
56
|
+
width: ${Spacing[2]};
|
|
57
|
+
top: 0;
|
|
58
|
+
bottom: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
height: 100%;
|
|
61
|
+
|
|
62
|
+
&::after {
|
|
63
|
+
content: '';
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: 0;
|
|
66
|
+
bottom: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
width: 2px;
|
|
69
|
+
background-color: transparent;
|
|
70
|
+
transition: background-color 0.15s ease-in;
|
|
71
|
+
transition-delay: 0.025s;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:hover::after,
|
|
75
|
+
&${`.${DRAGGING_CLASSNAME}`}::after {
|
|
76
|
+
background-color: ${({ theme }) => theme.color.border.active};
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
const RightPanelResizeHandle = ({ onMove, onMoveTo, onMoveStart, onMoveEnd, onDoubleClick }) => {
|
|
80
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
81
|
+
const isDraggingRef = useRef(false);
|
|
82
|
+
const capturedPointerIdRef = useRef(null);
|
|
83
|
+
const onMoveEndRef = useRef(onMoveEnd);
|
|
84
|
+
onMoveEndRef.current = onMoveEnd;
|
|
85
|
+
const { moveProps } = useMove({
|
|
86
|
+
onMoveStart(e) {
|
|
87
|
+
if (e.pointerType !== "keyboard") {
|
|
88
|
+
isDraggingRef.current = true;
|
|
89
|
+
setIsDragging(true);
|
|
90
|
+
}
|
|
91
|
+
onMoveStart?.();
|
|
92
|
+
},
|
|
93
|
+
onMove(e) {
|
|
94
|
+
if (e.pointerType !== "keyboard") return;
|
|
95
|
+
const step = e.shiftKey ? KEYBOARD_RESIZE_STEP_LARGE : KEYBOARD_RESIZE_STEP;
|
|
96
|
+
onMove(e.deltaX * step);
|
|
97
|
+
},
|
|
98
|
+
onMoveEnd(e) {
|
|
99
|
+
if (e.pointerType !== "keyboard") {
|
|
100
|
+
isDraggingRef.current = false;
|
|
101
|
+
setIsDragging(false);
|
|
102
|
+
capturedPointerIdRef.current = null;
|
|
103
|
+
}
|
|
104
|
+
onMoveEnd?.();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
return () => {
|
|
109
|
+
if (isDraggingRef.current) onMoveEndRef.current?.();
|
|
110
|
+
};
|
|
111
|
+
}, []);
|
|
112
|
+
return /* @__PURE__ */ jsx(Handle, {
|
|
113
|
+
...mergeProps(moveProps, {
|
|
114
|
+
onDoubleClick,
|
|
115
|
+
onKeyDown: (e) => {
|
|
116
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
117
|
+
onDoubleClick?.();
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
onLostPointerCapture: (e) => {
|
|
122
|
+
if (capturedPointerIdRef.current !== e.pointerId) return;
|
|
123
|
+
capturedPointerIdRef.current = null;
|
|
124
|
+
window.dispatchEvent(new PointerEvent("pointerup", {
|
|
125
|
+
bubbles: true,
|
|
126
|
+
pointerId: e.pointerId,
|
|
127
|
+
pointerType: e.pointerType || "mouse"
|
|
128
|
+
}));
|
|
129
|
+
},
|
|
130
|
+
onPointerDown: (e) => {
|
|
131
|
+
if (e.button !== 0 || capturedPointerIdRef.current != null) return;
|
|
132
|
+
capturedPointerIdRef.current = e.pointerId;
|
|
133
|
+
try {
|
|
134
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
135
|
+
} catch {}
|
|
136
|
+
},
|
|
137
|
+
onPointerMove: (e) => {
|
|
138
|
+
if (capturedPointerIdRef.current !== e.pointerId) return;
|
|
139
|
+
onMoveTo?.(e.clientX);
|
|
140
|
+
}
|
|
141
|
+
}),
|
|
142
|
+
"aria-label": "Resize right panel",
|
|
143
|
+
"aria-orientation": "vertical",
|
|
144
|
+
role: "separator",
|
|
145
|
+
tabIndex: 0,
|
|
146
|
+
className: isDragging ? DRAGGING_CLASSNAME : void 0
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region components/RightPanel/RightPanel.tsx
|
|
151
|
+
const OPEN_DURATION = .4;
|
|
152
|
+
const CLOSE_DURATION = .3;
|
|
153
|
+
const DEFAULT_MIN_WIDTH = 450;
|
|
154
|
+
const MAX_WIDTH_RATIO = .5;
|
|
155
|
+
const BODY_BOTTOM_PADDING = `calc(${Spacing[5]} + 48px + ${Spacing[5]})`;
|
|
156
|
+
const PanelOuter = styled(motion.div)`
|
|
157
|
+
flex-shrink: 0;
|
|
158
|
+
height: 100%;
|
|
159
|
+
overflow: hidden;
|
|
160
|
+
`;
|
|
161
|
+
const PanelInner = styled.div`
|
|
162
|
+
position: relative;
|
|
163
|
+
${({ $width, $useMinWidth }) => $useMinWidth ? `min-width: ${$width}px;` : ""}
|
|
164
|
+
height: 100%;
|
|
165
|
+
outline: none;
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
background: ${Color.BackgroundPrimary};
|
|
169
|
+
border-left: 1px solid ${Color.BorderDivider};
|
|
170
|
+
`;
|
|
171
|
+
const PanelHeader = styled.div`
|
|
172
|
+
padding: ${Spacing[4]};
|
|
173
|
+
border-bottom: 1px solid ${({ theme }) => theme.color.border.primary};
|
|
174
|
+
flex-shrink: 0;
|
|
175
|
+
`;
|
|
176
|
+
const PanelBody = styled.div`
|
|
177
|
+
flex: 1;
|
|
178
|
+
overflow-y: auto;
|
|
179
|
+
padding: ${Spacing[4]};
|
|
180
|
+
padding-bottom: ${BODY_BOTTOM_PADDING};
|
|
181
|
+
`;
|
|
182
|
+
const RightPanel = ({ id, open = false, onOpenChange, title, description, children, width = DEFAULT_MIN_WIDTH, minWidth = DEFAULT_MIN_WIDTH, resizable = false, loading = false }) => {
|
|
183
|
+
const panelRef = useRef(null);
|
|
184
|
+
const previousActiveElementRef = useRef(null);
|
|
185
|
+
const prefersReducedMotion = useReducedMotion();
|
|
186
|
+
const defaultWidth = resizable ? Math.max(minWidth, width) : width;
|
|
187
|
+
const [currentWidth, setCurrentWidth] = useState(defaultWidth);
|
|
188
|
+
const [shouldAnimateWidth, setShouldAnimateWidth] = useState(true);
|
|
189
|
+
const effectiveWidth = resizable ? currentWidth : width;
|
|
190
|
+
const handleClose = useCallback(() => {
|
|
191
|
+
onOpenChange?.(false);
|
|
192
|
+
}, [onOpenChange]);
|
|
193
|
+
const handleKeyDown = useCallback((e) => {
|
|
194
|
+
if (e.key === "Escape") handleClose();
|
|
195
|
+
}, [handleClose]);
|
|
196
|
+
useEffect(() => {
|
|
197
|
+
if (open) {
|
|
198
|
+
previousActiveElementRef.current = document.activeElement;
|
|
199
|
+
panelRef.current?.focus();
|
|
200
|
+
} else if (previousActiveElementRef.current && document.contains(previousActiveElementRef.current)) {
|
|
201
|
+
previousActiveElementRef.current.focus();
|
|
202
|
+
previousActiveElementRef.current = null;
|
|
203
|
+
}
|
|
204
|
+
}, [open]);
|
|
205
|
+
const clampWidth = useCallback((nextWidth) => Math.min(MAX_WIDTH_RATIO * window.innerWidth, Math.max(minWidth, nextWidth)), [minWidth]);
|
|
206
|
+
const handleMove = useCallback((deltaX) => {
|
|
207
|
+
setCurrentWidth((current) => clampWidth(current - deltaX));
|
|
208
|
+
}, [clampWidth]);
|
|
209
|
+
const handleMoveTo = useCallback((clientX) => {
|
|
210
|
+
setCurrentWidth(clampWidth((panelRef.current?.getBoundingClientRect().right ?? window.innerWidth) - clientX));
|
|
211
|
+
}, [clampWidth]);
|
|
212
|
+
const handleMoveStart = useCallback(() => {
|
|
213
|
+
setShouldAnimateWidth(false);
|
|
214
|
+
}, []);
|
|
215
|
+
const handleMoveEnd = useCallback(() => {
|
|
216
|
+
setShouldAnimateWidth(true);
|
|
217
|
+
}, []);
|
|
218
|
+
const handleDoubleClick = useCallback(() => {
|
|
219
|
+
setShouldAnimateWidth(true);
|
|
220
|
+
setCurrentWidth(defaultWidth);
|
|
221
|
+
}, [defaultWidth]);
|
|
222
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(PanelOuter, {
|
|
223
|
+
initial: {
|
|
224
|
+
width: prefersReducedMotion ? effectiveWidth : 0,
|
|
225
|
+
minWidth: prefersReducedMotion ? effectiveWidth : 0
|
|
226
|
+
},
|
|
227
|
+
animate: {
|
|
228
|
+
width: effectiveWidth,
|
|
229
|
+
minWidth: effectiveWidth,
|
|
230
|
+
transition: {
|
|
231
|
+
duration: prefersReducedMotion ? 0 : OPEN_DURATION,
|
|
232
|
+
ease: "circOut",
|
|
233
|
+
width: shouldAnimateWidth && !prefersReducedMotion ? void 0 : { duration: 0 },
|
|
234
|
+
minWidth: shouldAnimateWidth && !prefersReducedMotion ? void 0 : { duration: 0 }
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
exit: {
|
|
238
|
+
width: 0,
|
|
239
|
+
minWidth: 0,
|
|
240
|
+
transition: {
|
|
241
|
+
duration: prefersReducedMotion ? 0 : CLOSE_DURATION,
|
|
242
|
+
ease: "circOut"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
children: /* @__PURE__ */ jsxs(PanelInner, {
|
|
246
|
+
ref: panelRef,
|
|
247
|
+
id,
|
|
248
|
+
$width: effectiveWidth,
|
|
249
|
+
$useMinWidth: shouldAnimateWidth,
|
|
250
|
+
role: "complementary",
|
|
251
|
+
"aria-label": title,
|
|
252
|
+
tabIndex: -1,
|
|
253
|
+
onKeyDown: handleKeyDown,
|
|
254
|
+
children: [
|
|
255
|
+
resizable && /* @__PURE__ */ jsx(RightPanelResizeHandle, {
|
|
256
|
+
onMove: handleMove,
|
|
257
|
+
onMoveTo: handleMoveTo,
|
|
258
|
+
onMoveStart: handleMoveStart,
|
|
259
|
+
onMoveEnd: handleMoveEnd,
|
|
260
|
+
onDoubleClick: handleDoubleClick
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ jsx(PanelHeader, { children: /* @__PURE__ */ jsxs(Stack, {
|
|
263
|
+
spacing: Spacing[2],
|
|
264
|
+
children: [/* @__PURE__ */ jsxs(HStack, {
|
|
265
|
+
justify: "space-between",
|
|
266
|
+
align: "center",
|
|
267
|
+
spacing: Spacing[2],
|
|
268
|
+
children: [/* @__PURE__ */ jsx(Paragraph, {
|
|
269
|
+
as: "h3",
|
|
270
|
+
size: "lg",
|
|
271
|
+
weight: "bold",
|
|
272
|
+
color: "primary",
|
|
273
|
+
children: title
|
|
274
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
275
|
+
size: "md",
|
|
276
|
+
"aria-label": "Close",
|
|
277
|
+
onClick: handleClose,
|
|
278
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
279
|
+
})]
|
|
280
|
+
}), description && /* @__PURE__ */ jsx(Paragraph, {
|
|
281
|
+
size: "md",
|
|
282
|
+
color: "secondary",
|
|
283
|
+
children: description
|
|
284
|
+
})]
|
|
285
|
+
}) }),
|
|
286
|
+
/* @__PURE__ */ jsx(PanelBody, { children: loading ? /* @__PURE__ */ jsx(RightPanelLoadingContent, {}) : children })
|
|
287
|
+
]
|
|
288
|
+
})
|
|
289
|
+
}) });
|
|
290
|
+
};
|
|
291
|
+
//#endregion
|
|
292
|
+
export { RightPanel, RightPanel as default };
|
|
293
|
+
|
|
294
|
+
//# sourceMappingURL=index.mjs.map
|