@sebgroup/green-core 2.29.0 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/button/button.component.d.ts +4 -0
- package/components/button/button.component.js +10 -1
- package/components/button/button.styles.js +6 -3
- package/components/radio/radio-group/radio-group.component.d.ts +1 -1
- package/components/radio/radio.component.d.ts +1 -1
- package/components/radio/radio.component.js +2 -2
- package/custom-elements.json +430 -374
- package/gds-element.js +1 -1
- package/generated/mcp/button/api.md +1 -0
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/fab/api.md +1 -0
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/radio/api.md +1 -1
- package/generated/react/button/index.d.ts +1 -0
- package/generated/react/fab/index.d.ts +1 -0
- package/generated/react/index.d.ts +3 -3
- package/generated/react/index.js +3 -3
- package/generated/react/radio/index.d.ts +1 -1
- package/generated/react/radio-group/index.d.ts +1 -1
- package/package.json +1 -1
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -34,6 +34,10 @@ declare class Button extends GdsFormControlElement<any> {
|
|
|
34
34
|
* The label of the button. Use this to add an accessible label to the button when no text is provided in the default slot.
|
|
35
35
|
*/
|
|
36
36
|
label: string;
|
|
37
|
+
/**
|
|
38
|
+
* When set, adds a wrapped class to the button.
|
|
39
|
+
*/
|
|
40
|
+
wrapped: boolean;
|
|
37
41
|
/**
|
|
38
42
|
* When set, the underlying button will be rendered as an anchor element.
|
|
39
43
|
*/
|
|
@@ -37,6 +37,7 @@ class Button extends GdsFormControlElement {
|
|
|
37
37
|
this.variant = "neutral";
|
|
38
38
|
this.size = "medium";
|
|
39
39
|
this.label = "";
|
|
40
|
+
this.wrapped = false;
|
|
40
41
|
this.href = "";
|
|
41
42
|
__privateAdd(this, _isIconButton, false);
|
|
42
43
|
// Check if the button is an icon button.
|
|
@@ -95,7 +96,8 @@ class Button extends GdsFormControlElement {
|
|
|
95
96
|
warning: this.variant === "warning",
|
|
96
97
|
primary: this.rank === "primary",
|
|
97
98
|
secondary: this.rank === "secondary",
|
|
98
|
-
tertiary: this.rank === "tertiary"
|
|
99
|
+
tertiary: this.rank === "tertiary",
|
|
100
|
+
wrapped: this.wrapped
|
|
99
101
|
};
|
|
100
102
|
const tag = __privateGet(this, _Button_instances, isLink_get) ? literal`a` : literal`button`;
|
|
101
103
|
return staticHtml`
|
|
@@ -174,6 +176,13 @@ __decorateClass([
|
|
|
174
176
|
__decorateClass([
|
|
175
177
|
property()
|
|
176
178
|
], Button.prototype, "label", 2);
|
|
179
|
+
__decorateClass([
|
|
180
|
+
property({
|
|
181
|
+
attribute: "wrapped",
|
|
182
|
+
type: Boolean,
|
|
183
|
+
reflect: true
|
|
184
|
+
})
|
|
185
|
+
], Button.prototype, "wrapped", 2);
|
|
177
186
|
__decorateClass([
|
|
178
187
|
property()
|
|
179
188
|
], Button.prototype, "href", 2);
|
|
@@ -25,10 +25,11 @@ const style = css`
|
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
border: none;
|
|
27
27
|
cursor: pointer;
|
|
28
|
-
block-size: var(--_block-size);
|
|
28
|
+
min-block-size: var(--_block-size);
|
|
29
|
+
min-width: 0;
|
|
29
30
|
background-color: var(--gds-sys-color-l3-neutral-01);
|
|
30
31
|
color: var(--gds-sys-color-content-neutral-03);
|
|
31
|
-
border-radius: var(--
|
|
32
|
+
border-radius: calc(var(--_block-size) / 1.8);
|
|
32
33
|
font-family: inherit;
|
|
33
34
|
font: var(--gds-sys-text-detail-book-m);
|
|
34
35
|
gap: var(--gds-sys-space-xs);
|
|
@@ -70,11 +71,12 @@ const style = css`
|
|
|
70
71
|
);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
&:not(.circle) slot:not([name]) {
|
|
74
|
+
&:not(.circle, .wrapped) slot:not([name]) {
|
|
74
75
|
display: block;
|
|
75
76
|
overflow: hidden;
|
|
76
77
|
text-overflow: ellipsis;
|
|
77
78
|
white-space: nowrap;
|
|
79
|
+
min-width: 0;
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
}
|
|
@@ -146,6 +148,7 @@ const style = css`
|
|
|
146
148
|
gap: var(--gds-sys-space-3xs);
|
|
147
149
|
font: var(--gds-sys-text-detail-book-xs);
|
|
148
150
|
padding-inline: var(--gds-sys-space-s);
|
|
151
|
+
padding-block: 0;
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
:host([size='small']) .button {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GdsFormControlElement } from '../../form/form-control';
|
|
2
2
|
import type { GdsRadio } from '../radio';
|
|
3
|
-
declare class RadioGroup extends GdsFormControlElement<string> {
|
|
3
|
+
declare class RadioGroup extends GdsFormControlElement<string | boolean> {
|
|
4
4
|
#private;
|
|
5
5
|
static styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
|
|
6
6
|
/**
|
|
@@ -22,7 +22,7 @@ let GdsRadio = class extends GdsElement {
|
|
|
22
22
|
this.invalid = false;
|
|
23
23
|
this._isFocused = false;
|
|
24
24
|
__privateAdd(this, _handleClick, (e) => {
|
|
25
|
-
if (this.disabled || !this.
|
|
25
|
+
if (this.disabled || !this.label) return;
|
|
26
26
|
e.preventDefault();
|
|
27
27
|
this.checked = true;
|
|
28
28
|
this.focus();
|
|
@@ -87,7 +87,7 @@ __decorateClass([
|
|
|
87
87
|
property({ attribute: "supporting-text" })
|
|
88
88
|
], GdsRadio.prototype, "supportingText", 2);
|
|
89
89
|
__decorateClass([
|
|
90
|
-
property()
|
|
90
|
+
property({ type: String })
|
|
91
91
|
], GdsRadio.prototype, "value", 2);
|
|
92
92
|
__decorateClass([
|
|
93
93
|
property({ type: Boolean, reflect: true })
|