Skip to content

Commit 2e7abec

Browse files
authored
WEB-73 Enable strict typing (#90)
- Enabled strict typing - Removed undefined from Puck component fields who were guaranteed to be defined
2 parents 412582c + f651953 commit 2e7abec

11 files changed

Lines changed: 21 additions & 21 deletions

File tree

src/components/puck/Container.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { gapSettingsField, outlineSettingsField, paddingSettingsField } from "..
33

44
export interface ContainerProps {
55
content?: SlotComponent;
6-
padding?: string;
7-
gap?: string;
8-
outline?: string;
6+
padding: string;
7+
gap: string;
8+
outline: string;
99
}
1010

1111
export const Container: React.FC<ContainerProps> = ({
@@ -27,6 +27,7 @@ export const ContainerConfig: ComponentConfig<ContainerProps> = {
2727
defaultProps: {
2828
padding: "p-10",
2929
gap: "gap-6",
30+
outline: "",
3031
},
3132
render: (props) => <Container {...props} />,
3233
}

src/components/puck/Content.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import React from 'react';
33
import { paddingSettingsField, backgroundColorSettingField } from '../../lib/settings-fields';
44

55
export type ContentProps = {
6-
backgroundColor?: string;
7-
padding?: string;
6+
backgroundColor: string;
7+
padding: string;
88
minHeight?: string;
99
text?: string;
1010
};

src/components/puck/HeaderContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { paddingSettingsField, textColorSettingField } from '../../lib/settings-
44

55
export type HeaderContentProps = {
66
backgroundColor?: string;
7-
padding?: string;
7+
padding: string;
88
titleText?: string;
99
titleSize?: string;
10-
titleColor?: string;
10+
titleColor: string;
1111
logoSrc?: string;
1212
logoAltText?: string;
1313
logoWidth?: string;

src/components/puck/MasonryGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { gapSettingsField } from "../../lib/settings-fields";
33

44
export interface MasonryGridProps {
55
content?: SlotComponent;
6-
gap?: string;
6+
gap: string;
77
childrenBottomMargin?: string;
88
}
99

src/components/puck/MinimumColumnWidthGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { gapSettingsField } from "../../lib/settings-fields";
44
export interface MinimumColumnWidthGridProps {
55
content?: SlotComponent;
66
minimumColumnWidthPixels?: number;
7-
gap?: string;
7+
gap: string;
88
}
99

1010
export const MinimumColumnWidthGrid: React.FC<MinimumColumnWidthGridProps> = ({

src/components/puck/Navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type NavItem = {
99

1010
export type NavigationProps = {
1111
backgroundColor?: string;
12-
padding?: string;
12+
padding: string;
1313
nav: Array<{
1414
label: string;
1515
items: Array<NavItem>;

src/components/puck/Paragraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { textColorSettingField } from "../../lib/settings-fields";
33

44
export interface ParagraphProps {
55
text: RichText,
6-
textColor?: string;
6+
textColor: string;
77
}
88

99
export const Paragraph: React.FC<ParagraphProps> = ({

src/components/puck/RootContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { booleanSettingsField } from "../../lib/settings-fields";
33

44
export interface RootContainerProps {
55
content?: SlotComponent;
6-
padTop?: boolean;
7-
padBottom?: boolean;
6+
padTop: boolean;
7+
padBottom: boolean;
88
}
99

1010
export const RootContainer: React.FC<RootContainerProps> = ({

src/components/puck/SplitPane.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export interface SplitPaneProps {
66
paneTwoContent?: SlotComponent,
77
paneOneRatio?: number,
88
paneTwoRatio?: number,
9-
gap?: string,
10-
padding?: string,
11-
backgroundColor?: string;
9+
gap: string,
10+
padding: string,
11+
backgroundColor: string;
1212
}
1313

1414
export interface SplitPanePropsForRender extends SplitPaneProps {

src/components/puck/Title.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const titleSizeField: Field<TitleSize> = {
1818
export interface TitleProps {
1919
text: string;
2020
size: TitleSize;
21-
center?: boolean;
22-
uppercase?: boolean;
23-
textColor?: string;
21+
center: boolean;
22+
uppercase: boolean;
23+
textColor: string;
2424
}
2525

2626

0 commit comments

Comments
 (0)