@masterteam/components 0.0.250 → 0.0.252

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.
@@ -1,331 +1,265 @@
1
- /* ==========================================================================
2
- Tabs — transcribed from DS `Tabs/Tabs.module.css` (Figma node 4747:83313)
3
- --------------------------------------------------------------------------
4
- Horizontal (small): 36px tall · 8px/12px padding [DS Medium is 44/12/16;
5
- small is used as the default - this product is denser
6
- than the DS reference layouts] · 3px bottom bar #1849A9
7
- list divider 3px #D2D6DB · text always 14px
8
- weight 500 unselected → 700 selected · colour #000B36
9
- hover bg #E5E7EB · pressed #D2D6DB · disabled #6C7C96
10
- Vertical (medium): 44px tall · 12px padding · 3px pill-rounded left bar
11
- weight 400 unselected → 600 selected
12
-
13
- Two targets, because the library has two tab implementations: `mt-tabs`
14
- (hand-rolled with Tailwind utilities) and PrimeNG `p-tabs`. Unlayered rules
15
- outrank both `@layer utilities` and `@layer primeng`, so neither needs a
16
- template change.
17
- ========================================================================== */
18
-
19
- /* ══ mt-tabs — underline (horizontal) mode ══════════════════════════════ */
20
- /* Transcribed from the real .htab rules, not the summary at the top of the DS
21
- module - that comment claims 36/44/52 per size, but every .htabSmall /
22
- Medium / Large block is identical: 52px tall, 16px padding, 14/20 text.
23
-
24
- The active indicator is NOT a bottom border. It is a 3px pill inset 16px
25
- from each inline edge, so it sits under the label rather than spanning the
26
- full tab - which is why a border-bottom never looked right. Hover paints
27
- the same bar in #1F2A37. */
28
-
29
- html.mt-ds mt-tabs [role="tablist"][aria-orientation="horizontal"] > div {
30
- border-bottom: 3px solid #d2d6db;
31
- gap: 0;
32
- }
33
-
34
- html.mt-ds
35
- mt-tabs
36
- [role="tablist"][aria-orientation="horizontal"]
37
- [role="tab"] {
38
- position: relative;
39
- height: 52px;
40
- padding: 16px;
41
- gap: 8px;
42
- margin-bottom: 0;
43
- border: none;
44
- border-radius: 4px;
45
- font-family: var(--ds-font-sans);
46
- font-size: 14px;
47
- font-weight: 500;
48
- line-height: 20px;
49
- color: #000b36;
50
- transition: background-color var(--ds-transition-fast);
51
- }
52
-
53
- html.mt-ds
54
- mt-tabs
55
- [role="tablist"][aria-orientation="horizontal"]
56
- [role="tab"]::after {
57
- content: "";
58
- position: absolute;
59
- bottom: 0;
60
- inset-inline: 16px;
61
- height: 3px;
62
- border-radius: 9999px;
63
- background: transparent;
64
- transition: background-color var(--ds-transition-fast);
65
- }
66
-
67
- html.mt-ds
68
- mt-tabs
69
- [role="tablist"][aria-orientation="horizontal"]
70
- [role="tab"]:not([aria-selected="true"], :disabled):hover {
71
- background: #e5e7eb;
72
- color: #000b36;
73
- }
74
-
75
- html.mt-ds
76
- mt-tabs
77
- [role="tablist"][aria-orientation="horizontal"]
78
- [role="tab"]:not([aria-selected="true"], :disabled):hover::after {
79
- background: #1f2a37;
80
- }
81
-
82
- html.mt-ds
83
- mt-tabs
84
- [role="tablist"][aria-orientation="horizontal"]
85
- [role="tab"]:not([aria-selected="true"], :disabled):active {
86
- background: #d2d6db;
87
- }
88
-
89
- html.mt-ds
90
- mt-tabs
91
- [role="tablist"][aria-orientation="horizontal"]
92
- [role="tab"][aria-selected="true"] {
93
- background: transparent;
94
- color: #000b36;
95
- font-weight: 700;
96
- }
97
-
98
- html.mt-ds
99
- mt-tabs
100
- [role="tablist"][aria-orientation="horizontal"]
101
- [role="tab"][aria-selected="true"]::after {
102
- background: #1849a9;
103
- }
104
-
105
- html.mt-ds
106
- mt-tabs
107
- [role="tablist"][aria-orientation="horizontal"]
108
- [role="tab"]:disabled {
109
- color: #6c7c96;
110
- background: transparent;
111
- opacity: 1;
112
- }
113
-
114
- html.mt-ds
115
- mt-tabs
116
- [role="tablist"][aria-orientation="horizontal"]
117
- [role="tab"][aria-selected="true"]:disabled::after {
118
- background: #6c7c96;
119
- }
120
-
121
- /* ══ mt-tabs — vertical mode ════════════════════════════════════════════ */
122
-
123
- html.mt-ds mt-tabs [role="tablist"][aria-orientation="vertical"] {
124
- width: 150px;
125
- gap: 0;
126
- padding: 0;
127
- border: none;
128
- border-radius: 0;
129
- background: transparent;
130
- }
131
-
132
- html.mt-ds mt-tabs [role="tablist"][aria-orientation="vertical"] [role="tab"] {
133
- position: relative;
134
- height: 36px;
135
- padding: 8px 12px;
136
- border-radius: 0;
137
- font-family: var(--ds-font-sans);
138
- font-size: 14px;
139
- font-weight: 400;
140
- color: #000b36;
141
- background: transparent;
142
- }
143
-
144
- html.mt-ds
145
- mt-tabs
146
- [role="tablist"][aria-orientation="vertical"]
147
- [role="tab"]::before {
148
- content: "";
149
- position: absolute;
150
- inset-inline-start: 0;
151
- inset-block: 0;
152
- width: 3px;
153
- border-radius: 9999px;
154
- background: transparent;
155
- transition: background-color var(--ds-transition-fast);
156
- }
157
-
158
- html.mt-ds
159
- mt-tabs
160
- [role="tablist"][aria-orientation="vertical"]
161
- [role="tab"]:not([aria-selected="true"], :disabled):hover {
162
- background: #e5e7eb;
163
- }
164
-
165
- html.mt-ds
166
- mt-tabs
167
- [role="tablist"][aria-orientation="vertical"]
168
- [role="tab"]:not([aria-selected="true"], :disabled):hover::before {
169
- background: #1f2a37;
170
- }
171
-
172
- html.mt-ds
173
- mt-tabs
174
- [role="tablist"][aria-orientation="vertical"]
175
- [role="tab"][aria-selected="true"] {
176
- background: transparent;
177
- color: #000b36;
178
- font-weight: 600;
179
- }
180
-
181
- html.mt-ds
182
- mt-tabs
183
- [role="tablist"][aria-orientation="vertical"]
184
- [role="tab"][aria-selected="true"]::before {
185
- background: #1849a9;
186
- }
187
-
188
- html.mt-ds
189
- mt-tabs
190
- [role="tablist"][aria-orientation="vertical"]
191
- [role="tab"][aria-selected="true"]:disabled::before {
192
- background: #d2d6db;
193
- }
194
-
195
- /* ── Shared: focus ring ────────────────────────────────────────────────── */
196
-
197
- html.mt-ds mt-tabs [role="tab"]:focus-visible {
198
- outline: 3px solid #1849a9;
199
- outline-offset: 2px;
200
- box-shadow: none;
201
- }
202
-
203
- /* ══ PrimeNG p-tabs ═════════════════════════════════════════════════════ */
204
-
205
- html.mt-ds .p-tablist {
206
- border-bottom: 3px solid #d2d6db;
207
- }
208
-
209
- html.mt-ds .p-tab {
210
- height: 44px;
211
- padding: 12px 16px;
212
- border-width: 0 0 3px 0;
213
- border-color: transparent;
214
- font-family: var(--ds-font-sans);
215
- font-size: 14px;
216
- font-weight: 500;
217
- color: #000b36;
218
- margin-bottom: -3px;
219
- }
220
-
221
- html.mt-ds .p-tab:not(.p-tab-active, .p-disabled):hover {
222
- background: #e5e7eb;
223
- color: #000b36;
224
- border-color: transparent;
225
- }
226
-
227
- html.mt-ds .p-tab-active {
228
- color: #000b36;
229
- font-weight: 700;
230
- border-color: #1849a9;
231
- }
232
-
233
- html.mt-ds .p-tablist-active-bar {
234
- height: 3px;
235
- bottom: -3px;
236
- background: #1849a9;
237
- }
238
-
239
- /* ══ mt-tabs default mode — render as DS Tabs, not a content switcher ═══ */
240
- /* mt-tabs with no mode set renders a p-selectbutton, so it was picking up the
241
- content-switcher look: a grey track with one solid blue filled segment. But
242
- callers use it as a tab strip, and a DS tab is an underline rather than a
243
- segmented control — so it read as the wrong component entirely, whatever its
244
- dimensions.
245
-
246
- Scoped to mt-tabs, so a bare p-selectbutton used as a genuine view toggle
247
- keeps the content-switcher treatment from content-switcher.css. */
248
-
249
- html.mt-ds mt-tabs .p-selectbutton {
250
- gap: 0;
251
- padding: 0;
252
- border: none;
253
- border-bottom: 3px solid #d2d6db;
254
- border-radius: 0;
255
- background: transparent;
256
- overflow: visible;
257
- }
258
-
259
- html.mt-ds mt-tabs .p-selectbutton .p-togglebutton {
260
- position: relative;
261
- height: 52px;
262
- min-width: 0;
263
- border: none;
264
- border-radius: 4px;
265
- background: transparent;
266
- color: #000b36;
267
- font-weight: 500;
268
- }
269
-
270
- /* No inter-item dividers on a tab strip - those belong to the switcher. */
271
- html.mt-ds mt-tabs .p-selectbutton .p-togglebutton + .p-togglebutton {
272
- border-inline-start: none;
273
- }
274
-
275
- html.mt-ds mt-tabs .p-selectbutton .p-togglebutton .p-togglebutton-content {
276
- gap: 8px;
277
- padding: 16px;
278
- background: transparent;
279
- color: inherit;
280
- font-size: 14px;
281
- font-weight: inherit;
282
- line-height: 20px;
283
- }
284
-
285
- html.mt-ds mt-tabs .p-selectbutton .p-togglebutton::after {
286
- content: "";
287
- position: absolute;
288
- bottom: 0;
289
- inset-inline: 16px;
290
- height: 3px;
291
- border-radius: 9999px;
292
- background: transparent;
293
- transition: background-color var(--ds-transition-fast);
294
- }
295
-
296
- html.mt-ds
297
- mt-tabs
298
- .p-selectbutton
299
- .p-togglebutton:not(.p-togglebutton-checked, .p-disabled):hover {
300
- background: #e5e7eb;
301
- color: #000b36;
302
- }
303
-
304
- html.mt-ds
305
- mt-tabs
306
- .p-selectbutton
307
- .p-togglebutton:not(.p-togglebutton-checked, .p-disabled):hover::after {
308
- background: #1f2a37;
309
- }
310
-
311
- html.mt-ds mt-tabs .p-selectbutton .p-togglebutton.p-togglebutton-checked {
312
- background: transparent;
313
- color: #000b36;
314
- font-weight: 700;
315
- }
316
-
317
- html.mt-ds
318
- mt-tabs
319
- .p-selectbutton
320
- .p-togglebutton.p-togglebutton-checked
321
- .p-togglebutton-content {
322
- background: transparent;
323
- color: #000b36;
324
- }
325
-
326
- html.mt-ds
327
- mt-tabs
328
- .p-selectbutton
329
- .p-togglebutton.p-togglebutton-checked::after {
330
- background: #1849a9;
331
- }
1
+ /* ==========================================================================
2
+ Tabs — transcribed from DS `Tabs/Tabs.module.css` (Figma node 4747:83313)
3
+ --------------------------------------------------------------------------
4
+ Horizontal (medium): 44px tall · 12px/16px padding · 3px bottom bar #1849A9
5
+ list divider 3px #D2D6DB · text always 14px
6
+ weight 500 unselected → 700 selected · colour #000B36
7
+ hover bg #E5E7EB · pressed #D2D6DB · disabled #6C7C96
8
+ Vertical (medium): 44px tall · 12px padding · 3×16px pill-rounded start bar
9
+ weight 400 unselected → 600 selected
10
+
11
+ Two targets, because the library has two tab implementations: `mt-tabs`
12
+ (hand-rolled with Tailwind utilities) and PrimeNG `p-tabs`. Unlayered rules
13
+ outrank both `@layer utilities` and `@layer primeng`, so neither needs a
14
+ template change.
15
+ ========================================================================== */
16
+
17
+ /* ══ mt-tabs — underline (horizontal) mode ══════════════════════════════ */
18
+ /* The product uses the DS medium line-tab geometry. The active indicator is
19
+ not a bottom border: it is a 3px pill inset 16px
20
+ from each inline edge, so it sits under the label rather than spanning the
21
+ full tab - which is why a border-bottom never looked right. Hover paints
22
+ the same bar in #1F2A37. */
23
+
24
+ html.mt-ds {
25
+ --ds-line-tab-height: calc(var(--ds-space-4xl) + var(--ds-space-lg));
26
+ --ds-tab-indicator-size: 3px;
27
+ }
28
+
29
+ html.mt-ds mt-tabs [role="tablist"][aria-orientation="horizontal"] {
30
+ align-items: stretch;
31
+ gap: 0;
32
+ min-height: var(--ds-line-tab-height);
33
+ box-shadow: inset 0 calc(-1 * var(--ds-tab-indicator-size)) 0 #d2d6db;
34
+ }
35
+
36
+ /* Keep the visible row and the overflow control on one baseline. This also
37
+ neutralises the utility padding/margin on the overflow wrapper, so the
38
+ divider is one continuous line rather than two independently positioned
39
+ borders. */
40
+ html.mt-ds mt-tabs [role="tablist"][aria-orientation="horizontal"] > div {
41
+ align-items: center;
42
+ align-self: stretch;
43
+ height: var(--ds-line-tab-height);
44
+ padding-block: 0;
45
+ margin-bottom: 0;
46
+ border-bottom: 0;
47
+ gap: 0;
48
+ }
49
+
50
+ html.mt-ds
51
+ mt-tabs
52
+ [role="tablist"][aria-orientation="horizontal"]
53
+ [role="tab"] {
54
+ position: relative;
55
+ height: var(--ds-line-tab-height);
56
+ padding: var(--ds-space-lg) var(--ds-space-xl);
57
+ gap: var(--ds-space-md);
58
+ margin-bottom: 0;
59
+ border: none;
60
+ border-radius: 4px;
61
+ font-family: var(--ds-font-sans);
62
+ font-size: 14px;
63
+ font-weight: 500;
64
+ line-height: 20px;
65
+ color: #000b36;
66
+ transition: background-color var(--ds-transition-fast);
67
+ }
68
+
69
+ html.mt-ds
70
+ mt-tabs
71
+ [role="tablist"][aria-orientation="horizontal"]
72
+ [role="tab"]::after {
73
+ content: "";
74
+ position: absolute;
75
+ bottom: 0;
76
+ inset-inline: var(--ds-space-xl);
77
+ height: var(--ds-tab-indicator-size);
78
+ border-radius: 9999px;
79
+ background: transparent;
80
+ transition: background-color var(--ds-transition-fast);
81
+ }
82
+
83
+ html.mt-ds
84
+ mt-tabs
85
+ [role="tablist"][aria-orientation="horizontal"]
86
+ [role="tab"]:not([aria-selected="true"], :disabled):hover {
87
+ background: #e5e7eb;
88
+ color: #000b36;
89
+ }
90
+
91
+ html.mt-ds
92
+ mt-tabs
93
+ [role="tablist"][aria-orientation="horizontal"]
94
+ [role="tab"]:not([aria-selected="true"], :disabled):hover::after {
95
+ background: #1f2a37;
96
+ }
97
+
98
+ html.mt-ds
99
+ mt-tabs
100
+ [role="tablist"][aria-orientation="horizontal"]
101
+ [role="tab"]:not([aria-selected="true"], :disabled):active {
102
+ background: #d2d6db;
103
+ }
104
+
105
+ html.mt-ds
106
+ mt-tabs
107
+ [role="tablist"][aria-orientation="horizontal"]
108
+ [role="tab"][aria-selected="true"] {
109
+ background: transparent;
110
+ color: #000b36;
111
+ font-weight: 700;
112
+ }
113
+
114
+ html.mt-ds
115
+ mt-tabs
116
+ [role="tablist"][aria-orientation="horizontal"]
117
+ [role="tab"][aria-selected="true"]::after {
118
+ background: #1849a9;
119
+ }
120
+
121
+ html.mt-ds
122
+ mt-tabs
123
+ [role="tablist"][aria-orientation="horizontal"]
124
+ [role="tab"]:disabled {
125
+ color: #6c7c96;
126
+ background: transparent;
127
+ opacity: 1;
128
+ }
129
+
130
+ html.mt-ds
131
+ mt-tabs
132
+ [role="tablist"][aria-orientation="horizontal"]
133
+ [role="tab"][aria-selected="true"]:disabled::after {
134
+ background: #6c7c96;
135
+ }
136
+
137
+ /* ══ mt-tabs — vertical mode ════════════════════════════════════════════ */
138
+
139
+ html.mt-ds mt-tabs [role="tablist"][aria-orientation="vertical"] {
140
+ width: 150px;
141
+ gap: 0;
142
+ padding: 0;
143
+ border: none;
144
+ border-radius: 0;
145
+ background: transparent;
146
+ }
147
+
148
+ html.mt-ds mt-tabs [role="tablist"][aria-orientation="vertical"] [role="tab"] {
149
+ position: relative;
150
+ height: var(--ds-line-tab-height);
151
+ padding: var(--ds-space-lg);
152
+ border-radius: 0;
153
+ font-family: var(--ds-font-sans);
154
+ font-size: 14px;
155
+ font-weight: 400;
156
+ color: #000b36;
157
+ background: transparent;
158
+ }
159
+
160
+ html.mt-ds
161
+ mt-tabs
162
+ [role="tablist"][aria-orientation="vertical"]
163
+ [role="tab"]::before {
164
+ content: "";
165
+ position: absolute;
166
+ inset-inline-start: 0;
167
+ top: 50%;
168
+ transform: translateY(-50%);
169
+ width: 3px;
170
+ height: calc(2 * var(--ds-space-md));
171
+ border-radius: 9999px;
172
+ background: transparent;
173
+ transition: background-color var(--ds-transition-fast);
174
+ }
175
+
176
+ html.mt-ds
177
+ mt-tabs
178
+ [role="tablist"][aria-orientation="vertical"]
179
+ [role="tab"]:not([aria-selected="true"], :disabled):hover {
180
+ background: #e5e7eb;
181
+ }
182
+
183
+ html.mt-ds
184
+ mt-tabs
185
+ [role="tablist"][aria-orientation="vertical"]
186
+ [role="tab"]:not([aria-selected="true"], :disabled):hover::before {
187
+ background: #1f2a37;
188
+ }
189
+
190
+ html.mt-ds
191
+ mt-tabs
192
+ [role="tablist"][aria-orientation="vertical"]
193
+ [role="tab"][aria-selected="true"] {
194
+ background: transparent;
195
+ color: #000b36;
196
+ font-weight: 600;
197
+ }
198
+
199
+ html.mt-ds
200
+ mt-tabs
201
+ [role="tablist"][aria-orientation="vertical"]
202
+ [role="tab"][aria-selected="true"]::before {
203
+ background: #1849a9;
204
+ }
205
+
206
+ html.mt-ds
207
+ mt-tabs
208
+ [role="tablist"][aria-orientation="vertical"]
209
+ [role="tab"][aria-selected="true"]:disabled::before {
210
+ background: #d2d6db;
211
+ }
212
+
213
+ /* ── Shared: focus ring ────────────────────────────────────────────────── */
214
+
215
+ html.mt-ds mt-tabs [role="tab"]:focus-visible {
216
+ z-index: 1;
217
+ outline: none;
218
+ box-shadow:
219
+ 0 0 0 2px var(--ds-focus-ring-color),
220
+ 0 0 0 5px var(--ds-focus-outline-color);
221
+ }
222
+
223
+ /* ══ PrimeNG p-tabs ═════════════════════════════════════════════════════ */
224
+
225
+ html.mt-ds .p-tablist {
226
+ border-bottom: var(--ds-tab-indicator-size) solid #d2d6db;
227
+ }
228
+
229
+ html.mt-ds .p-tab {
230
+ height: var(--ds-line-tab-height);
231
+ padding: var(--ds-space-lg) var(--ds-space-xl);
232
+ border-width: 0 0 var(--ds-tab-indicator-size) 0;
233
+ border-color: transparent;
234
+ font-family: var(--ds-font-sans);
235
+ font-size: 14px;
236
+ font-weight: 500;
237
+ color: #000b36;
238
+ margin-bottom: calc(-1 * var(--ds-tab-indicator-size));
239
+ }
240
+
241
+ html.mt-ds .p-tab:not(.p-tab-active, .p-disabled):hover {
242
+ background: #e5e7eb;
243
+ color: #000b36;
244
+ border-color: transparent;
245
+ }
246
+
247
+ html.mt-ds .p-tab-active {
248
+ color: #000b36;
249
+ font-weight: 700;
250
+ border-color: #1849a9;
251
+ }
252
+
253
+ html.mt-ds .p-tab:focus-visible {
254
+ z-index: 1;
255
+ outline: none;
256
+ box-shadow:
257
+ 0 0 0 2px var(--ds-focus-ring-color),
258
+ 0 0 0 5px var(--ds-focus-outline-color);
259
+ }
260
+
261
+ html.mt-ds .p-tablist-active-bar {
262
+ height: var(--ds-tab-indicator-size);
263
+ bottom: calc(-1 * var(--ds-tab-indicator-size));
264
+ background: #1849a9;
265
+ }