Skip to content

Commit fe01347

Browse files
authored
chore: update radio button and typography (#441)
* chore(radio button): add support for alignItems prop * chore(typography): add support for code format * v2.9.6
1 parent 82a7e4c commit fe01347

4 files changed

Lines changed: 18 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netdata/netdata-ui",
3-
"version": "2.9.5",
3+
"version": "2.9.6",
44
"description": "netdata UI kit",
55
"main": "./lib/index.js",
66
"files": [

src/components/radio-button/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ const radioButtonStyles = {
1414
}
1515

1616
const RadioButton = ({
17-
label,
17+
alignItems = "center",
18+
alignSelf,
1819
checked,
19-
disabled,
2020
children,
21-
margin,
22-
alignSelf,
21+
disabled,
2322
iconProps,
23+
label,
24+
margin,
2425
...rest
2526
}) => {
2627
const radioStatus =
@@ -39,7 +40,7 @@ const RadioButton = ({
3940
const showIcon = radioStatus === "checkedDisabled" || radioStatus === "checked"
4041

4142
return (
42-
<Container disabled={disabled} margin={margin} alignSelf={alignSelf}>
43+
<Container alignItems={alignItems} alignSelf={alignSelf} disabled={disabled} margin={margin}>
4344
<Input type="radio" disabled={disabled} checked={checked} {...rest} />
4445
<IconContainer
4546
background={radioStyles.containerColor}

src/components/radio-button/styled.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import styled from "styled-components"
22
import { getColor } from "src/theme/utils"
33
import margin from "src/mixins/margin"
4+
import alignItems from "src/components/templates/mixins/alignItems"
45
import alignSelf from "src/mixins/alignSelf"
56
import { Icon } from "src/components/icon"
67
import disabled from "./mixins/disabled"
@@ -20,6 +21,7 @@ export const Container = styled.label`
2021
display: flex;
2122
flex-direction: row;
2223
align-items: center;
24+
${alignItems}
2325
${alignSelf}
2426
2527
${margin}

src/components/typography/typography.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,18 @@ const makeFontWeight =
1818
({ strong = defaultStrong }) =>
1919
`font-weight: ${strong ? "bold" : "normal"};`
2020
export const fontColor = ({ theme, color = "text" }) => `color: ${getColor(color)({ theme })};`
21+
export const fontCode = ({ background = "text", code, color = "elementBackground", theme }) =>
22+
code &&
23+
`
24+
background-color: ${getColor(background)({ theme })};
25+
border-radius: 4px;
26+
color: ${getColor(color)({ theme })};
27+
padding: 0 6px;
28+
`
2129

2230
const typography = css`
2331
${fontColor}
32+
${fontCode}
2433
${alignSelf}
2534
${textAlign}
2635
${textDecoration}

0 commit comments

Comments
 (0)