mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-05-18 20:08:19 +00:00
chore: initial Untitled UI Vite scaffold with FontAwesome Pro
This commit is contained in:
30
src/components/application/date-picker/date-input.tsx
Normal file
30
src/components/application/date-picker/date-input.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { DateInputProps as AriaDateInputProps } from "react-aria-components";
|
||||
import { DateInput as AriaDateInput, DateSegment as AriaDateSegment } from "react-aria-components";
|
||||
import { cx } from "@/utils/cx";
|
||||
|
||||
interface DateInputProps extends Omit<AriaDateInputProps, "children"> {}
|
||||
|
||||
export const DateInput = (props: DateInputProps) => {
|
||||
return (
|
||||
<AriaDateInput
|
||||
{...props}
|
||||
className={cx(
|
||||
"flex rounded-lg bg-primary px-2.5 py-2 text-md shadow-xs ring-1 ring-primary ring-inset focus-within:ring-2 focus-within:ring-brand",
|
||||
typeof props.className === "string" && props.className,
|
||||
)}
|
||||
>
|
||||
{(segment) => (
|
||||
<AriaDateSegment
|
||||
segment={segment}
|
||||
className={cx(
|
||||
"rounded px-0.5 text-primary tabular-nums caret-transparent focus:bg-brand-solid focus:font-medium focus:text-white focus:outline-hidden",
|
||||
// The placeholder segment.
|
||||
segment.isPlaceholder && "text-placeholder uppercase",
|
||||
// The separator "/" segment.
|
||||
segment.type === "literal" && "text-fg-quaternary",
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</AriaDateInput>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user