Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/app/content/bloks/prompt-input-questions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ function QuestionPromptCard({

<p className="text-sm text-foreground">{question}</p>

<ul
<div
role="radiogroup"
aria-label="Question answers"
className="flex flex-col gap-2"
Expand All @@ -543,7 +543,7 @@ function QuestionPromptCard({
const letter = String.fromCharCode(65 + index);
const isSelected = selectedId === answer.id;
return (
<li key={answer.id} className="min-w-0">
<div key={answer.id} className="min-w-0">
<button
type="button"
role="radio"
Expand All @@ -560,10 +560,10 @@ function QuestionPromptCard({
<span className="shrink-0">{letter}.</span>
<span className="min-w-0 truncate">{answer.label}</span>
</button>
</li>
</div>
);
})}
</ul>
</div>
</div>
)}

Expand Down
4 changes: 4 additions & 0 deletions src/components/code-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ export function CodeBlock({
return (
<div
dir="ltr"
role="region"
tabIndex={0}
aria-label="Code sample"
className={cn(
"relative rounded-md bg-muted max-h-[400px] overflow-auto",
"outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
className,
)}
style={{ width: "100%", maxWidth: "100%" }}
Expand Down
17 changes: 12 additions & 5 deletions src/components/ui/date-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ type CalendarProps = React.ComponentProps<typeof Calendar>;
* For DayPicker label creators (nav, days, etc.), use `calendarProps.ariaLabels`.
*/
export type DatePickerAriaLabels = {
/** `aria-label` on the popover trigger button */
/**
* `aria-label` on the popover trigger when **no date is selected** (empty state).
* When a date is shown, `aria-label` is omitted so the visible formatted date is the accessible name.
*/
popoverTrigger?: string;
};

Expand Down Expand Up @@ -154,8 +157,10 @@ function DatePickerSimple(props: DatePickerSimpleProps) {
colorScheme="neutral"
disabled={disabled}
aria-label={
ariaLabels?.popoverTrigger ??
(typeof placeholder === "string" ? placeholder : undefined)
date
? undefined
: (ariaLabels?.popoverTrigger ??
(typeof placeholder === "string" ? placeholder : undefined))
}
className={cn(
"border-input border-1 data-[state=open]:border-2 data-[state=open]:border-primary rounded-md text-md data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 bg-body-bg px-3 py-2 whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10",
Expand Down Expand Up @@ -279,8 +284,10 @@ function DatePickerWithRange(props: DatePickerWithRangeProps) {
colorScheme="neutral"
disabled={disabled}
aria-label={
ariaLabels?.popoverTrigger ??
(typeof placeholder === "string" ? placeholder : undefined)
range?.from
? undefined
: (ariaLabels?.popoverTrigger ??
(typeof placeholder === "string" ? placeholder : undefined))
}
className={cn(
"border-input border-1 data-[state=open]:border-2 data-[state=open]:border-primary rounded-md text-md data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 bg-body-bg px-3 py-2 whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10",
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export interface FilterMultiSelectProps {
disabled?: boolean;
name?: string;
helperText?: string;
"aria-describedby"?: string;
"aria-label"?: string;
renderOption?: (option: FilterOption) => React.ReactNode;
open?: boolean;
onOpenChange?: (open: boolean) => void;
Expand Down
Loading