Skip to content

Commit 1235682

Browse files
authored
Merge pull request #5333 from GeekyAnts/release/3.4.14
Release/3.4.14
2 parents a22a101 + 5937cd0 commit 1235682

Some content is hidden

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

58 files changed

+747
-704
lines changed

example/storybook/stories/components/primitives/Checkbox/FormControlled.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ export const Example = () => {
4242
Fax
4343
</Checkbox>
4444
</Checkbox.Group>
45-
<FormControl.ErrorMessage leftIcon={<WarningOutlineIcon size="xs" />}>
45+
<FormControl.ErrorMessage
46+
_stack={{ alignItems: 'flex-start' }}
47+
leftIcon={<WarningOutlineIcon size="xs" mt={1} />}
48+
>
4649
You must select at least three methods
4750
</FormControl.ErrorMessage>
4851
</FormControl>

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"prettier --write"
3737
]
3838
},
39-
"version": "3.4.13",
39+
"version": "3.4.14",
4040
"license": "MIT",
4141
"private": false,
4242
"main": "lib/commonjs/index",
@@ -196,6 +196,7 @@
196196
"@react-stately/tabs": "3.0.0-alpha.1",
197197
"@react-stately/toggle": "3.2.1",
198198
"@types/lodash.has": "^4.5.6",
199+
"@types/use-subscription": "^1.0.0",
199200
"lodash.clonedeep": "^4.5.0",
200201
"lodash.get": "^4.4.2",
201202
"lodash.has": "^4.5.2",

src/components/composites/Avatar/Group.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ const getAvatarGroupChildren = (
2929
};
3030
return [
3131
plusAvatars > 0 ? (
32-
<Avatar {...spacingProps} {..._avatar} {..._hiddenAvatarPlaceholder}>
32+
<Avatar
33+
key="avatar-group-wrapper"
34+
{...spacingProps}
35+
{..._avatar}
36+
{..._hiddenAvatarPlaceholder}
37+
>
3338
{'+ ' + plusAvatars}
3439
</Avatar>
3540
) : null,

src/components/composites/Collapse/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ViewStyle, LayoutAnimation, UIManager, Platform } from 'react-native';
44
import { Box } from '../../primitives';
55
import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps';
66
import type { InterfaceBoxProps } from '../../primitives/Box';
7+
import type { CustomProps } from '../../../components/types';
78
export type InterfaceCollapseProps = InterfaceBoxProps<ICollapseProps> & {
89
style?: ViewStyle;
910
endingHeight?: number;
@@ -15,7 +16,7 @@ export type InterfaceCollapseProps = InterfaceBoxProps<ICollapseProps> & {
1516
onAnimationStart?: Function;
1617
};
1718

18-
export type ICollapseProps = InterfaceCollapseProps;
19+
export type ICollapseProps = InterfaceCollapseProps & CustomProps<'Box'>;
1920

2021
function usePrevious(value: any) {
2122
const ref = useRef();

src/components/composites/FormControl/useFormControl.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { useId } from '@react-native-aria/utils';
33
import omit from 'lodash.omit';
44
import type { IFormControlProps } from './types';
55
import { ariaAttr } from '../../../utils';
6+
import { ResponsiveQueryContext } from '../../../utils/useResponsiveQuery/ResponsiveQueryProvider';
7+
import { uniqueId } from 'lodash';
68

79
export type IFormControlContext = Omit<
810
ReturnType<typeof useFormControlProvider>,
@@ -21,7 +23,18 @@ export function useFormControlProvider(props: IFormControlProps) {
2123
...htmlProps
2224
} = props;
2325

24-
const id = useId();
26+
let id = uniqueId();
27+
const responsiveQueryContext = React.useContext(ResponsiveQueryContext);
28+
const disableCSSMediaQueries = responsiveQueryContext.disableCSSMediaQueries;
29+
30+
if (!disableCSSMediaQueries) {
31+
// This if statement technically breaks the rules of hooks, but is safe
32+
// because the condition never changes after mounting.
33+
// eslint-disable-next-line react-hooks/rules-of-hooks
34+
id = useId();
35+
}
36+
37+
// const id = '';
2538
// Generate all the required ids
2639
const nativeID = idProp || `field-${id}`;
2740

@@ -85,7 +98,7 @@ export function useFormControl(props: IFormControlProps) {
8598

8699
return {
87100
...cleanProps,
88-
nativeID: props.nativeID ?? field?.nativeID,
101+
nativeID: props.nativeID ?? field?.nativeID + '-input',
89102
disabled: props.isDisabled || field?.isDisabled,
90103
readOnly: props.isReadOnly || field?.isReadOnly,
91104
required: props.isRequired || field?.isRequired,

src/components/composites/IconButton/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { CustomProps, VariantType } from '../../types';
66
import type { ThemeComponentSizeType } from '../../../components/types/utils';
77
export interface InterfaceIconButtonProps
88
extends Omit<
9-
InterfacePressableProps,
9+
InterfacePressableProps<InterfaceIconButtonProps>,
1010
| 'children'
1111
| 'color'
1212
| '_light'

src/components/composites/Menu/useMenu.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1+
import React from 'react';
12
import { useFocusManager } from '@react-aria/focus';
2-
import { useId } from '@react-aria/utils';
3+
import { useId } from '@react-native-aria/utils';
34
import { AccessibilityRole, Platform } from 'react-native';
5+
import { ResponsiveQueryContext } from '../../../utils/useResponsiveQuery/ResponsiveQueryProvider';
6+
import { uniqueId } from 'lodash';
47

58
type IMenuTriggerProps = {
69
handleOpen: () => void;
710
isOpen: boolean;
811
};
912

1013
export const useMenuTrigger = ({ handleOpen, isOpen }: IMenuTriggerProps) => {
11-
const menuTriggerId = useId();
14+
let menuTriggerId = uniqueId();
15+
16+
// let id = uniqueId();
17+
const responsiveQueryContext = React.useContext(ResponsiveQueryContext);
18+
const disableCSSMediaQueries = responsiveQueryContext.disableCSSMediaQueries;
19+
20+
if (!disableCSSMediaQueries) {
21+
// This if statement technically breaks the rules of hooks, but is safe
22+
// because the condition never changes after mounting.
23+
// eslint-disable-next-line react-hooks/rules-of-hooks
24+
menuTriggerId = useId();
25+
}
1226
return {
1327
'onKeyDownCapture': (event: KeyboardEvent) => {
1428
if ([' ', 'Enter', 'ArrowUp', 'ArrowDown'].includes(event.key)) {

src/components/composites/Modal/ModalContent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const ModalContent = (props: IBoxProps, ref?: any) => {
4444
//@ts-ignore - web only
4545
accessibilityRole={Platform.OS === 'web' ? 'dialog' : undefined}
4646
accessibilityViewIsModal
47+
_web={{ focusable: false }}
4748
/>
4849
);
4950
};

src/components/composites/NumberInput/NumberInputStepper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const NumberInputStepper = (
6464
ref?: any
6565
) => {
6666
const {
67+
//@ts-ignore
6768
numberInputStepper,
6869
setNumberInputStepper,
6970
}: INumberInputContext = React.useContext(NumberInputContext);

src/components/composites/Popover/Popover.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import Backdrop from '../Backdrop';
99
import { FocusScope } from '@react-native-aria/focus';
1010
import { PresenceTransition } from '../Transitions';
1111
import { StyleSheet } from 'react-native';
12-
import { useId } from '@react-aria/utils';
12+
import { useId } from '@react-native-aria/utils';
1313
import { Overlay } from '../../primitives/Overlay';
1414
import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps';
15+
import { uniqueId } from 'lodash';
16+
import { ResponsiveQueryContext } from '../../../utils/useResponsiveQuery/ResponsiveQueryProvider';
1517

1618
const Popover = (
1719
{
@@ -41,8 +43,18 @@ const Popover = (
4143

4244
const [bodyMounted, setBodyMounted] = React.useState(false);
4345
const [headerMounted, setHeaderMounted] = React.useState(false);
46+
let id = uniqueId();
47+
const responsiveQueryContext = React.useContext(ResponsiveQueryContext);
48+
const disableCSSMediaQueries = responsiveQueryContext.disableCSSMediaQueries;
4449

45-
const popoverContentId = `${useId()}-content`;
50+
if (!disableCSSMediaQueries) {
51+
// This if statement technically breaks the rules of hooks, but is safe
52+
// because the condition never changes after mounting.
53+
// eslint-disable-next-line react-hooks/rules-of-hooks
54+
id = useId();
55+
}
56+
57+
const popoverContentId = `${id}-content`;
4658
const headerId = `${popoverContentId}-header`;
4759
const bodyId = `${popoverContentId}-body`;
4860

0 commit comments

Comments
 (0)