@supersoniks/concorde 5.0.4 → 5.0.5

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 (208) hide show
  1. package/.agents/skills/concorde-component-docs/SKILL.md +194 -0
  2. package/.agents/skills/concorde-component-docs/template.md +45 -0
  3. package/ai/cursor/rules/concorde-theme.mdc +1 -1
  4. package/ai/cursor/rules/concorde.mdc +1 -1
  5. package/ai/skills/concorde/SKILL.md +1 -1
  6. package/ai/skills/concorde-theme/SKILL.md +21 -10
  7. package/build-infos.json +1 -1
  8. package/concorde-core.bundle.js +528 -534
  9. package/concorde-core.es.js +4257 -4212
  10. package/dist/concorde-core.bundle.js +528 -534
  11. package/dist/concorde-core.es.js +4257 -4212
  12. package/dist/docs-mock-api-sw.js +2 -0
  13. package/dist/docs-mock-api-sw.js.map +2 -2
  14. package/docs/assets/index-CD4WyL6o.css +1 -0
  15. package/docs/assets/{index-D8MVWqY6.js → index-wVZpLVYW.js} +1221 -1350
  16. package/docs/crawl/core/components/ui/alert/alert.html +172 -71
  17. package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +113 -5
  18. package/docs/crawl/core/components/ui/badge/badge.html +157 -79
  19. package/docs/crawl/core/components/ui/button/button.html +1 -0
  20. package/docs/crawl/core/components/ui/captcha/captcha.html +90 -8
  21. package/docs/crawl/core/components/ui/card/card.html +222 -68
  22. package/docs/crawl/core/components/ui/divider/divider.html +117 -31
  23. package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +232 -101
  24. package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +95 -52
  25. package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +97 -38
  26. package/docs/crawl/core/components/ui/form/input/input.html +3 -3
  27. package/docs/crawl/core/components/ui/form/textarea/textarea.html +3 -3
  28. package/docs/crawl/core/components/ui/group/group.html +60 -38
  29. package/docs/crawl/core/components/ui/icon/icon.html +136 -47
  30. package/docs/crawl/core/components/ui/image/image.html +244 -56
  31. package/docs/crawl/core/components/ui/link/link.html +67 -9
  32. package/docs/crawl/core/components/ui/loader/loader.html +97 -23
  33. package/docs/crawl/core/components/ui/menu/menu.html +162 -90
  34. package/docs/crawl/core/components/ui/modal/modal.html +275 -50
  35. package/docs/crawl/core/components/ui/pop/pop.html +260 -66
  36. package/docs/crawl/core/components/ui/progress/progress.html +103 -30
  37. package/docs/crawl/core/components/ui/table/table.html +303 -171
  38. package/docs/crawl/core/components/ui/theme/theme.html +131 -0
  39. package/docs/crawl/core/components/ui/toast/toast.html +170 -59
  40. package/docs/crawl/core/components/ui/tooltip/tooltip.html +90 -29
  41. package/docs/crawl/docs/_decorators/ancestor-attribute.html +3 -2
  42. package/docs/crawl/docs/_getting-started/concorde-outside.html +3 -3
  43. package/docs/crawl/docs/_getting-started/start.html +1 -1
  44. package/docs/crawl/docs/_getting-started/theming.html +311 -63
  45. package/docs/crawl/hubs/form-components.html +75 -53
  46. package/docs/crawl/index.html +7 -6
  47. package/docs/docs-mock-api-sw.js +2 -0
  48. package/docs/docs-mock-api-sw.js.map +2 -2
  49. package/docs/index.html +9 -7
  50. package/docs/llms-full.txt +1703 -456
  51. package/docs/llms.txt +25 -32
  52. package/docs/sitemap.xml +3 -0
  53. package/docs/src/core/components/functional/fetch/fetch.md +0 -0
  54. package/docs/src/core/components/functional/if/if.md +0 -0
  55. package/docs/src/core/components/functional/list/list.md +0 -0
  56. package/docs/src/core/components/functional/router/router.md +0 -0
  57. package/docs/src/core/components/functional/sdui/sdui.md +0 -0
  58. package/docs/src/core/components/functional/states/states.md +0 -0
  59. package/docs/src/core/components/functional/submit/submit.md +0 -0
  60. package/docs/src/core/components/ui/alert/alert.md +147 -72
  61. package/docs/src/core/components/ui/alert-messages/alert-messages.md +85 -0
  62. package/docs/src/core/components/ui/badge/badge.md +141 -80
  63. package/docs/src/core/components/ui/button/button.md +1 -0
  64. package/docs/src/core/components/ui/captcha/captcha.md +65 -6
  65. package/docs/src/core/components/ui/card/card.md +183 -65
  66. package/docs/src/core/components/ui/divider/divider.md +107 -13
  67. package/docs/src/core/components/ui/form/fieldset/fieldset.md +175 -99
  68. package/docs/src/core/components/ui/form/form-actions/form-actions.md +75 -52
  69. package/docs/src/core/components/ui/form/form-layout/form-layout.md +109 -34
  70. package/docs/src/core/components/ui/form/input/input.md +1 -1
  71. package/docs/src/core/components/ui/form/radio/radio.md +0 -0
  72. package/docs/src/core/components/ui/form/select/select.md +0 -0
  73. package/docs/src/core/components/ui/form/switch/switch.md +0 -0
  74. package/docs/src/core/components/ui/form/textarea/textarea.md +1 -1
  75. package/docs/src/core/components/ui/group/group.md +36 -36
  76. package/docs/src/core/components/ui/icon/icon.md +132 -43
  77. package/docs/src/core/components/ui/image/image.md +179 -53
  78. package/docs/src/core/components/ui/link/link.md +45 -7
  79. package/docs/src/core/components/ui/loader/loader.md +79 -22
  80. package/docs/src/core/components/ui/menu/menu.md +133 -92
  81. package/docs/src/core/components/ui/modal/modal.md +163 -47
  82. package/docs/src/core/components/ui/pop/pop.md +262 -64
  83. package/docs/src/core/components/ui/progress/progress.md +76 -30
  84. package/docs/src/core/components/ui/table/table.md +147 -171
  85. package/docs/src/core/components/ui/theme/theme.md +122 -0
  86. package/docs/src/core/components/ui/toast/toast.md +108 -58
  87. package/docs/src/core/components/ui/tooltip/tooltip.md +68 -26
  88. package/docs/src/docs/_core-concept/subscriber.md +0 -0
  89. package/docs/src/docs/_decorators/ancestor-attribute.md +3 -2
  90. package/docs/src/docs/_getting-started/concorde-outside.md +3 -3
  91. package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -0
  92. package/docs/src/docs/_getting-started/pubsub.md +0 -0
  93. package/docs/src/docs/_getting-started/start.md +1 -1
  94. package/docs/src/docs/_getting-started/theming.md +223 -61
  95. package/docs/src/docs/search/docs-search.json +3083 -348
  96. package/docs/src/tsconfig.json +63 -3
  97. package/gitlab/job_tests.sh +0 -0
  98. package/index.html +4 -2
  99. package/package.json +7 -1
  100. package/public/docs-mock-api-sw.js +2 -0
  101. package/public/docs-mock-api-sw.js.map +2 -2
  102. package/scripts/post-build-docs.js +0 -0
  103. package/scripts/post-build.mjs +0 -0
  104. package/src/core/components/functional/fetch/fetch.md +0 -0
  105. package/src/core/components/functional/if/if.md +0 -0
  106. package/src/core/components/functional/list/list.demo.ts +0 -0
  107. package/src/core/components/functional/list/list.md +0 -0
  108. package/src/core/components/functional/router/router.md +0 -0
  109. package/src/core/components/functional/router/router.ts +0 -0
  110. package/src/core/components/functional/sdui/sdui.md +0 -0
  111. package/src/core/components/functional/states/states.md +0 -0
  112. package/src/core/components/functional/submit/submit.md +0 -0
  113. package/src/core/components/functional/subscriber/subscriber.ts +0 -0
  114. package/src/core/components/ui/_css/align.ts +1 -0
  115. package/src/core/components/ui/_css/size.ts +0 -0
  116. package/src/core/components/ui/_css/type.ts +86 -8
  117. package/src/core/components/ui/_i18n/ui-aria-labels.ts +8 -0
  118. package/src/core/components/ui/alert/alert.md +21 -2
  119. package/src/core/components/ui/alert-messages/alert-messages.md +85 -0
  120. package/src/core/components/ui/badge/badge.md +19 -6
  121. package/src/core/components/ui/badge/badge.ts +8 -9
  122. package/src/core/components/ui/button/button.ts +5 -15
  123. package/src/core/components/ui/captcha/altchaStyles.ts +0 -0
  124. package/src/core/components/ui/captcha/captcha.md +65 -6
  125. package/src/core/components/ui/card/card.md +73 -10
  126. package/src/core/components/ui/card/card.ts +24 -22
  127. package/src/core/components/ui/divider/divider.md +107 -13
  128. package/src/core/components/ui/divider/divider.ts +40 -33
  129. package/src/core/components/ui/form/fieldset/fieldset.md +175 -99
  130. package/src/core/components/ui/form/fieldset/fieldset.ts +15 -28
  131. package/src/core/components/ui/form/fieldset/legend.ts +13 -13
  132. package/src/core/components/ui/form/form-actions/form-actions.md +75 -52
  133. package/src/core/components/ui/form/form-actions/form-actions.ts +7 -5
  134. package/src/core/components/ui/form/form-layout/form-layout.md +109 -34
  135. package/src/core/components/ui/form/form-layout/form-layout.ts +27 -24
  136. package/src/core/components/ui/form/radio/radio.md +0 -0
  137. package/src/core/components/ui/form/select/select.md +0 -0
  138. package/src/core/components/ui/form/switch/switch.md +0 -0
  139. package/src/core/components/ui/form/textarea/textarea.ts +4 -3
  140. package/src/core/components/ui/group/group.md +36 -36
  141. package/src/core/components/ui/group/group.ts +5 -10
  142. package/src/core/components/ui/icon/icon.md +132 -43
  143. package/src/core/components/ui/image/image.md +35 -3
  144. package/src/core/components/ui/link/link.md +43 -5
  145. package/src/core/components/ui/loader/loader.md +79 -22
  146. package/src/core/components/ui/loader/loader.ts +67 -27
  147. package/src/core/components/ui/loader/styles/fixed.ts +6 -11
  148. package/src/core/components/ui/menu/menu.md +133 -92
  149. package/src/core/components/ui/menu/menu.ts +53 -58
  150. package/src/core/components/ui/modal/modal.md +163 -47
  151. package/src/core/components/ui/modal/modal.ts +2 -4
  152. package/src/core/components/ui/pop/pop.md +217 -123
  153. package/src/core/components/ui/pop/pop.ts +0 -1
  154. package/src/core/components/ui/progress/progress.md +76 -30
  155. package/src/core/components/ui/progress/progress.ts +25 -56
  156. package/src/core/components/ui/table/table-caption.ts +2 -2
  157. package/src/core/components/ui/table/table-tbody.ts +3 -3
  158. package/src/core/components/ui/table/table-td.ts +23 -18
  159. package/src/core/components/ui/table/table-th.ts +8 -8
  160. package/src/core/components/ui/table/table-tr.ts +4 -4
  161. package/src/core/components/ui/table/table.md +147 -171
  162. package/src/core/components/ui/table/table.ts +20 -19
  163. package/src/core/components/ui/theme/theme-collection/auto.ts +15 -0
  164. package/src/core/components/ui/theme/theme-collection/core-variables.ts +8 -31
  165. package/src/core/components/ui/theme/theme-collection/dark.ts +1 -7
  166. package/src/core/components/ui/theme/theme-collection/light.ts +30 -26
  167. package/src/core/components/ui/theme/theme.md +122 -0
  168. package/src/core/components/ui/theme/theme.ts +30 -7
  169. package/src/core/components/ui/toast/toast-item.ts +6 -9
  170. package/src/core/components/ui/toast/toast.md +108 -58
  171. package/src/core/components/ui/toast/types.ts +1 -1
  172. package/src/core/components/ui/tooltip/tooltip.md +68 -26
  173. package/src/core/mixins/Subscriber.ts +0 -0
  174. package/src/core/utils/DataBindObserver.ts +0 -0
  175. package/src/core/utils/Objects.ts +0 -0
  176. package/src/core/utils/route.ts +0 -0
  177. package/src/docs/_core-concept/subscriber.md +0 -0
  178. package/src/docs/_getting-started/my-first-subscriber.md +0 -0
  179. package/src/docs/_getting-started/pubsub.md +0 -0
  180. package/src/docs/_getting-started/start.md +1 -1
  181. package/src/docs/_getting-started/theming.md +223 -61
  182. package/src/docs/code.ts +125 -58
  183. package/src/docs/example/users.ts +0 -0
  184. package/src/docs/header/header.ts +62 -54
  185. package/src/docs/mock-api/router.ts +2 -0
  186. package/src/docs/navigation/navigation.ts +6 -3
  187. package/src/docs/search/docs-search.json +2504 -399
  188. package/src/docs/search/markdown-renderer.ts +6 -6
  189. package/src/docs/search/page.ts +0 -0
  190. package/src/docs/search/search.ts +4 -4
  191. package/src/docs/tailwind/css/tailwind.css +6 -5
  192. package/src/tsconfig.json +18 -0
  193. package/src/tsconfig.tsbuildinfo +1 -1
  194. package/tailwind.config.js +19 -0
  195. package/.github/workflows/ci.yml +0 -21
  196. package/.github-export-ignore +0 -30
  197. package/CONTRIBUTING.md +0 -59
  198. package/DEV.md +0 -54
  199. package/LICENSE +0 -21
  200. package/OPEN_SOURCE_CHECKPOINT.md +0 -133
  201. package/docs/assets/index-DiD0qYvE.css +0 -1
  202. package/docs/src/tsconfig.declarations.json +0 -22
  203. package/docs/src/tsconfig.emit.json +0 -23
  204. package/gitlab/job_github_mirror.sh +0 -39
  205. package/scripts/github-export.mjs +0 -150
  206. package/src/css.d.ts +0 -19
  207. package/src/tsconfig.declarations.json +0 -22
  208. package/src/tsconfig.emit.json +0 -23
@@ -11,19 +11,18 @@ export class Fieldset extends Subscriber(LitElement) {
11
11
  static styles = [
12
12
  css`
13
13
  :host {
14
- --sc-fieldset-mt: 0;
15
- --sc-fieldset-mb: 1rem;
16
- --sc-fieldset-border-color: var(--sc-border-color);
17
- --sc-fieldset-border-width: var(--sc-form-border-width);
18
- --sc-fieldset-px: 1.25rem;
19
- --sc-fieldset-py: 1.8rem;
14
+ --sc-_mt: 0;
15
+ --sc-_mb: 1rem;
16
+ --sc-_border-color: var(--sc-border-color);
17
+ --sc-_border-width: var(--sc-form-border-width);
18
+ --sc-_px: 1.25rem;
19
+ --sc-_py: 1.8rem;
20
20
 
21
- margin-top: var(--sc-fieldset-mt);
22
- margin-bottom: var(--sc-fieldset-mb);
21
+ margin-top: var(--sc-_mt);
22
+ margin-bottom: var(--sc-_mb);
23
23
  display: block;
24
- border: var(--sc-fieldset-border-width) solid
25
- var(--sc-fieldset-border-color) !important;
26
- padding: var(--sc-fieldset-py) var(--sc-fieldset-px);
24
+ border: var(--sc-_border-width) solid var(--sc-_border-color) !important;
25
+ padding: var(--sc-_py) var(--sc-_px);
27
26
  border-radius: var(--sc-rounded-lg);
28
27
  }
29
28
 
@@ -34,15 +33,14 @@ export class Fieldset extends Subscriber(LitElement) {
34
33
 
35
34
  :host([variant="shadow"]),
36
35
  :host([variant="ghost"]) {
37
- --sc-fieldset-border-color: transparent;
36
+ --sc-_border-color: transparent;
38
37
  }
39
38
  :host([variant="shadow"]) {
40
- --sc-fieldset-border-color: transparent;
41
39
  box-shadow: var(--sc-shadow-lg);
42
40
  }
43
41
 
44
42
  :host([tight]) {
45
- --sc-fieldset-px: 0;
43
+ --sc-_px: 0;
46
44
  border-left: none !important;
47
45
  border-right: none !important;
48
46
  border-radius: 0;
@@ -61,15 +59,7 @@ export class Fieldset extends Subscriber(LitElement) {
61
59
  `,
62
60
  ];
63
61
 
64
- // @property({ type: String }) label: String = "";
65
-
66
- /**
67
- * Désactiver le fieldset
68
- */
69
- @property({ type: Boolean, reflect: true }) disabled: true | false = false;
70
- /**
71
- * Lier à un formulaire qui ne serait pas parent du fieldset
72
- */
62
+ @property({ type: Boolean, reflect: true }) disabled = false;
73
63
  @property({ type: String }) form?: string;
74
64
 
75
65
  @property({ type: String }) label?: string;
@@ -86,12 +76,9 @@ export class Fieldset extends Subscriber(LitElement) {
86
76
  | "shadow" = "default";
87
77
 
88
78
  render() {
89
- return html`<fieldset
90
- form="${ifDefined(this.form)}"
91
- ?disabled="${this.disabled}"
92
- >
79
+ return html`<fieldset form="${ifDefined(this.form)}" ?disabled="${this.disabled}">
93
80
  ${this.label
94
- ? html` <sonic-legend
81
+ ? html`<sonic-legend
95
82
  label=${ifDefined(this.label)}
96
83
  description=${ifDefined(this.description)}
97
84
  iconName=${ifDefined(this.iconName)}
@@ -11,15 +11,15 @@ export class Legend extends LitElement {
11
11
  static styles = [
12
12
  css`
13
13
  :host {
14
- --sc-legend-font-size: 1.25rem;
15
- --sc-legend-font-weight: var(--sc-font-weight-base, 400);
16
- --sc-legend-font-style: var(--sc-headings-font-style, normal);
17
- --sc-legend-family: var(
14
+ --sc-_font-size: 1.25rem;
15
+ --sc-_font-weight: var(--sc-font-weight-base, 400);
16
+ --sc-_font-style: var(--sc-headings-font-style, normal);
17
+ --sc-_font-family: var(
18
18
  --sc-headings-font-family,
19
19
  var(--sc-font-family-base, sans-serif)
20
20
  );
21
- --sc-legend-line-height: var(--sc-headings-line-height, 1.1);
22
- --sc-legend-color: var(--sc-base-content, #000);
21
+ --sc-_line-height: var(--sc-headings-line-height, 1.1);
22
+ --sc-_color: var(--sc-base-content, #000);
23
23
  display: flex;
24
24
  width: 100%;
25
25
  container-type: inline-size;
@@ -27,16 +27,16 @@ export class Legend extends LitElement {
27
27
 
28
28
  @container (max-inline-size: 28rem) {
29
29
  legend {
30
- --sc-legend-font-size: 1.3rem;
30
+ --sc-_font-size: 1.3rem;
31
31
  }
32
32
  }
33
33
  legend {
34
- font-size: var(--sc-legend-font-size);
35
- font-weight: var(--sc-legend-font-weight);
36
- font-style: var(--sc-legend-font-style);
37
- font-family: var(--sc-legend-font-family);
38
- line-height: var(--sc-legend-line-height);
39
- color: var(--sc-legend-color);
34
+ font-size: var(--sc-_font-size);
35
+ font-weight: var(--sc-_font-weight);
36
+ font-style: var(--sc-_font-style);
37
+ font-family: var(--sc-_font-family);
38
+ line-height: var(--sc-_line-height);
39
+ color: var(--sc-_color);
40
40
  padding: 0;
41
41
  display: flex;
42
42
  width: 100%;
@@ -1,77 +1,100 @@
1
- # Form-actions
1
+ # Form actions
2
2
 
3
- ## Left by default
3
+ **`sonic-form-actions`** lays out submit / cancel and other **form footer controls** in a **wrapping flex row** with a small fixed gap. Place it inside **`sonic-form-layout`** (full-width row) or any block that should end with actions. Defaults: **`direction`** `row` · **`justify`** `flex-start` · **`alignItems`** `center`.
4
+
5
+ ## Basic example
6
+
7
+ With no attributes, actions align to the **start** of the row (typical for left-to-right forms).
4
8
 
5
9
  <sonic-code>
6
10
  <template>
7
- <form>
8
- <sonic-form-layout>
9
- <sonic-input label="First name"></sonic-input>
10
- <sonic-input label="Last name"></sonic-input>
11
- <sonic-form-actions>
12
- <sonic-button type="success"><sonic-icon name="check" library="iconoir"></sonic-icon> Submit</sonic-button>
13
- <sonic-button type="danger" variant="ghost"><sonic-icon name="undo" library="iconoir"></sonic-icon> Cancel</sonic-button>
14
- </sonic-form-actions>
15
- </sonic-form-layout>
16
- </form >
11
+ <form>
12
+ <sonic-form-layout>
13
+ <sonic-input label="First name"></sonic-input>
14
+ <sonic-input label="Last name"></sonic-input>
15
+ <sonic-form-actions>
16
+ <sonic-button type="success"><sonic-icon name="check" library="iconoir"></sonic-icon> Submit</sonic-button>
17
+ <sonic-button type="danger" variant="ghost"><sonic-icon name="undo" library="iconoir"></sonic-icon> Cancel</sonic-button>
18
+ </sonic-form-actions>
19
+ </sonic-form-layout>
20
+ </form>
17
21
  </template>
18
22
  </sonic-code>
19
23
 
20
- ## Justify
24
+ ## Justify content
25
+
26
+ **`justify`** maps to CSS **`justify-content`**. Use **`flex-end`** for dialog-style footers or **`center`** for balanced toolbars.
21
27
 
22
28
  <sonic-code>
23
29
  <template>
24
- <form>
25
- <sonic-form-layout>
26
- <sonic-input label="First name"></sonic-input>
27
- <sonic-input label="Last name"></sonic-input>
28
- <sonic-form-actions justify="flex-end">
29
- <sonic-button type="success"><sonic-icon name="check" library="iconoir"></sonic-icon> Submit</sonic-button>
30
- <sonic-button type="danger" variant="ghost"><sonic-icon name="undo" library="iconoir"></sonic-icon> Cancel</sonic-button>
31
- </sonic-form-actions>
32
- </sonic-form-layout>
33
- </form >
30
+ <form>
31
+ <sonic-form-layout>
32
+ <sonic-input label="First name"></sonic-input>
33
+ <sonic-input label="Last name"></sonic-input>
34
+ <sonic-form-actions justify="flex-end">
35
+ <sonic-button type="success"><sonic-icon name="check" library="iconoir"></sonic-icon> Submit</sonic-button>
36
+ <sonic-button type="danger" variant="ghost"><sonic-icon name="undo" library="iconoir"></sonic-icon> Cancel</sonic-button>
37
+ </sonic-form-actions>
38
+ </sonic-form-layout>
39
+ </form>
34
40
  </template>
35
41
  </sonic-code>
36
42
 
37
- ## Direction
43
+ ## Flex direction
44
+
45
+ **`direction`** maps to **`flex-direction`**. **`row-reverse`** swaps visual order while keeping DOM order (focus order unchanged).
38
46
 
39
47
  <sonic-code>
40
48
  <template>
41
- <form>
42
- <sonic-form-layout>
43
- <sonic-input label="First name"></sonic-input>
44
- <sonic-input label="Last name"></sonic-input>
45
- <sonic-form-actions direction="row-reverse">
46
- <sonic-button type="success"><sonic-icon name="check" library="iconoir"></sonic-icon> Submit</sonic-button>
47
- <sonic-button type="danger" variant="ghost"><sonic-icon name="undo" library="iconoir"></sonic-icon> Cancel</sonic-button>
48
- </sonic-form-actions>
49
- </sonic-form-layout>
50
- </form >
49
+ <form>
50
+ <sonic-form-layout>
51
+ <sonic-input label="First name"></sonic-input>
52
+ <sonic-input label="Last name"></sonic-input>
53
+ <sonic-form-actions direction="row-reverse">
54
+ <sonic-button type="success"><sonic-icon name="check" library="iconoir"></sonic-icon> Submit</sonic-button>
55
+ <sonic-button type="danger" variant="ghost"><sonic-icon name="undo" library="iconoir"></sonic-icon> Cancel</sonic-button>
56
+ </sonic-form-actions>
57
+ </sonic-form-layout>
58
+ </form>
51
59
  </template>
52
60
  </sonic-code>
53
61
 
54
- ## Center
62
+ ## Mixed controls
63
+
64
+ Combine **`sonic-button`** with **`sonic-divider vertical`** or other slotted content. Default **`alignItems`** `center` keeps unlike heights aligned on the cross axis.
55
65
 
56
66
  <sonic-code>
57
67
  <template>
58
- <form>
59
- <sonic-form-layout>
60
- <sonic-input label="First name"></sonic-input>
61
- <sonic-input label="Last name"></sonic-input>
62
- <sonic-form-actions justify="center" >
63
- <sonic-button type="info" minWidth="12rem">
64
- <sonic-icon name="nav-arrow-left" library="iconoir" slot="prefix"></sonic-icon>
65
- Left seats
66
- </sonic-button>
67
- <sonic-divider vertical></sonic-divider>
68
- <sonic-button type="info" minWidth="12rem">
69
- <sonic-icon name="nav-arrow-right" library="iconoir" slot="suffix"></sonic-icon>
70
- Right seats
71
- </sonic-button>
72
- </sonic-form-actions>
73
- </sonic-form-layout>
74
- </form >
68
+ <form>
69
+ <sonic-form-layout>
70
+ <sonic-input label="First name"></sonic-input>
71
+ <sonic-input label="Last name"></sonic-input>
72
+ <sonic-form-actions justify="center">
73
+ <sonic-button type="info" minWidth="12rem">
74
+ <sonic-icon name="nav-arrow-left" library="iconoir" slot="prefix"></sonic-icon>
75
+ Left seats
76
+ </sonic-button>
77
+ <sonic-divider vertical></sonic-divider>
78
+ <sonic-button type="info" minWidth="12rem">
79
+ <sonic-icon name="nav-arrow-right" library="iconoir" slot="suffix"></sonic-icon>
80
+ Right seats
81
+ </sonic-button>
82
+ </sonic-form-actions>
83
+ </sonic-form-layout>
84
+ </form>
75
85
  </template>
76
86
  </sonic-code>
77
87
 
88
+ ## API reference
89
+
90
+ | Attribute | Values | Description |
91
+ |----------|---------|-------------|
92
+ | `direction` | `row` (default) · `column` · `row-reverse` · `column-reverse` | Main-axis layout of slotted controls |
93
+ | `justify` | CSS justify-content (default `flex-start`) | Distribution along the main axis |
94
+ | `alignItems` | CSS align-items (default `center`) | Cross-axis alignment when items differ in height |
95
+
96
+ The component exposes a single unnamed slot; there are no named slots. Slotted nodes use the host’s flex **`gap`** (`0.3rem`) and **`flex-wrap`**.
97
+
98
+ | Slot | Description |
99
+ |------|-------------|
100
+ | *(default)* | Footer actions (**`sonic-button`** and related controls) |
@@ -1,6 +1,6 @@
1
- import {html, LitElement, css} from "lit";
2
- import {customElement, property} from "lit/decorators.js";
3
- import {styleMap} from "lit/directives/style-map.js";
1
+ import { html, LitElement, css } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { styleMap } from "lit/directives/style-map.js";
4
4
 
5
5
  const tagName = "sonic-form-actions";
6
6
 
@@ -19,13 +19,15 @@ export class FormActions extends LitElement {
19
19
  `,
20
20
  ];
21
21
 
22
- @property({type: String}) direction = "row";
23
- @property({type: String}) justify = "flex-start";
22
+ @property({ type: String }) direction = "row";
23
+ @property({ type: String }) justify = "flex-start";
24
+ @property({ type: String }) alignItems = "center";
24
25
 
25
26
  render() {
26
27
  const styles = {
27
28
  flexDirection: this.direction,
28
29
  justifyContent: this.justify,
30
+ alignItems: this.alignItems,
29
31
  };
30
32
  return html`<slot style=${styleMap(styles)}></slot>`;
31
33
  }
@@ -1,44 +1,119 @@
1
- # Form-layout
1
+ # Form layout
2
+
3
+ **`sonic-form-layout`** arranges slotted form controls in a **responsive CSS grid** with consistent vertical spacing. Pair **`sonic-input`** · **`sonic-select`** and **`sonic-input-autocomplete`** fields side by side when the host is wider than **440px**; **textareas**, **toggles**, **dividers**, and **`sonic-form-actions`** span the full width. Wrap a **`form`** or **`sonic-fieldset`** body—no attributes are required.
4
+
5
+ ## Basic example
6
+
7
+ Typical registration-style form: short fields flow in two columns on wide layouts; long or grouped blocks stay full width.
8
+
9
+ <sonic-code>
10
+ <template>
11
+ <form>
12
+ <sonic-form-layout>
13
+ <sonic-input autocomplete="family-name" label="Last name" name="last_name"></sonic-input>
14
+ <sonic-input autocomplete="given-name" label="First name" name="first_name"></sonic-input>
15
+ <sonic-select autocomplete="sex" label="Gender" name="gender">
16
+ <option value="" selected="selected">— Select —</option>
17
+ <option value="prefer-not">Prefer not to say</option>
18
+ <option value="male">Male</option>
19
+ <option value="female">Female</option>
20
+ </sonic-select>
21
+ <sonic-input autocomplete="bday" label="Date of birth" name="birth_date" type="date"></sonic-input>
22
+ <sonic-divider></sonic-divider>
23
+ <sonic-input autocomplete="email" label="Email" name="email" type="email"></sonic-input>
24
+ <sonic-input
25
+ autocomplete="email"
26
+ label="Confirm email"
27
+ name="email_confirmation"
28
+ type="email"
29
+ ></sonic-input>
30
+ <sonic-input autocomplete="new-password" label="Password" name="password" type="password"></sonic-input>
31
+ <sonic-input
32
+ autocomplete="new-password"
33
+ label="Confirm password"
34
+ name="password_confirmation"
35
+ type="password"
36
+ ></sonic-input>
37
+ <sonic-divider></sonic-divider>
38
+ <sonic-textarea label="Message" rows="5"></sonic-textarea>
39
+ <sonic-switch>Enable optional feature</sonic-switch>
40
+ <sonic-checkbox>Subscribe to newsletter</sonic-checkbox>
41
+ <sonic-checkbox>
42
+ I accept the
43
+ <sonic-link href="#" class="underline">terms and conditions</sonic-link>
44
+ </sonic-checkbox>
45
+ <sonic-form-actions>
46
+ <sonic-button type="success">Submit</sonic-button>
47
+ </sonic-form-actions>
48
+ </sonic-form-layout>
49
+ </form>
50
+ </template>
51
+ </sonic-code>
52
+
53
+ ## Responsive columns
54
+
55
+ When the host **`offsetWidth`** is **greater than 440px**, the grid uses **two equal columns** with slightly larger gap (**1.75rem**). Below that breakpoint, fields stack in a **single column** (**1.5rem** gap).
56
+
57
+ If the slot contains **exactly one** direct **`sonic-input`**, **`sonic-select`**, or **`sonic-input-autocomplete`**, the layout stays **one column** even above the breakpoint so a lone field does not sit in half an empty row.
58
+
59
+ <sonic-code>
60
+ <template>
61
+ <div class="grid gap-8 md:grid-cols-2 mb-6">
62
+ <div>
63
+ <sonic-form-layout style="max-width: 20rem">
64
+ <sonic-divider align="left">Narrow host (single column)</sonic-divider>
65
+ <sonic-input label="Email" name="email_narrow" type="email"></sonic-input>
66
+ <sonic-input label="Confirm email" name="email_confirm_narrow" type="email"></sonic-input>
67
+ </sonic-form-layout>
68
+ </div>
69
+ </div>
70
+ <div>
71
+ <sonic-form-layout>
72
+ <sonic-divider align="left">Wide host (two columns for inputs)</sonic-divider>
73
+ <sonic-input label="Email" name="email_wide" type="email"></sonic-input>
74
+ <sonic-input label="Confirm email" name="email_confirm_wide" type="email"></sonic-input>
75
+ </sonic-form-layout>
76
+ </div>
77
+ </template>
78
+ </sonic-code>
79
+
80
+ ## Full-width slotted blocks
81
+
82
+ Everything except **`sonic-input`**, **`sonic-select`**, **`sonic-input-autocomplete`**, and slotted elements with class **`form-item-container`** is assigned **`grid-column: 1 / -1`**. Use this for **`sonic-textarea`**, **`sonic-checkbox`**, **`sonic-switch`**, **`sonic-form-actions`**, **`sonic-divider`**, and similar blocks.
83
+
84
+ Slotted **`sonic-divider`** sets **`--sc-divider-my: 0`** so divider spacing matches the grid rhythm. Slotted **`sonic-submit`** uses **`display: contents`** so submit controls participate in the grid without an extra wrapper box.
2
85
 
3
86
  <sonic-code>
4
87
  <template>
5
- <form>
6
88
  <sonic-form-layout>
7
- <sonic-input autocomplete="family-name" label="Nom" name="nom"></sonic-input>
8
- <sonic-input autocomplete="given-name" label="Prénom" name="prenom"></sonic-input>
9
- <sonic-select autocomplete="sex" label="Sexe" name="sexe">
10
- <option value="" selected="selected">- Sélectionner -</option>
11
- <option value="-">Je préfère ne pas le dire</option>
12
- <option value="Homme">Homme</option>
13
- <option value="Femme">Femme</option>
14
- </sonic-select>
15
- <sonic-input autocomplete="bday" label="Date de naissance" name="date_naissance" type="date"></sonic-input>
16
- <sonic-divider></sonic-divider>
17
- <sonic-input autocomplete="email" label="e-mail" name="email" type="email"></sonic-input>
18
- <sonic-input
19
- autocomplete="email"
20
- label="Confirmer votre e-mail"
21
- name="email_confirmation"
22
- type="email"
23
- ></sonic-input>
24
- <sonic-input autocomplete="new-password" label="Mot de passe" name="password" type="password"></sonic-input>
25
- <sonic-input
26
- autocomplete="new-password"
27
- label="Confirmer votre mot de passe"
28
- name="password_confirmation"
29
- type="password"
30
- ></sonic-input>
31
- <sonic-divider></sonic-divider>
32
- <sonic-textarea label="Message" rows="5">
33
- </sonic-textarea>
34
- <sonic-switch>Activer une superbe option</sonic-switch>
35
- <sonic-checkbox>Inscription à la newsletter</sonic-checkbox>
36
- <sonic-checkbox>J'ai lu et accepte les <sonic-link href="#" class="underline">Conditions générales de ventes</sonic-link></sonic-checkbox>
89
+ <sonic-input label="Subject" name="subject"></sonic-input>
90
+ <sonic-textarea label="Details" rows="4"></sonic-textarea>
37
91
  <sonic-form-actions>
38
- <sonic-button type="success">Valider</sonic-button>
92
+ <sonic-button type="primary">Send</sonic-button>
39
93
  </sonic-form-actions>
40
94
  </sonic-form-layout>
41
- </form >
42
95
  </template>
43
96
  </sonic-code>
44
97
 
98
+ ## Custom column wrapper
99
+
100
+ Add class **`form-item-container`** on a slotted wrapper (for example a **`div`**) when a field is not a direct **`sonic-input`** / **`sonic-select`** / **`sonic-input-autocomplete`** but should still share the two-column flow with short inputs.
101
+
102
+ <sonic-code>
103
+ <template>
104
+ <sonic-form-layout>
105
+ <sonic-input label="City" name="city"></sonic-input>
106
+ <div class="form-item-container">
107
+ <sonic-input label="Postal code" name="postal_code"></sonic-input>
108
+ </div>
109
+ </sonic-form-layout>
110
+ </template>
111
+ </sonic-code>
112
+
113
+ ## API reference
114
+
115
+ No public attributes — layout follows slotted children and host width.
116
+
117
+ | Slot | Description |
118
+ |------|-------------|
119
+ | *(default)* | Form fields and blocks in visual order; column vs full-width rules apply per slotted tag or **`form-item-container`** class |
@@ -1,14 +1,12 @@
1
- import {html, LitElement, css} from "lit";
2
- import {customElement, property, queryAssignedElements} from "lit/decorators.js";
3
- import {ResizeController} from "@lit-labs/observers/resize-controller.js";
4
- import {classMap} from "lit/directives/class-map.js";
5
-
6
- import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
1
+ import { html, LitElement, css } from "lit";
2
+ import { customElement, state, queryAssignedElements } from "lit/decorators.js";
3
+ import { ResizeController } from "@lit-labs/observers/resize-controller.js";
4
+ import { classMap } from "lit/directives/class-map.js";
7
5
 
8
6
  const tagName = "sonic-form-layout";
9
7
 
10
8
  @customElement(tagName)
11
- export class FormLayout extends Subscriber(LitElement) {
9
+ export class FormLayout extends LitElement {
12
10
  static styles = [
13
11
  css`
14
12
  :host {
@@ -17,52 +15,57 @@ export class FormLayout extends Subscriber(LitElement) {
17
15
 
18
16
  div {
19
17
  display: grid;
20
- grid-gap: 1.5rem;
18
+ grid-gap: 1.25rem;
21
19
  align-items: flex-start;
22
20
  }
23
21
 
24
22
  .cq--md {
25
- grid-gap: 1.75rem;
23
+ grid-gap: 1.35rem;
26
24
  grid-template-columns: repeat(2, minmax(0, 1fr));
27
25
  }
28
26
  .one-form-element {
29
27
  grid-template-columns: 1fr;
30
28
  }
31
- /*::slotted(sonic-radio),
32
- ::slotted(sonic-checkbox),
33
- ::slotted(sonic-form-actions),
34
- ::slotted(sonic-divider),
35
- ::slotted(sonic-textarea) {
36
- grid-column: 1 / -1;
37
- }*/
38
29
  ::slotted(sonic-submit) {
39
30
  display: contents;
40
31
  }
41
- ::slotted(:not(sonic-input):not(sonic-select):not(sonic-input-autocomplete):not(.form-item-container)) {
32
+ ::slotted(
33
+ :not(sonic-input):not(sonic-select):not(sonic-input-autocomplete):not(
34
+ .form-item-container
35
+ )
36
+ ) {
42
37
  grid-column: 1 / -1;
43
38
  }
44
39
 
45
40
  ::slotted(sonic-divider) {
46
- --sc-divider-my: 0;
41
+ margin-top: 0;
42
+ margin-bottom: 0;
47
43
  }
48
44
  `,
49
45
  ];
50
46
  _resizeController = new ResizeController(this, {});
51
47
 
52
- @queryAssignedElements({flatten: true}) slottedElements!: HTMLElement[];
53
- @property({type: Boolean}) oneFormElement = false;
48
+ @queryAssignedElements({ flatten: true }) slottedElements!: HTMLElement[];
49
+ @state() _oneFormElement = false;
54
50
 
55
51
  onSlotChange() {
56
52
  let elements = this.slottedElements;
57
- const formElementColumns = ["sonic-input", "sonic-select", "sonic-input-autocomplete", ".form-item-container"];
53
+ const formElementColumns = [
54
+ "sonic-input",
55
+ "sonic-select",
56
+ "sonic-input-autocomplete",
57
+ ".form-item-container",
58
+ ];
58
59
  // keep only form elements
59
- elements = elements.filter((elt) => formElementColumns.includes(elt.nodeName.toLowerCase()));
60
- this.oneFormElement = elements.length == 1;
60
+ elements = elements.filter((elt) =>
61
+ formElementColumns.includes(elt.nodeName.toLowerCase()),
62
+ );
63
+ this._oneFormElement = elements.length == 1;
61
64
  }
62
65
  render() {
63
66
  const classes = {
64
67
  "cq--md": this.offsetWidth > 440,
65
- "one-form-element": this.oneFormElement,
68
+ "one-form-element": this._oneFormElement,
66
69
  };
67
70
  return html`<div class=${classMap(classes)}>
68
71
  <slot @slotchange=${this.onSlotChange}></slot>
File without changes
File without changes
File without changes
@@ -84,7 +84,7 @@ export class Textarea extends FormInput(FormElement(LitElement)) {
84
84
 
85
85
  validateFormElement() {
86
86
  const textarea: HTMLTextAreaElement = this.shadowRoot?.querySelector(
87
- "textarea"
87
+ "textarea",
88
88
  ) as HTMLTextAreaElement;
89
89
  if (!textarea || textarea.checkValidity()) return;
90
90
  const formPublisher = this.getFormPublisher();
@@ -103,7 +103,7 @@ export class Textarea extends FormInput(FormElement(LitElement)) {
103
103
  <label
104
104
  for="${this.id || "form-element"}"
105
105
  class="${this.hasLabel ? "form-label" : "hidden"}"
106
- >${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot
106
+ >${this.label ? unsafeHTML(this.label) : ""}<slot
107
107
  name="label"
108
108
  @slotchange=${this.hasSlotOrProps}
109
109
  ></slot
@@ -115,6 +115,8 @@ export class Textarea extends FormInput(FormElement(LitElement)) {
115
115
  id="${this.id || "form-element"}"
116
116
  @input=${this.handleChange}
117
117
  @blur=${this.handleBlur}
118
+ .name=${this.name}
119
+ .value=${this.value}
118
120
  ?disabled=${this.disabled}
119
121
  ?required=${this.required}
120
122
  ?autofocus=${this.autofocus}
@@ -123,7 +125,6 @@ export class Textarea extends FormInput(FormElement(LitElement)) {
123
125
  maxlength=${ifDefined(this.maxlength)}
124
126
  minlength=${ifDefined(this.minlength)}
125
127
  ?readonly=${this.readonly}
126
- spellcheck=${ifDefined(this.spellcheck)}
127
128
  autocomplete=${ifDefined(this.autocomplete)}
128
129
  tabindex=${ifDefined(this.tabindex)}
129
130
  wrap=${ifDefined(this.wrap)}