@persona/design-system 0.1.5-pre.4 → 0.1.7
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 +64 -111
- package/dist/{Action-B10lxofb.d.mts → Action-DkNqzc2X.d.mts} +3 -3
- package/dist/{Action-uduFOh2m.d.cts → Action-z1rV4qON.d.cts} +3 -3
- package/dist/Action.d.cts +1 -1
- package/dist/Action.d.mts +1 -1
- package/dist/Attribute.d.mts +4 -4
- package/dist/AttributeGrid.d.mts +1 -1
- package/dist/{Badge-BwAZD9BH.cjs → Badge-DAGPU4-e.cjs} +3 -6
- package/dist/{Badge-BwAZD9BH.cjs.map → Badge-DAGPU4-e.cjs.map} +1 -1
- package/dist/{Badge-BqLnhb4n.mjs → Badge-DRn_r6is.mjs} +2 -5
- package/dist/{Badge-BqLnhb4n.mjs.map → Badge-DRn_r6is.mjs.map} +1 -1
- package/dist/Banner.d.mts +1 -1
- package/dist/Breadcrumb-BOxfam3E.d.cts +31 -0
- package/dist/Breadcrumb-On7pOpgt.d.mts +31 -0
- package/dist/Breadcrumb.d.cts +2 -0
- package/dist/Breadcrumb.d.mts +2 -0
- package/dist/Breadcrumbs.d.cts +20 -0
- package/dist/Breadcrumbs.d.mts +20 -0
- package/dist/{Button-DqDLGURJ.d.mts → Button-DXsYU5qU.d.mts} +2 -2
- package/dist/Button.d.mts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/Calendar.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-DeJSt5ys.mjs → Card-CLTkZLKr.mjs} +4 -4
- package/dist/{Card-DeJSt5ys.mjs.map → Card-CLTkZLKr.mjs.map} +1 -1
- package/dist/{Card-CyCKL-M5.cjs → Card-CaOItkgL.cjs} +5 -5
- package/dist/{Card-CyCKL-M5.cjs.map → Card-CaOItkgL.cjs.map} +1 -1
- package/dist/{Card-CrQL0hXm.d.cts → Card-DnmrsQWi.d.cts} +2 -2
- package/dist/{Card-CcU9cKCd.d.mts → Card-IOBCsfke.d.mts} +4 -4
- package/dist/Card.d.cts +1 -1
- package/dist/Card.d.mts +1 -1
- package/dist/Card2.d.cts +3 -3
- package/dist/Card2.d.mts +1 -1
- package/dist/{Checkbox-C5bGcb-r.mjs → Checkbox-BghGF-iW.mjs} +4 -4
- package/dist/{Checkbox-C5bGcb-r.mjs.map → Checkbox-BghGF-iW.mjs.map} +1 -1
- package/dist/{Checkbox-BWJNAP27.d.mts → Checkbox-DfI0Xp3y.d.cts} +1 -1
- package/dist/{Checkbox-D4nv7eNs.cjs → Checkbox-DhxpxzGp.cjs} +6 -6
- package/dist/{Checkbox-D4nv7eNs.cjs.map → Checkbox-DhxpxzGp.cjs.map} +1 -1
- package/dist/{Checkbox-BmjK0Wac.d.cts → Checkbox-MUC37dLY.d.mts} +1 -1
- package/dist/Checkbox.d.cts +1 -1
- package/dist/Checkbox.d.mts +1 -1
- package/dist/CheckboxGroupField.d.cts +1 -1
- package/dist/CheckboxGroupField.d.mts +2 -2
- package/dist/{Combobox-B_oe33Re.cjs → Combobox-4Bi9-N1p.cjs} +24 -23
- package/dist/Combobox-4Bi9-N1p.cjs.map +1 -0
- package/dist/{Combobox-DjbJYK_u.d.mts → Combobox-5rAFq_52.d.cts} +3 -3
- package/dist/Combobox-Bedo_GIj.d.mts +11 -0
- package/dist/{Combobox-B_-swcix.mjs → Combobox-CeKMrlxy.mjs} +31 -30
- package/dist/Combobox-CeKMrlxy.mjs.map +1 -0
- package/dist/Combobox.d.cts +3 -12
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-D2wypeXf.d.cts → ComboboxBase-BoR9DVwe.d.cts} +6 -5
- package/dist/{ComboboxBase-INya0Csa.d.mts → ComboboxBase-DGZUdsQa.d.mts} +9 -8
- package/dist/ComboboxBase.d.cts +1 -1
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-Dn8cRZ6Z.d.cts → ComboboxMultiSelect-CnI6sFAF.d.cts} +2 -2
- package/dist/{ComboboxMultiSelect-Dq9DGH8S.d.mts → ComboboxMultiSelect-DMWPiBrE.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.cts +1 -1
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-WwBJRb0e.d.mts → ComboboxSingleSelect-CcppU_hq.d.mts} +4 -4
- package/dist/{ComboboxSingleSelect-D8YM7GKP.d.cts → ComboboxSingleSelect-Japejm0g.d.cts} +4 -4
- package/dist/ComboboxSingleSelect.d.cts +1 -1
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/CompactBar-2cpJD7qg.d.mts +21 -0
- package/dist/CompactBar-DTsGo1zU.d.cts +21 -0
- package/dist/CompactBar.d.cts +2 -0
- package/dist/CompactBar.d.mts +2 -0
- package/dist/ConfigFormGroup-DISUwz5j.mjs +28 -0
- package/dist/ConfigFormGroup-DISUwz5j.mjs.map +1 -0
- package/dist/ConfigFormGroup-DVRhkS2L.cjs +35 -0
- package/dist/ConfigFormGroup-DVRhkS2L.cjs.map +1 -0
- package/dist/ControlBar-BGmXymCB.d.cts +151 -0
- package/dist/ControlBar-DXyl1gjc.d.mts +151 -0
- package/dist/ControlBar.d.cts +2 -0
- package/dist/ControlBar.d.mts +2 -0
- package/dist/DataTable.d.cts +372 -0
- package/dist/DataTable.d.mts +372 -0
- package/dist/DateField.d.cts +23 -2
- package/dist/DateField.d.mts +23 -2
- package/dist/DatePicker.d.cts +2 -2
- package/dist/DatePicker.d.mts +2 -2
- package/dist/DateRangePicker.d.cts +8 -2
- package/dist/DateRangePicker.d.mts +9 -4
- package/dist/{DropdownButton-k9kEcexu.mjs → DropdownButton-B397h6ka.mjs} +3 -4
- package/dist/{DropdownButton-k9kEcexu.mjs.map → DropdownButton-B397h6ka.mjs.map} +1 -1
- package/dist/{DropdownButton-DO4NqvWR.cjs → DropdownButton-Du6dwZVL.cjs} +4 -5
- package/dist/{DropdownButton-DO4NqvWR.cjs.map → DropdownButton-Du6dwZVL.cjs.map} +1 -1
- package/dist/DropdownButton.d.cts +1 -1
- package/dist/DropdownButton.d.mts +2 -2
- package/dist/{DropdownMenu-rWgROxQe.d.mts → DropdownMenu-5qIgQ14A.d.mts} +4 -4
- package/dist/{DropdownMenu-D2fzpkX2.cjs → DropdownMenu-CfJxgWN5.cjs} +4 -4
- package/dist/{DropdownMenu-D2fzpkX2.cjs.map → DropdownMenu-CfJxgWN5.cjs.map} +1 -1
- package/dist/{DropdownMenu-Bm2QqLEq.d.cts → DropdownMenu-FIYz6oAo.d.cts} +3 -3
- package/dist/{DropdownMenu-BTk--LWo.mjs → DropdownMenu-cnkoGc7C.mjs} +3 -3
- package/dist/{DropdownMenu-BTk--LWo.mjs.map → DropdownMenu-cnkoGc7C.mjs.map} +1 -1
- package/dist/DropdownMenu.d.cts +1 -1
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-DLdVsYlk.d.cts → ErrorProps-BosuK6zJ.d.cts} +1 -1
- package/dist/{ErrorProps-DYUKygmd.d.mts → ErrorProps-iEj4BIVA.d.mts} +1 -1
- package/dist/ErrorProps.d.cts +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/FloatingActionBar.d.cts +40 -0
- package/dist/FloatingActionBar.d.mts +41 -0
- package/dist/{FormControl-BXHqI_2D.mjs → FormControl-ArDcvmir.mjs} +3 -3
- package/dist/{FormControl-BXHqI_2D.mjs.map → FormControl-ArDcvmir.mjs.map} +1 -1
- package/dist/{FormControl-KkeIYuBa.d.cts → FormControl-BrsML00L.d.cts} +2 -2
- package/dist/{FormControl-DiR2e7Od.cjs → FormControl-Czt95h2L.cjs} +6 -6
- package/dist/{FormControl-DiR2e7Od.cjs.map → FormControl-Czt95h2L.cjs.map} +1 -1
- package/dist/{FormControl-CM7wTn1P.d.mts → FormControl-DnsC4vTX.d.mts} +3 -3
- package/dist/FormControl.d.cts +1 -1
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +14 -0
- package/dist/{FormField-CdMru4s5.d.mts → FormField-BddCs6P0.d.mts} +2 -2
- package/dist/{FormField-19ownwjH.d.cts → FormField-DoSXvnJ3.d.cts} +2 -2
- package/dist/FormField.d.cts +1 -1
- package/dist/FormField.d.mts +1 -1
- package/dist/{Header-t1plnZc0.d.mts → Header-B-Us54dR.d.mts} +2 -2
- package/dist/{Header-D8oDtnIL.d.cts → Header-CkZvzbzL.d.cts} +1 -1
- package/dist/Header.d.cts +1 -1
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-oXdyk2At.d.cts → HelperTooltip-C1CYMpJP.d.cts} +2 -2
- package/dist/{HelperTooltip-Cd7I0Ucq.d.mts → HelperTooltip-CofPKyZh.d.mts} +3 -3
- package/dist/HelperTooltip.d.cts +1 -1
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/HoverCopyableField-B_WNB7Qp.cjs +110 -0
- package/dist/HoverCopyableField-B_WNB7Qp.cjs.map +1 -0
- package/dist/HoverCopyableField-DR575ayC.mjs +103 -0
- package/dist/HoverCopyableField-DR575ayC.mjs.map +1 -0
- package/dist/HoverCopyableField.d.cts +16 -0
- package/dist/HoverCopyableField.d.mts +17 -0
- package/dist/{IconButton-C28qxOdi.mjs → IconButton-DC4rh6ow.mjs} +5 -5
- package/dist/{IconButton-C28qxOdi.mjs.map → IconButton-DC4rh6ow.mjs.map} +1 -1
- package/dist/{IconButton-B1ZL8BqW.cjs → IconButton-DNy7g5zh.cjs} +5 -5
- package/dist/{IconButton-B1ZL8BqW.cjs.map → IconButton-DNy7g5zh.cjs.map} +1 -1
- package/dist/{IconButton-DsXbc3nQ.d.mts → IconButton-Dnnlf9uO.d.mts} +2 -2
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.cts +1 -1
- package/dist/ImageTile.d.mts +2 -2
- package/dist/InlineCombobox.d.mts +45 -0
- package/dist/InlineInput.d.mts +39 -0
- package/dist/{Input-Cv5qieRg.d.mts → Input-4KeYlOWM.d.mts} +5 -5
- package/dist/{Input-DHOsR4cl.cjs → Input-BDLUq-pK.cjs} +6 -7
- package/dist/{Input-DHOsR4cl.cjs.map → Input-BDLUq-pK.cjs.map} +1 -1
- package/dist/{Input-XppkvfUf.d.cts → Input-CEcTvtX2.d.cts} +2 -2
- package/dist/{Input-eoFk39bE.mjs → Input-PWfwMSJ7.mjs} +4 -5
- package/dist/{Input-eoFk39bE.mjs.map → Input-PWfwMSJ7.mjs.map} +1 -1
- package/dist/Input.d.cts +1 -1
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-CitGo8QA.d.cts → InputProps-CTLG2Tr0.d.mts} +2 -2
- package/dist/{InputProps-BHu05fX0.d.mts → InputProps-DNlik5IZ.d.cts} +2 -2
- package/dist/InputProps.d.cts +1 -1
- package/dist/InputProps.d.mts +1 -1
- package/dist/Inserter.d.cts +12 -0
- package/dist/Inserter.d.mts +12 -0
- package/dist/Link.d.mts +1 -1
- package/dist/{ListBox-CE3mfDSB.cjs → ListBox-BCscLcYL.cjs} +11 -15
- package/dist/ListBox-BCscLcYL.cjs.map +1 -0
- package/dist/{ListBox-Z1y0LG1H.mjs → ListBox-CDNOJmvz.mjs} +9 -13
- package/dist/{ListBox-CE3mfDSB.cjs.map → ListBox-CDNOJmvz.mjs.map} +1 -1
- package/dist/{ListBox-AyjzT6ra.d.mts → ListBox-DZIAlPbc.d.mts} +4 -4
- package/dist/{ListBox-DbyZFy2W.d.cts → ListBox-WyZvseo5.d.cts} +2 -2
- package/dist/ListBox.d.cts +1 -1
- package/dist/ListBox.d.mts +1 -1
- package/dist/ListBoxField.d.cts +2 -2
- package/dist/ListBoxField.d.mts +3 -3
- package/dist/{LoadingShimmer-CNE6JUVF.mjs → LoadingShimmer-Bu6KtQ06.mjs} +2 -2
- package/dist/{LoadingShimmer-CNE6JUVF.mjs.map → LoadingShimmer-Bu6KtQ06.mjs.map} +1 -1
- package/dist/{LoadingShimmer-DMK9RC4N.cjs → LoadingShimmer-CUjbAqGd.cjs} +4 -4
- package/dist/{LoadingShimmer-DMK9RC4N.cjs.map → LoadingShimmer-CUjbAqGd.cjs.map} +1 -1
- package/dist/LoadingShimmer.d.mts +2 -2
- package/dist/MaskedInput.d.cts +1 -1
- package/dist/MaskedInput.d.mts +1 -1
- package/dist/{Menu-DIFkRQ6x.d.mts → Menu-BJ5c7HGD.d.mts} +4 -4
- package/dist/{Menu-DPrNMatb.d.cts → Menu-BKMxOXkj.d.cts} +2 -2
- package/dist/{Menu-BpkjNO81.cjs → Menu-BXic-30n.cjs} +4 -4
- package/dist/{Menu-BpkjNO81.cjs.map → Menu-BXic-30n.cjs.map} +1 -1
- package/dist/{Menu-DNRHo2i_.mjs → Menu-CVuFAxl2.mjs} +3 -3
- package/dist/{Menu-DNRHo2i_.mjs.map → Menu-CVuFAxl2.mjs.map} +1 -1
- package/dist/Menu.d.cts +1 -1
- package/dist/Menu.d.mts +1 -1
- package/dist/MiddleTruncatedText-BIzKECv9.cjs +178 -0
- package/dist/MiddleTruncatedText-BIzKECv9.cjs.map +1 -0
- package/dist/MiddleTruncatedText-Bzpg3zAU.mjs +171 -0
- package/dist/MiddleTruncatedText-Bzpg3zAU.mjs.map +1 -0
- package/dist/Modal.d.cts +10 -5
- package/dist/Modal.d.mts +12 -7
- package/dist/PageHeader.d.mts +1 -1
- package/dist/PageSelector-CMoV-cHa.d.mts +30 -0
- package/dist/PageSelector-DoROR_Uh.d.cts +30 -0
- package/dist/PageSelector.d.cts +2 -30
- package/dist/PageSelector.d.mts +2 -30
- package/dist/Pagination-B97xQ-Wk.d.cts +33 -0
- package/dist/Pagination-Cj08JRG9.mjs +202 -0
- package/dist/Pagination-Cj08JRG9.mjs.map +1 -0
- package/dist/Pagination-D4IVVj3S.cjs +233 -0
- package/dist/Pagination-D4IVVj3S.cjs.map +1 -0
- package/dist/Pagination-QWNK_hH7.d.mts +33 -0
- package/dist/Pagination.d.cts +2 -33
- package/dist/Pagination.d.mts +2 -33
- package/dist/Pii-Bxh6_R4T.mjs +19 -0
- package/dist/Pii-Bxh6_R4T.mjs.map +1 -0
- package/dist/Pii-D-Ry7L0t.cjs +25 -0
- package/dist/Pii-D-Ry7L0t.cjs.map +1 -0
- package/dist/Pii.d.mts +1 -1
- package/dist/{Popover-C2dBSwiU.cjs → Popover-BAv7BujW.cjs} +5 -5
- package/dist/{Popover-C2dBSwiU.cjs.map → Popover-BAv7BujW.cjs.map} +1 -1
- package/dist/{Popover-BSdyxuja.mjs → Popover-D0QY5f-J.mjs} +5 -5
- package/dist/{Popover-BSdyxuja.mjs.map → Popover-D0QY5f-J.mjs.map} +1 -1
- package/dist/Popover.d.mts +1 -1
- package/dist/ProgressBar.d.mts +1 -1
- package/dist/ProgressIndicator.d.mts +1 -1
- package/dist/{PseudoClassProps-mZgO_iZJ.d.mts → PseudoClassProps-ySXCGUEQ.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-w-L3Otuk.mjs → Radio-C9DevagH.mjs} +2 -2
- package/dist/{Radio-w-L3Otuk.mjs.map → Radio-C9DevagH.mjs.map} +1 -1
- package/dist/{Radio-mFfT6G3d.cjs → Radio-nw846eRv.cjs} +4 -4
- package/dist/{Radio-mFfT6G3d.cjs.map → Radio-nw846eRv.cjs.map} +1 -1
- package/dist/{RadioGroup-B8htTzsS.mjs → RadioGroup-B3hRbIWF.mjs} +3 -3
- package/dist/{RadioGroup-B8htTzsS.mjs.map → RadioGroup-B3hRbIWF.mjs.map} +1 -1
- package/dist/{RadioGroup-D5ueuC6a.d.cts → RadioGroup-D_H1B7JV.d.cts} +1 -1
- package/dist/{RadioGroup-BjDmweRK.cjs → RadioGroup-DmGVJCgT.cjs} +4 -4
- package/dist/{RadioGroup-BjDmweRK.cjs.map → RadioGroup-DmGVJCgT.cjs.map} +1 -1
- package/dist/{RadioGroup-Ls0vPsP_.d.mts → RadioGroup-nhMXEbCx.d.mts} +1 -1
- package/dist/RadioGroup.d.cts +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/RangeCalendar.d.mts +1 -1
- package/dist/RangeCalendarPresets.d.mts +2 -2
- package/dist/SearchInput-CAHYPQVX.d.cts +46 -0
- package/dist/SearchInput-s6qGC2WZ.d.mts +46 -0
- package/dist/SearchInput.d.cts +2 -0
- package/dist/SearchInput.d.mts +2 -0
- package/dist/Section.d.mts +1 -1
- package/dist/{SectionHeading-DVSXofwK.d.cts → SectionHeading-CDBQ4m9E.d.mts} +5 -6
- package/dist/{SectionHeading-QvAmhVmD.d.mts → SectionHeading-D-L4uPoX.d.cts} +5 -6
- package/dist/SectionHeading.d.cts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-DnwNjYre.mjs → SegmentedControl-B1ZLgu61.mjs} +2 -2
- package/dist/{SegmentedControl-DnwNjYre.mjs.map → SegmentedControl-B1ZLgu61.mjs.map} +1 -1
- package/dist/{SegmentedControl-DRtXdbLe.d.cts → SegmentedControl-BYuXohIp.d.cts} +1 -1
- package/dist/{SegmentedControl-Dk5S4Dhz.d.mts → SegmentedControl-CE845gnm.d.mts} +1 -1
- package/dist/{SegmentedControl-CvznPXgC.cjs → SegmentedControl-CIJz0oxY.cjs} +4 -4
- package/dist/{SegmentedControl-CvznPXgC.cjs.map → SegmentedControl-CIJz0oxY.cjs.map} +1 -1
- package/dist/SegmentedControl.d.cts +1 -1
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-DRnRqMAL.d.mts → Select-BMEwCfbv.d.mts} +5 -5
- package/dist/{Select-Cl3AOq0-.mjs → Select-ByTgXOlU.mjs} +8 -12
- package/dist/{Select-Cl3AOq0-.mjs.map → Select-ByTgXOlU.mjs.map} +1 -1
- package/dist/{Select-CVB-Q1g1.cjs → Select-C65bfYeT.cjs} +9 -13
- package/dist/{Select-CVB-Q1g1.cjs.map → Select-C65bfYeT.cjs.map} +1 -1
- package/dist/{Select-BdPdgtfU.d.cts → Select-NcaURrGZ.d.cts} +4 -4
- package/dist/Select.d.cts +1 -1
- package/dist/Select.d.mts +1 -1
- package/dist/Slider.d.cts +51 -2
- package/dist/Slider.d.mts +51 -2
- package/dist/SliderRHF.d.cts +18 -2
- package/dist/SliderRHF.d.mts +19 -2
- package/dist/SliderThumb.d.mts +2 -119
- package/dist/{Spacer-DWGkX170.cjs → Spacer-GYHbk-dS.cjs} +2 -2
- package/dist/{Spacer-DWGkX170.cjs.map → Spacer-GYHbk-dS.cjs.map} +1 -1
- package/dist/{Spacer-DxH_sQrV.mjs → Spacer-Ln3KChb5.mjs} +1 -1
- package/dist/{Spacer-DxH_sQrV.mjs.map → Spacer-Ln3KChb5.mjs.map} +1 -1
- package/dist/{Spinner-z7DrPE1d.cjs → Spinner-B6bx70yR.cjs} +2 -2
- package/dist/Spinner-B6bx70yR.cjs.map +1 -0
- package/dist/{Spinner-C05An_fn.mjs → Spinner-BEPF42RW.mjs} +1 -1
- package/dist/Spinner-BEPF42RW.mjs.map +1 -0
- package/dist/{Stack-BHb3ZB2A.cjs → Stack-BF-9YjA1.cjs} +2 -2
- package/dist/Stack-BF-9YjA1.cjs.map +1 -0
- package/dist/{Stack-toDRLy--.d.cts → Stack-D979gYU9.d.cts} +5 -5
- package/dist/{Stack-BntgUvsW.d.mts → Stack-UMhJ6F_3.d.mts} +6 -6
- package/dist/{Stack-hwgS2FU1.mjs → Stack-ckRN7LrP.mjs} +1 -1
- package/dist/Stack-ckRN7LrP.mjs.map +1 -0
- package/dist/Stack.d.cts +1 -1
- package/dist/Stack.d.mts +1 -1
- package/dist/StatusIndicator.d.mts +1 -1
- package/dist/{Sticker-D6bwBTGr.mjs → Sticker-B0TbkV4o.mjs} +3 -5
- package/dist/{Sticker-D6bwBTGr.mjs.map → Sticker-B0TbkV4o.mjs.map} +1 -1
- package/dist/{Sticker-D_dutvp_.cjs → Sticker-D0jIU2Dt.cjs} +4 -6
- package/dist/{Sticker-D_dutvp_.cjs.map → Sticker-D0jIU2Dt.cjs.map} +1 -1
- package/dist/{Sticker-Bd7KkekO.d.mts → Sticker-DjF9VJQB.d.mts} +5 -5
- package/dist/{Sticker-S6QWjlEJ.d.cts → Sticker-N8XZnv7M.d.cts} +2 -2
- package/dist/Sticker.d.cts +1 -1
- package/dist/Sticker.d.mts +1 -1
- package/dist/StyledIconDrag.d.mts +13 -0
- package/dist/SwatchPicker.d.mts +1 -1
- package/dist/Tab.d.mts +2 -2
- package/dist/{TabBar-BMv8dAS3.cjs → TabBar-BpHMYvNb.cjs} +9 -8
- package/dist/TabBar-BpHMYvNb.cjs.map +1 -0
- package/dist/{TabBar-Bf89XksH.mjs → TabBar-ByusqAXF.mjs} +8 -7
- package/dist/TabBar-ByusqAXF.mjs.map +1 -0
- package/dist/TabBarIconButton.d.mts +1 -1
- package/dist/Table-C9rjUVpn.cjs +478 -0
- package/dist/Table-C9rjUVpn.cjs.map +1 -0
- package/dist/Table-CNs8p8hL.mjs +387 -0
- package/dist/Table-CNs8p8hL.mjs.map +1 -0
- package/dist/{Table-DkAA1lt_.d.cts → Table-D3nyiZt0.d.mts} +1 -1
- package/dist/{Table-34f5m7w5.d.mts → Table-DJZtluW3.d.cts} +1 -1
- package/dist/Table.d.cts +1 -1
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-5QcVMPP_.d.cts → TableBody-BFPF07n4.d.cts} +1 -1
- package/dist/{TableBody-Clf34yzJ.d.mts → TableBody-DpRjZgzU.d.mts} +1 -1
- package/dist/TableBody.d.cts +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/TableBox-DIJffyts.mjs +1356 -0
- package/dist/TableBox-DIJffyts.mjs.map +1 -0
- package/dist/TableBox-DO-yToJk.cjs +1370 -0
- package/dist/TableBox-DO-yToJk.cjs.map +1 -0
- package/dist/TableBox.d.cts +3 -0
- package/dist/TableBox.d.mts +3 -0
- package/dist/TableBoxCell-D1bjYv7b.d.mts +259 -0
- package/dist/TableBoxCell-DOQ8PnAT.d.cts +259 -0
- package/dist/TableBoxCell.d.cts +2 -0
- package/dist/TableBoxCell.d.mts +2 -0
- package/dist/TableBoxField.d.cts +99 -0
- package/dist/TableBoxField.d.mts +99 -0
- package/dist/TableBoxRow-BUK5RjRA.d.cts +86 -0
- package/dist/TableBoxRow-CTR14HJF.d.mts +86 -0
- package/dist/TableBoxRow.d.cts +2 -0
- package/dist/TableBoxRow.d.mts +2 -0
- package/dist/TableBoxRowActions-BoMt5d0b.d.mts +57 -0
- package/dist/TableBoxRowActions-CKgUEH38.d.cts +57 -0
- package/dist/TableBoxRowActions.d.cts +2 -0
- package/dist/TableBoxRowActions.d.mts +2 -0
- package/dist/TableBoxRowContext.d.mts +22 -0
- package/dist/TableCell.d.cts +1 -1
- package/dist/TableCell.d.mts +1 -1
- package/dist/TableControls-BZyiqk9V.d.mts +70 -0
- package/dist/TableControls-Bkd3jhC1.d.cts +70 -0
- package/dist/TableControls-BkdSeQvt.mjs +1029 -0
- package/dist/TableControls-BkdSeQvt.mjs.map +1 -0
- package/dist/TableControls-DcbnNqeK.cjs +1080 -0
- package/dist/TableControls-DcbnNqeK.cjs.map +1 -0
- package/dist/TableControls.d.cts +2 -0
- package/dist/TableControls.d.mts +2 -0
- package/dist/TableControlsContext-CleTWT7z.d.mts +21 -0
- package/dist/TableControlsContext-D6XpuRVw.d.cts +21 -0
- package/dist/TableControlsContext.d.cts +2 -0
- package/dist/TableControlsContext.d.mts +2 -0
- package/dist/{TableHead-9LLM1B8I.d.cts → TableHead-CTsZNRJm.d.cts} +1 -1
- package/dist/{TableHead-DJBGHoUD.d.mts → TableHead-wl78HqPT.d.mts} +1 -1
- package/dist/TableHead.d.cts +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-DzYZq7SG.d.mts → TableHeaderCell-B2yiOw4w.d.mts} +1 -1
- package/dist/{TableHeaderCell-25lC9tNk.d.cts → TableHeaderCell-UoY92mzR.d.cts} +1 -1
- package/dist/TableHeaderCell.d.cts +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-BA3jbdbi.d.mts → TableLayout-GyRS-Awa.d.cts} +1 -1
- package/dist/{TableLayout-CmDKOu10.d.cts → TableLayout-_TWUnffx.d.mts} +1 -1
- package/dist/TableLayout.d.cts +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-IPjQnK2q.d.cts → TableRow-BVzduO4G.d.cts} +1 -1
- package/dist/{TableRow-CBKpDeUV.d.mts → TableRow-C-faHbkL.d.mts} +2 -2
- package/dist/TableRow.d.cts +1 -1
- package/dist/TableRow.d.mts +1 -1
- package/dist/TableTH.d.cts +1 -1
- package/dist/TableTH.d.mts +1 -1
- package/dist/TableViewConfigurationDropdown-D2TM2wCv.d.mts +32 -0
- package/dist/TableViewConfigurationDropdown-u3-prEHJ.d.cts +32 -0
- package/dist/TableViewConfigurationDropdown.d.cts +2 -0
- package/dist/TableViewConfigurationDropdown.d.mts +2 -0
- package/dist/TechnicalSticker.d.cts +51 -0
- package/dist/TechnicalSticker.d.mts +51 -0
- package/dist/{Text-DVz8erdF.cjs → Text-CzN0DOXV.cjs} +2 -2
- package/dist/{Text-DVz8erdF.cjs.map → Text-CzN0DOXV.cjs.map} +1 -1
- package/dist/{Text-CnXedFut.d.mts → Text-D3FXEnG6.d.mts} +3 -3
- package/dist/{Text-DOTYjIt0.mjs → Text-hEoPeOc9.mjs} +1 -1
- package/dist/{Text-DOTYjIt0.mjs.map → Text-hEoPeOc9.mjs.map} +1 -1
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-B1kitxCl.mjs → TextArea-DIPeBLkr.mjs} +2 -2
- package/dist/{TextArea-B1kitxCl.mjs.map → TextArea-DIPeBLkr.mjs.map} +1 -1
- package/dist/{TextArea-MVgGGM6r.cjs → TextArea-DVHi0K7M.cjs} +4 -4
- package/dist/{TextArea-MVgGGM6r.cjs.map → TextArea-DVHi0K7M.cjs.map} +1 -1
- package/dist/{TextArea-j43fhp2P.d.cts → TextArea-KpDoXg-5.d.cts} +2 -2
- package/dist/{TextArea-1bHvaq9p.d.mts → TextArea-weASn4Hq.d.mts} +2 -2
- package/dist/TextArea.d.cts +1 -1
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-z4sSGL91.d.mts → TextUnderlineTooltip-Cep5cgEQ.d.mts} +3 -3
- package/dist/{TextUnderlineTooltip-BDMs4iXn.d.cts → TextUnderlineTooltip-cSMjZOuB.d.cts} +2 -2
- package/dist/TextUnderlineTooltip.d.cts +1 -1
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.cts +1 -1
- package/dist/Tile.d.mts +2 -2
- package/dist/Toast.d.cts +2 -6
- package/dist/Toast.d.mts +2 -6
- package/dist/{Toggle-B3Cdyf7T.d.mts → Toggle-BQCOJZjZ.d.mts} +1 -1
- package/dist/{Toggle-CVdg5iQ0.cjs → Toggle-CTtrhzsV.cjs} +6 -6
- package/dist/{Toggle-CVdg5iQ0.cjs.map → Toggle-CTtrhzsV.cjs.map} +1 -1
- package/dist/{Toggle-BjkbL_uf.d.cts → Toggle-CYQE1Nk_.d.cts} +1 -1
- package/dist/{Toggle-8GNRxyvE.mjs → Toggle-CfjUQlcK.mjs} +4 -4
- package/dist/{Toggle-8GNRxyvE.mjs.map → Toggle-CfjUQlcK.mjs.map} +1 -1
- package/dist/Toggle.d.cts +1 -1
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-CE1oH6Iz.d.cts → Tooltip-BhGRP9QA.d.cts} +2 -2
- package/dist/{Tooltip-T7RQpy_a.mjs → Tooltip-CDvOu1UN.mjs} +3 -3
- package/dist/{Tooltip-T7RQpy_a.mjs.map → Tooltip-CDvOu1UN.mjs.map} +1 -1
- package/dist/{Tooltip-C0PS5InA.d.mts → Tooltip-DRgufW3i.d.mts} +3 -3
- package/dist/{Tooltip-0i_15ysU.cjs → Tooltip-vylydKVv.cjs} +4 -4
- package/dist/{Tooltip-0i_15ysU.cjs.map → Tooltip-vylydKVv.cjs.map} +1 -1
- package/dist/Tooltip.d.cts +1 -1
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-0Tf8CwFX.d.mts → TruncatedText-Cy8NpHzm.d.mts} +1 -1
- package/dist/{chunk-CoPdw6nB.cjs → chunk-CKQMccvm.cjs} +0 -36
- package/dist/components/Attribute/index.cjs +6 -6
- package/dist/components/Attribute/index.cjs.map +1 -1
- package/dist/components/Attribute/index.mjs +6 -6
- package/dist/components/Attribute/index.mjs.map +1 -1
- package/dist/components/Badge/index.cjs +1 -2
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Banner/index.cjs +2 -3
- package/dist/components/Banner/index.cjs.map +1 -1
- package/dist/components/Banner/index.mjs +1 -2
- package/dist/components/Banner/index.mjs.map +1 -1
- package/dist/components/Breadcrumbs/index.cjs +275 -0
- package/dist/components/Breadcrumbs/index.cjs.map +1 -0
- package/dist/components/Breadcrumbs/index.d.cts +2 -0
- package/dist/components/Breadcrumbs/index.d.mts +2 -0
- package/dist/components/Breadcrumbs/index.mjs +268 -0
- package/dist/components/Breadcrumbs/index.mjs.map +1 -0
- package/dist/components/Button/index.cjs +1 -2
- package/dist/components/Button/index.d.mts +2 -2
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/ButtonGroup/index.cjs +4 -4
- package/dist/components/ButtonGroup/index.cjs.map +1 -1
- package/dist/components/ButtonGroup/index.mjs +2 -2
- package/dist/components/ButtonGroup/index.mjs.map +1 -1
- package/dist/components/Card/index.cjs +1 -2
- package/dist/components/Card/index.d.cts +2 -2
- package/dist/components/Card/index.d.mts +2 -2
- package/dist/components/Card/index.mjs +1 -1
- package/dist/components/CardV2/index.cjs +16 -109
- package/dist/components/CardV2/index.cjs.map +1 -1
- package/dist/components/CardV2/index.d.cts +1 -1
- package/dist/components/CardV2/index.d.mts +1 -1
- package/dist/components/CardV2/index.mjs +18 -118
- package/dist/components/CardV2/index.mjs.map +1 -1
- package/dist/components/Checkbox/index.cjs +1 -2
- package/dist/components/Checkbox/index.d.cts +1 -1
- package/dist/components/Checkbox/index.d.mts +1 -1
- package/dist/components/Checkbox/index.mjs +1 -1
- package/dist/components/Combobox/index.cjs +1 -2
- package/dist/components/Combobox/index.d.cts +3 -3
- package/dist/components/Combobox/index.d.mts +3 -3
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/ConfigFormGroup/index.cjs +4 -31
- package/dist/components/ConfigFormGroup/index.mjs +1 -26
- package/dist/components/DataTable/TableControls/index.cjs +13 -0
- package/dist/components/DataTable/TableControls/index.d.cts +6 -0
- package/dist/components/DataTable/TableControls/index.d.mts +6 -0
- package/dist/components/DataTable/TableControls/index.mjs +2 -0
- package/dist/components/DataTable/index.cjs +1434 -0
- package/dist/components/DataTable/index.cjs.map +1 -0
- package/dist/components/DataTable/index.d.cts +8 -0
- package/dist/components/DataTable/index.d.mts +8 -0
- package/dist/components/DataTable/index.mjs +1407 -0
- package/dist/components/DataTable/index.mjs.map +1 -0
- package/dist/components/DataTable/types.d.cts +159 -0
- package/dist/components/DataTable/types.d.mts +159 -0
- package/dist/components/DataTable/types.mjs +0 -0
- package/dist/components/DatePicker/index.cjs +296 -10866
- package/dist/components/DatePicker/index.cjs.map +1 -1
- package/dist/components/DatePicker/index.d.cts +1 -1
- package/dist/components/DatePicker/index.d.mts +1 -1
- package/dist/components/DatePicker/index.mjs +290 -10859
- package/dist/components/DatePicker/index.mjs.map +1 -1
- package/dist/components/DropdownButton/index.cjs +1 -2
- package/dist/components/DropdownButton/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.cjs +1 -2
- package/dist/components/DropdownMenu/index.d.cts +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/DropdownMenu/index.mjs +1 -1
- package/dist/components/FormControl/index.cjs +2 -3
- package/dist/components/FormControl/index.d.cts +2 -2
- package/dist/components/FormControl/index.d.mts +2 -2
- package/dist/components/FormControl/index.mjs +1 -1
- package/dist/components/FormField/index.cjs +128 -23
- package/dist/components/FormField/index.cjs.map +1 -1
- package/dist/components/FormField/index.d.cts +3 -2
- package/dist/components/FormField/index.d.mts +3 -2
- package/dist/components/FormField/index.mjs +127 -23
- package/dist/components/FormField/index.mjs.map +1 -1
- package/dist/components/HoverCopyableField/index.cjs +2 -0
- package/dist/components/HoverCopyableField/index.d.cts +2 -0
- package/dist/components/HoverCopyableField/index.d.mts +2 -0
- package/dist/components/HoverCopyableField/index.mjs +2 -0
- package/dist/components/ImageTile/index.cjs +9 -12
- package/dist/components/ImageTile/index.cjs.map +1 -1
- package/dist/components/ImageTile/index.mjs +8 -11
- package/dist/components/ImageTile/index.mjs.map +1 -1
- package/dist/components/Input/index.cjs +1 -2
- package/dist/components/Input/index.cjs.map +1 -1
- package/dist/components/Input/index.d.cts +1 -1
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Link/index.cjs +2 -2
- package/dist/components/Link/index.cjs.map +1 -1
- package/dist/components/Link/index.mjs +1 -1
- package/dist/components/Link/index.mjs.map +1 -1
- package/dist/components/ListBox/index.cjs +1 -2
- package/dist/components/ListBox/index.d.cts +1 -1
- package/dist/components/ListBox/index.d.mts +1 -1
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/LoadingShimmer/index.cjs +1 -2
- package/dist/components/LoadingShimmer/index.mjs +1 -1
- package/dist/components/MaskedInput/index.cjs +3 -3
- package/dist/components/MaskedInput/index.mjs +2 -2
- package/dist/components/MatchHighlight/index.cjs +1 -1
- package/dist/components/MatchHighlight/index.cjs.map +1 -1
- package/dist/components/MatchHighlight/index.mjs.map +1 -1
- package/dist/components/Menu/index.cjs +1 -2
- package/dist/components/Menu/index.d.cts +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Menu/index.mjs +1 -1
- package/dist/components/Modal/index.cjs +37 -32
- package/dist/components/Modal/index.cjs.map +1 -1
- package/dist/components/Modal/index.d.cts +2 -2
- package/dist/components/Modal/index.d.mts +2 -2
- package/dist/components/Modal/index.mjs +36 -31
- package/dist/components/Modal/index.mjs.map +1 -1
- package/dist/components/PageHeader/index.cjs +2 -2
- package/dist/components/PageHeader/index.cjs.map +1 -1
- package/dist/components/PageHeader/index.mjs +1 -1
- package/dist/components/PageHeader/index.mjs.map +1 -1
- package/dist/components/Pagination/index.cjs +6 -207
- package/dist/components/Pagination/index.d.cts +4 -3
- package/dist/components/Pagination/index.d.mts +4 -3
- package/dist/components/Pagination/index.mjs +2 -203
- package/dist/components/Pii/index.cjs +2 -20
- package/dist/components/Pii/index.mjs +1 -18
- package/dist/components/Popover/index.cjs +1 -2
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/ProgressBar/index.cjs +2 -2
- package/dist/components/ProgressBar/index.cjs.map +1 -1
- package/dist/components/ProgressBar/index.mjs +1 -1
- package/dist/components/ProgressBar/index.mjs.map +1 -1
- package/dist/components/ProgressIndicator/index.cjs +1 -1
- package/dist/components/ProgressIndicator/index.cjs.map +1 -1
- package/dist/components/ProgressIndicator/index.mjs.map +1 -1
- package/dist/components/Radio/index.cjs +1 -2
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.cjs +1 -2
- package/dist/components/RadioGroup/index.d.cts +1 -1
- package/dist/components/RadioGroup/index.d.mts +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/SegmentedControl/index.cjs +1 -2
- package/dist/components/SegmentedControl/index.d.cts +1 -1
- package/dist/components/SegmentedControl/index.d.mts +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.cjs +1 -2
- package/dist/components/Select/index.d.cts +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Slider/index.cjs +20 -1282
- package/dist/components/Slider/index.cjs.map +1 -1
- package/dist/components/Slider/index.d.cts +2 -2
- package/dist/components/Slider/index.d.mts +2 -2
- package/dist/components/Slider/index.mjs +18 -1279
- package/dist/components/Slider/index.mjs.map +1 -1
- package/dist/components/Spacer/index.cjs +1 -2
- package/dist/components/Spacer/index.mjs +1 -1
- package/dist/components/Spinner/index.cjs +1 -2
- package/dist/components/Spinner/index.mjs +1 -1
- package/dist/components/Stack/index.cjs +1 -2
- package/dist/components/Stack/index.d.cts +1 -1
- package/dist/components/Stack/index.d.mts +1 -1
- package/dist/components/Stack/index.mjs +1 -1
- package/dist/components/StatusIndicator/index.cjs +1 -1
- package/dist/components/StatusIndicator/index.cjs.map +1 -1
- package/dist/components/StatusIndicator/index.mjs.map +1 -1
- package/dist/components/Sticker/index.cjs +1 -2
- package/dist/components/Sticker/index.d.cts +1 -1
- package/dist/components/Sticker/index.d.mts +1 -1
- package/dist/components/Sticker/index.mjs +1 -1
- package/dist/components/SwatchPicker/index.cjs +3 -5
- package/dist/components/SwatchPicker/index.cjs.map +1 -1
- package/dist/components/SwatchPicker/index.mjs +2 -4
- package/dist/components/SwatchPicker/index.mjs.map +1 -1
- package/dist/components/TabBar/index.cjs +1 -2
- package/dist/components/TabBar/index.mjs +1 -1
- package/dist/components/Table/index.cjs +17 -396
- package/dist/components/Table/index.d.cts +7 -7
- package/dist/components/Table/index.d.mts +7 -7
- package/dist/components/Table/index.mjs +1 -378
- package/dist/components/TableBox/index.cjs +7 -0
- package/dist/components/TableBox/index.d.cts +3 -0
- package/dist/components/TableBox/index.d.mts +3 -0
- package/dist/components/TableBox/index.mjs +2 -0
- package/dist/components/TechnicalSticker/index.cjs +239 -0
- package/dist/components/TechnicalSticker/index.cjs.map +1 -0
- package/dist/components/TechnicalSticker/index.d.cts +2 -0
- package/dist/components/TechnicalSticker/index.d.mts +2 -0
- package/dist/components/TechnicalSticker/index.mjs +232 -0
- package/dist/components/TechnicalSticker/index.mjs.map +1 -0
- package/dist/components/Text/index.cjs +1 -2
- package/dist/components/Text/index.d.mts +1 -1
- package/dist/components/Text/index.mjs +1 -1
- package/dist/components/TextArea/index.cjs +1 -2
- package/dist/components/TextArea/index.d.cts +1 -1
- package/dist/components/TextArea/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Tile/index.cjs +5 -6
- package/dist/components/Tile/index.cjs.map +1 -1
- package/dist/components/Tile/index.mjs +4 -5
- package/dist/components/Tile/index.mjs.map +1 -1
- package/dist/components/Toast/index.cjs +5 -12
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts +2 -2
- package/dist/components/Toast/index.d.mts +2 -2
- package/dist/components/Toast/index.mjs +4 -10
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/Toggle/index.cjs +1 -2
- package/dist/components/Toggle/index.d.cts +1 -1
- package/dist/components/Toggle/index.d.mts +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/Tooltip/index.cjs +1 -2
- package/dist/components/Tooltip/index.d.cts +3 -3
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/components/Tooltip/index.mjs +1 -1
- package/dist/constants-DVwPpTt5.d.mts +6 -0
- package/dist/constants-kwVsjw8O.d.cts +6 -0
- package/dist/constants.d.cts +2 -0
- package/dist/constants.d.mts +2 -5
- package/dist/constants2.d.cts +10 -0
- package/dist/constants2.d.mts +10 -0
- package/dist/helpers.d.cts +76 -0
- package/dist/helpers.d.mts +76 -0
- package/dist/{TableCell-Dog4Blfq.d.mts → index-BPnJP0jZ.d.mts} +4 -4
- package/dist/index-Oio5ygqN.d.mts +1 -0
- package/dist/index-VWno75SQ.d.mts +1 -0
- package/dist/{TableCell-DIs9h97h.d.cts → index-_tQRydn9.d.cts} +3 -3
- package/dist/index-_wQ5ClJU.d.cts +1 -0
- package/dist/index-c55Utzva.d.mts +1 -0
- package/dist/index-gpCH5158.d.mts +1 -0
- package/dist/index-lQ_hGQ08.d.cts +1 -0
- package/dist/index-luywJTzJ.d.mts +1 -0
- package/dist/index-zO0Ly4bS.d.cts +1 -0
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index2.d.cts +2 -1
- package/dist/index2.d.mts +2 -1
- package/dist/index3.d.cts +1 -0
- package/dist/index3.d.mts +1 -0
- package/dist/{input-Bm_anD8X.d.cts → input-BkzqXwn7.d.cts} +2 -2
- package/dist/{input-BCmP106-.d.mts → input-DrG6mA0V.d.mts} +3 -3
- package/dist/inputFields.d.cts +10 -10
- package/dist/inputFields.d.mts +11 -11
- package/dist/intersperse-Gxwgpbk8.cjs +26 -0
- package/dist/intersperse-Gxwgpbk8.cjs.map +1 -0
- package/dist/intersperse-yd3oMrQl.mjs +21 -0
- package/dist/intersperse-yd3oMrQl.mjs.map +1 -0
- package/dist/lib/ConfigContext.cjs +1 -1
- package/dist/lib/GlobalStyles.cjs +57 -0
- package/dist/lib/GlobalStyles.cjs.map +1 -0
- package/dist/lib/GlobalStyles.d.cts +8 -0
- package/dist/lib/GlobalStyles.d.mts +8 -0
- package/dist/lib/GlobalStyles.mjs +51 -0
- package/dist/lib/GlobalStyles.mjs.map +1 -0
- package/dist/lib/HeadlessAriaButton.cjs +1 -1
- package/dist/lib/MiddleTruncatedText.cjs +7 -0
- package/dist/lib/MiddleTruncatedText.d.cts +14 -0
- package/dist/lib/MiddleTruncatedText.d.mts +14 -0
- package/dist/lib/MiddleTruncatedText.mjs +2 -0
- package/dist/lib/PDSProvider.cjs +5 -12
- package/dist/lib/PDSProvider.cjs.map +1 -1
- package/dist/lib/PDSProvider.d.cts +0 -2
- package/dist/lib/PDSProvider.d.mts +1 -3
- package/dist/lib/PDSProvider.mjs +4 -11
- package/dist/lib/PDSProvider.mjs.map +1 -1
- package/dist/lib/TruncatedText.cjs +2 -2
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedText.mjs +1 -1
- package/dist/lib/TruncatedTextWithTooltip.cjs +3 -3
- package/dist/lib/TruncatedTextWithTooltip.d.cts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.mjs +2 -2
- package/dist/lib/comboboxHelper.cjs +6 -6
- package/dist/lib/comboboxHelper.cjs.map +1 -1
- package/dist/lib/comboboxHelper.mjs +1 -1
- package/dist/lib/copyTextToClipboard.cjs +33 -0
- package/dist/lib/copyTextToClipboard.cjs.map +1 -0
- package/dist/lib/copyTextToClipboard.d.cts +4 -0
- package/dist/lib/copyTextToClipboard.d.mts +5 -0
- package/dist/lib/copyTextToClipboard.mjs +33 -0
- package/dist/lib/copyTextToClipboard.mjs.map +1 -0
- package/dist/lib/datePickerHelper.cjs +9 -3541
- package/dist/lib/datePickerHelper.cjs.map +1 -1
- package/dist/lib/datePickerHelper.mjs +3 -3537
- package/dist/lib/datePickerHelper.mjs.map +1 -1
- package/dist/lib/message.cjs +12 -0
- package/dist/lib/message.cjs.map +1 -0
- package/dist/lib/message.d.cts +2 -0
- package/dist/lib/message.d.mts +2 -0
- package/dist/lib/message.mjs +11 -0
- package/dist/lib/message.mjs.map +1 -0
- package/dist/lib/pseudoClass.cjs +0 -1
- package/dist/lib/pseudoClass.cjs.map +1 -1
- package/dist/lib/pseudoClass.d.mts +1 -1
- package/dist/lib/reorderItems.cjs +0 -1
- package/dist/lib/reorderItems.cjs.map +1 -1
- package/dist/lib/selectHelper.cjs +4 -4
- package/dist/lib/selectHelper.cjs.map +1 -1
- package/dist/lib/selectHelper.mjs +1 -1
- package/dist/lib/useControlled.cjs +1 -1
- package/dist/lib/useIsOverflow.cjs +1 -1
- package/dist/lib/useOutsideClick.cjs +1 -1
- package/dist/lib/useScrollOverflow.cjs +61 -0
- package/dist/lib/useScrollOverflow.cjs.map +1 -0
- package/dist/lib/useScrollOverflow.d.cts +36 -0
- package/dist/lib/useScrollOverflow.d.mts +36 -0
- package/dist/lib/useScrollOverflow.mjs +59 -0
- package/dist/lib/useScrollOverflow.mjs.map +1 -0
- package/dist/lib/zindex.cjs +0 -1
- package/dist/lib/zindex.cjs.map +1 -1
- package/dist/message-BfJ87aIU.d.mts +9 -0
- package/dist/message-C2286H-r.d.cts +9 -0
- package/dist/middleTruncateText.d.mts +13 -0
- package/dist/mixins/focus.cjs +1 -1
- package/dist/mixins/focus.cjs.map +1 -1
- package/dist/mixins/focus.d.mts +1 -1
- package/dist/mixins/focus.mjs.map +1 -1
- package/dist/mixins/hoverable.cjs +1 -1
- package/dist/mixins/hoverable.d.mts +2 -2
- package/dist/mixins/input.cjs +1 -1
- package/dist/mixins/input.cjs.map +1 -1
- package/dist/mixins/input.d.cts +1 -1
- package/dist/mixins/input.d.mts +1 -1
- package/dist/mixins/input.mjs.map +1 -1
- package/dist/mixins/menuItem.cjs +1 -1
- package/dist/mixins/menuItem.cjs.map +1 -1
- package/dist/mixins/menuItem.d.mts +2 -2
- package/dist/mixins/menuItem.mjs.map +1 -1
- package/dist/mixins/print/index.cjs +1 -1
- package/dist/mixins/text.cjs +1 -1
- package/dist/mixins/text.cjs.map +1 -1
- package/dist/mixins/text.d.mts +1 -1
- package/dist/mixins/text.mjs.map +1 -1
- package/dist/positioning.d.mts +11 -0
- package/dist/tableBoxKeyboardNavigation.d.mts +8 -0
- package/dist/{text-BrSUs-88.d.mts → text-CtoDqqAO.d.mts} +1 -1
- package/dist/{theme-DGAqgnUa.d.mts → theme-Bx2sn3Lt.d.mts} +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/types-B34lbI2k.d.mts +25 -0
- package/dist/types-C_AUGurs.d.cts +25 -0
- package/dist/types-CuCT-YnX.d.cts +10 -0
- package/dist/types-DTak9UTv.d.mts +10 -0
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types2.d.cts +2 -0
- package/dist/types2.d.mts +2 -0
- package/dist/useColumnWidthLock.d.mts +28 -0
- package/dist/useDelayedInlineEditError.d.mts +12 -0
- package/dist/{useFormField-DN3gpEEV.cjs → useFormField-B98dmreO.cjs} +3 -3
- package/dist/{useFormField-DN3gpEEV.cjs.map → useFormField-B98dmreO.cjs.map} +1 -1
- package/dist/{useFormField-BmtItl8y.d.mts → useFormField-BE0rTBF1.d.mts} +2 -2
- package/dist/{useFormField-Ba0CQ43u.d.cts → useFormField-CaIdE7JQ.d.cts} +2 -2
- package/dist/useFormField.d.cts +1 -1
- package/dist/useFormField.d.mts +1 -1
- package/dist/{useFormGroup-B_mFNoN9.cjs → useFormGroup-BE7v9eAj.cjs} +2 -2
- package/dist/{useFormGroup-B_mFNoN9.cjs.map → useFormGroup-BE7v9eAj.cjs.map} +1 -1
- package/dist/useTableBoxDragAndDrop--QBq2FQh.d.cts +69 -0
- package/dist/useTableBoxDragAndDrop-BTtv9PEt.d.mts +69 -0
- package/dist/useTableBoxDragAndDrop.d.cts +2 -0
- package/dist/useTableBoxDragAndDrop.d.mts +2 -0
- package/dist/useTableColumns.d.cts +72 -0
- package/dist/useTableColumns.d.mts +72 -0
- package/dist/{useToggle-0zLL1E7s.mjs → useToggle-3k3EkV8V.mjs} +1 -1
- package/dist/{useToggle-0zLL1E7s.mjs.map → useToggle-3k3EkV8V.mjs.map} +1 -1
- package/dist/{useToggle-DNrEsTpr.cjs → useToggle-CSkZWXtQ.cjs} +2 -2
- package/dist/{useToggle-DNrEsTpr.cjs.map → useToggle-CSkZWXtQ.cjs.map} +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/{utilities-C8Jf-xpi.d.cts → utilities-DqO6Sh94.d.cts} +1 -1
- package/dist/{utilities-w1K54IAy.d.mts → utilities-SMbDe8oK.d.mts} +1 -1
- package/dist/utilities.d.cts +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utils/storybook.cjs +2 -3
- package/dist/utils/storybook.cjs.map +1 -1
- package/dist/utils/storybook.mjs +1 -2
- package/dist/utils/storybook.mjs.map +1 -1
- package/dist/utils/testing.cjs +5 -5
- package/dist/utils/testing.cjs.map +1 -1
- package/dist/utils/testing.d.cts +5 -357
- package/dist/utils/testing.d.mts +4 -356
- package/dist/utils/testing.mjs +2 -2
- package/dist/utils/testing.mjs.map +1 -1
- package/dist/utils.d.mts +9 -0
- package/dist/variables/color.cjs +0 -1
- package/dist/variables/color.cjs.map +1 -1
- package/dist/variables/effect.cjs +1 -1
- package/dist/variables/keyframes.cjs +1 -1
- package/dist/variables/spacing.cjs +1 -2
- package/dist/variables/spacing.cjs.map +1 -1
- package/dist/variables/spacing.d.cts +1 -1
- package/dist/variables/spacing.d.mts +1 -1
- package/dist/variables/spacing.mjs +1 -1
- package/dist/variables/spacing.mjs.map +1 -1
- package/dist/variables/text.cjs +0 -1
- package/dist/variables/text.cjs.map +1 -1
- package/dist/variables/transitions.cjs +0 -1
- package/dist/variables/transitions.cjs.map +1 -1
- package/package.json +135 -90
- package/dist/Combobox-B_-swcix.mjs.map +0 -1
- package/dist/Combobox-B_oe33Re.cjs.map +0 -1
- package/dist/DateField-Bwe_0qm9.d.cts +0 -24
- package/dist/DateField-Chko9oLb.d.mts +0 -24
- package/dist/ListBox-Z1y0LG1H.mjs.map +0 -1
- package/dist/RegisterComponent-BDb43KvI.d.mts +0 -34
- package/dist/RegisterComponent-CpXIR-51.d.cts +0 -34
- package/dist/Slider-D3gz7otf.d.mts +0 -56
- package/dist/Slider-uH5MOu2D.d.cts +0 -56
- package/dist/SliderRHF-Cc-9RuPe.d.cts +0 -984
- package/dist/SliderRHF-DIV-tCEv.d.mts +0 -984
- package/dist/Spinner-C05An_fn.mjs.map +0 -1
- package/dist/Spinner-z7DrPE1d.cjs.map +0 -1
- package/dist/Stack-BHb3ZB2A.cjs.map +0 -1
- package/dist/Stack-hwgS2FU1.mjs.map +0 -1
- package/dist/TabBar-BMv8dAS3.cjs.map +0 -1
- package/dist/TabBar-Bf89XksH.mjs.map +0 -1
- package/dist/chunk-Bpcn9VDT.mjs +0 -39
- package/dist/components/ConfigFormGroup/index.cjs.map +0 -1
- package/dist/components/ConfigFormGroup/index.mjs.map +0 -1
- package/dist/components/Pagination/index.cjs.map +0 -1
- package/dist/components/Pagination/index.mjs.map +0 -1
- package/dist/components/Pii/index.cjs.map +0 -1
- package/dist/components/Pii/index.mjs.map +0 -1
- package/dist/components/Table/index.cjs.map +0 -1
- package/dist/components/Table/index.mjs.map +0 -1
- package/dist/ids-Cr-NW2RJ.d.mts +0 -11
- package/dist/ids-e4V5Y3Ub.d.cts +0 -11
- package/dist/index-8R9vlM2B.d.mts +0 -83
- package/dist/index-BM1DqNZf.d.cts +0 -628
- package/dist/index-CExuKKOI.d.cts +0 -218
- package/dist/index-CKu60b9I.d.mts +0 -154
- package/dist/index-DQvVmqvS.d.mts +0 -628
- package/dist/lib/register/RegisterComponent.cjs +0 -91
- package/dist/lib/register/RegisterComponent.cjs.map +0 -1
- package/dist/lib/register/RegisterComponent.d.cts +0 -2
- package/dist/lib/register/RegisterComponent.d.mts +0 -2
- package/dist/lib/register/RegisterComponent.mjs +0 -88
- package/dist/lib/register/RegisterComponent.mjs.map +0 -1
- package/dist/lib/register/ids.cjs +0 -31
- package/dist/lib/register/ids.cjs.map +0 -1
- package/dist/lib/register/ids.d.cts +0 -2
- package/dist/lib/register/ids.d.mts +0 -2
- package/dist/lib/register/ids.mjs +0 -28
- package/dist/lib/register/ids.mjs.map +0 -1
- package/dist/lib/register/index.cjs +0 -8
- package/dist/lib/register/index.d.cts +0 -4
- package/dist/lib/register/index.d.mts +0 -4
- package/dist/lib/register/index.mjs +0 -3
- package/dist/lib/register/types.cjs +0 -1
- package/dist/lib/register/types.d.cts +0 -2
- package/dist/lib/register/types.d.mts +0 -2
- package/dist/mergeRefs-BZinWopc.cjs +0 -31
- package/dist/mergeRefs-BZinWopc.cjs.map +0 -1
- package/dist/mergeRefs-BgcbK0Qy.mjs +0 -26
- package/dist/mergeRefs-BgcbK0Qy.mjs.map +0 -1
- package/dist/motion-DoikasqZ.mjs +0 -7483
- package/dist/motion-DoikasqZ.mjs.map +0 -1
- package/dist/motion-QW6imSxE.cjs +0 -7488
- package/dist/motion-QW6imSxE.cjs.map +0 -1
- package/dist/react.esm-C-es35jP.cjs +0 -11441
- package/dist/react.esm-C-es35jP.cjs.map +0 -1
- package/dist/react.esm-Dv1lMDRs.mjs +0 -11397
- package/dist/react.esm-Dv1lMDRs.mjs.map +0 -1
- package/dist/types-DzHQ5MGm.d.mts +0 -69
- package/dist/types-N-cXznfM.d.cts +0 -69
- package/dist/useLabel-BcbghpIU.cjs +0 -1465
- package/dist/useLabel-BcbghpIU.cjs.map +0 -1
- package/dist/useLabel-DHGzNIKw.mjs +0 -1212
- package/dist/useLabel-DHGzNIKw.mjs.map +0 -1
- /package/dist/{lib/register/types.mjs → components/DataTable/types.cjs} +0 -0
- /package/dist/{index-1-AkepUA.d.mts → index-8SLBz2NH.d.mts} +0 -0
- /package/dist/{index-7in8TPrM.d.mts → index-B5cbLMbC2.d.cts} +0 -0
- /package/dist/{index-BBDa5smF.d.cts → index-BCsiC0tv.d.cts} +0 -0
- /package/dist/{index-BJ8-FA6N.d.cts → index-BR1oNnaF.d.cts} +0 -0
- /package/dist/{index-BUYyA1Xh.d.cts → index-BSVhZrWN.d.mts} +0 -0
- /package/dist/{index-CCt0lwyI.d.mts → index-BTImeehL2.d.mts} +0 -0
- /package/dist/{index-CEDY7cmG.d.cts → index-C0NRIDsj2.d.cts} +0 -0
- /package/dist/{index-CIABef8t.d.mts → index-C3kE54DD.d.mts} +0 -0
- /package/dist/{index-CIBxlpQo.d.mts → index-C6yvNuzO.d.cts} +0 -0
- /package/dist/{index-CP2eJYlK.d.mts → index-C8k_zgEm.d.cts} +0 -0
- /package/dist/{index-CRo77wc3.d.mts → index-CROz1VSV.d.mts} +0 -0
- /package/dist/{index-CiBIKhMu.d.cts → index-CWt1yJ75.d.cts} +0 -0
- /package/dist/{index-Cii4Qb1X.d.mts → index-CmCelmEL.d.cts} +0 -0
- /package/dist/{index-CspKFJM1.d.cts → index-CmUzJ4E-2.d.cts} +0 -0
- /package/dist/{index-D26lpgQi.d.cts → index-CtCMUyZA.d.cts} +0 -0
- /package/dist/{index-D4DUvwPf.d.mts → index-D5tSVhTd.d.mts} +0 -0
- /package/dist/{index-D4ELpJXS.d.cts → index-D8dPsry7.d.mts} +0 -0
- /package/dist/{index-D6CnpA_r.d.cts → index-DeEmP3Jc.d.cts} +0 -0
- /package/dist/{index-DLoAMD9J.d.cts → index-DeVKzGce.d.mts} +0 -0
- /package/dist/{index-DWfPppPU.d.mts → index-DrZ2Dh-H.d.cts} +0 -0
- /package/dist/{index-DcU87nuJ2.d.cts → index-DxSM7VXJ.d.cts} +0 -0
- /package/dist/{index-DkrC-i1D.d.mts → index-FtE8MXJ_.d.mts} +0 -0
- /package/dist/{index-DvuJXuAN.d.mts → index-JuxZj_Qp2.d.mts} +0 -0
- /package/dist/{index-OEBbnNdr.d.mts → index-LhFpnU-f.d.mts} +0 -0
- /package/dist/{index-QbUkWSLh.d.mts → index-N-OgGgfF.d.mts} +0 -0
- /package/dist/{index-VmEFGBxN.d.cts → index-NKYLt_R9.d.mts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HoverCopyableField-B_WNB7Qp.cjs","names":["Spacing","Button","fadeIn","Card","useToggle","Popover","CopyIcon","Paragraph"],"sources":["../components/HoverCopyableField/HoverCopyableField.tsx","../components/HoverCopyableField/index.ts"],"sourcesContent":["import type { MouseEvent, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { CopyIcon } from '@persona/icons';\nimport Button from 'design-system/components/Button';\nimport Card from 'design-system/components/Card';\nimport Popover from 'design-system/components/Popover';\nimport { Paragraph } from 'design-system/components/Text';\nimport useToggle from 'design-system/lib/useToggle';\nimport { fadeIn } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst copyToClipboard = async (text: string): Promise<boolean> => {\n try {\n if ('clipboard' in navigator) {\n await navigator.clipboard.writeText(text);\n return true;\n } else {\n return document.execCommand('copy', true, text);\n }\n } catch {\n return false;\n }\n};\n\nconst CopyableFieldContainer = styled.div`\n display: flex;\n gap: ${Spacing[1]};\n align-items: center;\n`;\n\nconst CopyButton = styled(Button).attrs(() => ({\n type: 'button',\n variant: 'inverse',\n width: 'icon',\n}))<{ isActive: boolean }>`\n height: ${Spacing[5]};\n width: ${Spacing[5]};\n visibility: ${({ isActive }) => (isActive ? 'visible' : 'hidden')};\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n svg {\n width: 14px;\n height: 14px;\n }\n`;\n\nconst StyledCard = styled(Card)`\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n padding: 6px;\n margin: 0;\n`;\n\ninterface HoverCopyableFieldProps {\n copyValue: string | undefined;\n confirmationText?: string;\n children: ReactNode;\n}\n\nconst HoverCopyableField = ({\n copyValue,\n confirmationText = 'Copied',\n children,\n}: HoverCopyableFieldProps) => {\n const [copyButtonActive, { enable: showCopyButton, disable: hideCopyButton }] = useToggle(false);\n const [confirmationActive, { enable: showConfirmation, disable: hideConfirmation }] =\n useToggle(false);\n\n const copyTextToClipboard = async () => {\n if (copyValue == null) {\n return;\n }\n const copyWasSuccessful = await copyToClipboard(copyValue);\n\n if (copyWasSuccessful) {\n showConfirmation();\n setTimeout(() => {\n hideCopyButton();\n hideConfirmation();\n }, 1200);\n }\n };\n\n const copyField = (e: MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n e.stopPropagation();\n copyTextToClipboard();\n };\n\n return copyValue != null && copyValue.trim().length > 0 ? (\n <CopyableFieldContainer onMouseEnter={showCopyButton} onMouseLeave={hideCopyButton}>\n {children}\n <Popover open={confirmationActive}>\n <Popover.Anchor asChild>\n <CopyButton\n id='hover-copyable-field__copy-button'\n isActive={copyButtonActive || confirmationActive}\n onClick={copyField}\n >\n <CopyIcon width={16} height={16} />\n </CopyButton>\n </Popover.Anchor>\n <Popover.Content side='top' align='center' style={{ zIndex: 2 }}>\n <StyledCard elevated>\n <Paragraph>{confirmationText}</Paragraph>\n </StyledCard>\n </Popover.Content>\n </Popover>\n </CopyableFieldContainer>\n ) : null;\n};\n\nexport default HoverCopyableField;\n","import Ho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AAD;EAAwB,cAAc;EAAgB,cAAc;YAApE,CACG,UACD,iBAAA,GAAA,kBAAA,MAACC,gBAAAA,iBAAD;GAAS,MAAM;aAAf,CACE,iBAAA,GAAA,kBAAA,KAACA,gBAAAA,gBAAQ,QAAT;IAAgB,SAAA;cACd,iBAAA,GAAA,kBAAA,KAAC,YAAD;KACE,IAAG;KACH,UAAU,oBAAoB;KAC9B,SAAS;eAET,iBAAA,GAAA,kBAAA,KAACC,eAAAA,UAAD;MAAU,OAAO;MAAI,QAAQ;MAAM,CAAA;KACxB,CAAA;IACE,CAAA,EACjB,iBAAA,GAAA,kBAAA,KAACD,gBAAAA,gBAAQ,SAAT;IAAiB,MAAK;IAAM,OAAM;IAAS,OAAO,EAAE,QAAQ,GAAG;cAC7D,iBAAA,GAAA,kBAAA,KAAC,YAAD;KAAY,UAAA;eACV,iBAAA,GAAA,kBAAA,KAACE,aAAAA,WAAD,EAAA,UAAY,kBAA6B,CAAA;KAC9B,CAAA;IACG,CAAA,CACV;KACa;MACvB;;;;AC/GN,IAAA,6BAAe"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import "./variables/transitions.mjs";
|
|
2
|
+
import { t as Card_default } from "./Card-CLTkZLKr.mjs";
|
|
3
|
+
import { i as Paragraph } from "./Text-hEoPeOc9.mjs";
|
|
4
|
+
import { t as useToggle } from "./useToggle-3k3EkV8V.mjs";
|
|
5
|
+
import { fadeIn } from "./variables/keyframes.mjs";
|
|
6
|
+
import { n as Button } from "./IconButton-DC4rh6ow.mjs";
|
|
7
|
+
import { s as Popover_default } from "./Popover-D0QY5f-J.mjs";
|
|
8
|
+
import { Spacing } from "@persona/design-tokens";
|
|
9
|
+
import styled from "styled-components";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { CopyIcon } from "@persona/icons";
|
|
12
|
+
//#region components/HoverCopyableField/HoverCopyableField.tsx
|
|
13
|
+
const copyToClipboard = async (text) => {
|
|
14
|
+
try {
|
|
15
|
+
if ("clipboard" in navigator) {
|
|
16
|
+
await navigator.clipboard.writeText(text);
|
|
17
|
+
return true;
|
|
18
|
+
} else return document.execCommand("copy", true, text);
|
|
19
|
+
} catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const CopyableFieldContainer = styled.div`
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: ${Spacing[1]};
|
|
26
|
+
align-items: center;
|
|
27
|
+
`;
|
|
28
|
+
const CopyButton = styled(Button).attrs(() => ({
|
|
29
|
+
type: "button",
|
|
30
|
+
variant: "inverse",
|
|
31
|
+
width: "icon"
|
|
32
|
+
}))`
|
|
33
|
+
height: ${Spacing[5]};
|
|
34
|
+
width: ${Spacing[5]};
|
|
35
|
+
visibility: ${({ isActive }) => isActive ? "visible" : "hidden"};
|
|
36
|
+
animation: ${fadeIn} ${"400ms"} ease-in-out;
|
|
37
|
+
svg {
|
|
38
|
+
width: 14px;
|
|
39
|
+
height: 14px;
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
const StyledCard = styled(Card_default)`
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
border-radius: 4px;
|
|
47
|
+
animation: ${fadeIn} ${"400ms"} ease-in-out;
|
|
48
|
+
padding: 6px;
|
|
49
|
+
margin: 0;
|
|
50
|
+
`;
|
|
51
|
+
const HoverCopyableField = ({ copyValue, confirmationText = "Copied", children }) => {
|
|
52
|
+
const [copyButtonActive, { enable: showCopyButton, disable: hideCopyButton }] = useToggle(false);
|
|
53
|
+
const [confirmationActive, { enable: showConfirmation, disable: hideConfirmation }] = useToggle(false);
|
|
54
|
+
const copyTextToClipboard = async () => {
|
|
55
|
+
if (copyValue == null) return;
|
|
56
|
+
if (await copyToClipboard(copyValue)) {
|
|
57
|
+
showConfirmation();
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
hideCopyButton();
|
|
60
|
+
hideConfirmation();
|
|
61
|
+
}, 1200);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const copyField = (e) => {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
copyTextToClipboard();
|
|
68
|
+
};
|
|
69
|
+
return copyValue != null && copyValue.trim().length > 0 ? /* @__PURE__ */ jsxs(CopyableFieldContainer, {
|
|
70
|
+
onMouseEnter: showCopyButton,
|
|
71
|
+
onMouseLeave: hideCopyButton,
|
|
72
|
+
children: [children, /* @__PURE__ */ jsxs(Popover_default, {
|
|
73
|
+
open: confirmationActive,
|
|
74
|
+
children: [/* @__PURE__ */ jsx(Popover_default.Anchor, {
|
|
75
|
+
asChild: true,
|
|
76
|
+
children: /* @__PURE__ */ jsx(CopyButton, {
|
|
77
|
+
id: "hover-copyable-field__copy-button",
|
|
78
|
+
isActive: copyButtonActive || confirmationActive,
|
|
79
|
+
onClick: copyField,
|
|
80
|
+
children: /* @__PURE__ */ jsx(CopyIcon, {
|
|
81
|
+
width: 16,
|
|
82
|
+
height: 16
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
}), /* @__PURE__ */ jsx(Popover_default.Content, {
|
|
86
|
+
side: "top",
|
|
87
|
+
align: "center",
|
|
88
|
+
style: { zIndex: 2 },
|
|
89
|
+
children: /* @__PURE__ */ jsx(StyledCard, {
|
|
90
|
+
elevated: true,
|
|
91
|
+
children: /* @__PURE__ */ jsx(Paragraph, { children: confirmationText })
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
})]
|
|
95
|
+
}) : null;
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region components/HoverCopyableField/index.ts
|
|
99
|
+
var HoverCopyableField_default = HoverCopyableField;
|
|
100
|
+
//#endregion
|
|
101
|
+
export { HoverCopyableField_default as t };
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=HoverCopyableField-DR575ayC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HoverCopyableField-DR575ayC.mjs","names":["Card","Popover"],"sources":["../components/HoverCopyableField/HoverCopyableField.tsx","../components/HoverCopyableField/index.ts"],"sourcesContent":["import type { MouseEvent, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { CopyIcon } from '@persona/icons';\nimport Button from 'design-system/components/Button';\nimport Card from 'design-system/components/Card';\nimport Popover from 'design-system/components/Popover';\nimport { Paragraph } from 'design-system/components/Text';\nimport useToggle from 'design-system/lib/useToggle';\nimport { fadeIn } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst copyToClipboard = async (text: string): Promise<boolean> => {\n try {\n if ('clipboard' in navigator) {\n await navigator.clipboard.writeText(text);\n return true;\n } else {\n return document.execCommand('copy', true, text);\n }\n } catch {\n return false;\n }\n};\n\nconst CopyableFieldContainer = styled.div`\n display: flex;\n gap: ${Spacing[1]};\n align-items: center;\n`;\n\nconst CopyButton = styled(Button).attrs(() => ({\n type: 'button',\n variant: 'inverse',\n width: 'icon',\n}))<{ isActive: boolean }>`\n height: ${Spacing[5]};\n width: ${Spacing[5]};\n visibility: ${({ isActive }) => (isActive ? 'visible' : 'hidden')};\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n svg {\n width: 14px;\n height: 14px;\n }\n`;\n\nconst StyledCard = styled(Card)`\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n padding: 6px;\n margin: 0;\n`;\n\ninterface HoverCopyableFieldProps {\n copyValue: string | undefined;\n confirmationText?: string;\n children: ReactNode;\n}\n\nconst HoverCopyableField = ({\n copyValue,\n confirmationText = 'Copied',\n children,\n}: HoverCopyableFieldProps) => {\n const [copyButtonActive, { enable: showCopyButton, disable: hideCopyButton }] = useToggle(false);\n const [confirmationActive, { enable: showConfirmation, disable: hideConfirmation }] =\n useToggle(false);\n\n const copyTextToClipboard = async () => {\n if (copyValue == null) {\n return;\n }\n const copyWasSuccessful = await copyToClipboard(copyValue);\n\n if (copyWasSuccessful) {\n showConfirmation();\n setTimeout(() => {\n hideCopyButton();\n hideConfirmation();\n }, 1200);\n }\n };\n\n const copyField = (e: MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n e.stopPropagation();\n copyTextToClipboard();\n };\n\n return copyValue != null && copyValue.trim().length > 0 ? (\n <CopyableFieldContainer onMouseEnter={showCopyButton} onMouseLeave={hideCopyButton}>\n {children}\n <Popover open={confirmationActive}>\n <Popover.Anchor asChild>\n <CopyButton\n id='hover-copyable-field__copy-button'\n isActive={copyButtonActive || confirmationActive}\n onClick={copyField}\n >\n <CopyIcon width={16} height={16} />\n </CopyButton>\n </Popover.Anchor>\n <Popover.Content side='top' align='center' style={{ zIndex: 2 }}>\n <StyledCard elevated>\n <Paragraph>{confirmationText}</Paragraph>\n </StyledCard>\n </Popover.Content>\n </Popover>\n </CopyableFieldContainer>\n ) : null;\n};\n\nexport default HoverCopyableField;\n","import HoverCopyableField from './HoverCopyableField';\n\nexport default HoverCopyableField;\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,kBAAkB,OAAO,SAAmC;AAChE,KAAI;AACF,MAAI,eAAe,WAAW;AAC5B,SAAM,UAAU,UAAU,UAAU,KAAK;AACzC,UAAO;QAEP,QAAO,SAAS,YAAY,QAAQ,MAAM,KAAK;SAE3C;AACN,SAAO;;;AAIX,MAAM,yBAAyB,OAAO,GAAG;;SAEhC,QAAQ,GAAG;;;AAIpB,MAAM,aAAa,OAAO,OAAO,CAAC,aAAa;CAC7C,MAAM;CACN,SAAS;CACT,OAAO;CACR,EAAE;YACS,QAAQ,GAAG;WACZ,QAAQ,GAAG;iBACL,EAAE,eAAgB,WAAW,YAAY,SAAU;eACrD,OAAO,GAAA,QAA6B;;;;;;AAOnD,MAAM,aAAa,OAAOA,aAAK;;;;;eAKhB,OAAO,GAAA,QAA6B;;;;AAWnD,MAAM,sBAAsB,EAC1B,WACA,mBAAmB,UACnB,eAC6B;CAC7B,MAAM,CAAC,kBAAkB,EAAE,QAAQ,gBAAgB,SAAS,oBAAoB,UAAU,MAAM;CAChG,MAAM,CAAC,oBAAoB,EAAE,QAAQ,kBAAkB,SAAS,sBAC9D,UAAU,MAAM;CAElB,MAAM,sBAAsB,YAAY;AACtC,MAAI,aAAa,KACf;AAIF,MAAI,MAF4B,gBAAgB,UAAU,EAEnC;AACrB,qBAAkB;AAClB,oBAAiB;AACf,oBAAgB;AAChB,sBAAkB;MACjB,KAAK;;;CAIZ,MAAM,aAAa,MAAqC;AACtD,IAAE,gBAAgB;AAClB,IAAE,iBAAiB;AACnB,uBAAqB;;AAGvB,QAAO,aAAa,QAAQ,UAAU,MAAM,CAAC,SAAS,IACpD,qBAAC,wBAAD;EAAwB,cAAc;EAAgB,cAAc;YAApE,CACG,UACD,qBAACC,iBAAD;GAAS,MAAM;aAAf,CACE,oBAACA,gBAAQ,QAAT;IAAgB,SAAA;cACd,oBAAC,YAAD;KACE,IAAG;KACH,UAAU,oBAAoB;KAC9B,SAAS;eAET,oBAAC,UAAD;MAAU,OAAO;MAAI,QAAQ;MAAM,CAAA;KACxB,CAAA;IACE,CAAA,EACjB,oBAACA,gBAAQ,SAAT;IAAiB,MAAK;IAAM,OAAM;IAAS,OAAO,EAAE,QAAQ,GAAG;cAC7D,oBAAC,YAAD;KAAY,UAAA;eACV,oBAAC,WAAD,EAAA,UAAY,kBAA6B,CAAA;KAC9B,CAAA;IACG,CAAA,CACV;KACa;MACvB;;;;AC/GN,IAAA,6BAAe"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime.js";
|
|
3
|
+
|
|
4
|
+
//#region components/HoverCopyableField/HoverCopyableField.d.ts
|
|
5
|
+
interface HoverCopyableFieldProps {
|
|
6
|
+
copyValue: string | undefined;
|
|
7
|
+
confirmationText?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const HoverCopyableField: ({
|
|
11
|
+
copyValue,
|
|
12
|
+
confirmationText,
|
|
13
|
+
children
|
|
14
|
+
}: HoverCopyableFieldProps) => _$react_jsx_runtime0.JSX.Element | null;
|
|
15
|
+
export = HoverCopyableField;
|
|
16
|
+
//# sourceMappingURL=HoverCopyableField.d.cts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region components/HoverCopyableField/HoverCopyableField.d.ts
|
|
5
|
+
interface HoverCopyableFieldProps {
|
|
6
|
+
copyValue: string | undefined;
|
|
7
|
+
confirmationText?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const HoverCopyableField: ({
|
|
11
|
+
copyValue,
|
|
12
|
+
confirmationText,
|
|
13
|
+
children
|
|
14
|
+
}: HoverCopyableFieldProps) => _$react_jsx_runtime0.JSX.Element | null;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { HoverCopyableField as default };
|
|
17
|
+
//# sourceMappingURL=HoverCopyableField.d.mts.map
|
|
@@ -3,14 +3,14 @@ import { focusOutlineControlled } from "./mixins/focus.mjs";
|
|
|
3
3
|
import "./variables/transitions.mjs";
|
|
4
4
|
import { printMixins } from "./mixins/print/index.mjs";
|
|
5
5
|
import { paragraphMixins } from "./mixins/text.mjs";
|
|
6
|
-
import { t as useToggle } from "./useToggle-
|
|
6
|
+
import { t as useToggle } from "./useToggle-3k3EkV8V.mjs";
|
|
7
7
|
import { rotate } from "./variables/keyframes.mjs";
|
|
8
8
|
import { BorderRadius, Color, Spacing } from "@persona/design-tokens";
|
|
9
9
|
import styled, { css } from "styled-components";
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { forwardRef, useCallback } from "react";
|
|
12
|
-
import {
|
|
11
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
12
|
import { LoaderIcon } from "@persona/icons";
|
|
13
|
+
import { Link } from "react-router-dom";
|
|
14
14
|
import { isEmpty, isFunction } from "lodash/fp.js";
|
|
15
15
|
//#region components/Button/Button.tsx
|
|
16
16
|
const noop = () => void 0;
|
|
@@ -284,7 +284,7 @@ const Button = forwardRef(function Button({ id, children, prefixIcon, suffixIcon
|
|
|
284
284
|
}), /* @__PURE__ */ jsxs(ButtonChildren, {
|
|
285
285
|
isPending: loading,
|
|
286
286
|
children: [
|
|
287
|
-
prefixIcon != null && /* @__PURE__ */ jsxs(Fragment, { children: [prefixIconType === "basic" && /* @__PURE__ */ jsx(PrefixIconContainer, { children: prefixIcon }), prefixIconType === "inherit" && /* @__PURE__ */ jsx(InheritPrefixIconContainer, { children: prefixIcon })] }),
|
|
287
|
+
prefixIcon != null && /* @__PURE__ */ jsxs(Fragment$1, { children: [prefixIconType === "basic" && /* @__PURE__ */ jsx(PrefixIconContainer, { children: prefixIcon }), prefixIconType === "inherit" && /* @__PURE__ */ jsx(InheritPrefixIconContainer, { children: prefixIcon })] }),
|
|
288
288
|
children && /* @__PURE__ */ jsx(ButtonText, {
|
|
289
289
|
width,
|
|
290
290
|
size,
|
|
@@ -338,4 +338,4 @@ const IconButton = forwardRef(function IconButton({ size = "xs", ...props }, ref
|
|
|
338
338
|
//#endregion
|
|
339
339
|
export { SuffixIconContainer as a, StyledButton as i, Button as n, ButtonChildren as r, IconButton as t };
|
|
340
340
|
|
|
341
|
-
//# sourceMappingURL=IconButton-
|
|
341
|
+
//# sourceMappingURL=IconButton-DC4rh6ow.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton-C28qxOdi.mjs","names":[],"sources":["../components/Button/Button.tsx","../components/Button/IconButton.tsx"],"sourcesContent":["import { Color, Spacing } from '@persona/design-tokens';\nimport { LoaderIcon } from '@persona/icons';\nimport { isEmpty, isFunction } from 'lodash/fp';\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type MouseEvent,\n type ReactNode,\n type Ref,\n useCallback,\n} from 'react';\nimport { Link, type LinkProps } from 'react-router-dom';\nimport styled, {\n css,\n type DefaultTheme,\n type FlattenInterpolation,\n type ThemeProps,\n} from 'styled-components';\n\nimport { isDisabled, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport useToggle from 'design-system/lib/useToggle';\nimport { focusOutlineControlled } from 'design-system/mixins/focus';\nimport { printMixins } from 'design-system/mixins/print';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\nimport { rotate } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst noop = (): void => undefined;\n\n// TODO(joseph): Bring this fix back to pseudoClass\nconst isActive = ({ active }: PseudoClassProps) => (active ? '' : ':active:enabled');\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst sizeStyles: Record<ButtonProps['size'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n md: css`\n ${paragraphMixins.md}\n height: ${({ theme }) => theme.button.height.md};\n padding: ${Spacing[2]};\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n sm: css`\n ${paragraphMixins.sm}\n height: ${({ theme }) => theme.button.height.sm};\n padding: ${Spacing[1]} 6px;\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n};\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst widthStyles: Record<ButtonProps['width'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n full: css`\n width: 100%;\n `,\n auto: css`\n width: auto;\n `,\n // TODO: rename this prop to 'element' as a standard unresponsive element width\n button: css`\n width: ${({ theme }) => theme.element.width.md};\n `,\n icon: css<ButtonProps>`\n width: ${({ theme, size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.button.height[size];\n }};\n padding: 0;\n flex: none;\n `,\n};\n\ninterface ButtonPropsWithTransientProps extends Omit<ButtonProps, 'isPending'> {\n $isPending: boolean;\n $onSecondaryBackground?: boolean;\n}\n\nexport const StyledButton = styled.button.attrs<ButtonPropsWithTransientProps>(({ to, target }) => {\n if (isEmpty(to)) {\n return 'button';\n } else if (typeof to === 'string' && to.startsWith('https://')) {\n return {\n as: 'a',\n href: to,\n target: target ?? '_blank',\n rel: 'noreferrer',\n };\n } else {\n return {\n as: Link,\n };\n }\n})<ButtonPropsWithTransientProps>`\n cursor: pointer;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n ${({ theme, variant }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const palette = theme.color.variants[variant] as any;\n return css`\n &:disabled {\n background-color: ${palette.disabled};\n color: ${palette.textDisabled};\n svg path {\n stroke: ${palette.textDisabled};\n }\n\n /* For backwards compatibility with current coloring scheme (targeting stroke property) */\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n /* Support icons with stroke */\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n user-select: none;\n }\n `;\n }}\n\n ${({ variant }) =>\n variant === 'outline' &&\n css`\n border: 1px solid ${({ theme }) => theme.color.border.input};\n `}\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* To properly position loading spinner */\n position: relative;\n\n border-radius: ${({ theme }) => theme.button.borderRadius};\n\n transition-duration: ${TransitionDuration.Fast};\n transition-property: background-color, color, border-color, width, height;\n\n ${({ size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return sizeStyles[size];\n }}\n ${({ width }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return widthStyles[width];\n }}\n\n /* Variant styling */\n ${({ theme, variant, $isPending, $onSecondaryBackground }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n let palette = theme.color.variants[variant] as any;\n\n if (variant === 'basic' && $onSecondaryBackground) {\n palette = {\n ...palette,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n default: Color.CoreSlate300,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n hover: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n active: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n disabled: Color.CoreSlate100,\n };\n }\n\n return css`\n background-color: ${palette.default};\n color: ${palette.text};\n svg path {\n stroke: ${palette.text};\n }\n\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n &${isHovered}${isNotDisabled} {\n background-color: ${palette.hover};\n }\n\n &${isDisabled} {\n cursor: not-allowed;\n }\n\n &${isActive} {\n background-color: ${palette.active};\n }\n\n ${focusOutlineControlled}\n\n ${\n $isPending &&\n css`\n cursor: default;\n background-color: ${palette.active};\n &:disabled {\n background-color: ${({ theme }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.color.variants[variant].active;\n }};\n user-select: none;\n }\n\n svg path {\n stroke: ${palette.highlightDark};\n }\n\n // For backwards compatibility with current coloring scheme (targeting stroke property)\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n `\n }\n `;\n }}\n\n\n ${printMixins.hide}\n`;\n\ntype WithPendingProps = Pick<ButtonProps, 'isPending'>;\n\nconst LoaderContainer = styled.div<WithPendingProps>`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 2s;\n opacity: ${({ isPending }) => (isPending ? '1' : '0')};\n`;\n\nconst Loader = styled(LoaderIcon)`\n animation: ${rotate} linear 1s infinite;\n`;\n\nexport const ButtonChildren = styled('div').attrs(({ isPending }: WithPendingProps) => ({\n ['aria-hidden']: isPending,\n}))<WithPendingProps>`\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: center;\n transition: opacity ${TransitionDuration.Fast};\n opacity: ${({ isPending }) => (isPending ? '0' : '1')};\n gap: ${Spacing[1]};\n`;\n\nconst PrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst InheritPrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n\n & svg {\n width: inherit;\n height: inherit;\n }\n`;\n\nexport const SuffixIconContainer = styled(PrefixIconContainer)`\n margin-right: 0;\n flex-grow: 1;\n justify-content: flex-end;\n`;\n\nconst ButtonText = styled.span<{ size: 'md' | 'sm'; width: 'full' | 'auto' | 'button' | 'icon' }>`\n position: relative;\n\n /* Needed to align for browsers that don't support text-box yet\n (which at this time, is firefox, and opera, and a few niche browsers)\n This checks firefox. Otherwise, it will default back to the original\n which is a slightly misaligned button\n */\n\n /* Was trying to use this with @supports not, but genuinely could not figure out why this wouldn't\n work */\n\n line-height: ${({ width }) => (width === 'icon' ? '0' : 'inherit')};\n @-moz-document url-prefix() {\n top: ${({ size }) => (size === 'md' ? '1px' : '0.5px')};\n }\n\n @supports (text-box: cap alphabetic) {\n text-box: ${({ width }) => (width === 'icon' ? 'normal' : 'cap alphabetic')};\n }\n`;\n\ntype MaybePromise =\n | ((e: MouseEvent<HTMLButtonElement>) => void)\n | ((e: MouseEvent<HTMLButtonElement>) => Promise<void>);\n\nexport interface ButtonProps\n extends ComponentPropsWithoutRef<'button'>, Omit<PseudoClassProps, 'checked'> {\n /**\n * Visual style of the button.\n *\n * - `primary` – filled brand colour, for the primary action on a surface.\n * - `basic` – subtle grey fill, for secondary actions.\n * - `outline` – transparent with a border, alternative secondary style.\n * - `text` – no background or border, for tertiary / inline actions.\n * - `inverse` – inverted fill for use on dark/coloured backgrounds.\n * - `danger` – red fill, for destructive actions.\n *\n * @defaultValue 'primary'\n */\n variant?: 'basic' | 'primary' | 'inverse' | 'danger' | 'text' | 'outline';\n /**\n * Shows a loading spinner and disables the button. Also triggers automatically\n * when `onClick` returns a Promise, clearing once the promise settles.\n */\n isPending?: boolean;\n /**\n * Icon rendered to the left of the button label.\n * Import from `@persona-id/icons`.\n */\n prefixIcon?: ReactNode;\n /**\n * Controls how the prefix icon inherits sizing.\n *\n * - `basic` – icon is rendered inside a fixed-size container.\n * - `inherit` – icon stretches to fill the surrounding element's dimensions.\n *\n * @defaultValue 'basic'\n */\n prefixIconType?: 'basic' | 'inherit';\n\n /**\n * Icon rendered to the right of the button label.\n * Import from `@persona-id/icons`.\n */\n suffixIcon?: ReactNode;\n\n /**\n * Height and typography scale of the button.\n *\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n\n /**\n * Changes the button into a link.\n * Pass a relative path to use `react-router-dom` `<Link>`, or an absolute\n * `https://` URL to render an `<a>` tag that opens in a new tab.\n */\n to?: LinkProps['to'];\n\n /**\n * Overrides the target of the link if `to` is provided and is an external link.\n */\n target?: LinkProps['target'];\n\n /**\n * Note: we may want to default this to 'button' in the future, but many instances of this Button component\n * in dashboard currently rely on the default 'submit' behavior that occurs when using this in redux-form\n * so we'll have to comb through and manually add the type='submit' prop.\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Controls the width of the button.\n *\n * - `full` – stretches to fill its container (`width: 100%`).\n * - `auto` – shrinks to fit its content.\n * - `button` – a fixed medium element width (from design tokens).\n * - `icon` – square, sized to match the button height; use for icon-only buttons.\n *\n * @defaultValue 'full'\n */\n width?: 'full' | 'auto' | 'button' | 'icon';\n onClick?: MaybePromise;\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * In some cases we render a button on a secondary background, which needs an adjustment\n * for certain variants.\n */\n onSecondaryBackground?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n id,\n children,\n prefixIcon,\n suffixIcon,\n disabled,\n isPending,\n type = 'button',\n prefixIconType = 'basic',\n variant = 'primary',\n size = 'md',\n width = 'full',\n onClick,\n onSecondaryBackground,\n ...props\n }: ButtonProps,\n ref,\n) {\n const [isResolving, { enable, disable }] = useToggle(false);\n const innerOnClick: MaybePromise = isFunction(onClick) ? onClick : noop;\n const loading = isPending || isResolving;\n\n const handleClick = useCallback(\n async (e: MouseEvent<HTMLButtonElement>) => {\n if (loading) {\n return;\n }\n\n const maybePromise = innerOnClick(e);\n\n if (maybePromise instanceof Promise) {\n enable();\n await maybePromise;\n disable();\n }\n },\n [loading, innerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n type={type}\n data-test={'button__' + variant}\n variant={variant}\n size={size}\n width={width}\n disabled={disabled || loading}\n $isPending={loading}\n $onSecondaryBackground={onSecondaryBackground}\n {...props}\n onClick={handleClick}\n ref={ref}\n >\n {loading && (\n <LoaderContainer isPending={loading}>\n <Loader aria-label={`Loading ${props['aria-label'] || ''}`} />\n </LoaderContainer>\n )}\n <ButtonChildren isPending={loading}>\n {prefixIcon != null && (\n <>\n {prefixIconType === 'basic' && <PrefixIconContainer>{prefixIcon}</PrefixIconContainer>}\n {prefixIconType === 'inherit' && (\n <InheritPrefixIconContainer>{prefixIcon}</InheritPrefixIconContainer>\n )}\n </>\n )}\n {children && (\n <ButtonText width={width} size={size}>\n {children}\n </ButtonText>\n )}\n {suffixIcon != null && <SuffixIconContainer>{suffixIcon}</SuffixIconContainer>}\n </ButtonChildren>\n </StyledButton>\n );\n});\n\nexport default Button;\n","import { BorderRadius } from '@persona/design-tokens';\nimport { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Button, { type ButtonProps } from './Button';\n\nconst BUTTON_SIZE_MAP = {\n xs: '16px',\n sm: '24px',\n md: '32px',\n};\n\nconst ICON_SIZE_MAP = {\n xs: '12px',\n sm: '16px',\n md: '16px',\n};\n\ntype IconBtnSize = keyof typeof BUTTON_SIZE_MAP;\n\nconst IconBtn = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n border-radius: ${BorderRadius.Md};\n\n ${({ size }) => css`\n height: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n width: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n\n svg {\n width: ${ICON_SIZE_MAP[size as IconBtnSize]};\n height: ${ICON_SIZE_MAP[size as IconBtnSize]};\n }\n `}\n`;\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'width' | 'prefixIcon' | 'prefixIconType' | 'suffixIcon' | 'variant' | 'size'\n> {\n /**\n * `xs` - 16px. `sm` - 24px. `md` - 32px.\n * Pair with a PDS icon in the prescribed size.\n */\n size?: IconBtnSize;\n}\n\n/**\n * Use to render icon-only buttons. Ensure buttons have proper aria properties.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { size = 'xs', ...props },\n ref,\n) {\n return <IconBtn size={size as ButtonProps['size']} ref={ref} {...props} />;\n});\n\nexport default IconButton;\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAM,aAAmB,KAAA;AAGzB,MAAM,YAAY,EAAE,aAAgC,SAAS,KAAK;AAGlE,MAAM,aAA0F;CAC9F,IAAI,GAAG;MACH,gBAAgB,GAAG;eACV,EAAE,YAAY,MAAM,OAAO,OAAO,GAAG;eACrC,QAAQ,GAAG;;;;;;CAMxB,IAAI,GAAG;MACH,gBAAgB,GAAG;eACV,EAAE,YAAY,MAAM,OAAO,OAAO,GAAG;eACrC,QAAQ,GAAG;;;;;;CAMzB;AAGD,MAAM,cAA4F;CAChG,MAAM,GAAG;;;CAGT,MAAM,GAAG;;;CAIT,QAAQ,GAAG;cACC,EAAE,YAAY,MAAM,QAAQ,MAAM,GAAG;;CAEjD,MAAM,GAAgB;cACV,EAAE,OAAO,WAAW;AAE5B,SAAO,MAAM,OAAO,OAAO;GAC3B;;;;CAIL;AAOD,MAAa,eAAe,OAAO,OAAO,OAAsC,EAAE,IAAI,aAAa;AACjG,KAAI,QAAQ,GAAG,CACb,QAAO;UACE,OAAO,OAAO,YAAY,GAAG,WAAW,WAAW,CAC5D,QAAO;EACL,IAAI;EACJ,MAAM;EACN,QAAQ,UAAU;EAClB,KAAK;EACN;KAED,QAAO,EACL,IAAI,MACL;EAEH;;;;;KAKG,EAAE,OAAO,cAAc;CAExB,MAAM,UAAU,M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B,YAAwC,CAAA,CAEtE,EAAA,CAAA;IAEJ,YACC,oBAAC,YAAD;KAAmB;KAAa;KAC7B;KACU,CAAA;IAEd,cAAc,QAAQ,oBAAC,qBAAD,EAAA,UAAsB,YAAiC,CAAA;IAC/D;KACJ;;EAEjB;;;ACheF,MAAM,kBAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,MAAM,gBAAgB;CACpB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAID,MAAM,UAAU,OAAO,OAAO,CAAC,MAAM;CACnC,OAAO;CACP,SAAS;CACV,CAAC;;;mBAGiB,aAAa,GAAG;;KAE9B,EAAE,WAAW,GAAG;cACP,gBAAgB,MAAqB;aACtC,gBAAgB,MAAqB;;;eAGnC,cAAc,MAAqB;gBAClC,cAAc,MAAqB;;IAE/C;;;;;AAiBJ,MAAM,aAAa,WAA+C,SAAS,WACzE,EAAE,OAAO,MAAM,GAAG,SAClB,KACA;AACA,QAAO,oBAAC,SAAD;EAAe;EAAkC;EAAK,GAAI;EAAS,CAAA;EAC1E"}
|
|
1
|
+
{"version":3,"file":"IconButton-DC4rh6ow.mjs","names":[],"sources":["../components/Button/Button.tsx","../components/Button/IconButton.tsx"],"sourcesContent":["import { isEmpty, isFunction } from 'lodash/fp';\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type MouseEvent,\n type ReactNode,\n type Ref,\n useCallback,\n} from 'react';\nimport { Link, type LinkProps } from 'react-router-dom';\nimport styled, {\n css,\n type DefaultTheme,\n type FlattenInterpolation,\n type ThemeProps,\n} from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { LoaderIcon } from '@persona/icons';\nimport { isDisabled, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport useToggle from 'design-system/lib/useToggle';\nimport { focusOutlineControlled } from 'design-system/mixins/focus';\nimport { printMixins } from 'design-system/mixins/print';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\nimport { rotate } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst noop = (): void => undefined;\n\n// TODO(joseph): Bring this fix back to pseudoClass\nconst isActive = ({ active }: PseudoClassProps) => (active ? '' : ':active:enabled');\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst sizeStyles: Record<ButtonProps['size'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n md: css`\n ${paragraphMixins.md}\n height: ${({ theme }) => theme.button.height.md};\n padding: ${Spacing[2]};\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n sm: css`\n ${paragraphMixins.sm}\n height: ${({ theme }) => theme.button.height.sm};\n padding: ${Spacing[1]} 6px;\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n};\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst widthStyles: Record<ButtonProps['width'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n full: css`\n width: 100%;\n `,\n auto: css`\n width: auto;\n `,\n // TODO: rename this prop to 'element' as a standard unresponsive element width\n button: css`\n width: ${({ theme }) => theme.element.width.md};\n `,\n icon: css<ButtonProps>`\n width: ${({ theme, size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.button.height[size];\n }};\n padding: 0;\n flex: none;\n `,\n};\n\ninterface ButtonPropsWithTransientProps extends Omit<ButtonProps, 'isPending'> {\n $isPending: boolean;\n $onSecondaryBackground?: boolean;\n}\n\nexport const StyledButton = styled.button.attrs<ButtonPropsWithTransientProps>(({ to, target }) => {\n if (isEmpty(to)) {\n return 'button';\n } else if (typeof to === 'string' && to.startsWith('https://')) {\n return {\n as: 'a',\n href: to,\n target: target ?? '_blank',\n rel: 'noreferrer',\n };\n } else {\n return {\n as: Link,\n };\n }\n})<ButtonPropsWithTransientProps>`\n cursor: pointer;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n ${({ theme, variant }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const palette = theme.color.variants[variant] as any;\n return css`\n &:disabled {\n background-color: ${palette.disabled};\n color: ${palette.textDisabled};\n svg path {\n stroke: ${palette.textDisabled};\n }\n\n /* For backwards compatibility with current coloring scheme (targeting stroke property) */\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n /* Support icons with stroke */\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n user-select: none;\n }\n `;\n }}\n\n ${({ variant }) =>\n variant === 'outline' &&\n css`\n border: 1px solid ${({ theme }) => theme.color.border.input};\n `}\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* To properly position loading spinner */\n position: relative;\n\n border-radius: ${({ theme }) => theme.button.borderRadius};\n\n transition-duration: ${TransitionDuration.Fast};\n transition-property: background-color, color, border-color, width, height;\n\n ${({ size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return sizeStyles[size];\n }}\n ${({ width }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return widthStyles[width];\n }}\n\n /* Variant styling */\n ${({ theme, variant, $isPending, $onSecondaryBackground }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n let palette = theme.color.variants[variant] as any;\n\n if (variant === 'basic' && $onSecondaryBackground) {\n palette = {\n ...palette,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n default: Color.CoreSlate300,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n hover: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n active: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n disabled: Color.CoreSlate100,\n };\n }\n\n return css`\n background-color: ${palette.default};\n color: ${palette.text};\n svg path {\n stroke: ${palette.text};\n }\n\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n &${isHovered}${isNotDisabled} {\n background-color: ${palette.hover};\n }\n\n &${isDisabled} {\n cursor: not-allowed;\n }\n\n &${isActive} {\n background-color: ${palette.active};\n }\n\n ${focusOutlineControlled}\n\n ${\n $isPending &&\n css`\n cursor: default;\n background-color: ${palette.active};\n &:disabled {\n background-color: ${({ theme }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.color.variants[variant].active;\n }};\n user-select: none;\n }\n\n svg path {\n stroke: ${palette.highlightDark};\n }\n\n // For backwards compatibility with current coloring scheme (targeting stroke property)\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n `\n }\n `;\n }}\n\n\n ${printMixins.hide}\n`;\n\ntype WithPendingProps = Pick<ButtonProps, 'isPending'>;\n\nconst LoaderContainer = styled.div<WithPendingProps>`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 2s;\n opacity: ${({ isPending }) => (isPending ? '1' : '0')};\n`;\n\nconst Loader = styled(LoaderIcon)`\n animation: ${rotate} linear 1s infinite;\n`;\n\nexport const ButtonChildren = styled('div').attrs(({ isPending }: WithPendingProps) => ({\n ['aria-hidden']: isPending,\n}))<WithPendingProps>`\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: center;\n transition: opacity ${TransitionDuration.Fast};\n opacity: ${({ isPending }) => (isPending ? '0' : '1')};\n gap: ${Spacing[1]};\n`;\n\nconst PrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst InheritPrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n\n & svg {\n width: inherit;\n height: inherit;\n }\n`;\n\nexport const SuffixIconContainer = styled(PrefixIconContainer)`\n margin-right: 0;\n flex-grow: 1;\n justify-content: flex-end;\n`;\n\nconst ButtonText = styled.span<{ size: 'md' | 'sm'; width: 'full' | 'auto' | 'button' | 'icon' }>`\n position: relative;\n\n /* Needed to align for browsers that don't support text-box yet\n (which at this time, is firefox, and opera, and a few niche browsers)\n This checks firefox. Otherwise, it will default back to the original\n which is a slightly misaligned button\n */\n\n /* Was trying to use this with @supports not, but genuinely could not figure out why this wouldn't\n work */\n\n line-height: ${({ width }) => (width === 'icon' ? '0' : 'inherit')};\n @-moz-document url-prefix() {\n top: ${({ size }) => (size === 'md' ? '1px' : '0.5px')};\n }\n\n @supports (text-box: cap alphabetic) {\n text-box: ${({ width }) => (width === 'icon' ? 'normal' : 'cap alphabetic')};\n }\n`;\n\ntype MaybePromise =\n | ((e: MouseEvent<HTMLButtonElement>) => void)\n | ((e: MouseEvent<HTMLButtonElement>) => Promise<void>);\n\nexport interface ButtonProps\n extends ComponentPropsWithoutRef<'button'>, Omit<PseudoClassProps, 'checked'> {\n /**\n * Visual style of the button.\n *\n * - `primary` – filled brand colour, for the primary action on a surface.\n * - `basic` – subtle grey fill, for secondary actions.\n * - `outline` – transparent with a border, alternative secondary style.\n * - `text` – no background or border, for tertiary / inline actions.\n * - `inverse` – inverted fill for use on dark/coloured backgrounds.\n * - `danger` – red fill, for destructive actions.\n *\n * @defaultValue 'primary'\n */\n variant?: 'basic' | 'primary' | 'inverse' | 'danger' | 'text' | 'outline';\n /**\n * Shows a loading spinner and disables the button. Also triggers automatically\n * when `onClick` returns a Promise, clearing once the promise settles.\n */\n isPending?: boolean;\n /**\n * Icon rendered to the left of the button label.\n * Import from `@persona-id/icons`.\n */\n prefixIcon?: ReactNode;\n /**\n * Controls how the prefix icon inherits sizing.\n *\n * - `basic` – icon is rendered inside a fixed-size container.\n * - `inherit` – icon stretches to fill the surrounding element's dimensions.\n *\n * @defaultValue 'basic'\n */\n prefixIconType?: 'basic' | 'inherit';\n\n /**\n * Icon rendered to the right of the button label.\n * Import from `@persona-id/icons`.\n */\n suffixIcon?: ReactNode;\n\n /**\n * Height and typography scale of the button.\n *\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n\n /**\n * Changes the button into a link.\n * Pass a relative path to use `react-router-dom` `<Link>`, or an absolute\n * `https://` URL to render an `<a>` tag that opens in a new tab.\n */\n to?: LinkProps['to'];\n\n /**\n * Overrides the target of the link if `to` is provided and is an external link.\n */\n target?: LinkProps['target'];\n\n /**\n * Note: we may want to default this to 'button' in the future, but many instances of this Button component\n * in dashboard currently rely on the default 'submit' behavior that occurs when using this in redux-form\n * so we'll have to comb through and manually add the type='submit' prop.\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Controls the width of the button.\n *\n * - `full` – stretches to fill its container (`width: 100%`).\n * - `auto` – shrinks to fit its content.\n * - `button` – a fixed medium element width (from design tokens).\n * - `icon` – square, sized to match the button height; use for icon-only buttons.\n *\n * @defaultValue 'full'\n */\n width?: 'full' | 'auto' | 'button' | 'icon';\n onClick?: MaybePromise;\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * In some cases we render a button on a secondary background, which needs an adjustment\n * for certain variants.\n */\n onSecondaryBackground?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n id,\n children,\n prefixIcon,\n suffixIcon,\n disabled,\n isPending,\n type = 'button',\n prefixIconType = 'basic',\n variant = 'primary',\n size = 'md',\n width = 'full',\n onClick,\n onSecondaryBackground,\n ...props\n }: ButtonProps,\n ref,\n) {\n const [isResolving, { enable, disable }] = useToggle(false);\n const innerOnClick: MaybePromise = isFunction(onClick) ? onClick : noop;\n const loading = isPending || isResolving;\n\n const handleClick = useCallback(\n async (e: MouseEvent<HTMLButtonElement>) => {\n if (loading) {\n return;\n }\n\n const maybePromise = innerOnClick(e);\n\n if (maybePromise instanceof Promise) {\n enable();\n await maybePromise;\n disable();\n }\n },\n [loading, innerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n type={type}\n data-test={'button__' + variant}\n variant={variant}\n size={size}\n width={width}\n disabled={disabled || loading}\n $isPending={loading}\n $onSecondaryBackground={onSecondaryBackground}\n {...props}\n onClick={handleClick}\n ref={ref}\n >\n {loading && (\n <LoaderContainer isPending={loading}>\n <Loader aria-label={`Loading ${props['aria-label'] || ''}`} />\n </LoaderContainer>\n )}\n <ButtonChildren isPending={loading}>\n {prefixIcon != null && (\n <>\n {prefixIconType === 'basic' && <PrefixIconContainer>{prefixIcon}</PrefixIconContainer>}\n {prefixIconType === 'inherit' && (\n <InheritPrefixIconContainer>{prefixIcon}</InheritPrefixIconContainer>\n )}\n </>\n )}\n {children && (\n <ButtonText width={width} size={size}>\n {children}\n </ButtonText>\n )}\n {suffixIcon != null && <SuffixIconContainer>{suffixIcon}</SuffixIconContainer>}\n </ButtonChildren>\n </StyledButton>\n );\n});\n\nexport default Button;\n","import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius } from '@persona/design-tokens';\n\nimport Button, { type ButtonProps } from './Button';\n\nconst BUTTON_SIZE_MAP = {\n xs: '16px',\n sm: '24px',\n md: '32px',\n};\n\nconst ICON_SIZE_MAP = {\n xs: '12px',\n sm: '16px',\n md: '16px',\n};\n\ntype IconBtnSize = keyof typeof BUTTON_SIZE_MAP;\n\nconst IconBtn = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n border-radius: ${BorderRadius.Md};\n\n ${({ size }) => css`\n height: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n width: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n\n svg {\n width: ${ICON_SIZE_MAP[size as IconBtnSize]};\n height: ${ICON_SIZE_MAP[size as IconBtnSize]};\n }\n `}\n`;\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'width' | 'prefixIcon' | 'prefixIconType' | 'suffixIcon' | 'variant' | 'size'\n> {\n /**\n * `xs` - 16px. `sm` - 24px. `md` - 32px.\n * Pair with a PDS icon in the prescribed size.\n */\n size?: IconBtnSize;\n}\n\n/**\n * Use to render icon-only buttons. Ensure buttons have proper aria properties.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { size = 'xs', ...props },\n ref,\n) {\n return <IconBtn size={size as ButtonProps['size']} ref={ref} {...props} />;\n});\n\nexport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GAAG;;KAE9B,EAAE,WAAW,GAAG;cACP,gBAAgB,MAAqB;aACtC,gBAAgB,MAAqB;;;eAGnC,cAAc,MAAqB;gBAClC,cAAc,MAAqB;;IAE/C;;;;;AAiBJ,MAAM,aAAa,WAA+C,SAAS,WACzE,EAAE,OAAO,MAAM,GAAG,SAClB,KACA;AACA,QAAO,oBAAC,SAAD;EAAe;EAAkC;EAAK,GAAI;EAAS,CAAA;EAC1E"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
1
|
+
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
2
2
|
const require_lib_pseudoClass = require("./lib/pseudoClass.cjs");
|
|
3
3
|
const require_mixins_focus = require("./mixins/focus.cjs");
|
|
4
4
|
require("./variables/transitions.cjs");
|
|
5
5
|
const require_mixins_print_index = require("./mixins/print/index.cjs");
|
|
6
6
|
const require_mixins_text = require("./mixins/text.cjs");
|
|
7
|
-
const require_useToggle = require("./useToggle-
|
|
7
|
+
const require_useToggle = require("./useToggle-CSkZWXtQ.cjs");
|
|
8
8
|
const require_variables_keyframes = require("./variables/keyframes.cjs");
|
|
9
9
|
let _persona_design_tokens = require("@persona/design-tokens");
|
|
10
10
|
let styled_components = require("styled-components");
|
|
11
11
|
styled_components = require_chunk.__toESM(styled_components);
|
|
12
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
12
|
let react = require("react");
|
|
14
|
-
let
|
|
13
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
15
14
|
let _persona_icons = require("@persona/icons");
|
|
15
|
+
let react_router_dom = require("react-router-dom");
|
|
16
16
|
let lodash_fp_js = require("lodash/fp.js");
|
|
17
17
|
//#region components/Button/Button.tsx
|
|
18
18
|
const noop = () => void 0;
|
|
@@ -369,4 +369,4 @@ Object.defineProperty(exports, "SuffixIconContainer", {
|
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
371
|
|
|
372
|
-
//# sourceMappingURL=IconButton-
|
|
372
|
+
//# sourceMappingURL=IconButton-DNy7g5zh.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton-B1ZL8BqW.cjs","names":["paragraphMixins","Spacing","Link","Color","isHovered","isNotDisabled","isDisabled","focusOutlineControlled","printMixins","LoaderIcon","rotate","useToggle","BorderRadius"],"sources":["../components/Button/Button.tsx","../components/Button/IconButton.tsx"],"sourcesContent":["import { Color, Spacing } from '@persona/design-tokens';\nimport { LoaderIcon } from '@persona/icons';\nimport { isEmpty, isFunction } from 'lodash/fp';\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type MouseEvent,\n type ReactNode,\n type Ref,\n useCallback,\n} from 'react';\nimport { Link, type LinkProps } from 'react-router-dom';\nimport styled, {\n css,\n type DefaultTheme,\n type FlattenInterpolation,\n type ThemeProps,\n} from 'styled-components';\n\nimport { isDisabled, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport useToggle from 'design-system/lib/useToggle';\nimport { focusOutlineControlled } from 'design-system/mixins/focus';\nimport { printMixins } from 'design-system/mixins/print';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\nimport { rotate } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst noop = (): void => undefined;\n\n// TODO(joseph): Bring this fix back to pseudoClass\nconst isActive = ({ active }: PseudoClassProps) => (active ? '' : ':active:enabled');\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst sizeStyles: Record<ButtonProps['size'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n md: css`\n ${paragraphMixins.md}\n height: ${({ theme }) => theme.button.height.md};\n padding: ${Spacing[2]};\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n sm: css`\n ${paragraphMixins.sm}\n height: ${({ theme }) => theme.button.height.sm};\n padding: ${Spacing[1]} 6px;\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n};\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst widthStyles: Record<ButtonProps['width'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n full: css`\n width: 100%;\n `,\n auto: css`\n width: auto;\n `,\n // TODO: rename this prop to 'element' as a standard unresponsive element width\n button: css`\n width: ${({ theme }) => theme.element.width.md};\n `,\n icon: css<ButtonProps>`\n width: ${({ theme, size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.button.height[size];\n }};\n padding: 0;\n flex: none;\n `,\n};\n\ninterface ButtonPropsWithTransientProps extends Omit<ButtonProps, 'isPending'> {\n $isPending: boolean;\n $onSecondaryBackground?: boolean;\n}\n\nexport const StyledButton = styled.button.attrs<ButtonPropsWithTransientProps>(({ to, target }) => {\n if (isEmpty(to)) {\n return 'button';\n } else if (typeof to === 'string' && to.startsWith('https://')) {\n return {\n as: 'a',\n href: to,\n target: target ?? '_blank',\n rel: 'noreferrer',\n };\n } else {\n return {\n as: Link,\n };\n }\n})<ButtonPropsWithTransientProps>`\n cursor: pointer;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n ${({ theme, variant }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const palette = theme.color.variants[variant] as any;\n return css`\n &:disabled {\n background-color: ${palette.disabled};\n color: ${palette.textDisabled};\n svg path {\n stroke: ${palette.textDisabled};\n }\n\n /* For backwards compatibility with current coloring scheme (targeting stroke property) */\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n /* Support icons with stroke */\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n user-select: none;\n }\n `;\n }}\n\n ${({ variant }) =>\n variant === 'outline' &&\n css`\n border: 1px solid ${({ theme }) => theme.color.border.input};\n `}\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* To properly position loading spinner */\n position: relative;\n\n border-radius: ${({ theme }) => theme.button.borderRadius};\n\n transition-duration: ${TransitionDuration.Fast};\n transition-property: background-color, color, border-color, width, height;\n\n ${({ size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return sizeStyles[size];\n }}\n ${({ width }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return widthStyles[width];\n }}\n\n /* Variant styling */\n ${({ theme, variant, $isPending, $onSecondaryBackground }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n let palette = theme.color.variants[variant] as any;\n\n if (variant === 'basic' && $onSecondaryBackground) {\n palette = {\n ...palette,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n default: Color.CoreSlate300,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n hover: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n active: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n disabled: Color.CoreSlate100,\n };\n }\n\n return css`\n background-color: ${palette.default};\n color: ${palette.text};\n svg path {\n stroke: ${palette.text};\n }\n\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n &${isHovered}${isNotDisabled} {\n background-color: ${palette.hover};\n }\n\n &${isDisabled} {\n cursor: not-allowed;\n }\n\n &${isActive} {\n background-color: ${palette.active};\n }\n\n ${focusOutlineControlled}\n\n ${\n $isPending &&\n css`\n cursor: default;\n background-color: ${palette.active};\n &:disabled {\n background-color: ${({ theme }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.color.variants[variant].active;\n }};\n user-select: none;\n }\n\n svg path {\n stroke: ${palette.highlightDark};\n }\n\n // For backwards compatibility with current coloring scheme (targeting stroke property)\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n `\n }\n `;\n }}\n\n\n ${printMixins.hide}\n`;\n\ntype WithPendingProps = Pick<ButtonProps, 'isPending'>;\n\nconst LoaderContainer = styled.div<WithPendingProps>`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 2s;\n opacity: ${({ isPending }) => (isPending ? '1' : '0')};\n`;\n\nconst Loader = styled(LoaderIcon)`\n animation: ${rotate} linear 1s infinite;\n`;\n\nexport const ButtonChildren = styled('div').attrs(({ isPending }: WithPendingProps) => ({\n ['aria-hidden']: isPending,\n}))<WithPendingProps>`\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: center;\n transition: opacity ${TransitionDuration.Fast};\n opacity: ${({ isPending }) => (isPending ? '0' : '1')};\n gap: ${Spacing[1]};\n`;\n\nconst PrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst InheritPrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n\n & svg {\n width: inherit;\n height: inherit;\n }\n`;\n\nexport const SuffixIconContainer = styled(PrefixIconContainer)`\n margin-right: 0;\n flex-grow: 1;\n justify-content: flex-end;\n`;\n\nconst ButtonText = styled.span<{ size: 'md' | 'sm'; width: 'full' | 'auto' | 'button' | 'icon' }>`\n position: relative;\n\n /* Needed to align for browsers that don't support text-box yet\n (which at this time, is firefox, and opera, and a few niche browsers)\n This checks firefox. Otherwise, it will default back to the original\n which is a slightly misaligned button\n */\n\n /* Was trying to use this with @supports not, but genuinely could not figure out why this wouldn't\n work */\n\n line-height: ${({ width }) => (width === 'icon' ? '0' : 'inherit')};\n @-moz-document url-prefix() {\n top: ${({ size }) => (size === 'md' ? '1px' : '0.5px')};\n }\n\n @supports (text-box: cap alphabetic) {\n text-box: ${({ width }) => (width === 'icon' ? 'normal' : 'cap alphabetic')};\n }\n`;\n\ntype MaybePromise =\n | ((e: MouseEvent<HTMLButtonElement>) => void)\n | ((e: MouseEvent<HTMLButtonElement>) => Promise<void>);\n\nexport interface ButtonProps\n extends ComponentPropsWithoutRef<'button'>, Omit<PseudoClassProps, 'checked'> {\n /**\n * Visual style of the button.\n *\n * - `primary` – filled brand colour, for the primary action on a surface.\n * - `basic` – subtle grey fill, for secondary actions.\n * - `outline` – transparent with a border, alternative secondary style.\n * - `text` – no background or border, for tertiary / inline actions.\n * - `inverse` – inverted fill for use on dark/coloured backgrounds.\n * - `danger` – red fill, for destructive actions.\n *\n * @defaultValue 'primary'\n */\n variant?: 'basic' | 'primary' | 'inverse' | 'danger' | 'text' | 'outline';\n /**\n * Shows a loading spinner and disables the button. Also triggers automatically\n * when `onClick` returns a Promise, clearing once the promise settles.\n */\n isPending?: boolean;\n /**\n * Icon rendered to the left of the button label.\n * Import from `@persona-id/icons`.\n */\n prefixIcon?: ReactNode;\n /**\n * Controls how the prefix icon inherits sizing.\n *\n * - `basic` – icon is rendered inside a fixed-size container.\n * - `inherit` – icon stretches to fill the surrounding element's dimensions.\n *\n * @defaultValue 'basic'\n */\n prefixIconType?: 'basic' | 'inherit';\n\n /**\n * Icon rendered to the right of the button label.\n * Import from `@persona-id/icons`.\n */\n suffixIcon?: ReactNode;\n\n /**\n * Height and typography scale of the button.\n *\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n\n /**\n * Changes the button into a link.\n * Pass a relative path to use `react-router-dom` `<Link>`, or an absolute\n * `https://` URL to render an `<a>` tag that opens in a new tab.\n */\n to?: LinkProps['to'];\n\n /**\n * Overrides the target of the link if `to` is provided and is an external link.\n */\n target?: LinkProps['target'];\n\n /**\n * Note: we may want to default this to 'button' in the future, but many instances of this Button component\n * in dashboard currently rely on the default 'submit' behavior that occurs when using this in redux-form\n * so we'll have to comb through and manually add the type='submit' prop.\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Controls the width of the button.\n *\n * - `full` – stretches to fill its container (`width: 100%`).\n * - `auto` – shrinks to fit its content.\n * - `button` – a fixed medium element width (from design tokens).\n * - `icon` – square, sized to match the button height; use for icon-only buttons.\n *\n * @defaultValue 'full'\n */\n width?: 'full' | 'auto' | 'button' | 'icon';\n onClick?: MaybePromise;\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * In some cases we render a button on a secondary background, which needs an adjustment\n * for certain variants.\n */\n onSecondaryBackground?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n id,\n children,\n prefixIcon,\n suffixIcon,\n disabled,\n isPending,\n type = 'button',\n prefixIconType = 'basic',\n variant = 'primary',\n size = 'md',\n width = 'full',\n onClick,\n onSecondaryBackground,\n ...props\n }: ButtonProps,\n ref,\n) {\n const [isResolving, { enable, disable }] = useToggle(false);\n const innerOnClick: MaybePromise = isFunction(onClick) ? onClick : noop;\n const loading = isPending || isResolving;\n\n const handleClick = useCallback(\n async (e: MouseEvent<HTMLButtonElement>) => {\n if (loading) {\n return;\n }\n\n const maybePromise = innerOnClick(e);\n\n if (maybePromise instanceof Promise) {\n enable();\n await maybePromise;\n disable();\n }\n },\n [loading, innerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n type={type}\n data-test={'button__' + variant}\n variant={variant}\n size={size}\n width={width}\n disabled={disabled || loading}\n $isPending={loading}\n $onSecondaryBackground={onSecondaryBackground}\n {...props}\n onClick={handleClick}\n ref={ref}\n >\n {loading && (\n <LoaderContainer isPending={loading}>\n <Loader aria-label={`Loading ${props['aria-label'] || ''}`} />\n </LoaderContainer>\n )}\n <ButtonChildren isPending={loading}>\n {prefixIcon != null && (\n <>\n {prefixIconType === 'basic' && <PrefixIconContainer>{prefixIcon}</PrefixIconContainer>}\n {prefixIconType === 'inherit' && (\n <InheritPrefixIconContainer>{prefixIcon}</InheritPrefixIconContainer>\n )}\n </>\n )}\n {children && (\n <ButtonText width={width} size={size}>\n {children}\n </ButtonText>\n )}\n {suffixIcon != null && <SuffixIconContainer>{suffixIcon}</SuffixIconContainer>}\n </ButtonChildren>\n </StyledButton>\n );\n});\n\nexport default Button;\n","import { BorderRadius } from '@persona/design-tokens';\nimport { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Button, { type ButtonProps } from './Button';\n\nconst BUTTON_SIZE_MAP = {\n xs: '16px',\n sm: '24px',\n md: '32px',\n};\n\nconst ICON_SIZE_MAP = {\n xs: '12px',\n sm: '16px',\n md: '16px',\n};\n\ntype IconBtnSize = keyof typeof BUTTON_SIZE_MAP;\n\nconst IconBtn = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n border-radius: ${BorderRadius.Md};\n\n ${({ size }) => css`\n height: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n width: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n\n svg {\n width: ${ICON_SIZE_MAP[size as IconBtnSize]};\n height: ${ICON_SIZE_MAP[size as IconBtnSize]};\n }\n `}\n`;\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'width' | 'prefixIcon' | 'prefixIconType' | 'suffixIcon' | 'variant' | 'size'\n> {\n /**\n * `xs` - 16px. `sm` - 24px. `md` - 32px.\n * Pair with a PDS icon in the prescribed size.\n */\n size?: IconBtnSize;\n}\n\n/**\n * Use to render icon-only buttons. Ensure buttons have proper aria properties.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { size = 'xs', ...props },\n ref,\n) {\n return <IconBtn size={size as ButtonProps['size']} ref={ref} {...props} />;\n});\n\nexport default IconButton;\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAM,aAAmB,KAAA;AAGzB,MAAM,YAAY,EAAE,aAAgC,SAAS,KAAK;AAGlE,MAAM,aAA0F;CAC9F,IAAI,kBAAA,GAAG;MACHA,oBAAAA,gBAAgB,GAAG;eACV,EAAE,YAAY,MAAM,OAAO,OAAO,GAAG;eACrCC,uBAAAA,QAAQ,GAAG;;;;;;CAMxB,IAAI,kBAAA,GAAG;MACHD,oBAAAA,gBAAgB,GAAG;eACV,EAAE,YAAY,MAAM,OAAO,OAAO,GAAG;eACrCC,uBAAAA,QAAQ,GAAG;;;;;;CAMzB;AAGD,MAAM,cAA4F;CAChG,MAAM,kBAAA,GAAG;;;CAGT,MAAM,kBAAA,GAAG;;;CAIT,QAAQ,kBAAA,GAAG;cACC,EA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A,SAAO,OAAO,CAAC,MAAM;CACnC,OAAO;CACP,SAAS;CACV,CAAC;;;mBAGiBC,uBAAAA,aAAa,GAAG;;KAE9B,EAAE,WAAW,kBAAA,GAAG;cACP,gBAAgB,MAAqB;aACtC,gBAAgB,MAAqB;;;eAGnC,cAAc,MAAqB;gBAClC,cAAc,MAAqB;;IAE/C;;;;;AAiBJ,MAAM,cAAA,GAAA,MAAA,YAA4D,SAAS,WACzE,EAAE,OAAO,MAAM,GAAG,SAClB,KACA;AACA,QAAO,iBAAA,GAAA,kBAAA,KAAC,SAAD;EAAe;EAAkC;EAAK,GAAI;EAAS,CAAA;EAC1E"}
|
|
1
|
+
{"version":3,"file":"IconButton-DNy7g5zh.cjs","names":["paragraphMixins","Spacing","Link","Color","isHovered","isNotDisabled","isDisabled","focusOutlineControlled","printMixins","LoaderIcon","rotate","useToggle","BorderRadius"],"sources":["../components/Button/Button.tsx","../components/Button/IconButton.tsx"],"sourcesContent":["import { isEmpty, isFunction } from 'lodash/fp';\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type MouseEvent,\n type ReactNode,\n type Ref,\n useCallback,\n} from 'react';\nimport { Link, type LinkProps } from 'react-router-dom';\nimport styled, {\n css,\n type DefaultTheme,\n type FlattenInterpolation,\n type ThemeProps,\n} from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { LoaderIcon } from '@persona/icons';\nimport { isDisabled, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport useToggle from 'design-system/lib/useToggle';\nimport { focusOutlineControlled } from 'design-system/mixins/focus';\nimport { printMixins } from 'design-system/mixins/print';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\nimport { rotate } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst noop = (): void => undefined;\n\n// TODO(joseph): Bring this fix back to pseudoClass\nconst isActive = ({ active }: PseudoClassProps) => (active ? '' : ':active:enabled');\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst sizeStyles: Record<ButtonProps['size'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n md: css`\n ${paragraphMixins.md}\n height: ${({ theme }) => theme.button.height.md};\n padding: ${Spacing[2]};\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n sm: css`\n ${paragraphMixins.sm}\n height: ${({ theme }) => theme.button.height.sm};\n padding: ${Spacing[1]} 6px;\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n};\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst widthStyles: Record<ButtonProps['width'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n full: css`\n width: 100%;\n `,\n auto: css`\n width: auto;\n `,\n // TODO: rename this prop to 'element' as a standard unresponsive element width\n button: css`\n width: ${({ theme }) => theme.element.width.md};\n `,\n icon: css<ButtonProps>`\n width: ${({ theme, size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.button.height[size];\n }};\n padding: 0;\n flex: none;\n `,\n};\n\ninterface ButtonPropsWithTransientProps extends Omit<ButtonProps, 'isPending'> {\n $isPending: boolean;\n $onSecondaryBackground?: boolean;\n}\n\nexport const StyledButton = styled.button.attrs<ButtonPropsWithTransientProps>(({ to, target }) => {\n if (isEmpty(to)) {\n return 'button';\n } else if (typeof to === 'string' && to.startsWith('https://')) {\n return {\n as: 'a',\n href: to,\n target: target ?? '_blank',\n rel: 'noreferrer',\n };\n } else {\n return {\n as: Link,\n };\n }\n})<ButtonPropsWithTransientProps>`\n cursor: pointer;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n ${({ theme, variant }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const palette = theme.color.variants[variant] as any;\n return css`\n &:disabled {\n background-color: ${palette.disabled};\n color: ${palette.textDisabled};\n svg path {\n stroke: ${palette.textDisabled};\n }\n\n /* For backwards compatibility with current coloring scheme (targeting stroke property) */\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n /* Support icons with stroke */\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n user-select: none;\n }\n `;\n }}\n\n ${({ variant }) =>\n variant === 'outline' &&\n css`\n border: 1px solid ${({ theme }) => theme.color.border.input};\n `}\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* To properly position loading spinner */\n position: relative;\n\n border-radius: ${({ theme }) => theme.button.borderRadius};\n\n transition-duration: ${TransitionDuration.Fast};\n transition-property: background-color, color, border-color, width, height;\n\n ${({ size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return sizeStyles[size];\n }}\n ${({ width }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return widthStyles[width];\n }}\n\n /* Variant styling */\n ${({ theme, variant, $isPending, $onSecondaryBackground }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n let palette = theme.color.variants[variant] as any;\n\n if (variant === 'basic' && $onSecondaryBackground) {\n palette = {\n ...palette,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n default: Color.CoreSlate300,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n hover: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n active: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n disabled: Color.CoreSlate100,\n };\n }\n\n return css`\n background-color: ${palette.default};\n color: ${palette.text};\n svg path {\n stroke: ${palette.text};\n }\n\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n &${isHovered}${isNotDisabled} {\n background-color: ${palette.hover};\n }\n\n &${isDisabled} {\n cursor: not-allowed;\n }\n\n &${isActive} {\n background-color: ${palette.active};\n }\n\n ${focusOutlineControlled}\n\n ${\n $isPending &&\n css`\n cursor: default;\n background-color: ${palette.active};\n &:disabled {\n background-color: ${({ theme }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.color.variants[variant].active;\n }};\n user-select: none;\n }\n\n svg path {\n stroke: ${palette.highlightDark};\n }\n\n // For backwards compatibility with current coloring scheme (targeting stroke property)\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n `\n }\n `;\n }}\n\n\n ${printMixins.hide}\n`;\n\ntype WithPendingProps = Pick<ButtonProps, 'isPending'>;\n\nconst LoaderContainer = styled.div<WithPendingProps>`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 2s;\n opacity: ${({ isPending }) => (isPending ? '1' : '0')};\n`;\n\nconst Loader = styled(LoaderIcon)`\n animation: ${rotate} linear 1s infinite;\n`;\n\nexport const ButtonChildren = styled('div').attrs(({ isPending }: WithPendingProps) => ({\n ['aria-hidden']: isPending,\n}))<WithPendingProps>`\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: center;\n transition: opacity ${TransitionDuration.Fast};\n opacity: ${({ isPending }) => (isPending ? '0' : '1')};\n gap: ${Spacing[1]};\n`;\n\nconst PrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst InheritPrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n\n & svg {\n width: inherit;\n height: inherit;\n }\n`;\n\nexport const SuffixIconContainer = styled(PrefixIconContainer)`\n margin-right: 0;\n flex-grow: 1;\n justify-content: flex-end;\n`;\n\nconst ButtonText = styled.span<{ size: 'md' | 'sm'; width: 'full' | 'auto' | 'button' | 'icon' }>`\n position: relative;\n\n /* Needed to align for browsers that don't support text-box yet\n (which at this time, is firefox, and opera, and a few niche browsers)\n This checks firefox. Otherwise, it will default back to the original\n which is a slightly misaligned button\n */\n\n /* Was trying to use this with @supports not, but genuinely could not figure out why this wouldn't\n work */\n\n line-height: ${({ width }) => (width === 'icon' ? '0' : 'inherit')};\n @-moz-document url-prefix() {\n top: ${({ size }) => (size === 'md' ? '1px' : '0.5px')};\n }\n\n @supports (text-box: cap alphabetic) {\n text-box: ${({ width }) => (width === 'icon' ? 'normal' : 'cap alphabetic')};\n }\n`;\n\ntype MaybePromise =\n | ((e: MouseEvent<HTMLButtonElement>) => void)\n | ((e: MouseEvent<HTMLButtonElement>) => Promise<void>);\n\nexport interface ButtonProps\n extends ComponentPropsWithoutRef<'button'>, Omit<PseudoClassProps, 'checked'> {\n /**\n * Visual style of the button.\n *\n * - `primary` – filled brand colour, for the primary action on a surface.\n * - `basic` – subtle grey fill, for secondary actions.\n * - `outline` – transparent with a border, alternative secondary style.\n * - `text` – no background or border, for tertiary / inline actions.\n * - `inverse` – inverted fill for use on dark/coloured backgrounds.\n * - `danger` – red fill, for destructive actions.\n *\n * @defaultValue 'primary'\n */\n variant?: 'basic' | 'primary' | 'inverse' | 'danger' | 'text' | 'outline';\n /**\n * Shows a loading spinner and disables the button. Also triggers automatically\n * when `onClick` returns a Promise, clearing once the promise settles.\n */\n isPending?: boolean;\n /**\n * Icon rendered to the left of the button label.\n * Import from `@persona-id/icons`.\n */\n prefixIcon?: ReactNode;\n /**\n * Controls how the prefix icon inherits sizing.\n *\n * - `basic` – icon is rendered inside a fixed-size container.\n * - `inherit` – icon stretches to fill the surrounding element's dimensions.\n *\n * @defaultValue 'basic'\n */\n prefixIconType?: 'basic' | 'inherit';\n\n /**\n * Icon rendered to the right of the button label.\n * Import from `@persona-id/icons`.\n */\n suffixIcon?: ReactNode;\n\n /**\n * Height and typography scale of the button.\n *\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n\n /**\n * Changes the button into a link.\n * Pass a relative path to use `react-router-dom` `<Link>`, or an absolute\n * `https://` URL to render an `<a>` tag that opens in a new tab.\n */\n to?: LinkProps['to'];\n\n /**\n * Overrides the target of the link if `to` is provided and is an external link.\n */\n target?: LinkProps['target'];\n\n /**\n * Note: we may want to default this to 'button' in the future, but many instances of this Button component\n * in dashboard currently rely on the default 'submit' behavior that occurs when using this in redux-form\n * so we'll have to comb through and manually add the type='submit' prop.\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Controls the width of the button.\n *\n * - `full` – stretches to fill its container (`width: 100%`).\n * - `auto` – shrinks to fit its content.\n * - `button` – a fixed medium element width (from design tokens).\n * - `icon` – square, sized to match the button height; use for icon-only buttons.\n *\n * @defaultValue 'full'\n */\n width?: 'full' | 'auto' | 'button' | 'icon';\n onClick?: MaybePromise;\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * In some cases we render a button on a secondary background, which needs an adjustment\n * for certain variants.\n */\n onSecondaryBackground?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n id,\n children,\n prefixIcon,\n suffixIcon,\n disabled,\n isPending,\n type = 'button',\n prefixIconType = 'basic',\n variant = 'primary',\n size = 'md',\n width = 'full',\n onClick,\n onSecondaryBackground,\n ...props\n }: ButtonProps,\n ref,\n) {\n const [isResolving, { enable, disable }] = useToggle(false);\n const innerOnClick: MaybePromise = isFunction(onClick) ? onClick : noop;\n const loading = isPending || isResolving;\n\n const handleClick = useCallback(\n async (e: MouseEvent<HTMLButtonElement>) => {\n if (loading) {\n return;\n }\n\n const maybePromise = innerOnClick(e);\n\n if (maybePromise instanceof Promise) {\n enable();\n await maybePromise;\n disable();\n }\n },\n [loading, innerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n type={type}\n data-test={'button__' + variant}\n variant={variant}\n size={size}\n width={width}\n disabled={disabled || loading}\n $isPending={loading}\n $onSecondaryBackground={onSecondaryBackground}\n {...props}\n onClick={handleClick}\n ref={ref}\n >\n {loading && (\n <LoaderContainer isPending={loading}>\n <Loader aria-label={`Loading ${props['aria-label'] || ''}`} />\n </LoaderContainer>\n )}\n <ButtonChildren isPending={loading}>\n {prefixIcon != null && (\n <>\n {prefixIconType === 'basic' && <PrefixIconContainer>{prefixIcon}</PrefixIconContainer>}\n {prefixIconType === 'inherit' && (\n <InheritPrefixIconContainer>{prefixIcon}</InheritPrefixIconContainer>\n )}\n </>\n )}\n {children && (\n <ButtonText width={width} size={size}>\n {children}\n </ButtonText>\n )}\n {suffixIcon != null && <SuffixIconContainer>{suffixIcon}</SuffixIconContainer>}\n </ButtonChildren>\n </StyledButton>\n );\n});\n\nexport default Button;\n","import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius } from '@persona/design-tokens';\n\nimport Button, { type ButtonProps } from './Button';\n\nconst BUTTON_SIZE_MAP = {\n xs: '16px',\n sm: '24px',\n md: '32px',\n};\n\nconst ICON_SIZE_MAP = {\n xs: '12px',\n sm: '16px',\n md: '16px',\n};\n\ntype IconBtnSize = keyof typeof BUTTON_SIZE_MAP;\n\nconst IconBtn = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n border-radius: ${BorderRadius.Md};\n\n ${({ size }) => css`\n height: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n width: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n\n svg {\n width: ${ICON_SIZE_MAP[size as IconBtnSize]};\n height: ${ICON_SIZE_MAP[size as IconBtnSize]};\n }\n `}\n`;\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'width' | 'prefixIcon' | 'prefixIconType' | 'suffixIcon' | 'variant' | 'size'\n> {\n /**\n * `xs` - 16px. `sm` - 24px. `md` - 32px.\n * Pair with a PDS icon in the prescribed size.\n */\n size?: IconBtnSize;\n}\n\n/**\n * Use to render icon-only buttons. Ensure buttons have proper aria properties.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { size = 'xs', ...props },\n ref,\n) {\n return <IconBtn size={size as ButtonProps['size']} ref={ref} {...props} />;\n});\n\nexport default IconButton;\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAM,aAAmB,KAAA;AAGzB,MAAM,YAAY,EAAE,aAAgC,SAAS,KAAK;AAGlE,MAAM,aAA0F;CAC9F,IAAI,kBAAA,GAAG;MACHA,oBAAAA,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A;IAEJ,YACC,iBAAA,GAAA,kBAAA,KAAC,YAAD;KAAmB;KAAa;KAC7B;KACU,CAAA;IAEd,cAAc,QAAQ,iBAAA,GAAA,kBAAA,KAAC,qBAAD,EAAA,UAAsB,YAAiC,CAAA;IAC/D;KACJ;;EAEjB;;;AC/dF,MAAM,kBAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,MAAM,gBAAgB;CACpB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAID,MAAM,UAAU,CAAA,GAAA,kBAAA,SAAO,OAAO,CAAC,MAAM;CACnC,OAAO;CACP,SAAS;CACV,CAAC;;;mBAGiBC,uBAAAA,aAAa,GAAG;;KAE9B,EAAE,WAAW,kBAAA,GAAG;cACP,gBAAgB,MAAqB;aACtC,gBAAgB,MAAqB;;;eAGnC,cAAc,MAAqB;gBAClC,cAAc,MAAqB;;IAE/C;;;;;AAiBJ,MAAM,cAAA,GAAA,MAAA,YAA4D,SAAS,WACzE,EAAE,OAAO,MAAM,GAAG,SAClB,KACA;AACA,QAAO,iBAAA,GAAA,kBAAA,KAAC,SAAD;EAAe;EAAkC;EAAK,GAAI;EAAS,CAAA;EAC1E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as ButtonProps } from "./Button-
|
|
1
|
+
import { r as ButtonProps } from "./Button-DXsYU5qU.mjs";
|
|
2
2
|
import * as _$react from "react";
|
|
3
3
|
|
|
4
4
|
//#region components/Button/IconButton.d.ts
|
|
@@ -21,4 +21,4 @@ interface IconButtonProps extends Omit<ButtonProps, 'width' | 'prefixIcon' | 'pr
|
|
|
21
21
|
declare const IconButton: _$react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & _$react.RefAttributes<HTMLButtonElement>>;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { IconButtonProps as n, IconButton as t };
|
|
24
|
-
//# sourceMappingURL=IconButton-
|
|
24
|
+
//# sourceMappingURL=IconButton-Dnnlf9uO.d.mts.map
|
package/dist/IconButton.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as IconButtonProps, t as IconButton } from "./IconButton-
|
|
1
|
+
import { n as IconButtonProps, t as IconButton } from "./IconButton-Dnnlf9uO.mjs";
|
|
2
2
|
export { IconButtonProps, IconButton as default };
|
package/dist/ImageTile.d.cts
CHANGED
package/dist/ImageTile.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as TextAction } from "./Action-
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { i as TextAction } from "./Action-DkNqzc2X.mjs";
|
|
3
2
|
import { ComponentPropsWithoutRef, MouseEvent, ReactNode } from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region components/ImageTile/ImageTile.d.ts
|
|
6
6
|
interface ImageTileProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { r as InlineEditConfig } from "./TableBoxCell-D1bjYv7b.mjs";
|
|
2
|
+
import { RefObject } from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/TableBox/InlineCombobox.d.ts
|
|
6
|
+
interface InlineComboboxProps {
|
|
7
|
+
/**
|
|
8
|
+
* The id of the item the cell belongs to
|
|
9
|
+
*/
|
|
10
|
+
itemId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Initial value for the cell
|
|
13
|
+
*/
|
|
14
|
+
value: string;
|
|
15
|
+
/**
|
|
16
|
+
* The column key this cell belongs to
|
|
17
|
+
*/
|
|
18
|
+
columnKey?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The inline edit configuration for this cell
|
|
21
|
+
*/
|
|
22
|
+
inlineEditConfig?: InlineEditConfig;
|
|
23
|
+
/**
|
|
24
|
+
* The content to display when not editing. If no children are passed, the value will be displayed.
|
|
25
|
+
*/
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Reference to the table row element. Used for full-width combobox dropdowns.
|
|
29
|
+
*/
|
|
30
|
+
rowRef?: RefObject<HTMLTableRowElement>;
|
|
31
|
+
/** Whether the closed display is preceded by an error icon. */
|
|
32
|
+
hasLeadingError?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const InlineCombobox: ({
|
|
35
|
+
itemId,
|
|
36
|
+
value,
|
|
37
|
+
columnKey,
|
|
38
|
+
inlineEditConfig,
|
|
39
|
+
children,
|
|
40
|
+
rowRef,
|
|
41
|
+
hasLeadingError
|
|
42
|
+
}: InlineComboboxProps) => _$react_jsx_runtime0.JSX.Element;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { InlineCombobox as default };
|
|
45
|
+
//# sourceMappingURL=InlineCombobox.d.mts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { r as InlineEditConfig } from "./TableBoxCell-D1bjYv7b.mjs";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region components/TableBox/InlineInput.d.ts
|
|
5
|
+
interface InlineInputProps {
|
|
6
|
+
/**
|
|
7
|
+
* The id of the item the cell belongs to
|
|
8
|
+
*/
|
|
9
|
+
itemId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Initial value for the cell
|
|
12
|
+
*/
|
|
13
|
+
value: string;
|
|
14
|
+
/**
|
|
15
|
+
* The column key this cell belongs to
|
|
16
|
+
*/
|
|
17
|
+
columnKey?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The inline edit configuration for this cell
|
|
20
|
+
*/
|
|
21
|
+
inlineEditConfig?: InlineEditConfig;
|
|
22
|
+
/** Notifies the cell that this inline editor committed or canceled. */
|
|
23
|
+
onEditingEnd?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* The content to display when not editing. If no children are passed, the value will be displayed.
|
|
26
|
+
*/
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
declare const InlineInput: ({
|
|
30
|
+
itemId,
|
|
31
|
+
value,
|
|
32
|
+
columnKey,
|
|
33
|
+
inlineEditConfig,
|
|
34
|
+
onEditingEnd,
|
|
35
|
+
children
|
|
36
|
+
}: InlineInputProps) => _$react_jsx_runtime0.JSX.Element;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { InlineInput as default };
|
|
39
|
+
//# sourceMappingURL=InlineInput.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as PseudoClassProps } from "./PseudoClassProps-
|
|
2
|
-
import { r as ButtonProps } from "./Button-
|
|
3
|
-
import { n as InputSizes, t as InputMixinProps } from "./input-
|
|
1
|
+
import { t as PseudoClassProps } from "./PseudoClassProps-ySXCGUEQ.mjs";
|
|
2
|
+
import { r as ButtonProps } from "./Button-DXsYU5qU.mjs";
|
|
3
|
+
import { n as InputSizes, t as InputMixinProps } from "./input-DrG6mA0V.mjs";
|
|
4
4
|
import * as _$styled_components0 from "styled-components";
|
|
5
5
|
import * as _$react from "react";
|
|
6
6
|
import { ComponentPropsWithoutRef, MouseEventHandler, ReactElement, ReactNode } from "react";
|
|
@@ -9,7 +9,7 @@ import { ComponentPropsWithoutRef, MouseEventHandler, ReactElement, ReactNode }
|
|
|
9
9
|
declare const ClearButton: _$styled_components0.StyledComponent<_$react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & _$react.RefAttributes<HTMLButtonElement>>, any, {
|
|
10
10
|
width: "icon";
|
|
11
11
|
variant: "basic";
|
|
12
|
-
} & PseudoClassProps, "
|
|
12
|
+
} & PseudoClassProps, "width" | "variant">;
|
|
13
13
|
interface StyledInputProps extends InputMixinProps {
|
|
14
14
|
$leftIcon?: ReactNode;
|
|
15
15
|
$hasRightItem?: boolean;
|
|
@@ -62,4 +62,4 @@ interface InputGroupProps extends ComponentPropsWithoutRef<'div'>, Omit<InputMix
|
|
|
62
62
|
declare const InputGroup: _$react.ForwardRefExoticComponent<InputGroupProps & _$react.RefAttributes<HTMLDivElement>>;
|
|
63
63
|
//#endregion
|
|
64
64
|
export { InputProps as a, InputGroupProps as i, Input as n, InputGroup as r, ClearButton as t };
|
|
65
|
-
//# sourceMappingURL=Input-
|
|
65
|
+
//# sourceMappingURL=Input-4KeYlOWM.d.mts.map
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
1
|
+
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
2
2
|
const require_lib_pseudoClass = require("./lib/pseudoClass.cjs");
|
|
3
3
|
const require_mixins_input = require("./mixins/input.cjs");
|
|
4
|
-
const require_Text = require("./Text-
|
|
5
|
-
const require_IconButton = require("./IconButton-
|
|
6
|
-
require("./
|
|
7
|
-
const require_useFormField = require("./useFormField-DN3gpEEV.cjs");
|
|
4
|
+
const require_Text = require("./Text-CzN0DOXV.cjs");
|
|
5
|
+
const require_IconButton = require("./IconButton-DNy7g5zh.cjs");
|
|
6
|
+
const require_useFormField = require("./useFormField-B98dmreO.cjs");
|
|
8
7
|
let _persona_design_tokens = require("@persona/design-tokens");
|
|
9
8
|
let styled_components = require("styled-components");
|
|
10
9
|
styled_components = require_chunk.__toESM(styled_components);
|
|
11
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
10
|
let react = require("react");
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
12
|
let _persona_icons = require("@persona/icons");
|
|
14
13
|
let _persona_icons_12px = require("@persona/icons/12px");
|
|
15
14
|
//#region components/Input/Input.tsx
|
|
@@ -207,4 +206,4 @@ Object.defineProperty(exports, "InputGroup", {
|
|
|
207
206
|
}
|
|
208
207
|
});
|
|
209
208
|
|
|
210
|
-
//# sourceMappingURL=Input-
|
|
209
|
+
//# sourceMappingURL=Input-BDLUq-pK.cjs.map
|