@techzyapp/ui-library 1.0.36 → 1.0.38

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.
Files changed (386) hide show
  1. package/README.md +16 -11
  2. package/dist/{AdminRoot-D97qDVTM.cjs → AdminRoot-DwQi_tM4.cjs} +2 -2
  3. package/dist/{AdminRoot-D97qDVTM.cjs.map → AdminRoot-DwQi_tM4.cjs.map} +1 -1
  4. package/dist/{AdminRoot-C_SNXQkB.js → AdminRoot-kGG0oPN_.js} +8 -8
  5. package/dist/{AdminRoot-C_SNXQkB.js.map → AdminRoot-kGG0oPN_.js.map} +1 -1
  6. package/dist/{Alert-CggrNMn5.cjs → Alert-B9gTeI7o.cjs} +2 -2
  7. package/dist/{Alert-CggrNMn5.cjs.map → Alert-B9gTeI7o.cjs.map} +1 -1
  8. package/dist/{Alert-BXtQFAVl.js → Alert-DXPlWb-U.js} +3 -3
  9. package/dist/{Alert-BXtQFAVl.js.map → Alert-DXPlWb-U.js.map} +1 -1
  10. package/dist/{Breadcrumbs-Cpa_LSY2.cjs → Breadcrumbs-ByFf228Q.cjs} +2 -2
  11. package/dist/{Breadcrumbs-Cpa_LSY2.cjs.map → Breadcrumbs-ByFf228Q.cjs.map} +1 -1
  12. package/dist/{Breadcrumbs-D_QnKw8q.js → Breadcrumbs-etqxqMJd.js} +3 -3
  13. package/dist/{Breadcrumbs-D_QnKw8q.js.map → Breadcrumbs-etqxqMJd.js.map} +1 -1
  14. package/dist/{Button-BQ7jsm5P.js → Button-Bst_NtPJ.js} +2 -2
  15. package/dist/{Button-BQ7jsm5P.js.map → Button-Bst_NtPJ.js.map} +1 -1
  16. package/dist/{Button-Cm64ROip.cjs → Button-CYZoF18-.cjs} +2 -2
  17. package/dist/{Button-Cm64ROip.cjs.map → Button-CYZoF18-.cjs.map} +1 -1
  18. package/dist/{Calendar-C2x9ZtPV.cjs → Calendar-CHflyWXY.cjs} +2 -2
  19. package/dist/{Calendar-C2x9ZtPV.cjs.map → Calendar-CHflyWXY.cjs.map} +1 -1
  20. package/dist/{Calendar-BrpJOBTt.js → Calendar-Dvb--s-e.js} +3 -3
  21. package/dist/{Calendar-BrpJOBTt.js.map → Calendar-Dvb--s-e.js.map} +1 -1
  22. package/dist/{Card-yhly3Xdp.cjs → Card-AibwIuoP.cjs} +2 -2
  23. package/dist/{Card-yhly3Xdp.cjs.map → Card-AibwIuoP.cjs.map} +1 -1
  24. package/dist/{Card-kizK1B7N.js → Card-Bar_wCiH.js} +2 -2
  25. package/dist/{Card-kizK1B7N.js.map → Card-Bar_wCiH.js.map} +1 -1
  26. package/dist/{Chip-BPcnO5WI.cjs → Chip-CeU3FxHU.cjs} +2 -2
  27. package/dist/{Chip-BPcnO5WI.cjs.map → Chip-CeU3FxHU.cjs.map} +1 -1
  28. package/dist/{Chip-BzyzLEeX.js → Chip-_8JWFrHv.js} +2 -2
  29. package/dist/{Chip-BzyzLEeX.js.map → Chip-_8JWFrHv.js.map} +1 -1
  30. package/dist/{CodeBlock-BTt40oh5.js → CodeBlock-CbJxxBn0.js} +3 -3
  31. package/dist/{CodeBlock-BTt40oh5.js.map → CodeBlock-CbJxxBn0.js.map} +1 -1
  32. package/dist/{CodeBlock-BgSum_bB.cjs → CodeBlock-b7PyuuI7.cjs} +2 -2
  33. package/dist/{CodeBlock-BgSum_bB.cjs.map → CodeBlock-b7PyuuI7.cjs.map} +1 -1
  34. package/dist/{ColorPicker-C33dlkhN.cjs → ColorPicker-CuaBgOPo.cjs} +2 -2
  35. package/dist/{ColorPicker-C33dlkhN.cjs.map → ColorPicker-CuaBgOPo.cjs.map} +1 -1
  36. package/dist/{ColorPicker-BNM75F5E.js → ColorPicker-DTh0w9rX.js} +3 -3
  37. package/dist/{ColorPicker-BNM75F5E.js.map → ColorPicker-DTh0w9rX.js.map} +1 -1
  38. package/dist/{ColorPickerPanel-BZ_ZNu2B.cjs → ColorPickerPanel-D5kmpmJM.cjs} +2 -2
  39. package/dist/{ColorPickerPanel-BZ_ZNu2B.cjs.map → ColorPickerPanel-D5kmpmJM.cjs.map} +1 -1
  40. package/dist/{ColorPickerPanel-Bh1K0YS8.js → ColorPickerPanel-yTEfn38g.js} +2 -2
  41. package/dist/{ColorPickerPanel-Bh1K0YS8.js.map → ColorPickerPanel-yTEfn38g.js.map} +1 -1
  42. package/dist/{ColorRamp-BJWNKzoX.cjs → ColorRamp-B_-ZPqMa.cjs} +2 -2
  43. package/dist/{ColorRamp-BJWNKzoX.cjs.map → ColorRamp-B_-ZPqMa.cjs.map} +1 -1
  44. package/dist/{ColorRamp-BnuXrSxa.js → ColorRamp-CCfImssD.js} +2 -2
  45. package/dist/{ColorRamp-BnuXrSxa.js.map → ColorRamp-CCfImssD.js.map} +1 -1
  46. package/dist/{ConfigProvider-th4GYhcU.cjs → ConfigProvider-B_Bb6pk1.cjs} +2 -2
  47. package/dist/ConfigProvider-B_Bb6pk1.cjs.map +1 -0
  48. package/dist/{ConfigProvider-DZMtq2Fz.js → ConfigProvider-DeMASTVo.js} +2 -2
  49. package/dist/ConfigProvider-DeMASTVo.js.map +1 -0
  50. package/dist/{CopyButton-C9oHGs6W.cjs → CopyButton-DZ3pdgfJ.cjs} +2 -2
  51. package/dist/{CopyButton-C9oHGs6W.cjs.map → CopyButton-DZ3pdgfJ.cjs.map} +1 -1
  52. package/dist/{CopyButton-hZqLdXJq.js → CopyButton-kZ8hJbqK.js} +3 -3
  53. package/dist/{CopyButton-hZqLdXJq.js.map → CopyButton-kZ8hJbqK.js.map} +1 -1
  54. package/dist/{DatePicker-DXwJB4MH.cjs → DatePicker-BXywGXmV.cjs} +2 -2
  55. package/dist/{DatePicker-DXwJB4MH.cjs.map → DatePicker-BXywGXmV.cjs.map} +1 -1
  56. package/dist/{DatePicker-B6ZL_T-E.js → DatePicker-CnMYmi0M.js} +4 -4
  57. package/dist/{DatePicker-B6ZL_T-E.js.map → DatePicker-CnMYmi0M.js.map} +1 -1
  58. package/dist/{DateTimePicker-BynW1Eeg.js → DateTimePicker-Cu8kcOtZ.js} +7 -7
  59. package/dist/{DateTimePicker-BynW1Eeg.js.map → DateTimePicker-Cu8kcOtZ.js.map} +1 -1
  60. package/dist/{DateTimePicker-CHi1H2k1.cjs → DateTimePicker-DrjYq5Bt.cjs} +2 -2
  61. package/dist/{DateTimePicker-CHi1H2k1.cjs.map → DateTimePicker-DrjYq5Bt.cjs.map} +1 -1
  62. package/dist/{DescriptionList-BqYwp08t.cjs → DescriptionList-DR9NTjaH.cjs} +2 -2
  63. package/dist/{DescriptionList-BqYwp08t.cjs.map → DescriptionList-DR9NTjaH.cjs.map} +1 -1
  64. package/dist/{DescriptionList-C6Gfk6I_.js → DescriptionList-DrvYmivR.js} +4 -4
  65. package/dist/{DescriptionList-C6Gfk6I_.js.map → DescriptionList-DrvYmivR.js.map} +1 -1
  66. package/dist/{EmptyState-CZ6X5-Zy.cjs → EmptyState-DIrXPui9.cjs} +2 -2
  67. package/dist/{EmptyState-CZ6X5-Zy.cjs.map → EmptyState-DIrXPui9.cjs.map} +1 -1
  68. package/dist/{EmptyState-BvAA5mYO.js → EmptyState-pUe8qBT5.js} +2 -2
  69. package/dist/{EmptyState-BvAA5mYO.js.map → EmptyState-pUe8qBT5.js.map} +1 -1
  70. package/dist/{ErrorBoundary-BS0x9RVO.js → ErrorBoundary-CLz5rsOJ.js} +3 -3
  71. package/dist/{ErrorBoundary-BS0x9RVO.js.map → ErrorBoundary-CLz5rsOJ.js.map} +1 -1
  72. package/dist/{ErrorBoundary-WwmJrL6o.cjs → ErrorBoundary-DtZn1K4r.cjs} +2 -2
  73. package/dist/{ErrorBoundary-WwmJrL6o.cjs.map → ErrorBoundary-DtZn1K4r.cjs.map} +1 -1
  74. package/dist/{ErrorState-DRXuV6na.cjs → ErrorState-Dtqznchj.cjs} +2 -2
  75. package/dist/{ErrorState-DRXuV6na.cjs.map → ErrorState-Dtqznchj.cjs.map} +1 -1
  76. package/dist/{ErrorState-BTSGKrJq.js → ErrorState-kdqkurmw.js} +7 -7
  77. package/dist/{ErrorState-BTSGKrJq.js.map → ErrorState-kdqkurmw.js.map} +1 -1
  78. package/dist/{FileCard-ZZNd_tUN.cjs → FileCard-19jrdC37.cjs} +2 -2
  79. package/dist/{FileCard-ZZNd_tUN.cjs.map → FileCard-19jrdC37.cjs.map} +1 -1
  80. package/dist/{FileCard-CxZ3o4BO.js → FileCard-flhEr03R.js} +3 -3
  81. package/dist/{FileCard-CxZ3o4BO.js.map → FileCard-flhEr03R.js.map} +1 -1
  82. package/dist/{FileUploader-CPah0hUe.js → FileUploader-CdBbl4os.js} +5 -5
  83. package/dist/{FileUploader-CPah0hUe.js.map → FileUploader-CdBbl4os.js.map} +1 -1
  84. package/dist/{FileUploader-B--hPV3b.cjs → FileUploader-Cha5mtqm.cjs} +2 -2
  85. package/dist/{FileUploader-B--hPV3b.cjs.map → FileUploader-Cha5mtqm.cjs.map} +1 -1
  86. package/dist/{Flag-DikEV1jI.js → Flag-DfA2t0yd.js} +2 -2
  87. package/dist/{Flag-DikEV1jI.js.map → Flag-DfA2t0yd.js.map} +1 -1
  88. package/dist/{Flag-C4La35rA.cjs → Flag-Do7x-AhS.cjs} +2 -2
  89. package/dist/{Flag-C4La35rA.cjs.map → Flag-Do7x-AhS.cjs.map} +1 -1
  90. package/dist/{FullscreenToggle-ejjFFd9a.cjs → FullscreenToggle-CIY7Anek.cjs} +2 -2
  91. package/dist/{FullscreenToggle-ejjFFd9a.cjs.map → FullscreenToggle-CIY7Anek.cjs.map} +1 -1
  92. package/dist/{FullscreenToggle-CTt7_Kv_.js → FullscreenToggle-CjirSJ6w.js} +3 -3
  93. package/dist/{FullscreenToggle-CTt7_Kv_.js.map → FullscreenToggle-CjirSJ6w.js.map} +1 -1
  94. package/dist/{IconButton-BUmXN_lD.js → IconButton-06pmftMo.js} +2 -2
  95. package/dist/{IconButton-BUmXN_lD.js.map → IconButton-06pmftMo.js.map} +1 -1
  96. package/dist/{IconButton-CYMvszcM.cjs → IconButton-CQ25TtBc.cjs} +2 -2
  97. package/dist/{IconButton-CYMvszcM.cjs.map → IconButton-CQ25TtBc.cjs.map} +1 -1
  98. package/dist/{Loader-DkwiCGbB.cjs → Loader-B5Pm8AaT.cjs} +2 -2
  99. package/dist/{Loader-DkwiCGbB.cjs.map → Loader-B5Pm8AaT.cjs.map} +1 -1
  100. package/dist/{Loader-jh7XMRhy.js → Loader-Bj5uwVR9.js} +2 -2
  101. package/dist/{Loader-jh7XMRhy.js.map → Loader-Bj5uwVR9.js.map} +1 -1
  102. package/dist/{LocationPicker-D-9mrCVD.cjs → LocationPicker-By3yMkOw.cjs} +2 -2
  103. package/dist/{LocationPicker-D-9mrCVD.cjs.map → LocationPicker-By3yMkOw.cjs.map} +1 -1
  104. package/dist/{LocationPicker-Cdm7BCX5.js → LocationPicker-D3jkpcIF.js} +6 -6
  105. package/dist/{LocationPicker-Cdm7BCX5.js.map → LocationPicker-D3jkpcIF.js.map} +1 -1
  106. package/dist/{Modal-CrvOHbNy.js → Modal-CDpWnBEB.js} +3 -3
  107. package/dist/{Modal-CrvOHbNy.js.map → Modal-CDpWnBEB.js.map} +1 -1
  108. package/dist/{Modal-eI6QL-LM.cjs → Modal-Df5Yc6CM.cjs} +2 -2
  109. package/dist/{Modal-eI6QL-LM.cjs.map → Modal-Df5Yc6CM.cjs.map} +1 -1
  110. package/dist/{MultiSelect-B_Jenpgv.cjs → MultiSelect-BoHvTTDJ.cjs} +2 -2
  111. package/dist/{MultiSelect-B_Jenpgv.cjs.map → MultiSelect-BoHvTTDJ.cjs.map} +1 -1
  112. package/dist/{MultiSelect-BTilYrXp.js → MultiSelect-DfVKZFX4.js} +4 -4
  113. package/dist/{MultiSelect-BTilYrXp.js.map → MultiSelect-DfVKZFX4.js.map} +1 -1
  114. package/dist/{NumberField-DEoaxFJj.js → NumberField-DU2oXSV3.js} +3 -3
  115. package/dist/{NumberField-DEoaxFJj.js.map → NumberField-DU2oXSV3.js.map} +1 -1
  116. package/dist/{NumberField-czWHuAyt.cjs → NumberField-vxOxw9m8.cjs} +2 -2
  117. package/dist/{NumberField-czWHuAyt.cjs.map → NumberField-vxOxw9m8.cjs.map} +1 -1
  118. package/dist/{OtpField-v2RuXdsE.js → OtpField-Dy4O1MeD.js} +2 -2
  119. package/dist/{OtpField-v2RuXdsE.js.map → OtpField-Dy4O1MeD.js.map} +1 -1
  120. package/dist/{OtpField-DK5KikOt.cjs → OtpField-OdkuKKcV.cjs} +2 -2
  121. package/dist/{OtpField-DK5KikOt.cjs.map → OtpField-OdkuKKcV.cjs.map} +1 -1
  122. package/dist/{PageError-CyMdVrxL.js → PageError-BHz8iTw2.js} +5 -5
  123. package/dist/{PageError-CyMdVrxL.js.map → PageError-BHz8iTw2.js.map} +1 -1
  124. package/dist/{PageError-CIVYNLTW.cjs → PageError-C0vYP2PL.cjs} +2 -2
  125. package/dist/{PageError-CIVYNLTW.cjs.map → PageError-C0vYP2PL.cjs.map} +1 -1
  126. package/dist/PageLayout-B4iX-IWD.js +37 -0
  127. package/dist/PageLayout-B4iX-IWD.js.map +1 -0
  128. package/dist/PageLayout-c9GL3nhJ.cjs +2 -0
  129. package/dist/PageLayout-c9GL3nhJ.cjs.map +1 -0
  130. package/dist/{PageNotFound-B-Ewl9a2.cjs → PageNotFound-B9nBGn4h.cjs} +2 -2
  131. package/dist/PageNotFound-B9nBGn4h.cjs.map +1 -0
  132. package/dist/{PageNotFound-B6jcXPba.js → PageNotFound-D1wFU9SN.js} +5 -5
  133. package/dist/PageNotFound-D1wFU9SN.js.map +1 -0
  134. package/dist/{Pagination-jLyJa8iL.cjs → Pagination-oLQcSMaO.cjs} +2 -2
  135. package/dist/{Pagination-jLyJa8iL.cjs.map → Pagination-oLQcSMaO.cjs.map} +1 -1
  136. package/dist/{Pagination-BjufY1mt.js → Pagination-sCDknGdJ.js} +2 -2
  137. package/dist/{Pagination-BjufY1mt.js.map → Pagination-sCDknGdJ.js.map} +1 -1
  138. package/dist/{PaletteField-DTfV8Lny.js → PaletteField-B9k607Dt.js} +3 -3
  139. package/dist/{PaletteField-DTfV8Lny.js.map → PaletteField-B9k607Dt.js.map} +1 -1
  140. package/dist/{PaletteField-DGaV7VJ9.cjs → PaletteField-BIRTMSbB.cjs} +2 -2
  141. package/dist/{PaletteField-DGaV7VJ9.cjs.map → PaletteField-BIRTMSbB.cjs.map} +1 -1
  142. package/dist/{PhoneField-DchrnSiE.cjs → PhoneField-CifOd98q.cjs} +2 -2
  143. package/dist/{PhoneField-DchrnSiE.cjs.map → PhoneField-CifOd98q.cjs.map} +1 -1
  144. package/dist/{PhoneField-BSIhBMW2.js → PhoneField-ql9eYaCh.js} +4 -4
  145. package/dist/{PhoneField-BSIhBMW2.js.map → PhoneField-ql9eYaCh.js.map} +1 -1
  146. package/dist/{Popconfirm-l9au66oY.cjs → Popconfirm-BctHVuvL.cjs} +2 -2
  147. package/dist/{Popconfirm-l9au66oY.cjs.map → Popconfirm-BctHVuvL.cjs.map} +1 -1
  148. package/dist/{Popconfirm-p2O8Vmz0.js → Popconfirm-C4WiB80U.js} +3 -3
  149. package/dist/{Popconfirm-p2O8Vmz0.js.map → Popconfirm-C4WiB80U.js.map} +1 -1
  150. package/dist/{Progress-Cqr2_BF1.cjs → Progress-BABBBG2y.cjs} +2 -2
  151. package/dist/{Progress-Cqr2_BF1.cjs.map → Progress-BABBBG2y.cjs.map} +1 -1
  152. package/dist/{Progress-C-VGs3yJ.js → Progress-ZNQrxw_Q.js} +2 -2
  153. package/dist/{Progress-C-VGs3yJ.js.map → Progress-ZNQrxw_Q.js.map} +1 -1
  154. package/dist/{RemoveDialog-eGCbOuuM.cjs → RemoveDialog-CB9Aq6KI.cjs} +2 -2
  155. package/dist/{RemoveDialog-eGCbOuuM.cjs.map → RemoveDialog-CB9Aq6KI.cjs.map} +1 -1
  156. package/dist/{RemoveDialog-BKgWohkG.js → RemoveDialog-DoYsfSWp.js} +5 -5
  157. package/dist/{RemoveDialog-BKgWohkG.js.map → RemoveDialog-DoYsfSWp.js.map} +1 -1
  158. package/dist/{RichTextEditor-C24uBIWh.js → RichTextEditor-B0V6OmlD.js} +7 -7
  159. package/dist/{RichTextEditor-C24uBIWh.js.map → RichTextEditor-B0V6OmlD.js.map} +1 -1
  160. package/dist/{RichTextEditor-BPAD4ISz.cjs → RichTextEditor-CJKfX0FP.cjs} +2 -2
  161. package/dist/{RichTextEditor-BPAD4ISz.cjs.map → RichTextEditor-CJKfX0FP.cjs.map} +1 -1
  162. package/dist/RootLayout-Dy6Llv-I.cjs +2 -0
  163. package/dist/RootLayout-Dy6Llv-I.cjs.map +1 -0
  164. package/dist/RootLayout-fsVJvS8l.js +582 -0
  165. package/dist/RootLayout-fsVJvS8l.js.map +1 -0
  166. package/dist/{Select-BbgueWwN.cjs → Select-It6dlL1v.cjs} +2 -2
  167. package/dist/{Select-BbgueWwN.cjs.map → Select-It6dlL1v.cjs.map} +1 -1
  168. package/dist/{Select-DEi_ZUHR.js → Select-TVfg_miK.js} +3 -3
  169. package/dist/{Select-DEi_ZUHR.js.map → Select-TVfg_miK.js.map} +1 -1
  170. package/dist/Sidebar-C4i3P_Lu.cjs +2 -0
  171. package/dist/Sidebar-C4i3P_Lu.cjs.map +1 -0
  172. package/dist/Sidebar-Cn2yCsG-.js +520 -0
  173. package/dist/Sidebar-Cn2yCsG-.js.map +1 -0
  174. package/dist/SpeedDial-B12OzpQt.js +178 -0
  175. package/dist/SpeedDial-B12OzpQt.js.map +1 -0
  176. package/dist/SpeedDial-Nvp31Ey3.cjs +2 -0
  177. package/dist/SpeedDial-Nvp31Ey3.cjs.map +1 -0
  178. package/dist/{Stepper-D8bRyyhl.js → Stepper-D7TdotAi.js} +2 -2
  179. package/dist/{Stepper-D8bRyyhl.js.map → Stepper-D7TdotAi.js.map} +1 -1
  180. package/dist/{Stepper-BRksGDK1.cjs → Stepper-YhyHUGhS.cjs} +2 -2
  181. package/dist/{Stepper-BRksGDK1.cjs.map → Stepper-YhyHUGhS.cjs.map} +1 -1
  182. package/dist/{Table-CGIip6UL.cjs → Table-Be6MMn0w.cjs} +2 -2
  183. package/dist/{Table-CGIip6UL.cjs.map → Table-Be6MMn0w.cjs.map} +1 -1
  184. package/dist/{Table-C0RDylA0.js → Table-D1_ErbiM.js} +15 -15
  185. package/dist/{Table-C0RDylA0.js.map → Table-D1_ErbiM.js.map} +1 -1
  186. package/dist/{Tabs-CQvfqazt.js → Tabs--NEoH5tq.js} +2 -2
  187. package/dist/{Tabs-CQvfqazt.js.map → Tabs--NEoH5tq.js.map} +1 -1
  188. package/dist/{Tabs-BzbSNmBj.cjs → Tabs-DWV0p55U.cjs} +2 -2
  189. package/dist/{Tabs-BzbSNmBj.cjs.map → Tabs-DWV0p55U.cjs.map} +1 -1
  190. package/dist/{TagsField-BdM-xre0.js → TagsField-C2RRJY8B.js} +4 -4
  191. package/dist/{TagsField-BdM-xre0.js.map → TagsField-C2RRJY8B.js.map} +1 -1
  192. package/dist/{TagsField-CGL1oI7b.cjs → TagsField-CP6gZJj2.cjs} +2 -2
  193. package/dist/{TagsField-CGL1oI7b.cjs.map → TagsField-CP6gZJj2.cjs.map} +1 -1
  194. package/dist/{TextField-otYGVuwF.js → TextField-Drb9cu7s.js} +3 -3
  195. package/dist/{TextField-otYGVuwF.js.map → TextField-Drb9cu7s.js.map} +1 -1
  196. package/dist/{TextField-D49Lpbjt.cjs → TextField-XdJ5bxGN.cjs} +2 -2
  197. package/dist/{TextField-D49Lpbjt.cjs.map → TextField-XdJ5bxGN.cjs.map} +1 -1
  198. package/dist/{ThemeToggle-D33Tqv2F.js → ThemeToggle-Bmx6I9qM.js} +3 -3
  199. package/dist/{ThemeToggle-D33Tqv2F.js.map → ThemeToggle-Bmx6I9qM.js.map} +1 -1
  200. package/dist/{ThemeToggle-B8rkRTis.cjs → ThemeToggle-n3I_o6Qm.cjs} +2 -2
  201. package/dist/{ThemeToggle-B8rkRTis.cjs.map → ThemeToggle-n3I_o6Qm.cjs.map} +1 -1
  202. package/dist/{TimeColumns-DyjTpZbD.js → TimeColumns-BE1sLoRV.js} +2 -2
  203. package/dist/{TimeColumns-DyjTpZbD.js.map → TimeColumns-BE1sLoRV.js.map} +1 -1
  204. package/dist/{TimeColumns-qEHHZC1N.cjs → TimeColumns-DkJsIu1w.cjs} +2 -2
  205. package/dist/{TimeColumns-qEHHZC1N.cjs.map → TimeColumns-DkJsIu1w.cjs.map} +1 -1
  206. package/dist/{TimePicker-DJrNO01U.cjs → TimePicker-Bv3lBZPP.cjs} +2 -2
  207. package/dist/{TimePicker-DJrNO01U.cjs.map → TimePicker-Bv3lBZPP.cjs.map} +1 -1
  208. package/dist/{TimePicker-yfYqLbj3.js → TimePicker-DC7x-szU.js} +5 -5
  209. package/dist/{TimePicker-yfYqLbj3.js.map → TimePicker-DC7x-szU.js.map} +1 -1
  210. package/dist/{Toaster-D8cxkhwr.js → Toaster-C_3REdVz.js} +2 -2
  211. package/dist/{Toaster-D8cxkhwr.js.map → Toaster-C_3REdVz.js.map} +1 -1
  212. package/dist/{Toaster-B7Xd2IaM.cjs → Toaster-CyWSt38Y.cjs} +2 -2
  213. package/dist/{Toaster-B7Xd2IaM.cjs.map → Toaster-CyWSt38Y.cjs.map} +1 -1
  214. package/dist/{TranslatedFields-CsSsTrnF.js → TranslatedFields-C58exJpw.js} +5 -5
  215. package/dist/{TranslatedFields-CsSsTrnF.js.map → TranslatedFields-C58exJpw.js.map} +1 -1
  216. package/dist/{TranslatedFields-BvqqdNWz.cjs → TranslatedFields-Pa4fR2P_.cjs} +2 -2
  217. package/dist/{TranslatedFields-BvqqdNWz.cjs.map → TranslatedFields-Pa4fR2P_.cjs.map} +1 -1
  218. package/dist/{UserCard-Die7JV4z.cjs → UserCard-DrJIl-gD.cjs} +2 -2
  219. package/dist/{UserCard-Die7JV4z.cjs.map → UserCard-DrJIl-gD.cjs.map} +1 -1
  220. package/dist/{UserCard-CsZ4Ogac.js → UserCard-eiY2q0lu.js} +3 -3
  221. package/dist/{UserCard-CsZ4Ogac.js.map → UserCard-eiY2q0lu.js.map} +1 -1
  222. package/dist/components/Alert/index.cjs +1 -1
  223. package/dist/components/Alert/index.js +1 -1
  224. package/dist/components/Breadcrumbs/index.cjs +1 -1
  225. package/dist/components/Breadcrumbs/index.js +1 -1
  226. package/dist/components/Button/index.cjs +1 -1
  227. package/dist/components/Button/index.js +1 -1
  228. package/dist/components/Card/index.cjs +1 -1
  229. package/dist/components/Card/index.js +1 -1
  230. package/dist/components/Chip/index.cjs +1 -1
  231. package/dist/components/Chip/index.js +1 -1
  232. package/dist/components/CodeBlock/index.cjs +1 -1
  233. package/dist/components/CodeBlock/index.js +1 -1
  234. package/dist/components/ColorPicker/index.cjs +1 -1
  235. package/dist/components/ColorPicker/index.js +1 -1
  236. package/dist/components/ColorRamp/index.cjs +1 -1
  237. package/dist/components/ColorRamp/index.js +1 -1
  238. package/dist/components/CopyButton/index.cjs +1 -1
  239. package/dist/components/CopyButton/index.js +1 -1
  240. package/dist/components/DatePicker/index.cjs +1 -1
  241. package/dist/components/DatePicker/index.js +1 -1
  242. package/dist/components/DateTimePicker/index.cjs +1 -1
  243. package/dist/components/DateTimePicker/index.js +1 -1
  244. package/dist/components/DescriptionList/index.cjs +1 -1
  245. package/dist/components/DescriptionList/index.js +1 -1
  246. package/dist/components/EmptyState/index.cjs +1 -1
  247. package/dist/components/EmptyState/index.js +1 -1
  248. package/dist/components/ErrorState/index.cjs +1 -1
  249. package/dist/components/ErrorState/index.js +2 -2
  250. package/dist/components/FileCard/index.cjs +1 -1
  251. package/dist/components/FileCard/index.js +1 -1
  252. package/dist/components/FileUploader/index.cjs +1 -1
  253. package/dist/components/FileUploader/index.js +1 -1
  254. package/dist/components/Flag/index.cjs +1 -1
  255. package/dist/components/Flag/index.js +1 -1
  256. package/dist/components/FullscreenToggle/index.cjs +1 -1
  257. package/dist/components/FullscreenToggle/index.js +1 -1
  258. package/dist/components/IconButton/index.cjs +1 -1
  259. package/dist/components/IconButton/index.js +1 -1
  260. package/dist/components/Loader/index.cjs +1 -1
  261. package/dist/components/Loader/index.js +1 -1
  262. package/dist/components/LocationPicker/index.cjs +1 -1
  263. package/dist/components/LocationPicker/index.js +1 -1
  264. package/dist/components/Modal/index.cjs +1 -1
  265. package/dist/components/Modal/index.js +1 -1
  266. package/dist/components/MultiSelect/index.cjs +1 -1
  267. package/dist/components/MultiSelect/index.js +1 -1
  268. package/dist/components/NumberField/index.cjs +1 -1
  269. package/dist/components/NumberField/index.js +1 -1
  270. package/dist/components/OtpField/index.cjs +1 -1
  271. package/dist/components/OtpField/index.js +1 -1
  272. package/dist/components/PageError/index.cjs +1 -1
  273. package/dist/components/PageError/index.js +1 -1
  274. package/dist/components/PageLayout/PageLayout.d.cts +25 -6
  275. package/dist/components/PageLayout/PageLayout.d.ts +25 -6
  276. package/dist/components/PageLayout/index.cjs +1 -1
  277. package/dist/components/PageLayout/index.js +1 -1
  278. package/dist/components/PageNotFound/PageNotFound.d.cts +2 -2
  279. package/dist/components/PageNotFound/PageNotFound.d.ts +2 -2
  280. package/dist/components/PageNotFound/index.cjs +1 -1
  281. package/dist/components/PageNotFound/index.js +1 -1
  282. package/dist/components/Pagination/index.cjs +1 -1
  283. package/dist/components/Pagination/index.js +1 -1
  284. package/dist/components/PaletteField/index.cjs +1 -1
  285. package/dist/components/PaletteField/index.js +1 -1
  286. package/dist/components/PhoneField/index.cjs +1 -1
  287. package/dist/components/PhoneField/index.js +1 -1
  288. package/dist/components/Popconfirm/index.cjs +1 -1
  289. package/dist/components/Popconfirm/index.js +1 -1
  290. package/dist/components/Progress/index.cjs +1 -1
  291. package/dist/components/Progress/index.js +1 -1
  292. package/dist/components/RemoveDialog/index.cjs +1 -1
  293. package/dist/components/RemoveDialog/index.js +1 -1
  294. package/dist/components/RichTextEditor/index.cjs +1 -1
  295. package/dist/components/RichTextEditor/index.js +1 -1
  296. package/dist/components/RootLayout/RootLayout.d.cts +5 -8
  297. package/dist/components/RootLayout/RootLayout.d.ts +5 -8
  298. package/dist/components/RootLayout/index.cjs +1 -1
  299. package/dist/components/RootLayout/index.js +1 -1
  300. package/dist/components/Select/index.cjs +1 -1
  301. package/dist/components/Select/index.js +1 -1
  302. package/dist/components/Sidebar/Sidebar.d.cts +14 -96
  303. package/dist/components/Sidebar/Sidebar.d.ts +14 -96
  304. package/dist/components/Sidebar/index.cjs +1 -1
  305. package/dist/components/Sidebar/index.d.cts +0 -1
  306. package/dist/components/Sidebar/index.d.ts +0 -1
  307. package/dist/components/Sidebar/index.js +1 -1
  308. package/dist/components/SpeedDial/SpeedDial.d.cts +2 -0
  309. package/dist/components/SpeedDial/SpeedDial.d.ts +2 -0
  310. package/dist/components/SpeedDial/SpeedDialAction.d.cts +6 -0
  311. package/dist/components/SpeedDial/SpeedDialAction.d.ts +6 -0
  312. package/dist/components/SpeedDial/index.cjs +1 -1
  313. package/dist/components/SpeedDial/index.js +1 -1
  314. package/dist/components/Stepper/index.cjs +1 -1
  315. package/dist/components/Stepper/index.js +1 -1
  316. package/dist/components/Table/index.cjs +1 -1
  317. package/dist/components/Table/index.js +1 -1
  318. package/dist/components/Tabs/index.cjs +1 -1
  319. package/dist/components/Tabs/index.js +1 -1
  320. package/dist/components/TagsField/index.cjs +1 -1
  321. package/dist/components/TagsField/index.js +1 -1
  322. package/dist/components/TextField/index.cjs +1 -1
  323. package/dist/components/TextField/index.js +1 -1
  324. package/dist/components/ThemeToggle/index.cjs +1 -1
  325. package/dist/components/ThemeToggle/index.js +1 -1
  326. package/dist/components/TimePicker/index.cjs +1 -1
  327. package/dist/components/TimePicker/index.js +1 -1
  328. package/dist/components/Toast/index.cjs +1 -1
  329. package/dist/components/Toast/index.js +1 -1
  330. package/dist/components/TranslatedFields/index.cjs +1 -1
  331. package/dist/components/TranslatedFields/index.js +1 -1
  332. package/dist/components/UserCard/index.cjs +1 -1
  333. package/dist/components/UserCard/index.js +1 -1
  334. package/dist/entries/app.cjs +1 -1
  335. package/dist/entries/app.js +1 -1
  336. package/dist/entries/components.cjs +1 -1
  337. package/dist/entries/components.js +50 -50
  338. package/dist/entries/i18n.cjs +1 -1
  339. package/dist/entries/i18n.js +2 -2
  340. package/dist/entries/theme.cjs +1 -1
  341. package/dist/entries/theme.js +1 -1
  342. package/dist/i18n/messages.d.cts +0 -1
  343. package/dist/i18n/messages.d.ts +0 -1
  344. package/dist/index.cjs +1 -1
  345. package/dist/index.css +1 -1
  346. package/dist/index.js +53 -53
  347. package/dist/{messages-zarEtcsN.js → messages-CMgYU5p6.js} +10 -17
  348. package/dist/messages-CMgYU5p6.js.map +1 -0
  349. package/dist/messages-h22vS9zn.cjs +36 -0
  350. package/dist/messages-h22vS9zn.cjs.map +1 -0
  351. package/dist/theme/ConfigProvider.d.cts +2 -4
  352. package/dist/theme/ConfigProvider.d.ts +2 -4
  353. package/dist/{useHomeTo-DVMyLZbb.js → useHomeTo-CsHSJ9bP.js} +2 -2
  354. package/dist/{useHomeTo-DVMyLZbb.js.map → useHomeTo-CsHSJ9bP.js.map} +1 -1
  355. package/dist/{useHomeTo-Dnu6VAvU.cjs → useHomeTo-QCdw9Rtn.cjs} +2 -2
  356. package/dist/{useHomeTo-Dnu6VAvU.cjs.map → useHomeTo-QCdw9Rtn.cjs.map} +1 -1
  357. package/dist/{useOptionMenu-OAYGUWP_.cjs → useOptionMenu-C0uz30xp.cjs} +2 -2
  358. package/dist/{useOptionMenu-OAYGUWP_.cjs.map → useOptionMenu-C0uz30xp.cjs.map} +1 -1
  359. package/dist/{useOptionMenu-DNYlfNO_.js → useOptionMenu-tLAmCiZ0.js} +3 -3
  360. package/dist/{useOptionMenu-DNYlfNO_.js.map → useOptionMenu-tLAmCiZ0.js.map} +1 -1
  361. package/package.json +1 -1
  362. package/dist/ConfigProvider-DZMtq2Fz.js.map +0 -1
  363. package/dist/ConfigProvider-th4GYhcU.cjs.map +0 -1
  364. package/dist/PageLayout-BtukUUfe.js +0 -12
  365. package/dist/PageLayout-BtukUUfe.js.map +0 -1
  366. package/dist/PageLayout-C_daDKkg.cjs +0 -2
  367. package/dist/PageLayout-C_daDKkg.cjs.map +0 -1
  368. package/dist/PageNotFound-B-Ewl9a2.cjs.map +0 -1
  369. package/dist/PageNotFound-B6jcXPba.js.map +0 -1
  370. package/dist/RootLayout-BY_BxQ0C.cjs +0 -2
  371. package/dist/RootLayout-BY_BxQ0C.cjs.map +0 -1
  372. package/dist/RootLayout-CicjlAUF.js +0 -641
  373. package/dist/RootLayout-CicjlAUF.js.map +0 -1
  374. package/dist/Sidebar-D-nR8Cu6.cjs +0 -2
  375. package/dist/Sidebar-D-nR8Cu6.cjs.map +0 -1
  376. package/dist/Sidebar-nORfjIg8.js +0 -565
  377. package/dist/Sidebar-nORfjIg8.js.map +0 -1
  378. package/dist/SpeedDial-BMpJtYP6.js +0 -165
  379. package/dist/SpeedDial-BMpJtYP6.js.map +0 -1
  380. package/dist/SpeedDial-D5uk_E5v.cjs +0 -2
  381. package/dist/SpeedDial-D5uk_E5v.cjs.map +0 -1
  382. package/dist/components/RootLayout/ActionSet.d.cts +0 -27
  383. package/dist/components/RootLayout/ActionSet.d.ts +0 -27
  384. package/dist/messages-DYXyWU3X.cjs +0 -36
  385. package/dist/messages-DYXyWU3X.cjs.map +0 -1
  386. package/dist/messages-zarEtcsN.js.map +0 -1
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @techzyapp/ui-library
2
2
 
3
3
  **Techzy UI** — a reusable, framework-agnostic React component library and the shared UI foundation for
4
- Techzy admin panels. Ships ~60 components plus a batteries-included admin shell (sidebar + header +
4
+ Techzy admin panels. Ships ~80 components plus a batteries-included admin shell (sidebar + header +
5
5
  routing), theming, and built-in UI localization.
6
6
 
7
7
  - **React 19** (peer `>=18`), TypeScript (strict), CSS Modules, dual **ESM/CJS**.
@@ -31,6 +31,9 @@ features you use need:
31
31
  | `FileUploader` | `react-dropzone`, `@dnd-kit/*`, `@formkit/auto-animate`, `react-image-crop` |
32
32
  | `Table` row reorder | `@dnd-kit/*` |
33
33
  | `CodeBlock` | `shiki` |
34
+ | `PhoneField` | `libphonenumber-js` |
35
+ | `QrCode` | `qrcode.react` |
36
+ | `LocationPicker` | none — loads Google Maps itself (key from `config.maps.apiKey`) |
34
37
 
35
38
  ---
36
39
 
@@ -113,16 +116,18 @@ const t = useTranslations()
113
116
 
114
117
  Import from the scoped surfaces (the root `.` re-exports everything too):
115
118
 
116
- | Import | What's in it |
117
- | --------------------------------------------------------- | --------------------------------------------------------------------------------- |
118
- | `@techzyapp/ui-library/components` | every component + the admin shell + `Form` |
119
- | `@techzyapp/ui-library/components/<Name>` | a single component |
120
- | `@techzyapp/ui-library/hooks` | `useDisclosure`, `useMediaQuery`, `useForm`, `useLockBodyScroll`, `useAccessKeys` |
121
- | `@techzyapp/ui-library/theme` | `ConfigProvider`, `useTheme`, config types, `applyTheme` |
122
- | `@techzyapp/ui-library/i18n` | `useT`, `useTranslations`, `useLanguage` + message types |
123
- | `@techzyapp/ui-library/icons` | `Icon`, `IconName`, `ICON_NAMES` |
124
- | `@techzyapp/ui-library/helpers` | RBAC + translation + `Table` query helpers |
125
- | `@techzyapp/ui-library/css/reset.css` · `/css/styles.css` | the two stylesheets |
119
+ | Import | What's in it |
120
+ | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
121
+ | `@techzyapp/ui-library/components` | every component + the admin shell + `Form` |
122
+ | `@techzyapp/ui-library/components/<Name>` | a single component |
123
+ | `@techzyapp/ui-library/hooks` | `useForm`, `useTableQuery`, `useQueryModal`, `useDisclosure`, `useMediaQuery`, `useBreakpointMatches`, `useClipboard`, `useLockBodyScroll`, `useAccessKeys` |
124
+ | `@techzyapp/ui-library/theme` | `ConfigProvider`, `useTheme`, config types, `applyTheme` |
125
+ | `@techzyapp/ui-library/i18n` | `useT`, `useTranslations`, `useLanguage` + message types |
126
+ | `@techzyapp/ui-library/icons` | `Icon`, `IconName`, `ICON_NAMES` |
127
+ | `@techzyapp/ui-library/helpers` | RBAC + translation + `Table` query helpers + palette / contrast |
128
+ | `@techzyapp/ui-library/auth` | `AuthGuard`, `authLayoutRoute` (TanStack-Router auth gating) |
129
+ | `@techzyapp/ui-library/app` | `AdminRoot` — the whole admin root route (shell + guard + session gate + Toaster) |
130
+ | `@techzyapp/ui-library/css/reset.css` · `/css/styles.css` | the two stylesheets |
126
131
 
127
132
  > Subpath imports need `moduleResolution: "bundler"` or `"node16"` in your `tsconfig`; the root import
128
133
  > works on classic `"node"` too.
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),n=require("@tanstack/react-router"),_=require("./errorMessage-C7N4KvUS.cjs"),B=require("./AuthGuard-kfOZviar.cjs"),W=require("./ConfigProvider-th4GYhcU.cjs"),z=require("./AuthLayout-Cl3tb4-E.cjs"),F=require("./Col-BdQeyKEX.cjs"),x=require("./ErrorBoundary-WwmJrL6o.cjs"),R=require("./Button-Cm64ROip.cjs"),f=require("./Toaster-B7Xd2IaM.cjs"),G=require("./RootLayout-BY_BxQ0C.cjs"),N=require("./UserCard-Die7JV4z.cjs"),U=require("./Loader-DkwiCGbB.cjs"),b="_pending_1jy0z_2",k={pending:b},I=({logo:d,logoTo:y,getUser:q,onLogout:A,authRouteId:L="/_auth",loginPath:l="/login",showUserCard:C=!0,header:p,errorBoundary:c=!0,pending:h=!1,pendingFallback:T,unavailable:t,unavailableFallback:m})=>{const i=W.useT(),S=n.useNavigate(),v=n.useRouterState({select:o=>o.matches.some(s=>s.routeId.startsWith(L))}),E=n.useRouterState({select:o=>{var s;return(s=o.location)==null?void 0:s.pathname}}),u=()=>{A(),S({to:l})};if(h||t){let o;if(h)o=T??e.jsx("div",{className:k.pending,"aria-busy":"true",children:e.jsx(U.Loader,{size:"lg"})});else if(t){const s=t.reason??(_.getErrorStatus(t.error)===403?"forbidden":"unreachable");if(m)o=m({error:t.error,reason:s,retry:t.onRetry,signOut:u});else{const a=s==="unreachable"?t.onRetry:void 0,g=s==="forbidden";o=e.jsx(z.AuthLayout,{logo:d,icon:t.icon||void 0,color:t.color??"error",title:i(g?"adminRoot.noAccessTitle":"adminRoot.unreachableTitle"),subtitle:i(g?"adminRoot.noAccessSubtitle":"adminRoot.unreachableSubtitle"),children:e.jsxs(F.Col,{gap:16,children:[e.jsx(x.QueryError,{variant:"alert",error:t.error}),a?e.jsx(R.Button,{fullWidth:!0,onClick:a,children:i("errorState.retry")}):null,e.jsx(R.Button,{fullWidth:!0,variant:a?"filled":"contained",onClick:u,children:i("userCard.signOut")})]})})}}return e.jsxs(e.Fragment,{children:[o,e.jsx(f.Toaster,{})]})}const r=q(),j=c===!1?e.jsx(n.Outlet,{}):e.jsx(x.ErrorBoundary,{...c===!0?{}:c,resetKeys:[E],children:e.jsx(n.Outlet,{})}),O=v?j:e.jsx(B.AuthGuard,{isAuthenticated:r!=null,redirectTo:l,children:e.jsx(G.RootLayout,{logo:d,logoTo:y,toaster:!1,header:{user:r?{name:r.name,email:r.email,avatar:r.avatar}:void 0,onLogout:u,...p},sidebarFooter:C&&r?e.jsx(N.UserCard,{name:r.name,email:r.email,avatar:r.avatar,onLogout:u}):void 0,children:j})});return e.jsxs(e.Fragment,{children:[O,e.jsx(f.Toaster,{})]})};exports.AdminRoot=I;
2
- //# sourceMappingURL=AdminRoot-D97qDVTM.cjs.map
1
+ "use strict";const e=require("react/jsx-runtime"),n=require("@tanstack/react-router"),_=require("./errorMessage-C7N4KvUS.cjs"),B=require("./AuthGuard-kfOZviar.cjs"),W=require("./ConfigProvider-B_Bb6pk1.cjs"),z=require("./AuthLayout-Cl3tb4-E.cjs"),F=require("./Col-BdQeyKEX.cjs"),x=require("./ErrorBoundary-DtZn1K4r.cjs"),R=require("./Button-CYZoF18-.cjs"),f=require("./Toaster-CyWSt38Y.cjs"),G=require("./RootLayout-Dy6Llv-I.cjs"),N=require("./UserCard-DrJIl-gD.cjs"),U=require("./Loader-B5Pm8AaT.cjs"),b="_pending_1jy0z_2",k={pending:b},I=({logo:d,logoTo:y,getUser:q,onLogout:A,authRouteId:L="/_auth",loginPath:l="/login",showUserCard:C=!0,header:p,errorBoundary:c=!0,pending:h=!1,pendingFallback:T,unavailable:t,unavailableFallback:m})=>{const i=W.useT(),S=n.useNavigate(),v=n.useRouterState({select:o=>o.matches.some(s=>s.routeId.startsWith(L))}),E=n.useRouterState({select:o=>{var s;return(s=o.location)==null?void 0:s.pathname}}),u=()=>{A(),S({to:l})};if(h||t){let o;if(h)o=T??e.jsx("div",{className:k.pending,"aria-busy":"true",children:e.jsx(U.Loader,{size:"lg"})});else if(t){const s=t.reason??(_.getErrorStatus(t.error)===403?"forbidden":"unreachable");if(m)o=m({error:t.error,reason:s,retry:t.onRetry,signOut:u});else{const a=s==="unreachable"?t.onRetry:void 0,g=s==="forbidden";o=e.jsx(z.AuthLayout,{logo:d,icon:t.icon||void 0,color:t.color??"error",title:i(g?"adminRoot.noAccessTitle":"adminRoot.unreachableTitle"),subtitle:i(g?"adminRoot.noAccessSubtitle":"adminRoot.unreachableSubtitle"),children:e.jsxs(F.Col,{gap:16,children:[e.jsx(x.QueryError,{variant:"alert",error:t.error}),a?e.jsx(R.Button,{fullWidth:!0,onClick:a,children:i("errorState.retry")}):null,e.jsx(R.Button,{fullWidth:!0,variant:a?"filled":"contained",onClick:u,children:i("userCard.signOut")})]})})}}return e.jsxs(e.Fragment,{children:[o,e.jsx(f.Toaster,{})]})}const r=q(),j=c===!1?e.jsx(n.Outlet,{}):e.jsx(x.ErrorBoundary,{...c===!0?{}:c,resetKeys:[E],children:e.jsx(n.Outlet,{})}),O=v?j:e.jsx(B.AuthGuard,{isAuthenticated:r!=null,redirectTo:l,children:e.jsx(G.RootLayout,{logo:d,logoTo:y,toaster:!1,header:{user:r?{name:r.name,email:r.email,avatar:r.avatar}:void 0,onLogout:u,...p},sidebarFooter:C&&r?e.jsx(N.UserCard,{name:r.name,email:r.email,avatar:r.avatar,onLogout:u}):void 0,children:j})});return e.jsxs(e.Fragment,{children:[O,e.jsx(f.Toaster,{})]})};exports.AdminRoot=I;
2
+ //# sourceMappingURL=AdminRoot-DwQi_tM4.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminRoot-D97qDVTM.cjs","sources":["../src/app/AdminRoot.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Outlet, useNavigate, useRouterState, type LinkProps } from '@tanstack/react-router'\nimport {\n AuthLayout,\n Button,\n Col,\n ErrorBoundary,\n Loader,\n QueryError,\n RootLayout,\n UserCard,\n Toaster,\n type ErrorBoundaryProps,\n type IconName,\n type RootLayoutHeader,\n type RootLayoutProps,\n} from '../components'\nimport { getErrorStatus } from '../components/ErrorState/errorMessage'\nimport { useT, type ThemeColor } from '../theme'\nimport { AuthGuard } from '../auth/AuthGuard'\nimport styles from './AdminRoot.module.css'\n\n/** Why the session can't be used — see `AdminRootUnavailable.reason`. */\nexport type AdminRootUnavailableReason = 'forbidden' | 'unreachable'\n\n/** The `unavailable` state of `AdminRoot` — the session could not be checked, or may not be used here. */\nexport interface AdminRootUnavailable {\n /** What failed — passed to `QueryError` (message, trace id). */\n error: unknown\n /**\n * Why. `'forbidden'` = a valid session this panel may not use (no retry, only Sign Out).\n * `'unreachable'` = the check itself failed (Try Again + Sign Out). Defaults to `'forbidden'` when the\n * error carries HTTP status 403 (`error.status` or `error.response.status`), else `'unreachable'`.\n */\n reason?: AdminRootUnavailableReason\n /** Re-runs the session check. Shown as \"Try Again\" for `'unreachable'` only. */\n onRetry?: () => void\n /**\n * The `AuthLayout` icon. Default: none — apps differ here (one shows a tinted `CloudCross`, another keeps\n * every auth page icon-free), so it's the app's choice.\n */\n icon?: IconName | false\n /** Tint for `icon` (`AuthLayout`'s `color`). Default `'error'`. */\n color?: ThemeColor\n}\n\n/** What an `unavailableFallback` receives. */\nexport interface AdminRootUnavailableFallbackProps {\n /** The `unavailable.error`. */\n error: unknown\n /** The resolved reason (explicit, or inferred from a 403). */\n reason: AdminRootUnavailableReason\n /** `unavailable.onRetry`, when given — whatever the reason (the fallback decides whether to offer it). */\n retry?: () => void\n /** The shell's Sign Out: `onLogout()`, then navigate to `loginPath`. */\n signOut: () => void\n}\n\n/** The minimal user shape `AdminRoot` reads — apps pass their own richer type via the generic. */\nexport interface AdminUser {\n name?: string\n email?: string\n avatar?: string\n}\n\nexport interface AdminRootProps<U extends AdminUser = AdminUser> {\n /** Brand mark for the sidebar top. */\n logo?: ReactNode\n /**\n * Where clicking the logo goes — the first menu page by default (see `RootLayout`'s `logoTo`); a path to\n * send it elsewhere, or `false` for a non-clickable logo.\n */\n logoTo?: RootLayoutProps['logoTo']\n /** Current user, or `null` when signed out. */\n getUser: () => U | null\n /** Clears the session; `AdminRoot` navigates to `loginPath` afterwards. */\n onLogout: () => void\n /** Route-id prefix for standalone public pages (rendered outside the shell). Default `'/_auth'`. */\n authRouteId?: string\n /** Guard target for signed-out visitors + post-logout redirect. Default `'/login'`. */\n loginPath?: string\n /** Show a `UserCard` in the sidebar footer. Default `true`. */\n showUserCard?: boolean\n /**\n * Extra `RootLayout` header config, merged **over** the defaults (the app's fields win). Flows through\n * unchanged — e.g. **`header.menu`** (`HeaderMenuItem[]`) adds items to the account menu above Sign out.\n */\n header?: RootLayoutHeader\n /**\n * Wrap the page content in an `ErrorBoundary` (reset on navigation), so a crashing page shows an\n * `ErrorState` inside the shell instead of a white screen. Default `true`; `false` opts out; an object\n * configures it (e.g. `{ onError: Sentry.captureException }` or a custom `fallback`). It only catches what\n * the router doesn't: TanStack Router catches a route's component / `loader` / `beforeLoad` errors in its own\n * per-route boundary, so page crashes need `createRouter({ defaultErrorComponent: PageError })`.\n */\n errorBoundary?: boolean | Omit<ErrorBoundaryProps, 'children' | 'resetKeys'>\n /**\n * The app is still finding out who is signed in (e.g. verifying a stored token or refreshing a cookie\n * session). While `true`, AdminRoot renders only `pendingFallback` — no shell, no public page, no\n * `AuthGuard`, and `getUser()` isn't read — so a signed-in admin is never redirected to sign-in before the\n * check resolves. Route `beforeLoad` guards (e.g. `authLayoutRoute`) still run in the router, independent\n * of this — they must tolerate the unknown state themselves. No minimum display time. Default `false`.\n */\n pending?: boolean\n /** What to show while `pending`. Default: a `Loader size=\"lg\"` centred in the full viewport. */\n pendingFallback?: ReactNode\n /**\n * The session could not be checked, or the server will not serve this account here. While set, AdminRoot\n * renders a standalone `AuthLayout` screen (the app's `logo`, a `QueryError`, Try Again / Sign Out) instead\n * of the shell or a public page — and never redirects. Sign Out calls `onLogout` then navigates to\n * `loginPath`, so **`onLogout` must clear whatever set `unavailable`** (or this screen shows again).\n * `pending` wins when both are set. `null` / `undefined` = not unavailable (the default).\n */\n unavailable?: AdminRootUnavailable | null\n /** Replaces the whole `unavailable` screen — for an app that needs its own wording or extra actions. */\n unavailableFallback?: (props: AdminRootUnavailableFallbackProps) => ReactNode\n}\n\n/**\n * Root-route component for admin apps — it wires up the whole shell orchestration so an app only has to\n * supply `logo` + `getUser` + `onLogout`. Public pages (route id under `authRouteId`) render standalone;\n * everything else renders inside the guarded admin shell (`RootLayout` + a sidebar `UserCard`), gated by\n * `AuthGuard` (signed-out visitors bounce to `loginPath`). Logout clears the session and navigates to\n * `loginPath`. Mounts exactly one app-wide `<Toaster/>` (the inner `RootLayout` gets `toaster={false}`),\n * and wraps the page in an `ErrorBoundary` that resets on navigation (`errorBoundary`, default on).\n * While the app is still checking the session, pass `pending` (a full-screen loader instead of a premature\n * sign-in redirect); when the check failed or the server refuses this account, pass `unavailable` (a\n * standalone \"Cannot Reach the Server\" / \"No Access\" screen with Try Again / Sign Out). The `Toaster` stays\n * mounted in both.\n *\n * `loginPath` is a plain string, cast loosely to the router's `to` type (the library can't know the\n * app's typed route tree). The generic `<U>` preserves the app's own user type through `getUser`.\n *\n * @example\n * // routes/__root.tsx\n * export const Route = createRootRoute({\n * component: () => {\n * const { status, error, retry } = useSession()\n * return (\n * <AdminRoot<AuthUser>\n * pending={status === 'loading'}\n * unavailable={status === 'unavailable' ? { error, onRetry: retry } : null}\n * logo={<Logo />}\n * getUser={getUser}\n * onLogout={logout}\n * />\n * )\n * },\n * })\n */\nexport const AdminRoot = <U extends AdminUser = AdminUser>({\n logo,\n logoTo,\n getUser,\n onLogout,\n authRouteId = '/_auth',\n loginPath = '/login',\n showUserCard = true,\n header,\n errorBoundary = true,\n pending = false,\n pendingFallback,\n unavailable,\n unavailableFallback,\n}: AdminRootProps<U>) => {\n const t = useT()\n const navigate = useNavigate()\n const isAuthRoute = useRouterState({\n select: (s) => s.matches.some((m) => m.routeId.startsWith(authRouteId)),\n })\n const pathname = useRouterState({ select: (s) => s.location?.pathname })\n const handleLogout = () => {\n onLogout()\n navigate({ to: loginPath as LinkProps['to'] })\n }\n\n // the session isn't known yet / can't be used — a standalone screen instead of the shell or a public\n // page (so no AuthGuard redirect, no sign-in flash). The Toaster stays, so a bootstrap toast isn't lost.\n if (pending || unavailable) {\n let gate: ReactNode\n if (pending) {\n gate = pendingFallback ?? (\n <div className={styles.pending} aria-busy=\"true\">\n <Loader size=\"lg\" />\n </div>\n )\n } else if (unavailable) {\n const reason: AdminRootUnavailableReason =\n unavailable.reason ??\n (getErrorStatus(unavailable.error) === 403 ? 'forbidden' : 'unreachable')\n if (unavailableFallback) {\n gate = unavailableFallback({\n error: unavailable.error,\n reason,\n retry: unavailable.onRetry,\n signOut: handleLogout,\n })\n } else {\n const retry = reason === 'unreachable' ? unavailable.onRetry : undefined\n const forbidden = reason === 'forbidden'\n gate = (\n <AuthLayout\n logo={logo}\n icon={unavailable.icon || undefined}\n color={unavailable.color ?? 'error'}\n title={t(forbidden ? 'adminRoot.noAccessTitle' : 'adminRoot.unreachableTitle')}\n subtitle={t(forbidden ? 'adminRoot.noAccessSubtitle' : 'adminRoot.unreachableSubtitle')}\n >\n <Col gap={16}>\n <QueryError variant=\"alert\" error={unavailable.error} />\n {retry ? (\n <Button fullWidth onClick={retry}>\n {t('errorState.retry')}\n </Button>\n ) : null}\n <Button fullWidth variant={retry ? 'filled' : 'contained'} onClick={handleLogout}>\n {t('userCard.signOut')}\n </Button>\n </Col>\n </AuthLayout>\n )\n }\n }\n return (\n <>\n {gate}\n <Toaster />\n </>\n )\n }\n\n const user = getUser()\n // the routed page, inside an ErrorBoundary that resets whenever the path changes\n const page =\n errorBoundary === false ? (\n <Outlet />\n ) : (\n <ErrorBoundary {...(errorBoundary === true ? {} : errorBoundary)} resetKeys={[pathname]}>\n <Outlet />\n </ErrorBoundary>\n )\n const content = isAuthRoute ? (\n page\n ) : (\n <AuthGuard isAuthenticated={user != null} redirectTo={loginPath}>\n <RootLayout\n logo={logo}\n logoTo={logoTo}\n toaster={false}\n header={{\n user: user ? { name: user.name, email: user.email, avatar: user.avatar } : undefined,\n onLogout: handleLogout,\n ...header,\n }}\n sidebarFooter={\n showUserCard && user ? (\n <UserCard\n name={user.name}\n email={user.email}\n avatar={user.avatar}\n onLogout={handleLogout}\n />\n ) : undefined\n }\n >\n {page}\n </RootLayout>\n </AuthGuard>\n )\n return (\n <>\n {content}\n <Toaster />\n </>\n )\n}\n"],"names":["AdminRoot","logo","logoTo","getUser","onLogout","authRouteId","loginPath","showUserCard","header","errorBoundary","pending","pendingFallback","unavailable","unavailableFallback","t","useT","navigate","useNavigate","isAuthRoute","useRouterState","s","m","pathname","_a","handleLogout","gate","jsx","styles","Loader","reason","getErrorStatus","retry","forbidden","AuthLayout","jsxs","Col","QueryError","Button","Fragment","Toaster","user","page","Outlet","ErrorBoundary","content","AuthGuard","RootLayout","UserCard"],"mappings":"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"}
1
+ {"version":3,"file":"AdminRoot-DwQi_tM4.cjs","sources":["../src/app/AdminRoot.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Outlet, useNavigate, useRouterState, type LinkProps } from '@tanstack/react-router'\nimport {\n AuthLayout,\n Button,\n Col,\n ErrorBoundary,\n Loader,\n QueryError,\n RootLayout,\n UserCard,\n Toaster,\n type ErrorBoundaryProps,\n type IconName,\n type RootLayoutHeader,\n type RootLayoutProps,\n} from '../components'\nimport { getErrorStatus } from '../components/ErrorState/errorMessage'\nimport { useT, type ThemeColor } from '../theme'\nimport { AuthGuard } from '../auth/AuthGuard'\nimport styles from './AdminRoot.module.css'\n\n/** Why the session can't be used — see `AdminRootUnavailable.reason`. */\nexport type AdminRootUnavailableReason = 'forbidden' | 'unreachable'\n\n/** The `unavailable` state of `AdminRoot` — the session could not be checked, or may not be used here. */\nexport interface AdminRootUnavailable {\n /** What failed — passed to `QueryError` (message, trace id). */\n error: unknown\n /**\n * Why. `'forbidden'` = a valid session this panel may not use (no retry, only Sign Out).\n * `'unreachable'` = the check itself failed (Try Again + Sign Out). Defaults to `'forbidden'` when the\n * error carries HTTP status 403 (`error.status` or `error.response.status`), else `'unreachable'`.\n */\n reason?: AdminRootUnavailableReason\n /** Re-runs the session check. Shown as \"Try Again\" for `'unreachable'` only. */\n onRetry?: () => void\n /**\n * The `AuthLayout` icon. Default: none — apps differ here (one shows a tinted `CloudCross`, another keeps\n * every auth page icon-free), so it's the app's choice.\n */\n icon?: IconName | false\n /** Tint for `icon` (`AuthLayout`'s `color`). Default `'error'`. */\n color?: ThemeColor\n}\n\n/** What an `unavailableFallback` receives. */\nexport interface AdminRootUnavailableFallbackProps {\n /** The `unavailable.error`. */\n error: unknown\n /** The resolved reason (explicit, or inferred from a 403). */\n reason: AdminRootUnavailableReason\n /** `unavailable.onRetry`, when given — whatever the reason (the fallback decides whether to offer it). */\n retry?: () => void\n /** The shell's Sign Out: `onLogout()`, then navigate to `loginPath`. */\n signOut: () => void\n}\n\n/** The minimal user shape `AdminRoot` reads — apps pass their own richer type via the generic. */\nexport interface AdminUser {\n name?: string\n email?: string\n avatar?: string\n}\n\nexport interface AdminRootProps<U extends AdminUser = AdminUser> {\n /** Brand mark for the sidebar top. */\n logo?: ReactNode\n /**\n * Where clicking the logo goes — the first menu page by default (see `RootLayout`'s `logoTo`); a path to\n * send it elsewhere, or `false` for a non-clickable logo.\n */\n logoTo?: RootLayoutProps['logoTo']\n /** Current user, or `null` when signed out. */\n getUser: () => U | null\n /** Clears the session; `AdminRoot` navigates to `loginPath` afterwards. */\n onLogout: () => void\n /** Route-id prefix for standalone public pages (rendered outside the shell). Default `'/_auth'`. */\n authRouteId?: string\n /** Guard target for signed-out visitors + post-logout redirect. Default `'/login'`. */\n loginPath?: string\n /** Show a `UserCard` in the sidebar footer. Default `true`. */\n showUserCard?: boolean\n /**\n * Extra `RootLayout` header config, merged **over** the defaults (the app's fields win). Flows through\n * unchanged — e.g. **`header.menu`** (`HeaderMenuItem[]`) adds items to the account menu above Sign out.\n */\n header?: RootLayoutHeader\n /**\n * Wrap the page content in an `ErrorBoundary` (reset on navigation), so a crashing page shows an\n * `ErrorState` inside the shell instead of a white screen. Default `true`; `false` opts out; an object\n * configures it (e.g. `{ onError: Sentry.captureException }` or a custom `fallback`). It only catches what\n * the router doesn't: TanStack Router catches a route's component / `loader` / `beforeLoad` errors in its own\n * per-route boundary, so page crashes need `createRouter({ defaultErrorComponent: PageError })`.\n */\n errorBoundary?: boolean | Omit<ErrorBoundaryProps, 'children' | 'resetKeys'>\n /**\n * The app is still finding out who is signed in (e.g. verifying a stored token or refreshing a cookie\n * session). While `true`, AdminRoot renders only `pendingFallback` — no shell, no public page, no\n * `AuthGuard`, and `getUser()` isn't read — so a signed-in admin is never redirected to sign-in before the\n * check resolves. Route `beforeLoad` guards (e.g. `authLayoutRoute`) still run in the router, independent\n * of this — they must tolerate the unknown state themselves. No minimum display time. Default `false`.\n */\n pending?: boolean\n /** What to show while `pending`. Default: a `Loader size=\"lg\"` centred in the full viewport. */\n pendingFallback?: ReactNode\n /**\n * The session could not be checked, or the server will not serve this account here. While set, AdminRoot\n * renders a standalone `AuthLayout` screen (the app's `logo`, a `QueryError`, Try Again / Sign Out) instead\n * of the shell or a public page — and never redirects. Sign Out calls `onLogout` then navigates to\n * `loginPath`, so **`onLogout` must clear whatever set `unavailable`** (or this screen shows again).\n * `pending` wins when both are set. `null` / `undefined` = not unavailable (the default).\n */\n unavailable?: AdminRootUnavailable | null\n /** Replaces the whole `unavailable` screen — for an app that needs its own wording or extra actions. */\n unavailableFallback?: (props: AdminRootUnavailableFallbackProps) => ReactNode\n}\n\n/**\n * Root-route component for admin apps — it wires up the whole shell orchestration so an app only has to\n * supply `logo` + `getUser` + `onLogout`. Public pages (route id under `authRouteId`) render standalone;\n * everything else renders inside the guarded admin shell (`RootLayout` + a sidebar `UserCard`), gated by\n * `AuthGuard` (signed-out visitors bounce to `loginPath`). Logout clears the session and navigates to\n * `loginPath`. Mounts exactly one app-wide `<Toaster/>` (the inner `RootLayout` gets `toaster={false}`),\n * and wraps the page in an `ErrorBoundary` that resets on navigation (`errorBoundary`, default on).\n * While the app is still checking the session, pass `pending` (a full-screen loader instead of a premature\n * sign-in redirect); when the check failed or the server refuses this account, pass `unavailable` (a\n * standalone \"Cannot Reach the Server\" / \"No Access\" screen with Try Again / Sign Out). The `Toaster` stays\n * mounted in both.\n *\n * `loginPath` is a plain string, cast loosely to the router's `to` type (the library can't know the\n * app's typed route tree). The generic `<U>` preserves the app's own user type through `getUser`.\n *\n * @example\n * // routes/__root.tsx\n * export const Route = createRootRoute({\n * component: () => {\n * const { status, error, retry } = useSession()\n * return (\n * <AdminRoot<AuthUser>\n * pending={status === 'loading'}\n * unavailable={status === 'unavailable' ? { error, onRetry: retry } : null}\n * logo={<Logo />}\n * getUser={getUser}\n * onLogout={logout}\n * />\n * )\n * },\n * })\n */\nexport const AdminRoot = <U extends AdminUser = AdminUser>({\n logo,\n logoTo,\n getUser,\n onLogout,\n authRouteId = '/_auth',\n loginPath = '/login',\n showUserCard = true,\n header,\n errorBoundary = true,\n pending = false,\n pendingFallback,\n unavailable,\n unavailableFallback,\n}: AdminRootProps<U>) => {\n const t = useT()\n const navigate = useNavigate()\n const isAuthRoute = useRouterState({\n select: (s) => s.matches.some((m) => m.routeId.startsWith(authRouteId)),\n })\n const pathname = useRouterState({ select: (s) => s.location?.pathname })\n const handleLogout = () => {\n onLogout()\n navigate({ to: loginPath as LinkProps['to'] })\n }\n\n // the session isn't known yet / can't be used — a standalone screen instead of the shell or a public\n // page (so no AuthGuard redirect, no sign-in flash). The Toaster stays, so a bootstrap toast isn't lost.\n if (pending || unavailable) {\n let gate: ReactNode\n if (pending) {\n gate = pendingFallback ?? (\n <div className={styles.pending} aria-busy=\"true\">\n <Loader size=\"lg\" />\n </div>\n )\n } else if (unavailable) {\n const reason: AdminRootUnavailableReason =\n unavailable.reason ??\n (getErrorStatus(unavailable.error) === 403 ? 'forbidden' : 'unreachable')\n if (unavailableFallback) {\n gate = unavailableFallback({\n error: unavailable.error,\n reason,\n retry: unavailable.onRetry,\n signOut: handleLogout,\n })\n } else {\n const retry = reason === 'unreachable' ? unavailable.onRetry : undefined\n const forbidden = reason === 'forbidden'\n gate = (\n <AuthLayout\n logo={logo}\n icon={unavailable.icon || undefined}\n color={unavailable.color ?? 'error'}\n title={t(forbidden ? 'adminRoot.noAccessTitle' : 'adminRoot.unreachableTitle')}\n subtitle={t(forbidden ? 'adminRoot.noAccessSubtitle' : 'adminRoot.unreachableSubtitle')}\n >\n <Col gap={16}>\n <QueryError variant=\"alert\" error={unavailable.error} />\n {retry ? (\n <Button fullWidth onClick={retry}>\n {t('errorState.retry')}\n </Button>\n ) : null}\n <Button fullWidth variant={retry ? 'filled' : 'contained'} onClick={handleLogout}>\n {t('userCard.signOut')}\n </Button>\n </Col>\n </AuthLayout>\n )\n }\n }\n return (\n <>\n {gate}\n <Toaster />\n </>\n )\n }\n\n const user = getUser()\n // the routed page, inside an ErrorBoundary that resets whenever the path changes\n const page =\n errorBoundary === false ? (\n <Outlet />\n ) : (\n <ErrorBoundary {...(errorBoundary === true ? {} : errorBoundary)} resetKeys={[pathname]}>\n <Outlet />\n </ErrorBoundary>\n )\n const content = isAuthRoute ? (\n page\n ) : (\n <AuthGuard isAuthenticated={user != null} redirectTo={loginPath}>\n <RootLayout\n logo={logo}\n logoTo={logoTo}\n toaster={false}\n header={{\n user: user ? { name: user.name, email: user.email, avatar: user.avatar } : undefined,\n onLogout: handleLogout,\n ...header,\n }}\n sidebarFooter={\n showUserCard && user ? (\n <UserCard\n name={user.name}\n email={user.email}\n avatar={user.avatar}\n onLogout={handleLogout}\n />\n ) : undefined\n }\n >\n {page}\n </RootLayout>\n </AuthGuard>\n )\n return (\n <>\n {content}\n <Toaster />\n </>\n )\n}\n"],"names":["AdminRoot","logo","logoTo","getUser","onLogout","authRouteId","loginPath","showUserCard","header","errorBoundary","pending","pendingFallback","unavailable","unavailableFallback","t","useT","navigate","useNavigate","isAuthRoute","useRouterState","s","m","pathname","_a","handleLogout","gate","jsx","styles","Loader","reason","getErrorStatus","retry","forbidden","AuthLayout","jsxs","Col","QueryError","Button","Fragment","Toaster","user","page","Outlet","ErrorBoundary","content","AuthGuard","RootLayout","UserCard"],"mappings":"0hBAsJaA,EAAY,CAAkC,CACzD,KAAAC,EACA,OAAAC,EACA,QAAAC,EACA,SAAAC,EACA,YAAAC,EAAc,SACd,UAAAC,EAAY,SACZ,aAAAC,EAAe,GACf,OAAAC,EACA,cAAAC,EAAgB,GAChB,QAAAC,EAAU,GACV,gBAAAC,EACA,YAAAC,EACA,oBAAAC,CACF,IAAyB,CACvB,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAWC,EAAAA,YAAA,EACXC,EAAcC,EAAAA,eAAe,CACjC,OAASC,GAAMA,EAAE,QAAQ,KAAMC,GAAMA,EAAE,QAAQ,WAAWhB,CAAW,CAAC,CAAA,CACvE,EACKiB,EAAWH,EAAAA,eAAe,CAAE,OAASC,UAAM,OAAAG,EAAAH,EAAE,WAAF,YAAAG,EAAY,UAAU,EACjEC,EAAe,IAAM,CACzBpB,EAAA,EACAY,EAAS,CAAE,GAAIV,EAA8B,CAC/C,EAIA,GAAII,GAAWE,EAAa,CAC1B,IAAIa,EACJ,GAAIf,EACFe,EAAOd,GACLe,MAAC,MAAA,CAAI,UAAWC,EAAO,QAAS,YAAU,OACxC,SAAAD,EAAAA,IAACE,EAAAA,OAAA,CAAO,KAAK,IAAA,CAAK,EACpB,UAEOhB,EAAa,CACtB,MAAMiB,EACJjB,EAAY,SACXkB,EAAAA,eAAelB,EAAY,KAAK,IAAM,IAAM,YAAc,eAC7D,GAAIC,EACFY,EAAOZ,EAAoB,CACzB,MAAOD,EAAY,MACnB,OAAAiB,EACA,MAAOjB,EAAY,QACnB,QAASY,CAAA,CACV,MACI,CACL,MAAMO,EAAQF,IAAW,cAAgBjB,EAAY,QAAU,OACzDoB,EAAYH,IAAW,YAC7BJ,EACEC,EAAAA,IAACO,EAAAA,WAAA,CACC,KAAAhC,EACA,KAAMW,EAAY,MAAQ,OAC1B,MAAOA,EAAY,OAAS,QAC5B,MAAOE,EAAEkB,EAAY,0BAA4B,4BAA4B,EAC7E,SAAUlB,EAAEkB,EAAY,6BAA+B,+BAA+B,EAEtF,SAAAE,EAAAA,KAACC,EAAAA,IAAA,CAAI,IAAK,GACR,SAAA,CAAAT,EAAAA,IAACU,EAAAA,WAAA,CAAW,QAAQ,QAAQ,MAAOxB,EAAY,MAAO,EACrDmB,EACCL,EAAAA,IAACW,EAAAA,OAAA,CAAO,UAAS,GAAC,QAASN,EACxB,SAAAjB,EAAE,kBAAkB,CAAA,CACvB,EACE,KACJY,EAAAA,IAACW,EAAAA,OAAA,CAAO,UAAS,GAAC,QAASN,EAAQ,SAAW,YAAa,QAASP,EACjE,SAAAV,EAAE,kBAAkB,CAAA,CACvB,CAAA,CAAA,CACF,CAAA,CAAA,CAGN,CACF,CACA,OACEoB,EAAAA,KAAAI,WAAA,CACG,SAAA,CAAAb,QACAc,EAAAA,QAAA,CAAA,CAAQ,CAAA,EACX,CAEJ,CAEA,MAAMC,EAAOrC,EAAA,EAEPsC,EACJhC,IAAkB,GAChBiB,EAAAA,IAACgB,WAAO,EAERhB,EAAAA,IAACiB,EAAAA,eAAe,GAAIlC,IAAkB,GAAO,GAAKA,EAAgB,UAAW,CAACa,CAAQ,EACpF,SAAAI,MAACgB,EAAAA,SAAO,EACV,EAEEE,EAAU1B,EACduB,EAEAf,EAAAA,IAACmB,EAAAA,WAAU,gBAAiBL,GAAQ,KAAM,WAAYlC,EACpD,SAAAoB,EAAAA,IAACoB,EAAAA,WAAA,CACC,KAAA7C,EACA,OAAAC,EACA,QAAS,GACT,OAAQ,CACN,KAAMsC,EAAO,CAAE,KAAMA,EAAK,KAAM,MAAOA,EAAK,MAAO,OAAQA,EAAK,MAAA,EAAW,OAC3E,SAAUhB,EACV,GAAGhB,CAAA,EAEL,cACED,GAAgBiC,EACdd,EAAAA,IAACqB,EAAAA,SAAA,CACC,KAAMP,EAAK,KACX,MAAOA,EAAK,MACZ,OAAQA,EAAK,OACb,SAAUhB,CAAA,CAAA,EAEV,OAGL,SAAAiB,CAAA,CAAA,EAEL,EAEF,OACEP,EAAAA,KAAAI,WAAA,CACG,SAAA,CAAAM,QACAL,EAAAA,QAAA,CAAA,CAAQ,CAAA,EACX,CAEJ"}
@@ -2,15 +2,15 @@ import { jsx as t, jsxs as m, Fragment as g } from "react/jsx-runtime";
2
2
  import { useNavigate as N, useRouterState as y, Outlet as R } from "@tanstack/react-router";
3
3
  import { c as Q } from "./errorMessage-C83fB2h5.js";
4
4
  import { A as U } from "./AuthGuard-CVklwDbj.js";
5
- import { a as b } from "./ConfigProvider-DZMtq2Fz.js";
5
+ import { a as b } from "./ConfigProvider-DeMASTVo.js";
6
6
  import { A as k } from "./AuthLayout-C47vXKYp.js";
7
7
  import { C as B } from "./Col-B51RlwWP.js";
8
- import { Q as F, E as G } from "./ErrorBoundary-BS0x9RVO.js";
9
- import { B as A } from "./Button-BQ7jsm5P.js";
10
- import { T as L } from "./Toaster-D8cxkhwr.js";
11
- import { R as I } from "./RootLayout-CicjlAUF.js";
12
- import { U as K } from "./UserCard-CsZ4Ogac.js";
13
- import { L as q } from "./Loader-jh7XMRhy.js";
8
+ import { Q as F, E as G } from "./ErrorBoundary-CLz5rsOJ.js";
9
+ import { B as A } from "./Button-Bst_NtPJ.js";
10
+ import { T as L } from "./Toaster-C_3REdVz.js";
11
+ import { R as I } from "./RootLayout-fsVJvS8l.js";
12
+ import { U as K } from "./UserCard-eiY2q0lu.js";
13
+ import { L as q } from "./Loader-Bj5uwVR9.js";
14
14
  const w = "_pending_1jy0z_2", D = {
15
15
  pending: w
16
16
  }, st = ({
@@ -104,4 +104,4 @@ const w = "_pending_1jy0z_2", D = {
104
104
  export {
105
105
  st as A
106
106
  };
107
- //# sourceMappingURL=AdminRoot-C_SNXQkB.js.map
107
+ //# sourceMappingURL=AdminRoot-kGG0oPN_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminRoot-C_SNXQkB.js","sources":["../src/app/AdminRoot.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Outlet, useNavigate, useRouterState, type LinkProps } from '@tanstack/react-router'\nimport {\n AuthLayout,\n Button,\n Col,\n ErrorBoundary,\n Loader,\n QueryError,\n RootLayout,\n UserCard,\n Toaster,\n type ErrorBoundaryProps,\n type IconName,\n type RootLayoutHeader,\n type RootLayoutProps,\n} from '../components'\nimport { getErrorStatus } from '../components/ErrorState/errorMessage'\nimport { useT, type ThemeColor } from '../theme'\nimport { AuthGuard } from '../auth/AuthGuard'\nimport styles from './AdminRoot.module.css'\n\n/** Why the session can't be used — see `AdminRootUnavailable.reason`. */\nexport type AdminRootUnavailableReason = 'forbidden' | 'unreachable'\n\n/** The `unavailable` state of `AdminRoot` — the session could not be checked, or may not be used here. */\nexport interface AdminRootUnavailable {\n /** What failed — passed to `QueryError` (message, trace id). */\n error: unknown\n /**\n * Why. `'forbidden'` = a valid session this panel may not use (no retry, only Sign Out).\n * `'unreachable'` = the check itself failed (Try Again + Sign Out). Defaults to `'forbidden'` when the\n * error carries HTTP status 403 (`error.status` or `error.response.status`), else `'unreachable'`.\n */\n reason?: AdminRootUnavailableReason\n /** Re-runs the session check. Shown as \"Try Again\" for `'unreachable'` only. */\n onRetry?: () => void\n /**\n * The `AuthLayout` icon. Default: none — apps differ here (one shows a tinted `CloudCross`, another keeps\n * every auth page icon-free), so it's the app's choice.\n */\n icon?: IconName | false\n /** Tint for `icon` (`AuthLayout`'s `color`). Default `'error'`. */\n color?: ThemeColor\n}\n\n/** What an `unavailableFallback` receives. */\nexport interface AdminRootUnavailableFallbackProps {\n /** The `unavailable.error`. */\n error: unknown\n /** The resolved reason (explicit, or inferred from a 403). */\n reason: AdminRootUnavailableReason\n /** `unavailable.onRetry`, when given — whatever the reason (the fallback decides whether to offer it). */\n retry?: () => void\n /** The shell's Sign Out: `onLogout()`, then navigate to `loginPath`. */\n signOut: () => void\n}\n\n/** The minimal user shape `AdminRoot` reads — apps pass their own richer type via the generic. */\nexport interface AdminUser {\n name?: string\n email?: string\n avatar?: string\n}\n\nexport interface AdminRootProps<U extends AdminUser = AdminUser> {\n /** Brand mark for the sidebar top. */\n logo?: ReactNode\n /**\n * Where clicking the logo goes — the first menu page by default (see `RootLayout`'s `logoTo`); a path to\n * send it elsewhere, or `false` for a non-clickable logo.\n */\n logoTo?: RootLayoutProps['logoTo']\n /** Current user, or `null` when signed out. */\n getUser: () => U | null\n /** Clears the session; `AdminRoot` navigates to `loginPath` afterwards. */\n onLogout: () => void\n /** Route-id prefix for standalone public pages (rendered outside the shell). Default `'/_auth'`. */\n authRouteId?: string\n /** Guard target for signed-out visitors + post-logout redirect. Default `'/login'`. */\n loginPath?: string\n /** Show a `UserCard` in the sidebar footer. Default `true`. */\n showUserCard?: boolean\n /**\n * Extra `RootLayout` header config, merged **over** the defaults (the app's fields win). Flows through\n * unchanged — e.g. **`header.menu`** (`HeaderMenuItem[]`) adds items to the account menu above Sign out.\n */\n header?: RootLayoutHeader\n /**\n * Wrap the page content in an `ErrorBoundary` (reset on navigation), so a crashing page shows an\n * `ErrorState` inside the shell instead of a white screen. Default `true`; `false` opts out; an object\n * configures it (e.g. `{ onError: Sentry.captureException }` or a custom `fallback`). It only catches what\n * the router doesn't: TanStack Router catches a route's component / `loader` / `beforeLoad` errors in its own\n * per-route boundary, so page crashes need `createRouter({ defaultErrorComponent: PageError })`.\n */\n errorBoundary?: boolean | Omit<ErrorBoundaryProps, 'children' | 'resetKeys'>\n /**\n * The app is still finding out who is signed in (e.g. verifying a stored token or refreshing a cookie\n * session). While `true`, AdminRoot renders only `pendingFallback` — no shell, no public page, no\n * `AuthGuard`, and `getUser()` isn't read — so a signed-in admin is never redirected to sign-in before the\n * check resolves. Route `beforeLoad` guards (e.g. `authLayoutRoute`) still run in the router, independent\n * of this — they must tolerate the unknown state themselves. No minimum display time. Default `false`.\n */\n pending?: boolean\n /** What to show while `pending`. Default: a `Loader size=\"lg\"` centred in the full viewport. */\n pendingFallback?: ReactNode\n /**\n * The session could not be checked, or the server will not serve this account here. While set, AdminRoot\n * renders a standalone `AuthLayout` screen (the app's `logo`, a `QueryError`, Try Again / Sign Out) instead\n * of the shell or a public page — and never redirects. Sign Out calls `onLogout` then navigates to\n * `loginPath`, so **`onLogout` must clear whatever set `unavailable`** (or this screen shows again).\n * `pending` wins when both are set. `null` / `undefined` = not unavailable (the default).\n */\n unavailable?: AdminRootUnavailable | null\n /** Replaces the whole `unavailable` screen — for an app that needs its own wording or extra actions. */\n unavailableFallback?: (props: AdminRootUnavailableFallbackProps) => ReactNode\n}\n\n/**\n * Root-route component for admin apps — it wires up the whole shell orchestration so an app only has to\n * supply `logo` + `getUser` + `onLogout`. Public pages (route id under `authRouteId`) render standalone;\n * everything else renders inside the guarded admin shell (`RootLayout` + a sidebar `UserCard`), gated by\n * `AuthGuard` (signed-out visitors bounce to `loginPath`). Logout clears the session and navigates to\n * `loginPath`. Mounts exactly one app-wide `<Toaster/>` (the inner `RootLayout` gets `toaster={false}`),\n * and wraps the page in an `ErrorBoundary` that resets on navigation (`errorBoundary`, default on).\n * While the app is still checking the session, pass `pending` (a full-screen loader instead of a premature\n * sign-in redirect); when the check failed or the server refuses this account, pass `unavailable` (a\n * standalone \"Cannot Reach the Server\" / \"No Access\" screen with Try Again / Sign Out). The `Toaster` stays\n * mounted in both.\n *\n * `loginPath` is a plain string, cast loosely to the router's `to` type (the library can't know the\n * app's typed route tree). The generic `<U>` preserves the app's own user type through `getUser`.\n *\n * @example\n * // routes/__root.tsx\n * export const Route = createRootRoute({\n * component: () => {\n * const { status, error, retry } = useSession()\n * return (\n * <AdminRoot<AuthUser>\n * pending={status === 'loading'}\n * unavailable={status === 'unavailable' ? { error, onRetry: retry } : null}\n * logo={<Logo />}\n * getUser={getUser}\n * onLogout={logout}\n * />\n * )\n * },\n * })\n */\nexport const AdminRoot = <U extends AdminUser = AdminUser>({\n logo,\n logoTo,\n getUser,\n onLogout,\n authRouteId = '/_auth',\n loginPath = '/login',\n showUserCard = true,\n header,\n errorBoundary = true,\n pending = false,\n pendingFallback,\n unavailable,\n unavailableFallback,\n}: AdminRootProps<U>) => {\n const t = useT()\n const navigate = useNavigate()\n const isAuthRoute = useRouterState({\n select: (s) => s.matches.some((m) => m.routeId.startsWith(authRouteId)),\n })\n const pathname = useRouterState({ select: (s) => s.location?.pathname })\n const handleLogout = () => {\n onLogout()\n navigate({ to: loginPath as LinkProps['to'] })\n }\n\n // the session isn't known yet / can't be used — a standalone screen instead of the shell or a public\n // page (so no AuthGuard redirect, no sign-in flash). The Toaster stays, so a bootstrap toast isn't lost.\n if (pending || unavailable) {\n let gate: ReactNode\n if (pending) {\n gate = pendingFallback ?? (\n <div className={styles.pending} aria-busy=\"true\">\n <Loader size=\"lg\" />\n </div>\n )\n } else if (unavailable) {\n const reason: AdminRootUnavailableReason =\n unavailable.reason ??\n (getErrorStatus(unavailable.error) === 403 ? 'forbidden' : 'unreachable')\n if (unavailableFallback) {\n gate = unavailableFallback({\n error: unavailable.error,\n reason,\n retry: unavailable.onRetry,\n signOut: handleLogout,\n })\n } else {\n const retry = reason === 'unreachable' ? unavailable.onRetry : undefined\n const forbidden = reason === 'forbidden'\n gate = (\n <AuthLayout\n logo={logo}\n icon={unavailable.icon || undefined}\n color={unavailable.color ?? 'error'}\n title={t(forbidden ? 'adminRoot.noAccessTitle' : 'adminRoot.unreachableTitle')}\n subtitle={t(forbidden ? 'adminRoot.noAccessSubtitle' : 'adminRoot.unreachableSubtitle')}\n >\n <Col gap={16}>\n <QueryError variant=\"alert\" error={unavailable.error} />\n {retry ? (\n <Button fullWidth onClick={retry}>\n {t('errorState.retry')}\n </Button>\n ) : null}\n <Button fullWidth variant={retry ? 'filled' : 'contained'} onClick={handleLogout}>\n {t('userCard.signOut')}\n </Button>\n </Col>\n </AuthLayout>\n )\n }\n }\n return (\n <>\n {gate}\n <Toaster />\n </>\n )\n }\n\n const user = getUser()\n // the routed page, inside an ErrorBoundary that resets whenever the path changes\n const page =\n errorBoundary === false ? (\n <Outlet />\n ) : (\n <ErrorBoundary {...(errorBoundary === true ? {} : errorBoundary)} resetKeys={[pathname]}>\n <Outlet />\n </ErrorBoundary>\n )\n const content = isAuthRoute ? (\n page\n ) : (\n <AuthGuard isAuthenticated={user != null} redirectTo={loginPath}>\n <RootLayout\n logo={logo}\n logoTo={logoTo}\n toaster={false}\n header={{\n user: user ? { name: user.name, email: user.email, avatar: user.avatar } : undefined,\n onLogout: handleLogout,\n ...header,\n }}\n sidebarFooter={\n showUserCard && user ? (\n <UserCard\n name={user.name}\n email={user.email}\n avatar={user.avatar}\n onLogout={handleLogout}\n />\n ) : undefined\n }\n >\n {page}\n </RootLayout>\n </AuthGuard>\n )\n return (\n <>\n {content}\n <Toaster />\n </>\n )\n}\n"],"names":["AdminRoot","logo","logoTo","getUser","onLogout","authRouteId","loginPath","showUserCard","header","errorBoundary","pending","pendingFallback","unavailable","unavailableFallback","t","useT","navigate","useNavigate","isAuthRoute","useRouterState","s","m","pathname","_a","handleLogout","gate","jsx","styles","Loader","reason","getErrorStatus","retry","forbidden","AuthLayout","jsxs","Col","QueryError","Button","Fragment","Toaster","user","page","Outlet","ErrorBoundary","content","AuthGuard","RootLayout","UserCard"],"mappings":"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"}
1
+ {"version":3,"file":"AdminRoot-kGG0oPN_.js","sources":["../src/app/AdminRoot.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Outlet, useNavigate, useRouterState, type LinkProps } from '@tanstack/react-router'\nimport {\n AuthLayout,\n Button,\n Col,\n ErrorBoundary,\n Loader,\n QueryError,\n RootLayout,\n UserCard,\n Toaster,\n type ErrorBoundaryProps,\n type IconName,\n type RootLayoutHeader,\n type RootLayoutProps,\n} from '../components'\nimport { getErrorStatus } from '../components/ErrorState/errorMessage'\nimport { useT, type ThemeColor } from '../theme'\nimport { AuthGuard } from '../auth/AuthGuard'\nimport styles from './AdminRoot.module.css'\n\n/** Why the session can't be used — see `AdminRootUnavailable.reason`. */\nexport type AdminRootUnavailableReason = 'forbidden' | 'unreachable'\n\n/** The `unavailable` state of `AdminRoot` — the session could not be checked, or may not be used here. */\nexport interface AdminRootUnavailable {\n /** What failed — passed to `QueryError` (message, trace id). */\n error: unknown\n /**\n * Why. `'forbidden'` = a valid session this panel may not use (no retry, only Sign Out).\n * `'unreachable'` = the check itself failed (Try Again + Sign Out). Defaults to `'forbidden'` when the\n * error carries HTTP status 403 (`error.status` or `error.response.status`), else `'unreachable'`.\n */\n reason?: AdminRootUnavailableReason\n /** Re-runs the session check. Shown as \"Try Again\" for `'unreachable'` only. */\n onRetry?: () => void\n /**\n * The `AuthLayout` icon. Default: none — apps differ here (one shows a tinted `CloudCross`, another keeps\n * every auth page icon-free), so it's the app's choice.\n */\n icon?: IconName | false\n /** Tint for `icon` (`AuthLayout`'s `color`). Default `'error'`. */\n color?: ThemeColor\n}\n\n/** What an `unavailableFallback` receives. */\nexport interface AdminRootUnavailableFallbackProps {\n /** The `unavailable.error`. */\n error: unknown\n /** The resolved reason (explicit, or inferred from a 403). */\n reason: AdminRootUnavailableReason\n /** `unavailable.onRetry`, when given — whatever the reason (the fallback decides whether to offer it). */\n retry?: () => void\n /** The shell's Sign Out: `onLogout()`, then navigate to `loginPath`. */\n signOut: () => void\n}\n\n/** The minimal user shape `AdminRoot` reads — apps pass their own richer type via the generic. */\nexport interface AdminUser {\n name?: string\n email?: string\n avatar?: string\n}\n\nexport interface AdminRootProps<U extends AdminUser = AdminUser> {\n /** Brand mark for the sidebar top. */\n logo?: ReactNode\n /**\n * Where clicking the logo goes — the first menu page by default (see `RootLayout`'s `logoTo`); a path to\n * send it elsewhere, or `false` for a non-clickable logo.\n */\n logoTo?: RootLayoutProps['logoTo']\n /** Current user, or `null` when signed out. */\n getUser: () => U | null\n /** Clears the session; `AdminRoot` navigates to `loginPath` afterwards. */\n onLogout: () => void\n /** Route-id prefix for standalone public pages (rendered outside the shell). Default `'/_auth'`. */\n authRouteId?: string\n /** Guard target for signed-out visitors + post-logout redirect. Default `'/login'`. */\n loginPath?: string\n /** Show a `UserCard` in the sidebar footer. Default `true`. */\n showUserCard?: boolean\n /**\n * Extra `RootLayout` header config, merged **over** the defaults (the app's fields win). Flows through\n * unchanged — e.g. **`header.menu`** (`HeaderMenuItem[]`) adds items to the account menu above Sign out.\n */\n header?: RootLayoutHeader\n /**\n * Wrap the page content in an `ErrorBoundary` (reset on navigation), so a crashing page shows an\n * `ErrorState` inside the shell instead of a white screen. Default `true`; `false` opts out; an object\n * configures it (e.g. `{ onError: Sentry.captureException }` or a custom `fallback`). It only catches what\n * the router doesn't: TanStack Router catches a route's component / `loader` / `beforeLoad` errors in its own\n * per-route boundary, so page crashes need `createRouter({ defaultErrorComponent: PageError })`.\n */\n errorBoundary?: boolean | Omit<ErrorBoundaryProps, 'children' | 'resetKeys'>\n /**\n * The app is still finding out who is signed in (e.g. verifying a stored token or refreshing a cookie\n * session). While `true`, AdminRoot renders only `pendingFallback` — no shell, no public page, no\n * `AuthGuard`, and `getUser()` isn't read — so a signed-in admin is never redirected to sign-in before the\n * check resolves. Route `beforeLoad` guards (e.g. `authLayoutRoute`) still run in the router, independent\n * of this — they must tolerate the unknown state themselves. No minimum display time. Default `false`.\n */\n pending?: boolean\n /** What to show while `pending`. Default: a `Loader size=\"lg\"` centred in the full viewport. */\n pendingFallback?: ReactNode\n /**\n * The session could not be checked, or the server will not serve this account here. While set, AdminRoot\n * renders a standalone `AuthLayout` screen (the app's `logo`, a `QueryError`, Try Again / Sign Out) instead\n * of the shell or a public page — and never redirects. Sign Out calls `onLogout` then navigates to\n * `loginPath`, so **`onLogout` must clear whatever set `unavailable`** (or this screen shows again).\n * `pending` wins when both are set. `null` / `undefined` = not unavailable (the default).\n */\n unavailable?: AdminRootUnavailable | null\n /** Replaces the whole `unavailable` screen — for an app that needs its own wording or extra actions. */\n unavailableFallback?: (props: AdminRootUnavailableFallbackProps) => ReactNode\n}\n\n/**\n * Root-route component for admin apps — it wires up the whole shell orchestration so an app only has to\n * supply `logo` + `getUser` + `onLogout`. Public pages (route id under `authRouteId`) render standalone;\n * everything else renders inside the guarded admin shell (`RootLayout` + a sidebar `UserCard`), gated by\n * `AuthGuard` (signed-out visitors bounce to `loginPath`). Logout clears the session and navigates to\n * `loginPath`. Mounts exactly one app-wide `<Toaster/>` (the inner `RootLayout` gets `toaster={false}`),\n * and wraps the page in an `ErrorBoundary` that resets on navigation (`errorBoundary`, default on).\n * While the app is still checking the session, pass `pending` (a full-screen loader instead of a premature\n * sign-in redirect); when the check failed or the server refuses this account, pass `unavailable` (a\n * standalone \"Cannot Reach the Server\" / \"No Access\" screen with Try Again / Sign Out). The `Toaster` stays\n * mounted in both.\n *\n * `loginPath` is a plain string, cast loosely to the router's `to` type (the library can't know the\n * app's typed route tree). The generic `<U>` preserves the app's own user type through `getUser`.\n *\n * @example\n * // routes/__root.tsx\n * export const Route = createRootRoute({\n * component: () => {\n * const { status, error, retry } = useSession()\n * return (\n * <AdminRoot<AuthUser>\n * pending={status === 'loading'}\n * unavailable={status === 'unavailable' ? { error, onRetry: retry } : null}\n * logo={<Logo />}\n * getUser={getUser}\n * onLogout={logout}\n * />\n * )\n * },\n * })\n */\nexport const AdminRoot = <U extends AdminUser = AdminUser>({\n logo,\n logoTo,\n getUser,\n onLogout,\n authRouteId = '/_auth',\n loginPath = '/login',\n showUserCard = true,\n header,\n errorBoundary = true,\n pending = false,\n pendingFallback,\n unavailable,\n unavailableFallback,\n}: AdminRootProps<U>) => {\n const t = useT()\n const navigate = useNavigate()\n const isAuthRoute = useRouterState({\n select: (s) => s.matches.some((m) => m.routeId.startsWith(authRouteId)),\n })\n const pathname = useRouterState({ select: (s) => s.location?.pathname })\n const handleLogout = () => {\n onLogout()\n navigate({ to: loginPath as LinkProps['to'] })\n }\n\n // the session isn't known yet / can't be used — a standalone screen instead of the shell or a public\n // page (so no AuthGuard redirect, no sign-in flash). The Toaster stays, so a bootstrap toast isn't lost.\n if (pending || unavailable) {\n let gate: ReactNode\n if (pending) {\n gate = pendingFallback ?? (\n <div className={styles.pending} aria-busy=\"true\">\n <Loader size=\"lg\" />\n </div>\n )\n } else if (unavailable) {\n const reason: AdminRootUnavailableReason =\n unavailable.reason ??\n (getErrorStatus(unavailable.error) === 403 ? 'forbidden' : 'unreachable')\n if (unavailableFallback) {\n gate = unavailableFallback({\n error: unavailable.error,\n reason,\n retry: unavailable.onRetry,\n signOut: handleLogout,\n })\n } else {\n const retry = reason === 'unreachable' ? unavailable.onRetry : undefined\n const forbidden = reason === 'forbidden'\n gate = (\n <AuthLayout\n logo={logo}\n icon={unavailable.icon || undefined}\n color={unavailable.color ?? 'error'}\n title={t(forbidden ? 'adminRoot.noAccessTitle' : 'adminRoot.unreachableTitle')}\n subtitle={t(forbidden ? 'adminRoot.noAccessSubtitle' : 'adminRoot.unreachableSubtitle')}\n >\n <Col gap={16}>\n <QueryError variant=\"alert\" error={unavailable.error} />\n {retry ? (\n <Button fullWidth onClick={retry}>\n {t('errorState.retry')}\n </Button>\n ) : null}\n <Button fullWidth variant={retry ? 'filled' : 'contained'} onClick={handleLogout}>\n {t('userCard.signOut')}\n </Button>\n </Col>\n </AuthLayout>\n )\n }\n }\n return (\n <>\n {gate}\n <Toaster />\n </>\n )\n }\n\n const user = getUser()\n // the routed page, inside an ErrorBoundary that resets whenever the path changes\n const page =\n errorBoundary === false ? (\n <Outlet />\n ) : (\n <ErrorBoundary {...(errorBoundary === true ? {} : errorBoundary)} resetKeys={[pathname]}>\n <Outlet />\n </ErrorBoundary>\n )\n const content = isAuthRoute ? (\n page\n ) : (\n <AuthGuard isAuthenticated={user != null} redirectTo={loginPath}>\n <RootLayout\n logo={logo}\n logoTo={logoTo}\n toaster={false}\n header={{\n user: user ? { name: user.name, email: user.email, avatar: user.avatar } : undefined,\n onLogout: handleLogout,\n ...header,\n }}\n sidebarFooter={\n showUserCard && user ? (\n <UserCard\n name={user.name}\n email={user.email}\n avatar={user.avatar}\n onLogout={handleLogout}\n />\n ) : undefined\n }\n >\n {page}\n </RootLayout>\n </AuthGuard>\n )\n return (\n <>\n {content}\n <Toaster />\n </>\n )\n}\n"],"names":["AdminRoot","logo","logoTo","getUser","onLogout","authRouteId","loginPath","showUserCard","header","errorBoundary","pending","pendingFallback","unavailable","unavailableFallback","t","useT","navigate","useNavigate","isAuthRoute","useRouterState","s","m","pathname","_a","handleLogout","gate","jsx","styles","Loader","reason","getErrorStatus","retry","forbidden","AuthLayout","jsxs","Col","QueryError","Button","Fragment","Toaster","user","page","Outlet","ErrorBoundary","content","AuthGuard","RootLayout","UserCard"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),x=require("react"),I=require("clsx"),l=require("./Icon-BUP5_kRs.cjs"),g=require("./names-YOCJ4B5J.cjs"),C=require("./IconButton-CYMvszcM.cjs"),N=require("./ConfigProvider-th4GYhcU.cjs"),j="_alert_13lvf_3",q="_filled_13lvf_19",h="_contained_13lvf_22",A="_outlined_13lvf_26",b="_text_13lvf_30",z="_icon_13lvf_35",E="_message_13lvf_44",T="_action_13lvf_50",w="_close_13lvf_57",s={alert:j,filled:q,contained:h,outlined:A,text:b,icon:z,message:E,action:T,close:w},y=new Set(g.ICON_NAMES),O={success:"TickCircle",error:"CloseCircle",warning:"Warning",info:"InfoCircle"},S=x.forwardRef(function({variant:i="filled",color:t="info",icon:n,action:c,onClose:o,closeLabel:a,className:_,style:f,children:d,...u},m){const v=N.useT(),r=n===!1?null:n==null?e.jsx(l.Icon,{name:O[t]??"InfoCircle"}):typeof n=="string"&&y.has(n)?e.jsx(l.Icon,{name:n}):n;return e.jsxs("div",{ref:m,role:"alert",className:I.clsx(s.alert,s[i],_),style:{"--tz-btn-rgb":`var(--tz-color-${t}-rgb)`,"--tz-btn-on":`var(--tz-color-${t}-contrast, #fff)`,...f},...u,children:[r!=null&&e.jsx("span",{className:s.icon,"aria-hidden":!0,children:r}),e.jsx("div",{className:s.message,children:d}),c!=null&&e.jsx("div",{className:s.action,children:c}),o&&e.jsx(C.IconButton,{variant:"text",color:t,size:"sm",className:s.close,"aria-label":a??v("common.close"),onClick:o,children:e.jsx(l.Icon,{name:"Close"})})]})});exports.Alert=S;
2
- //# sourceMappingURL=Alert-CggrNMn5.cjs.map
1
+ "use strict";const e=require("react/jsx-runtime"),x=require("react"),I=require("clsx"),l=require("./Icon-BUP5_kRs.cjs"),g=require("./names-YOCJ4B5J.cjs"),C=require("./IconButton-CQ25TtBc.cjs"),N=require("./ConfigProvider-B_Bb6pk1.cjs"),j="_alert_13lvf_3",q="_filled_13lvf_19",h="_contained_13lvf_22",A="_outlined_13lvf_26",b="_text_13lvf_30",z="_icon_13lvf_35",E="_message_13lvf_44",T="_action_13lvf_50",w="_close_13lvf_57",s={alert:j,filled:q,contained:h,outlined:A,text:b,icon:z,message:E,action:T,close:w},y=new Set(g.ICON_NAMES),O={success:"TickCircle",error:"CloseCircle",warning:"Warning",info:"InfoCircle"},S=x.forwardRef(function({variant:i="filled",color:t="info",icon:n,action:c,onClose:o,closeLabel:a,className:_,style:f,children:d,...u},m){const v=N.useT(),r=n===!1?null:n==null?e.jsx(l.Icon,{name:O[t]??"InfoCircle"}):typeof n=="string"&&y.has(n)?e.jsx(l.Icon,{name:n}):n;return e.jsxs("div",{ref:m,role:"alert",className:I.clsx(s.alert,s[i],_),style:{"--tz-btn-rgb":`var(--tz-color-${t}-rgb)`,"--tz-btn-on":`var(--tz-color-${t}-contrast, #fff)`,...f},...u,children:[r!=null&&e.jsx("span",{className:s.icon,"aria-hidden":!0,children:r}),e.jsx("div",{className:s.message,children:d}),c!=null&&e.jsx("div",{className:s.action,children:c}),o&&e.jsx(C.IconButton,{variant:"text",color:t,size:"sm",className:s.close,"aria-label":a??v("common.close"),onClick:o,children:e.jsx(l.Icon,{name:"Close"})})]})});exports.Alert=S;
2
+ //# sourceMappingURL=Alert-B9gTeI7o.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert-CggrNMn5.cjs","sources":["../src/components/Alert/Alert.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Alert.module.css'\n\nexport type AlertVariant = 'contained' | 'filled' | 'outlined' | 'text'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Default leading icon per semantic color (other colors fall back to `InfoCircle`). */\nconst DEFAULT_ICON: Partial<Record<ThemeColor, IconName>> = {\n success: 'TickCircle',\n error: 'CloseCircle',\n warning: 'Warning',\n info: 'InfoCircle',\n}\n\nexport interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'title'> {\n /** Tint style. Defaults to `filled` (the soft tint). */\n variant?: AlertVariant\n /** Brand / semantic palette token that tints the alert. Defaults to `info`. */\n color?: ThemeColor\n /**\n * Leading icon — a known `IconName`, any node, or `false` to hide it. Defaults to the semantic icon\n * for `color` (success → `TickCircle`, error → `CloseCircle`, warning → `Warning`, info → `InfoCircle`).\n */\n icon?: IconName | ReactNode | false\n /** Trailing action (e.g. an `UNDO` button), placed before the close button. */\n action?: ReactNode\n /** When provided, a trailing × close button appears that calls this. */\n onClose?: () => void\n /** Accessible label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string\n /** Alert message. */\n children?: ReactNode\n}\n\n/**\n * A message banner — the library's inline feedback surface (info, success, warning, error). Tinted by\n * `color` via the shared `--tz-btn-rgb` pattern across the 4 standard `variant`s; a semantic leading\n * `icon` is auto-picked per color (override with `icon`, or `icon={false}` to drop it). An optional\n * `action` slot (e.g. an `UNDO` button) and an `onClose` × button trail the message. `role=\"alert\"`.\n */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n {\n variant = 'filled',\n color = 'info',\n icon,\n action,\n onClose,\n closeLabel,\n className,\n style,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const renderedIcon =\n icon === false ? null : icon == null ? (\n <Icon name={DEFAULT_ICON[color] ?? 'InfoCircle'} />\n ) : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={clsx(styles.alert, styles[variant], className)}\n style={\n {\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 {...props}\n >\n {renderedIcon != null && (\n <span className={styles.icon} aria-hidden>\n {renderedIcon}\n </span>\n )}\n <div className={styles.message}>{children}</div>\n {action != null && <div className={styles.action}>{action}</div>}\n {onClose && (\n <IconButton\n variant=\"text\"\n color={color}\n size=\"sm\"\n className={styles.close}\n aria-label={closeLabel ?? t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","DEFAULT_ICON","Alert","forwardRef","variant","color","icon","action","onClose","closeLabel","className","style","children","props","ref","t","useT","renderedIcon","jsx","Icon","jsxs","clsx","styles","IconButton"],"mappings":"6fAUMA,EAAgB,IAAI,IAAYC,YAAU,EAG1CC,EAAsD,CAC1D,QAAS,aACT,MAAO,cACP,QAAS,UACT,KAAM,YACR,EA4BaC,EAAQC,EAAAA,WAAuC,SAC1D,CACE,QAAAC,EAAU,SACV,MAAAC,EAAQ,OACR,KAAAC,EACA,OAAAC,EACA,QAAAC,EACA,WAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EACJX,IAAS,GAAQ,KAAOA,GAAQ,KAC9BY,EAAAA,IAACC,EAAAA,KAAA,CAAK,KAAMlB,EAAaI,CAAK,GAAK,aAAc,EAC/C,OAAOC,GAAS,UAAYP,EAAc,IAAIO,CAAI,EACpDY,EAAAA,IAACC,EAAAA,KAAA,CAAK,KAAMb,CAAA,CAAkB,EAE9BA,EAGJ,OACEc,EAAAA,KAAC,MAAA,CACC,IAAAN,EACA,KAAK,QACL,UAAWO,EAAAA,KAAKC,EAAO,MAAOA,EAAOlB,CAAO,EAAGM,CAAS,EACxD,MACE,CACE,eAAgB,kBAAkBL,CAAK,QACvC,cAAe,kBAAkBA,CAAK,mBACtC,GAAGM,CAAA,EAGN,GAAGE,EAEH,SAAA,CAAAI,GAAgB,YACd,OAAA,CAAK,UAAWK,EAAO,KAAM,cAAW,GACtC,SAAAL,CAAA,CACH,EAEFC,EAAAA,IAAC,MAAA,CAAI,UAAWI,EAAO,QAAU,SAAAV,EAAS,EACzCL,GAAU,MAAQW,EAAAA,IAAC,OAAI,UAAWI,EAAO,OAAS,SAAAf,EAAO,EACzDC,GACCU,EAAAA,IAACK,EAAAA,WAAA,CACC,QAAQ,OACR,MAAAlB,EACA,KAAK,KACL,UAAWiB,EAAO,MAClB,aAAYb,GAAcM,EAAE,cAAc,EAC1C,QAASP,EAET,SAAAU,EAAAA,IAACC,EAAAA,KAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CAAA,CACrB,CAAA,CAAA,CAIR,CAAC"}
1
+ {"version":3,"file":"Alert-B9gTeI7o.cjs","sources":["../src/components/Alert/Alert.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Alert.module.css'\n\nexport type AlertVariant = 'contained' | 'filled' | 'outlined' | 'text'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Default leading icon per semantic color (other colors fall back to `InfoCircle`). */\nconst DEFAULT_ICON: Partial<Record<ThemeColor, IconName>> = {\n success: 'TickCircle',\n error: 'CloseCircle',\n warning: 'Warning',\n info: 'InfoCircle',\n}\n\nexport interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'title'> {\n /** Tint style. Defaults to `filled` (the soft tint). */\n variant?: AlertVariant\n /** Brand / semantic palette token that tints the alert. Defaults to `info`. */\n color?: ThemeColor\n /**\n * Leading icon — a known `IconName`, any node, or `false` to hide it. Defaults to the semantic icon\n * for `color` (success → `TickCircle`, error → `CloseCircle`, warning → `Warning`, info → `InfoCircle`).\n */\n icon?: IconName | ReactNode | false\n /** Trailing action (e.g. an `UNDO` button), placed before the close button. */\n action?: ReactNode\n /** When provided, a trailing × close button appears that calls this. */\n onClose?: () => void\n /** Accessible label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string\n /** Alert message. */\n children?: ReactNode\n}\n\n/**\n * A message banner — the library's inline feedback surface (info, success, warning, error). Tinted by\n * `color` via the shared `--tz-btn-rgb` pattern across the 4 standard `variant`s; a semantic leading\n * `icon` is auto-picked per color (override with `icon`, or `icon={false}` to drop it). An optional\n * `action` slot (e.g. an `UNDO` button) and an `onClose` × button trail the message. `role=\"alert\"`.\n */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n {\n variant = 'filled',\n color = 'info',\n icon,\n action,\n onClose,\n closeLabel,\n className,\n style,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const renderedIcon =\n icon === false ? null : icon == null ? (\n <Icon name={DEFAULT_ICON[color] ?? 'InfoCircle'} />\n ) : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={clsx(styles.alert, styles[variant], className)}\n style={\n {\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 {...props}\n >\n {renderedIcon != null && (\n <span className={styles.icon} aria-hidden>\n {renderedIcon}\n </span>\n )}\n <div className={styles.message}>{children}</div>\n {action != null && <div className={styles.action}>{action}</div>}\n {onClose && (\n <IconButton\n variant=\"text\"\n color={color}\n size=\"sm\"\n className={styles.close}\n aria-label={closeLabel ?? t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","DEFAULT_ICON","Alert","forwardRef","variant","color","icon","action","onClose","closeLabel","className","style","children","props","ref","t","useT","renderedIcon","jsx","Icon","jsxs","clsx","styles","IconButton"],"mappings":"6fAUMA,EAAgB,IAAI,IAAYC,YAAU,EAG1CC,EAAsD,CAC1D,QAAS,aACT,MAAO,cACP,QAAS,UACT,KAAM,YACR,EA4BaC,EAAQC,EAAAA,WAAuC,SAC1D,CACE,QAAAC,EAAU,SACV,MAAAC,EAAQ,OACR,KAAAC,EACA,OAAAC,EACA,QAAAC,EACA,WAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EACJX,IAAS,GAAQ,KAAOA,GAAQ,KAC9BY,EAAAA,IAACC,EAAAA,KAAA,CAAK,KAAMlB,EAAaI,CAAK,GAAK,aAAc,EAC/C,OAAOC,GAAS,UAAYP,EAAc,IAAIO,CAAI,EACpDY,EAAAA,IAACC,EAAAA,KAAA,CAAK,KAAMb,CAAA,CAAkB,EAE9BA,EAGJ,OACEc,EAAAA,KAAC,MAAA,CACC,IAAAN,EACA,KAAK,QACL,UAAWO,EAAAA,KAAKC,EAAO,MAAOA,EAAOlB,CAAO,EAAGM,CAAS,EACxD,MACE,CACE,eAAgB,kBAAkBL,CAAK,QACvC,cAAe,kBAAkBA,CAAK,mBACtC,GAAGM,CAAA,EAGN,GAAGE,EAEH,SAAA,CAAAI,GAAgB,YACd,OAAA,CAAK,UAAWK,EAAO,KAAM,cAAW,GACtC,SAAAL,CAAA,CACH,EAEFC,EAAAA,IAAC,MAAA,CAAI,UAAWI,EAAO,QAAU,SAAAV,EAAS,EACzCL,GAAU,MAAQW,EAAAA,IAAC,OAAI,UAAWI,EAAO,OAAS,SAAAf,EAAO,EACzDC,GACCU,EAAAA,IAACK,EAAAA,WAAA,CACC,QAAQ,OACR,MAAAlB,EACA,KAAK,KACL,UAAWiB,EAAO,MAClB,aAAYb,GAAcM,EAAE,cAAc,EAC1C,QAASP,EAET,SAAAU,EAAAA,IAACC,EAAAA,KAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CAAA,CACrB,CAAA,CAAA,CAIR,CAAC"}
@@ -3,8 +3,8 @@ import { forwardRef as I } from "react";
3
3
  import { clsx as N } from "clsx";
4
4
  import { I as l } from "./Icon-CGQ5yGSZ.js";
5
5
  import { a as g } from "./names-BR1uJs0-.js";
6
- import { I as C } from "./IconButton-BUmXN_lD.js";
7
- import { a as x } from "./ConfigProvider-DZMtq2Fz.js";
6
+ import { I as C } from "./IconButton-06pmftMo.js";
7
+ import { a as x } from "./ConfigProvider-DeMASTVo.js";
8
8
  const h = "_alert_13lvf_3", A = "_filled_13lvf_19", b = "_contained_13lvf_22", z = "_outlined_13lvf_26", E = "_text_13lvf_30", T = "_icon_13lvf_35", w = "_message_13lvf_44", y = "_action_13lvf_50", O = "_close_13lvf_57", n = {
9
9
  alert: h,
10
10
  filled: A,
@@ -68,4 +68,4 @@ const h = "_alert_13lvf_3", A = "_filled_13lvf_19", b = "_contained_13lvf_22", z
68
68
  export {
69
69
  U as A
70
70
  };
71
- //# sourceMappingURL=Alert-BXtQFAVl.js.map
71
+ //# sourceMappingURL=Alert-DXPlWb-U.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert-BXtQFAVl.js","sources":["../src/components/Alert/Alert.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Alert.module.css'\n\nexport type AlertVariant = 'contained' | 'filled' | 'outlined' | 'text'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Default leading icon per semantic color (other colors fall back to `InfoCircle`). */\nconst DEFAULT_ICON: Partial<Record<ThemeColor, IconName>> = {\n success: 'TickCircle',\n error: 'CloseCircle',\n warning: 'Warning',\n info: 'InfoCircle',\n}\n\nexport interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'title'> {\n /** Tint style. Defaults to `filled` (the soft tint). */\n variant?: AlertVariant\n /** Brand / semantic palette token that tints the alert. Defaults to `info`. */\n color?: ThemeColor\n /**\n * Leading icon — a known `IconName`, any node, or `false` to hide it. Defaults to the semantic icon\n * for `color` (success → `TickCircle`, error → `CloseCircle`, warning → `Warning`, info → `InfoCircle`).\n */\n icon?: IconName | ReactNode | false\n /** Trailing action (e.g. an `UNDO` button), placed before the close button. */\n action?: ReactNode\n /** When provided, a trailing × close button appears that calls this. */\n onClose?: () => void\n /** Accessible label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string\n /** Alert message. */\n children?: ReactNode\n}\n\n/**\n * A message banner — the library's inline feedback surface (info, success, warning, error). Tinted by\n * `color` via the shared `--tz-btn-rgb` pattern across the 4 standard `variant`s; a semantic leading\n * `icon` is auto-picked per color (override with `icon`, or `icon={false}` to drop it). An optional\n * `action` slot (e.g. an `UNDO` button) and an `onClose` × button trail the message. `role=\"alert\"`.\n */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n {\n variant = 'filled',\n color = 'info',\n icon,\n action,\n onClose,\n closeLabel,\n className,\n style,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const renderedIcon =\n icon === false ? null : icon == null ? (\n <Icon name={DEFAULT_ICON[color] ?? 'InfoCircle'} />\n ) : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={clsx(styles.alert, styles[variant], className)}\n style={\n {\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 {...props}\n >\n {renderedIcon != null && (\n <span className={styles.icon} aria-hidden>\n {renderedIcon}\n </span>\n )}\n <div className={styles.message}>{children}</div>\n {action != null && <div className={styles.action}>{action}</div>}\n {onClose && (\n <IconButton\n variant=\"text\"\n color={color}\n size=\"sm\"\n className={styles.close}\n aria-label={closeLabel ?? t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","DEFAULT_ICON","Alert","forwardRef","variant","color","icon","action","onClose","closeLabel","className","style","children","props","ref","t","useT","renderedIcon","jsx","Icon","jsxs","clsx","styles","IconButton"],"mappings":";;;;;;;;;;;;;;;;;GAUMA,IAAgB,IAAI,IAAYC,CAAU,GAG1CC,IAAsD;AAAA,EAC1D,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AACR,GA4BaC,IAAQC,EAAuC,SAC1D;AAAA,EACE,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IACJX,MAAS,KAAQ,OAAOA,KAAQ,OAC9B,gBAAAY,EAACC,GAAA,EAAK,MAAMlB,EAAaI,CAAK,KAAK,cAAc,IAC/C,OAAOC,KAAS,YAAYP,EAAc,IAAIO,CAAI,IACpD,gBAAAY,EAACC,GAAA,EAAK,MAAMb,EAAA,CAAkB,IAE9BA;AAGJ,SACE,gBAAAc;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,MAAK;AAAA,MACL,WAAWO,EAAKC,EAAO,OAAOA,EAAOlB,CAAO,GAAGM,CAAS;AAAA,MACxD,OACE;AAAA,QACE,gBAAgB,kBAAkBL,CAAK;AAAA,QACvC,eAAe,kBAAkBA,CAAK;AAAA,QACtC,GAAGM;AAAA,MAAA;AAAA,MAGN,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAI,KAAgB,0BACd,QAAA,EAAK,WAAWK,EAAO,MAAM,eAAW,IACtC,UAAAL,EAAA,CACH;AAAA,QAEF,gBAAAC,EAAC,OAAA,EAAI,WAAWI,EAAO,SAAU,UAAAV,GAAS;AAAA,QACzCL,KAAU,QAAQ,gBAAAW,EAAC,SAAI,WAAWI,EAAO,QAAS,UAAAf,GAAO;AAAA,QACzDC,KACC,gBAAAU;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAAlB;AAAA,YACA,MAAK;AAAA,YACL,WAAWiB,EAAO;AAAA,YAClB,cAAYb,KAAcM,EAAE,cAAc;AAAA,YAC1C,SAASP;AAAA,YAET,UAAA,gBAAAU,EAACC,GAAA,EAAK,MAAK,QAAA,CAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MACrB;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
1
+ {"version":3,"file":"Alert-DXPlWb-U.js","sources":["../src/components/Alert/Alert.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Alert.module.css'\n\nexport type AlertVariant = 'contained' | 'filled' | 'outlined' | 'text'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Default leading icon per semantic color (other colors fall back to `InfoCircle`). */\nconst DEFAULT_ICON: Partial<Record<ThemeColor, IconName>> = {\n success: 'TickCircle',\n error: 'CloseCircle',\n warning: 'Warning',\n info: 'InfoCircle',\n}\n\nexport interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'title'> {\n /** Tint style. Defaults to `filled` (the soft tint). */\n variant?: AlertVariant\n /** Brand / semantic palette token that tints the alert. Defaults to `info`. */\n color?: ThemeColor\n /**\n * Leading icon — a known `IconName`, any node, or `false` to hide it. Defaults to the semantic icon\n * for `color` (success → `TickCircle`, error → `CloseCircle`, warning → `Warning`, info → `InfoCircle`).\n */\n icon?: IconName | ReactNode | false\n /** Trailing action (e.g. an `UNDO` button), placed before the close button. */\n action?: ReactNode\n /** When provided, a trailing × close button appears that calls this. */\n onClose?: () => void\n /** Accessible label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string\n /** Alert message. */\n children?: ReactNode\n}\n\n/**\n * A message banner — the library's inline feedback surface (info, success, warning, error). Tinted by\n * `color` via the shared `--tz-btn-rgb` pattern across the 4 standard `variant`s; a semantic leading\n * `icon` is auto-picked per color (override with `icon`, or `icon={false}` to drop it). An optional\n * `action` slot (e.g. an `UNDO` button) and an `onClose` × button trail the message. `role=\"alert\"`.\n */\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n {\n variant = 'filled',\n color = 'info',\n icon,\n action,\n onClose,\n closeLabel,\n className,\n style,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const renderedIcon =\n icon === false ? null : icon == null ? (\n <Icon name={DEFAULT_ICON[color] ?? 'InfoCircle'} />\n ) : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={clsx(styles.alert, styles[variant], className)}\n style={\n {\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 {...props}\n >\n {renderedIcon != null && (\n <span className={styles.icon} aria-hidden>\n {renderedIcon}\n </span>\n )}\n <div className={styles.message}>{children}</div>\n {action != null && <div className={styles.action}>{action}</div>}\n {onClose && (\n <IconButton\n variant=\"text\"\n color={color}\n size=\"sm\"\n className={styles.close}\n aria-label={closeLabel ?? t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","DEFAULT_ICON","Alert","forwardRef","variant","color","icon","action","onClose","closeLabel","className","style","children","props","ref","t","useT","renderedIcon","jsx","Icon","jsxs","clsx","styles","IconButton"],"mappings":";;;;;;;;;;;;;;;;;GAUMA,IAAgB,IAAI,IAAYC,CAAU,GAG1CC,IAAsD;AAAA,EAC1D,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AACR,GA4BaC,IAAQC,EAAuC,SAC1D;AAAA,EACE,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IACJX,MAAS,KAAQ,OAAOA,KAAQ,OAC9B,gBAAAY,EAACC,GAAA,EAAK,MAAMlB,EAAaI,CAAK,KAAK,cAAc,IAC/C,OAAOC,KAAS,YAAYP,EAAc,IAAIO,CAAI,IACpD,gBAAAY,EAACC,GAAA,EAAK,MAAMb,EAAA,CAAkB,IAE9BA;AAGJ,SACE,gBAAAc;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,MAAK;AAAA,MACL,WAAWO,EAAKC,EAAO,OAAOA,EAAOlB,CAAO,GAAGM,CAAS;AAAA,MACxD,OACE;AAAA,QACE,gBAAgB,kBAAkBL,CAAK;AAAA,QACvC,eAAe,kBAAkBA,CAAK;AAAA,QACtC,GAAGM;AAAA,MAAA;AAAA,MAGN,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAI,KAAgB,0BACd,QAAA,EAAK,WAAWK,EAAO,MAAM,eAAW,IACtC,UAAAL,EAAA,CACH;AAAA,QAEF,gBAAAC,EAAC,OAAA,EAAI,WAAWI,EAAO,SAAU,UAAAV,GAAS;AAAA,QACzCL,KAAU,QAAQ,gBAAAW,EAAC,SAAI,WAAWI,EAAO,QAAS,UAAAf,GAAO;AAAA,QACzDC,KACC,gBAAAU;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAAlB;AAAA,YACA,MAAK;AAAA,YACL,WAAWiB,EAAO;AAAA,YAClB,cAAYb,KAAcM,EAAE,cAAc;AAAA,YAC1C,SAASP;AAAA,YAET,UAAA,gBAAAU,EAACC,GAAA,EAAK,MAAK,QAAA,CAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MACrB;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),m=require("@tanstack/react-router"),t=require("./Icon-BUP5_kRs.cjs"),b=require("./names-YOCJ4B5J.cjs"),_=require("./Sidebar-D-nR8Cu6.cjs"),d=require("./ConfigProvider-th4GYhcU.cjs"),h="_breadcrumbs_c3mqv_4",j="_list_c3mqv_8",N="_item_c3mqv_18",q="_home_c3mqv_27",x="_separator_c3mqv_39",v="_link_c3mqv_50",p="_current_c3mqv_61",s={breadcrumbs:h,list:j,item:N,home:q,separator:x,link:v,current:p},u=r=>r,k=new Set(b.ICON_NAMES);function f({separator:r}){return typeof r=="string"&&k.has(r)?e.jsx(t.Icon,{name:r,size:"sm",className:s.separator}):e.jsx("span",{className:s.separator,"aria-hidden":"true",children:r})}function g({separator:r="ArrowRight4"}={}){const{homeTo:i,items:n}=_.useBreadcrumbs(),a=d.useT();return n.length===0?null:e.jsx("nav",{"aria-label":a("breadcrumbs.label"),className:s.breadcrumbs,children:e.jsxs("ol",{className:s.list,children:[e.jsx("li",{className:s.item,children:i?e.jsx(m.Link,{to:u(i),className:s.home,"aria-label":a("breadcrumbs.home"),children:e.jsx(t.Icon,{name:"Home2",size:"sm"})}):e.jsx("span",{className:s.home,"aria-label":a("breadcrumbs.home"),children:e.jsx(t.Icon,{name:"Home2",size:"sm"})})}),n.map((c,o)=>{const l=o===n.length-1;return e.jsxs("li",{className:s.item,children:[e.jsx(f,{separator:r}),c.to&&!l?e.jsx(m.Link,{to:u(c.to),className:s.link,children:c.label}):e.jsx("span",{className:s.current,"aria-current":l?"page":void 0,children:c.label})]},`${c.label}-${o}`)})]})})}exports.Breadcrumbs=g;
2
- //# sourceMappingURL=Breadcrumbs-Cpa_LSY2.cjs.map
1
+ "use strict";const e=require("react/jsx-runtime"),m=require("@tanstack/react-router"),t=require("./Icon-BUP5_kRs.cjs"),b=require("./names-YOCJ4B5J.cjs"),_=require("./Sidebar-C4i3P_Lu.cjs"),d=require("./ConfigProvider-B_Bb6pk1.cjs"),h="_breadcrumbs_c3mqv_4",j="_list_c3mqv_8",N="_item_c3mqv_18",q="_home_c3mqv_27",x="_separator_c3mqv_39",v="_link_c3mqv_50",p="_current_c3mqv_61",s={breadcrumbs:h,list:j,item:N,home:q,separator:x,link:v,current:p},u=r=>r,k=new Set(b.ICON_NAMES);function f({separator:r}){return typeof r=="string"&&k.has(r)?e.jsx(t.Icon,{name:r,size:"sm",className:s.separator}):e.jsx("span",{className:s.separator,"aria-hidden":"true",children:r})}function g({separator:r="ArrowRight4"}={}){const{homeTo:i,items:n}=_.useBreadcrumbs(),a=d.useT();return n.length===0?null:e.jsx("nav",{"aria-label":a("breadcrumbs.label"),className:s.breadcrumbs,children:e.jsxs("ol",{className:s.list,children:[e.jsx("li",{className:s.item,children:i?e.jsx(m.Link,{to:u(i),className:s.home,"aria-label":a("breadcrumbs.home"),children:e.jsx(t.Icon,{name:"Home2",size:"sm"})}):e.jsx("span",{className:s.home,"aria-label":a("breadcrumbs.home"),children:e.jsx(t.Icon,{name:"Home2",size:"sm"})})}),n.map((c,o)=>{const l=o===n.length-1;return e.jsxs("li",{className:s.item,children:[e.jsx(f,{separator:r}),c.to&&!l?e.jsx(m.Link,{to:u(c.to),className:s.link,children:c.label}):e.jsx("span",{className:s.current,"aria-current":l?"page":void 0,children:c.label})]},`${c.label}-${o}`)})]})})}exports.Breadcrumbs=g;
2
+ //# sourceMappingURL=Breadcrumbs-ByFf228Q.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs-Cpa_LSY2.cjs","sources":["../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Link, type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useBreadcrumbs } from '../Sidebar/Sidebar'\nimport styles from './Breadcrumbs.module.css'\n\nconst linkTo = (to: string) => to as LinkProps['to']\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface BreadcrumbsProps {\n /**\n * Separator between crumbs. A known `IconName` (the default `\"ArrowRight4\"`) renders as an icon; any\n * other string renders as plain text; or pass a node.\n */\n separator?: IconName | ReactNode\n}\n\nfunction Separator({ separator }: { separator: IconName | ReactNode }) {\n if (typeof separator === 'string' && ICON_NAME_SET.has(separator)) {\n return <Icon name={separator as IconName} size=\"sm\" className={styles.separator} />\n }\n return (\n <span className={styles.separator} aria-hidden=\"true\">\n {separator}\n </span>\n )\n}\n\n/**\n * Auto-generated breadcrumb trail for the current route, rendered at the top of `RootLayout`'s\n * content. It always starts with a home icon that links to the first allowed menu page (the same\n * target as `FirstRouteRedirect`), followed by one crumb per matched route that declares a\n * `staticData.name`. Intermediate crumbs link to their page when navigable; the current page is\n * plain text. Renders nothing when the current route has no named matches. Token-only styling.\n */\nexport function Breadcrumbs({ separator = 'ArrowRight4' }: BreadcrumbsProps = {}) {\n const { homeTo, items } = useBreadcrumbs()\n const t = useT()\n if (items.length === 0) return null\n\n return (\n <nav aria-label={t('breadcrumbs.label')} className={styles.breadcrumbs}>\n <ol className={styles.list}>\n <li className={styles.item}>\n {homeTo ? (\n <Link to={linkTo(homeTo)} className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </Link>\n ) : (\n <span className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </span>\n )}\n </li>\n {items.map((item, index) => {\n const isLast = index === items.length - 1\n return (\n <li className={styles.item} key={`${item.label}-${index}`}>\n <Separator separator={separator} />\n {item.to && !isLast ? (\n <Link to={linkTo(item.to)} className={styles.link}>\n {item.label}\n </Link>\n ) : (\n <span className={styles.current} aria-current={isLast ? 'page' : undefined}>\n {item.label}\n </span>\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n"],"names":["linkTo","to","ICON_NAME_SET","ICON_NAMES","Separator","separator","jsx","Icon","styles","Breadcrumbs","homeTo","items","useBreadcrumbs","t","useT","jsxs","Link","item","index","isLast"],"mappings":"8bAQMA,EAAUC,GAAeA,EACzBC,EAAgB,IAAI,IAAYC,YAAU,EAUhD,SAASC,EAAU,CAAE,UAAAC,GAAkD,CACrE,OAAI,OAAOA,GAAc,UAAYH,EAAc,IAAIG,CAAS,EACvDC,MAACC,EAAAA,MAAK,KAAMF,EAAuB,KAAK,KAAK,UAAWG,EAAO,UAAW,QAGhF,OAAA,CAAK,UAAWA,EAAO,UAAW,cAAY,OAC5C,SAAAH,EACH,CAEJ,CASO,SAASI,EAAY,CAAE,UAAAJ,EAAY,aAAA,EAAoC,CAAA,EAAI,CAChF,KAAM,CAAE,OAAAK,EAAQ,MAAAC,CAAA,EAAUC,iBAAA,EACpBC,EAAIC,EAAAA,KAAA,EACV,OAAIH,EAAM,SAAW,EAAU,KAG7BL,EAAAA,IAAC,MAAA,CAAI,aAAYO,EAAE,mBAAmB,EAAG,UAAWL,EAAO,YACzD,SAAAO,EAAAA,KAAC,KAAA,CAAG,UAAWP,EAAO,KACpB,SAAA,CAAAF,EAAAA,IAAC,MAAG,UAAWE,EAAO,KACnB,SAAAE,EACCJ,EAAAA,IAACU,EAAAA,MAAK,GAAIhB,EAAOU,CAAM,EAAG,UAAWF,EAAO,KAAM,aAAYK,EAAE,kBAAkB,EAChF,eAACN,EAAAA,KAAA,CAAK,KAAK,QAAQ,KAAK,KAAK,CAAA,CAC/B,QAEC,OAAA,CAAK,UAAWC,EAAO,KAAM,aAAYK,EAAE,kBAAkB,EAC5D,eAACN,EAAAA,KAAA,CAAK,KAAK,QAAQ,KAAK,KAAK,EAC/B,CAAA,CAEJ,EACCI,EAAM,IAAI,CAACM,EAAMC,IAAU,CAC1B,MAAMC,EAASD,IAAUP,EAAM,OAAS,EACxC,OACEI,EAAAA,KAAC,KAAA,CAAG,UAAWP,EAAO,KACpB,SAAA,CAAAF,MAACF,GAAU,UAAAC,EAAsB,EAChCY,EAAK,IAAM,CAACE,EACXb,EAAAA,IAACU,EAAAA,KAAA,CAAK,GAAIhB,EAAOiB,EAAK,EAAE,EAAG,UAAWT,EAAO,KAC1C,SAAAS,EAAK,KAAA,CACR,EAEAX,EAAAA,IAAC,OAAA,CAAK,UAAWE,EAAO,QAAS,eAAcW,EAAS,OAAS,OAC9D,SAAAF,EAAK,KAAA,CACR,CAAA,CAAA,EAT6B,GAAGA,EAAK,KAAK,IAAIC,CAAK,EAWvD,CAEJ,CAAC,CAAA,CAAA,CACH,CAAA,CACF,CAEJ"}
1
+ {"version":3,"file":"Breadcrumbs-ByFf228Q.cjs","sources":["../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Link, type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useBreadcrumbs } from '../Sidebar/Sidebar'\nimport styles from './Breadcrumbs.module.css'\n\nconst linkTo = (to: string) => to as LinkProps['to']\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface BreadcrumbsProps {\n /**\n * Separator between crumbs. A known `IconName` (the default `\"ArrowRight4\"`) renders as an icon; any\n * other string renders as plain text; or pass a node.\n */\n separator?: IconName | ReactNode\n}\n\nfunction Separator({ separator }: { separator: IconName | ReactNode }) {\n if (typeof separator === 'string' && ICON_NAME_SET.has(separator)) {\n return <Icon name={separator as IconName} size=\"sm\" className={styles.separator} />\n }\n return (\n <span className={styles.separator} aria-hidden=\"true\">\n {separator}\n </span>\n )\n}\n\n/**\n * Auto-generated breadcrumb trail for the current route, rendered at the top of `RootLayout`'s\n * content. It always starts with a home icon that links to the first allowed menu page (the same\n * target as `FirstRouteRedirect`), followed by one crumb per matched route that declares a\n * `staticData.name`. Intermediate crumbs link to their page when navigable; the current page is\n * plain text. Renders nothing when the current route has no named matches. Token-only styling.\n */\nexport function Breadcrumbs({ separator = 'ArrowRight4' }: BreadcrumbsProps = {}) {\n const { homeTo, items } = useBreadcrumbs()\n const t = useT()\n if (items.length === 0) return null\n\n return (\n <nav aria-label={t('breadcrumbs.label')} className={styles.breadcrumbs}>\n <ol className={styles.list}>\n <li className={styles.item}>\n {homeTo ? (\n <Link to={linkTo(homeTo)} className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </Link>\n ) : (\n <span className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </span>\n )}\n </li>\n {items.map((item, index) => {\n const isLast = index === items.length - 1\n return (\n <li className={styles.item} key={`${item.label}-${index}`}>\n <Separator separator={separator} />\n {item.to && !isLast ? (\n <Link to={linkTo(item.to)} className={styles.link}>\n {item.label}\n </Link>\n ) : (\n <span className={styles.current} aria-current={isLast ? 'page' : undefined}>\n {item.label}\n </span>\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n"],"names":["linkTo","to","ICON_NAME_SET","ICON_NAMES","Separator","separator","jsx","Icon","styles","Breadcrumbs","homeTo","items","useBreadcrumbs","t","useT","jsxs","Link","item","index","isLast"],"mappings":"8bAQMA,EAAUC,GAAeA,EACzBC,EAAgB,IAAI,IAAYC,YAAU,EAUhD,SAASC,EAAU,CAAE,UAAAC,GAAkD,CACrE,OAAI,OAAOA,GAAc,UAAYH,EAAc,IAAIG,CAAS,EACvDC,MAACC,EAAAA,MAAK,KAAMF,EAAuB,KAAK,KAAK,UAAWG,EAAO,UAAW,QAGhF,OAAA,CAAK,UAAWA,EAAO,UAAW,cAAY,OAC5C,SAAAH,EACH,CAEJ,CASO,SAASI,EAAY,CAAE,UAAAJ,EAAY,aAAA,EAAoC,CAAA,EAAI,CAChF,KAAM,CAAE,OAAAK,EAAQ,MAAAC,CAAA,EAAUC,iBAAA,EACpBC,EAAIC,EAAAA,KAAA,EACV,OAAIH,EAAM,SAAW,EAAU,KAG7BL,EAAAA,IAAC,MAAA,CAAI,aAAYO,EAAE,mBAAmB,EAAG,UAAWL,EAAO,YACzD,SAAAO,EAAAA,KAAC,KAAA,CAAG,UAAWP,EAAO,KACpB,SAAA,CAAAF,EAAAA,IAAC,MAAG,UAAWE,EAAO,KACnB,SAAAE,EACCJ,EAAAA,IAACU,EAAAA,MAAK,GAAIhB,EAAOU,CAAM,EAAG,UAAWF,EAAO,KAAM,aAAYK,EAAE,kBAAkB,EAChF,eAACN,EAAAA,KAAA,CAAK,KAAK,QAAQ,KAAK,KAAK,CAAA,CAC/B,QAEC,OAAA,CAAK,UAAWC,EAAO,KAAM,aAAYK,EAAE,kBAAkB,EAC5D,eAACN,EAAAA,KAAA,CAAK,KAAK,QAAQ,KAAK,KAAK,EAC/B,CAAA,CAEJ,EACCI,EAAM,IAAI,CAACM,EAAMC,IAAU,CAC1B,MAAMC,EAASD,IAAUP,EAAM,OAAS,EACxC,OACEI,EAAAA,KAAC,KAAA,CAAG,UAAWP,EAAO,KACpB,SAAA,CAAAF,MAACF,GAAU,UAAAC,EAAsB,EAChCY,EAAK,IAAM,CAACE,EACXb,EAAAA,IAACU,EAAAA,KAAA,CAAK,GAAIhB,EAAOiB,EAAK,EAAE,EAAG,UAAWT,EAAO,KAC1C,SAAAS,EAAK,KAAA,CACR,EAEAX,EAAAA,IAAC,OAAA,CAAK,UAAWE,EAAO,QAAS,eAAcW,EAAS,OAAS,OAC9D,SAAAF,EAAK,KAAA,CACR,CAAA,CAAA,EAT6B,GAAGA,EAAK,KAAK,IAAIC,CAAK,EAWvD,CAEJ,CAAC,CAAA,CAAA,CACH,CAAA,CACF,CAEJ"}
@@ -2,8 +2,8 @@ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import { Link as u } from "@tanstack/react-router";
3
3
  import { I as n } from "./Icon-CGQ5yGSZ.js";
4
4
  import { a as b } from "./names-BR1uJs0-.js";
5
- import { u as h } from "./Sidebar-nORfjIg8.js";
6
- import { a as d } from "./ConfigProvider-DZMtq2Fz.js";
5
+ import { u as h } from "./Sidebar-Cn2yCsG-.js";
6
+ import { a as d } from "./ConfigProvider-DeMASTVo.js";
7
7
  const p = "_breadcrumbs_c3mqv_4", N = "_list_c3mqv_8", f = "_item_c3mqv_18", v = "_home_c3mqv_27", q = "_separator_c3mqv_39", k = "_link_c3mqv_50", g = "_current_c3mqv_61", r = {
8
8
  breadcrumbs: p,
9
9
  list: N,
@@ -32,4 +32,4 @@ function w({ separator: s = "ArrowRight4" } = {}) {
32
32
  export {
33
33
  w as B
34
34
  };
35
- //# sourceMappingURL=Breadcrumbs-D_QnKw8q.js.map
35
+ //# sourceMappingURL=Breadcrumbs-etqxqMJd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs-D_QnKw8q.js","sources":["../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Link, type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useBreadcrumbs } from '../Sidebar/Sidebar'\nimport styles from './Breadcrumbs.module.css'\n\nconst linkTo = (to: string) => to as LinkProps['to']\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface BreadcrumbsProps {\n /**\n * Separator between crumbs. A known `IconName` (the default `\"ArrowRight4\"`) renders as an icon; any\n * other string renders as plain text; or pass a node.\n */\n separator?: IconName | ReactNode\n}\n\nfunction Separator({ separator }: { separator: IconName | ReactNode }) {\n if (typeof separator === 'string' && ICON_NAME_SET.has(separator)) {\n return <Icon name={separator as IconName} size=\"sm\" className={styles.separator} />\n }\n return (\n <span className={styles.separator} aria-hidden=\"true\">\n {separator}\n </span>\n )\n}\n\n/**\n * Auto-generated breadcrumb trail for the current route, rendered at the top of `RootLayout`'s\n * content. It always starts with a home icon that links to the first allowed menu page (the same\n * target as `FirstRouteRedirect`), followed by one crumb per matched route that declares a\n * `staticData.name`. Intermediate crumbs link to their page when navigable; the current page is\n * plain text. Renders nothing when the current route has no named matches. Token-only styling.\n */\nexport function Breadcrumbs({ separator = 'ArrowRight4' }: BreadcrumbsProps = {}) {\n const { homeTo, items } = useBreadcrumbs()\n const t = useT()\n if (items.length === 0) return null\n\n return (\n <nav aria-label={t('breadcrumbs.label')} className={styles.breadcrumbs}>\n <ol className={styles.list}>\n <li className={styles.item}>\n {homeTo ? (\n <Link to={linkTo(homeTo)} className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </Link>\n ) : (\n <span className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </span>\n )}\n </li>\n {items.map((item, index) => {\n const isLast = index === items.length - 1\n return (\n <li className={styles.item} key={`${item.label}-${index}`}>\n <Separator separator={separator} />\n {item.to && !isLast ? (\n <Link to={linkTo(item.to)} className={styles.link}>\n {item.label}\n </Link>\n ) : (\n <span className={styles.current} aria-current={isLast ? 'page' : undefined}>\n {item.label}\n </span>\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n"],"names":["linkTo","to","ICON_NAME_SET","ICON_NAMES","Separator","separator","jsx","Icon","styles","Breadcrumbs","homeTo","items","useBreadcrumbs","t","useT","jsxs","Link","item","index","isLast"],"mappings":";;;;;;;;;;;;;;GAQMA,IAAS,CAACC,MAAeA,GACzBC,IAAgB,IAAI,IAAYC,CAAU;AAUhD,SAASC,EAAU,EAAE,WAAAC,KAAkD;AACrE,SAAI,OAAOA,KAAc,YAAYH,EAAc,IAAIG,CAAS,IACvD,gBAAAC,EAACC,KAAK,MAAMF,GAAuB,MAAK,MAAK,WAAWG,EAAO,WAAW,sBAGhF,QAAA,EAAK,WAAWA,EAAO,WAAW,eAAY,QAC5C,UAAAH,GACH;AAEJ;AASO,SAASI,EAAY,EAAE,WAAAJ,IAAY,cAAA,IAAoC,CAAA,GAAI;AAChF,QAAM,EAAE,QAAAK,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GACpBC,IAAIC,EAAA;AACV,SAAIH,EAAM,WAAW,IAAU,OAG7B,gBAAAL,EAAC,OAAA,EAAI,cAAYO,EAAE,mBAAmB,GAAG,WAAWL,EAAO,aACzD,UAAA,gBAAAO,EAAC,MAAA,EAAG,WAAWP,EAAO,MACpB,UAAA;AAAA,IAAA,gBAAAF,EAAC,QAAG,WAAWE,EAAO,MACnB,UAAAE,IACC,gBAAAJ,EAACU,KAAK,IAAIhB,EAAOU,CAAM,GAAG,WAAWF,EAAO,MAAM,cAAYK,EAAE,kBAAkB,GAChF,4BAACN,GAAA,EAAK,MAAK,SAAQ,MAAK,MAAK,EAAA,CAC/B,sBAEC,QAAA,EAAK,WAAWC,EAAO,MAAM,cAAYK,EAAE,kBAAkB,GAC5D,4BAACN,GAAA,EAAK,MAAK,SAAQ,MAAK,MAAK,GAC/B,EAAA,CAEJ;AAAA,IACCI,EAAM,IAAI,CAACM,GAAMC,MAAU;AAC1B,YAAMC,IAASD,MAAUP,EAAM,SAAS;AACxC,aACE,gBAAAI,EAAC,MAAA,EAAG,WAAWP,EAAO,MACpB,UAAA;AAAA,QAAA,gBAAAF,EAACF,KAAU,WAAAC,GAAsB;AAAA,QAChCY,EAAK,MAAM,CAACE,IACX,gBAAAb,EAACU,GAAA,EAAK,IAAIhB,EAAOiB,EAAK,EAAE,GAAG,WAAWT,EAAO,MAC1C,UAAAS,EAAK,MAAA,CACR,IAEA,gBAAAX,EAAC,QAAA,EAAK,WAAWE,EAAO,SAAS,gBAAcW,IAAS,SAAS,QAC9D,UAAAF,EAAK,MAAA,CACR;AAAA,MAAA,EAAA,GAT6B,GAAGA,EAAK,KAAK,IAAIC,CAAK,EAWvD;AAAA,IAEJ,CAAC;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"Breadcrumbs-etqxqMJd.js","sources":["../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Link, type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useBreadcrumbs } from '../Sidebar/Sidebar'\nimport styles from './Breadcrumbs.module.css'\n\nconst linkTo = (to: string) => to as LinkProps['to']\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface BreadcrumbsProps {\n /**\n * Separator between crumbs. A known `IconName` (the default `\"ArrowRight4\"`) renders as an icon; any\n * other string renders as plain text; or pass a node.\n */\n separator?: IconName | ReactNode\n}\n\nfunction Separator({ separator }: { separator: IconName | ReactNode }) {\n if (typeof separator === 'string' && ICON_NAME_SET.has(separator)) {\n return <Icon name={separator as IconName} size=\"sm\" className={styles.separator} />\n }\n return (\n <span className={styles.separator} aria-hidden=\"true\">\n {separator}\n </span>\n )\n}\n\n/**\n * Auto-generated breadcrumb trail for the current route, rendered at the top of `RootLayout`'s\n * content. It always starts with a home icon that links to the first allowed menu page (the same\n * target as `FirstRouteRedirect`), followed by one crumb per matched route that declares a\n * `staticData.name`. Intermediate crumbs link to their page when navigable; the current page is\n * plain text. Renders nothing when the current route has no named matches. Token-only styling.\n */\nexport function Breadcrumbs({ separator = 'ArrowRight4' }: BreadcrumbsProps = {}) {\n const { homeTo, items } = useBreadcrumbs()\n const t = useT()\n if (items.length === 0) return null\n\n return (\n <nav aria-label={t('breadcrumbs.label')} className={styles.breadcrumbs}>\n <ol className={styles.list}>\n <li className={styles.item}>\n {homeTo ? (\n <Link to={linkTo(homeTo)} className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </Link>\n ) : (\n <span className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </span>\n )}\n </li>\n {items.map((item, index) => {\n const isLast = index === items.length - 1\n return (\n <li className={styles.item} key={`${item.label}-${index}`}>\n <Separator separator={separator} />\n {item.to && !isLast ? (\n <Link to={linkTo(item.to)} className={styles.link}>\n {item.label}\n </Link>\n ) : (\n <span className={styles.current} aria-current={isLast ? 'page' : undefined}>\n {item.label}\n </span>\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n"],"names":["linkTo","to","ICON_NAME_SET","ICON_NAMES","Separator","separator","jsx","Icon","styles","Breadcrumbs","homeTo","items","useBreadcrumbs","t","useT","jsxs","Link","item","index","isLast"],"mappings":";;;;;;;;;;;;;;GAQMA,IAAS,CAACC,MAAeA,GACzBC,IAAgB,IAAI,IAAYC,CAAU;AAUhD,SAASC,EAAU,EAAE,WAAAC,KAAkD;AACrE,SAAI,OAAOA,KAAc,YAAYH,EAAc,IAAIG,CAAS,IACvD,gBAAAC,EAACC,KAAK,MAAMF,GAAuB,MAAK,MAAK,WAAWG,EAAO,WAAW,sBAGhF,QAAA,EAAK,WAAWA,EAAO,WAAW,eAAY,QAC5C,UAAAH,GACH;AAEJ;AASO,SAASI,EAAY,EAAE,WAAAJ,IAAY,cAAA,IAAoC,CAAA,GAAI;AAChF,QAAM,EAAE,QAAAK,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GACpBC,IAAIC,EAAA;AACV,SAAIH,EAAM,WAAW,IAAU,OAG7B,gBAAAL,EAAC,OAAA,EAAI,cAAYO,EAAE,mBAAmB,GAAG,WAAWL,EAAO,aACzD,UAAA,gBAAAO,EAAC,MAAA,EAAG,WAAWP,EAAO,MACpB,UAAA;AAAA,IAAA,gBAAAF,EAAC,QAAG,WAAWE,EAAO,MACnB,UAAAE,IACC,gBAAAJ,EAACU,KAAK,IAAIhB,EAAOU,CAAM,GAAG,WAAWF,EAAO,MAAM,cAAYK,EAAE,kBAAkB,GAChF,4BAACN,GAAA,EAAK,MAAK,SAAQ,MAAK,MAAK,EAAA,CAC/B,sBAEC,QAAA,EAAK,WAAWC,EAAO,MAAM,cAAYK,EAAE,kBAAkB,GAC5D,4BAACN,GAAA,EAAK,MAAK,SAAQ,MAAK,MAAK,GAC/B,EAAA,CAEJ;AAAA,IACCI,EAAM,IAAI,CAACM,GAAMC,MAAU;AAC1B,YAAMC,IAASD,MAAUP,EAAM,SAAS;AACxC,aACE,gBAAAI,EAAC,MAAA,EAAG,WAAWP,EAAO,MACpB,UAAA;AAAA,QAAA,gBAAAF,EAACF,KAAU,WAAAC,GAAsB;AAAA,QAChCY,EAAK,MAAM,CAACE,IACX,gBAAAb,EAACU,GAAA,EAAK,IAAIhB,EAAOiB,EAAK,EAAE,GAAG,WAAWT,EAAO,MAC1C,UAAAS,EAAK,MAAA,CACR,IAEA,gBAAAX,EAAC,QAAA,EAAK,WAAWE,EAAO,SAAS,gBAAcW,IAAS,SAAS,QAC9D,UAAAF,EAAK,MAAA,CACR;AAAA,MAAA,EAAA,GAT6B,GAAGA,EAAK,KAAK,IAAIC,CAAK,EAWvD;AAAA,IAEJ,CAAC;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
2
  import { forwardRef as z, isValidElement as W, cloneElement as v } from "react";
3
3
  import { clsx as B } from "clsx";
4
- import { L as i } from "./Loader-jh7XMRhy.js";
4
+ import { L as i } from "./Loader-Bj5uwVR9.js";
5
5
  const E = "_button_jyfg4_1", L = "_sm_jyfg4_23", N = "_md_jyfg4_29", $ = "_lg_jyfg4_35", w = "_contained_jyfg4_42", A = "_filled_jyfg4_52", R = "_outlined_jyfg4_61", V = "_text_jyfg4_72", k = "_fullWidth_jyfg4_82", q = "_rounded_jyfg4_86", C = "_disabled_jyfg4_94", D = "_loading_jyfg4_98", F = "_label_jyfg4_103", t = {
6
6
  button: E,
7
7
  sm: L,
@@ -69,4 +69,4 @@ const E = "_button_jyfg4_1", L = "_sm_jyfg4_23", N = "_md_jyfg4_29", $ = "_lg_jy
69
69
  export {
70
70
  M as B
71
71
  };
72
- //# sourceMappingURL=Button-BQ7jsm5P.js.map
72
+ //# sourceMappingURL=Button-Bst_NtPJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button-BQ7jsm5P.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import {\n cloneElement,\n forwardRef,\n isValidElement,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { Loader } from '../Loader'\nimport styles from './Button.module.css'\n\nexport type ButtonVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type ButtonSize = 'sm' | 'md' | 'lg'\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /** Visual style. `contained` solid · `filled` soft tint · `outlined` border · `text` bare. */\n variant?: ButtonVariant\n /** Theme palette token that tints the button. Defaults to `accent`. */\n color?: ThemeColor\n /** Preset size — drives height (`--tz-control-height-*`), padding and font size. */\n size?: ButtonSize\n /** Shows the loader and blocks interaction (also sets the native `disabled`). The loader replaces the `startIcon` when present, otherwise it trails the label at the end (right) — so a plain button shows the spinner on the right. The text stays visible. */\n loading?: boolean\n /** Stretches the button to fill its container. */\n fullWidth?: boolean\n /** Pill shape (fully rounded corners). */\n rounded?: boolean\n /** Icon before the label. Replaced by the loader while `loading`. */\n startIcon?: ReactNode\n /** Icon after the label. Replaced by the loader while `loading` when no `startIcon` is set. */\n endIcon?: ReactNode\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = 'contained',\n color = 'accent',\n size = 'md',\n loading = false,\n fullWidth = false,\n rounded = false,\n disabled = false,\n startIcon,\n endIcon,\n className,\n style,\n type = 'button',\n children,\n ...props\n },\n ref,\n) {\n // The loader replaces the start icon when there is one; otherwise it sits at the end (right) —\n // including a plain button with no icons, so the spinner trails the label.\n const loaderAtEnd = loading && !startIcon\n\n // size an icon slot to match the button (an explicit icon `size` still wins)\n const sizeIcon = (node: ReactNode): ReactNode =>\n isValidElement(node)\n ? cloneElement(node as ReactElement<{ size?: ButtonSize }>, {\n size: (node.props as { size?: ButtonSize }).size ?? size,\n })\n : node\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={clsx(\n styles.button,\n styles[variant],\n styles[size],\n fullWidth && styles.fullWidth,\n rounded && styles.rounded,\n loading && styles.loading,\n disabled && styles.disabled,\n className,\n )}\n style={\n {\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 {...props}\n >\n {/* leading slot — the loader takes the start icon's place while loading */}\n {loading && !loaderAtEnd ? <Loader size={size} aria-hidden=\"true\" /> : sizeIcon(startIcon)}\n {children != null && children !== false && <span className={styles.label}>{children}</span>}\n {/* trailing slot — the loader takes the end icon's place when there's no start icon */}\n {loaderAtEnd ? <Loader size={size} aria-hidden=\"true\" /> : !loading && sizeIcon(endIcon)}\n </button>\n )\n})\n"],"names":["Button","forwardRef","variant","color","size","loading","fullWidth","rounded","disabled","startIcon","endIcon","className","style","type","children","props","ref","loaderAtEnd","sizeIcon","node","isValidElement","cloneElement","jsxs","clsx","styles","jsx","Loader"],"mappings":";;;;;;;;;;;;;;;;;;GAoCaA,IAASC,EAA2C,SAC/D;AAAA,EACE,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAGA,QAAMC,IAAcZ,KAAW,CAACI,GAG1BS,IAAW,CAACC,MAChBC,EAAeD,CAAI,IACfE,EAAaF,GAA6C;AAAA,IACxD,MAAOA,EAAK,MAAgC,QAAQf;AAAA,EAAA,CACrD,IACDe;AAEN,SACE,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,MAAAH;AAAA,MACA,UAAUL,KAAYH;AAAA,MACtB,aAAWA,KAAW;AAAA,MACtB,WAAWkB;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOtB,CAAO;AAAA,QACdsB,EAAOpB,CAAI;AAAA,QACXE,KAAakB,EAAO;AAAA,QACpBjB,KAAWiB,EAAO;AAAA,QAClBnB,KAAWmB,EAAO;AAAA,QAClBhB,KAAYgB,EAAO;AAAA,QACnBb;AAAA,MAAA;AAAA,MAEF,OACE;AAAA,QACE,gBAAgB,kBAAkBR,CAAK;AAAA,QACvC,eAAe,kBAAkBA,CAAK;AAAA,QACtC,GAAGS;AAAA,MAAA;AAAA,MAGN,GAAGG;AAAA,MAGH,UAAA;AAAA,QAAAV,KAAW,CAACY,IAAc,gBAAAQ,EAACC,GAAA,EAAO,MAAAtB,GAAY,eAAY,OAAA,CAAO,IAAKc,EAAST,CAAS;AAAA,QACxFK,KAAY,QAAQA,MAAa,wBAAU,QAAA,EAAK,WAAWU,EAAO,OAAQ,UAAAV,EAAA,CAAS;AAAA,QAEnFG,IAAc,gBAAAQ,EAACC,GAAA,EAAO,MAAAtB,GAAY,eAAY,QAAO,IAAK,CAACC,KAAWa,EAASR,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG7F,CAAC;"}
1
+ {"version":3,"file":"Button-Bst_NtPJ.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import {\n cloneElement,\n forwardRef,\n isValidElement,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { Loader } from '../Loader'\nimport styles from './Button.module.css'\n\nexport type ButtonVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type ButtonSize = 'sm' | 'md' | 'lg'\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /** Visual style. `contained` solid · `filled` soft tint · `outlined` border · `text` bare. */\n variant?: ButtonVariant\n /** Theme palette token that tints the button. Defaults to `accent`. */\n color?: ThemeColor\n /** Preset size — drives height (`--tz-control-height-*`), padding and font size. */\n size?: ButtonSize\n /** Shows the loader and blocks interaction (also sets the native `disabled`). The loader replaces the `startIcon` when present, otherwise it trails the label at the end (right) — so a plain button shows the spinner on the right. The text stays visible. */\n loading?: boolean\n /** Stretches the button to fill its container. */\n fullWidth?: boolean\n /** Pill shape (fully rounded corners). */\n rounded?: boolean\n /** Icon before the label. Replaced by the loader while `loading`. */\n startIcon?: ReactNode\n /** Icon after the label. Replaced by the loader while `loading` when no `startIcon` is set. */\n endIcon?: ReactNode\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = 'contained',\n color = 'accent',\n size = 'md',\n loading = false,\n fullWidth = false,\n rounded = false,\n disabled = false,\n startIcon,\n endIcon,\n className,\n style,\n type = 'button',\n children,\n ...props\n },\n ref,\n) {\n // The loader replaces the start icon when there is one; otherwise it sits at the end (right) —\n // including a plain button with no icons, so the spinner trails the label.\n const loaderAtEnd = loading && !startIcon\n\n // size an icon slot to match the button (an explicit icon `size` still wins)\n const sizeIcon = (node: ReactNode): ReactNode =>\n isValidElement(node)\n ? cloneElement(node as ReactElement<{ size?: ButtonSize }>, {\n size: (node.props as { size?: ButtonSize }).size ?? size,\n })\n : node\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={clsx(\n styles.button,\n styles[variant],\n styles[size],\n fullWidth && styles.fullWidth,\n rounded && styles.rounded,\n loading && styles.loading,\n disabled && styles.disabled,\n className,\n )}\n style={\n {\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 {...props}\n >\n {/* leading slot — the loader takes the start icon's place while loading */}\n {loading && !loaderAtEnd ? <Loader size={size} aria-hidden=\"true\" /> : sizeIcon(startIcon)}\n {children != null && children !== false && <span className={styles.label}>{children}</span>}\n {/* trailing slot — the loader takes the end icon's place when there's no start icon */}\n {loaderAtEnd ? <Loader size={size} aria-hidden=\"true\" /> : !loading && sizeIcon(endIcon)}\n </button>\n )\n})\n"],"names":["Button","forwardRef","variant","color","size","loading","fullWidth","rounded","disabled","startIcon","endIcon","className","style","type","children","props","ref","loaderAtEnd","sizeIcon","node","isValidElement","cloneElement","jsxs","clsx","styles","jsx","Loader"],"mappings":";;;;;;;;;;;;;;;;;;GAoCaA,IAASC,EAA2C,SAC/D;AAAA,EACE,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAGA,QAAMC,IAAcZ,KAAW,CAACI,GAG1BS,IAAW,CAACC,MAChBC,EAAeD,CAAI,IACfE,EAAaF,GAA6C;AAAA,IACxD,MAAOA,EAAK,MAAgC,QAAQf;AAAA,EAAA,CACrD,IACDe;AAEN,SACE,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,MAAAH;AAAA,MACA,UAAUL,KAAYH;AAAA,MACtB,aAAWA,KAAW;AAAA,MACtB,WAAWkB;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOtB,CAAO;AAAA,QACdsB,EAAOpB,CAAI;AAAA,QACXE,KAAakB,EAAO;AAAA,QACpBjB,KAAWiB,EAAO;AAAA,QAClBnB,KAAWmB,EAAO;AAAA,QAClBhB,KAAYgB,EAAO;AAAA,QACnBb;AAAA,MAAA;AAAA,MAEF,OACE;AAAA,QACE,gBAAgB,kBAAkBR,CAAK;AAAA,QACvC,eAAe,kBAAkBA,CAAK;AAAA,QACtC,GAAGS;AAAA,MAAA;AAAA,MAGN,GAAGG;AAAA,MAGH,UAAA;AAAA,QAAAV,KAAW,CAACY,IAAc,gBAAAQ,EAACC,GAAA,EAAO,MAAAtB,GAAY,eAAY,OAAA,CAAO,IAAKc,EAAST,CAAS;AAAA,QACxFK,KAAY,QAAQA,MAAa,wBAAU,QAAA,EAAK,WAAWU,EAAO,OAAQ,UAAAV,EAAA,CAAS;AAAA,QAEnFG,IAAc,gBAAAQ,EAACC,GAAA,EAAO,MAAAtB,GAAY,eAAY,QAAO,IAAK,CAACC,KAAWa,EAASR,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG7F,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("react/jsx-runtime"),d=require("react"),z=require("clsx"),f=require("./Loader-DkwiCGbB.cjs"),W="_button_jyfg4_1",p="_sm_jyfg4_23",v="_md_jyfg4_29",B="_lg_jyfg4_35",E="_contained_jyfg4_42",L="_filled_jyfg4_52",N="_outlined_jyfg4_61",R="_text_jyfg4_72",$="_fullWidth_jyfg4_82",w="_rounded_jyfg4_86",A="_disabled_jyfg4_94",V="_loading_jyfg4_98",k="_label_jyfg4_103",t={button:W,sm:p,md:v,lg:B,contained:E,filled:L,outlined:N,text:R,fullWidth:$,rounded:w,disabled:A,loading:V,label:k},C=d.forwardRef(function({variant:i="contained",color:_="accent",size:n="md",loading:e=!1,fullWidth:b=!1,rounded:j=!1,disabled:a=!1,startIcon:c,endIcon:g,className:y,style:m,type:x="button",children:l,...h},q){const r=e&&!c,u=s=>d.isValidElement(s)?d.cloneElement(s,{size:s.props.size??n}):s;return o.jsxs("button",{ref:q,type:x,disabled:a||e,"aria-busy":e||void 0,className:z.clsx(t.button,t[i],t[n],b&&t.fullWidth,j&&t.rounded,e&&t.loading,a&&t.disabled,y),style:{"--tz-btn-rgb":`var(--tz-color-${_}-rgb)`,"--tz-btn-on":`var(--tz-color-${_}-contrast, #fff)`,...m},...h,children:[e&&!r?o.jsx(f.Loader,{size:n,"aria-hidden":"true"}):u(c),l!=null&&l!==!1&&o.jsx("span",{className:t.label,children:l}),r?o.jsx(f.Loader,{size:n,"aria-hidden":"true"}):!e&&u(g)]})});exports.Button=C;
2
- //# sourceMappingURL=Button-Cm64ROip.cjs.map
1
+ "use strict";const o=require("react/jsx-runtime"),d=require("react"),z=require("clsx"),f=require("./Loader-B5Pm8AaT.cjs"),W="_button_jyfg4_1",p="_sm_jyfg4_23",v="_md_jyfg4_29",B="_lg_jyfg4_35",E="_contained_jyfg4_42",L="_filled_jyfg4_52",N="_outlined_jyfg4_61",R="_text_jyfg4_72",$="_fullWidth_jyfg4_82",w="_rounded_jyfg4_86",A="_disabled_jyfg4_94",V="_loading_jyfg4_98",k="_label_jyfg4_103",t={button:W,sm:p,md:v,lg:B,contained:E,filled:L,outlined:N,text:R,fullWidth:$,rounded:w,disabled:A,loading:V,label:k},C=d.forwardRef(function({variant:i="contained",color:_="accent",size:n="md",loading:e=!1,fullWidth:b=!1,rounded:j=!1,disabled:a=!1,startIcon:c,endIcon:g,className:y,style:m,type:x="button",children:l,...h},q){const r=e&&!c,u=s=>d.isValidElement(s)?d.cloneElement(s,{size:s.props.size??n}):s;return o.jsxs("button",{ref:q,type:x,disabled:a||e,"aria-busy":e||void 0,className:z.clsx(t.button,t[i],t[n],b&&t.fullWidth,j&&t.rounded,e&&t.loading,a&&t.disabled,y),style:{"--tz-btn-rgb":`var(--tz-color-${_}-rgb)`,"--tz-btn-on":`var(--tz-color-${_}-contrast, #fff)`,...m},...h,children:[e&&!r?o.jsx(f.Loader,{size:n,"aria-hidden":"true"}):u(c),l!=null&&l!==!1&&o.jsx("span",{className:t.label,children:l}),r?o.jsx(f.Loader,{size:n,"aria-hidden":"true"}):!e&&u(g)]})});exports.Button=C;
2
+ //# sourceMappingURL=Button-CYZoF18-.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button-Cm64ROip.cjs","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import {\n cloneElement,\n forwardRef,\n isValidElement,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { Loader } from '../Loader'\nimport styles from './Button.module.css'\n\nexport type ButtonVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type ButtonSize = 'sm' | 'md' | 'lg'\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /** Visual style. `contained` solid · `filled` soft tint · `outlined` border · `text` bare. */\n variant?: ButtonVariant\n /** Theme palette token that tints the button. Defaults to `accent`. */\n color?: ThemeColor\n /** Preset size — drives height (`--tz-control-height-*`), padding and font size. */\n size?: ButtonSize\n /** Shows the loader and blocks interaction (also sets the native `disabled`). The loader replaces the `startIcon` when present, otherwise it trails the label at the end (right) — so a plain button shows the spinner on the right. The text stays visible. */\n loading?: boolean\n /** Stretches the button to fill its container. */\n fullWidth?: boolean\n /** Pill shape (fully rounded corners). */\n rounded?: boolean\n /** Icon before the label. Replaced by the loader while `loading`. */\n startIcon?: ReactNode\n /** Icon after the label. Replaced by the loader while `loading` when no `startIcon` is set. */\n endIcon?: ReactNode\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = 'contained',\n color = 'accent',\n size = 'md',\n loading = false,\n fullWidth = false,\n rounded = false,\n disabled = false,\n startIcon,\n endIcon,\n className,\n style,\n type = 'button',\n children,\n ...props\n },\n ref,\n) {\n // The loader replaces the start icon when there is one; otherwise it sits at the end (right) —\n // including a plain button with no icons, so the spinner trails the label.\n const loaderAtEnd = loading && !startIcon\n\n // size an icon slot to match the button (an explicit icon `size` still wins)\n const sizeIcon = (node: ReactNode): ReactNode =>\n isValidElement(node)\n ? cloneElement(node as ReactElement<{ size?: ButtonSize }>, {\n size: (node.props as { size?: ButtonSize }).size ?? size,\n })\n : node\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={clsx(\n styles.button,\n styles[variant],\n styles[size],\n fullWidth && styles.fullWidth,\n rounded && styles.rounded,\n loading && styles.loading,\n disabled && styles.disabled,\n className,\n )}\n style={\n {\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 {...props}\n >\n {/* leading slot — the loader takes the start icon's place while loading */}\n {loading && !loaderAtEnd ? <Loader size={size} aria-hidden=\"true\" /> : sizeIcon(startIcon)}\n {children != null && children !== false && <span className={styles.label}>{children}</span>}\n {/* trailing slot — the loader takes the end icon's place when there's no start icon */}\n {loaderAtEnd ? <Loader size={size} aria-hidden=\"true\" /> : !loading && sizeIcon(endIcon)}\n </button>\n )\n})\n"],"names":["Button","forwardRef","variant","color","size","loading","fullWidth","rounded","disabled","startIcon","endIcon","className","style","type","children","props","ref","loaderAtEnd","sizeIcon","node","isValidElement","cloneElement","jsxs","clsx","styles","jsx","Loader"],"mappings":"8fAoCaA,EAASC,EAAAA,WAA2C,SAC/D,CACE,QAAAC,EAAU,YACV,MAAAC,EAAQ,SACR,KAAAC,EAAO,KACP,QAAAC,EAAU,GACV,UAAAC,EAAY,GACZ,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,UAAAC,EACA,QAAAC,EACA,UAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,SACP,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CAGA,MAAMC,EAAcZ,GAAW,CAACI,EAG1BS,EAAYC,GAChBC,EAAAA,eAAeD,CAAI,EACfE,EAAAA,aAAaF,EAA6C,CACxD,KAAOA,EAAK,MAAgC,MAAQf,CAAA,CACrD,EACDe,EAEN,OACEG,EAAAA,KAAC,SAAA,CACC,IAAAN,EACA,KAAAH,EACA,SAAUL,GAAYH,EACtB,YAAWA,GAAW,OACtB,UAAWkB,EAAAA,KACTC,EAAO,OACPA,EAAOtB,CAAO,EACdsB,EAAOpB,CAAI,EACXE,GAAakB,EAAO,UACpBjB,GAAWiB,EAAO,QAClBnB,GAAWmB,EAAO,QAClBhB,GAAYgB,EAAO,SACnBb,CAAA,EAEF,MACE,CACE,eAAgB,kBAAkBR,CAAK,QACvC,cAAe,kBAAkBA,CAAK,mBACtC,GAAGS,CAAA,EAGN,GAAGG,EAGH,SAAA,CAAAV,GAAW,CAACY,EAAcQ,EAAAA,IAACC,SAAA,CAAO,KAAAtB,EAAY,cAAY,MAAA,CAAO,EAAKc,EAAST,CAAS,EACxFK,GAAY,MAAQA,IAAa,UAAU,OAAA,CAAK,UAAWU,EAAO,MAAQ,SAAAV,CAAA,CAAS,EAEnFG,EAAcQ,EAAAA,IAACC,SAAA,CAAO,KAAAtB,EAAY,cAAY,OAAO,EAAK,CAACC,GAAWa,EAASR,CAAO,CAAA,CAAA,CAAA,CAG7F,CAAC"}
1
+ {"version":3,"file":"Button-CYZoF18-.cjs","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import {\n cloneElement,\n forwardRef,\n isValidElement,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { Loader } from '../Loader'\nimport styles from './Button.module.css'\n\nexport type ButtonVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type ButtonSize = 'sm' | 'md' | 'lg'\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /** Visual style. `contained` solid · `filled` soft tint · `outlined` border · `text` bare. */\n variant?: ButtonVariant\n /** Theme palette token that tints the button. Defaults to `accent`. */\n color?: ThemeColor\n /** Preset size — drives height (`--tz-control-height-*`), padding and font size. */\n size?: ButtonSize\n /** Shows the loader and blocks interaction (also sets the native `disabled`). The loader replaces the `startIcon` when present, otherwise it trails the label at the end (right) — so a plain button shows the spinner on the right. The text stays visible. */\n loading?: boolean\n /** Stretches the button to fill its container. */\n fullWidth?: boolean\n /** Pill shape (fully rounded corners). */\n rounded?: boolean\n /** Icon before the label. Replaced by the loader while `loading`. */\n startIcon?: ReactNode\n /** Icon after the label. Replaced by the loader while `loading` when no `startIcon` is set. */\n endIcon?: ReactNode\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = 'contained',\n color = 'accent',\n size = 'md',\n loading = false,\n fullWidth = false,\n rounded = false,\n disabled = false,\n startIcon,\n endIcon,\n className,\n style,\n type = 'button',\n children,\n ...props\n },\n ref,\n) {\n // The loader replaces the start icon when there is one; otherwise it sits at the end (right) —\n // including a plain button with no icons, so the spinner trails the label.\n const loaderAtEnd = loading && !startIcon\n\n // size an icon slot to match the button (an explicit icon `size` still wins)\n const sizeIcon = (node: ReactNode): ReactNode =>\n isValidElement(node)\n ? cloneElement(node as ReactElement<{ size?: ButtonSize }>, {\n size: (node.props as { size?: ButtonSize }).size ?? size,\n })\n : node\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={clsx(\n styles.button,\n styles[variant],\n styles[size],\n fullWidth && styles.fullWidth,\n rounded && styles.rounded,\n loading && styles.loading,\n disabled && styles.disabled,\n className,\n )}\n style={\n {\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 {...props}\n >\n {/* leading slot — the loader takes the start icon's place while loading */}\n {loading && !loaderAtEnd ? <Loader size={size} aria-hidden=\"true\" /> : sizeIcon(startIcon)}\n {children != null && children !== false && <span className={styles.label}>{children}</span>}\n {/* trailing slot — the loader takes the end icon's place when there's no start icon */}\n {loaderAtEnd ? <Loader size={size} aria-hidden=\"true\" /> : !loading && sizeIcon(endIcon)}\n </button>\n )\n})\n"],"names":["Button","forwardRef","variant","color","size","loading","fullWidth","rounded","disabled","startIcon","endIcon","className","style","type","children","props","ref","loaderAtEnd","sizeIcon","node","isValidElement","cloneElement","jsxs","clsx","styles","jsx","Loader"],"mappings":"8fAoCaA,EAASC,EAAAA,WAA2C,SAC/D,CACE,QAAAC,EAAU,YACV,MAAAC,EAAQ,SACR,KAAAC,EAAO,KACP,QAAAC,EAAU,GACV,UAAAC,EAAY,GACZ,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,UAAAC,EACA,QAAAC,EACA,UAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,SACP,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CAGA,MAAMC,EAAcZ,GAAW,CAACI,EAG1BS,EAAYC,GAChBC,EAAAA,eAAeD,CAAI,EACfE,EAAAA,aAAaF,EAA6C,CACxD,KAAOA,EAAK,MAAgC,MAAQf,CAAA,CACrD,EACDe,EAEN,OACEG,EAAAA,KAAC,SAAA,CACC,IAAAN,EACA,KAAAH,EACA,SAAUL,GAAYH,EACtB,YAAWA,GAAW,OACtB,UAAWkB,EAAAA,KACTC,EAAO,OACPA,EAAOtB,CAAO,EACdsB,EAAOpB,CAAI,EACXE,GAAakB,EAAO,UACpBjB,GAAWiB,EAAO,QAClBnB,GAAWmB,EAAO,QAClBhB,GAAYgB,EAAO,SACnBb,CAAA,EAEF,MACE,CACE,eAAgB,kBAAkBR,CAAK,QACvC,cAAe,kBAAkBA,CAAK,mBACtC,GAAGS,CAAA,EAGN,GAAGG,EAGH,SAAA,CAAAV,GAAW,CAACY,EAAcQ,EAAAA,IAACC,SAAA,CAAO,KAAAtB,EAAY,cAAY,MAAA,CAAO,EAAKc,EAAST,CAAS,EACxFK,GAAY,MAAQA,IAAa,UAAU,OAAA,CAAK,UAAWU,EAAO,MAAQ,SAAAV,CAAA,CAAS,EAEnFG,EAAcQ,EAAAA,IAACC,SAAA,CAAO,KAAAtB,EAAY,cAAY,OAAO,EAAK,CAACC,GAAWa,EAASR,CAAO,CAAA,CAAA,CAAA,CAG7F,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("react/jsx-runtime"),f=require("react"),j=require("clsx"),E=require("./Icon-BUP5_kRs.cjs"),L=require("./IconButton-CYMvszcM.cjs"),r=require("./DatePicker.module-BDtTsg8M.cjs"),z=require("./ConfigProvider-th4GYhcU.cjs");function T(n,s){if(n&&n.isSame(s,"month"))return n;const i=r.today();return i.isSame(s,"month")?i:s.startOf("month")}const A=3;function H({value:n,month:s,onMonthChange:i,onSelect:I,min:p,max:b,disabledDate:K,weekStartsOn:S,autoFocus:O,labelId:k}){const m=z.useT(),[l,N]=f.useState("day"),[a,u]=f.useState(()=>T(n,s)),h=f.useRef(null),d=f.useRef(!!O);f.useEffect(()=>{u(e=>e.isSame(s,"month")?e:T(n,s))},[s]),f.useEffect(()=>{var t,c;if(!d.current)return;d.current=!1;const e=(t=h.current)==null?void 0:t.querySelector('[tabindex="0"]');e==null||e.focus(),(c=e==null?void 0:e.scrollIntoView)==null||c.call(e,{block:"nearest"})},[a,l,s]);const R=e=>{d.current=!0,N(e)},y=e=>{d.current=!0,e.isSame(s,"month")||i(e.startOf("month")),u(e)},w=e=>{const t=a.add(e,"month");d.current=!0,u(t),i(t.startOf("month"))},D=e=>{let t=a.year()+e;p&&(t=Math.max(t,p.year())),b&&(t=Math.min(t,b.year()));const c=a.year(t);d.current=!0,u(c),i(c.startOf("month"))},q=e=>{const t=s.year(e);d.current=!0,u(t),i(t),N("month")},g=e=>{const t=s.month(e);d.current=!0,u(T(n,t)),i(t),N("day")},G=e=>{const t=(a.day()-S+7)%7;switch(e.key){case"ArrowLeft":e.preventDefault(),y(a.subtract(1,"day"));break;case"ArrowRight":e.preventDefault(),y(a.add(1,"day"));break;case"ArrowUp":e.preventDefault(),y(a.subtract(7,"day"));break;case"ArrowDown":e.preventDefault(),y(a.add(7,"day"));break;case"Home":e.preventDefault(),y(a.subtract(t,"day"));break;case"End":e.preventDefault(),y(a.add(6-t,"day"));break;case"PageUp":e.preventDefault(),y(a.subtract(1,e.shiftKey?"year":"month"));break;case"PageDown":e.preventDefault(),y(a.add(1,e.shiftKey?"year":"month"));break;case"Enter":case" ":e.preventDefault(),r.isDisabled(a,p,b,K)||I(r.toISO(a));break}},P=e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),w(-1);break;case"ArrowRight":e.preventDefault(),w(1);break;case"ArrowUp":e.preventDefault(),w(-A);break;case"ArrowDown":e.preventDefault(),w(A);break;case"Enter":case" ":e.preventDefault(),g(a.month());break}},_=e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),D(-1);break;case"ArrowRight":e.preventDefault(),D(1);break;case"ArrowUp":e.preventDefault(),D(-A);break;case"ArrowDown":e.preventDefault(),D(A);break;case"Enter":case" ":e.preventDefault(),q(a.year());break}},B=r.today(),Y=e=>m(`calendar.month${e}`),v=Array.from({length:7},(e,t)=>m(`calendar.weekday${(S+t)%7}`)),U=l==="day"?r.buildMonthGrid(s,S):[],$=l==="month"?Array.from({length:12},(e,t)=>Y(t)):[],M=l==="year"?r.yearList(p,b,s.year()):[];return o.jsxs("div",{className:r.styles.calendar,children:[o.jsxs("div",{className:r.styles.calHeader,children:[l==="day"&&o.jsx(L.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":m("calendar.prevMonth"),onClick:()=>i(s.subtract(1,"month")),children:o.jsx(E.Icon,{name:"ArrowCircleLeft"})}),o.jsxs("div",{className:r.styles.calTitleGroup,children:[(l==="day"||l==="month")&&o.jsx("button",{type:"button",id:k,className:r.styles.calTitle,onClick:()=>R("year"),children:s.format("YYYY")}),l==="day"&&o.jsx("button",{type:"button",className:r.styles.calTitle,onClick:()=>R("month"),children:Y(s.month())}),l==="year"&&o.jsx("span",{id:k,className:r.styles.calTitleStatic,children:m("calendar.selectYear")})]}),l==="day"&&o.jsx(L.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":m("calendar.nextMonth"),onClick:()=>i(s.add(1,"month")),children:o.jsx(E.Icon,{name:"ArrowCircleRight"})})]}),l==="year"?o.jsx("div",{ref:h,className:j.clsx(r.styles.pickGrid,r.styles.pickScroll),role:"listbox","aria-labelledby":k,onKeyDown:_,children:M.map(e=>{const t=n?n.year()===e:!1;return o.jsx("button",{type:"button",role:"option",className:j.clsx(r.styles.pickCell,t&&r.styles.pickSelected,!t&&e===B.year()&&r.styles.pickToday),tabIndex:e===a.year()?0:-1,"aria-selected":t,onClick:()=>q(e),children:e},e)})}):l==="month"?o.jsx("div",{ref:h,className:r.styles.pickGrid,role:"listbox","aria-labelledby":k,onKeyDown:P,children:$.map((e,t)=>{const c=n?n.isSame(s.month(t),"month"):!1,x=B.isSame(s.month(t),"month");return o.jsx("button",{type:"button",role:"option",className:j.clsx(r.styles.pickCell,c&&r.styles.pickSelected,!c&&x&&r.styles.pickToday),tabIndex:t===a.month()?0:-1,"aria-selected":c,onClick:()=>g(t),children:e},e)})}):o.jsxs("div",{ref:h,className:r.styles.grid,role:"grid","aria-label":`${Y(s.month())} ${s.format("YYYY")}`,onKeyDown:G,children:[o.jsx("div",{className:r.styles.weekdays,role:"row",children:v.map((e,t)=>o.jsx("span",{role:"columnheader",className:r.styles.weekday,children:e},t))}),Array.from({length:6},(e,t)=>o.jsx("div",{role:"row",className:r.styles.week,children:U.slice(t*7,t*7+7).map(c=>{const x=n?c.date.isSame(n,"day"):!1,C=r.isDisabled(c.date,p,b,K);return o.jsx("button",{type:"button",role:"gridcell",className:j.clsx(r.styles.day,!c.inMonth&&r.styles.dayOutside,x&&r.styles.daySelected,c.isToday&&r.styles.dayToday,C&&r.styles.dayDisabled),tabIndex:c.date.isSame(a,"day")?0:-1,"aria-selected":x,"aria-disabled":C||void 0,"aria-current":c.isToday?"date":void 0,onClick:()=>!C&&I(c.iso),children:c.date.date()},c.iso)})},t))]})]})}exports.Calendar=H;
2
- //# sourceMappingURL=Calendar-C2x9ZtPV.cjs.map
1
+ "use strict";const o=require("react/jsx-runtime"),f=require("react"),j=require("clsx"),E=require("./Icon-BUP5_kRs.cjs"),L=require("./IconButton-CQ25TtBc.cjs"),r=require("./DatePicker.module-BDtTsg8M.cjs"),z=require("./ConfigProvider-B_Bb6pk1.cjs");function T(n,s){if(n&&n.isSame(s,"month"))return n;const i=r.today();return i.isSame(s,"month")?i:s.startOf("month")}const A=3;function H({value:n,month:s,onMonthChange:i,onSelect:I,min:p,max:b,disabledDate:K,weekStartsOn:S,autoFocus:O,labelId:k}){const m=z.useT(),[l,N]=f.useState("day"),[a,u]=f.useState(()=>T(n,s)),h=f.useRef(null),d=f.useRef(!!O);f.useEffect(()=>{u(e=>e.isSame(s,"month")?e:T(n,s))},[s]),f.useEffect(()=>{var t,c;if(!d.current)return;d.current=!1;const e=(t=h.current)==null?void 0:t.querySelector('[tabindex="0"]');e==null||e.focus(),(c=e==null?void 0:e.scrollIntoView)==null||c.call(e,{block:"nearest"})},[a,l,s]);const R=e=>{d.current=!0,N(e)},y=e=>{d.current=!0,e.isSame(s,"month")||i(e.startOf("month")),u(e)},w=e=>{const t=a.add(e,"month");d.current=!0,u(t),i(t.startOf("month"))},D=e=>{let t=a.year()+e;p&&(t=Math.max(t,p.year())),b&&(t=Math.min(t,b.year()));const c=a.year(t);d.current=!0,u(c),i(c.startOf("month"))},q=e=>{const t=s.year(e);d.current=!0,u(t),i(t),N("month")},g=e=>{const t=s.month(e);d.current=!0,u(T(n,t)),i(t),N("day")},G=e=>{const t=(a.day()-S+7)%7;switch(e.key){case"ArrowLeft":e.preventDefault(),y(a.subtract(1,"day"));break;case"ArrowRight":e.preventDefault(),y(a.add(1,"day"));break;case"ArrowUp":e.preventDefault(),y(a.subtract(7,"day"));break;case"ArrowDown":e.preventDefault(),y(a.add(7,"day"));break;case"Home":e.preventDefault(),y(a.subtract(t,"day"));break;case"End":e.preventDefault(),y(a.add(6-t,"day"));break;case"PageUp":e.preventDefault(),y(a.subtract(1,e.shiftKey?"year":"month"));break;case"PageDown":e.preventDefault(),y(a.add(1,e.shiftKey?"year":"month"));break;case"Enter":case" ":e.preventDefault(),r.isDisabled(a,p,b,K)||I(r.toISO(a));break}},P=e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),w(-1);break;case"ArrowRight":e.preventDefault(),w(1);break;case"ArrowUp":e.preventDefault(),w(-A);break;case"ArrowDown":e.preventDefault(),w(A);break;case"Enter":case" ":e.preventDefault(),g(a.month());break}},_=e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),D(-1);break;case"ArrowRight":e.preventDefault(),D(1);break;case"ArrowUp":e.preventDefault(),D(-A);break;case"ArrowDown":e.preventDefault(),D(A);break;case"Enter":case" ":e.preventDefault(),q(a.year());break}},B=r.today(),Y=e=>m(`calendar.month${e}`),v=Array.from({length:7},(e,t)=>m(`calendar.weekday${(S+t)%7}`)),U=l==="day"?r.buildMonthGrid(s,S):[],$=l==="month"?Array.from({length:12},(e,t)=>Y(t)):[],M=l==="year"?r.yearList(p,b,s.year()):[];return o.jsxs("div",{className:r.styles.calendar,children:[o.jsxs("div",{className:r.styles.calHeader,children:[l==="day"&&o.jsx(L.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":m("calendar.prevMonth"),onClick:()=>i(s.subtract(1,"month")),children:o.jsx(E.Icon,{name:"ArrowCircleLeft"})}),o.jsxs("div",{className:r.styles.calTitleGroup,children:[(l==="day"||l==="month")&&o.jsx("button",{type:"button",id:k,className:r.styles.calTitle,onClick:()=>R("year"),children:s.format("YYYY")}),l==="day"&&o.jsx("button",{type:"button",className:r.styles.calTitle,onClick:()=>R("month"),children:Y(s.month())}),l==="year"&&o.jsx("span",{id:k,className:r.styles.calTitleStatic,children:m("calendar.selectYear")})]}),l==="day"&&o.jsx(L.IconButton,{variant:"text",color:"primary",size:"sm","aria-label":m("calendar.nextMonth"),onClick:()=>i(s.add(1,"month")),children:o.jsx(E.Icon,{name:"ArrowCircleRight"})})]}),l==="year"?o.jsx("div",{ref:h,className:j.clsx(r.styles.pickGrid,r.styles.pickScroll),role:"listbox","aria-labelledby":k,onKeyDown:_,children:M.map(e=>{const t=n?n.year()===e:!1;return o.jsx("button",{type:"button",role:"option",className:j.clsx(r.styles.pickCell,t&&r.styles.pickSelected,!t&&e===B.year()&&r.styles.pickToday),tabIndex:e===a.year()?0:-1,"aria-selected":t,onClick:()=>q(e),children:e},e)})}):l==="month"?o.jsx("div",{ref:h,className:r.styles.pickGrid,role:"listbox","aria-labelledby":k,onKeyDown:P,children:$.map((e,t)=>{const c=n?n.isSame(s.month(t),"month"):!1,x=B.isSame(s.month(t),"month");return o.jsx("button",{type:"button",role:"option",className:j.clsx(r.styles.pickCell,c&&r.styles.pickSelected,!c&&x&&r.styles.pickToday),tabIndex:t===a.month()?0:-1,"aria-selected":c,onClick:()=>g(t),children:e},e)})}):o.jsxs("div",{ref:h,className:r.styles.grid,role:"grid","aria-label":`${Y(s.month())} ${s.format("YYYY")}`,onKeyDown:G,children:[o.jsx("div",{className:r.styles.weekdays,role:"row",children:v.map((e,t)=>o.jsx("span",{role:"columnheader",className:r.styles.weekday,children:e},t))}),Array.from({length:6},(e,t)=>o.jsx("div",{role:"row",className:r.styles.week,children:U.slice(t*7,t*7+7).map(c=>{const x=n?c.date.isSame(n,"day"):!1,C=r.isDisabled(c.date,p,b,K);return o.jsx("button",{type:"button",role:"gridcell",className:j.clsx(r.styles.day,!c.inMonth&&r.styles.dayOutside,x&&r.styles.daySelected,c.isToday&&r.styles.dayToday,C&&r.styles.dayDisabled),tabIndex:c.date.isSame(a,"day")?0:-1,"aria-selected":x,"aria-disabled":C||void 0,"aria-current":c.isToday?"date":void 0,onClick:()=>!C&&I(c.iso),children:c.date.date()},c.iso)})},t))]})]})}exports.Calendar=H;
2
+ //# sourceMappingURL=Calendar-CHflyWXY.cjs.map