@supersoniks/concorde 5.0.3 → 5.0.5
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/.agents/skills/concorde-component-docs/SKILL.md +194 -0
- package/.agents/skills/concorde-component-docs/template.md +45 -0
- package/ai/cursor/rules/concorde-theme.mdc +1 -1
- package/ai/cursor/rules/concorde.mdc +1 -1
- package/ai/skills/concorde/SKILL.md +1 -1
- package/ai/skills/concorde-theme/SKILL.md +21 -10
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +515 -521
- package/concorde-core.es.js +5151 -5056
- package/dist/concorde-core.bundle.js +515 -521
- package/dist/concorde-core.es.js +5151 -5056
- package/dist/docs-mock-api-sw.js +2 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/docs/assets/index-CD4WyL6o.css +1 -0
- package/docs/assets/{index-BnK6OS7w.js → index-wVZpLVYW.js} +815 -808
- package/docs/crawl/core/components/ui/alert/alert.html +76 -5
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +113 -5
- package/docs/crawl/core/components/ui/badge/badge.html +57 -8
- package/docs/crawl/core/components/ui/captcha/captcha.html +90 -8
- package/docs/crawl/core/components/ui/card/card.html +122 -12
- package/docs/crawl/core/components/ui/divider/divider.html +117 -31
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +232 -101
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +95 -52
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +97 -38
- package/docs/crawl/core/components/ui/group/group.html +60 -38
- package/docs/crawl/core/components/ui/icon/icon.html +136 -47
- package/docs/crawl/core/components/ui/image/image.html +118 -6
- package/docs/crawl/core/components/ui/link/link.html +65 -7
- package/docs/crawl/core/components/ui/loader/loader.html +97 -23
- package/docs/crawl/core/components/ui/menu/menu.html +162 -90
- package/docs/crawl/core/components/ui/modal/modal.html +275 -50
- package/docs/crawl/core/components/ui/pop/pop.html +242 -124
- package/docs/crawl/core/components/ui/progress/progress.html +103 -30
- package/docs/crawl/core/components/ui/table/table.html +303 -171
- package/docs/crawl/core/components/ui/theme/theme.html +131 -0
- package/docs/crawl/core/components/ui/toast/toast.html +170 -59
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +90 -29
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +3 -2
- package/docs/crawl/docs/_getting-started/start.html +1 -1
- package/docs/crawl/docs/_getting-started/theming.html +311 -63
- package/docs/crawl/hubs/form-components.html +71 -49
- package/docs/crawl/index.html +7 -6
- package/docs/docs-mock-api-sw.js +2 -0
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +6 -4
- package/docs/llms-full.txt +1468 -405
- package/docs/llms.txt +23 -30
- package/docs/sitemap.xml +3 -0
- package/docs/src/core/components/ui/alert/alert.md +21 -2
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/docs/src/core/components/ui/badge/badge.md +19 -6
- package/docs/src/core/components/ui/captcha/captcha.md +65 -6
- package/docs/src/core/components/ui/card/card.md +73 -10
- package/docs/src/core/components/ui/divider/divider.md +107 -13
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/docs/src/core/components/ui/group/group.md +36 -36
- package/docs/src/core/components/ui/icon/icon.md +132 -43
- package/docs/src/core/components/ui/image/image.md +35 -3
- package/docs/src/core/components/ui/link/link.md +43 -5
- package/docs/src/core/components/ui/loader/loader.md +79 -22
- package/docs/src/core/components/ui/menu/menu.md +133 -92
- package/docs/src/core/components/ui/modal/modal.md +163 -47
- package/docs/src/core/components/ui/pop/pop.md +217 -123
- package/docs/src/core/components/ui/progress/progress.md +76 -30
- package/docs/src/core/components/ui/table/table.md +147 -171
- package/docs/src/core/components/ui/theme/theme.md +122 -0
- package/docs/src/core/components/ui/toast/toast.md +108 -58
- package/docs/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/docs/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/docs/src/docs/_getting-started/start.md +1 -1
- package/docs/src/docs/_getting-started/theming.md +223 -61
- package/docs/src/docs/search/docs-search.json +2504 -399
- package/docs/src/tsconfig.json +18 -0
- package/index.html +4 -2
- package/package.json +7 -1
- package/public/docs-mock-api-sw.js +2 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- package/src/core/components/ui/_css/align.ts +1 -0
- package/src/core/components/ui/_css/type.ts +86 -8
- package/src/core/components/ui/_i18n/ui-aria-labels.ts +8 -0
- package/src/core/components/ui/alert/alert.md +21 -2
- package/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/src/core/components/ui/badge/badge.md +19 -6
- package/src/core/components/ui/badge/badge.ts +8 -9
- package/src/core/components/ui/button/button.ts +5 -15
- package/src/core/components/ui/captcha/captcha.md +65 -6
- package/src/core/components/ui/card/card.md +73 -10
- package/src/core/components/ui/card/card.ts +24 -22
- package/src/core/components/ui/divider/divider.md +107 -13
- package/src/core/components/ui/divider/divider.ts +40 -33
- package/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/src/core/components/ui/form/fieldset/fieldset.ts +15 -28
- package/src/core/components/ui/form/fieldset/legend.ts +13 -13
- package/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/src/core/components/ui/form/form-actions/form-actions.ts +7 -5
- package/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/src/core/components/ui/form/form-layout/form-layout.ts +27 -24
- package/src/core/components/ui/form/textarea/textarea.ts +4 -3
- package/src/core/components/ui/group/group.md +36 -36
- package/src/core/components/ui/group/group.ts +5 -10
- package/src/core/components/ui/icon/icon.md +132 -43
- package/src/core/components/ui/image/image.md +35 -3
- package/src/core/components/ui/link/link.md +43 -5
- package/src/core/components/ui/loader/loader.md +79 -22
- package/src/core/components/ui/loader/loader.ts +67 -27
- package/src/core/components/ui/loader/styles/fixed.ts +6 -11
- package/src/core/components/ui/menu/menu.md +133 -92
- package/src/core/components/ui/menu/menu.ts +53 -58
- package/src/core/components/ui/modal/modal.md +163 -47
- package/src/core/components/ui/modal/modal.ts +2 -4
- package/src/core/components/ui/pop/pop.md +217 -123
- package/src/core/components/ui/pop/pop.ts +0 -1
- package/src/core/components/ui/progress/progress.md +76 -30
- package/src/core/components/ui/progress/progress.ts +25 -56
- package/src/core/components/ui/table/table-caption.ts +2 -2
- package/src/core/components/ui/table/table-tbody.ts +3 -3
- package/src/core/components/ui/table/table-td.ts +23 -18
- package/src/core/components/ui/table/table-th.ts +8 -8
- package/src/core/components/ui/table/table-tr.ts +4 -4
- package/src/core/components/ui/table/table.md +147 -171
- package/src/core/components/ui/table/table.ts +20 -19
- package/src/core/components/ui/theme/theme-collection/auto.ts +15 -0
- package/src/core/components/ui/theme/theme-collection/core-variables.ts +8 -31
- package/src/core/components/ui/theme/theme-collection/dark.ts +1 -7
- package/src/core/components/ui/theme/theme-collection/light.ts +30 -26
- package/src/core/components/ui/theme/theme.md +122 -0
- package/src/core/components/ui/theme/theme.ts +30 -7
- package/src/core/components/ui/toast/toast-item.ts +6 -9
- package/src/core/components/ui/toast/toast.md +108 -58
- package/src/core/components/ui/toast/types.ts +1 -1
- package/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +26 -0
- package/src/core/decorators/subscriber/ancestorAttribute.ts +3 -4
- package/src/core/utils/AncestorAttributeObserver.ts +183 -70
- package/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/src/docs/_getting-started/start.md +1 -1
- package/src/docs/_getting-started/theming.md +223 -61
- package/src/docs/code.ts +125 -58
- package/src/docs/header/header.ts +62 -54
- package/src/docs/mock-api/router.ts +2 -0
- package/src/docs/navigation/navigation.ts +6 -3
- package/src/docs/search/docs-search.json +2504 -399
- package/src/docs/search/markdown-renderer.ts +6 -6
- package/src/docs/search/search.ts +4 -4
- package/src/docs/tailwind/css/tailwind.css +6 -5
- package/src/tsconfig.json +18 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +19 -0
- package/docs/assets/index--GpD7R7a.css +0 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# Badge
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Colors come from theme tokens (`--sc-primary`, `--sc-danger`, …) or the semantic `type` values below.
|
|
3
|
+
Badges are **compact, non-interactive** labels for status, counts, or categories. They mirror **`sonic-button`** styling (`type`, `variant`, `size`) without focus rings or click handling—use a button when the control should be actionable.
|
|
6
4
|
|
|
7
5
|
## Type
|
|
8
6
|
|
|
@@ -24,9 +22,9 @@ Colors come from theme tokens (`--sc-primary`, `--sc-danger`, …) or the semant
|
|
|
24
22
|
|
|
25
23
|
## Variant
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
Default **`variant`** is filled. **`outline`** — border and text in the `type` color. **`ghost`** — text only, no padding (except in forced-colors mode).
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
### Outline
|
|
30
28
|
|
|
31
29
|
<sonic-code>
|
|
32
30
|
<template>
|
|
@@ -42,7 +40,7 @@ Colors come from theme tokens (`--sc-primary`, `--sc-danger`, …) or the semant
|
|
|
42
40
|
</template>
|
|
43
41
|
</sonic-code>
|
|
44
42
|
|
|
45
|
-
|
|
43
|
+
### Ghost
|
|
46
44
|
|
|
47
45
|
<sonic-code>
|
|
48
46
|
<template>
|
|
@@ -173,3 +171,18 @@ Count inside a button (`slot="suffix"`) or a badge absolutely positioned on a bu
|
|
|
173
171
|
</div>
|
|
174
172
|
</template>
|
|
175
173
|
</sonic-code>
|
|
174
|
+
|
|
175
|
+
## API reference
|
|
176
|
+
|
|
177
|
+
| Attribute | Values | Description |
|
|
178
|
+
|----------|---------|-------------|
|
|
179
|
+
| `type` | `default` (default) · `primary` · `neutral` · `warning` · `info` · `success` · `danger` | Semantic color (`--sc-*` tokens) |
|
|
180
|
+
| `variant` | `default` (default) · `outline` · `ghost` | Filled, bordered, or text-only |
|
|
181
|
+
| `size` | `2xs` … `2xl` (default `md`) | Typography and padding (aligned with **`sonic-button`**) |
|
|
182
|
+
| `ellipsis` | boolean | Single-line truncation; parent must constrain width |
|
|
183
|
+
|
|
184
|
+
| Slot | Description |
|
|
185
|
+
|------|-------------|
|
|
186
|
+
| *(default)* | Main label |
|
|
187
|
+
| `prefix` | Icon or short text before the label |
|
|
188
|
+
| `suffix` | Icon or short text after the label |
|
|
@@ -4,7 +4,11 @@ import {
|
|
|
4
4
|
fontSize,
|
|
5
5
|
Size,
|
|
6
6
|
} from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
typesBg,
|
|
9
|
+
DefaultType,
|
|
10
|
+
typeColorInvert,
|
|
11
|
+
} from "@supersoniks/concorde/core/components/ui/_css/type";
|
|
8
12
|
|
|
9
13
|
const tagName = "sonic-badge";
|
|
10
14
|
/**
|
|
@@ -17,6 +21,7 @@ export class Badge extends LitElement {
|
|
|
17
21
|
static styles = [
|
|
18
22
|
fontSize,
|
|
19
23
|
typesBg,
|
|
24
|
+
typeColorInvert,
|
|
20
25
|
css`
|
|
21
26
|
:host {
|
|
22
27
|
--sc-_gap: 0.3em;
|
|
@@ -111,14 +116,8 @@ export class Badge extends LitElement {
|
|
|
111
116
|
* Le type change surtout la couleur composant
|
|
112
117
|
*/
|
|
113
118
|
@property({ type: String, reflect: true })
|
|
114
|
-
type:
|
|
115
|
-
|
|
116
|
-
| "primary"
|
|
117
|
-
| "warning"
|
|
118
|
-
| "danger"
|
|
119
|
-
| "success"
|
|
120
|
-
| "info"
|
|
121
|
-
| "neutral" = "default";
|
|
119
|
+
type: DefaultType = "default";
|
|
120
|
+
|
|
122
121
|
/**
|
|
123
122
|
* Le composant par defaut sans se paramètre à forte afordance
|
|
124
123
|
* * ghost : composant super léger visuellement
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
19
19
|
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
20
20
|
import { Route } from "@supersoniks/concorde/core/utils/route";
|
|
21
|
+
import { Align } from "../_css/align";
|
|
21
22
|
|
|
22
23
|
export type ButtonType =
|
|
23
24
|
| "default"
|
|
@@ -458,10 +459,7 @@ export class Button extends FormCheckable(FormElement(LitElement)) {
|
|
|
458
459
|
/**
|
|
459
460
|
* Propriété text-align du bouton
|
|
460
461
|
*/
|
|
461
|
-
@property({ type: String, reflect: true }) align?:
|
|
462
|
-
| "right"
|
|
463
|
-
| "left"
|
|
464
|
-
| "center";
|
|
462
|
+
@property({ type: String, reflect: true }) align?: Align;
|
|
465
463
|
|
|
466
464
|
/**
|
|
467
465
|
* Propriété min-width du bouton
|
|
@@ -647,17 +645,9 @@ export class Button extends FormCheckable(FormElement(LitElement)) {
|
|
|
647
645
|
@click=${this.handleChange}
|
|
648
646
|
@pointerdown=${this.handleRepeatStart}
|
|
649
647
|
>
|
|
650
|
-
<slot
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
name="prefix"
|
|
654
|
-
></slot>
|
|
655
|
-
<slot part="main" class="main-slot"></slot>
|
|
656
|
-
<slot
|
|
657
|
-
@slotchange=${this.onSlotChange}
|
|
658
|
-
part="suffix"
|
|
659
|
-
name="suffix"
|
|
660
|
-
></slot>
|
|
648
|
+
<slot @slotchange=${this.onSlotChange} name="prefix"></slot>
|
|
649
|
+
<slot class="main-slot"></slot>
|
|
650
|
+
<slot @slotchange=${this.onSlotChange} name="suffix"></slot>
|
|
661
651
|
${this.loading == true
|
|
662
652
|
? html`<sonic-icon name="loader" class="loader"></sonic-icon>`
|
|
663
653
|
: ""}
|
|
@@ -1,12 +1,71 @@
|
|
|
1
1
|
# Captcha
|
|
2
2
|
|
|
3
|
+
**`sonic-captcha`** embeds an **ALTCHA** widget and wires **`captchaToken`** / **`needsCaptchaValidation`** on the ancestor **`formDataProvider`** (or **`headersDataProvider`**). **`sonic-submit`** waits for a token before sending when validation is required. The widget loads only on **HTTPS**; on plain HTTP the host renders nothing.
|
|
4
|
+
|
|
5
|
+
> Live widget calls the Supersoniks challenge service — not part of [docs mock API](#docs/_misc/docs-mock-api.md/docs-mock-api).
|
|
6
|
+
|
|
7
|
+
## Basic example
|
|
8
|
+
|
|
9
|
+
Wrap the form scope and place **`sonic-submit`** in the default slot so the challenge appears above the action.
|
|
10
|
+
|
|
11
|
+
<sonic-code>
|
|
12
|
+
<template>
|
|
13
|
+
<sonic-scope
|
|
14
|
+
serviceURL="/docs-mock-api"
|
|
15
|
+
formDataProvider="captcha-docs-form"
|
|
16
|
+
submitResultDataProvider="captcha-docs-result"
|
|
17
|
+
>
|
|
18
|
+
<sonic-captcha formDataProvider="captcha-docs-form">
|
|
19
|
+
<sonic-input class="mb-3" name="email" type="email" label="Email" value="demo@example.com"></sonic-input>
|
|
20
|
+
<sonic-submit endPoint="api/register" onClick>
|
|
21
|
+
<sonic-button type="primary">Submit with captcha</sonic-button>
|
|
22
|
+
</sonic-submit>
|
|
23
|
+
</sonic-captcha>
|
|
24
|
+
</sonic-scope>
|
|
25
|
+
</template>
|
|
26
|
+
</sonic-code>
|
|
27
|
+
|
|
28
|
+
## Encrypted site key
|
|
29
|
+
|
|
30
|
+
Optional **`key`** skips client-side key generation. When omitted, the component derives an encrypted key on connect (after **`generateEncryptedKey`**).
|
|
31
|
+
|
|
3
32
|
<sonic-code>
|
|
4
33
|
<template>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</sonic-submit>
|
|
9
|
-
</sonic-captcha>
|
|
34
|
+
<sonic-captcha formDataProvider="captcha-docs-form" key="6Leq5V0iAAAAAB-41DlWN335jDlcIuXmhNtdd00t">
|
|
35
|
+
<sonic-button type="outline" disabled>Complete the challenge above to enable submit</sonic-button>
|
|
36
|
+
</sonic-captcha>
|
|
10
37
|
</template>
|
|
11
38
|
</sonic-code>
|
|
12
|
-
|
|
39
|
+
|
|
40
|
+
## Form publisher fields
|
|
41
|
+
|
|
42
|
+
On connect (HTTPS only), **`needsCaptchaValidation`** is set to **`true`** and **`captchaToken`** is cleared. When the ALTCHA widget reaches **`verified`**, **`captchaToken`** is written on the form publisher and **`sonic-captcha-validate`** fires (`detail.valid` · **`detail.state`** · optional **`detail.token`** / **`detail.payload`**). **`sonic-submit`** still listens for **`request_token`** to refresh the token immediately before send.
|
|
43
|
+
|
|
44
|
+
<sonic-code language="typescript">
|
|
45
|
+
<template>
|
|
46
|
+
{
|
|
47
|
+
needsCaptchaValidation: true,
|
|
48
|
+
captchaKey: "…",
|
|
49
|
+
captchaToken: "…"
|
|
50
|
+
}
|
|
51
|
+
</template>
|
|
52
|
+
</sonic-code>
|
|
53
|
+
|
|
54
|
+
## API reference
|
|
55
|
+
|
|
56
|
+
| Attribute | Values | Description |
|
|
57
|
+
|----------|---------|-------------|
|
|
58
|
+
| `formDataProvider` | publisher id | Same as ancestor form scope; reads/writes **`needsCaptchaValidation`** · **`captchaKey`** · **`captchaToken`** |
|
|
59
|
+
| `key` | string | ALTCHA site key; auto-generated when empty |
|
|
60
|
+
| `action` | string | Optional action name forwarded to the widget |
|
|
61
|
+
| `zIndex` | number (default `9999`) | Stacking for the challenge overlay |
|
|
62
|
+
|
|
63
|
+
| Slot | Description |
|
|
64
|
+
|------|-------------|
|
|
65
|
+
| *(default)* | Form actions (typically **`sonic-submit`** and fields) rendered below the widget |
|
|
66
|
+
|
|
67
|
+
| Event | Description |
|
|
68
|
+
|-------|-------------|
|
|
69
|
+
| `sonic-captcha-validate` | Fired when **`state`** is **`verified`** · **`error`** or **`expired`**; **`detail.valid`** is **`true`** only for **`verified`** |
|
|
70
|
+
|
|
71
|
+
Related: [Submit](#core/components/functional/submit/submit.md/submit) — **`needsCaptchaValidation`** and deferred send.
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
# Card
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Cards **group related content** on a padded surface with radius, theme **`type`** colors, and elevation. Default **`shadow`** is `lg`. Compose **`sonic-card-header`** / **`sonic-card-main`** / **`sonic-card-footer`**, or place any markup in the default slot.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
7
|
+
<sonic-code>
|
|
8
|
+
<template>
|
|
9
|
+
<sonic-card class="max-w-sm">
|
|
10
|
+
<p class="m-0">Related content on a raised surface.</p>
|
|
11
|
+
</sonic-card>
|
|
12
|
+
</template>
|
|
13
|
+
</sonic-code>
|
|
6
14
|
|
|
7
15
|
## Type
|
|
8
16
|
|
|
17
|
+
Default **`type`** is `base`. **`default`** and **`light`** share the same surface tokens.
|
|
18
|
+
|
|
9
19
|
<sonic-code>
|
|
10
20
|
<template>
|
|
11
21
|
<div class="flex flex-wrap gap-3">
|
|
12
22
|
<sonic-card type="base" class="min-w-[8rem]">Base</sonic-card>
|
|
13
23
|
<sonic-card type="light" class="min-w-[8rem]">Light</sonic-card>
|
|
24
|
+
<sonic-card type="default" class="min-w-[8rem]">Default</sonic-card>
|
|
14
25
|
<sonic-card type="primary" class="min-w-[8rem]">Primary</sonic-card>
|
|
15
26
|
<sonic-card type="info" class="min-w-[8rem]">Info</sonic-card>
|
|
16
27
|
<sonic-card type="success" class="min-w-[8rem]">Success</sonic-card>
|
|
@@ -22,9 +33,26 @@ Default **`type`** is `base` (page background). Use `light` for a subtle gray pa
|
|
|
22
33
|
</template>
|
|
23
34
|
</sonic-code>
|
|
24
35
|
|
|
36
|
+
## Shadow
|
|
37
|
+
|
|
38
|
+
Set **`shadow`** to control elevation. Default is `lg`.
|
|
39
|
+
|
|
40
|
+
<sonic-code>
|
|
41
|
+
<template>
|
|
42
|
+
<div class="grid gap-4 sm:grid-cols-2 max-w-2xl">
|
|
43
|
+
<sonic-card shadow="none" class="min-h-[5rem] flex items-center justify-center">None</sonic-card>
|
|
44
|
+
<sonic-card shadow="sm" class="min-h-[5rem] flex items-center justify-center">Small</sonic-card>
|
|
45
|
+
<sonic-card shadow="md" class="min-h-[5rem] flex items-center justify-center">Medium</sonic-card>
|
|
46
|
+
<sonic-card shadow="lg" class="min-h-[5rem] flex items-center justify-center">Large</sonic-card>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
</sonic-code>
|
|
50
|
+
|
|
25
51
|
## Header
|
|
26
52
|
|
|
27
|
-
Quick titles with **`label`** and **`description
|
|
53
|
+
Quick titles with **`label`** and **`description`**, 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.
|
|
54
|
+
|
|
55
|
+
`label` and `description` accept HTML (rendered as markup). Prefer plain text when possible; use **`sonic-card-header-description`** or the default slot for structured content.
|
|
28
56
|
|
|
29
57
|
<sonic-code>
|
|
30
58
|
<template>
|
|
@@ -42,7 +70,7 @@ Quick titles with **`label`** and **`description`** attributes, or full control
|
|
|
42
70
|
<sonic-card-header-description>
|
|
43
71
|
Choose what we email you about.
|
|
44
72
|
</sonic-card-header-description>
|
|
45
|
-
<sonic-badge slot="suffix"
|
|
73
|
+
<sonic-badge slot="suffix" type="warning" size="xs">3 new</sonic-badge>
|
|
46
74
|
</sonic-card-header>
|
|
47
75
|
</sonic-card>
|
|
48
76
|
|
|
@@ -77,8 +105,6 @@ Quick titles with **`label`** and **`description`** attributes, or full control
|
|
|
77
105
|
</template>
|
|
78
106
|
</sonic-code>
|
|
79
107
|
|
|
80
|
-
`label` and `description` accept HTML (rendered as markup). Prefer plain text when possible; use the slot for structured content.
|
|
81
|
-
|
|
82
108
|
## Main
|
|
83
109
|
|
|
84
110
|
Optional wrapper for the primary content area (typography, media, forms).
|
|
@@ -110,7 +136,7 @@ Optional footer for actions, metadata, or secondary text.
|
|
|
110
136
|
<p class="m-0">This project and all of its data will be removed permanently.</p>
|
|
111
137
|
</sonic-card-main>
|
|
112
138
|
<sonic-card-footer>
|
|
113
|
-
|
|
139
|
+
<sonic-divider></sonic-divider>
|
|
114
140
|
<div class="flex flex-wrap gap-2 justify-end">
|
|
115
141
|
<sonic-button variant="ghost" size="sm">Cancel</sonic-button>
|
|
116
142
|
<sonic-button type="danger" size="sm">Delete</sonic-button>
|
|
@@ -128,14 +154,14 @@ Header, media, body, and footer together.
|
|
|
128
154
|
<template>
|
|
129
155
|
<sonic-card class="max-w-md">
|
|
130
156
|
<sonic-card-header label="Featured route" description="San Francisco → New York">
|
|
131
|
-
<sonic-icon slot="suffix" library="iconoir" name="airplane"></sonic-icon>
|
|
157
|
+
<sonic-icon slot="suffix" library="iconoir" name="airplane" aria-hidden="true"></sonic-icon>
|
|
132
158
|
</sonic-card-header>
|
|
133
159
|
<sonic-card-main>
|
|
134
160
|
<sonic-image
|
|
135
161
|
rounded
|
|
136
162
|
ratio="16/9"
|
|
137
|
-
src="https://
|
|
138
|
-
alt=""
|
|
163
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
164
|
+
alt="Airplane wing above the clouds"
|
|
139
165
|
></sonic-image>
|
|
140
166
|
<p class="mb-0">
|
|
141
167
|
Nonstop flight with flexible dates. Prices shown include taxes and fees.
|
|
@@ -150,3 +176,40 @@ Header, media, body, and footer together.
|
|
|
150
176
|
</sonic-card>
|
|
151
177
|
</template>
|
|
152
178
|
</sonic-code>
|
|
179
|
+
|
|
180
|
+
## API reference
|
|
181
|
+
|
|
182
|
+
### `sonic-card`
|
|
183
|
+
|
|
184
|
+
| Attribute | Values | Description |
|
|
185
|
+
|----------|---------|-------------|
|
|
186
|
+
| `type` | `base` (default) · `light` · `invert` · `default` · `primary` · `warning` · `danger` · `success` · `info` · `neutral` | Semantic background and text (`default` and `light` share the same surface) |
|
|
187
|
+
| `shadow` | `none` · `sm` · `md` · `lg` (default `lg`) | Elevation on the card surface |
|
|
188
|
+
|
|
189
|
+
| Slot | Description |
|
|
190
|
+
|------|-------------|
|
|
191
|
+
| *(default)* | Free-form content (header, main, footer, or direct markup) |
|
|
192
|
+
|
|
193
|
+
### `sonic-card-header`
|
|
194
|
+
|
|
195
|
+
| Attribute | Values | Description |
|
|
196
|
+
|----------|---------|-------------|
|
|
197
|
+
| `label` | HTML | Title (rendered as markup) |
|
|
198
|
+
| `description` | HTML | Subtitle below the title |
|
|
199
|
+
|
|
200
|
+
| Slot | Description |
|
|
201
|
+
|------|-------------|
|
|
202
|
+
| *(default)* | Custom title / description when attributes are not enough |
|
|
203
|
+
| `suffix` | Actions or badges aligned on the right (does not shrink) |
|
|
204
|
+
|
|
205
|
+
### `sonic-card-header-description`
|
|
206
|
+
|
|
207
|
+
| Slot | Description |
|
|
208
|
+
|------|-------------|
|
|
209
|
+
| *(default)* | Subtitle text; styled below the title when slotted in **`sonic-card-header`** |
|
|
210
|
+
|
|
211
|
+
### `sonic-card-main` · `sonic-card-footer`
|
|
212
|
+
|
|
213
|
+
| Slot | Description |
|
|
214
|
+
|------|-------------|
|
|
215
|
+
| *(default)* | Primary content (`main`) or actions / metadata (`footer`) |
|
|
@@ -3,13 +3,15 @@ import { customElement, property } from "lit/decorators.js";
|
|
|
3
3
|
import "@supersoniks/concorde/core/components/ui/card/card-header";
|
|
4
4
|
import "@supersoniks/concorde/core/components/ui/card/card-main";
|
|
5
5
|
import "@supersoniks/concorde/core/components/ui/card/card-footer";
|
|
6
|
-
import { typesBg } from "../_css/type";
|
|
6
|
+
import { CardType, typesBg } from "../_css/type";
|
|
7
|
+
import { Shadow, shadowable } from "../_css/shadow";
|
|
7
8
|
|
|
8
9
|
const tagName = "sonic-card";
|
|
9
10
|
@customElement(tagName)
|
|
10
11
|
export class Card extends LitElement {
|
|
11
12
|
static styles = [
|
|
12
13
|
typesBg,
|
|
14
|
+
shadowable,
|
|
13
15
|
css`
|
|
14
16
|
* {
|
|
15
17
|
box-sizing: border-box;
|
|
@@ -19,46 +21,46 @@ export class Card extends LitElement {
|
|
|
19
21
|
--sc-_color: var(--sc-base-content, #000);
|
|
20
22
|
--sc-_bg: var(--sc-base, #fff);
|
|
21
23
|
--sc-_rounded: var(--sc-rounded-lg);
|
|
22
|
-
--sc-
|
|
24
|
+
--sc-_border-color: transparent;
|
|
25
|
+
--sc-_border-width: var(--sc-form-border-width);
|
|
26
|
+
display: block;
|
|
27
|
+
background: transparent;
|
|
23
28
|
-webkit-print-color-adjust: exact;
|
|
24
29
|
}
|
|
25
30
|
|
|
31
|
+
.shadowable {
|
|
32
|
+
padding: var(--sc-_padding);
|
|
33
|
+
background-color: var(--sc-_bg);
|
|
34
|
+
border-radius: var(--sc-_rounded);
|
|
35
|
+
color: var(--sc-_color);
|
|
36
|
+
border: var(--sc-_border-width) solid var(--sc-_border-color);
|
|
37
|
+
}
|
|
38
|
+
|
|
26
39
|
@media print {
|
|
27
40
|
:host {
|
|
28
41
|
page-break-inside: avoid;
|
|
29
42
|
break-inside: avoid;
|
|
43
|
+
}
|
|
44
|
+
.shadowable {
|
|
30
45
|
box-shadow: none !important;
|
|
31
46
|
border: 1px solid var(--sc-base-200, rgba(0, 0, 0, 0.12));
|
|
32
47
|
}
|
|
33
48
|
}
|
|
34
|
-
|
|
35
|
-
:host {
|
|
36
|
-
display: block;
|
|
37
|
-
padding: var(--sc-_padding);
|
|
38
|
-
background-color: var(--sc-_bg);
|
|
39
|
-
border-radius: var(--sc-_rounded);
|
|
40
|
-
box-shadow: var(--sc-_shadow);
|
|
41
|
-
color: var(--sc-_color);
|
|
42
|
-
}
|
|
43
49
|
`,
|
|
44
50
|
];
|
|
45
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Ombre
|
|
54
|
+
*/
|
|
55
|
+
@property({ type: String, reflect: true }) shadow: Shadow = "lg";
|
|
56
|
+
|
|
46
57
|
/**
|
|
47
58
|
* Le type change surtout la couleur composant
|
|
48
59
|
*/
|
|
49
60
|
@property({ type: String, reflect: true })
|
|
50
|
-
type:
|
|
51
|
-
| "light"
|
|
52
|
-
| "primary"
|
|
53
|
-
| "warning"
|
|
54
|
-
| "danger"
|
|
55
|
-
| "success"
|
|
56
|
-
| "info"
|
|
57
|
-
| "neutral"
|
|
58
|
-
| "invert"
|
|
59
|
-
| "base" = "base";
|
|
61
|
+
type: CardType = "base";
|
|
60
62
|
|
|
61
63
|
render() {
|
|
62
|
-
return html`<slot></slot
|
|
64
|
+
return html`<div class="shadowable"><slot></slot></div>`;
|
|
63
65
|
}
|
|
64
66
|
}
|
|
@@ -1,35 +1,129 @@
|
|
|
1
1
|
# Divider
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**`sonic-divider`** draws a horizontal or vertical rule with optional **centered label** copy. Use it to separate sections in forms, cards, and **`sonic-menu`**. Set **`label`** for simple HTML captions or use the **default slot** for richer markup; default **`align`** is **`center`** and default **`lineStyle`** is **`solid`**.
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
7
|
+
A bare divider is a full-width line with vertical margin. Omit **`size`** to use the host default spacing (`0.5rem` block margin).
|
|
8
|
+
|
|
4
9
|
<sonic-code>
|
|
5
10
|
<template>
|
|
6
|
-
|
|
11
|
+
<sonic-divider></sonic-divider>
|
|
7
12
|
</template>
|
|
8
13
|
</sonic-code>
|
|
9
14
|
|
|
10
|
-
##
|
|
15
|
+
## Label and align
|
|
16
|
+
|
|
17
|
+
**`label`** renders inside the line (HTML via the same pipeline as other form labels). **`align`** controls which side(s) of the line remain visible: **`left`** drops the leading segment, **`right`** drops the trailing segment, **`center`** keeps both.
|
|
18
|
+
|
|
11
19
|
<sonic-code>
|
|
12
20
|
<template>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
<div class="grid gap-4">
|
|
22
|
+
<sonic-divider label="Default centered label"></sonic-divider>
|
|
23
|
+
<sonic-divider label="Left" align="left"></sonic-divider>
|
|
24
|
+
<sonic-divider label="Center" align="center"></sonic-divider>
|
|
25
|
+
<sonic-divider label="Right" align="right"></sonic-divider>
|
|
26
|
+
</div>
|
|
17
27
|
</template>
|
|
18
28
|
</sonic-code>
|
|
19
29
|
|
|
20
30
|
## Size
|
|
31
|
+
|
|
32
|
+
**`size`** adjusts block margin and label font size. Values follow the shared Concorde scale (`2xs` … `2xl`).
|
|
33
|
+
|
|
34
|
+
<sonic-code>
|
|
35
|
+
<template>
|
|
36
|
+
<div class="grid gap-4">
|
|
37
|
+
<sonic-divider size="2xs" label="2xs"></sonic-divider>
|
|
38
|
+
<sonic-divider size="xs" label="xs"></sonic-divider>
|
|
39
|
+
<sonic-divider size="sm" label="sm"></sonic-divider>
|
|
40
|
+
<sonic-divider size="md" label="md"></sonic-divider>
|
|
41
|
+
<sonic-divider size="lg" label="lg"></sonic-divider>
|
|
42
|
+
<sonic-divider size="xl" label="xl"></sonic-divider>
|
|
43
|
+
<sonic-divider size="2xl" label="2xl"></sonic-divider>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
</sonic-code>
|
|
47
|
+
|
|
48
|
+
## Line style
|
|
49
|
+
|
|
50
|
+
**`lineStyle`** sets the stroke of the rule (`solid` · `dashed` · `dotted`). In HTML use the reflected attribute **`linestyle`** (case-insensitive).
|
|
51
|
+
|
|
21
52
|
<sonic-code>
|
|
22
53
|
<template>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
54
|
+
<div class="grid gap-4">
|
|
55
|
+
<sonic-divider label="Solid"></sonic-divider>
|
|
56
|
+
<sonic-divider label="Dashed" lineStyle="dashed"></sonic-divider>
|
|
57
|
+
<sonic-divider label="Dotted" lineStyle="dotted"></sonic-divider>
|
|
58
|
+
</div>
|
|
27
59
|
</template>
|
|
28
60
|
</sonic-code>
|
|
29
61
|
|
|
30
|
-
##
|
|
62
|
+
## Vertical and margin
|
|
63
|
+
|
|
64
|
+
Set **`vertical`** for a column rule (for example between toolbar actions). **`noMargin`** removes host margin when a parent layout already provides spacing.
|
|
65
|
+
|
|
31
66
|
<sonic-code>
|
|
32
67
|
<template>
|
|
33
|
-
|
|
68
|
+
<div class="flex items-stretch gap-2" style="min-height: 3rem;">
|
|
69
|
+
<span class="flex items-center px-2">Before</span>
|
|
70
|
+
<sonic-divider vertical noMargin></sonic-divider>
|
|
71
|
+
<span class="flex items-center px-2">After</span>
|
|
72
|
+
</div>
|
|
34
73
|
</template>
|
|
35
74
|
</sonic-code>
|
|
75
|
+
|
|
76
|
+
## Default slot
|
|
77
|
+
|
|
78
|
+
Slotted content replaces or augments **`label`**. Useful for badges, icons, or mixed markup in menus.
|
|
79
|
+
|
|
80
|
+
<sonic-code>
|
|
81
|
+
<template>
|
|
82
|
+
<sonic-divider>
|
|
83
|
+
<span class="mr-2">Section title</span>
|
|
84
|
+
<sonic-badge type="danger">+25</sonic-badge>
|
|
85
|
+
</sonic-divider>
|
|
86
|
+
</template>
|
|
87
|
+
</sonic-code>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## Inside typed cards
|
|
91
|
+
|
|
92
|
+
On **`sonic-card`** with semantic **`type`** (`primary` · `warning` · `danger` · `info` · `success`), the rule uses the card’s text color at reduced opacity so it stays visible on tinted surfaces. **`label`** and slotted captions use the same foreground color as surrounding copy.
|
|
93
|
+
|
|
94
|
+
<sonic-code>
|
|
95
|
+
<template>
|
|
96
|
+
<div class="grid gap-4 max-w-xl">
|
|
97
|
+
<sonic-card type="danger">
|
|
98
|
+
<div>This action cannot be undone.</div>
|
|
99
|
+
<sonic-divider label="Affected resources"></sonic-divider>
|
|
100
|
+
<ul class="m-0 pl-5 text-sm">
|
|
101
|
+
<li>Project files</li>
|
|
102
|
+
<li>Shared links</li>
|
|
103
|
+
</ul>
|
|
104
|
+
</sonic-card>
|
|
105
|
+
<sonic-card type="info">
|
|
106
|
+
<div>Maintenance is scheduled for tonight.</div>
|
|
107
|
+
<sonic-divider></sonic-divider>
|
|
108
|
+
<div class="opacity-60">Expected downtime: about 15 minutes.</div>
|
|
109
|
+
</sonic-card>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
112
|
+
</sonic-code>
|
|
113
|
+
|
|
114
|
+
## API reference
|
|
115
|
+
|
|
116
|
+
| Attribute | Values | Description |
|
|
117
|
+
|----------|---------|-------------|
|
|
118
|
+
| `label` | string (HTML) | Caption centered on the rule; combined with default-slot content when both are set |
|
|
119
|
+
| `align` | `left` · `center` · `right` (default `center`) | Hides the leading or trailing line segment for left/right alignment |
|
|
120
|
+
| `size` | `2xs` · `xs` · `sm` · `md` · `lg` · `xl` · `2xl` · `inherit` | Vertical margin and label `font-size`; omit for host defaults |
|
|
121
|
+
| `lineStyle` | `solid` · `dashed` · `dotted` (default `solid`) | Stroke style of the rule (HTML attribute `linestyle`) |
|
|
122
|
+
| `vertical` | boolean | Renders a vertical rule; swap block/inline margins |
|
|
123
|
+
| `noMargin` | boolean | Sets host margin to `0` |
|
|
124
|
+
|
|
125
|
+
| Slot | Description |
|
|
126
|
+
|------|-------------|
|
|
127
|
+
| *(default)* | Label markup when **`label`** is insufficient or empty |
|
|
128
|
+
|
|
129
|
+
The inner flex container exposes **`part="divider"`** for theme overrides.
|