xertica-ui 2.1.2 → 2.1.4

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 (181) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +1 -1
  3. package/bin/cli.ts +1 -1
  4. package/bin/generate-tokens.ts +13 -7
  5. package/components/assistant/xertica-assistant/index.ts +2 -0
  6. package/components/assistant/xertica-assistant/parts/AssistantCollapsedView.tsx +97 -0
  7. package/components/assistant/xertica-assistant/parts/AssistantConversationList.tsx +104 -0
  8. package/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.tsx +81 -0
  9. package/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.tsx +86 -0
  10. package/components/assistant/xertica-assistant/parts/AssistantHeader.tsx +77 -0
  11. package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +573 -0
  12. package/components/assistant/xertica-assistant/parts/AssistantTabBar.tsx +65 -0
  13. package/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.tsx +41 -0
  14. package/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.tsx +98 -0
  15. package/components/assistant/xertica-assistant/parts/index.ts +16 -0
  16. package/components/assistant/xertica-assistant/types.ts +139 -0
  17. package/components/assistant/xertica-assistant/use-assistant.ts +559 -0
  18. package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +200 -0
  19. package/components/assistant/xertica-assistant/xertica-assistant.tsx +198 -1460
  20. package/components/brand/theme-toggle/ThemeToggle.tsx +8 -27
  21. package/components/hooks/index.ts +3 -0
  22. package/components/hooks/use-layout-shortcuts.ts +46 -0
  23. package/components/layout/sidebar/index.ts +2 -0
  24. package/components/layout/sidebar/sidebar.stories.tsx +160 -8
  25. package/components/layout/sidebar/sidebar.tsx +606 -497
  26. package/components/layout/sidebar/use-sidebar.ts +104 -0
  27. package/components/media/audio-player/AudioPlayer.tsx +131 -206
  28. package/components/media/audio-player/use-audio-player.ts +298 -0
  29. package/components/pages/home-page/HomePage.tsx +1 -1
  30. package/components/pages/template-content/TemplateContent.tsx +5 -5
  31. package/components/pages/template-page/TemplatePage.tsx +5 -5
  32. package/components/shared/CustomTooltipContent.tsx +52 -0
  33. package/components/shared/layout-constants.ts +1 -1
  34. package/components/ui/chart/chart.stories.tsx +966 -7
  35. package/components/ui/chart/chart.tsx +918 -45
  36. package/components/ui/file-upload/file-upload.stories.tsx +100 -0
  37. package/components/ui/file-upload/file-upload.tsx +14 -74
  38. package/components/ui/file-upload/index.ts +1 -0
  39. package/components/ui/file-upload/use-file-upload.ts +181 -0
  40. package/components/ui/pagination/index.ts +2 -0
  41. package/components/ui/pagination/pagination.stories.tsx +94 -0
  42. package/components/ui/pagination/use-pagination.ts +194 -0
  43. package/components/ui/rich-text-editor/index.ts +2 -0
  44. package/components/ui/rich-text-editor/rich-text-editor.stories.tsx +129 -1
  45. package/components/ui/rich-text-editor/rich-text-editor.tsx +86 -305
  46. package/components/ui/rich-text-editor/use-rich-text-editor.ts +439 -0
  47. package/components/ui/stepper/index.ts +3 -1
  48. package/components/ui/stepper/stepper.stories.tsx +116 -0
  49. package/components/ui/stepper/stepper.tsx +4 -4
  50. package/components/ui/stepper/use-stepper.ts +137 -0
  51. package/components/ui/tree-view/index.ts +4 -1
  52. package/components/ui/tree-view/tree-view.stories.tsx +110 -4
  53. package/components/ui/tree-view/tree-view.tsx +17 -125
  54. package/components/ui/tree-view/use-tree-view.ts +229 -0
  55. package/contexts/AssistenteContext.tsx +17 -54
  56. package/contexts/BrandColorsContext.tsx +6 -17
  57. package/contexts/LayoutContext.tsx +5 -31
  58. package/dist/AssistantChart-BAudAfne.cjs +3591 -0
  59. package/dist/AssistantChart-BP8upjMk.js +3565 -0
  60. package/dist/AudioPlayer-1ypwE2Wh.cjs +936 -0
  61. package/dist/AudioPlayer-DuKXrCfy.js +937 -0
  62. package/dist/CustomTooltipContent-DHjkY0ww.js +40 -0
  63. package/dist/CustomTooltipContent-c_K-DWRr.cjs +56 -0
  64. package/dist/LanguageContext-BwhwC3G2.js +657 -0
  65. package/dist/LanguageContext-DvUt5jBg.cjs +656 -0
  66. package/dist/LayoutContext-BDmcZfMH.cjs +84 -0
  67. package/dist/LayoutContext-dbQvdC4O.js +85 -0
  68. package/dist/ThemeContext-RTy1m2Uq.js +82 -0
  69. package/dist/ThemeContext-bSzuOit2.cjs +81 -0
  70. package/dist/VerifyEmailPage-C_ihbcth.js +2828 -0
  71. package/dist/VerifyEmailPage-Dt7zgA4w.cjs +2827 -0
  72. package/dist/XerticaProvider-CW9hpCdF.cjs +39 -0
  73. package/dist/XerticaProvider-siSt9uG2.js +40 -0
  74. package/dist/XerticaXLogo-D8jf0SNv.cjs +214 -0
  75. package/dist/XerticaXLogo-fAJMy3H4.js +215 -0
  76. package/dist/assistant.cjs.js +2 -1
  77. package/dist/assistant.es.js +3 -2
  78. package/dist/brand.cjs.js +2 -2
  79. package/dist/brand.es.js +2 -2
  80. package/dist/cli.js +14 -8
  81. package/dist/components/assistant/xertica-assistant/index.d.ts +2 -0
  82. package/dist/components/assistant/xertica-assistant/parts/AssistantCollapsedView.d.ts +13 -0
  83. package/dist/components/assistant/xertica-assistant/parts/AssistantConversationList.d.ts +16 -0
  84. package/dist/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.d.ts +17 -0
  85. package/dist/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.d.ts +19 -0
  86. package/dist/components/assistant/xertica-assistant/parts/AssistantHeader.d.ts +11 -0
  87. package/dist/components/assistant/xertica-assistant/parts/AssistantMessageBubble.d.ts +29 -0
  88. package/dist/components/assistant/xertica-assistant/parts/AssistantTabBar.d.ts +13 -0
  89. package/dist/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.d.ts +4 -0
  90. package/dist/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.d.ts +17 -0
  91. package/dist/components/assistant/xertica-assistant/parts/index.d.ts +16 -0
  92. package/dist/components/assistant/xertica-assistant/types.d.ts +106 -0
  93. package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +125 -0
  94. package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +8 -97
  95. package/dist/components/hooks/index.d.ts +3 -0
  96. package/dist/components/hooks/use-layout-shortcuts.d.ts +22 -0
  97. package/dist/components/layout/sidebar/index.d.ts +2 -0
  98. package/dist/components/layout/sidebar/sidebar.d.ts +80 -0
  99. package/dist/components/layout/sidebar/use-sidebar.d.ts +22 -0
  100. package/dist/components/media/audio-player/AudioPlayer.d.ts +4 -1
  101. package/dist/components/media/audio-player/use-audio-player.d.ts +72 -0
  102. package/dist/components/shared/CustomTooltipContent.d.ts +20 -0
  103. package/dist/components/shared/layout-constants.d.ts +1 -1
  104. package/dist/components/ui/alert/alert.d.ts +1 -1
  105. package/dist/components/ui/badge/badge.d.ts +1 -1
  106. package/dist/components/ui/button/button.d.ts +2 -2
  107. package/dist/components/ui/chart/chart.d.ts +162 -5
  108. package/dist/components/ui/file-upload/file-upload.d.ts +2 -0
  109. package/dist/components/ui/file-upload/index.d.ts +1 -0
  110. package/dist/components/ui/file-upload/use-file-upload.d.ts +49 -0
  111. package/dist/components/ui/pagination/index.d.ts +2 -0
  112. package/dist/components/ui/pagination/use-pagination.d.ts +78 -0
  113. package/dist/components/ui/rich-text-editor/index.d.ts +2 -0
  114. package/dist/components/ui/rich-text-editor/use-rich-text-editor.d.ts +107 -0
  115. package/dist/components/ui/stepper/index.d.ts +3 -1
  116. package/dist/components/ui/stepper/stepper.d.ts +2 -2
  117. package/dist/components/ui/stepper/use-stepper.d.ts +60 -0
  118. package/dist/components/ui/tree-view/index.d.ts +4 -1
  119. package/dist/components/ui/tree-view/tree-view.d.ts +4 -6
  120. package/dist/components/ui/tree-view/use-tree-view.d.ts +60 -0
  121. package/dist/contexts/AssistenteContext.d.ts +10 -49
  122. package/dist/hooks.cjs.js +30 -10
  123. package/dist/hooks.es.js +25 -4
  124. package/dist/index.cjs.js +20 -9
  125. package/dist/index.es.js +38 -27
  126. package/dist/layout.cjs.js +82 -1
  127. package/dist/layout.es.js +83 -2
  128. package/dist/media.cjs.js +1 -1
  129. package/dist/media.es.js +1 -1
  130. package/dist/pages.cjs.js +1 -1
  131. package/dist/pages.es.js +1 -1
  132. package/dist/rich-text-editor-BmsjY03B.js +2949 -0
  133. package/dist/rich-text-editor-GS2kpTAK.cjs +2966 -0
  134. package/dist/sidebar-CVUGHOS_.cjs +756 -0
  135. package/dist/sidebar-CmvwjnVb.js +757 -0
  136. package/dist/ui.cjs.js +12 -2
  137. package/dist/ui.es.js +24 -14
  138. package/dist/use-audio-player-Bkh23vQ3.js +177 -0
  139. package/dist/use-audio-player-Dn1NR9xN.cjs +176 -0
  140. package/dist/utils/color-utils.d.ts +51 -0
  141. package/dist/xertica-assistant-BMqdyRVi.js +2082 -0
  142. package/dist/xertica-assistant-Bj3vBCq_.cjs +2081 -0
  143. package/dist/xertica-ui.css +1 -1
  144. package/docs/ai-usage.md +28 -10
  145. package/docs/architecture-improvements.md +463 -0
  146. package/docs/architecture.md +77 -1
  147. package/docs/components/assistant-chart.md +1 -1
  148. package/docs/components/assistant.md +159 -0
  149. package/docs/components/audio-player.md +46 -0
  150. package/docs/components/branding.md +251 -0
  151. package/docs/components/chart.md +354 -39
  152. package/docs/components/code-block.md +108 -0
  153. package/docs/components/file-upload.md +119 -2
  154. package/docs/components/formatted-document.md +113 -0
  155. package/docs/components/hooks.md +430 -0
  156. package/docs/components/image-with-fallback.md +106 -0
  157. package/docs/components/map-layers.md +140 -0
  158. package/docs/components/modern-chat-input.md +163 -0
  159. package/docs/components/pages.md +351 -0
  160. package/docs/components/pagination.md +187 -0
  161. package/docs/components/rich-text-editor.md +164 -0
  162. package/docs/components/sidebar.md +153 -4
  163. package/docs/components/stepper.md +157 -12
  164. package/docs/components/tree-view.md +164 -6
  165. package/docs/doc-audit.md +223 -0
  166. package/docs/getting-started.md +155 -1
  167. package/docs/guidelines.md +14 -8
  168. package/docs/layout.md +2 -2
  169. package/docs/llms.md +29 -9
  170. package/docs/patterns/detail-page.md +276 -0
  171. package/docs/patterns/settings.md +346 -0
  172. package/docs/patterns/wizard.md +217 -0
  173. package/guidelines/Guidelines.md +5 -3
  174. package/llms.txt +1 -1
  175. package/package.json +10 -10
  176. package/styles/xertica/tokens.css +41 -12
  177. package/templates/CLAUDE.md +16 -6
  178. package/templates/guidelines/Guidelines.md +16 -4
  179. package/templates/package.json +3 -3
  180. package/templates/src/styles/xertica/tokens.css +39 -10
  181. package/utils/color-utils.ts +72 -0
package/dist/ui.cjs.js CHANGED
@@ -3,10 +3,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const button = require("./button-0CXwCRTm.cjs");
4
4
  const card = require("./card-DJTsYhLL.cjs");
5
5
  const alertDialog = require("./alert-dialog-yckpaOpy.cjs");
6
- const AssistantChart = require("./AssistantChart-BAx9VQvb.cjs");
6
+ const AssistantChart = require("./AssistantChart-BAudAfne.cjs");
7
7
  const breadcrumb = require("./breadcrumb-DnDlQFg2.cjs");
8
8
  const input = require("./input-CPl84zAx.cjs");
9
- const richTextEditor = require("./rich-text-editor-DbV-S7Fi.cjs");
9
+ const richTextEditor = require("./rich-text-editor-GS2kpTAK.cjs");
10
10
  const slider = require("./slider-CPmwzm_3.cjs");
11
11
  const select = require("./select-DT7Zjn42.cjs");
12
12
  const tooltip = require("./tooltip-CNtsL5cB.cjs");
@@ -184,8 +184,12 @@ exports.ToggleGroupItem = AssistantChart.ToggleGroupItem;
184
184
  exports.TreeView = AssistantChart.TreeView;
185
185
  exports.navigationMenuTriggerStyle = AssistantChart.navigationMenuTriggerStyle;
186
186
  exports.toggleVariants = AssistantChart.toggleVariants;
187
+ exports.useFileUpload = AssistantChart.useFileUpload;
187
188
  exports.useFormField = AssistantChart.useFormField;
189
+ exports.usePagination = AssistantChart.usePagination;
188
190
  exports.useStepper = AssistantChart.useStepper;
191
+ exports.useStepperContext = AssistantChart.useStepperContext;
192
+ exports.useTreeView = AssistantChart.useTreeView;
189
193
  exports.Breadcrumb = breadcrumb.Breadcrumb;
190
194
  exports.BreadcrumbEllipsis = breadcrumb.BreadcrumbEllipsis;
191
195
  exports.BreadcrumbItem = breadcrumb.BreadcrumbItem;
@@ -231,10 +235,15 @@ exports.EmptyDescription = richTextEditor.EmptyDescription;
231
235
  exports.EmptyIcon = richTextEditor.EmptyIcon;
232
236
  exports.EmptyImage = richTextEditor.EmptyImage;
233
237
  exports.EmptyTitle = richTextEditor.EmptyTitle;
238
+ exports.GaugeChart = richTextEditor.GaugeChart;
234
239
  exports.HorizontalBarChart = richTextEditor.HorizontalBarChart;
235
240
  exports.InteractiveTimeSeriesChart = richTextEditor.InteractiveTimeSeriesChart;
241
+ exports.PieMetricChart = richTextEditor.PieMetricChart;
242
+ exports.RadarMetricChart = richTextEditor.RadarMetricChart;
243
+ exports.RadialBarMetricChart = richTextEditor.RadialBarMetricChart;
236
244
  exports.RichTextEditor = richTextEditor.RichTextEditor;
237
245
  exports.Skeleton = richTextEditor.Skeleton;
246
+ exports.SparklineChart = richTextEditor.SparklineChart;
238
247
  exports.Table = richTextEditor.Table;
239
248
  exports.TableBody = richTextEditor.TableBody;
240
249
  exports.TableCaption = richTextEditor.TableCaption;
@@ -245,6 +254,7 @@ exports.TableHeader = richTextEditor.TableHeader;
245
254
  exports.TableRow = richTextEditor.TableRow;
246
255
  exports.Textarea = richTextEditor.Textarea;
247
256
  exports.useChart = richTextEditor.useChart;
257
+ exports.useRichTextEditor = richTextEditor.useRichTextEditor;
248
258
  exports.Slider = slider.Slider;
249
259
  exports.Select = select.Select;
250
260
  exports.SelectContent = select.SelectContent;
package/dist/ui.es.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { B, b, c } from "./button-qkz7Icqf.js";
2
2
  import { C, a, b as b2, c as c2, d, e, f } from "./card-fi8zAN-I.js";
3
3
  import { A, a as a2, b as b3, c as c3, d as d2, e as e2, f as f2, g, h, i, j, C as C2, I, L, M, P, k, l, R, m, S, n, T, o, p, q, u } from "./alert-dialog-iDe5VE5o.js";
4
- import { A as A2, a as a3, b as b4, c as c4, d as d3, e as e3, C as C3, f as f3, g as g2, h as h2, i as i2, j as j2, k as k2, l as l2, m as m2, n as n2, o as o2, p as p2, q as q2, r, s, t, u as u2, v, w, x, y, z, B as B2, D, E, F, G, H, I as I2, J, K, L as L2, M as M2, N, O, P as P2, Q, R as R2, S as S2, T as T2, U, V, W, X, Y, Z, _, $, a0, a1, a2 as a22, a3 as a32, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2 as b22, b3 as b32, b4 as b42, b5, b6, b7, b8, b9, ba, bb, bc, bd, be } from "./AssistantChart-CVko2A1W.js";
4
+ import { A as A2, a as a3, b as b4, c as c4, d as d3, e as e3, C as C3, f as f3, g as g2, h as h2, i as i2, j as j2, k as k2, l as l2, m as m2, n as n2, o as o2, p as p2, q as q2, r, s, t, u as u2, v, w, x, y, z, B as B2, D, E, F, G, H, I as I2, J, K, L as L2, M as M2, N, O, P as P2, Q, R as R2, S as S2, T as T2, U, V, W, X, Y, Z, _, $, a0, a1, a2 as a22, a3 as a32, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2 as b22, b3 as b32, b4 as b42, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi } from "./AssistantChart-BP8upjMk.js";
5
5
  import { B as B3, a as a10, b as b10, c as c5, d as d4, e as e4, f as f4 } from "./breadcrumb-CVzzzqfo.js";
6
6
  import { I as I3, P as P3, a as a11, b as b11, c as c6, S as S3, d as d5 } from "./input-D-6IsAca.js";
7
- import { A as A3, a as a12, b as b12, C as C4, c as c7, d as d6, e as e5, f as f5, g as g3, h as h3, i as i3, D as D2, j as j3, k as k3, l as l3, m as m3, n as n3, o as o3, p as p3, q as q3, r as r2, s as s2, t as t2, u as u3, v as v2, E as E2, w as w2, x as x2, y as y2, z as z2, B as B4, H as H2, I as I4, R as R3, S as S4, T as T3, F as F2, G as G2, J as J2, K as K2, L as L3, M as M3, N as N2, O as O2, P as P4 } from "./rich-text-editor-BrdC5evx.js";
7
+ import { A as A3, a as a12, b as b12, C as C4, c as c7, d as d6, e as e5, f as f5, g as g3, h as h3, i as i3, D as D2, j as j3, k as k3, l as l3, m as m3, n as n3, o as o3, p as p3, q as q3, r as r2, s as s2, t as t2, u as u3, v as v2, E as E2, w as w2, x as x2, y as y2, z as z2, B as B4, G as G2, H as H2, I as I4, P as P4, R as R3, F as F2, J as J2, S as S4, K as K2, T as T3, L as L3, M as M3, N as N2, O as O2, Q as Q2, U as U2, V as V2, W as W2, X as X2, Y as Y2 } from "./rich-text-editor-BmsjY03B.js";
8
8
  import { S as S5 } from "./slider-C0JKA9k3.js";
9
9
  import { S as S6, a as a13, b as b13, c as c8, d as d7, e as e6, f as f6, g as g4, h as h4, i as i4 } from "./select-En8DkoaQ.js";
10
10
  import { T as T4, a as a14, b as b14, c as c9 } from "./tooltip-CTyZCD8h.js";
@@ -153,6 +153,7 @@ export {
153
153
  a4 as FormMessage,
154
154
  G3 as GOOGLE_MAPS_ID,
155
155
  a17 as GOOGLE_MAPS_LIBRARIES,
156
+ G2 as GaugeChart,
156
157
  b18 as GoogleMapsLoaderProvider,
157
158
  c11 as GoogleMapsProvider,
158
159
  H2 as HorizontalBarChart,
@@ -203,18 +204,21 @@ export {
203
204
  aF as PaginationLink,
204
205
  aG as PaginationNext,
205
206
  aH as PaginationPrevious,
207
+ P4 as PieMetricChart,
206
208
  P3 as Popover,
207
209
  a11 as PopoverAnchor,
208
210
  b11 as PopoverContent,
209
211
  c6 as PopoverTrigger,
210
212
  P5 as Progress,
213
+ R3 as RadarMetricChart,
214
+ F2 as RadialBarMetricChart,
211
215
  R as RadioGroup,
212
216
  m as RadioGroupItem,
213
217
  aI as Rating,
214
218
  aJ as ResizableHandle,
215
219
  aK as ResizablePanel,
216
220
  aL as ResizablePanelGroup,
217
- R3 as RichTextEditor,
221
+ J2 as RichTextEditor,
218
222
  aM as RouteMap,
219
223
  S3 as ScrollArea,
220
224
  d5 as ScrollBar,
@@ -243,23 +247,24 @@ export {
243
247
  aY as SimpleMap,
244
248
  S4 as Skeleton,
245
249
  S5 as Slider,
250
+ K2 as SparklineChart,
246
251
  aZ as StatsCard,
247
252
  a_ as Step,
248
253
  a$ as Stepper,
249
254
  n as Switch,
250
255
  T3 as Table,
251
- F2 as TableBody,
252
- G2 as TableCaption,
253
- J2 as TableCell,
254
- K2 as TableFooter,
255
- L3 as TableHead,
256
- M3 as TableHeader,
257
- N2 as TableRow,
256
+ L3 as TableBody,
257
+ M3 as TableCaption,
258
+ N2 as TableCell,
259
+ O2 as TableFooter,
260
+ Q2 as TableHead,
261
+ U2 as TableHeader,
262
+ V2 as TableRow,
258
263
  T as Tabs,
259
264
  o as TabsContent,
260
265
  p as TabsList,
261
266
  q as TabsTrigger,
262
- O2 as Textarea,
267
+ W2 as Textarea,
263
268
  b0 as Timeline,
264
269
  b1 as TimelineContent,
265
270
  b22 as TimelineDescription,
@@ -282,11 +287,16 @@ export {
282
287
  bb as navigationMenuTriggerStyle,
283
288
  r3 as reloadGoogleMaps,
284
289
  bc as toggleVariants,
285
- P4 as useChart,
286
- bd as useFormField,
290
+ X2 as useChart,
291
+ bd as useFileUpload,
292
+ be as useFormField,
287
293
  u4 as useGoogleMapsLoader,
288
294
  u5 as useIsMobile,
289
295
  u as useMapLayers,
290
296
  a18 as useMobile,
291
- be as useStepper
297
+ bf as usePagination,
298
+ Y2 as useRichTextEditor,
299
+ bg as useStepper,
300
+ bh as useStepperContext,
301
+ bi as useTreeView
292
302
  };
@@ -0,0 +1,177 @@
1
+ import { useRef, useState, useEffect, useCallback } from "react";
2
+ import { u as useIsMobile } from "./use-mobile-CNwiBNxu.js";
3
+ import { a as useOptionalLayout } from "./LayoutContext-dbQvdC4O.js";
4
+ function useAudioPlayer({
5
+ src,
6
+ autoPlay = false,
7
+ initialTime = 0,
8
+ initialDuration,
9
+ variant = "card",
10
+ isOpen = true,
11
+ enableAutoFloat = true,
12
+ onCloseFloating
13
+ } = {}) {
14
+ const audioRef = useRef(null);
15
+ const containerRef = useRef(null);
16
+ const layout = useOptionalLayout();
17
+ const sidebarExpanded = (layout == null ? void 0 : layout.sidebarExpanded) ?? false;
18
+ const sidebarWidth = (layout == null ? void 0 : layout.sidebarWidth) ?? 256;
19
+ const assistenteExpanded = (layout == null ? void 0 : layout.assistenteExpanded) ?? false;
20
+ const isMobile = useIsMobile();
21
+ const [isPlaying, setIsPlaying] = useState(false);
22
+ const [volume, setVolume] = useState(0.8);
23
+ const [isMuted, setIsMuted] = useState(false);
24
+ const [currentTime, setCurrentTime] = useState(initialTime);
25
+ const [duration, setDuration] = useState(initialDuration || 0);
26
+ const [playbackSpeed, setPlaybackSpeedState] = useState(1);
27
+ const [isFloating, setIsFloating] = useState(false);
28
+ const [isManualFloating, setIsManualFloating] = useState(false);
29
+ const [enableAutoFloatLocal, setEnableAutoFloatLocal] = useState(enableAutoFloat);
30
+ const [isVisible, setIsVisible] = useState(variant === "card");
31
+ useEffect(() => {
32
+ if (variant === "bar") {
33
+ if (isOpen) {
34
+ setIsVisible(true);
35
+ } else {
36
+ const timer = setTimeout(() => setIsVisible(false), 300);
37
+ return () => clearTimeout(timer);
38
+ }
39
+ } else {
40
+ setIsVisible(true);
41
+ }
42
+ }, [isOpen, variant]);
43
+ useEffect(() => {
44
+ const audio = audioRef.current;
45
+ if (!audio) return;
46
+ audio.volume = volume;
47
+ audio.muted = isMuted;
48
+ audio.playbackRate = playbackSpeed;
49
+ }, [volume, isMuted, playbackSpeed, src]);
50
+ useEffect(() => {
51
+ if (variant !== "card" || !enableAutoFloatLocal) return;
52
+ const container = containerRef.current;
53
+ if (!container) return;
54
+ if (typeof IntersectionObserver === "undefined") return;
55
+ const observer = new IntersectionObserver(
56
+ ([entry]) => {
57
+ if (isPlaying && !entry.isIntersecting && !isFloating) {
58
+ if (audioRef.current) setCurrentTime(audioRef.current.currentTime);
59
+ setIsFloating(true);
60
+ } else if (entry.isIntersecting && isFloating && !isManualFloating) {
61
+ if (audioRef.current) setCurrentTime(audioRef.current.currentTime);
62
+ setIsFloating(false);
63
+ setIsManualFloating(false);
64
+ }
65
+ },
66
+ { threshold: 0.2 }
67
+ );
68
+ observer.observe(container);
69
+ return () => observer.disconnect();
70
+ }, [isPlaying, isFloating, isManualFloating, variant, enableAutoFloatLocal]);
71
+ useEffect(() => {
72
+ const audio = audioRef.current;
73
+ if (audio) {
74
+ if (Math.abs(audio.currentTime - currentTime) > 0.5) {
75
+ audio.currentTime = currentTime;
76
+ }
77
+ if (isPlaying) {
78
+ audio.play().catch((err) => console.log("Playback interrupted:", err));
79
+ }
80
+ }
81
+ }, [isFloating, variant]);
82
+ const handleSetFloating = useCallback((floating) => {
83
+ if (audioRef.current) setCurrentTime(audioRef.current.currentTime);
84
+ setIsFloating(floating);
85
+ if (!floating) {
86
+ setIsManualFloating(false);
87
+ if (onCloseFloating) onCloseFloating();
88
+ }
89
+ }, [onCloseFloating]);
90
+ const togglePlay = useCallback(() => {
91
+ if (audioRef.current) {
92
+ if (isPlaying) {
93
+ audioRef.current.pause();
94
+ } else {
95
+ audioRef.current.play().catch((err) => console.log("Playback error:", err));
96
+ }
97
+ }
98
+ }, [isPlaying]);
99
+ const toggleMute = useCallback(() => {
100
+ setIsMuted((prev) => !prev);
101
+ }, []);
102
+ const handleSeek = useCallback((value) => {
103
+ if (audioRef.current) {
104
+ audioRef.current.currentTime = value[0];
105
+ setCurrentTime(value[0]);
106
+ }
107
+ }, []);
108
+ const handleVolumeChange = useCallback((value) => {
109
+ const newVolume = value[0];
110
+ setVolume(newVolume);
111
+ setIsMuted(newVolume === 0);
112
+ }, []);
113
+ const handleEnableManualFloat = useCallback(() => {
114
+ setEnableAutoFloatLocal(true);
115
+ setIsManualFloating(true);
116
+ if (audioRef.current) setCurrentTime(audioRef.current.currentTime);
117
+ setIsFloating(true);
118
+ }, []);
119
+ const setPlaybackSpeed = useCallback((speed) => {
120
+ setPlaybackSpeedState(speed);
121
+ }, []);
122
+ const resetAudio = useCallback(() => {
123
+ if (audioRef.current) {
124
+ audioRef.current.currentTime = 0;
125
+ }
126
+ }, []);
127
+ const formatTime = useCallback((time) => {
128
+ if (isNaN(time) || time === Infinity || !isFinite(time)) return "0:00";
129
+ const minutes = Math.floor(time / 60);
130
+ const seconds = Math.floor(time % 60);
131
+ return `${minutes}:${seconds < 10 ? "0" : ""}${seconds}`;
132
+ }, []);
133
+ const onPlay = useCallback(() => setIsPlaying(true), []);
134
+ const onPause = useCallback(() => setIsPlaying(false), []);
135
+ const onEnded = useCallback(() => setIsPlaying(false), []);
136
+ const onTimeUpdate = useCallback((e) => {
137
+ setCurrentTime(e.currentTarget.currentTime);
138
+ }, []);
139
+ const onLoadedMetadata = useCallback((e) => {
140
+ setDuration(e.currentTarget.duration);
141
+ }, []);
142
+ return {
143
+ audioRef,
144
+ containerRef,
145
+ isPlaying,
146
+ currentTime,
147
+ duration,
148
+ volume,
149
+ isMuted,
150
+ playbackSpeed,
151
+ isFloating,
152
+ isManualFloating,
153
+ isVisible,
154
+ isMobile,
155
+ enableAutoFloatLocal,
156
+ sidebarExpanded,
157
+ sidebarWidth,
158
+ assistenteExpanded,
159
+ togglePlay,
160
+ toggleMute,
161
+ handleSeek,
162
+ handleVolumeChange,
163
+ handleSetFloating,
164
+ handleEnableManualFloat,
165
+ setPlaybackSpeed,
166
+ resetAudio,
167
+ onPlay,
168
+ onPause,
169
+ onEnded,
170
+ onTimeUpdate,
171
+ onLoadedMetadata,
172
+ formatTime
173
+ };
174
+ }
175
+ export {
176
+ useAudioPlayer as u
177
+ };
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+ const React = require("react");
3
+ const useMobile = require("./use-mobile-Dlf74ufz.cjs");
4
+ const LayoutContext = require("./LayoutContext-BDmcZfMH.cjs");
5
+ function useAudioPlayer({
6
+ src,
7
+ autoPlay = false,
8
+ initialTime = 0,
9
+ initialDuration,
10
+ variant = "card",
11
+ isOpen = true,
12
+ enableAutoFloat = true,
13
+ onCloseFloating
14
+ } = {}) {
15
+ const audioRef = React.useRef(null);
16
+ const containerRef = React.useRef(null);
17
+ const layout = LayoutContext.useOptionalLayout();
18
+ const sidebarExpanded = (layout == null ? void 0 : layout.sidebarExpanded) ?? false;
19
+ const sidebarWidth = (layout == null ? void 0 : layout.sidebarWidth) ?? 256;
20
+ const assistenteExpanded = (layout == null ? void 0 : layout.assistenteExpanded) ?? false;
21
+ const isMobile = useMobile.useIsMobile();
22
+ const [isPlaying, setIsPlaying] = React.useState(false);
23
+ const [volume, setVolume] = React.useState(0.8);
24
+ const [isMuted, setIsMuted] = React.useState(false);
25
+ const [currentTime, setCurrentTime] = React.useState(initialTime);
26
+ const [duration, setDuration] = React.useState(initialDuration || 0);
27
+ const [playbackSpeed, setPlaybackSpeedState] = React.useState(1);
28
+ const [isFloating, setIsFloating] = React.useState(false);
29
+ const [isManualFloating, setIsManualFloating] = React.useState(false);
30
+ const [enableAutoFloatLocal, setEnableAutoFloatLocal] = React.useState(enableAutoFloat);
31
+ const [isVisible, setIsVisible] = React.useState(variant === "card");
32
+ React.useEffect(() => {
33
+ if (variant === "bar") {
34
+ if (isOpen) {
35
+ setIsVisible(true);
36
+ } else {
37
+ const timer = setTimeout(() => setIsVisible(false), 300);
38
+ return () => clearTimeout(timer);
39
+ }
40
+ } else {
41
+ setIsVisible(true);
42
+ }
43
+ }, [isOpen, variant]);
44
+ React.useEffect(() => {
45
+ const audio = audioRef.current;
46
+ if (!audio) return;
47
+ audio.volume = volume;
48
+ audio.muted = isMuted;
49
+ audio.playbackRate = playbackSpeed;
50
+ }, [volume, isMuted, playbackSpeed, src]);
51
+ React.useEffect(() => {
52
+ if (variant !== "card" || !enableAutoFloatLocal) return;
53
+ const container = containerRef.current;
54
+ if (!container) return;
55
+ if (typeof IntersectionObserver === "undefined") return;
56
+ const observer = new IntersectionObserver(
57
+ ([entry]) => {
58
+ if (isPlaying && !entry.isIntersecting && !isFloating) {
59
+ if (audioRef.current) setCurrentTime(audioRef.current.currentTime);
60
+ setIsFloating(true);
61
+ } else if (entry.isIntersecting && isFloating && !isManualFloating) {
62
+ if (audioRef.current) setCurrentTime(audioRef.current.currentTime);
63
+ setIsFloating(false);
64
+ setIsManualFloating(false);
65
+ }
66
+ },
67
+ { threshold: 0.2 }
68
+ );
69
+ observer.observe(container);
70
+ return () => observer.disconnect();
71
+ }, [isPlaying, isFloating, isManualFloating, variant, enableAutoFloatLocal]);
72
+ React.useEffect(() => {
73
+ const audio = audioRef.current;
74
+ if (audio) {
75
+ if (Math.abs(audio.currentTime - currentTime) > 0.5) {
76
+ audio.currentTime = currentTime;
77
+ }
78
+ if (isPlaying) {
79
+ audio.play().catch((err) => console.log("Playback interrupted:", err));
80
+ }
81
+ }
82
+ }, [isFloating, variant]);
83
+ const handleSetFloating = React.useCallback((floating) => {
84
+ if (audioRef.current) setCurrentTime(audioRef.current.currentTime);
85
+ setIsFloating(floating);
86
+ if (!floating) {
87
+ setIsManualFloating(false);
88
+ if (onCloseFloating) onCloseFloating();
89
+ }
90
+ }, [onCloseFloating]);
91
+ const togglePlay = React.useCallback(() => {
92
+ if (audioRef.current) {
93
+ if (isPlaying) {
94
+ audioRef.current.pause();
95
+ } else {
96
+ audioRef.current.play().catch((err) => console.log("Playback error:", err));
97
+ }
98
+ }
99
+ }, [isPlaying]);
100
+ const toggleMute = React.useCallback(() => {
101
+ setIsMuted((prev) => !prev);
102
+ }, []);
103
+ const handleSeek = React.useCallback((value) => {
104
+ if (audioRef.current) {
105
+ audioRef.current.currentTime = value[0];
106
+ setCurrentTime(value[0]);
107
+ }
108
+ }, []);
109
+ const handleVolumeChange = React.useCallback((value) => {
110
+ const newVolume = value[0];
111
+ setVolume(newVolume);
112
+ setIsMuted(newVolume === 0);
113
+ }, []);
114
+ const handleEnableManualFloat = React.useCallback(() => {
115
+ setEnableAutoFloatLocal(true);
116
+ setIsManualFloating(true);
117
+ if (audioRef.current) setCurrentTime(audioRef.current.currentTime);
118
+ setIsFloating(true);
119
+ }, []);
120
+ const setPlaybackSpeed = React.useCallback((speed) => {
121
+ setPlaybackSpeedState(speed);
122
+ }, []);
123
+ const resetAudio = React.useCallback(() => {
124
+ if (audioRef.current) {
125
+ audioRef.current.currentTime = 0;
126
+ }
127
+ }, []);
128
+ const formatTime = React.useCallback((time) => {
129
+ if (isNaN(time) || time === Infinity || !isFinite(time)) return "0:00";
130
+ const minutes = Math.floor(time / 60);
131
+ const seconds = Math.floor(time % 60);
132
+ return `${minutes}:${seconds < 10 ? "0" : ""}${seconds}`;
133
+ }, []);
134
+ const onPlay = React.useCallback(() => setIsPlaying(true), []);
135
+ const onPause = React.useCallback(() => setIsPlaying(false), []);
136
+ const onEnded = React.useCallback(() => setIsPlaying(false), []);
137
+ const onTimeUpdate = React.useCallback((e) => {
138
+ setCurrentTime(e.currentTarget.currentTime);
139
+ }, []);
140
+ const onLoadedMetadata = React.useCallback((e) => {
141
+ setDuration(e.currentTarget.duration);
142
+ }, []);
143
+ return {
144
+ audioRef,
145
+ containerRef,
146
+ isPlaying,
147
+ currentTime,
148
+ duration,
149
+ volume,
150
+ isMuted,
151
+ playbackSpeed,
152
+ isFloating,
153
+ isManualFloating,
154
+ isVisible,
155
+ isMobile,
156
+ enableAutoFloatLocal,
157
+ sidebarExpanded,
158
+ sidebarWidth,
159
+ assistenteExpanded,
160
+ togglePlay,
161
+ toggleMute,
162
+ handleSeek,
163
+ handleVolumeChange,
164
+ handleSetFloating,
165
+ handleEnableManualFloat,
166
+ setPlaybackSpeed,
167
+ resetAudio,
168
+ onPlay,
169
+ onPause,
170
+ onEnded,
171
+ onTimeUpdate,
172
+ onLoadedMetadata,
173
+ formatTime
174
+ };
175
+ }
176
+ exports.useAudioPlayer = useAudioPlayer;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Color utility functions shared across the project.
3
+ * Extracted from BrandColorsContext to allow reuse and isolated testing.
4
+ */
5
+ /**
6
+ * Converts a hex color string to its RGB components.
7
+ * @param hex - Hex color string (with or without leading `#`)
8
+ * @returns Object with `r`, `g`, `b` values (0–255), or `null` if invalid
9
+ *
10
+ * @example
11
+ * hexToRgb('#3b82f6') // { r: 59, g: 130, b: 246 }
12
+ * hexToRgb('3b82f6') // { r: 59, g: 130, b: 246 }
13
+ * hexToRgb('invalid') // null
14
+ */
15
+ export declare function hexToRgb(hex: string): {
16
+ r: number;
17
+ g: number;
18
+ b: number;
19
+ } | null;
20
+ /**
21
+ * Converts RGB components to an `rgba()` CSS string.
22
+ * @param r - Red (0–255)
23
+ * @param g - Green (0–255)
24
+ * @param b - Blue (0–255)
25
+ * @param alpha - Alpha (0–1), defaults to 1
26
+ *
27
+ * @example
28
+ * rgbToRgba(59, 130, 246, 0.5) // 'rgba(59, 130, 246, 0.5)'
29
+ */
30
+ export declare function rgbToRgba(r: number, g: number, b: number, alpha?: number): string;
31
+ /**
32
+ * Converts a hex color to an `rgba()` CSS string.
33
+ * Returns `null` if the hex is invalid.
34
+ *
35
+ * @example
36
+ * hexToRgba('#3b82f6', 0.15) // 'rgba(59, 130, 246, 0.15)'
37
+ */
38
+ export declare function hexToRgba(hex: string, alpha?: number): string | null;
39
+ /**
40
+ * Determines whether a hex color is considered "light" based on its luminance.
41
+ * Uses the W3C relative luminance formula.
42
+ *
43
+ * @param hex - Hex color string
44
+ * @returns `true` if the color is light, `false` if dark
45
+ *
46
+ * @example
47
+ * isLightColor('#ffffff') // true
48
+ * isLightColor('#000000') // false
49
+ * isLightColor('#3b82f6') // false
50
+ */
51
+ export declare function isLightColor(hex: string): boolean;