@synergy-design-system/mcp 2.7.0 → 2.8.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 +11 -0
- package/metadata/checksum.txt +1 -1
- package/metadata/packages/components/components/syn-alert/component.styles.ts +126 -26
- package/metadata/packages/components/components/syn-alert/component.ts +1 -2
- package/metadata/packages/components/components/syn-popup/component.styles.ts +24 -17
- package/metadata/packages/components/components/syn-popup/component.ts +1 -2
- package/metadata/packages/components/components/syn-tooltip/component.styles.ts +15 -10
- package/metadata/packages/components/components/syn-tooltip/component.ts +13 -5
- package/metadata/packages/components/components/syn-validate/component.angular.ts +9 -0
- package/metadata/packages/components/components/syn-validate/component.react.ts +8 -0
- package/metadata/packages/components/components/syn-validate/component.ts +106 -8
- package/metadata/packages/components/components/syn-validate/component.vue +9 -0
- package/metadata/packages/components/static/CHANGELOG.md +16 -0
- package/metadata/packages/tokens/CHANGELOG.md +11 -0
- package/metadata/packages/tokens/dark.css +1 -1
- package/metadata/packages/tokens/index.js +1 -1
- package/metadata/packages/tokens/light.css +1 -1
- package/metadata/packages/tokens/sick2018_dark.css +1 -1
- package/metadata/packages/tokens/sick2018_light.css +1 -1
- package/metadata/packages/tokens/sick2025_dark.css +1 -1
- package/metadata/packages/tokens/sick2025_light.css +1 -1
- package/metadata/static/components/syn-validate/docs.md +33 -6
- package/package.json +5 -5
- package/metadata/packages/components/components/syn-alert/component.custom.styles.ts +0 -136
- package/metadata/packages/components/components/syn-popup/component.custom.styles.ts +0 -18
- package/metadata/packages/components/components/syn-tooltip/component.custom.styles.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1192](https://github.com/synergy-design-system/synergy-design-system/pull/1192) [`31c54c0`](https://github.com/synergy-design-system/synergy-design-system/commit/31c54c04a651a14e20bc5f4b2aff1bd92ad26bc0) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-03-02
|
|
8
|
+
|
|
9
|
+
feat: ✨ New variant `tooltip` for `<syn-validate>` (#664)
|
|
10
|
+
|
|
11
|
+
`<syn-validate>` received the option to show validation errors using `<syn-tooltip>`.
|
|
12
|
+
To use this feature, set the `variant` property to `tooltip`.
|
|
13
|
+
|
|
3
14
|
## 2.7.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/metadata/checksum.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8e6d1d17a574847bbf85bc978ec6d9c9
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
import { css } from 'lit';
|
|
3
2
|
|
|
4
3
|
export default css`
|
|
5
|
-
|
|
4
|
+
/* stylelint-disable no-descending-specificity */
|
|
6
5
|
:host {
|
|
7
6
|
display: contents;
|
|
8
7
|
|
|
@@ -11,19 +10,54 @@ export default css`
|
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
.alert {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/* Defines the used border and icon color for variants */
|
|
14
|
+
--variant-color-border: var(--syn-alert-informative-color-border);
|
|
15
|
+
--variant-color-background: var(--syn-alert-informative-color-background);
|
|
16
|
+
--variant-color-icon: var(--syn-alert-informative-color-icon);
|
|
17
|
+
--variant-color-indicator: var(--syn-alert-informative-color-indicator);
|
|
18
|
+
|
|
19
|
+
/* Defines special settings for sizes */
|
|
20
|
+
--size-font-size: var(--syn-font-size-medium);
|
|
21
|
+
--size-icon-size: var(--syn-font-size-x-large);
|
|
22
|
+
--size-min-height: 54px;
|
|
23
|
+
--size-message-padding: var(--syn-spacing-medium) var(--syn-spacing-large) var(--syn-spacing-medium) var(--syn-spacing-medium);
|
|
24
|
+
--size-icon-padding-block: var(--syn-spacing-medium);
|
|
25
|
+
--size-icon-padding-inline: var(--syn-spacing-medium);
|
|
26
|
+
|
|
16
27
|
align-items: stretch;
|
|
17
|
-
background-color: var(--
|
|
18
|
-
border:
|
|
19
|
-
border-
|
|
20
|
-
border-radius: var(--syn-border-radius-
|
|
28
|
+
background-color: var(--variant-color-background);
|
|
29
|
+
border: var(--syn-panel-border-width) solid var(--variant-color-border);
|
|
30
|
+
border-left: 0;
|
|
31
|
+
border-radius: var(--syn-border-radius-none);
|
|
32
|
+
box-sizing: content-box;
|
|
33
|
+
color: var(--syn-typography-color-text);
|
|
34
|
+
display: flex;
|
|
21
35
|
font-family: var(--syn-font-sans);
|
|
22
|
-
font-size: var(--
|
|
36
|
+
font-size: var(--size-font-size);
|
|
23
37
|
font-weight: var(--syn-font-weight-normal);
|
|
24
|
-
line-height:
|
|
25
|
-
color: var(--syn-color-neutral-700);
|
|
38
|
+
line-height: var(--syn-line-height-normal);
|
|
26
39
|
margin: inherit;
|
|
40
|
+
min-height: var(--size-min-height);
|
|
41
|
+
position: relative;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Add back the items left borders
|
|
46
|
+
* This is done to prevent border clipping with the large border-left needed on .alert
|
|
47
|
+
* Note we also need to adjust our paddings to add the border width here
|
|
48
|
+
*/
|
|
49
|
+
.alert::before {
|
|
50
|
+
background: var(--variant-color-indicator);
|
|
51
|
+
bottom: -1px;
|
|
52
|
+
content: "";
|
|
53
|
+
left: 0;
|
|
54
|
+
position: absolute;
|
|
55
|
+
top: -1px;
|
|
56
|
+
width: var(--syn-spacing-2x-small);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.alert :first-child {
|
|
60
|
+
margin-inline-start: var(--syn-spacing-2x-small);
|
|
27
61
|
}
|
|
28
62
|
|
|
29
63
|
.alert:not(.alert--has-icon) .alert__icon,
|
|
@@ -31,12 +65,17 @@ export default css`
|
|
|
31
65
|
display: none;
|
|
32
66
|
}
|
|
33
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Make sure everything is aligned to top
|
|
70
|
+
*/
|
|
34
71
|
.alert__icon {
|
|
35
|
-
|
|
72
|
+
align-items: flex-start;
|
|
73
|
+
color: var(--variant-color-icon);
|
|
36
74
|
display: flex;
|
|
37
|
-
|
|
38
|
-
font-size: var(--
|
|
39
|
-
padding-
|
|
75
|
+
flex: 0 0 auto;
|
|
76
|
+
font-size: var(--size-icon-size);
|
|
77
|
+
padding-block-start: var(--size-icon-padding-block);
|
|
78
|
+
padding-inline-start: var(--size-icon-padding-inline);
|
|
40
79
|
}
|
|
41
80
|
|
|
42
81
|
.alert--has-countdown {
|
|
@@ -44,28 +83,34 @@ export default css`
|
|
|
44
83
|
}
|
|
45
84
|
|
|
46
85
|
.alert__message {
|
|
47
|
-
|
|
86
|
+
align-self: center;
|
|
48
87
|
display: block;
|
|
49
|
-
|
|
88
|
+
flex: 1 1 auto;
|
|
89
|
+
padding: var(--size-message-padding);
|
|
50
90
|
}
|
|
51
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Close Icon
|
|
94
|
+
*/
|
|
52
95
|
.alert__close-button {
|
|
53
|
-
|
|
96
|
+
align-items: flex-start;
|
|
97
|
+
align-self: start; /* #1135: Fix alignment for the close icon */
|
|
98
|
+
color: var(--syn-typography-color-text);
|
|
54
99
|
display: flex;
|
|
55
|
-
|
|
56
|
-
font-size: var(--
|
|
57
|
-
margin-
|
|
58
|
-
|
|
100
|
+
flex: 0 0 auto;
|
|
101
|
+
font-size: var(--size-icon-size);
|
|
102
|
+
margin-block: calc(var(--syn-spacing-x-small) - var(--syn-panel-border-width));
|
|
103
|
+
margin-inline-end: var(--syn-spacing-x-small);
|
|
59
104
|
}
|
|
60
105
|
|
|
61
106
|
.alert__countdown {
|
|
62
|
-
|
|
107
|
+
background-color: var(--syn-panel-border-color);
|
|
63
108
|
bottom: 0;
|
|
109
|
+
display: flex;
|
|
110
|
+
height: calc(var(--syn-panel-border-width) * 3);
|
|
64
111
|
left: 0;
|
|
112
|
+
position: absolute;
|
|
65
113
|
width: 100%;
|
|
66
|
-
height: calc(var(--syn-panel-border-width) * 3);
|
|
67
|
-
background-color: var(--syn-panel-border-color);
|
|
68
|
-
display: flex;
|
|
69
114
|
}
|
|
70
115
|
|
|
71
116
|
.alert__countdown--ltr {
|
|
@@ -97,6 +142,61 @@ export default css`
|
|
|
97
142
|
background-color: var(--syn-color-danger-600);
|
|
98
143
|
}
|
|
99
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Variant colors
|
|
147
|
+
*/
|
|
148
|
+
.alert--success {
|
|
149
|
+
--variant-color-border: var(--syn-alert-success-color-border);
|
|
150
|
+
--variant-color-background: var(--syn-alert-success-color-background);
|
|
151
|
+
--variant-color-icon: var(--syn-alert-success-color-icon);
|
|
152
|
+
--variant-color-indicator: var(--syn-alert-success-color-indicator);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.alert--neutral {
|
|
156
|
+
--variant-color-border: var(--syn-alert-neutral-color-border);
|
|
157
|
+
--variant-color-background: var(--syn-alert-neutral-color-background);
|
|
158
|
+
--variant-color-icon: var(--syn-alert-neutral-color-icon);
|
|
159
|
+
--variant-color-indicator: var(--syn-alert-neutral-color-indicator);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.alert--warning {
|
|
163
|
+
--variant-color-border: var(--syn-alert-warning-color-border);
|
|
164
|
+
--variant-color-background: var(--syn-alert-warning-color-background);
|
|
165
|
+
--variant-color-icon: var(--syn-alert-warning-color-icon);
|
|
166
|
+
--variant-color-indicator: var(--syn-alert-warning-color-indicator);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.alert--danger {
|
|
170
|
+
--variant-color-border: var(--syn-alert-error-color-border);
|
|
171
|
+
--variant-color-background: var(--syn-alert-error-color-background);
|
|
172
|
+
--variant-color-icon: var(--syn-alert-error-color-icon);
|
|
173
|
+
--variant-color-indicator: var(--syn-alert-error-color-indicator);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* #1119: Alert Sizes */
|
|
177
|
+
.alert--small {
|
|
178
|
+
--size-font-size: var(--syn-font-size-small);
|
|
179
|
+
--size-icon-size: var(--syn-font-size-large);
|
|
180
|
+
--size-min-height: 44px;
|
|
181
|
+
--size-message-padding: var(--syn-spacing-small) var(--syn-spacing-large) var(--syn-spacing-small) var(--syn-spacing-small);
|
|
182
|
+
--size-icon-padding-block: var(--syn-spacing-small);
|
|
183
|
+
--size-icon-padding-inline: var(--syn-spacing-small);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Adjust close button size for small alerts */
|
|
187
|
+
.alert--small .alert__close-button {
|
|
188
|
+
font-size: var(--syn-font-size-medium);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.alert--large {
|
|
192
|
+
--size-font-size: var(--syn-font-size-large);
|
|
193
|
+
--size-icon-size: var(--syn-font-size-2x-large);
|
|
194
|
+
--size-min-height: 68px;
|
|
195
|
+
--size-message-padding: var(--syn-spacing-medium-large) var(--syn-spacing-large) var(--syn-spacing-medium-large) var(--syn-spacing-medium-large);
|
|
196
|
+
--size-icon-padding-block: var(--syn-spacing-medium-large);
|
|
197
|
+
--size-icon-padding-inline: var(--syn-spacing-medium-large);
|
|
198
|
+
}
|
|
199
|
+
|
|
100
200
|
.alert__timer {
|
|
101
201
|
display: none;
|
|
102
202
|
}
|
|
@@ -13,7 +13,6 @@ import componentStyles from '../../styles/component.styles.js';
|
|
|
13
13
|
import SynergyElement from '../../internal/synergy-element.js';
|
|
14
14
|
import SynIconButton from '../icon-button/icon-button.component.js';
|
|
15
15
|
import styles from './alert.styles.js';
|
|
16
|
-
import customStyles from './alert.custom.styles.js';
|
|
17
16
|
import type { CSSResultGroup } from 'lit';
|
|
18
17
|
import { enableDefaultSettings } from '../../utilities/defaultSettings/decorator.js';
|
|
19
18
|
|
|
@@ -44,7 +43,7 @@ import { enableDefaultSettings } from '../../utilities/defaultSettings/decorator
|
|
|
44
43
|
*/
|
|
45
44
|
@enableDefaultSettings('SynAlert')
|
|
46
45
|
export default class SynAlert extends SynergyElement {
|
|
47
|
-
static styles: CSSResultGroup = [componentStyles, styles
|
|
46
|
+
static styles: CSSResultGroup = [componentStyles, styles];
|
|
48
47
|
static dependencies = { 'syn-icon-button': SynIconButton };
|
|
49
48
|
|
|
50
49
|
private autoHideTimeout: number;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
import { css } from 'lit';
|
|
3
2
|
|
|
4
3
|
export default css`
|
|
5
|
-
/* stylelint-disable */
|
|
6
4
|
:host {
|
|
7
5
|
--arrow-color: var(--syn-color-neutral-1000);
|
|
8
6
|
--arrow-size: 6px;
|
|
@@ -18,10 +16,22 @@ export default css`
|
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
.popup {
|
|
21
|
-
position: absolute;
|
|
22
19
|
isolation: isolate;
|
|
23
|
-
max-width: var(--auto-size-available-width, none);
|
|
24
20
|
max-height: var(--auto-size-available-height, none);
|
|
21
|
+
max-width: var(--auto-size-available-width, none);
|
|
22
|
+
position: absolute;
|
|
23
|
+
|
|
24
|
+
:where(&) {
|
|
25
|
+
background: unset;
|
|
26
|
+
border: unset;
|
|
27
|
+
color: unset;
|
|
28
|
+
height: unset;
|
|
29
|
+
inset: unset;
|
|
30
|
+
margin: unset;
|
|
31
|
+
overflow: unset;
|
|
32
|
+
padding: unset;
|
|
33
|
+
width: unset;
|
|
34
|
+
}
|
|
25
35
|
}
|
|
26
36
|
|
|
27
37
|
.popup--fixed {
|
|
@@ -33,31 +43,28 @@ export default css`
|
|
|
33
43
|
}
|
|
34
44
|
|
|
35
45
|
.popup__arrow {
|
|
36
|
-
|
|
37
|
-
width: calc(var(--arrow-size-diagonal) * 2);
|
|
46
|
+
background: var(--arrow-color);
|
|
38
47
|
height: calc(var(--arrow-size-diagonal) * 2);
|
|
48
|
+
position: absolute;
|
|
39
49
|
rotate: 45deg;
|
|
40
|
-
|
|
50
|
+
width: calc(var(--arrow-size-diagonal) * 2);
|
|
41
51
|
z-index: -1;
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
/* Hover bridge */
|
|
45
|
-
.popup-hover-bridge:not(.popup-hover-bridge--visible) {
|
|
46
|
-
display: none;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
55
|
.popup-hover-bridge {
|
|
50
|
-
position: fixed;
|
|
51
|
-
z-index: calc(var(--syn-z-index-dropdown) - 1);
|
|
52
|
-
top: 0;
|
|
53
|
-
right: 0;
|
|
54
|
-
bottom: 0;
|
|
55
|
-
left: 0;
|
|
56
56
|
clip-path: polygon(
|
|
57
57
|
var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0),
|
|
58
58
|
var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0),
|
|
59
59
|
var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0),
|
|
60
60
|
var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0)
|
|
61
61
|
);
|
|
62
|
+
inset: 0;
|
|
63
|
+
position: fixed;
|
|
64
|
+
z-index: calc(var(--syn-z-index-dropdown) - 1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.popup-hover-bridge:not(.popup-hover-bridge--visible) {
|
|
68
|
+
display: none;
|
|
62
69
|
}
|
|
63
70
|
`;
|
|
@@ -9,7 +9,6 @@ import { property, query } from 'lit/decorators.js';
|
|
|
9
9
|
import componentStyles from '../../styles/component.styles.js';
|
|
10
10
|
import SynergyElement from '../../internal/synergy-element.js';
|
|
11
11
|
import styles from './popup.styles.js';
|
|
12
|
-
import customStyles from './popup.custom.styles.js';
|
|
13
12
|
import type { CSSResultGroup } from 'lit';
|
|
14
13
|
|
|
15
14
|
const SUPPORTS_POPOVER = globalThis?.HTMLElement?.prototype.hasOwnProperty('popover');
|
|
@@ -58,7 +57,7 @@ function isVirtualElement(e: unknown): e is VirtualElement {
|
|
|
58
57
|
* available when using `auto-size`.
|
|
59
58
|
*/
|
|
60
59
|
export default class SynPopup extends SynergyElement {
|
|
61
|
-
static styles: CSSResultGroup = [componentStyles, styles
|
|
60
|
+
static styles: CSSResultGroup = [componentStyles, styles];
|
|
62
61
|
|
|
63
62
|
private anchorEl: Element | VirtualElement | null;
|
|
64
63
|
private cleanup: ReturnType<typeof autoUpdate> | undefined;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
import { css } from 'lit';
|
|
3
2
|
|
|
4
3
|
export default css`
|
|
5
|
-
|
|
4
|
+
/* stylelint-disable property-no-vendor-prefix */
|
|
6
5
|
:host {
|
|
7
6
|
--max-width: 20rem;
|
|
8
7
|
--hide-delay: 0ms;
|
|
@@ -11,6 +10,11 @@ export default css`
|
|
|
11
10
|
display: contents;
|
|
12
11
|
}
|
|
13
12
|
|
|
13
|
+
/** #640: Adjust the zIndex of the arrow to make sure the box-shadow above does not bleed out */
|
|
14
|
+
:host ::part(arrow) {
|
|
15
|
+
z-index: 0 !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
.tooltip {
|
|
15
19
|
--arrow-size: var(--syn-tooltip-arrow-size);
|
|
16
20
|
--arrow-color: var(--syn-tooltip-background-color);
|
|
@@ -37,21 +41,22 @@ export default css`
|
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
.tooltip__body {
|
|
40
|
-
display: block;
|
|
41
|
-
width: max-content;
|
|
42
|
-
max-width: var(--max-width);
|
|
43
|
-
border-radius: var(--syn-tooltip-border-radius);
|
|
44
44
|
background-color: var(--syn-tooltip-background-color);
|
|
45
|
+
border-radius: var(--syn-tooltip-border-radius);
|
|
46
|
+
box-shadow: var(--syn-shadow-large);
|
|
47
|
+
color: var(--syn-tooltip-color);
|
|
48
|
+
display: block;
|
|
45
49
|
font-family: var(--syn-tooltip-font-family);
|
|
46
50
|
font-size: var(--syn-tooltip-font-size);
|
|
47
51
|
font-weight: var(--syn-tooltip-font-weight);
|
|
48
52
|
line-height: var(--syn-tooltip-line-height);
|
|
49
|
-
|
|
50
|
-
white-space: normal;
|
|
51
|
-
color: var(--syn-tooltip-color);
|
|
53
|
+
max-width: var(--max-width);
|
|
52
54
|
padding: var(--syn-tooltip-padding);
|
|
53
55
|
pointer-events: none;
|
|
54
|
-
|
|
56
|
+
text-align: start;
|
|
55
57
|
-webkit-user-select: none;
|
|
58
|
+
user-select: none;
|
|
59
|
+
white-space: normal;
|
|
60
|
+
width: max-content;
|
|
56
61
|
}
|
|
57
62
|
`;
|
|
@@ -4,15 +4,15 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
4
4
|
import { getAnimation, setDefaultAnimation } from '../../utilities/animation-registry.js';
|
|
5
5
|
import { html } from 'lit';
|
|
6
6
|
import { LocalizeController } from '../../utilities/localize.js';
|
|
7
|
-
import { property, query } from 'lit/decorators.js';
|
|
7
|
+
import { property, state, query } from 'lit/decorators.js';
|
|
8
8
|
import { waitForEvent } from '../../internal/event.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 SynPopup from '../popup/popup.component.js';
|
|
13
13
|
import styles from './tooltip.styles.js';
|
|
14
|
-
import customStyles from './tooltip.custom.styles.js';
|
|
15
14
|
import type { CSSResultGroup } from 'lit';
|
|
15
|
+
import type { VirtualElement } from '../popup/popup.component.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @summary Tooltips display additional information based on a specific action.
|
|
@@ -43,7 +43,7 @@ import type { CSSResultGroup } from 'lit';
|
|
|
43
43
|
* @animation tooltip.hide - The animation to use when hiding the tooltip.
|
|
44
44
|
*/
|
|
45
45
|
export default class SynTooltip extends SynergyElement {
|
|
46
|
-
static styles: CSSResultGroup = [componentStyles, styles
|
|
46
|
+
static styles: CSSResultGroup = [componentStyles, styles];
|
|
47
47
|
static dependencies = { 'syn-popup': SynPopup };
|
|
48
48
|
|
|
49
49
|
private hoverTimeout: number;
|
|
@@ -54,6 +54,13 @@ export default class SynTooltip extends SynergyElement {
|
|
|
54
54
|
@query('.tooltip__body') body: HTMLElement;
|
|
55
55
|
@query('syn-popup') popup: SynPopup;
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* The element the tooltip will be anchored to. If the anchor lives outside of the tooltip, you can provide the anchor
|
|
59
|
+
* element `id`, a DOM element reference, or a `VirtualElement`. If the anchor lives inside the tooltip, use the
|
|
60
|
+
* `anchor` slot instead.
|
|
61
|
+
*/
|
|
62
|
+
@state() private anchor: Element | string | VirtualElement | undefined = undefined;
|
|
63
|
+
|
|
57
64
|
/** The tooltip's content. If you need to display HTML, use the `content` slot instead. */
|
|
58
65
|
@property() content = '';
|
|
59
66
|
|
|
@@ -214,7 +221,7 @@ export default class SynTooltip extends SynergyElement {
|
|
|
214
221
|
}
|
|
215
222
|
}
|
|
216
223
|
|
|
217
|
-
@watch(['content', 'distance','placement', 'skidding'])
|
|
224
|
+
@watch(['anchor', 'content', 'distance','placement', 'skidding'])
|
|
218
225
|
async handleOptionsChange() {
|
|
219
226
|
if (this.hasUpdated) {
|
|
220
227
|
await this.updateComplete;
|
|
@@ -258,6 +265,7 @@ export default class SynTooltip extends SynergyElement {
|
|
|
258
265
|
render() {
|
|
259
266
|
return html`
|
|
260
267
|
<syn-popup
|
|
268
|
+
.anchor=${this.anchor}
|
|
261
269
|
part="base"
|
|
262
270
|
exportparts="
|
|
263
271
|
popup:base__popup,
|
|
@@ -275,7 +283,7 @@ export default class SynTooltip extends SynergyElement {
|
|
|
275
283
|
arrow
|
|
276
284
|
hover-bridge
|
|
277
285
|
>
|
|
278
|
-
${'' /*
|
|
286
|
+
${'' /* Always render slotted content in anchor position - it's always visible */}
|
|
279
287
|
<slot slot="anchor" aria-describedby="tooltip"></slot>
|
|
280
288
|
|
|
281
289
|
${'' /* eslint-disable-next-line lit-a11y/accessible-name */}
|
|
@@ -22,16 +22,24 @@ import '@synergy-design-system/components/components/validate/validate.js';
|
|
|
22
22
|
* and showing the validation message in a consistent, user defined way.
|
|
23
23
|
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-validate--docs
|
|
24
24
|
* @dependency syn-alert
|
|
25
|
+
* @dependency syn-tooltip
|
|
25
26
|
*
|
|
26
27
|
* @slot - The form field that should be validated.
|
|
27
28
|
* Avoid slotting in more than one element, as subsequent ones will be ignored.
|
|
28
29
|
*
|
|
29
30
|
* @csspart base - The component's base wrapper.
|
|
30
31
|
* @csspart input-wrapper - The container that wraps the form field.
|
|
32
|
+
*
|
|
31
33
|
* @csspart alert - The syn-alert that is shown when the variant is set to "inline".
|
|
32
34
|
* @csspart alert__base - The container that wraps the alert.
|
|
33
35
|
* @csspart alert__message - The container that wraps the alert message.
|
|
34
36
|
* @csspart alert__icon - The container that wraps the alert icon.
|
|
37
|
+
*
|
|
38
|
+
* @csspart tooltip - The syn-tooltip that is shown when the variant is set to "tooltip".
|
|
39
|
+
* @csspart tooltip__base - The container that wraps the tooltip.
|
|
40
|
+
* @csspart tooltip__popup - The container that wraps the tooltip popup.
|
|
41
|
+
* @csspart tooltip__arrow - The container that wraps the tooltip arrow.
|
|
42
|
+
* @csspart tooltip__body - The container that wraps the tooltip body.
|
|
35
43
|
*/
|
|
36
44
|
@Component({
|
|
37
45
|
selector: 'syn-validate',
|
|
@@ -52,6 +60,7 @@ export class SynValidateComponent {
|
|
|
52
60
|
|
|
53
61
|
The following variants are supported:
|
|
54
62
|
- **native** (default): Uses the native browser validation, usually a browser tooltip.
|
|
63
|
+
- **tooltip**: Show the validation message as a tooltip using a `<syn-tooltip>`.
|
|
55
64
|
- **inline**: Show the validation message underneath the element, using a `<syn-alert>`
|
|
56
65
|
*/
|
|
57
66
|
@Input()
|
|
@@ -16,16 +16,24 @@ Component.define('syn-validate');
|
|
|
16
16
|
* and showing the validation message in a consistent, user defined way.
|
|
17
17
|
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-validate--docs
|
|
18
18
|
* @dependency syn-alert
|
|
19
|
+
* @dependency syn-tooltip
|
|
19
20
|
*
|
|
20
21
|
* @slot - The form field that should be validated.
|
|
21
22
|
* Avoid slotting in more than one element, as subsequent ones will be ignored.
|
|
22
23
|
*
|
|
23
24
|
* @csspart base - The component's base wrapper.
|
|
24
25
|
* @csspart input-wrapper - The container that wraps the form field.
|
|
26
|
+
*
|
|
25
27
|
* @csspart alert - The syn-alert that is shown when the variant is set to "inline".
|
|
26
28
|
* @csspart alert__base - The container that wraps the alert.
|
|
27
29
|
* @csspart alert__message - The container that wraps the alert message.
|
|
28
30
|
* @csspart alert__icon - The container that wraps the alert icon.
|
|
31
|
+
*
|
|
32
|
+
* @csspart tooltip - The syn-tooltip that is shown when the variant is set to "tooltip".
|
|
33
|
+
* @csspart tooltip__base - The container that wraps the tooltip.
|
|
34
|
+
* @csspart tooltip__popup - The container that wraps the tooltip popup.
|
|
35
|
+
* @csspart tooltip__arrow - The container that wraps the tooltip arrow.
|
|
36
|
+
* @csspart tooltip__body - The container that wraps the tooltip body.
|
|
29
37
|
*/
|
|
30
38
|
export const SynValidate = createComponent({
|
|
31
39
|
displayName: 'SynValidate',
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues } from 'lit';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
property,
|
|
5
|
+
query,
|
|
6
|
+
queryAssignedElements,
|
|
7
|
+
state,
|
|
8
|
+
} from 'lit/decorators.js';
|
|
4
9
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
10
|
import componentStyles from '../../styles/component.styles.js';
|
|
6
11
|
import SynergyElement from '../../internal/synergy-element.js';
|
|
7
12
|
import type SynInput from '../input/input.component.js';
|
|
8
13
|
import { watch } from '../../internal/watch.js';
|
|
9
14
|
import SynAlert from '../alert/alert.component.js';
|
|
15
|
+
import SynTooltip from '../tooltip/tooltip.component.js';
|
|
10
16
|
import {
|
|
11
17
|
alertSizeForInput,
|
|
18
|
+
getActualInputElement,
|
|
12
19
|
getEventNameForElement,
|
|
13
20
|
isBlurEvent,
|
|
14
21
|
isInvalidEvent,
|
|
@@ -18,29 +25,49 @@ import {
|
|
|
18
25
|
import styles from './validate.styles.js';
|
|
19
26
|
import { enableDefaultSettings } from '../../utilities/defaultSettings/decorator.js';
|
|
20
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Utility function that renders the default slot content.
|
|
30
|
+
* This is needed to avoid code duplication when rendering the default slot in both the tooltip and the regular render function.
|
|
31
|
+
*/
|
|
32
|
+
const renderDefaultSlot = () => html`
|
|
33
|
+
<slot
|
|
34
|
+
class="validate__input-wrapper"
|
|
35
|
+
part="input-wrapper"
|
|
36
|
+
></slot>
|
|
37
|
+
`;
|
|
38
|
+
|
|
21
39
|
/**
|
|
22
40
|
* @summary Validate provides form field validation messages in a unified way.
|
|
23
41
|
* It does this by using [the native browser validation](https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation)
|
|
24
42
|
* and showing the validation message in a consistent, user defined way.
|
|
25
43
|
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-validate--docs
|
|
26
44
|
* @dependency syn-alert
|
|
45
|
+
* @dependency syn-tooltip
|
|
27
46
|
*
|
|
28
47
|
* @slot - The form field that should be validated.
|
|
29
48
|
* Avoid slotting in more than one element, as subsequent ones will be ignored.
|
|
30
49
|
*
|
|
31
50
|
* @csspart base - The component's base wrapper.
|
|
32
51
|
* @csspart input-wrapper - The container that wraps the form field.
|
|
52
|
+
*
|
|
33
53
|
* @csspart alert - The syn-alert that is shown when the variant is set to "inline".
|
|
34
54
|
* @csspart alert__base - The container that wraps the alert.
|
|
35
55
|
* @csspart alert__message - The container that wraps the alert message.
|
|
36
56
|
* @csspart alert__icon - The container that wraps the alert icon.
|
|
37
|
-
|
|
57
|
+
*
|
|
58
|
+
* @csspart tooltip - The syn-tooltip that is shown when the variant is set to "tooltip".
|
|
59
|
+
* @csspart tooltip__base - The container that wraps the tooltip.
|
|
60
|
+
* @csspart tooltip__popup - The container that wraps the tooltip popup.
|
|
61
|
+
* @csspart tooltip__arrow - The container that wraps the tooltip arrow.
|
|
62
|
+
* @csspart tooltip__body - The container that wraps the tooltip body.
|
|
63
|
+
*/
|
|
38
64
|
@enableDefaultSettings('SynValidate')
|
|
39
65
|
export default class SynValidate extends SynergyElement {
|
|
40
66
|
static styles: CSSResultGroup = [componentStyles, styles];
|
|
41
67
|
|
|
42
68
|
static dependencies = {
|
|
43
69
|
'syn-alert': SynAlert,
|
|
70
|
+
'syn-tooltip': SynTooltip,
|
|
44
71
|
};
|
|
45
72
|
|
|
46
73
|
controller = new AbortController();
|
|
@@ -51,6 +78,8 @@ export default class SynValidate extends SynergyElement {
|
|
|
51
78
|
|
|
52
79
|
@queryAssignedElements() private slottedChildren: HTMLElement[];
|
|
53
80
|
|
|
81
|
+
@query('syn-tooltip') private tooltipElement?: SynTooltip;
|
|
82
|
+
|
|
54
83
|
@state() validationMessage = '';
|
|
55
84
|
|
|
56
85
|
@state() eagerFirstMount = true;
|
|
@@ -61,14 +90,17 @@ export default class SynValidate extends SynergyElement {
|
|
|
61
90
|
|
|
62
91
|
@state() alertSize?: SynInput['size'];
|
|
63
92
|
|
|
93
|
+
@state() hasFocus = false;
|
|
94
|
+
|
|
64
95
|
/**
|
|
65
96
|
* The variant that should be used to show validation alerts.
|
|
66
97
|
*
|
|
67
98
|
* The following variants are supported:
|
|
68
99
|
* - **native** (default): Uses the native browser validation, usually a browser tooltip.
|
|
100
|
+
* - **tooltip**: Show the validation message as a tooltip using a `<syn-tooltip>`.
|
|
69
101
|
* - **inline**: Show the validation message underneath the element, using a `<syn-alert>`
|
|
70
102
|
*/
|
|
71
|
-
@property({ reflect: true }) variant: 'native' | 'inline' = 'native';
|
|
103
|
+
@property({ reflect: true }) variant: 'native' | 'tooltip' | 'inline' = 'native';
|
|
72
104
|
|
|
73
105
|
/** Do not show the error icon when using the inline variant validation */
|
|
74
106
|
@property({ attribute: 'hide-icon', reflect: true, type: Boolean }) hideIcon = false;
|
|
@@ -235,6 +267,20 @@ export default class SynValidate extends SynergyElement {
|
|
|
235
267
|
signal: this.controller.signal,
|
|
236
268
|
});
|
|
237
269
|
}
|
|
270
|
+
|
|
271
|
+
// #664: Add focus/blur listeners specifically for tooltip variant
|
|
272
|
+
// This is needed because we want to show the tooltip on focus and hide it on blur, but only when using the tooltip variant.
|
|
273
|
+
// Otherwise, this would interfere with the native validation tooltip, which also relies on focus and blur events.
|
|
274
|
+
const focusEvent = getEventNameForElement(input, 'focus');
|
|
275
|
+
const blurEvent = getEventNameForElement(input, 'blur');
|
|
276
|
+
|
|
277
|
+
input.addEventListener(focusEvent, this.handleInputFocus, {
|
|
278
|
+
signal: this.controller.signal,
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
input.addEventListener(blurEvent, this.handleInputBlur, {
|
|
282
|
+
signal: this.controller.signal,
|
|
283
|
+
});
|
|
238
284
|
}
|
|
239
285
|
|
|
240
286
|
private setValidationMessage(input: HTMLInputElement) {
|
|
@@ -266,6 +312,17 @@ export default class SynValidate extends SynergyElement {
|
|
|
266
312
|
}
|
|
267
313
|
};
|
|
268
314
|
|
|
315
|
+
/**
|
|
316
|
+
* Handle focus/blur events for tooltip variant
|
|
317
|
+
*/
|
|
318
|
+
private handleInputFocus = () => {
|
|
319
|
+
this.hasFocus = true;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
private handleInputBlur = () => {
|
|
323
|
+
this.hasFocus = false;
|
|
324
|
+
};
|
|
325
|
+
|
|
269
326
|
/**
|
|
270
327
|
* Handle the blur event during validation
|
|
271
328
|
*/
|
|
@@ -439,6 +496,36 @@ export default class SynValidate extends SynergyElement {
|
|
|
439
496
|
this?.sizeObserver?.disconnect();
|
|
440
497
|
}
|
|
441
498
|
|
|
499
|
+
updated(changedProperties: PropertyValues) {
|
|
500
|
+
super.updated(changedProperties);
|
|
501
|
+
|
|
502
|
+
// #664: Make sure to update the syn-tooltip if the validation state changes when using the tooltip variant
|
|
503
|
+
if (this.variant !== 'tooltip') {
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
const tooltip = this.tooltipElement;
|
|
508
|
+
|
|
509
|
+
if (!tooltip) {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// When we have a valid tooltip,
|
|
514
|
+
// we need to update the content and show or hide it based on the validation state and focus state.
|
|
515
|
+
// We have to do this manually, as there is a problem when updating open and content at the same time.
|
|
516
|
+
// The order is critical: fill before showing, don´t update the content during hide.
|
|
517
|
+
const shouldShowTooltip = !this.isValid && this.validationMessage && this.hasFocus;
|
|
518
|
+
|
|
519
|
+
if (shouldShowTooltip) {
|
|
520
|
+
tooltip.content = this.validationMessage;
|
|
521
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
522
|
+
tooltip.show();
|
|
523
|
+
} else {
|
|
524
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
525
|
+
tooltip.hide();
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
442
529
|
private renderInlineValidation() {
|
|
443
530
|
if (this.variant !== 'inline' || !this.validationMessage) {
|
|
444
531
|
return '';
|
|
@@ -462,16 +549,27 @@ export default class SynValidate extends SynergyElement {
|
|
|
462
549
|
}
|
|
463
550
|
|
|
464
551
|
render() {
|
|
552
|
+
// #664: When using the tooltip variant, we need to wrap the default slot in a tooltip when the input is invalid and has a validation message.
|
|
553
|
+
const slotContent = this.variant === 'tooltip'
|
|
554
|
+
? html`
|
|
555
|
+
<syn-tooltip
|
|
556
|
+
.anchor=${getActualInputElement(this.getInput()) as Element ?? undefined}
|
|
557
|
+
exportparts="base:tooltip__base,base__popup:tooltip__popup,base__arrow:tooltip__arrow,body:tooltip__body"
|
|
558
|
+
.open=${this.eager ? !this.isValid && this.validationMessage.length > 0 : false}
|
|
559
|
+
part="tooltip"
|
|
560
|
+
placement="bottom"
|
|
561
|
+
trigger="manual"
|
|
562
|
+
>
|
|
563
|
+
${renderDefaultSlot()}
|
|
564
|
+
</syn-tooltip>
|
|
565
|
+
` : renderDefaultSlot();
|
|
566
|
+
|
|
465
567
|
return html`
|
|
466
568
|
<div
|
|
467
569
|
class="validate"
|
|
468
570
|
part="base"
|
|
469
571
|
>
|
|
470
|
-
|
|
471
|
-
class="validate__input-wrapper"
|
|
472
|
-
part="input-wrapper"
|
|
473
|
-
></slot>
|
|
474
|
-
|
|
572
|
+
${slotContent}
|
|
475
573
|
${this.renderInlineValidation()}
|
|
476
574
|
</div>
|
|
477
575
|
`;
|
|
@@ -11,16 +11,24 @@
|
|
|
11
11
|
* and showing the validation message in a consistent, user defined way.
|
|
12
12
|
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-validate--docs
|
|
13
13
|
* @dependency syn-alert
|
|
14
|
+
* @dependency syn-tooltip
|
|
14
15
|
*
|
|
15
16
|
* @slot - The form field that should be validated.
|
|
16
17
|
* Avoid slotting in more than one element, as subsequent ones will be ignored.
|
|
17
18
|
*
|
|
18
19
|
* @csspart base - The component's base wrapper.
|
|
19
20
|
* @csspart input-wrapper - The container that wraps the form field.
|
|
21
|
+
*
|
|
20
22
|
* @csspart alert - The syn-alert that is shown when the variant is set to "inline".
|
|
21
23
|
* @csspart alert__base - The container that wraps the alert.
|
|
22
24
|
* @csspart alert__message - The container that wraps the alert message.
|
|
23
25
|
* @csspart alert__icon - The container that wraps the alert icon.
|
|
26
|
+
*
|
|
27
|
+
* @csspart tooltip - The syn-tooltip that is shown when the variant is set to "tooltip".
|
|
28
|
+
* @csspart tooltip__base - The container that wraps the tooltip.
|
|
29
|
+
* @csspart tooltip__popup - The container that wraps the tooltip popup.
|
|
30
|
+
* @csspart tooltip__arrow - The container that wraps the tooltip arrow.
|
|
31
|
+
* @csspart tooltip__body - The container that wraps the tooltip body.
|
|
24
32
|
*/
|
|
25
33
|
import { computed, ref } from 'vue';
|
|
26
34
|
import '@synergy-design-system/components/components/validate/validate.js';
|
|
@@ -41,6 +49,7 @@ const props = defineProps<{
|
|
|
41
49
|
|
|
42
50
|
The following variants are supported:
|
|
43
51
|
- **native** (default): Uses the native browser validation, usually a browser tooltip.
|
|
52
|
+
- **tooltip**: Show the validation message as a tooltip using a `<syn-tooltip>`.
|
|
44
53
|
- **inline**: Show the validation message underneath the element, using a `<syn-alert>`
|
|
45
54
|
*/
|
|
46
55
|
variant?: SynValidate['variant'];
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1192](https://github.com/synergy-design-system/synergy-design-system/pull/1192) [`31c54c0`](https://github.com/synergy-design-system/synergy-design-system/commit/31c54c04a651a14e20bc5f4b2aff1bd92ad26bc0) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-03-02
|
|
8
|
+
|
|
9
|
+
feat: ✨ New variant `tooltip` for `<syn-validate>` (#664)
|
|
10
|
+
|
|
11
|
+
`<syn-validate>` received the option to show validation errors using `<syn-tooltip>`.
|
|
12
|
+
To use this feature, set the `variant` property to `tooltip`.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`31c54c0`](https://github.com/synergy-design-system/synergy-design-system/commit/31c54c04a651a14e20bc5f4b2aff1bd92ad26bc0)]:
|
|
17
|
+
- @synergy-design-system/tokens@3.6.0
|
|
18
|
+
|
|
3
19
|
## 3.5.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1192](https://github.com/synergy-design-system/synergy-design-system/pull/1192) [`31c54c0`](https://github.com/synergy-design-system/synergy-design-system/commit/31c54c04a651a14e20bc5f4b2aff1bd92ad26bc0) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-03-02
|
|
8
|
+
|
|
9
|
+
feat: ✨ New variant `tooltip` for `<syn-validate>` (#664)
|
|
10
|
+
|
|
11
|
+
`<syn-validate>` received the option to show validation errors using `<syn-tooltip>`.
|
|
12
|
+
To use this feature, set the `variant` property to `tooltip`.
|
|
13
|
+
|
|
3
14
|
## 3.5.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
|
@@ -25,6 +25,33 @@ Validate offers options for convenient error handling in form elements.
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
## Tooltip Variant
|
|
29
|
+
|
|
30
|
+
When the tooltip variant is chosen, validation errors are displayed in a <syn-tooltip> component that has its center at the invalid element. The native tooltip is suppressed.
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<form id="components-syn-validate--tooltip-variant-validate-demo-form">
|
|
34
|
+
<syn-validate class="validation-tooltip" variant="tooltip" on="live">
|
|
35
|
+
<syn-input
|
|
36
|
+
label="Invalid input"
|
|
37
|
+
type="email"
|
|
38
|
+
value="team(at)synergy.com"
|
|
39
|
+
required=""
|
|
40
|
+
title=""
|
|
41
|
+
size="medium"
|
|
42
|
+
form=""
|
|
43
|
+
></syn-input>
|
|
44
|
+
</syn-validate>
|
|
45
|
+
<p>
|
|
46
|
+
<syn-button type="submit" title="" variant="outline" size="medium"
|
|
47
|
+
>Submit</syn-button
|
|
48
|
+
>
|
|
49
|
+
</p>
|
|
50
|
+
</form>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
28
55
|
## Inline Variant
|
|
29
56
|
|
|
30
57
|
Set the variant attribute to inline to show the invalid message below the selected element.👨💻 Additional developer Information:Per default, syn-validate uses the browser’s built-in validation. This shows only one error at a time and is optimized for accessbility.When using the inline variant, you have to ensure accessibility on your side and have to have in mind it most likely will lead to layout shifts.
|
|
@@ -33,7 +60,7 @@ Set the variant attribute to inline to show the invalid message below the select
|
|
|
33
60
|
<form id="components-syn-validate--inline-variant-validate-demo-form">
|
|
34
61
|
<syn-validate class="validation-inline" variant="inline" on="">
|
|
35
62
|
<syn-input
|
|
36
|
-
label="Inline
|
|
63
|
+
label="Inline validation"
|
|
37
64
|
type="email"
|
|
38
65
|
value="team(at)synergy.com"
|
|
39
66
|
title=""
|
|
@@ -65,7 +92,7 @@ Use hide-icon to hide the icon in inline style. This is especially useful when s
|
|
|
65
92
|
on=""
|
|
66
93
|
>
|
|
67
94
|
<syn-input
|
|
68
|
-
label="
|
|
95
|
+
label="Hide icon"
|
|
69
96
|
type="email"
|
|
70
97
|
value="team(at)synergy.com"
|
|
71
98
|
title=""
|
|
@@ -95,9 +122,9 @@ In development use the size attribute of the form element e.g. syn-input to set
|
|
|
95
122
|
>
|
|
96
123
|
<syn-validate eager="" variant="inline" on="">
|
|
97
124
|
<syn-input
|
|
98
|
-
label="Inline Validation"
|
|
99
125
|
type="email"
|
|
100
126
|
value="team(at)synergy.com"
|
|
127
|
+
label="Size small"
|
|
101
128
|
size="small"
|
|
102
129
|
title=""
|
|
103
130
|
form=""
|
|
@@ -106,9 +133,9 @@ In development use the size attribute of the form element e.g. syn-input to set
|
|
|
106
133
|
|
|
107
134
|
<syn-validate eager="" variant="inline" on="">
|
|
108
135
|
<syn-input
|
|
109
|
-
label="Inline Validation"
|
|
110
136
|
type="email"
|
|
111
137
|
value="team(at)synergy.com"
|
|
138
|
+
label="Size medium"
|
|
112
139
|
size="medium"
|
|
113
140
|
title=""
|
|
114
141
|
form=""
|
|
@@ -117,9 +144,9 @@ In development use the size attribute of the form element e.g. syn-input to set
|
|
|
117
144
|
|
|
118
145
|
<syn-validate eager="" variant="inline" on="">
|
|
119
146
|
<syn-input
|
|
120
|
-
label="Inline Validation"
|
|
121
147
|
type="email"
|
|
122
148
|
value="team(at)synergy.com"
|
|
149
|
+
label="Size large"
|
|
123
150
|
size="large"
|
|
124
151
|
title=""
|
|
125
152
|
form=""
|
|
@@ -206,7 +233,7 @@ Wrap the element around any other form field, that follows browser standards to
|
|
|
206
233
|
<form id="components-syn-validate--custom-form-field-validate-demo-form">
|
|
207
234
|
<h3 style="margin: 0; padding: 0">Choose SICK´s brand color</h3>
|
|
208
235
|
<syn-validate class="validation-custom-form-field" on="live" variant="inline">
|
|
209
|
-
<validate-demo-radio name="color"></validate-demo-radio>
|
|
236
|
+
<validate-demo-radio name="color" required=""></validate-demo-radio>
|
|
210
237
|
</syn-validate>
|
|
211
238
|
|
|
212
239
|
<p>
|
package/package.json
CHANGED
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"serve-handler": "^6.1.6",
|
|
29
29
|
"ts-jest": "^29.4.6",
|
|
30
30
|
"typescript": "^5.9.3",
|
|
31
|
+
"@synergy-design-system/components": "3.6.0",
|
|
31
32
|
"@synergy-design-system/docs": "0.1.0",
|
|
32
|
-
"@synergy-design-system/eslint-config-syn": "^0.1.0",
|
|
33
33
|
"@synergy-design-system/fonts": "1.0.3",
|
|
34
|
-
"@synergy-design-system/
|
|
35
|
-
"@synergy-design-system/
|
|
36
|
-
"@synergy-design-system/
|
|
34
|
+
"@synergy-design-system/tokens": "^3.6.0",
|
|
35
|
+
"@synergy-design-system/eslint-config-syn": "^0.1.0",
|
|
36
|
+
"@synergy-design-system/styles": "2.0.1"
|
|
37
37
|
},
|
|
38
38
|
"exports": {
|
|
39
39
|
".": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"directory": "packages/mcp"
|
|
68
68
|
},
|
|
69
69
|
"type": "module",
|
|
70
|
-
"version": "2.
|
|
70
|
+
"version": "2.8.0",
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "pnpm run build:ts && pnpm run build:metadata && pnpm build:hash",
|
|
73
73
|
"build:all": "pnpm run build && pnpm run build:storybook",
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
|
|
3
|
-
export default css`
|
|
4
|
-
.alert {
|
|
5
|
-
/* Defines the used border and icon color for variants */
|
|
6
|
-
--variant-color-border: var(--syn-alert-informative-color-border);
|
|
7
|
-
--variant-color-background: var(--syn-alert-informative-color-background);
|
|
8
|
-
--variant-color-icon: var(--syn-alert-informative-color-icon);
|
|
9
|
-
--variant-color-indicator: var(--syn-alert-informative-color-indicator);
|
|
10
|
-
|
|
11
|
-
/* Defines special settings for sizes */
|
|
12
|
-
--size-font-size: var(--syn-font-size-medium);
|
|
13
|
-
--size-icon-size: var(--syn-font-size-x-large);
|
|
14
|
-
--size-min-height: 54px;
|
|
15
|
-
--size-message-padding: var(--syn-spacing-medium) var(--syn-spacing-large) var(--syn-spacing-medium) var(--syn-spacing-medium);
|
|
16
|
-
--size-icon-padding-block: var(--syn-spacing-medium);
|
|
17
|
-
--size-icon-padding-inline: var(--syn-spacing-medium);
|
|
18
|
-
|
|
19
|
-
background-color: var(--variant-color-background);
|
|
20
|
-
border: var(--syn-panel-border-width) solid var(--variant-color-border);
|
|
21
|
-
border-left: 0;
|
|
22
|
-
border-radius: var(--syn-border-radius-none);
|
|
23
|
-
box-sizing: content-box;
|
|
24
|
-
color: var(--syn-typography-color-text);
|
|
25
|
-
font-size: var(--size-font-size);
|
|
26
|
-
line-height: var(--syn-line-height-normal);
|
|
27
|
-
min-height: var(--size-min-height);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Add back the items left borders
|
|
32
|
-
* This is done to prevent border clipping with the large border-left needed on .alert
|
|
33
|
-
* Note we also need to adjust our paddings to add the border width here
|
|
34
|
-
*/
|
|
35
|
-
.alert::before {
|
|
36
|
-
background: var(--variant-color-indicator);
|
|
37
|
-
bottom: -1px;
|
|
38
|
-
content: "";
|
|
39
|
-
left: 0;
|
|
40
|
-
position: absolute;
|
|
41
|
-
top: -1px;
|
|
42
|
-
width: var(--syn-spacing-2x-small);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.alert :first-child {
|
|
46
|
-
margin-inline-start: var(--syn-spacing-2x-small);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Make sure everything is aligned to top
|
|
51
|
-
*/
|
|
52
|
-
.alert__icon,
|
|
53
|
-
.alert__close-button {
|
|
54
|
-
align-items: flex-start;
|
|
55
|
-
font-size: var(--size-icon-size);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.alert__message {
|
|
59
|
-
align-self: center;
|
|
60
|
-
padding: var(--size-message-padding);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Alert Icon
|
|
65
|
-
*/
|
|
66
|
-
.alert__icon {
|
|
67
|
-
color: var(--variant-color-icon);
|
|
68
|
-
padding-block-start: var(--size-icon-padding-block);
|
|
69
|
-
padding-inline-start: var(--size-icon-padding-inline);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Close Icon
|
|
74
|
-
*/
|
|
75
|
-
.alert__close-button {
|
|
76
|
-
align-self: start; /* #1135: Fix alignment for the close icon */
|
|
77
|
-
color: var(--syn-typography-color-text);
|
|
78
|
-
margin-block: calc(var(--syn-spacing-x-small) - var(--syn-panel-border-width));
|
|
79
|
-
margin-inline-end: var(--syn-spacing-x-small);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Variant colors
|
|
84
|
-
*/
|
|
85
|
-
.alert--success {
|
|
86
|
-
--variant-color-border: var(--syn-alert-success-color-border);
|
|
87
|
-
--variant-color-background: var(--syn-alert-success-color-background);
|
|
88
|
-
--variant-color-icon: var(--syn-alert-success-color-icon);
|
|
89
|
-
--variant-color-indicator: var(--syn-alert-success-color-indicator);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.alert--neutral {
|
|
93
|
-
--variant-color-border: var(--syn-alert-neutral-color-border);
|
|
94
|
-
--variant-color-background: var(--syn-alert-neutral-color-background);
|
|
95
|
-
--variant-color-icon: var(--syn-alert-neutral-color-icon);
|
|
96
|
-
--variant-color-indicator: var(--syn-alert-neutral-color-indicator);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.alert--warning {
|
|
100
|
-
--variant-color-border: var(--syn-alert-warning-color-border);
|
|
101
|
-
--variant-color-background: var(--syn-alert-warning-color-background);
|
|
102
|
-
--variant-color-icon: var(--syn-alert-warning-color-icon);
|
|
103
|
-
--variant-color-indicator: var(--syn-alert-warning-color-indicator);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.alert--danger {
|
|
107
|
-
--variant-color-border: var(--syn-alert-error-color-border);
|
|
108
|
-
--variant-color-background: var(--syn-alert-error-color-background);
|
|
109
|
-
--variant-color-icon: var(--syn-alert-error-color-icon);
|
|
110
|
-
--variant-color-indicator: var(--syn-alert-error-color-indicator);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/* #1119: Alert Sizes */
|
|
114
|
-
.alert--small {
|
|
115
|
-
--size-font-size: var(--syn-font-size-small);
|
|
116
|
-
--size-icon-size: var(--syn-font-size-large);
|
|
117
|
-
--size-min-height: 44px;
|
|
118
|
-
--size-message-padding: var(--syn-spacing-small) var(--syn-spacing-large) var(--syn-spacing-small) var(--syn-spacing-small);
|
|
119
|
-
--size-icon-padding-block: var(--syn-spacing-small);
|
|
120
|
-
--size-icon-padding-inline: var(--syn-spacing-small);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* Adjust close button size for small alerts */
|
|
124
|
-
.alert--small .alert__close-button {
|
|
125
|
-
font-size: var(--syn-font-size-medium);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.alert--large {
|
|
129
|
-
--size-font-size: var(--syn-font-size-large);
|
|
130
|
-
--size-icon-size: var(--syn-font-size-2x-large);
|
|
131
|
-
--size-min-height: 68px;
|
|
132
|
-
--size-message-padding: var(--syn-spacing-medium-large) var(--syn-spacing-large) var(--syn-spacing-medium-large) var(--syn-spacing-medium-large);
|
|
133
|
-
--size-icon-padding-block: var(--syn-spacing-medium-large);
|
|
134
|
-
--size-icon-padding-inline: var(--syn-spacing-medium-large);
|
|
135
|
-
}
|
|
136
|
-
`;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
|
|
3
|
-
export default css`
|
|
4
|
-
.popup {
|
|
5
|
-
/* Clear UA styles for [popover] */
|
|
6
|
-
:where(&) {
|
|
7
|
-
background: unset;
|
|
8
|
-
border: unset;
|
|
9
|
-
color: unset;
|
|
10
|
-
height: unset;
|
|
11
|
-
inset: unset;
|
|
12
|
-
margin: unset;
|
|
13
|
-
overflow: unset;
|
|
14
|
-
padding: unset;
|
|
15
|
-
width: unset;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
|
|
3
|
-
export default css`
|
|
4
|
-
/* Write custom CSS here */
|
|
5
|
-
.tooltip__body {
|
|
6
|
-
box-shadow: var(--syn-shadow-large);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/** #640: Adjust the zIndex of the arrow to make sure the box-shadow above does not bleed out */
|
|
10
|
-
:host ::part(arrow) {
|
|
11
|
-
z-index: 0 !important;
|
|
12
|
-
}
|
|
13
|
-
`;
|