|
32 | 32 | export let actionText: string = ""; |
33 | 33 | export let visible: boolean = true; |
34 | 34 | export let animationDirection: TemporaryNotificationAnimationDirection = "down"; |
| 35 | +
|
| 36 | + // Icon size for success/failure icons |
| 37 | + const iconSize = "large"; |
35 | 38 | </script> |
36 | 39 |
|
37 | 40 | <div |
|
48 | 51 | data-testid={testid} |
49 | 52 | > |
50 | 53 | {#if type === "success"} |
51 | | - <goa-icon type="checkmark-circle" /> |
| 54 | + <goa-icon type="checkmark-circle" size={iconSize} /> |
52 | 55 | {/if} |
53 | 56 |
|
54 | 57 | {#if type === "failure"} |
55 | | - <goa-icon type="close-circle" /> |
| 58 | + <goa-icon type="close-circle" size={iconSize} /> |
56 | 59 | {/if} |
57 | 60 |
|
58 | 61 | <span class="message"> |
|
82 | 85 | flex-direction: row; |
83 | 86 | flex-wrap: wrap; |
84 | 87 | align-items: center; |
85 | | - border-radius: var(--goa-border-radius-m); |
86 | | - gap: var(--goa-space-m); |
87 | | - padding: var(--goa-space-m) var(--goa-space-l); |
88 | | - max-width: 640px; |
89 | | - color: var(--goa-color-text-light); |
90 | | - transition: transform 0.3s ease, opacity 0.3s ease; |
| 88 | + border-radius: var(--goa-temporary-notification-borderRadius, var(--goa-border-radius-m)); |
| 89 | + row-gap: var(--goa-temporary-notification-row-gap, var(--goa-space-s)); |
| 90 | + column-gap: var(--goa-temporary-notification-column-gap, var(--goa-space-m)); |
| 91 | + padding: var(--goa-temporary-notification-padding, var(--goa-space-m) var(--goa-space-l)); |
| 92 | + max-width: var(--goa-temporary-notification-max-width, 640px); |
| 93 | + color: var(--goa-temporary-notification-color-text, var(--goa-color-text-light)); |
| 94 | + transition: |
| 95 | + transform var(--goa-temporary-notification-transition-duration, 0.3s) ease, |
| 96 | + opacity var(--goa-temporary-notification-transition-duration, 0.3s) ease; |
91 | 97 | overflow: hidden; |
92 | 98 | } |
93 | 99 |
|
| 100 | + /* Add extra bottom padding when progress bar is present */ |
| 101 | + .snackbar.progress, |
| 102 | + .snackbar.indeterminate { |
| 103 | + padding: var(--goa-temporary-notification-padding-with-progress, var(--goa-space-m) var(--goa-space-l) 22px var(--goa-space-l)); |
| 104 | + } |
| 105 | +
|
| 106 | + /* Icon spacing - 12px margin to the right */ |
| 107 | + .snackbar goa-icon { |
| 108 | + margin-right: var(--goa-temporary-notification-icon-margin, var(--goa-space-s)); |
| 109 | + margin-left: calc(-1 * var(--goa-temporary-notification-column-gap, var(--goa-space-m))); |
| 110 | + } |
| 111 | +
|
94 | 112 | @media (--not-mobile) { |
95 | 113 | .snackbar { |
96 | | - min-width: 360px; |
| 114 | + min-width: var(--goa-temporary-notification-min-width-desktop, 360px); |
97 | 115 | } |
98 | 116 | } |
99 | 117 |
|
|
107 | 125 | .snackbar.basic, |
108 | 126 | .snackbar.indeterminate, |
109 | 127 | .snackbar.progress { |
110 | | - border: 1px solid var(--goa-color-greyscale-700); |
111 | | - background: var(--goa-color-greyscale-black); |
| 128 | + border: var(--goa-temporary-notification-borderWidth, var(--goa-border-width-s)) solid var(--goa-temporary-notification-color-border, var(--goa-color-greyscale-700)); |
| 129 | + background: var(--goa-temporary-notification-color-bg-basic, var(--goa-color-greyscale-black)); |
112 | 130 | } |
113 | 131 |
|
114 | 132 | .action { |
|
123 | 141 | bottom: 0; |
124 | 142 | left: 0; |
125 | 143 | width: 100%; |
126 | | - height: 6px; |
| 144 | + height: var(--goa-temporary-notification-progress-bar-height, 6px); |
| 145 | + border-radius: 0 0 var(--goa-temporary-notification-progress-bar-borderRadius, 0) var(--goa-temporary-notification-progress-bar-borderRadius, 0); |
| 146 | + } |
| 147 | +
|
| 148 | + /* Progress bar browser-specific styling */ |
| 149 | + progress::-webkit-progress-bar { |
| 150 | + background-color: var(--goa-temporary-notification-progress-bar-color-bg, #adadad); |
| 151 | + border-radius: 0 0 var(--goa-temporary-notification-progress-bar-borderRadius, 0) var(--goa-temporary-notification-progress-bar-borderRadius, 0); |
| 152 | + } |
| 153 | +
|
| 154 | + progress::-webkit-progress-value { |
| 155 | + background-color: var(--goa-temporary-notification-progress-bar-color-fill, white); |
| 156 | + border-radius: 0 0 var(--goa-temporary-notification-progress-bar-borderRadius, 0) var(--goa-temporary-notification-progress-bar-borderRadius, 0); |
| 157 | + } |
| 158 | +
|
| 159 | + progress::-moz-progress-bar { |
| 160 | + background-color: var(--goa-temporary-notification-progress-bar-color-fill, white); |
| 161 | + border-radius: 0 0 var(--goa-temporary-notification-progress-bar-borderRadius, 0) var(--goa-temporary-notification-progress-bar-borderRadius, 0); |
127 | 162 | } |
128 | 163 |
|
129 | 164 | .show { |
|
143 | 178 | } |
144 | 179 |
|
145 | 180 | .hide.animate-up { |
146 | | - transform: translateY(-100px); |
| 181 | + transform: translateY(calc(-1 * var(--goa-temporary-notification-animation-distance, 100px))); |
147 | 182 | } |
148 | 183 |
|
149 | 184 | .hide.animate-down { |
150 | | - transform: translateY(100px); |
| 185 | + transform: translateY(var(--goa-temporary-notification-animation-distance, 100px)); |
151 | 186 | } |
152 | 187 |
|
153 | 188 | .snackbar.success { |
154 | | - background: var(--goa-color-success-default); |
| 189 | + background: var(--goa-temporary-notification-color-bg-success, var(--goa-color-success-default)); |
155 | 190 | } |
156 | 191 |
|
157 | 192 | .snackbar.failure { |
158 | | - background: var(--goa-color-emergency-default); |
| 193 | + background: var(--goa-temporary-notification-color-bg-failure, var(--goa-color-emergency-default)); |
159 | 194 | } |
160 | 195 |
|
161 | 196 | .message { |
162 | 197 | flex: 1 1 auto; |
163 | | - font: var(--goa-typography-body-m); |
| 198 | + font: var(--goa-temporary-notification-typography, var(--goa-typography-body-m)); |
| 199 | + padding-top: var(--goa-temporary-notification-padding-text-top, 0); |
164 | 200 | } |
165 | 201 | </style> |
0 commit comments