@viasat/beam-styles 2.73.0 → 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.
- package/components/calendar.module.scss +91 -0
- package/components/index.scss +1 -0
- package/package.json +1 -1
- package/styles.css +50 -0
- package/styles.css.map +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
|
@@ -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
|
+
}
|
package/components/index.scss
CHANGED
package/package.json
CHANGED
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,
|