File tree 2 files changed +18
-13
lines changed
.storybook/stories/components
2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,18 @@ export const Default: Story = {
28
28
< Lightbox . Root >
29
29
< Flex gap = "3" >
30
30
< Lightbox . Triggers >
31
- < Lightbox . Trigger
32
- src = "https://img-v2-prod.whop.com/hBOMqb1G4YIzR0jw7qnF0_IkXBoAOh78ybHZt_mKrT8/rs:fit:1280:720/el:1/dpr:2/aHR0cHM6Ly9hc3NldHMud2hvcC5jb20vdXBsb2Fkcy8yMDI0LTExLTEyL3VzZXJfMjMzNDg3XzAxMmY0ZDBkLWY1M2UtNGJhZS1iOTNhLWI3YTVhODhjMjA1Yy5wbmc"
33
- alt = "placeholder"
34
- />
35
- < Lightbox . Trigger
36
- src = "https://img-v2-prod.whop.com/7nS_TeQmzSCCznok6NSF4dsz-UivsmFcSIejHh_diFU/rs:fit:1280:720/el:1/dpr:2/aHR0cHM6Ly9hc3NldHMud2hvcC5jb20vdXBsb2Fkcy8yMDI0LTExLTEyL3VzZXJfMjMzNDg3XzM1YmRkZjAwLTgzNDMtNDE4Yy1hYzYzLWZkY2VmYWU2YzBhYS5wbmc"
37
- alt = "placeholder"
38
- />
31
+ < Lightbox . Trigger >
32
+ < img
33
+ src = "https://img-v2-prod.whop.com/hBOMqb1G4YIzR0jw7qnF0_IkXBoAOh78ybHZt_mKrT8/rs:fit:1280:720/el:1/dpr:2/aHR0cHM6Ly9hc3NldHMud2hvcC5jb20vdXBsb2Fkcy8yMDI0LTExLTEyL3VzZXJfMjMzNDg3XzAxMmY0ZDBkLWY1M2UtNGJhZS1iOTNhLWI3YTVhODhjMjA1Yy5wbmc"
34
+ alt = "placeholder"
35
+ />
36
+ </ Lightbox . Trigger >
37
+ < Lightbox . Trigger >
38
+ < img
39
+ src = "https://img-v2-prod.whop.com/7nS_TeQmzSCCznok6NSF4dsz-UivsmFcSIejHh_diFU/rs:fit:1280:720/el:1/dpr:2/aHR0cHM6Ly9hc3NldHMud2hvcC5jb20vdXBsb2Fkcy8yMDI0LTExLTEyL3VzZXJfMjMzNDg3XzM1YmRkZjAwLTgzNDMtNDE4Yy1hYzYzLWZkY2VmYWU2YzBhYS5wbmc"
40
+ alt = "placeholder"
41
+ />
42
+ </ Lightbox . Trigger >
39
43
</ Lightbox . Triggers >
40
44
</ Flex >
41
45
Original file line number Diff line number Diff line change 3
3
import { ChevronLeft24 , ChevronRight24 , XMark24 } from "@frosted-ui/icons" ;
4
4
import * as DialogPrimitive from "@radix-ui/react-dialog" ;
5
5
import classNames from "classnames" ;
6
- import React , { type ComponentPropsWithoutRef } from "react" ;
6
+ import React , { Children , type ComponentPropsWithoutRef } from "react" ;
7
7
import { getValidChildren } from "../helpers" ;
8
8
import { useIsomorphicLayoutEffect } from "../helpers/use-isomorphic-layout-effect" ;
9
9
import { Theme } from "../theme" ;
@@ -121,15 +121,16 @@ const LightboxTriggers: React.FC<LightboxTriggersProps> = ({
121
121
122
122
type LightboxTriggerElement = React . ElementRef < typeof DialogPrimitive . Trigger > ;
123
123
124
- interface LightboxTriggerProps extends ComponentPropsWithoutRef < "img" > { }
124
+ interface LightboxTriggerProps
125
+ extends Omit < DialogPrimitive . DialogTriggerProps , "asChild" > { }
125
126
126
127
const LightboxTrigger : React . FC < LightboxTriggerProps > = React . forwardRef <
127
128
LightboxTriggerElement ,
128
129
LightboxTriggerProps
129
- > ( ( props , forwardedRef ) => {
130
+ > ( ( { children , ... props } , forwardedRef ) => {
130
131
return (
131
- < DialogPrimitive . Trigger ref = { forwardedRef } asChild >
132
- < img { ... props } />
132
+ < DialogPrimitive . Trigger ref = { forwardedRef } asChild { ... props } >
133
+ { children }
133
134
</ DialogPrimitive . Trigger >
134
135
) ;
135
136
} ) ;
You can’t perform that action at this time.
0 commit comments