@espressif/dashboard-ui-components 1.9.1 → 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 (341) hide show
  1. package/CHANGELOG.md +179 -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 +159 -63
  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.d.ts +1 -1
  308. package/dist/index.js +148 -9
  309. package/dist/layouts/entry-layout/entry-layout-bg.js +4 -0
  310. package/dist/layouts/entry-layout/entry-layout.js +52 -0
  311. package/dist/layouts/index.js +7 -6
  312. package/dist/layouts/workspace-layout/account-menu/account-menu.js +108 -0
  313. package/dist/layouts/workspace-layout/breadcrumbs/derive-breadcrumbs.js +37 -0
  314. package/dist/layouts/workspace-layout/breadcrumbs/workspace-breadcrumbs.js +22 -0
  315. package/dist/layouts/workspace-layout/footer/footer.js +15 -0
  316. package/dist/layouts/workspace-layout/header/header.js +54 -0
  317. package/dist/layouts/workspace-layout/workspace-layout.js +157 -0
  318. package/dist/tailwind-preset.js +3 -4
  319. package/dist/utils/cn.js +8 -0
  320. package/dist/utils/color.js +72 -0
  321. package/dist/utils/index.js +3 -2
  322. package/dist/utils/path-match.js +17 -0
  323. package/dist/utils/silver-shine.js +63 -0
  324. package/dist/utils/variant-gradient-underlay.js +45 -0
  325. package/dist/utils/variant.js +426 -0
  326. package/package.json +7 -4
  327. package/dist/chunk-ABBHGIFI.js +0 -733
  328. package/dist/chunk-HIUBSBAP.js +0 -59
  329. package/dist/chunk-OKB2WTX7.js +0 -363
  330. package/dist/chunk-P6F6UWV2.js +0 -323
  331. package/dist/chunk-TRTQSARU.js +0 -31
  332. package/dist/chunk-VU4CZ76T.js +0 -43
  333. package/dist/chunk-XFYL5IZU.js +0 -69604
  334. package/dist/chunk-XW6Z6VO4.js +0 -505
  335. package/dist/chunk-ZFYUONPY.js +0 -4321
  336. package/src/assets/illustrations/add-to-group.svg +0 -32
  337. package/src/assets/illustrations/chip.svg +0 -51
  338. package/src/assets/illustrations/create-new-group.svg +0 -27
  339. package/src/assets/illustrations/new-ota.svg +0 -61
  340. package/src/assets/illustrations/secured-key.svg +0 -48
  341. /package/dist/assets/{entry-layout-bg-JPI7GJ42.webp → entry-layout-bg-DUM0UhT3.webp} +0 -0
@@ -0,0 +1,68 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { Avatar, AvatarFallback } from "../../core/avatar.js";
3
+ import { ScrollArea } from "../../core/scroll-area.js";
4
+ import { Dialog, DialogContent } from "../../core/animate-ui/components/radix/dialog.js";
5
+ import "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/fullscreen-dialog/fullscreen-dialog.tsx
8
+ var iconSizeMap = {
9
+ sm: {
10
+ avatar: "h-12 w-12",
11
+ icon: "size-6 [&_svg]:size-6"
12
+ },
13
+ md: {
14
+ avatar: "h-16 w-16",
15
+ icon: "size-8 [&_svg]:size-8"
16
+ },
17
+ lg: {
18
+ avatar: "h-20 w-20",
19
+ icon: "size-10 [&_svg]:size-10"
20
+ }
21
+ };
22
+ function FullscreenDialog({ icon, iconSize = "lg", heading, secondaryText, children, open, onOpenChange, closeOnEscape = true, noGutters = false }) {
23
+ const sizeClasses = iconSizeMap[iconSize];
24
+ return /* @__PURE__ */ jsx(Dialog, {
25
+ open,
26
+ onOpenChange,
27
+ children: /* @__PURE__ */ jsx(DialogContent, {
28
+ className: cn("!w-[100vw] !max-w-[100vw] !h-[100dvh] !max-h-[100dvh] rounded-none flex flex-col gap-0 overflow-hidden", noGutters ? "!p-0" : "p-4"),
29
+ showCloseButton: true,
30
+ closeButtonClassName: "[&_svg]:!size-6 cursor-pointer",
31
+ onEscapeKeyDown: (event) => {
32
+ if (!closeOnEscape) event.preventDefault();
33
+ },
34
+ children: /* @__PURE__ */ jsxs("div", {
35
+ className: cn("flex flex-col flex-1 min-h-0 w-full mx-auto overflow-hidden", !noGutters && "max-w-7xl"),
36
+ children: [
37
+ icon != null && /* @__PURE__ */ jsx(Avatar, {
38
+ className: cn("shrink-0 rounded-full mx-auto mb-4", sizeClasses.avatar),
39
+ children: /* @__PURE__ */ jsx(AvatarFallback, {
40
+ className: "rounded-full bg-accent/80",
41
+ children: /* @__PURE__ */ jsx("span", {
42
+ className: sizeClasses.icon,
43
+ children: icon
44
+ })
45
+ })
46
+ }),
47
+ heading != null && /* @__PURE__ */ jsx("h1", {
48
+ className: "text-2xl mb-4 font-normal text-center text-muted-foreground shrink-0",
49
+ children: heading
50
+ }),
51
+ secondaryText != null && /* @__PURE__ */ jsx("div", {
52
+ className: "flex justify-center",
53
+ children: /* @__PURE__ */ jsx("div", {
54
+ className: "mb-4",
55
+ children: secondaryText
56
+ })
57
+ }),
58
+ /* @__PURE__ */ jsx(ScrollArea, {
59
+ className: cn("flex-1 min-h-0", noGutters ? "p-0" : "px-6 py-4"),
60
+ children
61
+ })
62
+ ]
63
+ })
64
+ })
65
+ });
66
+ }
67
+ //#endregion
68
+ export { FullscreenDialog };
@@ -0,0 +1,130 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { isPresetColor, resolveColor } from "../../utils/color.js";
3
+ import { resolveVariantStyles } from "../../utils/variant.js";
4
+ import { VariantGradientUnderlay } from "../../utils/variant-gradient-underlay.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/icon-avatar/icon-avatar.tsx
7
+ var TINTED_FILL = {
8
+ primary: "bg-primary/5",
9
+ secondary: "bg-secondary/5",
10
+ error: "bg-error/5",
11
+ info: "bg-info/5",
12
+ success: "bg-success/5",
13
+ warning: "bg-warning/5",
14
+ disabled: "bg-disabled/5",
15
+ gray: "bg-gray/5",
16
+ mist: "bg-mist"
17
+ };
18
+ var TINTED_FG = {
19
+ primary: "text-primary",
20
+ secondary: "text-secondary",
21
+ error: "text-error",
22
+ info: "text-info",
23
+ success: "text-success",
24
+ warning: "text-warning",
25
+ disabled: "text-disabled",
26
+ gray: "text-gray",
27
+ mist: "text-mist-foreground"
28
+ };
29
+ var TINTED_BG = Object.fromEntries(Object.keys(TINTED_FILL).map((k) => [k, `${TINTED_FILL[k]} ${TINTED_FG[k]}`]));
30
+ var RING_BORDER = {
31
+ primary: "ring-primary/30",
32
+ secondary: "ring-secondary/30",
33
+ error: "ring-error/30",
34
+ info: "ring-info/30",
35
+ success: "ring-success/30",
36
+ warning: "ring-warning/30",
37
+ disabled: "ring-disabled/30",
38
+ gray: "ring-gray/30",
39
+ mist: "ring-mist-border"
40
+ };
41
+ function resolveTintedBg(color) {
42
+ if (isPresetColor(color)) return { className: TINTED_BG[color] };
43
+ return { style: {
44
+ backgroundColor: `color-mix(in srgb, ${color} 15%, transparent)`,
45
+ color
46
+ } };
47
+ }
48
+ function resolveTintedFill(color) {
49
+ if (isPresetColor(color)) return { className: TINTED_FILL[color] };
50
+ return { style: { backgroundColor: `color-mix(in srgb, ${color} 15%, transparent)` } };
51
+ }
52
+ function resolveTintedFg(color) {
53
+ if (isPresetColor(color)) return { className: TINTED_FG[color] };
54
+ return { style: { color } };
55
+ }
56
+ function resolveRingBorder(color) {
57
+ if (isPresetColor(color)) return { className: RING_BORDER[color] };
58
+ return { style: { "--tw-ring-color": color } };
59
+ }
60
+ function resolveAvatarVariant(color, variant) {
61
+ const styles = resolveVariantStyles(variant, color);
62
+ return {
63
+ className: styles.container,
64
+ style: styles.containerStyle,
65
+ underlay: /* @__PURE__ */ jsx(VariantGradientUnderlay, {
66
+ layers: styles.gradientHoverLayers,
67
+ layersInline: styles.gradientHoverLayersInline,
68
+ silverShine: styles.silverShine,
69
+ silverBorder: styles.silverBorder
70
+ })
71
+ };
72
+ }
73
+ function IconAvatar({ size = 24, color = "primary", variant = "legacy", ring, children, className, discClassName, discStyle }) {
74
+ const tinted = resolveTintedBg(color);
75
+ const tintedFill = resolveTintedFill(color);
76
+ const tintedFg = resolveTintedFg(color);
77
+ const variantSurface = variant === "legacy" ? void 0 : resolveAvatarVariant(color, variant);
78
+ const showRing = ring?.show ?? false;
79
+ const pulsate = showRing && (ring?.pulsate ?? false);
80
+ const ringColor = ring?.color ?? "primary";
81
+ const ringBorder = showRing && !pulsate ? resolveRingBorder(ringColor) : void 0;
82
+ const ringEmit = showRing && pulsate ? resolveColor(ringColor, "text") : void 0;
83
+ if (pulsate) return /* @__PURE__ */ jsxs("span", {
84
+ className: cn("relative isolate inline-flex shrink-0 items-center justify-center rounded-full", className),
85
+ style: {
86
+ width: size,
87
+ height: size
88
+ },
89
+ children: [
90
+ /* @__PURE__ */ jsx("span", {
91
+ className: cn("absolute inset-0 z-0 overflow-hidden rounded-full", variantSurface?.className ?? tintedFill.className, discClassName),
92
+ style: {
93
+ ...variantSurface?.style ?? tintedFill.style,
94
+ ...discStyle
95
+ },
96
+ children: variantSurface?.underlay
97
+ }),
98
+ /* @__PURE__ */ jsx("span", {
99
+ "aria-hidden": true,
100
+ className: cn("pointer-events-none absolute inset-0 z-[1] rounded-full animate-avatar-ring", ringEmit?.className),
101
+ style: ringEmit?.style
102
+ }),
103
+ /* @__PURE__ */ jsx("span", {
104
+ className: cn("relative z-10 inline-flex items-center justify-center", variant === "legacy" && tintedFg.className),
105
+ style: variant === "legacy" ? tintedFg.style : void 0,
106
+ children
107
+ })
108
+ ]
109
+ });
110
+ return /* @__PURE__ */ jsx("span", {
111
+ className: cn("relative isolate inline-flex shrink-0 items-center justify-center", className),
112
+ style: {
113
+ width: size,
114
+ height: size
115
+ },
116
+ children: /* @__PURE__ */ jsxs("span", {
117
+ className: cn("relative z-10 inline-flex items-center justify-center overflow-hidden rounded-full", variantSurface?.className ?? tinted.className, showRing && "ring-1 ring-offset-0.5 ring-offset-transparent", ringBorder?.className, discClassName),
118
+ style: {
119
+ width: size,
120
+ height: size,
121
+ ...variantSurface?.style ?? tinted.style,
122
+ ...ringBorder?.style,
123
+ ...discStyle
124
+ },
125
+ children: [variantSurface?.underlay, children]
126
+ })
127
+ });
128
+ }
129
+ //#endregion
130
+ export { IconAvatar };
@@ -0,0 +1,190 @@
1
+ "use client";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { isPresetColor } from "../../utils/color.js";
4
+ import { TooltipProvider } from "../../core/animate-ui/components/animate/tooltip.js";
5
+ import { PRESET_RING_CLASSES, renderGradientBackdropLayers, renderLeadingIconRow, renderTitleAndDescriptionBlocks, ringTransitionClass, useSimpleClickableCardSurface } from "../simple-clickable-card/simple-clickable-card-shared.js";
6
+ import * as React$1 from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { ChevronRight } from "lucide-react";
9
+ //#region src/components/icon-text-action-card/icon-text-action-card.tsx
10
+ function trailingLeadAndSlot(options) {
11
+ const { icon, s, iconAvatarColor, iconAvatarRingColor, iconAvatarVariant, iconAvatarDiscStyle, titleBlock, descriptionBlock, variant, fgClass, fgStyle, trailingSlot } = options;
12
+ const leadingInner = renderLeadingIconRow({
13
+ icon,
14
+ s,
15
+ iconAvatarColor,
16
+ iconAvatarRingColor,
17
+ iconAvatarVariant,
18
+ iconAvatarDiscStyle,
19
+ titleBlock,
20
+ descriptionBlock,
21
+ gradientZStyle: false
22
+ });
23
+ return /* @__PURE__ */ jsxs("span", {
24
+ className: cn("inline-flex min-w-0 flex-1 items-center", s.gap, variant === "gradient" && "relative z-10"),
25
+ children: [leadingInner, trailingSlot]
26
+ });
27
+ }
28
+ var ACTIONS_ROW_CLASS = "flex-wrap";
29
+ var ACTIONS_LEADING_BASIS_CLASS = {
30
+ auto: "basis-48",
31
+ below: "basis-full"
32
+ };
33
+ var ACTIONS_SLOT_CLASS = "relative z-10 ml-auto max-w-full shrink-0";
34
+ function shellPresetRing(color) {
35
+ const c = color ?? "gray";
36
+ return isPresetColor(c) ? PRESET_RING_CLASSES[c] : "";
37
+ }
38
+ var IconTextActionCard = React$1.forwardRef(({ icon, title, description, truncateTitle = false, truncateDescription = false, onClick, actions, showActionsOnlyOnHover = false, actionsPlacement = "auto", color = "gray", iconAvatarVariant: iconAvatarVariantProp, iconAvatarColor: iconAvatarColorProp, size = "default", variant = "soft", className, type = "button", disabled, ...rest }, ref) => {
39
+ const { onMouseEnter: onMouseEnterProp, onMouseLeave: onMouseLeaveProp, ...domRest } = rest;
40
+ const interactive = onClick != null;
41
+ const showActionsSlot = actions != null;
42
+ const { s, styles, isArbitraryGradient, surfaceStyleWithoutGradientBg, presetGradientPair, surfaceContainerClass, presetRingClasses, ringAccentStyle, iconAvatarColor: resolvedIconAvatarColor, iconAvatarVariant: resolvedIconAvatarVariant, iconAvatarDiscStyle } = useSimpleClickableCardSurface({
43
+ variant,
44
+ color,
45
+ size
46
+ });
47
+ const iconAvatarColor = iconAvatarColorProp ?? resolvedIconAvatarColor;
48
+ const iconAvatarVariant = iconAvatarVariantProp ?? resolvedIconAvatarVariant;
49
+ const iconAvatarRingColor = iconAvatarColorProp ?? color;
50
+ const resolvedDiscStyle = iconAvatarColorProp == null ? iconAvatarDiscStyle : void 0;
51
+ const fgClass = styles.foreground;
52
+ const fgStyle = styles.foregroundStyle;
53
+ const descClass = styles.description;
54
+ const descStyle = styles.descriptionStyle;
55
+ const { titleBlock, descriptionBlock } = renderTitleAndDescriptionBlocks({
56
+ title,
57
+ description,
58
+ truncateTitle,
59
+ truncateDescription,
60
+ s,
61
+ fgClass,
62
+ fgStyle,
63
+ descClass,
64
+ descStyle
65
+ });
66
+ const gradientLayers = renderGradientBackdropLayers({
67
+ variant,
68
+ color,
69
+ presetGradientPair
70
+ });
71
+ const leadingMain = renderLeadingIconRow({
72
+ icon,
73
+ s,
74
+ iconAvatarColor,
75
+ iconAvatarRingColor,
76
+ iconAvatarVariant,
77
+ iconAvatarDiscStyle: resolvedDiscStyle,
78
+ titleBlock,
79
+ descriptionBlock,
80
+ gradientZStyle: false
81
+ });
82
+ const surfaceStyleMerged = {
83
+ ...isArbitraryGradient ? surfaceStyleWithoutGradientBg : styles.containerStyle,
84
+ ...ringAccentStyle
85
+ };
86
+ const shellRingClass = shellPresetRing(color);
87
+ const trailingChevron = interactive && !showActionsSlot ? /* @__PURE__ */ jsx(ChevronRight, {
88
+ "aria-hidden": true,
89
+ size: s.chevronPx,
90
+ className: cn("shrink-0", fgClass),
91
+ style: fgStyle
92
+ }) : null;
93
+ const rowInteractiveFull = interactive && !showActionsSlot ? trailingLeadAndSlot({
94
+ icon,
95
+ s,
96
+ iconAvatarColor,
97
+ iconAvatarRingColor,
98
+ iconAvatarVariant,
99
+ iconAvatarDiscStyle: resolvedDiscStyle,
100
+ titleBlock,
101
+ descriptionBlock,
102
+ variant,
103
+ fgClass,
104
+ fgStyle,
105
+ trailingSlot: trailingChevron
106
+ }) : null;
107
+ const staticBlock = /* @__PURE__ */ jsx("div", {
108
+ className: cn("-m-0 inline-flex min-h-0 min-w-0 flex-1 cursor-default select-text items-center rounded-none border-0 bg-transparent text-left outline-none", !showActionsSlot ? s.gap : void 0, variant === "gradient" && "relative z-10", !showActionsSlot && "w-full min-w-0", showActionsSlot && ["min-w-0", ACTIONS_LEADING_BASIS_CLASS[actionsPlacement]]),
109
+ children: leadingMain
110
+ });
111
+ if (!interactive && !showActionsSlot) return /* @__PURE__ */ jsx(TooltipProvider, {
112
+ openDelay: 300,
113
+ closeDelay: 100,
114
+ children: /* @__PURE__ */ jsxs("div", {
115
+ ref,
116
+ "aria-disabled": disabled === true ? true : void 0,
117
+ className: cn("relative isolate inline-flex w-full cursor-default items-center overflow-hidden rounded-xl text-left ring-offset-background", variant === "gradient" && "group", disabled && "pointer-events-none opacity-50", s.rowPad, surfaceContainerClass, className),
118
+ style: surfaceStyleMerged,
119
+ ...domRest,
120
+ children: [gradientLayers, staticBlock]
121
+ })
122
+ });
123
+ if (!interactive && showActionsSlot) return /* @__PURE__ */ jsx(TooltipProvider, {
124
+ openDelay: 300,
125
+ closeDelay: 100,
126
+ children: /* @__PURE__ */ jsxs("div", {
127
+ ref,
128
+ "aria-disabled": disabled === true ? true : void 0,
129
+ className: cn("relative isolate inline-flex w-full max-w-full cursor-default items-center overflow-hidden rounded-xl text-left ring-offset-background", ACTIONS_ROW_CLASS, showActionsSlot && "group", variant === "gradient" && "group", disabled && "pointer-events-none opacity-50", s.rowPad, s.gap, surfaceContainerClass, className),
130
+ style: surfaceStyleMerged,
131
+ ...domRest,
132
+ children: [
133
+ gradientLayers,
134
+ staticBlock,
135
+ /* @__PURE__ */ jsx("div", {
136
+ className: cn(ACTIONS_SLOT_CLASS, showActionsOnlyOnHover && "transition-opacity [@media(hover:hover)]:pointer-events-none [@media(hover:hover)]:opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100"),
137
+ children: actions
138
+ })
139
+ ]
140
+ })
141
+ });
142
+ if (interactive && showActionsSlot) return /* @__PURE__ */ jsx(TooltipProvider, {
143
+ openDelay: 300,
144
+ closeDelay: 100,
145
+ children: /* @__PURE__ */ jsxs("div", {
146
+ ref,
147
+ className: cn("relative isolate inline-flex w-full max-w-full items-center overflow-hidden rounded-xl ring-offset-background", ACTIONS_ROW_CLASS, ringTransitionClass, showActionsSlot && "group", variant === "gradient" && "group", "focus-within:outline-none hover:ring-2 hover:ring-offset-2 focus-within:ring-2 focus-within:ring-offset-2", shellRingClass, disabled && "pointer-events-none opacity-50", s.rowPad, s.gap, surfaceContainerClass, className),
148
+ style: surfaceStyleMerged,
149
+ ...domRest,
150
+ children: [
151
+ gradientLayers,
152
+ /* @__PURE__ */ jsx("button", {
153
+ type,
154
+ disabled,
155
+ onClick,
156
+ onMouseEnter: onMouseEnterProp,
157
+ onMouseLeave: onMouseLeaveProp,
158
+ className: cn("-m-0 inline-flex min-h-0 min-w-0 flex-1 cursor-pointer items-center rounded-none border-0 bg-transparent text-left outline-none focus-visible:outline-none", s.gap, variant === "gradient" && "relative z-10", "min-w-0", ACTIONS_LEADING_BASIS_CLASS[actionsPlacement]),
159
+ children: leadingMain
160
+ }),
161
+ /* @__PURE__ */ jsx("div", {
162
+ className: cn(ACTIONS_SLOT_CLASS, showActionsOnlyOnHover && "transition-opacity [@media(hover:hover)]:pointer-events-none [@media(hover:hover)]:opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100"),
163
+ children: actions
164
+ })
165
+ ]
166
+ })
167
+ });
168
+ return /* @__PURE__ */ jsx(TooltipProvider, {
169
+ openDelay: 300,
170
+ closeDelay: 100,
171
+ children: /* @__PURE__ */ jsxs("button", {
172
+ ref,
173
+ type,
174
+ disabled,
175
+ onClick,
176
+ onMouseEnter: onMouseEnterProp,
177
+ onMouseLeave: onMouseLeaveProp,
178
+ className: cn("relative isolate inline-flex w-full cursor-pointer items-center overflow-hidden rounded-xl text-left ring-offset-background", ringTransitionClass, variant === "gradient" && "group", "focus-visible:outline-none hover:ring-2 hover:ring-offset-2 focus-visible:ring-2 focus-visible:ring-offset-2", presetRingClasses, "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", s.rowPad, s.gap, surfaceContainerClass, className),
179
+ style: {
180
+ ...isArbitraryGradient ? surfaceStyleWithoutGradientBg : styles.containerStyle,
181
+ ...ringAccentStyle
182
+ },
183
+ ...domRest,
184
+ children: [gradientLayers, rowInteractiveFull]
185
+ })
186
+ });
187
+ });
188
+ IconTextActionCard.displayName = "IconTextActionCard";
189
+ //#endregion
190
+ export { IconTextActionCard };
@@ -0,0 +1,37 @@
1
+ import bulb_cloud_drawing_default from "../../assets/illustrations/bulb-cloud-drawing.js";
2
+ import rm_dashboard_update_default from "../../assets/illustrations/rm-dashboard-update.js";
3
+ import rm_data_download_default from "../../assets/illustrations/rm-data-download.js";
4
+ //#region src/components/illustration/illustration-registry.ts
5
+ function parseSvgViewBoxAspectRatio(svg) {
6
+ const m = svg.match(/viewBox=["']([^"']+)["']/i);
7
+ if (!m) return void 0;
8
+ const parts = m[1].trim().split(/[\s,]+/).filter(Boolean);
9
+ if (parts.length !== 4) return void 0;
10
+ const w = parseFloat(parts[2]);
11
+ const h = parseFloat(parts[3]);
12
+ if (!Number.isFinite(w) || !Number.isFinite(h) || h <= 0) return void 0;
13
+ return w / h;
14
+ }
15
+ var noSearchResultsAspect = parseSvgViewBoxAspectRatio(bulb_cloud_drawing_default) ?? 814.69 / 352.1;
16
+ var rmDataDownloadAspect = parseSvgViewBoxAspectRatio(rm_data_download_default) ?? 845.67 / 533.92;
17
+ var rmDashboardUpdateAspect = parseSvgViewBoxAspectRatio(rm_dashboard_update_default) ?? 845.67 / 533.92;
18
+ var illustrationRegistry = [
19
+ {
20
+ id: "no-search-results",
21
+ svg: bulb_cloud_drawing_default,
22
+ aspectRatio: noSearchResultsAspect
23
+ },
24
+ {
25
+ id: "rm-data-download",
26
+ svg: rm_data_download_default,
27
+ aspectRatio: rmDataDownloadAspect
28
+ },
29
+ {
30
+ id: "rm-dashboard-update",
31
+ svg: rm_dashboard_update_default,
32
+ aspectRatio: rmDashboardUpdateAspect
33
+ }
34
+ ];
35
+ var illustrationsById = Object.fromEntries(illustrationRegistry.map((e) => [e.id, e]));
36
+ //#endregion
37
+ export { illustrationRegistry, illustrationsById, parseSvgViewBoxAspectRatio };
@@ -0,0 +1,21 @@
1
+ //#region src/components/illustration/illustration-variants.ts
2
+ /**
3
+ * An illustration source may carry SMIL animations plus groups tagged
4
+ * `data-variant="static"` or `data-variant="animated"`. This picks one
5
+ * variant: static keeps the base attribute values as the resting frame and
6
+ * drops every animation element; animated drops only the static-only groups.
7
+ *
8
+ * Variant groups must not contain nested `<g>` elements — the group selector
9
+ * stops at the first closing tag.
10
+ */
11
+ var STATIC_ONLY_GROUP_RE = /<g\s[^>]*data-variant="static"[^>]*>[\s\S]*?<\/g>\s*/g;
12
+ var ANIMATED_ONLY_GROUP_RE = /<g\s[^>]*data-variant="animated"[^>]*>[\s\S]*?<\/g>\s*/g;
13
+ /** `<animateMotion>` wraps an `<mpath>` child, so it needs the paired form. */
14
+ var ANIMATE_MOTION_BLOCK_RE = /<animateMotion\b[^>]*>[\s\S]*?<\/animateMotion>\s*/g;
15
+ var SMIL_ELEMENT_RE = /<(?:animate|animateTransform|animateMotion|set)\b[^>]*\/>\s*/g;
16
+ function selectIllustrationVariant(svg, animated) {
17
+ if (animated) return svg.replace(STATIC_ONLY_GROUP_RE, "");
18
+ return svg.replace(ANIMATED_ONLY_GROUP_RE, "").replace(ANIMATE_MOTION_BLOCK_RE, "").replace(SMIL_ELEMENT_RE, "");
19
+ }
20
+ //#endregion
21
+ export { selectIllustrationVariant };
@@ -0,0 +1,68 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { illustrationsById } from "./illustration-registry.js";
3
+ import { selectIllustrationVariant } from "./illustration-variants.js";
4
+ import { forwardRef, useMemo } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/components/illustration/illustration.tsx
7
+ function escapeAttr(value) {
8
+ return value.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
9
+ }
10
+ function buildSvgHtml(svgSource, options) {
11
+ const trimmed = svgSource.replace(/^<\?xml[^?]*\?>\s*/i, "").trim();
12
+ const style = options.pixelW != null && options.pixelH != null ? ` style="width:${options.pixelW}px;height:${options.pixelH}px"` : "";
13
+ const a11y = options.decorative ? ` aria-hidden="true" focusable="false"` : ` role="img" aria-label="${escapeAttr(options.alt)}" focusable="false"`;
14
+ return trimmed.replace(/^<svg\b([^>]*)>/i, `<svg$1 preserveAspectRatio="xMidYMid meet" class="block max-h-full max-w-full min-h-0 min-w-0"${style}${a11y}>`);
15
+ }
16
+ var Illustration = forwardRef(function Illustration({ type, size, alt, animated = false, className, ...rest }, ref) {
17
+ const entry = type in illustrationsById ? illustrationsById[type] : void 0;
18
+ const label = alt?.trim();
19
+ const decorative = !label;
20
+ let pixelW;
21
+ let pixelH;
22
+ if (entry && size != null && entry.aspectRatio != null) {
23
+ const ar = entry.aspectRatio;
24
+ if (ar >= 1) {
25
+ pixelW = size;
26
+ pixelH = size / ar;
27
+ } else {
28
+ pixelH = size;
29
+ pixelW = size * ar;
30
+ }
31
+ }
32
+ const html = useMemo(() => {
33
+ if (!entry) return "";
34
+ return buildSvgHtml(selectIllustrationVariant(entry.svg, animated), {
35
+ decorative,
36
+ alt: label,
37
+ pixelW,
38
+ pixelH
39
+ });
40
+ }, [
41
+ entry,
42
+ animated,
43
+ decorative,
44
+ label,
45
+ pixelW,
46
+ pixelH
47
+ ]);
48
+ if (!entry) return null;
49
+ const fixedSquare = size != null;
50
+ /** Without `size`, % height from `h-full` collapses if the parent has no explicit height. Use full width + aspect-ratio so height is derived from width. */
51
+ const fillParentWidth = !fixedSquare && entry.aspectRatio != null;
52
+ return /* @__PURE__ */ jsx("div", {
53
+ ref,
54
+ className: cn("flex min-w-0 items-center justify-center max-w-full max-h-full", fixedSquare ? "min-h-0 shrink-0" : "w-full max-w-full shrink-0", className),
55
+ style: fixedSquare ? {
56
+ width: size,
57
+ height: size
58
+ } : fillParentWidth ? { aspectRatio: entry.aspectRatio } : void 0,
59
+ ...rest,
60
+ children: /* @__PURE__ */ jsx("div", {
61
+ className: "flex h-full w-full min-h-0 min-w-0 items-center justify-center overflow-hidden",
62
+ dangerouslySetInnerHTML: { __html: html }
63
+ })
64
+ });
65
+ });
66
+ Illustration.displayName = "Illustration";
67
+ //#endregion
68
+ export { Illustration };