@carbon-labs/react-ui-shell 0.41.0 → 0.43.0

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": "@carbon-labs/react-ui-shell",
3
- "version": "0.41.0",
3
+ "version": "0.43.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -41,5 +41,5 @@
41
41
  "dependencies": {
42
42
  "@ibm/telemetry-js": "^1.9.1"
43
43
  },
44
- "gitHead": "84c5f4054019f11741d1a7f4bd5b9725914bab87"
44
+ "gitHead": "ec6300a09920e5feccecc82262079791e56d821b"
45
45
  }
@@ -8,7 +8,9 @@
8
8
  @use '@carbon/styles/scss/utilities/convert' as convert;
9
9
  @use '@carbon/styles/scss/utilities/custom-property' as custom-property;
10
10
  @use '@carbon/styles/scss/utilities/button-reset' as button-reset;
11
+ @use '@carbon/react/scss/breakpoint' as breakpoint;
11
12
  @use '@carbon/styles/scss/utilities/focus-outline' as *;
13
+ @use '@carbon/styles/scss/breakpoint' as *;
12
14
  @use '@carbon/styles/scss/theme' as *;
13
15
  @use '@carbon/styles/scss/motion' as *;
14
16
  @use '@carbon/styles/scss/type' as *;
@@ -25,6 +27,10 @@ div:has(.#{$prefix}--header)
25
27
  inset-block-start: $spacing-09;
26
28
  }
27
29
 
30
+ .#{$prefix}--side-nav {
31
+ overflow: visible;
32
+ }
33
+
28
34
  //----------------------------------------------------------------------------
29
35
  // Side-nav Collapsible
30
36
  //----------------------------------------------------------------------------
@@ -90,12 +96,32 @@ div:has(.#{$prefix}--header)
90
96
  padding-inline-start: $spacing-10;
91
97
  }
92
98
 
99
+ .#{$prefix}--side-nav__item--primary
100
+ > .#{$prefix}--side-nav__submenu[aria-expanded='true']
101
+ .#{$prefix}--side-nav__submenu-chevron
102
+ > svg {
103
+ transform: none;
104
+ }
105
+
106
+ .#{$prefix}--side-nav__item--primary
107
+ > .#{$prefix}--side-nav__submenu[aria-expanded='true'] {
108
+ background-color: $background-selected;
109
+ color: $text-primary;
110
+ }
111
+
93
112
  // with icon
94
113
  .#{$prefix}--side-nav__item.#{$prefix}--side-nav__item--icon
95
114
  a.#{$prefix}--side-nav__link:has(.#{$prefix}--side-nav__icon) {
96
115
  padding-inline-start: $spacing-09;
97
116
  }
98
117
 
118
+ // with icon inside primary menu (double wide)
119
+ .#{$prefix}--side-nav__item.#{$prefix}--side-nav__item--icon
120
+ .cds--side-nav__menu-secondary-wrapper
121
+ a.#{$prefix}--side-nav__link:has(.#{$prefix}--side-nav__icon) {
122
+ padding-inline-start: $spacing-05;
123
+ }
124
+
99
125
  // Level 3
100
126
  // without icon parent
101
127
  .#{$prefix}--side-nav__menu
@@ -111,6 +137,24 @@ div:has(.#{$prefix}--header)
111
137
  padding-inline-start: $spacing-12;
112
138
  }
113
139
 
140
+ .#{$prefix}--side-nav__menu-secondary-wrapper {
141
+ position: absolute;
142
+ background-color: $layer-01;
143
+ block-size: 100%;
144
+ inline-size: 0;
145
+ inset-block-start: 0;
146
+ inset-inline-start: 100%;
147
+ transform: translateX(-100%);
148
+ transition: color $duration-fast-02, background-color $duration-fast-02,
149
+ outline $duration-fast-02;
150
+ will-change: inline-size;
151
+ }
152
+
153
+ .#{$prefix}--side-nav__menu-secondary-wrapper-expanded {
154
+ inline-size: 16rem;
155
+ transform: translateX(0);
156
+ }
157
+
114
158
  //----------------------------------------------------------------------------
115
159
  // Side-nav Panel
116
160
  //----------------------------------------------------------------------------
@@ -354,6 +398,14 @@ div:has(.#{$prefix}--header)
354
398
  z-index: 7999; /* needs to be below header */
355
399
  }
356
400
 
401
+ @each $breakpoint in ('sm', 'md', 'lg', 'xlg', 'max') {
402
+ .#{$prefix}--side-nav--rail.#{$prefix}--side-nav--hide-rail-breakpoint-down-#{$breakpoint} {
403
+ @include breakpoint-down($breakpoint) {
404
+ display: none;
405
+ }
406
+ }
407
+ }
408
+
357
409
  // allow overlay to display at all breakpoints
358
410
  .#{$prefix}--side-nav__overlay-active {
359
411
  z-index: z('overlay');
@@ -364,3 +416,40 @@ div:has(.#{$prefix}--header)
364
416
  transition: opacity $transition-expansion $standard-easing,
365
417
  background-color $transition-expansion $standard-easing;
366
418
  }
419
+
420
+ // mobile
421
+ @include breakpoint.breakpoint-down(md) {
422
+ .#{$prefix}--side-nav--collapsible.#{$prefix}--side-nav--expanded {
423
+ inline-size: 100%;
424
+ max-inline-size: 100%;
425
+ }
426
+
427
+ .#{$prefix}--side-nav__menu-secondary-wrapper-expanded {
428
+ z-index: 1;
429
+ inline-size: 100%;
430
+ inset-inline-start: 0;
431
+ }
432
+
433
+ .#{$prefix}--side-nav__back-button.#{$prefix}--btn--ghost {
434
+ flex-direction: row-reverse;
435
+ justify-content: flex-end;
436
+ gap: 1rem;
437
+ inline-size: 100%;
438
+ max-inline-size: 100%;
439
+
440
+ &:focus {
441
+ box-shadow: inset 0 0 0 1px $focus;
442
+ }
443
+ }
444
+
445
+ .#{$prefix}--side-nav__back-button.#{$prefix}--btn--ghost:not([disabled]) {
446
+ svg {
447
+ align-self: center;
448
+ fill: $icon-interactive;
449
+ }
450
+
451
+ &:hover svg {
452
+ fill: $link-primary-hover;
453
+ }
454
+ }
455
+ }