@supersoniks/concorde 1.1.24 → 1.1.26

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 (108) hide show
  1. package/concorde-core.bundle.js +25 -31
  2. package/concorde-core.es.js +25 -31
  3. package/core/components/functional/configuration/configuration.js +2 -1
  4. package/core/components/functional/date/date.js +2 -1
  5. package/core/components/functional/example/example.js +2 -1
  6. package/core/components/functional/fetch/fetch.d.ts +0 -31
  7. package/core/components/functional/fetch/fetch.js +3 -2
  8. package/core/components/functional/if/if.d.ts +0 -3
  9. package/core/components/functional/if/if.js +3 -2
  10. package/core/components/functional/list/list.d.ts +3 -17
  11. package/core/components/functional/list/list.js +4 -3
  12. package/core/components/functional/queue/queue.d.ts +1 -8
  13. package/core/components/functional/queue/queue.js +10 -2
  14. package/core/components/functional/router/redirect.d.ts +0 -9
  15. package/core/components/functional/router/redirect.js +3 -2
  16. package/core/components/functional/router/router.d.ts +0 -14
  17. package/core/components/functional/router/router.js +3 -2
  18. package/core/components/functional/sonic-scope/sonic-scope.js +2 -1
  19. package/core/components/functional/states/states.d.ts +0 -15
  20. package/core/components/functional/states/states.js +3 -2
  21. package/core/components/functional/submit/submit.d.ts +0 -11
  22. package/core/components/functional/submit/submit.js +3 -2
  23. package/core/components/functional/subscriber/subscriber.d.ts +0 -3
  24. package/core/components/functional/subscriber/subscriber.js +3 -2
  25. package/core/components/ui/_css/scroll.d.ts +1 -0
  26. package/core/components/ui/_css/scroll.js +22 -0
  27. package/core/components/ui/_css/types.d.ts +2 -0
  28. package/core/components/ui/_css/types.js +60 -0
  29. package/core/components/ui/alert/alert.js +12 -12
  30. package/core/components/ui/badge/badge.js +3 -2
  31. package/core/components/ui/button/button.d.ts +4 -9
  32. package/core/components/ui/button/button.js +16 -13
  33. package/core/components/ui/card/card-footer.d.ts +0 -1
  34. package/core/components/ui/card/card-footer.js +14 -10
  35. package/core/components/ui/card/card-header-descripton.js +6 -1
  36. package/core/components/ui/card/card-header.js +7 -1
  37. package/core/components/ui/card/card-main.d.ts +0 -1
  38. package/core/components/ui/card/card-main.js +14 -10
  39. package/core/components/ui/card/card.js +7 -1
  40. package/core/components/ui/divider/divider.js +2 -1
  41. package/core/components/ui/form/checkbox/checkbox.d.ts +1 -20
  42. package/core/components/ui/form/checkbox/checkbox.js +23 -3
  43. package/core/components/ui/form/css/form-control.js +36 -33
  44. package/core/components/ui/form/fieldset/fieldset.d.ts +1 -1
  45. package/core/components/ui/form/fieldset/fieldset.js +5 -7
  46. package/core/components/ui/form/fieldset/legend.d.ts +5 -4
  47. package/core/components/ui/form/fieldset/legend.js +24 -20
  48. package/core/components/ui/form/form-actions/form-actions.d.ts +5 -0
  49. package/core/components/ui/form/{form-layout → form-actions}/form-actions.js +13 -5
  50. package/core/components/ui/form/form-layout/form-layout.js +3 -2
  51. package/core/components/ui/form/input/input.d.ts +3 -10
  52. package/core/components/ui/form/input/input.js +3 -2
  53. package/core/components/ui/form/radio/radio.d.ts +0 -6
  54. package/core/components/ui/form/radio/radio.js +3 -2
  55. package/core/components/ui/form/select/select.d.ts +0 -7
  56. package/core/components/ui/form/select/select.js +6 -4
  57. package/core/components/ui/form/textarea/textarea.js +10 -2
  58. package/core/components/ui/group/group.js +3 -2
  59. package/core/components/ui/icon/icon.d.ts +0 -4
  60. package/core/components/ui/icon/icon.js +9 -5
  61. package/core/components/ui/icon/icons.js +43 -17
  62. package/core/components/ui/icon/icons.json +1 -1
  63. package/core/components/ui/image/image.js +3 -2
  64. package/core/components/ui/link/link.js +6 -1
  65. package/core/components/ui/loader/loader.js +3 -2
  66. package/core/components/ui/menu/menu-item.js +5 -4
  67. package/core/components/ui/menu/menu.d.ts +2 -1
  68. package/core/components/ui/menu/menu.js +18 -13
  69. package/core/components/ui/modal/modal-actions.js +3 -2
  70. package/core/components/ui/modal/modal-close.js +4 -3
  71. package/core/components/ui/modal/modal-content.js +3 -2
  72. package/core/components/ui/modal/modal-subtitle.js +3 -2
  73. package/core/components/ui/modal/modal-title.js +3 -2
  74. package/core/components/ui/modal/modal.js +11 -24
  75. package/core/components/ui/pop/pop.js +3 -2
  76. package/core/components/ui/progress/progress.js +29 -7
  77. package/core/components/ui/table/table-caption.js +11 -2
  78. package/core/components/ui/table/table-tbody.js +8 -2
  79. package/core/components/ui/table/table-td.d.ts +4 -2
  80. package/core/components/ui/table/table-td.js +30 -13
  81. package/core/components/ui/table/table-tfoot.js +7 -1
  82. package/core/components/ui/table/table-th.d.ts +4 -1
  83. package/core/components/ui/table/table-th.js +41 -13
  84. package/core/components/ui/table/table-thead.js +8 -2
  85. package/core/components/ui/table/table-tr.js +9 -1
  86. package/core/components/ui/table/table.d.ts +2 -0
  87. package/core/components/ui/table/table.js +38 -3
  88. package/core/components/ui/tabs/tabs.js +3 -4
  89. package/core/components/ui/taxonomy/taxonomy.js +2 -1
  90. package/core/components/ui/theme/theme-collection/core-variables.js +12 -8
  91. package/core/components/ui/theme/theme-collection/dark.js +0 -4
  92. package/core/components/ui/theme/theme-collection/light.js +0 -1
  93. package/core/components/ui/theme/theme.d.ts +0 -1
  94. package/core/components/ui/theme/theme.js +3 -6
  95. package/core/components/ui/toast/message-subscriber.js +2 -1
  96. package/core/components/ui/toast/toast-item.d.ts +1 -0
  97. package/core/components/ui/toast/toast-item.js +51 -31
  98. package/core/components/ui/toast/toast.js +7 -6
  99. package/core/components/ui/tooltip/tooltip.js +7 -1
  100. package/core/components/ui/ui.d.ts +1 -0
  101. package/core/components/ui/ui.js +1 -0
  102. package/core/mixins/Fetcher.d.ts +3 -1
  103. package/core/mixins/Fetcher.js +3 -1
  104. package/core/mixins/FormElement.js +4 -0
  105. package/core/utils/api.d.ts +2 -2
  106. package/core/utils/api.js +7 -7
  107. package/package.json +7 -3
  108. package/core/components/ui/form/form-layout/form-actions.d.ts +0 -6
@@ -8,6 +8,7 @@ import { html, LitElement, css } 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
+ const tagName = "sonic-fieldset";
11
12
  let Fieldset = class Fieldset extends Subscriber(LitElement) {
12
13
  constructor() {
13
14
  super(...arguments);
@@ -16,10 +17,6 @@ let Fieldset = class Fieldset extends Subscriber(LitElement) {
16
17
  * Désactiver le fieldset
17
18
  */
18
19
  this.disabled = false;
19
- /**
20
- * Lier à un formulaire qui ne serait pas parent du fieldset
21
- */
22
- this.form = "";
23
20
  }
24
21
  render() {
25
22
  return html `<fieldset form="${ifDefined(this.form)}" ?disabled="${this.disabled}">
@@ -31,7 +28,7 @@ Fieldset.styles = [
31
28
  css `
32
29
  :host {
33
30
  --sc-fieldset-mt: 0;
34
- --sc-fieldset-mb: 2rem;
31
+ --sc-fieldset-mb: 1rem;
35
32
  --sc-fieldset-border-color: var(--sc-base-200);
36
33
  --sc-fieldset-border-width: var(--sc-form-border-width);
37
34
 
@@ -47,6 +44,7 @@ Fieldset.styles = [
47
44
  all: unset;
48
45
  display: contents;
49
46
  }
47
+
50
48
  ::slotted(sonic-legend) {
51
49
  margin-bottom: 1.5rem;
52
50
  display: block;
@@ -60,11 +58,11 @@ __decorate([
60
58
  property({ type: String })
61
59
  ], Fieldset.prototype, "form", void 0);
62
60
  Fieldset = __decorate([
63
- customElement("sonic-fieldset")
61
+ customElement(tagName)
64
62
  ], Fieldset);
65
63
  export { Fieldset };
66
64
  //Ajout pour la creation du cem notamment pour Storybook
67
65
  try {
68
- customElements.define("sonic-fieldset", Fieldset);
66
+ customElements.define(tagName, Fieldset);
69
67
  }
70
68
  catch (e) { }
@@ -2,9 +2,10 @@ import { LitElement } from "lit";
2
2
  import "@supersoniks/concorde/core/components/ui/form/fieldset/legend-description";
3
3
  export declare class Legend extends LitElement {
4
4
  static styles: import("lit").CSSResult[];
5
- description: string;
6
- label: string;
7
- iconName: string;
8
- iconPrefix: string;
5
+ description?: string;
6
+ label?: string;
7
+ iconName?: string;
8
+ iconLibrary?: string;
9
+ iconPrefix?: string;
9
10
  render(): import("lit-html").TemplateResult<1>;
10
11
  }
@@ -7,33 +7,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { html, LitElement, css } from "lit";
8
8
  import { customElement, property } from "lit/decorators.js";
9
9
  import "@supersoniks/concorde/core/components/ui/form/fieldset/legend-description";
10
+ import { ifDefined } from "lit/directives/if-defined.js";
11
+ const tagName = "sonic-legend";
10
12
  let Legend = class Legend extends LitElement {
11
- constructor() {
12
- super(...arguments);
13
- this.description = "";
14
- this.label = "";
15
- this.iconName = "";
16
- this.iconPrefix = "";
17
- }
18
13
  render() {
19
14
  return html `<legend part="legend">
20
-
21
- ${this.iconName ? html `<div class="icon"><sonic-icon name=${this.iconName} prefix=${this.iconPrefix}></sonic-icon></div>` : ""}
15
+ ${this.iconName
16
+ ? html `<div class="icon">
17
+ <sonic-icon
18
+ name=${this.iconName}
19
+ prefix=${ifDefined(this.iconPrefix)}
20
+ library=${ifDefined(this.iconLibrary)}></sonic-icon>
21
+ </div>`
22
+ : ""}
22
23
 
23
- <div class="legend-content">
24
- ${this.label}
25
- ${this.description ? html `<sonic-legend-description>${this.description}</sonic-legend-description>` : ""}
26
- <slot></slot>
27
- </div>
28
- <slot name="suffix"></slot>
29
- </legend>`;
24
+ <div class="legend-content">
25
+ ${this.label}
26
+ ${this.description ? html `<sonic-legend-description>${this.description}</sonic-legend-description>` : ""}
27
+ <slot></slot>
28
+ </div>
29
+ <slot name="suffix"></slot>
30
+ </legend>`;
30
31
  }
31
32
  };
32
33
  Legend.styles = [
33
34
  css `
34
35
  :host {
35
- --sc-legend-font-size: 1.875rem;
36
- --sc-legend-font-weight: var(--sc-headings-font-weight);
36
+ --sc-legend-font-size: 1.75rem;
37
+ --sc-legend-font-weight: var(--sc-font-weight-base);
37
38
  --sc-legend-font-style: var(--sc-headings-font-style);
38
39
  --sc-legend-family: var(--sc-headings-font-family);
39
40
  --sc-legend-line-height: var(--sc-headings-line-height);
@@ -74,15 +75,18 @@ __decorate([
74
75
  __decorate([
75
76
  property({ type: String })
76
77
  ], Legend.prototype, "iconName", void 0);
78
+ __decorate([
79
+ property({ type: String })
80
+ ], Legend.prototype, "iconLibrary", void 0);
77
81
  __decorate([
78
82
  property({ type: String })
79
83
  ], Legend.prototype, "iconPrefix", void 0);
80
84
  Legend = __decorate([
81
- customElement("sonic-legend")
85
+ customElement(tagName)
82
86
  ], Legend);
83
87
  export { Legend };
84
88
  //Ajout pour la creation du cem notamment pour Storybook
85
89
  try {
86
- customElements.define("sonic-legend", Legend);
90
+ customElements.define(tagName, Legend);
87
91
  }
88
92
  catch (e) { }
@@ -0,0 +1,5 @@
1
+ import { LitElement } from "lit";
2
+ export declare class FormActions extends LitElement {
3
+ static styles: import("lit").CSSResult[];
4
+ render(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -4,20 +4,28 @@ 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 } from "lit";
7
+ import { html, LitElement, css } from "lit";
8
8
  import { customElement } from "lit/decorators.js";
9
- import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
10
- let FormActions = class FormActions extends Subscriber(LitElement) {
9
+ const tagName = "sonic-form-actions";
10
+ let FormActions = class FormActions extends LitElement {
11
11
  render() {
12
12
  return html `<slot></slot>`;
13
13
  }
14
14
  };
15
+ FormActions.styles = [
16
+ css `
17
+ :host{
18
+ display:flex;
19
+ gap:.3rem;
20
+ }
21
+ `
22
+ ];
15
23
  FormActions = __decorate([
16
- customElement("sonic-form-actions")
24
+ customElement(tagName)
17
25
  ], FormActions);
18
26
  export { FormActions };
19
27
  //Ajout pour la creation du cem notamment pour Storybook
20
28
  try {
21
- customElements.define("sonic-form-actions", FormActions);
29
+ customElements.define(tagName, FormActions);
22
30
  }
23
31
  catch (e) { }
@@ -8,6 +8,7 @@ import { html, LitElement, css } from "lit";
8
8
  import { customElement } from "lit/decorators.js";
9
9
  import { ResizeController } from "@lit-labs/observers/resize_controller.js";
10
10
  import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
11
+ const tagName = "sonic-form-layout";
11
12
  let FormLayout = class FormLayout extends Subscriber(LitElement) {
12
13
  constructor() {
13
14
  super(...arguments);
@@ -48,11 +49,11 @@ FormLayout.styles = [
48
49
  `,
49
50
  ];
50
51
  FormLayout = __decorate([
51
- customElement("sonic-form-layout")
52
+ customElement(tagName)
52
53
  ], FormLayout);
53
54
  export { FormLayout };
54
55
  //Ajout pour la creation du cem notamment pour Storybook
55
56
  try {
56
- customElements.define("sonic-form-layout", FormLayout);
57
+ customElements.define(tagName, FormLayout);
57
58
  }
58
59
  catch (e) { }
@@ -35,6 +35,9 @@ declare const Input_base: {
35
35
  removeAttribute(name: string): void;
36
36
  initPublisher(): void;
37
37
  getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
38
+ /**
39
+ * Taille du composant, implique notamment des modifications de typo et de marge interne
40
+ */
38
41
  connectedCallback(): void;
39
42
  requestUpdate(): void;
40
43
  getAttribute(name: string): string;
@@ -42,16 +45,6 @@ declare const Input_base: {
42
45
  disconnectedCallback(): void;
43
46
  };
44
47
  } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
45
- /**
46
- * ### Le composent sonic-input étend les mixins FormInput, FormElement et Subscriber
47
- * **FormElement :**
48
- * * La propriété value est remplie automatiquement a l'aide de l'attribut name renseigné, ceci en prenant la valeur de la propriété du même nom dans les données du dataprovider associé.
49
- * * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
50
- * * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
51
- * * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
52
- * **FormInput :**
53
- * Uniquement des propriétés classiques d'un input HTML.
54
- */
55
48
  export declare class Input extends Input_base {
56
49
  static styles: import("lit").CSSResult[];
57
50
  /**
@@ -22,6 +22,7 @@ import { classMap } from "lit/directives/class-map.js";
22
22
  * **FormInput :**
23
23
  * Uniquement des propriétés classiques d'un input HTML.
24
24
  */
25
+ const tagName = "sonic-input";
25
26
  let Input = class Input extends FormInput(FormElement(Subscriber(LitElement))) {
26
27
  constructor() {
27
28
  super(...arguments);
@@ -170,11 +171,11 @@ __decorate([
170
171
  state()
171
172
  ], Input.prototype, "hasPrefix", void 0);
172
173
  Input = __decorate([
173
- customElement("sonic-input")
174
+ customElement(tagName)
174
175
  ], Input);
175
176
  export { Input };
176
177
  //Ajout pour Storybook
177
178
  try {
178
- customElements.define("sonic-input", Input);
179
+ customElements.define(tagName, Input);
179
180
  }
180
181
  catch (e) { }
@@ -1,10 +1,4 @@
1
1
  import { Checkbox } from "../checkbox/checkbox";
2
- /**
3
- * ### Le composant sonic-radio étend sonic-checkbox en assignant sa propriété radio à true.
4
- *
5
- * * Le type d'input html utilisé passe également de checkbox à radio.
6
- * * Le comportement est donc similaire à un bouton radio classique mais avec les fonctionnalités de sonic-checkbox (ie : Subscriber / FormElement / FormCheckable).
7
- */
8
2
  export declare class Radio extends Checkbox {
9
3
  static styles: (import("lit").CSSResult | import("lit").CSSResultGroup[])[];
10
4
  constructor();
@@ -13,6 +13,7 @@ import { Checkbox } from "../checkbox/checkbox";
13
13
  * * Le type d'input html utilisé passe également de checkbox à radio.
14
14
  * * Le comportement est donc similaire à un bouton radio classique mais avec les fonctionnalités de sonic-checkbox (ie : Subscriber / FormElement / FormCheckable).
15
15
  */
16
+ const tagName = "sonic-radio";
16
17
  let Radio = class Radio extends Checkbox {
17
18
  constructor() {
18
19
  super();
@@ -45,11 +46,11 @@ Radio.styles = [
45
46
  `,
46
47
  ];
47
48
  Radio = __decorate([
48
- customElement("sonic-radio")
49
+ customElement(tagName)
49
50
  ], Radio);
50
51
  export { Radio };
51
52
  //Ajout pour Storybook
52
53
  try {
53
- customElements.define("sonic-radio", Radio);
54
+ customElements.define(tagName, Radio);
54
55
  }
55
56
  catch (e) { }
@@ -1,13 +1,6 @@
1
1
  import { LitElement } from "lit";
2
2
  import "@supersoniks/concorde/core/components/ui/icon/icon";
3
3
  declare const Select_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
4
- /**
5
- * #### FormElement :
6
- * * La propriété value est remplie automatiquement a l'aide de l'attribut name renseigné, ceci en prenant la valeur de la propriété du même nom dans les données du dataprovider associé.
7
- * * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
8
- * * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
9
- * * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
10
- */
11
4
  export declare class Select extends Select_base {
12
5
  static styles: import("lit").CSSResult[];
13
6
  valueKey: string;
@@ -21,6 +21,7 @@ import "@supersoniks/concorde/core/components/ui/icon/icon";
21
21
  * * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
22
22
  * * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
23
23
  */
24
+ const tagName = "sonic-select";
24
25
  let Select = class Select extends FormElement(Subscriber(LitElement)) {
25
26
  constructor() {
26
27
  super(...arguments);
@@ -131,7 +132,7 @@ let Select = class Select extends FormElement(Subscriber(LitElement)) {
131
132
  })}
132
133
  <slot></slot>
133
134
  </select>
134
- <sonic-icon prefix="iconoir" name="nav-arrow-down" size="${this.size}"></sonic-icon>
135
+ <sonic-icon class="select-chevron" name="nav-arrow-down" size="${this.size}"></sonic-icon>
135
136
  </div>
136
137
  <slot name="suffix" @slotchange=${this.onSlotChange}></slot>
137
138
  </div>
@@ -153,12 +154,14 @@ Select.styles = [
153
154
  position: relative;
154
155
  width: 100%;
155
156
  }
157
+
156
158
  sonic-icon {
157
159
  position: absolute;
158
160
  right: 1em;
159
161
  top: 50%;
160
162
  pointer-events: none;
161
163
  transform: translateY(-50%);
164
+ color:var(--sc-input-color);
162
165
  }
163
166
 
164
167
  option {
@@ -166,7 +169,6 @@ Select.styles = [
166
169
  color: var(--sc-base-content);
167
170
  background: var(--sc-base);
168
171
  }
169
-
170
172
 
171
173
  `,
172
174
  ];
@@ -222,11 +224,11 @@ __decorate([
222
224
  state()
223
225
  ], Select.prototype, "hasPrefix", void 0);
224
226
  Select = __decorate([
225
- customElement("sonic-select")
227
+ customElement(tagName)
226
228
  ], Select);
227
229
  export { Select };
228
230
  //Ajout pour Storybook
229
231
  try {
230
- customElements.define("sonic-select", Select);
232
+ customElements.define(tagName, Select);
231
233
  }
232
234
  catch (e) { }
@@ -11,6 +11,8 @@ import { formControl } from "../css/form-control";
11
11
  import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
12
12
  import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
13
13
  import FormInput from "@supersoniks/concorde/core/mixins/FormInput";
14
+ import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
15
+ const tagName = "sonic-textarea";
14
16
  let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElement))) {
15
17
  constructor() {
16
18
  super(...arguments);
@@ -76,7 +78,7 @@ let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElemen
76
78
  ?readonly=${this.readonly}
77
79
  spellcheck=${ifDefined(this.spellcheck)}
78
80
  wrap=${ifDefined(this.wrap)}
79
- class="form-element textarea"
81
+ class="form-element textarea custom-scroll"
80
82
  placeholder="${this.placeholder}"
81
83
  >
82
84
  ${this.value}</textarea
@@ -91,6 +93,7 @@ ${this.value}</textarea
91
93
  };
92
94
  Textarea.styles = [
93
95
  formControl,
96
+ customScroll,
94
97
  css `
95
98
  textarea {
96
99
  font-size: inherit;
@@ -155,6 +158,11 @@ __decorate([
155
158
  property()
156
159
  ], Textarea.prototype, "slotClasses", void 0);
157
160
  Textarea = __decorate([
158
- customElement("sonic-textarea")
161
+ customElement(tagName)
159
162
  ], Textarea);
160
163
  export { Textarea };
164
+ //Ajout pour Storybook
165
+ try {
166
+ customElements.define(tagName, Textarea);
167
+ }
168
+ catch (e) { }
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html, LitElement, css } from "lit";
8
8
  import { customElement } from "lit/decorators.js";
9
+ const tagName = "sonic-group";
9
10
  let Group = class Group extends LitElement {
10
11
  updated() {
11
12
  const children = this.querySelectorAll("sonic-input, sonic-button");
@@ -48,10 +49,10 @@ Group.styles = [
48
49
  `,
49
50
  ];
50
51
  Group = __decorate([
51
- customElement("sonic-group")
52
+ customElement(tagName)
52
53
  ], Group);
53
54
  export { Group };
54
55
  try {
55
- customElements.define("sonic-group", Group);
56
+ customElements.define(tagName, Group);
56
57
  }
57
58
  catch (e) { }
@@ -1,8 +1,4 @@
1
1
  import { LitElement } from "lit";
2
- /**
3
- * Afficher l'icone choisie parmis une liste prédéfinie dans icons.json
4
- * les tailles suivantes sont disponible via l'attribut *size* : 2xs,xs,sm,"",lg,xl,2xl
5
- */
6
2
  export declare class Icon extends LitElement {
7
3
  static styles: import("lit").CSSResult;
8
4
  updateIcon(): Promise<void>;
@@ -14,14 +14,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
14
  });
15
15
  };
16
16
  import { LitElement, css, nothing } from "lit";
17
- import { property } from "lit/decorators.js";
17
+ import { customElement, property } from "lit/decorators.js";
18
18
  import Icons from "./icons";
19
19
  /**
20
20
  * Afficher l'icone choisie parmis une liste prédéfinie dans icons.json
21
21
  * les tailles suivantes sont disponible via l'attribut *size* : 2xs,xs,sm,"",lg,xl,2xl
22
22
  */
23
- // @customElement("sonic-icon")
24
- export class Icon extends LitElement {
23
+ const tagName = "sonic-icon";
24
+ let Icon = class Icon extends LitElement {
25
25
  constructor() {
26
26
  super(...arguments);
27
27
  this.iconText = "";
@@ -75,7 +75,7 @@ export class Icon extends LitElement {
75
75
  this.style.removeProperty("display");
76
76
  return this.iconText;
77
77
  }
78
- }
78
+ };
79
79
  Icon.styles = css `
80
80
  :host {
81
81
  line-height: 0;
@@ -129,8 +129,12 @@ __decorate([
129
129
  __decorate([
130
130
  property({ type: String })
131
131
  ], Icon.prototype, "library", null);
132
+ Icon = __decorate([
133
+ customElement(tagName)
134
+ ], Icon);
135
+ export { Icon };
132
136
  //Ajout pour la creation du cem notamment pour Storybook
133
137
  try {
134
- customElements.define("sonic-icon", Icon);
138
+ customElements.define(tagName, Icon);
135
139
  }
136
140
  catch (e) { }
@@ -21,12 +21,35 @@ const loadingGetPromises = new Map();
21
21
  * la propriété library de sonic-icon correspond à une clef de librairies.
22
22
  */
23
23
  const libraries = {
24
- heroicons: "https://cdn.jsdelivr.net/npm/heroicons@2.0.4/24/$prefix/$name.svg",
25
- iconoir: "https://cdnjs.cloudflare.com/ajax/libs/iconoir/5.1.4/icons/$name.svg",
26
- feathers: "https://cdn.jsdelivr.net/npm/feather-icons@4.29.0/dist/icons/$name.svg",
27
- material: "https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.5/svg/$name/$prefix.svg",
28
- fontAwesome: "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/svgs/$prefix/$name.svg",
24
+ heroicons: {
25
+ url: "https://cdn.jsdelivr.net/npm/heroicons@2.0.4/24/$prefix/$name.svg",
26
+ defaultPrefix: "outline",
27
+ },
28
+ iconoir: {
29
+ url: "https://cdnjs.cloudflare.com/ajax/libs/iconoir/5.1.4/icons/$name.svg",
30
+ },
31
+ feathers: {
32
+ url: "https://cdn.jsdelivr.net/npm/feather-icons@4.29.0/dist/icons/$name.svg",
33
+ },
34
+ material: {
35
+ url: "https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.5/svg/$name/$prefix.svg",
36
+ defaultPrefix: "regular",
37
+ },
38
+ fontAwesome: {
39
+ url: "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/svgs/$prefix/$name.svg",
40
+ defaultPrefix: "regular",
41
+ },
29
42
  };
43
+ let hasEnabledCustomLibrary = false;
44
+ function enableCustomLibrary() {
45
+ var _b, _c;
46
+ if (hasEnabledCustomLibrary)
47
+ return;
48
+ hasEnabledCustomLibrary = true;
49
+ libraries.custom = {};
50
+ libraries.custom.url = (_b = document.querySelector("[customIconLibraryPath]")) === null || _b === void 0 ? void 0 : _b.getAttribute("customIconLibraryPath");
51
+ libraries.custom.defaultPrefix = (_c = document.querySelector("[customIconDefaultPrefix]")) === null || _c === void 0 ? void 0 : _c.getAttribute("customIconDefaultPrefix");
52
+ }
30
53
  export default class Icons {
31
54
  static registerIcons(newIcons) {
32
55
  const record = icons;
@@ -43,29 +66,32 @@ export default class Icons {
43
66
  _a = Icons;
44
67
  Icons.fontAwesomeNext = {
45
68
  get: (params) => __awaiter(void 0, void 0, void 0, function* () {
46
- var _b;
47
- let prefix = ((_b = params.prefix) === null || _b === void 0 ? void 0 : _b.replace("far", "regular").replace("fas", "solid")) || "regular";
48
69
  let library = params.library;
49
70
  let name = params.name || "";
50
71
  const iconsAsRecord = icons;
51
72
  /**
52
73
  * SVGS en ligne
53
74
  */
75
+ if (library == "custom") {
76
+ enableCustomLibrary();
77
+ }
54
78
  if (library && libraries[library]) {
55
- let libIcons = iconsAsRecord[library];
56
- if (!libIcons)
57
- libIcons = iconsAsRecord[library] = {};
79
+ let libraryItem = libraries[library];
80
+ let prefix = params.prefix || libraryItem.defaultPrefix;
81
+ let libIcons = iconsAsRecord[library] || {};
82
+ let libIconsKey = prefix + "-" + name;
83
+ // if(!libIcons )libIcons = iconsAsRecord[library] = {};
58
84
  /**
59
85
  * Si l'icone a déjà été chargée on ne la recharge pas
60
86
  */
61
- if (libIcons[name])
62
- return unsafeHTML(libIcons[name]);
63
- let url = libraries[library].replace("$prefix", params.prefix).replace("$name", name);
87
+ if (libIcons[libIconsKey])
88
+ return unsafeHTML(libIcons[libIconsKey]);
89
+ let url = libraryItem.url.replace("$prefix", prefix).replace("$name", name);
64
90
  /**
65
91
  * on utilise une promise mutualisée pour ne pas faire plusieurs appels concurents d'une même icone
66
92
  */
67
- if (libIcons[name])
68
- return unsafeHTML(libIcons[name]);
93
+ if (libIcons[libIconsKey])
94
+ return unsafeHTML(libIcons[libIconsKey]);
69
95
  if (!loadingGetPromises.has(url)) {
70
96
  let promise = new Promise((resolve) => __awaiter(void 0, void 0, void 0, function* () {
71
97
  let result = yield fetch(url);
@@ -84,13 +110,13 @@ Icons.fontAwesomeNext = {
84
110
  */
85
111
  let result = yield loadingGetPromises.get(url);
86
112
  loadingGetPromises.delete(url);
87
- libIcons[name] = result;
113
+ libIcons[libIconsKey] = result;
88
114
  return unsafeHTML(result);
89
115
  }
90
116
  /**
91
117
  * svgs "locaux"
92
118
  */
93
- return unsafeHTML(iconsAsRecord[prefix][params.name] || "");
119
+ return unsafeHTML(iconsAsRecord["core"][params.name] || "");
94
120
  }),
95
121
  };
96
122
  Icons.default = Icons.fontAwesomeNext;
@@ -1 +1 @@
1
- {"iconoir":{"cancel":"<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","check-circled-outline":"<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7 12.5L10 15.5L17 8.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","check":"<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5 13L9 17L19 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","emoji-think-left":"<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M10 15H7M2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5C9 8.77614 8.77614 9 8.5 9Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M15.5 9C15.2239 9 15 8.77614 15 8.5C15 8.22386 15.2239 8 15.5 8C15.7761 8 16 8.22386 16 8.5C16 8.77614 15.7761 9 15.5 9Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","info-empty":"<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12 11.5V16.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 7.51L12.01 7.49889\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","loader":"","more-horiz":"<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M18 12.5C18.2761 12.5 18.5 12.2761 18.5 12C18.5 11.7239 18.2761 11.5 18 11.5C17.7239 11.5 17.5 11.7239 17.5 12C17.5 12.2761 17.7239 12.5 18 12.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M6 12.5C6.27614 12.5 6.5 12.2761 6.5 12C6.5 11.7239 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.7239 5.5 12C5.5 12.2761 5.72386 12.5 6 12.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","more-vert":"<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 18.5C12.2761 18.5 12.5 18.2761 12.5 18C12.5 17.7239 12.2761 17.5 12 17.5C11.7239 17.5 11.5 17.7239 11.5 18C11.5 18.2761 11.7239 18.5 12 18.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 6.5C12.2761 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.2761 5.5 12 5.5C11.7239 5.5 11.5 5.72386 11.5 6C11.5 6.27614 11.7239 6.5 12 6.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","nav-arrow-down":"<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M6 9L12 15L18 9\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","warning-circled-outline":"<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12 7L12 13\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 17.01L12.01 16.9989\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n"}}
1
+ {}
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { html, LitElement, css } from "lit";
8
8
  import { customElement, property } from "lit/decorators.js";
9
9
  import { styleMap } from "lit/directives/style-map.js";
10
+ const tagName = "sonic-image";
10
11
  let Image = class Image extends LitElement {
11
12
  constructor() {
12
13
  super(...arguments);
@@ -142,11 +143,11 @@ __decorate([
142
143
  property({ type: Boolean, reflect: true })
143
144
  ], Image.prototype, "cover", void 0);
144
145
  Image = __decorate([
145
- customElement("sonic-image")
146
+ customElement(tagName)
146
147
  ], Image);
147
148
  export { Image };
148
149
  //Ajout pour la creation du cem notamment pour Storybook
149
150
  try {
150
- customElements.define("sonic-image", Image);
151
+ customElements.define(tagName, Image);
151
152
  }
152
153
  catch (e) { }
@@ -9,6 +9,7 @@ import { html, LitElement, css } from "lit";
9
9
  import { customElement, property } from "lit/decorators.js";
10
10
  import { ifDefined } from "lit/directives/if-defined.js";
11
11
  import Electron from "@supersoniks/concorde/core/utils/Electron";
12
+ const tagName = "sonic-link";
12
13
  let Link = class Link extends LitElement {
13
14
  constructor() {
14
15
  super(...arguments);
@@ -89,6 +90,10 @@ __decorate([
89
90
  property({ type: Boolean })
90
91
  ], Link.prototype, "pushState", void 0);
91
92
  Link = __decorate([
92
- customElement("sonic-link")
93
+ customElement(tagName)
93
94
  ], Link);
94
95
  export { Link };
96
+ try {
97
+ customElements.define(tagName, Link);
98
+ }
99
+ catch (e) { }
@@ -9,6 +9,7 @@ import { html, LitElement, css } from "lit";
9
9
  import { customElement, property } from "lit/decorators.js";
10
10
  import { inline } from "./styles/inline";
11
11
  import { fixed } from "./styles/fixed";
12
+ const tagName = "sonic-loader";
12
13
  let Loader = Loader_1 = class Loader extends LitElement {
13
14
  constructor() {
14
15
  super(...arguments);
@@ -84,11 +85,11 @@ __decorate([
84
85
  property({ type: String })
85
86
  ], Loader.prototype, "mode", void 0);
86
87
  Loader = Loader_1 = __decorate([
87
- customElement("sonic-loader")
88
+ customElement(tagName)
88
89
  ], Loader);
89
90
  export { Loader };
90
91
  //Ajout pour la creation du cem notamment pour Storybook
91
92
  try {
92
- customElements.define("sonic-loader", Loader);
93
+ customElements.define(tagName, Loader);
93
94
  }
94
95
  catch (e) { }