@supersoniks/concorde 5.0.4 → 5.1.0
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/.tmp-cem/custom-elements.json +13705 -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-3d.bundle.js +3960 -0
- package/concorde-3d.es.js +33433 -0
- package/concorde-core.bundle.js +507 -513
- package/concorde-core.es.js +4027 -3702
- package/concorde-hugging-face-infer.bundle.js +32 -0
- package/concorde-hugging-face-infer.es.js +2952 -0
- package/concorde-interactive.bundle.js +1157 -0
- package/concorde-interactive.es.js +10734 -0
- package/concorde-shader.bundle.js +116 -0
- package/concorde-shader.es.js +8353 -0
- package/concorde-webgpu.bundle.js +307 -0
- package/concorde-webgpu.es.js +8627 -0
- package/custom-elements-manifest.config.mjs +14 -0
- package/dist/concorde-core.bundle.js +507 -513
- package/dist/concorde-core.es.js +4027 -3702
- package/dist/docs-mock-api-sw.js +2 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/gitlab/job_tests.sh +0 -0
- package/index.html +4 -2
- package/package.json +42 -2
- package/public/docs-mock-api-sw.js +2 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- package/scripts/generate-sdui-catalog.mjs +250 -0
- package/scripts/generate-sdui-catalog.spec.ts +91 -0
- package/scripts/pre-build.mjs +15 -0
- package/src/core/components/functional/if/if.ts +0 -0
- package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +5 -5
- package/src/core/components/functional/sdui/__fixtures__/descriptors.ts +251 -0
- package/src/core/components/functional/sdui/__snapshots__/sdui-action.spec.ts.snap +73 -0
- package/src/core/components/functional/sdui/__snapshots__/sdui-incremental.spec.ts.snap +50 -0
- package/src/core/components/functional/sdui/__snapshots__/sdui-partial.spec.ts.snap +50 -0
- package/src/core/components/functional/sdui/__snapshots__/sdui.regression.spec.ts.snap +461 -0
- package/src/core/components/functional/sdui/component-catalog.gaps.json +511 -0
- package/src/core/components/functional/sdui/component-catalog.json +3103 -0
- package/src/core/components/functional/sdui/component-catalog.spec.ts +23 -0
- package/src/core/components/functional/sdui/sdui-action.spec.ts +99 -0
- package/src/core/components/functional/sdui/sdui-dom-snapshot.ts +61 -0
- package/src/core/components/functional/sdui/sdui-extension-points.md +94 -0
- package/src/core/components/functional/sdui/sdui-incremental.spec.ts +137 -0
- package/src/core/components/functional/sdui/sdui-partial.spec.ts +83 -0
- package/src/core/components/functional/sdui/sdui-partial.ts +19 -0
- package/src/core/components/functional/sdui/sdui-safe.spec.ts +188 -0
- package/src/core/components/functional/sdui/sdui-safe.ts +100 -0
- package/src/core/components/functional/sdui/sdui.md +122 -0
- package/src/core/components/functional/sdui/sdui.regression.spec.ts +64 -0
- package/src/core/components/functional/sdui/sdui.ts +442 -34
- package/src/core/components/functional/sdui/types.ts +49 -0
- package/src/core/components/functional/value/value.ts +0 -0
- 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/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 +108 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +19 -0
|
@@ -1,125 +1,214 @@
|
|
|
1
1
|
# Icon
|
|
2
2
|
|
|
3
|
+
**`sonic-icon`** renders inline SVG icons from the **bundled core set** or from **CDN libraries**. Set **`name`** (and **`library`** / **`prefix`** when needed); scale with **`size`**. Icons inherit **`currentColor`** and are **`aria-hidden`** by default—keep visible text nearby or label the control that contains them.
|
|
3
4
|
|
|
4
|
-
##
|
|
5
|
+
## Core library
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
Omit **`library`** to use the bundled set in `icons.json`. Available **`name`** values: `cancel` · `check` · `check-circled-outline` · `emoji-puzzled` · `info-empty` · `loader` · `minus-small` · `more-horiz` · `more-vert` · `nav-arrow-down` · `warning-circled-outline`.
|
|
7
8
|
|
|
8
|
-
<sonic-code
|
|
9
|
-
customIconDefaultPrefix="regular">
|
|
9
|
+
<sonic-code>
|
|
10
10
|
<template>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<div class="text-
|
|
15
|
-
<sonic-icon library="custom" prefix="regular" name="plane"></sonic-icon>
|
|
16
|
-
<br>
|
|
17
|
-
<div class="text-xs mt-1">regular</div>
|
|
18
|
-
</div>
|
|
19
|
-
<div class="text-center">
|
|
20
|
-
<sonic-icon library="custom" prefix="solid" name="plane"></sonic-icon>
|
|
21
|
-
<br>
|
|
22
|
-
<div class="text-xs mt-1">solid</div>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="text-center">
|
|
25
|
-
<sonic-icon library="custom" name="plane"></sonic-icon>
|
|
26
|
-
<br>
|
|
27
|
-
<div class="text-xs mt-1">default prefix</div>
|
|
28
|
-
</div>
|
|
11
|
+
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-8">
|
|
12
|
+
<div class="text-center">
|
|
13
|
+
<sonic-icon name="cancel" size="lg"></sonic-icon>
|
|
14
|
+
<div class="text-xs mt-1">cancel</div>
|
|
29
15
|
</div>
|
|
30
|
-
|
|
16
|
+
<div class="text-center">
|
|
17
|
+
<sonic-icon name="check" size="lg"></sonic-icon>
|
|
18
|
+
<div class="text-xs mt-1">check</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="text-center">
|
|
21
|
+
<sonic-icon name="check-circled-outline" size="lg"></sonic-icon>
|
|
22
|
+
<div class="text-xs mt-1">check-circled-outline</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="text-center">
|
|
25
|
+
<sonic-icon name="emoji-puzzled" size="lg"></sonic-icon>
|
|
26
|
+
<div class="text-xs mt-1">emoji-puzzled</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="text-center">
|
|
29
|
+
<sonic-icon name="info-empty" size="lg"></sonic-icon>
|
|
30
|
+
<div class="text-xs mt-1">info-empty</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="text-center">
|
|
33
|
+
<sonic-icon name="loader" size="lg"></sonic-icon>
|
|
34
|
+
<div class="text-xs mt-1">loader</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="text-center">
|
|
37
|
+
<sonic-icon name="minus-small" size="lg"></sonic-icon>
|
|
38
|
+
<div class="text-xs mt-1">minus-small</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="text-center">
|
|
41
|
+
<sonic-icon name="more-horiz" size="lg"></sonic-icon>
|
|
42
|
+
<div class="text-xs mt-1">more-horiz</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="text-center">
|
|
45
|
+
<sonic-icon name="more-vert" size="lg"></sonic-icon>
|
|
46
|
+
<div class="text-xs mt-1">more-vert</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="text-center">
|
|
49
|
+
<sonic-icon name="nav-arrow-down" size="lg"></sonic-icon>
|
|
50
|
+
<div class="text-xs mt-1">nav-arrow-down</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="text-center">
|
|
53
|
+
<sonic-icon name="warning-circled-outline" size="lg"></sonic-icon>
|
|
54
|
+
<div class="text-xs mt-1">warning-circled-outline</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
31
57
|
</template>
|
|
32
58
|
</sonic-code>
|
|
33
59
|
|
|
60
|
+
## External libraries
|
|
61
|
+
|
|
62
|
+
Set **`library`** to load SVGs from a built-in CDN template. **`prefix`** falls back to each library’s default when omitted (`outline` for **`heroicons`**, **`regular`** for **`fontAwesome`** and **`material`**, and so on).
|
|
34
63
|
|
|
35
|
-
## External
|
|
36
64
|
<sonic-code>
|
|
37
65
|
<template>
|
|
38
66
|
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-8">
|
|
39
67
|
<sonic-link href="https://heroicons.com/" target="_blank" class="text-center underline">
|
|
40
68
|
<sonic-icon library="heroicons" prefix="outline" name="academic-cap" size="lg"></sonic-icon>
|
|
41
|
-
<br
|
|
69
|
+
<br />
|
|
42
70
|
<div class="text-xs mt-1">heroicons</div>
|
|
43
71
|
</sonic-link>
|
|
44
72
|
<sonic-link href="https://iconoir.com/" target="_blank" class="text-center underline">
|
|
45
|
-
<sonic-icon library="iconoir" name="2x2-cell"
|
|
46
|
-
<br
|
|
73
|
+
<sonic-icon library="iconoir" name="2x2-cell" size="lg"></sonic-icon>
|
|
74
|
+
<br />
|
|
47
75
|
<div class="text-xs mt-1">iconoir</div>
|
|
48
76
|
</sonic-link>
|
|
49
77
|
<sonic-link href="https://materialdesignicons.com/" target="_blank" class="text-center underline">
|
|
50
78
|
<sonic-icon library="material" prefix="outline" name="email" size="lg"></sonic-icon>
|
|
51
|
-
<br
|
|
79
|
+
<br />
|
|
52
80
|
<div class="text-xs mt-1">material design</div>
|
|
53
81
|
</sonic-link>
|
|
54
82
|
<sonic-link href="https://fontawesome.com/search?o=r&m=free&s=regular" target="_blank" class="text-center underline">
|
|
55
83
|
<sonic-icon library="fontAwesome" prefix="regular" name="user" size="lg"></sonic-icon>
|
|
56
|
-
<br
|
|
84
|
+
<br />
|
|
57
85
|
<div class="text-xs mt-1">fontAwesome regular</div>
|
|
58
86
|
</sonic-link>
|
|
59
87
|
<sonic-link href="https://fontawesome.com/search?o=r&m=free&s=solid" target="_blank" class="text-center underline">
|
|
60
88
|
<sonic-icon library="fontAwesome" prefix="solid" name="book" size="lg"></sonic-icon>
|
|
61
|
-
<br
|
|
89
|
+
<br />
|
|
62
90
|
<div class="text-xs mt-1">fontAwesome solid</div>
|
|
63
91
|
</sonic-link>
|
|
64
92
|
<sonic-link href="https://feathericons.com/" target="_blank" class="text-center underline">
|
|
65
|
-
<sonic-icon library="feathers" name="activity"
|
|
66
|
-
<br
|
|
93
|
+
<sonic-icon library="feathers" name="activity" size="lg"></sonic-icon>
|
|
94
|
+
<br />
|
|
67
95
|
<div class="text-xs mt-1">feathers</div>
|
|
68
96
|
</sonic-link>
|
|
69
97
|
<sonic-link href="https://lucide.dev/" target="_blank" class="text-center underline">
|
|
70
|
-
<sonic-icon library="lucide" name="album"
|
|
71
|
-
<br
|
|
98
|
+
<sonic-icon library="lucide" name="album" size="lg"></sonic-icon>
|
|
99
|
+
<br />
|
|
72
100
|
<div class="text-xs mt-1">lucide</div>
|
|
73
101
|
</sonic-link>
|
|
74
102
|
</div>
|
|
75
103
|
</template>
|
|
76
104
|
</sonic-code>
|
|
77
105
|
|
|
106
|
+
## Custom library
|
|
107
|
+
|
|
108
|
+
Use **`library="custom"`** with SVG files on your origin. On an ancestor (for example **`sonic-scope`** or **`sonic-code`**), set **`customIconLibraryPath`** to a URL template with **`$prefix`** and **`$name`** placeholders, and optionally **`customIconDefaultPrefix`** when **`prefix`** is omitted.
|
|
109
|
+
|
|
110
|
+
<sonic-code
|
|
111
|
+
customIconLibraryPath="/svg/$prefix/$name.svg"
|
|
112
|
+
customIconDefaultPrefix="regular"
|
|
113
|
+
>
|
|
114
|
+
<template>
|
|
115
|
+
<sonic-scope
|
|
116
|
+
customIconLibraryPath="/svg/$prefix/$name.svg"
|
|
117
|
+
customIconDefaultPrefix="regular"
|
|
118
|
+
>
|
|
119
|
+
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-8">
|
|
120
|
+
<div class="text-center">
|
|
121
|
+
<sonic-icon library="custom" prefix="regular" name="plane"></sonic-icon>
|
|
122
|
+
<br />
|
|
123
|
+
<div class="text-xs mt-1">regular</div>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="text-center">
|
|
126
|
+
<sonic-icon library="custom" prefix="solid" name="plane"></sonic-icon>
|
|
127
|
+
<br />
|
|
128
|
+
<div class="text-xs mt-1">solid</div>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="text-center">
|
|
131
|
+
<sonic-icon library="custom" name="plane"></sonic-icon>
|
|
132
|
+
<br />
|
|
133
|
+
<div class="text-xs mt-1">default prefix</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</sonic-scope>
|
|
137
|
+
</template>
|
|
138
|
+
</sonic-code>
|
|
139
|
+
|
|
78
140
|
## Size
|
|
141
|
+
|
|
142
|
+
Omit **`size`** for the default scale (`1em` height). Larger steps use **`3xl`**.
|
|
143
|
+
|
|
79
144
|
<sonic-code>
|
|
80
145
|
<template>
|
|
81
|
-
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4
|
|
146
|
+
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-8">
|
|
82
147
|
<div class="text-center">
|
|
83
148
|
<sonic-icon library="heroicons" prefix="outline" name="academic-cap" size="2xs"></sonic-icon>
|
|
84
|
-
<br
|
|
149
|
+
<br />
|
|
85
150
|
<div class="text-xs mt-1">2xs</div>
|
|
86
151
|
</div>
|
|
87
152
|
<div class="text-center">
|
|
88
153
|
<sonic-icon library="heroicons" prefix="outline" name="academic-cap" size="xs"></sonic-icon>
|
|
89
|
-
<br
|
|
154
|
+
<br />
|
|
90
155
|
<div class="text-xs mt-1">xs</div>
|
|
91
156
|
</div>
|
|
92
157
|
<div class="text-center">
|
|
93
158
|
<sonic-icon library="heroicons" prefix="outline" name="academic-cap" size="sm"></sonic-icon>
|
|
94
|
-
<br
|
|
159
|
+
<br />
|
|
95
160
|
<div class="text-xs mt-1">sm</div>
|
|
96
161
|
</div>
|
|
97
162
|
<div class="text-center">
|
|
98
163
|
<sonic-icon library="heroicons" prefix="outline" name="academic-cap"></sonic-icon>
|
|
99
|
-
<br
|
|
164
|
+
<br />
|
|
100
165
|
<div class="text-xs mt-1">default</div>
|
|
101
166
|
</div>
|
|
102
167
|
<div class="text-center">
|
|
103
168
|
<sonic-icon library="heroicons" prefix="outline" name="academic-cap" size="lg"></sonic-icon>
|
|
104
|
-
<br
|
|
169
|
+
<br />
|
|
105
170
|
<div class="text-xs mt-1">lg</div>
|
|
106
171
|
</div>
|
|
107
172
|
<div class="text-center">
|
|
108
173
|
<sonic-icon library="heroicons" prefix="outline" name="academic-cap" size="xl"></sonic-icon>
|
|
109
|
-
<br
|
|
174
|
+
<br />
|
|
110
175
|
<div class="text-xs mt-1">xl</div>
|
|
111
176
|
</div>
|
|
112
177
|
<div class="text-center">
|
|
113
178
|
<sonic-icon library="heroicons" prefix="outline" name="academic-cap" size="2xl"></sonic-icon>
|
|
114
|
-
<br
|
|
179
|
+
<br />
|
|
115
180
|
<div class="text-xs mt-1">2xl</div>
|
|
116
181
|
</div>
|
|
117
182
|
<div class="text-center">
|
|
118
183
|
<sonic-icon library="heroicons" prefix="outline" name="academic-cap" size="3xl"></sonic-icon>
|
|
119
|
-
<br
|
|
184
|
+
<br />
|
|
120
185
|
<div class="text-xs mt-1">3xl</div>
|
|
121
186
|
</div>
|
|
122
187
|
</div>
|
|
123
188
|
</template>
|
|
124
189
|
</sonic-code>
|
|
125
190
|
|
|
191
|
+
## Accessibility
|
|
192
|
+
|
|
193
|
+
On connect, the host sets **`aria-hidden="true"`**. Treat icons as decorative unless the surrounding control already has an accessible name. Do not rely on **`sonic-icon`** alone for meaning—use visible text or **`aria-label`** on the parent button / link.
|
|
194
|
+
|
|
195
|
+
<sonic-code>
|
|
196
|
+
<template>
|
|
197
|
+
<sonic-button type="neutral" variant="outline" shape="circle" aria-label="User profile">
|
|
198
|
+
<sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
199
|
+
</sonic-button>
|
|
200
|
+
</template>
|
|
201
|
+
</sonic-code>
|
|
202
|
+
|
|
203
|
+
## API reference
|
|
204
|
+
|
|
205
|
+
| Attribute | Values | Description |
|
|
206
|
+
|----------|---------|-------------|
|
|
207
|
+
| `name` | string | Icon id in the core bundle or in the remote library |
|
|
208
|
+
| `library` | `heroicons` · `iconoir` · `feathers` · `lucide` · `material` · `fontAwesome` · `custom` | CDN or custom template; omit for bundled core icons |
|
|
209
|
+
| `prefix` | string | Library-specific variant; defaults per library when empty |
|
|
210
|
+
| `size` | `2xs` · `xs` · `sm` · `lg` · `xl` · `2xl` · `3xl` (default `md`) | `em`-based SVG scale on the host |
|
|
211
|
+
|
|
212
|
+
Ancestor attributes (for **`library="custom"`** only): **`customIconLibraryPath`** (URL template with **`$prefix`** and **`$name`**) and **`customIconDefaultPrefix`**. May be set on **`sonic-scope`**, theme roots, or globally in the document.
|
|
213
|
+
|
|
214
|
+
No slots — the component inlines fetched or bundled SVG markup.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Image
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**`sonic-image`** wraps a responsive **`<img>`** with aspect ratio, `object-fit: cover`, optional rounded corners, and load transitions. The host shows a placeholder background (`--sc-placeholder-bg`) until the asset loads. Default **`loading`** is `lazy`; use **`loading="eager"`** for above-the-fold heroes.
|
|
4
4
|
|
|
5
5
|
## Rounded
|
|
6
6
|
|
|
@@ -149,7 +149,7 @@ Click **Add image** to append small thumbnails and replay the transition. **Clea
|
|
|
149
149
|
img.ratio = '1/1';
|
|
150
150
|
img.rounded = 'md';
|
|
151
151
|
img.loading = 'eager';
|
|
152
|
-
img.style.width = '
|
|
152
|
+
img.style.width = '8rem';
|
|
153
153
|
img.src = 'https://picsum.photos/seed/' + Date.now() + '/120/120';
|
|
154
154
|
host.appendChild(img);
|
|
155
155
|
})()"
|
|
@@ -166,7 +166,7 @@ Click **Add image** to append small thumbnails and replay the transition. **Clea
|
|
|
166
166
|
img.ratio = '1/1';
|
|
167
167
|
img.rounded = 'md';
|
|
168
168
|
img.loading = 'eager';
|
|
169
|
-
img.style.width = '
|
|
169
|
+
img.style.width = '8rem';
|
|
170
170
|
img.src = 'https://picsum.photos/seed/' + Date.now() + '/120/120';
|
|
171
171
|
host.appendChild(img);
|
|
172
172
|
})()"
|
|
@@ -199,3 +199,35 @@ Always set meaningful **`alt`** text (empty string only for decorative images).
|
|
|
199
199
|
></sonic-image>
|
|
200
200
|
</template>
|
|
201
201
|
</sonic-code>
|
|
202
|
+
|
|
203
|
+
## API reference
|
|
204
|
+
|
|
205
|
+
| Attribute | Values | Description |
|
|
206
|
+
|----------|---------|-------------|
|
|
207
|
+
| `src` | URL | Image URL passed to `<img src>` |
|
|
208
|
+
| `alt` | string | Accessible description; use `""` only for decorative images |
|
|
209
|
+
| `loading` | `lazy` (default), `eager` | Native lazy loading |
|
|
210
|
+
| `ratio` | CSS ratio, `auto` (default) | Host `aspect-ratio` on the image (ignored when `cover` is set) |
|
|
211
|
+
| `rounded` | `none` (default), boolean, `base`, `sm`, `md`, `lg`, `xl`, `full` | Corner radius from theme tokens; `full` is a circle (often with `ratio="1/1"`) |
|
|
212
|
+
| `objectPosition` | CSS position | Maps to `object-position` (default `center center`) |
|
|
213
|
+
| `imageRendering` | CSS value | Maps to `image-rendering` (default `auto`) |
|
|
214
|
+
| `cover` | boolean | Absolutely fills a positioned parent; host aspect ratio is ignored |
|
|
215
|
+
| `transition` | `fade`, `fade-scale-out` | Opacity (and scale) animation after `load`; remount to replay on `src` change |
|
|
216
|
+
|
|
217
|
+
No slots — content is driven entirely by attributes on the inner `<img>`.
|
|
218
|
+
|
|
219
|
+
## API reference
|
|
220
|
+
|
|
221
|
+
| Attribute | Values | Description |
|
|
222
|
+
|----------|---------|-------------|
|
|
223
|
+
| `src` | URL | Image URL passed to `<img src>` |
|
|
224
|
+
| `alt` | string | Accessible description; use `""` only for decorative images |
|
|
225
|
+
| `loading` | `lazy` (default), `eager` | Native lazy loading |
|
|
226
|
+
| `ratio` | CSS ratio, `auto` (default) | Host `aspect-ratio` on the image (ignored when `cover` is set) |
|
|
227
|
+
| `rounded` | `none` (default), boolean, `base`, `sm`, `md`, `lg`, `xl`, `full` | Corner radius from theme tokens; `full` is a circle (often with `ratio="1/1"`) |
|
|
228
|
+
| `objectPosition` | CSS position | Maps to `object-position` (default `center center`) |
|
|
229
|
+
| `imageRendering` | CSS value | Maps to `image-rendering` (default `auto`) |
|
|
230
|
+
| `cover` | boolean | Absolutely fills a positioned parent; host aspect ratio is ignored |
|
|
231
|
+
| `transition` | `fade`, `fade-scale-out` | Opacity (and scale) animation after `load`; remount to replay on `src` change |
|
|
232
|
+
|
|
233
|
+
No slots — content is driven entirely by attributes on the inner `<img>`.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Link
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Links **navigate** with inherited typography: internal routes, anchors, or external URLs. The default slot is the anchor label. For in-app routing, pair **`href`** with **`pushstate`**; use **`autoActive`** to reflect the current URL on the host (`active`).
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
4
7
|
<sonic-code>
|
|
5
8
|
<template>
|
|
6
9
|
<sonic-link href="/">Basic link with href attribute</sonic-link>
|
|
@@ -8,27 +11,45 @@
|
|
|
8
11
|
</sonic-code>
|
|
9
12
|
|
|
10
13
|
## Target
|
|
14
|
+
|
|
15
|
+
**`target="_blank"`** opens a new browsing context and sets **`rel="noopener noreferrer"`**.
|
|
16
|
+
|
|
11
17
|
<sonic-code>
|
|
12
18
|
<template>
|
|
13
19
|
<sonic-link href="/" target="_blank">Link with target attribute</sonic-link>
|
|
14
20
|
</template>
|
|
15
21
|
</sonic-code>
|
|
16
22
|
|
|
23
|
+
## Pushstate
|
|
24
|
+
|
|
25
|
+
Set **`pushstate`** on same-origin **`href`** values to intercept clicks and navigate through Concorde’s client router without a full reload.
|
|
26
|
+
|
|
27
|
+
<sonic-code>
|
|
28
|
+
<template>
|
|
29
|
+
<sonic-link href="/#core/components" pushstate>Client navigation (pushstate)</sonic-link>
|
|
30
|
+
</template>
|
|
31
|
+
</sonic-code>
|
|
32
|
+
|
|
17
33
|
## AutoActive
|
|
18
34
|
|
|
35
|
+
Default **`autoActive`** is **`partial`**: the host gets **`active`** when the current URL starts with **`href`**. Style with **`[&[active]]:`** utilities or host selectors.
|
|
36
|
+
|
|
19
37
|
<sonic-code>
|
|
20
38
|
<template>
|
|
21
|
-
<sonic-link href="/#core/components"
|
|
39
|
+
<sonic-link href="/#core/components" class="[&[active]]:text-success">autoActive partial (default)</sonic-link>
|
|
22
40
|
</template>
|
|
23
41
|
</sonic-code>
|
|
24
42
|
|
|
25
|
-
### AutoActive
|
|
43
|
+
### AutoActive strict vs partial
|
|
44
|
+
|
|
45
|
+
**`strict`** requires pathname, search, and hash to match. **`strict-path-only`** matches pathname and hash but ignores search.
|
|
26
46
|
|
|
27
47
|
<sonic-code>
|
|
28
48
|
<template>
|
|
29
49
|
<div class="grid gap-3">
|
|
30
50
|
<sonic-link href="/#core" autoActive="strict" class="[&[active]]:text-success">autoActive strict</sonic-link>
|
|
31
|
-
<sonic-link href="/#core/components/ui/link/link.md/link" autoActive="strict" class="[&[active]]:text-success">autoActive strict</sonic-link>
|
|
51
|
+
<sonic-link href="/#core/components/ui/link/link.md/link" autoActive="strict" class="[&[active]]:text-success">autoActive strict (long href)</sonic-link>
|
|
52
|
+
<sonic-link href="/#core/components" autoActive="strict-path-only" class="[&[active]]:text-success">autoActive strict-path-only</sonic-link>
|
|
32
53
|
</div>
|
|
33
54
|
</template>
|
|
34
55
|
</sonic-code>
|
|
@@ -37,7 +58,24 @@
|
|
|
37
58
|
|
|
38
59
|
<sonic-code>
|
|
39
60
|
<template>
|
|
40
|
-
|
|
61
|
+
<sonic-link href="/#core/components/ui/link/link.md/link" autoActive="disabled" class="[&[active]]:text-success">autoActive disabled</sonic-link>
|
|
41
62
|
</template>
|
|
42
63
|
</sonic-code>
|
|
43
64
|
|
|
65
|
+
## Accessibility
|
|
66
|
+
|
|
67
|
+
The inner **`<a>`** uses **`focus-visible`** outline styling. Set **`data-aria-label`** when the slot text is not sufficient on its own.
|
|
68
|
+
|
|
69
|
+
## API reference
|
|
70
|
+
|
|
71
|
+
| Attribute | Values | Description |
|
|
72
|
+
|----------|---------|-------------|
|
|
73
|
+
| `href` | URL | Link target; without **`href`**, only the slot is rendered (no **`<a>`**) |
|
|
74
|
+
| `target` | e.g. `_blank` | Navigation target; **`_blank`** adds **`rel="noopener noreferrer"`** |
|
|
75
|
+
| `pushstate` | boolean | Intercepts click for Concorde client navigation without reload |
|
|
76
|
+
| `autoActive` | `partial` (default) · `strict` · `strict-path-only` · `disabled` | When the host gets the **`active`** attribute (same-origin **`href`** only) |
|
|
77
|
+
| `data-aria-label` | string | Accessible **`aria-label`** when the slot text is not enough |
|
|
78
|
+
|
|
79
|
+
| Slot | Description |
|
|
80
|
+
|------|-------------|
|
|
81
|
+
| *(default)* | Link content (text, icons) |
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
# Loader
|
|
1
|
+
# Loader
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**`sonic-loader`** shows a loading animation in the page or as a viewport overlay. Default **`mode`** is **`fixed`** (centered overlay). Use **`inline`** inside lists and fetch placeholders. Pair **`noDelay`** when the spinner should appear without the default fade-in wait. For **`sonic-fetch`** / **`sonic-list`**, set the parent **`loader`** attribute instead of embedding a tag manually.
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
7
|
+
Inline loaders fit content areas; they use the theme primary color unless **`currentColor`** is set.
|
|
4
8
|
|
|
5
9
|
<sonic-code>
|
|
6
10
|
<template>
|
|
@@ -8,48 +12,101 @@
|
|
|
8
12
|
</template>
|
|
9
13
|
</sonic-code>
|
|
10
14
|
|
|
11
|
-
##
|
|
15
|
+
## Mode
|
|
16
|
+
|
|
17
|
+
**`inline`** — ellipsis animation in the document flow. **`fixed`** — centered overlay (`position: fixed`); default when the tag is omitted.
|
|
12
18
|
|
|
13
19
|
<sonic-code>
|
|
14
20
|
<template>
|
|
15
|
-
<sonic-loader mode="inline"
|
|
21
|
+
<sonic-loader mode="inline"></sonic-loader>
|
|
16
22
|
</template>
|
|
17
23
|
</sonic-code>
|
|
18
24
|
|
|
25
|
+
Use the checkbox below to toggle a **`fixed`** loader over the page (default **`mode`** on **`sonic-loader`**).
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
<docs-lit-demo for="docs-toggle-loader-demo"></docs-lit-demo>
|
|
28
|
+
|
|
29
|
+
## Inline alignment and color
|
|
30
|
+
|
|
31
|
+
**`align`** only affects **`mode="inline"`**: **`left`** · **`center`** (default) · **`right`**. Set **`currentColor`** so dots follow the host `color` (for example on a purple parent).
|
|
21
32
|
|
|
22
33
|
<sonic-code>
|
|
23
34
|
<template>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
<div class="grid gap-4">
|
|
36
|
+
<sonic-loader mode="inline" currentColor style="color: purple;"></sonic-loader>
|
|
37
|
+
<div class="flex flex-col gap-2">
|
|
38
|
+
<sonic-loader mode="inline" align="left"></sonic-loader>
|
|
39
|
+
<sonic-loader mode="inline" align="center"></sonic-loader>
|
|
40
|
+
<sonic-loader mode="inline" align="right"></sonic-loader>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
27
43
|
</template>
|
|
28
44
|
</sonic-code>
|
|
29
45
|
|
|
30
|
-
##
|
|
46
|
+
## `noDelay`
|
|
31
47
|
|
|
32
|
-
|
|
48
|
+
By default **`mode="fixed"`** waits briefly before fading in. **`mode="inline"`** already skips that wait. Set **`noDelay`** on **`fixed`** (or pass **`noDelay: true`** to **`Loader.show()`**) to appear immediately.
|
|
33
49
|
|
|
50
|
+
<sonic-code>
|
|
51
|
+
<template>
|
|
52
|
+
<sonic-loader mode="inline" noDelay></sonic-loader>
|
|
53
|
+
</template>
|
|
54
|
+
</sonic-code>
|
|
55
|
+
|
|
56
|
+
## Accessibility (`announce`)
|
|
57
|
+
|
|
58
|
+
The animation is **`aria-hidden`** by default so screen readers are not spammed on every fetch. Set **`announce`** when the loader is injected **after** user action (for example a global overlay): the host gets **`role="status"`**, **`aria-live="polite"`**, and a localized **`aria-label`** (“Loading” / “Chargement en cours”, …). For in-button loading, prefer **`sonic-button`** **`loading`** and **`aria-busy`** on the control—not on the loader.
|
|
34
59
|
|
|
35
|
-
## Loading button
|
|
36
60
|
<sonic-code>
|
|
37
61
|
<template>
|
|
38
|
-
<sonic-
|
|
62
|
+
<sonic-loader mode="inline" announce></sonic-loader>
|
|
39
63
|
</template>
|
|
40
64
|
</sonic-code>
|
|
41
65
|
|
|
42
|
-
##
|
|
66
|
+
## Show and hide programmatically
|
|
67
|
+
|
|
68
|
+
Import **`Loader`** and call **`Loader.show()`** / **`Loader.hide()`**. **`hide()`** is reference-counted: call it once per **`show()`**. With no **`container`**, the loader is appended to the theme pop container and **`mode`** is always **`fixed`**. Pass **`container`** and **`mode: "inline"`** to mount an inline instance in a specific element.
|
|
43
69
|
|
|
44
70
|
<sonic-code language="javascript">
|
|
45
71
|
<template>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
72
|
+
import { Loader } from "@supersoniks/concorde/core/components/ui/loader/loader";
|
|
73
|
+
|
|
74
|
+
Loader.show({
|
|
75
|
+
mode: "fixed",
|
|
76
|
+
noDelay: false,
|
|
77
|
+
announce: true,
|
|
78
|
+
container: document.querySelector("#foo"),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
Loader.hide();
|
|
54
82
|
</template>
|
|
55
|
-
</sonic-code>
|
|
83
|
+
</sonic-code>
|
|
84
|
+
|
|
85
|
+
## Composition
|
|
86
|
+
|
|
87
|
+
**`sonic-button`** **`loading`** shows an icon spinner and sets **`aria-busy`** on the button. **`sonic-fetch`** and **`sonic-list`** render **`sonic-loader`** when their **`loader`** attribute is set: **`true`** or an empty string maps to **`fixed`**; otherwise use **`inline`** or **`fixed`**.
|
|
88
|
+
|
|
89
|
+
<sonic-code>
|
|
90
|
+
<template>
|
|
91
|
+
<sonic-button loading>Save changes</sonic-button>
|
|
92
|
+
</template>
|
|
93
|
+
</sonic-code>
|
|
94
|
+
|
|
95
|
+
## API reference
|
|
96
|
+
|
|
97
|
+
| Attribute | Values | Description |
|
|
98
|
+
|----------|---------|-------------|
|
|
99
|
+
| `mode` | `inline` · `fixed` (default `fixed`) | Layout: in-flow ellipsis vs viewport-centered overlay |
|
|
100
|
+
| `noDelay` | boolean | Skips the initial fade-in delay before the animation appears |
|
|
101
|
+
| `announce` | boolean | **`role="status"`** and **`aria-live="polite"`** with localized loading label when the loader should be announced |
|
|
102
|
+
| `align` | `left` · `center` · `right` | Horizontal alignment for **`mode="inline"`** only (attribute selector; default centered) |
|
|
103
|
+
| `currentColor` | boolean | Uses `currentColor` for dot fill instead of **`--sc-primary`** |
|
|
104
|
+
|
|
105
|
+
This component has **no slots**. The animation markup is internal.
|
|
106
|
+
|
|
107
|
+
### Static methods
|
|
108
|
+
|
|
109
|
+
| Method | Description |
|
|
110
|
+
|--------|-------------|
|
|
111
|
+
| `Loader.show(conf?)` | Mounts the shared loader instance. **`conf.mode`**, **`conf.noDelay`**, **`conf.announce`**, optional **`conf.container`**. Without **`container`**, uses the theme pop container and forces **`fixed`**. |
|
|
112
|
+
| `Loader.hide()` | Decrements the show counter and removes the instance from the DOM when it reaches zero. |
|