@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
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
$checkboxBaseClass: '#{constants.$prefix}checkbox';
|
|
10
|
+
|
|
11
|
+
$inputChoiceCursor: '--#{constants.$prefix}input-choice-cursor';
|
|
12
|
+
$inputChoiceLabelCursor: '--#{constants.$prefix}input-choice-label-cursor';
|
|
13
|
+
$inputChoiceLabelPointerEvents: '--#{constants.$prefix}input-choice-label-pointer-events';
|
|
14
|
+
|
|
15
|
+
$checkboxStates: (
|
|
16
|
+
error: (
|
|
17
|
+
labelColor: tokens.$bm-comp-input-color-text,
|
|
18
|
+
backgroundColor: tokens.$bm-comp-input-color-bg,
|
|
19
|
+
selectedColor: tokens.$bm-comp-input-color-choice-checkbox-selected-bg-error,
|
|
20
|
+
borderColor: tokens.$bm-comp-input-color-border-error,
|
|
21
|
+
),
|
|
22
|
+
read-only: (
|
|
23
|
+
labelColor: tokens.$bm-comp-input-color-text,
|
|
24
|
+
backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
|
|
25
|
+
selectedColor: tokens.$bm-comp-input-color-icon,
|
|
26
|
+
borderColor: tokens.$bm-comp-input-color-border-disabled,
|
|
27
|
+
),
|
|
28
|
+
disabled: (
|
|
29
|
+
labelColor: tokens.$bm-comp-input-color-text-disabled,
|
|
30
|
+
backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
|
|
31
|
+
selectedColor: tokens.$bm-comp-input-color-icon-disabled,
|
|
32
|
+
borderColor: tokens.$bm-comp-input-color-border-disabled,
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
$check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.178 7.363.808 4.697 0 5.598l3.178 3.573L10 1.501 9.198.6l-6.02 6.763Z' fill='%23fff'/%3E%3C/svg%3E");
|
|
37
|
+
|
|
38
|
+
.#{$checkboxBaseClass} {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
@include cursors.applyChoiceCursors();
|
|
41
|
+
|
|
42
|
+
&__label {
|
|
43
|
+
display: inherit;
|
|
44
|
+
word-break: break-word;
|
|
45
|
+
color: tokens.$bm-comp-input-color-text;
|
|
46
|
+
font: tokens.$bm-comp-input-typo-default;
|
|
47
|
+
gap: tokens.$bm-comp-input-space-choice-gap-inside;
|
|
48
|
+
cursor: var(#{$inputChoiceLabelCursor}, pointer);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&--with-label &__label &__input {
|
|
52
|
+
margin: tokens.$bm-comp-input-space-choice-nudge tokens.$bm-sem-space-0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@each $state, $values in $checkboxStates {
|
|
56
|
+
&--#{$state} &__label {
|
|
57
|
+
color: map.get($values, labelColor);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&--#{$state} &__label &__input {
|
|
61
|
+
border-color: map.get($values, borderColor);
|
|
62
|
+
background-color: map.get($values, backgroundColor);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&--#{$state} &__label &__input:checked {
|
|
66
|
+
background-color: map.get($values, selectedColor);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&__label &__input {
|
|
71
|
+
appearance: none;
|
|
72
|
+
-moz-appearance: none;
|
|
73
|
+
-webkit-appearance: none;
|
|
74
|
+
|
|
75
|
+
position: relative;
|
|
76
|
+
margin: tokens.$bm-sem-space-0;
|
|
77
|
+
flex-shrink: tokens.$bm-sem-space-0;
|
|
78
|
+
width: tokens.$bm-comp-input-size-choice-checkbox;
|
|
79
|
+
height: tokens.$bm-comp-input-size-choice-checkbox;
|
|
80
|
+
background-color: tokens.$bm-comp-input-color-bg;
|
|
81
|
+
cursor: var(#{$inputChoiceCursor}, pointer);
|
|
82
|
+
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
|
|
85
|
+
border-style: solid;
|
|
86
|
+
border-color: tokens.$bm-comp-input-color-border;
|
|
87
|
+
border-radius: tokens.$bm-comp-input-radius-choice-checkbox;
|
|
88
|
+
border-width: tokens.$bm-comp-input-border-width-field-default;
|
|
89
|
+
|
|
90
|
+
&:focus-visible {
|
|
91
|
+
@include mixins.simulated-inset-outline();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:checked {
|
|
95
|
+
background-color: tokens.$bm-comp-input-color-choice-checkbox-selected-bg;
|
|
96
|
+
border-color: tokens.$bm-comp-input-color-choice-checkbox-selected-border;
|
|
97
|
+
|
|
98
|
+
&::after {
|
|
99
|
+
@include mixins.svg-icon($check-mask);
|
|
100
|
+
content: '';
|
|
101
|
+
background-color: tokens.$bm-comp-input-color-choice-checkbox-selected-icon;
|
|
102
|
+
position: absolute;
|
|
103
|
+
top: 50%;
|
|
104
|
+
left: 50%;
|
|
105
|
+
transform: translate(-50%, -50%);
|
|
106
|
+
width: calc(#{tokens.$bm-comp-input-size-choice-checkbox} * 5 / 8);
|
|
107
|
+
height: calc(#{tokens.$bm-comp-input-size-choice-checkbox} * 5 / 8);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&--indeterminate &__input:checked {
|
|
113
|
+
&::after {
|
|
114
|
+
height: 2px;
|
|
115
|
+
width: 50%;
|
|
116
|
+
|
|
117
|
+
border-radius: tokens.$bm-comp-input-size-choice-checkbox;
|
|
118
|
+
|
|
119
|
+
-webkit-mask-image: none;
|
|
120
|
+
mask-image: none;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../utils/constants.scss';
|
|
3
|
+
@use '../utils/tokens.scss' as tokens;
|
|
4
|
+
@use '../utils/stateLayerVars.scss' as state-layer;
|
|
5
|
+
|
|
6
|
+
@import '../../../../tokens/src/lib/components/Chip';
|
|
7
|
+
|
|
8
|
+
$chipBaseClass: '#{constants.$prefix}chip';
|
|
9
|
+
|
|
10
|
+
$sizes: (
|
|
11
|
+
'sm': (
|
|
12
|
+
'height': tokens.$bm-comp-chip-size-sm-height,
|
|
13
|
+
'icon-size': tokens.$bm-comp-chip-size-sm-icon,
|
|
14
|
+
'gap': tokens.$bm-comp-chip-space-sm-gap,
|
|
15
|
+
'padding-inline': tokens.$bm-comp-chip-space-sm-x,
|
|
16
|
+
'font': tokens.$bm-comp-chip-typo-sm,
|
|
17
|
+
),
|
|
18
|
+
'md': (
|
|
19
|
+
'height': tokens.$bm-comp-chip-size-md-height,
|
|
20
|
+
'icon-size': tokens.$bm-comp-chip-size-md-icon,
|
|
21
|
+
'gap': 0,
|
|
22
|
+
'padding-inline': tokens.$bm-comp-chip-space-md-x,
|
|
23
|
+
'font': tokens.$bm-comp-chip-typo-md,
|
|
24
|
+
),
|
|
25
|
+
'lg': (
|
|
26
|
+
'height': tokens.$bm-comp-chip-size-lg-height,
|
|
27
|
+
'icon-size': tokens.$bm-comp-chip-size-lg-icon,
|
|
28
|
+
'gap': 0,
|
|
29
|
+
'padding-inline': tokens.$bm-comp-chip-space-lg-x,
|
|
30
|
+
'font': tokens.$bm-comp-chip-typo-lg,
|
|
31
|
+
),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
.#{$chipBaseClass} {
|
|
35
|
+
position: relative;
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
align-items: center;
|
|
39
|
+
width: fit-content;
|
|
40
|
+
box-shadow: tokens.$bm-comp-chip-shadow;
|
|
41
|
+
color: tokens.$bm-comp-chip-color-fg;
|
|
42
|
+
background-color: tokens.$bm-comp-chip-color-bg;
|
|
43
|
+
border-color: tokens.$bm-comp-chip-color-border;
|
|
44
|
+
border-style: solid;
|
|
45
|
+
border-radius: tokens.$bm-comp-chip-radius-container;
|
|
46
|
+
border-width: tokens.$bm-comp-chip-border-width;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
user-select: none;
|
|
49
|
+
|
|
50
|
+
&__input {
|
|
51
|
+
position: absolute;
|
|
52
|
+
opacity: 0;
|
|
53
|
+
inset: 0;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
margin: 0;
|
|
57
|
+
cursor: inherit;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&__label {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 0;
|
|
64
|
+
cursor: inherit;
|
|
65
|
+
|
|
66
|
+
.#{$chipBaseClass}--ellipsis & > span {
|
|
67
|
+
display: -webkit-box;
|
|
68
|
+
-webkit-box-orient: vertical;
|
|
69
|
+
-webkit-line-clamp: 1;
|
|
70
|
+
line-clamp: 1;
|
|
71
|
+
flex: 1;
|
|
72
|
+
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&__icon {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
color: tokens.$bm-comp-chip-color-fg;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:has(input:checked) {
|
|
85
|
+
color: tokens.$bm-comp-chip-color-fg-selected;
|
|
86
|
+
background-color: tokens.$bm-comp-chip-color-bg-selected;
|
|
87
|
+
border-color: tokens.$bm-comp-chip-color-border-selected;
|
|
88
|
+
.#{$chipBaseClass}__icon {
|
|
89
|
+
color: tokens.$bm-comp-chip-color-fg-selected;
|
|
90
|
+
}
|
|
91
|
+
--bm-comp-close-btn-color-default: tokens.$bm-comp-chip-color-fg-selected;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:has(input[type='radio']:checked) {
|
|
95
|
+
color: tokens.$bm-comp-chip-color-fg-selected;
|
|
96
|
+
background-color: tokens.$bm-comp-chip-color-bg-selected;
|
|
97
|
+
border-color: tokens.$bm-comp-chip-color-border-selected;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__state-layer {
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
#{state-layer.$opacity}: 0;
|
|
103
|
+
#{state-layer.$outline-width}: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Show state layer only when component got this class
|
|
107
|
+
&--has-focus .#{state-layer.$stateLayerBaseClass} {
|
|
108
|
+
#{state-layer.$opacity}: 1;
|
|
109
|
+
#{state-layer.$outline-width}: tokens.$bm-sem-border-width-focus;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// When the input is focused, hide the state layer outline
|
|
113
|
+
&:focus-within:has(input:focus) .#{state-layer.$stateLayerBaseClass} {
|
|
114
|
+
#{state-layer.$outline-width}: 0px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// When the input is key board focus, show the state layer outline
|
|
118
|
+
&:focus-within:has(input:focus-visible) .#{state-layer.$stateLayerBaseClass} {
|
|
119
|
+
#{state-layer.$outline-width}: tokens.$bm-sem-border-width-focus;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&--disabled {
|
|
123
|
+
opacity: tokens.$bm-sem-opacity-disabled;
|
|
124
|
+
cursor: not-allowed !important;
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&--fluid {
|
|
129
|
+
width: 100%;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&--non-selectable {
|
|
133
|
+
cursor: text;
|
|
134
|
+
user-select: text;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@each $size, $properties in $sizes {
|
|
138
|
+
&--#{$size} {
|
|
139
|
+
height: map.get($properties, 'height');
|
|
140
|
+
padding-inline: map.get($properties, 'padding-inline');
|
|
141
|
+
font: map.get($properties, 'font');
|
|
142
|
+
gap: map.get($properties, 'gap');
|
|
143
|
+
|
|
144
|
+
.#{$chipBaseClass}__label {
|
|
145
|
+
gap: map.get($properties, 'gap');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.#{$chipBaseClass}__icon {
|
|
149
|
+
width: map.get($properties, 'icon-size');
|
|
150
|
+
height: map.get($properties, 'icon-size');
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@if $size == 'md' or $size == 'lg' {
|
|
154
|
+
.#{$chipBaseClass}__label > span:not(.#{$chipBaseClass}__icon) {
|
|
155
|
+
padding-inline: tokens.$bm-comp-chip-space-text;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&__label {
|
|
162
|
+
flex-direction: row;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&__icon {
|
|
166
|
+
order: -1;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&__dismiss-button {
|
|
170
|
+
order: 1;
|
|
171
|
+
margin-inline-start: auto;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@use '../utils/constants.scss';
|
|
2
|
+
|
|
3
|
+
@import '../../../../tokens/src/lib/components/Chip';
|
|
4
|
+
|
|
5
|
+
$chipBaseClass: '#{constants.$prefix}chips-group';
|
|
6
|
+
|
|
7
|
+
.#{$chipBaseClass} {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
position: relative;
|
|
11
|
+
width: fit-content;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../utils/constants.scss';
|
|
3
|
+
@use '../utils/mixins.scss';
|
|
4
|
+
@use '../utils/tokens.scss';
|
|
5
|
+
@use '../utils/stateLayerVars.scss' as state-layer;
|
|
6
|
+
|
|
7
|
+
@import '../../../../tokens/src/lib/components/CloseButton';
|
|
8
|
+
|
|
9
|
+
$closeButtonBaseClass: '#{constants.$prefix}close-button';
|
|
10
|
+
|
|
11
|
+
$sizes: (
|
|
12
|
+
xs: tokens.$bm-comp-close-btn-size-xs,
|
|
13
|
+
sm: tokens.$bm-comp-close-btn-size-sm,
|
|
14
|
+
md: tokens.$bm-comp-close-btn-size-md,
|
|
15
|
+
lg: tokens.$bm-comp-close-btn-size-lg,
|
|
16
|
+
xl: tokens.$bm-comp-close-btn-size-xl,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
.#{$closeButtonBaseClass} {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
padding: tokens.$bm-comp-close-btn-space-y tokens.$bm-comp-close-btn-space-x;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
position: relative;
|
|
25
|
+
outline: none;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
border: unset;
|
|
28
|
+
border-radius: tokens.$bm-comp-close-btn-radius;
|
|
29
|
+
background-color: unset;
|
|
30
|
+
color: tokens.$bm-comp-close-btn-color-default;
|
|
31
|
+
|
|
32
|
+
.#{state-layer.$stateLayerBaseClass} {
|
|
33
|
+
#{state-layer.$outline-offset}: calc(0px - tokens.$bm-sem-size-focus-offset);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@each $size, $sizeValue in $sizes {
|
|
37
|
+
&--#{$size} {
|
|
38
|
+
height: calc($sizeValue + tokens.$bm-comp-close-btn-space-y * 2);
|
|
39
|
+
width: calc($sizeValue + tokens.$bm-comp-close-btn-space-x * 2);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&--#{$size} &__icon {
|
|
43
|
+
height: $sizeValue;
|
|
44
|
+
width: $sizeValue;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:disabled {
|
|
49
|
+
cursor: not-allowed;
|
|
50
|
+
opacity: tokens.$bm-sem-opacity-disabled;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../utils/constants.scss';
|
|
3
|
+
@use '../utils/tokens.scss' as tokens;
|
|
4
|
+
@use '../utils/mixins.scss' as mixins;
|
|
5
|
+
@use '../utils/cursors.scss' as cursors;
|
|
6
|
+
@use './icon.vars.scss' as iconVars;
|
|
7
|
+
|
|
8
|
+
@import '../../../../tokens/src/lib/components/Input.css';
|
|
9
|
+
|
|
10
|
+
$comboboxBaseClass: '#{constants.$prefix}combobox';
|
|
11
|
+
|
|
12
|
+
$expandIconWidth: 0.625rem;
|
|
13
|
+
$expandIconHeight: 0.3125rem;
|
|
14
|
+
$expandIcon: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iNSIgdmlld0JveD0iMCAwIDEwIDUiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0wLjE4MjgzMiAwLjMxMjQ2NEMwLjExNDQwOSAwLjM5NzkxNSAwLjA2MzQ5MzEgMC40OTYwMSAwLjAzMjk5NCAwLjYwMTE0NUMwLjAwMjQ5NDk0IDAuNzA2MjggLTAuMDA2OTg5NjIgMC44MTYzOTUgMC4wMDUwODIyOCAwLjkyNTE5NkMwLjAxNzE1NDIgMS4wMzQgMC4wNTA1NDU5IDEuMTM5MzYgMC4xMDMzNSAxLjIzNTI1QzAuMTU2MTUzIDEuMzMxMTQgMC4yMjczMzQgMS40MTU2OSAwLjMxMjgyNSAxLjQ4NDA2TDQuNDc5MjUgNC44MTcyQzQuNjI3MDQgNC45MzU1MyA0LjgxMDcyIDUgNS4wMDAwNSA1QzUuMTg5MzcgNSA1LjM3MzA2IDQuOTM1NTMgNS41MjA4NSA0LjgxNzJMOS42ODcyNyAxLjQ4NDA2QzkuODU5ODcgMS4zNDU5NCA5Ljk3MDU0IDEuMTQ0OSA5Ljk5NDkxIDAuOTI1MTg1QzEwLjAxOTMgMC43MDU0NjggOS45NTUzOSAwLjQ4NTA2NiA5LjgxNzI2IDAuMzEyNDY0QzkuNjc5MTQgMC4xMzk4NjMgOS40NzgxIDAuMDI5MjAwNyA5LjI1ODM5IDAuMDA0ODIyNDJDOS4wMzg2NyAtMC4wMTk1NTU5IDguODE4MjcgMC4wNDQzNDY1IDguNjQ1NjcgMC4xODI0NzJMNS4wMDAwNSAzLjA5ODk3TDEuMzU0NDMgMC4xODI0NzJDMS4yNjg5OCAwLjExNDA0OCAxLjE3MDg4IDAuMDYzMTMzIDEuMDY1NzUgMC4wMzI2MzM5QzAuOTYwNjE0IDAuMDAyMTM0ODEgMC44NTA1IC0wLjAwNzM1MDQgMC43NDE2OTggMC4wMDQ3MjE1QzAuNjMyODk2IDAuMDE2NzkzNCAwLjUyNzUzOSAwLjA1MDE4NTggMC40MzE2NDYgMC4xMDI5ODlDMC4zMzU3NTQgMC4xNTU3OTMgMC4yNTEyMDYgMC4yMjY5NzQgMC4xODI4MzIgMC4zMTI0NjRWMC4zMTI0NjRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K');
|
|
15
|
+
|
|
16
|
+
$labelSpaceBottom: '--#{constants.$prefix}label-space-bottom';
|
|
17
|
+
$helperTextSpaceTop: '--#{constants.$prefix}helper-text-space-top';
|
|
18
|
+
|
|
19
|
+
$comboboxCursor: '--#{constants.$prefix}text-field-cursor';
|
|
20
|
+
$comboboxInputCursor: '--#{constants.$prefix}text-field-input-cursor';
|
|
21
|
+
|
|
22
|
+
$comboboxDropdownMaxItemsVar: '--#{constants.$prefix}combobox-dropdown-max-items';
|
|
23
|
+
|
|
24
|
+
$stateStyleTokens: (
|
|
25
|
+
error: (
|
|
26
|
+
textColor: tokens.$bm-comp-input-color-text,
|
|
27
|
+
backgroundColor: tokens.$bm-comp-input-color-bg,
|
|
28
|
+
borderColor: tokens.$bm-comp-input-color-border-error,
|
|
29
|
+
expandIconColor: tokens.$bm-comp-input-color-icon,
|
|
30
|
+
),
|
|
31
|
+
read-only: (
|
|
32
|
+
textColor: tokens.$bm-comp-input-color-text,
|
|
33
|
+
backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
|
|
34
|
+
borderColor: tokens.$bm-comp-input-color-border-disabled,
|
|
35
|
+
expandIconColor: tokens.$bm-comp-input-color-icon-disabled,
|
|
36
|
+
),
|
|
37
|
+
disabled: (
|
|
38
|
+
textColor: tokens.$bm-comp-input-color-text-disabled,
|
|
39
|
+
backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
|
|
40
|
+
borderColor: tokens.$bm-comp-input-color-border-disabled,
|
|
41
|
+
expandIconColor: tokens.$bm-comp-input-color-icon-disabled,
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
.#{$comboboxBaseClass} {
|
|
46
|
+
@include cursors.applyTextCursors();
|
|
47
|
+
max-width: tokens.$bm-comp-input-size-field-width;
|
|
48
|
+
position: relative;
|
|
49
|
+
|
|
50
|
+
#{$labelSpaceBottom}: #{tokens.$bm-comp-label-space-bottom};
|
|
51
|
+
#{$helperTextSpaceTop}: #{tokens.$bm-comp-helper-text-space-top};
|
|
52
|
+
|
|
53
|
+
&--fluid {
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&--autocomplete &__field {
|
|
58
|
+
#{$comboboxInputCursor}: text;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&--disabled, &--disabled &__field {
|
|
62
|
+
#{$comboboxCursor}: not-allowed;
|
|
63
|
+
#{$comboboxInputCursor}: not-allowed;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&--multiple:not(&--autocomplete):not(&--empty) &__field__input {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:not(&--autocomplete) &__field::selection {
|
|
71
|
+
background-color: transparent;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&__field {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: row;
|
|
77
|
+
align-items: flex-start;
|
|
78
|
+
position: relative;
|
|
79
|
+
cursor: var(#{$comboboxCursor}, pointer);
|
|
80
|
+
user-select: none;
|
|
81
|
+
font: tokens.$bm-comp-input-typo-default;
|
|
82
|
+
min-height: tokens.$bm-comp-input-size-field-md-height;
|
|
83
|
+
gap: tokens.$bm-comp-input-space-field-gap;
|
|
84
|
+
#{iconVars.$iconColor}: tokens.$bm-comp-input-color-icon;
|
|
85
|
+
#{iconVars.$iconSize}: tokens.$bm-comp-input-size-field-icon;
|
|
86
|
+
|
|
87
|
+
&__chevron {
|
|
88
|
+
position: absolute;
|
|
89
|
+
cursor: var(#{$comboboxCursor}, pointer);
|
|
90
|
+
width: var(#{iconVars.$iconSize});
|
|
91
|
+
height: var(#{iconVars.$iconSize});
|
|
92
|
+
|
|
93
|
+
@include mixins.svg-icon($expandIcon, $expandIconWidth $expandIconHeight);
|
|
94
|
+
background-color: tokens.$bm-comp-input-color-icon;
|
|
95
|
+
inset-inline-end: calc(tokens.$bm-comp-input-space-field-x - (var(#{iconVars.$iconSize}) - $expandIconWidth) / 2);
|
|
96
|
+
inset-block-start: calc(tokens.$bm-comp-input-size-field-md-height / 2 - var(#{iconVars.$iconSize}) / 2);
|
|
97
|
+
|
|
98
|
+
transition: transform 0.2s ease;
|
|
99
|
+
|
|
100
|
+
.#{$comboboxBaseClass}--dropdown-open & {
|
|
101
|
+
transform: rotate(180deg) translateY(tokens.$bm-comp-input-border-width-field-default);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__before,
|
|
106
|
+
&__chips,
|
|
107
|
+
&__input,
|
|
108
|
+
&__after {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
flex: 0 0 auto;
|
|
112
|
+
gap: tokens.$bm-comp-input-space-field-gap;
|
|
113
|
+
min-height: calc(
|
|
114
|
+
tokens.$bm-comp-input-size-field-md-height - 2 *
|
|
115
|
+
tokens.$bm-comp-input-border-width-field-default - 2 *
|
|
116
|
+
tokens.$bm-comp-input-space-field-y
|
|
117
|
+
);
|
|
118
|
+
line-height: calc(
|
|
119
|
+
tokens.$bm-comp-input-size-field-md-height - 2 *
|
|
120
|
+
tokens.$bm-comp-input-border-width-field-default - 2 *
|
|
121
|
+
tokens.$bm-comp-input-space-field-y
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&__input {
|
|
126
|
+
background: transparent;
|
|
127
|
+
min-height: calc(tokens.$bm-comp-input-size-field-md-height - 2 * tokens.$bm-comp-input-space-field-y);
|
|
128
|
+
line-height: calc(tokens.$bm-comp-input-size-field-md-height - 2 * tokens.$bm-comp-input-space-field-y);
|
|
129
|
+
|
|
130
|
+
&::placeholder {
|
|
131
|
+
color: tokens.$bm-comp-input-color-text-placeholder;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&__content-before, &__content-after {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
gap: tokens.$bm-comp-input-space-field-gap;
|
|
140
|
+
color: tokens.$bm-comp-input-color-text-placeholder;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&__content-before,
|
|
144
|
+
&__content-after {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
gap: tokens.$bm-comp-input-space-field-gap;
|
|
149
|
+
color: tokens.$bm-comp-input-color-text-placeholder;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&__chips {
|
|
153
|
+
flex: 1;
|
|
154
|
+
gap: tokens.$bm-sem-space-25;
|
|
155
|
+
flex-wrap: wrap;
|
|
156
|
+
margin-block: calc(-1 * tokens.$bm-comp-input-border-width-field-default);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&__input {
|
|
160
|
+
flex: 1;
|
|
161
|
+
cursor: var(#{$comboboxInputCursor}, pointer);
|
|
162
|
+
|
|
163
|
+
text-overflow: ellipsis;
|
|
164
|
+
|
|
165
|
+
border: 0;
|
|
166
|
+
outline: 0;
|
|
167
|
+
margin: 0;
|
|
168
|
+
padding: 0;
|
|
169
|
+
font: tokens.$bm-comp-input-typo-default;
|
|
170
|
+
|
|
171
|
+
width: 100%;
|
|
172
|
+
min-width: 3rem;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@each $state, $styleTokens in $stateStyleTokens {
|
|
177
|
+
&--#{$state} &__field__chevron {
|
|
178
|
+
background-color: map.get($styleTokens, expandIconColor);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&--#{$state} &__field {
|
|
182
|
+
color: map.get($styleTokens, textColor);
|
|
183
|
+
border-color: map.get($styleTokens, borderColor);
|
|
184
|
+
background-color: map.get($styleTokens, backgroundColor);
|
|
185
|
+
|
|
186
|
+
@if ($state == error) {
|
|
187
|
+
@include mixins.simulated-inset-outline(
|
|
188
|
+
tokens.$bm-comp-input-border-width-field-error,
|
|
189
|
+
solid,
|
|
190
|
+
map.get($styleTokens, borderColor),
|
|
191
|
+
calc(0px - #{tokens.$bm-comp-input-border-width-field-error})
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&--disabled &__field &__field__input {
|
|
198
|
+
color: tokens.$bm-comp-input-color-text-disabled;
|
|
199
|
+
|
|
200
|
+
&::placeholder {
|
|
201
|
+
color: tokens.$bm-comp-input-color-text-disabled;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&__field {
|
|
206
|
+
border: tokens.$bm-comp-input-border-width-field-default solid
|
|
207
|
+
tokens.$bm-comp-input-color-border;
|
|
208
|
+
border-radius: tokens.$bm-comp-input-radius-field;
|
|
209
|
+
|
|
210
|
+
cursor: var(#{$comboboxInputCursor}, pointer);
|
|
211
|
+
box-shadow: tokens.$bm-comp-input-shadow-field;
|
|
212
|
+
background-color: tokens.$bm-comp-input-color-bg;
|
|
213
|
+
transform: translate3d(
|
|
214
|
+
tokens.$bm-sem-space-0,
|
|
215
|
+
tokens.$bm-sem-space-0,
|
|
216
|
+
tokens.$bm-sem-space-0
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
padding-block: tokens.$bm-comp-input-space-field-y;
|
|
220
|
+
padding-inline: tokens.$bm-comp-input-space-field-x
|
|
221
|
+
calc(
|
|
222
|
+
#{$expandIconWidth} + #{tokens.$bm-comp-input-space-field-gap} + #{tokens.$bm-comp-input-space-field-x}
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
min-height: tokens.$bm-comp-input-size-field-md-height;
|
|
226
|
+
|
|
227
|
+
&:focus-within {
|
|
228
|
+
@include mixins.simulated-inset-outline(
|
|
229
|
+
tokens.$bm-sem-border-width-focus,
|
|
230
|
+
solid,
|
|
231
|
+
tokens.$bm-sem-color-border-focus,
|
|
232
|
+
calc(0px - #{tokens.$bm-sem-size-focus-offset})
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&__dropdown {
|
|
238
|
+
padding: tokens.$bm-sem-space-50 tokens.$bm-sem-space-100 !important;
|
|
239
|
+
|
|
240
|
+
max-height: calc(var(#{$comboboxDropdownMaxItemsVar}, 8) * #{tokens.$bm-comp-actionlist-size-height} + 2 * #{tokens.$bm-sem-space-50});
|
|
241
|
+
overflow-y: auto;
|
|
242
|
+
}
|
|
243
|
+
}
|