Skip to content

Commit

Permalink
fix pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisa18289 committed Jan 25, 2024
1 parent 73ca362 commit 4c2b622
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 26 deletions.
14 changes: 4 additions & 10 deletions packages/components/src/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
import React, { FC, PropsWithChildren, ReactNode } from "react";
import clsx from "clsx";
import {
PropsContext,
PropsContextProvider,
useProps,
} from "@/lib/propsContext";
import { PropsContext, PropsContextProvider } from "@/lib/propsContext";
import * as Aria from "react-aria-components";
import { Popover } from "@/components/Popover";
import { Calendar } from "./components/Calendar";
import { DateInput } from "./components/DateInput";
import { FieldError } from "@/components/FieldError";
import styles from "../FormField/FormField.module.scss";
import { DateValue } from "@internationalized/date";

export interface DatePickerProps<T extends Aria.DateValue>
extends PropsWithChildren<Omit<Aria.DatePickerProps<T>, "children">> {
errorMessage?: ReactNode;
}

export const DatePicker: FC<DatePickerProps<any>> = (props) => {
const { children, className, errorMessage, ...rest } = useProps(
"datePicker",
props,
);
export const DatePicker: FC<DatePickerProps<DateValue>> = (props) => {
const { children, className, errorMessage, ...rest } = props;

const rootClassName = clsx(styles.formField, className);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
import React, { FC, PropsWithChildren, ReactNode } from "react";
import styles from "../FormField/FormField.module.scss";
import clsx from "clsx";
import {
PropsContext,
PropsContextProvider,
useProps,
} from "@/lib/propsContext";
import { PropsContext, PropsContextProvider } from "@/lib/propsContext";
import * as Aria from "react-aria-components";
import { Popover } from "@/components/Popover";
import { RangeCalendar, DateRangeInput } from "./index";
import { FieldError } from "@/components/FieldError";
import { DateValue } from "@internationalized/date";

export interface DateRangePickerProps<T extends Aria.DateValue>
extends PropsWithChildren<Omit<Aria.DateRangePickerProps<T>, "children">> {
errorMessage?: ReactNode;
}

export const DateRangePicker: FC<DateRangePickerProps<any>> = (props) => {
const { children, className, errorMessage, ...rest } = useProps(
"dateRangePicker",
props,
);
export const DateRangePicker: FC<DateRangePickerProps<DateValue>> = (props) => {
const { children, className, errorMessage, ...rest } = props;

const rootClassName = clsx(styles.formField, className);

Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import React, { FC, PropsWithChildren } from "react";
import styles from "./Popover.module.scss";
import * as Aria from "react-aria-components";
import clsx from "clsx";
import { useProps } from "@/lib/propsContext";

export interface PopoverProps
extends PropsWithChildren<Omit<Aria.PopoverProps, "children">> {}

export const Popover: FC<PopoverProps> = (props) => {
const { children, className, ...rest } = useProps("popover", props);
const { children, className, ...rest } = props;

const rootClassName = clsx(styles.popover, className);

Expand Down
4 changes: 0 additions & 4 deletions packages/components/src/components/propTypes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { NoteProps } from "@/components/Note";
import { HeadingProps } from "@/components/Heading";
import { InitialsProps } from "@/components/Initials";
import { ImageProps } from "@/components/Image";
import { DatePickerProps, DateRangePickerProps } from "@/components/DatePicker";

export * from "./types";

Expand All @@ -33,7 +32,4 @@ export interface FlowComponentPropsTypes {
Image: ImageProps;
FieldError: FieldErrorProps;
FieldDescription: FieldDescriptionProps;
datePicker: DatePickerProps<any>;
dateRangePicker: DateRangePickerProps<any>;

}

0 comments on commit 4c2b622

Please sign in to comment.