@wazobiatech/wazui 0.0.11 → 0.0.13

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 (169) hide show
  1. package/.env.sample +18 -18
  2. package/.env.test +5 -0
  3. package/CONVERSION_COMPLETE.md +87 -0
  4. package/ENVIRONMENT.md +230 -0
  5. package/NEXTJS_GUIDE.md +186 -0
  6. package/QUICK_START_ENV.md +0 -0
  7. package/USAGE_EXAMPLES.tsx +76 -0
  8. package/package.json +2 -3
  9. package/src/config/env.ts +8 -8
  10. package/src/config/next.ts +79 -0
  11. package/src/decorators/ApolloDecorator.tsx +1 -1
  12. package/src/decorators/DolosApolloDecorator.tsx +1 -1
  13. package/src/env.ts +48 -93
  14. package/src/hooks/useMercuryProjectToken.ts +3 -3
  15. package/src/hooks/useProjectToken.ts +2 -2
  16. package/src/index.ts +17 -1
  17. package/src/mocks/env.ts +9 -9
  18. package/src/providers/EnvironmentProvider/WazUIEnvironmentProvider.tsx +50 -0
  19. package/src/providers/EnvironmentProvider/context.ts +5 -0
  20. package/src/providers/EnvironmentProvider/index.ts +5 -0
  21. package/src/providers/EnvironmentProvider/useWazUIEnvironment.ts +20 -0
  22. package/src/providers/EnvironmentProvider/utils.ts +122 -0
  23. package/src/utils/apolloClient.ts +6 -6
  24. package/src/utils/images.ts +14 -7
  25. package/storybook-static/assets/ApolloDecorator-DdFdPk9I.js +1 -0
  26. package/storybook-static/assets/BlogCategoryContent-j1uDZXn7.js +97 -0
  27. package/storybook-static/assets/BlogCategoryContent.stories-qYKLjb6F.js +9 -0
  28. package/storybook-static/assets/BlogPostContentComponent-C2AFWOqJ.js +956 -0
  29. package/storybook-static/assets/BlogPostContentComponent.stories-ZsTapbYf.js +18 -0
  30. package/storybook-static/assets/BlogPostsComponent.stories-CcjjSusf.js +11 -0
  31. package/storybook-static/assets/BlogTagContent-BnwuQUSW.js +92 -0
  32. package/storybook-static/assets/BlogTagContent.stories-BdzlB1N5.js +9 -0
  33. package/storybook-static/assets/CategoriesComponent.stories-C4qc6J3o.js +7 -0
  34. package/storybook-static/assets/ClearCacheHistory.stories-BFGJ9Cpr.js +6 -0
  35. package/storybook-static/assets/Color-YHDXOIA2-uT_23_Qt.js +1 -0
  36. package/storybook-static/assets/DocsRenderer-CFRXHY34-PYIpRFNk.js +575 -0
  37. package/storybook-static/assets/DolosApolloDecorator-DEvkQjrM.js +1 -0
  38. package/storybook-static/assets/FeatureJungle-Light-CFEx0Apr.woff +0 -0
  39. package/storybook-static/assets/PictureBlot-Ce0f3E3l.js +2 -0
  40. package/storybook-static/assets/PurgeCache-6QorPr5P.js +5 -0
  41. package/storybook-static/assets/PurgeCache.stories-9MRRLCNG.js +13 -0
  42. package/storybook-static/assets/ReactQueryDecorator-CrsXrNQd.js +1 -0
  43. package/storybook-static/assets/RecipeCategories.stories--J_t5Kqe.js +7 -0
  44. package/storybook-static/assets/RecipeCategoryContent-PlykHail.js +139 -0
  45. package/storybook-static/assets/RecipeCategoryContent.stories-kGW7yk1Q.js +9 -0
  46. package/storybook-static/assets/RecipeContentComponent.stories-BQ8Uxx67.js +18 -0
  47. package/storybook-static/assets/RecipeTags.stories-C1FTvpsL.js +7 -0
  48. package/storybook-static/assets/RecipeTagsContent-DS00_2mK.js +18 -0
  49. package/storybook-static/assets/RecipeTagsContent.stories-BiMSQhz1.js +5 -0
  50. package/storybook-static/assets/RecipesComponent.stories-CHZ8K6cH.js +9 -0
  51. package/storybook-static/assets/RedirectContent-CmGN0ktq.js +96 -0
  52. package/storybook-static/assets/RedirectContent.stories-9_qkEHzb.js +5 -0
  53. package/storybook-static/assets/RedirectsComponent.stories-CTycXldt.js +8 -0
  54. package/storybook-static/assets/TagsComponent.stories-DSohzxP0.js +7 -0
  55. package/storybook-static/assets/TimeAgo-BMs3lst-.js +5 -0
  56. package/storybook-static/assets/UniversalJungle-420-mm6ugnAQ.woff +0 -0
  57. package/storybook-static/assets/WazUIBlogComponent.stories-CCXKbbai.js +86 -0
  58. package/storybook-static/assets/WazUIBlogDashboard-CtU7uRTr.js +162 -0
  59. package/storybook-static/assets/WazUIBlogDashboard.stories-CqTZ4exx.js +38 -0
  60. package/storybook-static/assets/WazUIButton.stories-CDWIbKyS.js +59 -0
  61. package/storybook-static/assets/WazUIDataTable-DnneDnRd.js +22 -0
  62. package/storybook-static/assets/WazUIPostActions-BZQom1Yt.js +16 -0
  63. package/storybook-static/assets/WazUiBreadCrumb-BPc3tEqC.js +1 -0
  64. package/storybook-static/assets/WazUiBreadCrumb.stories-_gNokkDn.js +7 -0
  65. package/storybook-static/assets/WazUiButton-e06gz3US.js +27 -0
  66. package/storybook-static/assets/WazUiCreateBlogContent-DxC86Nwl.js +327 -0
  67. package/storybook-static/assets/WazUiCreateBlogContent.stories-Bzq3YtfW.js +94 -0
  68. package/storybook-static/assets/WazUiCreateContentPopup.stories-D_9OExPO.js +41 -0
  69. package/storybook-static/assets/WazUiDataTable.stories-D1Aj3wPk.js +23 -0
  70. package/storybook-static/assets/WazUiGqlMediaLibrary.stories-Cug9TM1_.js +105 -0
  71. package/storybook-static/assets/WazUiGqlMediaLibraryPopup.stories-CuwWYcJs.js +53 -0
  72. package/storybook-static/assets/WazUiInputBox-C2jVcTq2.js +734 -0
  73. package/storybook-static/assets/WazUiInputBox.stories-Bs1Vb_Rd.js +270 -0
  74. package/storybook-static/assets/WazUiNavigationBlocker-BrhA3ONc.js +1 -0
  75. package/storybook-static/assets/WazUiNavigationBlocker.stories-CgqwQbJ9.js +6 -0
  76. package/storybook-static/assets/WazUiPostCard-bQlmiDOB.js +99 -0
  77. package/storybook-static/assets/WazUiPostCard.stories-Dir2IwY1.js +9 -0
  78. package/storybook-static/assets/WazUiWysiwygInput.stories-BDO7EAIa.js +170 -0
  79. package/storybook-static/assets/WazuiActionModal-Cgw_QqFv.js +11 -0
  80. package/storybook-static/assets/WazuiActionModal.stories-CFCFlfLU.js +5 -0
  81. package/storybook-static/assets/WazuiCreateContentPopup-CXVvIFOU.js +130 -0
  82. package/storybook-static/assets/WazuiImage-BwRWaPkA.js +58 -0
  83. package/storybook-static/assets/WazuiImage.stories-CxpLgpmg.js +48 -0
  84. package/storybook-static/assets/button-BxNLA_J_.js +1 -0
  85. package/storybook-static/assets/calendar-CorT5FcI.js +6 -0
  86. package/storybook-static/assets/chunk-XP5HYGXS-BpfKkqn7.js +1 -0
  87. package/storybook-static/assets/emerald-GdtolcHR.svg +9 -0
  88. package/storybook-static/assets/entry-preview-Chux9cpU.js +2 -0
  89. package/storybook-static/assets/entry-preview-docs-DviPOtIv.js +46 -0
  90. package/storybook-static/assets/env-B_s3Ell7.js +1 -0
  91. package/storybook-static/assets/gold-CtN6pOVZ.svg +9 -0
  92. package/storybook-static/assets/groups-GzRK9wBi.js +6 -0
  93. package/storybook-static/assets/hooks-D-wca2rG.js +1 -0
  94. package/storybook-static/assets/iconBase-B7i_G6Rg.js +1 -0
  95. package/storybook-static/assets/iframe-DarAeeHv.js +211 -0
  96. package/storybook-static/assets/index-BAoN7Cmi.js +240 -0
  97. package/storybook-static/assets/index-BJvHeDRT.js +1 -0
  98. package/storybook-static/assets/index-BR89vyis.js +6 -0
  99. package/storybook-static/assets/index-BWnBDfn-.js +9 -0
  100. package/storybook-static/assets/index-Bqat3xNk.js +1 -0
  101. package/storybook-static/assets/index-CBYaBgW8.js +9 -0
  102. package/storybook-static/assets/index-CZ4jztst.js +30 -0
  103. package/storybook-static/assets/index-CeH2RAp8.js +22 -0
  104. package/storybook-static/assets/index-DarTc5kA.js +1 -0
  105. package/storybook-static/assets/index-DgH-xKnr.js +11 -0
  106. package/storybook-static/assets/index-DrFu-skq.js +6 -0
  107. package/storybook-static/assets/instagram-DKTomRJ8.svg +9 -0
  108. package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
  109. package/storybook-static/assets/no-data-image-Bhn_PKhS.svg +41 -0
  110. package/storybook-static/assets/no-image-icon-CjrDvlv3.svg +84 -0
  111. package/storybook-static/assets/pexels-DrnxyPAE.svg +9 -0
  112. package/storybook-static/assets/popover-BB1qMQFg.js +76 -0
  113. package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
  114. package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
  115. package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
  116. package/storybook-static/assets/preview-BaoH-L4j.js +1 -0
  117. package/storybook-static/assets/preview-C-LZrIW4.js +2 -0
  118. package/storybook-static/assets/preview-CVgpLj3b.js +1 -0
  119. package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
  120. package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
  121. package/storybook-static/assets/preview-DMG083aW.js +240 -0
  122. package/storybook-static/assets/preview-DoyfkCKF.css +1 -0
  123. package/storybook-static/assets/preview-TWlugwTp.js +3 -0
  124. package/storybook-static/assets/provider-Bst_TvlW.js +1 -0
  125. package/storybook-static/assets/queries-9Km_qMSB.js +125 -0
  126. package/storybook-static/assets/queries-Bdq7cXa5.js +231 -0
  127. package/storybook-static/assets/queries-ClywsDTl.js +103 -0
  128. package/storybook-static/assets/quill-Dex9Y0nc.js +49 -0
  129. package/storybook-static/assets/react-18-DbMmlWnz.js +25 -0
  130. package/storybook-static/assets/sapphire-BO-7mqXy.svg +9 -0
  131. package/storybook-static/assets/test-utils-DxU8HTJE.js +9 -0
  132. package/storybook-static/assets/upload-image-BZPKKzIo.svg +43 -0
  133. package/storybook-static/assets/useMercuryProjectToken-BgbQUYG9.js +49 -0
  134. package/storybook-static/assets/users-ClnJTo4A.js +1 -0
  135. package/storybook-static/assets/utils-3HBFSLrk.js +2 -0
  136. package/storybook-static/assets/v4-CtRu48qb.js +1 -0
  137. package/storybook-static/favicon.svg +1 -0
  138. package/storybook-static/iframe.html +669 -0
  139. package/storybook-static/index.html +185 -0
  140. package/storybook-static/index.json +1 -0
  141. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  142. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  143. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  144. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  145. package/storybook-static/project.json +1 -0
  146. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +331 -0
  147. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +51 -0
  148. package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
  149. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
  150. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +405 -0
  151. package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +245 -0
  152. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
  153. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
  154. package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
  155. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
  156. package/storybook-static/sb-addons/onboarding-9/manager-bundle.js +127 -0
  157. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  158. package/storybook-static/sb-addons/storybook-experimental-addon-test-11/manager-bundle.js +223 -0
  159. package/storybook-static/sb-addons/themes-12/manager-bundle.js +3 -0
  160. package/storybook-static/sb-common-assets/favicon.svg +1 -0
  161. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  162. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  163. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  164. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  165. package/storybook-static/sb-manager/globals-module-info.js +1051 -0
  166. package/storybook-static/sb-manager/globals-runtime.js +41591 -0
  167. package/storybook-static/sb-manager/globals.js +48 -0
  168. package/storybook-static/sb-manager/runtime.js +12048 -0
  169. package/vite.config.ts +1 -0
@@ -0,0 +1,86 @@
1
+ import{s as m,f as g,D as p,G as b,c as f,a as y,b as C,d as h,e as B}from"./queries-ClywsDTl.js";import{a as S}from"./WazUiInputBox-C2jVcTq2.js";import{W as w}from"./WazUiPostCard-bQlmiDOB.js";import"./jsx-runtime-D_zvdyIk.js";import"./WazUIPostActions-BZQom1Yt.js";import"./popover-BB1qMQFg.js";import"./button-BxNLA_J_.js";import"./index-CBYaBgW8.js";import"./utils-3HBFSLrk.js";import"./index-BJvHeDRT.js";import"./index-BWnBDfn-.js";import"./WazuiImage-BwRWaPkA.js";import"./env-B_s3Ell7.js";import"./iconBase-B7i_G6Rg.js";import"./index-CeH2RAp8.js";import"./useMercuryProjectToken-BgbQUYG9.js";import"./provider-Bst_TvlW.js";import"./WazuiActionModal-Cgw_QqFv.js";import"./index-CZ4jztst.js";import"./index-BR89vyis.js";import"./WazUiButton-e06gz3US.js";import"./WazUiBreadCrumb-BPc3tEqC.js";import"./WazUIDataTable-DnneDnRd.js";import"./calendar-CorT5FcI.js";import"./iframe-DarAeeHv.js";import"./TimeAgo-BMs3lst-.js";const M={title:"Components/WazUIBlogComponent",component:S,parameters:{layout:"fullscreen",docs:{description:{component:`
2
+ A versatile blog component that supports both list and grid views, with built-in:
3
+ - Search functionality
4
+ - Advanced filtering
5
+ - Column sorting
6
+ - Pagination
7
+ - Grid/List view toggle
8
+ - Post status filtering
9
+ - Loading states
10
+ - Error handling
11
+ `}}},tags:["autodocs"],argTypes:{columns:{description:"Table columns configuration for list view",control:"object",table:{type:{summary:"ColumnDef[]"}}},rootClassName:{description:"Additional CSS classes for the root container",control:"text",table:{defaultValue:{summary:"bg-background"}}},cardClassName:{description:"CSS classes applied to grid view cards",control:"text",table:{defaultValue:{summary:""}}},queryConfig:{description:"GraphQL query configuration",control:"object",table:{type:{summary:"{ name: DocumentNode, variables: object, dataKey: string }"}}},filterFields:{description:"Configuration for filterable fields",control:"object",table:{type:{summary:"FilterField[]"}}},statusFilters:{description:"Configuration for status filters",control:"object",table:{type:{summary:"StatusFilter[]"}}},gridCard:{description:"Custom component for rendering grid view items",control:!1,table:{type:{summary:"React.ComponentType"}}},defaultState:{description:"Initial state configuration",control:"object",table:{type:{summary:"BlogComponentState"}}}}},e={args:{baseUrl:"/contents/cms/recipes",columns:f,cellClassName:"bg-background",queryConfig:{fetch:{query:b,variables:{blog_uuid:"2ee767d4-91bb-414b-b8c8-ac5105f94c55",refreshToken:!1},dataKey:"getPostsByBlogUuid",cacheKey:"getPostsByBlogUuid"},delete:{query:p,variables:{blog_uuid:"2ee767d4-91bb-414b-b8c8-ac5105f94c55",refreshToken:!1},mutationInvalidateKey:"getPostsByBlogUuid",dataKey:"getPostsByBlogUuid"}},filterFields:g,gridCard:w,statusFilters:m},parameters:{docs:{description:{story:"A fully functional blog component with all features enabled."}}}},t={args:{...e.args,cellClassName:"bg-background shadow-[0_4px_0_0_rgba(0,0,0,0.1)]",rootClassName:"bg-slate-100 rounded-md border bg-transparent p-4 shadow-sm",cardClassName:"bg-white shadow-lg rounded-lg"},parameters:{docs:{description:{story:"Component with custom styling applied"}}}},o={args:{columns:B,cellClassName:"bg-background",queryConfig:{fetch:{query:h,variables:{blog_uuid:"6b2693df-8bdb-4692-9dfb-9a8def92c7ff",refreshToken:!1},dataKey:"getCategoriesByBlogUuid"}},filterFields:C,toggleView:!1,statusFilters:y},parameters:{docs:{description:{story:"A fully functional blog component with all features enabled."}}}};var a,s,r;e.parameters={...e.parameters,docs:{...(a=e.parameters)==null?void 0:a.docs,source:{originalSource:`{
12
+ args: {
13
+ baseUrl: '/contents/cms/recipes',
14
+ columns: columns,
15
+ cellClassName: 'bg-background',
16
+ queryConfig: {
17
+ fetch: {
18
+ query: GET_POSTS,
19
+ variables: {
20
+ blog_uuid: '2ee767d4-91bb-414b-b8c8-ac5105f94c55',
21
+ refreshToken: false
22
+ },
23
+ dataKey: 'getPostsByBlogUuid',
24
+ cacheKey: 'getPostsByBlogUuid'
25
+ },
26
+ delete: {
27
+ query: DELETE_POST,
28
+ variables: {
29
+ blog_uuid: '2ee767d4-91bb-414b-b8c8-ac5105f94c55',
30
+ refreshToken: false
31
+ },
32
+ mutationInvalidateKey: 'getPostsByBlogUuid',
33
+ dataKey: 'getPostsByBlogUuid'
34
+ }
35
+ },
36
+ filterFields: filterFields,
37
+ gridCard: WazUiPostCard,
38
+ statusFilters: statusFilters
39
+ },
40
+ parameters: {
41
+ docs: {
42
+ description: {
43
+ story: 'A fully functional blog component with all features enabled.'
44
+ }
45
+ }
46
+ }
47
+ }`,...(r=(s=e.parameters)==null?void 0:s.docs)==null?void 0:r.source}}};var n,i,l;t.parameters={...t.parameters,docs:{...(n=t.parameters)==null?void 0:n.docs,source:{originalSource:`{
48
+ args: {
49
+ ...Default.args,
50
+ cellClassName: 'bg-background shadow-[0_4px_0_0_rgba(0,0,0,0.1)]',
51
+ rootClassName: 'bg-slate-100 rounded-md border bg-transparent p-4 shadow-sm',
52
+ cardClassName: 'bg-white shadow-lg rounded-lg'
53
+ },
54
+ parameters: {
55
+ docs: {
56
+ description: {
57
+ story: 'Component with custom styling applied'
58
+ }
59
+ }
60
+ }
61
+ }`,...(l=(i=t.parameters)==null?void 0:i.docs)==null?void 0:l.source}}};var c,d,u;o.parameters={...o.parameters,docs:{...(c=o.parameters)==null?void 0:c.docs,source:{originalSource:`{
62
+ args: {
63
+ columns: categoryColumns,
64
+ cellClassName: 'bg-background',
65
+ queryConfig: {
66
+ fetch: {
67
+ query: GET_CATEGORIES,
68
+ variables: {
69
+ blog_uuid: '6b2693df-8bdb-4692-9dfb-9a8def92c7ff',
70
+ refreshToken: false
71
+ },
72
+ dataKey: 'getCategoriesByBlogUuid'
73
+ }
74
+ },
75
+ filterFields: categoryFilterFields,
76
+ toggleView: false,
77
+ statusFilters: categoryStatusFilters
78
+ },
79
+ parameters: {
80
+ docs: {
81
+ description: {
82
+ story: 'A fully functional blog component with all features enabled.'
83
+ }
84
+ }
85
+ }
86
+ }`,...(u=(d=o.parameters)==null?void 0:d.docs)==null?void 0:u.source}}};const X=["Default","CustomStyling","Categories"];export{o as Categories,t as CustomStyling,e as Default,X as __namedExportsOrder,M as default};
@@ -0,0 +1,162 @@
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as y}from"./index-CBYaBgW8.js";import{c as q,g as ee,d as He,f as U,e as z,h as te,i as ae,p as ge,j as Ge,k as Be,l as he,m as ce,n as Oe,o as ue,q as pe,t as xe}from"./utils-3HBFSLrk.js";import{c as me,a as Je,P as Qe,b as Ze,d as Ye,C as Xe,f as le,s as Ke,I as et,S as tt,e as G,g as Y,h as X,i as K,B as V}from"./popover-BB1qMQFg.js";import{B as fe}from"./button-BxNLA_J_.js";import{W as at}from"./WazUiButton-e06gz3US.js";import{C as st}from"./calendar-CorT5FcI.js";import{_ as rt}from"./iframe-DarAeeHv.js";import{g as W}from"./index-CeH2RAp8.js";import{e as ye}from"./env-B_s3Ell7.js";import{V as I,A as ve,I as we,P as be,W as nt}from"./useMercuryProjectToken-BgbQUYG9.js";/**
2
+ * @license lucide-react v0.507.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const it=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ot=me("eye",it);/**
7
+ * @license lucide-react v0.507.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const lt=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ct=me("send",lt);function dt(t,d,r){return Je(t,-1,r)}function je({onDateRangeChange:t,className:d,isActive:r=!1}){const l=new Date,o=dt(l),[n,s]=y.useState(void 0),[p,h]=y.useState(!1),c=f=>{s(f),f!=null&&f.from&&(f!=null&&f.to)&&t&&(t({start:f.from,end:f.to}),h(!1))},x=()=>n!=null&&n.from&&(n!=null&&n.to)?n.from.getTime()===n.to.getTime()?le(n.from,"MMM d, yyyy"):`${le(n.from,"MMM d")} - ${le(n.to,"MMM d, yyyy")}`:"Set Custom Date",u=f=>{const i=Ke(l);return f>=i};return e.jsxs(Qe,{open:p,onOpenChange:h,children:[e.jsx(Ze,{asChild:!0,children:e.jsxs(fe,{variant:"outline",className:q("h-10 px-4 border border-[#eaecf0] text-xs justify-start transition-colors",r?"bg-[#86fc65] hover:bg-[#7ae855] text-black":"bg-[#f7f7f7] hover:bg-gray-100 text-gray-600",d),style:{fontSize:"12px",fontWeight:r?"500":"400"},children:[e.jsx(st,{size:16,className:"mr-1 sm:mr-2"}),e.jsx("span",{className:"truncate",children:x()})]})}),e.jsx(Ye,{className:"w-auto p-4 text-gray-600",align:"end",style:{color:"#7a7a7a",fontSize:"12px",fontWeight:"400"},children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"text-gray-600 font-medium",style:{color:"#7a7a7a",fontSize:"14px",fontWeight:"400"},children:"Select custom date range"}),e.jsx(Xe,{initialFocus:!0,mode:"range",defaultMonth:o,selected:n,onSelect:c,numberOfMonths:2,disabled:u,className:"rounded-md border"})]})})]})}je.__docgenInfo={description:`DashboardDatePicker Component
12
+
13
+ A specialized date picker for the dashboard that allows custom date range selection.
14
+ Works alongside the "Last Month" button to provide flexible date filtering.
15
+
16
+ Features:
17
+ - Custom date range selection
18
+ - Disables current month and future dates
19
+ - Visual active state when custom date is selected
20
+ - Returns selected date range via callback
21
+ - Matches dashboard styling with Universal Jungle font
22
+
23
+ Date Restrictions:
24
+ - Disables current month and future dates
25
+ - Allows selection of any past dates
26
+
27
+ Usage:
28
+ \`\`\`tsx
29
+ <DashboardDatePicker
30
+ onDateRangeChange={(range) => console.log(range.start, range.end)}
31
+ isActive={true}
32
+ />
33
+ \`\`\``,methods:[],displayName:"DashboardDatePicker",props:{onDateRangeChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(range: { start: Date; end: Date }) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ start: Date; end: Date }",signature:{properties:[{key:"start",value:{name:"Date",required:!0}},{key:"end",value:{name:"Date",required:!0}}]}},name:"range"}],return:{name:"void"}}},description:""},className:{required:!1,tsType:{name:"string"},description:""},isActive:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}}}};function Ne({onSearchChange:t,onDateRangeChange:d,onLastMonthClick:r,isLastMonthActive:l=!0}){const[o,n]=y.useState(""),s=c=>{const x=c.target.value;n(x),t==null||t(x)},p=()=>{t==null||t(o)},h=()=>{r==null||r()};return e.jsxs("div",{className:"flex items-center justify-between w-full gap-4",children:[e.jsxs("div",{className:"flex w-154 items-center gap-0 border border-primary rounded bg-background overflow-hidden pl-0.5",children:[e.jsx(et,{placeholder:"Search dashboard",value:o,onChange:s,onKeyDown:c=>{c.key==="Enter"&&p()},className:"w-10 h-9 text-xs flex-1 rounded border-none bg-transparent hover:bg-transparent focus:bg-transparent focus:rounded-r-none"}),e.jsx(at,{variant:"ghost",className:"h-10 p-3 rounded-none bg-primary hover:bg-primary cursor-pointer",onClick:p,children:e.jsx(tt,{fontSize:10,className:"h-5 w-5"})})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex",children:[e.jsx(fe,{variant:"default",onClick:h,className:q("h-10 px-4 border border-[#eaecf0] rounded-l-md rounded-r-none text-xs font-medium transition-colors",l?"bg-[#86fc65] hover:bg-[#7ae855] text-black":"bg-[#f7f7f7] hover:bg-gray-100 text-gray-600"),style:{fontSize:"12px",fontWeight:"500"},children:"Last Month"}),e.jsx(je,{onDateRangeChange:d,className:q("rounded-r-md rounded-l-none border-l-0",!l&&"bg-[#86fc65] hover:bg-[#7ae855] text-black"),isActive:!l})]})]})}Ne.__docgenInfo={description:"",methods:[],displayName:"DashboardNavigation",props:{onSearchChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(query: string) => void",signature:{arguments:[{type:{name:"string"},name:"query"}],return:{name:"void"}}},description:""},onDateRangeChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(range: { start: Date; end: Date }) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ start: Date; end: Date }",signature:{properties:[{key:"start",value:{name:"Date",required:!0}},{key:"end",value:{name:"Date",required:!0}}]}},name:"range"}],return:{name:"void"}}},description:""},onLastMonthClick:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},isLastMonthActive:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}}}};function k({text:t,searchQuery:d,className:r,style:l}){if(!d||d.trim()==="")return e.jsx("span",{className:r,style:l,children:t});const o=d.trim().toLowerCase(),n=t.toLowerCase();if(!n.includes(o))return e.jsx("span",{className:r,style:l,children:t});const p=[];let h=0,c=n.indexOf(o),x=0;const u={color:"rgba(0, 0, 0, 0.44)"};for(;c!==-1;)c>h&&p.push(e.jsx("span",{style:u,children:t.slice(h,c)},`text-${x}`)),p.push(e.jsx("strong",{style:{fontWeight:700},children:t.slice(c,c+o.length)},`match-${x}`)),h=c+o.length,c=n.indexOf(o,h),x++;return h<t.length&&p.push(e.jsx("span",{style:u,children:t.slice(h)},"text-end")),e.jsx("span",{className:r,style:l,children:p})}k.__docgenInfo={description:`HighlightText Component
34
+
35
+ Renders text with matching portions bolded and non-matching portions faded.
36
+ Case-insensitive matching.
37
+
38
+ @example
39
+ <HighlightText text="Category Performance" searchQuery="Perfor" />
40
+ // Renders: Category <strong>Perfor</strong>mance (with faded non-matching text)`,methods:[],displayName:"HighlightText",props:{text:{required:!0,tsType:{name:"string"},description:""},searchQuery:{required:!0,tsType:{name:"string"},description:""},className:{required:!1,tsType:{name:"string"},description:""},style:{required:!1,tsType:{name:"ReactCSSProperties",raw:"React.CSSProperties"},description:""}}};const gt=W`
41
+ query GetPostsForMetrics(
42
+ $first: Int!
43
+ $page: Int
44
+ $publishedFilter: PostFilterInput
45
+ $draftFilter: PostFilterInput
46
+ ) {
47
+ published: posts(first: $first, page: $page, filter: $publishedFilter) {
48
+ data {
49
+ uuid
50
+ slug
51
+ read_time
52
+ metadata
53
+ published_at
54
+ }
55
+ paginatorInfo {
56
+ total
57
+ }
58
+ }
59
+ drafts: posts(first: $first, page: $page, filter: $draftFilter) {
60
+ data {
61
+ uuid
62
+ }
63
+ paginatorInfo {
64
+ total
65
+ }
66
+ }
67
+ }
68
+ `,se=W`
69
+ query GetAnalyticsStatistics($urls: [String!]!, $page: Int!, $perPage: Int!) {
70
+ statistics(urls: $urls, page: $page, perPage: $perPage) {
71
+ data {
72
+ pageId
73
+ pageUrl
74
+ totalPageViews
75
+ uniqueUsers
76
+ averageSessionDuration
77
+ totalEvents
78
+ lastActivity
79
+ }
80
+ }
81
+ }
82
+ `,ht=W`
83
+ query GetPostsWithCategories($first: Int!, $page: Int, $filter: PostFilterInput) {
84
+ posts(first: $first, page: $page, filter: $filter) {
85
+ data {
86
+ uuid
87
+ slug
88
+ metadata
89
+ category {
90
+ uuid
91
+ name
92
+ }
93
+ categories {
94
+ uuid
95
+ name
96
+ }
97
+ }
98
+ }
99
+ }
100
+ `,ut=W`
101
+ query GetPublishedPosts(
102
+ $first: Int!
103
+ $page: Int
104
+ $filter: PostFilterInput
105
+ $sort: [PostSortInput!]
106
+ ) {
107
+ posts(first: $first, page: $page, filter: $filter, sort: $sort) {
108
+ data {
109
+ uuid
110
+ slug
111
+ title
112
+ excerpt
113
+ featured_image
114
+ author_uuid
115
+ metadata
116
+ published_at
117
+ created_at
118
+ category {
119
+ uuid
120
+ name
121
+ }
122
+ categories {
123
+ uuid
124
+ name
125
+ }
126
+ tags {
127
+ uuid
128
+ name
129
+ }
130
+ }
131
+ paginatorInfo {
132
+ total
133
+ }
134
+ }
135
+ }
136
+ `,pt=W`
137
+ query GetPostsForWriters($first: Int!, $page: Int, $filter: PostFilterInput) {
138
+ posts(first: $first, page: $page, filter: $filter) {
139
+ data {
140
+ uuid
141
+ slug
142
+ author_uuid
143
+ }
144
+ }
145
+ }
146
+ `,xt=W`
147
+ query GetMonthlyPostCount($first: Int!, $page: Int, $filter: PostFilterInput) {
148
+ posts(first: $first, page: $page, filter: $filter) {
149
+ paginatorInfo {
150
+ total
151
+ }
152
+ }
153
+ }
154
+ `;W`
155
+ query GetAllCategories($first: Int!) {
156
+ categories(first: $first) {
157
+ data {
158
+ name
159
+ }
160
+ }
161
+ }
162
+ `;const mt=ye.VITE_MUSE_ENDPOINT||"http://localhost:8000/graphql",ft=ye.VITE_PHOENIX_ENDPOINT||"http://localhost:9000/graphql";function yt(t){return new ve({link:be({uri:mt,headers:{"x-project-token":t}}),cache:new we,defaultOptions:{query:{errorPolicy:"all",fetchPolicy:"no-cache"}}})}function vt(t){return new ve({link:be({uri:ft,headers:{"x-project-token":t}}),cache:new we,defaultOptions:{query:{errorPolicy:"all",fetchPolicy:"no-cache"}}})}let $=null,H=null;async function De(){if(!$)try{const t=await rt(()=>import("./users-ClnJTo4A.js"),[],import.meta.url),r=(t.default||t).map(l=>({id:l.id,uuid:l.uuid,name:l.name,email:l.email,avatar:l.avatar??void 0}));$=new Map(r.map(l=>[l.id,l])),H=new Map(r.map(l=>[l.uuid,l]))}catch(t){console.warn("Failed to load users.json:",t),$=new Map,H=new Map}}function ke(t){return($==null?void 0:$.get(t))||(H==null?void 0:H.get(t))}async function B(t,d,r={}){const o=await yt(t).query({query:W(d),variables:r});if(o.error&&(console.error("Muse GraphQL error:",o.error),!o.data))throw new Error(`Muse GraphQL query failed: ${o.error.message}`);return o.data}async function re(t,d,r={},l=2){for(let o=0;o<=l;o++)try{const s=await vt(t).query({query:W(d),variables:r});if(s.error&&(console.error("Phoenix GraphQL error:",s.error),!s.data))throw new Error(`Phoenix GraphQL query failed: ${s.error.message}`);return s.data}catch(n){const s=n instanceof Error?n.message:String(n);if((s.includes("connection")||s.includes("_connection_for_bind")||s.includes("SessionTransactionState")||s.includes("CLOSED"))&&o<l){console.warn(`Phoenix connection error (attempt ${o+1}/${l+1}), retrying in ${(o+1)*300}ms...`),await new Promise(h=>setTimeout(h,(o+1)*300));continue}throw n}throw new Error("Phoenix query failed after all retry attempts")}async function de(t,d){var i,a,m,j,N,T;const r=await B(t,I(gt),{first:1e3,page:1,publishedFilter:te(d),draftFilter:Oe(d)});if(!(r!=null&&r.published)||!(r!=null&&r.drafts))throw new Error("Invalid response from metrics query");const l=((i=r.published)==null?void 0:i.data)||[],o=((m=(a=r.drafts)==null?void 0:a.paginatorInfo)==null?void 0:m.total)||0,n=((N=(j=r.published)==null?void 0:j.paginatorInfo)==null?void 0:N.total)||0,s=l.filter(E=>E.read_time),p=s.length>0?Math.round(s.reduce((E,g)=>E+(g.read_time||0),0)/s.length):0;let h=0,c=0,x=0;if(l.length>0){const E=l.map(g=>g.slug);try{(((T=(await re(t,I(se),{urls:E,page:1,perPage:1e3})).statistics)==null?void 0:T.data)||[]).forEach(v=>{h+=v.totalPageViews||0;const w=ae(v);w>0&&(c+=w,x++)})}catch(g){console.warn("Phoenix query failed for period:",g)}}const u=x>0?c/x:0,f=Math.min(Math.round(u/300*100),100);return{draftsCount:o,publishedCount:n,totalViews:h,engagementRate:f,avgReadTime:p}}async function wt(t){var s;if(!t)throw new Error("Authentication token is required");const d=new Date,r=d.getFullYear(),l=d.getMonth(),o=[],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];for(let p=0;p<l;p++){const h=new Date(r,p,1),c=new Date(r,p+1,0,23,59,59);try{const x=await B(t,I(xt),{first:1,page:1,filter:{published_at:{gte:ce(h),lte:ce(c)}}});let u=0;(s=x==null?void 0:x.posts)!=null&&s.paginatorInfo&&(u=x.posts.paginatorInfo.total||0),o.push({month:n[p]||"Unknown",date:`${r}-${String(p+1).padStart(2,"0")}-15`,articles:u})}catch(x){console.error(`Failed to fetch posts for ${n[p]}:`,x),o.push({month:n[p]||"Unknown",date:`${r}-${String(p+1).padStart(2,"0")}-15`,articles:0})}}return o}async function bt(t,d){if(!t)throw new Error("Authentication token is required");const r=ee(d),l=He(r);try{const[o,n]=await Promise.all([de(t,r),de(t,l).catch(u=>(console.warn("Failed to fetch previous period metrics:",u),{draftsCount:0,publishedCount:0,totalViews:0,engagementRate:0,avgReadTime:0}))]),s=U(o.draftsCount,n.draftsCount),p=U(o.publishedCount,n.publishedCount),h=U(o.totalViews,n.totalViews),c=U(o.engagementRate,n.engagementRate,"%"),x=U(o.avgReadTime,n.avgReadTime);return[{title:"Articles in Draft",value:z(o.draftsCount),change:s.change,changeType:s.changeType,icon:"edit",iconBg:"bg-[rgba(164,248,122,0.16)]"},{title:"Articles Published",value:z(o.publishedCount),change:p.change,changeType:p.changeType,icon:"send",iconBg:"bg-[rgba(161,170,255,0.1)]"},{title:"Total Views",value:z(o.totalViews),change:h.change,changeType:h.changeType,icon:"eye",iconBg:"bg-[rgba(251,188,154,0.1)]"},{title:"Article Engagement Rate",value:`${o.engagementRate}%`,change:c.change,changeType:c.changeType,icon:"percent",iconBg:"bg-[rgba(164,248,122,0.16)]"},{title:"Avg Article Length",value:o.avgReadTime.toString(),change:"-",changeType:x.changeType,icon:"book",iconBg:"bg-[rgba(161,170,255,0.1)]"}]}catch(o){return console.error("Failed to fetch dashboard metrics:",o),[{title:"Articles in Draft",value:"0",change:"Unable to load",changeType:"negative",icon:"edit",iconBg:"bg-[rgba(164,248,122,0.16)]"},{title:"Articles Published",value:"0",change:"Unable to load",changeType:"negative",icon:"send",iconBg:"bg-[rgba(161,170,255,0.1)]"},{title:"Total Views",value:"0",change:"Unable to load",changeType:"negative",icon:"eye",iconBg:"bg-[rgba(251,188,154,0.1)]"},{title:"Article Engagement Rate",value:"0%",change:"Unable to load",changeType:"negative",icon:"percent",iconBg:"bg-[rgba(164,248,122,0.16)]"},{title:"Avg Article Length",value:"0",change:"Unable to load",changeType:"negative",icon:"book",iconBg:"bg-[rgba(161,170,255,0.1)]"}]}}async function jt(t,d){var l,o;if(!t)throw new Error("Authentication token is required");const r=ee(d);try{const n=await B(t,I(ht),{first:500,page:1,filter:te(r)});if(!(n!=null&&n.posts))throw new Error("Invalid response from category performance query");const s=((l=n.posts)==null?void 0:l.data)||[],p=new Map;s.forEach(u=>{var i;((i=u.categories)!=null&&i.length?u.categories:u.category?[u.category]:[{uuid:"general",name:"General"}]).forEach(a=>{p.has(a.name)||p.set(a.name,{urls:[],totalViews:0,totalEngagement:0}),p.get(a.name).urls.push(u.slug)})});const h=s.map(u=>u.slug),c=new Map;if(s.forEach(u=>{var i;const f=(i=u.categories)!=null&&i.length?u.categories:u.category?[u.category]:[{uuid:"general",name:"General"}];c.set(u.slug,f.map(a=>a.name)),c.set(u.slug.replace(/^\//,""),f.map(a=>a.name)),u.slug.startsWith("/")||c.set("/"+u.slug,f.map(a=>a.name))}),h.length>0)try{(((o=(await re(t,I(se),{urls:h,page:1,perPage:1e3})).statistics)==null?void 0:o.data)||[]).forEach(f=>{let i=c.get(f.pageUrl);i||(i=c.get(f.pageUrl.replace(/^\//,""))),!i&&!f.pageUrl.startsWith("/")&&(i=c.get("/"+f.pageUrl)),i&&i.forEach(a=>{const m=p.get(a);m&&(m.totalViews+=f.totalPageViews||0,m.totalEngagement+=ae(f))})})}catch(u){console.warn("Phoenix query failed for categories:",u)}const x=Array.from(p.entries()).map(([u,f])=>({category:u,totalViews:f.totalViews,totalEngagement:Math.round(f.totalEngagement)})).sort((u,f)=>f.totalViews+f.totalEngagement-(u.totalViews+u.totalEngagement)).slice(0,6);return x.length===0?[{category:"No Data",totalViews:0,totalEngagement:0}]:x}catch(n){return console.error("Failed to fetch category performance:",n),[{category:"Error",totalViews:0,totalEngagement:0}]}}async function Nt(t,d,r=10){var o,n;if(!t)throw new Error("Authentication token is required");const l=ee(d);try{const s=await B(t,I(ut),{first:100,page:1,filter:te(l),sort:[{field:"PUBLISHED_AT",order:"DESC"}]});if(!(s!=null&&s.posts))throw new Error("Invalid response from articles query");const p=((o=s.posts)==null?void 0:o.data)||[];await De();const h=p.map(i=>i.slug),c=new Map;if(h.length>0)try{(((n=(await re(t,I(se),{urls:h,page:1,perPage:1e3})).statistics)==null?void 0:n.data)||[]).forEach(a=>{const m=a.totalPageViews||0,j=ae(a);c.set(a.pageUrl,{views:m,engagement:j}),c.set(a.pageUrl.replace(/^\//,""),{views:m,engagement:j}),a.pageUrl.startsWith("/")||c.set("/"+a.pageUrl,{views:m,engagement:j})})}catch(i){console.warn("Phoenix query failed for articles:",i)}return{articles:p.map(i=>{let a=c.get(i.slug);a||(a=c.get(i.slug.replace(/^\//,""))),!a&&!i.slug.startsWith("/")&&(a=c.get("/"+i.slug));const m=(a==null?void 0:a.views)||0,j=(a==null?void 0:a.engagement)||0,N=m+j*2;return{post:i,views:m,engagement:j,performanceScore:N}}).sort((i,a)=>a.performanceScore-i.performanceScore).slice(0,r).map(({post:i,views:a})=>{var g,v;const m=i.author_uuid?ke(i.author_uuid):void 0,j=(m==null?void 0:m.name)||"Unknown Author",N=m?ge(m.avatar):void 0,T=((g=i.categories)==null?void 0:g.map(w=>w.name))||(i.category?[i.category.name]:["General"]),E=((v=i.tags)==null?void 0:v.map(w=>w.name))||[];return{id:i.uuid,title:i.title||"Untitled Article",author:{name:j,initials:he(j),email:m==null?void 0:m.email,avatar:N},image:Be(i.featured_image),categories:T,tags:E.length>0?E:["content"],statistics:{views:z(a),shares:Math.round(a*.03).toString()},timeAgo:Ge(i.published_at||i.created_at||"")}}),total:Math.min(r,p.length),hasMore:!1}}catch(s){return console.error("Failed to fetch articles:",s),{articles:[{id:"fallback-1",title:"Unable to load articles",author:{name:"Unknown",initials:"UN"},image:"https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?w=400&h=300&fit=crop",categories:["General"],tags:["content"],statistics:{views:"0",shares:"0"},timeAgo:"-"}],total:1,hasMore:!1}}}async function Dt(t,d,r=10){var o,n;if(!t)throw new Error("Authentication token is required");const l=ee(d);try{const s=await B(t,I(pt),{first:500,page:1,filter:te(l)});if(!(s!=null&&s.posts))throw new Error("Invalid response from writers query");const p=((o=s.posts)==null?void 0:o.data)||[];await De();const h=new Map;if(p.forEach(i=>{const a=i.author_uuid;a&&(h.has(a)||h.set(a,{urls:[],totalViews:0,totalEngagement:0}),h.get(a).urls.push(i.slug))}),h.size===0)return{writers:[],total:0,hasMore:!1};const c=Array.from(h.values()).flatMap(i=>i.urls),x=new Map;if(h.forEach((i,a)=>{i.urls.forEach(m=>{x.set(m,a),x.set(m.replace(/^\//,""),a),m.startsWith("/")||x.set("/"+m,a)})}),c.length>0)try{(((n=(await re(t,I(se),{urls:c,page:1,perPage:1e3})).statistics)==null?void 0:n.data)||[]).forEach(a=>{let m=x.get(a.pageUrl);if(m||(m=x.get(a.pageUrl.replace(/^\//,""))),!m&&!a.pageUrl.startsWith("/")&&(m=x.get("/"+a.pageUrl)),m){const j=h.get(m);j.totalViews+=a.totalPageViews||0,j.totalEngagement+=ae(a)}})}catch(i){console.warn("Phoenix query failed for writers:",i)}const u=Array.from(h.entries()).map(([i,a])=>({authorId:i,articlesWritten:a.urls.length,totalViews:a.totalViews,totalEngagement:a.totalEngagement})).sort((i,a)=>a.totalViews-i.totalViews);return{writers:u.slice(0,r).map(i=>{const a=ke(i.authorId),m=i.articlesWritten>0?i.totalEngagement/i.articlesWritten:0,j=Math.min(Math.round(m/300*100),100),N=a?ge(a.avatar):void 0;return{id:i.authorId,name:(a==null?void 0:a.name)||"Unknown Author",email:(a==null?void 0:a.email)||"",avatar:N,initials:he((a==null?void 0:a.name)||"Unknown"),articlesWritten:i.articlesWritten,totalViews:z(i.totalViews),engagementRate:`${j}%`}}),total:u.length,hasMore:u.length>r}}catch(s){return console.error("Failed to fetch writers:",s),{writers:[],total:0,hasMore:!1}}}const Z=[{id:"default-1",name:"Default Writer",email:"writer@example.com",initials:"DW",articlesWritten:0,totalViews:"0",engagementRate:"0%"}],kt=({projectToken:t}={})=>y.useCallback(async d=>bt(t,d),[t]),Ct=({projectToken:t}={})=>y.useCallback(async d=>jt(t,d),[t]),Mt=({projectToken:t}={})=>y.useCallback(async(d,r=4)=>Nt(t,d,r),[t]),St=({projectToken:t}={})=>y.useCallback(async(d,r=4)=>Dt(t,d,r),[t]),Et=({projectToken:t}={})=>y.useCallback(async()=>wt(t),[t]),At=({projectToken:t,enableLiveData:d=!0}={})=>{const r=kt({projectToken:t}),l=Ct({projectToken:t}),o=Mt({projectToken:t}),n=St({projectToken:t}),s=Et({projectToken:t}),p=y.useCallback(async h=>{if(!d)throw new Error("Live data is disabled");try{const[c,x]=await Promise.all([r(h).catch(a=>(console.error("Failed to fetch metrics:",a),[])),s().catch(a=>(console.error("Failed to fetch post publish rate:",a),[]))]),u=await l(h).catch(a=>(console.error("Failed to fetch category performance:",a),[]));await new Promise(a=>setTimeout(a,100));const f=await o(h,4).catch(a=>(console.error("Failed to fetch articles:",a),{articles:[],total:0,hasMore:!1}));await new Promise(a=>setTimeout(a,100));const i=await n(h,4).catch(a=>(console.error("Failed to fetch writers:",a),{writers:[],total:0,hasMore:!1}));return{data:{chartData:u,dashboardMetrics:c,articlesData:f.articles,writersData:i.writers,postPublishData:x},total:{articles:f.total,writers:i.total},hasMore:{articles:f.hasMore,writers:i.hasMore}}}catch(c){throw console.error("Error in fetchAllData:",c),c}},[r,l,o,n,s,d]);return y.useMemo(()=>({fetchAllData:p,fetchMetrics:r,fetchCategoryPerformance:l,fetchArticles:o,fetchWriters:n,fetchPostPublishRate:s}),[p,r,l,o,n,s])},Ce=y.createContext(void 0),Me=({children:t,projectToken:d,enableLiveData:r=!0,initialMetrics:l=[],initialArticles:o=[],initialWriters:n=[]})=>{const{data:s,isLoading:p,error:h}=nt(),c=(s==null?void 0:s.token)||d;console.log("Mercury Token Status:",{loading:p,hasData:!!s,hasToken:!!c,error:h==null?void 0:h.message});const x=At({projectToken:c,enableLiveData:r}),[u,f]=y.useState([]),[i,a]=y.useState(l),[m,j]=y.useState(o),[N,T]=y.useState(n.length>0?n:Z),[E,g]=y.useState([]),[v,w]=y.useState(r),[A,D]=y.useState(null),[P,S]=y.useState(""),C=!p&&(c||h),_=v||p,L=A||(h?`Token Error: ${h.message}`:null),[O,J]=y.useState({articles:0,writers:0}),[Fe,Q]=y.useState({articles:!1,writers:!1}),[ie,Ie]=y.useState(ue(pe())),[We,Re]=y.useState(!1),oe=y.useCallback(async M=>{if(!r){w(!1);return}if(!C){console.log("Waiting for token to be ready...");return}if(!c){w(!1);return}try{w(!0),D(null),console.log("Fetching dashboard data with filters:",M);const b=await x.fetchAllData(M);console.log("Dashboard response received:",{metricsCount:b.data.dashboardMetrics.length,chartDataCount:b.data.chartData.length,articlesCount:b.data.articlesData.length,writersCount:b.data.writersData.length}),f(b.data.chartData),a(b.data.dashboardMetrics),j(b.data.articlesData),T(b.data.writersData.length>0?b.data.writersData:Z),g(b.data.postPublishData),J(b.total),Q(b.hasMore),console.log("State updated with new data")}catch(b){console.error("Failed to fetch dashboard data:",b),D(b instanceof Error?b.message:"Failed to fetch data"),f([{category:"General",totalViews:0,totalEngagement:0},{category:"News",totalViews:0,totalEngagement:0}]),a([{title:"Articles in Draft",value:"0",change:"-",changeType:"positive",icon:"edit",iconBg:"bg-[rgba(164,248,122,0.16)]"},{title:"Articles Published",value:"0",change:"-",changeType:"positive",icon:"send",iconBg:"bg-[rgba(161,170,255,0.1)]"},{title:"Total Views",value:"0",change:"-",changeType:"positive",icon:"eye",iconBg:"bg-[rgba(251,188,154,0.1)]"},{title:"Article Engagement Rate",value:"0%",change:"-",changeType:"positive",icon:"percent",iconBg:"bg-[rgba(164,248,122,0.16)]"},{title:"Avg Article Length",value:"0 min",change:"-",changeType:"positive",icon:"book",iconBg:"bg-[rgba(161,170,255,0.1)]"}]),j([]),T(Z),J({articles:0,writers:0}),Q({articles:!1,writers:!1})}finally{w(!1)}},[r,x,C,c]),$e=y.useCallback(async M=>{if(c)try{const b=await x.fetchMetrics(M);a(b)}catch(b){console.error("Failed to update metrics:",b)}},[x,c]),qe=y.useCallback(async M=>{if(c)try{const b=await x.fetchCategoryPerformance(M);f(b)}catch(b){console.error("Failed to update chart data:",b)}},[x,c]),_e=y.useCallback(async(M,b=4)=>{if(c)try{const F=await x.fetchArticles(M,b);j(F.articles),J(R=>({...R,articles:F.total})),Q(R=>({...R,articles:F.hasMore}))}catch(F){console.error("Failed to update articles:",F)}},[x,c]),Le=y.useCallback(async(M,b=4)=>{if(c)try{const F=await x.fetchWriters(M,b);T(F.writers.length>0?F.writers:Z),J(R=>({...R,writers:F.total})),Q(R=>({...R,writers:F.hasMore}))}catch(F){console.error("Failed to update writers:",F)}},[x,c]),Ue=y.useCallback(async()=>{if(c)try{const M=await x.fetchPostPublishRate();g(M)}catch(M){console.error("Failed to update post publish data:",M)}},[x,c]),Ve=y.useCallback(async()=>{const M={dateRange:xe(ie)};await oe(M)},[oe,ie]),ze={chartData:u,dashboardMetrics:i,articlesData:m,writersData:N,postPublishData:E,loading:_,error:L,total:O,hasMore:Fe,dateRange:ie,isUsingCustomDate:We,searchQuery:P,fetchData:oe,setDateRange:Ie,setIsUsingCustomDate:Re,setSearchQuery:S,refreshData:Ve,updateMetrics:$e,updateChartData:qe,updateArticles:_e,updateWriters:Le,updatePostPublishData:Ue};return e.jsx(Ce.Provider,{value:ze,children:t})},ne=()=>{const t=y.useContext(Ce);if(!t)throw new Error("useDashboard must be used within a DashboardProvider");return t};Me.__docgenInfo={description:"",methods:[],displayName:"DashboardProvider",props:{children:{required:!0,tsType:{name:"ReactNode"},description:""},projectToken:{required:!1,tsType:{name:"string"},description:""},enableLiveData:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},initialMetrics:{required:!1,tsType:{name:"Array",elements:[{name:"DashboardMetric"}],raw:"DashboardMetric[]"},description:"",defaultValue:{value:"[]",computed:!1}},initialArticles:{required:!1,tsType:{name:"Array",elements:[{name:"ArticleData"}],raw:"ArticleData[]"},description:"",defaultValue:{value:"[]",computed:!1}},initialWriters:{required:!1,tsType:{name:"Array",elements:[{name:"WriterData"}],raw:"WriterData[]"},description:"",defaultValue:{value:"[]",computed:!1}}}};const Se="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.1665%201.66602H7.49984C3.33317%201.66602%201.6665%203.33268%201.6665%207.49935V12.4993C1.6665%2016.666%203.33317%2018.3327%207.49984%2018.3327H12.4998C16.6665%2018.3327%2018.3332%2016.666%2018.3332%2012.4993V10.8327'%20stroke='%23208B02'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.3666%202.51639L6.7999%209.08306C6.5499%209.33306%206.2999%209.82472%206.2499%2010.1831L5.89157%2012.6914C5.75823%2013.5997%206.3999%2014.2331%207.30823%2014.1081L9.81657%2013.7497C10.1666%2013.6997%2010.6582%2013.4497%2010.9166%2013.1997L17.4832%206.63306C18.6166%205.49972%2019.1499%204.18306%2017.4832%202.51639C15.8166%200.849722%2014.4999%201.38306%2013.3666%202.51639Z'%20stroke='%23208B02'%20stroke-width='1.5'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.4248%203.45898C12.9831%205.45065%2014.5415%207.00898%2016.5415%207.57565'%20stroke='%23208B02'%20stroke-width='1.5'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Pt="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.3332%2013.9501V3.89174C18.3332%202.89174%2017.5165%202.15008%2016.5248%202.23341H16.4748C14.7248%202.38341%2012.0665%203.27508%2010.5832%204.20841L10.4415%204.30008C10.1998%204.45008%209.79984%204.45008%209.55817%204.30008L9.34984%204.17508C7.8665%203.25008%205.2165%202.36674%203.4665%202.22508C2.47484%202.14174%201.6665%202.89174%201.6665%203.88341V13.9501C1.6665%2014.7501%202.3165%2015.5001%203.1165%2015.6001L3.35817%2015.6334C5.1665%2015.8751%207.95817%2016.7917%209.55817%2017.6667L9.5915%2017.6834C9.8165%2017.8084%2010.1748%2017.8084%2010.3915%2017.6834C11.9915%2016.8001%2014.7915%2015.8751%2016.6082%2015.6334L16.8832%2015.6001C17.6832%2015.5001%2018.3332%2014.7501%2018.3332%2013.9501Z'%20stroke='%236574FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M10%204.57422V17.0742'%20stroke='%236574FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.4585%207.07422H4.5835'%20stroke='%236574FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.0835%209.57422H4.5835'%20stroke='%236574FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Tt="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.9833%2010.0009C12.9833%2011.6509%2011.6499%2012.9842%209.99993%2012.9842C8.34993%2012.9842%207.0166%2011.6509%207.0166%2010.0009C7.0166%208.35091%208.34993%207.01758%209.99993%207.01758C11.6499%207.01758%2012.9833%208.35091%2012.9833%2010.0009Z'%20stroke='%23FF9A64'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.99987%2016.8913C12.9415%2016.8913%2015.6832%2015.1579%2017.5915%2012.1579C18.3415%2010.9829%2018.3415%209.00794%2017.5915%207.83294C15.6832%204.83294%2012.9415%203.09961%209.99987%203.09961C7.0582%203.09961%204.31654%204.83294%202.4082%207.83294C1.6582%209.00794%201.6582%2010.9829%202.4082%2012.1579C4.31654%2015.1579%207.0582%2016.8913%209.99987%2016.8913Z'%20stroke='%23FF9A64'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Ft="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.16689%205.2668L13.2419%202.90846C16.4169%201.85013%2018.1419%203.58346%2017.0919%206.75846L14.7336%2013.8335C13.1502%2018.5918%2010.5502%2018.5918%208.96689%2013.8335L8.26689%2011.7335L6.16689%2011.0335C1.40856%209.45013%201.40856%206.85846%206.16689%205.2668Z'%20stroke='%236574FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.4248%2011.3745L11.4081%208.38281'%20stroke='%236574FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",It="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.49984%201.66602H12.4998C16.6665%201.66602%2018.3332%203.33268%2018.3332%207.49935V12.4993C18.3332%2016.666%2016.6665%2018.3327%2012.4998%2018.3327H7.49984C3.33317%2018.3327%201.6665%2016.666%201.6665%2012.4993V7.49935C1.6665%203.33268%203.33317%201.66602%207.49984%201.66602Z'%20stroke='%23208B02'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.1416%2012.7254L12.5916%207.27539'%20stroke='%23208B02'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.48351%208.64179C8.0496%208.64179%208.50849%208.1829%208.50849%207.61681C8.50849%207.05071%208.0496%206.5918%207.48351%206.5918C6.91741%206.5918%206.4585%207.05071%206.4585%207.61681C6.4585%208.1829%206.91741%208.64179%207.48351%208.64179Z'%20stroke='%23208B02'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.9332%2013.4074C13.4993%2013.4074%2013.9582%2012.9485%2013.9582%2012.3824C13.9582%2011.8163%2013.4993%2011.3574%2012.9332%2011.3574C12.3671%2011.3574%2011.9082%2011.8163%2011.9082%2012.3824C11.9082%2012.9485%2012.3671%2013.4074%2012.9332%2013.4074Z'%20stroke='%23208B02'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Ee=t=>typeof t=="string"?t:typeof t=="object"&&t!==null&&"src"in t?t.src:String(t),Wt={edit:Se,send:Ft,eye:Tt,percent:It,book:Pt};function Ae({metrics:t}){const{searchQuery:d}=ne();return e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4",children:t.map((r,l)=>{const o=Wt[r.icon]||Se,n=Ee(o);return e.jsxs(G,{className:"bg-white",style:{display:"flex",padding:"12px",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",flex:"1 0 0",alignSelf:"stretch",borderRadius:"4.98px",border:"0.187px solid #C7C7C7",background:"#FFF",boxShadow:"12px 12px 12px 0 rgba(219, 219, 219, 0.18)"},children:[e.jsxs("div",{className:"flex items-start justify-between w-full mb-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-gray-600 leading-[22px] mb-1",style:{color:"#7a7a7a",fontSize:"12px",fontWeight:"400"},children:e.jsx(k,{text:r.title,searchQuery:d})}),e.jsx("p",{className:"text-black capitalize",style:{fontFamily:"Universal Jungle, sans-serif",fontSize:"20px",fontWeight:"400",lineHeight:"30px"},children:r.value})]}),e.jsx("div",{className:q("flex items-center justify-center w-[38px] h-[38px] rounded-lg flex-shrink-0",r.iconBg),children:e.jsx("img",{src:n,alt:r.icon,width:20,height:20,className:"text-gray-600"})})]}),e.jsx("p",{className:q("text-gray-600 leading-[20px] w-full text-left",r.changeType==="positive"?"text-[#229954]":"text-[#e61437]"),style:{color:r.changeType==="positive"?"#229954":"#e61437",fontSize:"11px"},children:r.change})]},l)})})}Ae.__docgenInfo={description:"",methods:[],displayName:"DashboardMetrics",props:{metrics:{required:!0,tsType:{name:"Array",elements:[{name:"DashboardMetric"}],raw:"DashboardMetric[]"},description:""}}};function Pe({chartData:t,postPublishData:d,loading:r=!1}){const[l,o]=y.useState(null),[n,s]=y.useState({x:0,y:0}),[p,h]=y.useState(!1),[c,x]=y.useState({x:0,y:0}),[u,f]=y.useState({x:0,y:0}),[i,a]=y.useState(0),{searchQuery:m}=ne(),j=[1e3,800,600,400,200,0],N=y.useMemo(()=>{if(!d||d.length===0)return[];const g=Math.max(...d.map(D=>D.articles),1),v=400,w=200,A=10;return d.map((D,P)=>{const S=A+P/(d.length-1||1)*(v-A*2),C=w-D.articles/g*(w-40)-20;return{...D,x:S,y:C}})},[d]),T=y.useMemo(()=>{if(N.length===0)return{linePath:"",areaPath:""};const g=N;let v=`M ${g[0].x} ${g[0].y}`;for(let A=1;A<g.length;A++){const D=g[A-1],P=g[A],S=D.x+(P.x-D.x)/3,C=D.y,_=D.x+(P.x-D.x)*2/3,L=P.y;v+=` C ${S} ${C}, ${_} ${L}, ${P.x} ${P.y}`}const w=v+` L ${g[g.length-1].x} 200 L ${g[0].x} 200 Z`;return{linePath:v,areaPath:w}},[N]),E=y.useMemo(()=>{if(!d||d.length===0)return["1,000","800","600","400","200","0"];const g=Math.max(...d.map(w=>w.articles),100),v=Math.ceil(g/200)*200;return[v.toLocaleString(),Math.round(v*.8).toLocaleString(),Math.round(v*.6).toLocaleString(),Math.round(v*.4).toLocaleString(),Math.round(v*.2).toLocaleString(),"0"]},[d]);return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsx(G,{className:"border border-[#c7c7c7] rounded-[4px] bg-white shadow-none",style:{display:"flex",padding:"12px",justifyContent:"center",alignItems:"flex-start",gap:"10px",flex:"1 0 0",alignSelf:"stretch",background:"#FFF"},children:e.jsxs("div",{className:"w-full",children:[e.jsx(Y,{className:"p-3 pb-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(X,{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"16px",fontWeight:"400"},children:e.jsx(k,{text:"Category Performance",searchQuery:m})}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#fbbc9a]"}),e.jsx("span",{className:"text-xs text-[#7a7a7a]",style:{fontFamily:"Universal Jungle, sans-serif"},children:e.jsx(k,{text:"Total Views",searchQuery:m})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#a1aaff]"}),e.jsx("span",{className:"text-xs text-[#7a7a7a]",style:{fontFamily:"Universal Jungle, sans-serif"},children:e.jsx(k,{text:"Total Engagement",searchQuery:m})})]})]})]})}),e.jsx(K,{className:"p-3 pt-6",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute text-xs text-[#7a7a7a]",style:{fontFamily:"Universal Jungle, sans-serif",left:"-28px",top:"50%",transform:"translateY(-50%) rotate(-90deg)",transformOrigin:"center center",whiteSpace:"nowrap"},children:e.jsx(k,{text:"Active users",searchQuery:m})}),e.jsxs("div",{className:"flex ml-8",children:[e.jsx("div",{className:"flex flex-col justify-between text-xs text-[#7a7a7a] pr-2 text-right",style:{fontFamily:"Universal Jungle, sans-serif",height:"200px",minWidth:"32px"},children:j.map(g=>e.jsx("span",{children:g.toLocaleString()},g))}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-end justify-around relative",style:{height:"200px"},children:[t.length===0?e.jsx("div",{className:"flex items-center justify-center w-full h-full text-gray-400",children:r?"Loading...":"No Data"}):t.map((g,v)=>{const w=Math.max(...t.map(S=>S.totalViews+S.totalEngagement),1),A=(g.totalViews+g.totalEngagement)/w*200,D=g.totalEngagement/w*200,P=g.totalViews/w*200;return e.jsx("div",{className:"flex flex-col items-center",style:{width:"48px"},children:e.jsxs("div",{className:"relative w-10 cursor-pointer",style:{height:`${A}px`},onMouseEnter:S=>{o(v);const C=S.currentTarget.getBoundingClientRect();s({x:C.right+10,y:C.top+C.height/2})},onMouseLeave:()=>{o(null)},children:[e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-[#a1aaff] transition-opacity hover:opacity-80",style:{height:`${D}px`}}),e.jsx("div",{className:"absolute left-0 right-0 bg-[#fbbc9a] rounded-t-sm transition-opacity hover:opacity-80",style:{height:`${P}px`,bottom:`${D}px`}})]})},v)}),l!==null&&t[l]&&e.jsxs("div",{className:"fixed z-50 bg-white rounded-lg shadow-lg border border-gray-200 p-3 pointer-events-none",style:{left:`${n.x}px`,top:`${n.y-50}px`,transform:"translateY(-50%)",minWidth:"180px"},children:[e.jsx("div",{className:"text-gray-600 mb-2",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"14px",fontWeight:"bold"},children:t[l].category}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#fbbc9a]"}),e.jsxs("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"12px",fontWeight:"400"},children:["Total Views: ",t[l].totalViews.toLocaleString()]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#a1aaff]"}),e.jsxs("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"12px",fontWeight:"400"},children:["Total Engagement:"," ",t[l].totalEngagement.toLocaleString()]})]})]})]})]}),e.jsx("div",{className:"flex justify-around mt-2",children:t.map((g,v)=>e.jsx("span",{className:"text-xs text-[#7a7a7a] text-center",style:{fontFamily:"Universal Jungle, sans-serif",width:"48px"},children:g.category},v))}),e.jsx("div",{className:"text-center mt-3",children:e.jsx("span",{className:"text-xs text-[#7a7a7a]",style:{fontFamily:"Universal Jungle, sans-serif"},children:e.jsx(k,{text:"Categories",searchQuery:m})})})]})]})]})})]})}),e.jsx(G,{className:"border border-[#c7c7c7] rounded-[4px] bg-white shadow-none",style:{display:"flex",padding:"12px",justifyContent:"center",alignItems:"flex-start",gap:"10px",flex:"1 0 0",alignSelf:"stretch",background:"#FFF"},children:e.jsxs("div",{className:"w-full",children:[e.jsx(Y,{className:"p-3 pb-0",children:e.jsx(X,{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"16px",fontWeight:"400"},children:e.jsx(k,{text:"Post Publish Rate",searchQuery:m})})}),e.jsx(K,{className:"p-3 pt-6",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute text-xs text-[#7a7a7a]",style:{fontFamily:"Universal Jungle, sans-serif",left:"-28px",top:"50%",transform:"translateY(-50%) rotate(-90deg)",transformOrigin:"center center",whiteSpace:"nowrap"},children:e.jsx(k,{text:"Number of posts",searchQuery:m})}),e.jsxs("div",{className:"flex ml-8",children:[e.jsx("div",{className:"flex flex-col justify-between text-xs text-[#7a7a7a] pr-2 text-right",style:{fontFamily:"Universal Jungle, sans-serif",height:"200px",minWidth:"36px"},children:E.map((g,v)=>e.jsx("span",{children:g},v))}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{style:{height:"200px"},className:"relative",children:[N.length===0?e.jsx("div",{className:"flex items-center justify-center w-full h-full text-gray-400",children:r?"Loading...":"No Data"}):e.jsxs("svg",{className:"w-full h-full cursor-crosshair",viewBox:"0 0 400 200",preserveAspectRatio:"none",onMouseMove:g=>{var A;const v=g.currentTarget.getBoundingClientRect(),w=(g.clientX-v.left)/v.width*400;if(w>=0&&w<=400&&N.length>0){let D=0,P=Math.abs(N[0].x-w);N.forEach((_,L)=>{const O=Math.abs(_.x-w);O<P&&(P=O,D=L)});const S=N[D];h(!0),x({x:S.x,y:S.y}),a(D);const C=(A=g.currentTarget.parentElement)==null?void 0:A.getBoundingClientRect();C&&f({x:C.left+S.x/400*C.width+10,y:C.top+S.y/200*C.height-10})}},onMouseLeave:()=>{h(!1)},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"areaGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[e.jsx("stop",{offset:"0%",stopColor:"#ffbc9a",stopOpacity:"0.4"}),e.jsx("stop",{offset:"100%",stopColor:"#ffbc9a",stopOpacity:"0.05"})]})}),[0,1,2,3,4,5].map(g=>e.jsx("line",{x1:"0",y1:g*40,x2:"400",y2:g*40,stroke:"#f0f0f0",strokeWidth:"1"},g)),e.jsx("path",{d:T.areaPath,fill:"url(#areaGradient)"}),e.jsx("path",{d:T.linePath,stroke:"#ffbc9a",strokeWidth:"2",fill:"none"}),N.map((g,v)=>e.jsx("circle",{cx:g.x,cy:g.y,r:"3",fill:"#ffbc9a",stroke:"white",strokeWidth:"1"},v)),p&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:c.x,y1:c.y,x2:c.x,y2:"200",stroke:"#e5e5e5",strokeWidth:"1",strokeDasharray:"2,2"}),e.jsx("circle",{cx:c.x,cy:c.y,r:"5",fill:"#ffbc9a",stroke:"white",strokeWidth:"2"})]})]}),p&&N[i]&&e.jsxs("div",{className:"fixed z-50 bg-white rounded-lg shadow-lg border border-gray-200 p-3 pointer-events-none",style:{left:`${u.x}px`,top:`${u.y}px`,transform:"translateY(-100%)",minWidth:"160px"},children:[e.jsxs("div",{className:"text-xs text-gray-600 mb-2",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"12px",fontWeight:"400"},children:[N[i].month," 2025"]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#ffbc9a]"}),e.jsxs("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"12px",fontWeight:"400"},children:[N[i].articles.toLocaleString()," ","articles"]})]})]})]}),e.jsx("div",{className:"flex justify-between mt-2",children:(d&&d.length>0?d.map(g=>g.month):["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct"]).map(g=>e.jsx("span",{className:"text-xs text-[#7a7a7a] text-center",style:{fontFamily:"Universal Jungle, sans-serif"},children:g},g))}),e.jsx("div",{className:"text-center mt-3",children:e.jsx("span",{className:"text-xs text-[#7a7a7a]",style:{fontFamily:"Universal Jungle, sans-serif"},children:e.jsx(k,{text:"Months",searchQuery:m})})})]})]})]})})]})})]})}Pe.__docgenInfo={description:"",methods:[],displayName:"DashboardCharts",props:{chartData:{required:!0,tsType:{name:"Array",elements:[{name:"ChartDataPoint"}],raw:"ChartDataPoint[]"},description:""},postPublishData:{required:!1,tsType:{name:"Array",elements:[{name:"PostPublishDataPoint"}],raw:"PostPublishDataPoint[]"},description:""},loading:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}}}};const Rt=""+new URL("gold-CtN6pOVZ.svg",import.meta.url).href,$t=""+new URL("sapphire-BO-7mqXy.svg",import.meta.url).href,qt=""+new URL("emerald-GdtolcHR.svg",import.meta.url).href;function Te({articles:t,writers:d,loading:r=!1}){const{searchQuery:l}=ne(),o=()=>e.jsxs("div",{className:"flex items-center py-4 px-4 border-b border-gray-100 animate-pulse",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-3",children:[e.jsx("div",{className:"w-[100px] h-[70px] bg-gray-200 rounded flex-shrink-0"}),e.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-gray-200 rounded w-1/2"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 bg-gray-200 rounded-full"}),e.jsx("div",{className:"h-3 bg-gray-200 rounded w-20"})]})]})]}),e.jsx("div",{className:"w-[120px] px-3 flex-shrink-0",children:e.jsx("div",{className:"h-6 bg-gray-200 rounded-full w-16"})}),e.jsx("div",{className:"w-[100px] px-3 flex-shrink-0",children:e.jsx("div",{className:"h-6 bg-gray-200 rounded-full w-14"})}),e.jsx("div",{className:"w-[130px] pl-3 pr-1 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-4 h-4 bg-gray-200 rounded"}),e.jsx("div",{className:"h-3 bg-gray-200 rounded w-8"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-4 h-4 bg-gray-200 rounded"}),e.jsx("div",{className:"h-3 bg-gray-200 rounded w-8"})]})]})})]}),n=()=>e.jsxs("div",{className:"flex items-center py-4 px-4 border-b border-gray-100 animate-pulse",style:{minHeight:"94px"},children:[e.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-3",children:[e.jsx("div",{className:"w-6 h-6 bg-gray-200 rounded flex-shrink-0"}),e.jsx("div",{className:"w-10 h-10 bg-gray-200 rounded-full flex-shrink-0"}),e.jsxs("div",{className:"flex flex-col gap-1 flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-24"}),e.jsx("div",{className:"h-3 bg-gray-200 rounded w-32"})]})]}),e.jsxs("div",{className:"w-[160px] px-3 flex items-center gap-3",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-8"}),e.jsx("div",{className:"h-5 bg-gray-200 rounded-full w-12"})]}),e.jsxs("div",{className:"w-[160px] px-3 flex items-center gap-3",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-12"}),e.jsx("div",{className:"h-5 bg-gray-200 rounded-full w-12"})]}),e.jsxs("div",{className:"w-[160px] px-3 flex items-center gap-3",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-10"}),e.jsx("div",{className:"h-5 bg-gray-200 rounded-full w-12"})]})]});return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(G,{className:"border border-[#c7c7c7] rounded-[4px] bg-white shadow-none",children:[e.jsx(Y,{className:"p-4 pb-6",children:e.jsx(X,{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"16px",fontWeight:"400"},children:e.jsx(k,{text:"Top Performing Article",searchQuery:l})})}),e.jsx(K,{className:"p-0",children:e.jsxs("div",{className:"overflow-hidden",children:[e.jsxs("div",{className:"flex items-center py-3 px-4 border-b border-gray-200",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"13px"},children:e.jsx(k,{text:"Article",searchQuery:l})})}),e.jsx("div",{className:"w-[120px] px-3 flex-shrink-0",children:e.jsx("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"13px"},children:e.jsx(k,{text:"Categories",searchQuery:l})})}),e.jsx("div",{className:"w-[100px] px-3 flex-shrink-0",children:e.jsx("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"13px"},children:e.jsx(k,{text:"Tags",searchQuery:l})})}),e.jsx("div",{className:"w-[130px] pl-3 pr-1 flex-shrink-0",children:e.jsx("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"13px"},children:e.jsx(k,{text:"Statistics",searchQuery:l})})})]}),r?e.jsxs(e.Fragment,{children:[e.jsx(o,{}),e.jsx(o,{}),e.jsx(o,{}),e.jsx(o,{})]}):t.map(s=>e.jsxs("div",{className:"flex items-center py-4 px-4 border-b border-gray-100 last:border-b-0",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-3",children:[e.jsx("div",{className:"w-[100px] h-[70px] bg-gray-200 rounded overflow-hidden flex-shrink-0",children:e.jsx("img",{src:s.image,alt:s.title,className:"w-full h-full object-cover"})}),e.jsxs("div",{style:{display:"flex",width:"228px",minWidth:"120px",padding:"8px",flexDirection:"column",alignItems:"flex-start",gap:"8px",alignSelf:"stretch"},children:[e.jsx("h4",{className:"leading-[1.4] line-clamp-2",style:{color:"#001A24",fontSize:"14px",fontWeight:"500"},children:s.title}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0 overflow-hidden",style:{backgroundColor:"#FFE4D6"},children:s.author.avatar?e.jsx("img",{src:s.author.avatar,alt:s.author.name,className:"w-full h-full object-cover"}):e.jsx("span",{className:"text-gray-600",style:{fontSize:"8px",fontWeight:"500"},children:s.author.initials})}),e.jsx("span",{className:"text-gray-500 truncate",style:{color:"rgba(0, 0, 0, 0.44)",fontSize:"12px"},children:s.author.name})]})]})]}),e.jsx("div",{className:"w-[120px] px-3 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(V,{variant:"secondary",className:"text-xs whitespace-nowrap",style:{display:"flex",padding:"2px 8px",alignItems:"center",gap:"4px",borderRadius:"16px",background:"#EEF4FF",color:"#3538CD",fontSize:"10px",fontWeight:"400"},children:s.categories[0]}),s.categories.length>1&&e.jsxs("span",{className:"text-gray-500",style:{fontSize:"10px",marginLeft:"4px"},children:["+",s.categories.length-1]})]})}),e.jsx("div",{className:"w-[100px] px-3 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(V,{variant:"outline",className:"text-xs whitespace-nowrap",style:{display:"flex",padding:"2px 8px",alignItems:"center",gap:"4px",borderRadius:"16px",background:"#FFF",border:"1px solid #DFE5EB",color:"#869DA5",fontSize:"10px",fontWeight:"400"},children:s.tags[0]}),s.tags.length>1&&e.jsxs("span",{className:"text-gray-500",style:{fontSize:"10px",marginLeft:"4px"},children:["+",s.tags.length-1]})]})}),e.jsx("div",{className:"w-[130px] pl-3 pr-1 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ot,{className:"w-[14px] h-[14px] text-gray-400"}),e.jsx("span",{className:"text-gray-600",style:{color:"#001A24",fontSize:"12px"},children:s.statistics.views})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ct,{className:"w-[14px] h-[14px] text-gray-400"}),e.jsx("span",{className:"text-gray-600",style:{color:"#001A24",fontSize:"12px"},children:s.statistics.shares})]})]})})]},s.id))]})})]}),e.jsxs(G,{className:"border border-[#c7c7c7] rounded-[4px] bg-white shadow-none",children:[e.jsx(Y,{className:"p-4 pb-6",children:e.jsx(X,{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"16px",fontWeight:"400"},children:e.jsx(k,{text:"Writers Performance",searchQuery:l})})}),e.jsx(K,{className:"p-0",children:e.jsxs("div",{className:"overflow-hidden",children:[e.jsxs("div",{className:"flex items-center py-3 px-4 border-b border-gray-200",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"13px"},children:e.jsx(k,{text:"Writer",searchQuery:l})})}),e.jsx("div",{className:"w-[160px] px-3",children:e.jsx("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"13px"},children:e.jsx(k,{text:"Articles Written",searchQuery:l})})}),e.jsx("div",{className:"w-[160px] px-3",children:e.jsx("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"13px"},children:e.jsx(k,{text:"Total Views",searchQuery:l})})}),e.jsx("div",{className:"w-[160px] px-3",children:e.jsx("span",{className:"text-gray-600",style:{color:"var(--Hive-Grey-ED-900, var(--Foundation-Dark-D10, #001A24))",fontSize:"13px"},children:e.jsx(k,{text:"Engagement Rate",searchQuery:l})})})]}),r?e.jsxs(e.Fragment,{children:[e.jsx(n,{}),e.jsx(n,{}),e.jsx(n,{}),e.jsx(n,{})]}):d.length===0?e.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500",children:"No writers data available for this period"}):d.slice(0,4).map((s,p)=>{const c=(f=>f===0?Rt:f===1||f===2?$t:qt)(p),x=Ee(c),u=p===0?28:24;return e.jsxs("div",{className:"flex items-center py-4 px-4 border-b border-gray-100 last:border-b-0",style:{minHeight:"108px"},children:[e.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-3",children:[e.jsx("div",{className:"w-6 h-6 flex items-center justify-center flex-shrink-0",children:e.jsx("img",{src:x,alt:`Rank ${p+1}`,width:u,height:u})}),e.jsx("div",{className:"w-10 h-10 bg-gray-200 rounded-full overflow-hidden flex-shrink-0",children:s.avatar?e.jsx("img",{src:s.avatar,alt:s.name,className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full bg-gray-300 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-gray-600",style:{fontFamily:"Universal Jungle"},children:s.initials})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"text-sm font-medium text-black truncate",style:{color:"#001A24",fontSize:"14px",fontWeight:"500"},children:s.name}),e.jsx("p",{className:"text-xs text-gray-500 truncate",style:{color:"rgba(0, 0, 0, 0.44)",fontSize:"12px"},children:s.email})]})]}),e.jsxs("div",{className:"w-[160px] px-3 flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-black",style:{color:"#001A24",fontSize:"14px"},children:s.articlesWritten}),e.jsx(V,{variant:"secondary",className:"whitespace-nowrap",style:{display:"flex",padding:"2px 8px",alignItems:"center",gap:"2px",borderRadius:"16px",background:"#FEE2E2",color:"#DC2626",fontSize:"10px",fontWeight:"400"},children:"↓ 20%"})]}),e.jsxs("div",{className:"w-[160px] px-3 flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-black",style:{color:"#001A24",fontSize:"14px"},children:s.totalViews}),e.jsx(V,{variant:"secondary",className:"whitespace-nowrap",style:{display:"flex",padding:"2px 8px",alignItems:"center",gap:"2px",borderRadius:"16px",background:"#DCFCE7",color:"#16A34A",fontSize:"10px",fontWeight:"400"},children:"↑ 20%"})]}),e.jsxs("div",{className:"w-[160px] px-3 flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-black",style:{color:"#001A24",fontSize:"14px"},children:s.engagementRate}),e.jsx(V,{variant:"secondary",className:"whitespace-nowrap",style:{display:"flex",padding:"2px 8px",alignItems:"center",gap:"2px",borderRadius:"16px",background:"#DCFCE7",color:"#16A34A",fontSize:"10px",fontWeight:"400"},children:"↑ 20%"})]})]},s.id)})]})})]})]})}Te.__docgenInfo={description:"",methods:[],displayName:"DashboardTables",props:{articles:{required:!0,tsType:{name:"Array",elements:[{name:"ArticleData"}],raw:"ArticleData[]"},description:""},writers:{required:!0,tsType:{name:"Array",elements:[{name:"WriterData"}],raw:"WriterData[]"},description:""},loading:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}}}};function _t({className:t,showTitle:d=!0,title:r="Content Insight Dashboard",subtitle:l="Welcome to your Jungle dashboard!",onSearchChange:o,onDateRangeChange:n}){const{chartData:s,dashboardMetrics:p,articlesData:h,writersData:c,postPublishData:x,loading:u,dateRange:f,isUsingCustomDate:i,fetchData:a,setDateRange:m,setIsUsingCustomDate:j,setSearchQuery:N}=ne();y.useEffect(()=>{const v={dateRange:xe(f)};a(v)},[f,a]);const T=y.useCallback(v=>{m(v),j(!0),n==null||n(v)},[n]),E=y.useCallback(()=>{const v=pe(),w=ue(v);m(w),j(!1),n==null||n(w)},[n,m,j]),g=y.useCallback(v=>{N(v),o==null||o(v)},[o,N]);return e.jsx("div",{className:q("w-full h-full overflow-y-auto",t),children:e.jsxs("div",{className:"space-y-6 p-6",children:[d&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-[30px] font-normal leading-normal text-[#434343]",style:{fontFamily:"UniversalFeature, sans-serif"},children:r}),l&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("p",{className:"text-gray-600",children:l})})]}),e.jsx(Ne,{onSearchChange:g,onDateRangeChange:T,onLastMonthClick:E,isLastMonthActive:!i}),e.jsx(Ae,{metrics:p}),e.jsx(Pe,{chartData:s,postPublishData:x,loading:u}),e.jsx(Te,{articles:h,writers:c,loading:u})]})})}function Lt({projectToken:t,enableLiveData:d=!0,metrics:r,articles:l,writers:o,...n}){return e.jsx(Me,{projectToken:t,enableLiveData:d,initialMetrics:r,initialArticles:l,initialWriters:o,children:e.jsx(_t,{...n})})}Lt.__docgenInfo={description:"Main WazUIBlogDashboard component with context provider",methods:[],displayName:"WazUIBlogDashboard",props:{className:{required:!1,tsType:{name:"string"},description:""},showTitle:{required:!1,tsType:{name:"boolean"},description:""},title:{required:!1,tsType:{name:"string"},description:""},subtitle:{required:!1,tsType:{name:"string"},description:""},metrics:{required:!1,tsType:{name:"Array",elements:[{name:"DashboardMetric"}],raw:"DashboardMetric[]"},description:""},chartData:{required:!1,tsType:{name:"Array",elements:[{name:"ChartDataPoint"}],raw:"ChartDataPoint[]"},description:""},articles:{required:!1,tsType:{name:"Array",elements:[{name:"ArticleData"}],raw:"ArticleData[]"},description:""},writers:{required:!1,tsType:{name:"Array",elements:[{name:"WriterData"}],raw:"WriterData[]"},description:""},onSearchChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(query: string) => void",signature:{arguments:[{type:{name:"string"},name:"query"}],return:{name:"void"}}},description:""},onDateRangeChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(range: { start: Date; end: Date }) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ start: Date; end: Date }",signature:{properties:[{key:"start",value:{name:"Date",required:!0}},{key:"end",value:{name:"Date",required:!0}}]}},name:"range"}],return:{name:"void"}}},description:""},projectToken:{required:!1,tsType:{name:"string"},description:""},enableLiveData:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}}}};export{Lt as W};
@@ -0,0 +1,38 @@
1
+ import{W as T}from"./WazUIBlogDashboard-CtU7uRTr.js";import"./jsx-runtime-D_zvdyIk.js";import"./index-CBYaBgW8.js";import"./utils-3HBFSLrk.js";import"./popover-BB1qMQFg.js";import"./button-BxNLA_J_.js";import"./index-BJvHeDRT.js";import"./index-BWnBDfn-.js";import"./WazUiButton-e06gz3US.js";import"./calendar-CorT5FcI.js";import"./iframe-DarAeeHv.js";import"./index-CeH2RAp8.js";import"./useMercuryProjectToken-BgbQUYG9.js";import"./env-B_s3Ell7.js";const U={title:"Components/WazUIBlogDashboard",component:T,parameters:{layout:"fullscreen",docs:{description:{component:"Content Insight Dashboard - A comprehensive blog dashboard component displaying metrics, charts, and data tables for content management."}}},tags:["autodocs"],argTypes:{className:{control:"text",description:"Additional CSS classes to apply to the dashboard"},showTitle:{control:"boolean",description:"Whether to show the dashboard title section"},title:{control:"text",description:"Main dashboard title"},subtitle:{control:"text",description:"Dashboard subtitle/description"},onSearchChange:{action:"search changed",description:"Callback fired when search query changes"},onDateRangeChange:{action:"date range changed",description:"Callback fired when date range is selected"}}},e={args:{className:"bg-[red]"}},t={args:{metrics:[{title:"Custom Metric 1",value:"999",change:"+25 from last week",changeType:"positive",icon:"edit",iconBg:"bg-blue-100"},{title:"Custom Metric 2",value:"1.2M",change:"-5% from last month",changeType:"negative",icon:"eye",iconBg:"bg-red-100"}]}},a={args:{articles:[],writers:[],chartData:[]}},o={args:{title:"My Custom Dashboard",subtitle:"Custom subtitle for the dashboard component"}},r={args:{showTitle:!1}};var s,n,i;e.parameters={...e.parameters,docs:{...(s=e.parameters)==null?void 0:s.docs,source:{originalSource:`{
2
+ args: {
3
+ className: 'bg-[red]'
4
+ }
5
+ }`,...(i=(n=e.parameters)==null?void 0:n.docs)==null?void 0:i.source}}};var c,m,l;t.parameters={...t.parameters,docs:{...(c=t.parameters)==null?void 0:c.docs,source:{originalSource:`{
6
+ args: {
7
+ metrics: [{
8
+ title: 'Custom Metric 1',
9
+ value: '999',
10
+ change: '+25 from last week',
11
+ changeType: 'positive',
12
+ icon: 'edit',
13
+ iconBg: 'bg-blue-100'
14
+ }, {
15
+ title: 'Custom Metric 2',
16
+ value: '1.2M',
17
+ change: '-5% from last month',
18
+ changeType: 'negative',
19
+ icon: 'eye',
20
+ iconBg: 'bg-red-100'
21
+ }]
22
+ }
23
+ }`,...(l=(m=t.parameters)==null?void 0:m.docs)==null?void 0:l.source}}};var d,p,g;a.parameters={...a.parameters,docs:{...(d=a.parameters)==null?void 0:d.docs,source:{originalSource:`{
24
+ args: {
25
+ articles: [],
26
+ writers: [],
27
+ chartData: []
28
+ }
29
+ }`,...(g=(p=a.parameters)==null?void 0:p.docs)==null?void 0:g.source}}};var h,u,b;o.parameters={...o.parameters,docs:{...(h=o.parameters)==null?void 0:h.docs,source:{originalSource:`{
30
+ args: {
31
+ title: 'My Custom Dashboard',
32
+ subtitle: 'Custom subtitle for the dashboard component'
33
+ }
34
+ }`,...(b=(u=o.parameters)==null?void 0:u.docs)==null?void 0:b.source}}};var C,f,y;r.parameters={...r.parameters,docs:{...(C=r.parameters)==null?void 0:C.docs,source:{originalSource:`{
35
+ args: {
36
+ showTitle: false
37
+ }
38
+ }`,...(y=(f=r.parameters)==null?void 0:f.docs)==null?void 0:y.source}}};const _=["Default","CustomMetrics","EmptyState","WithCustomTitle","WithoutTitle"];export{t as CustomMetrics,e as Default,a as EmptyState,o as WithCustomTitle,r as WithoutTitle,_ as __namedExportsOrder,U as default};
@@ -0,0 +1,59 @@
1
+ import{W as E}from"./WazUiButton-e06gz3US.js";import"./jsx-runtime-D_zvdyIk.js";import"./utils-3HBFSLrk.js";import"./index-CBYaBgW8.js";import"./button-BxNLA_J_.js";const H={title:"Components/WazUIButton",component:E,parameters:{layout:"centered",theme:"dark"},tags:["autodocs"],argTypes:{variant:{control:"select",options:["primary","secondary","destructive","outline","ghost"]},size:{control:"select",options:["default","sm","lg","icon"]},isLoading:{control:"boolean"},disabled:{control:"boolean"},leadingIcon:{control:"text"},trailingIcon:{control:"text"}}},r={args:{variant:"primary",size:"default",children:"Primary Button"}},e={args:{variant:"secondary",size:"default",children:"Secondary Button"}},a={args:{variant:"destructive",size:"default",children:"Destructive Button"}},n={args:{variant:"outline",size:"default",children:"Outline Button"}},t={args:{variant:"ghost",size:"default",children:"Ghost Button"}},s={args:{variant:"primary",size:"default",leadingIcon:"🔥",children:"Leading Icon"}},o={args:{variant:"primary",size:"default",trailingIcon:"➡️",children:"Trailing Icon"}},i={args:{variant:"primary",size:"default",isLoading:!0,children:"Loading..."}},c={args:{variant:"primary",size:"default",disabled:!0,children:"Disabled Button"}};var d,l,u;r.parameters={...r.parameters,docs:{...(d=r.parameters)==null?void 0:d.docs,source:{originalSource:`{
2
+ args: {
3
+ variant: 'primary',
4
+ size: 'default',
5
+ children: 'Primary Button'
6
+ }
7
+ }`,...(u=(l=r.parameters)==null?void 0:l.docs)==null?void 0:u.source}}};var m,p,g;e.parameters={...e.parameters,docs:{...(m=e.parameters)==null?void 0:m.docs,source:{originalSource:`{
8
+ args: {
9
+ variant: 'secondary',
10
+ size: 'default',
11
+ children: 'Secondary Button'
12
+ }
13
+ }`,...(g=(p=e.parameters)==null?void 0:p.docs)==null?void 0:g.source}}};var h,v,y;a.parameters={...a.parameters,docs:{...(h=a.parameters)==null?void 0:h.docs,source:{originalSource:`{
14
+ args: {
15
+ variant: 'destructive',
16
+ size: 'default',
17
+ children: 'Destructive Button'
18
+ }
19
+ }`,...(y=(v=a.parameters)==null?void 0:v.docs)==null?void 0:y.source}}};var f,z,I;n.parameters={...n.parameters,docs:{...(f=n.parameters)==null?void 0:f.docs,source:{originalSource:`{
20
+ args: {
21
+ variant: 'outline',
22
+ size: 'default',
23
+ children: 'Outline Button'
24
+ }
25
+ }`,...(I=(z=n.parameters)==null?void 0:z.docs)==null?void 0:I.source}}};var B,S,L;t.parameters={...t.parameters,docs:{...(B=t.parameters)==null?void 0:B.docs,source:{originalSource:`{
26
+ args: {
27
+ variant: 'ghost',
28
+ size: 'default',
29
+ children: 'Ghost Button'
30
+ }
31
+ }`,...(L=(S=t.parameters)==null?void 0:S.docs)==null?void 0:L.source}}};var b,D,W;s.parameters={...s.parameters,docs:{...(b=s.parameters)==null?void 0:b.docs,source:{originalSource:`{
32
+ args: {
33
+ variant: 'primary',
34
+ size: 'default',
35
+ leadingIcon: '🔥',
36
+ children: 'Leading Icon'
37
+ }
38
+ }`,...(W=(D=s.parameters)==null?void 0:D.docs)==null?void 0:W.source}}};var O,T,x;o.parameters={...o.parameters,docs:{...(O=o.parameters)==null?void 0:O.docs,source:{originalSource:`{
39
+ args: {
40
+ variant: 'primary',
41
+ size: 'default',
42
+ trailingIcon: '➡️',
43
+ children: 'Trailing Icon'
44
+ }
45
+ }`,...(x=(T=o.parameters)==null?void 0:T.docs)==null?void 0:x.source}}};var G,P,U;i.parameters={...i.parameters,docs:{...(G=i.parameters)==null?void 0:G.docs,source:{originalSource:`{
46
+ args: {
47
+ variant: 'primary',
48
+ size: 'default',
49
+ isLoading: true,
50
+ children: 'Loading...'
51
+ }
52
+ }`,...(U=(P=i.parameters)==null?void 0:P.docs)==null?void 0:U.source}}};var _,k,C;c.parameters={...c.parameters,docs:{...(_=c.parameters)==null?void 0:_.docs,source:{originalSource:`{
53
+ args: {
54
+ variant: 'primary',
55
+ size: 'default',
56
+ disabled: true,
57
+ children: 'Disabled Button'
58
+ }
59
+ }`,...(C=(k=c.parameters)==null?void 0:k.docs)==null?void 0:C.source}}};const J=["Primary","Secondary","Destructive","Outline","Ghost","WithLeadingIcon","WithTrailingIcon","Loading","Disabled"];export{a as Destructive,c as Disabled,t as Ghost,i as Loading,n as Outline,r as Primary,e as Secondary,s as WithLeadingIcon,o as WithTrailingIcon,J as __namedExportsOrder,H as default};