@supersoniks/concorde 5.0.2 → 5.0.3

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 (214) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +1 -1
  3. package/concorde-core.es.js +1 -1
  4. package/dist/concorde-core.bundle.js +1 -1
  5. package/dist/concorde-core.es.js +1 -1
  6. package/docs/altcha-widget.js +2662 -0
  7. package/docs/assets/index--GpD7R7a.css +1 -0
  8. package/docs/assets/index-BnK6OS7w.js +12115 -0
  9. package/docs/crawl/core/components/functional/date/date.html +190 -0
  10. package/docs/crawl/core/components/functional/fetch/fetch.html +109 -0
  11. package/docs/crawl/core/components/functional/if/if.html +27 -0
  12. package/docs/crawl/core/components/functional/jsonata/jsonata.html +79 -0
  13. package/docs/crawl/core/components/functional/list/list.html +70 -0
  14. package/docs/crawl/core/components/functional/mix/mix.html +45 -0
  15. package/docs/crawl/core/components/functional/queue/queue.html +96 -0
  16. package/docs/crawl/core/components/functional/router/router.html +106 -0
  17. package/docs/crawl/core/components/functional/sdui/sdui.html +269 -0
  18. package/docs/crawl/core/components/functional/states/states.html +66 -0
  19. package/docs/crawl/core/components/functional/submit/submit.html +160 -0
  20. package/docs/crawl/core/components/functional/subscriber/subscriber.html +67 -0
  21. package/docs/crawl/core/components/functional/value/value.html +51 -0
  22. package/docs/crawl/core/components/ui/alert/alert.html +140 -0
  23. package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +23 -0
  24. package/docs/crawl/core/components/ui/badge/badge.html +148 -0
  25. package/docs/crawl/core/components/ui/button/button.html +150 -0
  26. package/docs/crawl/core/components/ui/captcha/captcha.html +30 -0
  27. package/docs/crawl/core/components/ui/card/card.html +143 -0
  28. package/docs/crawl/core/components/ui/divider/divider.html +58 -0
  29. package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +73 -0
  30. package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +135 -0
  31. package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +79 -0
  32. package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +62 -0
  33. package/docs/crawl/core/components/ui/form/input/input.html +109 -0
  34. package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +38 -0
  35. package/docs/crawl/core/components/ui/form/radio/radio.html +56 -0
  36. package/docs/crawl/core/components/ui/form/select/select.html +73 -0
  37. package/docs/crawl/core/components/ui/form/switch/switch.html +56 -0
  38. package/docs/crawl/core/components/ui/form/textarea/textarea.html +59 -0
  39. package/docs/crawl/core/components/ui/group/group.html +82 -0
  40. package/docs/crawl/core/components/ui/icon/icon.html +133 -0
  41. package/docs/crawl/core/components/ui/image/image.html +186 -0
  42. package/docs/crawl/core/components/ui/link/link.html +42 -0
  43. package/docs/crawl/core/components/ui/loader/loader.html +50 -0
  44. package/docs/crawl/core/components/ui/menu/menu.html +322 -0
  45. package/docs/crawl/core/components/ui/modal/modal.html +117 -0
  46. package/docs/crawl/core/components/ui/pop/pop.html +178 -0
  47. package/docs/crawl/core/components/ui/progress/progress.html +58 -0
  48. package/docs/crawl/core/components/ui/table/table.html +413 -0
  49. package/docs/crawl/core/components/ui/toast/toast.html +122 -0
  50. package/docs/crawl/core/components/ui/tooltip/tooltip.html +79 -0
  51. package/docs/crawl/docs/_core-concept/dataFlow.html +177 -0
  52. package/docs/crawl/docs/_core-concept/overview.html +66 -0
  53. package/docs/crawl/docs/_core-concept/subscriber.html +75 -0
  54. package/docs/crawl/docs/_decorators/ancestor-attribute.html +116 -0
  55. package/docs/crawl/docs/_decorators/auto-subscribe.html +202 -0
  56. package/docs/crawl/docs/_decorators/bind.html +141 -0
  57. package/docs/crawl/docs/_decorators/get.html +149 -0
  58. package/docs/crawl/docs/_decorators/handle.html +165 -0
  59. package/docs/crawl/docs/_decorators/on-assign.html +355 -0
  60. package/docs/crawl/docs/_decorators/patch.html +78 -0
  61. package/docs/crawl/docs/_decorators/post.html +139 -0
  62. package/docs/crawl/docs/_decorators/publish.html +61 -0
  63. package/docs/crawl/docs/_decorators/put.html +78 -0
  64. package/docs/crawl/docs/_decorators/subscribe.html +109 -0
  65. package/docs/crawl/docs/_decorators/wait-for-ancestors.html +137 -0
  66. package/docs/crawl/docs/_directives/sub.html +93 -0
  67. package/docs/crawl/docs/_getting-started/ai-agents.html +173 -0
  68. package/docs/crawl/docs/_getting-started/concorde-manual-install.html +100 -0
  69. package/docs/crawl/docs/_getting-started/concorde-outside.html +58 -0
  70. package/docs/crawl/docs/_getting-started/create-a-component.html +111 -0
  71. package/docs/crawl/docs/_getting-started/my-first-component.html +189 -0
  72. package/docs/crawl/docs/_getting-started/my-first-subscriber.html +110 -0
  73. package/docs/crawl/docs/_getting-started/pubsub.html +62 -0
  74. package/docs/crawl/docs/_getting-started/start.html +76 -0
  75. package/docs/crawl/docs/_getting-started/theming.html +85 -0
  76. package/docs/crawl/docs/_misc/api-configuration.html +149 -0
  77. package/docs/crawl/docs/_misc/dataProviderKey.html +135 -0
  78. package/docs/crawl/docs/_misc/docs-mock-api.html +158 -0
  79. package/docs/crawl/docs/_misc/dynamic-path.html +180 -0
  80. package/docs/crawl/docs/_misc/endpoint.html +50 -0
  81. package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +138 -0
  82. package/docs/crawl/docs/_misc/html-integration.html +48 -0
  83. package/docs/crawl/hubs/decorators.html +547 -0
  84. package/docs/crawl/hubs/form-components.html +359 -0
  85. package/docs/crawl/hubs/remote-data.html +452 -0
  86. package/docs/crawl/index.html +101 -0
  87. package/docs/css/docs.css +0 -0
  88. package/docs/docs-mock-api-sw.js +724 -0
  89. package/docs/docs-mock-api-sw.js.map +7 -0
  90. package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
  91. package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
  92. package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
  93. package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
  94. package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
  95. package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
  96. package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
  97. package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
  98. package/docs/fonts/ClashGrotesk-Light.eot +0 -0
  99. package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
  100. package/docs/fonts/ClashGrotesk-Light.woff +0 -0
  101. package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
  102. package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
  103. package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
  104. package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
  105. package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
  106. package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
  107. package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
  108. package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
  109. package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
  110. package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
  111. package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
  112. package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
  113. package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
  114. package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
  115. package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
  116. package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
  117. package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
  118. package/docs/img/concorde-icon.svg +5 -0
  119. package/docs/img/concorde-logo.svg +1 -0
  120. package/docs/img/concorde.png +0 -0
  121. package/docs/img/concorde_def.png +0 -0
  122. package/docs/img/concorde_seuil.png.webp +0 -0
  123. package/docs/img/concorde_seuil_invert.png +0 -0
  124. package/docs/img/paul_metrand.jpg +0 -0
  125. package/docs/img/paul_metrand_xs.jpg +0 -0
  126. package/docs/index.html +93 -0
  127. package/docs/llms-full.txt +5945 -0
  128. package/docs/llms.txt +104 -0
  129. package/docs/robots.txt +16 -0
  130. package/docs/sitemap.xml +237 -0
  131. package/docs/src/core/components/functional/date/date.md +290 -0
  132. package/docs/src/core/components/functional/fetch/fetch.md +125 -0
  133. package/docs/src/core/components/functional/if/if.md +9 -0
  134. package/docs/src/core/components/functional/jsonata/jsonata.md +56 -0
  135. package/docs/src/core/components/functional/list/list.md +65 -0
  136. package/docs/src/core/components/functional/mix/mix.md +41 -0
  137. package/docs/src/core/components/functional/queue/queue.md +72 -0
  138. package/docs/src/core/components/functional/router/router.md +94 -0
  139. package/docs/src/core/components/functional/sdui/default-library.json +108 -0
  140. package/docs/src/core/components/functional/sdui/example.json +99 -0
  141. package/docs/src/core/components/functional/sdui/sdui.md +356 -0
  142. package/docs/src/core/components/functional/states/states.md +87 -0
  143. package/docs/src/core/components/functional/submit/submit.md +114 -0
  144. package/docs/src/core/components/functional/subscriber/subscriber.md +91 -0
  145. package/docs/src/core/components/functional/value/value.md +35 -0
  146. package/docs/src/core/components/ui/alert/alert.md +177 -0
  147. package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
  148. package/docs/src/core/components/ui/badge/badge.md +175 -0
  149. package/docs/src/core/components/ui/button/button.md +183 -0
  150. package/docs/src/core/components/ui/captcha/captcha.md +12 -0
  151. package/docs/src/core/components/ui/card/card.md +152 -0
  152. package/docs/src/core/components/ui/divider/divider.md +35 -0
  153. package/docs/src/core/components/ui/form/checkbox/checkbox.md +77 -0
  154. package/docs/src/core/components/ui/form/fieldset/fieldset.md +129 -0
  155. package/docs/src/core/components/ui/form/form-actions/form-actions.md +77 -0
  156. package/docs/src/core/components/ui/form/form-layout/form-layout.md +44 -0
  157. package/docs/src/core/components/ui/form/input/input.md +142 -0
  158. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +29 -0
  159. package/docs/src/core/components/ui/form/radio/radio.md +57 -0
  160. package/docs/src/core/components/ui/form/select/select.md +71 -0
  161. package/docs/src/core/components/ui/form/switch/switch.md +57 -0
  162. package/docs/src/core/components/ui/form/textarea/textarea.md +65 -0
  163. package/docs/src/core/components/ui/group/group.md +75 -0
  164. package/docs/src/core/components/ui/icon/icon.md +125 -0
  165. package/docs/src/core/components/ui/icon/icons.json +1 -0
  166. package/docs/src/core/components/ui/image/image.md +201 -0
  167. package/docs/src/core/components/ui/link/link.md +43 -0
  168. package/docs/src/core/components/ui/loader/loader.md +55 -0
  169. package/docs/src/core/components/ui/menu/menu.md +329 -0
  170. package/docs/src/core/components/ui/modal/modal.md +119 -0
  171. package/docs/src/core/components/ui/pop/pop.md +200 -0
  172. package/docs/src/core/components/ui/progress/progress.md +63 -0
  173. package/docs/src/core/components/ui/table/table.md +455 -0
  174. package/docs/src/core/components/ui/toast/toast.md +166 -0
  175. package/docs/src/core/components/ui/tooltip/tooltip.md +82 -0
  176. package/docs/src/docs/_core-concept/dataFlow.md +88 -0
  177. package/docs/src/docs/_core-concept/overview.md +57 -0
  178. package/docs/src/docs/_core-concept/subscriber.md +75 -0
  179. package/docs/src/docs/_decorators/ancestor-attribute.md +127 -0
  180. package/docs/src/docs/_decorators/auto-subscribe.md +202 -0
  181. package/docs/src/docs/_decorators/bind.md +167 -0
  182. package/docs/src/docs/_decorators/get.md +162 -0
  183. package/docs/src/docs/_decorators/handle.md +175 -0
  184. package/docs/src/docs/_decorators/on-assign.md +390 -0
  185. package/docs/src/docs/_decorators/patch.md +70 -0
  186. package/docs/src/docs/_decorators/post.md +146 -0
  187. package/docs/src/docs/_decorators/publish.md +55 -0
  188. package/docs/src/docs/_decorators/put.md +70 -0
  189. package/docs/src/docs/_decorators/subscribe.md +100 -0
  190. package/docs/src/docs/_decorators/wait-for-ancestors.md +163 -0
  191. package/docs/src/docs/_directives/sub.md +91 -0
  192. package/docs/src/docs/_getting-started/ai-agents.md +76 -0
  193. package/docs/src/docs/_getting-started/concorde-manual-install.md +133 -0
  194. package/docs/src/docs/_getting-started/concorde-outside.md +33 -0
  195. package/docs/src/docs/_getting-started/create-a-component.md +139 -0
  196. package/docs/src/docs/_getting-started/my-first-component.md +236 -0
  197. package/docs/src/docs/_getting-started/my-first-subscriber.md +120 -0
  198. package/docs/src/docs/_getting-started/pubsub.md +37 -0
  199. package/docs/src/docs/_getting-started/start.md +47 -0
  200. package/docs/src/docs/_getting-started/theming.md +91 -0
  201. package/docs/src/docs/_misc/api-configuration.md +81 -0
  202. package/docs/src/docs/_misc/dataProviderKey.md +168 -0
  203. package/docs/src/docs/_misc/docs-mock-api.md +63 -0
  204. package/docs/src/docs/_misc/dynamic-path.md +71 -0
  205. package/docs/src/docs/_misc/endpoint.md +45 -0
  206. package/docs/src/docs/_misc/formelement-subscriber-removal.md +115 -0
  207. package/docs/src/docs/_misc/html-integration.md +15 -0
  208. package/docs/src/docs/search/docs-search.json +10137 -0
  209. package/docs/src/tag-list.json +1 -0
  210. package/docs/src/tsconfig-model.json +23 -0
  211. package/docs/src/tsconfig.json +1224 -0
  212. package/docs/svg/regular/plane.svg +1 -0
  213. package/docs/svg/solid/plane.svg +1 -0
  214. package/package.json +1 -1
@@ -0,0 +1,87 @@
1
+ # States
2
+
3
+ ### sonic-states displays different states depending on the value of a sub-property of its dataProvider (data-path attribute in dot notation):
4
+ * It loops over its child templates and tests if the regexp contained in the *data-value* attribute matches the value of the property
5
+ * If so, the content of the corresponding template is displayed as a state.
6
+ * If the attribute dataProviderExpression is provided the content is surrounded by a div:
7
+ * The "dataProvider" attribute of this div is the result of calling the replace function on the property value with the regexp and dataproviderExpression as parameters.
8
+ * The subscribers/fetch... of the template will refer to this dataProvider
9
+ * You can also use url-pattern expressions for the route parameters, see the examples
10
+ *
11
+ **Examples**
12
+ * With ma.property= 2 :
13
+ * RegExp data-value = (\d+) and dataproviderExpression = /user/$1 the dataProvider attribute will be "/user/2"
14
+ * url-pattern data-value = :id and dataproviderExpression = /user/:id the dataProvider attribute will be "/user/2
15
+
16
+ ## Basic
17
+
18
+ <sonic-code>
19
+ <template>
20
+ <div class="flex gap-2 items-center" formDataProvider="states-basic-example">
21
+ <sonic-button radio name="selection" value="#home" checked size="xs">Home</sonic-button>
22
+ <sonic-button radio name="selection" value="#about" size="xs">About</sonic-button>
23
+ <sonic-button radio name="selection" value="#work" size="xs">Work</sonic-button>
24
+ <sonic-button radio name="selection" value="#contact" size="xs">Contact</sonic-button>
25
+ </div>
26
+ <div class="text-center text-neutral-700 border rounded text-4xl my-6 p-3 ">
27
+ <sonic-states dataProvider="states-basic-example" data-path="selection">
28
+ <template data-value="#home">Home</template>
29
+ <template data-value="#about">About</template>
30
+ <template data-value="#work">Work</template>
31
+ <template data-value="#contact">Contact</template>
32
+ </sonic-states>
33
+ </div>
34
+ </template>
35
+ </sonic-code>
36
+
37
+ ## Regexp
38
+
39
+ When using **capturing groups ()** the stored values are accessible via the **dataProviderExpression**
40
+ **e.g.**, data-value="#couleur_<b class="text-danger">(\d+)</b>" => dataProviderExpression="api/unknown/<b class="text-danger">$1</b>"
41
+
42
+ <sonic-code>
43
+ <template>
44
+ <div serviceURL="/docs-mock-api">
45
+ <sonic-list formDataProvider="states-regexp-example" fetch dataProvider="api/unknown" key="data" class="flex gap-2 items-center" >
46
+ <template>
47
+ <sonic-button radio size="xs" name="selection" data-bind ::value="#couleur_$id">
48
+ <span data-bind ::inner-html="ucFirst|$name"></span>
49
+ </sonic-button>
50
+ </template>
51
+ </sonic-list>
52
+ <sonic-states dataProvider="states-regexp-example" data-path="selection">
53
+ <template data-value="#couleur_(\d+)" dataProviderExpression="api/unknown/$1">
54
+ <sonic-fetch>
55
+ <input type="color" disabled data-bind ::value="$data.color" class=" w-full h-10 my-3" />
56
+ </sonic-fetch>
57
+ </template>
58
+ </sonic-states>
59
+ </div>
60
+ </template>
61
+ </sonic-code>
62
+
63
+ ## Url-pattern
64
+
65
+ Same as RegExp but using <a href="https://www.npmjs.com/package/url-pattern" target="_blank">url patterns</a>
66
+ **e.g.**, data-value="#couleur_<b class="text-danger">:id</b>" => dataProviderExpression="api/unknown/<b class="text-danger">:id</b>"
67
+
68
+ <sonic-code>
69
+ <template>
70
+ <div serviceURL="/docs-mock-api">
71
+ <sonic-list formDataProvider="states-regexp-example" fetch dataProvider="api/unknown" key="data" class="flex gap-2 items-center" >
72
+ <template>
73
+ <sonic-button radio size="xs" name="selection" data-bind ::value="#couleur_$id">
74
+ <span data-bind ::inner-html="ucFirst|$name"></span>
75
+ </sonic-button>
76
+ </template>
77
+ </sonic-list>
78
+ <sonic-states dataProvider="states-regexp-example" data-path="selection">
79
+ <template data-value="#couleur_:id" dataProviderExpression="api/unknown/:id">
80
+ <sonic-fetch>
81
+ <input type="color" disabled data-bind ::value="$data.color" class=" w-full h-10 my-3" />
82
+ </sonic-fetch>
83
+ </template>
84
+ </sonic-states>
85
+ </div>
86
+ </template>
87
+ </sonic-code>
@@ -0,0 +1,114 @@
1
+ # Submit
2
+
3
+ > **Live demos:** `<docs-lit-demo>` + `src/docs/example/docs-submit-demos.ts`. Use [Local API demos](#docs/_misc/docs-mock-api.md/docs-mock-api) (`serviceURL="/docs-mock-api"`).
4
+
5
+ ## Overview
6
+
7
+ **sonic-submit** sends the **formDataProvider** publisher to a REST endpoint (same configuration model as [fetch](#core/components/functional/fetch/fetch.md/fetch): `serviceURL` on an ancestor, path via `dataProvider` or `endPoint`).
8
+
9
+ | Trigger | Attribute |
10
+ |---------|-----------|
11
+ | Click inside the slot | `onClick` |
12
+ | Enter in a focused field inside the slot | `onEnterKey` |
13
+
14
+ | Data / API | Attribute / property | Notes |
15
+ |------------|----------------------|--------|
16
+ | Form fields | `formDataProvider` on ancestor | Filled by `sonic-input`, `sonic-select`, etc. via `name` |
17
+ | Result after call | `submitResultDataProvider` on ancestor | Whole result object (after optional `submit-result-key`) |
18
+ | Slice of JSON result | `submit-result-key` on **sonic-submit** | Dot path, e.g. `data` when the API returns `{ data: { … } }` |
19
+ | HTTP verb | `method` on **sonic-submit** | `post` (default), `put`, `patch`, `delete`, `get` — not inherited from `sonic-scope` |
20
+ | Path override | `endPoint` on **sonic-submit** | Wins over ancestor `dataProvider` |
21
+ | JSON vs multipart | `sendAsFormData` on **sonic-submit** | `FormData` body, still expects JSON response |
22
+ | Reset publishers | `clearedDataOnSuccess` on ancestor | Space-separated `DataProviderKey.path` values; runs when a **result object** is returned (including error payloads with `messages`) |
23
+ | Browser form POST | `native` on **sonic-submit** | See [Native HTML form](#native-html-form) |
24
+ | Result event | — | Bubbles `submit` `CustomEvent` with `detail` = result |
25
+ | Credential Management API | `usernameKey`, `passwordKey` on **sonic-submit** | After a **successful** HTTP response, stores login if those keys exist in the payload (defaults: `username`, `password`) |
26
+ | ALTCHA / captcha | `needsCaptchaValidation` on form/header publisher | Defers send until token is set — see [Captcha](#core/components/ui/captcha/captcha.md/captcha) |
27
+
28
+ While a REST submit runs, the slot is wrapped with `data-disabled` (faded, no pointer events). With **`native`**, validation and loader still run, then the browser performs a normal form submission.
29
+
30
+ ## Form and result handling
31
+
32
+ POST to mock `api/register`; result publisher `submit-example-result`.
33
+
34
+ <docs-lit-demo for="docs-submit-demo"></docs-lit-demo>
35
+
36
+ ## Native HTML form
37
+
38
+ With **`native`**, Concorde does **not** call `fetch`. After form validation it:
39
+
40
+ 1. Copies **formDataProvider** values into matching `<input>` / `<select>` / `<textarea>` inside the closest **`<form>`** (creates hidden inputs if needed).
41
+ 2. Programmatically clicks a hidden native `type="submit"` control (`name` / `value` on **sonic-submit** if you need them).
42
+
43
+ Use a real `<form action="…" method="post">` ancestor. For SPAs, a named **`target`** (e.g. iframe) avoids leaving the doc page.
44
+
45
+ <docs-lit-demo for="docs-submit-native-demo"></docs-lit-demo>
46
+
47
+ ## sendAsFormData
48
+
49
+ Sends fields as **`multipart/form-data`** instead of `application/json` (response is still parsed as JSON).
50
+
51
+ <docs-lit-demo for="docs-submit-formdata-demo"></docs-lit-demo>
52
+
53
+ ## submit-result-key
54
+
55
+ When the API wraps the payload (e.g. `{ data: { id, token } }`), set **`submit-result-key="data"`** on **sonic-submit** so **submitResultDataProvider** receives only the inner object.
56
+
57
+ <docs-lit-demo for="docs-submit-result-key-demo"></docs-lit-demo>
58
+
59
+ Mock endpoint: `POST /docs-mock-api/api/register/nested`.
60
+
61
+ ## clearedDataOnSuccess
62
+
63
+ Lists one or more publisher ids (space-separated). After the API returns a result object, each is set to `{}` — useful to reset the form publisher.
64
+
65
+ <docs-lit-demo for="docs-submit-clear-demo"></docs-lit-demo>
66
+
67
+ ## Custom `submit` event
68
+
69
+ Listen for the bubbling **`submit`** event; **`event.detail`** is the same result written to **submitResultDataProvider** (if configured).
70
+
71
+ <docs-lit-demo for="docs-submit-event-demo"></docs-lit-demo>
72
+
73
+ ## endPoint vs dataProvider
74
+
75
+ Ancestor **`dataProvider`** is the default path; **`endPoint`** on **sonic-submit** overrides it for that button only.
76
+
77
+ <docs-lit-demo for="docs-submit-endpoint-demo"></docs-lit-demo>
78
+
79
+ ## method="get"
80
+
81
+ Appends publisher fields as a query string on the endpoint, then performs a GET. The mock route `api/register/echo` returns the query for inspection.
82
+
83
+ <docs-lit-demo for="docs-submit-get-demo"></docs-lit-demo>
84
+
85
+ ## dot notation (formDataProvider shape)
86
+
87
+ You can use dot notation in **`name`** on form controls; the publisher stores nested objects:
88
+
89
+ <sonic-code>
90
+ <template>
91
+ <sonic-scope formDataProvider="submit-example-dot-notation">
92
+ <div class="grid grid-cols-2 gap-4 mb-4 ">
93
+ <sonic-input required name="email.value" type="email" value="eve.holt@reqres.in"></sonic-input>
94
+ <sonic-input required type="password" name="details.password.value" value="pistol"></sonic-input>
95
+ </div>
96
+ </sonic-scope>
97
+ </template>
98
+ </sonic-code>
99
+
100
+ Stored shape:
101
+
102
+ <sonic-code language="typescript">
103
+ <template>
104
+ {
105
+ email: { value: "eve.holt@reqres.in" },
106
+ details: { password: { value: "pistol" } }
107
+ }
108
+ </template>
109
+ </sonic-code>
110
+
111
+ ## Related
112
+
113
+ - [Captcha](#core/components/ui/captcha/captcha.md/captcha) — submit waits for `captchaToken` when validation is required.
114
+ - [HTML integration](#docs/_misc/html-integration.md/html-integration) — legacy `data-bind` result blocks; prefer **submitResultDataProvider** + `@subscribe` in Lit demos.
@@ -0,0 +1,91 @@
1
+ # Subscriber
2
+
3
+ La mixin Subscriber permet lier un composant à un publisher.
4
+ La liaison à un publisher se fait via l'attribut *dataProvider* du composant qui représente ce que l'on obtient en appellant PublisherManager.get(dataProvider).
5
+
6
+ Les propriétés du composant sont automatiquement remplies avec les propriétés du même nom dans les données du publisher.
7
+
8
+ Le composant est automatiquement mis à jour lorsque les données du publisher sont mises à jour.
9
+
10
+ ## DataProvider
11
+
12
+ **Id** of the dataProvider that the component will **subscribe** to
13
+
14
+ <sonic-code>
15
+ <template>
16
+ <sonic-subscriber dataProvider="id_that_the_subsriber_will_subscribe_to" debug>
17
+ <sonic-button> custom dataProvider id</sonic-button>
18
+ </sonic-subscriber>
19
+ <sonic-subscriber debug>
20
+ <sonic-button> default id : pageHTML</sonic-button>
21
+ </sonic-subscriber>
22
+ </template>
23
+ </sonic-code>
24
+
25
+ ## Props
26
+
27
+ Data object (json) that will be passed to the dataProvider
28
+
29
+ <sonic-code>
30
+ <template>
31
+ <sonic-subscriber props='{"data":"Hello world"}' debug>
32
+ <sonic-button> Hover to see the data</sonic-button>
33
+ </sonic-subscriber>
34
+ </template>
35
+ </sonic-code>
36
+
37
+
38
+ ## Debug
39
+
40
+ **Helper**, display the data held by the dataProvider in a floating div
41
+
42
+ <sonic-code>
43
+ <template>
44
+ <sonic-subscriber debug>
45
+ <sonic-button> see the dataProvider'data </sonic-button>
46
+ </sonic-subscriber>
47
+ </template>
48
+ </sonic-code>
49
+
50
+
51
+ ## NoAutofill
52
+
53
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
54
+
55
+ ## PropertyMap
56
+
57
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
58
+
59
+ Permet de mapper un nom de propriété de donnée source vers une propriété du subscriber à la volée
60
+
61
+ ## BindPublisher
62
+
63
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
64
+
65
+ On peut utiliser cette fonction pour lier un publisher spécifique au composant si besoin.
66
+
67
+ ## instanceCounter
68
+
69
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
70
+
71
+ ## Publisher
72
+
73
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
74
+
75
+ ## Args
76
+
77
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
78
+
79
+ ## NoShadowDom
80
+
81
+ Par défaut on crée un shadow dom mais on peut demander à ne pas en avoir via cette propriété et un attribut associé.
82
+ Cela se fait à l'initialisation uniquement et n'est pas modifiable lors de la vie du composant.
83
+
84
+
85
+ ## Other attributes gathered from subscriber.stories.ts
86
+
87
+ styles ??
88
+ title ??
89
+ _props ??
90
+ onAssign ??
91
+ defferedDebug ??
@@ -0,0 +1,35 @@
1
+ # Value
2
+
3
+ Simply shows a value from a data provider.
4
+ You can target sub data value using dot syntax.
5
+ The value reacts to changes.
6
+
7
+ * Below is a form that helps you to set a value for the field "preference" in the data target with id "value-example"
8
+ <sonic-code>
9
+ <template>
10
+ <div formDataProvider="value-example">
11
+ which one do you prefer ?
12
+ <sonic-radio name="preference" checked value="dogs"> Dogs</sonic-radio>
13
+ <sonic-radio name="preference" value="cats"> Cats</sonic-radio>
14
+ </div>
15
+ </template>
16
+ </sonic-code>
17
+ * Then you can see live value of the preference using this code :
18
+ <sonic-code>
19
+ <template>
20
+ I prefer <sonic-value dataProvider="value-example" key="preference"></sonic-value>
21
+ </template>
22
+ </sonic-code>
23
+ * If you have more complex data like this
24
+ <sonic-code>
25
+ <template>
26
+ <sonic-subscriber dataProvider="value-example-2" props='{"my":{"complex":[{"data":"👋 Hi There"}]}}'></sonic-subscriber>
27
+ </template>
28
+ </sonic-code>
29
+ * You can target it with the dot syntax
30
+ <sonic-code>
31
+ <template>
32
+ <sonic-value dataProvider="value-example-2" key="my.complex.0.data"></sonic-value>
33
+ </template>
34
+ </sonic-code>
35
+
@@ -0,0 +1,177 @@
1
+ # Alert
2
+
3
+ Inline message in the page: title (`label`), body (`text` or default slot), icon from `status`. For HTML or actions, use the slot instead of `label` / `text` (plain text only).
4
+
5
+ Use **`status`**: `default`, `info`, `success`, `warning`, `error`.
6
+
7
+ <sonic-code>
8
+ <template>
9
+ <sonic-alert status="error" label="Email error" text="This address is already in use" background></sonic-alert>
10
+ </template>
11
+ </sonic-code>
12
+
13
+ ## Status
14
+
15
+ Color and icon follow `status`. With no `status`, behavior is `default`.
16
+
17
+ <sonic-code>
18
+ <template>
19
+ <div class="grid gap-4">
20
+ <sonic-alert label="Default">This address is already in use.</sonic-alert>
21
+ <sonic-alert status="success" label="Success">This address is already in use.</sonic-alert>
22
+ <sonic-alert status="error" label="Error">This address is already in use.</sonic-alert>
23
+ <sonic-alert status="warning" label="Warning">This address is already in use.</sonic-alert>
24
+ <sonic-alert status="info" label="Info">This address is already in use.</sonic-alert>
25
+ </div>
26
+ </template>
27
+ </sonic-code>
28
+
29
+ ## Accessibility (`announce`)
30
+
31
+ By default, an alert already in the DOM is **not** announced (no `role` / `aria-live`). Set **`announce`** when the message appears **after** user action (API response, validation, etc.): screen readers get `role="alert"` for `error`, otherwise `role="status"` and `aria-live="polite"`.
32
+
33
+ `sonic-alert-messages` sets `announce` on every rendered alert.
34
+
35
+ <sonic-code>
36
+ <template>
37
+ <sonic-alert announce status="success" label="Saved" text="Your changes were saved."></sonic-alert>
38
+ </template>
39
+ </sonic-code>
40
+
41
+ ## Content and icon
42
+
43
+ `label` and `text` accept plain text only. The default slot is rendered after `text`. Use the **`icon`** slot to replace the default `sonic-icon`. **`noIcon`** hides the icon.
44
+
45
+ <sonic-code>
46
+ <template>
47
+ <sonic-alert status="info" noIcon label="No icon" text="Informational message."></sonic-alert>
48
+ </template>
49
+ </sonic-code>
50
+
51
+ ## Custom icon slot
52
+
53
+ Project any markup into **`slot="icon"`** (emoji, image, custom component). Keep it decorative with `aria-hidden="true"` when the message text already conveys meaning.
54
+
55
+ <sonic-code>
56
+ <template>
57
+ <sonic-alert status="success" label="Achievement unlocked" background>
58
+ <span slot="icon" aria-hidden="true" class="text-lg leading-none">🎉</span>
59
+ You unlocked a new badge.
60
+ </sonic-alert>
61
+ </template>
62
+ </sonic-code>
63
+
64
+ ## Sizes
65
+
66
+ <sonic-code>
67
+ <template>
68
+ <div class="grid gap-4">
69
+ <sonic-alert status="error" label="Email error" size="2xs">
70
+ This address is already in use. Lorem ipsum dolor sit amet.
71
+ </sonic-alert>
72
+ <sonic-alert status="error" label="Email error" size="xs">
73
+ This address is already in use. Lorem ipsum dolor sit amet.
74
+ </sonic-alert>
75
+ <sonic-alert status="error" label="Email error" size="sm">
76
+ This address is already in use. Lorem ipsum dolor sit amet.
77
+ </sonic-alert>
78
+ <sonic-alert status="error" label="Email error">
79
+ This address is already in use. Lorem ipsum dolor sit amet.
80
+ </sonic-alert>
81
+ <sonic-alert status="error" label="Email error" size="lg">
82
+ This address is already in use. Lorem ipsum dolor sit amet.
83
+ </sonic-alert>
84
+ <sonic-alert status="error" label="Email error" size="xl">
85
+ This address is already in use. Lorem ipsum dolor sit amet.
86
+ </sonic-alert>
87
+ <sonic-alert status="error" label="Email error" size="2xl">
88
+ This address is already in use. Lorem ipsum dolor sit amet.
89
+ </sonic-alert>
90
+ </div>
91
+ </template>
92
+ </sonic-code>
93
+
94
+ ## Alert with link
95
+
96
+ Rich content in the slot (buttons, links).
97
+
98
+ <sonic-code>
99
+ <template>
100
+ <sonic-alert status="info" label="New messages !">
101
+ You have 2 unread messages<br />
102
+ <div class="flex gap-2 mt-1">
103
+ <sonic-button variant="outline" type="info" size="xs">See messages</sonic-button>
104
+ <sonic-button variant="ghost" type="info" size="xs">Dismiss</sonic-button>
105
+ </div>
106
+ </sonic-alert>
107
+ </template>
108
+ </sonic-code>
109
+
110
+ ## Background
111
+
112
+ Tinted background from the `status` color (`color-mix` on `currentColor`).
113
+
114
+ <sonic-code>
115
+ <template>
116
+ <div class="grid gap-4">
117
+ <sonic-alert background label="Lorem ipsum dolor">This address is already in use.</sonic-alert>
118
+ <sonic-alert status="success" background label="Lorem ipsum dolor">
119
+ This address is already in use.
120
+ </sonic-alert>
121
+ <sonic-alert status="error" background label="Lorem ipsum dolor">
122
+ This address is already in use.
123
+ </sonic-alert>
124
+ <sonic-alert status="warning" background label="Lorem ipsum dolor">
125
+ This address is already in use.
126
+ </sonic-alert>
127
+ <sonic-alert status="info" background label="Lorem ipsum dolor">
128
+ This address is already in use.
129
+ </sonic-alert>
130
+ </div>
131
+ </template>
132
+ </sonic-code>
133
+
134
+ ## Dismissible
135
+
136
+ `dismissible` removes the alert from the DOM when the close control is clicked (i18n aria label). **`dismissible`** and **`background`** are independent: without `background`, close sits at the end of the row; with `background`, top-right.
137
+
138
+ <sonic-code>
139
+ <template>
140
+ <sonic-alert status="info" class="mb-3" dismissible label="This address is already in use.">
141
+ </sonic-alert>
142
+ <sonic-alert class="mb-3" dismissible background label="Lorem ipsum dolor">
143
+ This address is already in use.
144
+ </sonic-alert>
145
+ <sonic-alert status="success" class="mb-3" dismissible background label="Lorem ipsum dolor">
146
+ This address is already in use.
147
+ </sonic-alert>
148
+ <sonic-alert status="error" class="mb-3" dismissible background label="Lorem ipsum dolor">
149
+ This address is already in use.
150
+ </sonic-alert>
151
+ <sonic-alert status="warning" class="mb-3" dismissible background label="Lorem ipsum dolor">
152
+ This address is already in use.
153
+ </sonic-alert>
154
+ <sonic-alert status="info" class="mb-3" dismissible background label="Lorem ipsum dolor">
155
+ This address is already in use.
156
+ </sonic-alert>
157
+ </template>
158
+ </sonic-code>
159
+
160
+ ## Dismiss forever
161
+
162
+ With **`dismissForever`**, dismissal is stored in `localStorage` (key `sonic-alert-dismissed`). A stable **`id`** on the element is **required**; without `id`, a warning is logged and nothing is persisted.
163
+
164
+ <sonic-code>
165
+ <template>
166
+ <sonic-alert
167
+ class="mb-3"
168
+ dismissible
169
+ background
170
+ dismissForever
171
+ label="Lorem ipsum dolor"
172
+ id="addressUniqueId"
173
+ >
174
+ This address is already in use.
175
+ </sonic-alert>
176
+ </template>
177
+ </sonic-code>