@supersoniks/concorde 1.0.7 → 1.1.1

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 (175) hide show
  1. package/README.md +16 -8
  2. package/cli.js +69 -0
  3. package/core/components/functional/date/date.d.ts +34 -0
  4. package/core/components/functional/date/date.js +187 -0
  5. package/core/components/functional/example/example.d.ts +7 -0
  6. package/core/components/functional/example/example.js +25 -0
  7. package/core/components/functional/fetch/fetch.d.ts +49 -0
  8. package/core/components/functional/fetch/fetch.js +38 -0
  9. package/core/components/functional/functional.d.ts +11 -0
  10. package/core/components/functional/functional.js +11 -0
  11. package/core/components/functional/if/if.d.ts +12 -0
  12. package/core/components/functional/if/if.js +43 -0
  13. package/core/components/functional/list/list.d.ts +67 -0
  14. package/core/components/functional/list/list.js +132 -0
  15. package/core/components/functional/queue/queue.d.ts +42 -0
  16. package/core/components/functional/queue/queue.js +184 -0
  17. package/core/components/functional/router/redirect.d.ts +18 -0
  18. package/core/components/functional/router/redirect.js +57 -0
  19. package/core/components/functional/router/router.d.ts +26 -0
  20. package/core/components/functional/router/router.js +104 -0
  21. package/core/components/functional/states/states.d.ts +28 -0
  22. package/core/components/functional/states/states.js +139 -0
  23. package/core/components/functional/submit/submit.d.ts +24 -0
  24. package/core/components/functional/submit/submit.js +108 -0
  25. package/{types/core/components → core/components/functional/subscriber}/subscriber.d.ts +5 -1
  26. package/core/components/functional/subscriber/subscriber.js +30 -0
  27. package/core/components/ui/alert/alert.d.ts +20 -0
  28. package/core/components/ui/alert/alert.js +150 -0
  29. package/core/components/ui/badge/badge.d.ts +24 -0
  30. package/core/components/ui/badge/badge.js +177 -0
  31. package/core/components/ui/button/button.d.ts +125 -0
  32. package/core/components/ui/button/button.js +558 -0
  33. package/core/components/ui/divider/divider.d.ts +11 -0
  34. package/core/components/ui/divider/divider.js +144 -0
  35. package/core/components/ui/form/checkbox/checkbox.d.ts +120 -0
  36. package/core/components/ui/form/checkbox/checkbox.js +203 -0
  37. package/core/components/ui/form/css/form-control.d.ts +1 -0
  38. package/core/components/ui/form/css/form-control.js +219 -0
  39. package/core/components/ui/form/fieldset/fieldset.d.ts +15 -0
  40. package/core/components/ui/form/fieldset/fieldset.js +70 -0
  41. package/core/components/ui/form/fieldset/legend.d.ts +11 -0
  42. package/core/components/ui/form/fieldset/legend.js +92 -0
  43. package/core/components/ui/form/form-layout/form-actions.d.ts +6 -0
  44. package/core/components/ui/form/form-layout/form-actions.js +23 -0
  45. package/core/components/ui/form/form-layout/form-layout.d.ts +9 -0
  46. package/core/components/ui/form/form-layout/form-layout.js +58 -0
  47. package/core/components/ui/form/input/input.d.ts +84 -0
  48. package/core/components/ui/form/input/input.js +180 -0
  49. package/core/components/ui/form/radio/radio.d.ts +12 -0
  50. package/core/components/ui/form/radio/radio.js +55 -0
  51. package/core/components/ui/form/select/select.d.ts +39 -0
  52. package/core/components/ui/form/select/select.js +220 -0
  53. package/core/components/ui/form/textarea/textarea.d.ts +69 -0
  54. package/core/components/ui/form/textarea/textarea.js +150 -0
  55. package/core/components/ui/group/group.d.ts +6 -0
  56. package/core/components/ui/group/group.js +57 -0
  57. package/core/components/ui/icon/icon.d.ts +17 -0
  58. package/core/components/ui/icon/icon.js +93 -0
  59. package/core/components/ui/icon/icons.d.ts +13 -0
  60. package/core/components/ui/icon/icons.js +25 -0
  61. package/core/components/ui/icon/icons.json +1 -0
  62. package/core/components/ui/image/image.d.ts +14 -0
  63. package/core/components/ui/image/image.js +152 -0
  64. package/core/components/ui/link/link.d.ts +16 -0
  65. package/core/components/ui/link/link.js +70 -0
  66. package/core/components/ui/loader/loader.d.ts +20 -0
  67. package/core/components/ui/loader/loader.js +94 -0
  68. package/{types → core}/components/ui/loader/styles/fixed.d.ts +0 -0
  69. package/core/components/ui/loader/styles/fixed.js +57 -0
  70. package/{types → core}/components/ui/loader/styles/inline.d.ts +0 -0
  71. package/core/components/ui/loader/styles/inline.js +71 -0
  72. package/core/components/ui/menu/menu-item.d.ts +5 -0
  73. package/core/components/ui/menu/menu-item.js +37 -0
  74. package/core/components/ui/menu/menu.d.ts +26 -0
  75. package/core/components/ui/menu/menu.js +125 -0
  76. package/core/components/ui/modal/modal-actions.d.ts +7 -0
  77. package/core/components/ui/modal/modal-actions.js +46 -0
  78. package/core/components/ui/modal/modal-close.d.ts +6 -0
  79. package/core/components/ui/modal/modal-close.js +38 -0
  80. package/core/components/ui/modal/modal-content.d.ts +5 -0
  81. package/core/components/ui/modal/modal-content.js +29 -0
  82. package/core/components/ui/modal/modal-subtitle.d.ts +5 -0
  83. package/core/components/ui/modal/modal-subtitle.js +33 -0
  84. package/core/components/ui/modal/modal-title.d.ts +5 -0
  85. package/core/components/ui/modal/modal-title.js +33 -0
  86. package/core/components/ui/modal/modal.d.ts +36 -0
  87. package/core/components/ui/modal/modal.js +325 -0
  88. package/core/components/ui/pop/pop.d.ts +28 -0
  89. package/core/components/ui/pop/pop.js +223 -0
  90. package/core/components/ui/tabs/tab.d.ts +6 -0
  91. package/core/components/ui/tabs/tab.js +46 -0
  92. package/core/components/ui/tabs/tabs.d.ts +14 -0
  93. package/core/components/ui/tabs/tabs.js +127 -0
  94. package/core/components/ui/taxonomy/taxonomy.d.ts +41 -0
  95. package/core/components/ui/taxonomy/taxonomy.js +113 -0
  96. package/core/components/ui/theme/css/tailwind.css +3 -0
  97. package/core/components/ui/theme/css/tailwind.d.ts +2 -0
  98. package/core/components/ui/theme/theme-collection/core-variables.d.ts +1 -0
  99. package/core/components/ui/theme/theme-collection/core-variables.js +50 -0
  100. package/{types/components → core/components/ui}/theme/theme-collection/dark.d.ts +0 -0
  101. package/core/components/ui/theme/theme-collection/dark.js +41 -0
  102. package/{types/components → core/components/ui}/theme/theme-collection/light.d.ts +0 -0
  103. package/core/components/ui/theme/theme-collection/light.js +35 -0
  104. package/core/components/ui/theme/theme.d.ts +11 -0
  105. package/core/components/ui/theme/theme.js +105 -0
  106. package/core/components/ui/toast/message-subscriber.d.ts +17 -0
  107. package/core/components/ui/toast/message-subscriber.js +85 -0
  108. package/{types → core}/components/ui/toast/toast.d.ts +10 -8
  109. package/core/components/ui/toast/toast.js +260 -0
  110. package/core/components/ui/tooltip/tooltip.d.ts +7 -0
  111. package/core/components/ui/tooltip/tooltip.js +68 -0
  112. package/core/components/ui/ui.d.ts +27 -0
  113. package/core/components/ui/ui.js +34 -0
  114. package/core/core.d.ts +3 -0
  115. package/core/core.js +7 -0
  116. package/core/mixins/Fetcher.d.ts +69 -0
  117. package/core/mixins/Fetcher.js +147 -0
  118. package/core/mixins/FormCheckable.d.ts +72 -0
  119. package/core/mixins/FormCheckable.js +144 -0
  120. package/core/mixins/FormElement.d.ts +21 -0
  121. package/core/mixins/FormElement.js +229 -0
  122. package/core/mixins/FormInput.d.ts +49 -0
  123. package/core/mixins/FormInput.js +33 -0
  124. package/core/mixins/Subscriber.d.ts +30 -0
  125. package/core/mixins/Subscriber.js +379 -0
  126. package/core/mixins/TemplatesContainer.d.ts +12 -0
  127. package/core/mixins/TemplatesContainer.js +60 -0
  128. package/core/mixins/mixins.d.ts +6 -0
  129. package/core/mixins/mixins.js +6 -0
  130. package/core/utils/Arrays.d.ts +97 -0
  131. package/core/utils/Arrays.js +136 -0
  132. package/core/utils/DataBindObserver.d.ts +74 -0
  133. package/core/utils/DataBindObserver.js +252 -0
  134. package/core/utils/Format.d.ts +11 -0
  135. package/core/utils/Format.js +22 -0
  136. package/core/utils/HTML.d.ts +13 -0
  137. package/core/utils/HTML.js +26 -0
  138. package/core/utils/LocationHandler.d.ts +44 -0
  139. package/core/utils/LocationHandler.js +96 -0
  140. package/core/utils/Objects.d.ts +23 -0
  141. package/core/utils/Objects.js +63 -0
  142. package/core/utils/PublisherProxy.d.mts +110 -0
  143. package/core/utils/PublisherProxy.mjs +371 -0
  144. package/core/utils/api.d.ts +66 -0
  145. package/core/utils/api.js +145 -0
  146. package/package.json +159 -21
  147. package/LICENSE +0 -43
  148. package/dist/concorde.bundle.js +0 -3620
  149. package/types/components/event/event-card/event-card.d.ts +0 -10
  150. package/types/components/event/event-title/event-title.d.ts +0 -7
  151. package/types/components/event/event.d.ts +0 -8
  152. package/types/components/giftcards/giftcard/giftcard.d.ts +0 -15
  153. package/types/components/illustration/illustration.d.ts +0 -16
  154. package/types/components/product/prices-form/price-button/price-button.d.ts +0 -25
  155. package/types/components/product/prices-form/prices-form.d.ts +0 -23
  156. package/types/components/theme/theme-collection/bootstrap5.d.ts +0 -1
  157. package/types/components/theme/theme-collection/dracula.d.ts +0 -1
  158. package/types/components/theme/theme.d.ts +0 -8
  159. package/types/components/ui/button/button.d.ts +0 -13
  160. package/types/components/ui/loader/loader.d.ts +0 -15
  161. package/types/components/ui/modal/modal.d.ts +0 -17
  162. package/types/components/ui/tooltip/tooltip.d.ts +0 -9
  163. package/types/core/components/fetch.d.ts +0 -6
  164. package/types/core/components/list.d.ts +0 -9
  165. package/types/core/components/queue.d.ts +0 -15
  166. package/types/core/components/taxonomy.d.ts +0 -13
  167. package/types/core/components/text-formatted.d.ts +0 -15
  168. package/types/core/components/text.d.ts +0 -9
  169. package/types/core/core.d.ts +0 -7
  170. package/types/core/mixins/Fetcher.d.ts +0 -9
  171. package/types/core/mixins/Subscriber.d.ts +0 -13
  172. package/types/core/utils/api.d.ts +0 -16
  173. package/types/index.d.ts +0 -12
  174. package/types/styles/button/button.d.ts +0 -1
  175. package/types/styles/prose/prose.d.ts +0 -2
@@ -0,0 +1,14 @@
1
+ import { LitElement } from "lit";
2
+ export declare class Image extends LitElement {
3
+ static styles: import("lit").CSSResult[];
4
+ rounded: "" | "none" | "full" | "sm" | "md" | "lg";
5
+ src: string;
6
+ alt: string;
7
+ loading: "eager" | "lazy";
8
+ ratio: string;
9
+ objectPosition: string;
10
+ imageRendering: string;
11
+ shadow: "" | "none" | "sm" | "md";
12
+ cover: boolean;
13
+ render(): import("lit-html").TemplateResult<1>;
14
+ }
@@ -0,0 +1,152 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, LitElement, css } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { styleMap } from "lit/directives/style-map.js";
10
+ let Image = class Image extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.rounded = "none";
14
+ this.src = "";
15
+ this.alt = "";
16
+ this.loading = "lazy";
17
+ this.ratio = "auto";
18
+ this.objectPosition = "center center";
19
+ this.imageRendering = "auto";
20
+ this.shadow = "none";
21
+ this.cover = false;
22
+ }
23
+ render() {
24
+ const imgStyles = {
25
+ aspectRatio: this.cover ? "auto" : this.ratio,
26
+ imageRendering: this.imageRendering,
27
+ objectPosition: this.objectPosition,
28
+ };
29
+ return html `<div part="image">
30
+ <picture part="picture"
31
+ ><img part="img" src="${this.src}" loading="${this.loading}" alt="${this.alt}" style=${styleMap(imgStyles)}
32
+ /></picture>
33
+ </div>`;
34
+ }
35
+ };
36
+ Image.styles = [
37
+ css `
38
+ :host {
39
+ --sc-img-radius: 0;
40
+ --sc-img-bg: var(--sc-placeholder-bg);
41
+ border-radius: var(--sc-img-radius);
42
+ display: block;
43
+ width: 100%;
44
+ background: var(--sc-img-bg);
45
+ }
46
+
47
+ img {
48
+ width: 100%;
49
+ vertical-align: middle;
50
+ object-fit: cover;
51
+ }
52
+
53
+ img[src=""] {
54
+ visibility: hidden;
55
+ }
56
+
57
+ /*Rounded*/
58
+ :host([rounded]) {
59
+ --sc-img-radius: var(--sc-rounded);
60
+ overflow: hidden;
61
+ }
62
+ :host([rounded="sm"]) {
63
+ --sc-img-radius: var(--sc-rounded-sm);
64
+ }
65
+
66
+ :host([rounded="md"]) {
67
+ --sc-img-radius: var(--sc-rounded-md);
68
+ }
69
+
70
+ :host([rounded="lg"]) {
71
+ --sc-img-radius: var(--sc-rounded-lg);
72
+ }
73
+ :host([rounded="xl"]) {
74
+ --sc-img-radius: var(--sc-rounded-xl);
75
+ }
76
+
77
+ /*Cercle*/
78
+ :host([rounded="full"]) {
79
+ --sc-img-radius: 50% !important;
80
+ }
81
+ :host([rounded="none"]) {
82
+ --sc-img-radius: 0 !important;
83
+ }
84
+
85
+ /*OMBRE*/
86
+ :host([shadow]) > div,
87
+ :host([shadow="md"]) > div,
88
+ :host([shadow="true"]) > div {
89
+ box-shadow: var(--sc-shadow);
90
+ }
91
+
92
+ :host([shadow="sm"]) > div {
93
+ box-shadow: var(--sc-shadow-sm);
94
+ }
95
+
96
+ :host([shadow="none"]) > div {
97
+ box-shadow: none;
98
+ }
99
+
100
+ :host([shadow="lg"]) > div {
101
+ box-shadow: var(--sc-shadow-lg);
102
+ }
103
+
104
+ :host([cover]),
105
+ :host([cover]) > div,
106
+ :host([cover]) img {
107
+ position: absolute !important;
108
+ left: 0 !important;
109
+ top: 0 !important;
110
+ right: 0 !important;
111
+ bottom: 0 !important;
112
+ height: 100% !important;
113
+ width: 100% !important;
114
+ }
115
+ `,
116
+ ];
117
+ __decorate([
118
+ property({ type: String })
119
+ ], Image.prototype, "rounded", void 0);
120
+ __decorate([
121
+ property({ type: String })
122
+ ], Image.prototype, "src", void 0);
123
+ __decorate([
124
+ property({ type: String })
125
+ ], Image.prototype, "alt", void 0);
126
+ __decorate([
127
+ property({ type: String })
128
+ ], Image.prototype, "loading", void 0);
129
+ __decorate([
130
+ property({ type: String })
131
+ ], Image.prototype, "ratio", void 0);
132
+ __decorate([
133
+ property({ type: String })
134
+ ], Image.prototype, "objectPosition", void 0);
135
+ __decorate([
136
+ property({ type: String })
137
+ ], Image.prototype, "imageRendering", void 0);
138
+ __decorate([
139
+ property({ type: String, reflect: true })
140
+ ], Image.prototype, "shadow", void 0);
141
+ __decorate([
142
+ property({ type: Boolean, reflect: true })
143
+ ], Image.prototype, "cover", void 0);
144
+ Image = __decorate([
145
+ customElement("sonic-image")
146
+ ], Image);
147
+ export { Image };
148
+ //Ajout pour la creation du cem notamment pour Storybook
149
+ try {
150
+ customElements.define("sonic-image", Image);
151
+ }
152
+ catch (e) { }
@@ -0,0 +1,16 @@
1
+ import { LitElement } from "lit";
2
+ export declare class Link extends LitElement {
3
+ static styles: import("lit").CSSResult[];
4
+ href: string;
5
+ private _location;
6
+ get location(): string;
7
+ set location(value: string);
8
+ connectedCallback(): void;
9
+ disconnectedCallback(): void;
10
+ /**
11
+ * Si présent on passe en mode pushstate
12
+ */
13
+ pushState: null;
14
+ handlePushState(e: Event): void;
15
+ render(): import("lit-html").TemplateResult<1>;
16
+ }
@@ -0,0 +1,70 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import LocationHandler from "@supersoniks/concorde/core/utils/LocationHandler";
8
+ import { html, LitElement, css } from "lit";
9
+ import { customElement, property } from "lit/decorators.js";
10
+ let Link = class Link extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.href = "";
14
+ this._location = "";
15
+ /**
16
+ * Si présent on passe en mode pushstate
17
+ */
18
+ this.pushState = null;
19
+ }
20
+ get location() {
21
+ return this._location;
22
+ }
23
+ set location(value) {
24
+ this._location = value;
25
+ LocationHandler.updateComponentActiveState(this);
26
+ }
27
+ connectedCallback() {
28
+ if (this.href && this.href.indexOf("http") != 0) {
29
+ LocationHandler.onChange(this);
30
+ this.location = document.location.href.replace(document.location.origin, "");
31
+ }
32
+ super.connectedCallback();
33
+ }
34
+ disconnectedCallback() {
35
+ LocationHandler.offChange(this);
36
+ super.disconnectedCallback();
37
+ }
38
+ handlePushState(e) {
39
+ e.preventDefault();
40
+ LocationHandler.changeFromComponent(this);
41
+ }
42
+ render() {
43
+ if (!this.href)
44
+ return html `<slot></slot>`;
45
+ return html `
46
+ <a href="${this.href}" @click=${this.pushState ? this.handlePushState : null}>
47
+ <slot></slot>
48
+ </a>
49
+ `;
50
+ }
51
+ };
52
+ Link.styles = [
53
+ css `
54
+ a {
55
+ color: inherit;
56
+ text-decoration: none;
57
+ display:contents;
58
+ }
59
+ `,
60
+ ];
61
+ __decorate([
62
+ property({ type: String })
63
+ ], Link.prototype, "href", void 0);
64
+ __decorate([
65
+ property({ type: Boolean })
66
+ ], Link.prototype, "pushState", void 0);
67
+ Link = __decorate([
68
+ customElement("sonic-link")
69
+ ], Link);
70
+ export { Link };
@@ -0,0 +1,20 @@
1
+ import { LitElement } from "lit";
2
+ declare type LoaderConf = {
3
+ mode?: string;
4
+ container?: HTMLElement;
5
+ };
6
+ export declare class Loader extends LitElement {
7
+ static styles: import("lit").CSSResult[];
8
+ static loader: Loader;
9
+ static callCounter: number;
10
+ static show(conf?: LoaderConf): void;
11
+ static hide(): void;
12
+ /**
13
+ * Mode d'affichage du loader
14
+ * * inline : Loader dans le contenu
15
+ * * fixed : Loader global par dessus la page
16
+ */
17
+ mode: "inline" | "fixed";
18
+ render(): import("lit-html").TemplateResult<1>;
19
+ }
20
+ export {};
@@ -0,0 +1,94 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var Loader_1;
8
+ import { html, LitElement, css } from "lit";
9
+ import { customElement, property } from "lit/decorators.js";
10
+ import { inline } from "./styles/inline";
11
+ import { fixed } from "./styles/fixed";
12
+ let Loader = Loader_1 = class Loader extends LitElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ /**
16
+ * Mode d'affichage du loader
17
+ * * inline : Loader dans le contenu
18
+ * * fixed : Loader global par dessus la page
19
+ */
20
+ this.mode = "fixed";
21
+ }
22
+ static show(conf) {
23
+ if (!Loader_1.loader)
24
+ Loader_1.loader = document.createElement("sonic-loader");
25
+ let loader = Loader_1.loader;
26
+ if (!conf)
27
+ conf = {};
28
+ let v = conf;
29
+ for (let z in v)
30
+ loader.setAttribute(z, v[z]);
31
+ if (!conf.container) {
32
+ conf.container = document.querySelector("sonic-theme") || document.body;
33
+ conf.mode = "fixed";
34
+ }
35
+ conf.container.appendChild(loader);
36
+ Loader_1.callCounter++;
37
+ }
38
+ static hide() {
39
+ Loader_1.callCounter--;
40
+ if (Loader_1.callCounter > 0)
41
+ return;
42
+ if (Loader_1.loader)
43
+ Loader_1.loader.remove();
44
+ }
45
+ render() {
46
+ return html `<div class="sonic-loader sonic-loader--${this.mode} ">
47
+ <div></div>
48
+ <div></div>
49
+ <div></div>
50
+ <div></div>
51
+ </div>`;
52
+ }
53
+ };
54
+ Loader.styles = [
55
+ inline,
56
+ fixed,
57
+ css `
58
+ :host {
59
+ --sc-loader-bg: var(--sc-primary, currentColor);
60
+ pointer-events: none;
61
+ }
62
+
63
+ .sonic-loader {
64
+ opacity: 0;
65
+ animation: showLoader 0.5s 0.5s forwards;
66
+ }
67
+ .sonic-loader--inline {
68
+ animation-delay: 0s;
69
+ }
70
+
71
+ @keyframes showLoader {
72
+ 0% {
73
+ opacity: 0;
74
+ }
75
+
76
+ 100% {
77
+ opacity: 1;
78
+ }
79
+ }
80
+ `,
81
+ ];
82
+ Loader.callCounter = 0;
83
+ __decorate([
84
+ property({ type: String })
85
+ ], Loader.prototype, "mode", void 0);
86
+ Loader = Loader_1 = __decorate([
87
+ customElement("sonic-loader")
88
+ ], Loader);
89
+ export { Loader };
90
+ //Ajout pour la creation du cem notamment pour Storybook
91
+ try {
92
+ customElements.define("sonic-loader", Loader);
93
+ }
94
+ catch (e) { }
@@ -0,0 +1,57 @@
1
+ import { css } from "lit";
2
+ export const fixed = css `
3
+
4
+ @keyframes sonic-loader--fixed {
5
+ 0% {
6
+ transform: scale(0);
7
+ opacity: 0;
8
+ }
9
+ 5% {
10
+ opacity: 1;
11
+ }
12
+ 70% {
13
+ opacity:90%;
14
+ }
15
+ 100% {
16
+ transform: scale(1);
17
+ opacity: 0;
18
+ }
19
+ }
20
+
21
+ .sonic-loader--fixed {
22
+ position: fixed;
23
+ top:50%;
24
+ left:50%;
25
+ transform:transateY(-50%) translateX(-50%);
26
+ z-index:999;
27
+ }
28
+
29
+ .sonic-loader--fixed > div:nth-child(2) {
30
+ animation-delay: -0.5s;
31
+ }
32
+ .sonic-loader--fixed > div:nth-child(3) {
33
+ animation-delay: -0.2s;
34
+ }
35
+
36
+ .sonic-loader--fixed > div:nth-child(4) {
37
+ display:none !important;
38
+ }
39
+ .sonic-loader--fixed > div {
40
+ background-color: var(--sc-loader-bg);
41
+ width: 5rem;
42
+ height: 5rem;
43
+ border-radius: 100%;
44
+ margin: 2px;
45
+ animation-fill-mode: both;
46
+ position: absolute;
47
+ top: 0px;
48
+ opacity: 0;
49
+ margin: 0;
50
+ top: -2.5rem;
51
+ left: -2.5rem;
52
+ width: 5rem;
53
+ height: 5rem;
54
+ animation: sonic-loader--fixed 1s 0s linear infinite;
55
+ }
56
+
57
+ `;
@@ -0,0 +1,71 @@
1
+ import { css } from "lit";
2
+ export const inline = css `
3
+
4
+ :host([align="left"]) .sonic-loader--inline {
5
+ margin-left:0;
6
+ }
7
+
8
+ :host([align="right"]) .sonic-loader--inline {
9
+ margin-left:auto;
10
+ margin-right:0;
11
+ }
12
+ .sonic-loader--inline {
13
+ display:block;
14
+ position: relative;
15
+ width: 80px;
16
+ height: 80px;
17
+ margin:auto;
18
+ z-index:20;
19
+ }
20
+ .sonic-loader--inline div {
21
+ position: absolute;
22
+ top: 33px;
23
+ width: 13px;
24
+ height: 13px;
25
+ border-radius: 50%;
26
+ background:var(--sc-loader-bg);
27
+ animation-timing-function: cubic-bezier(0, 1, 1, 0);
28
+ }
29
+ .sonic-loader--inline div:nth-child(1) {
30
+ left: 8px;
31
+ animation: lds-ellipsis1 0.6s infinite;
32
+ }
33
+ .sonic-loader--inline div:nth-child(2) {
34
+ left: 8px;
35
+ animation: lds-ellipsis2 0.6s infinite;
36
+ }
37
+ .sonic-loader--inline div:nth-child(3) {
38
+ left: 32px;
39
+ animation: lds-ellipsis2 0.6s infinite;
40
+ }
41
+ .sonic-loader--inline div:nth-child(4) {
42
+ left: 56px;
43
+ animation: lds-ellipsis3 0.6s infinite;
44
+ }
45
+
46
+ @keyframes lds-ellipsis1 {
47
+ 0% {
48
+ transform: scale(0);
49
+ }
50
+ 100% {
51
+ transform: scale(1);
52
+ }
53
+ }
54
+ @keyframes lds-ellipsis3 {
55
+ 0% {
56
+ transform: scale(1);
57
+ }
58
+ 100% {
59
+ transform: scale(0);
60
+ }
61
+ }
62
+ @keyframes lds-ellipsis2 {
63
+ 0% {
64
+ transform: translate(0, 0);
65
+ }
66
+ 100% {
67
+ transform: translate(24px, 0);
68
+ }
69
+ }
70
+
71
+ `;
@@ -0,0 +1,5 @@
1
+ import { Button } from "../button/button";
2
+ export declare class MenuItem extends Button {
3
+ constructor();
4
+ connectedCallback(): void;
5
+ }
@@ -0,0 +1,37 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { customElement } from "lit/decorators.js";
8
+ import { Button } from "../button/button";
9
+ let MenuItem = class MenuItem extends Button {
10
+ constructor() {
11
+ super();
12
+ }
13
+ connectedCallback() {
14
+ if (!this.hasAttribute('variant')) {
15
+ this.variant = "ghost";
16
+ }
17
+ if (!this.hasAttribute('type')) {
18
+ this.type = "primary";
19
+ }
20
+ if (!this.hasAttribute('shape')) {
21
+ this.shape = "block";
22
+ }
23
+ if (!this.hasAttribute('textAlign')) {
24
+ this.textAlign = "left";
25
+ }
26
+ super.connectedCallback();
27
+ }
28
+ };
29
+ MenuItem = __decorate([
30
+ customElement("sonic-menu-item")
31
+ ], MenuItem);
32
+ export { MenuItem };
33
+ //Ajout pour Storybook
34
+ try {
35
+ customElements.define("sonic-menu-item", MenuItem);
36
+ }
37
+ catch (e) { }
@@ -0,0 +1,26 @@
1
+ import { LitElement, PropertyValues } from "lit";
2
+ export declare class MenuItems extends LitElement {
3
+ static styles: import("lit").CSSResult[];
4
+ /**
5
+ * Taille du composant, peut avoir un effet sur ses composants enfants
6
+ * tels que les dividers / boutons,... qui n'auraient pas d'attribut size précisés.
7
+ */
8
+ size: "" | "xs" | "sm" | "lg";
9
+ /**
10
+ * Direction // todo
11
+ */
12
+ direction: "" | "row" | "column";
13
+ /**
14
+ * Ombre
15
+ */
16
+ shadow: "" | "none" | "sm" | "md";
17
+ /**
18
+ * Propriété min-width du bouton
19
+ */
20
+ minWidth: string;
21
+ menuChildren: Array<HTMLElement>;
22
+ menuNodes: Array<Node>;
23
+ updated(_changedProperties: PropertyValues): void;
24
+ _setChildrenSize(): void;
25
+ render(): import("lit-html").TemplateResult<1>;
26
+ }