@sebgroup/green-core 3.27.0 → 3.29.0-rc.20261012203419455
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/components/checkbox/checkbox-group/checkbox-group.component.d.ts +9 -1
- package/components/checkbox/checkbox-group/checkbox-group.component.js +15 -9
- package/components/checkbox/checkbox-group/checkbox-group.styles.js +7 -16
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/progress/index.d.ts +1 -0
- package/components/progress/index.js +1 -0
- package/components/progress/progress.component.d.ts +67 -0
- package/components/progress/progress.component.js +172 -0
- package/components/progress/progress.d.ts +2 -0
- package/components/progress/progress.js +6 -0
- package/components/progress/progress.styles.d.ts +2 -0
- package/components/progress/progress.styles.js +175 -0
- package/components/radio/radio-group/radio-group.component.d.ts +9 -1
- package/components/radio/radio-group/radio-group.component.js +15 -10
- package/components/radio/radio-group/radio-group.styles.js +7 -16
- package/components/rich-text/rich-text.component.js +7 -3
- package/custom-elements.json +25317 -24382
- package/gds-element.js +1 -1
- package/generated/mcp/checkbox-group/api.md +2 -1
- package/generated/mcp/components.json +13 -1
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/progress/angular.md +15 -0
- package/generated/mcp/progress/api.md +41 -0
- package/generated/mcp/progress/index.json +8 -0
- package/generated/mcp/progress/react.md +15 -0
- package/generated/mcp/radio-group/api.md +2 -1
- package/generated/mcp/tokens.json +1 -1
- package/generated/react/checkbox-group/index.d.ts +2 -1
- package/generated/react/index.d.ts +7 -6
- package/generated/react/index.js +7 -6
- package/generated/react/progress/index.d.ts +701 -0
- package/generated/react/progress/index.js +14 -0
- package/generated/react/radio-group/index.d.ts +2 -1
- package/package.json +3 -1
- package/pure.d.ts +1 -0
- package/pure.js +1 -0
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -7,10 +7,18 @@ declare class CheckboxGroup extends GdsFormControlElement<string[]> {
|
|
|
7
7
|
* Controls the font-size of label and supporting text on group form control header and single checkbox buttons respectively.
|
|
8
8
|
*/
|
|
9
9
|
size: 'large' | 'small';
|
|
10
|
+
/**
|
|
11
|
+
* Style Expression Property that controls the `flex-direction` property of
|
|
12
|
+
* the checkbox list. Supports all valid CSS `flex-direction` values.
|
|
13
|
+
*/
|
|
14
|
+
'flex-direction'?: string;
|
|
10
15
|
/**
|
|
11
16
|
* The flex-direction in which checkbox buttons are displayed.
|
|
17
|
+
*
|
|
18
|
+
* @deprecated Use `flex-direction` instead.
|
|
12
19
|
*/
|
|
13
|
-
flexDirection:
|
|
20
|
+
get flexDirection(): string | undefined;
|
|
21
|
+
set flexDirection(value: string | undefined);
|
|
14
22
|
/**
|
|
15
23
|
* Whether to hide the label for the checkbox group. Usable if you want a single checkbox to act as the label.
|
|
16
24
|
*/
|
|
@@ -13,6 +13,7 @@ import { GdsFormControlHeader } from "../../../primitives/form-control-header/fo
|
|
|
13
13
|
import { gdsCustomElement, html } from "../../../scoping.js";
|
|
14
14
|
import { observeLightDOM } from "../../../utils/decorators/index.js";
|
|
15
15
|
import { ariaForwarding } from "../../../utils/decorators/aria-forwarding.js";
|
|
16
|
+
import { styleExpressionProperty } from "../../../utils/decorators/style-expression-property.js";
|
|
16
17
|
import { watch } from "../../../utils/decorators/watch.js";
|
|
17
18
|
import {
|
|
18
19
|
withLayoutChildProps,
|
|
@@ -26,7 +27,6 @@ let CheckboxGroup = class extends GdsFormControlElement {
|
|
|
26
27
|
super(...arguments);
|
|
27
28
|
__privateAdd(this, _CheckboxGroup_instances);
|
|
28
29
|
this.size = "large";
|
|
29
|
-
this.flexDirection = "column";
|
|
30
30
|
this.hideLabel = false;
|
|
31
31
|
this.supportingText = "";
|
|
32
32
|
this.showExtendedSupportingText = false;
|
|
@@ -38,6 +38,17 @@ let CheckboxGroup = class extends GdsFormControlElement {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* The flex-direction in which checkbox buttons are displayed.
|
|
43
|
+
*
|
|
44
|
+
* @deprecated Use `flex-direction` instead.
|
|
45
|
+
*/
|
|
46
|
+
get flexDirection() {
|
|
47
|
+
return this["flex-direction"];
|
|
48
|
+
}
|
|
49
|
+
set flexDirection(value) {
|
|
50
|
+
this["flex-direction"] = value;
|
|
51
|
+
}
|
|
41
52
|
get value() {
|
|
42
53
|
return this._internalValue || [];
|
|
43
54
|
}
|
|
@@ -73,15 +84,10 @@ let CheckboxGroup = class extends GdsFormControlElement {
|
|
|
73
84
|
this.addEventListener("gds-validity-state", __privateGet(this, _syncCheckboxes));
|
|
74
85
|
}
|
|
75
86
|
render() {
|
|
76
|
-
const classes = {
|
|
77
|
-
"checkbox-group": true,
|
|
78
|
-
"direction-row": this.flexDirection === "row",
|
|
79
|
-
"direction-column": this.flexDirection === "column"
|
|
80
|
-
};
|
|
81
87
|
return html`<div
|
|
82
88
|
role="group"
|
|
83
89
|
id="checkboxgroup"
|
|
84
|
-
class
|
|
90
|
+
class="checkbox-group"
|
|
85
91
|
aria-labelledby="group-label"
|
|
86
92
|
aria-describedby="supporting-text extended-supporting-text footer"
|
|
87
93
|
aria-invalid=${this.invalid}
|
|
@@ -162,8 +168,8 @@ __decorateClass([
|
|
|
162
168
|
property()
|
|
163
169
|
], CheckboxGroup.prototype, "size", 2);
|
|
164
170
|
__decorateClass([
|
|
165
|
-
|
|
166
|
-
], CheckboxGroup.prototype, "
|
|
171
|
+
styleExpressionProperty({ selector: ".content" })
|
|
172
|
+
], CheckboxGroup.prototype, "flex-direction", 2);
|
|
167
173
|
__decorateClass([
|
|
168
174
|
property({ type: Boolean, attribute: "hide-label" })
|
|
169
175
|
], CheckboxGroup.prototype, "hideLabel", 2);
|
|
@@ -38,27 +38,18 @@ const styles = css`
|
|
|
38
38
|
|
|
39
39
|
.content {
|
|
40
40
|
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
flex-wrap: wrap;
|
|
43
|
+
/* row-gap/column-gap set once: the browser only renders whichever axis the
|
|
44
|
+
resolved flex-direction actually uses, so this reproduces the former
|
|
45
|
+
per-direction gap values without needing to key off direction. */
|
|
46
|
+
gap: var(--gds-sys-space-s) var(--gds-sys-space-xl);
|
|
41
47
|
position: relative;
|
|
42
48
|
max-width: max-content;
|
|
43
49
|
color: var(--_checkbox-label-color);
|
|
44
50
|
}
|
|
45
51
|
|
|
46
|
-
|
|
47
|
-
flex-direction: row;
|
|
48
|
-
flex-wrap: wrap;
|
|
49
|
-
gap: var(--gds-sys-space-s) var(--gds-sys-space-xl);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.direction-column .content {
|
|
53
|
-
flex-direction: column;
|
|
54
|
-
gap: var(--gds-sys-space-s);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
:host([size='small']) .direction-column .content {
|
|
58
|
-
gap: var(--gds-sys-space-xs);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
:host([size='small']) .direction-row .content {
|
|
52
|
+
:host([size='small']) .content {
|
|
62
53
|
gap: var(--gds-sys-space-xs) var(--gds-sys-space-m);
|
|
63
54
|
}
|
|
64
55
|
|
package/components/index.d.ts
CHANGED
package/components/index.js
CHANGED
|
@@ -34,6 +34,7 @@ export * from "./mask/index.js";
|
|
|
34
34
|
export * from "./menu-button/index.js";
|
|
35
35
|
export * from "./pagination/index.js";
|
|
36
36
|
export * from "./popover/index.js";
|
|
37
|
+
export * from "./progress/index.js";
|
|
37
38
|
export * from "./radio/index.js";
|
|
38
39
|
export * from "./rich-text/index.js";
|
|
39
40
|
export * from "./segmented-control/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './progress';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./progress.js";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { GdsElement } from '../../gds-element';
|
|
2
|
+
export type GdsProgressVariant = 'information' | 'positive' | 'negative';
|
|
3
|
+
declare class Progress extends GdsElement {
|
|
4
|
+
#private;
|
|
5
|
+
static styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
|
|
6
|
+
/**
|
|
7
|
+
* The accessible label for the progress bar. Also rendered as visible text
|
|
8
|
+
* unless `plain` is set.
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* The current progress, expressed on a scale from 0 to `max`.
|
|
13
|
+
*/
|
|
14
|
+
value: number;
|
|
15
|
+
/**
|
|
16
|
+
* The upper bound of the progress scale. Values of 0 or less fall back to 100.
|
|
17
|
+
*/
|
|
18
|
+
max: number;
|
|
19
|
+
/**
|
|
20
|
+
* Visual state of the progress bar. `positive` and `negative` also swap the
|
|
21
|
+
* trailing value text for a status icon.
|
|
22
|
+
*/
|
|
23
|
+
variant: GdsProgressVariant;
|
|
24
|
+
/**
|
|
25
|
+
* Controls the font-size of texts and the track height.
|
|
26
|
+
*/
|
|
27
|
+
size: 'large' | 'small';
|
|
28
|
+
/**
|
|
29
|
+
* Style Expression Property that controls the `flex-direction` property.
|
|
30
|
+
* Supports all valid CSS `flex-direction` values. Use `column-reverse` to
|
|
31
|
+
* place the label row below the bar.
|
|
32
|
+
*/
|
|
33
|
+
'flex-direction'?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Renders an animated, non-measurable progress bar. The native `<progress>`
|
|
36
|
+
* element is left without a value, so assistive tech announces it as
|
|
37
|
+
* indeterminate.
|
|
38
|
+
*/
|
|
39
|
+
indeterminate: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Hides the label row, while still keeping the accessible label.
|
|
42
|
+
*/
|
|
43
|
+
plain: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Hides the trailing text and status icon.
|
|
46
|
+
*/
|
|
47
|
+
hideValue: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Text rendered at the end of the label row, in place of the automatically
|
|
50
|
+
* formatted percentage or the status icon.
|
|
51
|
+
*/
|
|
52
|
+
trail?: string;
|
|
53
|
+
private _currentLocale;
|
|
54
|
+
connectedCallback(): void;
|
|
55
|
+
disconnectedCallback(): void;
|
|
56
|
+
render(): any;
|
|
57
|
+
}
|
|
58
|
+
declare const GdsProgress_base: (new (...args: any[]) => import("../../utils/mixins/declarative-layout-mixins").SizeXProps) & (new (...args: any[]) => import("../../utils/mixins/declarative-layout-mixins").MarginProps) & (new (...args: any[]) => import("../../utils/mixins/declarative-layout-mixins").LayoutChildProps) & typeof Progress;
|
|
59
|
+
/**
|
|
60
|
+
* @element gds-progress
|
|
61
|
+
* @status beta
|
|
62
|
+
*
|
|
63
|
+
* @summary A progress bar built on the native `<progress>` element.
|
|
64
|
+
*/
|
|
65
|
+
export declare class GdsProgress extends GdsProgress_base {
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__decorateClass,
|
|
3
|
+
__privateAdd,
|
|
4
|
+
__privateGet,
|
|
5
|
+
__privateMethod
|
|
6
|
+
} from "../../chunks/chunk.H2T4A5YY.js";
|
|
7
|
+
var _handleLocaleStatus, _Progress_instances, percent_fn, displayValue_fn, renderTrail_fn;
|
|
8
|
+
import { localized, msg } from "@lit/localize";
|
|
9
|
+
import { property, state } from "lit/decorators.js";
|
|
10
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
|
+
import { when } from "lit/directives/when.js";
|
|
12
|
+
import { GdsElement } from "../../gds-element.js";
|
|
13
|
+
import { gdsCustomElement, html } from "../../scoping.js";
|
|
14
|
+
import { tokens } from "../../tokens.style.js";
|
|
15
|
+
import { ariaForwarding } from "../../utils/decorators/aria-forwarding.js";
|
|
16
|
+
import { styleExpressionProperty } from "../../utils/decorators/style-expression-property.js";
|
|
17
|
+
import {
|
|
18
|
+
withLayoutChildProps,
|
|
19
|
+
withMarginProps,
|
|
20
|
+
withSizeXProps
|
|
21
|
+
} from "../../utils/mixins/declarative-layout-mixins.js";
|
|
22
|
+
import { IconCircleCheck } from "../icon/icons/circle-check.component.js";
|
|
23
|
+
import { IconCircleX } from "../icon/icons/circle-x.component.js";
|
|
24
|
+
import ProgressStyles from "./progress.styles.js";
|
|
25
|
+
let Progress = class extends GdsElement {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
__privateAdd(this, _Progress_instances);
|
|
29
|
+
this.label = "";
|
|
30
|
+
this.value = 0;
|
|
31
|
+
this.max = 100;
|
|
32
|
+
this.variant = "information";
|
|
33
|
+
this.size = "large";
|
|
34
|
+
this.indeterminate = false;
|
|
35
|
+
this.plain = false;
|
|
36
|
+
this.hideValue = false;
|
|
37
|
+
this._currentLocale = navigator.language;
|
|
38
|
+
__privateAdd(this, _handleLocaleStatus, (e) => {
|
|
39
|
+
const detail = e.detail;
|
|
40
|
+
if (detail?.status === "ready") this._currentLocale = detail.readyLocale;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
connectedCallback() {
|
|
44
|
+
super.connectedCallback();
|
|
45
|
+
window.addEventListener("lit-localize-status", __privateGet(this, _handleLocaleStatus));
|
|
46
|
+
}
|
|
47
|
+
disconnectedCallback() {
|
|
48
|
+
super.disconnectedCallback();
|
|
49
|
+
window.removeEventListener("lit-localize-status", __privateGet(this, _handleLocaleStatus));
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const percent = __privateMethod(this, _Progress_instances, percent_fn).call(this);
|
|
53
|
+
return html`
|
|
54
|
+
${when(
|
|
55
|
+
this.plain,
|
|
56
|
+
() => html`<span id="label" class="visually-hidden">${this.label}</span>`,
|
|
57
|
+
() => html`
|
|
58
|
+
<div id="label-row">
|
|
59
|
+
<span id="label">${this.label}</span>
|
|
60
|
+
${__privateMethod(this, _Progress_instances, renderTrail_fn).call(this)}
|
|
61
|
+
</div>
|
|
62
|
+
`
|
|
63
|
+
)}
|
|
64
|
+
|
|
65
|
+
<div id="track">
|
|
66
|
+
<progress
|
|
67
|
+
id="control"
|
|
68
|
+
max=${percent.max}
|
|
69
|
+
value=${ifDefined(this.indeterminate ? void 0 : percent.value)}
|
|
70
|
+
aria-labelledby=${ifDefined(this.label ? "label" : void 0)}
|
|
71
|
+
aria-valuetext=${ifDefined(__privateMethod(this, _Progress_instances, displayValue_fn).call(this))}
|
|
72
|
+
></progress>
|
|
73
|
+
${when(
|
|
74
|
+
this.indeterminate,
|
|
75
|
+
() => html`<div id="indeterminate-fill" aria-hidden="true"></div>`
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
_handleLocaleStatus = new WeakMap();
|
|
82
|
+
_Progress_instances = new WeakSet();
|
|
83
|
+
percent_fn = function() {
|
|
84
|
+
const max = this.max > 0 ? this.max : 100;
|
|
85
|
+
const value = Math.max(0, Math.min(max, this.value));
|
|
86
|
+
return { value, max, ratio: value / max };
|
|
87
|
+
};
|
|
88
|
+
// Indeterminate progress has no meaningful value to announce, so no valuetext is set.
|
|
89
|
+
displayValue_fn = function() {
|
|
90
|
+
if (this.trail) return this.trail;
|
|
91
|
+
if (this.indeterminate) return void 0;
|
|
92
|
+
return new Intl.NumberFormat(this._currentLocale, {
|
|
93
|
+
style: "percent"
|
|
94
|
+
}).format(__privateMethod(this, _Progress_instances, percent_fn).call(this).ratio);
|
|
95
|
+
};
|
|
96
|
+
renderTrail_fn = function() {
|
|
97
|
+
if (this.hideValue) return null;
|
|
98
|
+
if (this.trail) return html`<span id="trail">${this.trail}</span>`;
|
|
99
|
+
if (this.indeterminate) return null;
|
|
100
|
+
const iconSize = this.size === "small" ? "s" : "m";
|
|
101
|
+
return when(
|
|
102
|
+
this.variant === "positive",
|
|
103
|
+
() => html`<gds-icon-circle-check
|
|
104
|
+
class="status-icon"
|
|
105
|
+
solid
|
|
106
|
+
size=${iconSize}
|
|
107
|
+
label=${msg("Completed")}
|
|
108
|
+
></gds-icon-circle-check>`,
|
|
109
|
+
() => when(
|
|
110
|
+
this.variant === "negative",
|
|
111
|
+
() => html`<gds-icon-circle-x
|
|
112
|
+
class="status-icon"
|
|
113
|
+
solid
|
|
114
|
+
size=${iconSize}
|
|
115
|
+
label=${msg("Failed")}
|
|
116
|
+
></gds-icon-circle-x>`,
|
|
117
|
+
() => html`<span id="trail">${__privateMethod(this, _Progress_instances, displayValue_fn).call(this)}</span>`
|
|
118
|
+
)
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
Progress.styles = [tokens, ProgressStyles];
|
|
122
|
+
__decorateClass([
|
|
123
|
+
property()
|
|
124
|
+
], Progress.prototype, "label", 2);
|
|
125
|
+
__decorateClass([
|
|
126
|
+
property({ type: Number })
|
|
127
|
+
], Progress.prototype, "value", 2);
|
|
128
|
+
__decorateClass([
|
|
129
|
+
property({ type: Number })
|
|
130
|
+
], Progress.prototype, "max", 2);
|
|
131
|
+
__decorateClass([
|
|
132
|
+
property({ reflect: true })
|
|
133
|
+
], Progress.prototype, "variant", 2);
|
|
134
|
+
__decorateClass([
|
|
135
|
+
property({ reflect: true })
|
|
136
|
+
], Progress.prototype, "size", 2);
|
|
137
|
+
__decorateClass([
|
|
138
|
+
styleExpressionProperty()
|
|
139
|
+
], Progress.prototype, "flex-direction", 2);
|
|
140
|
+
__decorateClass([
|
|
141
|
+
property({ type: Boolean, reflect: true })
|
|
142
|
+
], Progress.prototype, "indeterminate", 2);
|
|
143
|
+
__decorateClass([
|
|
144
|
+
property({ type: Boolean, reflect: true })
|
|
145
|
+
], Progress.prototype, "plain", 2);
|
|
146
|
+
__decorateClass([
|
|
147
|
+
property({ type: Boolean, reflect: true, attribute: "hide-value" })
|
|
148
|
+
], Progress.prototype, "hideValue", 2);
|
|
149
|
+
__decorateClass([
|
|
150
|
+
property()
|
|
151
|
+
], Progress.prototype, "trail", 2);
|
|
152
|
+
__decorateClass([
|
|
153
|
+
state()
|
|
154
|
+
], Progress.prototype, "_currentLocale", 2);
|
|
155
|
+
Progress = __decorateClass([
|
|
156
|
+
localized(),
|
|
157
|
+
ariaForwarding({
|
|
158
|
+
labelledBy: "#control"
|
|
159
|
+
})
|
|
160
|
+
], Progress);
|
|
161
|
+
let GdsProgress = class extends withSizeXProps(
|
|
162
|
+
withMarginProps(withLayoutChildProps(Progress))
|
|
163
|
+
) {
|
|
164
|
+
};
|
|
165
|
+
GdsProgress = __decorateClass([
|
|
166
|
+
gdsCustomElement("gds-progress", {
|
|
167
|
+
dependsOn: [IconCircleCheck, IconCircleX]
|
|
168
|
+
})
|
|
169
|
+
], GdsProgress);
|
|
170
|
+
export {
|
|
171
|
+
GdsProgress
|
|
172
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import "../../chunks/chunk.H2T4A5YY.js";
|
|
2
|
+
import { css } from "lit";
|
|
3
|
+
const styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
--_track-bg: var(--gds-sys-color-l3-neutral-02);
|
|
6
|
+
--_fill-color: var(--gds-sys-color-l3-neutral-03);
|
|
7
|
+
--_label-color: var(--gds-sys-color-content-neutral-01);
|
|
8
|
+
--_track-height: var(--gds-sys-space-3xs);
|
|
9
|
+
--_font: var(--gds-sys-text-detail-s-regular);
|
|
10
|
+
--_icon-size: var(--gds-sys-space-m);
|
|
11
|
+
--_row-gap: var(--gds-sys-space-xs);
|
|
12
|
+
--_label-gap: var(--gds-sys-space-s);
|
|
13
|
+
--_indeterminate-inset: 88%;
|
|
14
|
+
--_indeterminate-duration: 2.1s;
|
|
15
|
+
--_indeterminate-easing-lead: cubic-bezier(0.2, 0, 0.3, 1);
|
|
16
|
+
--_indeterminate-easing-trail: cubic-bezier(0.7, 0, 0.8, 1);
|
|
17
|
+
--_t-easing-out: cubic-bezier(var(--gds-sys-motion-easing-ease-out));
|
|
18
|
+
--_t-duration: var(--gds-sys-motion-duration-fast);
|
|
19
|
+
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: var(--_row-gap);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([size='small']) {
|
|
26
|
+
--_font: var(--gds-sys-text-detail-xs-regular);
|
|
27
|
+
--_icon-size: var(--gds-sys-space-s);
|
|
28
|
+
--_row-gap: var(--gds-sys-space-2xs);
|
|
29
|
+
--_label-gap: var(--gds-sys-space-xs);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([variant='positive']) {
|
|
33
|
+
--_fill-color: var(--gds-sys-color-content-positive-01);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host([variant='negative']) {
|
|
37
|
+
--_fill-color: var(--gds-sys-color-content-negative-01);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.visually-hidden {
|
|
41
|
+
border: 0;
|
|
42
|
+
clip: rect(0 0 0 0);
|
|
43
|
+
height: 1px;
|
|
44
|
+
margin: -1px;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
padding: 0;
|
|
47
|
+
position: absolute;
|
|
48
|
+
width: 1px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#label-row {
|
|
52
|
+
align-items: center;
|
|
53
|
+
display: flex;
|
|
54
|
+
font: var(--_font);
|
|
55
|
+
gap: var(--_label-gap);
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
min-height: var(--_icon-size);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#label {
|
|
61
|
+
color: var(--_label-color);
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
text-overflow: ellipsis;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#trail {
|
|
68
|
+
color: var(--_label-color);
|
|
69
|
+
flex: none;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.status-icon {
|
|
74
|
+
display: block;
|
|
75
|
+
flex: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([variant='positive']) .status-icon {
|
|
79
|
+
color: var(--gds-sys-color-content-positive-01);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([variant='negative']) .status-icon {
|
|
83
|
+
color: var(--gds-sys-color-content-negative-01);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#track {
|
|
87
|
+
border-radius: var(--gds-sys-radius-max);
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
position: relative;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
progress {
|
|
93
|
+
-webkit-appearance: none;
|
|
94
|
+
appearance: none;
|
|
95
|
+
background: var(--_track-bg);
|
|
96
|
+
border: none;
|
|
97
|
+
border-radius: var(--gds-sys-radius-max);
|
|
98
|
+
display: block;
|
|
99
|
+
height: var(--_track-height);
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
width: 100%;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
progress::-webkit-progress-bar {
|
|
105
|
+
background: var(--_track-bg);
|
|
106
|
+
border-radius: var(--gds-sys-radius-max);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
progress::-webkit-progress-value {
|
|
110
|
+
background: var(--_fill-color);
|
|
111
|
+
border-radius: var(--gds-sys-radius-max);
|
|
112
|
+
transition: inline-size var(--_t-duration) var(--_t-easing-out);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
progress::-moz-progress-bar {
|
|
116
|
+
background: var(--_fill-color);
|
|
117
|
+
border-radius: var(--gds-sys-radius-max);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Painted as a sibling of the native element rather than on it: an indeterminate
|
|
121
|
+
<progress> exposes no value pseudo-element in Chromium. Insets are animated
|
|
122
|
+
rather than transforms so the pill radius isn't squashed by scaling.
|
|
123
|
+
|
|
124
|
+
The two edges run as separate animations over the same span, so neither is ever
|
|
125
|
+
parked while the other catches up. The leading edge pulls away while the trailing
|
|
126
|
+
edge lags, which stretches the bar mid-track and collapses it against each end.
|
|
127
|
+
|
|
128
|
+
Both curves are shaped y1=0 / y2=1, so each edge starts and ends at zero velocity.
|
|
129
|
+
That matters because alternating mirrors the curve: any residual speed at the
|
|
130
|
+
turnaround would flip sign instantly and read as a hard bounce. The difference
|
|
131
|
+
between the curves is where the motion happens, not how it starts or stops. */
|
|
132
|
+
#indeterminate-fill {
|
|
133
|
+
animation:
|
|
134
|
+
gds-progress-indeterminate-head var(--_indeterminate-duration) infinite
|
|
135
|
+
alternate var(--_indeterminate-easing-lead),
|
|
136
|
+
gds-progress-indeterminate-tail var(--_indeterminate-duration) infinite
|
|
137
|
+
alternate var(--_indeterminate-easing-trail);
|
|
138
|
+
background: var(--_fill-color);
|
|
139
|
+
border-radius: var(--gds-sys-radius-max);
|
|
140
|
+
inset-block: 0;
|
|
141
|
+
position: absolute;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@keyframes gds-progress-indeterminate-head {
|
|
145
|
+
from {
|
|
146
|
+
inset-inline-end: var(--_indeterminate-inset);
|
|
147
|
+
}
|
|
148
|
+
to {
|
|
149
|
+
inset-inline-end: 0%;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@keyframes gds-progress-indeterminate-tail {
|
|
154
|
+
from {
|
|
155
|
+
inset-inline-start: 0%;
|
|
156
|
+
}
|
|
157
|
+
to {
|
|
158
|
+
inset-inline-start: var(--_indeterminate-inset);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@media (prefers-reduced-motion: reduce) {
|
|
163
|
+
progress::-webkit-progress-value {
|
|
164
|
+
transition: none;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host {
|
|
168
|
+
--_indeterminate-duration: 4s;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
`;
|
|
172
|
+
var progress_styles_default = styles;
|
|
173
|
+
export {
|
|
174
|
+
progress_styles_default as default
|
|
175
|
+
};
|
|
@@ -7,10 +7,18 @@ declare class RadioGroup extends GdsFormControlElement<string | boolean> {
|
|
|
7
7
|
* Controls the font-size of label and supporting text on group form control header and single radio buttons respectively.
|
|
8
8
|
*/
|
|
9
9
|
size: 'large' | 'small';
|
|
10
|
+
/**
|
|
11
|
+
* Style Expression Property that controls the `flex-direction` property of
|
|
12
|
+
* the radio list. Supports all valid CSS `flex-direction` values.
|
|
13
|
+
*/
|
|
14
|
+
'flex-direction'?: string;
|
|
10
15
|
/**
|
|
11
16
|
* The flex-direction in which radio buttons are displayed.
|
|
17
|
+
*
|
|
18
|
+
* @deprecated Use `flex-direction` instead.
|
|
12
19
|
*/
|
|
13
|
-
flexDirection:
|
|
20
|
+
get flexDirection(): string | undefined;
|
|
21
|
+
set flexDirection(value: string | undefined);
|
|
14
22
|
/**
|
|
15
23
|
* The supporting text displayed between the label and the field.
|
|
16
24
|
* This text provides additional context or information to the user.
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
var _RadioGroup_instances, initializeFocusable_fn, handleFocus_fn, dispatchChangeEvents_fn, handleRadioChange_fn, handleKeyDown_fn, focusAndSelectRadio_fn, renderRadioGroupContents_fn, renderFieldControlHeader_fn, renderRadios_fn, renderFieldControlFooter_fn;
|
|
7
7
|
import { localized } from "@lit/localize";
|
|
8
8
|
import { property, query } from "lit/decorators.js";
|
|
9
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
10
9
|
import { GdsFormControlFooter } from "../../../primitives/form-control-footer/form-control-footer.component.js";
|
|
11
10
|
import { GdsFormControlHeader } from "../../../primitives/form-control-header/form-control-header.component.js";
|
|
12
11
|
import { gdsCustomElement, html } from "../../../scoping.js";
|
|
13
12
|
import { tokens } from "../../../tokens.style.js";
|
|
14
13
|
import { ariaForwarding } from "../../../utils/decorators/aria-forwarding.js";
|
|
14
|
+
import { styleExpressionProperty } from "../../../utils/decorators/style-expression-property.js";
|
|
15
15
|
import { watch } from "../../../utils/decorators/watch.js";
|
|
16
16
|
import {
|
|
17
17
|
withLayoutChildProps,
|
|
@@ -25,11 +25,21 @@ let RadioGroup = class extends GdsFormControlElement {
|
|
|
25
25
|
super(...arguments);
|
|
26
26
|
__privateAdd(this, _RadioGroup_instances);
|
|
27
27
|
this.size = "large";
|
|
28
|
-
this.flexDirection = "column";
|
|
29
28
|
this.supportingText = "";
|
|
30
29
|
this.showExtendedSupportingText = false;
|
|
31
30
|
this._isConnected = false;
|
|
32
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* The flex-direction in which radio buttons are displayed.
|
|
34
|
+
*
|
|
35
|
+
* @deprecated Use `flex-direction` instead.
|
|
36
|
+
*/
|
|
37
|
+
get flexDirection() {
|
|
38
|
+
return this["flex-direction"];
|
|
39
|
+
}
|
|
40
|
+
set flexDirection(value) {
|
|
41
|
+
this["flex-direction"] = value;
|
|
42
|
+
}
|
|
33
43
|
/**
|
|
34
44
|
* Returns an array of `<gds-radio>` elements in the radio group.
|
|
35
45
|
*
|
|
@@ -80,15 +90,10 @@ let RadioGroup = class extends GdsFormControlElement {
|
|
|
80
90
|
});
|
|
81
91
|
}
|
|
82
92
|
render() {
|
|
83
|
-
const classes = {
|
|
84
|
-
"radio-group": true,
|
|
85
|
-
"direction-row": this.flexDirection === "row",
|
|
86
|
-
"direction-column": this.flexDirection === "column"
|
|
87
|
-
};
|
|
88
93
|
return html`<div
|
|
89
94
|
role="radiogroup"
|
|
90
95
|
id="radiogroup"
|
|
91
|
-
class
|
|
96
|
+
class="radio-group"
|
|
92
97
|
aria-labelledby="group-label"
|
|
93
98
|
aria-describedby="supporting-text extended-supporting-text footer"
|
|
94
99
|
aria-invalid=${this.invalid}
|
|
@@ -236,8 +241,8 @@ __decorateClass([
|
|
|
236
241
|
property()
|
|
237
242
|
], RadioGroup.prototype, "size", 2);
|
|
238
243
|
__decorateClass([
|
|
239
|
-
|
|
240
|
-
], RadioGroup.prototype, "
|
|
244
|
+
styleExpressionProperty({ selector: ".content" })
|
|
245
|
+
], RadioGroup.prototype, "flex-direction", 2);
|
|
241
246
|
__decorateClass([
|
|
242
247
|
property({ attribute: "supporting-text" })
|
|
243
248
|
], RadioGroup.prototype, "supportingText", 2);
|