Skip to content

Commit f91042c

Browse files
committed
Merge branch 'ccjk_font' of github.com:adobe/react-spectrum into ccjk_font
2 parents a937d59 + 77b72b1 commit f91042c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1245
-230
lines changed

packages/@adobe/spectrum-css-temp/components/accordion/skin.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,13 @@ governing permissions and limitations under the License.
2222
}
2323
}
2424

25-
.spectrum-Accordion-itemIndicator {
26-
color: var(--spectrum-alias-text-color);
27-
}
28-
2925
.spectrum-Accordion-itemHeader {
3026
color: var(--spectrum-alias-text-color);
3127

3228
&:hover {
3329
color: var(--spectrum-alias-text-color-hover);
3430

3531
background-color: var(--spectrum-accordion-background-color-hover);
36-
37-
+ .spectrum-Accordion-itemIndicator {
38-
color: var(--spectrum-alias-text-color-hover);
39-
}
4032
}
4133

4234
&:focus-ring {

packages/@react-aria/datepicker/src/useDatePicker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>
140140
'aria-label': stringFormatter.format('calendar'),
141141
'aria-labelledby': `${labelledBy} ${buttonId}`,
142142
'aria-describedby': ariaDescribedBy,
143+
'aria-expanded': state.isOpen || undefined,
143144
onPress: () => state.setOpen(true)
144145
},
145146
dialogProps: {

packages/@react-aria/datepicker/src/useDateRangePicker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
151151
'aria-label': stringFormatter.format('calendar'),
152152
'aria-labelledby': `${labelledBy} ${buttonId}`,
153153
'aria-describedby': ariaDescribedBy,
154+
'aria-expanded': state.isOpen || undefined,
154155
onPress: () => state.setOpen(true)
155156
},
156157
dialogProps: {

packages/@react-aria/dnd/src/useDroppableCollection.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,13 @@ export function useDroppableCollection(props: DroppableCollectionOptions, state:
297297
// is some indication that items were added.
298298
if (state.selectionManager.focusedKey === droppingState.current.focusedKey) {
299299
let first = newKeys.keys().next().value;
300+
let item = state.collection.getItem(first);
301+
302+
// If this is a cell, focus the parent row.
303+
if (item?.type === 'cell') {
304+
first = item.parentKey;
305+
}
306+
300307
state.selectionManager.setFocusedKey(first);
301308

302309
if (state.selectionManager.selectionMode === 'none') {

packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class LiveAnnouncer {
7171
clip: 'rect(0 0 0 0)',
7272
clipPath: 'inset(50%)',
7373
height: '1px',
74-
margin: '0 -1px -1px 0',
74+
margin: '-1px',
7575
overflow: 'hidden',
7676
padding: 0,
7777
position: 'absolute',
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"remove": "Press Space or Delete to remove tag."
2+
"removeDescription": "Press Delete to remove tag.",
3+
"removeButtonLabel": "Remove"
34
}

packages/@react-aria/tag/src/useTag.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
*/
1212

1313
import {AriaButtonProps} from '@react-types/button';
14-
import {chain, filterDOMProps, mergeProps, useId} from '@react-aria/utils';
14+
import {chain, filterDOMProps, mergeProps, useDescription, useId} from '@react-aria/utils';
1515
import {DOMAttributes, FocusableElement} from '@react-types/shared';
1616
// @ts-ignore
1717
import intlMessages from '../intl/*.json';
1818
import {KeyboardEvent, RefObject} from 'react';
1919
import type {TagGroupState} from '@react-stately/tag';
2020
import {TagProps} from '@react-types/tag';
2121
import {useGridListItem} from '@react-aria/gridlist';
22+
import {useInteractionModality} from '@react-aria/interactions';
2223
import {useLocalizedStringFormatter} from '@react-aria/i18n';
2324

2425

@@ -46,7 +47,6 @@ export function useTag<T>(props: TagProps<T>, state: TagGroupState<T>, ref: RefO
4647
item
4748
} = props;
4849
let stringFormatter = useLocalizedStringFormatter(intlMessages);
49-
let removeString = stringFormatter.format('remove');
5050
let labelId = useId();
5151
let buttonId = useId();
5252

@@ -66,11 +66,18 @@ export function useTag<T>(props: TagProps<T>, state: TagGroupState<T>, ref: RefO
6666
}
6767
};
6868

69+
let modality: string = useInteractionModality();
70+
if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {
71+
modality = 'touch';
72+
}
73+
let description = allowsRemoving && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';
74+
let descProps = useDescription(description);
75+
6976
isFocused = isFocused || state.selectionManager.focusedKey === item.key;
7077
let domProps = filterDOMProps(props);
7178
return {
7279
clearButtonProps: {
73-
'aria-label': removeString,
80+
'aria-label': stringFormatter.format('removeButtonLabel', {label: item.textValue}),
7481
'aria-labelledby': `${buttonId} ${labelId}`,
7582
id: buttonId,
7683
onPress: () => allowsRemoving && onRemove ? onRemove(item.key) : null,
@@ -82,7 +89,8 @@ export function useTag<T>(props: TagProps<T>, state: TagGroupState<T>, ref: RefO
8289
rowProps: {
8390
...rowProps,
8491
tabIndex: (isFocused || state.selectionManager.focusedKey == null) ? 0 : -1,
85-
onKeyDown: allowsRemoving ? onKeyDown : null
92+
onKeyDown: allowsRemoving ? onKeyDown : null,
93+
'aria-describedby': descProps['aria-describedby']
8694
},
8795
gridCellProps: mergeProps(domProps, gridCellProps, {
8896
'aria-errormessage': props['aria-errormessage'],

packages/@react-aria/visually-hidden/src/VisuallyHidden.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ const styles: CSSProperties = {
3333
border: 0,
3434
clip: 'rect(0 0 0 0)',
3535
clipPath: 'inset(50%)',
36-
height: 1,
37-
margin: '0 -1px -1px 0',
36+
height: '1px',
37+
margin: '-1px',
3838
overflow: 'hidden',
3939
padding: 0,
4040
position: 'absolute',
41-
width: 1,
41+
width: '1px',
4242
whiteSpace: 'nowrap'
4343
};
4444

packages/@react-spectrum/autocomplete/src/MobileSearchAutocomplete.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ const SearchAutocompleteButton = React.forwardRef(function SearchAutocompleteBut
208208
classNames(
209209
styles,
210210
'spectrum-InputGroup-input-validationIcon'
211+
),
212+
classNames(
213+
searchStyles,
214+
'spectrum-Search-validationIcon'
211215
)
212216
)
213217
});
@@ -264,6 +268,7 @@ const SearchAutocompleteButton = React.forwardRef(function SearchAutocompleteBut
264268
classNames(
265269
searchStyles,
266270
'spectrum-Search',
271+
'spectrum-Search--loadable',
267272
{
268273
'is-disabled': isDisabled,
269274
'is-quiet': isQuiet,

packages/@react-spectrum/dialog/chromatic/Dialog.chromatic.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ storiesOf('Dialog', module)
156156
chromaticProvider: {colorSchemes: ['light'], locales: ['en-US'], scales: ['large'], disableAnimations: true}
157157
}
158158
)
159+
.add(
160+
'popover: containerPadding',
161+
() => renderTriggerProps({type: 'popover', containerPadding: 30, shouldFlip: false, placement: 'top'}), {
162+
chromatic: {viewports: [1200]},
163+
chromaticProvider: {colorSchemes: ['light'], locales: ['en-US'], scales: ['large'], disableAnimations: true}
164+
}
165+
)
159166
.add(
160167
'mobileType fullscreenTakeover, modal',
161168
() => renderTriggerProps({type: 'modal', mobileType: 'fullscreenTakeover'}), {

0 commit comments

Comments
 (0)