@getflip/swirl-components 0.252.0 → 0.252.1

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.
@@ -54,9 +54,11 @@ export class SwirlImageGridItem {
54
54
  this.computedSrc = this.src;
55
55
  this.gifPaused = false;
56
56
  }
57
+ componentWillLoad() {
58
+ this.computedSrc = this.src;
59
+ }
57
60
  componentDidLoad() {
58
61
  this.setupIntersectionObserver();
59
- this.computedSrc = this.src;
60
62
  if (this.img?.complete) {
61
63
  this.loaded = true;
62
64
  }
@@ -115,16 +117,16 @@ export class SwirlImageGridItem {
115
117
  "image-grid-item--has-error": this.error,
116
118
  "image-grid-item--has-overlay": this.overlay,
117
119
  });
118
- return (h(Host, { key: '75658ab5e5c9dfa05b47af29e6b173045a3046b0', "data-sibling-count": siblingCount, role: "listitem" }, h(Tag, { key: '730e1ae5791eea95fb9156b6c503ad8a86d0702e', class: className, type: this.interactive ? "button" : undefined }, h("div", { key: '1af6c077e717b71b40e8f9a815a731218d0a37f4', class: "image-grid-item__background", style: {
120
+ return (h(Host, { key: 'cdc714907ae1fc9c9624f56f41b9fcf0025eb285', "data-sibling-count": siblingCount, role: "listitem" }, h(Tag, { key: '5464cfb479a797e4dfa90c47079998948f2e3157', class: className, type: this.interactive ? "button" : undefined }, h("div", { key: '6f25439257b6df1507c7799c4a3b59b2c7a6e7d0', class: "image-grid-item__background", style: {
119
121
  backgroundImage: showBlurredBackground
120
122
  ? `url(${this.computedSrc})`
121
123
  : undefined,
122
124
  } }), this.loading !== "intersecting" ||
123
125
  this.inViewport ||
124
- this.gifPaused ? (h("img", { alt: this.alt, class: "image-grid-item__image", loading: this.loading !== "intersecting" ? this.loading : undefined, onError: this.onError, onLoad: this.onLoad, ref: (el) => (this.img = el), src: this.computedSrc })) : (h("div", { class: "image-grid-item__loading-placeholder" })), this.showGifControls && (h("swirl-stack", { key: '0fd42074e485aa8c504060db5259891403e49665', class: "image-grid-item__gif-controls", orientation: "horizontal", spacing: "4" }, h("button", { key: '66440c7eaea08167d32dceb3efe89bea404a94f7', class: "image-grid-item__gif-controls__icon image-grid-item__gif-controls__icon--button", onClick: this.handleControlClick, type: "button", "aria-label": this.gifPaused ? this.gifPlayLabel : this.gifPauseLabel }, this.gifPaused ? (h("swirl-icon-play-arrow", { size: 20 })) : (h("swirl-icon-pause", { size: 20 }))), h("div", { key: '7311b452251d0dbd0004b50855b51b8dd4a45a26', class: "image-grid-item__gif-controls__icon image-grid-item__gif-controls__icon--label" }, h("swirl-icon-gif", { key: 'fda7c865e98ba6235035f21b63437bf2840c748a', size: 20 })))), this.loaded &&
126
+ this.gifPaused ? (h("img", { alt: this.alt, class: "image-grid-item__image", loading: this.loading !== "intersecting" ? this.loading : undefined, onError: this.onError, onLoad: this.onLoad, ref: (el) => (this.img = el), src: this.computedSrc })) : (h("div", { class: "image-grid-item__loading-placeholder" })), this.showGifControls && (h("swirl-stack", { key: 'fb75324360455d6cfe7e2284e7412377cc855427', class: "image-grid-item__gif-controls", orientation: "horizontal", spacing: "4" }, h("button", { key: 'c830ee3ce7ae6dec733814c87ead9e86e9f849bd', class: "image-grid-item__gif-controls__icon image-grid-item__gif-controls__icon--button", onClick: this.handleControlClick, type: "button", "aria-label": this.gifPaused ? this.gifPlayLabel : this.gifPauseLabel }, this.gifPaused ? (h("swirl-icon-play-arrow", { size: 20 })) : (h("swirl-icon-pause", { size: 20 }))), h("div", { key: '095c819753f83f4626adfedb8a0f684263b295bb', class: "image-grid-item__gif-controls__icon image-grid-item__gif-controls__icon--label" }, h("swirl-icon-gif", { key: '64bc862874b6823ceabaaf0aa23a5a2b0f3c5358', size: 20 })))), this.loaded &&
125
127
  !this.error &&
126
128
  this.icon &&
127
- !Boolean(this.overlay) && (h("div", { key: 'ec261fd8161f6c4a0dbd1e4d453d53efa6078ffb', class: "image-grid-item__icon", innerHTML: this.icon })), this.overlay && (h("div", { key: '7ba82f4ae19a32b3645a9b78e896b77fe11d0fe7', class: "image-grid-item__overlay" }, this.overlay)), !this.loaded && (h("div", { key: '5b10aa43ee80c16d2f49fc30d9a638700056bf6e', class: "image-grid-item__spinner" }, h("swirl-spinner", { key: '4e654ea8e949853cf0b2ab7c624a7d8335920117' }))), this.loaded && this.error && (h("div", { key: '2cebd11ed5552cd6c8e1637a3b0dc88858d8d01d', class: "image-grid-item__error" }, h("swirl-icon-error", { key: '1ceb0a99118b6cc9ac2e693e09010ee5213db913', color: "critical" }))))));
129
+ !Boolean(this.overlay) && (h("div", { key: '3c555ad4e984cc83e3d1b0c4a890357f2733dd79', class: "image-grid-item__icon", innerHTML: this.icon })), this.overlay && (h("div", { key: '6bbf9b518ef50a33b67a7bfcd6401a910343efbc', class: "image-grid-item__overlay" }, this.overlay)), !this.loaded && (h("div", { key: 'b9a362e3241d12569702f3a4a23ad982cd578343', class: "image-grid-item__spinner" }, h("swirl-spinner", { key: '8321dbb7ecc0f011267542aab3f4778c80ee1af0' }))), this.loaded && this.error && (h("div", { key: '5d4b51352870858fc00e89d59ea66ad3323568dd', class: "image-grid-item__error" }, h("swirl-icon-error", { key: 'caf660c996da50aea9089a4ed3d186598685d03b', color: "critical" }))))));
128
130
  }
129
131
  static get is() { return "swirl-image-grid-item"; }
130
132
  static get encapsulation() { return "shadow"; }
@@ -69,22 +69,22 @@ const Template = (args) => {
69
69
 
70
70
  <ul slot="secondary-nav">
71
71
  <li>
72
- <swirl-shell-navigation-item label="Reporting hub">
72
+ <swirl-shell-navigation-item label="Reporting hub" with-gradient>
73
73
  <swirl-app-icon src="/menu-item-1.png" slot="icon"></swirl-app-icon>
74
74
  </swirl-shell-navigation-item>
75
75
  </li>
76
76
  <li>
77
- <swirl-shell-navigation-item label="My absences">
77
+ <swirl-shell-navigation-item label="My absences" with-gradient>
78
78
  <swirl-app-icon src="/menu-item-2.png" slot="icon"></swirl-app-icon>
79
79
  </swirl-shell-navigation-item>
80
80
  </li>
81
81
  <li>
82
- <swirl-shell-navigation-item label="IT self-service">
82
+ <swirl-shell-navigation-item label="IT self-service" with-gradient>
83
83
  <swirl-app-icon src="/menu-item-3.png" slot="icon"></swirl-app-icon>
84
84
  </swirl-shell-navigation-item>
85
85
  </li>
86
86
  <li>
87
- <swirl-shell-navigation-item label="Office door key">
87
+ <swirl-shell-navigation-item label="Office door key" with-gradient>
88
88
  <swirl-app-icon src="/menu-item-4.png" slot="icon"></swirl-app-icon>
89
89
  </swirl-shell-navigation-item>
90
90
  </li>
@@ -13,6 +13,10 @@
13
13
 
14
14
  .shell-navigation-item {
15
15
  --swirl-app-icon-size: 1.5rem;
16
+ --swirl-shell-navigation-item-gradient: linear-gradient(
17
+ rgba(0, 0, 0, 0),
18
+ rgba(0, 0, 0, 0.8)
19
+ );
16
20
 
17
21
  position: relative;
18
22
  display: flex;
@@ -67,11 +71,9 @@
67
71
 
68
72
  .shell-navigation-item.shell-navigation-item--boxed .shell-navigation-item__icon {
69
73
  overflow: hidden;
70
- border-width: var(--s-border-width-default);
71
- border-style: solid;
72
- border-color: var(--s-border-default);
73
74
  border-radius: var(--s-border-radius-sm);
74
75
  background-color: var(--s-background-default);
76
+ box-shadow: 0 0 0 var(--s-border-width-default) var(--s-border-default);
75
77
  }
76
78
 
77
79
  .shell-navigation-item.shell-navigation-item--tiled {
@@ -80,8 +82,9 @@
80
82
  height: auto;
81
83
  padding: 0;
82
84
  align-items: start;
85
+ border-radius: var(--s-border-radius-base);
83
86
  flex-direction: column;
84
- container-type: unset;
87
+ container-type: inline-size;
85
88
  gap: var(--s-space-8);
86
89
  }
87
90
 
@@ -95,8 +98,8 @@
95
98
 
96
99
  .shell-navigation-item.shell-navigation-item--tiled ::slotted(*) {
97
100
  position: absolute;
98
- left: var(--s-space-12);
99
101
  top: var(--s-space-12);
102
+ left: var(--s-space-12);
100
103
  }
101
104
 
102
105
  .shell-navigation-item.shell-navigation-item--tiled ::slotted(swirl-app-icon) {
@@ -117,16 +120,13 @@
117
120
  }
118
121
 
119
122
  .shell-navigation-item.shell-navigation-item--tiled.shell-navigation-item--gradient .shell-navigation-item__icon::after {
120
- content: "";
121
123
  position: absolute;
122
- width: 100%;
123
- aspect-ratio: 1;
124
124
  display: inline-block;
125
+ width: 100%;
125
126
  border-radius: var(--s-border-radius-base);
126
- background-image: linear-gradient(
127
- rgba(0, 0, 0, 0),
128
- rgba(0, 0, 0, 0.8)
129
- );
127
+ background-image: var(--swirl-shell-navigation-item-gradient);
128
+ content: "";
129
+ aspect-ratio: 1;
130
130
  }
131
131
 
132
132
  .shell-navigation-item.shell-navigation-item--tiled .shell-navigation-item__badge {
@@ -139,12 +139,12 @@
139
139
  .shell-navigation-item.shell-navigation-item--tiled .shell-navigation-item__label {
140
140
  display: -webkit-box;
141
141
  overflow: hidden;
142
- text-align: start;
142
+ color: var(--s-text-default);
143
143
  font-weight: var(--s-font-weight-semibold);
144
+ text-align: start;
144
145
  white-space: normal;
145
146
  text-overflow: unset;
146
147
  overflow-wrap: anywhere;
147
- color: var(--s-text-default);
148
148
  -webkit-line-clamp: 2;
149
149
  -webkit-box-orient: vertical;
150
150
  }
@@ -238,6 +238,10 @@
238
238
  padding: var(--s-space-2);
239
239
  }
240
240
 
241
+ .shell-navigation-item--gradient .shell-navigation-item__icon {
242
+ --swirl-shell-navigation-item-gradient: none;
243
+ }
244
+
241
245
  .shell-navigation-item__badge--dot {
242
246
  top: var(--s-space-8);
243
247
  right: var(--s-space-8);