@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
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Badge โ Concorde</title>
|
|
7
|
-
<meta name="description" content="
|
|
8
|
-
<meta name="keywords" content="Concorde, supersoniks, core/components/ui/badge/badge, badge, Badge, UI component, sonic-badge, web component">
|
|
7
|
+
<meta name="description" content="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">
|
|
8
|
+
<meta name="keywords" content="Concorde, supersoniks, core/components/ui/badge/badge, badge, Badge, UI component, sonic-badge, web component, sonic-button, type, variant, size, default, base-100, neutral, base-content, outline">
|
|
9
9
|
<meta name="concorde-doc-id" content="core/components/ui/badge/badge">
|
|
10
10
|
<link rel="canonical" href="https://concorde.supersoniks.org/crawl/core/components/ui/badge/badge.html">
|
|
11
11
|
</head>
|
|
@@ -15,103 +15,181 @@
|
|
|
15
15
|
</header>
|
|
16
16
|
<main>
|
|
17
17
|
<article>
|
|
18
|
-
<p class="doc-lead" id="doc-summary"><strong>Concorde UI component โ Badge</strong>.
|
|
18
|
+
<p class="doc-lead" id="doc-summary"><strong>Concorde UI component โ Badge</strong>. 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 <span>Doc ID: <code>core/components/ui/badge/badge</code>. Keywords: Concorde, supersoniks, core/components/ui/badge/badge, badge, Badge, UI component, sonic-badge, web component, sonic-button, type, variant, size, default, base-100, neutral, base-content, outline. URL: <a href="https://concorde.supersoniks.org/crawl/core/components/ui/badge/badge.html">https://concorde.supersoniks.org/crawl/core/components/ui/badge/badge.html</a>.</span></p>
|
|
19
19
|
<h1 id="badge">Badge</h1>
|
|
20
|
+
<p>Badges are <strong>compact, non-interactive</strong> labels for status, counts, or categories. They mirror <strong><code>sonic-button</code></strong> styling (<code>type</code>, <code>variant</code>, <code>size</code>) without focus rings or click handlingโuse a button when the control should be actionable.</p>
|
|
20
21
|
<h2 id="type">Type</h2>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
<p><code>default</code> โ subtle background (<code>base-100</code>). <code>neutral</code> โ dark fill (<code>base-content</code>) with light text, useful on light backgrounds.</p>
|
|
23
|
+
<pre><code><div class="flex flex-wrap gap-2">
|
|
24
|
+
<sonic-badge>Default</sonic-badge>
|
|
25
|
+
<sonic-badge type="primary">Primary</sonic-badge>
|
|
26
|
+
<sonic-badge type="neutral">Neutral</sonic-badge>
|
|
27
|
+
<sonic-badge type="warning">Warning</sonic-badge>
|
|
28
|
+
<sonic-badge type="info">Info</sonic-badge>
|
|
29
|
+
<sonic-badge type="success">Success</sonic-badge>
|
|
30
|
+
<sonic-badge type="danger">Danger</sonic-badge>
|
|
31
|
+
</div>
|
|
29
32
|
</code></pre>
|
|
30
|
-
<h2 id="
|
|
33
|
+
<h2 id="variant">Variant</h2>
|
|
34
|
+
<p>Default <strong><code>variant</code></strong> is filled. <strong><code>outline</code></strong> โ border and text in the <code>type</code> color. <strong><code>ghost</code></strong> โ text only, no padding (except in forced-colors mode).</p>
|
|
35
|
+
<h3 id="outline">Outline</h3>
|
|
31
36
|
<pre><code><div class="flex items-center flex-wrap gap-3">
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
</div>
|
|
37
|
+
<sonic-badge variant="outline">Default</sonic-badge>
|
|
38
|
+
<sonic-badge variant="outline" type="primary">Primary</sonic-badge>
|
|
39
|
+
<sonic-badge variant="outline" type="neutral">Neutral</sonic-badge>
|
|
40
|
+
<sonic-badge variant="outline" type="warning">Warning</sonic-badge>
|
|
41
|
+
<sonic-badge variant="outline" type="info">Info</sonic-badge>
|
|
42
|
+
<sonic-badge variant="outline" type="success">Success</sonic-badge>
|
|
43
|
+
<sonic-badge variant="outline" type="danger">Danger</sonic-badge>
|
|
44
|
+
</div>
|
|
41
45
|
</code></pre>
|
|
42
|
-
<
|
|
46
|
+
<h3 id="ghost">Ghost</h3>
|
|
43
47
|
<pre><code><div class="flex items-center flex-wrap gap-3">
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
</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>
|
|
53
56
|
</code></pre>
|
|
54
57
|
<h2 id="size">Size</h2>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
<p>Default size is <code>md</code> (omit the <code>size</code> attribute). Typography and padding follow <code>sonic-button</code>.</p>
|
|
59
|
+
<pre><code><div class="flex flex-wrap items-center gap-2">
|
|
60
|
+
<sonic-badge size="2xs">2Xs</sonic-badge>
|
|
61
|
+
<sonic-badge size="xs">Xs</sonic-badge>
|
|
62
|
+
<sonic-badge size="sm">Sm</sonic-badge>
|
|
63
|
+
<sonic-badge>Md</sonic-badge>
|
|
64
|
+
<sonic-badge size="lg">Lg</sonic-badge>
|
|
65
|
+
<sonic-badge size="xl">Xl</sonic-badge>
|
|
66
|
+
<sonic-badge size="2xl">2Xl</sonic-badge>
|
|
67
|
+
</div>
|
|
68
|
+
</code></pre>
|
|
69
|
+
<h2 id="prefix-and-suffix-slots">Prefix and suffix slots</h2>
|
|
70
|
+
<p>Icons or short text before / after the main label.</p>
|
|
71
|
+
<pre><code><sonic-badge type="info" size="sm">
|
|
72
|
+
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon>
|
|
73
|
+
Info
|
|
74
|
+
</sonic-badge>
|
|
75
|
+
<sonic-badge type="success">
|
|
76
|
+
Verified
|
|
77
|
+
<sonic-icon slot="suffix" name="check" library="iconoir"></sonic-icon>
|
|
78
|
+
</sonic-badge>
|
|
62
79
|
</code></pre>
|
|
63
80
|
<h2 id="empty-badges">Empty badges</h2>
|
|
81
|
+
<p>Badge with no text (visual dot). <code>min-width</code> / <code>min-height</code> keep a readable shape.</p>
|
|
64
82
|
<pre><code><div class="flex items-center flex-wrap gap-3">
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
<sonic-badge type="danger" size="2xs"></sonic-badge>
|
|
84
|
+
<sonic-badge type="danger" size="xs"></sonic-badge>
|
|
85
|
+
<sonic-badge type="danger" size="sm"></sonic-badge>
|
|
86
|
+
<sonic-badge type="danger"></sonic-badge>
|
|
87
|
+
<sonic-badge type="danger" size="lg"></sonic-badge>
|
|
88
|
+
<sonic-badge type="danger" size="xl"></sonic-badge>
|
|
89
|
+
<sonic-badge type="danger" size="2xl"></sonic-badge>
|
|
90
|
+
</div>
|
|
73
91
|
</code></pre>
|
|
74
92
|
<h2 id="ellipsis">Ellipsis</h2>
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<sonic-
|
|
93
|
+
<p>With <code>ellipsis</code>, long labels truncate. The parent must constrain width (<code>max-width</code>, grid, etc.).</p>
|
|
94
|
+
<pre><code><div class="grid grid-cols-2 gap-4 max-w-xl">
|
|
95
|
+
<sonic-badge ellipsis size="sm" variant="outline">
|
|
96
|
+
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon>
|
|
97
|
+
Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod.
|
|
98
|
+
</sonic-badge>
|
|
99
|
+
<sonic-badge ellipsis size="sm">
|
|
100
|
+
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon>
|
|
101
|
+
Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod.
|
|
102
|
+
</sonic-badge>
|
|
79
103
|
</div>
|
|
80
104
|
</code></pre>
|
|
81
105
|
<h2 id="badge-in-button">Badge in button</h2>
|
|
106
|
+
<p>Count inside a button (<code>slot="suffix"</code>) or a badge absolutely positioned on a button / icon.</p>
|
|
82
107
|
<pre><code><div class="flex flex-wrap gap-4 items-center">
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</sonic-button>
|
|
86
|
-
<div class="relative inline-block">
|
|
87
|
-
<sonic-button type="success" class="relative"> Mon compte </sonic-button>
|
|
88
|
-
<sonic-badge type="danger" size="xs" class="absolute right-1 top-0 pe-none transform -translate-y-1/2"
|
|
89
|
-
>12</sonic-badge
|
|
90
|
-
>
|
|
91
|
-
</div>
|
|
92
|
-
<div class="relative inline-block">
|
|
93
|
-
<sonic-button type="neutral" shape="circle" variant="outline"
|
|
94
|
-
><sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
95
|
-
</sonic-button>
|
|
96
|
-
<sonic-badge
|
|
97
|
-
type="danger"
|
|
98
|
-
size="xs"
|
|
99
|
-
class="absolute right-1 bottom-1 pe-none transform translate-y-1/2 translate-x-1/2"
|
|
100
|
-
>33</sonic-badge
|
|
101
|
-
>
|
|
102
|
-
</div>
|
|
103
|
-
<div class="relative inline-block">
|
|
104
|
-
<sonic-button type="neutral" shape="circle" variant="outline"
|
|
105
|
-
><sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
108
|
+
<sonic-button type="default">
|
|
109
|
+
Messages <sonic-badge slot="suffix" type="danger" size="xs">5</sonic-badge>
|
|
106
110
|
</sonic-button>
|
|
107
|
-
<
|
|
108
|
-
type="
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
<div class="relative inline-block">
|
|
112
|
+
<sonic-button type="success" class="relative">My account</sonic-button>
|
|
113
|
+
<sonic-badge
|
|
114
|
+
type="danger"
|
|
115
|
+
size="xs"
|
|
116
|
+
class="absolute right-1 top-0 pe-none transform -translate-y-1/2"
|
|
117
|
+
>12</sonic-badge
|
|
118
|
+
>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="relative inline-block">
|
|
121
|
+
<sonic-button type="neutral" shape="circle" variant="outline">
|
|
122
|
+
<sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
123
|
+
</sonic-button>
|
|
124
|
+
<sonic-badge
|
|
125
|
+
type="danger"
|
|
126
|
+
size="xs"
|
|
127
|
+
class="absolute right-1 bottom-1 pe-none transform translate-y-1/2 translate-x-1/2"
|
|
128
|
+
>33</sonic-badge
|
|
129
|
+
>
|
|
130
|
+
</div>
|
|
131
|
+
<div class="relative inline-block">
|
|
132
|
+
<sonic-button type="neutral" shape="circle" variant="outline">
|
|
133
|
+
<sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
134
|
+
</sonic-button>
|
|
135
|
+
<sonic-badge
|
|
136
|
+
type="danger"
|
|
137
|
+
size="xs"
|
|
138
|
+
class="absolute right-2 bottom-2 pe-none transform translate-y-1/2 translate-x-1/2"
|
|
139
|
+
></sonic-badge>
|
|
140
|
+
</div>
|
|
112
141
|
</div>
|
|
113
|
-
</div>
|
|
114
142
|
</code></pre>
|
|
143
|
+
<h2 id="api-reference">API reference</h2>
|
|
144
|
+
<table>
|
|
145
|
+
<thead>
|
|
146
|
+
<tr>
|
|
147
|
+
<th>Attribute</th>
|
|
148
|
+
<th>Values</th>
|
|
149
|
+
<th>Description</th>
|
|
150
|
+
</tr>
|
|
151
|
+
</thead>
|
|
152
|
+
<tbody><tr>
|
|
153
|
+
<td><code>type</code></td>
|
|
154
|
+
<td><code>default</code> (default) ยท <code>primary</code> ยท <code>neutral</code> ยท <code>warning</code> ยท <code>info</code> ยท <code>success</code> ยท <code>danger</code></td>
|
|
155
|
+
<td>Semantic color (<code>--sc-*</code> tokens)</td>
|
|
156
|
+
</tr>
|
|
157
|
+
<tr>
|
|
158
|
+
<td><code>variant</code></td>
|
|
159
|
+
<td><code>default</code> (default) ยท <code>outline</code> ยท <code>ghost</code></td>
|
|
160
|
+
<td>Filled, bordered, or text-only</td>
|
|
161
|
+
</tr>
|
|
162
|
+
<tr>
|
|
163
|
+
<td><code>size</code></td>
|
|
164
|
+
<td><code>2xs</code> โฆ <code>2xl</code> (default <code>md</code>)</td>
|
|
165
|
+
<td>Typography and padding (aligned with <strong><code>sonic-button</code></strong>)</td>
|
|
166
|
+
</tr>
|
|
167
|
+
<tr>
|
|
168
|
+
<td><code>ellipsis</code></td>
|
|
169
|
+
<td>boolean</td>
|
|
170
|
+
<td>Single-line truncation; parent must constrain width</td>
|
|
171
|
+
</tr>
|
|
172
|
+
</tbody></table>
|
|
173
|
+
<table>
|
|
174
|
+
<thead>
|
|
175
|
+
<tr>
|
|
176
|
+
<th>Slot</th>
|
|
177
|
+
<th>Description</th>
|
|
178
|
+
</tr>
|
|
179
|
+
</thead>
|
|
180
|
+
<tbody><tr>
|
|
181
|
+
<td><em>(default)</em></td>
|
|
182
|
+
<td>Main label</td>
|
|
183
|
+
</tr>
|
|
184
|
+
<tr>
|
|
185
|
+
<td><code>prefix</code></td>
|
|
186
|
+
<td>Icon or short text before the label</td>
|
|
187
|
+
</tr>
|
|
188
|
+
<tr>
|
|
189
|
+
<td><code>suffix</code></td>
|
|
190
|
+
<td>Icon or short text after the label</td>
|
|
191
|
+
</tr>
|
|
192
|
+
</tbody></table>
|
|
115
193
|
|
|
116
194
|
</article>
|
|
117
195
|
</main>
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
<p>The length of the button depends on the size of its content</p>
|
|
67
67
|
<pre><code><sonic-button loading></sonic-button>
|
|
68
68
|
<sonic-button loading>Loading button</sonic-button>
|
|
69
|
+
<sonic-button loading><span slot="prefix">๐</span>Loading with prefix<span slot="suffix">๐</span></sonic-button>
|
|
69
70
|
</code></pre>
|
|
70
71
|
<h2 id="swap">Swap</h2>
|
|
71
72
|
<pre><code><sonic-button formDataProvider="button_swap_example" name="youpi" value="youpla" type="primary" shape="circle" variant="outline" class="mr-4">
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Captcha โ Concorde</title>
|
|
7
|
-
<meta name="description" content="
|
|
8
|
-
<meta name="keywords" content="Concorde, supersoniks, core/components/ui/captcha/captcha, captcha, Captcha, UI component, sonic-captcha, web component">
|
|
7
|
+
<meta name="description" content="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 vali">
|
|
8
|
+
<meta name="keywords" content="Concorde, supersoniks, core/components/ui/captcha/captcha, captcha, Captcha, UI component, sonic-captcha, web component, captchaToken, needsCaptchaValidation, formDataProvider, headersDataProvider, sonic-submit, key, generateEncryptedKey">
|
|
9
9
|
<meta name="concorde-doc-id" content="core/components/ui/captcha/captcha">
|
|
10
10
|
<link rel="canonical" href="https://concorde.supersoniks.org/crawl/core/components/ui/captcha/captcha.html">
|
|
11
11
|
</head>
|
|
@@ -15,14 +15,96 @@
|
|
|
15
15
|
</header>
|
|
16
16
|
<main>
|
|
17
17
|
<article>
|
|
18
|
-
<p class="doc-lead" id="doc-summary"><strong>Concorde UI component โ Captcha</strong>.
|
|
18
|
+
<p class="doc-lead" id="doc-summary"><strong>Concorde UI component โ Captcha</strong>. 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 vali <span>Doc ID: <code>core/components/ui/captcha/captcha</code>. Keywords: Concorde, supersoniks, core/components/ui/captcha/captcha, captcha, Captcha, UI component, sonic-captcha, web component, captchaToken, needsCaptchaValidation, formDataProvider, headersDataProvider, sonic-submit, key, generateEncryptedKey. URL: <a href="https://concorde.supersoniks.org/crawl/core/components/ui/captcha/captcha.html">https://concorde.supersoniks.org/crawl/core/components/ui/captcha/captcha.html</a>.</span></p>
|
|
19
19
|
<h1 id="captcha">Captcha</h1>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
<p><strong><code>sonic-captcha</code></strong> embeds an <strong>ALTCHA</strong> widget and wires <strong><code>captchaToken</code></strong> / <strong><code>needsCaptchaValidation</code></strong> on the ancestor <strong><code>formDataProvider</code></strong> (or <strong><code>headersDataProvider</code></strong>). <strong><code>sonic-submit</code></strong> waits for a token before sending when validation is required. The widget loads only on <strong>HTTPS</strong>; on plain HTTP the host renders nothing.</p>
|
|
21
|
+
<blockquote>
|
|
22
|
+
<p>Live widget calls the Supersoniks challenge service โ not part of <a href="../../../../docs/_misc/docs-mock-api.html#docs-mock-api">docs mock API</a>.</p>
|
|
23
|
+
</blockquote>
|
|
24
|
+
<h2 id="basic-example">Basic example</h2>
|
|
25
|
+
<p>Wrap the form scope and place <strong><code>sonic-submit</code></strong> in the default slot so the challenge appears above the action.</p>
|
|
26
|
+
<pre><code><sonic-scope
|
|
27
|
+
serviceURL="/docs-mock-api"
|
|
28
|
+
formDataProvider="captcha-docs-form"
|
|
29
|
+
submitResultDataProvider="captcha-docs-result"
|
|
30
|
+
>
|
|
31
|
+
<sonic-captcha formDataProvider="captcha-docs-form">
|
|
32
|
+
<sonic-input class="mb-3" name="email" type="email" label="Email" value="demo@example.com"></sonic-input>
|
|
33
|
+
<sonic-submit endPoint="api/register" onClick>
|
|
34
|
+
<sonic-button type="primary">Submit with captcha</sonic-button>
|
|
35
|
+
</sonic-submit>
|
|
36
|
+
</sonic-captcha>
|
|
37
|
+
</sonic-scope>
|
|
25
38
|
</code></pre>
|
|
39
|
+
<h2 id="encrypted-site-key">Encrypted site key</h2>
|
|
40
|
+
<p>Optional <strong><code>key</code></strong> skips client-side key generation. When omitted, the component derives an encrypted key on connect (after <strong><code>generateEncryptedKey</code></strong>).</p>
|
|
41
|
+
<pre><code><sonic-captcha formDataProvider="captcha-docs-form" key="6Leq5V0iAAAAAB-41DlWN335jDlcIuXmhNtdd00t">
|
|
42
|
+
<sonic-button type="outline" disabled>Complete the challenge above to enable submit</sonic-button>
|
|
43
|
+
</sonic-captcha>
|
|
44
|
+
</code></pre>
|
|
45
|
+
<h2 id="form-publisher-fields">Form publisher fields</h2>
|
|
46
|
+
<p>On connect (HTTPS only), <strong><code>needsCaptchaValidation</code></strong> is set to <strong><code>true</code></strong> and <strong><code>captchaToken</code></strong> is cleared. When the ALTCHA widget reaches <strong><code>verified</code></strong>, <strong><code>captchaToken</code></strong> is written on the form publisher and <strong><code>sonic-captcha-validate</code></strong> fires (<code>detail.valid</code> ยท <strong><code>detail.state</code></strong> ยท optional <strong><code>detail.token</code></strong> / <strong><code>detail.payload</code></strong>). <strong><code>sonic-submit</code></strong> still listens for <strong><code>request_token</code></strong> to refresh the token immediately before send.</p>
|
|
47
|
+
<pre><code class="language-typescript">{
|
|
48
|
+
needsCaptchaValidation: true,
|
|
49
|
+
captchaKey: "โฆ",
|
|
50
|
+
captchaToken: "โฆ"
|
|
51
|
+
}
|
|
52
|
+
</code></pre>
|
|
53
|
+
<h2 id="api-reference">API reference</h2>
|
|
54
|
+
<table>
|
|
55
|
+
<thead>
|
|
56
|
+
<tr>
|
|
57
|
+
<th>Attribute</th>
|
|
58
|
+
<th>Values</th>
|
|
59
|
+
<th>Description</th>
|
|
60
|
+
</tr>
|
|
61
|
+
</thead>
|
|
62
|
+
<tbody><tr>
|
|
63
|
+
<td><code>formDataProvider</code></td>
|
|
64
|
+
<td>publisher id</td>
|
|
65
|
+
<td>Same as ancestor form scope; reads/writes <strong><code>needsCaptchaValidation</code></strong> ยท <strong><code>captchaKey</code></strong> ยท <strong><code>captchaToken</code></strong></td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr>
|
|
68
|
+
<td><code>key</code></td>
|
|
69
|
+
<td>string</td>
|
|
70
|
+
<td>ALTCHA site key; auto-generated when empty</td>
|
|
71
|
+
</tr>
|
|
72
|
+
<tr>
|
|
73
|
+
<td><code>action</code></td>
|
|
74
|
+
<td>string</td>
|
|
75
|
+
<td>Optional action name forwarded to the widget</td>
|
|
76
|
+
</tr>
|
|
77
|
+
<tr>
|
|
78
|
+
<td><code>zIndex</code></td>
|
|
79
|
+
<td>number (default <code>9999</code>)</td>
|
|
80
|
+
<td>Stacking for the challenge overlay</td>
|
|
81
|
+
</tr>
|
|
82
|
+
</tbody></table>
|
|
83
|
+
<table>
|
|
84
|
+
<thead>
|
|
85
|
+
<tr>
|
|
86
|
+
<th>Slot</th>
|
|
87
|
+
<th>Description</th>
|
|
88
|
+
</tr>
|
|
89
|
+
</thead>
|
|
90
|
+
<tbody><tr>
|
|
91
|
+
<td><em>(default)</em></td>
|
|
92
|
+
<td>Form actions (typically <strong><code>sonic-submit</code></strong> and fields) rendered below the widget</td>
|
|
93
|
+
</tr>
|
|
94
|
+
</tbody></table>
|
|
95
|
+
<table>
|
|
96
|
+
<thead>
|
|
97
|
+
<tr>
|
|
98
|
+
<th>Event</th>
|
|
99
|
+
<th>Description</th>
|
|
100
|
+
</tr>
|
|
101
|
+
</thead>
|
|
102
|
+
<tbody><tr>
|
|
103
|
+
<td><code>sonic-captcha-validate</code></td>
|
|
104
|
+
<td>Fired when <strong><code>state</code></strong> is <strong><code>verified</code></strong> ยท <strong><code>error</code></strong> or <strong><code>expired</code></strong>; <strong><code>detail.valid</code></strong> is <strong><code>true</code></strong> only for <strong><code>verified</code></strong></td>
|
|
105
|
+
</tr>
|
|
106
|
+
</tbody></table>
|
|
107
|
+
<p>Related: <a href="../../functional/submit/submit.html#submit">Submit</a> โ <strong><code>needsCaptchaValidation</code></strong> and deferred send.</p>
|
|
26
108
|
|
|
27
109
|
</article>
|
|
28
110
|
</main>
|