@kaizen/components 2.3.2 → 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.
@@ -284,7 +284,7 @@ var TitleBlock = function (_a) {
284
284
  sectionTitleAutomationId: sectionTitleAutomationId,
285
285
  sectionTitleDescription: sectionTitleDescription,
286
286
  sectionTitleDescriptionAutomationId: sectionTitleDescriptionAutomationId
287
- }) : defaultRenderSectionTitle(sectionTitle, sectionTitleDescription, variant, sectionTitleAutomationId, sectionTitleDescriptionAutomationId))), renderNavigationTabs(navigationTabs, collapseNavigationArea, title), (secondaryActions !== null && secondaryActions !== void 0 ? secondaryActions : secondaryOverflowMenuItems) && React__default.default.createElement(SecondaryActions.SecondaryActions, {
287
+ }) : defaultRenderSectionTitle(sectionTitle, sectionTitleDescription, variant, sectionTitleAutomationId, sectionTitleDescriptionAutomationId))), !sectionTitle && !sectionTitleDescription && !renderSectionTitle && renderNavigationTabs(navigationTabs, collapseNavigationArea, title), (secondaryActions !== null && secondaryActions !== void 0 ? secondaryActions : secondaryOverflowMenuItems) && React__default.default.createElement(SecondaryActions.SecondaryActions, {
288
288
  secondaryActions: secondaryActions,
289
289
  secondaryOverflowMenuItems: secondaryOverflowMenuItems,
290
290
  reversed: utils.isReversed(variant)
@@ -276,7 +276,7 @@ const TitleBlock = /*#__PURE__*/function () {
276
276
  sectionTitleAutomationId: sectionTitleAutomationId,
277
277
  sectionTitleDescription: sectionTitleDescription,
278
278
  sectionTitleDescriptionAutomationId: sectionTitleDescriptionAutomationId
279
- }) : defaultRenderSectionTitle(sectionTitle, sectionTitleDescription, variant, sectionTitleAutomationId, sectionTitleDescriptionAutomationId)))), renderNavigationTabs(navigationTabs, collapseNavigationArea, title), (secondaryActions !== null && secondaryActions !== void 0 ? secondaryActions : secondaryOverflowMenuItems) && (/*#__PURE__*/React.createElement(SecondaryActions, {
279
+ }) : defaultRenderSectionTitle(sectionTitle, sectionTitleDescription, variant, sectionTitleAutomationId, sectionTitleDescriptionAutomationId)))), !sectionTitle && !sectionTitleDescription && !renderSectionTitle && renderNavigationTabs(navigationTabs, collapseNavigationArea, title), (secondaryActions !== null && secondaryActions !== void 0 ? secondaryActions : secondaryOverflowMenuItems) && (/*#__PURE__*/React.createElement(SecondaryActions, {
280
280
  secondaryActions: secondaryActions,
281
281
  secondaryOverflowMenuItems: secondaryOverflowMenuItems,
282
282
  reversed: isReversed(variant)
package/dist/styles.css CHANGED
@@ -10058,11 +10058,6 @@
10058
10058
  width: 100%;
10059
10059
  justify-content: center;
10060
10060
  }
10061
- @container (max-width: calc(768px - 1px)) {
10062
- .TitleBlock-module_rowBelowSeparator__H4E63 {
10063
- height: 3.75rem;
10064
- }
10065
- }
10066
10061
  .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_titleRow__Ifqiu {
10067
10062
  background-color: var(--color-white, #ffffff);
10068
10063
  margin-bottom: 0.063rem;
@@ -10098,11 +10093,6 @@
10098
10093
  margin-inline: 24px;
10099
10094
  }
10100
10095
  }
10101
- @container (max-width: calc(768px - 1px)) {
10102
- .TitleBlock-module_rowBelowSeparatorInner__3gNec {
10103
- height: 3.75rem;
10104
- }
10105
- }
10106
10096
  .TitleBlock-module_titleRowInnerContent__NhTHV {
10107
10097
  box-sizing: border-box;
10108
10098
  position: relative;
@@ -10338,14 +10328,21 @@
10338
10328
  .TitleBlock-module_sectionTitleContainer__LrDPV {
10339
10329
  display: flex;
10340
10330
  align-items: center;
10331
+ padding-block: 9px;
10341
10332
  padding-inline-end: 8px;
10342
10333
  }
10334
+ @container (min-width: 1080px) {
10335
+ .TitleBlock-module_sectionTitleContainer__LrDPV {
10336
+ padding-block: 17px;
10337
+ }
10338
+ }
10343
10339
  .TitleBlock-module_sectionTitle__b8daw {
10344
10340
  display: block;
10345
10341
  }
10346
10342
  .TitleBlock-module_sectionTitleInner__nJfOP {
10347
10343
  display: flex;
10348
10344
  flex-direction: column;
10345
+ row-gap: 4px;
10349
10346
  }
10350
10347
  @container (min-width: 1080px) {
10351
10348
  .TitleBlock-module_sectionTitleInner__nJfOP {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -61,10 +61,6 @@
61
61
  display: flex;
62
62
  width: 100%;
63
63
  justify-content: center;
64
-
65
- @include title-block-small {
66
- height: $tab-container-height-small;
67
- }
68
64
  }
69
65
 
70
66
  .lightVariant .titleRow {
@@ -112,10 +108,6 @@
112
108
  .rowBelowSeparatorInner {
113
109
  @extend %titleBlockInner;
114
110
  @extend %rowBelowSeparatorInnerMarginOverride;
115
-
116
- @include title-block-small {
117
- height: $tab-container-height-small;
118
- }
119
111
  }
120
112
 
121
113
  .titleRowInnerContent {
@@ -367,7 +359,12 @@
367
359
  .sectionTitleContainer {
368
360
  display: flex;
369
361
  align-items: center;
362
+ padding-block: 9px;
370
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
+ }
371
368
  }
372
369
 
373
370
  .sectionTitle {
@@ -377,6 +374,7 @@
377
374
  .sectionTitleInner {
378
375
  display: flex;
379
376
  flex-direction: column;
377
+ row-gap: 4px;
380
378
 
381
379
  @include title-block-min-container-1080 {
382
380
  flex-direction: row;
@@ -376,7 +376,10 @@ export const TitleBlock = ({
376
376
  </div>
377
377
  </div>
378
378
  )}
379
- {renderNavigationTabs(navigationTabs, collapseNavigationArea, title)}
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 (Purple background)">
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 purple background"
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)',
@@ -442,10 +606,65 @@ export const WithSection: Story = {
442
606
  },
443
607
  args: {
444
608
  title: 'A extra long title with over thirty characters so it truncates in a mobile viewport',
445
- variant: 'light',
446
609
  sectionTitle: 'Section title',
447
610
  sectionTitleDescription: 'Description of section can go here',
448
611
  navigationTabs: undefined,
449
612
  surveyStatus: undefined,
450
613
  },
451
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
+ }