@wakastellar/ui 4.0.1 → 4.1.1

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 (622) hide show
  1. package/dist/blocks/_shared/identity/InviteUserPanel.cjs.js +1 -1
  2. package/dist/blocks/_shared/identity/RoleSelect.cjs.js +1 -1
  3. package/dist/blocks/_shared/identity/SidePushLayout.cjs.js +1 -1
  4. package/dist/blocks/activity-timeline/index.cjs.js +1 -1
  5. package/dist/blocks/activity-timeline/index.es.js +1 -1
  6. package/dist/blocks/antivirus-dashboard/index.cjs.js +1 -1
  7. package/dist/blocks/antivirus-dashboard/index.es.js +1 -1
  8. package/dist/blocks/api-keys-manager/index.cjs.js +1 -1
  9. package/dist/blocks/apm-overview/index.cjs.js +1 -1
  10. package/dist/blocks/auth-2fa/index.cjs.js +2 -2
  11. package/dist/blocks/auth-2fa/index.es.js +1 -1
  12. package/dist/blocks/avatar-upload/index.cjs.js +1 -1
  13. package/dist/blocks/avatar-upload/index.es.js +13 -13
  14. package/dist/blocks/calendar-view/index.cjs.js +1 -1
  15. package/dist/blocks/calendar-view/index.es.js +1 -1
  16. package/dist/blocks/chat/index.cjs.js +1 -1
  17. package/dist/blocks/chat/index.es.js +162 -162
  18. package/dist/blocks/chat/widget.cjs.js +1 -1
  19. package/dist/blocks/chat/widget.es.js +19 -13
  20. package/dist/blocks/chat-interface/index.cjs.js +1 -1
  21. package/dist/blocks/chat-interface/index.es.js +1 -1
  22. package/dist/blocks/checkout-flow/index.cjs.js +1 -1
  23. package/dist/blocks/checkout-flow/index.es.js +1 -1
  24. package/dist/blocks/cicd-builder/index.cjs.js +1 -1
  25. package/dist/blocks/clamav-service-status/index.cjs.js +1 -1
  26. package/dist/blocks/cloud-cost-dashboard/index.cjs.js +1 -1
  27. package/dist/blocks/container-orchestrator/index.cjs.js +1 -1
  28. package/dist/blocks/container-orchestrator/index.es.js +2 -1
  29. package/dist/blocks/dashboard/index.cjs.js +1 -1
  30. package/dist/blocks/dashboard/index.es.js +2 -2
  31. package/dist/blocks/dashboard-kpi/index.cjs.js +1 -1
  32. package/dist/blocks/dashboard-kpi/index.es.js +1 -1
  33. package/dist/blocks/database-admin/index.cjs.js +1 -1
  34. package/dist/blocks/deployment-dashboard/index.cjs.js +1 -1
  35. package/dist/blocks/deployment-dashboard/index.es.js +1 -1
  36. package/dist/blocks/empty-states/index.cjs.js +1 -1
  37. package/dist/blocks/empty-states/index.es.js +1 -1
  38. package/dist/blocks/error-pages/index.cjs.js +1 -1
  39. package/dist/blocks/error-pages/index.es.js +1 -1
  40. package/dist/blocks/faq/index.cjs.js +1 -1
  41. package/dist/blocks/faq/index.es.js +1 -1
  42. package/dist/blocks/file-manager/index.cjs.js +1 -1
  43. package/dist/blocks/file-manager/index.es.js +1 -1
  44. package/dist/blocks/file-scan-uploader/index.cjs.js +1 -1
  45. package/dist/blocks/file-scan-uploader/index.es.js +2 -2
  46. package/dist/blocks/footer/index.cjs.js +1 -1
  47. package/dist/blocks/gitops-sync-status/index.cjs.js +1 -1
  48. package/dist/blocks/header/index.cjs.js +1 -1
  49. package/dist/blocks/header/index.es.js +1 -1
  50. package/dist/blocks/headtab/index.cjs.js +1 -1
  51. package/dist/blocks/i18n-editor/index.cjs.js +1 -1
  52. package/dist/blocks/i18n-editor/index.es.js +127 -127
  53. package/dist/blocks/incident-manager/index.cjs.js +1 -1
  54. package/dist/blocks/infrastructure-map/index.cjs.js +1 -1
  55. package/dist/blocks/kanban-board/index.cjs.js +1 -1
  56. package/dist/blocks/kanban-board/index.es.js +1 -1
  57. package/dist/blocks/landing/index.cjs.js +1 -1
  58. package/dist/blocks/landing/index.es.js +1 -1
  59. package/dist/blocks/language-selector/index.cjs.js +1 -1
  60. package/dist/blocks/layout/index.cjs.js +1 -1
  61. package/dist/blocks/login/index.cjs.js +1 -1
  62. package/dist/blocks/on-call-schedule/index.cjs.js +1 -1
  63. package/dist/blocks/player-profile/index.cjs.js +1 -1
  64. package/dist/blocks/player-profile/index.es.js +1 -1
  65. package/dist/blocks/pricing/index.cjs.js +1 -1
  66. package/dist/blocks/pricing/index.es.js +1 -1
  67. package/dist/blocks/profile/index.cjs.js +1 -1
  68. package/dist/blocks/profile/index.es.js +1 -1
  69. package/dist/blocks/profile-list/index.cjs.js +1 -1
  70. package/dist/blocks/quarantine-manager/index.cjs.js +1 -1
  71. package/dist/blocks/quarantine-manager/index.es.js +1 -1
  72. package/dist/blocks/release-notes/index.cjs.js +1 -1
  73. package/dist/blocks/scan-history-log/index.cjs.js +1 -1
  74. package/dist/blocks/scan-history-log/index.es.js +1 -1
  75. package/dist/blocks/scan-policy-editor/index.cjs.js +1 -1
  76. package/dist/blocks/scan-report-generator/index.cjs.js +1 -1
  77. package/dist/blocks/settings/index.cjs.js +1 -1
  78. package/dist/blocks/settings/index.es.js +1 -1
  79. package/dist/blocks/sidebar/index.cjs.js +1 -1
  80. package/dist/blocks/sidebar/index.es.js +1 -1
  81. package/dist/blocks/signature-database-manager/index.cjs.js +1 -1
  82. package/dist/blocks/team-form/index.cjs.js +1 -1
  83. package/dist/blocks/threat-alert-banner/index.cjs.js +1 -1
  84. package/dist/blocks/user-management/index.cjs.js +1 -1
  85. package/dist/blocks/waka-doc-shell/index.cjs.js +1 -1
  86. package/dist/blocks/wizard/index.cjs.js +1 -1
  87. package/dist/blocks/wizard/index.es.js +37 -37
  88. package/dist/charts.cjs.js +1 -1
  89. package/dist/charts.es.js +8 -8
  90. package/dist/cli/index.cjs +5 -1
  91. package/dist/components/DataTable/DataTable.cjs.js +1 -1
  92. package/dist/components/DataTable/DataTable.es.js +68 -66
  93. package/dist/components/DataTable/DataTableAdvanced.cjs.js +1 -1
  94. package/dist/components/DataTable/DataTableColumnResizer.cjs.js +1 -1
  95. package/dist/components/DataTable/DataTableContextMenu.cjs.js +1 -1
  96. package/dist/components/DataTable/DataTableEditCell.cjs.js +1 -1
  97. package/dist/components/DataTable/DataTableFilters.cjs.js +1 -1
  98. package/dist/components/DataTable/DataTableGrouping.cjs.js +1 -1
  99. package/dist/components/DataTable/DataTablePagination.cjs.js +1 -1
  100. package/dist/components/DataTable/DataTablePagination.d.ts +3 -1
  101. package/dist/components/DataTable/DataTablePagination.es.js +38 -27
  102. package/dist/components/DataTable/DataTableSelection.cjs.js +1 -1
  103. package/dist/components/DataTable/DataTableToolbar.cjs.js +1 -1
  104. package/dist/components/DataTable/hooks/useDataTable.cjs.js +1 -1
  105. package/dist/components/DataTable/hooks/useDataTable.es.js +5 -1
  106. package/dist/components/DataTable/hooks/useDataTableAdvanced.cjs.js +1 -1
  107. package/dist/components/DataTable/hooks/useDataTableEdit.cjs.js +1 -1
  108. package/dist/components/DataTable/hooks/useDataTableExport.cjs.js +2 -2
  109. package/dist/components/DataTable/hooks/useDataTableImport.cjs.js +2 -2
  110. package/dist/components/DataTable/hooks/useDataTableImport.es.js +2 -1
  111. package/dist/components/DataTable/hooks/useDataTableTheme.cjs.js +1 -1
  112. package/dist/components/DataTable/hooks/useDataTableVirtualization.cjs.js +1 -1
  113. package/dist/components/DataTable/hooks/useTableLayout.cjs.js +1 -1
  114. package/dist/components/DataTable/utils.cjs.js +1 -1
  115. package/dist/components/accordion/index.cjs.js +1 -1
  116. package/dist/components/alert/index.cjs.js +1 -1
  117. package/dist/components/alert-dialog/index.cjs.js +1 -1
  118. package/dist/components/aspect-ratio/index.cjs.js +1 -1
  119. package/dist/components/avatar/index.cjs.js +1 -1
  120. package/dist/components/badge/index.cjs.js +1 -1
  121. package/dist/components/button/index.cjs.js +1 -1
  122. package/dist/components/calendar/index.cjs.js +1 -1
  123. package/dist/components/card/index.cjs.js +1 -1
  124. package/dist/components/checkbox/index.cjs.js +1 -1
  125. package/dist/components/code/index.cjs.js +2 -2
  126. package/dist/components/code/index.es.js +3 -2
  127. package/dist/components/collapsible/index.cjs.js +1 -1
  128. package/dist/components/command/index.cjs.js +1 -1
  129. package/dist/components/context-menu/index.cjs.js +1 -1
  130. package/dist/components/dialog/index.cjs.js +1 -1
  131. package/dist/components/dropdown-menu/index.cjs.js +1 -1
  132. package/dist/components/editor/blocks/index.cjs.js +1 -1
  133. package/dist/components/editor/blocks/index.es.js +12 -12
  134. package/dist/components/editor/blocks/waka-acceptance-criteria-block.cjs.js +1 -1
  135. package/dist/components/editor/blocks/waka-ai-assist-block.cjs.js +1 -1
  136. package/dist/components/editor/blocks/waka-api-endpoint-block.cjs.js +1 -1
  137. package/dist/components/editor/blocks/waka-code-playground-block.cjs.js +1 -1
  138. package/dist/components/editor/blocks/waka-comment-thread-block.cjs.js +1 -1
  139. package/dist/components/editor/blocks/waka-diagram-block.cjs.js +3 -3
  140. package/dist/components/editor/blocks/waka-diagram-block.es.js +21 -40
  141. package/dist/components/editor/blocks/waka-embed-block.cjs.js +1 -1
  142. package/dist/components/editor/blocks/waka-slash-menu-block.cjs.js +1 -1
  143. package/dist/components/editor/blocks/waka-user-story-block.cjs.js +1 -1
  144. package/dist/components/editor/blocks/waka-version-diff-block.cjs.js +1 -1
  145. package/dist/components/editor/waka-ai-writer.cjs.js +1 -1
  146. package/dist/components/editor/waka-collaborative-editor.cjs.js +1 -1
  147. package/dist/components/editor/waka-diff-viewer.cjs.js +1 -1
  148. package/dist/components/editor/waka-dnd-editor.cjs.js +1 -1
  149. package/dist/components/editor/waka-document-editor.cjs.js +1 -1
  150. package/dist/components/editor/waka-document-editor.es.js +1 -1
  151. package/dist/components/editor/waka-editor-elements.cjs.js +1 -1
  152. package/dist/components/editor/waka-editor-leaves.cjs.js +1 -1
  153. package/dist/components/editor/waka-editor-toolbar.cjs.js +1 -1
  154. package/dist/components/editor/waka-editor.cjs.js +1 -1
  155. package/dist/components/editor/waka-floating-toolbar.cjs.js +1 -1
  156. package/dist/components/editor/waka-markdown-editor.cjs.js +1 -1
  157. package/dist/components/editor/waka-mention-editor.cjs.js +1 -1
  158. package/dist/components/editor/waka-mention-editor.es.js +2 -2
  159. package/dist/components/editor/waka-slash-menu.cjs.js +1 -1
  160. package/dist/components/editor/waka-spec-editor.cjs.js +1 -1
  161. package/dist/components/form/index.cjs.js +1 -1
  162. package/dist/components/hover-card/index.cjs.js +1 -1
  163. package/dist/components/input/index.cjs.js +1 -1
  164. package/dist/components/input-otp/index.cjs.js +1 -1
  165. package/dist/components/input-otp/index.es.js +2 -1
  166. package/dist/components/label/index.cjs.js +1 -1
  167. package/dist/components/language-selector/index.cjs.js +1 -1
  168. package/dist/components/menubar/index.cjs.js +1 -1
  169. package/dist/components/navigation-menu/index.cjs.js +1 -1
  170. package/dist/components/popover/index.cjs.js +1 -1
  171. package/dist/components/progress/index.cjs.js +1 -1
  172. package/dist/components/radio-group/index.cjs.js +1 -1
  173. package/dist/components/resizable/index.cjs.js +1 -1
  174. package/dist/components/resizable/index.es.js +9 -9
  175. package/dist/components/scroll-area/index.cjs.js +1 -1
  176. package/dist/components/select/index.cjs.js +1 -1
  177. package/dist/components/separator/index.cjs.js +1 -1
  178. package/dist/components/sheet/index.cjs.js +1 -1
  179. package/dist/components/skeleton/index.cjs.js +1 -1
  180. package/dist/components/slider/index.cjs.js +1 -1
  181. package/dist/components/switch/index.cjs.js +1 -1
  182. package/dist/components/table/index.cjs.js +1 -1
  183. package/dist/components/tabs/index.cjs.js +1 -1
  184. package/dist/components/textarea/index.cjs.js +1 -1
  185. package/dist/components/theme-selector/index.cjs.js +1 -1
  186. package/dist/components/toast/index.cjs.js +1 -1
  187. package/dist/components/toaster/index.cjs.js +1 -1
  188. package/dist/components/toggle/index.cjs.js +1 -1
  189. package/dist/components/toggle-group/index.cjs.js +1 -1
  190. package/dist/components/tooltip/index.cjs.js +1 -1
  191. package/dist/components/typography/index.cjs.js +1 -1
  192. package/dist/components/waka-3d-pie-chart/index.cjs.js +1 -1
  193. package/dist/components/waka-3d-pie-chart/index.es.js +1 -1
  194. package/dist/components/waka-achievement-unlock/index.cjs.js +1 -1
  195. package/dist/components/waka-achievement-unlock/index.es.js +1 -1
  196. package/dist/components/waka-activity-feed/index.cjs.js +2 -2
  197. package/dist/components/waka-activity-feed/index.es.js +1 -1
  198. package/dist/components/waka-ad-banner/index.cjs.js +1 -1
  199. package/dist/components/waka-ad-banner/index.es.js +18 -15
  200. package/dist/components/waka-ad-fallback/index.cjs.js +1 -1
  201. package/dist/components/waka-ad-fallback/index.es.js +1 -1
  202. package/dist/components/waka-ad-inline/index.cjs.js +1 -1
  203. package/dist/components/waka-ad-inline/index.es.js +2 -2
  204. package/dist/components/waka-ad-interstitial/index.cjs.js +1 -1
  205. package/dist/components/waka-ad-interstitial/index.es.js +3 -3
  206. package/dist/components/waka-ad-placeholder/index.cjs.js +2 -2
  207. package/dist/components/waka-ad-placeholder/index.es.js +1 -1
  208. package/dist/components/waka-ad-provider/index.cjs.js +1 -1
  209. package/dist/components/waka-ad-provider/index.es.js +1 -1
  210. package/dist/components/waka-ad-sidebar/index.cjs.js +1 -1
  211. package/dist/components/waka-ad-sidebar/index.es.js +2 -2
  212. package/dist/components/waka-ad-sticky-footer/index.cjs.js +1 -1
  213. package/dist/components/waka-ad-sticky-footer/index.es.js +2 -2
  214. package/dist/components/waka-address-autocomplete/index.cjs.js +2 -2
  215. package/dist/components/waka-address-autocomplete/index.es.js +10 -6
  216. package/dist/components/waka-admincrumb/index.cjs.js +1 -1
  217. package/dist/components/waka-alert-panel/index.cjs.js +1 -1
  218. package/dist/components/waka-alert-stack/index.cjs.js +1 -1
  219. package/dist/components/waka-alert-stack/index.es.js +1 -1
  220. package/dist/components/waka-allocation-matrix/index.cjs.js +2 -2
  221. package/dist/components/waka-allocation-matrix/index.es.js +1 -1
  222. package/dist/components/waka-approval-chain/index.cjs.js +1 -1
  223. package/dist/components/waka-approval-chain/index.es.js +1 -1
  224. package/dist/components/waka-artifact-list/index.cjs.js +1 -1
  225. package/dist/components/waka-artifact-list/index.es.js +1 -1
  226. package/dist/components/waka-audit-log/index.cjs.js +2 -2
  227. package/dist/components/waka-audit-log/index.es.js +1 -1
  228. package/dist/components/waka-autocomplete/index.cjs.js +1 -1
  229. package/dist/components/waka-autocomplete/index.es.js +3 -2
  230. package/dist/components/waka-badge-showcase/index.cjs.js +1 -1
  231. package/dist/components/waka-barcode/index.cjs.js +1 -1
  232. package/dist/components/waka-barcode/index.es.js +1 -1
  233. package/dist/components/waka-biometric-prompt/index.cjs.js +2 -2
  234. package/dist/components/waka-biometric-prompt/index.es.js +1 -1
  235. package/dist/components/waka-bottom-sheet/index.cjs.js +1 -1
  236. package/dist/components/waka-bottom-sheet/index.es.js +12 -7
  237. package/dist/components/waka-breadcrumb/index.cjs.js +1 -1
  238. package/dist/components/waka-breadcrumb/index.es.js +1 -1
  239. package/dist/components/waka-breadcrumb-path/index.cjs.js +1 -1
  240. package/dist/components/waka-breadcrumb-path/index.es.js +1 -1
  241. package/dist/components/waka-budget-burn/index.cjs.js +2 -2
  242. package/dist/components/waka-budget-burn/index.es.js +3 -3
  243. package/dist/components/waka-build-matrix/index.cjs.js +1 -1
  244. package/dist/components/waka-capacity-planner/index.cjs.js +2 -2
  245. package/dist/components/waka-capacity-planner/index.es.js +1 -1
  246. package/dist/components/waka-carousel/index.cjs.js +1 -1
  247. package/dist/components/waka-carousel/index.es.js +2 -2
  248. package/dist/components/waka-cart-summary/index.cjs.js +1 -1
  249. package/dist/components/waka-cart-summary/index.es.js +2 -2
  250. package/dist/components/waka-challenge-timer/index.cjs.js +1 -1
  251. package/dist/components/waka-charts/WakaAreaChart.cjs.js +1 -1
  252. package/dist/components/waka-charts/WakaAreaChart.es.js +2 -2
  253. package/dist/components/waka-charts/WakaBarChart.cjs.js +1 -1
  254. package/dist/components/waka-charts/WakaBarChart.es.js +2 -2
  255. package/dist/components/waka-charts/WakaChart.cjs.js +1 -1
  256. package/dist/components/waka-charts/WakaChart.es.js +1 -1
  257. package/dist/components/waka-charts/WakaLineChart.cjs.js +1 -1
  258. package/dist/components/waka-charts/WakaLineChart.es.js +2 -2
  259. package/dist/components/waka-charts/WakaMiniChart.cjs.js +1 -1
  260. package/dist/components/waka-charts/WakaMiniChart.es.js +2 -2
  261. package/dist/components/waka-charts/WakaPieChart.cjs.js +1 -1
  262. package/dist/components/waka-charts/WakaPieChart.es.js +2 -2
  263. package/dist/components/waka-charts/WakaSparkline.cjs.js +1 -1
  264. package/dist/components/waka-charts/WakaSparkline.es.js +1 -1
  265. package/dist/components/waka-charts/dataTableHelpers.cjs.js +1 -1
  266. package/dist/components/waka-charts/dataTableHelpers.es.js +1 -1
  267. package/dist/components/waka-charts/hooks/useChartTheme.cjs.js +1 -1
  268. package/dist/components/waka-charts/hooks/useChartTheme.es.js +1 -1
  269. package/dist/components/waka-charts/hooks/useRechartsLoader.cjs.js +1 -1
  270. package/dist/components/waka-charts/hooks/useRechartsLoader.es.js +1 -1
  271. package/dist/components/waka-chat-bubble/index.cjs.js +1 -1
  272. package/dist/components/waka-checklist/index.cjs.js +2 -2
  273. package/dist/components/waka-checklist/index.es.js +1 -1
  274. package/dist/components/waka-checkout-stepper/index.cjs.js +1 -1
  275. package/dist/components/waka-checkout-stepper/index.es.js +1 -1
  276. package/dist/components/waka-cohort-table/index.cjs.js +2 -2
  277. package/dist/components/waka-cohort-table/index.es.js +1 -1
  278. package/dist/components/waka-color-picker/index.cjs.js +2 -2
  279. package/dist/components/waka-color-picker/index.es.js +1 -1
  280. package/dist/components/waka-combo-counter/index.cjs.js +1 -1
  281. package/dist/components/waka-combobox/index.cjs.js +1 -1
  282. package/dist/components/waka-combobox/index.es.js +3 -2
  283. package/dist/components/waka-command-bar/index.cjs.js +1 -1
  284. package/dist/components/waka-compare-period/index.cjs.js +2 -2
  285. package/dist/components/waka-compare-period/index.es.js +7 -5
  286. package/dist/components/waka-config-comparator/index.cjs.js +1 -1
  287. package/dist/components/waka-config-comparator/index.es.js +1 -1
  288. package/dist/components/waka-connection-matrix/index.cjs.js +1 -1
  289. package/dist/components/waka-connection-matrix/index.es.js +1 -1
  290. package/dist/components/waka-container-list/index.cjs.js +1 -1
  291. package/dist/components/waka-container-list/index.es.js +1 -1
  292. package/dist/components/waka-content-recommendation/index.cjs.js +1 -1
  293. package/dist/components/waka-content-recommendation/index.es.js +2 -2
  294. package/dist/components/waka-contribution-graph/index.cjs.js +1 -1
  295. package/dist/components/waka-contribution-graph/index.es.js +4 -4
  296. package/dist/components/waka-cost-breakdown/index.cjs.js +1 -1
  297. package/dist/components/waka-cost-breakdown/index.es.js +7 -7
  298. package/dist/components/waka-coupon-input/index.cjs.js +2 -2
  299. package/dist/components/waka-coupon-input/index.es.js +1 -1
  300. package/dist/components/waka-credit-activity-feed/index.cjs.js +2 -2
  301. package/dist/components/waka-credit-activity-feed/index.es.js +1 -1
  302. package/dist/components/waka-credit-alert/index.cjs.js +1 -1
  303. package/dist/components/waka-credit-alert/index.es.js +1 -1
  304. package/dist/components/waka-credit-balance/index.cjs.js +1 -1
  305. package/dist/components/waka-credit-balance/index.es.js +3 -3
  306. package/dist/components/waka-credit-breakdown/index.cjs.js +1 -1
  307. package/dist/components/waka-credit-breakdown/index.es.js +1 -1
  308. package/dist/components/waka-credit-burn-rate/index.cjs.js +1 -1
  309. package/dist/components/waka-credit-burn-rate/index.es.js +1 -1
  310. package/dist/components/waka-credit-card-input/index.cjs.js +1 -1
  311. package/dist/components/waka-credit-card-input/index.es.js +1 -1
  312. package/dist/components/waka-credit-history/index.cjs.js +1 -1
  313. package/dist/components/waka-credit-history/index.es.js +1 -1
  314. package/dist/components/waka-credit-meter/index.cjs.js +2 -2
  315. package/dist/components/waka-credit-meter/index.es.js +3 -3
  316. package/dist/components/waka-credit-pricing-pack/index.cjs.js +1 -1
  317. package/dist/components/waka-credit-pricing-pack/index.es.js +1 -1
  318. package/dist/components/waka-credit-projection/index.cjs.js +1 -1
  319. package/dist/components/waka-credit-projection/index.es.js +1 -1
  320. package/dist/components/waka-credit-quota/index.cjs.js +1 -1
  321. package/dist/components/waka-credit-quota/index.es.js +3 -3
  322. package/dist/components/waka-credit-receipt/index.cjs.js +1 -1
  323. package/dist/components/waka-credit-receipt/index.es.js +1 -1
  324. package/dist/components/waka-credit-top-up/index.cjs.js +1 -1
  325. package/dist/components/waka-credit-top-up/index.es.js +1 -1
  326. package/dist/components/waka-credit-transaction/index.cjs.js +1 -1
  327. package/dist/components/waka-credit-transaction/index.es.js +1 -1
  328. package/dist/components/waka-credit-transfer-form/index.cjs.js +1 -1
  329. package/dist/components/waka-credit-transfer-form/index.es.js +1 -1
  330. package/dist/components/waka-credit-usage-chart/index.cjs.js +1 -1
  331. package/dist/components/waka-credit-usage-chart/index.es.js +1 -1
  332. package/dist/components/waka-daily-reward/index.cjs.js +1 -1
  333. package/dist/components/waka-database-card/index.cjs.js +1 -1
  334. package/dist/components/waka-database-card/index.es.js +1 -1
  335. package/dist/components/waka-date-range-picker/index.cjs.js +1 -1
  336. package/dist/components/waka-date-range-picker/index.es.js +3 -2
  337. package/dist/components/waka-datetime-picker/index.cjs.js +1 -1
  338. package/dist/components/waka-datetime-picker/index.es.js +4 -1
  339. package/dist/components/waka-datetime-picker.form-integration/index.cjs.js +1 -1
  340. package/dist/components/waka-dependency-tree/index.cjs.js +1 -1
  341. package/dist/components/waka-dependency-tree/index.es.js +1 -1
  342. package/dist/components/waka-deployment-lane/index.cjs.js +1 -1
  343. package/dist/components/waka-deployment-lane/index.es.js +1 -1
  344. package/dist/components/waka-device-trust/index.cjs.js +2 -2
  345. package/dist/components/waka-device-trust/index.es.js +1 -1
  346. package/dist/components/waka-doc-breadcrumb/index.cjs.js +1 -1
  347. package/dist/components/waka-doc-callout/index.cjs.js +1 -1
  348. package/dist/components/waka-doc-code-block/index.cjs.js +1 -1
  349. package/dist/components/waka-doc-nav/index.cjs.js +1 -1
  350. package/dist/components/waka-doc-renderer/index.cjs.js +1 -1
  351. package/dist/components/waka-doc-search/index.cjs.js +1 -1
  352. package/dist/components/waka-doc-table/index.cjs.js +1 -1
  353. package/dist/components/waka-doc-toc/index.cjs.js +1 -1
  354. package/dist/components/waka-doc-toolbar/index.cjs.js +1 -1
  355. package/dist/components/waka-doc-version/index.cjs.js +1 -1
  356. package/dist/components/waka-dock/index.cjs.js +1 -1
  357. package/dist/components/waka-dock/index.es.js +2 -2
  358. package/dist/components/waka-drawer/index.cjs.js +1 -1
  359. package/dist/components/waka-drawer/index.es.js +1 -1
  360. package/dist/components/waka-empty-state/index.cjs.js +1 -1
  361. package/dist/components/waka-env-var-editor/index.cjs.js +1 -1
  362. package/dist/components/waka-error-shake/index.cjs.js +1 -1
  363. package/dist/components/waka-feature-announcement/index.cjs.js +2 -2
  364. package/dist/components/waka-feature-announcement/index.es.js +1 -1
  365. package/dist/components/waka-feature-flag-row/index.cjs.js +1 -1
  366. package/dist/components/waka-file-upload/index.cjs.js +1 -1
  367. package/dist/components/waka-file-upload/index.es.js +2 -2
  368. package/dist/components/waka-floating-nav/index.cjs.js +1 -1
  369. package/dist/components/waka-floating-nav/index.es.js +1 -1
  370. package/dist/components/waka-flow-diagram/index.cjs.js +1 -1
  371. package/dist/components/waka-funnel-chart/index.cjs.js +2 -2
  372. package/dist/components/waka-funnel-chart/index.es.js +1 -1
  373. package/dist/components/waka-glow-card/index.cjs.js +1 -1
  374. package/dist/components/waka-glow-card/index.es.js +3 -3
  375. package/dist/components/waka-goal-progress/index.cjs.js +3 -3
  376. package/dist/components/waka-goal-progress/index.es.js +3 -3
  377. package/dist/components/waka-haptic-button/index.cjs.js +1 -1
  378. package/dist/components/waka-health-pulse/index.cjs.js +2 -2
  379. package/dist/components/waka-health-pulse/index.es.js +1 -1
  380. package/dist/components/waka-heatmap/index.cjs.js +1 -1
  381. package/dist/components/waka-heatmap/index.es.js +3 -3
  382. package/dist/components/waka-hotspot/index.cjs.js +1 -1
  383. package/dist/components/waka-image/index.cjs.js +1 -1
  384. package/dist/components/waka-image/index.es.js +1 -1
  385. package/dist/components/waka-incident-timeline/index.cjs.js +1 -1
  386. package/dist/components/waka-incident-timeline/index.es.js +3 -2
  387. package/dist/components/waka-invoice-preview/index.cjs.js +1 -1
  388. package/dist/components/waka-invoice-preview/index.es.js +1 -1
  389. package/dist/components/waka-kanban/index.cjs.js +1 -1
  390. package/dist/components/waka-kanban/index.es.js +1 -1
  391. package/dist/components/waka-kpi-dashboard/index.cjs.js +1 -1
  392. package/dist/components/waka-kpi-dashboard/index.es.js +6 -4
  393. package/dist/components/waka-kubernetes-overview/index.cjs.js +1 -1
  394. package/dist/components/waka-kubernetes-overview/index.es.js +1 -1
  395. package/dist/components/waka-leaderboard/index.cjs.js +1 -1
  396. package/dist/components/waka-level-progress/index.cjs.js +2 -2
  397. package/dist/components/waka-level-progress/index.es.js +2 -2
  398. package/dist/components/waka-liquid-button/index.cjs.js +1 -1
  399. package/dist/components/waka-loading-orbit/index.cjs.js +1 -1
  400. package/dist/components/waka-log-viewer/index.cjs.js +1 -1
  401. package/dist/components/waka-loot-box/index.cjs.js +2 -2
  402. package/dist/components/waka-loot-box/index.es.js +1 -1
  403. package/dist/components/waka-magic-link/index.cjs.js +2 -2
  404. package/dist/components/waka-magnetic-button/index.cjs.js +1 -1
  405. package/dist/components/waka-mention-input/index.cjs.js +1 -1
  406. package/dist/components/waka-mention-input/index.es.js +52 -40
  407. package/dist/components/waka-metric-sparkline/index.cjs.js +1 -1
  408. package/dist/components/waka-metric-sparkline/index.es.js +1 -1
  409. package/dist/components/waka-migration-list/index.cjs.js +1 -1
  410. package/dist/components/waka-milestone-road/index.cjs.js +2 -2
  411. package/dist/components/waka-milestone-road/index.es.js +5 -5
  412. package/dist/components/waka-modal/index.cjs.js +1 -1
  413. package/dist/components/waka-modal/index.es.js +1 -1
  414. package/dist/components/waka-morph-button/index.cjs.js +2 -2
  415. package/dist/components/waka-morph-button/index.es.js +6 -2
  416. package/dist/components/waka-network-topology/index.cjs.js +1 -1
  417. package/dist/components/waka-network-topology/index.es.js +4 -2
  418. package/dist/components/waka-notifications/index.cjs.js +1 -1
  419. package/dist/components/waka-number-input/index.cjs.js +1 -1
  420. package/dist/components/waka-number-input/index.es.js +1 -1
  421. package/dist/components/waka-orbital-menu/index.cjs.js +1 -1
  422. package/dist/components/waka-orbital-menu/index.es.js +1 -1
  423. package/dist/components/waka-order-tracker/index.cjs.js +1 -1
  424. package/dist/components/waka-order-tracker/index.es.js +3 -2
  425. package/dist/components/waka-outstream-video/index.cjs.js +1 -1
  426. package/dist/components/waka-outstream-video/index.es.js +2 -2
  427. package/dist/components/waka-pagination/index.cjs.js +1 -1
  428. package/dist/components/waka-pagination/index.es.js +1 -1
  429. package/dist/components/waka-password-strength/index.cjs.js +2 -2
  430. package/dist/components/waka-password-strength/index.es.js +3 -3
  431. package/dist/components/waka-payment-method-picker/index.cjs.js +1 -1
  432. package/dist/components/waka-payment-method-picker/index.es.js +1 -1
  433. package/dist/components/waka-permission-matrix/index.cjs.js +2 -2
  434. package/dist/components/waka-permission-matrix/index.es.js +3 -2
  435. package/dist/components/waka-phone-input/index.cjs.js +1 -1
  436. package/dist/components/waka-phone-input/index.es.js +5 -3
  437. package/dist/components/waka-pipeline-view/index.cjs.js +2 -2
  438. package/dist/components/waka-pipeline-view/index.es.js +1 -1
  439. package/dist/components/waka-player-card/index.cjs.js +2 -2
  440. package/dist/components/waka-player-card/index.es.js +4 -4
  441. package/dist/components/waka-pod-card/index.cjs.js +1 -1
  442. package/dist/components/waka-pod-card/index.es.js +1 -1
  443. package/dist/components/waka-points-popup/index.cjs.js +1 -1
  444. package/dist/components/waka-points-popup/index.es.js +5 -1
  445. package/dist/components/waka-power-up/index.cjs.js +1 -1
  446. package/dist/components/waka-presence-indicator/index.cjs.js +2 -2
  447. package/dist/components/waka-presence-indicator/index.es.js +1 -1
  448. package/dist/components/waka-pricing-table/index.cjs.js +2 -2
  449. package/dist/components/waka-pricing-table/index.es.js +1 -1
  450. package/dist/components/waka-product-card/index.cjs.js +1 -1
  451. package/dist/components/waka-progress-onboarding/index.cjs.js +3 -3
  452. package/dist/components/waka-progress-onboarding/index.es.js +1 -1
  453. package/dist/components/waka-pull-to-refresh/index.cjs.js +1 -1
  454. package/dist/components/waka-qrcode/index.cjs.js +1 -1
  455. package/dist/components/waka-qrcode/index.es.js +1 -1
  456. package/dist/components/waka-query-explain/index.cjs.js +1 -1
  457. package/dist/components/waka-quest-card/index.cjs.js +2 -2
  458. package/dist/components/waka-quest-card/index.es.js +4 -1
  459. package/dist/components/waka-quota-bar/index.cjs.js +2 -2
  460. package/dist/components/waka-quota-bar/index.es.js +11 -4
  461. package/dist/components/waka-radar-score/index.cjs.js +1 -1
  462. package/dist/components/waka-radar-score/index.es.js +6 -6
  463. package/dist/components/waka-rank-badge/index.cjs.js +2 -2
  464. package/dist/components/waka-rank-badge/index.es.js +1 -1
  465. package/dist/components/waka-rating-input/index.cjs.js +2 -2
  466. package/dist/components/waka-rating-input/index.es.js +1 -1
  467. package/dist/components/waka-reaction-picker/index.cjs.js +1 -1
  468. package/dist/components/waka-reaction-picker/index.es.js +7 -4
  469. package/dist/components/waka-region-map/index.cjs.js +1 -1
  470. package/dist/components/waka-region-map/index.es.js +1 -1
  471. package/dist/components/waka-resource-gauge/index.cjs.js +2 -2
  472. package/dist/components/waka-resource-gauge/index.es.js +3 -3
  473. package/dist/components/waka-resource-pool/index.cjs.js +2 -2
  474. package/dist/components/waka-resource-pool/index.es.js +1 -1
  475. package/dist/components/waka-rich-text-editor/index.cjs.js +1 -1
  476. package/dist/components/waka-rich-text-editor/index.es.js +1 -1
  477. package/dist/components/waka-rollback-slider/index.cjs.js +2 -2
  478. package/dist/components/waka-rollback-slider/index.es.js +5 -3
  479. package/dist/components/waka-sankey-diagram/index.cjs.js +2 -2
  480. package/dist/components/waka-sankey-diagram/index.es.js +5 -5
  481. package/dist/components/waka-schedule-picker/index.cjs.js +1 -1
  482. package/dist/components/waka-schedule-picker/index.es.js +3 -2
  483. package/dist/components/waka-scratch-card/index.cjs.js +2 -2
  484. package/dist/components/waka-scratch-card/index.es.js +1 -1
  485. package/dist/components/waka-season-pass/index.cjs.js +1 -1
  486. package/dist/components/waka-secret-card/index.cjs.js +1 -1
  487. package/dist/components/waka-security-scan-result/index.cjs.js +1 -1
  488. package/dist/components/waka-security-score/index.cjs.js +2 -2
  489. package/dist/components/waka-security-score/index.es.js +5 -5
  490. package/dist/components/waka-segmented-control/index.cjs.js +1 -1
  491. package/dist/components/waka-segmented-control/index.es.js +1 -1
  492. package/dist/components/waka-server-rack/index.cjs.js +1 -1
  493. package/dist/components/waka-service-graph/index.cjs.js +1 -1
  494. package/dist/components/waka-session-manager/index.cjs.js +1 -1
  495. package/dist/components/waka-session-manager/index.es.js +3 -2
  496. package/dist/components/waka-signature-pad/index.cjs.js +1 -1
  497. package/dist/components/waka-signature-pad/index.es.js +1 -1
  498. package/dist/components/waka-skeleton-wave/index.cjs.js +1 -1
  499. package/dist/components/waka-skill-tree/index.cjs.js +2 -2
  500. package/dist/components/waka-skill-tree/index.es.js +32 -32
  501. package/dist/components/waka-sla-tracker/index.cjs.js +1 -1
  502. package/dist/components/waka-sla-tracker/index.es.js +1 -1
  503. package/dist/components/waka-slider-range/index.cjs.js +1 -1
  504. package/dist/components/waka-slider-range/index.es.js +3 -3
  505. package/dist/components/waka-spin-wheel/index.cjs.js +2 -2
  506. package/dist/components/waka-spin-wheel/index.es.js +6 -6
  507. package/dist/components/waka-spinner/index.cjs.js +1 -1
  508. package/dist/components/waka-sponsored-badge/index.cjs.js +1 -1
  509. package/dist/components/waka-sponsored-badge/index.es.js +1 -1
  510. package/dist/components/waka-sponsored-card/index.cjs.js +1 -1
  511. package/dist/components/waka-sponsored-card/index.es.js +2 -2
  512. package/dist/components/waka-sponsored-feed/index.cjs.js +1 -1
  513. package/dist/components/waka-sponsored-feed/index.es.js +2 -2
  514. package/dist/components/waka-spotlight/index.cjs.js +1 -1
  515. package/dist/components/waka-spotlight/index.es.js +2 -1
  516. package/dist/components/waka-stat/index.cjs.js +1 -1
  517. package/dist/components/waka-stat/index.es.js +1 -1
  518. package/dist/components/waka-stats-hexagon/index.cjs.js +1 -1
  519. package/dist/components/waka-stats-hexagon/index.es.js +9 -9
  520. package/dist/components/waka-status-matrix/index.cjs.js +1 -1
  521. package/dist/components/waka-status-matrix/index.es.js +1 -1
  522. package/dist/components/waka-stepper/index.cjs.js +1 -1
  523. package/dist/components/waka-stepper/index.es.js +1 -1
  524. package/dist/components/waka-streak-counter/index.cjs.js +1 -1
  525. package/dist/components/waka-success-explosion/index.cjs.js +1 -1
  526. package/dist/components/waka-swipe-card/index.cjs.js +1 -1
  527. package/dist/components/waka-swipe-card/index.es.js +2 -2
  528. package/dist/components/waka-tabs-morph/index.cjs.js +1 -1
  529. package/dist/components/waka-tabs-morph/index.es.js +1 -1
  530. package/dist/components/waka-tag-input/index.cjs.js +1 -1
  531. package/dist/components/waka-tag-input/index.es.js +3 -2
  532. package/dist/components/waka-team-banner/index.cjs.js +2 -2
  533. package/dist/components/waka-team-banner/index.es.js +1 -1
  534. package/dist/components/waka-terminal-output/index.cjs.js +2 -2
  535. package/dist/components/waka-terminal-output/index.es.js +5 -3
  536. package/dist/components/waka-test-report/index.cjs.js +1 -1
  537. package/dist/components/waka-theme-creator/index.cjs.js +1 -1
  538. package/dist/components/waka-theme-manager/index.cjs.js +1 -1
  539. package/dist/components/waka-theme-manager/index.es.js +5 -2
  540. package/dist/components/waka-thread-view/index.cjs.js +2 -2
  541. package/dist/components/waka-thread-view/index.es.js +1 -1
  542. package/dist/components/waka-tilt-card/index.cjs.js +1 -1
  543. package/dist/components/waka-tilt-card/index.es.js +8 -6
  544. package/dist/components/waka-time-picker/index.cjs.js +1 -1
  545. package/dist/components/waka-time-picker/index.es.js +10 -6
  546. package/dist/components/waka-timeline/index.cjs.js +1 -1
  547. package/dist/components/waka-timeline/index.es.js +1 -1
  548. package/dist/components/waka-tooltip-tour/index.cjs.js +3 -3
  549. package/dist/components/waka-tooltip-tour/index.es.js +53 -51
  550. package/dist/components/waka-tour-guide/index.cjs.js +2 -2
  551. package/dist/components/waka-tour-guide/index.es.js +1 -1
  552. package/dist/components/waka-tournament-bracket/index.cjs.js +2 -2
  553. package/dist/components/waka-tournament-bracket/index.es.js +1 -1
  554. package/dist/components/waka-trace-viewer/index.cjs.js +1 -1
  555. package/dist/components/waka-tree/index.cjs.js +1 -1
  556. package/dist/components/waka-tree/index.es.js +1 -1
  557. package/dist/components/waka-treemap-chart/index.cjs.js +1 -1
  558. package/dist/components/waka-treemap-chart/index.es.js +1 -1
  559. package/dist/components/waka-two-factor-setup/index.cjs.js +2 -2
  560. package/dist/components/waka-two-factor-setup/index.es.js +5 -4
  561. package/dist/components/waka-typewriter/index.cjs.js +1 -1
  562. package/dist/components/waka-typewriter/index.es.js +7 -2
  563. package/dist/components/waka-typing-indicator/index.cjs.js +2 -2
  564. package/dist/components/waka-typing-indicator/index.es.js +1 -1
  565. package/dist/components/waka-versus-card/index.cjs.js +3 -3
  566. package/dist/components/waka-versus-card/index.es.js +5 -4
  567. package/dist/components/waka-video/index.cjs.js +1 -1
  568. package/dist/components/waka-video/index.es.js +1 -1
  569. package/dist/components/waka-video-ad/index.cjs.js +1 -1
  570. package/dist/components/waka-video-ad/index.es.js +3 -3
  571. package/dist/components/waka-video-call/index.cjs.js +2 -2
  572. package/dist/components/waka-video-call/index.es.js +1 -1
  573. package/dist/components/waka-video-overlay/index.cjs.js +1 -1
  574. package/dist/components/waka-video-overlay/index.es.js +2 -2
  575. package/dist/components/waka-virtual-list/index.cjs.js +1 -1
  576. package/dist/components/waka-virtual-list/index.es.js +1 -1
  577. package/dist/components/waka-voice-message/index.cjs.js +1 -1
  578. package/dist/components/waka-voice-message/index.es.js +6 -5
  579. package/dist/components/waka-welcome-modal/index.cjs.js +2 -2
  580. package/dist/components/waka-welcome-modal/index.es.js +1 -1
  581. package/dist/components/waka-xp-bar/index.cjs.js +1 -1
  582. package/dist/components/waka-xp-bar/index.es.js +2 -2
  583. package/dist/context/admincrumb-context.cjs.js +1 -1
  584. package/dist/context/language-context.cjs.js +1 -1
  585. package/dist/context/language-context.es.js +2 -2
  586. package/dist/context/theme-context.cjs.js +1 -1
  587. package/dist/context/theme-provider.cjs.js +1 -1
  588. package/dist/context/theme-provider.es.js +9 -6
  589. package/dist/context/waka-provider.cjs.js +1 -1
  590. package/dist/context/waka-provider.es.js +57 -53
  591. package/dist/doc.cjs.js +1 -1
  592. package/dist/editor.cjs.js +1 -1
  593. package/dist/export.cjs.js +1 -1
  594. package/dist/hooks/use-toast.cjs.js +1 -1
  595. package/dist/hooks/use-translation.cjs.js +1 -1
  596. package/dist/index.cjs.js +1 -1
  597. package/dist/index.d.ts +2 -0
  598. package/dist/index.es.js +279 -278
  599. package/dist/lib/i18n.cjs.js +1 -1
  600. package/dist/lib/i18n.es.js +11 -9
  601. package/dist/locales/default-resources.cjs.js +1 -0
  602. package/dist/locales/default-resources.d.ts +155 -0
  603. package/dist/locales/default-resources.es.js +150 -0
  604. package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.cjs.js +13 -13
  605. package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.es.js +13 -13
  606. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-docker.cjs.js +1 -1
  607. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-docker.es.js +19 -19
  608. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.cjs.js +1 -1
  609. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.es.js +24 -25
  610. package/dist/node_modules/.pnpm/react-resizable-panels@4.11.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-resizable-panels/dist/react-resizable-panels.cjs.js +1 -1
  611. package/dist/node_modules/.pnpm/react-resizable-panels@4.11.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-resizable-panels/dist/react-resizable-panels.es.js +26 -23
  612. package/dist/rich-text.cjs.js +1 -1
  613. package/dist/ui.css +1 -1
  614. package/dist/utils/cn.cjs.js +1 -1
  615. package/dist/utils/datetime-helpers.cjs.js +1 -1
  616. package/dist/utils/theme-loader.cjs.js +1 -1
  617. package/dist/utils/tweak.cjs.js +1 -1
  618. package/package.json +28 -27
  619. package/src/components/DataTable/DataTable.tsx +2 -0
  620. package/src/components/DataTable/DataTablePagination.tsx +28 -8
  621. package/src/components/DataTable/hooks/useDataTable.ts +13 -0
  622. package/src/components/editor/blocks/waka-diagram-block.tsx +7 -36
@@ -1,4 +1,4 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../alert-dialog/index.cjs.js`),r=require(`../badge/index.cjs.js`),i=require(`../button/index.cjs.js`),a=require(`../card/index.cjs.js`),o=require(`../label/index.cjs.js`),s=require(`../input/index.cjs.js`),c=require(`../textarea/index.cjs.js`),l=require(`../../hooks/use-toast.cjs.js`);let u=require(`react`);u=e.__toESM(u);let d=require(`lucide-react`),f=require(`react/jsx-runtime`);function p({s3Config:e,onSave:p,onDelete:m,onLoadTheme:h,existingThemes:g=[],className:_}){let{toast:v}=l.useToast(),[y,b]=u.useState(``),[x,S]=u.useState(``),[C,w]=u.useState(``),[T,E]=u.useState(`#3b82f6`),[D,O]=u.useState(``),[k,A]=u.useState(``),[j,M]=u.useState(``),[N,P]=u.useState(!1),[F,I]=u.useState(!1),[L,R]=u.useState(!1),[z,B]=u.useState(!1),[V,H]=u.useState(!1),[U,W]=u.useState(null),[G,K]=u.useState([]),[q,J]=u.useState(`1.0.0`),Y=u.useRef(null),X=u.useCallback(e=>{if(!e.trim())return{valid:!1,error:`Le CSS ne peut pas être vide`};let t=e.includes(`:root`)||e.includes(`.dark`),n=e.includes(`@theme inline`);return!t&&!n?{valid:!1,error:`Le CSS doit contenir :root, .dark ou @theme inline`}:e.includes(`--`)?{valid:!0}:{valid:!1,error:`Le CSS doit contenir des variables CSS (--variable)`}},[]),Z=u.useCallback(()=>{let e=X(k);if(!e.valid){v({title:`CSS invalide`,description:e.error,variant:`destructive`});return}Y.current&&Y.current.parentNode&&Y.current.parentNode.removeChild(Y.current);let t=document.createElement(`style`);t.setAttribute(`data-theme-preview`,y),t.textContent=k,document.head.appendChild(t),Y.current=t,document.documentElement.setAttribute(`data-theme`,y),I(!0),v({title:`Prévisualisation activée`,description:`Le thème "${x}" est maintenant actif`})},[k,y,x,X,v]),Q=u.useCallback(()=>{Y.current&&Y.current.parentNode&&Y.current.parentNode.removeChild(Y.current),document.documentElement.removeAttribute(`data-theme`),I(!1),v({title:`Prévisualisation arrêtée`,description:`Thème par défaut restauré`})},[v]),ee=u.useCallback(async()=>{let t=X(k);if(!t.valid){v({title:`CSS invalide`,description:t.error,variant:`destructive`});return}if(!y||!x){v({title:`Informations manquantes`,description:`Veuillez renseigner l'ID et le nom du thème`,variant:`destructive`});return}P(!0);try{let{baseUrl:t,method:n=`PUT`,headers:r={},prefix:i=``,extension:a=`css`}=e,o=encodeURIComponent(y.replace(/\s+/g,`-`).toLowerCase()),s=`${t.replace(/\/$/,``)}/${i}${o}.${a}`;console.log(`[ThemeCreator] Uploading theme to: ${s}`);let c=await fetch(s,{method:n,headers:{"Content-Type":`text/css`,...r},body:k});if(!c.ok)throw Error(`Upload failed: ${c.status} ${c.statusText}`);let l={version:q,createdAt:new Date,createdBy:D||`Anonymous`,changelog:j||`No changelog provided`,css:k},u=[...G,l];K(u);let d={id:y,label:x,description:C,previewColor:T,author:D,versions:u,currentVersion:q},f=`${t.replace(/\/$/,``)}/${i}${y}.json`;await fetch(f,{method:n,headers:{"Content-Type":`application/json`,...r},body:JSON.stringify(d,null,2)}),v({title:`Thème publié !`,description:`Le thème "${x}" v${q} a été uploadé sur S3`}),p?.(d),M(``)}catch(e){console.error(`[ThemeCreator] Upload error:`,e),v({title:`Erreur d'upload`,description:e instanceof Error?e.message:`Une erreur est survenue`,variant:`destructive`})}finally{P(!1)}},[k,y,x,C,T,D,q,j,G,e,X,v,p]),te=u.useCallback(async()=>{try{await navigator.clipboard.writeText(k),R(!0),setTimeout(()=>R(!1),2e3),v({title:`CSS copié !`,description:`Le code CSS a été copié dans le presse-papiers`})}catch{v({title:`Erreur de copie`,description:`Impossible de copier le CSS`,variant:`destructive`})}},[k,v]),ne=u.useCallback(async e=>{H(!0);try{let t=e;if(h&&(!e.versions||e.versions.length===0||!e.versions[0].css)){let n=await h(e.id);if(n)t=n,v({title:`Thème chargé`,description:`Thème "${t.label}" chargé depuis S3`});else{v({title:`Erreur`,description:`Impossible de charger le thème "${e.label}"`,variant:`destructive`});return}}b(t.id),S(t.label),w(t.description||``),E(t.previewColor||`#3b82f6`),O(t.author||``),K(t.versions),J(t.currentVersion);let n=t.versions[t.versions.length-1];n&&A(n.css),W(t)}catch(e){console.error(`[WakaThemeCreator] Error loading theme:`,e),v({title:`Erreur`,description:`Erreur lors du chargement du thème`,variant:`destructive`})}finally{H(!1)}},[h,v]),$=u.useCallback(()=>{b(``),S(``),w(``),E(`#3b82f6`),O(``),A(``),M(``),K([]),J(`1.0.0`),W(null),F&&Q()},[F,Q]),re=u.useCallback(()=>{let e=new Blob([k],{type:`text/css`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${y||`theme`}.css`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t),v({title:`CSS téléchargé`,description:`Fichier ${y||`theme`}.css téléchargé`})},[k,y,v]);return(0,f.jsxs)(`div`,{className:t.cn(`w-full max-w-6xl mx-auto space-y-6`,_),children:[(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Créateur de Thèmes`}),(0,f.jsx)(`p`,{className:`text-muted-foreground`,children:`Créez et publiez des thèmes TweakCN sur S3`})]}),(0,f.jsxs)(`div`,{className:`flex gap-2`,children:[(0,f.jsxs)(i.Button,{variant:`outline`,onClick:$,children:[(0,f.jsx)(d.Plus,{className:`mr-2 h-4 w-4`}),`Nouveau thème`]}),F&&(0,f.jsx)(i.Button,{variant:`destructive`,onClick:Q,children:`Arrêter la prévisualisation`})]})]}),(0,f.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,f.jsxs)(a.Card,{className:`lg:col-span-1`,children:[(0,f.jsxs)(a.CardHeader,{children:[(0,f.jsx)(a.CardTitle,{children:`Thèmes existants`}),(0,f.jsx)(a.CardDescription,{children:`Chargez un thème pour le modifier`})]}),(0,f.jsx)(a.CardContent,{className:`space-y-2`,children:g.length===0?(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-4`,children:`Aucun thème existant`}):g.map(e=>(0,f.jsxs)(`button`,{onClick:()=>ne(e),disabled:V,className:t.cn(`w-full flex items-center gap-3 p-3 rounded-lg border-2 transition-all text-left`,U?.id===e.id?`border-primary bg-primary/10`:`border-border hover:border-primary/50`,V&&`opacity-50 cursor-not-allowed`),children:[(0,f.jsx)(`div`,{className:`w-8 h-8 rounded-full flex-shrink-0`,style:{backgroundColor:e.previewColor||`#3b82f6`}}),(0,f.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,f.jsxs)(`div`,{className:`font-medium truncate flex items-center gap-2`,children:[e.label,V&&U?.id===e.id&&(0,f.jsx)(d.Loader2,{className:`h-4 w-4 animate-spin`})]}),(0,f.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`v`,e.currentVersion||`1.0.0`,` • `,e.versions?.length||0,` versions`]})]})]},e.id))})]}),(0,f.jsxs)(`div`,{className:`lg:col-span-2 space-y-6`,children:[(0,f.jsxs)(a.Card,{children:[(0,f.jsx)(a.CardHeader,{children:(0,f.jsxs)(a.CardTitle,{className:`flex items-center gap-2`,children:[(0,f.jsx)(d.Palette,{className:`h-5 w-5`}),`Informations du thème`]})}),(0,f.jsxs)(a.CardContent,{className:`space-y-4`,children:[(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-id`,children:`ID du thème *`}),(0,f.jsx)(s.Input,{id:`theme-id`,placeholder:`ex: forest`,value:y,onChange:e=>b(e.target.value)})]}),(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-label`,children:`Nom d'affichage *`}),(0,f.jsx)(s.Input,{id:`theme-label`,placeholder:`ex: Forêt`,value:x,onChange:e=>S(e.target.value)})]})]}),(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-description`,children:`Description`}),(0,f.jsx)(s.Input,{id:`theme-description`,placeholder:`Thème inspiré de la nature`,value:C,onChange:e=>w(e.target.value)})]}),(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-color`,children:`Couleur de prévisualisation`}),(0,f.jsxs)(`div`,{className:`flex gap-2`,children:[(0,f.jsx)(s.Input,{id:`theme-color`,type:`color`,value:T,onChange:e=>E(e.target.value),className:`w-16 h-10 p-1`}),(0,f.jsx)(s.Input,{value:T,onChange:e=>E(e.target.value),placeholder:`#3b82f6`})]})]}),(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-author`,children:`Auteur`}),(0,f.jsx)(s.Input,{id:`theme-author`,placeholder:`Votre nom`,value:D,onChange:e=>O(e.target.value)})]})]}),(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-version`,children:`Version`}),(0,f.jsx)(s.Input,{id:`theme-version`,placeholder:`1.0.0`,value:q,onChange:e=>J(e.target.value)})]}),(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-changelog`,children:`Changelog`}),(0,f.jsx)(s.Input,{id:`theme-changelog`,placeholder:`Modifications apportées`,value:j,onChange:e=>M(e.target.value)})]})]})]})]}),(0,f.jsxs)(a.Card,{children:[(0,f.jsxs)(a.CardHeader,{children:[(0,f.jsxs)(a.CardTitle,{className:`flex items-center gap-2`,children:[(0,f.jsx)(d.FileCode,{className:`h-5 w-5`}),`Code CSS TweakCN`]}),(0,f.jsx)(a.CardDescription,{children:`Collez le CSS généré par TweakCN ici`})]}),(0,f.jsxs)(a.CardContent,{className:`space-y-4`,children:[(0,f.jsx)(c.Textarea,{placeholder:`:root {
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../alert-dialog/index.cjs.js"),r=require("../badge/index.cjs.js"),i=require("../button/index.cjs.js"),a=require("../card/index.cjs.js"),o=require("../label/index.cjs.js"),s=require("../input/index.cjs.js"),c=require("../textarea/index.cjs.js"),l=require("../../hooks/use-toast.cjs.js");let u=require("react");u=e.__toESM(u);let d=require("lucide-react"),f=require("react/jsx-runtime");function p({s3Config:e,onSave:p,onDelete:m,onLoadTheme:h,existingThemes:g=[],className:_}){let{toast:v}=l.useToast(),[y,b]=u.useState(``),[x,S]=u.useState(``),[C,w]=u.useState(``),[T,E]=u.useState(`#3b82f6`),[D,O]=u.useState(``),[k,A]=u.useState(``),[j,M]=u.useState(``),[N,P]=u.useState(!1),[F,I]=u.useState(!1),[L,R]=u.useState(!1),[z,B]=u.useState(!1),[V,H]=u.useState(!1),[U,W]=u.useState(null),[G,K]=u.useState([]),[q,J]=u.useState(`1.0.0`),Y=u.useRef(null),X=u.useCallback(e=>{if(!e.trim())return{valid:!1,error:`Le CSS ne peut pas être vide`};let t=e.includes(`:root`)||e.includes(`.dark`),n=e.includes(`@theme inline`);return!t&&!n?{valid:!1,error:`Le CSS doit contenir :root, .dark ou @theme inline`}:e.includes(`--`)?{valid:!0}:{valid:!1,error:`Le CSS doit contenir des variables CSS (--variable)`}},[]),Z=u.useCallback(()=>{let e=X(k);if(!e.valid){v({title:`CSS invalide`,description:e.error,variant:`destructive`});return}Y.current&&Y.current.parentNode&&Y.current.parentNode.removeChild(Y.current);let t=document.createElement(`style`);t.setAttribute(`data-theme-preview`,y),t.textContent=k,document.head.appendChild(t),Y.current=t,document.documentElement.setAttribute(`data-theme`,y),I(!0),v({title:`Prévisualisation activée`,description:`Le thème "${x}" est maintenant actif`})},[k,y,x,X,v]),Q=u.useCallback(()=>{Y.current&&Y.current.parentNode&&Y.current.parentNode.removeChild(Y.current),document.documentElement.removeAttribute(`data-theme`),I(!1),v({title:`Prévisualisation arrêtée`,description:`Thème par défaut restauré`})},[v]),ee=u.useCallback(async()=>{let t=X(k);if(!t.valid){v({title:`CSS invalide`,description:t.error,variant:`destructive`});return}if(!y||!x){v({title:`Informations manquantes`,description:`Veuillez renseigner l'ID et le nom du thème`,variant:`destructive`});return}P(!0);try{let{baseUrl:t,method:n=`PUT`,headers:r={},prefix:i=``,extension:a=`css`}=e,o=encodeURIComponent(y.replace(/\s+/g,`-`).toLowerCase()),s=`${t.replace(/\/$/,``)}/${i}${o}.${a}`;console.log(`[ThemeCreator] Uploading theme to: ${s}`);let c=await fetch(s,{method:n,headers:{"Content-Type":`text/css`,...r},body:k});if(!c.ok)throw Error(`Upload failed: ${c.status} ${c.statusText}`);let l={version:q,createdAt:new Date,createdBy:D||`Anonymous`,changelog:j||`No changelog provided`,css:k},u=[...G,l];K(u);let d={id:y,label:x,description:C,previewColor:T,author:D,versions:u,currentVersion:q},f=`${t.replace(/\/$/,``)}/${i}${y}.json`;await fetch(f,{method:n,headers:{"Content-Type":`application/json`,...r},body:JSON.stringify(d,null,2)}),v({title:`Thème publié !`,description:`Le thème "${x}" v${q} a été uploadé sur S3`}),p?.(d),M(``)}catch(e){console.error(`[ThemeCreator] Upload error:`,e),v({title:`Erreur d'upload`,description:e instanceof Error?e.message:`Une erreur est survenue`,variant:`destructive`})}finally{P(!1)}},[k,y,x,C,T,D,q,j,G,e,X,v,p]),te=u.useCallback(async()=>{try{await navigator.clipboard.writeText(k),R(!0),setTimeout(()=>R(!1),2e3),v({title:`CSS copié !`,description:`Le code CSS a été copié dans le presse-papiers`})}catch{v({title:`Erreur de copie`,description:`Impossible de copier le CSS`,variant:`destructive`})}},[k,v]),ne=u.useCallback(async e=>{H(!0);try{let t=e;if(h&&(!e.versions||e.versions.length===0||!e.versions[0].css)){let n=await h(e.id);if(n)t=n,v({title:`Thème chargé`,description:`Thème "${t.label}" chargé depuis S3`});else{v({title:`Erreur`,description:`Impossible de charger le thème "${e.label}"`,variant:`destructive`});return}}b(t.id),S(t.label),w(t.description||``),E(t.previewColor||`#3b82f6`),O(t.author||``),K(t.versions),J(t.currentVersion);let n=t.versions[t.versions.length-1];n&&A(n.css),W(t)}catch(e){console.error(`[WakaThemeCreator] Error loading theme:`,e),v({title:`Erreur`,description:`Erreur lors du chargement du thème`,variant:`destructive`})}finally{H(!1)}},[h,v]),$=u.useCallback(()=>{b(``),S(``),w(``),E(`#3b82f6`),O(``),A(``),M(``),K([]),J(`1.0.0`),W(null),F&&Q()},[F,Q]),re=u.useCallback(()=>{let e=new Blob([k],{type:`text/css`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${y||`theme`}.css`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t),v({title:`CSS téléchargé`,description:`Fichier ${y||`theme`}.css téléchargé`})},[k,y,v]);return(0,f.jsxs)(`div`,{className:t.cn(`w-full max-w-6xl mx-auto space-y-6`,_),children:[(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Créateur de Thèmes`}),(0,f.jsx)(`p`,{className:`text-muted-foreground`,children:`Créez et publiez des thèmes TweakCN sur S3`})]}),(0,f.jsxs)(`div`,{className:`flex gap-2`,children:[(0,f.jsxs)(i.Button,{variant:`outline`,onClick:$,children:[(0,f.jsx)(d.Plus,{className:`mr-2 h-4 w-4`}),`Nouveau thème`]}),F&&(0,f.jsx)(i.Button,{variant:`destructive`,onClick:Q,children:`Arrêter la prévisualisation`})]})]}),(0,f.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,f.jsxs)(a.Card,{className:`lg:col-span-1`,children:[(0,f.jsxs)(a.CardHeader,{children:[(0,f.jsx)(a.CardTitle,{children:`Thèmes existants`}),(0,f.jsx)(a.CardDescription,{children:`Chargez un thème pour le modifier`})]}),(0,f.jsx)(a.CardContent,{className:`space-y-2`,children:g.length===0?(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-4`,children:`Aucun thème existant`}):g.map(e=>(0,f.jsxs)(`button`,{onClick:()=>ne(e),disabled:V,className:t.cn(`w-full flex items-center gap-3 p-3 rounded-lg border-2 transition-all text-left`,U?.id===e.id?`border-primary bg-primary/10`:`border-border hover:border-primary/50`,V&&`opacity-50 cursor-not-allowed`),children:[(0,f.jsx)(`div`,{className:`w-8 h-8 rounded-full flex-shrink-0`,style:{backgroundColor:e.previewColor||`#3b82f6`}}),(0,f.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,f.jsxs)(`div`,{className:`font-medium truncate flex items-center gap-2`,children:[e.label,V&&U?.id===e.id&&(0,f.jsx)(d.Loader2,{className:`h-4 w-4 animate-spin`})]}),(0,f.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`v`,e.currentVersion||`1.0.0`,` • `,e.versions?.length||0,` versions`]})]})]},e.id))})]}),(0,f.jsxs)(`div`,{className:`lg:col-span-2 space-y-6`,children:[(0,f.jsxs)(a.Card,{children:[(0,f.jsx)(a.CardHeader,{children:(0,f.jsxs)(a.CardTitle,{className:`flex items-center gap-2`,children:[(0,f.jsx)(d.Palette,{className:`h-5 w-5`}),`Informations du thème`]})}),(0,f.jsxs)(a.CardContent,{className:`space-y-4`,children:[(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-id`,children:`ID du thème *`}),(0,f.jsx)(s.Input,{id:`theme-id`,placeholder:`ex: forest`,value:y,onChange:e=>b(e.target.value)})]}),(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-label`,children:`Nom d'affichage *`}),(0,f.jsx)(s.Input,{id:`theme-label`,placeholder:`ex: Forêt`,value:x,onChange:e=>S(e.target.value)})]})]}),(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-description`,children:`Description`}),(0,f.jsx)(s.Input,{id:`theme-description`,placeholder:`Thème inspiré de la nature`,value:C,onChange:e=>w(e.target.value)})]}),(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-color`,children:`Couleur de prévisualisation`}),(0,f.jsxs)(`div`,{className:`flex gap-2`,children:[(0,f.jsx)(s.Input,{id:`theme-color`,type:`color`,value:T,onChange:e=>E(e.target.value),className:`w-16 h-10 p-1`}),(0,f.jsx)(s.Input,{value:T,onChange:e=>E(e.target.value),placeholder:`#3b82f6`})]})]}),(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-author`,children:`Auteur`}),(0,f.jsx)(s.Input,{id:`theme-author`,placeholder:`Votre nom`,value:D,onChange:e=>O(e.target.value)})]})]}),(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-version`,children:`Version`}),(0,f.jsx)(s.Input,{id:`theme-version`,placeholder:`1.0.0`,value:q,onChange:e=>J(e.target.value)})]}),(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsx)(o.Label,{htmlFor:`theme-changelog`,children:`Changelog`}),(0,f.jsx)(s.Input,{id:`theme-changelog`,placeholder:`Modifications apportées`,value:j,onChange:e=>M(e.target.value)})]})]})]})]}),(0,f.jsxs)(a.Card,{children:[(0,f.jsxs)(a.CardHeader,{children:[(0,f.jsxs)(a.CardTitle,{className:`flex items-center gap-2`,children:[(0,f.jsx)(d.FileCode,{className:`h-5 w-5`}),`Code CSS TweakCN`]}),(0,f.jsx)(a.CardDescription,{children:`Collez le CSS généré par TweakCN ici`})]}),(0,f.jsxs)(a.CardContent,{className:`space-y-4`,children:[(0,f.jsx)(c.Textarea,{placeholder:`:root {
2
2
  --background: oklch(0.9911 0 0);
3
3
  --foreground: oklch(0.2046 0 0);
4
4
  --primary: oklch(0.8348 0.1302 160.9080);
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../badge/index.cjs.js`),r=require(`../button/index.cjs.js`),i=require(`../card/index.cjs.js`),a=require(`../label/index.cjs.js`),o=require(`../input/index.cjs.js`),s=require(`../separator/index.cjs.js`),c=require(`../textarea/index.cjs.js`),l=require(`../../context/theme-provider.cjs.js`);let u=require(`react`);u=e.__toESM(u);let d=require(`lucide-react`),f=require(`class-variance-authority`),p=require(`react/jsx-runtime`);function m(){try{return l.useTheme()}catch{return null}}var h=(0,f.cva)(`w-full`,{variants:{size:{sm:`max-w-2xl`,base:`max-w-4xl`,lg:`max-w-6xl`,full:`max-w-full`}},defaultVariants:{size:`base`}}),g=u.forwardRef(({className:e,size:l,onThemeChange:f,onThemeLoad:g,onThemeSave:_,initialTheme:v,showPreview:y=!0,showExport:b=!0,showImport:x=!0,allowCustomColors:S=!0,...C},w)=>{let T=m(),E=T?.currentTheme,D=T?.themes||[],O=T?.changeTheme,[k,A]=(0,u.useState)(v||{name:`Custom Theme`,description:`Thème personnalisé`,colors:{background:`#ffffff`,foreground:`#0a0a0a`,card:`#ffffff`,cardForeground:`#0a0a0a`,popover:`#ffffff`,popoverForeground:`#0a0a0a`,primary:`#0a0a0a`,primaryForeground:`#fafafa`,secondary:`#f4f4f5`,secondaryForeground:`#0a0a0a`,muted:`#f4f4f5`,mutedForeground:`#737373`,accent:`#f4f4f5`,accentForeground:`#0a0a0a`,destructive:`#ef4444`,destructiveForeground:`#fafafa`,border:`#e4e4e7`,input:`#e4e4e7`,ring:`#0a0a0a`}}),[j,M]=(0,u.useState)(!1),[N,P]=(0,u.useState)(null),[F,I]=(0,u.useState)(null),[L,R]=(0,u.useState)(``),[z,B]=(0,u.useState)(!1),[V,H]=(0,u.useState)(`auto`),U=(0,u.useCallback)(e=>{let t=document.documentElement;Object.entries(e.colors).forEach(([e,n])=>{let r=`--${e.replace(/([A-Z])/g,`-$1`).toLowerCase()}`;t.style.setProperty(r,n)}),O&&O(e.name.toLowerCase().replace(/\s+/g,`-`))},[O]),W=async e=>{M(!0),P(null),I(null);try{let t=await fetch(e);if(!t.ok)throw Error(`Erreur HTTP: ${t.status}`);let n=await t.json();if(!n.name||!n.colors)throw Error(`Format de thème invalide`);let r={name:n.name,description:n.description||``,author:n.author||``,version:n.version||`1.0.0`,colors:{background:n.colors.background||`#ffffff`,foreground:n.colors.foreground||`#0a0a0a`,card:n.colors.card||`#ffffff`,cardForeground:n.colors.cardForeground||`#0a0a0a`,popover:n.colors.popover||`#ffffff`,popoverForeground:n.colors.popoverForeground||`#0a0a0a`,primary:n.colors.primary||`#0a0a0a`,primaryForeground:n.colors.primaryForeground||`#fafafa`,secondary:n.colors.secondary||`#f4f4f5`,secondaryForeground:n.colors.secondaryForeground||`#0a0a0a`,muted:n.colors.muted||`#f4f4f5`,mutedForeground:n.colors.mutedForeground||`#737373`,accent:n.colors.accent||`#f4f4f5`,accentForeground:n.colors.accentForeground||`#0a0a0a`,destructive:n.colors.destructive||`#ef4444`,destructiveForeground:n.colors.destructiveForeground||`#fafafa`,border:n.colors.border||`#e4e4e7`,input:n.colors.input||`#e4e4e7`,ring:n.colors.ring||`#0a0a0a`,chart1:n.colors.chart1,chart2:n.colors.chart2,chart3:n.colors.chart3,chart4:n.colors.chart4,chart5:n.colors.chart5}};A(r),U(r),g?.(r),I(`Thème chargé avec succès !`)}catch(e){P(e instanceof Error?e.message:`Erreur lors du chargement du thème`)}finally{M(!1)}},G=()=>{let e=JSON.stringify(k,null,2),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${k.name.toLowerCase().replace(/\s+/g,`-`)}-theme.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)},K=async()=>{try{await navigator.clipboard.writeText(JSON.stringify(k,null,2)),B(!0),setTimeout(()=>B(!1),2e3)}catch{P(`Impossible de copier le thème`)}},q=(e,t)=>{let n={...k,colors:{...k.colors,[e]:t}};A(n),U(n),f?.(n)},J=()=>{_?.(k),I(`Thème sauvegardé !`)};return(0,u.useEffect)(()=>{U(k)},[k,U]),(0,u.useEffect)(()=>{let e=document.documentElement;V===`dark`?e.classList.add(`dark`):V===`light`?e.classList.remove(`dark`):window.matchMedia(`(prefers-color-scheme: dark)`).matches?e.classList.add(`dark`):e.classList.remove(`dark`)},[V]),(0,p.jsx)(`div`,{ref:w,className:t.cn(h({size:l}),e),...C,children:(0,p.jsxs)(`div`,{className:`space-y-6`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Gestionnaire de Thèmes TweakCN`}),(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`Créez, importez et prévisualisez vos thèmes personnalisés`})]}),(0,p.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,p.jsxs)(n.Badge,{variant:`outline`,className:`flex items-center gap-1`,children:[(0,p.jsx)(d.Palette,{className:`h-3 w-3`}),k.name]})})]}),N&&(0,p.jsxs)(`div`,{className:`flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive`,children:[(0,p.jsx)(d.AlertCircle,{className:`h-4 w-4`}),(0,p.jsx)(`span`,{className:`text-sm`,children:N})]}),F&&(0,p.jsxs)(`div`,{className:`flex items-center gap-2 p-3 bg-green-500/10 border border-green-500/20 rounded-lg text-green-600`,children:[(0,p.jsx)(d.CheckCircle,{className:`h-4 w-4`}),(0,p.jsx)(`span`,{className:`text-sm`,children:F})]}),(0,p.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,p.jsxs)(`div`,{className:`space-y-6`,children:[(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.CardHeader,{children:(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Settings,{className:`h-5 w-5`}),`Informations du thème`]})}),(0,p.jsxs)(i.CardContent,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(a.Label,{htmlFor:`theme-name`,children:`Nom`}),(0,p.jsx)(o.Input,{id:`theme-name`,value:k.name,onChange:e=>A({...k,name:e.target.value}),placeholder:`Mon thème`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(a.Label,{htmlFor:`theme-author`,children:`Auteur`}),(0,p.jsx)(o.Input,{id:`theme-author`,value:k.author||``,onChange:e=>A({...k,author:e.target.value}),placeholder:`Votre nom`})]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(a.Label,{htmlFor:`theme-description`,children:`Description`}),(0,p.jsx)(c.Textarea,{id:`theme-description`,value:k.description||``,onChange:e=>A({...k,description:e.target.value}),placeholder:`Description du thème...`,rows:3})]})]})]}),(x||b)&&(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.CardHeader,{children:(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Upload,{className:`h-5 w-5`}),`Import / Export`]})}),(0,p.jsxs)(i.CardContent,{className:`space-y-4`,children:[x&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(a.Label,{htmlFor:`import-url`,children:`URL du thème JSON`}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsx)(o.Input,{id:`import-url`,value:L,onChange:e=>R(e.target.value),placeholder:`https://example.com/theme.json`,className:`flex-1`}),(0,p.jsx)(r.Button,{onClick:()=>W(L),disabled:!L||j,size:`sm`,children:j?(0,p.jsx)(d.RefreshCw,{className:`h-4 w-4 animate-spin`}):(0,p.jsx)(d.Download,{className:`h-4 w-4`})})]})]}),b&&(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(r.Button,{onClick:G,variant:`outline`,className:`flex-1`,children:[(0,p.jsx)(d.Download,{className:`h-4 w-4 mr-2`}),`Exporter JSON`]}),(0,p.jsx)(r.Button,{onClick:K,variant:`outline`,children:z?(0,p.jsx)(d.Check,{className:`h-4 w-4`}):(0,p.jsx)(d.Copy,{className:`h-4 w-4`})})]})]})]}),y&&(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.CardHeader,{children:(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Eye,{className:`h-5 w-5`}),`Prévisualisation`]})}),(0,p.jsx)(i.CardContent,{children:(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(r.Button,{variant:V===`light`?`default`:`outline`,size:`sm`,onClick:()=>H(`light`),children:[(0,p.jsx)(d.Sun,{className:`h-4 w-4 mr-2`}),`Clair`]}),(0,p.jsxs)(r.Button,{variant:V===`dark`?`default`:`outline`,size:`sm`,onClick:()=>H(`dark`),children:[(0,p.jsx)(d.Moon,{className:`h-4 w-4 mr-2`}),`Sombre`]}),(0,p.jsxs)(r.Button,{variant:V===`auto`?`default`:`outline`,size:`sm`,onClick:()=>H(`auto`),children:[(0,p.jsx)(d.Monitor,{className:`h-4 w-4 mr-2`}),`Auto`]})]}),E&&(0,p.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[(0,p.jsxs)(`div`,{className:`flex justify-between`,children:[(0,p.jsx)(`span`,{children:`Thème actuel:`}),(0,p.jsx)(`span`,{className:`font-medium`,children:E})]}),(0,p.jsxs)(`div`,{className:`flex justify-between`,children:[(0,p.jsx)(`span`,{children:`Mode sombre:`}),(0,p.jsx)(`span`,{className:`font-medium`,children:`Géré par le système`})]}),(0,p.jsxs)(`div`,{className:`flex justify-between`,children:[(0,p.jsx)(`span`,{children:`Thèmes disponibles:`}),(0,p.jsx)(`span`,{className:`font-medium`,children:D.length})]})]})]})})]}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsx)(r.Button,{onClick:J,className:`flex-1`,children:`Sauvegarder le thème`}),(0,p.jsxs)(r.Button,{variant:`outline`,onClick:()=>window.open(`https://tweakcn.com`,`_blank`),children:[(0,p.jsx)(d.ExternalLink,{className:`h-4 w-4 mr-2`}),`TweakCN`]})]})]}),S&&(0,p.jsx)(`div`,{className:`space-y-6`,children:(0,p.jsxs)(i.Card,{children:[(0,p.jsxs)(i.CardHeader,{children:[(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Palette,{className:`h-5 w-5`}),`Couleurs du thème`]}),(0,p.jsx)(i.CardDescription,{children:`Cliquez sur une couleur pour la modifier`})]}),(0,p.jsx)(i.CardContent,{children:(0,p.jsx)(`div`,{className:`grid grid-cols-2 gap-4`,children:Object.entries(k.colors).map(([e,t])=>(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(a.Label,{htmlFor:`color-${e}`,className:`text-sm font-medium`,children:e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase())}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsx)(`div`,{className:`w-10 h-10 rounded border border-border cursor-pointer`,style:{backgroundColor:t},onClick:()=>{document.getElementById(`color-${e}`)?.click()}}),(0,p.jsx)(o.Input,{id:`color-${e}`,type:`color`,value:t,onChange:t=>q(e,t.target.value),className:`flex-1 h-10`})]})]},e))})})]})})]}),y&&(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.CardHeader,{children:(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Eye,{className:`h-5 w-5`}),`Prévisualisation en temps réel`]})}),(0,p.jsx)(i.CardContent,{children:(0,p.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:[(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Boutons`}),(0,p.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,p.jsx)(r.Button,{size:`sm`,children:`Primary`}),(0,p.jsx)(r.Button,{variant:`secondary`,size:`sm`,children:`Secondary`}),(0,p.jsx)(r.Button,{variant:`outline`,size:`sm`,children:`Outline`}),(0,p.jsx)(r.Button,{variant:`destructive`,size:`sm`,children:`Destructive`})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Cards`}),(0,p.jsxs)(i.Card,{className:`p-3`,children:[(0,p.jsx)(i.CardTitle,{className:`text-sm`,children:`Exemple de carte`}),(0,p.jsx)(i.CardDescription,{className:`text-xs`,children:`Contenu de la carte avec le nouveau thème`})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Inputs`}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(o.Input,{placeholder:`Input normal`}),(0,p.jsx)(o.Input,{placeholder:`Input avec erreur`,className:`border-destructive`})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Badges`}),(0,p.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,p.jsx)(n.Badge,{children:`Default`}),(0,p.jsx)(n.Badge,{variant:`secondary`,children:`Secondary`}),(0,p.jsx)(n.Badge,{variant:`destructive`,children:`Destructive`}),(0,p.jsx)(n.Badge,{variant:`outline`,children:`Outline`})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Séparateur`}),(0,p.jsx)(s.Separator,{}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Texte avec couleur muted`})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Progress`}),(0,p.jsx)(`div`,{className:`w-full bg-muted rounded-full h-2`,children:(0,p.jsx)(`div`,{className:`bg-primary h-2 rounded-full`,style:{width:`60%`}})})]})]})})]})]})})});g.displayName=`WakaThemeManager`,exports.WakaThemeManager=g,exports.themeManagerVariants=h;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../badge/index.cjs.js"),r=require("../button/index.cjs.js"),i=require("../card/index.cjs.js"),a=require("../label/index.cjs.js"),o=require("../input/index.cjs.js"),s=require("../separator/index.cjs.js"),c=require("../textarea/index.cjs.js"),l=require("../../context/theme-provider.cjs.js");let u=require("react");u=e.__toESM(u);let d=require("lucide-react"),f=require("class-variance-authority"),p=require("react/jsx-runtime");function m(){try{return l.useTheme()}catch{return null}}var h=(0,f.cva)(`w-full`,{variants:{size:{sm:`max-w-2xl`,base:`max-w-4xl`,lg:`max-w-6xl`,full:`max-w-full`}},defaultVariants:{size:`base`}}),g=u.forwardRef(({className:e,size:l,onThemeChange:f,onThemeLoad:g,onThemeSave:_,initialTheme:v,showPreview:y=!0,showExport:b=!0,showImport:x=!0,allowCustomColors:S=!0,...C},w)=>{let T=m(),E=T?.currentTheme,D=T?.themes||[],O=T?.changeTheme,[k,A]=(0,u.useState)(v||{name:`Custom Theme`,description:`Thème personnalisé`,colors:{background:`#ffffff`,foreground:`#0a0a0a`,card:`#ffffff`,cardForeground:`#0a0a0a`,popover:`#ffffff`,popoverForeground:`#0a0a0a`,primary:`#0a0a0a`,primaryForeground:`#fafafa`,secondary:`#f4f4f5`,secondaryForeground:`#0a0a0a`,muted:`#f4f4f5`,mutedForeground:`#737373`,accent:`#f4f4f5`,accentForeground:`#0a0a0a`,destructive:`#ef4444`,destructiveForeground:`#fafafa`,border:`#e4e4e7`,input:`#e4e4e7`,ring:`#0a0a0a`}}),[j,M]=(0,u.useState)(!1),[N,P]=(0,u.useState)(null),[F,I]=(0,u.useState)(null),[L,R]=(0,u.useState)(``),[z,B]=(0,u.useState)(!1),[V,H]=(0,u.useState)(`auto`),U=(0,u.useCallback)(e=>{let t=document.documentElement;if(Object.entries(e.colors).forEach(([e,n])=>{let r=`--${e.replace(/([A-Z])/g,`-$1`).toLowerCase()}`;t.style.setProperty(r,n)}),O){let t=e.name.toLowerCase().replace(/\s+/g,`-`);O(t)}},[O]),W=async e=>{M(!0),P(null),I(null);try{let t=await fetch(e);if(!t.ok)throw Error(`Erreur HTTP: ${t.status}`);let n=await t.json();if(!n.name||!n.colors)throw Error(`Format de thème invalide`);let r={name:n.name,description:n.description||``,author:n.author||``,version:n.version||`1.0.0`,colors:{background:n.colors.background||`#ffffff`,foreground:n.colors.foreground||`#0a0a0a`,card:n.colors.card||`#ffffff`,cardForeground:n.colors.cardForeground||`#0a0a0a`,popover:n.colors.popover||`#ffffff`,popoverForeground:n.colors.popoverForeground||`#0a0a0a`,primary:n.colors.primary||`#0a0a0a`,primaryForeground:n.colors.primaryForeground||`#fafafa`,secondary:n.colors.secondary||`#f4f4f5`,secondaryForeground:n.colors.secondaryForeground||`#0a0a0a`,muted:n.colors.muted||`#f4f4f5`,mutedForeground:n.colors.mutedForeground||`#737373`,accent:n.colors.accent||`#f4f4f5`,accentForeground:n.colors.accentForeground||`#0a0a0a`,destructive:n.colors.destructive||`#ef4444`,destructiveForeground:n.colors.destructiveForeground||`#fafafa`,border:n.colors.border||`#e4e4e7`,input:n.colors.input||`#e4e4e7`,ring:n.colors.ring||`#0a0a0a`,chart1:n.colors.chart1,chart2:n.colors.chart2,chart3:n.colors.chart3,chart4:n.colors.chart4,chart5:n.colors.chart5}};A(r),U(r),g?.(r),I(`Thème chargé avec succès !`)}catch(e){P(e instanceof Error?e.message:`Erreur lors du chargement du thème`)}finally{M(!1)}},G=()=>{let e=JSON.stringify(k,null,2),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${k.name.toLowerCase().replace(/\s+/g,`-`)}-theme.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)},K=async()=>{try{await navigator.clipboard.writeText(JSON.stringify(k,null,2)),B(!0),setTimeout(()=>B(!1),2e3)}catch{P(`Impossible de copier le thème`)}},q=(e,t)=>{let n={...k,colors:{...k.colors,[e]:t}};A(n),U(n),f?.(n)},J=()=>{_?.(k),I(`Thème sauvegardé !`)};return(0,u.useEffect)(()=>{U(k)},[k,U]),(0,u.useEffect)(()=>{let e=document.documentElement;V===`dark`?e.classList.add(`dark`):V===`light`?e.classList.remove(`dark`):window.matchMedia(`(prefers-color-scheme: dark)`).matches?e.classList.add(`dark`):e.classList.remove(`dark`)},[V]),(0,p.jsx)(`div`,{ref:w,className:t.cn(h({size:l}),e),...C,children:(0,p.jsxs)(`div`,{className:`space-y-6`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Gestionnaire de Thèmes TweakCN`}),(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`Créez, importez et prévisualisez vos thèmes personnalisés`})]}),(0,p.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,p.jsxs)(n.Badge,{variant:`outline`,className:`flex items-center gap-1`,children:[(0,p.jsx)(d.Palette,{className:`h-3 w-3`}),k.name]})})]}),N&&(0,p.jsxs)(`div`,{className:`flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive`,children:[(0,p.jsx)(d.AlertCircle,{className:`h-4 w-4`}),(0,p.jsx)(`span`,{className:`text-sm`,children:N})]}),F&&(0,p.jsxs)(`div`,{className:`flex items-center gap-2 p-3 bg-green-500/10 border border-green-500/20 rounded-lg text-green-600`,children:[(0,p.jsx)(d.CheckCircle,{className:`h-4 w-4`}),(0,p.jsx)(`span`,{className:`text-sm`,children:F})]}),(0,p.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,p.jsxs)(`div`,{className:`space-y-6`,children:[(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.CardHeader,{children:(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Settings,{className:`h-5 w-5`}),`Informations du thème`]})}),(0,p.jsxs)(i.CardContent,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(a.Label,{htmlFor:`theme-name`,children:`Nom`}),(0,p.jsx)(o.Input,{id:`theme-name`,value:k.name,onChange:e=>A({...k,name:e.target.value}),placeholder:`Mon thème`})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(a.Label,{htmlFor:`theme-author`,children:`Auteur`}),(0,p.jsx)(o.Input,{id:`theme-author`,value:k.author||``,onChange:e=>A({...k,author:e.target.value}),placeholder:`Votre nom`})]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(a.Label,{htmlFor:`theme-description`,children:`Description`}),(0,p.jsx)(c.Textarea,{id:`theme-description`,value:k.description||``,onChange:e=>A({...k,description:e.target.value}),placeholder:`Description du thème...`,rows:3})]})]})]}),(x||b)&&(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.CardHeader,{children:(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Upload,{className:`h-5 w-5`}),`Import / Export`]})}),(0,p.jsxs)(i.CardContent,{className:`space-y-4`,children:[x&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(a.Label,{htmlFor:`import-url`,children:`URL du thème JSON`}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsx)(o.Input,{id:`import-url`,value:L,onChange:e=>R(e.target.value),placeholder:`https://example.com/theme.json`,className:`flex-1`}),(0,p.jsx)(r.Button,{onClick:()=>W(L),disabled:!L||j,size:`sm`,children:j?(0,p.jsx)(d.RefreshCw,{className:`h-4 w-4 animate-spin`}):(0,p.jsx)(d.Download,{className:`h-4 w-4`})})]})]}),b&&(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(r.Button,{onClick:G,variant:`outline`,className:`flex-1`,children:[(0,p.jsx)(d.Download,{className:`h-4 w-4 mr-2`}),`Exporter JSON`]}),(0,p.jsx)(r.Button,{onClick:K,variant:`outline`,children:z?(0,p.jsx)(d.Check,{className:`h-4 w-4`}):(0,p.jsx)(d.Copy,{className:`h-4 w-4`})})]})]})]}),y&&(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.CardHeader,{children:(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Eye,{className:`h-5 w-5`}),`Prévisualisation`]})}),(0,p.jsx)(i.CardContent,{children:(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(r.Button,{variant:V===`light`?`default`:`outline`,size:`sm`,onClick:()=>H(`light`),children:[(0,p.jsx)(d.Sun,{className:`h-4 w-4 mr-2`}),`Clair`]}),(0,p.jsxs)(r.Button,{variant:V===`dark`?`default`:`outline`,size:`sm`,onClick:()=>H(`dark`),children:[(0,p.jsx)(d.Moon,{className:`h-4 w-4 mr-2`}),`Sombre`]}),(0,p.jsxs)(r.Button,{variant:V===`auto`?`default`:`outline`,size:`sm`,onClick:()=>H(`auto`),children:[(0,p.jsx)(d.Monitor,{className:`h-4 w-4 mr-2`}),`Auto`]})]}),E&&(0,p.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[(0,p.jsxs)(`div`,{className:`flex justify-between`,children:[(0,p.jsx)(`span`,{children:`Thème actuel:`}),(0,p.jsx)(`span`,{className:`font-medium`,children:E})]}),(0,p.jsxs)(`div`,{className:`flex justify-between`,children:[(0,p.jsx)(`span`,{children:`Mode sombre:`}),(0,p.jsx)(`span`,{className:`font-medium`,children:`Géré par le système`})]}),(0,p.jsxs)(`div`,{className:`flex justify-between`,children:[(0,p.jsx)(`span`,{children:`Thèmes disponibles:`}),(0,p.jsx)(`span`,{className:`font-medium`,children:D.length})]})]})]})})]}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsx)(r.Button,{onClick:J,className:`flex-1`,children:`Sauvegarder le thème`}),(0,p.jsxs)(r.Button,{variant:`outline`,onClick:()=>window.open(`https://tweakcn.com`,`_blank`),children:[(0,p.jsx)(d.ExternalLink,{className:`h-4 w-4 mr-2`}),`TweakCN`]})]})]}),S&&(0,p.jsx)(`div`,{className:`space-y-6`,children:(0,p.jsxs)(i.Card,{children:[(0,p.jsxs)(i.CardHeader,{children:[(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Palette,{className:`h-5 w-5`}),`Couleurs du thème`]}),(0,p.jsx)(i.CardDescription,{children:`Cliquez sur une couleur pour la modifier`})]}),(0,p.jsx)(i.CardContent,{children:(0,p.jsx)(`div`,{className:`grid grid-cols-2 gap-4`,children:Object.entries(k.colors).map(([e,t])=>(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(a.Label,{htmlFor:`color-${e}`,className:`text-sm font-medium`,children:e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase())}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsx)(`div`,{className:`w-10 h-10 rounded border border-border cursor-pointer`,style:{backgroundColor:t},onClick:()=>{document.getElementById(`color-${e}`)?.click()}}),(0,p.jsx)(o.Input,{id:`color-${e}`,type:`color`,value:t,onChange:t=>q(e,t.target.value),className:`flex-1 h-10`})]})]},e))})})]})})]}),y&&(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.CardHeader,{children:(0,p.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Eye,{className:`h-5 w-5`}),`Prévisualisation en temps réel`]})}),(0,p.jsx)(i.CardContent,{children:(0,p.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:[(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Boutons`}),(0,p.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,p.jsx)(r.Button,{size:`sm`,children:`Primary`}),(0,p.jsx)(r.Button,{variant:`secondary`,size:`sm`,children:`Secondary`}),(0,p.jsx)(r.Button,{variant:`outline`,size:`sm`,children:`Outline`}),(0,p.jsx)(r.Button,{variant:`destructive`,size:`sm`,children:`Destructive`})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Cards`}),(0,p.jsxs)(i.Card,{className:`p-3`,children:[(0,p.jsx)(i.CardTitle,{className:`text-sm`,children:`Exemple de carte`}),(0,p.jsx)(i.CardDescription,{className:`text-xs`,children:`Contenu de la carte avec le nouveau thème`})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Inputs`}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(o.Input,{placeholder:`Input normal`}),(0,p.jsx)(o.Input,{placeholder:`Input avec erreur`,className:`border-destructive`})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Badges`}),(0,p.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,p.jsx)(n.Badge,{children:`Default`}),(0,p.jsx)(n.Badge,{variant:`secondary`,children:`Secondary`}),(0,p.jsx)(n.Badge,{variant:`destructive`,children:`Destructive`}),(0,p.jsx)(n.Badge,{variant:`outline`,children:`Outline`})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Séparateur`}),(0,p.jsx)(s.Separator,{}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Texte avec couleur muted`})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`h4`,{className:`font-medium`,children:`Progress`}),(0,p.jsx)(`div`,{className:`w-full bg-muted rounded-full h-2`,children:(0,p.jsx)(`div`,{className:`bg-primary h-2 rounded-full`,style:{width:`60%`}})})]})]})})]})]})})});g.displayName=`WakaThemeManager`,exports.WakaThemeManager=g,exports.themeManagerVariants=h;
@@ -57,10 +57,13 @@ var k = T("w-full", {
57
57
  }
58
58
  }), [H, U] = h(!1), [W, G] = h(null), [K, q] = h(null), [J, le] = h(""), [Y, X] = h(!1), [Z, Q] = h("auto"), $ = ee((e) => {
59
59
  let t = document.documentElement;
60
- Object.entries(e.colors).forEach(([e, n]) => {
60
+ if (Object.entries(e.colors).forEach(([e, n]) => {
61
61
  let r = `--${e.replace(/([A-Z])/g, "-$1").toLowerCase()}`;
62
62
  t.style.setProperty(r, n);
63
- }), z && z(e.name.toLowerCase().replace(/\s+/g, "-"));
63
+ }), z) {
64
+ let t = e.name.toLowerCase().replace(/\s+/g, "-");
65
+ z(t);
66
+ }
64
67
  }, [z]), ue = async (e) => {
65
68
  U(!0), G(null), q(null);
66
69
  try {
@@ -1,4 +1,4 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`lucide-react`),i=require(`react/jsx-runtime`);function a(e){let t=Math.floor((new Date().getTime()-e.getTime())/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);if(i<7)return`${i}d ago`;let a=Math.floor(i/7);return a<4?`${a}w ago`:e.toLocaleDateString()}function o(e){let t=e.replies?.length||0;return e.replies?.forEach(e=>{t+=o(e)}),t}function s(e){return e.split(` `).map(e=>e[0]).join(``).toUpperCase().slice(0,2)}function c({participant:e,size:n=`md`,className:r}){return(0,i.jsx)(`div`,{className:t.cn(`relative flex items-center justify-center rounded-full font-semibold flex-shrink-0`,{sm:`h-6 w-6 text-[10px]`,md:`h-8 w-8 text-xs`,lg:`h-10 w-10 text-sm`}[n],e.avatar?``:`bg-muted text-muted-foreground`,r),children:e.avatar?(0,i.jsx)(`img`,{src:e.avatar,alt:e.name,className:`h-full w-full rounded-full object-cover`}):s(e.name)})}function l({participants:e,max:t=4}){let n=e.slice(0,t),r=e.length-t;return(0,i.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,i.jsx)(`div`,{className:`flex -space-x-2`,children:n.map(e=>(0,i.jsx)(c,{participant:e,size:`sm`,className:`ring-2 ring-background`},e.id))}),r>0&&(0,i.jsxs)(`span`,{className:`text-xs text-muted-foreground ml-1`,children:[`+`,r,` more`]})]})}function u({count:e,isExpanded:n,onClick:a}){return e===0?null:(0,i.jsxs)(`button`,{onClick:a,className:t.cn(`flex items-center gap-1.5 text-sm font-medium transition-colors`,`text-primary hover:text-primary/80`),children:[n?(0,i.jsx)(r.ChevronUp,{className:`h-4 w-4`}):(0,i.jsx)(r.ChevronDown,{className:`h-4 w-4`}),(0,i.jsxs)(`span`,{children:[e,` `,e===1?`reply`:`replies`]})]})}function d({message:e,depth:n,maxDepth:s,isCollapsed:l,onToggleCollapse:f,onReply:p,showReplyButton:m=!0}){let h=e.replies&&e.replies.length>0,g=h?o(e):0,_=n<s;return(0,i.jsxs)(`div`,{className:`group`,children:[(0,i.jsxs)(`div`,{className:t.cn(`flex gap-3 py-3 transition-colors`,n>0&&`hover:bg-accent/30 rounded-lg px-2 -mx-2`),children:[(0,i.jsx)(c,{participant:e.author,size:n===0?`lg`:`md`}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,i.jsx)(`span`,{className:`font-medium text-sm`,children:e.author.name}),(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a(new Date(e.timestamp))}),e.edited&&(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`(edited)`})]}),(0,i.jsx)(`p`,{className:`mt-1 text-sm text-foreground whitespace-pre-wrap`,children:e.content}),(0,i.jsxs)(`div`,{className:`mt-2 flex items-center gap-4`,children:[m&&p&&(0,i.jsxs)(`button`,{onClick:()=>p(e.id),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-primary transition-colors`,children:[(0,i.jsx)(r.Reply,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`Reply`})]}),h&&_&&(0,i.jsx)(u,{count:g,isExpanded:!l,onClick:()=>f(e.id)}),(0,i.jsx)(`button`,{className:`opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-foreground transition-all`,children:(0,i.jsx)(r.MoreHorizontal,{className:`h-4 w-4`})})]})]})]}),h&&!l&&_&&(0,i.jsx)(`div`,{className:t.cn(`ml-4 pl-4 border-l-2 border-border/50`,`animate-thread-expand`),children:e.replies.map(e=>(0,i.jsx)(d,{message:e,depth:n+1,maxDepth:s,isCollapsed:!1,onToggleCollapse:f,onReply:p,showReplyButton:m},e.id))}),h&&!_&&(0,i.jsx)(`div`,{className:`ml-11 mt-1 text-xs text-muted-foreground`,children:(0,i.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,i.jsx)(r.MessageSquare,{className:`h-3 w-3`}),g,` nested `,g===1?`reply`:`replies`]})})]})}function f({currentUser:e,onSubmit:a,placeholder:o=`Write a reply...`,disabled:s=!1,replyingTo:l,onCancelReply:u}){let[d,f]=n.useState(``),p=n.useRef(null),m=e=>{e.preventDefault(),d.trim()&&!s&&(a(d.trim()),f(``))};return n.useEffect(()=>{p.current&&(p.current.style.height=`auto`,p.current.style.height=`${Math.min(p.current.scrollHeight,150)}px`)},[d]),(0,i.jsxs)(`form`,{onSubmit:m,className:`flex gap-3`,children:[e&&(0,i.jsx)(c,{participant:e,size:`md`}),(0,i.jsxs)(`div`,{className:`flex-1 relative`,children:[l&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground mb-1`,children:[(0,i.jsx)(r.Reply,{className:`h-3 w-3`}),(0,i.jsx)(`span`,{children:`Replying to thread`}),(0,i.jsx)(`button`,{type:`button`,onClick:u,className:`hover:text-foreground`,children:`Cancel`})]}),(0,i.jsxs)(`div`,{className:`relative flex items-end gap-2 rounded-lg border bg-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2`,children:[(0,i.jsx)(`textarea`,{ref:p,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&m(e),e.key===`Escape`&&u&&u()},placeholder:o,disabled:s,rows:1,className:t.cn(`flex-1 resize-none bg-transparent px-3 py-2.5 text-sm`,`placeholder:text-muted-foreground focus:outline-none`,`disabled:cursor-not-allowed disabled:opacity-50`,`min-h-[40px] max-h-[150px]`)}),(0,i.jsx)(`button`,{type:`submit`,disabled:s||!d.trim(),className:t.cn(`flex-shrink-0 p-2.5 rounded-r-lg transition-colors`,`text-muted-foreground hover:text-primary`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:(0,i.jsx)(r.Send,{className:`h-4 w-4`})})]}),(0,i.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:`Press Cmd+Enter to send`})]})]})}function p({thread:e,showParticipants:n,onFollowToggle:a,onRefresh:o}){return(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-4 pb-4 border-b`,children:[(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[e.title&&(0,i.jsx)(`h2`,{className:`text-lg font-semibold mb-2`,children:e.title}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 flex-wrap`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,i.jsx)(r.MessageSquare,{className:`h-4 w-4`}),(0,i.jsxs)(`span`,{children:[e.replyCount,` `,e.replyCount===1?`reply`:`replies`]})]}),n&&e.participants.length>0&&(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,i.jsx)(r.Users,{className:`h-4 w-4 text-muted-foreground`}),(0,i.jsx)(l,{participants:e.participants,max:4})]}),e.isClosed&&(0,i.jsxs)(`div`,{className:`flex items-center gap-1 text-sm text-muted-foreground`,children:[(0,i.jsx)(r.Lock,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`Closed`})]})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.hasNewUpdates&&o&&(0,i.jsxs)(`button`,{onClick:o,className:t.cn(`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm`,`bg-primary/10 text-primary hover:bg-primary/20 transition-colors`,`animate-pulse`),children:[(0,i.jsx)(r.RefreshCw,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`New updates`})]}),a&&(0,i.jsx)(`button`,{onClick:a,className:t.cn(`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors`,e.isFollowing?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-muted text-muted-foreground hover:bg-muted/80`),children:e.isFollowing?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.BellOff,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`Following`})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Bell,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`Follow`})]})})]})]})}function m({thread:e,currentUser:a,onReply:o,onLoadMore:s,hasMoreReplies:c=!1,loading:l=!1,onFollowToggle:u,onRefresh:m,maxDepth:h=3,showParticipants:g=!0,enableReplies:_=!0,className:v}){let[y,b]=n.useState(new Set),[x,S]=n.useState(null);return(0,i.jsxs)(`div`,{className:t.cn(`flex flex-col`,v),children:[(0,i.jsx)(p,{thread:e,showParticipants:g,onFollowToggle:u,onRefresh:m}),(0,i.jsx)(`div`,{className:`py-4 border-b`,children:(0,i.jsx)(d,{message:e.parentMessage,depth:0,maxDepth:h,isCollapsed:y.has(e.parentMessage.id),onToggleCollapse:e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},onReply:_&&!e.isClosed?e=>{S(e)}:void 0,showReplyButton:_&&!e.isClosed})}),c&&(0,i.jsx)(`div`,{className:`py-3 border-b`,children:(0,i.jsx)(`button`,{onClick:s,disabled:l,className:t.cn(`flex items-center gap-2 text-sm text-primary hover:text-primary/80 transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Loader2,{className:`h-4 w-4 animate-spin`}),(0,i.jsx)(`span`,{children:`Loading...`})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.ChevronDown,{className:`h-4 w-4`}),(0,i.jsx)(`span`,{children:`Load more replies`})]})})}),l&&!c&&(0,i.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,i.jsx)(r.Loader2,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),_&&!e.isClosed&&(0,i.jsx)(`div`,{className:`pt-4 mt-auto`,children:(0,i.jsx)(f,{currentUser:a,onSubmit:e=>{o?.(e,x||void 0),S(null)},placeholder:x?`Write a reply...`:`Add a comment...`,replyingTo:x||void 0,onCancelReply:x?()=>{S(null)}:void 0})}),e.isClosed&&(0,i.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-6 text-muted-foreground`,children:[(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),(0,i.jsx)(`span`,{className:`text-sm`,children:`This thread is closed for new replies`})]}),(0,i.jsx)(`style`,{children:`
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime");function a(e){let t=Math.floor((new Date().getTime()-e.getTime())/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);if(i<7)return`${i}d ago`;let a=Math.floor(i/7);return a<4?`${a}w ago`:e.toLocaleDateString()}function o(e){let t=e.replies?.length||0;return e.replies?.forEach(e=>{t+=o(e)}),t}function s(e){return e.split(` `).map(e=>e[0]).join(``).toUpperCase().slice(0,2)}function c({participant:e,size:n=`md`,className:r}){return(0,i.jsx)(`div`,{className:t.cn(`relative flex items-center justify-center rounded-full font-semibold flex-shrink-0`,{sm:`h-6 w-6 text-[10px]`,md:`h-8 w-8 text-xs`,lg:`h-10 w-10 text-sm`}[n],e.avatar?``:`bg-muted text-muted-foreground`,r),children:e.avatar?(0,i.jsx)(`img`,{src:e.avatar,alt:e.name,className:`h-full w-full rounded-full object-cover`}):s(e.name)})}function l({participants:e,max:t=4}){let n=e.slice(0,t),r=e.length-t;return(0,i.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,i.jsx)(`div`,{className:`flex -space-x-2`,children:n.map(e=>(0,i.jsx)(c,{participant:e,size:`sm`,className:`ring-2 ring-background`},e.id))}),r>0&&(0,i.jsxs)(`span`,{className:`text-xs text-muted-foreground ml-1`,children:[`+`,r,` more`]})]})}function u({count:e,isExpanded:n,onClick:a}){return e===0?null:(0,i.jsxs)(`button`,{onClick:a,className:t.cn(`flex items-center gap-1.5 text-sm font-medium transition-colors`,`text-primary hover:text-primary/80`),children:[n?(0,i.jsx)(r.ChevronUp,{className:`h-4 w-4`}):(0,i.jsx)(r.ChevronDown,{className:`h-4 w-4`}),(0,i.jsxs)(`span`,{children:[e,` `,e===1?`reply`:`replies`]})]})}function d({message:e,depth:n,maxDepth:s,isCollapsed:l,onToggleCollapse:f,onReply:p,showReplyButton:m=!0}){let h=e.replies&&e.replies.length>0,g=h?o(e):0,_=n<s;return(0,i.jsxs)(`div`,{className:`group`,children:[(0,i.jsxs)(`div`,{className:t.cn(`flex gap-3 py-3 transition-colors`,n>0&&`hover:bg-accent/30 rounded-lg px-2 -mx-2`),children:[(0,i.jsx)(c,{participant:e.author,size:n===0?`lg`:`md`}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,i.jsx)(`span`,{className:`font-medium text-sm`,children:e.author.name}),(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a(new Date(e.timestamp))}),e.edited&&(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`(edited)`})]}),(0,i.jsx)(`p`,{className:`mt-1 text-sm text-foreground whitespace-pre-wrap`,children:e.content}),(0,i.jsxs)(`div`,{className:`mt-2 flex items-center gap-4`,children:[m&&p&&(0,i.jsxs)(`button`,{onClick:()=>p(e.id),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-primary transition-colors`,children:[(0,i.jsx)(r.Reply,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`Reply`})]}),h&&_&&(0,i.jsx)(u,{count:g,isExpanded:!l,onClick:()=>f(e.id)}),(0,i.jsx)(`button`,{className:`opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-foreground transition-all`,children:(0,i.jsx)(r.MoreHorizontal,{className:`h-4 w-4`})})]})]})]}),h&&!l&&_&&(0,i.jsx)(`div`,{className:t.cn(`ml-4 pl-4 border-l-2 border-border/50`,`animate-thread-expand`),children:e.replies.map(e=>(0,i.jsx)(d,{message:e,depth:n+1,maxDepth:s,isCollapsed:!1,onToggleCollapse:f,onReply:p,showReplyButton:m},e.id))}),h&&!_&&(0,i.jsx)(`div`,{className:`ml-11 mt-1 text-xs text-muted-foreground`,children:(0,i.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,i.jsx)(r.MessageSquare,{className:`h-3 w-3`}),g,` nested `,g===1?`reply`:`replies`]})})]})}function f({currentUser:e,onSubmit:a,placeholder:o=`Write a reply...`,disabled:s=!1,replyingTo:l,onCancelReply:u}){let[d,f]=n.useState(``),p=n.useRef(null),m=e=>{e.preventDefault(),d.trim()&&!s&&(a(d.trim()),f(``))};return n.useEffect(()=>{p.current&&(p.current.style.height=`auto`,p.current.style.height=`${Math.min(p.current.scrollHeight,150)}px`)},[d]),(0,i.jsxs)(`form`,{onSubmit:m,className:`flex gap-3`,children:[e&&(0,i.jsx)(c,{participant:e,size:`md`}),(0,i.jsxs)(`div`,{className:`flex-1 relative`,children:[l&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground mb-1`,children:[(0,i.jsx)(r.Reply,{className:`h-3 w-3`}),(0,i.jsx)(`span`,{children:`Replying to thread`}),(0,i.jsx)(`button`,{type:`button`,onClick:u,className:`hover:text-foreground`,children:`Cancel`})]}),(0,i.jsxs)(`div`,{className:`relative flex items-end gap-2 rounded-lg border bg-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2`,children:[(0,i.jsx)(`textarea`,{ref:p,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&m(e),e.key===`Escape`&&u&&u()},placeholder:o,disabled:s,rows:1,className:t.cn(`flex-1 resize-none bg-transparent px-3 py-2.5 text-sm`,`placeholder:text-muted-foreground focus:outline-none`,`disabled:cursor-not-allowed disabled:opacity-50`,`min-h-[40px] max-h-[150px]`)}),(0,i.jsx)(`button`,{type:`submit`,disabled:s||!d.trim(),className:t.cn(`flex-shrink-0 p-2.5 rounded-r-lg transition-colors`,`text-muted-foreground hover:text-primary`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:(0,i.jsx)(r.Send,{className:`h-4 w-4`})})]}),(0,i.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:`Press Cmd+Enter to send`})]})]})}function p({thread:e,showParticipants:n,onFollowToggle:a,onRefresh:o}){return(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-4 pb-4 border-b`,children:[(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[e.title&&(0,i.jsx)(`h2`,{className:`text-lg font-semibold mb-2`,children:e.title}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 flex-wrap`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,i.jsx)(r.MessageSquare,{className:`h-4 w-4`}),(0,i.jsxs)(`span`,{children:[e.replyCount,` `,e.replyCount===1?`reply`:`replies`]})]}),n&&e.participants.length>0&&(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,i.jsx)(r.Users,{className:`h-4 w-4 text-muted-foreground`}),(0,i.jsx)(l,{participants:e.participants,max:4})]}),e.isClosed&&(0,i.jsxs)(`div`,{className:`flex items-center gap-1 text-sm text-muted-foreground`,children:[(0,i.jsx)(r.Lock,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`Closed`})]})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.hasNewUpdates&&o&&(0,i.jsxs)(`button`,{onClick:o,className:t.cn(`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm`,`bg-primary/10 text-primary hover:bg-primary/20 transition-colors`,`animate-pulse`),children:[(0,i.jsx)(r.RefreshCw,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`New updates`})]}),a&&(0,i.jsx)(`button`,{onClick:a,className:t.cn(`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors`,e.isFollowing?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-muted text-muted-foreground hover:bg-muted/80`),children:e.isFollowing?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.BellOff,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`Following`})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Bell,{className:`h-3.5 w-3.5`}),(0,i.jsx)(`span`,{children:`Follow`})]})})]})]})}function m({thread:e,currentUser:a,onReply:o,onLoadMore:s,hasMoreReplies:c=!1,loading:l=!1,onFollowToggle:u,onRefresh:m,maxDepth:h=3,showParticipants:g=!0,enableReplies:_=!0,className:v}){let[y,b]=n.useState(new Set),[x,S]=n.useState(null);return(0,i.jsxs)(`div`,{className:t.cn(`flex flex-col`,v),children:[(0,i.jsx)(p,{thread:e,showParticipants:g,onFollowToggle:u,onRefresh:m}),(0,i.jsx)(`div`,{className:`py-4 border-b`,children:(0,i.jsx)(d,{message:e.parentMessage,depth:0,maxDepth:h,isCollapsed:y.has(e.parentMessage.id),onToggleCollapse:e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},onReply:_&&!e.isClosed?e=>{S(e)}:void 0,showReplyButton:_&&!e.isClosed})}),c&&(0,i.jsx)(`div`,{className:`py-3 border-b`,children:(0,i.jsx)(`button`,{onClick:s,disabled:l,className:t.cn(`flex items-center gap-2 text-sm text-primary hover:text-primary/80 transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Loader2,{className:`h-4 w-4 animate-spin`}),(0,i.jsx)(`span`,{children:`Loading...`})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.ChevronDown,{className:`h-4 w-4`}),(0,i.jsx)(`span`,{children:`Load more replies`})]})})}),l&&!c&&(0,i.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,i.jsx)(r.Loader2,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),_&&!e.isClosed&&(0,i.jsx)(`div`,{className:`pt-4 mt-auto`,children:(0,i.jsx)(f,{currentUser:a,onSubmit:e=>{o?.(e,x||void 0),S(null)},placeholder:x?`Write a reply...`:`Add a comment...`,replyingTo:x||void 0,onCancelReply:x?()=>{S(null)}:void 0})}),e.isClosed&&(0,i.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-6 text-muted-foreground`,children:[(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),(0,i.jsx)(`span`,{className:`text-sm`,children:`This thread is closed for new replies`})]}),(0,i.jsx)(`style`,{children:`
2
2
  @keyframes thread-expand {
3
3
  0% {
4
4
  opacity: 0;
@@ -15,4 +15,4 @@
15
15
  animation: thread-expand 0.3s ease-out forwards;
16
16
  overflow: hidden;
17
17
  }
18
- `})]})}function h({initialThread:e,maxReplies:t=100}={}){let[r,i]=n.useState(e||null),[a,o]=n.useState(!1),[s,c]=n.useState(new Set),l=n.useCallback(e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=n.useCallback(e=>s.has(e),[s]);return{thread:r,loading:a,collapsedThreads:s,toggleCollapse:l,addReply:n.useCallback((e,n)=>{if(!r)return;let a={id:`reply-${Date.now()}`,author:r.participants[0]||{id:`current-user`,name:`You`},content:e,timestamp:new Date,replies:[]},o=(e,n)=>!n||e.id===n?{...e,replies:[...e.replies||[],a].slice(-t)}:e.replies?{...e,replies:e.replies.map(e=>o(e,n))}:e;i(e=>e&&{...e,parentMessage:o(e.parentMessage,n),replyCount:e.replyCount+1})},[r,t]),setThread:n.useCallback(e=>{i(e)},[]),toggleFollow:n.useCallback(()=>{i(e=>e&&{...e,isFollowing:!e.isFollowing})},[]),setHasNewUpdates:n.useCallback(e=>{i(t=>t&&{...t,hasNewUpdates:e})},[]),setLoading:o,isCollapsed:u}}exports.default=m,exports.useThreadView=h;
18
+ `})]})}function h({initialThread:e,maxReplies:t=100}={}){let[r,i]=n.useState(e||null),[a,o]=n.useState(!1),[s,c]=n.useState(new Set),l=n.useCallback(e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=n.useCallback(e=>s.has(e),[s]);return{thread:r,loading:a,collapsedThreads:s,toggleCollapse:l,addReply:n.useCallback((e,n)=>{if(!r)return;let a={id:`reply-${Date.now()}`,author:r.participants[0]||{id:`current-user`,name:`You`},content:e,timestamp:new Date,replies:[]},o=(e,n)=>!n||e.id===n?{...e,replies:[...e.replies||[],a].slice(-t)}:e.replies?{...e,replies:e.replies.map(e=>o(e,n))}:e;i(e=>e&&{...e,parentMessage:o(e.parentMessage,n),replyCount:e.replyCount+1})},[r,t]),setThread:n.useCallback(e=>{i(e)},[]),toggleFollow:n.useCallback(()=>{i(e=>e&&{...e,isFollowing:!e.isFollowing})},[]),setHasNewUpdates:n.useCallback(e=>{i(t=>t&&{...t,hasNewUpdates:e})},[]),setLoading:o,isCollapsed:u}}exports.WakaThreadView=m,exports.default=m,exports.useThreadView=h;
@@ -381,4 +381,4 @@ function D({ initialThread: e, maxReplies: n = 100 } = {}) {
381
381
  };
382
382
  }
383
383
  //#endregion
384
- export { E as default, D as useThreadView };
384
+ export { E as WakaThreadView, E as default, D as useThreadView };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);function i({maxTilt:e=15,perspective:i=1e3,scale:a=1.02,speed:o=400,disabled:s=!1,glare:c=!0,maxGlare:l=.2,reset:u=!0,reverse:d=!1,gyroscope:f=!1,className:p,children:m,style:h,...g}){let _=n.useRef(null),[v,y]=n.useState({x:0,y:0}),[b,x]=n.useState({x:50,y:50}),[S,C]=n.useState(!1),w=d?-1:1,T=n.useCallback(t=>{if(s||!_.current)return;let n=_.current.getBoundingClientRect(),r=n.width,i=n.height,a=(t.clientX-n.left)/r,o=(t.clientY-n.top)/i;y({x:(o-.5)*e*2*w,y:(a-.5)*e*2*w*-1}),x({x:a*100,y:o*100})},[s,e,w]),E=()=>{s||C(!0)},D=()=>{u&&(y({x:0,y:0}),x({x:50,y:50})),C(!1)};n.useEffect(()=>{if(!f||s||typeof window>`u`)return;let t=t=>{t.gamma===null||t.beta===null||y({x:Math.min(Math.max(t.beta,-e),e)*w,y:Math.min(Math.max(t.gamma,-e),e)*w*-1})};return window.addEventListener(`deviceorientation`,t),()=>window.removeEventListener(`deviceorientation`,t)},[f,s,e,w]);let O={perspective:`${i}px`,...h},k={transform:`rotateX(${v.x}deg) rotateY(${v.y}deg) scale(${S?a:1})`,transition:`transform ${o}ms cubic-bezier(0.03, 0.98, 0.52, 0.99)`,transformStyle:`preserve-3d`},A={position:`absolute`,inset:0,borderRadius:`inherit`,background:`radial-gradient(circle at ${b.x}% ${b.y}%, rgba(255,255,255,${l}), transparent 60%)`,opacity:+!!S,transition:`opacity ${o}ms ease`,pointerEvents:`none`};return(0,r.jsx)(`div`,{ref:_,className:t.cn(`relative`,p),style:O,onMouseMove:T,onMouseEnter:E,onMouseLeave:D,...g,children:(0,r.jsxs)(`div`,{style:k,className:`relative`,children:[m,c&&(0,r.jsx)(`div`,{style:A})]})})}function a({title:e,description:n,icon:a,image:o,footer:s,className:c,glowColor:l=`hsl(var(--primary))`}){return(0,r.jsx)(i,{className:t.cn(`group cursor-pointer`,c),maxTilt:10,glare:!0,children:(0,r.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border bg-card shadow-lg`,children:[(0,r.jsx)(`div`,{className:`absolute -inset-px rounded-xl opacity-0 blur-xl transition-opacity duration-500 group-hover:opacity-30`,style:{background:l}}),o&&(0,r.jsxs)(`div`,{className:`relative h-48 overflow-hidden`,children:[(0,r.jsx)(`img`,{src:o,alt:e,className:`h-full w-full object-cover transition-transform duration-500 group-hover:scale-105`}),(0,r.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-t from-card to-transparent`})]}),(0,r.jsxs)(`div`,{className:`relative p-6`,style:{transform:`translateZ(30px)`},children:[a&&(0,r.jsx)(`div`,{className:`mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg`,style:{background:`linear-gradient(135deg, ${l}20, ${l}10)`,transform:`translateZ(20px)`},children:a}),(0,r.jsx)(`h3`,{className:`text-xl font-semibold`,style:{transform:`translateZ(40px)`},children:e}),n&&(0,r.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,style:{transform:`translateZ(25px)`},children:n}),s&&(0,r.jsx)(`div`,{className:`mt-4 pt-4 border-t`,style:{transform:`translateZ(20px)`},children:s})]}),(0,r.jsx)(`div`,{className:`absolute -right-4 -top-4 h-24 w-24 rounded-full opacity-5`,style:{background:l,transform:`translateZ(60px)`}})]})})}exports.WakaTiltCard=i,exports.WakaTiltShowcaseCard=a;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("react/jsx-runtime");function i({maxTilt:e=15,perspective:i=1e3,scale:a=1.02,speed:o=400,disabled:s=!1,glare:c=!0,maxGlare:l=.2,reset:u=!0,reverse:d=!1,gyroscope:f=!1,className:p,children:m,style:h,...g}){let _=n.useRef(null),[v,y]=n.useState({x:0,y:0}),[b,x]=n.useState({x:50,y:50}),[S,C]=n.useState(!1),w=d?-1:1,T=n.useCallback(t=>{if(s||!_.current)return;let n=_.current.getBoundingClientRect(),r=n.width,i=n.height,a=(t.clientX-n.left)/r,o=(t.clientY-n.top)/i,c=(o-.5)*e*2*w,l=(a-.5)*e*2*w*-1;y({x:c,y:l}),x({x:a*100,y:o*100})},[s,e,w]),E=()=>{s||C(!0)},D=()=>{u&&(y({x:0,y:0}),x({x:50,y:50})),C(!1)};n.useEffect(()=>{if(!f||s||typeof window>`u`)return;let t=t=>{if(t.gamma===null||t.beta===null)return;let n=Math.min(Math.max(t.beta,-e),e)*w,r=Math.min(Math.max(t.gamma,-e),e)*w*-1;y({x:n,y:r})};return window.addEventListener(`deviceorientation`,t),()=>window.removeEventListener(`deviceorientation`,t)},[f,s,e,w]);let O={perspective:`${i}px`,...h},k={transform:`rotateX(${v.x}deg) rotateY(${v.y}deg) scale(${S?a:1})`,transition:`transform ${o}ms cubic-bezier(0.03, 0.98, 0.52, 0.99)`,transformStyle:`preserve-3d`},A={position:`absolute`,inset:0,borderRadius:`inherit`,background:`radial-gradient(circle at ${b.x}% ${b.y}%, rgba(255,255,255,${l}), transparent 60%)`,opacity:+!!S,transition:`opacity ${o}ms ease`,pointerEvents:`none`};return(0,r.jsx)(`div`,{ref:_,className:t.cn(`relative`,p),style:O,onMouseMove:T,onMouseEnter:E,onMouseLeave:D,...g,children:(0,r.jsxs)(`div`,{style:k,className:`relative`,children:[m,c&&(0,r.jsx)(`div`,{style:A})]})})}function a({title:e,description:n,icon:a,image:o,footer:s,className:c,glowColor:l=`hsl(var(--primary))`}){return(0,r.jsx)(i,{className:t.cn(`group cursor-pointer`,c),maxTilt:10,glare:!0,children:(0,r.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border bg-card shadow-lg`,children:[(0,r.jsx)(`div`,{className:`absolute -inset-px rounded-xl opacity-0 blur-xl transition-opacity duration-500 group-hover:opacity-30`,style:{background:l}}),o&&(0,r.jsxs)(`div`,{className:`relative h-48 overflow-hidden`,children:[(0,r.jsx)(`img`,{src:o,alt:e,className:`h-full w-full object-cover transition-transform duration-500 group-hover:scale-105`}),(0,r.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-t from-card to-transparent`})]}),(0,r.jsxs)(`div`,{className:`relative p-6`,style:{transform:`translateZ(30px)`},children:[a&&(0,r.jsx)(`div`,{className:`mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg`,style:{background:`linear-gradient(135deg, ${l}20, ${l}10)`,transform:`translateZ(20px)`},children:a}),(0,r.jsx)(`h3`,{className:`text-xl font-semibold`,style:{transform:`translateZ(40px)`},children:e}),n&&(0,r.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,style:{transform:`translateZ(25px)`},children:n}),s&&(0,r.jsx)(`div`,{className:`mt-4 pt-4 border-t`,style:{transform:`translateZ(20px)`},children:s})]}),(0,r.jsx)(`div`,{className:`absolute -right-4 -top-4 h-24 w-24 rounded-full opacity-5`,style:{background:l,transform:`translateZ(60px)`}})]})})}exports.WakaTiltCard=i,exports.WakaTiltShowcaseCard=a;
@@ -13,10 +13,10 @@ function i({ maxTilt: i = 15, perspective: a = 1e3, scale: o = 1.02, speed: s =
13
13
  y: 50
14
14
  }), [C, w] = t.useState(!1), T = f ? -1 : 1, E = t.useCallback((e) => {
15
15
  if (c || !v.current) return;
16
- let t = v.current.getBoundingClientRect(), n = t.width, r = t.height, a = (e.clientX - t.left) / n, o = (e.clientY - t.top) / r;
16
+ let t = v.current.getBoundingClientRect(), n = t.width, r = t.height, a = (e.clientX - t.left) / n, o = (e.clientY - t.top) / r, s = (o - .5) * i * 2 * T, l = (a - .5) * i * 2 * T * -1;
17
17
  b({
18
- x: (o - .5) * i * 2 * T,
19
- y: (a - .5) * i * 2 * T * -1
18
+ x: s,
19
+ y: l
20
20
  }), S({
21
21
  x: a * 100,
22
22
  y: o * 100
@@ -39,9 +39,11 @@ function i({ maxTilt: i = 15, perspective: a = 1e3, scale: o = 1.02, speed: s =
39
39
  t.useEffect(() => {
40
40
  if (!p || c || typeof window > "u") return;
41
41
  let e = (e) => {
42
- e.gamma === null || e.beta === null || b({
43
- x: Math.min(Math.max(e.beta, -i), i) * T,
44
- y: Math.min(Math.max(e.gamma, -i), i) * T * -1
42
+ if (e.gamma === null || e.beta === null) return;
43
+ let t = Math.min(Math.max(e.beta, -i), i) * T, n = Math.min(Math.max(e.gamma, -i), i) * T * -1;
44
+ b({
45
+ x: t,
46
+ y: n
45
47
  });
46
48
  };
47
49
  return window.addEventListener("deviceorientation", e), () => window.removeEventListener("deviceorientation", e);
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../button/index.cjs.js`),r=require(`../input/index.cjs.js`),i=require(`../popover/index.cjs.js`);let a=require(`react`);a=e.__toESM(a);let o=require(`lucide-react`),s=require(`react/jsx-runtime`);function c(e){let t=e.split(`:`);return{hours:parseInt(t[0]||`0`,10),minutes:parseInt(t[1]||`0`,10),seconds:parseInt(t[2]||`0`,10)}}function l(e,t,n,r){let i=e.toString().padStart(2,`0`),a=t.toString().padStart(2,`0`),o=n.toString().padStart(2,`0`);return r?`${i}:${a}:${o}`:`${i}:${a}`}function u(e){let t=e>=12?`PM`:`AM`,n=e%12;return n===0&&(n=12),{display:n,period:t}}function d(e,t){return t===`AM`?e===12?0:e:e===12?12:e+12}function f(e,t,n,r,i){let a=e*3600+t*60+n;if(r){let e=c(r);if(a<e.hours*3600+e.minutes*60+e.seconds)return!1}if(i){let e=c(i);if(a>e.hours*3600+e.minutes*60+e.seconds)return!1}return!0}function p({value:e,onChange:t,max:r,step:i=1,disabled:c,label:l}){let u=a.useMemo(()=>{let e=[];for(let t=0;t<r;t+=i)e.push(t);return e},[r,i]);return(0,s.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,s.jsx)(`span`,{className:`text-xs text-muted-foreground mb-1`,children:l}),(0,s.jsx)(n.Button,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-8`,onClick:()=>{t(u[(u.indexOf(e)+1)%u.length])},disabled:c,tabIndex:-1,children:(0,s.jsx)(o.ChevronUp,{className:`h-4 w-4`})}),(0,s.jsx)(`div`,{className:`h-10 w-12 flex items-center justify-center text-lg font-medium`,children:e.toString().padStart(2,`0`)}),(0,s.jsx)(n.Button,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-8`,onClick:()=>{let n=u.indexOf(e);t(u[n===0?u.length-1:n-1])},disabled:c,tabIndex:-1,children:(0,s.jsx)(o.ChevronDown,{className:`h-4 w-4`})})]})}function m({value:e,onChange:t,disabled:r}){return(0,s.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,s.jsx)(n.Button,{type:`button`,variant:e===`AM`?`default`:`ghost`,size:`sm`,className:`h-7 px-2`,onClick:()=>t(`AM`),disabled:r,children:`AM`}),(0,s.jsx)(n.Button,{type:`button`,variant:e===`PM`?`default`:`ghost`,size:`sm`,className:`h-7 px-2`,onClick:()=>t(`PM`),disabled:r,children:`PM`})]})}function h({value:e,onChange:h,placeholder:g=`Sélectionner une heure`,format:_=`24h`,showSeconds:v=!1,minuteStep:y=1,secondStep:b=1,minTime:x,maxTime:S,disabled:C=!1,error:w=!1,size:T=`md`,className:E,id:D,name:O}){let[k,A]=a.useState(!1),[j,M]=a.useState(e||``),N=e?c(e):{hours:0,minutes:0,seconds:0},[P,F]=a.useState(N.hours),[I,L]=a.useState(N.minutes),[R,z]=a.useState(N.seconds),[B,V]=a.useState(N.hours>=12?`PM`:`AM`);a.useEffect(()=>{if(e){let t=c(e);F(t.hours),L(t.minutes),z(t.seconds),V(t.hours>=12?`PM`:`AM`),M(e)}},[e]);let H=a.useMemo(()=>{if(!e)return``;if(_===`12h`){let{display:e,period:t}=u(P);return`${e.toString().padStart(2,`0`)}:${I.toString().padStart(2,`0`)}${v?`:${R.toString().padStart(2,`0`)}`:``} ${t}`}return l(P,I,R,v)},[e,P,I,R,_,v]),U=(e,t,n)=>{if(!f(e,t,n,x,S))return;F(e),L(t),z(n);let r=l(e,t,n,v);h?.(r)},W=e=>{U(_===`12h`?d(e,B):e,I,R)},G=e=>{U(P,e,R)},K=e=>{U(P,I,e)},q=e=>{V(e),U(d(P%12||12,e),I,R)},J=e=>{let t=e.target.value;M(t);let n=v?/^(\d{1,2}):(\d{2}):(\d{2})$/:/^(\d{1,2}):(\d{2})$/,r=t.match(n);if(r){let e=parseInt(r[1],10),t=parseInt(r[2],10),n=v?parseInt(r[3],10):0;e>=0&&e<24&&t>=0&&t<60&&n>=0&&n<60&&U(e,t,n)}},Y={sm:`h-8 text-xs`,md:`h-9 text-sm`,lg:`h-10 text-base`},X={sm:`h-3 w-3`,md:`h-4 w-4`,lg:`h-5 w-5`},Z=_===`12h`?P%12||12:P;return(0,s.jsxs)(i.Popover,{open:k,onOpenChange:A,children:[(0,s.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,s.jsxs)(`div`,{className:t.cn(`relative`,E),children:[(0,s.jsx)(r.Input,{id:D,name:O,value:H,onChange:J,placeholder:g,disabled:C,className:t.cn(Y[T],`pr-10`,w&&`border-destructive focus-visible:ring-destructive`)}),(0,s.jsx)(n.Button,{type:`button`,variant:`ghost`,size:`icon`,className:t.cn(`absolute right-0 top-0 h-full px-2`,C&&`pointer-events-none opacity-50`),onClick:()=>!C&&A(!k),tabIndex:-1,children:(0,s.jsx)(o.Clock,{className:X[T]})})]})}),(0,s.jsxs)(i.PopoverContent,{className:`w-auto p-4`,align:`start`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsx)(p,{value:Z,onChange:W,max:_===`12h`?13:24,disabled:C,label:`Heures`}),(0,s.jsx)(`span`,{className:`text-xl font-medium`,children:`:`}),(0,s.jsx)(p,{value:I,onChange:G,max:60,step:y,disabled:C,label:`Minutes`}),v&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-xl font-medium`,children:`:`}),(0,s.jsx)(p,{value:R,onChange:K,max:60,step:b,disabled:C,label:`Secondes`})]}),_===`12h`&&(0,s.jsx)(`div`,{className:`ml-2`,children:(0,s.jsx)(m,{value:B,onChange:q,disabled:C})})]}),(0,s.jsxs)(`div`,{className:`flex gap-2 mt-4 pt-4 border-t`,children:[(0,s.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{let e=new Date;U(e.getHours(),e.getMinutes(),e.getSeconds())},disabled:C,children:`Maintenant`}),(0,s.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>U(0,0,0),disabled:C,children:`00:00`}),(0,s.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>U(12,0,0),disabled:C,children:`12:00`})]})]})]})}function g(e={}){let{initialValue:t=``,format:n=`24h`,showSeconds:r=!1}=e,[i,o]=a.useState(t);return{value:i,onChange:o,clear:()=>o(``),setNow:()=>{let e=new Date,t=e.getHours().toString().padStart(2,`0`),n=e.getMinutes().toString().padStart(2,`0`),i=e.getSeconds().toString().padStart(2,`0`);o(r?`${t}:${n}:${i}`:`${t}:${n}`)},format:n,showSeconds:r}}exports.default=h,exports.useTimePicker=g;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../button/index.cjs.js"),r=require("../input/index.cjs.js"),i=require("../popover/index.cjs.js");let a=require("react");a=e.__toESM(a);let o=require("lucide-react"),s=require("react/jsx-runtime");function c(e){let t=e.split(`:`);return{hours:parseInt(t[0]||`0`,10),minutes:parseInt(t[1]||`0`,10),seconds:parseInt(t[2]||`0`,10)}}function l(e,t,n,r){let i=e.toString().padStart(2,`0`),a=t.toString().padStart(2,`0`),o=n.toString().padStart(2,`0`);return r?`${i}:${a}:${o}`:`${i}:${a}`}function u(e){let t=e>=12?`PM`:`AM`,n=e%12;return n===0&&(n=12),{display:n,period:t}}function d(e,t){return t===`AM`?e===12?0:e:e===12?12:e+12}function f(e,t,n,r,i){let a=e*3600+t*60+n;if(r){let e=c(r);if(a<e.hours*3600+e.minutes*60+e.seconds)return!1}if(i){let e=c(i);if(a>e.hours*3600+e.minutes*60+e.seconds)return!1}return!0}function p({value:e,onChange:t,max:r,step:i=1,disabled:c,label:l}){let u=a.useMemo(()=>{let e=[];for(let t=0;t<r;t+=i)e.push(t);return e},[r,i]);return(0,s.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,s.jsx)(`span`,{className:`text-xs text-muted-foreground mb-1`,children:l}),(0,s.jsx)(n.Button,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-8`,onClick:()=>{let n=(u.indexOf(e)+1)%u.length;t(u[n])},disabled:c,tabIndex:-1,children:(0,s.jsx)(o.ChevronUp,{className:`h-4 w-4`})}),(0,s.jsx)(`div`,{className:`h-10 w-12 flex items-center justify-center text-lg font-medium`,children:e.toString().padStart(2,`0`)}),(0,s.jsx)(n.Button,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-8`,onClick:()=>{let n=u.indexOf(e),r=n===0?u.length-1:n-1;t(u[r])},disabled:c,tabIndex:-1,children:(0,s.jsx)(o.ChevronDown,{className:`h-4 w-4`})})]})}function m({value:e,onChange:t,disabled:r}){return(0,s.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,s.jsx)(n.Button,{type:`button`,variant:e===`AM`?`default`:`ghost`,size:`sm`,className:`h-7 px-2`,onClick:()=>t(`AM`),disabled:r,children:`AM`}),(0,s.jsx)(n.Button,{type:`button`,variant:e===`PM`?`default`:`ghost`,size:`sm`,className:`h-7 px-2`,onClick:()=>t(`PM`),disabled:r,children:`PM`})]})}function h({value:e,onChange:h,placeholder:g=`Sélectionner une heure`,format:_=`24h`,showSeconds:v=!1,minuteStep:y=1,secondStep:b=1,minTime:x,maxTime:S,disabled:C=!1,error:w=!1,size:T=`md`,className:E,id:D,name:O}){let[k,A]=a.useState(!1),[j,M]=a.useState(e||``),N=e?c(e):{hours:0,minutes:0,seconds:0},[P,F]=a.useState(N.hours),[I,L]=a.useState(N.minutes),[R,z]=a.useState(N.seconds),[B,V]=a.useState(N.hours>=12?`PM`:`AM`);a.useEffect(()=>{if(e){let t=c(e);F(t.hours),L(t.minutes),z(t.seconds),V(t.hours>=12?`PM`:`AM`),M(e)}},[e]);let H=a.useMemo(()=>{if(!e)return``;if(_===`12h`){let{display:e,period:t}=u(P);return`${e.toString().padStart(2,`0`)}:${I.toString().padStart(2,`0`)}${v?`:${R.toString().padStart(2,`0`)}`:``} ${t}`}return l(P,I,R,v)},[e,P,I,R,_,v]),U=(e,t,n)=>{if(!f(e,t,n,x,S))return;F(e),L(t),z(n);let r=l(e,t,n,v);h?.(r)},W=e=>{let t=_===`12h`?d(e,B):e;U(t,I,R)},G=e=>{U(P,e,R)},K=e=>{U(P,I,e)},q=e=>{V(e);let t=d(P%12||12,e);U(t,I,R)},J=e=>{let t=e.target.value;M(t);let n=v?/^(\d{1,2}):(\d{2}):(\d{2})$/:/^(\d{1,2}):(\d{2})$/,r=t.match(n);if(r){let e=parseInt(r[1],10),t=parseInt(r[2],10),n=v?parseInt(r[3],10):0;e>=0&&e<24&&t>=0&&t<60&&n>=0&&n<60&&U(e,t,n)}},Y={sm:`h-8 text-xs`,md:`h-9 text-sm`,lg:`h-10 text-base`},X={sm:`h-3 w-3`,md:`h-4 w-4`,lg:`h-5 w-5`},Z=_===`12h`?P%12||12:P;return(0,s.jsxs)(i.Popover,{open:k,onOpenChange:A,children:[(0,s.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,s.jsxs)(`div`,{className:t.cn(`relative`,E),children:[(0,s.jsx)(r.Input,{id:D,name:O,value:H,onChange:J,placeholder:g,disabled:C,className:t.cn(Y[T],`pr-10`,w&&`border-destructive focus-visible:ring-destructive`)}),(0,s.jsx)(n.Button,{type:`button`,variant:`ghost`,size:`icon`,className:t.cn(`absolute right-0 top-0 h-full px-2`,C&&`pointer-events-none opacity-50`),onClick:()=>!C&&A(!k),tabIndex:-1,children:(0,s.jsx)(o.Clock,{className:X[T]})})]})}),(0,s.jsxs)(i.PopoverContent,{className:`w-auto p-4`,align:`start`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsx)(p,{value:Z,onChange:W,max:_===`12h`?13:24,disabled:C,label:`Heures`}),(0,s.jsx)(`span`,{className:`text-xl font-medium`,children:`:`}),(0,s.jsx)(p,{value:I,onChange:G,max:60,step:y,disabled:C,label:`Minutes`}),v&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-xl font-medium`,children:`:`}),(0,s.jsx)(p,{value:R,onChange:K,max:60,step:b,disabled:C,label:`Secondes`})]}),_===`12h`&&(0,s.jsx)(`div`,{className:`ml-2`,children:(0,s.jsx)(m,{value:B,onChange:q,disabled:C})})]}),(0,s.jsxs)(`div`,{className:`flex gap-2 mt-4 pt-4 border-t`,children:[(0,s.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{let e=new Date;U(e.getHours(),e.getMinutes(),e.getSeconds())},disabled:C,children:`Maintenant`}),(0,s.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>U(0,0,0),disabled:C,children:`00:00`}),(0,s.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>U(12,0,0),disabled:C,children:`12:00`})]})]})]})}function g(e={}){let{initialValue:t=``,format:n=`24h`,showSeconds:r=!1}=e,[i,o]=a.useState(t);return{value:i,onChange:o,clear:()=>o(``),setNow:()=>{let e=new Date,t=e.getHours().toString().padStart(2,`0`),n=e.getMinutes().toString().padStart(2,`0`),i=e.getSeconds().toString().padStart(2,`0`);o(r?`${t}:${n}:${i}`:`${t}:${n}`)},format:n,showSeconds:r}}exports.WakaTimePicker=h,exports.default=h,exports.useTimePicker=g;
@@ -61,7 +61,8 @@ function v({ value: e, onChange: n, max: r, step: i = 1, disabled: a, label: l }
61
61
  size: "icon",
62
62
  className: "h-6 w-8",
63
63
  onClick: () => {
64
- n(u[(u.indexOf(e) + 1) % u.length]);
64
+ let t = (u.indexOf(e) + 1) % u.length;
65
+ n(u[t]);
65
66
  },
66
67
  disabled: a,
67
68
  tabIndex: -1,
@@ -77,8 +78,8 @@ function v({ value: e, onChange: n, max: r, step: i = 1, disabled: a, label: l }
77
78
  size: "icon",
78
79
  className: "h-6 w-8",
79
80
  onClick: () => {
80
- let t = u.indexOf(e);
81
- n(u[t === 0 ? u.length - 1 : t - 1]);
81
+ let t = u.indexOf(e), r = t === 0 ? u.length - 1 : t - 1;
82
+ n(u[r]);
82
83
  },
83
84
  disabled: a,
84
85
  tabIndex: -1,
@@ -141,13 +142,16 @@ function b({ value: s, onChange: c, placeholder: b = "Sélectionner une heure",
141
142
  let r = m(e, t, n, S);
142
143
  c?.(r);
143
144
  }, q = (e) => {
144
- K(x === "12h" ? g(e, U) : e, z, V);
145
+ let t = x === "12h" ? g(e, U) : e;
146
+ K(t, z, V);
145
147
  }, J = (e) => {
146
148
  K(L, e, V);
147
149
  }, Y = (e) => {
148
150
  K(L, z, e);
149
151
  }, X = (e) => {
150
- W(e), K(g(L % 12 || 12, e), z, V);
152
+ W(e);
153
+ let t = g(L % 12 || 12, e);
154
+ K(t, z, V);
151
155
  }, Z = (e) => {
152
156
  let t = e.target.value;
153
157
  F(t);
@@ -285,4 +289,4 @@ function x(e = {}) {
285
289
  };
286
290
  }
287
291
  //#endregion
288
- export { b as default, x as useTimePicker };
292
+ export { b as WakaTimePicker, b as default, x as useTimePicker };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../button/index.cjs.js`);let r=require(`react`);r=e.__toESM(r);let i=require(`lucide-react`),a=require(`react/jsx-runtime`);var o={completed:{icon:i.Check,color:`text-green-600`,bgColor:`bg-green-100`},current:{icon:i.Circle,color:`text-primary`,bgColor:`bg-primary/10`},pending:{icon:i.Clock,color:`text-muted-foreground`,bgColor:`bg-muted`},error:{icon:i.AlertCircle,color:`text-destructive`,bgColor:`bg-destructive/10`}};function s({status:e,icon:n,color:r,size:i}){let s=o[e],c=s.icon;return(0,a.jsx)(`div`,{className:t.cn(`rounded-full flex items-center justify-center flex-shrink-0 border-2 border-background shadow-sm`,{sm:`h-6 w-6`,md:`h-8 w-8`,lg:`h-10 w-10`}[i],r?``:s.bgColor),style:r?{backgroundColor:r+`20`}:void 0,children:n||(0,a.jsx)(c,{className:t.cn({sm:`h-3 w-3`,md:`h-4 w-4`,lg:`h-5 w-5`}[i],r?``:s.color),style:r?{color:r}:void 0})})}function c({item:e,isLast:c,size:l,showDate:u,dateFormat:d,collapsible:f,onItemClick:p,orientation:m,position:h}){let[g,_]=r.useState(!1),v=e.status||`pending`,y={sm:{title:`text-sm`,desc:`text-xs`,date:`text-[10px]`},md:{title:`text-base`,desc:`text-sm`,date:`text-xs`},lg:{title:`text-lg`,desc:`text-base`,date:`text-sm`}},b=e=>(typeof e==`string`?new Date(e):e).toLocaleDateString(`fr-FR`,d||{day:`numeric`,month:`short`,year:`numeric`}),x=()=>{f&&e.content&&_(!g),p?.(e)};if(m===`horizontal`)return(0,a.jsxs)(`div`,{className:`flex flex-col items-center flex-1 min-w-[120px]`,children:[u&&e.date&&(0,a.jsx)(`div`,{className:t.cn(`mb-2 text-muted-foreground`,y[l].date),children:b(e.date)}),(0,a.jsxs)(`div`,{className:`flex items-center w-full`,children:[(0,a.jsx)(`div`,{className:t.cn(`flex-1 h-0.5`,c?``:`bg-border`),style:v===`completed`?{backgroundColor:o.completed.color.replace(`text-`,``)}:void 0}),(0,a.jsx)(s,{status:v,icon:e.icon,color:e.color,size:l}),(0,a.jsx)(`div`,{className:t.cn(`flex-1 h-0.5`,c?``:`bg-border`)})]}),(0,a.jsxs)(`div`,{className:t.cn(`mt-2 text-center`,p&&`cursor-pointer hover:opacity-80`),onClick:x,children:[(0,a.jsx)(`h4`,{className:t.cn(`font-medium`,y[l].title),children:e.title}),e.description&&(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mt-0.5`,y[l].desc),children:e.description})]})]});let S=h===`right`;return(0,a.jsxs)(`div`,{className:t.cn(`flex gap-4`,S&&`flex-row-reverse`),children:[h!==`left`&&u&&e.date&&(0,a.jsx)(`div`,{className:t.cn(`w-24 text-muted-foreground pt-1`,y[l].date,S?`text-left`:`text-right`),children:b(e.date)}),(0,a.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,a.jsx)(s,{status:v,icon:e.icon,color:e.color,size:l}),!c&&(0,a.jsx)(`div`,{className:t.cn(`w-0.5 flex-1 min-h-[24px] mt-1`,v===`completed`?`bg-green-500`:`bg-border`)})]}),(0,a.jsxs)(`div`,{className:t.cn(`flex-1 pb-8`,S&&`text-right`),children:[h===`left`&&u&&e.date&&(0,a.jsx)(`div`,{className:t.cn(`text-muted-foreground mb-1`,y[l].date),children:b(e.date)}),(0,a.jsxs)(`div`,{className:t.cn(`inline-block`,(p||f&&e.content)&&`cursor-pointer hover:opacity-80`),onClick:x,children:[(0,a.jsxs)(`h4`,{className:t.cn(`font-medium`,y[l].title),children:[e.title,f&&e.content&&(0,a.jsx)(n.Button,{variant:`ghost`,size:`icon`,className:`h-5 w-5 ml-1`,children:g?(0,a.jsx)(i.ChevronUp,{className:`h-3 w-3`}):(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3`})})]}),e.description&&(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mt-0.5`,y[l].desc),children:e.description})]}),f&&e.content&&g&&(0,a.jsx)(`div`,{className:`mt-3 p-3 bg-muted/50 rounded-lg`,children:e.content})]})]})}function l({items:e,orientation:n=`vertical`,linePosition:r=`left`,size:i=`md`,showDates:o=!0,dateFormat:s,collapsible:l=!1,alternate:u=!1,onItemClick:d,className:f}){return n===`horizontal`?(0,a.jsx)(`div`,{className:t.cn(`flex items-start overflow-x-auto`,f),children:e.map((t,n)=>(0,a.jsx)(c,{item:t,isLast:n===e.length-1,size:i,showDate:o,dateFormat:s,collapsible:l,onItemClick:d,orientation:`horizontal`,position:`left`},t.id))}):(0,a.jsx)(`div`,{className:t.cn(`flex flex-col`,r===`center`&&`items-center`,f),children:e.map((t,n)=>{let f=`left`;return r===`center`&&u?f=n%2==0?`left`:`right`:r===`right`&&(f=`right`),(0,a.jsx)(c,{item:t,isLast:n===e.length-1,size:i,showDate:o,dateFormat:s,collapsible:l,onItemClick:d,orientation:`vertical`,position:f},t.id)})})}exports.default=l;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../button/index.cjs.js");let r=require("react");r=e.__toESM(r);let i=require("lucide-react"),a=require("react/jsx-runtime");var o={completed:{icon:i.Check,color:`text-green-600`,bgColor:`bg-green-100`},current:{icon:i.Circle,color:`text-primary`,bgColor:`bg-primary/10`},pending:{icon:i.Clock,color:`text-muted-foreground`,bgColor:`bg-muted`},error:{icon:i.AlertCircle,color:`text-destructive`,bgColor:`bg-destructive/10`}};function s({status:e,icon:n,color:r,size:i}){let s=o[e],c=s.icon;return(0,a.jsx)(`div`,{className:t.cn(`rounded-full flex items-center justify-center flex-shrink-0 border-2 border-background shadow-sm`,{sm:`h-6 w-6`,md:`h-8 w-8`,lg:`h-10 w-10`}[i],r?``:s.bgColor),style:r?{backgroundColor:r+`20`}:void 0,children:n||(0,a.jsx)(c,{className:t.cn({sm:`h-3 w-3`,md:`h-4 w-4`,lg:`h-5 w-5`}[i],r?``:s.color),style:r?{color:r}:void 0})})}function c({item:e,isLast:c,size:l,showDate:u,dateFormat:d,collapsible:f,onItemClick:p,orientation:m,position:h}){let[g,_]=r.useState(!1),v=e.status||`pending`,y={sm:{title:`text-sm`,desc:`text-xs`,date:`text-[10px]`},md:{title:`text-base`,desc:`text-sm`,date:`text-xs`},lg:{title:`text-lg`,desc:`text-base`,date:`text-sm`}},b=e=>(typeof e==`string`?new Date(e):e).toLocaleDateString(`fr-FR`,d||{day:`numeric`,month:`short`,year:`numeric`}),x=()=>{f&&e.content&&_(!g),p?.(e)};if(m===`horizontal`)return(0,a.jsxs)(`div`,{className:`flex flex-col items-center flex-1 min-w-[120px]`,children:[u&&e.date&&(0,a.jsx)(`div`,{className:t.cn(`mb-2 text-muted-foreground`,y[l].date),children:b(e.date)}),(0,a.jsxs)(`div`,{className:`flex items-center w-full`,children:[(0,a.jsx)(`div`,{className:t.cn(`flex-1 h-0.5`,c?``:`bg-border`),style:v===`completed`?{backgroundColor:o.completed.color.replace(`text-`,``)}:void 0}),(0,a.jsx)(s,{status:v,icon:e.icon,color:e.color,size:l}),(0,a.jsx)(`div`,{className:t.cn(`flex-1 h-0.5`,c?``:`bg-border`)})]}),(0,a.jsxs)(`div`,{className:t.cn(`mt-2 text-center`,p&&`cursor-pointer hover:opacity-80`),onClick:x,children:[(0,a.jsx)(`h4`,{className:t.cn(`font-medium`,y[l].title),children:e.title}),e.description&&(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mt-0.5`,y[l].desc),children:e.description})]})]});let S=h===`right`;return(0,a.jsxs)(`div`,{className:t.cn(`flex gap-4`,S&&`flex-row-reverse`),children:[h!==`left`&&u&&e.date&&(0,a.jsx)(`div`,{className:t.cn(`w-24 text-muted-foreground pt-1`,y[l].date,S?`text-left`:`text-right`),children:b(e.date)}),(0,a.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,a.jsx)(s,{status:v,icon:e.icon,color:e.color,size:l}),!c&&(0,a.jsx)(`div`,{className:t.cn(`w-0.5 flex-1 min-h-[24px] mt-1`,v===`completed`?`bg-green-500`:`bg-border`)})]}),(0,a.jsxs)(`div`,{className:t.cn(`flex-1 pb-8`,S&&`text-right`),children:[h===`left`&&u&&e.date&&(0,a.jsx)(`div`,{className:t.cn(`text-muted-foreground mb-1`,y[l].date),children:b(e.date)}),(0,a.jsxs)(`div`,{className:t.cn(`inline-block`,(p||f&&e.content)&&`cursor-pointer hover:opacity-80`),onClick:x,children:[(0,a.jsxs)(`h4`,{className:t.cn(`font-medium`,y[l].title),children:[e.title,f&&e.content&&(0,a.jsx)(n.Button,{variant:`ghost`,size:`icon`,className:`h-5 w-5 ml-1`,children:g?(0,a.jsx)(i.ChevronUp,{className:`h-3 w-3`}):(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3`})})]}),e.description&&(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mt-0.5`,y[l].desc),children:e.description})]}),f&&e.content&&g&&(0,a.jsx)(`div`,{className:`mt-3 p-3 bg-muted/50 rounded-lg`,children:e.content})]})]})}function l({items:e,orientation:n=`vertical`,linePosition:r=`left`,size:i=`md`,showDates:o=!0,dateFormat:s,collapsible:l=!1,alternate:u=!1,onItemClick:d,className:f}){return n===`horizontal`?(0,a.jsx)(`div`,{className:t.cn(`flex items-start overflow-x-auto`,f),children:e.map((t,n)=>(0,a.jsx)(c,{item:t,isLast:n===e.length-1,size:i,showDate:o,dateFormat:s,collapsible:l,onItemClick:d,orientation:`horizontal`,position:`left`},t.id))}):(0,a.jsx)(`div`,{className:t.cn(`flex flex-col`,r===`center`&&`items-center`,f),children:e.map((t,n)=>{let f=`left`;return r===`center`&&u?f=n%2==0?`left`:`right`:r===`right`&&(f=`right`),(0,a.jsx)(c,{item:t,isLast:n===e.length-1,size:i,showDate:o,dateFormat:s,collapsible:l,onItemClick:d,orientation:`vertical`,position:f},t.id)})})}exports.WakaTimeline=l,exports.default=l;
@@ -189,4 +189,4 @@ function m({ items: t, orientation: n = "vertical", linePosition: r = "left", si
189
189
  });
190
190
  }
191
191
  //#endregion
192
- export { m as default };
192
+ export { m as WakaTimeline, m as default };
@@ -1,11 +1,11 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`lucide-react`),i=require(`react/jsx-runtime`);var a=`waka-tour-completed-`,o=8,s=12;function c(e){return`${a}${e}`}function l(e){if(typeof window>`u`)return!1;try{return localStorage.getItem(c(e))===`true`}catch{return!1}}function u(e){if(!(typeof window>`u`))try{localStorage.setItem(c(e),`true`)}catch{}}function d(e){if(!(typeof window>`u`))try{localStorage.removeItem(c(e))}catch{}}function f(e){return typeof e==`string`?document.querySelector(e):e.current}function p(e){return e.getBoundingClientRect()}function m(e,t,n,r,i){let a=s+o,c=0,l=0,u=0,d=0,f=0,p=n,m={top:()=>{c=e.top-t.height-a,l=e.left+(e.width-t.width)/2,u=t.height,d=t.width/2-o,f=180},"top-start":()=>{c=e.top-t.height-a,l=e.left,u=t.height,d=Math.min(e.width/2,t.width/4),f=180},"top-end":()=>{c=e.top-t.height-a,l=e.right-t.width,u=t.height,d=t.width-Math.min(e.width/2,t.width/4)-o*2,f=180},bottom:()=>{c=e.bottom+a,l=e.left+(e.width-t.width)/2,u=-o*2,d=t.width/2-o,f=0},"bottom-start":()=>{c=e.bottom+a,l=e.left,u=-o*2,d=Math.min(e.width/2,t.width/4),f=0},"bottom-end":()=>{c=e.bottom+a,l=e.right-t.width,u=-o*2,d=t.width-Math.min(e.width/2,t.width/4)-o*2,f=0},left:()=>{c=e.top+(e.height-t.height)/2,l=e.left-t.width-a,u=t.height/2-o,d=t.width,f=90},"left-start":()=>{c=e.top,l=e.left-t.width-a,u=Math.min(e.height/2,t.height/4),d=t.width,f=90},"left-end":()=>{c=e.bottom-t.height,l=e.left-t.width-a,u=t.height-Math.min(e.height/2,t.height/4)-o*2,d=t.width,f=90},right:()=>{c=e.top+(e.height-t.height)/2,l=e.right+a,u=t.height/2-o,d=-o*2,f=-90},"right-start":()=>{c=e.top,l=e.right+a,u=Math.min(e.height/2,t.height/4),d=-o*2,f=-90},"right-end":()=>{c=e.bottom-t.height,l=e.right+a,u=t.height-Math.min(e.height/2,t.height/4)-o*2,d=-o*2,f=-90}};return m[n](),l<16?l=16:l+t.width>r-16&&(l=r-t.width-16),c<16&&n.startsWith(`top`)?(p=n.replace(`top`,`bottom`),m[p]()):c+t.height>i-16&&n.startsWith(`bottom`)&&(p=n.replace(`bottom`,`top`),m[p]()),{top:c,left:l,arrowTop:u,arrowLeft:d,arrowRotation:f,actualPlacement:p}}function h({tourId:e,persistCompletion:t=!0,autoStart:r=!1,autoStartDelay:i=500}){let[a,o]=n.useState(!1),[s,c]=n.useState(0),[f,p]=n.useState(!1);n.useEffect(()=>{t&&p(l(e))},[e,t]),n.useEffect(()=>{if(r&&!f&&!a){let e=setTimeout(()=>{o(!0)},i);return()=>clearTimeout(e)}},[r,f,a,i]);let m=n.useCallback((e=0)=>{c(e),o(!0)},[]),h=n.useCallback(()=>{o(!1)},[]),g=n.useCallback(()=>{c(e=>e+1)},[]),_=n.useCallback(()=>{c(e=>Math.max(0,e-1))},[]),v=n.useCallback(e=>{c(e)},[]),y=n.useCallback(()=>{o(!1),t&&(u(e),p(!0))},[e,t]),b=n.useCallback(()=>{o(!1)},[]);return{isActive:a,currentStep:s,start:m,stop:h,next:g,prev:_,goTo:v,complete:y,skip:b,reset:n.useCallback(()=>{d(e),p(!1),c(0)},[e]),hasCompleted:f,tourProps:{isActive:a,onActiveChange:n.useCallback(e=>{o(e),e||c(0)},[]),onComplete:y,onSkip:b,onStepChange:c,startAt:s}}}function g({targetRect:e,padding:n,onClick:r,className:a}){if(!e)return(0,i.jsx)(`div`,{className:t.cn(`fixed inset-0 z-[9998] bg-black/60 transition-opacity duration-300`,a),onClick:r});let o={position:`fixed`,inset:0,zIndex:9998,background:`
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime");var a=`waka-tour-completed-`,o=8;function s(e){return`${a}${e}`}function c(e){if(typeof window>`u`)return!1;try{return localStorage.getItem(s(e))===`true`}catch{return!1}}function l(e){if(!(typeof window>`u`))try{localStorage.setItem(s(e),`true`)}catch{}}function u(e){if(!(typeof window>`u`))try{localStorage.removeItem(s(e))}catch{}}function d(e){return typeof e==`string`?document.querySelector(e):e.current}function f(e){return e.getBoundingClientRect()}function p(e,t,n,r,i){let a=0,s=0,c=0,l=0,u=0,d=n,f={top:()=>{a=e.top-t.height-20,s=e.left+(e.width-t.width)/2,c=t.height,l=t.width/2-o,u=180},"top-start":()=>{a=e.top-t.height-20,s=e.left,c=t.height,l=Math.min(e.width/2,t.width/4),u=180},"top-end":()=>{a=e.top-t.height-20,s=e.right-t.width,c=t.height,l=t.width-Math.min(e.width/2,t.width/4)-o*2,u=180},bottom:()=>{a=e.bottom+20,s=e.left+(e.width-t.width)/2,c=-16,l=t.width/2-o,u=0},"bottom-start":()=>{a=e.bottom+20,s=e.left,c=-16,l=Math.min(e.width/2,t.width/4),u=0},"bottom-end":()=>{a=e.bottom+20,s=e.right-t.width,c=-16,l=t.width-Math.min(e.width/2,t.width/4)-o*2,u=0},left:()=>{a=e.top+(e.height-t.height)/2,s=e.left-t.width-20,c=t.height/2-o,l=t.width,u=90},"left-start":()=>{a=e.top,s=e.left-t.width-20,c=Math.min(e.height/2,t.height/4),l=t.width,u=90},"left-end":()=>{a=e.bottom-t.height,s=e.left-t.width-20,c=t.height-Math.min(e.height/2,t.height/4)-o*2,l=t.width,u=90},right:()=>{a=e.top+(e.height-t.height)/2,s=e.right+20,c=t.height/2-o,l=-16,u=-90},"right-start":()=>{a=e.top,s=e.right+20,c=Math.min(e.height/2,t.height/4),l=-16,u=-90},"right-end":()=>{a=e.bottom-t.height,s=e.right+20,c=t.height-Math.min(e.height/2,t.height/4)-o*2,l=-16,u=-90}};return f[n](),s<16?s=16:s+t.width>r-16&&(s=r-t.width-16),a<16&&n.startsWith(`top`)?(d=n.replace(`top`,`bottom`),f[d]()):a+t.height>i-16&&n.startsWith(`bottom`)&&(d=n.replace(`bottom`,`top`),f[d]()),{top:a,left:s,arrowTop:c,arrowLeft:l,arrowRotation:u,actualPlacement:d}}function m({tourId:e,persistCompletion:t=!0,autoStart:r=!1,autoStartDelay:i=500}){let[a,o]=n.useState(!1),[s,d]=n.useState(0),[f,p]=n.useState(!1);n.useEffect(()=>{t&&p(c(e))},[e,t]),n.useEffect(()=>{if(r&&!f&&!a){let e=setTimeout(()=>{o(!0)},i);return()=>clearTimeout(e)}},[r,f,a,i]);let m=n.useCallback((e=0)=>{d(e),o(!0)},[]),h=n.useCallback(()=>{o(!1)},[]),g=n.useCallback(()=>{d(e=>e+1)},[]),_=n.useCallback(()=>{d(e=>Math.max(0,e-1))},[]),v=n.useCallback(e=>{d(e)},[]),y=n.useCallback(()=>{o(!1),t&&(l(e),p(!0))},[e,t]),b=n.useCallback(()=>{o(!1)},[]);return{isActive:a,currentStep:s,start:m,stop:h,next:g,prev:_,goTo:v,complete:y,skip:b,reset:n.useCallback(()=>{u(e),p(!1),d(0)},[e]),hasCompleted:f,tourProps:{isActive:a,onActiveChange:n.useCallback(e=>{o(e),e||d(0)},[]),onComplete:y,onSkip:b,onStepChange:d,startAt:s}}}function h({targetRect:e,padding:n,onClick:r,className:a}){if(!e)return(0,i.jsx)(`div`,{className:t.cn(`fixed inset-0 z-[9998] bg-black/60 transition-opacity duration-300`,a),onClick:r});let o={position:`fixed`,inset:0,zIndex:9998,background:`
2
2
  linear-gradient(to right, rgba(0,0,0,0.6) ${e.left-n}px, transparent ${e.left-n}px),
3
3
  linear-gradient(to left, rgba(0,0,0,0.6) ${window.innerWidth-e.right-n}px, transparent ${window.innerWidth-e.right-n}px),
4
4
  linear-gradient(to bottom, rgba(0,0,0,0.6) ${e.top-n}px, transparent ${e.top-n}px),
5
5
  linear-gradient(to top, rgba(0,0,0,0.6) ${window.innerHeight-e.bottom-n}px, transparent ${window.innerHeight-e.bottom-n}px)
6
- `};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:t.cn(`transition-all duration-300`,a),style:o,onClick:r}),(0,i.jsx)(`div`,{className:`fixed z-[9999] pointer-events-none rounded-md ring-2 ring-primary ring-offset-2 ring-offset-transparent transition-all duration-300`,style:{top:e.top-n,left:e.left-n,width:e.width+n*2,height:e.height+n*2}})]})}function _({top:e,left:t,rotation:n}){return(0,i.jsx)(`div`,{className:`absolute w-0 h-0`,style:{top:e,left:t,transform:`rotate(${n}deg)`,borderLeft:`${o}px solid transparent`,borderRight:`${o}px solid transparent`,borderBottom:`${o}px solid hsl(var(--popover))`}})}function v({tourId:e,steps:a,isActive:o,onActiveChange:s,onComplete:c,onSkip:l,onStepChange:d,startAt:h=0,autoAdvance:v,showSkip:y=!0,showProgress:b=!0,showNavigation:x=!0,persistCompletion:S=!0,className:C,overlayClassName:w,scrollToTarget:T=!0,scrollBehavior:E=`smooth`,closeOnOverlayClick:D=!1,closeOnEscape:O=!0,skipText:k=`Skip tour`,nextText:A=`Next`,prevText:j=`Back`,finishText:M=`Finish`}){let[N,P]=n.useState(h),[F,I]=n.useState(null),[L,R]=n.useState(null),[z,B]=n.useState(!1),V=n.useRef(null),H=n.useRef(void 0),U=a[N],W=N===0,G=N===a.length-1;n.useEffect(()=>{P(h)},[h]),n.useEffect(()=>{if(!o||!O)return;let e=e=>{e.key===`Escape`&&Y()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o,O]),n.useEffect(()=>{if(!o||!U)return;let e=()=>{let e=f(U.target);if(e){let t=p(e);I(t),T&&(t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth||(e.scrollIntoView({behavior:E,block:`center`,inline:`center`}),requestAnimationFrame(()=>{I(p(e))})))}else I(null)};B(!0),e();let t=setTimeout(()=>{B(!1)},300);return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{clearTimeout(t),window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[o,U,N,T,E]),n.useEffect(()=>{!F||!V.current||!U||R(m(F,V.current.getBoundingClientRect(),U.placement||`bottom`,window.innerWidth,window.innerHeight))},[F,U]),n.useEffect(()=>{if(!(!o||!v||G))return H.current=setTimeout(()=>{K()},v),()=>{H.current&&clearTimeout(H.current)}},[o,v,N,G]);let K=()=>{if(G)J();else{let e=N+1;P(e),d?.(e)}},q=()=>{if(!W){let e=N-1;P(e),d?.(e)}},J=()=>{S&&u(e),s?.(!1),c?.()},Y=()=>{s?.(!1),l?.()},X=()=>{D&&Y()},Z=()=>{U?.onAction?.(),K()};if(!o||!U)return null;let Q=U.spotlightPadding??8;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g,{targetRect:U.highlight===!1?null:F,padding:Q,onClick:X,className:w}),(0,i.jsxs)(`div`,{ref:V,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-step-${U.id}-title`,"aria-describedby":`tour-step-${U.id}-content`,className:t.cn(`fixed z-[10000] w-80 max-w-[calc(100vw-32px)] rounded-lg border bg-popover p-4 shadow-xl`,`transition-all duration-300`,z?`opacity-0 scale-95`:`opacity-100 scale-100`,C),style:{top:L?.top??0,left:L?.left??0},children:[L&&(0,i.jsx)(_,{top:L.arrowTop,left:L.arrowLeft,rotation:L.arrowRotation}),(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-2`,children:[(0,i.jsx)(`h3`,{id:`tour-step-${U.id}-title`,className:`font-semibold text-foreground`,children:U.title}),y&&(0,i.jsx)(`button`,{onClick:Y,className:`p-1 -m-1 rounded-md hover:bg-accent transition-colors`,"aria-label":`Close tour`,children:(0,i.jsx)(r.X,{className:`h-4 w-4 text-muted-foreground`})})]}),(0,i.jsx)(`div`,{id:`tour-step-${U.id}-content`,className:`text-sm text-muted-foreground mb-4`,children:U.content}),(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b&&(0,i.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[N+1,` of `,a.length]}),y&&!G&&(0,i.jsxs)(`button`,{onClick:Y,className:`text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,i.jsx)(r.SkipForward,{className:`h-3 w-3`}),k]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x&&!W&&(0,i.jsxs)(`button`,{onClick:q,className:`flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md hover:bg-accent transition-colors`,children:[(0,i.jsx)(r.ChevronLeft,{className:`h-4 w-4`}),j]}),U.actionText?(0,i.jsx)(`button`,{onClick:Z,className:`px-3 py-1.5 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors`,children:U.actionText}):(0,i.jsxs)(`button`,{onClick:K,className:`flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors`,children:[G?M:A,!G&&(0,i.jsx)(r.ChevronRight,{className:`h-4 w-4`})]})]})]}),v&&!G&&(0,i.jsxs)(`div`,{className:`absolute bottom-0 left-0 right-0 h-1 bg-muted rounded-b-lg overflow-hidden`,children:[(0,i.jsx)(`div`,{className:`h-full bg-primary`,style:{width:`100%`,animation:`waka-tour-progress ${v}ms linear forwards`}}),(0,i.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`
6
+ `};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:t.cn(`transition-all duration-300`,a),style:o,onClick:r}),(0,i.jsx)(`div`,{className:`fixed z-[9999] pointer-events-none rounded-md ring-2 ring-primary ring-offset-2 ring-offset-transparent transition-all duration-300`,style:{top:e.top-n,left:e.left-n,width:e.width+n*2,height:e.height+n*2}})]})}function g({top:e,left:t,rotation:n}){return(0,i.jsx)(`div`,{className:`absolute w-0 h-0`,style:{top:e,left:t,transform:`rotate(${n}deg)`,borderLeft:`${o}px solid transparent`,borderRight:`${o}px solid transparent`,borderBottom:`${o}px solid hsl(var(--popover))`}})}function _({tourId:e,steps:a,isActive:o,onActiveChange:s,onComplete:c,onSkip:u,onStepChange:m,startAt:_=0,autoAdvance:v,showSkip:y=!0,showProgress:b=!0,showNavigation:x=!0,persistCompletion:S=!0,className:C,overlayClassName:w,scrollToTarget:T=!0,scrollBehavior:E=`smooth`,closeOnOverlayClick:D=!1,closeOnEscape:O=!0,skipText:k=`Skip tour`,nextText:A=`Next`,prevText:j=`Back`,finishText:M=`Finish`}){let[N,P]=n.useState(_),[F,I]=n.useState(null),[L,R]=n.useState(null),[z,B]=n.useState(!1),V=n.useRef(null),H=n.useRef(void 0),U=a[N],W=N===0,G=N===a.length-1;n.useEffect(()=>{P(_)},[_]),n.useEffect(()=>{if(!o||!O)return;let e=e=>{e.key===`Escape`&&Y()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o,O]),n.useEffect(()=>{if(!o||!U)return;let e=()=>{let e=d(U.target);if(e){let t=f(e);I(t),T&&(t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth||(e.scrollIntoView({behavior:E,block:`center`,inline:`center`}),requestAnimationFrame(()=>{I(f(e))})))}else I(null)};B(!0),e();let t=setTimeout(()=>{B(!1)},300);return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{clearTimeout(t),window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[o,U,N,T,E]),n.useEffect(()=>{if(!F||!V.current||!U)return;let e=V.current.getBoundingClientRect(),t=p(F,e,U.placement||`bottom`,window.innerWidth,window.innerHeight);R(t)},[F,U]),n.useEffect(()=>{if(!(!o||!v||G))return H.current=setTimeout(()=>{K()},v),()=>{H.current&&clearTimeout(H.current)}},[o,v,N,G]);let K=()=>{if(G)J();else{let e=N+1;P(e),m?.(e)}},q=()=>{if(!W){let e=N-1;P(e),m?.(e)}},J=()=>{S&&l(e),s?.(!1),c?.()},Y=()=>{s?.(!1),u?.()},X=()=>{D&&Y()},Z=()=>{U?.onAction?.(),K()};if(!o||!U)return null;let Q=U.spotlightPadding??8;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h,{targetRect:U.highlight===!1?null:F,padding:Q,onClick:X,className:w}),(0,i.jsxs)(`div`,{ref:V,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-step-${U.id}-title`,"aria-describedby":`tour-step-${U.id}-content`,className:t.cn(`fixed z-[10000] w-80 max-w-[calc(100vw-32px)] rounded-lg border bg-popover p-4 shadow-xl`,`transition-all duration-300`,z?`opacity-0 scale-95`:`opacity-100 scale-100`,C),style:{top:L?.top??0,left:L?.left??0},children:[L&&(0,i.jsx)(g,{top:L.arrowTop,left:L.arrowLeft,rotation:L.arrowRotation}),(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-2`,children:[(0,i.jsx)(`h3`,{id:`tour-step-${U.id}-title`,className:`font-semibold text-foreground`,children:U.title}),y&&(0,i.jsx)(`button`,{onClick:Y,className:`p-1 -m-1 rounded-md hover:bg-accent transition-colors`,"aria-label":`Close tour`,children:(0,i.jsx)(r.X,{className:`h-4 w-4 text-muted-foreground`})})]}),(0,i.jsx)(`div`,{id:`tour-step-${U.id}-content`,className:`text-sm text-muted-foreground mb-4`,children:U.content}),(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b&&(0,i.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[N+1,` of `,a.length]}),y&&!G&&(0,i.jsxs)(`button`,{onClick:Y,className:`text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,i.jsx)(r.SkipForward,{className:`h-3 w-3`}),k]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x&&!W&&(0,i.jsxs)(`button`,{onClick:q,className:`flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md hover:bg-accent transition-colors`,children:[(0,i.jsx)(r.ChevronLeft,{className:`h-4 w-4`}),j]}),U.actionText?(0,i.jsx)(`button`,{onClick:Z,className:`px-3 py-1.5 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors`,children:U.actionText}):(0,i.jsxs)(`button`,{onClick:K,className:`flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors`,children:[G?M:A,!G&&(0,i.jsx)(r.ChevronRight,{className:`h-4 w-4`})]})]})]}),v&&!G&&(0,i.jsxs)(`div`,{className:`absolute bottom-0 left-0 right-0 h-1 bg-muted rounded-b-lg overflow-hidden`,children:[(0,i.jsx)(`div`,{className:`h-full bg-primary`,style:{width:`100%`,animation:`waka-tour-progress ${v}ms linear forwards`}}),(0,i.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`
7
7
  @keyframes waka-tour-progress {
8
8
  from { width: 0%; }
9
9
  to { width: 100%; }
10
10
  }
11
- `}})]})]})]})}exports.default=v,exports.useTooltipTour=h;
11
+ `}})]})]})]})}exports.WakaTooltipTour=_,exports.default=_,exports.useTooltipTour=m;