playbook_ui 10.21.0.pre.alpha.lightbox → 10.21.0.pre.alpha.lightbox.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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slide.jsx +2 -4
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.jsx +1 -2
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.jsx +2 -3
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.jsx +1 -5
- data/app/pb_kits/playbook/pb_lightbox/Carousel/index.jsx +1 -2
- data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +112 -0
- data/lib/playbook/version.rb +1 -1
- metadata +1 -2
- data/app/pb_kits/playbook/pb_lightbox/Carousel/styles.scss +0 -110
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8de309283f70eb32584fd45cd9c8c1d86eb4379dd3268b32c04961a3c1eb78c
|
4
|
+
data.tar.gz: 5d658516cec5f8eae57b9a5c04375524b9f03bb091171941a30776390130418c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ed16f1d8e6ab09e07dfc3f397700e4f41e90716ad91b61dbc33cc31615325a399affdcfb39448b7f5550784c4706ebeac6dfe1b0e4679a8bdd7207d956effaa
|
7
|
+
data.tar.gz: 634bc7cdb80465bb4c226a3b8f8f938380d57c44be6d94e0605c3ba3b357724d251c6a014e766b2173d35c2a22cac965637f953a5864f63ecd73eb466b6614b2
|
@@ -5,8 +5,6 @@ import { noop } from 'lodash'
|
|
5
5
|
import { TransformComponent, TransformWrapper } from 'react-zoom-pan-pinch'
|
6
6
|
import Image from '../../pb_image/_image'
|
7
7
|
|
8
|
-
import styles from './styles.scss'
|
9
|
-
|
10
8
|
type SlideType = {
|
11
9
|
alt: string,
|
12
10
|
current: number,
|
@@ -37,12 +35,12 @@ export default function Slide({
|
|
37
35
|
panning={{ disabled: !zooming }}
|
38
36
|
>
|
39
37
|
<button
|
40
|
-
className=
|
38
|
+
className="Slide"
|
41
39
|
onClick={onClick}
|
42
40
|
onDoubleClick={() => onZoom(false)}
|
43
41
|
tabIndex={-1}
|
44
42
|
>
|
45
|
-
<TransformComponent className=
|
43
|
+
<TransformComponent className="TransformComponent">
|
46
44
|
<Image
|
47
45
|
alt={alt}
|
48
46
|
url={url}
|
@@ -5,7 +5,6 @@ import { motion } from 'framer-motion'
|
|
5
5
|
import React, { useState } from 'react'
|
6
6
|
|
7
7
|
import Slide from './Slide'
|
8
|
-
import styles from './styles.scss'
|
9
8
|
import useSlides from './useSlides'
|
10
9
|
|
11
10
|
type SlidesType = {
|
@@ -33,7 +32,7 @@ export default function Slides({
|
|
33
32
|
return (
|
34
33
|
<motion.div
|
35
34
|
animate={controls}
|
36
|
-
className=
|
35
|
+
className="Slides"
|
37
36
|
drag={!zooming && 'x'}
|
38
37
|
dragConstraints={dragConstraints}
|
39
38
|
dragElastic={0.05}
|
@@ -5,8 +5,6 @@ import { noop } from 'lodash'
|
|
5
5
|
import classnames from 'classnames'
|
6
6
|
import Image from '../../pb_image/_image'
|
7
7
|
|
8
|
-
import styles from './styles.scss'
|
9
|
-
|
10
8
|
type ThumbnailType = {
|
11
9
|
active?: boolean,
|
12
10
|
alt?: string,
|
@@ -22,9 +20,10 @@ export default function Thumbnail({
|
|
22
20
|
url,
|
23
21
|
onClick = noop,
|
24
22
|
}: ThumbnailType) {
|
23
|
+
const activeClasses = classnames('Thumbnail', { active })
|
25
24
|
return (
|
26
25
|
<button
|
27
|
-
className={classnames(
|
26
|
+
className={classnames(activeClasses)}
|
28
27
|
onClick={onClick}
|
29
28
|
style={{ width }}
|
30
29
|
type="button"
|
@@ -8,8 +8,6 @@ import { useWindowSize } from '../hooks/useWindowSize'
|
|
8
8
|
|
9
9
|
import Thumbnail from './Thumbnail'
|
10
10
|
|
11
|
-
import styles from './styles.scss'
|
12
|
-
|
13
11
|
export const indexWithinBounds = (
|
14
12
|
current: number,
|
15
13
|
min: number,
|
@@ -35,9 +33,7 @@ export default function Thumbnails({
|
|
35
33
|
const viewportSize = useWindowSize()
|
36
34
|
const thumbnailWidth = viewportSize.width / 8
|
37
35
|
const draggable = thumbnailWidth * urls.length > viewportSize.width
|
38
|
-
const css = classnames(
|
39
|
-
[styles.draggable]: draggable,
|
40
|
-
})
|
36
|
+
const css = classnames('Thumbnails', { draggable })
|
41
37
|
const dragConstraints = {
|
42
38
|
left: -1 * (thumbnailWidth * urls.length - viewportSize.width),
|
43
39
|
right: 0,
|
@@ -6,7 +6,6 @@ import React, { useEffect, useState } from 'react'
|
|
6
6
|
|
7
7
|
import Slides from './Slides'
|
8
8
|
import Thumbnails from './Thumbnails'
|
9
|
-
import styles from './styles.scss'
|
10
9
|
|
11
10
|
type CarouselType = {
|
12
11
|
initialPhoto: string,
|
@@ -40,7 +39,7 @@ export default function Carousel({
|
|
40
39
|
}
|
41
40
|
|
42
41
|
return (
|
43
|
-
<div className=
|
42
|
+
<div className="Lightbox">
|
44
43
|
<Slides
|
45
44
|
current={currentIndex}
|
46
45
|
onChange={handleChange}
|
@@ -88,3 +88,115 @@
|
|
88
88
|
pointer-events: none;
|
89
89
|
}
|
90
90
|
}
|
91
|
+
|
92
|
+
|
93
|
+
.Lightbox {
|
94
|
+
width: 100vw;
|
95
|
+
height: 100vh;
|
96
|
+
position: fixed;
|
97
|
+
left: 0;
|
98
|
+
top: 0;
|
99
|
+
display: flex;
|
100
|
+
align-items: center;
|
101
|
+
flex-direction: column;
|
102
|
+
background-color: black;
|
103
|
+
z-index: 1;
|
104
|
+
overflow: hidden;
|
105
|
+
}
|
106
|
+
|
107
|
+
.Slides {
|
108
|
+
display: flex;
|
109
|
+
flex-grow: 1;
|
110
|
+
height: calc(100% - 100px);
|
111
|
+
width: 100%;
|
112
|
+
z-index: 1;
|
113
|
+
|
114
|
+
[class^="react-transform-wrapper"] {
|
115
|
+
flex-shrink: 0;
|
116
|
+
width: 100%;
|
117
|
+
height: 100%;
|
118
|
+
}
|
119
|
+
|
120
|
+
[class^="react-transform-content"] {
|
121
|
+
width: 100%;
|
122
|
+
height: 100%;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
.Slide,
|
127
|
+
.Thumbnail {
|
128
|
+
flex-shrink: 0;
|
129
|
+
border: none;
|
130
|
+
margin: 0;
|
131
|
+
padding: 0;
|
132
|
+
cursor: pointer;
|
133
|
+
background-color: transparent;
|
134
|
+
}
|
135
|
+
|
136
|
+
.Slide {
|
137
|
+
display: flex;
|
138
|
+
justify-content: center;
|
139
|
+
align-items: center;
|
140
|
+
width: 100%;
|
141
|
+
height: 100%;
|
142
|
+
overflow: hidden;
|
143
|
+
|
144
|
+
img {
|
145
|
+
width: 100vw;
|
146
|
+
height: 100vh;
|
147
|
+
object-fit: contain;
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
.BackBtn,
|
152
|
+
.NextBtn {
|
153
|
+
z-index: 2;
|
154
|
+
color: black;
|
155
|
+
position: absolute;
|
156
|
+
width: 50px;
|
157
|
+
height: 50px;
|
158
|
+
top: calc(50vh - 5px);
|
159
|
+
border: none;
|
160
|
+
border-radius: 50%;
|
161
|
+
background-color: white;
|
162
|
+
}
|
163
|
+
|
164
|
+
.BackBtn::before,
|
165
|
+
.NextBtn::before {
|
166
|
+
content: "▸";
|
167
|
+
}
|
168
|
+
|
169
|
+
.BackBtn {
|
170
|
+
left: 30px;
|
171
|
+
transform: rotate(180deg);
|
172
|
+
}
|
173
|
+
|
174
|
+
.NextBtn {
|
175
|
+
right: 30px;
|
176
|
+
}
|
177
|
+
|
178
|
+
.Thumbnails {
|
179
|
+
display: flex;
|
180
|
+
padding: 3px;
|
181
|
+
}
|
182
|
+
|
183
|
+
.Thumbnails.draggable {
|
184
|
+
align-self: flex-start;
|
185
|
+
}
|
186
|
+
|
187
|
+
.Thumbnail {
|
188
|
+
padding: 3px;
|
189
|
+
height: 100%;
|
190
|
+
|
191
|
+
img {
|
192
|
+
width: 100%;
|
193
|
+
height: 100%;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
.Thumbnail.active {
|
198
|
+
padding: 6px;
|
199
|
+
background-color: white;
|
200
|
+
box-shadow: 0 0 6px white;
|
201
|
+
}
|
202
|
+
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.21.0.pre.alpha.lightbox
|
4
|
+
version: 10.21.0.pre.alpha.lightbox.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -1186,7 +1186,6 @@ files:
|
|
1186
1186
|
- app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.jsx
|
1187
1187
|
- app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.jsx
|
1188
1188
|
- app/pb_kits/playbook/pb_lightbox/Carousel/index.jsx
|
1189
|
-
- app/pb_kits/playbook/pb_lightbox/Carousel/styles.scss
|
1190
1189
|
- app/pb_kits/playbook/pb_lightbox/Carousel/useSlides.js
|
1191
1190
|
- app/pb_kits/playbook/pb_lightbox/_lightbox.jsx
|
1192
1191
|
- app/pb_kits/playbook/pb_lightbox/_lightbox_context.jsx
|
@@ -1,110 +0,0 @@
|
|
1
|
-
.Lightbox {
|
2
|
-
width: 100vw;
|
3
|
-
height: 100vh;
|
4
|
-
position: fixed;
|
5
|
-
left: 0;
|
6
|
-
top: 0;
|
7
|
-
display: flex;
|
8
|
-
align-items: center;
|
9
|
-
flex-direction: column;
|
10
|
-
background-color: black;
|
11
|
-
z-index: 1;
|
12
|
-
overflow: hidden;
|
13
|
-
}
|
14
|
-
|
15
|
-
.Slides {
|
16
|
-
display: flex;
|
17
|
-
flex-grow: 1;
|
18
|
-
height: calc(100% - 100px);
|
19
|
-
width: 100%;
|
20
|
-
z-index: 1;
|
21
|
-
|
22
|
-
[class^="react-transform-wrapper"] {
|
23
|
-
flex-shrink: 0;
|
24
|
-
width: 100%;
|
25
|
-
height: 100%;
|
26
|
-
}
|
27
|
-
|
28
|
-
[class^="react-transform-content"] {
|
29
|
-
width: 100%;
|
30
|
-
height: 100%;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
.Slide,
|
35
|
-
.Thumbnail {
|
36
|
-
flex-shrink: 0;
|
37
|
-
border: none;
|
38
|
-
margin: 0;
|
39
|
-
padding: 0;
|
40
|
-
cursor: pointer;
|
41
|
-
background-color: transparent;
|
42
|
-
}
|
43
|
-
|
44
|
-
.Slide {
|
45
|
-
display: flex;
|
46
|
-
justify-content: center;
|
47
|
-
align-items: center;
|
48
|
-
width: 100%;
|
49
|
-
height: 100%;
|
50
|
-
overflow: hidden;
|
51
|
-
|
52
|
-
img {
|
53
|
-
width: 100vw;
|
54
|
-
height: 100vh;
|
55
|
-
object-fit: contain;
|
56
|
-
}
|
57
|
-
}
|
58
|
-
|
59
|
-
.BackBtn,
|
60
|
-
.NextBtn {
|
61
|
-
z-index: 2;
|
62
|
-
color: black;
|
63
|
-
position: absolute;
|
64
|
-
width: 50px;
|
65
|
-
height: 50px;
|
66
|
-
top: calc(50vh - 5px);
|
67
|
-
border: none;
|
68
|
-
border-radius: 50%;
|
69
|
-
background-color: white;
|
70
|
-
}
|
71
|
-
|
72
|
-
.BackBtn::before,
|
73
|
-
.NextBtn::before {
|
74
|
-
content: "▸";
|
75
|
-
}
|
76
|
-
|
77
|
-
.BackBtn {
|
78
|
-
left: 30px;
|
79
|
-
transform: rotate(180deg);
|
80
|
-
}
|
81
|
-
|
82
|
-
.NextBtn {
|
83
|
-
right: 30px;
|
84
|
-
}
|
85
|
-
|
86
|
-
.Thumbnails {
|
87
|
-
display: flex;
|
88
|
-
padding: 3px;
|
89
|
-
}
|
90
|
-
|
91
|
-
.Thumbnails.draggable {
|
92
|
-
align-self: flex-start;
|
93
|
-
}
|
94
|
-
|
95
|
-
.Thumbnail {
|
96
|
-
padding: 3px;
|
97
|
-
height: 100%;
|
98
|
-
|
99
|
-
img {
|
100
|
-
width: 100%;
|
101
|
-
height: 100%;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
|
105
|
-
.Thumbnail.active {
|
106
|
-
padding: 6px;
|
107
|
-
background-color: white;
|
108
|
-
box-shadow: 0 0 6px white;
|
109
|
-
}
|
110
|
-
|