@fluid-app/portal-sdk 0.1.45 → 0.1.46

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 (239) hide show
  1. package/dist/{AlertWidget-CRYuxgyZ.cjs → AlertWidget-CSYWU2c3.cjs} +2 -2
  2. package/dist/{AlertWidget-CRYuxgyZ.cjs.map → AlertWidget-CSYWU2c3.cjs.map} +1 -1
  3. package/dist/{AlertWidget-DnygF0ze.mjs → AlertWidget-DTrMt8y7.mjs} +2 -2
  4. package/dist/{AlertWidget-DnygF0ze.mjs.map → AlertWidget-DTrMt8y7.mjs.map} +1 -1
  5. package/dist/{BulletListWidget-DfXMbboF.cjs → BulletListWidget-BUMq15V1.cjs} +18 -4
  6. package/dist/BulletListWidget-BUMq15V1.cjs.map +1 -0
  7. package/dist/{BulletListWidget-bvVUvGOQ.mjs → BulletListWidget-riFNn47D.mjs} +19 -5
  8. package/dist/BulletListWidget-riFNn47D.mjs.map +1 -0
  9. package/dist/{CalendarWidget-YybCIktI.mjs → CalendarWidget-B9I__jsL.mjs} +20 -4
  10. package/dist/CalendarWidget-B9I__jsL.mjs.map +1 -0
  11. package/dist/{CalendarWidget-BAHiko62.cjs → CalendarWidget-DLkcnQVx.cjs} +19 -3
  12. package/dist/CalendarWidget-DLkcnQVx.cjs.map +1 -0
  13. package/dist/{CardWidget-h-FAxb1X.cjs → CardWidget-B4cJHq6g.cjs} +18 -10
  14. package/dist/CardWidget-B4cJHq6g.cjs.map +1 -0
  15. package/dist/{CardWidget-DBv4M9Wx.cjs → CardWidget-BtX2jjQR.cjs} +1 -1
  16. package/dist/{CardWidget-BOk-hod0.mjs → CardWidget-CzRI-odk.mjs} +19 -11
  17. package/dist/CardWidget-CzRI-odk.mjs.map +1 -0
  18. package/dist/{CarouselWidget-tT7qklhM.cjs → CarouselWidget-BcnZwnIh.cjs} +1 -1
  19. package/dist/{CarouselWidget-D-hBiS_H.cjs → CarouselWidget-Bx5jrthO.cjs} +19 -3
  20. package/dist/CarouselWidget-Bx5jrthO.cjs.map +1 -0
  21. package/dist/{CarouselWidget-Cqk2VJzH.mjs → CarouselWidget-C04z7JxO.mjs} +20 -4
  22. package/dist/CarouselWidget-C04z7JxO.mjs.map +1 -0
  23. package/dist/{CatchUpWidget-Bq5Z7dnd.cjs → CatchUpWidget-CFL4REYX.cjs} +19 -3
  24. package/dist/CatchUpWidget-CFL4REYX.cjs.map +1 -0
  25. package/dist/{CatchUpWidget-ZsrbwaTu.mjs → CatchUpWidget-Cb0B0G90.mjs} +20 -4
  26. package/dist/CatchUpWidget-Cb0B0G90.mjs.map +1 -0
  27. package/dist/{ChartWidget-B6_n_Jp8.cjs → ChartWidget-DWWeWN0Q.cjs} +19 -3
  28. package/dist/ChartWidget-DWWeWN0Q.cjs.map +1 -0
  29. package/dist/{ChartWidget-CU3_7LIS.mjs → ChartWidget-WaLM-zc-.mjs} +20 -4
  30. package/dist/ChartWidget-WaLM-zc-.mjs.map +1 -0
  31. package/dist/{ChartWidget-DVZSBgqe.cjs → ChartWidget-_jzD434L.cjs} +1 -1
  32. package/dist/ContactsScreen-B4FZ0Qeu.mjs +37 -0
  33. package/dist/{ContactsScreen-CTCJYpHu.cjs → ContactsScreen-C0I1_D_a.cjs} +2 -2
  34. package/dist/{ContactsScreen-CTCJYpHu.cjs.map → ContactsScreen-C0I1_D_a.cjs.map} +1 -1
  35. package/dist/{ContactsScreen-CoXP9Lt3.mjs → ContactsScreen-CoFB7EM3.mjs} +2 -2
  36. package/dist/{ContactsScreen-CoXP9Lt3.mjs.map → ContactsScreen-CoFB7EM3.mjs.map} +1 -1
  37. package/dist/ContactsScreen-DO7EwobV.cjs +39 -0
  38. package/dist/{ContainerWidget-CCqS2O6i.cjs → ContainerWidget-BFdpfJP9.cjs} +2 -2
  39. package/dist/{ContainerWidget-N8zf088I.cjs → ContainerWidget-DZXzmDZl.cjs} +2 -2
  40. package/dist/{ContainerWidget-N8zf088I.cjs.map → ContainerWidget-DZXzmDZl.cjs.map} +1 -1
  41. package/dist/{ContainerWidget-CFvliHMt.mjs → ContainerWidget-PNfcrIfV.mjs} +3 -3
  42. package/dist/{ContainerWidget-CFvliHMt.mjs.map → ContainerWidget-PNfcrIfV.mjs.map} +1 -1
  43. package/dist/{EmbedWidget-CRCZwIZl.mjs → EmbedWidget-BgDpu44-.mjs} +18 -3
  44. package/dist/EmbedWidget-BgDpu44-.mjs.map +1 -0
  45. package/dist/{EmbedWidget-DQB5SADr.cjs → EmbedWidget-D6eRvOud.cjs} +17 -3
  46. package/dist/EmbedWidget-D6eRvOud.cjs.map +1 -0
  47. package/dist/{FluidProvider-CRceQXyP.cjs → FluidProvider-DzrMOFXn.cjs} +43 -43
  48. package/dist/{FluidProvider-CRceQXyP.cjs.map → FluidProvider-DzrMOFXn.cjs.map} +1 -1
  49. package/dist/{FluidProvider-wbFFOVLt.mjs → FluidProvider-iYl6DSax.mjs} +45 -45
  50. package/dist/{FluidProvider-wbFFOVLt.mjs.map → FluidProvider-iYl6DSax.mjs.map} +1 -1
  51. package/dist/{ImageWidget-m5oDe9uw.mjs → ImageWidget-CvRlDtEa.mjs} +18 -3
  52. package/dist/ImageWidget-CvRlDtEa.mjs.map +1 -0
  53. package/dist/{ImageWidget-2ZYY9Ea9.cjs → ImageWidget-DwM4H6SC.cjs} +17 -3
  54. package/dist/ImageWidget-DwM4H6SC.cjs.map +1 -0
  55. package/dist/{LayoutWidget-Cfyr6h-3.cjs → LayoutWidget-CJ_OSMpt.cjs} +1 -1
  56. package/dist/{LayoutWidget-SPn4xt-J.cjs → LayoutWidget-CsdItxHF.cjs} +17 -3
  57. package/dist/LayoutWidget-CsdItxHF.cjs.map +1 -0
  58. package/dist/{LayoutWidget-B23HX9yD.mjs → LayoutWidget-pS3AMhD7.mjs} +18 -4
  59. package/dist/LayoutWidget-pS3AMhD7.mjs.map +1 -0
  60. package/dist/{LinkWidget-BFBAfz2T.cjs → LinkWidget-CJKveS10.cjs} +18 -4
  61. package/dist/LinkWidget-CJKveS10.cjs.map +1 -0
  62. package/dist/{LinkWidget-DVjXtQgl.cjs → LinkWidget-DFApxWIK.cjs} +1 -1
  63. package/dist/{LinkWidget-DImz_Kgl.mjs → LinkWidget-NR2OqU4Y.mjs} +19 -5
  64. package/dist/LinkWidget-NR2OqU4Y.mjs.map +1 -0
  65. package/dist/{ListWidget-B5PMqdCy.cjs → ListWidget-CulUMQ0M.cjs} +1 -1
  66. package/dist/{ListWidget-4nc_OvSx.cjs → ListWidget-D8yMrpa5.cjs} +19 -3
  67. package/dist/ListWidget-D8yMrpa5.cjs.map +1 -0
  68. package/dist/{ListWidget-BiCdEqrT.mjs → ListWidget-Dl2vSYmI.mjs} +20 -4
  69. package/dist/ListWidget-Dl2vSYmI.mjs.map +1 -0
  70. package/dist/{MessagingScreen-DXLiIKMX.cjs → MessagingScreen-CUBOR0qo.cjs} +3 -3
  71. package/dist/{MessagingScreen-DXLiIKMX.cjs.map → MessagingScreen-CUBOR0qo.cjs.map} +1 -1
  72. package/dist/MessagingScreen-CfbkE7H-.cjs +38 -0
  73. package/dist/{MessagingScreen-BNw31J4s.mjs → MessagingScreen-DgvqyD7k.mjs} +3 -3
  74. package/dist/{MessagingScreen-BNw31J4s.mjs.map → MessagingScreen-DgvqyD7k.mjs.map} +1 -1
  75. package/dist/MessagingScreen-kP-1EJZ5.mjs +36 -0
  76. package/dist/{MySiteScreen-CCjZRdTu.mjs → MySiteScreen-CvyqpzJd.mjs} +2 -2
  77. package/dist/{MySiteScreen-CCjZRdTu.mjs.map → MySiteScreen-CvyqpzJd.mjs.map} +1 -1
  78. package/dist/MySiteScreen-DUMMPU6X.mjs +35 -0
  79. package/dist/{MySiteScreen-DA9vTjW8.cjs → MySiteScreen-NJSRcmI-.cjs} +2 -2
  80. package/dist/{MySiteScreen-DA9vTjW8.cjs.map → MySiteScreen-NJSRcmI-.cjs.map} +1 -1
  81. package/dist/MySiteScreen-jE2m5qP6.cjs +37 -0
  82. package/dist/{MySiteWidget-Cw7623aF.mjs → MySiteWidget-CD1fK3lT.mjs} +20 -4
  83. package/dist/MySiteWidget-CD1fK3lT.mjs.map +1 -0
  84. package/dist/{MySiteWidget-bKaJ4r_k.cjs → MySiteWidget-DeAwyK5y.cjs} +19 -3
  85. package/dist/MySiteWidget-DeAwyK5y.cjs.map +1 -0
  86. package/dist/{NestedWidget-DRhUGS_-.cjs → NestedWidget-C-ZEUe-s.cjs} +1 -1
  87. package/dist/{NestedWidget-Bxf8MJuj.cjs → NestedWidget-CZuN2QY2.cjs} +19 -3
  88. package/dist/NestedWidget-CZuN2QY2.cjs.map +1 -0
  89. package/dist/{NestedWidget-DDAcIeej.mjs → NestedWidget-DjZumiak.mjs} +20 -4
  90. package/dist/NestedWidget-DjZumiak.mjs.map +1 -0
  91. package/dist/{OrdersScreen-CO3-vKPa.mjs → OrdersScreen-B2ErpU4b.mjs} +3 -3
  92. package/dist/{OrdersScreen-CO3-vKPa.mjs.map → OrdersScreen-B2ErpU4b.mjs.map} +1 -1
  93. package/dist/OrdersScreen-BTJAhLgs.mjs +35 -0
  94. package/dist/OrdersScreen-CE0GMwfC.cjs +37 -0
  95. package/dist/{OrdersScreen-q1QeUeHP.cjs → OrdersScreen-DvqljQVk.cjs} +3 -3
  96. package/dist/{OrdersScreen-q1QeUeHP.cjs.map → OrdersScreen-DvqljQVk.cjs.map} +1 -1
  97. package/dist/ProductsScreen-Bb5icf74.mjs +39 -0
  98. package/dist/{ProductsScreen-Btv24fan.mjs → ProductsScreen-CBVy5Zyi.mjs} +4 -4
  99. package/dist/{ProductsScreen-Btv24fan.mjs.map → ProductsScreen-CBVy5Zyi.mjs.map} +1 -1
  100. package/dist/{ProductsScreen-whYhtGj4.cjs → ProductsScreen-DdX6HMHt.cjs} +4 -4
  101. package/dist/{ProductsScreen-whYhtGj4.cjs.map → ProductsScreen-DdX6HMHt.cjs.map} +1 -1
  102. package/dist/ProductsScreen-HIV2lQ9Z.cjs +41 -0
  103. package/dist/ProfileScreen-BpJ41w20.mjs +34 -0
  104. package/dist/ProfileScreen-DAFrOHW1.cjs +36 -0
  105. package/dist/{ProfileScreen-DrmMx9us.cjs → ProfileScreen-LmGvJwTb.cjs} +3 -3
  106. package/dist/{ProfileScreen-DrmMx9us.cjs.map → ProfileScreen-LmGvJwTb.cjs.map} +1 -1
  107. package/dist/{ProfileScreen-Dsrj30ts.mjs → ProfileScreen-r8ceJSGs.mjs} +3 -3
  108. package/dist/{ProfileScreen-Dsrj30ts.mjs.map → ProfileScreen-r8ceJSGs.mjs.map} +1 -1
  109. package/dist/{QuickShareWidget-DJSBoNdI.cjs → QuickShareWidget-CIfXUWCx.cjs} +19 -3
  110. package/dist/QuickShareWidget-CIfXUWCx.cjs.map +1 -0
  111. package/dist/{QuickShareWidget-DzvaOfZL.mjs → QuickShareWidget-CvdvBmEn.mjs} +20 -4
  112. package/dist/QuickShareWidget-CvdvBmEn.mjs.map +1 -0
  113. package/dist/{RecentActivityWidget-DxCHufm5.cjs → RecentActivityWidget-kRfjO1IV.cjs} +19 -3
  114. package/dist/RecentActivityWidget-kRfjO1IV.cjs.map +1 -0
  115. package/dist/{RecentActivityWidget-Dw6yeZKX.mjs → RecentActivityWidget-uegOsG5c.mjs} +20 -4
  116. package/dist/RecentActivityWidget-uegOsG5c.mjs.map +1 -0
  117. package/dist/{SeparatorWidget-DQEGdSLZ.mjs → SeparatorWidget-CkFIxxkI.mjs} +2 -2
  118. package/dist/{SeparatorWidget-DQEGdSLZ.mjs.map → SeparatorWidget-CkFIxxkI.mjs.map} +1 -1
  119. package/dist/{ShareablesScreen-DX_Drc1P.mjs → ShareablesScreen-0JcyLc7i.mjs} +4 -4
  120. package/dist/{ShareablesScreen-DX_Drc1P.mjs.map → ShareablesScreen-0JcyLc7i.mjs.map} +1 -1
  121. package/dist/ShareablesScreen-CBw3gH0u.cjs +41 -0
  122. package/dist/{ShareablesScreen-CLjjDaWJ.cjs → ShareablesScreen-Dfa0LM6R.cjs} +4 -4
  123. package/dist/{ShareablesScreen-CLjjDaWJ.cjs.map → ShareablesScreen-Dfa0LM6R.cjs.map} +1 -1
  124. package/dist/ShareablesScreen-Riod6fjb.mjs +39 -0
  125. package/dist/{ShopScreen-DxU3HMSU.cjs → ShopScreen-C73ARj6e.cjs} +4 -4
  126. package/dist/{ShopScreen-DxU3HMSU.cjs.map → ShopScreen-C73ARj6e.cjs.map} +1 -1
  127. package/dist/ShopScreen-CET9016G.cjs +36 -0
  128. package/dist/{ShopScreen-DH3E7AIz.mjs → ShopScreen-DMDSD4gF.mjs} +4 -4
  129. package/dist/{ShopScreen-DH3E7AIz.mjs.map → ShopScreen-DMDSD4gF.mjs.map} +1 -1
  130. package/dist/ShopScreen-Ddrw43gs.mjs +34 -0
  131. package/dist/{SubscriptionsScreen-JVUC37A9.mjs → SubscriptionsScreen-BLrScFQV.mjs} +3 -3
  132. package/dist/{SubscriptionsScreen-JVUC37A9.mjs.map → SubscriptionsScreen-BLrScFQV.mjs.map} +1 -1
  133. package/dist/SubscriptionsScreen-BMjdIyWT.mjs +35 -0
  134. package/dist/SubscriptionsScreen-CPXCoeeu.cjs +37 -0
  135. package/dist/{SubscriptionsScreen-Bi8ecPZG.cjs → SubscriptionsScreen-CpvMZaU0.cjs} +3 -3
  136. package/dist/{SubscriptionsScreen-Bi8ecPZG.cjs.map → SubscriptionsScreen-CpvMZaU0.cjs.map} +1 -1
  137. package/dist/{TableWidget-D2QlWEXk.cjs → TableWidget-DFWfQIWv.cjs} +19 -3
  138. package/dist/TableWidget-DFWfQIWv.cjs.map +1 -0
  139. package/dist/{TableWidget-C_3ocWPY.cjs → TableWidget-WB7hx4Hb.cjs} +1 -1
  140. package/dist/{TableWidget-kq_rQCoV.mjs → TableWidget-aZUcob2U.mjs} +20 -4
  141. package/dist/TableWidget-aZUcob2U.mjs.map +1 -0
  142. package/dist/{TextWidget-Cmu4a9QG.mjs → TextWidget-D6qCnspg.mjs} +21 -5
  143. package/dist/TextWidget-D6qCnspg.mjs.map +1 -0
  144. package/dist/{TextWidget-Bd8V3uOT.cjs → TextWidget-XBeVX2oM.cjs} +20 -4
  145. package/dist/TextWidget-XBeVX2oM.cjs.map +1 -0
  146. package/dist/{ToDoWidget-BTq8QL4U.cjs → ToDoWidget-GmeRwP_0.cjs} +19 -3
  147. package/dist/ToDoWidget-GmeRwP_0.cjs.map +1 -0
  148. package/dist/{ToDoWidget-CKC5BocI.mjs → ToDoWidget-iiVItJrO.mjs} +20 -4
  149. package/dist/ToDoWidget-iiVItJrO.mjs.map +1 -0
  150. package/dist/{VideoWidget-R5xG2Dt6.mjs → VideoWidget-BAxtPtq5.mjs} +20 -4
  151. package/dist/VideoWidget-BAxtPtq5.mjs.map +1 -0
  152. package/dist/{VideoWidget-BK6_XvD0.cjs → VideoWidget-CN8nMeGP.cjs} +19 -3
  153. package/dist/VideoWidget-CN8nMeGP.cjs.map +1 -0
  154. package/dist/fields-CjDogNNF.mjs +2 -0
  155. package/dist/index.cjs +53 -53
  156. package/dist/index.d.cts +77 -1
  157. package/dist/index.d.cts.map +1 -1
  158. package/dist/index.d.mts +77 -1
  159. package/dist/index.d.mts.map +1 -1
  160. package/dist/index.mjs +55 -55
  161. package/dist/{products-fvXefwYo.mjs → products-DOCuAQDz.mjs} +3 -3
  162. package/dist/{products-fvXefwYo.mjs.map → products-DOCuAQDz.mjs.map} +1 -1
  163. package/dist/{products-CbSNg_2Q.cjs → products-zutaVs48.cjs} +3 -3
  164. package/dist/{products-CbSNg_2Q.cjs.map → products-zutaVs48.cjs.map} +1 -1
  165. package/dist/{src-CzKSt-6K.mjs → src-CIhTbou2.mjs} +2 -2
  166. package/dist/{src-CzKSt-6K.mjs.map → src-CIhTbou2.mjs.map} +1 -1
  167. package/dist/{src-BxmqgcCj.cjs → src-CXGrnE7x.cjs} +2 -2
  168. package/dist/{src-BxmqgcCj.cjs.map → src-CXGrnE7x.cjs.map} +1 -1
  169. package/dist/{use-account-clients-DR-cFoiZ.cjs → use-account-clients-BOwgvZok.cjs} +2 -2
  170. package/dist/{use-account-clients-DR-cFoiZ.cjs.map → use-account-clients-BOwgvZok.cjs.map} +1 -1
  171. package/dist/{use-account-clients-DSdeJkp0.mjs → use-account-clients-EEcG-B1B.mjs} +2 -2
  172. package/dist/{use-account-clients-DSdeJkp0.mjs.map → use-account-clients-EEcG-B1B.mjs.map} +1 -1
  173. package/dist/{use-customer-account-BFxhulZt.cjs → use-customer-account-BxoVi8ak.cjs} +3 -3
  174. package/dist/{use-customer-account-BFxhulZt.cjs.map → use-customer-account-BxoVi8ak.cjs.map} +1 -1
  175. package/dist/{use-customer-account-zbnCNccM.mjs → use-customer-account-TLWo3z05.mjs} +3 -3
  176. package/dist/{use-customer-account-zbnCNccM.mjs.map → use-customer-account-TLWo3z05.mjs.map} +1 -1
  177. package/dist/{use-fluid-api-BUOA1P_y.cjs → use-fluid-api-CU_r0Gu9.cjs} +2 -2
  178. package/dist/{use-fluid-api-BUOA1P_y.cjs.map → use-fluid-api-CU_r0Gu9.cjs.map} +1 -1
  179. package/dist/{use-fluid-api-BUEolyn-.mjs → use-fluid-api-DH8hTTPQ.mjs} +2 -2
  180. package/dist/{use-fluid-api-BUEolyn-.mjs.map → use-fluid-api-DH8hTTPQ.mjs.map} +1 -1
  181. package/package.json +16 -16
  182. package/styles/globals.css +2 -1
  183. package/dist/BulletListWidget-DfXMbboF.cjs.map +0 -1
  184. package/dist/BulletListWidget-bvVUvGOQ.mjs.map +0 -1
  185. package/dist/CalendarWidget-BAHiko62.cjs.map +0 -1
  186. package/dist/CalendarWidget-YybCIktI.mjs.map +0 -1
  187. package/dist/CardWidget-BOk-hod0.mjs.map +0 -1
  188. package/dist/CardWidget-h-FAxb1X.cjs.map +0 -1
  189. package/dist/CarouselWidget-Cqk2VJzH.mjs.map +0 -1
  190. package/dist/CarouselWidget-D-hBiS_H.cjs.map +0 -1
  191. package/dist/CatchUpWidget-Bq5Z7dnd.cjs.map +0 -1
  192. package/dist/CatchUpWidget-ZsrbwaTu.mjs.map +0 -1
  193. package/dist/ChartWidget-B6_n_Jp8.cjs.map +0 -1
  194. package/dist/ChartWidget-CU3_7LIS.mjs.map +0 -1
  195. package/dist/ContactsScreen-BGwMvoc6.cjs +0 -39
  196. package/dist/ContactsScreen-B_W89Txh.mjs +0 -37
  197. package/dist/EmbedWidget-CRCZwIZl.mjs.map +0 -1
  198. package/dist/EmbedWidget-DQB5SADr.cjs.map +0 -1
  199. package/dist/ImageWidget-2ZYY9Ea9.cjs.map +0 -1
  200. package/dist/ImageWidget-m5oDe9uw.mjs.map +0 -1
  201. package/dist/LayoutWidget-B23HX9yD.mjs.map +0 -1
  202. package/dist/LayoutWidget-SPn4xt-J.cjs.map +0 -1
  203. package/dist/LinkWidget-BFBAfz2T.cjs.map +0 -1
  204. package/dist/LinkWidget-DImz_Kgl.mjs.map +0 -1
  205. package/dist/ListWidget-4nc_OvSx.cjs.map +0 -1
  206. package/dist/ListWidget-BiCdEqrT.mjs.map +0 -1
  207. package/dist/MessagingScreen-BgaFc4dw.mjs +0 -36
  208. package/dist/MessagingScreen-r1CuGZTz.cjs +0 -38
  209. package/dist/MySiteScreen-CejFK1ki.cjs +0 -37
  210. package/dist/MySiteScreen-DcFcXY7l.mjs +0 -35
  211. package/dist/MySiteWidget-Cw7623aF.mjs.map +0 -1
  212. package/dist/MySiteWidget-bKaJ4r_k.cjs.map +0 -1
  213. package/dist/NestedWidget-Bxf8MJuj.cjs.map +0 -1
  214. package/dist/NestedWidget-DDAcIeej.mjs.map +0 -1
  215. package/dist/OrdersScreen-BTgeNO4Z.cjs +0 -37
  216. package/dist/OrdersScreen-yDvuEsiZ.mjs +0 -35
  217. package/dist/ProductsScreen-CibQXnfN.mjs +0 -39
  218. package/dist/ProductsScreen-DygMyNll.cjs +0 -41
  219. package/dist/ProfileScreen-CbZevC9b.cjs +0 -36
  220. package/dist/ProfileScreen-H2suBhUK.mjs +0 -34
  221. package/dist/QuickShareWidget-DJSBoNdI.cjs.map +0 -1
  222. package/dist/QuickShareWidget-DzvaOfZL.mjs.map +0 -1
  223. package/dist/RecentActivityWidget-Dw6yeZKX.mjs.map +0 -1
  224. package/dist/RecentActivityWidget-DxCHufm5.cjs.map +0 -1
  225. package/dist/ShareablesScreen-CvdwMRKM.cjs +0 -41
  226. package/dist/ShareablesScreen-VWeb61BX.mjs +0 -39
  227. package/dist/ShopScreen-CFP3QG21.mjs +0 -34
  228. package/dist/ShopScreen-CWFKO9Iz.cjs +0 -36
  229. package/dist/SubscriptionsScreen-CNDRQ4Q5.cjs +0 -37
  230. package/dist/SubscriptionsScreen-oABvUl1M.mjs +0 -35
  231. package/dist/TableWidget-D2QlWEXk.cjs.map +0 -1
  232. package/dist/TableWidget-kq_rQCoV.mjs.map +0 -1
  233. package/dist/TextWidget-Bd8V3uOT.cjs.map +0 -1
  234. package/dist/TextWidget-Cmu4a9QG.mjs.map +0 -1
  235. package/dist/ToDoWidget-BTq8QL4U.cjs.map +0 -1
  236. package/dist/ToDoWidget-CKC5BocI.mjs.map +0 -1
  237. package/dist/VideoWidget-BK6_XvD0.cjs.map +0 -1
  238. package/dist/VideoWidget-R5xG2Dt6.mjs.map +0 -1
  239. package/dist/fields-DW1nDGRz.mjs +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableWidget-DFWfQIWv.cjs","names":["MediaRenderer","getMediaPropsFromShareable","useWidgetInteraction","borderWidthClasses","borderColorClasses","Input"],"sources":["../../widgets/src/widgets/TableWidget.tsx"],"sourcesContent":["import { useState, useMemo, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { Input } from \"@fluid-app/ui-primitives\";\nimport {\n MediaRenderer,\n getMediaPropsFromShareable,\n} from \"../components/MediaRenderer\";\nimport { type ShareableItem } from \"@fluid-app/portal-core/types\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\n\n/** Plain column definition provided by data sources (no render functions) */\nexport type TableColumnDef = {\n key: string;\n label: string;\n sortable: boolean;\n};\n\n// Internal column definition (includes render function)\ntype ColumnDef = TableColumnDef & {\n render?: (value: unknown, item: ShareableItem) => React.ReactNode;\n};\n\nconst DEFAULT_DATA: ShareableItem[] = [];\n\n// ---------------------------------------------------------------------------\n// Column cell renderers\n// ---------------------------------------------------------------------------\n\nfunction ImageCellRenderer(_value: unknown, item: ShareableItem) {\n return (\n <div className=\"h-10 w-10 rounded object-cover\">\n <MediaRenderer {...getMediaPropsFromShareable(item)} />\n </div>\n );\n}\n\nfunction PriceCellRenderer(_value: unknown, item: ShareableItem) {\n return ((item.display_price as string) ?? item.price) || \"-\";\n}\n\nfunction StatusCellRenderer(value: unknown) {\n const status = String(value || \"unknown\").toLowerCase();\n const statusStyles: Record<string, string> = {\n active: \"bg-primary text-primary-foreground\",\n paid: \"bg-primary text-primary-foreground\",\n inactive: \"bg-secondary text-secondary-foreground\",\n paused: \"bg-secondary text-secondary-foreground\",\n unknown: \"bg-muted text-muted-foreground\",\n unpaid: \"bg-destructive text-destructive-foreground\",\n refunded: \"bg-muted text-muted-foreground\",\n cancelled: \"bg-destructive text-destructive-foreground\",\n };\n return (\n <span\n className={`inline-flex rounded-full px-2 py-1 text-xs font-medium ${statusStyles[status] || \"bg-muted text-foreground\"}`}\n >\n {String(value || \"Unknown\")}\n </span>\n );\n}\n\n/** Map of column keys to custom cell renderers */\nconst CELL_RENDERERS: Record<\n string,\n (value: unknown, item: ShareableItem) => React.ReactNode\n> = {\n imageUrl: ImageCellRenderer,\n price: PriceCellRenderer,\n display_price: PriceCellRenderer,\n status: StatusCellRenderer,\n};\n\n/** Resolve plain column definitions from a data source into full ColumnDefs with renderers */\nfunction resolveColumns(columns: TableColumnDef[]): ColumnDef[] {\n return columns.map((col) => {\n const render = CELL_RENDERERS[col.key];\n return render ? { ...col, render } : { ...col };\n });\n}\n\n// Default columns for product data\nconst defaultColumns: ColumnDef[] = [\n {\n key: \"imageUrl\",\n label: \"Image\",\n sortable: false,\n render: ImageCellRenderer,\n },\n {\n key: \"title\",\n label: \"Title\",\n sortable: true,\n },\n {\n key: \"price\",\n label: \"Price\",\n sortable: true,\n render: PriceCellRenderer,\n },\n {\n key: \"status\",\n label: \"Status\",\n sortable: true,\n render: StatusCellRenderer,\n },\n];\n\ntype TableWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Styling\n background?: BackgroundValue;\n alternatingColorEnabled?: boolean;\n textColor?: ColorOptions;\n headerBackgroundColor?: ColorOptions;\n headerTextColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Data\n data?: ShareableItem[];\n /** Column definitions from a data source (plain data, renderers resolved internally) */\n columns?: TableColumnDef[];\n\n // Features\n filterEnabled?: boolean;\n sortingEnabled?: boolean;\n paginationEnabled?: boolean;\n maxRowsPerPage?: number;\n};\n\nexport function TableWidget({\n // Title defaults\n titleEnabled = true,\n titleText = \"Products\",\n titleFontSize = \"xl\",\n titleColor = \"foreground\",\n\n // Styling defaults\n background = {\n type: \"solid\",\n color: \"background\",\n },\n alternatingColorEnabled = true,\n textColor = \"foreground\",\n headerBackgroundColor = \"muted\",\n headerTextColor = \"foreground\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n // Data\n data = DEFAULT_DATA,\n columns: columnsProp,\n\n // Feature defaults\n filterEnabled = true,\n sortingEnabled = true,\n paginationEnabled = true,\n maxRowsPerPage = 5,\n\n className,\n ...props\n}: TableWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const isImageBackground = background.type === \"image\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n isImageBackground\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n const pageSize = maxRowsPerPage;\n\n // When using an image or transparent background, inner elements should be\n // transparent so the image/page shows through. Otherwise use the configured colors.\n const isTransparentBg = backgroundColor === \"transparent\";\n const useTransparentInner = isImageBackground || isTransparentBg;\n const innerBg = useTransparentInner\n ? \"bg-transparent\"\n : `bg-${backgroundColor}`;\n const innerBgAlt = useTransparentInner\n ? \"bg-black/5\"\n : `bg-${backgroundColor}-400`;\n const transparentBorder = isTransparentBg\n ? \"border-black/20\"\n : \"border-white/20\";\n const innerBorder = useTransparentInner\n ? transparentBorder\n : `border-${backgroundColor}-600`;\n const headerBg = useTransparentInner\n ? \"bg-black/10\"\n : `bg-${headerBackgroundColor}-400`;\n const headerBorder = useTransparentInner\n ? transparentBorder\n : `border-${headerBackgroundColor}-600`;\n const paginationBg = useTransparentInner\n ? \"bg-black/10\"\n : `bg-${backgroundColor}-400`;\n\n // State for filtering, sorting, and pagination\n const [globalFilter, setGlobalFilter] = useState(\"\");\n const [sortConfig, setSortConfig] = useState<{\n key: string;\n direction: \"asc\" | \"desc\";\n } | null>(null);\n const [currentPage, setCurrentPage] = useState(1);\n\n // Only use columns from the data source if they look like valid column defs\n // (have a `key` string). When transformers return a plain array (e.g. toShareableProps),\n // use-widget-data maps the same array to ALL targetProps, so `columns` may\n // receive the data rows instead of column definitions.\n const firstCol = columnsProp?.[0];\n const validColumnsProp =\n firstCol && typeof firstCol.key === \"string\" && firstCol.key !== \"\"\n ? columnsProp\n : undefined;\n\n const columns = useMemo(\n () =>\n validColumnsProp ? resolveColumns(validColumnsProp) : defaultColumns,\n [validColumnsProp],\n );\n\n // Filter data\n const filteredData = useMemo(() => {\n let result = [...data];\n\n if (globalFilter) {\n const lowerFilter = globalFilter.toLowerCase();\n result = result.filter((item) =>\n columns.some((col) => {\n const value = item[col.key];\n return String(value ?? \"\")\n .toLowerCase()\n .includes(lowerFilter);\n }),\n );\n }\n\n return result;\n }, [data, globalFilter, columns]);\n\n // Sort data\n const sortedData = useMemo(() => {\n if (!sortConfig) return filteredData;\n\n return [...filteredData].sort((a, b) => {\n const aValue = a[sortConfig.key];\n const bValue = b[sortConfig.key];\n\n // Handle null/undefined\n if (aValue == null && bValue == null) return 0;\n if (aValue == null) return sortConfig.direction === \"asc\" ? 1 : -1;\n if (bValue == null) return sortConfig.direction === \"asc\" ? -1 : 1;\n\n // Compare values\n let comparison = 0;\n if (typeof aValue === \"number\" && typeof bValue === \"number\") {\n comparison = aValue - bValue;\n } else {\n comparison = String(aValue).localeCompare(String(bValue));\n }\n\n return sortConfig.direction === \"asc\" ? comparison : -comparison;\n });\n }, [filteredData, sortConfig]);\n\n // Paginate data\n const paginatedData = useMemo(() => {\n if (!paginationEnabled) return sortedData;\n\n const startIndex = (currentPage - 1) * pageSize;\n return sortedData.slice(startIndex, startIndex + pageSize);\n }, [sortedData, currentPage, pageSize, paginationEnabled]);\n\n const totalPages = Math.ceil(sortedData.length / pageSize);\n\n // Reset to page 1 when filters change\n const handleGlobalFilterChange = (value: string) => {\n setGlobalFilter(value);\n setCurrentPage(1);\n };\n\n // Handle sort\n const handleSort = (key: string) => {\n if (!sortingEnabled) return;\n\n setSortConfig((prev) => {\n if (prev?.key !== key) return { key, direction: \"asc\" };\n if (prev.direction === \"asc\") return { key, direction: \"desc\" };\n return null;\n });\n };\n\n // Get sort indicator\n const getSortIndicator = (key: string) => {\n if (sortConfig?.key !== key) return null;\n return sortConfig.direction === \"asc\" ? \" ↑\" : \" ↓\";\n };\n\n const { onItemClick } = useWidgetInteraction();\n\n return (\n <div\n className={`@container overflow-hidden ${paginationEnabled ? \"\" : \"overflow-y-auto\"} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-${backgroundColor} bg-cover bg-center text-${textColor} ${className}`}\n style={{ backgroundImage }}\n {...props}\n >\n <div\n className={`flex items-center justify-between p-${padding} ${innerBg} space-x-2`}\n >\n {/* Title */}\n {titleEnabled && titleText && (\n <h2\n className={`text-${titleFontSize === \"md\" ? \"base\" : titleFontSize} font-header font-bold text-${titleColor} min-w-0 truncate`}\n >\n {titleText}\n </h2>\n )}\n\n {/* Global Search */}\n {filterEnabled && (\n <Input\n type=\"text\"\n placeholder=\"Search all columns...\"\n value={globalFilter}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n handleGlobalFilterChange(e.target.value)\n }\n className={`w-full rounded-md border ${headerBorder} ${headerBg} ring-offset-muted px-3 py-2 text-sm placeholder:text-${headerTextColor}-400 focus-visible:ring-primary focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none md:w-64`}\n />\n )}\n </div>\n\n {/* Table */}\n <div className=\"overflow-x-auto\">\n <table className=\"w-full border-collapse\">\n <thead>\n <tr className={`${headerBg} ${headerBorder} border-y`}>\n {columns.map((col) => (\n <th\n key={col.key}\n className={`px-4 py-3 text-left text-sm font-semibold text-${headerTextColor} ${col.sortable && sortingEnabled ? \"cursor-pointer select-none hover:opacity-80\" : \"\"}`}\n {...(col.sortable && sortingEnabled\n ? {\n role: \"button\" as const,\n tabIndex: 0,\n onClick: () => handleSort(col.key),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n handleSort(col.key);\n }\n },\n }\n : {})}\n >\n <div className=\"flex flex-col gap-1\">\n <span>\n {col.label}\n {col.sortable &&\n sortingEnabled &&\n getSortIndicator(col.key)}\n </span>\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {data.length === 0 ? (\n <tr>\n <td colSpan={columns.length}>\n <div className=\"text-muted-foreground flex min-h-[200px] flex-col items-center justify-center gap-2\">\n <div className=\"text-4xl\">📋</div>\n <p className=\"text-sm\">No data available</p>\n <p className=\"text-muted-foreground/70 text-xs\">\n Connect a data source to display table data\n </p>\n </div>\n </td>\n </tr>\n ) : paginatedData.length === 0 ? (\n <tr>\n <td colSpan={columns.length}>\n <div className=\"py-8 text-center\">\n <p className=\"text-sm\">No results found</p>\n <p className=\"text-xs\">Try adjusting your search</p>\n </div>\n </td>\n </tr>\n ) : (\n <>\n {paginatedData.map((item, index) => (\n <tr\n key={item.id ?? index}\n className={`h-17 border-b ${innerBorder} last:border-none ${innerBg} ${alternatingColorEnabled ? `even:${innerBgAlt}` : \"\"} ${onItemClick ? \"cursor-pointer hover:opacity-80\" : \"\"}`}\n {...(onItemClick\n ? {\n tabIndex: 0,\n onClick: () => onItemClick(item),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onItemClick(item);\n }\n },\n }\n : {})}\n >\n {columns.map((col) => (\n <td key={col.key} className=\"px-4 py-3 text-sm\">\n {col.render\n ? col.render(item[col.key], item)\n : String(item[col.key] ?? \"-\")}\n </td>\n ))}\n </tr>\n ))}\n {/* Empty rows to fill the last page for consistent pagination position */}\n {paginationEnabled &&\n paginatedData.length < pageSize &&\n paginatedData.length > 0 &&\n Array.from({ length: pageSize - paginatedData.length }).map(\n (_, index) => (\n <tr\n key={`empty-${index}`}\n className={`h-17 border-b ${innerBorder} last:border-none ${innerBg} ${alternatingColorEnabled ? `even:${innerBgAlt}` : \"\"}`}\n >\n {columns.map((col) => (\n <td key={col.key} className=\"px-4 py-3 text-sm\">\n &nbsp;\n </td>\n ))}\n </tr>\n ),\n )}\n </>\n )}\n </tbody>\n </table>\n </div>\n\n {/* Pagination */}\n {paginationEnabled && totalPages > 1 && (\n <div\n className={`flex flex-col items-center justify-between gap-2 border-t ${innerBorder} p-${padding} @md:flex-row ${paginationBg} text-${textColor}`}\n >\n <p className=\"text-sm\">\n Showing {(currentPage - 1) * pageSize + 1}-\n {Math.min(currentPage * pageSize, sortedData.length)} of{\" \"}\n {sortedData.length} results\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n onClick={() => setCurrentPage((p) => Math.max(1, p - 1))}\n disabled={currentPage === 1}\n className={`rounded-md border border-${headerBackgroundColor}-600 bg-${headerBackgroundColor} ring-offset-muted placeholder:text-muted-foreground focus-visible:ring-primary px-3 py-1 text-sm transition-opacity hover:opacity-80 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50`}\n >\n Previous\n </button>\n <span className=\"text-sm\">\n Page {currentPage} of {totalPages}\n </span>\n <button\n onClick={() => setCurrentPage((p) => Math.min(totalPages, p + 1))}\n disabled={currentPage === totalPages}\n className={`rounded-md border border-${headerBackgroundColor}-600 bg-${headerBackgroundColor} ring-offset-muted placeholder:text-muted-foreground focus-visible:ring-primary px-3 py-1 text-sm transition-opacity hover:opacity-80 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50`}\n >\n Next\n </button>\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport const tableWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"TableWidget\",\n displayName: \"Table Widget\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"behavior\", label: \"Behavior\" },\n { id: \"data\", label: \"Data\" },\n ],\n dataSourceTargetProps: [\"data\", \"columns\"],\n fields: [\n // Content Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the table\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the table\",\n defaultValue: \"Products\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n label: \"Title Font Size\",\n defaultValue: \"xl\",\n key: \"titleFontSize\",\n description: \"Font size for the widget title\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling Tab - Design Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the table container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"alternatingColorEnabled\",\n label: \"Enable Alternating Colors\",\n type: \"boolean\",\n description: \"Enable alternating colors for table rows\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"headerBackgroundColor\",\n label: \"Header Background\",\n description: \"Background color for the table header\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for table content\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"headerTextColor\",\n label: \"Header Text Color\",\n description: \"Text color for the table header\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the table container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the table container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n\n // Behavior Tab - Features Group\n {\n key: \"filterEnabled\",\n label: \"Enable Filters\",\n type: \"boolean\",\n description: \"Show global search and column filters\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Features\",\n },\n {\n key: \"sortingEnabled\",\n label: \"Enable Sorting\",\n type: \"boolean\",\n description: \"Allow sorting by clicking column headers\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Features\",\n },\n {\n key: \"paginationEnabled\",\n label: \"Enable Pagination\",\n type: \"boolean\",\n description: \"Split data into pages\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Features\",\n },\n {\n key: \"maxRowsPerPage\",\n label: \"Max Rows Per Page\",\n type: \"number\",\n description: \"Maximum number of rows to display per page\",\n min: 1,\n max: 50,\n step: 1,\n defaultValue: 5,\n tab: \"behavior\",\n group: \"Features\",\n requiresKeyToBeTrue: \"paginationEnabled\",\n },\n\n // Data Tab\n {\n key: \"dataSource\",\n label: \"Data Source\",\n type: \"dataSource\",\n description: \"Configure data source for the table\",\n tab: \"data\",\n group: \"Data Configuration\",\n },\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;AAyCA,MAAM,eAAgC,EAAE;AAMxC,SAAS,kBAAkB,QAAiB,MAAqB;AAC/D,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;YACb,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,eAAD,EAAe,GAAIC,sBAAAA,2BAA2B,KAAK,EAAI,CAAA;EACnD,CAAA;;AAIV,SAAS,kBAAkB,QAAiB,MAAqB;AAC/D,SAAS,KAAK,iBAA4B,KAAK,UAAU;;AAG3D,SAAS,mBAAmB,OAAgB;AAY1C,QACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;EACE,WAAW,0DAZ8B;GAC3C,QAAQ;GACR,MAAM;GACN,UAAU;GACV,QAAQ;GACR,SAAS;GACT,QAAQ;GACR,UAAU;GACV,WAAW;GACZ,CAVc,OAAO,SAAS,UAAU,CAAC,aAAa,KAa0C;YAE5F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,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;6DACkB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;6DACkB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EAGD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACR;EACF;CACF"}
@@ -3,5 +3,5 @@ require("./WidgetInteractionContext-ywxCBIMm.cjs");
3
3
  require("./fields-BCNGRVzZ.cjs");
4
4
  require("./src-CWGmmrLZ.cjs");
5
5
  require("./MediaRenderer-CEV-eeB-.cjs");
6
- const require_TableWidget = require("./TableWidget-D2QlWEXk.cjs");
6
+ const require_TableWidget = require("./TableWidget-DFWfQIWv.cjs");
7
7
  exports.tableWidgetPropertySchema = require_TableWidget.tableWidgetPropertySchema;
@@ -1,6 +1,6 @@
1
1
  import { n as __exportAll } from "./chunk-CRV2RMSr.mjs";
2
2
  import { t as useWidgetInteraction } from "./WidgetInteractionContext-DAN31Alw.mjs";
3
- import { a as getColorField, o as getFontSizeField, r as getBorderRadiusField, u as getPaddingField } from "./fields-DW1nDGRz.mjs";
3
+ import { i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./fields-CjDogNNF.mjs";
4
4
  import { I as Input } from "./src-BVkLGnwV.mjs";
5
5
  import { n as getMediaPropsFromShareable, t as MediaRenderer } from "./MediaRenderer-CI67k-ti.mjs";
6
6
  import { useMemo, useState } from "react";
@@ -81,7 +81,7 @@ const defaultColumns = [
81
81
  function TableWidget({ titleEnabled = true, titleText = "Products", titleFontSize = "xl", titleColor = "foreground", background = {
82
82
  type: "solid",
83
83
  color: "background"
84
- }, alternatingColorEnabled = true, textColor = "foreground", headerBackgroundColor = "muted", headerTextColor = "foreground", padding = 4, borderRadius = "md", data = DEFAULT_DATA, columns: columnsProp, filterEnabled = true, sortingEnabled = true, paginationEnabled = true, maxRowsPerPage = 5, className, ...props }) {
84
+ }, alternatingColorEnabled = true, textColor = "foreground", headerBackgroundColor = "muted", headerTextColor = "foreground", padding = 4, borderRadius = "md", borderWidth = "none", borderColor = "muted", data = DEFAULT_DATA, columns: columnsProp, filterEnabled = true, sortingEnabled = true, paginationEnabled = true, maxRowsPerPage = 5, className, ...props }) {
85
85
  const backgroundColor = background.color || "background";
86
86
  const isImageBackground = background.type === "image";
87
87
  const backgroundImage = (background.resource?.image_url || background.resource?.imageUrl) && isImageBackground ? `url(${background.resource.image_url || background.resource.imageUrl})` : "none";
@@ -165,7 +165,7 @@ function TableWidget({ titleEnabled = true, titleText = "Products", titleFontSiz
165
165
  };
166
166
  const { onItemClick } = useWidgetInteraction();
167
167
  return /* @__PURE__ */ jsxs("div", {
168
- className: `@container overflow-hidden ${paginationEnabled ? "" : "overflow-y-auto"} rounded-${borderRadius} bg-${backgroundColor} bg-cover bg-center text-${textColor} ${className}`,
168
+ className: `@container overflow-hidden ${paginationEnabled ? "" : "overflow-y-auto"} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? borderColorClasses[borderColor] : ""} bg-${backgroundColor} bg-cover bg-center text-${textColor} ${className}`,
169
169
  style: { backgroundImage },
170
170
  ...props,
171
171
  children: [
@@ -427,6 +427,22 @@ const tableWidgetPropertySchema = {
427
427
  tab: "styling",
428
428
  group: "Design"
429
429
  }),
430
+ getBorderWidthField({
431
+ key: "borderWidth",
432
+ label: "Border Width",
433
+ description: "Border width for the widget",
434
+ defaultValue: "none",
435
+ tab: "styling",
436
+ group: "Design"
437
+ }),
438
+ getBorderColorField({
439
+ key: "borderColor",
440
+ label: "Border Color",
441
+ description: "Border color for the widget",
442
+ defaultValue: "muted",
443
+ tab: "styling",
444
+ group: "Design"
445
+ }),
430
446
  {
431
447
  key: "filterEnabled",
432
448
  label: "Enable Filters",
@@ -480,4 +496,4 @@ const tableWidgetPropertySchema = {
480
496
  //#endregion
481
497
  export { TableWidget_exports as n, tableWidgetPropertySchema as r, TableWidget as t };
482
498
 
483
- //# sourceMappingURL=TableWidget-kq_rQCoV.mjs.map
499
+ //# sourceMappingURL=TableWidget-aZUcob2U.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableWidget-aZUcob2U.mjs","names":[],"sources":["../../widgets/src/widgets/TableWidget.tsx"],"sourcesContent":["import { useState, useMemo, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { Input } from \"@fluid-app/ui-primitives\";\nimport {\n MediaRenderer,\n getMediaPropsFromShareable,\n} from \"../components/MediaRenderer\";\nimport { type ShareableItem } from \"@fluid-app/portal-core/types\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\n\n/** Plain column definition provided by data sources (no render functions) */\nexport type TableColumnDef = {\n key: string;\n label: string;\n sortable: boolean;\n};\n\n// Internal column definition (includes render function)\ntype ColumnDef = TableColumnDef & {\n render?: (value: unknown, item: ShareableItem) => React.ReactNode;\n};\n\nconst DEFAULT_DATA: ShareableItem[] = [];\n\n// ---------------------------------------------------------------------------\n// Column cell renderers\n// ---------------------------------------------------------------------------\n\nfunction ImageCellRenderer(_value: unknown, item: ShareableItem) {\n return (\n <div className=\"h-10 w-10 rounded object-cover\">\n <MediaRenderer {...getMediaPropsFromShareable(item)} />\n </div>\n );\n}\n\nfunction PriceCellRenderer(_value: unknown, item: ShareableItem) {\n return ((item.display_price as string) ?? item.price) || \"-\";\n}\n\nfunction StatusCellRenderer(value: unknown) {\n const status = String(value || \"unknown\").toLowerCase();\n const statusStyles: Record<string, string> = {\n active: \"bg-primary text-primary-foreground\",\n paid: \"bg-primary text-primary-foreground\",\n inactive: \"bg-secondary text-secondary-foreground\",\n paused: \"bg-secondary text-secondary-foreground\",\n unknown: \"bg-muted text-muted-foreground\",\n unpaid: \"bg-destructive text-destructive-foreground\",\n refunded: \"bg-muted text-muted-foreground\",\n cancelled: \"bg-destructive text-destructive-foreground\",\n };\n return (\n <span\n className={`inline-flex rounded-full px-2 py-1 text-xs font-medium ${statusStyles[status] || \"bg-muted text-foreground\"}`}\n >\n {String(value || \"Unknown\")}\n </span>\n );\n}\n\n/** Map of column keys to custom cell renderers */\nconst CELL_RENDERERS: Record<\n string,\n (value: unknown, item: ShareableItem) => React.ReactNode\n> = {\n imageUrl: ImageCellRenderer,\n price: PriceCellRenderer,\n display_price: PriceCellRenderer,\n status: StatusCellRenderer,\n};\n\n/** Resolve plain column definitions from a data source into full ColumnDefs with renderers */\nfunction resolveColumns(columns: TableColumnDef[]): ColumnDef[] {\n return columns.map((col) => {\n const render = CELL_RENDERERS[col.key];\n return render ? { ...col, render } : { ...col };\n });\n}\n\n// Default columns for product data\nconst defaultColumns: ColumnDef[] = [\n {\n key: \"imageUrl\",\n label: \"Image\",\n sortable: false,\n render: ImageCellRenderer,\n },\n {\n key: \"title\",\n label: \"Title\",\n sortable: true,\n },\n {\n key: \"price\",\n label: \"Price\",\n sortable: true,\n render: PriceCellRenderer,\n },\n {\n key: \"status\",\n label: \"Status\",\n sortable: true,\n render: StatusCellRenderer,\n },\n];\n\ntype TableWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Styling\n background?: BackgroundValue;\n alternatingColorEnabled?: boolean;\n textColor?: ColorOptions;\n headerBackgroundColor?: ColorOptions;\n headerTextColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Data\n data?: ShareableItem[];\n /** Column definitions from a data source (plain data, renderers resolved internally) */\n columns?: TableColumnDef[];\n\n // Features\n filterEnabled?: boolean;\n sortingEnabled?: boolean;\n paginationEnabled?: boolean;\n maxRowsPerPage?: number;\n};\n\nexport function TableWidget({\n // Title defaults\n titleEnabled = true,\n titleText = \"Products\",\n titleFontSize = \"xl\",\n titleColor = \"foreground\",\n\n // Styling defaults\n background = {\n type: \"solid\",\n color: \"background\",\n },\n alternatingColorEnabled = true,\n textColor = \"foreground\",\n headerBackgroundColor = \"muted\",\n headerTextColor = \"foreground\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n // Data\n data = DEFAULT_DATA,\n columns: columnsProp,\n\n // Feature defaults\n filterEnabled = true,\n sortingEnabled = true,\n paginationEnabled = true,\n maxRowsPerPage = 5,\n\n className,\n ...props\n}: TableWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const isImageBackground = background.type === \"image\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n isImageBackground\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n const pageSize = maxRowsPerPage;\n\n // When using an image or transparent background, inner elements should be\n // transparent so the image/page shows through. Otherwise use the configured colors.\n const isTransparentBg = backgroundColor === \"transparent\";\n const useTransparentInner = isImageBackground || isTransparentBg;\n const innerBg = useTransparentInner\n ? \"bg-transparent\"\n : `bg-${backgroundColor}`;\n const innerBgAlt = useTransparentInner\n ? \"bg-black/5\"\n : `bg-${backgroundColor}-400`;\n const transparentBorder = isTransparentBg\n ? \"border-black/20\"\n : \"border-white/20\";\n const innerBorder = useTransparentInner\n ? transparentBorder\n : `border-${backgroundColor}-600`;\n const headerBg = useTransparentInner\n ? \"bg-black/10\"\n : `bg-${headerBackgroundColor}-400`;\n const headerBorder = useTransparentInner\n ? transparentBorder\n : `border-${headerBackgroundColor}-600`;\n const paginationBg = useTransparentInner\n ? \"bg-black/10\"\n : `bg-${backgroundColor}-400`;\n\n // State for filtering, sorting, and pagination\n const [globalFilter, setGlobalFilter] = useState(\"\");\n const [sortConfig, setSortConfig] = useState<{\n key: string;\n direction: \"asc\" | \"desc\";\n } | null>(null);\n const [currentPage, setCurrentPage] = useState(1);\n\n // Only use columns from the data source if they look like valid column defs\n // (have a `key` string). When transformers return a plain array (e.g. toShareableProps),\n // use-widget-data maps the same array to ALL targetProps, so `columns` may\n // receive the data rows instead of column definitions.\n const firstCol = columnsProp?.[0];\n const validColumnsProp =\n firstCol && typeof firstCol.key === \"string\" && firstCol.key !== \"\"\n ? columnsProp\n : undefined;\n\n const columns = useMemo(\n () =>\n validColumnsProp ? resolveColumns(validColumnsProp) : defaultColumns,\n [validColumnsProp],\n );\n\n // Filter data\n const filteredData = useMemo(() => {\n let result = [...data];\n\n if (globalFilter) {\n const lowerFilter = globalFilter.toLowerCase();\n result = result.filter((item) =>\n columns.some((col) => {\n const value = item[col.key];\n return String(value ?? \"\")\n .toLowerCase()\n .includes(lowerFilter);\n }),\n );\n }\n\n return result;\n }, [data, globalFilter, columns]);\n\n // Sort data\n const sortedData = useMemo(() => {\n if (!sortConfig) return filteredData;\n\n return [...filteredData].sort((a, b) => {\n const aValue = a[sortConfig.key];\n const bValue = b[sortConfig.key];\n\n // Handle null/undefined\n if (aValue == null && bValue == null) return 0;\n if (aValue == null) return sortConfig.direction === \"asc\" ? 1 : -1;\n if (bValue == null) return sortConfig.direction === \"asc\" ? -1 : 1;\n\n // Compare values\n let comparison = 0;\n if (typeof aValue === \"number\" && typeof bValue === \"number\") {\n comparison = aValue - bValue;\n } else {\n comparison = String(aValue).localeCompare(String(bValue));\n }\n\n return sortConfig.direction === \"asc\" ? comparison : -comparison;\n });\n }, [filteredData, sortConfig]);\n\n // Paginate data\n const paginatedData = useMemo(() => {\n if (!paginationEnabled) return sortedData;\n\n const startIndex = (currentPage - 1) * pageSize;\n return sortedData.slice(startIndex, startIndex + pageSize);\n }, [sortedData, currentPage, pageSize, paginationEnabled]);\n\n const totalPages = Math.ceil(sortedData.length / pageSize);\n\n // Reset to page 1 when filters change\n const handleGlobalFilterChange = (value: string) => {\n setGlobalFilter(value);\n setCurrentPage(1);\n };\n\n // Handle sort\n const handleSort = (key: string) => {\n if (!sortingEnabled) return;\n\n setSortConfig((prev) => {\n if (prev?.key !== key) return { key, direction: \"asc\" };\n if (prev.direction === \"asc\") return { key, direction: \"desc\" };\n return null;\n });\n };\n\n // Get sort indicator\n const getSortIndicator = (key: string) => {\n if (sortConfig?.key !== key) return null;\n return sortConfig.direction === \"asc\" ? \" ↑\" : \" ↓\";\n };\n\n const { onItemClick } = useWidgetInteraction();\n\n return (\n <div\n className={`@container overflow-hidden ${paginationEnabled ? \"\" : \"overflow-y-auto\"} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-${backgroundColor} bg-cover bg-center text-${textColor} ${className}`}\n style={{ backgroundImage }}\n {...props}\n >\n <div\n className={`flex items-center justify-between p-${padding} ${innerBg} space-x-2`}\n >\n {/* Title */}\n {titleEnabled && titleText && (\n <h2\n className={`text-${titleFontSize === \"md\" ? \"base\" : titleFontSize} font-header font-bold text-${titleColor} min-w-0 truncate`}\n >\n {titleText}\n </h2>\n )}\n\n {/* Global Search */}\n {filterEnabled && (\n <Input\n type=\"text\"\n placeholder=\"Search all columns...\"\n value={globalFilter}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n handleGlobalFilterChange(e.target.value)\n }\n className={`w-full rounded-md border ${headerBorder} ${headerBg} ring-offset-muted px-3 py-2 text-sm placeholder:text-${headerTextColor}-400 focus-visible:ring-primary focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none md:w-64`}\n />\n )}\n </div>\n\n {/* Table */}\n <div className=\"overflow-x-auto\">\n <table className=\"w-full border-collapse\">\n <thead>\n <tr className={`${headerBg} ${headerBorder} border-y`}>\n {columns.map((col) => (\n <th\n key={col.key}\n className={`px-4 py-3 text-left text-sm font-semibold text-${headerTextColor} ${col.sortable && sortingEnabled ? \"cursor-pointer select-none hover:opacity-80\" : \"\"}`}\n {...(col.sortable && sortingEnabled\n ? {\n role: \"button\" as const,\n tabIndex: 0,\n onClick: () => handleSort(col.key),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n handleSort(col.key);\n }\n },\n }\n : {})}\n >\n <div className=\"flex flex-col gap-1\">\n <span>\n {col.label}\n {col.sortable &&\n sortingEnabled &&\n getSortIndicator(col.key)}\n </span>\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {data.length === 0 ? (\n <tr>\n <td colSpan={columns.length}>\n <div className=\"text-muted-foreground flex min-h-[200px] flex-col items-center justify-center gap-2\">\n <div className=\"text-4xl\">📋</div>\n <p className=\"text-sm\">No data available</p>\n <p className=\"text-muted-foreground/70 text-xs\">\n Connect a data source to display table data\n </p>\n </div>\n </td>\n </tr>\n ) : paginatedData.length === 0 ? (\n <tr>\n <td colSpan={columns.length}>\n <div className=\"py-8 text-center\">\n <p className=\"text-sm\">No results found</p>\n <p className=\"text-xs\">Try adjusting your search</p>\n </div>\n </td>\n </tr>\n ) : (\n <>\n {paginatedData.map((item, index) => (\n <tr\n key={item.id ?? index}\n className={`h-17 border-b ${innerBorder} last:border-none ${innerBg} ${alternatingColorEnabled ? `even:${innerBgAlt}` : \"\"} ${onItemClick ? \"cursor-pointer hover:opacity-80\" : \"\"}`}\n {...(onItemClick\n ? {\n tabIndex: 0,\n onClick: () => onItemClick(item),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onItemClick(item);\n }\n },\n }\n : {})}\n >\n {columns.map((col) => (\n <td key={col.key} className=\"px-4 py-3 text-sm\">\n {col.render\n ? col.render(item[col.key], item)\n : String(item[col.key] ?? \"-\")}\n </td>\n ))}\n </tr>\n ))}\n {/* Empty rows to fill the last page for consistent pagination position */}\n {paginationEnabled &&\n paginatedData.length < pageSize &&\n paginatedData.length > 0 &&\n Array.from({ length: pageSize - paginatedData.length }).map(\n (_, index) => (\n <tr\n key={`empty-${index}`}\n className={`h-17 border-b ${innerBorder} last:border-none ${innerBg} ${alternatingColorEnabled ? `even:${innerBgAlt}` : \"\"}`}\n >\n {columns.map((col) => (\n <td key={col.key} className=\"px-4 py-3 text-sm\">\n &nbsp;\n </td>\n ))}\n </tr>\n ),\n )}\n </>\n )}\n </tbody>\n </table>\n </div>\n\n {/* Pagination */}\n {paginationEnabled && totalPages > 1 && (\n <div\n className={`flex flex-col items-center justify-between gap-2 border-t ${innerBorder} p-${padding} @md:flex-row ${paginationBg} text-${textColor}`}\n >\n <p className=\"text-sm\">\n Showing {(currentPage - 1) * pageSize + 1}-\n {Math.min(currentPage * pageSize, sortedData.length)} of{\" \"}\n {sortedData.length} results\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n onClick={() => setCurrentPage((p) => Math.max(1, p - 1))}\n disabled={currentPage === 1}\n className={`rounded-md border border-${headerBackgroundColor}-600 bg-${headerBackgroundColor} ring-offset-muted placeholder:text-muted-foreground focus-visible:ring-primary px-3 py-1 text-sm transition-opacity hover:opacity-80 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50`}\n >\n Previous\n </button>\n <span className=\"text-sm\">\n Page {currentPage} of {totalPages}\n </span>\n <button\n onClick={() => setCurrentPage((p) => Math.min(totalPages, p + 1))}\n disabled={currentPage === totalPages}\n className={`rounded-md border border-${headerBackgroundColor}-600 bg-${headerBackgroundColor} ring-offset-muted placeholder:text-muted-foreground focus-visible:ring-primary px-3 py-1 text-sm transition-opacity hover:opacity-80 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50`}\n >\n Next\n </button>\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport const tableWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"TableWidget\",\n displayName: \"Table Widget\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"behavior\", label: \"Behavior\" },\n { id: \"data\", label: \"Data\" },\n ],\n dataSourceTargetProps: [\"data\", \"columns\"],\n fields: [\n // Content Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the table\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the table\",\n defaultValue: \"Products\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n label: \"Title Font Size\",\n defaultValue: \"xl\",\n key: \"titleFontSize\",\n description: \"Font size for the widget title\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling Tab - Design Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the table container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"alternatingColorEnabled\",\n label: \"Enable Alternating Colors\",\n type: \"boolean\",\n description: \"Enable alternating colors for table rows\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"headerBackgroundColor\",\n label: \"Header Background\",\n description: \"Background color for the table header\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for table content\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"headerTextColor\",\n label: \"Header Text Color\",\n description: \"Text color for the table header\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the table container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the table container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n\n // Behavior Tab - Features Group\n {\n key: \"filterEnabled\",\n label: \"Enable Filters\",\n type: \"boolean\",\n description: \"Show global search and column filters\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Features\",\n },\n {\n key: \"sortingEnabled\",\n label: \"Enable Sorting\",\n type: \"boolean\",\n description: \"Allow sorting by clicking column headers\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Features\",\n },\n {\n key: \"paginationEnabled\",\n label: \"Enable Pagination\",\n type: \"boolean\",\n description: \"Split data into pages\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Features\",\n },\n {\n key: \"maxRowsPerPage\",\n label: \"Max Rows Per Page\",\n type: \"number\",\n description: \"Maximum number of rows to display per page\",\n min: 1,\n max: 50,\n step: 1,\n defaultValue: 5,\n tab: \"behavior\",\n group: \"Features\",\n requiresKeyToBeTrue: \"paginationEnabled\",\n },\n\n // Data Tab\n {\n key: \"dataSource\",\n label: \"Data Source\",\n type: \"dataSource\",\n description: \"Configure data source for the table\",\n tab: \"data\",\n group: \"Data Configuration\",\n },\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;AAyCA,MAAM,eAAgC,EAAE;AAMxC,SAAS,kBAAkB,QAAiB,MAAqB;AAC/D,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,eAAD,EAAe,GAAI,2BAA2B,KAAK,EAAI,CAAA;EACnD,CAAA;;AAIV,SAAS,kBAAkB,QAAiB,MAAqB;AAC/D,SAAS,KAAK,iBAA4B,KAAK,UAAU;;AAG3D,SAAS,mBAAmB,OAAgB;AAY1C,QACE,oBAAC,QAAD;EACE,WAAW,0DAZ8B;GAC3C,QAAQ;GACR,MAAM;GACN,UAAU;GACV,QAAQ;GACR,SAAS;GACT,QAAQ;GACR,UAAU;GACV,WAAW;GACZ,CAVc,OAAO,SAAS,UAAU,CAAC,aAAa,KAa0C;YAE5F,OAAO,SAAS,UAAU;EACtB,CAAA;;;AAKX,MAAM,iBAGF;CACF,UAAU;CACV,OAAO;CACP,eAAe;CACf,QAAQ;CACT;;AAGD,SAAS,eAAe,SAAwC;AAC9D,QAAO,QAAQ,KAAK,QAAQ;EAC1B,MAAM,SAAS,eAAe,IAAI;AAClC,SAAO,SAAS;GAAE,GAAG;GAAK;GAAQ,GAAG,EAAE,GAAG,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ACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EAGD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACR;EACF;CACF"}
@@ -1,5 +1,5 @@
1
1
  import { n as __exportAll } from "./chunk-CRV2RMSr.mjs";
2
- import { a as getColorField, o as getFontSizeField, r as getBorderRadiusField, s as getFontWeightField, u as getPaddingField } from "./fields-DW1nDGRz.mjs";
2
+ import { d as getFontWeightField, i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./fields-CjDogNNF.mjs";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region ../widgets/src/widgets/TextWidget.tsx
5
5
  var TextWidget_exports = /* @__PURE__ */ __exportAll({
@@ -14,11 +14,11 @@ const textAlignmentClasses = {
14
14
  function TextWidget({ titleEnabled = true, title = "Text Widget", titleFontSize = "xl", titleFontWeight = "bold", titleColor = "foreground", titleAlignment = "left", description = "This is a text widget", descriptionFontSize = "md", descriptionFontWeight = "normal", descriptionColor = "foreground", descriptionAlignment = "left", background = {
15
15
  type: "solid",
16
16
  color: "background"
17
- }, padding = 4, borderRadius = "md", className, ...props }) {
17
+ }, padding = 4, borderRadius = "md", borderWidth = "none", borderColor = "muted", className, ...props }) {
18
18
  const backgroundColor = background.color || "background";
19
19
  const backgroundImage = (background.resource?.image_url || background.resource?.imageUrl) && background.type === "image" ? `url(${background.resource.image_url || background.resource.imageUrl})` : "none";
20
20
  return /* @__PURE__ */ jsxs("div", {
21
- className: `bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${className ?? ""}`,
21
+ className: `bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? borderColorClasses[borderColor] : ""} ${className ?? ""}`,
22
22
  style: { backgroundImage },
23
23
  ...props,
24
24
  children: [titleEnabled && /* @__PURE__ */ jsx("h2", {
@@ -188,11 +188,27 @@ const textWidgetPropertySchema = {
188
188
  description: "The border radius of the text container",
189
189
  label: "Border Radius",
190
190
  tab: "content",
191
- group: "Style"
191
+ group: "Design"
192
+ }),
193
+ getBorderWidthField({
194
+ key: "borderWidth",
195
+ label: "Border Width",
196
+ description: "The border width of the text container",
197
+ defaultValue: "none",
198
+ tab: "content",
199
+ group: "Design"
200
+ }),
201
+ getBorderColorField({
202
+ key: "borderColor",
203
+ label: "Border Color",
204
+ description: "The border color of the text container",
205
+ defaultValue: "muted",
206
+ tab: "content",
207
+ group: "Design"
192
208
  })
193
209
  ]
194
210
  };
195
211
  //#endregion
196
212
  export { TextWidget_exports as n, textWidgetPropertySchema as r, TextWidget as t };
197
213
 
198
- //# sourceMappingURL=TextWidget-Cmu4a9QG.mjs.map
214
+ //# sourceMappingURL=TextWidget-D6qCnspg.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextWidget-D6qCnspg.mjs","names":[],"sources":["../../widgets/src/widgets/TextWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getFontWeightField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n FontWeightOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\n\ntype TextAlignment = \"left\" | \"center\" | \"right\";\n\nconst textAlignmentClasses: Record<TextAlignment, string> = {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n} as const;\n\ntype TextWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n title?: string;\n titleFontSize?: FontSizeOptions;\n titleFontWeight?: FontWeightOptions;\n titleColor?: ColorOptions;\n titleAlignment?: TextAlignment;\n\n // Description\n description?: string;\n descriptionFontSize?: FontSizeOptions;\n descriptionFontWeight?: FontWeightOptions;\n descriptionColor?: ColorOptions;\n descriptionAlignment?: TextAlignment;\n\n // Styling\n background?: BackgroundValue;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n};\n\nexport function TextWidget({\n titleEnabled = true,\n title = \"Text Widget\",\n titleFontSize = \"xl\",\n titleFontWeight = \"bold\",\n titleColor = \"foreground\",\n titleAlignment = \"left\",\n description = \"This is a text widget\",\n descriptionFontSize = \"md\",\n descriptionFontWeight = \"normal\",\n descriptionColor = \"foreground\",\n descriptionAlignment = \"left\",\n background = {\n type: \"solid\",\n color: \"background\",\n },\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n className,\n ...props\n}: TextWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n return (\n <div\n className={`bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {titleEnabled && (\n <h2\n className={`text-${titleFontSize} text-${titleColor} ${textAlignmentClasses[titleAlignment]} font-header font-${titleFontWeight}`}\n >\n {title}\n </h2>\n )}\n <p\n className={`text-${descriptionFontSize} text-${descriptionColor} ${textAlignmentClasses[descriptionAlignment]} font-${descriptionFontWeight}`}\n >\n {description}\n </p>\n </div>\n );\n}\n\nexport const textWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"TextWidget\",\n displayName: \"Text Widget\",\n tabsConfig: [{ id: \"content\", label: \"Content\" }],\n dataSourceTargetProps: [\"title\", \"description\"],\n fields: [\n // Content Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the text\",\n defaultValue: true,\n tab: \"content\",\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"The title\",\n defaultValue: \"Heads up!\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the title\",\n defaultValue: \"xl\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getFontWeightField({\n key: \"titleFontWeight\",\n label: \"Title Font Weight\",\n description: \"Font weight for the title\",\n defaultValue: \"bold\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"The color of the title\",\n defaultValue: \"foreground\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n {\n key: \"titleAlignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Text alignment for the title\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"left\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n // Content Tab - Description Group\n {\n key: \"description\",\n label: \"Description\",\n type: \"textarea\",\n description: \"The text message\",\n rows: 3,\n defaultValue:\n \"You can add components and dependencies to your app using the cli.\",\n tab: \"content\",\n group: \"Description\",\n },\n getFontSizeField({\n key: \"descriptionFontSize\",\n label: \"Description Font Size\",\n description: \"Font size for the text\",\n defaultValue: \"md\",\n tab: \"content\",\n group: \"Description\",\n }),\n getFontWeightField({\n key: \"descriptionFontWeight\",\n label: \"Description Font Weight\",\n description: \"Font weight for the text\",\n defaultValue: \"normal\",\n tab: \"content\",\n group: \"Description\",\n }),\n getColorField({\n key: \"descriptionColor\",\n label: \"Description Color\",\n description: \"The color of the text\",\n defaultValue: \"foreground\",\n tab: \"content\",\n group: \"Description\",\n }),\n {\n key: \"descriptionAlignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Text alignment for the description\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"left\",\n tab: \"content\",\n group: \"Description\",\n },\n // Content Tab - Style Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the text container\",\n defaultValue: \"background\",\n tab: \"content\",\n group: \"Style\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"The padding of the text container\",\n defaultValue: 4,\n tab: \"content\",\n group: \"Style\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n description: \"The border radius of the text container\",\n label: \"Border Radius\",\n tab: \"content\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"The border width of the text container\",\n defaultValue: \"none\",\n tab: \"content\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"The border color of the text container\",\n defaultValue: \"muted\",\n tab: \"content\",\n group: \"Design\",\n }),\n ],\n};\n"],"mappings":";;;;;;;;AA0BA,MAAM,uBAAsD;CAC1D,MAAM;CACN,QAAQ;CACR,OAAO;CACR;AA0BD,SAAgB,WAAW,EACzB,eAAe,MACf,QAAQ,eACR,gBAAgB,MAChB,kBAAkB,QAClB,aAAa,cACb,iBAAiB,QACjB,cAAc,yBACd,sBAAsB,MACtB,wBAAwB,UACxB,mBAAmB,cACnB,uBAAuB,QACvB,aAAa;CACX,MAAM;CACN,OAAO;CACR,EACD,UAAU,GACV,eAAe,MACf,cAAc,QACd,cAAc,SACd,WACA,GAAG,SACkC;CACrC,MAAM,kBAAkB,WAAW,SAAS;CAC5C,MAAM,mBACH,WAAW,UAAU,aAAa,WAAW,UAAU,aACxD,WAAW,SAAS,UAChB,OAAO,WAAW,SAAS,aAAa,WAAW,SAAS,SAAS,KACrE;AACN,QACE,qBAAC,OAAD;EACE,WAAW,MAAM,gBAAgB,KAAK,QAAQ,WAAW,aAAa,GAAG,mBAAmB,aAAa,GAAG,gBAAgB,SAAS,mBAAmB,eAAe,GAAG,GAAG,aAAa;EAC1L,OAAO,EAAE,iBAAiB;EAC1B,GAAI;YAHN,CAKG,gBACC,oBAAC,MAAD;GACE,WAAW,QAAQ,cAAc,QAAQ,WAAW,GAAG,qBAAqB,gB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AAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;IACP;KAAE,OAAO;KAAQ,OAAO;KAAQ;IAChC;KAAE,OAAO;KAAU,OAAO;KAAU;IACpC;KAAE,OAAO;KAAS,OAAO;KAAS;IACnC;GACD,cAAc;GACd,KAAK;GACL,OAAO;GACR;EAED;GACE,MAAM;GACN,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,aAAa;GACb,OAAO;GACP,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
@@ -14,11 +14,11 @@ const textAlignmentClasses = {
14
14
  function TextWidget({ titleEnabled = true, title = "Text Widget", titleFontSize = "xl", titleFontWeight = "bold", titleColor = "foreground", titleAlignment = "left", description = "This is a text widget", descriptionFontSize = "md", descriptionFontWeight = "normal", descriptionColor = "foreground", descriptionAlignment = "left", background = {
15
15
  type: "solid",
16
16
  color: "background"
17
- }, padding = 4, borderRadius = "md", className, ...props }) {
17
+ }, padding = 4, borderRadius = "md", borderWidth = "none", borderColor = "muted", className, ...props }) {
18
18
  const backgroundColor = background.color || "background";
19
19
  const backgroundImage = (background.resource?.image_url || background.resource?.imageUrl) && background.type === "image" ? `url(${background.resource.image_url || background.resource.imageUrl})` : "none";
20
20
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21
- className: `bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${className ?? ""}`,
21
+ className: `bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${_fluid_app_portal_core_registries.borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? _fluid_app_portal_core_registries.borderColorClasses[borderColor] : ""} ${className ?? ""}`,
22
22
  style: { backgroundImage },
23
23
  ...props,
24
24
  children: [titleEnabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
@@ -188,7 +188,23 @@ const textWidgetPropertySchema = {
188
188
  description: "The border radius of the text container",
189
189
  label: "Border Radius",
190
190
  tab: "content",
191
- group: "Style"
191
+ group: "Design"
192
+ }),
193
+ (0, _fluid_app_portal_core_registries.getBorderWidthField)({
194
+ key: "borderWidth",
195
+ label: "Border Width",
196
+ description: "The border width of the text container",
197
+ defaultValue: "none",
198
+ tab: "content",
199
+ group: "Design"
200
+ }),
201
+ (0, _fluid_app_portal_core_registries.getBorderColorField)({
202
+ key: "borderColor",
203
+ label: "Border Color",
204
+ description: "The border color of the text container",
205
+ defaultValue: "muted",
206
+ tab: "content",
207
+ group: "Design"
192
208
  })
193
209
  ]
194
210
  };
@@ -212,4 +228,4 @@ Object.defineProperty(exports, "textWidgetPropertySchema", {
212
228
  }
213
229
  });
214
230
 
215
- //# sourceMappingURL=TextWidget-Bd8V3uOT.cjs.map
231
+ //# sourceMappingURL=TextWidget-XBeVX2oM.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextWidget-XBeVX2oM.cjs","names":["borderWidthClasses","borderColorClasses"],"sources":["../../widgets/src/widgets/TextWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getFontWeightField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n FontWeightOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\n\ntype TextAlignment = \"left\" | \"center\" | \"right\";\n\nconst textAlignmentClasses: Record<TextAlignment, string> = {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n} as const;\n\ntype TextWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n title?: string;\n titleFontSize?: FontSizeOptions;\n titleFontWeight?: FontWeightOptions;\n titleColor?: ColorOptions;\n titleAlignment?: TextAlignment;\n\n // Description\n description?: string;\n descriptionFontSize?: FontSizeOptions;\n descriptionFontWeight?: FontWeightOptions;\n descriptionColor?: ColorOptions;\n descriptionAlignment?: TextAlignment;\n\n // Styling\n background?: BackgroundValue;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n};\n\nexport function TextWidget({\n titleEnabled = true,\n title = \"Text Widget\",\n titleFontSize = \"xl\",\n titleFontWeight = \"bold\",\n titleColor = \"foreground\",\n titleAlignment = \"left\",\n description = \"This is a text widget\",\n descriptionFontSize = \"md\",\n descriptionFontWeight = \"normal\",\n descriptionColor = \"foreground\",\n descriptionAlignment = \"left\",\n background = {\n type: \"solid\",\n color: \"background\",\n },\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n className,\n ...props\n}: TextWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n return (\n <div\n className={`bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {titleEnabled && (\n <h2\n className={`text-${titleFontSize} text-${titleColor} ${textAlignmentClasses[titleAlignment]} font-header font-${titleFontWeight}`}\n >\n {title}\n </h2>\n )}\n <p\n className={`text-${descriptionFontSize} text-${descriptionColor} ${textAlignmentClasses[descriptionAlignment]} font-${descriptionFontWeight}`}\n >\n {description}\n </p>\n </div>\n );\n}\n\nexport const textWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"TextWidget\",\n displayName: \"Text Widget\",\n tabsConfig: [{ id: \"content\", label: \"Content\" }],\n dataSourceTargetProps: [\"title\", \"description\"],\n fields: [\n // Content Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the text\",\n defaultValue: true,\n tab: \"content\",\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"The title\",\n defaultValue: \"Heads up!\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the title\",\n defaultValue: \"xl\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getFontWeightField({\n key: \"titleFontWeight\",\n label: \"Title Font Weight\",\n description: \"Font weight for the title\",\n defaultValue: \"bold\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"The color of the title\",\n defaultValue: \"foreground\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n {\n key: \"titleAlignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Text alignment for the title\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"left\",\n tab: \"content\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n // Content Tab - Description Group\n {\n key: \"description\",\n label: \"Description\",\n type: \"textarea\",\n description: \"The text message\",\n rows: 3,\n defaultValue:\n \"You can add components and dependencies to your app using the cli.\",\n tab: \"content\",\n group: \"Description\",\n },\n getFontSizeField({\n key: \"descriptionFontSize\",\n label: \"Description Font Size\",\n description: \"Font size for the text\",\n defaultValue: \"md\",\n tab: \"content\",\n group: \"Description\",\n }),\n getFontWeightField({\n key: \"descriptionFontWeight\",\n label: \"Description Font Weight\",\n description: \"Font weight for the text\",\n defaultValue: \"normal\",\n tab: \"content\",\n group: \"Description\",\n }),\n getColorField({\n key: \"descriptionColor\",\n label: \"Description Color\",\n description: \"The color of the text\",\n defaultValue: \"foreground\",\n tab: \"content\",\n group: \"Description\",\n }),\n {\n key: \"descriptionAlignment\",\n label: \"Alignment\",\n type: \"buttonGroup\",\n description: \"Text alignment for the description\",\n options: [\n { label: \"Left\", value: \"left\" },\n { label: \"Center\", value: \"center\" },\n { label: \"Right\", value: \"right\" },\n ],\n defaultValue: \"left\",\n tab: \"content\",\n group: \"Description\",\n },\n // Content Tab - Style Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the text container\",\n defaultValue: \"background\",\n tab: \"content\",\n group: \"Style\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"The padding of the text container\",\n defaultValue: 4,\n tab: \"content\",\n group: \"Style\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n description: \"The border radius of the text container\",\n label: \"Border Radius\",\n tab: \"content\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"The border width of the text container\",\n defaultValue: \"none\",\n tab: \"content\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"The border color of the text container\",\n defaultValue: \"muted\",\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;GACN,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;yDACe;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;8DACmB;GACnB,KAAK;GACL,aAAa;GACb,OAAO;GACP,KAAK;GACL,OAAO;GACR,CAAC;6DACkB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;6DACkB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
@@ -83,7 +83,7 @@ var ToDoWidget_exports = /* @__PURE__ */ require_chunk.__exportAll({
83
83
  function ToDoWidget({ titleEnabled = true, titleText = "To-Do", titleFontSize = "lg", titleColor = "foreground", background = {
84
84
  type: "solid",
85
85
  color: "background"
86
- }, textColor = "foreground", accentColor = "primary", padding = 4, borderRadius = "md", maxItems = 5, className, ...props }) {
86
+ }, textColor = "foreground", accentColor = "primary", padding = 4, borderRadius = "md", borderWidth = "none", borderColor = "muted", maxItems = 5, className, ...props }) {
87
87
  const backgroundColor = background.color || "background";
88
88
  const backgroundImage = (background.resource?.image_url || background.resource?.imageUrl) && background.type === "image" ? `url(${background.resource.image_url || background.resource.imageUrl})` : "none";
89
89
  const { data: todos = [], isLoading, isError } = useTodos();
@@ -92,7 +92,7 @@ function ToDoWidget({ titleEnabled = true, titleText = "To-Do", titleFontSize =
92
92
  const remainingCount = activeTodos.length - todosToShow.length;
93
93
  const isEmpty = activeTodos.length === 0;
94
94
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
95
- className: `overflow-hidden rounded-${borderRadius} bg-${backgroundColor} text-${textColor} p-${padding} ${className ?? ""}`,
95
+ className: `overflow-hidden rounded-${borderRadius} ${_fluid_app_portal_core_registries.borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? _fluid_app_portal_core_registries.borderColorClasses[borderColor] : ""} bg-${backgroundColor} text-${textColor} p-${padding} ${className ?? ""}`,
96
96
  style: { backgroundImage },
97
97
  ...props,
98
98
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -256,6 +256,22 @@ const toDoWidgetPropertySchema = {
256
256
  defaultValue: "md",
257
257
  tab: "styling",
258
258
  group: "Design"
259
+ }),
260
+ (0, _fluid_app_portal_core_registries.getBorderWidthField)({
261
+ key: "borderWidth",
262
+ label: "Border Width",
263
+ description: "Border width for the widget",
264
+ defaultValue: "none",
265
+ tab: "styling",
266
+ group: "Design"
267
+ }),
268
+ (0, _fluid_app_portal_core_registries.getBorderColorField)({
269
+ key: "borderColor",
270
+ label: "Border Color",
271
+ description: "Border color for the widget",
272
+ defaultValue: "muted",
273
+ tab: "styling",
274
+ group: "Design"
259
275
  })
260
276
  ]
261
277
  };
@@ -279,4 +295,4 @@ Object.defineProperty(exports, "toDoWidgetPropertySchema", {
279
295
  }
280
296
  });
281
297
 
282
- //# sourceMappingURL=ToDoWidget-BTq8QL4U.cjs.map
298
+ //# sourceMappingURL=ToDoWidget-GmeRwP_0.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToDoWidget-GmeRwP_0.cjs","names":["useDataSourceConfig","useWidgetPreviewContext","borderWidthClasses","borderColorClasses","ListChecks","ErrorState","Plus"],"sources":["../../widgets/src/hooks/use-todos.preview.ts","../../widgets/src/hooks/use-todos.ts","../../widgets/src/widgets/ToDoWidget.tsx"],"sourcesContent":["import type { Todo } from \"./use-todos.types\";\n\nconst now = new Date();\n\nfunction daysFromNow(days: number): string {\n const d = new Date(now);\n d.setDate(d.getDate() + days);\n return d.toISOString();\n}\n\nexport const PREVIEW_DATA: Todo[] = [\n {\n id: 1,\n body: \"Send follow-up email to new leads\",\n dueAt: daysFromNow(1),\n completedAt: null,\n createdAt: daysFromNow(-2),\n contactName: \"Sarah Johnson\",\n },\n {\n id: 2,\n body: \"Prepare slides for team training\",\n dueAt: daysFromNow(3),\n completedAt: null,\n createdAt: daysFromNow(-1),\n contactName: null,\n },\n {\n id: 3,\n body: \"Review monthly sales report\",\n dueAt: daysFromNow(-1),\n completedAt: null,\n createdAt: daysFromNow(-5),\n contactName: \"Mike Chen\",\n },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useDataSourceConfig } from \"@fluid-app/portal-react/data-sources/context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { PREVIEW_DATA } from \"./use-todos.preview\";\nimport type { ApiTodo, Todo } from \"./use-todos.types\";\n\nexport type { TodoContact, ApiTodo, Todo } from \"./use-todos.types\";\n\nexport function useTodos(): UseQueryResult<Todo[], Error> {\n const { baseUrl, getApiHeaders } = useDataSourceConfig();\n const { isPreview } = useWidgetPreviewContext();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"todos\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: async ({ signal }): Promise<Todo[]> => {\n const url = baseUrl ? `${baseUrl}/tasks` : \"/tasks\";\n const response = await fetch(url, {\n headers: {\n \"content-type\": \"application/json\",\n ...getApiHeaders?.(),\n },\n signal,\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch todos: ${response.status}`);\n }\n\n const data: ApiTodo[] = await response.json();\n return transformTodos(data);\n },\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n\nfunction transformTodos(rawData: ApiTodo[]): Todo[] {\n return rawData.map((todo) => ({\n id: todo.id,\n body: todo.body,\n dueAt: todo.due_at,\n completedAt: todo.completed_at,\n createdAt: todo.created_at,\n contactName: todo.contact\n ? `${todo.contact.first_name} ${todo.contact.last_name}`\n : null,\n }));\n}\n","import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { ListChecks, Plus } from \"lucide-react\";\nimport { useTodos } from \"../hooks/use-todos\";\nimport { ErrorState } from \"../components/error-state\";\n\ntype ToDoWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Styling\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Content\n maxItems?: number;\n};\n\nexport function ToDoWidget({\n // Title defaults\n titleEnabled = true,\n titleText = \"To-Do\",\n titleFontSize = \"lg\",\n titleColor = \"foreground\",\n\n // Styling defaults\n background = {\n type: \"solid\",\n color: \"background\",\n },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n // Content defaults\n maxItems = 5,\n\n className,\n ...props\n}: ToDoWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n const { data: todos = [], isLoading, isError } = useTodos();\n\n // Use API data if available, otherwise fall back to demo data\n const displayTodos = todos.length > 0 ? todos : [];\n\n // Filter out completed tasks\n const activeTodos = displayTodos.filter((todo) => !todo.completedAt);\n const todosToShow = activeTodos.slice(0, maxItems);\n const remainingCount = activeTodos.length - todosToShow.length;\n const isEmpty = activeTodos.length === 0;\n\n return (\n <div\n className={`overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-${backgroundColor} text-${textColor} p-${padding} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {/* Header */}\n <div className=\"mb-3 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n {titleEnabled && titleText && (\n <h2\n className={`text-${titleFontSize} font-header font-bold text-${titleColor}`}\n >\n {titleText}\n </h2>\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {!isEmpty && !isLoading && (\n <span className={`text-2xl font-bold text-${accentColor}`}>\n {activeTodos.length}\n </span>\n )}\n <div\n className={`flex h-10 w-10 shrink-0 items-center justify-center`}\n >\n <ListChecks className={`h-5 w-5 text-${accentColor}-foreground`} />\n </div>\n </div>\n </div>\n\n {/* Loading state */}\n {isLoading ? (\n <div className=\"flex min-h-[120px] items-center justify-center\">\n <div className=\"h-6 w-6 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n </div>\n ) : isError ? (\n /* Error state */\n <ErrorState />\n ) : isEmpty ? (\n /* Empty state */\n <div className=\"flex flex-col items-center justify-center py-8\">\n <p className={`text-center text-${textColor}/60`}>\n You&apos;ve got nothing else To-Do!\n </p>\n </div>\n ) : (\n /* Todo List */\n <>\n <div className=\"flex flex-col\">\n {todosToShow.map((todo, index) => (\n <div\n key={todo.id}\n className={`flex items-center gap-3 py-2.5 ${\n index !== todosToShow.length - 1\n ? `border-b border-${textColor}/10`\n : \"\"\n }`}\n >\n <input\n type=\"checkbox\"\n className={`h-5 w-5 rounded-full border-2 border-${textColor}/30 bg-transparent`}\n checked={!!todo.completedAt}\n readOnly\n />\n <span className=\"line-clamp-1 flex-1 text-sm\">{todo.body}</span>\n </div>\n ))}\n </div>\n\n {/* Footer */}\n <div className=\"mt-2 flex items-center justify-between\">\n {remainingCount > 0 && (\n <span className={`text-sm text-${textColor}/50 underline`}>\n {remainingCount} more task{remainingCount > 1 ? \"s\" : \"\"}\n </span>\n )}\n <div className=\"ml-auto\">\n <Plus className={`h-5 w-5 text-${textColor}/50`} />\n </div>\n </div>\n </>\n )}\n </div>\n );\n}\n\nexport const toDoWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ToDoWidget\",\n displayName: \"To-Do Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [\n // Styling Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the todo list\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the todo list\",\n defaultValue: \"To-Do\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the widget title\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling Tab - Design Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the widget container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for todo items\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description: \"Color used for count badge and icon\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"maxItems\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of todo items to display\",\n min: 1,\n max: 20,\n step: 1,\n defaultValue: 5,\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the widget container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the widget container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;AAEA,MAAM,sBAAM,IAAI,MAAM;AAEtB,SAAS,YAAY,MAAsB;CACzC,MAAM,IAAI,IAAI,KAAK,IAAI;AACvB,GAAE,QAAQ,EAAE,SAAS,GAAG,KAAK;AAC7B,QAAO,EAAE,aAAa;;AAGxB,MAAa,eAAuB;CAClC;EACE,IAAI;EACJ,MAAM;EACN,OAAO,YAAY,EAAE;EACrB,aAAa;EACb,WAAW,YAAY,GAAG;EAC1B,aAAa;EACd;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO,YAAY,EAAE;EACrB,aAAa;EACb,WAAW,YAAY,GAAG;EAC1B,aAAa;EACd;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO,YAAY,GAAG;EACtB,aAAa;EACb,WAAW,YAAY,GAAG;EAC1B,aAAa;EACd;CACF;;;AC3BD,SAAgB,WAA0C;CACxD,MAAM,EAAE,SAAS,kBAAkBA,oBAAAA,qBAAqB;CACxD,MAAM,EAAE,cAAcC,oBAAAA,yBAAyB;AAE/C,SAAA,GAAA,sBAAA,UAAgB;EACd,UAAU;GACR;GACA;GACA,YAAY,YAAY;GACzB;EACD,SAAS,OAAO,EAAE,aAA8B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ACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;uDACa;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;uDACY;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACR;yDACe;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;8DACmB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;6DACkB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;6DACkB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}
@@ -1,6 +1,6 @@
1
1
  import { n as __exportAll } from "./chunk-CRV2RMSr.mjs";
2
2
  import { i as useDataSourceConfig, n as useWidgetPreviewContext, t as ErrorState } from "./error-state-BGEvTYIh.mjs";
3
- import { a as getColorField, o as getFontSizeField, r as getBorderRadiusField, u as getPaddingField } from "./fields-DW1nDGRz.mjs";
3
+ import { i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./fields-CjDogNNF.mjs";
4
4
  import { useQuery } from "@tanstack/react-query";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { ListChecks, Plus } from "lucide-react";
@@ -83,7 +83,7 @@ var ToDoWidget_exports = /* @__PURE__ */ __exportAll({
83
83
  function ToDoWidget({ titleEnabled = true, titleText = "To-Do", titleFontSize = "lg", titleColor = "foreground", background = {
84
84
  type: "solid",
85
85
  color: "background"
86
- }, textColor = "foreground", accentColor = "primary", padding = 4, borderRadius = "md", maxItems = 5, className, ...props }) {
86
+ }, textColor = "foreground", accentColor = "primary", padding = 4, borderRadius = "md", borderWidth = "none", borderColor = "muted", maxItems = 5, className, ...props }) {
87
87
  const backgroundColor = background.color || "background";
88
88
  const backgroundImage = (background.resource?.image_url || background.resource?.imageUrl) && background.type === "image" ? `url(${background.resource.image_url || background.resource.imageUrl})` : "none";
89
89
  const { data: todos = [], isLoading, isError } = useTodos();
@@ -92,7 +92,7 @@ function ToDoWidget({ titleEnabled = true, titleText = "To-Do", titleFontSize =
92
92
  const remainingCount = activeTodos.length - todosToShow.length;
93
93
  const isEmpty = activeTodos.length === 0;
94
94
  return /* @__PURE__ */ jsxs("div", {
95
- className: `overflow-hidden rounded-${borderRadius} bg-${backgroundColor} text-${textColor} p-${padding} ${className ?? ""}`,
95
+ className: `overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? borderColorClasses[borderColor] : ""} bg-${backgroundColor} text-${textColor} p-${padding} ${className ?? ""}`,
96
96
  style: { backgroundImage },
97
97
  ...props,
98
98
  children: [/* @__PURE__ */ jsxs("div", {
@@ -256,10 +256,26 @@ const toDoWidgetPropertySchema = {
256
256
  defaultValue: "md",
257
257
  tab: "styling",
258
258
  group: "Design"
259
+ }),
260
+ getBorderWidthField({
261
+ key: "borderWidth",
262
+ label: "Border Width",
263
+ description: "Border width for the widget",
264
+ defaultValue: "none",
265
+ tab: "styling",
266
+ group: "Design"
267
+ }),
268
+ getBorderColorField({
269
+ key: "borderColor",
270
+ label: "Border Color",
271
+ description: "Border color for the widget",
272
+ defaultValue: "muted",
273
+ tab: "styling",
274
+ group: "Design"
259
275
  })
260
276
  ]
261
277
  };
262
278
  //#endregion
263
279
  export { ToDoWidget_exports as n, toDoWidgetPropertySchema as r, ToDoWidget as t };
264
280
 
265
- //# sourceMappingURL=ToDoWidget-CKC5BocI.mjs.map
281
+ //# sourceMappingURL=ToDoWidget-iiVItJrO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToDoWidget-iiVItJrO.mjs","names":[],"sources":["../../widgets/src/hooks/use-todos.preview.ts","../../widgets/src/hooks/use-todos.ts","../../widgets/src/widgets/ToDoWidget.tsx"],"sourcesContent":["import type { Todo } from \"./use-todos.types\";\n\nconst now = new Date();\n\nfunction daysFromNow(days: number): string {\n const d = new Date(now);\n d.setDate(d.getDate() + days);\n return d.toISOString();\n}\n\nexport const PREVIEW_DATA: Todo[] = [\n {\n id: 1,\n body: \"Send follow-up email to new leads\",\n dueAt: daysFromNow(1),\n completedAt: null,\n createdAt: daysFromNow(-2),\n contactName: \"Sarah Johnson\",\n },\n {\n id: 2,\n body: \"Prepare slides for team training\",\n dueAt: daysFromNow(3),\n completedAt: null,\n createdAt: daysFromNow(-1),\n contactName: null,\n },\n {\n id: 3,\n body: \"Review monthly sales report\",\n dueAt: daysFromNow(-1),\n completedAt: null,\n createdAt: daysFromNow(-5),\n contactName: \"Mike Chen\",\n },\n];\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useDataSourceConfig } from \"@fluid-app/portal-react/data-sources/context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { PREVIEW_DATA } from \"./use-todos.preview\";\nimport type { ApiTodo, Todo } from \"./use-todos.types\";\n\nexport type { TodoContact, ApiTodo, Todo } from \"./use-todos.types\";\n\nexport function useTodos(): UseQueryResult<Todo[], Error> {\n const { baseUrl, getApiHeaders } = useDataSourceConfig();\n const { isPreview } = useWidgetPreviewContext();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"todos\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: async ({ signal }): Promise<Todo[]> => {\n const url = baseUrl ? `${baseUrl}/tasks` : \"/tasks\";\n const response = await fetch(url, {\n headers: {\n \"content-type\": \"application/json\",\n ...getApiHeaders?.(),\n },\n signal,\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch todos: ${response.status}`);\n }\n\n const data: ApiTodo[] = await response.json();\n return transformTodos(data);\n },\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\n });\n}\n\nfunction transformTodos(rawData: ApiTodo[]): Todo[] {\n return rawData.map((todo) => ({\n id: todo.id,\n body: todo.body,\n dueAt: todo.due_at,\n completedAt: todo.completed_at,\n createdAt: todo.created_at,\n contactName: todo.contact\n ? `${todo.contact.first_name} ${todo.contact.last_name}`\n : null,\n }));\n}\n","import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getColorField,\n getFontSizeField,\n getPaddingField,\n} from \"../core/fields\";\nimport { ListChecks, Plus } from \"lucide-react\";\nimport { useTodos } from \"../hooks/use-todos\";\nimport { ErrorState } from \"../components/error-state\";\n\ntype ToDoWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Styling\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Content\n maxItems?: number;\n};\n\nexport function ToDoWidget({\n // Title defaults\n titleEnabled = true,\n titleText = \"To-Do\",\n titleFontSize = \"lg\",\n titleColor = \"foreground\",\n\n // Styling defaults\n background = {\n type: \"solid\",\n color: \"background\",\n },\n textColor = \"foreground\",\n accentColor = \"primary\",\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n // Content defaults\n maxItems = 5,\n\n className,\n ...props\n}: ToDoWidgetProps): React.JSX.Element {\n const backgroundColor = background.color || \"background\";\n const backgroundImage =\n (background.resource?.image_url || background.resource?.imageUrl) &&\n background.type === \"image\"\n ? `url(${background.resource.image_url || background.resource.imageUrl})`\n : \"none\";\n const { data: todos = [], isLoading, isError } = useTodos();\n\n // Use API data if available, otherwise fall back to demo data\n const displayTodos = todos.length > 0 ? todos : [];\n\n // Filter out completed tasks\n const activeTodos = displayTodos.filter((todo) => !todo.completedAt);\n const todosToShow = activeTodos.slice(0, maxItems);\n const remainingCount = activeTodos.length - todosToShow.length;\n const isEmpty = activeTodos.length === 0;\n\n return (\n <div\n className={`overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-${backgroundColor} text-${textColor} p-${padding} ${className ?? \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {/* Header */}\n <div className=\"mb-3 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n {titleEnabled && titleText && (\n <h2\n className={`text-${titleFontSize} font-header font-bold text-${titleColor}`}\n >\n {titleText}\n </h2>\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {!isEmpty && !isLoading && (\n <span className={`text-2xl font-bold text-${accentColor}`}>\n {activeTodos.length}\n </span>\n )}\n <div\n className={`flex h-10 w-10 shrink-0 items-center justify-center`}\n >\n <ListChecks className={`h-5 w-5 text-${accentColor}-foreground`} />\n </div>\n </div>\n </div>\n\n {/* Loading state */}\n {isLoading ? (\n <div className=\"flex min-h-[120px] items-center justify-center\">\n <div className=\"h-6 w-6 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n </div>\n ) : isError ? (\n /* Error state */\n <ErrorState />\n ) : isEmpty ? (\n /* Empty state */\n <div className=\"flex flex-col items-center justify-center py-8\">\n <p className={`text-center text-${textColor}/60`}>\n You&apos;ve got nothing else To-Do!\n </p>\n </div>\n ) : (\n /* Todo List */\n <>\n <div className=\"flex flex-col\">\n {todosToShow.map((todo, index) => (\n <div\n key={todo.id}\n className={`flex items-center gap-3 py-2.5 ${\n index !== todosToShow.length - 1\n ? `border-b border-${textColor}/10`\n : \"\"\n }`}\n >\n <input\n type=\"checkbox\"\n className={`h-5 w-5 rounded-full border-2 border-${textColor}/30 bg-transparent`}\n checked={!!todo.completedAt}\n readOnly\n />\n <span className=\"line-clamp-1 flex-1 text-sm\">{todo.body}</span>\n </div>\n ))}\n </div>\n\n {/* Footer */}\n <div className=\"mt-2 flex items-center justify-between\">\n {remainingCount > 0 && (\n <span className={`text-sm text-${textColor}/50 underline`}>\n {remainingCount} more task{remainingCount > 1 ? \"s\" : \"\"}\n </span>\n )}\n <div className=\"ml-auto\">\n <Plus className={`h-5 w-5 text-${textColor}/50`} />\n </div>\n </div>\n </>\n )}\n </div>\n );\n}\n\nexport const toDoWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ToDoWidget\",\n displayName: \"To-Do Widget\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [\n // Styling Tab - Title Group\n {\n key: \"titleEnabled\",\n label: \"Widget Title\",\n type: \"boolean\",\n description: \"Enable the title displayed above the todo list\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"titleText\",\n label: \"Title\",\n type: \"text\",\n description: \"Title text displayed above the todo list\",\n defaultValue: \"To-Do\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n },\n getFontSizeField({\n key: \"titleFontSize\",\n label: \"Title Font Size\",\n description: \"Font size for the widget title\",\n defaultValue: \"xl\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the widget title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Styling Tab - Design Group\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the widget container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Default text color for todo items\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getColorField({\n key: \"accentColor\",\n label: \"Accent Color\",\n description: \"Color used for count badge and icon\",\n defaultValue: \"primary\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"maxItems\",\n label: \"Max Items\",\n type: \"number\",\n description: \"Maximum number of todo items to display\",\n min: 1,\n max: 20,\n step: 1,\n defaultValue: 5,\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the widget container\",\n defaultValue: 4,\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the widget container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;AAEA,MAAM,sBAAM,IAAI,MAAM;AAEtB,SAAS,YAAY,MAAsB;CACzC,MAAM,IAAI,IAAI,KAAK,IAAI;AACvB,GAAE,QAAQ,EAAE,SAAS,GAAG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;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,MAAM;GACN,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}