@viasat/beam-styles 2.1.0 → 2.2.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.
@@ -2,6 +2,7 @@
2
2
  @use '../utils/constants.scss';
3
3
  @use '../utils/mixins.scss' as mixins;
4
4
  @use '../utils/tokens.scss' as tokens;
5
+ @use '../utils/stateLayerVars.scss' as state-layer;
5
6
 
6
7
  @import '../../../../tokens/src/lib/components/Card';
7
8
 
@@ -71,6 +72,7 @@ $cardDensity: (
71
72
  display: flex;
72
73
  flex-direction: column;
73
74
  overflow: hidden;
75
+ outline: none;
74
76
 
75
77
  &--default-background {
76
78
  background: tokens.$bm-comp-card-color-bg;
@@ -84,6 +86,91 @@ $cardDensity: (
84
86
  &--default-border-radius {
85
87
  border-radius: tokens.$bm-comp-card-radius-outer;
86
88
  }
89
+
90
+ // Interactive card styles (clickable/selectable)
91
+ &--interactive {
92
+ position: relative;
93
+ cursor: pointer;
94
+ user-select: none;
95
+
96
+ // Reset default button/anchor styles when using as those elements
97
+ text-decoration: none;
98
+ color: inherit;
99
+ font: inherit;
100
+ text-align: inherit;
101
+ appearance: none;
102
+ -webkit-appearance: none;
103
+ -moz-appearance: none;
104
+ padding: 0;
105
+ margin: 0;
106
+
107
+ // State layer for hover/active states (direct child only, not nested state layers)
108
+ // Extend to cover the border area so overlay matches full card surface
109
+ > .#{state-layer.$stateLayerBaseClass} {
110
+ pointer-events: none;
111
+ z-index: 1;
112
+
113
+ $border-offset: calc(0px - tokens.$bm-sem-border-width-md);
114
+ #{state-layer.$top}: $border-offset;
115
+ #{state-layer.$right}: $border-offset;
116
+ #{state-layer.$bottom}: $border-offset;
117
+ #{state-layer.$left}: $border-offset;
118
+ }
119
+
120
+ // Focus outline
121
+ &:focus-visible {
122
+ @include mixins.simulated-inset-outline(
123
+ tokens.$bm-sem-border-width-focus,
124
+ solid,
125
+ tokens.$bm-sem-color-border-focus,
126
+ calc(tokens.$bm-sem-border-width-md + tokens.$bm-sem-size-focus-offset)
127
+ );
128
+ }
129
+
130
+ // Suppress state layer when hovering interactive children
131
+ &:has(
132
+ button:hover,
133
+ a:hover,
134
+ input:hover,
135
+ select:hover,
136
+ textarea:hover,
137
+ [role='button']:hover,
138
+ [role='link']:hover,
139
+ [tabindex]:not([tabindex='-1']):hover
140
+ )
141
+ > .#{state-layer.$stateLayerBaseClass} {
142
+ #{state-layer.$opacity}: 0 !important;
143
+ #{state-layer.$background}: transparent !important;
144
+ }
145
+
146
+ // Suppress state layer when clicking (active) interactive children
147
+ &:has(
148
+ button:active,
149
+ a:active,
150
+ input:active,
151
+ select:active,
152
+ textarea:active,
153
+ [role='button']:active,
154
+ [role='link']:active,
155
+ [tabindex]:not([tabindex='-1']):active
156
+ )
157
+ > .#{state-layer.$stateLayerBaseClass} {
158
+ #{state-layer.$opacity}: 0 !important;
159
+ #{state-layer.$background}: transparent !important;
160
+ }
161
+ }
162
+
163
+
164
+ // Disabled state
165
+ &--disabled {
166
+ opacity: tokens.$bm-sem-opacity-disabled;
167
+ cursor: not-allowed;
168
+ }
169
+
170
+ // Selected state (for future selectable implementation)
171
+ &--selected {
172
+ border-color: tokens.$bm-comp-card-color-border-selected;
173
+ }
87
174
  }
88
175
 
89
176
  // Card.Content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viasat/beam-styles",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "SCSS modules and component styles for the Beam Design System",
5
5
  "license": "MIT",
6
6
  "author": "Viasat",