@synergy-design-system/metadata 3.17.0 → 3.19.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 +20 -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 +5 -5
- 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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
export default css`
|
|
4
|
+
/* stylelint-disable no-descending-specificity */
|
|
5
|
+
/*
|
|
6
|
+
* Button groups support a variety of button types (e.g. buttons with tooltips, buttons as dropdown triggers, etc.).
|
|
7
|
+
* This means buttons aren't always direct descendants of the button group, thus we can't target them with the
|
|
8
|
+
* ::slotted selector. To work around this, the button group component does some magic to add these special classes to
|
|
9
|
+
* buttons and we style them here instead.
|
|
10
|
+
*/
|
|
11
|
+
:host([data-syn-button-group__button--first]:not([data-syn-button-group__button--last])) .button {
|
|
12
|
+
border-end-end-radius: 0;
|
|
13
|
+
border-start-end-radius: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([data-syn-button-group__button--inner]) .button {
|
|
17
|
+
border-radius: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([data-syn-button-group__button--last]:not([data-syn-button-group__button--first])) .button {
|
|
21
|
+
border-end-start-radius: 0;
|
|
22
|
+
border-start-start-radius: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* All except the first */
|
|
26
|
+
:host([data-syn-button-group__button]:not([data-syn-button-group__button--first])) {
|
|
27
|
+
margin-inline-start: calc(-1 * var(--syn-input-border-width));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Add a visual separator between solid buttons */
|
|
31
|
+
:host([data-syn-button-group__button]:not([data-syn-button-group__button--first]):not([data-syn-button-group__button--radio]):not([variant='filled']):not(:hover)) .button::after {
|
|
32
|
+
border-left: solid 1px rgb(128 128 128 / 33%);
|
|
33
|
+
bottom: 0;
|
|
34
|
+
content: '';
|
|
35
|
+
inset-inline-start: 0;
|
|
36
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
37
|
+
mix-blend-mode: multiply;
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Bump hovered, focused, and checked buttons up so their focus ring isn't clipped */
|
|
43
|
+
:host([data-syn-button-group__button--hover]) {
|
|
44
|
+
z-index: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Focus and checked are always on top */
|
|
48
|
+
:host([data-syn-button-group__button--focus]),
|
|
49
|
+
:host([data-syn-button-group__button][checked]) {
|
|
50
|
+
z-index: 2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* #392: Button Groups */
|
|
54
|
+
:host([data-syn-button-group__button--inner]) .button--filled.button {
|
|
55
|
+
border-left-color: var(--syn-panel-background-color);
|
|
56
|
+
border-right-color: var(--syn-panel-background-color);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([data-syn-button-group__button--first]:not([data-syn-button-group__button--last])) .button--filled.button {
|
|
60
|
+
border-right-color: var(--syn-panel-background-color);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([data-syn-button-group__button--last]:not([data-syn-button-group__button--first])) .button--filled.button {
|
|
64
|
+
border-left-color: var(--syn-panel-background-color);
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CSSResultGroup } from 'lit';
|
|
2
|
+
import { html, literal } from 'lit/static-html.js';
|
|
3
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
2
5
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
6
|
import { FormControlController, validValidityState } from '../../internal/form.js';
|
|
4
7
|
import { HasSlotController, getTextContent } from '../../internal/slot.js';
|
|
5
|
-
import { html, literal } from 'lit/static-html.js';
|
|
6
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
8
|
import { LocalizeController } from '../../utilities/localize.js';
|
|
8
|
-
import { property, query, state } from 'lit/decorators.js';
|
|
9
9
|
import { watch } from '../../internal/watch.js';
|
|
10
10
|
import componentStyles from '../../styles/component.styles.js';
|
|
11
11
|
import SynergyElement from '../../internal/synergy-element.js';
|
|
12
12
|
import SynIcon from '../icon/icon.component.js';
|
|
13
13
|
import SynSpinner from '../spinner/spinner.component.js';
|
|
14
14
|
import styles from './button.styles.js';
|
|
15
|
-
import
|
|
16
|
-
import type { CSSResultGroup } from 'lit';
|
|
15
|
+
import buttonGroupStyles from './button-group.styles.js';
|
|
17
16
|
import type { SynergyFormControl } from '../../internal/synergy-element.js';
|
|
18
17
|
import { enableDefaultSettings } from '../../utilities/defaultSettings/decorator.js';
|
|
19
18
|
|
|
@@ -43,26 +42,31 @@ import { enableDefaultSettings } from '../../utilities/defaultSettings/decorator
|
|
|
43
42
|
*/
|
|
44
43
|
@enableDefaultSettings('SynButton')
|
|
45
44
|
export default class SynButton extends SynergyElement implements SynergyFormControl {
|
|
46
|
-
static styles: CSSResultGroup = [componentStyles, styles,
|
|
45
|
+
static styles: CSSResultGroup = [componentStyles, styles, buttonGroupStyles];
|
|
46
|
+
|
|
47
47
|
static dependencies = {
|
|
48
48
|
'syn-icon': SynIcon,
|
|
49
|
-
'syn-spinner': SynSpinner
|
|
49
|
+
'syn-spinner': SynSpinner,
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
private readonly formControlController = new FormControlController(this, {
|
|
53
|
-
assumeInteractionOn: ['click']
|
|
53
|
+
assumeInteractionOn: ['click'],
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');
|
|
57
|
+
|
|
57
58
|
private readonly localize = new LocalizeController(this);
|
|
58
59
|
|
|
59
60
|
@query('.button') button: HTMLButtonElement | HTMLLinkElement;
|
|
61
|
+
|
|
60
62
|
@query('slot:not([name])') defaultSlot: HTMLSlotElement;
|
|
61
63
|
|
|
62
64
|
@state() private iconOnly = false;
|
|
63
65
|
|
|
64
66
|
@state() private hasFocus = false;
|
|
67
|
+
|
|
65
68
|
@state() invalid = false;
|
|
69
|
+
|
|
66
70
|
@property({ reflect: true }) title = ''; // make reactive to pass through
|
|
67
71
|
|
|
68
72
|
/** The button's theme variant. */
|
|
@@ -72,13 +76,13 @@ export default class SynButton extends SynergyElement implements SynergyFormCont
|
|
|
72
76
|
@property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';
|
|
73
77
|
|
|
74
78
|
/** Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior. */
|
|
75
|
-
@property({
|
|
79
|
+
@property({ reflect: true, type: Boolean }) caret = false;
|
|
76
80
|
|
|
77
81
|
/** Disables the button. */
|
|
78
|
-
@property({
|
|
82
|
+
@property({ reflect: true, type: Boolean }) disabled = false;
|
|
79
83
|
|
|
80
84
|
/** Draws the button in a loading state. */
|
|
81
|
-
@property({
|
|
85
|
+
@property({ reflect: true, type: Boolean }) loading = false;
|
|
82
86
|
|
|
83
87
|
/**
|
|
84
88
|
* The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native
|
|
@@ -135,24 +139,19 @@ export default class SynButton extends SynergyElement implements SynergyFormCont
|
|
|
135
139
|
@property({ attribute: 'formnovalidate', type: Boolean }) formNoValidate: boolean;
|
|
136
140
|
|
|
137
141
|
/** Used to override the form owner's `target` attribute. */
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
138
143
|
@property({ attribute: 'formtarget' }) formTarget: '_self' | '_blank' | '_parent' | '_top' | string;
|
|
139
144
|
|
|
140
145
|
/** Gets the validity state object */
|
|
141
146
|
get validity() {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return validValidityState;
|
|
147
|
+
return this.isButton()
|
|
148
|
+
? (this.button as HTMLButtonElement).validity
|
|
149
|
+
: validValidityState;
|
|
147
150
|
}
|
|
148
151
|
|
|
149
152
|
/** Gets the validation message */
|
|
150
153
|
get validationMessage() {
|
|
151
|
-
|
|
152
|
-
return (this.button as HTMLButtonElement).validationMessage;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return '';
|
|
154
|
+
return this.isButton() ? (this.button as HTMLButtonElement).validationMessage : '';
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
firstUpdated() {
|
|
@@ -187,16 +186,16 @@ export default class SynButton extends SynergyElement implements SynergyFormCont
|
|
|
187
186
|
}
|
|
188
187
|
|
|
189
188
|
private isButton() {
|
|
190
|
-
return this.href
|
|
189
|
+
return !this.href;
|
|
191
190
|
}
|
|
192
191
|
|
|
193
192
|
private isLink() {
|
|
194
|
-
return this.href
|
|
193
|
+
return !!this.href;
|
|
195
194
|
}
|
|
196
195
|
|
|
197
196
|
private handleSlotChange() {
|
|
198
197
|
const textContent = getTextContent(this.defaultSlot).trim();
|
|
199
|
-
const assignedElements = this.defaultSlot.assignedElements({flatten: true})
|
|
198
|
+
const assignedElements = this.defaultSlot.assignedElements({flatten: true});
|
|
200
199
|
const iconOnlyElement = assignedElements.length === 1 && assignedElements[0].tagName.toLowerCase() === 'syn-icon';
|
|
201
200
|
|
|
202
201
|
this.iconOnly = iconOnlyElement && textContent === '';
|
|
@@ -227,11 +226,7 @@ export default class SynButton extends SynergyElement implements SynergyFormCont
|
|
|
227
226
|
|
|
228
227
|
/** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
|
|
229
228
|
checkValidity() {
|
|
230
|
-
|
|
231
|
-
return (this.button as HTMLButtonElement).checkValidity();
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return true;
|
|
229
|
+
return this.isButton() ? (this.button as HTMLButtonElement).checkValidity() : true;
|
|
235
230
|
}
|
|
236
231
|
|
|
237
232
|
/** Gets the associated form, if one exists. */
|
|
@@ -241,11 +236,7 @@ export default class SynButton extends SynergyElement implements SynergyFormCont
|
|
|
241
236
|
|
|
242
237
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
243
238
|
reportValidity() {
|
|
244
|
-
|
|
245
|
-
return (this.button as HTMLButtonElement).reportValidity();
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
return true;
|
|
239
|
+
return this.isButton() ? (this.button as HTMLButtonElement).reportValidity() : true;
|
|
249
240
|
}
|
|
250
241
|
|
|
251
242
|
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
|
@@ -256,32 +247,32 @@ export default class SynButton extends SynergyElement implements SynergyFormCont
|
|
|
256
247
|
}
|
|
257
248
|
}
|
|
258
249
|
|
|
250
|
+
// eslint-disable-next-line complexity
|
|
259
251
|
render() {
|
|
260
252
|
const isLink = this.isLink();
|
|
261
253
|
const tag = isLink ? literal`a` : literal`button`;
|
|
262
254
|
|
|
263
|
-
/* eslint-disable lit/no-invalid-html */
|
|
264
|
-
/* eslint-disable lit/binding-positions */
|
|
255
|
+
/* eslint-disable @typescript-eslint/unbound-method, lit/binding-positions, lit/no-invalid-html */
|
|
265
256
|
return html`
|
|
266
257
|
<${tag}
|
|
267
258
|
part="base"
|
|
268
259
|
class=${classMap({
|
|
269
260
|
button: true,
|
|
270
|
-
'button--primary': true,
|
|
271
|
-
'button--text': this.variant === 'text',
|
|
272
|
-
'button--small': this.size === 'small',
|
|
273
|
-
'button--medium': this.size === 'medium',
|
|
274
|
-
'button--large': this.size === 'large',
|
|
275
261
|
'button--caret': this.caret,
|
|
276
262
|
'button--disabled': this.disabled,
|
|
263
|
+
'button--filled': this.variant === 'filled',
|
|
277
264
|
'button--focused': this.hasFocus,
|
|
265
|
+
'button--has-label': this.hasSlotController.test('[default]'),
|
|
266
|
+
'button--has-prefix': this.hasSlotController.test('prefix'),
|
|
267
|
+
'button--has-suffix': this.hasSlotController.test('suffix'),
|
|
268
|
+
'button--large': this.size === 'large',
|
|
278
269
|
'button--loading': this.loading,
|
|
279
|
-
'button--
|
|
270
|
+
'button--medium': this.size === 'medium',
|
|
280
271
|
'button--outline': this.variant === 'outline',
|
|
272
|
+
'button--primary': true,
|
|
281
273
|
'button--rtl': this.localize.dir() === 'rtl',
|
|
282
|
-
'button--
|
|
283
|
-
'button--
|
|
284
|
-
'button--has-suffix': this.hasSlotController.test('suffix')
|
|
274
|
+
'button--small': this.size === 'small',
|
|
275
|
+
'button--text': this.variant === 'text',
|
|
285
276
|
})}
|
|
286
277
|
?disabled=${ifDefined(isLink ? undefined : this.disabled)}
|
|
287
278
|
type=${ifDefined(isLink ? undefined : this.type)}
|
|
@@ -301,15 +292,12 @@ export default class SynButton extends SynergyElement implements SynergyFormCont
|
|
|
301
292
|
@click=${this.handleClick}
|
|
302
293
|
>
|
|
303
294
|
<slot name="prefix" part="prefix" class="button__prefix"></slot>
|
|
304
|
-
<slot part="label" class=${classMap({ '
|
|
295
|
+
<slot part="label" class=${classMap({ 'button__icon-only': this.iconOnly, button__label: true })} @slotchange=${this.handleSlotChange}></slot>
|
|
305
296
|
<slot name="suffix" part="suffix" class="button__suffix"></slot>
|
|
306
|
-
${
|
|
307
|
-
this.caret ? html` <syn-icon part="caret" class="button__caret" library="system" name="chevron-down"></syn-icon> ` : ''
|
|
308
|
-
}
|
|
297
|
+
${this.caret ? html` <syn-icon part="caret" class="button__caret" library="system" name="chevron-down"></syn-icon> ` : ''}
|
|
309
298
|
${this.loading ? html`<syn-spinner part="spinner"></syn-spinner>` : ''}
|
|
310
299
|
</${tag}>
|
|
311
300
|
`;
|
|
312
|
-
/* eslint-enable lit/no-invalid-html */
|
|
313
|
-
/* eslint-enable lit/binding-positions */
|
|
301
|
+
/* eslint-enable @typescript-eslint/unbound-method, lit/binding-positions, lit/no-invalid-html */
|
|
314
302
|
}
|
|
315
303
|
}
|