@react-native-ama/lists 1.0.0 → 1.0.1-alpha.2
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/package.json +5 -5
- package/dist/core/src/components/AMAProvider.d.ts +0 -26
- package/dist/core/src/components/AMAProvider.js +0 -147
- package/dist/core/src/components/AutofocusContainer.d.ts +0 -9
- package/dist/core/src/components/AutofocusContainer.js +0 -58
- package/dist/core/src/components/HideChildrenFromAccessibilityTree.d.ts +0 -6
- package/dist/core/src/components/HideChildrenFromAccessibilityTree.js +0 -40
- package/dist/core/src/hooks/useButtonChecks.d.ts +0 -6
- package/dist/core/src/hooks/useButtonChecks.js +0 -51
- package/dist/core/src/hooks/useChecks.d.ts +0 -15
- package/dist/core/src/hooks/useChecks.js +0 -152
- package/dist/core/src/hooks/useFocus.d.ts +0 -4
- package/dist/core/src/hooks/useFocus.js +0 -55
- package/dist/core/src/hooks/useTimedAction.d.ts +0 -3
- package/dist/core/src/hooks/useTimedAction.js +0 -63
- package/dist/core/src/index.d.ts +0 -7
- package/dist/core/src/index.js +0 -20
- package/dist/internal/src/checks/checkAccessibilityRole.d.ts +0 -3
- package/dist/internal/src/checks/checkAccessibilityRole.js +0 -32
- package/dist/internal/src/checks/checkFocusTrap.d.ts +0 -8
- package/dist/internal/src/checks/checkFocusTrap.js +0 -34
- package/dist/internal/src/checks/checkForAccessibilityState.d.ts +0 -7
- package/dist/internal/src/checks/checkForAccessibilityState.js +0 -48
- package/dist/internal/src/checks/checkMinimumSize.d.ts +0 -3
- package/dist/internal/src/checks/checkMinimumSize.js +0 -29
- package/dist/internal/src/checks/contrastChecker.d.ts +0 -8
- package/dist/internal/src/checks/contrastChecker.js +0 -77
- package/dist/internal/src/checks/noUndefinedProperty.d.ts +0 -8
- package/dist/internal/src/checks/noUndefinedProperty.js +0 -14
- package/dist/internal/src/checks/uppercaseChecker.d.ts +0 -8
- package/dist/internal/src/checks/uppercaseChecker.js +0 -18
- package/dist/internal/src/checks/uppercaseStringChecker.d.ts +0 -8
- package/dist/internal/src/checks/uppercaseStringChecker.js +0 -29
- package/dist/internal/src/index.d.ts +0 -20
- package/dist/internal/src/index.js +0 -56
- package/dist/internal/src/types.d.ts +0 -17
- package/dist/internal/src/types.js +0 -2
- package/dist/internal/src/utils/applyStyle.d.ts +0 -9
- package/dist/internal/src/utils/applyStyle.js +0 -33
- package/dist/internal/src/utils/constants.d.ts +0 -3
- package/dist/internal/src/utils/constants.js +0 -32
- package/dist/internal/src/utils/error.style.d.ts +0 -6
- package/dist/internal/src/utils/error.style.js +0 -11
- package/dist/internal/src/utils/generateAccessibilityStateFromProp.d.ts +0 -9
- package/dist/internal/src/utils/generateAccessibilityStateFromProp.js +0 -35
- package/dist/internal/src/utils/getPropertyFromStyle.d.ts +0 -2
- package/dist/internal/src/utils/getPropertyFromStyle.js +0 -10
- package/dist/internal/src/utils/interpolateAnimationStates.d.ts +0 -2
- package/dist/internal/src/utils/interpolateAnimationStates.js +0 -43
- package/dist/internal/src/utils/isFocused.d.ts +0 -2
- package/dist/internal/src/utils/isFocused.js +0 -7
- package/dist/internal/src/utils/logger.d.ts +0 -16
- package/dist/internal/src/utils/logger.js +0 -53
- package/dist/internal/src/utils/logger.rules.d.ts +0 -15
- package/dist/internal/src/utils/logger.rules.js +0 -74
- package/dist/internal/src/utils/maybeGenerateStringFromElement.d.ts +0 -2
- package/dist/internal/src/utils/maybeGenerateStringFromElement.js +0 -51
- package/dist/internal/src/utils/minimumTouchableSize.d.ts +0 -3
- package/dist/internal/src/utils/minimumTouchableSize.js +0 -9
- /package/dist/{lists/src/components → components}/DynamicFlatList.d.ts +0 -0
- /package/dist/{lists/src/components → components}/DynamicFlatList.js +0 -0
- /package/dist/{lists/src/components → components}/FlatList.d.ts +0 -0
- /package/dist/{lists/src/components → components}/FlatList.js +0 -0
- /package/dist/{lists/src/components → components}/ListWrapper.d.ts +0 -0
- /package/dist/{lists/src/components → components}/ListWrapper.js +0 -0
- /package/dist/{lists/src/components → components}/StaticFlatList.d.ts +0 -0
- /package/dist/{lists/src/components → components}/StaticFlatList.js +0 -0
- /package/dist/{lists/src/hooks → hooks}/useDynamicList.d.ts +0 -0
- /package/dist/{lists/src/hooks → hooks}/useDynamicList.js +0 -0
- /package/dist/{lists/src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{lists/src/index.js → index.js} +0 -0
|
@@ -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,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,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,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,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.maybeGenerateStringFromElement = void 0;
|
|
27
|
-
const React = __importStar(require("react"));
|
|
28
|
-
const maybeGenerateStringFromElement = (element, alternativeString) => {
|
|
29
|
-
var _a;
|
|
30
|
-
if (alternativeString || element == null) {
|
|
31
|
-
return alternativeString || '';
|
|
32
|
-
}
|
|
33
|
-
const pieces = extractPieces(element);
|
|
34
|
-
if (pieces == null || (pieces === null || pieces === void 0 ? void 0 : pieces.length) === 0) {
|
|
35
|
-
console.error(`Cannot generate the string from ${element} prop. Please provide one!`);
|
|
36
|
-
}
|
|
37
|
-
return (_a = pieces === null || pieces === void 0 ? void 0 : pieces.join(' ')) === null || _a === void 0 ? void 0 : _a.replace(/\*$/, '');
|
|
38
|
-
};
|
|
39
|
-
exports.maybeGenerateStringFromElement = maybeGenerateStringFromElement;
|
|
40
|
-
const extractPieces = (component) => {
|
|
41
|
-
return React.Children.map(component, child => {
|
|
42
|
-
if (!React.isValidElement(child)) {
|
|
43
|
-
return '';
|
|
44
|
-
}
|
|
45
|
-
const children = child.props.children;
|
|
46
|
-
if (React.isValidElement(children) || Array.isArray(children)) {
|
|
47
|
-
return extractPieces(children);
|
|
48
|
-
}
|
|
49
|
-
return children;
|
|
50
|
-
});
|
|
51
|
-
};
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|