@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.
- package/README.md +150 -0
- package/all.scss +3 -0
- package/components/accordion.module.scss +166 -0
- package/components/accordion.vars.scss +3 -0
- package/components/actionList.module.scss +211 -0
- package/components/actionList.vars.scss +6 -0
- package/components/alert.module.scss +158 -0
- package/components/aspectRatio.module.scss +21 -0
- package/components/avatar.module.scss +204 -0
- package/components/badge.module.scss +166 -0
- package/components/badgeDot.module.scss +90 -0
- package/components/box.module.scss +127 -0
- package/components/breadcrumbs.module.scss +149 -0
- package/components/button.module.scss +179 -0
- package/components/button.vars.scss +129 -0
- package/components/card.module.scss +232 -0
- package/components/checkbox.module.scss +123 -0
- package/components/chip.module.scss +173 -0
- package/components/chipsGroup.module.scss +13 -0
- package/components/closeButton.module.scss +52 -0
- package/components/combobox.module.scss +243 -0
- package/components/dialog.module.scss +199 -0
- package/components/divider.module.scss +255 -0
- package/components/emptyState.module.scss +61 -0
- package/components/fileUpload.module.scss +282 -0
- package/components/flag.module.scss +11 -0
- package/components/floatingui.module.scss +40 -0
- package/components/header.module.scss +123 -0
- package/components/helperText.module.scss +86 -0
- package/components/icon.module.scss +46 -0
- package/components/icon.vars.scss +31 -0
- package/components/index.scss +40 -0
- package/components/inputChoiceGroup.module.scss +46 -0
- package/components/label.module.scss +67 -0
- package/components/link.module.scss +118 -0
- package/components/list.module.scss +204 -0
- package/components/logo.module.scss +11 -0
- package/components/menu.module.scss +13 -0
- package/components/nativeSelect.module.scss +139 -0
- package/components/navigation.module.scss +156 -0
- package/components/pageHeader.module.scss +93 -0
- package/components/pageLayout.module.scss +38 -0
- package/components/pagination.module.scss +71 -0
- package/components/popover.module.scss +71 -0
- package/components/progressBar.module.scss +107 -0
- package/components/radioButton.module.scss +115 -0
- package/components/segmentedControl.module.scss +212 -0
- package/components/sideNav.module.scss +355 -0
- package/components/slider.module.scss +240 -0
- package/components/spinner.module.scss +261 -0
- package/components/spinner.vars.scss +85 -0
- package/components/stepper.module.scss +255 -0
- package/components/switch.module.scss +194 -0
- package/components/tabs.module.scss +412 -0
- package/components/text.module.scss +112 -0
- package/components/textArea.module.scss +183 -0
- package/components/textField.module.scss +162 -0
- package/components/toast.module.scss +235 -0
- package/components/toastContainer.module.scss +68 -0
- package/components/tooltip.module.scss +112 -0
- package/package.json +47 -0
- package/styles.css +11719 -0
- package/styles.css.map +1 -0
- package/styles.min.css +20 -0
- package/styles.min.css.map +1 -0
- package/utils/animation.scss +13 -0
- package/utils/constants.scss +1 -0
- package/utils/cursors.scss +35 -0
- package/utils/globals.scss +17 -0
- package/utils/helpers.scss +14 -0
- package/utils/index.scss +10 -0
- package/utils/mixins.scss +93 -0
- package/utils/spacing.scss +82 -0
- package/utils/stateLayer.module.scss +55 -0
- package/utils/stateLayerVars.scss +75 -0
- package/utils/tokens.scss +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# 🎨 Beam Styles
|
|
2
|
+
|
|
3
|
+
SCSS modules and component styles for the Beam Design System. This package provides modular, reusable styles that can be imported directly into your components or applications.
|
|
4
|
+
|
|
5
|
+
## 🔖 Table of Contents
|
|
6
|
+
|
|
7
|
+
1. [📋 Overview](#overview)
|
|
8
|
+
2. [💻 Installation](#installation)
|
|
9
|
+
3. [🛠️ Usage](#usage)
|
|
10
|
+
4. [📁 Package Structure](#package-structure)
|
|
11
|
+
5. [📦 CSS Modules](#css-modules)
|
|
12
|
+
6. [🎯 When to Use](#when-to-use)
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
`@viasat/beam-styles` contains:
|
|
17
|
+
|
|
18
|
+
- **Component SCSS Modules** - Scoped styles for all Beam components
|
|
19
|
+
- **Utility Mixins** - Helper mixins for common styling patterns
|
|
20
|
+
- **CSS Variables** - Component-specific CSS custom properties
|
|
21
|
+
- **Design Tokens** - SCSS variables for spacing, animation, and constants
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @viasat/beam-styles
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
> **Note**: This package is typically installed automatically as a dependency of `@viasat/beam-react` or for direct SCSS imports in custom implementations.
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
### Component Styles
|
|
34
|
+
|
|
35
|
+
Import component SCSS modules directly:
|
|
36
|
+
|
|
37
|
+
```scss
|
|
38
|
+
@use '@viasat/beam-styles/components/button.module';
|
|
39
|
+
@use '@viasat/beam-styles/components/card.module';
|
|
40
|
+
@use '@viasat/beam-styles/components/alert.module';
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Utility Mixins
|
|
44
|
+
|
|
45
|
+
Access helpful mixins and functions:
|
|
46
|
+
|
|
47
|
+
```scss
|
|
48
|
+
@use '@viasat/beam-styles/utils/mixins';
|
|
49
|
+
@use '@viasat/beam-styles/utils/helpers';
|
|
50
|
+
@use '@viasat/beam-styles/utils/spacing';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### CSS Variables
|
|
54
|
+
|
|
55
|
+
Import component-specific CSS variables:
|
|
56
|
+
|
|
57
|
+
```scss
|
|
58
|
+
@use '@viasat/beam-styles/components/button.vars';
|
|
59
|
+
@use '@viasat/beam-styles/components/icon.vars';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Complete Import
|
|
63
|
+
|
|
64
|
+
Import all component and utility styles:
|
|
65
|
+
|
|
66
|
+
```scss
|
|
67
|
+
@use '@viasat/beam-styles/all';
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Package Structure
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
@viasat/beam-styles/
|
|
74
|
+
├── components/ # Component SCSS modules
|
|
75
|
+
│ ├── button.module.scss
|
|
76
|
+
│ ├── button.vars.scss # Component CSS variables
|
|
77
|
+
│ ├── card.module.scss
|
|
78
|
+
│ ├── alert.module.scss
|
|
79
|
+
│ └── ...
|
|
80
|
+
└── utils/ # Utility styles
|
|
81
|
+
├── animation.scss
|
|
82
|
+
├── constants.scss
|
|
83
|
+
├── cursors.scss
|
|
84
|
+
├── globals.scss
|
|
85
|
+
├── helpers.scss
|
|
86
|
+
├── mixins.scss
|
|
87
|
+
├── spacing.scss
|
|
88
|
+
└── tokens.scss
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## CSS Modules
|
|
92
|
+
|
|
93
|
+
All component styles use CSS Modules with local scope by default:
|
|
94
|
+
|
|
95
|
+
```scss
|
|
96
|
+
// button.module.scss
|
|
97
|
+
.bm-button {
|
|
98
|
+
// Styles scoped to .button
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.bm-button--primary {
|
|
102
|
+
// Modifier styles
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
When imported in JavaScript/TypeScript:
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
import styles from '@viasat/beam-styles/components/button.module.scss';
|
|
110
|
+
|
|
111
|
+
<button className={styles.button} />;
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Compiled CSS
|
|
115
|
+
|
|
116
|
+
Pre-compiled CSS is also available:
|
|
117
|
+
|
|
118
|
+
- `styles.css` - Full compiled CSS
|
|
119
|
+
- `styles.min.css` - Minified version
|
|
120
|
+
- `styles.css.map` - Source map
|
|
121
|
+
|
|
122
|
+
## Direct CSS Import
|
|
123
|
+
|
|
124
|
+
For non-SCSS projects:
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
import '@viasat/beam-styles/styles.css';
|
|
128
|
+
// Or for minified
|
|
129
|
+
import '@viasat/beam-styles/styles.min.css';
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## When to Use
|
|
133
|
+
|
|
134
|
+
This package is intended for:
|
|
135
|
+
|
|
136
|
+
- ✅ Custom Beam implementations
|
|
137
|
+
- ✅ Direct SCSS imports in React/Vue/Angular apps
|
|
138
|
+
- ✅ Building custom components with Beam styling
|
|
139
|
+
- ✅ Theming and style customization
|
|
140
|
+
|
|
141
|
+
This package is **not needed** if you're using `@viasat/beam-react` or `@viasat/beam-web-components` components directly (styles are already included).
|
|
142
|
+
|
|
143
|
+
## Dependencies
|
|
144
|
+
|
|
145
|
+
- Requires a SASS/SCSS compiler (e.g., `sass`, `node-sass`, `dart-sass`)
|
|
146
|
+
- Works with any CSS Modules implementation
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT © Viasat
|
package/all.scss
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use './../utils/tokens.scss' as tokens;
|
|
3
|
+
@use './accordion.vars.scss' as accordionVars;
|
|
4
|
+
|
|
5
|
+
@import '../../../../tokens/src/lib/components/Accordion';
|
|
6
|
+
|
|
7
|
+
$accordionBaseClass: accordionVars.$accordionBaseClass;
|
|
8
|
+
|
|
9
|
+
$accordionSizes: (
|
|
10
|
+
'sm': (
|
|
11
|
+
'height': tokens.$bm-comp-accordion-size-sm-height,
|
|
12
|
+
'icon': tokens.$bm-comp-accordion-size-sm-icon,
|
|
13
|
+
'header-y': tokens.$bm-comp-accordion-space-sm-header-y,
|
|
14
|
+
'heading': tokens.$bm-comp-accordion-typo-sm-heading,
|
|
15
|
+
'body': tokens.$bm-comp-accordion-typo-sm-body,
|
|
16
|
+
'content-bottom': tokens.$bm-comp-accordion-space-sm-content-bottom,
|
|
17
|
+
),
|
|
18
|
+
'md': (
|
|
19
|
+
'height': tokens.$bm-comp-accordion-size-md-height,
|
|
20
|
+
'icon': tokens.$bm-comp-accordion-size-md-icon,
|
|
21
|
+
'header-y': tokens.$bm-comp-accordion-space-md-header-y,
|
|
22
|
+
'heading': tokens.$bm-comp-accordion-typo-md-heading,
|
|
23
|
+
'body': tokens.$bm-comp-accordion-typo-md-body,
|
|
24
|
+
'content-bottom': tokens.$bm-comp-accordion-space-md-content-bottom,
|
|
25
|
+
),
|
|
26
|
+
'lg': (
|
|
27
|
+
'height': tokens.$bm-comp-accordion-size-lg-height,
|
|
28
|
+
'icon': tokens.$bm-comp-accordion-size-lg-icon,
|
|
29
|
+
'header-y': tokens.$bm-comp-accordion-space-lg-header-y,
|
|
30
|
+
'heading': tokens.$bm-comp-accordion-typo-lg-heading,
|
|
31
|
+
'body': tokens.$bm-comp-accordion-typo-lg-body,
|
|
32
|
+
'content-bottom': tokens.$bm-comp-accordion-space-lg-content-bottom,
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
@mixin accordion-styles($size) {
|
|
37
|
+
.#{$accordionBaseClass}--#{$size} {
|
|
38
|
+
.#{$accordionBaseClass}__container {
|
|
39
|
+
min-height: map.get(map.get($accordionSizes, $size), 'height');
|
|
40
|
+
padding: map.get(map.get($accordionSizes, $size), 'header-y') 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.#{$accordionBaseClass}__chevron {
|
|
44
|
+
height: map.get(map.get($accordionSizes, $size), 'icon');
|
|
45
|
+
min-width: map.get(map.get($accordionSizes, $size), 'icon');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.#{$accordionBaseClass}__heading {
|
|
49
|
+
font: map.get(map.get($accordionSizes, $size), 'heading');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.#{$accordionBaseClass}__icon {
|
|
53
|
+
height: map.get(map.get($accordionSizes, $size), 'icon');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.#{$accordionBaseClass}__panel--#{$size} {
|
|
58
|
+
visibility: hidden;
|
|
59
|
+
font: map.get(map.get($accordionSizes, $size), 'body');
|
|
60
|
+
color: tokens.$bm-comp-accordion-color-body;
|
|
61
|
+
|
|
62
|
+
position: relative;
|
|
63
|
+
|
|
64
|
+
display: grid;
|
|
65
|
+
grid-template-rows: 0fr;
|
|
66
|
+
transition: grid-template-rows, padding-bottom, 0.2s linear;
|
|
67
|
+
|
|
68
|
+
> div {
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
align-items: flex-start;
|
|
73
|
+
gap: tokens.$bm-comp-accordion-space-content-gap;
|
|
74
|
+
align-self: stretch;
|
|
75
|
+
|
|
76
|
+
// due to overflow: hidden - this prevents focus outline clipping
|
|
77
|
+
padding: 0.3rem;
|
|
78
|
+
margin: -0.3rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
will-change: grid-template-rows, transform, padding-bottom;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.#{$accordionBaseClass}__panel--expanded--#{$size} {
|
|
85
|
+
visibility: visible;
|
|
86
|
+
grid-template-rows: 1fr;
|
|
87
|
+
padding-bottom: map.get(map.get($accordionSizes, $size), 'content-bottom');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@include accordion-styles('sm');
|
|
92
|
+
@include accordion-styles('md');
|
|
93
|
+
@include accordion-styles('lg');
|
|
94
|
+
|
|
95
|
+
.#{$accordionBaseClass} {
|
|
96
|
+
&__container {
|
|
97
|
+
display: flex;
|
|
98
|
+
justify-content: space-between;
|
|
99
|
+
align-items: center;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
gap: tokens.$bm-comp-accordion-space-header-gap;
|
|
102
|
+
|
|
103
|
+
&:focus-visible {
|
|
104
|
+
outline: tokens.$bm-sem-border-width-focus solid
|
|
105
|
+
tokens.$bm-sem-color-border-focus;
|
|
106
|
+
border-radius: tokens.$bm-sem-radius-focus-md;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&__icon {
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
color: tokens.$bm-comp-accordion-color-icon;
|
|
114
|
+
|
|
115
|
+
::slotted([slot='icon']) {
|
|
116
|
+
display: inline-flex;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__heading {
|
|
121
|
+
flex-grow: 1;
|
|
122
|
+
color: tokens.$bm-comp-accordion-color-heading;
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
gap: tokens.$bm-comp-accordion-space-header-gap;
|
|
126
|
+
|
|
127
|
+
::slotted([slot='heading']) {
|
|
128
|
+
gap: tokens.$bm-comp-accordion-space-header-gap;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&__chevron {
|
|
133
|
+
transition: transform 0.2s ease;
|
|
134
|
+
color: tokens.$bm-comp-accordion-color-icon;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&__chevron--rotated {
|
|
138
|
+
transform: rotate(180deg);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Divider for React Accordion (only)
|
|
142
|
+
& > div:not(:first-child) > &__container {
|
|
143
|
+
border-top: tokens.$bm-sem-border-width-md solid
|
|
144
|
+
tokens.$bm-comp-accordion-color-divider;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Divider for Web-Component Accordion (only)
|
|
148
|
+
:host(:not(:first-of-type)) &__container {
|
|
149
|
+
border-top: tokens.$bm-sem-border-width-md solid
|
|
150
|
+
tokens.$bm-comp-accordion-color-divider;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Shadow DOM magic 🤨
|
|
154
|
+
:host(*) &__container {
|
|
155
|
+
box-sizing: border-box;
|
|
156
|
+
&:focus-visible {
|
|
157
|
+
outline: tokens.$bm-sem-border-width-focus solid
|
|
158
|
+
tokens.$bm-sem-color-border-focus;
|
|
159
|
+
border-radius: tokens.$bm-sem-radius-focus-md;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&--no-box {
|
|
164
|
+
display: contents;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../utils/constants.scss';
|
|
3
|
+
@use '../utils/tokens.scss' as tokens;
|
|
4
|
+
@use '../utils/stateLayerVars.scss' as stateLayerVars;
|
|
5
|
+
@use '../components/icon.vars.scss' as iconVars;
|
|
6
|
+
@use '../components/button.vars.scss' as buttonVars;
|
|
7
|
+
@use '../components/actionList.vars.scss' as actionListVars;
|
|
8
|
+
|
|
9
|
+
@import '../../../../tokens/src/lib/components/ActionList';
|
|
10
|
+
|
|
11
|
+
.#{actionListVars.$actionListBaseClass} {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
|
|
15
|
+
&__no-results {
|
|
16
|
+
display: flex;
|
|
17
|
+
min-height: tokens.$bm-comp-actionlist-size-height;
|
|
18
|
+
padding: tokens.$bm-comp-actionlist-space-y 0;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
color: tokens.$bm-sem-color-text-primary;
|
|
22
|
+
text-align: center;
|
|
23
|
+
font: tokens.$bm-sem-typo-body-md;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__loading {
|
|
27
|
+
padding: tokens.$bm-comp-actionlist-space-y 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.#{actionListVars.$actionListItemBaseClass} {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
gap: tokens.$bm-comp-actionlist-space-gap;
|
|
35
|
+
min-height: tokens.$bm-comp-actionlist-size-height;
|
|
36
|
+
padding: tokens.$bm-comp-actionlist-space-y 0;
|
|
37
|
+
position: relative;
|
|
38
|
+
align-items: center;
|
|
39
|
+
color: tokens.$bm-comp-actionlist-color-text;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
isolation: isolate;
|
|
42
|
+
|
|
43
|
+
&[hidden] {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:has(&__supporting-text) {
|
|
48
|
+
align-items: flex-start;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:focus {
|
|
52
|
+
outline: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--kind-destructive {
|
|
56
|
+
color: tokens.$bm-sem-color-text-negative;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--disabled {
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
cursor: default;
|
|
62
|
+
opacity: tokens.$bm-sem-opacity-disabled;
|
|
63
|
+
|
|
64
|
+
& > .#{stateLayerVars.$stateLayerBaseClass} {
|
|
65
|
+
$appearance: map.get(stateLayerVars.$state-layer-tokens, 'base');
|
|
66
|
+
$disabled: map.get($appearance, 'disabled');
|
|
67
|
+
@include stateLayerVars.get-state-layer-styles-body($disabled);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&--active {
|
|
72
|
+
& > .#{stateLayerVars.$stateLayerBaseClass} {
|
|
73
|
+
$appearance: map.get(stateLayerVars.$state-layer-tokens, 'base');
|
|
74
|
+
$focused: map.get($appearance, 'focus-visible-within');
|
|
75
|
+
@include stateLayerVars.get-state-layer-styles-body($focused);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&__choice, &__switch {
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
display: flex;
|
|
83
|
+
color: tokens.$bm-comp-actionlist-color-check;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__choice {
|
|
87
|
+
width: tokens.$bm-comp-actionlist-size-icon;
|
|
88
|
+
height: tokens.$bm-comp-actionlist-size-icon;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&__content-before {
|
|
92
|
+
min-width: tokens.$bm-comp-actionlist-size-icon;
|
|
93
|
+
min-height: tokens.$bm-comp-actionlist-size-icon;
|
|
94
|
+
display: flex;
|
|
95
|
+
color: tokens.$bm-comp-actionlist-color-icon;
|
|
96
|
+
|
|
97
|
+
#{iconVars.$iconSize}: tokens.$bm-comp-actionlist-size-icon;
|
|
98
|
+
#{iconVars.$iconColor}: tokens.$bm-comp-actionlist-color-icon;
|
|
99
|
+
|
|
100
|
+
.#{actionListVars.$actionListItemBaseClass}--kind-destructive & {
|
|
101
|
+
#{iconVars.$iconColor}: tokens.$bm-sem-color-icon-negative-strong;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__content {
|
|
106
|
+
flex: 1;
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
align-items: flex-start;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&__text {
|
|
113
|
+
display: -webkit-box;
|
|
114
|
+
-webkit-box-orient: vertical;
|
|
115
|
+
-webkit-line-clamp: 1;
|
|
116
|
+
line-clamp: 1;
|
|
117
|
+
align-self: stretch;
|
|
118
|
+
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
text-overflow: ellipsis;
|
|
121
|
+
font: tokens.$bm-comp-actionlist-typo-text;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&--header {
|
|
125
|
+
cursor: default;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&--header &__text {
|
|
129
|
+
color: tokens.$bm-comp-actionlist-color-heading;
|
|
130
|
+
font: tokens.$bm-sem-typo-label-md;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&__supporting-text {
|
|
134
|
+
align-self: stretch;
|
|
135
|
+
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
color: tokens.$bm-comp-actionlist-color-text-supporting;
|
|
138
|
+
font: tokens.$bm-comp-actionlist-typo-text-supporting;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&__content-after {
|
|
142
|
+
display: flex;
|
|
143
|
+
justify-content: flex-end;
|
|
144
|
+
gap: tokens.$bm-comp-actionlist-space-gap;
|
|
145
|
+
|
|
146
|
+
min-width: tokens.$bm-comp-actionlist-size-icon;
|
|
147
|
+
min-height: tokens.$bm-comp-actionlist-size-icon;
|
|
148
|
+
|
|
149
|
+
color: tokens.$bm-comp-actionlist-color-text-suffix;
|
|
150
|
+
font: tokens.$bm-comp-actionlist-typo-text-suffix;
|
|
151
|
+
text-align: right;
|
|
152
|
+
|
|
153
|
+
#{iconVars.$iconSize}: tokens.$bm-comp-actionlist-size-icon;
|
|
154
|
+
#{iconVars.$iconColor}: tokens.$bm-comp-actionlist-color-icon;
|
|
155
|
+
|
|
156
|
+
.#{buttonVars.$buttonBaseClass} {
|
|
157
|
+
#{buttonVars.$buttonIconSizeVarName}: tokens.$bm-comp-actionlist-size-icon;
|
|
158
|
+
--bm-comp-btn-size-sm-width: tokens.$bm-comp-actionlist-size-icon;
|
|
159
|
+
--bm-comp-btn-size-sm-height: tokens.$bm-comp-actionlist-size-icon;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&__flyout {
|
|
164
|
+
#{iconVars.$iconSize}: tokens.$bm-comp-actionlist-size-icon;
|
|
165
|
+
#{iconVars.$iconColor}: tokens.$bm-comp-actionlist-color-icon;
|
|
166
|
+
|
|
167
|
+
&:dir(rtl) {
|
|
168
|
+
transform: scaleX(-1);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
& > .#{stateLayerVars.$stateLayerBaseClass} {
|
|
173
|
+
#{stateLayerVars.$left}: calc(
|
|
174
|
+
-1 * #{tokens.$bm-comp-actionlist-size-state-offset}
|
|
175
|
+
);
|
|
176
|
+
#{stateLayerVars.$right}: calc(
|
|
177
|
+
-1 * #{tokens.$bm-comp-actionlist-size-state-offset}
|
|
178
|
+
);
|
|
179
|
+
#{stateLayerVars.$outline-offset}: calc(
|
|
180
|
+
-1 * var(#{stateLayerVars.$outline-width})
|
|
181
|
+
);
|
|
182
|
+
border-radius: tokens.$bm-comp-actionlist-radius;
|
|
183
|
+
z-index: -1;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.#{actionListVars.$actionListGroupBaseClass} {
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
|
|
191
|
+
&__heading {
|
|
192
|
+
overflow: hidden;
|
|
193
|
+
text-overflow: ellipsis;
|
|
194
|
+
white-space: nowrap;
|
|
195
|
+
padding-top: tokens.$bm-comp-actionlist-space-y;
|
|
196
|
+
color: tokens.$bm-comp-actionlist-color-group-heading;
|
|
197
|
+
font: tokens.$bm-comp-actionlist-typo-heading-group;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&__divider {
|
|
201
|
+
margin: tokens.$bm-comp-actionlist-space-y 0;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.#{actionListVars.$actionListIconButtonBaseClass} {
|
|
206
|
+
&__placeholder {
|
|
207
|
+
display: flex;
|
|
208
|
+
width: tokens.$bm-comp-actionlist-size-icon;
|
|
209
|
+
height: tokens.$bm-comp-actionlist-size-icon;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
@use '../utils/constants.scss';
|
|
2
|
+
|
|
3
|
+
$actionListBaseClass: '#{constants.$prefix}action-list';
|
|
4
|
+
$actionListItemBaseClass: '#{constants.$prefix}action-list__item';
|
|
5
|
+
$actionListIconButtonBaseClass: '#{constants.$prefix}action-list__item__icon-button';
|
|
6
|
+
$actionListGroupBaseClass: '#{constants.$prefix}action-list__group';
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../utils/constants.scss';
|
|
3
|
+
@use '../utils/tokens.scss' as tokens;
|
|
4
|
+
|
|
5
|
+
@import '../../../../tokens/src/lib/components/Alert';
|
|
6
|
+
|
|
7
|
+
$alertBaseClass: '#{constants.$prefix}alert';
|
|
8
|
+
$alertIconClass: '#{$alertBaseClass}__icon';
|
|
9
|
+
$alertContentClass: '#{$alertBaseClass}__content';
|
|
10
|
+
|
|
11
|
+
$appearances: (
|
|
12
|
+
'positive': (
|
|
13
|
+
'background': tokens.$bm-comp-alert-color-positive-bg,
|
|
14
|
+
'icon-color': tokens.$bm-comp-alert-color-positive-icon,
|
|
15
|
+
'body-color': tokens.$bm-comp-alert-color-positive-body,
|
|
16
|
+
'heading-color': tokens.$bm-comp-alert-color-positive-heading,
|
|
17
|
+
'border-color': tokens.$bm-comp-alert-color-positive-border,
|
|
18
|
+
),
|
|
19
|
+
'warning': (
|
|
20
|
+
'background': tokens.$bm-comp-alert-color-warning-bg,
|
|
21
|
+
'icon-color': tokens.$bm-comp-alert-color-warning-icon,
|
|
22
|
+
'body-color': tokens.$bm-comp-alert-color-warning-body,
|
|
23
|
+
'heading-color': tokens.$bm-comp-alert-color-warning-heading,
|
|
24
|
+
'border-color': tokens.$bm-comp-alert-color-warning-border,
|
|
25
|
+
),
|
|
26
|
+
'negative': (
|
|
27
|
+
'background': tokens.$bm-comp-alert-color-negative-bg,
|
|
28
|
+
'icon-color': tokens.$bm-comp-alert-color-negative-icon,
|
|
29
|
+
'body-color': tokens.$bm-comp-alert-color-negative-body,
|
|
30
|
+
'heading-color': tokens.$bm-comp-alert-color-negative-heading,
|
|
31
|
+
'border-color': tokens.$bm-comp-alert-color-negative-border,
|
|
32
|
+
),
|
|
33
|
+
'infoPrimary': (
|
|
34
|
+
'background': tokens.$bm-comp-alert-color-info-primary-bg,
|
|
35
|
+
'icon-color': tokens.$bm-comp-alert-color-info-primary-icon,
|
|
36
|
+
'body-color': tokens.$bm-comp-alert-color-info-primary-body,
|
|
37
|
+
'heading-color': tokens.$bm-comp-alert-color-info-primary-heading,
|
|
38
|
+
'border-color': tokens.$bm-comp-alert-color-info-primary-border,
|
|
39
|
+
),
|
|
40
|
+
'infoSecondary': (
|
|
41
|
+
'background': tokens.$bm-comp-alert-color-info-secondary-bg,
|
|
42
|
+
'icon-color': tokens.$bm-comp-alert-color-info-secondary-icon,
|
|
43
|
+
'body-color': tokens.$bm-comp-alert-color-info-secondary-body,
|
|
44
|
+
'heading-color': tokens.$bm-comp-alert-color-info-secondary-heading,
|
|
45
|
+
'border-color': tokens.$bm-comp-alert-color-info-secondary-border,
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
.#{$alertBaseClass} {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
word-break: break-word;
|
|
53
|
+
gap: tokens.$bm-comp-alert-space-gap;
|
|
54
|
+
|
|
55
|
+
padding: tokens.$bm-comp-alert-space-sm-y tokens.$bm-comp-alert-space-x;
|
|
56
|
+
|
|
57
|
+
box-shadow: tokens.$bm-comp-alert-shadow;
|
|
58
|
+
|
|
59
|
+
border-width: tokens.$bm-comp-alert-border-width;
|
|
60
|
+
border-style: solid;
|
|
61
|
+
border-radius: tokens.$bm-comp-alert-radius-in-page;
|
|
62
|
+
|
|
63
|
+
&__content__wrapper {
|
|
64
|
+
flex: 1 0 0;
|
|
65
|
+
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
align-items: center;
|
|
69
|
+
flex-wrap: wrap;
|
|
70
|
+
gap: tokens.$bm-comp-alert-space-gap;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.#{$alertContentClass} {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
gap: tokens.$bm-comp-alert-space-text-gap;
|
|
77
|
+
font: tokens.$bm-comp-alert-typo-sm-body;
|
|
78
|
+
|
|
79
|
+
&__heading {
|
|
80
|
+
font: tokens.$bm-comp-alert-typo-sm-heading;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&__actions {
|
|
85
|
+
display: flex;
|
|
86
|
+
gap: tokens.$bm-comp-alert-space-actions-gap;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.#{$alertIconClass},
|
|
90
|
+
.#{$alertIconClass} svg {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-self: center;
|
|
93
|
+
align-items: center;
|
|
94
|
+
min-width: tokens.$bm-comp-alert-size-sm-icon;
|
|
95
|
+
min-height: tokens.$bm-comp-alert-size-sm-icon;
|
|
96
|
+
|
|
97
|
+
&--wrapping {
|
|
98
|
+
align-self: flex-start;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__close-button {
|
|
103
|
+
// Allows the close button to drop in with no extra height
|
|
104
|
+
display: flex;
|
|
105
|
+
|
|
106
|
+
align-self: center;
|
|
107
|
+
|
|
108
|
+
&--wrapping {
|
|
109
|
+
align-self: baseline;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&--full-width {
|
|
114
|
+
border-radius: tokens.$bm-comp-alert-radius-full-width;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--md {
|
|
118
|
+
padding: tokens.$bm-comp-alert-space-y tokens.$bm-comp-alert-space-x;
|
|
119
|
+
|
|
120
|
+
.#{$alertContentClass} {
|
|
121
|
+
font: tokens.$bm-comp-alert-typo-md-body;
|
|
122
|
+
|
|
123
|
+
&__heading {
|
|
124
|
+
font: tokens.$bm-comp-alert-typo-md-heading;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.#{$alertIconClass},
|
|
129
|
+
.#{$alertIconClass} svg {
|
|
130
|
+
min-width: tokens.$bm-comp-alert-size-md-icon;
|
|
131
|
+
min-height: tokens.$bm-comp-alert-size-md-icon;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@each $state, $colors in $appearances {
|
|
136
|
+
&--#{$state} {
|
|
137
|
+
background-color: map.get($colors, 'background');
|
|
138
|
+
border-color: map.get($colors, 'border-color');
|
|
139
|
+
|
|
140
|
+
.#{$alertIconClass},
|
|
141
|
+
.#{$alertIconClass} svg {
|
|
142
|
+
color: map.get($colors, 'icon-color');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.#{$alertContentClass} {
|
|
146
|
+
color: map.get($colors, 'body-color');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&[dir='rtl'] {
|
|
152
|
+
flex-direction: row-reverse;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&--no-box {
|
|
156
|
+
display: contents;
|
|
157
|
+
}
|
|
158
|
+
}
|