@phcdevworks/spectre-components 1.18.0 → 1.20.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 (140) hide show
  1. package/README.md +102 -78
  2. package/dist/alert.cjs.map +1 -1
  3. package/dist/alert.d.cts +2 -2
  4. package/dist/alert.d.ts +2 -2
  5. package/dist/alert.js.map +1 -1
  6. package/dist/avatar.cjs.map +1 -1
  7. package/dist/avatar.d.cts +2 -2
  8. package/dist/avatar.d.ts +2 -2
  9. package/dist/avatar.js.map +1 -1
  10. package/dist/badge.cjs +48 -1
  11. package/dist/badge.cjs.map +1 -1
  12. package/dist/badge.d.cts +22 -2
  13. package/dist/badge.d.ts +22 -2
  14. package/dist/badge.js +48 -1
  15. package/dist/badge.js.map +1 -1
  16. package/dist/button.cjs.map +1 -1
  17. package/dist/button.d.cts +2 -2
  18. package/dist/button.d.ts +2 -2
  19. package/dist/button.js.map +1 -1
  20. package/dist/card.cjs +34 -0
  21. package/dist/card.cjs.map +1 -1
  22. package/dist/card.d.cts +16 -3
  23. package/dist/card.d.ts +16 -3
  24. package/dist/card.js +33 -1
  25. package/dist/card.js.map +1 -1
  26. package/dist/container.cjs.map +1 -1
  27. package/dist/container.d.cts +2 -2
  28. package/dist/container.d.ts +2 -2
  29. package/dist/container.js.map +1 -1
  30. package/dist/dropdown.cjs +53 -6
  31. package/dist/dropdown.cjs.map +1 -1
  32. package/dist/dropdown.d.cts +21 -2
  33. package/dist/dropdown.d.ts +21 -2
  34. package/dist/dropdown.js +53 -6
  35. package/dist/dropdown.js.map +1 -1
  36. package/dist/footer.cjs +32 -0
  37. package/dist/footer.cjs.map +1 -1
  38. package/dist/footer.d.cts +14 -0
  39. package/dist/footer.d.ts +14 -0
  40. package/dist/footer.js +32 -0
  41. package/dist/footer.js.map +1 -1
  42. package/dist/{form-TvtLcoW0.d.cts → form-DpPtizpY.d.cts} +5 -1
  43. package/dist/{form-TvtLcoW0.d.ts → form-DpPtizpY.d.ts} +5 -1
  44. package/dist/grid.cjs.map +1 -1
  45. package/dist/grid.d.cts +2 -2
  46. package/dist/grid.d.ts +2 -2
  47. package/dist/grid.js.map +1 -1
  48. package/dist/icon-box.cjs.map +1 -1
  49. package/dist/icon-box.d.cts +2 -2
  50. package/dist/icon-box.d.ts +2 -2
  51. package/dist/icon-box.js.map +1 -1
  52. package/dist/index.cjs +220 -11
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.d.cts +1 -1
  55. package/dist/index.d.ts +1 -1
  56. package/dist/index.js +219 -12
  57. package/dist/index.js.map +1 -1
  58. package/dist/input.cjs.map +1 -1
  59. package/dist/input.d.cts +2 -2
  60. package/dist/input.d.ts +2 -2
  61. package/dist/input.js.map +1 -1
  62. package/dist/modal.cjs +32 -0
  63. package/dist/modal.cjs.map +1 -1
  64. package/dist/modal.d.cts +14 -0
  65. package/dist/modal.d.ts +14 -0
  66. package/dist/modal.js +32 -0
  67. package/dist/modal.js.map +1 -1
  68. package/dist/nav-item.cjs.map +1 -1
  69. package/dist/nav-item.d.cts +1 -1
  70. package/dist/nav-item.d.ts +1 -1
  71. package/dist/nav-item.js.map +1 -1
  72. package/dist/nav.cjs +32 -0
  73. package/dist/nav.cjs.map +1 -1
  74. package/dist/nav.d.cts +14 -1
  75. package/dist/nav.d.ts +14 -1
  76. package/dist/nav.js +32 -0
  77. package/dist/nav.js.map +1 -1
  78. package/dist/pricing-card.cjs +32 -0
  79. package/dist/pricing-card.cjs.map +1 -1
  80. package/dist/pricing-card.d.cts +14 -0
  81. package/dist/pricing-card.d.ts +14 -0
  82. package/dist/pricing-card.js +32 -0
  83. package/dist/pricing-card.js.map +1 -1
  84. package/dist/radio.cjs +3 -2
  85. package/dist/radio.cjs.map +1 -1
  86. package/dist/radio.js +3 -2
  87. package/dist/radio.js.map +1 -1
  88. package/dist/rating.cjs.map +1 -1
  89. package/dist/rating.d.cts +2 -2
  90. package/dist/rating.d.ts +2 -2
  91. package/dist/rating.js.map +1 -1
  92. package/dist/section.cjs.map +1 -1
  93. package/dist/section.js.map +1 -1
  94. package/dist/select.cjs.map +1 -1
  95. package/dist/select.d.cts +1 -1
  96. package/dist/select.d.ts +1 -1
  97. package/dist/select.js.map +1 -1
  98. package/dist/sidebar-link.cjs.map +1 -1
  99. package/dist/sidebar-link.d.cts +1 -1
  100. package/dist/sidebar-link.d.ts +1 -1
  101. package/dist/sidebar-link.js.map +1 -1
  102. package/dist/spinner.cjs.map +1 -1
  103. package/dist/spinner.d.cts +2 -2
  104. package/dist/spinner.d.ts +2 -2
  105. package/dist/spinner.js.map +1 -1
  106. package/dist/stack.cjs.map +1 -1
  107. package/dist/stack.d.cts +2 -2
  108. package/dist/stack.d.ts +2 -2
  109. package/dist/stack.js.map +1 -1
  110. package/dist/tag.cjs.map +1 -1
  111. package/dist/tag.d.cts +2 -2
  112. package/dist/tag.d.ts +2 -2
  113. package/dist/tag.js.map +1 -1
  114. package/dist/testimonial.cjs +32 -0
  115. package/dist/testimonial.cjs.map +1 -1
  116. package/dist/testimonial.d.cts +15 -2
  117. package/dist/testimonial.d.ts +15 -2
  118. package/dist/testimonial.js +32 -0
  119. package/dist/testimonial.js.map +1 -1
  120. package/dist/text.cjs.map +1 -1
  121. package/dist/text.d.cts +2 -2
  122. package/dist/text.d.ts +2 -2
  123. package/dist/text.js.map +1 -1
  124. package/dist/textarea.cjs.map +1 -1
  125. package/dist/textarea.d.cts +1 -1
  126. package/dist/textarea.d.ts +1 -1
  127. package/dist/textarea.js.map +1 -1
  128. package/dist/toast.cjs +32 -0
  129. package/dist/toast.cjs.map +1 -1
  130. package/dist/toast.d.cts +15 -2
  131. package/dist/toast.d.ts +15 -2
  132. package/dist/toast.js +32 -0
  133. package/dist/toast.js.map +1 -1
  134. package/dist/tooltip.cjs +41 -2
  135. package/dist/tooltip.cjs.map +1 -1
  136. package/dist/tooltip.d.cts +15 -2
  137. package/dist/tooltip.d.ts +15 -2
  138. package/dist/tooltip.js +41 -2
  139. package/dist/tooltip.js.map +1 -1
  140. package/package.json +22 -18
package/dist/index.cjs CHANGED
@@ -87,6 +87,22 @@ function isCardPaddingSize(value) {
87
87
  value
88
88
  );
89
89
  }
90
+ var spectreAccentEdges = ["top", "right", "bottom", "left"];
91
+ function isAccentEdge(value) {
92
+ return spectreAccentEdges.includes(value);
93
+ }
94
+ var spectreAccentColors = [
95
+ "neutral",
96
+ "brand",
97
+ "info",
98
+ "success",
99
+ "warning",
100
+ "danger",
101
+ "cta"
102
+ ];
103
+ function isAccentColor(value) {
104
+ return spectreAccentColors.includes(value);
105
+ }
90
106
  var spectreIconBoxVariants = [
91
107
  "primary",
92
108
  "secondary",
@@ -1712,7 +1728,7 @@ var SpectreRadioElement = class extends SpectreProjectableElement {
1712
1728
  }
1713
1729
  updated(changedProperties) {
1714
1730
  super.updated(changedProperties);
1715
- if ((changedProperties.has("checked") || changedProperties.has("name")) && this.checked && this.name) {
1731
+ if ((changedProperties.has("checked") || changedProperties.has("name") || changedProperties.has("form")) && this.checked && this.name) {
1716
1732
  this.syncGroup();
1717
1733
  }
1718
1734
  }
@@ -1724,8 +1740,9 @@ var SpectreRadioElement = class extends SpectreProjectableElement {
1724
1740
  const radios = root.querySelectorAll(
1725
1741
  "sp-radio"
1726
1742
  );
1743
+ const form = this.nativeInput?.form;
1727
1744
  radios.forEach((radio) => {
1728
- if (radio !== this && radio.name === this.name && radio.checked) {
1745
+ if (radio !== this && radio.name === this.name && radio.nativeInput?.form === form && radio.checked) {
1729
1746
  radio.checked = false;
1730
1747
  }
1731
1748
  });
@@ -1983,8 +2000,11 @@ function defineSpectreFieldset(tagName = "sp-fieldset") {
1983
2000
  var SpectreBadgeElement = class extends SpectreProjectableElement {
1984
2001
  constructor() {
1985
2002
  super(...arguments);
2003
+ this.accentRail = void 0;
2004
+ this.accentRailColor = void 0;
1986
2005
  this.disabled = false;
1987
2006
  this.fullWidth = false;
2007
+ this.innerClass = void 0;
1988
2008
  this.loading = false;
1989
2009
  this.size = "md";
1990
2010
  this.variant = "primary";
@@ -2012,6 +2032,12 @@ var SpectreBadgeElement = class extends SpectreProjectableElement {
2012
2032
  return el.hasAttribute("data-sp-badge-native");
2013
2033
  }
2014
2034
  willUpdate(changedProperties) {
2035
+ if (changedProperties.has("accentRail") && this.accentRail != null && !isAccentEdge(this.accentRail)) {
2036
+ this.accentRail = void 0;
2037
+ }
2038
+ if (changedProperties.has("accentRailColor") && this.accentRailColor != null && !isAccentColor(this.accentRailColor)) {
2039
+ this.accentRailColor = void 0;
2040
+ }
2015
2041
  if (changedProperties.has("disabled") && this.disabled == null) {
2016
2042
  this.disabled = false;
2017
2043
  }
@@ -2029,13 +2055,21 @@ var SpectreBadgeElement = class extends SpectreProjectableElement {
2029
2055
  }
2030
2056
  }
2031
2057
  get badgeClasses() {
2032
- return spectreUi.getBadgeClasses({
2058
+ const recipeClasses = spectreUi.getBadgeClasses({
2059
+ ...this.accentRail !== void 0 && {
2060
+ accentRail: this.accentRail
2061
+ },
2062
+ ...this.accentRailColor !== void 0 && {
2063
+ accentRailColor: this.accentRailColor
2064
+ },
2033
2065
  disabled: this.isDisabled,
2034
2066
  fullWidth: this.fullWidth ?? false,
2035
2067
  loading: this.loading ?? false,
2036
2068
  size: this.size,
2037
2069
  variant: this.variant
2038
2070
  });
2071
+ const utilityClasses = sanitizeUtilityClasses(this.innerClass);
2072
+ return utilityClasses ? `${recipeClasses} ${utilityClasses}` : recipeClasses;
2039
2073
  }
2040
2074
  render() {
2041
2075
  return lit.html`<span
@@ -2054,8 +2088,15 @@ var SpectreBadgeElement = class extends SpectreProjectableElement {
2054
2088
  }
2055
2089
  };
2056
2090
  SpectreBadgeElement.properties = {
2091
+ accentRail: { attribute: "accent-rail", type: String, reflect: true },
2092
+ accentRailColor: {
2093
+ attribute: "accent-rail-color",
2094
+ type: String,
2095
+ reflect: true
2096
+ },
2057
2097
  disabled: { type: Boolean, reflect: true },
2058
2098
  fullWidth: { attribute: "full-width", type: Boolean, reflect: true },
2099
+ innerClass: { attribute: "inner-class", type: String },
2059
2100
  loading: { type: Boolean, reflect: true },
2060
2101
  size: { type: String, reflect: true },
2061
2102
  variant: { type: String, reflect: true }
@@ -2091,6 +2132,8 @@ var paddedConverter = {
2091
2132
  var SpectreCardElement = class extends SpectreProjectableElement {
2092
2133
  constructor() {
2093
2134
  super(...arguments);
2135
+ this.accent = void 0;
2136
+ this.accentColor = void 0;
2094
2137
  this.disabled = false;
2095
2138
  this.fullHeight = false;
2096
2139
  this.innerClass = void 0;
@@ -2122,6 +2165,12 @@ var SpectreCardElement = class extends SpectreProjectableElement {
2122
2165
  return el.hasAttribute("data-sp-card-native");
2123
2166
  }
2124
2167
  willUpdate(changedProperties) {
2168
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
2169
+ this.accent = void 0;
2170
+ }
2171
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
2172
+ this.accentColor = void 0;
2173
+ }
2125
2174
  if (changedProperties.has("disabled") && this.disabled == null) {
2126
2175
  this.disabled = false;
2127
2176
  }
@@ -2143,6 +2192,12 @@ var SpectreCardElement = class extends SpectreProjectableElement {
2143
2192
  }
2144
2193
  get cardClasses() {
2145
2194
  const recipeClasses = spectreUi.getCardClasses({
2195
+ ...this.accent !== void 0 && {
2196
+ accent: this.accent
2197
+ },
2198
+ ...this.accentColor !== void 0 && {
2199
+ accentColor: this.accentColor
2200
+ },
2146
2201
  disabled: this.isDisabled,
2147
2202
  fullHeight: this.fullHeight ?? false,
2148
2203
  interactive: this.interactive ?? false,
@@ -2170,6 +2225,8 @@ var SpectreCardElement = class extends SpectreProjectableElement {
2170
2225
  }
2171
2226
  };
2172
2227
  SpectreCardElement.properties = {
2228
+ accent: { type: String, reflect: true },
2229
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
2173
2230
  disabled: { type: Boolean, reflect: true },
2174
2231
  fullHeight: { attribute: "full-height", type: Boolean, reflect: true },
2175
2232
  innerClass: { attribute: "inner-class", type: String },
@@ -2395,6 +2452,8 @@ function defineSpectreRating(tagName = "sp-rating") {
2395
2452
  var SpectreTestimonialElement = class extends SpectreProjectableElement {
2396
2453
  constructor() {
2397
2454
  super(...arguments);
2455
+ this.accent = void 0;
2456
+ this.accentColor = void 0;
2398
2457
  this.disabled = false;
2399
2458
  this.fullHeight = false;
2400
2459
  this.interactive = false;
@@ -2424,6 +2483,12 @@ var SpectreTestimonialElement = class extends SpectreProjectableElement {
2424
2483
  return el.hasAttribute("data-sp-testimonial-native");
2425
2484
  }
2426
2485
  willUpdate(changedProperties) {
2486
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
2487
+ this.accent = void 0;
2488
+ }
2489
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
2490
+ this.accentColor = void 0;
2491
+ }
2427
2492
  if (changedProperties.has("disabled") && this.disabled == null) {
2428
2493
  this.disabled = false;
2429
2494
  }
@@ -2442,6 +2507,12 @@ var SpectreTestimonialElement = class extends SpectreProjectableElement {
2442
2507
  }
2443
2508
  get testimonialClasses() {
2444
2509
  return spectreUi.getTestimonialClasses({
2510
+ ...this.accent !== void 0 && {
2511
+ accent: this.accent
2512
+ },
2513
+ ...this.accentColor !== void 0 && {
2514
+ accentColor: this.accentColor
2515
+ },
2445
2516
  disabled: this.isDisabled,
2446
2517
  fullHeight: this.fullHeight ?? false,
2447
2518
  interactive: this.interactive ?? false,
@@ -2466,6 +2537,8 @@ var SpectreTestimonialElement = class extends SpectreProjectableElement {
2466
2537
  }
2467
2538
  };
2468
2539
  SpectreTestimonialElement.properties = {
2540
+ accent: { type: String, reflect: true },
2541
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
2469
2542
  disabled: { type: Boolean, reflect: true },
2470
2543
  fullHeight: { attribute: "full-height", type: Boolean, reflect: true },
2471
2544
  interactive: { type: Boolean, reflect: true },
@@ -2855,6 +2928,8 @@ function defineSpectreTag(tagName = "sp-tag") {
2855
2928
  var SpectrePricingCardElement = class extends SpectreProjectableElement {
2856
2929
  constructor() {
2857
2930
  super(...arguments);
2931
+ this.accent = void 0;
2932
+ this.accentColor = void 0;
2858
2933
  this.disabled = false;
2859
2934
  this.featured = false;
2860
2935
  this.fullHeight = false;
@@ -2884,6 +2959,12 @@ var SpectrePricingCardElement = class extends SpectreProjectableElement {
2884
2959
  return el.hasAttribute("data-sp-pricing-card-native");
2885
2960
  }
2886
2961
  willUpdate(changedProperties) {
2962
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
2963
+ this.accent = void 0;
2964
+ }
2965
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
2966
+ this.accentColor = void 0;
2967
+ }
2887
2968
  if (changedProperties.has("disabled") && this.disabled == null) {
2888
2969
  this.disabled = false;
2889
2970
  }
@@ -2902,6 +2983,12 @@ var SpectrePricingCardElement = class extends SpectreProjectableElement {
2902
2983
  }
2903
2984
  get pricingCardClasses() {
2904
2985
  return spectreUi.getPricingCardClasses({
2986
+ ...this.accent !== void 0 && {
2987
+ accent: this.accent
2988
+ },
2989
+ ...this.accentColor !== void 0 && {
2990
+ accentColor: this.accentColor
2991
+ },
2905
2992
  disabled: this.isDisabled,
2906
2993
  featured: this.featured ?? false,
2907
2994
  fullHeight: this.fullHeight ?? false,
@@ -2926,6 +3013,8 @@ var SpectrePricingCardElement = class extends SpectreProjectableElement {
2926
3013
  }
2927
3014
  };
2928
3015
  SpectrePricingCardElement.properties = {
3016
+ accent: { type: String, reflect: true },
3017
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
2929
3018
  disabled: { type: Boolean, reflect: true },
2930
3019
  featured: { type: Boolean, reflect: true },
2931
3020
  fullHeight: { attribute: "full-height", type: Boolean, reflect: true },
@@ -3371,11 +3460,14 @@ function defineSpectreStack(tagName = "sp-stack") {
3371
3460
  var SpectreDropdownElement = class extends SpectreBaseElement {
3372
3461
  constructor() {
3373
3462
  super(...arguments);
3463
+ this.accent = void 0;
3464
+ this.accentColor = void 0;
3374
3465
  this.fullWidth = false;
3375
3466
  this.mega = false;
3376
3467
  this.open = false;
3377
3468
  this.placement = "bottom-start";
3378
3469
  this.triggerLabel = "Toggle menu";
3470
+ this.viewport = false;
3379
3471
  this.triggerContent = [];
3380
3472
  this.menuContent = [];
3381
3473
  this.handleDocumentClick = (event) => {
@@ -3410,13 +3502,20 @@ var SpectreDropdownElement = class extends SpectreBaseElement {
3410
3502
  return false;
3411
3503
  }
3412
3504
  const el = node;
3413
- return el.hasAttribute("data-sp-dropdown-menu") || el.hasAttribute("data-sp-dropdown-trigger");
3505
+ return el.hasAttribute("data-sp-dropdown-native") || el.hasAttribute("data-sp-dropdown-menu") || el.hasAttribute("data-sp-dropdown-trigger");
3414
3506
  }
3415
3507
  syncProjectedContent() {
3416
3508
  const nextTriggerContent = [];
3417
3509
  const nextMenuContent = [];
3418
- this.childNodes.forEach((node) => {
3419
- if (this.isInternalNode(node)) {
3510
+ const sourceNodes = [
3511
+ ...this.triggerContent.filter((node) => this.contains(node)),
3512
+ ...this.menuContent.filter((node) => this.contains(node)),
3513
+ ...Array.from(this.childNodes).filter(
3514
+ (node) => !this.hasUpdated || node.nodeType !== Node.TEXT_NODE || node.textContent?.trim()
3515
+ )
3516
+ ];
3517
+ new Set(sourceNodes).forEach((node) => {
3518
+ if (node.nodeType === Node.COMMENT_NODE || this.isInternalNode(node)) {
3420
3519
  return;
3421
3520
  }
3422
3521
  const isTriggerSlot = node.nodeType === Node.ELEMENT_NODE && node.getAttribute("slot") === "trigger";
@@ -3473,6 +3572,12 @@ var SpectreDropdownElement = class extends SpectreBaseElement {
3473
3572
  this.contentObserver = void 0;
3474
3573
  }
3475
3574
  willUpdate(changedProperties) {
3575
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
3576
+ this.accent = void 0;
3577
+ }
3578
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
3579
+ this.accentColor = void 0;
3580
+ }
3476
3581
  if (changedProperties.has("fullWidth") && this.fullWidth == null) {
3477
3582
  this.fullWidth = false;
3478
3583
  }
@@ -3488,6 +3593,9 @@ var SpectreDropdownElement = class extends SpectreBaseElement {
3488
3593
  if (changedProperties.has("triggerLabel") && !this.triggerLabel) {
3489
3594
  this.triggerLabel = "Toggle menu";
3490
3595
  }
3596
+ if (changedProperties.has("viewport") && this.viewport == null) {
3597
+ this.viewport = false;
3598
+ }
3491
3599
  }
3492
3600
  get triggerElement() {
3493
3601
  return this.querySelector("[data-sp-dropdown-trigger]");
@@ -3516,19 +3624,28 @@ var SpectreDropdownElement = class extends SpectreBaseElement {
3516
3624
  get dropdownClasses() {
3517
3625
  return spectreUi.getDropdownClasses({
3518
3626
  fullWidth: this.fullWidth ?? false,
3519
- mega: this.mega ?? false
3627
+ mega: this.mega ?? false,
3628
+ viewport: this.viewport ?? false
3520
3629
  });
3521
3630
  }
3522
3631
  get menuClasses() {
3523
3632
  return spectreUi.getDropdownMenuClasses({
3633
+ ...this.accent !== void 0 && {
3634
+ accent: this.accent
3635
+ },
3636
+ ...this.accentColor !== void 0 && {
3637
+ accentColor: this.accentColor
3638
+ },
3524
3639
  mega: this.mega ?? false,
3525
3640
  open: this.open ?? false,
3526
- placement: this.placement
3641
+ placement: this.placement,
3642
+ viewport: this.viewport ?? false
3527
3643
  });
3528
3644
  }
3529
3645
  render() {
3530
3646
  return lit.html`<div
3531
3647
  class="${this.dropdownClasses}"
3648
+ data-sp-dropdown-native
3532
3649
  id="${ifDefined_js.ifDefined(this.id || void 0)}"
3533
3650
  title="${ifDefined_js.ifDefined(this.title || void 0)}"
3534
3651
  >
@@ -3550,11 +3667,14 @@ var SpectreDropdownElement = class extends SpectreBaseElement {
3550
3667
  }
3551
3668
  };
3552
3669
  SpectreDropdownElement.properties = {
3670
+ accent: { type: String, reflect: true },
3671
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
3553
3672
  fullWidth: { attribute: "full-width", type: Boolean, reflect: true },
3554
3673
  mega: { type: Boolean, reflect: true },
3555
3674
  open: { type: Boolean, reflect: true },
3556
3675
  placement: { type: String, reflect: true },
3557
- triggerLabel: { attribute: "trigger-label", type: String }
3676
+ triggerLabel: { attribute: "trigger-label", type: String },
3677
+ viewport: { type: Boolean, reflect: true }
3558
3678
  };
3559
3679
  function defineSpectreDropdown(tagName = "sp-dropdown") {
3560
3680
  const existingElement = customElements.get(tagName);
@@ -3567,6 +3687,8 @@ function defineSpectreDropdown(tagName = "sp-dropdown") {
3567
3687
  var SpectreFooterElement = class extends SpectreProjectableElement {
3568
3688
  constructor() {
3569
3689
  super(...arguments);
3690
+ this.accent = void 0;
3691
+ this.accentColor = void 0;
3570
3692
  this.bordered = false;
3571
3693
  this.fullWidth = false;
3572
3694
  this.innerClass = void 0;
@@ -3599,6 +3721,12 @@ var SpectreFooterElement = class extends SpectreProjectableElement {
3599
3721
  return el.hasAttribute("data-sp-footer-native");
3600
3722
  }
3601
3723
  willUpdate(changedProperties) {
3724
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
3725
+ this.accent = void 0;
3726
+ }
3727
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
3728
+ this.accentColor = void 0;
3729
+ }
3602
3730
  if (changedProperties.has("bordered") && this.bordered == null) {
3603
3731
  this.bordered = false;
3604
3732
  }
@@ -3608,6 +3736,12 @@ var SpectreFooterElement = class extends SpectreProjectableElement {
3608
3736
  }
3609
3737
  get footerClasses() {
3610
3738
  const recipeClasses = spectreUi.getFooterClasses({
3739
+ ...this.accent !== void 0 && {
3740
+ accent: this.accent
3741
+ },
3742
+ ...this.accentColor !== void 0 && {
3743
+ accentColor: this.accentColor
3744
+ },
3611
3745
  bordered: this.bordered ?? false,
3612
3746
  fullWidth: this.fullWidth ?? false
3613
3747
  });
@@ -3627,6 +3761,8 @@ var SpectreFooterElement = class extends SpectreProjectableElement {
3627
3761
  }
3628
3762
  };
3629
3763
  SpectreFooterElement.properties = {
3764
+ accent: { type: String, reflect: true },
3765
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
3630
3766
  bordered: { type: Boolean, reflect: true },
3631
3767
  fullWidth: { attribute: "full-width", type: Boolean, reflect: true },
3632
3768
  innerClass: { attribute: "inner-class", type: String }
@@ -3781,6 +3917,8 @@ var FOCUSABLE_SELECTOR = [
3781
3917
  var SpectreModalElement = class extends SpectreProjectableElement {
3782
3918
  constructor() {
3783
3919
  super(...arguments);
3920
+ this.accent = void 0;
3921
+ this.accentColor = void 0;
3784
3922
  this.fullWidth = false;
3785
3923
  this.open = false;
3786
3924
  this.previouslyFocusedElement = null;
@@ -3820,6 +3958,12 @@ var SpectreModalElement = class extends SpectreProjectableElement {
3820
3958
  return el.hasAttribute("data-sp-modal-native") || el.hasAttribute("data-sp-modal-overlay");
3821
3959
  }
3822
3960
  willUpdate(changedProperties) {
3961
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
3962
+ this.accent = void 0;
3963
+ }
3964
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
3965
+ this.accentColor = void 0;
3966
+ }
3823
3967
  if (changedProperties.has("fullWidth") && this.fullWidth == null) {
3824
3968
  this.fullWidth = false;
3825
3969
  }
@@ -3891,6 +4035,12 @@ var SpectreModalElement = class extends SpectreProjectableElement {
3891
4035
  }
3892
4036
  get modalClasses() {
3893
4037
  return spectreUi.getModalClasses({
4038
+ ...this.accent !== void 0 && {
4039
+ accent: this.accent
4040
+ },
4041
+ ...this.accentColor !== void 0 && {
4042
+ accentColor: this.accentColor
4043
+ },
3894
4044
  open: this.open ?? false,
3895
4045
  fullWidth: this.fullWidth ?? false
3896
4046
  });
@@ -3926,6 +4076,8 @@ var SpectreModalElement = class extends SpectreProjectableElement {
3926
4076
  }
3927
4077
  };
3928
4078
  SpectreModalElement.properties = {
4079
+ accent: { type: String, reflect: true },
4080
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
3929
4081
  fullWidth: { attribute: "full-width", type: Boolean, reflect: true },
3930
4082
  open: { type: Boolean, reflect: true }
3931
4083
  };
@@ -3940,6 +4092,8 @@ function defineSpectreModal(tagName = "sp-modal") {
3940
4092
  var SpectreNavElement = class extends SpectreProjectableElement {
3941
4093
  constructor() {
3942
4094
  super(...arguments);
4095
+ this.accent = void 0;
4096
+ this.accentColor = void 0;
3943
4097
  this.align = void 0;
3944
4098
  this.bordered = false;
3945
4099
  this.fullWidth = false;
@@ -3974,6 +4128,12 @@ var SpectreNavElement = class extends SpectreProjectableElement {
3974
4128
  return el.hasAttribute("data-sp-nav-native");
3975
4129
  }
3976
4130
  willUpdate(changedProperties) {
4131
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
4132
+ this.accent = void 0;
4133
+ }
4134
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
4135
+ this.accentColor = void 0;
4136
+ }
3977
4137
  if (changedProperties.has("bordered") && this.bordered == null) {
3978
4138
  this.bordered = false;
3979
4139
  }
@@ -3989,6 +4149,12 @@ var SpectreNavElement = class extends SpectreProjectableElement {
3989
4149
  }
3990
4150
  get navClasses() {
3991
4151
  const recipeClasses = spectreUi.getNavClasses({
4152
+ ...this.accent !== void 0 && {
4153
+ accent: this.accent
4154
+ },
4155
+ ...this.accentColor !== void 0 && {
4156
+ accentColor: this.accentColor
4157
+ },
3992
4158
  bordered: this.bordered ?? false,
3993
4159
  fullWidth: this.fullWidth ?? false,
3994
4160
  sticky: this.sticky ?? false,
@@ -4010,6 +4176,8 @@ var SpectreNavElement = class extends SpectreProjectableElement {
4010
4176
  }
4011
4177
  };
4012
4178
  SpectreNavElement.properties = {
4179
+ accent: { type: String, reflect: true },
4180
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
4013
4181
  align: { type: String, reflect: true },
4014
4182
  bordered: { type: Boolean, reflect: true },
4015
4183
  fullWidth: { attribute: "full-width", type: Boolean, reflect: true },
@@ -4560,6 +4728,8 @@ function defineSpectreSidebarToggle(tagName = "sp-sidebar-toggle") {
4560
4728
  var SpectreToastElement = class extends SpectreBaseElement {
4561
4729
  constructor() {
4562
4730
  super(...arguments);
4731
+ this.accent = void 0;
4732
+ this.accentColor = void 0;
4563
4733
  this.dismissed = false;
4564
4734
  this.fullWidth = false;
4565
4735
  this.variant = "info";
@@ -4643,6 +4813,12 @@ var SpectreToastElement = class extends SpectreBaseElement {
4643
4813
  this.contentObserver = void 0;
4644
4814
  }
4645
4815
  willUpdate(changedProperties) {
4816
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
4817
+ this.accent = void 0;
4818
+ }
4819
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
4820
+ this.accentColor = void 0;
4821
+ }
4646
4822
  if (changedProperties.has("dismissed") && this.dismissed == null) {
4647
4823
  this.dismissed = false;
4648
4824
  }
@@ -4689,6 +4865,12 @@ var SpectreToastElement = class extends SpectreBaseElement {
4689
4865
  }
4690
4866
  get toastClasses() {
4691
4867
  return spectreUi.getToastClasses({
4868
+ ...this.accent !== void 0 && {
4869
+ accent: this.accent
4870
+ },
4871
+ ...this.accentColor !== void 0 && {
4872
+ accentColor: this.accentColor
4873
+ },
4692
4874
  variant: this.variant,
4693
4875
  dismissed: this.dismissed ?? false,
4694
4876
  fullWidth: this.fullWidth ?? false
@@ -4716,6 +4898,8 @@ var SpectreToastElement = class extends SpectreBaseElement {
4716
4898
  }
4717
4899
  };
4718
4900
  SpectreToastElement.properties = {
4901
+ accent: { type: String, reflect: true },
4902
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
4719
4903
  autoDismiss: { attribute: "auto-dismiss", type: Number },
4720
4904
  dismissed: { type: Boolean, reflect: true },
4721
4905
  fullWidth: { attribute: "full-width", type: Boolean, reflect: true },
@@ -4732,6 +4916,8 @@ function defineSpectreToast(tagName = "sp-toast") {
4732
4916
  var SpectreTooltipElement = class extends SpectreBaseElement {
4733
4917
  constructor() {
4734
4918
  super(...arguments);
4919
+ this.accent = void 0;
4920
+ this.accentColor = void 0;
4735
4921
  this.placement = "top";
4736
4922
  this.visible = false;
4737
4923
  this.triggerContent = [];
@@ -4759,8 +4945,15 @@ var SpectreTooltipElement = class extends SpectreBaseElement {
4759
4945
  syncProjectedContent() {
4760
4946
  const nextTooltipContent = [];
4761
4947
  const nextTriggerContent = [];
4762
- this.childNodes.forEach((node) => {
4763
- if (this.isInternalNode(node)) {
4948
+ const sourceNodes = [
4949
+ ...this.triggerContent.filter((node) => this.contains(node)),
4950
+ ...this.tooltipContent.filter((node) => this.contains(node)),
4951
+ ...Array.from(this.childNodes).filter(
4952
+ (node) => !this.hasUpdated || node.nodeType !== Node.TEXT_NODE || node.textContent?.trim()
4953
+ )
4954
+ ];
4955
+ new Set(sourceNodes).forEach((node) => {
4956
+ if (node.nodeType === Node.COMMENT_NODE || this.isInternalNode(node)) {
4764
4957
  return;
4765
4958
  }
4766
4959
  const isTooltipSlot = node.nodeType === Node.ELEMENT_NODE && node.getAttribute("slot") === "tooltip";
@@ -4813,6 +5006,12 @@ var SpectreTooltipElement = class extends SpectreBaseElement {
4813
5006
  this.contentObserver = void 0;
4814
5007
  }
4815
5008
  willUpdate(changedProperties) {
5009
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
5010
+ this.accent = void 0;
5011
+ }
5012
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
5013
+ this.accentColor = void 0;
5014
+ }
4816
5015
  if (changedProperties.has("placement") && (this.placement == null || !isTooltipPlacement(this.placement))) {
4817
5016
  this.placement = "top";
4818
5017
  }
@@ -4836,6 +5035,12 @@ var SpectreTooltipElement = class extends SpectreBaseElement {
4836
5035
  }
4837
5036
  get tooltipClasses() {
4838
5037
  return spectreUi.getTooltipClasses({
5038
+ ...this.accent !== void 0 && {
5039
+ accent: this.accent
5040
+ },
5041
+ ...this.accentColor !== void 0 && {
5042
+ accentColor: this.accentColor
5043
+ },
4839
5044
  placement: this.placement,
4840
5045
  visible: this.visible ?? false
4841
5046
  });
@@ -4863,6 +5068,8 @@ var SpectreTooltipElement = class extends SpectreBaseElement {
4863
5068
  }
4864
5069
  };
4865
5070
  SpectreTooltipElement.properties = {
5071
+ accent: { type: String, reflect: true },
5072
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
4866
5073
  placement: { type: String, reflect: true },
4867
5074
  visible: { type: Boolean, reflect: true }
4868
5075
  };
@@ -5084,6 +5291,8 @@ exports.spectreBadgeVariants = spectreBadgeVariants;
5084
5291
  exports.spectreButtonSizes = spectreInputSizes;
5085
5292
  exports.spectreButtonTypes = spectreButtonTypes;
5086
5293
  exports.spectreButtonVariants = spectreButtonVariants;
5294
+ exports.spectreCardAccentColors = spectreAccentColors;
5295
+ exports.spectreCardAccentEdges = spectreAccentEdges;
5087
5296
  exports.spectreCardVariants = spectreCardVariants;
5088
5297
  exports.spectreContainerMaxWidths = spectreContainerMaxWidths;
5089
5298
  exports.spectreDropdownPlacements = spectreDropdownPlacements;