playbook_ui 12.17.0.pre.alpha.lightboxcurrentPhotoIndex582 → 12.17.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bed2313044d6ca33a9bb666afe1c6305e5d99b9f1de9d809d28b6978b45637a8
4
- data.tar.gz: ca47d98d665b8112837f2e39f57ee39fc10cd3f3440e56e1c986d424bcb4bddc
3
+ metadata.gz: cd6838e0560cc93f906cf9adc9ca3b2ddf760b04eb217a758de88cf4d55f5921
4
+ data.tar.gz: 7fe4be39b88ef061b65beb11d35680d3faf0ffe9eea5696f4cffdb0385eff6a5
5
5
  SHA512:
6
- metadata.gz: 71e5a51e29e811bd4b5170728cf2bf8ee1dd80147d33697edd13a334206119fe9bae3ae9e16e107bdc557027208d6b17e46d4976e9a222582d72849a9ed917af
7
- data.tar.gz: 5bf261e0aeaf57de2c6d6807b205302e0beedf6943f53d65d1338dff3ba81ff4e068cd51f574b122c292bda0bbe6ce6dda06476596e2c69f4e22cdb091a5859b
6
+ metadata.gz: 50fb6671787a4142632f88b003d143dc5731ca71e06e8c3cbe94ecf6e4650c803466e79365047133bd9eb43049c0f0731b504ee8d013c73ab03f0cca7794dc46
7
+ data.tar.gz: 7965856ed4ff7d6c7197f5bdaead0960549c67673c94da1f659b4d1a65cb2c179c0fa8800900c6323675afb823e06a5ab24d1735d58a7d8fadc28b9cc843e4ac
@@ -47,15 +47,12 @@ const Lightbox = (props: LightboxType): React.ReactNode => {
47
47
  } = props
48
48
 
49
49
  const [activePhoto, setActivePhoto] = useState(initialPhoto)
50
-
51
50
  useEffect(() => {
52
51
  onChange(activePhoto)
53
52
  },[activePhoto])
54
53
 
55
54
  useEffect(() => {
56
- currentPhotoIndex !== undefined && currentPhotoIndex !== null && (
57
55
  setActivePhoto(currentPhotoIndex)
58
- )
59
56
  },[currentPhotoIndex])
60
57
 
61
58
  const ariaProps = buildAriaProps(aria)
@@ -10,17 +10,14 @@ const LightboxCompoundComponent = (props) => {
10
10
  'https://images.unsplash.com/photo-1501045337096-542a73dafa4f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2052&q=80',
11
11
  'https://images.unsplash.com/photo-1563693998336-93c10e5d8f91?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80,',
12
12
  ]
13
- const [selectedPhoto, setSelectedPhoto] = useState(0)
14
13
  const [showLightbox, toggleShowLightbox] = useState(false)
15
14
 
16
15
  const handleCloseLightbox = () => {
17
16
  toggleShowLightbox(!showLightbox)
18
- setSelectedPhoto(null)
19
17
  }
20
18
 
21
- const onPhotoClick = (photo) => {
19
+ const onPhotoClick = () => {
22
20
  toggleShowLightbox(!showLightbox)
23
- setSelectedPhoto(photo)
24
21
  }
25
22
 
26
23
  const exampleStyles = {
@@ -34,7 +31,6 @@ const LightboxCompoundComponent = (props) => {
34
31
  {showLightbox ? (
35
32
  <Lightbox
36
33
  description='Description Content Goes Here.'
37
- initialPhoto={selectedPhoto}
38
34
  onClose={handleCloseLightbox}
39
35
  photos={photos}
40
36
  title='Windows, Sidings, & Gutters'
@@ -118,4 +118,4 @@ const LightboxCurrentPhoto = (props) => {
118
118
  )
119
119
  }
120
120
 
121
- export default LightboxCurrentPhoto
121
+ export default LightboxCurrentPhoto
@@ -10,17 +10,14 @@ const LightboxCustomHeader = (props) => {
10
10
  "https://images.unsplash.com/photo-1501045337096-542a73dafa4f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2052&q=80",
11
11
  "https://images.unsplash.com/photo-1563693998336-93c10e5d8f91?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80,",
12
12
  ];
13
- const [selectedPhoto, setSelectedPhoto] = useState(0);
14
13
  const [showLightbox, toggleShowLightbox] = useState(false);
15
14
 
16
15
  const handleCloseLightbox = () => {
17
16
  toggleShowLightbox(!showLightbox);
18
- setSelectedPhoto(null);
19
17
  };
20
18
 
21
- const onPhotoClick = (photo) => {
19
+ const onPhotoClick = () => {
22
20
  toggleShowLightbox(!showLightbox);
23
- setSelectedPhoto(photo);
24
21
  };
25
22
 
26
23
  const exampleStyles = {
@@ -55,7 +52,6 @@ const LightboxCustomHeader = (props) => {
55
52
  {showLightbox ? (
56
53
  <Lightbox
57
54
  description={customDescription}
58
- initialPhoto={selectedPhoto}
59
55
  navRight="All Photos"
60
56
  onClickRight={()=> alert("Clicked!")}
61
57
  onClose={handleCloseLightbox}
@@ -8,17 +8,14 @@ const LightboxDefault = (props) => {
8
8
  const photos = [
9
9
  'https://images.unsplash.com/photo-1638727228877-d2a79ab75e68?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2668&q=80',
10
10
  ]
11
- const [selectedPhoto, setSelectedPhoto] = useState(0)
12
11
  const [showLightbox, toggleShowLightbox] = useState(false)
13
12
 
14
13
  const handleCloseLightbox = () => {
15
14
  toggleShowLightbox(!showLightbox)
16
- setSelectedPhoto(null)
17
15
  }
18
16
 
19
- const onPhotoClick = (photoIndex) => {
17
+ const onPhotoClick = () => {
20
18
  toggleShowLightbox(!showLightbox)
21
- setSelectedPhoto(photoIndex)
22
19
  }
23
20
 
24
21
  return (
@@ -27,7 +24,6 @@ const LightboxDefault = (props) => {
27
24
  {showLightbox ? (
28
25
  <Lightbox
29
26
  icon="times"
30
- initialPhoto={selectedPhoto}
31
27
  onClose={handleCloseLightbox}
32
28
  photos={photos}
33
29
  {...props}
@@ -1 +1 @@
1
- Lightbox contains several props: `photos` (an array of urls), `initialPhoto` (a number), `onClickLeft` (an optional callback function for top left close button), `title` and `description` (string or custom components), `icon` ( optional prop for the close button in the top left of the header), `navRight` (optional prop that renders clickable text in the top right section of the header), `onClickRight` (optional callback function of navRight) and `onChange` (optional event handler prop exposing index of current photo).
1
+ Lightbox contains several props: `photos` (an array of urls), `onClickLeft` (an optional callback function for top left close button), `title` and `description` (string or custom components), `icon` ( optional prop for the close button in the top left of the header), `navRight` (optional prop that renders clickable text in the top right section of the header), `onClickRight` (optional callback function of navRight) and `onChange` (optional event handler prop exposing index of current photo).
@@ -29,17 +29,14 @@ const LightboxMultiple = (props) => {
29
29
  'https://images.unsplash.com/photo-1526657782461-9fe13402a841?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1984&q=80',
30
30
  'https://images.unsplash.com/photo-1523057530100-383d7fbc77a1?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2669&q=80',
31
31
  ]
32
- const [selectedPhoto, setSelectedPhoto] = useState(0)
33
32
  const [light, toggleLight] = useState(false)
34
33
 
35
34
  const handleCloseLightbox = () => {
36
35
  toggleLight(!light)
37
- setSelectedPhoto(null)
38
36
  }
39
37
 
40
- const onPhotoClick = (photo) => {
38
+ const onPhotoClick = () => {
41
39
  toggleLight(!light)
42
- setSelectedPhoto(photo)
43
40
  }
44
41
 
45
42
  const exampleStyles = {
@@ -52,7 +49,6 @@ const LightboxMultiple = (props) => {
52
49
  {light ? (
53
50
  <Lightbox
54
51
  icon="times"
55
- initialPhoto={selectedPhoto}
56
52
  onChange={(index) => console.log(`current photo index: ${index}`)}
57
53
  onClose={handleCloseLightbox}
58
54
  photos={photos}
@@ -18,7 +18,6 @@ test('Kit renders', () => {
18
18
  data={{ testid: testId }}
19
19
  icon="close"
20
20
  id="test1"
21
- initialPhoto={1}
22
21
  onClose={() => {}}
23
22
  photos={TEST_PHOTOS}
24
23
  />
@@ -35,7 +34,6 @@ test('Shows selected images', () => {
35
34
  data={{ testid: testId }}
36
35
  icon="close"
37
36
  id="test1"
38
- initialPhoto={1}
39
37
  onClose={() => {}}
40
38
  photos={TEST_PHOTOS}
41
39
  />
@@ -43,7 +41,7 @@ test('Shows selected images', () => {
43
41
  const kit = screen.getByTestId(testId)
44
42
  const slide = kit.getElementsByClassName('Slide')[0]
45
43
  const image = slide.getElementsByTagName('img')[0]
46
- expect(image).toHaveAttribute('src', TEST_PHOTOS[1])
44
+ expect(image).toHaveAttribute('src', TEST_PHOTOS[0])
47
45
 
48
46
  const thumbnails = kit.getElementsByClassName('Thumbnail')
49
47
 
@@ -77,7 +75,6 @@ test('Closes on escape key', async () => {
77
75
  data={{ testid: testId }}
78
76
  icon="close"
79
77
  id="test1"
80
- initialPhoto={0}
81
78
  onClose={mockClose}
82
79
  photos={TEST_PHOTOS}
83
80
  />
@@ -106,7 +103,6 @@ test('Closes on close button', async () => {
106
103
  data={{ testid: testId }}
107
104
  icon="close"
108
105
  id="test1"
109
- initialPhoto={0}
110
106
  onClose={mockClose}
111
107
  photos={TEST_PHOTOS}
112
108
  />
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "12.17.0"
5
- VERSION = "12.17.0.pre.alpha.lightboxcurrentPhotoIndex582"
4
+ PREVIOUS_VERSION = "12.16.0"
5
+ VERSION = "12.17.0"
6
6
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.17.0.pre.alpha.lightboxcurrentPhotoIndex582
4
+ version: 12.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
8
8
  - Power Devs
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-04-30 00:00:00.000000000 Z
12
+ date: 2023-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -2474,7 +2474,7 @@ homepage: http://playbook.powerapp.cloud
2474
2474
  licenses:
2475
2475
  - ISC
2476
2476
  metadata: {}
2477
- post_install_message:
2477
+ post_install_message:
2478
2478
  rdoc_options: []
2479
2479
  require_paths:
2480
2480
  - lib
@@ -2485,12 +2485,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
2485
2485
  version: '0'
2486
2486
  required_rubygems_version: !ruby/object:Gem::Requirement
2487
2487
  requirements:
2488
- - - ">"
2488
+ - - ">="
2489
2489
  - !ruby/object:Gem::Version
2490
- version: 1.3.1
2490
+ version: '0'
2491
2491
  requirements: []
2492
2492
  rubygems_version: 3.3.7
2493
- signing_key:
2493
+ signing_key:
2494
2494
  specification_version: 4
2495
2495
  summary: Playbook Design System
2496
2496
  test_files: []