@educarehq/solaris-ui 0.11.0 → 0.11.2

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.
@@ -2688,10 +2688,17 @@ class SolarisButtonDirective {
2688
2688
  isButton = this.elementRef.nativeElement.tagName === 'BUTTON';
2689
2689
  isAnchor = this.elementRef.nativeElement.tagName === 'A';
2690
2690
  constructor() {
2691
- const initialType = this.elementRef.nativeElement.getAttribute('type');
2691
+ const el = this.elementRef.nativeElement;
2692
+ const initialType = el.getAttribute('type');
2692
2693
  if (this.isButton && initialType === null) {
2693
- this.elementRef.nativeElement.setAttribute('type', 'button');
2694
- }
2694
+ el.setAttribute('type', 'button');
2695
+ }
2696
+ // Apply variant attributes synchronously so the element never flashes the
2697
+ // base style before Angular's first change detection (SSR/hydration FOUC).
2698
+ el.setAttribute('data-appearance', this.appearance());
2699
+ el.setAttribute('data-color', this.color());
2700
+ el.setAttribute('data-radius', this.radius());
2701
+ el.setAttribute('data-shape', this.shape());
2695
2702
  effect(() => {
2696
2703
  if (this.loading()) {
2697
2704
  this.attachSpinner();
@@ -2841,10 +2848,17 @@ class SolarisIconButtonDirective {
2841
2848
  isButton = this.elementRef.nativeElement.tagName === 'BUTTON';
2842
2849
  isAnchor = this.elementRef.nativeElement.tagName === 'A';
2843
2850
  constructor() {
2844
- const initialType = this.elementRef.nativeElement.getAttribute('type');
2851
+ const el = this.elementRef.nativeElement;
2852
+ const initialType = el.getAttribute('type');
2845
2853
  if (this.isButton && initialType === null) {
2846
- this.elementRef.nativeElement.setAttribute('type', 'button');
2847
- }
2854
+ el.setAttribute('type', 'button');
2855
+ }
2856
+ // Apply variant attributes synchronously so the element never flashes the
2857
+ // base style before Angular's first change detection (SSR/hydration FOUC).
2858
+ el.setAttribute('data-appearance', this.appearance());
2859
+ el.setAttribute('data-color', this.color());
2860
+ el.setAttribute('data-radius', this.radius());
2861
+ el.setAttribute('data-shape', this.shape());
2848
2862
  }
2849
2863
  onClick(event) {
2850
2864
  if (this.isEffectivelyDisabled() && this.isAnchor) {