@supersoniks/concorde 5.0.1 → 5.0.2
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/build-infos.json +1 -1
- package/concorde-core.bundle.js +519 -586
- package/concorde-core.es.js +3783 -3689
- package/dist/concorde-core.bundle.js +519 -586
- package/dist/concorde-core.es.js +3783 -3689
- package/index.html +2 -2
- package/package.json +14 -1
- package/src/core/components/ui/_css/rounded.ts +36 -0
- package/src/core/components/ui/_css/type.ts +49 -0
- package/src/core/components/ui/_i18n/ui-aria-labels.ts +104 -0
- package/src/core/components/ui/alert/alert.md +128 -72
- package/src/core/components/ui/alert/alert.spec.ts +145 -0
- package/src/core/components/ui/alert/alert.ts +86 -91
- package/src/core/components/ui/alert-messages/alert-messages.ts +1 -1
- package/src/core/components/ui/badge/badge.md +126 -78
- package/src/core/components/ui/badge/badge.ts +29 -81
- package/src/core/components/ui/button/button.md +1 -0
- package/src/core/components/ui/button/button.ts +11 -8
- package/src/core/components/ui/card/card-header.ts +7 -2
- package/src/core/components/ui/card/card.md +120 -65
- package/src/core/components/ui/divider/divider.ts +4 -9
- package/src/core/components/ui/form/fieldset/legend-description.ts +1 -1
- package/src/core/components/ui/form/fieldset/legend.ts +1 -1
- package/src/core/components/ui/form/input/input.md +1 -1
- package/src/core/components/ui/form/input/input.ts +19 -15
- package/src/core/components/ui/form/textarea/textarea.md +1 -1
- package/src/core/components/ui/image/image.md +147 -53
- package/src/core/components/ui/image/image.ts +10 -44
- package/src/core/components/ui/link/link.md +2 -2
- package/src/core/components/ui/link/link.ts +42 -37
- package/src/core/components/ui/modal/modal-close.ts +8 -12
- package/src/core/components/ui/modal/modal.ts +18 -18
- package/src/core/components/ui/pop/pop.md +7 -5
- package/src/core/components/ui/pop/pop.ts +78 -38
- package/src/core/components/ui/table/table.ts +2 -8
- package/src/core/components/ui/toast/dismissed.ts +14 -0
- package/src/core/components/ui/toast/toast-item.ts +139 -91
- package/src/core/components/ui/toast/toast.ts +4 -7
- package/src/core/components/ui/tooltip/tooltip.ts +6 -8
- package/src/core/utils/LocationHandler.ts +12 -5
- package/src/core/utils/dismissed.ts +22 -0
- package/src/core/utils/positioning.spec.ts +28 -0
- package/src/core/utils/positioning.ts +19 -0
- package/src/docs/_getting-started/concorde-outside.md +3 -3
- package/src/docs/code.ts +3 -1
- package/src/docs/search/docs-search.json +541 -1
- package/src/docs/tailwind/css/tailwind.css +6 -0
- package/src/tsconfig.json +422 -383
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +50 -3
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
fontSize,
|
|
5
5
|
Size,
|
|
6
6
|
} from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
7
|
+
import { typesBg } from "@supersoniks/concorde/core/components/ui/_css/type";
|
|
7
8
|
|
|
8
9
|
const tagName = "sonic-badge";
|
|
9
10
|
/**
|
|
@@ -15,125 +16,73 @@ const tagName = "sonic-badge";
|
|
|
15
16
|
export class Badge extends LitElement {
|
|
16
17
|
static styles = [
|
|
17
18
|
fontSize,
|
|
19
|
+
typesBg,
|
|
18
20
|
css`
|
|
19
21
|
:host {
|
|
20
|
-
--sc-
|
|
21
|
-
--sc-
|
|
22
|
-
--sc-
|
|
23
|
-
|
|
24
|
-
--sc-
|
|
25
|
-
--sc-
|
|
26
|
-
|
|
27
|
-
/*--sc-badge-border-width: var(--sc-form-border-width, 0.1rem);*/
|
|
28
|
-
--sc-badge-border-width: 1px;
|
|
29
|
-
--sc-badge-border-color: transparent;
|
|
30
|
-
--sc-badge-border: var(--sc-badge-border-width) solid
|
|
31
|
-
var(--sc-badge-border-color);
|
|
32
|
-
|
|
33
|
-
--sc-badge-rounded: 0.85em;
|
|
34
|
-
--sc-badge-fw: var(--sc-font-weight-base, 400);
|
|
22
|
+
--sc-_gap: 0.3em;
|
|
23
|
+
--sc-_py: 0.35em;
|
|
24
|
+
--sc-_px: 0.67em;
|
|
25
|
+
--sc-_rounded: 0.85em;
|
|
26
|
+
--sc-_fw: var(--sc-font-weight-base, 400);
|
|
27
|
+
--sc-_border-width: 1px;
|
|
28
|
+
--sc-_border-color: transparent;
|
|
35
29
|
|
|
36
30
|
display: inline-flex;
|
|
37
31
|
align-items: center;
|
|
32
|
+
gap: var(--sc-_gap);
|
|
38
33
|
box-sizing: border-box;
|
|
39
|
-
line-height: var(--sc-_lh);
|
|
40
|
-
border-radius: var(--sc-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
padding-top: var(--sc-badge-py);
|
|
49
|
-
padding-bottom: var(--sc-badge-py);
|
|
50
|
-
padding-left: var(--sc-badge-px);
|
|
51
|
-
padding-right: var(--sc-badge-px);
|
|
52
|
-
/**Round pour lissage px */
|
|
53
|
-
min-height: round(calc(var(--sc-badge-px) * 2), 1px);
|
|
54
|
-
min-width: round(calc(var(--sc-badge-px) * 2), 1px);
|
|
55
|
-
border: var(--sc-badge-border);
|
|
34
|
+
line-height: var(--sc-_lh, 1);
|
|
35
|
+
border-radius: var(--sc-_rounded);
|
|
36
|
+
font-family: var(--sc-font-family-base, sans-serif);
|
|
37
|
+
font-weight: var(--sc-_fw);
|
|
38
|
+
padding: var(--sc-_py) var(--sc-_px);
|
|
39
|
+
min-height: round(calc(var(--sc-_px) * 2), 1px);
|
|
40
|
+
min-width: round(calc(var(--sc-_px) * 2), 1px);
|
|
41
|
+
border: var(--sc-_border-width) solid var(--sc-_border-color);
|
|
56
42
|
-webkit-print-color-adjust: exact;
|
|
57
43
|
}
|
|
58
44
|
|
|
59
|
-
/*TYPES*/
|
|
60
|
-
:host([type="primary"]) {
|
|
61
|
-
--sc-badge-color: var(--sc-primary-content, var(--sc-base, #fff));
|
|
62
|
-
--sc-badge-bg: var(--sc-primary, var(--sc-base-content, #000));
|
|
63
|
-
}
|
|
64
|
-
:host([type="warning"]) {
|
|
65
|
-
--sc-badge-color: var(--sc-warning-content, var(--sc-base, #fff));
|
|
66
|
-
--sc-badge-bg: var(--sc-warning, var(--sc-base-content, #000));
|
|
67
|
-
}
|
|
68
|
-
:host([type="danger"]) {
|
|
69
|
-
--sc-badge-color: var(--sc-danger-content, var(--sc-base, #fff));
|
|
70
|
-
--sc-badge-bg: var(--sc-danger, var(--sc-base-content, #000));
|
|
71
|
-
}
|
|
72
|
-
:host([type="info"]) {
|
|
73
|
-
--sc-badge-color: var(--sc-info-content, var(--sc-base, #fff));
|
|
74
|
-
--sc-badge-bg: var(--sc-info, var(--sc-base-content, #000));
|
|
75
|
-
}
|
|
76
|
-
:host([type="success"]) {
|
|
77
|
-
--sc-badge-color: var(--sc-success-content, var(--sc-base, #fff));
|
|
78
|
-
--sc-badge-bg: var(--sc-success, var(--sc-base-content, #000));
|
|
79
|
-
}
|
|
80
|
-
:host([type="neutral"]) {
|
|
81
|
-
--sc-badge-color: var(--sc-base, #fff);
|
|
82
|
-
--sc-badge-bg: var(--sc-base-content, #000);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
:host([contrast]),
|
|
86
|
-
:host([type="contrast"]) {
|
|
87
|
-
--sc-badge-color: var(--sc-contrast-content, #fff);
|
|
88
|
-
--sc-badge-bg: var(--sc-contrast, #000);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/*SIZE*/
|
|
92
|
-
:host {
|
|
93
|
-
gap: var(--sc-badge-gap);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
45
|
:host([size="2xs"]),
|
|
97
46
|
:host([size="xs"]),
|
|
98
47
|
:host([size="sm"]) {
|
|
99
|
-
--sc-
|
|
48
|
+
--sc-_gap: 0.35em;
|
|
100
49
|
}
|
|
101
50
|
|
|
102
51
|
:host([size="lg"]),
|
|
103
52
|
:host([size="xl"]) {
|
|
104
53
|
--sc-_lh: 1.2;
|
|
105
|
-
--sc-
|
|
54
|
+
--sc-_gap: 0.5em;
|
|
106
55
|
}
|
|
107
56
|
|
|
108
57
|
/*OUTLINE*/
|
|
109
58
|
:host([variant="outline"][type]) {
|
|
110
|
-
border-width: var(--sc-
|
|
111
|
-
border-color: var(--sc-
|
|
112
|
-
color: var(--sc-
|
|
59
|
+
border-width: var(--sc-_border-width) !important;
|
|
60
|
+
border-color: var(--sc-_bg);
|
|
61
|
+
color: var(--sc-_bg);
|
|
113
62
|
background: transparent;
|
|
114
63
|
}
|
|
115
64
|
|
|
116
65
|
:host([variant="outline"][type="default"]) {
|
|
117
|
-
border-color: var(--sc-
|
|
118
|
-
color: var(--sc-
|
|
66
|
+
border-color: var(--sc-_color);
|
|
67
|
+
color: var(--sc-_color);
|
|
119
68
|
background: transparent;
|
|
120
69
|
}
|
|
121
70
|
|
|
122
71
|
/*GHOST*/
|
|
123
72
|
:host([variant="ghost"][type]) {
|
|
124
|
-
color: var(--sc-
|
|
73
|
+
color: var(--sc-_bg);
|
|
125
74
|
background: transparent;
|
|
126
75
|
padding: 0;
|
|
127
76
|
}
|
|
128
77
|
|
|
129
78
|
@media (forced-colors: active) {
|
|
130
79
|
:host([variant="ghost"][type]) {
|
|
131
|
-
padding: var(--sc-
|
|
80
|
+
padding: var(--sc-_py) var(--sc-_px);
|
|
132
81
|
}
|
|
133
82
|
}
|
|
134
|
-
|
|
83
|
+
/* surcharge du default pour le ghost */
|
|
135
84
|
:host([variant="ghost"][type="default"]) {
|
|
136
|
-
color: var(--sc-
|
|
85
|
+
color: var(--sc-_color);
|
|
137
86
|
background: transparent;
|
|
138
87
|
}
|
|
139
88
|
|
|
@@ -169,7 +118,6 @@ export class Badge extends LitElement {
|
|
|
169
118
|
| "danger"
|
|
170
119
|
| "success"
|
|
171
120
|
| "info"
|
|
172
|
-
| "contrast"
|
|
173
121
|
| "neutral" = "default";
|
|
174
122
|
/**
|
|
175
123
|
* Le composant par defaut sans se paramètre à forte afordance
|
|
@@ -71,6 +71,7 @@ The length of the button depends on the size of its content
|
|
|
71
71
|
<template>
|
|
72
72
|
<sonic-button loading></sonic-button>
|
|
73
73
|
<sonic-button loading>Loading button</sonic-button>
|
|
74
|
+
<sonic-button loading><span slot="prefix">🚀</span>Loading with prefix<span slot="suffix">😂</span></sonic-button>
|
|
74
75
|
</template>
|
|
75
76
|
</sonic-code>
|
|
76
77
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import LocationHandler
|
|
1
|
+
import LocationHandler, {
|
|
2
|
+
type AutoActiveMode,
|
|
3
|
+
} from "@supersoniks/concorde/core/utils/LocationHandler";
|
|
2
4
|
import { html, LitElement, css, CSSResultGroup } from "lit";
|
|
3
5
|
import {
|
|
4
6
|
customElement,
|
|
@@ -381,8 +383,9 @@ export class Button extends FormCheckable(FormElement(LitElement)) {
|
|
|
381
383
|
position: relative;
|
|
382
384
|
}
|
|
383
385
|
|
|
384
|
-
:host([loading]) slot
|
|
385
|
-
|
|
386
|
+
:host([loading]) slot,
|
|
387
|
+
:host([loading]) slot::slotted(*) {
|
|
388
|
+
visibility: hidden !important;
|
|
386
389
|
pointer-events: none;
|
|
387
390
|
}
|
|
388
391
|
/*Loading*/
|
|
@@ -395,8 +398,8 @@ export class Button extends FormCheckable(FormElement(LitElement)) {
|
|
|
395
398
|
align-items: center;
|
|
396
399
|
justify-content: center;
|
|
397
400
|
line-height: 0;
|
|
398
|
-
height: var(--sc-btn-
|
|
399
|
-
width: var(--sc-btn-
|
|
401
|
+
height: var(--sc-btn-fs);
|
|
402
|
+
width: var(--sc-btn-fs);
|
|
400
403
|
animation: rotation 2s infinite linear;
|
|
401
404
|
}
|
|
402
405
|
|
|
@@ -479,8 +482,7 @@ export class Button extends FormCheckable(FormElement(LitElement)) {
|
|
|
479
482
|
* - strict-path-only : l'url courante match exactement avec le path du bouton sans les query params
|
|
480
483
|
* - disabled : aucune activation / désactivation
|
|
481
484
|
*/
|
|
482
|
-
@property({ type: String }) autoActive:
|
|
483
|
-
"partial";
|
|
485
|
+
@property({ type: String }) autoActive: AutoActiveMode = "partial";
|
|
484
486
|
|
|
485
487
|
/**
|
|
486
488
|
* Laisse apparaitre un loader en remplacement du contenu du bouton.
|
|
@@ -627,7 +629,7 @@ export class Button extends FormCheckable(FormElement(LitElement)) {
|
|
|
627
629
|
flexDirection: this.direction,
|
|
628
630
|
alignItems: this.alignItems,
|
|
629
631
|
justifyContent: this.justify,
|
|
630
|
-
|
|
632
|
+
textAlign: this.align,
|
|
631
633
|
minWidth: this.minWidth,
|
|
632
634
|
};
|
|
633
635
|
|
|
@@ -640,6 +642,7 @@ export class Button extends FormCheckable(FormElement(LitElement)) {
|
|
|
640
642
|
aria-expanded=${ifDefined(this.sonicAriaExpanded)}
|
|
641
643
|
aria-label=${ifDefined(this.ariaLabel)}
|
|
642
644
|
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
645
|
+
aria-busy=${ifDefined(this.loading ? "true" : undefined)}
|
|
643
646
|
?disabled=${this.disabled}
|
|
644
647
|
@click=${this.handleChange}
|
|
645
648
|
@pointerdown=${this.handleRepeatStart}
|
|
@@ -10,7 +10,7 @@ export class CardHeader extends LitElement {
|
|
|
10
10
|
css`
|
|
11
11
|
:host {
|
|
12
12
|
--sc-card-header-mb: 1.35rem;
|
|
13
|
-
--sc-card-header-font-size: 1.
|
|
13
|
+
--sc-card-header-font-size: 1.5rem;
|
|
14
14
|
--sc-card-header-font-weight: var(--sc-headings-font-weight, 700);
|
|
15
15
|
--sc-card-header-font-style: var(--sc-headings-font-style, normal);
|
|
16
16
|
--sc-card-header-family: var(
|
|
@@ -42,8 +42,13 @@ export class CardHeader extends LitElement {
|
|
|
42
42
|
flex-shrink: 0;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
::slotted([slot="suffix"]) {
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
sonic-card-header-description,
|
|
45
50
|
::slotted(sonic-card-header-description) {
|
|
46
|
-
margin-top: 0.
|
|
51
|
+
margin-top: 0.12em;
|
|
47
52
|
}
|
|
48
53
|
`,
|
|
49
54
|
];
|
|
@@ -1,97 +1,152 @@
|
|
|
1
1
|
# Card
|
|
2
2
|
|
|
3
|
+
A **surface** for grouped content: padding, radius, shadow, and semantic **`type`** colors via shared theme tokens. Compose **`sonic-card-header`**, **`sonic-card-main`**, and **`sonic-card-footer`** inside the card, or put any markup in the default slot.
|
|
4
|
+
|
|
5
|
+
Default **`type`** is `base` (page background). Use `light` for a subtle gray panel, `invert` / `neutral` for high-contrast blocks, and `primary`, `info`, `success`, `warning`, or `danger` for tinted surfaces (divider tokens apply on colored types).
|
|
6
|
+
|
|
3
7
|
## Type
|
|
8
|
+
|
|
4
9
|
<sonic-code>
|
|
5
10
|
<template>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
<div class="flex flex-wrap gap-3">
|
|
12
|
+
<sonic-card type="base" class="min-w-[8rem]">Base</sonic-card>
|
|
13
|
+
<sonic-card type="light" class="min-w-[8rem]">Light</sonic-card>
|
|
14
|
+
<sonic-card type="primary" class="min-w-[8rem]">Primary</sonic-card>
|
|
15
|
+
<sonic-card type="info" class="min-w-[8rem]">Info</sonic-card>
|
|
16
|
+
<sonic-card type="success" class="min-w-[8rem]">Success</sonic-card>
|
|
17
|
+
<sonic-card type="warning" class="min-w-[8rem]">Warning</sonic-card>
|
|
18
|
+
<sonic-card type="danger" class="min-w-[8rem]">Danger</sonic-card>
|
|
19
|
+
<sonic-card type="neutral" class="min-w-[8rem]">Neutral</sonic-card>
|
|
20
|
+
<sonic-card type="invert" class="min-w-[8rem]">Invert</sonic-card>
|
|
21
|
+
</div>
|
|
17
22
|
</template>
|
|
18
23
|
</sonic-code>
|
|
19
24
|
|
|
20
25
|
## Header
|
|
26
|
+
|
|
27
|
+
Quick titles with **`label`** and **`description`** attributes, or full control through the default slot. **`slot="suffix"`** aligns badges or actions on the right; suffix content does not shrink when the title wraps.
|
|
28
|
+
|
|
21
29
|
<sonic-code>
|
|
22
30
|
<template>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
<div class="grid gap-4 max-w-xl">
|
|
32
|
+
<sonic-card>
|
|
33
|
+
<sonic-card-header
|
|
34
|
+
label="Account settings"
|
|
35
|
+
description="Manage your profile and preferences."
|
|
36
|
+
></sonic-card-header>
|
|
37
|
+
<p class="m-0 text-sm opacity-80">Body content goes in the card slot or in <code>sonic-card-main</code>.</p>
|
|
38
|
+
</sonic-card>
|
|
39
|
+
|
|
40
|
+
<sonic-card type="neutral">
|
|
41
|
+
<sonic-card-header label="Notifications">
|
|
42
|
+
<sonic-card-header-description>
|
|
43
|
+
Choose what we email you about.
|
|
44
|
+
</sonic-card-header-description>
|
|
45
|
+
<sonic-badge slot="suffix" type="warning" size="xs">3 new</sonic-badge>
|
|
46
|
+
</sonic-card-header>
|
|
47
|
+
</sonic-card>
|
|
48
|
+
|
|
49
|
+
<sonic-card>
|
|
50
|
+
<sonic-card-header label="Team workspace" description="Shared with 12 members">
|
|
51
|
+
<sonic-button
|
|
52
|
+
slot="suffix"
|
|
53
|
+
shape="circle"
|
|
54
|
+
variant="outline"
|
|
55
|
+
size="sm"
|
|
56
|
+
type="default"
|
|
57
|
+
icon
|
|
58
|
+
data-aria-label="Workspace settings"
|
|
59
|
+
>
|
|
60
|
+
<sonic-icon library="iconoir" name="settings"></sonic-icon>
|
|
61
|
+
</sonic-button>
|
|
62
|
+
</sonic-card-header>
|
|
63
|
+
</sonic-card>
|
|
64
|
+
|
|
65
|
+
<sonic-card type="primary">
|
|
66
|
+
<sonic-card-header>
|
|
67
|
+
<div>Custom header</div>
|
|
68
|
+
<sonic-card-header-description>
|
|
69
|
+
Use the header slot when attributes are not enough.
|
|
70
|
+
</sonic-card-header-description>
|
|
71
|
+
<sonic-button slot="suffix" shape="circle" variant="ghost" size="sm" type="primary" icon>
|
|
72
|
+
<sonic-icon library="iconoir" name="nav-arrow-right"></sonic-icon>
|
|
73
|
+
</sonic-button>
|
|
74
|
+
</sonic-card-header>
|
|
75
|
+
</sonic-card>
|
|
76
|
+
</div>
|
|
44
77
|
</template>
|
|
45
78
|
</sonic-code>
|
|
46
79
|
|
|
80
|
+
`label` and `description` accept HTML (rendered as markup). Prefer plain text when possible; use the slot for structured content.
|
|
81
|
+
|
|
47
82
|
## Main
|
|
83
|
+
|
|
84
|
+
Optional wrapper for the primary content area (typography, media, forms).
|
|
85
|
+
|
|
48
86
|
<sonic-code>
|
|
49
87
|
<template>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
88
|
+
<sonic-card class="max-w-xl">
|
|
89
|
+
<sonic-card-header label="Release notes" description="Version 2.4"></sonic-card-header>
|
|
90
|
+
<sonic-card-main>
|
|
91
|
+
<p class="mt-0">
|
|
92
|
+
Improved performance on large lists and fixed an issue with keyboard navigation in menus.
|
|
93
|
+
</p>
|
|
94
|
+
<sonic-divider></sonic-divider>
|
|
95
|
+
<p class="mb-0 text-sm opacity-80">See the changelog for details.</p>
|
|
96
|
+
</sonic-card-main>
|
|
97
|
+
</sonic-card>
|
|
57
98
|
</template>
|
|
58
99
|
</sonic-code>
|
|
59
100
|
|
|
60
101
|
## Footer
|
|
102
|
+
|
|
103
|
+
Optional footer for actions, metadata, or secondary text.
|
|
104
|
+
|
|
61
105
|
<sonic-code>
|
|
62
106
|
<template>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
107
|
+
<sonic-card class="max-w-xl">
|
|
108
|
+
<sonic-card-header label="Confirm deletion"></sonic-card-header>
|
|
109
|
+
<sonic-card-main>
|
|
110
|
+
<p class="m-0">This project and all of its data will be removed permanently.</p>
|
|
111
|
+
</sonic-card-main>
|
|
112
|
+
<sonic-card-footer>
|
|
113
|
+
<sonic-divider></sonic-divider>
|
|
114
|
+
<div class="flex flex-wrap gap-2 justify-end">
|
|
115
|
+
<sonic-button variant="ghost" size="sm">Cancel</sonic-button>
|
|
116
|
+
<sonic-button type="danger" size="sm">Delete</sonic-button>
|
|
70
117
|
</div>
|
|
71
|
-
</
|
|
72
|
-
</sonic-card
|
|
73
|
-
</sonic-card>
|
|
118
|
+
</sonic-card-footer>
|
|
119
|
+
</sonic-card>
|
|
74
120
|
</template>
|
|
75
121
|
</sonic-code>
|
|
76
122
|
|
|
123
|
+
## Full example
|
|
124
|
+
|
|
125
|
+
Header, media, body, and footer together.
|
|
77
126
|
|
|
78
|
-
## Example of use
|
|
79
127
|
<sonic-code>
|
|
80
128
|
<template>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
129
|
+
<sonic-card class="max-w-md">
|
|
130
|
+
<sonic-card-header label="Featured route" description="San Francisco → New York">
|
|
131
|
+
<sonic-icon slot="suffix" library="iconoir" name="airplane"></sonic-icon>
|
|
132
|
+
</sonic-card-header>
|
|
133
|
+
<sonic-card-main>
|
|
134
|
+
<sonic-image
|
|
135
|
+
rounded
|
|
136
|
+
ratio="16/9"
|
|
137
|
+
src="https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80"
|
|
138
|
+
alt=""
|
|
139
|
+
></sonic-image>
|
|
140
|
+
<p class="mb-0">
|
|
141
|
+
Nonstop flight with flexible dates. Prices shown include taxes and fees.
|
|
142
|
+
</p>
|
|
143
|
+
</sonic-card-main>
|
|
144
|
+
<sonic-card-footer>
|
|
145
|
+
<div class="flex items-center justify-between gap-3 flex-wrap">
|
|
146
|
+
<span class="text-sm font-semibold">From $249</span>
|
|
147
|
+
<sonic-button type="primary" size="sm">Book</sonic-button>
|
|
148
|
+
</div>
|
|
149
|
+
</sonic-card-footer>
|
|
150
|
+
</sonic-card>
|
|
96
151
|
</template>
|
|
97
152
|
</sonic-code>
|
|
@@ -6,12 +6,13 @@ import {
|
|
|
6
6
|
query,
|
|
7
7
|
} from "lit/decorators.js";
|
|
8
8
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
9
|
+
import { Size } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
9
10
|
const tagName = "sonic-divider";
|
|
10
11
|
@customElement(tagName)
|
|
11
12
|
export class Divider extends LitElement {
|
|
12
13
|
static styles = [
|
|
13
14
|
css`
|
|
14
|
-
:host {
|
|
15
|
+
:host {
|
|
15
16
|
--sc-divider-my: 0.5rem;
|
|
16
17
|
--sc-divider-mx: 0;
|
|
17
18
|
--sc-divider-border-width: max(
|
|
@@ -150,14 +151,8 @@ export class Divider extends LitElement {
|
|
|
150
151
|
divider!: HTMLDivElement;
|
|
151
152
|
|
|
152
153
|
@property({ type: String }) label = "";
|
|
153
|
-
@property({ type: String, reflect: true }) size?:
|
|
154
|
-
|
|
155
|
-
| "xs"
|
|
156
|
-
| "sm"
|
|
157
|
-
| "md"
|
|
158
|
-
| "lg"
|
|
159
|
-
| "xl"
|
|
160
|
-
| "2xl";
|
|
154
|
+
@property({ type: String, reflect: true }) size?: Size;
|
|
155
|
+
|
|
161
156
|
@property({ type: String, reflect: true }) align:
|
|
162
157
|
| "left"
|
|
163
158
|
| "right"
|
|
@@ -11,7 +11,7 @@ export class Legend extends LitElement {
|
|
|
11
11
|
static styles = [
|
|
12
12
|
css`
|
|
13
13
|
:host {
|
|
14
|
-
--sc-legend-font-size: 1.
|
|
14
|
+
--sc-legend-font-size: 1.25rem;
|
|
15
15
|
--sc-legend-font-weight: var(--sc-font-weight-base, 400);
|
|
16
16
|
--sc-legend-font-style: var(--sc-headings-font-style, normal);
|
|
17
17
|
--sc-legend-family: var(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<sonic-button type="info" size="sm" target="_blank" href="https://www.w3schools.com/tags/tag_input.asp#midcontentadcontainer">
|
|
4
4
|
<sonic-icon library="iconoir" name="open-new-window" slot="prefix" ></sonic-icon>
|
|
5
|
-
Native
|
|
5
|
+
Native attributes list
|
|
6
6
|
</sonic-button>
|
|
7
7
|
|
|
8
8
|
## Label
|
|
@@ -16,7 +16,14 @@ import {
|
|
|
16
16
|
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
17
17
|
import FormInput from "@supersoniks/concorde/core/mixins/FormInput";
|
|
18
18
|
import { classMap } from "lit/directives/class-map.js";
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
fontSize,
|
|
21
|
+
Size,
|
|
22
|
+
} from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
23
|
+
import {
|
|
24
|
+
resolveUiLabel,
|
|
25
|
+
uiAriaLabels,
|
|
26
|
+
} from "@supersoniks/concorde/core/components/ui/_i18n/ui-aria-labels";
|
|
20
27
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
21
28
|
|
|
22
29
|
/**
|
|
@@ -48,14 +55,7 @@ export class Input extends FormInput(FormElement(LitElement)) {
|
|
|
48
55
|
/**
|
|
49
56
|
* Taille du composant, implique notamment des modifications de typo et de marge interne
|
|
50
57
|
*/
|
|
51
|
-
@property({ type: String, reflect: true }) size?:
|
|
52
|
-
| "2xs"
|
|
53
|
-
| "xs"
|
|
54
|
-
| "sm"
|
|
55
|
-
| "md"
|
|
56
|
-
| "lg"
|
|
57
|
-
| "xl"
|
|
58
|
-
| "2xl";
|
|
58
|
+
@property({ type: String, reflect: true }) size?: Size;
|
|
59
59
|
@property({ type: String }) inputmode?: string;
|
|
60
60
|
@property({ type: String }) list?: string;
|
|
61
61
|
@property({ type: String }) placeholder?: string;
|
|
@@ -163,7 +163,7 @@ export class Input extends FormInput(FormElement(LitElement)) {
|
|
|
163
163
|
if (this.changeTimeoutId) clearTimeout(this.changeTimeoutId);
|
|
164
164
|
this.changeTimeoutId = setTimeout(
|
|
165
165
|
() => super.handleChange(e),
|
|
166
|
-
parseInt(this.getAttribute("inputDelayMs") || "0")
|
|
166
|
+
parseInt(this.getAttribute("inputDelayMs") || "0"),
|
|
167
167
|
);
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -212,8 +212,8 @@ export class Input extends FormInput(FormElement(LitElement)) {
|
|
|
212
212
|
//let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
213
213
|
return html`
|
|
214
214
|
<label for="${this.id || "form-element"}" class="${
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
this.hasLabel ? "form-label" : "hidden"
|
|
216
|
+
}"
|
|
217
217
|
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot
|
|
218
218
|
name="label"
|
|
219
219
|
@slotchange=${this.hasSlotOrProps}
|
|
@@ -221,8 +221,8 @@ export class Input extends FormInput(FormElement(LitElement)) {
|
|
|
221
221
|
></label>
|
|
222
222
|
|
|
223
223
|
<div @click=${this.inlineContentFocus} class="form-control ${classMap(
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
slotClasses,
|
|
225
|
+
)}">
|
|
226
226
|
<div part="content" class="${
|
|
227
227
|
this.inlineContent ? "form-element form-element-wrapper" : "contents"
|
|
228
228
|
}">
|
|
@@ -263,7 +263,11 @@ export class Input extends FormInput(FormElement(LitElement)) {
|
|
|
263
263
|
shape="circle"
|
|
264
264
|
class="password-toggle"
|
|
265
265
|
@click=${this.togglePasswordVisibility}
|
|
266
|
-
|
|
266
|
+
.ariaLabel=${resolveUiLabel(
|
|
267
|
+
this.isPassword
|
|
268
|
+
? uiAriaLabels.showPassword
|
|
269
|
+
: uiAriaLabels.hidePassword,
|
|
270
|
+
)}
|
|
267
271
|
variant="unstyled"
|
|
268
272
|
>
|
|
269
273
|
<sonic-icon
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<sonic-button type="info" size="sm" target="_blank" href="https://www.w3schools.com/tags/tag_textarea.asp#midcontentadcontainer">
|
|
4
4
|
<sonic-icon library="iconoir" name="open-new-window" slot="prefix" ></sonic-icon>
|
|
5
|
-
Native
|
|
5
|
+
Native attributes list
|
|
6
6
|
</sonic-button>
|
|
7
7
|
|
|
8
8
|
|