Skip to content

Commit

Permalink
fix: rowGap and columnGap style properties not accepting strings (#2525)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj authored Jan 19, 2024
1 parent 7403b21 commit 9e5842b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-gorillas-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-pdf/types': patch
---

Fix rowGap and columnGap style properties not accepting strings
66 changes: 52 additions & 14 deletions packages/types/style.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
export interface Style {
// Flexbox

alignContent?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around';
alignContent?:
| 'flex-start'
| 'flex-end'
| 'center'
| 'stretch'
| 'space-between'
| 'space-around';
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
alignSelf?:
| 'auto'
| 'flex-start'
| 'flex-end'
| 'center'
| 'baseline'
| 'stretch';
flex?: number | string;
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
flexFlow?: number;
flexGrow?: number;
flexShrink?: number;
flexBasis?: number | string;
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-around' | 'space-between' | 'space-evenly';
justifyContent?:
| 'flex-start'
| 'flex-end'
| 'center'
| 'space-around'
| 'space-between'
| 'space-evenly';
gap?: number | string;
rowGap?: number;
columnGap?: number;
rowGap?: number | string;
columnGap?: number | string;

// Layout

Expand Down Expand Up @@ -48,14 +66,34 @@ export interface Style {
fontSize?: number | string;
fontFamily?: string;
fontStyle?: string | 'normal';
fontWeight?: number | 'thin' | 'hairline' | 'ultralight' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'demibold' | 'bold' | 'ultrabold' | 'extrabold' | 'heavy' | 'black';
fontWeight?:
| number
| 'thin'
| 'hairline'
| 'ultralight'
| 'extralight'
| 'light'
| 'normal'
| 'medium'
| 'semibold'
| 'demibold'
| 'bold'
| 'ultrabold'
| 'extrabold'
| 'heavy'
| 'black';
letterSpacing?: number | string;
lineHeight?: number | string;
maxLines?: number; // ?
textAlign?: 'left' | 'right' | 'center' | 'justify'; // ?
textDecoration?: 'line-through' | 'underline' | 'none' | 'line-through underline' | 'underline line-through';
textDecoration?:
| 'line-through'
| 'underline'
| 'none'
| 'line-through underline'
| 'underline line-through';
textDecorationColor?: string;
textDecorationStyle?: "dashed" | "dotted" | "solid" | string; // ?
textDecorationStyle?: 'dashed' | 'dotted' | 'solid' | string; // ?
textIndent?: any; // ?
textOverflow?: 'ellipsis';
textTransform?: 'capitalize' | 'lowercase' | 'uppercase';
Expand Down Expand Up @@ -97,26 +135,26 @@ export interface Style {
border?: number | string;
borderWidth?: number | string;
borderColor?: string;
borderStyle?: "dashed" | "dotted" | "solid";
borderStyle?: 'dashed' | 'dotted' | 'solid';
borderTop?: number | string;
borderTopColor?: string;
borderTopStyle?: "dashed" | "dotted" | "solid"; // ?
borderTopStyle?: 'dashed' | 'dotted' | 'solid'; // ?
borderTopWidth?: number | string;
borderRight?: number | string;
borderRightColor?: string;
borderRightStyle?: "dashed" | "dotted" | "solid"; // ?
borderRightStyle?: 'dashed' | 'dotted' | 'solid'; // ?
borderRightWidth?: number | string;
borderBottom?: number | string;
borderBottomColor?: string;
borderBottomStyle?: "dashed" | "dotted" | "solid"; // ?
borderBottomStyle?: 'dashed' | 'dotted' | 'solid'; // ?
borderBottomWidth?: number | string;
borderLeft?: number | string;
borderLeftColor?: string;
borderLeftStyle?: "dashed" | "dotted" | "solid"; // ?
borderLeftStyle?: 'dashed' | 'dotted' | 'solid'; // ?
borderLeftWidth?: number | string;
borderTopLeftRadius?: number | string;
borderTopRightRadius?: number | string;
borderBottomRightRadius?: number | string;
borderBottomLeftRadius?: number | string;
borderRadius?: number | string
borderRadius?: number | string;
}

0 comments on commit 9e5842b

Please sign in to comment.