File tree Expand file tree Collapse file tree 3 files changed +18
-9
lines changed
website/content/components Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import {
1616 Snackbar ,
1717 Tooltip ,
1818} from '../../src' ;
19- import { FlexItem } from '../../src/components/Flex/FlexItem/FlexItem' ;
2019import { Keys , pressedKey } from '../../src/lib/accessibility' ;
2120import { OverviewLayout } from '../common/components/OverviewLayout' ;
2221import { useGetGlobalParams } from '../common/hooks/useGetGlobalParams' ;
@@ -114,7 +113,7 @@ const IconsOverview = () => {
114113 ItemsContainer = { ( { children } ) => < Flex gap = { [ '2xl' , 'xl' ] } > { children } </ Flex > }
115114 renderSectionItem = { ( iconData , iconSizeData ) => (
116115 < Tooltip key = { iconData . name } title = { iconData . name } strategy = "absolute" >
117- < FlexItem
116+ < div
118117 onClick = { ( ) => onIconClick ( iconData . name ) }
119118 onKeyDown = { ( e ) => onKeyDown ( e , iconData . name ) }
120119 className = { styles . icon }
@@ -123,7 +122,7 @@ const IconsOverview = () => {
123122 style = { { inlineSize : Number ( iconSizeData . title ) } }
124123 >
125124 { iconData . node }
126- </ FlexItem >
125+ </ div >
127126 </ Tooltip >
128127 ) }
129128 additionalHeaderItem = {
@@ -136,7 +135,7 @@ const IconsOverview = () => {
136135 allowClearButton
137136 />
138137 { selectedSizes . length < SIZES_OPTIONS . length && (
139- < FlexItem flex = "shrink" >
138+ < Flex flexShrink = { 1 } >
140139 < Button
141140 size = "m"
142141 mode = "secondary"
@@ -145,7 +144,7 @@ const IconsOverview = () => {
145144 rounded
146145 aria-label = "Сбросить фильтры"
147146 />
148- </ FlexItem >
147+ </ Flex >
149148 ) }
150149 </ Flex >
151150 }
Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ import {
44 columnGapClassNames ,
55 type GapProp ,
66 type GapsProp ,
7+ resolveLayoutProps ,
78 rowGapClassNames ,
89} from '../../lib/layouts' ;
10+ import type { LayoutProps } from '../../lib/layouts/types' ;
911import type { CSSCustomProperties } from '../../types' ;
1012import { RootComponent } from '../RootComponent/RootComponent' ;
1113import type { RootComponentProps } from '../RootComponent/RootComponent' ;
@@ -48,7 +50,9 @@ type FlexContentProps =
4850 | 'space-between'
4951 | 'space-evenly' ;
5052
51- export interface FlexProps extends Omit < RootComponentProps < HTMLElement > , 'baseClassName' > {
53+ export interface FlexProps
54+ extends Omit < RootComponentProps < HTMLElement > , 'baseClassName' > ,
55+ LayoutProps {
5256 /**
5357 * Направление осей, эквивалентно `flex-direction`.
5458 */
@@ -104,13 +108,14 @@ export const Flex: React.FC<FlexProps> & {
104108 reverse = false ,
105109 children,
106110 alignSelf,
107- ...props
111+ ...restProps
108112} : FlexProps ) => {
109113 const [ rowGap , columnGap ] = calculateGap ( gap ) ;
114+ const resolvedProps = resolveLayoutProps ( restProps ) ;
110115
111116 return (
112117 < RootComponent
113- { ...props }
118+ { ...resolvedProps }
114119 baseClassName = { classNames (
115120 styles . host ,
116121 ! noWrap && styles . wrap ,
Original file line number Diff line number Diff line change @@ -117,7 +117,9 @@ VKUI (например, [`Header`](/components/group#header) и [`SimpleCell`](/
117117 ```
118118</Playground >
119119
120- ## Flex.Item [ tag:component]
120+ ## ~ Flex.Item~ [ tag:component]
121+
122+ > Подкомпонент устарел. Используйте ` Flex ` , который теперь принимает все свойства ` Flex.Item ` .
121123
122124Подкомпонент ` Flex.Item ` используется как обёртка для дочерних элементов компонента ` Flex ` в случае, когда нужно
123125переопределить ` flex ` -свойства этих элементов, например, ` flex-basis ` :
@@ -129,6 +131,9 @@ VKUI (например, [`Header`](/components/group#header) и [`SimpleCell`](/
129131 < Flex .Item flexBasis= {100 }>
130132 < Card Component= " div" > Ширина 100px < / Card>
131133 < / Flex .Item >
134+ < Flex flexBasis= {100 }>
135+ < Card Component= " div" > Я лучше Ширина 100px < / Card>
136+ < / Flex>
132137 < Card Component= " div" > Колонка< / Card>
133138 < / Flex>
134139 ```
You can’t perform that action at this time.
0 commit comments