@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
|
@@ -10,19 +10,28 @@ import { renderToastContent } from "@supersoniks/concorde/core/components/ui/toa
|
|
|
10
10
|
import { normalizeStyleSheets } from "@supersoniks/concorde/core/components/ui/modal/modal-utils";
|
|
11
11
|
import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
12
12
|
import { HTML } from "@supersoniks/concorde/utils";
|
|
13
|
+
import {
|
|
14
|
+
isToastDismissed,
|
|
15
|
+
markToastDismissed,
|
|
16
|
+
} from "@supersoniks/concorde/core/components/ui/toast/dismissed";
|
|
17
|
+
import { resolveToastCloseLabel } from "@supersoniks/concorde/core/components/ui/_i18n/ui-aria-labels";
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
import {
|
|
20
|
+
statusAriaLive,
|
|
21
|
+
statusAriaRole,
|
|
22
|
+
statusColor,
|
|
23
|
+
statusIcon,
|
|
24
|
+
toStatus,
|
|
25
|
+
} from "@supersoniks/concorde/core/components/ui/_css/type";
|
|
26
|
+
|
|
27
|
+
const AUTO_HIDE_DELAY = 6000;
|
|
20
28
|
const tagName = "sonic-toast-item";
|
|
21
29
|
|
|
22
30
|
@customElement(tagName)
|
|
23
31
|
export class SonicToastItem extends LitElement {
|
|
24
32
|
static styles = [
|
|
25
33
|
customScroll,
|
|
34
|
+
statusColor,
|
|
26
35
|
css`
|
|
27
36
|
* {
|
|
28
37
|
box-sizing: border-box;
|
|
@@ -31,7 +40,6 @@ export class SonicToastItem extends LitElement {
|
|
|
31
40
|
display: block;
|
|
32
41
|
pointer-events: auto;
|
|
33
42
|
position: relative;
|
|
34
|
-
--sc-toast-status-color: transparent;
|
|
35
43
|
--sc-toast-color: var(--sc-base-content, #000);
|
|
36
44
|
--sc-toast-bg: var(--sc-base, #fff);
|
|
37
45
|
--sc-toast-rounded: var(--sc-rounded-md);
|
|
@@ -52,14 +60,13 @@ export class SonicToastItem extends LitElement {
|
|
|
52
60
|
pointer-events: auto;
|
|
53
61
|
overflow: hidden;
|
|
54
62
|
line-height: 1.25;
|
|
55
|
-
color: var(--sc-toast-color);
|
|
56
63
|
box-shadow: var(--sc-toast-shadow);
|
|
57
64
|
border-radius: var(--sc-toast-rounded);
|
|
58
65
|
background: var(--sc-toast-bg);
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
.sonic-toast-content {
|
|
62
|
-
padding:
|
|
69
|
+
padding: 0.8em 2.25rem 0.8em 0.8em;
|
|
63
70
|
display: flex;
|
|
64
71
|
gap: 0.5rem;
|
|
65
72
|
overflow: auto;
|
|
@@ -67,6 +74,7 @@ export class SonicToastItem extends LitElement {
|
|
|
67
74
|
}
|
|
68
75
|
|
|
69
76
|
.sonic-toast-text {
|
|
77
|
+
color: var(--sc-toast-color);
|
|
70
78
|
align-self: center;
|
|
71
79
|
margin-top: auto;
|
|
72
80
|
margin-bottom: auto;
|
|
@@ -114,6 +122,7 @@ export class SonicToastItem extends LitElement {
|
|
|
114
122
|
border-radius: 50%;
|
|
115
123
|
text-align: center;
|
|
116
124
|
opacity: 0.5;
|
|
125
|
+
color: var(--sc-toast-color);
|
|
117
126
|
background: rgba(0, 0, 0, 0);
|
|
118
127
|
}
|
|
119
128
|
|
|
@@ -133,39 +142,21 @@ export class SonicToastItem extends LitElement {
|
|
|
133
142
|
/*Title*/
|
|
134
143
|
.sonic-toast-title {
|
|
135
144
|
font-weight: bold;
|
|
136
|
-
font-size: 1.
|
|
137
|
-
margin: 0.15em 0 0.
|
|
145
|
+
font-size: 1.125rem;
|
|
146
|
+
margin: 0.15em 0 0.15em;
|
|
138
147
|
line-height: 1.2;
|
|
139
148
|
}
|
|
140
149
|
|
|
141
|
-
/*STATUS*/
|
|
142
|
-
.
|
|
143
|
-
|
|
144
|
-
--sc-success,
|
|
145
|
-
var(--sc-base-content, #000)
|
|
146
|
-
);
|
|
150
|
+
/*STATUS — accent via statusColor (--sc-_color) */
|
|
151
|
+
:host([status]) .sonic-toast {
|
|
152
|
+
border-top: 3px solid var(--sc-_color);
|
|
147
153
|
}
|
|
148
154
|
|
|
149
|
-
.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
--sc-toast-status-color: var(
|
|
155
|
-
--sc-warning,
|
|
156
|
-
var(--sc-base-content, #000)
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.info {
|
|
161
|
-
--sc-toast-status-color: var(--sc-info, var(--sc-base-content, #000));
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.success,
|
|
165
|
-
.error,
|
|
166
|
-
.info,
|
|
167
|
-
.warning {
|
|
168
|
-
border-top: 3px solid var(--sc-toast-status-color, currentColor);
|
|
155
|
+
:host([status="success"]) .sonic-toast:before,
|
|
156
|
+
:host([status="error"]) .sonic-toast:before,
|
|
157
|
+
:host([status="info"]) .sonic-toast:before,
|
|
158
|
+
:host([status="warning"]) .sonic-toast:before {
|
|
159
|
+
background-color: var(--sc-_color);
|
|
169
160
|
}
|
|
170
161
|
|
|
171
162
|
.sonic-toast:before {
|
|
@@ -180,20 +171,12 @@ export class SonicToastItem extends LitElement {
|
|
|
180
171
|
pointer-events: none;
|
|
181
172
|
transition: 0.2s;
|
|
182
173
|
border-radius: var(--sc-toast-rounded);
|
|
183
|
-
background-color: var(--sc-toast-status-color);
|
|
184
174
|
}
|
|
185
175
|
|
|
186
176
|
.sonic-toast:hover:before {
|
|
187
177
|
opacity: 0.025;
|
|
188
178
|
}
|
|
189
179
|
|
|
190
|
-
.info .sonic-toast-icon,
|
|
191
|
-
.error .sonic-toast-icon,
|
|
192
|
-
.success .sonic-toast-icon,
|
|
193
|
-
.warning .sonic-toast-icon {
|
|
194
|
-
color: var(--sc-toast-status-color, currentColor);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
180
|
.sonic-toast-icon {
|
|
198
181
|
position: sticky;
|
|
199
182
|
top: 0;
|
|
@@ -209,7 +192,7 @@ export class SonicToastItem extends LitElement {
|
|
|
209
192
|
@property() label: ToastContent = "";
|
|
210
193
|
@property({ type: String }) id = "";
|
|
211
194
|
@property() text: ToastContent = "";
|
|
212
|
-
@property({ type: String }) status: ToastStatus = "";
|
|
195
|
+
@property({ type: String, reflect: true }) status: ToastStatus = "";
|
|
213
196
|
@property({ type: Boolean }) ghost = false;
|
|
214
197
|
@property({ type: Boolean }) preserve = false;
|
|
215
198
|
@property({ type: Boolean }) dismissForever = false;
|
|
@@ -218,7 +201,42 @@ export class SonicToastItem extends LitElement {
|
|
|
218
201
|
@property({ attribute: false }) styleSheet?: ToastStyleSheetInput;
|
|
219
202
|
@state() visible = true;
|
|
220
203
|
@state() private _titleId: string = "";
|
|
204
|
+
@state() private _dismissed = false;
|
|
221
205
|
private _adoptedStyleSheets: Array<CSSStyleSheet> = [];
|
|
206
|
+
private _hideTimer?: ReturnType<typeof setTimeout>;
|
|
207
|
+
private _hideRemaining = AUTO_HIDE_DELAY;
|
|
208
|
+
private _hideStartedAt = 0;
|
|
209
|
+
private _hovered = false;
|
|
210
|
+
private _focused = false;
|
|
211
|
+
private _hidden = false;
|
|
212
|
+
|
|
213
|
+
connectedCallback(): void {
|
|
214
|
+
super.connectedCallback();
|
|
215
|
+
this.addEventListener("mouseenter", this._onMouseEnter);
|
|
216
|
+
this.addEventListener("mouseleave", this._onMouseLeave);
|
|
217
|
+
this.addEventListener("focusin", this._onFocusIn);
|
|
218
|
+
this.addEventListener("focusout", this._onFocusOut);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
disconnectedCallback(): void {
|
|
222
|
+
this._clearHideTimer();
|
|
223
|
+
this.removeEventListener("mouseenter", this._onMouseEnter);
|
|
224
|
+
this.removeEventListener("mouseleave", this._onMouseLeave);
|
|
225
|
+
this.removeEventListener("focusin", this._onFocusIn);
|
|
226
|
+
this.removeEventListener("focusout", this._onFocusOut);
|
|
227
|
+
super.disconnectedCallback();
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
protected willUpdate(changedProperties: PropertyValues): void {
|
|
231
|
+
if (
|
|
232
|
+
changedProperties.has("dismissForever") ||
|
|
233
|
+
changedProperties.has("id")
|
|
234
|
+
) {
|
|
235
|
+
this._dismissed =
|
|
236
|
+
this.dismissForever && !!this.id && isToastDismissed(this.id);
|
|
237
|
+
}
|
|
238
|
+
super.willUpdate(changedProperties);
|
|
239
|
+
}
|
|
222
240
|
|
|
223
241
|
// @queryAssignedElements({flatten: true, slot: main"})
|
|
224
242
|
// textSlot!: HTMLElement[];
|
|
@@ -229,7 +247,7 @@ export class SonicToastItem extends LitElement {
|
|
|
229
247
|
* - "status" pour les autres (messages informatifs)
|
|
230
248
|
*/
|
|
231
249
|
getAriaRole(): "alert" | "status" {
|
|
232
|
-
return this.status
|
|
250
|
+
return statusAriaRole(toStatus(this.status) ?? "default");
|
|
233
251
|
}
|
|
234
252
|
|
|
235
253
|
/**
|
|
@@ -238,7 +256,7 @@ export class SonicToastItem extends LitElement {
|
|
|
238
256
|
* - "polite" pour les autres (peut attendre)
|
|
239
257
|
*/
|
|
240
258
|
getAriaLive(): "polite" | null {
|
|
241
|
-
return this.status
|
|
259
|
+
return statusAriaLive(toStatus(this.status) ?? "default");
|
|
242
260
|
}
|
|
243
261
|
|
|
244
262
|
/**
|
|
@@ -254,33 +272,8 @@ export class SonicToastItem extends LitElement {
|
|
|
254
272
|
return this._titleId;
|
|
255
273
|
}
|
|
256
274
|
|
|
257
|
-
/**
|
|
258
|
-
* Génère un label ARIA descriptif pour le bouton de fermeture
|
|
259
|
-
*/
|
|
260
|
-
getCloseButtonLabel(): string {
|
|
261
|
-
const statusLabels: Record<string, string> = {
|
|
262
|
-
error: "Fermer le message d'erreur",
|
|
263
|
-
warning: "Fermer l'avertissement",
|
|
264
|
-
success: "Fermer le message de succès",
|
|
265
|
-
info: "Fermer l'information",
|
|
266
|
-
};
|
|
267
|
-
const statusLabel = this.status
|
|
268
|
-
? statusLabels[this.status] || "Fermer la notification"
|
|
269
|
-
: "Fermer la notification";
|
|
270
|
-
return statusLabel;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
275
|
render() {
|
|
274
|
-
|
|
275
|
-
if (this.dismissForever) {
|
|
276
|
-
const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}";
|
|
277
|
-
const dismissedObj = JSON.parse(dismissed);
|
|
278
|
-
if (dismissedObj[this.id]) {
|
|
279
|
-
return nothing;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (!this.visible) {
|
|
276
|
+
if (this._dismissed || !this.visible) {
|
|
284
277
|
return nothing;
|
|
285
278
|
}
|
|
286
279
|
|
|
@@ -295,14 +288,14 @@ export class SonicToastItem extends LitElement {
|
|
|
295
288
|
|
|
296
289
|
const ariaLive = this.getAriaLive();
|
|
297
290
|
return html`<div
|
|
298
|
-
class="sonic-toast ${this.
|
|
291
|
+
class="sonic-toast ${this.ghost ? "ghost" : ""}"
|
|
299
292
|
role=${this.getAriaRole()}
|
|
300
293
|
aria-live=${ariaLive || nothing}
|
|
301
294
|
aria-atomic="true"
|
|
302
295
|
aria-label=${ariaLabel || nothing}
|
|
303
296
|
>
|
|
304
297
|
<button
|
|
305
|
-
aria-label=${this.
|
|
298
|
+
aria-label=${resolveToastCloseLabel(this.status)}
|
|
306
299
|
class="sonic-toast-close"
|
|
307
300
|
@click=${() => this.hide()}
|
|
308
301
|
>
|
|
@@ -314,9 +307,9 @@ export class SonicToastItem extends LitElement {
|
|
|
314
307
|
>
|
|
315
308
|
${this.status &&
|
|
316
309
|
html`<sonic-icon
|
|
317
|
-
name=${
|
|
310
|
+
name=${statusIcon[toStatus(this.status) ?? "default"]}
|
|
318
311
|
class="sonic-toast-icon"
|
|
319
|
-
size="
|
|
312
|
+
size="xl"
|
|
320
313
|
aria-hidden="true"
|
|
321
314
|
></sonic-icon>`}
|
|
322
315
|
|
|
@@ -329,8 +322,6 @@ export class SonicToastItem extends LitElement {
|
|
|
329
322
|
${this.useSlot ? nothing : renderToastContent(this.text)}
|
|
330
323
|
<slot></slot>
|
|
331
324
|
</div>
|
|
332
|
-
|
|
333
|
-
${!this.preserve ? this.autoHide() : ""}
|
|
334
325
|
</div>
|
|
335
326
|
</div>`;
|
|
336
327
|
}
|
|
@@ -339,6 +330,13 @@ export class SonicToastItem extends LitElement {
|
|
|
339
330
|
if (_changedProperties.has("styleSheet")) {
|
|
340
331
|
this.syncAdoptedStyleSheets();
|
|
341
332
|
}
|
|
333
|
+
if (
|
|
334
|
+
_changedProperties.has("preserve") ||
|
|
335
|
+
_changedProperties.has("visible") ||
|
|
336
|
+
_changedProperties.has("_dismissed")
|
|
337
|
+
) {
|
|
338
|
+
this._syncHideTimer();
|
|
339
|
+
}
|
|
342
340
|
}
|
|
343
341
|
|
|
344
342
|
syncAdoptedStyleSheets() {
|
|
@@ -357,30 +355,80 @@ export class SonicToastItem extends LitElement {
|
|
|
357
355
|
}
|
|
358
356
|
|
|
359
357
|
hide() {
|
|
358
|
+
this._clearHideTimer();
|
|
359
|
+
this._hidden = true;
|
|
360
360
|
if (!HTML.getClosestElement(this, "sonic-toast")) {
|
|
361
361
|
this.visible = false;
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
if (this.dismissForever) {
|
|
365
|
-
|
|
366
|
-
const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}";
|
|
367
|
-
const dismissedObj = JSON.parse(dismissed);
|
|
368
|
-
dismissedObj[this.id] = true;
|
|
369
|
-
localStorage.setItem(
|
|
370
|
-
"sonic-toast-dismissed",
|
|
371
|
-
JSON.stringify(dismissedObj),
|
|
372
|
-
);
|
|
365
|
+
markToastDismissed(this.id);
|
|
373
366
|
}
|
|
374
367
|
this.dispatchEvent(new CustomEvent("hide", { bubbles: true }));
|
|
375
368
|
}
|
|
376
369
|
|
|
377
370
|
show() {
|
|
371
|
+
this._hidden = false;
|
|
372
|
+
this._hideRemaining = AUTO_HIDE_DELAY;
|
|
378
373
|
this.visible = true;
|
|
374
|
+
this._syncHideTimer();
|
|
379
375
|
}
|
|
380
376
|
|
|
381
|
-
|
|
382
|
-
|
|
377
|
+
private _syncHideTimer() {
|
|
378
|
+
const shouldRun =
|
|
379
|
+
!this.preserve &&
|
|
380
|
+
this.visible &&
|
|
381
|
+
!this._hidden &&
|
|
382
|
+
!this._dismissed &&
|
|
383
|
+
!this._hovered &&
|
|
384
|
+
!this._focused;
|
|
385
|
+
|
|
386
|
+
if (!shouldRun) {
|
|
387
|
+
this._pauseHideTimer();
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
if (this._hideTimer) return;
|
|
391
|
+
|
|
392
|
+
this._hideStartedAt = Date.now();
|
|
393
|
+
this._hideTimer = setTimeout(() => {
|
|
394
|
+
this._hideTimer = undefined;
|
|
383
395
|
this.hide();
|
|
384
|
-
},
|
|
396
|
+
}, this._hideRemaining);
|
|
385
397
|
}
|
|
398
|
+
|
|
399
|
+
private _pauseHideTimer() {
|
|
400
|
+
if (!this._hideTimer) return;
|
|
401
|
+
clearTimeout(this._hideTimer);
|
|
402
|
+
this._hideTimer = undefined;
|
|
403
|
+
this._hideRemaining = Math.max(
|
|
404
|
+
0,
|
|
405
|
+
this._hideRemaining - (Date.now() - this._hideStartedAt),
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
private _clearHideTimer() {
|
|
410
|
+
clearTimeout(this._hideTimer);
|
|
411
|
+
this._hideTimer = undefined;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
private _onMouseEnter = () => {
|
|
415
|
+
this._hovered = true;
|
|
416
|
+
this._syncHideTimer();
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
private _onMouseLeave = () => {
|
|
420
|
+
this._hovered = false;
|
|
421
|
+
this._syncHideTimer();
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
private _onFocusIn = () => {
|
|
425
|
+
this._focused = true;
|
|
426
|
+
this._syncHideTimer();
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
private _onFocusOut = (e: FocusEvent) => {
|
|
430
|
+
if (this.contains(e.relatedTarget as Node | null)) return;
|
|
431
|
+
this._focused = false;
|
|
432
|
+
this._syncHideTimer();
|
|
433
|
+
};
|
|
386
434
|
}
|
|
@@ -8,6 +8,7 @@ import { ifDefined } from "lit/directives/if-defined.js";
|
|
|
8
8
|
import { styleMap, StyleInfo } from "lit/directives/style-map.js";
|
|
9
9
|
import "@supersoniks/concorde/core/components/ui/toast/toast-item";
|
|
10
10
|
import { renderToastContent } from "@supersoniks/concorde/core/components/ui/toast/render-content";
|
|
11
|
+
import { isToastDismissed } from "@supersoniks/concorde/core/components/ui/toast/dismissed";
|
|
11
12
|
import {
|
|
12
13
|
Toast,
|
|
13
14
|
ToastContent,
|
|
@@ -66,7 +67,7 @@ export class SonicToast extends LitElement {
|
|
|
66
67
|
bottom: "1.25rem",
|
|
67
68
|
right: "1.25rem",
|
|
68
69
|
zIndex: "10000",
|
|
69
|
-
maxWidth: "
|
|
70
|
+
maxWidth: "45ch",
|
|
70
71
|
flexDirection: "column-reverse",
|
|
71
72
|
};
|
|
72
73
|
}
|
|
@@ -215,12 +216,8 @@ export class SonicToast extends LitElement {
|
|
|
215
216
|
};
|
|
216
217
|
|
|
217
218
|
// check if the toast is dismissed
|
|
218
|
-
if (conf.dismissForever && conf.id) {
|
|
219
|
-
|
|
220
|
-
const dismissedObj = JSON.parse(dismissed);
|
|
221
|
-
if (dismissedObj[conf.id]) {
|
|
222
|
-
return null;
|
|
223
|
-
}
|
|
219
|
+
if (conf.dismissForever && conf.id && isToastDismissed(conf.id)) {
|
|
220
|
+
return null;
|
|
224
221
|
}
|
|
225
222
|
|
|
226
223
|
if (toastComponent?.toasts.length) {
|