1- import React from 'react'
1+ import React , { type CSSProperties } from 'react'
22import { clsx } from 'clsx'
33import type { ResponsiveValue } from '../hooks/useResponsiveValue'
44import { getBreakpointDeclarations } from '../utils/getBreakpointDeclarations'
@@ -14,6 +14,7 @@ export type HiddenProps = {
1414 when : Array < Viewport > | Viewport
1515 children : React . ReactNode
1616 className ?: string
17+ style ?: CSSProperties
1718}
1819
1920/* Normalize the value that is received from the prop `when`.
@@ -37,7 +38,7 @@ function normalize(hiddenViewports: Array<Viewport> | Viewport): ResponsiveValue
3738 }
3839}
3940
40- export const Hidden = ( { when, className, children} : HiddenProps ) => {
41+ export const Hidden = ( { when, className, style , children} : HiddenProps ) => {
4142 const enabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
4243 const normalizedStyles = normalize ( when )
4344
@@ -52,7 +53,8 @@ export const Hidden = ({when, className, children}: HiddenProps) => {
5253 '--hiddenDisplay-narrow' : normalizedStyles . narrow ? 'none' : undefined ,
5354 '--hiddenDisplay-regular' : normalizedStyles . regular ? 'none' : undefined ,
5455 '--hiddenDisplay-wide' : normalizedStyles . wide ? 'none' : undefined ,
55- } as React . CSSProperties
56+ ...style ,
57+ } as CSSProperties
5658 }
5759 >
5860 { children }
0 commit comments