@supersoniks/concorde 1.1.23 → 1.1.25

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 (101) hide show
  1. package/README.md +0 -0
  2. package/cli.js +0 -0
  3. package/concorde-core.bundle.js +25 -31
  4. package/concorde-core.es.js +25 -31
  5. package/core/components/functional/configuration/configuration.js +2 -1
  6. package/core/components/functional/date/date.js +2 -1
  7. package/core/components/functional/example/example.js +2 -1
  8. package/core/components/functional/fetch/fetch.d.ts +0 -31
  9. package/core/components/functional/fetch/fetch.js +3 -2
  10. package/core/components/functional/if/if.d.ts +0 -3
  11. package/core/components/functional/if/if.js +3 -2
  12. package/core/components/functional/list/list.d.ts +0 -17
  13. package/core/components/functional/list/list.js +4 -3
  14. package/core/components/functional/queue/queue.d.ts +1 -8
  15. package/core/components/functional/queue/queue.js +10 -2
  16. package/core/components/functional/router/redirect.d.ts +0 -9
  17. package/core/components/functional/router/redirect.js +3 -2
  18. package/core/components/functional/router/router.d.ts +0 -14
  19. package/core/components/functional/router/router.js +3 -2
  20. package/core/components/functional/sonic-scope/sonic-scope.js +2 -1
  21. package/core/components/functional/states/states.d.ts +0 -15
  22. package/core/components/functional/states/states.js +3 -2
  23. package/core/components/functional/submit/submit.d.ts +0 -11
  24. package/core/components/functional/submit/submit.js +3 -2
  25. package/core/components/functional/subscriber/subscriber.d.ts +0 -3
  26. package/core/components/functional/subscriber/subscriber.js +3 -2
  27. package/core/components/ui/alert/alert.js +11 -11
  28. package/core/components/ui/badge/badge.js +3 -2
  29. package/core/components/ui/button/button.d.ts +4 -8
  30. package/core/components/ui/button/button.js +16 -9
  31. package/core/components/ui/card/card-footer.js +7 -1
  32. package/core/components/ui/card/card-header-descripton.js +6 -1
  33. package/core/components/ui/card/card-header.js +7 -1
  34. package/core/components/ui/card/card-main.js +7 -1
  35. package/core/components/ui/card/card.js +7 -1
  36. package/core/components/ui/divider/divider.js +2 -1
  37. package/core/components/ui/form/checkbox/checkbox.d.ts +1 -20
  38. package/core/components/ui/form/checkbox/checkbox.js +4 -3
  39. package/core/components/ui/form/fieldset/fieldset.js +5 -3
  40. package/core/components/ui/form/fieldset/legend.d.ts +3 -2
  41. package/core/components/ui/form/fieldset/legend.js +24 -15
  42. package/core/components/ui/form/form-actions/form-actions.d.ts +5 -0
  43. package/core/components/ui/form/{form-layout → form-actions}/form-actions.js +13 -5
  44. package/core/components/ui/form/form-layout/form-layout.js +3 -2
  45. package/core/components/ui/form/input/input.d.ts +3 -10
  46. package/core/components/ui/form/input/input.js +3 -2
  47. package/core/components/ui/form/radio/radio.d.ts +0 -6
  48. package/core/components/ui/form/radio/radio.js +3 -2
  49. package/core/components/ui/form/select/select.d.ts +0 -7
  50. package/core/components/ui/form/select/select.js +4 -3
  51. package/core/components/ui/form/textarea/textarea.js +7 -1
  52. package/core/components/ui/group/group.js +3 -2
  53. package/core/components/ui/icon/icon.d.ts +0 -4
  54. package/core/components/ui/icon/icon.js +9 -5
  55. package/core/components/ui/icon/icons.js +43 -17
  56. package/core/components/ui/icon/icons.json +1 -1
  57. package/core/components/ui/image/image.js +3 -2
  58. package/core/components/ui/link/link.js +6 -1
  59. package/core/components/ui/loader/loader.js +3 -2
  60. package/core/components/ui/menu/menu-item.js +5 -4
  61. package/core/components/ui/menu/menu.d.ts +2 -1
  62. package/core/components/ui/menu/menu.js +18 -13
  63. package/core/components/ui/modal/modal-actions.js +3 -2
  64. package/core/components/ui/modal/modal-close.js +4 -3
  65. package/core/components/ui/modal/modal-content.js +3 -2
  66. package/core/components/ui/modal/modal-subtitle.js +3 -2
  67. package/core/components/ui/modal/modal-title.js +3 -2
  68. package/core/components/ui/modal/modal.js +5 -4
  69. package/core/components/ui/pop/pop.js +3 -2
  70. package/core/components/ui/progress/progress.js +29 -7
  71. package/core/components/ui/table/table-caption.js +20 -2
  72. package/core/components/ui/table/table-tbody.js +8 -2
  73. package/core/components/ui/table/table-td.d.ts +3 -2
  74. package/core/components/ui/table/table-td.js +19 -11
  75. package/core/components/ui/table/table-tfoot.js +7 -1
  76. package/core/components/ui/table/table-th.d.ts +3 -1
  77. package/core/components/ui/table/table-th.js +27 -13
  78. package/core/components/ui/table/table-thead.js +8 -2
  79. package/core/components/ui/table/table-tr.js +7 -1
  80. package/core/components/ui/table/table.js +15 -2
  81. package/core/components/ui/tabs/tabs.js +2 -3
  82. package/core/components/ui/taxonomy/taxonomy.js +2 -1
  83. package/core/components/ui/theme/css/tailwind.css +0 -0
  84. package/core/components/ui/theme/css/tailwind.d.ts +0 -0
  85. package/core/components/ui/theme/theme-collection/core-variables.js +9 -8
  86. package/core/components/ui/theme/theme-collection/dark.js +0 -4
  87. package/core/components/ui/theme/theme-collection/light.js +0 -1
  88. package/core/components/ui/theme/theme.d.ts +0 -1
  89. package/core/components/ui/theme/theme.js +3 -6
  90. package/core/components/ui/toast/message-subscriber.js +2 -1
  91. package/core/components/ui/toast/toast-item.d.ts +1 -0
  92. package/core/components/ui/toast/toast-item.js +61 -31
  93. package/core/components/ui/toast/toast.js +7 -6
  94. package/core/components/ui/tooltip/tooltip.js +7 -1
  95. package/core/components/ui/ui.d.ts +1 -0
  96. package/core/components/ui/ui.js +1 -0
  97. package/core/mixins/FormCheckable.d.ts +1 -0
  98. package/core/mixins/FormCheckable.js +12 -0
  99. package/mixins.d.ts +1 -0
  100. package/package.json +3 -3
  101. package/core/components/ui/form/form-layout/form-actions.d.ts +0 -6
@@ -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) { }
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { customElement } from "lit/decorators.js";
8
8
  import { Button } from "../button/button";
9
+ const tagName = "sonic-menu-item";
9
10
  let MenuItem = class MenuItem extends Button {
10
11
  constructor() {
11
12
  super();
@@ -20,18 +21,18 @@ let MenuItem = class MenuItem extends Button {
20
21
  if (!this.hasAttribute('shape')) {
21
22
  this.shape = "block";
22
23
  }
23
- if (!this.hasAttribute('textAlign')) {
24
- this.textAlign = "left";
24
+ if (!this.hasAttribute('align')) {
25
+ this.align = "left";
25
26
  }
26
27
  super.connectedCallback();
27
28
  }
28
29
  };
29
30
  MenuItem = __decorate([
30
- customElement("sonic-menu-item")
31
+ customElement(tagName)
31
32
  ], MenuItem);
32
33
  export { MenuItem };
33
34
  //Ajout pour Storybook
34
35
  try {
35
- customElements.define("sonic-menu-item", MenuItem);
36
+ customElements.define(tagName, MenuItem);
36
37
  }
37
38
  catch (e) { }
@@ -11,11 +11,12 @@ export declare class MenuItems extends LitElement {
11
11
  * Direction
12
12
  */
13
13
  direction: "row" | "column";
14
+ gap: string;
14
15
  align: "center" | "left" | "right";
15
16
  /**
16
17
  * Ombre
17
18
  */
18
- shadow: "" | "none" | "sm" | "md" | 'lg' | "xl";
19
+ shadow: "" | "sm" | "md" | 'lg' | "xl" | "none" | null;
19
20
  moreShape: "square" | "circle";
20
21
  /**
21
22
  * Propriété min-width du bouton
@@ -8,6 +8,7 @@ import { html, LitElement, css } from "lit";
8
8
  import { styleMap } from "lit/directives/style-map.js";
9
9
  import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
10
10
  import "./menu-item";
11
+ const tagName = "sonic-menu";
11
12
  let MenuItems = class MenuItems extends LitElement {
12
13
  constructor() {
13
14
  super(...arguments);
@@ -20,11 +21,12 @@ let MenuItems = class MenuItems extends LitElement {
20
21
  * Direction
21
22
  */
22
23
  this.direction = "column";
24
+ this.gap = "var(--sc-menu-gap)";
23
25
  this.align = "left";
24
26
  /**
25
27
  * Ombre
26
28
  */
27
- this.shadow = "none";
29
+ this.shadow = null;
28
30
  this.moreShape = "circle";
29
31
  /**
30
32
  * Propriété min-width du bouton
@@ -58,7 +60,7 @@ let MenuItems = class MenuItems extends LitElement {
58
60
  elt.setAttribute("size", this.size);
59
61
  }
60
62
  if (this.align) {
61
- elt.setAttribute("textAlign", this.align);
63
+ elt.setAttribute("align", this.align);
62
64
  }
63
65
  if (this.direction == "row") {
64
66
  if (elt.getAttribute('shape') == "block") {
@@ -71,6 +73,7 @@ let MenuItems = class MenuItems extends LitElement {
71
73
  const menuStyles = {
72
74
  minWidth: this.minWidth,
73
75
  flexDirection: this.direction,
76
+ gap: this.gap
74
77
  };
75
78
  const isMenuRow = this.direction == "row";
76
79
  const popStyles = {
@@ -85,8 +88,8 @@ let MenuItems = class MenuItems extends LitElement {
85
88
  return html `<menu part="menu" class="shadowable" style=${styleMap(menuStyles)}>
86
89
  <slot @slotchange=${this.mainSlotChange}></slot>
87
90
  <sonic-pop style=${styleMap(popStyles)} class=${!this.hasMoreElements ? 'hidden' : ''}>
88
- <sonic-menu-item style=${styleMap(popBtnStyles)} class="more-btn" shape=${this.moreShape} textAlign="center" >
89
- <sonic-icon prefix="iconoir" size="xl" name=${isMenuRow ? "more-vert" : "more-horiz"} ></sonic-icon>
91
+ <sonic-menu-item style=${styleMap(popBtnStyles)} class="more-btn" shape=${this.moreShape} align="center" >
92
+ <sonic-icon size="xl" name=${isMenuRow ? "more-vert" : "more-horiz"} ></sonic-icon>
90
93
  </sonic-menu-item>
91
94
  <slot name="more" @slotchange=${this.checkIfMore} slot="content"></slot>
92
95
  </sonic-pop>
@@ -97,6 +100,7 @@ MenuItems.styles = [
97
100
  css `
98
101
  :host {
99
102
  display: block;
103
+ --sc-menu-gap:.15rem;
100
104
  }
101
105
 
102
106
  :host > menu {
@@ -104,7 +108,6 @@ MenuItems.styles = [
104
108
  border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em);
105
109
  margin: 0;
106
110
  padding: 0.35em;
107
- gap: 0.15rem;
108
111
  }
109
112
 
110
113
  .hidden {
@@ -113,23 +116,22 @@ MenuItems.styles = [
113
116
 
114
117
  /*OMBRE*/
115
118
  :host([shadow]) .shadowable,
116
- :host([shadow="md"]) .shadowable,
117
- :host([shadow="true"]) .shadowable {
119
+ :host([shadow="md"]) .shadowable,
120
+ :host([shadow="true"]) .shadowable {
118
121
  box-shadow: var(--sc-shadow);
119
122
  }
120
123
 
121
- :host([shadow="sm"]) .shadowable {
124
+ :host([shadow="sm"]) .shadowable {
122
125
  box-shadow: var(--sc-shadow-sm);
123
126
  }
124
127
 
125
- :host([shadow="lg"]) .shadowable {
128
+ :host([shadow="lg"]) .shadowable {
126
129
  box-shadow: var(--sc-shadow-lg);
127
130
  }
128
131
 
129
- :host([shadow="none"]) .shadowable {
132
+ :host([shadow="none"]) .shadowable {
130
133
  box-shadow: none;
131
134
  }
132
-
133
135
 
134
136
  `,
135
137
  ];
@@ -139,6 +141,9 @@ __decorate([
139
141
  __decorate([
140
142
  property({ type: String, reflect: true })
141
143
  ], MenuItems.prototype, "direction", void 0);
144
+ __decorate([
145
+ property({ type: String })
146
+ ], MenuItems.prototype, "gap", void 0);
142
147
  __decorate([
143
148
  property({ type: String, reflect: true })
144
149
  ], MenuItems.prototype, "align", void 0);
@@ -161,11 +166,11 @@ __decorate([
161
166
  state()
162
167
  ], MenuItems.prototype, "hasMoreElements", void 0);
163
168
  MenuItems = __decorate([
164
- customElement("sonic-menu")
169
+ customElement(tagName)
165
170
  ], MenuItems);
166
171
  export { MenuItems };
167
172
  //Ajout pour la creation du cem notamment pour Storybook
168
173
  try {
169
- customElements.define("sonic-menu", MenuItems);
174
+ customElements.define(tagName, MenuItems);
170
175
  }
171
176
  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, queryAssignedElements } from "lit/decorators.js";
9
+ const tagName = "sonic-modal-actions";
9
10
  let ModalActions = class ModalActions extends LitElement {
10
11
  firstUpdated() {
11
12
  var _a;
@@ -36,11 +37,11 @@ __decorate([
36
37
  queryAssignedElements({ selector: "sonic-button" })
37
38
  ], ModalActions.prototype, "buttons", void 0);
38
39
  ModalActions = __decorate([
39
- customElement("sonic-modal-actions")
40
+ customElement(tagName)
40
41
  ], ModalActions);
41
42
  export { ModalActions };
42
43
  //Ajout pour Storybook
43
44
  try {
44
- customElements.define("sonic-modal-actions", ModalActions);
45
+ customElements.define(tagName, ModalActions);
45
46
  }
46
47
  catch (e) { }
@@ -6,10 +6,11 @@ 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-modal-close";
9
10
  let ModalClose = class ModalClose extends LitElement {
10
11
  render() {
11
12
  return html `<sonic-button shape="circle" variant="ghost" @click=${this.handleClick}
12
- ><sonic-icon prefix="iconoir" name="cancel" size="lg"></sonic-icon
13
+ ><sonic-icon name="cancel" size="lg"></sonic-icon
13
14
  ></sonic-button>`;
14
15
  }
15
16
  handleClick() {
@@ -28,11 +29,11 @@ ModalClose.styles = [
28
29
  `,
29
30
  ];
30
31
  ModalClose = __decorate([
31
- customElement("sonic-modal-close")
32
+ customElement(tagName)
32
33
  ], ModalClose);
33
34
  export { ModalClose };
34
35
  //Ajout pour Storybook
35
36
  try {
36
- customElements.define("sonic-modal-close", ModalClose);
37
+ customElements.define(tagName, ModalClose);
37
38
  }
38
39
  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-modal-content";
9
10
  let ModalContent = class ModalContent extends LitElement {
10
11
  render() {
11
12
  return html `<slot></slot>`;
@@ -19,11 +20,11 @@ ModalContent.styles = [
19
20
  `,
20
21
  ];
21
22
  ModalContent = __decorate([
22
- customElement("sonic-modal-content")
23
+ customElement(tagName)
23
24
  ], ModalContent);
24
25
  export { ModalContent };
25
26
  //Ajout pour Storybook
26
27
  try {
27
- customElements.define("sonic-modal-content", ModalContent);
28
+ customElements.define(tagName, ModalContent);
28
29
  }
29
30
  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-modal-subtitle";
9
10
  let ModalSubTitle = class ModalSubTitle extends LitElement {
10
11
  render() {
11
12
  return html `<slot></slot>`;
@@ -23,11 +24,11 @@ ModalSubTitle.styles = [
23
24
  `,
24
25
  ];
25
26
  ModalSubTitle = __decorate([
26
- customElement("sonic-modal-subtitle")
27
+ customElement(tagName)
27
28
  ], ModalSubTitle);
28
29
  export { ModalSubTitle };
29
30
  //Ajout pour Storybook
30
31
  try {
31
- customElements.define("sonic-modal-subtitle", ModalSubTitle);
32
+ customElements.define(tagName, ModalSubTitle);
32
33
  }
33
34
  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-modal-title";
9
10
  let ModalTitle = class ModalTitle extends LitElement {
10
11
  render() {
11
12
  return html `<slot></slot>`;
@@ -23,11 +24,11 @@ ModalTitle.styles = [
23
24
  `,
24
25
  ];
25
26
  ModalTitle = __decorate([
26
- customElement("sonic-modal-title")
27
+ customElement(tagName)
27
28
  ], ModalTitle);
28
29
  export { ModalTitle };
29
30
  //Ajout pour Storybook
30
31
  try {
31
- customElements.define("sonic-modal-title", ModalTitle);
32
+ customElements.define(tagName, ModalTitle);
32
33
  }
33
34
  catch (e) { }
@@ -14,6 +14,7 @@ import "./modal-title";
14
14
  import "./modal-subtitle";
15
15
  import "./modal-content";
16
16
  import "./modal-close";
17
+ const tagName = "sonic-modal";
17
18
  let Modal = class Modal extends Subscriber(LitElement) {
18
19
  constructor() {
19
20
  super(...arguments);
@@ -29,7 +30,7 @@ let Modal = class Modal extends Subscriber(LitElement) {
29
30
  this.visible = false;
30
31
  }
31
32
  static create(options) {
32
- const modal = document.createElement("sonic-modal");
33
+ const modal = document.createElement(tagName);
33
34
  modal.innerHTML =
34
35
  `<sonic-modal-close></sonic-modal-close><sonic-modal-content>${options.content}</sonic-modal-content>` || "";
35
36
  let container = document.querySelector("sonic-theme") || document.body;
@@ -126,7 +127,7 @@ let Modal = class Modal extends Subscriber(LitElement) {
126
127
  }
127
128
  handleEscape(e) {
128
129
  if (e.key === "Escape") {
129
- const modals = [...document.querySelectorAll("sonic-modal")];
130
+ const modals = [...document.querySelectorAll(tagName)];
130
131
  modals.forEach((item) => {
131
132
  if (this.hideOnEscape == true) {
132
133
  item.hide();
@@ -312,7 +313,7 @@ __decorate([
312
313
  queryAssignedElements({ selector: "sonic-modal-close" })
313
314
  ], Modal.prototype, "closeBtn", void 0);
314
315
  Modal = __decorate([
315
- customElement("sonic-modal")
316
+ customElement(tagName)
316
317
  ], Modal);
317
318
  export { Modal };
318
319
  if (typeof window !== "undefined") {
@@ -320,6 +321,6 @@ if (typeof window !== "undefined") {
320
321
  win.SonicModal = Modal;
321
322
  }
322
323
  try {
323
- customElements.define("sonic-modal", Modal);
324
+ customElements.define(tagName, Modal);
324
325
  }
325
326
  catch (e) { }
@@ -8,6 +8,7 @@ var Pop_1;
8
8
  import { html, LitElement, css } from "lit";
9
9
  import { customElement, query, state, property } from "lit/decorators.js";
10
10
  import HTML from "@supersoniks/concorde/core/utils/HTML";
11
+ const tagName = "sonic-pop";
11
12
  let Pop = Pop_1 = class Pop extends LitElement {
12
13
  constructor() {
13
14
  super(...arguments);
@@ -216,11 +217,11 @@ __decorate([
216
217
  property({ type: String })
217
218
  ], Pop.prototype, "placement", void 0);
218
219
  Pop = Pop_1 = __decorate([
219
- customElement("sonic-pop")
220
+ customElement(tagName)
220
221
  ], Pop);
221
222
  export { Pop };
222
223
  //Ajout pour la creation du cem notamment pour Storybook
223
224
  try {
224
- customElements.define("sonic-pop", Pop);
225
+ customElements.define(tagName, Pop);
225
226
  }
226
227
  catch (e) { }