@supersoniks/concorde 1.1.42 → 1.1.44

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 (189) hide show
  1. package/components.js +2 -3
  2. package/concorde-core.bundle.js +37 -35
  3. package/concorde-core.es.js +5283 -4453
  4. package/core/_types/types.d.ts +31 -0
  5. package/core/_types/types.js +2 -0
  6. package/core/components/functional/date/date.d.ts +13 -5
  7. package/core/components/functional/date/date.js +57 -38
  8. package/core/components/functional/example/example.d.ts +1 -1
  9. package/core/components/functional/example/example.js +1 -1
  10. package/core/components/functional/fetch/fetch.d.ts +45 -6
  11. package/core/components/functional/fetch/fetch.js +2 -6
  12. package/core/components/functional/functional.d.ts +2 -0
  13. package/core/components/functional/functional.js +2 -0
  14. package/core/components/functional/if/if.d.ts +3 -0
  15. package/core/components/functional/if/if.js +6 -12
  16. package/core/components/functional/if/if.test.d.ts +1 -0
  17. package/core/components/functional/if/if.test.js +44 -0
  18. package/core/components/functional/list/list.d.ts +44 -12
  19. package/core/components/functional/list/list.js +54 -49
  20. package/core/components/functional/mix/mix.d.ts +22 -0
  21. package/core/components/functional/mix/mix.js +102 -0
  22. package/core/components/functional/queue/queue.d.ts +27 -5
  23. package/core/components/functional/queue/queue.js +88 -26
  24. package/core/components/functional/router/redirect.d.ts +11 -2
  25. package/core/components/functional/router/redirect.js +7 -12
  26. package/core/components/functional/router/router.d.ts +15 -1
  27. package/core/components/functional/router/router.js +11 -16
  28. package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +1 -2
  29. package/core/components/functional/sdui/SDUIDescriptorTransformer.js +56 -45
  30. package/core/components/functional/sdui/default-library.json +108 -0
  31. package/core/components/functional/sdui/sdui-utils.d.ts +5 -0
  32. package/core/components/functional/sdui/sdui-utils.js +63 -0
  33. package/core/components/functional/sdui/sdui.d.ts +21 -13
  34. package/core/components/functional/sdui/sdui.js +70 -44
  35. package/core/components/functional/sdui/types.d.ts +10 -8
  36. package/core/components/functional/states/states.d.ts +20 -4
  37. package/core/components/functional/states/states.js +15 -20
  38. package/core/components/functional/submit/submit.d.ts +16 -1
  39. package/core/components/functional/submit/submit.js +95 -25
  40. package/core/components/functional/subscriber/subscriber.d.ts +4 -1
  41. package/core/components/functional/subscriber/subscriber.js +1 -6
  42. package/core/components/functional/value/value.d.ts +7 -0
  43. package/core/components/functional/value/value.js +26 -0
  44. package/core/components/ui/_css/scroll.js +6 -7
  45. package/core/components/ui/_css/size.d.ts +1 -0
  46. package/core/components/ui/_css/size.js +3 -1
  47. package/core/components/ui/alert/alert.d.ts +2 -2
  48. package/core/components/ui/alert/alert.js +11 -16
  49. package/core/components/ui/badge/badge.d.ts +3 -1
  50. package/core/components/ui/badge/badge.js +36 -22
  51. package/core/components/ui/button/button.d.ts +28 -23
  52. package/core/components/ui/button/button.js +60 -43
  53. package/core/components/ui/captcha/captcha.d.ts +14 -2
  54. package/core/components/ui/captcha/captcha.js +18 -13
  55. package/core/components/ui/card/card-footer.js +1 -8
  56. package/core/components/ui/card/card-header-descripton.js +3 -9
  57. package/core/components/ui/card/card-header.js +6 -7
  58. package/core/components/ui/card/card-main.js +0 -5
  59. package/core/components/ui/card/card.d.ts +1 -1
  60. package/core/components/ui/card/card.js +30 -12
  61. package/core/components/ui/divider/divider.d.ts +2 -0
  62. package/core/components/ui/divider/divider.js +43 -16
  63. package/core/components/ui/form/checkbox/checkbox.d.ts +86 -25
  64. package/core/components/ui/form/checkbox/checkbox.js +53 -28
  65. package/core/components/ui/form/css/form-control.d.ts +2 -0
  66. package/core/components/ui/form/css/form-control.js +145 -67
  67. package/core/components/ui/form/fieldset/fieldset.d.ts +8 -1
  68. package/core/components/ui/form/fieldset/fieldset.js +45 -8
  69. package/core/components/ui/form/fieldset/legend-description.js +0 -5
  70. package/core/components/ui/form/fieldset/legend.js +3 -6
  71. package/core/components/ui/form/form-actions/form-actions.d.ts +2 -0
  72. package/core/components/ui/form/form-actions/form-actions.js +26 -11
  73. package/core/components/ui/form/form-layout/form-layout.d.ts +5 -2
  74. package/core/components/ui/form/form-layout/form-layout.js +31 -9
  75. package/core/components/ui/form/input/input.d.ts +26 -24
  76. package/core/components/ui/form/input/input.js +87 -52
  77. package/core/components/ui/form/input/password-helper.d.ts +1 -1
  78. package/core/components/ui/form/input/password-helper.js +4 -3
  79. package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
  80. package/core/components/ui/form/input/same-value-helper.js +3 -2
  81. package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +2 -3
  82. package/core/components/ui/form/input-autocomplete/input-autocomplete.js +2 -6
  83. package/core/components/ui/form/radio/radio.d.ts +6 -0
  84. package/core/components/ui/form/radio/radio.js +7 -12
  85. package/core/components/ui/form/select/select.d.ts +25 -8
  86. package/core/components/ui/form/select/select.js +72 -41
  87. package/core/components/ui/form/textarea/textarea.d.ts +21 -19
  88. package/core/components/ui/form/textarea/textarea.js +29 -36
  89. package/core/components/ui/group/group.d.ts +11 -1
  90. package/core/components/ui/group/group.js +79 -17
  91. package/core/components/ui/icon/icon.d.ts +10 -3
  92. package/core/components/ui/icon/icon.js +16 -15
  93. package/core/components/ui/icon/icons.js +25 -20
  94. package/core/components/ui/icon/icons.json +1 -1
  95. package/core/components/ui/image/image.js +0 -5
  96. package/core/components/ui/link/link.d.ts +1 -1
  97. package/core/components/ui/link/link.js +2 -6
  98. package/core/components/ui/loader/loader.d.ts +1 -1
  99. package/core/components/ui/loader/loader.js +3 -9
  100. package/core/components/ui/menu/menu-item.js +4 -9
  101. package/core/components/ui/menu/menu.d.ts +9 -1
  102. package/core/components/ui/menu/menu.js +182 -27
  103. package/core/components/ui/modal/modal-actions.js +1 -6
  104. package/core/components/ui/modal/modal-close.d.ts +1 -0
  105. package/core/components/ui/modal/modal-close.js +14 -10
  106. package/core/components/ui/modal/modal-content.js +0 -5
  107. package/core/components/ui/modal/modal-subtitle.js +2 -6
  108. package/core/components/ui/modal/modal-title.js +0 -5
  109. package/core/components/ui/modal/modal.d.ts +7 -7
  110. package/core/components/ui/modal/modal.js +37 -37
  111. package/core/components/ui/pop/pop.d.ts +6 -5
  112. package/core/components/ui/pop/pop.js +57 -57
  113. package/core/components/ui/progress/progress.js +34 -32
  114. package/core/components/ui/table/table-caption.js +5 -10
  115. package/core/components/ui/table/table-tbody.js +10 -14
  116. package/core/components/ui/table/table-td.d.ts +2 -0
  117. package/core/components/ui/table/table-td.js +8 -5
  118. package/core/components/ui/table/table-tfoot.js +5 -7
  119. package/core/components/ui/table/table-th.d.ts +2 -0
  120. package/core/components/ui/table/table-th.js +12 -9
  121. package/core/components/ui/table/table-thead.js +1 -6
  122. package/core/components/ui/table/table-tr.js +4 -6
  123. package/core/components/ui/table/table.d.ts +0 -3
  124. package/core/components/ui/table/table.js +14 -31
  125. package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
  126. package/core/components/ui/theme/theme-collection/dark.js +1 -1
  127. package/core/components/ui/theme/theme.d.ts +1 -6
  128. package/core/components/ui/theme/theme.js +19 -46
  129. package/core/components/ui/toast/message-subscriber.d.ts +16 -7
  130. package/core/components/ui/toast/message-subscriber.js +10 -8
  131. package/core/components/ui/toast/toast-item.js +1 -1
  132. package/core/components/ui/toast/toast.d.ts +3 -2
  133. package/core/components/ui/toast/toast.js +33 -19
  134. package/core/components/ui/toast/types.d.ts +3 -2
  135. package/core/components/ui/tooltip/tooltip.d.ts +1 -0
  136. package/core/components/ui/tooltip/tooltip.js +36 -15
  137. package/core/components/ui/ui.d.ts +1 -1
  138. package/core/components/ui/ui.js +1 -4
  139. package/core/core.js +5 -6
  140. package/core/mixins/Fetcher.d.ts +20 -13
  141. package/core/mixins/Fetcher.js +44 -19
  142. package/core/mixins/FormCheckable.d.ts +25 -13
  143. package/core/mixins/FormCheckable.js +180 -23
  144. package/core/mixins/FormElement.d.ts +17 -9
  145. package/core/mixins/FormElement.js +56 -39
  146. package/core/mixins/FormInput.d.ts +22 -12
  147. package/core/mixins/FormInput.js +4 -3
  148. package/core/mixins/Subscriber.d.ts +12 -8
  149. package/core/mixins/Subscriber.js +51 -48
  150. package/core/mixins/TemplatesContainer.d.ts +2 -1
  151. package/core/mixins/TemplatesContainer.js +2 -2
  152. package/core/utils/Arrays.d.ts +15 -15
  153. package/core/utils/Arrays.js +12 -9
  154. package/core/utils/DataBindObserver.d.ts +18 -11
  155. package/core/utils/DataBindObserver.js +47 -54
  156. package/core/utils/Electron.d.ts +5 -1
  157. package/core/utils/Electron.js +4 -2
  158. package/core/utils/HTML.d.ts +9 -2
  159. package/core/utils/HTML.js +24 -5
  160. package/core/utils/LocationHandler.d.ts +6 -5
  161. package/core/utils/LocationHandler.js +27 -16
  162. package/core/utils/Objects.d.ts +7 -4
  163. package/core/utils/Objects.js +37 -9
  164. package/core/utils/{PublisherProxy.d.mts → PublisherProxy.d.ts} +49 -34
  165. package/core/utils/{PublisherProxy.mjs → PublisherProxy.js} +107 -77
  166. package/core/utils/Utils.d.ts +3 -0
  167. package/core/utils/Utils.js +18 -0
  168. package/core/utils/api.d.ts +26 -9
  169. package/core/utils/api.js +62 -45
  170. package/img/concorde-logo.svg +1 -0
  171. package/img/concorde.png +0 -0
  172. package/img/concorde_def.png +0 -0
  173. package/mixins.d.ts +53 -29
  174. package/mixins.js +3 -4
  175. package/package.json +51 -12
  176. package/svg/regular/plane.svg +1 -0
  177. package/svg/solid/plane.svg +1 -0
  178. package/test-utils/TestUtils.d.ts +4 -0
  179. package/test-utils/TestUtils.js +12 -0
  180. package/utils.d.ts +3 -1
  181. package/utils.js +7 -5
  182. package/core/components/functional/configuration/configuration.d.ts +0 -5
  183. package/core/components/functional/configuration/configuration.js +0 -22
  184. package/core/components/ui/tabs/tab.d.ts +0 -6
  185. package/core/components/ui/tabs/tab.js +0 -46
  186. package/core/components/ui/tabs/tabs.d.ts +0 -15
  187. package/core/components/ui/tabs/tabs.js +0 -129
  188. package/core/components/ui/taxonomy/taxonomy.d.ts +0 -41
  189. package/core/components/ui/taxonomy/taxonomy.js +0 -115
@@ -1,35 +1,51 @@
1
1
  import { css } from "lit";
2
+ export const label = css `
3
+ :host {
4
+ --sc-label-fs: var(--sc-fs, 1rem);
5
+ --sc-label-fw: var(--sc-label-font-weight);
6
+ }
7
+ label {
8
+ font-size: var(--sc-label-fs);
9
+ font-weight: var(--sc-label-fw);
10
+ line-height: 1.2;
11
+ }
12
+ .form-label {
13
+ margin-bottom: 0.22em;
14
+ display: block;
15
+ }
16
+ `;
17
+ export const description = css `
18
+ .form-description {
19
+ color: var(--sc-base-400);
20
+ font-size: 0.85em;
21
+ margin-top: 0.2em;
22
+ display: block;
23
+ }
24
+ `;
2
25
  export const formControl = css `
3
-
4
26
  * {
5
27
  box-sizing: border-box;
6
28
  }
7
29
 
8
30
  :host {
9
31
  --sc-input-height: var(--sc-form-height);
10
- --sc-input-border-width: var(--sc-form-border-width);
11
- --sc-input-color: var(--sc-base-content);
32
+ --sc-input-c: var(--sc-input-color, var(--sc-base-content));
33
+ --sc-input-b-width: var(--sc-form-border-width);
34
+ --sc-input-b-color: var(--sc-input-border-color);
12
35
 
13
36
  --sc-item-rounded-tr: var(--sc-input-rounded);
14
37
  --sc-item-rounded-tl: var(--sc-input-rounded);
15
38
  --sc-item-rounded-bl: var(--sc-input-rounded);
16
39
  --sc-item-rounded-br: var(--sc-input-rounded);
17
40
 
18
- --sc-input-fs: var(--sc-fs, 1rem) ;
41
+ --sc-input-fs: var(--sc-fs, 1rem);
19
42
  --sc-input-ff: inherit;
20
- --sc-input-py: 0.6em;
21
- --sc-input-px: 1.15em;
22
-
23
- --sc-input-prefix-color: var(--sc-input-color);
24
- --sc-input-prefix-bg: var(--sc-input-bg);
25
- --sc-input-prefix-border-color: var(--sc-input-border-color);
26
-
27
- --sc-input-suffix-color: var(--sc-input-color);
28
- --sc-input-suffix-bg: var(--sc-input-bg);
29
- --sc-input-suffix-border-color: var(--sc-input-border-color);
43
+ --sc-input-py: 0.55em;
44
+ --sc-input-px: clamp(0.3em, 8%, 1.1em);
30
45
 
31
- --sc-label-fs: var(--sc-fs, 1rem);
32
- --sc-label-fw: var(--sc-label-font-weight);
46
+ --sc-input-background: var(--sc-input-bg);
47
+ --sc-input-addon-c: var(--sc-input-addon-color, var(--sc-base));
48
+ --sc-input-addon-bg: var(--sc-input-c);
33
49
  }
34
50
 
35
51
  .form-element {
@@ -38,13 +54,13 @@ export const formControl = css `
38
54
  width: 100%;
39
55
 
40
56
  line-height: 1.1;
41
- color: var(--sc-input-color);
57
+ color: var(--sc-input-c);
42
58
  border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br)
43
59
  var(--sc-item-rounded-bl);
44
60
 
45
61
  font-family: var(--sc-input-ff);
46
- background-color: var(--sc-input-bg, var(--sc-base, #fff));
47
- border: var(--sc-input-border-width) solid var(--sc-input-border-color, var(--sc-base-300, #aaa));
62
+ background-color: var(--sc-input-background);
63
+ border: var(--sc-input-b-width) solid var(--sc-input-b-color, var(--sc-base-300, #aaa));
48
64
  width: 100%;
49
65
  font-size: var(--sc-input-fs);
50
66
 
@@ -56,12 +72,6 @@ export const formControl = css `
56
72
  min-height: var(--sc-input-height);
57
73
  }
58
74
 
59
- label {
60
- font-size: var(--sc-label-fs);
61
- font-weight: var(--sc-label-fw);
62
- line-height: 1.2;
63
- }
64
-
65
75
  .form-control {
66
76
  display: flex;
67
77
  width: 100%;
@@ -77,24 +87,24 @@ export const formControl = css `
77
87
  justify-content: center;
78
88
  line-height: 1.1;
79
89
  flex-shrink: 0;
80
- padding-left: calc(-1 * var(--sc-input-px));
81
- padding-right: calc(-1 * var(--sc-input-px));
90
+ padding-left: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px)));
91
+ padding-right: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px)));
82
92
  }
83
93
 
84
94
  :host(:not([inlineContent])) slot[name="prefix"] {
85
95
  border-radius: var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl);
86
- background-color: var(--sc-input-prefix-bg);
87
- color: var(--sc-input-prefix-color);
88
- border: var(--sc-input-border-width) solid var(--sc-input-prefix-border-color);
89
- margin-right: calc(-1 * var(--sc-input-border-width));
96
+ background-color: var(--sc-input-addon-bg);
97
+ color: var(--sc-input-addon-c);
98
+ /*margin-right: calc(-1 * var(--sc-input-b-width));
99
+ border: none;*/
90
100
  }
91
101
 
92
102
  :host(:not([inlineContent])) slot[name="suffix"] {
93
103
  border-radius: 0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0;
94
- background-color: var(--sc-input-suffix-bg);
95
- color: var(--sc-input-suffix-color);
96
- border: var(--sc-input-border-width) solid var(--sc-input-suffix-border-color);
97
- margin-left: calc(-1 * var(--sc-input-border-width));
104
+ background-color: var(--sc-input-addon-bg);
105
+ color: var(--sc-input-addon-c);
106
+ /*margin-left: calc(-1 * var(--sc-input-b-width));
107
+ border: none;*/
98
108
  }
99
109
 
100
110
  :host(:not([inlineContent])) .has-prefix .form-element {
@@ -107,20 +117,62 @@ export const formControl = css `
107
117
  border-bottom-right-radius: 0;
108
118
  }
109
119
 
120
+ slot[name="suffix"]::slotted(sonic-icon),
121
+ slot[name="prefix"]::slotted(sonic-icon) {
122
+ font-size: 1.2em;
123
+ }
124
+
110
125
  /*InlineCONTENT */
111
- :host([inlineContent]) {
112
- --sc-input-py: 0;
126
+
127
+ .form-element > slot,
128
+ .form-element .form-element {
129
+ all: unset;
113
130
  }
131
+
114
132
  :host([inlineContent]) .form-element {
115
133
  display: flex;
116
- flex-wrap: wrap;
117
134
  align-items: center;
118
135
  gap: 0.35em;
119
136
  min-height: var(--sc-form-height);
120
137
  }
121
138
 
139
+ :host([inlineContent]) .form-element .form-element {
140
+ appearance: none;
141
+ background: transparent;
142
+ border: none;
143
+ padding: 0;
144
+ display: block;
145
+ width: 50%;
146
+ min-width: 0;
147
+ flex: 1 1 auto;
148
+ height: auto;
149
+ min-height: auto;
150
+ border-radius: 0;
151
+ }
152
+ :host([inlineContent]) slot[name="prefix"]::slotted(*),
153
+ :host([inlineContent]) slot[name="suffix"]::slotted(*) {
154
+ display: block;
155
+ flex: 0 0 auto;
156
+ max-width: 100%;
157
+ max-width: 100%;
158
+ }
159
+
160
+ :host([inlineContent]) .has-suffix slot[name="suffix"] {
161
+ margin-right: calc(-0.5 * var(--sc-input-px));
162
+ }
163
+ :host([inlineContent]) .has-prefix slot[name="prefix"] {
164
+ margin-left: calc(-0.5 * var(--sc-input-px));
165
+ }
166
+
167
+ :host([inlineContent]) slot[name="suffix"]::slotted(*) {
168
+ margin-left: auto;
169
+ }
170
+
171
+ /* :host([inlineContent]) .input {
172
+
173
+ }*/
122
174
  /*Disabled */
123
- :host([disabled]) .form-element-container {
175
+ :host([disabled]) .form-control {
124
176
  cursor: not-allowed;
125
177
  }
126
178
 
@@ -131,9 +183,12 @@ export const formControl = css `
131
183
  /*Disbaled*/
132
184
  :host([disabled]) .form-element {
133
185
  pointer-events: none;
134
- background-color: var(--sc-base-100);
135
- border-color: transparent;
136
- color: var(--sc-base-400);
186
+ opacity: 0.5;
187
+ /* border-color: transparent;*/
188
+ }
189
+ :host([disabled]) .select-chevron {
190
+ display: none;
191
+ /* border-color: transparent;*/
137
192
  }
138
193
 
139
194
  /*PLACEHOLDER*/
@@ -142,8 +197,12 @@ export const formControl = css `
142
197
  opacity: 0.45;
143
198
  }
144
199
 
200
+ :host([placehoderAsLabel]) ::placeholder {
201
+ opacity: 1;
202
+ }
203
+
145
204
  :focus::placeholder {
146
- opacity: 0;
205
+ opacity: 0 !important;
147
206
  }
148
207
 
149
208
  /*HOVER*/
@@ -166,11 +225,6 @@ export const formControl = css `
166
225
  display: block;
167
226
  }
168
227
 
169
- .form-element > slot,
170
- .form-element .form-element {
171
- all: unset !important;
172
- }
173
-
174
228
  /*Utilitaires*/
175
229
  .hidden {
176
230
  display: none;
@@ -179,33 +233,32 @@ export const formControl = css `
179
233
  display: contents;
180
234
  }
181
235
 
182
-
183
236
  /*ERROR*/
184
237
  :host([error]) {
185
- --sc-input-border-color: var(--sc-danger);
238
+ --sc-input-b-color: var(--sc-danger);
186
239
  }
187
240
 
188
- :host input:visited{
189
- display:none;
241
+ :host input:visited {
242
+ display: none;
190
243
  }
191
244
 
192
245
  :host([touched][required]) :not(:focus):invalid {
193
- --sc-input-border-color: var(--sc-danger);
194
- --sc-input-color: var(--sc-danger);
246
+ --sc-input-b-color: var(--sc-danger);
247
+ --sc-input-c: var(--sc-danger);
195
248
  }
196
249
 
197
- :host([touched][required]) :not(:focus):invalid + .select-chevron{
198
- --sc-input-color: var(--sc-danger);
250
+ :host([touched][required]) :not(:focus):invalid + .select-chevron {
251
+ --sc-input-c: var(--sc-danger);
199
252
  }
200
253
 
201
254
  /*VALID*/
202
255
  :host([touched][required]) :not([value=""]):not(:focus):valid {
203
- --sc-input-border-color: var(--sc-success);
204
- --sc-input-color: var(--sc-success);
256
+ --sc-input-b-color: var(--sc-success);
257
+ --sc-input-c: var(--sc-success);
205
258
  }
206
259
 
207
- :host([touched][required]) :not(:focus):valid + .select-chevron{
208
- --sc-input-color: var(--sc-success);
260
+ :host([touched][required]) :not(:focus):valid + .select-chevron {
261
+ --sc-input-c: var(--sc-success);
209
262
  }
210
263
 
211
264
  /*Input COLOR*/
@@ -220,13 +273,13 @@ export const formControl = css `
220
273
  input[type="color"]::-webkit-color-swatch {
221
274
  border: none;
222
275
  border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br)
223
- var(--sc-item-rounded-bl);
276
+ var(--sc-item-rounded-bl);
224
277
  }
225
278
 
226
279
  /*Input Image*/
227
280
  :host([type="image"]) .form-element {
228
281
  padding: 0;
229
- border:none;
282
+ border: none;
230
283
  }
231
284
 
232
285
  /*Input reset & image*/
@@ -236,14 +289,39 @@ export const formControl = css `
236
289
  }
237
290
 
238
291
  /*Input search*/
292
+ :host([type="search"]) {
293
+ appearance: none !important;
294
+ }
295
+
239
296
  input[type="search"]::-webkit-search-cancel-button {
240
- appearance:none;
241
- cursor:pointer;
242
- height: .65em;
243
- width: .65em;
297
+ appearance: none;
298
+ cursor: pointer;
299
+ height: 0.65em;
300
+ width: 0.65em;
244
301
  background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE2LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgd2lkdGg9IjEyMy4wNXB4IiBoZWlnaHQ9IjEyMy4wNXB4IiB2aWV3Qm94PSIwIDAgMTIzLjA1IDEyMy4wNSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTIzLjA1IDEyMy4wNTsiDQoJIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZD0iTTEyMS4zMjUsMTAuOTI1bC04LjUtOC4zOTljLTIuMy0yLjMtNi4xLTIuMy04LjUsMGwtNDIuNCw0Mi4zOTlMMTguNzI2LDEuNzI2Yy0yLjMwMS0yLjMwMS02LjEwMS0yLjMwMS04LjUsMGwtOC41LDguNQ0KCQljLTIuMzAxLDIuMy0yLjMwMSw2LjEsMCw4LjVsNDMuMSw0My4xbC00Mi4zLDQyLjVjLTIuMywyLjMtMi4zLDYuMSwwLDguNWw4LjUsOC41YzIuMywyLjMsNi4xLDIuMyw4LjUsMGw0Mi4zOTktNDIuNGw0Mi40LDQyLjQNCgkJYzIuMywyLjMsNi4xLDIuMyw4LjUsMGw4LjUtOC41YzIuMy0yLjMsMi4zLTYuMSwwLTguNWwtNDIuNS00Mi40bDQyLjQtNDIuMzk5QzEyMy42MjUsMTcuMTI1LDEyMy42MjUsMTMuMzI1LDEyMS4zMjUsMTAuOTI1eiIvPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPC9zdmc+DQo=);
245
302
  background-size: contain;
246
303
  background-repeat: no-repeat;
247
- }
304
+ }
248
305
 
306
+ /* Text align */
307
+ :host([align="center"]) .form-element {
308
+ text-align: center;
309
+ }
310
+ :host([align="left"]) .form-element {
311
+ text-align: left;
312
+ }
313
+ :host([align="right"]) .form-element {
314
+ text-align: right;
315
+ }
316
+
317
+ /* No arrows ion input Number */
318
+ :host([noAppearance]) input[type="number"]::-webkit-outer-spin-button,
319
+ :host([noAppearance]) input[type="number"]::-webkit-inner-spin-button {
320
+ -webkit-appearance: none;
321
+ margin: 0;
322
+ }
323
+
324
+ :host([noAppearance]) input[type="number"] {
325
+ -moz-appearance: textfield !important;
326
+ }
249
327
  `;
@@ -1,5 +1,6 @@
1
1
  import { LitElement } from "lit";
2
- declare const Fieldset_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
2
+ import "./legend";
3
+ declare const Fieldset_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
3
4
  export declare class Fieldset extends Fieldset_base {
4
5
  static styles: import("lit").CSSResult[];
5
6
  /**
@@ -10,6 +11,12 @@ export declare class Fieldset extends Fieldset_base {
10
11
  * Lier à un formulaire qui ne serait pas parent du fieldset
11
12
  */
12
13
  form?: string;
14
+ label?: string;
15
+ description?: string;
16
+ iconName?: string;
17
+ iconLibrary?: string;
18
+ iconPrefix?: string;
19
+ variant: "default" | "ghost" | "shadow";
13
20
  render(): import("lit-html").TemplateResult<1>;
14
21
  }
15
22
  export {};
@@ -4,10 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { html, LitElement, css } from "lit";
7
+ import { html, LitElement, css, nothing } from "lit";
8
8
  import { customElement, property } from "lit/decorators.js";
9
9
  import { ifDefined } from "lit/directives/if-defined.js";
10
10
  import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
11
+ import "./legend";
11
12
  const tagName = "sonic-fieldset";
12
13
  let Fieldset = class Fieldset extends Subscriber(LitElement) {
13
14
  constructor() {
@@ -17,9 +18,19 @@ let Fieldset = class Fieldset extends Subscriber(LitElement) {
17
18
  * Désactiver le fieldset
18
19
  */
19
20
  this.disabled = false;
21
+ this.variant = "default";
20
22
  }
21
23
  render() {
22
24
  return html `<fieldset form="${ifDefined(this.form)}" ?disabled="${this.disabled}">
25
+ ${this.label
26
+ ? html ` <sonic-legend
27
+ label=${ifDefined(this.label)}
28
+ description=${ifDefined(this.description)}
29
+ iconName=${ifDefined(this.iconName)}
30
+ iconPrefix=${ifDefined(this.iconPrefix)}
31
+ iconLibrary=${ifDefined(this.iconLibrary)}
32
+ ></sonic-legend>`
33
+ : nothing}
23
34
  <slot></slot>
24
35
  </fieldset>`;
25
36
  }
@@ -29,7 +40,7 @@ Fieldset.styles = [
29
40
  :host {
30
41
  --sc-fieldset-mt: 0;
31
42
  --sc-fieldset-mb: 1rem;
32
- --sc-fieldset-border-color: var(--sc-base-200);
43
+ --sc-fieldset-border-color: var(--sc-border-color);
33
44
  --sc-fieldset-border-width: var(--sc-form-border-width);
34
45
 
35
46
  margin-top: var(--sc-fieldset-mt);
@@ -44,11 +55,24 @@ Fieldset.styles = [
44
55
  all: unset;
45
56
  display: contents;
46
57
  }
47
-
58
+ :host([variant="shadow"]),
59
+ :host([variant="ghost"]) {
60
+ --sc-fieldset-border-color: transparent;
61
+ }
62
+ :host([variant="shadow"]) {
63
+ --sc-fieldset-border-color: transparent;
64
+ box-shadow: var(--sc-shadow-lg);
65
+ }
66
+
67
+ sonic-legend,
48
68
  ::slotted(sonic-legend) {
49
69
  margin-bottom: 1.5rem;
50
70
  display: block;
51
71
  }
72
+
73
+ ::slotted(sonic-legend:last-child) {
74
+ margin-bottom: 0;
75
+ }
52
76
  `,
53
77
  ];
54
78
  __decorate([
@@ -57,12 +81,25 @@ __decorate([
57
81
  __decorate([
58
82
  property({ type: String })
59
83
  ], Fieldset.prototype, "form", void 0);
84
+ __decorate([
85
+ property({ type: String })
86
+ ], Fieldset.prototype, "label", void 0);
87
+ __decorate([
88
+ property({ type: String })
89
+ ], Fieldset.prototype, "description", void 0);
90
+ __decorate([
91
+ property({ type: String })
92
+ ], Fieldset.prototype, "iconName", void 0);
93
+ __decorate([
94
+ property({ type: String })
95
+ ], Fieldset.prototype, "iconLibrary", void 0);
96
+ __decorate([
97
+ property({ type: String })
98
+ ], Fieldset.prototype, "iconPrefix", void 0);
99
+ __decorate([
100
+ property({ type: String, reflect: true })
101
+ ], Fieldset.prototype, "variant", void 0);
60
102
  Fieldset = __decorate([
61
103
  customElement(tagName)
62
104
  ], Fieldset);
63
105
  export { Fieldset };
64
- //Ajout pour la creation du cem notamment pour Storybook
65
- try {
66
- customElements.define(tagName, Fieldset);
67
- }
68
- catch (e) { }
@@ -28,8 +28,3 @@ LegendDescription = __decorate([
28
28
  customElement("sonic-legend-description")
29
29
  ], LegendDescription);
30
30
  export { LegendDescription };
31
- //Ajout pour la creation du cem notamment pour Storybook
32
- try {
33
- customElements.define("sonic-legend-description", LegendDescription);
34
- }
35
- catch (e) { }
@@ -59,11 +59,12 @@ let Legend = class Legend extends LitElement {
59
59
  Legend.styles = [
60
60
  css `
61
61
  :host {
62
- --sc-legend-font-size: 1.75rem;
62
+ --sc-legend-font-size: 1.5rem;
63
63
  --sc-legend-font-weight: var(--sc-font-weight-base);
64
64
  --sc-legend-font-style: var(--sc-headings-font-style);
65
65
  --sc-legend-family: var(--sc-headings-font-family);
66
66
  --sc-legend-line-height: var(--sc-headings-line-height);
67
+ --sc-legend-color: var(--sc-base-content);
67
68
  display: flex;
68
69
  width: 100%;
69
70
  }
@@ -74,6 +75,7 @@ Legend.styles = [
74
75
  font-style: var(--sc-legend-font-style);
75
76
  font-family: var(--sc-legend-font-family);
76
77
  line-height: var(--sc-legend-line-height);
78
+ color: var(--sc-legend-color);
77
79
  padding: 0;
78
80
  display: flex;
79
81
  width: 100%;
@@ -114,8 +116,3 @@ Legend = __decorate([
114
116
  customElement(tagName)
115
117
  ], Legend);
116
118
  export { Legend };
117
- //Ajout pour la creation du cem notamment pour Storybook
118
- try {
119
- customElements.define(tagName, Legend);
120
- }
121
- catch (e) { }
@@ -1,5 +1,7 @@
1
1
  import { LitElement } from "lit";
2
2
  export declare class FormActions extends LitElement {
3
3
  static styles: import("lit").CSSResult[];
4
+ direction: string;
5
+ justify: string;
4
6
  render(): import("lit-html").TemplateResult<1>;
5
7
  }
@@ -5,27 +5,42 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { html, LitElement, css } from "lit";
8
- import { customElement } from "lit/decorators.js";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { styleMap } from "lit/directives/style-map.js";
9
10
  const tagName = "sonic-form-actions";
10
11
  let FormActions = class FormActions extends LitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.direction = "row";
15
+ this.justify = "flex-start";
16
+ }
11
17
  render() {
12
- return html `<slot></slot>`;
18
+ const styles = {
19
+ flexDirection: this.direction,
20
+ justifyContent: this.justify,
21
+ };
22
+ return html `<slot style=${styleMap(styles)}></slot>`;
13
23
  }
14
24
  };
15
25
  FormActions.styles = [
16
26
  css `
17
- :host{
18
- display:flex;
19
- gap:.3rem;
27
+ :host {
28
+ display: block;
29
+ }
30
+ slot {
31
+ display: flex;
32
+ flex-wrap: wrap;
33
+ gap: 0.3rem;
20
34
  }
21
- `
35
+ `,
22
36
  ];
37
+ __decorate([
38
+ property({ type: String })
39
+ ], FormActions.prototype, "direction", void 0);
40
+ __decorate([
41
+ property({ type: String })
42
+ ], FormActions.prototype, "justify", void 0);
23
43
  FormActions = __decorate([
24
44
  customElement(tagName)
25
45
  ], FormActions);
26
46
  export { FormActions };
27
- //Ajout pour la creation du cem notamment pour Storybook
28
- try {
29
- customElements.define(tagName, FormActions);
30
- }
31
- catch (e) { }
@@ -1,9 +1,12 @@
1
1
  import { LitElement } from "lit";
2
2
  import { ResizeController } from "@lit-labs/observers/resize_controller.js";
3
- declare const FormLayout_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
3
+ declare const FormLayout_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
4
4
  export declare class FormLayout extends FormLayout_base {
5
5
  static styles: import("lit").CSSResult[];
6
- _resizeController: ResizeController;
6
+ _resizeController: ResizeController<unknown>;
7
+ slottedElements: HTMLElement[];
8
+ oneFormElement: boolean;
9
+ onSlotChange(): void;
7
10
  render(): import("lit-html").TemplateResult<1>;
8
11
  }
9
12
  export {};
@@ -5,17 +5,32 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { html, LitElement, css } from "lit";
8
- import { customElement } from "lit/decorators.js";
8
+ import { customElement, property, queryAssignedElements } from "lit/decorators.js";
9
9
  import { ResizeController } from "@lit-labs/observers/resize_controller.js";
10
+ import { classMap } from "lit/directives/class-map.js";
10
11
  import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
11
12
  const tagName = "sonic-form-layout";
12
13
  let FormLayout = class FormLayout extends Subscriber(LitElement) {
13
14
  constructor() {
14
15
  super(...arguments);
15
16
  this._resizeController = new ResizeController(this, {});
17
+ this.oneFormElement = false;
18
+ }
19
+ onSlotChange() {
20
+ let elements = this.slottedElements;
21
+ const formElementColumns = ["sonic-input", "sonic-select", "sonic-input-autocomplete", ".form-item-container"];
22
+ // keep only form elements
23
+ elements = elements.filter((elt) => formElementColumns.includes(elt.nodeName.toLowerCase()));
24
+ this.oneFormElement = elements.length == 1;
16
25
  }
17
26
  render() {
18
- return html `<div class=${this.offsetWidth > 440 ? "cq--md" : ""}><slot></slot></div>`;
27
+ const classes = {
28
+ "cq--md": this.offsetWidth > 440,
29
+ "one-form-element": this.oneFormElement,
30
+ };
31
+ return html `<div class=${classMap(classes)}>
32
+ <slot @slotchange=${this.onSlotChange}></slot>
33
+ </div>`;
19
34
  }
20
35
  };
21
36
  FormLayout.styles = [
@@ -34,13 +49,19 @@ FormLayout.styles = [
34
49
  grid-gap: 1.75rem;
35
50
  grid-template-columns: repeat(2, minmax(0, 1fr));
36
51
  }
37
-
38
- ::slotted(sonic-radio),
52
+ .one-form-element {
53
+ grid-template-columns: 1fr;
54
+ }
55
+ /*::slotted(sonic-radio),
39
56
  ::slotted(sonic-checkbox),
40
57
  ::slotted(sonic-form-actions),
41
58
  ::slotted(sonic-divider),
42
59
  ::slotted(sonic-textarea) {
43
60
  grid-column: 1 / -1;
61
+ }*/
62
+
63
+ ::slotted(:not(sonic-input):not(sonic-select):not(sonic-input-autocomplete):not(.form-item-container)) {
64
+ grid-column: 1 / -1;
44
65
  }
45
66
 
46
67
  ::slotted(sonic-divider) {
@@ -48,12 +69,13 @@ FormLayout.styles = [
48
69
  }
49
70
  `,
50
71
  ];
72
+ __decorate([
73
+ queryAssignedElements({ flatten: true })
74
+ ], FormLayout.prototype, "slottedElements", void 0);
75
+ __decorate([
76
+ property({ type: Boolean })
77
+ ], FormLayout.prototype, "oneFormElement", void 0);
51
78
  FormLayout = __decorate([
52
79
  customElement(tagName)
53
80
  ], FormLayout);
54
81
  export { FormLayout };
55
- //Ajout pour la creation du cem notamment pour Storybook
56
- try {
57
- customElements.define(tagName, FormLayout);
58
- }
59
- catch (e) { }