@thalassic/themes 22.17.4 → 22.17.5

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.17.4",
3
+ "version": "22.17.5",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^22.0.0",
@@ -5,4 +5,12 @@
5
5
  --radius-xl: 16px;
6
6
  --radius-2xl: 20px;
7
7
  --radius-3xl: 24px;
8
+
9
+ // Continuous corner curvature: the corner hugs the box instead of cutting a
10
+ // quarter-circle out of it, so a control reads as a soft square rather than a
11
+ // rounded rectangle. Because the curve stays closer to the corner, it needs a
12
+ // larger radius than a circular corner of the same visual weight — pair it
13
+ // with a value one step up the scale. Browsers without `corner-shape` drop the
14
+ // declaration and fall back to a circular corner.
15
+ --corner-shape-squircle: superellipse(2.5);
8
16
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  .tls-menu {
4
4
  --tls-menu-min-width: 160px;
5
+ --tls-menu-max-width: 320px;
5
6
  --tls-menu-padding-block: var(--spacing-1);
6
7
 
7
8
  --tls-menu-border-radius: var(--radius-md);
@@ -17,6 +18,7 @@
17
18
  --tls-menu-item-padding-block: var(--spacing-2);
18
19
  --tls-menu-item-padding-inline: var(--spacing-4);
19
20
  --tls-menu-item-icon-size: 14px;
21
+ --tls-menu-item-check-size: 14px;
20
22
 
21
23
  --tls-menu-label-color: var(--color-outline);
22
24
  --tls-menu-label-padding-block: var(--spacing-2);
@@ -26,6 +28,7 @@
26
28
  --tls-menu-divider-margin-block: var(--spacing-1);
27
29
 
28
30
  min-width: var(--tls-menu-min-width);
31
+ max-width: var(--tls-menu-max-width);
29
32
  padding-block: var(--tls-menu-padding-block);
30
33
 
31
34
  background-color: var(--tls-menu-background);
@@ -80,6 +83,23 @@
80
83
  }
81
84
  }
82
85
 
86
+ // Leading indicator of a checkable (radio / checkbox) item. Always rendered for
87
+ // such items so the label doesn't shift when the checkmark appears.
88
+ &__item-check {
89
+ width: var(--tls-menu-item-check-size);
90
+ height: var(--tls-menu-item-check-size);
91
+
92
+ display: flex;
93
+ flex-shrink: 0;
94
+ align-items: center;
95
+ justify-content: center;
96
+
97
+ .tls-icon {
98
+ width: 100%;
99
+ height: 100%;
100
+ }
101
+ }
102
+
83
103
  &__item-icon {
84
104
  flex-shrink: 0;
85
105
 
@@ -96,23 +116,35 @@
96
116
  }
97
117
  }
98
118
 
99
- &__item-label {
119
+ &__item-text {
120
+ min-width: 0;
121
+
100
122
  flex: 1;
123
+ display: flex;
124
+ flex-direction: column;
101
125
  }
102
126
 
103
- &__item-shortcut {
104
- margin-inline-start: auto;
105
- color: var(--tls-menu-label-color);
127
+ // Labels keep the item's nowrap and truncate at the menu's max-width instead of widening it.
128
+ &__item-label {
129
+ overflow: hidden;
130
+ text-overflow: ellipsis;
131
+ }
106
132
 
133
+ &__item-description {
107
134
  font-size: var(--font-label-small-size);
108
135
  font-weight: var(--font-label-small-weight);
109
136
  line-height: var(--font-label-small-line-height);
110
137
  letter-spacing: var(--font-label-small-letter-spacing);
138
+ white-space: normal;
139
+ color: var(--tls-menu-label-color);
140
+ }
111
141
 
112
- font-family: inherit;
113
- background: none;
114
- border: none;
115
- padding: 0;
142
+ &__item-shortcut {
143
+ margin-inline-start: auto;
144
+
145
+ display: inline-flex;
146
+ align-items: center;
147
+ gap: var(--spacing-1);
116
148
  }
117
149
 
118
150
  &__label {
@@ -2,9 +2,4 @@
2
2
 
3
3
  .tls-button {
4
4
  @include mixins.color-variants('tls-button', $tonal: true);
5
-
6
- &.tls-button--disabled {
7
- --tls-button-on-color: var(--color-on-surface-variant);
8
- --tls-button-color: var(--color-surface-variant);
9
- }
10
5
  }
@@ -16,10 +16,6 @@
16
16
  padding-inline: 0;
17
17
 
18
18
  aspect-ratio: 1 / 1;
19
-
20
- &.tls-button--rounded {
21
- --tls-button-border-radius: 50%;
22
- }
23
19
  }
24
20
 
25
21
  &.tls-button--fluid {
@@ -30,41 +26,38 @@
30
26
  --tls-button-height: var(--control-height-sm);
31
27
  --tls-button-padding-inline: var(--spacing-3);
32
28
 
29
+ --tls-button-radius-round: var(--radius-md);
30
+ --tls-button-radius-squircle: var(--radius-lg);
31
+
33
32
  --tls-button-font-size: var(--font-label-small-size);
34
33
  --tls-button-font-weight: var(--font-label-small-weight);
35
34
  --tls-button-line-height: var(--font-label-small-line-height);
36
35
  --tls-button-letter-spacing: var(--font-label-small-letter-spacing);
37
-
38
- &.tls-button--rounded {
39
- --tls-button-border-radius: var(--radius-xl);
40
- }
41
36
  }
42
37
 
43
38
  &.tls-button--md {
44
39
  --tls-button-height: var(--control-height-md);
45
40
  --tls-button-padding-inline: var(--spacing-4);
46
41
 
42
+ --tls-button-radius-round: var(--radius-lg);
43
+ --tls-button-radius-squircle: var(--radius-xl);
44
+
47
45
  --tls-button-font-size: var(--font-label-medium-size);
48
46
  --tls-button-font-weight: var(--font-label-medium-weight);
49
47
  --tls-button-line-height: var(--font-label-medium-line-height);
50
48
  --tls-button-letter-spacing: var(--font-label-medium-letter-spacing);
51
-
52
- &.tls-button--rounded {
53
- --tls-button-border-radius: var(--radius-2xl);
54
- }
55
49
  }
56
50
 
57
51
  &.tls-button--lg {
58
52
  --tls-button-height: var(--control-height-lg);
59
53
  --tls-button-padding-inline: var(--spacing-5);
60
54
 
55
+ --tls-button-radius-round: var(--radius-xl);
56
+ --tls-button-radius-squircle: var(--radius-2xl);
57
+
61
58
  --tls-button-font-size: var(--font-label-large-size);
62
59
  --tls-button-font-weight: var(--font-label-large-weight);
63
60
  --tls-button-line-height: var(--font-label-large-line-height);
64
61
  --tls-button-letter-spacing: var(--font-label-large-letter-spacing);
65
-
66
- &.tls-button--rounded {
67
- --tls-button-border-radius: var(--radius-3xl);
68
- }
69
62
  }
70
63
  }
@@ -22,13 +22,16 @@
22
22
  @include mixins.variant-treatment(elevated, 'tls-button');
23
23
  }
24
24
 
25
+ // Unavailability overrides the treatment entirely: every variant collapses to
26
+ // the same neutral container, so the state reads identically wherever it
27
+ // appears rather than asking the reader to recognise five faded silhouettes.
25
28
  &--disabled {
26
- border-color: var(--color-outline);
29
+ border-color: transparent;
27
30
 
28
- background-color: var(--tls-button-color);
31
+ background-color: var(--tls-button-disabled-color);
29
32
  box-shadow: none;
30
33
 
31
- color: var(--tls-button-on-color);
34
+ color: var(--tls-button-disabled-on-color);
32
35
 
33
36
  cursor: not-allowed;
34
37
  }
@@ -2,7 +2,15 @@
2
2
 
3
3
  .tls-button {
4
4
  --tls-button-border-width: 1px;
5
- --tls-button-border-radius: var(--radius-sm);
5
+
6
+ // Unavailability is signalled by dropping the accent for a neutral pair, which
7
+ // keeps the label at full contrast instead of fading it below legibility.
8
+ --tls-button-disabled-color: var(--color-surface-variant);
9
+ --tls-button-disabled-on-color: var(--color-on-surface-variant);
10
+
11
+ // Each size carries a radius per corner shape: the continuous curve needs the
12
+ // larger of the two to read with the same weight as the circular fallback.
13
+ --tls-button-border-radius: var(--tls-button-radius-round);
6
14
 
7
15
  position: relative;
8
16
  z-index: 1;
@@ -16,6 +24,7 @@
16
24
 
17
25
  border: var(--tls-button-border-width) solid transparent;
18
26
  border-radius: var(--tls-button-border-radius);
27
+ corner-shape: var(--corner-shape-squircle);
19
28
 
20
29
  background-color: var(--color-surface);
21
30
 
@@ -28,9 +37,21 @@
28
37
  box-shadow var(--motion-fast) var(--motion-ease-in-out),
29
38
  color var(--motion-fast) var(--motion-ease-in-out);
30
39
 
40
+ @supports (corner-shape: squircle) {
41
+ --tls-button-border-radius: var(--tls-button-radius-squircle);
42
+ }
43
+
31
44
  &:focus-visible {
32
45
  @include mixins.focus-ring;
33
46
  }
34
47
 
48
+ // A pill has no corner left to shape — the arc spans the whole edge, which a
49
+ // superellipse would flatten back towards a rectangle.
50
+ &--rounded {
51
+ --tls-button-border-radius: calc(var(--tls-button-height) / 2);
52
+
53
+ corner-shape: round;
54
+ }
55
+
35
56
  @include mixins.touch-target(var(--tls-button-height));
36
57
  }