@persona/design-system 0.7.1 → 0.8.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 +49 -0
- package/README.md +9 -9
- package/dist/Accordion.d.mts +38 -0
- package/dist/AccordionItem.d.mts +31 -0
- package/dist/{Action-C7INft7X.d.mts → Action-B-AiHknZ.d.mts} +3 -3
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +2 -2
- package/dist/AdvancedFilterRulesPopover.d.mts +2 -2
- package/dist/ArrayValueControl.d.mts +1 -1
- package/dist/Attribute.d.mts +3 -3
- package/dist/{Badge-BD0Ut46g.mjs → Badge-COqUjFQu.mjs} +2 -2
- package/dist/{Badge-BD0Ut46g.mjs.map → Badge-COqUjFQu.mjs.map} +1 -1
- package/dist/BooleanValueControl.d.mts +1 -1
- package/dist/{Breadcrumb-DtW1R9xW.d.mts → Breadcrumb-DRFY46ZW.d.mts} +1 -1
- package/dist/Breadcrumb.d.mts +1 -1
- package/dist/{Breadcrumbs-B6JyoS8n.d.mts → Breadcrumbs-DUSbT1I7.d.mts} +2 -2
- package/dist/{Breadcrumbs-CrXfUK1V.mjs → Breadcrumbs-DXS7rU7_.mjs} +5 -5
- package/dist/{Breadcrumbs-CrXfUK1V.mjs.map → Breadcrumbs-DXS7rU7_.mjs.map} +1 -1
- package/dist/Breadcrumbs.d.mts +1 -1
- package/dist/{Button-HodDf_bB.d.mts → Button-xZ6DC5XC.d.mts} +4 -4
- package/dist/Button.d.mts +1 -1
- package/dist/{Calendar-DrdTvzAa.d.mts → Calendar-dPmo2dkj.d.mts} +1 -1
- package/dist/Calendar.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-CpDwATnX.d.mts → Card-CUeM8Lh8.d.mts} +3 -3
- package/dist/Card.d.mts +1 -1
- package/dist/{CardV2-M3o4BELp.mjs → CardV2-D9p7D7jX.mjs} +9 -7
- package/dist/{CardV2-M3o4BELp.mjs.map → CardV2-D9p7D7jX.mjs.map} +1 -1
- package/dist/{Checkbox-CyWXhuby.mjs → Checkbox-DQynkc_I.mjs} +3 -3
- package/dist/{Checkbox-CyWXhuby.mjs.map → Checkbox-DQynkc_I.mjs.map} +1 -1
- package/dist/{Checkbox-C-hMfItK.d.mts → Checkbox-DoJpxPEz.d.mts} +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-1M6EwVmq.mjs → Combobox-C_kCY3P3.mjs} +28 -12
- package/dist/Combobox-C_kCY3P3.mjs.map +1 -0
- package/dist/{Combobox-DyNllwt8.d.mts → Combobox-D7hyf-jA.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-B3YqkjQp.d.mts → ComboboxBase-BMCY6O7Y.d.mts} +10 -5
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-BuwVssvZ.d.mts → ComboboxMultiSelect-L0KYMkmm.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-gJC4v7ER.d.mts → ComboboxSingleSelect-v5oNrJ7M.d.mts} +4 -4
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-DhHh7Roq.d.mts → CompactBar-DjFaUAsN.d.mts} +4 -4
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ConfigFormGroup-Cz7GeTYd.mjs → ConfigFormGroup-DLOZOuLf.mjs} +2 -2
- package/dist/{ConfigFormGroup-Cz7GeTYd.mjs.map → ConfigFormGroup-DLOZOuLf.mjs.map} +1 -1
- package/dist/{ControlBar-C8kagIck.d.mts → ControlBar-Cegjxa6-.d.mts} +7 -2
- package/dist/ControlBar.d.mts +1 -1
- package/dist/DataTable.d.mts +4 -3
- package/dist/{DateField-2aigfD4u.d.mts → DateField-Dk5ykLdr.d.mts} +2 -2
- package/dist/DateField.d.mts +1 -1
- package/dist/{DatePicker-D9JurBBj.mjs → DatePicker-C7z1yodK.mjs} +77 -42
- package/dist/DatePicker-C7z1yodK.mjs.map +1 -0
- package/dist/{DatePicker-DC_RKjdM.d.mts → DatePicker-Dtvv0V45.d.mts} +2 -2
- package/dist/DatePicker.d.mts +1 -1
- package/dist/{DateRangePicker-ByD6IsLB.d.mts → DateRangePicker-HPYsa4wC.d.mts} +3 -3
- package/dist/DateRangePicker.d.mts +1 -1
- package/dist/DateRangeValueControl.d.mts +5 -3
- package/dist/DateValueControl.d.mts +8 -5
- package/dist/{DropdownButton-BWiXLMfD.mjs → DropdownButton-CQrFHOIW.mjs} +3 -3
- package/dist/{DropdownButton-BWiXLMfD.mjs.map → DropdownButton-CQrFHOIW.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-Xl1BYXsY.d.mts → DropdownMenu-D1qvgGTZ.d.mts} +2 -2
- package/dist/{DropdownMenu-CuKSNxc9.mjs → DropdownMenu-rm9Nnxn7.mjs} +7 -2
- package/dist/DropdownMenu-rm9Nnxn7.mjs.map +1 -0
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-Dgu98PkH.d.mts → ErrorProps-B8-Mqf1W.d.mts} +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/{FieldRegistry-BdtxI1N2.d.mts → FieldRegistry-0LmSQ-jc.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-jYjPeD7F.d.mts → FilterBar-BMM4Swbt.d.mts} +11 -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-BEk4F1EV.mjs → FormControl-DXrxoJLl.mjs} +26 -11
- package/dist/FormControl-DXrxoJLl.mjs.map +1 -0
- package/dist/{FormControl-CJfYdgZF.d.mts → FormControl-Dg8doZq2.d.mts} +6 -2
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +1 -1
- package/dist/{FormField-CK8o1sMB.d.mts → FormField-BeLigf9j.d.mts} +4 -2
- package/dist/{FormField-ByT0avVx.mjs → FormField-Crp3F-hv.mjs} +31 -21
- package/dist/FormField-Crp3F-hv.mjs.map +1 -0
- package/dist/FormField.d.mts +1 -1
- package/dist/Grid-eMLuyRzV.mjs +92 -0
- package/dist/Grid-eMLuyRzV.mjs.map +1 -0
- package/dist/Grid.d.mts +4 -1
- package/dist/{Header-ZnHGm8fs.d.mts → Header-DxJ6TfPw.d.mts} +1 -1
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-CQpPO16Q.d.mts → HelperTooltip-DcyrpEZI.d.mts} +2 -2
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/{HoverCopyableField-CN3gl0ny.mjs → HoverCopyableField-12bBuG-d.mjs} +3 -3
- package/dist/{HoverCopyableField-CN3gl0ny.mjs.map → HoverCopyableField-12bBuG-d.mjs.map} +1 -1
- package/dist/{IconButton-zu-VNp1h.d.mts → IconButton-BUMMN-gH.d.mts} +2 -2
- package/dist/{IconButton-CqTPMhjV.mjs → IconButton-CCLMYWVN.mjs} +1 -1
- package/dist/{IconButton-CqTPMhjV.mjs.map → IconButton-CCLMYWVN.mjs.map} +1 -1
- 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-Ce8FvSYf.d.mts → Input-2N2e5JCf.d.mts} +3 -3
- package/dist/{Input-Bc2yWH3j.mjs → Input-Cl4o41k4.mjs} +7 -3
- package/dist/Input-Cl4o41k4.mjs.map +1 -0
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-B1Xod4wm.d.mts → InputProps-TWzig3QO.d.mts} +2 -2
- package/dist/InputProps.d.mts +1 -1
- package/dist/IntegerValueControl.d.mts +1 -1
- package/dist/Link-I9Bklen-.mjs +79 -0
- package/dist/Link-I9Bklen-.mjs.map +1 -0
- package/dist/Link.d.mts +1 -1
- package/dist/{ListBox-D-8iwYVj.d.mts → ListBox-BcoXOt73.d.mts} +3 -3
- package/dist/{ListBox-CFBhILRy.mjs → ListBox-sqeLBiKS.mjs} +33 -16
- package/dist/ListBox-sqeLBiKS.mjs.map +1 -0
- package/dist/ListBox.d.mts +1 -1
- package/dist/ListBoxField.d.mts +3 -2
- package/dist/{LoadingShimmer-Dizk2sZu.mjs → LoadingShimmer-dRSkdlqD.mjs} +13 -8
- package/dist/LoadingShimmer-dRSkdlqD.mjs.map +1 -0
- package/dist/LoadingShimmer.d.mts +1 -1
- package/dist/{LogicRow-CgPds2tq.d.mts → LogicRow-DXywXdYt.d.mts} +3 -3
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +2 -2
- package/dist/{Menu-CSwzFqdv.d.mts → Menu-BekLwm8w.d.mts} +3 -3
- package/dist/{Menu-Cd6oxjAe.mjs → Menu-CwlI7BMN.mjs} +1 -1
- package/dist/{Menu-Cd6oxjAe.mjs.map → Menu-CwlI7BMN.mjs.map} +1 -1
- package/dist/Menu.d.mts +1 -1
- package/dist/Modal-CMiFcXC9.mjs +260 -0
- package/dist/Modal-CMiFcXC9.mjs.map +1 -0
- package/dist/Modal-ymxlGYKt.d.mts +145 -0
- package/dist/Modal.d.mts +2 -145
- package/dist/{PageHeader-DJOlcAiW.mjs → PageHeader-D_0p7UK_.mjs} +2 -2
- package/dist/{PageHeader-DJOlcAiW.mjs.map → PageHeader-D_0p7UK_.mjs.map} +1 -1
- package/dist/PageHeader.d.mts +1 -1
- package/dist/PageLayoutFrame.d.mts +28 -0
- package/dist/{PageSelector-BMz2Q4P6.d.mts → PageSelector-Bxulu6vU.d.mts} +3 -3
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-B1u203DE.mjs → Pagination-Co9CfyFQ.mjs} +5 -5
- package/dist/{Pagination-B1u203DE.mjs.map → Pagination-Co9CfyFQ.mjs.map} +1 -1
- package/dist/{Pagination-ne9hnVoe.d.mts → Pagination-Dg-4O7F7.d.mts} +2 -2
- package/dist/Pagination.d.mts +1 -1
- package/dist/{Pii-Dz4woKd8.mjs → Pii-JGV9gP95.mjs} +2 -2
- package/dist/{Pii-Dz4woKd8.mjs.map → Pii-JGV9gP95.mjs.map} +1 -1
- package/dist/{PillShell-ChTB_koa.d.mts → PillShell-BA7KK1zS.d.mts} +2 -2
- package/dist/PillShell.d.mts +1 -1
- package/dist/{Popover-opVa9Xhc.mjs → Popover-ZAj03lws.mjs} +15 -2
- package/dist/Popover-ZAj03lws.mjs.map +1 -0
- package/dist/ProgressIndicator-CQg08vuA.mjs +188 -0
- package/dist/ProgressIndicator-CQg08vuA.mjs.map +1 -0
- package/dist/ProgressIndicator-D85HQGSx.d.mts +66 -0
- package/dist/ProgressIndicator.d.mts +2 -66
- package/dist/{PseudoClassProps-CdRF3QNn.d.mts → PseudoClassProps-BHs8TX_3.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-Ds1pODKw.mjs → Radio-CYV290JI.mjs} +2 -2
- package/dist/{Radio-Ds1pODKw.mjs.map → Radio-CYV290JI.mjs.map} +1 -1
- package/dist/{RadioGroup-CxL6LW4q.d.mts → RadioGroup-Cq3KV1TN.d.mts} +1 -1
- package/dist/{RadioGroup-HIC9V2hO.mjs → RadioGroup-lWMMtu9V.mjs} +2 -2
- package/dist/{RadioGroup-HIC9V2hO.mjs.map → RadioGroup-lWMMtu9V.mjs.map} +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/{RangeCalendar-B7TwRJbg.d.mts → RangeCalendar-Mh7h74Tp.d.mts} +2 -2
- package/dist/RangeCalendar.d.mts +1 -1
- package/dist/RangeCalendarPresets.d.mts +1 -1
- package/dist/{RouterContext-B7N12wkK.d.mts → RouterContext-B3IU1jb0.d.mts} +2 -2
- package/dist/RouterContext.d.mts +1 -1
- package/dist/{RouterLink-Bq36EGjc.d.mts → RouterLink-CwAqTLC2.d.mts} +2 -2
- package/dist/RouterLink.d.mts +1 -1
- package/dist/RuleEditorFields.d.mts +2 -2
- package/dist/RulesPill.d.mts +1 -1
- package/dist/{SearchInput-D69WxMNq.d.mts → SearchInput-BGyUUcoz.d.mts} +2 -2
- package/dist/SearchInput.d.mts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-OHrfJiw0.mjs → SegmentedControl-BEbIcV3g.mjs} +13 -6
- package/dist/SegmentedControl-BEbIcV3g.mjs.map +1 -0
- package/dist/{SegmentedControl-vCnGsdXo.d.mts → SegmentedControl-DgDabSgr.d.mts} +2 -1
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-sQb4dQwT.d.mts → Select-wqTtGyga.d.mts} +3 -3
- package/dist/{Select-DE7uv9C8.mjs → Select-yC2t_gZb.mjs} +10 -8
- package/dist/Select-yC2t_gZb.mjs.map +1 -0
- package/dist/Select.d.mts +1 -1
- package/dist/SingleColumnLayout.d.mts +16 -0
- package/dist/{Spinner-DplDSBqf.mjs → Spinner-BlAg8_OX.mjs} +1 -1
- package/dist/{Spinner-DplDSBqf.mjs.map → Spinner-BlAg8_OX.mjs.map} +1 -1
- package/dist/SplitColumnLayout.d.mts +19 -0
- package/dist/{Stack-ChsImaEY.mjs → Stack-Bkn0TUDe.mjs} +1 -1
- package/dist/{Stack-ChsImaEY.mjs.map → Stack-Bkn0TUDe.mjs.map} +1 -1
- package/dist/{Stack-8KGPQp0u.d.mts → Stack-CYqjBXe8.d.mts} +1 -1
- package/dist/Stack.d.mts +1 -1
- package/dist/StatusIndicator-DT2zNbkp.mjs +315 -0
- package/dist/StatusIndicator-DT2zNbkp.mjs.map +1 -0
- package/dist/{Sticker-C3Eb13OQ.mjs → Sticker-BLbgJxcH.mjs} +5 -8
- package/dist/Sticker-BLbgJxcH.mjs.map +1 -0
- package/dist/{Sticker-Bf9rhSkv.d.mts → Sticker-BmyKaxwx.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-BepWbJHz.mjs → TabBar-Bj84q1Mr.mjs} +4 -7
- package/dist/{TabBar-BepWbJHz.mjs.map → TabBar-Bj84q1Mr.mjs.map} +1 -1
- package/dist/{Table-BefytM6w.d.mts → Table-DhdHUQ8V.d.mts} +1 -1
- package/dist/{Table-B1gRr2XT.mjs → Table-WqNfjasd.mjs} +22 -3
- package/dist/Table-WqNfjasd.mjs.map +1 -0
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-BZ34-_wV.d.mts → TableBody-qoSvQDds.d.mts} +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/{TableBox-NP6bhtKb.mjs → TableBox-obl64W5Y.mjs} +22 -17
- package/dist/TableBox-obl64W5Y.mjs.map +1 -0
- package/dist/TableBox.d.mts +2 -2
- package/dist/{TableBoxCell-CHGw9HVj.d.mts → TableBoxCell-DzYMx4Ju.d.mts} +6 -6
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/TableBoxField.d.mts +4 -3
- package/dist/{TableBoxRow-BljsXKrL.d.mts → TableBoxRow-B4rFCvWK.d.mts} +3 -3
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-h6HNEv9F.d.mts → TableBoxRowActions-qMKcVuTL.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/{TableCell-DorRxyke.d.mts → TableCell-CGPQRc5g.d.mts} +2 -2
- package/dist/TableCell.d.mts +1 -1
- package/dist/{TableControls-CYTpBlQN.mjs → TableControls-RS_ozBsI.mjs} +219 -70
- package/dist/TableControls-RS_ozBsI.mjs.map +1 -0
- package/dist/{TableControls-BtGFiZeD.d.mts → TableControls-WP78qtET.d.mts} +4 -3
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-C3DYeUmB.d.mts → TableControlsContext-DZIZSyfX.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableHead-B0Fdldgw.d.mts → TableHead-36j-_oyn.d.mts} +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-C_7X8QAT.d.mts → TableHeaderCell-C7gp9j1X.d.mts} +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-CXVVzq0e.d.mts → TableLayout-CQqIV0vj.d.mts} +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-Dr61XJNw.d.mts → TableRow-BJZM8I8i.d.mts} +2 -2
- package/dist/TableRow.d.mts +1 -1
- package/dist/TableTH.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-CCtwcB3I.d.mts → TableViewConfigurationDropdown-Dwy_9FBz.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{TechnicalSticker-_LtE-PRY.mjs → TechnicalSticker-CL0zkOAj.mjs} +1 -1
- package/dist/{TechnicalSticker-_LtE-PRY.mjs.map → TechnicalSticker-CL0zkOAj.mjs.map} +1 -1
- package/dist/{Text-DD_W_ixb.d.mts → Text-DbtTa83E.d.mts} +3 -3
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-DOofaXJi.d.mts → TextArea-CbxF6u7z.d.mts} +2 -2
- package/dist/{TextArea-8TuVvmvj.mjs → TextArea-CfZr5Sk4.mjs} +2 -2
- package/dist/{TextArea-8TuVvmvj.mjs.map → TextArea-CfZr5Sk4.mjs.map} +1 -1
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-BPLKU9wu.d.mts → TextUnderlineTooltip-BgLQuK38.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-2nrUX591.d.mts → Toggle-BYMLrPXk.d.mts} +3 -1
- package/dist/{Toggle-Dcn2Rqgm.mjs → Toggle-D4ZaUcVt.mjs} +11 -5
- package/dist/Toggle-D4ZaUcVt.mjs.map +1 -0
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-Cnqf1-tx.d.mts → Tooltip-4pshzB_i.d.mts} +2 -2
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-g2T5HlqX.d.mts → TruncatedText-O7hE3w0O.d.mts} +1 -1
- package/dist/VersionHistory.d.mts +23 -0
- package/dist/VersionHistoryItem-CIcEgl0K.d.mts +54 -0
- package/dist/VersionHistoryItem.d.mts +2 -0
- package/dist/WizardModal.d.mts +41 -0
- package/dist/accordionTitleTypography-CNB1w3kn.d.mts +17 -0
- package/dist/accordionTitleTypography.d.mts +2 -0
- package/dist/assertNever.d.mts +5 -0
- package/dist/{codec-CoX6LfOY.d.mts → codec-BXVBsB8Y.d.mts} +2 -2
- package/dist/codec.d.mts +1 -1
- package/dist/{color-Bt0Lv1e3.d.mts → color-3UO63ocQ.d.mts} +9 -4
- package/dist/components/Accordion/index.d.mts +4 -0
- package/dist/components/Accordion/index.mjs +330 -0
- package/dist/components/Accordion/index.mjs.map +1 -0
- package/dist/components/Attribute/index.mjs +2 -2
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Banner/index.mjs +1 -1
- package/dist/components/BottomPanel/index.mjs +5 -3
- package/dist/components/BottomPanel/index.mjs.map +1 -1
- package/dist/components/Breadcrumbs/index.d.mts +1 -1
- package/dist/components/Breadcrumbs/index.mjs +1 -1
- package/dist/components/Button/index.d.mts +2 -2
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/ButtonGroup/index.mjs +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/CodeHighlight/index.mjs +3 -1
- package/dist/components/CodeHighlight/index.mjs.map +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 -19
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.mjs +27 -16
- 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 +10 -7
- 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 +2 -2
- package/dist/components/Grid/index.mjs +2 -85
- package/dist/components/HoverCopyableField/index.mjs +1 -1
- package/dist/components/ImageTile/index.mjs +13 -9
- package/dist/components/ImageTile/index.mjs.map +1 -1
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Link/index.mjs +1 -78
- 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.d.mts +1 -1
- package/dist/components/Modal/index.mjs +1 -257
- package/dist/components/PageHeader/index.mjs +1 -1
- package/dist/components/Pagination/index.d.mts +3 -3
- package/dist/components/Pagination/index.mjs +1 -1
- package/dist/components/Pii/index.mjs +1 -1
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/ProgressBar/index.mjs +1 -2
- package/dist/components/ProgressBar/index.mjs.map +1 -1
- package/dist/components/ProgressIndicator/index.d.mts +2 -2
- package/dist/components/ProgressIndicator/index.mjs +1 -187
- 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.mjs +10 -7
- package/dist/components/RightPanel/index.mjs.map +1 -1
- package/dist/components/SegmentedControl/index.d.mts +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Slider/index.mjs +1 -1
- package/dist/components/Slider/index.mjs.map +1 -1
- package/dist/components/SmartTextInput/parser/method-chain/types.d.mts +2 -105
- package/dist/components/SmartTextInput/parser/smart-text/types.d.mts +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 +1 -314
- package/dist/components/Sticker/index.d.mts +1 -1
- package/dist/components/Sticker/index.mjs +1 -1
- package/dist/components/TabBar/index.mjs +1 -1
- package/dist/components/Table/index.d.mts +8 -8
- 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/Tile/index.mjs +2 -2
- package/dist/components/Toast/index.mjs +2 -2
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/Toggle/index.d.mts +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/components/VersionHistory/index.d.mts +3 -0
- package/dist/components/VersionHistory/index.mjs +389 -0
- package/dist/components/VersionHistory/index.mjs.map +1 -0
- package/dist/components/WizardModal/index.d.mts +2 -0
- package/dist/components/WizardModal/index.mjs +106 -0
- package/dist/components/WizardModal/index.mjs.map +1 -0
- package/dist/compound-expression.d.mts +1 -1
- package/dist/{constants-D8bzZ-7B.d.mts → constants-BOxzLX-O.d.mts} +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/{createPath-BDYRvl57.d.mts → createPath-OeTC9kvS.d.mts} +2 -2
- package/dist/createPath.d.mts +1 -1
- package/dist/{date-filter-CZeChs9T.mjs → date-filter-BnzR6NxT.mjs} +1 -1
- package/dist/{date-filter-CZeChs9T.mjs.map → date-filter-BnzR6NxT.mjs.map} +1 -1
- package/dist/{date-range-rule-value-jZAHuxZJ.d.mts → date-range-rule-value-BRp5Bi7R.d.mts} +2 -2
- package/dist/date-range-rule-value.d.mts +1 -1
- package/dist/{date-rule-intent-CC1LdkE7.d.mts → date-rule-intent-CDBtV0ET.d.mts} +3 -3
- package/dist/date-rule-intent.d.mts +1 -1
- package/dist/display.d.mts +2 -2
- package/dist/fieldPickerOptions.d.mts +2 -2
- package/dist/{filter-size-context-BGczB5R9.d.mts → filter-size-context-CqvQ190x.d.mts} +2 -2
- package/dist/filter-size-context.d.mts +1 -1
- package/dist/format-date-value.d.mts +5 -0
- package/dist/helpers.d.mts +1 -1
- package/dist/{index-DalP_w0c.d.mts → index-BXSe73Xn.d.mts} +2 -2
- package/dist/{index-BRKXhLGa.d.mts → index-CyAok7As.d.mts} +2 -2
- package/dist/index-gVcIuWLd.d.mts +1 -0
- package/dist/{index-BZmGEbsA.d.mts → index-wKK9f9La.d.mts} +3 -3
- package/dist/index-zeAhjge4.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 +1 -1
- package/dist/index5.d.mts +14 -14
- package/dist/{input-DCJivcWf.d.mts → input-C6cyiqm2.d.mts} +3 -3
- package/dist/inputFields.d.mts +14 -12
- package/dist/{intersperse-Bxcrxj2Q.mjs → intersperse-Df9zw7Bk.mjs} +1 -1
- package/dist/{intersperse-Bxcrxj2Q.mjs.map → intersperse-Df9zw7Bk.mjs.map} +1 -1
- package/dist/{jsonSchema-c_EfAj8y.d.mts → jsonSchema-CfGi1bzI.d.mts} +67 -11
- package/dist/lib/PDSProvider.d.mts +2 -2
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/chainTypes.d.mts +17 -0
- package/dist/lib/chainTypes.mjs +0 -0
- package/dist/lib/color.d.mts +2 -2
- package/dist/lib/color.mjs +18 -11
- package/dist/lib/color.mjs.map +1 -1
- package/dist/lib/customFunctionSchema.d.mts +49 -0
- package/dist/lib/customFunctionSchema.mjs +299 -0
- package/dist/lib/customFunctionSchema.mjs.map +1 -0
- package/dist/lib/date-filter/index.d.mts +2 -2
- package/dist/lib/date-filter/index.mjs +1 -1
- package/dist/lib/jsonSchema.d.mts +2 -2
- package/dist/lib/jsonSchema.mjs +36 -11
- package/dist/lib/jsonSchema.mjs.map +1 -1
- package/dist/lib/jsonSchemaType.d.mts +7 -0
- package/dist/lib/jsonSchemaType.mjs +31 -0
- package/dist/lib/jsonSchemaType.mjs.map +1 -0
- package/dist/lib/letPointerDownReachDocument.d.mts +22 -0
- package/dist/lib/letPointerDownReachDocument.mjs +25 -0
- package/dist/lib/letPointerDownReachDocument.mjs.map +1 -0
- package/dist/lib/message.d.mts +1 -1
- package/dist/lib/methodChain.d.mts +3 -66
- package/dist/lib/methodChain.mjs +1 -237
- package/dist/lib/methodChainNormalize.d.mts +2 -2
- package/dist/lib/methodChainTypes.d.mts +2 -23
- package/dist/lib/objectSchemaTypes.d.mts +1 -1
- package/dist/lib/platformObject.d.mts +38 -0
- package/dist/lib/platformObject.mjs +79 -0
- package/dist/lib/platformObject.mjs.map +1 -0
- package/dist/lib/pseudoClass.d.mts +1 -1
- package/dist/lib/router/adapters/reactRouter.d.mts +1 -1
- package/dist/lib/router/adapters/tanstack.d.mts +1 -1
- package/dist/lib/router/index.d.mts +5 -5
- package/dist/lib/schemaOptions.d.mts +173 -0
- package/dist/lib/schemaOptions.mjs +481 -0
- package/dist/lib/schemaOptions.mjs.map +1 -0
- package/dist/lib/semanticColor.d.mts +1 -1
- package/dist/lib/snakifyPath.d.mts +5 -0
- package/dist/lib/snakifyPath.mjs +11 -0
- package/dist/lib/snakifyPath.mjs.map +1 -0
- package/dist/{message-CjIHdhX1.d.mts → message-CblP0EjG.d.mts} +1 -1
- package/dist/methodChain-DAQxLgxt.mjs +241 -0
- package/dist/methodChain-DAQxLgxt.mjs.map +1 -0
- package/dist/methodChain-Pk1C3i_E.d.mts +66 -0
- package/dist/methodChainTypes-CqWzfx0M.d.mts +23 -0
- 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/input.mjs +6 -14
- package/dist/mixins/input.mjs.map +1 -1
- package/dist/mixins/menuItem.d.mts +2 -2
- package/dist/mixins/scrollbar.d.mts +10 -0
- package/dist/mixins/scrollbar.mjs +31 -0
- package/dist/mixins/scrollbar.mjs.map +1 -0
- package/dist/mixins/text.d.mts +1 -1
- package/dist/{operators-x_ZENhrT.d.mts → operators-CoXL5Hv6.d.mts} +2 -2
- package/dist/operators.d.mts +1 -1
- package/dist/{palette-qgPRWgUN.d.mts → palette-CxXUs1Fu.d.mts} +3 -3
- package/dist/palette.d.mts +1 -1
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +5 -5
- package/dist/patterns/PageLayout/index.d.mts +4 -1
- package/dist/patterns/PageLayout/index.mjs +99 -2
- package/dist/patterns/PageLayout/index.mjs.map +1 -1
- package/dist/reactRouterFallback.d.mts +1 -1
- package/dist/relative-date-label.d.mts +1 -1
- package/dist/scrollExpandedItemIntoView.d.mts +12 -0
- package/dist/{semantic-DUctmpu_.d.mts → semantic-CFMBsuiJ.d.mts} +2 -2
- package/dist/{semanticColor-IAhXS17y.d.mts → semanticColor-DuJCmDrH.d.mts} +3 -3
- package/dist/{text-DjTGRUM1.d.mts → text-D8HPjiEX.d.mts} +1 -1
- package/dist/{theme-DKiszVRN.d.mts → theme-BcaR-Au5.d.mts} +3 -3
- package/dist/theme.d.mts +1 -1
- package/dist/time-range.d.mts +7 -0
- package/dist/tone.d.mts +3 -3
- package/dist/{types-CcZbBH0e.d.mts → types-BCiq4hGv.d.mts} +1 -1
- package/dist/types-BGMmkUpy.d.mts +105 -0
- package/dist/{types-N8PYonjD.d.mts → types-C4WUSW3e.d.mts} +7 -2
- package/dist/{types-CuQSgl1F.d.mts → types-CkpixGWr.d.mts} +1 -1
- package/dist/{types-D8rWSj3z.d.mts → types-Cl-w8tYc.d.mts} +1 -1
- package/dist/{types-gnF3MPfk2.d.mts → types-CoVZwrMW.d.mts} +2 -2
- package/dist/{types-RWjW1d9I.d.mts → types-DgyGecdM.d.mts} +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types2.d.mts +1 -1
- package/dist/types3.d.mts +1 -1
- package/dist/types4.d.mts +1 -1
- package/dist/types5.d.mts +1 -1
- package/dist/types6.d.mts +1 -1
- package/dist/{url-state-C2gl07_y.d.mts → url-state-8j_ef8Uf.d.mts} +2 -2
- package/dist/url-state.d.mts +1 -1
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useFilterStateV2-BQYcAdKR.d.mts → useFilterStateV2-CW6eght1.d.mts} +3 -3
- package/dist/useFilterStateV2.d.mts +1 -1
- package/dist/{useFormField-DDbo-ExT.d.mts → useFormField-CLRZkUZt.d.mts} +4 -2
- package/dist/{useFormField-DsvC5dOb.mjs → useFormField-XezSxho_.mjs} +3 -2
- package/dist/useFormField-XezSxho_.mjs.map +1 -0
- package/dist/useFormField.d.mts +1 -1
- package/dist/{useFormGroup-CH3kiXoa.mjs → useFormGroup-C7Cax8zO.mjs} +1 -1
- package/dist/{useFormGroup-CH3kiXoa.mjs.map → useFormGroup-C7Cax8zO.mjs.map} +1 -1
- package/dist/{useLocationPathname-K2N4fw8j.d.mts → useLocationPathname-DH5Tdq5X.d.mts} +1 -1
- package/dist/useLocationPathname.d.mts +1 -1
- package/dist/{useTableBoxDragAndDrop-CbbH3pMK.d.mts → useTableBoxDragAndDrop-Da4TiYBT.d.mts} +1 -1
- package/dist/useTableBoxDragAndDrop.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/{utilities-D0EhDri-.d.mts → utilities-DcsbI71T.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.map +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/{validation-CMtfUd-R.d.mts → validation-BgwNghi2.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/{value-control-resolver-Au9JNS5z.d.mts → value-control-resolver-B0HDRxRN.d.mts} +3 -2
- package/dist/value-control-resolver.d.mts +1 -1
- package/dist/variables/effect.d.mts +1 -1
- package/dist/variables/semantic.d.mts +1 -1
- package/dist/variables/semantic.mjs +15 -18
- package/dist/variables/semantic.mjs.map +1 -1
- package/llms.txt +10 -1
- package/package.json +27 -6
- package/skills/ui-authoring/COMPONENTS.md +6 -1
- package/skills/ui-authoring/PATTERNS.md +74 -115
- package/dist/Combobox-1M6EwVmq.mjs.map +0 -1
- package/dist/DatePicker-D9JurBBj.mjs.map +0 -1
- package/dist/DropdownMenu-CuKSNxc9.mjs.map +0 -1
- package/dist/FormControl-BEk4F1EV.mjs.map +0 -1
- package/dist/FormField-ByT0avVx.mjs.map +0 -1
- package/dist/Input-Bc2yWH3j.mjs.map +0 -1
- package/dist/ListBox-CFBhILRy.mjs.map +0 -1
- package/dist/LoadingShimmer-Dizk2sZu.mjs.map +0 -1
- package/dist/Popover-opVa9Xhc.mjs.map +0 -1
- package/dist/SegmentedControl-OHrfJiw0.mjs.map +0 -1
- package/dist/Select-DE7uv9C8.mjs.map +0 -1
- package/dist/Sticker-C3Eb13OQ.mjs.map +0 -1
- package/dist/Table-B1gRr2XT.mjs.map +0 -1
- package/dist/TableBox-NP6bhtKb.mjs.map +0 -1
- package/dist/TableControls-CYTpBlQN.mjs.map +0 -1
- package/dist/Toggle-Dcn2Rqgm.mjs.map +0 -1
- package/dist/components/Grid/index.mjs.map +0 -1
- package/dist/components/Link/index.mjs.map +0 -1
- package/dist/components/Modal/index.mjs.map +0 -1
- package/dist/components/ProgressIndicator/index.mjs.map +0 -1
- package/dist/components/StatusIndicator/index.mjs.map +0 -1
- package/dist/fieldSchemaTypes-BVYSm74B.d.mts +0 -39
- package/dist/lib/fieldSchemaTypes.d.mts +0 -2
- package/dist/lib/fieldSchemaTypes.mjs +0 -41
- package/dist/lib/fieldSchemaTypes.mjs.map +0 -1
- package/dist/lib/methodChain.mjs.map +0 -1
- package/dist/useFormField-DsvC5dOb.mjs.map +0 -1
- /package/dist/{index--p6oQT9I.d.mts → index-B24gUwOx.d.mts} +0 -0
- /package/dist/{index-B33elXxm.d.mts → index-BFnNtGdX.d.mts} +0 -0
- /package/dist/{index-BO_854F2.d.mts → index-BNRXMhlr.d.mts} +0 -0
- /package/dist/{index-BrGZHEgX.d.mts → index-BPiqSRRl.d.mts} +0 -0
- /package/dist/{index-BwAfCVZH2.d.mts → index-BYd3Btr1.d.mts} +0 -0
- /package/dist/{index-CRo77wc3.d.mts → index-Bt4QNofW.d.mts} +0 -0
- /package/dist/{index-CX869wwk.d.mts → index-CEqOS-7M.d.mts} +0 -0
- /package/dist/{index-CsuikFeJ.d.mts → index-CIABef8t.d.mts} +0 -0
- /package/dist/{index-CuYZJcK3.d.mts → index-CTHojwxd.d.mts} +0 -0
- /package/dist/{index-CzItj62a.d.mts → index-Cm-1i165.d.mts} +0 -0
- /package/dist/{index-D13oYj4_.d.mts → index-DB7t8whN.d.mts} +0 -0
- /package/dist/{index-D4DUvwPf.d.mts → index-DBGd4WeR.d.mts} +0 -0
- /package/dist/{index-DMRtRo7y.d.mts → index-DGsJdI5l.d.mts} +0 -0
- /package/dist/{index-DXJd7-2Z.d.mts → index-DWfPppPU.d.mts} +0 -0
- /package/dist/{index-DZlqSwCF.d.mts → index-DedbSZMv.d.mts} +0 -0
- /package/dist/{index-Dflz2i1X.d.mts → index-Jh0C5PIG.d.mts} +0 -0
- /package/dist/{index-DkrC-i1D.d.mts → index-NKYLt_R9.d.mts} +0 -0
- /package/dist/{index-DztUdPP_.d.mts → index-Qwqzz3XM.d.mts} +0 -0
- /package/dist/{index-Rvd9MEUQ.d.mts → index-VWno75SQ.d.mts} +0 -0
- /package/dist/{index-bHnO4ZKt.d.mts → index-fxXoW-qc.d.mts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl-BEbIcV3g.mjs","names":[],"sources":["../components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n type Key,\n type ReactNode,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { ToggleButton, ToggleButtonGroup, type ToggleButtonProps } from 'react-aria-components';\nimport styled from 'styled-components';\n\nimport { BorderRadius, Spacing } from '@persona/design-tokens';\nimport useFormField from 'design-system/components/FormControl/useFormField';\nimport { semanticColor } from 'design-system/lib/semanticColor';\nimport { paragraphMixins } from 'design-system/mixins/text';\n\nconst SegmentedControlSizeContext = createContext<'sm' | 'md'>('md');\n\nexport interface SegmentedControlProps {\n id?: string;\n className?: string;\n\n /**\n * Current selected key (controlled)\n */\n selectedKey?: Key;\n\n /**\n * Default selected key (uncontrolled)\n */\n defaultSelectedKey?: Key;\n\n /**\n * Callback when selection changes\n */\n onSelectionChange?: (key: Key) => void;\n\n /**\n * Whether the entire component is disabled\n */\n disabled?: boolean;\n\n /**\n * Whether the component should take full width\n */\n fullWidth?: boolean;\n\n /**\n * Size of the segmented control\n */\n size?: 'sm' | 'md';\n\n /**\n * Accessible label for the group\n */\n 'aria-label'?: string;\n 'aria-required'?: boolean;\n\n /**\n * Segment components\n */\n children: ReactNode;\n}\n\ninterface StyledSegmentedControlProps {\n id?: string;\n $fullWidth?: boolean;\n $size?: 'sm' | 'md';\n}\n\nconst StyledSegmentedControl = styled(ToggleButtonGroup)<StyledSegmentedControlProps>`\n display: inline-flex;\n background-color: ${({ theme }) =>\n semanticColor(theme, 'ActionNeutral', theme.color.variants.basic.default)};\n border-radius: 5px;\n padding: 1px;\n width: ${({ $fullWidth }) => ($fullWidth ? '100%' : 'auto')};\n height: ${({ $size = 'md' }) => ($size === 'sm' ? '20px' : '24px')};\n`;\n\n/**\n * A segmented control component that allows users to select between multiple options.\n * Built with React Aria for accessibility and keyboard navigation.\n */\nexport const SegmentedControl = forwardRef<HTMLDivElement, SegmentedControlProps>(\n function SegmentedControl(\n {\n id,\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n disabled,\n fullWidth = false,\n size = 'md',\n className,\n 'aria-label': ariaLabel,\n 'aria-required': ariaRequired,\n children,\n ...props\n },\n ref,\n ) {\n const field = useFormField({ inputId: id, disabled });\n const segmentedControlRef = useRef<HTMLDivElement>(null);\n const isRequired = ariaRequired;\n\n useImperativeHandle(ref, () => segmentedControlRef.current!, []);\n // react-aria-components filters aria-required from DOM props, so it is applied imperatively.\n useEffect(() => {\n if (isRequired) {\n segmentedControlRef.current?.setAttribute('aria-required', 'true');\n } else {\n segmentedControlRef.current?.removeAttribute('aria-required');\n }\n }, [isRequired]);\n\n return (\n <SegmentedControlSizeContext.Provider value={size}>\n <StyledSegmentedControl\n ref={segmentedControlRef}\n className={className}\n selectionMode='single'\n selectedKeys={selectedKey ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey ? [defaultSelectedKey] : undefined}\n onSelectionChange={(keys) => {\n const key = Array.from(keys)[0];\n if (key && onSelectionChange) {\n onSelectionChange(key);\n }\n }}\n isDisabled={field.disabled}\n aria-label={ariaLabel}\n aria-labelledby={field.labelId}\n aria-describedby={field.helperTextId}\n aria-errormessage={field.hasError ? field.helperTextId : undefined}\n aria-invalid={field.hasError}\n $fullWidth={fullWidth}\n $size={size}\n {...props}\n id={field.inputId}\n >\n {children}\n </StyledSegmentedControl>\n </SegmentedControlSizeContext.Provider>\n );\n },\n);\n\nconst StyledSegment = styled(ToggleButton)<{ $size?: 'sm' | 'md' }>`\n ${paragraphMixins.sm};\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: transparent;\n border: none;\n border-radius: ${BorderRadius.Md};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.secondary)};\n cursor: pointer;\n flex: 1;\n line-height: 1;\n\n & * {\n cursor: inherit;\n }\n padding: 0 ${({ $size = 'md' }) => ($size === 'sm' ? Spacing[1] : Spacing[2])};\n position: relative;\n transition: all 0.15s ease-in-out;\n white-space: nowrap;\n\n /* Hover state */\n &[data-hovered] {\n background-color: ${({ theme }) => semanticColor(theme, 'ActionNeutralHover', theme.color.variants.basic.hover)};\n }\n\n /* Selected state */\n &[data-selected] {\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', theme.color.primary.white)};\n box-shadow: inset 0 0 0 1px ${({ theme }) => semanticColor(theme, 'BorderDefault', theme.color.border.input)};\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', theme.color.text.primary)};\n }\n\n /* Disabled state */\n &[data-disabled] {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Remove focus outline unless we're using a keyboard */\n &[data-focused]:not([data-focus-visible]) {\n outline: none;\n }\n`;\n\nexport interface SegmentedControlItemProps extends Omit<\n ToggleButtonProps,\n 'isDisabled' | 'style' | 'isSelected' | 'defaultSelected'\n> {\n /**\n * Whether this control item is disabled\n */\n disabled?: boolean;\n}\n\n/**\n * A segment item component for use within SegmentedControl.\n */\nconst SegmentedControlItem = forwardRef<HTMLButtonElement, SegmentedControlItemProps>(\n function SegmentedControlItem({ disabled, children, ...props }, ref) {\n const size = useContext(SegmentedControlSizeContext);\n return (\n <StyledSegment ref={ref} isDisabled={disabled} $size={size} {...props}>\n {children}\n </StyledSegment>\n );\n },\n);\n\nexport default SegmentedControl;\nexport { SegmentedControlItem };\n"],"mappings":";;;;;;;;;AAkBA,MAAM,8BAA8B,cAA2B,KAAK;AAsDpE,MAAM,yBAAyB,OAAO,kBAAkB;;uBAEjC,EAAE,YACrB,cAAc,OAAO,iBAAiB,MAAM,MAAM,SAAS,MAAM,QAAQ,CAAC;;;YAGlE,EAAE,iBAAkB,aAAa,SAAS,OAAQ;aACjD,EAAE,QAAQ,WAAY,UAAU,OAAO,SAAS,OAAQ;;;;;;AAOrE,MAAa,mBAAmB,WAC9B,SAAS,iBACP,EACE,IACA,aACA,oBACA,mBACA,UACA,YAAY,OACZ,OAAO,MACP,WACA,cAAc,WACd,iBAAiB,cACjB,UACA,GAAG,SAEL,KACA;CACA,MAAM,QAAQ,aAAa;EAAE,SAAS;EAAI;EAAU,CAAC;CACrD,MAAM,sBAAsB,OAAuB,KAAK;CACxD,MAAM,aAAa;AAEnB,qBAAoB,WAAW,oBAAoB,SAAU,EAAE,CAAC;AAEhE,iBAAgB;AACd,MAAI,WACF,qBAAoB,SAAS,aAAa,iBAAiB,OAAO;MAElE,qBAAoB,SAAS,gBAAgB,gBAAgB;IAE9D,CAAC,WAAW,CAAC;AAEhB,QACE,oBAAC,4BAA4B,UAA7B;EAAsC,OAAO;YAC3C,oBAAC,wBAAD;GACE,KAAK;GACM;GACX,eAAc;GACd,cAAc,cAAc,CAAC,YAAY,GAAG,KAAA;GAC5C,qBAAqB,qBAAqB,CAAC,mBAAmB,GAAG,KAAA;GACjE,oBAAoB,SAAS;IAC3B,MAAM,MAAM,MAAM,KAAK,KAAK,CAAC;AAC7B,QAAI,OAAO,kBACT,mBAAkB,IAAI;;GAG1B,YAAY,MAAM;GAClB,cAAY;GACZ,mBAAiB,MAAM;GACvB,oBAAkB,MAAM;GACxB,qBAAmB,MAAM,WAAW,MAAM,eAAe,KAAA;GACzD,gBAAc,MAAM;GACpB,YAAY;GACZ,OAAO;GACP,GAAI;GACJ,IAAI,MAAM;GAET;GACsB,CAAA;EACY,CAAA;EAG5C;AAED,MAAM,gBAAgB,OAAO,aAAa;IACtC,gBAAgB,GAAG;;;;;;mBAMJ,aAAa,GAAG;YACvB,EAAE,YAAY,cAAc,OAAO,eAAe,MAAM,MAAM,KAAK,UAAU,CAAC;;;;;;;;gBAQ1E,EAAE,QAAQ,WAAY,UAAU,OAAO,QAAQ,KAAK,QAAQ,GAAI;;;;;;;yBAOvD,EAAE,YAAY,cAAc,OAAO,sBAAsB,MAAM,MAAM,SAAS,MAAM,MAAM,CAAC;;;;;yBAK3F,EAAE,YAAY,cAAc,OAAO,kBAAkB,MAAM,MAAM,QAAQ,MAAM,CAAC;mCACtE,EAAE,YAAY,cAAc,OAAO,iBAAiB,MAAM,MAAM,OAAO,MAAM,CAAC;cACnG,EAAE,YAAY,cAAc,OAAO,aAAa,MAAM,MAAM,KAAK,QAAQ,CAAC;;;;;;;;;;;;;;;;;AA4BxF,MAAM,uBAAuB,WAC3B,SAAS,qBAAqB,EAAE,UAAU,UAAU,GAAG,SAAS,KAAK;AAEnE,QACE,oBAAC,eAAD;EAAoB;EAAK,YAAY;EAAU,OAFpC,WAAW,4BAEoC;EAAE,GAAI;EAC7D;EACa,CAAA;EAGrB"}
|
|
@@ -34,6 +34,7 @@ interface SegmentedControlProps {
|
|
|
34
34
|
* Accessible label for the group
|
|
35
35
|
*/
|
|
36
36
|
'aria-label'?: string;
|
|
37
|
+
'aria-required'?: boolean;
|
|
37
38
|
/**
|
|
38
39
|
* Segment components
|
|
39
40
|
*/
|
|
@@ -56,4 +57,4 @@ interface SegmentedControlItemProps extends Omit<ToggleButtonProps, 'isDisabled'
|
|
|
56
57
|
declare const SegmentedControlItem: _$react.ForwardRefExoticComponent<SegmentedControlItemProps & _$react.RefAttributes<HTMLButtonElement>>;
|
|
57
58
|
//#endregion
|
|
58
59
|
export { SegmentedControlProps as i, SegmentedControlItem as n, SegmentedControlItemProps as r, SegmentedControl as t };
|
|
59
|
-
//# sourceMappingURL=SegmentedControl-
|
|
60
|
+
//# sourceMappingURL=SegmentedControl-DgDabSgr.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as SegmentedControlProps, n as SegmentedControlItem, r as SegmentedControlItemProps, t as SegmentedControl } from "./SegmentedControl-
|
|
1
|
+
import { i as SegmentedControlProps, n as SegmentedControlItem, r as SegmentedControlItemProps, t as SegmentedControl } from "./SegmentedControl-DgDabSgr.mjs";
|
|
2
2
|
export { SegmentedControl, SegmentedControl as default, SegmentedControlItem, SegmentedControlItemProps, SegmentedControlProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as MenuItemProps } from "./Menu-
|
|
2
|
-
import { n as InputSizes, t as InputMixinProps } from "./input-
|
|
1
|
+
import { l as MenuItemProps } from "./Menu-BekLwm8w.mjs";
|
|
2
|
+
import { n as InputSizes, t as InputMixinProps } from "./input-C6cyiqm2.mjs";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -80,4 +80,4 @@ declare const Select: _$react.ForwardRefExoticComponent<SelectProps & _$react.Re
|
|
|
80
80
|
declare const Option: _$react.ForwardRefExoticComponent<SelectPrimitive.SelectItemProps & MenuItemProps<"div"> & _$react.RefAttributes<HTMLDivElement>>;
|
|
81
81
|
//#endregion
|
|
82
82
|
export { SelectProps as i, Select as n, SelectHeader as r, Option as t };
|
|
83
|
-
//# sourceMappingURL=Select-
|
|
83
|
+
//# sourceMappingURL=Select-wqTtGyga.d.mts.map
|
|
@@ -5,11 +5,12 @@ import { i as Paragraph } from "./Text-BdluS7Fy.mjs";
|
|
|
5
5
|
import { isNotDisabled } from "./lib/pseudoClass.mjs";
|
|
6
6
|
import { Z_INDICES } from "./lib/zindex.mjs";
|
|
7
7
|
import inputMixin from "./mixins/input.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { semanticScrollbar } from "./mixins/scrollbar.mjs";
|
|
9
|
+
import { t as HStack } from "./Stack-Bkn0TUDe.mjs";
|
|
10
|
+
import { t as IconButton } from "./IconButton-CCLMYWVN.mjs";
|
|
11
|
+
import { n as useFormField } from "./useFormField-XezSxho_.mjs";
|
|
12
|
+
import { c as MenuList, i as Menu, o as MenuHeading, s as MenuItem } from "./Menu-CwlI7BMN.mjs";
|
|
13
|
+
import { n as DropdownMenu_default } from "./DropdownMenu-rm9Nnxn7.mjs";
|
|
13
14
|
import { Color, Spacing } from "@persona/design-tokens";
|
|
14
15
|
import { forwardRef } from "react";
|
|
15
16
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -35,7 +36,7 @@ const SelectButton = styled("button")`
|
|
|
35
36
|
cursor: pointer;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
${({ theme, isSelectingPlaceholder }) => isSelectingPlaceholder && css`
|
|
39
|
+
${({ theme, isSelectingPlaceholder, disabled }) => isSelectingPlaceholder && !disabled && css`
|
|
39
40
|
color: ${semanticColor(theme, "FgSecondary", theme.color.text.secondary)};
|
|
40
41
|
`}
|
|
41
42
|
`;
|
|
@@ -58,6 +59,7 @@ const OptionsMenu = styled(Menu)`
|
|
|
58
59
|
width: var(--radix-select-trigger-width);
|
|
59
60
|
max-height: ${({ maxHeight }) => maxHeight ?? "225px !important"};
|
|
60
61
|
overflow-y: auto;
|
|
62
|
+
${semanticScrollbar}
|
|
61
63
|
margin-bottom: 0;
|
|
62
64
|
|
|
63
65
|
${({ size }) => {
|
|
@@ -218,7 +220,7 @@ const Select = forwardRef(function Select({ portal = false, portalContainer, siz
|
|
|
218
220
|
width: valueContainerWidth,
|
|
219
221
|
children: /* @__PURE__ */ jsx(SelectPrimitive.Value, { placeholder })
|
|
220
222
|
}), /* @__PURE__ */ jsx(StyledIconContainer, {
|
|
221
|
-
disabled,
|
|
223
|
+
disabled: field.disabled,
|
|
222
224
|
children: /* @__PURE__ */ jsx(CaretDownIcon, {})
|
|
223
225
|
})]
|
|
224
226
|
})
|
|
@@ -242,4 +244,4 @@ const Option = forwardRef(function Option({ children, subtitle, ...props }, forw
|
|
|
242
244
|
//#endregion
|
|
243
245
|
export { Select as n, SelectHeader as r, Option as t };
|
|
244
246
|
|
|
245
|
-
//# sourceMappingURL=Select-
|
|
247
|
+
//# sourceMappingURL=Select-yC2t_gZb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select-yC2t_gZb.mjs","names":["DropdownMenu"],"sources":["../components/Select/Select.tsx"],"sourcesContent":["import * as SelectPrimitive from '@radix-ui/react-select';\nimport type { Property } from 'csstype';\nimport { forwardRef, type ReactNode } from 'react';\nimport { useId } from 'react-aria';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { CaretDownIcon, MoreIcon } from '@persona/icons';\nimport { IconButton } from 'design-system/components/Button';\nimport DropdownMenu from 'design-system/components/DropdownMenu';\nimport useFormField from 'design-system/components/FormControl/useFormField';\nimport Menu, {\n MenuHeading,\n MenuItem,\n type MenuItemProps,\n MenuList,\n type MenuProps,\n} from 'design-system/components/Menu';\nimport { HStack } from 'design-system/components/Stack';\nimport { Paragraph } from 'design-system/components/Text';\nimport { isNotDisabled } from 'design-system/lib/pseudoClass';\nimport { semanticColor } from 'design-system/lib/semanticColor';\nimport { Z_INDICES } from 'design-system/lib/zindex';\nimport inputMixin, { type InputMixinProps, type InputSizes } from 'design-system/mixins/input';\nimport { semanticScrollbar } from 'design-system/mixins/scrollbar';\nimport { paragraphMixins } from 'design-system/mixins/text';\n\nexport interface SelectProps extends InputMixinProps, Omit<SelectPrimitive.SelectProps, 'value'> {\n 'aria-label'?: string;\n placeholder?: string;\n\n /**\n * id will be applied to trigger\n */\n id?: string;\n\n /**\n * Class name will be applied to trigger\n */\n className?: string;\n\n /**\n * Max height of options menu\n */\n maxHeight?: number;\n\n /**\n * Min width of the select\n */\n minWidth?: number;\n\n /**\n * Width of the selected value container\n */\n valueContainerWidth?: 'auto' | '100%';\n\n /**\n * Render dropdown menu in a portal.\n */\n portal?: boolean;\n\n /**\n * Element the portalled menu renders into. Defaults to `document.body`. Pass a container inside\n * the current dialog so the menu escapes clipping ancestors without leaving the dialog's\n * dismiss scope, which would close it on click. Requires `portal`.\n */\n portalContainer?: HTMLElement | null;\n\n /**\n * Props to apply to Radix Select.Trigger within\n */\n triggerProps?: SelectPrimitive.SelectTriggerProps;\n\n /**\n * Props to apply to Radix Select.Content within\n */\n contentProps?: SelectPrimitive.SelectContentProps;\n\n /**\n * Callback meant for use with `react-hook-form`'s `useForm` (or Persona's `useFormSecurely`)\n */\n onChange?: (event: { target: { value: string } }) => void;\n\n size?: InputSizes;\n\n value?: string | null;\n\n width?: string;\n\n header?: ReactNode;\n\n footer?: ReactNode;\n\n /**\n * z-index of content. Please use sparingly.\n */\n zIndex?: Property.ZIndex;\n}\n\ninterface SelectButtonProps extends InputMixinProps {\n isSelectingPlaceholder: boolean;\n $width?: string;\n $minWidth?: number;\n}\n\nconst SelectButton = styled('button')<SelectButtonProps>`\n ${inputMixin};\n display: inline-flex;\n position: relative;\n align-items: center;\n outline: none;\n appearance: none;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding-right: ${Spacing[6]};\n width: ${({ $width }) => $width ?? '100%'};\n min-width: ${({ $minWidth }) => ($minWidth != null ? `${$minWidth}px` : 'auto')};\n\n &${isNotDisabled} {\n cursor: pointer;\n }\n\n ${({ theme, isSelectingPlaceholder, disabled }) =>\n isSelectingPlaceholder &&\n !disabled &&\n css`\n color: ${semanticColor(theme, 'FgSecondary', theme.color.text.secondary)};\n `}\n`;\n\ninterface SelectValueContainerProps {\n width?: string;\n}\n\nconst SelectValueContainer = styled.span<SelectValueContainerProps>`\n text-overflow: ellipsis;\n min-width: 0px;\n overflow: hidden;\n text-align: start;\n\n ${({ width }) =>\n width &&\n css`\n width: ${width};\n `}\n`;\n\nconst OptionSubtitle = styled.div`\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.secondary)};\n font-size: ${({ theme }) => theme.text.paragraph.sm.fontSize};\n margin-top: ${Spacing[1]};\n`;\n\ninterface OptionsMenuProps {\n maxHeight?: number;\n size?: InputSizes;\n}\n\nconst OptionsMenu = styled(Menu)<OptionsMenuProps>`\n width: var(--radix-select-trigger-width);\n max-height: ${({ maxHeight }) => maxHeight ?? '225px !important'};\n overflow-y: auto;\n ${semanticScrollbar}\n margin-bottom: 0;\n\n ${({ size }) => {\n switch (size) {\n case 'md': {\n return css`\n ${MenuList} {\n padding: ${Spacing[2]};\n }\n\n ${OptionItem} {\n ${paragraphMixins.md};\n padding: ${Spacing[2]};\n }\n\n ${MenuHeading} {\n padding: ${Spacing[2]};\n }\n `;\n }\n case 'sm': {\n return css`\n ${MenuList} {\n padding: ${Spacing[1]};\n }\n\n ${OptionItem} {\n ${paragraphMixins.sm};\n padding: ${Spacing[1]};\n }\n\n ${MenuHeading} {\n padding: ${Spacing[1]};\n }\n `;\n }\n }\n }}\n`;\n\nconst SelectContent = styled(SelectPrimitive.Content)<{ $zIndex?: number | string }>`\n z-index: ${({ $zIndex }) => $zIndex || Z_INDICES.dropdown};\n`;\n\nconst SelectHeaderContainer = styled(HStack)`\n display: flex;\n justify-content: space-between;\n padding: ${Spacing[1]} ${Spacing[1]} 0 ${Spacing[1]};\n margin-bottom: ${Spacing[1]};\n`;\n\nconst SelectFooter = styled.div`\n padding: ${Spacing[1]} 0;\n margin-top: ${Spacing[1]};\n border-top: 1px solid ${({ theme }) => semanticColor(theme, 'BorderSubtle', Color.BorderDivider)};\n`;\n\nconst SelectMenu = forwardRef<HTMLUListElement, MenuProps & OptionsMenuProps>(function SelectMenu(\n props: MenuProps,\n forwardedRef,\n) {\n return <OptionsMenu listRef={forwardedRef} {...props} />;\n});\n\nconst OptionItem = styled(MenuItem)`\n ${paragraphMixins.md};\n padding: ${Spacing[4]};\n`;\n\nconst SelectItem = forwardRef<HTMLDivElement, MenuItemProps>(function SelectItem(\n props: MenuItemProps,\n forwardedRef,\n) {\n return <OptionItem ref={forwardedRef} {...props} />;\n});\n\nconst StyledIconContainer = styled(SelectPrimitive.Icon)<{ disabled?: boolean }>`\n position: absolute;\n right: ${Spacing[2]};\n display: flex;\n justify-content: center;\n\n ${({ theme, disabled }) => css`\n color: ${\n disabled\n ? semanticColor(theme, 'FgDisabled', Color.BorderIconDisabled)\n : semanticColor(theme, 'FgPrimary', Color.BorderIconPrimary)\n };\n `}\n`;\n\ninterface SelectHeaderProps {\n title?: ReactNode;\n menuItems?: ReactNode;\n menuTriggerLabel?: string;\n}\n\nexport const SelectHeader = ({ title, menuItems, menuTriggerLabel }: SelectHeaderProps) => {\n const uniqueId = useId();\n\n return (\n <SelectHeaderContainer align='center'>\n {title && (\n <Paragraph color='primary' weight='bold' size='md'>\n {title}\n </Paragraph>\n )}\n {menuItems && (\n <DropdownMenu\n portal={true}\n trigger={\n <IconButton>\n <MoreIcon />\n </IconButton>\n }\n triggerProps={{\n 'aria-label': menuTriggerLabel,\n id: `select-header-menu-trigger-${uniqueId}`,\n }}\n side='right'\n align='start'\n zIndex={Z_INDICES.layeredDropdown}\n contentProps={{\n // Fix for Radix UI 2.1.15 upgrade breaking changes:\n // 1. Portal rendering causes pointer-events issues preventing dropdown interaction\n // 2. Portal timing causes onFocusOutside to fire immediately, closing dropdown\n style: {\n pointerEvents: 'auto', // Ensure dropdown items receive mouse events\n },\n onFocusOutside: (event) => event.preventDefault(), // Prevent immediate portal closing\n }}\n >\n {menuItems}\n </DropdownMenu>\n )}\n </SelectHeaderContainer>\n );\n};\n\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n { portal = false, portalContainer, size = 'md', ...props }: SelectProps,\n forwardedRef,\n) {\n const {\n 'aria-label': ariaLabel,\n hasError,\n hasWarning,\n focused,\n active,\n hovered,\n disabled,\n placeholder,\n maxHeight,\n children,\n triggerProps,\n contentProps,\n id,\n className,\n onChange,\n onValueChange,\n value,\n width,\n header,\n footer,\n minWidth,\n valueContainerWidth,\n zIndex,\n } = props;\n\n const field = useFormField({ inputId: props.id, disabled, hasWarning, hasError });\n\n const content = (\n <SelectContent\n position='popper'\n side='bottom'\n sideOffset={8}\n $zIndex={zIndex}\n {...contentProps}\n >\n <SelectMenu maxHeight={maxHeight} size={size}>\n {header}\n <SelectPrimitive.Viewport>{children}</SelectPrimitive.Viewport>\n {footer && (\n <>\n <SelectFooter>{footer}</SelectFooter>\n </>\n )}\n </SelectMenu>\n </SelectContent>\n );\n\n return (\n <SelectPrimitive.Root\n {...props}\n onValueChange={(value) => {\n onChange?.({ target: { value } });\n onValueChange?.(value);\n }}\n // Custom behavior to consider null as empty value\n value={value === null ? '' : value}\n >\n <SelectPrimitive.Trigger\n ref={forwardedRef}\n asChild\n id={id}\n className={className}\n disabled={field.disabled}\n aria-describedby={field.helperTextId}\n aria-errormessage={field.hasError ? field.helperTextId : undefined}\n aria-invalid={field.hasError}\n aria-label={ariaLabel}\n {...triggerProps}\n >\n <SelectButton\n hasWarning={field.hasWarning}\n hasError={field.hasError}\n hovered={hovered}\n focused={focused}\n active={active}\n disabled={field.disabled}\n placeholder={placeholder}\n isSelectingPlaceholder={props.value === '' || props.value == null}\n $minWidth={minWidth}\n $size={size}\n $width={width}\n >\n <SelectValueContainer width={valueContainerWidth}>\n <SelectPrimitive.Value placeholder={placeholder} />\n </SelectValueContainer>\n <StyledIconContainer disabled={field.disabled}>\n <CaretDownIcon />\n </StyledIconContainer>\n </SelectButton>\n </SelectPrimitive.Trigger>\n {portal ? (\n <SelectPrimitive.Portal container={portalContainer}>{content}</SelectPrimitive.Portal>\n ) : (\n content\n )}\n </SelectPrimitive.Root>\n );\n});\n\nexport default Select;\n\nexport const Option = forwardRef<HTMLDivElement, SelectPrimitive.SelectItemProps & MenuItemProps>(\n function Option({ children, subtitle, ...props }, forwardedRef) {\n return (\n <SelectPrimitive.Item {...props} ref={forwardedRef} asChild>\n <SelectItem {...props}>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n {subtitle && <OptionSubtitle>{subtitle}</OptionSubtitle>}\n </SelectItem>\n </SelectPrimitive.Item>\n );\n },\n);\n"],"mappings":"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"}
|
package/dist/Select.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as SelectProps, n as Select, r as SelectHeader, t as Option } from "./Select-
|
|
1
|
+
import { i as SelectProps, n as Select, r as SelectHeader, t as Option } from "./Select-wqTtGyga.mjs";
|
|
2
2
|
export { Option, Select, Select as default, SelectHeader, SelectProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PageLayoutChromeProps } from "./PageLayoutFrame.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region patterns/PageLayout/SingleColumnLayout.d.ts
|
|
6
|
+
interface SingleColumnLayoutProps extends PageLayoutChromeProps {
|
|
7
|
+
/** Primary page content. Direct children stack vertically. */
|
|
8
|
+
main: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const SingleColumnLayout: ({
|
|
11
|
+
main,
|
|
12
|
+
...chrome
|
|
13
|
+
}: SingleColumnLayoutProps) => _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { SingleColumnLayout, SingleColumnLayoutProps };
|
|
16
|
+
//# sourceMappingURL=SingleColumnLayout.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner-
|
|
1
|
+
{"version":3,"file":"Spinner-BlAg8_OX.mjs","names":["LoaderIconMedium"],"sources":["../components/Spinner/Spinner.tsx"],"sourcesContent":["import styled, { useTheme } from 'styled-components';\n\nimport { rotate } from '@persona/design-system/variables/keyframes';\nimport { TransitionDuration } from '@persona/design-system/variables/transitions';\nimport { Color } from '@persona/design-tokens';\nimport { LoaderIcon } from '@persona/icons';\nimport { LoaderIcon as LoaderIconMedium } from '@persona/icons/24px';\nimport { semanticColor } from 'design-system/lib/semanticColor';\n\nexport type SpinnerVariant = 'default' | 'inverse';\n\ntype SpinnerSize = 'sm' | 'md';\n\ninterface SpinnerProps {\n /**\n * `default` uses {@link Color.BorderIconPrimary}; `inverse` uses {@link Color.BorderIconInverse}\n * (e.g. on dark backgrounds).\n */\n variant?: SpinnerVariant;\n /** Size of the spinner. Defaults to 'sm'. */\n size?: SpinnerSize;\n /** Screen reader text. Defaults to \"Loading...\". */\n srText?: string;\n className?: string;\n}\n\nconst Container = styled.span`\n line-height: 0;\n display: inline-block;\n`;\n\nconst VisuallyHidden = styled.span`\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n`;\n\nconst IconContainer = styled.span`\n display: inline-block;\n animation: ${rotate} ${TransitionDuration.OneSecond} linear infinite;\n`;\n\nexport const Spinner = ({ variant = 'default', size = 'sm', srText, className }: SpinnerProps) => {\n const theme = useTheme();\n const resolvedColor =\n variant === 'inverse'\n ? semanticColor(theme, 'FgInverse', Color.BorderIconInverse)\n : semanticColor(theme, 'FgPrimary', Color.BorderIconPrimary);\n return (\n <Container role='status' aria-label='loading spinner' className={className}>\n <VisuallyHidden>{srText ?? 'Loading...'}</VisuallyHidden>\n <IconContainer>\n {size === 'sm' ? (\n <LoaderIcon color={resolvedColor} />\n ) : (\n <LoaderIconMedium color={resolvedColor} />\n )}\n </IconContainer>\n </Container>\n );\n};\n\nexport default Spinner;\n"],"mappings":";;;;;;;;;AA0BA,MAAM,YAAY,OAAO,IAAI;;;;AAK7B,MAAM,iBAAiB,OAAO,IAAI;;;;;;;;AASlC,MAAM,gBAAgB,OAAO,IAAI;;eAElB,OAAO,GAAA,SAAgC;;AAGtD,MAAa,WAAW,EAAE,UAAU,WAAW,OAAO,MAAM,QAAQ,gBAA8B;CAChG,MAAM,QAAQ,UAAU;CACxB,MAAM,gBACJ,YAAY,YACR,cAAc,OAAO,aAAa,MAAM,kBAAkB,GAC1D,cAAc,OAAO,aAAa,MAAM,kBAAkB;AAChE,QACE,qBAAC,WAAD;EAAW,MAAK;EAAS,cAAW;EAA6B;YAAjE,CACE,oBAAC,gBAAD,EAAA,UAAiB,UAAU,cAA8B,CAAA,EACzD,oBAAC,eAAD,EAAA,UACG,SAAS,OACR,oBAAC,YAAD,EAAY,OAAO,eAAiB,CAAA,GAEpC,oBAACA,cAAD,EAAkB,OAAO,eAAiB,CAAA,EAE9B,CAAA,CACN"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PageLayoutChromeProps } from "./PageLayoutFrame.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region patterns/PageLayout/SplitColumnLayout.d.ts
|
|
6
|
+
interface SplitColumnLayoutProps extends PageLayoutChromeProps {
|
|
7
|
+
/** Primary column. Direct children stack vertically and stay in this column. */
|
|
8
|
+
main: ReactNode;
|
|
9
|
+
/** Supporting column. Direct children stack vertically and stay in this column. */
|
|
10
|
+
aside: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const SplitColumnLayout: ({
|
|
13
|
+
main,
|
|
14
|
+
aside,
|
|
15
|
+
...chrome
|
|
16
|
+
}: SplitColumnLayoutProps) => _$react_jsx_runtime0.JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { SplitColumnLayout, SplitColumnLayoutProps };
|
|
19
|
+
//# sourceMappingURL=SplitColumnLayout.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack-
|
|
1
|
+
{"version":3,"file":"Stack-Bkn0TUDe.mjs","names":[],"sources":["../components/Stack/Stack.tsx"],"sourcesContent":["import type * as CSS from 'csstype';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\n\nexport interface StackProps {\n /**\n * Spacing between items. Defaults to Spacing[3].\n *\n * @defaultValue Spacing[3]\n */\n spacing?: Spacing;\n\n /**\n * Direction of Stack. Defaults to vertical.\n *\n * @defaultValue 'vertical'\n */\n direction?: 'vertical' | 'horizontal';\n\n /**\n * Passed through as `align-items`\n */\n align?: CSS.Property.AlignItems;\n\n /**\n * Passed through as `justify-content`\n */\n justify?: CSS.Property.JustifyContent;\n\n /**\n * Passed through as `flex-wrap`\n */\n wrap?: CSS.Property.FlexWrap;\n\n /**\n * Give each item an equal width/height.\n */\n equal?: boolean;\n\n /**\n * Passed through as `width: 100%`\n */\n fullWidth?: boolean;\n}\n\nexport const Stack = styled('div')<StackProps>`\n display: flex;\n flex-direction: ${({ direction }) => (direction === 'horizontal' ? 'row' : 'column')};\n gap: ${({ spacing }) => spacing || Spacing[2]};\n\n ${({ align }) =>\n align &&\n css`\n align-items: ${align};\n `}\n\n ${({ justify }) =>\n justify &&\n css`\n justify-content: ${justify};\n `}\n\n ${({ wrap }) =>\n wrap &&\n css`\n flex-wrap: ${wrap};\n `}\n\n ${({ equal }) =>\n equal &&\n css`\n > * {\n flex-grow: 1;\n flex-basis: 0;\n }\n `}\n\n ${({ fullWidth }) =>\n fullWidth &&\n css`\n width: 100%;\n `}\n`;\n\nexport default Stack;\n\nexport type HStackProps = ComponentPropsWithoutRef<'div'> & StackProps;\n\nexport const HStack = (props: HStackProps) => <Stack {...props} direction='horizontal' />;\n"],"mappings":";;;;AA+CA,MAAa,QAAQ,OAAO,MAAM;;qBAEb,EAAE,gBAAiB,cAAc,eAAe,QAAQ,SAAU;UAC7E,EAAE,cAAc,WAAW,QAAQ,GAAG;;KAE3C,EAAE,YACH,SACA,GAAG;qBACc,MAAM;MACrB;;KAED,EAAE,cACH,WACA,GAAG;yBACkB,QAAQ;MAC3B;;KAED,EAAE,WACH,QACA,GAAG;mBACY,KAAK;MAClB;;KAED,EAAE,YACH,SACA,GAAG;;;;;MAKD;;KAED,EAAE,gBACH,aACA,GAAG;;MAED;;AAON,MAAa,UAAU,UAAuB,oBAAC,OAAD;CAAO,GAAI;CAAO,WAAU;CAAe,CAAA"}
|
|
@@ -44,4 +44,4 @@ type HStackProps = ComponentPropsWithoutRef<'div'> & StackProps;
|
|
|
44
44
|
declare const HStack: (props: HStackProps) => _$react_jsx_runtime0.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { StackProps as i, HStackProps as n, Stack as r, HStack as t };
|
|
47
|
-
//# sourceMappingURL=Stack-
|
|
47
|
+
//# sourceMappingURL=Stack-CYqjBXe8.d.mts.map
|
package/dist/Stack.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as StackProps, n as HStackProps, r as Stack, t as HStack } from "./Stack-
|
|
1
|
+
import { i as StackProps, n as HStackProps, r as Stack, t as HStack } from "./Stack-CYqjBXe8.mjs";
|
|
2
2
|
export { HStack, HStackProps, Stack, Stack as default, StackProps };
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { a as styled, r as css } from "./styledComponentsInterop-NxwFjeA4.mjs";
|
|
2
|
+
import { TruncatedText } from "./lib/TruncatedText.mjs";
|
|
3
|
+
import { semanticTokens } from "./lib/semanticColor.mjs";
|
|
4
|
+
import { paragraphMixins } from "./mixins/text.mjs";
|
|
5
|
+
import { withAlpha } from "./lib/color.mjs";
|
|
6
|
+
import { BorderRadius, Color, Spacing } from "@persona/design-tokens";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { CircleCheckFillIcon, CircleFillIcon, CircleHalfIcon, CircleMinusFillIcon, CircleNullIcon, CircleSlashIcon, WarningFillIcon } from "@persona/icons/12px";
|
|
9
|
+
//#region components/StatusIndicator/StatusIndicator.tsx
|
|
10
|
+
const STATUS_CONFIG = {
|
|
11
|
+
open: {
|
|
12
|
+
type: "neutral",
|
|
13
|
+
icon: /* @__PURE__ */ jsx(CircleNullIcon, {})
|
|
14
|
+
},
|
|
15
|
+
pending: {
|
|
16
|
+
type: "neutral",
|
|
17
|
+
icon: /* @__PURE__ */ jsx(CircleHalfIcon, {})
|
|
18
|
+
},
|
|
19
|
+
completed: {
|
|
20
|
+
type: "success",
|
|
21
|
+
icon: /* @__PURE__ */ jsx(CircleCheckFillIcon, {})
|
|
22
|
+
},
|
|
23
|
+
active: {
|
|
24
|
+
type: "success",
|
|
25
|
+
icon: /* @__PURE__ */ jsx(CircleFillIcon, {})
|
|
26
|
+
},
|
|
27
|
+
failed: {
|
|
28
|
+
type: "critical",
|
|
29
|
+
icon: /* @__PURE__ */ jsx(CircleSlashIcon, {})
|
|
30
|
+
},
|
|
31
|
+
needs_review: {
|
|
32
|
+
type: "warning",
|
|
33
|
+
icon: /* @__PURE__ */ jsx(WarningFillIcon, {})
|
|
34
|
+
},
|
|
35
|
+
canceled: {
|
|
36
|
+
type: "attention",
|
|
37
|
+
icon: /* @__PURE__ */ jsx(CircleSlashIcon, {})
|
|
38
|
+
},
|
|
39
|
+
archived: {
|
|
40
|
+
type: "neutral",
|
|
41
|
+
icon: /* @__PURE__ */ jsx(CircleMinusFillIcon, {})
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
/** All supported `status` preset keys, derived from the config map. */
|
|
45
|
+
const STATUSES = Object.keys(STATUS_CONFIG);
|
|
46
|
+
const FILLED_STATUS_COLORS = {
|
|
47
|
+
neutral: {
|
|
48
|
+
background: Color.BackgroundStatusIndicatorDefault,
|
|
49
|
+
text: Color.TextStatusIndicatorDefault,
|
|
50
|
+
icon: Color.BorderIconLabelGrey
|
|
51
|
+
},
|
|
52
|
+
attention: {
|
|
53
|
+
background: Color.BackgroundStatusIndicatorAttention,
|
|
54
|
+
text: Color.TextStatusIndicatorAttention,
|
|
55
|
+
icon: Color.BorderIconLabelYellow
|
|
56
|
+
},
|
|
57
|
+
warning: {
|
|
58
|
+
background: Color.BackgroundStatusIndicatorWarning,
|
|
59
|
+
text: Color.TextStatusIndicatorWarning,
|
|
60
|
+
icon: Color.BorderIconLabelOrange
|
|
61
|
+
},
|
|
62
|
+
critical: {
|
|
63
|
+
background: Color.BackgroundStatusIndicatorCritical,
|
|
64
|
+
text: Color.TextStatusIndicatorCritical,
|
|
65
|
+
icon: Color.BorderIconLabelRed
|
|
66
|
+
},
|
|
67
|
+
success: {
|
|
68
|
+
background: Color.BackgroundStatusIndicatorSuccess,
|
|
69
|
+
text: Color.TextStatusIndicatorSuccess,
|
|
70
|
+
icon: Color.BorderIconLabelGreen
|
|
71
|
+
},
|
|
72
|
+
feature: {
|
|
73
|
+
background: Color.BackgroundStatusIndicatorFeature,
|
|
74
|
+
text: Color.TextStatusIndicatorFeature,
|
|
75
|
+
icon: Color.BorderIconLabelPurple
|
|
76
|
+
},
|
|
77
|
+
informational: {
|
|
78
|
+
background: Color.BackgroundStatusIndicatorInformational,
|
|
79
|
+
text: Color.TextStatusIndicatorInformational,
|
|
80
|
+
icon: Color.BorderIconLabelBlue
|
|
81
|
+
},
|
|
82
|
+
miscellaneous: {
|
|
83
|
+
background: Color.BackgroundStatusIndicatorMiscellaneous,
|
|
84
|
+
text: Color.TextStatusIndicatorMiscellaneous,
|
|
85
|
+
icon: Color.BorderIconLabelTeal
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const TRANSPARENT_STATUS_COLORS = {
|
|
89
|
+
neutral: {
|
|
90
|
+
background: "transparent",
|
|
91
|
+
text: Color.TextPrimary,
|
|
92
|
+
icon: Color.BorderIconSecondary
|
|
93
|
+
},
|
|
94
|
+
attention: {
|
|
95
|
+
background: "transparent",
|
|
96
|
+
text: Color.TextPrimary,
|
|
97
|
+
icon: Color.BorderIconWarning
|
|
98
|
+
},
|
|
99
|
+
warning: {
|
|
100
|
+
background: "transparent",
|
|
101
|
+
text: Color.TextPrimary,
|
|
102
|
+
icon: Color.BorderIconWarning
|
|
103
|
+
},
|
|
104
|
+
critical: {
|
|
105
|
+
background: "transparent",
|
|
106
|
+
text: Color.TextPrimary,
|
|
107
|
+
icon: Color.BorderIconDanger
|
|
108
|
+
},
|
|
109
|
+
success: {
|
|
110
|
+
background: "transparent",
|
|
111
|
+
text: Color.TextPrimary,
|
|
112
|
+
icon: Color.BorderIconSuccess
|
|
113
|
+
},
|
|
114
|
+
feature: {
|
|
115
|
+
background: "transparent",
|
|
116
|
+
text: Color.TextPrimary,
|
|
117
|
+
icon: Color.BorderIconActive
|
|
118
|
+
},
|
|
119
|
+
informational: {
|
|
120
|
+
background: "transparent",
|
|
121
|
+
text: Color.TextPrimary,
|
|
122
|
+
icon: Color.BorderIconLabelBlue
|
|
123
|
+
},
|
|
124
|
+
miscellaneous: {
|
|
125
|
+
background: "transparent",
|
|
126
|
+
text: Color.TextPrimary,
|
|
127
|
+
icon: Color.BorderIconLabelTeal
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const semanticFilledStatusColors = (t) => ({
|
|
131
|
+
neutral: {
|
|
132
|
+
background: t.StatusNeutral,
|
|
133
|
+
text: t.FgPrimary,
|
|
134
|
+
icon: t.FgPrimary
|
|
135
|
+
},
|
|
136
|
+
attention: {
|
|
137
|
+
background: withAlpha(t.StatusHighlight, t.Opacity15),
|
|
138
|
+
text: t.FgHighlight,
|
|
139
|
+
icon: t.FgHighlight
|
|
140
|
+
},
|
|
141
|
+
warning: {
|
|
142
|
+
background: withAlpha(t.StatusWarning, t.Opacity15),
|
|
143
|
+
text: t.FgWarning2,
|
|
144
|
+
icon: t.FgWarning2
|
|
145
|
+
},
|
|
146
|
+
critical: {
|
|
147
|
+
background: withAlpha(t.StatusDanger3, t.Opacity15),
|
|
148
|
+
text: t.FgDanger2,
|
|
149
|
+
icon: t.FgDanger2
|
|
150
|
+
},
|
|
151
|
+
success: {
|
|
152
|
+
background: withAlpha(t.StatusSuccess2, t.Opacity15),
|
|
153
|
+
text: t.FgSuccess,
|
|
154
|
+
icon: t.FgSuccess
|
|
155
|
+
},
|
|
156
|
+
feature: {
|
|
157
|
+
background: withAlpha(t.StatusFeature, t.Opacity25),
|
|
158
|
+
text: t.FgFeature,
|
|
159
|
+
icon: t.FgFeature
|
|
160
|
+
},
|
|
161
|
+
informational: {
|
|
162
|
+
background: withAlpha(t.StatusInfo2, t.Opacity25),
|
|
163
|
+
text: t.FgInfo,
|
|
164
|
+
icon: t.FgInfo
|
|
165
|
+
},
|
|
166
|
+
miscellaneous: {
|
|
167
|
+
background: withAlpha(t.StatusMisc, t.Opacity15),
|
|
168
|
+
text: t.FgMisc,
|
|
169
|
+
icon: t.FgMisc
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const semanticTransparentStatusColors = (t) => ({
|
|
173
|
+
neutral: {
|
|
174
|
+
background: "transparent",
|
|
175
|
+
text: t.FgPrimary,
|
|
176
|
+
icon: t.FgSecondary
|
|
177
|
+
},
|
|
178
|
+
attention: {
|
|
179
|
+
background: "transparent",
|
|
180
|
+
text: t.FgPrimary,
|
|
181
|
+
icon: t.FeedbackHighlight1
|
|
182
|
+
},
|
|
183
|
+
warning: {
|
|
184
|
+
background: "transparent",
|
|
185
|
+
text: t.FgPrimary,
|
|
186
|
+
icon: t.FgWarning1
|
|
187
|
+
},
|
|
188
|
+
critical: {
|
|
189
|
+
background: "transparent",
|
|
190
|
+
text: t.FgPrimary,
|
|
191
|
+
icon: t.FgDanger1
|
|
192
|
+
},
|
|
193
|
+
success: {
|
|
194
|
+
background: "transparent",
|
|
195
|
+
text: t.FgPrimary,
|
|
196
|
+
icon: t.FgSuccess
|
|
197
|
+
},
|
|
198
|
+
feature: {
|
|
199
|
+
background: "transparent",
|
|
200
|
+
text: t.FgPrimary,
|
|
201
|
+
icon: t.FgAccent
|
|
202
|
+
},
|
|
203
|
+
informational: {
|
|
204
|
+
background: "transparent",
|
|
205
|
+
text: t.FgPrimary,
|
|
206
|
+
icon: t.FgInfo
|
|
207
|
+
},
|
|
208
|
+
miscellaneous: {
|
|
209
|
+
background: "transparent",
|
|
210
|
+
text: t.FgPrimary,
|
|
211
|
+
icon: t.FgMisc
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
const semanticStatusColorCache = /* @__PURE__ */ new WeakMap();
|
|
215
|
+
const semanticStatusColors = (tokens) => {
|
|
216
|
+
let colors = semanticStatusColorCache.get(tokens);
|
|
217
|
+
if (!colors) {
|
|
218
|
+
colors = {
|
|
219
|
+
filled: semanticFilledStatusColors(tokens),
|
|
220
|
+
none: semanticTransparentStatusColors(tokens)
|
|
221
|
+
};
|
|
222
|
+
semanticStatusColorCache.set(tokens, colors);
|
|
223
|
+
}
|
|
224
|
+
return colors;
|
|
225
|
+
};
|
|
226
|
+
const statusColors = (theme, background) => {
|
|
227
|
+
const tokens = semanticTokens(theme);
|
|
228
|
+
if (tokens) return semanticStatusColors(tokens)[background];
|
|
229
|
+
return background === "filled" ? FILLED_STATUS_COLORS : TRANSPARENT_STATUS_COLORS;
|
|
230
|
+
};
|
|
231
|
+
const Label = styled.div`
|
|
232
|
+
${paragraphMixins.sm}
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
justify-content: center;
|
|
236
|
+
flex-shrink: ${({ $truncate }) => $truncate ? 1 : 0};
|
|
237
|
+
min-width: ${({ $truncate }) => $truncate ? "0" : "auto"};
|
|
238
|
+
/* Line box hugs the font so pill height is driven by padding alone, and clipping an overflowing
|
|
239
|
+
label can't cut into descenders. Matches Sticker. */
|
|
240
|
+
line-height: 1;
|
|
241
|
+
white-space: nowrap;
|
|
242
|
+
text-transform: ${({ $preserveCase }) => $preserveCase ? "none" : "capitalize"};
|
|
243
|
+
/* Slight optical centering adjustment */
|
|
244
|
+
transform: translateY(0.5px);
|
|
245
|
+
color: ${({ theme, $type, $background }) => statusColors(theme, $background)[$type].text};
|
|
246
|
+
`;
|
|
247
|
+
const IconContainer = styled.span`
|
|
248
|
+
line-height: 0;
|
|
249
|
+
color: ${({ theme, $type, $background }) => statusColors(theme, $background)[$type].icon};
|
|
250
|
+
`;
|
|
251
|
+
const LabelContainer = styled.div`
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
gap: ${Spacing[1]};
|
|
255
|
+
padding: ${({ $hasIcon }) => `${Spacing[1]} ${Spacing[2]} ${Spacing[1]} ${$hasIcon ? Spacing[1] : Spacing[2]}`};
|
|
256
|
+
position: relative;
|
|
257
|
+
flex-shrink: ${({ $truncate }) => $truncate ? 1 : 0};
|
|
258
|
+
min-width: ${({ $truncate }) => $truncate ? "0" : "auto"};
|
|
259
|
+
`;
|
|
260
|
+
const StyledStatusIndicator = styled.div`
|
|
261
|
+
display: inline-flex;
|
|
262
|
+
align-items: center;
|
|
263
|
+
border-radius: ${BorderRadius.Xl};
|
|
264
|
+
width: fit-content;
|
|
265
|
+
max-width: ${({ $truncate }) => $truncate ? "100%" : "none"};
|
|
266
|
+
|
|
267
|
+
${({ theme, $type, $background }) => css`
|
|
268
|
+
background-color: ${statusColors(theme, $background)[$type].background};
|
|
269
|
+
`}
|
|
270
|
+
`;
|
|
271
|
+
/**
|
|
272
|
+
* StatusIndicator displays semantic status information with a colored icon and label.
|
|
273
|
+
* Supports both filled backgrounds and transparent styles.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```tsx
|
|
277
|
+
* <StatusIndicator status="active">Active</StatusIndicator>
|
|
278
|
+
* <StatusIndicator type="success" background="filled">Approved</StatusIndicator>
|
|
279
|
+
* <StatusIndicator type="critical" background="none">Failed</StatusIndicator>
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
const StatusIndicator = ({ status, type, background = "filled", showIcon = true, leadingIcon, truncate = false, preserveCase = false, children, ...props }) => {
|
|
283
|
+
const resolvedType = type ?? (status != null ? STATUS_CONFIG[status].type : "neutral");
|
|
284
|
+
let iconToRender;
|
|
285
|
+
if (!showIcon && background === "filled") iconToRender = null;
|
|
286
|
+
else if (typeof leadingIcon !== "undefined") iconToRender = leadingIcon;
|
|
287
|
+
else if (status != null) iconToRender = STATUS_CONFIG[status].icon;
|
|
288
|
+
else iconToRender = /* @__PURE__ */ jsx(CircleNullIcon, {});
|
|
289
|
+
const hasIcon = iconToRender != null;
|
|
290
|
+
return /* @__PURE__ */ jsx(StyledStatusIndicator, {
|
|
291
|
+
$type: resolvedType,
|
|
292
|
+
$background: background,
|
|
293
|
+
$truncate: truncate,
|
|
294
|
+
...props,
|
|
295
|
+
children: /* @__PURE__ */ jsxs(LabelContainer, {
|
|
296
|
+
$hasIcon: hasIcon,
|
|
297
|
+
$truncate: truncate,
|
|
298
|
+
children: [hasIcon && /* @__PURE__ */ jsx(IconContainer, {
|
|
299
|
+
$type: resolvedType,
|
|
300
|
+
$background: background,
|
|
301
|
+
children: iconToRender
|
|
302
|
+
}), /* @__PURE__ */ jsx(Label, {
|
|
303
|
+
$type: resolvedType,
|
|
304
|
+
$background: background,
|
|
305
|
+
$truncate: truncate,
|
|
306
|
+
$preserveCase: preserveCase,
|
|
307
|
+
children: truncate ? /* @__PURE__ */ jsx(TruncatedText, { children }) : children
|
|
308
|
+
})]
|
|
309
|
+
})
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
//#endregion
|
|
313
|
+
export { StatusIndicator as n, STATUSES as t };
|
|
314
|
+
|
|
315
|
+
//# sourceMappingURL=StatusIndicator-DT2zNbkp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusIndicator-DT2zNbkp.mjs","names":[],"sources":["../components/StatusIndicator/StatusIndicator.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius, Color, Spacing } from '@persona/design-tokens';\nimport {\n CircleCheckFillIcon,\n CircleFillIcon,\n CircleHalfIcon,\n CircleMinusFillIcon,\n CircleNullIcon,\n CircleSlashIcon,\n WarningFillIcon,\n} from '@persona/icons/12px';\nimport { withAlpha } from 'design-system/lib/color';\nimport { type MaybeSemanticTheme, semanticTokens } from 'design-system/lib/semanticColor';\nimport { TruncatedText } from 'design-system/lib/TruncatedText';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type { SemanticTokens } from 'design-system/variables/semantic';\n\nexport type StatusType =\n | 'neutral'\n | 'attention'\n | 'warning'\n | 'critical'\n | 'success'\n | 'feature'\n | 'informational'\n | 'miscellaneous';\nexport type BackgroundType = 'filled' | 'none';\n\n/**\n * Narrow set of status presets — one value per type+icon combination.\n * Override color with `type` or icon with `leadingIcon` when needed.\n */\nexport type Status =\n | 'open'\n | 'pending'\n | 'completed'\n | 'active'\n | 'failed'\n | 'needs_review'\n | 'canceled'\n | 'archived';\n\nconst STATUS_CONFIG: Record<Status, { type: StatusType; icon: ReactNode }> = {\n open: { type: 'neutral', icon: <CircleNullIcon /> },\n pending: { type: 'neutral', icon: <CircleHalfIcon /> },\n completed: { type: 'success', icon: <CircleCheckFillIcon /> },\n active: { type: 'success', icon: <CircleFillIcon /> },\n failed: { type: 'critical', icon: <CircleSlashIcon /> },\n needs_review: { type: 'warning', icon: <WarningFillIcon /> },\n canceled: { type: 'attention', icon: <CircleSlashIcon /> },\n archived: { type: 'neutral', icon: <CircleMinusFillIcon /> },\n};\n\n/** All supported `status` preset keys, derived from the config map. */\nexport const STATUSES = Object.keys(STATUS_CONFIG) as Status[];\n\nexport interface StatusIndicatorProps extends ComponentPropsWithoutRef<'div'> {\n /**\n * Preset that sets a default semantic type and icon.\n * Explicit `type` and `leadingIcon` override the preset.\n */\n status?: Status;\n\n /**\n * The semantic status type to display. Overrides `status` when both are set.\n */\n type?: StatusType;\n\n /**\n * Whether to show filled background or transparent\n */\n background?: BackgroundType;\n\n /**\n * Whether to show the icon. When false, displays label-only variant\n * @default true\n */\n showIcon?: boolean;\n\n /**\n * Optional custom icon to replace the default icon indicator (12px recommended)\n * - undefined (default): Uses `status` icon when set, otherwise CircleNullIcon\n * - null: Hides the icon completely\n * - ReactNode: Shows the provided custom icon\n * Note: showIcon must be true for this to take effect\n */\n leadingIcon?: ReactNode | null;\n\n /**\n * Truncate the label with an ellipsis instead of letting it overflow its container. Adds a\n * title tooltip with the full text when it doesn't fit.\n * @default false\n */\n truncate?: boolean;\n\n /**\n * Render the label exactly as given instead of capitalizing each word. Use for labels that are\n * authored outside the product, where the casing is not ours to change.\n * @default false\n */\n preserveCase?: boolean;\n\n /**\n * The text label to display\n */\n children?: ReactNode;\n}\n\ninterface StatusColors {\n background: string;\n text: string;\n icon: string;\n}\n\nconst FILLED_STATUS_COLORS: Record<StatusType, StatusColors> = {\n neutral: {\n background: Color.BackgroundStatusIndicatorDefault,\n text: Color.TextStatusIndicatorDefault,\n icon: Color.BorderIconLabelGrey,\n },\n attention: {\n background: Color.BackgroundStatusIndicatorAttention,\n text: Color.TextStatusIndicatorAttention,\n icon: Color.BorderIconLabelYellow,\n },\n warning: {\n background: Color.BackgroundStatusIndicatorWarning,\n text: Color.TextStatusIndicatorWarning,\n icon: Color.BorderIconLabelOrange,\n },\n critical: {\n background: Color.BackgroundStatusIndicatorCritical,\n text: Color.TextStatusIndicatorCritical,\n icon: Color.BorderIconLabelRed,\n },\n success: {\n background: Color.BackgroundStatusIndicatorSuccess,\n text: Color.TextStatusIndicatorSuccess,\n icon: Color.BorderIconLabelGreen,\n },\n feature: {\n background: Color.BackgroundStatusIndicatorFeature,\n text: Color.TextStatusIndicatorFeature,\n icon: Color.BorderIconLabelPurple,\n },\n informational: {\n background: Color.BackgroundStatusIndicatorInformational,\n text: Color.TextStatusIndicatorInformational,\n icon: Color.BorderIconLabelBlue,\n },\n miscellaneous: {\n background: Color.BackgroundStatusIndicatorMiscellaneous,\n text: Color.TextStatusIndicatorMiscellaneous,\n icon: Color.BorderIconLabelTeal,\n },\n};\n\nconst TRANSPARENT_STATUS_COLORS: Record<StatusType, StatusColors> = {\n neutral: {\n background: 'transparent',\n text: Color.TextPrimary,\n icon: Color.BorderIconSecondary,\n },\n attention: {\n background: 'transparent',\n text: Color.TextPrimary,\n icon: Color.BorderIconWarning,\n },\n warning: {\n background: 'transparent',\n text: Color.TextPrimary,\n icon: Color.BorderIconWarning,\n },\n critical: {\n background: 'transparent',\n text: Color.TextPrimary,\n icon: Color.BorderIconDanger,\n },\n success: {\n background: 'transparent',\n text: Color.TextPrimary,\n icon: Color.BorderIconSuccess,\n },\n feature: {\n background: 'transparent',\n text: Color.TextPrimary,\n icon: Color.BorderIconActive,\n },\n informational: {\n background: 'transparent',\n text: Color.TextPrimary,\n icon: Color.BorderIconLabelBlue,\n },\n miscellaneous: {\n background: 'transparent',\n text: Color.TextPrimary,\n icon: Color.BorderIconLabelTeal,\n },\n};\n\nconst semanticFilledStatusColors = (t: SemanticTokens): Record<StatusType, StatusColors> => ({\n neutral: { background: t.StatusNeutral, text: t.FgPrimary, icon: t.FgPrimary },\n attention: {\n background: withAlpha(t.StatusHighlight, t.Opacity15),\n text: t.FgHighlight,\n icon: t.FgHighlight,\n },\n warning: {\n background: withAlpha(t.StatusWarning, t.Opacity15),\n text: t.FgWarning2,\n icon: t.FgWarning2,\n },\n critical: {\n background: withAlpha(t.StatusDanger3, t.Opacity15),\n text: t.FgDanger2,\n icon: t.FgDanger2,\n },\n success: {\n background: withAlpha(t.StatusSuccess2, t.Opacity15),\n text: t.FgSuccess,\n icon: t.FgSuccess,\n },\n feature: {\n background: withAlpha(t.StatusFeature, t.Opacity25),\n text: t.FgFeature,\n icon: t.FgFeature,\n },\n informational: {\n background: withAlpha(t.StatusInfo2, t.Opacity25),\n text: t.FgInfo,\n icon: t.FgInfo,\n },\n miscellaneous: {\n background: withAlpha(t.StatusMisc, t.Opacity15),\n text: t.FgMisc,\n icon: t.FgMisc,\n },\n});\n\nconst semanticTransparentStatusColors = (t: SemanticTokens): Record<StatusType, StatusColors> => ({\n neutral: { background: 'transparent', text: t.FgPrimary, icon: t.FgSecondary },\n attention: { background: 'transparent', text: t.FgPrimary, icon: t.FeedbackHighlight1 },\n warning: { background: 'transparent', text: t.FgPrimary, icon: t.FgWarning1 },\n critical: { background: 'transparent', text: t.FgPrimary, icon: t.FgDanger1 },\n success: { background: 'transparent', text: t.FgPrimary, icon: t.FgSuccess },\n feature: { background: 'transparent', text: t.FgPrimary, icon: t.FgAccent },\n informational: { background: 'transparent', text: t.FgPrimary, icon: t.FgInfo },\n miscellaneous: { background: 'transparent', text: t.FgPrimary, icon: t.FgMisc },\n});\n\nconst semanticStatusColorCache = new WeakMap<\n SemanticTokens,\n Record<BackgroundType, Record<StatusType, StatusColors>>\n>();\n\nconst semanticStatusColors = (tokens: SemanticTokens) => {\n let colors = semanticStatusColorCache.get(tokens);\n if (!colors) {\n colors = {\n filled: semanticFilledStatusColors(tokens),\n none: semanticTransparentStatusColors(tokens),\n };\n semanticStatusColorCache.set(tokens, colors);\n }\n return colors;\n};\n\nconst statusColors = (theme: MaybeSemanticTheme, background: BackgroundType) => {\n const tokens = semanticTokens(theme);\n if (tokens) {\n return semanticStatusColors(tokens)[background];\n }\n return background === 'filled' ? FILLED_STATUS_COLORS : TRANSPARENT_STATUS_COLORS;\n};\n\nconst Label = styled.div<{\n $type: StatusType;\n $background: BackgroundType;\n $truncate: boolean;\n $preserveCase: boolean;\n}>`\n ${paragraphMixins.sm}\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex-shrink: ${({ $truncate }) => ($truncate ? 1 : 0)};\n min-width: ${({ $truncate }) => ($truncate ? '0' : 'auto')};\n /* Line box hugs the font so pill height is driven by padding alone, and clipping an overflowing\n label can't cut into descenders. Matches Sticker. */\n line-height: 1;\n white-space: nowrap;\n text-transform: ${({ $preserveCase }) => ($preserveCase ? 'none' : 'capitalize')};\n /* Slight optical centering adjustment */\n transform: translateY(0.5px);\n color: ${({ theme, $type, $background }) => statusColors(theme, $background)[$type].text};\n`;\n\nconst IconContainer = styled.span<{ $type: StatusType; $background: BackgroundType }>`\n line-height: 0;\n color: ${({ theme, $type, $background }) => statusColors(theme, $background)[$type].icon};\n`;\n\nconst LabelContainer = styled.div<{ $hasIcon: boolean; $truncate: boolean }>`\n display: flex;\n align-items: center;\n gap: ${Spacing[1]};\n padding: ${({ $hasIcon }) =>\n `${Spacing[1]} ${Spacing[2]} ${Spacing[1]} ${$hasIcon ? Spacing[1] : Spacing[2]}`};\n position: relative;\n flex-shrink: ${({ $truncate }) => ($truncate ? 1 : 0)};\n min-width: ${({ $truncate }) => ($truncate ? '0' : 'auto')};\n`;\n\nconst StyledStatusIndicator = styled.div<{\n $type: StatusType;\n $background: BackgroundType;\n $truncate: boolean;\n}>`\n display: inline-flex;\n align-items: center;\n border-radius: ${BorderRadius.Xl};\n width: fit-content;\n max-width: ${({ $truncate }) => ($truncate ? '100%' : 'none')};\n\n ${({ theme, $type, $background }) => css`\n background-color: ${statusColors(theme, $background)[$type].background};\n `}\n`;\n\n/**\n * StatusIndicator displays semantic status information with a colored icon and label.\n * Supports both filled backgrounds and transparent styles.\n *\n * @example\n * ```tsx\n * <StatusIndicator status=\"active\">Active</StatusIndicator>\n * <StatusIndicator type=\"success\" background=\"filled\">Approved</StatusIndicator>\n * <StatusIndicator type=\"critical\" background=\"none\">Failed</StatusIndicator>\n * ```\n */\nexport const StatusIndicator = ({\n status,\n type,\n background = 'filled',\n showIcon = true,\n leadingIcon,\n truncate = false,\n preserveCase = false,\n children,\n ...props\n}: StatusIndicatorProps) => {\n const resolvedType = type ?? (status != null ? STATUS_CONFIG[status].type : 'neutral');\n\n // Determine which icon to show:\n // - showIcon=false with background='filled': label-only variant (no icon)\n // - leadingIcon set (including null): explicit override\n // - status set: use preset icon\n // - otherwise: default CircleNullIcon\n // - background='none' always shows icon (showIcon is ignored for none background)\n let iconToRender;\n if (!showIcon && background === 'filled') {\n iconToRender = null;\n } else if (typeof leadingIcon !== 'undefined') {\n iconToRender = leadingIcon;\n } else if (status != null) {\n iconToRender = STATUS_CONFIG[status].icon;\n } else {\n iconToRender = <CircleNullIcon />;\n }\n const hasIcon = iconToRender != null;\n\n return (\n <StyledStatusIndicator\n $type={resolvedType}\n $background={background}\n $truncate={truncate}\n {...props}\n >\n <LabelContainer $hasIcon={hasIcon} $truncate={truncate}>\n {hasIcon && (\n <IconContainer $type={resolvedType} $background={background}>\n {iconToRender}\n </IconContainer>\n )}\n <Label\n $type={resolvedType}\n $background={background}\n $truncate={truncate}\n $preserveCase={preserveCase}\n >\n {truncate ? <TruncatedText>{children}</TruncatedText> : children}\n </Label>\n </LabelContainer>\n </StyledStatusIndicator>\n );\n};\n\nexport default StatusIndicator;\n"],"mappings":"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"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as styled
|
|
1
|
+
import { a as styled } from "./styledComponentsInterop-NxwFjeA4.mjs";
|
|
2
2
|
import { TruncatedText } from "./lib/TruncatedText.mjs";
|
|
3
|
-
import { semanticColor,
|
|
3
|
+
import { semanticColor, semanticTokens } from "./lib/semanticColor.mjs";
|
|
4
4
|
import { paragraphMixins } from "./mixins/text.mjs";
|
|
5
5
|
import { withAlpha } from "./lib/color.mjs";
|
|
6
6
|
import { isDisabled, isFocusedVisible, isHovered, isNotDisabled } from "./lib/pseudoClass.mjs";
|
|
7
|
-
import { n as Stack } from "./Stack-
|
|
8
|
-
import { t as IconButton } from "./IconButton-
|
|
7
|
+
import { n as Stack } from "./Stack-Bkn0TUDe.mjs";
|
|
8
|
+
import { t as IconButton } from "./IconButton-CCLMYWVN.mjs";
|
|
9
9
|
import { BorderRadius, Color, Spacing } from "@persona/design-tokens";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { XIcon } from "@persona/icons/12px";
|
|
@@ -218,9 +218,6 @@ const DismissButton = styled(IconButton)`
|
|
|
218
218
|
&${isHovered}${isNotDisabled} {
|
|
219
219
|
cursor: pointer;
|
|
220
220
|
|
|
221
|
-
${({ theme, variant }) => semanticOnly((tokens) => css`
|
|
222
|
-
color: ${semanticStickerTone(tokens, variant).colorHover};
|
|
223
|
-
`)({ theme })}
|
|
224
221
|
background: ${({ theme, variant }) => {
|
|
225
222
|
const tokens = semanticTokens(theme);
|
|
226
223
|
if (tokens) return semanticStickerTone(tokens, variant).backgroundHover;
|
|
@@ -355,4 +352,4 @@ const Sticker = ({ variant, icon, children, onDismiss, disabled, dismissButtonPr
|
|
|
355
352
|
//#endregion
|
|
356
353
|
export { StyledTruncatedText as a, StickerContentContainer as i, Sticker as n, StickerContainer as r, STICKER_COLOR_CONFIG as t };
|
|
357
354
|
|
|
358
|
-
//# sourceMappingURL=Sticker-
|
|
355
|
+
//# sourceMappingURL=Sticker-BLbgJxcH.mjs.map
|