@supersoniks/concorde 3.1.87 → 3.1.90

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "3.1.87",
3
+ "version": "3.1.90",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "",
@@ -142,7 +142,7 @@ export class Button extends FormCheckable(FormElement(Subscriber(LitElement))) {
142
142
  gap: var(--sc-btn-gap);
143
143
  }
144
144
 
145
- :host button:focus,
145
+ :host button:focus-visible,
146
146
  :host button:hover {
147
147
  filter: var(--sc-btn-hover-filter);
148
148
  }
@@ -201,7 +201,7 @@ export class Button extends FormCheckable(FormElement(Subscriber(LitElement))) {
201
201
  }
202
202
 
203
203
  /*GESTION DU FOCUS*/
204
- :host(:not([disabled])) button:focus {
204
+ :host(:not([disabled])) button:focus-visible {
205
205
  box-shadow: 0 0 0 0.18rem var(--sc-base-300, rgba(0, 0, 0, 0.18));
206
206
  border-color: var(--sc-base-300, rgba(0, 0, 0, 0.18)) !important;
207
207
  outline: none;
@@ -218,7 +218,7 @@ export class Button extends FormCheckable(FormElement(Subscriber(LitElement))) {
218
218
  background: transparent;
219
219
  }
220
220
 
221
- /*:host([variant="ghost"]) button:focus,*/
221
+ /*:host([variant="ghost"]) button:focus-visible,*/
222
222
  :host([variant="ghost"]) button:hover {
223
223
  background: var(--sc-btn-ghost-bg-hover);
224
224
  filter: none;
@@ -246,7 +246,7 @@ export class Button extends FormCheckable(FormElement(Subscriber(LitElement))) {
246
246
  background: transparent;
247
247
  }
248
248
 
249
- /*:host([variant="outline"]) button:focus,*/
249
+ /*:host([variant="outline"]) button:focus-visible,*/
250
250
  :host([variant="outline"]) button:hover {
251
251
  background: var(--btn-outline-bg-hover);
252
252
  }
@@ -279,7 +279,7 @@ export class Button extends FormCheckable(FormElement(Subscriber(LitElement))) {
279
279
  color: inherit;
280
280
  }
281
281
 
282
- :host([variant="link"]) button:focus,
282
+ :host([variant="link"]) button:focus-visible,
283
283
  :host([variant="link"]) button:hover {
284
284
  text-decoration: none;
285
285
  }
@@ -641,6 +641,7 @@ export class Button extends FormCheckable(FormElement(Subscriber(LitElement))) {
641
641
  aria-expanded=${ifDefined(this.sonicAriaExpanded)}
642
642
  aria-label=${ifDefined(this.ariaLabel)}
643
643
  aria-labelledby=${ifDefined(this.ariaLabelledby)}
644
+ ?disabled=${this.disabled}
644
645
  @click=${this.handleChange}
645
646
  @pointerdown=${this.handleRepeatStart}
646
647
  >
@@ -84,7 +84,7 @@ export class Checkbox extends FormCheckable(
84
84
  var(--sc-checkbox-border-color);
85
85
  }
86
86
 
87
- input:focus,
87
+ input:focus-visible,
88
88
  :host(:not([disabled])) input:active {
89
89
  box-shadow: 0 0 0 2px var(--sc-primary, var(--sc-base-content, #000));
90
90
  }
@@ -1,30 +1,32 @@
1
- import {html, LitElement, css} from "lit";
2
- import {customElement, property} from "lit/decorators.js";
3
- import {Modal} from "@supersoniks/concorde/core/components/ui/modal/modal";
4
- import {ifDefined} from "lit/directives/if-defined.js";
1
+ import { html, LitElement } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { Modal } from "@supersoniks/concorde/core/components/ui/modal/modal";
4
+ import { ifDefined } from "lit/directives/if-defined.js";
5
5
  import HTML from "@supersoniks/concorde/core/utils/HTML";
6
6
  const tagName = "sonic-modal-close";
7
7
 
8
8
  @customElement(tagName)
9
9
  export class ModalClose extends LitElement {
10
- static styles = [
11
- css`
12
- :host {
13
- position: sticky;
14
- display: block;
15
- align-self: flex-end;
16
- height: 0;
17
- top: 0.5rem;
18
- right: 0.5rem;
19
- transform: translate3d(calc(var(--sc-modal-px)), calc(-1 * var(--sc-modal-py)), 0);
20
- z-index: 20;
21
- }
22
- `,
23
- ];
10
+ @property() translation: Record<string, string> = {
11
+ fr: "Fermer la fenêtre",
12
+ en: "Close window",
13
+ de: "Fenster schließen",
14
+ nl: "Venster sluiten",
15
+ es: "Cerrar",
16
+ };
17
+
24
18
  @property() reset?: string;
25
19
 
20
+ connectedCallback() {
21
+ super.connectedCallback();
22
+ this.lang = document.documentElement.lang?.split("-")[0] ?? "fr";
23
+ }
26
24
  render() {
27
- return html`<sonic-button reset=${ifDefined(this.reset)} shape="circle" @click=${this.handleClick}
25
+ return html`<sonic-button
26
+ aria-label=${this.translation[this.lang]}
27
+ reset=${ifDefined(this.reset)}
28
+ shape="circle"
29
+ @click=${this.handleClick}
28
30
  ><sonic-icon name="cancel" size="lg"></sonic-icon
29
31
  ></sonic-button>`;
30
32
  }
@@ -6,7 +6,6 @@
6
6
  Simple modal
7
7
  </sonic-button>
8
8
  <sonic-modal id="modalExample">
9
- <sonic-modal-close></sonic-modal-close>
10
9
  <sonic-modal-title
11
10
  >Lorem ipsum dolor sit amet <sonic-badge type="danger" size="sm">+33</sonic-badge></sonic-modal-title
12
11
  >
@@ -31,7 +30,6 @@
31
30
  <template>
32
31
  <sonic-button onclick="document.getElementById('modalText').show()"> Long text </sonic-button>
33
32
  <sonic-modal align="left" id="modalText">
34
- <sonic-modal-close></sonic-modal-close>
35
33
  <sonic-modal-title>Infos et tarifs </sonic-modal-title>
36
34
  <sonic-modal-content>
37
35
  <div class="prose">
@@ -97,7 +95,6 @@
97
95
  <template>
98
96
  <sonic-button onclick="document.getElementById('CustomWidth').show()"> Custom width </sonic-button>
99
97
  <sonic-modal maxHeight="50vh" maxWidth="90vw" width="100%" height="100%" id="CustomWidth">
100
- <sonic-modal-close></sonic-modal-close>
101
98
  <sonic-image
102
99
  cover
103
100
  objectPosition="center 20%"
@@ -113,7 +110,6 @@
113
110
  <template>
114
111
  <sonic-button onclick="document.getElementById('Fullscreen').show()"> Fullscreen </sonic-button>
115
112
  <sonic-modal fullscreen id="Fullscreen">
116
- <sonic-modal-close></sonic-modal-close>
117
113
  <sonic-image
118
114
  cover
119
115
  src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"