@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
@@ -159,7 +159,7 @@
159
159
  "name": "danger-description",
160
160
  "description": "Specify the message read by screen readers for the danger button variants",
161
161
  "type": "string",
162
- "default": "\"danger\""
162
+ "default": "\"\""
163
163
  },
164
164
  {
165
165
  "name": "disabled",
@@ -301,7 +301,7 @@
301
301
  "attribute": "danger-description",
302
302
  "description": "Specify the message read by screen readers for the danger button variants",
303
303
  "type": "string",
304
- "default": "\"danger\""
304
+ "default": "\"\""
305
305
  },
306
306
  {
307
307
  "name": "disabled",
@@ -1055,7 +1055,7 @@
1055
1055
  "name": "danger-description",
1056
1056
  "description": "Specify the message read by screen readers for the danger button variants",
1057
1057
  "type": "string",
1058
- "default": "\"danger\""
1058
+ "default": "\"\""
1059
1059
  },
1060
1060
  {
1061
1061
  "name": "disabled",
@@ -1279,7 +1279,7 @@
1279
1279
  "attribute": "danger-description",
1280
1280
  "description": "Specify the message read by screen readers for the danger button variants",
1281
1281
  "type": "string",
1282
- "default": "\"danger\""
1282
+ "default": "\"\""
1283
1283
  },
1284
1284
  {
1285
1285
  "name": "disabled",
@@ -1527,7 +1527,7 @@
1527
1527
  "name": "danger-description",
1528
1528
  "description": "Specify the message read by screen readers for the danger button variants",
1529
1529
  "type": "string",
1530
- "default": "\"danger\""
1530
+ "default": "\"\""
1531
1531
  },
1532
1532
  {
1533
1533
  "name": "disabled",
@@ -1662,7 +1662,7 @@
1662
1662
  "attribute": "danger-description",
1663
1663
  "description": "Specify the message read by screen readers for the danger button variants",
1664
1664
  "type": "string",
1665
- "default": "\"danger\""
1665
+ "default": "\"\""
1666
1666
  },
1667
1667
  {
1668
1668
  "name": "disabled",
@@ -3630,7 +3630,7 @@
3630
3630
  "name": "danger-description",
3631
3631
  "description": "Specify the message read by screen readers for the danger button variants",
3632
3632
  "type": "string",
3633
- "default": "\"danger\""
3633
+ "default": "\"\""
3634
3634
  },
3635
3635
  {
3636
3636
  "name": "disabled",
@@ -3821,7 +3821,7 @@
3821
3821
  "attribute": "danger-description",
3822
3822
  "description": "Specify the message read by screen readers for the danger button variants",
3823
3823
  "type": "string",
3824
- "default": "\"danger\""
3824
+ "default": "\"\""
3825
3825
  },
3826
3826
  {
3827
3827
  "name": "disabled",
@@ -5810,7 +5810,7 @@
5810
5810
  "name": "danger-description",
5811
5811
  "description": "Specify the message read by screen readers for the danger button variants",
5812
5812
  "type": "string",
5813
- "default": "\"danger\""
5813
+ "default": "\"\""
5814
5814
  },
5815
5815
  {
5816
5816
  "name": "disabled",
@@ -5945,7 +5945,7 @@
5945
5945
  "attribute": "danger-description",
5946
5946
  "description": "Specify the message read by screen readers for the danger button variants",
5947
5947
  "type": "string",
5948
- "default": "\"danger\""
5948
+ "default": "\"\""
5949
5949
  },
5950
5950
  {
5951
5951
  "name": "disabled",
@@ -8167,6 +8167,12 @@
8167
8167
  {
8168
8168
  "name": "filterable"
8169
8169
  },
8170
+ {
8171
+ "name": "autocomplete",
8172
+ "description": "The native `autocomplete` attribute for the filterable input.",
8173
+ "type": "string",
8174
+ "default": "\"off\""
8175
+ },
8170
8176
  {
8171
8177
  "name": "clear-selection-label",
8172
8178
  "description": "The `aria-label` attribute for the icon to clear selection.",
@@ -8360,6 +8366,13 @@
8360
8366
  "name": "filterable",
8361
8367
  "attribute": "filterable"
8362
8368
  },
8369
+ {
8370
+ "name": "autocomplete",
8371
+ "attribute": "autocomplete",
8372
+ "description": "The native `autocomplete` attribute for the filterable input.",
8373
+ "type": "string",
8374
+ "default": "\"off\""
8375
+ },
8363
8376
  {
8364
8377
  "name": "clearSelectionLabel",
8365
8378
  "attribute": "clear-selection-label",
@@ -12276,7 +12289,7 @@
12276
12289
  "name": "danger-description",
12277
12290
  "description": "Specify the message read by screen readers for the danger button variants",
12278
12291
  "type": "string",
12279
- "default": "\"danger\""
12292
+ "default": "\"\""
12280
12293
  },
12281
12294
  {
12282
12295
  "name": "disabled",
@@ -12453,7 +12466,7 @@
12453
12466
  "attribute": "danger-description",
12454
12467
  "description": "Specify the message read by screen readers for the danger button variants",
12455
12468
  "type": "string",
12456
- "default": "\"danger\""
12469
+ "default": "\"\""
12457
12470
  },
12458
12471
  {
12459
12472
  "name": "disabled",
@@ -13559,7 +13572,7 @@
13559
13572
  "name": "danger-description",
13560
13573
  "description": "Specify the message read by screen readers for the danger menu item variant",
13561
13574
  "type": "string",
13562
- "default": "\"danger\""
13575
+ "default": "\"\""
13563
13576
  },
13564
13577
  {
13565
13578
  "name": "submenuOpen",
@@ -13616,7 +13629,7 @@
13616
13629
  "attribute": "danger-description",
13617
13630
  "description": "Specify the message read by screen readers for the danger menu item variant",
13618
13631
  "type": "string",
13619
- "default": "\"danger\""
13632
+ "default": "\"\""
13620
13633
  },
13621
13634
  {
13622
13635
  "name": "submenuOpen",
@@ -13755,7 +13768,7 @@
13755
13768
  "name": "danger-description",
13756
13769
  "description": "Specify the message read by screen readers for the danger button variants",
13757
13770
  "type": "string",
13758
- "default": "\"danger\""
13771
+ "default": "\"\""
13759
13772
  },
13760
13773
  {
13761
13774
  "name": "disabled",
@@ -13890,7 +13903,7 @@
13890
13903
  "attribute": "danger-description",
13891
13904
  "description": "Specify the message read by screen readers for the danger button variants",
13892
13905
  "type": "string",
13893
- "default": "\"danger\""
13906
+ "default": "\"\""
13894
13907
  },
13895
13908
  {
13896
13909
  "name": "disabled",
@@ -14455,6 +14468,12 @@
14455
14468
  {
14456
14469
  "name": "filterable"
14457
14470
  },
14471
+ {
14472
+ "name": "autocomplete",
14473
+ "description": "The native `autocomplete` attribute for the filterable input.",
14474
+ "type": "string",
14475
+ "default": "\"off\""
14476
+ },
14458
14477
  {
14459
14478
  "name": "clear-selection-label",
14460
14479
  "description": "The `aria-label` attribute for the icon to clear selection.",
@@ -14641,6 +14660,13 @@
14641
14660
  "name": "filterable",
14642
14661
  "attribute": "filterable"
14643
14662
  },
14663
+ {
14664
+ "name": "autocomplete",
14665
+ "attribute": "autocomplete",
14666
+ "description": "The native `autocomplete` attribute for the filterable input.",
14667
+ "type": "string",
14668
+ "default": "\"off\""
14669
+ },
14644
14670
  {
14645
14671
  "name": "clearSelectionLabel",
14646
14672
  "attribute": "clear-selection-label",
@@ -14972,7 +14998,7 @@
14972
14998
  "name": "danger-description",
14973
14999
  "description": "Specify the message read by screen readers for the danger button variants",
14974
15000
  "type": "string",
14975
- "default": "\"danger\""
15001
+ "default": "\"\""
14976
15002
  },
14977
15003
  {
14978
15004
  "name": "disabled",
@@ -15107,7 +15133,7 @@
15107
15133
  "attribute": "danger-description",
15108
15134
  "description": "Specify the message read by screen readers for the danger button variants",
15109
15135
  "type": "string",
15110
- "default": "\"danger\""
15136
+ "default": "\"\""
15111
15137
  },
15112
15138
  {
15113
15139
  "name": "disabled",
@@ -16692,7 +16718,7 @@
16692
16718
  "name": "danger-description",
16693
16719
  "description": "Specify the message read by screen readers for the danger over flow menu item variant",
16694
16720
  "type": "string",
16695
- "default": "\"danger\""
16721
+ "default": "\"\""
16696
16722
  },
16697
16723
  {
16698
16724
  "name": "disabled",
@@ -16732,7 +16758,7 @@
16732
16758
  "attribute": "danger-description",
16733
16759
  "description": "Specify the message read by screen readers for the danger over flow menu item variant",
16734
16760
  "type": "string",
16735
- "default": "\"danger\""
16761
+ "default": "\"\""
16736
16762
  },
16737
16763
  {
16738
16764
  "name": "disabled",
@@ -16876,7 +16902,7 @@
16876
16902
  "name": "danger-description",
16877
16903
  "description": "Specify the message read by screen readers for the danger button variants",
16878
16904
  "type": "string",
16879
- "default": "\"danger\""
16905
+ "default": "\"\""
16880
16906
  },
16881
16907
  {
16882
16908
  "name": "disabled",
@@ -17100,7 +17126,7 @@
17100
17126
  "attribute": "danger-description",
17101
17127
  "description": "Specify the message read by screen readers for the danger button variants",
17102
17128
  "type": "string",
17103
- "default": "\"danger\""
17129
+ "default": "\"\""
17104
17130
  },
17105
17131
  {
17106
17132
  "name": "disabled",
@@ -20856,7 +20882,7 @@
20856
20882
  "name": "danger-description",
20857
20883
  "description": "Specify the message read by screen readers for the danger button variants",
20858
20884
  "type": "string",
20859
- "default": "\"danger\""
20885
+ "default": "\"\""
20860
20886
  },
20861
20887
  {
20862
20888
  "name": "disabled",
@@ -20998,7 +21024,7 @@
20998
21024
  "attribute": "danger-description",
20999
21025
  "description": "Specify the message read by screen readers for the danger button variants",
21000
21026
  "type": "string",
21001
- "default": "\"danger\""
21027
+ "default": "\"\""
21002
21028
  },
21003
21029
  {
21004
21030
  "name": "disabled",
@@ -21628,6 +21654,11 @@
21628
21654
  "description": "Selected index for the initially selected content",
21629
21655
  "type": "number",
21630
21656
  "default": "0"
21657
+ },
21658
+ {
21659
+ "name": "size",
21660
+ "description": "Size of the tabs",
21661
+ "type": "TABS_SIZE | undefined"
21631
21662
  }
21632
21663
  ],
21633
21664
  "properties": [
@@ -21672,6 +21703,12 @@
21672
21703
  "description": "Selected index for the initially selected content",
21673
21704
  "type": "number",
21674
21705
  "default": "0"
21706
+ },
21707
+ {
21708
+ "name": "size",
21709
+ "attribute": "size",
21710
+ "description": "Size of the tabs",
21711
+ "type": "TABS_SIZE | undefined"
21675
21712
  }
21676
21713
  ]
21677
21714
  },
@@ -21697,6 +21734,12 @@
21697
21734
  "type": "TABS_TYPE",
21698
21735
  "default": "\"\""
21699
21736
  },
21737
+ {
21738
+ "name": "vertical",
21739
+ "description": "`true` if the tab is in vertical orientation.\nThis is automatically set by the parent `<cds-tabs>` when it's in vertical mode.",
21740
+ "type": "boolean",
21741
+ "default": "false"
21742
+ },
21700
21743
  {
21701
21744
  "name": "icon-only",
21702
21745
  "description": "`true` if this tab is icon-only.",
@@ -21767,6 +21810,13 @@
21767
21810
  "type": "TABS_TYPE",
21768
21811
  "default": "\"\""
21769
21812
  },
21813
+ {
21814
+ "name": "vertical",
21815
+ "attribute": "vertical",
21816
+ "description": "`true` if the tab is in vertical orientation.\nThis is automatically set by the parent `<cds-tabs>` when it's in vertical mode.",
21817
+ "type": "boolean",
21818
+ "default": "false"
21819
+ },
21770
21820
  {
21771
21821
  "name": "iconOnly",
21772
21822
  "attribute": "icon-only",
@@ -21798,6 +21848,12 @@
21798
21848
  "type": "boolean",
21799
21849
  "default": "false"
21800
21850
  },
21851
+ {
21852
+ "name": "truncated",
21853
+ "description": "`true` if the tab text is truncated with ellipsis.\nThis state is automatically updated when the component renders in vertical mode.",
21854
+ "type": "boolean",
21855
+ "default": "false"
21856
+ },
21801
21857
  {
21802
21858
  "name": "disabled",
21803
21859
  "attribute": "disabled",
@@ -21898,6 +21954,40 @@
21898
21954
  }
21899
21955
  ]
21900
21956
  },
21957
+ {
21958
+ "name": "cds-tabs-vertical",
21959
+ "path": "./src/components/tabs/tabs-vertical.ts",
21960
+ "description": "Vertical tabs container component.",
21961
+ "attributes": [
21962
+ {
21963
+ "name": "custom-height",
21964
+ "description": "Option to set a height style only if using vertical variation.",
21965
+ "type": "string | undefined"
21966
+ }
21967
+ ],
21968
+ "properties": [
21969
+ {
21970
+ "name": "customHeight",
21971
+ "attribute": "custom-height",
21972
+ "description": "Option to set a height style only if using vertical variation.",
21973
+ "type": "string | undefined"
21974
+ },
21975
+ {
21976
+ "name": "styles",
21977
+ "default": "\"styles\""
21978
+ }
21979
+ ],
21980
+ "slots": [
21981
+ {
21982
+ "name": "tabs",
21983
+ "description": "The `<cds-tabs>` navigation element."
21984
+ },
21985
+ {
21986
+ "name": "panel",
21987
+ "description": "One or more `<div role=\"tabpanel\">` elements."
21988
+ }
21989
+ ]
21990
+ },
21901
21991
  {
21902
21992
  "name": "cds-tabs",
21903
21993
  "path": "./src/components/tabs/tabs.ts",
@@ -21927,6 +22017,12 @@
21927
22017
  "type": "TABS_TYPE",
21928
22018
  "default": "\"\""
21929
22019
  },
22020
+ {
22021
+ "name": "vertical",
22022
+ "description": "`true` if the tabs are in vertical orientation.\nThis is automatically set by `cds-tabs-vertical`.",
22023
+ "type": "boolean",
22024
+ "default": "false"
22025
+ },
21930
22026
  {
21931
22027
  "name": "dismissable",
21932
22028
  "description": "Whether the rendered Tab children should be dismissable."
@@ -21962,8 +22058,8 @@
21962
22058
  },
21963
22059
  {
21964
22060
  "name": "size",
21965
- "description": "Content switcher size.",
21966
- "type": "CONTENT_SWITCHER_SIZE",
22061
+ "description": "Specify the size of contained tabs.",
22062
+ "type": "TABS_SIZE | undefined",
21967
22063
  "default": "\"\""
21968
22064
  },
21969
22065
  {
@@ -22008,6 +22104,13 @@
22008
22104
  "type": "TABS_TYPE",
22009
22105
  "default": "\"\""
22010
22106
  },
22107
+ {
22108
+ "name": "vertical",
22109
+ "attribute": "vertical",
22110
+ "description": "`true` if the tabs are in vertical orientation.\nThis is automatically set by `cds-tabs-vertical`.",
22111
+ "type": "boolean",
22112
+ "default": "false"
22113
+ },
22011
22114
  {
22012
22115
  "name": "dismissable",
22013
22116
  "attribute": "dismissable",
@@ -22056,8 +22159,8 @@
22056
22159
  {
22057
22160
  "name": "size",
22058
22161
  "attribute": "size",
22059
- "description": "Content switcher size.",
22060
- "type": "CONTENT_SWITCHER_SIZE",
22162
+ "description": "Specify the size of contained tabs.",
22163
+ "type": "TABS_SIZE | undefined",
22061
22164
  "default": "\"\""
22062
22165
  },
22063
22166
  {
@@ -25803,7 +25906,7 @@
25803
25906
  "name": "danger-description",
25804
25907
  "description": "Specify the message read by screen readers for the danger button variants",
25805
25908
  "type": "string",
25806
- "default": "\"danger\""
25909
+ "default": "\"\""
25807
25910
  },
25808
25911
  {
25809
25912
  "name": "disabled",
@@ -25958,7 +26061,7 @@
25958
26061
  "attribute": "danger-description",
25959
26062
  "description": "Specify the message read by screen readers for the danger button variants",
25960
26063
  "type": "string",
25961
- "default": "\"danger\""
26064
+ "default": "\"\""
25962
26065
  },
25963
26066
  {
25964
26067
  "name": "disabled",
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,QAAQ,CAAC;AAMhB,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX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MAAM,CAAC;IAElB;;OAEG;IAEH,YAAY,UAAS;IAErB;;OAEG;IAEH,UAAU,UAAS;IAEnB;;OAEG;IAEH,IAAI,cAAuB;IAE3B;;OAEG;IAEH,QAAQ,SAAY;IAEpB;;OAEG;IAEH,WAAW,UAAS;IAEpB;;OAEG;IAEH,IAAI,EAAG,MAAM,CAAC;IAEd;;OAEG;IAEH,GAAG,EAAG,MAAM,CAAC;IAEb;;OAEG;IAEH,IAAI,SAAQ;IAEZ;;OAEG;IAEH,QAAQ,SAAK;IAEb;;OAEG;IAEH,MAAM,EAAG,MAAM,CAAC;IAEhB;;;OAGG;IAEH,gBAAgB,2BAAmC;IAEnD;;;OAGG;IAEH,eAAe,0BAA+B;IAE9C;;;OAGG;IAEH,WAAW,EAAG,MAAM,CAAC;IAErB;;OAEG;IAEH,IAAI,cAAsB;IAE1B,MAAM;IA8JN,MAAM,CAAC,iBAAiB;;;;;;;MAGtB;IACF,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,SAAS,CAAC"}
@@ -48,7 +48,7 @@ let CDSButton = class CDSButton extends HostListenerMixin(FocusMixin(LitElement)
48
48
  };
49
49
  this.autofocus = false;
50
50
  this.batchAction = false;
51
- this.dangerDescription = "danger";
51
+ this.dangerDescription = "";
52
52
  this.disabled = false;
53
53
  this.hasMainContent = false;
54
54
  this.isExpressive = false;
@@ -108,7 +108,7 @@ let CDSButton = class CDSButton extends HostListenerMixin(FocusMixin(LitElement)
108
108
  };
109
109
  }
110
110
  const classes = classMap(defaultClasses);
111
- const isDanger = kind?.includes("danger");
111
+ const hasDangerDescription = kind?.includes("danger") && Boolean(dangerDescription);
112
112
  if (href) return disabled ? html`
113
113
  <p id="button" part="button" class="${classes}">
114
114
  <slot @slotchange="${handleSlotChange}"></slot>
@@ -178,8 +178,10 @@ let CDSButton = class CDSButton extends HostListenerMixin(FocusMixin(LitElement)
178
178
  tabindex="${tabIndex}"
179
179
  type="${ifDefined(type)}"
180
180
  aria-label="${ifDefined(tooltipText)}"
181
- aria-describedby="badge-indicator">
182
- ${isDanger ? html`<span class="${"cds"}--visually-hidden"
181
+ aria-describedby="${ifDefined(hasDangerDescription ? "danger-description" : void 0)}">
182
+ ${hasDangerDescription ? html`<span
183
+ id="danger-description"
184
+ class="${"cds"}--visually-hidden"
183
185
  >${dangerDescription}</span
184
186
  >` : ``}
185
187
  <slot @slotchange="${handleSlotChange}"></slot>
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":["styles","customElement"],"sources":["../../../src/components/button/button.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport {\n BUTTON_KIND,\n BUTTON_TYPE,\n BUTTON_SIZE,\n BUTTON_TOOLTIP_ALIGNMENT,\n BUTTON_TOOLTIP_POSITION,\n} from './defs';\nimport styles from './button.scss?lit';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport {\n BUTTON_KIND,\n BUTTON_TYPE,\n BUTTON_SIZE,\n BUTTON_TOOLTIP_ALIGNMENT,\n BUTTON_TOOLTIP_POSITION,\n};\n\n/**\n * Button.\n *\n * @element cds-button\n * @csspart button The button.\n */\n@customElement(`${prefix}-button`)\nclass CDSButton extends HostListenerMixin(FocusMixin(LitElement)) {\n /**\n * `true` if there is an icon.\n */\n private _hasIcon = false;\n\n /**\n * Handles `slotchange` event.\n */\n private _handleSlotChange({ target }: Event) {\n const { name } = target as HTMLSlotElement;\n const hasContent = (target as HTMLSlotElement).assignedNodes().some(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n this[name === 'icon' ? '_hasIcon' : 'hasMainContent'] = hasContent;\n this.requestUpdate();\n }\n\n @HostListener('click', { capture: true })\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore\n private _handleDisabledClick(event: Event) {\n const { disabled } = this;\n if (disabled) {\n event.stopPropagation();\n }\n }\n\n private _checkBadgeWarning() {\n const hasBadgeIndicator = this.querySelector(`${prefix}-badge-indicator`);\n if (\n hasBadgeIndicator &&\n (this.kind !== BUTTON_KIND.GHOST || this.size !== BUTTON_SIZE.LARGE)\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `The badge indicator must be used with kind='ghost' and size='lg'`\n );\n }\n }\n updated(changedProperties) {\n super.updated?.(changedProperties);\n this._checkBadgeWarning();\n }\n\n @HostListener('mouseover')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleOver = () => {\n this.openTooltip = true;\n };\n\n /**\n * Handles `keydown` event on this element.\n */\n @HostListener('mouseout')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleHoverOut = async () => {\n this.openTooltip = false;\n };\n\n /**\n * Handles `keydown` event on this element.\n * Space & enter will toggle state, Escape will only close.\n */\n @HostListener('focus')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleFocus = async () => {\n this.openTooltip = true;\n };\n\n /**\n * Handles `keydown` event on this element.\n * Space & enter will toggle state, Escape will only close.\n */\n @HostListener('focusout')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleFocusout = async () => {\n this.openTooltip = false;\n };\n\n /**\n * `true` if the button should have input focus when the page loads.\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * `true` if the button is being used within a data table batch action toolbar\n */\n @property({ type: Boolean, reflect: true, attribute: 'batch-action' })\n batchAction = false;\n\n /**\n * Specify an optional className to be added to your Button\n */\n @property({ type: String, reflect: true, attribute: 'button-class-name' })\n buttonClassName;\n\n /**\n * Specify the message read by screen readers for the danger button variants\n */\n @property({ type: String, reflect: true, attribute: 'danger-description' })\n dangerDescription = 'danger';\n\n /**\n * Specify whether the Button should be disabled, or not\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The default file name, used if this button is rendered as `<a>`.\n */\n @property({ type: String, reflect: true })\n download!: string;\n\n /**\n * `true` if there is a non-icon content.\n */\n @property({ reflect: true, attribute: 'has-main-content', type: Boolean })\n hasMainContent = false;\n\n /**\n * Optionally specify an href for your Button to become an `<a>` element\n */\n @property({ type: String, reflect: true })\n href!: string;\n\n /**\n * The language of what `href` points to, if this button is rendered as `<a>`.\n */\n @property({ type: String, reflect: true })\n hreflang!: string;\n\n /**\n * Specify whether the Button is expressive, or not.\n */\n @property({ type: Boolean, reflect: true })\n isExpressive = false;\n\n /**\n * Specify whether the Button is currently selected. Only applies to the icon only Ghost variant.\n */\n @property({ type: Boolean, reflect: true })\n isSelected = false;\n\n /**\n * Specify the kind of Button you want to create. `primary`, `secondary`,`tertiary`, `ghost`, `danger`, `danger-tertiary`, `danger-ghost`\n */\n @property({ type: String, reflect: true })\n kind = BUTTON_KIND.PRIMARY;\n\n /**\n * The a11y role for `<a>`.\n */\n @property({ type: String, attribute: 'link-role' })\n linkRole = 'button';\n\n /**\n * Boolean to determine if tooltip is open.\n */\n @property({ type: Boolean })\n openTooltip = false;\n\n /**\n * URLs to ping, if this button is rendered as `<a>`.\n */\n @property({ type: String, reflect: true })\n ping!: string;\n\n /**\n * Optionally specify a `rel` when using an `<a>` element.\n */\n @property({ type: String, reflect: true })\n rel!: string;\n\n /**\n * Specify the size of the button, from the following list of sizes: `xs`, `sm`, `md`, `lg`, `xl`, `2xl`\n */\n @property({ type: String, reflect: true })\n size = 'lg';\n\n /**\n * Optional prop to specify the tabIndex of the Button\n */\n @property({ type: Number, attribute: 'tab-index', reflect: true })\n tabIndex = 0;\n\n /**\n * Optionally specify a `target` when using an `<a>` element.\n */\n @property({ type: String, reflect: true })\n target!: string;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property({ type: String, reflect: true, attribute: 'tooltip-alignment' })\n tooltipAlignment = BUTTON_TOOLTIP_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property({ type: String, reflect: true, attribute: 'tooltip-position' })\n tooltipPosition = BUTTON_TOOLTIP_POSITION.TOP;\n\n /**\n * If rendering an `icon-only` button through `slot=\"icon\"`, Specify the text to be rendered in the tooltip. If using\n * `cds-badge-indicator` with no count prop then the text should include describing there is a new notification.\n */\n @property({ type: String, reflect: true, attribute: 'tooltip-text' })\n tooltipText!: string;\n\n /**\n * Optional prop to specify the type of the Button.\n */\n @property({ type: String, reflect: true })\n type = BUTTON_TYPE.BUTTON;\n\n render() {\n const {\n autofocus,\n buttonClassName,\n dangerDescription,\n disabled,\n download,\n href,\n hreflang,\n kind,\n isExpressive,\n isSelected,\n linkRole,\n openTooltip,\n ping,\n rel,\n size,\n tabIndex,\n target,\n tooltipAlignment,\n tooltipPosition,\n tooltipText,\n type,\n _hasIcon: hasIcon,\n hasMainContent,\n _handleSlotChange: handleSlotChange,\n } = this;\n\n let defaultClasses = {\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--${kind}`]: kind,\n [`${prefix}--btn--danger--tertiary`]:\n kind === BUTTON_KIND.DANGER_TERTIARY,\n [`${prefix}--btn--danger--ghost`]: kind === BUTTON_KIND.DANGER_GHOST,\n [`${prefix}--btn--disabled`]: disabled,\n [`${prefix}--btn--icon-only`]: hasIcon && !hasMainContent,\n [`${prefix}--btn--${size}`]: size,\n [`${prefix}--layout--size-${size}`]: size,\n [`${prefix}-ce--btn--has-icon`]: hasIcon,\n [`${prefix}--btn--expressive`]: isExpressive,\n [`${prefix}--btn--selected`]: isSelected && kind === 'ghost',\n };\n\n if (buttonClassName) {\n const outputObject = {};\n buttonClassName?.split(' ').forEach((element) => {\n outputObject[element] = true;\n });\n defaultClasses = { ...defaultClasses, ...outputObject };\n }\n const classes = classMap(defaultClasses);\n\n const isDanger = kind?.includes('danger');\n\n if (href) {\n return disabled\n ? html`\n <p id=\"button\" part=\"button\" class=\"${classes}\">\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </p>\n `\n : html`\n <a\n id=\"button\"\n part=\"button\"\n role=\"${ifDefined(linkRole)}\"\n class=\"${classes}\"\n download=\"${ifDefined(download)}\"\n href=\"${ifDefined(href)}\"\n hreflang=\"${ifDefined(hreflang)}\"\n ping=\"${ifDefined(ping)}\"\n rel=\"${ifDefined(rel)}\"\n target=\"${ifDefined(target)}\"\n type=\"${ifDefined(type)}\"\n tabindex=\"${tabIndex}\"\n aria-describedby=\"badge-indicator\">\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </a>\n ${html`<slot id=\"badge-indicator\" name=\"badge-indicator\"></slot>` ??\n !disabled}\n `;\n }\n\n const alignmentClass =\n tooltipAlignment &&\n (tooltipPosition === BUTTON_TOOLTIP_POSITION.TOP ||\n tooltipPosition === BUTTON_TOOLTIP_POSITION.BOTTOM)\n ? `-${tooltipAlignment}`\n : '';\n\n const tooltipClasses = classMap({\n [`${prefix}--popover-container`]: true,\n [`${prefix}--popover--caret`]: true,\n [`${prefix}--popover--high-contrast`]: true,\n [`${prefix}--tooltip`]: true,\n [`${prefix}--icon-tooltip`]: hasIcon,\n [`${prefix}--popover--open`]: openTooltip,\n [`${prefix}--popover--${tooltipPosition}${alignmentClass}`]: tooltipText,\n });\n\n return tooltipText && !disabled\n ? html`\n <span class=\"${tooltipClasses}\">\n <button\n id=\"button\"\n part=\"button\"\n class=\"${classes}\"\n ?autofocus=\"${autofocus}\"\n ?disabled=\"${disabled}\"\n tabindex=\"${tabIndex}\"\n type=\"${ifDefined(type)}\"\n aria-label=\"${ifDefined(tooltipText)}\"\n aria-describedby=\"badge-indicator\">\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </button>\n <span class=\"${prefix}--popover\">\n <span\n class=\"${prefix}--popover-content ${prefix}--tooltip-content\">\n ${tooltipText}\n </span>\n <span class=\"${prefix}--popover-caret\"></span>\n </span>\n ${html`<slot id=\"badge-indicator\" name=\"badge-indicator\"></slot>` ??\n !disabled}\n </span>\n `\n : html`\n <button\n id=\"button\"\n part=\"button\"\n class=\"${classes}\"\n ?autofocus=\"${autofocus}\"\n ?disabled=\"${disabled}\"\n tabindex=\"${tabIndex}\"\n type=\"${ifDefined(type)}\"\n aria-label=\"${ifDefined(tooltipText)}\"\n aria-describedby=\"badge-indicator\">\n ${isDanger\n ? html`<span class=\"${prefix}--visually-hidden\"\n >${dangerDescription}</span\n >`\n : ``}\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </button>\n ${html`<slot id=\"badge-indicator\" name=\"badge-indicator\"></slot>` ??\n !disabled}\n `;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAA,YAAA,MACM,kBAAkB,kBAAkB,WAAW,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,SAAS;CAAM,WAAW;CAAgB,CAAC,CAAA,EAAA,UAAA,WAAA,eAAA,KAAA,EAAA;YAMpE,SAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,UAAA,WAAA,QAAA,KAAA,EAAA;wBAhO3CC,cAAc,aAAmB,CAAA,EAAA,UAAA;AAmYlC,IAAA,iBAAe"}
1
+ {"version":3,"file":"button.js","names":["styles","customElement"],"sources":["../../../src/components/button/button.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport {\n BUTTON_KIND,\n BUTTON_TYPE,\n BUTTON_SIZE,\n BUTTON_TOOLTIP_ALIGNMENT,\n BUTTON_TOOLTIP_POSITION,\n} from './defs';\nimport styles from './button.scss?lit';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport {\n BUTTON_KIND,\n BUTTON_TYPE,\n BUTTON_SIZE,\n BUTTON_TOOLTIP_ALIGNMENT,\n BUTTON_TOOLTIP_POSITION,\n};\n\n/**\n * Button.\n *\n * @element cds-button\n * @csspart button The button.\n */\n@customElement(`${prefix}-button`)\nclass CDSButton extends HostListenerMixin(FocusMixin(LitElement)) {\n /**\n * `true` if there is an icon.\n */\n private _hasIcon = false;\n\n /**\n * Handles `slotchange` event.\n */\n private _handleSlotChange({ target }: Event) {\n const { name } = target as HTMLSlotElement;\n const hasContent = (target as HTMLSlotElement).assignedNodes().some(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n this[name === 'icon' ? '_hasIcon' : 'hasMainContent'] = hasContent;\n this.requestUpdate();\n }\n\n @HostListener('click', { capture: true })\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore\n private _handleDisabledClick(event: Event) {\n const { disabled } = this;\n if (disabled) {\n event.stopPropagation();\n }\n }\n\n private _checkBadgeWarning() {\n const hasBadgeIndicator = this.querySelector(`${prefix}-badge-indicator`);\n if (\n hasBadgeIndicator &&\n (this.kind !== BUTTON_KIND.GHOST || this.size !== BUTTON_SIZE.LARGE)\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `The badge indicator must be used with kind='ghost' and size='lg'`\n );\n }\n }\n updated(changedProperties) {\n super.updated?.(changedProperties);\n this._checkBadgeWarning();\n }\n\n @HostListener('mouseover')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleOver = () => {\n this.openTooltip = true;\n };\n\n /**\n * Handles `keydown` event on this element.\n */\n @HostListener('mouseout')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleHoverOut = async () => {\n this.openTooltip = false;\n };\n\n /**\n * Handles `keydown` event on this element.\n * Space & enter will toggle state, Escape will only close.\n */\n @HostListener('focus')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleFocus = async () => {\n this.openTooltip = true;\n };\n\n /**\n * Handles `keydown` event on this element.\n * Space & enter will toggle state, Escape will only close.\n */\n @HostListener('focusout')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleFocusout = async () => {\n this.openTooltip = false;\n };\n\n /**\n * `true` if the button should have input focus when the page loads.\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * `true` if the button is being used within a data table batch action toolbar\n */\n @property({ type: Boolean, reflect: true, attribute: 'batch-action' })\n batchAction = false;\n\n /**\n * Specify an optional className to be added to your Button\n */\n @property({ type: String, reflect: true, attribute: 'button-class-name' })\n buttonClassName;\n\n /**\n * Specify the message read by screen readers for the danger button variants\n */\n @property({ type: String, reflect: true, attribute: 'danger-description' })\n dangerDescription = '';\n\n /**\n * Specify whether the Button should be disabled, or not\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The default file name, used if this button is rendered as `<a>`.\n */\n @property({ type: String, reflect: true })\n download!: string;\n\n /**\n * `true` if there is a non-icon content.\n */\n @property({ reflect: true, attribute: 'has-main-content', type: Boolean })\n hasMainContent = false;\n\n /**\n * Optionally specify an href for your Button to become an `<a>` element\n */\n @property({ type: String, reflect: true })\n href!: string;\n\n /**\n * The language of what `href` points to, if this button is rendered as `<a>`.\n */\n @property({ type: String, reflect: true })\n hreflang!: string;\n\n /**\n * Specify whether the Button is expressive, or not.\n */\n @property({ type: Boolean, reflect: true })\n isExpressive = false;\n\n /**\n * Specify whether the Button is currently selected. Only applies to the icon only Ghost variant.\n */\n @property({ type: Boolean, reflect: true })\n isSelected = false;\n\n /**\n * Specify the kind of Button you want to create. `primary`, `secondary`,`tertiary`, `ghost`, `danger`, `danger-tertiary`, `danger-ghost`\n */\n @property({ type: String, reflect: true })\n kind = BUTTON_KIND.PRIMARY;\n\n /**\n * The a11y role for `<a>`.\n */\n @property({ type: String, attribute: 'link-role' })\n linkRole = 'button';\n\n /**\n * Boolean to determine if tooltip is open.\n */\n @property({ type: Boolean })\n openTooltip = false;\n\n /**\n * URLs to ping, if this button is rendered as `<a>`.\n */\n @property({ type: String, reflect: true })\n ping!: string;\n\n /**\n * Optionally specify a `rel` when using an `<a>` element.\n */\n @property({ type: String, reflect: true })\n rel!: string;\n\n /**\n * Specify the size of the button, from the following list of sizes: `xs`, `sm`, `md`, `lg`, `xl`, `2xl`\n */\n @property({ type: String, reflect: true })\n size = 'lg';\n\n /**\n * Optional prop to specify the tabIndex of the Button\n */\n @property({ type: Number, attribute: 'tab-index', reflect: true })\n tabIndex = 0;\n\n /**\n * Optionally specify a `target` when using an `<a>` element.\n */\n @property({ type: String, reflect: true })\n target!: string;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property({ type: String, reflect: true, attribute: 'tooltip-alignment' })\n tooltipAlignment = BUTTON_TOOLTIP_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property({ type: String, reflect: true, attribute: 'tooltip-position' })\n tooltipPosition = BUTTON_TOOLTIP_POSITION.TOP;\n\n /**\n * If rendering an `icon-only` button through `slot=\"icon\"`, Specify the text to be rendered in the tooltip. If using\n * `cds-badge-indicator` with no count prop then the text should include describing there is a new notification.\n */\n @property({ type: String, reflect: true, attribute: 'tooltip-text' })\n tooltipText!: string;\n\n /**\n * Optional prop to specify the type of the Button.\n */\n @property({ type: String, reflect: true })\n type = BUTTON_TYPE.BUTTON;\n\n render() {\n const {\n autofocus,\n buttonClassName,\n dangerDescription,\n disabled,\n download,\n href,\n hreflang,\n kind,\n isExpressive,\n isSelected,\n linkRole,\n openTooltip,\n ping,\n rel,\n size,\n tabIndex,\n target,\n tooltipAlignment,\n tooltipPosition,\n tooltipText,\n type,\n _hasIcon: hasIcon,\n hasMainContent,\n _handleSlotChange: handleSlotChange,\n } = this;\n\n let defaultClasses = {\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--${kind}`]: kind,\n [`${prefix}--btn--danger--tertiary`]:\n kind === BUTTON_KIND.DANGER_TERTIARY,\n [`${prefix}--btn--danger--ghost`]: kind === BUTTON_KIND.DANGER_GHOST,\n [`${prefix}--btn--disabled`]: disabled,\n [`${prefix}--btn--icon-only`]: hasIcon && !hasMainContent,\n [`${prefix}--btn--${size}`]: size,\n [`${prefix}--layout--size-${size}`]: size,\n [`${prefix}-ce--btn--has-icon`]: hasIcon,\n [`${prefix}--btn--expressive`]: isExpressive,\n [`${prefix}--btn--selected`]: isSelected && kind === 'ghost',\n };\n\n if (buttonClassName) {\n const outputObject = {};\n buttonClassName?.split(' ').forEach((element) => {\n outputObject[element] = true;\n });\n defaultClasses = { ...defaultClasses, ...outputObject };\n }\n const classes = classMap(defaultClasses);\n\n const isDanger = kind?.includes('danger');\n const hasDangerDescription = isDanger && Boolean(dangerDescription);\n\n if (href) {\n return disabled\n ? html`\n <p id=\"button\" part=\"button\" class=\"${classes}\">\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </p>\n `\n : html`\n <a\n id=\"button\"\n part=\"button\"\n role=\"${ifDefined(linkRole)}\"\n class=\"${classes}\"\n download=\"${ifDefined(download)}\"\n href=\"${ifDefined(href)}\"\n hreflang=\"${ifDefined(hreflang)}\"\n ping=\"${ifDefined(ping)}\"\n rel=\"${ifDefined(rel)}\"\n target=\"${ifDefined(target)}\"\n type=\"${ifDefined(type)}\"\n tabindex=\"${tabIndex}\"\n aria-describedby=\"badge-indicator\">\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </a>\n ${html`<slot id=\"badge-indicator\" name=\"badge-indicator\"></slot>` ??\n !disabled}\n `;\n }\n\n const alignmentClass =\n tooltipAlignment &&\n (tooltipPosition === BUTTON_TOOLTIP_POSITION.TOP ||\n tooltipPosition === BUTTON_TOOLTIP_POSITION.BOTTOM)\n ? `-${tooltipAlignment}`\n : '';\n\n const tooltipClasses = classMap({\n [`${prefix}--popover-container`]: true,\n [`${prefix}--popover--caret`]: true,\n [`${prefix}--popover--high-contrast`]: true,\n [`${prefix}--tooltip`]: true,\n [`${prefix}--icon-tooltip`]: hasIcon,\n [`${prefix}--popover--open`]: openTooltip,\n [`${prefix}--popover--${tooltipPosition}${alignmentClass}`]: tooltipText,\n });\n\n return tooltipText && !disabled\n ? html`\n <span class=\"${tooltipClasses}\">\n <button\n id=\"button\"\n part=\"button\"\n class=\"${classes}\"\n ?autofocus=\"${autofocus}\"\n ?disabled=\"${disabled}\"\n tabindex=\"${tabIndex}\"\n type=\"${ifDefined(type)}\"\n aria-label=\"${ifDefined(tooltipText)}\"\n aria-describedby=\"badge-indicator\">\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </button>\n <span class=\"${prefix}--popover\">\n <span\n class=\"${prefix}--popover-content ${prefix}--tooltip-content\">\n ${tooltipText}\n </span>\n <span class=\"${prefix}--popover-caret\"></span>\n </span>\n ${html`<slot id=\"badge-indicator\" name=\"badge-indicator\"></slot>` ??\n !disabled}\n </span>\n `\n : html`\n <button\n id=\"button\"\n part=\"button\"\n class=\"${classes}\"\n ?autofocus=\"${autofocus}\"\n ?disabled=\"${disabled}\"\n tabindex=\"${tabIndex}\"\n type=\"${ifDefined(type)}\"\n aria-label=\"${ifDefined(tooltipText)}\"\n aria-describedby=\"${ifDefined(\n hasDangerDescription ? 'danger-description' : undefined\n )}\">\n ${hasDangerDescription\n ? html`<span\n id=\"danger-description\"\n class=\"${prefix}--visually-hidden\"\n >${dangerDescription}</span\n >`\n : ``}\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </button>\n ${html`<slot id=\"badge-indicator\" name=\"badge-indicator\"></slot>` ??\n !disabled}\n `;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;IAEH,KAAK,MAAC;IACN;;OAEG;IAEH,QAAQ,MAAC;IACT;;OAEG;IAEH,QAAQ,MAAC;IAET;;OAEG;IAEH,iBAAiB,SAAM;IAEvB;;OAEG;IAEH,WAAW,UAAS;IAGpB,IAAI,iBAA0B;IAC9B;;OAEG;IAEH,UAAU,EAAE;QACV,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC7B,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC9B,CAAoB;IAGrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAA4C;IAEtE;;OAEG;IAEH,YAAY,MAAC;IACb;;OAEG;IAEH,KAAK,UAAS;IACd;;OAEG;IAEH,UAAU,UAAS;IAEb,kBAAkB;IAaxB,OAAO,CAAC,iBAAiB;IAwBzB,YAAY;IA2BZ,oBAAoB;IAIpB,OAAO,IAAI,IAAI;IAWf,WAAW,CAAC,KAAK,EAAE,UAAU;IAK7B,eAAe,CAAC,KAAK,EAAE,UAAU;IAOjC,gBAAgB;IAOhB,gBAAgB;IAOhB,aAAa,CAAC,KAAK,EAAE,aAAa;IAIlC,MAAM;IAwDN,YAAY,GAAI,GAAG,UAAU,GAAG,aAAa,KAAG,IAAI,CAwBlD;IACF,iBAAiB,aAIf;IACF,iBAAiB,aAMf;IACF,YAAY,aAcV;IACF,qBAAqB,aAkCnB;IACF,aAAa,aASX;IACF,cAAc,GAAI,GAAG,aAAa,UAUhC;IAEF,MAAM,CAAC,MAAM,MAAU;CACxB;AACD,eAAe,WAAW,CAAC"}
@@ -38,7 +38,7 @@ let CDSmenuItem = class CDSmenuItem extends HostListenerMixin(HostListenerMixin(
38
38
  super(..._args);
39
39
  this.hoverIntentDelay = 150;
40
40
  this._parentMenu = null;
41
- this.dangerDescription = "danger";
41
+ this.dangerDescription = "";
42
42
  this.submenuOpen = false;
43
43
  this.kind = "default";
44
44
  this.boundaries = {
@@ -207,7 +207,7 @@ let CDSmenuItem = class CDSmenuItem extends HostListenerMixin(HostListenerMixin(
207
207
  }
208
208
  render() {
209
209
  const { label, shortcut, submenuOpen, boundaries, isRtl, kind, dangerDescription } = this;
210
- const isDanger = kind === "danger" && !this.hasSubmenu;
210
+ const hasDangerDescription = kind === "danger" && !this.hasSubmenu && Boolean(dangerDescription);
211
211
  const menuClassName = this.context?.hasSelectableItems ? `cds--menu--with-selectable-items` : "";
212
212
  return html`
213
213
  <div class="${"cds"}--menu-item__selection-icon">
@@ -218,7 +218,7 @@ let CDSmenuItem = class CDSmenuItem extends HostListenerMixin(HostListenerMixin(
218
218
  <slot name="render-icon"></slot>
219
219
  </div>
220
220
  <div class="${"cds"}--menu-item__label">${label}</div>
221
- ${isDanger ? html`<span id="danger-description" class="${"cds"}--visually-hidden"
221
+ ${hasDangerDescription ? html`<span id="danger-description" class="${"cds"}--visually-hidden"
222
222
  >${dangerDescription}</span
223
223
  >` : html``}
224
224
  ${shortcut && !this.hasSubmenu ? html` <div class="${"cds"}--menu-item__shortcut">${shortcut}</div> ` : html``}