@react-native-ama/core 0.0.2 → 1.0.0

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.
Files changed (81) hide show
  1. package/dist/{core/src/components → components}/AMAProvider.js +1 -2
  2. package/dist/{core/src/index.js → index.js} +3 -3
  3. package/package.json +30 -5
  4. package/src/components/AMAProvider.d.ts +26 -0
  5. package/src/components/AMAProvider.js +147 -0
  6. package/src/components/AMAProvider.tsx +1 -3
  7. package/src/components/AutofocusContainer.d.ts +9 -0
  8. package/src/components/AutofocusContainer.js +58 -0
  9. package/src/components/HideChildrenFromAccessibilityTree.d.ts +6 -0
  10. package/src/components/HideChildrenFromAccessibilityTree.js +40 -0
  11. package/src/components/HideChildrenFromAccessibilityTree.test.tsx +2 -1
  12. package/src/hooks/useButtonChecks.d.ts +8 -0
  13. package/src/hooks/useButtonChecks.js +51 -0
  14. package/src/hooks/useChecks.d.ts +15 -0
  15. package/src/hooks/useChecks.js +152 -0
  16. package/src/hooks/useChecks.test.ts +1 -1
  17. package/src/hooks/useFocus.d.ts +4 -0
  18. package/{dist/internal/src/utils/maybeGenerateStringFromElement.js → src/hooks/useFocus.js} +26 -22
  19. package/src/hooks/useFocus.test.ts +1 -0
  20. package/src/hooks/useTimedAction.d.ts +3 -0
  21. package/src/hooks/useTimedAction.js +63 -0
  22. package/src/index.d.ts +7 -0
  23. package/src/index.js +20 -0
  24. package/src/index.ts +1 -1
  25. package/dist/internal/src/checks/checkAccessibilityRole.d.ts +0 -3
  26. package/dist/internal/src/checks/checkAccessibilityRole.js +0 -32
  27. package/dist/internal/src/checks/checkFocusTrap.d.ts +0 -8
  28. package/dist/internal/src/checks/checkFocusTrap.js +0 -34
  29. package/dist/internal/src/checks/checkForAccessibilityState.d.ts +0 -7
  30. package/dist/internal/src/checks/checkForAccessibilityState.js +0 -48
  31. package/dist/internal/src/checks/checkMinimumSize.d.ts +0 -3
  32. package/dist/internal/src/checks/checkMinimumSize.js +0 -29
  33. package/dist/internal/src/checks/contrastChecker.d.ts +0 -8
  34. package/dist/internal/src/checks/contrastChecker.js +0 -77
  35. package/dist/internal/src/checks/noUndefinedProperty.d.ts +0 -8
  36. package/dist/internal/src/checks/noUndefinedProperty.js +0 -14
  37. package/dist/internal/src/checks/uppercaseChecker.d.ts +0 -9
  38. package/dist/internal/src/checks/uppercaseChecker.js +0 -18
  39. package/dist/internal/src/checks/uppercaseStringChecker.d.ts +0 -8
  40. package/dist/internal/src/checks/uppercaseStringChecker.js +0 -29
  41. package/dist/internal/src/index.d.ts +0 -20
  42. package/dist/internal/src/index.js +0 -56
  43. package/dist/internal/src/types.d.ts +0 -17
  44. package/dist/internal/src/types.js +0 -2
  45. package/dist/internal/src/utils/applyStyle.d.ts +0 -10
  46. package/dist/internal/src/utils/applyStyle.js +0 -33
  47. package/dist/internal/src/utils/constants.d.ts +0 -3
  48. package/dist/internal/src/utils/constants.js +0 -32
  49. package/dist/internal/src/utils/error.style.d.ts +0 -6
  50. package/dist/internal/src/utils/error.style.js +0 -11
  51. package/dist/internal/src/utils/generateAccessibilityStateFromProp.d.ts +0 -9
  52. package/dist/internal/src/utils/generateAccessibilityStateFromProp.js +0 -35
  53. package/dist/internal/src/utils/getPropertyFromStyle.d.ts +0 -2
  54. package/dist/internal/src/utils/getPropertyFromStyle.js +0 -10
  55. package/dist/internal/src/utils/interpolateAnimationStates.d.ts +0 -2
  56. package/dist/internal/src/utils/interpolateAnimationStates.js +0 -43
  57. package/dist/internal/src/utils/isFocused.d.ts +0 -2
  58. package/dist/internal/src/utils/isFocused.js +0 -7
  59. package/dist/internal/src/utils/logger.d.ts +0 -16
  60. package/dist/internal/src/utils/logger.js +0 -53
  61. package/dist/internal/src/utils/logger.rules.d.ts +0 -15
  62. package/dist/internal/src/utils/logger.rules.js +0 -74
  63. package/dist/internal/src/utils/maybeGenerateStringFromElement.d.ts +0 -3
  64. package/dist/internal/src/utils/minimumTouchableSize.d.ts +0 -3
  65. package/dist/internal/src/utils/minimumTouchableSize.js +0 -9
  66. package/dist/{core/src/components → components}/AMAProvider.d.ts +0 -0
  67. package/dist/{core/src/components → components}/AutofocusContainer.d.ts +0 -0
  68. package/dist/{core/src/components → components}/AutofocusContainer.js +0 -0
  69. package/dist/{core/src/components → components}/HideChildrenFromAccessibilityTree.d.ts +0 -0
  70. package/dist/{core/src/components → components}/HideChildrenFromAccessibilityTree.js +0 -0
  71. package/dist/{core/src/hooks → hooks}/useButtonChecks.d.ts +0 -0
  72. package/dist/{core/src/hooks → hooks}/useButtonChecks.js +0 -0
  73. package/dist/{core/src/hooks → hooks}/useChecks.d.ts +0 -0
  74. package/dist/{core/src/hooks → hooks}/useChecks.js +0 -0
  75. package/dist/{core/src/hooks → hooks}/useFocus.d.ts +0 -0
  76. package/dist/{core/src/hooks → hooks}/useFocus.js +0 -0
  77. package/dist/{core/src/hooks → hooks}/useTimedAction.d.ts +0 -0
  78. package/dist/{core/src/hooks → hooks}/useTimedAction.js +0 -0
  79. package/dist/{core/src/index.d.ts → index.d.ts} +1 -1
  80. /package/dist/{core/src/utils → utils}/numerify.d.ts +0 -0
  81. /package/dist/{core/src/utils → utils}/numerify.js +0 -0
@@ -1,17 +0,0 @@
1
- import type { AccessibilityState } from 'react-native';
2
- export type AMAAccessibilityState = Pick<AccessibilityState, 'busy'>;
3
- export type AccessibilityRoles = {
4
- accessibilityRole: 'none' | 'link' | 'search' | 'image' | 'keyboardkey' | 'text' | 'imagebutton' | 'header' | 'summary' | 'alert' | 'combobox' | 'menu' | 'menubar' | 'menuitem' | 'progressbar' | 'radiogroup' | 'scrollbar' | 'spinbutton' | 'tabbar' | 'tablist' | 'timer' | 'list' | 'toolbar';
5
- } | {
6
- accessibilityRole: 'button';
7
- expanded?: AccessibilityState['expanded'];
8
- } | {
9
- accessibilityRole: 'switch';
10
- checked: AccessibilityState['checked'];
11
- } | {
12
- accessibilityRole: 'tab' | 'radio';
13
- selected: AccessibilityState['selected'];
14
- } | {
15
- accessibilityRole: 'togglebutton' | 'switch' | 'checkbox';
16
- checked: AccessibilityState['checked'];
17
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { ContrastChecker } from '../checks/contrastChecker';
3
- export declare const applyStyle: (({ style, debugStyle, children, contrastCheckerCallback, }: {
4
- style: Record<string, any> | Function;
5
- debugStyle: Record<any, any>;
6
- children?: ReactNode;
7
- contrastCheckerCallback?: ((_: ContrastChecker) => Record<string, any>) | undefined;
8
- }) => any[] | ((...params: any) => any) | {
9
- [x: string]: any;
10
- } | undefined) | null;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyStyle = void 0;
4
- const applyStyleFunction = __DEV__
5
- ? (style, debugStyle, children, contrastCheckerCallback) => {
6
- return (...params) => {
7
- const s = style(...params);
8
- const contrastStyle = contrastCheckerCallback
9
- ? contrastCheckerCallback({ style: s, children })
10
- : {};
11
- if (Array.isArray(s)) {
12
- return [...s, debugStyle, contrastStyle];
13
- }
14
- return Object.assign(Object.assign(Object.assign({}, s), debugStyle), contrastStyle);
15
- };
16
- }
17
- : null;
18
- exports.applyStyle = __DEV__
19
- ? ({ style, debugStyle, children, contrastCheckerCallback, }) => {
20
- if (typeof style === 'function') {
21
- return applyStyleFunction === null || applyStyleFunction === void 0 ? void 0 : applyStyleFunction(style, debugStyle, children, contrastCheckerCallback);
22
- }
23
- const contrastCheckerStyle = contrastCheckerCallback
24
- ? contrastCheckerCallback({ style, children })
25
- : {};
26
- if (Array.isArray(style)) {
27
- return [...style, debugStyle, contrastCheckerStyle].filter(Boolean);
28
- }
29
- else {
30
- return Object.assign(Object.assign(Object.assign({}, style), debugStyle), contrastCheckerStyle);
31
- }
32
- }
33
- : null;
@@ -1,3 +0,0 @@
1
- import type { ViewStyle } from 'react-native';
2
- export type MotionAnimationKey = Partial<keyof ViewStyle> | 'scale';
3
- export declare const MOTION_ANIMATIONS: MotionAnimationKey[];
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MOTION_ANIMATIONS = void 0;
4
- exports.MOTION_ANIMATIONS = [
5
- 'left',
6
- 'bottom',
7
- 'top',
8
- 'right',
9
- 'transform',
10
- 'translateX',
11
- 'translateY',
12
- 'scaleX',
13
- 'scaleY',
14
- 'scale',
15
- 'width',
16
- 'height',
17
- 'padding',
18
- 'paddingBottom',
19
- 'paddingLeft',
20
- 'paddingRight',
21
- 'paddingTop',
22
- 'paddingVertical',
23
- 'paddingHorizontal',
24
- 'margin',
25
- 'marginBottom',
26
- 'marginLeft',
27
- 'marginRight',
28
- 'marginTop',
29
- 'marginHorizontal',
30
- 'marginVertical',
31
- 'rotation',
32
- ];
@@ -1,6 +0,0 @@
1
- export declare const RED = "#A31420";
2
- export declare const ERROR_STYLE: {
3
- borderColor: string;
4
- backgroundColor: string;
5
- borderWidth: number;
6
- } | null;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ERROR_STYLE = exports.RED = void 0;
4
- exports.RED = '#A31420';
5
- exports.ERROR_STYLE = __DEV__
6
- ? {
7
- borderColor: exports.RED,
8
- backgroundColor: 'rgba(163, 20, 32, 0.4)',
9
- borderWidth: 4,
10
- }
11
- : null;
@@ -1,9 +0,0 @@
1
- import type { AccessibilityRole, AccessibilityState } from 'react-native';
2
- export declare const generateAccessibilityStateFromProp: ({ accessibilityRole, ...props }: StateKeyValue) => AccessibilityState;
3
- type StateKeyValue = {
4
- [key in keyof AccessibilityState]: AccessibilityState[key];
5
- } & {
6
- accessibilityState?: AccessibilityState;
7
- accessibilityRole?: AccessibilityRole;
8
- };
9
- export {};
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.generateAccessibilityStateFromProp = void 0;
15
- const react_native_1 = require("react-native");
16
- const generateAccessibilityStateFromProp = (_a) => {
17
- var { accessibilityRole } = _a, props = __rest(_a, ["accessibilityRole"]);
18
- const state = Object.assign({ disabled: props.disabled, selected: props.selected, checked: props.checked, busy: props.busy, expanded: props.expanded }, (props.accessibilityState || {}));
19
- if (accessibilityRole === 'button' && react_native_1.Platform.OS === 'ios') {
20
- /**
21
- * Accessibility roles like
22
- * - checkbox
23
- * - radio
24
- * - togglebutton
25
- *
26
- * need to set the "selected" state for iOS
27
- */
28
- if (typeof state.checked !== 'undefined') {
29
- state.selected = state.checked;
30
- state.checked = undefined;
31
- }
32
- }
33
- return Object.fromEntries(Object.entries(state).filter(([, value]) => value !== undefined));
34
- };
35
- exports.generateAccessibilityStateFromProp = generateAccessibilityStateFromProp;
@@ -1,2 +0,0 @@
1
- import type { StyleProp } from 'react-native';
2
- export declare const getPropertyFromStyle: (style: StyleProp<any> | StyleProp<any>[] | null, key: keyof StyleProp<any>) => any;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPropertyFromStyle = void 0;
4
- const getPropertyFromStyle = (style, key) => {
5
- var _a, _b, _c;
6
- return Array.isArray(style)
7
- ? (_c = (_b = (_a = style.filter(theStyle => theStyle === null || theStyle === void 0 ? void 0 : theStyle[key])) === null || _a === void 0 ? void 0 : _a.slice(-1)) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[key]
8
- : style === null || style === void 0 ? void 0 : style[key];
9
- };
10
- exports.getPropertyFromStyle = getPropertyFromStyle;
@@ -1,2 +0,0 @@
1
- import type { Animated } from 'react-native';
2
- export declare const interpolateAnimationStates: (from: Record<string, any>, to: Record<string, any>, isReduceMotionEnabled: boolean, progressValue: Animated.Value, reduceMotionProgressValue: Animated.Value) => Record<string, any>;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.interpolateAnimationStates = void 0;
15
- const constants_1 = require("./constants");
16
- const interpolateAnimationStates = (from, to, isReduceMotionEnabled, progressValue, reduceMotionProgressValue) => {
17
- return Object.keys(from).reduce((outputAnimation, key) => {
18
- const isMotionAnimation = constants_1.MOTION_ANIMATIONS.includes(key);
19
- const progressKey = isReduceMotionEnabled && isMotionAnimation
20
- ? reduceMotionProgressValue
21
- : progressValue;
22
- if (Array.isArray(from[key])) {
23
- outputAnimation[key] = from[key].map((animationObject, index) => {
24
- const _a = (0, exports.interpolateAnimationStates)(animationObject, to[key][index], isReduceMotionEnabled, progressValue, reduceMotionProgressValue), { __hasOnlyMotionAnimation } = _a, style = __rest(_a, ["__hasOnlyMotionAnimation"]);
25
- outputAnimation.__hasOnlyMotionAnimation =
26
- outputAnimation.__hasOnlyMotionAnimation &&
27
- __hasOnlyMotionAnimation;
28
- return style;
29
- });
30
- }
31
- else {
32
- outputAnimation[key] = progressKey.interpolate({
33
- inputRange: [0, 1],
34
- // @ts-ignore
35
- outputRange: [from[key], to[key]],
36
- });
37
- outputAnimation.__hasOnlyMotionAnimation =
38
- outputAnimation.__hasOnlyMotionAnimation && isMotionAnimation;
39
- }
40
- return outputAnimation;
41
- }, { __hasOnlyMotionAnimation: true });
42
- };
43
- exports.interpolateAnimationStates = interpolateAnimationStates;
@@ -1,2 +0,0 @@
1
- import type { TextInput } from 'react-native';
2
- export declare const isFocused: (input: TextInput | undefined | null) => boolean | undefined;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFocused = void 0;
4
- const isFocused = (input) => {
5
- return input === null || input === void 0 ? void 0 : input.isFocused();
6
- };
7
- exports.isFocused = isFocused;
@@ -1,16 +0,0 @@
1
- import { Rule, RuleAction } from './logger.rules';
2
- export type LogParams = {
3
- rule: Rule;
4
- message: string;
5
- extra?: any;
6
- };
7
- export declare const getRuleAction: ((rule: Rule) => RuleAction) | null;
8
- type LogFailure = LogParams & {
9
- action: RuleAction;
10
- };
11
- type CHECK_STATUS = 'ERROR' | 'WARNING';
12
- export declare const logFailure: (({ action, rule, message, extra }: LogFailure) => CHECK_STATUS) | null;
13
- export declare const getContrastCheckerMaxDepth: (() => RuleAction | 5) | null;
14
- export declare const shouldIgnoreContrastCheckForDisabledElement: (() => false | RuleAction) | null;
15
- export declare const isAccessibilityLabelAllowed: ((accessibilityLabel: string) => boolean) | null;
16
- export {};
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAccessibilityLabelAllowed = exports.shouldIgnoreContrastCheckForDisabledElement = exports.getContrastCheckerMaxDepth = exports.logFailure = exports.getRuleAction = void 0;
4
- const logger_rules_1 = require("./logger.rules");
5
- const logger_rules_2 = require("./logger.rules");
6
- const overrideRules = require('./../ama.rules.json');
7
- exports.getRuleAction = __DEV__
8
- ? (rule) => {
9
- var _a;
10
- const customRule = (logger_rules_1.canRuleBeOverridden === null || logger_rules_1.canRuleBeOverridden === void 0 ? void 0 : (0, logger_rules_1.canRuleBeOverridden)(rule))
11
- ? (_a = overrideRules === null || overrideRules === void 0 ? void 0 : overrideRules.rules) === null || _a === void 0 ? void 0 : _a[rule]
12
- : undefined;
13
- return customRule || logger_rules_2.LOGGER_RULES[rule];
14
- }
15
- : null;
16
- exports.logFailure = __DEV__
17
- ? ({ action, rule, message, extra = '' }) => {
18
- // @ts-ignore
19
- const formattedMessage = `❌ ${logger_rules_1.SHELL_COLORS.BG_RED}[ AMA ]${logger_rules_1.SHELL_COLORS.RESET}: ${logger_rules_1.SHELL_COLORS.BLUE}${rule}${logger_rules_1.SHELL_COLORS.RESET} - ${logger_rules_1.SHELL_COLORS.YELLOW}${message}${logger_rules_1.SHELL_COLORS.RESET}\n\n${logger_rules_2.RULES_HELP[rule]}\n\n`;
20
- switch (action) {
21
- case 'MUST_NOT':
22
- case 'MUST':
23
- console.info(formattedMessage, extra || '', '\n');
24
- return 'ERROR';
25
- case 'PLEASE_FORGIVE_ME':
26
- return 'WARNING';
27
- case 'SHOULD_NOT':
28
- default:
29
- console.warn(formattedMessage, extra || '', '\n');
30
- return 'WARNING';
31
- }
32
- }
33
- : null;
34
- exports.getContrastCheckerMaxDepth = __DEV__
35
- ? () => {
36
- var _a;
37
- return (((_a = overrideRules === null || overrideRules === void 0 ? void 0 : overrideRules.rules) === null || _a === void 0 ? void 0 : _a.CONTRAST_CHECKER_MAX_DEPTH) ||
38
- logger_rules_2.CONTRAST_CHECKER_MAX_DEPTH);
39
- }
40
- : null;
41
- exports.shouldIgnoreContrastCheckForDisabledElement = __DEV__
42
- ? () => {
43
- var _a;
44
- return (((_a = overrideRules === null || overrideRules === void 0 ? void 0 : overrideRules.rules) === null || _a === void 0 ? void 0 : _a.IGNORE_CONTRAST_FOR_DISABLED_ELEMENTS) ||
45
- logger_rules_1.IGNORE_CONTRAST_FOR_DISABLED_ELEMENTS);
46
- }
47
- : null;
48
- exports.isAccessibilityLabelAllowed = __DEV__
49
- ? (accessibilityLabel) => {
50
- var _a;
51
- return (_a = overrideRules === null || overrideRules === void 0 ? void 0 : overrideRules.accessibilityLabelExceptions) === null || _a === void 0 ? void 0 : _a.includes(accessibilityLabel);
52
- }
53
- : null;
@@ -1,15 +0,0 @@
1
- export type Rule = 'BOTTOM_SHEET_CLOSE_ACTION' | 'CONTRAST_FAILED' | 'CONTRAST_FAILED_AAA' | 'FLATLIST_NO_COUNT_IN_PLURAL_MESSAGE' | 'FLATLIST_NO_COUNT_IN_SINGULAR_MESSAGE' | 'MINIMUM_SIZE' | 'NO_ACCESSIBILITY_LABEL' | 'NO_ACCESSIBILITY_ROLE' | 'NO_FORM_ERROR' | 'NO_FORM_LABEL' | 'NO_KEYBOARD_TRAP' | 'NO_UNDEFINED' | 'NO_UPPERCASE_TEXT' | 'INCOMPATIBLE_ACCESSIBILITY_STATE' | 'INCOMPATIBLE_ACCESSIBILITY_ROLE' | 'NO_FORM_LABEL_ENDING_WITH_ASTERISK' | 'UPPERCASE_TEXT_NO_ACCESSIBILITY_LABEL';
2
- export type RuleAction = 'SHOULD_NOT' | 'MUST_NOT' | 'MUST' | 'SHOULD' | 'PLEASE_FORGIVE_ME';
3
- export declare const NON_OVERRIDABLE_RULES: string[] | undefined;
4
- export declare const LOGGER_RULES: Record<Rule, RuleAction> | null;
5
- export declare const CONTRAST_CHECKER_MAX_DEPTH = 5;
6
- export declare const IGNORE_CONTRAST_FOR_DISABLED_ELEMENTS = false;
7
- export declare const RULES_HELP: Record<Rule, string> | null;
8
- export declare const canRuleBeOverridden: ((rule: Rule) => boolean) | null;
9
- export declare const SHELL_COLORS: {
10
- RED: string;
11
- YELLOW: string;
12
- RESET: string;
13
- BLUE: string;
14
- BG_RED: string;
15
- } | undefined;
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SHELL_COLORS = exports.canRuleBeOverridden = exports.RULES_HELP = exports.IGNORE_CONTRAST_FOR_DISABLED_ELEMENTS = exports.CONTRAST_CHECKER_MAX_DEPTH = exports.LOGGER_RULES = exports.NON_OVERRIDABLE_RULES = void 0;
4
- exports.NON_OVERRIDABLE_RULES = __DEV__
5
- ? [
6
- 'NO_ACCESSIBILITY_ROLE',
7
- 'NO_ACCESSIBILITY_LABEL',
8
- 'NO_KEYBOARD_TRAP',
9
- 'NO_UNDEFINED',
10
- 'NO_FORM_LABEL',
11
- 'FLATLIST_NO_COUNT_IN_PLURAL_MESSAGE',
12
- 'BOTTOM_SHEET_CLOSE_ACTION',
13
- 'INCOMPATIBLE_ACCESSIBILITY_STATE',
14
- 'INCOMPATIBLE_ACCESSIBILITY_ROLE',
15
- ]
16
- : undefined;
17
- exports.LOGGER_RULES = __DEV__
18
- ? {
19
- CONTRAST_FAILED: 'MUST',
20
- CONTRAST_FAILED_AAA: 'SHOULD',
21
- FLATLIST_NO_COUNT_IN_SINGULAR_MESSAGE: 'SHOULD',
22
- FLATLIST_NO_COUNT_IN_PLURAL_MESSAGE: 'MUST',
23
- MINIMUM_SIZE: 'MUST',
24
- NO_ACCESSIBILITY_LABEL: 'MUST',
25
- NO_ACCESSIBILITY_ROLE: 'MUST',
26
- NO_FORM_LABEL: 'MUST',
27
- NO_FORM_ERROR: 'MUST',
28
- NO_KEYBOARD_TRAP: 'MUST_NOT',
29
- NO_UNDEFINED: 'MUST_NOT',
30
- UPPERCASE_TEXT_NO_ACCESSIBILITY_LABEL: 'MUST_NOT',
31
- NO_UPPERCASE_TEXT: 'MUST_NOT',
32
- BOTTOM_SHEET_CLOSE_ACTION: 'MUST',
33
- INCOMPATIBLE_ACCESSIBILITY_STATE: 'MUST',
34
- NO_FORM_LABEL_ENDING_WITH_ASTERISK: 'MUST_NOT',
35
- INCOMPATIBLE_ACCESSIBILITY_ROLE: 'MUST_NOT',
36
- }
37
- : null;
38
- exports.CONTRAST_CHECKER_MAX_DEPTH = 5;
39
- exports.IGNORE_CONTRAST_FOR_DISABLED_ELEMENTS = false;
40
- exports.RULES_HELP = __DEV__
41
- ? {
42
- NO_UNDEFINED: '',
43
- CONTRAST_FAILED: 'https://formidable.com/open-source/react-native-ama/guidelines/contrast',
44
- CONTRAST_FAILED_AAA: 'https://formidable.com/open-source/react-native-ama/guidelines/contrast',
45
- MINIMUM_SIZE: 'https://formidable.com/open-source/react-native-ama/guidelines/minimum-size',
46
- UPPERCASE_TEXT_NO_ACCESSIBILITY_LABEL: 'https://formidable.com/open-source/react-native-ama/guidelines/text',
47
- NO_UPPERCASE_TEXT: 'https://formidable.com/open-source/react-native-ama/guidelines/text',
48
- NO_ACCESSIBILITY_LABEL: 'https://formidable.com/open-source/react-native-ama/guidelines/accessibility-labels',
49
- NO_ACCESSIBILITY_ROLE: 'https://formidable.com/open-source/react-native-ama/guidelines/accessibility-role',
50
- NO_KEYBOARD_TRAP: 'https://formidable.com/open-source/react-native-ama/guidelines/forms',
51
- NO_FORM_LABEL: 'https://formidable.com/open-source/react-native-ama/guidelines/forms',
52
- NO_FORM_ERROR: 'https://formidable.com/open-source/react-native-ama/guidelines/forms',
53
- FLATLIST_NO_COUNT_IN_SINGULAR_MESSAGE: 'https://formidable.com/open-source/react-native-ama/guidelines/lists-grids#number-of-results',
54
- FLATLIST_NO_COUNT_IN_PLURAL_MESSAGE: 'https://formidable.com/open-source/react-native-ama/guidelines/lists-grids#number-of-results',
55
- BOTTOM_SHEET_CLOSE_ACTION: 'https://formidable.com/open-source/react-native-ama/guidelines/bottomsheet',
56
- INCOMPATIBLE_ACCESSIBILITY_STATE: 'https://formidable.com/open-source/react-native-ama/guidelines/accessibility-role',
57
- INCOMPATIBLE_ACCESSIBILITY_ROLE: 'https://formidable.com/open-source/react-native-ama/guidelines/accessibility-role',
58
- NO_FORM_LABEL_ENDING_WITH_ASTERISK: 'https://formidable.com/open-source/react-native-ama/guidelines/forms#labels',
59
- }
60
- : null;
61
- exports.canRuleBeOverridden = __DEV__
62
- ? (rule) => {
63
- return !exports.NON_OVERRIDABLE_RULES.includes(rule);
64
- }
65
- : null;
66
- exports.SHELL_COLORS = __DEV__
67
- ? {
68
- RED: '\x1b[31m',
69
- YELLOW: '\x1b[33m',
70
- RESET: '\x1b[0m',
71
- BLUE: '\x1b[36m',
72
- BG_RED: '\x1b[41m',
73
- }
74
- : undefined;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- /// <reference types="react" />
3
- export declare const maybeGenerateStringFromElement: (element?: JSX.Element, alternativeString?: string | null) => string;
@@ -1,3 +0,0 @@
1
- export declare const ANDROID_MINIMUM_TOUCHABLE_SIZE = 48;
2
- export declare const IOS_MINIMUM_TOUCHABLE_SIZE = 44;
3
- export declare const MINIMUM_TOUCHABLE_SIZE: number;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MINIMUM_TOUCHABLE_SIZE = exports.IOS_MINIMUM_TOUCHABLE_SIZE = exports.ANDROID_MINIMUM_TOUCHABLE_SIZE = void 0;
4
- const react_native_1 = require("react-native");
5
- exports.ANDROID_MINIMUM_TOUCHABLE_SIZE = 48;
6
- exports.IOS_MINIMUM_TOUCHABLE_SIZE = 44;
7
- exports.MINIMUM_TOUCHABLE_SIZE = react_native_1.Platform.OS === 'android'
8
- ? exports.ANDROID_MINIMUM_TOUCHABLE_SIZE
9
- : exports.IOS_MINIMUM_TOUCHABLE_SIZE;
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  export { AutofocusContainer } from './components/AutofocusContainer';
2
- export { HideChildrenFromAccessibilityTree } from './components/HideChildrenFromAccessibilityTree';
3
2
  export { AMAProvider, useAMAContext, type AMAContextValue, type AMADevContextValue, type AMAProdContextValue, } from './components/AMAProvider';
3
+ export { HideChildrenFromAccessibilityTree } from './components/HideChildrenFromAccessibilityTree';
4
4
  export { useButtonChecks } from './hooks/useButtonChecks';
5
5
  export { useChecks } from './hooks/useChecks';
6
6
  export { useFocus } from './hooks/useFocus';
File without changes
File without changes