@techzyapp/ui-library 1.0.29 → 1.0.31

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 (534) hide show
  1. package/dist/{Accordion-w-w_WxxV.js → Accordion-ClK2XpD7.js} +3 -3
  2. package/dist/{Accordion-w-w_WxxV.js.map → Accordion-ClK2XpD7.js.map} +1 -1
  3. package/dist/{Accordion-P3PNqSER.cjs → Accordion-CtvAYNKd.cjs} +2 -2
  4. package/dist/{Accordion-P3PNqSER.cjs.map → Accordion-CtvAYNKd.cjs.map} +1 -1
  5. package/dist/AdminRoot-BYkmCGNx.js +57 -0
  6. package/dist/AdminRoot-BYkmCGNx.js.map +1 -0
  7. package/dist/AdminRoot-BbkfFQEn.cjs +2 -0
  8. package/dist/AdminRoot-BbkfFQEn.cjs.map +1 -0
  9. package/dist/{Alert-CJono1TJ.js → Alert-BLqAcEoT.js} +5 -5
  10. package/dist/{Alert-CJono1TJ.js.map → Alert-BLqAcEoT.js.map} +1 -1
  11. package/dist/{Alert-VFQuuII6.cjs → Alert-BM5WOI_u.cjs} +2 -2
  12. package/dist/{Alert-VFQuuII6.cjs.map → Alert-BM5WOI_u.cjs.map} +1 -1
  13. package/dist/{AuthLayout-QAtW2GAT.cjs → AuthLayout-DIcR__vo.cjs} +2 -2
  14. package/dist/{AuthLayout-QAtW2GAT.cjs.map → AuthLayout-DIcR__vo.cjs.map} +1 -1
  15. package/dist/{AuthLayout-DOFYw_z5.js → AuthLayout-m1BQ6Ixx.js} +2 -2
  16. package/dist/{AuthLayout-DOFYw_z5.js.map → AuthLayout-m1BQ6Ixx.js.map} +1 -1
  17. package/dist/{Avatar-DrV_F7Ex.cjs → Avatar-CQ--wGWS.cjs} +2 -2
  18. package/dist/{Avatar-DrV_F7Ex.cjs.map → Avatar-CQ--wGWS.cjs.map} +1 -1
  19. package/dist/{Avatar-DXNPg23a.js → Avatar-MwWIcj8z.js} +3 -3
  20. package/dist/{Avatar-DXNPg23a.js.map → Avatar-MwWIcj8z.js.map} +1 -1
  21. package/dist/{AvatarGroup-CwlYqDCI.js → AvatarGroup-BxYQo0zZ.js} +2 -2
  22. package/dist/{AvatarGroup-CwlYqDCI.js.map → AvatarGroup-BxYQo0zZ.js.map} +1 -1
  23. package/dist/{AvatarGroup-CHesdo-M.cjs → AvatarGroup-Bzu2t6Sd.cjs} +2 -2
  24. package/dist/{AvatarGroup-CHesdo-M.cjs.map → AvatarGroup-Bzu2t6Sd.cjs.map} +1 -1
  25. package/dist/{Breadcrumbs-XWU8tRvs.js → Breadcrumbs-CzHGbN2c.js} +5 -5
  26. package/dist/{Breadcrumbs-XWU8tRvs.js.map → Breadcrumbs-CzHGbN2c.js.map} +1 -1
  27. package/dist/{Breadcrumbs-DCEHxpSi.cjs → Breadcrumbs-Di4-Acfb.cjs} +2 -2
  28. package/dist/{Breadcrumbs-DCEHxpSi.cjs.map → Breadcrumbs-Di4-Acfb.cjs.map} +1 -1
  29. package/dist/{Button-CWMNNiia.js → Button-9Qcdkw-y.js} +2 -2
  30. package/dist/{Button-CWMNNiia.js.map → Button-9Qcdkw-y.js.map} +1 -1
  31. package/dist/{Button-CusxDmfq.cjs → Button-BQhiJq8e.cjs} +2 -2
  32. package/dist/{Button-CusxDmfq.cjs.map → Button-BQhiJq8e.cjs.map} +1 -1
  33. package/dist/{Calendar-Db3rr1VD.js → Calendar-BB-C0qXO.js} +4 -4
  34. package/dist/{Calendar-Db3rr1VD.js.map → Calendar-BB-C0qXO.js.map} +1 -1
  35. package/dist/{Calendar-BEQbZixA.cjs → Calendar-dXhLgOUH.cjs} +2 -2
  36. package/dist/{Calendar-BEQbZixA.cjs.map → Calendar-dXhLgOUH.cjs.map} +1 -1
  37. package/dist/Card-BERQfyhJ.js +129 -0
  38. package/dist/Card-BERQfyhJ.js.map +1 -0
  39. package/dist/Card-DULpoOfj.cjs +2 -0
  40. package/dist/Card-DULpoOfj.cjs.map +1 -0
  41. package/dist/{Chip-D12KcV4_.cjs → Chip-BuydTI6V.cjs} +2 -2
  42. package/dist/{Chip-D12KcV4_.cjs.map → Chip-BuydTI6V.cjs.map} +1 -1
  43. package/dist/{Chip-Zh1OB9nV.js → Chip-DZ5Fz7jx.js} +3 -3
  44. package/dist/{Chip-Zh1OB9nV.js.map → Chip-DZ5Fz7jx.js.map} +1 -1
  45. package/dist/{ChoiceCardGroup-CEniY_HJ.js → ChoiceCardGroup-BTbKjJdp.js} +3 -3
  46. package/dist/{ChoiceCardGroup-CEniY_HJ.js.map → ChoiceCardGroup-BTbKjJdp.js.map} +1 -1
  47. package/dist/{ChoiceCardGroup-BSagRbPI.cjs → ChoiceCardGroup-Bg2jtFpe.cjs} +2 -2
  48. package/dist/{ChoiceCardGroup-BSagRbPI.cjs.map → ChoiceCardGroup-Bg2jtFpe.cjs.map} +1 -1
  49. package/dist/{CodeBlock-DAM7BkHK.cjs → CodeBlock-BPraYPoS.cjs} +2 -2
  50. package/dist/{CodeBlock-DAM7BkHK.cjs.map → CodeBlock-BPraYPoS.cjs.map} +1 -1
  51. package/dist/{CodeBlock-CkrTnpcj.js → CodeBlock-BySsTAtY.js} +5 -5
  52. package/dist/{CodeBlock-CkrTnpcj.js.map → CodeBlock-BySsTAtY.js.map} +1 -1
  53. package/dist/{ColorPicker-BcCozxIe.cjs → ColorPicker-BTBTQD39.cjs} +2 -2
  54. package/dist/{ColorPicker-BcCozxIe.cjs.map → ColorPicker-BTBTQD39.cjs.map} +1 -1
  55. package/dist/{ColorPicker-DqxVgUoD.js → ColorPicker-DJow7m2v.js} +4 -4
  56. package/dist/{ColorPicker-DqxVgUoD.js.map → ColorPicker-DJow7m2v.js.map} +1 -1
  57. package/dist/{ColorPickerPanel-DZjN8NNn.js → ColorPickerPanel-D6agWM6y.js} +3 -3
  58. package/dist/{ColorPickerPanel-DZjN8NNn.js.map → ColorPickerPanel-D6agWM6y.js.map} +1 -1
  59. package/dist/{ColorPickerPanel-DAOESLCe.cjs → ColorPickerPanel-DXIYwUoE.cjs} +2 -2
  60. package/dist/{ColorPickerPanel-DAOESLCe.cjs.map → ColorPickerPanel-DXIYwUoE.cjs.map} +1 -1
  61. package/dist/{ColorRamp-_KwlPQ-T.cjs → ColorRamp-B45Rtwgw.cjs} +2 -2
  62. package/dist/{ColorRamp-_KwlPQ-T.cjs.map → ColorRamp-B45Rtwgw.cjs.map} +1 -1
  63. package/dist/{ColorRamp-DS5LVpRF.js → ColorRamp-Bhj28c_6.js} +3 -3
  64. package/dist/{ColorRamp-DS5LVpRF.js.map → ColorRamp-Bhj28c_6.js.map} +1 -1
  65. package/dist/ConfigProvider-Ct0Pe3Ku.js +335 -0
  66. package/dist/ConfigProvider-Ct0Pe3Ku.js.map +1 -0
  67. package/dist/ConfigProvider-CtpfSy1i.cjs +2 -0
  68. package/dist/ConfigProvider-CtpfSy1i.cjs.map +1 -0
  69. package/dist/{CopyButton-SFwjKod9.cjs → CopyButton-Bfte6TJF.cjs} +2 -2
  70. package/dist/{CopyButton-SFwjKod9.cjs.map → CopyButton-Bfte6TJF.cjs.map} +1 -1
  71. package/dist/{CopyButton-D4s8aeSE.js → CopyButton-CBk85MQ7.js} +5 -5
  72. package/dist/{CopyButton-D4s8aeSE.js.map → CopyButton-CBk85MQ7.js.map} +1 -1
  73. package/dist/{DashedButton-iM7kzopW.js → DashedButton-BpiG8rab.js} +3 -3
  74. package/dist/{DashedButton-iM7kzopW.js.map → DashedButton-BpiG8rab.js.map} +1 -1
  75. package/dist/{DashedButton-B7xodc3N.cjs → DashedButton-DZmgxLMO.cjs} +2 -2
  76. package/dist/{DashedButton-B7xodc3N.cjs.map → DashedButton-DZmgxLMO.cjs.map} +1 -1
  77. package/dist/{DatePicker-ENbn2Vab.cjs → DatePicker-DBiU4Mb6.cjs} +2 -2
  78. package/dist/{DatePicker-ENbn2Vab.cjs.map → DatePicker-DBiU4Mb6.cjs.map} +1 -1
  79. package/dist/{DatePicker-DGwjCHfd.js → DatePicker-eAzDnO2Y.js} +6 -6
  80. package/dist/{DatePicker-DGwjCHfd.js.map → DatePicker-eAzDnO2Y.js.map} +1 -1
  81. package/dist/{DateTimePicker-BQUmsFwX.cjs → DateTimePicker-CvaD8IkF.cjs} +2 -2
  82. package/dist/{DateTimePicker-BQUmsFwX.cjs.map → DateTimePicker-CvaD8IkF.cjs.map} +1 -1
  83. package/dist/{DateTimePicker-CwVkQiun.js → DateTimePicker-M2UBjFVc.js} +9 -9
  84. package/dist/{DateTimePicker-CwVkQiun.js.map → DateTimePicker-M2UBjFVc.js.map} +1 -1
  85. package/dist/{DescriptionList-0qjKr6GN.js → DescriptionList-BhsmdtS1.js} +64 -64
  86. package/dist/{DescriptionList-0qjKr6GN.js.map → DescriptionList-BhsmdtS1.js.map} +1 -1
  87. package/dist/DescriptionList-DQHNOTWl.cjs +2 -0
  88. package/dist/{DescriptionList-U5z2Faf4.cjs.map → DescriptionList-DQHNOTWl.cjs.map} +1 -1
  89. package/dist/{Dropdown-DNZ9S_zQ.cjs → Dropdown-BbaU1WDC.cjs} +2 -2
  90. package/dist/{Dropdown-DNZ9S_zQ.cjs.map → Dropdown-BbaU1WDC.cjs.map} +1 -1
  91. package/dist/{Dropdown--1mNTVZJ.js → Dropdown-BlmbYp1X.js} +2 -2
  92. package/dist/{Dropdown--1mNTVZJ.js.map → Dropdown-BlmbYp1X.js.map} +1 -1
  93. package/dist/{EmptyState-DwT9_HW7.js → EmptyState-2pA3XlOX.js} +4 -4
  94. package/dist/{EmptyState-DwT9_HW7.js.map → EmptyState-2pA3XlOX.js.map} +1 -1
  95. package/dist/{EmptyState-B2_4BN4l.cjs → EmptyState-ByBpy2vN.cjs} +2 -2
  96. package/dist/{EmptyState-B2_4BN4l.cjs.map → EmptyState-ByBpy2vN.cjs.map} +1 -1
  97. package/dist/{ErrorBoundary-CsDHKYB4.js → ErrorBoundary-B-37hGZW.js} +6 -6
  98. package/dist/{ErrorBoundary-CsDHKYB4.js.map → ErrorBoundary-B-37hGZW.js.map} +1 -1
  99. package/dist/{ErrorBoundary-CYSOAQlB.cjs → ErrorBoundary-gRGxeuM1.cjs} +2 -2
  100. package/dist/{ErrorBoundary-CYSOAQlB.cjs.map → ErrorBoundary-gRGxeuM1.cjs.map} +1 -1
  101. package/dist/{FileCard-B9f9RoXS.js → FileCard-BNfUAgsF.js} +5 -5
  102. package/dist/{FileCard-B9f9RoXS.js.map → FileCard-BNfUAgsF.js.map} +1 -1
  103. package/dist/{FileCard-zuUYik-F.cjs → FileCard-BYNJVmp0.cjs} +2 -2
  104. package/dist/{FileCard-zuUYik-F.cjs.map → FileCard-BYNJVmp0.cjs.map} +1 -1
  105. package/dist/{FileUploader-Y8hiyIpp.cjs → FileUploader-DdICa5UC.cjs} +2 -2
  106. package/dist/{FileUploader-Y8hiyIpp.cjs.map → FileUploader-DdICa5UC.cjs.map} +1 -1
  107. package/dist/{FileUploader-Dh2zA50t.js → FileUploader-TOWwDOSS.js} +6 -6
  108. package/dist/{FileUploader-Dh2zA50t.js.map → FileUploader-TOWwDOSS.js.map} +1 -1
  109. package/dist/{Flag-CmDXvd7j.js → Flag-DDR6OANA.js} +2 -2
  110. package/dist/{Flag-CmDXvd7j.js.map → Flag-DDR6OANA.js.map} +1 -1
  111. package/dist/{Flag-BpTQAgbD.cjs → Flag-DXPQ2t8z.cjs} +2 -2
  112. package/dist/{Flag-BpTQAgbD.cjs.map → Flag-DXPQ2t8z.cjs.map} +1 -1
  113. package/dist/FloatingPanel-C5c_eMQ0.js +135 -0
  114. package/dist/{FloatingPanel-CeSOtE_D.js.map → FloatingPanel-C5c_eMQ0.js.map} +1 -1
  115. package/dist/FloatingPanel-tGCG2nhA.cjs +2 -0
  116. package/dist/{FloatingPanel-BIC4WrFa.cjs.map → FloatingPanel-tGCG2nhA.cjs.map} +1 -1
  117. package/dist/{FullscreenToggle-CeGgw3z1.cjs → FullscreenToggle-BKo1lDSE.cjs} +2 -2
  118. package/dist/{FullscreenToggle-CeGgw3z1.cjs.map → FullscreenToggle-BKo1lDSE.cjs.map} +1 -1
  119. package/dist/{FullscreenToggle-2IYIS5KF.js → FullscreenToggle-DmH1541W.js} +4 -4
  120. package/dist/{FullscreenToggle-2IYIS5KF.js.map → FullscreenToggle-DmH1541W.js.map} +1 -1
  121. package/dist/Icon-BUP5_kRs.cjs +2 -0
  122. package/dist/Icon-BUP5_kRs.cjs.map +1 -0
  123. package/dist/{Icon-DaTvzLBu.js → Icon-CGQ5yGSZ.js} +4 -3
  124. package/dist/Icon-CGQ5yGSZ.js.map +1 -0
  125. package/dist/{IconButton-GU3Ud4Zg.js → IconButton-CL_6iMQh.js} +2 -2
  126. package/dist/{IconButton-GU3Ud4Zg.js.map → IconButton-CL_6iMQh.js.map} +1 -1
  127. package/dist/{IconButton-BNa0yLcv.cjs → IconButton-CvIXSFsr.cjs} +2 -2
  128. package/dist/{IconButton-BNa0yLcv.cjs.map → IconButton-CvIXSFsr.cjs.map} +1 -1
  129. package/dist/{List-CZwNGxuP.js → List-BLPB3-B8.js} +3 -3
  130. package/dist/{List-CZwNGxuP.js.map → List-BLPB3-B8.js.map} +1 -1
  131. package/dist/{List-9lUjapQ5.cjs → List-ah2PNWeY.cjs} +2 -2
  132. package/dist/{List-9lUjapQ5.cjs.map → List-ah2PNWeY.cjs.map} +1 -1
  133. package/dist/{Loader-Cpr9-OOZ.cjs → Loader-CI1j71X8.cjs} +2 -2
  134. package/dist/{Loader-Cpr9-OOZ.cjs.map → Loader-CI1j71X8.cjs.map} +1 -1
  135. package/dist/{Loader-C1uaCtx6.js → Loader-Czzb450N.js} +2 -2
  136. package/dist/{Loader-C1uaCtx6.js.map → Loader-Czzb450N.js.map} +1 -1
  137. package/dist/{Modal-DHP2R3K3.js → Modal-DMJMw6kT.js} +5 -5
  138. package/dist/{Modal-DHP2R3K3.js.map → Modal-DMJMw6kT.js.map} +1 -1
  139. package/dist/{Modal-DFeBHv-Q.cjs → Modal-DPObz0b-.cjs} +2 -2
  140. package/dist/{Modal-DFeBHv-Q.cjs.map → Modal-DPObz0b-.cjs.map} +1 -1
  141. package/dist/{MultiSelect-B-FPQ08c.js → MultiSelect-BTR6w5Ot.js} +5 -5
  142. package/dist/{MultiSelect-B-FPQ08c.js.map → MultiSelect-BTR6w5Ot.js.map} +1 -1
  143. package/dist/{MultiSelect-S5VG9g3l.cjs → MultiSelect-IDAJ5a5K.cjs} +2 -2
  144. package/dist/{MultiSelect-S5VG9g3l.cjs.map → MultiSelect-IDAJ5a5K.cjs.map} +1 -1
  145. package/dist/{NumberField-SSGXlF8U.cjs → NumberField-Cg0XEDgW.cjs} +2 -2
  146. package/dist/{NumberField-SSGXlF8U.cjs.map → NumberField-Cg0XEDgW.cjs.map} +1 -1
  147. package/dist/{NumberField-CzyvDMRV.js → NumberField-DlaW-g3Z.js} +4 -4
  148. package/dist/{NumberField-CzyvDMRV.js.map → NumberField-DlaW-g3Z.js.map} +1 -1
  149. package/dist/{OtpField-Pr7Ch0El.cjs → OtpField-DsedK1nQ.cjs} +2 -2
  150. package/dist/{OtpField-Pr7Ch0El.cjs.map → OtpField-DsedK1nQ.cjs.map} +1 -1
  151. package/dist/{OtpField-CMoJqcx1.js → OtpField-vxQuo-uR.js} +2 -2
  152. package/dist/{OtpField-CMoJqcx1.js.map → OtpField-vxQuo-uR.js.map} +1 -1
  153. package/dist/{PageLayout-BIMkjq-q.cjs → PageLayout-BPbjTYS3.cjs} +2 -2
  154. package/dist/{PageLayout-BIMkjq-q.cjs.map → PageLayout-BPbjTYS3.cjs.map} +1 -1
  155. package/dist/{PageLayout-Ctr-IEzX.js → PageLayout-Rk6KSxmn.js} +2 -2
  156. package/dist/{PageLayout-Ctr-IEzX.js.map → PageLayout-Rk6KSxmn.js.map} +1 -1
  157. package/dist/{PageNotFound-KKJTeaRF.js → PageNotFound-CBNhKZ9Y.js} +5 -5
  158. package/dist/{PageNotFound-KKJTeaRF.js.map → PageNotFound-CBNhKZ9Y.js.map} +1 -1
  159. package/dist/{PageNotFound-CnhBheI4.cjs → PageNotFound-PUQ1o9R4.cjs} +2 -2
  160. package/dist/{PageNotFound-CnhBheI4.cjs.map → PageNotFound-PUQ1o9R4.cjs.map} +1 -1
  161. package/dist/{Pagination-Oyms2ERd.js → Pagination-CNdkfXp2.js} +3 -3
  162. package/dist/{Pagination-Oyms2ERd.js.map → Pagination-CNdkfXp2.js.map} +1 -1
  163. package/dist/{Pagination-BD5WOW98.cjs → Pagination-DNGKNQy0.cjs} +2 -2
  164. package/dist/{Pagination-BD5WOW98.cjs.map → Pagination-DNGKNQy0.cjs.map} +1 -1
  165. package/dist/{PaletteField-CCQGW5LC.cjs → PaletteField-BSIF5jI6.cjs} +2 -2
  166. package/dist/{PaletteField-CCQGW5LC.cjs.map → PaletteField-BSIF5jI6.cjs.map} +1 -1
  167. package/dist/{PaletteField-BHzzzdou.js → PaletteField-Bp5Fgygh.js} +3 -3
  168. package/dist/{PaletteField-BHzzzdou.js.map → PaletteField-Bp5Fgygh.js.map} +1 -1
  169. package/dist/{PhoneField-5zGY4Wko.cjs → PhoneField-BMhZeZkW.cjs} +2 -2
  170. package/dist/{PhoneField-5zGY4Wko.cjs.map → PhoneField-BMhZeZkW.cjs.map} +1 -1
  171. package/dist/{PhoneField-CBfmChPx.js → PhoneField-BdmvslXQ.js} +5 -5
  172. package/dist/{PhoneField-CBfmChPx.js.map → PhoneField-BdmvslXQ.js.map} +1 -1
  173. package/dist/{Popconfirm-BtGDhqrc.js → Popconfirm-Cyaeybtj.js} +6 -6
  174. package/dist/{Popconfirm-BtGDhqrc.js.map → Popconfirm-Cyaeybtj.js.map} +1 -1
  175. package/dist/{Popconfirm-CkBdntxV.cjs → Popconfirm-IhlIINtZ.cjs} +2 -2
  176. package/dist/{Popconfirm-CkBdntxV.cjs.map → Popconfirm-IhlIINtZ.cjs.map} +1 -1
  177. package/dist/{Popover-DAT6DcM9.cjs → Popover-DsYUT23r.cjs} +2 -2
  178. package/dist/{Popover-DAT6DcM9.cjs.map → Popover-DsYUT23r.cjs.map} +1 -1
  179. package/dist/{Popover-B82Id9Ut.js → Popover-WaVH3jsN.js} +2 -2
  180. package/dist/{Popover-B82Id9Ut.js.map → Popover-WaVH3jsN.js.map} +1 -1
  181. package/dist/{Progress-Bwxx71Ns.cjs → Progress-CAY1p06_.cjs} +2 -2
  182. package/dist/{Progress-Bwxx71Ns.cjs.map → Progress-CAY1p06_.cjs.map} +1 -1
  183. package/dist/{Progress-pTbaOSDd.js → Progress-T7PLrJ0Y.js} +2 -2
  184. package/dist/{Progress-pTbaOSDd.js.map → Progress-T7PLrJ0Y.js.map} +1 -1
  185. package/dist/{QueryError-C01oichG.cjs → QueryError-DP22IUnp.cjs} +2 -2
  186. package/dist/{QueryError-C01oichG.cjs.map → QueryError-DP22IUnp.cjs.map} +1 -1
  187. package/dist/{QueryError-Bu_MNGek.js → QueryError-Dtspj9l4.js} +2 -2
  188. package/dist/{QueryError-Bu_MNGek.js.map → QueryError-Dtspj9l4.js.map} +1 -1
  189. package/dist/RadioGroup-CTAayuMv.js +142 -0
  190. package/dist/RadioGroup-CTAayuMv.js.map +1 -0
  191. package/dist/RadioGroup-CvC2yc4p.cjs +2 -0
  192. package/dist/RadioGroup-CvC2yc4p.cjs.map +1 -0
  193. package/dist/{RemoveDialog-Bm2mJB3l.cjs → RemoveDialog-D12B4x80.cjs} +2 -2
  194. package/dist/{RemoveDialog-Bm2mJB3l.cjs.map → RemoveDialog-D12B4x80.cjs.map} +1 -1
  195. package/dist/{RemoveDialog-C2uJzWi-.js → RemoveDialog-DdGsqaWV.js} +6 -6
  196. package/dist/{RemoveDialog-C2uJzWi-.js.map → RemoveDialog-DdGsqaWV.js.map} +1 -1
  197. package/dist/RichTextEditor-BVXY25sz.cjs +2 -0
  198. package/dist/RichTextEditor-BVXY25sz.cjs.map +1 -0
  199. package/dist/RichTextEditor-DL4y5xVv.js +916 -0
  200. package/dist/RichTextEditor-DL4y5xVv.js.map +1 -0
  201. package/dist/RootLayout-BK3t6Mm0.js +604 -0
  202. package/dist/RootLayout-BK3t6Mm0.js.map +1 -0
  203. package/dist/RootLayout-DDuzPlJe.cjs +2 -0
  204. package/dist/RootLayout-DDuzPlJe.cjs.map +1 -0
  205. package/dist/{Select-CVVJKAtS.cjs → Select-DlFDOZtn.cjs} +2 -2
  206. package/dist/{Select-CVVJKAtS.cjs.map → Select-DlFDOZtn.cjs.map} +1 -1
  207. package/dist/{Select-d9LDI8O3.js → Select-tVI_qer3.js} +5 -5
  208. package/dist/{Select-d9LDI8O3.js.map → Select-tVI_qer3.js.map} +1 -1
  209. package/dist/{Sidebar-BgCfnZBF.js → Sidebar-CjrD3nNp.js} +7 -6
  210. package/dist/Sidebar-CjrD3nNp.js.map +1 -0
  211. package/dist/Sidebar-gB-X4VLX.cjs +2 -0
  212. package/dist/Sidebar-gB-X4VLX.cjs.map +1 -0
  213. package/dist/{SpeedDial-CEr2JWQb.cjs → SpeedDial-BIOkkLKO.cjs} +2 -2
  214. package/dist/{SpeedDial-CEr2JWQb.cjs.map → SpeedDial-BIOkkLKO.cjs.map} +1 -1
  215. package/dist/{SpeedDial-CBVwgnFp.js → SpeedDial-xQr4JH0x.js} +5 -5
  216. package/dist/{SpeedDial-CBVwgnFp.js.map → SpeedDial-xQr4JH0x.js.map} +1 -1
  217. package/dist/Stepper-CBdhvPoz.cjs +2 -0
  218. package/dist/Stepper-CBdhvPoz.cjs.map +1 -0
  219. package/dist/Stepper-CkYcIc15.js +169 -0
  220. package/dist/Stepper-CkYcIc15.js.map +1 -0
  221. package/dist/{SwatchPicker-Bpxk0IOe.js → SwatchPicker-BAKslSY4.js} +2 -2
  222. package/dist/{SwatchPicker-Bpxk0IOe.js.map → SwatchPicker-BAKslSY4.js.map} +1 -1
  223. package/dist/{SwatchPicker-BWXqgsEy.cjs → SwatchPicker-CpwVq0xp.cjs} +2 -2
  224. package/dist/{SwatchPicker-BWXqgsEy.cjs.map → SwatchPicker-CpwVq0xp.cjs.map} +1 -1
  225. package/dist/Table-CwQKfXGn.js +1210 -0
  226. package/dist/Table-CwQKfXGn.js.map +1 -0
  227. package/dist/Table-Cwxqo7Br.cjs +2 -0
  228. package/dist/Table-Cwxqo7Br.cjs.map +1 -0
  229. package/dist/Tabs-651xbRe4.cjs +2 -0
  230. package/dist/Tabs-651xbRe4.cjs.map +1 -0
  231. package/dist/Tabs-Bztnezt9.js +194 -0
  232. package/dist/Tabs-Bztnezt9.js.map +1 -0
  233. package/dist/{TagsField-DcuSn7wL.cjs → TagsField-B7ZARHzD.cjs} +2 -2
  234. package/dist/{TagsField-DcuSn7wL.cjs.map → TagsField-B7ZARHzD.cjs.map} +1 -1
  235. package/dist/{TagsField-DuQEFHZ3.js → TagsField-CdymON69.js} +5 -5
  236. package/dist/{TagsField-DuQEFHZ3.js.map → TagsField-CdymON69.js.map} +1 -1
  237. package/dist/{TextField-E85pvJQC.cjs → TextField-B22NRQ91.cjs} +2 -2
  238. package/dist/{TextField-E85pvJQC.cjs.map → TextField-B22NRQ91.cjs.map} +1 -1
  239. package/dist/{TextField-SGYWviFf.js → TextField-DkaYK1DI.js} +4 -4
  240. package/dist/{TextField-SGYWviFf.js.map → TextField-DkaYK1DI.js.map} +1 -1
  241. package/dist/{ThemeToggle-BdlxzYNt.cjs → ThemeToggle-D5dWHQFb.cjs} +2 -2
  242. package/dist/{ThemeToggle-BdlxzYNt.cjs.map → ThemeToggle-D5dWHQFb.cjs.map} +1 -1
  243. package/dist/{ThemeToggle-C2kjFrD_.js → ThemeToggle-DqzUvcK5.js} +4 -4
  244. package/dist/{ThemeToggle-C2kjFrD_.js.map → ThemeToggle-DqzUvcK5.js.map} +1 -1
  245. package/dist/{TimeColumns-BS1d0qOp.js → TimeColumns-BEoHh961.js} +2 -2
  246. package/dist/{TimeColumns-BS1d0qOp.js.map → TimeColumns-BEoHh961.js.map} +1 -1
  247. package/dist/{TimeColumns-D7-O4Qyt.cjs → TimeColumns-o2xhvSGE.cjs} +2 -2
  248. package/dist/{TimeColumns-D7-O4Qyt.cjs.map → TimeColumns-o2xhvSGE.cjs.map} +1 -1
  249. package/dist/{TimePicker-Dzb3gycP.cjs → TimePicker-CACmHwNn.cjs} +2 -2
  250. package/dist/{TimePicker-Dzb3gycP.cjs.map → TimePicker-CACmHwNn.cjs.map} +1 -1
  251. package/dist/{TimePicker-DlzYNDN1.js → TimePicker-DCryZCmh.js} +7 -7
  252. package/dist/{TimePicker-DlzYNDN1.js.map → TimePicker-DCryZCmh.js.map} +1 -1
  253. package/dist/{Timeline-CKEosWka.cjs → Timeline-CMP93APm.cjs} +2 -2
  254. package/dist/{Timeline-CKEosWka.cjs.map → Timeline-CMP93APm.cjs.map} +1 -1
  255. package/dist/{Timeline-ufVXmpMY.js → Timeline-Dri2dPsK.js} +3 -3
  256. package/dist/{Timeline-ufVXmpMY.js.map → Timeline-Dri2dPsK.js.map} +1 -1
  257. package/dist/{Toaster-Cummylmj.cjs → Toaster-BwREV06e.cjs} +2 -2
  258. package/dist/{Toaster-Cummylmj.cjs.map → Toaster-BwREV06e.cjs.map} +1 -1
  259. package/dist/{Toaster-cu5XyKeE.js → Toaster-DwVLab3k.js} +2 -2
  260. package/dist/{Toaster-cu5XyKeE.js.map → Toaster-DwVLab3k.js.map} +1 -1
  261. package/dist/{ToggleButtonGroup-D9odYMzD.js → ToggleButtonGroup-BtVDnQIF.js} +3 -3
  262. package/dist/{ToggleButtonGroup-D9odYMzD.js.map → ToggleButtonGroup-BtVDnQIF.js.map} +1 -1
  263. package/dist/{ToggleButtonGroup-M2oj_3mc.cjs → ToggleButtonGroup-UylpGJ16.cjs} +2 -2
  264. package/dist/{ToggleButtonGroup-M2oj_3mc.cjs.map → ToggleButtonGroup-UylpGJ16.cjs.map} +1 -1
  265. package/dist/Tooltip-Bw-1Xk2Z.cjs +2 -0
  266. package/dist/Tooltip-Bw-1Xk2Z.cjs.map +1 -0
  267. package/dist/Tooltip-DsDv4NOq.js +135 -0
  268. package/dist/Tooltip-DsDv4NOq.js.map +1 -0
  269. package/dist/{TranslatedFields-Ccjhq2YL.js → TranslatedFields-B0LMXgiu.js} +5 -5
  270. package/dist/{TranslatedFields-Ccjhq2YL.js.map → TranslatedFields-B0LMXgiu.js.map} +1 -1
  271. package/dist/{TranslatedFields-CbTlgKnh.cjs → TranslatedFields-sio1Qfy7.cjs} +2 -2
  272. package/dist/{TranslatedFields-CbTlgKnh.cjs.map → TranslatedFields-sio1Qfy7.cjs.map} +1 -1
  273. package/dist/{UserCard-Bs8kuV2j.js → UserCard-B5FVcJaK.js} +5 -5
  274. package/dist/{UserCard-Bs8kuV2j.js.map → UserCard-B5FVcJaK.js.map} +1 -1
  275. package/dist/{UserCard-BfHHfkDr.cjs → UserCard-Dzc4zmPj.cjs} +2 -2
  276. package/dist/{UserCard-BfHHfkDr.cjs.map → UserCard-Dzc4zmPj.cjs.map} +1 -1
  277. package/dist/app/AdminRoot.d.cts +7 -2
  278. package/dist/app/AdminRoot.d.ts +7 -2
  279. package/dist/components/Accordion/index.cjs +1 -1
  280. package/dist/components/Accordion/index.js +1 -1
  281. package/dist/components/Alert/index.cjs +1 -1
  282. package/dist/components/Alert/index.js +1 -1
  283. package/dist/components/AuthLayout/index.cjs +1 -1
  284. package/dist/components/AuthLayout/index.js +1 -1
  285. package/dist/components/Avatar/index.cjs +1 -1
  286. package/dist/components/Avatar/index.js +2 -2
  287. package/dist/components/Breadcrumbs/index.cjs +1 -1
  288. package/dist/components/Breadcrumbs/index.js +1 -1
  289. package/dist/components/Button/index.cjs +1 -1
  290. package/dist/components/Button/index.js +1 -1
  291. package/dist/components/Card/Card.d.cts +9 -1
  292. package/dist/components/Card/Card.d.ts +9 -1
  293. package/dist/components/Card/index.cjs +1 -1
  294. package/dist/components/Card/index.js +1 -1
  295. package/dist/components/Chip/index.cjs +1 -1
  296. package/dist/components/Chip/index.js +1 -1
  297. package/dist/components/ChoiceCard/index.cjs +1 -1
  298. package/dist/components/ChoiceCard/index.js +1 -1
  299. package/dist/components/CodeBlock/index.cjs +1 -1
  300. package/dist/components/CodeBlock/index.js +1 -1
  301. package/dist/components/ColorPicker/index.cjs +1 -1
  302. package/dist/components/ColorPicker/index.js +1 -1
  303. package/dist/components/ColorRamp/index.cjs +1 -1
  304. package/dist/components/ColorRamp/index.js +1 -1
  305. package/dist/components/CopyButton/index.cjs +1 -1
  306. package/dist/components/CopyButton/index.js +1 -1
  307. package/dist/components/DashedButton/index.cjs +1 -1
  308. package/dist/components/DashedButton/index.js +1 -1
  309. package/dist/components/DatePicker/index.cjs +1 -1
  310. package/dist/components/DatePicker/index.js +1 -1
  311. package/dist/components/DateTimePicker/index.cjs +1 -1
  312. package/dist/components/DateTimePicker/index.js +1 -1
  313. package/dist/components/DescriptionList/index.cjs +1 -1
  314. package/dist/components/DescriptionList/index.js +1 -1
  315. package/dist/components/Dropdown/index.cjs +1 -1
  316. package/dist/components/Dropdown/index.js +1 -1
  317. package/dist/components/EmptyState/index.cjs +1 -1
  318. package/dist/components/EmptyState/index.js +1 -1
  319. package/dist/components/ErrorState/index.cjs +1 -1
  320. package/dist/components/ErrorState/index.js +2 -2
  321. package/dist/components/FileCard/index.cjs +1 -1
  322. package/dist/components/FileCard/index.js +1 -1
  323. package/dist/components/FileUploader/index.cjs +1 -1
  324. package/dist/components/FileUploader/index.js +1 -1
  325. package/dist/components/Flag/index.cjs +1 -1
  326. package/dist/components/Flag/index.js +1 -1
  327. package/dist/components/FullscreenToggle/index.cjs +1 -1
  328. package/dist/components/FullscreenToggle/index.js +1 -1
  329. package/dist/components/Icon/index.cjs +1 -1
  330. package/dist/components/Icon/index.js +2 -2
  331. package/dist/components/IconButton/index.cjs +1 -1
  332. package/dist/components/IconButton/index.js +1 -1
  333. package/dist/components/List/index.cjs +1 -1
  334. package/dist/components/List/index.js +1 -1
  335. package/dist/components/Loader/index.cjs +1 -1
  336. package/dist/components/Loader/index.js +1 -1
  337. package/dist/components/Modal/index.cjs +1 -1
  338. package/dist/components/Modal/index.js +1 -1
  339. package/dist/components/MultiSelect/index.cjs +1 -1
  340. package/dist/components/MultiSelect/index.js +1 -1
  341. package/dist/components/NumberField/index.cjs +1 -1
  342. package/dist/components/NumberField/index.js +1 -1
  343. package/dist/components/OtpField/index.cjs +1 -1
  344. package/dist/components/OtpField/index.js +1 -1
  345. package/dist/components/PageLayout/index.cjs +1 -1
  346. package/dist/components/PageLayout/index.js +1 -1
  347. package/dist/components/PageNotFound/index.cjs +1 -1
  348. package/dist/components/PageNotFound/index.js +1 -1
  349. package/dist/components/Pagination/index.cjs +1 -1
  350. package/dist/components/Pagination/index.js +1 -1
  351. package/dist/components/PaletteField/index.cjs +1 -1
  352. package/dist/components/PaletteField/index.js +1 -1
  353. package/dist/components/PhoneField/index.cjs +1 -1
  354. package/dist/components/PhoneField/index.js +1 -1
  355. package/dist/components/Popconfirm/index.cjs +1 -1
  356. package/dist/components/Popconfirm/index.js +1 -1
  357. package/dist/components/Popover/index.cjs +1 -1
  358. package/dist/components/Popover/index.js +1 -1
  359. package/dist/components/Progress/index.cjs +1 -1
  360. package/dist/components/Progress/index.js +1 -1
  361. package/dist/components/Radio/RadioGroup.d.cts +1 -1
  362. package/dist/components/Radio/RadioGroup.d.ts +1 -1
  363. package/dist/components/Radio/index.cjs +1 -1
  364. package/dist/components/Radio/index.js +1 -1
  365. package/dist/components/RemoveDialog/index.cjs +1 -1
  366. package/dist/components/RemoveDialog/index.js +1 -1
  367. package/dist/components/RichTextEditor/RichTextEditor.d.cts +16 -1
  368. package/dist/components/RichTextEditor/RichTextEditor.d.ts +16 -1
  369. package/dist/components/RichTextEditor/index.cjs +1 -1
  370. package/dist/components/RichTextEditor/index.js +1 -1
  371. package/dist/components/RootLayout/RootLayout.d.cts +8 -1
  372. package/dist/components/RootLayout/RootLayout.d.ts +8 -1
  373. package/dist/components/RootLayout/SettingsDrawer.d.cts +4 -1
  374. package/dist/components/RootLayout/SettingsDrawer.d.ts +4 -1
  375. package/dist/components/RootLayout/index.cjs +1 -1
  376. package/dist/components/RootLayout/index.js +1 -1
  377. package/dist/components/Select/index.cjs +1 -1
  378. package/dist/components/Select/index.js +1 -1
  379. package/dist/components/Sidebar/Sidebar.d.cts +2 -0
  380. package/dist/components/Sidebar/Sidebar.d.ts +2 -0
  381. package/dist/components/Sidebar/index.cjs +1 -1
  382. package/dist/components/Sidebar/index.js +1 -1
  383. package/dist/components/SpeedDial/index.cjs +1 -1
  384. package/dist/components/SpeedDial/index.js +1 -1
  385. package/dist/components/Stepper/Stepper.d.cts +8 -1
  386. package/dist/components/Stepper/Stepper.d.ts +8 -1
  387. package/dist/components/Stepper/index.cjs +1 -1
  388. package/dist/components/Stepper/index.js +1 -1
  389. package/dist/components/SwatchPicker/index.cjs +1 -1
  390. package/dist/components/SwatchPicker/index.js +1 -1
  391. package/dist/components/Table/Table.d.cts +20 -3
  392. package/dist/components/Table/Table.d.ts +20 -3
  393. package/dist/components/Table/index.cjs +1 -1
  394. package/dist/components/Table/index.js +1 -1
  395. package/dist/components/Table/tableFilter.d.cts +12 -2
  396. package/dist/components/Table/tableFilter.d.ts +12 -2
  397. package/dist/components/Tabs/Tabs.d.cts +8 -1
  398. package/dist/components/Tabs/Tabs.d.ts +8 -1
  399. package/dist/components/Tabs/index.cjs +1 -1
  400. package/dist/components/Tabs/index.js +1 -1
  401. package/dist/components/TagsField/index.cjs +1 -1
  402. package/dist/components/TagsField/index.js +1 -1
  403. package/dist/components/TextField/index.cjs +1 -1
  404. package/dist/components/TextField/index.js +1 -1
  405. package/dist/components/ThemeToggle/index.cjs +1 -1
  406. package/dist/components/ThemeToggle/index.js +1 -1
  407. package/dist/components/TimePicker/index.cjs +1 -1
  408. package/dist/components/TimePicker/index.js +1 -1
  409. package/dist/components/Timeline/index.cjs +1 -1
  410. package/dist/components/Timeline/index.js +1 -1
  411. package/dist/components/Toast/index.cjs +1 -1
  412. package/dist/components/Toast/index.js +1 -1
  413. package/dist/components/ToggleButton/index.cjs +1 -1
  414. package/dist/components/ToggleButton/index.js +1 -1
  415. package/dist/components/Tooltip/Tooltip.d.cts +10 -3
  416. package/dist/components/Tooltip/Tooltip.d.ts +10 -3
  417. package/dist/components/Tooltip/index.cjs +1 -1
  418. package/dist/components/Tooltip/index.js +1 -1
  419. package/dist/components/TranslatedFields/index.cjs +1 -1
  420. package/dist/components/TranslatedFields/index.js +1 -1
  421. package/dist/components/UserCard/index.cjs +1 -1
  422. package/dist/components/UserCard/index.js +1 -1
  423. package/dist/entries/app.cjs +1 -1
  424. package/dist/entries/app.js +1 -1
  425. package/dist/entries/components.cjs +1 -1
  426. package/dist/entries/components.js +64 -64
  427. package/dist/entries/hooks.cjs +1 -1
  428. package/dist/entries/hooks.d.cts +2 -0
  429. package/dist/entries/hooks.d.ts +2 -0
  430. package/dist/entries/hooks.js +9 -8
  431. package/dist/entries/i18n.cjs +1 -1
  432. package/dist/entries/i18n.js +2 -2
  433. package/dist/entries/icons.cjs +1 -1
  434. package/dist/entries/icons.js +2 -2
  435. package/dist/entries/theme.cjs +1 -1
  436. package/dist/entries/theme.d.cts +1 -1
  437. package/dist/entries/theme.d.ts +1 -1
  438. package/dist/entries/theme.js +1 -1
  439. package/dist/hooks/index.d.cts +2 -0
  440. package/dist/hooks/index.d.ts +2 -0
  441. package/dist/hooks/useClearUrlOnUnmount.d.cts +19 -0
  442. package/dist/hooks/useClearUrlOnUnmount.d.ts +19 -0
  443. package/dist/hooks/useQueryModal.d.cts +40 -0
  444. package/dist/hooks/useQueryModal.d.ts +40 -0
  445. package/dist/i18n/messages.d.cts +12 -0
  446. package/dist/i18n/messages.d.ts +12 -0
  447. package/dist/icons/names.d.cts +3 -3
  448. package/dist/icons/names.d.ts +3 -3
  449. package/dist/index.cjs +1 -1
  450. package/dist/index.css +1 -1
  451. package/dist/index.js +251 -250
  452. package/dist/{messages-FiUqCKjJ.cjs → messages-DS38X5W2.cjs} +9 -9
  453. package/dist/messages-DS38X5W2.cjs.map +1 -0
  454. package/dist/{messages-DCefu6Pn.js → messages-DswDgGe2.js} +52 -10
  455. package/dist/messages-DswDgGe2.js.map +1 -0
  456. package/dist/{names-r21QPjcU.js → names-BR1uJs0-.js} +5 -4
  457. package/dist/names-BR1uJs0-.js.map +1 -0
  458. package/dist/names-YOCJ4B5J.cjs +2 -0
  459. package/dist/names-YOCJ4B5J.cjs.map +1 -0
  460. package/dist/theme/ConfigProvider.d.cts +48 -0
  461. package/dist/theme/ConfigProvider.d.ts +48 -0
  462. package/dist/theme/index.d.cts +1 -1
  463. package/dist/theme/index.d.ts +1 -1
  464. package/dist/useClearUrlOnUnmount-Cg7v2y5B.cjs +2 -0
  465. package/dist/useClearUrlOnUnmount-Cg7v2y5B.cjs.map +1 -0
  466. package/dist/useClearUrlOnUnmount-DOeh6CUN.js +37 -0
  467. package/dist/useClearUrlOnUnmount-DOeh6CUN.js.map +1 -0
  468. package/dist/useForm-CGbJ44Gp.js +194 -0
  469. package/dist/useForm-CGbJ44Gp.js.map +1 -0
  470. package/dist/useForm-CSw6r1n1.cjs +2 -0
  471. package/dist/useForm-CSw6r1n1.cjs.map +1 -0
  472. package/dist/{useOptionMenu-BoWyPgbY.cjs → useOptionMenu-BYeSUee6.cjs} +2 -2
  473. package/dist/{useOptionMenu-BoWyPgbY.cjs.map → useOptionMenu-BYeSUee6.cjs.map} +1 -1
  474. package/dist/{useOptionMenu-D7EbYG9A.js → useOptionMenu-DtTvY9EC.js} +6 -6
  475. package/dist/{useOptionMenu-D7EbYG9A.js.map → useOptionMenu-DtTvY9EC.js.map} +1 -1
  476. package/package.json +1 -1
  477. package/dist/AdminRoot-9HGp3Mds.js +0 -55
  478. package/dist/AdminRoot-9HGp3Mds.js.map +0 -1
  479. package/dist/AdminRoot-D24UJ-4a.cjs +0 -2
  480. package/dist/AdminRoot-D24UJ-4a.cjs.map +0 -1
  481. package/dist/Card-CUUh4mlB.cjs +0 -2
  482. package/dist/Card-CUUh4mlB.cjs.map +0 -1
  483. package/dist/Card-MxYfQTOY.js +0 -121
  484. package/dist/Card-MxYfQTOY.js.map +0 -1
  485. package/dist/ConfigProvider-BbsI15b-.js +0 -320
  486. package/dist/ConfigProvider-BbsI15b-.js.map +0 -1
  487. package/dist/ConfigProvider-ByLHqXpv.cjs +0 -2
  488. package/dist/ConfigProvider-ByLHqXpv.cjs.map +0 -1
  489. package/dist/DescriptionList-U5z2Faf4.cjs +0 -2
  490. package/dist/FloatingPanel-BIC4WrFa.cjs +0 -2
  491. package/dist/FloatingPanel-CeSOtE_D.js +0 -135
  492. package/dist/Icon-BVULqOJD.cjs +0 -2
  493. package/dist/Icon-BVULqOJD.cjs.map +0 -1
  494. package/dist/Icon-DaTvzLBu.js.map +0 -1
  495. package/dist/RadioGroup-BcFBdFhh.cjs +0 -2
  496. package/dist/RadioGroup-BcFBdFhh.cjs.map +0 -1
  497. package/dist/RadioGroup-dVx_hMCY.js +0 -141
  498. package/dist/RadioGroup-dVx_hMCY.js.map +0 -1
  499. package/dist/RichTextEditor-BDAWmQrN.js +0 -806
  500. package/dist/RichTextEditor-BDAWmQrN.js.map +0 -1
  501. package/dist/RichTextEditor-D4HpPT3C.cjs +0 -2
  502. package/dist/RichTextEditor-D4HpPT3C.cjs.map +0 -1
  503. package/dist/RootLayout-CxncyjCz.js +0 -515
  504. package/dist/RootLayout-CxncyjCz.js.map +0 -1
  505. package/dist/RootLayout-XEcU_MBs.cjs +0 -2
  506. package/dist/RootLayout-XEcU_MBs.cjs.map +0 -1
  507. package/dist/Sidebar-B8ecHwZr.cjs +0 -2
  508. package/dist/Sidebar-B8ecHwZr.cjs.map +0 -1
  509. package/dist/Sidebar-BgCfnZBF.js.map +0 -1
  510. package/dist/Stepper-DOSc03YV.cjs +0 -2
  511. package/dist/Stepper-DOSc03YV.cjs.map +0 -1
  512. package/dist/Stepper-DtYamv1q.js +0 -165
  513. package/dist/Stepper-DtYamv1q.js.map +0 -1
  514. package/dist/Table-AzNzUAkl.js +0 -1170
  515. package/dist/Table-AzNzUAkl.js.map +0 -1
  516. package/dist/Table-CrpWhZUg.cjs +0 -2
  517. package/dist/Table-CrpWhZUg.cjs.map +0 -1
  518. package/dist/Tabs-CMnLXRjA.cjs +0 -2
  519. package/dist/Tabs-CMnLXRjA.cjs.map +0 -1
  520. package/dist/Tabs-D1RGhKsa.js +0 -190
  521. package/dist/Tabs-D1RGhKsa.js.map +0 -1
  522. package/dist/Tooltip-Ao7az09p.cjs +0 -2
  523. package/dist/Tooltip-Ao7az09p.cjs.map +0 -1
  524. package/dist/Tooltip-Cb_FKxT9.js +0 -65
  525. package/dist/Tooltip-Cb_FKxT9.js.map +0 -1
  526. package/dist/messages-DCefu6Pn.js.map +0 -1
  527. package/dist/messages-FiUqCKjJ.cjs.map +0 -1
  528. package/dist/names-BJnFU_5m.cjs +0 -2
  529. package/dist/names-BJnFU_5m.cjs.map +0 -1
  530. package/dist/names-r21QPjcU.js.map +0 -1
  531. package/dist/useForm-CN-qCrP7.js +0 -144
  532. package/dist/useForm-CN-qCrP7.js.map +0 -1
  533. package/dist/useForm-WvV361y6.cjs +0 -2
  534. package/dist/useForm-WvV361y6.cjs.map +0 -1
@@ -0,0 +1,135 @@
1
+ import { jsxs as j, jsx as I } from "react/jsx-runtime";
2
+ import { useId as M, useState as w, useRef as y, useCallback as N, useEffect as x, useLayoutEffect as W, cloneElement as k } from "react";
3
+ import { createPortal as B } from "react-dom";
4
+ import { clsx as G } from "clsx";
5
+ const H = "_root_1i027_4", q = "_tooltip_1i027_13", V = "_arrow_1i027_41", J = "_top_1i027_49", Q = "_bottom_1i027_59", U = "_left_1i027_69", X = "_right_1i027_79", _ = {
6
+ root: H,
7
+ tooltip: q,
8
+ arrow: V,
9
+ top: J,
10
+ bottom: Q,
11
+ left: U,
12
+ right: X
13
+ }, E = 8, c = 8, P = {
14
+ top: "bottom",
15
+ bottom: "top",
16
+ left: "right",
17
+ right: "left"
18
+ };
19
+ function Y(o, n, l) {
20
+ const u = window.innerWidth, p = window.innerHeight, d = (t) => t === "top" ? o.top - E - n.height >= c : t === "bottom" ? o.bottom + E + n.height <= p - c : t === "left" ? o.left - E - n.width >= c : o.right + E + n.width <= u - c, i = !d(l) && d(P[l]) ? P[l] : l, m = (t, r, f) => t - r < c ? c - (t - r) : t + r > f - c ? f - c - (t + r) : 0;
21
+ if (i === "top" || i === "bottom") {
22
+ const t = o.left + o.width / 2;
23
+ return {
24
+ side: i,
25
+ x: t,
26
+ y: i === "top" ? o.top : o.bottom,
27
+ shift: m(t, n.width / 2, u)
28
+ };
29
+ }
30
+ const h = o.top + o.height / 2;
31
+ return {
32
+ side: i,
33
+ x: i === "left" ? o.left : o.right,
34
+ y: h,
35
+ shift: m(h, n.height / 2, p)
36
+ };
37
+ }
38
+ function tt({
39
+ content: o,
40
+ placement: n = "top",
41
+ color: l = "primary",
42
+ children: u,
43
+ className: p,
44
+ style: d,
45
+ onKeyDown: i,
46
+ ...m
47
+ }) {
48
+ const h = `${M()}-tooltip`, [t, r] = w(!1), [f, b] = w(!1), [R, z] = w(!1), [s, S] = w(null), L = y(null), T = y(null), $ = o != null && o !== "", a = N(() => {
49
+ const e = L.current, v = T.current;
50
+ !e || !v || S(
51
+ Y(
52
+ e.getBoundingClientRect(),
53
+ { width: v.offsetWidth, height: v.offsetHeight },
54
+ n
55
+ )
56
+ );
57
+ }, [n]);
58
+ x(() => {
59
+ t ? b(!0) : z(!1);
60
+ }, [t]), W(() => {
61
+ if (!t || !f) return;
62
+ a();
63
+ const e = requestAnimationFrame(() => z(!0));
64
+ return () => cancelAnimationFrame(e);
65
+ }, [t, f, a, o]), x(() => {
66
+ if (t)
67
+ return window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
68
+ window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
69
+ };
70
+ }, [t, a]), x(() => {
71
+ if (t || !f) return;
72
+ const e = window.setTimeout(() => b(!1), 400);
73
+ return () => window.clearTimeout(e);
74
+ }, [t, f]);
75
+ const A = (e) => {
76
+ e.key === "Escape" && r(!1), i == null || i(e);
77
+ };
78
+ if (!$) return u;
79
+ const O = {
80
+ "--tz-btn-rgb": `var(--tz-color-${l}-rgb)`,
81
+ "--tz-btn-on": `var(--tz-color-${l}-contrast, #fff)`
82
+ }, C = (s == null ? void 0 : s.side) ?? n, F = Object.fromEntries(
83
+ Object.entries(d ?? {}).filter(([e]) => e.startsWith("--"))
84
+ );
85
+ return /* @__PURE__ */ j(
86
+ "span",
87
+ {
88
+ ref: L,
89
+ className: G(_.root, p),
90
+ style: { ...O, ...d },
91
+ onMouseEnter: () => r(!0),
92
+ onMouseLeave: () => r(!1),
93
+ onFocus: () => r(!0),
94
+ onBlur: () => r(!1),
95
+ onKeyDown: A,
96
+ ...m,
97
+ children: [
98
+ t ? k(u, {
99
+ "aria-describedby": h
100
+ }) : u,
101
+ f && typeof document < "u" && B(
102
+ /* @__PURE__ */ j(
103
+ "span",
104
+ {
105
+ ref: T,
106
+ role: "tooltip",
107
+ id: h,
108
+ className: G(_.tooltip, _[C]),
109
+ "data-open": t && R ? "true" : "false",
110
+ style: {
111
+ ...O,
112
+ ...F,
113
+ top: (s == null ? void 0 : s.y) ?? 0,
114
+ left: (s == null ? void 0 : s.x) ?? 0,
115
+ "--tz-tooltip-shift": `${(s == null ? void 0 : s.shift) ?? 0}px`
116
+ },
117
+ onTransitionEnd: () => {
118
+ t || b(!1);
119
+ },
120
+ children: [
121
+ o,
122
+ /* @__PURE__ */ I("span", { className: _.arrow, "aria-hidden": "true" })
123
+ ]
124
+ }
125
+ ),
126
+ document.body
127
+ )
128
+ ]
129
+ }
130
+ );
131
+ }
132
+ export {
133
+ tt as T
134
+ };
135
+ //# sourceMappingURL=Tooltip-DsDv4NOq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip-DsDv4NOq.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import {\n cloneElement,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport styles from './Tooltip.module.css'\n\nexport type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right'\n\nexport interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'content' | 'color'> {\n /** The tooltip text/content shown on hover or focus. Empty content renders no tooltip. */\n content: ReactNode\n /**\n * Which side of the trigger the tooltip appears on. Defaults to `top`. Flips to the opposite side when\n * the preferred one has no room in the viewport.\n */\n placement?: TooltipPlacement\n /** Theme palette token for the fill (label uses its contrast color). Defaults to `primary`. */\n color?: ThemeColor\n /** A single focusable element to attach the tooltip to (e.g. a `Button` or `IconButton`). */\n children: ReactElement\n}\n\n/** Bubble ↔ trigger gap (the CSS margin, `--tz-space-xs`) — used here only to decide whether a side fits. */\nconst GAP = 8\n/** Minimum distance kept between the bubble and the viewport edge. */\nconst EDGE = 8\nconst OPPOSITE: Record<TooltipPlacement, TooltipPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n}\n\ninterface TooltipGeometry {\n side: TooltipPlacement\n /** The anchor point on the trigger's edge (viewport px) — CSS offsets the bubble from it. */\n x: number\n y: number\n /** Cross-axis nudge that keeps the bubble inside the viewport (the arrow counter-shifts). */\n shift: number\n}\n\n/**\n * Where the bubble goes: the preferred side unless only the opposite one fits, anchored at the middle of\n * that trigger edge, nudged along the cross axis so it never runs off-screen.\n */\nfunction computeGeometry(\n trigger: DOMRect,\n bubble: { width: number; height: number },\n placement: TooltipPlacement,\n): TooltipGeometry {\n const vw = window.innerWidth\n const vh = window.innerHeight\n const fits = (side: TooltipPlacement) =>\n side === 'top'\n ? trigger.top - GAP - bubble.height >= EDGE\n : side === 'bottom'\n ? trigger.bottom + GAP + bubble.height <= vh - EDGE\n : side === 'left'\n ? trigger.left - GAP - bubble.width >= EDGE\n : trigger.right + GAP + bubble.width <= vw - EDGE\n const side = !fits(placement) && fits(OPPOSITE[placement]) ? OPPOSITE[placement] : placement\n\n const clampShift = (center: number, half: number, size: number) =>\n center - half < EDGE\n ? EDGE - (center - half)\n : center + half > size - EDGE\n ? size - EDGE - (center + half)\n : 0\n\n if (side === 'top' || side === 'bottom') {\n const x = trigger.left + trigger.width / 2\n return {\n side,\n x,\n y: side === 'top' ? trigger.top : trigger.bottom,\n shift: clampShift(x, bubble.width / 2, vw),\n }\n }\n const y = trigger.top + trigger.height / 2\n return {\n side,\n x: side === 'left' ? trigger.left : trigger.right,\n y,\n shift: clampShift(y, bubble.height / 2, vh),\n }\n}\n\n/**\n * Shows a small floating label on hover or keyboard focus of its child, with an arrow pointing at\n * the trigger. Wrap a single element: `<Tooltip content=\"Save\"><IconButton…/></Tooltip>`. Opens on\n * `mouseenter`/`focus`, closes on `mouseleave`/`blur`/`Escape`. The child gets `aria-describedby`\n * while open (the label has `role=\"tooltip\"`). The bubble is **portaled to `<body>`** with fixed\n * positioning, so a scrolling / `overflow: hidden` ancestor (a `Table`'s scroll area, a `Modal` body)\n * never clips it; it flips to the opposite side when the preferred one has no room, stays inside the\n * viewport, follows the trigger on scroll / resize, and is mounted only while shown. Token-only styling\n * via the shared `--tz-btn-rgb` pattern — `color` (default `primary`) sets the fill and its contrast\n * label, flipping with the theme.\n */\nexport function Tooltip({\n content,\n placement = 'top',\n color = 'primary',\n children,\n className,\n style,\n onKeyDown,\n ...props\n}: TooltipProps) {\n const tooltipId = `${useId()}-tooltip`\n const [open, setOpen] = useState(false)\n // mounted spans the fade-out too; `shown` drives the CSS fade (one frame after the first measure)\n const [mounted, setMounted] = useState(false)\n const [shown, setShown] = useState(false)\n const [geometry, setGeometry] = useState<TooltipGeometry | null>(null)\n const rootRef = useRef<HTMLSpanElement | null>(null)\n const bubbleRef = useRef<HTMLSpanElement | null>(null)\n const hasContent = content !== null && content !== undefined && content !== ''\n\n const measure = useCallback(() => {\n const root = rootRef.current\n const bubble = bubbleRef.current\n if (!root || !bubble) return\n setGeometry(\n computeGeometry(\n root.getBoundingClientRect(),\n { width: bubble.offsetWidth, height: bubble.offsetHeight },\n placement,\n ),\n )\n }, [placement])\n\n useEffect(() => {\n if (open) setMounted(true)\n else setShown(false)\n }, [open])\n\n // measure before paint, then fade in on the next frame (so the bubble never flashes at 0,0)\n useLayoutEffect(() => {\n if (!open || !mounted) return\n measure()\n const frame = requestAnimationFrame(() => setShown(true))\n return () => cancelAnimationFrame(frame)\n }, [open, mounted, measure, content])\n\n // follow the trigger while open — any scroll (capture: a table's scroll area too) or resize\n useEffect(() => {\n if (!open) return\n window.addEventListener('scroll', measure, true)\n window.addEventListener('resize', measure)\n return () => {\n window.removeEventListener('scroll', measure, true)\n window.removeEventListener('resize', measure)\n }\n }, [open, measure])\n\n // unmount once faded out; the timer covers a transition that never fires (no CSS, reduced motion)\n useEffect(() => {\n if (open || !mounted) return\n const timer = window.setTimeout(() => setMounted(false), 400)\n return () => window.clearTimeout(timer)\n }, [open, mounted])\n\n const handleKeyDown = (event: KeyboardEvent<HTMLSpanElement>) => {\n if (event.key === 'Escape') setOpen(false)\n onKeyDown?.(event)\n }\n\n if (!hasContent) return children\n\n const tint = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n } as CSSProperties\n const side = geometry?.side ?? placement\n // the bubble is portaled out of the wrapper, so CSS variables set through `style` (e.g. a custom\n // `--tz-btn-rgb` / `--tz-btn-on` tint, as CodeBlock's white pill does) are copied onto it explicitly\n const bubbleVars = Object.fromEntries(\n Object.entries(style ?? {}).filter(([property]) => property.startsWith('--')),\n ) as CSSProperties\n\n return (\n <span\n ref={rootRef}\n className={clsx(styles.root, className)}\n style={{ ...tint, ...style }}\n onMouseEnter={() => setOpen(true)}\n onMouseLeave={() => setOpen(false)}\n onFocus={() => setOpen(true)}\n onBlur={() => setOpen(false)}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {open\n ? cloneElement(children as ReactElement<{ 'aria-describedby'?: string }>, {\n 'aria-describedby': tooltipId,\n })\n : children}\n {mounted &&\n typeof document !== 'undefined' &&\n createPortal(\n <span\n ref={bubbleRef}\n role=\"tooltip\"\n id={tooltipId}\n className={clsx(styles.tooltip, styles[side])}\n data-open={open && shown ? 'true' : 'false'}\n style={\n {\n ...tint,\n ...bubbleVars,\n top: geometry?.y ?? 0,\n left: geometry?.x ?? 0,\n '--tz-tooltip-shift': `${geometry?.shift ?? 0}px`,\n } as CSSProperties\n }\n onTransitionEnd={() => {\n if (!open) setMounted(false)\n }}\n >\n {content}\n <span className={styles.arrow} aria-hidden=\"true\" />\n </span>,\n document.body,\n )}\n </span>\n )\n}\n"],"names":["GAP","EDGE","OPPOSITE","computeGeometry","trigger","bubble","placement","vw","vh","fits","side","clampShift","center","half","size","x","y","Tooltip","content","color","children","className","style","onKeyDown","props","tooltipId","useId","open","setOpen","useState","mounted","setMounted","shown","setShown","geometry","setGeometry","rootRef","useRef","bubbleRef","hasContent","measure","useCallback","root","useEffect","useLayoutEffect","frame","timer","handleKeyDown","event","tint","bubbleVars","property","jsxs","clsx","styles","cloneElement","createPortal"],"mappings":";;;;;;;;;;;;GAoCMA,IAAM,GAENC,IAAO,GACPC,IAAuD;AAAA,EAC3D,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AACT;AAeA,SAASC,EACPC,GACAC,GACAC,GACiB;AACjB,QAAMC,IAAK,OAAO,YACZC,IAAK,OAAO,aACZC,IAAO,CAACC,MACZA,MAAS,QACLN,EAAQ,MAAMJ,IAAMK,EAAO,UAAUJ,IACrCS,MAAS,WACPN,EAAQ,SAASJ,IAAMK,EAAO,UAAUG,IAAKP,IAC7CS,MAAS,SACPN,EAAQ,OAAOJ,IAAMK,EAAO,SAASJ,IACrCG,EAAQ,QAAQJ,IAAMK,EAAO,SAASE,IAAKN,GAC/CS,IAAO,CAACD,EAAKH,CAAS,KAAKG,EAAKP,EAASI,CAAS,CAAC,IAAIJ,EAASI,CAAS,IAAIA,GAE7EK,IAAa,CAACC,GAAgBC,GAAcC,MAChDF,IAASC,IAAOZ,IACZA,KAAQW,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AAAA,UAAA;AAAA,UAEpD,SAAS;AAAA,QAAA;AAAA,MACX;AAAA,IAAA;AAAA,EAAA;AAGR;"}
@@ -2,10 +2,10 @@ import { jsx as d } from "react/jsx-runtime";
2
2
  import { forwardRef as g, useState as z, useRef as b, useEffect as R } from "react";
3
3
  import { u as D } from "./formContext-B7ln1Miy.js";
4
4
  import { b as j } from "./translations-D15tFHM1.js";
5
- import { f as J } from "./messages-DCefu6Pn.js";
6
- import { F as M } from "./Flag-CmDXvd7j.js";
7
- import { T as P } from "./Tabs-D1RGhKsa.js";
8
- import { h as Q, n as U } from "./ConfigProvider-BbsI15b-.js";
5
+ import { f as J } from "./messages-DswDgGe2.js";
6
+ import { F as M } from "./Flag-DDR6OANA.js";
7
+ import { T as P } from "./Tabs-Bztnezt9.js";
8
+ import { h as Q, n as U } from "./ConfigProvider-Ct0Pe3Ku.js";
9
9
  const X = "_fields_aawaf_4", Y = {
10
10
  fields: X
11
11
  }, ie = g(
@@ -83,4 +83,4 @@ const X = "_fields_aawaf_4", Y = {
83
83
  export {
84
84
  ie as T
85
85
  };
86
- //# sourceMappingURL=TranslatedFields-Ccjhq2YL.js.map
86
+ //# sourceMappingURL=TranslatedFields-B0LMXgiu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TranslatedFields-Ccjhq2YL.js","sources":["../src/components/TranslatedFields/TranslatedFields.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState, type CSSProperties, type ReactNode } from 'react'\nimport { useFormContext } from '../../form/formContext'\nimport { useLocales, useTranslationsNamespace, type LocaleConfig } from '../../theme'\nimport { buildTranslationName } from '../../helpers/translations'\nimport { flagFor } from '../../i18n/messages'\nimport type { IconName } from '../../icons/names'\nimport { Flag } from '../Flag'\nimport { Tabs, type TabsSize, type TabsVariant } from '../Tabs'\nimport styles from './TranslatedFields.module.css'\n\n/** Builds a field's namespaced form name for the active locale (`(field) => name`). */\nexport type TranslatedFieldName = (field: string) => string\n\nexport interface TranslatedFieldsProps {\n /**\n * Render the fields for one locale. `name(field)` returns the namespaced form name to put on each\n * control (e.g. `translations[en-US].title`); `locale` is the active code. The same render runs per\n * locale, so the fields are identical bar their names.\n */\n children: (name: TranslatedFieldName, locale: string) => ReactNode\n /**\n * Locales (one tab each). Defaults to the app's configured locales\n * (`<ConfigProvider config={{ locales }}>`).\n */\n locales?: LocaleConfig[]\n /**\n * Top-level namespace for the field names (`<namespace>[<locale>].<field>`) and the nested object.\n * Falls back to `<ConfigProvider config={{ keys: { translationsNamespace } }}>`, then `'translations'`.\n * Pass to override per-instance (e.g. `'languages'`).\n */\n namespace?: string\n /** Controlled active locale code. */\n value?: string\n /** Initial active locale code (uncontrolled). Defaults to the first locale. */\n defaultValue?: string\n /** Fires with the next active locale code. */\n onChange?: (locale: string) => void\n /**\n * Show each locale's **flag** on its tab (matched by the language via `flagFor`). A language with no\n * built-in flag falls back to the `icon`. Defaults to `true`; pass `false` to always use `icon`.\n */\n showFlags?: boolean\n /** Fallback icon shown on a locale tab when its language has no flag (or `showFlags={false}`). Defaults to `'Global'`. */\n icon?: IconName\n /** Tab strip variant. Defaults to `Tabs`' default (`underline`). */\n variant?: TabsVariant\n /** Tab + field density. Defaults to `Tabs`' default (`md`). */\n size?: TabsSize\n /** Accessible label for the tablist. Defaults to `'Translations'`. */\n 'aria-label'?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A tabbed group of **per-locale** form fields — one tab per content locale, each rendering the same\n * fields with locale-namespaced `name`s (`translations[<locale>].<field>` by default), so a `<Form>`\n * submits e.g. `translations[en-US].title` / `translations[ka-GE].title`. You supply the fields once\n * via a render function that receives a `name(field)` builder for the active locale; bring any field\n * component (`TextField`, `MultilineTextField`, a rich-text editor, …). Locales come from\n * `<ConfigProvider config={{ locales }}>` (override with the `locales` prop). The top-level word is the\n * `namespace` (default `'translations'`, e.g. `'languages'`). Each tab shows its language's **flag**\n * (matched via `flagFor`); a language with no built-in flag falls back to the `icon` (a `Global` icon by\n * default), and `showFlags={false}` uses the `icon` for every tab. While inside a `<Form>`, an incomplete\n * locale's tab shows a **dot**, and on submit the strip auto-advances to the first locale with errors\n * and focuses its field. Build the schema / defaults with `buildTranslations`; the form values stay\n * **flat** (`translations[en-US].title` — the `FormData` shape) — convert to/from the **nested** JSON\n * shape (`{ translations: { 'en-US': { title } } }`) with `nestTranslations` / `flattenTranslations`.\n * Requires the `Tabs` component.\n */\nexport const TranslatedFields = forwardRef<HTMLDivElement, TranslatedFieldsProps>(\n function TranslatedFields(\n {\n children,\n locales: localesProp,\n namespace: namespaceProp,\n value,\n defaultValue,\n onChange,\n showFlags = true,\n icon = 'Global',\n variant,\n size,\n 'aria-label': ariaLabel = 'Translations',\n className,\n style,\n },\n ref,\n ) {\n const configLocales = useLocales()\n const locales = localesProp ?? configLocales\n // namespace: the `namespace` prop wins, else the ConfigProvider's (which falls back to the default)\n const configNamespace = useTranslationsNamespace()\n const namespace = namespaceProp ?? configNamespace\n const form = useFormContext()\n\n // active locale — controlled (`value`) or internal; falls back to the first locale\n const isControlled = value !== undefined\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const active = (isControlled ? value : internal) ?? locales[0]?.code ?? ''\n const setActive = (next: string) => {\n if (!isControlled) setInternal(next)\n onChange?.(next)\n }\n\n // the namespaced-name prefix for a locale (e.g. `translations[en-US].`)\n const prefixOf = (code: string) => buildTranslationName(code, '', namespace)\n // a locale's tab is flagged when any of its fields is invalid AND the error is shown (submitted/touched)\n const localeHasError = (code: string): boolean =>\n !!form &&\n Object.keys(form.errors).some(\n (key) => key.startsWith(prefixOf(code)) && (form.isSubmitted || form.touched[key] === true),\n )\n\n // merge the forwarded ref with an internal one (to query the mounted fields for scroll/focus)\n const rootRef = useRef<HTMLDivElement | null>(null)\n const setRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLDivElement | null }).current = node\n }\n\n // on each submit, if the active tab is complete but another locale has the only remaining errors,\n // switch to it and focus its first invalid field (the form's own scroll can't reach an unmounted tab)\n const lastSubmit = useRef(0)\n const pendingFocus = useRef<string | null>(null)\n useEffect(() => {\n const count = form?.submitCount ?? 0\n if (!form || count === lastSubmit.current) return\n lastSubmit.current = count\n const errorKeys = Object.keys(form.errors)\n if (errorKeys.length === 0) return\n const isTranslationKey = (k: string) => locales.some((l) => k.startsWith(prefixOf(l.code)))\n // a non-translation field is still invalid → the form's scroll-to-error handles it (above the tabs)\n if (!errorKeys.every(isTranslationKey)) return\n // active locale already shows its (mounted) errors → nothing to switch to\n if (errorKeys.some((k) => k.startsWith(prefixOf(active)))) return\n const firstBad = locales.find((l) => errorKeys.some((k) => k.startsWith(prefixOf(l.code))))\n if (firstBad && firstBad.code !== active) {\n pendingFocus.current = firstBad.code\n setActive(firstBad.code)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [form?.submitCount])\n\n // once the auto-switched tab has mounted, focus its first invalid field\n useEffect(() => {\n if (pendingFocus.current == null || pendingFocus.current !== active) return\n pendingFocus.current = null\n const root = rootRef.current\n if (!root || !form) return\n const errorKeys = new Set(Object.keys(form.errors))\n const target = Array.from(root.querySelectorAll<HTMLElement>('[name]')).find((el) =>\n errorKeys.has(el.getAttribute('name') ?? ''),\n )\n target?.scrollIntoView?.({ behavior: 'smooth', block: 'center' })\n target?.focus({ preventScroll: true })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [active])\n\n if (locales.length === 0) return null\n\n const items = locales.map((loc) => ({\n value: loc.code,\n label: loc.label ?? loc.code,\n // the locale's flag when it has one (and flags are enabled), else the fallback `icon` (Global)\n icon: showFlags && flagFor(loc.code) ? <Flag code={loc.code} /> : icon,\n // an invalid locale shows the Tabs error dot (a small red dot — no full-tab tint)\n error: localeHasError(loc.code),\n // keyed by locale so switching tabs remounts the fields (no value/state bleed between locales)\n content: (\n <div key={loc.code} className={styles.fields}>\n {children((field) => buildTranslationName(loc.code, field, namespace), loc.code)}\n </div>\n ),\n }))\n\n return (\n <Tabs\n ref={setRootRef}\n className={className}\n style={style}\n items={items}\n value={active}\n onChange={setActive}\n variant={variant}\n size={size}\n // locale tabs are internal UI — never sync them to the page URL\n queryKey={null}\n aria-label={ariaLabel}\n />\n )\n },\n)\n"],"names":["TranslatedFields","forwardRef","children","localesProp","namespaceProp","value","defaultValue","onChange","showFlags","icon","variant","size","ariaLabel","className","style","ref","configLocales","useLocales","locales","configNamespace","useTranslationsNamespace","namespace","form","useFormContext","isControlled","internal","setInternal","useState","active","_a","setActive","next","prefixOf","code","buildTranslationName","localeHasError","key","rootRef","useRef","setRootRef","node","lastSubmit","pendingFocus","useEffect","count","errorKeys","isTranslationKey","k","l","firstBad","root","target","el","items","loc","flagFor","jsx","Flag","styles","field","Tabs"],"mappings":";;;;;;;;;;GAsEaA,KAAmBC;AAAA,EAC9B,SACE;AAAA,IACE,UAAAC;AAAA,IACA,SAASC;AAAA,IACT,WAAWC;AAAA,IACX,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,MAAAC,IAAO;AAAA,IACP,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC,IAAY;AAAA,IAC1B,WAAAC;AAAA,IACA,OAAAC;AAAA,EAAA,GAEFC,GACA;;AACA,UAAMC,IAAgBC,EAAA,GAChBC,IAAUf,KAAea,GAEzBG,IAAkBC,EAAA,GAClBC,IAAYjB,KAAiBe,GAC7BG,IAAOC,EAAA,GAGPC,IAAenB,MAAU,QACzB,CAACoB,GAAUC,CAAW,IAAIC,EAA6BrB,CAAY,GACnEsB,KAAUJ,IAAenB,IAAQoB,QAAaI,IAAAX,EAAQ,CAAC,MAAT,gBAAAW,EAAY,SAAQ,IAClEC,IAAY,CAACC,MAAiB;AAClC,MAAKP,KAAcE,EAAYK,CAAI,GACnCxB,KAAA,QAAAA,EAAWwB;AAAA,IACb,GAGMC,IAAW,CAACC,MAAiBC,EAAqBD,GAAM,IAAIZ,CAAS,GAErEc,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AA;AAAA,EAGlB;AACF;"}
1
+ {"version":3,"file":"TranslatedFields-B0LMXgiu.js","sources":["../src/components/TranslatedFields/TranslatedFields.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState, type CSSProperties, type ReactNode } from 'react'\nimport { useFormContext } from '../../form/formContext'\nimport { useLocales, useTranslationsNamespace, type LocaleConfig } from '../../theme'\nimport { buildTranslationName } from '../../helpers/translations'\nimport { flagFor } from '../../i18n/messages'\nimport type { IconName } from '../../icons/names'\nimport { Flag } from '../Flag'\nimport { Tabs, type TabsSize, type TabsVariant } from '../Tabs'\nimport styles from './TranslatedFields.module.css'\n\n/** Builds a field's namespaced form name for the active locale (`(field) => name`). */\nexport type TranslatedFieldName = (field: string) => string\n\nexport interface TranslatedFieldsProps {\n /**\n * Render the fields for one locale. `name(field)` returns the namespaced form name to put on each\n * control (e.g. `translations[en-US].title`); `locale` is the active code. The same render runs per\n * locale, so the fields are identical bar their names.\n */\n children: (name: TranslatedFieldName, locale: string) => ReactNode\n /**\n * Locales (one tab each). Defaults to the app's configured locales\n * (`<ConfigProvider config={{ locales }}>`).\n */\n locales?: LocaleConfig[]\n /**\n * Top-level namespace for the field names (`<namespace>[<locale>].<field>`) and the nested object.\n * Falls back to `<ConfigProvider config={{ keys: { translationsNamespace } }}>`, then `'translations'`.\n * Pass to override per-instance (e.g. `'languages'`).\n */\n namespace?: string\n /** Controlled active locale code. */\n value?: string\n /** Initial active locale code (uncontrolled). Defaults to the first locale. */\n defaultValue?: string\n /** Fires with the next active locale code. */\n onChange?: (locale: string) => void\n /**\n * Show each locale's **flag** on its tab (matched by the language via `flagFor`). A language with no\n * built-in flag falls back to the `icon`. Defaults to `true`; pass `false` to always use `icon`.\n */\n showFlags?: boolean\n /** Fallback icon shown on a locale tab when its language has no flag (or `showFlags={false}`). Defaults to `'Global'`. */\n icon?: IconName\n /** Tab strip variant. Defaults to `Tabs`' default (`underline`). */\n variant?: TabsVariant\n /** Tab + field density. Defaults to `Tabs`' default (`md`). */\n size?: TabsSize\n /** Accessible label for the tablist. Defaults to `'Translations'`. */\n 'aria-label'?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A tabbed group of **per-locale** form fields — one tab per content locale, each rendering the same\n * fields with locale-namespaced `name`s (`translations[<locale>].<field>` by default), so a `<Form>`\n * submits e.g. `translations[en-US].title` / `translations[ka-GE].title`. You supply the fields once\n * via a render function that receives a `name(field)` builder for the active locale; bring any field\n * component (`TextField`, `MultilineTextField`, a rich-text editor, …). Locales come from\n * `<ConfigProvider config={{ locales }}>` (override with the `locales` prop). The top-level word is the\n * `namespace` (default `'translations'`, e.g. `'languages'`). Each tab shows its language's **flag**\n * (matched via `flagFor`); a language with no built-in flag falls back to the `icon` (a `Global` icon by\n * default), and `showFlags={false}` uses the `icon` for every tab. While inside a `<Form>`, an incomplete\n * locale's tab shows a **dot**, and on submit the strip auto-advances to the first locale with errors\n * and focuses its field. Build the schema / defaults with `buildTranslations`; the form values stay\n * **flat** (`translations[en-US].title` — the `FormData` shape) — convert to/from the **nested** JSON\n * shape (`{ translations: { 'en-US': { title } } }`) with `nestTranslations` / `flattenTranslations`.\n * Requires the `Tabs` component.\n */\nexport const TranslatedFields = forwardRef<HTMLDivElement, TranslatedFieldsProps>(\n function TranslatedFields(\n {\n children,\n locales: localesProp,\n namespace: namespaceProp,\n value,\n defaultValue,\n onChange,\n showFlags = true,\n icon = 'Global',\n variant,\n size,\n 'aria-label': ariaLabel = 'Translations',\n className,\n style,\n },\n ref,\n ) {\n const configLocales = useLocales()\n const locales = localesProp ?? configLocales\n // namespace: the `namespace` prop wins, else the ConfigProvider's (which falls back to the default)\n const configNamespace = useTranslationsNamespace()\n const namespace = namespaceProp ?? configNamespace\n const form = useFormContext()\n\n // active locale — controlled (`value`) or internal; falls back to the first locale\n const isControlled = value !== undefined\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const active = (isControlled ? value : internal) ?? locales[0]?.code ?? ''\n const setActive = (next: string) => {\n if (!isControlled) setInternal(next)\n onChange?.(next)\n }\n\n // the namespaced-name prefix for a locale (e.g. `translations[en-US].`)\n const prefixOf = (code: string) => buildTranslationName(code, '', namespace)\n // a locale's tab is flagged when any of its fields is invalid AND the error is shown (submitted/touched)\n const localeHasError = (code: string): boolean =>\n !!form &&\n Object.keys(form.errors).some(\n (key) => key.startsWith(prefixOf(code)) && (form.isSubmitted || form.touched[key] === true),\n )\n\n // merge the forwarded ref with an internal one (to query the mounted fields for scroll/focus)\n const rootRef = useRef<HTMLDivElement | null>(null)\n const setRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLDivElement | null }).current = node\n }\n\n // on each submit, if the active tab is complete but another locale has the only remaining errors,\n // switch to it and focus its first invalid field (the form's own scroll can't reach an unmounted tab)\n const lastSubmit = useRef(0)\n const pendingFocus = useRef<string | null>(null)\n useEffect(() => {\n const count = form?.submitCount ?? 0\n if (!form || count === lastSubmit.current) return\n lastSubmit.current = count\n const errorKeys = Object.keys(form.errors)\n if (errorKeys.length === 0) return\n const isTranslationKey = (k: string) => locales.some((l) => k.startsWith(prefixOf(l.code)))\n // a non-translation field is still invalid → the form's scroll-to-error handles it (above the tabs)\n if (!errorKeys.every(isTranslationKey)) return\n // active locale already shows its (mounted) errors → nothing to switch to\n if (errorKeys.some((k) => k.startsWith(prefixOf(active)))) return\n const firstBad = locales.find((l) => errorKeys.some((k) => k.startsWith(prefixOf(l.code))))\n if (firstBad && firstBad.code !== active) {\n pendingFocus.current = firstBad.code\n setActive(firstBad.code)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [form?.submitCount])\n\n // once the auto-switched tab has mounted, focus its first invalid field\n useEffect(() => {\n if (pendingFocus.current == null || pendingFocus.current !== active) return\n pendingFocus.current = null\n const root = rootRef.current\n if (!root || !form) return\n const errorKeys = new Set(Object.keys(form.errors))\n const target = Array.from(root.querySelectorAll<HTMLElement>('[name]')).find((el) =>\n errorKeys.has(el.getAttribute('name') ?? ''),\n )\n target?.scrollIntoView?.({ behavior: 'smooth', block: 'center' })\n target?.focus({ preventScroll: true })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [active])\n\n if (locales.length === 0) return null\n\n const items = locales.map((loc) => ({\n value: loc.code,\n label: loc.label ?? loc.code,\n // the locale's flag when it has one (and flags are enabled), else the fallback `icon` (Global)\n icon: showFlags && flagFor(loc.code) ? <Flag code={loc.code} /> : icon,\n // an invalid locale shows the Tabs error dot (a small red dot — no full-tab tint)\n error: localeHasError(loc.code),\n // keyed by locale so switching tabs remounts the fields (no value/state bleed between locales)\n content: (\n <div key={loc.code} className={styles.fields}>\n {children((field) => buildTranslationName(loc.code, field, namespace), loc.code)}\n </div>\n ),\n }))\n\n return (\n <Tabs\n ref={setRootRef}\n className={className}\n style={style}\n items={items}\n value={active}\n onChange={setActive}\n variant={variant}\n size={size}\n // locale tabs are internal UI — never sync them to the page URL\n queryKey={null}\n aria-label={ariaLabel}\n />\n )\n },\n)\n"],"names":["TranslatedFields","forwardRef","children","localesProp","namespaceProp","value","defaultValue","onChange","showFlags","icon","variant","size","ariaLabel","className","style","ref","configLocales","useLocales","locales","configNamespace","useTranslationsNamespace","namespace","form","useFormContext","isControlled","internal","setInternal","useState","active","_a","setActive","next","prefixOf","code","buildTranslationName","localeHasError","key","rootRef","useRef","setRootRef","node","lastSubmit","pendingFocus","useEffect","count","errorKeys","isTranslationKey","k","l","firstBad","root","target","el","items","loc","flagFor","jsx","Flag","styles","field","Tabs"],"mappings":";;;;;;;;;;GAsEaA,KAAmBC;AAAA,EAC9B,SACE;AAAA,IACE,UAAAC;AAAA,IACA,SAASC;AAAA,IACT,WAAWC;AAAA,IACX,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,MAAAC,IAAO;AAAA,IACP,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC,IAAY;AAAA,IAC1B,WAAAC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;AAAA;AAAA,MAElE,OAAO0B,EAAemB,EAAI,IAAI;AAAA;AAAA,MAE9B,SACE,gBAAAE,EAAC,OAAA,EAAmB,WAAWE,EAAO,QACnC,YAAS,CAACC,MAAUzB,EAAqBoB,EAAI,MAAMK,GAAOtC,CAAS,GAAGiC,EAAI,IAAI,KADvEA,EAAI,IAEd;AAAA,IAAA,EAEF;AAEF,WACE,gBAAAE;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,KAAKrB;AAAA,QACL,WAAA1B;AAAA,QACA,OAAAC;AAAA,QACA,OAAAuC;AAAA,QACA,OAAOzB;AAAA,QACP,UAAUE;AAAA,QACV,SAAApB;AAAA,QACA,MAAAC;AAAA,QAEA,UAAU;AAAA,QACV,cAAYC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGlB;AACF;"}
@@ -1,2 +1,2 @@
1
- "use strict";const b=require("react/jsx-runtime"),c=require("react"),P=require("./formContext-bTWrqdEV.cjs"),R=require("./translations-CXEeeUDL.cjs"),V=require("./messages-FiUqCKjJ.cjs"),z=require("./Flag-BpTQAgbD.cjs"),D=require("./Tabs-CMnLXRjA.cjs"),j=require("./ConfigProvider-ByLHqXpv.cjs"),J="_fields_aawaf_4",M={fields:J},Q=c.forwardRef(function({children:x,locales:S,namespace:N,value:y,defaultValue:w,onChange:f,showFlags:A=!0,icon:K="Global",variant:O,size:W,"aria-label":g="Translations",className:k,style:C},l){var F;const E=j.useLocales(),i=S??E,_=j.useTranslationsNamespace(),q=N??_,s=P.useFormContext(),T=y!==void 0,[I,L]=c.useState(w),a=(T?y:I)??((F=i[0])==null?void 0:F.code)??"",p=e=>{T||L(e),f==null||f(e)},u=e=>R.buildTranslationName(e,"",q),B=e=>!!s&&Object.keys(s.errors).some(t=>t.startsWith(u(e))&&(s.isSubmitted||s.touched[t]===!0)),v=c.useRef(null),G=e=>{v.current=e,typeof l=="function"?l(e):l&&(l.current=e)},h=c.useRef(0),d=c.useRef(null);if(c.useEffect(()=>{const e=(s==null?void 0:s.submitCount)??0;if(!s||e===h.current)return;h.current=e;const t=Object.keys(s.errors);if(t.length===0)return;const r=o=>i.some(m=>o.startsWith(u(m.code)));if(!t.every(r)||t.some(o=>o.startsWith(u(a))))return;const n=i.find(o=>t.some(m=>m.startsWith(u(o.code))));n&&n.code!==a&&(d.current=n.code,p(n.code))},[s==null?void 0:s.submitCount]),c.useEffect(()=>{var n;if(d.current==null||d.current!==a)return;d.current=null;const e=v.current;if(!e||!s)return;const t=new Set(Object.keys(s.errors)),r=Array.from(e.querySelectorAll("[name]")).find(o=>t.has(o.getAttribute("name")??""));(n=r==null?void 0:r.scrollIntoView)==null||n.call(r,{behavior:"smooth",block:"center"}),r==null||r.focus({preventScroll:!0})},[a]),i.length===0)return null;const H=i.map(e=>({value:e.code,label:e.label??e.code,icon:A&&V.flagFor(e.code)?b.jsx(z.Flag,{code:e.code}):K,error:B(e.code),content:b.jsx("div",{className:M.fields,children:x(t=>R.buildTranslationName(e.code,t,q),e.code)},e.code)}));return b.jsx(D.Tabs,{ref:G,className:k,style:C,items:H,value:a,onChange:p,variant:O,size:W,queryKey:null,"aria-label":g})});exports.TranslatedFields=Q;
2
- //# sourceMappingURL=TranslatedFields-CbTlgKnh.cjs.map
1
+ "use strict";const b=require("react/jsx-runtime"),c=require("react"),P=require("./formContext-bTWrqdEV.cjs"),R=require("./translations-CXEeeUDL.cjs"),V=require("./messages-DS38X5W2.cjs"),z=require("./Flag-DXPQ2t8z.cjs"),D=require("./Tabs-651xbRe4.cjs"),j=require("./ConfigProvider-CtpfSy1i.cjs"),J="_fields_aawaf_4",M={fields:J},Q=c.forwardRef(function({children:x,locales:S,namespace:N,value:y,defaultValue:w,onChange:f,showFlags:A=!0,icon:K="Global",variant:O,size:W,"aria-label":g="Translations",className:k,style:C},l){var F;const E=j.useLocales(),i=S??E,_=j.useTranslationsNamespace(),q=N??_,s=P.useFormContext(),T=y!==void 0,[I,L]=c.useState(w),a=(T?y:I)??((F=i[0])==null?void 0:F.code)??"",p=e=>{T||L(e),f==null||f(e)},u=e=>R.buildTranslationName(e,"",q),B=e=>!!s&&Object.keys(s.errors).some(t=>t.startsWith(u(e))&&(s.isSubmitted||s.touched[t]===!0)),v=c.useRef(null),G=e=>{v.current=e,typeof l=="function"?l(e):l&&(l.current=e)},h=c.useRef(0),d=c.useRef(null);if(c.useEffect(()=>{const e=(s==null?void 0:s.submitCount)??0;if(!s||e===h.current)return;h.current=e;const t=Object.keys(s.errors);if(t.length===0)return;const r=o=>i.some(m=>o.startsWith(u(m.code)));if(!t.every(r)||t.some(o=>o.startsWith(u(a))))return;const n=i.find(o=>t.some(m=>m.startsWith(u(o.code))));n&&n.code!==a&&(d.current=n.code,p(n.code))},[s==null?void 0:s.submitCount]),c.useEffect(()=>{var n;if(d.current==null||d.current!==a)return;d.current=null;const e=v.current;if(!e||!s)return;const t=new Set(Object.keys(s.errors)),r=Array.from(e.querySelectorAll("[name]")).find(o=>t.has(o.getAttribute("name")??""));(n=r==null?void 0:r.scrollIntoView)==null||n.call(r,{behavior:"smooth",block:"center"}),r==null||r.focus({preventScroll:!0})},[a]),i.length===0)return null;const H=i.map(e=>({value:e.code,label:e.label??e.code,icon:A&&V.flagFor(e.code)?b.jsx(z.Flag,{code:e.code}):K,error:B(e.code),content:b.jsx("div",{className:M.fields,children:x(t=>R.buildTranslationName(e.code,t,q),e.code)},e.code)}));return b.jsx(D.Tabs,{ref:G,className:k,style:C,items:H,value:a,onChange:p,variant:O,size:W,queryKey:null,"aria-label":g})});exports.TranslatedFields=Q;
2
+ //# sourceMappingURL=TranslatedFields-sio1Qfy7.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TranslatedFields-CbTlgKnh.cjs","sources":["../src/components/TranslatedFields/TranslatedFields.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState, type CSSProperties, type ReactNode } from 'react'\nimport { useFormContext } from '../../form/formContext'\nimport { useLocales, useTranslationsNamespace, type LocaleConfig } from '../../theme'\nimport { buildTranslationName } from '../../helpers/translations'\nimport { flagFor } from '../../i18n/messages'\nimport type { IconName } from '../../icons/names'\nimport { Flag } from '../Flag'\nimport { Tabs, type TabsSize, type TabsVariant } from '../Tabs'\nimport styles from './TranslatedFields.module.css'\n\n/** Builds a field's namespaced form name for the active locale (`(field) => name`). */\nexport type TranslatedFieldName = (field: string) => string\n\nexport interface TranslatedFieldsProps {\n /**\n * Render the fields for one locale. `name(field)` returns the namespaced form name to put on each\n * control (e.g. `translations[en-US].title`); `locale` is the active code. The same render runs per\n * locale, so the fields are identical bar their names.\n */\n children: (name: TranslatedFieldName, locale: string) => ReactNode\n /**\n * Locales (one tab each). Defaults to the app's configured locales\n * (`<ConfigProvider config={{ locales }}>`).\n */\n locales?: LocaleConfig[]\n /**\n * Top-level namespace for the field names (`<namespace>[<locale>].<field>`) and the nested object.\n * Falls back to `<ConfigProvider config={{ keys: { translationsNamespace } }}>`, then `'translations'`.\n * Pass to override per-instance (e.g. `'languages'`).\n */\n namespace?: string\n /** Controlled active locale code. */\n value?: string\n /** Initial active locale code (uncontrolled). Defaults to the first locale. */\n defaultValue?: string\n /** Fires with the next active locale code. */\n onChange?: (locale: string) => void\n /**\n * Show each locale's **flag** on its tab (matched by the language via `flagFor`). A language with no\n * built-in flag falls back to the `icon`. Defaults to `true`; pass `false` to always use `icon`.\n */\n showFlags?: boolean\n /** Fallback icon shown on a locale tab when its language has no flag (or `showFlags={false}`). Defaults to `'Global'`. */\n icon?: IconName\n /** Tab strip variant. Defaults to `Tabs`' default (`underline`). */\n variant?: TabsVariant\n /** Tab + field density. Defaults to `Tabs`' default (`md`). */\n size?: TabsSize\n /** Accessible label for the tablist. Defaults to `'Translations'`. */\n 'aria-label'?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A tabbed group of **per-locale** form fields — one tab per content locale, each rendering the same\n * fields with locale-namespaced `name`s (`translations[<locale>].<field>` by default), so a `<Form>`\n * submits e.g. `translations[en-US].title` / `translations[ka-GE].title`. You supply the fields once\n * via a render function that receives a `name(field)` builder for the active locale; bring any field\n * component (`TextField`, `MultilineTextField`, a rich-text editor, …). Locales come from\n * `<ConfigProvider config={{ locales }}>` (override with the `locales` prop). The top-level word is the\n * `namespace` (default `'translations'`, e.g. `'languages'`). Each tab shows its language's **flag**\n * (matched via `flagFor`); a language with no built-in flag falls back to the `icon` (a `Global` icon by\n * default), and `showFlags={false}` uses the `icon` for every tab. While inside a `<Form>`, an incomplete\n * locale's tab shows a **dot**, and on submit the strip auto-advances to the first locale with errors\n * and focuses its field. Build the schema / defaults with `buildTranslations`; the form values stay\n * **flat** (`translations[en-US].title` — the `FormData` shape) — convert to/from the **nested** JSON\n * shape (`{ translations: { 'en-US': { title } } }`) with `nestTranslations` / `flattenTranslations`.\n * Requires the `Tabs` component.\n */\nexport const TranslatedFields = forwardRef<HTMLDivElement, TranslatedFieldsProps>(\n function TranslatedFields(\n {\n children,\n locales: localesProp,\n namespace: namespaceProp,\n value,\n defaultValue,\n onChange,\n showFlags = true,\n icon = 'Global',\n variant,\n size,\n 'aria-label': ariaLabel = 'Translations',\n className,\n style,\n },\n ref,\n ) {\n const configLocales = useLocales()\n const locales = localesProp ?? configLocales\n // namespace: the `namespace` prop wins, else the ConfigProvider's (which falls back to the default)\n const configNamespace = useTranslationsNamespace()\n const namespace = namespaceProp ?? configNamespace\n const form = useFormContext()\n\n // active locale — controlled (`value`) or internal; falls back to the first locale\n const isControlled = value !== undefined\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const active = (isControlled ? value : internal) ?? locales[0]?.code ?? ''\n const setActive = (next: string) => {\n if (!isControlled) setInternal(next)\n onChange?.(next)\n }\n\n // the namespaced-name prefix for a locale (e.g. `translations[en-US].`)\n const prefixOf = (code: string) => buildTranslationName(code, '', namespace)\n // a locale's tab is flagged when any of its fields is invalid AND the error is shown (submitted/touched)\n const localeHasError = (code: string): boolean =>\n !!form &&\n Object.keys(form.errors).some(\n (key) => key.startsWith(prefixOf(code)) && (form.isSubmitted || form.touched[key] === true),\n )\n\n // merge the forwarded ref with an internal one (to query the mounted fields for scroll/focus)\n const rootRef = useRef<HTMLDivElement | null>(null)\n const setRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLDivElement | null }).current = node\n }\n\n // on each submit, if the active tab is complete but another locale has the only remaining errors,\n // switch to it and focus its first invalid field (the form's own scroll can't reach an unmounted tab)\n const lastSubmit = useRef(0)\n const pendingFocus = useRef<string | null>(null)\n useEffect(() => {\n const count = form?.submitCount ?? 0\n if (!form || count === lastSubmit.current) return\n lastSubmit.current = count\n const errorKeys = Object.keys(form.errors)\n if (errorKeys.length === 0) return\n const isTranslationKey = (k: string) => locales.some((l) => k.startsWith(prefixOf(l.code)))\n // a non-translation field is still invalid → the form's scroll-to-error handles it (above the tabs)\n if (!errorKeys.every(isTranslationKey)) return\n // active locale already shows its (mounted) errors → nothing to switch to\n if (errorKeys.some((k) => k.startsWith(prefixOf(active)))) return\n const firstBad = locales.find((l) => errorKeys.some((k) => k.startsWith(prefixOf(l.code))))\n if (firstBad && firstBad.code !== active) {\n pendingFocus.current = firstBad.code\n setActive(firstBad.code)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [form?.submitCount])\n\n // once the auto-switched tab has mounted, focus its first invalid field\n useEffect(() => {\n if (pendingFocus.current == null || pendingFocus.current !== active) return\n pendingFocus.current = null\n const root = rootRef.current\n if (!root || !form) return\n const errorKeys = new Set(Object.keys(form.errors))\n const target = Array.from(root.querySelectorAll<HTMLElement>('[name]')).find((el) =>\n errorKeys.has(el.getAttribute('name') ?? ''),\n )\n target?.scrollIntoView?.({ behavior: 'smooth', block: 'center' })\n target?.focus({ preventScroll: true })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [active])\n\n if (locales.length === 0) return null\n\n const items = locales.map((loc) => ({\n value: loc.code,\n label: loc.label ?? loc.code,\n // the locale's flag when it has one (and flags are enabled), else the fallback `icon` (Global)\n icon: showFlags && flagFor(loc.code) ? <Flag code={loc.code} /> : icon,\n // an invalid locale shows the Tabs error dot (a small red dot — no full-tab tint)\n error: localeHasError(loc.code),\n // keyed by locale so switching tabs remounts the fields (no value/state bleed between locales)\n content: (\n <div key={loc.code} className={styles.fields}>\n {children((field) => buildTranslationName(loc.code, field, namespace), loc.code)}\n </div>\n ),\n }))\n\n return (\n <Tabs\n ref={setRootRef}\n className={className}\n style={style}\n items={items}\n value={active}\n onChange={setActive}\n variant={variant}\n size={size}\n // locale tabs are internal UI — never sync them to the page URL\n queryKey={null}\n aria-label={ariaLabel}\n />\n )\n },\n)\n"],"names":["TranslatedFields","forwardRef","children","localesProp","namespaceProp","value","defaultValue","onChange","showFlags","icon","variant","size","ariaLabel","className","style","ref","configLocales","useLocales","locales","configNamespace","useTranslationsNamespace","namespace","form","useFormContext","isControlled","internal","setInternal","useState","active","_a","setActive","next","prefixOf","code","buildTranslationName","localeHasError","key","rootRef","useRef","setRootRef","node","lastSubmit","pendingFocus","useEffect","count","errorKeys","isTranslationKey","k","l","firstBad","root","target","el","items","loc","flagFor","jsx","Flag","styles","field","Tabs"],"mappings":"yUAsEaA,EAAmBC,EAAAA,WAC9B,SACE,CACE,SAAAC,EACA,QAASC,EACT,UAAWC,EACX,MAAAC,EACA,aAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,GACZ,KAAAC,EAAO,SACP,QAAAC,EACA,KAAAC,EACA,aAAcC,EAAY,eAC1B,UAAAC,EACA,MAAAC,CAAA,EAEFC,EACA,OACA,MAAMC,EAAgBC,EAAAA,WAAA,EAChBC,EAAUf,GAAea,EAEzBG,EAAkBC,EAAAA,yBAAA,EAClBC,EAAYjB,GAAiBe,EAC7BG,EAAOC,EAAAA,eAAA,EAGPC,EAAenB,IAAU,OACzB,CAACoB,EAAUC,CAAW,EAAIC,EAAAA,SAA6BrB,CAAY,EACnEsB,GAAUJ,EAAenB,EAAQoB,MAAaI,EAAAX,EAAQ,CAAC,IAAT,YAAAW,EAAY,OAA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.cjs","sources":["../src/components/TranslatedFields/TranslatedFields.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState, type CSSProperties, type ReactNode } from 'react'\nimport { useFormContext } from '../../form/formContext'\nimport { useLocales, useTranslationsNamespace, type LocaleConfig } from '../../theme'\nimport { buildTranslationName } from '../../helpers/translations'\nimport { flagFor } from '../../i18n/messages'\nimport type { IconName } from '../../icons/names'\nimport { Flag } from '../Flag'\nimport { Tabs, type TabsSize, type TabsVariant } from '../Tabs'\nimport styles from './TranslatedFields.module.css'\n\n/** Builds a field's namespaced form name for the active locale (`(field) => name`). */\nexport type TranslatedFieldName = (field: string) => string\n\nexport interface TranslatedFieldsProps {\n /**\n * Render the fields for one locale. `name(field)` returns the namespaced form name to put on each\n * control (e.g. `translations[en-US].title`); `locale` is the active code. The same render runs per\n * locale, so the fields are identical bar their names.\n */\n children: (name: TranslatedFieldName, locale: string) => ReactNode\n /**\n * Locales (one tab each). Defaults to the app's configured locales\n * (`<ConfigProvider config={{ locales }}>`).\n */\n locales?: LocaleConfig[]\n /**\n * Top-level namespace for the field names (`<namespace>[<locale>].<field>`) and the nested object.\n * Falls back to `<ConfigProvider config={{ keys: { translationsNamespace } }}>`, then `'translations'`.\n * Pass to override per-instance (e.g. `'languages'`).\n */\n namespace?: string\n /** Controlled active locale code. */\n value?: string\n /** Initial active locale code (uncontrolled). Defaults to the first locale. */\n defaultValue?: string\n /** Fires with the next active locale code. */\n onChange?: (locale: string) => void\n /**\n * Show each locale's **flag** on its tab (matched by the language via `flagFor`). A language with no\n * built-in flag falls back to the `icon`. Defaults to `true`; pass `false` to always use `icon`.\n */\n showFlags?: boolean\n /** Fallback icon shown on a locale tab when its language has no flag (or `showFlags={false}`). Defaults to `'Global'`. */\n icon?: IconName\n /** Tab strip variant. Defaults to `Tabs`' default (`underline`). */\n variant?: TabsVariant\n /** Tab + field density. Defaults to `Tabs`' default (`md`). */\n size?: TabsSize\n /** Accessible label for the tablist. Defaults to `'Translations'`. */\n 'aria-label'?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A tabbed group of **per-locale** form fields — one tab per content locale, each rendering the same\n * fields with locale-namespaced `name`s (`translations[<locale>].<field>` by default), so a `<Form>`\n * submits e.g. `translations[en-US].title` / `translations[ka-GE].title`. You supply the fields once\n * via a render function that receives a `name(field)` builder for the active locale; bring any field\n * component (`TextField`, `MultilineTextField`, a rich-text editor, …). Locales come from\n * `<ConfigProvider config={{ locales }}>` (override with the `locales` prop). The top-level word is the\n * `namespace` (default `'translations'`, e.g. `'languages'`). Each tab shows its language's **flag**\n * (matched via `flagFor`); a language with no built-in flag falls back to the `icon` (a `Global` icon by\n * default), and `showFlags={false}` uses the `icon` for every tab. While inside a `<Form>`, an incomplete\n * locale's tab shows a **dot**, and on submit the strip auto-advances to the first locale with errors\n * and focuses its field. Build the schema / defaults with `buildTranslations`; the form values stay\n * **flat** (`translations[en-US].title` — the `FormData` shape) — convert to/from the **nested** JSON\n * shape (`{ translations: { 'en-US': { title } } }`) with `nestTranslations` / `flattenTranslations`.\n * Requires the `Tabs` component.\n */\nexport const TranslatedFields = forwardRef<HTMLDivElement, TranslatedFieldsProps>(\n function TranslatedFields(\n {\n children,\n locales: localesProp,\n namespace: namespaceProp,\n value,\n defaultValue,\n onChange,\n showFlags = true,\n icon = 'Global',\n variant,\n size,\n 'aria-label': ariaLabel = 'Translations',\n className,\n style,\n },\n ref,\n ) {\n const configLocales = useLocales()\n const locales = localesProp ?? configLocales\n // namespace: the `namespace` prop wins, else the ConfigProvider's (which falls back to the default)\n const configNamespace = useTranslationsNamespace()\n const namespace = namespaceProp ?? configNamespace\n const form = useFormContext()\n\n // active locale — controlled (`value`) or internal; falls back to the first locale\n const isControlled = value !== undefined\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const active = (isControlled ? value : internal) ?? locales[0]?.code ?? ''\n const setActive = (next: string) => {\n if (!isControlled) setInternal(next)\n onChange?.(next)\n }\n\n // the namespaced-name prefix for a locale (e.g. `translations[en-US].`)\n const prefixOf = (code: string) => buildTranslationName(code, '', namespace)\n // a locale's tab is flagged when any of its fields is invalid AND the error is shown (submitted/touched)\n const localeHasError = (code: string): boolean =>\n !!form &&\n Object.keys(form.errors).some(\n (key) => key.startsWith(prefixOf(code)) && (form.isSubmitted || form.touched[key] === true),\n )\n\n // merge the forwarded ref with an internal one (to query the mounted fields for scroll/focus)\n const rootRef = useRef<HTMLDivElement | null>(null)\n const setRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLDivElement | null }).current = node\n }\n\n // on each submit, if the active tab is complete but another locale has the only remaining errors,\n // switch to it and focus its first invalid field (the form's own scroll can't reach an unmounted tab)\n const lastSubmit = useRef(0)\n const pendingFocus = useRef<string | null>(null)\n useEffect(() => {\n const count = form?.submitCount ?? 0\n if (!form || count === lastSubmit.current) return\n lastSubmit.current = count\n const errorKeys = Object.keys(form.errors)\n if (errorKeys.length === 0) return\n const isTranslationKey = (k: string) => locales.some((l) => k.startsWith(prefixOf(l.code)))\n // a non-translation field is still invalid → the form's scroll-to-error handles it (above the tabs)\n if (!errorKeys.every(isTranslationKey)) return\n // active locale already shows its (mounted) errors → nothing to switch to\n if (errorKeys.some((k) => k.startsWith(prefixOf(active)))) return\n const firstBad = locales.find((l) => errorKeys.some((k) => k.startsWith(prefixOf(l.code))))\n if (firstBad && firstBad.code !== active) {\n pendingFocus.current = firstBad.code\n setActive(firstBad.code)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [form?.submitCount])\n\n // once the auto-switched tab has mounted, focus its first invalid field\n useEffect(() => {\n if (pendingFocus.current == null || pendingFocus.current !== active) return\n pendingFocus.current = null\n const root = rootRef.current\n if (!root || !form) return\n const errorKeys = new Set(Object.keys(form.errors))\n const target = Array.from(root.querySelectorAll<HTMLElement>('[name]')).find((el) =>\n errorKeys.has(el.getAttribute('name') ?? ''),\n )\n target?.scrollIntoView?.({ behavior: 'smooth', block: 'center' })\n target?.focus({ preventScroll: true })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [active])\n\n if (locales.length === 0) return null\n\n const items = locales.map((loc) => ({\n value: loc.code,\n label: loc.label ?? loc.code,\n // the locale's flag when it has one (and flags are enabled), else the fallback `icon` (Global)\n icon: showFlags && flagFor(loc.code) ? <Flag code={loc.code} /> : icon,\n // an invalid locale shows the Tabs error dot (a small red dot — no full-tab tint)\n error: localeHasError(loc.code),\n // keyed by locale so switching tabs remounts the fields (no value/state bleed between locales)\n content: (\n <div key={loc.code} className={styles.fields}>\n {children((field) => buildTranslationName(loc.code, field, namespace), loc.code)}\n </div>\n ),\n }))\n\n return (\n <Tabs\n ref={setRootRef}\n className={className}\n style={style}\n items={items}\n value={active}\n onChange={setActive}\n variant={variant}\n size={size}\n // locale tabs are internal UI — never sync them to the page URL\n queryKey={null}\n aria-label={ariaLabel}\n />\n )\n },\n)\n"],"names":["TranslatedFields","forwardRef","children","localesProp","namespaceProp","value","defaultValue","onChange","showFlags","icon","variant","size","ariaLabel","className","style","ref","configLocales","useLocales","locales","configNamespace","useTranslationsNamespace","namespace","form","useFormContext","isControlled","internal","setInternal","useState","active","_a","setActive","next","prefixOf","code","buildTranslationName","localeHasError","key","rootRef","useRef","setRootRef","node","lastSubmit","pendingFocus","useEffect","count","errorKeys","isTranslationKey","k","l","firstBad","root","target","el","items","loc","flagFor","jsx","Flag","styles","field","Tabs"],"mappings":"yUAsEaA,EAAmBC,EAAAA,WAC9B,SACE,CACE,SAAAC,EACA,QAASC,EACT,UAAWC,EACX,MAAAC,EACA,aAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,GACZ,KAAAC,EAAO,SACP,QAAAC,EACA,KAAAC,EACA,aAAcC,EAAY,eAC1B,UAAAC,EACA,MAAAC,CAAA,EAEFC,EACA,OACA,MAAMC,EAAgBC,EAAAA,WAAA,EAChBC,EAAUf,GAAea,EAEzBG,EAAkBC,EAAAA,yBAAA,EAClBC,EAAYjB,GAAiBe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A,CACC,IAAKrB,EACL,UAAA1B,EACA,MAAAC,EACA,MAAAuC,EACA,MAAOzB,EACP,SAAUE,EACV,QAAApB,EACA,KAAAC,EAEA,SAAU,KACV,aAAYC,CAAA,CAAA,CAGlB,CACF"}
@@ -1,12 +1,12 @@
1
1
  import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
2
  import { forwardRef as S } from "react";
3
3
  import { clsx as g } from "clsx";
4
- import { A as w } from "./Avatar-DXNPg23a.js";
5
- import { B as U } from "./Button-CWMNNiia.js";
6
- import { I as b } from "./Icon-DaTvzLBu.js";
4
+ import { A as w } from "./Avatar-MwWIcj8z.js";
5
+ import { B as U } from "./Button-9Qcdkw-y.js";
6
+ import { I as b } from "./Icon-CGQ5yGSZ.js";
7
7
  import { S as m } from "./Skeleton-_-uGax2j.js";
8
8
  import { T as d } from "./Typography-CJv5AnRP.js";
9
- import { a as I } from "./ConfigProvider-BbsI15b-.js";
9
+ import { a as I } from "./ConfigProvider-Ct0Pe3Ku.js";
10
10
  const N = "_card_1fykc_3", T = "_identity_1fykc_16", j = "_text_1fykc_20", A = "_sm_1fykc_33", B = "_lg_1fykc_37", o = {
11
11
  card: N,
12
12
  identity: T,
@@ -75,4 +75,4 @@ const N = "_card_1fykc_3", T = "_identity_1fykc_16", j = "_text_1fykc_20", A = "
75
75
  export {
76
76
  J as U
77
77
  };
78
- //# sourceMappingURL=UserCard-Bs8kuV2j.js.map
78
+ //# sourceMappingURL=UserCard-B5FVcJaK.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserCard-Bs8kuV2j.js","sources":["../src/components/UserCard/UserCard.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport type { IconName } from '../../icons/names'\nimport { Avatar } from '../Avatar'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Skeleton } from '../Skeleton'\nimport { Typography } from '../Typography'\nimport styles from './UserCard.module.css'\n\nexport type UserCardSize = 'sm' | 'md' | 'lg'\n\nexport interface UserCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /**\n * Display name — the primary line, and the source of the avatar initials. When omitted, the primary\n * line falls back to a localized **\"Welcome\"** greeting (and the avatar shows the `icon`).\n */\n name?: string\n /** Secondary line under the name (usually the email). */\n email?: ReactNode\n /** Avatar image URL (falls back to the initials from `name`, else the `icon`). */\n avatar?: string\n /** Fallback avatar icon when there's no image or name. Defaults to `'User'`. */\n icon?: IconName\n /** Theme palette token tinting the avatar. Defaults to `'primary'`. */\n color?: ThemeColor\n /** Preset size (avatar + fonts + button). Defaults to `'md'`. */\n size?: UserCardSize\n /** When provided, a **Sign out** button is shown that calls this. */\n onLogout?: () => void\n /** Sign-out button label. Defaults to `'Sign out'`. */\n logoutLabel?: ReactNode\n /** Extra content between the identity row and the sign-out button (e.g. a link or menu). */\n children?: ReactNode\n /** Show skeletons for the avatar, name and email while the user is being fetched (sign-out stays usable). Defaults to `false`. */\n loading?: boolean\n}\n\n/**\n * A compact account card — an `Avatar` + name/email and an optional **Sign out** button. Drop it into\n * the `RootLayout` `sidebarFooter` (or anywhere) for a consistent signed-in-user block across apps,\n * instead of hand-rolling the markup each time. Shows the image (`avatar`) → initials (from `name`) →\n * `icon` (default `User`) in priority order; renders the sign-out `Button` (filled `error`) only when\n * `onLogout` is given. `size` (`sm`/`md`/`lg`) scales the avatar + type; `color` (default `primary`)\n * tints the avatar. `loading` swaps the avatar + name + email for skeletons. Own CSS module (token-only).\n */\nexport const UserCard = forwardRef<HTMLDivElement, UserCardProps>(function UserCard(\n {\n name,\n email,\n avatar,\n icon = 'User',\n color = 'primary',\n size = 'md',\n onLogout,\n logoutLabel,\n children,\n loading = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n // the identity row + the sign-out button share the same visual size step\n const avatarSize = size === 'lg' ? 'lg' : size === 'sm' ? 'sm' : 'md'\n const buttonSize = size === 'lg' ? 'md' : 'sm'\n\n return (\n <div\n ref={ref}\n className={clsx(styles.card, styles[size], className)}\n style={style as CSSProperties}\n aria-busy={loading || undefined}\n {...props}\n >\n <div className={styles.identity}>\n {/* Avatar priority is image → icon → initials, so pass `icon` only as the last resort (no\n name), otherwise a name would still show the icon instead of its initials */}\n <Avatar\n size={avatarSize}\n name={name}\n src={avatar}\n icon={name ? undefined : icon}\n color={color}\n loading={loading}\n />\n <div className={styles.text}>\n {/* primary line: the name, or a \"Welcome\" greeting fallback when no name is given */}\n <Typography variant=\"bodySmall\" truncate>\n {loading ? <Skeleton width=\"60%\" /> : (name ?? t('userCard.welcome'))}\n </Typography>\n {(loading || email != null) && (\n <Typography variant=\"caption\" color=\"muted\" truncate>\n {loading ? <Skeleton width=\"85%\" /> : email}\n </Typography>\n )}\n </div>\n </div>\n\n {children}\n\n {onLogout ? (\n <Button\n variant=\"filled\"\n color=\"error\"\n size={buttonSize}\n fullWidth\n startIcon={<Icon name=\"Logout2\" />}\n onClick={onLogout}\n >\n {logoutLabel ?? t('userCard.signOut')}\n </Button>\n ) : null}\n </div>\n )\n})\n"],"names":["UserCard","forwardRef","name","email","avatar","icon","color","size","onLogout","logoutLabel","children","loading","className","style","props","ref","t","useT","avatarSize","buttonSize","jsxs","clsx","styles","jsx","Avatar","Typography","Skeleton","Button","Icon"],"mappings":";;;;;;;;;;;;;;;GA+CaA,IAAWC,EAA0C,SAChE;AAAA,EACE,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GAEJC,IAAaX,MAAS,OAAO,OAAOA,MAAS,OAAO,OA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AAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
1
+ {"version":3,"file":"UserCard-B5FVcJaK.js","sources":["../src/components/UserCard/UserCard.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport type { IconName } from '../../icons/names'\nimport { Avatar } from '../Avatar'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Skeleton } from '../Skeleton'\nimport { Typography } from '../Typography'\nimport styles from './UserCard.module.css'\n\nexport type UserCardSize = 'sm' | 'md' | 'lg'\n\nexport interface UserCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /**\n * Display name — the primary line, and the source of the avatar initials. When omitted, the primary\n * line falls back to a localized **\"Welcome\"** greeting (and the avatar shows the `icon`).\n */\n name?: string\n /** Secondary line under the name (usually the email). */\n email?: ReactNode\n /** Avatar image URL (falls back to the initials from `name`, else the `icon`). */\n avatar?: string\n /** Fallback avatar icon when there's no image or name. Defaults to `'User'`. */\n icon?: IconName\n /** Theme palette token tinting the avatar. Defaults to `'primary'`. */\n color?: ThemeColor\n /** Preset size (avatar + fonts + button). Defaults to `'md'`. */\n size?: UserCardSize\n /** When provided, a **Sign out** button is shown that calls this. */\n onLogout?: () => void\n /** Sign-out button label. Defaults to `'Sign out'`. */\n logoutLabel?: ReactNode\n /** Extra content between the identity row and the sign-out button (e.g. a link or menu). */\n children?: ReactNode\n /** Show skeletons for the avatar, name and email while the user is being fetched (sign-out stays usable). Defaults to `false`. */\n loading?: boolean\n}\n\n/**\n * A compact account card — an `Avatar` + name/email and an optional **Sign out** button. Drop it into\n * the `RootLayout` `sidebarFooter` (or anywhere) for a consistent signed-in-user block across apps,\n * instead of hand-rolling the markup each time. Shows the image (`avatar`) → initials (from `name`) →\n * `icon` (default `User`) in priority order; renders the sign-out `Button` (filled `error`) only when\n * `onLogout` is given. `size` (`sm`/`md`/`lg`) scales the avatar + type; `color` (default `primary`)\n * tints the avatar. `loading` swaps the avatar + name + email for skeletons. Own CSS module (token-only).\n */\nexport const UserCard = forwardRef<HTMLDivElement, UserCardProps>(function UserCard(\n {\n name,\n email,\n avatar,\n icon = 'User',\n color = 'primary',\n size = 'md',\n onLogout,\n logoutLabel,\n children,\n loading = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n // the identity row + the sign-out button share the same visual size step\n const avatarSize = size === 'lg' ? 'lg' : size === 'sm' ? 'sm' : 'md'\n const buttonSize = size === 'lg' ? 'md' : 'sm'\n\n return (\n <div\n ref={ref}\n className={clsx(styles.card, styles[size], className)}\n style={style as CSSProperties}\n aria-busy={loading || undefined}\n {...props}\n >\n <div className={styles.identity}>\n {/* Avatar priority is image → icon → initials, so pass `icon` only as the last resort (no\n name), otherwise a name would still show the icon instead of its initials */}\n <Avatar\n size={avatarSize}\n name={name}\n src={avatar}\n icon={name ? undefined : icon}\n color={color}\n loading={loading}\n />\n <div className={styles.text}>\n {/* primary line: the name, or a \"Welcome\" greeting fallback when no name is given */}\n <Typography variant=\"bodySmall\" truncate>\n {loading ? <Skeleton width=\"60%\" /> : (name ?? t('userCard.welcome'))}\n </Typography>\n {(loading || email != null) && (\n <Typography variant=\"caption\" color=\"muted\" truncate>\n {loading ? <Skeleton width=\"85%\" /> : email}\n </Typography>\n )}\n </div>\n </div>\n\n {children}\n\n {onLogout ? (\n <Button\n variant=\"filled\"\n color=\"error\"\n size={buttonSize}\n fullWidth\n startIcon={<Icon name=\"Logout2\" />}\n onClick={onLogout}\n >\n {logoutLabel ?? t('userCard.signOut')}\n </Button>\n ) : null}\n </div>\n )\n})\n"],"names":["UserCard","forwardRef","name","email","avatar","icon","color","size","onLogout","logoutLabel","children","loading","className","style","props","ref","t","useT","avatarSize","buttonSize","jsxs","clsx","styles","jsx","Avatar","Typography","Skeleton","Button","Icon"],"mappings":";;;;;;;;;;;;;;;GA+CaA,IAAWC,EAA0C,SAChE;AAAA,EACE,MAAA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UAAA,EAAA,CAEJ;AAAA,QAAA,GACF;AAAA,QAECO;AAAA,QAEAF,IACC,gBAAAe;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,MAAMR;AAAA,YACN,WAAS;AAAA,YACT,WAAW,gBAAAI,EAACK,GAAA,EAAK,MAAK,UAAA,CAAU;AAAA,YAChC,SAASpB;AAAA,YAER,UAAAC,KAAeO,EAAE,kBAAkB;AAAA,UAAA;AAAA,QAAA,IAEpC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const t=require("react/jsx-runtime"),q=require("react"),p=require("clsx"),g=require("./Avatar-DrV_F7Ex.cjs"),C=require("./Button-CusxDmfq.cjs"),S=require("./Icon-BVULqOJD.cjs"),a=require("./Skeleton-DK0lAjS9.cjs"),d=require("./Typography-B6ASPrzT.cjs"),w=require("./ConfigProvider-ByLHqXpv.cjs"),T="_card_1fykc_3",U="_identity_1fykc_16",b="_text_1fykc_20",I="_sm_1fykc_33",N="_lg_1fykc_37",s={card:T,identity:U,text:b,sm:I,lg:N},A=q.forwardRef(function({name:c,email:n,avatar:l,icon:u="User",color:y="primary",size:e="md",onLogout:i,logoutLabel:x,children:m,loading:r=!1,className:_,style:f,...h},v){const o=w.useT(),j=e==="lg"?"lg":e==="sm"?"sm":"md",k=e==="lg"?"md":"sm";return t.jsxs("div",{ref:v,className:p.clsx(s.card,s[e],_),style:f,"aria-busy":r||void 0,...h,children:[t.jsxs("div",{className:s.identity,children:[t.jsx(g.Avatar,{size:j,name:c,src:l,icon:c?void 0:u,color:y,loading:r}),t.jsxs("div",{className:s.text,children:[t.jsx(d.Typography,{variant:"bodySmall",truncate:!0,children:r?t.jsx(a.Skeleton,{width:"60%"}):c??o("userCard.welcome")}),(r||n!=null)&&t.jsx(d.Typography,{variant:"caption",color:"muted",truncate:!0,children:r?t.jsx(a.Skeleton,{width:"85%"}):n})]})]}),m,i?t.jsx(C.Button,{variant:"filled",color:"error",size:k,fullWidth:!0,startIcon:t.jsx(S.Icon,{name:"Logout2"}),onClick:i,children:x??o("userCard.signOut")}):null]})});exports.UserCard=A;
2
- //# sourceMappingURL=UserCard-BfHHfkDr.cjs.map
1
+ "use strict";const t=require("react/jsx-runtime"),q=require("react"),p=require("clsx"),g=require("./Avatar-CQ--wGWS.cjs"),C=require("./Button-BQhiJq8e.cjs"),S=require("./Icon-BUP5_kRs.cjs"),a=require("./Skeleton-DK0lAjS9.cjs"),d=require("./Typography-B6ASPrzT.cjs"),w=require("./ConfigProvider-CtpfSy1i.cjs"),T="_card_1fykc_3",U="_identity_1fykc_16",b="_text_1fykc_20",I="_sm_1fykc_33",N="_lg_1fykc_37",s={card:T,identity:U,text:b,sm:I,lg:N},A=q.forwardRef(function({name:c,email:n,avatar:l,icon:u="User",color:y="primary",size:e="md",onLogout:i,logoutLabel:x,children:m,loading:r=!1,className:_,style:f,...h},v){const o=w.useT(),j=e==="lg"?"lg":e==="sm"?"sm":"md",k=e==="lg"?"md":"sm";return t.jsxs("div",{ref:v,className:p.clsx(s.card,s[e],_),style:f,"aria-busy":r||void 0,...h,children:[t.jsxs("div",{className:s.identity,children:[t.jsx(g.Avatar,{size:j,name:c,src:l,icon:c?void 0:u,color:y,loading:r}),t.jsxs("div",{className:s.text,children:[t.jsx(d.Typography,{variant:"bodySmall",truncate:!0,children:r?t.jsx(a.Skeleton,{width:"60%"}):c??o("userCard.welcome")}),(r||n!=null)&&t.jsx(d.Typography,{variant:"caption",color:"muted",truncate:!0,children:r?t.jsx(a.Skeleton,{width:"85%"}):n})]})]}),m,i?t.jsx(C.Button,{variant:"filled",color:"error",size:k,fullWidth:!0,startIcon:t.jsx(S.Icon,{name:"Logout2"}),onClick:i,children:x??o("userCard.signOut")}):null]})});exports.UserCard=A;
2
+ //# sourceMappingURL=UserCard-Dzc4zmPj.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserCard-BfHHfkDr.cjs","sources":["../src/components/UserCard/UserCard.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport type { IconName } from '../../icons/names'\nimport { Avatar } from '../Avatar'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Skeleton } from '../Skeleton'\nimport { Typography } from '../Typography'\nimport styles from './UserCard.module.css'\n\nexport type UserCardSize = 'sm' | 'md' | 'lg'\n\nexport interface UserCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /**\n * Display name — the primary line, and the source of the avatar initials. When omitted, the primary\n * line falls back to a localized **\"Welcome\"** greeting (and the avatar shows the `icon`).\n */\n name?: string\n /** Secondary line under the name (usually the email). */\n email?: ReactNode\n /** Avatar image URL (falls back to the initials from `name`, else the `icon`). */\n avatar?: string\n /** Fallback avatar icon when there's no image or name. Defaults to `'User'`. */\n icon?: IconName\n /** Theme palette token tinting the avatar. Defaults to `'primary'`. */\n color?: ThemeColor\n /** Preset size (avatar + fonts + button). Defaults to `'md'`. */\n size?: UserCardSize\n /** When provided, a **Sign out** button is shown that calls this. */\n onLogout?: () => void\n /** Sign-out button label. Defaults to `'Sign out'`. */\n logoutLabel?: ReactNode\n /** Extra content between the identity row and the sign-out button (e.g. a link or menu). */\n children?: ReactNode\n /** Show skeletons for the avatar, name and email while the user is being fetched (sign-out stays usable). Defaults to `false`. */\n loading?: boolean\n}\n\n/**\n * A compact account card — an `Avatar` + name/email and an optional **Sign out** button. Drop it into\n * the `RootLayout` `sidebarFooter` (or anywhere) for a consistent signed-in-user block across apps,\n * instead of hand-rolling the markup each time. Shows the image (`avatar`) → initials (from `name`) →\n * `icon` (default `User`) in priority order; renders the sign-out `Button` (filled `error`) only when\n * `onLogout` is given. `size` (`sm`/`md`/`lg`) scales the avatar + type; `color` (default `primary`)\n * tints the avatar. `loading` swaps the avatar + name + email for skeletons. Own CSS module (token-only).\n */\nexport const UserCard = forwardRef<HTMLDivElement, UserCardProps>(function UserCard(\n {\n name,\n email,\n avatar,\n icon = 'User',\n color = 'primary',\n size = 'md',\n onLogout,\n logoutLabel,\n children,\n loading = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n // the identity row + the sign-out button share the same visual size step\n const avatarSize = size === 'lg' ? 'lg' : size === 'sm' ? 'sm' : 'md'\n const buttonSize = size === 'lg' ? 'md' : 'sm'\n\n return (\n <div\n ref={ref}\n className={clsx(styles.card, styles[size], className)}\n style={style as CSSProperties}\n aria-busy={loading || undefined}\n {...props}\n >\n <div className={styles.identity}>\n {/* Avatar priority is image → icon → initials, so pass `icon` only as the last resort (no\n name), otherwise a name would still show the icon instead of its initials */}\n <Avatar\n size={avatarSize}\n name={name}\n src={avatar}\n icon={name ? undefined : icon}\n color={color}\n loading={loading}\n />\n <div className={styles.text}>\n {/* primary line: the name, or a \"Welcome\" greeting fallback when no name is given */}\n <Typography variant=\"bodySmall\" truncate>\n {loading ? <Skeleton width=\"60%\" /> : (name ?? t('userCard.welcome'))}\n </Typography>\n {(loading || email != null) && (\n <Typography variant=\"caption\" color=\"muted\" truncate>\n {loading ? <Skeleton width=\"85%\" /> : email}\n </Typography>\n )}\n </div>\n </div>\n\n {children}\n\n {onLogout ? (\n <Button\n variant=\"filled\"\n color=\"error\"\n size={buttonSize}\n fullWidth\n startIcon={<Icon name=\"Logout2\" />}\n onClick={onLogout}\n >\n {logoutLabel ?? t('userCard.signOut')}\n </Button>\n ) : null}\n </div>\n )\n})\n"],"names":["UserCard","forwardRef","name","email","avatar","icon","color","size","onLogout","logoutLabel","children","loading","className","style","props","ref","t","useT","avatarSize","buttonSize","jsxs","clsx","styles","jsx","Avatar","Typography","Skeleton","Button","Icon"],"mappings":"0bA+CaA,EAAWC,EAAAA,WAA0C,SAChE,CACE,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,KAAAC,EAAO,OACP,MAAAC,EAAQ,UACR,KAAAC,EAAO,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CAAA,CAGV,CAAC"}
1
+ {"version":3,"file":"UserCard-Dzc4zmPj.cjs","sources":["../src/components/UserCard/UserCard.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport type { IconName } from '../../icons/names'\nimport { Avatar } from '../Avatar'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Skeleton } from '../Skeleton'\nimport { Typography } from '../Typography'\nimport styles from './UserCard.module.css'\n\nexport type UserCardSize = 'sm' | 'md' | 'lg'\n\nexport interface UserCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /**\n * Display name — the primary line, and the source of the avatar initials. When omitted, the primary\n * line falls back to a localized **\"Welcome\"** greeting (and the avatar shows the `icon`).\n */\n name?: string\n /** Secondary line under the name (usually the email). */\n email?: ReactNode\n /** Avatar image URL (falls back to the initials from `name`, else the `icon`). */\n avatar?: string\n /** Fallback avatar icon when there's no image or name. Defaults to `'User'`. */\n icon?: IconName\n /** Theme palette token tinting the avatar. Defaults to `'primary'`. */\n color?: ThemeColor\n /** Preset size (avatar + fonts + button). Defaults to `'md'`. */\n size?: UserCardSize\n /** When provided, a **Sign out** button is shown that calls this. */\n onLogout?: () => void\n /** Sign-out button label. Defaults to `'Sign out'`. */\n logoutLabel?: ReactNode\n /** Extra content between the identity row and the sign-out button (e.g. a link or menu). */\n children?: ReactNode\n /** Show skeletons for the avatar, name and email while the user is being fetched (sign-out stays usable). Defaults to `false`. */\n loading?: boolean\n}\n\n/**\n * A compact account card — an `Avatar` + name/email and an optional **Sign out** button. Drop it into\n * the `RootLayout` `sidebarFooter` (or anywhere) for a consistent signed-in-user block across apps,\n * instead of hand-rolling the markup each time. Shows the image (`avatar`) → initials (from `name`) →\n * `icon` (default `User`) in priority order; renders the sign-out `Button` (filled `error`) only when\n * `onLogout` is given. `size` (`sm`/`md`/`lg`) scales the avatar + type; `color` (default `primary`)\n * tints the avatar. `loading` swaps the avatar + name + email for skeletons. Own CSS module (token-only).\n */\nexport const UserCard = forwardRef<HTMLDivElement, UserCardProps>(function UserCard(\n {\n name,\n email,\n avatar,\n icon = 'User',\n color = 'primary',\n size = 'md',\n onLogout,\n logoutLabel,\n children,\n loading = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n // the identity row + the sign-out button share the same visual size step\n const avatarSize = size === 'lg' ? 'lg' : size === 'sm' ? 'sm' : 'md'\n const buttonSize = size === 'lg' ? 'md' : 'sm'\n\n return (\n <div\n ref={ref}\n className={clsx(styles.card, styles[size], className)}\n style={style as CSSProperties}\n aria-busy={loading || undefined}\n {...props}\n >\n <div className={styles.identity}>\n {/* Avatar priority is image → icon → initials, so pass `icon` only as the last resort (no\n name), otherwise a name would still show the icon instead of its initials */}\n <Avatar\n size={avatarSize}\n name={name}\n src={avatar}\n icon={name ? undefined : icon}\n color={color}\n loading={loading}\n />\n <div className={styles.text}>\n {/* primary line: the name, or a \"Welcome\" greeting fallback when no name is given */}\n <Typography variant=\"bodySmall\" truncate>\n {loading ? <Skeleton width=\"60%\" /> : (name ?? t('userCard.welcome'))}\n </Typography>\n {(loading || email != null) && (\n <Typography variant=\"caption\" color=\"muted\" truncate>\n {loading ? <Skeleton width=\"85%\" /> : email}\n </Typography>\n )}\n </div>\n </div>\n\n {children}\n\n {onLogout ? (\n <Button\n variant=\"filled\"\n color=\"error\"\n size={buttonSize}\n fullWidth\n startIcon={<Icon name=\"Logout2\" />}\n onClick={onLogout}\n >\n {logoutLabel ?? t('userCard.signOut')}\n </Button>\n ) : null}\n </div>\n )\n})\n"],"names":["UserCard","forwardRef","name","email","avatar","icon","color","size","onLogout","logoutLabel","children","loading","className","style","props","ref","t","useT","avatarSize","buttonSize","jsxs","clsx","styles","jsx","Avatar","Typography","Skeleton","Button","Icon"],"mappings":"0bA+CaA,EAAWC,EAAAA,WAA0C,SAChE,CACE,KAAAC,EACA,MAAAC,EACA,OAAAC,EAC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GAAeO,EAAE,kBAAkB,CAAA,CAAA,EAEpC,IAAA,CAAA,CAAA,CAGV,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import { type ErrorBoundaryProps, type RootLayoutHeader } from '../components';
2
+ import { type ErrorBoundaryProps, type RootLayoutHeader, type RootLayoutProps } from '../components';
3
3
  /** The minimal user shape `AdminRoot` reads — apps pass their own richer type via the generic. */
4
4
  export interface AdminUser {
5
5
  name?: string;
@@ -9,6 +9,11 @@ export interface AdminUser {
9
9
  export interface AdminRootProps<U extends AdminUser = AdminUser> {
10
10
  /** Brand mark for the sidebar top. */
11
11
  logo?: ReactNode;
12
+ /**
13
+ * Where clicking the logo goes — the first menu page by default (see `RootLayout`'s `logoTo`); a path to
14
+ * send it elsewhere, or `false` for a non-clickable logo.
15
+ */
16
+ logoTo?: RootLayoutProps['logoTo'];
12
17
  /** Current user, or `null` when signed out. */
13
18
  getUser: () => U | null;
14
19
  /** Clears the session; `AdminRoot` navigates to `loginPath` afterwards. */
@@ -48,4 +53,4 @@ export interface AdminRootProps<U extends AdminUser = AdminUser> {
48
53
  * component: () => <AdminRoot<AuthUser> logo={<Logo />} getUser={getUser} onLogout={logout} />,
49
54
  * })
50
55
  */
51
- export declare const AdminRoot: <U extends AdminUser = AdminUser>({ logo, getUser, onLogout, authRouteId, loginPath, showUserCard, header, errorBoundary, }: AdminRootProps<U>) => import("react/jsx-runtime").JSX.Element;
56
+ export declare const AdminRoot: <U extends AdminUser = AdminUser>({ logo, logoTo, getUser, onLogout, authRouteId, loginPath, showUserCard, header, errorBoundary, }: AdminRootProps<U>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import { type ErrorBoundaryProps, type RootLayoutHeader } from '../components';
2
+ import { type ErrorBoundaryProps, type RootLayoutHeader, type RootLayoutProps } from '../components';
3
3
  /** The minimal user shape `AdminRoot` reads — apps pass their own richer type via the generic. */
4
4
  export interface AdminUser {
5
5
  name?: string;
@@ -9,6 +9,11 @@ export interface AdminUser {
9
9
  export interface AdminRootProps<U extends AdminUser = AdminUser> {
10
10
  /** Brand mark for the sidebar top. */
11
11
  logo?: ReactNode;
12
+ /**
13
+ * Where clicking the logo goes — the first menu page by default (see `RootLayout`'s `logoTo`); a path to
14
+ * send it elsewhere, or `false` for a non-clickable logo.
15
+ */
16
+ logoTo?: RootLayoutProps['logoTo'];
12
17
  /** Current user, or `null` when signed out. */
13
18
  getUser: () => U | null;
14
19
  /** Clears the session; `AdminRoot` navigates to `loginPath` afterwards. */
@@ -48,4 +53,4 @@ export interface AdminRootProps<U extends AdminUser = AdminUser> {
48
53
  * component: () => <AdminRoot<AuthUser> logo={<Logo />} getUser={getUser} onLogout={logout} />,
49
54
  * })
50
55
  */
51
- export declare const AdminRoot: <U extends AdminUser = AdminUser>({ logo, getUser, onLogout, authRouteId, loginPath, showUserCard, header, errorBoundary, }: AdminRootProps<U>) => import("react/jsx-runtime").JSX.Element;
56
+ export declare const AdminRoot: <U extends AdminUser = AdminUser>({ logo, logoTo, getUser, onLogout, authRouteId, loginPath, showUserCard, header, errorBoundary, }: AdminRootProps<U>) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../Accordion-P3PNqSER.cjs");exports.Accordion=o.Accordion;exports.AccordionItem=o.AccordionItem;exports.default=o.Accordion;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../Accordion-CtvAYNKd.cjs");exports.Accordion=o.Accordion;exports.AccordionItem=o.AccordionItem;exports.default=o.Accordion;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { A as c, a as r, A } from "../../Accordion-w-w_WxxV.js";
1
+ import { A as c, a as r, A } from "../../Accordion-ClK2XpD7.js";
2
2
  export {
3
3
  c as Accordion,
4
4
  r as AccordionItem,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../Alert-VFQuuII6.cjs");exports.Alert=e.Alert;exports.default=e.Alert;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../Alert-BM5WOI_u.cjs");exports.Alert=e.Alert;exports.default=e.Alert;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { A as r, A as t } from "../../Alert-CJono1TJ.js";
1
+ import { A as r, A as t } from "../../Alert-BLqAcEoT.js";
2
2
  export {
3
3
  r as Alert,
4
4
  t as default
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../AuthLayout-QAtW2GAT.cjs");exports.AuthLayout=t.AuthLayout;exports.default=t.AuthLayout;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../AuthLayout-DIcR__vo.cjs");exports.AuthLayout=t.AuthLayout;exports.default=t.AuthLayout;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { A as o, A as u } from "../../AuthLayout-DOFYw_z5.js";
1
+ import { A as o, A as u } from "../../AuthLayout-m1BQ6Ixx.js";
2
2
  export {
3
3
  o as AuthLayout,
4
4
  u as default
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../Avatar-DrV_F7Ex.cjs"),a=require("../../AvatarGroup-CHesdo-M.cjs");exports.Avatar=r.Avatar;exports.default=r.Avatar;exports.AvatarGroup=a.AvatarGroup;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../Avatar-CQ--wGWS.cjs"),a=require("../../AvatarGroup-Bzu2t6Sd.cjs");exports.Avatar=r.Avatar;exports.default=r.Avatar;exports.AvatarGroup=a.AvatarGroup;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
- import { A as o, A as t } from "../../Avatar-DXNPg23a.js";
2
- import { A as e } from "../../AvatarGroup-CwlYqDCI.js";
1
+ import { A as o, A as t } from "../../Avatar-MwWIcj8z.js";
2
+ import { A as e } from "../../AvatarGroup-BxYQo0zZ.js";
3
3
  export {
4
4
  o as Avatar,
5
5
  e as AvatarGroup,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../Breadcrumbs-DCEHxpSi.cjs");exports.Breadcrumbs=e.Breadcrumbs;exports.default=e.Breadcrumbs;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../Breadcrumbs-Di4-Acfb.cjs");exports.Breadcrumbs=e.Breadcrumbs;exports.default=e.Breadcrumbs;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { B as e, B as s } from "../../Breadcrumbs-XWU8tRvs.js";
1
+ import { B as e, B as s } from "../../Breadcrumbs-CzHGbN2c.js";
2
2
  export {
3
3
  e as Breadcrumbs,
4
4
  s as default
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../Button-CusxDmfq.cjs");exports.Button=t.Button;exports.default=t.Button;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../Button-BQhiJq8e.cjs");exports.Button=t.Button;exports.default=t.Button;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { B as o, B } from "../../Button-CWMNNiia.js";
1
+ import { B as o, B } from "../../Button-9Qcdkw-y.js";
2
2
  export {
3
3
  o as Button,
4
4
  B as default
@@ -18,6 +18,13 @@ export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'
18
18
  footer?: ReactNode;
19
19
  /** Footer content pinned to the **left** of the footer row (opposite `footer`). */
20
20
  footerStart?: ReactNode;
21
+ /**
22
+ * Keep the footer **pinned to the bottom of the screen** while the card is taller than the viewport — so a
23
+ * long form's Save / Cancel stay reachable without scrolling to the end. It sits in its normal place once
24
+ * the card's end scrolls into view. Needs no `overflow` on the scrolling ancestors (the admin shell has
25
+ * none). Defaults to `false`.
26
+ */
27
+ stickyFooter?: boolean;
21
28
  /** Adds a collapse/expand toggle to the header that folds the body + footer. */
22
29
  collapsible?: boolean;
23
30
  /** Controlled collapsed state. */
@@ -34,6 +41,7 @@ export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'
34
41
  /**
35
42
  * A surface card with an optional header (icon + title + actions), a body, and a footer for actions.
36
43
  * `collapsible` adds a chevron that smoothly folds the body + footer (controlled via `collapsed`/
37
- * `onCollapsedChange`, or uncontrolled via `defaultCollapsed`). Token-only styling.
44
+ * `onCollapsedChange`, or uncontrolled via `defaultCollapsed`). `stickyFooter` pins the footer to the bottom
45
+ * of the screen while the card scrolls. Token-only styling.
38
46
  */
39
47
  export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;