@viasat/beam-styles 2.0.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.
Files changed (76) hide show
  1. package/README.md +150 -0
  2. package/all.scss +3 -0
  3. package/components/accordion.module.scss +166 -0
  4. package/components/accordion.vars.scss +3 -0
  5. package/components/actionList.module.scss +211 -0
  6. package/components/actionList.vars.scss +6 -0
  7. package/components/alert.module.scss +158 -0
  8. package/components/aspectRatio.module.scss +21 -0
  9. package/components/avatar.module.scss +204 -0
  10. package/components/badge.module.scss +166 -0
  11. package/components/badgeDot.module.scss +90 -0
  12. package/components/box.module.scss +127 -0
  13. package/components/breadcrumbs.module.scss +149 -0
  14. package/components/button.module.scss +179 -0
  15. package/components/button.vars.scss +129 -0
  16. package/components/card.module.scss +232 -0
  17. package/components/checkbox.module.scss +123 -0
  18. package/components/chip.module.scss +173 -0
  19. package/components/chipsGroup.module.scss +13 -0
  20. package/components/closeButton.module.scss +52 -0
  21. package/components/combobox.module.scss +243 -0
  22. package/components/dialog.module.scss +199 -0
  23. package/components/divider.module.scss +255 -0
  24. package/components/emptyState.module.scss +61 -0
  25. package/components/fileUpload.module.scss +282 -0
  26. package/components/flag.module.scss +11 -0
  27. package/components/floatingui.module.scss +40 -0
  28. package/components/header.module.scss +123 -0
  29. package/components/helperText.module.scss +86 -0
  30. package/components/icon.module.scss +46 -0
  31. package/components/icon.vars.scss +31 -0
  32. package/components/index.scss +40 -0
  33. package/components/inputChoiceGroup.module.scss +46 -0
  34. package/components/label.module.scss +67 -0
  35. package/components/link.module.scss +118 -0
  36. package/components/list.module.scss +204 -0
  37. package/components/logo.module.scss +11 -0
  38. package/components/menu.module.scss +13 -0
  39. package/components/nativeSelect.module.scss +139 -0
  40. package/components/navigation.module.scss +156 -0
  41. package/components/pageHeader.module.scss +93 -0
  42. package/components/pageLayout.module.scss +38 -0
  43. package/components/pagination.module.scss +71 -0
  44. package/components/popover.module.scss +71 -0
  45. package/components/progressBar.module.scss +107 -0
  46. package/components/radioButton.module.scss +115 -0
  47. package/components/segmentedControl.module.scss +212 -0
  48. package/components/sideNav.module.scss +355 -0
  49. package/components/slider.module.scss +240 -0
  50. package/components/spinner.module.scss +261 -0
  51. package/components/spinner.vars.scss +85 -0
  52. package/components/stepper.module.scss +255 -0
  53. package/components/switch.module.scss +194 -0
  54. package/components/tabs.module.scss +412 -0
  55. package/components/text.module.scss +112 -0
  56. package/components/textArea.module.scss +183 -0
  57. package/components/textField.module.scss +162 -0
  58. package/components/toast.module.scss +235 -0
  59. package/components/toastContainer.module.scss +68 -0
  60. package/components/tooltip.module.scss +112 -0
  61. package/package.json +47 -0
  62. package/styles.css +11719 -0
  63. package/styles.css.map +1 -0
  64. package/styles.min.css +20 -0
  65. package/styles.min.css.map +1 -0
  66. package/utils/animation.scss +13 -0
  67. package/utils/constants.scss +1 -0
  68. package/utils/cursors.scss +35 -0
  69. package/utils/globals.scss +17 -0
  70. package/utils/helpers.scss +14 -0
  71. package/utils/index.scss +10 -0
  72. package/utils/mixins.scss +93 -0
  73. package/utils/spacing.scss +82 -0
  74. package/utils/stateLayer.module.scss +55 -0
  75. package/utils/stateLayerVars.scss +75 -0
  76. package/utils/tokens.scss +14 -0
@@ -0,0 +1,183 @@
1
+ @use 'sass:map';
2
+ @use '../utils/constants.scss';
3
+ @use '../utils/mixins.scss' as mixins;
4
+ @use '../utils/tokens.scss' as tokens;
5
+ @use '../utils/cursors.scss' as cursors;
6
+
7
+ @import '../../../../tokens/src/lib/components/Input';
8
+
9
+ $textAreaBaseClass: '#{constants.$prefix}text-area';
10
+
11
+ $textAreaCursor: '--#{constants.$prefix}text-field-cursor';
12
+ $textAreaInputCursor: '--#{constants.$prefix}text-field-input-cursor';
13
+
14
+ $labelSpaceBottom: '--#{constants.$prefix}label-space-bottom';
15
+ $helperTextSpaceTop: '--#{constants.$prefix}helper-text-space-top';
16
+
17
+ $resizeIconFlip: '--#{constants.$prefix}resize-icon-flip';
18
+ $resizeIcon: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSJub25lIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzY0NjIyXzQ4MzUzKSI+CjxwYXRoIGQ9Ik0xOC4zMzMzIDE4LjMzMzNIMTYuNjY2N1YxNi42NjY3SDE4LjMzMzNWMTguMzMzM1pNMTguMzMzMyAxNUgxNi42NjY3VjEzLjMzMzNIMTguMzMzM1YxNVpNMTUgMTguMzMzM0gxMy4zMzMzVjE2LjY2NjdIMTVWMTguMzMzM1pNMTUgMTVIMTMuMzMzM1YxMy4zMzMzSDE1VjE1Wk0xMS42NjY3IDE4LjMzMzNIMTBWMTYuNjY2N0gxMS42NjY3VjE4LjMzMzNaTTE4LjMzMzMgMTEuNjY2N0gxNi42NjY3VjEwSDE4LjMzMzNWMTEuNjY2N3oiIGZpbGw9IiM0NjU5NjciLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF82NDYyMl80ODM1MyI+CjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4=');
19
+
20
+ $stateStyleTokens: (
21
+ error: (
22
+ color: tokens.$bm-comp-input-color-text,
23
+ backgroundColor: tokens.$bm-comp-input-color-bg,
24
+ svgColor: tokens.$bm-comp-input-color-icon-error,
25
+ borderColor: tokens.$bm-comp-input-color-border-error,
26
+ counterColor: tokens.$bm-comp-input-color-text-placeholder,
27
+ placeholderColor: tokens.$bm-comp-input-color-text-placeholder,
28
+ ),
29
+ read-only: (
30
+ color: tokens.$bm-comp-input-color-text,
31
+ backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
32
+ svgColor: tokens.$bm-comp-input-color-icon,
33
+ borderColor: tokens.$bm-comp-input-color-border-disabled,
34
+ counterColor: tokens.$bm-comp-input-color-text-placeholder,
35
+ placeholderColor: tokens.$bm-comp-input-color-text-placeholder,
36
+ ),
37
+ disabled: (
38
+ color: tokens.$bm-comp-input-color-text-disabled,
39
+ backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
40
+ svgColor: tokens.$bm-comp-input-color-text-disabled,
41
+ borderColor: tokens.$bm-comp-input-color-border-disabled,
42
+ counterColor: tokens.$bm-comp-input-color-text-disabled,
43
+ placeholderColor: tokens.$bm-comp-input-color-text-disabled,
44
+ ),
45
+ );
46
+
47
+ .#{$textAreaBaseClass} {
48
+ @include cursors.applyTextCursors();
49
+ max-width: tokens.$bm-comp-input-size-field-width;
50
+
51
+ #{$labelSpaceBottom}: #{tokens.$bm-comp-label-space-bottom};
52
+ #{$helperTextSpaceTop}: #{tokens.$bm-comp-helper-text-space-top};
53
+
54
+ @each $state, $styleTokens in $stateStyleTokens {
55
+ &--#{$state} &__header &__counter {
56
+ color: map.get($styleTokens, counterColor);
57
+ }
58
+
59
+ &--#{$state} &__field &__input {
60
+ color: map.get($styleTokens, color);
61
+ border-color: map.get($styleTokens, borderColor);
62
+ background-color: map.get($styleTokens, backgroundColor);
63
+
64
+ &::placeholder {
65
+ color: map.get($styleTokens, placeholderColor);
66
+ }
67
+
68
+ @if ($state == error) {
69
+ @include mixins.simulated-inset-outline(
70
+ tokens.$bm-comp-input-border-width-field-error,
71
+ solid,
72
+ map.get($styleTokens, borderColor),
73
+ calc(0px - #{tokens.$bm-comp-input-border-width-field-error})
74
+ );
75
+ }
76
+ }
77
+ }
78
+
79
+ &--fluid {
80
+ max-width: 100%;
81
+ }
82
+
83
+ @-moz-document url-prefix() {
84
+ &__field:after {
85
+ display: none;
86
+ }
87
+ }
88
+
89
+ &--hide-resize &__field:after {
90
+ display: none;
91
+ }
92
+
93
+ &--hide-resize &__field &__input {
94
+ resize: none;
95
+ }
96
+
97
+ &--cols-width {
98
+ max-width: fit-content;
99
+ }
100
+
101
+ &--cols-width &__field &__input {
102
+ width: auto;
103
+ }
104
+
105
+ &__header {
106
+ display: flex;
107
+ gap: tokens.$bm-sem-space-50;
108
+ }
109
+
110
+ &__header &__counter {
111
+ margin-block-end: auto;
112
+ margin-inline-start: auto;
113
+
114
+ font: tokens.$bm-comp-input-typo-character-count;
115
+ color: tokens.$bm-comp-input-color-text-placeholder;
116
+ padding-block-end: tokens.$bm-comp-label-space-bottom;
117
+ }
118
+
119
+ &__field {
120
+ position: relative;
121
+ cursor: var(#{$textAreaCursor}, default);
122
+
123
+ &:dir(rtl) {
124
+ #{$resizeIconFlip}: -1;
125
+ }
126
+
127
+ &::after {
128
+ content: '';
129
+ position: absolute;
130
+ pointer-events: none;
131
+ width: tokens.$bm-sem-space-125;
132
+ height: tokens.$bm-sem-space-125;
133
+
134
+ @include mixins.svg-icon($resizeIcon);
135
+ inset-block-end: tokens.$bm-sem-space-12;
136
+ inset-inline-end: tokens.$bm-sem-space-12;
137
+ transform: scaleX(var(#{$resizeIconFlip}, 1));
138
+ background-color: tokens.$bm-sem-color-icon-secondary;
139
+ }
140
+ }
141
+
142
+ &__field &__input {
143
+ width: 100%;
144
+ display: block;
145
+ resize: vertical;
146
+ box-sizing: border-box;
147
+
148
+ border-style: solid;
149
+ border-color: tokens.$bm-comp-input-color-border;
150
+ border-radius: tokens.$bm-comp-input-radius-field;
151
+ border-width: tokens.$bm-comp-input-border-width-field-default;
152
+
153
+ color: tokens.$bm-comp-input-color-text;
154
+ font: tokens.$bm-comp-input-typo-default;
155
+ cursor: var(#{$textAreaInputCursor}, text);
156
+ box-shadow: tokens.$bm-comp-input-shadow-field;
157
+ background-color: tokens.$bm-comp-input-color-bg;
158
+ min-height: tokens.$bm-comp-input-size-field-text-area-height;
159
+ padding: tokens.$bm-comp-input-space-field-y tokens.$bm-comp-input-space-field-x;
160
+ transform: translate3d(
161
+ tokens.$bm-sem-space-0,
162
+ tokens.$bm-sem-space-0,
163
+ tokens.$bm-sem-space-0
164
+ );
165
+
166
+ &::-webkit-resizer {
167
+ display: none;
168
+ }
169
+
170
+ &::placeholder {
171
+ color: tokens.$bm-comp-input-color-text-placeholder;
172
+ }
173
+
174
+ &:focus {
175
+ @include mixins.simulated-inset-outline(
176
+ tokens.$bm-sem-border-width-focus,
177
+ solid,
178
+ tokens.$bm-sem-color-border-focus,
179
+ calc(0px - #{tokens.$bm-sem-size-focus-offset})
180
+ );
181
+ }
182
+ }
183
+ }
@@ -0,0 +1,162 @@
1
+ @use 'sass:map';
2
+ @use '../utils/constants.scss';
3
+ @use '../utils/mixins.scss' as mixins;
4
+ @use '../utils/tokens.scss' as tokens;
5
+ @use '../utils/cursors.scss' as cursors;
6
+
7
+ @import '../../../../tokens/src/lib/components/Input';
8
+
9
+ $textFieldBaseClass: '#{constants.$prefix}text-field';
10
+
11
+ $textFieldCursor: '--#{constants.$prefix}text-field-cursor';
12
+ $textFieldInputCursor: '--#{constants.$prefix}text-field-input-cursor';
13
+
14
+ $labelSpaceBottom: '--#{constants.$prefix}label-space-bottom';
15
+ $helperTextSpaceTop: '--#{constants.$prefix}helper-text-space-top';
16
+
17
+ $stateStyleTokens: (
18
+ error: (
19
+ color: tokens.$bm-comp-input-color-text,
20
+ backgroundColor: tokens.$bm-comp-input-color-bg,
21
+ borderColor: tokens.$bm-comp-input-color-border-error,
22
+ placeholderColor: tokens.$bm-comp-input-color-text-placeholder,
23
+ ),
24
+ read-only: (
25
+ color: tokens.$bm-comp-input-color-text,
26
+ svgColor: tokens.$bm-comp-input-color-icon,
27
+ backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
28
+ borderColor: tokens.$bm-comp-input-color-border-disabled,
29
+ placeholderColor: tokens.$bm-comp-input-color-text-placeholder,
30
+ ),
31
+ disabled: (
32
+ color: tokens.$bm-comp-input-color-text-disabled,
33
+ svgColor: tokens.$bm-comp-input-color-text-disabled,
34
+ backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
35
+ borderColor: tokens.$bm-comp-input-color-border-disabled,
36
+ placeholderColor: tokens.$bm-comp-input-color-text-disabled,
37
+ ),
38
+ );
39
+
40
+ .#{$textFieldBaseClass} {
41
+ @include cursors.applyTextCursors();
42
+ max-width: tokens.$bm-comp-input-size-field-width;
43
+
44
+ #{$labelSpaceBottom}: #{tokens.$bm-comp-label-space-bottom};
45
+ #{$helperTextSpaceTop}: #{tokens.$bm-comp-helper-text-space-top};
46
+
47
+ @each $state, $styleTokens in $stateStyleTokens {
48
+ &--#{$state} &__field {
49
+ border-color: map.get($styleTokens, borderColor);
50
+ background-color: map.get($styleTokens, backgroundColor);
51
+
52
+ @if ($state == error) {
53
+ @include mixins.simulated-inset-outline(
54
+ tokens.$bm-comp-input-border-width-field-error,
55
+ solid,
56
+ map.get($styleTokens, borderColor),
57
+ calc(0px - #{tokens.$bm-comp-input-border-width-field-error})
58
+ );
59
+ }
60
+ }
61
+
62
+ &--#{$state} &__field &__input {
63
+ color: map.get($styleTokens, color);
64
+
65
+ &::placeholder {
66
+ color: map.get($styleTokens, placeholderColor);
67
+ }
68
+ }
69
+
70
+ &--#{$state} &__field &__content {
71
+ @if ($state == disabled) {
72
+ opacity: tokens.$bm-sem-opacity-disabled;
73
+ }
74
+
75
+ svg,
76
+ ::slotted([slot*='content']) {
77
+ color: map.get($styleTokens, svgColor);
78
+ }
79
+ }
80
+ }
81
+
82
+ &--fluid {
83
+ max-width: 100%;
84
+ }
85
+
86
+ &--ellipsis &__field &__input {
87
+ overflow: hidden;
88
+ white-space: nowrap;
89
+ text-overflow: ellipsis;
90
+ }
91
+
92
+ &__field {
93
+ display: flex;
94
+ flex-wrap: nowrap;
95
+ align-items: center;
96
+ box-sizing: border-box;
97
+ transform: translate3d(
98
+ tokens.$bm-sem-space-0,
99
+ tokens.$bm-sem-space-0,
100
+ tokens.$bm-sem-space-0
101
+ );
102
+
103
+ border-style: solid;
104
+ border-color: tokens.$bm-comp-input-color-border;
105
+ border-radius: tokens.$bm-comp-input-radius-field;
106
+ border-width: tokens.$bm-comp-input-border-width-field-default;
107
+
108
+ cursor: var(#{$textFieldCursor}, default);
109
+ gap: tokens.$bm-comp-input-space-field-gap;
110
+ box-shadow: tokens.$bm-comp-input-shadow-field;
111
+ background-color: tokens.$bm-comp-input-color-bg;
112
+ height: tokens.$bm-comp-input-size-field-md-height;
113
+ padding: tokens.$bm-comp-input-space-field-y tokens.$bm-comp-input-space-field-x;
114
+
115
+ &:focus-within {
116
+ @include mixins.simulated-inset-outline(
117
+ tokens.$bm-sem-border-width-focus,
118
+ solid,
119
+ tokens.$bm-sem-color-border-focus,
120
+ calc(0px - #{tokens.$bm-sem-size-focus-offset})
121
+ );
122
+ }
123
+ }
124
+
125
+ &__field &__input {
126
+ border: none;
127
+ outline: none;
128
+ background: none;
129
+
130
+ width: 100%;
131
+ padding: tokens.$bm-sem-space-0;
132
+ color: tokens.$bm-comp-input-color-text;
133
+ font: tokens.$bm-comp-input-typo-default;
134
+ cursor: var(#{$textFieldInputCursor}, text);
135
+
136
+ &:-webkit-autofill {
137
+ caret-color: tokens.$bm-comp-input-color-text;
138
+ -webkit-text-fill-color: tokens.$bm-comp-input-color-text;
139
+
140
+ @include mixins.simulated-inset-border(
141
+ tokens.$bm-comp-input-size-field-md-height,
142
+ tokens.$bm-comp-input-color-bg
143
+ );
144
+ }
145
+
146
+ &::placeholder {
147
+ color: tokens.$bm-comp-input-color-text-placeholder;
148
+ }
149
+ }
150
+
151
+ &__field &__content {
152
+ display: flex;
153
+ align-items: center;
154
+
155
+ svg,
156
+ ::slotted([slot*='content']) {
157
+ color: tokens.$bm-comp-input-color-icon;
158
+ width: tokens.$bm-comp-input-size-field-icon;
159
+ height: tokens.$bm-comp-input-size-field-icon;
160
+ }
161
+ }
162
+ }
@@ -0,0 +1,235 @@
1
+ @use 'sass:map';
2
+ @use '../utils/constants.scss';
3
+ @use '../utils/tokens.scss';
4
+
5
+ @import '../../../../tokens/src/lib/components/Toast';
6
+
7
+ $toastBaseClass: '#{constants.$prefix}toast';
8
+ $toastCompBaseClass: '#{constants.$prefix}comp-toast';
9
+
10
+ @keyframes enterFirstAnimation {
11
+ 0% {
12
+ opacity: 0;
13
+ }
14
+
15
+ 100% {
16
+ opacity: 1;
17
+ z-index: 9999;
18
+ }
19
+ }
20
+
21
+ @keyframes enterAnimation {
22
+ 0% {
23
+ position: absolute;
24
+ max-height: 0px;
25
+ opacity: 0;
26
+ z-index: 0;
27
+ }
28
+
29
+ 30% {
30
+ position: relative;
31
+ }
32
+
33
+ 50% {
34
+ max-height: 300px;
35
+ opacity: 0;
36
+ }
37
+
38
+ 100% {
39
+ max-height: 300px;
40
+ opacity: 1;
41
+ z-index: 9999;
42
+ }
43
+ }
44
+
45
+ @keyframes exitAnimation {
46
+ 0% {
47
+ max-height: 300px;
48
+ opacity: 1;
49
+ }
50
+
51
+ 30% {
52
+ max-height: 300px;
53
+ opacity: 0;
54
+ }
55
+
56
+ 100% {
57
+ max-height: 0;
58
+ opacity: 0;
59
+ }
60
+ }
61
+
62
+ * {
63
+ --#{$toastCompBaseClass}-animation-duration: 500ms;
64
+ }
65
+
66
+ $toast-animation-duration: var(--#{$toastCompBaseClass}-animation-duration);
67
+
68
+ $appearances: (
69
+ 'information': (
70
+ 'background': tokens.$bm-comp-toast-color-info-bg,
71
+ 'body': tokens.$bm-comp-toast-color-info-body,
72
+ 'border': tokens.$bm-comp-toast-color-info-border,
73
+ 'heading': tokens.$bm-comp-toast-color-info-heading,
74
+ 'highlight': tokens.$bm-comp-toast-color-info-highlight,
75
+ 'icon': tokens.$bm-comp-toast-color-info-icon,
76
+ ),
77
+ 'negative': (
78
+ 'background': tokens.$bm-comp-toast-color-negative-bg,
79
+ 'body': tokens.$bm-comp-toast-color-negative-body,
80
+ 'border': tokens.$bm-comp-toast-color-negative-border,
81
+ 'heading': tokens.$bm-comp-toast-color-negative-heading,
82
+ 'highlight': tokens.$bm-comp-toast-color-negative-highlight,
83
+ 'icon': tokens.$bm-comp-toast-color-negative-icon,
84
+ ),
85
+ 'positive': (
86
+ 'background': tokens.$bm-comp-toast-color-positive-bg,
87
+ 'body': tokens.$bm-comp-toast-color-positive-body,
88
+ 'border': tokens.$bm-comp-toast-color-positive-border,
89
+ 'heading': tokens.$bm-comp-toast-color-positive-heading,
90
+ 'highlight': tokens.$bm-comp-toast-color-positive-highlight,
91
+ 'icon': tokens.$bm-comp-toast-color-positive-icon,
92
+ ),
93
+ 'warning': (
94
+ 'background': tokens.$bm-comp-toast-color-warning-bg,
95
+ 'body': tokens.$bm-comp-toast-color-warning-body,
96
+ 'border': tokens.$bm-comp-toast-color-warning-border,
97
+ 'heading': tokens.$bm-comp-toast-color-warning-heading,
98
+ 'highlight': tokens.$bm-comp-toast-color-warning-highlight,
99
+ 'icon': tokens.$bm-comp-toast-color-warning-icon,
100
+ ),
101
+ );
102
+
103
+ .#{$toastBaseClass} {
104
+ position: relative;
105
+ display: flex;
106
+ align-items: flex-start;
107
+ border-radius: tokens.$bm-comp-toast-radius;
108
+ border-width: tokens.$bm-comp-toast-border-width;
109
+ box-shadow: tokens.$bm-comp-toast-shadow;
110
+ gap: tokens.$bm-comp-toast-space-gap;
111
+ padding: tokens.$bm-comp-toast-space-y tokens.$bm-comp-toast-space-x;
112
+ width: tokens.$bm-comp-toast-size-width;
113
+ z-index: 9999;
114
+
115
+ &:focus,
116
+ &:focus-visible,
117
+ &:active {
118
+ outline: none;
119
+ }
120
+
121
+ &__lil-diss-button {
122
+ width: tokens.$bm-sem-size-icon-md;
123
+ height: tokens.$bm-sem-size-icon-md;
124
+ display: flex;
125
+ align-items: center;
126
+ justify-content: center;
127
+ }
128
+
129
+ &__content {
130
+ flex-direction: column;
131
+ display: flex;
132
+ flex: 1;
133
+ gap: tokens.$bm-comp-toast-space-text-gap;
134
+
135
+ &--lite {
136
+ gap: tokens.$bm-comp-toast-space-gap;
137
+ flex-direction: row;
138
+ align-items: center;
139
+ justify-content: flex-start;
140
+ }
141
+ }
142
+
143
+ &__heading {
144
+ font: tokens.$bm-comp-toast-typo-heading;
145
+ }
146
+
147
+ &__inner-content {
148
+ display: flex;
149
+ flex-direction: column;
150
+ gap: tokens.$bm-comp-toast-space-content-gap;
151
+
152
+ .#{$toastBaseClass}__content--lite & {
153
+ flex-direction: row;
154
+ }
155
+ }
156
+
157
+ &__body {
158
+ display: flex;
159
+ align-items: center;
160
+ flex: 1;
161
+ font: tokens.$bm-comp-toast-typo-body;
162
+ }
163
+
164
+ &__actions {
165
+ display: flex;
166
+ justify-content: flex-start;
167
+ flex-wrap: nowrap;
168
+ white-space: nowrap;
169
+ align-items: center;
170
+ gap: tokens.$bm-comp-toast-space-actions-gap;
171
+ }
172
+
173
+ &--lite &__actions {
174
+ align-items: flex-start;
175
+ }
176
+
177
+ &__icon {
178
+ display: flex;
179
+ width: tokens.$bm-comp-toast-size-icon;
180
+ height: tokens.$bm-comp-toast-size-icon;
181
+
182
+ ::slotted([slot='icon']) {
183
+ width: tokens.$bm-comp-toast-size-icon;
184
+ height: tokens.$bm-comp-toast-size-icon;
185
+ }
186
+ }
187
+
188
+ &--lite {
189
+ padding: tokens.$bm-comp-toast-space-lite-y tokens.$bm-comp-toast-space-x;
190
+ width: auto;
191
+
192
+ &::before {
193
+ content: none;
194
+ display: none;
195
+ }
196
+ }
197
+
198
+ &--anim-entering {
199
+ animation: enterAnimation 1s ease-in-out forwards;
200
+ }
201
+
202
+ &--anim-exiting {
203
+ animation: exitAnimation 0.8s ease-out forwards;
204
+ }
205
+
206
+ &--anim-first-entering {
207
+ animation: enterAnimation 0.4s ease-out forwards;
208
+ }
209
+
210
+ @each $state, $colors in $appearances {
211
+ &--#{$state} {
212
+ background-color: map.get($colors, 'background');
213
+ outline: tokens.$bm-comp-toast-border-width solid map.get($colors, 'border');
214
+ border-inline-start: tokens.$bm-comp-toast-size-highlight-width
215
+ solid
216
+ map.get($colors, 'highlight');
217
+
218
+ .#{$toastBaseClass}__body {
219
+ color: map.get($colors, 'body');
220
+ }
221
+
222
+ .#{$toastBaseClass}__heading {
223
+ color: map.get($colors, 'heading');
224
+ }
225
+
226
+ .#{$toastBaseClass}__icon {
227
+ color: map.get($colors, 'icon');
228
+ }
229
+
230
+ &.#{$toastBaseClass}--lite {
231
+ border-inline-start: none;
232
+ }
233
+ }
234
+ }
235
+ }
@@ -0,0 +1,68 @@
1
+ @use '../utils/tokens.scss';
2
+ @use '../utils/constants.scss';
3
+
4
+ @import '../../../../tokens/src/lib/components/Toast';
5
+
6
+ $toastBaseClass: '#{constants.$prefix}toast';
7
+ $toastContainerBaseClass: '#{$toastBaseClass}-container';
8
+ $toastCompBaseClass: '#{constants.$prefix}comp-toast';
9
+
10
+ .#{$toastContainerBaseClass} {
11
+ padding: tokens.$bm-comp-toast-space-viewport-offset;
12
+ position: fixed;
13
+ display: flex;
14
+ flex-direction: column-reverse;
15
+ gap: tokens.$bm-comp-toast-space-stack;
16
+ overflow: hidden;
17
+ z-index: 9999;
18
+
19
+ &--top-left {
20
+ top: 0;
21
+ left: 0;
22
+ }
23
+
24
+ &--top-right {
25
+ top: 0;
26
+ right: 0;
27
+ }
28
+
29
+ &--top-center {
30
+ top: 0;
31
+ left: 50%;
32
+ }
33
+
34
+ &--bottom-left {
35
+ bottom: 0;
36
+ left: 0;
37
+ }
38
+
39
+ &--bottom-right {
40
+ bottom: 0;
41
+ right: 0;
42
+ }
43
+
44
+ &--bottom-center {
45
+ bottom: 0;
46
+ left: 50%;
47
+ }
48
+ }
49
+
50
+ @media (max-width: 720px) {
51
+ .#{$toastContainerBaseClass} {
52
+ width: 100%;
53
+
54
+ &--top-left,
55
+ &--top-right,
56
+ &--top-center {
57
+ top: tokens.$bm-comp-toast-space-viewport-offset;
58
+ flex-direction: column;
59
+ }
60
+
61
+ &--bottom-left,
62
+ &--bottom-right,
63
+ &--bottom-center {
64
+ bottom: tokens.$bm-comp-toast-space-viewport-offset;
65
+ flex-direction: column-reverse;
66
+ }
67
+ }
68
+ }