@supersoniks/concorde 5.0.5 → 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/.github/workflows/ci.yml +21 -0
- package/.github-export-ignore +30 -0
- package/.tmp-cem/custom-elements.json +13705 -0
- package/CONTRIBUTING.md +59 -0
- package/DEV.md +54 -0
- package/LICENSE +21 -0
- package/OPEN_SOURCE_CHECKPOINT.md +133 -0
- 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 +196 -196
- package/concorde-core.es.js +3685 -3405
- 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 +196 -196
- package/dist/concorde-core.es.js +3685 -3405
- package/docs/assets/{index-wVZpLVYW.js → index-D8MVWqY6.js} +1351 -1222
- package/docs/assets/index-DiD0qYvE.css +1 -0
- package/docs/crawl/core/components/ui/alert/alert.html +71 -172
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +5 -113
- package/docs/crawl/core/components/ui/badge/badge.html +79 -157
- package/docs/crawl/core/components/ui/button/button.html +0 -1
- package/docs/crawl/core/components/ui/captcha/captcha.html +8 -90
- package/docs/crawl/core/components/ui/card/card.html +68 -222
- package/docs/crawl/core/components/ui/divider/divider.html +31 -117
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +101 -232
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +52 -95
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +38 -97
- package/docs/crawl/core/components/ui/form/input/input.html +3 -3
- package/docs/crawl/core/components/ui/form/textarea/textarea.html +3 -3
- package/docs/crawl/core/components/ui/group/group.html +38 -60
- package/docs/crawl/core/components/ui/icon/icon.html +47 -136
- package/docs/crawl/core/components/ui/image/image.html +56 -244
- package/docs/crawl/core/components/ui/link/link.html +9 -67
- package/docs/crawl/core/components/ui/loader/loader.html +23 -97
- package/docs/crawl/core/components/ui/menu/menu.html +90 -162
- package/docs/crawl/core/components/ui/modal/modal.html +50 -275
- package/docs/crawl/core/components/ui/pop/pop.html +66 -260
- package/docs/crawl/core/components/ui/progress/progress.html +30 -103
- package/docs/crawl/core/components/ui/table/table.html +171 -303
- package/docs/crawl/core/components/ui/toast/toast.html +59 -170
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +29 -90
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +2 -3
- package/docs/crawl/docs/_getting-started/concorde-outside.html +3 -3
- package/docs/crawl/docs/_getting-started/start.html +1 -1
- package/docs/crawl/docs/_getting-started/theming.html +63 -311
- package/docs/crawl/hubs/form-components.html +53 -75
- package/docs/crawl/index.html +6 -7
- package/docs/docs-mock-api-sw.js +0 -2
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +7 -9
- package/docs/llms-full.txt +456 -1703
- package/docs/llms.txt +32 -25
- package/docs/sitemap.xml +0 -3
- package/docs/src/core/components/functional/fetch/fetch.md +0 -0
- package/docs/src/core/components/functional/if/if.md +0 -0
- package/docs/src/core/components/functional/list/list.md +0 -0
- package/docs/src/core/components/functional/router/router.md +0 -0
- package/docs/src/core/components/functional/sdui/sdui.md +0 -0
- package/docs/src/core/components/functional/states/states.md +0 -0
- package/docs/src/core/components/functional/submit/submit.md +0 -0
- package/docs/src/core/components/ui/alert/alert.md +72 -147
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -85
- package/docs/src/core/components/ui/badge/badge.md +80 -141
- package/docs/src/core/components/ui/button/button.md +0 -1
- package/docs/src/core/components/ui/captcha/captcha.md +6 -65
- package/docs/src/core/components/ui/card/card.md +65 -183
- package/docs/src/core/components/ui/divider/divider.md +13 -107
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +99 -175
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +52 -75
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +34 -109
- package/docs/src/core/components/ui/form/input/input.md +1 -1
- package/docs/src/core/components/ui/form/radio/radio.md +0 -0
- package/docs/src/core/components/ui/form/select/select.md +0 -0
- package/docs/src/core/components/ui/form/switch/switch.md +0 -0
- package/docs/src/core/components/ui/form/textarea/textarea.md +1 -1
- package/docs/src/core/components/ui/group/group.md +36 -36
- package/docs/src/core/components/ui/icon/icon.md +43 -132
- package/docs/src/core/components/ui/image/image.md +53 -179
- package/docs/src/core/components/ui/link/link.md +7 -45
- package/docs/src/core/components/ui/loader/loader.md +22 -79
- package/docs/src/core/components/ui/menu/menu.md +92 -133
- package/docs/src/core/components/ui/modal/modal.md +47 -163
- package/docs/src/core/components/ui/pop/pop.md +64 -262
- package/docs/src/core/components/ui/progress/progress.md +30 -76
- package/docs/src/core/components/ui/table/table.md +171 -147
- package/docs/src/core/components/ui/toast/toast.md +58 -108
- package/docs/src/core/components/ui/tooltip/tooltip.md +26 -68
- package/docs/src/docs/_core-concept/subscriber.md +0 -0
- package/docs/src/docs/_decorators/ancestor-attribute.md +2 -3
- package/docs/src/docs/_getting-started/concorde-outside.md +3 -3
- package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -0
- package/docs/src/docs/_getting-started/pubsub.md +0 -0
- package/docs/src/docs/_getting-started/start.md +1 -1
- package/docs/src/docs/_getting-started/theming.md +61 -223
- package/docs/src/docs/search/docs-search.json +348 -3083
- package/docs/src/tsconfig.declarations.json +22 -0
- package/docs/src/tsconfig.emit.json +23 -0
- package/docs/src/tsconfig.json +3 -63
- package/gitlab/job_github_mirror.sh +39 -0
- package/package.json +36 -2
- package/scripts/generate-sdui-catalog.mjs +250 -0
- package/scripts/generate-sdui-catalog.spec.ts +91 -0
- package/scripts/github-export.mjs +150 -0
- package/scripts/post-build-docs.js +0 -0
- package/scripts/post-build.mjs +0 -0
- package/scripts/pre-build.mjs +15 -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/if/if.ts +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/router/router.md +0 -0
- package/src/core/components/functional/router/router.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/states/states.md +0 -0
- package/src/core/components/functional/submit/submit.md +0 -0
- package/src/core/components/functional/subscriber/subscriber.ts +0 -0
- package/src/core/components/functional/value/value.ts +0 -0
- package/src/core/components/ui/_css/size.ts +0 -0
- package/src/core/components/ui/captcha/altchaStyles.ts +0 -0
- 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/mixins/Subscriber.ts +0 -0
- package/src/core/utils/DataBindObserver.ts +0 -0
- package/src/core/utils/Objects.ts +0 -0
- package/src/core/utils/route.ts +0 -0
- package/src/css.d.ts +19 -0
- package/src/docs/_core-concept/subscriber.md +0 -0
- package/src/docs/_getting-started/my-first-subscriber.md +0 -0
- package/src/docs/_getting-started/pubsub.md +0 -0
- package/src/docs/example/users.ts +0 -0
- package/src/docs/search/page.ts +0 -0
- package/src/tsconfig.declarations.json +22 -0
- package/src/tsconfig.emit.json +23 -0
- package/src/tsconfig.json +90 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/docs/assets/index-CD4WyL6o.css +0 -1
- package/docs/crawl/core/components/ui/theme/theme.html +0 -131
- package/docs/src/core/components/ui/theme/theme.md +0 -122
|
@@ -1,188 +1,127 @@
|
|
|
1
1
|
# Badge
|
|
2
2
|
|
|
3
|
-
Badges are **compact, non-interactive** labels for status, counts, or categories. They mirror **`sonic-button`** styling (`type`, `variant`, `size`) without focus rings or click handling—use a button when the control should be actionable.
|
|
4
|
-
|
|
5
3
|
## Type
|
|
6
|
-
|
|
7
|
-
`default` — subtle background (`base-100`). `neutral` — dark fill (`base-content`) with light text, useful on light backgrounds.
|
|
8
|
-
|
|
9
4
|
<sonic-code>
|
|
10
5
|
<template>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</div>
|
|
6
|
+
<sonic-badge>Default</sonic-badge>
|
|
7
|
+
<sonic-badge type="primary">Primary</sonic-badge>
|
|
8
|
+
<sonic-badge type="neutral">Neutral</sonic-badge>
|
|
9
|
+
<sonic-badge type="warning">Warning</sonic-badge>
|
|
10
|
+
<sonic-badge type="info">Info</sonic-badge>
|
|
11
|
+
<sonic-badge type="success">Success</sonic-badge>
|
|
12
|
+
<sonic-badge type="danger">Danger</sonic-badge>
|
|
13
|
+
<sonic-badge type="contrast">Contrast</sonic-badge>
|
|
20
14
|
</template>
|
|
21
15
|
</sonic-code>
|
|
22
16
|
|
|
23
|
-
## Variant
|
|
24
|
-
|
|
25
|
-
Default **`variant`** is filled. **`outline`** — border and text in the `type` color. **`ghost`** — text only, no padding (except in forced-colors mode).
|
|
26
|
-
|
|
27
|
-
### Outline
|
|
28
17
|
|
|
18
|
+
## Outline
|
|
29
19
|
<sonic-code>
|
|
30
20
|
<template>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</
|
|
21
|
+
<div class="flex items-center flex-wrap gap-3">
|
|
22
|
+
<sonic-badge variant="outline">Default</sonic-badge>
|
|
23
|
+
<sonic-badge variant="outline" type="primary">Primary</sonic-badge>
|
|
24
|
+
<sonic-badge variant="outline" type="neutral">Neutral</sonic-badge>
|
|
25
|
+
<sonic-badge variant="outline" type="warning">Warning</sonic-badge>
|
|
26
|
+
<sonic-badge variant="outline" type="info">Info</sonic-badge>
|
|
27
|
+
<sonic-badge variant="outline" type="success">Success</sonic-badge>
|
|
28
|
+
<sonic-badge variant="outline" type="danger">Danger</sonic-badge>
|
|
29
|
+
<sonic-badge variant="outline" type="contrast">Contrast</sonic-badge>
|
|
30
|
+
</div>
|
|
40
31
|
</template>
|
|
41
32
|
</sonic-code>
|
|
42
33
|
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
## Ghost
|
|
45
35
|
<sonic-code>
|
|
46
36
|
<template>
|
|
47
37
|
<div class="flex items-center flex-wrap gap-3">
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</
|
|
38
|
+
<sonic-badge variant="ghost">Default</sonic-badge>
|
|
39
|
+
<sonic-badge variant="ghost" type="primary">Primary</sonic-badge>
|
|
40
|
+
<sonic-badge variant="ghost" type="neutral">Neutral</sonic-badge>
|
|
41
|
+
<sonic-badge variant="ghost" type="warning">Warning</sonic-badge>
|
|
42
|
+
<sonic-badge variant="ghost" type="info">Info</sonic-badge>
|
|
43
|
+
<sonic-badge variant="ghost" type="success">Success</sonic-badge>
|
|
44
|
+
<sonic-badge variant="ghost" type="danger">Danger</sonic-badge>
|
|
45
|
+
<sonic-badge variant="ghost" type="contrast">Contrast</sonic-badge>
|
|
46
|
+
</div>
|
|
56
47
|
</template>
|
|
57
48
|
</sonic-code>
|
|
58
49
|
|
|
59
50
|
## Size
|
|
60
|
-
|
|
61
|
-
Default size is `md` (omit the `size` attribute). Typography and padding follow `sonic-button`.
|
|
62
|
-
|
|
63
51
|
<sonic-code>
|
|
64
52
|
<template>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<sonic-badge size="2xl">2Xl</sonic-badge>
|
|
73
|
-
</div>
|
|
53
|
+
<sonic-badge size="2xs">2Xs badge</sonic-badge>
|
|
54
|
+
<sonic-badge size="xs">Xs badge</sonic-badge>
|
|
55
|
+
<sonic-badge size="sm">Sm badge</sonic-badge>
|
|
56
|
+
<sonic-badge>Md badge</sonic-badge>
|
|
57
|
+
<sonic-badge size="lg">Lg badge</sonic-badge>
|
|
58
|
+
<sonic-badge size="xl">Xl badge</sonic-badge>
|
|
59
|
+
<sonic-badge size="2xl">2Xl badge</sonic-badge>
|
|
74
60
|
</template>
|
|
75
61
|
</sonic-code>
|
|
76
62
|
|
|
77
|
-
## Prefix and suffix slots
|
|
78
|
-
|
|
79
|
-
Icons or short text before / after the main label.
|
|
80
|
-
|
|
81
|
-
<sonic-code>
|
|
82
|
-
<template>
|
|
83
|
-
<sonic-badge type="info" size="sm">
|
|
84
|
-
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon>
|
|
85
|
-
Info
|
|
86
|
-
</sonic-badge>
|
|
87
|
-
<sonic-badge type="success">
|
|
88
|
-
Verified
|
|
89
|
-
<sonic-icon slot="suffix" name="check" library="iconoir"></sonic-icon>
|
|
90
|
-
</sonic-badge>
|
|
91
|
-
</template>
|
|
92
|
-
</sonic-code>
|
|
93
63
|
|
|
94
64
|
## Empty badges
|
|
95
|
-
|
|
96
|
-
Badge with no text (visual dot). `min-width` / `min-height` keep a readable shape.
|
|
97
|
-
|
|
98
65
|
<sonic-code>
|
|
99
66
|
<template>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
67
|
+
<div class="flex items-center flex-wrap gap-3">
|
|
68
|
+
<sonic-badge type="danger" size="2xs"></sonic-badge>
|
|
69
|
+
<sonic-badge type="danger" size="xs"></sonic-badge>
|
|
70
|
+
<sonic-badge type="danger" size="sm"></sonic-badge>
|
|
71
|
+
<sonic-badge type="danger"></sonic-badge>
|
|
72
|
+
<sonic-badge type="danger" size="lg"></sonic-badge>
|
|
73
|
+
<sonic-badge type="danger" size="xl"></sonic-badge>
|
|
74
|
+
<sonic-badge type="danger" size="2xl"></sonic-badge>
|
|
75
|
+
</div>
|
|
109
76
|
</template>
|
|
110
77
|
</sonic-code>
|
|
111
78
|
|
|
112
|
-
## Ellipsis
|
|
113
|
-
|
|
114
|
-
With `ellipsis`, long labels truncate. The parent must constrain width (`max-width`, grid, etc.).
|
|
115
79
|
|
|
80
|
+
## Ellipsis
|
|
116
81
|
<sonic-code>
|
|
117
82
|
<template>
|
|
118
|
-
<div class="grid grid-cols-
|
|
119
|
-
|
|
120
|
-
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon>
|
|
121
|
-
Lorem ipsum dolor sit
|
|
122
|
-
</sonic-badge>
|
|
123
|
-
<sonic-badge ellipsis size="sm">
|
|
124
|
-
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon>
|
|
125
|
-
Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod.
|
|
126
|
-
</sonic-badge>
|
|
83
|
+
<div class="grid grid-cols-3 gap-4" >
|
|
84
|
+
<sonic-badge ellipsis size="sm" variant="outline" >
|
|
85
|
+
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon> Lorem ipsum dolor sit consectetur adipiscing elit. Lorem ipsum dolor sit consectetur adipiscing elit.</sonic-badge>
|
|
86
|
+
<sonic-badge ellipsis size="sm" > <sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon> Lorem ipsum dolor sit consectetur adipiscing elit. Lorem ipsum dolor sit consectetur adipiscing elit.</sonic-badge>
|
|
127
87
|
</div>
|
|
128
88
|
</template>
|
|
129
89
|
</sonic-code>
|
|
130
90
|
|
|
131
91
|
## Badge in button
|
|
132
|
-
|
|
133
|
-
Count inside a button (`slot="suffix"`) or a badge absolutely positioned on a button / icon.
|
|
134
|
-
|
|
135
92
|
<sonic-code>
|
|
136
93
|
<template>
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
94
|
+
<div class="flex flex-wrap gap-4 items-center">
|
|
95
|
+
<sonic-button type="default">
|
|
96
|
+
Messages <sonic-badge slot="suffix" type="danger" size="xs">5</sonic-badge>
|
|
97
|
+
</sonic-button>
|
|
98
|
+
<div class="relative inline-block">
|
|
99
|
+
<sonic-button type="success" class="relative"> Mon compte </sonic-button>
|
|
100
|
+
<sonic-badge type="danger" size="xs" class="absolute right-1 top-0 pe-none transform -translate-y-1/2"
|
|
101
|
+
>12</sonic-badge
|
|
102
|
+
>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="relative inline-block">
|
|
105
|
+
<sonic-button type="neutral" shape="circle" variant="outline"
|
|
106
|
+
><sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
107
|
+
</sonic-button>
|
|
108
|
+
<sonic-badge
|
|
109
|
+
type="danger"
|
|
110
|
+
size="xs"
|
|
111
|
+
class="absolute right-1 bottom-1 pe-none transform translate-y-1/2 translate-x-1/2"
|
|
112
|
+
>33</sonic-badge
|
|
113
|
+
>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="relative inline-block">
|
|
116
|
+
<sonic-button type="neutral" shape="circle" variant="outline"
|
|
117
|
+
><sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
140
118
|
</sonic-button>
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
class="absolute right-1 top-0 pe-none transform -translate-y-1/2"
|
|
147
|
-
>12</sonic-badge
|
|
148
|
-
>
|
|
149
|
-
</div>
|
|
150
|
-
<div class="relative inline-block">
|
|
151
|
-
<sonic-button type="neutral" shape="circle" variant="outline">
|
|
152
|
-
<sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
153
|
-
</sonic-button>
|
|
154
|
-
<sonic-badge
|
|
155
|
-
type="danger"
|
|
156
|
-
size="xs"
|
|
157
|
-
class="absolute right-1 bottom-1 pe-none transform translate-y-1/2 translate-x-1/2"
|
|
158
|
-
>33</sonic-badge
|
|
159
|
-
>
|
|
160
|
-
</div>
|
|
161
|
-
<div class="relative inline-block">
|
|
162
|
-
<sonic-button type="neutral" shape="circle" variant="outline">
|
|
163
|
-
<sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
164
|
-
</sonic-button>
|
|
165
|
-
<sonic-badge
|
|
166
|
-
type="danger"
|
|
167
|
-
size="xs"
|
|
168
|
-
class="absolute right-2 bottom-2 pe-none transform translate-y-1/2 translate-x-1/2"
|
|
169
|
-
></sonic-badge>
|
|
170
|
-
</div>
|
|
119
|
+
<sonic-badge
|
|
120
|
+
type="danger"
|
|
121
|
+
size="xs"
|
|
122
|
+
class="absolute right-2 bottom-2 pe-none transform translate-y-1/2 translate-x-1/2"
|
|
123
|
+
></sonic-badge>
|
|
171
124
|
</div>
|
|
125
|
+
</div>
|
|
172
126
|
</template>
|
|
173
127
|
</sonic-code>
|
|
174
|
-
|
|
175
|
-
## API reference
|
|
176
|
-
|
|
177
|
-
| Attribute | Values | Description |
|
|
178
|
-
|----------|---------|-------------|
|
|
179
|
-
| `type` | `default` (default) · `primary` · `neutral` · `warning` · `info` · `success` · `danger` | Semantic color (`--sc-*` tokens) |
|
|
180
|
-
| `variant` | `default` (default) · `outline` · `ghost` | Filled, bordered, or text-only |
|
|
181
|
-
| `size` | `2xs` … `2xl` (default `md`) | Typography and padding (aligned with **`sonic-button`**) |
|
|
182
|
-
| `ellipsis` | boolean | Single-line truncation; parent must constrain width |
|
|
183
|
-
|
|
184
|
-
| Slot | Description |
|
|
185
|
-
|------|-------------|
|
|
186
|
-
| *(default)* | Main label |
|
|
187
|
-
| `prefix` | Icon or short text before the label |
|
|
188
|
-
| `suffix` | Icon or short text after the label |
|
|
@@ -71,7 +71,6 @@ The length of the button depends on the size of its content
|
|
|
71
71
|
<template>
|
|
72
72
|
<sonic-button loading></sonic-button>
|
|
73
73
|
<sonic-button loading>Loading button</sonic-button>
|
|
74
|
-
<sonic-button loading><span slot="prefix">🚀</span>Loading with prefix<span slot="suffix">😂</span></sonic-button>
|
|
75
74
|
</template>
|
|
76
75
|
</sonic-code>
|
|
77
76
|
|
|
@@ -1,71 +1,12 @@
|
|
|
1
1
|
# Captcha
|
|
2
2
|
|
|
3
|
-
**`sonic-captcha`** embeds an **ALTCHA** widget and wires **`captchaToken`** / **`needsCaptchaValidation`** on the ancestor **`formDataProvider`** (or **`headersDataProvider`**). **`sonic-submit`** waits for a token before sending when validation is required. The widget loads only on **HTTPS**; on plain HTTP the host renders nothing.
|
|
4
|
-
|
|
5
|
-
> Live widget calls the Supersoniks challenge service — not part of [docs mock API](#docs/_misc/docs-mock-api.md/docs-mock-api).
|
|
6
|
-
|
|
7
|
-
## Basic example
|
|
8
|
-
|
|
9
|
-
Wrap the form scope and place **`sonic-submit`** in the default slot so the challenge appears above the action.
|
|
10
|
-
|
|
11
|
-
<sonic-code>
|
|
12
|
-
<template>
|
|
13
|
-
<sonic-scope
|
|
14
|
-
serviceURL="/docs-mock-api"
|
|
15
|
-
formDataProvider="captcha-docs-form"
|
|
16
|
-
submitResultDataProvider="captcha-docs-result"
|
|
17
|
-
>
|
|
18
|
-
<sonic-captcha formDataProvider="captcha-docs-form">
|
|
19
|
-
<sonic-input class="mb-3" name="email" type="email" label="Email" value="demo@example.com"></sonic-input>
|
|
20
|
-
<sonic-submit endPoint="api/register" onClick>
|
|
21
|
-
<sonic-button type="primary">Submit with captcha</sonic-button>
|
|
22
|
-
</sonic-submit>
|
|
23
|
-
</sonic-captcha>
|
|
24
|
-
</sonic-scope>
|
|
25
|
-
</template>
|
|
26
|
-
</sonic-code>
|
|
27
|
-
|
|
28
|
-
## Encrypted site key
|
|
29
|
-
|
|
30
|
-
Optional **`key`** skips client-side key generation. When omitted, the component derives an encrypted key on connect (after **`generateEncryptedKey`**).
|
|
31
|
-
|
|
32
3
|
<sonic-code>
|
|
33
4
|
<template>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
5
|
+
<sonic-captcha formDataProvider="captchaTestDataProvider" key="6Leq5V0iAAAAAB-41DlWN335jDlcIuXmhNtdd00t">
|
|
6
|
+
<sonic-submit serviceURL="/docs-mock-api" endPoint="api/unknown" onclick>
|
|
7
|
+
<sonic-button class="mt-4">Submit with captcha</sonic-button>
|
|
8
|
+
</sonic-submit>
|
|
9
|
+
</sonic-captcha>
|
|
37
10
|
</template>
|
|
38
11
|
</sonic-code>
|
|
39
|
-
|
|
40
|
-
## Form publisher fields
|
|
41
|
-
|
|
42
|
-
On connect (HTTPS only), **`needsCaptchaValidation`** is set to **`true`** and **`captchaToken`** is cleared. When the ALTCHA widget reaches **`verified`**, **`captchaToken`** is written on the form publisher and **`sonic-captcha-validate`** fires (`detail.valid` · **`detail.state`** · optional **`detail.token`** / **`detail.payload`**). **`sonic-submit`** still listens for **`request_token`** to refresh the token immediately before send.
|
|
43
|
-
|
|
44
|
-
<sonic-code language="typescript">
|
|
45
|
-
<template>
|
|
46
|
-
{
|
|
47
|
-
needsCaptchaValidation: true,
|
|
48
|
-
captchaKey: "…",
|
|
49
|
-
captchaToken: "…"
|
|
50
|
-
}
|
|
51
|
-
</template>
|
|
52
|
-
</sonic-code>
|
|
53
|
-
|
|
54
|
-
## API reference
|
|
55
|
-
|
|
56
|
-
| Attribute | Values | Description |
|
|
57
|
-
|----------|---------|-------------|
|
|
58
|
-
| `formDataProvider` | publisher id | Same as ancestor form scope; reads/writes **`needsCaptchaValidation`** · **`captchaKey`** · **`captchaToken`** |
|
|
59
|
-
| `key` | string | ALTCHA site key; auto-generated when empty |
|
|
60
|
-
| `action` | string | Optional action name forwarded to the widget |
|
|
61
|
-
| `zIndex` | number (default `9999`) | Stacking for the challenge overlay |
|
|
62
|
-
|
|
63
|
-
| Slot | Description |
|
|
64
|
-
|------|-------------|
|
|
65
|
-
| *(default)* | Form actions (typically **`sonic-submit`** and fields) rendered below the widget |
|
|
66
|
-
|
|
67
|
-
| Event | Description |
|
|
68
|
-
|-------|-------------|
|
|
69
|
-
| `sonic-captcha-validate` | Fired when **`state`** is **`verified`** · **`error`** or **`expired`**; **`detail.valid`** is **`true`** only for **`verified`** |
|
|
70
|
-
|
|
71
|
-
Related: [Submit](#core/components/functional/submit/submit.md/submit) — **`needsCaptchaValidation`** and deferred send.
|
|
12
|
+
|
|
@@ -1,215 +1,97 @@
|
|
|
1
1
|
# Card
|
|
2
2
|
|
|
3
|
-
Cards **group related content** on a padded surface with radius, theme **`type`** colors, and elevation. Default **`shadow`** is `lg`. Compose **`sonic-card-header`** / **`sonic-card-main`** / **`sonic-card-footer`**, or place any markup in the default slot.
|
|
4
|
-
|
|
5
|
-
## Basic example
|
|
6
|
-
|
|
7
|
-
<sonic-code>
|
|
8
|
-
<template>
|
|
9
|
-
<sonic-card class="max-w-sm">
|
|
10
|
-
<p class="m-0">Related content on a raised surface.</p>
|
|
11
|
-
</sonic-card>
|
|
12
|
-
</template>
|
|
13
|
-
</sonic-code>
|
|
14
|
-
|
|
15
3
|
## Type
|
|
16
|
-
|
|
17
|
-
Default **`type`** is `base`. **`default`** and **`light`** share the same surface tokens.
|
|
18
|
-
|
|
19
|
-
<sonic-code>
|
|
20
|
-
<template>
|
|
21
|
-
<div class="flex flex-wrap gap-3">
|
|
22
|
-
<sonic-card type="base" class="min-w-[8rem]">Base</sonic-card>
|
|
23
|
-
<sonic-card type="light" class="min-w-[8rem]">Light</sonic-card>
|
|
24
|
-
<sonic-card type="default" class="min-w-[8rem]">Default</sonic-card>
|
|
25
|
-
<sonic-card type="primary" class="min-w-[8rem]">Primary</sonic-card>
|
|
26
|
-
<sonic-card type="info" class="min-w-[8rem]">Info</sonic-card>
|
|
27
|
-
<sonic-card type="success" class="min-w-[8rem]">Success</sonic-card>
|
|
28
|
-
<sonic-card type="warning" class="min-w-[8rem]">Warning</sonic-card>
|
|
29
|
-
<sonic-card type="danger" class="min-w-[8rem]">Danger</sonic-card>
|
|
30
|
-
<sonic-card type="neutral" class="min-w-[8rem]">Neutral</sonic-card>
|
|
31
|
-
<sonic-card type="invert" class="min-w-[8rem]">Invert</sonic-card>
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
</sonic-code>
|
|
35
|
-
|
|
36
|
-
## Shadow
|
|
37
|
-
|
|
38
|
-
Set **`shadow`** to control elevation. Default is `lg`.
|
|
39
|
-
|
|
40
4
|
<sonic-code>
|
|
41
5
|
<template>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</
|
|
6
|
+
<div class="grid grid-cols-3 gap-3">
|
|
7
|
+
<sonic-card type="base">Base</sonic-card>
|
|
8
|
+
<sonic-card type="light">Light</sonic-card>
|
|
9
|
+
<sonic-card type="primary">Primary</sonic-card>
|
|
10
|
+
<sonic-card type="warning">Warning</sonic-card>
|
|
11
|
+
<sonic-card type="danger">Danger</sonic-card>
|
|
12
|
+
<sonic-card type="success">Success</sonic-card>
|
|
13
|
+
<sonic-card type="info">Info</sonic-card>
|
|
14
|
+
<sonic-card type="neutral">Neutral</sonic-card>
|
|
15
|
+
<sonic-card type="invert">Invert</sonic-card>
|
|
16
|
+
</div>
|
|
48
17
|
</template>
|
|
49
18
|
</sonic-code>
|
|
50
19
|
|
|
51
20
|
## Header
|
|
52
|
-
|
|
53
|
-
Quick titles with **`label`** and **`description`**, or full control through the default slot. **`slot="suffix"`** aligns badges or actions on the right; suffix content does not shrink when the title wraps.
|
|
54
|
-
|
|
55
|
-
`label` and `description` accept HTML (rendered as markup). Prefer plain text when possible; use **`sonic-card-header-description`** or the default slot for structured content.
|
|
56
|
-
|
|
57
21
|
<sonic-code>
|
|
58
22
|
<template>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
</
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
slot="suffix"
|
|
81
|
-
shape="circle"
|
|
82
|
-
variant="outline"
|
|
83
|
-
size="sm"
|
|
84
|
-
type="default"
|
|
85
|
-
icon
|
|
86
|
-
data-aria-label="Workspace settings"
|
|
87
|
-
>
|
|
88
|
-
<sonic-icon library="iconoir" name="settings"></sonic-icon>
|
|
89
|
-
</sonic-button>
|
|
90
|
-
</sonic-card-header>
|
|
91
|
-
</sonic-card>
|
|
92
|
-
|
|
93
|
-
<sonic-card type="primary">
|
|
94
|
-
<sonic-card-header>
|
|
95
|
-
<div>Custom header</div>
|
|
96
|
-
<sonic-card-header-description>
|
|
97
|
-
Use the header slot when attributes are not enough.
|
|
98
|
-
</sonic-card-header-description>
|
|
99
|
-
<sonic-button slot="suffix" shape="circle" variant="ghost" size="sm" type="primary" icon>
|
|
100
|
-
<sonic-icon library="iconoir" name="nav-arrow-right"></sonic-icon>
|
|
101
|
-
</sonic-button>
|
|
102
|
-
</sonic-card-header>
|
|
103
|
-
</sonic-card>
|
|
104
|
-
</div>
|
|
23
|
+
<div class="grid grid-cols-1 gap-3">
|
|
24
|
+
<sonic-card >
|
|
25
|
+
<sonic-card-header label="Header simple, titre géré via l'attribut : label" description="Description via l'attribut : description">
|
|
26
|
+
</sonic-card-header>
|
|
27
|
+
</sonic-card>
|
|
28
|
+
<sonic-card type="neutral">
|
|
29
|
+
<sonic-card-header label="Header composé">
|
|
30
|
+
<sonic-card-header-description>Description rendu via le composant : "sonic-card-header-description"</sonic-card-header-description>
|
|
31
|
+
<div slot="suffix" class="flex">
|
|
32
|
+
Suffix
|
|
33
|
+
</div>
|
|
34
|
+
</sonic-card-header>
|
|
35
|
+
</sonic-card>
|
|
36
|
+
<sonic-card type="invert">
|
|
37
|
+
<sonic-card-header>
|
|
38
|
+
<div>Header custom</div>
|
|
39
|
+
<div class="text-lg text-danger">Tout le contenu excepté l'icône ✈ passe par le slot du header</div>
|
|
40
|
+
<span slot="suffix" >✈</span>
|
|
41
|
+
</sonic-card-header>
|
|
42
|
+
</sonic-card>
|
|
43
|
+
</div>
|
|
105
44
|
</template>
|
|
106
45
|
</sonic-code>
|
|
107
46
|
|
|
108
47
|
## Main
|
|
109
|
-
|
|
110
|
-
Optional wrapper for the primary content area (typography, media, forms).
|
|
111
|
-
|
|
112
48
|
<sonic-code>
|
|
113
49
|
<template>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<p class="mb-0 text-sm opacity-80">See the changelog for details.</p>
|
|
122
|
-
</sonic-card-main>
|
|
123
|
-
</sonic-card>
|
|
50
|
+
<sonic-card >
|
|
51
|
+
<sonic-card-main >
|
|
52
|
+
<h3>Main area</h3>
|
|
53
|
+
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iure id dolor debitis deleniti eligendi natus dolorem a commodi sunt dicta? Ipsa asperiores magni consequuntur dolor voluptatibus. Maxime, nemo? Facere, odio.</p>
|
|
54
|
+
<iframe width="560" height="315" src="https://www.youtube.com/embed/aqz-KE-bpKQ" title="Big Buck Bunny (Blender Foundation)" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
55
|
+
</sonic-card-main>
|
|
56
|
+
</sonic-card>
|
|
124
57
|
</template>
|
|
125
58
|
</sonic-code>
|
|
126
59
|
|
|
127
60
|
## Footer
|
|
128
|
-
|
|
129
|
-
Optional footer for actions, metadata, or secondary text.
|
|
130
|
-
|
|
131
61
|
<sonic-code>
|
|
132
62
|
<template>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
<
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<div class="flex flex-wrap gap-2 justify-end">
|
|
141
|
-
<sonic-button variant="ghost" size="sm">Cancel</sonic-button>
|
|
142
|
-
<sonic-button type="danger" size="sm">Delete</sonic-button>
|
|
63
|
+
<sonic-card >
|
|
64
|
+
<sonic-card-footer >
|
|
65
|
+
<div >
|
|
66
|
+
<h4 class="mb-0">Footer area</h4>
|
|
67
|
+
<small>Debitis deleniti eligendi natus dolorem aufdh.</small>
|
|
68
|
+
<div>
|
|
69
|
+
🛫 ✈ ✈ ✈ ✈ ✈ 🛬
|
|
143
70
|
</div>
|
|
144
|
-
</
|
|
145
|
-
</sonic-card>
|
|
71
|
+
</div>
|
|
72
|
+
</sonic-card-footer>
|
|
73
|
+
</sonic-card>
|
|
146
74
|
</template>
|
|
147
75
|
</sonic-code>
|
|
148
76
|
|
|
149
|
-
## Full example
|
|
150
|
-
|
|
151
|
-
Header, media, body, and footer together.
|
|
152
77
|
|
|
78
|
+
## Example of use
|
|
153
79
|
<sonic-code>
|
|
154
80
|
<template>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<sonic-card-footer>
|
|
171
|
-
<div class="flex items-center justify-between gap-3 flex-wrap">
|
|
172
|
-
<span class="text-sm font-semibold">From $249</span>
|
|
173
|
-
<sonic-button type="primary" size="sm">Book</sonic-button>
|
|
174
|
-
</div>
|
|
175
|
-
</sonic-card-footer>
|
|
176
|
-
</sonic-card>
|
|
81
|
+
<sonic-card >
|
|
82
|
+
<sonic-card-header label="Header" description="Header description">
|
|
83
|
+
<sonic-icon library="iconoir" name="nav-arrow-right" slot="suffix" ></sonic-icon>
|
|
84
|
+
</sonic-card-header>
|
|
85
|
+
<sonic-card-main >
|
|
86
|
+
<sonic-image rounded ratio="11/4" src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg">
|
|
87
|
+
</sonic-image>
|
|
88
|
+
<p><b>Main</b> - Lorem ipsum dolor sit, amet consectetur adipisicing elit. Iure id dolor debitis deleniti eligendi natus dolorem a commodi sunt dicta? Ipsa asperiores magni consequuntur dolor voluptatibus. Maxime, nemo? Facere, odio.</p>
|
|
89
|
+
</sonic-card-main>
|
|
90
|
+
<sonic-card-footer>
|
|
91
|
+
<div>
|
|
92
|
+
<i>Footer</i> - Amet consectetur adipisicing
|
|
93
|
+
</div>
|
|
94
|
+
</sonic-card-footer>
|
|
95
|
+
</sonic-card>
|
|
177
96
|
</template>
|
|
178
97
|
</sonic-code>
|
|
179
|
-
|
|
180
|
-
## API reference
|
|
181
|
-
|
|
182
|
-
### `sonic-card`
|
|
183
|
-
|
|
184
|
-
| Attribute | Values | Description |
|
|
185
|
-
|----------|---------|-------------|
|
|
186
|
-
| `type` | `base` (default) · `light` · `invert` · `default` · `primary` · `warning` · `danger` · `success` · `info` · `neutral` | Semantic background and text (`default` and `light` share the same surface) |
|
|
187
|
-
| `shadow` | `none` · `sm` · `md` · `lg` (default `lg`) | Elevation on the card surface |
|
|
188
|
-
|
|
189
|
-
| Slot | Description |
|
|
190
|
-
|------|-------------|
|
|
191
|
-
| *(default)* | Free-form content (header, main, footer, or direct markup) |
|
|
192
|
-
|
|
193
|
-
### `sonic-card-header`
|
|
194
|
-
|
|
195
|
-
| Attribute | Values | Description |
|
|
196
|
-
|----------|---------|-------------|
|
|
197
|
-
| `label` | HTML | Title (rendered as markup) |
|
|
198
|
-
| `description` | HTML | Subtitle below the title |
|
|
199
|
-
|
|
200
|
-
| Slot | Description |
|
|
201
|
-
|------|-------------|
|
|
202
|
-
| *(default)* | Custom title / description when attributes are not enough |
|
|
203
|
-
| `suffix` | Actions or badges aligned on the right (does not shrink) |
|
|
204
|
-
|
|
205
|
-
### `sonic-card-header-description`
|
|
206
|
-
|
|
207
|
-
| Slot | Description |
|
|
208
|
-
|------|-------------|
|
|
209
|
-
| *(default)* | Subtitle text; styled below the title when slotted in **`sonic-card-header`** |
|
|
210
|
-
|
|
211
|
-
### `sonic-card-main` · `sonic-card-footer`
|
|
212
|
-
|
|
213
|
-
| Slot | Description |
|
|
214
|
-
|------|-------------|
|
|
215
|
-
| *(default)* | Primary content (`main`) or actions / metadata (`footer`) |
|