@supersoniks/concorde 5.0.3 → 5.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/concorde-component-docs/SKILL.md +194 -0
- package/.agents/skills/concorde-component-docs/template.md +45 -0
- package/ai/cursor/rules/concorde-theme.mdc +1 -1
- package/ai/cursor/rules/concorde.mdc +1 -1
- package/ai/skills/concorde/SKILL.md +1 -1
- package/ai/skills/concorde-theme/SKILL.md +21 -10
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +515 -521
- package/concorde-core.es.js +5151 -5056
- package/dist/concorde-core.bundle.js +515 -521
- package/dist/concorde-core.es.js +5151 -5056
- package/dist/docs-mock-api-sw.js +2 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/docs/assets/index-CD4WyL6o.css +1 -0
- package/docs/assets/{index-BnK6OS7w.js → index-wVZpLVYW.js} +815 -808
- package/docs/crawl/core/components/ui/alert/alert.html +76 -5
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +113 -5
- package/docs/crawl/core/components/ui/badge/badge.html +57 -8
- package/docs/crawl/core/components/ui/captcha/captcha.html +90 -8
- package/docs/crawl/core/components/ui/card/card.html +122 -12
- package/docs/crawl/core/components/ui/divider/divider.html +117 -31
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +232 -101
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +95 -52
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +97 -38
- package/docs/crawl/core/components/ui/group/group.html +60 -38
- package/docs/crawl/core/components/ui/icon/icon.html +136 -47
- package/docs/crawl/core/components/ui/image/image.html +118 -6
- package/docs/crawl/core/components/ui/link/link.html +65 -7
- package/docs/crawl/core/components/ui/loader/loader.html +97 -23
- package/docs/crawl/core/components/ui/menu/menu.html +162 -90
- package/docs/crawl/core/components/ui/modal/modal.html +275 -50
- package/docs/crawl/core/components/ui/pop/pop.html +242 -124
- package/docs/crawl/core/components/ui/progress/progress.html +103 -30
- package/docs/crawl/core/components/ui/table/table.html +303 -171
- package/docs/crawl/core/components/ui/theme/theme.html +131 -0
- package/docs/crawl/core/components/ui/toast/toast.html +170 -59
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +90 -29
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +3 -2
- package/docs/crawl/docs/_getting-started/start.html +1 -1
- package/docs/crawl/docs/_getting-started/theming.html +311 -63
- package/docs/crawl/hubs/form-components.html +71 -49
- package/docs/crawl/index.html +7 -6
- package/docs/docs-mock-api-sw.js +2 -0
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +6 -4
- package/docs/llms-full.txt +1468 -405
- package/docs/llms.txt +23 -30
- package/docs/sitemap.xml +3 -0
- package/docs/src/core/components/ui/alert/alert.md +21 -2
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/docs/src/core/components/ui/badge/badge.md +19 -6
- package/docs/src/core/components/ui/captcha/captcha.md +65 -6
- package/docs/src/core/components/ui/card/card.md +73 -10
- package/docs/src/core/components/ui/divider/divider.md +107 -13
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/docs/src/core/components/ui/group/group.md +36 -36
- package/docs/src/core/components/ui/icon/icon.md +132 -43
- package/docs/src/core/components/ui/image/image.md +35 -3
- package/docs/src/core/components/ui/link/link.md +43 -5
- package/docs/src/core/components/ui/loader/loader.md +79 -22
- package/docs/src/core/components/ui/menu/menu.md +133 -92
- package/docs/src/core/components/ui/modal/modal.md +163 -47
- package/docs/src/core/components/ui/pop/pop.md +217 -123
- package/docs/src/core/components/ui/progress/progress.md +76 -30
- package/docs/src/core/components/ui/table/table.md +147 -171
- package/docs/src/core/components/ui/theme/theme.md +122 -0
- package/docs/src/core/components/ui/toast/toast.md +108 -58
- package/docs/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/docs/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/docs/src/docs/_getting-started/start.md +1 -1
- package/docs/src/docs/_getting-started/theming.md +223 -61
- package/docs/src/docs/search/docs-search.json +2504 -399
- package/docs/src/tsconfig.json +18 -0
- package/index.html +4 -2
- package/package.json +7 -1
- package/public/docs-mock-api-sw.js +2 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- package/src/core/components/ui/_css/align.ts +1 -0
- package/src/core/components/ui/_css/type.ts +86 -8
- package/src/core/components/ui/_i18n/ui-aria-labels.ts +8 -0
- package/src/core/components/ui/alert/alert.md +21 -2
- package/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/src/core/components/ui/badge/badge.md +19 -6
- package/src/core/components/ui/badge/badge.ts +8 -9
- package/src/core/components/ui/button/button.ts +5 -15
- package/src/core/components/ui/captcha/captcha.md +65 -6
- package/src/core/components/ui/card/card.md +73 -10
- package/src/core/components/ui/card/card.ts +24 -22
- package/src/core/components/ui/divider/divider.md +107 -13
- package/src/core/components/ui/divider/divider.ts +40 -33
- package/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/src/core/components/ui/form/fieldset/fieldset.ts +15 -28
- package/src/core/components/ui/form/fieldset/legend.ts +13 -13
- package/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/src/core/components/ui/form/form-actions/form-actions.ts +7 -5
- package/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/src/core/components/ui/form/form-layout/form-layout.ts +27 -24
- package/src/core/components/ui/form/textarea/textarea.ts +4 -3
- package/src/core/components/ui/group/group.md +36 -36
- package/src/core/components/ui/group/group.ts +5 -10
- package/src/core/components/ui/icon/icon.md +132 -43
- package/src/core/components/ui/image/image.md +35 -3
- package/src/core/components/ui/link/link.md +43 -5
- package/src/core/components/ui/loader/loader.md +79 -22
- package/src/core/components/ui/loader/loader.ts +67 -27
- package/src/core/components/ui/loader/styles/fixed.ts +6 -11
- package/src/core/components/ui/menu/menu.md +133 -92
- package/src/core/components/ui/menu/menu.ts +53 -58
- package/src/core/components/ui/modal/modal.md +163 -47
- package/src/core/components/ui/modal/modal.ts +2 -4
- package/src/core/components/ui/pop/pop.md +217 -123
- package/src/core/components/ui/pop/pop.ts +0 -1
- package/src/core/components/ui/progress/progress.md +76 -30
- package/src/core/components/ui/progress/progress.ts +25 -56
- package/src/core/components/ui/table/table-caption.ts +2 -2
- package/src/core/components/ui/table/table-tbody.ts +3 -3
- package/src/core/components/ui/table/table-td.ts +23 -18
- package/src/core/components/ui/table/table-th.ts +8 -8
- package/src/core/components/ui/table/table-tr.ts +4 -4
- package/src/core/components/ui/table/table.md +147 -171
- package/src/core/components/ui/table/table.ts +20 -19
- package/src/core/components/ui/theme/theme-collection/auto.ts +15 -0
- package/src/core/components/ui/theme/theme-collection/core-variables.ts +8 -31
- package/src/core/components/ui/theme/theme-collection/dark.ts +1 -7
- package/src/core/components/ui/theme/theme-collection/light.ts +30 -26
- package/src/core/components/ui/theme/theme.md +122 -0
- package/src/core/components/ui/theme/theme.ts +30 -7
- package/src/core/components/ui/toast/toast-item.ts +6 -9
- package/src/core/components/ui/toast/toast.md +108 -58
- package/src/core/components/ui/toast/types.ts +1 -1
- package/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +26 -0
- package/src/core/decorators/subscriber/ancestorAttribute.ts +3 -4
- package/src/core/utils/AncestorAttributeObserver.ts +183 -70
- package/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/src/docs/_getting-started/start.md +1 -1
- package/src/docs/_getting-started/theming.md +223 -61
- package/src/docs/code.ts +125 -58
- package/src/docs/header/header.ts +62 -54
- package/src/docs/mock-api/router.ts +2 -0
- package/src/docs/navigation/navigation.ts +6 -3
- package/src/docs/search/docs-search.json +2504 -399
- package/src/docs/search/markdown-renderer.ts +6 -6
- package/src/docs/search/search.ts +4 -4
- package/src/docs/tailwind/css/tailwind.css +6 -5
- package/src/tsconfig.json +18 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +19 -0
- package/docs/assets/index--GpD7R7a.css +0 -1
|
@@ -1,166 +1,216 @@
|
|
|
1
1
|
# Toast
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Toasts surface **short-lived feedback** in a fixed stack (bottom-right in the main window). Queue messages with **`SonicToast.add()`** on the global **`SonicToast`** class—the host **`sonic-toast`** is created automatically. Prefer **`label`** for a heading; use **`preserve`** or interactive **`text`** when the user must read or act before dismiss.
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
7
|
+
Click the button to show a toast.
|
|
4
8
|
|
|
5
9
|
<sonic-code>
|
|
6
10
|
<template>
|
|
7
|
-
<sonic-button onclick="
|
|
8
|
-
|
|
11
|
+
<sonic-button onclick="SonicToast.add({ text: 'Simple notification' })">
|
|
12
|
+
Show toast
|
|
9
13
|
</sonic-button>
|
|
10
14
|
</template>
|
|
11
15
|
</sonic-code>
|
|
12
16
|
|
|
13
|
-
##
|
|
17
|
+
## Status
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
**`status`** drives color, icon, and live-region behavior. Omit **`status`** or pass an empty string for a neutral toast.
|
|
16
20
|
|
|
17
21
|
<sonic-code>
|
|
18
22
|
<template>
|
|
19
23
|
<div class="flex flex-wrap gap-2">
|
|
20
|
-
<sonic-button onclick="
|
|
24
|
+
<sonic-button onclick="SonicToast.add({ text: 'Default message', status: '' })">
|
|
21
25
|
Default
|
|
22
26
|
</sonic-button>
|
|
23
|
-
<sonic-button onclick="
|
|
27
|
+
<sonic-button onclick="SonicToast.add({ text: 'Operation succeeded', status: 'success' })">
|
|
24
28
|
Success
|
|
25
29
|
</sonic-button>
|
|
26
|
-
<sonic-button onclick="
|
|
30
|
+
<sonic-button onclick="SonicToast.add({ text: 'Something went wrong', status: 'error' })">
|
|
27
31
|
Error
|
|
28
32
|
</sonic-button>
|
|
29
|
-
<sonic-button onclick="
|
|
33
|
+
<sonic-button onclick="SonicToast.add({ text: 'Check this detail', status: 'warning' })">
|
|
30
34
|
Warning
|
|
31
35
|
</sonic-button>
|
|
32
|
-
<sonic-button onclick="
|
|
36
|
+
<sonic-button onclick="SonicToast.add({ text: 'Helpful context', status: 'info' })">
|
|
33
37
|
Info
|
|
34
38
|
</sonic-button>
|
|
35
39
|
</div>
|
|
36
40
|
</template>
|
|
37
41
|
</sonic-code>
|
|
38
42
|
|
|
39
|
-
##
|
|
43
|
+
## Label
|
|
44
|
+
|
|
45
|
+
Set **`label`** for a bold title above **`text`**. **`title`** still works but is deprecated—use **`label`** in new code.
|
|
40
46
|
|
|
41
47
|
<sonic-code>
|
|
42
48
|
<template>
|
|
43
49
|
<div class="flex flex-wrap gap-2">
|
|
44
|
-
<sonic-button
|
|
45
|
-
|
|
50
|
+
<sonic-button
|
|
51
|
+
onclick="SonicToast.add({ label: 'Success', text: 'Your request was processed.', status: 'success' })"
|
|
52
|
+
>
|
|
53
|
+
Toast with label
|
|
46
54
|
</sonic-button>
|
|
47
|
-
<sonic-button
|
|
48
|
-
|
|
55
|
+
<sonic-button
|
|
56
|
+
onclick="SonicToast.add({ label: 'Error', text: 'Processing failed. Try again.', status: 'error' })"
|
|
57
|
+
>
|
|
58
|
+
Error with label
|
|
49
59
|
</sonic-button>
|
|
50
60
|
</div>
|
|
51
61
|
</template>
|
|
52
62
|
</sonic-code>
|
|
53
63
|
|
|
54
|
-
##
|
|
64
|
+
## HTML in text
|
|
55
65
|
|
|
56
|
-
|
|
66
|
+
**`text`** (and **`label`**) can include HTML strings. Links and controls in **`text`** automatically enable **`preserve`** so the toast does not auto-hide while the user interacts.
|
|
57
67
|
|
|
58
68
|
<sonic-code>
|
|
59
69
|
<template>
|
|
60
|
-
<sonic-button
|
|
61
|
-
|
|
70
|
+
<sonic-button
|
|
71
|
+
onclick="SonicToast.add({ text: 'Message with <strong>HTML</strong> and an <a href="#">action link</a>', status: 'info' })"
|
|
72
|
+
>
|
|
73
|
+
Toast with HTML
|
|
62
74
|
</sonic-button>
|
|
63
75
|
</template>
|
|
64
76
|
</sonic-code>
|
|
65
77
|
|
|
78
|
+
## Preserve
|
|
66
79
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Par défaut, les toasts disparaissent automatiquement. Avec `preserve: true`, le toast reste affiché jusqu'à ce qu'il soit fermé manuellement.
|
|
80
|
+
Without **`preserve`**, toasts auto-hide after about six seconds (timer pauses on hover or focus). Set **`preserve`** to keep the toast until the user closes it.
|
|
70
81
|
|
|
71
82
|
<sonic-code>
|
|
72
83
|
<template>
|
|
73
|
-
<sonic-button
|
|
74
|
-
|
|
84
|
+
<sonic-button
|
|
85
|
+
onclick="SonicToast.add({ text: 'This toast stays until you dismiss it', status: 'info', preserve: true })"
|
|
86
|
+
>
|
|
87
|
+
Persistent toast
|
|
75
88
|
</sonic-button>
|
|
76
89
|
</template>
|
|
77
90
|
</sonic-code>
|
|
78
91
|
|
|
79
|
-
##
|
|
92
|
+
## Dismiss forever
|
|
80
93
|
|
|
81
|
-
|
|
94
|
+
With **`dismissForever`** and a stable **`id`**, closing the toast stores dismissal in **`localStorage`**—**`SonicToast.add`** skips it on later visits. Duplicate payloads (same fields, ignoring **`id`**) are not queued twice.
|
|
82
95
|
|
|
83
96
|
<sonic-code>
|
|
84
97
|
<template>
|
|
85
|
-
<sonic-button
|
|
86
|
-
|
|
98
|
+
<sonic-button
|
|
99
|
+
onclick="SonicToast.add({ id: 'unique-toast-id', text: 'Dismiss forever hides this across reloads', status: 'info', dismissForever: true })"
|
|
100
|
+
>
|
|
101
|
+
Dismiss forever
|
|
87
102
|
</sonic-button>
|
|
88
103
|
</template>
|
|
89
104
|
</sonic-code>
|
|
90
105
|
|
|
91
|
-
##
|
|
106
|
+
## Ghost
|
|
92
107
|
|
|
93
|
-
|
|
108
|
+
**`ghost`** renders a semi-transparent, non-interactive toast—useful for loading or background states. **`SonicToast.removeAll`** leaves ghost toasts in place.
|
|
94
109
|
|
|
95
110
|
<sonic-code>
|
|
96
111
|
<template>
|
|
97
|
-
<sonic-button
|
|
98
|
-
|
|
112
|
+
<sonic-button
|
|
113
|
+
onclick="SonicToast.add({ text: 'Ghost toast (non-interactive)', status: 'info', ghost: true })"
|
|
114
|
+
>
|
|
115
|
+
Ghost toast
|
|
99
116
|
</sonic-button>
|
|
100
117
|
</template>
|
|
101
118
|
</sonic-code>
|
|
102
119
|
|
|
120
|
+
## Dismissal
|
|
103
121
|
|
|
104
|
-
|
|
122
|
+
Use static helpers to clear the stack from app logic (for example after navigation).
|
|
105
123
|
|
|
106
|
-
###
|
|
124
|
+
### Remove all
|
|
107
125
|
|
|
108
|
-
|
|
126
|
+
Removes every toast except **`ghost`** items.
|
|
109
127
|
|
|
110
128
|
<sonic-code>
|
|
111
129
|
<template>
|
|
112
130
|
<div class="flex flex-wrap gap-2">
|
|
113
|
-
<sonic-button onclick="
|
|
114
|
-
<sonic-button onclick="
|
|
115
|
-
<sonic-button onclick="
|
|
116
|
-
<sonic-button onclick="
|
|
131
|
+
<sonic-button onclick="SonicToast.add({ text: 'Toast 1', status: 'info' })">Add toast 1</sonic-button>
|
|
132
|
+
<sonic-button onclick="SonicToast.add({ text: 'Toast 2', status: 'success' })">Add toast 2</sonic-button>
|
|
133
|
+
<sonic-button onclick="SonicToast.add({ text: 'Toast 3', status: 'warning' })">Add toast 3</sonic-button>
|
|
134
|
+
<sonic-button onclick="SonicToast.removeAll()">Remove all</sonic-button>
|
|
117
135
|
</div>
|
|
118
136
|
</template>
|
|
119
137
|
</sonic-code>
|
|
120
138
|
|
|
121
|
-
###
|
|
122
|
-
|
|
123
|
-
Supprime tous les toasts d'un statut spécifique.
|
|
139
|
+
### Remove by status
|
|
124
140
|
|
|
125
141
|
<sonic-code>
|
|
126
142
|
<template>
|
|
127
143
|
<div class="flex flex-wrap gap-2">
|
|
128
|
-
<sonic-button onclick="
|
|
129
|
-
<sonic-button onclick="
|
|
130
|
-
<sonic-button onclick="
|
|
131
|
-
<sonic-button onclick="
|
|
132
|
-
<sonic-button onclick="
|
|
144
|
+
<sonic-button onclick="SonicToast.add({ text: 'Success toast', status: 'success' })">Success</sonic-button>
|
|
145
|
+
<sonic-button onclick="SonicToast.add({ text: 'Error toast', status: 'error' })">Error</sonic-button>
|
|
146
|
+
<sonic-button onclick="SonicToast.add({ text: 'Warning toast', status: 'warning' })">Warning</sonic-button>
|
|
147
|
+
<sonic-button onclick="SonicToast.removeItemsByStatus('success')">Remove success</sonic-button>
|
|
148
|
+
<sonic-button onclick="SonicToast.removeItemsByStatus('error')">Remove error</sonic-button>
|
|
133
149
|
</div>
|
|
134
150
|
</template>
|
|
135
151
|
</sonic-code>
|
|
136
152
|
|
|
137
|
-
###
|
|
153
|
+
### Remove temporary items
|
|
138
154
|
|
|
139
|
-
|
|
155
|
+
Removes toasts that are not **`preserve`**.
|
|
140
156
|
|
|
141
157
|
<sonic-code>
|
|
142
158
|
<template>
|
|
143
159
|
<div class="flex flex-wrap gap-2">
|
|
144
|
-
<sonic-button onclick="
|
|
145
|
-
<sonic-button onclick="
|
|
146
|
-
|
|
160
|
+
<sonic-button onclick="SonicToast.add({ text: 'Temporary toast', status: 'info' })">Temporary</sonic-button>
|
|
161
|
+
<sonic-button onclick="SonicToast.add({ text: 'Persistent toast', status: 'success', preserve: true })">
|
|
162
|
+
Persistent
|
|
163
|
+
</sonic-button>
|
|
164
|
+
<sonic-button onclick="SonicToast.removeTemporaryItems()">Remove temporary</sonic-button>
|
|
147
165
|
</div>
|
|
148
166
|
</template>
|
|
149
167
|
</sonic-code>
|
|
150
168
|
|
|
151
|
-
##
|
|
169
|
+
## Combined options
|
|
152
170
|
|
|
153
171
|
<sonic-code>
|
|
154
172
|
<template>
|
|
155
|
-
<sonic-button
|
|
173
|
+
<sonic-button
|
|
174
|
+
onclick="SonicToast.add({
|
|
156
175
|
id: 'welcome-toast',
|
|
157
|
-
|
|
158
|
-
text: '
|
|
176
|
+
label: 'Welcome',
|
|
177
|
+
text: 'Welcome to the platform. Explore the docs to get started.',
|
|
159
178
|
status: 'success',
|
|
160
179
|
dismissForever: true
|
|
161
|
-
})"
|
|
162
|
-
|
|
180
|
+
})"
|
|
181
|
+
>
|
|
182
|
+
Full example
|
|
163
183
|
</sonic-button>
|
|
164
184
|
</template>
|
|
165
185
|
</sonic-code>
|
|
166
186
|
|
|
187
|
+
## Accessibility
|
|
188
|
+
|
|
189
|
+
Each toast uses **`role="alert"`** for **`error`** and **`role="status"`** otherwise (with **`aria-live="polite"`** when applicable). Status icons are decorative (**`aria-hidden`**). The close control has an i18n **`aria-label`**. When there is no **`label`**, a truncated string **`aria-label`** may be derived from plain **`text`**.
|
|
190
|
+
|
|
191
|
+
## API reference
|
|
192
|
+
|
|
193
|
+
Options passed to **`SonicToast.add(conf)`**:
|
|
194
|
+
|
|
195
|
+
| Option | Values | Description |
|
|
196
|
+
|----------|---------|-------------|
|
|
197
|
+
| `text` | string · Lit template | Main body; HTML strings are supported |
|
|
198
|
+
| `label` | string · Lit template | Optional heading above **`text`** |
|
|
199
|
+
| `title` | string · Lit template | Deprecated alias for **`label`** |
|
|
200
|
+
| `status` | `success` · `error` · `warning` · `info` · `` (empty) | Semantic styling and live region behavior |
|
|
201
|
+
| `id` | string · number | Stable id for deduplication and **`dismissForever`** (defaults to timestamp) |
|
|
202
|
+
| `preserve` | boolean | Skip auto-hide; forced when **`text`** contains interactive markup |
|
|
203
|
+
| `ghost` | boolean | Semi-transparent and non-interactive; kept by **`removeAll`** |
|
|
204
|
+
| `dismissForever` | boolean | Persist dismissal in **`localStorage`** when closed (requires stable **`id`**) |
|
|
205
|
+
| `styleSheet` | modal style input | Extra adopted styles on the toast item shadow root |
|
|
206
|
+
| `useSlot` | boolean | Legacy: project **`text`** into the light DOM slot |
|
|
207
|
+
|
|
208
|
+
| Method | Description |
|
|
209
|
+
|--------|-------------|
|
|
210
|
+
| `SonicToast.add(conf)` | Append a toast; returns the config or **`null`** if skipped (dismissed forever or duplicate) |
|
|
211
|
+
| `SonicToast.removeAll()` | Remove all non-**`ghost`** toasts |
|
|
212
|
+
| `SonicToast.removeItemsByStatus(status)` | Remove toasts matching **`status`** |
|
|
213
|
+
| `SonicToast.removeItemById(id)` | Remove a single toast by **`id`** |
|
|
214
|
+
| `SonicToast.removeTemporaryItems()` | Remove toasts without **`preserve`** |
|
|
215
|
+
|
|
216
|
+
**`sonic-toast`** is mounted automatically; **`sonic-toast-item`** is internal. In iframes, toasts can delegate to the parent window via **`postMessage`**.
|
|
@@ -1,71 +1,97 @@
|
|
|
1
1
|
# Tooltip
|
|
2
2
|
|
|
3
|
+
Tooltip shows a short **`label`** on hover (and on focus when the trigger can receive focus). Wrap the trigger in the default slot—buttons, icons, or plain text. Default **`placement`** is **`top`** (center-aligned). An empty **`label`** hides the bubble the same way as **`disabled`**.
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
3
7
|
<sonic-code>
|
|
4
8
|
<template>
|
|
5
|
-
<sonic-tooltip label="
|
|
9
|
+
<sonic-tooltip label="Additional context on hover">
|
|
10
|
+
<sonic-button variant="outline">Hover me</sonic-button>
|
|
11
|
+
</sonic-tooltip>
|
|
6
12
|
</template>
|
|
7
13
|
</sonic-code>
|
|
8
14
|
|
|
9
15
|
## Placement
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
Use **`top`** · **`bottom`** · **`left`** · **`right`** for the main axis. Add **`-start`** or **`-end`** to align the bubble along the anchor edge.
|
|
12
18
|
|
|
13
19
|
<sonic-code>
|
|
14
20
|
<template>
|
|
15
|
-
<
|
|
16
|
-
<sonic-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<sonic-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<sonic-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<sonic-
|
|
26
|
-
|
|
21
|
+
<div class="flex flex-wrap gap-2">
|
|
22
|
+
<sonic-tooltip placement="top" label="Top">
|
|
23
|
+
<sonic-button>Top</sonic-button>
|
|
24
|
+
</sonic-tooltip>
|
|
25
|
+
<sonic-tooltip placement="bottom" label="Bottom">
|
|
26
|
+
<sonic-button>Bottom</sonic-button>
|
|
27
|
+
</sonic-tooltip>
|
|
28
|
+
<sonic-tooltip placement="right" label="Right">
|
|
29
|
+
<sonic-button>Right</sonic-button>
|
|
30
|
+
</sonic-tooltip>
|
|
31
|
+
<sonic-tooltip placement="left" label="Left">
|
|
32
|
+
<sonic-button>Left</sonic-button>
|
|
33
|
+
</sonic-tooltip>
|
|
34
|
+
</div>
|
|
27
35
|
</template>
|
|
28
36
|
</sonic-code>
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
### Aligned placements
|
|
39
|
+
|
|
31
40
|
<sonic-code>
|
|
32
41
|
<template>
|
|
33
42
|
<div class="flex gap-3 flex-wrap">
|
|
34
|
-
<sonic-tooltip placement="top-start" label="
|
|
43
|
+
<sonic-tooltip placement="top-start" label="Top start">
|
|
35
44
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Top start</sonic-button>
|
|
36
45
|
</sonic-tooltip>
|
|
37
|
-
<sonic-tooltip placement="top-end" label="
|
|
46
|
+
<sonic-tooltip placement="top-end" label="Top end">
|
|
38
47
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Top end</sonic-button>
|
|
39
48
|
</sonic-tooltip>
|
|
40
|
-
<sonic-tooltip placement="bottom-start" label="
|
|
49
|
+
<sonic-tooltip placement="bottom-start" label="Bottom start">
|
|
41
50
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Bottom start</sonic-button>
|
|
42
51
|
</sonic-tooltip>
|
|
43
|
-
<sonic-tooltip placement="bottom-end" label="
|
|
52
|
+
<sonic-tooltip placement="bottom-end" label="Bottom end">
|
|
44
53
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Bottom end</sonic-button>
|
|
45
54
|
</sonic-tooltip>
|
|
46
|
-
<sonic-tooltip placement="right-start" label="
|
|
55
|
+
<sonic-tooltip placement="right-start" label="Right start">
|
|
47
56
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Right start</sonic-button>
|
|
48
57
|
</sonic-tooltip>
|
|
49
|
-
<sonic-tooltip placement="right-end" label="
|
|
58
|
+
<sonic-tooltip placement="right-end" label="Right end">
|
|
50
59
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Right end</sonic-button>
|
|
51
60
|
</sonic-tooltip>
|
|
52
|
-
<sonic-tooltip placement="left-start" label="
|
|
61
|
+
<sonic-tooltip placement="left-start" label="Left start">
|
|
53
62
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Left start</sonic-button>
|
|
54
63
|
</sonic-tooltip>
|
|
55
|
-
<sonic-tooltip placement="left-end" label="
|
|
64
|
+
<sonic-tooltip placement="left-end" label="Left end">
|
|
56
65
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Left end</sonic-button>
|
|
57
66
|
</sonic-tooltip>
|
|
58
67
|
</div>
|
|
59
68
|
</template>
|
|
60
69
|
</sonic-code>
|
|
61
70
|
|
|
71
|
+
## Label formatting
|
|
72
|
+
|
|
73
|
+
**`label`** supports line breaks (`\n` in markup or multiline text). Lines are trimmed; **` `** is normalized to spaces. **`white-space: pre-line`** preserves breaks in the bubble (max width **18rem**).
|
|
74
|
+
|
|
75
|
+
<sonic-code>
|
|
76
|
+
<template>
|
|
77
|
+
<sonic-tooltip label="First line Second line">
|
|
78
|
+
<sonic-button variant="outline">Multiline label</sonic-button>
|
|
79
|
+
</sonic-tooltip>
|
|
80
|
+
</template>
|
|
81
|
+
</sonic-code>
|
|
62
82
|
|
|
63
83
|
## Focusable
|
|
64
84
|
|
|
85
|
+
On non-interactive triggers, set **`focusable`** so the host gets **`tabindex="0"`** and the tooltip opens on keyboard focus as well as hover.
|
|
86
|
+
|
|
65
87
|
<sonic-code>
|
|
66
88
|
<template>
|
|
67
|
-
<sonic-tooltip
|
|
68
|
-
|
|
89
|
+
<sonic-tooltip
|
|
90
|
+
focusable
|
|
91
|
+
label="The Concorde made its first transatlantic crossing on September 26, 1973"
|
|
92
|
+
>
|
|
93
|
+
<sonic-icon library="iconoir" name="chat-bubble-question"></sonic-icon>
|
|
94
|
+
Focus or hover this text
|
|
69
95
|
</sonic-tooltip>
|
|
70
96
|
</template>
|
|
71
97
|
</sonic-code>
|
|
@@ -74,9 +100,25 @@ By default, tooltip is centered next to its content
|
|
|
74
100
|
|
|
75
101
|
<sonic-code>
|
|
76
102
|
<template>
|
|
77
|
-
<sonic-tooltip disabled label="
|
|
103
|
+
<sonic-tooltip disabled label="Not shown">
|
|
78
104
|
<sonic-button>Tooltip disabled</sonic-button>
|
|
79
105
|
</sonic-tooltip>
|
|
80
106
|
</template>
|
|
81
107
|
</sonic-code>
|
|
82
108
|
|
|
109
|
+
## Accessibility
|
|
110
|
+
|
|
111
|
+
The bubble uses **`popover="hint"`** (non-modal, no pointer capture). Prefer **`focusable`** when the slotted content is not already focusable. When the Popover API is unavailable, the host falls back to the native **`title`** attribute with a single-line label. Opacity transitions respect **`prefers-reduced-motion`**.
|
|
112
|
+
|
|
113
|
+
## API reference
|
|
114
|
+
|
|
115
|
+
| Attribute | Values | Description |
|
|
116
|
+
|----------|---------|-------------|
|
|
117
|
+
| `label` | string | Tooltip copy; whitespace-only values suppress the bubble |
|
|
118
|
+
| `placement` | `top` (default) · `bottom` · `left` · `right` · `top-start` · `top-end` · `bottom-start` · `bottom-end` · `left-start` · `left-end` · `right-start` · `right-end` | Position relative to the trigger; repositions while open |
|
|
119
|
+
| `disabled` | boolean | Suppress show/hide; sets **`tabindex="-1"`** on the host |
|
|
120
|
+
| `focusable` | boolean | Add **`tabindex="0"`** on the host for keyboard access |
|
|
121
|
+
|
|
122
|
+
| Slot | Description |
|
|
123
|
+
|------|-------------|
|
|
124
|
+
| *(default)* | Trigger content (hover target) |
|
|
@@ -69,8 +69,9 @@ This decorator is particularly useful for:
|
|
|
69
69
|
- By default (`dynamic: false`), the value is read once at connect time and is not updated afterward
|
|
70
70
|
- With `{ dynamic: true }`, the property stays in sync when:
|
|
71
71
|
- an ancestor **changes** the attribute value
|
|
72
|
-
- a **closer** ancestor **gains** the attribute (
|
|
73
|
-
- the
|
|
72
|
+
- a **closer** ancestor **gains** / **loses** the attribute (fallback / `null`)
|
|
73
|
+
- the component is **reparented** (no extra opt-in) — parent `childList` only reacts if *this* node moves
|
|
74
|
+
- Observers are **shared** (one per ancestor attribute / one per parent) so large lists of `sonic-icon` stay cheap on Firefox.
|
|
74
75
|
- When `dynamic` is enabled, updates also propagate to `@subscribe` / `@bind` paths that depend on the decorated property (e.g. `${dataProvider}`)
|
|
75
76
|
|
|
76
77
|
### Dynamic mode
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## What is Concorde?
|
|
4
4
|
|
|
5
5
|
Based on **[lit.dev](https://lit.dev)**, Concorde is a collection of web components for shared apps and websites.
|
|
6
|
-
Build UIs without tying components to a specific host stack, while keeping visual consistency through
|
|
6
|
+
Build UIs without tying components to a specific host stack, while keeping visual consistency through the smallest set of CSS variables needed to define a theme.
|
|
7
7
|
|
|
8
8
|
## Why and use case
|
|
9
9
|
|