@synergy-design-system/metadata 3.17.0 → 3.18.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/CHANGELOG.md +12 -0
- package/data/core/component/component:syn-button-group.json +0 -5
- package/data/core/component/component:syn-button.json +3 -3
- package/data/core/component/component:syn-chart.json +145 -0
- package/data/core/component/component:syn-radio-button.json +123 -14
- package/data/core/component/component:syn-radio-group.json +11 -0
- package/data/core/setup/setup:angular-components-module.json +1 -1
- package/data/core/setup/setup:angular-forms-module.json +1 -1
- package/data/core/setup/setup:angular-package.json +2 -2
- package/data/core/setup/setup:angular-validators-module.json +1 -1
- package/data/core/setup/setup:components-package.json +2 -2
- package/data/core/setup/setup:react-package.json +2 -2
- package/data/core/setup/setup:tokens-package.json +2 -2
- package/data/core/setup/setup:vue-package.json +2 -2
- package/data/core/token/token:tokens-charts-js-index-d-ts.json +1 -1
- package/data/core/token/token:tokens-charts-js-index-js.json +1 -1
- package/data/core/token/token:tokens-charts-scss-tokens-scss.json +1 -1
- package/data/core/token/token:tokens-charts-themes-sick2025-dark-css.json +1 -1
- package/data/core/token/token:tokens-charts-themes-sick2025-light-css.json +1 -1
- package/data/core/token/token:tokens-figma-variables-sick2018-dark-json.json +1 -1
- package/data/core/token/token:tokens-figma-variables-sick2018-light-json.json +1 -1
- package/data/core/token/token:tokens-figma-variables-sick2025-dark-json.json +1 -1
- package/data/core/token/token:tokens-figma-variables-sick2025-light-json.json +1 -1
- package/data/core/token/token:tokens-js-index-d-ts.json +1 -1
- package/data/core/token/token:tokens-js-index-js.json +1 -1
- package/data/core/token/token:tokens-scss-tokens-scss.json +1 -1
- package/data/core/token/token:tokens-themes-sick2018-dark-css.json +1 -1
- package/data/core/token/token:tokens-themes-sick2018-light-css.json +1 -1
- package/data/core/token/token:tokens-themes-sick2025-dark-css.json +1 -1
- package/data/core/token/token:tokens-themes-sick2025-light-css.json +1 -1
- package/data/index.json +3 -2
- package/data/layers/examples/component/component:syn-checkbox.md +16 -2
- package/data/layers/examples/component/component:syn-combobox.md +10 -3
- package/data/layers/examples/component/component:syn-file.md +16 -10
- package/data/layers/examples/component/component:syn-input.md +10 -3
- package/data/layers/examples/component/component:syn-radio-button.md +200 -0
- package/data/layers/examples/component/component:syn-radio-group.md +27 -2
- package/data/layers/examples/component/component:syn-radio.md +12 -5
- package/data/layers/examples/component/component:syn-range.md +16 -14
- package/data/layers/examples/component/component:syn-select.md +10 -3
- package/data/layers/examples/component/component:syn-switch.md +10 -3
- package/data/layers/examples/component/component:syn-textarea.md +10 -3
- package/data/layers/full/component/component:syn-button/components/button-group.styles.ts +66 -0
- package/data/layers/full/component/component:syn-button/components/button.component.ts +40 -52
- package/data/layers/full/component/component:syn-button/components/button.styles.ts +162 -173
- package/data/layers/full/component/component:syn-button-group/components/button-group.component.ts +22 -18
- package/data/layers/full/component/component:syn-button-group/components/button-group.styles.ts +0 -2
- package/data/layers/full/component/component:syn-radio-button/angular/radio-button.component.ts +14 -14
- package/data/layers/full/component/component:syn-radio-button/components/radio-button.component.ts +45 -25
- package/data/layers/full/component/component:syn-radio-button/components/radio-button.styles.ts +87 -25
- package/data/layers/full/component/component:syn-radio-button/react/radio-button.ts +1 -1
- package/data/layers/full/component/component:syn-radio-button/vue/SynVueRadioButton.vue +6 -6
- package/data/layers/full/component/component:syn-radio-group/components/radio-group.component.ts +23 -11
- package/data/layers/full/component/component:syn-radio-group/components/radio-group.styles.ts +51 -6
- package/data/layers/full/setup/setup:angular-package/angular/CHANGELOG.md +18 -0
- package/data/layers/full/setup/setup:angular-package/angular/package.json +1 -1
- package/data/layers/full/setup/setup:components-package/components/CHANGELOG.md +17 -0
- package/data/layers/full/setup/setup:components-package/components/package.json +1 -1
- package/data/layers/full/setup/setup:react-package/react/CHANGELOG.md +8 -0
- package/data/layers/full/setup/setup:react-package/react/package.json +1 -1
- package/data/layers/full/setup/setup:react-package/react/syn-jsx-elements.ts +2 -2
- package/data/layers/full/setup/setup:tokens-package/tokens/CHANGELOG.md +12 -0
- package/data/layers/full/setup/setup:tokens-package/tokens/package.json +1 -1
- package/data/layers/full/setup/setup:vue-package/vue/CHANGELOG.md +18 -0
- package/data/layers/full/setup/setup:vue-package/vue/package.json +1 -1
- package/data/layers/full/tokens/charts/js/index.d.ts +1 -1
- package/data/layers/full/tokens/charts/js/index.js +1 -1
- package/data/layers/full/tokens/charts/scss/_tokens.scss +1 -1
- package/data/layers/full/tokens/charts/themes/sick2025_dark.css +1 -1
- package/data/layers/full/tokens/charts/themes/sick2025_light.css +1 -1
- package/data/layers/full/tokens/figma-variables/sick2018-dark.json +20 -0
- package/data/layers/full/tokens/figma-variables/sick2018-light.json +20 -0
- package/data/layers/full/tokens/figma-variables/sick2025-dark.json +20 -0
- package/data/layers/full/tokens/figma-variables/sick2025-light.json +20 -0
- package/data/layers/full/tokens/js/index.d.ts +21 -1
- package/data/layers/full/tokens/js/index.js +21 -1
- package/data/layers/full/tokens/scss/_tokens.scss +5 -1
- package/data/layers/full/tokens/themes/sick2018_dark.css +5 -1
- package/data/layers/full/tokens/themes/sick2018_light.css +5 -1
- package/data/layers/full/tokens/themes/sick2025_dark.css +5 -1
- package/data/layers/full/tokens/themes/sick2025_light.css +5 -1
- package/data/layers/interface/component/component:syn-radio-button.json +14 -12
- package/data/layers/interface/component/component:syn-radio-button.md +6 -4
- package/data/layers/rules/component/component:syn-radio-button.md +16 -11
- package/data/manifest.json +1 -1
- package/dist/intentPolicy/domains/input/capabilities.js +4 -0
- package/dist/intentPolicy/domains/input/patterns.js +9 -0
- package/package.json +3 -3
- package/data/layers/full/component/component:syn-button/components/button.custom.styles.ts +0 -245
- package/data/layers/full/component/component:syn-button-group/components/button-group.custom.styles.ts +0 -5
package/data/layers/full/component/component:syn-radio-button/components/radio-button.component.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
-
import { HasSlotController } from '../../internal/slot.js';
|
|
4
|
-
import { html } from 'lit/static-html.js';
|
|
5
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
1
|
+
import { type CSSResultGroup, html } from 'lit';
|
|
6
2
|
import { property, query, state } from 'lit/decorators.js';
|
|
3
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { HasSlotController, getTextContent } from '../../internal/slot.js';
|
|
7
6
|
import { watch } from '../../internal/watch.js';
|
|
8
7
|
import componentStyles from '../../styles/component.styles.js';
|
|
9
8
|
import SynergyElement from '../../internal/synergy-element.js';
|
|
10
9
|
import styles from './radio-button.styles.js';
|
|
11
|
-
import
|
|
10
|
+
import buttonStyles from '../button/button.styles.js';
|
|
12
11
|
import { enableDefaultSettings } from '../../utilities/defaultSettings/decorator.js';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* @summary Radios buttons allow the user to select a single option from a group using a button-like control.
|
|
16
15
|
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-radio-button--docs
|
|
17
16
|
* @status stable
|
|
18
|
-
* @since
|
|
17
|
+
* @since 3.17.0
|
|
19
18
|
*
|
|
20
19
|
* @slot - The radio button's label.
|
|
21
20
|
* @slot prefix - A presentational prefix icon or similar element.
|
|
@@ -33,26 +32,32 @@ import { enableDefaultSettings } from '../../utilities/defaultSettings/decorator
|
|
|
33
32
|
*/
|
|
34
33
|
@enableDefaultSettings('SynRadioButton')
|
|
35
34
|
export default class SynRadioButton extends SynergyElement {
|
|
36
|
-
static styles: CSSResultGroup = [componentStyles, styles];
|
|
35
|
+
static styles: CSSResultGroup = [componentStyles, buttonStyles, styles];
|
|
37
36
|
|
|
38
37
|
private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');
|
|
39
38
|
|
|
40
39
|
@query('.button') input: HTMLInputElement;
|
|
41
|
-
|
|
40
|
+
|
|
41
|
+
@query('slot:not([name])') defaultSlot: HTMLSlotElement;
|
|
42
42
|
|
|
43
43
|
@state() protected hasFocus = false;
|
|
44
44
|
|
|
45
|
+
@state() private iconOnly = false;
|
|
46
|
+
|
|
45
47
|
/**
|
|
46
48
|
* @internal The radio button's checked state. This is exposed as an "internal" attribute so we can reflect it, making
|
|
47
49
|
* it easier to style in button groups.
|
|
48
50
|
*/
|
|
49
|
-
@property({
|
|
51
|
+
@property({ reflect: true, type: Boolean }) checked = false;
|
|
50
52
|
|
|
51
53
|
/** The radio's value. When selected, the radio group will receive this value. */
|
|
52
54
|
@property() value: string | number;
|
|
53
55
|
|
|
54
56
|
/** Disables the radio button. */
|
|
55
|
-
@property({
|
|
57
|
+
@property({ reflect: true, type: Boolean }) disabled = false;
|
|
58
|
+
|
|
59
|
+
/** Sets the radio button to a readonly state. */
|
|
60
|
+
@property({ reflect: true, type: Boolean }) readonly = false;
|
|
56
61
|
|
|
57
62
|
/**
|
|
58
63
|
* The radio button's size. When used inside a radio group, the size will be determined by the radio group's size so
|
|
@@ -60,21 +65,22 @@ export default class SynRadioButton extends SynergyElement {
|
|
|
60
65
|
*/
|
|
61
66
|
@property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';
|
|
62
67
|
|
|
63
|
-
/** Draws a pill-style radio button with rounded edges. */
|
|
64
|
-
@property({ type: Boolean, reflect: true }) pill = false;
|
|
65
|
-
|
|
66
68
|
connectedCallback() {
|
|
67
69
|
super.connectedCallback();
|
|
68
70
|
this.setAttribute('role', 'presentation');
|
|
69
71
|
}
|
|
70
72
|
|
|
73
|
+
private isDisabled() {
|
|
74
|
+
return this.disabled || this.readonly;
|
|
75
|
+
}
|
|
76
|
+
|
|
71
77
|
private handleBlur() {
|
|
72
78
|
this.hasFocus = false;
|
|
73
79
|
this.emit('syn-blur');
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
private handleClick(e: MouseEvent) {
|
|
77
|
-
if (this.
|
|
83
|
+
if (this.isDisabled()) {
|
|
78
84
|
e.preventDefault();
|
|
79
85
|
e.stopPropagation();
|
|
80
86
|
return;
|
|
@@ -88,9 +94,17 @@ export default class SynRadioButton extends SynergyElement {
|
|
|
88
94
|
this.emit('syn-focus');
|
|
89
95
|
}
|
|
90
96
|
|
|
91
|
-
|
|
97
|
+
private handleSlotChange() {
|
|
98
|
+
const textContent = getTextContent(this.defaultSlot).trim();
|
|
99
|
+
const assignedElements = this.defaultSlot.assignedElements({ flatten: true });
|
|
100
|
+
const iconOnlyElement = assignedElements.length === 1 && assignedElements[0].tagName.toLowerCase() === 'syn-icon';
|
|
101
|
+
|
|
102
|
+
this.iconOnly = iconOnlyElement && textContent === '';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@watch(['disabled', 'readonly'], { waitUntilFirstUpdate: true })
|
|
92
106
|
handleDisabledChange() {
|
|
93
|
-
this.setAttribute('aria-disabled', this.
|
|
107
|
+
this.setAttribute('aria-disabled', this.isDisabled() ? 'true' : 'false');
|
|
94
108
|
}
|
|
95
109
|
|
|
96
110
|
/** Sets focus on the radio button. */
|
|
@@ -104,6 +118,7 @@ export default class SynRadioButton extends SynergyElement {
|
|
|
104
118
|
}
|
|
105
119
|
|
|
106
120
|
render() {
|
|
121
|
+
/* eslint-disable @typescript-eslint/unbound-method */
|
|
107
122
|
return html`
|
|
108
123
|
<div part="base" role="presentation">
|
|
109
124
|
<button
|
|
@@ -112,31 +127,36 @@ export default class SynRadioButton extends SynergyElement {
|
|
|
112
127
|
aria-checked="${this.checked}"
|
|
113
128
|
class=${classMap({
|
|
114
129
|
button: true,
|
|
115
|
-
'button--default': true,
|
|
116
|
-
'button--small': this.size === 'small',
|
|
117
|
-
'button--medium': this.size === 'medium',
|
|
118
|
-
'button--large': this.size === 'large',
|
|
119
130
|
'button--checked': this.checked,
|
|
131
|
+
'button--default': true,
|
|
120
132
|
'button--disabled': this.disabled,
|
|
133
|
+
'button--filled': this.checked,
|
|
121
134
|
'button--focused': this.hasFocus,
|
|
122
|
-
'button--outline': true,
|
|
123
|
-
'button--pill': this.pill,
|
|
124
135
|
'button--has-label': this.hasSlotController.test('[default]'),
|
|
125
136
|
'button--has-prefix': this.hasSlotController.test('prefix'),
|
|
126
|
-
'button--has-suffix': this.hasSlotController.test('suffix')
|
|
137
|
+
'button--has-suffix': this.hasSlotController.test('suffix'),
|
|
138
|
+
'button--icon-only': this.iconOnly,
|
|
139
|
+
'button--large': this.size === 'large',
|
|
140
|
+
'button--medium': this.size === 'medium',
|
|
141
|
+
'button--primary': true,
|
|
142
|
+
'button--readonly': this.readonly,
|
|
143
|
+
'button--small': this.size === 'small',
|
|
144
|
+
'button--text': !this.checked,
|
|
127
145
|
})}
|
|
128
146
|
aria-disabled=${this.disabled}
|
|
129
147
|
type="button"
|
|
148
|
+
tabindex=${ifDefined(this.disabled ? '-1': undefined)}
|
|
130
149
|
value=${ifDefined(this.value)}
|
|
131
150
|
@blur=${this.handleBlur}
|
|
132
151
|
@focus=${this.handleFocus}
|
|
133
152
|
@click=${this.handleClick}
|
|
134
153
|
>
|
|
135
154
|
<slot name="prefix" part="prefix" class="button__prefix"></slot>
|
|
136
|
-
<slot part="label" class="button__label"></slot>
|
|
155
|
+
<slot part="label" class="button__label" @slotchange=${this.handleSlotChange}></slot>
|
|
137
156
|
<slot name="suffix" part="suffix" class="button__suffix"></slot>
|
|
138
157
|
</button>
|
|
139
158
|
</div>
|
|
140
159
|
`;
|
|
160
|
+
/* eslint-enable @typescript-eslint/unbound-method */
|
|
141
161
|
}
|
|
142
162
|
}
|
package/data/layers/full/component/component:syn-radio-button/components/radio-button.styles.ts
CHANGED
|
@@ -1,30 +1,92 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
import { css } from 'lit';
|
|
3
|
-
import buttonStyles from '../button/button.styles.js';
|
|
4
2
|
|
|
5
3
|
export default css`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
:host([readonly]) {
|
|
5
|
+
cursor: default;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.button {
|
|
9
|
+
/* Medium size is the default */
|
|
10
|
+
--syn-radio-button-height: 32px;
|
|
11
|
+
--syn-radio-button-radius: var(--syn-radio-button-border-radius-medium);
|
|
12
|
+
|
|
13
|
+
border-radius: var(--syn-radio-button-radius);
|
|
14
|
+
font-weight: normal;
|
|
15
|
+
line-height: calc(var(--syn-radio-button-height) - var(--syn-input-border-width) * 2);
|
|
16
|
+
min-height: var(--syn-radio-button-height);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.button--small {
|
|
20
|
+
--syn-radio-button-height: 24px;
|
|
21
|
+
--syn-radio-button-radius: var(--syn-radio-button-border-radius-small);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.button--large {
|
|
25
|
+
--syn-radio-button-height: 48px;
|
|
26
|
+
--syn-radio-button-radius: var(--syn-radio-button-border-radius-large);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Icon only buttons
|
|
31
|
+
*/
|
|
32
|
+
.button--icon-only .button__label {
|
|
33
|
+
border-radius: var(--syn-border-radius-medium);
|
|
34
|
+
padding-inline: var(--syn-spacing-2x-small);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Override the default unchecked button
|
|
39
|
+
*/
|
|
40
|
+
.button--text {
|
|
41
|
+
color: var(--syn-interactive-quiet-color);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.button--text:hover:not(.button--disabled):not(.button--readonly) {
|
|
45
|
+
background: var(--syn-interactive-background-color-hover);
|
|
46
|
+
color: var(--syn-interactive-quiet-color-hover);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Disabled active buttons should look like their default state, but with opacity applied.
|
|
51
|
+
* This overrides the defaults from the button component.
|
|
52
|
+
* Note we cannot use syn-button-color because it will be the wrong color in dark mode.
|
|
53
|
+
*/
|
|
54
|
+
.button--filled.button--primary,
|
|
55
|
+
.button--filled.button--primary.button--disabled {
|
|
56
|
+
background: var(--syn-interactive-emphasis-color);
|
|
57
|
+
border-color: var(--syn-interactive-emphasis-color);
|
|
58
|
+
color: var(--syn-color-neutral-0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Make sure the active state is applied to the button in its selected and none selected state.
|
|
63
|
+
*/
|
|
64
|
+
.button--filled.button--primary:active:not(.button--disabled),
|
|
65
|
+
.button--text.button--primary:active:not(.button--disabled) {
|
|
66
|
+
background: var(--syn-button-color-active);
|
|
67
|
+
border-color: var(--syn-button-color-active);
|
|
68
|
+
color: var(--syn-button-filled-color-text-active);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Readonly state styles
|
|
73
|
+
*/
|
|
74
|
+
.button.button--readonly {
|
|
75
|
+
background: var(--syn-readonly-background-color);
|
|
76
|
+
color: var(--syn-readonly-color-text);
|
|
77
|
+
cursor: text;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
user-select: text;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.button.button--readonly:focus-visible {
|
|
83
|
+
background: var(--syn-input-readonly-background-color-focus);
|
|
84
|
+
color: var(--syn-readonly-color-text);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.button.button--readonly.button--checked {
|
|
88
|
+
background: var(--syn-readonly-indicator-color);
|
|
89
|
+
border-color: var(--syn-readonly-border-color);
|
|
90
|
+
color: var(--syn-color-neutral-0);
|
|
29
91
|
}
|
|
30
92
|
`;
|
|
@@ -18,7 +18,7 @@ Component.define('syn-radio-button');
|
|
|
18
18
|
* @summary Radios buttons allow the user to select a single option from a group using a button-like control.
|
|
19
19
|
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-radio-button--docs
|
|
20
20
|
* @status stable
|
|
21
|
-
* @since
|
|
21
|
+
* @since 3.17.0
|
|
22
22
|
*
|
|
23
23
|
* @slot - The radio button's label.
|
|
24
24
|
* @slot prefix - A presentational prefix icon or similar element.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @summary Radios buttons allow the user to select a single option from a group using a button-like control.
|
|
10
10
|
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-radio-button--docs
|
|
11
11
|
* @status stable
|
|
12
|
-
* @since
|
|
12
|
+
* @since 3.17.0
|
|
13
13
|
*
|
|
14
14
|
* @slot - The radio button's label.
|
|
15
15
|
* @slot prefix - A presentational prefix icon or similar element.
|
|
@@ -52,17 +52,17 @@ const props = defineProps<{
|
|
|
52
52
|
*/
|
|
53
53
|
disabled?: SynRadioButton['disabled'];
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Sets the radio button to a readonly state.
|
|
57
|
+
*/
|
|
58
|
+
readonly?: SynRadioButton['readonly'];
|
|
59
|
+
|
|
55
60
|
/**
|
|
56
61
|
* The radio button's size.
|
|
57
62
|
* When used inside a radio group, the size will be determined by the radio group's size so
|
|
58
63
|
this attribute can typically be omitted.
|
|
59
64
|
*/
|
|
60
65
|
size?: SynRadioButton['size'];
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Draws a pill-style radio button with rounded edges.
|
|
64
|
-
*/
|
|
65
|
-
pill?: SynRadioButton['pill'];
|
|
66
66
|
}>();
|
|
67
67
|
|
|
68
68
|
// Make sure prop binding only forwards the props that are actually there.
|
package/data/layers/full/component/component:syn-radio-group/components/radio-group.component.ts
CHANGED
|
@@ -144,15 +144,16 @@ export default class SynRadioGroup extends SynergyElement implements SynergyForm
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
private handleRadioClick(event: MouseEvent) {
|
|
147
|
-
const target = (event.target as HTMLElement).closest<SynRadio | SynRadioButton>('syn-radio, syn-radio-button')
|
|
148
|
-
const radios = this.getAllRadios();
|
|
149
|
-
const oldValue = this.value;
|
|
147
|
+
const target = (event.target as HTMLElement).closest<SynRadio | SynRadioButton>('syn-radio, syn-radio-button');
|
|
150
148
|
|
|
151
149
|
// #1174: If we have a radio, also do nothing if the radio is readonly
|
|
152
|
-
if (!target || target.disabled ||
|
|
150
|
+
if (!target || target.disabled || target.readonly) {
|
|
153
151
|
return;
|
|
154
152
|
}
|
|
155
153
|
|
|
154
|
+
const radios = this.getAllRadios();
|
|
155
|
+
const oldValue = this.value;
|
|
156
|
+
|
|
156
157
|
this.value = target.value;
|
|
157
158
|
radios.forEach(radio => {
|
|
158
159
|
radio.checked = radio === target;
|
|
@@ -170,7 +171,7 @@ export default class SynRadioGroup extends SynergyElement implements SynergyForm
|
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
// #1174: Filter out elements that are either disabled or readonly
|
|
173
|
-
const availableRadios = this.getAllRadios().filter(radio => (!radio.disabled && !
|
|
174
|
+
const availableRadios = this.getAllRadios().filter(radio => (!radio.disabled && !radio.readonly));
|
|
174
175
|
const checkedRadio = availableRadios.find(radio => radio.checked) ?? availableRadios[0];
|
|
175
176
|
|
|
176
177
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -186,6 +187,11 @@ export default class SynRadioGroup extends SynergyElement implements SynergyForm
|
|
|
186
187
|
index = 0;
|
|
187
188
|
}
|
|
188
189
|
|
|
190
|
+
// #1175: If all radios are readonly, skip and focus the first one and do not change the value
|
|
191
|
+
if (!availableRadios[index]) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
|
|
189
195
|
const allRadios = this.getAllRadios();
|
|
190
196
|
|
|
191
197
|
allRadios.forEach(radio => {
|
|
@@ -196,11 +202,6 @@ export default class SynRadioGroup extends SynergyElement implements SynergyForm
|
|
|
196
202
|
}
|
|
197
203
|
});
|
|
198
204
|
|
|
199
|
-
// #1175: If all radios are readonly, skip and focus the first one and do not change the value
|
|
200
|
-
if (!availableRadios[index]) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
205
|
this.value = availableRadios[index].value;
|
|
205
206
|
availableRadios[index].checked = true;
|
|
206
207
|
|
|
@@ -257,6 +258,11 @@ export default class SynRadioGroup extends SynergyElement implements SynergyForm
|
|
|
257
258
|
if (this.hasButtonGroup) {
|
|
258
259
|
const buttonGroup = this.shadowRoot?.querySelector('syn-button-group');
|
|
259
260
|
|
|
261
|
+
// Check if all radios in the group are readonly. If they are, set the button group to readonly as well to prevent focus and hover styles
|
|
262
|
+
if (buttonGroup) {
|
|
263
|
+
buttonGroup.toggleAttribute('readonly', radios.every(radio => radio.readonly));
|
|
264
|
+
}
|
|
265
|
+
|
|
260
266
|
if (buttonGroup) {
|
|
261
267
|
buttonGroup.disableRole = true;
|
|
262
268
|
}
|
|
@@ -379,6 +385,7 @@ export default class SynRadioGroup extends SynergyElement implements SynergyForm
|
|
|
379
385
|
part="form-control"
|
|
380
386
|
class=${classMap({
|
|
381
387
|
'form-control': true,
|
|
388
|
+
'form-control--has-button-group': this.hasButtonGroup,
|
|
382
389
|
'form-control--has-help-text': hasHelpText,
|
|
383
390
|
'form-control--has-label': hasLabel,
|
|
384
391
|
'form-control--large': this.size === 'large',
|
|
@@ -418,7 +425,12 @@ export default class SynRadioGroup extends SynergyElement implements SynergyForm
|
|
|
418
425
|
|
|
419
426
|
${this.hasButtonGroup
|
|
420
427
|
? html`
|
|
421
|
-
<syn-button-group
|
|
428
|
+
<syn-button-group
|
|
429
|
+
exportparts="base:button-group__base"
|
|
430
|
+
part="button-group"
|
|
431
|
+
role="presentation"
|
|
432
|
+
size=${this.size}
|
|
433
|
+
>
|
|
422
434
|
${defaultSlot}
|
|
423
435
|
</syn-button-group>
|
|
424
436
|
`
|
package/data/layers/full/component/component:syn-radio-group/components/radio-group.styles.ts
CHANGED
|
@@ -28,6 +28,16 @@ export default css`
|
|
|
28
28
|
padding: 0;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
.form-control-input {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: var(--syn-spacing-x-small);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.form-control--has-help-text.form-control--radio-group .form-control__help-text {
|
|
38
|
+
margin-top: var(--syn-spacing-x-small);
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
.radio-group--required .radio-group__label::after {
|
|
32
42
|
content: var(--syn-input-required-content);
|
|
33
43
|
margin-inline-start: var(--syn-input-required-content-offset);
|
|
@@ -46,13 +56,48 @@ export default css`
|
|
|
46
56
|
width: 1px;
|
|
47
57
|
}
|
|
48
58
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
/**
|
|
60
|
+
* #1140:
|
|
61
|
+
* Apply custom styling when we are using syn-radio-button.
|
|
62
|
+
* This is needed because syn-radio-button is displayed with space between the items
|
|
63
|
+
* and should not adhere to the default styling needed for regular button groups.
|
|
64
|
+
*/
|
|
65
|
+
.form-control--has-button-group .form-control-input {
|
|
66
|
+
max-width: 100%; /* Fallback for older browsers, do not remove */
|
|
53
67
|
}
|
|
54
68
|
|
|
55
|
-
|
|
56
|
-
|
|
69
|
+
@supports (max-width: fit-content) {
|
|
70
|
+
.form-control--has-button-group .form-control-input {
|
|
71
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
72
|
+
max-width: fit-content;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.form-control--has-button-group syn-button-group::part(base) {
|
|
77
|
+
--radiogroup-padding: calc(var(--syn-spacing-x-small) - 1px);
|
|
78
|
+
|
|
79
|
+
border: 1px solid var(--syn-input-border-color);
|
|
80
|
+
border-radius: var(--syn-input-border-radius-large);
|
|
81
|
+
gap: var(--radiogroup-padding);
|
|
82
|
+
padding: var(--radiogroup-padding);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.form-control--has-button-group syn-button-group[readonly]::part(base) {
|
|
86
|
+
background: var(--syn-readonly-background-color);
|
|
87
|
+
border-color: var(--syn-readonly-background-color);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.form-control--has-button-group syn-button-group[size="small"]::part(base) {
|
|
91
|
+
--radiogroup-padding: calc(var(--syn-spacing-2x-small) + var(--syn-input-width));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* #1140: This statement overrides the children selectors that are used for showing readonly fields
|
|
96
|
+
* We are not able to easily forward them to the radio button, so we need to override them here.
|
|
97
|
+
*/
|
|
98
|
+
.form-control--has-button-group syn-button-group[readonly] ::slotted(syn-radio-button) {
|
|
99
|
+
--syn-readonly-indicator-color: var(--syn-readonly-background-color);
|
|
100
|
+
--syn-readonly-border-color: transparent;
|
|
101
|
+
--syn-color-neutral-0: var(--syn-readonly-color-text);
|
|
57
102
|
}
|
|
58
103
|
`;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @synergy-design-system/angular
|
|
2
2
|
|
|
3
|
+
## 3.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1231](https://github.com/synergy-design-system/synergy-design-system/pull/1231) [`8a6cbf7`](https://github.com/synergy-design-system/synergy-design-system/commit/8a6cbf78fe5236b691815edfad12b34659937df9) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-06-30
|
|
8
|
+
|
|
9
|
+
feat: ✨ `<syn-radio-button>` ([#1140](https://github.com/synergy-design-system/synergy-design-system/issues/1140))
|
|
10
|
+
|
|
11
|
+
This release adds the new `<syn-radio-button>` component for single-selection controls with a more prominent, button-like appearance.
|
|
12
|
+
|
|
13
|
+
Use `<syn-radio>` for classic form input patterns, and `<syn-radio-button>` when the same behavior should feel more like an immediate mode, view, or option switch.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`8a6cbf7`](https://github.com/synergy-design-system/synergy-design-system/commit/8a6cbf78fe5236b691815edfad12b34659937df9)]:
|
|
18
|
+
- @synergy-design-system/components@3.17.0
|
|
19
|
+
- @synergy-design-system/tokens@3.17.0
|
|
20
|
+
|
|
3
21
|
## 3.16.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"url": "https://github.com/synergy-design-system/synergy-design-system.git",
|
|
23
23
|
"directory": "packages/angular"
|
|
24
24
|
},
|
|
25
|
-
"version": "3.
|
|
25
|
+
"version": "3.17.0",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"_build": "pnpm _clean && ng-packagr -c tsconfig.lib.json && pnpm _after-build",
|
|
28
28
|
"_clean": "rm -rf ../_private/angular-demo/.angular",
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1231](https://github.com/synergy-design-system/synergy-design-system/pull/1231) [`8a6cbf7`](https://github.com/synergy-design-system/synergy-design-system/commit/8a6cbf78fe5236b691815edfad12b34659937df9) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-06-30
|
|
8
|
+
|
|
9
|
+
feat: ✨ `<syn-radio-button>` ([#1140](https://github.com/synergy-design-system/synergy-design-system/issues/1140))
|
|
10
|
+
|
|
11
|
+
This release adds the new `<syn-radio-button>` component for single-selection controls with a more prominent, button-like appearance.
|
|
12
|
+
|
|
13
|
+
Use `<syn-radio>` for classic form input patterns, and `<syn-radio-button>` when the same behavior should feel more like an immediate mode, view, or option switch.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`8a6cbf7`](https://github.com/synergy-design-system/synergy-design-system/commit/8a6cbf78fe5236b691815edfad12b34659937df9)]:
|
|
18
|
+
- @synergy-design-system/tokens@3.17.0
|
|
19
|
+
|
|
3
20
|
## 3.16.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @synergy-design-system/react
|
|
2
2
|
|
|
3
|
+
## 3.17.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`8a6cbf7`](https://github.com/synergy-design-system/synergy-design-system/commit/8a6cbf78fe5236b691815edfad12b34659937df9)]:
|
|
8
|
+
- @synergy-design-system/components@3.17.0
|
|
9
|
+
- @synergy-design-system/tokens@3.17.0
|
|
10
|
+
|
|
3
11
|
## 3.16.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -1092,7 +1092,7 @@ export type SynCustomElement<
|
|
|
1092
1092
|
* @summary Radios buttons allow the user to select a single option from a group using a button-like control.
|
|
1093
1093
|
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-radio-button--docs
|
|
1094
1094
|
* @status stable
|
|
1095
|
-
* @since
|
|
1095
|
+
* @since 3.17.0
|
|
1096
1096
|
*
|
|
1097
1097
|
* @slot - The radio button's label.
|
|
1098
1098
|
* @slot prefix - A presentational prefix icon or similar element.
|
|
@@ -2441,7 +2441,7 @@ declare module 'react' {
|
|
|
2441
2441
|
* @summary Radios buttons allow the user to select a single option from a group using a button-like control.
|
|
2442
2442
|
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-radio-button--docs
|
|
2443
2443
|
* @status stable
|
|
2444
|
-
* @since
|
|
2444
|
+
* @since 3.17.0
|
|
2445
2445
|
*
|
|
2446
2446
|
* @slot - The radio button's label.
|
|
2447
2447
|
* @slot prefix - A presentational prefix icon or similar element.
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1231](https://github.com/synergy-design-system/synergy-design-system/pull/1231) [`8a6cbf7`](https://github.com/synergy-design-system/synergy-design-system/commit/8a6cbf78fe5236b691815edfad12b34659937df9) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-06-30
|
|
8
|
+
|
|
9
|
+
feat: ✨ `<syn-radio-button>` ([#1140](https://github.com/synergy-design-system/synergy-design-system/issues/1140))
|
|
10
|
+
|
|
11
|
+
This release adds the new `<syn-radio-button>` component for single-selection controls with a more prominent, button-like appearance.
|
|
12
|
+
|
|
13
|
+
Use `<syn-radio>` for classic form input patterns, and `<syn-radio-button>` when the same behavior should feel more like an immediate mode, view, or option switch.
|
|
14
|
+
|
|
3
15
|
## 3.16.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @synergy-design-system/vue
|
|
2
2
|
|
|
3
|
+
## 3.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1231](https://github.com/synergy-design-system/synergy-design-system/pull/1231) [`8a6cbf7`](https://github.com/synergy-design-system/synergy-design-system/commit/8a6cbf78fe5236b691815edfad12b34659937df9) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-06-30
|
|
8
|
+
|
|
9
|
+
feat: ✨ `<syn-radio-button>` ([#1140](https://github.com/synergy-design-system/synergy-design-system/issues/1140))
|
|
10
|
+
|
|
11
|
+
This release adds the new `<syn-radio-button>` component for single-selection controls with a more prominent, button-like appearance.
|
|
12
|
+
|
|
13
|
+
Use `<syn-radio>` for classic form input patterns, and `<syn-radio-button>` when the same behavior should feel more like an immediate mode, view, or option switch.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`8a6cbf7`](https://github.com/synergy-design-system/synergy-design-system/commit/8a6cbf78fe5236b691815edfad12b34659937df9)]:
|
|
18
|
+
- @synergy-design-system/components@3.17.0
|
|
19
|
+
- @synergy-design-system/tokens@3.17.0
|
|
20
|
+
|
|
3
21
|
## 3.16.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|