@playpilot/tpi 8.0.0-beta.explore-home.12 → 8.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.0.0-beta.explore-home.12",
3
+ "version": "8.0.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -18,7 +18,7 @@
18
18
  prepend?: Snippet | null
19
19
  tall?: boolean
20
20
  wide?: boolean
21
- width?: boolean
21
+ blur?: boolean
22
22
  closeButtonStyle?: 'shadow' | 'flat'
23
23
  initialScrollPosition?: number
24
24
  onscroll?: () => void
@@ -32,6 +32,7 @@
32
32
  dialog,
33
33
  tall = false,
34
34
  wide = false,
35
+ blur = false,
35
36
  closeButtonStyle = 'shadow',
36
37
  initialScrollPosition = 0,
37
38
  onscroll = () => null,
@@ -119,6 +120,7 @@
119
120
  class="modal"
120
121
  class:wide
121
122
  class:tall
123
+ class:blur
122
124
  class:has-bubble={!!bubble}
123
125
  class:has-prepend={!!prepend}
124
126
  style:--dialog-offset="{dialogOffset}px"
@@ -206,6 +208,10 @@
206
208
  &.has-bubble {
207
209
  --playpilot-detail-background-border-radius: 0;
208
210
  }
211
+
212
+ &.blur {
213
+ backdrop-filter: blur(1.5rem);
214
+ }
209
215
  }
210
216
 
211
217
  .dialog,
@@ -29,7 +29,7 @@
29
29
  })
30
30
  </script>
31
31
 
32
- <Modal>
32
+ <Modal blur>
33
33
  {#snippet dialog()}
34
34
  <div class="rail-modal" style:--transition-duration="{transitionDuration}ms">
35
35
  <TinySlider threshold={40} moveThreshold={40} transitionDuration={initialized ? transitionDuration : 0} bind:this={slider}>
@@ -115,41 +115,43 @@
115
115
  {/each}
116
116
  </Rail>
117
117
  {:then titles}
118
- <Rail
119
- bind:slider
120
- {heading}
121
- onchange={(index) => setTimeout(() => openTitle(null, titles, index), 250)}
122
- onresize={() => slider?.reposition()}>
123
- {#each titles as title, index}
124
- {@const expanded = isExpanded(title)}
125
- {@const href = titleUrl(title)}
126
- {@const onclick = (event: MouseEvent): void => openTitle(event, titles, index)}
127
-
128
- <div class="title" class:expanded data-testid="title">
129
- <div class="media">
130
- {#if expanded}
131
- <div class="video" out:fade={{ delay: 200, duration: 200 }}>
132
- <a class="video-overlay" title="" {href} {onclick}></a>
133
-
134
- {#if !!title.embeddable_url}
135
- <YouTubeEmbed embeddable_url={title.embeddable_url!} muted loop />
136
- {:else}
137
- <img class="video-fallback" src={title.medium_poster} alt="" />
138
- {/if}
139
- </div>
140
- {:else}
141
- <a class="poster" {href} {onclick}>
142
- <TitlePoster {title} width={96} height={144} />
143
- </a>
144
- {/if}
118
+ {#if titles?.length}
119
+ <Rail
120
+ bind:slider
121
+ {heading}
122
+ onchange={(index) => setTimeout(() => openTitle(null, titles, index), 250)}
123
+ onresize={() => slider?.reposition()}>
124
+ {#each titles as title, index}
125
+ {@const expanded = isExpanded(title)}
126
+ {@const href = titleUrl(title)}
127
+ {@const onclick = (event: MouseEvent): void => openTitle(event, titles, index)}
128
+
129
+ <div class="title" class:expanded data-testid="title">
130
+ <div class="media">
131
+ {#if expanded}
132
+ <div class="video" out:fade={{ delay: 200, duration: 200 }}>
133
+ <a class="video-overlay" title="" {href} {onclick}></a>
134
+
135
+ {#if !!title.embeddable_url}
136
+ <YouTubeEmbed embeddable_url={title.embeddable_url!} muted loop />
137
+ {:else}
138
+ <img class="video-fallback" src={title.medium_poster} alt="" />
139
+ {/if}
140
+ </div>
141
+ {:else}
142
+ <a class="poster" {href} {onclick}>
143
+ <TitlePoster {title} width={96} height={144} />
144
+ </a>
145
+ {/if}
146
+ </div>
147
+
148
+ <a class="heading" {href} {onclick} data-testid="heading">
149
+ {title.title}
150
+ </a>
145
151
  </div>
146
-
147
- <a class="heading" {href} {onclick} data-testid="heading">
148
- {title.title}
149
- </a>
150
- </div>
151
- {/each}
152
- </Rail>
152
+ {/each}
153
+ </Rail>
154
+ {/if}
153
155
  {/await}
154
156
  </div>
155
157
 
@@ -121,6 +121,18 @@ describe('Modal.svelte', () => {
121
121
  expect(getByTestId('modal').classList).toContain('wide')
122
122
  })
123
123
 
124
+ it('Should not have blur class by default', () => {
125
+ const { getByTestId } = render(Modal, { children })
126
+
127
+ expect(getByTestId('modal').classList).not.toContain('blur')
128
+ })
129
+
130
+ it('Should have blur class when prop is given', () => {
131
+ const { getByTestId } = render(Modal, { children, blur: true })
132
+
133
+ expect(getByTestId('modal').classList).toContain('blur')
134
+ })
135
+
124
136
  it('Should not show back button by default', () => {
125
137
  const { queryByLabelText } = render(Modal, { children })
126
138