@supersoniks/concorde 1.1.42 → 1.1.43

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 (182) hide show
  1. package/components.js +2 -3
  2. package/concorde-core.bundle.js +37 -35
  3. package/concorde-core.es.js +5081 -4317
  4. package/core/_types/types.d.ts +26 -0
  5. package/core/_types/types.js +1 -0
  6. package/core/components/functional/date/date.d.ts +13 -5
  7. package/core/components/functional/date/date.js +48 -29
  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 +40 -3
  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 +32 -8
  19. package/core/components/functional/list/list.js +33 -40
  20. package/core/components/functional/mix/mix.d.ts +22 -0
  21. package/core/components/functional/mix/mix.js +99 -0
  22. package/core/components/functional/queue/queue.d.ts +16 -3
  23. package/core/components/functional/queue/queue.js +71 -15
  24. package/core/components/functional/router/redirect.d.ts +10 -1
  25. package/core/components/functional/router/redirect.js +5 -6
  26. package/core/components/functional/router/router.d.ts +15 -1
  27. package/core/components/functional/router/router.js +1 -6
  28. package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +1 -1
  29. package/core/components/functional/sdui/SDUIDescriptorTransformer.js +24 -12
  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 +16 -9
  34. package/core/components/functional/sdui/sdui.js +52 -25
  35. package/core/components/functional/sdui/types.d.ts +4 -2
  36. package/core/components/functional/states/states.d.ts +19 -3
  37. package/core/components/functional/states/states.js +7 -12
  38. package/core/components/functional/submit/submit.d.ts +16 -1
  39. package/core/components/functional/submit/submit.js +87 -17
  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 +23 -20
  52. package/core/components/ui/button/button.js +59 -42
  53. package/core/components/ui/captcha/captcha.d.ts +14 -2
  54. package/core/components/ui/captcha/captcha.js +17 -12
  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 +1 -6
  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 +28 -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 +53 -16
  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 +15 -18
  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 +3 -2
  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 +1 -0
  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 +23 -7
  86. package/core/components/ui/form/select/select.js +69 -38
  87. package/core/components/ui/form/textarea/textarea.d.ts +13 -13
  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 +11 -8
  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.js +2 -8
  99. package/core/components/ui/menu/menu-item.js +4 -9
  100. package/core/components/ui/menu/menu.d.ts +9 -1
  101. package/core/components/ui/menu/menu.js +183 -27
  102. package/core/components/ui/modal/modal-actions.js +1 -6
  103. package/core/components/ui/modal/modal-close.d.ts +1 -0
  104. package/core/components/ui/modal/modal-close.js +14 -10
  105. package/core/components/ui/modal/modal-content.js +0 -5
  106. package/core/components/ui/modal/modal-subtitle.js +2 -6
  107. package/core/components/ui/modal/modal-title.js +0 -5
  108. package/core/components/ui/modal/modal.d.ts +7 -7
  109. package/core/components/ui/modal/modal.js +36 -36
  110. package/core/components/ui/pop/pop.d.ts +6 -5
  111. package/core/components/ui/pop/pop.js +44 -44
  112. package/core/components/ui/progress/progress.js +34 -32
  113. package/core/components/ui/table/table-caption.js +5 -10
  114. package/core/components/ui/table/table-tbody.js +10 -14
  115. package/core/components/ui/table/table-td.d.ts +2 -0
  116. package/core/components/ui/table/table-td.js +8 -5
  117. package/core/components/ui/table/table-tfoot.js +5 -7
  118. package/core/components/ui/table/table-th.d.ts +2 -0
  119. package/core/components/ui/table/table-th.js +12 -9
  120. package/core/components/ui/table/table-thead.js +1 -6
  121. package/core/components/ui/table/table-tr.js +4 -6
  122. package/core/components/ui/table/table.d.ts +0 -3
  123. package/core/components/ui/table/table.js +14 -31
  124. package/core/components/ui/taxonomy/taxonomy.d.ts +6 -3
  125. package/core/components/ui/taxonomy/taxonomy.js +9 -9
  126. package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
  127. package/core/components/ui/theme/theme-collection/dark.js +1 -1
  128. package/core/components/ui/theme/theme.d.ts +1 -6
  129. package/core/components/ui/theme/theme.js +7 -36
  130. package/core/components/ui/toast/message-subscriber.d.ts +13 -7
  131. package/core/components/ui/toast/toast-item.js +1 -1
  132. package/core/components/ui/toast/toast.d.ts +2 -1
  133. package/core/components/ui/toast/toast.js +29 -14
  134. package/core/components/ui/tooltip/tooltip.d.ts +1 -0
  135. package/core/components/ui/tooltip/tooltip.js +35 -14
  136. package/core/components/ui/ui.js +0 -3
  137. package/core/core.js +5 -6
  138. package/core/mixins/Fetcher.d.ts +19 -10
  139. package/core/mixins/Fetcher.js +26 -10
  140. package/core/mixins/FormCheckable.d.ts +17 -8
  141. package/core/mixins/FormCheckable.js +177 -22
  142. package/core/mixins/FormElement.d.ts +12 -7
  143. package/core/mixins/FormElement.js +42 -26
  144. package/core/mixins/FormInput.d.ts +8 -4
  145. package/core/mixins/FormInput.js +4 -3
  146. package/core/mixins/Subscriber.d.ts +7 -5
  147. package/core/mixins/Subscriber.js +34 -32
  148. package/core/utils/Arrays.d.ts +15 -15
  149. package/core/utils/DataBindObserver.d.ts +16 -9
  150. package/core/utils/DataBindObserver.js +23 -28
  151. package/core/utils/Electron.d.ts +5 -1
  152. package/core/utils/Electron.js +4 -2
  153. package/core/utils/HTML.d.ts +9 -2
  154. package/core/utils/HTML.js +22 -3
  155. package/core/utils/LocationHandler.d.ts +6 -5
  156. package/core/utils/LocationHandler.js +19 -8
  157. package/core/utils/Objects.d.ts +7 -4
  158. package/core/utils/Objects.js +28 -6
  159. package/core/utils/{PublisherProxy.d.mts → PublisherProxy.d.ts} +40 -31
  160. package/core/utils/{PublisherProxy.mjs → PublisherProxy.js} +54 -28
  161. package/core/utils/Utils.d.ts +3 -0
  162. package/core/utils/Utils.js +18 -0
  163. package/core/utils/api.d.ts +39 -7
  164. package/core/utils/api.js +45 -32
  165. package/img/concorde-logo.svg +1 -0
  166. package/img/concorde.png +0 -0
  167. package/img/concorde_def.png +0 -0
  168. package/mixins.d.ts +36 -18
  169. package/mixins.js +3 -4
  170. package/package.json +45 -10
  171. package/svg/regular/plane.svg +1 -0
  172. package/svg/solid/plane.svg +1 -0
  173. package/test-utils/TestUtils.d.ts +4 -0
  174. package/test-utils/TestUtils.js +12 -0
  175. package/utils.d.ts +3 -1
  176. package/utils.js +7 -5
  177. package/core/components/functional/configuration/configuration.d.ts +0 -5
  178. package/core/components/functional/configuration/configuration.js +0 -22
  179. package/core/components/ui/tabs/tab.d.ts +0 -6
  180. package/core/components/ui/tabs/tab.js +0 -46
  181. package/core/components/ui/tabs/tabs.d.ts +0 -15
  182. package/core/components/ui/tabs/tabs.js +0 -129
@@ -20,19 +20,15 @@ const tagName = "sonic-table";
20
20
  let Table = class Table extends LitElement {
21
21
  constructor() {
22
22
  super(...arguments);
23
- this.striped = false;
24
- this.sticky = false;
25
23
  this.bordered = false;
26
- this.hover = false;
27
24
  }
28
25
  render() {
29
26
  const containerStyles = {
30
27
  maxHeight: this.maxHeight,
31
28
  };
32
29
  return html `
33
-
34
- <div class="table-container custom-scroll" style=${styleMap(containerStyles)} >
35
- <div class="table" ?striped=${this.striped} ?hover=${this.hover} ?sticky=${this.sticky}>
30
+ <div class="table-container custom-scroll" style=${styleMap(containerStyles)}>
31
+ <div class="table">
36
32
  <slot></slot>
37
33
  </div>
38
34
  </div>
@@ -47,51 +43,43 @@ Table.styles = [
47
43
  --sc-table-fw: var(--sc-font-weight-base);
48
44
  --sc-table-fst: var(--sc-font-style-base);
49
45
  --sc-table-fs: 1rem;
50
- --sc-table-border-color: var(--sc-base-200);
51
- --sc-table-caption-color: var(--sc-base-400);
46
+ --sc-table-border-color: var(--sc-border-color);
47
+ --sc-table-caption-color: var(--sc-base-500);
52
48
  --sc-table-bg: var(--sc-base);
53
- --sc-table-th-fs: .85em;
49
+ --sc-table-accent-bg: var(--sc-base-50);
50
+ --sc-table-hover-bg: var(--sc-base-100);
51
+ --sc-table-th-fs: 0.85em;
54
52
  --sc-table-th-fw: bold;
55
53
  --sc-table-th-tt: uppercase;
56
54
  --sc-table-th-px: var(--sc-table-td-px);
57
- --sc-table-th-py: calc(1.8 * var(--sc-table-td-py) );
58
- --sc-table-td-px: .5em;
59
- --sc-table-td-py: .5em;
60
- display:block;
55
+ --sc-table-th-py: calc(1.8 * var(--sc-table-td-py));
56
+ --sc-table-td-px: 0.5em;
57
+ --sc-table-td-py: 0.5em;
58
+ display: block;
61
59
  }
62
60
 
63
61
  :host([maxHeight]) .table-container {
64
62
  overflow-x: auto;
65
63
  -webkit-overflow-scrolling: touch;
66
64
  }
67
-
65
+
68
66
  .table {
69
67
  width: 100%;
70
68
  display: table;
71
- box-sizing:border-box;
69
+ box-sizing: border-box;
72
70
  }
73
71
 
74
72
  :host([bordered]) .table-container {
75
- border:var(--sc-border-width) solid var(--sc-table-border-color) !important;
73
+ border: var(--sc-border-width) solid var(--sc-table-border-color) !important;
76
74
  }
77
-
78
75
  `,
79
76
  ];
80
77
  __decorate([
81
78
  property({ type: String, reflect: true })
82
79
  ], Table.prototype, "size", void 0);
83
- __decorate([
84
- property({ type: Boolean, reflect: true })
85
- ], Table.prototype, "striped", void 0);
86
- __decorate([
87
- property({ type: Boolean, reflect: true })
88
- ], Table.prototype, "sticky", void 0);
89
80
  __decorate([
90
81
  property({ type: Boolean, reflect: true })
91
82
  ], Table.prototype, "bordered", void 0);
92
- __decorate([
93
- property({ type: Boolean, reflect: true })
94
- ], Table.prototype, "hover", void 0);
95
83
  __decorate([
96
84
  property({ type: String })
97
85
  ], Table.prototype, "maxHeight", void 0);
@@ -99,8 +87,3 @@ Table = __decorate([
99
87
  customElement(tagName)
100
88
  ], Table);
101
89
  export { Table };
102
- //Ajout pour la creation du cem notamment pour Storybook
103
- try {
104
- customElements.define(tagName, Table);
105
- }
106
- catch (e) { }
@@ -1,6 +1,8 @@
1
1
  import { LitElement, nothing } from "lit";
2
2
  import "@supersoniks/concorde/core/components/ui/icon/icon";
3
3
  import "@supersoniks/concorde/core/components/ui/badge/badge";
4
+ import { IconConf } from "../icon/icons";
5
+ declare type TaxonomyConf = Record<string, boolean | string>;
4
6
  /**
5
7
  * Le composant taxonomy crée un badge (*sonic-badge*) contenant une liste de termes préfixés par une icone (*sonic-icon*) optionelle séparées par une chaine html séparatrice (*separator*)
6
8
  */
@@ -9,12 +11,12 @@ export declare class Taxonomy extends LitElement {
9
11
  /**
10
12
  * Identifiant d'icone passé en interne au composant *sonic-icon*
11
13
  */
12
- icon: any;
14
+ icon: IconConf;
13
15
  /**
14
16
  * Tableau d'objets de la forme :{*key*_name:*"Une taxonomie"*} ou *key* correspond à la valeur fournie à la propriété *key*.
15
17
  * Dans ce cas *"une taxonomie"* sera un des termes affiches dans le composant.
16
18
  */
17
- taxonomy: never[];
19
+ taxonomy: TaxonomyConf[];
18
20
  /**
19
21
  * Chaque terme sera séparé par la valeur contenue dans cette propriété
20
22
  */
@@ -32,10 +34,11 @@ export declare class Taxonomy extends LitElement {
32
34
  * * gost : composant super léger visuellement
33
35
  * * outline : composant légé avec une bordure
34
36
  */
35
- variant: "default" | "outline";
37
+ variant: "default" | "outline" | "ghost";
36
38
  /**
37
39
  * Taille du composant, implique notamment des modifications de typo et de marge interne
38
40
  */
39
41
  size: "md" | "xs" | "sm" | "lg";
40
42
  render(): import("lit-html").TemplateResult<1> | typeof nothing;
41
43
  }
44
+ export {};
@@ -21,7 +21,7 @@ let Taxonomy = class Taxonomy extends LitElement {
21
21
  /**
22
22
  * Identifiant d'icone passé en interne au composant *sonic-icon*
23
23
  */
24
- this.icon = {};
24
+ this.icon = { name: "" };
25
25
  /**
26
26
  * Tableau d'objets de la forme :{*key*_name:*"Une taxonomie"*} ou *key* correspond à la valeur fournie à la propriété *key*.
27
27
  * Dans ce cas *"une taxonomie"* sera un des termes affiches dans le composant.
@@ -51,7 +51,7 @@ let Taxonomy = class Taxonomy extends LitElement {
51
51
  this.size = "md";
52
52
  }
53
53
  render() {
54
- if (!this.taxonomy)
54
+ if (!Array.isArray(this.taxonomy))
55
55
  return nothing;
56
56
  let key = this.key + "_display";
57
57
  let taxo = this.taxonomy.filter((elt) => elt != null && (elt[key] === true || elt[key] == "1" || !elt.hasOwnProperty(key)));
@@ -62,10 +62,15 @@ let Taxonomy = class Taxonomy extends LitElement {
62
62
  this.style.removeProperty("display");
63
63
  return html `
64
64
  <sonic-badge type=${this.type} variant=${this.variant} size=${this.size}>
65
- <sonic-icon slot="prefix" library=${ifDefined(this.icon.library)} prefix=${ifDefined(this.icon.prefix)} name=${ifDefined(this.icon.name)} ></sonic-icon>
65
+ <sonic-icon
66
+ slot="prefix"
67
+ library=${ifDefined(this.icon.library)}
68
+ prefix=${ifDefined(this.icon.prefix)}
69
+ name=${ifDefined(this.icon.name)}
70
+ ></sonic-icon>
66
71
  <span class="taxonomy-list">
67
72
  ${repeat(taxo, (item) => item[this.key + "_id"], (item) => {
68
- return html `<span> ${item[this.key + "_name"]}</span
73
+ return html `<span> ${item[this.key + "_name"] || item["name"]}</span
69
74
  ><span class="sonic-taxonomy-separator">${unsafeHTML(this.separator)}</span>`;
70
75
  })}
71
76
  </span>
@@ -108,8 +113,3 @@ Taxonomy = __decorate([
108
113
  customElement(tagName)
109
114
  ], Taxonomy);
110
115
  export { Taxonomy };
111
- //Ajout pour la creation du cem notamment pour Storybook
112
- try {
113
- customElements.define("sonic-taxonomy", Taxonomy);
114
- }
115
- catch (e) { }
@@ -2,7 +2,7 @@ import { css } from "lit";
2
2
  export const coreVariables = css `
3
3
  :host {
4
4
  /* polices*/
5
- --sc-font-family-base: "Inter var", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
5
+ --sc-font-family-base: "Inter var", "Inter", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
6
6
  "Helvetica Neue", Arial, sans-serif;
7
7
  --sc-font-weight-base: 400;
8
8
  --sc-font-style-base: normal;
@@ -22,14 +22,14 @@ export const coreVariables = css `
22
22
  --sc-rounded-sm: calc(var(--sc-rounded) * 0.5);
23
23
  --sc-rounded: 0.375rem;
24
24
  --sc-rounded-md: calc(var(--sc-rounded) * 1.8);
25
- --sc-rounded-lg: calc(var(--sc-rounded) * 3.5);
25
+ --sc-rounded-lg: calc(var(--sc-rounded) * 3);
26
26
  --sc-rounded-xl: calc(var(--sc-rounded) * 7);
27
- --sc-rounded-size-intensity: calc((1em - 1rem) * .4);
27
+ --sc-rounded-size-intensity: calc((1em - 1rem) * 0.4);
28
28
 
29
29
  /* 4 for rounded full*/
30
- --sc-btn-rounded-intensity : 1.4;
30
+ --sc-btn-rounded-intensity: 1.4;
31
31
  --sc-btn-font-weight: 500;
32
- --sc-btn-rounded: calc((var(--sc-rounded) + var(--sc-rounded-size-intensity)) * var(--sc-btn-rounded-intensity) );
32
+ --sc-btn-rounded: calc((var(--sc-rounded) + var(--sc-rounded-size-intensity)) * var(--sc-btn-rounded-intensity));
33
33
 
34
34
  /* Placeholder */
35
35
  --sc-placeholder-bg: rgba(17, 24, 39, 0.05);
@@ -37,18 +37,21 @@ export const coreVariables = css `
37
37
  /* OMBRES */
38
38
  --sc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
39
39
  --sc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
40
- --sc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
40
+ --sc-shadow-lg: 0 10px 15px 0px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
41
41
  --sc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
42
42
  --sc-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
43
43
 
44
44
  /* Forms */
45
45
  --sc-border-width: max(1px, 0.12rem);
46
- --sc-form-height : 2.5em;
46
+ --sc-border-color: var(--sc-base-200);
47
+ --sc-form-height: 2.5em;
47
48
  --sc-form-border-width: var(--sc-border-width);
48
49
  --sc-input-bg: var(--sc-base-100);
49
50
  --sc-input-border-color: var(--sc-input-bg);
50
- --sc-input-rounded-intensity : 1.4;
51
- --sc-input-rounded: calc((var(--sc-rounded) + var(--sc-rounded-size-intensity)) * var(--sc-input-rounded-intensity) );
51
+ --sc-input-rounded-intensity: 1.4;
52
+ --sc-input-rounded: calc(
53
+ (var(--sc-rounded) + var(--sc-rounded-size-intensity)) * var(--sc-input-rounded-intensity)
54
+ );
52
55
  --sc-label-font-weight: 500;
53
56
 
54
57
  /* Contrast -- ex : Text on images */
@@ -56,10 +59,9 @@ export const coreVariables = css `
56
59
  --sc-contrast: #11151f;
57
60
 
58
61
  /*Scrollbar*/
59
- --sc-scrollbar-bg : var(--sc-base-400);
62
+ --sc-scrollbar-bg: var(--sc-base-400);
60
63
 
61
64
  /*Body*/
62
65
  --sc-body-bg: var(--sc-base);
63
-
64
66
  }
65
67
  `;
@@ -14,7 +14,7 @@ const darkCss = css `
14
14
 
15
15
  --sc-base: var(--sc-dark-base, #1d2634);
16
16
  --sc-base-50: var(--sc-dark-base-50, #1f2937);
17
- --sc-base-100: var(--sc-dark-base-100, #252C36);
17
+ --sc-base-100: var(--sc-dark-base-100, #252c36);
18
18
  --sc-base-200: var(--sc-dark-base-200, #2c3543);
19
19
  --sc-base-300: var(--sc-dark-base-300, #38414e);
20
20
  --sc-base-400: var(--sc-dark-base-400, #515964);
@@ -1,18 +1,13 @@
1
1
  import { LitElement } from "lit";
2
- export declare const tailwind: import("lit").CSSResult;
3
2
  export declare class Theme extends LitElement {
4
3
  static styles: import("lit").CSSResult[];
5
4
  theme: string;
6
5
  background: boolean;
7
6
  color: boolean;
8
7
  font: boolean;
9
- contrastDarkMode: boolean;
10
8
  connectedCallback(): void;
11
- updated(): void;
12
9
  postCSSVars(): void;
13
- receiveMessage(event: any): void;
10
+ receiveMessage(event: MessageEvent): void;
14
11
  getCssVariables(): Record<string, string>;
15
- contrast(color: string, percent: number): string;
16
- contrastBg(): void;
17
12
  render(): import("lit-html").TemplateResult<1>;
18
13
  }
@@ -5,15 +5,11 @@ 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
  var Theme_1;
8
- import { html, LitElement, css, unsafeCSS } from "lit";
8
+ import { html, LitElement, css } from "lit";
9
9
  import { customElement, property } from "lit/decorators.js";
10
10
  import { coreVariables } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/core-variables";
11
11
  import { light } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/light";
12
12
  import { dark } from "@supersoniks/concorde/core/components/ui/theme/theme-collection/dark";
13
- import tailwindImport from "./css/tailwind.css?inline";
14
- export const tailwind = css `
15
- ${unsafeCSS(tailwindImport)}
16
- `;
17
13
  const tagName = "sonic-theme";
18
14
  let Theme = Theme_1 = class Theme extends LitElement {
19
15
  constructor() {
@@ -22,16 +18,12 @@ let Theme = Theme_1 = class Theme extends LitElement {
22
18
  this.background = false;
23
19
  this.color = false;
24
20
  this.font = false;
25
- this.contrastDarkMode = false;
26
21
  }
27
22
  connectedCallback() {
28
23
  super.connectedCallback();
29
24
  window.addEventListener("message", (e) => this.receiveMessage(e), false);
30
25
  this.postCSSVars();
31
26
  }
32
- updated() {
33
- this.contrastBg();
34
- }
35
27
  postCSSVars() {
36
28
  const stylesheets = document.styleSheets;
37
29
  const ssLength = stylesheets.length;
@@ -61,11 +53,14 @@ let Theme = Theme_1 = class Theme extends LitElement {
61
53
  let stylesheets = [...Theme_1.styles.map((s) => s.styleSheet), ...Array.from(document.styleSheets)];
62
54
  for (let stylesheet of stylesheets) {
63
55
  try {
64
- let rules = stylesheet === null || stylesheet === void 0 ? void 0 : stylesheet.cssRules;
56
+ if (!stylesheet)
57
+ continue;
58
+ let rules = stylesheet.cssRules;
65
59
  for (let rule of rules) {
66
- if (!rule.style)
60
+ if (!("style" in rule))
67
61
  continue;
68
- for (let name of rule.style) {
62
+ let style = rule.style;
63
+ for (let name of style) {
69
64
  if (names.includes(name) || name.indexOf("--sc") !== 0)
70
65
  continue;
71
66
  names.push(name);
@@ -79,24 +74,6 @@ let Theme = Theme_1 = class Theme extends LitElement {
79
74
  names.forEach((name) => (result[name] = style.getPropertyValue(name)));
80
75
  return result;
81
76
  }
82
- // function to darken a color based on an hexa value
83
- contrast(color, percent) {
84
- let num = parseInt(color.replace("#", ""), 16), amt = Math.round(2.55 * percent), R = (num >> 16) + amt, B = ((num >> 8) & 0x00ff) + amt, G = (num & 0x0000ff) + amt;
85
- return ("#" +
86
- (0x1000000 +
87
- (R < 255 ? (R < 1 ? 0 : R) : 255) * 0x10000 +
88
- (B < 255 ? (B < 1 ? 0 : B) : 255) * 0x100 +
89
- (G < 255 ? (G < 1 ? 0 : G) : 255))
90
- .toString(16)
91
- .slice(1));
92
- }
93
- // get de computed value of --sc-base and darken it
94
- contrastBg() {
95
- if (this.theme === "dark" && this.contrastDarkMode && this.background) {
96
- let baseColor = window.getComputedStyle(this).getPropertyValue("--sc-base");
97
- this.style.setProperty("--sc-body-bg", this.contrast(baseColor, -2.5));
98
- }
99
- }
100
77
  render() {
101
78
  return html `<slot></slot>`;
102
79
  }
@@ -111,9 +88,6 @@ Theme.styles = [
111
88
  background: var(--sc-body-bg) !important;
112
89
  min-height: 100vh;
113
90
  }
114
- :host([contrastDarkMode]) {
115
- transition: background-color 2.5s ease;
116
- }
117
91
 
118
92
  :host([color]) {
119
93
  color: var(--sc-base-content);
@@ -138,9 +112,6 @@ __decorate([
138
112
  __decorate([
139
113
  property({ type: Boolean, reflect: true })
140
114
  ], Theme.prototype, "font", void 0);
141
- __decorate([
142
- property({ type: Boolean, reflect: true })
143
- ], Theme.prototype, "contrastDarkMode", void 0);
144
115
  Theme = Theme_1 = __decorate([
145
116
  customElement(tagName)
146
117
  ], Theme);
@@ -1,17 +1,23 @@
1
1
  import { LitElement } from "lit";
2
- declare const MessageSubscriber_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
2
+ import { ToastStatus } from "@supersoniks/concorde/core/components/ui/toast/types";
3
+ declare type Message = {
4
+ type: string;
5
+ content: string;
6
+ status: ToastStatus;
7
+ };
8
+ declare const MessageSubscriber_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
3
9
  export declare class MessageSubscriber extends MessageSubscriber_base {
4
- _messages: Array<any>;
10
+ _messages: Array<Message>;
5
11
  success: boolean | null;
6
12
  status: boolean | null;
7
- get messages(): Array<any>;
8
- set messages(value: Array<any>);
13
+ get messages(): Message[];
14
+ set messages(value: Message[]);
9
15
  _message: string;
10
16
  get message(): string;
11
17
  set message(value: string);
12
- _data: Record<string, any>[] | string;
13
- get data(): string | Record<string, any>[];
14
- set data(value: string | Record<string, any>[]);
18
+ _data: Object | string;
19
+ get data(): string | Object;
20
+ set data(value: string | Object);
15
21
  render(): symbol;
16
22
  }
17
23
  export {};
@@ -107,7 +107,7 @@ SonicToastItem.styles = [
107
107
  position: fixed;
108
108
  bottom: 1.25rem;
109
109
  right: 1.25rem;
110
- z-index: 999;
110
+ z-index: 10000;
111
111
  display: flex;
112
112
  flex-direction: column-reverse;
113
113
  }
@@ -16,5 +16,6 @@ export declare class SonicToast extends LitElement {
16
16
  ghost: boolean | undefined;
17
17
  dismissForever: boolean | undefined;
18
18
  } | null;
19
- removeItem(item: Toast): void;
19
+ static removeItem(toastToRemove?: Toast): void;
20
+ removeItem(toastToRemove?: Toast): void;
20
21
  }
@@ -29,22 +29,23 @@ let SonicToast = class SonicToast extends LitElement {
29
29
  pointerEvents: "none",
30
30
  gap: "1rem",
31
31
  display: "flex",
32
- margin: "1rem"
32
+ margin: "1rem",
33
33
  };
34
34
  if (!isIframe) {
35
- styles = Object.assign(Object.assign({}, styles), { margin: "0", width: "calc(100% - 2.5rem)", position: "fixed", bottom: "1.25rem", right: "1.25rem", zIndex: "999", maxWidth: "64ch", flexDirection: "column-reverse" });
35
+ styles = Object.assign(Object.assign({}, styles), { margin: "0", width: "calc(100% - 2.5rem)", position: "fixed", bottom: "1.25rem", right: "1.25rem", zIndex: "10000", maxWidth: "64ch", flexDirection: "column-reverse" });
36
36
  }
37
37
  // ${window.parent == window ? "fixed-area" : ""}
38
38
  if (!this.toasts)
39
39
  return nothing;
40
40
  return html `<div aria-live="polite" style=${styleMap(styles)}>
41
41
  ${repeat(this.toasts, (item) => item.id, (item) => html `
42
- <sonic-toast-item maxHeight=${isIframe ? 'none' : '10rem'}
42
+ <sonic-toast-item
43
+ maxHeight=${isIframe ? "none" : "10rem"}
43
44
  status=${ifDefined(item.status)}
44
45
  title=${ifDefined(item.title)}
45
46
  ?ghost=${item.ghost}
46
47
  ?dismissForever=${item.dismissForever}
47
- ?preserve=${item.preserve}
48
+ ?preserve=${item.preserve}
48
49
  id=${ifDefined(item.id)}
49
50
  @hide=${() => this.removeItem(item)}
50
51
  ${animate({
@@ -88,7 +89,7 @@ let SonicToast = class SonicToast extends LitElement {
88
89
  // Ajoute le toast à la liste
89
90
  let toastComponent = document.querySelector("sonic-toast");
90
91
  const nextId = (_a = conf.id) !== null && _a !== void 0 ? _a : new Date().valueOf();
91
- const interactiveRegExp = new RegExp("</a>|</button>");
92
+ const interactiveRegExp = new RegExp("</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>");
92
93
  const hasInteractive = interactiveRegExp.test(conf.text);
93
94
  const currentToast = {
94
95
  id: nextId,
@@ -101,7 +102,7 @@ let SonicToast = class SonicToast extends LitElement {
101
102
  };
102
103
  // check if the toast is dismissed
103
104
  if (conf.dismissForever && conf.id) {
104
- const dismissed = localStorage.getItem('sonic-toast-dismissed') || '{}';
105
+ const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}";
105
106
  const dismissedObj = JSON.parse(dismissed);
106
107
  if (dismissedObj[conf.id]) {
107
108
  return null;
@@ -109,18 +110,33 @@ let SonicToast = class SonicToast extends LitElement {
109
110
  }
110
111
  if (toastComponent.toasts.length > 0) {
111
112
  let toastA = Object.assign({}, currentToast);
112
- let toastB = Object.assign({}, toastComponent.toasts[toastComponent.toasts.length - 1]);
113
- toastA.id = toastB.id = 0;
114
- if (!currentToast.preserve && Objects.shallowEqual(toastA, toastB)) {
115
- return null;
113
+ for (const toast of toastComponent.toasts) {
114
+ let toastB = Object.assign({}, toast);
115
+ toastA.id = toastB.id = 0;
116
+ if ( /*!currentToast.preserve && */Objects.shallowEqual(toastA, toastB)) {
117
+ return null;
118
+ }
116
119
  }
117
120
  }
118
121
  toastComponent.toasts = [...toastComponent.toasts, currentToast];
119
122
  return currentToast;
120
123
  }
124
+ static removeItem(toastToRemove) {
125
+ let toastComponent = document.querySelector("sonic-toast");
126
+ if (!toastComponent)
127
+ return;
128
+ console.log(toastToRemove);
129
+ toastComponent.removeItem(toastToRemove);
130
+ }
121
131
  // Remove Toast
122
- removeItem(item) {
123
- this.toasts = this.toasts.filter((i) => i != item);
132
+ removeItem(toastToRemove) {
133
+ if (!toastToRemove)
134
+ return;
135
+ this.toasts = this.toasts.filter((toast) => {
136
+ toast = Object.assign({}, toast);
137
+ delete toast.id;
138
+ return !Objects.shallowEqual(toast, toastToRemove, false);
139
+ });
124
140
  }
125
141
  };
126
142
  __decorate([
@@ -131,6 +147,5 @@ SonicToast = __decorate([
131
147
  ], SonicToast);
132
148
  export { SonicToast };
133
149
  if (typeof window !== "undefined") {
134
- let win = window;
135
- win.SonicToast = SonicToast;
150
+ window.SonicToast = SonicToast;
136
151
  }
@@ -2,6 +2,7 @@ import { LitElement } from "lit";
2
2
  export declare class Tooltip extends LitElement {
3
3
  static styles: import("lit").CSSResult[];
4
4
  label: string;
5
+ placement?: "top" | "bottom";
5
6
  disabled: boolean;
6
7
  render(): import("lit-html").TemplateResult<1>;
7
8
  }
@@ -15,22 +15,21 @@ let Tooltip = class Tooltip extends LitElement {
15
15
  }
16
16
  render() {
17
17
  let disabledClass = this.disabled || this.label == "" ? "disabled" : "";
18
- return html `<div
19
- data-tooltip-text="${this.label.trim().replace("&nbsp;", " ")}"
20
- class="tooltip ${disabledClass}"
21
- >
18
+ return html `<div data-tooltip-text="${this.label.trim().replace("&nbsp;", " ")}" class="tooltip ${disabledClass}">
22
19
  <slot></slot>
23
20
  </div>`;
24
21
  }
25
22
  };
26
23
  Tooltip.styles = [
27
24
  css `
28
- .tooltip {
25
+ :host {
29
26
  position: relative;
30
- display: flex;
27
+ display: inline-flex;
31
28
  align-items: center;
32
29
  text-align: center;
30
+ --sc-tooltip-fw: var(--sc-font-weight-base);
33
31
  }
32
+
34
33
  .tooltip:before {
35
34
  position: absolute;
36
35
  content: attr(data-tooltip-text);
@@ -38,9 +37,6 @@ Tooltip.styles = [
38
37
  display: block;
39
38
  opacity: 0;
40
39
  pointer-events: none;
41
- bottom: calc(100% + 0.25rem);
42
- left: 50%;
43
- transform: translateX(-50%);
44
40
  background: var(--sc-base-content, #111827);
45
41
  padding: 0.25rem;
46
42
  border-radius: 0.25rem;
@@ -50,16 +46,46 @@ Tooltip.styles = [
50
46
  line-height: 1.1;
51
47
  width: max-content;
52
48
  max-width: 20rem;
49
+ white-space: pre-line;
50
+ font-weight: var(--sc-tooltip-fw);
53
51
  }
54
52
  .tooltip:not(.disabled):hover:before {
55
53
  opacity: 1;
56
54
  display: block;
57
55
  }
56
+
57
+ :host(:not([placement])) .tooltip:before,
58
+ :host([placement="top"]) .tooltip:before {
59
+ bottom: calc(100% + 0.25rem);
60
+ left: 50%;
61
+ transform: translateX(-50%);
62
+ }
63
+
64
+ :host([placement="bottom"]) .tooltip:before {
65
+ top: calc(100% + 0.25rem);
66
+ left: 50%;
67
+ transform: translateX(-50%);
68
+ }
69
+
70
+ :host([placement="left"]) .tooltip:before {
71
+ top: 50%;
72
+ right: calc(100% + 0.25rem);
73
+ transform: translateY(-50%);
74
+ }
75
+
76
+ :host([placement="right"]) .tooltip:before {
77
+ top: 50%;
78
+ transform: translateY(-50%);
79
+ left: calc(100% + 0.25rem);
80
+ }
58
81
  `,
59
82
  ];
60
83
  __decorate([
61
84
  property({ type: String })
62
85
  ], Tooltip.prototype, "label", void 0);
86
+ __decorate([
87
+ property({ type: String, reflect: true })
88
+ ], Tooltip.prototype, "placement", void 0);
63
89
  __decorate([
64
90
  property({ type: Boolean })
65
91
  ], Tooltip.prototype, "disabled", void 0);
@@ -67,8 +93,3 @@ Tooltip = __decorate([
67
93
  customElement(tagName)
68
94
  ], Tooltip);
69
95
  export { Tooltip };
70
- //Ajout pour la creation du cem notamment pour Storybook
71
- try {
72
- customElements.define(tagName, Tooltip);
73
- }
74
- catch (e) { }
@@ -26,9 +26,6 @@ import "./loader/loader";
26
26
  import "./taxonomy/taxonomy";
27
27
  //Menu
28
28
  import "./menu/menu";
29
- //Tabs
30
- // import "./tabs/tabs";
31
- // import "./tabs/tab";
32
29
  // Misc
33
30
  import "./modal/modal";
34
31
  import "./alert/alert";
package/core/core.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import "./components/functional/functional";
2
2
  import "./components/ui/ui";
3
3
  import "./mixins/mixins";
4
- import { PublisherManager } from "@supersoniks/concorde/core/utils/PublisherProxy.mjs";
4
+ import { PublisherManager } from "@supersoniks/concorde/core/utils/PublisherProxy";
5
5
  import DataBindObserver from "./utils/DataBindObserver";
6
- let win = window;
7
- if (!win.SonicPublisherManager)
8
- win.SonicPublisherManager = PublisherManager;
9
- if (!win.SonicDataBindObserver)
10
- win.SonicDataBindObserver = DataBindObserver;
6
+ if (!window.SonicPublisherManager)
7
+ window.SonicPublisherManager = PublisherManager;
8
+ if (!window.SonicDataBindObserver)
9
+ window.SonicDataBindObserver = DataBindObserver;