@supersoniks/concorde 5.0.0 → 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/.gitlab-ci.yml +0 -13
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +606 -689
- package/concorde-core.es.js +4511 -4329
- package/dist/concorde-core.bundle.js +606 -689
- package/dist/concorde-core.es.js +4511 -4329
- package/gitlab/job_tests.sh +25 -12
- package/index.html +3 -3
- package/package.json +16 -1
- 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/list/list.ts +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/ui/_css/rounded.ts +36 -0
- package/src/core/components/ui/_css/size.ts +0 -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/captcha/altchaStyles.ts +0 -0
- package/src/core/components/ui/captcha/captcha.md +0 -0
- 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/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/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/loader/loader.md +0 -0
- package/src/core/components/ui/menu/menu.md +0 -0
- package/src/core/components/ui/modal/modal-close.ts +8 -12
- package/src/core/components/ui/modal/modal.md +0 -0
- package/src/core/components/ui/modal/modal.ts +18 -18
- package/src/core/components/ui/pop/pop.md +105 -1
- package/src/core/components/ui/pop/pop.ts +143 -148
- package/src/core/components/ui/table/table-caption.ts +0 -0
- package/src/core/components/ui/table/table.md +0 -0
- package/src/core/components/ui/table/table.ts +2 -8
- package/src/core/components/ui/theme/theme.ts +1 -1
- 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 +176 -154
- package/src/core/utils/LocationHandler.ts +12 -5
- package/src/core/utils/dismissed.ts +22 -0
- package/src/core/utils/positioning.spec.ts +208 -0
- package/src/core/utils/positioning.ts +183 -0
- package/src/core/utils/route.ts +0 -0
- package/src/directives.ts +2 -3
- package/src/docs/_core-concept/subscriber.md +0 -0
- package/src/docs/_getting-started/concorde-outside.md +3 -3
- 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/code.ts +3 -1
- package/src/docs/example/users.ts +0 -0
- package/src/docs/search/docs-search.json +651 -21
- package/src/docs/search/page.ts +0 -0
- package/src/docs/tailwind/css/tailwind.css +13 -6
- package/src/tsconfig.json +45 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +50 -3
- package/vitest.setup.ts +49 -13
- package/.github/workflows/ci.yml +0 -21
- package/.github-export-ignore +0 -30
- package/CONTRIBUTING.md +0 -59
- package/DEV.md +0 -54
- package/LICENSE +0 -21
- package/OPEN_SOURCE_CHECKPOINT.md +0 -133
- package/concorde-3d.bundle.js +0 -3960
- package/concorde-3d.es.js +0 -33433
- package/concorde-hugging-face-infer.bundle.js +0 -32
- package/concorde-hugging-face-infer.es.js +0 -2952
- package/concorde-shader.bundle.js +0 -116
- package/concorde-shader.es.js +0 -8353
- package/concorde-webgpu.bundle.js +0 -307
- package/concorde-webgpu.es.js +0 -8627
- package/docs/altcha-widget.js +0 -2662
- package/docs/assets/index-BZiZXMU-.css +0 -1
- package/docs/assets/index-FmK4JaIM.js +0 -11992
- package/docs/crawl/core/components/functional/date/date.html +0 -190
- package/docs/crawl/core/components/functional/fetch/fetch.html +0 -109
- package/docs/crawl/core/components/functional/if/if.html +0 -27
- package/docs/crawl/core/components/functional/jsonata/jsonata.html +0 -79
- package/docs/crawl/core/components/functional/list/list.html +0 -70
- package/docs/crawl/core/components/functional/mix/mix.html +0 -45
- package/docs/crawl/core/components/functional/queue/queue.html +0 -96
- package/docs/crawl/core/components/functional/router/router.html +0 -106
- package/docs/crawl/core/components/functional/sdui/sdui.html +0 -269
- package/docs/crawl/core/components/functional/states/states.html +0 -66
- package/docs/crawl/core/components/functional/submit/submit.html +0 -160
- package/docs/crawl/core/components/functional/subscriber/subscriber.html +0 -67
- package/docs/crawl/core/components/functional/value/value.html +0 -51
- package/docs/crawl/core/components/ui/alert/alert.html +0 -110
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +0 -23
- package/docs/crawl/core/components/ui/badge/badge.html +0 -119
- package/docs/crawl/core/components/ui/button/button.html +0 -149
- package/docs/crawl/core/components/ui/captcha/captcha.html +0 -30
- package/docs/crawl/core/components/ui/card/card.html +0 -99
- package/docs/crawl/core/components/ui/divider/divider.html +0 -58
- package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +0 -73
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +0 -135
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +0 -79
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +0 -62
- package/docs/crawl/core/components/ui/form/input/input.html +0 -109
- package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +0 -106
- package/docs/crawl/core/components/ui/form/radio/radio.html +0 -56
- package/docs/crawl/core/components/ui/form/select/select.html +0 -73
- package/docs/crawl/core/components/ui/form/switch/switch.html +0 -56
- package/docs/crawl/core/components/ui/form/textarea/textarea.html +0 -59
- package/docs/crawl/core/components/ui/group/group.html +0 -82
- package/docs/crawl/core/components/ui/icon/icon.html +0 -133
- package/docs/crawl/core/components/ui/image/image.html +0 -110
- package/docs/crawl/core/components/ui/link/link.html +0 -42
- package/docs/crawl/core/components/ui/loader/loader.html +0 -50
- package/docs/crawl/core/components/ui/menu/menu.html +0 -322
- package/docs/crawl/core/components/ui/modal/modal.html +0 -117
- package/docs/crawl/core/components/ui/pop/pop.html +0 -102
- package/docs/crawl/core/components/ui/progress/progress.html +0 -58
- package/docs/crawl/core/components/ui/table/table.html +0 -413
- package/docs/crawl/core/components/ui/toast/toast.html +0 -122
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +0 -79
- package/docs/crawl/docs/_core-concept/dataFlow.html +0 -177
- package/docs/crawl/docs/_core-concept/overview.html +0 -66
- package/docs/crawl/docs/_core-concept/subscriber.html +0 -75
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +0 -116
- package/docs/crawl/docs/_decorators/auto-subscribe.html +0 -202
- package/docs/crawl/docs/_decorators/bind.html +0 -141
- package/docs/crawl/docs/_decorators/get.html +0 -149
- package/docs/crawl/docs/_decorators/handle.html +0 -165
- package/docs/crawl/docs/_decorators/on-assign.html +0 -355
- package/docs/crawl/docs/_decorators/patch.html +0 -78
- package/docs/crawl/docs/_decorators/post.html +0 -139
- package/docs/crawl/docs/_decorators/publish.html +0 -61
- package/docs/crawl/docs/_decorators/put.html +0 -78
- package/docs/crawl/docs/_decorators/subscribe.html +0 -109
- package/docs/crawl/docs/_decorators/wait-for-ancestors.html +0 -137
- package/docs/crawl/docs/_directives/sub.html +0 -93
- package/docs/crawl/docs/_getting-started/ai-agents.html +0 -173
- package/docs/crawl/docs/_getting-started/concorde-manual-install.html +0 -100
- package/docs/crawl/docs/_getting-started/concorde-outside.html +0 -58
- package/docs/crawl/docs/_getting-started/create-a-component.html +0 -111
- package/docs/crawl/docs/_getting-started/my-first-component.html +0 -189
- package/docs/crawl/docs/_getting-started/my-first-subscriber.html +0 -110
- package/docs/crawl/docs/_getting-started/pubsub.html +0 -62
- package/docs/crawl/docs/_getting-started/start.html +0 -76
- package/docs/crawl/docs/_getting-started/theming.html +0 -85
- package/docs/crawl/docs/_misc/api-configuration.html +0 -149
- package/docs/crawl/docs/_misc/dataProviderKey.html +0 -135
- package/docs/crawl/docs/_misc/docs-mock-api.html +0 -158
- package/docs/crawl/docs/_misc/dynamic-path.html +0 -180
- package/docs/crawl/docs/_misc/endpoint.html +0 -50
- package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +0 -138
- package/docs/crawl/docs/_misc/html-integration.html +0 -48
- package/docs/crawl/hubs/decorators.html +0 -547
- package/docs/crawl/hubs/form-components.html +0 -357
- package/docs/crawl/hubs/remote-data.html +0 -452
- package/docs/crawl/index.html +0 -101
- package/docs/css/docs.css +0 -0
- package/docs/docs-mock-api-sw.js +0 -720
- package/docs/docs-mock-api-sw.js.map +0 -7
- package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
- package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
- package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Light.eot +0 -0
- package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Light.woff +0 -0
- package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
- package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
- package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
- package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
- package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
- package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
- package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
- package/docs/img/concorde-icon.svg +0 -5
- package/docs/img/concorde-logo.svg +0 -1
- package/docs/img/concorde.png +0 -0
- package/docs/img/concorde_def.png +0 -0
- package/docs/img/concorde_seuil.png.webp +0 -0
- package/docs/img/concorde_seuil_invert.png +0 -0
- package/docs/img/paul_metrand.jpg +0 -0
- package/docs/img/paul_metrand_xs.jpg +0 -0
- package/docs/index.html +0 -93
- package/docs/llms-full.txt +0 -5787
- package/docs/llms.txt +0 -104
- package/docs/robots.txt +0 -16
- package/docs/sitemap.xml +0 -237
- package/docs/src/core/components/functional/date/date.md +0 -290
- package/docs/src/core/components/functional/fetch/fetch.md +0 -125
- package/docs/src/core/components/functional/if/if.md +0 -9
- package/docs/src/core/components/functional/jsonata/jsonata.md +0 -56
- package/docs/src/core/components/functional/list/list.md +0 -65
- package/docs/src/core/components/functional/mix/mix.md +0 -41
- package/docs/src/core/components/functional/queue/queue.md +0 -72
- package/docs/src/core/components/functional/router/router.md +0 -94
- package/docs/src/core/components/functional/sdui/default-library.json +0 -108
- package/docs/src/core/components/functional/sdui/example.json +0 -99
- package/docs/src/core/components/functional/sdui/sdui.md +0 -356
- package/docs/src/core/components/functional/states/states.md +0 -87
- package/docs/src/core/components/functional/submit/submit.md +0 -114
- package/docs/src/core/components/functional/subscriber/subscriber.md +0 -91
- package/docs/src/core/components/functional/value/value.md +0 -35
- package/docs/src/core/components/ui/alert/alert.md +0 -121
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
- package/docs/src/core/components/ui/badge/badge.md +0 -127
- package/docs/src/core/components/ui/button/button.md +0 -182
- package/docs/src/core/components/ui/captcha/captcha.md +0 -12
- package/docs/src/core/components/ui/card/card.md +0 -97
- package/docs/src/core/components/ui/divider/divider.md +0 -35
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -77
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +0 -129
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +0 -77
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +0 -44
- package/docs/src/core/components/ui/form/input/input.md +0 -142
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -133
- package/docs/src/core/components/ui/form/radio/radio.md +0 -57
- package/docs/src/core/components/ui/form/select/select.md +0 -71
- package/docs/src/core/components/ui/form/switch/switch.md +0 -57
- package/docs/src/core/components/ui/form/textarea/textarea.md +0 -65
- package/docs/src/core/components/ui/group/group.md +0 -75
- package/docs/src/core/components/ui/icon/icon.md +0 -125
- package/docs/src/core/components/ui/icon/icons.json +0 -1
- package/docs/src/core/components/ui/image/image.md +0 -107
- package/docs/src/core/components/ui/link/link.md +0 -43
- package/docs/src/core/components/ui/loader/loader.md +0 -55
- package/docs/src/core/components/ui/menu/menu.md +0 -329
- package/docs/src/core/components/ui/modal/modal.md +0 -119
- package/docs/src/core/components/ui/pop/pop.md +0 -96
- package/docs/src/core/components/ui/progress/progress.md +0 -63
- package/docs/src/core/components/ui/table/table.md +0 -455
- package/docs/src/core/components/ui/toast/toast.md +0 -166
- package/docs/src/core/components/ui/tooltip/tooltip.md +0 -82
- package/docs/src/docs/_core-concept/dataFlow.md +0 -88
- package/docs/src/docs/_core-concept/overview.md +0 -57
- package/docs/src/docs/_core-concept/subscriber.md +0 -75
- package/docs/src/docs/_decorators/ancestor-attribute.md +0 -127
- package/docs/src/docs/_decorators/auto-subscribe.md +0 -202
- package/docs/src/docs/_decorators/bind.md +0 -167
- package/docs/src/docs/_decorators/get.md +0 -162
- package/docs/src/docs/_decorators/handle.md +0 -175
- package/docs/src/docs/_decorators/on-assign.md +0 -390
- package/docs/src/docs/_decorators/patch.md +0 -70
- package/docs/src/docs/_decorators/post.md +0 -146
- package/docs/src/docs/_decorators/publish.md +0 -55
- package/docs/src/docs/_decorators/put.md +0 -70
- package/docs/src/docs/_decorators/subscribe.md +0 -100
- package/docs/src/docs/_decorators/wait-for-ancestors.md +0 -163
- package/docs/src/docs/_directives/sub.md +0 -91
- package/docs/src/docs/_getting-started/ai-agents.md +0 -76
- package/docs/src/docs/_getting-started/concorde-manual-install.md +0 -133
- package/docs/src/docs/_getting-started/concorde-outside.md +0 -33
- package/docs/src/docs/_getting-started/create-a-component.md +0 -139
- package/docs/src/docs/_getting-started/my-first-component.md +0 -236
- package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -120
- package/docs/src/docs/_getting-started/pubsub.md +0 -37
- package/docs/src/docs/_getting-started/start.md +0 -47
- package/docs/src/docs/_getting-started/theming.md +0 -91
- package/docs/src/docs/_misc/api-configuration.md +0 -81
- package/docs/src/docs/_misc/dataProviderKey.md +0 -168
- package/docs/src/docs/_misc/docs-mock-api.md +0 -63
- package/docs/src/docs/_misc/dynamic-path.md +0 -71
- package/docs/src/docs/_misc/endpoint.md +0 -45
- package/docs/src/docs/_misc/formelement-subscriber-removal.md +0 -115
- package/docs/src/docs/_misc/html-integration.md +0 -15
- package/docs/src/docs/search/docs-search.json +0 -9512
- package/docs/src/tag-list.json +0 -1
- package/docs/src/tsconfig-model.json +0 -23
- package/docs/src/tsconfig.declarations.json +0 -22
- package/docs/src/tsconfig.emit.json +0 -23
- package/docs/src/tsconfig.json +0 -858
- package/docs/svg/regular/plane.svg +0 -1
- package/docs/svg/solid/plane.svg +0 -1
- package/gitlab/job_github_mirror.sh +0 -39
- package/scripts/github-export.mjs +0 -150
- package/src/css.d.ts +0 -19
- package/src/tsconfig.declarations.json +0 -22
- package/src/tsconfig.emit.json +0 -23
|
@@ -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
|
|
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 attributes list
|
|
6
6
|
</sonic-button>
|
|
7
7
|
|
|
8
8
|
|
|
@@ -1,107 +1,201 @@
|
|
|
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
|
+
|
|
3
5
|
## Rounded
|
|
4
6
|
|
|
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
|
+
|
|
5
9
|
<sonic-code>
|
|
6
10
|
<template>
|
|
7
|
-
<div class="grid gap-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
11
|
+
<div class="grid gap-6 grid-cols-3 lg:grid-cols-4 items-end text-center text-xs ">
|
|
12
|
+
<div>
|
|
13
|
+
<sonic-image
|
|
14
|
+
ratio="1/1"
|
|
15
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
16
|
+
></sonic-image>
|
|
17
|
+
<p class="mt-2">default</p>
|
|
18
|
+
</div>
|
|
19
|
+
<div>
|
|
20
|
+
<sonic-image
|
|
21
|
+
rounded="sm"
|
|
22
|
+
ratio="1/1"
|
|
23
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
24
|
+
></sonic-image>
|
|
25
|
+
<p class="mt-2">sm</p>
|
|
26
|
+
</div>
|
|
27
|
+
<div>
|
|
28
|
+
<sonic-image
|
|
29
|
+
rounded
|
|
30
|
+
ratio="1/1"
|
|
31
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
32
|
+
></sonic-image>
|
|
33
|
+
<p class="mt-2">rounded</p>
|
|
34
|
+
</div>
|
|
35
|
+
<div>
|
|
36
|
+
<sonic-image
|
|
37
|
+
rounded="md"
|
|
38
|
+
ratio="1/1"
|
|
39
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
40
|
+
></sonic-image>
|
|
41
|
+
<p class="mt-2">md</p>
|
|
42
|
+
</div>
|
|
43
|
+
<div>
|
|
44
|
+
<sonic-image
|
|
45
|
+
rounded="lg"
|
|
46
|
+
ratio="1/1"
|
|
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>
|
|
43
69
|
</div>
|
|
44
70
|
</template>
|
|
45
71
|
</sonic-code>
|
|
46
72
|
|
|
47
|
-
##
|
|
73
|
+
## Aspect ratio
|
|
74
|
+
|
|
75
|
+
**`ratio`** sets CSS `aspect-ratio` on the image (default **`auto`**). The image still fills the host width (`width: 100%`).
|
|
48
76
|
|
|
49
77
|
<sonic-code>
|
|
50
78
|
<template>
|
|
51
79
|
<div class="grid gap-8 grid-cols-2 items-center">
|
|
52
80
|
<sonic-image
|
|
53
81
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
54
|
-
>
|
|
55
|
-
</sonic-image>
|
|
82
|
+
></sonic-image>
|
|
56
83
|
<sonic-image
|
|
57
84
|
ratio="16/9"
|
|
58
85
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
59
|
-
>
|
|
60
|
-
</sonic-image>
|
|
86
|
+
></sonic-image>
|
|
61
87
|
<sonic-image
|
|
62
88
|
ratio="1/1"
|
|
63
89
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
64
|
-
>
|
|
65
|
-
</sonic-image>
|
|
90
|
+
></sonic-image>
|
|
66
91
|
<sonic-image
|
|
67
92
|
ratio="2/3"
|
|
68
93
|
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
69
|
-
>
|
|
70
|
-
</sonic-image>
|
|
94
|
+
></sonic-image>
|
|
71
95
|
</div>
|
|
72
96
|
</template>
|
|
73
97
|
</sonic-code>
|
|
74
98
|
|
|
75
99
|
## Object position
|
|
76
100
|
|
|
101
|
+
**`objectPosition`** maps to CSS `object-position` (default **`center center`**). Useful on wide crops when the subject sits off-center.
|
|
102
|
+
|
|
77
103
|
<sonic-code>
|
|
78
104
|
<template>
|
|
79
105
|
<div class="grid gap-8 grid-cols-2 items-center">
|
|
80
106
|
<sonic-image
|
|
81
|
-
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
82
107
|
ratio="11/4"
|
|
83
|
-
|
|
84
|
-
|
|
108
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
109
|
+
></sonic-image>
|
|
85
110
|
<sonic-image
|
|
86
111
|
objectPosition="center top"
|
|
87
|
-
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
88
112
|
ratio="11/4"
|
|
89
|
-
|
|
90
|
-
|
|
113
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
114
|
+
></sonic-image>
|
|
91
115
|
</div>
|
|
92
116
|
</template>
|
|
93
117
|
</sonic-code>
|
|
94
118
|
|
|
95
119
|
## Cover
|
|
96
120
|
|
|
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
|
+
|
|
97
123
|
<sonic-code>
|
|
98
124
|
<template>
|
|
99
|
-
<div class="h-96 relative">
|
|
125
|
+
<div class="h-96 relative rounded-lg overflow-hidden">
|
|
100
126
|
<sonic-image
|
|
101
127
|
cover
|
|
102
128
|
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()"
|
|
103
180
|
>
|
|
104
|
-
|
|
181
|
+
Clear
|
|
182
|
+
</sonic-button>
|
|
105
183
|
</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>
|
|
106
200
|
</template>
|
|
107
201
|
</sonic-code>
|