v10

Orbit Migration Guide v10

Breaking changes

Tailwind requirement

StyledBox removed

import { StyledBox } from "@kiwicom/orbit-components";
const SomeWrapper = styled.div`
height: 100%;
${StyledBox} {
padding: 10px;
}
`;
const SomeWrapper = styled.div`
height: 100%;
.orbit-box {
padding: 10px;
}
`;

Using the styled function

import styled from "styled-components";
import { Box } from "@kiwicom/orbit-components";
const CustomBox = styled(Box)`
${({theme})} => css`
line-height: ${theme.orbit.lineHeightNormal};
padding: ${theme.orbit.spaceSmall};
`};
`;
import { Box } from "@kiwicom/orbit-components";
const CustomBox = props => <Box className="leading-normal" padding="small" {...props} />;

Color props in BadgePrimitive (background and foregroundColor)

<BadgePrimitive background="#005AA3" foregroundColor="#fff" />
<BadgePrimitive className="bg-blue-dark text-white-normal" />

Align prop in Text

Icon prop in Card

<CardSection
icon={<CarrierLogo carriers={[{ code: "G9", name: "Air Arabia" }]} size="large" />}
title={
<Stack direction="row" spacing="XXSmall" align="center">
<Text weight="bold">Cairo CAI</Text>
<FlightDirect size="small" />
<Text weight="bold">Dubai SHJ</Text>
</Stack>
}
/>
<CardSection
title={
<Stack direction="row" spacing="XSmall" align="center">
<Box>
<CarrierLogo carriers={[{ code: "G9", name: "Air Arabia" }]} size="large" />
</Box>
<Stack direction="row" spacing="XXSmall" align="center">
<Text weight="bold">Cairo CAI</Text>
<FlightDirect size="small" />
<Text weight="bold">Dubai SHJ</Text>
</Stack>
</Stack>
}
/>

Deprecations

Desktop

<Desktop>
<Text>Only visible on desktop</Text>
</Desktop>
<Hide on={["smallMobile", "mediumMobile", "largeMobile", "tablet"]}>
<Text>Only visible on desktop</Text>
</Hide>

Mobile

<Mobile>
<Text>Only visible on mobile</Text>
</Mobile>
<Hide on={["desktop", "largeDesktop"]}>
<Text>Only visible on mobile</Text>
</Hide>

KeyValue