Skip to content

Commit 4317c6f

Browse files
committed
Rename 'scrimColor' prop to 'scrim'
1 parent 80b3f08 commit 4317c6f

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

src/components/Lightbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function Lightbox({
3434
onChangeImage,
3535
onRequestClose,
3636
rounded,
37-
scrimColor = 'auto',
37+
scrim = 'auto',
3838
...rest
3939
}: LightboxProps) {
4040
const currentImage =
@@ -70,7 +70,7 @@ export default function Lightbox({
7070
closeOnScrimClick={false}
7171
dialogClassName="lightbox__dialog"
7272
onRequestClose={onRequestClose}
73-
scrimColor={scrimColor}
73+
scrim={scrim}
7474
{...rest}
7575
>
7676
<div className="lightbox__container">

src/components/Overlay.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type OverlayProps = {
1717
open?: boolean;
1818
reflow?: boolean;
1919
rootElement?: string;
20-
scrimColor?: 'auto' | 'dark' | 'light';
20+
scrim?: 'auto' | 'dark' | 'light';
2121
theme?: ThemeToken;
2222
} & React.ComponentPropsWithoutRef<'div'>;
2323

@@ -33,17 +33,15 @@ export default function Overlay({
3333
open = false,
3434
reflow = true,
3535
rootElement = 'body',
36-
scrimColor = 'dark',
36+
scrim = 'dark',
3737
theme,
3838
...rest
3939
}: OverlayProps) {
4040
const scrimClassNames = classNames('overlay__scrim', {
41-
'bg-white':
42-
scrimColor === 'light' || (scrimColor === 'auto' && theme === 'light'),
41+
'bg-white': scrim === 'light' || (scrim === 'auto' && theme === 'light'),
4342
'bg-black':
44-
scrimColor === 'dark' ||
45-
(scrimColor === 'auto' && theme !== 'light' && theme),
46-
'bg-background': scrimColor === 'auto' && !theme,
43+
scrim === 'dark' || (scrim === 'auto' && theme !== 'light' && theme),
44+
'bg-background': scrim === 'auto' && !theme,
4745
hidden: hideScrim,
4846
});
4947
useBodyOverflow(open, reflow);

stories/Lightbox.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const Rounded: Story = {
8888

8989
export const DarkScrim: Story = {
9090
args: {
91-
scrimColor: 'dark',
91+
scrim: 'dark',
9292
images: [
9393
'https://picsum.photos/seed/10/1280/720',
9494
'https://picsum.photos/seed/100/1280/720',

stories/Overlay.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const Default: Story = {
3232
};
3333

3434
export const LightScrim: Story = {
35-
args: { scrimColor: 'light' },
35+
args: { scrim: 'light' },
3636
decorators: [Decorator],
3737
};
3838

0 commit comments

Comments
 (0)