@nulogy/components
Advanced tools
Changelog
11.0.0 (2024-11-25)
icon
and iconSize
props from the input
in-favor of iconLeft
, iconRight
, iconRightSize
, iconLeftSize
Migration:
icon
prop with iconRight
iconSize
prop with iconRightSize
size
prop to variant
.The size
prop was originally used sparingly in some components like the
Button and the Icon to resize those components.
It was later extended to make all interactive components large enough to
be used on a touch screen, through changing the size
prop directly or
by passing a size
prop to the NDSProvider globally.
With this change, we retain the use of the size
prop for select
components, and introduce a variant
prop that can be passed either to
individual components or the NDSProvider globally with the value of
either desktop
or touch
.
NDS is introducing context-specific default themes. Directly importing themes from NDS may result in using the wrong theme, causing conflicts between custom app themes, desktop, and touch variants.
Instead of importing the theme from NDS like so:
import { theme } from "@nulogy/components"
,
you can use and access the theme in one of the following ways:
const Example = styled.div(({ theme }) => ({
marginLeft: theme.space.x3,
marginBottom: theme.space.x1,
color: theme.colors.darkBlue,
}));
function Component(props: Props) {
return (
<Box ml="x3" mb="x1" color="darkBlue">
{props.children}
</Box>
)
}
import { useTheme } from "styled-components"
function getPaddingBasedOnSomeProp(foo, theme) { ... }
function Component(props: Props) {
const theme = useTheme()
const horizontalPadding = getPaddingBasedOnSomeProp(props.foo, theme)
return (
<Box px={horizontalPadding}>
{props.children}
</Box>
)
}
Changelog
11.0.0 (2024-11-07)
icon
and iconSize
props from the input
in-favor of iconLeft
, iconRight
, iconRightSize
, iconLeftSize
Migration:
icon
prop with iconRight
iconSize
prop with iconRightSize
size
prop to variant
.The size
prop was originally used sparingly in some components like the
Button and the Icon to resize those components.
It was later extended to make all interactive components large enough to
be used on a touch screen, through changing the size
prop directly or
by passing a size
prop to the NDSProvider globally.
With this change, we retain the use of the size
prop for select
components, and introduce a variant
prop that can be passed either to
individual components or the NDSProvider globally with the value of
either desktop
or touch
.
NDS is introducing context-specific default themes. Directly importing themes from NDS may result in using the wrong theme, causing conflicts between custom app themes, desktop, and touch variants.
Instead of importing the theme from NDS like so:
import { theme } from "@nulogy/components"
,
you can use and access the theme in one of the following ways:
const Example = styled.div(({ theme }) => ({
marginLeft: theme.space.x3,
marginBottom: theme.space.x1,
color: theme.colors.darkBlue,
}));
function Component(props: Props) {
return (
<Box ml="x3" mb="x1" color="darkBlue">
{props.children}
</Box>
)
}
import { useTheme } from "styled-components"
function getPaddingBasedOnSomeProp(foo, theme) { ... }
function Component(props: Props) {
const theme = useTheme()
const horizontalPadding = getPaddingBasedOnSomeProp(props.foo, theme)
return (
<Box px={horizontalPadding}>
{props.children}
</Box>
)
}