@react-native-aria/separator 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/useSeparator.js +2 -3
- package/lib/commonjs/useSeparator.js.map +1 -1
- package/lib/module/useSeparator.js +2 -3
- package/lib/module/useSeparator.js.map +1 -1
- package/lib/typescript/useSeparator.d.ts +1 -2
- package/package.json +1 -1
- package/src/useSeparator.ts +2 -4
- package/.DS_Store +0 -0
- package/src/.DS_Store +0 -0
@@ -21,9 +21,8 @@ function useSeparator(props) {
|
|
21
21
|
|
22
22
|
return {
|
23
23
|
separatorProps: { ...props,
|
24
|
-
'
|
25
|
-
'aria-orientation': ariaOrientation
|
26
|
-
'accessibilityOrientation': ariaOrientation
|
24
|
+
'role': 'separator',
|
25
|
+
'aria-orientation': ariaOrientation
|
27
26
|
}
|
28
27
|
};
|
29
28
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useSeparator.ts"],"names":["useSeparator","props","ariaOrientation","orientation","separatorProps"],"mappings":";;;;;;;
|
1
|
+
{"version":3,"sources":["useSeparator.ts"],"names":["useSeparator","props","ariaOrientation","orientation","separatorProps"],"mappings":";;;;;;;AAoBA;AACA;AACA;AACA;AACA;AACO,SAASA,YAAT,CAAsBC,KAAtB,EAA4D;AACjE,MAAIC,eAAJ,CADiE,CAEjE;AACA;;AACA,MAAID,KAAK,CAACE,WAAN,KAAsB,UAA1B,EAAsC;AACpCD,IAAAA,eAAe,GAAG,UAAlB;AACD,GANgE,CAOjE;;;AACA,SAAO;AACLE,IAAAA,cAAc,EAAE,EACd,GAAGH,KADW;AAEd,cAAQ,WAFM;AAGd,0BAAoBC;AAHN;AADX,GAAP;AAOD","sourcesContent":["import { AriaLabelingProps, DOMProps, Orientation } from '@react-types/shared';\n\nexport interface SeparatorProps extends DOMProps, AriaLabelingProps {\n /**\n * The orientation of the separator.\n * @default 'horizontal'\n */\n orientation?: Orientation;\n /** The HTML element type that will be used to render the separator. */\n elementType?: string;\n}\n\nexport interface SeparatorAria {\n /** Props for the separator element. */\n separatorProps: {\n 'role': any;\n 'aria-orientation'?: string;\n };\n}\n\n/**\n * Provides the accessibility implementation for a separator.\n * A separator is a visual divider between two groups of content,\n * e.g. groups of menu items or sections of a page.\n */\nexport function useSeparator(props: SeparatorProps): SeparatorAria {\n let ariaOrientation;\n // if orientation is horizontal, aria-orientation default is horizontal, so we leave it undefined\n // if it's vertical, we need to specify it\n if (props.orientation === 'vertical') {\n ariaOrientation = 'vertical';\n }\n // hr elements implicitly have role = separator and a horizontal orientation\n return {\n separatorProps: {\n ...props,\n 'role': 'separator',\n 'aria-orientation': ariaOrientation,\n },\n };\n}\n"]}
|
@@ -14,9 +14,8 @@ export function useSeparator(props) {
|
|
14
14
|
|
15
15
|
return {
|
16
16
|
separatorProps: { ...props,
|
17
|
-
'
|
18
|
-
'aria-orientation': ariaOrientation
|
19
|
-
'accessibilityOrientation': ariaOrientation
|
17
|
+
'role': 'separator',
|
18
|
+
'aria-orientation': ariaOrientation
|
20
19
|
}
|
21
20
|
};
|
22
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useSeparator.ts"],"names":["useSeparator","props","ariaOrientation","orientation","separatorProps"],"mappings":"
|
1
|
+
{"version":3,"sources":["useSeparator.ts"],"names":["useSeparator","props","ariaOrientation","orientation","separatorProps"],"mappings":"AAoBA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,YAAT,CAAsBC,KAAtB,EAA4D;AACjE,MAAIC,eAAJ,CADiE,CAEjE;AACA;;AACA,MAAID,KAAK,CAACE,WAAN,KAAsB,UAA1B,EAAsC;AACpCD,IAAAA,eAAe,GAAG,UAAlB;AACD,GANgE,CAOjE;;;AACA,SAAO;AACLE,IAAAA,cAAc,EAAE,EACd,GAAGH,KADW;AAEd,cAAQ,WAFM;AAGd,0BAAoBC;AAHN;AADX,GAAP;AAOD","sourcesContent":["import { AriaLabelingProps, DOMProps, Orientation } from '@react-types/shared';\n\nexport interface SeparatorProps extends DOMProps, AriaLabelingProps {\n /**\n * The orientation of the separator.\n * @default 'horizontal'\n */\n orientation?: Orientation;\n /** The HTML element type that will be used to render the separator. */\n elementType?: string;\n}\n\nexport interface SeparatorAria {\n /** Props for the separator element. */\n separatorProps: {\n 'role': any;\n 'aria-orientation'?: string;\n };\n}\n\n/**\n * Provides the accessibility implementation for a separator.\n * A separator is a visual divider between two groups of content,\n * e.g. groups of menu items or sections of a page.\n */\nexport function useSeparator(props: SeparatorProps): SeparatorAria {\n let ariaOrientation;\n // if orientation is horizontal, aria-orientation default is horizontal, so we leave it undefined\n // if it's vertical, we need to specify it\n if (props.orientation === 'vertical') {\n ariaOrientation = 'vertical';\n }\n // hr elements implicitly have role = separator and a horizontal orientation\n return {\n separatorProps: {\n ...props,\n 'role': 'separator',\n 'aria-orientation': ariaOrientation,\n },\n };\n}\n"]}
|
@@ -11,8 +11,7 @@ export interface SeparatorProps extends DOMProps, AriaLabelingProps {
|
|
11
11
|
export interface SeparatorAria {
|
12
12
|
/** Props for the separator element. */
|
13
13
|
separatorProps: {
|
14
|
-
'
|
15
|
-
'accessibilityOrientation'?: string;
|
14
|
+
'role': any;
|
16
15
|
'aria-orientation'?: string;
|
17
16
|
};
|
18
17
|
}
|
package/package.json
CHANGED
package/src/useSeparator.ts
CHANGED
@@ -13,8 +13,7 @@ export interface SeparatorProps extends DOMProps, AriaLabelingProps {
|
|
13
13
|
export interface SeparatorAria {
|
14
14
|
/** Props for the separator element. */
|
15
15
|
separatorProps: {
|
16
|
-
'
|
17
|
-
'accessibilityOrientation'?: string;
|
16
|
+
'role': any;
|
18
17
|
'aria-orientation'?: string;
|
19
18
|
};
|
20
19
|
}
|
@@ -35,9 +34,8 @@ export function useSeparator(props: SeparatorProps): SeparatorAria {
|
|
35
34
|
return {
|
36
35
|
separatorProps: {
|
37
36
|
...props,
|
38
|
-
'
|
37
|
+
'role': 'separator',
|
39
38
|
'aria-orientation': ariaOrientation,
|
40
|
-
'accessibilityOrientation': ariaOrientation,
|
41
39
|
},
|
42
40
|
};
|
43
41
|
}
|
package/.DS_Store
DELETED
Binary file
|
package/src/.DS_Store
DELETED
Binary file
|