@supersoniks/concorde 5.0.0 → 5.0.2

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 (314) hide show
  1. package/.gitlab-ci.yml +0 -13
  2. package/build-infos.json +1 -1
  3. package/concorde-core.bundle.js +606 -689
  4. package/concorde-core.es.js +4511 -4329
  5. package/dist/concorde-core.bundle.js +606 -689
  6. package/dist/concorde-core.es.js +4511 -4329
  7. package/gitlab/job_tests.sh +25 -12
  8. package/index.html +3 -3
  9. package/package.json +16 -1
  10. package/scripts/post-build-docs.js +0 -0
  11. package/scripts/post-build.mjs +0 -0
  12. package/src/core/components/functional/fetch/fetch.md +0 -0
  13. package/src/core/components/functional/if/if.md +0 -0
  14. package/src/core/components/functional/list/list.demo.ts +0 -0
  15. package/src/core/components/functional/list/list.md +0 -0
  16. package/src/core/components/functional/list/list.ts +0 -0
  17. package/src/core/components/functional/router/router.md +0 -0
  18. package/src/core/components/functional/router/router.ts +0 -0
  19. package/src/core/components/functional/sdui/sdui.md +0 -0
  20. package/src/core/components/functional/states/states.md +0 -0
  21. package/src/core/components/functional/submit/submit.md +0 -0
  22. package/src/core/components/ui/_css/rounded.ts +36 -0
  23. package/src/core/components/ui/_css/size.ts +0 -0
  24. package/src/core/components/ui/_css/type.ts +49 -0
  25. package/src/core/components/ui/_i18n/ui-aria-labels.ts +104 -0
  26. package/src/core/components/ui/alert/alert.md +128 -72
  27. package/src/core/components/ui/alert/alert.spec.ts +145 -0
  28. package/src/core/components/ui/alert/alert.ts +86 -91
  29. package/src/core/components/ui/alert-messages/alert-messages.ts +1 -1
  30. package/src/core/components/ui/badge/badge.md +126 -78
  31. package/src/core/components/ui/badge/badge.ts +29 -81
  32. package/src/core/components/ui/button/button.md +1 -0
  33. package/src/core/components/ui/button/button.ts +11 -8
  34. package/src/core/components/ui/captcha/altchaStyles.ts +0 -0
  35. package/src/core/components/ui/captcha/captcha.md +0 -0
  36. package/src/core/components/ui/card/card-header.ts +7 -2
  37. package/src/core/components/ui/card/card.md +120 -65
  38. package/src/core/components/ui/divider/divider.ts +4 -9
  39. package/src/core/components/ui/form/fieldset/legend-description.ts +1 -1
  40. package/src/core/components/ui/form/fieldset/legend.ts +1 -1
  41. package/src/core/components/ui/form/input/input.md +1 -1
  42. package/src/core/components/ui/form/input/input.ts +19 -15
  43. package/src/core/components/ui/form/radio/radio.md +0 -0
  44. package/src/core/components/ui/form/select/select.md +0 -0
  45. package/src/core/components/ui/form/switch/switch.md +0 -0
  46. package/src/core/components/ui/form/textarea/textarea.md +1 -1
  47. package/src/core/components/ui/image/image.md +147 -53
  48. package/src/core/components/ui/image/image.ts +10 -44
  49. package/src/core/components/ui/link/link.md +2 -2
  50. package/src/core/components/ui/link/link.ts +42 -37
  51. package/src/core/components/ui/loader/loader.md +0 -0
  52. package/src/core/components/ui/menu/menu.md +0 -0
  53. package/src/core/components/ui/modal/modal-close.ts +8 -12
  54. package/src/core/components/ui/modal/modal.md +0 -0
  55. package/src/core/components/ui/modal/modal.ts +18 -18
  56. package/src/core/components/ui/pop/pop.md +105 -1
  57. package/src/core/components/ui/pop/pop.ts +143 -148
  58. package/src/core/components/ui/table/table-caption.ts +0 -0
  59. package/src/core/components/ui/table/table.md +0 -0
  60. package/src/core/components/ui/table/table.ts +2 -8
  61. package/src/core/components/ui/theme/theme.ts +1 -1
  62. package/src/core/components/ui/toast/dismissed.ts +14 -0
  63. package/src/core/components/ui/toast/toast-item.ts +139 -91
  64. package/src/core/components/ui/toast/toast.ts +4 -7
  65. package/src/core/components/ui/tooltip/tooltip.ts +176 -154
  66. package/src/core/utils/LocationHandler.ts +12 -5
  67. package/src/core/utils/dismissed.ts +22 -0
  68. package/src/core/utils/positioning.spec.ts +208 -0
  69. package/src/core/utils/positioning.ts +183 -0
  70. package/src/core/utils/route.ts +0 -0
  71. package/src/directives.ts +2 -3
  72. package/src/docs/_core-concept/subscriber.md +0 -0
  73. package/src/docs/_getting-started/concorde-outside.md +3 -3
  74. package/src/docs/_getting-started/my-first-subscriber.md +0 -0
  75. package/src/docs/_getting-started/pubsub.md +0 -0
  76. package/src/docs/_getting-started/start.md +0 -0
  77. package/src/docs/code.ts +3 -1
  78. package/src/docs/example/users.ts +0 -0
  79. package/src/docs/search/docs-search.json +651 -21
  80. package/src/docs/search/page.ts +0 -0
  81. package/src/docs/tailwind/css/tailwind.css +13 -6
  82. package/src/tsconfig.json +45 -0
  83. package/src/tsconfig.tsbuildinfo +1 -1
  84. package/tailwind.config.js +50 -3
  85. package/vitest.setup.ts +49 -13
  86. package/.github/workflows/ci.yml +0 -21
  87. package/.github-export-ignore +0 -30
  88. package/CONTRIBUTING.md +0 -59
  89. package/DEV.md +0 -54
  90. package/LICENSE +0 -21
  91. package/OPEN_SOURCE_CHECKPOINT.md +0 -133
  92. package/concorde-3d.bundle.js +0 -3960
  93. package/concorde-3d.es.js +0 -33433
  94. package/concorde-hugging-face-infer.bundle.js +0 -32
  95. package/concorde-hugging-face-infer.es.js +0 -2952
  96. package/concorde-shader.bundle.js +0 -116
  97. package/concorde-shader.es.js +0 -8353
  98. package/concorde-webgpu.bundle.js +0 -307
  99. package/concorde-webgpu.es.js +0 -8627
  100. package/docs/altcha-widget.js +0 -2662
  101. package/docs/assets/index-BZiZXMU-.css +0 -1
  102. package/docs/assets/index-FmK4JaIM.js +0 -11992
  103. package/docs/crawl/core/components/functional/date/date.html +0 -190
  104. package/docs/crawl/core/components/functional/fetch/fetch.html +0 -109
  105. package/docs/crawl/core/components/functional/if/if.html +0 -27
  106. package/docs/crawl/core/components/functional/jsonata/jsonata.html +0 -79
  107. package/docs/crawl/core/components/functional/list/list.html +0 -70
  108. package/docs/crawl/core/components/functional/mix/mix.html +0 -45
  109. package/docs/crawl/core/components/functional/queue/queue.html +0 -96
  110. package/docs/crawl/core/components/functional/router/router.html +0 -106
  111. package/docs/crawl/core/components/functional/sdui/sdui.html +0 -269
  112. package/docs/crawl/core/components/functional/states/states.html +0 -66
  113. package/docs/crawl/core/components/functional/submit/submit.html +0 -160
  114. package/docs/crawl/core/components/functional/subscriber/subscriber.html +0 -67
  115. package/docs/crawl/core/components/functional/value/value.html +0 -51
  116. package/docs/crawl/core/components/ui/alert/alert.html +0 -110
  117. package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +0 -23
  118. package/docs/crawl/core/components/ui/badge/badge.html +0 -119
  119. package/docs/crawl/core/components/ui/button/button.html +0 -149
  120. package/docs/crawl/core/components/ui/captcha/captcha.html +0 -30
  121. package/docs/crawl/core/components/ui/card/card.html +0 -99
  122. package/docs/crawl/core/components/ui/divider/divider.html +0 -58
  123. package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +0 -73
  124. package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +0 -135
  125. package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +0 -79
  126. package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +0 -62
  127. package/docs/crawl/core/components/ui/form/input/input.html +0 -109
  128. package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +0 -106
  129. package/docs/crawl/core/components/ui/form/radio/radio.html +0 -56
  130. package/docs/crawl/core/components/ui/form/select/select.html +0 -73
  131. package/docs/crawl/core/components/ui/form/switch/switch.html +0 -56
  132. package/docs/crawl/core/components/ui/form/textarea/textarea.html +0 -59
  133. package/docs/crawl/core/components/ui/group/group.html +0 -82
  134. package/docs/crawl/core/components/ui/icon/icon.html +0 -133
  135. package/docs/crawl/core/components/ui/image/image.html +0 -110
  136. package/docs/crawl/core/components/ui/link/link.html +0 -42
  137. package/docs/crawl/core/components/ui/loader/loader.html +0 -50
  138. package/docs/crawl/core/components/ui/menu/menu.html +0 -322
  139. package/docs/crawl/core/components/ui/modal/modal.html +0 -117
  140. package/docs/crawl/core/components/ui/pop/pop.html +0 -102
  141. package/docs/crawl/core/components/ui/progress/progress.html +0 -58
  142. package/docs/crawl/core/components/ui/table/table.html +0 -413
  143. package/docs/crawl/core/components/ui/toast/toast.html +0 -122
  144. package/docs/crawl/core/components/ui/tooltip/tooltip.html +0 -79
  145. package/docs/crawl/docs/_core-concept/dataFlow.html +0 -177
  146. package/docs/crawl/docs/_core-concept/overview.html +0 -66
  147. package/docs/crawl/docs/_core-concept/subscriber.html +0 -75
  148. package/docs/crawl/docs/_decorators/ancestor-attribute.html +0 -116
  149. package/docs/crawl/docs/_decorators/auto-subscribe.html +0 -202
  150. package/docs/crawl/docs/_decorators/bind.html +0 -141
  151. package/docs/crawl/docs/_decorators/get.html +0 -149
  152. package/docs/crawl/docs/_decorators/handle.html +0 -165
  153. package/docs/crawl/docs/_decorators/on-assign.html +0 -355
  154. package/docs/crawl/docs/_decorators/patch.html +0 -78
  155. package/docs/crawl/docs/_decorators/post.html +0 -139
  156. package/docs/crawl/docs/_decorators/publish.html +0 -61
  157. package/docs/crawl/docs/_decorators/put.html +0 -78
  158. package/docs/crawl/docs/_decorators/subscribe.html +0 -109
  159. package/docs/crawl/docs/_decorators/wait-for-ancestors.html +0 -137
  160. package/docs/crawl/docs/_directives/sub.html +0 -93
  161. package/docs/crawl/docs/_getting-started/ai-agents.html +0 -173
  162. package/docs/crawl/docs/_getting-started/concorde-manual-install.html +0 -100
  163. package/docs/crawl/docs/_getting-started/concorde-outside.html +0 -58
  164. package/docs/crawl/docs/_getting-started/create-a-component.html +0 -111
  165. package/docs/crawl/docs/_getting-started/my-first-component.html +0 -189
  166. package/docs/crawl/docs/_getting-started/my-first-subscriber.html +0 -110
  167. package/docs/crawl/docs/_getting-started/pubsub.html +0 -62
  168. package/docs/crawl/docs/_getting-started/start.html +0 -76
  169. package/docs/crawl/docs/_getting-started/theming.html +0 -85
  170. package/docs/crawl/docs/_misc/api-configuration.html +0 -149
  171. package/docs/crawl/docs/_misc/dataProviderKey.html +0 -135
  172. package/docs/crawl/docs/_misc/docs-mock-api.html +0 -158
  173. package/docs/crawl/docs/_misc/dynamic-path.html +0 -180
  174. package/docs/crawl/docs/_misc/endpoint.html +0 -50
  175. package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +0 -138
  176. package/docs/crawl/docs/_misc/html-integration.html +0 -48
  177. package/docs/crawl/hubs/decorators.html +0 -547
  178. package/docs/crawl/hubs/form-components.html +0 -357
  179. package/docs/crawl/hubs/remote-data.html +0 -452
  180. package/docs/crawl/index.html +0 -101
  181. package/docs/css/docs.css +0 -0
  182. package/docs/docs-mock-api-sw.js +0 -720
  183. package/docs/docs-mock-api-sw.js.map +0 -7
  184. package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
  185. package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
  186. package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
  187. package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
  188. package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
  189. package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
  190. package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
  191. package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
  192. package/docs/fonts/ClashGrotesk-Light.eot +0 -0
  193. package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
  194. package/docs/fonts/ClashGrotesk-Light.woff +0 -0
  195. package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
  196. package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
  197. package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
  198. package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
  199. package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
  200. package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
  201. package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
  202. package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
  203. package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
  204. package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
  205. package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
  206. package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
  207. package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
  208. package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
  209. package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
  210. package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
  211. package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
  212. package/docs/img/concorde-icon.svg +0 -5
  213. package/docs/img/concorde-logo.svg +0 -1
  214. package/docs/img/concorde.png +0 -0
  215. package/docs/img/concorde_def.png +0 -0
  216. package/docs/img/concorde_seuil.png.webp +0 -0
  217. package/docs/img/concorde_seuil_invert.png +0 -0
  218. package/docs/img/paul_metrand.jpg +0 -0
  219. package/docs/img/paul_metrand_xs.jpg +0 -0
  220. package/docs/index.html +0 -93
  221. package/docs/llms-full.txt +0 -5787
  222. package/docs/llms.txt +0 -104
  223. package/docs/robots.txt +0 -16
  224. package/docs/sitemap.xml +0 -237
  225. package/docs/src/core/components/functional/date/date.md +0 -290
  226. package/docs/src/core/components/functional/fetch/fetch.md +0 -125
  227. package/docs/src/core/components/functional/if/if.md +0 -9
  228. package/docs/src/core/components/functional/jsonata/jsonata.md +0 -56
  229. package/docs/src/core/components/functional/list/list.md +0 -65
  230. package/docs/src/core/components/functional/mix/mix.md +0 -41
  231. package/docs/src/core/components/functional/queue/queue.md +0 -72
  232. package/docs/src/core/components/functional/router/router.md +0 -94
  233. package/docs/src/core/components/functional/sdui/default-library.json +0 -108
  234. package/docs/src/core/components/functional/sdui/example.json +0 -99
  235. package/docs/src/core/components/functional/sdui/sdui.md +0 -356
  236. package/docs/src/core/components/functional/states/states.md +0 -87
  237. package/docs/src/core/components/functional/submit/submit.md +0 -114
  238. package/docs/src/core/components/functional/subscriber/subscriber.md +0 -91
  239. package/docs/src/core/components/functional/value/value.md +0 -35
  240. package/docs/src/core/components/ui/alert/alert.md +0 -121
  241. package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
  242. package/docs/src/core/components/ui/badge/badge.md +0 -127
  243. package/docs/src/core/components/ui/button/button.md +0 -182
  244. package/docs/src/core/components/ui/captcha/captcha.md +0 -12
  245. package/docs/src/core/components/ui/card/card.md +0 -97
  246. package/docs/src/core/components/ui/divider/divider.md +0 -35
  247. package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -77
  248. package/docs/src/core/components/ui/form/fieldset/fieldset.md +0 -129
  249. package/docs/src/core/components/ui/form/form-actions/form-actions.md +0 -77
  250. package/docs/src/core/components/ui/form/form-layout/form-layout.md +0 -44
  251. package/docs/src/core/components/ui/form/input/input.md +0 -142
  252. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -133
  253. package/docs/src/core/components/ui/form/radio/radio.md +0 -57
  254. package/docs/src/core/components/ui/form/select/select.md +0 -71
  255. package/docs/src/core/components/ui/form/switch/switch.md +0 -57
  256. package/docs/src/core/components/ui/form/textarea/textarea.md +0 -65
  257. package/docs/src/core/components/ui/group/group.md +0 -75
  258. package/docs/src/core/components/ui/icon/icon.md +0 -125
  259. package/docs/src/core/components/ui/icon/icons.json +0 -1
  260. package/docs/src/core/components/ui/image/image.md +0 -107
  261. package/docs/src/core/components/ui/link/link.md +0 -43
  262. package/docs/src/core/components/ui/loader/loader.md +0 -55
  263. package/docs/src/core/components/ui/menu/menu.md +0 -329
  264. package/docs/src/core/components/ui/modal/modal.md +0 -119
  265. package/docs/src/core/components/ui/pop/pop.md +0 -96
  266. package/docs/src/core/components/ui/progress/progress.md +0 -63
  267. package/docs/src/core/components/ui/table/table.md +0 -455
  268. package/docs/src/core/components/ui/toast/toast.md +0 -166
  269. package/docs/src/core/components/ui/tooltip/tooltip.md +0 -82
  270. package/docs/src/docs/_core-concept/dataFlow.md +0 -88
  271. package/docs/src/docs/_core-concept/overview.md +0 -57
  272. package/docs/src/docs/_core-concept/subscriber.md +0 -75
  273. package/docs/src/docs/_decorators/ancestor-attribute.md +0 -127
  274. package/docs/src/docs/_decorators/auto-subscribe.md +0 -202
  275. package/docs/src/docs/_decorators/bind.md +0 -167
  276. package/docs/src/docs/_decorators/get.md +0 -162
  277. package/docs/src/docs/_decorators/handle.md +0 -175
  278. package/docs/src/docs/_decorators/on-assign.md +0 -390
  279. package/docs/src/docs/_decorators/patch.md +0 -70
  280. package/docs/src/docs/_decorators/post.md +0 -146
  281. package/docs/src/docs/_decorators/publish.md +0 -55
  282. package/docs/src/docs/_decorators/put.md +0 -70
  283. package/docs/src/docs/_decorators/subscribe.md +0 -100
  284. package/docs/src/docs/_decorators/wait-for-ancestors.md +0 -163
  285. package/docs/src/docs/_directives/sub.md +0 -91
  286. package/docs/src/docs/_getting-started/ai-agents.md +0 -76
  287. package/docs/src/docs/_getting-started/concorde-manual-install.md +0 -133
  288. package/docs/src/docs/_getting-started/concorde-outside.md +0 -33
  289. package/docs/src/docs/_getting-started/create-a-component.md +0 -139
  290. package/docs/src/docs/_getting-started/my-first-component.md +0 -236
  291. package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -120
  292. package/docs/src/docs/_getting-started/pubsub.md +0 -37
  293. package/docs/src/docs/_getting-started/start.md +0 -47
  294. package/docs/src/docs/_getting-started/theming.md +0 -91
  295. package/docs/src/docs/_misc/api-configuration.md +0 -81
  296. package/docs/src/docs/_misc/dataProviderKey.md +0 -168
  297. package/docs/src/docs/_misc/docs-mock-api.md +0 -63
  298. package/docs/src/docs/_misc/dynamic-path.md +0 -71
  299. package/docs/src/docs/_misc/endpoint.md +0 -45
  300. package/docs/src/docs/_misc/formelement-subscriber-removal.md +0 -115
  301. package/docs/src/docs/_misc/html-integration.md +0 -15
  302. package/docs/src/docs/search/docs-search.json +0 -9512
  303. package/docs/src/tag-list.json +0 -1
  304. package/docs/src/tsconfig-model.json +0 -23
  305. package/docs/src/tsconfig.declarations.json +0 -22
  306. package/docs/src/tsconfig.emit.json +0 -23
  307. package/docs/src/tsconfig.json +0 -858
  308. package/docs/svg/regular/plane.svg +0 -1
  309. package/docs/svg/solid/plane.svg +0 -1
  310. package/gitlab/job_github_mirror.sh +0 -39
  311. package/scripts/github-export.mjs +0 -150
  312. package/src/css.d.ts +0 -19
  313. package/src/tsconfig.declarations.json +0 -22
  314. package/src/tsconfig.emit.json +0 -23
@@ -10,19 +10,28 @@ import { renderToastContent } from "@supersoniks/concorde/core/components/ui/toa
10
10
  import { normalizeStyleSheets } from "@supersoniks/concorde/core/components/ui/modal/modal-utils";
11
11
  import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
12
12
  import { HTML } from "@supersoniks/concorde/utils";
13
+ import {
14
+ isToastDismissed,
15
+ markToastDismissed,
16
+ } from "@supersoniks/concorde/core/components/ui/toast/dismissed";
17
+ import { resolveToastCloseLabel } from "@supersoniks/concorde/core/components/ui/_i18n/ui-aria-labels";
13
18
 
14
- const icon: Record<string, string> = {
15
- warning: "warning-circled-outline",
16
- success: "check-circled-outline",
17
- error: "warning-circled-outline",
18
- info: "info-empty",
19
- };
19
+ import {
20
+ statusAriaLive,
21
+ statusAriaRole,
22
+ statusColor,
23
+ statusIcon,
24
+ toStatus,
25
+ } from "@supersoniks/concorde/core/components/ui/_css/type";
26
+
27
+ const AUTO_HIDE_DELAY = 6000;
20
28
  const tagName = "sonic-toast-item";
21
29
 
22
30
  @customElement(tagName)
23
31
  export class SonicToastItem extends LitElement {
24
32
  static styles = [
25
33
  customScroll,
34
+ statusColor,
26
35
  css`
27
36
  * {
28
37
  box-sizing: border-box;
@@ -31,7 +40,6 @@ export class SonicToastItem extends LitElement {
31
40
  display: block;
32
41
  pointer-events: auto;
33
42
  position: relative;
34
- --sc-toast-status-color: transparent;
35
43
  --sc-toast-color: var(--sc-base-content, #000);
36
44
  --sc-toast-bg: var(--sc-base, #fff);
37
45
  --sc-toast-rounded: var(--sc-rounded-md);
@@ -52,14 +60,13 @@ export class SonicToastItem extends LitElement {
52
60
  pointer-events: auto;
53
61
  overflow: hidden;
54
62
  line-height: 1.25;
55
- color: var(--sc-toast-color);
56
63
  box-shadow: var(--sc-toast-shadow);
57
64
  border-radius: var(--sc-toast-rounded);
58
65
  background: var(--sc-toast-bg);
59
66
  }
60
67
 
61
68
  .sonic-toast-content {
62
- padding: 1em 2.5rem 1em 1em;
69
+ padding: 0.8em 2.25rem 0.8em 0.8em;
63
70
  display: flex;
64
71
  gap: 0.5rem;
65
72
  overflow: auto;
@@ -67,6 +74,7 @@ export class SonicToastItem extends LitElement {
67
74
  }
68
75
 
69
76
  .sonic-toast-text {
77
+ color: var(--sc-toast-color);
70
78
  align-self: center;
71
79
  margin-top: auto;
72
80
  margin-bottom: auto;
@@ -114,6 +122,7 @@ export class SonicToastItem extends LitElement {
114
122
  border-radius: 50%;
115
123
  text-align: center;
116
124
  opacity: 0.5;
125
+ color: var(--sc-toast-color);
117
126
  background: rgba(0, 0, 0, 0);
118
127
  }
119
128
 
@@ -133,39 +142,21 @@ export class SonicToastItem extends LitElement {
133
142
  /*Title*/
134
143
  .sonic-toast-title {
135
144
  font-weight: bold;
136
- font-size: 1.15rem;
137
- margin: 0.15em 0 0.25em;
145
+ font-size: 1.125rem;
146
+ margin: 0.15em 0 0.15em;
138
147
  line-height: 1.2;
139
148
  }
140
149
 
141
- /*STATUS*/
142
- .success {
143
- --sc-toast-status-color: var(
144
- --sc-success,
145
- var(--sc-base-content, #000)
146
- );
150
+ /*STATUS — accent via statusColor (--sc-_color) */
151
+ :host([status]) .sonic-toast {
152
+ border-top: 3px solid var(--sc-_color);
147
153
  }
148
154
 
149
- .error {
150
- --sc-toast-status-color: var(--sc-danger, var(--sc-base-content, #000));
151
- }
152
-
153
- .warning {
154
- --sc-toast-status-color: var(
155
- --sc-warning,
156
- var(--sc-base-content, #000)
157
- );
158
- }
159
-
160
- .info {
161
- --sc-toast-status-color: var(--sc-info, var(--sc-base-content, #000));
162
- }
163
-
164
- .success,
165
- .error,
166
- .info,
167
- .warning {
168
- border-top: 3px solid var(--sc-toast-status-color, currentColor);
155
+ :host([status="success"]) .sonic-toast:before,
156
+ :host([status="error"]) .sonic-toast:before,
157
+ :host([status="info"]) .sonic-toast:before,
158
+ :host([status="warning"]) .sonic-toast:before {
159
+ background-color: var(--sc-_color);
169
160
  }
170
161
 
171
162
  .sonic-toast:before {
@@ -180,20 +171,12 @@ export class SonicToastItem extends LitElement {
180
171
  pointer-events: none;
181
172
  transition: 0.2s;
182
173
  border-radius: var(--sc-toast-rounded);
183
- background-color: var(--sc-toast-status-color);
184
174
  }
185
175
 
186
176
  .sonic-toast:hover:before {
187
177
  opacity: 0.025;
188
178
  }
189
179
 
190
- .info .sonic-toast-icon,
191
- .error .sonic-toast-icon,
192
- .success .sonic-toast-icon,
193
- .warning .sonic-toast-icon {
194
- color: var(--sc-toast-status-color, currentColor);
195
- }
196
-
197
180
  .sonic-toast-icon {
198
181
  position: sticky;
199
182
  top: 0;
@@ -209,7 +192,7 @@ export class SonicToastItem extends LitElement {
209
192
  @property() label: ToastContent = "";
210
193
  @property({ type: String }) id = "";
211
194
  @property() text: ToastContent = "";
212
- @property({ type: String }) status: ToastStatus = "";
195
+ @property({ type: String, reflect: true }) status: ToastStatus = "";
213
196
  @property({ type: Boolean }) ghost = false;
214
197
  @property({ type: Boolean }) preserve = false;
215
198
  @property({ type: Boolean }) dismissForever = false;
@@ -218,7 +201,42 @@ export class SonicToastItem extends LitElement {
218
201
  @property({ attribute: false }) styleSheet?: ToastStyleSheetInput;
219
202
  @state() visible = true;
220
203
  @state() private _titleId: string = "";
204
+ @state() private _dismissed = false;
221
205
  private _adoptedStyleSheets: Array<CSSStyleSheet> = [];
206
+ private _hideTimer?: ReturnType<typeof setTimeout>;
207
+ private _hideRemaining = AUTO_HIDE_DELAY;
208
+ private _hideStartedAt = 0;
209
+ private _hovered = false;
210
+ private _focused = false;
211
+ private _hidden = false;
212
+
213
+ connectedCallback(): void {
214
+ super.connectedCallback();
215
+ this.addEventListener("mouseenter", this._onMouseEnter);
216
+ this.addEventListener("mouseleave", this._onMouseLeave);
217
+ this.addEventListener("focusin", this._onFocusIn);
218
+ this.addEventListener("focusout", this._onFocusOut);
219
+ }
220
+
221
+ disconnectedCallback(): void {
222
+ this._clearHideTimer();
223
+ this.removeEventListener("mouseenter", this._onMouseEnter);
224
+ this.removeEventListener("mouseleave", this._onMouseLeave);
225
+ this.removeEventListener("focusin", this._onFocusIn);
226
+ this.removeEventListener("focusout", this._onFocusOut);
227
+ super.disconnectedCallback();
228
+ }
229
+
230
+ protected willUpdate(changedProperties: PropertyValues): void {
231
+ if (
232
+ changedProperties.has("dismissForever") ||
233
+ changedProperties.has("id")
234
+ ) {
235
+ this._dismissed =
236
+ this.dismissForever && !!this.id && isToastDismissed(this.id);
237
+ }
238
+ super.willUpdate(changedProperties);
239
+ }
222
240
 
223
241
  // @queryAssignedElements({flatten: true, slot: main"})
224
242
  // textSlot!: HTMLElement[];
@@ -229,7 +247,7 @@ export class SonicToastItem extends LitElement {
229
247
  * - "status" pour les autres (messages informatifs)
230
248
  */
231
249
  getAriaRole(): "alert" | "status" {
232
- return this.status === "error" ? "alert" : "status";
250
+ return statusAriaRole(toStatus(this.status) ?? "default");
233
251
  }
234
252
 
235
253
  /**
@@ -238,7 +256,7 @@ export class SonicToastItem extends LitElement {
238
256
  * - "polite" pour les autres (peut attendre)
239
257
  */
240
258
  getAriaLive(): "polite" | null {
241
- return this.status === "error" ? null : "polite";
259
+ return statusAriaLive(toStatus(this.status) ?? "default");
242
260
  }
243
261
 
244
262
  /**
@@ -254,33 +272,8 @@ export class SonicToastItem extends LitElement {
254
272
  return this._titleId;
255
273
  }
256
274
 
257
- /**
258
- * Génère un label ARIA descriptif pour le bouton de fermeture
259
- */
260
- getCloseButtonLabel(): string {
261
- const statusLabels: Record<string, string> = {
262
- error: "Fermer le message d'erreur",
263
- warning: "Fermer l'avertissement",
264
- success: "Fermer le message de succès",
265
- info: "Fermer l'information",
266
- };
267
- const statusLabel = this.status
268
- ? statusLabels[this.status] || "Fermer la notification"
269
- : "Fermer la notification";
270
- return statusLabel;
271
- }
272
-
273
275
  render() {
274
- // check if the toast is dismissed
275
- if (this.dismissForever) {
276
- const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}";
277
- const dismissedObj = JSON.parse(dismissed);
278
- if (dismissedObj[this.id]) {
279
- return nothing;
280
- }
281
- }
282
-
283
- if (!this.visible) {
276
+ if (this._dismissed || !this.visible) {
284
277
  return nothing;
285
278
  }
286
279
 
@@ -295,14 +288,14 @@ export class SonicToastItem extends LitElement {
295
288
 
296
289
  const ariaLive = this.getAriaLive();
297
290
  return html`<div
298
- class="sonic-toast ${this.status} ${this.ghost ? "ghost" : ""}"
291
+ class="sonic-toast ${this.ghost ? "ghost" : ""}"
299
292
  role=${this.getAriaRole()}
300
293
  aria-live=${ariaLive || nothing}
301
294
  aria-atomic="true"
302
295
  aria-label=${ariaLabel || nothing}
303
296
  >
304
297
  <button
305
- aria-label=${this.getCloseButtonLabel()}
298
+ aria-label=${resolveToastCloseLabel(this.status)}
306
299
  class="sonic-toast-close"
307
300
  @click=${() => this.hide()}
308
301
  >
@@ -314,9 +307,9 @@ export class SonicToastItem extends LitElement {
314
307
  >
315
308
  ${this.status &&
316
309
  html`<sonic-icon
317
- name=${icon[this.status]}
310
+ name=${statusIcon[toStatus(this.status) ?? "default"]}
318
311
  class="sonic-toast-icon"
319
- size="2xl"
312
+ size="xl"
320
313
  aria-hidden="true"
321
314
  ></sonic-icon>`}
322
315
 
@@ -329,8 +322,6 @@ export class SonicToastItem extends LitElement {
329
322
  ${this.useSlot ? nothing : renderToastContent(this.text)}
330
323
  <slot></slot>
331
324
  </div>
332
-
333
- ${!this.preserve ? this.autoHide() : ""}
334
325
  </div>
335
326
  </div>`;
336
327
  }
@@ -339,6 +330,13 @@ export class SonicToastItem extends LitElement {
339
330
  if (_changedProperties.has("styleSheet")) {
340
331
  this.syncAdoptedStyleSheets();
341
332
  }
333
+ if (
334
+ _changedProperties.has("preserve") ||
335
+ _changedProperties.has("visible") ||
336
+ _changedProperties.has("_dismissed")
337
+ ) {
338
+ this._syncHideTimer();
339
+ }
342
340
  }
343
341
 
344
342
  syncAdoptedStyleSheets() {
@@ -357,30 +355,80 @@ export class SonicToastItem extends LitElement {
357
355
  }
358
356
 
359
357
  hide() {
358
+ this._clearHideTimer();
359
+ this._hidden = true;
360
360
  if (!HTML.getClosestElement(this, "sonic-toast")) {
361
361
  this.visible = false;
362
362
  }
363
363
 
364
364
  if (this.dismissForever) {
365
- // set in local Storage an Object with the id as key and if it's dismissed as value
366
- const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}";
367
- const dismissedObj = JSON.parse(dismissed);
368
- dismissedObj[this.id] = true;
369
- localStorage.setItem(
370
- "sonic-toast-dismissed",
371
- JSON.stringify(dismissedObj),
372
- );
365
+ markToastDismissed(this.id);
373
366
  }
374
367
  this.dispatchEvent(new CustomEvent("hide", { bubbles: true }));
375
368
  }
376
369
 
377
370
  show() {
371
+ this._hidden = false;
372
+ this._hideRemaining = AUTO_HIDE_DELAY;
378
373
  this.visible = true;
374
+ this._syncHideTimer();
379
375
  }
380
376
 
381
- autoHide() {
382
- setTimeout(() => {
377
+ private _syncHideTimer() {
378
+ const shouldRun =
379
+ !this.preserve &&
380
+ this.visible &&
381
+ !this._hidden &&
382
+ !this._dismissed &&
383
+ !this._hovered &&
384
+ !this._focused;
385
+
386
+ if (!shouldRun) {
387
+ this._pauseHideTimer();
388
+ return;
389
+ }
390
+ if (this._hideTimer) return;
391
+
392
+ this._hideStartedAt = Date.now();
393
+ this._hideTimer = setTimeout(() => {
394
+ this._hideTimer = undefined;
383
395
  this.hide();
384
- }, 6000);
396
+ }, this._hideRemaining);
385
397
  }
398
+
399
+ private _pauseHideTimer() {
400
+ if (!this._hideTimer) return;
401
+ clearTimeout(this._hideTimer);
402
+ this._hideTimer = undefined;
403
+ this._hideRemaining = Math.max(
404
+ 0,
405
+ this._hideRemaining - (Date.now() - this._hideStartedAt),
406
+ );
407
+ }
408
+
409
+ private _clearHideTimer() {
410
+ clearTimeout(this._hideTimer);
411
+ this._hideTimer = undefined;
412
+ }
413
+
414
+ private _onMouseEnter = () => {
415
+ this._hovered = true;
416
+ this._syncHideTimer();
417
+ };
418
+
419
+ private _onMouseLeave = () => {
420
+ this._hovered = false;
421
+ this._syncHideTimer();
422
+ };
423
+
424
+ private _onFocusIn = () => {
425
+ this._focused = true;
426
+ this._syncHideTimer();
427
+ };
428
+
429
+ private _onFocusOut = (e: FocusEvent) => {
430
+ if (this.contains(e.relatedTarget as Node | null)) return;
431
+ this._focused = false;
432
+ this._syncHideTimer();
433
+ };
386
434
  }
@@ -8,6 +8,7 @@ import { ifDefined } from "lit/directives/if-defined.js";
8
8
  import { styleMap, StyleInfo } from "lit/directives/style-map.js";
9
9
  import "@supersoniks/concorde/core/components/ui/toast/toast-item";
10
10
  import { renderToastContent } from "@supersoniks/concorde/core/components/ui/toast/render-content";
11
+ import { isToastDismissed } from "@supersoniks/concorde/core/components/ui/toast/dismissed";
11
12
  import {
12
13
  Toast,
13
14
  ToastContent,
@@ -66,7 +67,7 @@ export class SonicToast extends LitElement {
66
67
  bottom: "1.25rem",
67
68
  right: "1.25rem",
68
69
  zIndex: "10000",
69
- maxWidth: "64ch",
70
+ maxWidth: "45ch",
70
71
  flexDirection: "column-reverse",
71
72
  };
72
73
  }
@@ -215,12 +216,8 @@ export class SonicToast extends LitElement {
215
216
  };
216
217
 
217
218
  // check if the toast is dismissed
218
- if (conf.dismissForever && conf.id) {
219
- const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}";
220
- const dismissedObj = JSON.parse(dismissed);
221
- if (dismissedObj[conf.id]) {
222
- return null;
223
- }
219
+ if (conf.dismissForever && conf.id && isToastDismissed(conf.id)) {
220
+ return null;
224
221
  }
225
222
 
226
223
  if (toastComponent?.toasts.length) {