Skip to content

Commit c563623

Browse files
committed
feat(ui-flex): add order prop to Flex.Item
INSTUI-4663
1 parent 0eaa872 commit c563623

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/ui-flex/src/Flex/Item/props.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,9 @@ type FlexItemOwnProps = {
113113
/**
114114
* Specifies the order of the `Flex.Item` inside the `Flex` component.
115115
*
116-
* Items with the same order revert to source order.
117-
*
118-
* Utilizes the order flex CSS property. Default order CSS value is 0.
116+
* Utilizes the order flex CSS property.
119117
*/
120-
order?: string | number
118+
order?: number
121119
}
122120

123121
type PropKeys = keyof FlexItemOwnProps
@@ -145,7 +143,7 @@ const propTypes: PropValidators<PropKeys> = {
145143
shouldShrink: PropTypes.bool,
146144
size: PropTypes.string,
147145
withVisualDebug: PropTypes.bool,
148-
order: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
146+
order: PropTypes.number
149147
}
150148

151149
const allowedProps: AllowedPropKeys = [

packages/ui-flex/src/Flex/Item/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const generateStyle = (
5353
boxSizing: 'border-box',
5454
minWidth: '0.0625rem',
5555
flexBasis: size,
56-
...(order !== undefined && { order }),
56+
...(order !== undefined ? { order } : {}),
5757
// initial value is 1, but we want 0 as our default,
5858
// so users can opt in to shrink like they do grow
5959
flexShrink: shouldShrink ? 1 : 0,

0 commit comments

Comments
 (0)