@viasat/beam-styles 2.72.1 → 2.74.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.
@@ -0,0 +1,91 @@
1
+ @use '../utils/constants.scss';
2
+ @use '../utils/mixins.scss' as mixins;
3
+ @use '../utils/tokens.scss' as tokens;
4
+
5
+ $calendarBaseClass: '#{constants.$prefix}calendar';
6
+
7
+ .#{$calendarBaseClass} {
8
+ // The grid is a fixed 7 × 40px wide per Figma; without this the root block
9
+ // would stretch to its container and leave the table floating inside it.
10
+ inline-size: fit-content;
11
+
12
+ // Announced but not drawn: the column's full weekday name, and each cell's
13
+ // full date. Both are cases where the visible text is an abbreviation and the
14
+ // spoken text needs to be the whole thing. This needs a real rule — an
15
+ // undeclared class resolves to undefined in the CSS-module build, and the
16
+ // text would render on screen instead of being hidden.
17
+ &__visually-hidden {
18
+ @include mixins.visually-hidden;
19
+ }
20
+
21
+ &__grid {
22
+ // Suppresses the UA's default cell borders and 2px spacing. Row rhythm is
23
+ // handled by cell padding below instead of `border-spacing`, which would
24
+ // also add space above the first row and below the last.
25
+ border-collapse: collapse;
26
+ }
27
+
28
+ &__day {
29
+ box-sizing: border-box;
30
+ // Figma binds the cell's width to the same `height/md` token it uses for
31
+ // the 40px date cells, so the columns line up between header and grid.
32
+ inline-size: tokens.$bm-sem-size-height-md;
33
+ block-size: tokens.$bm-sem-size-height-sm;
34
+
35
+ font: tokens.$bm-sem-typo-label-xs;
36
+ color: tokens.$bm-sem-color-text-secondary;
37
+ text-align: center;
38
+ }
39
+
40
+ &__date {
41
+ padding: 0;
42
+ }
43
+
44
+ // 4px between week rows, with no leading or trailing gap.
45
+ //
46
+ // Structure-dependent: this relies on `<td>` being a direct child of `<tr>`
47
+ // and on the rows being direct siblings. Audit it before inserting any
48
+ // wrapper element into the grid (see AGENTS.md).
49
+ &__week + &__week > &__date {
50
+ padding-block-start: tokens.$bm-sem-space-25;
51
+ }
52
+
53
+ // The 40px round cell body. A `<span>` in C-1 — nothing is selectable yet, so
54
+ // the cell is text rather than a control — and a `<button>` again from C-3,
55
+ // which is why the name and the `position: relative` the state layer needs
56
+ // both stay put.
57
+ &__date-button {
58
+ position: relative;
59
+ box-sizing: border-box;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+
64
+ inline-size: tokens.$bm-sem-size-height-md;
65
+ block-size: tokens.$bm-sem-size-height-md;
66
+ padding: 0;
67
+
68
+ border: none;
69
+ border-radius: tokens.$bm-sem-radius-round;
70
+ background-color: transparent;
71
+
72
+ font: tokens.$bm-sem-typo-body-sm;
73
+ color: tokens.$bm-sem-color-text-primary;
74
+
75
+ // Nothing is selectable until C-3; the state layer is muted in the TSX for
76
+ // the same reason. No `:hover` / `:focus-visible` rules here either — those
77
+ // belong to the state layer, per .claude/rules/accessibility.md.
78
+ cursor: default;
79
+ }
80
+
81
+ // Adjacent-month days.
82
+ //
83
+ // UNCONFIRMED BY DESIGN: Figma currently renders `outsideMonth` cells blank
84
+ // (i.e. `showOutsideDays={false}`), while the C-1 acceptance criteria call for
85
+ // dimmed dates. `text/secondary` is used rather than the disabled treatment
86
+ // because these days become selectable (C-3) and focusable (C-10), so the
87
+ // disabled look would signal the wrong affordance.
88
+ &__date[data-outside-month='true'] &__date-button {
89
+ color: tokens.$bm-sem-color-text-secondary;
90
+ }
91
+ }
@@ -84,19 +84,17 @@ $dataTableDensity: (
84
84
  background: tokens.$bm-comp-data-table-color-bg;
85
85
  }
86
86
 
87
- // Scope zebra striping to body rows only. A plain `&__row:nth-of-type(even)`
88
- // also shades the second row of grouped headers (masked today by the column
89
- // header background), which would surface if that token ever changes.
90
- &__body &__row:nth-of-type(even) {
91
- background: tokens.$bm-comp-data-table-color-zebra;
87
+ // Body scoping keeps grouped header rows plain while rows opt into striping.
88
+ &__body &__row--striped {
89
+ background-color: tokens.$bm-comp-data-table-color-zebra;
92
90
  }
93
91
 
94
- // Phase 1 display-only hover: a plain token background via `:hover`, no
95
- // StateLayer (interactive rows adopt StateLayer in Phase 3). Placed after the
96
- // zebra rule so it wins on equal specificity; full stripe-vs-hover precedence
97
- // is owned by EPTOOLS-2195.
98
- &__body &__row:hover {
99
- background: tokens.$bm-sem-color-state-layer-hover;
92
+ // Opt-in hover layers over the base or zebra fill, scoped to this table's rows.
93
+ &--row-hover > &__body > &__row:hover {
94
+ background-image: linear-gradient(
95
+ tokens.$bm-sem-color-state-layer-hover,
96
+ tokens.$bm-sem-color-state-layer-hover
97
+ );
100
98
  }
101
99
 
102
100
  &__cell {
@@ -10,6 +10,7 @@
10
10
  @use './box.module.scss';
11
11
  @use './breadcrumbs.module.scss';
12
12
  @use './button.module.scss';
13
+ @use './calendar.module.scss';
13
14
  @use './card.module.scss';
14
15
  @use './checkbox.module.scss';
15
16
  @use './chip.module.scss';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viasat/beam-styles",
3
- "version": "2.72.1",
3
+ "version": "2.74.0",
4
4
  "description": "SCSS modules and component styles for the Beam Design System",
5
5
  "license": "MIT",
6
6
  "author": "Viasat",
package/styles.css CHANGED
@@ -4939,6 +4939,56 @@
4939
4939
  .bm-button--fluid {
4940
4940
  width: 100%;
4941
4941
  }
4942
+ .bm-calendar {
4943
+ inline-size: fit-content;
4944
+ }
4945
+ .bm-calendar__visually-hidden {
4946
+ position: absolute;
4947
+ width: 1px;
4948
+ height: 1px;
4949
+ margin: -1px;
4950
+ padding: 0;
4951
+ overflow: hidden;
4952
+ clip: rect(0, 0, 0, 0);
4953
+ border: 0;
4954
+ }
4955
+ .bm-calendar__grid {
4956
+ border-collapse: collapse;
4957
+ }
4958
+ .bm-calendar__day {
4959
+ box-sizing: border-box;
4960
+ inline-size: var(--bm-sem-size-height-md);
4961
+ block-size: var(--bm-sem-size-height-sm);
4962
+ font: var(--bm-sem-typo-label-xs);
4963
+ color: var(--bm-sem-color-text-secondary);
4964
+ text-align: center;
4965
+ }
4966
+ .bm-calendar__date {
4967
+ padding: 0;
4968
+ }
4969
+ .bm-calendar__week + .bm-calendar__week > .bm-calendar__date {
4970
+ padding-block-start: var(--bm-sem-space-25);
4971
+ }
4972
+ .bm-calendar__date-button {
4973
+ position: relative;
4974
+ box-sizing: border-box;
4975
+ display: flex;
4976
+ align-items: center;
4977
+ justify-content: center;
4978
+ inline-size: var(--bm-sem-size-height-md);
4979
+ block-size: var(--bm-sem-size-height-md);
4980
+ padding: 0;
4981
+ border: none;
4982
+ border-radius: var(--bm-sem-radius-round);
4983
+ background-color: transparent;
4984
+ font: var(--bm-sem-typo-body-sm);
4985
+ color: var(--bm-sem-color-text-primary);
4986
+ cursor: default;
4987
+ }
4988
+ .bm-calendar__date[data-outside-month=true] .bm-calendar__date-button {
4989
+ color: var(--bm-sem-color-text-secondary);
4990
+ }
4991
+
4942
4992
  :root,
4943
4993
  :host,
4944
4994
  .bm-light,
@@ -7730,11 +7780,11 @@ textarea:focus-visible,
7730
7780
  .bm-data-table__body {
7731
7781
  background: var(--bm-comp-data-table-color-bg);
7732
7782
  }
7733
- .bm-data-table__body .bm-data-table__row:nth-of-type(even) {
7734
- background: var(--bm-comp-data-table-color-zebra);
7783
+ .bm-data-table__body .bm-data-table__row--striped {
7784
+ background-color: var(--bm-comp-data-table-color-zebra);
7735
7785
  }
7736
- .bm-data-table__body .bm-data-table__row:hover {
7737
- background: var(--bm-sem-color-state-layer-hover);
7786
+ .bm-data-table--row-hover > .bm-data-table__body > .bm-data-table__row:hover {
7787
+ background-image: linear-gradient(var(--bm-sem-color-state-layer-hover), var(--bm-sem-color-state-layer-hover));
7738
7788
  }
7739
7789
  .bm-data-table__cell {
7740
7790
  font: var(--bm-comp-data-table-typo-cell);