import { Show, children, splitProps } from 'solid-js';
import { DatePicker as DatePickerPrimitive } from '@ark-ui/solid';
import { buttonVariants } from '~/components/ui/button';
import { cn } from '~/utils/styles';
const DatePicker = DatePickerPrimitive.Root;
const DatePickerLabel = DatePickerPrimitive.Label;
const DatePickerContext = DatePickerPrimitive.Context;
const DatePickerTableHead = DatePickerPrimitive.TableHead;
const DatePickerTableBody = DatePickerPrimitive.TableBody;
const DatePickerYearSelect = DatePickerPrimitive.YearSelect;
const DatePickerMonthSelect = DatePickerPrimitive.MonthSelect;
const DatePickerPositioner = DatePickerPrimitive.Positioner;
const DatePickerControl = (props: DatePickerPrimitive.ControlProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerInput = (props: DatePickerPrimitive.InputProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerTrigger = (props: DatePickerPrimitive.TriggerProps) => {
const [local, others] = splitProps(props, ['class', 'children']);
// prevents rendering children twice
const resolvedChildren = children(() => local.children);
const hasChildren = () => resolvedChildren.toArray().length !== 0;
return (
svg]:size-4',
local.class
)}
{...others}
>
);
};
const DatePickerContent = (props: DatePickerPrimitive.ContentProps) => {
const [local, others] = splitProps(props, ['class', 'children']);
return (
{local.children}
);
};
const DatePickerView = (props: DatePickerPrimitive.ViewProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerViewControl = (props: DatePickerPrimitive.ViewControlProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerPrevTrigger = (props: DatePickerPrimitive.PrevTriggerProps) => {
const [local, others] = splitProps(props, ['class', 'children']);
// prevents rendering children twice
const resolvedChildren = children(() => local.children);
const hasChildren = () => resolvedChildren.toArray().length !== 0;
return (
);
};
const DatePickerNextTrigger = (props: DatePickerPrimitive.NextTriggerProps) => {
const [local, others] = splitProps(props, ['class', 'children']);
// prevents rendering children twice
const resolvedChildren = children(() => local.children);
const hasChildren = () => resolvedChildren.toArray().length !== 0;
return (
);
};
const DatePickerViewTrigger = (props: DatePickerPrimitive.ViewTriggerProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerRangeText = (props: DatePickerPrimitive.RangeTextProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerTable = (props: DatePickerPrimitive.TableProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerTableRow = (props: DatePickerPrimitive.TableRowProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerTableHeader = (props: DatePickerPrimitive.TableHeaderProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerTableCell = (props: DatePickerPrimitive.TableCellProps) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
const DatePickerTableCellTrigger = (
props: DatePickerPrimitive.TableCellTriggerProps
) => {
const [local, others] = splitProps(props, ['class']);
return (
);
};
export {
DatePicker,
DatePickerLabel,
DatePickerControl,
DatePickerInput,
DatePickerTrigger,
DatePickerContent,
DatePickerView,
DatePickerViewControl,
DatePickerPrevTrigger,
DatePickerNextTrigger,
DatePickerViewTrigger,
DatePickerRangeText,
DatePickerContext,
DatePickerTable,
DatePickerTableHead,
DatePickerTableBody,
DatePickerTableRow,
DatePickerTableHeader,
DatePickerTableCell,
DatePickerTableCellTrigger,
DatePickerYearSelect,
DatePickerMonthSelect,
DatePickerPositioner,
};