@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,67 @@
|
|
|
1
|
+
@use '../utils/constants.scss';
|
|
2
|
+
@use '../utils/tokens.scss' as tokens;
|
|
3
|
+
|
|
4
|
+
@import '../../../../tokens/src/lib/components/Label';
|
|
5
|
+
|
|
6
|
+
$labelBaseClass: '#{constants.$prefix}label';
|
|
7
|
+
|
|
8
|
+
$labelCursor: '--#{constants.$prefix}comp-label-cursor';
|
|
9
|
+
$labelSpaceBottom: '--#{constants.$prefix}comp-label-space-bottom';
|
|
10
|
+
$labelPointerEvents: '--#{constants.$prefix}comp-label-pointer-events';
|
|
11
|
+
|
|
12
|
+
.#{$labelBaseClass} {
|
|
13
|
+
color: tokens.$bm-comp-label-color-text;
|
|
14
|
+
font: tokens.$bm-comp-label-typo-default;
|
|
15
|
+
margin-bottom: var(#{$labelSpaceBottom}, tokens.$bm-sem-space-0);
|
|
16
|
+
|
|
17
|
+
label {
|
|
18
|
+
cursor: var(#{$labelCursor}, default);
|
|
19
|
+
pointer-events: var(#{$labelPointerEvents}, inherit);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--disabled label {
|
|
23
|
+
opacity: tokens.$bm-sem-opacity-disabled;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&--required label {
|
|
27
|
+
&:after {
|
|
28
|
+
content: '*';
|
|
29
|
+
color: tokens.$bm-sem-color-text-negative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:has(:last-child) {
|
|
33
|
+
&:after {
|
|
34
|
+
content: '';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
& > *:last-child:after {
|
|
38
|
+
content: '*';
|
|
39
|
+
color: tokens.$bm-sem-color-text-negative;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__optional {
|
|
45
|
+
font: tokens.$bm-comp-label-typo-optional;
|
|
46
|
+
margin-left: tokens.$bm-comp-label-space-gap;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__tooltip {
|
|
50
|
+
vertical-align: top;
|
|
51
|
+
display: inline-block;
|
|
52
|
+
margin-inline-start: tokens.$bm-comp-label-space-gap;
|
|
53
|
+
|
|
54
|
+
button {
|
|
55
|
+
color: tokens.$bm-comp-tooltip-color-icon-trigger;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
svg {
|
|
59
|
+
height: tokens.$bm-comp-label-size-icon;
|
|
60
|
+
width: tokens.$bm-comp-label-size-icon;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&--no-box {
|
|
65
|
+
display: contents;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../utils/constants.scss';
|
|
3
|
+
@use '../utils/tokens.scss' as tokens;
|
|
4
|
+
|
|
5
|
+
@import '../../../../tokens/src/lib/components/Link';
|
|
6
|
+
|
|
7
|
+
$linkBaseClass: '#{constants.$prefix}link';
|
|
8
|
+
|
|
9
|
+
$appearances: (
|
|
10
|
+
'primary': (
|
|
11
|
+
'color': tokens.$bm-sem-color-link-primary,
|
|
12
|
+
'hover-color': tokens.$bm-comp-link-color-primary-hover,
|
|
13
|
+
'active-color': tokens.$bm-comp-link-color-primary-active,
|
|
14
|
+
),
|
|
15
|
+
'secondary': (
|
|
16
|
+
'color': tokens.$bm-sem-color-link-secondary,
|
|
17
|
+
'hover-color': tokens.$bm-comp-link-color-secondary-hover,
|
|
18
|
+
'active-color': tokens.$bm-comp-link-color-secondary-active,
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
$sizes: (
|
|
23
|
+
sm: (
|
|
24
|
+
text: tokens.$bm-comp-link-typo-sm,
|
|
25
|
+
icon: tokens.$bm-comp-link-size-sm-icon,
|
|
26
|
+
),
|
|
27
|
+
md: (
|
|
28
|
+
text: tokens.$bm-comp-link-typo-md,
|
|
29
|
+
icon: tokens.$bm-comp-link-size-md-icon,
|
|
30
|
+
),
|
|
31
|
+
lg: (
|
|
32
|
+
text: tokens.$bm-comp-link-typo-lg,
|
|
33
|
+
icon: tokens.$bm-comp-link-size-lg-icon,
|
|
34
|
+
),
|
|
35
|
+
xl: (
|
|
36
|
+
text: tokens.$bm-comp-link-typo-xl,
|
|
37
|
+
icon: tokens.$bm-comp-link-size-xl-icon,
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
.#{$linkBaseClass} {
|
|
42
|
+
outline: none;
|
|
43
|
+
width: fit-content;
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
border: tokens.$bm-sem-border-width-focus solid transparent;
|
|
47
|
+
margin: calc(#{tokens.$bm-sem-border-width-focus} * -1);
|
|
48
|
+
|
|
49
|
+
&:hover {
|
|
50
|
+
text-decoration: underline;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:focus,
|
|
54
|
+
&:focus-visible {
|
|
55
|
+
outline: none;
|
|
56
|
+
border-radius: tokens.$bm-sem-radius-focus-md;
|
|
57
|
+
border: tokens.$bm-sem-border-width-focus solid tokens.$bm-sem-color-border-focus;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&--disabled {
|
|
61
|
+
cursor: not-allowed;
|
|
62
|
+
opacity: tokens.$bm-sem-opacity-disabled;
|
|
63
|
+
text-decoration: none !important;
|
|
64
|
+
|
|
65
|
+
&:focus,
|
|
66
|
+
&:focus-visible {
|
|
67
|
+
border: tokens.$bm-sem-border-width-focus solid transparent;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&--hide-underline {
|
|
72
|
+
text-decoration: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@each $size, $sizeValue in $sizes {
|
|
76
|
+
$textSize: map.get($sizeValue, 'text');
|
|
77
|
+
$iconSize: map.get($sizeValue, 'icon');
|
|
78
|
+
|
|
79
|
+
&--#{$size} {
|
|
80
|
+
font: $textSize;
|
|
81
|
+
|
|
82
|
+
// Gap only needed when we have size
|
|
83
|
+
// otherwise it's an inhered link
|
|
84
|
+
// shouldn't render with an icon or gap
|
|
85
|
+
gap: tokens.$bm-comp-link-space-gap;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&--#{$size} &__icon,
|
|
89
|
+
&--#{$size} ::slotted([slot='iconBefore']),
|
|
90
|
+
&--#{$size} ::slotted([slot='iconAfter']) {
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
width: $iconSize;
|
|
93
|
+
height: $iconSize;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@each $state, $colors in $appearances {
|
|
98
|
+
$defaultColor: map.get($colors, 'color');
|
|
99
|
+
$hoverColor: map.get($colors, 'hover-color');
|
|
100
|
+
$activeColor: map.get($colors, 'active-color');
|
|
101
|
+
|
|
102
|
+
&--#{$state} {
|
|
103
|
+
color: $defaultColor;
|
|
104
|
+
|
|
105
|
+
&:not(&--disabled):hover {
|
|
106
|
+
color: $hoverColor;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:not(&--disabled):active {
|
|
110
|
+
color: $activeColor;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&--body-bold {
|
|
116
|
+
font-weight: tokens.$bm-sem-font-weight-body-bold;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../utils/constants.scss';
|
|
3
|
+
@use '../utils/mixins.scss' as mixins;
|
|
4
|
+
@use '../utils/tokens.scss' as tokens;
|
|
5
|
+
|
|
6
|
+
@import '../../../../tokens/src/lib/components/List';
|
|
7
|
+
|
|
8
|
+
$listBaseClass: '#{constants.$prefix}list';
|
|
9
|
+
$listItemBaseClass: '#{constants.$prefix}list__item';
|
|
10
|
+
|
|
11
|
+
$ol-list-styles: decimal, lower-alpha, lower-roman;
|
|
12
|
+
$ul-list-styles: disc, circle;
|
|
13
|
+
|
|
14
|
+
$sizes: (
|
|
15
|
+
sm: (
|
|
16
|
+
text: tokens.$bm-sem-typo-body-sm,
|
|
17
|
+
icon: tokens.$bm-sem-size-icon-md,
|
|
18
|
+
),
|
|
19
|
+
md: (
|
|
20
|
+
text: tokens.$bm-sem-typo-body-md,
|
|
21
|
+
icon: tokens.$bm-sem-size-icon-lg,
|
|
22
|
+
),
|
|
23
|
+
lg: (
|
|
24
|
+
text: tokens.$bm-sem-typo-body-lg,
|
|
25
|
+
icon: tokens.$bm-sem-size-icon-xl,
|
|
26
|
+
),
|
|
27
|
+
xl: (
|
|
28
|
+
text: tokens.$bm-sem-typo-body-xl,
|
|
29
|
+
icon: tokens.$bm-sem-size-icon-2xl,
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
$densities: (
|
|
34
|
+
density-md: tokens.$bm-comp-list-space-bottom-md,
|
|
35
|
+
density-lg: tokens.$bm-comp-list-space-bottom-lg,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
// Recursive mixins to handle nested list ordering for child lists of the same type
|
|
39
|
+
@mixin nested-ol-list-styles($depth: 0) {
|
|
40
|
+
list-style-type: nth($ol-list-styles, ($depth % length($ol-list-styles)) + 1);
|
|
41
|
+
|
|
42
|
+
li {
|
|
43
|
+
padding-inline-start: tokens.$bm-comp-list-space-marker;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@if $depth < 10 {
|
|
47
|
+
// support both sublists nested in li and regular sub lists of lists
|
|
48
|
+
& > li .#{$listBaseClass}--ordered {
|
|
49
|
+
@include nested-ol-list-styles($depth + 1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@mixin nested-ul-list-styles($depth: 0) {
|
|
55
|
+
list-style-type: nth($ul-list-styles, ($depth % length($ul-list-styles)) + 1);
|
|
56
|
+
|
|
57
|
+
li {
|
|
58
|
+
padding-inline-start: tokens.$bm-comp-list-space-marker;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@if $depth < 10 {
|
|
62
|
+
// support both sublists nested in li and regular sub lists of lists
|
|
63
|
+
& > li .#{$listBaseClass}--unordered {
|
|
64
|
+
@include nested-ul-list-styles($depth + 1);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.#{$listBaseClass} {
|
|
70
|
+
list-style: none;
|
|
71
|
+
color: tokens.$bm-sem-color-text-primary;
|
|
72
|
+
padding-inline-start: tokens.$bm-comp-list-space-indent;
|
|
73
|
+
margin-block-start: 0;
|
|
74
|
+
margin-block-end: 0;
|
|
75
|
+
|
|
76
|
+
&--ordered {
|
|
77
|
+
@include nested-ol-list-styles();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&--unordered {
|
|
81
|
+
@include nested-ul-list-styles();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&--unstyled {
|
|
85
|
+
list-style-type: none;
|
|
86
|
+
padding-inline-start: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--withIcons {
|
|
90
|
+
list-style-type: none;
|
|
91
|
+
padding-inline-start: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--withIcons &__content {
|
|
95
|
+
display: flex;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&--indent {
|
|
99
|
+
padding-inline-start: tokens.$bm-comp-list-space-indent;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@each $size, $sizeValue in $sizes {
|
|
103
|
+
&--#{$size} {
|
|
104
|
+
&.#{$listBaseClass}--wcWithIcons {
|
|
105
|
+
// negative margin to counteract withIcons flexbox layout (wc)
|
|
106
|
+
margin-inline-start: calc(
|
|
107
|
+
-1 * (map.get($sizeValue, 'icon') + tokens.$bm-comp-list-space-icon)
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
li,
|
|
112
|
+
&,
|
|
113
|
+
::slotted(bm-list-item) {
|
|
114
|
+
font: map.get($sizeValue, 'text');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&--#{$size} &__icon {
|
|
119
|
+
color: tokens.$bm-sem-color-icon-primary;
|
|
120
|
+
|
|
121
|
+
svg {
|
|
122
|
+
vertical-align: bottom;
|
|
123
|
+
margin-inline-end: tokens.$bm-comp-list-space-icon;
|
|
124
|
+
width: map.get($sizeValue, 'icon');
|
|
125
|
+
height: map.get($sizeValue, 'icon');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&--#{$size} &--withIcons {
|
|
130
|
+
// negative margin to counteract withIcons flexbox layout (react)
|
|
131
|
+
margin-inline-start: calc(
|
|
132
|
+
-1 * (map.get($sizeValue, 'icon') + tokens.$bm-comp-list-space-icon)
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@each $density, $densityValue in $densities {
|
|
138
|
+
&--#{$density} {
|
|
139
|
+
li:not(:has(> ol, > ul)) {
|
|
140
|
+
padding-bottom: $densityValue;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
ol,
|
|
144
|
+
ul,
|
|
145
|
+
&--nested {
|
|
146
|
+
padding-top: $densityValue;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.#{$listItemBaseClass} {
|
|
153
|
+
display: list-item;
|
|
154
|
+
|
|
155
|
+
&--decimal {
|
|
156
|
+
list-style-type: decimal;
|
|
157
|
+
padding-inline-start: tokens.$bm-comp-list-space-marker;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&--lower-alpha {
|
|
161
|
+
list-style: lower-alpha;
|
|
162
|
+
padding-inline-start: tokens.$bm-comp-list-space-marker;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&--lower-roman {
|
|
166
|
+
list-style-type: lower-roman;
|
|
167
|
+
padding-inline-start: tokens.$bm-comp-list-space-marker;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&--disc {
|
|
171
|
+
list-style-type: disc;
|
|
172
|
+
padding-inline-start: tokens.$bm-comp-list-space-marker;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&--circle {
|
|
176
|
+
list-style-type: circle;
|
|
177
|
+
padding-inline-start: tokens.$bm-comp-list-space-marker;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__content {
|
|
181
|
+
display: flex;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@each $density, $densityValue in $densities {
|
|
185
|
+
&--#{$density} {
|
|
186
|
+
padding-bottom: $densityValue;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@each $size, $sizeValue in $sizes {
|
|
191
|
+
&--#{$size} {
|
|
192
|
+
&__icon svg,
|
|
193
|
+
::slotted([slot='icon']) {
|
|
194
|
+
flex-shrink: 0;
|
|
195
|
+
color: tokens.$bm-sem-color-icon-primary;
|
|
196
|
+
display: inline-block;
|
|
197
|
+
vertical-align: bottom;
|
|
198
|
+
margin-inline-end: tokens.$bm-comp-list-space-icon;
|
|
199
|
+
width: map.get($sizeValue, 'icon');
|
|
200
|
+
height: map.get($sizeValue, 'icon');
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@use '../utils/constants.scss';
|
|
2
|
+
|
|
3
|
+
$logoBaseClass: '#{constants.$prefix}logo';
|
|
4
|
+
|
|
5
|
+
.#{$logoBaseClass} {
|
|
6
|
+
&--clickable { cursor: pointer; }
|
|
7
|
+
&--inline { display: inline; }
|
|
8
|
+
&--inline-block { display: inline-block; }
|
|
9
|
+
&--block { display: block; }
|
|
10
|
+
&--none { display: none; }
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@use '../utils/constants.scss';
|
|
2
|
+
@use '../utils/mixins.scss' as mixins;
|
|
3
|
+
@use '../utils/tokens.scss' as tokens;
|
|
4
|
+
|
|
5
|
+
@import '../../../../tokens/src/lib/components/Menu';
|
|
6
|
+
|
|
7
|
+
$menuBaseClass: '#{constants.$prefix}menu';
|
|
8
|
+
$menuPopoverContentClass: '#{constants.$prefix}menu__popover-content';
|
|
9
|
+
|
|
10
|
+
.#{$menuPopoverContentClass} {
|
|
11
|
+
padding: tokens.$bm-sem-space-50 tokens.$bm-sem-space-100;
|
|
12
|
+
overflow-y: auto;
|
|
13
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
|
|
7
|
+
@import '../../../../tokens/src/lib/components/Input';
|
|
8
|
+
|
|
9
|
+
$nativeSelectBaseClass: '#{constants.$prefix}native-select';
|
|
10
|
+
|
|
11
|
+
$expandIconWidth: 0.625rem;
|
|
12
|
+
$expandIconHeight: 0.3125rem;
|
|
13
|
+
$expandIcon: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iNSIgdmlld0JveD0iMCAwIDEwIDUiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0wLjE4MjgzMiAwLjMxMjQ2NEMwLjExNDQwOSAwLjM5NzkxNSAwLjA2MzQ5MzEgMC40OTYwMSAwLjAzMjk5NCAwLjYwMTE0NUMwLjAwMjQ5NDk0IDAuNzA2MjggLTAuMDA2OTg5NjIgMC44MTYzOTUgMC4wMDUwODIyOCAwLjkyNTE5NkMwLjAxNzE1NDIgMS4wMzQgMC4wNTA1NDU5IDEuMTM5MzYgMC4xMDMzNSAxLjIzNTI1QzAuMTU2MTUzIDEuMzMxMTQgMC4yMjczMzQgMS40MTU2OSAwLjMxMjgyNSAxLjQ4NDA2TDQuNDc5MjUgNC44MTcyQzQuNjI3MDQgNC45MzU1MyA0LjgxMDcyIDUgNS4wMDAwNSA1QzUuMTg5MzcgNSA1LjM3MzA2IDQuOTM1NTMgNS41MjA4NSA0LjgxNzJMOS42ODcyNyAxLjQ4NDA2QzkuODU5ODcgMS4zNDU5NCA5Ljk3MDU0IDEuMTQ0OSA5Ljk5NDkxIDAuOTI1MTg1QzEwLjAxOTMgMC43MDU0NjggOS45NTUzOSAwLjQ4NTA2NiA5LjgxNzI2IDAuMzEyNDY0QzkuNjc5MTQgMC4xMzk4NjMgOS40NzgxIDAuMDI5MjAwNyA5LjI1ODM5IDAuMDA0ODIyNDJDOS4wMzg2NyAtMC4wMTk1NTU5IDguODE4MjcgMC4wNDQzNDY1IDguNjQ1NjcgMC4xODI0NzJMNS4wMDAwNSAzLjA5ODk3TDEuMzU0NDMgMC4xODI0NzJDMS4yNjg5OCAwLjExNDA0OCAxLjE3MDg4IDAuMDYzMTMzIDEuMDY1NzUgMC4wMzI2MzM5QzAuOTYwNjE0IDAuMDAyMTM0ODEgMC44NTA1IC0wLjAwNzM1MDQgMC43NDE2OTggMC4wMDQ3MjE1QzAuNjMyODk2IDAuMDE2NzkzNCAwLjUyNzUzOSAwLjA1MDE4NTggMC40MzE2NDYgMC4xMDI5ODlDMC4zMzU3NTQgMC4xNTU3OTMgMC4yNTEyMDYgMC4yMjY5NzQgMC4xODI4MzIgMC4zMTI0NjRWMC4zMTI0NjRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K');
|
|
14
|
+
|
|
15
|
+
$labelSpaceBottom: '--#{constants.$prefix}label-space-bottom';
|
|
16
|
+
$helperTextSpaceTop: '--#{constants.$prefix}helper-text-space-top';
|
|
17
|
+
|
|
18
|
+
$selectCursor: '--#{constants.$prefix}text-field-cursor';
|
|
19
|
+
$selectInputCursor: '--#{constants.$prefix}text-field-input-cursor';
|
|
20
|
+
|
|
21
|
+
$stateStyleTokens: (
|
|
22
|
+
error: (
|
|
23
|
+
textColor: tokens.$bm-comp-input-color-text,
|
|
24
|
+
backgroundColor: tokens.$bm-comp-input-color-bg,
|
|
25
|
+
borderColor: tokens.$bm-comp-input-color-border-error,
|
|
26
|
+
expandIconColor: tokens.$bm-comp-input-color-icon,
|
|
27
|
+
),
|
|
28
|
+
read-only: (
|
|
29
|
+
textColor: tokens.$bm-comp-input-color-text,
|
|
30
|
+
backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
|
|
31
|
+
borderColor: tokens.$bm-comp-input-color-border-disabled,
|
|
32
|
+
expandIconColor: tokens.$bm-comp-input-color-icon-disabled,
|
|
33
|
+
),
|
|
34
|
+
disabled: (
|
|
35
|
+
textColor: tokens.$bm-comp-input-color-text-disabled,
|
|
36
|
+
backgroundColor: tokens.$bm-comp-input-color-bg-disabled,
|
|
37
|
+
borderColor: tokens.$bm-comp-input-color-border-disabled,
|
|
38
|
+
expandIconColor: tokens.$bm-comp-input-color-icon-disabled,
|
|
39
|
+
),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
.#{$nativeSelectBaseClass} {
|
|
43
|
+
@include cursors.applyTextCursors();
|
|
44
|
+
max-width: tokens.$bm-comp-input-size-field-width;
|
|
45
|
+
|
|
46
|
+
#{$labelSpaceBottom}: #{tokens.$bm-comp-label-space-bottom};
|
|
47
|
+
#{$helperTextSpaceTop}: #{tokens.$bm-comp-helper-text-space-top};
|
|
48
|
+
|
|
49
|
+
&--fluid {
|
|
50
|
+
max-width: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&--ellipsis &__field &__input {
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&__field {
|
|
60
|
+
position: relative;
|
|
61
|
+
cursor: var(#{$selectCursor}, default);
|
|
62
|
+
|
|
63
|
+
&:after {
|
|
64
|
+
content: '';
|
|
65
|
+
position: absolute;
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
width: $expandIconWidth;
|
|
68
|
+
height: $expandIconHeight;
|
|
69
|
+
|
|
70
|
+
@include mixins.svg-icon($expandIcon);
|
|
71
|
+
background-color: tokens.$bm-comp-input-color-icon;
|
|
72
|
+
inset-inline-end: tokens.$bm-comp-input-space-field-x;
|
|
73
|
+
inset-block-start: calc(
|
|
74
|
+
#{tokens.$bm-comp-input-space-field-x} + #{$expandIconHeight} / 2
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@each $state, $styleTokens in $stateStyleTokens {
|
|
80
|
+
&--#{$state} &__field:after {
|
|
81
|
+
background-color: map.get($styleTokens, expandIconColor);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&--#{$state} &__field &__input {
|
|
85
|
+
color: map.get($styleTokens, textColor);
|
|
86
|
+
border-color: map.get($styleTokens, borderColor);
|
|
87
|
+
background-color: map.get($styleTokens, backgroundColor);
|
|
88
|
+
|
|
89
|
+
@if ($state == error) {
|
|
90
|
+
@include mixins.simulated-inset-outline(
|
|
91
|
+
tokens.$bm-comp-input-border-width-field-error,
|
|
92
|
+
solid,
|
|
93
|
+
map.get($styleTokens, borderColor),
|
|
94
|
+
calc(0px - #{tokens.$bm-comp-input-border-width-field-error})
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__field &__input {
|
|
101
|
+
width: 100%;
|
|
102
|
+
display: block;
|
|
103
|
+
appearance: none;
|
|
104
|
+
-moz-appearance: none;
|
|
105
|
+
-webkit-appearance: none;
|
|
106
|
+
|
|
107
|
+
border-style: solid;
|
|
108
|
+
border-color: tokens.$bm-comp-input-color-border;
|
|
109
|
+
border-radius: tokens.$bm-comp-input-radius-field;
|
|
110
|
+
border-width: tokens.$bm-comp-input-border-width-field-default;
|
|
111
|
+
|
|
112
|
+
color: tokens.$bm-comp-input-color-text;
|
|
113
|
+
font: tokens.$bm-comp-input-typo-default;
|
|
114
|
+
cursor: var(#{$selectInputCursor}, pointer);
|
|
115
|
+
box-shadow: tokens.$bm-comp-input-shadow-field;
|
|
116
|
+
background-color: tokens.$bm-comp-input-color-bg;
|
|
117
|
+
height: tokens.$bm-comp-input-size-field-md-height;
|
|
118
|
+
transform: translate3d(
|
|
119
|
+
tokens.$bm-sem-space-0,
|
|
120
|
+
tokens.$bm-sem-space-0,
|
|
121
|
+
tokens.$bm-sem-space-0
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
padding-block: tokens.$bm-comp-input-space-field-y;
|
|
125
|
+
padding-inline: tokens.$bm-comp-input-space-field-x
|
|
126
|
+
calc(
|
|
127
|
+
#{$expandIconWidth} + #{tokens.$bm-comp-input-space-field-gap} + #{tokens.$bm-comp-input-space-field-x}
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
&:focus {
|
|
131
|
+
@include mixins.simulated-inset-outline(
|
|
132
|
+
tokens.$bm-sem-border-width-focus,
|
|
133
|
+
solid,
|
|
134
|
+
tokens.$bm-sem-color-border-focus,
|
|
135
|
+
calc(0px - #{tokens.$bm-sem-size-focus-offset})
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
@use '../utils/constants.scss';
|
|
2
|
+
@use '../utils/tokens.scss' as tokens;
|
|
3
|
+
|
|
4
|
+
$navBaseClass: '#{constants.$prefix}navigation';
|
|
5
|
+
$transitionDuration: 0.2s;
|
|
6
|
+
|
|
7
|
+
@mixin nav-item-indicator {
|
|
8
|
+
display: block;
|
|
9
|
+
position: absolute;
|
|
10
|
+
background: tokens.$bm-comp-header-color-nav-item-indicator;
|
|
11
|
+
content: '';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.#{$navBaseClass} {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
|
|
18
|
+
&__list {
|
|
19
|
+
display: flex;
|
|
20
|
+
gap: tokens.$bm-comp-header-space-nav-gap;
|
|
21
|
+
margin: unset;
|
|
22
|
+
padding-inline-start: unset;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--vertical &__list {
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__item {
|
|
31
|
+
display: flex;
|
|
32
|
+
position: relative;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
height: tokens.$bm-comp-header-size-height;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
|
|
38
|
+
.bm-state-layer {
|
|
39
|
+
--bm-state-layer-left: 0;
|
|
40
|
+
--bm-state-layer-right: 0;
|
|
41
|
+
--bm-state-layer-outline-offset: 0;
|
|
42
|
+
--bm-state-layer-top: calc(
|
|
43
|
+
(100% - #{tokens.$bm-comp-header-size-nav-item-height}) / 2
|
|
44
|
+
);
|
|
45
|
+
--bm-state-layer-bottom: calc(
|
|
46
|
+
(100% - #{tokens.$bm-comp-header-size-nav-item-height}) / 2
|
|
47
|
+
);
|
|
48
|
+
border-radius: tokens.$bm-comp-header-radius-nav-item;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&--disabled {
|
|
52
|
+
opacity: tokens.$bm-sem-opacity-disabled;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--selected::after {
|
|
56
|
+
@include nav-item-indicator;
|
|
57
|
+
|
|
58
|
+
bottom: 0;
|
|
59
|
+
transition: width $transitionDuration ease;
|
|
60
|
+
margin-inline: tokens.$bm-comp-header-space-nav-item-x;
|
|
61
|
+
border-start-start-radius: tokens.$bm-comp-header-radius-indicator;
|
|
62
|
+
border-start-end-radius: tokens.$bm-comp-header-radius-indicator;
|
|
63
|
+
width: calc(100% - tokens.$bm-comp-header-space-nav-item-x * 2);
|
|
64
|
+
height: tokens.$bm-comp-header-size-nav-item-indicator;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&--selected &-link {
|
|
68
|
+
color: tokens.$bm-comp-header-color-nav-item-fg-selected;
|
|
69
|
+
font: tokens.$bm-comp-header-nav-item-typo-selected;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&-link {
|
|
73
|
+
display: flex;
|
|
74
|
+
position: relative;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: tokens.$bm-comp-header-space-nav-item-gap;
|
|
77
|
+
|
|
78
|
+
border-radius: tokens.$bm-comp-header-radius-nav-item;
|
|
79
|
+
padding-inline: tokens.$bm-comp-header-space-nav-item-x;
|
|
80
|
+
min-width: 100%;
|
|
81
|
+
height: tokens.$bm-comp-header-size-nav-item-height;
|
|
82
|
+
color: tokens.$bm-comp-header-color-nav-item-fg;
|
|
83
|
+
|
|
84
|
+
font: tokens.$bm-comp-header-nav-item-typo-default;
|
|
85
|
+
text-decoration: none;
|
|
86
|
+
z-index: 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&-link:focus-within {
|
|
90
|
+
outline: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&--disabled &-link {
|
|
94
|
+
cursor: not-allowed;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&-icon-container {
|
|
98
|
+
display: flex;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
align-items: center;
|
|
101
|
+
|
|
102
|
+
aspect-ratio: 1;
|
|
103
|
+
width: tokens.$bm-comp-header-size-nav-item-icon;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&--vertical &__item {
|
|
108
|
+
height: tokens.$bm-comp-header-size-nav-item-height;
|
|
109
|
+
justify-content: flex-start;
|
|
110
|
+
align-items: center;
|
|
111
|
+
|
|
112
|
+
.bm-state-layer {
|
|
113
|
+
--bm-state-layer-left: calc(-1 * var(--bm-comp-actionlist-size-state-offset));
|
|
114
|
+
--bm-state-layer-right: calc(-1 * var(--bm-comp-actionlist-size-state-offset));
|
|
115
|
+
--bm-state-layer-outline-offset: calc(
|
|
116
|
+
-1 * var(--bm-state-layer-outline-width)
|
|
117
|
+
);
|
|
118
|
+
--bm-state-layer-top: 0;
|
|
119
|
+
--bm-state-layer-bottom: 0;
|
|
120
|
+
border-radius: var(--bm-comp-actionlist-radius);
|
|
121
|
+
z-index: -1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&--selected {
|
|
125
|
+
&::before {
|
|
126
|
+
@include nav-item-indicator;
|
|
127
|
+
|
|
128
|
+
inset-inline-start: 0;
|
|
129
|
+
transform: translateX(-50%);
|
|
130
|
+
transition: height $transitionDuration ease;
|
|
131
|
+
|
|
132
|
+
margin-block: tokens.$bm-comp-header-space-nav-item-x;
|
|
133
|
+
border-radius: tokens.$bm-comp-header-radius-indicator;
|
|
134
|
+
|
|
135
|
+
width: tokens.$bm-comp-actionlist-size-indicator-width;
|
|
136
|
+
height: calc(100% - tokens.$bm-comp-header-space-nav-item-x * 2);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&--selected::after {
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&-link {
|
|
145
|
+
display: -webkit-box;
|
|
146
|
+
-webkit-box-orient: vertical;
|
|
147
|
+
-webkit-line-clamp: 1;
|
|
148
|
+
line-clamp: 1;
|
|
149
|
+
align-self: stretch;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
text-overflow: ellipsis;
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
line-height: tokens.$bm-comp-header-size-nav-item-height;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|