Skip to content
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/ar-AE.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "المزيد من العناصر"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/bg-BG.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Още елементи"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/cs-CZ.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Další položky"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/da-DK.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Flere elementer"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/de-DE.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Weitere Elemente"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/el-GR.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Περισσότερα στοιχεία"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/es-ES.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Más elementos"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/et-EE.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Veel üksusi"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/fi-FI.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Lisää kohteita"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/fr-FR.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Plus d’éléments"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/he-IL.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "פריטים נוספים"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/hr-HR.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Više stavki"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/hu-HU.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "További elemek"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/it-IT.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Altri elementi"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/ja-JP.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "その他の項目"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/ko-KR.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "기타 항목"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/lt-LT.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Daugiau elementų"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/lv-LV.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Vairāk vienumu"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/nb-NO.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Flere elementer"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/nl-NL.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Meer items"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/pl-PL.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Więcej elementów"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/pt-BR.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Mais itens"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/pt-PT.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Mais artigos"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/ro-RO.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Mai multe articole"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/ru-RU.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Дополнительные элементы"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/sk-SK.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Ďalšie položky"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/sl-SI.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Več elementov"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/sr-SP.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Više stavki"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/sv-SE.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Fler artiklar"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/tr-TR.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Daha fazla öğe"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/uk-UA.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "Більше елементів"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/zh-CN.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "更多项目"
}
2 changes: 1 addition & 1 deletion packages/@react-spectrum/actiongroup/intl/zh-TW.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"more": "More items"
"more": "更多項目"
}
16 changes: 8 additions & 8 deletions packages/@react-spectrum/s2/src/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -454,18 +454,17 @@ const CalendarCell = (props: Omit<CalendarCellProps, 'children'> & {firstDayOfWe
let isFirstWeek = weekIndex === 0;
let isFirstChild = dayIndex === 0;
let isLastChild = dayIndex === 6;
let isNextDaySelected = state.isSelected(props.date.add({days: 1}));
return (
<AriaCalendarCell
date={props.date}
className={(renderProps) => cellStyles({...renderProps, isFirstChild, isLastChild, isFirstWeek})}>
{(renderProps) => <CalendarCellInner {...props} weekIndex={weekIndex} dayIndex={dayIndex} state={state} isRangeSelection={!!rangeCalendarStateContext} isNextDaySelected={isNextDaySelected} isLastChild={isLastChild} renderProps={renderProps} />}
{(renderProps) => <CalendarCellInner {...props} weekIndex={weekIndex} dayIndex={dayIndex} state={state} isRangeSelection={!!rangeCalendarStateContext} renderProps={renderProps} />}
</AriaCalendarCell>
);
};

const CalendarCellInner = (props: Omit<CalendarCellProps, 'children'> & {isNextDaySelected: boolean, isLastChild: boolean, isRangeSelection: boolean, state: CalendarState | RangeCalendarState, weekIndex: number, dayIndex: number, renderProps?: CalendarCellRenderProps, date: DateValue}): ReactElement => {
let {weekIndex, dayIndex, date, renderProps, state, isRangeSelection, isNextDaySelected, isLastChild} = props;
const CalendarCellInner = (props: Omit<CalendarCellProps, 'children'> & {isRangeSelection: boolean, state: CalendarState | RangeCalendarState, weekIndex: number, dayIndex: number, renderProps?: CalendarCellRenderProps, date: DateValue}): ReactElement => {
let {weekIndex, dayIndex, date, renderProps, state, isRangeSelection} = props;
let {getDatesInWeek} = state;
let ref = useRef<HTMLDivElement>(null);
let {isUnavailable, formattedDate, isSelected} = renderProps!;
Expand All @@ -484,13 +483,14 @@ const CalendarCellInner = (props: Omit<CalendarCellProps, 'children'> & {isNextD
selectionSpan = dayIndex;
}

let prevDay = date.subtract({days: 1});
let nextDay = date.add({days: 1});
let isBackgroundStyleApplied = (
isSelected
&& (isLastChild || !isNextDaySelected)
&& isRangeSelection
&& (state.isSelected(date.subtract({days: 1}))
|| state.isSelected(date.add({days: 1}))
));
&& (state.isSelected(prevDay)
|| (nextDay.month === date.month && state.isSelected(nextDay)))
);

return (
<div
Expand Down
8 changes: 7 additions & 1 deletion packages/@react-spectrum/s2/src/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
DateValue,
Dialog,
FormContext,
OverlayTriggerStateContext,
Provider,
TimeValue
} from 'react-aria-components';
Expand Down Expand Up @@ -241,7 +242,12 @@ export function CalendarPopover(props: PropsWithChildren): ReactElement {
gap: 16
})}>
<Dialog>
{props.children}
<Provider
values={[
[OverlayTriggerStateContext, null]
]}>
{props.children}
</Provider>
</Dialog>
</PopoverBase>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-spectrum/s2/src/RangeCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(functi
</div>
{isInvalid && (
<Text slot="errorMessage" className={helpTextStyles({isInvalid, isDisabled, size: 'M'})}>
{errorMessage || stringFormatter.format('invalidSelection', {selectedCount: 2})}
{errorMessage || stringFormatter.format('calendar.invalidSelection', {selectedCount: 2})}
</Text>
)}
</>
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-spectrum/s2/src/TimeField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import {createContext, forwardRef, ReactElement, Ref, useContext} from 'react';
import {DateInput, DateInputContainer, InvalidIndicator} from './DateField';
import {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
import {FieldGroup, FieldLabel, HelpText} from './Field';
import {forwardRefType, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';
import {forwardRefType, GlobalDOMAttributes, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';
import {style} from '../style' with {type: 'macro'};
import {useSpectrumContextProps} from './useSpectrumContextProps';


export interface TimeFieldProps<T extends TimeValue> extends
Omit<AriaTimeFieldProps<T>, 'children' | 'className' | 'style'>,
Omit<AriaTimeFieldProps<T>, 'children' | 'className' | 'style' | keyof GlobalDOMAttributes>,
StyleProps,
SpectrumLabelableProps,
HelpTextProps {
Expand Down
8 changes: 8 additions & 0 deletions packages/@react-spectrum/s2/stories/DateField.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import {Button, Content, ContextualHelp, DateField, Footer, Form, Heading, Link, Text} from '../src';
import {CalendarSwitcher, categorizeArgTypes} from './utils';
import type {Meta, StoryObj} from '@storybook/react';
import {parseDate, toZoned} from '@internationalized/date';
import {style} from '../style' with {type: 'macro'};

const meta: Meta<typeof DateField> = {
Expand Down Expand Up @@ -47,6 +48,13 @@ export const Example: Story = {
}
};

export const Zoned: Story = {
args: {
label: 'Birthday',
defaultValue: toZoned(parseDate('2020-02-03'), 'America/New_York')
}
};

export const AriaLabel: Story = {
args: {
'aria-label': 'Birthday'
Expand Down
8 changes: 8 additions & 0 deletions packages/@react-spectrum/s2/stories/DatePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {Button, Content, ContextualHelp, DatePicker, Footer, Form, Heading, Link
import {CalendarSwitcher, categorizeArgTypes} from './utils';
import {fn} from '@storybook/test';
import type {Meta, StoryObj} from '@storybook/react';
import {parseDate, toZoned} from '@internationalized/date';
import {style} from '../style' with {type: 'macro'};

const meta: Meta<typeof DatePicker> = {
Expand Down Expand Up @@ -58,6 +59,13 @@ export const Example: Story = {
}
};

export const Zoned: Story = {
args: {
label: 'Birthday',
defaultValue: toZoned(parseDate('2020-02-03'), 'America/New_York')
}
};

export const AriaLabel: Story = {
args: {
'aria-label': 'Birthday'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {Button, Content, ContextualHelp, DateRangePicker, Footer, Form, Heading,
import {CalendarSwitcher, categorizeArgTypes} from './utils';
import {fn} from '@storybook/test';
import type {Meta, StoryObj} from '@storybook/react';
import {parseDate, toZoned} from '@internationalized/date';
import {style} from '../style' with {type: 'macro'};

const meta: Meta<typeof DateRangePicker> = {
Expand Down Expand Up @@ -58,6 +59,13 @@ export const Example: Story = {
}
};

export const Zoned: Story = {
args: {
label: 'Reservation dates',
defaultValue: {start: toZoned(parseDate('2020-02-03'), 'America/New_York'), end: toZoned(parseDate('2020-02-05'), 'America/Los_Angeles')}
}
};

export const AriaLabel: Story = {
args: {
'aria-label': 'Reservation dates'
Expand Down
2 changes: 1 addition & 1 deletion packages/react-aria-components/src/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ export const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(functio
{...mergeProps(DOMProps, gridProps)}
ref={ref}
style={props.style}
cellPadding={0}
className={props.className ?? 'react-aria-CalendarGrid'}>
{typeof props.children !== 'function'
? props.children
Expand Down Expand Up @@ -507,7 +508,6 @@ export const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(functio
let state = calendarState ?? rangeCalendarState!;
let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};
let isOutsideMonth = !isSameMonth(currentMonth, date);
// TODO: check api with team, this seemed useful though
let istoday = isToday(date, state.timeZone);

let buttonRef = useRef<HTMLDivElement>(null);
Expand Down
4 changes: 2 additions & 2 deletions packages/react-aria-components/src/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const DatePickerStateContext = createContext<DatePickerState | null>(null
export const DateRangePickerStateContext = createContext<DateRangePickerState | null>(null);

// Contexts to clear inside the popover.
const CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext, OverlayTriggerStateContext];
const CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext];

/**
* A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.
Expand Down Expand Up @@ -173,7 +173,7 @@ export const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function
data-focus-visible={isFocusVisible || undefined}
data-disabled={props.isDisabled || undefined}
data-open={state.isOpen || undefined} />
<HiddenDateInput
<HiddenDateInput
autoComplete={props.autoComplete}
name={props.name}
isDisabled={props.isDisabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import React from 'react';
import styles from '../example/index.css';
import {useAsyncList, useListData, useTreeData} from 'react-stately';
import {useFilter} from 'react-aria';
import './styles.css';

export default {
title: 'React Aria Components/Autocomplete',
Expand Down
Loading