colibri-ui 0.8.84 → 0.8.87

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 (257) hide show
  1. package/Accordion/Accordion.module.css +4 -0
  2. package/Accordion/index.js +15 -23
  3. package/Autocomplete/Autocomplete.js +101 -132
  4. package/Avatar/Avatar.module.css +6 -0
  5. package/Avatar/index.js +102 -89
  6. package/Badge/Badge.module.css +2 -1
  7. package/Badge/Control/index.js +5 -3
  8. package/Badge/index.js +16 -16
  9. package/Button/index.js +23 -20
  10. package/Button/tokens.js +2 -2
  11. package/Calendar/Calendar.js +171 -269
  12. package/Card/Card.js +26 -32
  13. package/Checkbox/index.js +46 -43
  14. package/Chip/Chip.module.css +2 -1
  15. package/Chip/index.js +15 -15
  16. package/ClickOutside/index.js +10 -13
  17. package/CodeField/CodeField.js +113 -170
  18. package/Counter/Counter.module.css +2 -1
  19. package/Counter/index.js +21 -20
  20. package/Datepicker/components/DatePicker/index.js +81 -102
  21. package/Datepicker/index.js +17 -16
  22. package/DotsLoader/index.js +23 -15
  23. package/Drawer/Drawer.js +84 -98
  24. package/Drawer/Drawer.module.css +2 -1
  25. package/Drawer/index.props.d.ts +2 -0
  26. package/Dropdown/index.js +55 -68
  27. package/Dropzone/Dropzone.js +78 -168
  28. package/Dropzone/Dropzone.module.css +2 -1
  29. package/Editable/Editable.js +44 -57
  30. package/Grid/Item/index.js +11 -13
  31. package/Grid/index.js +15 -21
  32. package/Icons/ArrowNext.js +7 -8
  33. package/Icons/Cart.js +7 -8
  34. package/Icons/Check.js +7 -8
  35. package/Icons/Chevron.js +7 -8
  36. package/Icons/Close.js +6 -6
  37. package/Icons/Copy.js +7 -8
  38. package/Icons/Cross.js +6 -6
  39. package/Icons/CrossFill.js +7 -8
  40. package/Icons/Edit.js +7 -8
  41. package/Icons/Exit.js +7 -8
  42. package/Icons/EyeClosed.js +7 -8
  43. package/Icons/EyeOpen.js +7 -8
  44. package/Icons/Help.js +6 -6
  45. package/Icons/Info.js +7 -8
  46. package/Icons/Minus.js +7 -8
  47. package/Icons/More.js +7 -8
  48. package/Icons/Plus.js +7 -8
  49. package/Icons/Setting.js +7 -8
  50. package/Icons/Shield.js +7 -8
  51. package/Icons/Trash.js +7 -8
  52. package/Icons/User.js +7 -8
  53. package/Image/Image.module.css +4 -0
  54. package/Image/index.d.ts +1 -1
  55. package/Image/index.js +44 -37
  56. package/Input/index.d.ts +1 -1
  57. package/Input/index.js +37 -25
  58. package/Input/index.props.d.ts +1 -1
  59. package/InputRadio/index.js +32 -24
  60. package/List/List.js +81 -76
  61. package/Menu/Menu.module.css +2 -1
  62. package/Menu/components/MenuItem/index.js +17 -14
  63. package/Menu/index.js +22 -23
  64. package/Modal/components/Body/index.js +9 -8
  65. package/Modal/components/Close/Close.module.css +4 -0
  66. package/Modal/components/Close/index.js +13 -14
  67. package/Modal/components/Content/index.js +5 -6
  68. package/Modal/components/Footer/index.js +5 -3
  69. package/Modal/components/Header/index.js +13 -12
  70. package/Modal/components/Title/index.js +10 -9
  71. package/Modal/context.js +3 -3
  72. package/Modal/index.js +46 -68
  73. package/MultiSelect/components/MenuOverlay/index.js +48 -61
  74. package/MultiSelect/components/MenuOverlayItem/index.js +13 -14
  75. package/MultiSelect/index.js +72 -100
  76. package/MultiSelect/index.module.css +2 -1
  77. package/MultiSelect/utils/index.js +8 -18
  78. package/NumberInput/NumberInput.js +80 -112
  79. package/Portal/index.js +6 -10
  80. package/Progress/Progress.js +45 -58
  81. package/RadioGroup/Radio.js +29 -32
  82. package/RadioGroup/index.js +43 -46
  83. package/Rating/Rating.js +50 -63
  84. package/Select/components/MenuOverlay/index.js +16 -25
  85. package/Select/components/MenuOverlayItem/index.js +13 -11
  86. package/Select/index.js +39 -48
  87. package/Select/index.module.css +2 -1
  88. package/Separator/index.js +5 -6
  89. package/Sheet/Sheet.js +98 -122
  90. package/Sheet/Sheet.module.css +4 -2
  91. package/Sheet/index.props.d.ts +2 -0
  92. package/Skeleton/index.js +25 -30
  93. package/Slider/Slider.js +83 -119
  94. package/Status/index.js +17 -18
  95. package/Switch/Switch.module.css +2 -1
  96. package/Switch/index.js +22 -15
  97. package/TabsMenu/Tab/Tab.js +14 -10
  98. package/TabsMenu/Tab/Tab.module.css +2 -1
  99. package/TabsMenu/index.js +25 -26
  100. package/TabsPanels/Panel/index.js +6 -4
  101. package/TabsPanels/index.js +13 -10
  102. package/TextArea/index.d.ts +1 -1
  103. package/TextArea/index.js +30 -19
  104. package/Theme/breakpoints.js +5 -11
  105. package/Theme/colors/theme_buenos_aires.js +14 -14
  106. package/Theme/colors/theme_jaipur.js +14 -14
  107. package/Theme/global.css +0 -1
  108. package/Theme/index.js +1 -1
  109. package/TimeSelect/Label/index.js +11 -13
  110. package/TimeSelect/helpers.js +23 -42
  111. package/TimeSelect/index.js +32 -38
  112. package/Tooltip/index.js +36 -42
  113. package/Typography/Typography.module.css +1365 -0
  114. package/Typography/index.js +24 -13
  115. package/Typography/index.props.d.ts +13 -1
  116. package/base/BaseInput/index.js +10 -8
  117. package/base/FormField/index.d.ts +1 -1
  118. package/base/FormField/index.js +27 -22
  119. package/base/FormField/index.props.d.ts +4 -0
  120. package/base/InputRoot/index.js +27 -27
  121. package/esm/Accordion/Accordion.module.css +4 -0
  122. package/esm/Accordion/index.js +15 -21
  123. package/esm/Autocomplete/Autocomplete.js +101 -130
  124. package/esm/Avatar/Avatar.module.css +6 -0
  125. package/esm/Avatar/index.js +102 -88
  126. package/esm/Badge/Badge.module.css +2 -1
  127. package/esm/Badge/Control/index.js +5 -3
  128. package/esm/Badge/index.js +16 -15
  129. package/esm/Button/index.js +23 -19
  130. package/esm/Button/tokens.js +2 -2
  131. package/esm/Calendar/Calendar.js +171 -267
  132. package/esm/Card/Card.js +26 -32
  133. package/esm/Checkbox/index.js +46 -42
  134. package/esm/Chip/Chip.module.css +2 -1
  135. package/esm/Chip/index.js +15 -14
  136. package/esm/ClickOutside/index.js +10 -13
  137. package/esm/CodeField/CodeField.js +113 -169
  138. package/esm/Counter/Counter.module.css +2 -1
  139. package/esm/Counter/index.js +21 -19
  140. package/esm/Datepicker/components/DatePicker/index.js +81 -101
  141. package/esm/Datepicker/index.js +17 -16
  142. package/esm/DotsLoader/index.js +23 -14
  143. package/esm/Drawer/Drawer.js +84 -97
  144. package/esm/Drawer/Drawer.module.css +2 -1
  145. package/esm/Drawer/index.props.d.ts +2 -0
  146. package/esm/Dropdown/index.js +55 -66
  147. package/esm/Dropzone/Dropzone.js +78 -165
  148. package/esm/Dropzone/Dropzone.module.css +2 -1
  149. package/esm/Editable/Editable.js +44 -56
  150. package/esm/Grid/Item/index.js +11 -12
  151. package/esm/Grid/index.js +15 -21
  152. package/esm/Icons/ArrowNext.js +7 -8
  153. package/esm/Icons/Cart.js +7 -8
  154. package/esm/Icons/Check.js +7 -8
  155. package/esm/Icons/Chevron.js +7 -8
  156. package/esm/Icons/Close.js +6 -6
  157. package/esm/Icons/Copy.js +7 -8
  158. package/esm/Icons/Cross.js +6 -6
  159. package/esm/Icons/CrossFill.js +7 -8
  160. package/esm/Icons/Edit.js +7 -8
  161. package/esm/Icons/Exit.js +7 -8
  162. package/esm/Icons/EyeClosed.js +7 -8
  163. package/esm/Icons/EyeOpen.js +7 -8
  164. package/esm/Icons/Help.js +6 -6
  165. package/esm/Icons/Info.js +7 -8
  166. package/esm/Icons/Minus.js +7 -8
  167. package/esm/Icons/More.js +7 -8
  168. package/esm/Icons/Plus.js +7 -8
  169. package/esm/Icons/Setting.js +7 -8
  170. package/esm/Icons/Shield.js +7 -8
  171. package/esm/Icons/Trash.js +7 -8
  172. package/esm/Icons/User.js +7 -8
  173. package/esm/Image/Image.module.css +4 -0
  174. package/esm/Image/index.d.ts +1 -1
  175. package/esm/Image/index.js +44 -36
  176. package/esm/Input/index.d.ts +1 -1
  177. package/esm/Input/index.js +38 -26
  178. package/esm/Input/index.props.d.ts +1 -1
  179. package/esm/InputRadio/index.js +32 -23
  180. package/esm/List/List.js +81 -75
  181. package/esm/Menu/Menu.module.css +2 -1
  182. package/esm/Menu/components/MenuItem/index.js +17 -13
  183. package/esm/Menu/index.js +22 -23
  184. package/esm/Modal/components/Body/index.js +9 -7
  185. package/esm/Modal/components/Close/Close.module.css +4 -0
  186. package/esm/Modal/components/Close/index.js +13 -14
  187. package/esm/Modal/components/Content/index.js +5 -6
  188. package/esm/Modal/components/Footer/index.js +5 -3
  189. package/esm/Modal/components/Header/index.js +13 -11
  190. package/esm/Modal/components/Title/index.js +10 -9
  191. package/esm/Modal/context.js +3 -3
  192. package/esm/Modal/index.js +50 -70
  193. package/esm/MultiSelect/components/MenuOverlay/index.js +48 -60
  194. package/esm/MultiSelect/components/MenuOverlayItem/index.js +13 -14
  195. package/esm/MultiSelect/index.js +72 -97
  196. package/esm/MultiSelect/index.module.css +2 -1
  197. package/esm/MultiSelect/utils/index.js +8 -14
  198. package/esm/NumberInput/NumberInput.js +80 -111
  199. package/esm/Portal/index.js +6 -9
  200. package/esm/Progress/Progress.js +45 -58
  201. package/esm/RadioGroup/Radio.js +29 -32
  202. package/esm/RadioGroup/index.js +43 -45
  203. package/esm/Rating/Rating.js +50 -63
  204. package/esm/Select/components/MenuOverlay/index.js +16 -24
  205. package/esm/Select/components/MenuOverlayItem/index.js +13 -11
  206. package/esm/Select/index.js +39 -46
  207. package/esm/Select/index.module.css +2 -1
  208. package/esm/Separator/index.js +5 -6
  209. package/esm/Sheet/Sheet.js +98 -120
  210. package/esm/Sheet/Sheet.module.css +4 -2
  211. package/esm/Sheet/index.props.d.ts +2 -0
  212. package/esm/Skeleton/index.js +25 -30
  213. package/esm/Slider/Slider.js +83 -119
  214. package/esm/Status/index.js +17 -17
  215. package/esm/Switch/Switch.module.css +2 -1
  216. package/esm/Switch/index.js +22 -14
  217. package/esm/TabsMenu/Tab/Tab.js +14 -9
  218. package/esm/TabsMenu/Tab/Tab.module.css +2 -1
  219. package/esm/TabsMenu/index.js +25 -26
  220. package/esm/TabsPanels/Panel/index.js +6 -4
  221. package/esm/TabsPanels/index.js +13 -10
  222. package/esm/TextArea/index.d.ts +1 -1
  223. package/esm/TextArea/index.js +31 -20
  224. package/esm/Theme/breakpoints.js +5 -11
  225. package/esm/Theme/colors/theme_buenos_aires.js +14 -14
  226. package/esm/Theme/colors/theme_jaipur.js +14 -14
  227. package/esm/Theme/global.css +0 -1
  228. package/esm/Theme/index.js +1 -1
  229. package/esm/TimeSelect/Label/index.js +11 -13
  230. package/esm/TimeSelect/helpers.js +22 -37
  231. package/esm/TimeSelect/index.js +32 -38
  232. package/esm/Tooltip/index.js +36 -41
  233. package/esm/Typography/Typography.module.css +1365 -0
  234. package/esm/Typography/index.js +24 -12
  235. package/esm/Typography/index.props.d.ts +13 -1
  236. package/esm/base/BaseInput/index.js +10 -8
  237. package/esm/base/FormField/index.d.ts +1 -1
  238. package/esm/base/FormField/index.js +27 -21
  239. package/esm/base/FormField/index.props.d.ts +4 -0
  240. package/esm/base/InputRoot/index.js +27 -26
  241. package/esm/helpers/date/index.js +4 -8
  242. package/esm/hooks/useMediaSizes/index.js +9 -15
  243. package/esm/hooks/useModalStack/index.js +6 -9
  244. package/esm/hooks/useOnClickOutside/index.js +6 -6
  245. package/esm/hooks/useScrollLock/index.js +10 -9
  246. package/esm/hooks/useTrapFocus/index.js +8 -10
  247. package/esm/index.d.ts +1 -1
  248. package/esm/lib/keyboard.js +2 -4
  249. package/helpers/date/index.js +21 -32
  250. package/hooks/useMediaSizes/index.js +9 -15
  251. package/hooks/useModalStack/index.js +6 -9
  252. package/hooks/useOnClickOutside/index.js +6 -6
  253. package/hooks/useScrollLock/index.js +10 -9
  254. package/hooks/useTrapFocus/index.js +8 -10
  255. package/index.d.ts +1 -1
  256. package/lib/keyboard.js +2 -4
  257. package/package.json +5 -1
@@ -1,29 +1,33 @@
1
1
  import { __rest } from 'tslib';
2
- import React from 'react';
2
+ import React, { useId } from 'react';
3
3
  import TextareaAutosize from 'react-textarea-autosize';
4
4
  import clsx from 'clsx';
5
5
  import { FormField } from '../base/FormField/index.js';
6
6
  import { InputRoot } from '../base/InputRoot/index.js';
7
7
  import styles from './TextArea.module.css';
8
8
 
9
- var TextArea = function TextArea(_a) {
10
- var className = _a.className,
11
- _a$value = _a.value,
12
- value = _a$value === void 0 ? "" : _a$value,
13
- _a$minRows = _a.minRows,
14
- minRows = _a$minRows === void 0 ? 3 : _a$minRows,
15
- _a$maxRows = _a.maxRows,
16
- maxRows = _a$maxRows === void 0 ? 6 : _a$maxRows,
17
- onChange = _a.onChange,
18
- label = _a.label,
19
- required = _a.required,
20
- hasError = _a.hasError,
21
- hint = _a.hint,
22
- disabled = _a.disabled,
23
- inputRef = _a.inputRef,
24
- ref = _a.ref,
25
- props = __rest(_a, ["className", "value", "minRows", "maxRows", "onChange", "label", "required", "hasError", "hint", "disabled", "inputRef", "ref"]);
26
- var onChangeHandler = function onChangeHandler(event) {
9
+ const TextArea = _a => {
10
+ var _b;
11
+ var {
12
+ className,
13
+ value = "",
14
+ minRows = 3,
15
+ maxRows = 6,
16
+ onChange,
17
+ label,
18
+ required,
19
+ hasError,
20
+ hint,
21
+ disabled,
22
+ inputRef,
23
+ ref,
24
+ id
25
+ } = _a,
26
+ props = __rest(_a, ["className", "value", "minRows", "maxRows", "onChange", "label", "required", "hasError", "hint", "disabled", "inputRef", "ref", "id"]);
27
+ const generatedId = useId();
28
+ const textareaId = id !== null && id !== void 0 ? id : generatedId;
29
+ const hintId = hint ? `${textareaId}-hint` : undefined;
30
+ const onChangeHandler = event => {
27
31
  if (onChange) onChange(event.target.value, event);
28
32
  };
29
33
  return /*#__PURE__*/React.createElement(FormField, {
@@ -31,7 +35,9 @@ var TextArea = function TextArea(_a) {
31
35
  className: clsx(className),
32
36
  required: required,
33
37
  label: label,
38
+ htmlFor: textareaId,
34
39
  hint: hint,
40
+ hintId: hintId,
35
41
  hasError: hasError
36
42
  }, /*#__PURE__*/React.createElement(InputRoot, {
37
43
  disabled: !!disabled,
@@ -45,7 +51,12 @@ var TextArea = function TextArea(_a) {
45
51
  value: value,
46
52
  className: clsx(styles.textarea, className),
47
53
  onChange: onChangeHandler
48
- }, props))));
54
+ }, props, {
55
+ id: textareaId,
56
+ required: required,
57
+ "aria-invalid": (_b = props["aria-invalid"]) !== null && _b !== void 0 ? _b : hasError || undefined,
58
+ "aria-describedby": clsx(props["aria-describedby"], hintId) || undefined
59
+ }))));
49
60
  };
50
61
 
51
62
  export { TextArea };
@@ -2,7 +2,7 @@
2
2
  * Breakpoints shared with the apps that use the kit.
3
3
  * The values match the Tailwind CSS defaults on purpose; Tailwind is not a dependency.
4
4
  */
5
- var BREAKPOINTS = {
5
+ const BREAKPOINTS = {
6
6
  sm: "40rem",
7
7
  md: "48rem",
8
8
  lg: "64rem",
@@ -10,16 +10,10 @@ var BREAKPOINTS = {
10
10
  "2xl": "96rem"
11
11
  };
12
12
  /** Bare media queries, usable in `window.matchMedia`. Prefix with `@media ` in CSS-in-JS. */
13
- var media = {
14
- up: function up(name) {
15
- return "(width >= ".concat(BREAKPOINTS[name], ")");
16
- },
17
- down: function down(name) {
18
- return "(width < ".concat(BREAKPOINTS[name], ")");
19
- },
20
- between: function between(from, to) {
21
- return "(".concat(BREAKPOINTS[from], " <= width < ").concat(BREAKPOINTS[to], ")");
22
- }
13
+ const media = {
14
+ up: name => `(width >= ${BREAKPOINTS[name]})`,
15
+ down: name => `(width < ${BREAKPOINTS[name]})`,
16
+ between: (from, to) => `(${BREAKPOINTS[from]} <= width < ${BREAKPOINTS[to]})`
23
17
  };
24
18
 
25
19
  export { BREAKPOINTS, media };
@@ -1,11 +1,11 @@
1
- var BrandBA = {
1
+ const BrandBA = {
2
2
  BRAND_BA_LIME: "#9FE870",
3
3
  BRAND_BA_FOREST: "#163300",
4
4
  BRAND_BA_INK: "#0D1F12",
5
5
  BRAND_BA_CANVAS: "#F5F7F2",
6
6
  BRAND_BA_WHITE: "#FFFFFF"
7
7
  };
8
- var NeutralBA = {
8
+ const NeutralBA = {
9
9
  NEUTRAL_BA_0: "#FFFFFF",
10
10
  NEUTRAL_BA_50: "#F5F7F2",
11
11
  NEUTRAL_BA_100: "#EDF0EA",
@@ -19,7 +19,7 @@ var NeutralBA = {
19
19
  NEUTRAL_BA_900: "#203025",
20
20
  NEUTRAL_BA_950: "#0D1F12"
21
21
  };
22
- var LimeBA = {
22
+ const LimeBA = {
23
23
  LIME_BA_50: "#F4FFEC",
24
24
  LIME_BA_100: "#E4FFD2",
25
25
  LIME_BA_200: "#D0FBAF",
@@ -32,7 +32,7 @@ var LimeBA = {
32
32
  LIME_BA_900: "#163300",
33
33
  LIME_BA_950: "#0D1F12"
34
34
  };
35
- var BlueBA = {
35
+ const BlueBA = {
36
36
  BLUE_BA_50: "#EFFBFB",
37
37
  BLUE_BA_100: "#DDF7F7",
38
38
  BLUE_BA_200: "#BCECEF",
@@ -44,7 +44,7 @@ var BlueBA = {
44
44
  BLUE_BA_800: "#185159",
45
45
  BLUE_BA_900: "#123B40"
46
46
  };
47
- var PinkBA = {
47
+ const PinkBA = {
48
48
  PINK_BA_50: "#FFF5F8",
49
49
  PINK_BA_100: "#FFE7F0",
50
50
  PINK_BA_200: "#FFD2E3",
@@ -56,7 +56,7 @@ var PinkBA = {
56
56
  PINK_BA_800: "#702645",
57
57
  PINK_BA_900: "#541B35"
58
58
  };
59
- var OrangeBA = {
59
+ const OrangeBA = {
60
60
  ORANGE_BA_50: "#FFF7F1",
61
61
  ORANGE_BA_100: "#FFE8D7",
62
62
  ORANGE_BA_200: "#FFD0AD",
@@ -68,7 +68,7 @@ var OrangeBA = {
68
68
  ORANGE_BA_800: "#6D2E13",
69
69
  ORANGE_BA_900: "#542610"
70
70
  };
71
- var YellowBA = {
71
+ const YellowBA = {
72
72
  YELLOW_BA_50: "#FFFBEB",
73
73
  YELLOW_BA_100: "#FFF4BD",
74
74
  YELLOW_BA_200: "#FFE982",
@@ -80,7 +80,7 @@ var YellowBA = {
80
80
  YELLOW_BA_800: "#59470C",
81
81
  YELLOW_BA_900: "#3C3609"
82
82
  };
83
- var PurpleBA = {
83
+ const PurpleBA = {
84
84
  PURPLE_BA_50: "#F8F6FF",
85
85
  PURPLE_BA_100: "#EAE4FF",
86
86
  PURPLE_BA_200: "#D6CAFF",
@@ -92,7 +92,7 @@ var PurpleBA = {
92
92
  PURPLE_BA_800: "#402E78",
93
93
  PURPLE_BA_900: "#30215C"
94
94
  };
95
- var StatusBA = {
95
+ const StatusBA = {
96
96
  STATUS_BA_SUCCESS: "#244F18",
97
97
  STATUS_BA_SUCCESS_BG: "#E4FFD2",
98
98
  STATUS_BA_SUCCESS_BG_HOVER: LimeBA.LIME_BA_200,
@@ -105,7 +105,7 @@ var StatusBA = {
105
105
  STATUS_BA_INFO: "#123B40",
106
106
  STATUS_BA_INFO_BG: "#DDF7F7"
107
107
  };
108
- var PromoBA = {
108
+ const PromoBA = {
109
109
  PROMO_SILVER: "#EDF0EA",
110
110
  PROMO_GOLD: "#FFF4BD",
111
111
  PROMO_ASPHALT: "#E2E7DF",
@@ -115,27 +115,27 @@ var PromoBA = {
115
115
  PROMO_SKY: "#DDF7F7",
116
116
  PROMO_NEON: "#EAE4FF"
117
117
  };
118
- var PrimaryBA = {
118
+ const PrimaryBA = {
119
119
  PRIMARY_BA_1: LimeBA.LIME_BA_100,
120
120
  PRIMARY_BA_2: LimeBA.LIME_BA_200,
121
121
  PRIMARY_BA_3: LimeBA.LIME_BA_300,
122
122
  PRIMARY_BA_4: LimeBA.LIME_BA_400,
123
123
  PRIMARY_BA_5: LimeBA.LIME_BA_500
124
124
  };
125
- var SecondaryBA = {
125
+ const SecondaryBA = {
126
126
  SECONDARY_BA_1: NeutralBA.NEUTRAL_BA_100,
127
127
  SECONDARY_BA_2: NeutralBA.NEUTRAL_BA_300,
128
128
  SECONDARY_BA_3: NeutralBA.NEUTRAL_BA_700,
129
129
  SECONDARY_BA_4: BrandBA.BRAND_BA_FOREST,
130
130
  SECONDARY_BA_5: BrandBA.BRAND_BA_INK
131
131
  };
132
- var TretiaryBA = {
132
+ const TretiaryBA = {
133
133
  TRETIARY_BA_1: BlueBA.BLUE_BA_50,
134
134
  TRETIARY_BA_2: BlueBA.BLUE_BA_100,
135
135
  TRETIARY_BA_3: BlueBA.BLUE_BA_300,
136
136
  TRETIARY_BA_4: BlueBA.BLUE_BA_500,
137
137
  TRETIARY_BA_5: BlueBA.BLUE_BA_700
138
138
  };
139
- var Color = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, BrandBA), NeutralBA), LimeBA), BlueBA), PinkBA), OrangeBA), YellowBA), PurpleBA), StatusBA), PromoBA), PrimaryBA), SecondaryBA), TretiaryBA);
139
+ const Color = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, BrandBA), NeutralBA), LimeBA), BlueBA), PinkBA), OrangeBA), YellowBA), PurpleBA), StatusBA), PromoBA), PrimaryBA), SecondaryBA), TretiaryBA);
140
140
 
141
141
  export { BlueBA, BrandBA, LimeBA, NeutralBA, OrangeBA, PinkBA, PrimaryBA, PromoBA, PurpleBA, SecondaryBA, StatusBA, TretiaryBA, YellowBA, Color as default };
@@ -1,11 +1,11 @@
1
- var BrandJP = {
1
+ const BrandJP = {
2
2
  BRAND_JP_PINK: "#FFA8CD",
3
3
  BRAND_JP_EGGPLANT: "#2C2242",
4
4
  BRAND_JP_INK: "#0B051D",
5
5
  BRAND_JP_CANVAS: "#F9F8F5",
6
6
  BRAND_JP_WHITE: "#FFFFFF"
7
7
  };
8
- var NeutralJP = {
8
+ const NeutralJP = {
9
9
  NEUTRAL_JP_0: "#FFFFFF",
10
10
  NEUTRAL_JP_50: "#F9F8F5",
11
11
  NEUTRAL_JP_100: "#F2F1EE",
@@ -19,7 +19,7 @@ var NeutralJP = {
19
19
  NEUTRAL_JP_900: "#211A31",
20
20
  NEUTRAL_JP_950: "#0B051D"
21
21
  };
22
- var PinkJP = {
22
+ const PinkJP = {
23
23
  PINK_JP_50: "#FFF5F9",
24
24
  PINK_JP_100: "#FFE8F2",
25
25
  PINK_JP_200: "#FFD3E5",
@@ -32,7 +32,7 @@ var PinkJP = {
32
32
  PINK_JP_900: "#5C2042",
33
33
  PINK_JP_950: "#351126"
34
34
  };
35
- var PurpleJP = {
35
+ const PurpleJP = {
36
36
  PURPLE_JP_50: "#F8F5FA",
37
37
  PURPLE_JP_100: "#EEE7F1",
38
38
  PURPLE_JP_200: "#DED1E3",
@@ -45,7 +45,7 @@ var PurpleJP = {
45
45
  PURPLE_JP_900: "#2C2242",
46
46
  PURPLE_JP_950: "#171022"
47
47
  };
48
- var LimeJP = {
48
+ const LimeJP = {
49
49
  LIME_JP_50: "#FBFFF2",
50
50
  LIME_JP_100: "#F5FFDD",
51
51
  LIME_JP_200: "#EEFFC6",
@@ -57,7 +57,7 @@ var LimeJP = {
57
57
  LIME_JP_800: "#526820",
58
58
  LIME_JP_900: "#374715"
59
59
  };
60
- var BlueJP = {
60
+ const BlueJP = {
61
61
  BLUE_JP_50: "#F3F7FF",
62
62
  BLUE_JP_100: "#E4EDFF",
63
63
  BLUE_JP_200: "#CDDCFF",
@@ -69,7 +69,7 @@ var BlueJP = {
69
69
  BLUE_JP_800: "#303F6C",
70
70
  BLUE_JP_900: "#252F50"
71
71
  };
72
- var OrangeJP = {
72
+ const OrangeJP = {
73
73
  ORANGE_JP_50: "#FFF8F3",
74
74
  ORANGE_JP_100: "#FFEBDD",
75
75
  ORANGE_JP_200: "#FFD8BE",
@@ -81,7 +81,7 @@ var OrangeJP = {
81
81
  ORANGE_JP_800: "#713721",
82
82
  ORANGE_JP_900: "#51291B"
83
83
  };
84
- var YellowJP = {
84
+ const YellowJP = {
85
85
  YELLOW_JP_50: "#FFFDF2",
86
86
  YELLOW_JP_100: "#FFF8D8",
87
87
  YELLOW_JP_200: "#FFF0AD",
@@ -93,7 +93,7 @@ var YellowJP = {
93
93
  YELLOW_JP_800: "#624D15",
94
94
  YELLOW_JP_900: "#443612"
95
95
  };
96
- var StatusJP = {
96
+ const StatusJP = {
97
97
  STATUS_JP_SUCCESS: "#46591B",
98
98
  STATUS_JP_SUCCESS_BG: "#E6FFA9",
99
99
  STATUS_JP_SUCCESS_BG_HOVER: LimeJP.LIME_JP_200,
@@ -106,7 +106,7 @@ var StatusJP = {
106
106
  STATUS_JP_INFO: "#303F6C",
107
107
  STATUS_JP_INFO_BG: "#E4EDFF"
108
108
  };
109
- var PromoJP = {
109
+ const PromoJP = {
110
110
  PROMO_SILVER: "#F2F1EE",
111
111
  PROMO_GOLD: "#FFF0AD",
112
112
  PROMO_ASPHALT: "#E4E3DF",
@@ -116,27 +116,27 @@ var PromoJP = {
116
116
  PROMO_SKY: "#E4EDFF",
117
117
  PROMO_NEON: "#EEE7F1"
118
118
  };
119
- var PrimaryJP = {
119
+ const PrimaryJP = {
120
120
  PRIMARY_JP_1: PinkJP.PINK_JP_100,
121
121
  PRIMARY_JP_2: PinkJP.PINK_JP_200,
122
122
  PRIMARY_JP_3: PinkJP.PINK_JP_300,
123
123
  PRIMARY_JP_4: PinkJP.PINK_JP_400,
124
124
  PRIMARY_JP_5: PinkJP.PINK_JP_500
125
125
  };
126
- var SecondaryJP = {
126
+ const SecondaryJP = {
127
127
  SECONDARY_JP_1: NeutralJP.NEUTRAL_JP_100,
128
128
  SECONDARY_JP_2: NeutralJP.NEUTRAL_JP_300,
129
129
  SECONDARY_JP_3: NeutralJP.NEUTRAL_JP_700,
130
130
  SECONDARY_JP_4: BrandJP.BRAND_JP_EGGPLANT,
131
131
  SECONDARY_JP_5: BrandJP.BRAND_JP_INK
132
132
  };
133
- var TretiaryJP = {
133
+ const TretiaryJP = {
134
134
  TRETIARY_JP_1: PurpleJP.PURPLE_JP_50,
135
135
  TRETIARY_JP_2: PurpleJP.PURPLE_JP_100,
136
136
  TRETIARY_JP_3: PurpleJP.PURPLE_JP_300,
137
137
  TRETIARY_JP_4: PurpleJP.PURPLE_JP_500,
138
138
  TRETIARY_JP_5: PurpleJP.PURPLE_JP_700
139
139
  };
140
- var Color = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, BrandJP), NeutralJP), PinkJP), PurpleJP), LimeJP), BlueJP), OrangeJP), YellowJP), StatusJP), PromoJP), PrimaryJP), SecondaryJP), TretiaryJP);
140
+ const Color = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, BrandJP), NeutralJP), PinkJP), PurpleJP), LimeJP), BlueJP), OrangeJP), YellowJP), StatusJP), PromoJP), PrimaryJP), SecondaryJP), TretiaryJP);
141
141
 
142
142
  export { BlueJP, BrandJP, LimeJP, NeutralJP, OrangeJP, PinkJP, PrimaryJP, PromoJP, PurpleJP, SecondaryJP, StatusJP, TretiaryJP, YellowJP, Color as default };
@@ -19,7 +19,6 @@
19
19
  border: none;
20
20
  box-sizing: border-box;
21
21
  margin: 0;
22
- outline: none;
23
22
  padding: 0;
24
23
  text-decoration: none;
25
24
  }
@@ -3,7 +3,7 @@ import theme_jaipur from './themes/jaipur.js';
3
3
  import THEME_BA from './themes/buenos_aires.js';
4
4
  export { BREAKPOINTS, media } from './breakpoints.js';
5
5
 
6
- var THEMES = {
6
+ const THEMES = {
7
7
  JAIPUR: Object.assign(Object.assign({}, theme_jaipur), BUTTON_TOKENS),
8
8
  BA: Object.assign(Object.assign({}, THEME_BA), BUTTON_TOKENS)
9
9
  };
@@ -1,17 +1,15 @@
1
1
  import React from 'react';
2
2
 
3
- var OptionLabel = function OptionLabel(_ref) {
4
- var time = _ref.time,
5
- onClick = _ref.onClick,
6
- onMouseEnter = _ref.onMouseEnter;
7
- return (
8
- /*#__PURE__*/
9
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
10
- React.createElement("span", {
11
- onClick: onClick,
12
- onMouseEnter: onMouseEnter
13
- }, time)
14
- );
15
- };
3
+ const OptionLabel = ({
4
+ time,
5
+ onClick,
6
+ onMouseEnter
7
+ }) => (
8
+ /*#__PURE__*/
9
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
10
+ React.createElement("span", {
11
+ onClick: onClick,
12
+ onMouseEnter: onMouseEnter
13
+ }, time));
16
14
 
17
15
  export { OptionLabel };
@@ -1,54 +1,39 @@
1
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
1
  import { addMinutes, parse, isBefore, format } from 'date-fns';
3
2
 
4
- var day = new Date();
3
+ const day = new Date();
5
4
  day.setHours(24, 0, 0, 0);
6
- var formatTime = function formatTime(date) {
7
- return format(date, "HH:mm");
8
- };
9
- var generateSuggest = function generateSuggest() {
10
- var interval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 15;
11
- return new Array(24 * 60 / interval).fill(null).map(function (_, index) {
12
- var date = addMinutes(day, index * interval);
13
- return {
14
- time: formatTime(date)
15
- };
16
- });
17
- };
18
- var checkIsBeforeNow = function checkIsBeforeNow(time, currentDate) {
5
+ const formatTime = date => format(date, "HH:mm");
6
+ const generateSuggest = (interval = 15) => new Array(24 * 60 / interval).fill(null).map((_, index) => {
7
+ const date = addMinutes(day, index * interval);
8
+ return {
9
+ time: formatTime(date)
10
+ };
11
+ });
12
+ const checkIsBeforeNow = (time, currentDate) => {
19
13
  if (!currentDate) return false;
20
- var baseDate = new Date(currentDate);
14
+ const baseDate = new Date(currentDate);
21
15
  baseDate.setHours(0, 0, 0, 0);
22
- var parsedTime = parse(time, "HH:mm", baseDate);
16
+ const parsedTime = parse(time, "HH:mm", baseDate);
23
17
  return isBefore(parsedTime, currentDate);
24
18
  };
25
- var checkIsBeforeSelectedDate = function checkIsBeforeSelectedDate(time, interval, date) {
19
+ const checkIsBeforeSelectedDate = (time, interval, date) => {
26
20
  if (date) {
27
- var selectedDate = new Date(date);
21
+ const selectedDate = new Date(date);
28
22
  selectedDate.setMinutes(selectedDate.getMinutes() + interval);
29
- var baseDate = new Date(date);
23
+ const baseDate = new Date(date);
30
24
  baseDate.setHours(0, 0, 0, 0);
31
- var parsedTime = parse(time, "HH:mm", baseDate);
25
+ const parsedTime = parse(time, "HH:mm", baseDate);
32
26
  return isBefore(parsedTime, selectedDate);
33
27
  }
34
28
  return false;
35
29
  };
36
- var isTimeInRange = function isTimeInRange(timeString, range) {
37
- var _timeString$split$map = timeString.split(":").map(Number),
38
- _timeString$split$map2 = _slicedToArray(_timeString$split$map, 2),
39
- hours = _timeString$split$map2[0],
40
- minutes = _timeString$split$map2[1];
41
- var totalMinutes = hours * 60 + minutes;
42
- var _range$start$split$ma = range.start.split(":").map(Number),
43
- _range$start$split$ma2 = _slicedToArray(_range$start$split$ma, 2),
44
- startHours = _range$start$split$ma2[0],
45
- startMinutes = _range$start$split$ma2[1];
46
- var startTotalMinutes = startHours * 60 + startMinutes;
47
- var _range$end$split$map = range.end.split(":").map(Number),
48
- _range$end$split$map2 = _slicedToArray(_range$end$split$map, 2),
49
- endHours = _range$end$split$map2[0],
50
- endMinutes = _range$end$split$map2[1];
51
- var endTotalMinutes = endHours * 60 + endMinutes;
30
+ const isTimeInRange = (timeString, range) => {
31
+ const [hours, minutes] = timeString.split(":").map(Number);
32
+ const totalMinutes = hours * 60 + minutes;
33
+ const [startHours, startMinutes] = range.start.split(":").map(Number);
34
+ const startTotalMinutes = startHours * 60 + startMinutes;
35
+ const [endHours, endMinutes] = range.end.split(":").map(Number);
36
+ const endTotalMinutes = endHours * 60 + endMinutes;
52
37
  return totalMinutes >= startTotalMinutes && totalMinutes <= endTotalMinutes;
53
38
  };
54
39
 
@@ -3,45 +3,39 @@ import { Select } from '../Select/index.js';
3
3
  import { generateSuggest, isTimeInRange, checkIsBeforeSelectedDate, checkIsBeforeNow } from './helpers.js';
4
4
  import { OptionLabel } from './Label/index.js';
5
5
 
6
- var TimeSelect = function TimeSelect(_ref) {
7
- var value = _ref.value,
8
- name = _ref.name,
9
- className = _ref.className,
10
- currentDate = _ref.currentDate,
11
- selectedDate = _ref.selectedDate,
12
- label = _ref.label,
13
- _ref$interval = _ref.interval,
14
- interval = _ref$interval === void 0 ? 15 : _ref$interval,
15
- onChange = _ref.onChange,
16
- disabled = _ref.disabled,
17
- allowedTimeRange = _ref.allowedTimeRange,
18
- placeholder = _ref.placeholder,
19
- fullWidth = _ref.fullWidth,
20
- customInputRoot = _ref.customInputRoot,
21
- fontSize = _ref.fontSize,
22
- required = _ref.required,
23
- size = _ref.size,
24
- zIndex = _ref.zIndex,
25
- hasError = _ref.hasError,
26
- hint = _ref.hint;
27
- var baseOptions = useMemo(function () {
28
- return generateSuggest(interval).map(function (item) {
29
- return {
30
- value: item.time,
31
- label: /*#__PURE__*/React.createElement(OptionLabel, {
32
- time: item.time
33
- })
34
- };
6
+ const TimeSelect = ({
7
+ value,
8
+ name,
9
+ className,
10
+ currentDate,
11
+ selectedDate,
12
+ label,
13
+ interval = 15,
14
+ onChange,
15
+ disabled,
16
+ allowedTimeRange,
17
+ placeholder,
18
+ fullWidth,
19
+ customInputRoot,
20
+ fontSize,
21
+ required,
22
+ size,
23
+ zIndex,
24
+ hasError,
25
+ hint
26
+ }) => {
27
+ const baseOptions = useMemo(() => generateSuggest(interval).map(item => ({
28
+ value: item.time,
29
+ label: /*#__PURE__*/React.createElement(OptionLabel, {
30
+ time: item.time
31
+ })
32
+ })), [interval]);
33
+ const options = useMemo(() => baseOptions.map(option => {
34
+ const isDisabled = !!allowedTimeRange && !isTimeInRange(option.value, allowedTimeRange) || !!selectedDate && checkIsBeforeSelectedDate(option.value, interval, selectedDate) || !!currentDate && checkIsBeforeNow(option.value, currentDate);
35
+ return Object.assign(Object.assign({}, option), {
36
+ disabled: isDisabled
35
37
  });
36
- }, [interval]);
37
- var options = useMemo(function () {
38
- return baseOptions.map(function (option) {
39
- var isDisabled = !!allowedTimeRange && !isTimeInRange(option.value, allowedTimeRange) || !!selectedDate && checkIsBeforeSelectedDate(option.value, interval, selectedDate) || !!currentDate && checkIsBeforeNow(option.value, currentDate);
40
- return Object.assign(Object.assign({}, option), {
41
- disabled: isDisabled
42
- });
43
- });
44
- }, [baseOptions, currentDate, selectedDate, allowedTimeRange, interval]);
38
+ }), [baseOptions, currentDate, selectedDate, allowedTimeRange, interval]);
45
39
  return /*#__PURE__*/React.createElement(Select, {
46
40
  className: className,
47
41
  customInputRoot: customInputRoot,
@@ -1,62 +1,57 @@
1
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
1
  import React, { useState, useRef, useMemo, cloneElement } from 'react';
3
2
  import { useFloating, offset, flip, shift, arrow, useHover, useDismiss, useRole, useInteractions, FloatingPortal, FloatingArrow } from '@floating-ui/react';
4
3
  import clsx from 'clsx';
5
4
  import styles from './Tooltip.module.css';
6
5
 
7
- var Tooltip = function Tooltip(_ref) {
8
- var children = _ref.children,
9
- content = _ref.content,
10
- _ref$zIndex = _ref.zIndex,
11
- zIndex = _ref$zIndex === void 0 ? 1000 : _ref$zIndex,
12
- _ref$withTail = _ref.withTail,
13
- withTail = _ref$withTail === void 0 ? false : _ref$withTail,
14
- _ref$placement = _ref.placement,
15
- placement = _ref$placement === void 0 ? "bottom" : _ref$placement,
16
- _ref$strategy = _ref.strategy,
17
- strategy = _ref$strategy === void 0 ? "absolute" : _ref$strategy,
18
- className = _ref.className;
19
- var _useState = useState(false),
20
- _useState2 = _slicedToArray(_useState, 2),
21
- isOpen = _useState2[0],
22
- setIsOpen = _useState2[1];
23
- var arrowRef = useRef(null);
24
- var _useFloating = useFloating({
25
- placement: placement,
26
- strategy: strategy,
27
- open: isOpen,
28
- onOpenChange: setIsOpen,
29
- middleware: [offset(8), flip(), shift({
30
- padding: 8
31
- }), arrow({
32
- element: arrowRef
33
- })]
34
- }),
35
- refs = _useFloating.refs,
36
- context = _useFloating.context,
37
- floatingStyles = _useFloating.floatingStyles;
38
- var hover = useHover(context, {
6
+ const Tooltip = ({
7
+ children,
8
+ content,
9
+ zIndex = 1000,
10
+ withTail = false,
11
+ placement = "bottom",
12
+ strategy = "absolute",
13
+ className
14
+ }) => {
15
+ const [isOpen, setIsOpen] = useState(false);
16
+ const arrowRef = useRef(null);
17
+ const {
18
+ refs,
19
+ context,
20
+ floatingStyles
21
+ } = useFloating({
22
+ placement,
23
+ strategy,
24
+ open: isOpen,
25
+ onOpenChange: setIsOpen,
26
+ middleware: [offset(8), flip(), shift({
27
+ padding: 8
28
+ }), arrow({
29
+ element: arrowRef
30
+ })]
31
+ });
32
+ const hover = useHover(context, {
39
33
  move: false,
40
34
  delay: {
41
35
  open: 100,
42
36
  close: 100
43
37
  }
44
38
  });
45
- var dismiss = useDismiss(context);
46
- var role = useRole(context, {
39
+ const dismiss = useDismiss(context);
40
+ const role = useRole(context, {
47
41
  role: "tooltip"
48
42
  });
49
- var _useInteractions = useInteractions([hover, dismiss, role]),
50
- getReferenceProps = _useInteractions.getReferenceProps,
51
- getFloatingProps = _useInteractions.getFloatingProps;
52
- var reference = useMemo(function () {
43
+ const {
44
+ getReferenceProps,
45
+ getFloatingProps
46
+ } = useInteractions([hover, dismiss, role]);
47
+ const reference = useMemo(() => {
53
48
  if (!children) return null;
54
49
  if (typeof children === "string") {
55
50
  return /*#__PURE__*/React.createElement("span", null, children);
56
51
  }
57
52
  return children;
58
53
  }, [children]);
59
- var trigger = reference ? /*#__PURE__*/cloneElement(reference, Object.assign({
54
+ const trigger = reference ? /*#__PURE__*/cloneElement(reference, Object.assign({
60
55
  ref: refs.setReference
61
56
  }, getReferenceProps())) : null;
62
57
  return /*#__PURE__*/React.createElement(React.Fragment, null, trigger, isOpen && (/*#__PURE__*/React.createElement(FloatingPortal, null, /*#__PURE__*/React.createElement("div", Object.assign({
@@ -64,7 +59,7 @@ var Tooltip = function Tooltip(_ref) {
64
59
  }, getFloatingProps(), {
65
60
  className: clsx(styles.tooltip, className),
66
61
  style: Object.assign(Object.assign({}, floatingStyles), {
67
- zIndex: zIndex
62
+ zIndex
68
63
  })
69
64
  }), /*#__PURE__*/React.createElement("div", {
70
65
  className: styles.content