@thalassic/themes 22.4.0 → 22.5.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thalassic/themes",
3
- "version": "22.4.0",
3
+ "version": "22.5.1",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^22.0.0",
@@ -0,0 +1,73 @@
1
+ @use '../../mixins' as mixins;
2
+
3
+ .tls-calendar-agenda-view {
4
+ display: flex;
5
+ flex-direction: column;
6
+
7
+ &__day {
8
+ display: grid;
9
+ grid-template-columns: var(--spacing-24) 1fr;
10
+ gap: var(--spacing-4);
11
+
12
+ padding-block: var(--spacing-3);
13
+
14
+ & + & {
15
+ border-block-start: 1px solid var(--color-outline-variant);
16
+ }
17
+ }
18
+
19
+ &__date {
20
+ padding: 0;
21
+
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: var(--spacing-1);
25
+
26
+ border: none;
27
+
28
+ background-color: transparent;
29
+
30
+ text-align: start;
31
+ color: var(--color-on-surface);
32
+
33
+ cursor: pointer;
34
+
35
+ &:focus-visible {
36
+ @include mixins.focus-ring;
37
+ }
38
+
39
+ &--today {
40
+ color: var(--color-primary);
41
+ }
42
+ }
43
+
44
+ &__weekday {
45
+ font-size: var(--font-label-medium-size);
46
+ font-weight: var(--font-weight-medium);
47
+ }
48
+
49
+ &__date-label {
50
+ font-size: var(--font-label-small-size);
51
+ color: var(--color-on-surface-variant);
52
+ }
53
+
54
+ &__events {
55
+ margin: 0;
56
+ padding: 0;
57
+
58
+ display: flex;
59
+ flex-direction: column;
60
+ gap: var(--spacing-1);
61
+
62
+ list-style: none;
63
+ }
64
+
65
+ &__empty {
66
+ margin: 0;
67
+
68
+ padding: var(--spacing-8);
69
+
70
+ text-align: center;
71
+ color: var(--color-on-surface-variant);
72
+ }
73
+ }
@@ -0,0 +1,70 @@
1
+ .tls-calendar-event {
2
+ display: block;
3
+
4
+ height: 100%;
5
+
6
+ &__button {
7
+ box-sizing: border-box;
8
+ width: 100%;
9
+ height: 100%;
10
+
11
+ padding-inline: var(--spacing-2);
12
+
13
+ display: flex;
14
+ align-items: center;
15
+
16
+ border: none;
17
+ border-radius: var(--radius-sm);
18
+
19
+ background-color: var(--tls-calendar-event-color, var(--color-primary-container));
20
+
21
+ font-size: var(--font-label-small-size);
22
+ line-height: var(--font-label-small-line-height);
23
+ color: var(--tls-calendar-event-on-color, var(--color-on-primary-container));
24
+
25
+ cursor: pointer;
26
+
27
+ &--primary {
28
+ --tls-calendar-event-color: var(--color-primary-container);
29
+ --tls-calendar-event-on-color: var(--color-on-primary-container);
30
+ }
31
+
32
+ &--secondary {
33
+ --tls-calendar-event-color: var(--color-secondary-container);
34
+ --tls-calendar-event-on-color: var(--color-on-secondary-container);
35
+ }
36
+
37
+ &--tertiary {
38
+ --tls-calendar-event-color: var(--color-tertiary-container);
39
+ --tls-calendar-event-on-color: var(--color-on-tertiary-container);
40
+ }
41
+
42
+ &--success {
43
+ --tls-calendar-event-color: var(--color-success-container);
44
+ --tls-calendar-event-on-color: var(--color-on-success-container);
45
+ }
46
+
47
+ &--info {
48
+ --tls-calendar-event-color: var(--color-info-container);
49
+ --tls-calendar-event-on-color: var(--color-on-info-container);
50
+ }
51
+
52
+ &--warning {
53
+ --tls-calendar-event-color: var(--color-warning-container);
54
+ --tls-calendar-event-on-color: var(--color-on-warning-container);
55
+ }
56
+
57
+ &--danger {
58
+ --tls-calendar-event-color: var(--color-danger-container);
59
+ --tls-calendar-event-on-color: var(--color-on-danger-container);
60
+ }
61
+ }
62
+
63
+ &__label {
64
+ min-width: 0;
65
+
66
+ overflow: hidden;
67
+ text-overflow: ellipsis;
68
+ white-space: nowrap;
69
+ }
70
+ }
@@ -0,0 +1,39 @@
1
+ .tls-calendar {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: var(--spacing-4);
5
+
6
+ &__header {
7
+ display: flex;
8
+ flex-wrap: wrap;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ gap: var(--spacing-4);
12
+ }
13
+
14
+ &__nav {
15
+ display: flex;
16
+ align-items: center;
17
+ gap: var(--spacing-2);
18
+ }
19
+
20
+ &__nav-button {
21
+ svg {
22
+ width: 8px;
23
+ height: 14px;
24
+ }
25
+ }
26
+
27
+ &__title {
28
+ margin: 0;
29
+
30
+ font-size: var(--font-title-large-size);
31
+ font-weight: var(--font-weight-semibold);
32
+ line-height: var(--font-title-large-line-height);
33
+ color: var(--color-on-surface);
34
+ }
35
+
36
+ &__views {
37
+ flex-shrink: 0;
38
+ }
39
+ }
@@ -0,0 +1,5 @@
1
+ @forward 'agenda';
2
+ @forward 'calendar';
3
+ @forward 'calendar-event';
4
+ @forward 'month-view';
5
+ @forward 'time-grid';
@@ -0,0 +1,155 @@
1
+ @use '../../mixins' as mixins;
2
+
3
+ .tls-calendar-month-view {
4
+ // Lane geometry shared by the cell height and the bar overlay. The day-number reservation
5
+ // clears the cell's top padding plus today's circle, so bars never overlap the number.
6
+ --tls-calendar-day-number-height: var(--spacing-8);
7
+ --tls-calendar-bar-height: var(--spacing-6);
8
+ --tls-calendar-bar-gap: var(--spacing-1);
9
+ --tls-calendar-more-height: var(--spacing-5);
10
+
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: var(--spacing-2);
14
+
15
+ &__weekdays {
16
+ display: grid;
17
+ grid-template-columns: repeat(7, 1fr);
18
+ }
19
+
20
+ &__weekday {
21
+ padding-block: var(--spacing-2);
22
+
23
+ font-size: var(--font-label-medium-size);
24
+ font-weight: var(--font-weight-medium);
25
+ text-align: center;
26
+ color: var(--color-on-surface-variant);
27
+ }
28
+
29
+ &__grid {
30
+ display: grid;
31
+ // Reserve room for the day number, every visible lane (plus the gaps between them), and
32
+ // the "+N more" affordance.
33
+ grid-auto-rows: minmax(
34
+ calc(
35
+ var(--tls-calendar-day-number-height) + var(--tls-calendar-max-lanes, 3) *
36
+ var(--tls-calendar-bar-height) + (var(--tls-calendar-max-lanes, 3) - 1) *
37
+ var(--tls-calendar-bar-gap) + var(--tls-calendar-more-height)
38
+ ),
39
+ 1fr
40
+ );
41
+
42
+ // Collapsed borders: the grid draws the top/start edge, each cell the bottom/end edge,
43
+ // so shared borders never double up and there are no gaps between cells.
44
+ border-block-start: 1px solid var(--color-outline-variant);
45
+ border-inline-start: 1px solid var(--color-outline-variant);
46
+ }
47
+
48
+ &__week {
49
+ position: relative;
50
+
51
+ display: grid;
52
+ grid-template-columns: repeat(7, 1fr);
53
+ }
54
+
55
+ &__day {
56
+ min-width: 0;
57
+
58
+ padding: var(--spacing-1) var(--spacing-2);
59
+
60
+ display: flex;
61
+ flex-direction: column;
62
+
63
+ border-block-end: 1px solid var(--color-outline-variant);
64
+ border-inline-end: 1px solid var(--color-outline-variant);
65
+
66
+ background-color: var(--color-surface-container-lowest);
67
+
68
+ color: var(--color-on-surface);
69
+
70
+ cursor: pointer;
71
+
72
+ @include mixins.motion(essential) {
73
+ transition: background-color var(--motion-fast) var(--motion-ease-in-out);
74
+ }
75
+
76
+ &:hover {
77
+ background-color: var(--color-surface-container-low);
78
+ }
79
+
80
+ &:focus-visible {
81
+ @include mixins.focus-ring;
82
+ }
83
+
84
+ &--outside {
85
+ background-color: var(--color-surface-container);
86
+
87
+ color: var(--color-on-surface-variant);
88
+ }
89
+
90
+ &--today {
91
+ .tls-calendar-month-view__day-number {
92
+ display: inline-flex;
93
+ align-items: center;
94
+ justify-content: center;
95
+
96
+ width: var(--spacing-6);
97
+ height: var(--spacing-6);
98
+
99
+ border-radius: 50%;
100
+
101
+ background-color: var(--color-primary);
102
+
103
+ color: var(--color-on-primary);
104
+ }
105
+ }
106
+ }
107
+
108
+ &__day-number {
109
+ align-self: flex-end;
110
+
111
+ font-size: var(--font-label-small-size);
112
+ font-weight: var(--font-weight-medium);
113
+ }
114
+
115
+ &__more {
116
+ margin-block-start: auto;
117
+
118
+ font-size: var(--font-label-small-size);
119
+ color: var(--color-on-surface-variant);
120
+ }
121
+
122
+ &__bars {
123
+ position: absolute;
124
+ inset-block: var(--tls-calendar-day-number-height) var(--tls-calendar-more-height);
125
+ inset-inline: 0;
126
+
127
+ display: grid;
128
+ grid-template-columns: repeat(7, 1fr);
129
+ grid-auto-rows: var(--tls-calendar-bar-height);
130
+ // Gaps between lanes (rows) and neighbouring events (columns). A spanning bar absorbs the
131
+ // column gaps inside its span, so it stays continuous.
132
+ gap: var(--tls-calendar-bar-gap);
133
+
134
+ // Small inset so the outer bars don't sit flush against the grid's outer border.
135
+ padding-inline: var(--tls-calendar-bar-gap);
136
+
137
+ pointer-events: none;
138
+ }
139
+
140
+ &__bar {
141
+ min-width: 0;
142
+
143
+ pointer-events: auto;
144
+
145
+ &--continues-before .tls-calendar-event__button {
146
+ border-start-start-radius: 0;
147
+ border-end-start-radius: 0;
148
+ }
149
+
150
+ &--continues-after .tls-calendar-event__button {
151
+ border-start-end-radius: 0;
152
+ border-end-end-radius: 0;
153
+ }
154
+ }
155
+ }
@@ -0,0 +1,124 @@
1
+ @use '../../mixins' as mixins;
2
+
3
+ .tls-calendar-time-grid {
4
+ --tls-calendar-gutter: var(--spacing-16);
5
+
6
+ display: block;
7
+
8
+ &__header,
9
+ &__all-day,
10
+ &__body {
11
+ display: grid;
12
+ grid-template-columns: var(--tls-calendar-gutter) repeat(var(--tls-calendar-columns), minmax(0, 1fr));
13
+ }
14
+
15
+ &__header {
16
+ border-block-end: 1px solid var(--color-outline-variant);
17
+ }
18
+
19
+ &__heading {
20
+ width: 100%;
21
+
22
+ padding: var(--spacing-2);
23
+
24
+ border: none;
25
+
26
+ background-color: transparent;
27
+
28
+ font-size: var(--font-label-medium-size);
29
+ font-weight: var(--font-weight-medium);
30
+ text-align: center;
31
+ color: var(--color-on-surface-variant);
32
+
33
+ cursor: pointer;
34
+
35
+ &:focus-visible {
36
+ @include mixins.focus-ring;
37
+ }
38
+
39
+ &--today {
40
+ color: var(--color-primary);
41
+ }
42
+ }
43
+
44
+ &__all-day {
45
+ border-block-end: 1px solid var(--color-outline-variant);
46
+ }
47
+
48
+ &__gutter-label {
49
+ padding: var(--spacing-2);
50
+
51
+ font-size: var(--font-label-small-size);
52
+ text-align: end;
53
+ color: var(--color-on-surface-variant);
54
+ }
55
+
56
+ &__all-day-cell {
57
+ padding: var(--spacing-1);
58
+
59
+ display: flex;
60
+ flex-direction: column;
61
+ gap: var(--spacing-1);
62
+
63
+ border-inline-start: 1px solid var(--color-outline-variant);
64
+ }
65
+
66
+ &__gutter {
67
+ display: flex;
68
+ flex-direction: column;
69
+ }
70
+
71
+ // Labels keep their default top alignment, so each sits just under its hour line and the
72
+ // first ("12 AM") stays clear of the all-day row above. `border-box` keeps the top padding
73
+ // inside the hour height so rows stay aligned with the columns.
74
+ &__hour-label {
75
+ box-sizing: border-box;
76
+ height: var(--tls-calendar-hour-height);
77
+
78
+ padding-block-start: var(--spacing-1);
79
+ padding-inline-end: var(--spacing-2);
80
+
81
+ font-size: var(--font-label-small-size);
82
+ text-align: end;
83
+ color: var(--color-on-surface-variant);
84
+ }
85
+
86
+ &__column {
87
+ position: relative;
88
+
89
+ border-inline-start: 1px solid var(--color-outline-variant);
90
+
91
+ &--today {
92
+ background-color: var(--color-surface-container-low);
93
+ }
94
+ }
95
+
96
+ &__hour-line {
97
+ // Keep the top border inside the height so rows stay exactly one hour tall and the lines
98
+ // line up with the gutter's hour labels.
99
+ box-sizing: border-box;
100
+ height: var(--tls-calendar-hour-height);
101
+
102
+ border-block-start: 1px solid var(--color-outline-variant);
103
+ }
104
+
105
+ &__event {
106
+ // `border-box` keeps the inline top/height/width from the template accurate once padded.
107
+ box-sizing: border-box;
108
+ position: absolute;
109
+
110
+ padding: 2px;
111
+
112
+ z-index: 1;
113
+ }
114
+
115
+ &__now {
116
+ position: absolute;
117
+ inset-inline: 0;
118
+ z-index: 2;
119
+
120
+ height: 0;
121
+
122
+ border-block-start: 2px solid var(--color-primary);
123
+ }
124
+ }
@@ -1,7 +1,7 @@
1
1
  @use 'mixins' as picker-mixins;
2
2
  @use '../../mixins' as mixins;
3
3
 
4
- .tls-calendar {
4
+ .tls-date-picker-calendar {
5
5
  display: block;
6
6
  width: fit-content;
7
7
 
@@ -1,4 +1,4 @@
1
- @forward 'calendar';
1
+ @forward 'date-picker-calendar';
2
2
  @forward 'date-time-picker';
3
3
  @forward 'month-picker';
4
4
  @forward 'time-picker';
@@ -1,5 +1,6 @@
1
1
  @forward 'alert';
2
2
  @forward 'button';
3
+ @forward 'calendar';
3
4
  @forward 'chart';
4
5
  @forward 'chip';
5
6
  @forward 'date-time-picker';
@@ -1,2 +1,4 @@
1
1
  @forward 'tabs';
2
2
  @forward 'tabs-variant';
3
+ @forward 'tabs-orientation';
4
+ @forward 'tabs-header-position';
@@ -0,0 +1,83 @@
1
+ .tls-tabs {
2
+ &.tls-tabs--header-end {
3
+ .tls-tabs-header {
4
+ order: 1;
5
+ }
6
+
7
+ .tls-tabs-content {
8
+ order: 0;
9
+ }
10
+ }
11
+
12
+ // Horizontal: divider faces the content, so it moves from the header's
13
+ // bottom edge to its top edge once the header trails the content.
14
+ &.tls-tabs--horizontal.tls-tabs--header-end {
15
+ &.tls-tabs--flat .tls-tabs-header {
16
+ border-bottom-width: 0;
17
+ border-top-width: var(--tls-tabs-border-width);
18
+ border-top-style: solid;
19
+
20
+ &__item {
21
+ margin-bottom: 0;
22
+ margin-top: -1px;
23
+
24
+ border-bottom-width: 0;
25
+ border-top-width: var(--tls-tabs-active-border-width);
26
+ border-top-style: solid;
27
+
28
+ // See the flat variant's own hover rule for why this is needed:
29
+ // it keeps the divider line visible under the hover fill.
30
+ &:hover:not(.tls-tabs-header__item--active) {
31
+ border-top-color: var(--tls-tabs-border-color);
32
+ }
33
+ }
34
+ }
35
+
36
+ &.tls-tabs--outlined .tls-tabs-header {
37
+ border-bottom-width: 0;
38
+ border-top-width: var(--tls-tabs-border-width);
39
+ border-top-style: solid;
40
+
41
+ &__item {
42
+ margin-bottom: 0;
43
+ margin-top: -1px;
44
+ }
45
+ }
46
+ }
47
+
48
+ // Vertical: divider faces the content, so it moves from the header's
49
+ // inline-end edge to its inline-start edge once the header trails the content.
50
+ &.tls-tabs--vertical.tls-tabs--header-end {
51
+ &.tls-tabs--flat .tls-tabs-header {
52
+ border-inline-end-width: 0;
53
+ border-inline-start-width: var(--tls-tabs-border-width);
54
+ border-inline-start-style: solid;
55
+
56
+ &__item {
57
+ margin-inline-end: 0;
58
+ margin-inline-start: -1px;
59
+
60
+ border-inline-end-width: 0;
61
+ border-inline-start-width: var(--tls-tabs-active-border-width);
62
+ border-inline-start-style: solid;
63
+
64
+ // See the flat variant's own hover rule for why this is needed:
65
+ // it keeps the divider line visible under the hover fill.
66
+ &:hover:not(.tls-tabs-header__item--active) {
67
+ border-inline-start-color: var(--tls-tabs-border-color);
68
+ }
69
+ }
70
+ }
71
+
72
+ &.tls-tabs--outlined .tls-tabs-header {
73
+ border-inline-end-width: 0;
74
+ border-inline-start-width: var(--tls-tabs-border-width);
75
+ border-inline-start-style: solid;
76
+
77
+ &__item {
78
+ margin-inline-end: 0;
79
+ margin-inline-start: -1px;
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,66 @@
1
+ .tls-tabs {
2
+ // Vertical
3
+ &.tls-tabs--vertical {
4
+ display: flex;
5
+ flex-direction: row;
6
+
7
+ .tls-tabs-header {
8
+ flex-direction: column;
9
+
10
+ border-color: var(--tls-tabs-border-color);
11
+ }
12
+
13
+ .tls-tabs-content {
14
+ flex-grow: 1;
15
+ }
16
+
17
+ // Flat
18
+ &.tls-tabs--flat {
19
+ .tls-tabs-header {
20
+ border-bottom-width: 0;
21
+ border-inline-end-width: var(--tls-tabs-border-width);
22
+ border-inline-end-style: solid;
23
+
24
+ &__item {
25
+ margin-bottom: 0;
26
+ margin-inline-end: -1px;
27
+
28
+ border-bottom-width: 0;
29
+ border-inline-end-width: var(--tls-tabs-active-border-width);
30
+ border-inline-end-style: solid;
31
+
32
+ // See the flat variant's own hover rule for why this is needed:
33
+ // it keeps the divider line visible under the hover fill.
34
+ &:hover:not(.tls-tabs-header__item--active) {
35
+ border-inline-end-color: var(--tls-tabs-border-color);
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ // Outlined
42
+ &.tls-tabs--outlined {
43
+ .tls-tabs-header {
44
+ border-bottom-width: 0;
45
+ border-inline-end-width: var(--tls-tabs-border-width);
46
+ border-inline-end-style: solid;
47
+
48
+ &__item {
49
+ margin-bottom: 0;
50
+ margin-inline-end: -1px;
51
+
52
+ border-inline-start-width: 0;
53
+ border-inline-end-width: 0;
54
+ border-block-start-width: var(--tls-tabs-active-border-width);
55
+ border-block-end-width: var(--tls-tabs-active-border-width);
56
+ border-style: solid;
57
+
58
+ &:first-child {
59
+ border-inline-start-width: 0;
60
+ border-block-start-width: 0;
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
@@ -8,15 +8,27 @@
8
8
  &__item {
9
9
  margin-bottom: -1px;
10
10
 
11
+ // Border is always reserved at the active width and toggles only
12
+ // border-color (transparent to active) so switching tabs never
13
+ // changes the item's box height and shifts the label.
14
+ border-bottom-width: var(--tls-tabs-active-border-width);
15
+ border-bottom-style: solid;
16
+
17
+ // Hover fill sits on the item, not the button, so it paints under
18
+ // the item's border and reaches the divider line instead of
19
+ // stopping short and leaving a gap.
11
20
  &:hover {
12
- .tls-tabs-header__item-button {
13
- background-color: var(--color-surface-container);
14
- }
15
- }
21
+ background-color: var(--color-surface-container);
16
22
 
17
- &.tls-tabs-header__item--active {
18
- border-bottom-width: var(--tls-tabs-active-border-width);
19
- border-bottom-style: solid;
23
+ // The item's border overlaps the header's divider line by
24
+ // `--tls-tabs-border-width` (see `margin-bottom: -1px` above).
25
+ // Made opaque only while hovering, it paints over the hover
26
+ // fill and keeps that shared pixel visible instead of the
27
+ // fill covering it. The active item already has an opaque
28
+ // border, so it's excluded here.
29
+ &:not(.tls-tabs-header__item--active) {
30
+ border-bottom-color: var(--tls-tabs-border-color);
31
+ }
20
32
  }
21
33
  }
22
34
  }
@@ -11,11 +11,11 @@
11
11
 
12
12
  background: var(--tls-tabs-background-color);
13
13
 
14
- display: block;
14
+ display: flex;
15
+ flex-direction: column;
15
16
 
16
- transition:
17
- border-color var(--motion-theme),
18
- background-color var(--motion-theme);
17
+ transition: border-color var(--motion-theme),
18
+ background-color var(--motion-theme);
19
19
 
20
20
  overflow: clip;
21
21
 
@@ -25,14 +25,15 @@
25
25
  border-color: var(--tls-tabs-border-color);
26
26
 
27
27
  &__item {
28
+ display: flex;
29
+
28
30
  color: var(--tls-tabs-label-color);
29
31
 
30
32
  border-color: transparent;
31
33
 
32
- transition:
33
- color var(--motion-fast),
34
- border-color var(--motion-fast),
35
- background-color var(--motion-theme);
34
+ transition: color var(--motion-fast),
35
+ border-color var(--motion-fast),
36
+ background-color var(--motion-theme);
36
37
 
37
38
  &:has(&-link:hover, &-link:focus) {
38
39
  background-color: var(--color-grey-95);
@@ -57,7 +58,7 @@
57
58
  // TODO: use mixin
58
59
  font-size: var(--font-label-large-size);
59
60
  font-weight: var(--font-label-large-weight);
60
- line-height: var(--font-label-large-border-height);
61
+ line-height: var(--font-label-large-line-height);
61
62
  letter-spacing: var(--font-label-large-letter-spacing);
62
63
 
63
64
  cursor: pointer;