@supersoniks/concorde 1.0.7 → 1.0.8

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 +365 -0
  144. package/core/utils/api.d.ts +66 -0
  145. package/core/utils/api.js +145 -0
  146. package/package.json +179 -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,120 @@
1
+ import { LitElement, CSSResultGroup } from "lit";
2
+ import "@supersoniks/concorde/core/components/ui/icon/icon";
3
+ declare const Checkbox_base: {
4
+ new (...args: any[]): {
5
+ _value: string | null;
6
+ value: string | null;
7
+ _name: string;
8
+ name: string;
9
+ unique: true | null;
10
+ radio: true | null;
11
+ _checked: true | null;
12
+ checked: true | null;
13
+ setCheckedValue(checked: true | null): void;
14
+ handleChange(): void;
15
+ getValueForFormPublisher(): any;
16
+ setFormValueFromPublisher(value: any): void;
17
+ initPublisher(): void;
18
+ getFormPublisher(): any;
19
+ updateDataValue(): void;
20
+ error: true | null;
21
+ autofocus: true | null;
22
+ disabled: true | null;
23
+ required: true | null;
24
+ formDataProvider: string;
25
+ props: any;
26
+ getAncestorAttributeValue(attributeName: string): string;
27
+ hasAncestorAttribute(attributeName: string): boolean;
28
+ querySelectorAll(selector: string): NodeListOf<Element>;
29
+ publisher: any;
30
+ dataProvider: String;
31
+ noShadowDom: string | null;
32
+ debug: HTMLElement | null;
33
+ defferedDebug: boolean | null;
34
+ makeShadow(props: Record<string, any>, value: any): any;
35
+ dispatchEvent(event: Event): void;
36
+ setAttribute(name: string, value: string): void;
37
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
38
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
39
+ removeAttribute(name: string): void;
40
+ getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
41
+ connectedCallback(): void;
42
+ requestUpdate(): void;
43
+ getAttribute(name: string): string;
44
+ hasAttribute(attributeName: String): boolean;
45
+ disconnectedCallback(): void;
46
+ };
47
+ } & {
48
+ new (...args: any[]): {
49
+ type: "number" | "search" | "file" | "button" | "password" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local";
50
+ tabindex: string | null;
51
+ autocomplete: "url" | "name" | "language" | "on" | "tel" | "email" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "photo" | null;
52
+ getFormPublisher(): any;
53
+ updateDataValue(): void;
54
+ handleChange(e?: any): void;
55
+ getValueForFormPublisher(): any;
56
+ error: true | null;
57
+ autofocus: true | null;
58
+ disabled: true | null;
59
+ required: true | null;
60
+ formDataProvider: string;
61
+ _value: any;
62
+ value: any;
63
+ _name: string;
64
+ name: string;
65
+ props: any;
66
+ getAncestorAttributeValue(attributeName: string): string;
67
+ hasAncestorAttribute(attributeName: string): boolean;
68
+ querySelectorAll(selector: string): NodeListOf<Element>;
69
+ publisher: any;
70
+ dataProvider: String;
71
+ noShadowDom: string | null;
72
+ debug: HTMLElement | null;
73
+ defferedDebug: boolean | null;
74
+ makeShadow(props: Record<string, any>, value: any): any;
75
+ dispatchEvent(event: Event): void;
76
+ setAttribute(name: string, value: string): void;
77
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
78
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
79
+ removeAttribute(name: string): void;
80
+ initPublisher(): void;
81
+ getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
82
+ connectedCallback(): void;
83
+ requestUpdate(): void;
84
+ getAttribute(name: string): string;
85
+ hasAttribute(attributeName: String): boolean;
86
+ disconnectedCallback(): void;
87
+ };
88
+ } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
89
+ /**
90
+ * ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
91
+ * **FormElement :**
92
+ * * 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é.
93
+ * * Par défault lorsque modifie l'input, la valeur est également mise à jour via le même dataprovider
94
+ * * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
95
+ * * 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.
96
+ * * **FormInput **
97
+ * Uniquement des propriétés classiques d'un input HTML. La prise en compte est ici partielle, par exemple les propriétés *placeholder*, *readonly*, *pattern*, *min* et *max* n'ont pas de sens pour un checkbox.
98
+ * **FormCheckable :**
99
+ * * La propriété checked mise à true si la valeur de la propriété du même nom dans les données du dataprovider associé contient un propriété checked.
100
+ * **Comportements :**
101
+ * * multiple (par défaut):
102
+ * - on peut cocher plusieurs checkbox ayant le même *name*.
103
+ * - la valeur enregistrée dans la propriété nommé du même nom dans formDataProvider est un tableau avec les *value* des cases cochées ayant le même *name*.
104
+ * * unique (Ajouter l'attribute unique au composant a l'intégration):
105
+ * - on ne peut cocher qu'une seule checkbox ayant le même *name*.
106
+ * * radio (Ajouter l'attribute radio au composant a l'intégration):
107
+ * Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
108
+ */
109
+ export declare class Checkbox extends Checkbox_base {
110
+ static styles: CSSResultGroup[];
111
+ iconName: string;
112
+ description: string;
113
+ label: string;
114
+ slotDescriptionNodes: Array<Node>;
115
+ hasDescription: true | false;
116
+ updated(): void;
117
+ connectedCallback(): void;
118
+ render(): import("lit-html").TemplateResult<1>;
119
+ }
120
+ export {};
@@ -0,0 +1,203 @@
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, queryAssignedNodes } from "lit/decorators.js";
9
+ import { ifDefined } from "lit/directives/if-defined.js";
10
+ import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
11
+ import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
12
+ import FormInput from "@supersoniks/concorde/core/mixins/FormInput";
13
+ import FormCheckable from "@supersoniks/concorde/core/mixins/FormCheckable";
14
+ import "@supersoniks/concorde/core/components/ui/icon/icon";
15
+ /**
16
+ * ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
17
+ * **FormElement :**
18
+ * * 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é.
19
+ * * Par défault lorsque modifie l'input, la valeur est également mise à jour via le même dataprovider
20
+ * * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
21
+ * * 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.
22
+ * * **FormInput **
23
+ * Uniquement des propriétés classiques d'un input HTML. La prise en compte est ici partielle, par exemple les propriétés *placeholder*, *readonly*, *pattern*, *min* et *max* n'ont pas de sens pour un checkbox.
24
+ * **FormCheckable :**
25
+ * * La propriété checked mise à true si la valeur de la propriété du même nom dans les données du dataprovider associé contient un propriété checked.
26
+ * **Comportements :**
27
+ * * multiple (par défaut):
28
+ * - on peut cocher plusieurs checkbox ayant le même *name*.
29
+ * - la valeur enregistrée dans la propriété nommé du même nom dans formDataProvider est un tableau avec les *value* des cases cochées ayant le même *name*.
30
+ * * unique (Ajouter l'attribute unique au composant a l'intégration):
31
+ * - on ne peut cocher qu'une seule checkbox ayant le même *name*.
32
+ * * radio (Ajouter l'attribute radio au composant a l'intégration):
33
+ * Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
34
+ */
35
+ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscriber(LitElement)))) {
36
+ constructor() {
37
+ super(...arguments);
38
+ this.iconName = "check";
39
+ this.description = "";
40
+ this.label = "";
41
+ this.hasDescription = false;
42
+ }
43
+ updated() {
44
+ var _a;
45
+ this.hasDescription = this.description || ((_a = this.slotDescriptionNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
46
+ }
47
+ connectedCallback() {
48
+ this.type = "checkbox";
49
+ super.connectedCallback();
50
+ }
51
+ render() {
52
+ return html `
53
+ <label class="checkbox-container ${this.disabled ? "disabled" : ""}">
54
+ <span class="icon-container">
55
+ <input
56
+ type="${this.type}"
57
+ @change=${this.handleChange}
58
+ disabled="${ifDefined(this.disabled)}"
59
+ .checked="${ifDefined(this.checked)}"
60
+ required=${ifDefined(this.required)}
61
+ .name=${this.name}
62
+ .value=${this.value}
63
+ autofocus=${ifDefined(this.autofocus)}
64
+
65
+ />
66
+ <sonic-icon prefix="iconoir"
67
+ name="${this.iconName}" class="sc-input-icon"></sonic-icon>
68
+ </span>
69
+ <div class="checkbox-text">
70
+ ${this.label ? this.label : ""}
71
+ <slot></slot>
72
+ <slot name="description" class="${this.hasDescription ? "description" : "hidden"} ">
73
+ ${this.description ? html `${this.description}` : ""}
74
+ <slot>
75
+ </div>
76
+ </label>
77
+
78
+ `;
79
+ }
80
+ };
81
+ Checkbox.styles = [
82
+ css `
83
+ * {
84
+ box-sizing: border-box;
85
+ }
86
+ .checkbox-container {
87
+ min-height: 1.4em;
88
+ display: flex;
89
+ gap: 0.5em;
90
+ line-height: 1.2;
91
+ align-items: flex-start;
92
+ }
93
+
94
+ .icon-container {
95
+ position: relative;
96
+ display: flex;
97
+ flex-shrink: 0;
98
+ }
99
+
100
+ input {
101
+ appearance: none;
102
+ flex-shrink: 0;
103
+ height: 1.5em;
104
+ width: 1.5em;
105
+ display: block;
106
+ cursor: pointer;
107
+ border-radius: 0.25em;
108
+ transition: 0.2s;
109
+ outline: none;
110
+ margin: 0;
111
+ background-color: var(--sc-base-200);
112
+ }
113
+
114
+ input:focus,
115
+ :host(:not([disabled])) input:active {
116
+ box-shadow: 0 0 0 2px var(--sc-primary);
117
+ }
118
+
119
+ :host(:not([disabled])) label {
120
+ cursor: pointer;
121
+ }
122
+
123
+ sonic-icon {
124
+ line-height: 0;
125
+ position: absolute;
126
+ top: 50%;
127
+ left: 50%;
128
+ transform: translateX(-50%) translateY(-50%) scale(0);
129
+ transition: transform 0.2s ease-in-out;
130
+ color: var(--sc-primary-content);
131
+ }
132
+
133
+ /* .checkbox-text {
134
+ align-self: center;
135
+ } */
136
+
137
+ .description {
138
+ color: var(--sc-base-400);
139
+ font-size: 0.85em;
140
+ margin-top: 0.2em;
141
+ display: block;
142
+ }
143
+
144
+ /*Active */
145
+ input:checked,
146
+ input[checked="true"] {
147
+ background: var(--sc-primary);
148
+ }
149
+
150
+ input:checked + sonic-icon,
151
+ input[checked="true"] + sonic-icon {
152
+ transform: translateX(-50%) translateY(-50%) scale(1);
153
+ }
154
+ /*DISABLED */
155
+ .disabled {
156
+ cursor: not-allowed;
157
+ }
158
+ .disabled input {
159
+ opacity: 0.4;
160
+ }
161
+
162
+ .disabled .checkbox-text {
163
+ opacity: 0.6;
164
+ }
165
+
166
+ ::slotted(a) {
167
+ color: inherit;
168
+ text-decoration: underline !important;
169
+ }
170
+
171
+ ::slotted(a:hover) {
172
+ text-decoration: none !important;
173
+ }
174
+ /*Utils */
175
+ .hidden {
176
+ display: none;
177
+ }
178
+ `,
179
+ ];
180
+ __decorate([
181
+ property({ type: String })
182
+ ], Checkbox.prototype, "iconName", void 0);
183
+ __decorate([
184
+ property({ type: String })
185
+ ], Checkbox.prototype, "description", void 0);
186
+ __decorate([
187
+ property({ type: String })
188
+ ], Checkbox.prototype, "label", void 0);
189
+ __decorate([
190
+ queryAssignedNodes({ slot: "description" })
191
+ ], Checkbox.prototype, "slotDescriptionNodes", void 0);
192
+ __decorate([
193
+ property({ type: Boolean })
194
+ ], Checkbox.prototype, "hasDescription", void 0);
195
+ Checkbox = __decorate([
196
+ customElement("sonic-checkbox")
197
+ ], Checkbox);
198
+ export { Checkbox };
199
+ //Ajout pour Storybook
200
+ try {
201
+ customElements.define("sonic-checkbox", Checkbox);
202
+ }
203
+ catch (e) { }
@@ -0,0 +1 @@
1
+ export declare const formControl: import("lit").CSSResult;
@@ -0,0 +1,219 @@
1
+ import { css } from "lit";
2
+ export const formControl = css `
3
+ * {
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ :host {
8
+ --sc-input-height: var(--sc-form-height, 2.5em);
9
+ --sc-input-border-with: var(--sc-form-border-width, 0.1rem);
10
+ --sc-input-border: var(--sc-input-border-with) solid var(--sc-input-border-color, var(--sc-base-300, #aaa));
11
+ --sc-input-color: var(--sc-base-content, #1f2937);
12
+
13
+ --sc-item-rounded-tr: var(--sc-input-rounded, var(--sc-rounded));
14
+ --sc-item-rounded-tl: var(--sc-input-rounded, var(--sc-rounded));
15
+ --sc-item-rounded-bl: var(--sc-input-rounded, var(--sc-rounded));
16
+ --sc-item-rounded-br: var(--sc-input-rounded, var(--sc-rounded));
17
+
18
+ --sc-input-ff: inherit;
19
+ --sc-input-py: 0.6em;
20
+ --sc-input-px: 1.15em;
21
+
22
+ --sc-input-prefix-color: var(--sc-input-color);
23
+ --sc-input-prefix-bg: var(--sc-input-bg);
24
+ --sc-input-prefix-border-color: var(--sc-input-border-color);
25
+
26
+ --sc-input-suffix-color: var(--sc-input-color);
27
+ --sc-input-suffix-bg: var(--sc-input-bg);
28
+ --sc-input-suffix-border-color: var(--sc-input-border-color);
29
+ --sc-label-fs: var(--sc-input-fs);
30
+ }
31
+
32
+ .form-element {
33
+ display: block;
34
+ flex-grow: 1;
35
+ width: 100%;
36
+
37
+ line-height: 1.1;
38
+ color: var(--sc-input-color);
39
+ border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br)
40
+ var(--sc-item-rounded-bl);
41
+
42
+ font-family: var(--sc-input-ff);
43
+ background-color: var(--sc-input-bg, var(--sc-base, #fff));
44
+ border: var(--sc-input-border);
45
+ width: 100%;
46
+ font-size: var(--sc-input-fs);
47
+
48
+ padding-top: var(--sc-input-py);
49
+ padding-bottom: var(--sc-input-py);
50
+ padding-left: var(--sc-input-px);
51
+ padding-right: var(--sc-input-px);
52
+
53
+ min-height: var(--sc-input-height);
54
+ }
55
+
56
+ label {
57
+ font-size: var(--sc-label-fs);
58
+ line-height: 1.2;
59
+ }
60
+
61
+ .form-control {
62
+ display: flex;
63
+ width: 100%;
64
+ }
65
+
66
+ /*Suffix*/
67
+ :host(:not([inlineContent])) .has-suffix slot[name="suffix"],
68
+ :host(:not([inlineContent])) .has-prefix slot[name="prefix"] {
69
+ min-width: var(--sc-input-height);
70
+ box-sizing: border-box;
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ line-height: 1.1;
75
+ flex-shrink: 0;
76
+ padding-left: calc(-1 * var(--sc-input-px));
77
+ padding-right: calc(-1 * var(--sc-input-px));
78
+ }
79
+
80
+ :host(:not([inlineContent])) slot[name="prefix"] {
81
+ border-radius: var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl);
82
+ background-color: var(--sc-input-prefix-bg);
83
+ color: var(--sc-input-prefix-color);
84
+ border: var(--sc-input-border-with) solid var(--sc-input-prefix-border-color);
85
+ margin-right: calc(-1 * var(--sc-input-border-with));
86
+ }
87
+
88
+ :host(:not([inlineContent])) slot[name="suffix"] {
89
+ border-radius: 0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0;
90
+ background-color: var(--sc-input-suffix-bg);
91
+ color: var(--sc-input-suffix-color);
92
+ border: var(--sc-input-border-with) solid var(--sc-input-suffix-border-color);
93
+ margin-left: calc(-1 * var(--sc-input-border-with));
94
+ }
95
+
96
+ :host(:not([inlineContent])) .has-prefix .form-element {
97
+ border-top-left-radius: 0;
98
+ border-bottom-left-radius: 0;
99
+ }
100
+
101
+ :host(:not([inlineContent])) .has-suffix .form-element {
102
+ border-top-right-radius: 0;
103
+ border-bottom-right-radius: 0;
104
+ }
105
+
106
+ /*InlineCONTENT */
107
+ :host([inlineContent]) {
108
+ --sc-input-py: 0;
109
+ }
110
+ :host([inlineContent]) .form-element {
111
+ display: flex;
112
+ flex-wrap: wrap;
113
+ align-items: center;
114
+ gap: 0.2em;
115
+ }
116
+
117
+ /*Disabled */
118
+ :host([disabled]) .form-element-container {
119
+ cursor: not-allowed;
120
+ }
121
+
122
+ /*SIZE*/
123
+ :host {
124
+ --sc-input-fs: 1rem;
125
+ }
126
+
127
+ :host([size="xs"]) {
128
+ --sc-input-fs: 0.75rem;
129
+ }
130
+ :host([size="sm"]) {
131
+ --sc-input-fs: 0.85rem;
132
+ }
133
+ :host([size="lg"]) {
134
+ --sc-input-fs: 1.2rem;
135
+ }
136
+
137
+ :host([variant="ghost"]) .form-element {
138
+ --sc-input-bg: transparent;
139
+ }
140
+
141
+ /*ERROR*/
142
+ :host([error]) {
143
+ --sc-input-border-color: var(--sc-danger);
144
+ }
145
+
146
+ :host :not([value=""]):not(:focus):invalid {
147
+ --sc-input-color: var(--sc-danger);
148
+ }
149
+
150
+ /*Disbaled*/
151
+ :host([disabled]) .form-element {
152
+ pointer-events: none;
153
+ background-color: var(--sc-base-100);
154
+ border-color: transparent;
155
+ color: var(--sc-base-400);
156
+ }
157
+
158
+ /*PLACEHOLDER*/
159
+ ::placeholder {
160
+ color: inherit;
161
+ opacity: 0.45;
162
+ }
163
+
164
+ :focus::placeholder {
165
+ opacity: 0;
166
+ }
167
+
168
+ /*HOVER*/
169
+ :host(:not([disabled])) .form-element:hover,
170
+ .form-element:focus-visible,
171
+ .form-element:focus {
172
+ filter: brightness(0.97);
173
+ outline: none;
174
+ }
175
+
176
+ .form-label {
177
+ margin-bottom: 0.22em;
178
+ display: block;
179
+ }
180
+
181
+ .form-description {
182
+ color: var(--sc-base-400);
183
+ font-size: 0.85em;
184
+ margin-top: 0.2em;
185
+ display: block;
186
+ }
187
+
188
+ .form-element > slot,
189
+ .form-element .form-element {
190
+ all: unset !important;
191
+ }
192
+
193
+ /*Textarea scrollbar*/
194
+ textarea::-webkit-scrollbar {
195
+ width: 0.4rem;
196
+ }
197
+ textarea::-webkit-scrollbar-track {
198
+ width: 0.4rem;
199
+ }
200
+ textarea::-webkit-scrollbar-thumb {
201
+ background-color: var(--sc-base-500);
202
+ width: 0.4rem;
203
+ border-radius: var(--sc-rounded);
204
+ }
205
+ textarea::-webkit-scrollbar {
206
+ width: 0.4rem;
207
+ }
208
+ textarea::-webkit-scrollbar-track {
209
+ width: 0.4rem;
210
+ }
211
+
212
+ /*Utilitaires*/
213
+ .hidden {
214
+ display: none;
215
+ }
216
+ .contents {
217
+ display: contents;
218
+ }
219
+ `;
@@ -0,0 +1,15 @@
1
+ import { LitElement } from "lit";
2
+ declare const Fieldset_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
3
+ export declare class Fieldset extends Fieldset_base {
4
+ static styles: import("lit").CSSResult[];
5
+ /**
6
+ * Désactiver le fieldset
7
+ */
8
+ disabled: true | false;
9
+ /**
10
+ * Lier à un formulaire qui ne serait pas parent du fieldset
11
+ */
12
+ form: string;
13
+ render(): import("lit-html").TemplateResult<1>;
14
+ }
15
+ export {};
@@ -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 { html, LitElement, css } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { ifDefined } from "lit/directives/if-defined.js";
10
+ import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
11
+ let Fieldset = class Fieldset extends Subscriber(LitElement) {
12
+ constructor() {
13
+ super(...arguments);
14
+ // @property({ type: String }) label: String = "";
15
+ /**
16
+ * Désactiver le fieldset
17
+ */
18
+ this.disabled = false;
19
+ /**
20
+ * Lier à un formulaire qui ne serait pas parent du fieldset
21
+ */
22
+ this.form = "";
23
+ }
24
+ render() {
25
+ return html `<fieldset form="${ifDefined(this.form)}" ?disabled="${this.disabled}">
26
+ <slot></slot>
27
+ </fieldset>`;
28
+ }
29
+ };
30
+ Fieldset.styles = [
31
+ css `
32
+ :host {
33
+ --sc-fieldset-mt: 0;
34
+ --sc-fieldset-mb: 2rem;
35
+ --sc-fieldset-border-color: var(--sc-base-200);
36
+ --sc-fieldset-border-width: var(--sc-form-border-width);
37
+
38
+ margin-top: var(--sc-fieldset-mt);
39
+ margin-bottom: var(--sc-fieldset-mb);
40
+ display: block;
41
+ border: var(--sc-fieldset-border-width) solid var(--sc-fieldset-border-color) !important;
42
+ padding: 1.25rem;
43
+ border-radius: var(--sc-rounded-lg);
44
+ }
45
+
46
+ fieldset {
47
+ all: unset;
48
+ display: contents;
49
+ }
50
+ ::slotted(sonic-legend) {
51
+ margin-bottom: 1.5rem;
52
+ display: block;
53
+ }
54
+ `,
55
+ ];
56
+ __decorate([
57
+ property({ type: Boolean, reflect: true })
58
+ ], Fieldset.prototype, "disabled", void 0);
59
+ __decorate([
60
+ property({ type: String })
61
+ ], Fieldset.prototype, "form", void 0);
62
+ Fieldset = __decorate([
63
+ customElement("sonic-fieldset")
64
+ ], Fieldset);
65
+ export { Fieldset };
66
+ //Ajout pour la creation du cem notamment pour Storybook
67
+ try {
68
+ customElements.define("sonic-fieldset", Fieldset);
69
+ }
70
+ catch (e) { }
@@ -0,0 +1,11 @@
1
+ import { LitElement } from "lit";
2
+ declare const Legend_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
3
+ export declare class Legend extends Legend_base {
4
+ static styles: import("lit").CSSResult[];
5
+ iconName: string;
6
+ iconPrefix: string;
7
+ description: string;
8
+ label: string;
9
+ render(): import("lit-html").TemplateResult<1>;
10
+ }
11
+ export {};