@supersoniks/concorde 1.1.42 → 1.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/components.js +2 -3
  2. package/concorde-core.bundle.js +37 -35
  3. package/concorde-core.es.js +5081 -4317
  4. package/core/_types/types.d.ts +26 -0
  5. package/core/_types/types.js +1 -0
  6. package/core/components/functional/date/date.d.ts +13 -5
  7. package/core/components/functional/date/date.js +48 -29
  8. package/core/components/functional/example/example.d.ts +1 -1
  9. package/core/components/functional/example/example.js +1 -1
  10. package/core/components/functional/fetch/fetch.d.ts +40 -3
  11. package/core/components/functional/fetch/fetch.js +2 -6
  12. package/core/components/functional/functional.d.ts +2 -0
  13. package/core/components/functional/functional.js +2 -0
  14. package/core/components/functional/if/if.d.ts +3 -0
  15. package/core/components/functional/if/if.js +6 -12
  16. package/core/components/functional/if/if.test.d.ts +1 -0
  17. package/core/components/functional/if/if.test.js +44 -0
  18. package/core/components/functional/list/list.d.ts +32 -8
  19. package/core/components/functional/list/list.js +33 -40
  20. package/core/components/functional/mix/mix.d.ts +22 -0
  21. package/core/components/functional/mix/mix.js +99 -0
  22. package/core/components/functional/queue/queue.d.ts +16 -3
  23. package/core/components/functional/queue/queue.js +71 -15
  24. package/core/components/functional/router/redirect.d.ts +10 -1
  25. package/core/components/functional/router/redirect.js +5 -6
  26. package/core/components/functional/router/router.d.ts +15 -1
  27. package/core/components/functional/router/router.js +1 -6
  28. package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +1 -1
  29. package/core/components/functional/sdui/SDUIDescriptorTransformer.js +24 -12
  30. package/core/components/functional/sdui/default-library.json +108 -0
  31. package/core/components/functional/sdui/sdui-utils.d.ts +5 -0
  32. package/core/components/functional/sdui/sdui-utils.js +63 -0
  33. package/core/components/functional/sdui/sdui.d.ts +16 -9
  34. package/core/components/functional/sdui/sdui.js +52 -25
  35. package/core/components/functional/sdui/types.d.ts +4 -2
  36. package/core/components/functional/states/states.d.ts +19 -3
  37. package/core/components/functional/states/states.js +7 -12
  38. package/core/components/functional/submit/submit.d.ts +16 -1
  39. package/core/components/functional/submit/submit.js +87 -17
  40. package/core/components/functional/subscriber/subscriber.d.ts +4 -1
  41. package/core/components/functional/subscriber/subscriber.js +1 -6
  42. package/core/components/functional/value/value.d.ts +7 -0
  43. package/core/components/functional/value/value.js +26 -0
  44. package/core/components/ui/_css/scroll.js +6 -7
  45. package/core/components/ui/_css/size.d.ts +1 -0
  46. package/core/components/ui/_css/size.js +3 -1
  47. package/core/components/ui/alert/alert.d.ts +2 -2
  48. package/core/components/ui/alert/alert.js +11 -16
  49. package/core/components/ui/badge/badge.d.ts +3 -1
  50. package/core/components/ui/badge/badge.js +36 -22
  51. package/core/components/ui/button/button.d.ts +23 -20
  52. package/core/components/ui/button/button.js +59 -42
  53. package/core/components/ui/captcha/captcha.d.ts +14 -2
  54. package/core/components/ui/captcha/captcha.js +17 -12
  55. package/core/components/ui/card/card-footer.js +1 -8
  56. package/core/components/ui/card/card-header-descripton.js +3 -9
  57. package/core/components/ui/card/card-header.js +1 -6
  58. package/core/components/ui/card/card-main.js +0 -5
  59. package/core/components/ui/card/card.d.ts +1 -1
  60. package/core/components/ui/card/card.js +28 -12
  61. package/core/components/ui/divider/divider.d.ts +2 -0
  62. package/core/components/ui/divider/divider.js +43 -16
  63. package/core/components/ui/form/checkbox/checkbox.d.ts +53 -16
  64. package/core/components/ui/form/checkbox/checkbox.js +53 -28
  65. package/core/components/ui/form/css/form-control.d.ts +2 -0
  66. package/core/components/ui/form/css/form-control.js +145 -67
  67. package/core/components/ui/form/fieldset/fieldset.d.ts +8 -1
  68. package/core/components/ui/form/fieldset/fieldset.js +45 -8
  69. package/core/components/ui/form/fieldset/legend-description.js +0 -5
  70. package/core/components/ui/form/fieldset/legend.js +3 -6
  71. package/core/components/ui/form/form-actions/form-actions.d.ts +2 -0
  72. package/core/components/ui/form/form-actions/form-actions.js +26 -11
  73. package/core/components/ui/form/form-layout/form-layout.d.ts +5 -2
  74. package/core/components/ui/form/form-layout/form-layout.js +31 -9
  75. package/core/components/ui/form/input/input.d.ts +15 -18
  76. package/core/components/ui/form/input/input.js +87 -52
  77. package/core/components/ui/form/input/password-helper.d.ts +1 -1
  78. package/core/components/ui/form/input/password-helper.js +3 -2
  79. package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
  80. package/core/components/ui/form/input/same-value-helper.js +1 -0
  81. package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +2 -3
  82. package/core/components/ui/form/input-autocomplete/input-autocomplete.js +2 -6
  83. package/core/components/ui/form/radio/radio.d.ts +6 -0
  84. package/core/components/ui/form/radio/radio.js +7 -12
  85. package/core/components/ui/form/select/select.d.ts +23 -7
  86. package/core/components/ui/form/select/select.js +69 -38
  87. package/core/components/ui/form/textarea/textarea.d.ts +13 -13
  88. package/core/components/ui/form/textarea/textarea.js +29 -36
  89. package/core/components/ui/group/group.d.ts +11 -1
  90. package/core/components/ui/group/group.js +79 -17
  91. package/core/components/ui/icon/icon.d.ts +10 -3
  92. package/core/components/ui/icon/icon.js +16 -15
  93. package/core/components/ui/icon/icons.js +11 -8
  94. package/core/components/ui/icon/icons.json +1 -1
  95. package/core/components/ui/image/image.js +0 -5
  96. package/core/components/ui/link/link.d.ts +1 -1
  97. package/core/components/ui/link/link.js +2 -6
  98. package/core/components/ui/loader/loader.js +2 -8
  99. package/core/components/ui/menu/menu-item.js +4 -9
  100. package/core/components/ui/menu/menu.d.ts +9 -1
  101. package/core/components/ui/menu/menu.js +183 -27
  102. package/core/components/ui/modal/modal-actions.js +1 -6
  103. package/core/components/ui/modal/modal-close.d.ts +1 -0
  104. package/core/components/ui/modal/modal-close.js +14 -10
  105. package/core/components/ui/modal/modal-content.js +0 -5
  106. package/core/components/ui/modal/modal-subtitle.js +2 -6
  107. package/core/components/ui/modal/modal-title.js +0 -5
  108. package/core/components/ui/modal/modal.d.ts +7 -7
  109. package/core/components/ui/modal/modal.js +36 -36
  110. package/core/components/ui/pop/pop.d.ts +6 -5
  111. package/core/components/ui/pop/pop.js +44 -44
  112. package/core/components/ui/progress/progress.js +34 -32
  113. package/core/components/ui/table/table-caption.js +5 -10
  114. package/core/components/ui/table/table-tbody.js +10 -14
  115. package/core/components/ui/table/table-td.d.ts +2 -0
  116. package/core/components/ui/table/table-td.js +8 -5
  117. package/core/components/ui/table/table-tfoot.js +5 -7
  118. package/core/components/ui/table/table-th.d.ts +2 -0
  119. package/core/components/ui/table/table-th.js +12 -9
  120. package/core/components/ui/table/table-thead.js +1 -6
  121. package/core/components/ui/table/table-tr.js +4 -6
  122. package/core/components/ui/table/table.d.ts +0 -3
  123. package/core/components/ui/table/table.js +14 -31
  124. package/core/components/ui/taxonomy/taxonomy.d.ts +6 -3
  125. package/core/components/ui/taxonomy/taxonomy.js +9 -9
  126. package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
  127. package/core/components/ui/theme/theme-collection/dark.js +1 -1
  128. package/core/components/ui/theme/theme.d.ts +1 -6
  129. package/core/components/ui/theme/theme.js +7 -36
  130. package/core/components/ui/toast/message-subscriber.d.ts +13 -7
  131. package/core/components/ui/toast/toast-item.js +1 -1
  132. package/core/components/ui/toast/toast.d.ts +2 -1
  133. package/core/components/ui/toast/toast.js +29 -14
  134. package/core/components/ui/tooltip/tooltip.d.ts +1 -0
  135. package/core/components/ui/tooltip/tooltip.js +35 -14
  136. package/core/components/ui/ui.js +0 -3
  137. package/core/core.js +5 -6
  138. package/core/mixins/Fetcher.d.ts +19 -10
  139. package/core/mixins/Fetcher.js +26 -10
  140. package/core/mixins/FormCheckable.d.ts +17 -8
  141. package/core/mixins/FormCheckable.js +177 -22
  142. package/core/mixins/FormElement.d.ts +12 -7
  143. package/core/mixins/FormElement.js +42 -26
  144. package/core/mixins/FormInput.d.ts +8 -4
  145. package/core/mixins/FormInput.js +4 -3
  146. package/core/mixins/Subscriber.d.ts +7 -5
  147. package/core/mixins/Subscriber.js +34 -32
  148. package/core/utils/Arrays.d.ts +15 -15
  149. package/core/utils/DataBindObserver.d.ts +16 -9
  150. package/core/utils/DataBindObserver.js +23 -28
  151. package/core/utils/Electron.d.ts +5 -1
  152. package/core/utils/Electron.js +4 -2
  153. package/core/utils/HTML.d.ts +9 -2
  154. package/core/utils/HTML.js +22 -3
  155. package/core/utils/LocationHandler.d.ts +6 -5
  156. package/core/utils/LocationHandler.js +19 -8
  157. package/core/utils/Objects.d.ts +7 -4
  158. package/core/utils/Objects.js +28 -6
  159. package/core/utils/{PublisherProxy.d.mts → PublisherProxy.d.ts} +40 -31
  160. package/core/utils/{PublisherProxy.mjs → PublisherProxy.js} +54 -28
  161. package/core/utils/Utils.d.ts +3 -0
  162. package/core/utils/Utils.js +18 -0
  163. package/core/utils/api.d.ts +39 -7
  164. package/core/utils/api.js +45 -32
  165. package/img/concorde-logo.svg +1 -0
  166. package/img/concorde.png +0 -0
  167. package/img/concorde_def.png +0 -0
  168. package/mixins.d.ts +36 -18
  169. package/mixins.js +3 -4
  170. package/package.json +45 -10
  171. package/svg/regular/plane.svg +1 -0
  172. package/svg/solid/plane.svg +1 -0
  173. package/test-utils/TestUtils.d.ts +4 -0
  174. package/test-utils/TestUtils.js +12 -0
  175. package/utils.d.ts +3 -1
  176. package/utils.js +7 -5
  177. package/core/components/functional/configuration/configuration.d.ts +0 -5
  178. package/core/components/functional/configuration/configuration.js +0 -22
  179. package/core/components/ui/tabs/tab.d.ts +0 -6
  180. package/core/components/ui/tabs/tab.js +0 -46
  181. package/core/components/ui/tabs/tabs.d.ts +0 -15
  182. package/core/components/ui/tabs/tabs.js +0 -129
@@ -1,4 +1,4 @@
1
- import { LitElement, CSSResultGroup } from "lit";
1
+ import { LitElement, CSSResultGroup, PropertyValues } from "lit";
2
2
  import "@supersoniks/concorde/core/components/ui/icon/icon";
3
3
  declare const Checkbox_base: {
4
4
  new (...args: any[]): {
@@ -7,22 +7,32 @@ declare const Checkbox_base: {
7
7
  forceAutoFill: boolean;
8
8
  unique: true | null;
9
9
  radio: true | null;
10
- _checked: true | null;
11
- checked: true | null;
10
+ unCheckOnDisconnect: boolean;
11
+ _checked: true | "indeterminate" | null;
12
+ checked: true | "indeterminate" | null;
12
13
  validateFormElement(): void;
13
- setCheckedValue(checked: true | null): void;
14
+ checksAll(): boolean;
15
+ setCheckedValue(checked: true | "indeterminate" | null): void;
14
16
  handleChange(): void;
15
17
  getValueForFormPublisher(): any;
16
- setFormValueFromPublisher(value: any): void;
17
- initPublisher(): void;
18
+ setFormValueFromPublisher(value: string | (string | null)[] | null): void;
19
+ getCheckAllPublisher(): any;
20
+ updateAllChecked: () => void;
21
+ onChecksAllRequest: (value: string) => void;
22
+ disconnectedCallback(): void;
23
+ connectedCallback(): void;
18
24
  getFormPublisher(): any;
19
25
  updateDataValue(): void;
20
- handleBlur(e?: any): void;
26
+ handleBlur(e?: Event | undefined): void;
27
+ focus?: (() => void) | undefined;
28
+ shadowRoot?: ShadowRoot | undefined;
21
29
  error: boolean;
22
30
  autofocus: boolean;
23
31
  required: boolean;
24
32
  disabled: true | null;
25
33
  formDataProvider: string;
34
+ ariaLabelledby?: string | undefined;
35
+ ariaLabel?: string | undefined;
26
36
  _name: string;
27
37
  name: string;
28
38
  props: any;
@@ -42,12 +52,11 @@ declare const Checkbox_base: {
42
52
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
43
53
  removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
44
54
  removeAttribute(name: string): void;
55
+ initPublisher(): void;
45
56
  getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
46
- connectedCallback(): void;
47
57
  requestUpdate(): void;
48
58
  getAttribute(name: string): string;
49
59
  hasAttribute(attributeName: String): boolean;
50
- disconnectedCallback(): void;
51
60
  };
52
61
  } & {
53
62
  new (...args: any[]): {
@@ -63,16 +72,20 @@ declare const Checkbox_base: {
63
72
  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" | undefined;
64
73
  getFormPublisher(): any;
65
74
  updateDataValue(): void;
66
- handleChange(e?: any): void;
67
- handleBlur(e?: any): void;
75
+ handleChange(e?: Event | undefined): void;
76
+ handleBlur(e?: Event | undefined): void;
68
77
  getValueForFormPublisher(): any;
78
+ focus?: (() => void) | undefined;
79
+ shadowRoot?: ShadowRoot | undefined;
69
80
  error: boolean;
70
81
  autofocus: boolean;
71
82
  required: boolean;
72
83
  disabled: true | null;
73
84
  formDataProvider: string;
74
- _value: any;
75
- value: any;
85
+ ariaLabelledby?: string | undefined;
86
+ ariaLabel?: string | undefined;
87
+ _value: string | null;
88
+ value: string | null;
76
89
  _name: string;
77
90
  name: string;
78
91
  props: any;
@@ -100,15 +113,39 @@ declare const Checkbox_base: {
100
113
  hasAttribute(attributeName: String): boolean;
101
114
  disconnectedCallback(): void;
102
115
  };
103
- } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
116
+ } & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
117
+ /**
118
+ * ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
119
+ * **FormElement :**
120
+ * * 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é.
121
+ * * Par défault lorsque modifie l'input, la valeur est également mise à jour via le même dataprovider
122
+ * * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
123
+ * * 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.
124
+ * * **FormInput **
125
+ * 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.
126
+ * **FormCheckable :**
127
+ * * 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.
128
+ * **Comportements :**
129
+ * * multiple (par défaut):
130
+ * - on peut cocher plusieurs checkbox ayant le même *name*.
131
+ * - 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*.
132
+ * * unique (Ajouter l'attribute unique au composant a l'intégration):
133
+ * - on ne peut cocher qu'une seule checkbox ayant le même *name*.
134
+ * * radio (Ajouter l'attribute radio au composant a l'intégration):
135
+ * Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
136
+ */
104
137
  export declare class Checkbox extends Checkbox_base {
105
138
  static styles: CSSResultGroup[];
106
139
  touched: boolean;
107
140
  iconName: string;
108
- slotDescriptionNodes: Array<Node>;
141
+ indeterminateIconName: string;
109
142
  hasDescription: boolean;
110
- updated(): void;
143
+ hasLabel: boolean;
144
+ slotLabelNodes: Array<Node>;
145
+ slotDescriptionNodes: Array<Node>;
111
146
  connectedCallback(): void;
147
+ willUpdate(changedProperties: PropertyValues): void;
148
+ hasSlotOrProps(): void;
112
149
  render(): import("lit-html").TemplateResult<1>;
113
150
  }
114
151
  export {};
@@ -14,6 +14,7 @@ import FormCheckable from "@supersoniks/concorde/core/mixins/FormCheckable";
14
14
  import "@supersoniks/concorde/core/components/ui/icon/icon";
15
15
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
16
16
  import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
17
+ const tagName = "sonic-checkbox";
17
18
  /**
18
19
  * ### Le composent sonic-checkbox étend les mixins FormCheckable, FormInput, FormElement et Subscriber
19
20
  * **FormElement :**
@@ -34,30 +35,38 @@ import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
34
35
  * * radio (Ajouter l'attribute radio au composant a l'intégration):
35
36
  * Comme unique, mais on ne peut pas décocher la case sauf en en cochant une autre, comme un bouton radio.
36
37
  */
37
- const tagName = "sonic-checkbox";
38
38
  let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscriber(LitElement)))) {
39
39
  constructor() {
40
40
  super(...arguments);
41
41
  this.touched = false;
42
42
  this.iconName = "check";
43
+ this.indeterminateIconName = "minus-small";
43
44
  this.hasDescription = false;
44
- }
45
- updated() {
46
- var _a;
47
- this.hasDescription = this.description || ((_a = this.slotDescriptionNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
45
+ this.hasLabel = false;
48
46
  }
49
47
  connectedCallback() {
50
48
  this.type = "checkbox";
49
+ this.hasSlotOrProps();
51
50
  super.connectedCallback();
52
51
  }
52
+ willUpdate(changedProperties) {
53
+ this.hasSlotOrProps();
54
+ super.willUpdate(changedProperties);
55
+ }
56
+ hasSlotOrProps() {
57
+ var _a, _b;
58
+ this.hasLabel = this.label || ((_a = this.slotLabelNodes) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
59
+ this.hasDescription = this.description || ((_b = this.slotDescriptionNodes) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
60
+ }
53
61
  render() {
54
62
  //let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
55
63
  return html `
56
64
  <label class="checkbox-container ${this.disabled ? "disabled" : ""}">
65
+
57
66
  <span class="icon-container">
58
67
  <input
59
68
  type="${this.type}"
60
- @change=${this.handleChange}
69
+ @click=${this.handleChange}
61
70
  @blur=${this.handleBlur}
62
71
  ?required=${this.required}
63
72
  .disabled=${ifDefined(this.disabled)}
@@ -65,16 +74,20 @@ let Checkbox = class Checkbox extends FormCheckable(FormInput(FormElement(Subscr
65
74
  .name=${this.name}
66
75
  .value=${this.value}
67
76
  ?autofocus=${this.autofocus}
77
+ aria-label=${ifDefined(this.ariaLabel)}
78
+ aria-labelledby=${ifDefined(this.ariaLabelledby)}
68
79
  />
69
- <sonic-icon name="${this.iconName}" class="sc-input-icon"></sonic-icon>
80
+ <sonic-icon name="${this.checked == "indeterminate" ? this.indeterminateIconName : this.iconName}" class="sc-input-icon"></sonic-icon>
70
81
  </span>
71
- <div class="checkbox-text">
72
- ${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}
73
- <slot></slot>
74
- <slot name="description" class="${this.hasDescription ? "description" : "hidden"} ">
75
- ${this.description ? html `${unsafeHTML(this.description)}` : ""}
76
- </slot>
77
- </div>
82
+
83
+ <div class="checkbox-text ${!this.hasDescription && !this.hasLabel ? "hidden" : "checkbox-text"}">
84
+ ${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}
85
+ <slot @slotchange=${this.hasSlotOrProps}></slot>
86
+ <slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription ? "description" : "hidden"} ">
87
+ ${this.description ? html `${unsafeHTML(this.description)}` : ""}
88
+ </slot>
89
+ </div>
90
+ </label>
78
91
  </label>
79
92
  `;
80
93
  }
@@ -84,7 +97,9 @@ Checkbox.styles = [
84
97
  css `
85
98
  :host {
86
99
  --sc-checkbox-border-width: var(--sc-form-border-width);
87
- --sc-checkbox-border-color: transparent;
100
+ --sc-checkbox-border-color: var(--sc-input-border-color);
101
+ --sc-checkbox-bg: var(--sc-input-bg);
102
+ --sc-checkbox-color: transparent;
88
103
  }
89
104
 
90
105
  * {
@@ -118,7 +133,7 @@ Checkbox.styles = [
118
133
  transition: 0.2s;
119
134
  outline: none;
120
135
  margin: 0;
121
- background-color: var(--sc-base-200);
136
+ background-color: var(--sc-checkbox-bg);
122
137
  border: var(--sc-checkbox-border-width) solid var(--sc-checkbox-border-color);
123
138
  }
124
139
 
@@ -138,7 +153,7 @@ Checkbox.styles = [
138
153
  left: 50%;
139
154
  transform: translateX(-50%) translateY(-50%) scale(0);
140
155
  transition: transform 0.2s ease-in-out;
141
- color: var(--sc-primary-content);
156
+ color: var(--sc-checkbox-color);
142
157
  }
143
158
 
144
159
  /* .checkbox-text {
@@ -154,12 +169,13 @@ Checkbox.styles = [
154
169
 
155
170
  /*Active */
156
171
  input:checked,
157
- input[checked="true"] {
158
- background: var(--sc-primary);
172
+ input[checked] {
173
+ --sc-checkbox-border-color: var(--sc-primary);
174
+ --sc-checkbox-bg: var(--sc-primary);
159
175
  }
160
-
161
176
  input:checked + sonic-icon,
162
- input[checked="true"] + sonic-icon {
177
+ input[checked] + sonic-icon {
178
+ --sc-checkbox-color: var(--sc-primary-content);
163
179
  transform: translateX(-50%) translateY(-50%) scale(1);
164
180
  }
165
181
  /*DISABLED */
@@ -174,6 +190,11 @@ Checkbox.styles = [
174
190
  opacity: 0.6;
175
191
  }
176
192
 
193
+ /*INPUT HOVER*/
194
+ :host(:not([disabled])) label:hover input {
195
+ filter: brightness(0.97);
196
+ }
197
+
177
198
  ::slotted(a) {
178
199
  color: inherit;
179
200
  text-decoration: underline !important;
@@ -205,17 +226,21 @@ __decorate([
205
226
  property({ type: String })
206
227
  ], Checkbox.prototype, "iconName", void 0);
207
228
  __decorate([
208
- queryAssignedNodes({ slot: "description" })
209
- ], Checkbox.prototype, "slotDescriptionNodes", void 0);
229
+ property({ type: String })
230
+ ], Checkbox.prototype, "indeterminateIconName", void 0);
210
231
  __decorate([
211
232
  property({ type: Boolean })
212
233
  ], Checkbox.prototype, "hasDescription", void 0);
234
+ __decorate([
235
+ property({ type: Boolean })
236
+ ], Checkbox.prototype, "hasLabel", void 0);
237
+ __decorate([
238
+ queryAssignedNodes()
239
+ ], Checkbox.prototype, "slotLabelNodes", void 0);
240
+ __decorate([
241
+ queryAssignedNodes({ slot: "description" })
242
+ ], Checkbox.prototype, "slotDescriptionNodes", void 0);
213
243
  Checkbox = __decorate([
214
244
  customElement(tagName)
215
245
  ], Checkbox);
216
246
  export { Checkbox };
217
- //Ajout pour Storybook
218
- try {
219
- customElements.define(tagName, Checkbox);
220
- }
221
- catch (e) { }
@@ -1 +1,3 @@
1
+ export declare const label: import("lit").CSSResult;
2
+ export declare const description: import("lit").CSSResult;
1
3
  export declare const formControl: import("lit").CSSResult;
@@ -1,35 +1,51 @@
1
1
  import { css } from "lit";
2
+ export const label = css `
3
+ :host {
4
+ --sc-label-fs: var(--sc-fs, 1rem);
5
+ --sc-label-fw: var(--sc-label-font-weight);
6
+ }
7
+ label {
8
+ font-size: var(--sc-label-fs);
9
+ font-weight: var(--sc-label-fw);
10
+ line-height: 1.2;
11
+ }
12
+ .form-label {
13
+ margin-bottom: 0.22em;
14
+ display: block;
15
+ }
16
+ `;
17
+ export const description = css `
18
+ .form-description {
19
+ color: var(--sc-base-400);
20
+ font-size: 0.85em;
21
+ margin-top: 0.2em;
22
+ display: block;
23
+ }
24
+ `;
2
25
  export const formControl = css `
3
-
4
26
  * {
5
27
  box-sizing: border-box;
6
28
  }
7
29
 
8
30
  :host {
9
31
  --sc-input-height: var(--sc-form-height);
10
- --sc-input-border-width: var(--sc-form-border-width);
11
- --sc-input-color: var(--sc-base-content);
32
+ --sc-input-c: var(--sc-input-color, var(--sc-base-content));
33
+ --sc-input-b-width: var(--sc-form-border-width);
34
+ --sc-input-b-color: var(--sc-input-border-color);
12
35
 
13
36
  --sc-item-rounded-tr: var(--sc-input-rounded);
14
37
  --sc-item-rounded-tl: var(--sc-input-rounded);
15
38
  --sc-item-rounded-bl: var(--sc-input-rounded);
16
39
  --sc-item-rounded-br: var(--sc-input-rounded);
17
40
 
18
- --sc-input-fs: var(--sc-fs, 1rem) ;
41
+ --sc-input-fs: var(--sc-fs, 1rem);
19
42
  --sc-input-ff: inherit;
20
- --sc-input-py: 0.6em;
21
- --sc-input-px: 1.15em;
22
-
23
- --sc-input-prefix-color: var(--sc-input-color);
24
- --sc-input-prefix-bg: var(--sc-input-bg);
25
- --sc-input-prefix-border-color: var(--sc-input-border-color);
26
-
27
- --sc-input-suffix-color: var(--sc-input-color);
28
- --sc-input-suffix-bg: var(--sc-input-bg);
29
- --sc-input-suffix-border-color: var(--sc-input-border-color);
43
+ --sc-input-py: 0.55em;
44
+ --sc-input-px: clamp(0.3em, 8%, 1.1em);
30
45
 
31
- --sc-label-fs: var(--sc-fs, 1rem);
32
- --sc-label-fw: var(--sc-label-font-weight);
46
+ --sc-input-background: var(--sc-input-bg);
47
+ --sc-input-addon-c: var(--sc-input-addon-color, var(--sc-base));
48
+ --sc-input-addon-bg: var(--sc-input-c);
33
49
  }
34
50
 
35
51
  .form-element {
@@ -38,13 +54,13 @@ export const formControl = css `
38
54
  width: 100%;
39
55
 
40
56
  line-height: 1.1;
41
- color: var(--sc-input-color);
57
+ color: var(--sc-input-c);
42
58
  border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br)
43
59
  var(--sc-item-rounded-bl);
44
60
 
45
61
  font-family: var(--sc-input-ff);
46
- background-color: var(--sc-input-bg, var(--sc-base, #fff));
47
- border: var(--sc-input-border-width) solid var(--sc-input-border-color, var(--sc-base-300, #aaa));
62
+ background-color: var(--sc-input-background);
63
+ border: var(--sc-input-b-width) solid var(--sc-input-b-color, var(--sc-base-300, #aaa));
48
64
  width: 100%;
49
65
  font-size: var(--sc-input-fs);
50
66
 
@@ -56,12 +72,6 @@ export const formControl = css `
56
72
  min-height: var(--sc-input-height);
57
73
  }
58
74
 
59
- label {
60
- font-size: var(--sc-label-fs);
61
- font-weight: var(--sc-label-fw);
62
- line-height: 1.2;
63
- }
64
-
65
75
  .form-control {
66
76
  display: flex;
67
77
  width: 100%;
@@ -77,24 +87,24 @@ export const formControl = css `
77
87
  justify-content: center;
78
88
  line-height: 1.1;
79
89
  flex-shrink: 0;
80
- padding-left: calc(-1 * var(--sc-input-px));
81
- padding-right: calc(-1 * var(--sc-input-px));
90
+ padding-left: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px)));
91
+ padding-right: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px)));
82
92
  }
83
93
 
84
94
  :host(:not([inlineContent])) slot[name="prefix"] {
85
95
  border-radius: var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl);
86
- background-color: var(--sc-input-prefix-bg);
87
- color: var(--sc-input-prefix-color);
88
- border: var(--sc-input-border-width) solid var(--sc-input-prefix-border-color);
89
- margin-right: calc(-1 * var(--sc-input-border-width));
96
+ background-color: var(--sc-input-addon-bg);
97
+ color: var(--sc-input-addon-c);
98
+ /*margin-right: calc(-1 * var(--sc-input-b-width));
99
+ border: none;*/
90
100
  }
91
101
 
92
102
  :host(:not([inlineContent])) slot[name="suffix"] {
93
103
  border-radius: 0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0;
94
- background-color: var(--sc-input-suffix-bg);
95
- color: var(--sc-input-suffix-color);
96
- border: var(--sc-input-border-width) solid var(--sc-input-suffix-border-color);
97
- margin-left: calc(-1 * var(--sc-input-border-width));
104
+ background-color: var(--sc-input-addon-bg);
105
+ color: var(--sc-input-addon-c);
106
+ /*margin-left: calc(-1 * var(--sc-input-b-width));
107
+ border: none;*/
98
108
  }
99
109
 
100
110
  :host(:not([inlineContent])) .has-prefix .form-element {
@@ -107,20 +117,62 @@ export const formControl = css `
107
117
  border-bottom-right-radius: 0;
108
118
  }
109
119
 
120
+ slot[name="suffix"]::slotted(sonic-icon),
121
+ slot[name="prefix"]::slotted(sonic-icon) {
122
+ font-size: 1.2em;
123
+ }
124
+
110
125
  /*InlineCONTENT */
111
- :host([inlineContent]) {
112
- --sc-input-py: 0;
126
+
127
+ .form-element > slot,
128
+ .form-element .form-element {
129
+ all: unset;
113
130
  }
131
+
114
132
  :host([inlineContent]) .form-element {
115
133
  display: flex;
116
- flex-wrap: wrap;
117
134
  align-items: center;
118
135
  gap: 0.35em;
119
136
  min-height: var(--sc-form-height);
120
137
  }
121
138
 
139
+ :host([inlineContent]) .form-element .form-element {
140
+ appearance: none;
141
+ background: transparent;
142
+ border: none;
143
+ padding: 0;
144
+ display: block;
145
+ width: 50%;
146
+ min-width: 0;
147
+ flex: 1 1 auto;
148
+ height: auto;
149
+ min-height: auto;
150
+ border-radius: 0;
151
+ }
152
+ :host([inlineContent]) slot[name="prefix"]::slotted(*),
153
+ :host([inlineContent]) slot[name="suffix"]::slotted(*) {
154
+ display: block;
155
+ flex: 0 0 auto;
156
+ max-width: 100%;
157
+ max-width: 100%;
158
+ }
159
+
160
+ :host([inlineContent]) .has-suffix slot[name="suffix"] {
161
+ margin-right: calc(-0.5 * var(--sc-input-px));
162
+ }
163
+ :host([inlineContent]) .has-prefix slot[name="prefix"] {
164
+ margin-left: calc(-0.5 * var(--sc-input-px));
165
+ }
166
+
167
+ :host([inlineContent]) slot[name="suffix"]::slotted(*) {
168
+ margin-left: auto;
169
+ }
170
+
171
+ /* :host([inlineContent]) .input {
172
+
173
+ }*/
122
174
  /*Disabled */
123
- :host([disabled]) .form-element-container {
175
+ :host([disabled]) .form-control {
124
176
  cursor: not-allowed;
125
177
  }
126
178
 
@@ -131,9 +183,12 @@ export const formControl = css `
131
183
  /*Disbaled*/
132
184
  :host([disabled]) .form-element {
133
185
  pointer-events: none;
134
- background-color: var(--sc-base-100);
135
- border-color: transparent;
136
- color: var(--sc-base-400);
186
+ opacity: 0.5;
187
+ /* border-color: transparent;*/
188
+ }
189
+ :host([disabled]) .select-chevron {
190
+ display: none;
191
+ /* border-color: transparent;*/
137
192
  }
138
193
 
139
194
  /*PLACEHOLDER*/
@@ -142,8 +197,12 @@ export const formControl = css `
142
197
  opacity: 0.45;
143
198
  }
144
199
 
200
+ :host([placehoderAsLabel]) ::placeholder {
201
+ opacity: 1;
202
+ }
203
+
145
204
  :focus::placeholder {
146
- opacity: 0;
205
+ opacity: 0 !important;
147
206
  }
148
207
 
149
208
  /*HOVER*/
@@ -166,11 +225,6 @@ export const formControl = css `
166
225
  display: block;
167
226
  }
168
227
 
169
- .form-element > slot,
170
- .form-element .form-element {
171
- all: unset !important;
172
- }
173
-
174
228
  /*Utilitaires*/
175
229
  .hidden {
176
230
  display: none;
@@ -179,33 +233,32 @@ export const formControl = css `
179
233
  display: contents;
180
234
  }
181
235
 
182
-
183
236
  /*ERROR*/
184
237
  :host([error]) {
185
- --sc-input-border-color: var(--sc-danger);
238
+ --sc-input-b-color: var(--sc-danger);
186
239
  }
187
240
 
188
- :host input:visited{
189
- display:none;
241
+ :host input:visited {
242
+ display: none;
190
243
  }
191
244
 
192
245
  :host([touched][required]) :not(:focus):invalid {
193
- --sc-input-border-color: var(--sc-danger);
194
- --sc-input-color: var(--sc-danger);
246
+ --sc-input-b-color: var(--sc-danger);
247
+ --sc-input-c: var(--sc-danger);
195
248
  }
196
249
 
197
- :host([touched][required]) :not(:focus):invalid + .select-chevron{
198
- --sc-input-color: var(--sc-danger);
250
+ :host([touched][required]) :not(:focus):invalid + .select-chevron {
251
+ --sc-input-c: var(--sc-danger);
199
252
  }
200
253
 
201
254
  /*VALID*/
202
255
  :host([touched][required]) :not([value=""]):not(:focus):valid {
203
- --sc-input-border-color: var(--sc-success);
204
- --sc-input-color: var(--sc-success);
256
+ --sc-input-b-color: var(--sc-success);
257
+ --sc-input-c: var(--sc-success);
205
258
  }
206
259
 
207
- :host([touched][required]) :not(:focus):valid + .select-chevron{
208
- --sc-input-color: var(--sc-success);
260
+ :host([touched][required]) :not(:focus):valid + .select-chevron {
261
+ --sc-input-c: var(--sc-success);
209
262
  }
210
263
 
211
264
  /*Input COLOR*/
@@ -220,13 +273,13 @@ export const formControl = css `
220
273
  input[type="color"]::-webkit-color-swatch {
221
274
  border: none;
222
275
  border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br)
223
- var(--sc-item-rounded-bl);
276
+ var(--sc-item-rounded-bl);
224
277
  }
225
278
 
226
279
  /*Input Image*/
227
280
  :host([type="image"]) .form-element {
228
281
  padding: 0;
229
- border:none;
282
+ border: none;
230
283
  }
231
284
 
232
285
  /*Input reset & image*/
@@ -236,14 +289,39 @@ export const formControl = css `
236
289
  }
237
290
 
238
291
  /*Input search*/
292
+ :host([type="search"]) {
293
+ appearance: none !important;
294
+ }
295
+
239
296
  input[type="search"]::-webkit-search-cancel-button {
240
- appearance:none;
241
- cursor:pointer;
242
- height: .65em;
243
- width: .65em;
297
+ appearance: none;
298
+ cursor: pointer;
299
+ height: 0.65em;
300
+ width: 0.65em;
244
301
  background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE2LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgd2lkdGg9IjEyMy4wNXB4IiBoZWlnaHQ9IjEyMy4wNXB4IiB2aWV3Qm94PSIwIDAgMTIzLjA1IDEyMy4wNSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTIzLjA1IDEyMy4wNTsiDQoJIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZD0iTTEyMS4zMjUsMTAuOTI1bC04LjUtOC4zOTljLTIuMy0yLjMtNi4xLTIuMy04LjUsMGwtNDIuNCw0Mi4zOTlMMTguNzI2LDEuNzI2Yy0yLjMwMS0yLjMwMS02LjEwMS0yLjMwMS04LjUsMGwtOC41LDguNQ0KCQljLTIuMzAxLDIuMy0yLjMwMSw2LjEsMCw4LjVsNDMuMSw0My4xbC00Mi4zLDQyLjVjLTIuMywyLjMtMi4zLDYuMSwwLDguNWw4LjUsOC41YzIuMywyLjMsNi4xLDIuMyw4LjUsMGw0Mi4zOTktNDIuNGw0Mi40LDQyLjQNCgkJYzIuMywyLjMsNi4xLDIuMyw4LjUsMGw4LjUtOC41YzIuMy0yLjMsMi4zLTYuMSwwLTguNWwtNDIuNS00Mi40bDQyLjQtNDIuMzk5QzEyMy42MjUsMTcuMTI1LDEyMy42MjUsMTMuMzI1LDEyMS4zMjUsMTAuOTI1eiIvPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPC9zdmc+DQo=);
245
302
  background-size: contain;
246
303
  background-repeat: no-repeat;
247
- }
304
+ }
248
305
 
306
+ /* Text align */
307
+ :host([align="center"]) .form-element {
308
+ text-align: center;
309
+ }
310
+ :host([align="left"]) .form-element {
311
+ text-align: left;
312
+ }
313
+ :host([align="right"]) .form-element {
314
+ text-align: right;
315
+ }
316
+
317
+ /* No arrows ion input Number */
318
+ :host([noAppearance]) input[type="number"]::-webkit-outer-spin-button,
319
+ :host([noAppearance]) input[type="number"]::-webkit-inner-spin-button {
320
+ -webkit-appearance: none;
321
+ margin: 0;
322
+ }
323
+
324
+ :host([noAppearance]) input[type="number"] {
325
+ -moz-appearance: textfield !important;
326
+ }
249
327
  `;
@@ -1,5 +1,6 @@
1
1
  import { LitElement } from "lit";
2
- declare const Fieldset_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
2
+ import "./legend";
3
+ declare const Fieldset_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<any>) & typeof LitElement;
3
4
  export declare class Fieldset extends Fieldset_base {
4
5
  static styles: import("lit").CSSResult[];
5
6
  /**
@@ -10,6 +11,12 @@ export declare class Fieldset extends Fieldset_base {
10
11
  * Lier à un formulaire qui ne serait pas parent du fieldset
11
12
  */
12
13
  form?: string;
14
+ label?: string;
15
+ description?: string;
16
+ iconName?: string;
17
+ iconLibrary?: string;
18
+ iconPrefix?: string;
19
+ variant: "default" | "ghost" | "shadow";
13
20
  render(): import("lit-html").TemplateResult<1>;
14
21
  }
15
22
  export {};