@espressif/dashboard-ui-components 1.10.0 → 1.11.0

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 (340) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/_vendor/@radix-ui/primitive/dist/index.js +9 -0
  3. package/dist/_vendor/@radix-ui/react-checkbox/dist/index.js +185 -0
  4. package/dist/_vendor/@radix-ui/react-compose-refs/dist/index.js +28 -0
  5. package/dist/_vendor/@radix-ui/react-context/dist/index.js +68 -0
  6. package/dist/_vendor/@radix-ui/react-presence/dist/index.js +127 -0
  7. package/dist/_vendor/@radix-ui/react-primitive/dist/index.js +42 -0
  8. package/dist/_vendor/@radix-ui/react-use-controllable-state/dist/index.js +55 -0
  9. package/dist/_vendor/@radix-ui/react-use-layout-effect/dist/index.js +5 -0
  10. package/dist/_vendor/@radix-ui/react-use-previous/dist/index.js +17 -0
  11. package/dist/_vendor/@radix-ui/react-use-size/dist/index.js +39 -0
  12. package/dist/_vendor/lottie-react/build/index.es.js +537 -0
  13. package/dist/_vendor/lottie-web/build/player/lottie.js +14149 -0
  14. package/dist/_virtual/_rolldown/runtime.js +24 -0
  15. package/dist/assets/illustrations/bulb-cloud-drawing.js +4 -0
  16. package/dist/assets/illustrations/rm-dashboard-update.js +4 -0
  17. package/dist/assets/illustrations/rm-data-download.js +4 -0
  18. package/dist/assets/logos/espressif/espressif-no-text.js +4 -0
  19. package/dist/assets/logos/espressif/espressif-with-text-dm.js +4 -0
  20. package/dist/assets/logos/espressif/espressif-with-text.js +4 -0
  21. package/dist/assets/logos/insights/insights-no-text.js +4 -0
  22. package/dist/assets/logos/insights/insights-with-text-dm.js +4 -0
  23. package/dist/assets/logos/insights/insights-with-text.js +4 -0
  24. package/dist/assets/logos/launchpad/launchpad-no-text-dm.js +4 -0
  25. package/dist/assets/logos/launchpad/launchpad-no-text.js +4 -0
  26. package/dist/assets/logos/launchpad/launchpad-with-text-dm.js +4 -0
  27. package/dist/assets/logos/launchpad/launchpad-with-text.js +4 -0
  28. package/dist/assets/logos/private-agents/private-agents-no-text.js +4 -0
  29. package/dist/assets/logos/private-agents/private-agents-with-text-dm.js +4 -0
  30. package/dist/assets/logos/private-agents/private-agents-with-text.js +4 -0
  31. package/dist/assets/logos/rainmaker/rainmaker-no-text.js +4 -0
  32. package/dist/assets/logos/rainmaker/rainmaker-with-text-dm.js +4 -0
  33. package/dist/assets/logos/rainmaker/rainmaker-with-text.js +4 -0
  34. package/dist/assets/logos/rainmaker-classic/rainmaker-classic-no-text-dm.js +4 -0
  35. package/dist/assets/logos/rainmaker-classic/rainmaker-classic-no-text.js +4 -0
  36. package/dist/assets/logos/rainmaker-classic/rainmaker-classic-with-text-dm.js +4 -0
  37. package/dist/assets/logos/rainmaker-classic/rainmaker-classic-with-text.js +4 -0
  38. package/dist/assets/logos/rainmaker-neo/rainmaker-neo-no-text.js +4 -0
  39. package/dist/assets/logos/rainmaker-neo/rainmaker-neo-with-text-dm.js +4 -0
  40. package/dist/assets/logos/rainmaker-neo/rainmaker-neo-with-text.js +4 -0
  41. package/dist/assets/logos/ui-components/ui-components-no-text.js +4 -0
  42. package/dist/assets/logos/ui-components/ui-components-with-text-dm.js +4 -0
  43. package/dist/assets/logos/ui-components/ui-components-with-text.js +4 -0
  44. package/dist/assets/logos/zerocode/zerocode-no-text.js +4 -0
  45. package/dist/assets/logos/zerocode/zerocode-with-text-dm.js +4 -0
  46. package/dist/assets/logos/zerocode/zerocode-with-text.js +4 -0
  47. package/dist/assets/logos/zerocode-ai/zerocode-ai-no-text.js +4 -0
  48. package/dist/assets/logos/zerocode-ai/zerocode-ai-with-text-dm.js +4 -0
  49. package/dist/assets/logos/zerocode-ai/zerocode-ai-with-text.js +4 -0
  50. package/dist/common/animated-rainmaker-logo/animated-rainmaker-logo.constants.js +18 -0
  51. package/dist/common/animated-rainmaker-logo/animated-rainmaker-logo.js +24 -0
  52. package/dist/common/animated-rainmaker-logo/rainmaker-c-logo.js +50 -0
  53. package/dist/common/animated-rainmaker-logo/use-animated-rainmaker-logo-animation.js +85 -0
  54. package/dist/common/app-logo/app-logo.js +59 -0
  55. package/dist/common/app-logo/logo-config.js +297 -0
  56. package/dist/common/copyright-card/copyright-card.js +39 -0
  57. package/dist/common/footer-card/footer-card.js +22 -0
  58. package/dist/common/index.js +8 -8
  59. package/dist/common/my-account-menu/my-account-menu.js +32 -0
  60. package/dist/common/page-loader/page-loader.js +21 -0
  61. package/dist/common/profile-card/profile-card.js +26 -0
  62. package/dist/components/accordion/accordion.js +52 -0
  63. package/dist/components/advanced-search-box/advanced-search-box.js +106 -0
  64. package/dist/components/alert/alert.js +85 -0
  65. package/dist/components/animated-containers/pop-collection-item.js +28 -0
  66. package/dist/components/async-multi-select/async-multi-select.js +199 -0
  67. package/dist/components/avatar/avatar.js +41 -0
  68. package/dist/components/button/button.js +191 -0
  69. package/dist/components/button/flash-button.js +110 -0
  70. package/dist/components/button/invert-button.js +13 -0
  71. package/dist/components/calendar/calendar.js +105 -0
  72. package/dist/components/cards/animated-card/animated-card-animations.js +57 -0
  73. package/dist/components/cards/animated-card/animated-card.js +42 -0
  74. package/dist/components/cards/basic-details-card.js +46 -0
  75. package/dist/components/cards/collapsible-card.js +48 -0
  76. package/dist/components/cards/no-data-card/no-data-card.js +30 -0
  77. package/dist/components/cards/section-card.js +265 -0
  78. package/dist/components/cards/simple-card.js +24 -0
  79. package/dist/components/carousel/carousel.js +158 -0
  80. package/dist/components/chart/area-chart.js +135 -0
  81. package/dist/components/chart/bar-chart.js +151 -0
  82. package/dist/components/chart/chart-colors.js +85 -0
  83. package/dist/components/chart/chart-series-data.js +53 -0
  84. package/dist/components/chart/chart.js +147 -0
  85. package/dist/components/chart/chart.types.js +7 -0
  86. package/dist/components/chart/composed-chart.js +182 -0
  87. package/dist/components/chart/donut-chart.js +177 -0
  88. package/dist/components/chart/line-chart.js +137 -0
  89. package/dist/components/chart/treemap-chart.js +294 -0
  90. package/dist/components/circular-progress/circular-progress.js +125 -0
  91. package/dist/components/code-editor/code-editor.js +235 -0
  92. package/dist/components/code-editor/code-editor.utils.js +122 -0
  93. package/dist/components/code-editor/use-code-editor-keys.js +79 -0
  94. package/dist/components/code-editor/use-highlighted-html.js +102 -0
  95. package/dist/components/confirmation-dialog/confirmation-dialog.js +72 -0
  96. package/dist/components/content-container/content-container.js +20 -0
  97. package/dist/components/copiable-text/copiable-text.js +46 -0
  98. package/dist/components/data-table/data-table.js +186 -0
  99. package/dist/components/data-table/responsive-columns.js +65 -0
  100. package/dist/components/data-table/row-actions.js +27 -0
  101. package/dist/components/data-table/sticky-columns.js +71 -0
  102. package/dist/components/data-table/table-body.js +57 -0
  103. package/dist/components/data-table/table-header.js +21 -0
  104. package/dist/components/date-picker/date-picker.js +95 -0
  105. package/dist/components/date-range-picker/date-range-picker.js +301 -0
  106. package/dist/components/date-range-picker/presets.js +174 -0
  107. package/dist/components/date-time-picker/date-time-picker.js +144 -0
  108. package/dist/components/date-time-picker/date-time-picker.utils.js +32 -0
  109. package/dist/components/device-icon/device-icon.config.js +194 -0
  110. package/dist/components/device-icon/device-icon.js +17 -0
  111. package/dist/components/device-icon/icons/air-conditioner.js +22 -0
  112. package/dist/components/device-icon/icons/blind.js +24 -0
  113. package/dist/components/device-icon/icons/dimmer.js +14 -0
  114. package/dist/components/device-icon/icons/extension-board.js +42 -0
  115. package/dist/components/device-icon/icons/fan.js +14 -0
  116. package/dist/components/device-icon/icons/knob.js +14 -0
  117. package/dist/components/device-icon/icons/led-strip.js +22 -0
  118. package/dist/components/device-icon/icons/light.js +14 -0
  119. package/dist/components/device-icon/icons/refrigerator.js +18 -0
  120. package/dist/components/device-icon/icons/retro-switch.js +18 -0
  121. package/dist/components/device-icon/icons/router.js +20 -0
  122. package/dist/components/device-icon/icons/sensor.js +20 -0
  123. package/dist/components/device-icon/icons/socket.js +19 -0
  124. package/dist/components/device-icon/icons/switch.js +19 -0
  125. package/dist/components/device-icon/icons/thermostat.js +21 -0
  126. package/dist/components/device-icon/icons/washing-machine.js +22 -0
  127. package/dist/components/device-icon/match-device.js +61 -0
  128. package/dist/components/dynamic-list/dynamic-list.js +445 -0
  129. package/dist/components/error-display/full-size-error/full-size-error.js +20 -0
  130. package/dist/components/error-display/inline-error/inline-error.js +12 -0
  131. package/dist/components/file-input/file-input.js +318 -0
  132. package/dist/components/file-upload/file-upload.js +317 -0
  133. package/dist/components/filters-bar/filters-bar.js +36 -0
  134. package/dist/components/fullscreen-dialog/fullscreen-dialog.js +68 -0
  135. package/dist/components/icon-avatar/icon-avatar.js +130 -0
  136. package/dist/components/icon-text-action-card/icon-text-action-card.js +190 -0
  137. package/dist/components/illustration/illustration-registry.js +37 -0
  138. package/dist/components/illustration/illustration-variants.js +21 -0
  139. package/dist/components/illustration/illustration.js +68 -0
  140. package/dist/components/index.d.ts +0 -20
  141. package/dist/components/index.js +134 -6
  142. package/dist/components/key-value-manager/key-value-manager-add-popover.js +126 -0
  143. package/dist/components/key-value-manager/key-value-manager-field.js +47 -0
  144. package/dist/components/key-value-manager/key-value-manager-table.js +188 -0
  145. package/dist/components/key-value-manager/key-value-manager.js +111 -0
  146. package/dist/components/key-value-manager/key-value-manager.props.js +28 -0
  147. package/dist/components/key-value-manager/key-value-manager.utils.js +21 -0
  148. package/dist/components/link/link.js +67 -0
  149. package/dist/components/list/dropdown-list-item.js +60 -0
  150. package/dist/components/list/list-item.utils.js +76 -0
  151. package/dist/components/list/list.js +49 -0
  152. package/dist/components/list/list.props.js +27 -0
  153. package/dist/components/list/standard-list-item.js +66 -0
  154. package/dist/components/list-details/list-details-item-button.js +46 -0
  155. package/dist/components/list-details/list-details-item-dropdown.js +112 -0
  156. package/dist/components/list-details/list-details-item-strip.js +125 -0
  157. package/dist/components/list-details/list-details.js +148 -0
  158. package/dist/components/lottie-animation-container/lottie-animation-container.js +31 -0
  159. package/dist/components/lottie-animations/animation-data/access-denied.js +3980 -0
  160. package/dist/components/lottie-animations/animation-data/active.js +825 -0
  161. package/dist/components/lottie-animations/animation-data/bar-chart.js +610 -0
  162. package/dist/components/lottie-animations/animation-data/chart-loading.js +5368 -0
  163. package/dist/components/lottie-animations/animation-data/cloud-download.js +1660 -0
  164. package/dist/components/lottie-animations/animation-data/cloud-sync.js +932 -0
  165. package/dist/components/lottie-animations/animation-data/coud-upload.js +7060 -0
  166. package/dist/components/lottie-animations/animation-data/cross-throb.js +1506 -0
  167. package/dist/components/lottie-animations/animation-data/dashboard-loading.js +14330 -0
  168. package/dist/components/lottie-animations/animation-data/error-spread-out.js +5567 -0
  169. package/dist/components/lottie-animations/animation-data/error.js +1211 -0
  170. package/dist/components/lottie-animations/animation-data/green-success.js +14826 -0
  171. package/dist/components/lottie-animations/animation-data/inactive.js +723 -0
  172. package/dist/components/lottie-animations/animation-data/light.js +2678 -0
  173. package/dist/components/lottie-animations/animation-data/lock.js +900 -0
  174. package/dist/components/lottie-animations/animation-data/lock2.js +1686 -0
  175. package/dist/components/lottie-animations/animation-data/locked.js +641 -0
  176. package/dist/components/lottie-animations/animation-data/search-error.js +954 -0
  177. package/dist/components/lottie-animations/animation-data/security.js +4121 -0
  178. package/dist/components/lottie-animations/animation-data/success.js +404 -0
  179. package/dist/components/lottie-animations/animation-data/verification-in-progress.js +10138 -0
  180. package/dist/components/lottie-animations/animation-data/warning.js +843 -0
  181. package/dist/components/lottie-animations/verification-in-progress/verification-in-progress.js +19 -0
  182. package/dist/components/markdown-content/markdown-content.components.js +114 -0
  183. package/dist/components/markdown-content/markdown-content.js +39 -0
  184. package/dist/components/menu/menu.js +19 -0
  185. package/dist/components/monospace-content/monospace-content.js +80 -0
  186. package/dist/components/nav-bar/nav-bar-details-panel.js +51 -0
  187. package/dist/components/nav-bar/nav-bar-mobile-menu.js +105 -0
  188. package/dist/components/nav-bar/nav-bar.js +449 -0
  189. package/dist/components/nav-bar/use-nav-bar-overflow.js +74 -0
  190. package/dist/components/nav-bar/use-nav-bar-scroll.js +42 -0
  191. package/dist/components/overflow-badge-list/overflow-badge-list.js +58 -0
  192. package/dist/components/page-container/page-container-skeleton.js +72 -0
  193. package/dist/components/page-container/page-container.js +93 -0
  194. package/dist/components/pagination/pagination.js +96 -0
  195. package/dist/components/pagination/pagination.props.js +16 -0
  196. package/dist/components/progress-bar/progress-bar.js +106 -0
  197. package/dist/components/radio-group/radio-group.js +41 -0
  198. package/dist/components/requirement-list/requirement-list.js +83 -0
  199. package/dist/components/scrollable-sections/scrollable-sections.js +270 -0
  200. package/dist/components/search-box/search-box.js +54 -0
  201. package/dist/components/search-field-shell.js +24 -0
  202. package/dist/components/selectable-card-list/checkbox-card-list.js +85 -0
  203. package/dist/components/selectable-card-list/radio-card-list.js +99 -0
  204. package/dist/components/selectable-card-list/selectable-card-list-shared.js +135 -0
  205. package/dist/components/selectable-card-list/selectable-card-list.js +34 -0
  206. package/dist/components/sidebar/sidebar.js +344 -0
  207. package/dist/components/sidebar/types.js +6 -0
  208. package/dist/components/simple-clickable-card/simple-clickable-card-shared.js +309 -0
  209. package/dist/components/simple-clickable-card/simple-clickable-card.js +106 -0
  210. package/dist/components/simple-info-card/simple-info-card.js +154 -0
  211. package/dist/components/simple-list/simple-list.js +146 -0
  212. package/dist/components/simple-paginated-list/simple-paginated-list.js +178 -0
  213. package/dist/components/simplified-date/simplified-date.js +56 -0
  214. package/dist/components/skeletons/table-skeleton.js +16 -0
  215. package/dist/components/spinner/spinner.js +25 -0
  216. package/dist/components/stat-card/stat-card.js +206 -0
  217. package/dist/components/status-badge/status-badge.js +108 -0
  218. package/dist/components/status-card-list/status-card-list.js +282 -0
  219. package/dist/components/tag/tag.js +144 -0
  220. package/dist/components/tag-input/tag-input.js +161 -0
  221. package/dist/components/text-effects/glitch-effect/glitch-text.js +115 -0
  222. package/dist/components/text-effects/gradient-text/gradient-text.js +32 -0
  223. package/dist/components/text-effects/highlight-text/highlight-text.js +35 -0
  224. package/dist/components/text-effects/parse-text-markup.js +53 -0
  225. package/dist/components/text-effects/shimmer-text/shimmer-text.js +67 -0
  226. package/dist/components/time-picker/time-picker.js +23 -0
  227. package/dist/components/toast/toast.js +126 -0
  228. package/dist/components/togglable-items-list/togglable-items-list.js +28 -0
  229. package/dist/components/tooltip/tooltip.js +21 -0
  230. package/dist/components/transfer-list/transfer-list.js +413 -0
  231. package/dist/components/truncated-line-with-tooltip/truncated-line-with-tooltip.js +61 -0
  232. package/dist/components/typography/typography-variants.js +41 -0
  233. package/dist/components/typography/typography.js +15 -0
  234. package/dist/components/user-type-badge/user-type-badge.js +40 -0
  235. package/dist/components/user-type-badge/user-type-badge.registry.js +17 -0
  236. package/dist/components/vertical-stepper/vertical-stepper.js +171 -0
  237. package/dist/core/alert.js +33 -0
  238. package/dist/core/animate-ui/components/animate/code-header.js +30 -0
  239. package/dist/core/animate-ui/components/animate/code.js +35 -0
  240. package/dist/core/animate-ui/components/animate/tabs.js +188 -0
  241. package/dist/core/animate-ui/components/animate/tooltip.js +39 -0
  242. package/dist/core/animate-ui/components/base/preview-card.js +29 -0
  243. package/dist/core/animate-ui/components/base/progress.js +32 -0
  244. package/dist/core/animate-ui/components/base/radio.js +24 -0
  245. package/dist/core/animate-ui/components/buttons/copy.js +95 -0
  246. package/dist/core/animate-ui/components/radix/accordion.js +36 -0
  247. package/dist/core/animate-ui/components/radix/dialog.js +60 -0
  248. package/dist/core/animate-ui/components/radix/dropdown-menu.js +129 -0
  249. package/dist/core/animate-ui/components/radix/sheet.js +110 -0
  250. package/dist/core/animate-ui/components/radix/sidebar.js +416 -0
  251. package/dist/core/animate-ui/components/radix/switch.js +34 -0
  252. package/dist/core/animate-ui/components/radix/toggle-group.js +115 -0
  253. package/dist/core/animate-ui/components/radix/toggle.js +24 -0
  254. package/dist/core/animate-ui/primitives/animate/code-block.js +131 -0
  255. package/dist/core/animate-ui/primitives/animate/escape-html.js +7 -0
  256. package/dist/core/animate-ui/primitives/animate/shiki-highlighter.js +64 -0
  257. package/dist/core/animate-ui/primitives/animate/slot.js +39 -0
  258. package/dist/core/animate-ui/primitives/animate/tabs.js +202 -0
  259. package/dist/core/animate-ui/primitives/animate/tooltip.js +351 -0
  260. package/dist/core/animate-ui/primitives/base/preview-card.js +107 -0
  261. package/dist/core/animate-ui/primitives/base/progress.js +60 -0
  262. package/dist/core/animate-ui/primitives/base/radio.js +83 -0
  263. package/dist/core/animate-ui/primitives/buttons/button.js +15 -0
  264. package/dist/core/animate-ui/primitives/effects/highlight.js +407 -0
  265. package/dist/core/animate-ui/primitives/radix/accordion.js +76 -0
  266. package/dist/core/animate-ui/primitives/radix/dialog.js +136 -0
  267. package/dist/core/animate-ui/primitives/radix/dropdown-menu.js +305 -0
  268. package/dist/core/animate-ui/primitives/radix/sheet.js +165 -0
  269. package/dist/core/animate-ui/primitives/radix/switch.js +86 -0
  270. package/dist/core/animate-ui/primitives/radix/toggle-group.js +100 -0
  271. package/dist/core/animate-ui/primitives/texts/counting-number.js +75 -0
  272. package/dist/core/avatar.js +32 -0
  273. package/dist/core/badge.js +27 -0
  274. package/dist/core/breadcrumb.js +62 -0
  275. package/dist/core/button/button.js +43 -0
  276. package/dist/core/button/craft-button.js +78 -0
  277. package/dist/core/button-group.js +38 -0
  278. package/dist/core/button.js +40 -0
  279. package/dist/core/card.js +42 -0
  280. package/dist/core/carousel/carousel.js +149 -0
  281. package/dist/core/checkbox/motion-checkbox.js +103 -0
  282. package/dist/core/collapsible.js +54 -0
  283. package/dist/core/combobox/combobox.js +85 -0
  284. package/dist/core/command.js +61 -0
  285. package/dist/core/field-end-icons.js +36 -0
  286. package/dist/core/field-label-row.js +33 -0
  287. package/dist/core/form.js +92 -0
  288. package/dist/core/hooks/use-controlled-state.js +27 -0
  289. package/dist/core/hooks/use-data-state.js +39 -0
  290. package/dist/core/hooks/use-is-in-view.js +18 -0
  291. package/dist/core/hooks/use-mobile.js +19 -0
  292. package/dist/core/hooks/use-reveal-on-scroll-up.js +141 -0
  293. package/dist/core/hooks/use-scroll-overflow.js +50 -0
  294. package/dist/core/index.js +18 -52
  295. package/dist/core/input/input-password.js +30 -0
  296. package/dist/core/input/input.js +147 -0
  297. package/dist/core/input-otp/input-otp.js +183 -0
  298. package/dist/core/label.js +15 -0
  299. package/dist/core/popover.js +31 -0
  300. package/dist/core/scroll-area.js +42 -0
  301. package/dist/core/select.js +121 -0
  302. package/dist/core/separator.js +40 -0
  303. package/dist/core/skeleton.js +11 -0
  304. package/dist/core/table.js +59 -0
  305. package/dist/core/textarea/textarea.js +97 -0
  306. package/dist/core/utils/get-strict-context.js +18 -0
  307. package/dist/index.js +148 -9
  308. package/dist/layouts/entry-layout/entry-layout-bg.js +4 -0
  309. package/dist/layouts/entry-layout/entry-layout.js +52 -0
  310. package/dist/layouts/index.js +7 -6
  311. package/dist/layouts/workspace-layout/account-menu/account-menu.js +108 -0
  312. package/dist/layouts/workspace-layout/breadcrumbs/derive-breadcrumbs.js +37 -0
  313. package/dist/layouts/workspace-layout/breadcrumbs/workspace-breadcrumbs.js +22 -0
  314. package/dist/layouts/workspace-layout/footer/footer.js +15 -0
  315. package/dist/layouts/workspace-layout/header/header.js +54 -0
  316. package/dist/layouts/workspace-layout/workspace-layout.js +157 -0
  317. package/dist/tailwind-preset.js +3 -4
  318. package/dist/utils/cn.js +8 -0
  319. package/dist/utils/color.js +72 -0
  320. package/dist/utils/index.js +3 -2
  321. package/dist/utils/path-match.js +17 -0
  322. package/dist/utils/silver-shine.js +63 -0
  323. package/dist/utils/variant-gradient-underlay.js +45 -0
  324. package/dist/utils/variant.js +426 -0
  325. package/package.json +7 -4
  326. package/dist/chunk-2GDYZAKR.js +0 -505
  327. package/dist/chunk-ALCWXFUC.js +0 -733
  328. package/dist/chunk-CDHBLANU.js +0 -59
  329. package/dist/chunk-LUESSJAF.js +0 -70068
  330. package/dist/chunk-TMORRNEB.js +0 -323
  331. package/dist/chunk-TRTQSARU.js +0 -31
  332. package/dist/chunk-VU4CZ76T.js +0 -43
  333. package/dist/chunk-XNLCVHBC.js +0 -364
  334. package/dist/chunk-Z4776NRY.js +0 -4347
  335. package/src/assets/illustrations/add-to-group.svg +0 -32
  336. package/src/assets/illustrations/chip.svg +0 -51
  337. package/src/assets/illustrations/create-new-group.svg +0 -27
  338. package/src/assets/illustrations/new-ota.svg +0 -61
  339. package/src/assets/illustrations/secured-key.svg +0 -48
  340. /package/dist/assets/{entry-layout-bg-JPI7GJ42.webp → entry-layout-bg-DUM0UhT3.webp} +0 -0
@@ -0,0 +1,146 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { Avatar, AvatarFallback } from "../../core/avatar.js";
3
+ import { Separator } from "../../core/separator.js";
4
+ import { Label } from "../../core/label.js";
5
+ import { Fragment, cloneElement, createElement, isValidElement } from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/simple-list/simple-list.tsx
8
+ var AVATAR_SIZE = {
9
+ sm: {
10
+ avatar: "h-8 w-8",
11
+ icon: "h-4 w-4"
12
+ },
13
+ default: {
14
+ avatar: "h-10 w-10",
15
+ icon: "h-5 w-5"
16
+ },
17
+ lg: {
18
+ avatar: "h-12 w-12",
19
+ icon: "h-6 w-6"
20
+ }
21
+ };
22
+ var LIST_SIZE_STYLES = {
23
+ sm: {
24
+ listGap: "gap-4",
25
+ rowGap: "gap-3",
26
+ rowGapFromSm: "sm:gap-3",
27
+ itemGap: "gap-1.5",
28
+ labelTypography: "text-xs font-medium",
29
+ rowValueTypography: "text-xs",
30
+ inlineIcon: "h-3.5 w-3.5 shrink-0",
31
+ avatarFallbackTypography: "text-[10px]"
32
+ },
33
+ default: {
34
+ listGap: "gap-5",
35
+ rowGap: "gap-4",
36
+ rowGapFromSm: "sm:gap-4",
37
+ itemGap: "gap-2",
38
+ labelTypography: "text-sm font-medium",
39
+ rowValueTypography: "text-sm",
40
+ inlineIcon: "h-4 w-4 shrink-0",
41
+ avatarFallbackTypography: "text-xs"
42
+ },
43
+ lg: {
44
+ listGap: "gap-6",
45
+ rowGap: "gap-5",
46
+ rowGapFromSm: "sm:gap-5",
47
+ itemGap: "gap-3",
48
+ labelTypography: "text-base font-medium",
49
+ rowValueTypography: "text-base",
50
+ inlineIcon: "h-[18px] w-[18px] shrink-0",
51
+ avatarFallbackTypography: "text-sm"
52
+ }
53
+ };
54
+ /** Detects callable React components: plain function components AND `forwardRef` exotics (e.g. Lucide icons). */
55
+ function isComponentLike(icon) {
56
+ if (icon == null) return false;
57
+ if (typeof icon === "function") return true;
58
+ if (typeof icon === "object" && "$$typeof" in icon) return !isValidElement(icon);
59
+ return false;
60
+ }
61
+ function renderSizedIcon(icon, sizeClass) {
62
+ if (icon == null) return null;
63
+ if (isValidElement(icon)) {
64
+ const el = icon;
65
+ return cloneElement(el, { className: cn(el.props.className, sizeClass) });
66
+ }
67
+ if (isComponentLike(icon)) return createElement(icon, {
68
+ className: cn(sizeClass),
69
+ "aria-hidden": true
70
+ });
71
+ return /* @__PURE__ */ jsx("span", {
72
+ className: cn("inline-flex items-center justify-center", sizeClass),
73
+ "aria-hidden": true,
74
+ children: icon
75
+ });
76
+ }
77
+ function ItemRow({ item, effectiveDirection, iconStyle, avatarSize, size }) {
78
+ const isRow = effectiveDirection === "row";
79
+ const isAvatar = iconStyle === "avatar";
80
+ const isInline = iconStyle === "inline";
81
+ const avatarSizeClasses = AVATAR_SIZE[avatarSize];
82
+ const listSizeStyles = LIST_SIZE_STYLES[size];
83
+ const inlineIconNode = isInline && item.icon != null ? renderSizedIcon(item.icon, listSizeStyles.inlineIcon) : null;
84
+ const avatarNode = isAvatar && item.icon != null ? /* @__PURE__ */ jsx(Avatar, {
85
+ className: cn("shrink-0", avatarSizeClasses.avatar),
86
+ children: /* @__PURE__ */ jsx(AvatarFallback, {
87
+ className: cn("flex items-center justify-center gap-1 border", listSizeStyles.avatarFallbackTypography),
88
+ children: renderSizedIcon(item.icon, avatarSizeClasses.icon)
89
+ })
90
+ }) : null;
91
+ const labelNode = /* @__PURE__ */ jsx(Label, {
92
+ className: listSizeStyles.labelTypography,
93
+ children: inlineIconNode != null ? /* @__PURE__ */ jsxs("span", {
94
+ className: "flex items-center gap-2",
95
+ children: [inlineIconNode, /* @__PURE__ */ jsx("span", { children: item.label })]
96
+ }) : item.label
97
+ });
98
+ if (isAvatar && !isRow) return /* @__PURE__ */ jsxs("div", {
99
+ className: cn("flex flex-row items-start min-w-0", listSizeStyles.rowGap, item.className),
100
+ children: [avatarNode, /* @__PURE__ */ jsxs("div", {
101
+ className: cn("flex min-w-0 flex-1 flex-col", listSizeStyles.itemGap),
102
+ children: [labelNode, item.content]
103
+ })]
104
+ });
105
+ if (isRow) return /* @__PURE__ */ jsxs("div", {
106
+ className: cn("flex flex-row items-start sm:items-center min-w-0", listSizeStyles.rowGap, item.className),
107
+ children: [avatarNode, /* @__PURE__ */ jsxs("div", {
108
+ className: cn("flex min-w-0 flex-1 flex-col sm:flex-row sm:items-center", listSizeStyles.itemGap, listSizeStyles.rowGapFromSm),
109
+ children: [/* @__PURE__ */ jsx("div", {
110
+ className: "shrink-0",
111
+ children: labelNode
112
+ }), /* @__PURE__ */ jsx("div", {
113
+ className: cn("min-w-0 flex sm:flex-1 sm:justify-end", listSizeStyles.rowValueTypography),
114
+ children: item.content
115
+ })]
116
+ })]
117
+ });
118
+ return /* @__PURE__ */ jsxs("div", {
119
+ className: cn("flex flex-col", listSizeStyles.itemGap, item.className),
120
+ children: [labelNode, item.content]
121
+ });
122
+ }
123
+ function SimpleList({ items, size = "default", direction = "column", iconStyle = "inline", avatarSize = "default", separators = true, gapClassName, emptyState, className }) {
124
+ const listSizeStyles = LIST_SIZE_STYLES[size];
125
+ const visibleItems = items.filter((item) => {
126
+ if ((item.hideIfEmpty ?? true) && item.content == null) return false;
127
+ return true;
128
+ });
129
+ if (visibleItems.length === 0) return emptyState != null ? /* @__PURE__ */ jsx(Fragment$1, { children: emptyState }) : null;
130
+ return /* @__PURE__ */ jsx("div", {
131
+ className: cn("flex flex-col", gapClassName ?? listSizeStyles.listGap, className),
132
+ children: visibleItems.map((item, index) => {
133
+ const effectiveDirection = item.direction ?? direction;
134
+ const isLast = index === visibleItems.length - 1;
135
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ItemRow, {
136
+ item,
137
+ effectiveDirection,
138
+ iconStyle,
139
+ avatarSize,
140
+ size
141
+ }), separators && !isLast ? /* @__PURE__ */ jsx(Separator, {}) : null] }, item.key);
142
+ })
143
+ });
144
+ }
145
+ //#endregion
146
+ export { SimpleList };
@@ -0,0 +1,178 @@
1
+ "use client";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { Button } from "../button/button.js";
4
+ import { cloneElement, createElement, isValidElement, useEffect, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { ChevronLeft, ChevronRight } from "lucide-react";
7
+ import { AnimatePresence, motion } from "framer-motion";
8
+ //#region src/components/simple-paginated-list/simple-paginated-list.tsx
9
+ var SIZE_STYLES = {
10
+ sm: {
11
+ rowPad: "py-2",
12
+ insetX: "px-2",
13
+ gap: "gap-2",
14
+ label: "text-xs",
15
+ icon: "h-3.5 w-3.5 shrink-0"
16
+ },
17
+ default: {
18
+ rowPad: "py-3",
19
+ insetX: "px-2",
20
+ gap: "gap-3",
21
+ label: "text-sm",
22
+ icon: "h-4 w-4 shrink-0"
23
+ },
24
+ lg: {
25
+ rowPad: "py-4",
26
+ insetX: "px-3",
27
+ gap: "gap-4",
28
+ label: "text-base",
29
+ icon: "h-5 w-5 shrink-0"
30
+ }
31
+ };
32
+ var slideTransition = {
33
+ duration: .15,
34
+ ease: [
35
+ .22,
36
+ 1,
37
+ .36,
38
+ 1
39
+ ]
40
+ };
41
+ var slideVariants = {
42
+ enter: (dir) => ({
43
+ x: dir > 0 ? "100%" : "-100%",
44
+ opacity: 1
45
+ }),
46
+ center: {
47
+ x: 0,
48
+ opacity: 1
49
+ },
50
+ exit: (dir) => ({
51
+ x: dir > 0 ? "-100%" : "100%",
52
+ opacity: 1
53
+ })
54
+ };
55
+ function isComponentLike(icon) {
56
+ if (icon == null) return false;
57
+ if (typeof icon === "function") return true;
58
+ if (typeof icon === "object" && "$$typeof" in icon) return !isValidElement(icon);
59
+ return false;
60
+ }
61
+ function renderSizedIcon(icon, sizeClass) {
62
+ if (icon == null) return null;
63
+ if (isValidElement(icon)) {
64
+ const el = icon;
65
+ return cloneElement(el, { className: cn(el.props.className, sizeClass) });
66
+ }
67
+ if (isComponentLike(icon)) return createElement(icon, {
68
+ className: cn(sizeClass),
69
+ "aria-hidden": true
70
+ });
71
+ return /* @__PURE__ */ jsx("span", {
72
+ className: cn("inline-flex items-center justify-center", sizeClass),
73
+ "aria-hidden": true,
74
+ children: icon
75
+ });
76
+ }
77
+ function ListRow({ item, showBorder, styles }) {
78
+ return /* @__PURE__ */ jsxs("div", {
79
+ className: cn("flex items-center", styles.gap, styles.rowPad, showBorder && "border-b border-border"),
80
+ children: [
81
+ item.icon != null ? /* @__PURE__ */ jsx("span", {
82
+ className: "shrink-0",
83
+ children: renderSizedIcon(item.icon, styles.icon)
84
+ }) : null,
85
+ /* @__PURE__ */ jsx("span", {
86
+ className: cn("min-w-0 flex-1 truncate", styles.label),
87
+ children: item.label
88
+ }),
89
+ item.action != null ? /* @__PURE__ */ jsx("span", {
90
+ className: "ml-auto shrink-0 overflow-visible",
91
+ children: item.action
92
+ }) : null
93
+ ]
94
+ });
95
+ }
96
+ function SimplePaginatedList({ items, itemsPerPage = 3, size = "default", className }) {
97
+ const [page, setPage] = useState(0);
98
+ const [direction, setDirection] = useState(1);
99
+ const pageSize = Math.max(1, itemsPerPage);
100
+ const totalPages = Math.max(1, Math.ceil(items.length / pageSize));
101
+ const showPagination = items.length > pageSize;
102
+ const pageItems = items.slice(page * pageSize, (page + 1) * pageSize);
103
+ const hasPrev = page > 0;
104
+ const hasNext = page < totalPages - 1;
105
+ const noItems = items.length === 0;
106
+ const styles = SIZE_STYLES[size];
107
+ useEffect(() => {
108
+ setPage((current) => Math.min(current, Math.max(0, totalPages - 1)));
109
+ }, [
110
+ items,
111
+ pageSize,
112
+ totalPages
113
+ ]);
114
+ const goPrev = () => {
115
+ if (!hasPrev || noItems) return;
116
+ setDirection(-1);
117
+ setPage((current) => current - 1);
118
+ };
119
+ const goNext = () => {
120
+ if (!hasNext || noItems) return;
121
+ setDirection(1);
122
+ setPage((current) => current + 1);
123
+ };
124
+ return /* @__PURE__ */ jsxs("div", {
125
+ className: cn("w-full", className),
126
+ children: [/* @__PURE__ */ jsx("div", {
127
+ className: cn("overflow-hidden", styles.insetX),
128
+ children: /* @__PURE__ */ jsx(AnimatePresence, {
129
+ mode: "wait",
130
+ custom: direction,
131
+ children: /* @__PURE__ */ jsx(motion.div, {
132
+ custom: direction,
133
+ variants: slideVariants,
134
+ initial: "enter",
135
+ animate: "center",
136
+ exit: "exit",
137
+ transition: slideTransition,
138
+ children: pageItems.map((item, index) => /* @__PURE__ */ jsx(ListRow, {
139
+ item,
140
+ showBorder: index < pageItems.length - 1,
141
+ styles
142
+ }, item.id))
143
+ }, page)
144
+ })
145
+ }), showPagination ? /* @__PURE__ */ jsxs("div", {
146
+ className: cn("mt-3 flex justify-end gap-1", styles.insetX),
147
+ children: [/* @__PURE__ */ jsx(Button, {
148
+ type: "button",
149
+ variant: "ghost",
150
+ color: "primary",
151
+ size: "icon",
152
+ fullWidth: false,
153
+ "aria-label": "Previous page",
154
+ disabled: noItems || !hasPrev,
155
+ onClick: goPrev,
156
+ children: /* @__PURE__ */ jsx(ChevronLeft, {
157
+ className: "text-primary",
158
+ "aria-hidden": true
159
+ })
160
+ }), /* @__PURE__ */ jsx(Button, {
161
+ type: "button",
162
+ variant: "ghost",
163
+ color: "primary",
164
+ size: "icon",
165
+ fullWidth: false,
166
+ "aria-label": "Next page",
167
+ disabled: noItems || !hasNext,
168
+ onClick: goNext,
169
+ children: /* @__PURE__ */ jsx(ChevronRight, {
170
+ className: "text-primary",
171
+ "aria-hidden": true
172
+ })
173
+ })]
174
+ }) : null]
175
+ });
176
+ }
177
+ //#endregion
178
+ export { SimplePaginatedList };
@@ -0,0 +1,56 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import Tooltip from "../tooltip/tooltip.js";
3
+ import { useMemo } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/simplified-date/simplified-date.tsx
6
+ var DEFAULT_DATE_FORMAT = "dd/MM/yyyy HH:mm:ss";
7
+ var MS_THRESHOLD = 1e10;
8
+ /** Applied only when `relative` is true (relative time + tooltip). */
9
+ var RELATIVE_TIME_OUTER_CLASSES = "underline underline-offset-5 decoration-primary/20";
10
+ function normalizeTimestamp(ts) {
11
+ if (!Number.isFinite(ts) || ts <= 0) return null;
12
+ return ts < MS_THRESHOLD ? ts * 1e3 : ts;
13
+ }
14
+ function computeRelativeTime(ms) {
15
+ const seconds = Math.floor((Date.now() - ms) / 1e3);
16
+ if (seconds < 60) return "just now";
17
+ const minutes = Math.floor(seconds / 60);
18
+ if (minutes < 60) return `${minutes}m ago`;
19
+ const hours = Math.floor(minutes / 60);
20
+ if (hours < 24) return `${hours}h ago`;
21
+ const days = Math.floor(hours / 24);
22
+ if (days < 30) return `${days}d ago`;
23
+ const months = Math.floor(days / 30);
24
+ if (months < 12) return `${months}mo ago`;
25
+ return `${Math.floor(months / 12)}y ago`;
26
+ }
27
+ function formatDate(date, format) {
28
+ const pad = (n) => String(n).padStart(2, "0");
29
+ const tokens = {
30
+ dd: pad(date.getDate()),
31
+ MM: pad(date.getMonth() + 1),
32
+ yyyy: String(date.getFullYear()),
33
+ HH: pad(date.getHours()),
34
+ mm: pad(date.getMinutes()),
35
+ ss: pad(date.getSeconds())
36
+ };
37
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, (match) => tokens[match]);
38
+ }
39
+ function SimplifiedDate({ ts, dateFormat, className, relative = false }) {
40
+ const ms = useMemo(() => ts != null ? normalizeTimestamp(ts) : null, [ts]);
41
+ if (ms === null) return null;
42
+ const detailedDate = formatDate(new Date(ms), dateFormat ?? DEFAULT_DATE_FORMAT);
43
+ if (relative) return /* @__PURE__ */ jsx(Tooltip, {
44
+ content: detailedDate,
45
+ children: /* @__PURE__ */ jsx("span", {
46
+ className: cn(RELATIVE_TIME_OUTER_CLASSES, className),
47
+ children: computeRelativeTime(ms)
48
+ })
49
+ });
50
+ return /* @__PURE__ */ jsx("span", {
51
+ className: cn(className),
52
+ children: detailedDate
53
+ });
54
+ }
55
+ //#endregion
56
+ export { SimplifiedDate };
@@ -0,0 +1,16 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { Skeleton } from "../../core/skeleton.js";
3
+ import { TableBody, TableCell, TableRow } from "../../core/table.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/skeletons/table-skeleton.tsx
6
+ function TableSkeleton({ totalRows = 5, totalColumns = 5, showBorder = false, padFirstColumn = false }) {
7
+ return /* @__PURE__ */ jsx(TableBody, { children: Array.from({ length: totalRows }).map((_, rowIndex) => /* @__PURE__ */ jsx(TableRow, {
8
+ className: cn(showBorder ? "border-b border-border/50 last:border-b-0" : "border-0"),
9
+ children: Array.from({ length: totalColumns }).map((_, colIndex) => /* @__PURE__ */ jsx(TableCell, {
10
+ className: cn("px-2 py-4", padFirstColumn && colIndex === 0 && "pl-4"),
11
+ children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" })
12
+ }, colIndex))
13
+ }, rowIndex)) });
14
+ }
15
+ //#endregion
16
+ export { TableSkeleton };
@@ -0,0 +1,25 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { resolveColor } from "../../utils/color.js";
3
+ import * as React$1 from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { LoaderCircle } from "lucide-react";
6
+ //#region src/components/spinner/spinner.tsx
7
+ var Spinner = React$1.forwardRef(function Spinner({ color, size, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...rest }, ref) {
8
+ const resolved = color != null ? resolveColor(color, "text") : void 0;
9
+ const ariaLabelResolved = ariaLabelledby != null ? void 0 : ariaLabel !== void 0 ? ariaLabel : "Loading";
10
+ return /* @__PURE__ */ jsx(LoaderCircle, {
11
+ ref,
12
+ ...rest,
13
+ className: cn("animate-spin", resolved?.className, className),
14
+ style: {
15
+ ...resolved?.style,
16
+ ...style
17
+ },
18
+ size: size ?? "1em",
19
+ "aria-label": ariaLabelResolved,
20
+ "aria-labelledby": ariaLabelledby
21
+ });
22
+ });
23
+ Spinner.displayName = "Spinner";
24
+ //#endregion
25
+ export { Spinner };
@@ -0,0 +1,206 @@
1
+ "use client";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { isPresetColor } from "../../utils/color.js";
4
+ import { Popover, PopoverContent, PopoverTrigger } from "../../core/popover.js";
5
+ import { IconAvatar } from "../icon-avatar/icon-avatar.js";
6
+ import { Typography } from "../typography/typography.js";
7
+ import { Badge } from "../../core/badge.js";
8
+ import { Spinner } from "../spinner/spinner.js";
9
+ import * as React$1 from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { Info, Triangle } from "lucide-react";
12
+ //#region src/components/stat-card/stat-card.tsx
13
+ var PRESET_SURFACE_CLASS = {
14
+ primary: "bg-gradient-to-br from-primary/5 to-primary/10",
15
+ secondary: "bg-gradient-to-br from-secondary/5 to-secondary/10",
16
+ error: "bg-gradient-to-br from-error/5 to-error/10",
17
+ info: "bg-gradient-to-br from-info/5 to-info/10",
18
+ success: "bg-gradient-to-br from-success/5 to-success/10",
19
+ warning: "bg-gradient-to-br from-warning/5 to-warning/10",
20
+ disabled: "bg-gradient-to-br from-disabled/5 to-disabled/10",
21
+ gray: "bg-gradient-to-br from-gray/5 to-gray/10",
22
+ mist: "bg-gradient-to-br from-mist to-mist-border"
23
+ };
24
+ var PRESET_INFO_CLASS = {
25
+ primary: "text-primary/50 hover:text-primary/80 focus-visible:ring-primary/80",
26
+ secondary: "text-secondary/50 hover:text-secondary/80 focus-visible:ring-secondary/80",
27
+ error: "text-error/50 hover:text-error/80 focus-visible:ring-error/80",
28
+ info: "text-info/50 hover:text-info/80 focus-visible:ring-info/80",
29
+ success: "text-success/50 hover:text-success/80 focus-visible:ring-success/80",
30
+ warning: "text-warning/50 hover:text-warning/80 focus-visible:ring-warning/80",
31
+ disabled: "text-disabled/50 hover:text-disabled/80 focus-visible:ring-disabled/80",
32
+ gray: "text-gray/50 hover:text-gray/80 focus-visible:ring-gray/80",
33
+ mist: "text-mist-secondary hover:text-mist-foreground focus-visible:ring-mist-border"
34
+ };
35
+ var SIZE_STYLES = {
36
+ sm: {
37
+ card: "rounded-2xl p-4",
38
+ gap: "gap-4",
39
+ headerGap: "gap-3",
40
+ avatar: 40,
41
+ icon: "size-5",
42
+ heading: "text-base",
43
+ value: "text-2xl",
44
+ footer: "text-xs",
45
+ badge: "gap-1 rounded-full px-2.5 py-0.5 text-xs",
46
+ info: "size-7 [&_svg]:size-4"
47
+ },
48
+ default: {
49
+ card: "rounded-2xl p-5",
50
+ gap: "gap-5",
51
+ headerGap: "gap-3",
52
+ avatar: 52,
53
+ icon: "size-6",
54
+ heading: "text-xl",
55
+ value: "text-3xl",
56
+ footer: "text-sm",
57
+ badge: "gap-1 rounded-full px-3 py-1 text-sm",
58
+ info: "size-8 [&_svg]:size-5"
59
+ },
60
+ lg: {
61
+ card: "rounded-3xl p-6",
62
+ gap: "gap-6",
63
+ headerGap: "gap-4",
64
+ avatar: 60,
65
+ icon: "size-7",
66
+ heading: "text-2xl",
67
+ value: "text-4xl",
68
+ footer: "text-base",
69
+ badge: "gap-1.5 rounded-full px-3.5 py-1 text-base",
70
+ info: "size-9 [&_svg]:size-6"
71
+ }
72
+ };
73
+ function hasRenderableContent(content) {
74
+ if (content === void 0 || content === null) return false;
75
+ if (typeof content === "string") return content.length > 0;
76
+ if (typeof content === "boolean") return false;
77
+ return true;
78
+ }
79
+ function resolveStatColor(color, value, previousValue) {
80
+ if (color !== void 0) return color;
81
+ if (previousValue !== void 0) return value - previousValue < 0 ? "error" : "success";
82
+ return "primary";
83
+ }
84
+ function resolveSurface(color) {
85
+ if (isPresetColor(color)) return { className: PRESET_SURFACE_CLASS[color] };
86
+ return { style: { backgroundImage: `linear-gradient(135deg, color-mix(in srgb, ${color} 7%, transparent), color-mix(in srgb, ${color} 14%, transparent))` } };
87
+ }
88
+ function renderSizedIcon(icon, iconClassName) {
89
+ if (icon == null) return null;
90
+ if (React$1.isValidElement(icon)) {
91
+ const el = icon;
92
+ return React$1.cloneElement(el, { className: cn(el.props.className, "shrink-0", iconClassName) });
93
+ }
94
+ return /* @__PURE__ */ jsx("span", {
95
+ className: cn("inline-flex shrink-0 items-center justify-center", iconClassName),
96
+ children: icon
97
+ });
98
+ }
99
+ function formatValue(value, valueType) {
100
+ if (valueType === "string") return String(value);
101
+ const formatted = value.toLocaleString();
102
+ if (valueType === "percentage") return `${formatted}%`;
103
+ return formatted;
104
+ }
105
+ function getTrend(value, previousValue) {
106
+ if (previousValue === void 0) return void 0;
107
+ if (!Number.isFinite(value) || !Number.isFinite(previousValue)) return void 0;
108
+ if (previousValue === 0) return void 0;
109
+ const percent = (value - previousValue) / Math.abs(previousValue) * 100;
110
+ if (!Number.isFinite(percent)) return void 0;
111
+ return {
112
+ direction: percent > 0 ? "up" : percent < 0 ? "down" : "flat",
113
+ label: `${Math.abs(percent).toLocaleString(void 0, { maximumFractionDigits: 1 })}%`
114
+ };
115
+ }
116
+ var StatCard = React$1.forwardRef(({ color, size = "default", loading = false, icon, heading, value, previousValue, previousValueComparisonTip, infoContent, valueType = "number", className, style, ...divProps }, ref) => {
117
+ const s = SIZE_STYLES[size];
118
+ const statColor = resolveStatColor(color, value, previousValue);
119
+ const surface = resolveSurface(statColor);
120
+ const trend = getTrend(value, previousValue);
121
+ const showTrend = trend !== void 0 && !(value === 0 && previousValue === 0);
122
+ const showInfo = hasRenderableContent(infoContent);
123
+ const showFooter = showTrend || showInfo;
124
+ const presetInfoClass = isPresetColor(statColor) ? PRESET_INFO_CLASS[statColor] : void 0;
125
+ const infoButtonStyle = !isPresetColor(statColor) && typeof statColor === "string" ? {
126
+ color: statColor,
127
+ "--tw-ring-color": statColor
128
+ } : void 0;
129
+ return /* @__PURE__ */ jsxs("div", {
130
+ ref,
131
+ className: cn("relative isolate flex w-full flex-col overflow-hidden border border-transparent text-foreground", s.card, surface.className, className),
132
+ style: {
133
+ ...surface.style,
134
+ ...style
135
+ },
136
+ "aria-busy": loading,
137
+ ...divProps,
138
+ children: [loading ? /* @__PURE__ */ jsx("div", {
139
+ className: "pointer-events-none absolute inset-0 z-20 flex items-center justify-center",
140
+ children: /* @__PURE__ */ jsx(Spinner, {
141
+ size: s.avatar,
142
+ color: statColor
143
+ })
144
+ }) : null, /* @__PURE__ */ jsxs("div", {
145
+ className: cn("relative z-10 flex flex-col", s.gap, loading && "pointer-events-none blur-[1px] opacity-60"),
146
+ children: [
147
+ /* @__PURE__ */ jsxs("div", {
148
+ className: cn("flex items-center", s.headerGap),
149
+ children: [icon ? /* @__PURE__ */ jsx(IconAvatar, {
150
+ color: statColor,
151
+ size: s.avatar,
152
+ ring: {
153
+ show: true,
154
+ color: statColor
155
+ },
156
+ children: renderSizedIcon(icon, s.icon)
157
+ }) : null, /* @__PURE__ */ jsx(Typography, {
158
+ as: "div",
159
+ variant: "h5",
160
+ className: cn("font-medium leading-tight", s.heading),
161
+ children: heading
162
+ })]
163
+ }),
164
+ /* @__PURE__ */ jsx("div", {
165
+ className: cn("font-bold leading-none tracking-tight text-foreground", s.value),
166
+ children: formatValue(value, valueType)
167
+ }),
168
+ showFooter ? /* @__PURE__ */ jsxs("div", {
169
+ className: cn("flex items-center gap-3", s.footer),
170
+ children: [/* @__PURE__ */ jsxs("div", {
171
+ className: "flex min-w-0 flex-1 items-center gap-3",
172
+ children: [showTrend ? /* @__PURE__ */ jsxs(Badge, {
173
+ color: statColor,
174
+ variant: "outline",
175
+ className: s.badge,
176
+ children: [trend.direction === "flat" ? null : /* @__PURE__ */ jsx(Triangle, {
177
+ "aria-hidden": true,
178
+ className: cn("size-3 fill-current stroke-current", trend.direction === "down" && "rotate-180")
179
+ }), trend.label]
180
+ }) : null, showTrend && hasRenderableContent(previousValueComparisonTip) ? /* @__PURE__ */ jsx("span", {
181
+ className: "min-w-0 truncate text-foreground",
182
+ children: previousValueComparisonTip
183
+ }) : null]
184
+ }), showInfo ? /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
185
+ asChild: true,
186
+ children: /* @__PURE__ */ jsx("button", {
187
+ type: "button",
188
+ "aria-label": "More information",
189
+ className: cn("inline-flex shrink-0 items-center justify-center rounded-full outline-none transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background", s.info, presetInfoClass),
190
+ style: infoButtonStyle,
191
+ children: /* @__PURE__ */ jsx(Info, { "aria-hidden": true })
192
+ })
193
+ }), /* @__PURE__ */ jsx(PopoverContent, {
194
+ align: "end",
195
+ side: "top",
196
+ sideOffset: 8,
197
+ children: infoContent
198
+ })] }) : null]
199
+ }) : null
200
+ ]
201
+ })]
202
+ });
203
+ });
204
+ StatCard.displayName = "StatCard";
205
+ //#endregion
206
+ export { StatCard };