@snack-uikit/alert 0.13.2 → 0.13.3-preview-4ab4d581.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/dist/components/Alert/Alert.js +1 -1
- package/dist/components/Alert/styles.module.css +8 -8
- package/dist/components/AlertTop/styles.module.css +4 -4
- package/dist/helperComponents/styles.module.css +2 -2
- package/package.json +2 -2
- package/src/components/Alert/Alert.tsx +1 -1
- package/src/components/Alert/styles.module.scss +11 -8
|
@@ -27,5 +27,5 @@ export function Alert(_a) {
|
|
|
27
27
|
var { icon = true, title, truncate, link, description, onClose, appearance = APPEARANCE.Neutral, className, actions, outline, size = 'm' } = _a, rest = __rest(_a, ["icon", "title", "truncate", "link", "description", "onClose", "appearance", "className", "actions", "outline", "size"]);
|
|
28
28
|
return (_jsxs("div", Object.assign({ className: cn(styles.alert, {
|
|
29
29
|
[styles.alertOutline]: outline,
|
|
30
|
-
}, className) }, extractSupportProps(rest), { "data-color": APPEARANCE_TO_COLOR_MAP[appearance], "data-size": size, children: [_jsxs("div", { className: styles.body, "data-size": size, children: [icon && (_jsx("div", { className: styles.icon, "data-color": APPEARANCE_TO_COLOR_MAP[appearance], "data-test-id": 'alert__icon', "data-size": size, children: getIcon(appearance, size === 's' ? 16 : 24) })), _jsxs("div", { className: styles.contentLayout, children: [title && (_jsx(TruncateString, { text: title, maxLines: (_b = truncate === null || truncate === void 0 ? void 0 : truncate.title) !== null && _b !== void 0 ? _b : 1, className: styles.title, "data-test-id": 'alert__title', "data-size": size })), _jsx("span", { "data-test-id": 'alert__description', className: styles.description, "data-size": size, children: description }), link && (_jsx("span", { children: _jsx(Link, Object.assign({}, link, { appearance: APPEARANCE_TO_LINK_COLOR_MAP[appearance], textMode: 'default', size: size, "data-test-id": 'alert__link' })) }))] }), onClose && (_jsx(AlertButton, { onClick: onClose, appearance: APPEARANCE_TO_COLOR_MAP[appearance], icon: _jsx(CrossSVG, {}), variant: 'simple', dataTestId: 'alert__close-button' }))] }), actions && (_jsxs("div", { className: styles.footer, "data-size": size, children: [actions.primary && (_jsx(AlertButton, Object.assign({}, actions.primary, { appearance: APPEARANCE_TO_COLOR_MAP[appearance], variant: 'simple', size: size }))), (actions === null || actions === void 0 ? void 0 : actions.secondary) && (_jsx(AlertButton, Object.assign({}, actions.secondary, { appearance: APPEARANCE_TO_COLOR_MAP[appearance], variant: 'simple', size: size })))] }))] })));
|
|
30
|
+
}, className) }, extractSupportProps(rest), { "data-color": APPEARANCE_TO_COLOR_MAP[appearance], "data-size": size, children: [_jsxs("div", { className: styles.body, "data-size": size, children: [icon && (_jsx("div", { className: styles.icon, "data-color": APPEARANCE_TO_COLOR_MAP[appearance], "data-test-id": 'alert__icon', "data-size": size, children: getIcon(appearance, size === 's' ? 16 : 24) })), _jsxs("div", { className: styles.contentLayout, "data-size": size, children: [title && (_jsx(TruncateString, { text: title, maxLines: (_b = truncate === null || truncate === void 0 ? void 0 : truncate.title) !== null && _b !== void 0 ? _b : 1, className: styles.title, "data-test-id": 'alert__title', "data-size": size })), _jsx("span", { "data-test-id": 'alert__description', className: styles.description, "data-size": size, children: description }), link && (_jsx("span", { children: _jsx(Link, Object.assign({}, link, { appearance: APPEARANCE_TO_LINK_COLOR_MAP[appearance], textMode: 'default', size: size, "data-test-id": 'alert__link' })) }))] }), onClose && (_jsx(AlertButton, { onClick: onClose, appearance: APPEARANCE_TO_COLOR_MAP[appearance], icon: _jsx(CrossSVG, {}), variant: 'simple', dataTestId: 'alert__close-button' }))] }), actions && (_jsxs("div", { className: styles.footer, "data-size": size, children: [actions.primary && (_jsx(AlertButton, Object.assign({}, actions.primary, { appearance: APPEARANCE_TO_COLOR_MAP[appearance], variant: 'simple', size: size }))), (actions === null || actions === void 0 ? void 0 : actions.secondary) && (_jsx(AlertButton, Object.assign({}, actions.secondary, { appearance: APPEARANCE_TO_COLOR_MAP[appearance], variant: 'simple', size: size })))] }))] })));
|
|
31
31
|
}
|
|
@@ -146,6 +146,14 @@
|
|
|
146
146
|
color:var(--sys-neutral-text-main, #41424e);
|
|
147
147
|
}
|
|
148
148
|
.title[data-size=s]{
|
|
149
|
+
font-family:var(--sans-label-m-font-family, SB Sans Interface);
|
|
150
|
+
font-weight:var(--sans-label-m-font-weight, Semibold);
|
|
151
|
+
line-height:var(--sans-label-m-line-height, 16px);
|
|
152
|
+
font-size:var(--sans-label-m-font-size, 12px);
|
|
153
|
+
letter-spacing:var(--sans-label-m-letter-spacing, 0px);
|
|
154
|
+
paragraph-spacing:var(--sans-label-m-paragraph-spacing, 6.6px);
|
|
155
|
+
}
|
|
156
|
+
.title[data-size=m]{
|
|
149
157
|
font-family:var(--sans-title-s-font-family, SB Sans Interface);
|
|
150
158
|
font-weight:var(--sans-title-s-font-weight, Semibold);
|
|
151
159
|
line-height:var(--sans-title-s-line-height, 20px);
|
|
@@ -153,14 +161,6 @@
|
|
|
153
161
|
letter-spacing:var(--sans-title-s-letter-spacing, 0.15px);
|
|
154
162
|
paragraph-spacing:var(--sans-title-s-paragraph-spacing, 7.7px);
|
|
155
163
|
}
|
|
156
|
-
.title[data-size=m]{
|
|
157
|
-
font-family:var(--sans-title-m-font-family, SB Sans Interface);
|
|
158
|
-
font-weight:var(--sans-title-m-font-weight, Semibold);
|
|
159
|
-
line-height:var(--sans-title-m-line-height, 24px);
|
|
160
|
-
font-size:var(--sans-title-m-font-size, 16px);
|
|
161
|
-
letter-spacing:var(--sans-title-m-letter-spacing, 0.15px);
|
|
162
|
-
paragraph-spacing:var(--sans-title-m-paragraph-spacing, 8.8px);
|
|
163
|
-
}
|
|
164
164
|
|
|
165
165
|
.description{
|
|
166
166
|
color:var(--sys-neutral-text-support, #6d707f);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
box-sizing:border-box;
|
|
10
10
|
}
|
|
11
11
|
.alertTop[data-color=invert-neutral]{
|
|
12
|
-
background-color:var(--sys-invert-neutral-background, #
|
|
12
|
+
background-color:var(--sys-invert-neutral-background, #30303c);
|
|
13
13
|
}
|
|
14
14
|
.alertTop[data-color=primary]{
|
|
15
15
|
background-color:var(--sys-primary-accent-default, #794ed3);
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
color:var(--sys-red-on-accent, #fffbf9);
|
|
43
43
|
}
|
|
44
44
|
.icon[data-color=yellow]{
|
|
45
|
-
color:var(--sys-yellow-on-accent, #
|
|
45
|
+
color:var(--sys-yellow-on-accent, #583f1f);
|
|
46
46
|
}
|
|
47
47
|
.icon[data-color=green]{
|
|
48
48
|
color:var(--sys-green-on-accent, #fcfefa);
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
color:var(--sys-red-on-accent, #fffbf9);
|
|
74
74
|
}
|
|
75
75
|
.title[data-color=yellow]{
|
|
76
|
-
color:var(--sys-yellow-on-accent, #
|
|
76
|
+
color:var(--sys-yellow-on-accent, #583f1f);
|
|
77
77
|
}
|
|
78
78
|
.title[data-color=green]{
|
|
79
79
|
color:var(--sys-green-on-accent, #fcfefa);
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
color:var(--sys-red-on-accent, #fffbf9);
|
|
102
102
|
}
|
|
103
103
|
.description[data-color=yellow]{
|
|
104
|
-
color:var(--sys-yellow-on-accent, #
|
|
104
|
+
color:var(--sys-yellow-on-accent, #583f1f);
|
|
105
105
|
}
|
|
106
106
|
.description[data-color=green]{
|
|
107
107
|
color:var(--sys-green-on-accent, #fcfefa);
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
border-radius:var(--radius-alert-button, 8px);
|
|
66
66
|
}
|
|
67
67
|
.alertButton[data-variant=simple]:focus-visible{
|
|
68
|
-
outline-color:var(--sys-available-complementary, #
|
|
68
|
+
outline-color:var(--sys-available-complementary, #1c1c24);
|
|
69
69
|
outline-offset:var(--spacing-state-focus-offset, 2px);
|
|
70
70
|
}
|
|
71
71
|
.alertButton[data-variant=simple][data-appearance=neutral]{
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
color:var(--sys-red-on-accent, #fffbf9);
|
|
162
162
|
}
|
|
163
163
|
.alertButton[data-variant=tonal][data-appearance=yellow]{
|
|
164
|
-
color:var(--sys-yellow-on-accent, #
|
|
164
|
+
color:var(--sys-yellow-on-accent, #583f1f);
|
|
165
165
|
}
|
|
166
166
|
.alertButton[data-variant=tonal][data-appearance=green]{
|
|
167
167
|
color:var(--sys-green-on-accent, #fcfefa);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Alert",
|
|
7
|
-
"version": "0.13.
|
|
7
|
+
"version": "0.13.3-preview-4ab4d581.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@snack-uikit/utils": "3.3.0",
|
|
40
40
|
"classnames": "2.3.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "0d52e9b583e9a990834cd94ec67277bdd27651c1"
|
|
43
43
|
}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
$colors: 'neutral', 'primary', 'red', 'yellow', 'green', 'blue';
|
|
5
5
|
$sizes: 's', 'm';
|
|
6
|
-
$icons: (
|
|
6
|
+
$icons: (
|
|
7
|
+
's': 'xs',
|
|
8
|
+
'm': 's',
|
|
9
|
+
);
|
|
7
10
|
|
|
8
11
|
.alert {
|
|
9
12
|
display: flex;
|
|
@@ -70,8 +73,6 @@ $icons: ('s': 'xs', 'm': 's');
|
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
.contentLayout {
|
|
@@ -90,10 +91,12 @@ $icons: ('s': 'xs', 'm': 's');
|
|
|
90
91
|
.title {
|
|
91
92
|
color: $sys-neutral-text-main;
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
&[data-size='s'] {
|
|
95
|
+
@include composite-var($sans-label-m);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&[data-size='m'] {
|
|
99
|
+
@include composite-var($sans-title-s);
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
|
|
@@ -103,7 +106,7 @@ $icons: ('s': 'xs', 'm': 's');
|
|
|
103
106
|
|
|
104
107
|
@each $size in $sizes {
|
|
105
108
|
&[data-size='#{$size}'] {
|
|
106
|
-
@include composite-var($theme-variables, 'sans', 'body', $size)
|
|
109
|
+
@include composite-var($theme-variables, 'sans', 'body', $size);
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
}
|