@supersoniks/concorde 5.0.3 → 5.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/concorde-component-docs/SKILL.md +194 -0
- package/.agents/skills/concorde-component-docs/template.md +45 -0
- package/ai/cursor/rules/concorde-theme.mdc +1 -1
- package/ai/cursor/rules/concorde.mdc +1 -1
- package/ai/skills/concorde/SKILL.md +1 -1
- package/ai/skills/concorde-theme/SKILL.md +21 -10
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +515 -521
- package/concorde-core.es.js +5151 -5056
- package/dist/concorde-core.bundle.js +515 -521
- package/dist/concorde-core.es.js +5151 -5056
- package/dist/docs-mock-api-sw.js +2 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/docs/assets/index-CD4WyL6o.css +1 -0
- package/docs/assets/{index-BnK6OS7w.js → index-wVZpLVYW.js} +815 -808
- package/docs/crawl/core/components/ui/alert/alert.html +76 -5
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +113 -5
- package/docs/crawl/core/components/ui/badge/badge.html +57 -8
- package/docs/crawl/core/components/ui/captcha/captcha.html +90 -8
- package/docs/crawl/core/components/ui/card/card.html +122 -12
- package/docs/crawl/core/components/ui/divider/divider.html +117 -31
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +232 -101
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +95 -52
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +97 -38
- package/docs/crawl/core/components/ui/group/group.html +60 -38
- package/docs/crawl/core/components/ui/icon/icon.html +136 -47
- package/docs/crawl/core/components/ui/image/image.html +118 -6
- package/docs/crawl/core/components/ui/link/link.html +65 -7
- package/docs/crawl/core/components/ui/loader/loader.html +97 -23
- package/docs/crawl/core/components/ui/menu/menu.html +162 -90
- package/docs/crawl/core/components/ui/modal/modal.html +275 -50
- package/docs/crawl/core/components/ui/pop/pop.html +242 -124
- package/docs/crawl/core/components/ui/progress/progress.html +103 -30
- package/docs/crawl/core/components/ui/table/table.html +303 -171
- package/docs/crawl/core/components/ui/theme/theme.html +131 -0
- package/docs/crawl/core/components/ui/toast/toast.html +170 -59
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +90 -29
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +3 -2
- package/docs/crawl/docs/_getting-started/start.html +1 -1
- package/docs/crawl/docs/_getting-started/theming.html +311 -63
- package/docs/crawl/hubs/form-components.html +71 -49
- package/docs/crawl/index.html +7 -6
- package/docs/docs-mock-api-sw.js +2 -0
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +6 -4
- package/docs/llms-full.txt +1468 -405
- package/docs/llms.txt +23 -30
- package/docs/sitemap.xml +3 -0
- package/docs/src/core/components/ui/alert/alert.md +21 -2
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/docs/src/core/components/ui/badge/badge.md +19 -6
- package/docs/src/core/components/ui/captcha/captcha.md +65 -6
- package/docs/src/core/components/ui/card/card.md +73 -10
- package/docs/src/core/components/ui/divider/divider.md +107 -13
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/docs/src/core/components/ui/group/group.md +36 -36
- package/docs/src/core/components/ui/icon/icon.md +132 -43
- package/docs/src/core/components/ui/image/image.md +35 -3
- package/docs/src/core/components/ui/link/link.md +43 -5
- package/docs/src/core/components/ui/loader/loader.md +79 -22
- package/docs/src/core/components/ui/menu/menu.md +133 -92
- package/docs/src/core/components/ui/modal/modal.md +163 -47
- package/docs/src/core/components/ui/pop/pop.md +217 -123
- package/docs/src/core/components/ui/progress/progress.md +76 -30
- package/docs/src/core/components/ui/table/table.md +147 -171
- package/docs/src/core/components/ui/theme/theme.md +122 -0
- package/docs/src/core/components/ui/toast/toast.md +108 -58
- package/docs/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/docs/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/docs/src/docs/_getting-started/start.md +1 -1
- package/docs/src/docs/_getting-started/theming.md +223 -61
- package/docs/src/docs/search/docs-search.json +2504 -399
- package/docs/src/tsconfig.json +18 -0
- package/index.html +4 -2
- package/package.json +7 -1
- package/public/docs-mock-api-sw.js +2 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- package/src/core/components/ui/_css/align.ts +1 -0
- package/src/core/components/ui/_css/type.ts +86 -8
- package/src/core/components/ui/_i18n/ui-aria-labels.ts +8 -0
- package/src/core/components/ui/alert/alert.md +21 -2
- package/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/src/core/components/ui/badge/badge.md +19 -6
- package/src/core/components/ui/badge/badge.ts +8 -9
- package/src/core/components/ui/button/button.ts +5 -15
- package/src/core/components/ui/captcha/captcha.md +65 -6
- package/src/core/components/ui/card/card.md +73 -10
- package/src/core/components/ui/card/card.ts +24 -22
- package/src/core/components/ui/divider/divider.md +107 -13
- package/src/core/components/ui/divider/divider.ts +40 -33
- package/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/src/core/components/ui/form/fieldset/fieldset.ts +15 -28
- package/src/core/components/ui/form/fieldset/legend.ts +13 -13
- package/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/src/core/components/ui/form/form-actions/form-actions.ts +7 -5
- package/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/src/core/components/ui/form/form-layout/form-layout.ts +27 -24
- package/src/core/components/ui/form/textarea/textarea.ts +4 -3
- package/src/core/components/ui/group/group.md +36 -36
- package/src/core/components/ui/group/group.ts +5 -10
- package/src/core/components/ui/icon/icon.md +132 -43
- package/src/core/components/ui/image/image.md +35 -3
- package/src/core/components/ui/link/link.md +43 -5
- package/src/core/components/ui/loader/loader.md +79 -22
- package/src/core/components/ui/loader/loader.ts +67 -27
- package/src/core/components/ui/loader/styles/fixed.ts +6 -11
- package/src/core/components/ui/menu/menu.md +133 -92
- package/src/core/components/ui/menu/menu.ts +53 -58
- package/src/core/components/ui/modal/modal.md +163 -47
- package/src/core/components/ui/modal/modal.ts +2 -4
- package/src/core/components/ui/pop/pop.md +217 -123
- package/src/core/components/ui/pop/pop.ts +0 -1
- package/src/core/components/ui/progress/progress.md +76 -30
- package/src/core/components/ui/progress/progress.ts +25 -56
- package/src/core/components/ui/table/table-caption.ts +2 -2
- package/src/core/components/ui/table/table-tbody.ts +3 -3
- package/src/core/components/ui/table/table-td.ts +23 -18
- package/src/core/components/ui/table/table-th.ts +8 -8
- package/src/core/components/ui/table/table-tr.ts +4 -4
- package/src/core/components/ui/table/table.md +147 -171
- package/src/core/components/ui/table/table.ts +20 -19
- package/src/core/components/ui/theme/theme-collection/auto.ts +15 -0
- package/src/core/components/ui/theme/theme-collection/core-variables.ts +8 -31
- package/src/core/components/ui/theme/theme-collection/dark.ts +1 -7
- package/src/core/components/ui/theme/theme-collection/light.ts +30 -26
- package/src/core/components/ui/theme/theme.md +122 -0
- package/src/core/components/ui/theme/theme.ts +30 -7
- package/src/core/components/ui/toast/toast-item.ts +6 -9
- package/src/core/components/ui/toast/toast.md +108 -58
- package/src/core/components/ui/toast/types.ts +1 -1
- package/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +26 -0
- package/src/core/decorators/subscriber/ancestorAttribute.ts +3 -4
- package/src/core/utils/AncestorAttributeObserver.ts +183 -70
- package/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/src/docs/_getting-started/start.md +1 -1
- package/src/docs/_getting-started/theming.md +223 -61
- package/src/docs/code.ts +125 -58
- package/src/docs/header/header.ts +62 -54
- package/src/docs/mock-api/router.ts +2 -0
- package/src/docs/navigation/navigation.ts +6 -3
- package/src/docs/search/docs-search.json +2504 -399
- package/src/docs/search/markdown-renderer.ts +6 -6
- package/src/docs/search/search.ts +4 -4
- package/src/docs/tailwind/css/tailwind.css +6 -5
- package/src/tsconfig.json +18 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +19 -0
- package/docs/assets/index--GpD7R7a.css +0 -1
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { html, LitElement, css } from "lit";
|
|
1
|
+
import { html, LitElement, css, PropertyValues, nothing } from "lit";
|
|
2
2
|
import {
|
|
3
3
|
customElement,
|
|
4
4
|
property,
|
|
5
5
|
queryAssignedNodes,
|
|
6
|
-
|
|
6
|
+
state,
|
|
7
7
|
} from "lit/decorators.js";
|
|
8
8
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
9
|
-
import {
|
|
9
|
+
import { Align } from "@supersoniks/concorde/core/components/ui/_css/align";
|
|
10
|
+
import {
|
|
11
|
+
fontSize,
|
|
12
|
+
Size,
|
|
13
|
+
} from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
14
|
+
|
|
15
|
+
export type DividerLineStyle = "solid" | "dashed" | "dotted";
|
|
16
|
+
|
|
10
17
|
const tagName = "sonic-divider";
|
|
11
18
|
@customElement(tagName)
|
|
12
19
|
export class Divider extends LitElement {
|
|
13
20
|
static styles = [
|
|
21
|
+
fontSize,
|
|
14
22
|
css`
|
|
15
23
|
:host {
|
|
16
24
|
--sc-divider-my: 0.5rem;
|
|
@@ -20,15 +28,13 @@ export class Divider extends LitElement {
|
|
|
20
28
|
var(--sc-border-width, max(1px, 0.12rem))
|
|
21
29
|
);
|
|
22
30
|
--sc-divider-border-color: var(--sc-border-color);
|
|
23
|
-
--sc-
|
|
31
|
+
--sc-_border-style: solid;
|
|
24
32
|
--sc-divider-color: currentColor;
|
|
25
33
|
--sc-divider-ff: var(--sc-font-family-base, sans-serif);
|
|
26
|
-
--sc-divider-fs: 1rem;
|
|
27
34
|
--sc-divider-fw: var(--sc-font-weight-base, 400);
|
|
28
35
|
--sc-divider-fst: var(--sc-font-style-base, normal);
|
|
29
36
|
|
|
30
37
|
margin: var(--sc-divider-my) var(--sc-divider-mx);
|
|
31
|
-
font-size: var(--sc-divider-fs);
|
|
32
38
|
font-style: var(--sc-divider-fst);
|
|
33
39
|
font-family: var(--sc-divider-ff);
|
|
34
40
|
font-weight: var(--sc-divider-fw);
|
|
@@ -39,17 +45,14 @@ export class Divider extends LitElement {
|
|
|
39
45
|
/*SIZE*/
|
|
40
46
|
:host([size="2xs"]) {
|
|
41
47
|
--sc-divider-my: 0.35rem;
|
|
42
|
-
--sc-divider-fs: 0.68rem;
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
:host([size="xs"]) {
|
|
46
51
|
--sc-divider-my: 0.5rem;
|
|
47
|
-
--sc-divider-fs: 0.75rem;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
:host([size="sm"]) {
|
|
51
55
|
--sc-divider-my: 0.75rem;
|
|
52
|
-
--sc-divider-fs: 0.875rem;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
:host([size="md"]) {
|
|
@@ -78,8 +81,8 @@ export class Divider extends LitElement {
|
|
|
78
81
|
div::after {
|
|
79
82
|
content: "";
|
|
80
83
|
flex-grow: 1;
|
|
81
|
-
border-top: var(--sc-divider-border-width)
|
|
82
|
-
var(--sc-divider-border-
|
|
84
|
+
border-top: var(--sc-divider-border-width) var(--sc-_border-style)
|
|
85
|
+
var(--sc-divider-border-color);
|
|
83
86
|
width: 100%;
|
|
84
87
|
opacity: var(--sc-divider-opacity, 1);
|
|
85
88
|
}
|
|
@@ -110,8 +113,8 @@ export class Divider extends LitElement {
|
|
|
110
113
|
:host([vertical]) div::before,
|
|
111
114
|
:host([vertical]) div::after {
|
|
112
115
|
border-top: none;
|
|
113
|
-
border-left: var(--sc-divider-border-width)
|
|
114
|
-
var(--sc-divider-border-
|
|
116
|
+
border-left: var(--sc-divider-border-width) var(--sc-_border-style)
|
|
117
|
+
var(--sc-divider-border-color);
|
|
115
118
|
width: auto;
|
|
116
119
|
height: 100%;
|
|
117
120
|
opacity: var(--sc-divider-opacity, 1);
|
|
@@ -131,48 +134,52 @@ export class Divider extends LitElement {
|
|
|
131
134
|
.no-text .text {
|
|
132
135
|
display: none;
|
|
133
136
|
}
|
|
137
|
+
.no-text::after {
|
|
138
|
+
display: none;
|
|
139
|
+
}
|
|
134
140
|
|
|
135
141
|
.has-text {
|
|
136
142
|
gap: 0.5rem;
|
|
137
143
|
}
|
|
138
144
|
|
|
139
|
-
:host([
|
|
140
|
-
--sc-
|
|
145
|
+
:host([linestyle="dashed"]) {
|
|
146
|
+
--sc-_border-style: dashed;
|
|
141
147
|
}
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
|
|
149
|
+
:host([linestyle="dotted"]) {
|
|
150
|
+
--sc-_border-style: dotted;
|
|
144
151
|
}
|
|
145
152
|
`,
|
|
146
153
|
];
|
|
147
154
|
@queryAssignedNodes({ flatten: true })
|
|
148
155
|
slotNodes!: Array<Node>;
|
|
149
156
|
|
|
150
|
-
@
|
|
151
|
-
divider!: HTMLDivElement;
|
|
157
|
+
@state() hasText = false;
|
|
152
158
|
|
|
153
159
|
@property({ type: String }) label = "";
|
|
154
160
|
@property({ type: String, reflect: true }) size?: Size;
|
|
155
161
|
|
|
156
|
-
@property({ type: String, reflect: true }) align:
|
|
157
|
-
| "left"
|
|
158
|
-
| "right"
|
|
159
|
-
| "center" = "center";
|
|
162
|
+
@property({ type: String, reflect: true }) align: Align = "center";
|
|
160
163
|
@property({ type: Boolean, reflect: true }) vertical = false;
|
|
161
164
|
@property({ type: Boolean, reflect: true }) noMargin = false;
|
|
162
|
-
@property({ type:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
super.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
@property({ type: String, reflect: true })
|
|
166
|
+
lineStyle: DividerLineStyle = "solid";
|
|
167
|
+
|
|
168
|
+
willUpdate(changedProperties: PropertyValues) {
|
|
169
|
+
super.willUpdate(changedProperties);
|
|
170
|
+
this.syncHasText();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
syncHasText() {
|
|
174
|
+
this.hasText = !!(this.label || this.slotNodes?.length);
|
|
170
175
|
}
|
|
171
176
|
|
|
172
177
|
render() {
|
|
173
|
-
return html`<div
|
|
178
|
+
return html`<div class="${this.hasText ? "has-text" : "no-text"}">
|
|
174
179
|
<span class="text"
|
|
175
|
-
>${unsafeHTML(this.label ? this.label :
|
|
180
|
+
>${unsafeHTML(this.label ? this.label : nothing)}<slot
|
|
181
|
+
@slotchange=${this.syncHasText}
|
|
182
|
+
></slot
|
|
176
183
|
></span>
|
|
177
184
|
</div>`;
|
|
178
185
|
}
|
|
@@ -1,129 +1,205 @@
|
|
|
1
1
|
# Fieldset
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**`sonic-fieldset`** groups related form controls with a bordered container and an accessible **`<fieldset>`** semantics layer. Put fields in the **default slot**; add a title with **`sonic-legend`** or the shorthand **`label`** / **`description`** / **`iconName`** attributes. Default **`variant`** is `default`. Pair the body with **`sonic-form-layout`** for responsive columns.
|
|
4
|
+
|
|
5
|
+
## Basic example
|
|
6
|
+
|
|
4
7
|
<sonic-code>
|
|
5
8
|
<template>
|
|
6
|
-
<sonic-fieldset
|
|
7
|
-
|
|
9
|
+
<sonic-fieldset>
|
|
10
|
+
<sonic-legend label="Contact details"></sonic-legend>
|
|
11
|
+
<sonic-form-layout>
|
|
12
|
+
<sonic-input autocomplete="email" label="Email" name="email" type="email"></sonic-input>
|
|
13
|
+
<sonic-input autocomplete="tel" label="Phone" name="phone" type="tel"></sonic-input>
|
|
14
|
+
</sonic-form-layout>
|
|
8
15
|
</sonic-fieldset>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
</template>
|
|
17
|
+
</sonic-code>
|
|
18
|
+
|
|
19
|
+
## Variant
|
|
20
|
+
|
|
21
|
+
**`ghost`** and **`shadow`** use a transparent border; **`shadow`** also applies **`--sc-shadow-lg`**.
|
|
22
|
+
|
|
23
|
+
<sonic-code>
|
|
24
|
+
<template>
|
|
25
|
+
<div class="grid gap-4">
|
|
26
|
+
<sonic-fieldset variant="default">
|
|
27
|
+
<sonic-legend label="Default"></sonic-legend>
|
|
28
|
+
<sonic-input label="Field" name="a"></sonic-input>
|
|
29
|
+
</sonic-fieldset>
|
|
30
|
+
<sonic-fieldset variant="ghost">
|
|
31
|
+
<sonic-legend label="Ghost"></sonic-legend>
|
|
32
|
+
<sonic-input label="Field" name="b"></sonic-input>
|
|
33
|
+
</sonic-fieldset>
|
|
34
|
+
<sonic-fieldset variant="shadow">
|
|
35
|
+
<sonic-legend label="Shadow"></sonic-legend>
|
|
36
|
+
<sonic-input label="Field" name="c"></sonic-input>
|
|
37
|
+
</sonic-fieldset>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
</sonic-code>
|
|
41
|
+
|
|
42
|
+
## Tight layout
|
|
43
|
+
|
|
44
|
+
Set **`tight`** to remove horizontal padding and side borders (flat strip inside a parent).
|
|
45
|
+
|
|
46
|
+
<sonic-code>
|
|
47
|
+
<template>
|
|
48
|
+
<sonic-fieldset tight variant="ghost">
|
|
49
|
+
<sonic-legend label="Tight fieldset"></sonic-legend>
|
|
50
|
+
<sonic-input label="Field" name="tight"></sonic-input>
|
|
14
51
|
</sonic-fieldset>
|
|
15
52
|
</template>
|
|
16
53
|
</sonic-code>
|
|
17
54
|
|
|
18
55
|
## Legend
|
|
56
|
+
|
|
57
|
+
Use **`sonic-legend`** for the group title. Set **`label`** and **`description`** for simple copy, or use the **default slot** for custom markup. Add secondary text with **`sonic-legend-description`**. Place actions in **`slot="suffix"`** on the legend.
|
|
58
|
+
|
|
59
|
+
Attribute values on **`sonic-legend`** are rendered as HTML—use only trusted content.
|
|
60
|
+
|
|
61
|
+
<sonic-code>
|
|
62
|
+
<template>
|
|
63
|
+
<div class="grid gap-4">
|
|
64
|
+
<sonic-fieldset>
|
|
65
|
+
<sonic-legend label="Attributes" description="Short description via attributes"></sonic-legend>
|
|
66
|
+
<sonic-input label="Field" name="attr"></sonic-input>
|
|
67
|
+
</sonic-fieldset>
|
|
68
|
+
<sonic-fieldset>
|
|
69
|
+
<sonic-legend iconLibrary="iconoir" iconName="pin-alt">
|
|
70
|
+
Custom title in the default slot
|
|
71
|
+
<sonic-legend-description>Description via sonic-legend-description</sonic-legend-description>
|
|
72
|
+
</sonic-legend>
|
|
73
|
+
<sonic-input label="Field" name="slot"></sonic-input>
|
|
74
|
+
</sonic-fieldset>
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
77
|
+
</sonic-code>
|
|
78
|
+
|
|
79
|
+
## Shorthand legend on the fieldset
|
|
80
|
+
|
|
81
|
+
When **`label`** is set on **`sonic-fieldset`**, the component renders **`sonic-legend`** for you. Pass **`description`** **`iconName`** **`iconLibrary`** and **`iconPrefix`** the same way. Do not combine shorthand **`label`** with a separate slotted **`sonic-legend`**—you will get two legends.
|
|
82
|
+
|
|
19
83
|
<sonic-code>
|
|
20
84
|
<template>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Description via composant : sonic-legend-description
|
|
30
|
-
</sonic-legend-description>
|
|
31
|
-
</sonic-legend>
|
|
32
|
-
</sonic-fieldset>
|
|
85
|
+
<sonic-fieldset
|
|
86
|
+
label="Account"
|
|
87
|
+
description="Basic profile fields"
|
|
88
|
+
iconLibrary="iconoir"
|
|
89
|
+
iconName="user"
|
|
90
|
+
>
|
|
91
|
+
<sonic-input label="Display name" name="display_name"></sonic-input>
|
|
92
|
+
</sonic-fieldset>
|
|
33
93
|
</template>
|
|
34
94
|
</sonic-code>
|
|
35
95
|
|
|
96
|
+
## Legend actions
|
|
97
|
+
|
|
98
|
+
Use **`slot="suffix"`** on **`sonic-legend`** for menus or icon buttons aligned to the end of the legend row.
|
|
36
99
|
|
|
37
|
-
## Short hand
|
|
38
100
|
<sonic-code>
|
|
39
101
|
<template>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
102
|
+
<sonic-fieldset>
|
|
103
|
+
<sonic-legend label="Personal information">
|
|
104
|
+
<sonic-pop class="inline-block" slot="suffix">
|
|
105
|
+
<sonic-button shape="circle" variant="ghost">
|
|
106
|
+
<sonic-icon library="iconoir" size="lg" name="more-vert"></sonic-icon>
|
|
107
|
+
</sonic-button>
|
|
108
|
+
<sonic-menu slot="content" minWidth="12rem">
|
|
109
|
+
<sonic-menu-item>Legal notice</sonic-menu-item>
|
|
110
|
+
<sonic-menu-item>Terms of use</sonic-menu-item>
|
|
111
|
+
</sonic-menu>
|
|
112
|
+
</sonic-pop>
|
|
113
|
+
</sonic-legend>
|
|
114
|
+
<sonic-form-layout>
|
|
115
|
+
<sonic-input autocomplete="family-name" label="Last name" name="last_name"></sonic-input>
|
|
116
|
+
<sonic-input autocomplete="given-name" label="First name" name="first_name"></sonic-input>
|
|
117
|
+
</sonic-form-layout>
|
|
118
|
+
</sonic-fieldset>
|
|
46
119
|
</template>
|
|
47
120
|
</sonic-code>
|
|
48
121
|
|
|
49
|
-
##
|
|
122
|
+
## Form association and disabled state
|
|
123
|
+
|
|
124
|
+
### Associating a distant `form`
|
|
125
|
+
|
|
126
|
+
Set **`form`** on **`sonic-fieldset`** to the **`id`** of a **`<form>`** elsewhere in the page (same as the native **`form`** attribute on **`<fieldset>`**). Named fields in the fieldset then belong to that form for submit and constraint validation—for example a toolbar **`form`** and a field group rendered lower on the layout.
|
|
127
|
+
|
|
50
128
|
<sonic-code>
|
|
51
129
|
<template>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<span slot="description">Description du fieldset lorem ipsum dolor</span>
|
|
58
|
-
<sonic-pop class="inline-block" slot="suffix">
|
|
59
|
-
<sonic-button shape="circle" variant="ghost">
|
|
60
|
-
<sonic-icon library="iconoir" size="lg" name="more-vert"></sonic-icon
|
|
61
|
-
></sonic-button>
|
|
62
|
-
<sonic-menu slot="content" minWidth="12rem">
|
|
63
|
-
<sonic-menu-item>Mentions légales</sonic-menu-item>
|
|
64
|
-
<sonic-menu-item>Conditions générales d'utilisation</sonic-menu-item>
|
|
65
|
-
</sonic-menu>
|
|
66
|
-
</sonic-pop>
|
|
67
|
-
</sonic-legend>
|
|
130
|
+
<div class="grid gap-4">
|
|
131
|
+
<form id="billing-form" class="flex flex-wrap items-center gap-2">
|
|
132
|
+
<sonic-button submit type="primary">Save billing</sonic-button>
|
|
133
|
+
</form>
|
|
134
|
+
<sonic-fieldset form="billing-form" label="Billing address">
|
|
68
135
|
<sonic-form-layout>
|
|
69
|
-
<sonic-input
|
|
70
|
-
<sonic-input
|
|
71
|
-
<sonic-
|
|
72
|
-
<option value="" selected="selected">- Sélectionner -</option>
|
|
73
|
-
<option value="-">Je préfère ne pas le dire</option>
|
|
74
|
-
<option value="Homme">Homme</option>
|
|
75
|
-
<option value="Femme">Femme</option>
|
|
76
|
-
</sonic-select>
|
|
77
|
-
<sonic-input autocomplete="bday" label="Date de naissance" name="date_naissance" type="date"></sonic-input>
|
|
78
|
-
<sonic-divider></sonic-divider>
|
|
79
|
-
<sonic-input autocomplete="email" label="e-mail" name="email" type="email"></sonic-input>
|
|
80
|
-
<sonic-input
|
|
81
|
-
autocomplete="email"
|
|
82
|
-
label="Confirmer votre e-mail"
|
|
83
|
-
name="email_confirmation"
|
|
84
|
-
type="email"
|
|
85
|
-
></sonic-input>
|
|
86
|
-
<sonic-input autocomplete="new-password" label="Mot de passe" name="password" type="password"></sonic-input>
|
|
87
|
-
<sonic-input
|
|
88
|
-
autocomplete="new-password"
|
|
89
|
-
label="Confirmer votre mot de passe"
|
|
90
|
-
name="password_confirmation"
|
|
91
|
-
type="password"
|
|
92
|
-
></sonic-input>
|
|
136
|
+
<sonic-input label="Street" name="street" autocomplete="street-address"></sonic-input>
|
|
137
|
+
<sonic-input label="Postal code" required name="postal_code" autocomplete="postal-code"></sonic-input>
|
|
138
|
+
<sonic-input label="City" name="city" autocomplete="address-level2"></sonic-input>
|
|
93
139
|
</sonic-form-layout>
|
|
94
140
|
</sonic-fieldset>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
141
|
+
</div>
|
|
142
|
+
</template>
|
|
143
|
+
</sonic-code>
|
|
144
|
+
|
|
145
|
+
### Disabling a group
|
|
146
|
+
|
|
147
|
+
Set **`disabled`** on **`sonic-fieldset`** to disable the inner **`<fieldset>`** and every control in the group (same as a native fieldset). Use it for read-only steps or sections gated by permissions.
|
|
148
|
+
|
|
149
|
+
<sonic-code>
|
|
150
|
+
<template>
|
|
151
|
+
<div class="grid gap-4">
|
|
152
|
+
<sonic-fieldset label="Editable">
|
|
153
|
+
<sonic-input label="Display name" name="display_name"></sonic-input>
|
|
154
|
+
</sonic-fieldset>
|
|
155
|
+
<sonic-fieldset label="Locked" disabled>
|
|
156
|
+
<sonic-input label="Account ID" name="account_id" value="acct_42"></sonic-input>
|
|
101
157
|
</sonic-fieldset>
|
|
102
|
-
<div class="">
|
|
103
|
-
<sonic-button submit type="primary">
|
|
104
|
-
<sonic-icon library="iconoir" name="check"></sonic-icon>
|
|
105
|
-
S'inscrire
|
|
106
|
-
</sonic-button>
|
|
107
|
-
<sonic-tooltip class="inline-flex" label="Vous êtes sûr(e) ? 🙄">
|
|
108
|
-
<sonic-button size="sm" variant="ghost"> Continuer sans m'inscrire </sonic-button>
|
|
109
|
-
</sonic-tooltip>
|
|
110
|
-
</div>
|
|
111
|
-
</form>
|
|
112
|
-
<div dataProvider="user_create" class="my-6 text-neutral-600 p-5 rounded-xl shadow-lg">
|
|
113
|
-
<div class="font-bold text-lg text-neutral-400">Submitted informations...</div>
|
|
114
|
-
<div class="text-lg my-2">
|
|
115
|
-
<sonic-value key="nom" class="font-bold"></sonic-value>
|
|
116
|
-
<sonic-value key="prenom"></sonic-value>
|
|
117
|
-
</div>
|
|
118
|
-
<div class="text-sm">
|
|
119
|
-
<sonic-value key="sexe"></sonic-value>
|
|
120
|
-
<sonic-value key="date_naissance"></sonic-value>
|
|
121
|
-
</div>
|
|
122
|
-
<div class="text-sm">
|
|
123
|
-
<sonic-value key="email"></sonic-value>
|
|
124
|
-
<sonic-value key="cp"></sonic-value>
|
|
125
|
-
<sonic-value key="ville"></sonic-value></div>
|
|
126
158
|
</div>
|
|
127
|
-
</sonic-div>
|
|
128
159
|
</template>
|
|
129
160
|
</sonic-code>
|
|
161
|
+
|
|
162
|
+
## Accessibility
|
|
163
|
+
|
|
164
|
+
The inner **`<fieldset>`** carries grouping semantics. **`disabled`** is applied on that element so nested controls are disabled in the usual way. **`sonic-legend`** renders a native **`<legend>`** for the group label.
|
|
165
|
+
|
|
166
|
+
## API reference
|
|
167
|
+
|
|
168
|
+
### `sonic-fieldset`
|
|
169
|
+
|
|
170
|
+
| Attribute | Values | Description |
|
|
171
|
+
|----------|---------|-------------|
|
|
172
|
+
| `variant` | `default` · `ghost` · `shadow` (default `default`) | Border and shadow treatment |
|
|
173
|
+
| `tight` | boolean | Removes horizontal padding and side borders |
|
|
174
|
+
| `label` | string | Shorthand legend title; renders **`sonic-legend`** when set |
|
|
175
|
+
| `description` | string | Shorthand legend description (HTML) |
|
|
176
|
+
| `iconName` | string | Shorthand legend icon **`name`** |
|
|
177
|
+
| `iconLibrary` | string | Shorthand legend icon **`library`** |
|
|
178
|
+
| `iconPrefix` | string | Shorthand legend icon **`prefix`** |
|
|
179
|
+
| `disabled` | boolean | Disables the native **`<fieldset>`** and its controls |
|
|
180
|
+
| `form` | string | **`id`** of an associated **`form`** |
|
|
181
|
+
| `dataProvider` | string | Subscriber key; can autofill properties that match publisher fields (e.g. **`label`**) |
|
|
182
|
+
|
|
183
|
+
| Slot | Description |
|
|
184
|
+
|------|-------------|
|
|
185
|
+
| *(default)* | Legend (optional) and field group content in visual order |
|
|
186
|
+
|
|
187
|
+
### `sonic-legend`
|
|
188
|
+
|
|
189
|
+
| Attribute | Values | Description |
|
|
190
|
+
|----------|---------|-------------|
|
|
191
|
+
| `label` | string | Title HTML when not using the default slot |
|
|
192
|
+
| `description` | string | Description HTML (wrapped in **`sonic-legend-description`**) |
|
|
193
|
+
| `iconName` | string | Leading **`sonic-icon`** **`name`** |
|
|
194
|
+
| `iconLibrary` | string | Icon **`library`** |
|
|
195
|
+
| `iconPrefix` | string | Icon **`prefix`** |
|
|
196
|
+
| `forceAutoFill` | boolean | Allows Subscriber autofill to override attribute-backed **`label`** / **`description`** |
|
|
197
|
+
|
|
198
|
+
| Slot | Description |
|
|
199
|
+
|------|-------------|
|
|
200
|
+
| *(default)* | Legend title and description components |
|
|
201
|
+
| `suffix` | Trailing actions (menus, icon buttons) |
|
|
202
|
+
|
|
203
|
+
### `sonic-legend-description`
|
|
204
|
+
|
|
205
|
+
Muted description line below the legend title. No attributes—project content through the **default slot**.
|
|
@@ -11,19 +11,18 @@ export class Fieldset extends Subscriber(LitElement) {
|
|
|
11
11
|
static styles = [
|
|
12
12
|
css`
|
|
13
13
|
:host {
|
|
14
|
-
--sc-
|
|
15
|
-
--sc-
|
|
16
|
-
--sc-
|
|
17
|
-
--sc-
|
|
18
|
-
--sc-
|
|
19
|
-
--sc-
|
|
14
|
+
--sc-_mt: 0;
|
|
15
|
+
--sc-_mb: 1rem;
|
|
16
|
+
--sc-_border-color: var(--sc-border-color);
|
|
17
|
+
--sc-_border-width: var(--sc-form-border-width);
|
|
18
|
+
--sc-_px: 1.25rem;
|
|
19
|
+
--sc-_py: 1.8rem;
|
|
20
20
|
|
|
21
|
-
margin-top: var(--sc-
|
|
22
|
-
margin-bottom: var(--sc-
|
|
21
|
+
margin-top: var(--sc-_mt);
|
|
22
|
+
margin-bottom: var(--sc-_mb);
|
|
23
23
|
display: block;
|
|
24
|
-
border: var(--sc-
|
|
25
|
-
|
|
26
|
-
padding: var(--sc-fieldset-py) var(--sc-fieldset-px);
|
|
24
|
+
border: var(--sc-_border-width) solid var(--sc-_border-color) !important;
|
|
25
|
+
padding: var(--sc-_py) var(--sc-_px);
|
|
27
26
|
border-radius: var(--sc-rounded-lg);
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -34,15 +33,14 @@ export class Fieldset extends Subscriber(LitElement) {
|
|
|
34
33
|
|
|
35
34
|
:host([variant="shadow"]),
|
|
36
35
|
:host([variant="ghost"]) {
|
|
37
|
-
--sc-
|
|
36
|
+
--sc-_border-color: transparent;
|
|
38
37
|
}
|
|
39
38
|
:host([variant="shadow"]) {
|
|
40
|
-
--sc-fieldset-border-color: transparent;
|
|
41
39
|
box-shadow: var(--sc-shadow-lg);
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
:host([tight]) {
|
|
45
|
-
--sc-
|
|
43
|
+
--sc-_px: 0;
|
|
46
44
|
border-left: none !important;
|
|
47
45
|
border-right: none !important;
|
|
48
46
|
border-radius: 0;
|
|
@@ -61,15 +59,7 @@ export class Fieldset extends Subscriber(LitElement) {
|
|
|
61
59
|
`,
|
|
62
60
|
];
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Désactiver le fieldset
|
|
68
|
-
*/
|
|
69
|
-
@property({ type: Boolean, reflect: true }) disabled: true | false = false;
|
|
70
|
-
/**
|
|
71
|
-
* Lier à un formulaire qui ne serait pas parent du fieldset
|
|
72
|
-
*/
|
|
62
|
+
@property({ type: Boolean, reflect: true }) disabled = false;
|
|
73
63
|
@property({ type: String }) form?: string;
|
|
74
64
|
|
|
75
65
|
@property({ type: String }) label?: string;
|
|
@@ -86,12 +76,9 @@ export class Fieldset extends Subscriber(LitElement) {
|
|
|
86
76
|
| "shadow" = "default";
|
|
87
77
|
|
|
88
78
|
render() {
|
|
89
|
-
return html`<fieldset
|
|
90
|
-
form="${ifDefined(this.form)}"
|
|
91
|
-
?disabled="${this.disabled}"
|
|
92
|
-
>
|
|
79
|
+
return html`<fieldset form="${ifDefined(this.form)}" ?disabled="${this.disabled}">
|
|
93
80
|
${this.label
|
|
94
|
-
? html
|
|
81
|
+
? html`<sonic-legend
|
|
95
82
|
label=${ifDefined(this.label)}
|
|
96
83
|
description=${ifDefined(this.description)}
|
|
97
84
|
iconName=${ifDefined(this.iconName)}
|
|
@@ -11,15 +11,15 @@ export class Legend extends LitElement {
|
|
|
11
11
|
static styles = [
|
|
12
12
|
css`
|
|
13
13
|
:host {
|
|
14
|
-
--sc-
|
|
15
|
-
--sc-
|
|
16
|
-
--sc-
|
|
17
|
-
--sc-
|
|
14
|
+
--sc-_font-size: 1.25rem;
|
|
15
|
+
--sc-_font-weight: var(--sc-font-weight-base, 400);
|
|
16
|
+
--sc-_font-style: var(--sc-headings-font-style, normal);
|
|
17
|
+
--sc-_font-family: var(
|
|
18
18
|
--sc-headings-font-family,
|
|
19
19
|
var(--sc-font-family-base, sans-serif)
|
|
20
20
|
);
|
|
21
|
-
--sc-
|
|
22
|
-
--sc-
|
|
21
|
+
--sc-_line-height: var(--sc-headings-line-height, 1.1);
|
|
22
|
+
--sc-_color: var(--sc-base-content, #000);
|
|
23
23
|
display: flex;
|
|
24
24
|
width: 100%;
|
|
25
25
|
container-type: inline-size;
|
|
@@ -27,16 +27,16 @@ export class Legend extends LitElement {
|
|
|
27
27
|
|
|
28
28
|
@container (max-inline-size: 28rem) {
|
|
29
29
|
legend {
|
|
30
|
-
--sc-
|
|
30
|
+
--sc-_font-size: 1.3rem;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
legend {
|
|
34
|
-
font-size: var(--sc-
|
|
35
|
-
font-weight: var(--sc-
|
|
36
|
-
font-style: var(--sc-
|
|
37
|
-
font-family: var(--sc-
|
|
38
|
-
line-height: var(--sc-
|
|
39
|
-
color: var(--sc-
|
|
34
|
+
font-size: var(--sc-_font-size);
|
|
35
|
+
font-weight: var(--sc-_font-weight);
|
|
36
|
+
font-style: var(--sc-_font-style);
|
|
37
|
+
font-family: var(--sc-_font-family);
|
|
38
|
+
line-height: var(--sc-_line-height);
|
|
39
|
+
color: var(--sc-_color);
|
|
40
40
|
padding: 0;
|
|
41
41
|
display: flex;
|
|
42
42
|
width: 100%;
|