@@ -2,13 +2,6 @@ import styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';
22import { css } from '@patternfly/react-styles' ;
33import { formatBreakpointMods , setBreakpointCssVars , toCamel } from '../../helpers/util' ;
44import c_toolbar__item_Width from '@patternfly/react-tokens/dist/esm/c_toolbar__item_Width' ;
5- import c_toolbar__item_m_w_sm_Width from '@patternfly/react-tokens/dist/esm/c_toolbar__item_m_w_sm_Width' ;
6- import c_toolbar__item_m_w_md_Width from '@patternfly/react-tokens/dist/esm/c_toolbar__item_m_w_md_Width' ;
7- import c_toolbar__item_m_w_lg_Width from '@patternfly/react-tokens/dist/esm/c_toolbar__item_m_w_lg_Width' ;
8- import c_toolbar__item_m_w_xl_Width from '@patternfly/react-tokens/dist/esm/c_toolbar__item_m_w_xl_Width' ;
9- import c_toolbar__item_m_w_2xl_Width from '@patternfly/react-tokens/dist/esm/c_toolbar__item_m_w_2xl_Width' ;
10- import c_toolbar__item_m_w_3xl_Width from '@patternfly/react-tokens/dist/esm/c_toolbar__item_m_w_3xl_Width' ;
11- import c_toolbar__item_m_w_4xl_Width from '@patternfly/react-tokens/dist/esm/c_toolbar__item_m_w_4xl_Width' ;
125import { Divider } from '../Divider' ;
136import { PageContext } from '../Page/PageContext' ;
147
@@ -34,7 +27,7 @@ export interface ToolbarItemProps extends React.HTMLProps<HTMLDivElement> {
3427 xl ?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' ;
3528 '2xl' ?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' ;
3629 } ;
37- /** Flex grow modifier at various breakpoints */
30+ /** Indicates whether a flex grow modifier of 1 is applied at various breakpoints */
3831 flexGrow ?: {
3932 default ?: 'flexGrow' ;
4033 sm ?: 'flexGrow' ;
@@ -263,17 +256,17 @@ export const ToolbarItem: React.FunctionComponent<ToolbarItemProps> = ({
263256 if ( ! size ) {
264257 return acc ;
265258 }
266- const valueMap : Record < string , string > = {
267- sm : ( c_toolbar__item_m_w_sm_Width as any ) ?. value ,
268- md : ( c_toolbar__item_m_w_md_Width as any ) ?. value ,
269- lg : ( c_toolbar__item_m_w_lg_Width as any ) ?. value ,
270- xl : ( c_toolbar__item_m_w_xl_Width as any ) ?. value ,
271- '2xl' : ( c_toolbar__item_m_w_2xl_Width as any ) ?. value ,
272- '3xl' : ( c_toolbar__item_m_w_3xl_Width as any ) ?. value ,
273- '4xl' : ( c_toolbar__item_m_w_4xl_Width as any ) ?. value
259+ const cssVarValueMap : Record < string , string > = {
260+ sm : 'var(--pf-c-toolbar__item--m-w-sm--Width)' ,
261+ md : 'var(--pf-c-toolbar__item--m-w-md--Width)' ,
262+ lg : 'var(--pf-c-toolbar__item--m-w-lg--Width)' ,
263+ xl : 'var(--pf-c-toolbar__item--m-w-xl--Width)' ,
264+ '2xl' : 'var(--pf-c-toolbar__item--m-w-2xl--Width)' ,
265+ '3xl' : 'var(--pf-c-toolbar__item--m-w-3xl--Width)' ,
266+ '4xl' : 'var(--pf-c-toolbar__item--m-w-4xl--Width)'
274267 } ;
275- const tokenValue = valueMap [ size as keyof typeof valueMap ] ;
276- return tokenValue ? { ...acc , [ bp ] : tokenValue } : acc ;
268+ const value = cssVarValueMap [ size as keyof typeof cssVarValueMap ] ;
269+ return value ? { ...acc , [ bp ] : value } : acc ;
277270 } ,
278271 { } as Record < string , string >
279272 ) ,
0 commit comments