Skip to content

Commit

Permalink
tested
Browse files Browse the repository at this point in the history
  • Loading branch information
asanehisa committed Nov 21, 2024
1 parent 3213859 commit 038bbcd
Show file tree
Hide file tree
Showing 16 changed files with 5,584 additions and 7,015 deletions.
12,472 changes: 5,518 additions & 6,954 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/components/puck/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
YextEntityFieldSelector,
} from "../../index.ts";

export type AddressProps = {
type AddressProps = {
address: YextEntityField<AddressType>;
getDirectionsProvider: GetDirectionsConfig["provider"];
alignment: "items-start" | "items-center";
Expand Down Expand Up @@ -109,7 +109,7 @@ const Address = ({
);
};

export const AddressComponent: ComponentConfig<AddressProps> = {
const AddressComponent: ComponentConfig<AddressProps> = {
fields: addressFields,
defaultProps: {
alignment: "items-start",
Expand All @@ -129,3 +129,5 @@ export const AddressComponent: ComponentConfig<AddressProps> = {
label: "Address",
render: (props) => <Address {...props} />,
};

export { type AddressProps, AddressComponent as Address };
8 changes: 4 additions & 4 deletions src/components/puck/BodyText.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { ComponentConfig, Fields } from "@measured/puck";
import { Body, BodyProps, bodyVariants } from "./atoms/body.js";
import { Body, BodyProps } from "./atoms/body.js";
import {
useDocument,
resolveYextEntityField,
Expand All @@ -11,7 +11,7 @@ import {
FontSizeSelector,
} from "../../index.ts";

export interface BodyTextProps extends BodyProps {
interface BodyTextProps extends BodyProps {
text: YextEntityField<string>;
}

Expand Down Expand Up @@ -66,7 +66,7 @@ const bodyTextFields: Fields<BodyTextProps> = {
},
};

export const BodyTextComponent: ComponentConfig<BodyTextProps> = {
const BodyTextComponent: ComponentConfig<BodyTextProps> = {
label: "Body Text",
fields: bodyTextFields,
defaultProps: {
Expand Down Expand Up @@ -96,4 +96,4 @@ export const BodyTextComponent: ComponentConfig<BodyTextProps> = {
render: (props) => <BodyText {...props} />,
};

export { BodyText, bodyVariants };
export { BodyTextComponent as BodyText, type BodyTextProps };
6 changes: 3 additions & 3 deletions src/components/puck/CtaWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
FontSizeSelector,
} from "../../index.ts";

export interface CTAWrapperProps {
interface CTAWrapperProps {
entityField: YextEntityField<CTAProps>;
variant: CTAProps["variant"];
fontSize: CTAProps["fontSize"];
Expand Down Expand Up @@ -65,7 +65,7 @@ const CTAWrapper: React.FC<CTAWrapperProps> = ({
);
};

export const CTAWrapperComponent: ComponentConfig<CTAWrapperProps> = {
const CTAWrapperComponent: ComponentConfig<CTAWrapperProps> = {
label: "Call to Action",
fields: ctaWrapperFields,
defaultProps: {
Expand All @@ -81,4 +81,4 @@ export const CTAWrapperComponent: ComponentConfig<CTAWrapperProps> = {
render: (props) => <CTAWrapper {...props} />,
};

export { CTAWrapper };
export { CTAWrapperComponent as CTAWrapper, type CTAWrapperProps };
6 changes: 3 additions & 3 deletions src/components/puck/Emails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const emailsVariants = cva("list-inside font-body-fontFamily", {
},
});

export interface EmailsProps extends VariantProps<typeof emailsVariants> {
interface EmailsProps extends VariantProps<typeof emailsVariants> {
list: YextEntityField<string[]>;
includeHyperlink: boolean;
listLength: number;
Expand Down Expand Up @@ -160,7 +160,7 @@ const Emails: React.FC<EmailsProps> = ({
);
};

export const EmailsComponent: ComponentConfig<EmailsProps> = {
const EmailsComponent: ComponentConfig<EmailsProps> = {
label: "Emails",
fields: EmailsFields,
defaultProps: {
Expand All @@ -187,4 +187,4 @@ export const EmailsComponent: ComponentConfig<EmailsProps> = {
render: (props) => <Emails {...props} />,
};

export { Emails, emailsVariants };
export { EmailsComponent as Emails, type EmailsProps };
6 changes: 3 additions & 3 deletions src/components/puck/FlexContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const flexContainerVariants = cva("flex", {
},
});

export interface FlexContainerProps
interface FlexContainerProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof flexContainerVariants> {
renderDropZone?: any;
Expand Down Expand Up @@ -131,7 +131,7 @@ const flexContainerFields: Fields<FlexContainerProps> = {
},
};

export const FlexContainerComponent: ComponentConfig<FlexContainerProps> = {
const FlexContainerComponent: ComponentConfig<FlexContainerProps> = {
label: "Flex Container",
fields: flexContainerFields,
defaultProps: {
Expand All @@ -158,4 +158,4 @@ export const FlexContainerComponent: ComponentConfig<FlexContainerProps> = {
),
};

export { FlexContainer, flexContainerVariants };
export { FlexContainerComponent as FlexContainer, type FlexContainerProps };
6 changes: 4 additions & 2 deletions src/components/puck/GetDirections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from "../../index.js";
import { VariantProps } from "class-variance-authority";

export type GetDirectionsProps = {
type GetDirectionsProps = {
coordinate: YextEntityField<Coordinate>;
getDirectionsProvider: GetDirectionsConfig["provider"];
variant: ButtonProps["variant"];
Expand Down Expand Up @@ -137,7 +137,7 @@ const GetDirections = ({
);
};

export const GetDirectionsComponent: ComponentConfig<GetDirectionsProps> = {
const GetDirectionsComponent: ComponentConfig<GetDirectionsProps> = {
fields: getDirectionsFields,
defaultProps: {
variant: "primary",
Expand All @@ -158,3 +158,5 @@ export const GetDirectionsComponent: ComponentConfig<GetDirectionsProps> = {
label: "Get Directions",
render: (props) => <GetDirections {...props} />,
};

export { GetDirectionsComponent as GetDirections, type GetDirectionsProps };
8 changes: 4 additions & 4 deletions src/components/puck/GridSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ const columnVariants = cva("flex flex-col gap-y-grid-verticalSpacing", {
},
});

export interface ColumnProps extends VariantProps<typeof columnVariants> {
interface ColumnProps extends VariantProps<typeof columnVariants> {
span?: number;
}

export interface GridSectionProps
interface GridSectionProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof gridSectionVariants>,
VariantProps<typeof backgroundVariants> {
Expand Down Expand Up @@ -231,7 +231,7 @@ const gridSectionFields: Fields<GridSectionProps> = {
},
};

export const GridSectionComponent: ComponentConfig<GridSectionProps> = {
const GridSectionComponent: ComponentConfig<GridSectionProps> = {
label: "Grid Section",
fields: gridSectionFields,
defaultProps: {
Expand Down Expand Up @@ -270,4 +270,4 @@ export const GridSectionComponent: ComponentConfig<GridSectionProps> = {
),
};

export { GridSection, gridSectionVariants };
export { GridSectionComponent as GridSection, type GridSectionProps };
8 changes: 4 additions & 4 deletions src/components/puck/HeadingText.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { ComponentConfig, Fields } from "@measured/puck";
import { Heading, HeadingProps, headingVariants } from "./atoms/heading.js";
import { Heading, HeadingProps } from "./atoms/heading.js";
import {
useDocument,
resolveYextEntityField,
Expand All @@ -11,7 +11,7 @@ import {
getFontWeightOverrideOptions,
} from "../../index.js";

export interface HeadingTextProps extends HeadingProps {
interface HeadingTextProps extends HeadingProps {
text: YextEntityField<string>;
}

Expand Down Expand Up @@ -73,7 +73,7 @@ const headingTextFields: Fields<HeadingTextProps> = {
},
};

export const HeadingTextComponent: ComponentConfig<HeadingTextProps> = {
const HeadingTextComponent: ComponentConfig<HeadingTextProps> = {
label: "Heading Text",
fields: headingTextFields,
defaultProps: {
Expand Down Expand Up @@ -105,4 +105,4 @@ export const HeadingTextComponent: ComponentConfig<HeadingTextProps> = {
render: (props) => <HeadingText {...props} />,
};

export { HeadingText, headingVariants };
export { HeadingTextComponent as HeadingText, type HeadingTextProps };
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
YextEntityFieldSelector,
} from "../../index.js";

export type HoursCardProps = {
type HoursCardProps = {
hours: YextEntityField<HoursType>;
startOfWeek: keyof DayOfWeekNames | "today";
collapseDays: boolean;
Expand Down Expand Up @@ -122,7 +122,7 @@ const HoursTable = ({
);
};

export const HoursCardComponent: ComponentConfig<HoursCardProps> = {
const HoursCardComponent: ComponentConfig<HoursCardProps> = {
fields: hoursCardFields,
defaultProps: {
hours: {
Expand All @@ -138,3 +138,5 @@ export const HoursCardComponent: ComponentConfig<HoursCardProps> = {
label: "Hours Table",
render: (props) => <HoursTable {...props} />,
};

export { HoursCardComponent as HoursCard, type HoursCardProps };
6 changes: 4 additions & 2 deletions src/components/puck/HoursStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
YextEntityFieldSelector,
} from "../../index.js";

export interface HoursStatusProps {
interface HoursStatusProps {
hours: YextEntityField<HoursType>;
className?: string;
showCurrentStatus?: boolean;
Expand Down Expand Up @@ -94,7 +94,7 @@ const HoursStatusWrapper: React.FC<HoursStatusProps> = ({
);
};

export const HoursStatusComponent: ComponentConfig<HoursStatusProps> = {
const HoursStatusComponent: ComponentConfig<HoursStatusProps> = {
label: "Hours Status",
fields: hoursStatusWrapperFields,
defaultProps: {
Expand All @@ -110,3 +110,5 @@ export const HoursStatusComponent: ComponentConfig<HoursStatusProps> = {
},
render: (props) => <HoursStatusWrapper {...props} />,
};

export { HoursStatusComponent as HoursStatus, type HoursStatusProps };
11 changes: 7 additions & 4 deletions src/components/puck/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ const imageWrapperVariants = cva("", {
},
});

export interface ImageWrapperProps
extends VariantProps<typeof imageWrapperVariants> {
interface ImageWrapperProps extends VariantProps<typeof imageWrapperVariants> {
image: YextEntityField<ImageType>;
}

Expand Down Expand Up @@ -117,7 +116,7 @@ const ImageWrapper: React.FC<ImageWrapperProps> = ({
);
};

export const ImageWrapperComponent: ComponentConfig<ImageWrapperProps> = {
const ImageWrapperComponent: ComponentConfig<ImageWrapperProps> = {
label: "Image",
fields: imageWrapperFields,
defaultProps: {
Expand All @@ -138,4 +137,8 @@ export const ImageWrapperComponent: ComponentConfig<ImageWrapperProps> = {
render: (props) => <ImageWrapper {...props} />,
};

export { ImageWrapper, imageWrapperVariants };
export {
ImageWrapperComponent as ImageWrapper,
type ImageWrapperProps,
imageWrapperVariants,
};
6 changes: 3 additions & 3 deletions src/components/puck/Phone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const phoneVariants = cva(
}
);

export interface PhoneProps extends VariantProps<typeof phoneVariants> {
interface PhoneProps extends VariantProps<typeof phoneVariants> {
phone: YextEntityField<string>;
format?: "domestic" | "international";
textSize?: number;
Expand Down Expand Up @@ -136,7 +136,7 @@ const Phone: React.FC<PhoneProps> = ({ phone, format, fontWeight, color }) => {
);
};

export const PhoneComponent: ComponentConfig<PhoneProps> = {
const PhoneComponent: ComponentConfig<PhoneProps> = {
label: "Phone",
fields: PhoneFields,
defaultProps: {
Expand All @@ -162,4 +162,4 @@ export const PhoneComponent: ComponentConfig<PhoneProps> = {
render: (props) => <Phone {...props} />,
};

export { Phone, phoneVariants };
export { PhoneComponent as Phone, type PhoneProps };
4 changes: 2 additions & 2 deletions src/components/puck/Promo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { imageWrapperVariants, ImageWrapperProps } from "./Image.js";

const PLACEHOLDER_IMAGE_URL = "https://placehold.co/640x360";

export interface PromoProps {
interface PromoProps {
orientation: "left" | "right";
title: {
text: YextEntityField<string>;
Expand Down Expand Up @@ -324,4 +324,4 @@ export const PromoComponent: ComponentConfig<PromoProps> = {
render: (props) => <PromoWrapper {...props} />,
};

export { PromoWrapper };
export { PromoComponent as Promo, type PromoProps };
6 changes: 3 additions & 3 deletions src/components/puck/TextList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const textListVariants = cva(
}
);

export interface TextListProps extends VariantProps<typeof textListVariants> {
interface TextListProps extends VariantProps<typeof textListVariants> {
list: YextEntityField<string[]>;
textSize?: number;
}
Expand Down Expand Up @@ -138,7 +138,7 @@ const TextList: React.FC<TextListProps> = ({
);
};

export const TextListComponent: ComponentConfig<TextListProps> = {
const TextListComponent: ComponentConfig<TextListProps> = {
label: "Text List",
fields: textListFields,
defaultProps: {
Expand All @@ -164,4 +164,4 @@ export const TextListComponent: ComponentConfig<TextListProps> = {
render: (props) => <TextList {...props} />,
};

export { TextList, textListVariants };
export { TextListComponent as TextList, type TextListProps };
34 changes: 14 additions & 20 deletions src/components/puck/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
export * from "./atoms/index.ts";
export { AddressComponent, type AddressProps } from "./Address.tsx";
export {
GetDirectionsComponent,
type GetDirectionsProps,
} from "./GetDirections.tsx";
export { BodyTextComponent, type BodyTextProps } from "./BodyText.tsx";
export { CTAWrapperComponent, type CTAWrapperProps } from "./CtaWrapper.tsx";
export { EmailsComponent, type EmailsProps } from "./Emails.tsx";
export {
FlexContainerComponent,
type FlexContainerProps,
} from "./FlexContainer.tsx";
export { GridSectionComponent, type GridSectionProps } from "./GridSection.tsx";
export { HeadingTextComponent, type HeadingTextProps } from "./HeadingText.tsx";
export { HoursCardComponent, type HoursCardProps } from "./HoursTable.tsx";
export { HoursStatusComponent, type HoursStatusProps } from "./HoursStatus.tsx";
export { ImageWrapperComponent, type ImageWrapperProps } from "./Image.tsx";
export { PhoneComponent, type PhoneProps } from "./Phone.tsx";
export { TextListComponent, type TextListProps } from "./TextList.tsx";
export { PromoComponent, type PromoProps } from "./Promo.tsx";
export { Address, type AddressProps } from "./Address.tsx";
export { BodyText, type BodyTextProps } from "./BodyText.tsx";
export { CTAWrapper, type CTAWrapperProps } from "./CtaWrapper.tsx";
export { Emails, type EmailsProps } from "./Emails.tsx";
export { FlexContainer, type FlexContainerProps } from "./FlexContainer.tsx";
export { GetDirections, type GetDirectionsProps } from "./GetDirections.tsx";
export { GridSection, type GridSectionProps } from "./GridSection.tsx";
export { HeadingText, type HeadingTextProps } from "./HeadingText.tsx";
export { HoursCard, type HoursCardProps } from "./HoursCard.tsx";
export { HoursStatus, type HoursStatusProps } from "./HoursStatus.tsx";
export { ImageWrapper, type ImageWrapperProps } from "./Image.tsx";
export { Phone, type PhoneProps } from "./Phone.tsx";
export { Promo, type PromoProps } from "./Promo.tsx";
export { TextList, type TextListProps } from "./TextList.tsx";

0 comments on commit 038bbcd

Please sign in to comment.