@kaizen/components 2.3.1 → 2.3.3
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/dist/cjs/src/TitleBlock/TitleBlock.cjs +1 -1
- package/dist/cjs/src/TitleBlock/TitleBlock.module.scss.cjs +1 -1
- package/dist/cjs/src/TitleBlock/subcomponents/Toolbar.module.scss.cjs +1 -3
- package/dist/esm/src/TitleBlock/TitleBlock.mjs +1 -1
- package/dist/esm/src/TitleBlock/TitleBlock.module.scss.mjs +1 -1
- package/dist/esm/src/TitleBlock/subcomponents/Toolbar.module.scss.mjs +1 -3
- package/dist/styles.css +142 -133
- package/package.json +1 -1
- package/src/Tabs/subcomponents/Tab/Tab.module.css +1 -1
- package/src/TitleBlock/TitleBlock.module.scss +127 -73
- package/src/TitleBlock/TitleBlock.tsx +4 -1
- package/src/TitleBlock/_docs/TitleBlock.stories.tsx +238 -4
- package/src/TitleBlock/_mixins.scss +29 -0
- package/src/TitleBlock/subcomponents/MainActions.module.scss +17 -24
- package/src/TitleBlock/subcomponents/Toolbar.module.scss +4 -36
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
@import './variables';
|
|
11
11
|
|
|
12
12
|
@layer kz-components {
|
|
13
|
-
$title-block-
|
|
13
|
+
$title-block-spacing-default: 20px;
|
|
14
|
+
$title-block-spacing-above-1080: 24px;
|
|
15
|
+
$title-block-gap-default: 12px;
|
|
14
16
|
$breadcrumb-circle-width: 48px;
|
|
15
17
|
$breadcrumb-breakpoint-width: $layout-content-max-width + $layout-content-side-margin * 2 +
|
|
16
18
|
$breadcrumb-circle-width * 2.25;
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
.titleRow {
|
|
54
|
+
box-sizing: border-box;
|
|
52
55
|
display: flex;
|
|
53
56
|
width: 100%;
|
|
54
57
|
justify-content: center;
|
|
@@ -58,10 +61,6 @@
|
|
|
58
61
|
display: flex;
|
|
59
62
|
width: 100%;
|
|
60
63
|
justify-content: center;
|
|
61
|
-
|
|
62
|
-
@include title-block-small {
|
|
63
|
-
height: $tab-container-height-small;
|
|
64
|
-
}
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
.lightVariant .titleRow {
|
|
@@ -75,15 +74,17 @@
|
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
%titleBlockInner {
|
|
77
|
+
box-sizing: border-box;
|
|
78
78
|
max-width: $layout-content-max-width;
|
|
79
|
-
margin: 0 $layout-content-side-margin;
|
|
80
79
|
display: flex;
|
|
81
80
|
flex-direction: column;
|
|
82
81
|
width: 100%;
|
|
83
82
|
min-width: 0; // this is an important trick to prevent flexbox items from overflowing
|
|
83
|
+
padding: 0 $title-block-spacing-default 0 0;
|
|
84
84
|
|
|
85
|
-
@include title-block-
|
|
86
|
-
|
|
85
|
+
@include title-block-min-media-1080 {
|
|
86
|
+
padding: 0;
|
|
87
|
+
margin-inline: $title-block-spacing-above-1080;
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
@@ -93,26 +94,30 @@
|
|
|
93
94
|
|
|
94
95
|
.lightVariant .titleRowInner {
|
|
95
96
|
border-bottom: 1px solid $color-gray-300;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
%rowBelowSeparatorInnerMarginOverride {
|
|
100
|
+
padding: 0 4px 0 12px;
|
|
96
101
|
|
|
97
|
-
@include title-block-
|
|
98
|
-
padding
|
|
102
|
+
@include title-block-min-media-1080 {
|
|
103
|
+
padding: 0;
|
|
104
|
+
margin-inline: $title-block-spacing-above-1080;
|
|
99
105
|
}
|
|
100
106
|
}
|
|
101
107
|
|
|
102
108
|
.rowBelowSeparatorInner {
|
|
103
109
|
@extend %titleBlockInner;
|
|
104
|
-
|
|
105
|
-
@include title-block-small {
|
|
106
|
-
height: $tab-container-height-small;
|
|
107
|
-
}
|
|
110
|
+
@extend %rowBelowSeparatorInnerMarginOverride;
|
|
108
111
|
}
|
|
109
112
|
|
|
110
113
|
.titleRowInnerContent {
|
|
114
|
+
box-sizing: border-box;
|
|
111
115
|
position: relative;
|
|
112
116
|
display: flex;
|
|
113
117
|
width: 100%;
|
|
114
118
|
align-items: center;
|
|
115
|
-
|
|
119
|
+
gap: $title-block-gap-default;
|
|
120
|
+
padding-block: $title-block-spacing-default 19px;
|
|
116
121
|
justify-content: space-between;
|
|
117
122
|
border-bottom: $title-block-separator-height solid rgba($color-white-rgb, 0.1);
|
|
118
123
|
|
|
@@ -130,16 +135,24 @@
|
|
|
130
135
|
border-bottom: none;
|
|
131
136
|
}
|
|
132
137
|
|
|
133
|
-
@include title-block-
|
|
138
|
+
@include title-block-under-576 {
|
|
134
139
|
flex-wrap: wrap;
|
|
140
|
+
gap: 4px;
|
|
135
141
|
}
|
|
136
142
|
}
|
|
137
143
|
|
|
138
144
|
.title {
|
|
139
|
-
display: flex;
|
|
140
145
|
align-items: center;
|
|
141
146
|
min-width: 0; // this is an important trick to prevent flexbox items from overflowing
|
|
142
147
|
|
|
148
|
+
// truncation
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
text-overflow: ellipsis;
|
|
151
|
+
display: -webkit-box;
|
|
152
|
+
line-clamp: 3;
|
|
153
|
+
-webkit-line-clamp: 3;
|
|
154
|
+
-webkit-box-orient: vertical;
|
|
155
|
+
|
|
143
156
|
// Applying width 100% when the title is *not* long and is followed by a subtitle
|
|
144
157
|
// causes misalignment of both.
|
|
145
158
|
@include title-block-under-1366 {
|
|
@@ -155,7 +168,7 @@
|
|
|
155
168
|
|
|
156
169
|
.hasSubtitle & {
|
|
157
170
|
@include title-block-under-1366 {
|
|
158
|
-
transform: translateY(-
|
|
171
|
+
transform: translateY(-12px);
|
|
159
172
|
}
|
|
160
173
|
}
|
|
161
174
|
}
|
|
@@ -204,34 +217,65 @@
|
|
|
204
217
|
}
|
|
205
218
|
|
|
206
219
|
.titleTextOverride.titleTextOverride {
|
|
207
|
-
|
|
220
|
+
font-size: $typography-heading-3-font-size;
|
|
221
|
+
line-height: $typography-heading-3-line-height;
|
|
222
|
+
letter-spacing: $typography-heading-3-letter-spacing;
|
|
223
|
+
margin: 8px 0;
|
|
208
224
|
|
|
209
|
-
|
|
225
|
+
.hasSubtitle & {
|
|
226
|
+
margin-bottom: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@include title-block-media-mixed-width {
|
|
210
230
|
font-size: $typography-heading-2-font-size;
|
|
211
231
|
line-height: $typography-heading-2-line-height;
|
|
212
232
|
letter-spacing: $typography-heading-2-letter-spacing;
|
|
213
|
-
|
|
233
|
+
margin: 2px 0;
|
|
234
|
+
|
|
235
|
+
.hasSubtitle & {
|
|
236
|
+
margin-bottom: 0;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@include title-block-min-container-1080 {
|
|
241
|
+
font-size: $typography-heading-2-font-size;
|
|
242
|
+
line-height: $typography-heading-2-line-height;
|
|
243
|
+
letter-spacing: $typography-heading-2-letter-spacing;
|
|
244
|
+
margin: 2px 0;
|
|
245
|
+
|
|
246
|
+
.hasSubtitle & {
|
|
247
|
+
margin-bottom: 0;
|
|
248
|
+
}
|
|
214
249
|
}
|
|
215
250
|
|
|
216
251
|
.hasLongTitle & {
|
|
217
|
-
@include title-block-
|
|
252
|
+
@include title-block-media-mixed-width {
|
|
218
253
|
font-size: $typography-heading-3-font-size;
|
|
219
254
|
line-height: $typography-heading-3-line-height;
|
|
220
255
|
letter-spacing: $typography-heading-3-letter-spacing;
|
|
221
|
-
|
|
256
|
+
margin: 2px 0;
|
|
257
|
+
|
|
258
|
+
.hasSubtitle & {
|
|
259
|
+
margin-bottom: 0;
|
|
260
|
+
}
|
|
222
261
|
}
|
|
223
|
-
}
|
|
224
262
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
263
|
+
@container (min-width: #{$layout-breakpoints-large}) and (max-width: 1365px) {
|
|
264
|
+
font-size: $typography-heading-3-font-size;
|
|
265
|
+
line-height: $typography-heading-3-line-height;
|
|
266
|
+
letter-spacing: $typography-heading-3-letter-spacing;
|
|
267
|
+
margin: 2px 0;
|
|
268
|
+
|
|
269
|
+
.hasSubtitle & {
|
|
270
|
+
margin-bottom: 0;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
230
273
|
}
|
|
231
274
|
}
|
|
232
275
|
|
|
233
276
|
.avatar {
|
|
234
277
|
display: none;
|
|
278
|
+
align-self: self-start;
|
|
235
279
|
box-sizing: border-box;
|
|
236
280
|
overflow: hidden;
|
|
237
281
|
height: $ca-grid * 2;
|
|
@@ -243,10 +287,6 @@
|
|
|
243
287
|
max-width: 100%;
|
|
244
288
|
}
|
|
245
289
|
|
|
246
|
-
@container (min-width: #{$layout-breakpoints-large}) {
|
|
247
|
-
display: block;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
290
|
&.withBorder {
|
|
251
291
|
border: 3px solid $color-white;
|
|
252
292
|
border-radius: 50%;
|
|
@@ -255,15 +295,22 @@
|
|
|
255
295
|
.hasLongTitle & {
|
|
256
296
|
display: none;
|
|
257
297
|
}
|
|
298
|
+
|
|
299
|
+
@include title-block-media-mixed-width {
|
|
300
|
+
display: block;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@include title-block-min-container-1080 {
|
|
304
|
+
display: block;
|
|
305
|
+
}
|
|
258
306
|
}
|
|
259
307
|
|
|
260
308
|
.hamburger {
|
|
261
|
-
display:
|
|
262
|
-
|
|
263
|
-
@include ca-margin($end: $spacing-xs);
|
|
309
|
+
display: flex;
|
|
310
|
+
align-self: self-start;
|
|
264
311
|
|
|
265
|
-
@include title-block-
|
|
266
|
-
display:
|
|
312
|
+
@include title-block-min-media-1080 {
|
|
313
|
+
display: none;
|
|
267
314
|
}
|
|
268
315
|
}
|
|
269
316
|
|
|
@@ -312,17 +359,32 @@
|
|
|
312
359
|
.sectionTitleContainer {
|
|
313
360
|
display: flex;
|
|
314
361
|
align-items: center;
|
|
315
|
-
padding:
|
|
362
|
+
padding-block: 9px;
|
|
363
|
+
padding-inline-end: 8px; // 20 take 12 result in 8 extra padding needed in section versus tabs UI
|
|
364
|
+
|
|
365
|
+
@include title-block-min-container-1080 {
|
|
366
|
+
padding-block: 17px;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.sectionTitle {
|
|
371
|
+
display: block;
|
|
316
372
|
}
|
|
317
373
|
|
|
318
374
|
.sectionTitleInner {
|
|
319
375
|
display: flex;
|
|
320
376
|
flex-direction: column;
|
|
377
|
+
row-gap: 4px;
|
|
378
|
+
|
|
379
|
+
@include title-block-min-container-1080 {
|
|
380
|
+
flex-direction: row;
|
|
381
|
+
align-items: center;
|
|
382
|
+
column-gap: $title-block-gap-default;
|
|
383
|
+
}
|
|
321
384
|
}
|
|
322
385
|
|
|
323
386
|
.sectionTitleOverride.sectionTitleOverride {
|
|
324
387
|
white-space: nowrap;
|
|
325
|
-
margin-inline: 0 var(--spacing-24);
|
|
326
388
|
font-family: $typography-heading-2-font-family;
|
|
327
389
|
font-weight: $typography-heading-2-font-weight;
|
|
328
390
|
font-size: $typography-heading-2-font-size;
|
|
@@ -346,10 +408,6 @@
|
|
|
346
408
|
}
|
|
347
409
|
}
|
|
348
410
|
|
|
349
|
-
.sectionTitle {
|
|
350
|
-
display: block;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
411
|
.sectionTitleDescription {
|
|
354
412
|
color: $color-white;
|
|
355
413
|
max-width: 780px;
|
|
@@ -359,10 +417,6 @@
|
|
|
359
417
|
line-height: $typography-paragraph-small-line-height;
|
|
360
418
|
letter-spacing: $typography-paragraph-small-letter-spacing;
|
|
361
419
|
|
|
362
|
-
.sectionTitle + & {
|
|
363
|
-
margin-top: var(--spacing-6);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
420
|
&.dark {
|
|
367
421
|
color: rgba($color-purple-800-rgb, 0.7);
|
|
368
422
|
}
|
|
@@ -373,10 +427,6 @@
|
|
|
373
427
|
width: 100%;
|
|
374
428
|
margin-top: -$title-block-separator-height;
|
|
375
429
|
justify-content: space-between;
|
|
376
|
-
|
|
377
|
-
@include title-block-small {
|
|
378
|
-
height: $tab-container-height-small;
|
|
379
|
-
}
|
|
380
430
|
}
|
|
381
431
|
|
|
382
432
|
.titleAndAdjacent {
|
|
@@ -399,12 +449,16 @@
|
|
|
399
449
|
}
|
|
400
450
|
|
|
401
451
|
.tag {
|
|
402
|
-
display:
|
|
452
|
+
display: none;
|
|
403
453
|
align-items: center;
|
|
404
454
|
margin-inline: var(--spacing-12) 0;
|
|
405
455
|
|
|
406
|
-
@include title-block-
|
|
407
|
-
display:
|
|
456
|
+
@include title-block-media-mixed-width {
|
|
457
|
+
display: flex;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
@include title-block-min-container-1080 {
|
|
461
|
+
display: flex;
|
|
408
462
|
}
|
|
409
463
|
|
|
410
464
|
+ .pageSwitcherSelectNextToTitle {
|
|
@@ -529,11 +583,6 @@
|
|
|
529
583
|
// but the variants prevent us from breaking this out.
|
|
530
584
|
.secondaryActionsContainer {
|
|
531
585
|
display: flex;
|
|
532
|
-
align-items: flex-start;
|
|
533
|
-
justify-content: flex-end;
|
|
534
|
-
padding: (calc(#{$ca-grid} / 2)) 0;
|
|
535
|
-
|
|
536
|
-
@include ca-margin($start: $ca-grid * 1.5);
|
|
537
586
|
|
|
538
587
|
// To be removed eventually – the Dropdown does not
|
|
539
588
|
// currently set its own color, and we want it
|
|
@@ -564,7 +613,6 @@
|
|
|
564
613
|
@include button-reset;
|
|
565
614
|
|
|
566
615
|
cursor: pointer;
|
|
567
|
-
display: flex;
|
|
568
616
|
position: absolute;
|
|
569
617
|
align-items: center;
|
|
570
618
|
top: 50%;
|
|
@@ -573,7 +621,7 @@
|
|
|
573
621
|
|
|
574
622
|
@include ca-position($start: calc(-#{$breadcrumb-circle-width} - #{$ca-grid}));
|
|
575
623
|
|
|
576
|
-
align-self:
|
|
624
|
+
align-self: self-start;
|
|
577
625
|
|
|
578
626
|
&:hover .breadcrumbTextLink {
|
|
579
627
|
text-decoration: underline;
|
|
@@ -598,14 +646,24 @@
|
|
|
598
646
|
}
|
|
599
647
|
}
|
|
600
648
|
|
|
601
|
-
|
|
602
|
-
@container (max-width: #{$breadcrumb-breakpoint-width}) {
|
|
603
|
-
position: relative;
|
|
604
|
-
transform: translateY(0);
|
|
605
|
-
margin-inline: 0 var(--spacing-12);
|
|
649
|
+
display: none;
|
|
606
650
|
|
|
607
|
-
|
|
608
|
-
|
|
651
|
+
@include title-block-media-mixed-width {
|
|
652
|
+
display: flex;
|
|
653
|
+
position: relative;
|
|
654
|
+
transform: translateY(0);
|
|
655
|
+
margin-inline: 0 var(--spacing-12);
|
|
656
|
+
|
|
657
|
+
@include ca-position($start: 0);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
@include title-block-min-container-1080 {
|
|
661
|
+
display: flex;
|
|
662
|
+
position: relative;
|
|
663
|
+
transform: translateY(0);
|
|
664
|
+
margin-inline: 0 var(--spacing-12);
|
|
665
|
+
|
|
666
|
+
@include ca-position($start: 0);
|
|
609
667
|
}
|
|
610
668
|
}
|
|
611
669
|
|
|
@@ -729,10 +787,6 @@
|
|
|
729
787
|
color: $color-blue-500;
|
|
730
788
|
background-color: rgba($color-blue-500-rgb, 0.1);
|
|
731
789
|
}
|
|
732
|
-
|
|
733
|
-
@include title-block-medium-and-small {
|
|
734
|
-
display: none;
|
|
735
|
-
}
|
|
736
790
|
}
|
|
737
791
|
/* stylelint-enable no-descending-specificity */
|
|
738
792
|
}
|
|
@@ -376,7 +376,10 @@ export const TitleBlock = ({
|
|
|
376
376
|
</div>
|
|
377
377
|
</div>
|
|
378
378
|
)}
|
|
379
|
-
{
|
|
379
|
+
{!sectionTitle &&
|
|
380
|
+
!sectionTitleDescription &&
|
|
381
|
+
!renderSectionTitle &&
|
|
382
|
+
renderNavigationTabs(navigationTabs, collapseNavigationArea, title)}
|
|
380
383
|
{(secondaryActions ?? secondaryOverflowMenuItems) && (
|
|
381
384
|
<SecondaryActions
|
|
382
385
|
secondaryActions={secondaryActions}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { type Meta, type StoryObj } from '@storybook/react'
|
|
3
3
|
import { expect, waitFor, within } from '@storybook/test'
|
|
4
|
+
import { Heading } from 'react-aria-components'
|
|
4
5
|
import { Icon } from '~components/Icon'
|
|
5
6
|
import { assetUrl } from '~components/utils/hostedAssets'
|
|
6
7
|
import { StickerSheet } from '~storybook/components/StickerSheet'
|
|
@@ -253,18 +254,18 @@ export const StickerSheetVariants: Story = {
|
|
|
253
254
|
]}
|
|
254
255
|
/>
|
|
255
256
|
</StickerSheet.Row>
|
|
256
|
-
<StickerSheet.Row header="Education (
|
|
257
|
+
<StickerSheet.Row header="Education (Blue background)">
|
|
257
258
|
<TitleBlock
|
|
258
259
|
variant="education"
|
|
259
260
|
title="Education Variant"
|
|
260
|
-
subtitle="This is the education variant with
|
|
261
|
+
subtitle="This is the education variant with blue background"
|
|
261
262
|
breadcrumb={{
|
|
262
263
|
path: '#',
|
|
263
264
|
text: 'Back to courses',
|
|
264
265
|
}}
|
|
265
266
|
navigationTabs={[
|
|
266
|
-
<NavigationTab key="1" text="Lessons" href="#" active />,
|
|
267
|
-
<NavigationTab key="2" text="Assignments" href="#" />,
|
|
267
|
+
<NavigationTab key="1" variant="education" text="Lessons" href="#" active />,
|
|
268
|
+
<NavigationTab key="2" variant="education" text="Assignments" href="#" />,
|
|
268
269
|
]}
|
|
269
270
|
/>
|
|
270
271
|
</StickerSheet.Row>
|
|
@@ -301,6 +302,169 @@ export const StickerSheetVariants: Story = {
|
|
|
301
302
|
</StickerSheet>
|
|
302
303
|
),
|
|
303
304
|
}
|
|
305
|
+
export const StickerSheetVariantsWithSection: Story = {
|
|
306
|
+
name: 'Sticker Sheet (Variants With Section)',
|
|
307
|
+
render: () => (
|
|
308
|
+
<StickerSheet title="TitleBlock Variants">
|
|
309
|
+
<StickerSheet.Row header="Default (Purple background)">
|
|
310
|
+
<TitleBlock
|
|
311
|
+
title="Default Variant"
|
|
312
|
+
subtitle="This is the default purple variant with white text"
|
|
313
|
+
sectionTitle="Section title"
|
|
314
|
+
sectionTitleDescription="Description of section can go here"
|
|
315
|
+
navigationTabs={undefined}
|
|
316
|
+
surveyStatus={undefined}
|
|
317
|
+
/>
|
|
318
|
+
</StickerSheet.Row>
|
|
319
|
+
<StickerSheet.Row header="Education (Blue background)">
|
|
320
|
+
<TitleBlock
|
|
321
|
+
variant="education"
|
|
322
|
+
title="Education Variant"
|
|
323
|
+
subtitle="This is the education variant with blue background"
|
|
324
|
+
sectionTitle="Section title"
|
|
325
|
+
sectionTitleDescription="Description of section can go here"
|
|
326
|
+
navigationTabs={undefined}
|
|
327
|
+
surveyStatus={undefined}
|
|
328
|
+
/>
|
|
329
|
+
</StickerSheet.Row>
|
|
330
|
+
<StickerSheet.Row header="Admin (White background)">
|
|
331
|
+
<TitleBlock
|
|
332
|
+
variant="admin"
|
|
333
|
+
title="Admin Variant"
|
|
334
|
+
subtitle="This is the admin variant with white background"
|
|
335
|
+
sectionTitle="Section title"
|
|
336
|
+
sectionTitleDescription="Description of section can go here"
|
|
337
|
+
navigationTabs={undefined}
|
|
338
|
+
surveyStatus={undefined}
|
|
339
|
+
/>
|
|
340
|
+
</StickerSheet.Row>
|
|
341
|
+
<StickerSheet.Row header="Light (White background)">
|
|
342
|
+
<TitleBlock
|
|
343
|
+
variant="light"
|
|
344
|
+
title="Light Variant"
|
|
345
|
+
subtitle="This is the light variant with clean white background"
|
|
346
|
+
sectionTitle="Section title"
|
|
347
|
+
sectionTitleDescription="Description of section can go here"
|
|
348
|
+
navigationTabs={undefined}
|
|
349
|
+
surveyStatus={undefined}
|
|
350
|
+
/>
|
|
351
|
+
</StickerSheet.Row>
|
|
352
|
+
</StickerSheet>
|
|
353
|
+
),
|
|
354
|
+
}
|
|
355
|
+
export const StickerSheetVariantsWithSectionTitleOnly: Story = {
|
|
356
|
+
name: 'Sticker Sheet (Section Title Only)',
|
|
357
|
+
render: () => (
|
|
358
|
+
<StickerSheet title="TitleBlock Variants">
|
|
359
|
+
<StickerSheet.Row header="Default (Purple background)">
|
|
360
|
+
<TitleBlock
|
|
361
|
+
title="Default Variant"
|
|
362
|
+
subtitle="This is the default purple variant with white text"
|
|
363
|
+
sectionTitle="Section title"
|
|
364
|
+
sectionTitleDescription={undefined}
|
|
365
|
+
navigationTabs={undefined}
|
|
366
|
+
surveyStatus={undefined}
|
|
367
|
+
secondaryActions={undefined}
|
|
368
|
+
secondaryOverflowMenuItems={undefined}
|
|
369
|
+
primaryAction={undefined}
|
|
370
|
+
defaultAction={undefined}
|
|
371
|
+
/>
|
|
372
|
+
</StickerSheet.Row>
|
|
373
|
+
<StickerSheet.Row header="Education (Blue background)">
|
|
374
|
+
<TitleBlock
|
|
375
|
+
variant="education"
|
|
376
|
+
title="Education Variant"
|
|
377
|
+
subtitle="This is the education variant with blue background"
|
|
378
|
+
sectionTitle="Section title"
|
|
379
|
+
sectionTitleDescription={undefined}
|
|
380
|
+
navigationTabs={undefined}
|
|
381
|
+
surveyStatus={undefined}
|
|
382
|
+
secondaryActions={undefined}
|
|
383
|
+
secondaryOverflowMenuItems={undefined}
|
|
384
|
+
primaryAction={undefined}
|
|
385
|
+
defaultAction={undefined}
|
|
386
|
+
/>
|
|
387
|
+
</StickerSheet.Row>
|
|
388
|
+
<StickerSheet.Row header="Admin (White background)">
|
|
389
|
+
<TitleBlock
|
|
390
|
+
variant="admin"
|
|
391
|
+
title="Admin Variant"
|
|
392
|
+
subtitle="This is the admin variant with white background"
|
|
393
|
+
sectionTitle="Section title"
|
|
394
|
+
sectionTitleDescription={undefined}
|
|
395
|
+
navigationTabs={undefined}
|
|
396
|
+
surveyStatus={undefined}
|
|
397
|
+
secondaryActions={undefined}
|
|
398
|
+
secondaryOverflowMenuItems={undefined}
|
|
399
|
+
primaryAction={undefined}
|
|
400
|
+
defaultAction={undefined}
|
|
401
|
+
/>
|
|
402
|
+
</StickerSheet.Row>
|
|
403
|
+
<StickerSheet.Row header="Light (White background)">
|
|
404
|
+
<TitleBlock
|
|
405
|
+
variant="light"
|
|
406
|
+
title="Light Variant"
|
|
407
|
+
subtitle="This is the light variant with clean white background"
|
|
408
|
+
sectionTitle="Section title"
|
|
409
|
+
sectionTitleDescription={undefined}
|
|
410
|
+
navigationTabs={undefined}
|
|
411
|
+
surveyStatus={undefined}
|
|
412
|
+
secondaryActions={undefined}
|
|
413
|
+
secondaryOverflowMenuItems={undefined}
|
|
414
|
+
primaryAction={undefined}
|
|
415
|
+
defaultAction={undefined}
|
|
416
|
+
/>
|
|
417
|
+
</StickerSheet.Row>
|
|
418
|
+
</StickerSheet>
|
|
419
|
+
),
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export const StickerSheetVariantsWithCollapseNavigationAreaWhenPossible: Story = {
|
|
423
|
+
name: 'Sticker Sheet (Variants WithCollapseNavigationAreaWhenPossible)',
|
|
424
|
+
render: () => (
|
|
425
|
+
<StickerSheet title="TitleBlock Variants">
|
|
426
|
+
<StickerSheet.Row header="Default">
|
|
427
|
+
<TitleBlock
|
|
428
|
+
title="Default Variant"
|
|
429
|
+
subtitle={undefined}
|
|
430
|
+
breadcrumb={undefined}
|
|
431
|
+
navigationTabs={undefined}
|
|
432
|
+
collapseNavigationAreaWhenPossible={true}
|
|
433
|
+
/>
|
|
434
|
+
</StickerSheet.Row>
|
|
435
|
+
<StickerSheet.Row header="Education">
|
|
436
|
+
<TitleBlock
|
|
437
|
+
variant="education"
|
|
438
|
+
title="Education Variant"
|
|
439
|
+
subtitle={undefined}
|
|
440
|
+
breadcrumb={undefined}
|
|
441
|
+
navigationTabs={undefined}
|
|
442
|
+
collapseNavigationAreaWhenPossible={true}
|
|
443
|
+
/>
|
|
444
|
+
</StickerSheet.Row>
|
|
445
|
+
<StickerSheet.Row header="Admin">
|
|
446
|
+
<TitleBlock
|
|
447
|
+
variant="admin"
|
|
448
|
+
title="Admin Variant"
|
|
449
|
+
subtitle={undefined}
|
|
450
|
+
breadcrumb={undefined}
|
|
451
|
+
navigationTabs={undefined}
|
|
452
|
+
collapseNavigationAreaWhenPossible={true}
|
|
453
|
+
/>
|
|
454
|
+
</StickerSheet.Row>
|
|
455
|
+
<StickerSheet.Row header="Light">
|
|
456
|
+
<TitleBlock
|
|
457
|
+
variant="light"
|
|
458
|
+
title="Light Variant"
|
|
459
|
+
subtitle={undefined}
|
|
460
|
+
breadcrumb={undefined}
|
|
461
|
+
navigationTabs={undefined}
|
|
462
|
+
collapseNavigationAreaWhenPossible={true}
|
|
463
|
+
/>
|
|
464
|
+
</StickerSheet.Row>
|
|
465
|
+
</StickerSheet>
|
|
466
|
+
),
|
|
467
|
+
}
|
|
304
468
|
|
|
305
469
|
export const StickerSheetBreadcrumbs: Story = {
|
|
306
470
|
name: 'Sticker Sheet (Breadcrumb)',
|
|
@@ -434,3 +598,73 @@ export const StickerSheetSurveyStatus: Story = {
|
|
|
434
598
|
</StickerSheet>
|
|
435
599
|
),
|
|
436
600
|
}
|
|
601
|
+
|
|
602
|
+
export const WithSection: Story = {
|
|
603
|
+
parameters: {
|
|
604
|
+
viewport: viewports,
|
|
605
|
+
chromatic: chromaticViewports,
|
|
606
|
+
},
|
|
607
|
+
args: {
|
|
608
|
+
title: 'A extra long title with over thirty characters so it truncates in a mobile viewport',
|
|
609
|
+
sectionTitle: 'Section title',
|
|
610
|
+
sectionTitleDescription: 'Description of section can go here',
|
|
611
|
+
navigationTabs: undefined,
|
|
612
|
+
surveyStatus: undefined,
|
|
613
|
+
},
|
|
614
|
+
}
|
|
615
|
+
export const WithCustomSectionTitleOnly: Story = {
|
|
616
|
+
parameters: {
|
|
617
|
+
viewport: viewports,
|
|
618
|
+
chromatic: chromaticViewports,
|
|
619
|
+
},
|
|
620
|
+
args: {
|
|
621
|
+
title: 'Page title',
|
|
622
|
+
renderSectionTitle: () => (
|
|
623
|
+
<div>
|
|
624
|
+
<Heading className="m-0">Custom Section Title</Heading>
|
|
625
|
+
</div>
|
|
626
|
+
),
|
|
627
|
+
navigationTabs: undefined,
|
|
628
|
+
surveyStatus: undefined,
|
|
629
|
+
secondaryActions: undefined,
|
|
630
|
+
secondaryOverflowMenuItems: undefined,
|
|
631
|
+
primaryAction: undefined,
|
|
632
|
+
defaultAction: undefined,
|
|
633
|
+
},
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export const WithTitleCollapseNavigationAreaWhenPossible: Story = {
|
|
637
|
+
parameters: {
|
|
638
|
+
viewport: viewports,
|
|
639
|
+
chromatic: chromaticViewports,
|
|
640
|
+
},
|
|
641
|
+
args: {
|
|
642
|
+
title: 'Page title',
|
|
643
|
+
navigationTabs: undefined,
|
|
644
|
+
surveyStatus: undefined,
|
|
645
|
+
primaryAction: undefined,
|
|
646
|
+
defaultAction: undefined,
|
|
647
|
+
secondaryActions: undefined,
|
|
648
|
+
secondaryOverflowMenuItems: undefined,
|
|
649
|
+
breadcrumb: undefined,
|
|
650
|
+
avatar: undefined,
|
|
651
|
+
collapseNavigationAreaWhenPossible: true,
|
|
652
|
+
},
|
|
653
|
+
}
|
|
654
|
+
export const WithOnlySecondaryActions: Story = {
|
|
655
|
+
parameters: {
|
|
656
|
+
viewport: viewports,
|
|
657
|
+
chromatic: chromaticViewports,
|
|
658
|
+
},
|
|
659
|
+
args: {
|
|
660
|
+
title: 'Page title',
|
|
661
|
+
navigationTabs: undefined,
|
|
662
|
+
surveyStatus: undefined,
|
|
663
|
+
primaryAction: undefined,
|
|
664
|
+
defaultAction: undefined,
|
|
665
|
+
sectionTitle: undefined,
|
|
666
|
+
sectionTitleDescription: undefined,
|
|
667
|
+
breadcrumb: undefined,
|
|
668
|
+
avatar: undefined,
|
|
669
|
+
},
|
|
670
|
+
}
|
|
@@ -41,3 +41,32 @@
|
|
|
41
41
|
@content;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
|
|
45
|
+
@mixin title-block-min-media-1080 {
|
|
46
|
+
@media (min-width: #{$layout-breakpoints-large}) {
|
|
47
|
+
@content;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@mixin title-block-min-container-1080 {
|
|
52
|
+
@container (min-width: #{$layout-breakpoints-large}) {
|
|
53
|
+
@content;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@mixin title-block-media-mixed-width {
|
|
58
|
+
// 1080
|
|
59
|
+
@media (min-width: #{$layout-breakpoints-large}) and (max-width: 1095px) {
|
|
60
|
+
// Note: There is a diff of 15px between the media and container query
|
|
61
|
+
@container (min-width: 1065px) {
|
|
62
|
+
@content;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 576 is the specified breakpoint from design to wrap the primary actions
|
|
68
|
+
@mixin title-block-under-576 {
|
|
69
|
+
@container (max-width: 576px) {
|
|
70
|
+
@content;
|
|
71
|
+
}
|
|
72
|
+
}
|