@telefonica/mistica 12.11.1 → 12.13.0

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 (337) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/avatar.css-mistica.js +2 -2
  3. package/dist/avatar.d.ts +3 -2
  4. package/dist/avatar.js +72 -17
  5. package/dist/avatar.js.flow +2 -1
  6. package/dist/badge.css-mistica.js +4 -4
  7. package/dist/badge.d.ts +2 -0
  8. package/dist/badge.js +49 -8
  9. package/dist/badge.js.flow +2 -0
  10. package/dist/boxed.js +5 -5
  11. package/dist/button-group.css-mistica.js +1 -1
  12. package/dist/button-group.js +7 -7
  13. package/dist/button-layout.css-mistica.js +12 -12
  14. package/dist/button-layout.js +1 -1
  15. package/dist/button.css-mistica.js +26 -26
  16. package/dist/button.js +127 -77
  17. package/dist/callout.css-mistica.js +2 -2
  18. package/dist/callout.d.ts +2 -1
  19. package/dist/callout.js +68 -16
  20. package/dist/callout.js.flow +2 -1
  21. package/dist/card.css-mistica.js +5 -5
  22. package/dist/card.js +47 -41
  23. package/dist/carousel.css-mistica.js +23 -25
  24. package/dist/carousel.css.d.ts +1 -0
  25. package/dist/carousel.css.js.flow +4 -0
  26. package/dist/carousel.d.ts +7 -1
  27. package/dist/carousel.js +237 -209
  28. package/dist/carousel.js.flow +9 -1
  29. package/dist/checkbox.css-mistica.js +6 -6
  30. package/dist/checkbox.js +1 -1
  31. package/dist/chip.css-mistica.js +2 -2
  32. package/dist/chip.d.ts +7 -11
  33. package/dist/chip.js +65 -22
  34. package/dist/chip.js.flow +11 -6
  35. package/dist/circle.css-mistica.js +1 -1
  36. package/dist/credit-card-number-field.css-mistica.js +3 -3
  37. package/dist/cvv-field.css-mistica.js +1 -1
  38. package/dist/date-time-picker.js +2 -2
  39. package/dist/desktop-container-type-context.js +14 -4
  40. package/dist/dialog.css-mistica.js +6 -6
  41. package/dist/dialog.d.ts +2 -10
  42. package/dist/dialog.js +1 -0
  43. package/dist/dialog.js.flow +6 -4
  44. package/dist/double-field.css-mistica.js +5 -4
  45. package/dist/empty-state-card.css-mistica.js +1 -1
  46. package/dist/empty-state.css-mistica.js +2 -2
  47. package/dist/empty-state.js +5 -5
  48. package/dist/fade-in.d.ts +2 -0
  49. package/dist/fade-in.js +59 -6
  50. package/dist/fade-in.js.flow +2 -0
  51. package/dist/feedback.css-mistica.js +1 -1
  52. package/dist/feedback.js +130 -115
  53. package/dist/fixed-footer-layout.css-mistica.js +36 -0
  54. package/dist/fixed-footer-layout.css.d.ts +9 -0
  55. package/dist/fixed-footer-layout.css.js.flow +17 -0
  56. package/dist/fixed-footer-layout.css.ts.vanilla.js +11 -0
  57. package/dist/fixed-footer-layout.js +35 -84
  58. package/dist/header.js +99 -129
  59. package/dist/highlighted-card.css-mistica.js +5 -5
  60. package/dist/highlighted-card.d.ts +1 -1
  61. package/dist/highlighted-card.js +20 -15
  62. package/dist/highlighted-card.js.flow +1 -1
  63. package/dist/icon-button.css-mistica.js +13 -0
  64. package/dist/icon-button.css.d.ts +1 -0
  65. package/dist/icon-button.css.js.flow +3 -0
  66. package/dist/icon-button.css.ts.vanilla.js +11 -0
  67. package/dist/icon-button.d.ts +2 -1
  68. package/dist/icon-button.js +51 -28
  69. package/dist/icon-button.js.flow +2 -1
  70. package/dist/icons/icon-error.css-mistica.js +20 -0
  71. package/dist/icons/icon-error.css.d.ts +2 -0
  72. package/dist/icons/icon-error.css.js.flow +4 -0
  73. package/dist/icons/icon-error.css.ts.vanilla.js +11 -0
  74. package/dist/icons/icon-error.js +22 -33
  75. package/dist/icons/icon-info.js +16 -28
  76. package/dist/icons/icon-success-vivo.js +10 -20
  77. package/dist/icons/icon-success.js +28 -44
  78. package/dist/image.css-mistica.js +3 -3
  79. package/dist/index.d.ts +2 -0
  80. package/dist/index.js +8 -0
  81. package/dist/index.js.flow +2 -0
  82. package/dist/list.css-mistica.js +7 -7
  83. package/dist/list.js +112 -71
  84. package/dist/loading-bar.css-mistica.js +6 -6
  85. package/dist/loading-bar.d.ts +2 -0
  86. package/dist/loading-bar.js +60 -6
  87. package/dist/loading-bar.js.flow +5 -1
  88. package/dist/maybe-dismissable.css-mistica.js +24 -0
  89. package/dist/maybe-dismissable.css.d.ts +3 -0
  90. package/dist/maybe-dismissable.css.js.flow +5 -0
  91. package/dist/maybe-dismissable.css.ts.vanilla.js +11 -0
  92. package/dist/maybe-dismissable.js +16 -51
  93. package/dist/media-queries.css-mistica.js +37 -5
  94. package/dist/menu.css-mistica.js +34 -0
  95. package/dist/menu.css.d.ts +11 -0
  96. package/dist/menu.css.js.flow +19 -0
  97. package/dist/menu.css.ts.vanilla.js +11 -0
  98. package/dist/menu.d.ts +2 -0
  99. package/dist/menu.js +53 -99
  100. package/dist/menu.js.flow +2 -0
  101. package/dist/navigation-bar.css-mistica.js +79 -0
  102. package/dist/navigation-bar.css.d.ts +17 -0
  103. package/dist/navigation-bar.css.js.flow +26 -0
  104. package/dist/navigation-bar.css.ts.vanilla.js +11 -0
  105. package/dist/navigation-bar.js +206 -334
  106. package/dist/navigation-breadcrumbs.css-mistica.js +27 -0
  107. package/dist/navigation-breadcrumbs.css.d.ts +5 -0
  108. package/dist/navigation-breadcrumbs.css.js.flow +7 -0
  109. package/dist/navigation-breadcrumbs.css.ts.vanilla.js +11 -0
  110. package/dist/navigation-breadcrumbs.js +20 -38
  111. package/dist/overlay.d.ts +2 -0
  112. package/dist/overlay.js +37 -11
  113. package/dist/overlay.js.flow +2 -0
  114. package/dist/package-version.js +1 -1
  115. package/dist/password-field.css-mistica.js +13 -0
  116. package/dist/password-field.css.d.ts +1 -0
  117. package/dist/password-field.css.js.flow +3 -0
  118. package/dist/password-field.css.ts.vanilla.js +11 -0
  119. package/dist/password-field.js +39 -55
  120. package/dist/popover.css-mistica.js +51 -0
  121. package/dist/popover.css.d.ts +12 -0
  122. package/dist/popover.css.js.flow +14 -0
  123. package/dist/popover.css.ts.vanilla.js +11 -0
  124. package/dist/popover.d.ts +2 -1
  125. package/dist/popover.js +97 -118
  126. package/dist/popover.js.flow +2 -1
  127. package/dist/progress-bar.css-mistica.js +3 -3
  128. package/dist/progress-bar.d.ts +2 -0
  129. package/dist/progress-bar.js +60 -7
  130. package/dist/progress-bar.js.flow +2 -0
  131. package/dist/radio-button.css-mistica.js +39 -0
  132. package/dist/radio-button.css.d.ts +6 -0
  133. package/dist/radio-button.css.js.flow +8 -0
  134. package/dist/radio-button.css.ts.vanilla.js +11 -0
  135. package/dist/radio-button.d.ts +1 -0
  136. package/dist/radio-button.js +81 -125
  137. package/dist/radio-button.js.flow +1 -0
  138. package/dist/responsive-layout.css-mistica.js +7 -4
  139. package/dist/responsive-layout.css.d.ts +1 -0
  140. package/dist/responsive-layout.css.js.flow +1 -0
  141. package/dist/responsive-layout.d.ts +2 -0
  142. package/dist/responsive-layout.js +19 -11
  143. package/dist/responsive-layout.js.flow +2 -0
  144. package/dist/screen-reader-only.css-mistica.js +2 -2
  145. package/dist/select.css-mistica.js +60 -0
  146. package/dist/select.css.d.ts +16 -0
  147. package/dist/select.css.js.flow +30 -0
  148. package/dist/select.css.ts.vanilla.js +11 -0
  149. package/dist/select.js +150 -272
  150. package/dist/skeleton-base.js +13 -32
  151. package/dist/skeletons.css-mistica.js +1 -1
  152. package/dist/skeletons.js +63 -42
  153. package/dist/skins/skin-contract.css.js.flow +1 -0
  154. package/dist/snackbar.css-mistica.js +4 -4
  155. package/dist/snackbar.d.ts +2 -0
  156. package/dist/snackbar.js +70 -23
  157. package/dist/snackbar.js.flow +2 -0
  158. package/dist/spinner.css-mistica.js +2 -2
  159. package/dist/spinner.js +14 -11
  160. package/dist/sprinkles.css-mistica.js +217 -479
  161. package/dist/sprinkles.css.d.ts +0 -25
  162. package/dist/stepper.css-mistica.js +7 -7
  163. package/dist/stepper.d.ts +2 -0
  164. package/dist/stepper.js +52 -11
  165. package/dist/stepper.js.flow +2 -0
  166. package/dist/switch-component.css-mistica.js +54 -0
  167. package/dist/switch-component.css.d.ts +14 -0
  168. package/dist/switch-component.css.js.flow +43 -0
  169. package/dist/switch-component.css.ts.vanilla.js +11 -0
  170. package/dist/switch-component.js +35 -96
  171. package/dist/tabs.css-mistica.js +6 -6
  172. package/dist/tabs.js +16 -15
  173. package/dist/tag.css-mistica.js +2 -2
  174. package/dist/tag.js +5 -5
  175. package/dist/text-field-base.css-mistica.js +63 -0
  176. package/dist/text-field-base.css.d.ts +17 -0
  177. package/dist/text-field-base.css.js.flow +19 -0
  178. package/dist/text-field-base.css.ts.vanilla.js +11 -0
  179. package/dist/text-field-base.js +120 -314
  180. package/dist/text-field-components.css-mistica.js +69 -0
  181. package/dist/text-field-components.css.d.ts +18 -0
  182. package/dist/text-field-components.css.js.flow +20 -0
  183. package/dist/text-field-components.css.ts.vanilla.js +11 -0
  184. package/dist/text-field-components.d.ts +0 -4
  185. package/dist/text-field-components.js +46 -159
  186. package/dist/text-field-components.js.flow +0 -4
  187. package/dist/text-link.css-mistica.js +3 -3
  188. package/dist/text.js +159 -92
  189. package/dist/theme-context-provider.js +1 -1
  190. package/dist/title.js +44 -12
  191. package/dist/tooltip.css-mistica.js +7 -7
  192. package/dist/tooltip.d.ts +2 -0
  193. package/dist/tooltip.js +62 -36
  194. package/dist/tooltip.js.flow +2 -0
  195. package/dist/touchable.css-mistica.js +3 -3
  196. package/dist/touchable.js +10 -10
  197. package/dist/utils/animation.d.ts +0 -6
  198. package/dist/utils/animation.js +18 -55
  199. package/dist/utils/animation.js.flow +0 -8
  200. package/dist/utils/aspect-ratio-support.css-mistica.js +29 -0
  201. package/dist/utils/aspect-ratio-support.css.d.ts +6 -0
  202. package/dist/utils/aspect-ratio-support.css.js.flow +11 -0
  203. package/dist/utils/aspect-ratio-support.css.ts.vanilla.js +11 -0
  204. package/dist/utils/aspect-ratio-support.js +37 -56
  205. package/dist/utils/color.d.ts +1 -1
  206. package/dist/utils/color.js.flow +1 -1
  207. package/dist/utils/dom.d.ts +1 -1
  208. package/dist/utils/dom.js +7 -5
  209. package/dist/utils/dom.js.flow +2 -1
  210. package/dist/video.css-mistica.js +2 -2
  211. package/dist-es/avatar.css-mistica.js +2 -2
  212. package/dist-es/avatar.js +77 -22
  213. package/dist-es/badge.css-mistica.js +2 -2
  214. package/dist-es/badge.js +56 -15
  215. package/dist-es/boxed.js +5 -5
  216. package/dist-es/button-group.css-mistica.js +1 -1
  217. package/dist-es/button-group.js +10 -10
  218. package/dist-es/button-layout.css-mistica.js +7 -7
  219. package/dist-es/button-layout.js +4 -4
  220. package/dist-es/button.css-mistica.js +9 -9
  221. package/dist-es/button.js +152 -102
  222. package/dist-es/callout.css-mistica.js +2 -2
  223. package/dist-es/callout.js +79 -27
  224. package/dist-es/card.css-mistica.js +2 -2
  225. package/dist-es/card.js +78 -72
  226. package/dist-es/carousel.css-mistica.js +8 -7
  227. package/dist-es/carousel.js +286 -258
  228. package/dist-es/checkbox.css-mistica.js +5 -5
  229. package/dist-es/checkbox.js +1 -1
  230. package/dist-es/chip.css-mistica.js +2 -2
  231. package/dist-es/chip.js +79 -36
  232. package/dist-es/circle.css-mistica.js +1 -1
  233. package/dist-es/credit-card-number-field.css-mistica.js +3 -3
  234. package/dist-es/cvv-field.css-mistica.js +1 -1
  235. package/dist-es/date-time-picker.js +1 -1
  236. package/dist-es/desktop-container-type-context.js +4 -2
  237. package/dist-es/dialog.css-mistica.js +5 -5
  238. package/dist-es/dialog.js +1 -0
  239. package/dist-es/double-field.css-mistica.js +5 -4
  240. package/dist-es/empty-state-card.css-mistica.js +1 -1
  241. package/dist-es/empty-state.css-mistica.js +2 -2
  242. package/dist-es/empty-state.js +18 -18
  243. package/dist-es/fade-in.js +60 -7
  244. package/dist-es/feedback.css-mistica.js +1 -1
  245. package/dist-es/feedback.js +170 -155
  246. package/dist-es/fixed-footer-layout.css-mistica.js +7 -0
  247. package/dist-es/fixed-footer-layout.css.ts.vanilla.js +2 -0
  248. package/dist-es/fixed-footer-layout.js +47 -96
  249. package/dist-es/header.js +116 -146
  250. package/dist-es/highlighted-card.css-mistica.js +5 -5
  251. package/dist-es/highlighted-card.js +44 -39
  252. package/dist-es/icon-button.css-mistica.js +4 -0
  253. package/dist-es/icon-button.css.ts.vanilla.js +2 -0
  254. package/dist-es/icon-button.js +41 -26
  255. package/dist-es/icons/icon-error.css-mistica.js +3 -0
  256. package/dist-es/icons/icon-error.css.ts.vanilla.js +2 -0
  257. package/dist-es/icons/icon-error.js +46 -57
  258. package/dist-es/icons/icon-info.js +28 -40
  259. package/dist-es/icons/icon-success-vivo.js +18 -28
  260. package/dist-es/icons/icon-success.js +45 -56
  261. package/dist-es/image.css-mistica.js +2 -2
  262. package/dist-es/index.js +1738 -1736
  263. package/dist-es/list.css-mistica.js +2 -2
  264. package/dist-es/list.js +126 -85
  265. package/dist-es/loading-bar.css-mistica.js +2 -2
  266. package/dist-es/loading-bar.js +73 -19
  267. package/dist-es/maybe-dismissable.css-mistica.js +4 -0
  268. package/dist-es/maybe-dismissable.css.ts.vanilla.js +2 -0
  269. package/dist-es/maybe-dismissable.js +24 -59
  270. package/dist-es/media-queries.css-mistica.js +3 -3
  271. package/dist-es/menu.css-mistica.js +11 -0
  272. package/dist-es/menu.css.ts.vanilla.js +2 -0
  273. package/dist-es/menu.js +61 -107
  274. package/dist-es/navigation-bar.css-mistica.js +17 -0
  275. package/dist-es/navigation-bar.css.ts.vanilla.js +2 -0
  276. package/dist-es/navigation-bar.js +253 -381
  277. package/dist-es/navigation-breadcrumbs.css-mistica.js +4 -0
  278. package/dist-es/navigation-breadcrumbs.css.ts.vanilla.js +2 -0
  279. package/dist-es/navigation-breadcrumbs.js +34 -52
  280. package/dist-es/overlay.js +41 -15
  281. package/dist-es/package-version.js +1 -1
  282. package/dist-es/password-field.css-mistica.js +4 -0
  283. package/dist-es/password-field.css.ts.vanilla.js +2 -0
  284. package/dist-es/password-field.js +45 -61
  285. package/dist-es/popover.css-mistica.js +4 -0
  286. package/dist-es/popover.css.ts.vanilla.js +2 -0
  287. package/dist-es/popover.js +121 -141
  288. package/dist-es/progress-bar.css-mistica.js +2 -2
  289. package/dist-es/progress-bar.js +68 -15
  290. package/dist-es/radio-button.css-mistica.js +10 -0
  291. package/dist-es/radio-button.css.ts.vanilla.js +2 -0
  292. package/dist-es/radio-button.js +99 -143
  293. package/dist-es/responsive-layout.css-mistica.js +2 -2
  294. package/dist-es/responsive-layout.js +23 -15
  295. package/dist-es/screen-reader-only.css-mistica.js +2 -2
  296. package/dist-es/select.css-mistica.js +22 -0
  297. package/dist-es/select.css.ts.vanilla.js +2 -0
  298. package/dist-es/select.js +177 -299
  299. package/dist-es/skeleton-base.js +17 -36
  300. package/dist-es/skeletons.css-mistica.js +1 -1
  301. package/dist-es/skeletons.js +78 -57
  302. package/dist-es/snackbar.css-mistica.js +2 -2
  303. package/dist-es/snackbar.js +89 -42
  304. package/dist-es/spinner.css-mistica.js +2 -2
  305. package/dist-es/spinner.js +14 -11
  306. package/dist-es/sprinkles.css-mistica.js +217 -479
  307. package/dist-es/stepper.css-mistica.js +2 -2
  308. package/dist-es/stepper.js +68 -27
  309. package/dist-es/style.css +1 -1
  310. package/dist-es/switch-component.css-mistica.js +22 -0
  311. package/dist-es/switch-component.css.ts.vanilla.js +2 -0
  312. package/dist-es/switch-component.js +51 -112
  313. package/dist-es/tabs.css-mistica.js +6 -6
  314. package/dist-es/tabs.js +24 -23
  315. package/dist-es/tag.css-mistica.js +2 -2
  316. package/dist-es/tag.js +11 -11
  317. package/dist-es/text-field-base.css-mistica.js +4 -0
  318. package/dist-es/text-field-base.css.ts.vanilla.js +2 -0
  319. package/dist-es/text-field-base.js +134 -328
  320. package/dist-es/text-field-components.css-mistica.js +4 -0
  321. package/dist-es/text-field-components.css.ts.vanilla.js +2 -0
  322. package/dist-es/text-field-components.js +56 -157
  323. package/dist-es/text-link.css-mistica.js +3 -3
  324. package/dist-es/text.js +159 -92
  325. package/dist-es/theme-context-provider.js +1 -1
  326. package/dist-es/title.js +50 -18
  327. package/dist-es/tooltip.css-mistica.js +3 -3
  328. package/dist-es/tooltip.js +90 -64
  329. package/dist-es/touchable.css-mistica.js +2 -2
  330. package/dist-es/touchable.js +10 -10
  331. package/dist-es/utils/animation.js +28 -62
  332. package/dist-es/utils/aspect-ratio-support.css-mistica.js +6 -0
  333. package/dist-es/utils/aspect-ratio-support.css.ts.vanilla.js +2 -0
  334. package/dist-es/utils/aspect-ratio-support.js +34 -58
  335. package/dist-es/utils/dom.js +7 -5
  336. package/dist-es/video.css-mistica.js +2 -2
  337. package/package.json +2 -1
package/dist-es/select.js CHANGED
@@ -101,423 +101,301 @@ function _unsupportedIterableToArray(o, minLen) {
101
101
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
102
102
  }
103
103
  import * as s from "react";
104
- import { useForm as ye } from "./form-context.js";
105
- import { useAriaId as Ie, useTheme as Oe } from "./hooks.js";
106
- import { TAB as Ee, ESC as Ce, ENTER as re, SPACE as se, UP as ve, DOWN as ke } from "./utils/key-codes.js";
107
- import { FieldContainer as Ne, HelperText as Re, Label as Ae } from "./text-field-components.js";
104
+ import oe from "classnames";
105
+ import { useForm as Ce } from "./form-context.js";
106
+ import { useAriaId as Ne, useTheme as Ae } from "./hooks.js";
107
+ import { TAB as Re, ESC as ve, ENTER as se, SPACE as re, UP as be, DOWN as ke } from "./utils/key-codes.js";
108
+ import { FieldContainer as _e, HelperText as Ve, Label as De } from "./text-field-components.js";
108
109
  import ie from "./generated/mistica-icons/icon-chevron-down-regular.js";
109
- import { TextFieldBaseAutosuggest as _e } from "./text-field-base.js";
110
- import De from "./overlay.js";
111
- import Pe from "classnames";
112
- import { isAndroid as He, isIos as Me } from "./utils/platform.js";
113
- import { createUseStyles as Fe } from "./jss.js";
114
- import { cancelEvent as h } from "./utils/dom.js";
115
- import { Text3 as Ve } from "./text.js";
116
- import { jsxs as _, jsx as u, Fragment as Be } from "./_virtual/jsx-runtime.js";
117
- var Ge = Fe(function(d) {
118
- var _obj, _obj1;
119
- return {
120
- selectContainer: (_obj = {
121
- position: "relative",
122
- outline: 0
123
- }, _defineProperty(_obj, d.mq.tabletOrSmaller, {
124
- width: "100%"
125
- }), _defineProperty(_obj, d.mq.desktopOrBigger, {
126
- width: function(param) {
127
- var t = param.fullWidth;
128
- return t ? "100%" : "fit-content";
129
- }
130
- }), _obj),
131
- select: {
132
- fontFamily: "inherit",
133
- backgroundColor: "transparent",
134
- paddingTop: function(param) {
135
- var t = param.label;
136
- return t ? 24 : 16;
137
- },
138
- paddingBottom: function(param) {
139
- var t = param.label;
140
- return t ? 8 : 16;
141
- },
142
- paddingRight: 0,
143
- paddingLeft: 12,
144
- border: 0,
145
- outline: 0,
146
- fontSize: 16,
147
- color: d.colors.textPrimary,
148
- width: "100%",
149
- height: "100%",
150
- textOverflow: "ellipsis",
151
- appearance: "none",
152
- cursor: function(param) {
153
- var t = param.disabled;
154
- return t ? "default" : "pointer";
155
- }
156
- },
157
- arrowDown: {
158
- position: "absolute",
159
- right: 16,
160
- top: "calc(50% - 10px)",
161
- pointerEvents: "none"
162
- },
163
- selectText: {
164
- position: "absolute",
165
- pointerEvents: "none",
166
- left: 12 + 1,
167
- right: 48 + 1,
168
- overflow: "hidden",
169
- top: function(param) {
170
- var t = param.label;
171
- return t ? 27 : 17;
172
- },
173
- lineHeight: "20px",
174
- fontSize: 16,
175
- color: d.colors.textPrimary,
176
- opacity: function(param) {
177
- var t = param.disabled;
178
- return t ? 0.5 : 1;
179
- },
180
- maxWidth: "100%",
181
- textOverflow: "ellipsis",
182
- whiteSpace: "nowrap"
183
- },
184
- optionsContainer: {
185
- margin: 0,
186
- padding: 0,
187
- listStyleType: "none",
188
- position: "absolute",
189
- top: function(param) {
190
- var t = param.optionsComputedProps;
191
- return t.top;
192
- },
193
- left: function(param) {
194
- var t = param.optionsComputedProps;
195
- return t.left;
196
- },
197
- minWidth: function(param) {
198
- var t = param.optionsComputedProps;
199
- return t.width;
200
- },
201
- borderRadius: 8,
202
- boxShadow: "0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)",
203
- backgroundColor: d.colors.backgroundContainer,
204
- paddingTop: 8,
205
- paddingBottom: 8,
206
- transformOrigin: function(param) {
207
- var t = param.optionsComputedProps;
208
- return t.transformOrigin;
209
- },
210
- transition: "opacity .03s linear,transform .12s cubic-bezier(0,0,.2,1) .15s",
211
- opacity: function(param) {
212
- var t = param.animateShowOptions;
213
- return t ? 1 : 0;
214
- },
215
- transform: function(param) {
216
- var t = param.animateShowOptions;
217
- return t ? "scale(1)" : "scale(0)";
218
- },
219
- maxHeight: function(param) {
220
- var t = param.optionsComputedProps;
221
- var C;
222
- return (C = t.maxHeight) != null ? C : "416px";
223
- },
224
- overflowY: "auto"
225
- },
226
- menuItemSelected: {
227
- backgroundColor: "rgba(0, 0, 0, 0.14)"
228
- },
229
- menuItem: (_obj1 = {
230
- color: d.colors.textPrimary,
231
- padding: "8px 16px",
232
- height: 48,
233
- transition: "background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"
234
- }, _defineProperty(_obj1, d.mq.supportsHover, {
235
- "&:hover": {
236
- backgroundColor: "rgba(0, 0, 0, 0.08)"
237
- }
238
- }), _defineProperty(_obj1, "display", "flex"), _defineProperty(_obj1, "alignItems", "center"), _defineProperty(_obj1, "cursor", "pointer"), _obj1)
239
- };
240
- }), tt = function(param) {
241
- var d = param.id, t = param.label, C = param.helperText, D = param.value, P = param.onChangeValue, c = param.name, H = param.fullWidth, p = param.options, v = param.optional, ce = param.disabled, le = param.error, M = param.onBlur, tmp = param.autoFocus, j = tmp === void 0 ? !1 : tmp, ae = param.native;
242
- var te, oe;
243
- var x = s.useRef(null), f = s.useRef(null), w = s.useRef(null), b = s.useRef(null), k = s.useRef(/* @__PURE__ */ new Map()), ref = _slicedToArray(s.useState(), 2), l = ref[0], ue = ref[1], ref1 = _slicedToArray(s.useState(!1), 2), F = ref1[0], K = ref1[1], ref2 = _slicedToArray(s.useState(!1), 2), X = ref2[0], W = ref2[1], ref3 = _slicedToArray(s.useState(!1), 2), Y = ref3[0], O = ref3[1], ref4 = _slicedToArray(s.useState({}), 2), de = ref4[0], V = ref4[1], ref5 = _slicedToArray(s.useState(), 2), S = ref5[0], B = ref5[1], G = s.useRef(null), Z = Ie(d), ref6 = ye(), pe = ref6.rawValues, q = ref6.setRawValue, z = ref6.setValue, fe = ref6.formStatus, J = ref6.formErrors, me = ref6.setFormError, L = ref6.register, ref7 = Oe(), Q = ref7.platformOverrides, $ = ae || process.env.NODE_ENV === "test" || He(Q) || Me(Q), E = ce || fe === "sending", N = le || !!J[c], U = J[c] || C, r = D != null ? D : pe[c], R = function(e) {
244
- P == null || P(e), me({
245
- name: c,
110
+ import { TextFieldBaseAutosuggest as Me } from "./text-field-base.js";
111
+ import He from "./overlay.js";
112
+ import { isAndroid as Fe, isIos as Pe } from "./utils/platform.js";
113
+ import { cancelEvent as m } from "./utils/dom.js";
114
+ import { Text3 as Ge } from "./text.js";
115
+ import { selectVariants as Ze, arrowDown as We, selectContainerVariants as Be, selectTextVariants as Le, vars as C, optionsContainer as $e, optionsAnimationsVariants as ce, menuItem as qe, menuItemSelected as je } from "./select.css-mistica.js";
116
+ import { assignInlineVars as ze } from "@vanilla-extract/dynamic";
117
+ import { jsxs as b, jsx as a, Fragment as Ke } from "./_virtual/jsx-runtime.js";
118
+ var ut = function(param) {
119
+ var le = param.id, h = param.label, ae = param.helperText, k = param.value, _ = param.onChangeValue, i = param.name, V = param.fullWidth, d = param.options, D = param.optional, ue = param.disabled, de = param.error, M = param.onBlur, tmp = param.autoFocus, $ = tmp === void 0 ? !1 : tmp, fe = param.native;
120
+ var Y, ee, te;
121
+ var g = s.useRef(null), f = s.useRef(null), T = s.useRef(null), I = s.useRef(null), N = s.useRef(/* @__PURE__ */ new Map()), ref = _slicedToArray(s.useState(), 2), c = ref[0], pe = ref[1], ref1 = _slicedToArray(s.useState(!1), 2), H = ref1[0], q = ref1[1], ref2 = _slicedToArray(s.useState(!1), 2), j = ref2[0], z = ref2[1], ref3 = _slicedToArray(s.useState(!1), 2), K = ref3[0], y = ref3[1], ref4 = _slicedToArray(s.useState({}), 2), u = ref4[0], F = ref4[1], ref5 = _slicedToArray(s.useState(), 2), x = ref5[0], P = ref5[1], G = s.useRef(null), Z = Ne(le), ref6 = Ce(), me = ref6.rawValues, W = ref6.setRawValue, B = ref6.setValue, he = ref6.formStatus, U = ref6.formErrors, ge = ref6.setFormError, L = ref6.register, ref7 = Ae(), X = ref7.platformOverrides, Te = fe || process.env.NODE_ENV === "test" || Fe(X) || Pe(X), E = ue || he === "sending", A = de || !!U[i], J = U[i] || ae, o = k != null ? k : me[i], R = function(e) {
122
+ _ == null || _(e), ge({
123
+ name: i,
246
124
  error: ""
247
- }), q({
248
- name: c,
125
+ }), W({
126
+ name: i,
249
127
  value: e
250
- }), z({
251
- name: c,
128
+ }), B({
129
+ name: i,
252
130
  value: e
253
131
  });
254
- }, T = function(e) {
132
+ }, w = function(e) {
255
133
  if (e) {
256
- if (w != null && w.current) {
257
- var ref = w.current.getBoundingClientRect(), i = ref.top, y = ref.width, I = ref.left, A = ref.height, g = i + A, ne = Math.min(p.length, 8) * 48 + 16;
258
- if (g + ne + 12 > window.innerHeight) {
259
- var Se = window.innerHeight - g;
260
- if (i > Se) {
261
- var Te = i - ne;
262
- V({
263
- width: y,
264
- left: I,
265
- top: Math.max(Te, 12),
266
- maxHeight: i - 12,
134
+ if (T != null && T.current) {
135
+ var ref = T.current.getBoundingClientRect(), r = ref.top, O = ref.width, S = ref.left, v = ref.height, p = r + v, ne = Math.min(d.length, 8) * 48 + 16;
136
+ if (p + ne + 12 > window.innerHeight) {
137
+ var Se = window.innerHeight - p;
138
+ if (r > Se) {
139
+ var ye = r - ne;
140
+ F({
141
+ minWidth: O,
142
+ left: S,
143
+ top: Math.max(ye, 12),
144
+ maxHeight: r - 12,
267
145
  transformOrigin: "center bottom"
268
146
  });
269
- } else V({
270
- width: y,
271
- top: g,
272
- left: I,
273
- maxHeight: window.innerHeight - g - 12,
147
+ } else F({
148
+ minWidth: O,
149
+ top: p,
150
+ left: S,
151
+ maxHeight: window.innerHeight - p - 12,
274
152
  transformOrigin: "center top"
275
153
  });
276
- } else V({
277
- width: y,
278
- top: g,
279
- left: I,
154
+ } else F({
155
+ minWidth: O,
156
+ top: p,
157
+ left: S,
280
158
  maxHeight: void 0,
281
159
  transformOrigin: "center top"
282
160
  });
283
161
  }
284
- K(!0), requestAnimationFrame(function() {
285
- G.current && b.current && "scrollTop" in b.current && (b.current.scrollTop = G.current), W(!0);
286
- }), B(l != null ? l : r);
287
- } else W(!1), K(!1), B(void 0);
288
- }, ee = function(e) {
289
- var o;
290
- G.current = (o = b.current) == null ? void 0 : o.scrollTop, T(!1), R && typeof e == "string" && R(e), (typeof r === "undefined" ? "undefined" : _typeof(r)) > "u" && ue(e);
291
- }, ge = function(e) {
162
+ q(!0), requestAnimationFrame(function() {
163
+ G.current && I.current && "scrollTop" in I.current && (I.current.scrollTop = G.current), z(!0);
164
+ }), P(c != null ? c : o);
165
+ } else z(!1), q(!1), P(void 0);
166
+ }, Q = function(e) {
167
+ var t;
168
+ G.current = (t = I.current) == null ? void 0 : t.scrollTop, w(!1), R && typeof e == "string" && R(e), (typeof o === "undefined" ? "undefined" : _typeof(o)) > "u" && pe(e);
169
+ }, Ie = function(e) {
292
170
  var n;
293
- var o = (n = b.current) == null ? void 0 : n.getBoundingClientRect();
294
- if (o && e && k.current.has(e)) {
295
- var a = k.current.get(e), i = a == null ? void 0 : a.getBoundingClientRect();
296
- if (i && i.top + i.height / 2 >= o.top + o.height) {
297
- a == null || a.scrollIntoView();
171
+ var t = (n = I.current) == null ? void 0 : n.getBoundingClientRect();
172
+ if (t && e && N.current.has(e)) {
173
+ var l = N.current.get(e), r = l == null ? void 0 : l.getBoundingClientRect();
174
+ if (r && r.top + r.height / 2 >= t.top + t.height) {
175
+ l == null || l.scrollIntoView();
298
176
  return;
299
177
  }
300
- i && i.top + i.height / 2 <= o.top && (a == null || a.scrollIntoView(!1));
178
+ r && r.top + r.height / 2 <= t.top && (l == null || l.scrollIntoView(!1));
301
179
  }
302
- }, he = f.current, xe = x.current;
180
+ }, xe = f.current, Ee = g.current;
303
181
  s.useEffect(function() {
304
- q({
305
- name: c,
306
- value: r
307
- }), z({
308
- name: c,
309
- value: r
182
+ W({
183
+ name: i,
184
+ value: o
185
+ }), B({
186
+ name: i,
187
+ value: o
310
188
  });
311
189
  }, [
312
- c,
313
- q,
314
- z,
315
- r
190
+ i,
191
+ W,
192
+ B,
193
+ o
316
194
  ]), s.useEffect(function() {
317
- return L(c, {
318
- input: x.current,
195
+ return L(i, {
196
+ input: g.current,
319
197
  focusableElement: f.current
320
198
  }), function() {
321
- L(c, {
199
+ L(i, {
322
200
  input: null,
323
201
  focusableElement: null
324
202
  });
325
203
  };
326
204
  }, [
327
- c,
205
+ i,
328
206
  L,
329
207
  f,
330
- x,
331
- he,
332
- xe
208
+ g,
209
+ xe,
210
+ Ee
333
211
  ]), s.useEffect(function() {
334
212
  var e = function(n) {
335
- var y, I;
213
+ var O, S;
336
214
  var _obj;
337
- var i = (_obj = {}, _defineProperty(_obj, ve, -1), _defineProperty(_obj, ke, 1), _obj)[n.keyCode];
338
- if (i) {
339
- h(n);
340
- var A = (I = (y = p[p.findIndex(function(param) {
341
- var g = param.value;
342
- return g === S;
343
- }) + i]) == null ? void 0 : y.value) != null ? I : S;
344
- B(A), ge(A);
215
+ var r = (_obj = {}, _defineProperty(_obj, be, -1), _defineProperty(_obj, ke, 1), _obj)[n.keyCode];
216
+ if (r) {
217
+ m(n);
218
+ var v = (S = (O = d[d.findIndex(function(param) {
219
+ var p = param.value;
220
+ return p === x;
221
+ }) + r]) == null ? void 0 : O.value) != null ? S : x;
222
+ P(v), Ie(v);
345
223
  }
346
- }, o = function(n) {
347
- F && (n.keyCode === Ee && h(n), n.keyCode === Ce && T(!1), (n.keyCode === re || n.keyCode === se) && (h(n), p.findIndex(function(param) {
348
- var a = param.value;
349
- return a === S;
350
- }) !== -1 && S !== l && ee(S), T(!1))), X && e(n);
224
+ }, t = function(n) {
225
+ H && (n.keyCode === Re && m(n), n.keyCode === ve && w(!1), (n.keyCode === se || n.keyCode === re) && (m(n), d.findIndex(function(param) {
226
+ var l = param.value;
227
+ return l === x;
228
+ }) !== -1 && x !== c && Q(x), w(!1))), j && e(n);
351
229
  };
352
- return document.addEventListener("keydown", o, !1), function() {
353
- document.removeEventListener("keydown", o, !1);
230
+ return document.addEventListener("keydown", t, !1), function() {
231
+ document.removeEventListener("keydown", t, !1);
354
232
  };
355
233
  }), s.useEffect(function() {
356
- j && f.current && f.current.focus();
234
+ $ && f.current && f.current.focus();
357
235
  }, [
358
- j
236
+ $
359
237
  ]);
360
- var m = Ge({
361
- label: t || v && !$,
362
- optionsComputedProps: de,
363
- animateShowOptions: X,
364
- helperText: U,
365
- disabled: E,
366
- fullWidth: H
367
- }), we = function(e) {
368
- var o;
369
- return e ? (o = p.find(function(param) {
238
+ var we = function(e) {
239
+ var t;
240
+ return e ? (t = d.find(function(param) {
370
241
  var n = param.value;
371
242
  return n === e;
372
- })) == null ? void 0 : o.text : "";
373
- }, be = {
243
+ })) == null ? void 0 : t.text : "";
244
+ }, Oe = {
374
245
  tabIndex: 0,
375
246
  onFocus: function() {
376
- return O(!0);
247
+ return y(!0);
377
248
  },
378
249
  onBlur: function() {
379
- return O(!1);
250
+ return y(!1);
380
251
  },
381
252
  onClick: function() {
382
- T(!0), O(!0);
253
+ w(!0), y(!0);
383
254
  },
384
255
  onKeyDown: function(e) {
385
- !F && (e.keyCode === se || e.keyCode === re) && (h(e), T(!0));
256
+ !H && (e.keyCode === re || e.keyCode === se) && (m(e), w(!0));
386
257
  }
387
258
  };
388
- return $ ? /* @__PURE__ */ _(Ne, {
259
+ var _obj;
260
+ return Te ? /* @__PURE__ */ b(_e, {
389
261
  disabled: E,
390
- helperText: /* @__PURE__ */ u(Re, {
391
- error: N,
392
- leftText: U
262
+ helperText: /* @__PURE__ */ a(Ve, {
263
+ error: A,
264
+ leftText: J
393
265
  }),
394
- fieldRef: w,
395
- fullWidth: H,
266
+ fieldRef: T,
267
+ fullWidth: V,
396
268
  children: [
397
- t && /* @__PURE__ */ u(Ae, {
398
- error: N,
269
+ h && /* @__PURE__ */ a(De, {
270
+ error: A,
399
271
  forId: Z,
400
- inputState: Y ? "focused" : ((oe = r != null ? r : l) != null ? oe : (te = x.current) == null ? void 0 : te.value) ? "filled" : "default",
401
- optional: v,
402
- children: t
272
+ inputState: K ? "focused" : ((ee = o != null ? o : c) != null ? ee : (Y = g.current) == null ? void 0 : Y.value) ? "filled" : "default",
273
+ optional: D,
274
+ children: h
403
275
  }),
404
- /* @__PURE__ */ _("select", {
405
- className: m.select,
276
+ /* @__PURE__ */ b("select", {
277
+ className: Ze[E ? "disabled" : "default"],
406
278
  id: Z,
407
- "aria-invalid": !!N,
408
- value: r,
409
- required: !v,
279
+ "aria-invalid": !!A,
280
+ value: o,
281
+ required: !D,
410
282
  disabled: E,
411
283
  onChange: function(e) {
412
284
  R && R(e.target.value);
413
285
  },
414
286
  onFocus: function() {
415
- return O(!0);
287
+ return y(!0);
416
288
  },
417
289
  onBlur: function(e) {
418
- O(!1), M == null || M(e);
290
+ y(!1), M == null || M(e);
419
291
  },
420
292
  ref: function(e) {
421
293
  [
422
- x,
294
+ g,
423
295
  f
424
- ].forEach(function(o) {
425
- o.current = e;
296
+ ].forEach(function(t) {
297
+ t.current = e;
426
298
  });
427
299
  },
428
300
  style: {
301
+ paddingTop: h ? 24 : 16,
302
+ paddingBottom: h ? 8 : 16,
429
303
  opacity: 1
430
304
  },
431
305
  children: [
432
- p.every(function(param) {
306
+ d.every(function(param) {
433
307
  var e = param.value;
434
308
  return !!e;
435
- }) && /* @__PURE__ */ u("option", {
309
+ }) && /* @__PURE__ */ a("option", {
436
310
  value: "",
437
311
  style: {
438
312
  display: "none"
439
313
  }
440
314
  }),
441
- p.map(function(param) {
442
- var e = param.value, o = param.text;
443
- return /* @__PURE__ */ u("option", {
315
+ d.map(function(param) {
316
+ var e = param.value, t = param.text;
317
+ return /* @__PURE__ */ a("option", {
444
318
  value: e,
445
- children: o
319
+ children: t
446
320
  }, e);
447
321
  })
448
322
  ]
449
323
  }),
450
- /* @__PURE__ */ u("div", {
451
- className: m.arrowDown,
324
+ /* @__PURE__ */ a("div", {
325
+ className: We,
452
326
  "aria-hidden": !0,
453
- children: /* @__PURE__ */ u(ie, {
327
+ children: /* @__PURE__ */ a(ie, {
454
328
  size: 20
455
329
  })
456
330
  })
457
331
  ]
458
- }) : /* @__PURE__ */ _(Be, {
332
+ }) : /* @__PURE__ */ b(Ke, {
459
333
  children: [
460
- /* @__PURE__ */ _("div", _objectSpreadProps(_objectSpread({
461
- className: m.selectContainer,
334
+ /* @__PURE__ */ b("div", _objectSpreadProps(_objectSpread({
335
+ className: Be[V ? "fullWidth" : "default"],
462
336
  role: "button",
463
337
  "aria-haspopup": "listbox",
464
338
  ref: f
465
- }, !E && be), {
339
+ }, !E && Oe), {
466
340
  children: [
467
- /* @__PURE__ */ u(_e, {
341
+ /* @__PURE__ */ a(Me, {
468
342
  style: {
469
343
  visibility: "hidden"
470
344
  },
471
- fullWidth: H,
472
- endIcon: /* @__PURE__ */ u(ie, {
345
+ fullWidth: V,
346
+ endIcon: /* @__PURE__ */ a(ie, {
473
347
  size: 20
474
348
  }),
475
- focus: Y,
476
- label: t,
477
- value: r,
478
- shrinkLabel: !!(r || l),
479
- name: c,
480
- helperText: U,
481
- required: !v,
349
+ focus: K,
350
+ label: h,
351
+ value: o,
352
+ shrinkLabel: !!(o || c),
353
+ name: i,
354
+ helperText: J,
355
+ required: !D,
482
356
  disabled: E,
483
357
  id: Z,
484
- error: N,
485
- inputRef: x,
486
- fieldRef: w
358
+ error: A,
359
+ inputRef: g,
360
+ fieldRef: T
487
361
  }),
488
- /* @__PURE__ */ u("div", {
489
- className: m.selectText,
490
- children: we(r != null ? r : l)
362
+ /* @__PURE__ */ a("div", {
363
+ className: Le[E ? "disabled" : "default"],
364
+ style: {
365
+ top: h ? 27 : 17
366
+ },
367
+ children: we(o != null ? o : c)
491
368
  })
492
369
  ]
493
370
  })),
494
- F && /* @__PURE__ */ u(De, {
371
+ H && /* @__PURE__ */ a(He, {
495
372
  onPress: function(e) {
496
- T(!1), h(e);
373
+ w(!1), m(e);
497
374
  },
498
375
  disableScroll: !0,
499
- children: /* @__PURE__ */ u("ul", {
500
- onPointerDown: h,
501
- className: m.optionsContainer,
376
+ children: /* @__PURE__ */ a("ul", {
377
+ style: ze((_obj = {}, _defineProperty(_obj, C.top, u.top ? "".concat(u.top, "px") : ""), _defineProperty(_obj, C.left, u.left ? "".concat(u.left, "px") : ""), _defineProperty(_obj, C.maxHeight, u.maxHeight ? "".concat(u.maxHeight, "px") : ""), _defineProperty(_obj, C.minWidth, u.minWidth ? "".concat(u.minWidth, "px") : ""), _defineProperty(_obj, C.transformOrigin, (te = u.transformOrigin) != null ? te : ""), _obj)),
378
+ onPointerDown: m,
379
+ className: oe($e, j ? ce.show : ce.hide),
502
380
  role: "listbox",
503
- ref: b,
504
- children: p.map(function(param) {
505
- var e = param.value, o = param.text;
506
- return /* @__PURE__ */ u("li", {
381
+ ref: I,
382
+ children: d.map(function(param) {
383
+ var e = param.value, t = param.text;
384
+ return /* @__PURE__ */ a("li", {
507
385
  role: "option",
508
- "aria-selected": e === (l != null ? l : r),
386
+ "aria-selected": e === (c != null ? c : o),
509
387
  "data-value": e,
510
- className: Pe(m.menuItem, _defineProperty({}, m.menuItemSelected, e === S || e === (l != null ? l : r))),
511
- onPointerDown: h,
388
+ className: oe(qe, _defineProperty({}, je, e === x || e === (c != null ? c : o))),
389
+ onPointerDown: m,
512
390
  onClick: function() {
513
- return ee(e);
391
+ return Q(e);
514
392
  },
515
393
  ref: function(n) {
516
- n ? k.current.set(e, n) : k.current.delete(e);
394
+ n ? N.current.set(e, n) : N.current.delete(e);
517
395
  },
518
- children: /* @__PURE__ */ u(Ve, {
396
+ children: /* @__PURE__ */ a(Ge, {
519
397
  regular: !0,
520
- children: o
398
+ children: t
521
399
  })
522
400
  }, e);
523
401
  })
@@ -526,4 +404,4 @@ var Ge = Fe(function(d) {
526
404
  ]
527
405
  });
528
406
  };
529
- export { tt as default };
407
+ export { ut as default };