sapo-components-ui-rn 1.1.21 → 1.1.23

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 (45) hide show
  1. package/dist/assets/icon-arrow-down.svg +3 -0
  2. package/dist/assets/icon-clear-text.svg +4 -0
  3. package/dist/assets/icon-del-number.svg +4 -0
  4. package/dist/assets/icon-error.svg +3 -0
  5. package/dist/assets/icon-info.svg +3 -0
  6. package/dist/assets/icon-search.svg +10 -0
  7. package/dist/assets/icon-success.svg +3 -0
  8. package/dist/assets/icon-warning.svg +3 -0
  9. package/dist/assets/index.ts +16 -0
  10. package/dist/assets/svg/icon-arrow-down.svg +3 -0
  11. package/dist/assets/svg/icon-clear-text.svg +4 -0
  12. package/dist/assets/svg/icon-del-number.svg +4 -0
  13. package/dist/assets/svg/icon-error.svg +3 -0
  14. package/dist/assets/svg/icon-info.svg +3 -0
  15. package/dist/assets/svg/icon-search.svg +10 -0
  16. package/dist/assets/svg/icon-success.svg +3 -0
  17. package/dist/assets/svg/icon-warning.svg +3 -0
  18. package/dist/assets/svg/index.d.ts +8 -0
  19. package/dist/assets/svg/index.ts +16 -0
  20. package/dist/components/IconSvg/index.d.ts +2 -1
  21. package/dist/index.esm.js +39 -133
  22. package/dist/index.esm.js.map +1 -1
  23. package/dist/index.js +47 -134
  24. package/dist/index.js.map +1 -1
  25. package/package.json +1 -1
  26. package/src/assets/svg/icon-arrow-down.svg +3 -0
  27. package/src/assets/svg/icon-clear-text.svg +4 -0
  28. package/src/assets/svg/icon-del-number.svg +4 -0
  29. package/src/assets/svg/icon-error.svg +3 -0
  30. package/src/assets/svg/icon-info.svg +3 -0
  31. package/src/assets/svg/icon-search.svg +10 -0
  32. package/src/assets/svg/icon-success.svg +3 -0
  33. package/src/assets/svg/icon-warning.svg +3 -0
  34. package/src/assets/svg/index.ts +16 -0
  35. package/src/components/Checkbox/index.tsx +4 -3
  36. package/src/components/IconSvg/index.tsx +1 -1
  37. package/src/components/NumberKeyboard/index.tsx +4 -3
  38. package/src/components/RadioButton/index.tsx +6 -11
  39. package/src/components/SearchInput/index.tsx +3 -2
  40. package/src/components/SelectionField/index.tsx +2 -2
  41. package/src/components/Tag/index.tsx +5 -4
  42. package/src/components/TextInput/TextInputDefault.tsx +2 -2
  43. package/src/components/TextInput/TextInputFlat.tsx +2 -2
  44. package/src/components/TextInput/TextInputNumber.tsx +11 -5
  45. package/src/components/Toast/index.tsx +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sapo-components-ui-rn",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "React Native UI Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M18.0107 9.70166L12 15.7124L5.98926 9.70166L7.40332 8.2876L12 12.8843L16.5967 8.2876L18.0107 9.70166Z" fill="#A3A8AF"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12 3.66699C16.6024 3.66699 20.333 7.39763 20.333 12C20.333 16.6024 16.6024 20.333 12 20.333C7.39763 20.333 3.66699 16.6024 3.66699 12C3.66699 7.39763 7.39763 3.66699 12 3.66699Z" fill="white"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.66669 12C3.66669 7.39167 7.39169 3.66667 12 3.66667C16.6084 3.66667 20.3334 7.39167 20.3334 12C20.3334 16.6083 16.6084 20.3333 12 20.3333C7.39169 20.3333 3.66669 16.6083 3.66669 12ZM12 10.825L14.1584 8.66667L15.3334 9.84167L13.175 12L15.3334 14.1583L14.1584 15.3333L12 13.175L9.84169 15.3333L8.66669 14.1583L10.825 12L8.66669 9.84167L9.84169 8.66667L12 10.825Z" fill="#A3A8AF"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="20" viewBox="0 0 28 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M25.0455 0H11.4154C10.7939 0.000239015 10.1952 0.240624 9.7409 0.6725L0.889895 9.08617C0.641199 9.32258 0.5 9.65352 0.5 10C0.5 10.3465 0.641199 10.6774 0.889895 10.9138L9.74099 19.3276C10.1953 19.7595 10.7939 19.9998 11.4154 20H25.0455C25.6964 20 26.3208 19.7366 26.7811 19.2678C27.2414 18.7989 27.5 18.163 27.5 17.5V2.5C27.5 1.83696 27.2414 1.20108 26.7811 0.732233C26.3208 0.263392 25.6964 0 25.0455 0Z" fill="#A3A8AF"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13.7085 5.9531C14.1026 5.56618 14.7357 5.57199 15.1227 5.96608L17.6818 8.57263L20.241 5.96608C20.6279 5.57199 21.261 5.56618 21.6551 5.9531C22.0492 6.34003 22.055 6.97317 21.6681 7.36726L19.0832 10L21.6681 12.6327C22.055 13.0268 22.0492 13.66 21.6551 14.0469C21.261 14.4338 20.6279 14.428 20.241 14.0339L17.6818 11.4274L15.1227 14.0339C14.7357 14.428 14.1026 14.4338 13.7085 14.0469C13.3144 13.66 13.3086 13.0268 13.6955 12.6327L16.2804 10L13.6955 7.36726C13.3086 6.97317 13.3144 6.34003 13.7085 5.9531Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.99219 2.5004C14.1397 2.5004 17.5 5.8604 17.5 10.0004C17.4998 14.1402 14.1396 17.5004 9.99219 17.5004C5.85247 17.5002 2.50022 14.1401 2.5 10.0004C2.5 5.8605 5.85233 2.50057 9.99219 2.5004ZM10 4.0004C6.685 4.0004 4 6.6854 4 10.0004C4.00022 13.3152 6.68514 16.0004 10 16.0004C13.3149 16.0004 15.9998 13.3152 16 10.0004C16 6.6854 13.315 4.0004 10 4.0004ZM10.75 12.2504V13.7504H9.25V12.2504H10.75ZM10.75 6.2504V10.7504H9.25V6.2504H10.75Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10 2.5004C14.1667 2.5004 17.5 5.83374 17.5 10.0004C17.4998 14.1669 14.1665 17.5004 10 17.5004C5.83347 17.5004 2.50022 14.1669 2.5 10.0004C2.5 5.83374 5.83333 2.5004 10 2.5004ZM10 4.0004C6.66667 4.0004 4 6.66707 4 10.0004C4.00022 13.3335 6.6668 16.0004 10 16.0004C13.3332 16.0004 15.9998 13.3335 16 10.0004C16 6.66707 13.3333 4.0004 10 4.0004ZM10.75 12.2504H11.5V13.7504H9.25V10.7504H8.5V9.2504H10.75V12.2504ZM10.75 7.7504H9.25V6.2504H10.75V7.7504Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_155_9023)">
3
+ <path d="M19.7 18.3L15.5 14.1C15.3 13.9 15 13.8 14.7 13.8C15.5 12.8 16 11.4 16 10C16 6.7 13.3 4 10 4C6.7 4 4 6.7 4 10C4 13.3 6.7 16 10 16C11.4 16 12.8 15.5 13.8 14.6C13.8 14.9 13.8 15.2 14.1 15.4L18.3 19.6C18.5 19.8 18.8 19.9 19 19.9C19.2 19.9 19.5 19.8 19.7 19.6C20.1 19.3 20.1 18.7 19.7 18.3ZM10 14.5C7.5 14.5 5.5 12.5 5.5 10C5.5 7.5 7.5 5.5 10 5.5C12.5 5.5 14.5 7.5 14.5 10C14.5 12.5 12.5 14.5 10 14.5Z" fill="#A3A8AF"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_155_9023">
7
+ <rect width="16" height="16" fill="white" transform="translate(4 4)"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10 2.50041C14.1421 2.50041 17.5 5.85828 17.5 10.0004C17.4998 14.1424 14.142 17.5004 10 17.5004C5.858 17.5004 2.50022 14.1424 2.5 10.0004C2.5 5.85828 5.85786 2.50041 10 2.50041ZM10 3.86369C6.61098 3.86369 3.86328 6.61139 3.86328 10.0004C3.8635 13.3892 6.61112 16.1362 10 16.1362C13.3889 16.1362 16.1365 13.3892 16.1367 10.0004C16.1367 6.61139 13.389 3.86369 10 3.86369ZM13.9053 8.01506L8.875 13.0453L6.09473 10.2651L7.15527 9.20451L8.875 10.9242L12.8447 6.95451L13.9053 8.01506Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.27915 2.9137C9.60027 2.35977 10.4006 2.35955 10.7215 2.9137L18.4422 16.2506C18.7638 16.8061 18.3633 17.5014 17.7215 17.5016H2.27915C1.63721 17.5016 1.23583 16.8062 1.55747 16.2506L9.27915 2.9137ZM3.72446 15.8346H16.2762L9.99985 4.99475L3.72446 15.8346ZM10.8329 14.9996H9.16685V13.3336H10.8329V14.9996ZM10.8329 12.4996H9.16685V8.33362H10.8329V12.4996Z" fill="white"/>
3
+ </svg>
@@ -3,6 +3,14 @@ import IconCheckbox from "./icon-checkbox.svg";
3
3
  import IconCheckboxActive from "./icon-checkbox-active.svg";
4
4
  import IconRadio from "./icon-radio.svg";
5
5
  import IconRadioActive from "./icon-radio-active.svg";
6
+ import IconSearch from "./icons/IconSearch.svg";
7
+ import IconInfo from "./icons/IconInfo.svg";
8
+ import IconSuccess from "./icons/IconSuccess.svg";
9
+ import IconWarning from "./icons/IconWarning.svg";
10
+ import IconArrowDown from "./icons/IconArrowDown.svg";
11
+ import IconError from "./icons/IconError.svg";
12
+ import IconClearText from "./icons/IconClearText.svg";
13
+ import IconDelNumber from './icon-del-number.svg'
6
14
 
7
15
  export const Svg = {
8
16
  IconClose,
@@ -10,4 +18,12 @@ export const Svg = {
10
18
  IconCheckboxActive,
11
19
  IconRadio,
12
20
  IconRadioActive,
21
+ IconSearch,
22
+ IconInfo,
23
+ IconSuccess,
24
+ IconWarning,
25
+ IconArrowDown,
26
+ IconError,
27
+ IconClearText,
28
+ IconDelNumber,
13
29
  };
@@ -5,8 +5,8 @@ import { CONSTANTS } from "../../styles/themes/tokens";
5
5
  import Text from "../Text";
6
6
  import { useInternalTheme } from "../../core/theming";
7
7
  import containerStyles from "../../theme/container-styles";
8
- import Icon from "../Icon";
9
8
 
9
+ import SvgIcon from "../IconSvg";
10
10
  interface CheckboxProps {
11
11
  style?: StyleProp<ViewStyle>;
12
12
  content: string;
@@ -68,9 +68,10 @@ const Checkbox = ({
68
68
  <View paddingRight={CONSTANTS.SPACE_8}>{leftIcon}</View>
69
69
  ) : (
70
70
  <View paddingRight={CONSTANTS.SPACE_8}>
71
- <Icon
71
+ <SvgIcon
72
72
  name={isActive ? "IconCheckboxActive" : "IconCheckbox"}
73
- size={iconSize}
73
+ width={iconSize}
74
+ height={iconSize}
74
75
  color={checkboxColor}
75
76
  />
76
77
  </View>
@@ -3,7 +3,7 @@ import React from "react";
3
3
  import { Svg } from "../../assets/svg";
4
4
 
5
5
  interface SvgIconProps {
6
- name: any;
6
+ name: keyof typeof Svg;
7
7
  width?: number;
8
8
  height?: number;
9
9
  color?: string;
@@ -9,8 +9,8 @@ import Text from "../Text";
9
9
  import View from "../View";
10
10
  import { useInternalTheme } from "../../core/theming";
11
11
  import Spacer from "../Spacer";
12
- import Icon from "../Icon";
13
12
  import containerStyles from "../../theme/container-styles";
13
+ import SvgIcon from "../IconSvg";
14
14
 
15
15
  export interface NumberKeyboardProps {
16
16
  /** Giá trị hiện tại của input */
@@ -215,9 +215,10 @@ const NumberKeyboard: React.FC<NumberKeyboardProps> = ({
215
215
  </Text>
216
216
  </View>
217
217
  <TouchableOpacity onPress={handleClear} style={styles.clearButton}>
218
- <Icon
218
+ <SvgIcon
219
219
  name="IconClearText"
220
- size={24}
220
+ width={24}
221
+ height={24}
221
222
  color={colors.textSecondary}
222
223
  />
223
224
  </TouchableOpacity>
@@ -1,11 +1,11 @@
1
- import React, { useState, useCallback, useMemo, useEffect } from "react";
1
+ import React, { useCallback, useMemo } from "react";
2
2
  import { StyleProp, ViewStyle, StyleSheet, TextStyle } from "react-native";
3
3
  import View from "../View";
4
4
  import { CONSTANTS } from "../../styles/themes/tokens";
5
5
  import Text from "../Text";
6
6
  import { useInternalTheme } from "../../core/theming";
7
7
  import containerStyles from "../../theme/container-styles";
8
- import Icon from "../Icon";
8
+ import SvgIcon from "../IconSvg";
9
9
 
10
10
  interface RadioButtonProps {
11
11
  style?: StyleProp<ViewStyle>;
@@ -55,15 +55,10 @@ const RadioButton = ({
55
55
  <View paddingRight={CONSTANTS.SPACE_8}>{leftIcon}</View>
56
56
  ) : (
57
57
  <View paddingRight={CONSTANTS.SPACE_8}>
58
- <Icon
59
- name={
60
- disabled
61
- ? "IconRadioDisable"
62
- : checked
63
- ? "IconRadioActive"
64
- : "IconRadio"
65
- }
66
- size={24}
58
+ <SvgIcon
59
+ name={checked ? "IconRadioActive" : "IconRadio"}
60
+ width={24}
61
+ height={24}
67
62
  color={getColorCheckbox}
68
63
  />
69
64
  </View>
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
2
  import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
3
  import View from "../View";
4
- import Icon from "../Icon";
4
+
5
5
  import TextInput from "../TextInput/TextInput";
6
6
  import { useInternalTheme } from "../../core/theming";
7
7
  import { useDebouncedCallback } from "use-debounce";
8
+ import SvgIcon from "../IconSvg";
8
9
 
9
10
  interface SearchInputProps {
10
11
  style?: StyleProp<ViewStyle>;
@@ -48,7 +49,7 @@ const SearchInput = ({
48
49
  <TextInput
49
50
  left={
50
51
  <View>
51
- <Icon name={"IconSearch"} size={18} />
52
+ <SvgIcon name={"IconSearch"} width={18} height={18} />
52
53
  </View>
53
54
  }
54
55
  disabled={disabled}
@@ -24,8 +24,8 @@ import View from "../View";
24
24
  import { useInternalTheme } from "../../core/theming";
25
25
  import { ThemeProp } from "../../types";
26
26
  import Spacer from "../Spacer";
27
- import Icon from "../Icon";
28
27
  import containerStyles from "../../theme/container-styles";
28
+ import SvgIcon from "../IconSvg";
29
29
 
30
30
  export interface SelectionFieldProps extends TouchableOpacityProps {
31
31
  style?: StyleProp<ViewStyle>;
@@ -146,7 +146,7 @@ const SelectionField = ({
146
146
  </Text>
147
147
  </View>
148
148
 
149
- {right || <Icon name={"IconArrowDown"} size={24} />}
149
+ {right || <SvgIcon name={"IconArrowDown"} height={24} width={24} />}
150
150
  <Spacer width={SPACE_12} />
151
151
  </View>
152
152
  </ScaleButton>
@@ -1,11 +1,11 @@
1
- import React, { useState, useCallback, useEffect } from "react";
1
+ import React, { useCallback } from "react";
2
2
  import { StyleProp, ViewStyle, StyleSheet, TextStyle } from "react-native";
3
3
  import View from "../View";
4
4
  import { CONSTANTS } from "../../styles/themes/tokens";
5
5
  import Text from "../Text";
6
6
  import { useInternalTheme } from "../../core/theming";
7
7
  import containerStyles from "../../theme/container-styles";
8
- import Icon from "../Icon";
8
+ import SvgIcon from "../IconSvg";
9
9
 
10
10
  interface TagProps {
11
11
  style?: StyleProp<ViewStyle>;
@@ -95,9 +95,10 @@ const Tag = ({
95
95
  <View />
96
96
  ) : (
97
97
  <View paddingLeft={CONSTANTS.SPACE_4}>
98
- <Icon
98
+ <SvgIcon
99
99
  name={"IconClose"}
100
- size={20}
100
+ width={20}
101
+ height={20}
101
102
  color={colors.iconBrandDefault}
102
103
  />
103
104
  </View>
@@ -16,8 +16,8 @@ import { getOutlinedInputColors } from "./helpers";
16
16
  import type { RenderProps, ChildTextInputProps } from "./types";
17
17
  import { CONSTANTS } from "../../styles/themes/tokens";
18
18
  import Spacer from "../Spacer";
19
- import Icon from "../Icon";
20
19
  import Text from "../Text";
20
+ import SvgIcon from "../IconSvg";
21
21
 
22
22
  const TextInputDefault = ({
23
23
  disabled = false,
@@ -393,7 +393,7 @@ const TextInputDefault = ({
393
393
  onPress={handleClear}
394
394
  style={multiline ? styles.clearButtonMultiline : styles.clearButton}
395
395
  >
396
- <Icon name={"IconClearText"} size={24} />
396
+ <SvgIcon name={"IconClearText"} width={24} height={24} />
397
397
  </TouchableOpacity>
398
398
  ) : (
399
399
  <Spacer width={CONSTANTS.SPACE_12} />
@@ -42,8 +42,8 @@ import {
42
42
  SPACE_8,
43
43
  SPACE_2,
44
44
  } from "@/theme/dimensions";
45
- import Icon from "../Icon";
46
45
  import Text from "../Text";
46
+ import SvgIcon from "../IconSvg";
47
47
 
48
48
  const TextInputFlat = ({
49
49
  disabled = false,
@@ -501,7 +501,7 @@ const TextInputFlat = ({
501
501
  </View>
502
502
  {parentState.focused && !disabled && clearButton && inputValue ? (
503
503
  <TouchableOpacity onPress={handleClear} style={styles.clearButton}>
504
- <Icon name="IconClearText" size={24} />
504
+ <SvgIcon name="IconClearText" width={24} height={24} />
505
505
  </TouchableOpacity>
506
506
  ) : (
507
507
  <Spacer width={SPACE_12} />
@@ -28,8 +28,8 @@ import View from "../View";
28
28
  import { useInternalTheme } from "../../core/theming";
29
29
  import { ThemeProp } from "../../types";
30
30
  import Spacer from "../Spacer";
31
- import Icon from "../Icon";
32
31
  import containerStyles from "../../theme/container-styles";
32
+ import SvgIcon from "../IconSvg";
33
33
 
34
34
  export interface TextInputNumberProps extends TouchableOpacityProps {
35
35
  style?: StyleProp<ViewStyle>;
@@ -363,7 +363,7 @@ const TextInputNumber = ({
363
363
  </View>
364
364
  {clearButton && !checkValueEmpty() && (
365
365
  <TouchableOpacity activeOpacity={0.8} onPress={handleClearInput}>
366
- <Icon name={"IconClearText"} size={24} />
366
+ <SvgIcon name="IconClearText" width={24} height={24} />
367
367
  </TouchableOpacity>
368
368
  )}
369
369
  {right && numberValue && (
@@ -428,9 +428,10 @@ const TextInputNumber = ({
428
428
  onPress={handleClear}
429
429
  style={styles.clearButton}
430
430
  >
431
- <Icon
431
+ <SvgIcon
432
432
  name="IconClearText"
433
- size={24}
433
+ width={24}
434
+ height={24}
434
435
  color={colors.textSecondary}
435
436
  />
436
437
  </TouchableOpacity>
@@ -461,7 +462,12 @@ const TextInputNumber = ({
461
462
  }
462
463
  >
463
464
  {key === "del" ? (
464
- <Icon name="IconDelNumber" size={24} />
465
+ <SvgIcon
466
+ name="IconDelNumber"
467
+ width={24}
468
+ height={24}
469
+ color={colors.textSecondary}
470
+ />
465
471
  ) : (
466
472
  <Text
467
473
  style={[
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { CONSTANTS } from "../../styles/themes/tokens";
4
4
  import React, { useImperativeHandle, useRef, useState } from "react";
5
- import { StyleSheet, Image as RNImage } from "react-native";
5
+ import { StyleSheet } from "react-native";
6
6
  import { useSafeAreaInsets } from "react-native-safe-area-context";
7
7
  import Text from "../Text";
8
8
  import View from "../View";
@@ -10,7 +10,7 @@ import View from "../View";
10
10
  import { memoWithRef } from "@/utils/function-utils";
11
11
  import ViewVisibleAnimated from "../ViewVisibleAnimated";
12
12
  import { useInternalTheme } from "../../core/theming";
13
- import Icon from "../Icon";
13
+ import SvgIcon from "../IconSvg";
14
14
 
15
15
  const POSITION = {
16
16
  TOP: "top",
@@ -236,7 +236,7 @@ const Toast = memoWithRef(
236
236
  >
237
237
  <View row style={{ alignItems: "flex-start" }}>
238
238
  <View>
239
- <Icon name={getSourceIcon()} size={20} />
239
+ <SvgIcon name={getSourceIcon()} width={20} height={20} />
240
240
  </View>
241
241
  <View full paddingLeft={CONSTANTS.SPACE_8}>
242
242
  <Text bold color={colors.textOnFillDefault}>