@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,18 +1,18 @@
|
|
|
1
1
|
import { html, LitElement, css } from "lit";
|
|
2
2
|
import { customElement, property } from "lit/decorators.js";
|
|
3
3
|
import { styleMap } from "lit/directives/style-map.js";
|
|
4
|
+
import { Rounded, hostRounded } from "../_css/rounded";
|
|
4
5
|
const tagName = "sonic-image";
|
|
5
6
|
@customElement(tagName)
|
|
6
7
|
export class Image extends LitElement {
|
|
7
8
|
static styles = [
|
|
9
|
+
hostRounded,
|
|
8
10
|
css`
|
|
9
11
|
:host {
|
|
10
|
-
--sc-
|
|
11
|
-
|
|
12
|
-
border-radius: var(--sc-img-radius);
|
|
12
|
+
--sc-_bg: var(--sc-placeholder-bg, rgba(12, 12, 12, 0.05));
|
|
13
|
+
background: var(--sc-_bg);
|
|
13
14
|
display: block;
|
|
14
15
|
width: 100%;
|
|
15
|
-
background: var(--sc-img-bg);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
img {
|
|
@@ -25,34 +25,6 @@ export class Image extends LitElement {
|
|
|
25
25
|
visibility: hidden;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
/*Rounded*/
|
|
29
|
-
:host([rounded]) {
|
|
30
|
-
--sc-img-radius: var(--sc-rounded);
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
}
|
|
33
|
-
:host([rounded="sm"]) {
|
|
34
|
-
--sc-img-radius: var(--sc-rounded-sm);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host([rounded="md"]) {
|
|
38
|
-
--sc-img-radius: var(--sc-rounded-md);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
:host([rounded="lg"]) {
|
|
42
|
-
--sc-img-radius: var(--sc-rounded-lg);
|
|
43
|
-
}
|
|
44
|
-
:host([rounded="xl"]) {
|
|
45
|
-
--sc-img-radius: var(--sc-rounded-xl);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/*Cercle*/
|
|
49
|
-
:host([rounded="full"]) {
|
|
50
|
-
--sc-img-radius: 50% !important;
|
|
51
|
-
}
|
|
52
|
-
:host([rounded="none"]) {
|
|
53
|
-
--sc-img-radius: 0 !important;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
28
|
:host([cover]),
|
|
57
29
|
:host([cover]) > div,
|
|
58
30
|
:host([cover]) img {
|
|
@@ -72,7 +44,8 @@ export class Image extends LitElement {
|
|
|
72
44
|
|
|
73
45
|
:host([transition="fade-scale-out"]) img {
|
|
74
46
|
scale: 1.08;
|
|
75
|
-
transition:
|
|
47
|
+
transition:
|
|
48
|
+
opacity 0.3s linear,
|
|
76
49
|
scale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
77
50
|
}
|
|
78
51
|
:host([transition]) img.loaded {
|
|
@@ -82,13 +55,7 @@ export class Image extends LitElement {
|
|
|
82
55
|
`,
|
|
83
56
|
];
|
|
84
57
|
|
|
85
|
-
@property({ type: String }) rounded:
|
|
86
|
-
| ""
|
|
87
|
-
| "none"
|
|
88
|
-
| "full"
|
|
89
|
-
| "sm"
|
|
90
|
-
| "md"
|
|
91
|
-
| "lg" = "none";
|
|
58
|
+
@property({ type: String, reflect: true }) rounded: Rounded = "none";
|
|
92
59
|
@property({ type: String }) src = "";
|
|
93
60
|
@property({ type: String }) alt = "";
|
|
94
61
|
@property({ type: String }) loading: "eager" | "lazy" = "lazy";
|
|
@@ -101,7 +68,7 @@ export class Image extends LitElement {
|
|
|
101
68
|
@property({ type: Boolean, reflect: true }) cover = false;
|
|
102
69
|
|
|
103
70
|
firstUpdated(
|
|
104
|
-
changedProperties: Map<string | number | symbol, unknown
|
|
71
|
+
changedProperties: Map<string | number | symbol, unknown>,
|
|
105
72
|
): void {
|
|
106
73
|
if (this.transition) {
|
|
107
74
|
const img = this.shadowRoot?.querySelector("img");
|
|
@@ -119,10 +86,9 @@ export class Image extends LitElement {
|
|
|
119
86
|
imageRendering: this.imageRendering,
|
|
120
87
|
objectPosition: this.objectPosition,
|
|
121
88
|
};
|
|
122
|
-
return html`<div
|
|
123
|
-
<picture
|
|
89
|
+
return html`<div>
|
|
90
|
+
<picture
|
|
124
91
|
><img
|
|
125
|
-
part="img"
|
|
126
92
|
src="${this.src}"
|
|
127
93
|
loading="${this.loading}"
|
|
128
94
|
alt="${this.alt}"
|
|
@@ -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 attribute</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 attribute</sonic-link>
|
|
14
14
|
</template>
|
|
15
15
|
</sonic-code>
|
|
16
16
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import LocationHandler
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
1
|
+
import LocationHandler, {
|
|
2
|
+
type AutoActiveMode,
|
|
3
|
+
} from "@supersoniks/concorde/core/utils/LocationHandler";
|
|
4
|
+
import { html, LitElement, css, nothing } from "lit";
|
|
5
|
+
import { customElement, property } from "lit/decorators.js";
|
|
6
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
7
|
import Electron from "@supersoniks/concorde/core/utils/Electron";
|
|
6
8
|
const tagName = "sonic-link";
|
|
7
9
|
|
|
@@ -11,13 +13,27 @@ export class Link extends LitElement {
|
|
|
11
13
|
css`
|
|
12
14
|
a {
|
|
13
15
|
color: inherit;
|
|
14
|
-
text-decoration:
|
|
15
|
-
display:
|
|
16
|
+
text-decoration: inherit;
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: inherit;
|
|
19
|
+
gap: inherit;
|
|
20
|
+
min-width: 0;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
a:focus {
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
a:focus-visible {
|
|
29
|
+
outline: 2px solid currentColor;
|
|
30
|
+
outline-offset: 2px;
|
|
31
|
+
border-radius: 2px;
|
|
16
32
|
}
|
|
17
33
|
`,
|
|
18
34
|
];
|
|
19
35
|
|
|
20
|
-
@property({type: String}) href = "";
|
|
36
|
+
@property({ type: String }) href = "";
|
|
21
37
|
private _location = "";
|
|
22
38
|
get location(): string {
|
|
23
39
|
return this._location;
|
|
@@ -27,47 +43,37 @@ export class Link extends LitElement {
|
|
|
27
43
|
LocationHandler.updateComponentActiveState(this);
|
|
28
44
|
}
|
|
29
45
|
|
|
30
|
-
@property({type: String, attribute: "data-aria-label"}) ariaLabel
|
|
46
|
+
@property({ type: String, attribute: "data-aria-label" }) ariaLabel:
|
|
47
|
+
| string
|
|
48
|
+
| null = null;
|
|
31
49
|
|
|
32
50
|
/**
|
|
33
|
-
*
|
|
34
|
-
* - strict
|
|
35
|
-
* -
|
|
36
|
-
* -
|
|
51
|
+
* Active state for in-app navigation:
|
|
52
|
+
* - strict — pathname, search, and hash must match
|
|
53
|
+
* - strict-path-only — pathname and hash must match (ignore search)
|
|
54
|
+
* - partial — current URL starts with href (default)
|
|
55
|
+
* - disabled — never sets `active`
|
|
37
56
|
*/
|
|
38
|
-
@property({type: String}) autoActive:
|
|
57
|
+
@property({ type: String }) autoActive: AutoActiveMode = "partial";
|
|
58
|
+
|
|
39
59
|
connectedCallback() {
|
|
40
60
|
if (this.href && this.href.indexOf("http") != 0) {
|
|
41
61
|
LocationHandler.onChange(this);
|
|
42
|
-
this.location = document.location.href.replace(
|
|
62
|
+
this.location = document.location.href.replace(
|
|
63
|
+
document.location.origin,
|
|
64
|
+
"",
|
|
65
|
+
);
|
|
43
66
|
}
|
|
44
67
|
|
|
45
|
-
// on Enter keypress we trigger a click on the link tag
|
|
46
|
-
this.addEventListener("keypress", (e: KeyboardEvent) => {
|
|
47
|
-
if (e.key === "Enter") {
|
|
48
|
-
this.shadowRoot?.querySelector("a")?.click();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
this.setFocusable();
|
|
53
|
-
|
|
54
68
|
super.connectedCallback();
|
|
55
69
|
}
|
|
56
70
|
|
|
57
|
-
setFocusable() {
|
|
58
|
-
if (this.href) {
|
|
59
|
-
this.setAttribute("tabIndex", "0");
|
|
60
|
-
} else {
|
|
61
|
-
this.removeAttribute("tabIndex");
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
71
|
disconnectedCallback(): void {
|
|
66
72
|
LocationHandler.offChange(this);
|
|
67
73
|
super.disconnectedCallback();
|
|
68
74
|
}
|
|
69
75
|
private _target: string | null = null;
|
|
70
|
-
@property({type: String}) set target(newTarget) {
|
|
76
|
+
@property({ type: String }) set target(newTarget) {
|
|
71
77
|
this._target = newTarget;
|
|
72
78
|
Electron.fixBlankLink(this);
|
|
73
79
|
this.requestUpdate();
|
|
@@ -79,17 +85,15 @@ export class Link extends LitElement {
|
|
|
79
85
|
/**
|
|
80
86
|
* Si présent on passe en mode pushstate
|
|
81
87
|
*/
|
|
82
|
-
@property({type: Boolean}) pushState: boolean | null = null;
|
|
88
|
+
@property({ type: Boolean, reflect: true }) pushState: boolean | null = null;
|
|
83
89
|
|
|
84
90
|
handlePushState(e: Event) {
|
|
85
91
|
e.preventDefault();
|
|
86
92
|
LocationHandler.changeFromComponent(this);
|
|
87
93
|
}
|
|
88
94
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.setFocusable();
|
|
92
|
-
}
|
|
95
|
+
private get blankRel(): string | undefined {
|
|
96
|
+
return this.target === "_blank" ? "noopener noreferrer" : undefined;
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
render() {
|
|
@@ -99,6 +103,7 @@ export class Link extends LitElement {
|
|
|
99
103
|
href="${this.href}"
|
|
100
104
|
aria-label=${this.ariaLabel || nothing}
|
|
101
105
|
target=${ifDefined(this.target)}
|
|
106
|
+
rel=${ifDefined(this.blankRel)}
|
|
102
107
|
@click=${this.pushState ? this.handlePushState : null}
|
|
103
108
|
>
|
|
104
109
|
<slot></slot>
|
|
File without changes
|
|
File without changes
|
|
@@ -4,31 +4,27 @@ import { Modal } from "@supersoniks/concorde/core/components/ui/modal/modal";
|
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
5
|
import HTML from "@supersoniks/concorde/core/utils/HTML";
|
|
6
6
|
import { ButtonType } from "../button/button";
|
|
7
|
+
import {
|
|
8
|
+
resolveUiLabel,
|
|
9
|
+
uiAriaLabels,
|
|
10
|
+
type UiLabelDict,
|
|
11
|
+
} from "@supersoniks/concorde/core/components/ui/_i18n/ui-aria-labels";
|
|
12
|
+
|
|
7
13
|
const tagName = "sonic-modal-close";
|
|
8
14
|
|
|
9
15
|
@customElement(tagName)
|
|
10
16
|
export class ModalClose extends LitElement {
|
|
11
|
-
@property() translation:
|
|
12
|
-
fr: "Fermer la fenêtre",
|
|
13
|
-
en: "Close window",
|
|
14
|
-
de: "Fenster schließen",
|
|
15
|
-
nl: "Venster sluiten",
|
|
16
|
-
es: "Cerrar",
|
|
17
|
-
};
|
|
17
|
+
@property() translation: UiLabelDict = { ...uiAriaLabels.closeWindow };
|
|
18
18
|
|
|
19
19
|
@property() reset?: string;
|
|
20
20
|
@property() type?: ButtonType;
|
|
21
21
|
|
|
22
|
-
connectedCallback() {
|
|
23
|
-
super.connectedCallback();
|
|
24
|
-
this.lang = document.documentElement.lang?.split("-")[0] ?? "fr";
|
|
25
|
-
}
|
|
26
22
|
render() {
|
|
27
23
|
return html`<sonic-button
|
|
28
24
|
noAutoFill
|
|
29
|
-
data-aria-label=${this.translation[this.lang]}
|
|
30
25
|
reset=${ifDefined(this.reset)}
|
|
31
26
|
shape="circle"
|
|
27
|
+
.ariaLabel=${resolveUiLabel(this.translation)}
|
|
32
28
|
@click=${this.handleClick}
|
|
33
29
|
type=${ifDefined(this.type)}
|
|
34
30
|
><sonic-icon name="cancel" size="lg"></sonic-icon
|
|
File without changes
|
|
@@ -58,13 +58,13 @@ export class Modal extends Subscriber(LitElement) {
|
|
|
58
58
|
--sc-modal-py: 2.5rem;
|
|
59
59
|
--sc-modal-px: 1.5rem;
|
|
60
60
|
|
|
61
|
-
--
|
|
62
|
-
--
|
|
61
|
+
--sc-_backdrop-bg: var(
|
|
62
|
+
--sc-_overlay-bg,
|
|
63
63
|
var(--sc-base-200, rgba(0, 0, 0, 0.12))
|
|
64
64
|
);
|
|
65
|
-
--
|
|
66
|
-
--
|
|
67
|
-
--
|
|
65
|
+
--sc-_backdrop-opacity: 0;
|
|
66
|
+
--sc-_rounded: var(--sc-rounded-lg);
|
|
67
|
+
--sc-_z-index: 990;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
* {
|
|
@@ -76,7 +76,7 @@ export class Modal extends Subscriber(LitElement) {
|
|
|
76
76
|
color: var(--sc-base-content, #000);
|
|
77
77
|
width: 100%;
|
|
78
78
|
box-shadow: var(--sc-shadow-lg);
|
|
79
|
-
border-radius: var(--
|
|
79
|
+
border-radius: var(--sc-_rounded) var(--sc-_rounded);
|
|
80
80
|
transform: translateZ(0);
|
|
81
81
|
border: none;
|
|
82
82
|
outline: none;
|
|
@@ -87,16 +87,16 @@ export class Modal extends Subscriber(LitElement) {
|
|
|
87
87
|
opacity: 0;
|
|
88
88
|
position: fixed;
|
|
89
89
|
inset: 0;
|
|
90
|
-
z-index: var(--
|
|
90
|
+
z-index: var(--sc-_z-index);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
#backdrop {
|
|
94
|
-
opacity: var(--
|
|
95
|
-
background: var(--
|
|
94
|
+
opacity: var(--sc-_backdrop-opacity, 0);
|
|
95
|
+
background: var(--sc-_backdrop-bg);
|
|
96
96
|
transition: opacity 0.15s linear;
|
|
97
97
|
inset: 0;
|
|
98
98
|
position: fixed;
|
|
99
|
-
z-index: var(--
|
|
99
|
+
z-index: var(--sc-_z-index);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
#modal-content {
|
|
@@ -112,12 +112,12 @@ export class Modal extends Subscriber(LitElement) {
|
|
|
112
112
|
max-width: none !important;
|
|
113
113
|
margin: auto 0 0 !important;
|
|
114
114
|
width: 100% !important;
|
|
115
|
-
border-radius: var(--
|
|
115
|
+
border-radius: var(--sc-_rounded) var(--sc-_rounded) 0 0 !important;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
:host([fullScreen]) {
|
|
120
|
-
--
|
|
120
|
+
--sc-_rounded: 0;
|
|
121
121
|
}
|
|
122
122
|
:host([fullScreen]) #modal {
|
|
123
123
|
width: 100% !important;
|
|
@@ -161,11 +161,11 @@ export class Modal extends Subscriber(LitElement) {
|
|
|
161
161
|
/* Close button */
|
|
162
162
|
::slotted(sonic-modal-close),
|
|
163
163
|
sonic-modal-close {
|
|
164
|
-
--
|
|
165
|
-
--
|
|
164
|
+
--sc-_top: 0.25rem;
|
|
165
|
+
--sc-_x: 0.25rem;
|
|
166
166
|
position: sticky;
|
|
167
167
|
display: block;
|
|
168
|
-
top: var(--
|
|
168
|
+
top: var(--sc-_top);
|
|
169
169
|
margin-left: auto;
|
|
170
170
|
margin-bottom: -1rem;
|
|
171
171
|
margin-top: calc(-1 * var(--sc-modal-py) - 0.25rem);
|
|
@@ -312,7 +312,7 @@ export class Modal extends Subscriber(LitElement) {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
if (_changedProperties.has("zIndex")) {
|
|
315
|
-
this.style.setProperty("--
|
|
315
|
+
this.style.setProperty("--sc-_z-index", this.zIndex || "990");
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
if (_changedProperties.has("paddingX")) {
|
|
@@ -530,10 +530,10 @@ export class Modal extends Subscriber(LitElement) {
|
|
|
530
530
|
// Backdrop
|
|
531
531
|
if (!this.fullScreen) {
|
|
532
532
|
if (isEntering) {
|
|
533
|
-
this.style.setProperty("--
|
|
533
|
+
this.style.setProperty("--sc-_backdrop-opacity", "0.8");
|
|
534
534
|
} else {
|
|
535
535
|
setTimeout(() => {
|
|
536
|
-
this.style.setProperty("--
|
|
536
|
+
this.style.setProperty("--sc-_backdrop-opacity", "0");
|
|
537
537
|
}, 150);
|
|
538
538
|
}
|
|
539
539
|
}
|
|
@@ -30,7 +30,43 @@
|
|
|
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
|
+
|
|
33
66
|
## Shadow
|
|
67
|
+
|
|
68
|
+
Default shadow is `lg`.
|
|
69
|
+
|
|
34
70
|
<sonic-code>
|
|
35
71
|
<template>
|
|
36
72
|
<sonic-pop class="inline-block" shadow="none" placement='top' >
|
|
@@ -60,6 +96,26 @@
|
|
|
60
96
|
</template>
|
|
61
97
|
</sonic-code>
|
|
62
98
|
|
|
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
|
+
|
|
63
119
|
## noToggle
|
|
64
120
|
<sonic-code>
|
|
65
121
|
<template>
|
|
@@ -93,4 +149,52 @@
|
|
|
93
149
|
Click to open pop
|
|
94
150
|
</sonic-button>
|
|
95
151
|
</template>
|
|
96
|
-
</sonic-code>
|
|
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
|
+
```
|