@tecsinapse/react-core 3.3.7 → 3.4.1

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 (177) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +9 -7
  3. package/dist/cjs/components/atoms/Input/InputContainer/InputContainer.js +2 -4
  4. package/dist/cjs/components/atoms/Input/InputMaskElement/InputMaskElement.js +1 -2
  5. package/dist/cjs/components/atoms/Input/hooks/useNumberMask.js +1 -2
  6. package/dist/cjs/components/atoms/Input/hooks/useStringMask.js +5 -10
  7. package/dist/cjs/components/atoms/Switch/animation.js +1 -2
  8. package/dist/cjs/components/molecules/Calendar/Calendar.js +1 -2
  9. package/dist/cjs/components/molecules/Calendar/components/MonthWeek.js +3 -6
  10. package/dist/cjs/components/molecules/DatePicker/DatePicker.js +2 -4
  11. package/dist/cjs/components/molecules/DateTimeSelector/DateTimeSelector.js +1 -2
  12. package/dist/cjs/components/molecules/Grid/functions.js +2 -4
  13. package/dist/cjs/hooks/useDebouncedState.js +1 -2
  14. package/dist/cjs/styles/definitions.js +1 -2
  15. package/dist/cjs/utils/ResponsiveFontSize.js +2 -4
  16. package/dist/cjs/utils/lightenDarkenColor.js +6 -12
  17. package/dist/esm/components/atoms/Input/InputContainer/InputContainer.js +2 -4
  18. package/dist/esm/components/atoms/Input/InputMaskElement/InputMaskElement.js +1 -2
  19. package/dist/esm/components/atoms/Input/hooks/useNumberMask.js +1 -2
  20. package/dist/esm/components/atoms/Input/hooks/useStringMask.js +5 -10
  21. package/dist/esm/components/atoms/Switch/animation.js +1 -2
  22. package/dist/esm/components/molecules/Calendar/Calendar.js +1 -2
  23. package/dist/esm/components/molecules/Calendar/components/MonthWeek.js +3 -6
  24. package/dist/esm/components/molecules/DatePicker/DatePicker.js +2 -4
  25. package/dist/esm/components/molecules/DateTimeSelector/DateTimeSelector.js +1 -2
  26. package/dist/esm/components/molecules/Grid/functions.js +2 -4
  27. package/dist/esm/hooks/useDebouncedState.js +1 -2
  28. package/dist/esm/styles/definitions.js +1 -2
  29. package/dist/esm/utils/ResponsiveFontSize.js +2 -4
  30. package/dist/esm/utils/lightenDarkenColor.js +6 -12
  31. package/dist/types/components/atoms/Avatar/Avatar.d.ts +4 -0
  32. package/dist/types/components/atoms/Avatar/helpers.d.ts +1 -0
  33. package/dist/types/components/atoms/Avatar/index.d.ts +2 -0
  34. package/dist/types/components/atoms/Avatar/styled.d.ts +24 -0
  35. package/dist/types/components/atoms/Avatar/types.d.ts +12 -0
  36. package/dist/types/components/atoms/Badge/Badge.d.ts +12 -0
  37. package/dist/types/components/atoms/Badge/index.d.ts +2 -0
  38. package/dist/types/components/atoms/Badge/styled.d.ts +15 -0
  39. package/dist/types/components/atoms/BoxContent/BoxContent.d.ts +7 -0
  40. package/dist/types/components/atoms/BoxContent/index.d.ts +2 -0
  41. package/dist/types/components/atoms/BoxContent/styled.d.ts +22 -0
  42. package/dist/types/components/atoms/Button/Button.d.ts +28 -0
  43. package/dist/types/components/atoms/Button/States/BaseState.d.ts +7 -0
  44. package/dist/types/components/atoms/Button/States/Error.d.ts +4 -0
  45. package/dist/types/components/atoms/Button/States/Loading.d.ts +4 -0
  46. package/dist/types/components/atoms/Button/States/Success.d.ts +4 -0
  47. package/dist/types/components/atoms/Button/States/index.d.ts +3 -0
  48. package/dist/types/components/atoms/Button/States/styled.d.ts +14 -0
  49. package/dist/types/components/atoms/Button/index.d.ts +3 -0
  50. package/dist/types/components/atoms/Button/styled.d.ts +6 -0
  51. package/dist/types/components/atoms/Card/Card.d.ts +10 -0
  52. package/dist/types/components/atoms/Card/Footer/Footer.d.ts +8 -0
  53. package/dist/types/components/atoms/Card/Footer/index.d.ts +2 -0
  54. package/dist/types/components/atoms/Card/Header/Header.d.ts +8 -0
  55. package/dist/types/components/atoms/Card/Header/index.d.ts +2 -0
  56. package/dist/types/components/atoms/Card/index.d.ts +2 -0
  57. package/dist/types/components/atoms/Card/styled.d.ts +6 -0
  58. package/dist/types/components/atoms/Checkbox/Checkbox.d.ts +15 -0
  59. package/dist/types/components/atoms/Checkbox/index.d.ts +2 -0
  60. package/dist/types/components/atoms/Checkbox/styled.d.ts +27 -0
  61. package/dist/types/components/atoms/Divider/Divider.d.ts +8 -0
  62. package/dist/types/components/atoms/Divider/index.d.ts +2 -0
  63. package/dist/types/components/atoms/Divider/styled.d.ts +11 -0
  64. package/dist/types/components/atoms/GroupButton/GroupButton.d.ts +33 -0
  65. package/dist/types/components/atoms/GroupButton/GroupButtonOption.d.ts +9 -0
  66. package/dist/types/components/atoms/GroupButton/index.d.ts +4 -0
  67. package/dist/types/components/atoms/GroupButton/styled.d.ts +38 -0
  68. package/dist/types/components/atoms/Icon/AntDesign.d.ts +4 -0
  69. package/dist/types/components/atoms/Icon/Entypo.d.ts +4 -0
  70. package/dist/types/components/atoms/Icon/Evil.d.ts +4 -0
  71. package/dist/types/components/atoms/Icon/Feather.d.ts +4 -0
  72. package/dist/types/components/atoms/Icon/FontAwesome.d.ts +4 -0
  73. package/dist/types/components/atoms/Icon/FontAwesomeFive.d.ts +4 -0
  74. package/dist/types/components/atoms/Icon/Fontisto.d.ts +4 -0
  75. package/dist/types/components/atoms/Icon/Foundation.d.ts +4 -0
  76. package/dist/types/components/atoms/Icon/Icon.d.ts +15 -0
  77. package/dist/types/components/atoms/Icon/Ionicon.d.ts +4 -0
  78. package/dist/types/components/atoms/Icon/Material.d.ts +4 -0
  79. package/dist/types/components/atoms/Icon/MaterialCommunity.d.ts +4 -0
  80. package/dist/types/components/atoms/Icon/Octicon.d.ts +4 -0
  81. package/dist/types/components/atoms/Icon/SimpleLine.d.ts +4 -0
  82. package/dist/types/components/atoms/Icon/Zocial.d.ts +4 -0
  83. package/dist/types/components/atoms/Icon/functions.d.ts +7 -0
  84. package/dist/types/components/atoms/Icon/index.d.ts +2 -0
  85. package/dist/types/components/atoms/Icon/styled.d.ts +7 -0
  86. package/dist/types/components/atoms/Icon/types.d.ts +12 -0
  87. package/dist/types/components/atoms/Input/Hint.d.ts +10 -0
  88. package/dist/types/components/atoms/Input/InputContainer/InputContainer.d.ts +30 -0
  89. package/dist/types/components/atoms/Input/InputElement/InputElement.d.ts +13 -0
  90. package/dist/types/components/atoms/Input/InputMaskElement/InputMaskElement.d.ts +16 -0
  91. package/dist/types/components/atoms/Input/PressableInputContainer/PressableInputContainer.d.ts +11 -0
  92. package/dist/types/components/atoms/Input/PressableInputContainer/index.d.ts +2 -0
  93. package/dist/types/components/atoms/Input/PressableInputContainer/styled.d.ts +5 -0
  94. package/dist/types/components/atoms/Input/hooks/useInputFocus.d.ts +5 -0
  95. package/dist/types/components/atoms/Input/hooks/useNumberMask.d.ts +8 -0
  96. package/dist/types/components/atoms/Input/hooks/useStringMask.d.ts +8 -0
  97. package/dist/types/components/atoms/Input/index.d.ts +13 -0
  98. package/dist/types/components/atoms/Input/styled.d.ts +58 -0
  99. package/dist/types/components/atoms/Paper/Paper.d.ts +9 -0
  100. package/dist/types/components/atoms/Paper/index.d.ts +2 -0
  101. package/dist/types/components/atoms/Paper/styled.d.ts +7 -0
  102. package/dist/types/components/atoms/PressableSurface/PressableSurface.d.ts +11 -0
  103. package/dist/types/components/atoms/PressableSurface/index.d.ts +2 -0
  104. package/dist/types/components/atoms/ProgressBar/ProgressBar.d.ts +13 -0
  105. package/dist/types/components/atoms/ProgressBar/index.d.ts +2 -0
  106. package/dist/types/components/atoms/ProgressBar/styled.d.ts +19 -0
  107. package/dist/types/components/atoms/RadioButton/RadioButton.d.ts +15 -0
  108. package/dist/types/components/atoms/RadioButton/index.d.ts +2 -0
  109. package/dist/types/components/atoms/RadioButton/styled.d.ts +27 -0
  110. package/dist/types/components/atoms/Switch/Switch.d.ts +16 -0
  111. package/dist/types/components/atoms/Switch/animation.d.ts +2 -0
  112. package/dist/types/components/atoms/Switch/index.d.ts +3 -0
  113. package/dist/types/components/atoms/Switch/styled.d.ts +12 -0
  114. package/dist/types/components/atoms/Tag/Tag.d.ts +15 -0
  115. package/dist/types/components/atoms/Tag/index.d.ts +2 -0
  116. package/dist/types/components/atoms/Tag/styled.d.ts +22 -0
  117. package/dist/types/components/atoms/Text/Text.d.ts +20 -0
  118. package/dist/types/components/atoms/Text/functions.d.ts +2 -0
  119. package/dist/types/components/atoms/Text/index.d.ts +2 -0
  120. package/dist/types/components/atoms/Text/styled.d.ts +18 -0
  121. package/dist/types/components/atoms/shared/PaperAndCard.d.ts +5 -0
  122. package/dist/types/components/molecules/Calendar/Calendar.d.ts +22 -0
  123. package/dist/types/components/molecules/Calendar/components/MemoizedYearCard.d.ts +10 -0
  124. package/dist/types/components/molecules/Calendar/components/MonthWeek.d.ts +13 -0
  125. package/dist/types/components/molecules/Calendar/components/SelectYear.d.ts +12 -0
  126. package/dist/types/components/molecules/Calendar/components/Weekdays.d.ts +8 -0
  127. package/dist/types/components/molecules/Calendar/components/index.d.ts +4 -0
  128. package/dist/types/components/molecules/Calendar/index.d.ts +2 -0
  129. package/dist/types/components/molecules/Calendar/styled.d.ts +63 -0
  130. package/dist/types/components/molecules/ControlledDateTimeSelector/ControlledDateTimeSelector.d.ts +20 -0
  131. package/dist/types/components/molecules/ControlledDateTimeSelector/index.d.ts +2 -0
  132. package/dist/types/components/molecules/DatePicker/DatePicker.d.ts +19 -0
  133. package/dist/types/components/molecules/DatePicker/index.d.ts +3 -0
  134. package/dist/types/components/molecules/DatePicker/styled.d.ts +11 -0
  135. package/dist/types/components/molecules/DateTimePicker/DateTimePicker.d.ts +17 -0
  136. package/dist/types/components/molecules/DateTimePicker/index.d.ts +2 -0
  137. package/dist/types/components/molecules/DateTimePicker/styled.d.ts +6 -0
  138. package/dist/types/components/molecules/DateTimeSelector/DateTimeSelector.d.ts +28 -0
  139. package/dist/types/components/molecules/DateTimeSelector/Selector.d.ts +17 -0
  140. package/dist/types/components/molecules/DateTimeSelector/index.d.ts +2 -0
  141. package/dist/types/components/molecules/DateTimeSelector/styled.d.ts +48 -0
  142. package/dist/types/components/molecules/Grid/functions.d.ts +4 -0
  143. package/dist/types/components/molecules/Grid/index.d.ts +42 -0
  144. package/dist/types/components/molecules/HintInputContainer/HintInputContainer.d.ts +17 -0
  145. package/dist/types/components/molecules/HintInputContainer/index.d.ts +2 -0
  146. package/dist/types/components/molecules/HintInputContainer/styled.d.ts +0 -0
  147. package/dist/types/components/molecules/IconTextButton/IconComponent.d.ts +11 -0
  148. package/dist/types/components/molecules/IconTextButton/IconTextButton.d.ts +10 -0
  149. package/dist/types/components/molecules/IconTextButton/index.d.ts +2 -0
  150. package/dist/types/components/molecules/InputPassword/InputPasswordIcon.d.ts +8 -0
  151. package/dist/types/components/molecules/InputPassword/index.d.ts +1 -0
  152. package/dist/types/components/molecules/InputPassword/styled.d.ts +5 -0
  153. package/dist/types/components/molecules/LabeledSwitch/LabeledSwitch.d.ts +11 -0
  154. package/dist/types/components/molecules/LabeledSwitch/index.d.ts +1 -0
  155. package/dist/types/components/molecules/Snackbar/Snackbar.d.ts +21 -0
  156. package/dist/types/components/molecules/Snackbar/index.d.ts +2 -0
  157. package/dist/types/components/molecules/Snackbar/styled.d.ts +37 -0
  158. package/dist/types/components/molecules/TextArea/TextArea.d.ts +14 -0
  159. package/dist/types/components/molecules/TextArea/index.d.ts +3 -0
  160. package/dist/types/components/molecules/TextArea/styled.d.ts +10 -0
  161. package/dist/types/hooks/index.d.ts +2 -0
  162. package/dist/types/hooks/useDebouncedState.d.ts +2 -0
  163. package/dist/types/hooks/useTheme.d.ts +2 -0
  164. package/dist/types/index.d.ts +66 -0
  165. package/dist/types/styles/ThemeProvider.d.ts +4 -0
  166. package/dist/types/styles/definitions.d.ts +45 -0
  167. package/dist/types/styles/light.d.ts +2 -0
  168. package/dist/types/types/defaults.d.ts +134 -0
  169. package/dist/types/utils/IPhoneXHelper.d.ts +4 -0
  170. package/dist/types/utils/ResponsiveFontSize.d.ts +3 -0
  171. package/dist/types/utils/extractNumbersFromString.d.ts +2 -0
  172. package/dist/types/utils/formatWithMask.d.ts +2 -0
  173. package/dist/types/utils/index.d.ts +7 -0
  174. package/dist/types/utils/lightenDarkenColor.d.ts +1 -0
  175. package/dist/types/utils/masks.d.ts +12 -0
  176. package/dist/types/utils/variantComplement.d.ts +6 -0
  177. package/package.json +9 -9
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 TecSinapse
3
+ Copyright (c) 2024 TecSinapse
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -4,8 +4,7 @@
4
4
 
5
5
  [![Stars](https://img.shields.io/github/stars/tecsinapse/design-system?style=social)](https://github.com/tecsinapse/design-system/) [![License](https://img.shields.io/github/license/tecsinapse/design-system)](./LICENSE.md) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE_OF_CONDUCT.md)![build workflow](https://github.com/tecsinapse/design-system/actions/workflows/ci.yml/badge.svg)
6
6
 
7
-
8
- [TecSinapse Design System](https://tecsinapse.github.io/design-system) is the hybrid implementation of the [TecSinapse](https://www.tecsinapse.com.br/) Design System.
7
+ [TecSinapse Design System](https://tecsinapse.github.io/design-system) is the hybrid implementation of the [TecSinapse](https://www.tecsinapse.com.br/) Design System.
9
8
  Our primary goal is to create a system that can be used to build a wide variety of TecSinapase websites and apps, while providing a consistent and inclusive user experience to our end users.
10
9
  In addition, the design system and component library should be easy to use for developers and designers.
11
10
 
@@ -24,11 +23,12 @@ Here are a few helpful links for getting started:
24
23
  ## Packages
25
24
 
26
25
  | Package | Content | Version |
27
- |-----------------------------------------------------------------|------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
26
+ | --------------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
28
27
  | **[@tecsinapse/react-core](./packages/react-core)** | the core hybrid React component library | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-core.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-core) |
29
28
  | **[@tecsinapse/react-web-kit](./packages/react-web-kit)** | the React component library focused on web | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-web-kit.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-web-kit) |
30
29
  | **[@tecsinapse/react-native-kit](./packages/react-native-kit)** | the React native component library focused on mobile | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-native-kit.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-native-kit) |
31
30
  | **[@tecsinapse/react-charts](./packages/react-charts)** | Charts for React based on SVG | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-charts.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-charts) |
31
+ | **[@tecsinapse/cortex-core](./packages/cortex-core)** | The core library for tailwindcss based design | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Fcortex-core.svg)](https://badge.fury.io/js/%40tecsinapse%2Fcortex-core) |
32
32
 
33
33
  ## Code of conduct
34
34
 
@@ -41,27 +41,29 @@ If you feel another member of the community violated our code or you are experie
41
41
  At times, it may be necessary to test changes directly in a product, and not in the design system, and for this to work in a less laborious way, we can follow the steps below:
42
42
 
43
43
  3 terminal tabs should open:
44
+
44
45
  - In one run the JS code watch:
46
+
45
47
  ```
46
48
  yarn build:watch
47
49
  ```
50
+
48
51
  - In another run the watch of the TS code watch
52
+
49
53
  ```
50
54
  yarn build:declarations:watch
51
55
  ```
56
+
52
57
  - On another run yalc push (this script updates linked local projects)
58
+
53
59
  ```
54
60
  yarn yalc:push
55
61
  ```
56
62
 
57
63
  With that, all changes will be in yalc locally.
58
64
 
59
- To access in your application, see this [example](https://github.com/tecsinapse/vendas-web-poc-playground#tools) in topic "**Yalc link Design System:**"
60
-
61
-
62
65
  ### Maintainers
63
66
 
64
- - [Beatriz Silva](mailto:beatriz.silva@tecsinapse.com.br)
65
67
  - [Denner Vidal](mailto:denner.vidal@tecsinapse.com.br)
66
68
  - [Gabriel Sanches](mailto:gabriel.sanches@tecsinapse.com.br)
67
69
  - [Lucas Ramos](mailto:lucas.ramos@tecsinapse.com.br)
@@ -23,10 +23,8 @@ const InputContainer = ({
23
23
  ...rest
24
24
  }) => {
25
25
  let _defaultLabelColor = labelColorVariant;
26
- if (variant === "error")
27
- _defaultLabelColor = "error";
28
- if (variant === "success")
29
- _defaultLabelColor = "success";
26
+ if (variant === "error") _defaultLabelColor = "error";
27
+ if (variant === "success") _defaultLabelColor = "success";
30
28
  const _labelColorVariant = disabled ? "secondary" : _defaultLabelColor;
31
29
  const _labelColorTone = disabled ? "light" : labelColorTone;
32
30
  return /* @__PURE__ */ React.createElement(
@@ -40,8 +40,7 @@ const InputMaskElement = React.forwardRef(
40
40
  (value2) => {
41
41
  if (maskValue !== void 0 && setMaskValue !== void 0) {
42
42
  setMaskValue(value2);
43
- } else
44
- onChange && onChange(value2);
43
+ } else onChange && onChange(value2);
45
44
  },
46
45
  [value]
47
46
  );
@@ -22,8 +22,7 @@ const getInternalNumberAndMask = (value, options) => {
22
22
  const currentPrecision = decimalIndex + precision;
23
23
  if (decimalIndex !== -1 && currentPrecision <= stringValue.length) {
24
24
  const zeros = stringValue.length + 1 - currentPrecision;
25
- for (let i = 0; i < zeros; i++)
26
- stringValue = stringValue + `0`;
25
+ for (let i = 0; i < zeros; i++) stringValue = stringValue + `0`;
27
26
  }
28
27
  internalNumber = Number(stringValue);
29
28
  } else {
@@ -43,22 +43,17 @@ const getMask = (mask, newValue) => {
43
43
  }
44
44
  maskArray.forEach((exp) => {
45
45
  if (typeof exp !== "string") {
46
- if (Array.isArray(exp))
47
- regexArray.push(exp);
48
- else
49
- regexArray.push(exp);
46
+ if (Array.isArray(exp)) regexArray.push(exp);
47
+ else regexArray.push(exp);
50
48
  } else {
51
49
  for (let i = 0; i < exp.length; i++) {
52
50
  if (exp[i] === "\\") {
53
51
  regexArray.push(exp[i + 1]);
54
52
  i++;
55
53
  } else {
56
- if (exp[i] === "9")
57
- regexArray.push(/\d/);
58
- else if (exp[i] === "a")
59
- regexArray.push(/[a-zA-Z]/);
60
- else
61
- regexArray.push(exp[i]);
54
+ if (exp[i] === "9") regexArray.push(/\d/);
55
+ else if (exp[i] === "a") regexArray.push(/[a-zA-Z]/);
56
+ else regexArray.push(exp[i]);
62
57
  }
63
58
  }
64
59
  }
@@ -4,8 +4,7 @@ var reactNative = require('react-native');
4
4
 
5
5
  const ANIMATION_SPEED = 140;
6
6
  const transitionSwitch = (active, translate, transitionValue, animatedColor) => {
7
- if (translate <= 0)
8
- return;
7
+ if (translate <= 0) return;
9
8
  if (active) {
10
9
  reactNative.Animated.timing(transitionValue, {
11
10
  toValue: translate,
@@ -78,8 +78,7 @@ function Calendar({
78
78
  () => [...Array(6).keys()].map(
79
79
  (week) => [...Array(7).keys()].map((weekDayIndex) => {
80
80
  let addDays = 6 * week + week + weekDayIndex - startingWeekDay;
81
- if (weeksInMonth == 5 && startingWeekDay == 0)
82
- addDays -= 7;
81
+ if (weeksInMonth == 5 && startingWeekDay == 0) addDays -= 7;
83
82
  return dateFns.add(referenceDate, {
84
83
  days: addDays
85
84
  });
@@ -14,12 +14,10 @@ const MonthWeek = ({
14
14
  }) => {
15
15
  const checkIfIsBetween = React.useCallback(
16
16
  (date, _value) => {
17
- if (type !== "range" || !_value)
18
- return false;
17
+ if (type !== "range" || !_value) return false;
19
18
  else {
20
19
  const { lowest, highest } = _value;
21
- if (!highest)
22
- return false;
20
+ if (!highest) return false;
23
21
  return dateFns.compareAsc(lowest, date) <= 0 && dateFns.compareAsc(highest, date) >= 0;
24
22
  }
25
23
  },
@@ -27,8 +25,7 @@ const MonthWeek = ({
27
25
  );
28
26
  const checkIfIsSelected = React.useCallback(
29
27
  (date, _value) => {
30
- if (!_value)
31
- return false;
28
+ if (!_value) return false;
32
29
  else if (type === "range" && _value) {
33
30
  const { lowest, highest } = _value;
34
31
  return dateFns.isSameDay(lowest, date) || (highest ? dateFns.isSameDay(highest, date) : false);
@@ -68,8 +68,7 @@ function DatePicker({
68
68
  handleFocus();
69
69
  }, [handleFocus, requestShowCalendar]);
70
70
  const getDisplayValue = () => {
71
- if (!value)
72
- return placeholder;
71
+ if (!value) return placeholder;
73
72
  if (type === "day") {
74
73
  return dateFns.format(value, format, { locale });
75
74
  } else {
@@ -78,8 +77,7 @@ function DatePicker({
78
77
  return `${dateFns.format(lowest, format, {
79
78
  locale
80
79
  })} - ${dateFns.format(highest, format, { locale })}`;
81
- else
82
- return placeholder;
80
+ else return placeholder;
83
81
  }
84
82
  };
85
83
  const StyledText = styled.getStyledTextComponent(TextComponent);
@@ -30,8 +30,7 @@ function _interopNamespaceDefault(e) {
30
30
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
31
31
 
32
32
  function getThresholdUnit(mode, threshold) {
33
- if (!threshold)
34
- return {};
33
+ if (!threshold) return {};
35
34
  if (mode === "month") {
36
35
  return { months: threshold };
37
36
  } else if (["date", "datetime"].includes(mode)) {
@@ -16,10 +16,8 @@ const getGridItemPadding = (pos, _spacing, themeSpacing) => {
16
16
  return extractNumbersFromString.extractNumbersFromString(themeSpacing[_spacing]);
17
17
  else if (typeof _spacing === "object" && _spacing[pos]) {
18
18
  return extractNumbersFromString.extractNumbersFromString(themeSpacing[_spacing[pos] ?? "0"]);
19
- } else
20
- return void 0;
21
- } else
22
- return void 0;
19
+ } else return void 0;
20
+ } else return void 0;
23
21
  };
24
22
  const getGridItemColumSpan = (columns, span) => 100 / (columns / span);
25
23
 
@@ -6,8 +6,7 @@ function useDebouncedState(initialState, timeoutCallback, timeoutMs = 166) {
6
6
  const timeoutId = React.useRef();
7
7
  const [state, setState] = React.useState(initialState);
8
8
  React.useEffect(() => {
9
- if (timeoutId.current)
10
- clearTimeout(timeoutId.current);
9
+ if (timeoutId.current) clearTimeout(timeoutId.current);
11
10
  if (timeoutCallback)
12
11
  timeoutId.current = setTimeout(() => timeoutCallback(state), timeoutMs);
13
12
  }, [state]);
@@ -42,8 +42,7 @@ const statusColor = {
42
42
  };
43
43
  const hex2rgba = (hex, alpha = 1) => {
44
44
  const rgb = ((hex ?? "").match(/\w\w/g) ?? []).map((x) => parseInt(x, 16));
45
- if (!rgb || (rgb ?? []).length === 0)
46
- return "";
45
+ if (!rgb || (rgb ?? []).length === 0) return "";
47
46
  const [r, g, b] = rgb;
48
47
  return `rgba(${r},${g},${b},${alpha})`;
49
48
  };
@@ -6,8 +6,7 @@ var IPhoneXHelper = require('./IPhoneXHelper.js');
6
6
 
7
7
  const STANDARD_SCREEN_HEIGHT = 680;
8
8
  const RFPercentage = (percent) => {
9
- if (reactNative.Platform.OS === "web")
10
- return percent;
9
+ if (reactNative.Platform.OS === "web") return percent;
11
10
  const { height, width } = reactNative.Dimensions.get("window");
12
11
  const standardLength = width > height ? width : height;
13
12
  const offset = width > height ? 0 : reactNative.Platform.OS === "ios" ? 78 : reactNative.StatusBar.currentHeight || 0;
@@ -16,8 +15,7 @@ const RFPercentage = (percent) => {
16
15
  return Math.round(heightPercent);
17
16
  };
18
17
  const RFValue = (fontSize, standardScreenHeight = STANDARD_SCREEN_HEIGHT) => {
19
- if (reactNative.Platform.OS === "web")
20
- return fontSize;
18
+ if (reactNative.Platform.OS === "web") return fontSize;
21
19
  const { height, width } = reactNative.Dimensions.get("window");
22
20
  const standardLength = width > height ? width : height;
23
21
  const offset = width > height ? 0 : reactNative.Platform.OS === "ios" ? 78 : reactNative.StatusBar.currentHeight || 0;
@@ -8,20 +8,14 @@ const lightenDarkenColor = (color, variation) => {
8
8
  }
9
9
  const num = parseInt(color, 16);
10
10
  let r = (num >> 16) + variation;
11
- if (r > 255)
12
- r = 255;
13
- else if (r < 0)
14
- r = 0;
11
+ if (r > 255) r = 255;
12
+ else if (r < 0) r = 0;
15
13
  let b = (num >> 8 & 255) + variation;
16
- if (b > 255)
17
- b = 255;
18
- else if (b < 0)
19
- b = 0;
14
+ if (b > 255) b = 255;
15
+ else if (b < 0) b = 0;
20
16
  let g = (num & 255) + variation;
21
- if (g > 255)
22
- g = 255;
23
- else if (g < 0)
24
- g = 0;
17
+ if (g > 255) g = 255;
18
+ else if (g < 0) g = 0;
25
19
  return (usePound ? "#" : "") + (g | b << 8 | r << 16).toString(16);
26
20
  };
27
21
 
@@ -21,10 +21,8 @@ const InputContainer = ({
21
21
  ...rest
22
22
  }) => {
23
23
  let _defaultLabelColor = labelColorVariant;
24
- if (variant === "error")
25
- _defaultLabelColor = "error";
26
- if (variant === "success")
27
- _defaultLabelColor = "success";
24
+ if (variant === "error") _defaultLabelColor = "error";
25
+ if (variant === "success") _defaultLabelColor = "success";
28
26
  const _labelColorVariant = disabled ? "secondary" : _defaultLabelColor;
29
27
  const _labelColorTone = disabled ? "light" : labelColorTone;
30
28
  return /* @__PURE__ */ React__default.createElement(
@@ -38,8 +38,7 @@ const InputMaskElement = React__default.forwardRef(
38
38
  (value2) => {
39
39
  if (maskValue !== void 0 && setMaskValue !== void 0) {
40
40
  setMaskValue(value2);
41
- } else
42
- onChange && onChange(value2);
41
+ } else onChange && onChange(value2);
43
42
  },
44
43
  [value]
45
44
  );
@@ -20,8 +20,7 @@ const getInternalNumberAndMask = (value, options) => {
20
20
  const currentPrecision = decimalIndex + precision;
21
21
  if (decimalIndex !== -1 && currentPrecision <= stringValue.length) {
22
22
  const zeros = stringValue.length + 1 - currentPrecision;
23
- for (let i = 0; i < zeros; i++)
24
- stringValue = stringValue + `0`;
23
+ for (let i = 0; i < zeros; i++) stringValue = stringValue + `0`;
25
24
  }
26
25
  internalNumber = Number(stringValue);
27
26
  } else {
@@ -41,22 +41,17 @@ const getMask = (mask, newValue) => {
41
41
  }
42
42
  maskArray.forEach((exp) => {
43
43
  if (typeof exp !== "string") {
44
- if (Array.isArray(exp))
45
- regexArray.push(exp);
46
- else
47
- regexArray.push(exp);
44
+ if (Array.isArray(exp)) regexArray.push(exp);
45
+ else regexArray.push(exp);
48
46
  } else {
49
47
  for (let i = 0; i < exp.length; i++) {
50
48
  if (exp[i] === "\\") {
51
49
  regexArray.push(exp[i + 1]);
52
50
  i++;
53
51
  } else {
54
- if (exp[i] === "9")
55
- regexArray.push(/\d/);
56
- else if (exp[i] === "a")
57
- regexArray.push(/[a-zA-Z]/);
58
- else
59
- regexArray.push(exp[i]);
52
+ if (exp[i] === "9") regexArray.push(/\d/);
53
+ else if (exp[i] === "a") regexArray.push(/[a-zA-Z]/);
54
+ else regexArray.push(exp[i]);
60
55
  }
61
56
  }
62
57
  }
@@ -2,8 +2,7 @@ import { Animated, Easing } from 'react-native';
2
2
 
3
3
  const ANIMATION_SPEED = 140;
4
4
  const transitionSwitch = (active, translate, transitionValue, animatedColor) => {
5
- if (translate <= 0)
6
- return;
5
+ if (translate <= 0) return;
7
6
  if (active) {
8
7
  Animated.timing(transitionValue, {
9
8
  toValue: translate,
@@ -58,8 +58,7 @@ function Calendar({
58
58
  () => [...Array(6).keys()].map(
59
59
  (week) => [...Array(7).keys()].map((weekDayIndex) => {
60
60
  let addDays = 6 * week + week + weekDayIndex - startingWeekDay;
61
- if (weeksInMonth == 5 && startingWeekDay == 0)
62
- addDays -= 7;
61
+ if (weeksInMonth == 5 && startingWeekDay == 0) addDays -= 7;
63
62
  return add(referenceDate, {
64
63
  days: addDays
65
64
  });
@@ -12,12 +12,10 @@ const MonthWeek = ({
12
12
  }) => {
13
13
  const checkIfIsBetween = React__default.useCallback(
14
14
  (date, _value) => {
15
- if (type !== "range" || !_value)
16
- return false;
15
+ if (type !== "range" || !_value) return false;
17
16
  else {
18
17
  const { lowest, highest } = _value;
19
- if (!highest)
20
- return false;
18
+ if (!highest) return false;
21
19
  return compareAsc(lowest, date) <= 0 && compareAsc(highest, date) >= 0;
22
20
  }
23
21
  },
@@ -25,8 +23,7 @@ const MonthWeek = ({
25
23
  );
26
24
  const checkIfIsSelected = React__default.useCallback(
27
25
  (date, _value) => {
28
- if (!_value)
29
- return false;
26
+ if (!_value) return false;
30
27
  else if (type === "range" && _value) {
31
28
  const { lowest, highest } = _value;
32
29
  return isSameDay(lowest, date) || (highest ? isSameDay(highest, date) : false);
@@ -48,8 +48,7 @@ function DatePicker({
48
48
  handleFocus();
49
49
  }, [handleFocus, requestShowCalendar]);
50
50
  const getDisplayValue = () => {
51
- if (!value)
52
- return placeholder;
51
+ if (!value) return placeholder;
53
52
  if (type === "day") {
54
53
  return format(value, format$1, { locale });
55
54
  } else {
@@ -58,8 +57,7 @@ function DatePicker({
58
57
  return `${format(lowest, format$1, {
59
58
  locale
60
59
  })} - ${format(highest, format$1, { locale })}`;
61
- else
62
- return placeholder;
60
+ else return placeholder;
63
61
  }
64
62
  };
65
63
  const StyledText = getStyledTextComponent(TextComponent);
@@ -9,8 +9,7 @@ import { Selector } from './Selector.js';
9
9
  import { Root, Header, BackButton, Content, SelectorContainer } from './styled.js';
10
10
 
11
11
  function getThresholdUnit(mode, threshold) {
12
- if (!threshold)
13
- return {};
12
+ if (!threshold) return {};
14
13
  if (mode === "month") {
15
14
  return { months: threshold };
16
15
  } else if (["date", "datetime"].includes(mode)) {
@@ -14,10 +14,8 @@ const getGridItemPadding = (pos, _spacing, themeSpacing) => {
14
14
  return extractNumbersFromString(themeSpacing[_spacing]);
15
15
  else if (typeof _spacing === "object" && _spacing[pos]) {
16
16
  return extractNumbersFromString(themeSpacing[_spacing[pos] ?? "0"]);
17
- } else
18
- return void 0;
19
- } else
20
- return void 0;
17
+ } else return void 0;
18
+ } else return void 0;
21
19
  };
22
20
  const getGridItemColumSpan = (columns, span) => 100 / (columns / span);
23
21
 
@@ -4,8 +4,7 @@ function useDebouncedState(initialState, timeoutCallback, timeoutMs = 166) {
4
4
  const timeoutId = useRef();
5
5
  const [state, setState] = useState(initialState);
6
6
  useEffect(() => {
7
- if (timeoutId.current)
8
- clearTimeout(timeoutId.current);
7
+ if (timeoutId.current) clearTimeout(timeoutId.current);
9
8
  if (timeoutCallback)
10
9
  timeoutId.current = setTimeout(() => timeoutCallback(state), timeoutMs);
11
10
  }, [state]);
@@ -40,8 +40,7 @@ const statusColor = {
40
40
  };
41
41
  const hex2rgba = (hex, alpha = 1) => {
42
42
  const rgb = ((hex ?? "").match(/\w\w/g) ?? []).map((x) => parseInt(x, 16));
43
- if (!rgb || (rgb ?? []).length === 0)
44
- return "";
43
+ if (!rgb || (rgb ?? []).length === 0) return "";
45
44
  const [r, g, b] = rgb;
46
45
  return `rgba(${r},${g},${b},${alpha})`;
47
46
  };
@@ -4,8 +4,7 @@ import { isIphoneX } from './IPhoneXHelper.js';
4
4
 
5
5
  const STANDARD_SCREEN_HEIGHT = 680;
6
6
  const RFPercentage = (percent) => {
7
- if (Platform.OS === "web")
8
- return percent;
7
+ if (Platform.OS === "web") return percent;
9
8
  const { height, width } = Dimensions.get("window");
10
9
  const standardLength = width > height ? width : height;
11
10
  const offset = width > height ? 0 : Platform.OS === "ios" ? 78 : StatusBar.currentHeight || 0;
@@ -14,8 +13,7 @@ const RFPercentage = (percent) => {
14
13
  return Math.round(heightPercent);
15
14
  };
16
15
  const RFValue = (fontSize, standardScreenHeight = STANDARD_SCREEN_HEIGHT) => {
17
- if (Platform.OS === "web")
18
- return fontSize;
16
+ if (Platform.OS === "web") return fontSize;
19
17
  const { height, width } = Dimensions.get("window");
20
18
  const standardLength = width > height ? width : height;
21
19
  const offset = width > height ? 0 : Platform.OS === "ios" ? 78 : StatusBar.currentHeight || 0;
@@ -6,20 +6,14 @@ const lightenDarkenColor = (color, variation) => {
6
6
  }
7
7
  const num = parseInt(color, 16);
8
8
  let r = (num >> 16) + variation;
9
- if (r > 255)
10
- r = 255;
11
- else if (r < 0)
12
- r = 0;
9
+ if (r > 255) r = 255;
10
+ else if (r < 0) r = 0;
13
11
  let b = (num >> 8 & 255) + variation;
14
- if (b > 255)
15
- b = 255;
16
- else if (b < 0)
17
- b = 0;
12
+ if (b > 255) b = 255;
13
+ else if (b < 0) b = 0;
18
14
  let g = (num & 255) + variation;
19
- if (g > 255)
20
- g = 255;
21
- else if (g < 0)
22
- g = 0;
15
+ if (g > 255) g = 255;
16
+ else if (g < 0) g = 0;
23
17
  return (usePound ? "#" : "") + (g | b << 8 | r << 16).toString(16);
24
18
  };
25
19
 
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { AvatarProps } from './types';
3
+ declare const Avatar: React.FC<AvatarProps>;
4
+ export default Avatar;
@@ -0,0 +1 @@
1
+ export declare const getIniciais: (name: string) => string;
@@ -0,0 +1,2 @@
1
+ export { default as Avatar } from './Avatar';
2
+ export type { AvatarProps } from './types';
@@ -0,0 +1,24 @@
1
+ import { FC } from 'react';
2
+ import { Image, View } from 'react-native';
3
+ import { TextProps } from '../Text';
4
+ import { AvatarProps } from './types';
5
+ export declare const ContainerButtonAvatar: import("@emotion/native").StyledComponent<import("../PressableSurface").PressableSurfaceProps & {
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any> | undefined;
8
+ } & Partial<import("../../../types/defaults").ThemeProviderProps & AvatarProps>, {}, {}>;
9
+ export declare const StyledAvatar: import("@emotion/native").StyledComponent<import("react-native").ImageProps & {
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ as?: import("react").ElementType<any> | undefined;
12
+ } & Partial<import("../../../types/defaults").ThemeProviderProps>, {}, {
13
+ ref?: import("react").Ref<Image> | undefined;
14
+ }>;
15
+ export declare const StyledBackground: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
16
+ theme?: import("@emotion/react").Theme | undefined;
17
+ as?: import("react").ElementType<any> | undefined;
18
+ } & Partial<import("../../../types/defaults").ThemeProviderProps>, {}, {
19
+ ref?: import("react").Ref<View> | undefined;
20
+ }>;
21
+ export declare const getStyledTextComponent: (component: FC<TextProps>) => import("@emotion/native").StyledComponent<TextProps & {
22
+ theme?: import("@emotion/react").Theme | undefined;
23
+ as?: import("react").ElementType<any> | undefined;
24
+ }, {}, {}>;
@@ -0,0 +1,12 @@
1
+ import { IconSize } from '../../../types/defaults';
2
+ import { ImageSourcePropType } from 'react-native';
3
+ import { FC } from 'react';
4
+ import { TextProps } from '../Text';
5
+ export type SizeAvatar = Omit<IconSize, 'centi' | 'deca'>;
6
+ export interface AvatarProps {
7
+ source?: ImageSourcePropType;
8
+ name: string;
9
+ onPress?: () => void;
10
+ size?: keyof SizeAvatar;
11
+ TextComponent?: FC<TextProps>;
12
+ }
@@ -0,0 +1,12 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { ColorGradationType, ColorType } from '../../../types/defaults';
4
+ export interface BadgeProps {
5
+ color: ColorType;
6
+ tone?: ColorGradationType;
7
+ style?: StyleProp<ViewStyle>;
8
+ value: React.ReactNode;
9
+ children?: ReactNode;
10
+ }
11
+ declare const Badge: ({ children, style, color, tone, value, }: BadgeProps) => JSX.Element;
12
+ export default Badge;
@@ -0,0 +1,2 @@
1
+ export { default as Badge } from './Badge';
2
+ export type { BadgeProps } from './Badge';
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { View } from 'react-native';
3
+ import { BadgeProps } from './Badge';
4
+ export declare const BadgeStyle: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
5
+ theme?: import("@emotion/react").Theme | undefined;
6
+ as?: import("react").ElementType<any> | undefined;
7
+ } & Partial<import("../../../types/defaults").ThemeProviderProps & BadgeProps>, {}, {
8
+ ref?: import("react").Ref<View> | undefined;
9
+ }>;
10
+ export declare const ViewStyled: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ } & Partial<import("../../../types/defaults").ThemeProviderProps & BadgeProps>, {}, {
14
+ ref?: import("react").Ref<View> | undefined;
15
+ }>;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { ViewProps } from 'react-native';
3
+ export interface BoxContentProps extends ViewProps {
4
+ variant: 'top' | 'bottom' | 'left' | 'right';
5
+ }
6
+ declare const BoxContent: FC<BoxContentProps>;
7
+ export default BoxContent;
@@ -0,0 +1,2 @@
1
+ export { default as BoxContent } from './BoxContent';
2
+ export type { BoxContentProps } from './BoxContent';