@supersoniks/concorde 5.0.4 → 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 +528 -534
- package/concorde-core.es.js +4257 -4212
- package/dist/concorde-core.bundle.js +528 -534
- package/dist/concorde-core.es.js +4257 -4212
- 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-D8MVWqY6.js → index-wVZpLVYW.js} +1221 -1350
- package/docs/crawl/core/components/ui/alert/alert.html +172 -71
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +113 -5
- package/docs/crawl/core/components/ui/badge/badge.html +157 -79
- package/docs/crawl/core/components/ui/button/button.html +1 -0
- package/docs/crawl/core/components/ui/captcha/captcha.html +90 -8
- package/docs/crawl/core/components/ui/card/card.html +222 -68
- 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/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 +60 -38
- package/docs/crawl/core/components/ui/icon/icon.html +136 -47
- package/docs/crawl/core/components/ui/image/image.html +244 -56
- package/docs/crawl/core/components/ui/link/link.html +67 -9
- 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 +260 -66
- 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/concorde-outside.html +3 -3
- 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 +75 -53
- 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 +9 -7
- package/docs/llms-full.txt +1703 -456
- package/docs/llms.txt +25 -32
- package/docs/sitemap.xml +3 -0
- 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 +147 -72
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/docs/src/core/components/ui/badge/badge.md +141 -80
- package/docs/src/core/components/ui/button/button.md +1 -0
- package/docs/src/core/components/ui/captcha/captcha.md +65 -6
- package/docs/src/core/components/ui/card/card.md +183 -65
- 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/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 +132 -43
- package/docs/src/core/components/ui/image/image.md +179 -53
- package/docs/src/core/components/ui/link/link.md +45 -7
- 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 +262 -64
- 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/_core-concept/subscriber.md +0 -0
- package/docs/src/docs/_decorators/ancestor-attribute.md +3 -2
- 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 +223 -61
- package/docs/src/docs/search/docs-search.json +3083 -348
- package/docs/src/tsconfig.json +63 -3
- package/gitlab/job_tests.sh +0 -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/scripts/post-build-docs.js +0 -0
- package/scripts/post-build.mjs +0 -0
- package/src/core/components/functional/fetch/fetch.md +0 -0
- package/src/core/components/functional/if/if.md +0 -0
- package/src/core/components/functional/list/list.demo.ts +0 -0
- package/src/core/components/functional/list/list.md +0 -0
- package/src/core/components/functional/router/router.md +0 -0
- package/src/core/components/functional/router/router.ts +0 -0
- package/src/core/components/functional/sdui/sdui.md +0 -0
- package/src/core/components/functional/states/states.md +0 -0
- package/src/core/components/functional/submit/submit.md +0 -0
- package/src/core/components/functional/subscriber/subscriber.ts +0 -0
- package/src/core/components/ui/_css/align.ts +1 -0
- package/src/core/components/ui/_css/size.ts +0 -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/altchaStyles.ts +0 -0
- 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/radio/radio.md +0 -0
- package/src/core/components/ui/form/select/select.md +0 -0
- package/src/core/components/ui/form/switch/switch.md +0 -0
- package/src/core/components/ui/form/textarea/textarea.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/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/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/_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/example/users.ts +0 -0
- 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/page.ts +0 -0
- 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/.github/workflows/ci.yml +0 -21
- package/.github-export-ignore +0 -30
- package/CONTRIBUTING.md +0 -59
- package/DEV.md +0 -54
- package/LICENSE +0 -21
- package/OPEN_SOURCE_CHECKPOINT.md +0 -133
- package/docs/assets/index-DiD0qYvE.css +0 -1
- package/docs/src/tsconfig.declarations.json +0 -22
- package/docs/src/tsconfig.emit.json +0 -23
- package/gitlab/job_github_mirror.sh +0 -39
- package/scripts/github-export.mjs +0 -150
- package/src/css.d.ts +0 -19
- package/src/tsconfig.declarations.json +0 -22
- package/src/tsconfig.emit.json +0 -23
|
@@ -1,127 +1,188 @@
|
|
|
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
|
+
|
|
3
5
|
## Type
|
|
6
|
+
|
|
7
|
+
`default` — subtle background (`base-100`). `neutral` — dark fill (`base-content`) with light text, useful on light backgrounds.
|
|
8
|
+
|
|
4
9
|
<sonic-code>
|
|
5
10
|
<template>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
<div class="flex flex-wrap gap-2">
|
|
12
|
+
<sonic-badge>Default</sonic-badge>
|
|
13
|
+
<sonic-badge type="primary">Primary</sonic-badge>
|
|
14
|
+
<sonic-badge type="neutral">Neutral</sonic-badge>
|
|
15
|
+
<sonic-badge type="warning">Warning</sonic-badge>
|
|
16
|
+
<sonic-badge type="info">Info</sonic-badge>
|
|
17
|
+
<sonic-badge type="success">Success</sonic-badge>
|
|
18
|
+
<sonic-badge type="danger">Danger</sonic-badge>
|
|
19
|
+
</div>
|
|
14
20
|
</template>
|
|
15
21
|
</sonic-code>
|
|
16
22
|
|
|
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
|
|
17
28
|
|
|
18
|
-
## Outline
|
|
19
29
|
<sonic-code>
|
|
20
30
|
<template>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</div>
|
|
31
|
+
<div class="flex items-center flex-wrap gap-3">
|
|
32
|
+
<sonic-badge variant="outline">Default</sonic-badge>
|
|
33
|
+
<sonic-badge variant="outline" type="primary">Primary</sonic-badge>
|
|
34
|
+
<sonic-badge variant="outline" type="neutral">Neutral</sonic-badge>
|
|
35
|
+
<sonic-badge variant="outline" type="warning">Warning</sonic-badge>
|
|
36
|
+
<sonic-badge variant="outline" type="info">Info</sonic-badge>
|
|
37
|
+
<sonic-badge variant="outline" type="success">Success</sonic-badge>
|
|
38
|
+
<sonic-badge variant="outline" type="danger">Danger</sonic-badge>
|
|
39
|
+
</div>
|
|
31
40
|
</template>
|
|
32
41
|
</sonic-code>
|
|
33
42
|
|
|
34
|
-
|
|
43
|
+
### Ghost
|
|
44
|
+
|
|
35
45
|
<sonic-code>
|
|
36
46
|
<template>
|
|
37
47
|
<div class="flex items-center flex-wrap gap-3">
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</div>
|
|
48
|
+
<sonic-badge variant="ghost">Default</sonic-badge>
|
|
49
|
+
<sonic-badge variant="ghost" type="primary">Primary</sonic-badge>
|
|
50
|
+
<sonic-badge variant="ghost" type="neutral">Neutral</sonic-badge>
|
|
51
|
+
<sonic-badge variant="ghost" type="warning">Warning</sonic-badge>
|
|
52
|
+
<sonic-badge variant="ghost" type="info">Info</sonic-badge>
|
|
53
|
+
<sonic-badge variant="ghost" type="success">Success</sonic-badge>
|
|
54
|
+
<sonic-badge variant="ghost" type="danger">Danger</sonic-badge>
|
|
55
|
+
</div>
|
|
47
56
|
</template>
|
|
48
57
|
</sonic-code>
|
|
49
58
|
|
|
50
59
|
## Size
|
|
60
|
+
|
|
61
|
+
Default size is `md` (omit the `size` attribute). Typography and padding follow `sonic-button`.
|
|
62
|
+
|
|
51
63
|
<sonic-code>
|
|
52
64
|
<template>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
66
|
+
<sonic-badge size="2xs">2Xs</sonic-badge>
|
|
67
|
+
<sonic-badge size="xs">Xs</sonic-badge>
|
|
68
|
+
<sonic-badge size="sm">Sm</sonic-badge>
|
|
69
|
+
<sonic-badge>Md</sonic-badge>
|
|
70
|
+
<sonic-badge size="lg">Lg</sonic-badge>
|
|
71
|
+
<sonic-badge size="xl">Xl</sonic-badge>
|
|
72
|
+
<sonic-badge size="2xl">2Xl</sonic-badge>
|
|
73
|
+
</div>
|
|
60
74
|
</template>
|
|
61
75
|
</sonic-code>
|
|
62
76
|
|
|
77
|
+
## Prefix and suffix slots
|
|
78
|
+
|
|
79
|
+
Icons or short text before / after the main label.
|
|
63
80
|
|
|
64
|
-
## Empty badges
|
|
65
81
|
<sonic-code>
|
|
66
82
|
<template>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<sonic-badge type="
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</div>
|
|
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>
|
|
76
91
|
</template>
|
|
77
92
|
</sonic-code>
|
|
78
93
|
|
|
94
|
+
## Empty badges
|
|
95
|
+
|
|
96
|
+
Badge with no text (visual dot). `min-width` / `min-height` keep a readable shape.
|
|
97
|
+
|
|
98
|
+
<sonic-code>
|
|
99
|
+
<template>
|
|
100
|
+
<div class="flex items-center flex-wrap gap-3">
|
|
101
|
+
<sonic-badge type="danger" size="2xs"></sonic-badge>
|
|
102
|
+
<sonic-badge type="danger" size="xs"></sonic-badge>
|
|
103
|
+
<sonic-badge type="danger" size="sm"></sonic-badge>
|
|
104
|
+
<sonic-badge type="danger"></sonic-badge>
|
|
105
|
+
<sonic-badge type="danger" size="lg"></sonic-badge>
|
|
106
|
+
<sonic-badge type="danger" size="xl"></sonic-badge>
|
|
107
|
+
<sonic-badge type="danger" size="2xl"></sonic-badge>
|
|
108
|
+
</div>
|
|
109
|
+
</template>
|
|
110
|
+
</sonic-code>
|
|
79
111
|
|
|
80
112
|
## Ellipsis
|
|
113
|
+
|
|
114
|
+
With `ellipsis`, long labels truncate. The parent must constrain width (`max-width`, grid, etc.).
|
|
115
|
+
|
|
81
116
|
<sonic-code>
|
|
82
117
|
<template>
|
|
83
|
-
<div class="grid grid-cols-
|
|
84
|
-
|
|
85
|
-
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon>
|
|
86
|
-
|
|
118
|
+
<div class="grid grid-cols-2 gap-4 max-w-xl">
|
|
119
|
+
<sonic-badge ellipsis size="sm" variant="outline">
|
|
120
|
+
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon>
|
|
121
|
+
Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod.
|
|
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>
|
|
87
127
|
</div>
|
|
88
128
|
</template>
|
|
89
129
|
</sonic-code>
|
|
90
130
|
|
|
91
131
|
## Badge in button
|
|
132
|
+
|
|
133
|
+
Count inside a button (`slot="suffix"`) or a badge absolutely positioned on a button / icon.
|
|
134
|
+
|
|
92
135
|
<sonic-code>
|
|
93
136
|
<template>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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>
|
|
137
|
+
<div class="flex flex-wrap gap-4 items-center">
|
|
138
|
+
<sonic-button type="default">
|
|
139
|
+
Messages <sonic-badge slot="suffix" type="danger" size="xs">5</sonic-badge>
|
|
118
140
|
</sonic-button>
|
|
119
|
-
<
|
|
120
|
-
type="
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
141
|
+
<div class="relative inline-block">
|
|
142
|
+
<sonic-button type="success" class="relative">My account</sonic-button>
|
|
143
|
+
<sonic-badge
|
|
144
|
+
type="danger"
|
|
145
|
+
size="xs"
|
|
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>
|
|
124
171
|
</div>
|
|
125
|
-
</div>
|
|
126
172
|
</template>
|
|
127
173
|
</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,6 +71,7 @@ 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>
|
|
74
75
|
</template>
|
|
75
76
|
</sonic-code>
|
|
76
77
|
|
|
@@ -1,12 +1,71 @@
|
|
|
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
|
+
|
|
3
32
|
<sonic-code>
|
|
4
33
|
<template>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</sonic-submit>
|
|
9
|
-
</sonic-captcha>
|
|
34
|
+
<sonic-captcha formDataProvider="captcha-docs-form" key="6Leq5V0iAAAAAB-41DlWN335jDlcIuXmhNtdd00t">
|
|
35
|
+
<sonic-button type="outline" disabled>Complete the challenge above to enable submit</sonic-button>
|
|
36
|
+
</sonic-captcha>
|
|
10
37
|
</template>
|
|
11
38
|
</sonic-code>
|
|
12
|
-
|
|
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.
|
|
@@ -1,97 +1,215 @@
|
|
|
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
|
+
|
|
3
15
|
## 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
|
+
|
|
4
40
|
<sonic-code>
|
|
5
41
|
<template>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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>
|
|
42
|
+
<div class="grid gap-4 sm:grid-cols-2 max-w-2xl">
|
|
43
|
+
<sonic-card shadow="none" class="min-h-[5rem] flex items-center justify-center">None</sonic-card>
|
|
44
|
+
<sonic-card shadow="sm" class="min-h-[5rem] flex items-center justify-center">Small</sonic-card>
|
|
45
|
+
<sonic-card shadow="md" class="min-h-[5rem] flex items-center justify-center">Medium</sonic-card>
|
|
46
|
+
<sonic-card shadow="lg" class="min-h-[5rem] flex items-center justify-center">Large</sonic-card>
|
|
47
|
+
</div>
|
|
17
48
|
</template>
|
|
18
49
|
</sonic-code>
|
|
19
50
|
|
|
20
51
|
## 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
|
+
|
|
21
57
|
<sonic-code>
|
|
22
58
|
<template>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
<div class="grid gap-4 max-w-xl">
|
|
60
|
+
<sonic-card>
|
|
61
|
+
<sonic-card-header
|
|
62
|
+
label="Account settings"
|
|
63
|
+
description="Manage your profile and preferences."
|
|
64
|
+
></sonic-card-header>
|
|
65
|
+
<p class="m-0 text-sm opacity-80">Body content goes in the card slot or in <code>sonic-card-main</code>.</p>
|
|
66
|
+
</sonic-card>
|
|
67
|
+
|
|
68
|
+
<sonic-card type="neutral">
|
|
69
|
+
<sonic-card-header label="Notifications">
|
|
70
|
+
<sonic-card-header-description>
|
|
71
|
+
Choose what we email you about.
|
|
72
|
+
</sonic-card-header-description>
|
|
73
|
+
<sonic-badge slot="suffix" type="warning" size="xs">3 new</sonic-badge>
|
|
74
|
+
</sonic-card-header>
|
|
75
|
+
</sonic-card>
|
|
76
|
+
|
|
77
|
+
<sonic-card>
|
|
78
|
+
<sonic-card-header label="Team workspace" description="Shared with 12 members">
|
|
79
|
+
<sonic-button
|
|
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>
|
|
44
105
|
</template>
|
|
45
106
|
</sonic-code>
|
|
46
107
|
|
|
47
108
|
## Main
|
|
109
|
+
|
|
110
|
+
Optional wrapper for the primary content area (typography, media, forms).
|
|
111
|
+
|
|
48
112
|
<sonic-code>
|
|
49
113
|
<template>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
114
|
+
<sonic-card class="max-w-xl">
|
|
115
|
+
<sonic-card-header label="Release notes" description="Version 2.4"></sonic-card-header>
|
|
116
|
+
<sonic-card-main>
|
|
117
|
+
<p class="mt-0">
|
|
118
|
+
Improved performance on large lists and fixed an issue with keyboard navigation in menus.
|
|
119
|
+
</p>
|
|
120
|
+
<sonic-divider></sonic-divider>
|
|
121
|
+
<p class="mb-0 text-sm opacity-80">See the changelog for details.</p>
|
|
122
|
+
</sonic-card-main>
|
|
123
|
+
</sonic-card>
|
|
57
124
|
</template>
|
|
58
125
|
</sonic-code>
|
|
59
126
|
|
|
60
127
|
## Footer
|
|
128
|
+
|
|
129
|
+
Optional footer for actions, metadata, or secondary text.
|
|
130
|
+
|
|
61
131
|
<sonic-code>
|
|
62
132
|
<template>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
133
|
+
<sonic-card class="max-w-xl">
|
|
134
|
+
<sonic-card-header label="Confirm deletion"></sonic-card-header>
|
|
135
|
+
<sonic-card-main>
|
|
136
|
+
<p class="m-0">This project and all of its data will be removed permanently.</p>
|
|
137
|
+
</sonic-card-main>
|
|
138
|
+
<sonic-card-footer>
|
|
139
|
+
<sonic-divider></sonic-divider>
|
|
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>
|
|
70
143
|
</div>
|
|
71
|
-
</
|
|
72
|
-
</sonic-card
|
|
73
|
-
</sonic-card>
|
|
144
|
+
</sonic-card-footer>
|
|
145
|
+
</sonic-card>
|
|
74
146
|
</template>
|
|
75
147
|
</sonic-code>
|
|
76
148
|
|
|
149
|
+
## Full example
|
|
150
|
+
|
|
151
|
+
Header, media, body, and footer together.
|
|
77
152
|
|
|
78
|
-
## Example of use
|
|
79
153
|
<sonic-code>
|
|
80
154
|
<template>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
155
|
+
<sonic-card class="max-w-md">
|
|
156
|
+
<sonic-card-header label="Featured route" description="San Francisco → New York">
|
|
157
|
+
<sonic-icon slot="suffix" library="iconoir" name="airplane" aria-hidden="true"></sonic-icon>
|
|
158
|
+
</sonic-card-header>
|
|
159
|
+
<sonic-card-main>
|
|
160
|
+
<sonic-image
|
|
161
|
+
rounded
|
|
162
|
+
ratio="16/9"
|
|
163
|
+
src="https://thegoodlife.fr/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
164
|
+
alt="Airplane wing above the clouds"
|
|
165
|
+
></sonic-image>
|
|
166
|
+
<p class="mb-0">
|
|
167
|
+
Nonstop flight with flexible dates. Prices shown include taxes and fees.
|
|
168
|
+
</p>
|
|
169
|
+
</sonic-card-main>
|
|
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>
|
|
96
177
|
</template>
|
|
97
178
|
</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`) |
|