@supersoniks/concorde 5.0.3 → 5.0.4
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/.github/workflows/ci.yml +21 -0
- package/.github-export-ignore +30 -0
- package/CONTRIBUTING.md +59 -0
- package/DEV.md +54 -0
- package/LICENSE +21 -0
- package/OPEN_SOURCE_CHECKPOINT.md +133 -0
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +66 -66
- package/concorde-core.es.js +1368 -1318
- package/dist/concorde-core.bundle.js +66 -66
- package/dist/concorde-core.es.js +1368 -1318
- package/docs/assets/{index-BnK6OS7w.js → index-D8MVWqY6.js} +1144 -1008
- package/docs/assets/index-DiD0qYvE.css +1 -0
- package/docs/crawl/core/components/ui/alert/alert.html +71 -101
- package/docs/crawl/core/components/ui/badge/badge.html +77 -106
- package/docs/crawl/core/components/ui/button/button.html +0 -1
- package/docs/crawl/core/components/ui/card/card.html +68 -112
- package/docs/crawl/core/components/ui/form/input/input.html +3 -3
- package/docs/crawl/core/components/ui/form/textarea/textarea.html +3 -3
- package/docs/crawl/core/components/ui/image/image.html +56 -132
- package/docs/crawl/core/components/ui/link/link.html +4 -4
- package/docs/crawl/core/components/ui/pop/pop.html +3 -79
- package/docs/crawl/docs/_getting-started/concorde-outside.html +3 -3
- package/docs/crawl/hubs/form-components.html +4 -4
- package/docs/index.html +5 -5
- package/docs/llms-full.txt +97 -281
- package/docs/llms.txt +8 -8
- package/docs/src/core/components/functional/fetch/fetch.md +0 -0
- package/docs/src/core/components/functional/if/if.md +0 -0
- package/docs/src/core/components/functional/list/list.md +0 -0
- package/docs/src/core/components/functional/router/router.md +0 -0
- package/docs/src/core/components/functional/sdui/sdui.md +0 -0
- package/docs/src/core/components/functional/states/states.md +0 -0
- package/docs/src/core/components/functional/submit/submit.md +0 -0
- package/docs/src/core/components/ui/alert/alert.md +72 -128
- package/docs/src/core/components/ui/badge/badge.md +78 -126
- package/docs/src/core/components/ui/button/button.md +0 -1
- package/docs/src/core/components/ui/captcha/captcha.md +0 -0
- package/docs/src/core/components/ui/card/card.md +65 -120
- package/docs/src/core/components/ui/form/input/input.md +1 -1
- package/docs/src/core/components/ui/form/radio/radio.md +0 -0
- package/docs/src/core/components/ui/form/select/select.md +0 -0
- package/docs/src/core/components/ui/form/switch/switch.md +0 -0
- package/docs/src/core/components/ui/form/textarea/textarea.md +1 -1
- package/docs/src/core/components/ui/image/image.md +53 -147
- package/docs/src/core/components/ui/link/link.md +2 -2
- package/docs/src/core/components/ui/loader/loader.md +0 -0
- package/docs/src/core/components/ui/menu/menu.md +0 -0
- package/docs/src/core/components/ui/modal/modal.md +0 -0
- package/docs/src/core/components/ui/pop/pop.md +1 -105
- package/docs/src/core/components/ui/table/table.md +0 -0
- package/docs/src/docs/_core-concept/subscriber.md +0 -0
- package/docs/src/docs/_getting-started/concorde-outside.md +3 -3
- package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -0
- package/docs/src/docs/_getting-started/pubsub.md +0 -0
- package/docs/src/docs/_getting-started/start.md +0 -0
- package/docs/src/docs/search/docs-search.json +25 -655
- package/docs/src/tsconfig.declarations.json +22 -0
- package/docs/src/tsconfig.emit.json +23 -0
- package/docs/src/tsconfig.json +3 -45
- package/gitlab/job_github_mirror.sh +39 -0
- package/gitlab/job_tests.sh +0 -0
- package/package.json +1 -1
- package/scripts/github-export.mjs +150 -0
- package/scripts/post-build-docs.js +0 -0
- package/scripts/post-build.mjs +0 -0
- package/src/core/components/functional/fetch/fetch.md +0 -0
- package/src/core/components/functional/if/if.md +0 -0
- package/src/core/components/functional/list/list.demo.ts +0 -0
- package/src/core/components/functional/list/list.md +0 -0
- package/src/core/components/functional/router/router.md +0 -0
- package/src/core/components/functional/router/router.ts +0 -0
- package/src/core/components/functional/sdui/sdui.md +0 -0
- package/src/core/components/functional/states/states.md +0 -0
- package/src/core/components/functional/submit/submit.md +0 -0
- package/src/core/components/functional/subscriber/subscriber.ts +0 -0
- package/src/core/components/ui/_css/size.ts +0 -0
- package/src/core/components/ui/captcha/altchaStyles.ts +0 -0
- package/src/core/components/ui/captcha/captcha.md +0 -0
- package/src/core/components/ui/form/radio/radio.md +0 -0
- package/src/core/components/ui/form/select/select.md +0 -0
- package/src/core/components/ui/form/switch/switch.md +0 -0
- package/src/core/components/ui/loader/loader.md +0 -0
- package/src/core/components/ui/menu/menu.md +0 -0
- package/src/core/components/ui/modal/modal.md +0 -0
- package/src/core/components/ui/table/table-caption.ts +0 -0
- package/src/core/components/ui/table/table.md +0 -0
- package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +26 -0
- package/src/core/decorators/subscriber/ancestorAttribute.ts +3 -4
- package/src/core/mixins/Subscriber.ts +0 -0
- package/src/core/utils/AncestorAttributeObserver.ts +183 -70
- package/src/core/utils/DataBindObserver.ts +0 -0
- package/src/core/utils/Objects.ts +0 -0
- package/src/core/utils/route.ts +0 -0
- package/src/css.d.ts +19 -0
- package/src/docs/_core-concept/subscriber.md +0 -0
- package/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/src/docs/_getting-started/my-first-subscriber.md +0 -0
- package/src/docs/_getting-started/pubsub.md +0 -0
- package/src/docs/_getting-started/start.md +0 -0
- package/src/docs/example/users.ts +0 -0
- package/src/docs/search/page.ts +0 -0
- package/src/tsconfig.declarations.json +22 -0
- package/src/tsconfig.emit.json +23 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/docs/assets/index--GpD7R7a.css +0 -1
|
@@ -1,152 +1,97 @@
|
|
|
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
|
-
|
|
7
3
|
## Type
|
|
8
|
-
|
|
9
4
|
<sonic-code>
|
|
10
5
|
<template>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
<div class="grid grid-cols-3 gap-3">
|
|
7
|
+
<sonic-card type="base">Base</sonic-card>
|
|
8
|
+
<sonic-card type="light">Light</sonic-card>
|
|
9
|
+
<sonic-card type="primary">Primary</sonic-card>
|
|
10
|
+
<sonic-card type="warning">Warning</sonic-card>
|
|
11
|
+
<sonic-card type="danger">Danger</sonic-card>
|
|
12
|
+
<sonic-card type="success">Success</sonic-card>
|
|
13
|
+
<sonic-card type="info">Info</sonic-card>
|
|
14
|
+
<sonic-card type="neutral">Neutral</sonic-card>
|
|
15
|
+
<sonic-card type="invert">Invert</sonic-card>
|
|
16
|
+
</div>
|
|
22
17
|
</template>
|
|
23
18
|
</sonic-code>
|
|
24
19
|
|
|
25
20
|
## 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
|
-
|
|
29
21
|
<sonic-code>
|
|
30
22
|
<template>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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>
|
|
23
|
+
<div class="grid grid-cols-1 gap-3">
|
|
24
|
+
<sonic-card >
|
|
25
|
+
<sonic-card-header label="Header simple, titre géré via l'attribut : label" description="Description via l'attribut : description">
|
|
26
|
+
</sonic-card-header>
|
|
27
|
+
</sonic-card>
|
|
28
|
+
<sonic-card type="neutral">
|
|
29
|
+
<sonic-card-header label="Header composé">
|
|
30
|
+
<sonic-card-header-description>Description rendu via le composant : "sonic-card-header-description"</sonic-card-header-description>
|
|
31
|
+
<div slot="suffix" class="flex">
|
|
32
|
+
Suffix
|
|
33
|
+
</div>
|
|
34
|
+
</sonic-card-header>
|
|
35
|
+
</sonic-card>
|
|
36
|
+
<sonic-card type="invert">
|
|
37
|
+
<sonic-card-header>
|
|
38
|
+
<div>Header custom</div>
|
|
39
|
+
<div class="text-lg text-danger">Tout le contenu excepté l'icône ✈ passe par le slot du header</div>
|
|
40
|
+
<span slot="suffix" >✈</span>
|
|
41
|
+
</sonic-card-header>
|
|
42
|
+
</sonic-card>
|
|
43
|
+
</div>
|
|
77
44
|
</template>
|
|
78
45
|
</sonic-code>
|
|
79
46
|
|
|
80
|
-
`label` and `description` accept HTML (rendered as markup). Prefer plain text when possible; use the slot for structured content.
|
|
81
|
-
|
|
82
47
|
## Main
|
|
83
|
-
|
|
84
|
-
Optional wrapper for the primary content area (typography, media, forms).
|
|
85
|
-
|
|
86
48
|
<sonic-code>
|
|
87
49
|
<template>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<p class="mb-0 text-sm opacity-80">See the changelog for details.</p>
|
|
96
|
-
</sonic-card-main>
|
|
97
|
-
</sonic-card>
|
|
50
|
+
<sonic-card >
|
|
51
|
+
<sonic-card-main >
|
|
52
|
+
<h3>Main area</h3>
|
|
53
|
+
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iure id dolor debitis deleniti eligendi natus dolorem a commodi sunt dicta? Ipsa asperiores magni consequuntur dolor voluptatibus. Maxime, nemo? Facere, odio.</p>
|
|
54
|
+
<iframe width="560" height="315" src="https://www.youtube.com/embed/aqz-KE-bpKQ" title="Big Buck Bunny (Blender Foundation)" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
55
|
+
</sonic-card-main>
|
|
56
|
+
</sonic-card>
|
|
98
57
|
</template>
|
|
99
58
|
</sonic-code>
|
|
100
59
|
|
|
101
60
|
## Footer
|
|
102
|
-
|
|
103
|
-
Optional footer for actions, metadata, or secondary text.
|
|
104
|
-
|
|
105
61
|
<sonic-code>
|
|
106
62
|
<template>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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>
|
|
63
|
+
<sonic-card >
|
|
64
|
+
<sonic-card-footer >
|
|
65
|
+
<div >
|
|
66
|
+
<h4 class="mb-0">Footer area</h4>
|
|
67
|
+
<small>Debitis deleniti eligendi natus dolorem aufdh.</small>
|
|
68
|
+
<div>
|
|
69
|
+
🛫 ✈ ✈ ✈ ✈ ✈ 🛬
|
|
117
70
|
</div>
|
|
118
|
-
</
|
|
119
|
-
</sonic-card>
|
|
71
|
+
</div>
|
|
72
|
+
</sonic-card-footer>
|
|
73
|
+
</sonic-card>
|
|
120
74
|
</template>
|
|
121
75
|
</sonic-code>
|
|
122
76
|
|
|
123
|
-
## Full example
|
|
124
|
-
|
|
125
|
-
Header, media, body, and footer together.
|
|
126
77
|
|
|
78
|
+
## Example of use
|
|
127
79
|
<sonic-code>
|
|
128
80
|
<template>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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>
|
|
81
|
+
<sonic-card >
|
|
82
|
+
<sonic-card-header label="Header" description="Header description">
|
|
83
|
+
<sonic-icon library="iconoir" name="nav-arrow-right" slot="suffix" ></sonic-icon>
|
|
84
|
+
</sonic-card-header>
|
|
85
|
+
<sonic-card-main >
|
|
86
|
+
<sonic-image rounded ratio="11/4" src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg">
|
|
87
|
+
</sonic-image>
|
|
88
|
+
<p><b>Main</b> - Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iure id dolor debitis deleniti eligendi natus dolorem a commodi sunt dicta? Ipsa asperiores magni consequuntur dolor voluptatibus. Maxime, nemo? Facere, odio.</p>
|
|
89
|
+
</sonic-card-main>
|
|
90
|
+
<sonic-card-footer>
|
|
91
|
+
<div>
|
|
92
|
+
<i>Footer</i> - Amet consectetur adipisicing
|
|
93
|
+
</div>
|
|
94
|
+
</sonic-card-footer>
|
|
95
|
+
</sonic-card>
|
|
151
96
|
</template>
|
|
152
97
|
</sonic-code>
|
|
@@ -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 attibutes list
|
|
6
6
|
</sonic-button>
|
|
7
7
|
|
|
8
8
|
## Label
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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 attibutes list
|
|
6
6
|
</sonic-button>
|
|
7
7
|
|
|
8
8
|
|
|
@@ -1,201 +1,107 @@
|
|
|
1
1
|
# Image
|
|
2
2
|
|
|
3
|
-
Responsive **`<img>`** wrapper: aspect ratio, `object-fit: cover`, rounded corners, and optional fade-in on load. The host uses a light placeholder background (`--sc-placeholder-bg`) until the file is ready. Default **`loading`** is `lazy`; set **`loading="eager"`** for above-the-fold heroes.
|
|
4
|
-
|
|
5
3
|
## Rounded
|
|
6
4
|
|
|
7
|
-
Omit `rounded` for square corners. Boolean **`rounded`** uses the theme token `--sc-rounded`. Sizes: **`sm`**, **`md`**, **`lg`**, **`xl`**, **`full`** (circle — pair with `ratio="1/1"`), **`none`** (explicit reset).
|
|
8
|
-
|
|
9
5
|
<sonic-code>
|
|
10
6
|
<template>
|
|
11
|
-
<div class="grid gap-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
48
|
-
></sonic-image>
|
|
49
|
-
<p class="mt-2">lg</p>
|
|
50
|
-
</div>
|
|
51
|
-
<div>
|
|
52
|
-
<sonic-image
|
|
53
|
-
rounded="xl"
|
|
54
|
-
ratio="1/1"
|
|
55
|
-
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
56
|
-
></sonic-image>
|
|
57
|
-
<p class="mt-2">xl</p>
|
|
58
|
-
</div>
|
|
59
|
-
<div >
|
|
60
|
-
<div >
|
|
61
|
-
<sonic-image
|
|
62
|
-
rounded="full"
|
|
63
|
-
ratio="1/1"
|
|
64
|
-
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
65
|
-
></sonic-image>
|
|
66
|
-
<p class="mt-2">full</p>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
7
|
+
<div class="grid gap-8 grid-cols-3 items-center">
|
|
8
|
+
<sonic-image
|
|
9
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
10
|
+
ratio="1/1"
|
|
11
|
+
>
|
|
12
|
+
</sonic-image>
|
|
13
|
+
<sonic-image
|
|
14
|
+
rounded="sm"
|
|
15
|
+
ratio="1/1"
|
|
16
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
17
|
+
>
|
|
18
|
+
</sonic-image>
|
|
19
|
+
<sonic-image
|
|
20
|
+
rounded
|
|
21
|
+
ratio="1/1"
|
|
22
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
23
|
+
>
|
|
24
|
+
</sonic-image>
|
|
25
|
+
<sonic-image
|
|
26
|
+
rounded="md"
|
|
27
|
+
ratio="1/1"
|
|
28
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
29
|
+
>
|
|
30
|
+
</sonic-image>
|
|
31
|
+
<sonic-image
|
|
32
|
+
rounded="lg"
|
|
33
|
+
ratio="1/1"
|
|
34
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
35
|
+
>
|
|
36
|
+
</sonic-image>
|
|
37
|
+
<sonic-image
|
|
38
|
+
rounded="full"
|
|
39
|
+
ratio="1/1"
|
|
40
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
41
|
+
>
|
|
42
|
+
</sonic-image>
|
|
69
43
|
</div>
|
|
70
44
|
</template>
|
|
71
45
|
</sonic-code>
|
|
72
46
|
|
|
73
|
-
##
|
|
74
|
-
|
|
75
|
-
**`ratio`** sets CSS `aspect-ratio` on the image (default **`auto`**). The image still fills the host width (`width: 100%`).
|
|
47
|
+
## Ratio
|
|
76
48
|
|
|
77
49
|
<sonic-code>
|
|
78
50
|
<template>
|
|
79
51
|
<div class="grid gap-8 grid-cols-2 items-center">
|
|
80
52
|
<sonic-image
|
|
81
53
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
82
|
-
|
|
54
|
+
>
|
|
55
|
+
</sonic-image>
|
|
83
56
|
<sonic-image
|
|
84
57
|
ratio="16/9"
|
|
85
58
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
86
|
-
|
|
59
|
+
>
|
|
60
|
+
</sonic-image>
|
|
87
61
|
<sonic-image
|
|
88
62
|
ratio="1/1"
|
|
89
63
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
90
|
-
|
|
64
|
+
>
|
|
65
|
+
</sonic-image>
|
|
91
66
|
<sonic-image
|
|
92
67
|
ratio="2/3"
|
|
93
68
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
94
|
-
|
|
69
|
+
>
|
|
70
|
+
</sonic-image>
|
|
95
71
|
</div>
|
|
96
72
|
</template>
|
|
97
73
|
</sonic-code>
|
|
98
74
|
|
|
99
75
|
## Object position
|
|
100
76
|
|
|
101
|
-
**`objectPosition`** maps to CSS `object-position` (default **`center center`**). Useful on wide crops when the subject sits off-center.
|
|
102
|
-
|
|
103
77
|
<sonic-code>
|
|
104
78
|
<template>
|
|
105
79
|
<div class="grid gap-8 grid-cols-2 items-center">
|
|
106
80
|
<sonic-image
|
|
107
|
-
ratio="11/4"
|
|
108
81
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
109
|
-
|
|
82
|
+
ratio="11/4"
|
|
83
|
+
>
|
|
84
|
+
</sonic-image>
|
|
110
85
|
<sonic-image
|
|
111
86
|
objectPosition="center top"
|
|
112
|
-
ratio="11/4"
|
|
113
87
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
114
|
-
|
|
88
|
+
ratio="11/4"
|
|
89
|
+
>
|
|
90
|
+
</sonic-image>
|
|
115
91
|
</div>
|
|
116
92
|
</template>
|
|
117
93
|
</sonic-code>
|
|
118
94
|
|
|
119
95
|
## Cover
|
|
120
96
|
|
|
121
|
-
**`cover`** stretches the image to fill a **positioned** parent (`position: relative` + fixed height or inset). Aspect ratio on the host is ignored while `cover` is set.
|
|
122
|
-
|
|
123
97
|
<sonic-code>
|
|
124
98
|
<template>
|
|
125
|
-
<div class="h-96 relative
|
|
99
|
+
<div class="h-96 relative">
|
|
126
100
|
<sonic-image
|
|
127
101
|
cover
|
|
128
102
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
129
|
-
></sonic-image>
|
|
130
|
-
</div>
|
|
131
|
-
</template>
|
|
132
|
-
</sonic-code>
|
|
133
|
-
|
|
134
|
-
## Load transition
|
|
135
|
-
|
|
136
|
-
Set **`transition`** to **`fade`** (default when the attribute is present) or **`fade-scale-out`**. The image stays at `opacity: 0` until the browser fires **`load`**, then the **`loaded`** class runs the animation. Changing `src` on an existing element does not replay the effect — mount a new `sonic-image` when you need another entrance (galleries, infinite scroll).
|
|
137
|
-
|
|
138
|
-
Click **Add image** to append small thumbnails and replay the transition. **Clear** resets the row.
|
|
139
|
-
|
|
140
|
-
<sonic-code>
|
|
141
|
-
<template>
|
|
142
|
-
<div class="flex flex-wrap gap-2 mb-4">
|
|
143
|
-
<sonic-button
|
|
144
|
-
size="sm"
|
|
145
|
-
onclick="(function () {
|
|
146
|
-
var host = document.getElementById('sonic-image-transition-host');
|
|
147
|
-
var img = document.createElement('sonic-image');
|
|
148
|
-
img.transition = 'fade';
|
|
149
|
-
img.ratio = '1/1';
|
|
150
|
-
img.rounded = 'md';
|
|
151
|
-
img.loading = 'eager';
|
|
152
|
-
img.style.width = '5rem';
|
|
153
|
-
img.src = 'https://picsum.photos/seed/' + Date.now() + '/120/120';
|
|
154
|
-
host.appendChild(img);
|
|
155
|
-
})()"
|
|
156
|
-
>
|
|
157
|
-
Add image (fade)
|
|
158
|
-
</sonic-button>
|
|
159
|
-
<sonic-button
|
|
160
|
-
size="sm"
|
|
161
|
-
variant="outline"
|
|
162
|
-
onclick="(function () {
|
|
163
|
-
var host = document.getElementById('sonic-image-transition-host');
|
|
164
|
-
var img = document.createElement('sonic-image');
|
|
165
|
-
img.transition = 'fade-scale-out';
|
|
166
|
-
img.ratio = '1/1';
|
|
167
|
-
img.rounded = 'md';
|
|
168
|
-
img.loading = 'eager';
|
|
169
|
-
img.style.width = '5rem';
|
|
170
|
-
img.src = 'https://picsum.photos/seed/' + Date.now() + '/120/120';
|
|
171
|
-
host.appendChild(img);
|
|
172
|
-
})()"
|
|
173
|
-
>
|
|
174
|
-
Add image (fade-scale-out)
|
|
175
|
-
</sonic-button>
|
|
176
|
-
<sonic-button
|
|
177
|
-
size="sm"
|
|
178
|
-
variant="ghost"
|
|
179
|
-
onclick="document.getElementById('sonic-image-transition-host').replaceChildren()"
|
|
180
103
|
>
|
|
181
|
-
|
|
182
|
-
</sonic-button>
|
|
104
|
+
</sonic-image>
|
|
183
105
|
</div>
|
|
184
|
-
<div id="sonic-image-transition-host" class="flex flex-wrap gap-2 min-h-[5rem]"></div>
|
|
185
|
-
</template>
|
|
186
|
-
</sonic-code>
|
|
187
|
-
|
|
188
|
-
## Accessibility and parts
|
|
189
|
-
|
|
190
|
-
Always set meaningful **`alt`** text (empty string only for decorative images).
|
|
191
|
-
|
|
192
|
-
<sonic-code>
|
|
193
|
-
<template>
|
|
194
|
-
<sonic-image
|
|
195
|
-
rounded="md"
|
|
196
|
-
ratio="16/9"
|
|
197
|
-
alt="Concorde aircraft in flight"
|
|
198
|
-
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
199
|
-
></sonic-image>
|
|
200
106
|
</template>
|
|
201
107
|
</sonic-code>
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
## Href
|
|
4
4
|
<sonic-code>
|
|
5
5
|
<template>
|
|
6
|
-
<sonic-link href="/">Basic link with href
|
|
6
|
+
<sonic-link href="/">Basic link with href attibute</sonic-link>
|
|
7
7
|
</template>
|
|
8
8
|
</sonic-code>
|
|
9
9
|
|
|
10
10
|
## Target
|
|
11
11
|
<sonic-code>
|
|
12
12
|
<template>
|
|
13
|
-
<sonic-link href="/" target="_blank">Link with target
|
|
13
|
+
<sonic-link href="/" target="_blank">Link with target attibute</sonic-link>
|
|
14
14
|
</template>
|
|
15
15
|
</sonic-code>
|
|
16
16
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -30,43 +30,7 @@
|
|
|
30
30
|
</template>
|
|
31
31
|
</sonic-code>
|
|
32
32
|
|
|
33
|
-
Default placement is `bottom`. Placement is written `side-align`, like `sonic-tooltip`: `side` is `top`, `right`, `bottom` or `left`, `align` is `start`, `center` or `end`. Without `align`, content is aligned on the start of the trigger. If there is not enough room, content flips to the opposite side and stays inside the viewport.
|
|
34
|
-
|
|
35
|
-
The former space syntax (`placement="bottom center"`) still works but is deprecated.
|
|
36
|
-
|
|
37
|
-
<sonic-code>
|
|
38
|
-
<template>
|
|
39
|
-
<sonic-pop class="inline-block" placement="bottom-center">
|
|
40
|
-
<sonic-button>Bottom center</sonic-button>
|
|
41
|
-
<sonic-menu slot="content">
|
|
42
|
-
<sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
|
|
43
|
-
</sonic-menu>
|
|
44
|
-
</sonic-pop>
|
|
45
|
-
<sonic-pop class="inline-block" placement="top-center">
|
|
46
|
-
<sonic-button>Top center</sonic-button>
|
|
47
|
-
<sonic-menu slot="content">
|
|
48
|
-
<sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
|
|
49
|
-
</sonic-menu>
|
|
50
|
-
</sonic-pop>
|
|
51
|
-
<sonic-pop class="inline-block" placement="left-center">
|
|
52
|
-
<sonic-button>Left center</sonic-button>
|
|
53
|
-
<sonic-menu slot="content">
|
|
54
|
-
<sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
|
|
55
|
-
</sonic-menu>
|
|
56
|
-
</sonic-pop>
|
|
57
|
-
<sonic-pop class="inline-block" placement="right-center">
|
|
58
|
-
<sonic-button>Right center</sonic-button>
|
|
59
|
-
<sonic-menu slot="content">
|
|
60
|
-
<sonic-menu-item><sonic-icon library="iconoir" name="bell-notification" slot="prefix"></sonic-icon>Notifications</sonic-menu-item>
|
|
61
|
-
</sonic-menu>
|
|
62
|
-
</sonic-pop>
|
|
63
|
-
</template>
|
|
64
|
-
</sonic-code>
|
|
65
|
-
|
|
66
33
|
## Shadow
|
|
67
|
-
|
|
68
|
-
Default shadow is `lg`.
|
|
69
|
-
|
|
70
34
|
<sonic-code>
|
|
71
35
|
<template>
|
|
72
36
|
<sonic-pop class="inline-block" shadow="none" placement='top' >
|
|
@@ -96,26 +60,6 @@ Default shadow is `lg`.
|
|
|
96
60
|
</template>
|
|
97
61
|
</sonic-code>
|
|
98
62
|
|
|
99
|
-
## Inline
|
|
100
|
-
|
|
101
|
-
By default, pop is vertically aligned to the middle. Use `inline` to align it on the text baseline, e.g. inside a sentence.
|
|
102
|
-
|
|
103
|
-
<sonic-code>
|
|
104
|
-
<template>
|
|
105
|
-
<p>
|
|
106
|
-
The Concorde flew from Paris to
|
|
107
|
-
<sonic-pop inline>
|
|
108
|
-
<sonic-button variant="link">New York</sonic-button>
|
|
109
|
-
<sonic-menu slot="content">
|
|
110
|
-
<sonic-menu-item>See flights</sonic-menu-item>
|
|
111
|
-
<sonic-menu-item>Book a seat</sonic-menu-item>
|
|
112
|
-
</sonic-menu>
|
|
113
|
-
</sonic-pop>
|
|
114
|
-
in about 3.5 hours.
|
|
115
|
-
</p>
|
|
116
|
-
</template>
|
|
117
|
-
</sonic-code>
|
|
118
|
-
|
|
119
63
|
## noToggle
|
|
120
64
|
<sonic-code>
|
|
121
65
|
<template>
|
|
@@ -149,52 +93,4 @@ By default, pop is vertically aligned to the middle. Use `inline` to align it on
|
|
|
149
93
|
Click to open pop
|
|
150
94
|
</sonic-button>
|
|
151
95
|
</template>
|
|
152
|
-
</sonic-code>
|
|
153
|
-
|
|
154
|
-
## Keep open on select
|
|
155
|
-
|
|
156
|
-
By default, a click inside the content closes the pop, as well as a click outside. Add `data-on-select="keep"` on the content, or on any of its elements, to keep the pop open when interacting with it.
|
|
157
|
-
|
|
158
|
-
<sonic-code>
|
|
159
|
-
<template>
|
|
160
|
-
<sonic-pop class="inline-block">
|
|
161
|
-
<sonic-button>Closes on select</sonic-button>
|
|
162
|
-
<div slot="content" class="grid gap-2 p-3">
|
|
163
|
-
<sonic-checkbox>Option A</sonic-checkbox>
|
|
164
|
-
<sonic-checkbox>Option B</sonic-checkbox>
|
|
165
|
-
</div>
|
|
166
|
-
</sonic-pop>
|
|
167
|
-
<sonic-pop class="inline-block">
|
|
168
|
-
<sonic-button>Stays open on select</sonic-button>
|
|
169
|
-
<div slot="content" class="grid gap-2 p-3" data-on-select="keep">
|
|
170
|
-
<sonic-checkbox>Option A</sonic-checkbox>
|
|
171
|
-
<sonic-checkbox>Option B</sonic-checkbox>
|
|
172
|
-
</div>
|
|
173
|
-
</sonic-pop>
|
|
174
|
-
</template>
|
|
175
|
-
</sonic-code>
|
|
176
|
-
|
|
177
|
-
## Keyboard
|
|
178
|
-
|
|
179
|
-
- `ArrowDown` on the trigger opens the pop.
|
|
180
|
-
- `Escape` closes the last opened pop and gives focus back to its trigger.
|
|
181
|
-
|
|
182
|
-
## Methods and events
|
|
183
|
-
|
|
184
|
-
`show()` and `hide()` open and close the pop programmatically (see `manual` above). The pop dispatches a `show` event when it opens and a `hide` event when it closes.
|
|
185
|
-
|
|
186
|
-
```js
|
|
187
|
-
const pop = document.querySelector("sonic-pop");
|
|
188
|
-
pop.addEventListener("hide", () => console.log("pop closed"));
|
|
189
|
-
pop.show();
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## Styling
|
|
193
|
-
|
|
194
|
-
The content can be styled from outside with `::part(content)`.
|
|
195
|
-
|
|
196
|
-
```css
|
|
197
|
-
sonic-pop::part(content) {
|
|
198
|
-
border-radius: 0;
|
|
199
|
-
}
|
|
200
|
-
```
|
|
96
|
+
</sonic-code>
|
|
File without changes
|
|
File without changes
|