@kaizen/components 2.1.1 → 2.2.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.
Files changed (51) hide show
  1. package/dist/cjs/index.cjs +2 -0
  2. package/dist/cjs/src/Button/Button.cjs +1 -0
  3. package/dist/cjs/src/Calendar/CalendarRange/CalendarRange.cjs +4 -2
  4. package/dist/cjs/src/Calendar/CalendarRange/CalendarRange.module.scss.cjs +2 -1
  5. package/dist/cjs/src/Calendar/CalendarSingle/CalendarSingle.cjs +9 -5
  6. package/dist/cjs/src/Calendar/CalendarSingle/CalendarSingle.module.scss.cjs +2 -1
  7. package/dist/cjs/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.cjs +4 -2
  8. package/dist/cjs/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.module.scss.cjs +2 -1
  9. package/dist/cjs/src/LinkButton/LinkButton.cjs +1 -0
  10. package/dist/cjs/src/Pagination/Pagination.cjs +1 -0
  11. package/dist/cjs/src/TitleBlock/TitleBlock.module.scss.cjs +1 -0
  12. package/dist/cjs/src/TitleBlock/utils.cjs +1 -1
  13. package/dist/cjs/src/Tooltip/OverlayArrow.cjs +1 -0
  14. package/dist/cjs/src/Tooltip/Tooltip.cjs +1 -0
  15. package/dist/cjs/src/utils/useContainerQueries.cjs +89 -0
  16. package/dist/esm/index.mjs +1 -0
  17. package/dist/esm/src/Button/Button.mjs +1 -0
  18. package/dist/esm/src/Calendar/CalendarRange/CalendarRange.mjs +4 -2
  19. package/dist/esm/src/Calendar/CalendarRange/CalendarRange.module.scss.mjs +2 -1
  20. package/dist/esm/src/Calendar/CalendarSingle/CalendarSingle.mjs +9 -5
  21. package/dist/esm/src/Calendar/CalendarSingle/CalendarSingle.module.scss.mjs +2 -1
  22. package/dist/esm/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.mjs +4 -2
  23. package/dist/esm/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.module.scss.mjs +2 -1
  24. package/dist/esm/src/LinkButton/LinkButton.mjs +1 -0
  25. package/dist/esm/src/Pagination/Pagination.mjs +1 -0
  26. package/dist/esm/src/TitleBlock/TitleBlock.module.scss.mjs +1 -0
  27. package/dist/esm/src/TitleBlock/utils.mjs +1 -1
  28. package/dist/esm/src/Tooltip/OverlayArrow.mjs +1 -0
  29. package/dist/esm/src/Tooltip/Tooltip.mjs +1 -0
  30. package/dist/esm/src/utils/useContainerQueries.mjs +87 -0
  31. package/dist/styles.css +34 -5
  32. package/dist/types/Calendar/CalendarSingle/CalendarSingle.d.ts +3 -1
  33. package/dist/types/TitleBlock/types.d.ts +1 -1
  34. package/dist/types/utils/index.d.ts +1 -0
  35. package/dist/types/utils/useContainerQueries.d.ts +21 -0
  36. package/package.json +1 -1
  37. package/src/Calendar/CalendarRange/CalendarRange.module.scss +4 -0
  38. package/src/Calendar/CalendarRange/CalendarRange.tsx +16 -2
  39. package/src/Calendar/CalendarSingle/CalendarSingle.module.scss +4 -0
  40. package/src/Calendar/CalendarSingle/CalendarSingle.tsx +20 -2
  41. package/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.module.scss +4 -0
  42. package/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.tsx +16 -2
  43. package/src/TitleBlock/TitleBlock.module.scss +29 -0
  44. package/src/TitleBlock/_docs/TitleBlock--usage-guidelines.mdx +4 -0
  45. package/src/TitleBlock/_docs/TitleBlock.stories.tsx +108 -0
  46. package/src/TitleBlock/_variables.scss +1 -0
  47. package/src/TitleBlock/types.ts +1 -1
  48. package/src/TitleBlock/utils.ts +1 -1
  49. package/src/utils/index.ts +1 -0
  50. package/src/utils/useContainerQueries.spec.tsx +209 -0
  51. package/src/utils/useContainerQueries.tsx +121 -0
package/dist/styles.css CHANGED
@@ -2081,6 +2081,9 @@
2081
2081
  .CalendarSingle-module_navButtonNext__-GrZx {
2082
2082
  inset-inline-end: 0;
2083
2083
  }
2084
+ .CalendarSingle-module_chevronIcon__0PRnR {
2085
+ pointer-events: none;
2086
+ }
2084
2087
  }
2085
2088
  /** THIS IS AN AUTOGENERATED FILE **/
2086
2089
  /** THIS IS AN AUTOGENERATED FILE **/
@@ -2133,6 +2136,9 @@
2133
2136
  .CalendarRange-module_hidden__D47kb {
2134
2137
  background-color: transparent;
2135
2138
  }
2139
+ .CalendarRange-module_chevronIcon__ULJzd {
2140
+ pointer-events: none;
2141
+ }
2136
2142
  }
2137
2143
  @layer kz-components {
2138
2144
  @property --gradient-angle {
@@ -3529,6 +3535,9 @@
3529
3535
  .LegacyCalendarRange-module_dayRangeMiddle__M27gR [class*=_button_] {
3530
3536
  color: var(--color-blue-500, #0168b3);
3531
3537
  }
3538
+ .LegacyCalendarRange-module_chevronIcon__Q6pOJ {
3539
+ pointer-events: none;
3540
+ }
3532
3541
  }
3533
3542
  /** THIS IS AN AUTOGENERATED FILE **/
3534
3543
  /** THIS IS AN AUTOGENERATED FILE **/
@@ -10237,6 +10246,9 @@
10237
10246
  justify-content: center;
10238
10247
  flex-direction: column;
10239
10248
  }
10249
+ .TitleBlock-module_titleBlock__7jxn3.TitleBlock-module_lightVariant__1EeLV {
10250
+ background-color: var(--color-white, #ffffff);
10251
+ }
10240
10252
  .TitleBlock-module_titleBlock__7jxn3.TitleBlock-module_educationVariant__YvpWa {
10241
10253
  background-color: var(--color-blue-100, #e6f6ff);
10242
10254
  }
@@ -10254,6 +10266,10 @@
10254
10266
  width: 100%;
10255
10267
  justify-content: center;
10256
10268
  }
10269
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_titleRow__Ifqiu {
10270
+ background-color: var(--color-white, #ffffff);
10271
+ margin-bottom: 3px;
10272
+ }
10257
10273
  .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_titleRow__Ifqiu {
10258
10274
  background-color: var(--color-white, #ffffff);
10259
10275
  margin-bottom: 3px;
@@ -10271,6 +10287,9 @@
10271
10287
  margin: 0 12px;
10272
10288
  }
10273
10289
  }
10290
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_titleRowInner__SlArS {
10291
+ border-bottom: 1px solid var(--color-gray-300, #eaeaec);
10292
+ }
10274
10293
  .TitleBlock-module_titleRowInnerContent__NhTHV {
10275
10294
  position: relative;
10276
10295
  display: flex;
@@ -10283,7 +10302,7 @@
10283
10302
  .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_titleRowInnerContent__NhTHV {
10284
10303
  border-bottom-color: rgba(var(--color-purple-700-rgb, 74, 35, 77), 0.2);
10285
10304
  }
10286
- .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_titleRowInnerContent__NhTHV, .TitleBlock-module_collapseNavigationArea__x9hzQ .TitleBlock-module_titleRowInnerContent__NhTHV {
10305
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_titleRowInnerContent__NhTHV, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_titleRowInnerContent__NhTHV, .TitleBlock-module_collapseNavigationArea__x9hzQ .TitleBlock-module_titleRowInnerContent__NhTHV {
10287
10306
  border-bottom-color: transparent;
10288
10307
  }
10289
10308
  @container (max-width: calc(1080px - 1px)) {
@@ -10426,6 +10445,9 @@
10426
10445
  max-width: 230px;
10427
10446
  margin-inline: var(--spacing-12) 0;
10428
10447
  }
10448
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_subtitle__AI9tj {
10449
+ color: var(--color-purple-800, #2f2438);
10450
+ }
10429
10451
  .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_subtitle__AI9tj {
10430
10452
  color: var(--color-purple-800, #2f2438);
10431
10453
  }
@@ -10598,6 +10620,11 @@
10598
10620
  z-index: 1;
10599
10621
  }
10600
10622
  }
10623
+ @container (max-width: calc(768px - 1px)) {
10624
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_navigationTabEdgeShadowRight__xkIWc, .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_navigationTabEdgeShadowLeft__9pGhR {
10625
+ background: linear-gradient(0deg, var(--color-gray-100, #f9f9f9), rgba(var(--color-gray-100-rgb, 249, 249, 249), 0));
10626
+ }
10627
+ }
10601
10628
  @container (max-width: calc(768px - 1px)) {
10602
10629
  .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_navigationTabEdgeShadowRight__xkIWc, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_navigationTabEdgeShadowLeft__9pGhR {
10603
10630
  background: linear-gradient(0deg, var(--color-gray-100, #f9f9f9), rgba(var(--color-gray-100-rgb, 249, 249, 249), 0));
@@ -10636,7 +10663,7 @@
10636
10663
  margin-inline-end: 0;
10637
10664
  margin-inline-start: 2.25rem;
10638
10665
  }
10639
- .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_secondaryActionsContainer__-4q0l, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_secondaryActionsContainer__-4q0l {
10666
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_secondaryActionsContainer__-4q0l, .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_secondaryActionsContainer__-4q0l, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_secondaryActionsContainer__-4q0l {
10640
10667
  color: var(--color-blue-500, #0168b3);
10641
10668
  }
10642
10669
  @container (max-width: calc(1080px - 1px)) {
@@ -10751,9 +10778,11 @@
10751
10778
  .TitleBlock-module_breadcrumbText__vDi0k {
10752
10779
  color: var(--color-white, #ffffff);
10753
10780
  }
10754
- .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_breadcrumb__lVNKz, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_breadcrumb__lVNKz,
10781
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_breadcrumb__lVNKz, .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_breadcrumb__lVNKz, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_breadcrumb__lVNKz,
10782
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_breadcrumb__lVNKz:hover,
10755
10783
  .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_breadcrumb__lVNKz:hover,
10756
10784
  .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_breadcrumb__lVNKz:hover,
10785
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_breadcrumbText__vDi0k,
10757
10786
  .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_breadcrumbText__vDi0k,
10758
10787
  .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_breadcrumbText__vDi0k {
10759
10788
  color: var(--color-purple-800, #2f2438);
@@ -10779,12 +10808,12 @@
10779
10808
  color: var(--color-white, #ffffff);
10780
10809
  background-color: rgba(var(--color-white-rgb, 255, 255, 255), 0.1);
10781
10810
  }
10782
- .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_circle__68z-T, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_circle__68z-T {
10811
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_circle__68z-T, .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_circle__68z-T, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_circle__68z-T {
10783
10812
  color: var(--color-blue-500, #0168b3);
10784
10813
  border-color: var(--color-blue-300, #73c0e8);
10785
10814
  border-width: 3px;
10786
10815
  }
10787
- .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_breadcrumb__lVNKz:hover .TitleBlock-module_circle__68z-T, .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_breadcrumb__lVNKz:focus .TitleBlock-module_circle__68z-T, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_breadcrumb__lVNKz:hover .TitleBlock-module_circle__68z-T, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_breadcrumb__lVNKz:focus .TitleBlock-module_circle__68z-T {
10816
+ .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_breadcrumb__lVNKz:hover .TitleBlock-module_circle__68z-T, .TitleBlock-module_lightVariant__1EeLV .TitleBlock-module_breadcrumb__lVNKz:focus .TitleBlock-module_circle__68z-T, .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_breadcrumb__lVNKz:hover .TitleBlock-module_circle__68z-T, .TitleBlock-module_educationVariant__YvpWa .TitleBlock-module_breadcrumb__lVNKz:focus .TitleBlock-module_circle__68z-T, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_breadcrumb__lVNKz:hover .TitleBlock-module_circle__68z-T, .TitleBlock-module_adminVariant__s95nS .TitleBlock-module_breadcrumb__lVNKz:focus .TitleBlock-module_circle__68z-T {
10788
10817
  border-color: var(--color-blue-500, #0168b3);
10789
10818
  color: var(--color-blue-500, #0168b3);
10790
10819
  background-color: rgba(var(--color-blue-500-rgb, 1, 104, 179), 0.1);
@@ -4,8 +4,10 @@ export type CalendarSingleElement = HTMLDivElement;
4
4
  export type CalendarSingleProps = {
5
5
  id?: string;
6
6
  onMount?: (calendarElement: CalendarSingleElement) => void;
7
+ /** Exposes the react-day-picker component prop. Please be aware, consumers using this will have to guarentee functions as expected */
8
+ components?: PropsBase['components'];
7
9
  } & OverrideClassName<Omit<PropsSingle & Omit<PropsBase, 'mode'>, 'mode'>>;
8
10
  export declare const CalendarSingle: {
9
- ({ id, onMount, classNameOverride, selected, defaultMonth, weekStartsOn, locale, ...restProps }: CalendarSingleProps): JSX.Element;
11
+ ({ id, onMount, classNameOverride, selected, defaultMonth, weekStartsOn, locale, components, ...restProps }: CalendarSingleProps): JSX.Element;
10
12
  displayName: string;
11
13
  };
@@ -117,7 +117,7 @@ export type TitleBlockDistributiveOmit<T, K extends keyof any> = T extends any ?
117
117
  export type TitleBlockAvatarProps = Omit<GenericAvatarProps, 'size'> | Omit<CompanyAvatarProps, 'size'>;
118
118
  export type DefaultActionProps = TitleBlockButtonProps | TitleBlockCustomButtonProps;
119
119
  export type SectionTitleRenderProps = Pick<TitleBlockProps, 'sectionTitle' | 'sectionTitleAutomationId' | 'sectionTitleDescription' | 'sectionTitleDescriptionAutomationId'>;
120
- export type TitleBlockVariant = 'admin' | 'education';
120
+ export type TitleBlockVariant = 'light' | 'admin' | 'education';
121
121
  export type NavigationTabs = React.ReactElement<NavigationTabProps>[];
122
122
  export type TextDirection = 'ltr' | 'rtl';
123
123
  export type SurveyStatus = {
@@ -1,3 +1,4 @@
1
1
  export * from './useMediaQueries';
2
+ export * from './useContainerQueries';
2
3
  export * from './hostedAssets';
3
4
  export * from './ReversedColors';
@@ -0,0 +1,21 @@
1
+ import type React from 'react';
2
+ type ContainerQueries = {
3
+ is3xsOrLarger: boolean;
4
+ is2xsOrLarger: boolean;
5
+ isXsOrLarger: boolean;
6
+ isSmOrLarger: boolean;
7
+ isMdOrLarger: boolean;
8
+ isLgOrLarger: boolean;
9
+ isXlOrLarger: boolean;
10
+ is2xlOrLarger: boolean;
11
+ is3xlOrLarger: boolean;
12
+ is4xlOrLarger: boolean;
13
+ is5xlOrLarger: boolean;
14
+ is6xlOrLarger: boolean;
15
+ is7xlOrLarger: boolean;
16
+ };
17
+ export declare const useContainerQueries: () => {
18
+ containerRef: React.RefCallback<HTMLElement>;
19
+ queries: ContainerQueries;
20
+ };
21
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -65,4 +65,8 @@
65
65
  .hidden {
66
66
  background-color: transparent;
67
67
  }
68
+
69
+ .chevronIcon {
70
+ pointer-events: none;
71
+ }
68
72
  }
@@ -57,10 +57,24 @@ export const CalendarRange = ({
57
57
  components={{
58
58
  Chevron: (props) => {
59
59
  if (props.orientation === 'left') {
60
- return <Icon name="arrow_back" isPresentational shouldMirrorInRTL />
60
+ return (
61
+ <Icon
62
+ name="arrow_back"
63
+ isPresentational
64
+ shouldMirrorInRTL
65
+ className={styles.chevronIcon}
66
+ />
67
+ )
61
68
  }
62
69
 
63
- return <Icon name="arrow_forward" isPresentational shouldMirrorInRTL />
70
+ return (
71
+ <Icon
72
+ name="arrow_forward"
73
+ isPresentational
74
+ shouldMirrorInRTL
75
+ className={styles.chevronIcon}
76
+ />
77
+ )
64
78
  },
65
79
  }}
66
80
  numberOfMonths={numberOfMonths}
@@ -13,4 +13,8 @@
13
13
  .navButtonNext {
14
14
  inset-inline-end: 0;
15
15
  }
16
+
17
+ .chevronIcon {
18
+ pointer-events: none;
19
+ }
16
20
  }
@@ -12,6 +12,8 @@ export type CalendarSingleElement = HTMLDivElement
12
12
  export type CalendarSingleProps = {
13
13
  id?: string
14
14
  onMount?: (calendarElement: CalendarSingleElement) => void
15
+ /** Exposes the react-day-picker component prop. Please be aware, consumers using this will have to guarentee functions as expected */
16
+ components?: PropsBase['components']
15
17
  } & OverrideClassName<Omit<PropsSingle & Omit<PropsBase, 'mode'>, 'mode'>>
16
18
 
17
19
  export const CalendarSingle = ({
@@ -22,6 +24,7 @@ export const CalendarSingle = ({
22
24
  defaultMonth,
23
25
  weekStartsOn,
24
26
  locale = enAU,
27
+ components = {},
25
28
  ...restProps
26
29
  }: CalendarSingleProps): JSX.Element => {
27
30
  const calendarRef = useRef<CalendarSingleElement>(null)
@@ -52,11 +55,26 @@ export const CalendarSingle = ({
52
55
  components={{
53
56
  Chevron: (props) => {
54
57
  if (props.orientation === 'left') {
55
- return <Icon name="arrow_back" isPresentational shouldMirrorInRTL />
58
+ return (
59
+ <Icon
60
+ name="arrow_back"
61
+ isPresentational
62
+ shouldMirrorInRTL
63
+ className={styles.chevronIcon}
64
+ />
65
+ )
56
66
  }
57
67
 
58
- return <Icon name="arrow_forward" isPresentational shouldMirrorInRTL />
68
+ return (
69
+ <Icon
70
+ name="arrow_forward"
71
+ isPresentational
72
+ shouldMirrorInRTL
73
+ className={styles.chevronIcon}
74
+ />
75
+ )
59
76
  },
77
+ ...components,
60
78
  }}
61
79
  locale={locale}
62
80
  {...restProps}
@@ -24,4 +24,8 @@
24
24
  color: $color-blue-500;
25
25
  }
26
26
  }
27
+
28
+ .chevronIcon {
29
+ pointer-events: none;
30
+ }
27
31
  }
@@ -60,10 +60,24 @@ export const LegacyCalendarRange = ({
60
60
  components={{
61
61
  Chevron: (props) => {
62
62
  if (props.orientation === 'left') {
63
- return <Icon name="arrow_back" isPresentational shouldMirrorInRTL />
63
+ return (
64
+ <Icon
65
+ name="arrow_back"
66
+ isPresentational
67
+ shouldMirrorInRTL
68
+ className={styles.chevronIcon}
69
+ />
70
+ )
64
71
  }
65
72
 
66
- return <Icon name="arrow_forward" isPresentational shouldMirrorInRTL />
73
+ return (
74
+ <Icon
75
+ name="arrow_forward"
76
+ isPresentational
77
+ shouldMirrorInRTL
78
+ className={styles.chevronIcon}
79
+ />
80
+ )
67
81
  },
68
82
  }}
69
83
  locale={locale}
@@ -31,6 +31,10 @@
31
31
  justify-content: center;
32
32
  flex-direction: column;
33
33
 
34
+ &.lightVariant {
35
+ background-color: $dt-color-background-color-light;
36
+ }
37
+
34
38
  &.educationVariant {
35
39
  background-color: $dt-color-background-color-eduction;
36
40
  }
@@ -51,6 +55,11 @@
51
55
  justify-content: center;
52
56
  }
53
57
 
58
+ .lightVariant .titleRow {
59
+ background-color: $color-white;
60
+ margin-bottom: 3px; // needed to correctly position the active tab label :after element
61
+ }
62
+
54
63
  .adminVariant .titleRow {
55
64
  background-color: $color-white;
56
65
  margin-bottom: 3px; // needed to correctly position the active tab label :after element
@@ -73,6 +82,10 @@
73
82
  @extend %titleBlockInner;
74
83
  }
75
84
 
85
+ .lightVariant .titleRowInner {
86
+ border-bottom: 1px solid $color-gray-300;
87
+ }
88
+
76
89
  .rowBelowSeparatorInner {
77
90
  @extend %titleBlockInner;
78
91
  }
@@ -90,6 +103,7 @@
90
103
  border-bottom-color: rgba($color-purple-700-rgb, 0.2);
91
104
  }
92
105
 
106
+ .lightVariant &,
93
107
  .adminVariant &,
94
108
  .collapseNavigationArea & {
95
109
  border-bottom-color: transparent;
@@ -245,6 +259,10 @@
245
259
  max-width: 230px;
246
260
  margin-inline: var(--spacing-12) 0;
247
261
 
262
+ .lightVariant & {
263
+ color: $color-purple-800;
264
+ }
265
+
248
266
  .adminVariant & {
249
267
  color: $color-purple-800;
250
268
  }
@@ -438,6 +456,12 @@
438
456
  z-index: 1;
439
457
  }
440
458
 
459
+ .lightVariant & {
460
+ @include title-block-small {
461
+ background: linear-gradient(0deg, $color-gray-100, rgba($color-gray-100-rgb, 0));
462
+ }
463
+ }
464
+
441
465
  .adminVariant & {
442
466
  @include title-block-small {
443
467
  background: linear-gradient(0deg, $color-gray-100, rgba($color-gray-100-rgb, 0));
@@ -488,6 +512,7 @@
488
512
  // To be removed eventually – the Dropdown does not
489
513
  // currently set its own color, and we want it
490
514
  // to be Cluny like the default secondary buttons
515
+ .lightVariant &,
491
516
  .educationVariant &,
492
517
  .adminVariant & {
493
518
  color: $color-blue-500;
@@ -621,6 +646,7 @@
621
646
  .breadcrumbText {
622
647
  color: $color-white;
623
648
 
649
+ .lightVariant &,
624
650
  .educationVariant &,
625
651
  .adminVariant & {
626
652
  color: $color-purple-800;
@@ -654,6 +680,7 @@
654
680
  background-color: rgba($color-white-rgb, 0.1);
655
681
  }
656
682
 
683
+ .lightVariant &,
657
684
  .educationVariant &,
658
685
  .adminVariant & {
659
686
  color: $color-blue-500;
@@ -661,6 +688,8 @@
661
688
  border-width: $border-width;
662
689
  }
663
690
 
691
+ .lightVariant .breadcrumb:hover &,
692
+ .lightVariant .breadcrumb:focus &,
664
693
  .educationVariant .breadcrumb:hover &,
665
694
  .educationVariant .breadcrumb:focus &,
666
695
  .adminVariant .breadcrumb:hover &,
@@ -35,6 +35,10 @@ A consistent pattern to allow users to navigate and complete tasks easily.
35
35
 
36
36
  <Canvas of={TitleBlockStories.HasLongTitle} />
37
37
 
38
+ ### Light Variant
39
+
40
+ <Canvas of={TitleBlockStories.LightVariant} />
41
+
38
42
  ### Admin Variant
39
43
 
40
44
  <Canvas of={TitleBlockStories.AdminVariant} />
@@ -146,6 +146,47 @@ export const HasLongTitle: Story = {
146
146
  args: { title: 'A long title with over thirty characters' },
147
147
  }
148
148
 
149
+ export const LightVariant: Story = {
150
+ parameters: {
151
+ docs: {
152
+ canvas: {
153
+ sourceState: 'shown',
154
+ },
155
+ },
156
+ viewport: {
157
+ viewports: {
158
+ default: {
159
+ name: 'Above or equal to 1366',
160
+ styles: { width: '1366px', height: '800px' },
161
+ type: 'desktop',
162
+ },
163
+ under1366: {
164
+ name: 'Under 1366',
165
+ styles: { width: '1365px', height: '800px' },
166
+ type: 'desktop',
167
+ },
168
+ },
169
+ defaultViewport: 'default',
170
+ },
171
+ chromatic: {
172
+ disable: false,
173
+ viewports: [1365, 1366],
174
+ },
175
+ },
176
+ args: {
177
+ variant: 'light',
178
+ title: 'Light TitleBlock',
179
+ navigationTabs: [
180
+ <NavigationTab key="1" variant="light" text="Label" href="#" active />,
181
+ <NavigationTab key="2" variant="light" text="Label" href="#" />,
182
+ <NavigationTab key="3" variant="light" text="Label" href="#" />,
183
+ <NavigationTab key="4" variant="light" text="Label" href="#" />,
184
+ <NavigationTab key="5" variant="light" text="Label" href="#" />,
185
+ <NavigationTab key="6" variant="light" text="Label" href="#" />,
186
+ ],
187
+ },
188
+ }
189
+
149
190
  export const AdminVariant: Story = {
150
191
  parameters: {
151
192
  viewport: {
@@ -216,6 +257,73 @@ export const EducationVariant: Story = {
216
257
  },
217
258
  }
218
259
 
260
+ export const StickerSheetVariants: Story = {
261
+ name: 'Sticker Sheet (Variants)',
262
+ render: () => (
263
+ <StickerSheet title="TitleBlock Variants">
264
+ <StickerSheet.Row header="Default (Purple background)">
265
+ <TitleBlock
266
+ title="Default Variant"
267
+ subtitle="This is the default purple variant with white text"
268
+ breadcrumb={{
269
+ path: '#',
270
+ text: 'Back to home',
271
+ }}
272
+ navigationTabs={[
273
+ <NavigationTab key="1" text="Overview" href="#" active />,
274
+ <NavigationTab key="2" text="Settings" href="#" />,
275
+ ]}
276
+ />
277
+ </StickerSheet.Row>
278
+ <StickerSheet.Row header="Education (Purple background)">
279
+ <TitleBlock
280
+ variant="education"
281
+ title="Education Variant"
282
+ subtitle="This is the education variant with purple background"
283
+ breadcrumb={{
284
+ path: '#',
285
+ text: 'Back to courses',
286
+ }}
287
+ navigationTabs={[
288
+ <NavigationTab key="1" text="Lessons" href="#" active />,
289
+ <NavigationTab key="2" text="Assignments" href="#" />,
290
+ ]}
291
+ />
292
+ </StickerSheet.Row>
293
+ <StickerSheet.Row header="Admin (White background)">
294
+ <TitleBlock
295
+ variant="admin"
296
+ title="Admin Variant"
297
+ subtitle="This is the admin variant with white background"
298
+ breadcrumb={{
299
+ path: '#',
300
+ text: 'Back to dashboard',
301
+ }}
302
+ navigationTabs={[
303
+ <NavigationTab key="1" text="Users" href="#" active />,
304
+ <NavigationTab key="2" text="Settings" href="#" />,
305
+ ]}
306
+ />
307
+ </StickerSheet.Row>
308
+ <StickerSheet.Row header="Light (White background)">
309
+ <TitleBlock
310
+ variant="light"
311
+ title="Light Variant"
312
+ subtitle="This is the light variant with clean white background"
313
+ breadcrumb={{
314
+ path: '#',
315
+ text: 'Back to overview',
316
+ }}
317
+ navigationTabs={[
318
+ <NavigationTab key="1" text="Details" href="#" active />,
319
+ <NavigationTab key="2" text="Analytics" href="#" />,
320
+ ]}
321
+ />
322
+ </StickerSheet.Row>
323
+ </StickerSheet>
324
+ ),
325
+ }
326
+
219
327
  export const StickerSheetBreadcrumbs: Story = {
220
328
  name: 'Sticker Sheet (Breadcrumb)',
221
329
  parameters: {
@@ -3,6 +3,7 @@
3
3
  $dt-color-background-color-admin: $color-gray-100;
4
4
  $dt-color-background-color-eduction: $color-blue-100;
5
5
  $dt-color-background-color-default: $color-purple-600;
6
+ $dt-color-background-color-light: $color-white;
6
7
  $dt-color-background-gradient: linear-gradient(
7
8
  0deg,
8
9
  $color-purple-600,
@@ -157,7 +157,7 @@ export type SectionTitleRenderProps = Pick<
157
157
  | 'sectionTitleDescriptionAutomationId'
158
158
  >
159
159
 
160
- export type TitleBlockVariant = 'admin' | 'education' // the default is wisteria bg (AKA "reporting")
160
+ export type TitleBlockVariant = 'light' | 'admin' | 'education' // the default is wisteria bg (AKA "reporting")
161
161
 
162
162
  export type NavigationTabs = React.ReactElement<NavigationTabProps>[]
163
163
 
@@ -11,7 +11,7 @@ export const isMenuGroupNotButton = (
11
11
  value: (TitleBlockButtonProps | TitleBlockCustomButtonProps) | TitleBlockMenuGroup,
12
12
  ): value is TitleBlockMenuGroup => 'menuItems' in value
13
13
 
14
- export const NON_REVERSED_VARIANTS = ['education', 'admin']
14
+ export const NON_REVERSED_VARIANTS = ['light', 'education', 'admin']
15
15
 
16
16
  export const isReversed = (variant: TitleBlockVariant | undefined): boolean => {
17
17
  // The default variant (no variant prop) is reversed (dark background)
@@ -1,4 +1,5 @@
1
1
  // Not all utils are exported because most are intended for internal use only
2
2
  export * from './useMediaQueries'
3
+ export * from './useContainerQueries'
3
4
  export * from './hostedAssets'
4
5
  export * from './ReversedColors'