sapo-components-ui-rn 1.1.97 → 1.1.99

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.
@@ -26,6 +26,7 @@ export interface ButtonProps extends TouchableOpacityProps {
26
26
  type?: 'default' | 'text';
27
27
  critical?: boolean;
28
28
  width?: number;
29
+ testID?: string;
29
30
  }
30
- declare const _default: React.MemoExoticComponent<({ style, title, border, borderColor, isLoading, left, right, margin, textStyle, textProps, onPress, disabled, backgroundColor, textColor, textBold, mode, transparent, full, theme: themeOverrides, buttonSize, textSize, critical, width, type, ...props }: ButtonProps) => React.JSX.Element>;
31
+ declare const _default: React.MemoExoticComponent<({ style, title, border, borderColor, isLoading, left, right, margin, textStyle, textProps, onPress, disabled, backgroundColor, textColor, textBold, mode, transparent, full, theme: themeOverrides, buttonSize, textSize, critical, width, type, testID, accessibilityLabel, ...props }: ButtonProps) => React.JSX.Element>;
31
32
  export default _default;
@@ -14,6 +14,8 @@ export interface ButtonIconProps {
14
14
  borderColor?: string;
15
15
  mode?: "normal" | "small";
16
16
  testID?: string;
17
+ accessible?: boolean;
18
+ accessibilityLabel?: string;
17
19
  }
18
20
  declare const _default: React.MemoExoticComponent<React.ComponentType<ButtonIconProps>>;
19
21
  export default _default;
@@ -10,6 +10,8 @@ interface CheckboxProps {
10
10
  leftIcon?: React.ReactNode;
11
11
  checked?: boolean | "indeterminate";
12
12
  iconSize?: number;
13
+ accessible?: boolean;
14
+ accessibilityLabel?: string;
13
15
  }
14
- declare const Checkbox: ({ testID, style, content, textStyle, onPress, disabled, leftIcon, checked, iconSize, }: CheckboxProps) => React.JSX.Element;
16
+ declare const Checkbox: ({ testID, style, content, textStyle, onPress, disabled, leftIcon, checked, iconSize, accessible, accessibilityLabel, }: CheckboxProps) => React.JSX.Element;
15
17
  export default Checkbox;
@@ -14,6 +14,8 @@ interface ChipBarProps {
14
14
  checked?: boolean;
15
15
  ellipsizeMode?: "head" | "middle" | "tail" | "clip";
16
16
  numberOfLines?: number;
17
+ accessible?: boolean;
18
+ accessibilityLabel?: string;
17
19
  }
18
- declare const ChipBar: ({ testID, style, borderRadius, title, textStyle, onPress, disabled, leftIcon, rightIcon, badge, checked, ellipsizeMode, numberOfLines, }: ChipBarProps) => React.JSX.Element;
20
+ declare const ChipBar: ({ testID, style, borderRadius, title, textStyle, onPress, disabled, leftIcon, rightIcon, badge, checked, ellipsizeMode, numberOfLines, accessible, accessibilityLabel, }: ChipBarProps) => React.JSX.Element;
19
21
  export default ChipBar;
@@ -15,6 +15,8 @@ export interface FloatingButtonProps {
15
15
  left?: number;
16
16
  bottom?: number;
17
17
  testID?: string;
18
+ accessible?: boolean;
19
+ accessibilityLabel?: string;
18
20
  }
19
21
  declare const _default: React.MemoExoticComponent<React.ComponentType<FloatingButtonProps>>;
20
22
  export default _default;
@@ -11,6 +11,8 @@ export interface IconProps {
11
11
  tintColor?: string;
12
12
  animatedProps?: Record<string, unknown>;
13
13
  testID?: string;
14
+ accessible?: boolean;
15
+ accessibilityLabel?: string;
14
16
  }
15
17
  declare const _default: React.NamedExoticComponent<IconProps>;
16
18
  export default _default;
@@ -20,6 +20,7 @@ export interface NumberKeyboardProps {
20
20
  /** Callback khi đóng modal */
21
21
  onClose: () => void;
22
22
  keyboardStyle?: StyleProp<ViewStyle>;
23
+ testID?: string;
23
24
  }
24
25
  declare const _default: React.NamedExoticComponent<NumberKeyboardProps>;
25
26
  export default _default;
@@ -9,6 +9,8 @@ interface RadioButtonProps {
9
9
  disabled?: boolean;
10
10
  leftIcon?: React.ReactNode;
11
11
  checked?: boolean;
12
+ accessible?: boolean;
13
+ accessibilityLabel?: string;
12
14
  }
13
- declare const RadioButton: ({ testID, style, content, textStyle, onPress, disabled, leftIcon, checked, }: RadioButtonProps) => React.JSX.Element;
15
+ declare const RadioButton: ({ testID, style, content, textStyle, onPress, disabled, leftIcon, checked, accessible, accessibilityLabel, }: RadioButtonProps) => React.JSX.Element;
14
16
  export default RadioButton;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { TouchableOpacityProps } from "react-native";
3
- declare const _default: React.MemoExoticComponent<({ children, style, onPress, ...rest }: TouchableOpacityProps) => React.JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ children, style, onPress, accessible, accessibilityRole, ...rest }: TouchableOpacityProps) => React.JSX.Element>;
4
4
  export default _default;
@@ -20,6 +20,9 @@ export interface SelectionFieldProps extends TouchableOpacityProps {
20
20
  theme?: ThemeProp;
21
21
  required?: boolean;
22
22
  height?: number;
23
+ testID?: string;
24
+ accessible?: boolean;
25
+ accessibilityLabel?: string;
23
26
  }
24
- declare const _default: React.MemoExoticComponent<({ style, content, label, error, borderColor, left, right, textStyle, labelStyle, textProps, onPress, disabled, textColor, labelColor, theme: themeOverrides, required, height, testID, ...props }: SelectionFieldProps) => React.JSX.Element>;
27
+ declare const _default: React.MemoExoticComponent<({ style, content, label, error, borderColor, left, right, textStyle, labelStyle, textProps, onPress, disabled, textColor, labelColor, theme: themeOverrides, required, height, testID, accessible, accessibilityLabel, ...props }: SelectionFieldProps) => React.JSX.Element>;
25
28
  export default _default;
@@ -14,6 +14,8 @@ export type Props = {
14
14
  */
15
15
  onValueChange?: (value: boolean) => void;
16
16
  testID?: string;
17
+ accessible?: boolean;
18
+ accessibilityLabel?: string;
17
19
  };
18
- declare const Switch: React.MemoExoticComponent<({ testID, value, disabled, onValueChange, size }: Props) => React.JSX.Element>;
20
+ declare const Switch: React.MemoExoticComponent<({ testID, value, disabled, onValueChange, size, accessible, accessibilityLabel, }: Props) => React.JSX.Element>;
19
21
  export default Switch;
@@ -24,6 +24,7 @@ export interface TextInputNumberProps extends TouchableOpacityProps {
24
24
  contentStyle?: StyleProp<TextStyle>;
25
25
  textErrorStyle?: StyleProp<TextStyle>;
26
26
  height?: number;
27
+ testID?: string;
27
28
  }
28
- declare const _default: React.MemoExoticComponent<({ style, value, label, textError, left, right, onChangeText, disabled, theme: themeOverrides, prefix, suffix, clearButton, maxValue, minValue, type, formatDecimal, required, labelStyle, contentStyle, textErrorStyle, height, keyboardStyle, ...props }: TextInputNumberProps) => React.JSX.Element>;
29
+ declare const _default: React.MemoExoticComponent<({ style, value, label, textError, left, right, onChangeText, disabled, theme: themeOverrides, prefix, suffix, clearButton, maxValue, minValue, type, formatDecimal, required, labelStyle, contentStyle, textErrorStyle, height, keyboardStyle, testID, ...props }: TextInputNumberProps) => React.JSX.Element>;
29
30
  export default _default;
package/dist/index.esm.js CHANGED
@@ -1532,7 +1532,7 @@ var ViewCustom = forwardRef$1(function (_a, ref) {
1532
1532
  var View = React__default.memo(ViewCustom);
1533
1533
 
1534
1534
  var Switch = memo(function (_a) {
1535
- var testID = _a.testID, value = _a.value, disabled = _a.disabled, onValueChange = _a.onValueChange, _b = _a.size, size = _b === void 0 ? "normal" : _b;
1535
+ var testID = _a.testID, value = _a.value, disabled = _a.disabled, onValueChange = _a.onValueChange, _b = _a.size, size = _b === void 0 ? "normal" : _b, _c = _a.accessible, accessible = _c === void 0 ? true : _c, accessibilityLabel = _a.accessibilityLabel;
1536
1536
  var theme = useInternalTheme();
1537
1537
  var colors = theme.colors;
1538
1538
  var progress = useSharedValue(value ? 1 : 0);
@@ -1605,7 +1605,7 @@ var Switch = memo(function (_a) {
1605
1605
  }
1606
1606
  }, [size, colors]);
1607
1607
  return (React$3.createElement(View, { row: true },
1608
- React$3.createElement(TouchableOpacity, { testID: testID, activeOpacity: 1, onPress: handleSwitch, disabled: disabled, style: disabled ? { opacity: 0.6 } : {} },
1608
+ React$3.createElement(TouchableOpacity, { testID: testID, accessible: accessible, accessibilityRole: "switch", accessibilityState: { checked: !!value, disabled: !!disabled }, accessibilityLabel: accessibilityLabel || testID || "switch", activeOpacity: 1, onPress: handleSwitch, disabled: disabled, style: disabled ? { opacity: 0.6 } : {} },
1609
1609
  React$3.createElement(Animated.View, { style: [styles$j.vSegment, backgroundColor, getSizeSwitch()] },
1610
1610
  React$3.createElement(Animated.View, { style: [styles$j.animated, animatedStyle, getSizeCircle()] })))));
1611
1611
  });
@@ -5369,8 +5369,8 @@ var roundLayoutSize = function (size) {
5369
5369
  };
5370
5370
 
5371
5371
  var ScaleButton = function (_a) {
5372
- var children = _a.children; _a.style; var _b = _a.onPress, onPress = _b === void 0 ? function () { } : _b, rest = __rest(_a, ["children", "style", "onPress"]);
5373
- return (React__default.createElement(TouchableOpacity, __assign({}, rest, { onPress: onPress }), children));
5372
+ var children = _a.children; _a.style; var _b = _a.onPress, onPress = _b === void 0 ? function () { } : _b, _c = _a.accessible, accessible = _c === void 0 ? true : _c, _d = _a.accessibilityRole, accessibilityRole = _d === void 0 ? "button" : _d, rest = __rest(_a, ["children", "style", "onPress", "accessible", "accessibilityRole"]);
5373
+ return (React__default.createElement(TouchableOpacity, __assign({ accessible: accessible, accessibilityRole: accessibilityRole }, rest, { onPress: onPress }), children));
5374
5374
  };
5375
5375
  var ScaleButton$1 = React__default.memo(ScaleButton);
5376
5376
 
@@ -5415,7 +5415,7 @@ function formatShowInput$1(value, formatDecimal) {
5415
5415
  return result;
5416
5416
  }
5417
5417
  var TextInputNumber = function (_a) {
5418
- var style = _a.style, _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.label, label = _c === void 0 ? "" : _c, _d = _a.textError, textError = _d === void 0 ? "" : _d, left = _a.left, right = _a.right, onChangeText = _a.onChangeText, _e = _a.disabled, disabled = _e === void 0 ? false : _e; _a.theme; var _f = _a.prefix, prefix = _f === void 0 ? "" : _f, _g = _a.suffix, suffix = _g === void 0 ? "" : _g, _h = _a.clearButton, clearButton = _h === void 0 ? false : _h, _j = _a.maxValue, maxValue = _j === void 0 ? 999999999999 : _j, _k = _a.minValue, minValue = _k === void 0 ? 0 : _k, _l = _a.type, type = _l === void 0 ? "integer" : _l, _m = _a.formatDecimal, formatDecimal = _m === void 0 ? 3 : _m, _o = _a.required, required = _o === void 0 ? false : _o, labelStyle = _a.labelStyle, contentStyle = _a.contentStyle, textErrorStyle = _a.textErrorStyle, height = _a.height, _p = _a.keyboardStyle, keyboardStyle = _p === void 0 ? {} : _p, props = __rest(_a, ["style", "value", "label", "textError", "left", "right", "onChangeText", "disabled", "theme", "prefix", "suffix", "clearButton", "maxValue", "minValue", "type", "formatDecimal", "required", "labelStyle", "contentStyle", "textErrorStyle", "height", "keyboardStyle"]);
5418
+ var style = _a.style, _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.label, label = _c === void 0 ? "" : _c, _d = _a.textError, textError = _d === void 0 ? "" : _d, left = _a.left, right = _a.right, onChangeText = _a.onChangeText, _e = _a.disabled, disabled = _e === void 0 ? false : _e; _a.theme; var _f = _a.prefix, prefix = _f === void 0 ? "" : _f, _g = _a.suffix, suffix = _g === void 0 ? "" : _g, _h = _a.clearButton, clearButton = _h === void 0 ? false : _h, _j = _a.maxValue, maxValue = _j === void 0 ? 999999999999 : _j, _k = _a.minValue, minValue = _k === void 0 ? 0 : _k, _l = _a.type, type = _l === void 0 ? "integer" : _l, _m = _a.formatDecimal, formatDecimal = _m === void 0 ? 3 : _m, _o = _a.required, required = _o === void 0 ? false : _o, labelStyle = _a.labelStyle, contentStyle = _a.contentStyle, textErrorStyle = _a.textErrorStyle, height = _a.height, _p = _a.keyboardStyle, keyboardStyle = _p === void 0 ? {} : _p, testID = _a.testID, props = __rest(_a, ["style", "value", "label", "textError", "left", "right", "onChangeText", "disabled", "theme", "prefix", "suffix", "clearButton", "maxValue", "minValue", "type", "formatDecimal", "required", "labelStyle", "contentStyle", "textErrorStyle", "height", "keyboardStyle", "testID"]);
5419
5419
  var theme = useInternalTheme();
5420
5420
  var colors = theme.colors;
5421
5421
  var _q = useState(false), isShowModalKeyboard = _q[0], setIsShowModalKeyboard = _q[1];
@@ -5797,7 +5797,7 @@ var TextInputNumber = function (_a) {
5797
5797
  }, 300);
5798
5798
  };
5799
5799
  return (React__default.createElement(View, null,
5800
- React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onShowModalKeyboard }, props, { disabled: disabled || false }),
5800
+ React__default.createElement(ScaleButton$1, __assign({ testID: testID, activeOpacity: 0.8, onPress: onShowModalKeyboard }, props, { disabled: disabled || false }),
5801
5801
  React__default.createElement(View, { style: [
5802
5802
  styles$c.container,
5803
5803
  {
@@ -5882,42 +5882,43 @@ var TextInputNumber = function (_a) {
5882
5882
  React__default.createElement(View, { width: "100%", style: styles$c.valueRow },
5883
5883
  React__default.createElement(View, { style: styles$c.valueTextContainer },
5884
5884
  React__default.createElement(Text$1, { numberOfLines: 1, style: [styles$c.text30, styles$c.valueText] }, formatNumberInput$1(inputValue, formatDecimal) || "\u00A0")),
5885
- React__default.createElement(TouchableOpacity, { onPress: handleClear, style: styles$c.clearButton },
5885
+ React__default.createElement(TouchableOpacity, { testID: testID ? "".concat(testID, "_modal_btn_clear") : 'number_input_btn_clear', accessible: true, accessibilityRole: "button", accessibilityLabel: "X\u00F3a h\u1EBFt", onPress: handleClear, style: styles$c.clearButton },
5886
5886
  React__default.createElement(SvgIcon, { name: "IconClearText", width: 24, height: 24, color: colors.textSecondary }))),
5887
5887
  React__default.createElement(View, { style: styles$c.keyboardGrid }, [
5888
5888
  ["1", "2", "3"],
5889
5889
  ["4", "5", "6"],
5890
5890
  ["7", "8", "9"],
5891
5891
  [type === "integer" ? "000" : ".", "0", "del"],
5892
- ].map(function (row, rowIndex) { return (React__default.createElement(View, { key: rowIndex, style: styles$c.keyboardRow }, row.map(function (key) { return (React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, key: key, style: [
5893
- styles$c.keyButton,
5894
- key === "000" && is000Disabled && styles$c.disabledKey,
5895
- key === "0" && is0Disabled && styles$c.disabledKey,
5896
- key === "." &&
5897
- inputValue.includes(".") &&
5898
- styles$c.disabledKey,
5899
- ], onPress: function () { return handleKeyPress(key); }, disabled: (key === "000" && is000Disabled) ||
5900
- (key === "0" && is0Disabled) ||
5901
- (key === "." && inputValue.includes(".")) }, key === "del" ? (React__default.createElement(SvgIcon, { name: "IconDelNumber", width: 24, height: 24, color: colors.textSecondary })) : (React__default.createElement(Text$1, { style: [
5902
- styles$c.keyText,
5903
- styles$c.text22,
5904
- key === "000" &&
5905
- is000Disabled &&
5906
- styles$c.disabledKeyText,
5907
- key === "0" &&
5908
- is0Disabled &&
5909
- styles$c.disabledKeyText,
5910
- key === "." &&
5911
- inputValue.includes(".") &&
5912
- styles$c.disabledKeyText,
5913
- ] }, key)))); }))); })),
5892
+ ].map(function (row, rowIndex) { return (React__default.createElement(View, { key: rowIndex, style: styles$c.keyboardRow }, row.map(function (key) {
5893
+ var keyId = key === 'del' ? 'del' : key === '.' ? 'dot' : key;
5894
+ return (React__default.createElement(TouchableOpacity, { testID: testID ? "".concat(testID, "_modal_key_").concat(keyId) : "number_input_key_".concat(keyId), accessible: true, accessibilityRole: "button", accessibilityLabel: key === 'del' ? 'Xóa' : key, activeOpacity: 0.8, key: key, style: [
5895
+ styles$c.keyButton,
5896
+ key === "000" && is000Disabled && styles$c.disabledKey,
5897
+ key === "0" && is0Disabled && styles$c.disabledKey,
5898
+ key === "." &&
5899
+ inputValue.includes(".") &&
5900
+ styles$c.disabledKey,
5901
+ ], onPress: function () { return handleKeyPress(key); }, disabled: (key === "000" && is000Disabled) ||
5902
+ (key === "0" && is0Disabled) ||
5903
+ (key === "." && inputValue.includes(".")) }, key === "del" ? (React__default.createElement(SvgIcon, { name: "IconDelNumber", width: 24, height: 24, color: colors.textSecondary })) : (React__default.createElement(Text$1, { style: [
5904
+ styles$c.keyText,
5905
+ styles$c.text22,
5906
+ key === "000" &&
5907
+ is000Disabled &&
5908
+ styles$c.disabledKeyText,
5909
+ key === "0" && is0Disabled && styles$c.disabledKeyText,
5910
+ key === "." &&
5911
+ inputValue.includes(".") &&
5912
+ styles$c.disabledKeyText,
5913
+ ] }, key))));
5914
+ }))); })),
5914
5915
  React__default.createElement(View, { style: styles$c.actionRow },
5915
- React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, style: styles$c.actionButton, onPress: onCloseModalKeyboard },
5916
+ React__default.createElement(TouchableOpacity, { testID: testID ? "".concat(testID, "_modal_btn_close") : 'number_input_btn_close', accessible: true, accessibilityRole: "button", accessibilityLabel: "\u0110\u00F3ng", activeOpacity: 0.8, style: styles$c.actionButton, onPress: onCloseModalKeyboard },
5916
5917
  React__default.createElement(Text$1, { style: [styles$c.actionText, styles$c.text16] }, "\u0110\u00F3ng")),
5917
5918
  React__default.createElement(Spacer, { style: {
5918
5919
  height: "100%",
5919
5920
  }, width: 1, backgroundColor: colors.borderPrimaryDefault }),
5920
- React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, style: [styles$c.actionButton, !canSave && { opacity: 0.5 }], onPress: handleSave, disabled: !canSave },
5921
+ React__default.createElement(TouchableOpacity, { testID: testID ? "".concat(testID, "_modal_btn_save") : 'number_input_btn_save', accessible: true, accessibilityRole: "button", accessibilityLabel: "L\u01B0u", activeOpacity: 0.8, style: [styles$c.actionButton, !canSave && { opacity: 0.5 }], onPress: handleSave, disabled: !canSave },
5921
5922
  React__default.createElement(Text$1, { style: [
5922
5923
  styles$c.actionText,
5923
5924
  styles$c.text16,
@@ -6263,7 +6264,7 @@ var TextInput = forwardRef(function (_a, ref) {
6263
6264
  TextInput.Affix = TextInputAffix;
6264
6265
 
6265
6266
  var Button = function (_a) {
6266
- var style = _a.style, title = _a.title; _a.border; var borderColor = _a.borderColor, isLoading = _a.isLoading, left = _a.left, right = _a.right, margin = _a.margin, textStyle = _a.textStyle, textProps = _a.textProps, onPress = _a.onPress, disabled = _a.disabled, backgroundColor = _a.backgroundColor, textColor = _a.textColor, _b = _a.textBold, textBold = _b === void 0 ? true : _b, _c = _a.mode, mode = _c === void 0 ? 'contained' : _c; _a.transparent; var _e = _a.full, full = _e === void 0 ? false : _e; _a.theme; var _f = _a.buttonSize, buttonSize = _f === void 0 ? 'normal' : _f, _g = _a.textSize, textSize = _g === void 0 ? buttonSize === 'small' ? 14 : 16 : _g, _h = _a.critical, critical = _h === void 0 ? false : _h, width = _a.width, _j = _a.type, type = _j === void 0 ? 'default' : _j, props = __rest(_a, ["style", "title", "border", "borderColor", "isLoading", "left", "right", "margin", "textStyle", "textProps", "onPress", "disabled", "backgroundColor", "textColor", "textBold", "mode", "transparent", "full", "theme", "buttonSize", "textSize", "critical", "width", "type"]);
6267
+ var style = _a.style, title = _a.title; _a.border; var borderColor = _a.borderColor, isLoading = _a.isLoading, left = _a.left, right = _a.right, margin = _a.margin, textStyle = _a.textStyle, textProps = _a.textProps, onPress = _a.onPress, disabled = _a.disabled, backgroundColor = _a.backgroundColor, textColor = _a.textColor, _b = _a.textBold, textBold = _b === void 0 ? true : _b, _c = _a.mode, mode = _c === void 0 ? 'contained' : _c; _a.transparent; var _e = _a.full, full = _e === void 0 ? false : _e; _a.theme; var _f = _a.buttonSize, buttonSize = _f === void 0 ? 'normal' : _f, _g = _a.textSize, textSize = _g === void 0 ? buttonSize === 'small' ? 14 : 16 : _g, _h = _a.critical, critical = _h === void 0 ? false : _h, width = _a.width, _j = _a.type, type = _j === void 0 ? 'default' : _j, testID = _a.testID, accessibilityLabel = _a.accessibilityLabel, props = __rest(_a, ["style", "title", "border", "borderColor", "isLoading", "left", "right", "margin", "textStyle", "textProps", "onPress", "disabled", "backgroundColor", "textColor", "textBold", "mode", "transparent", "full", "theme", "buttonSize", "textSize", "critical", "width", "type", "testID", "accessibilityLabel"]);
6267
6268
  var theme = useInternalTheme();
6268
6269
  var colors = theme.colors;
6269
6270
  var disabledTextStyle = {
@@ -6333,7 +6334,7 @@ var Button = function (_a) {
6333
6334
  }
6334
6335
  };
6335
6336
  if (type === 'text') {
6336
- return (React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading }),
6337
+ return (React__default.createElement(ScaleButton$1, __assign({ testID: testID, accessibilityLabel: accessibilityLabel || title || testID, activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading }),
6337
6338
  React__default.createElement(View, { width: width, margin: margin, style: [
6338
6339
  {
6339
6340
  height: CONSTANTS.BUTTON_HEIGHT,
@@ -6360,7 +6361,7 @@ var Button = function (_a) {
6360
6361
  !isLoading && right)))));
6361
6362
  }
6362
6363
  return (React__default.createElement(View, { row: !full },
6363
- React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading }),
6364
+ React__default.createElement(ScaleButton$1, __assign({ testID: testID, accessibilityLabel: accessibilityLabel || title || testID, activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading }),
6364
6365
  React__default.createElement(View, { width: width, margin: margin, style: [
6365
6366
  styles$b.button,
6366
6367
  {
@@ -6415,10 +6416,11 @@ var styles$b = StyleSheet.create(__assign(__assign({}, containerStyles), { disab
6415
6416
  var index$3 = React__default.memo(Button);
6416
6417
 
6417
6418
  var FloatingButton = function (_a) {
6418
- var isLoading = _a.isLoading, disabled = _a.disabled, onPress = _a.onPress, style = _a.style, _b = _a.hiddenBackground, hiddenBackground = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? BUTTON_HEIGHT : _c, children = _a.children, backgroundColor = _a.backgroundColor, props = _a.props, _d = _a.top, top = _d === void 0 ? 0 : _d, _e = _a.right, right = _e === void 0 ? 0 : _e, _f = _a.left, left = _f === void 0 ? 0 : _f, _g = _a.bottom, bottom = _g === void 0 ? 0 : _g, testID = _a.testID;
6419
+ var isLoading = _a.isLoading, disabled = _a.disabled, onPress = _a.onPress, style = _a.style, _b = _a.hiddenBackground, hiddenBackground = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? BUTTON_HEIGHT : _c, children = _a.children, backgroundColor = _a.backgroundColor, props = _a.props, _d = _a.top, top = _d === void 0 ? 0 : _d, _e = _a.right, right = _e === void 0 ? 0 : _e, _f = _a.left, left = _f === void 0 ? 0 : _f, _g = _a.bottom, bottom = _g === void 0 ? 0 : _g, testID = _a.testID, _h = _a.accessible, accessible = _h === void 0 ? true : _h, accessibilityLabel = _a.accessibilityLabel;
6419
6420
  var colors = useInternalTheme().colors;
6420
- return (React__default.createElement(TouchableOpacity, __assign({ testID: testID, activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading, style: [
6421
+ return (React__default.createElement(TouchableOpacity, __assign({ testID: testID, accessible: accessible, accessibilityRole: "button", accessibilityLabel: accessibilityLabel || testID || "floating-button", activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading, style: [
6421
6422
  styles$a.btn,
6423
+ { width: size, height: size },
6422
6424
  top > 0 && { top: top },
6423
6425
  right > 0 && { right: right },
6424
6426
  left > 0 && { left: left },
@@ -7032,7 +7034,7 @@ var styles$7 = StyleSheet.create(__assign(__assign({}, containerStyles), { conta
7032
7034
  } }));
7033
7035
 
7034
7036
  var ChipBar = function (_a) {
7035
- var testID = _a.testID, style = _a.style, _b = _a.borderRadius, borderRadius = _b === void 0 ? CONSTANTS.BORDER_RADIUS_ROUNDED : _b, _c = _a.title, title = _c === void 0 ? "content" : _c, textStyle = _a.textStyle, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _e = _a.badge, badge = _e === void 0 ? 0 : _e, _f = _a.checked, checked = _f === void 0 ? false : _f, _g = _a.ellipsizeMode, ellipsizeMode = _g === void 0 ? "tail" : _g, _h = _a.numberOfLines, numberOfLines = _h === void 0 ? 1 : _h;
7037
+ var testID = _a.testID, style = _a.style, _b = _a.borderRadius, borderRadius = _b === void 0 ? CONSTANTS.BORDER_RADIUS_ROUNDED : _b, _c = _a.title, title = _c === void 0 ? "content" : _c, textStyle = _a.textStyle, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _e = _a.badge, badge = _e === void 0 ? 0 : _e, _f = _a.checked, checked = _f === void 0 ? false : _f, _g = _a.ellipsizeMode, ellipsizeMode = _g === void 0 ? "tail" : _g, _h = _a.numberOfLines, numberOfLines = _h === void 0 ? 1 : _h, _j = _a.accessible, accessible = _j === void 0 ? true : _j, accessibilityLabel = _a.accessibilityLabel;
7036
7038
  var theme = useInternalTheme();
7037
7039
  var colors = theme.colors;
7038
7040
  var handlePressChipBar = function () {
@@ -7040,8 +7042,8 @@ var ChipBar = function (_a) {
7040
7042
  onPress === null || onPress === void 0 ? void 0 : onPress(!checked);
7041
7043
  }
7042
7044
  };
7043
- return (React__default.createElement(View, { testID: testID, row: true },
7044
- React__default.createElement(View, { row: true, disabled: disabled, paddingHorizontal: CONSTANTS.SPACE_12, paddingVertical: CONSTANTS.SPACE_8, borderRadius: borderRadius, borderWidth: 1, alignCenter: true, style: [
7045
+ return (React__default.createElement(View, { row: true },
7046
+ React__default.createElement(View, { testID: testID, accessible: accessible, accessibilityRole: "button", accessibilityLabel: accessibilityLabel || title || testID, accessibilityState: { checked: checked, disabled: disabled }, row: true, disabled: disabled, paddingHorizontal: CONSTANTS.SPACE_12, paddingVertical: CONSTANTS.SPACE_8, borderRadius: borderRadius, borderWidth: 1, alignCenter: true, style: [
7045
7047
  disabled && {
7046
7048
  backgroundColor: colors.surfaceSecondaryDefault,
7047
7049
  borderColor: colors.surfaceSecondaryDefault,
@@ -7085,10 +7087,10 @@ var useCheckboxColor = function (isActive, disabled) {
7085
7087
  }, [isActive, disabled, colors]);
7086
7088
  };
7087
7089
  var Checkbox = function (_a) {
7088
- var testID = _a.testID, style = _a.style, _b = _a.content, content = _b === void 0 ? "content" : _b, textStyle = _a.textStyle, onPress = _a.onPress, _c = _a.disabled, disabled = _c === void 0 ? false : _c, leftIcon = _a.leftIcon, _d = _a.checked, checked = _d === void 0 ? false : _d, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e;
7090
+ var testID = _a.testID, style = _a.style, _b = _a.content, content = _b === void 0 ? "content" : _b, textStyle = _a.textStyle, onPress = _a.onPress, _c = _a.disabled, disabled = _c === void 0 ? false : _c, leftIcon = _a.leftIcon, _d = _a.checked, checked = _d === void 0 ? false : _d, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e, _f = _a.accessible, accessible = _f === void 0 ? true : _f, accessibilityLabel = _a.accessibilityLabel;
7089
7091
  var theme = useInternalTheme();
7090
7092
  var colors = theme.colors;
7091
- var _f = useState(checked), isActive = _f[0], setActive = _f[1];
7093
+ var _g = useState(checked), isActive = _g[0], setActive = _g[1];
7092
7094
  var checkboxColor = useCheckboxColor(isActive, disabled);
7093
7095
  var checkboxIconName = "IconCheckbox";
7094
7096
  if (isActive === "indeterminate") {
@@ -7103,7 +7105,7 @@ var Checkbox = function (_a) {
7103
7105
  useEffect(function () {
7104
7106
  setActive(checked);
7105
7107
  }, [checked]);
7106
- return (React__default.createElement(View, { testID: testID, row: true, disabled: disabled, alignCenter: true, style: [style], onPress: handlePress },
7108
+ return (React__default.createElement(View, { testID: testID, accessible: accessible, accessibilityRole: "checkbox", accessibilityState: { checked: isActive, disabled: disabled }, accessibilityLabel: accessibilityLabel || content || testID, row: true, disabled: disabled, alignCenter: true, style: [style], onPress: handlePress },
7107
7109
  leftIcon ? (React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_8 }, leftIcon)) : (React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_8 },
7108
7110
  React__default.createElement(SvgIcon, { name: checkboxIconName, width: iconSize, height: iconSize, color: checkboxColor }))),
7109
7111
  React__default.createElement(View, { full: true },
@@ -7118,7 +7120,7 @@ var Checkbox = function (_a) {
7118
7120
  var styles$5 = StyleSheet.create(__assign({}, containerStyles));
7119
7121
 
7120
7122
  var RadioButton = function (_a) {
7121
- var testID = _a.testID, style = _a.style, _b = _a.content, content = _b === void 0 ? "content" : _b, textStyle = _a.textStyle, onPress = _a.onPress, _c = _a.disabled, disabled = _c === void 0 ? false : _c, leftIcon = _a.leftIcon, _d = _a.checked, checked = _d === void 0 ? false : _d;
7123
+ var testID = _a.testID, style = _a.style, _b = _a.content, content = _b === void 0 ? "content" : _b, textStyle = _a.textStyle, onPress = _a.onPress, _c = _a.disabled, disabled = _c === void 0 ? false : _c, leftIcon = _a.leftIcon, _d = _a.checked, checked = _d === void 0 ? false : _d, _e = _a.accessible, accessible = _e === void 0 ? true : _e, accessibilityLabel = _a.accessibilityLabel;
7122
7124
  var theme = useInternalTheme();
7123
7125
  var colors = theme.colors;
7124
7126
  var handlePress = useCallback(function () {
@@ -7133,7 +7135,7 @@ var RadioButton = function (_a) {
7133
7135
  }
7134
7136
  return colors.surfacePrimaryDefault;
7135
7137
  }, [checked, disabled]);
7136
- return (React__default.createElement(View, { testID: testID, row: true, disabled: disabled, alignCenter: true, style: [style], onPress: handlePress },
7138
+ return (React__default.createElement(View, { testID: testID, accessible: accessible, accessibilityRole: "radio", accessibilityState: { checked: checked, disabled: disabled }, accessibilityLabel: accessibilityLabel || content || testID, row: true, disabled: disabled, alignCenter: true, style: [style], onPress: handlePress },
7137
7139
  leftIcon ? (React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_8 }, leftIcon)) : (React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_8 },
7138
7140
  React__default.createElement(SvgIcon, { name: checked ? "IconRadioActive" : "IconRadio", width: 24, height: 24, color: getColorCheckbox }))),
7139
7141
  React__default.createElement(View, { full: true },
@@ -7197,7 +7199,7 @@ var styles$3 = StyleSheet.create({
7197
7199
  });
7198
7200
 
7199
7201
  var SelectionField = function (_a) {
7200
- var style = _a.style, _b = _a.content, content = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.error, error = _d === void 0 ? '' : _d, borderColor = _a.borderColor; _a.left; var right = _a.right, textStyle = _a.textStyle, labelStyle = _a.labelStyle, textProps = _a.textProps, onPress = _a.onPress, _e = _a.disabled, disabled = _e === void 0 ? false : _e, textColor = _a.textColor, labelColor = _a.labelColor; _a.theme; var _f = _a.required, required = _f === void 0 ? false : _f, _g = _a.height, height = _g === void 0 ? 48 : _g, testID = _a.testID, props = __rest(_a, ["style", "content", "label", "error", "borderColor", "left", "right", "textStyle", "labelStyle", "textProps", "onPress", "disabled", "textColor", "labelColor", "theme", "required", "height", "testID"]);
7202
+ var style = _a.style, _b = _a.content, content = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.error, error = _d === void 0 ? '' : _d, borderColor = _a.borderColor; _a.left; var right = _a.right, textStyle = _a.textStyle, labelStyle = _a.labelStyle, textProps = _a.textProps, onPress = _a.onPress, _e = _a.disabled, disabled = _e === void 0 ? false : _e, textColor = _a.textColor, labelColor = _a.labelColor; _a.theme; var _f = _a.required, required = _f === void 0 ? false : _f, _g = _a.height, height = _g === void 0 ? 48 : _g, testID = _a.testID, _h = _a.accessible, accessible = _h === void 0 ? true : _h, accessibilityLabel = _a.accessibilityLabel, props = __rest(_a, ["style", "content", "label", "error", "borderColor", "left", "right", "textStyle", "labelStyle", "textProps", "onPress", "disabled", "textColor", "labelColor", "theme", "required", "height", "testID", "accessible", "accessibilityLabel"]);
7201
7203
  var theme = useInternalTheme();
7202
7204
  var colors = theme.colors;
7203
7205
  var disabledTextStyle = {
@@ -7213,8 +7215,8 @@ var SelectionField = function (_a) {
7213
7215
  }
7214
7216
  return textColor || colors.textDefault;
7215
7217
  };
7216
- return (React__default.createElement(View, { testID: testID },
7217
- React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
7218
+ return (React__default.createElement(View, null,
7219
+ React__default.createElement(ScaleButton$1, __assign({ testID: testID, accessible: accessible, accessibilityRole: "button", accessibilityLabel: accessibilityLabel || label || (content === null || content === void 0 ? void 0 : content.toString()) || testID, activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
7218
7220
  React__default.createElement(View, { style: [
7219
7221
  styles$2.container,
7220
7222
  {
@@ -7369,7 +7371,7 @@ var formatShowInput = function (value, formatDecimal) {
7369
7371
  return result;
7370
7372
  };
7371
7373
  var NumberKeyboard = function (_a) {
7372
- var _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.label, label = _c === void 0 ? "" : _c, onChangeText = _a.onChangeText, _d = _a.maxValue, maxValue = _d === void 0 ? 999999999999 : _d, _e = _a.minValue, minValue = _e === void 0 ? 0 : _e, _f = _a.type, type = _f === void 0 ? "integer" : _f, _g = _a.formatDecimal, formatDecimal = _g === void 0 ? 3 : _g, visible = _a.visible, onClose = _a.onClose, keyboardStyle = _a.keyboardStyle;
7374
+ var _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.label, label = _c === void 0 ? "" : _c, onChangeText = _a.onChangeText, _d = _a.maxValue, maxValue = _d === void 0 ? 999999999999 : _d, _e = _a.minValue, minValue = _e === void 0 ? 0 : _e, _f = _a.type, type = _f === void 0 ? "integer" : _f, _g = _a.formatDecimal, formatDecimal = _g === void 0 ? 3 : _g, visible = _a.visible, onClose = _a.onClose, keyboardStyle = _a.keyboardStyle, testID = _a.testID;
7373
7375
  var theme = useInternalTheme();
7374
7376
  var colors = theme.colors;
7375
7377
  var _h = useState((value === null || value === void 0 ? void 0 : value.toString()) || ""), inputValue = _h[0], setInputValue = _h[1];
@@ -7651,45 +7653,47 @@ var NumberKeyboard = function (_a) {
7651
7653
  }, 300);
7652
7654
  }, [onClose, value]);
7653
7655
  return (React__default.createElement(Modal, { visible: visible, transparent: true, animationType: "fade", statusBarTranslucent: true, onRequestClose: handleClose },
7654
- React__default.createElement(View, { style: styles.modalOverlay },
7655
- React__default.createElement(TouchableOpacity, { style: styles.modalBackdrop, activeOpacity: 1, onPress: handleClose }),
7656
- React__default.createElement(View, { backgroundColor: colors.surfacePrimaryDefault, style: [styles.modalContent, keyboardStyle] },
7656
+ React__default.createElement(TouchableOpacity, { style: styles.modalOverlay, activeOpacity: 1, onPress: handleClose },
7657
+ React__default.createElement(View, { onPress: function () { }, activeOpacity: 1, backgroundColor: colors.surfacePrimaryDefault, style: [styles.modalContent, keyboardStyle] },
7657
7658
  React__default.createElement(Text$1, { style: [styles.text18, styles.modalTitle] }, label),
7658
7659
  React__default.createElement(View, { width: "100%", style: styles.valueRow },
7659
7660
  React__default.createElement(View, { style: styles.valueTextContainer },
7660
7661
  React__default.createElement(Text$1, { numberOfLines: 1, style: [styles.text30, styles.valueText] }, formatNumberInput(inputValue, formatDecimal) || "\u00A0")),
7661
- React__default.createElement(TouchableOpacity, { onPress: handleClear, style: styles.clearButton },
7662
+ React__default.createElement(TouchableOpacity, { testID: testID ? "".concat(testID, "_btn_clear") : 'keyboard_btn_clear', accessible: true, accessibilityRole: "button", accessibilityLabel: "X\u00F3a h\u1EBFt", onPress: handleClear, style: styles.clearButton },
7662
7663
  React__default.createElement(SvgIcon, { name: "IconClearText", width: 24, height: 24, color: colors.textSecondary }))),
7663
7664
  React__default.createElement(View, { style: styles.keyboardGrid }, [
7664
7665
  ["1", "2", "3"],
7665
7666
  ["4", "5", "6"],
7666
7667
  ["7", "8", "9"],
7667
7668
  [type === "integer" ? "000" : ".", "0", "del"],
7668
- ].map(function (row, rowIndex) { return (React__default.createElement(View, { key: rowIndex, style: styles.keyboardRow }, row.map(function (key) { return (React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, key: key, style: [
7669
- styles.keyButton,
7670
- key === "000" && is000Disabled && styles.disabledKey,
7671
- key === "0" && is0Disabled && styles.disabledKey,
7672
- key === "." &&
7673
- inputValue.includes(".") &&
7674
- styles.disabledKey,
7675
- ], onPress: function () { return handleKeyPress(key); }, disabled: (key === "000" && is000Disabled) ||
7676
- (key === "0" && is0Disabled) ||
7677
- (key === "." && inputValue.includes(".")) }, key === "del" ? (React__default.createElement(SvgIcon, { name: "IconDelNumber", width: 24, height: 24, color: colors.textSecondary })) : (React__default.createElement(Text$1, { style: [
7678
- styles.keyText,
7679
- styles.text22,
7680
- key === "000" &&
7681
- is000Disabled &&
7682
- styles.disabledKeyText,
7683
- key === "0" && is0Disabled && styles.disabledKeyText,
7684
- key === "." &&
7685
- inputValue.includes(".") &&
7686
- styles.disabledKeyText,
7687
- ] }, key)))); }))); })),
7669
+ ].map(function (row, rowIndex) { return (React__default.createElement(View, { key: rowIndex, style: styles.keyboardRow }, row.map(function (key) {
7670
+ var keyId = key === 'del' ? 'del' : key === '.' ? 'dot' : key;
7671
+ return (React__default.createElement(TouchableOpacity, { testID: testID ? "".concat(testID, "_key_").concat(keyId) : "keyboard_key_".concat(keyId), accessible: true, accessibilityRole: "button", accessibilityLabel: key === 'del' ? 'Xóa' : key, activeOpacity: 0.8, key: key, style: [
7672
+ styles.keyButton,
7673
+ key === "000" && is000Disabled && styles.disabledKey,
7674
+ key === "0" && is0Disabled && styles.disabledKey,
7675
+ key === "." &&
7676
+ inputValue.includes(".") &&
7677
+ styles.disabledKey,
7678
+ ], onPress: function () { return handleKeyPress(key); }, disabled: (key === "000" && is000Disabled) ||
7679
+ (key === "0" && is0Disabled) ||
7680
+ (key === "." && inputValue.includes(".")) }, key === "del" ? (React__default.createElement(SvgIcon, { name: "IconDelNumber", width: 24, height: 24, color: colors.textSecondary })) : (React__default.createElement(Text$1, { style: [
7681
+ styles.keyText,
7682
+ styles.text22,
7683
+ key === "000" &&
7684
+ is000Disabled &&
7685
+ styles.disabledKeyText,
7686
+ key === "0" && is0Disabled && styles.disabledKeyText,
7687
+ key === "." &&
7688
+ inputValue.includes(".") &&
7689
+ styles.disabledKeyText,
7690
+ ] }, key))));
7691
+ }))); })),
7688
7692
  React__default.createElement(View, { style: styles.actionRow },
7689
- React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, style: styles.actionButton, onPress: handleClose },
7693
+ React__default.createElement(TouchableOpacity, { testID: testID ? "".concat(testID, "_btn_close") : 'keyboard_btn_close', accessible: true, accessibilityRole: "button", accessibilityLabel: "\u0110\u00F3ng", activeOpacity: 0.8, style: styles.actionButton, onPress: handleClose },
7690
7694
  React__default.createElement(Text$1, { style: [styles.actionText, styles.text16] }, "\u0110\u00F3ng")),
7691
7695
  React__default.createElement(Spacer, { style: { height: "100%" }, width: 1, backgroundColor: colors.borderPrimaryDefault }),
7692
- React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, style: [styles.actionButton, !canSave && { opacity: 0.5 }], onPress: handleSave, disabled: !canSave },
7696
+ React__default.createElement(TouchableOpacity, { testID: testID ? "".concat(testID, "_btn_save") : 'keyboard_btn_save', accessible: true, accessibilityRole: "button", accessibilityLabel: "L\u01B0u", activeOpacity: 0.8, style: [styles.actionButton, !canSave && { opacity: 0.5 }], onPress: handleSave, disabled: !canSave },
7693
7697
  React__default.createElement(Text$1, { style: [
7694
7698
  styles.actionText,
7695
7699
  styles.text16,
@@ -7699,11 +7703,10 @@ var NumberKeyboard = function (_a) {
7699
7703
  };
7700
7704
  var styles = StyleSheet.create(__assign(__assign({}, containerStyles), { modalOverlay: {
7701
7705
  flex: 1,
7702
- width: "100%",
7703
- height: "100%",
7706
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
7704
7707
  justifyContent: "center",
7705
7708
  alignItems: "center",
7706
- }, modalBackdrop: __assign(__assign({}, StyleSheet.absoluteFillObject), { backgroundColor: "rgba(0, 0, 0, 0.5)" }), modalContent: {
7709
+ }, modalContent: {
7707
7710
  borderRadius: 20,
7708
7711
  width: "90%",
7709
7712
  paddingBottom: 20,