@supersoniks/concorde 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/.gitlab-ci.yml +0 -13
  2. package/build-infos.json +1 -1
  3. package/concorde-core.bundle.js +257 -273
  4. package/concorde-core.es.js +4127 -4039
  5. package/dist/concorde-core.bundle.js +257 -273
  6. package/dist/concorde-core.es.js +4127 -4039
  7. package/gitlab/job_tests.sh +25 -12
  8. package/index.html +1 -1
  9. package/package.json +3 -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/size.ts +0 -0
  23. package/src/core/components/ui/alert/alert.ts +0 -0
  24. package/src/core/components/ui/button/button.md +0 -0
  25. package/src/core/components/ui/captcha/altchaStyles.ts +0 -0
  26. package/src/core/components/ui/captcha/captcha.md +0 -0
  27. package/src/core/components/ui/card/card.md +0 -0
  28. package/src/core/components/ui/divider/divider.ts +0 -0
  29. package/src/core/components/ui/form/input/input.md +0 -0
  30. package/src/core/components/ui/form/radio/radio.md +0 -0
  31. package/src/core/components/ui/form/select/select.md +0 -0
  32. package/src/core/components/ui/form/switch/switch.md +0 -0
  33. package/src/core/components/ui/loader/loader.md +0 -0
  34. package/src/core/components/ui/menu/menu.md +0 -0
  35. package/src/core/components/ui/modal/modal-close.ts +0 -0
  36. package/src/core/components/ui/modal/modal.md +0 -0
  37. package/src/core/components/ui/pop/pop.md +103 -1
  38. package/src/core/components/ui/pop/pop.ts +70 -115
  39. package/src/core/components/ui/table/table-caption.ts +0 -0
  40. package/src/core/components/ui/table/table.md +0 -0
  41. package/src/core/components/ui/theme/theme.ts +1 -1
  42. package/src/core/components/ui/tooltip/tooltip.ts +178 -154
  43. package/src/core/utils/positioning.spec.ts +180 -0
  44. package/src/core/utils/positioning.ts +164 -0
  45. package/src/core/utils/route.ts +0 -0
  46. package/src/directives.ts +2 -3
  47. package/src/docs/_core-concept/subscriber.md +0 -0
  48. package/src/docs/_getting-started/concorde-outside.md +0 -0
  49. package/src/docs/_getting-started/my-first-subscriber.md +0 -0
  50. package/src/docs/_getting-started/pubsub.md +0 -0
  51. package/src/docs/_getting-started/start.md +0 -0
  52. package/src/docs/example/users.ts +0 -0
  53. package/src/docs/search/docs-search.json +90 -0
  54. package/src/docs/search/page.ts +0 -0
  55. package/src/docs/tailwind/css/tailwind.css +7 -6
  56. package/src/tsconfig.json +387 -381
  57. package/src/tsconfig.tsbuildinfo +1 -1
  58. package/vitest.setup.ts +49 -13
  59. package/.github/workflows/ci.yml +0 -21
  60. package/.github-export-ignore +0 -30
  61. package/CONTRIBUTING.md +0 -59
  62. package/DEV.md +0 -54
  63. package/LICENSE +0 -21
  64. package/OPEN_SOURCE_CHECKPOINT.md +0 -133
  65. package/concorde-3d.bundle.js +0 -3960
  66. package/concorde-3d.es.js +0 -33433
  67. package/concorde-hugging-face-infer.bundle.js +0 -32
  68. package/concorde-hugging-face-infer.es.js +0 -2952
  69. package/concorde-shader.bundle.js +0 -116
  70. package/concorde-shader.es.js +0 -8353
  71. package/concorde-webgpu.bundle.js +0 -307
  72. package/concorde-webgpu.es.js +0 -8627
  73. package/docs/altcha-widget.js +0 -2662
  74. package/docs/assets/index-BZiZXMU-.css +0 -1
  75. package/docs/assets/index-FmK4JaIM.js +0 -11992
  76. package/docs/crawl/core/components/functional/date/date.html +0 -190
  77. package/docs/crawl/core/components/functional/fetch/fetch.html +0 -109
  78. package/docs/crawl/core/components/functional/if/if.html +0 -27
  79. package/docs/crawl/core/components/functional/jsonata/jsonata.html +0 -79
  80. package/docs/crawl/core/components/functional/list/list.html +0 -70
  81. package/docs/crawl/core/components/functional/mix/mix.html +0 -45
  82. package/docs/crawl/core/components/functional/queue/queue.html +0 -96
  83. package/docs/crawl/core/components/functional/router/router.html +0 -106
  84. package/docs/crawl/core/components/functional/sdui/sdui.html +0 -269
  85. package/docs/crawl/core/components/functional/states/states.html +0 -66
  86. package/docs/crawl/core/components/functional/submit/submit.html +0 -160
  87. package/docs/crawl/core/components/functional/subscriber/subscriber.html +0 -67
  88. package/docs/crawl/core/components/functional/value/value.html +0 -51
  89. package/docs/crawl/core/components/ui/alert/alert.html +0 -110
  90. package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +0 -23
  91. package/docs/crawl/core/components/ui/badge/badge.html +0 -119
  92. package/docs/crawl/core/components/ui/button/button.html +0 -149
  93. package/docs/crawl/core/components/ui/captcha/captcha.html +0 -30
  94. package/docs/crawl/core/components/ui/card/card.html +0 -99
  95. package/docs/crawl/core/components/ui/divider/divider.html +0 -58
  96. package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +0 -73
  97. package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +0 -135
  98. package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +0 -79
  99. package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +0 -62
  100. package/docs/crawl/core/components/ui/form/input/input.html +0 -109
  101. package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +0 -106
  102. package/docs/crawl/core/components/ui/form/radio/radio.html +0 -56
  103. package/docs/crawl/core/components/ui/form/select/select.html +0 -73
  104. package/docs/crawl/core/components/ui/form/switch/switch.html +0 -56
  105. package/docs/crawl/core/components/ui/form/textarea/textarea.html +0 -59
  106. package/docs/crawl/core/components/ui/group/group.html +0 -82
  107. package/docs/crawl/core/components/ui/icon/icon.html +0 -133
  108. package/docs/crawl/core/components/ui/image/image.html +0 -110
  109. package/docs/crawl/core/components/ui/link/link.html +0 -42
  110. package/docs/crawl/core/components/ui/loader/loader.html +0 -50
  111. package/docs/crawl/core/components/ui/menu/menu.html +0 -322
  112. package/docs/crawl/core/components/ui/modal/modal.html +0 -117
  113. package/docs/crawl/core/components/ui/pop/pop.html +0 -102
  114. package/docs/crawl/core/components/ui/progress/progress.html +0 -58
  115. package/docs/crawl/core/components/ui/table/table.html +0 -413
  116. package/docs/crawl/core/components/ui/toast/toast.html +0 -122
  117. package/docs/crawl/core/components/ui/tooltip/tooltip.html +0 -79
  118. package/docs/crawl/docs/_core-concept/dataFlow.html +0 -177
  119. package/docs/crawl/docs/_core-concept/overview.html +0 -66
  120. package/docs/crawl/docs/_core-concept/subscriber.html +0 -75
  121. package/docs/crawl/docs/_decorators/ancestor-attribute.html +0 -116
  122. package/docs/crawl/docs/_decorators/auto-subscribe.html +0 -202
  123. package/docs/crawl/docs/_decorators/bind.html +0 -141
  124. package/docs/crawl/docs/_decorators/get.html +0 -149
  125. package/docs/crawl/docs/_decorators/handle.html +0 -165
  126. package/docs/crawl/docs/_decorators/on-assign.html +0 -355
  127. package/docs/crawl/docs/_decorators/patch.html +0 -78
  128. package/docs/crawl/docs/_decorators/post.html +0 -139
  129. package/docs/crawl/docs/_decorators/publish.html +0 -61
  130. package/docs/crawl/docs/_decorators/put.html +0 -78
  131. package/docs/crawl/docs/_decorators/subscribe.html +0 -109
  132. package/docs/crawl/docs/_decorators/wait-for-ancestors.html +0 -137
  133. package/docs/crawl/docs/_directives/sub.html +0 -93
  134. package/docs/crawl/docs/_getting-started/ai-agents.html +0 -173
  135. package/docs/crawl/docs/_getting-started/concorde-manual-install.html +0 -100
  136. package/docs/crawl/docs/_getting-started/concorde-outside.html +0 -58
  137. package/docs/crawl/docs/_getting-started/create-a-component.html +0 -111
  138. package/docs/crawl/docs/_getting-started/my-first-component.html +0 -189
  139. package/docs/crawl/docs/_getting-started/my-first-subscriber.html +0 -110
  140. package/docs/crawl/docs/_getting-started/pubsub.html +0 -62
  141. package/docs/crawl/docs/_getting-started/start.html +0 -76
  142. package/docs/crawl/docs/_getting-started/theming.html +0 -85
  143. package/docs/crawl/docs/_misc/api-configuration.html +0 -149
  144. package/docs/crawl/docs/_misc/dataProviderKey.html +0 -135
  145. package/docs/crawl/docs/_misc/docs-mock-api.html +0 -158
  146. package/docs/crawl/docs/_misc/dynamic-path.html +0 -180
  147. package/docs/crawl/docs/_misc/endpoint.html +0 -50
  148. package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +0 -138
  149. package/docs/crawl/docs/_misc/html-integration.html +0 -48
  150. package/docs/crawl/hubs/decorators.html +0 -547
  151. package/docs/crawl/hubs/form-components.html +0 -357
  152. package/docs/crawl/hubs/remote-data.html +0 -452
  153. package/docs/crawl/index.html +0 -101
  154. package/docs/css/docs.css +0 -0
  155. package/docs/docs-mock-api-sw.js +0 -720
  156. package/docs/docs-mock-api-sw.js.map +0 -7
  157. package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
  158. package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
  159. package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
  160. package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
  161. package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
  162. package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
  163. package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
  164. package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
  165. package/docs/fonts/ClashGrotesk-Light.eot +0 -0
  166. package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
  167. package/docs/fonts/ClashGrotesk-Light.woff +0 -0
  168. package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
  169. package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
  170. package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
  171. package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
  172. package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
  173. package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
  174. package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
  175. package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
  176. package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
  177. package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
  178. package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
  179. package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
  180. package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
  181. package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
  182. package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
  183. package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
  184. package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
  185. package/docs/img/concorde-icon.svg +0 -5
  186. package/docs/img/concorde-logo.svg +0 -1
  187. package/docs/img/concorde.png +0 -0
  188. package/docs/img/concorde_def.png +0 -0
  189. package/docs/img/concorde_seuil.png.webp +0 -0
  190. package/docs/img/concorde_seuil_invert.png +0 -0
  191. package/docs/img/paul_metrand.jpg +0 -0
  192. package/docs/img/paul_metrand_xs.jpg +0 -0
  193. package/docs/index.html +0 -93
  194. package/docs/llms-full.txt +0 -5787
  195. package/docs/llms.txt +0 -104
  196. package/docs/robots.txt +0 -16
  197. package/docs/sitemap.xml +0 -237
  198. package/docs/src/core/components/functional/date/date.md +0 -290
  199. package/docs/src/core/components/functional/fetch/fetch.md +0 -125
  200. package/docs/src/core/components/functional/if/if.md +0 -9
  201. package/docs/src/core/components/functional/jsonata/jsonata.md +0 -56
  202. package/docs/src/core/components/functional/list/list.md +0 -65
  203. package/docs/src/core/components/functional/mix/mix.md +0 -41
  204. package/docs/src/core/components/functional/queue/queue.md +0 -72
  205. package/docs/src/core/components/functional/router/router.md +0 -94
  206. package/docs/src/core/components/functional/sdui/default-library.json +0 -108
  207. package/docs/src/core/components/functional/sdui/example.json +0 -99
  208. package/docs/src/core/components/functional/sdui/sdui.md +0 -356
  209. package/docs/src/core/components/functional/states/states.md +0 -87
  210. package/docs/src/core/components/functional/submit/submit.md +0 -114
  211. package/docs/src/core/components/functional/subscriber/subscriber.md +0 -91
  212. package/docs/src/core/components/functional/value/value.md +0 -35
  213. package/docs/src/core/components/ui/alert/alert.md +0 -121
  214. package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
  215. package/docs/src/core/components/ui/badge/badge.md +0 -127
  216. package/docs/src/core/components/ui/button/button.md +0 -182
  217. package/docs/src/core/components/ui/captcha/captcha.md +0 -12
  218. package/docs/src/core/components/ui/card/card.md +0 -97
  219. package/docs/src/core/components/ui/divider/divider.md +0 -35
  220. package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -77
  221. package/docs/src/core/components/ui/form/fieldset/fieldset.md +0 -129
  222. package/docs/src/core/components/ui/form/form-actions/form-actions.md +0 -77
  223. package/docs/src/core/components/ui/form/form-layout/form-layout.md +0 -44
  224. package/docs/src/core/components/ui/form/input/input.md +0 -142
  225. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -133
  226. package/docs/src/core/components/ui/form/radio/radio.md +0 -57
  227. package/docs/src/core/components/ui/form/select/select.md +0 -71
  228. package/docs/src/core/components/ui/form/switch/switch.md +0 -57
  229. package/docs/src/core/components/ui/form/textarea/textarea.md +0 -65
  230. package/docs/src/core/components/ui/group/group.md +0 -75
  231. package/docs/src/core/components/ui/icon/icon.md +0 -125
  232. package/docs/src/core/components/ui/icon/icons.json +0 -1
  233. package/docs/src/core/components/ui/image/image.md +0 -107
  234. package/docs/src/core/components/ui/link/link.md +0 -43
  235. package/docs/src/core/components/ui/loader/loader.md +0 -55
  236. package/docs/src/core/components/ui/menu/menu.md +0 -329
  237. package/docs/src/core/components/ui/modal/modal.md +0 -119
  238. package/docs/src/core/components/ui/pop/pop.md +0 -96
  239. package/docs/src/core/components/ui/progress/progress.md +0 -63
  240. package/docs/src/core/components/ui/table/table.md +0 -455
  241. package/docs/src/core/components/ui/toast/toast.md +0 -166
  242. package/docs/src/core/components/ui/tooltip/tooltip.md +0 -82
  243. package/docs/src/docs/_core-concept/dataFlow.md +0 -88
  244. package/docs/src/docs/_core-concept/overview.md +0 -57
  245. package/docs/src/docs/_core-concept/subscriber.md +0 -75
  246. package/docs/src/docs/_decorators/ancestor-attribute.md +0 -127
  247. package/docs/src/docs/_decorators/auto-subscribe.md +0 -202
  248. package/docs/src/docs/_decorators/bind.md +0 -167
  249. package/docs/src/docs/_decorators/get.md +0 -162
  250. package/docs/src/docs/_decorators/handle.md +0 -175
  251. package/docs/src/docs/_decorators/on-assign.md +0 -390
  252. package/docs/src/docs/_decorators/patch.md +0 -70
  253. package/docs/src/docs/_decorators/post.md +0 -146
  254. package/docs/src/docs/_decorators/publish.md +0 -55
  255. package/docs/src/docs/_decorators/put.md +0 -70
  256. package/docs/src/docs/_decorators/subscribe.md +0 -100
  257. package/docs/src/docs/_decorators/wait-for-ancestors.md +0 -163
  258. package/docs/src/docs/_directives/sub.md +0 -91
  259. package/docs/src/docs/_getting-started/ai-agents.md +0 -76
  260. package/docs/src/docs/_getting-started/concorde-manual-install.md +0 -133
  261. package/docs/src/docs/_getting-started/concorde-outside.md +0 -33
  262. package/docs/src/docs/_getting-started/create-a-component.md +0 -139
  263. package/docs/src/docs/_getting-started/my-first-component.md +0 -236
  264. package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -120
  265. package/docs/src/docs/_getting-started/pubsub.md +0 -37
  266. package/docs/src/docs/_getting-started/start.md +0 -47
  267. package/docs/src/docs/_getting-started/theming.md +0 -91
  268. package/docs/src/docs/_misc/api-configuration.md +0 -81
  269. package/docs/src/docs/_misc/dataProviderKey.md +0 -168
  270. package/docs/src/docs/_misc/docs-mock-api.md +0 -63
  271. package/docs/src/docs/_misc/dynamic-path.md +0 -71
  272. package/docs/src/docs/_misc/endpoint.md +0 -45
  273. package/docs/src/docs/_misc/formelement-subscriber-removal.md +0 -115
  274. package/docs/src/docs/_misc/html-integration.md +0 -15
  275. package/docs/src/docs/search/docs-search.json +0 -9512
  276. package/docs/src/tag-list.json +0 -1
  277. package/docs/src/tsconfig-model.json +0 -23
  278. package/docs/src/tsconfig.declarations.json +0 -22
  279. package/docs/src/tsconfig.emit.json +0 -23
  280. package/docs/src/tsconfig.json +0 -858
  281. package/docs/svg/regular/plane.svg +0 -1
  282. package/docs/svg/solid/plane.svg +0 -1
  283. package/gitlab/job_github_mirror.sh +0 -39
  284. package/scripts/github-export.mjs +0 -150
  285. package/src/css.d.ts +0 -19
  286. package/src/tsconfig.declarations.json +0 -22
  287. package/src/tsconfig.emit.json +0 -23
@@ -1,16 +1,14 @@
1
1
  #!/usr/bin/env bash
2
2
  # Tests CI de concorde : install + vitest (sans watch).
3
3
  #
4
- # Contexte : le runner shell (ssks7, hôte manu) checkout le code dans $CI_PROJECT_DIR
5
- # (sous /home/gitlab-runner/...), invisible depuis le conteneur nodejs.
4
+ # Contexte : le runner shell (ssks7) checkout le code dans $CI_PROJECT_DIR
5
+ # (sous /home/ssks/...), invisible depuis le conteneur nodejs.
6
6
  # Le conteneur nodejs monte /usr2/sites -> /sites. On copie donc le code du runner vers
7
- # un dossier CI DÉDIÉ et appartenant au runner : /usr2/sites/concorde-ci/<branche>
8
- # (= /sites/concorde-ci/<branche> dans le conteneur), puis on lance yarn dans le conteneur
9
- # nodejs existant via /scripts/cmd-yes.sh. Aucune image construite.
7
+ # un dossier CI sous /usr2/sites writable par le runner, puis on lance yarn dans le
8
+ # conteneur nodejs existant via /scripts/cmd-yes.sh. Aucune image construite.
10
9
  #
11
- # Pré-requis (une seule fois, en root sur manu) :
12
- # sudo mkdir -p /usr2/sites/concorde-ci
13
- # sudo chown -R gitlab-runner:gitlab-runner /usr2/sites/concorde-ci
10
+ # Si /usr2/sites/concorde-ci n'est pas writable (ex. tree laissé par un autre uid),
11
+ # on bascule automatiquement sur /usr2/sites/concorde-ci-u<uid>.
14
12
  #
15
13
  # Concorde n'est PAS un workspace -> commandes yarn directes.
16
14
  #
@@ -19,15 +17,30 @@
19
17
  set -euo pipefail
20
18
 
21
19
  NODEJS_CONTAINER=nodejs
22
- SITE_BASE="/usr2/sites/concorde-ci"
23
20
 
24
21
  # En pipeline de Merge Request, CI_COMMIT_BRANCH est vide -> fallback sur CI_COMMIT_REF_NAME.
25
22
  BRANCH="${CI_COMMIT_BRANCH:-${CI_COMMIT_REF_NAME:-ci}}"
23
+ RUN_UID="$(id -u):$(id -g)"
24
+ RUN_UID_NUM="$(id -u)"
25
+
26
+ # Dossier CI writable par le runner (évite Permission denied si un ancien tree
27
+ # appartient à un autre uid, ex. 1001 via docker -u 1001).
28
+ SITE_BASE="/usr2/sites/concorde-ci"
29
+ mkdir -p "$SITE_BASE" 2>/dev/null || true
30
+ if [[ ! -d "$SITE_BASE" || ! -w "$SITE_BASE" ]]; then
31
+ SITE_BASE="/usr2/sites/concorde-ci-u${RUN_UID_NUM}"
32
+ mkdir -p "$SITE_BASE"
33
+ fi
34
+
26
35
  SITE_PATH="$SITE_BASE/$BRANCH"
27
- SITE_CONTAINER_PATH="/sites/concorde-ci/$BRANCH"
36
+ if [[ -e "$SITE_PATH" && ! -w "$SITE_PATH" ]]; then
37
+ SITE_BASE="/usr2/sites/concorde-ci-u${RUN_UID_NUM}"
38
+ mkdir -p "$SITE_BASE"
39
+ SITE_PATH="$SITE_BASE/$BRANCH"
40
+ fi
28
41
 
29
- # On exécute le conteneur avec l'uid du runner (cohérence des droits en écriture).
30
- RUN_UID="$(id -u):$(id -g)"
42
+ # /usr2/sites/<...> -> /sites/<...> dans le conteneur.
43
+ SITE_CONTAINER_PATH="/sites/${SITE_BASE#/usr2/sites/}/$BRANCH"
31
44
 
32
45
  echo "=== Configuration ==="
33
46
  echo "- CI_PROJECT_DIR '$CI_PROJECT_DIR'"
package/index.html CHANGED
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <link rel="icon" type="image/svg+xml" href="./svg/favicon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <meta name="robots" content="noindex, nofollow" />
8
7
  <title>Concorde - A supersonic design system</title>
8
+ <link rel="stylesheet" href="https://use.typekit.net/eda3clw.css" />
9
9
  <script src="https://cdn.jsdelivr.net/npm/fuzzysort@2.0.1/fuzzysort.min.js"></script>
10
10
  <!-- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
11
11
  -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "",
@@ -345,6 +345,8 @@
345
345
  "./utils/endpoint": "./src/core/utils/endpoint.ts",
346
346
  "./utils/jsonataHelpers": "./src/core/utils/jsonataHelpers.ts",
347
347
  "./utils/jsonataRuntime": "./src/core/utils/jsonataRuntime.ts",
348
+ "./utils/positioning.spec": "./src/core/utils/positioning.spec.ts",
349
+ "./utils/positioning": "./src/core/utils/positioning.ts",
348
350
  "./utils/publisherPathKey.spec": "./src/core/utils/publisherPathKey.spec.ts",
349
351
  "./utils/route.spec": "./src/core/utils/route.spec.ts",
350
352
  "./utils/route": "./src/core/utils/route.ts",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -30,7 +30,41 @@
30
30
  </template>
31
31
  </sonic-code>
32
32
 
33
+ Default placement is `bottom`. Content is aligned on the start of the trigger, add `center` to center it. If there is not enough room, content flips to the opposite side and stays inside the viewport.
34
+
35
+ <sonic-code>
36
+ <template>
37
+ <sonic-pop class="inline-block" placement="bottom center">
38
+ <sonic-button>Bottom center</sonic-button>
39
+ <sonic-menu slot="content">
40
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
41
+ </sonic-menu>
42
+ </sonic-pop>
43
+ <sonic-pop class="inline-block" placement="top center">
44
+ <sonic-button>Top center</sonic-button>
45
+ <sonic-menu slot="content">
46
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
47
+ </sonic-menu>
48
+ </sonic-pop>
49
+ <sonic-pop class="inline-block" placement="left center">
50
+ <sonic-button>Left center</sonic-button>
51
+ <sonic-menu slot="content">
52
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
53
+ </sonic-menu>
54
+ </sonic-pop>
55
+ <sonic-pop class="inline-block" placement="right center">
56
+ <sonic-button>Right center</sonic-button>
57
+ <sonic-menu slot="content">
58
+ <sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
59
+ </sonic-menu>
60
+ </sonic-pop>
61
+ </template>
62
+ </sonic-code>
63
+
33
64
  ## Shadow
65
+
66
+ Default shadow is `lg`.
67
+
34
68
  <sonic-code>
35
69
  <template>
36
70
  <sonic-pop class="inline-block" shadow="none" placement='top' >
@@ -60,6 +94,26 @@
60
94
  </template>
61
95
  </sonic-code>
62
96
 
97
+ ## Inline
98
+
99
+ By default, pop is vertically aligned to the middle. Use `inline` to align it on the text baseline, e.g. inside a sentence.
100
+
101
+ <sonic-code>
102
+ <template>
103
+ <p>
104
+ The Concorde flew from Paris to
105
+ <sonic-pop inline>
106
+ <sonic-button variant="link">New York</sonic-button>
107
+ <sonic-menu slot="content">
108
+ <sonic-menu-item>See flights</sonic-menu-item>
109
+ <sonic-menu-item>Book a seat</sonic-menu-item>
110
+ </sonic-menu>
111
+ </sonic-pop>
112
+ in about 3.5 hours.
113
+ </p>
114
+ </template>
115
+ </sonic-code>
116
+
63
117
  ## noToggle
64
118
  <sonic-code>
65
119
  <template>
@@ -93,4 +147,52 @@
93
147
  Click to open pop
94
148
  </sonic-button>
95
149
  </template>
96
- </sonic-code>
150
+ </sonic-code>
151
+
152
+ ## Keep open on select
153
+
154
+ By default, a click inside the content closes the pop, as well as a click outside. Add `data-on-select="keep"` on the content, or on any of its elements, to keep the pop open when interacting with it.
155
+
156
+ <sonic-code>
157
+ <template>
158
+ <sonic-pop class="inline-block">
159
+ <sonic-button>Closes on select</sonic-button>
160
+ <div slot="content" class="grid gap-2 p-3">
161
+ <sonic-checkbox>Option A</sonic-checkbox>
162
+ <sonic-checkbox>Option B</sonic-checkbox>
163
+ </div>
164
+ </sonic-pop>
165
+ <sonic-pop class="inline-block">
166
+ <sonic-button>Stays open on select</sonic-button>
167
+ <div slot="content" class="grid gap-2 p-3" data-on-select="keep">
168
+ <sonic-checkbox>Option A</sonic-checkbox>
169
+ <sonic-checkbox>Option B</sonic-checkbox>
170
+ </div>
171
+ </sonic-pop>
172
+ </template>
173
+ </sonic-code>
174
+
175
+ ## Keyboard
176
+
177
+ - `ArrowDown` on the trigger opens the pop.
178
+ - `Escape` closes the last opened pop and gives focus back to its trigger.
179
+
180
+ ## Methods and events
181
+
182
+ `show()` and `hide()` open and close the pop programmatically (see `manual` above). The pop dispatches a `show` event when it opens and a `hide` event when it closes.
183
+
184
+ ```js
185
+ const pop = document.querySelector("sonic-pop");
186
+ pop.addEventListener("hide", () => console.log("pop closed"));
187
+ pop.show();
188
+ ```
189
+
190
+ ## Styling
191
+
192
+ The content can be styled from outside with `::part(content)`.
193
+
194
+ ```css
195
+ sonic-pop::part(content) {
196
+ border-radius: 0;
197
+ }
198
+ ```
@@ -1,17 +1,22 @@
1
1
  import { html, LitElement, css, PropertyValues } from "lit";
2
2
  import { customElement, query, state, property } from "lit/decorators.js";
3
+ import { ifDefined } from "lit/directives/if-defined.js";
3
4
 
4
5
  import HTML, {
5
6
  SearchableDomElement,
6
7
  } from "@supersoniks/concorde/core/utils/HTML";
8
+ import {
9
+ computeFloatingPosition,
10
+ FloatingSide,
11
+ getFloatingBounds,
12
+ supportsPopover,
13
+ } from "@supersoniks/concorde/core/utils/positioning";
7
14
  import { Shadow, shadowable } from "../_css/shadow";
8
- // Toast
9
15
  type PopPlacement =
10
16
  | "bottom"
11
17
  | "top"
12
18
  | "right"
13
19
  | "left"
14
- | "top"
15
20
  | "bottom center"
16
21
  | "top center"
17
22
  | "right center"
@@ -22,6 +27,7 @@ const tagName = "sonic-pop";
22
27
  @customElement(tagName)
23
28
  export class Pop extends LitElement {
24
29
  static pops = new Set<Pop>();
30
+ static readonly supportsPopover = supportsPopover;
25
31
  static styles = [
26
32
  css`
27
33
  :host {
@@ -44,7 +50,7 @@ export class Pop extends LitElement {
44
50
  border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em);
45
51
  }
46
52
 
47
- slot[name="content"].is-open:not(.is-empty) {
53
+ slot[name="content"].is-open {
48
54
  transform: translateY(0) scale(1);
49
55
  opacity: 1;
50
56
  pointer-events: auto;
@@ -52,6 +58,36 @@ export class Pop extends LitElement {
52
58
  transition-timing-function: cubic-bezier(0.25, 0.25, 0.42, 1.225);
53
59
  }
54
60
 
61
+ slot[name="content"][popover] {
62
+ inset: auto;
63
+ width: auto;
64
+ height: auto;
65
+ margin: 0;
66
+ padding: 0;
67
+ border: none;
68
+ overflow: visible;
69
+ color: inherit;
70
+ /* display / overlay en allow-discrete : reste dans le top layer pendant le fondu de fermeture */
71
+ transition-property: all, display, overlay;
72
+ transition-behavior: normal, allow-discrete, allow-discrete;
73
+ }
74
+
75
+ slot[name="content"][popover]:not(:popover-open) {
76
+ display: none;
77
+ }
78
+
79
+ slot[name="content"][popover].is-open {
80
+ transition-property: scale, opacity, display, overlay;
81
+ transition-behavior: normal, normal, allow-discrete, allow-discrete;
82
+ }
83
+
84
+ @starting-style {
85
+ slot[name="content"][popover].is-open:popover-open {
86
+ transform: translateY(1rem) scale(0.95);
87
+ opacity: 0;
88
+ }
89
+ }
90
+
55
91
  :host([inline]) {
56
92
  vertical-align: baseline;
57
93
  }
@@ -83,7 +119,6 @@ export class Pop extends LitElement {
83
119
 
84
120
  runPositioningLoop() {
85
121
  if (!this.positioningRuns) return;
86
- this.positioningRuns = true;
87
122
  this.computePosition(this.placement);
88
123
  window.requestAnimationFrame(() => this.runPositioningLoop());
89
124
  }
@@ -104,9 +139,14 @@ export class Pop extends LitElement {
104
139
  }
105
140
 
106
141
  show() {
107
- this.setMaxZindex();
142
+ if (!Pop.supportsPopover) this.setMaxZindex();
108
143
  this.popContent?.style?.removeProperty("display");
144
+ if (Pop.supportsPopover && !this.popContent.matches(":popover-open")) {
145
+ this.popContent.showPopover();
146
+ }
109
147
  this.open = true;
148
+ // Pop.pops suit l'ordre d'ouverture : Escape ferme le dernier ouvert.
149
+ if (Pop.pops.delete(this)) Pop.pops.add(this);
110
150
  this.popContent.setAttribute("tabindex", "0");
111
151
  if (this.popBtn && this.popContent && !this.positioningRuns) {
112
152
  this.positioningRuns = true;
@@ -118,7 +158,10 @@ export class Pop extends LitElement {
118
158
  }
119
159
 
120
160
  hide() {
121
- this.resetZindexes();
161
+ if (!Pop.supportsPopover) this.resetZindexes();
162
+ if (Pop.supportsPopover && this.popContent?.matches(":popover-open")) {
163
+ this.popContent.hidePopover();
164
+ }
122
165
  this.open = false;
123
166
  this.popContent.setAttribute("tabindex", "-1");
124
167
  this.positioningRuns = false;
@@ -204,7 +247,7 @@ export class Pop extends LitElement {
204
247
  if (Pop.pops.size == 0) {
205
248
  document.addEventListener("pointerdown", this._handleClosePop);
206
249
  document.addEventListener("click", this._handleClosePop);
207
- document.addEventListener("keydown", this._handleKeyDown);
250
+ document.addEventListener("keydown", Pop._handleKeyDown);
208
251
  }
209
252
  Pop.pops.add(this);
210
253
  }
@@ -226,128 +269,39 @@ export class Pop extends LitElement {
226
269
  if (Pop.pops.size == 0) {
227
270
  document.removeEventListener("pointerdown", this._handleClosePop);
228
271
  document.removeEventListener("click", this._handleClosePop);
229
- document.removeEventListener("keydown", this._handleKeyDown);
272
+ document.removeEventListener("keydown", Pop._handleKeyDown);
230
273
  }
231
274
  }
232
275
 
233
276
  computePosition(placement: PopPlacement) {
234
- const placementSplit = placement.split(" ");
235
- const placementBase = placementSplit[0];
236
- let placementSec = placementSplit[1];
237
-
238
- const padding = 5;
239
- const thisRect = this.getBoundingClientRect();
240
-
241
- const scrollableAncestor = HTML.getScrollableAncestor(
242
- this.popContent,
243
- ) as HTMLElement;
244
- const scrollableAncestorRect = scrollableAncestor?.getBoundingClientRect();
245
- const minX = Math.max(0, scrollableAncestorRect?.left || 0) + padding;
246
- const minY = Math.max(0, scrollableAncestorRect?.top || 0) + padding;
247
- const maxX =
248
- Math.min(
249
- window.innerWidth,
250
- scrollableAncestorRect?.right || window.innerWidth,
251
- ) - padding;
252
- const maxY =
253
- Math.min(
254
- window.innerHeight,
255
- scrollableAncestorRect?.bottom || window.innerHeight,
256
- ) - padding;
257
- const x0 = thisRect.left;
258
- const y0 = thisRect.top;
259
- let x = x0,
260
- y = y0;
261
- let contentRect = this.popContent?.getBoundingClientRect();
262
- const yTop = y0 - contentRect.height;
263
- const xLeft = x0 - contentRect.width;
264
- const xRight = x0 + thisRect.width;
265
- const yBottom = y0 + thisRect.height;
266
- const xCenter = x0 + (thisRect.width - contentRect.width) * 0.5;
267
- const yCenter = y0 + (thisRect.height - contentRect.height) * 0.5;
268
- switch (placementBase) {
269
- case "bottom":
270
- y = yBottom;
271
- if (placementSec == "center") {
272
- x = xCenter;
273
- }
274
- break;
275
- case "top":
276
- y = yTop;
277
- if (placementSec == "center") {
278
- x = xCenter;
279
- }
280
- break;
281
- case "left":
282
- x = xLeft;
283
- if (placementSec == "center") {
284
- y = yCenter;
285
- }
286
- break;
287
- case "right":
288
- x = xRight;
289
- if (placementSec == "center") {
290
- y = yCenter;
291
- }
292
- break;
293
- }
294
-
295
- this.lastContentX += x - contentRect.x;
296
- this.lastContentY += y - contentRect.y;
297
- Object.assign(this.popContent.style, {
298
- left: `${this.lastContentX}px`,
299
- top: `${this.lastContentY}px`,
277
+ const [side, secondary] = placement.split(" ");
278
+ const contentRect = this.popContent.getBoundingClientRect();
279
+
280
+ const { x, y } = computeFloatingPosition({
281
+ anchor: this.getBoundingClientRect(),
282
+ floating: contentRect,
283
+ side: side as FloatingSide,
284
+ align: secondary == "center" ? "center" : "start",
285
+ bounds: getFloatingBounds(this.popContent, 5),
300
286
  });
301
287
 
302
- contentRect = this.popContent?.getBoundingClientRect();
303
- if (contentRect.x < minX && placementBase == "left") x = xRight;
304
- if (contentRect.y < minY && placementBase == "top") y = yBottom;
305
- if (contentRect.x + contentRect.width > maxX && placementBase == "right")
306
- x = xLeft;
307
- if (contentRect.y + contentRect.height > maxY && placementBase == "bottom")
308
- y = yTop;
309
-
288
+ // Déplacement relatif à la position mesurée : reste juste quand un ancêtre transformé
289
+ // (ex. modale en translateZ) devient le bloc conteneur du position: fixed.
310
290
  this.lastContentX += x - contentRect.x;
311
291
  this.lastContentY += y - contentRect.y;
312
-
313
- Object.assign(this.popContent.style, {
314
- left: `${this.lastContentX}px`,
315
- top: `${this.lastContentY}px`,
316
- });
317
-
318
- contentRect = this.popContent?.getBoundingClientRect();
319
-
320
- if (contentRect.x < minX) {
321
- this.lastContentX += minX - contentRect.x;
322
- }
323
- if (contentRect.y < minY) {
324
- this.lastContentY += minY - contentRect.y;
325
- }
326
-
327
- Object.assign(this.popContent.style, {
328
- left: `${this.lastContentX}px`,
329
- top: `${this.lastContentY}px`,
330
- });
331
- contentRect = this.popContent?.getBoundingClientRect();
332
- if (contentRect.x + contentRect.width > maxX) {
333
- this.lastContentX += maxX - (contentRect.x + contentRect.width);
334
- }
335
- if (contentRect.y + contentRect.height > maxY) {
336
- this.lastContentY += maxY - (contentRect.y + contentRect.height);
337
- }
338
-
339
292
  Object.assign(this.popContent.style, {
340
293
  left: `${this.lastContentX}px`,
341
294
  top: `${this.lastContentY}px`,
342
295
  });
343
296
  }
344
297
 
345
- private _handleKeyDown = (e: KeyboardEvent) => {
346
- if (e.key === "Escape" && this.open) {
347
- e.stopPropagation();
348
- this.hide();
349
- }
350
- };
298
+ private static _handleKeyDown(e: KeyboardEvent) {
299
+ if (e.key !== "Escape") return;
300
+ const lastOpened = [...Pop.pops].reverse().find((pop) => pop.open);
301
+ if (!lastOpened) return;
302
+ e.stopPropagation();
303
+ lastOpened.hide();
304
+ }
351
305
 
352
306
  render() {
353
307
  return html`
@@ -358,6 +312,7 @@ export class Pop extends LitElement {
358
312
  ></slot>
359
313
  <slot
360
314
  name="content"
315
+ popover=${ifDefined(Pop.supportsPopover ? "manual" : undefined)}
361
316
  tabindex="-1"
362
317
  part="content"
363
318
  style="display: none;"
File without changes
File without changes
@@ -38,7 +38,7 @@ export class Theme extends LitElement {
38
38
  border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em);
39
39
  }
40
40
 
41
- ::slotted(.sonic-pop-content).is-open:not(.is-empty) {
41
+ ::slotted(.sonic-pop-content).is-open {
42
42
  transform: translateY(0) scale(1);
43
43
  opacity: 1;
44
44
  pointer-events: auto;