@techzyapp/ui-library 1.0.33 → 1.0.35
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/dist/{AdminRoot-CwUHa2us.js → AdminRoot-C_SNXQkB.js} +9 -9
- package/dist/{AdminRoot-CwUHa2us.js.map → AdminRoot-C_SNXQkB.js.map} +1 -1
- package/dist/{AdminRoot-cjP_Ad4r.cjs → AdminRoot-D97qDVTM.cjs} +2 -2
- package/dist/{AdminRoot-cjP_Ad4r.cjs.map → AdminRoot-D97qDVTM.cjs.map} +1 -1
- package/dist/{Alert-LJDrtkJy.js → Alert-BXtQFAVl.js} +3 -3
- package/dist/{Alert-LJDrtkJy.js.map → Alert-BXtQFAVl.js.map} +1 -1
- package/dist/{Alert-CfjDmLR8.cjs → Alert-CggrNMn5.cjs} +2 -2
- package/dist/{Alert-CfjDmLR8.cjs.map → Alert-CggrNMn5.cjs.map} +1 -1
- package/dist/{AuthLayout-m1BQ6Ixx.js → AuthLayout-C47vXKYp.js} +2 -2
- package/dist/{AuthLayout-m1BQ6Ixx.js.map → AuthLayout-C47vXKYp.js.map} +1 -1
- package/dist/{AuthLayout-DIcR__vo.cjs → AuthLayout-Cl3tb4-E.cjs} +2 -2
- package/dist/{AuthLayout-DIcR__vo.cjs.map → AuthLayout-Cl3tb4-E.cjs.map} +1 -1
- package/dist/{Breadcrumbs-COb2zmDk.cjs → Breadcrumbs-Cpa_LSY2.cjs} +2 -2
- package/dist/{Breadcrumbs-COb2zmDk.cjs.map → Breadcrumbs-Cpa_LSY2.cjs.map} +1 -1
- package/dist/{Breadcrumbs-DYeVrOns.js → Breadcrumbs-D_QnKw8q.js} +3 -3
- package/dist/{Breadcrumbs-DYeVrOns.js.map → Breadcrumbs-D_QnKw8q.js.map} +1 -1
- package/dist/{Button-PBZnkRNn.js → Button-BQ7jsm5P.js} +2 -2
- package/dist/{Button-PBZnkRNn.js.map → Button-BQ7jsm5P.js.map} +1 -1
- package/dist/{Button-BD5wpg-t.cjs → Button-Cm64ROip.cjs} +2 -2
- package/dist/{Button-BD5wpg-t.cjs.map → Button-Cm64ROip.cjs.map} +1 -1
- package/dist/{Calendar-Bb5Ekbpr.js → Calendar-BrpJOBTt.js} +3 -3
- package/dist/{Calendar-Bb5Ekbpr.js.map → Calendar-BrpJOBTt.js.map} +1 -1
- package/dist/{Calendar-842vjtdN.cjs → Calendar-C2x9ZtPV.cjs} +2 -2
- package/dist/{Calendar-842vjtdN.cjs.map → Calendar-C2x9ZtPV.cjs.map} +1 -1
- package/dist/{Card-CV_rHego.js → Card-kizK1B7N.js} +2 -2
- package/dist/{Card-CV_rHego.js.map → Card-kizK1B7N.js.map} +1 -1
- package/dist/{Card-DL7XnkOA.cjs → Card-yhly3Xdp.cjs} +2 -2
- package/dist/{Card-DL7XnkOA.cjs.map → Card-yhly3Xdp.cjs.map} +1 -1
- package/dist/{Chip-CLPIPC9a.cjs → Chip-BPcnO5WI.cjs} +2 -2
- package/dist/{Chip-CLPIPC9a.cjs.map → Chip-BPcnO5WI.cjs.map} +1 -1
- package/dist/{Chip-DdOUVF0Z.js → Chip-BzyzLEeX.js} +2 -2
- package/dist/{Chip-DdOUVF0Z.js.map → Chip-BzyzLEeX.js.map} +1 -1
- package/dist/{ChoiceCardGroup-BTbKjJdp.js → ChoiceCardGroup-BBD8ai4s.js} +2 -2
- package/dist/{ChoiceCardGroup-BTbKjJdp.js.map → ChoiceCardGroup-BBD8ai4s.js.map} +1 -1
- package/dist/{ChoiceCardGroup-Bg2jtFpe.cjs → ChoiceCardGroup-BWsG_Vh5.cjs} +2 -2
- package/dist/{ChoiceCardGroup-Bg2jtFpe.cjs.map → ChoiceCardGroup-BWsG_Vh5.cjs.map} +1 -1
- package/dist/{CodeBlock-B35NXZzd.js → CodeBlock-BTt40oh5.js} +3 -3
- package/dist/{CodeBlock-B35NXZzd.js.map → CodeBlock-BTt40oh5.js.map} +1 -1
- package/dist/{CodeBlock-C0dbyxcl.cjs → CodeBlock-BgSum_bB.cjs} +2 -2
- package/dist/{CodeBlock-C0dbyxcl.cjs.map → CodeBlock-BgSum_bB.cjs.map} +1 -1
- package/dist/{ColorPicker-6UraVYFy.js → ColorPicker-BNM75F5E.js} +4 -4
- package/dist/{ColorPicker-6UraVYFy.js.map → ColorPicker-BNM75F5E.js.map} +1 -1
- package/dist/{ColorPicker-DmLGKaYF.cjs → ColorPicker-C33dlkhN.cjs} +2 -2
- package/dist/{ColorPicker-DmLGKaYF.cjs.map → ColorPicker-C33dlkhN.cjs.map} +1 -1
- package/dist/{ColorPickerPanel-WuxwwfCI.cjs → ColorPickerPanel-BZ_ZNu2B.cjs} +2 -2
- package/dist/{ColorPickerPanel-WuxwwfCI.cjs.map → ColorPickerPanel-BZ_ZNu2B.cjs.map} +1 -1
- package/dist/{ColorPickerPanel-DZ-W_wOI.js → ColorPickerPanel-Bh1K0YS8.js} +2 -2
- package/dist/{ColorPickerPanel-DZ-W_wOI.js.map → ColorPickerPanel-Bh1K0YS8.js.map} +1 -1
- package/dist/{ColorRamp-D_9gsqJl.cjs → ColorRamp-BJWNKzoX.cjs} +2 -2
- package/dist/{ColorRamp-D_9gsqJl.cjs.map → ColorRamp-BJWNKzoX.cjs.map} +1 -1
- package/dist/{ColorRamp-CSqzzHZx.js → ColorRamp-BnuXrSxa.js} +3 -3
- package/dist/{ColorRamp-CSqzzHZx.js.map → ColorRamp-BnuXrSxa.js.map} +1 -1
- package/dist/{ConfigProvider-tvLbKiqu.js → ConfigProvider-DZMtq2Fz.js} +2 -2
- package/dist/ConfigProvider-DZMtq2Fz.js.map +1 -0
- package/dist/{ConfigProvider-CVLHPXQm.cjs → ConfigProvider-th4GYhcU.cjs} +2 -2
- package/dist/ConfigProvider-th4GYhcU.cjs.map +1 -0
- package/dist/{CopyButton-0w4OToIy.cjs → CopyButton-C9oHGs6W.cjs} +2 -2
- package/dist/{CopyButton-0w4OToIy.cjs.map → CopyButton-C9oHGs6W.cjs.map} +1 -1
- package/dist/{CopyButton-B_mYxcXV.js → CopyButton-hZqLdXJq.js} +3 -3
- package/dist/{CopyButton-B_mYxcXV.js.map → CopyButton-hZqLdXJq.js.map} +1 -1
- package/dist/{DatePicker-Bt-M87zX.js → DatePicker-B6ZL_T-E.js} +5 -5
- package/dist/{DatePicker-Bt-M87zX.js.map → DatePicker-B6ZL_T-E.js.map} +1 -1
- package/dist/{DatePicker-D1uFIm3M.cjs → DatePicker-DXwJB4MH.cjs} +2 -2
- package/dist/{DatePicker-D1uFIm3M.cjs.map → DatePicker-DXwJB4MH.cjs.map} +1 -1
- package/dist/{DateTimePicker-zJUc9crs.js → DateTimePicker-BynW1Eeg.js} +8 -8
- package/dist/{DateTimePicker-zJUc9crs.js.map → DateTimePicker-BynW1Eeg.js.map} +1 -1
- package/dist/{DateTimePicker-DPt-LDVJ.cjs → DateTimePicker-CHi1H2k1.cjs} +2 -2
- package/dist/{DateTimePicker-DPt-LDVJ.cjs.map → DateTimePicker-CHi1H2k1.cjs.map} +1 -1
- package/dist/{DescriptionList-CPCbzU9b.cjs → DescriptionList-BqYwp08t.cjs} +2 -2
- package/dist/{DescriptionList-CPCbzU9b.cjs.map → DescriptionList-BqYwp08t.cjs.map} +1 -1
- package/dist/{DescriptionList-BLx9NfAW.js → DescriptionList-C6Gfk6I_.js} +5 -5
- package/dist/{DescriptionList-BLx9NfAW.js.map → DescriptionList-C6Gfk6I_.js.map} +1 -1
- package/dist/{EmptyState-BEVEGcLx.js → EmptyState-BvAA5mYO.js} +2 -2
- package/dist/{EmptyState-BEVEGcLx.js.map → EmptyState-BvAA5mYO.js.map} +1 -1
- package/dist/{EmptyState-C54C0Qwc.cjs → EmptyState-CZ6X5-Zy.cjs} +2 -2
- package/dist/{EmptyState-C54C0Qwc.cjs.map → EmptyState-CZ6X5-Zy.cjs.map} +1 -1
- package/dist/{ErrorBoundary-BSJL381Y.js → ErrorBoundary-BS0x9RVO.js} +14 -6
- package/dist/ErrorBoundary-BS0x9RVO.js.map +1 -0
- package/dist/ErrorBoundary-WwmJrL6o.cjs +2 -0
- package/dist/ErrorBoundary-WwmJrL6o.cjs.map +1 -0
- package/dist/ErrorState-BTSGKrJq.js +178 -0
- package/dist/ErrorState-BTSGKrJq.js.map +1 -0
- package/dist/ErrorState-DRXuV6na.cjs +4 -0
- package/dist/ErrorState-DRXuV6na.cjs.map +1 -0
- package/dist/{FileCard-R_sB8Qbx.js → FileCard-CxZ3o4BO.js} +4 -4
- package/dist/{FileCard-R_sB8Qbx.js.map → FileCard-CxZ3o4BO.js.map} +1 -1
- package/dist/{FileCard-B3dfdTVN.cjs → FileCard-ZZNd_tUN.cjs} +2 -2
- package/dist/{FileCard-B3dfdTVN.cjs.map → FileCard-ZZNd_tUN.cjs.map} +1 -1
- package/dist/{FileUploader-4UMy0urx.cjs → FileUploader-B--hPV3b.cjs} +2 -2
- package/dist/{FileUploader-4UMy0urx.cjs.map → FileUploader-B--hPV3b.cjs.map} +1 -1
- package/dist/{FileUploader-B55atuxq.js → FileUploader-CPah0hUe.js} +6 -6
- package/dist/{FileUploader-B55atuxq.js.map → FileUploader-CPah0hUe.js.map} +1 -1
- package/dist/{Flag-CFvJHC0u.cjs → Flag-C4La35rA.cjs} +2 -2
- package/dist/{Flag-CFvJHC0u.cjs.map → Flag-C4La35rA.cjs.map} +1 -1
- package/dist/{Flag-D7fmMqqy.js → Flag-DikEV1jI.js} +2 -2
- package/dist/{Flag-D7fmMqqy.js.map → Flag-DikEV1jI.js.map} +1 -1
- package/dist/{FullscreenToggle-CXmPqxJv.js → FullscreenToggle-CTt7_Kv_.js} +3 -3
- package/dist/{FullscreenToggle-CXmPqxJv.js.map → FullscreenToggle-CTt7_Kv_.js.map} +1 -1
- package/dist/{FullscreenToggle-D7tUPCNI.cjs → FullscreenToggle-ejjFFd9a.cjs} +2 -2
- package/dist/{FullscreenToggle-D7tUPCNI.cjs.map → FullscreenToggle-ejjFFd9a.cjs.map} +1 -1
- package/dist/{IconButton-sC_E_TXd.js → IconButton-BUmXN_lD.js} +2 -2
- package/dist/{IconButton-sC_E_TXd.js.map → IconButton-BUmXN_lD.js.map} +1 -1
- package/dist/{IconButton-BVrO9TBP.cjs → IconButton-CYMvszcM.cjs} +2 -2
- package/dist/{IconButton-BVrO9TBP.cjs.map → IconButton-CYMvszcM.cjs.map} +1 -1
- package/dist/{Loader-DNCEHqZb.cjs → Loader-DkwiCGbB.cjs} +2 -2
- package/dist/{Loader-DNCEHqZb.cjs.map → Loader-DkwiCGbB.cjs.map} +1 -1
- package/dist/{Loader-ChrouvaR.js → Loader-jh7XMRhy.js} +2 -2
- package/dist/{Loader-ChrouvaR.js.map → Loader-jh7XMRhy.js.map} +1 -1
- package/dist/{LocationPicker-DxiQ27k6.js → LocationPicker-Cdm7BCX5.js} +7 -7
- package/dist/{LocationPicker-DxiQ27k6.js.map → LocationPicker-Cdm7BCX5.js.map} +1 -1
- package/dist/{LocationPicker-CJ6bCJC4.cjs → LocationPicker-D-9mrCVD.cjs} +2 -2
- package/dist/{LocationPicker-CJ6bCJC4.cjs.map → LocationPicker-D-9mrCVD.cjs.map} +1 -1
- package/dist/{Modal-Do8pzyMl.js → Modal-CrvOHbNy.js} +3 -3
- package/dist/{Modal-Do8pzyMl.js.map → Modal-CrvOHbNy.js.map} +1 -1
- package/dist/{Modal-BL_XihC8.cjs → Modal-eI6QL-LM.cjs} +2 -2
- package/dist/{Modal-BL_XihC8.cjs.map → Modal-eI6QL-LM.cjs.map} +1 -1
- package/dist/{MultiSelect-BfsEdXNa.js → MultiSelect-BTilYrXp.js} +5 -5
- package/dist/{MultiSelect-BfsEdXNa.js.map → MultiSelect-BTilYrXp.js.map} +1 -1
- package/dist/{MultiSelect-WS5YNGRD.cjs → MultiSelect-B_Jenpgv.cjs} +2 -2
- package/dist/{MultiSelect-WS5YNGRD.cjs.map → MultiSelect-B_Jenpgv.cjs.map} +1 -1
- package/dist/{MultilineTextField-BgfBFeeF.js → MultilineTextField-DJ26nTdF.js} +2 -2
- package/dist/{MultilineTextField-BgfBFeeF.js.map → MultilineTextField-DJ26nTdF.js.map} +1 -1
- package/dist/{MultilineTextField-B6EYAdik.cjs → MultilineTextField-ihcPDX3D.cjs} +2 -2
- package/dist/{MultilineTextField-B6EYAdik.cjs.map → MultilineTextField-ihcPDX3D.cjs.map} +1 -1
- package/dist/{NumberField-P68n6q5m.js → NumberField-DEoaxFJj.js} +4 -4
- package/dist/{NumberField-P68n6q5m.js.map → NumberField-DEoaxFJj.js.map} +1 -1
- package/dist/{NumberField-CxiEfRAi.cjs → NumberField-czWHuAyt.cjs} +2 -2
- package/dist/{NumberField-CxiEfRAi.cjs.map → NumberField-czWHuAyt.cjs.map} +1 -1
- package/dist/{OtpField-XieJfl1y.cjs → OtpField-DK5KikOt.cjs} +2 -2
- package/dist/{OtpField-XieJfl1y.cjs.map → OtpField-DK5KikOt.cjs.map} +1 -1
- package/dist/{OtpField-DjTJH4Kh.js → OtpField-v2RuXdsE.js} +3 -3
- package/dist/{OtpField-DjTJH4Kh.js.map → OtpField-v2RuXdsE.js.map} +1 -1
- package/dist/PageError-CIVYNLTW.cjs +2 -0
- package/dist/{PageError-D7_Q8wz8.cjs.map → PageError-CIVYNLTW.cjs.map} +1 -1
- package/dist/PageError-CyMdVrxL.js +70 -0
- package/dist/{PageError-ClR7k0Zb.js.map → PageError-CyMdVrxL.js.map} +1 -1
- package/dist/{PageLayout-XQ_aQTf5.js → PageLayout-BtukUUfe.js} +2 -2
- package/dist/{PageLayout-XQ_aQTf5.js.map → PageLayout-BtukUUfe.js.map} +1 -1
- package/dist/{PageLayout-DTG83hLL.cjs → PageLayout-C_daDKkg.cjs} +2 -2
- package/dist/{PageLayout-DTG83hLL.cjs.map → PageLayout-C_daDKkg.cjs.map} +1 -1
- package/dist/{PageNotFound-D3wJ4Job.cjs → PageNotFound-CHb8DlqC.cjs} +2 -2
- package/dist/{PageNotFound-D3wJ4Job.cjs.map → PageNotFound-CHb8DlqC.cjs.map} +1 -1
- package/dist/{PageNotFound-CpwHMTxG.js → PageNotFound-DQ-OvU_O.js} +5 -5
- package/dist/{PageNotFound-CpwHMTxG.js.map → PageNotFound-DQ-OvU_O.js.map} +1 -1
- package/dist/{Pagination-Df-F9i2o.js → Pagination-BjufY1mt.js} +2 -2
- package/dist/{Pagination-Df-F9i2o.js.map → Pagination-BjufY1mt.js.map} +1 -1
- package/dist/{Pagination-BF8cmQMi.cjs → Pagination-jLyJa8iL.cjs} +2 -2
- package/dist/{Pagination-BF8cmQMi.cjs.map → Pagination-jLyJa8iL.cjs.map} +1 -1
- package/dist/{PaletteField-BFRPv7AC.cjs → PaletteField-DGaV7VJ9.cjs} +2 -2
- package/dist/{PaletteField-BFRPv7AC.cjs.map → PaletteField-DGaV7VJ9.cjs.map} +1 -1
- package/dist/{PaletteField-DUu4jz1c.js → PaletteField-DTfV8Lny.js} +3 -3
- package/dist/{PaletteField-DUu4jz1c.js.map → PaletteField-DTfV8Lny.js.map} +1 -1
- package/dist/{PhoneField-CXIQX_hR.js → PhoneField-BSIhBMW2.js} +5 -5
- package/dist/{PhoneField-CXIQX_hR.js.map → PhoneField-BSIhBMW2.js.map} +1 -1
- package/dist/{PhoneField-O5syyH7u.cjs → PhoneField-DchrnSiE.cjs} +2 -2
- package/dist/{PhoneField-O5syyH7u.cjs.map → PhoneField-DchrnSiE.cjs.map} +1 -1
- package/dist/{Popconfirm-bEoOPmZY.cjs → Popconfirm-l9au66oY.cjs} +2 -2
- package/dist/{Popconfirm-bEoOPmZY.cjs.map → Popconfirm-l9au66oY.cjs.map} +1 -1
- package/dist/{Popconfirm-D4J7tlk_.js → Popconfirm-p2O8Vmz0.js} +3 -3
- package/dist/{Popconfirm-D4J7tlk_.js.map → Popconfirm-p2O8Vmz0.js.map} +1 -1
- package/dist/{Progress-BxvqmmGS.js → Progress-C-VGs3yJ.js} +2 -2
- package/dist/{Progress-BxvqmmGS.js.map → Progress-C-VGs3yJ.js.map} +1 -1
- package/dist/{Progress-CqXX0rRp.cjs → Progress-Cqr2_BF1.cjs} +2 -2
- package/dist/{Progress-CqXX0rRp.cjs.map → Progress-Cqr2_BF1.cjs.map} +1 -1
- package/dist/{QrCode-osD23Vkt.js → QrCode-B9YbQNVc.js} +2 -2
- package/dist/{QrCode-osD23Vkt.js.map → QrCode-B9YbQNVc.js.map} +1 -1
- package/dist/{QrCode-BQ1eUiAJ.cjs → QrCode-CNVYpz9j.cjs} +2 -2
- package/dist/{QrCode-BQ1eUiAJ.cjs.map → QrCode-CNVYpz9j.cjs.map} +1 -1
- package/dist/{RadioGroup-CvC2yc4p.cjs → RadioGroup-687BVZ7k.cjs} +2 -2
- package/dist/{RadioGroup-CvC2yc4p.cjs.map → RadioGroup-687BVZ7k.cjs.map} +1 -1
- package/dist/{RadioGroup-CTAayuMv.js → RadioGroup-CD209tlb.js} +2 -2
- package/dist/{RadioGroup-CTAayuMv.js.map → RadioGroup-CD209tlb.js.map} +1 -1
- package/dist/{RemoveDialog-DH3eNUxC.js → RemoveDialog-BKgWohkG.js} +6 -6
- package/dist/{RemoveDialog-DH3eNUxC.js.map → RemoveDialog-BKgWohkG.js.map} +1 -1
- package/dist/{RemoveDialog-FrieNcjL.cjs → RemoveDialog-eGCbOuuM.cjs} +2 -2
- package/dist/{RemoveDialog-FrieNcjL.cjs.map → RemoveDialog-eGCbOuuM.cjs.map} +1 -1
- package/dist/{RichTextEditor-B-C4NPDk.cjs → RichTextEditor-BPAD4ISz.cjs} +2 -2
- package/dist/{RichTextEditor-B-C4NPDk.cjs.map → RichTextEditor-BPAD4ISz.cjs.map} +1 -1
- package/dist/{RichTextEditor-6frB2C5G.js → RichTextEditor-C24uBIWh.js} +8 -8
- package/dist/{RichTextEditor-6frB2C5G.js.map → RichTextEditor-C24uBIWh.js.map} +1 -1
- package/dist/RootLayout-BY_BxQ0C.cjs +2 -0
- package/dist/RootLayout-BY_BxQ0C.cjs.map +1 -0
- package/dist/RootLayout-CicjlAUF.js +641 -0
- package/dist/RootLayout-CicjlAUF.js.map +1 -0
- package/dist/{Select-Bjq_p8_e.cjs → Select-BbgueWwN.cjs} +2 -2
- package/dist/{Select-Bjq_p8_e.cjs.map → Select-BbgueWwN.cjs.map} +1 -1
- package/dist/{Select-DO3zDQYV.js → Select-DEi_ZUHR.js} +4 -4
- package/dist/{Select-DO3zDQYV.js.map → Select-DEi_ZUHR.js.map} +1 -1
- package/dist/{Sidebar-2oH285Xs.cjs → Sidebar-D-nR8Cu6.cjs} +2 -2
- package/dist/{Sidebar-2oH285Xs.cjs.map → Sidebar-D-nR8Cu6.cjs.map} +1 -1
- package/dist/{Sidebar-CKbSWc5q.js → Sidebar-nORfjIg8.js} +4 -4
- package/dist/{Sidebar-CKbSWc5q.js.map → Sidebar-nORfjIg8.js.map} +1 -1
- package/dist/{Slider-Cu1FhxR2.cjs → Slider-0joKXhPo.cjs} +2 -2
- package/dist/{Slider-Cu1FhxR2.cjs.map → Slider-0joKXhPo.cjs.map} +1 -1
- package/dist/{Slider-DoQJWgGU.js → Slider-CwZYxDO0.js} +2 -2
- package/dist/{Slider-DoQJWgGU.js.map → Slider-CwZYxDO0.js.map} +1 -1
- package/dist/{SpeedDial-BZK-z_r9.js → SpeedDial-BMpJtYP6.js} +2 -2
- package/dist/{SpeedDial-BZK-z_r9.js.map → SpeedDial-BMpJtYP6.js.map} +1 -1
- package/dist/{SpeedDial-KGf8b4Gq.cjs → SpeedDial-D5uk_E5v.cjs} +2 -2
- package/dist/{SpeedDial-KGf8b4Gq.cjs.map → SpeedDial-D5uk_E5v.cjs.map} +1 -1
- package/dist/{Stepper-s9Vah5R2.cjs → Stepper-BRksGDK1.cjs} +2 -2
- package/dist/{Stepper-s9Vah5R2.cjs.map → Stepper-BRksGDK1.cjs.map} +1 -1
- package/dist/{Stepper-BI3pjWf_.js → Stepper-D8bRyyhl.js} +2 -2
- package/dist/{Stepper-BI3pjWf_.js.map → Stepper-D8bRyyhl.js.map} +1 -1
- package/dist/{SwatchPicker-CpwVq0xp.cjs → SwatchPicker-BVW_yhRU.cjs} +2 -2
- package/dist/{SwatchPicker-CpwVq0xp.cjs.map → SwatchPicker-BVW_yhRU.cjs.map} +1 -1
- package/dist/{SwatchPicker-BAKslSY4.js → SwatchPicker-C-_wLaf6.js} +2 -2
- package/dist/{SwatchPicker-BAKslSY4.js.map → SwatchPicker-C-_wLaf6.js.map} +1 -1
- package/dist/{Table-PsNnKn_j.js → Table-C0RDylA0.js} +18 -18
- package/dist/{Table-PsNnKn_j.js.map → Table-C0RDylA0.js.map} +1 -1
- package/dist/{Table-CLjLsYYS.cjs → Table-CGIip6UL.cjs} +2 -2
- package/dist/{Table-CLjLsYYS.cjs.map → Table-CGIip6UL.cjs.map} +1 -1
- package/dist/{Tabs-DQoNP0QT.cjs → Tabs-BzbSNmBj.cjs} +2 -2
- package/dist/{Tabs-DQoNP0QT.cjs.map → Tabs-BzbSNmBj.cjs.map} +1 -1
- package/dist/{Tabs-B2WzlRXI.js → Tabs-CQvfqazt.js} +2 -2
- package/dist/{Tabs-B2WzlRXI.js.map → Tabs-CQvfqazt.js.map} +1 -1
- package/dist/{TagsField-pdvQU4zh.js → TagsField-BdM-xre0.js} +5 -5
- package/dist/{TagsField-pdvQU4zh.js.map → TagsField-BdM-xre0.js.map} +1 -1
- package/dist/{TagsField-CLfAAz4N.cjs → TagsField-CGL1oI7b.cjs} +2 -2
- package/dist/{TagsField-CLfAAz4N.cjs.map → TagsField-CGL1oI7b.cjs.map} +1 -1
- package/dist/{TextField-CgPfN-4d.cjs → TextField-D49Lpbjt.cjs} +2 -2
- package/dist/{TextField-CgPfN-4d.cjs.map → TextField-D49Lpbjt.cjs.map} +1 -1
- package/dist/{TextField-LONfx4jy.js → TextField-otYGVuwF.js} +4 -4
- package/dist/{TextField-LONfx4jy.js.map → TextField-otYGVuwF.js.map} +1 -1
- package/dist/{ThemeToggle-9RBaRALj.cjs → ThemeToggle-B8rkRTis.cjs} +2 -2
- package/dist/{ThemeToggle-9RBaRALj.cjs.map → ThemeToggle-B8rkRTis.cjs.map} +1 -1
- package/dist/{ThemeToggle-DTkFppOd.js → ThemeToggle-D33Tqv2F.js} +3 -3
- package/dist/{ThemeToggle-DTkFppOd.js.map → ThemeToggle-D33Tqv2F.js.map} +1 -1
- package/dist/{TimeColumns-B7af5Cbj.js → TimeColumns-DyjTpZbD.js} +2 -2
- package/dist/{TimeColumns-B7af5Cbj.js.map → TimeColumns-DyjTpZbD.js.map} +1 -1
- package/dist/{TimeColumns-CJ13uf3K.cjs → TimeColumns-qEHHZC1N.cjs} +2 -2
- package/dist/{TimeColumns-CJ13uf3K.cjs.map → TimeColumns-qEHHZC1N.cjs.map} +1 -1
- package/dist/{TimePicker-Dshko7IJ.cjs → TimePicker-DJrNO01U.cjs} +2 -2
- package/dist/{TimePicker-Dshko7IJ.cjs.map → TimePicker-DJrNO01U.cjs.map} +1 -1
- package/dist/{TimePicker-BitZ7wv-.js → TimePicker-yfYqLbj3.js} +6 -6
- package/dist/{TimePicker-BitZ7wv-.js.map → TimePicker-yfYqLbj3.js.map} +1 -1
- package/dist/{Toaster-8ynQTcc0.cjs → Toaster-B7Xd2IaM.cjs} +2 -2
- package/dist/{Toaster-8ynQTcc0.cjs.map → Toaster-B7Xd2IaM.cjs.map} +1 -1
- package/dist/{Toaster-CYVETXVZ.js → Toaster-D8cxkhwr.js} +2 -2
- package/dist/{Toaster-CYVETXVZ.js.map → Toaster-D8cxkhwr.js.map} +1 -1
- package/dist/{TranslatedFields-BKI3jrNd.cjs → TranslatedFields-BvqqdNWz.cjs} +2 -2
- package/dist/{TranslatedFields-BKI3jrNd.cjs.map → TranslatedFields-BvqqdNWz.cjs.map} +1 -1
- package/dist/{TranslatedFields-dmb-0Yn7.js → TranslatedFields-CsSsTrnF.js} +5 -5
- package/dist/{TranslatedFields-dmb-0Yn7.js.map → TranslatedFields-CsSsTrnF.js.map} +1 -1
- package/dist/Typography-ChSuxgkc.js +74 -0
- package/dist/Typography-ChSuxgkc.js.map +1 -0
- package/dist/Typography-d97DdbNd.cjs +2 -0
- package/dist/Typography-d97DdbNd.cjs.map +1 -0
- package/dist/{UserCard-pEJZqiDF.js → UserCard-CsZ4Ogac.js} +4 -4
- package/dist/{UserCard-pEJZqiDF.js.map → UserCard-CsZ4Ogac.js.map} +1 -1
- package/dist/{UserCard-ah6K1y0H.cjs → UserCard-Die7JV4z.cjs} +2 -2
- package/dist/{UserCard-ah6K1y0H.cjs.map → UserCard-Die7JV4z.cjs.map} +1 -1
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/AuthLayout/index.cjs +1 -1
- package/dist/components/AuthLayout/index.js +1 -1
- package/dist/components/Breadcrumbs/index.cjs +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Card/index.cjs +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Chip/index.cjs +1 -1
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/ChoiceCard/index.cjs +1 -1
- package/dist/components/ChoiceCard/index.js +1 -1
- package/dist/components/CodeBlock/index.cjs +1 -1
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/ColorPicker/index.cjs +1 -1
- package/dist/components/ColorPicker/index.js +1 -1
- package/dist/components/ColorRamp/index.cjs +1 -1
- package/dist/components/ColorRamp/index.js +1 -1
- package/dist/components/CopyButton/index.cjs +1 -1
- package/dist/components/CopyButton/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/DateTimePicker/index.cjs +1 -1
- package/dist/components/DateTimePicker/index.js +1 -1
- package/dist/components/DescriptionList/index.cjs +1 -1
- package/dist/components/DescriptionList/index.js +1 -1
- package/dist/components/EmptyState/index.cjs +1 -1
- package/dist/components/EmptyState/index.js +1 -1
- package/dist/components/ErrorState/ErrorDetailsModal.d.cts +12 -0
- package/dist/components/ErrorState/ErrorDetailsModal.d.ts +12 -0
- package/dist/components/ErrorState/ErrorState.d.cts +23 -24
- package/dist/components/ErrorState/ErrorState.d.ts +23 -24
- package/dist/components/ErrorState/QueryError.d.cts +3 -3
- package/dist/components/ErrorState/QueryError.d.ts +3 -3
- package/dist/components/ErrorState/index.cjs +1 -1
- package/dist/components/ErrorState/index.js +2 -2
- package/dist/components/FileCard/index.cjs +1 -1
- package/dist/components/FileCard/index.js +1 -1
- package/dist/components/FileUploader/index.cjs +1 -1
- package/dist/components/FileUploader/index.js +1 -1
- package/dist/components/Flag/index.cjs +1 -1
- package/dist/components/Flag/index.js +1 -1
- package/dist/components/FullscreenToggle/index.cjs +1 -1
- package/dist/components/FullscreenToggle/index.js +1 -1
- package/dist/components/IconButton/index.cjs +1 -1
- package/dist/components/IconButton/index.js +1 -1
- package/dist/components/Loader/index.cjs +1 -1
- package/dist/components/Loader/index.js +1 -1
- package/dist/components/LocationPicker/index.cjs +1 -1
- package/dist/components/LocationPicker/index.js +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/MultiSelect/index.cjs +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultilineTextField/index.cjs +1 -1
- package/dist/components/MultilineTextField/index.js +1 -1
- package/dist/components/NumberField/index.cjs +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OtpField/index.cjs +1 -1
- package/dist/components/OtpField/index.js +1 -1
- package/dist/components/PageError/index.cjs +1 -1
- package/dist/components/PageError/index.js +1 -1
- package/dist/components/PageLayout/index.cjs +1 -1
- package/dist/components/PageLayout/index.js +1 -1
- package/dist/components/PageNotFound/index.cjs +1 -1
- package/dist/components/PageNotFound/index.js +1 -1
- package/dist/components/Pagination/index.cjs +1 -1
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/PaletteField/index.cjs +1 -1
- package/dist/components/PaletteField/index.js +1 -1
- package/dist/components/PhoneField/index.cjs +1 -1
- package/dist/components/PhoneField/index.js +1 -1
- package/dist/components/Popconfirm/index.cjs +1 -1
- package/dist/components/Popconfirm/index.js +1 -1
- package/dist/components/Progress/index.cjs +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/QrCode/index.cjs +1 -1
- package/dist/components/QrCode/index.js +1 -1
- package/dist/components/Radio/index.cjs +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/RemoveDialog/index.cjs +1 -1
- package/dist/components/RemoveDialog/index.js +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RootLayout/RootLayout.d.cts +6 -1
- package/dist/components/RootLayout/RootLayout.d.ts +6 -1
- package/dist/components/RootLayout/index.cjs +1 -1
- package/dist/components/RootLayout/index.js +1 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Sidebar/index.cjs +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/Slider/index.cjs +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/SpeedDial/index.cjs +1 -1
- package/dist/components/SpeedDial/index.js +1 -1
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/SwatchPicker/index.cjs +1 -1
- package/dist/components/SwatchPicker/index.js +1 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tabs/index.cjs +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/TagsField/index.cjs +1 -1
- package/dist/components/TagsField/index.js +1 -1
- package/dist/components/TextField/index.cjs +1 -1
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/ThemeToggle/index.cjs +1 -1
- package/dist/components/ThemeToggle/index.js +1 -1
- package/dist/components/TimePicker/index.cjs +1 -1
- package/dist/components/TimePicker/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/TranslatedFields/index.cjs +1 -1
- package/dist/components/TranslatedFields/index.js +1 -1
- package/dist/components/Typography/Typography.d.cts +7 -1
- package/dist/components/Typography/Typography.d.ts +7 -1
- package/dist/components/Typography/index.cjs +1 -1
- package/dist/components/Typography/index.js +1 -1
- package/dist/components/UserCard/index.cjs +1 -1
- package/dist/components/UserCard/index.js +1 -1
- package/dist/entries/app.cjs +1 -1
- package/dist/entries/app.js +1 -1
- package/dist/entries/components.cjs +1 -1
- package/dist/entries/components.js +58 -58
- package/dist/entries/i18n.cjs +1 -1
- package/dist/entries/i18n.js +2 -2
- package/dist/entries/theme.cjs +1 -1
- package/dist/entries/theme.d.cts +1 -1
- package/dist/entries/theme.d.ts +1 -1
- package/dist/entries/theme.js +1 -1
- package/dist/i18n/messages.d.cts +6 -0
- package/dist/i18n/messages.d.ts +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +61 -61
- package/dist/messages-DYXyWU3X.cjs +36 -0
- package/dist/messages-DYXyWU3X.cjs.map +1 -0
- package/dist/{messages-C1eTrGJy.js → messages-zarEtcsN.js} +25 -4
- package/dist/messages-zarEtcsN.js.map +1 -0
- package/dist/theme/ConfigProvider.d.cts +21 -2
- package/dist/theme/ConfigProvider.d.ts +21 -2
- package/dist/theme/index.d.cts +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/{useHomeTo-yTXajO22.js → useHomeTo-DVMyLZbb.js} +2 -2
- package/dist/{useHomeTo-yTXajO22.js.map → useHomeTo-DVMyLZbb.js.map} +1 -1
- package/dist/{useHomeTo-Cr6Usr_D.cjs → useHomeTo-Dnu6VAvU.cjs} +2 -2
- package/dist/{useHomeTo-Cr6Usr_D.cjs.map → useHomeTo-Dnu6VAvU.cjs.map} +1 -1
- package/dist/{useOptionMenu-DK0ixg-p.js → useOptionMenu-DNYlfNO_.js} +4 -4
- package/dist/{useOptionMenu-DK0ixg-p.js.map → useOptionMenu-DNYlfNO_.js.map} +1 -1
- package/dist/{useOptionMenu-DHGSbQmS.cjs → useOptionMenu-OAYGUWP_.cjs} +2 -2
- package/dist/{useOptionMenu-DHGSbQmS.cjs.map → useOptionMenu-OAYGUWP_.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/ConfigProvider-CVLHPXQm.cjs.map +0 -1
- package/dist/ConfigProvider-tvLbKiqu.js.map +0 -1
- package/dist/ErrorBoundary-8iu-mR5Y.cjs +0 -2
- package/dist/ErrorBoundary-8iu-mR5Y.cjs.map +0 -1
- package/dist/ErrorBoundary-BSJL381Y.js.map +0 -1
- package/dist/ErrorState-BXMjBWav.cjs +0 -4
- package/dist/ErrorState-BXMjBWav.cjs.map +0 -1
- package/dist/ErrorState-DKhZ4aJh.js +0 -142
- package/dist/ErrorState-DKhZ4aJh.js.map +0 -1
- package/dist/PageError-ClR7k0Zb.js +0 -69
- package/dist/PageError-D7_Q8wz8.cjs +0 -2
- package/dist/RootLayout-C7n79JjM.js +0 -621
- package/dist/RootLayout-C7n79JjM.js.map +0 -1
- package/dist/RootLayout-CtkpgPGV.cjs +0 -2
- package/dist/RootLayout-CtkpgPGV.cjs.map +0 -1
- package/dist/Typography-B6ASPrzT.cjs +0 -2
- package/dist/Typography-B6ASPrzT.cjs.map +0 -1
- package/dist/Typography-CJv5AnRP.js +0 -70
- package/dist/Typography-CJv5AnRP.js.map +0 -1
- package/dist/messages-C1eTrGJy.js.map +0 -1
- package/dist/messages-DCr7iFmv.cjs +0 -36
- package/dist/messages-DCr7iFmv.cjs.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as j, useState as w, useRef as u, useEffect as l } from "react";
|
|
3
|
+
import { B as z } from "./Button-BQ7jsm5P.js";
|
|
4
|
+
import { E as C } from "./ErrorState-BTSGKrJq.js";
|
|
5
|
+
import { f as p, e as D } from "./errorMessage-C83fB2h5.js";
|
|
6
|
+
import { u as H } from "./useHomeTo-DVMyLZbb.js";
|
|
7
|
+
import { a as _ } from "./ConfigProvider-DZMtq2Fz.js";
|
|
8
|
+
const O = j(function({
|
|
9
|
+
error: t,
|
|
10
|
+
reset: o,
|
|
11
|
+
info: A,
|
|
12
|
+
onRetry: i,
|
|
13
|
+
showMessage: n,
|
|
14
|
+
showHome: d = !0,
|
|
15
|
+
title: v,
|
|
16
|
+
description: E,
|
|
17
|
+
icon: g,
|
|
18
|
+
size: y,
|
|
19
|
+
pattern: P,
|
|
20
|
+
showDetails: S,
|
|
21
|
+
...x
|
|
22
|
+
}, T) {
|
|
23
|
+
const a = _(), { router: r, homeTo: c } = H(), [h, f] = w(!1), e = u(!0);
|
|
24
|
+
l(() => (e.current = !0, () => {
|
|
25
|
+
e.current = !1;
|
|
26
|
+
}), []);
|
|
27
|
+
const m = u(void 0);
|
|
28
|
+
l(() => {
|
|
29
|
+
m.current !== t && (m.current = t, console.error("[PageError]", t));
|
|
30
|
+
}, [t]);
|
|
31
|
+
const k = typeof n == "function" ? n(t) : n === "dev" ? p() : n ?? (D(t) || p()), B = async () => {
|
|
32
|
+
f(!0);
|
|
33
|
+
try {
|
|
34
|
+
await (i == null ? void 0 : i()), o == null || o(), await (r == null ? void 0 : r.invalidate());
|
|
35
|
+
} finally {
|
|
36
|
+
e.current && f(!1);
|
|
37
|
+
}
|
|
38
|
+
}, b = d && r && c != null ? /* @__PURE__ */ s(
|
|
39
|
+
z,
|
|
40
|
+
{
|
|
41
|
+
size: "sm",
|
|
42
|
+
variant: "text",
|
|
43
|
+
color: "primary",
|
|
44
|
+
onClick: () => r.navigate({ to: c }),
|
|
45
|
+
children: a("pageError.home")
|
|
46
|
+
}
|
|
47
|
+
) : void 0;
|
|
48
|
+
return /* @__PURE__ */ s(
|
|
49
|
+
C,
|
|
50
|
+
{
|
|
51
|
+
ref: T,
|
|
52
|
+
variant: "block",
|
|
53
|
+
error: t,
|
|
54
|
+
title: v ?? a("pageError.title"),
|
|
55
|
+
description: E ?? (k ? void 0 : a("pageError.description")),
|
|
56
|
+
icon: g,
|
|
57
|
+
size: y,
|
|
58
|
+
pattern: P,
|
|
59
|
+
showDetails: S,
|
|
60
|
+
onRetry: o || i || r ? () => void B() : void 0,
|
|
61
|
+
retrying: h,
|
|
62
|
+
action: b,
|
|
63
|
+
...x
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
O as P
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=PageError-CyMdVrxL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageError-
|
|
1
|
+
{"version":3,"file":"PageError-CyMdVrxL.js","sources":["../src/components/PageError/PageError.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState, type HTMLAttributes, type ReactNode } from 'react'\nimport { type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport type { IconName } from '../../icons/names'\nimport { Button } from '../Button'\nimport type { EmptyStateSize } from '../EmptyState'\nimport { ErrorState } from '../ErrorState/ErrorState'\nimport { isDev, isServerError } from '../ErrorState/errorMessage'\nimport { useHomeTo } from '../PageNotFound/useHomeTo'\n\nexport interface PageErrorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** What the route threw (TanStack Router's `ErrorComponentProps.error`). */\n error: unknown\n /** Resets the route's error boundary (TanStack Router's `ErrorComponentProps.reset`). */\n reset?: () => void\n /** The React component stack (TanStack Router's `ErrorComponentProps.info`) — unused, accepted for typing. */\n info?: { componentStack: string }\n /**\n * Runs **before** the reset on \"Try Again\" (may be async) — where an app drops cached data, e.g.\n * `() => queryClient.resetQueries({ predicate: (q) => q.queryKey[0] !== 'session' })`. Without it, `reset()`\n * re-renders against the same cached response and throws on the same data again.\n */\n onRetry?: () => void | Promise<void>\n /**\n * Show the error's own message. Default: when it looks **server-originated** (a `traceId` or a numeric\n * `status` — written for people) or in development; otherwise the localized generic sentence (a render\n * crash's message is a developer's). `true` / `false` force it; `'dev'` = development only; a function decides\n * per error.\n */\n showMessage?: boolean | 'dev' | ((error: unknown) => boolean)\n /** A secondary \"Go to Home\" button to the first allowed menu page (RBAC-aware). Defaults to `true`. */\n showHome?: boolean\n /** Heading. Defaults to the localized \"This Page Could Not Be Shown\". */\n title?: ReactNode\n /** Overrides the description (the message / the generic sentence). */\n description?: ReactNode\n /** Leading icon — passed to `ErrorState` (`Danger` / `CloudCross` by default; `false` hides it). */\n icon?: IconName | ReactNode | false\n /** Size — passed to `ErrorState`. Defaults to `md`. */\n size?: EmptyStateSize\n /** Faded-grid hero backdrop — passed to `ErrorState`. Defaults to `true`. */\n pattern?: boolean\n /** The developer details panel (stack) — passed to `ErrorState`. Defaults to `'dev'`. */\n showDetails?: boolean | 'dev'\n}\n\n/**\n * The shared **route error page** — the twin of `PageNotFound`. Drop it into TanStack Router as the\n * `defaultErrorComponent`: TanStack wraps every route in its own error boundary (inside the shell's `<Outlet/>`),\n * so without it a crashing page shows the router's bare \"Something went wrong!\". Renders the full `ErrorState`\n * hero inside the shell with **Try Again** (`await onRetry?.()` → `reset()` → `router.invalidate()`, which re-runs\n * a throwing loader / `beforeLoad`), a **Go to Home** button, the server's `traceId`, and the error's message only\n * when it was written for people (`showMessage`). Every error is `console.error`ed once — in production the\n * screen hides the message, so the console is the record.\n *\n * @example\n * createRouter({ routeTree, defaultNotFoundComponent: PageNotFound, defaultErrorComponent: PageError })\n */\nexport const PageError = forwardRef<HTMLDivElement, PageErrorProps>(function PageError(\n {\n error,\n reset,\n info: _info,\n onRetry,\n showMessage,\n showHome = true,\n title,\n description,\n icon,\n size,\n pattern,\n showDetails,\n ...props\n },\n ref,\n) {\n const t = useT()\n const { router, homeTo } = useHomeTo()\n const [retrying, setRetrying] = useState(false)\n const mounted = useRef(true)\n useEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n }\n }, [])\n\n // log each distinct error once (StrictMode re-runs effects; a re-render with the same error isn't new)\n const logged = useRef<unknown>(undefined)\n useEffect(() => {\n if (logged.current === error) return\n logged.current = error\n console.error('[PageError]', error)\n }, [error])\n\n const messageShown =\n typeof showMessage === 'function'\n ? showMessage(error)\n : showMessage === 'dev'\n ? isDev()\n : (showMessage ?? (isServerError(error) || isDev()))\n\n const retry = async () => {\n setRetrying(true)\n try {\n await onRetry?.()\n reset?.()\n await router?.invalidate()\n } finally {\n if (mounted.current) setRetrying(false)\n }\n }\n\n const home =\n showHome && router && homeTo != null ? (\n <Button\n size=\"sm\"\n variant=\"text\"\n color=\"primary\"\n onClick={() => router.navigate({ to: homeTo as LinkProps['to'] })}\n >\n {t('pageError.home')}\n </Button>\n ) : undefined\n\n return (\n <ErrorState\n ref={ref}\n variant=\"block\"\n error={error}\n title={title ?? t('pageError.title')}\n // hidden message → the generic sentence (the trace id still shows: it's for support, not a leak)\n description={description ?? (messageShown ? undefined : t('pageError.description'))}\n icon={icon}\n size={size}\n pattern={pattern}\n showDetails={showDetails}\n onRetry={reset || onRetry || router ? () => void retry() : undefined}\n retrying={retrying}\n action={home}\n {...props}\n />\n )\n})\n"],"names":["PageError","forwardRef","error","reset","_info","onRetry","showMessage","showHome","title","description","icon","size","pattern","showDetails","props","ref","t","useT","router","homeTo","useHomeTo","retrying","setRetrying","useState","mounted","useRef","useEffect","logged","messageShown","isDev","isServerError","retry","home","jsx","Button","ErrorState"],"mappings":";;;;;;;AA0DO,MAAMA,IAAYC,EAA2C,SAClE;AAAA,EACE,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAMC;AAAA,EACN,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJ,EAAE,QAAAC,GAAQ,QAAAC,EAAA,IAAWC,EAAA,GACrB,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxCC,IAAUC,EAAO,EAAI;AAC3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lB;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as a } from "react";
|
|
3
|
-
import { C as f } from "./Card-
|
|
3
|
+
import { C as f } from "./Card-kizK1B7N.js";
|
|
4
4
|
const n = a(
|
|
5
5
|
function(r, o) {
|
|
6
6
|
return /* @__PURE__ */ t(f, { ref: o, flat: !0, ...r });
|
|
@@ -9,4 +9,4 @@ const n = a(
|
|
|
9
9
|
export {
|
|
10
10
|
n as P
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=PageLayout-
|
|
12
|
+
//# sourceMappingURL=PageLayout-BtukUUfe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout-
|
|
1
|
+
{"version":3,"file":"PageLayout-BtukUUfe.js","sources":["../src/components/PageLayout/PageLayout.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { Card, type CardProps } from '../Card'\n\n/** PageLayout is a flat `Card`, so it gains all of Card's slots minus the `flat` toggle (always flat). */\nexport interface PageLayoutProps extends Omit<CardProps, 'flat'> {}\n\n/**\n * The content container a page's body sits in — a **flat `Card`** (no shadow, the page `background`\n * color), so it blends with the shell while the Cards/inputs placed inside it read as elevated. Being\n * a Card, it gains the full Card anatomy: an optional header (`icon` + `title` + `subtitle` +\n * `actions`), the body (`children`), a `footer` / `footerStart`, and `collapsible`. Rendered by the\n * consumer inside each route, below the shell's breadcrumbs + page title:\n * `<PageLayout title=\"Settings\" actions={…}>…</PageLayout>`. Styling uses `--tz-*` tokens only.\n */\nexport const PageLayout = forwardRef<HTMLDivElement, PageLayoutProps>(\n function PageLayout(props, ref) {\n return <Card ref={ref} flat {...props} />\n },\n)\n"],"names":["PageLayout","forwardRef","props","ref","Card"],"mappings":";;;AAcO,MAAMA,IAAaC;AAAA,EACxB,SAAoBC,GAAOC,GAAK;AAC9B,6BAAQC,GAAA,EAAK,KAAAD,GAAU,MAAI,IAAE,GAAGD,GAAO;AAAA,EACzC;AACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),a=require("react"),u=require("./Card-
|
|
2
|
-
//# sourceMappingURL=PageLayout-
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),a=require("react"),u=require("./Card-yhly3Xdp.cjs"),o=a.forwardRef(function(e,r){return t.jsx(u.Card,{ref:r,flat:!0,...e})});exports.PageLayout=o;
|
|
2
|
+
//# sourceMappingURL=PageLayout-C_daDKkg.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout-
|
|
1
|
+
{"version":3,"file":"PageLayout-C_daDKkg.cjs","sources":["../src/components/PageLayout/PageLayout.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { Card, type CardProps } from '../Card'\n\n/** PageLayout is a flat `Card`, so it gains all of Card's slots minus the `flat` toggle (always flat). */\nexport interface PageLayoutProps extends Omit<CardProps, 'flat'> {}\n\n/**\n * The content container a page's body sits in — a **flat `Card`** (no shadow, the page `background`\n * color), so it blends with the shell while the Cards/inputs placed inside it read as elevated. Being\n * a Card, it gains the full Card anatomy: an optional header (`icon` + `title` + `subtitle` +\n * `actions`), the body (`children`), a `footer` / `footerStart`, and `collapsible`. Rendered by the\n * consumer inside each route, below the shell's breadcrumbs + page title:\n * `<PageLayout title=\"Settings\" actions={…}>…</PageLayout>`. Styling uses `--tz-*` tokens only.\n */\nexport const PageLayout = forwardRef<HTMLDivElement, PageLayoutProps>(\n function PageLayout(props, ref) {\n return <Card ref={ref} flat {...props} />\n },\n)\n"],"names":["PageLayout","forwardRef","props","ref","Card"],"mappings":"sGAcaA,EAAaC,EAAAA,WACxB,SAAoBC,EAAOC,EAAK,CAC9B,aAAQC,EAAAA,KAAA,CAAK,IAAAD,EAAU,KAAI,GAAE,GAAGD,EAAO,CACzC,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),q=require("react"),F=require("./EmptyState-
|
|
2
|
-
//# sourceMappingURL=PageNotFound-
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),q=require("react"),F=require("./EmptyState-CZ6X5-Zy.cjs"),v=require("./Button-Cm64ROip.cjs"),T=require("./useHomeTo-Dnu6VAvU.cjs"),f=require("./ConfigProvider-th4GYhcU.cjs"),p=q.forwardRef(function({icon:r="SearchStatus",title:i,description:s,actionLabel:u,to:c,showAction:a=!0,...d},l){const t=f.useT(),{router:o,homeTo:e}=T.useHomeTo(c),m=!!o&&e!=null,g=a&&m?n.jsx(v.Button,{size:"sm",onClick:()=>o.navigate({to:e}),children:u??t("notFound.action")}):void 0;return n.jsx(F.EmptyState,{ref:l,icon:r,title:i??t("notFound.title"),description:s??t("notFound.description"),action:g,...d})});exports.PageNotFound=p;
|
|
2
|
+
//# sourceMappingURL=PageNotFound-CHb8DlqC.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageNotFound-
|
|
1
|
+
{"version":3,"file":"PageNotFound-CHb8DlqC.cjs","sources":["../src/components/PageNotFound/PageNotFound.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react'\nimport { type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { EmptyState, type EmptyStateSize } from '../EmptyState'\nimport { Button } from '../Button'\nimport type { IconName } from '../../icons/names'\nimport { useHomeTo } from './useHomeTo'\n\nexport interface PageNotFoundProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Hero glyph — an `IconName`, any node, or `false` to hide it. Defaults to `SearchStatus`. */\n icon?: IconName | ReactNode | false\n /** Heading. Defaults to the localized `notFound.title`. */\n title?: ReactNode\n /** Muted description. Defaults to the localized `notFound.description`. */\n description?: ReactNode\n /** Action button label. Defaults to the localized `notFound.action`. */\n actionLabel?: ReactNode\n /** Where the action navigates. Defaults to the first allowed menu page (RBAC-aware), else `/`. */\n to?: string\n /** Show the \"back home\" action button. Defaults to `true` (hidden anyway when there's no router). */\n showAction?: boolean\n /** Faded-grid hero backdrop — passed to `EmptyState`. Defaults to `true` (its default). */\n pattern?: boolean\n /** Size — passed to `EmptyState`. Defaults to `md`. */\n size?: EmptyStateSize\n}\n\n/**\n * The shared **404** page. Drop it straight into TanStack Router as the\n * `defaultNotFoundComponent` — zero props needed: the title/description/action strings come from the\n * built-in i18n (`useT`), so they translate with the panel language, and the action navigates to the\n * **first allowed menu page** (the same RBAC-aware target as `FirstRouteRedirect`), falling back to\n * `/`. Built on `EmptyState` (hero glyph + title + description + action, `pattern` on by default), so\n * it renders inside the `RootLayout` content area with the shell/sidebar intact. Lenient: with no\n * router context the `EmptyState` still renders, just without the action button. Token-only styling.\n *\n * @example\n * const router = createRouter({ routeTree, defaultNotFoundComponent: PageNotFound })\n */\nexport const PageNotFound = forwardRef<HTMLDivElement, PageNotFoundProps>(function PageNotFound(\n { icon = 'SearchStatus', title, description, actionLabel, to, showAction = true, ...props },\n ref,\n) {\n const t = useT()\n // the first allowed menu page (RBAC-aware, `/` fallback); router is undefined outside a <RouterProvider>\n const { router, homeTo: resolvedTo } = useHomeTo(to)\n\n const canNavigate = !!router && resolvedTo != null\n const action =\n showAction && canNavigate ? (\n <Button size=\"sm\" onClick={() => router.navigate({ to: resolvedTo as LinkProps['to'] })}>\n {actionLabel ?? t('notFound.action')}\n </Button>\n ) : undefined\n\n return (\n <EmptyState\n ref={ref}\n icon={icon}\n title={title ?? t('notFound.title')}\n description={description ?? t('notFound.description')}\n action={action}\n {...props}\n />\n )\n})\n"],"names":["PageNotFound","forwardRef","icon","title","description","actionLabel","to","showAction","props","ref","useT","router","resolvedTo","useHomeTo","canNavigate","action","jsx","Button","EmptyState"],"mappings":"gOAuCaA,EAAeC,EAAAA,WAA8C,SACxE,CAAE,KAAAC,EAAO,eAAgB,MAAAC,EAAO,YAAAC,EAAa,YAAAC,EAAa,GAAAC,EAAI,WAAAC,EAAa,GAAM,GAAGC,CAAA,EACpFC,EACA,CACA,MAAM,EAAIC,EAAAA,KAAA,EAEJ,CAAE,OAAAC,EAAQ,OAAQC,CAAA,EAAeC,EAAAA,UAAUP,CAAE,EAE7CQ,EAAc,CAAC,CAACH,GAAUC,GAAc,KACxCG,EACJR,GAAcO,EACZE,EAAAA,IAACC,EAAAA,QAAO,KAAK,KAAK,QAAS,IAAMN,EAAO,SAAS,CAAE,GAAIC,EAA+B,EACnF,YAAe,EAAE,iBAAiB,EACrC,EACE,OAEN,OACEI,EAAAA,IAACE,EAAAA,WAAA,CACC,IAAAT,EACA,KAAAP,EACA,MAAOC,GAAS,EAAE,gBAAgB,EAClC,YAAaC,GAAe,EAAE,sBAAsB,EACpD,OAAAW,EACC,GAAGP,CAAA,CAAA,CAGV,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as l } from "react";
|
|
3
|
-
import { E as F } from "./EmptyState-
|
|
4
|
-
import { B as g } from "./Button-
|
|
5
|
-
import { u as v } from "./useHomeTo-
|
|
6
|
-
import { a as T } from "./ConfigProvider-
|
|
3
|
+
import { E as F } from "./EmptyState-BvAA5mYO.js";
|
|
4
|
+
import { B as g } from "./Button-BQ7jsm5P.js";
|
|
5
|
+
import { u as v } from "./useHomeTo-DVMyLZbb.js";
|
|
6
|
+
import { a as T } from "./ConfigProvider-DZMtq2Fz.js";
|
|
7
7
|
const j = l(function({ icon: e = "SearchStatus", title: i, description: a, actionLabel: s, to: m, showAction: u = !0, ...c }, d) {
|
|
8
8
|
const o = T(), { router: t, homeTo: n } = v(m), p = !!t && n != null, f = u && p ? /* @__PURE__ */ r(g, { size: "sm", onClick: () => t.navigate({ to: n }), children: s ?? o("notFound.action") }) : void 0;
|
|
9
9
|
return /* @__PURE__ */ r(
|
|
@@ -21,4 +21,4 @@ const j = l(function({ icon: e = "SearchStatus", title: i, description: a, actio
|
|
|
21
21
|
export {
|
|
22
22
|
j as P
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=PageNotFound-
|
|
24
|
+
//# sourceMappingURL=PageNotFound-DQ-OvU_O.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageNotFound-
|
|
1
|
+
{"version":3,"file":"PageNotFound-DQ-OvU_O.js","sources":["../src/components/PageNotFound/PageNotFound.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react'\nimport { type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { EmptyState, type EmptyStateSize } from '../EmptyState'\nimport { Button } from '../Button'\nimport type { IconName } from '../../icons/names'\nimport { useHomeTo } from './useHomeTo'\n\nexport interface PageNotFoundProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Hero glyph — an `IconName`, any node, or `false` to hide it. Defaults to `SearchStatus`. */\n icon?: IconName | ReactNode | false\n /** Heading. Defaults to the localized `notFound.title`. */\n title?: ReactNode\n /** Muted description. Defaults to the localized `notFound.description`. */\n description?: ReactNode\n /** Action button label. Defaults to the localized `notFound.action`. */\n actionLabel?: ReactNode\n /** Where the action navigates. Defaults to the first allowed menu page (RBAC-aware), else `/`. */\n to?: string\n /** Show the \"back home\" action button. Defaults to `true` (hidden anyway when there's no router). */\n showAction?: boolean\n /** Faded-grid hero backdrop — passed to `EmptyState`. Defaults to `true` (its default). */\n pattern?: boolean\n /** Size — passed to `EmptyState`. Defaults to `md`. */\n size?: EmptyStateSize\n}\n\n/**\n * The shared **404** page. Drop it straight into TanStack Router as the\n * `defaultNotFoundComponent` — zero props needed: the title/description/action strings come from the\n * built-in i18n (`useT`), so they translate with the panel language, and the action navigates to the\n * **first allowed menu page** (the same RBAC-aware target as `FirstRouteRedirect`), falling back to\n * `/`. Built on `EmptyState` (hero glyph + title + description + action, `pattern` on by default), so\n * it renders inside the `RootLayout` content area with the shell/sidebar intact. Lenient: with no\n * router context the `EmptyState` still renders, just without the action button. Token-only styling.\n *\n * @example\n * const router = createRouter({ routeTree, defaultNotFoundComponent: PageNotFound })\n */\nexport const PageNotFound = forwardRef<HTMLDivElement, PageNotFoundProps>(function PageNotFound(\n { icon = 'SearchStatus', title, description, actionLabel, to, showAction = true, ...props },\n ref,\n) {\n const t = useT()\n // the first allowed menu page (RBAC-aware, `/` fallback); router is undefined outside a <RouterProvider>\n const { router, homeTo: resolvedTo } = useHomeTo(to)\n\n const canNavigate = !!router && resolvedTo != null\n const action =\n showAction && canNavigate ? (\n <Button size=\"sm\" onClick={() => router.navigate({ to: resolvedTo as LinkProps['to'] })}>\n {actionLabel ?? t('notFound.action')}\n </Button>\n ) : undefined\n\n return (\n <EmptyState\n ref={ref}\n icon={icon}\n title={title ?? t('notFound.title')}\n description={description ?? t('notFound.description')}\n action={action}\n {...props}\n />\n )\n})\n"],"names":["PageNotFound","forwardRef","icon","title","description","actionLabel","to","showAction","props","ref","t","useT","router","resolvedTo","useHomeTo","canNavigate","action","jsx","Button","EmptyState"],"mappings":";;;;;;AAuCO,MAAMA,IAAeC,EAA8C,SACxE,EAAE,MAAAC,IAAO,gBAAgB,OAAAC,GAAO,aAAAC,GAAa,aAAAC,GAAa,IAAAC,GAAI,YAAAC,IAAa,IAAM,GAAGC,EAAA,GACpFC,GACA;AACA,QAAMC,IAAIC,EAAA,GAEJ,EAAE,QAAAC,GAAQ,QAAQC,EAAA,IAAeC,EAAUR,CAAE,GAE7CS,IAAc,CAAC,CAACH,KAAUC,KAAc,MACxCG,IACJT,KAAcQ,IACZ,gBAAAE,EAACC,KAAO,MAAK,MAAK,SAAS,MAAMN,EAAO,SAAS,EAAE,IAAIC,GAA+B,GACnF,eAAeH,EAAE,iBAAiB,GACrC,IACE;AAEN,SACE,gBAAAO;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,KAAAV;AAAA,MACA,MAAAP;AAAA,MACA,OAAOC,KAASO,EAAE,gBAAgB;AAAA,MAClC,aAAaN,KAAeM,EAAE,sBAAsB;AAAA,MACpD,QAAAM;AAAA,MACC,GAAGR;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as O } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as Q, useState as U } from "react";
|
|
3
3
|
import { clsx as d } from "clsx";
|
|
4
4
|
import { I as V } from "./Icon-CGQ5yGSZ.js";
|
|
5
|
-
import { a as W } from "./ConfigProvider-
|
|
5
|
+
import { a as W } from "./ConfigProvider-DZMtq2Fz.js";
|
|
6
6
|
const v = (s, i) => Array.from({ length: Math.max(i - s + 1, 0) }, (l, a) => s + a);
|
|
7
7
|
function X({
|
|
8
8
|
count: s,
|
|
@@ -136,4 +136,4 @@ const Y = "_pagination_5gbvi_3", Z = "_list_5gbvi_8", y = "_item_5gbvi_18", u =
|
|
|
136
136
|
export {
|
|
137
137
|
_a as P
|
|
138
138
|
};
|
|
139
|
-
//# sourceMappingURL=Pagination-
|
|
139
|
+
//# sourceMappingURL=Pagination-BjufY1mt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination-Df-F9i2o.js","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabel = 'Pagination',\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next/last glyphs are the left ones flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabel","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":";;;;;AAmBA,MAAMA,IAAQ,CAACC,GAAeC,MAC5B,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAIA,IAAMD,IAAQ,GAAG,CAAC,EAAA,GAAK,CAACE,GAAGC,MAAMH,IAAQG,CAAC;AAOnE,SAASC,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,eAAAC,IAAgB;AAClB,GAA6C;AAC3C,MAAIH,KAAS,EAAG,QAAO,CAAA;AAGvB,QAAMI,IAAaV,EAAM,GAAG,KAAK,IAAIS,GAAeH,CAAK,CAAC,GACpDK,IAAWX,EAAM,KAAK,IAAIM,IAAQG,IAAgB,GAAGA,IAAgB,CAAC,GAAGH,CAAK,GAG9EM,IAAgB,KAAK;AAAA,IACzB,KAAK,IAAIL,IAAOC,GAAcF,IAAQG,IAAgBD,IAAe,IAAI,CAAC;AAAA,IAC1EC,IAAgB;AAAA,EAAA,GAEZI,IAAc,KAAK;AAAA,IACvB,KAAK,IAAIN,IAAOC,GAAcC,IAAgBD,IAAe,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AE,kBAAkB,GAAG,GAAG,IAAOJ,KAAW,CAAC;AAAA,QAC3EQ;AAAA,UACC;AAAA,UACA;AAAA,UACAJ,EAAE,qBAAqB;AAAA,UACvBJ,IAAU;AAAA,UACVjB;AAAA,UACAiB,KAAW;AAAA,QAAA;AAAA,QAEZM,EAAM;AAAA,UAAI,CAACc,GAAMzD,MAChB,OAAOyD,KAAS,WACd,gBAAAL,EAAC,MAAA,EAAc,WAAWC,EAAO,MAC/B,UAAA,gBAAAD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAWE,EAAKD,EAAO,MAAMI,MAASpB,KAAWgB,EAAO,QAAQ;AAAA,cAChE,cAAYZ,EAAE,mBAAmB,EAAE,MAAMgB,GAAM;AAAA,cAC/C,gBAAcA,MAASpB,IAAU,SAAS;AAAA,cAC1C,UAAAX;AAAA,cACA,SAAS,MAAMY,EAAGmB,CAAI;AAAA,cAErB,UAAAA;AAAA,YAAA;AAAA,UAAA,EACH,GAVOA,CAWT,IAEA,gBAAAL,EAAC,QAAwB,WAAWC,EAAO,MAAM,eAAW,IAC1D,4BAAC,QAAA,EAAK,WAAWA,EAAO,UAAU,UAAA,IAAA,CAAC,KAD5B,GAAGI,CAAI,IAAIzD,CAAC,EAErB;AAAA,QAAA;AAAA,QAGH6C;AAAA,UACC;AAAA,UACA;AAAA,UACAJ,EAAE,iBAAiB;AAAA,UACnBJ,IAAU;AAAA,UACVhB;AAAA,UACAgB,KAAWnC;AAAA,UACX;AAAA,QAAA;AAAA,QAEDiB,KACC0B,EAAQ,QAAQ,QAAQJ,EAAE,iBAAiB,GAAGvC,GAAO,IAAOmC,KAAWnC,CAAK;AAAA,MAAA,EAAA,CAChF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Pagination-BjufY1mt.js","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabel = 'Pagination',\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next/last glyphs are the left ones flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabel","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":";;;;;AAmBA,MAAMA,IAAQ,CAACC,GAAeC,MAC5B,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAIA,IAAMD,IAAQ,GAAG,CAAC,EAAA,GAAK,CAACE,GAAGC,MAAMH,IAAQG,CAAC;AAOnE,SAASC,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,E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6C;AAAA,UACC;AAAA,UACA;AAAA,UACAJ,EAAE,iBAAiB;AAAA,UACnBJ,IAAU;AAAA,UACVhB;AAAA,UACAgB,KAAWnC;AAAA,UACX;AAAA,QAAA;AAAA,QAEDiB,KACC0B,EAAQ,QAAQ,QAAQJ,EAAE,iBAAiB,GAAGvC,GAAO,IAAOmC,KAAWnC,CAAK;AAAA,MAAA,EAAA,CAChF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),P=require("react"),d=require("clsx"),Q=require("./Icon-BUP5_kRs.cjs"),U=require("./ConfigProvider-
|
|
2
|
-
//# sourceMappingURL=Pagination-
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),P=require("react"),d=require("clsx"),Q=require("./Icon-BUP5_kRs.cjs"),U=require("./ConfigProvider-th4GYhcU.cjs"),v=(e,a)=>Array.from({length:Math.max(a-e+1,0)},(l,s)=>e+s);function V({count:e,page:a,siblingCount:l=1,boundaryCount:s=1}){if(e<=0)return[];const o=v(1,Math.min(s,e)),g=v(Math.max(e-s+1,s+1),e),p=Math.max(Math.min(a-l,e-s-l*2-1),s+2),m=Math.min(Math.max(a+l,s+l*2+2),g.length>0?g[0]-2:e-1);return[...o,...p>s+2?["start-ellipsis"]:s+1<e-s?[s+1]:[],...v(p,m),...m<e-s-1?["end-ellipsis"]:e-s>s?[e-s]:[],...g]}const W="_pagination_5gbvi_3",X="_list_5gbvi_8",Y="_item_5gbvi_18",Z="_sm_5gbvi_28",u="_md_5gbvi_33",y="_lg_5gbvi_38",C="_page_5gbvi_45",ss="_selected_5gbvi_64",es="_outlined_5gbvi_80",is="_rounded_5gbvi_96",as="_arrow_5gbvi_26",ts="_flip_5gbvi_107",ls="_ellipsis_5gbvi_112",i={pagination:W,list:X,item:Y,sm:Z,md:u,lg:y,page:C,selected:ss,outlined:es,rounded:is,arrow:as,flip:ts,ellipsis:ls},w=(e,a,l)=>Math.min(Math.max(e,a),l),ns=P.forwardRef(function({count:a,page:l,defaultPage:s=1,onChange:o,siblingCount:g=1,boundaryCount:p=1,showFirstButton:m=!1,showLastButton:q=!1,hidePrevButton:$=!1,hideNextButton:z=!1,variant:A="outlined",size:x="md",color:h="accent",rounded:I=!1,disabled:b=!1,className:R,style:S,"aria-label":k="Pagination",...L},E){const j=l!==void 0,[T,B]=P.useState(s),M=Math.max(a,1),n=w(j?l:T,1,M),N=t=>{const c=w(t,1,M);c!==n&&(j||B(c),o==null||o(c))},_=U.useT(),D=V({count:a,page:n,siblingCount:g,boundaryCount:p}),F={"--tz-btn-rgb":`var(--tz-color-${h}-rgb)`,"--tz-btn-on":`var(--tz-color-${h}-contrast, #fff)`,...S},f=(t,c,G,H,J,K,O=!1)=>J?null:r.jsx("li",{className:i.item,children:r.jsx("button",{type:"button",className:d.clsx(i.page,i.arrow),"aria-label":G,disabled:b||K,onClick:()=>N(H),children:r.jsx(Q.Icon,{name:c,size:x,className:O?i.flip:void 0})})},t);return r.jsx("nav",{ref:E,"aria-label":k,className:d.clsx(i.pagination,i[A],i[x],I&&i.rounded,R),style:F,...L,children:r.jsxs("ul",{className:i.list,children:[m&&f("first","Previous",_("pagination.first"),1,!1,n<=1),f("prev","ArrowLeft",_("pagination.previous"),n-1,$,n<=1),D.map((t,c)=>typeof t=="number"?r.jsx("li",{className:i.item,children:r.jsx("button",{type:"button",className:d.clsx(i.page,t===n&&i.selected),"aria-label":_("pagination.page",{page:t}),"aria-current":t===n?"page":void 0,disabled:b,onClick:()=>N(t),children:t})},t):r.jsx("li",{className:i.item,"aria-hidden":!0,children:r.jsx("span",{className:i.ellipsis,children:"…"})},`${t}-${c}`)),f("next","ArrowLeft",_("pagination.next"),n+1,z,n>=a,!0),q&&f("last","Next",_("pagination.last"),a,!1,n>=a)]})})});exports.Pagination=ns;
|
|
2
|
+
//# sourceMappingURL=Pagination-jLyJa8iL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination-BF8cmQMi.cjs","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabel = 'Pagination',\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next/last glyphs are the left ones flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabel","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":"mKAmBMA,EAAQ,CAACC,EAAeC,IAC5B,MAAM,KAAK,CAAE,OAAQ,KAAK,IAAIA,EAAMD,EAAQ,EAAG,CAAC,CAAA,EAAK,CAACE,EAAGC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AA,EAEF,MAAOiB,EACN,GAAGd,EAEJ,SAAA0B,EAAAA,KAAC,KAAA,CAAG,UAAWH,EAAO,KACnB,SAAA,CAAAnC,GACC2B,EAAQ,QAAS,WAAYJ,EAAE,kBAAkB,EAAG,EAAG,GAAOJ,GAAW,CAAC,EAC3EQ,EACC,OACA,YACAJ,EAAE,qBAAqB,EACvBJ,EAAU,EACVjB,EACAiB,GAAW,CAAA,EAEZM,EAAM,IAAI,CAACc,EAAMzD,IAChB,OAAOyD,GAAS,SACdL,EAAAA,IAAC,KAAA,CAAc,UAAWC,EAAO,KAC/B,SAAAD,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWE,EAAAA,KAAKD,EAAO,KAAMI,IAASpB,GAAWgB,EAAO,QAAQ,EAChE,aAAYZ,EAAE,kBAAmB,CAAE,KAAMgB,EAAM,EAC/C,eAAcA,IAASpB,EAAU,OAAS,OAC1C,SAAAX,EACA,QAAS,IAAMY,EAAGmB,CAAI,EAErB,SAAAA,CAAA,CAAA,CACH,EAVOA,CAWT,EAEAL,EAAAA,IAAC,MAAwB,UAAWC,EAAO,KAAM,cAAW,GAC1D,eAAC,OAAA,CAAK,UAAWA,EAAO,SAAU,SAAA,GAAA,CAAC,GAD5B,GAAGI,CAAI,IAAIzD,CAAC,EAErB,CAAA,EAGH6C,EACC,OACA,YACAJ,EAAE,iBAAiB,EACnBJ,EAAU,EACVhB,EACAgB,GAAWnC,EACX,EAAA,EAEDiB,GACC0B,EAAQ,OAAQ,OAAQJ,EAAE,iBAAiB,EAAGvC,EAAO,GAAOmC,GAAWnC,CAAK,CAAA,CAAA,CAChF,CAAA,CAAA,CAGN,CAAC"}
|
|
1
|
+
{"version":3,"file":"Pagination-jLyJa8iL.cjs","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabel = 'Pagination',\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next/last glyphs are the left ones flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabel","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":"mKAmBMA,EAAQ,CAACC,EAAeC,IAC5B,MAAM,KAAK,CAAE,OAAQ,KAAK,IAAIA,EAAMD,EAAQ,EAAG,CAAC,CAAA,EAAK,CAACE,EAAGC,IAAMH,EAAQG,CAAC,EAOnE,SAASC,EAAgB,CAC9B,MAAAC,EACA,KAAAC,EACA,aAAAC,EAAe,EACf,cAAAC,EAAgB,CAClB,EAA6C,CAC3C,GAAIH,GAAS,EAAG,MAAO,CAAA,EAGvB,MAAMI,EAAaV,EAAM,EAA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,EACC,OACA,YACAJ,EAAE,qBAAqB,EACvBJ,EAAU,EACVjB,EACAiB,GAAW,CAAA,EAEZM,EAAM,IAAI,CAACc,EAAMzD,IAChB,OAAOyD,GAAS,SACdL,EAAAA,IAAC,KAAA,CAAc,UAAWC,EAAO,KAC/B,SAAAD,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWE,EAAAA,KAAKD,EAAO,KAAMI,IAASpB,GAAWgB,EAAO,QAAQ,EAChE,aAAYZ,EAAE,kBAAmB,CAAE,KAAMgB,EAAM,EAC/C,eAAcA,IAASpB,EAAU,OAAS,OAC1C,SAAAX,EACA,QAAS,IAAMY,EAAGmB,CAAI,EAErB,SAAAA,CAAA,CAAA,CACH,EAVOA,CAWT,EAEAL,EAAAA,IAAC,MAAwB,UAAWC,EAAO,KAAM,cAAW,GAC1D,eAAC,OAAA,CAAK,UAAWA,EAAO,SAAU,SAAA,GAAA,CAAC,GAD5B,GAAGI,CAAI,IAAIzD,CAAC,EAErB,CAAA,EAGH6C,EACC,OACA,YACAJ,EAAE,iBAAiB,EACnBJ,EAAU,EACVhB,EACAgB,GAAWnC,EACX,EAAA,EAEDiB,GACC0B,EAAQ,OAAQ,OAAQJ,EAAE,iBAAiB,EAAGvC,EAAO,GAAOmC,GAAWnC,CAAK,CAAA,CAAA,CAChF,CAAA,CAAA,CAGN,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),l=require("react"),k=require("clsx"),y=require("./formContext-bTWrqdEV.cjs"),_=require("./ColorPicker-
|
|
2
|
-
//# sourceMappingURL=PaletteField-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("react"),k=require("clsx"),y=require("./formContext-bTWrqdEV.cjs"),_=require("./ColorPicker-C33dlkhN.cjs"),z=require("./ColorRamp-BJWNKzoX.cjs"),B="_root_bbykz_3",h={root:B},v=l.forwardRef(function({rampName:u,paletteOptions:a,rampSize:d="md",hideRamp:x=!1,opaque:m=!0,onCopyStep:f,value:o,defaultValue:s,onChange:r,name:t,className:q,style:C,...p},F){const c=y.useFormContext(),n=!!(c&&t),[P,j]=l.useState(s??""),R=o!==void 0?o:n?c.values[t]??"":P,b=i=>{o===void 0&&!n&&j(i),r==null||r(i)};return e.jsxs("div",{ref:F,className:k.clsx(h.root,q),style:C,children:[e.jsx(_.ColorPicker,{...p,name:t,value:o,defaultValue:s,onChange:b,alpha:!m}),!x&&e.jsx(z.ColorRamp,{baseColor:R,name:u??t??"color",options:a,size:d,onCopy:f})]})});exports.PaletteField=v;
|
|
2
|
+
//# sourceMappingURL=PaletteField-DGaV7VJ9.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaletteField-
|
|
1
|
+
{"version":3,"file":"PaletteField-DGaV7VJ9.cjs","sources":["../src/components/PaletteField/PaletteField.tsx"],"sourcesContent":["import { forwardRef, useState, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { GeneratePaletteOptions } from '../../helpers/palette'\nimport { ColorPicker, type ColorPickerProps } from '../ColorPicker'\nimport { ColorRamp, type ColorRampProps } from '../ColorRamp'\nimport styles from './PaletteField.module.css'\n\nexport interface PaletteFieldProps extends Omit<ColorPickerProps, 'swatches'> {\n /** Token prefix for the ramp (see `ColorRamp.name`). Defaults to `name`, then `'color'`. */\n rampName?: string\n /** `generatePalette` overrides, forwarded to the ramp. */\n paletteOptions?: GeneratePaletteOptions\n /** Ramp height (default `md`). */\n rampSize?: ColorRampProps['size']\n /** Hide the ramp (default `false`). */\n hideRamp?: boolean\n /** Brand colors are opaque: hide the alpha slider and emit `#rrggbb` only (default `true`). */\n opaque?: boolean\n /** Forwarded to the ramp's `onCopy`. */\n onCopyStep?: ColorRampProps['onCopy']\n className?: string\n style?: CSSProperties\n}\n\n/**\n * The composition every configurator page repeats: a **`ColorPicker`** with the **`ColorRamp`** of its\n * current value directly beneath, both bound to the same value. Works controlled (`value` +\n * `onChange`), uncontrolled (`defaultValue`), and inside `<Form>` by `name` — the ramp always reflects\n * the live field value (including `setValue` / `reset`), read through the same `useFormContext` binding\n * `ColorPicker` uses, so there is exactly one source of truth. `label` / `helperText` / `error` /\n * `required` go to the picker; the ramp shows no chrome of its own here (its bounds row stays).\n * `opaque` (default `true`) passes `alpha={false}` to the picker: no alpha slider, `#rrggbb` only.\n */\nexport const PaletteField = forwardRef<HTMLDivElement, PaletteFieldProps>(function PaletteField(\n {\n rampName,\n paletteOptions,\n rampSize = 'md',\n hideRamp = false,\n opaque = true,\n onCopyStep,\n value,\n defaultValue,\n onChange,\n name,\n className,\n style,\n ...picker\n },\n ref,\n) {\n // Mirror ColorPicker's own binding exactly: controlled prop → form value (by `name`) → internal state.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const current =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n\n const handleChange = (color: string) => {\n // the picker already writes the form value when bound; we only track the uncontrolled case\n if (value === undefined && !isFormBound) setInternal(color)\n onChange?.(color)\n }\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style}>\n <ColorPicker\n {...picker}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n alpha={!opaque}\n />\n {!hideRamp && (\n <ColorRamp\n baseColor={current}\n name={rampName ?? name ?? 'color'}\n options={paletteOptions}\n size={rampSize}\n onCopy={onCopyStep}\n />\n )}\n </div>\n )\n})\n"],"names":["PaletteField","forwardRef","rampName","paletteOptions","rampSize","hideRamp","opaque","onCopyStep","value","defaultValue","onChange","name","className","style","picker","ref","form","useFormContext","isFormBound","internal","setInternal","useState","current","handleChange","color","jsxs","clsx","styles","jsx","ColorPicker","ColorRamp"],"mappings":"0OAkCaA,EAAeC,EAAAA,WAA8C,SACxE,CACE,SAAAC,EACA,eAAAC,EACA,SAAAC,EAAW,KACX,SAAAC,EAAW,GACX,OAAAC,EAAS,GACT,WAAAC,EACA,MAAAC,EACA,aAAAC,EACA,SAAAC,EACA,KAAAC,EACA,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CAEA,MAAMC,EAAOC,EAAAA,eAAA,EACPC,EAAc,GAAQF,GAAQL,GAC9B,CAACQ,EAAUC,CAAW,EAAIC,EAAAA,SAAiBZ,GAAgB,EAAE,EAC7Da,EACJd,IAAU,OACNA,EACAU,EACIF,EAAM,OAAOL,CAAK,GAA4B,GAChDQ,EAEFI,EAAgBC,GAAkB,CAElChB,IAAU,QAAa,CAACU,KAAyBM,CAAK,EAC1Dd,GAAA,MAAAA,EAAWc,EACb,EAEA,OACEC,OAAC,OAAI,IAAAV,EAAU,UAAWW,EAAAA,KAAKC,EAAO,KAAMf,CAAS,EAAG,MAAAC,EACtD,SAAA,CAAAe,EAAAA,IAACC,EAAAA,YAAA,CACE,GAAGf,EACJ,KAAAH,EACA,MAAAH,EACA,aAAAC,EACA,SAAUc,EACV,MAAO,CAACjB,CAAA,CAAA,EAET,CAACD,GACAuB,EAAAA,IAACE,EAAAA,UAAA,CACC,UAAWR,EACX,KAAMpB,GAAYS,GAAQ,QAC1B,QAASR,EACT,KAAMC,EACN,OAAQG,CAAA,CAAA,CACV,EAEJ,CAEJ,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { jsxs as j, jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as k, useState as z } from "react";
|
|
3
3
|
import { clsx as B } from "clsx";
|
|
4
4
|
import { u as R } from "./formContext-B7ln1Miy.js";
|
|
5
|
-
import { C as h } from "./ColorPicker-
|
|
6
|
-
import { C as v } from "./ColorRamp-
|
|
5
|
+
import { C as h } from "./ColorPicker-BNM75F5E.js";
|
|
6
|
+
import { C as v } from "./ColorRamp-BnuXrSxa.js";
|
|
7
7
|
const w = "_root_bbykz_3", I = {
|
|
8
8
|
root: w
|
|
9
9
|
}, H = k(function({
|
|
@@ -51,4 +51,4 @@ const w = "_root_bbykz_3", I = {
|
|
|
51
51
|
export {
|
|
52
52
|
H as P
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=PaletteField-
|
|
54
|
+
//# sourceMappingURL=PaletteField-DTfV8Lny.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaletteField-
|
|
1
|
+
{"version":3,"file":"PaletteField-DTfV8Lny.js","sources":["../src/components/PaletteField/PaletteField.tsx"],"sourcesContent":["import { forwardRef, useState, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { GeneratePaletteOptions } from '../../helpers/palette'\nimport { ColorPicker, type ColorPickerProps } from '../ColorPicker'\nimport { ColorRamp, type ColorRampProps } from '../ColorRamp'\nimport styles from './PaletteField.module.css'\n\nexport interface PaletteFieldProps extends Omit<ColorPickerProps, 'swatches'> {\n /** Token prefix for the ramp (see `ColorRamp.name`). Defaults to `name`, then `'color'`. */\n rampName?: string\n /** `generatePalette` overrides, forwarded to the ramp. */\n paletteOptions?: GeneratePaletteOptions\n /** Ramp height (default `md`). */\n rampSize?: ColorRampProps['size']\n /** Hide the ramp (default `false`). */\n hideRamp?: boolean\n /** Brand colors are opaque: hide the alpha slider and emit `#rrggbb` only (default `true`). */\n opaque?: boolean\n /** Forwarded to the ramp's `onCopy`. */\n onCopyStep?: ColorRampProps['onCopy']\n className?: string\n style?: CSSProperties\n}\n\n/**\n * The composition every configurator page repeats: a **`ColorPicker`** with the **`ColorRamp`** of its\n * current value directly beneath, both bound to the same value. Works controlled (`value` +\n * `onChange`), uncontrolled (`defaultValue`), and inside `<Form>` by `name` — the ramp always reflects\n * the live field value (including `setValue` / `reset`), read through the same `useFormContext` binding\n * `ColorPicker` uses, so there is exactly one source of truth. `label` / `helperText` / `error` /\n * `required` go to the picker; the ramp shows no chrome of its own here (its bounds row stays).\n * `opaque` (default `true`) passes `alpha={false}` to the picker: no alpha slider, `#rrggbb` only.\n */\nexport const PaletteField = forwardRef<HTMLDivElement, PaletteFieldProps>(function PaletteField(\n {\n rampName,\n paletteOptions,\n rampSize = 'md',\n hideRamp = false,\n opaque = true,\n onCopyStep,\n value,\n defaultValue,\n onChange,\n name,\n className,\n style,\n ...picker\n },\n ref,\n) {\n // Mirror ColorPicker's own binding exactly: controlled prop → form value (by `name`) → internal state.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const current =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n\n const handleChange = (color: string) => {\n // the picker already writes the form value when bound; we only track the uncontrolled case\n if (value === undefined && !isFormBound) setInternal(color)\n onChange?.(color)\n }\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style}>\n <ColorPicker\n {...picker}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n alpha={!opaque}\n />\n {!hideRamp && (\n <ColorRamp\n baseColor={current}\n name={rampName ?? name ?? 'color'}\n options={paletteOptions}\n size={rampSize}\n onCopy={onCopyStep}\n />\n )}\n </div>\n )\n})\n"],"names":["PaletteField","forwardRef","rampName","paletteOptions","rampSize","hideRamp","opaque","onCopyStep","value","defaultValue","onChange","name","className","style","picker","ref","form","useFormContext","isFormBound","internal","setInternal","useState","current","handleChange","color","jsxs","clsx","styles","jsx","ColorPicker","ColorRamp"],"mappings":";;;;;;;;GAkCaA,IAAeC,EAA8C,SACxE;AAAA,EACE,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,QAAAC,IAAS;AAAA,EACT,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAEA,QAAMC,IAAOC,EAAA,GACPC,IAAc,GAAQF,KAAQL,IAC9B,CAACQ,GAAUC,CAAW,IAAIC,EAAiBZ,KAAgB,EAAE,GAC7Da,IACJd,MAAU,SACNA,IACAU,IACIF,EAAM,OAAOL,CAAK,KAA4B,KAChDQ,GAEFI,IAAe,CAACC,MAAkB;AAEtC,IAAIhB,MAAU,UAAa,CAACU,OAAyBM,CAAK,GAC1Dd,KAAA,QAAAA,EAAWc;AAAA,EACb;AAEA,SACE,gBAAAC,EAAC,SAAI,KAAAV,GAAU,WAAWW,EAAKC,EAAO,MAAMf,CAAS,GAAG,OAAAC,GACtD,UAAA;AAAA,IAAA,gBAAAe;AAAA,MAACC;AAAA,MAAA;AAAA,QACE,GAAGf;AAAA,QACJ,MAAAH;AAAA,QACA,OAAAH;AAAA,QACA,cAAAC;AAAA,QACA,UAAUc;AAAA,QACV,OAAO,CAACjB;AAAA,MAAA;AAAA,IAAA;AAAA,IAET,CAACD,KACA,gBAAAuB;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWR;AAAA,QACX,MAAMpB,KAAYS,KAAQ;AAAA,QAC1B,SAASR;AAAA,QACT,MAAMC;AAAA,QACN,QAAQG;AAAA,MAAA;AAAA,IAAA;AAAA,EACV,GAEJ;AAEJ,CAAC;"}
|
|
@@ -4,11 +4,11 @@ import { clsx as ne } from "clsx";
|
|
|
4
4
|
import { o as Ue, u as ke } from "./useOptionalPeer-49f3XcO5.js";
|
|
5
5
|
import { u as Ee } from "./formContext-B7ln1Miy.js";
|
|
6
6
|
import { I as Me } from "./Icon-CGQ5yGSZ.js";
|
|
7
|
-
import { T as Ve } from "./TextField-
|
|
8
|
-
import { u as We, O as je } from "./useOptionMenu-
|
|
9
|
-
import { T as pe } from "./Typography-
|
|
7
|
+
import { T as Ve } from "./TextField-otYGVuwF.js";
|
|
8
|
+
import { u as We, O as je } from "./useOptionMenu-DNYlfNO_.js";
|
|
9
|
+
import { T as pe } from "./Typography-ChSuxgkc.js";
|
|
10
10
|
import { f as y } from "./TextField.module-6gYcR9TL.js";
|
|
11
|
-
import { a as Be, u as Ge } from "./ConfigProvider-
|
|
11
|
+
import { a as Be, u as Ge } from "./ConfigProvider-DZMtq2Fz.js";
|
|
12
12
|
const Y = Ue(
|
|
13
13
|
"libphonenumber-js",
|
|
14
14
|
"PhoneField",
|
|
@@ -369,4 +369,4 @@ export {
|
|
|
369
369
|
vn as P,
|
|
370
370
|
gn as i
|
|
371
371
|
};
|
|
372
|
-
//# sourceMappingURL=PhoneField-
|
|
372
|
+
//# sourceMappingURL=PhoneField-BSIhBMW2.js.map
|