From 093943832edf8502cf7456ad46f4297d50ba4a8f Mon Sep 17 00:00:00 2001 From: Kyle <122591+kyleknighted@users.noreply.github.com> Date: Wed, 29 Apr 2026 15:17:58 +0000 Subject: [PATCH 1/5] feat(DateRangePicker): add `trigger: 'button' | 'input'` prop Default remains the existing outline-button trigger. The new `trigger="input"` variant renders a full-width - + `; `` attaches the + * toggle behaviour to the underlying ` + + ); + } + + return ( + + + + ); + } +); + +DateTrigger.displayName = 'DateTrigger'; + +export default DateTrigger; diff --git a/lib/compound/DateRangePicker/parts/SingleCalendar.tsx b/lib/compound/DateRangePicker/parts/SingleCalendar.tsx index 4da3b8e..60242f7 100644 --- a/lib/compound/DateRangePicker/parts/SingleCalendar.tsx +++ b/lib/compound/DateRangePicker/parts/SingleCalendar.tsx @@ -6,10 +6,8 @@ import { Popover, PopoverContent, PopoverPortal, - PopoverTrigger, } from '@radix-ui/react-popover'; import { format } from 'date-fns'; -import { CalendarIcon } from '@phosphor-icons/react'; import { type DayPickerProps, DayPicker } from 'react-day-picker'; import styles from '../DateRangePicker.module.css'; @@ -17,6 +15,7 @@ import type { IDateRangePickerSingleProps } from '../DateRangePicker.types'; import { ContentWrapper } from '../../../atom'; import DateSelection from './DateSelection'; +import DateTrigger from './DateTrigger'; import NextMonthButton from './NextMonthButton'; import SinglePresetsColumn from './SinglePresetsColumn'; import { DEFAULT_DATE_PRESETS } from './presets'; @@ -41,6 +40,7 @@ const SingleCalendar = ({ disabled, placeholder = DEFAULT_PLACEHOLDER, presets = DEFAULT_DATE_PRESETS, + trigger = 'button', }: Omit) => { const isControlled = value !== undefined; const controlledDate = value ?? undefined; @@ -107,12 +107,13 @@ const SingleCalendar = ({ } }} > - - - + Date: Wed, 29 Apr 2026 15:34:15 +0000 Subject: [PATCH 2/5] refactor(DateTrigger): use Radix TextField.Root + PopoverAnchor for input variant Per review feedback on #103, use a real Radix `TextField.Root` (readonly) with a leading `TextField.Slot` for the input trigger, so theme/size/variant styling is inherited from Radix instead of re-implemented with custom CSS. Drives the popover via `PopoverAnchor` + manual `onClick` / `onKeyDown` (Enter, Space, ArrowDown) handlers so both the input text area and the slot icon open the popover, and keyboard focus + activation work natively. `aria-expanded` + `aria-haspopup="dialog"` on the input keep AT in sync. Verified in Storybook: click-input, click-slot, and Enter all open; Escape closes; selection + Apply round-trip updates the value. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../DateRangePicker.module.css | 58 ------------- .../DateRangePicker.stories.tsx | 5 +- .../DateRangePicker/DateRangePicker.tsx | 2 + .../DateRangePicker/parts/DateTrigger.tsx | 86 ++++++++++++------- .../DateRangePicker/parts/SingleCalendar.tsx | 2 + 5 files changed, 61 insertions(+), 92 deletions(-) diff --git a/lib/compound/DateRangePicker/DateRangePicker.module.css b/lib/compound/DateRangePicker/DateRangePicker.module.css index d1c7bc9..f22c679 100644 --- a/lib/compound/DateRangePicker/DateRangePicker.module.css +++ b/lib/compound/DateRangePicker/DateRangePicker.module.css @@ -88,61 +88,3 @@ color: var(--accent-11); font-weight: 500; } - -/* - * Input-shaped trigger. Mimics @radix-ui/themes `TextField.Root` (surface - * variant, size 2) so the picker lines up with adjacent form inputs, while - * remaining a single focusable - + + + + + ); } return (