@fluid-app/portal-sdk 0.1.131 → 0.1.133

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 (146) hide show
  1. package/dist/{AlertWidget-WQ_XPDRo.mjs → AlertWidget-BYbcGyNr.mjs} +3 -3
  2. package/dist/{AlertWidget-WQ_XPDRo.mjs.map → AlertWidget-BYbcGyNr.mjs.map} +1 -1
  3. package/dist/{AppDownloadScreen-zNP4k8ht.cjs → AppDownloadScreen-B-i6Rydi.cjs} +1 -1
  4. package/dist/{AppDownloadScreen-BOfG3cqC.mjs → AppDownloadScreen-BpExiJat.mjs} +3 -3
  5. package/dist/{AppDownloadScreen-BOfG3cqC.mjs.map → AppDownloadScreen-BpExiJat.mjs.map} +1 -1
  6. package/dist/{AppDownloadScreen-BjCtTMPU.cjs → AppDownloadScreen-CIqSvpV0.cjs} +1 -1
  7. package/dist/{AppDownloadScreen-BjCtTMPU.cjs.map → AppDownloadScreen-CIqSvpV0.cjs.map} +1 -1
  8. package/dist/{BulletListWidget-BYcaQnVH.mjs → BulletListWidget-Bo5Kj1W-.mjs} +2 -2
  9. package/dist/{BulletListWidget-BYcaQnVH.mjs.map → BulletListWidget-Bo5Kj1W-.mjs.map} +1 -1
  10. package/dist/{CalendarWidget-Qb-utCFD.mjs → CalendarWidget-CCsceh_0.mjs} +2 -2
  11. package/dist/{CalendarWidget-Qb-utCFD.mjs.map → CalendarWidget-CCsceh_0.mjs.map} +1 -1
  12. package/dist/{CardWidget-zVxobZDH.mjs → CardWidget-BkOMSBQ-.mjs} +2 -2
  13. package/dist/{CardWidget-zVxobZDH.mjs.map → CardWidget-BkOMSBQ-.mjs.map} +1 -1
  14. package/dist/{CarouselWidget-dpRCljEx.mjs → CarouselWidget-B9LsTYUF.mjs} +2 -2
  15. package/dist/{CarouselWidget-dpRCljEx.mjs.map → CarouselWidget-B9LsTYUF.mjs.map} +1 -1
  16. package/dist/{CatchUpWidget-CSIXsR82.mjs → CatchUpWidget-CSJdJgs-.mjs} +2 -2
  17. package/dist/{CatchUpWidget-CSIXsR82.mjs.map → CatchUpWidget-CSJdJgs-.mjs.map} +1 -1
  18. package/dist/{ChartWidget-88hpX7ft.mjs → ChartWidget-Cpzqi6W4.mjs} +2 -2
  19. package/dist/{ChartWidget-88hpX7ft.mjs.map → ChartWidget-Cpzqi6W4.mjs.map} +1 -1
  20. package/dist/{ContactsScreen-BvoMicyB.mjs → ContactsScreen-BRmYDosJ.mjs} +5 -5
  21. package/dist/{ContactsScreen-BvoMicyB.mjs.map → ContactsScreen-BRmYDosJ.mjs.map} +1 -1
  22. package/dist/{ContainerWidget-DNS7ynby.mjs → ContainerWidget-DTchKDKw.mjs} +3 -3
  23. package/dist/{ContainerWidget-DNS7ynby.mjs.map → ContainerWidget-DTchKDKw.mjs.map} +1 -1
  24. package/dist/{CustomersScreen-xAauAB-B.mjs → CustomersScreen-Cnn-Wcza.mjs} +2 -2
  25. package/dist/{CustomersScreen-xAauAB-B.mjs.map → CustomersScreen-Cnn-Wcza.mjs.map} +1 -1
  26. package/dist/{EmbedWidget-BQYixJLj.mjs → EmbedWidget-Du9DMpSo.mjs} +2 -2
  27. package/dist/{EmbedWidget-BQYixJLj.mjs.map → EmbedWidget-Du9DMpSo.mjs.map} +1 -1
  28. package/dist/{FluidProvider-B-f_JVal.mjs → FluidProvider-BUdNsR8f.mjs} +49 -49
  29. package/dist/{FluidProvider-B-f_JVal.mjs.map → FluidProvider-BUdNsR8f.mjs.map} +1 -1
  30. package/dist/FluidProvider-CQoQjYxU.cjs.map +1 -1
  31. package/dist/{ImageWidget-DE9Fp_oH.mjs → ImageWidget-B1Mx3qKN.mjs} +2 -2
  32. package/dist/{ImageWidget-DE9Fp_oH.mjs.map → ImageWidget-B1Mx3qKN.mjs.map} +1 -1
  33. package/dist/{LayoutWidget-BFO_PHWw.mjs → LayoutWidget-Bgodl7eR.mjs} +2 -2
  34. package/dist/{LayoutWidget-BFO_PHWw.mjs.map → LayoutWidget-Bgodl7eR.mjs.map} +1 -1
  35. package/dist/{LinkWidget-JSoDi-ag.mjs → LinkWidget-B5PlWJHe.mjs} +2 -2
  36. package/dist/{LinkWidget-JSoDi-ag.mjs.map → LinkWidget-B5PlWJHe.mjs.map} +1 -1
  37. package/dist/{ListWidget-CBLZ8CjD.mjs → ListWidget-BWfsmVoc.mjs} +2 -2
  38. package/dist/{ListWidget-CBLZ8CjD.mjs.map → ListWidget-BWfsmVoc.mjs.map} +1 -1
  39. package/dist/{MessagingScreen-COWASb0E.mjs → MessagingScreen-CQwR5WA1.mjs} +9 -6
  40. package/dist/{MessagingScreen-COWASb0E.mjs.map → MessagingScreen-CQwR5WA1.mjs.map} +1 -1
  41. package/dist/{MySiteScreen-BasZFpx7.cjs → MySiteScreen-C00HjZdl.cjs} +1 -1
  42. package/dist/{MySiteScreen-B5-bV1-O.mjs → MySiteScreen-CcxWz0IH.mjs} +4 -4
  43. package/dist/{MySiteScreen-B5-bV1-O.mjs.map → MySiteScreen-CcxWz0IH.mjs.map} +1 -1
  44. package/dist/{MySiteScreen-DURa034X.cjs → MySiteScreen-D56qESn0.cjs} +1 -1
  45. package/dist/{MySiteScreen-DURa034X.cjs.map → MySiteScreen-D56qESn0.cjs.map} +1 -1
  46. package/dist/{MySiteWidget-BqtLSExC.mjs → MySiteWidget-mK0Mj3DS.mjs} +2 -2
  47. package/dist/{MySiteWidget-BqtLSExC.mjs.map → MySiteWidget-mK0Mj3DS.mjs.map} +1 -1
  48. package/dist/{NestedWidget-DIwW-wM7.mjs → NestedWidget-B6cUOyI3.mjs} +2 -2
  49. package/dist/{NestedWidget-DIwW-wM7.mjs.map → NestedWidget-B6cUOyI3.mjs.map} +1 -1
  50. package/dist/{OrdersScreen-BcFvAtJ_.mjs → OrdersScreen-CpOywVHJ.mjs} +4 -4
  51. package/dist/{OrdersScreen-BcFvAtJ_.mjs.map → OrdersScreen-CpOywVHJ.mjs.map} +1 -1
  52. package/dist/{PointsWidget-DgLGU995.mjs → PointsWidget-BlEzqgbK.mjs} +2 -2
  53. package/dist/{PointsWidget-DgLGU995.mjs.map → PointsWidget-BlEzqgbK.mjs.map} +1 -1
  54. package/dist/{ProductsScreen-Mu8doz5F.cjs → ProductsScreen-BPNdpsYm.cjs} +2 -2
  55. package/dist/{src-CMByt6YP.cjs → ProductsScreen-BY285fh-.cjs} +90 -31
  56. package/dist/ProductsScreen-BY285fh-.cjs.map +1 -0
  57. package/dist/ProductsScreen-DMldTDPg.mjs +42 -0
  58. package/dist/{src-DryOJTBW.mjs → ProductsScreen-jdy2j9_J.mjs} +86 -28
  59. package/dist/ProductsScreen-jdy2j9_J.mjs.map +1 -0
  60. package/dist/{ProfileScreen-CnQqdYBE.mjs → ProfileScreen-mAUuAFhe.mjs} +5 -5
  61. package/dist/{ProfileScreen-CnQqdYBE.mjs.map → ProfileScreen-mAUuAFhe.mjs.map} +1 -1
  62. package/dist/{QuickShareWidget-CajKauDa.mjs → QuickShareWidget-Lpox79Cq.mjs} +2 -2
  63. package/dist/{QuickShareWidget-CajKauDa.mjs.map → QuickShareWidget-Lpox79Cq.mjs.map} +1 -1
  64. package/dist/{RecentActivityWidget-BZYB21eR.mjs → RecentActivityWidget-BdPmAQq4.mjs} +2 -2
  65. package/dist/{RecentActivityWidget-BZYB21eR.mjs.map → RecentActivityWidget-BdPmAQq4.mjs.map} +1 -1
  66. package/dist/{SeparatorWidget-Lsd6juu7.mjs → SeparatorWidget-BS966Lk4.mjs} +2 -2
  67. package/dist/{SeparatorWidget-Lsd6juu7.mjs.map → SeparatorWidget-BS966Lk4.mjs.map} +1 -1
  68. package/dist/ShareablesScreen-B6tMQzuX.mjs +1314 -0
  69. package/dist/ShareablesScreen-B6tMQzuX.mjs.map +1 -0
  70. package/dist/{ShareablesScreen-oZhW2jGu.cjs → ShareablesScreen-DMBXIMMj.cjs} +2 -2
  71. package/dist/ShareablesScreen-d_ThfnNQ.mjs +42 -0
  72. package/dist/ShareablesScreen-znVUD_OK.cjs +1332 -0
  73. package/dist/ShareablesScreen-znVUD_OK.cjs.map +1 -0
  74. package/dist/{ShopScreen-B1UzSmK8.cjs → ShopScreen-BVIT_QS-.cjs} +6 -4
  75. package/dist/ShopScreen-BVIT_QS-.cjs.map +1 -0
  76. package/dist/{ShopScreen-7HWz_B6R.cjs → ShopScreen-Bsjdn-E9.cjs} +1 -1
  77. package/dist/{ShopScreen-D1N3RWm9.mjs → ShopScreen-C1bnhxpj.mjs} +9 -7
  78. package/dist/ShopScreen-C1bnhxpj.mjs.map +1 -0
  79. package/dist/{SpacerWidget-B3zkEePP.mjs → SpacerWidget-BimE1fjJ.mjs} +2 -2
  80. package/dist/{SpacerWidget-B3zkEePP.mjs.map → SpacerWidget-BimE1fjJ.mjs.map} +1 -1
  81. package/dist/{SubscriptionsScreen-Bw3xkq7t.mjs → SubscriptionsScreen-QHf54yD7.mjs} +5 -5
  82. package/dist/{SubscriptionsScreen-Bw3xkq7t.mjs.map → SubscriptionsScreen-QHf54yD7.mjs.map} +1 -1
  83. package/dist/{TableWidget-Xz0d4UH5.mjs → TableWidget-CfSqeNQj.mjs} +2 -2
  84. package/dist/{TableWidget-Xz0d4UH5.mjs.map → TableWidget-CfSqeNQj.mjs.map} +1 -1
  85. package/dist/{TextWidget-CzUlNmCl.mjs → TextWidget-DYpbUtQh.mjs} +2 -2
  86. package/dist/{TextWidget-CzUlNmCl.mjs.map → TextWidget-DYpbUtQh.mjs.map} +1 -1
  87. package/dist/{ToDoWidget-qyFLHU_o.mjs → ToDoWidget-DaxkgCEl.mjs} +2 -2
  88. package/dist/{ToDoWidget-qyFLHU_o.mjs.map → ToDoWidget-DaxkgCEl.mjs.map} +1 -1
  89. package/dist/{UpgradeScreen-CIiEjeTZ.cjs → UpgradeScreen--eiiE1rX.cjs} +1 -1
  90. package/dist/{UpgradeScreen-IaYxGm7M.cjs → UpgradeScreen-7on9GOgu.cjs} +1 -1
  91. package/dist/{UpgradeScreen-IaYxGm7M.cjs.map → UpgradeScreen-7on9GOgu.cjs.map} +1 -1
  92. package/dist/{UpgradeScreen-BZdJQxb9.mjs → UpgradeScreen-p7aAXWFM.mjs} +2 -2
  93. package/dist/{UpgradeScreen-BZdJQxb9.mjs.map → UpgradeScreen-p7aAXWFM.mjs.map} +1 -1
  94. package/dist/{VideoWidget-CpUPsOI7.mjs → VideoWidget-CHktk3hs.mjs} +2 -2
  95. package/dist/{VideoWidget-CpUPsOI7.mjs.map → VideoWidget-CHktk3hs.mjs.map} +1 -1
  96. package/dist/{dist-B1HwSrso.mjs → dist-CayuD99K.mjs} +1 -1
  97. package/dist/{dist-B1HwSrso.mjs.map → dist-CayuD99K.mjs.map} +1 -1
  98. package/dist/{es-BcjHf1ZX.mjs → es-CTLNkiWp.mjs} +38 -3
  99. package/dist/{es-BcjHf1ZX.mjs.map → es-CTLNkiWp.mjs.map} +1 -1
  100. package/dist/index.cjs +19 -19
  101. package/dist/index.d.cts.map +1 -1
  102. package/dist/index.d.mts.map +1 -1
  103. package/dist/index.mjs +70 -70
  104. package/dist/index.mjs.map +1 -1
  105. package/dist/{order-status-badge-OZ1InBwZ.mjs → order-status-badge-Bt2gMEPZ.mjs} +1 -1
  106. package/dist/{order-status-badge-OZ1InBwZ.mjs.map → order-status-badge-Bt2gMEPZ.mjs.map} +1 -1
  107. package/dist/{sortable.esm-DSrWP4x9.mjs → sortable.esm-BzPsVjTI.mjs} +1 -1
  108. package/dist/{sortable.esm-DSrWP4x9.mjs.map → sortable.esm-BzPsVjTI.mjs.map} +1 -1
  109. package/dist/{src-DIcd2_ex.cjs → src-C5GUPE_i.cjs} +37 -26
  110. package/dist/src-C5GUPE_i.cjs.map +1 -0
  111. package/dist/{src-k03GJfKt.mjs → src-DcIV4Mpe.mjs} +41 -30
  112. package/dist/src-DcIV4Mpe.mjs.map +1 -0
  113. package/dist/{use-account-clients-CZw8FqxD.mjs → use-account-clients-BjK5QVYl.mjs} +2 -2
  114. package/dist/{use-account-clients-CZw8FqxD.mjs.map → use-account-clients-BjK5QVYl.mjs.map} +1 -1
  115. package/dist/{use-current-user-C6af9r0B.mjs → use-current-user-BP_GJuQe.mjs} +3 -3
  116. package/dist/{use-current-user-C6af9r0B.mjs.map → use-current-user-BP_GJuQe.mjs.map} +1 -1
  117. package/dist/{use-fluid-api-R0Qybt_F.mjs → use-fluid-api-UtVBk6E-.mjs} +2 -2
  118. package/dist/{use-fluid-api-R0Qybt_F.mjs.map → use-fluid-api-UtVBk6E-.mjs.map} +1 -1
  119. package/dist/{use-fluid-auth-_pnjCu2c.mjs → use-fluid-auth-DrPeCmW-.mjs} +2 -2
  120. package/dist/{use-fluid-auth-_pnjCu2c.mjs.map → use-fluid-auth-DrPeCmW-.mjs.map} +1 -1
  121. package/dist/{use-portal-products-client-Bl-yd0Tl.cjs → use-portal-products-client-CIrRGIxC.cjs} +5 -14
  122. package/dist/use-portal-products-client-CIrRGIxC.cjs.map +1 -0
  123. package/dist/{use-portal-products-client-tJi4q54S.mjs → use-portal-products-client-dV5jIXpp.mjs} +6 -15
  124. package/dist/use-portal-products-client-dV5jIXpp.mjs.map +1 -0
  125. package/package.json +18 -18
  126. package/dist/MessagingScreen-CWm4iQnk.mjs +0 -38
  127. package/dist/ProductsScreen-BHeRiKUM.cjs +0 -101
  128. package/dist/ProductsScreen-BHeRiKUM.cjs.map +0 -1
  129. package/dist/ProductsScreen-C_1ghW3w.mjs +0 -42
  130. package/dist/ProductsScreen-DJOPzE9v.mjs +0 -89
  131. package/dist/ProductsScreen-DJOPzE9v.mjs.map +0 -1
  132. package/dist/ShareablesScreen-BSRbPf6u.cjs +0 -414
  133. package/dist/ShareablesScreen-BSRbPf6u.cjs.map +0 -1
  134. package/dist/ShareablesScreen-COyBtpDy.mjs +0 -42
  135. package/dist/ShareablesScreen-kBJFUklJ.mjs +0 -396
  136. package/dist/ShareablesScreen-kBJFUklJ.mjs.map +0 -1
  137. package/dist/ShopScreen-B1UzSmK8.cjs.map +0 -1
  138. package/dist/ShopScreen-D1N3RWm9.mjs.map +0 -1
  139. package/dist/chunk-ByhMGyNw.mjs +0 -37
  140. package/dist/src-CMByt6YP.cjs.map +0 -1
  141. package/dist/src-DIcd2_ex.cjs.map +0 -1
  142. package/dist/src-DryOJTBW.mjs.map +0 -1
  143. package/dist/src-k03GJfKt.mjs.map +0 -1
  144. package/dist/use-portal-products-client-Bl-yd0Tl.cjs.map +0 -1
  145. package/dist/use-portal-products-client-tJi4q54S.mjs.map +0 -1
  146. /package/dist/{src-DAC9DwXZ.mjs → src-6SxtfYk9.mjs} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CarouselWidget-dpRCljEx.mjs","names":["DOMPurify"],"sources":["../../widgets/src/widgets/CarouselWidget.tsx"],"sourcesContent":["import DOMPurify from \"dompurify\";\nimport { Button } from \"@fluid-app/ui-primitives\";\nimport { ScrollArrows } from \"../ui/scroll-arrows\";\nimport type { ComponentProps } from \"react\";\nimport { useEffect, useState, useCallback } from \"react\";\nimport type React from \"react\";\nimport {\n MediaRenderer,\n getMediaPropsFromWidgetSchema,\n} from \"../components/MediaRenderer\";\nimport type {\n WidgetSchema,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n AlignOptions,\n FontSizeOptions,\n PaddingOptions,\n ButtonSizeOptions,\n} from \"@fluid-app/portal-core/types\";\nimport {\n getHeightField,\n type WidgetPropertySchema,\n} from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n getButtonSizeField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\n\nconst DEFAULT_SLIDES: CarouselSlide[] = [];\n\ntype CarouselSlide = {\n id: string;\n content: WidgetSchema;\n title?: string;\n description?: string;\n buttonEnabled?: boolean;\n buttonText?: string;\n buttonVariant?:\n | \"default\"\n | \"secondary\"\n | \"outline\"\n | \"destructive\"\n | \"ghost\"\n | \"link\";\n buttonLink?: string;\n};\n\ntype CarouselWidgetProps = ComponentProps<\"div\"> & {\n slides?: CarouselSlide[];\n autoScrollInterval?: number;\n enableAutoScroll?: boolean;\n\n // Layout\n align?: AlignOptions;\n carouselHeight?: string;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n padding?: PaddingOptions;\n\n // Text Styling\n headerSize?: FontSizeOptions;\n headerColor?: ColorOptions;\n textSize?: FontSizeOptions;\n textColor?: ColorOptions;\n textWidth?: string;\n\n // Button\n showButton?: boolean;\n buttonColor?: ColorOptions;\n buttonSize?: ButtonSizeOptions;\n\n // Overlay\n overlayEnabled?: boolean;\n overlayType?: \"solid\" | \"gradient\";\n overlayIntensity?: number;\n};\n\nexport function CarouselWidget({\n slides = DEFAULT_SLIDES,\n autoScrollInterval = 3000,\n enableAutoScroll = false,\n carouselHeight = \"400px\",\n align = { vertical: \"bottom\", horizontal: \"left\" },\n overlayIntensity = 40,\n borderRadius = \"none\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n padding = 0,\n textWidth = \"100%\",\n headerSize = \"lg\",\n headerColor = \"background\",\n textSize = \"md\",\n textColor = \"background\",\n showButton = true,\n buttonColor = \"background\",\n buttonSize = \"default\",\n overlayEnabled = true,\n overlayType = \"solid\",\n className,\n ...props\n}: CarouselWidgetProps): React.JSX.Element {\n const [currentIndex, setCurrentIndex] = useState(0);\n const [isHovered, setIsHovered] = useState(false);\n\n const hasSlides = slides.length > 0;\n const totalSlides = slides.length;\n\n const goToNext = useCallback(() => {\n if (!hasSlides) return;\n setCurrentIndex((prev) => {\n if (prev === totalSlides - 1) {\n return 0;\n }\n return prev + 1;\n });\n }, [hasSlides, totalSlides]);\n\n const goToPrevious = useCallback(() => {\n if (!hasSlides) return;\n setCurrentIndex((prev) => {\n if (prev === 0) {\n return totalSlides - 1;\n }\n return prev - 1;\n });\n }, [hasSlides, totalSlides]);\n\n const goToSlide = useCallback(\n (index: number) => {\n if (!hasSlides) return;\n if (index >= 0 && index < totalSlides) {\n setCurrentIndex(index);\n }\n },\n [hasSlides, totalSlides],\n );\n\n // Auto-scroll effect\n useEffect(() => {\n if (!enableAutoScroll || !hasSlides || isHovered) return;\n\n const intervalId = setInterval(() => {\n goToNext();\n }, autoScrollInterval);\n\n return () => clearInterval(intervalId);\n }, [enableAutoScroll, autoScrollInterval, hasSlides, isHovered, goToNext]);\n\n // Reset to first slide if slides change\n useEffect(() => {\n if (currentIndex >= totalSlides && totalSlides > 0) {\n setCurrentIndex(0);\n }\n }, [totalSlides, currentIndex]);\n\n if (!hasSlides) {\n return (\n <div\n className={`rounded-${borderRadius} ${className} w-full overflow-hidden`}\n style={{ minHeight: carouselHeight }}\n {...props}\n >\n <div\n className=\"bg-muted flex h-full w-full items-center justify-center\"\n style={{ minHeight: carouselHeight }}\n >\n <div className=\"text-muted-foreground flex flex-col items-center gap-2\">\n <div className=\"text-4xl\">🎠</div>\n <p className=\"text-sm\">No slides added</p>\n <p className=\"text-muted-foreground/70 text-xs\">\n Add slides to create a carousel\n </p>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={`relative w-full overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className}`}\n style={{ minHeight: carouselHeight }}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n {...props}\n >\n {/* Slides Container */}\n <div\n className=\"relative h-full w-full\"\n style={{ minHeight: carouselHeight }}\n >\n <div\n className=\"flex h-full transition-transform duration-500 ease-in-out\"\n style={{\n transform: `translateX(-${currentIndex * 100}%)`,\n }}\n >\n {slides.map((slide) => (\n <div\n key={slide.id}\n className=\"relative h-full w-full flex-shrink-0\"\n style={{ minWidth: \"100%\", minHeight: carouselHeight }}\n >\n {/* Background image/content layer */}\n <div className=\"absolute inset-0 z-0 h-full w-full\">\n <MediaRenderer\n {...getMediaPropsFromWidgetSchema(slide.content)}\n />\n </div>\n\n {/* Dark overlay for text readability */}\n {overlayEnabled && (\n <div\n className={`pointer-events-none absolute inset-0 z-9 ${\n overlayType === \"gradient\"\n ? \"bg-gradient-to-t from-black to-transparent\"\n : \"bg-black\"\n }`}\n style={{\n opacity:\n (Number(String(overlayIntensity).replace(\"%\", \"\")) ||\n 40) / 100,\n }}\n />\n )}\n\n {/* Content box */}\n <div\n className={`pointer-events-none absolute inset-x-0 z-10 flex px-3 ${\n align.horizontal === \"left\"\n ? \"justify-start\"\n : align.horizontal === \"center\"\n ? \"justify-center\"\n : \"justify-end\"\n } ${\n align.vertical === \"top\"\n ? \"top-0 pt-13\"\n : align.vertical === \"center\"\n ? \"top-1/2 -translate-y-1/2\"\n : \"bottom-0 pb-13\"\n }`}\n >\n <div\n className={`pointer-events-auto p-${padding} flex flex-col gap-3`}\n style={{ maxWidth: textWidth }}\n >\n {/* Heading and text */}\n <div className={`flex flex-col text-${align.horizontal}`}>\n {slide.title && (\n <h2\n className={`font-header mb-2 leading-tight font-bold text-${headerColor} text-${headerSize === \"md\" ? \"base\" : headerSize}`}\n >\n {slide.title}\n </h2>\n )}\n {slide.description && (\n <div\n className={`leading-snug text-${textColor} text-${textSize === \"md\" ? \"base\" : textSize} line-clamp-2`}\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(slide.description, {\n ALLOWED_TAGS: [\n \"br\",\n \"strong\",\n \"em\",\n \"b\",\n \"i\",\n \"ul\",\n \"ol\",\n \"li\",\n \"p\",\n ],\n ALLOWED_ATTR: [],\n }),\n }}\n />\n )}\n </div>\n\n {/* Button */}\n {slide.buttonText && slide.buttonEnabled && showButton && (\n <div className={`text-${align.horizontal}`}>\n <Button\n size={buttonSize}\n className={`rounded-md py-1 font-semibold bg-${buttonColor} text-${buttonColor}-foreground hover:bg-${buttonColor}/90`}\n asChild\n >\n <a href={slide.buttonLink}>{slide.buttonText}</a>\n </Button>\n </div>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n {/* Dots and Navigation */}\n {totalSlides > 1 && (\n <div\n className={`p-${padding} absolute bottom-0 z-10 flex w-full items-center justify-between ${align.horizontal === \"center\" ? \"h-full\" : \"\"}`}\n >\n {/* Pagination dots - always at bottom */}\n <div\n className={`flex items-center ${\n align.horizontal === \"center\"\n ? `p-${padding} absolute inset-x-0 bottom-3 justify-center`\n : \"\"\n }`}\n >\n <div\n className={`flex items-center gap-2 ${\n align.horizontal === \"center\" ? \"justify-center\" : \"\"\n }`}\n >\n {slides.map((_, index) => (\n <button\n key={`dot-${index}`}\n className={`h-[6px] w-[6px] rounded-full transition-colors ${\n index === currentIndex\n ? \"bg-background\"\n : \"bg-background/40 hover:bg-background/60\"\n }`}\n onClick={() => goToSlide(index)}\n aria-label={`Go to slide ${index + 1}`}\n aria-current={index === currentIndex ? \"true\" : \"false\"}\n />\n ))}\n </div>\n </div>\n\n {/* Navigation arrows - position changes based on alignment */}\n <div\n className={`flex items-center gap-[10px] ${\n align.horizontal === \"center\"\n ? `absolute inset-x-0 top-1/2 justify-between px-${padding}`\n : \"\"\n }`}\n >\n <ScrollArrows onPrevious={goToPrevious} onNext={goToNext} />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport const carouselWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"CarouselWidget\",\n displayName: \"Carousel\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"behavior\", label: \"Behavior\" },\n { id: \"data\", label: \"Data\" },\n ],\n dataSourceTargetProps: [\"slides\"],\n fields: [\n // Styling tab - Text Styling group\n getFontSizeField({\n defaultValue: \"lg\",\n key: \"headerSize\",\n label: \"Header Font Size\",\n description: \"Font size for the slide header\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n getColorField({\n defaultValue: \"background\",\n key: \"headerColor\",\n label: \"Header Color\",\n description: \"Color variant for the slide header\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Text Styling\",\n },\n getFontSizeField({\n defaultValue: \"md\",\n key: \"textSize\",\n label: \"Text Font Size\",\n description: \"Font size for the slide text\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n getColorField({\n defaultValue: \"background\",\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Color variant for the slide text\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n // Styling tab - Layout group\n {\n key: \"align\",\n label: \"Alignment\",\n type: \"alignment\",\n description: \"Alignment of the carousel content\",\n defaultValue: { vertical: \"bottom\", horizontal: \"left\" },\n options: {\n verticalEnabled: true,\n horizontalEnabled: true,\n },\n tab: \"styling\",\n group: \"Layout\",\n },\n {\n key: \"textWidth\",\n label: \"Content Width\",\n type: \"cssUnit\",\n description: \"Maximum width for slide content\",\n defaultValue: \"100%\",\n allowedUnits: [\"px\", \"rem\", \"%\"],\n defaultUnit: \"%\",\n minByUnit: { px: 50, rem: 3, \"%\": 10 },\n maxByUnit: { px: 1200, rem: 75, \"%\": 100 },\n stepByUnit: { px: 10, rem: 1, \"%\": 1 },\n tab: \"styling\",\n group: \"Layout\",\n },\n // Styling tab - Design group\n getHeightField({\n key: \"carouselHeight\",\n label: \"Carousel Height\",\n description: \"Height of the carousel\",\n defaultValue: \"400px\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator2\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n getBorderRadiusField({\n defaultValue: \"md\",\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Rounded corners for the carousel\",\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 getPaddingField({\n defaultValue: 4,\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding for the carousel\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"overlayEnabled\",\n label: \"Enable Overlay\",\n type: \"boolean\",\n description: \"Add background overlay to slide content\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"overlayType\",\n label: \"Overlay Type\",\n type: \"buttonGroup\",\n description: \"Type of overlay to add to the slide content\",\n defaultValue: \"gradient\",\n options: [\n { label: \"Solid\", value: \"solid\" },\n { label: \"Gradient\", value: \"gradient\" },\n ],\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"overlayIntensity\",\n label: \"Overlay Intensity\",\n type: \"slider\",\n description: \"Opacity of the overlay background (0-100)\",\n min: 0,\n max: 100,\n step: 5,\n defaultValue: 50,\n unit: \"%\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"showButton\",\n label: \"Show Button\",\n type: \"boolean\",\n description: \"Display the button in slide content\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n defaultValue: \"primary\",\n key: \"buttonColor\",\n label: \"Button Color\",\n description: \"Color variant for the slide button\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"showButton\",\n }),\n getButtonSizeField({\n defaultValue: \"default\",\n key: \"buttonSize\",\n label: \"Button Size\",\n description: \"Size of the slide button\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"showButton\",\n }),\n // Behavior tab - Auto-Scroll group\n {\n key: \"enableAutoScroll\",\n label: \"Enable Auto-Scroll\",\n type: \"boolean\",\n description: \"Automatically advance to the next slide\",\n defaultValue: false,\n tab: \"behavior\",\n group: \"Auto-Scroll\",\n },\n {\n key: \"autoScrollInterval\",\n label: \"Auto-Scroll Interval (ms)\",\n type: \"number\",\n description: \"Time in milliseconds between automatic slide transitions\",\n min: 1000,\n max: 10000,\n step: 500,\n defaultValue: 3000,\n tab: \"behavior\",\n group: \"Auto-Scroll\",\n requiresKeyToBeTrue: \"enableAutoScroll\",\n },\n // Data tab - Data Configuration group\n {\n key: \"dataSource\",\n label: \"Data Source\",\n type: \"dataSource\",\n description: \"\",\n tab: \"data\",\n group: \"Data Configuration\",\n },\n ],\n // Per-item configuration schema for custom data sources\n itemConfigSchema: {\n description: \"Configure settings for this slide\",\n fields: [\n {\n key: \"title\",\n label: \"Custom Title\",\n type: \"text\",\n description: \"Override the item's title for this slide\",\n },\n {\n key: \"description\",\n label: \"Custom Description\",\n type: \"textarea\",\n description: \"Override the item's description for this slide\",\n rows: 3,\n },\n {\n key: \"buttonEnabled\",\n label: \"Show Button\",\n type: \"boolean\",\n description: \"Show the button in the slide\",\n defaultValue: false,\n },\n {\n key: \"buttonText\",\n label: \"Button Text\",\n type: \"text\",\n description: \"Text to display on the slide button\",\n requiresKeyToBeTrue: \"buttonEnabled\",\n },\n {\n key: \"buttonLink\",\n label: \"Button Link\",\n type: \"text\",\n description: \"URL for the slide button\",\n requiresKeyToBeTrue: \"buttonEnabled\",\n },\n ],\n },\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;AAoCA,MAAM,iBAAkC,EAAE;AAkD1C,SAAgB,eAAe,EAC7B,SAAS,gBACT,qBAAqB,KACrB,mBAAmB,OACnB,iBAAiB,SACjB,QAAQ;CAAE,UAAU;CAAU,YAAY;CAAQ,EAClD,mBAAmB,IACnB,eAAe,QACf,cAAc,QACd,cAAc,SACd,UAAU,GACV,YAAY,QACZ,aAAa,MACb,cAAc,cACd,WAAW,MACX,YAAY,cACZ,aAAa,MACb,cAAc,cACd,aAAa,WACb,iBAAiB,MACjB,cAAc,SACd,WACA,GAAG,SACsC;CACzC,MAAM,CAAC,cAAc,mBAAmB,SAAS,EAAE;CACnD,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CAEjD,MAAM,YAAY,OAAO,SAAS;CAClC,MAAM,cAAc,OAAO;CAE3B,MAAM,WAA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AAC;EACF,gBAAgB;GACd,cAAc;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO;GACR,CAAC;EACF;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,SAAS,CACP;IAAE,OAAO;IAAS,OAAO;IAAS,EAClC;IAAE,OAAO;IAAY,OAAO;IAAY,CACzC;GACD,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,MAAM;GACN,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,cAAc;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,mBAAmB;GACjB,cAAc;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAEF;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;EAED;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACR;EACF;CAED,kBAAkB;EAChB,aAAa;EACb,QAAQ;GACN;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,MAAM;IACP;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,cAAc;IACf;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,qBAAqB;IACtB;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,qBAAqB;IACtB;GACF;EACF;CACF"}
1
+ {"version":3,"file":"CarouselWidget-B9LsTYUF.mjs","names":["DOMPurify"],"sources":["../../widgets/src/widgets/CarouselWidget.tsx"],"sourcesContent":["import DOMPurify from \"dompurify\";\nimport { Button } from \"@fluid-app/ui-primitives\";\nimport { ScrollArrows } from \"../ui/scroll-arrows\";\nimport type { ComponentProps } from \"react\";\nimport { useEffect, useState, useCallback } from \"react\";\nimport type React from \"react\";\nimport {\n MediaRenderer,\n getMediaPropsFromWidgetSchema,\n} from \"../components/MediaRenderer\";\nimport type {\n WidgetSchema,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n AlignOptions,\n FontSizeOptions,\n PaddingOptions,\n ButtonSizeOptions,\n} from \"@fluid-app/portal-core/types\";\nimport {\n getHeightField,\n type WidgetPropertySchema,\n} from \"@fluid-app/portal-core/registries\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getPaddingField,\n getButtonSizeField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\n\nconst DEFAULT_SLIDES: CarouselSlide[] = [];\n\ntype CarouselSlide = {\n id: string;\n content: WidgetSchema;\n title?: string;\n description?: string;\n buttonEnabled?: boolean;\n buttonText?: string;\n buttonVariant?:\n | \"default\"\n | \"secondary\"\n | \"outline\"\n | \"destructive\"\n | \"ghost\"\n | \"link\";\n buttonLink?: string;\n};\n\ntype CarouselWidgetProps = ComponentProps<\"div\"> & {\n slides?: CarouselSlide[];\n autoScrollInterval?: number;\n enableAutoScroll?: boolean;\n\n // Layout\n align?: AlignOptions;\n carouselHeight?: string;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n padding?: PaddingOptions;\n\n // Text Styling\n headerSize?: FontSizeOptions;\n headerColor?: ColorOptions;\n textSize?: FontSizeOptions;\n textColor?: ColorOptions;\n textWidth?: string;\n\n // Button\n showButton?: boolean;\n buttonColor?: ColorOptions;\n buttonSize?: ButtonSizeOptions;\n\n // Overlay\n overlayEnabled?: boolean;\n overlayType?: \"solid\" | \"gradient\";\n overlayIntensity?: number;\n};\n\nexport function CarouselWidget({\n slides = DEFAULT_SLIDES,\n autoScrollInterval = 3000,\n enableAutoScroll = false,\n carouselHeight = \"400px\",\n align = { vertical: \"bottom\", horizontal: \"left\" },\n overlayIntensity = 40,\n borderRadius = \"none\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n padding = 0,\n textWidth = \"100%\",\n headerSize = \"lg\",\n headerColor = \"background\",\n textSize = \"md\",\n textColor = \"background\",\n showButton = true,\n buttonColor = \"background\",\n buttonSize = \"default\",\n overlayEnabled = true,\n overlayType = \"solid\",\n className,\n ...props\n}: CarouselWidgetProps): React.JSX.Element {\n const [currentIndex, setCurrentIndex] = useState(0);\n const [isHovered, setIsHovered] = useState(false);\n\n const hasSlides = slides.length > 0;\n const totalSlides = slides.length;\n\n const goToNext = useCallback(() => {\n if (!hasSlides) return;\n setCurrentIndex((prev) => {\n if (prev === totalSlides - 1) {\n return 0;\n }\n return prev + 1;\n });\n }, [hasSlides, totalSlides]);\n\n const goToPrevious = useCallback(() => {\n if (!hasSlides) return;\n setCurrentIndex((prev) => {\n if (prev === 0) {\n return totalSlides - 1;\n }\n return prev - 1;\n });\n }, [hasSlides, totalSlides]);\n\n const goToSlide = useCallback(\n (index: number) => {\n if (!hasSlides) return;\n if (index >= 0 && index < totalSlides) {\n setCurrentIndex(index);\n }\n },\n [hasSlides, totalSlides],\n );\n\n // Auto-scroll effect\n useEffect(() => {\n if (!enableAutoScroll || !hasSlides || isHovered) return;\n\n const intervalId = setInterval(() => {\n goToNext();\n }, autoScrollInterval);\n\n return () => clearInterval(intervalId);\n }, [enableAutoScroll, autoScrollInterval, hasSlides, isHovered, goToNext]);\n\n // Reset to first slide if slides change\n useEffect(() => {\n if (currentIndex >= totalSlides && totalSlides > 0) {\n setCurrentIndex(0);\n }\n }, [totalSlides, currentIndex]);\n\n if (!hasSlides) {\n return (\n <div\n className={`rounded-${borderRadius} ${className} w-full overflow-hidden`}\n style={{ minHeight: carouselHeight }}\n {...props}\n >\n <div\n className=\"bg-muted flex h-full w-full items-center justify-center\"\n style={{ minHeight: carouselHeight }}\n >\n <div className=\"text-muted-foreground flex flex-col items-center gap-2\">\n <div className=\"text-4xl\">🎠</div>\n <p className=\"text-sm\">No slides added</p>\n <p className=\"text-muted-foreground/70 text-xs\">\n Add slides to create a carousel\n </p>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={`relative w-full overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className}`}\n style={{ minHeight: carouselHeight }}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n {...props}\n >\n {/* Slides Container */}\n <div\n className=\"relative h-full w-full\"\n style={{ minHeight: carouselHeight }}\n >\n <div\n className=\"flex h-full transition-transform duration-500 ease-in-out\"\n style={{\n transform: `translateX(-${currentIndex * 100}%)`,\n }}\n >\n {slides.map((slide) => (\n <div\n key={slide.id}\n className=\"relative h-full w-full flex-shrink-0\"\n style={{ minWidth: \"100%\", minHeight: carouselHeight }}\n >\n {/* Background image/content layer */}\n <div className=\"absolute inset-0 z-0 h-full w-full\">\n <MediaRenderer\n {...getMediaPropsFromWidgetSchema(slide.content)}\n />\n </div>\n\n {/* Dark overlay for text readability */}\n {overlayEnabled && (\n <div\n className={`pointer-events-none absolute inset-0 z-9 ${\n overlayType === \"gradient\"\n ? \"bg-gradient-to-t from-black to-transparent\"\n : \"bg-black\"\n }`}\n style={{\n opacity:\n (Number(String(overlayIntensity).replace(\"%\", \"\")) ||\n 40) / 100,\n }}\n />\n )}\n\n {/* Content box */}\n <div\n className={`pointer-events-none absolute inset-x-0 z-10 flex px-3 ${\n align.horizontal === \"left\"\n ? \"justify-start\"\n : align.horizontal === \"center\"\n ? \"justify-center\"\n : \"justify-end\"\n } ${\n align.vertical === \"top\"\n ? \"top-0 pt-13\"\n : align.vertical === \"center\"\n ? \"top-1/2 -translate-y-1/2\"\n : \"bottom-0 pb-13\"\n }`}\n >\n <div\n className={`pointer-events-auto p-${padding} flex flex-col gap-3`}\n style={{ maxWidth: textWidth }}\n >\n {/* Heading and text */}\n <div className={`flex flex-col text-${align.horizontal}`}>\n {slide.title && (\n <h2\n className={`font-header mb-2 leading-tight font-bold text-${headerColor} text-${headerSize === \"md\" ? \"base\" : headerSize}`}\n >\n {slide.title}\n </h2>\n )}\n {slide.description && (\n <div\n className={`leading-snug text-${textColor} text-${textSize === \"md\" ? \"base\" : textSize} line-clamp-2`}\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(slide.description, {\n ALLOWED_TAGS: [\n \"br\",\n \"strong\",\n \"em\",\n \"b\",\n \"i\",\n \"ul\",\n \"ol\",\n \"li\",\n \"p\",\n ],\n ALLOWED_ATTR: [],\n }),\n }}\n />\n )}\n </div>\n\n {/* Button */}\n {slide.buttonText && slide.buttonEnabled && showButton && (\n <div className={`text-${align.horizontal}`}>\n <Button\n size={buttonSize}\n className={`rounded-md py-1 font-semibold bg-${buttonColor} text-${buttonColor}-foreground hover:bg-${buttonColor}/90`}\n asChild\n >\n <a href={slide.buttonLink}>{slide.buttonText}</a>\n </Button>\n </div>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n {/* Dots and Navigation */}\n {totalSlides > 1 && (\n <div\n className={`p-${padding} absolute bottom-0 z-10 flex w-full items-center justify-between ${align.horizontal === \"center\" ? \"h-full\" : \"\"}`}\n >\n {/* Pagination dots - always at bottom */}\n <div\n className={`flex items-center ${\n align.horizontal === \"center\"\n ? `p-${padding} absolute inset-x-0 bottom-3 justify-center`\n : \"\"\n }`}\n >\n <div\n className={`flex items-center gap-2 ${\n align.horizontal === \"center\" ? \"justify-center\" : \"\"\n }`}\n >\n {slides.map((_, index) => (\n <button\n key={`dot-${index}`}\n className={`h-[6px] w-[6px] rounded-full transition-colors ${\n index === currentIndex\n ? \"bg-background\"\n : \"bg-background/40 hover:bg-background/60\"\n }`}\n onClick={() => goToSlide(index)}\n aria-label={`Go to slide ${index + 1}`}\n aria-current={index === currentIndex ? \"true\" : \"false\"}\n />\n ))}\n </div>\n </div>\n\n {/* Navigation arrows - position changes based on alignment */}\n <div\n className={`flex items-center gap-[10px] ${\n align.horizontal === \"center\"\n ? `absolute inset-x-0 top-1/2 justify-between px-${padding}`\n : \"\"\n }`}\n >\n <ScrollArrows onPrevious={goToPrevious} onNext={goToNext} />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport const carouselWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"CarouselWidget\",\n displayName: \"Carousel\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"behavior\", label: \"Behavior\" },\n { id: \"data\", label: \"Data\" },\n ],\n dataSourceTargetProps: [\"slides\"],\n fields: [\n // Styling tab - Text Styling group\n getFontSizeField({\n defaultValue: \"lg\",\n key: \"headerSize\",\n label: \"Header Font Size\",\n description: \"Font size for the slide header\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n getColorField({\n defaultValue: \"background\",\n key: \"headerColor\",\n label: \"Header Color\",\n description: \"Color variant for the slide header\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n {\n key: \"separator\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Text Styling\",\n },\n getFontSizeField({\n defaultValue: \"md\",\n key: \"textSize\",\n label: \"Text Font Size\",\n description: \"Font size for the slide text\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n getColorField({\n defaultValue: \"background\",\n key: \"textColor\",\n label: \"Text Color\",\n description: \"Color variant for the slide text\",\n tab: \"styling\",\n group: \"Text Styling\",\n }),\n // Styling tab - Layout group\n {\n key: \"align\",\n label: \"Alignment\",\n type: \"alignment\",\n description: \"Alignment of the carousel content\",\n defaultValue: { vertical: \"bottom\", horizontal: \"left\" },\n options: {\n verticalEnabled: true,\n horizontalEnabled: true,\n },\n tab: \"styling\",\n group: \"Layout\",\n },\n {\n key: \"textWidth\",\n label: \"Content Width\",\n type: \"cssUnit\",\n description: \"Maximum width for slide content\",\n defaultValue: \"100%\",\n allowedUnits: [\"px\", \"rem\", \"%\"],\n defaultUnit: \"%\",\n minByUnit: { px: 50, rem: 3, \"%\": 10 },\n maxByUnit: { px: 1200, rem: 75, \"%\": 100 },\n stepByUnit: { px: 10, rem: 1, \"%\": 1 },\n tab: \"styling\",\n group: \"Layout\",\n },\n // Styling tab - Design group\n getHeightField({\n key: \"carouselHeight\",\n label: \"Carousel Height\",\n description: \"Height of the carousel\",\n defaultValue: \"400px\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator2\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n getBorderRadiusField({\n defaultValue: \"md\",\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Rounded corners for the carousel\",\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 getPaddingField({\n defaultValue: 4,\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding for the carousel\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"overlayEnabled\",\n label: \"Enable Overlay\",\n type: \"boolean\",\n description: \"Add background overlay to slide content\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"overlayType\",\n label: \"Overlay Type\",\n type: \"buttonGroup\",\n description: \"Type of overlay to add to the slide content\",\n defaultValue: \"gradient\",\n options: [\n { label: \"Solid\", value: \"solid\" },\n { label: \"Gradient\", value: \"gradient\" },\n ],\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"overlayIntensity\",\n label: \"Overlay Intensity\",\n type: \"slider\",\n description: \"Opacity of the overlay background (0-100)\",\n min: 0,\n max: 100,\n step: 5,\n defaultValue: 50,\n unit: \"%\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"overlayEnabled\",\n },\n {\n key: \"showButton\",\n label: \"Show Button\",\n type: \"boolean\",\n description: \"Display the button in slide content\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n getColorField({\n defaultValue: \"primary\",\n key: \"buttonColor\",\n label: \"Button Color\",\n description: \"Color variant for the slide button\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"showButton\",\n }),\n getButtonSizeField({\n defaultValue: \"default\",\n key: \"buttonSize\",\n label: \"Button Size\",\n description: \"Size of the slide button\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyToBeTrue: \"showButton\",\n }),\n // Behavior tab - Auto-Scroll group\n {\n key: \"enableAutoScroll\",\n label: \"Enable Auto-Scroll\",\n type: \"boolean\",\n description: \"Automatically advance to the next slide\",\n defaultValue: false,\n tab: \"behavior\",\n group: \"Auto-Scroll\",\n },\n {\n key: \"autoScrollInterval\",\n label: \"Auto-Scroll Interval (ms)\",\n type: \"number\",\n description: \"Time in milliseconds between automatic slide transitions\",\n min: 1000,\n max: 10000,\n step: 500,\n defaultValue: 3000,\n tab: \"behavior\",\n group: \"Auto-Scroll\",\n requiresKeyToBeTrue: \"enableAutoScroll\",\n },\n // Data tab - Data Configuration group\n {\n key: \"dataSource\",\n label: \"Data Source\",\n type: \"dataSource\",\n description: \"\",\n tab: \"data\",\n group: \"Data Configuration\",\n },\n ],\n // Per-item configuration schema for custom data sources\n itemConfigSchema: {\n description: \"Configure settings for this slide\",\n fields: [\n {\n key: \"title\",\n label: \"Custom Title\",\n type: \"text\",\n description: \"Override the item's title for this slide\",\n },\n {\n key: \"description\",\n label: \"Custom Description\",\n type: \"textarea\",\n description: \"Override the item's description for this slide\",\n rows: 3,\n },\n {\n key: \"buttonEnabled\",\n label: \"Show Button\",\n type: \"boolean\",\n description: \"Show the button in the slide\",\n defaultValue: false,\n },\n {\n key: \"buttonText\",\n label: \"Button Text\",\n type: \"text\",\n description: \"Text to display on the slide button\",\n requiresKeyToBeTrue: \"buttonEnabled\",\n },\n {\n key: \"buttonLink\",\n label: \"Button Link\",\n type: \"text\",\n description: \"URL for the slide button\",\n requiresKeyToBeTrue: \"buttonEnabled\",\n },\n ],\n },\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;AAoCA,MAAM,iBAAkC,EAAE;AAkD1C,SAAgB,eAAe,EAC7B,SAAS,gBACT,qBAAqB,KACrB,mBAAmB,OACnB,iBAAiB,SACjB,QAAQ;CAAE,UAAU;CAAU,YAAY;CAAQ,EAClD,mBAAmB,IACnB,eAAe,QACf,cAAc,QACd,cAAc,SACd,UAAU,GACV,YAAY,QACZ,aAAa,MACb,cAAc,cACd,WAAW,MACX,YAAY,cACZ,aAAa,MACb,cAAc,cACd,aAAa,WACb,iBAAiB,MACjB,cAAc,SACd,WACA,GAAG,SACsC;CACzC,MAAM,CAAC,cAAc,mBAAmB,SAAS,EAAE;CACnD,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CAEjD,MAAM,YAAY,OAAO,SAAS;CAClC,MAAM,cAAc,OAAO;CAE3B,MAAM,WAAW,kBAAkB;AACjC,MAAI,CAAC,UAAW;AAChB,mBAAiB,SAAS;AACxB,OAAI,SAAS,cAAc,EACzB,QAAO;AAET,UAAO,OA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AAK;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,SAAS,CACP;IAAE,OAAO;IAAS,OAAO;IAAS,EAClC;IAAE,OAAO;IAAY,OAAO;IAAY,CACzC;GACD,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,MAAM;GACN,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,cAAc;GACZ,cAAc;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,mBAAmB;GACjB,cAAc;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAEF;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;EAED;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,OAAO;GACR;EACF;CAED,kBAAkB;EAChB,aAAa;EACb,QAAQ;GACN;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACd;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,MAAM;IACP;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,cAAc;IACf;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,qBAAqB;IACtB;GACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,qBAAqB;IACtB;GACF;EACF;CACF"}
@@ -1,4 +1,4 @@
1
- import { n as __exportAll } from "./chunk-ByhMGyNw.mjs";
1
+ import { r as __exportAll } from "./es-CTLNkiWp.mjs";
2
2
  import { i as useDataSourceConfig, n as useWidgetPreviewContext, t as ErrorState } from "./error-state-BGEvTYIh.mjs";
3
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 "./registries-CM_NlECC.mjs";
4
4
  import { useQuery } from "@tanstack/react-query";
@@ -250,4 +250,4 @@ const catchUpWidgetPropertySchema = {
250
250
  //#endregion
251
251
  export { CatchUpWidget_exports as n, catchUpWidgetPropertySchema as r, CatchUpWidget as t };
252
252
 
253
- //# sourceMappingURL=CatchUpWidget-CSIXsR82.mjs.map
253
+ //# sourceMappingURL=CatchUpWidget-CSJdJgs-.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CatchUpWidget-CSIXsR82.mjs","names":[],"sources":["../../widgets/src/hooks/use-catchups.preview.ts","../../widgets/src/hooks/use-catchups.ts","../../widgets/src/widgets/CatchUpWidget.tsx"],"sourcesContent":["import type { CatchUp } from \"./use-catchups.types\";\n\nexport const PREVIEW_DATA: CatchUp[] = [\n { id: 1, suggestion_title: \"Check in with Sarah about her recent order\" },\n { id: 2, suggestion_title: \"Follow up with Mike on product samples\" },\n { id: 3, suggestion_title: \"Reconnect with Lisa — last contact 30 days ago\" },\n { id: 4, suggestion_title: \"Thank Alex for their referral last week\" },\n { id: 5, suggestion_title: \"Share new catalog with Jordan\" },\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-catchups.preview\";\n\nimport type { CatchUp } from \"./use-catchups.types\";\n\nexport type { CatchUp } from \"./use-catchups.types\";\n\nexport function useCatchUps(): UseQueryResult<CatchUp[], Error> {\n const { baseUrl, getApiHeaders } = useDataSourceConfig();\n const { isPreview } = useWidgetPreviewContext();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"catchups\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: async ({ signal }): Promise<CatchUp[]> => {\n const url = baseUrl\n ? `${baseUrl}/affiliate_catch_up_actions.json`\n : \"/affiliate_catch_up_actions.json\";\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 catch ups: ${response.status}`);\n }\n\n return response.json();\n },\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\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 getColorField,\n getFontSizeField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport { useCatchUps } from \"../hooks/use-catchups\";\nimport { Loader2, Sparkles } from \"lucide-react\";\nimport { ErrorState } from \"../components/error-state\";\n\n// Font size mapping for title\nconst fontSizeClasses: Record<FontSizeOptions, string> = {\n \"2xl\": \"text-2xl\",\n xl: \"text-xl\",\n lg: \"text-lg\",\n md: \"text-base\",\n sm: \"text-sm\",\n xs: \"text-xs\",\n};\n\ntype CatchUpWidgetProps = ComponentProps<\"div\"> & {\n // Title settings\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n // Design settings\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n // Display settings\n maxItems?: number;\n};\n\nexport function CatchUpWidget({\n // Title settings with defaults\n titleEnabled = true,\n titleText = \"Catch Ups\",\n titleFontSize = \"xl\",\n titleColor = \"foreground\",\n // Design settings with 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 // Display settings with defaults\n maxItems = 5,\n className,\n ...props\n}: CatchUpWidgetProps): 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 = [], isLoading, isError } = useCatchUps();\n\n const catchUpsToShow = data.slice(0, maxItems);\n const moreCatchUps = data.length - catchUpsToShow.length;\n\n return (\n <div\n className={`flex flex-col rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-${backgroundColor} p-${padding} text-${textColor} ${className || \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between\">\n {titleEnabled && (\n <h3\n className={`${fontSizeClasses[titleFontSize]} font-header font-semibold text-${titleColor}`}\n >\n {titleText}\n </h3>\n )}\n {!isLoading && !isError && data.length > 0 && (\n <span className={`text-3xl font-bold text-${accentColor}`}>\n {data.length}\n </span>\n )}\n </div>\n\n {/* Loading state */}\n {isLoading ? (\n <div className=\"flex min-h-[150px] flex-1 items-center justify-center\">\n <Loader2 className={`h-8 w-8 animate-spin text-${accentColor}`} />\n </div>\n ) : isError ? (\n /* Error state */\n <ErrorState />\n ) : data.length === 0 ? (\n /* Empty state */\n <div className=\"flex min-h-[150px] flex-1 flex-col items-center justify-center gap-2\">\n <Sparkles className={`h-8 w-8 text-${accentColor}`} />\n <p className=\"text-center font-semibold\">\n You&apos;re all caught up.\n </p>\n <p className=\"text-sm opacity-60\">See you next time!</p>\n </div>\n ) : (\n /* Default state with catch ups */\n <>\n <div className=\"mt-3 flex-1\">\n {catchUpsToShow.map((catchUp, index: number) => (\n <div\n key={catchUp.id || index}\n className={`py-2 ${index !== catchUpsToShow.length - 1 ? \"border-b border-current/10\" : \"\"}`}\n >\n <p className=\"line-clamp-1 text-sm\">\n {catchUp.suggestion_title}\n </p>\n </div>\n ))}\n </div>\n\n {/* More indicator */}\n {moreCatchUps > 0 && (\n <p className=\"mt-2 text-sm opacity-60\">\n {moreCatchUps} more catch up{moreCatchUps > 1 ? \"s\" : \"\"}\n </p>\n )}\n </>\n )}\n </div>\n );\n}\n\n// Property schema for the widget editor\nexport const catchUpWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"CatchUpWidget\",\n displayName: \"Catch Up 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 catch ups\",\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 catch ups\",\n defaultValue: \"Catch Ups\",\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 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 catch up 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 display and icons\",\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 catch ups to display\",\n defaultValue: 5,\n min: 1,\n max: 10,\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the 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 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,MAAa,eAA0B;CACrC;EAAE,IAAI;EAAG,kBAAkB;EAA8C;CACzE;EAAE,IAAI;EAAG,kBAAkB;EAA0C;CACrE;EAAE,IAAI;EAAG,kBAAkB;EAAkD;CAC7E;EAAE,IAAI;EAAG,kBAAkB;EAA2C;CACtE;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AAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;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,cAAc;GACd,KAAK;GACL,KAAK;GACL,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"}
1
+ {"version":3,"file":"CatchUpWidget-CSJdJgs-.mjs","names":[],"sources":["../../widgets/src/hooks/use-catchups.preview.ts","../../widgets/src/hooks/use-catchups.ts","../../widgets/src/widgets/CatchUpWidget.tsx"],"sourcesContent":["import type { CatchUp } from \"./use-catchups.types\";\n\nexport const PREVIEW_DATA: CatchUp[] = [\n { id: 1, suggestion_title: \"Check in with Sarah about her recent order\" },\n { id: 2, suggestion_title: \"Follow up with Mike on product samples\" },\n { id: 3, suggestion_title: \"Reconnect with Lisa — last contact 30 days ago\" },\n { id: 4, suggestion_title: \"Thank Alex for their referral last week\" },\n { id: 5, suggestion_title: \"Share new catalog with Jordan\" },\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-catchups.preview\";\n\nimport type { CatchUp } from \"./use-catchups.types\";\n\nexport type { CatchUp } from \"./use-catchups.types\";\n\nexport function useCatchUps(): UseQueryResult<CatchUp[], Error> {\n const { baseUrl, getApiHeaders } = useDataSourceConfig();\n const { isPreview } = useWidgetPreviewContext();\n\n return useQuery({\n queryKey: [\n \"portal-widget-use\",\n \"catchups\",\n isPreview ? \"preview\" : baseUrl,\n ] as const,\n queryFn: async ({ signal }): Promise<CatchUp[]> => {\n const url = baseUrl\n ? `${baseUrl}/affiliate_catch_up_actions.json`\n : \"/affiliate_catch_up_actions.json\";\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 catch ups: ${response.status}`);\n }\n\n return response.json();\n },\n enabled: !isPreview,\n ...(isPreview && { placeholderData: PREVIEW_DATA }),\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 getColorField,\n getFontSizeField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport { useCatchUps } from \"../hooks/use-catchups\";\nimport { Loader2, Sparkles } from \"lucide-react\";\nimport { ErrorState } from \"../components/error-state\";\n\n// Font size mapping for title\nconst fontSizeClasses: Record<FontSizeOptions, string> = {\n \"2xl\": \"text-2xl\",\n xl: \"text-xl\",\n lg: \"text-lg\",\n md: \"text-base\",\n sm: \"text-sm\",\n xs: \"text-xs\",\n};\n\ntype CatchUpWidgetProps = ComponentProps<\"div\"> & {\n // Title settings\n titleEnabled?: boolean;\n titleText?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n // Design settings\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n // Display settings\n maxItems?: number;\n};\n\nexport function CatchUpWidget({\n // Title settings with defaults\n titleEnabled = true,\n titleText = \"Catch Ups\",\n titleFontSize = \"xl\",\n titleColor = \"foreground\",\n // Design settings with 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 // Display settings with defaults\n maxItems = 5,\n className,\n ...props\n}: CatchUpWidgetProps): 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 = [], isLoading, isError } = useCatchUps();\n\n const catchUpsToShow = data.slice(0, maxItems);\n const moreCatchUps = data.length - catchUpsToShow.length;\n\n return (\n <div\n className={`flex flex-col rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-${backgroundColor} p-${padding} text-${textColor} ${className || \"\"}`}\n style={{ backgroundImage }}\n {...props}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between\">\n {titleEnabled && (\n <h3\n className={`${fontSizeClasses[titleFontSize]} font-header font-semibold text-${titleColor}`}\n >\n {titleText}\n </h3>\n )}\n {!isLoading && !isError && data.length > 0 && (\n <span className={`text-3xl font-bold text-${accentColor}`}>\n {data.length}\n </span>\n )}\n </div>\n\n {/* Loading state */}\n {isLoading ? (\n <div className=\"flex min-h-[150px] flex-1 items-center justify-center\">\n <Loader2 className={`h-8 w-8 animate-spin text-${accentColor}`} />\n </div>\n ) : isError ? (\n /* Error state */\n <ErrorState />\n ) : data.length === 0 ? (\n /* Empty state */\n <div className=\"flex min-h-[150px] flex-1 flex-col items-center justify-center gap-2\">\n <Sparkles className={`h-8 w-8 text-${accentColor}`} />\n <p className=\"text-center font-semibold\">\n You&apos;re all caught up.\n </p>\n <p className=\"text-sm opacity-60\">See you next time!</p>\n </div>\n ) : (\n /* Default state with catch ups */\n <>\n <div className=\"mt-3 flex-1\">\n {catchUpsToShow.map((catchUp, index: number) => (\n <div\n key={catchUp.id || index}\n className={`py-2 ${index !== catchUpsToShow.length - 1 ? \"border-b border-current/10\" : \"\"}`}\n >\n <p className=\"line-clamp-1 text-sm\">\n {catchUp.suggestion_title}\n </p>\n </div>\n ))}\n </div>\n\n {/* More indicator */}\n {moreCatchUps > 0 && (\n <p className=\"mt-2 text-sm opacity-60\">\n {moreCatchUps} more catch up{moreCatchUps > 1 ? \"s\" : \"\"}\n </p>\n )}\n </>\n )}\n </div>\n );\n}\n\n// Property schema for the widget editor\nexport const catchUpWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"CatchUpWidget\",\n displayName: \"Catch Up 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 catch ups\",\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 catch ups\",\n defaultValue: \"Catch Ups\",\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 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 catch up 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 display and icons\",\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 catch ups to display\",\n defaultValue: 5,\n min: 1,\n max: 10,\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding around the 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 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,MAAa,eAA0B;CACrC;EAAE,IAAI;EAAG,kBAAkB;EAA8C;CACzE;EAAE,IAAI;EAAG,kBAAkB;EAA0C;CACrE;EAAE,IAAI;EAAG,kBAAkB;EAAkD;CAC7E;EAAE,IAAI;EAAG,kBAAkB;EAA2C;CACtE;EAAE,IAAI;EAAG,kBAAkB;EAAiC;CAC7D;;;ACCD,SAAgB,cAAgD;CAC9D,MAAM,EAAE,SAAS,kBAAkB,qBAAqB;CACxD,MAAM,EAAE,cAAc,yBAAyB;AAE/C,QAAO,SAAS;EACd,UAAU;GACR;GACA;GACA,YAAY,YAAY;GACzB;EACD,SAAS,OAAO,EAAE,aAAiC;GACjD,MAAM,MAAM,UACR,GAAG,QAAQ,oCACX;GACJ,MAAM,WAAW,MAAM,MAAM,KAAK;IAChC,SAAS;KACP,gBAAgB;KAChB,GAAG,iBAAiB;KACrB;IACD;IACD,CAAC;AAEF,OAAI,CAAC,SAAS,GACZ,OAAM,IAAI,MAAM,8BAA8B,SAAS,SAAS;AAGlE,UAAO,SAAS,MAAM;;EAExB,SAAS,CAAC;EACV,GAAI,aAAa,EAAE,iBAAiB,cAAc;EACnD,CAAC;;;;;;;;ACbJ,MAAM,kBAAmD;CACvD,OAAO;CACP,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAoBD,SAAgB,cAAc,EAE5B,eAAe,MACf,YAAY,aACZ,gBAAgB,MAChB,aAAa,cAEb,aAAa;CACX,MAAM;CACN,OAAO;CACR,EACD,YAAY,cACZ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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"}
@@ -1,4 +1,4 @@
1
- import { n as __exportAll } from "./chunk-ByhMGyNw.mjs";
1
+ import { r as __exportAll } from "./es-CTLNkiWp.mjs";
2
2
  import { i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, p as getHeightField, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-CM_NlECC.mjs";
3
3
  import { _t as ChartTooltip, gt as ChartLegendContent, ht as ChartLegend, mt as ChartContainer, vt as ChartTooltipContent, yt as Card } from "./src-Duo2Iuw-.mjs";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -425,4 +425,4 @@ const chartWidgetPropertySchema = {
425
425
  //#endregion
426
426
  export { ChartWidget_exports as n, chartWidgetPropertySchema as r, ChartWidget as t };
427
427
 
428
- //# sourceMappingURL=ChartWidget-88hpX7ft.mjs.map
428
+ //# sourceMappingURL=ChartWidget-Cpzqi6W4.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartWidget-88hpX7ft.mjs","names":["RechartsBarChart","RechartsLineChart","RechartsAreaChart","RechartsPieChart"],"sources":["../../widgets/src/widgets/ChartWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n Card,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n} from \"@fluid-app/ui-primitives\";\nimport type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n Bar,\n BarChart as RechartsBarChart,\n Line,\n LineChart as RechartsLineChart,\n Area,\n AreaChart as RechartsAreaChart,\n Pie,\n PieChart as RechartsPieChart,\n XAxis,\n YAxis,\n CartesianGrid,\n} from \"recharts\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getHeightField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\n\ntype ChartDataPoint = Record<string, unknown>;\n\ntype ChartWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n title?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Description\n description?: string;\n descriptionFontSize?: FontSizeOptions;\n descriptionColor?: ColorOptions;\n\n // Design\n chartType?: \"bar\" | \"line\" | \"area\" | \"pie\";\n showLegend?: boolean;\n showTooltip?: boolean;\n showGrid?: boolean;\n width?: string;\n height?: string;\n background?: BackgroundValue;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Data\n dataKey?: string;\n xAxisKey?: string;\n /** Chart data - when provided via dataSource, this overrides defaultData */\n data?: ChartDataPoint[];\n /** Chart configuration - can be dynamically provided via dataSource */\n chartConfig?: Record<string, { label: string; color: string }>;\n};\n\n// Default sample data for demonstration\nconst defaultData = [\n { name: \"Jan\", value: 186 },\n { name: \"Feb\", value: 305 },\n { name: \"Mar\", value: 237 },\n { name: \"Apr\", value: 273 },\n { name: \"May\", value: 209 },\n { name: \"Jun\", value: 214 },\n];\n\n// Pie chart data with individual fill properties\nconst defaultPieData = [\n { name: \"Jan\", value: 186, fill: \"var(--chart-1)\" },\n { name: \"Feb\", value: 305, fill: \"var(--chart-2)\" },\n { name: \"Mar\", value: 237, fill: \"var(--chart-3)\" },\n { name: \"Apr\", value: 273, fill: \"var(--chart-4)\" },\n { name: \"May\", value: 209, fill: \"var(--chart-5)\" },\n];\n\nconst defaultChartConfig = {\n value: {\n label: \"Value\",\n color: \"var(--chart-1)\",\n },\n};\n\nexport function ChartWidget({\n titleEnabled = true,\n title = \"Chart Widget\",\n titleFontSize = \"lg\",\n titleColor = \"foreground\",\n\n description = \"Displaying sample data\",\n descriptionFontSize = \"md\",\n descriptionColor = \"foreground\",\n\n chartType = \"bar\",\n showLegend = false,\n showTooltip = true,\n showGrid = true,\n width = \"100%\",\n height = \"300px\",\n background = {\n type: \"solid\",\n color: \"background\",\n },\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n dataKey = \"value\",\n xAxisKey = \"name\",\n data,\n chartConfig,\n className,\n ...props\n}: ChartWidgetProps): 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 // Use provided data or fall back to default\n const chartData = data ?? defaultData;\n const chartPieData =\n chartType === \"pie\" && data\n ? data.map((item, index) => ({\n ...item,\n fill: `var(--chart-${(index % 5) + 1})`,\n }))\n : defaultPieData;\n const config = chartConfig ?? defaultChartConfig;\n const chartElement = (() => {\n switch (chartType) {\n case \"bar\":\n return (\n <RechartsBarChart data={chartData}>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" />}\n <XAxis dataKey={xAxisKey} />\n <YAxis />\n {showTooltip && <ChartTooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Bar dataKey={dataKey} fill=\"var(--color-value)\" radius={8} />\n </RechartsBarChart>\n );\n\n case \"line\":\n return (\n <RechartsLineChart data={chartData}>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" />}\n <XAxis dataKey={xAxisKey} />\n <YAxis />\n {showTooltip && <ChartTooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Line\n type=\"monotone\"\n dataKey={dataKey}\n stroke=\"var(--color-value)\"\n strokeWidth={2}\n dot={{ r: 4 }}\n />\n </RechartsLineChart>\n );\n\n case \"area\":\n return (\n <RechartsAreaChart data={chartData}>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" />}\n <XAxis dataKey={xAxisKey} />\n <YAxis />\n {showTooltip && <ChartTooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Area\n type=\"monotone\"\n dataKey={dataKey}\n stroke=\"var(--color-value)\"\n fill=\"var(--color-value)\"\n fillOpacity={0.6}\n />\n </RechartsAreaChart>\n );\n\n case \"pie\":\n return (\n <RechartsPieChart>\n {showTooltip && (\n <ChartTooltip content={<ChartTooltipContent hideLabel />} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Pie\n data={chartPieData}\n dataKey={dataKey}\n nameKey={xAxisKey}\n cx=\"50%\"\n cy=\"50%\"\n outerRadius={80}\n label\n />\n </RechartsPieChart>\n );\n\n default:\n // Fallback to bar chart for unknown chart types\n return (\n <RechartsBarChart data={chartData}>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" />}\n <XAxis dataKey={xAxisKey} />\n <YAxis />\n {showTooltip && <ChartTooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Bar dataKey={dataKey} fill=\"var(--color-value)\" radius={8} />\n </RechartsBarChart>\n );\n }\n })();\n\n return (\n <Card\n className={`bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className}`}\n style={{\n width,\n maxWidth: \"100%\",\n backgroundImage,\n }}\n {...props}\n >\n <div className=\"p-6\">\n <div className=\"mb-4\">\n {titleEnabled && (\n <h3\n className={`text-${titleFontSize} text-${titleColor} font-header font-bold`}\n >\n {title}\n </h3>\n )}\n {description && (\n <p\n className={`text-${descriptionFontSize} text-${descriptionColor}`}\n >\n {description}\n </p>\n )}\n </div>\n <ChartContainer config={config} style={{ height }}>\n {chartElement}\n </ChartContainer>\n </div>\n </Card>\n );\n}\n\nexport const chartWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ChartWidget\",\n displayName: \"Chart\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"data\", label: \"Data\" },\n ],\n dataSourceTargetProps: [\"data\", \"chartConfig\"],\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 chart\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"The chart title\",\n defaultValue: \"Chart Widget\",\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 chart title\",\n defaultValue: \"lg\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the chart title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Content Tab - Description Group\n {\n key: \"description\",\n label: \"Description\",\n type: \"textarea\",\n description: \"The chart description\",\n rows: 2,\n defaultValue: \"Displaying sample data\",\n tab: \"styling\",\n group: \"Description\",\n },\n getFontSizeField({\n key: \"descriptionFontSize\",\n label: \"Description Font Size\",\n description: \"Font size for the chart description\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Description\",\n }),\n getColorField({\n key: \"descriptionColor\",\n label: \"Description Color\",\n description: \"Color for the chart description\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Description\",\n }),\n\n // Styling Tab - Design Group\n {\n key: \"chartType\",\n label: \"Chart Type\",\n type: \"select\",\n description: \"Type of chart to display\",\n options: [\n { label: \"Bar Chart\", value: \"bar\" },\n { label: \"Line Chart\", value: \"line\" },\n { label: \"Area Chart\", value: \"area\" },\n { label: \"Pie Chart\", value: \"pie\" },\n ],\n defaultValue: \"bar\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"showLegend\",\n label: \"Show Legend\",\n type: \"boolean\",\n description: \"Display chart legend\",\n defaultValue: false,\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"showTooltip\",\n label: \"Show Tooltip\",\n type: \"boolean\",\n description: \"Display tooltip on hover\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"showGrid\",\n label: \"Show Grid\",\n type: \"boolean\",\n description: \"Display background grid lines\",\n defaultValue: true,\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: \"width\",\n label: \"Width\",\n type: \"text\",\n description:\n \"Width of the chart container (CSS value, e.g., 100%, 600px)\",\n defaultValue: \"100%\",\n tab: \"styling\",\n group: \"Design\",\n },\n getHeightField({\n key: \"height\",\n label: \"Height\",\n description: \"Height of the chart\",\n defaultValue: \"300px\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator2\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the chart container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding for the chart 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 chart 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 // Data Tab - Data Group\n {\n key: \"dataSource\",\n label: \"Data Source\",\n type: \"dataSource\",\n description: \"Configure dynamic data fetching from an API\",\n tab: \"data\",\n group: \"Data\",\n },\n {\n key: \"dataKey\",\n label: \"Data Key\",\n type: \"select\",\n description: \"Key in the data to use for chart values\",\n options: [{ label: \"value\", value: \"value\" }],\n defaultValue: \"value\",\n tab: \"data\",\n group: \"Data\",\n },\n {\n key: \"xAxisKey\",\n label: \"X-Axis Key\",\n type: \"select\",\n description: \"Key in the data to use for X-axis labels\",\n options: [{ label: \"name\", value: \"name\" }],\n defaultValue: \"name\",\n tab: \"data\",\n group: \"Data\",\n },\n ],\n} satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;AAiFA,MAAM,cAAc;CAClB;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC5B;AAGD,MAAM,iBAAiB;CACrB;EAAE,MAAM;EAAO,OAAO;EAAK,MAAM;EAAkB;CACnD;EAAE,MAAM;EAAO,OAAO;EAAK,MAAM;EAAkB;CACnD;EAAE,MAAM;EAAO,OAAO;EAAK,MAAM;EAAkB;CACnD;EAAE,MAAM;EAAO,OAAO;EAAK,MAAM;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O;GACP,qBAAqB;GACtB;EACD,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,iBAAiB;GACf,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;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;IACP;KAAE,OAAO;KAAa,OAAO;KAAO;IACpC;KAAE,OAAO;KAAc,OAAO;KAAQ;IACtC;KAAE,OAAO;KAAc,OAAO;KAAQ;IACtC;KAAE,OAAO;KAAa,OAAO;KAAO;IACrC;GACD,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,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,eAAe;GACb,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,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,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,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CAAC;IAAE,OAAO;IAAS,OAAO;IAAS,CAAC;GAC7C,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CAAC;IAAE,OAAO;IAAQ,OAAO;IAAQ,CAAC;GAC3C,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACF;CACF"}
1
+ {"version":3,"file":"ChartWidget-Cpzqi6W4.mjs","names":["RechartsBarChart","RechartsLineChart","RechartsAreaChart","RechartsPieChart"],"sources":["../../widgets/src/widgets/ChartWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport {\n Card,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n} from \"@fluid-app/ui-primitives\";\nimport type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n Bar,\n BarChart as RechartsBarChart,\n Line,\n LineChart as RechartsLineChart,\n Area,\n AreaChart as RechartsAreaChart,\n Pie,\n PieChart as RechartsPieChart,\n XAxis,\n YAxis,\n CartesianGrid,\n} from \"recharts\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n getColorField,\n getFontSizeField,\n getHeightField,\n getPaddingField,\n borderWidthClasses,\n borderColorClasses,\n} from \"../core/fields\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n FontSizeOptions,\n PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\n\ntype ChartDataPoint = Record<string, unknown>;\n\ntype ChartWidgetProps = ComponentProps<\"div\"> & {\n // Title\n titleEnabled?: boolean;\n title?: string;\n titleFontSize?: FontSizeOptions;\n titleColor?: ColorOptions;\n\n // Description\n description?: string;\n descriptionFontSize?: FontSizeOptions;\n descriptionColor?: ColorOptions;\n\n // Design\n chartType?: \"bar\" | \"line\" | \"area\" | \"pie\";\n showLegend?: boolean;\n showTooltip?: boolean;\n showGrid?: boolean;\n width?: string;\n height?: string;\n background?: BackgroundValue;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n\n // Data\n dataKey?: string;\n xAxisKey?: string;\n /** Chart data - when provided via dataSource, this overrides defaultData */\n data?: ChartDataPoint[];\n /** Chart configuration - can be dynamically provided via dataSource */\n chartConfig?: Record<string, { label: string; color: string }>;\n};\n\n// Default sample data for demonstration\nconst defaultData = [\n { name: \"Jan\", value: 186 },\n { name: \"Feb\", value: 305 },\n { name: \"Mar\", value: 237 },\n { name: \"Apr\", value: 273 },\n { name: \"May\", value: 209 },\n { name: \"Jun\", value: 214 },\n];\n\n// Pie chart data with individual fill properties\nconst defaultPieData = [\n { name: \"Jan\", value: 186, fill: \"var(--chart-1)\" },\n { name: \"Feb\", value: 305, fill: \"var(--chart-2)\" },\n { name: \"Mar\", value: 237, fill: \"var(--chart-3)\" },\n { name: \"Apr\", value: 273, fill: \"var(--chart-4)\" },\n { name: \"May\", value: 209, fill: \"var(--chart-5)\" },\n];\n\nconst defaultChartConfig = {\n value: {\n label: \"Value\",\n color: \"var(--chart-1)\",\n },\n};\n\nexport function ChartWidget({\n titleEnabled = true,\n title = \"Chart Widget\",\n titleFontSize = \"lg\",\n titleColor = \"foreground\",\n\n description = \"Displaying sample data\",\n descriptionFontSize = \"md\",\n descriptionColor = \"foreground\",\n\n chartType = \"bar\",\n showLegend = false,\n showTooltip = true,\n showGrid = true,\n width = \"100%\",\n height = \"300px\",\n background = {\n type: \"solid\",\n color: \"background\",\n },\n padding = 4,\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n\n dataKey = \"value\",\n xAxisKey = \"name\",\n data,\n chartConfig,\n className,\n ...props\n}: ChartWidgetProps): 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 // Use provided data or fall back to default\n const chartData = data ?? defaultData;\n const chartPieData =\n chartType === \"pie\" && data\n ? data.map((item, index) => ({\n ...item,\n fill: `var(--chart-${(index % 5) + 1})`,\n }))\n : defaultPieData;\n const config = chartConfig ?? defaultChartConfig;\n const chartElement = (() => {\n switch (chartType) {\n case \"bar\":\n return (\n <RechartsBarChart data={chartData}>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" />}\n <XAxis dataKey={xAxisKey} />\n <YAxis />\n {showTooltip && <ChartTooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Bar dataKey={dataKey} fill=\"var(--color-value)\" radius={8} />\n </RechartsBarChart>\n );\n\n case \"line\":\n return (\n <RechartsLineChart data={chartData}>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" />}\n <XAxis dataKey={xAxisKey} />\n <YAxis />\n {showTooltip && <ChartTooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Line\n type=\"monotone\"\n dataKey={dataKey}\n stroke=\"var(--color-value)\"\n strokeWidth={2}\n dot={{ r: 4 }}\n />\n </RechartsLineChart>\n );\n\n case \"area\":\n return (\n <RechartsAreaChart data={chartData}>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" />}\n <XAxis dataKey={xAxisKey} />\n <YAxis />\n {showTooltip && <ChartTooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Area\n type=\"monotone\"\n dataKey={dataKey}\n stroke=\"var(--color-value)\"\n fill=\"var(--color-value)\"\n fillOpacity={0.6}\n />\n </RechartsAreaChart>\n );\n\n case \"pie\":\n return (\n <RechartsPieChart>\n {showTooltip && (\n <ChartTooltip content={<ChartTooltipContent hideLabel />} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Pie\n data={chartPieData}\n dataKey={dataKey}\n nameKey={xAxisKey}\n cx=\"50%\"\n cy=\"50%\"\n outerRadius={80}\n label\n />\n </RechartsPieChart>\n );\n\n default:\n // Fallback to bar chart for unknown chart types\n return (\n <RechartsBarChart data={chartData}>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" />}\n <XAxis dataKey={xAxisKey} />\n <YAxis />\n {showTooltip && <ChartTooltip content={<ChartTooltipContent />} />}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n <Bar dataKey={dataKey} fill=\"var(--color-value)\" radius={8} />\n </RechartsBarChart>\n );\n }\n })();\n\n return (\n <Card\n className={`bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className}`}\n style={{\n width,\n maxWidth: \"100%\",\n backgroundImage,\n }}\n {...props}\n >\n <div className=\"p-6\">\n <div className=\"mb-4\">\n {titleEnabled && (\n <h3\n className={`text-${titleFontSize} text-${titleColor} font-header font-bold`}\n >\n {title}\n </h3>\n )}\n {description && (\n <p\n className={`text-${descriptionFontSize} text-${descriptionColor}`}\n >\n {description}\n </p>\n )}\n </div>\n <ChartContainer config={config} style={{ height }}>\n {chartElement}\n </ChartContainer>\n </div>\n </Card>\n );\n}\n\nexport const chartWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"ChartWidget\",\n displayName: \"Chart\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"data\", label: \"Data\" },\n ],\n dataSourceTargetProps: [\"data\", \"chartConfig\"],\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 chart\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Title\",\n },\n {\n key: \"title\",\n label: \"Title\",\n type: \"text\",\n description: \"The chart title\",\n defaultValue: \"Chart Widget\",\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 chart title\",\n defaultValue: \"lg\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n getColorField({\n key: \"titleColor\",\n label: \"Title Color\",\n description: \"Color for the chart title\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Title\",\n requiresKeyToBeTrue: \"titleEnabled\",\n }),\n\n // Content Tab - Description Group\n {\n key: \"description\",\n label: \"Description\",\n type: \"textarea\",\n description: \"The chart description\",\n rows: 2,\n defaultValue: \"Displaying sample data\",\n tab: \"styling\",\n group: \"Description\",\n },\n getFontSizeField({\n key: \"descriptionFontSize\",\n label: \"Description Font Size\",\n description: \"Font size for the chart description\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Description\",\n }),\n getColorField({\n key: \"descriptionColor\",\n label: \"Description Color\",\n description: \"Color for the chart description\",\n defaultValue: \"foreground\",\n tab: \"styling\",\n group: \"Description\",\n }),\n\n // Styling Tab - Design Group\n {\n key: \"chartType\",\n label: \"Chart Type\",\n type: \"select\",\n description: \"Type of chart to display\",\n options: [\n { label: \"Bar Chart\", value: \"bar\" },\n { label: \"Line Chart\", value: \"line\" },\n { label: \"Area Chart\", value: \"area\" },\n { label: \"Pie Chart\", value: \"pie\" },\n ],\n defaultValue: \"bar\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"showLegend\",\n label: \"Show Legend\",\n type: \"boolean\",\n description: \"Display chart legend\",\n defaultValue: false,\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"showTooltip\",\n label: \"Show Tooltip\",\n type: \"boolean\",\n description: \"Display tooltip on hover\",\n defaultValue: true,\n tab: \"styling\",\n group: \"Design\",\n },\n {\n key: \"showGrid\",\n label: \"Show Grid\",\n type: \"boolean\",\n description: \"Display background grid lines\",\n defaultValue: true,\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: \"width\",\n label: \"Width\",\n type: \"text\",\n description:\n \"Width of the chart container (CSS value, e.g., 100%, 600px)\",\n defaultValue: \"100%\",\n tab: \"styling\",\n group: \"Design\",\n },\n getHeightField({\n key: \"height\",\n label: \"Height\",\n description: \"Height of the chart\",\n defaultValue: \"300px\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"separator2\",\n type: \"separator\",\n label: \"Separator\",\n tab: \"styling\",\n group: \"Design\",\n },\n {\n type: \"background\",\n key: \"background\",\n label: \"Background\",\n description: \"Background for the chart container\",\n defaultValue: \"background\",\n tab: \"styling\",\n group: \"Design\",\n },\n getPaddingField({\n key: \"padding\",\n label: \"Padding\",\n description: \"Padding for the chart 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 chart 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 // Data Tab - Data Group\n {\n key: \"dataSource\",\n label: \"Data Source\",\n type: \"dataSource\",\n description: \"Configure dynamic data fetching from an API\",\n tab: \"data\",\n group: \"Data\",\n },\n {\n key: \"dataKey\",\n label: \"Data Key\",\n type: \"select\",\n description: \"Key in the data to use for chart values\",\n options: [{ label: \"value\", value: \"value\" }],\n defaultValue: \"value\",\n tab: \"data\",\n group: \"Data\",\n },\n {\n key: \"xAxisKey\",\n label: \"X-Axis Key\",\n type: \"select\",\n description: \"Key in the data to use for X-axis labels\",\n options: [{ label: \"name\", value: \"name\" }],\n defaultValue: \"name\",\n tab: \"data\",\n group: \"Data\",\n },\n ],\n} satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;AAiFA,MAAM,cAAc;CAClB;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC3B;EAAE,MAAM;EAAO,OAAO;EAAK;CAC5B;AAGD,MAAM,iBAAiB;CACrB;EAAE,MAAM;EAAO,OAAO;EAAK,MAAM;EAAkB;CACnD;EAAE,MAAM;EAAO,OAAO;EAAK,MAAM;EAAkB;CACnD;EAAE,MAAM;EAAO,OAAO;EAAK,MAAM;EAAkB;CACnD;EAAE,MAAM;EAAO,OAAO;EAAK,MAAM;EAAkB;CACnD;EAAE,MAAM;EAAO,OAAO;EAAK,MAAM;EAAkB;CACpD;AAED,MAAM,qBAAqB,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,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,MAAM;GACN,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,iBAAiB;GACf,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;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;IACP;KAAE,OAAO;KAAa,OAAO;KAAO;IACpC;KAAE,OAAO;KAAc,OAAO;KAAQ;IACtC;KAAE,OAAO;KAAc,OAAO;KAAQ;IACtC;KAAE,OAAO;KAAa,OAAO;KAAO;IACrC;GACD,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,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD,eAAe;GACb,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,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,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,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CAAC;IAAE,OAAO;IAAS,OAAO;IAAS,CAAC;GAC7C,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CAAC;IAAE,OAAO;IAAQ,OAAO;IAAQ,CAAC;GAC3C,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACF;CACF"}
@@ -1,11 +1,11 @@
1
- import { n as __exportAll } from "./chunk-ByhMGyNw.mjs";
2
- import { n as useFluidContext, u as usePortalTenantClient, yt as createFetchClient } from "./FluidProvider-B-f_JVal.mjs";
1
+ import { r as __exportAll } from "./es-CTLNkiWp.mjs";
2
+ import { n as useFluidContext, u as usePortalTenantClient, yt as createFetchClient } from "./FluidProvider-BUdNsR8f.mjs";
3
3
  import { r as parseApiErrors, t as createPortalTenantCountriesAdapter } from "./portal-tenant-countries-adapter-C3HVoAls.mjs";
4
4
  import { $t as AvatarImage, A as SelectContent, C as SheetContent, Ct as CardHeader, E as SheetTitle, G as DropdownMenuContent, Gt as BreadcrumbItem, J as DropdownMenuSeparator, Jt as BreadcrumbPage, K as DropdownMenuItem, Kt as BreadcrumbLink, M as SelectTrigger, N as SelectValue, P as Input, Q as DropdownMenuTrigger, Qt as AvatarFallback, S as Sheet, T as SheetHeader, U as Label, W as DropdownMenu, Wt as Breadcrumb, Xt as Badge, Yt as BreadcrumbSeparator, Zt as Avatar, _n as cn, an as AlertDialogFooter, c as TabsList, cn as AlertDialogTitle, d as TableBody, en as AlertDialog, f as TableCell, gn as useZodForm, h as TableRow, i as TooltipTrigger, in as AlertDialogDescription, j as SelectItem, k as Select, l as TabsTrigger, ln as Button, m as TableHeader, n as TooltipContent, nn as AlertDialogCancel, o as Tabs, on as AlertDialogHeader, p as TableHead, q as DropdownMenuLabel, qt as BreadcrumbList, r as TooltipProvider, rn as AlertDialogContent, s as TabsContent, t as Tooltip, tn as AlertDialogAction, u as Table$1, w as SheetFooter, wt as CardTitle, x as Skeleton, xt as CardContent, y as fluidToast, yt as Card } from "./src-Duo2Iuw-.mjs";
5
5
  import { n as useScreenHeaderActions, r as useScreenHeaderBreadcrumbs } from "./ScreenHeaderContext-CrdfLGKk.mjs";
6
6
  import { a as useEditor, n as Heading, o as Placeholder, r as EditorContent, t as StarterKit } from "./dist-CMGXkSgZ.mjs";
7
- import { i as PaginationFooter } from "./order-status-badge-OZ1InBwZ.mjs";
8
- import { n as TextAlign, t as Underline } from "./dist-B1HwSrso.mjs";
7
+ import { i as PaginationFooter } from "./order-status-badge-Bt2gMEPZ.mjs";
8
+ import { n as TextAlign, t as Underline } from "./dist-CayuD99K.mjs";
9
9
  import { createContext, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
10
10
  import { keepPreviousData, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
11
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -4059,4 +4059,4 @@ const contactsScreenPropertySchema = {
4059
4059
  //#endregion
4060
4060
  export { ContactsScreen_exports as n, contactsScreenPropertySchema as r, ContactsScreen as t };
4061
4061
 
4062
- //# sourceMappingURL=ContactsScreen-BvoMicyB.mjs.map
4062
+ //# sourceMappingURL=ContactsScreen-BRmYDosJ.mjs.map