@carbon/web-components 2.55.0-rc.0 → 2.55.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.
Files changed (100) hide show
  1. package/custom-elements.json +133 -30
  2. package/es/components/button/button.d.ts.map +1 -1
  3. package/es/components/button/button.js +6 -4
  4. package/es/components/button/button.js.map +1 -1
  5. package/es/components/menu/menu-item.d.ts.map +1 -1
  6. package/es/components/menu/menu-item.js +3 -3
  7. package/es/components/menu/menu-item.js.map +1 -1
  8. package/es/components/multi-select/multi-select.d.ts +4 -0
  9. package/es/components/multi-select/multi-select.d.ts.map +1 -1
  10. package/es/components/multi-select/multi-select.js +4 -1
  11. package/es/components/multi-select/multi-select.js.map +1 -1
  12. package/es/components/overflow-menu/overflow-menu-item.d.ts.map +1 -1
  13. package/es/components/overflow-menu/overflow-menu-item.js +4 -3
  14. package/es/components/overflow-menu/overflow-menu-item.js.map +1 -1
  15. package/es/components/tabs/defs.d.ts +26 -0
  16. package/es/components/tabs/defs.d.ts.map +1 -1
  17. package/es/components/tabs/defs.js +28 -1
  18. package/es/components/tabs/defs.js.map +1 -1
  19. package/es/components/tabs/index.d.ts +1 -0
  20. package/es/components/tabs/index.d.ts.map +1 -1
  21. package/es/components/tabs/index.js +1 -0
  22. package/es/components/tabs/stories/tabs-wrapper.d.ts +5 -0
  23. package/es/components/tabs/stories/tabs-wrapper.d.ts.map +1 -1
  24. package/es/components/tabs/stories/tabs-wrapper.js +2 -0
  25. package/es/components/tabs/stories/tabs-wrapper.js.map +1 -1
  26. package/es/components/tabs/tab.d.ts +26 -0
  27. package/es/components/tabs/tab.d.ts.map +1 -1
  28. package/es/components/tabs/tab.js +41 -7
  29. package/es/components/tabs/tab.js.map +1 -1
  30. package/es/components/tabs/tabs-vertical.d.ts +29 -0
  31. package/es/components/tabs/tabs-vertical.d.ts.map +1 -0
  32. package/es/components/tabs/tabs-vertical.js +113 -0
  33. package/es/components/tabs/tabs-vertical.js.map +1 -0
  34. package/es/components/tabs/tabs.d.ts +22 -4
  35. package/es/components/tabs/tabs.d.ts.map +1 -1
  36. package/es/components/tabs/tabs.js +50 -9
  37. package/es/components/tabs/tabs.js.map +1 -1
  38. package/es/components/tabs/tabs.scss.js +1 -1
  39. package/es/components/tabs/tabs.scss.js.map +1 -1
  40. package/es-custom/components/button/button.d.ts.map +1 -1
  41. package/es-custom/components/button/button.js +6 -4
  42. package/es-custom/components/button/button.js.map +1 -1
  43. package/es-custom/components/menu/menu-item.d.ts.map +1 -1
  44. package/es-custom/components/menu/menu-item.js +3 -3
  45. package/es-custom/components/menu/menu-item.js.map +1 -1
  46. package/es-custom/components/multi-select/multi-select.d.ts +4 -0
  47. package/es-custom/components/multi-select/multi-select.d.ts.map +1 -1
  48. package/es-custom/components/multi-select/multi-select.js +4 -1
  49. package/es-custom/components/multi-select/multi-select.js.map +1 -1
  50. package/es-custom/components/overflow-menu/overflow-menu-item.d.ts.map +1 -1
  51. package/es-custom/components/overflow-menu/overflow-menu-item.js +4 -3
  52. package/es-custom/components/overflow-menu/overflow-menu-item.js.map +1 -1
  53. package/es-custom/components/tabs/defs.d.ts +26 -0
  54. package/es-custom/components/tabs/defs.d.ts.map +1 -1
  55. package/es-custom/components/tabs/defs.js +28 -1
  56. package/es-custom/components/tabs/defs.js.map +1 -1
  57. package/es-custom/components/tabs/index.d.ts +1 -0
  58. package/es-custom/components/tabs/index.d.ts.map +1 -1
  59. package/es-custom/components/tabs/index.js +1 -0
  60. package/es-custom/components/tabs/stories/tabs-wrapper.d.ts +5 -0
  61. package/es-custom/components/tabs/stories/tabs-wrapper.d.ts.map +1 -1
  62. package/es-custom/components/tabs/stories/tabs-wrapper.js +2 -0
  63. package/es-custom/components/tabs/stories/tabs-wrapper.js.map +1 -1
  64. package/es-custom/components/tabs/tab.d.ts +26 -0
  65. package/es-custom/components/tabs/tab.d.ts.map +1 -1
  66. package/es-custom/components/tabs/tab.js +41 -7
  67. package/es-custom/components/tabs/tab.js.map +1 -1
  68. package/es-custom/components/tabs/tabs-vertical.d.ts +29 -0
  69. package/es-custom/components/tabs/tabs-vertical.d.ts.map +1 -0
  70. package/es-custom/components/tabs/tabs-vertical.js +113 -0
  71. package/es-custom/components/tabs/tabs-vertical.js.map +1 -0
  72. package/es-custom/components/tabs/tabs.d.ts +22 -4
  73. package/es-custom/components/tabs/tabs.d.ts.map +1 -1
  74. package/es-custom/components/tabs/tabs.js +50 -9
  75. package/es-custom/components/tabs/tabs.js.map +1 -1
  76. package/es-custom/components/tabs/tabs.scss.js +1 -1
  77. package/es-custom/components/tabs/tabs.scss.js.map +1 -1
  78. package/lib/components/button/button.d.ts.map +1 -1
  79. package/lib/components/menu/menu-item.d.ts.map +1 -1
  80. package/lib/components/multi-select/multi-select.d.ts +4 -0
  81. package/lib/components/multi-select/multi-select.d.ts.map +1 -1
  82. package/lib/components/overflow-menu/overflow-menu-item.d.ts.map +1 -1
  83. package/lib/components/tabs/defs.d.ts +26 -0
  84. package/lib/components/tabs/defs.d.ts.map +1 -1
  85. package/lib/components/tabs/defs.js +29 -0
  86. package/lib/components/tabs/defs.js.map +1 -1
  87. package/lib/components/tabs/index.d.ts +1 -0
  88. package/lib/components/tabs/index.d.ts.map +1 -1
  89. package/lib/components/tabs/stories/tabs-wrapper.d.ts +5 -0
  90. package/lib/components/tabs/stories/tabs-wrapper.d.ts.map +1 -1
  91. package/lib/components/tabs/tab.d.ts +26 -0
  92. package/lib/components/tabs/tab.d.ts.map +1 -1
  93. package/lib/components/tabs/tabs-vertical.d.ts +29 -0
  94. package/lib/components/tabs/tabs-vertical.d.ts.map +1 -0
  95. package/lib/components/tabs/tabs.d.ts +22 -4
  96. package/lib/components/tabs/tabs.d.ts.map +1 -1
  97. package/package.json +7 -7
  98. package/scss/components/tabs/tabs-story.scss +5 -0
  99. package/scss/components/tabs/tabs.scss +168 -5
  100. package/telemetry.yml +2 -0
@@ -20,6 +20,7 @@
20
20
  @use '@carbon/styles/scss/utilities/layout';
21
21
  @use '@carbon/styles/scss/utilities/convert';
22
22
  @use '@carbon/styles/scss/utilities/skeleton' as *;
23
+ @use '@carbon/styles/scss/utilities/update_fields_on_layer' as *;
23
24
 
24
25
  $inset-transition: inset 110ms motion(standard, productive);
25
26
 
@@ -27,6 +28,7 @@ $inset-transition: inset 110ms motion(standard, productive);
27
28
  :host(#{$prefix}-tabs-skeleton) {
28
29
  @extend .#{$prefix}--tabs;
29
30
  @include emit-layout-tokens();
31
+
30
32
  .#{$prefix}--tabs-nav-content-container {
31
33
  position: relative;
32
34
  overflow: scroll;
@@ -264,6 +266,9 @@ $inset-transition: inset 110ms motion(standard, productive);
264
266
  outline: none;
265
267
  }
266
268
 
269
+ :host(#{$prefix}-tab:not([type='contained']):not([vertical])) {
270
+ margin-inline-end: convert.to-rem(1px);
271
+ }
267
272
  :host(#{$prefix}-tab:not([type='contained'])) {
268
273
  .#{$prefix}--tabs__nav-link {
269
274
  padding-block-end: calc(#{$spacing-03} + #{convert.to-rem(1px)});
@@ -271,10 +276,19 @@ $inset-transition: inset 110ms motion(standard, productive);
271
276
  }
272
277
  }
273
278
 
279
+ :host(#{$prefix}-tab:not([type='contained']):not([vertical]):last-of-type) {
280
+ margin-inline-end: 0;
281
+ }
274
282
  :host(#{$prefix}-tab:not([type='contained']))
275
283
  + :host(#{$prefix}-tab:not([type='contained'])) {
276
284
  margin-inline-start: convert.to-rem(1px);
277
285
  }
286
+ :host(#{$prefix}-tab[vertical]) {
287
+ .#{$prefix}--tabs__nav-link {
288
+ padding-block-end: $spacing-03;
289
+ padding-block-start: $spacing-03;
290
+ }
291
+ }
278
292
 
279
293
  :host(#{$prefix}-tab[badge-indicator][icon-only]:not([icon-size='lg']))
280
294
  #{$prefix}-badge-indicator,
@@ -368,7 +382,7 @@ $inset-transition: inset 110ms motion(standard, productive);
368
382
  }
369
383
  }
370
384
 
371
- :host(#{$prefix}-tab:hover:not([selected])) {
385
+ :host(#{$prefix}-tab:hover:not([selected]):not([vertical])) {
372
386
  background-color: transparent;
373
387
 
374
388
  a.#{$prefix}--tabs__nav-link {
@@ -384,7 +398,7 @@ $inset-transition: inset 110ms motion(standard, productive);
384
398
 
385
399
  :host(#{$prefix}-tabs[type='contained'])
386
400
  .#{$prefix}--tabs-nav-content-container {
387
- block-size: $spacing-09;
401
+ block-size: layout.size('height');
388
402
  }
389
403
 
390
404
  :host(#{$prefix}-tab[type='contained']) {
@@ -392,9 +406,9 @@ $inset-transition: inset 110ms motion(standard, productive);
392
406
 
393
407
  a.#{$prefix}--tabs__nav-link {
394
408
  padding: $spacing-03 $spacing-05;
395
- block-size: $spacing-09;
409
+ block-size: layout.size('height');
396
410
  // height - vertical padding
397
- line-height: calc(#{$spacing-09} - (#{$spacing-03} * 2));
411
+ line-height: calc(#{layout.size('height')} - (#{$spacing-03} * 2));
398
412
  }
399
413
  }
400
414
 
@@ -446,7 +460,7 @@ $inset-transition: inset 110ms motion(standard, productive);
446
460
  // Draws the border without affecting the inner-content
447
461
  box-shadow: inset 0 $spacing-01 0 0 $interactive;
448
462
  // height - vertical padding
449
- line-height: calc(#{$spacing-09} - (#{$spacing-03} * 2));
463
+ line-height: calc(#{layout.size('height')} - (#{$spacing-03} * 2));
450
464
  }
451
465
 
452
466
  .#{$prefix}--tabs__nav-link:focus,
@@ -559,6 +573,155 @@ $inset-transition: inset 110ms motion(standard, productive);
559
573
  }
560
574
  }
561
575
 
576
+ :host(#{$prefix}-tab[vertical]) .#{$prefix}--tabs__nav-link {
577
+ display: flex;
578
+ align-items: center;
579
+ border-block-end: 1px solid $border-subtle;
580
+ }
581
+
582
+ :host(#{$prefix}-tab[vertical][selected]) .#{$prefix}--tabs__nav-link {
583
+ border-block-end: 1px solid $border-subtle;
584
+ }
585
+
586
+ :host(#{$prefix}-tab[vertical][disabled]) .#{$prefix}--tabs__nav-link {
587
+ border-block-end: 1px solid $border-subtle;
588
+ }
589
+
590
+ //-----------------------------
591
+ // Vertical Tabs Wrapper
592
+ //-----------------------------
593
+
594
+ :host(#{$prefix}-tabs-vertical) {
595
+ @include emit-layout-tokens();
596
+ @include layout.use('density', $default: 'normal');
597
+
598
+ grid-column: span 2;
599
+ max-block-size: none;
600
+
601
+ &.#{$prefix}--css-grid {
602
+ box-shadow: inset -1px 0 $border-subtle;
603
+ }
604
+
605
+ ::slotted(#{$prefix}-tabs) {
606
+ grid-column: span 2;
607
+
608
+ @include breakpoint(lg) {
609
+ grid-column: span 4;
610
+ }
611
+ }
612
+
613
+ // Shadow-DOM wrapper for the panel slot — styled directly (no ::slotted needed)
614
+ .#{$prefix}-panel-container {
615
+ @include update_fields_on_layer;
616
+
617
+ background: $layer;
618
+ grid-column: 3 / -1;
619
+ overflow-y: auto;
620
+
621
+ @include breakpoint(lg) {
622
+ grid-column: 5 / -1;
623
+ }
624
+ }
625
+ }
626
+
627
+ // Slotted tab panel divs — match React's cds--tab-content styles
628
+ :host(#{$prefix}-tabs-vertical) ::slotted([role='tabpanel']) {
629
+ // stylelint-disable-next-line declaration-no-important
630
+ padding: layout.density('padding-inline') !important;
631
+ outline: none;
632
+ }
633
+
634
+ :host(#{$prefix}-tabs-vertical)
635
+ .panel-container
636
+ ::slotted([role='tabpanel']:focus) {
637
+ @include focus-outline('outline');
638
+ }
639
+
640
+ // cds-tabs when slotted inside cds-tabs-vertical (slot="tabs")
641
+ :host(#{$prefix}-tabs-vertical) ::slotted(#{$prefix}-tabs) {
642
+ background: $layer;
643
+ box-shadow: inset -1px 0 $border-subtle;
644
+ max-block-size: none;
645
+ }
646
+
647
+ // Internal styles for cds-tabs when inside cds-tabs-vertical
648
+ // These are applied via a CSS custom property / attribute set by the wrapper
649
+ :host(#{$prefix}-tabs[vertical]) {
650
+ .#{$prefix}--tabs-nav-content-container {
651
+ block-size: 100%;
652
+ overflow-x: hidden;
653
+ overflow-y: auto;
654
+ }
655
+
656
+ .#{$prefix}--tabs-nav-content {
657
+ position: relative;
658
+ block-size: 100%;
659
+ }
660
+
661
+ .#{$prefix}--tabs-nav {
662
+ position: relative;
663
+ }
664
+
665
+ .#{$prefix}--tab--list {
666
+ display: flex;
667
+ flex-direction: column;
668
+ }
669
+
670
+ .#{$prefix}--tab--overflow-nav-button {
671
+ display: none;
672
+ }
673
+
674
+ .#{$prefix}--tabs__nav-item-label {
675
+ display: -webkit-box;
676
+ overflow: hidden;
677
+ -webkit-box-orient: vertical;
678
+ -webkit-line-clamp: 2;
679
+ line-height: var(--cds-body-compact-01-line-height);
680
+ text-overflow: ellipsis;
681
+ white-space: normal;
682
+ }
683
+ }
684
+
685
+ :host(#{$prefix}-tab[vertical]) {
686
+ flex: none;
687
+ background-color: $layer-01;
688
+ block-size: $spacing-10;
689
+ border-inline-end: 1px solid $border-subtle;
690
+ box-shadow: inset 3px 0 0 0 $border-subtle;
691
+ inline-size: 100%;
692
+
693
+ .#{$prefix}--tabs__nav-item-label {
694
+ display: -webkit-box;
695
+ overflow: hidden;
696
+ -webkit-box-orient: vertical;
697
+ -webkit-line-clamp: 2;
698
+ line-height: var(--cds-body-compact-01-line-height);
699
+ text-overflow: ellipsis;
700
+ white-space: normal;
701
+ }
702
+ }
703
+
704
+ :host(#{$prefix}-tab[vertical][disabled]) {
705
+ border-inline-end: 1px solid $border-subtle;
706
+ box-shadow: inset 3px 0 0 0 $border-subtle;
707
+ }
708
+
709
+ :host(#{$prefix}-tab[vertical]:hover),
710
+ :host(#{$prefix}-tab[vertical][disabled]:hover) {
711
+ .#{$prefix}--tabs__nav-link {
712
+ border-block-end: 1px solid $border-subtle;
713
+ }
714
+ }
715
+
716
+ :host(#{$prefix}-tab[vertical][selected]) {
717
+ border-inline: none;
718
+ box-shadow: inset 3px 0 0 0 $border-interactive;
719
+ }
720
+
721
+ :host(#{$prefix}-tab[vertical]:not([selected]):not([disabled]):hover) {
722
+ background-color: $layer-hover;
723
+ box-shadow: inset 3px 0 0 0 $border-strong;
724
+ }
562
725
  :host(#{$prefix}-tab) {
563
726
  .#{$prefix}--tabs__nav-link--dismissable {
564
727
  display: flex;
package/telemetry.yml CHANGED
@@ -551,6 +551,8 @@ collect:
551
551
  - oncds-tabs-selected
552
552
  - selected-item-assistive-text
553
553
  - selecting-items-assistive-text
554
+ # cds-tabs-vertical
555
+ - custom-height
554
556
  # cds-tearsheet
555
557
  - has-close-icon
556
558
  - influencer-placement