@telefonica/mistica 16.0.0 → 16.1.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 (152) hide show
  1. package/README.md +11 -9
  2. package/css/mistica.css +1 -1
  3. package/dist/box.d.ts +1 -0
  4. package/dist/box.js +12 -12
  5. package/dist/card.d.ts +14 -2
  6. package/dist/card.js +210 -206
  7. package/dist/credit-card-expiration-field.d.ts +1 -1
  8. package/dist/credit-card-expiration-field.js +53 -52
  9. package/dist/credit-card-number-field.d.ts +1 -1
  10. package/dist/credit-card-number-field.js +47 -45
  11. package/dist/cvv-field.d.ts +1 -1
  12. package/dist/cvv-field.js +38 -37
  13. package/dist/date-field.d.ts +1 -1
  14. package/dist/date-field.js +15 -13
  15. package/dist/date-time-field.d.ts +1 -1
  16. package/dist/date-time-field.js +13 -11
  17. package/dist/decimal-field.d.ts +1 -1
  18. package/dist/decimal-field.js +39 -38
  19. package/dist/email-field.d.ts +1 -1
  20. package/dist/email-field.js +21 -19
  21. package/dist/form-context.d.ts +7 -2
  22. package/dist/form-context.js +69 -62
  23. package/dist/form.d.ts +2 -1
  24. package/dist/form.js +94 -80
  25. package/dist/iban-field.d.ts +1 -1
  26. package/dist/iban-field.js +32 -30
  27. package/dist/index.d.ts +12 -3
  28. package/dist/index.js +19 -8
  29. package/dist/inline.d.ts +2 -1
  30. package/dist/inline.js +16 -15
  31. package/dist/integer-field.d.ts +1 -1
  32. package/dist/integer-field.js +30 -30
  33. package/dist/month-field.d.ts +1 -1
  34. package/dist/month-field.js +15 -13
  35. package/dist/package-version.js +1 -1
  36. package/dist/password-field.d.ts +1 -1
  37. package/dist/password-field.js +24 -22
  38. package/dist/phone-number-field.d.ts +4 -1
  39. package/dist/phone-number-field.js +84 -52
  40. package/dist/pin-field.js +21 -20
  41. package/dist/radio-button.d.ts +1 -0
  42. package/dist/radio-button.js +42 -41
  43. package/dist/rating.css-mistica.js +44 -0
  44. package/dist/rating.css.d.ts +11 -0
  45. package/dist/rating.css.ts.vanilla.css-mistica.js +11 -0
  46. package/dist/rating.d.ts +37 -0
  47. package/dist/rating.js +320 -0
  48. package/dist/search-field.d.ts +1 -0
  49. package/dist/search-field.js +18 -16
  50. package/dist/select.js +36 -33
  51. package/dist/sheet-action-row.css-mistica.js +13 -0
  52. package/dist/sheet-action-row.css.d.ts +1 -0
  53. package/dist/sheet-actions-list.d.ts +26 -0
  54. package/dist/sheet-actions-list.js +147 -0
  55. package/dist/sheet-actions.d.ts +23 -0
  56. package/dist/sheet-actions.js +175 -0
  57. package/dist/{sheet.css-mistica.js → sheet-common.css-mistica.js} +15 -21
  58. package/dist/{sheet.css.d.ts → sheet-common.css.d.ts} +0 -2
  59. package/dist/sheet-common.css.ts.vanilla.css-mistica.js +11 -0
  60. package/dist/sheet-common.d.ts +24 -0
  61. package/dist/sheet-common.js +429 -0
  62. package/dist/sheet-info.css-mistica.js +12 -0
  63. package/dist/sheet-info.css.d.ts +1 -0
  64. package/dist/sheet-info.d.ts +28 -0
  65. package/dist/sheet-info.js +156 -0
  66. package/dist/sheet-native.d.ts +2 -0
  67. package/dist/sheet-native.js +173 -0
  68. package/dist/sheet-radio-list.d.ts +22 -0
  69. package/dist/sheet-radio-list.js +143 -0
  70. package/dist/sheet-root.d.ts +4 -85
  71. package/dist/sheet-root.js +48 -322
  72. package/dist/sheet-types.d.ts +88 -0
  73. package/dist/sheet-web.d.ts +8 -0
  74. package/dist/sheet-web.js +183 -0
  75. package/dist/slider.js +40 -39
  76. package/dist/switch-component.js +18 -17
  77. package/dist/text-field-base.d.ts +3 -1
  78. package/dist/text-field-base.js +74 -66
  79. package/dist/text-field-components.css-mistica.js +14 -14
  80. package/dist/text-field-components.css.d.ts +2 -2
  81. package/dist/text-field-components.js +49 -39
  82. package/dist/text-field.d.ts +1 -0
  83. package/dist/text-field.js +24 -22
  84. package/dist/text-tokens.d.ts +14 -0
  85. package/dist/text-tokens.js +145 -89
  86. package/dist/theme-context-provider.js +6 -5
  87. package/dist/theme.d.ts +2 -0
  88. package/dist/utils/credit-card.d.ts +2 -2
  89. package/dist/utils/credit-card.js +1 -1
  90. package/dist/vivinho-loading-animation/in-lottie.json.js +544 -612
  91. package/dist/vivinho-loading-animation/out-lottie.json.js +828 -896
  92. package/dist/vivinho-loading-animation/pulse-lottie.json.js +798 -866
  93. package/dist/vivinho-loading-animation/wave-lottie.json.js +4303 -4409
  94. package/dist-es/box.js +18 -18
  95. package/dist-es/card.js +305 -301
  96. package/dist-es/credit-card-expiration-field.js +57 -56
  97. package/dist-es/credit-card-number-field.js +74 -72
  98. package/dist-es/cvv-field.js +82 -81
  99. package/dist-es/date-field.js +29 -27
  100. package/dist-es/date-time-field.js +29 -27
  101. package/dist-es/decimal-field.js +46 -45
  102. package/dist-es/email-field.js +26 -24
  103. package/dist-es/form-context.js +70 -63
  104. package/dist-es/form.js +102 -88
  105. package/dist-es/iban-field.js +35 -33
  106. package/dist-es/index.js +1822 -1817
  107. package/dist-es/inline.js +26 -25
  108. package/dist-es/integer-field.js +31 -31
  109. package/dist-es/month-field.js +28 -26
  110. package/dist-es/package-version.js +1 -1
  111. package/dist-es/password-field.js +37 -35
  112. package/dist-es/phone-number-field.js +92 -60
  113. package/dist-es/pin-field.js +32 -31
  114. package/dist-es/radio-button.js +42 -41
  115. package/dist-es/rating.css-mistica.js +6 -0
  116. package/dist-es/rating.css.ts.vanilla.css-mistica.js +2 -0
  117. package/dist-es/rating.js +257 -0
  118. package/dist-es/search-field.js +33 -31
  119. package/dist-es/select.js +49 -46
  120. package/dist-es/sheet-action-row.css-mistica.js +4 -0
  121. package/dist-es/sheet-actions-list.js +92 -0
  122. package/dist-es/sheet-actions.js +125 -0
  123. package/dist-es/sheet-common.css-mistica.js +4 -0
  124. package/dist-es/sheet-common.css.ts.vanilla.css-mistica.js +2 -0
  125. package/dist-es/sheet-common.js +366 -0
  126. package/dist-es/sheet-info.css-mistica.js +3 -0
  127. package/dist-es/sheet-info.js +101 -0
  128. package/dist-es/sheet-native.js +164 -0
  129. package/dist-es/sheet-radio-list.js +88 -0
  130. package/dist-es/sheet-root.js +50 -319
  131. package/dist-es/sheet-web.js +128 -0
  132. package/dist-es/slider.js +49 -48
  133. package/dist-es/style.css +1 -1
  134. package/dist-es/switch-component.js +27 -26
  135. package/dist-es/text-field-base.js +108 -100
  136. package/dist-es/text-field-components.css-mistica.js +2 -2
  137. package/dist-es/text-field-components.js +70 -60
  138. package/dist-es/text-field.js +33 -31
  139. package/dist-es/text-tokens.js +80 -45
  140. package/dist-es/theme-context-provider.js +20 -19
  141. package/dist-es/utils/credit-card.js +1 -1
  142. package/dist-es/vivinho-loading-animation/in-lottie.json.js +534 -599
  143. package/dist-es/vivinho-loading-animation/out-lottie.json.js +821 -886
  144. package/dist-es/vivinho-loading-animation/pulse-lottie.json.js +790 -855
  145. package/dist-es/vivinho-loading-animation/wave-lottie.json.js +4297 -4400
  146. package/package.json +4 -3
  147. package/dist/sheet.d.ts +0 -107
  148. package/dist/sheet.js +0 -642
  149. package/dist-es/sheet.css-mistica.js +0 -4
  150. package/dist-es/sheet.js +0 -567
  151. /package/dist/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
  152. /package/dist-es/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
@@ -164,33 +164,33 @@ const S = /*#__PURE__*/ _react.createContext({
164
164
  selectNext: ()=>{},
165
165
  selectPrev: ()=>{}
166
166
  }), z = ()=>_react.useContext(S), J = (_param)=>{
167
- var { value: t, id: s, dataAttributes: h, "aria-labelledby": R, "aria-label": x } = _param, f = _object_without_properties(_param, [
167
+ var { value: e, id: s, dataAttributes: h, "aria-labelledby": g, "aria-label": x } = _param, f = _object_without_properties(_param, [
168
168
  "value",
169
169
  "id",
170
170
  "dataAttributes",
171
171
  "aria-labelledby",
172
172
  "aria-label"
173
173
  ]);
174
- const { disabled: l, selectedValue: C, focusableValue: p, select: c, selectNext: g, selectPrev: y } = z(), r = _react.useId(), m = R || r, V = _react.useRef(null), d = t === C, o = p === t ? 0 : -1, { isIos: a } = (0, _hooks.useTheme)(), v = (e)=>{
175
- switch(e.key){
174
+ const { disabled: l, selectedValue: v, focusableValue: C, select: c, selectNext: p, selectPrev: y } = z(), r = _react.useId(), b = g || r, V = _react.useRef(null), d = e === v, o = C === e ? 0 : -1, { isIos: t } = (0, _hooks.useTheme)(), R = (a)=>{
175
+ switch(a.key){
176
176
  case _keys.SPACE:
177
- c(t), e.preventDefault(), e.stopPropagation();
177
+ c(e), a.preventDefault(), a.stopPropagation();
178
178
  break;
179
179
  case _keys.RIGHT:
180
180
  case _keys.DOWN:
181
- g(), e.preventDefault(), e.stopPropagation();
181
+ p(), a.preventDefault(), a.stopPropagation();
182
182
  break;
183
183
  case _keys.LEFT:
184
184
  case _keys.UP:
185
- y(), e.preventDefault(), e.stopPropagation();
185
+ y(), a.preventDefault(), a.stopPropagation();
186
186
  break;
187
187
  }
188
188
  }, u = /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
189
- className: (0, _classnames.default)(a ? _radiobuttoncssmistica.outerCircleVariants.ios : _radiobuttoncssmistica.outerCircleVariants.default, {
190
- [_radiobuttoncssmistica.outerCircleCheckedVariants[a ? "ios" : "default"]]: d,
189
+ className: (0, _classnames.default)(t ? _radiobuttoncssmistica.outerCircleVariants.ios : _radiobuttoncssmistica.outerCircleVariants.default, {
190
+ [_radiobuttoncssmistica.outerCircleCheckedVariants[t ? "ios" : "default"]]: d,
191
191
  [_radiobuttoncssmistica.disabled]: l
192
192
  }),
193
- children: !a && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
193
+ children: !t && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
194
194
  className: (0, _classnames.default)(_radiobuttoncssmistica.innerCircle, {
195
195
  [_radiobuttoncssmistica.innerCircleChecked]: d
196
196
  })
@@ -201,22 +201,22 @@ const S = /*#__PURE__*/ _react.createContext({
201
201
  id: s,
202
202
  tabIndex: l ? void 0 : o,
203
203
  role: "radio",
204
- "data-value": t,
204
+ "data-value": e,
205
205
  "aria-checked": d,
206
206
  "aria-disabled": l,
207
207
  "aria-label": x,
208
- "aria-labelledby": x ? void 0 : m,
209
- onClick: (e)=>{
210
- e.stopPropagation(), l || c(t);
208
+ "aria-labelledby": x ? void 0 : b,
209
+ onClick: (a)=>{
210
+ a.stopPropagation(), l || c(e);
211
211
  },
212
- onKeyDown: l ? void 0 : v,
212
+ onKeyDown: l ? void 0 : R,
213
213
  className: l ? _radiobuttoncssmistica.radioButtonContainerDisabled : _radiobuttoncssmistica.radioButton
214
214
  }, (0, _dom.getPrefixedDataAttributes)(h, "RadioButton")), {
215
215
  children: f.render ? f.render({
216
216
  controlElement: u,
217
217
  disabled: !!l,
218
218
  checked: d,
219
- labelId: m
219
+ labelId: b
220
220
  }) : /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
221
221
  space: 16,
222
222
  children: [
@@ -234,7 +234,7 @@ const S = /*#__PURE__*/ _react.createContext({
234
234
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
235
235
  regular: !0,
236
236
  as: "div",
237
- id: m,
237
+ id: b,
238
238
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("span", {
239
239
  className: l ? _radiobuttoncssmistica.disabled : "",
240
240
  children: f.children
@@ -243,35 +243,35 @@ const S = /*#__PURE__*/ _react.createContext({
243
243
  ]
244
244
  })
245
245
  }));
246
- }, oe = (t)=>{
246
+ }, oe = (e)=>{
247
247
  var _ref;
248
- const { value: s, defaultValue: h, onChange: R, focusableRef: x, disabled: f } = (0, _formcontext.useControlProps)({
249
- name: t.name,
250
- value: t.value,
251
- defaultValue: t.defaultValue,
252
- onChange: t.onChange,
253
- disabled: t.disabled
254
- }), l = typeof s < "u", [C, p] = _react.useState((_ref = s !== null && s !== void 0 ? s : h) !== null && _ref !== void 0 ? _ref : "");
248
+ const { value: s, defaultValue: h, onChange: g, focusableRef: x, disabled: f } = (0, _formcontext.useControlProps)({
249
+ name: e.name,
250
+ value: e.value,
251
+ defaultValue: e.defaultValue,
252
+ onChange: e.onChange,
253
+ disabled: e.disabled
254
+ }), l = typeof s < "u", [v, C] = _react.useState((_ref = s !== null && s !== void 0 ? s : h) !== null && _ref !== void 0 ? _ref : "");
255
255
  _react.useEffect(()=>{
256
- s !== void 0 && p(s);
256
+ s !== void 0 && C(s);
257
257
  }, [
258
258
  s
259
259
  ]);
260
260
  const c = (o)=>{
261
- l || p(o), R(o);
262
- }, [g, y] = _react.useState(null), r = _react.useRef(null), m = ()=>{
261
+ l || C(o), g(o);
262
+ }, [p, y] = _react.useState(null), r = _react.useRef(null), b = ()=>{
263
263
  if (r.current) {
264
- const o = r.current.querySelector("[role=radio][aria-checked=true]"), a = Array.from(r.current.querySelectorAll("[role=radio]"));
265
- if (a.length === 0) return;
266
- const u = ((o ? a.indexOf(o) : 0) + 1) % a.length, e = a[u], b = e.dataset.value;
267
- b && (e.focus(), c(b));
264
+ const o = r.current.querySelector("[role=radio][aria-checked=true]"), t = Array.from(r.current.querySelectorAll("[role=radio]"));
265
+ if (t.length === 0) return;
266
+ const u = ((o ? t.indexOf(o) : 0) + 1) % t.length, a = t[u], m = a.dataset.value;
267
+ m && (a.focus(), c(m));
268
268
  }
269
269
  }, V = ()=>{
270
270
  if (r.current) {
271
- const o = r.current.querySelector("[role=radio][aria-checked=true]"), a = Array.from(r.current.querySelectorAll("[role=radio]"));
272
- if (a.length === 0) return;
273
- const v = o ? a.indexOf(o) : 0, u = (a.length + v - 1) % a.length, e = a[u], b = e.dataset.value;
274
- b && (e.focus(), c(b));
271
+ const o = r.current.querySelector("[role=radio][aria-checked=true]"), t = Array.from(r.current.querySelectorAll("[role=radio]"));
272
+ if (t.length === 0) return;
273
+ const R = o ? t.indexOf(o) : 0, u = (t.length + R - 1) % t.length, a = t[u], m = a.dataset.value;
274
+ m && (a.focus(), c(m));
275
275
  }
276
276
  };
277
277
  _react.useEffect(()=>{
@@ -282,22 +282,23 @@ const S = /*#__PURE__*/ _react.createContext({
282
282
  }
283
283
  }, []);
284
284
  var _ref1;
285
- const d = (_ref1 = C !== null && C !== void 0 ? C : g) !== null && _ref1 !== void 0 ? _ref1 : null;
285
+ const d = (_ref1 = v !== null && v !== void 0 ? v : p) !== null && _ref1 !== void 0 ? _ref1 : null;
286
286
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
287
287
  ref: (0, _common.combineRefs)(r, x),
288
288
  role: "radiogroup",
289
- "aria-labelledby": t["aria-labelledby"]
290
- }, (0, _dom.getPrefixedDataAttributes)(t.dataAttributes, "RadioGroup")), {
289
+ "aria-label": e["aria-label"],
290
+ "aria-labelledby": e["aria-label"] ? void 0 : e["aria-labelledby"]
291
+ }, (0, _dom.getPrefixedDataAttributes)(e.dataAttributes, "RadioGroup")), {
291
292
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(S.Provider, {
292
293
  value: {
293
294
  disabled: f,
294
- selectedValue: C !== null && C !== void 0 ? C : h,
295
+ selectedValue: v !== null && v !== void 0 ? v : h,
295
296
  focusableValue: d,
296
297
  select: c,
297
- selectNext: m,
298
+ selectNext: b,
298
299
  selectPrev: V
299
300
  },
300
- children: t.children
301
+ children: e.children
301
302
  })
302
303
  }));
303
304
  }, re = J;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ IconWrapper: function() {
13
+ return a;
14
+ },
15
+ disabled: function() {
16
+ return v;
17
+ },
18
+ firstIcon: function() {
19
+ return e;
20
+ },
21
+ halfIconActive: function() {
22
+ return t;
23
+ },
24
+ halfIconContainer: function() {
25
+ return n;
26
+ },
27
+ halfIconInactive: function() {
28
+ return o;
29
+ },
30
+ lastIcon: function() {
31
+ return c;
32
+ },
33
+ touchable: function() {
34
+ return f;
35
+ },
36
+ vars: function() {
37
+ return h;
38
+ }
39
+ });
40
+ require("./sprinkles.css.ts.vanilla.css-mistica.js");
41
+ require("./rating.css.ts.vanilla.css-mistica.js");
42
+ var a = "igrtie3 _1y2v1nfhk _1y2v1nfht _1y2v1nfhz", v = "igrtie9", e = "igrtiea", t = "igrtie8 _1y2v1nfhe", n = "_1y2v1nfhe", o = "igrtie6 _1y2v1nfhf", c = "igrtieb", f = "igrtiec", h = {
43
+ iconSize: "var(--igrtie0)"
44
+ };
@@ -0,0 +1,11 @@
1
+ export declare const vars: {
2
+ iconSize: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
3
+ };
4
+ export declare const IconWrapper: string;
5
+ export declare const halfIconContainer: string;
6
+ export declare const halfIconInactive: string;
7
+ export declare const halfIconActive: string;
8
+ export declare const disabled: string;
9
+ export declare const firstIcon: string;
10
+ export declare const lastIcon: string;
11
+ export declare const touchable: string;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return a;
9
+ }
10
+ });
11
+ const a = "";
@@ -0,0 +1,37 @@
1
+ /// <reference types="react" />
2
+ import type { ExclusifyUnion } from './utils/utility-types';
3
+ import type { DataAttributes, IconProps } from './utils/types';
4
+ type RatingIconProps = {
5
+ ActiveIcon: (props: IconProps) => JSX.Element;
6
+ InactiveIcon: (props: IconProps) => JSX.Element;
7
+ color: string;
8
+ };
9
+ interface BaseRatingProps {
10
+ size?: number;
11
+ dataAttributes?: DataAttributes;
12
+ valueLabels?: Array<string>;
13
+ 'aria-label'?: string;
14
+ 'aria-labelledby'?: string;
15
+ }
16
+ interface QuantitativeRatingProps extends BaseRatingProps {
17
+ type?: 'quantitative';
18
+ icon?: RatingIconProps;
19
+ count?: number;
20
+ }
21
+ interface QualitativeRatingProps extends BaseRatingProps {
22
+ type: 'qualitative';
23
+ icons?: Array<RatingIconProps>;
24
+ }
25
+ type RatingProps = ExclusifyUnion<QualitativeRatingProps | QuantitativeRatingProps> & {
26
+ value?: number;
27
+ defaultValue?: number;
28
+ onChangeValue?: (value: number) => void;
29
+ disabled?: boolean;
30
+ };
31
+ type InfoRatingProps = Omit<QuantitativeRatingProps, 'type' | 'valueLabels'> & {
32
+ value?: number;
33
+ withHalfValue?: boolean;
34
+ };
35
+ export declare const Rating: ({ dataAttributes, ...props }: RatingProps) => JSX.Element;
36
+ export declare const InfoRating: ({ dataAttributes, icon, size, ...props }: InfoRatingProps) => JSX.Element;
37
+ export {};
package/dist/rating.js ADDED
@@ -0,0 +1,320 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ function _export(target, all) {
7
+ for(var name in all)Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: all[name]
10
+ });
11
+ }
12
+ _export(exports, {
13
+ InfoRating: function() {
14
+ return at;
15
+ },
16
+ Rating: function() {
17
+ return rt;
18
+ }
19
+ });
20
+ const _jsxruntime = require("react/jsx-runtime");
21
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
22
+ const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
23
+ const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
24
+ const _themevariantcontext = require("./theme-variant-context.js");
25
+ const _ratingcssmistica = require("./rating.css-mistica.js");
26
+ const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
27
+ const _css = require("./utils/css.js");
28
+ const _environment = require("./utils/environment.js");
29
+ const _radiobutton = /*#__PURE__*/ _interop_require_wildcard(require("./radio-button.js"));
30
+ const _helpers = require("./utils/helpers.js");
31
+ const _iconstarfilled = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-star-filled.js"));
32
+ const _iconstarregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-star-regular.js"));
33
+ const _iconfacesadfilled = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-sad-filled.js"));
34
+ const _iconfacesadregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-sad-regular.js"));
35
+ const _iconfaceslightlysadfilled = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-slightly-sad-filled.js"));
36
+ const _iconfaceslightlysadregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-slightly-sad-regular.js"));
37
+ const _iconfaceneutralfilled = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-neutral-filled.js"));
38
+ const _iconfaceneutralregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-neutral-regular.js"));
39
+ const _iconfacehappyfilled = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-happy-filled.js"));
40
+ const _iconfacehappyregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-happy-regular.js"));
41
+ const _iconfacesuperhappyfilled = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-super-happy-filled.js"));
42
+ const _iconfacesuperhappyregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-face-super-happy-regular.js"));
43
+ const _hooks = require("./hooks.js");
44
+ const _texttokens = require("./text-tokens.js");
45
+ function _interop_require_default(obj) {
46
+ return obj && obj.__esModule ? obj : {
47
+ default: obj
48
+ };
49
+ }
50
+ function _getRequireWildcardCache(nodeInterop) {
51
+ if (typeof WeakMap !== "function") return null;
52
+ var cacheBabelInterop = new WeakMap();
53
+ var cacheNodeInterop = new WeakMap();
54
+ return (_getRequireWildcardCache = function(nodeInterop) {
55
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
56
+ })(nodeInterop);
57
+ }
58
+ function _interop_require_wildcard(obj, nodeInterop) {
59
+ if (!nodeInterop && obj && obj.__esModule) {
60
+ return obj;
61
+ }
62
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
63
+ return {
64
+ default: obj
65
+ };
66
+ }
67
+ var cache = _getRequireWildcardCache(nodeInterop);
68
+ if (cache && cache.has(obj)) {
69
+ return cache.get(obj);
70
+ }
71
+ var newObj = {
72
+ __proto__: null
73
+ };
74
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
75
+ for(var key in obj){
76
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
77
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
78
+ if (desc && (desc.get || desc.set)) {
79
+ Object.defineProperty(newObj, key, desc);
80
+ } else {
81
+ newObj[key] = obj[key];
82
+ }
83
+ }
84
+ }
85
+ newObj.default = obj;
86
+ if (cache) {
87
+ cache.set(obj, newObj);
88
+ }
89
+ return newObj;
90
+ }
91
+ function _define_property(obj, key, value) {
92
+ if (key in obj) {
93
+ Object.defineProperty(obj, key, {
94
+ value: value,
95
+ enumerable: true,
96
+ configurable: true,
97
+ writable: true
98
+ });
99
+ } else {
100
+ obj[key] = value;
101
+ }
102
+ return obj;
103
+ }
104
+ function _object_spread(target) {
105
+ for(var i = 1; i < arguments.length; i++){
106
+ var source = arguments[i] != null ? arguments[i] : {};
107
+ var ownKeys = Object.keys(source);
108
+ if (typeof Object.getOwnPropertySymbols === "function") {
109
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
110
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
111
+ }));
112
+ }
113
+ ownKeys.forEach(function(key) {
114
+ _define_property(target, key, source[key]);
115
+ });
116
+ }
117
+ return target;
118
+ }
119
+ function _object_without_properties(source, excluded) {
120
+ if (source == null) return {};
121
+ var target = _object_without_properties_loose(source, excluded);
122
+ var key, i;
123
+ if (Object.getOwnPropertySymbols) {
124
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
125
+ for(i = 0; i < sourceSymbolKeys.length; i++){
126
+ key = sourceSymbolKeys[i];
127
+ if (excluded.indexOf(key) >= 0) continue;
128
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
129
+ target[key] = source[key];
130
+ }
131
+ }
132
+ return target;
133
+ }
134
+ function _object_without_properties_loose(source, excluded) {
135
+ if (source == null) return {};
136
+ var target = {};
137
+ var sourceKeys = Object.keys(source);
138
+ var key, i;
139
+ for(i = 0; i < sourceKeys.length; i++){
140
+ key = sourceKeys[i];
141
+ if (excluded.indexOf(key) >= 0) continue;
142
+ target[key] = source[key];
143
+ }
144
+ return target;
145
+ }
146
+ const To = 32, _o = 16, yo = 5, Eo = {
147
+ ActiveIcon: _iconstarfilled.default,
148
+ InactiveIcon: _iconstarregular.default,
149
+ color: _skincontractcssmistica.vars.colors.controlActivated
150
+ }, Co = {
151
+ ActiveIcon: _iconstarfilled.default,
152
+ InactiveIcon: _iconstarregular.default,
153
+ color: _skincontractcssmistica.vars.colors.warning
154
+ }, V = [
155
+ {
156
+ ActiveIcon: _iconfacesadfilled.default,
157
+ InactiveIcon: _iconfacesadregular.default,
158
+ color: _skincontractcssmistica.vars.colors.errorHigh
159
+ },
160
+ {
161
+ ActiveIcon: _iconfaceslightlysadfilled.default,
162
+ InactiveIcon: _iconfaceslightlysadregular.default,
163
+ color: _skincontractcssmistica.vars.colors.error
164
+ },
165
+ {
166
+ ActiveIcon: _iconfaceneutralfilled.default,
167
+ InactiveIcon: _iconfaceneutralregular.default,
168
+ color: _skincontractcssmistica.vars.colors.warning
169
+ },
170
+ {
171
+ ActiveIcon: _iconfacehappyfilled.default,
172
+ InactiveIcon: _iconfacehappyregular.default,
173
+ color: _skincontractcssmistica.vars.colors.success
174
+ },
175
+ {
176
+ ActiveIcon: _iconfacesuperhappyfilled.default,
177
+ InactiveIcon: _iconfacesuperhappyregular.default,
178
+ color: _skincontractcssmistica.vars.colors.successHigh
179
+ }
180
+ ], Go = (param)=>{
181
+ let { value: i, defaultValue: e, iconsCount: I, onChangeValue: a } = param;
182
+ const n = i !== void 0, p = _react.useCallback((l)=>l === void 0 ? 0 : Math.max(0, Math.min(I, l)), [
183
+ I
184
+ ]), [A, F] = _react.useState(p(e)), R = (l)=>{
185
+ n || F(l), a == null || a(l);
186
+ };
187
+ return [
188
+ n ? p(i) : A,
189
+ R
190
+ ];
191
+ }, H = (param)=>{
192
+ let { icons: i = V, count: e = yo, icon: I = Eo, size: a = To, type: n = "quantitative", dataAttributes: p, onChangeValue: A, defaultValue: F, value: R, disabled: l, role: S, valueLabels: O, withHalfValue: Q, "aria-label": f, "aria-labelledby": L } = param;
193
+ const { texts: v, t: u } = (0, _hooks.useTheme)(), $ = [
194
+ v.ratingVeryBadLabel || u(_texttokens.ratingVeryBadLabel),
195
+ v.ratingBadLabel || u(_texttokens.ratingBadLabel),
196
+ v.ratingRegularLabel || u(_texttokens.ratingRegularLabel),
197
+ v.ratingGoodLabel || u(_texttokens.ratingGoodLabel),
198
+ v.ratingVeryGoodLabel || u(_texttokens.ratingVeryGoodLabel)
199
+ ], B = Array.from({
200
+ length: e
201
+ }, (o, t)=>(v.ratingQuantitativeLabel || u(_texttokens.ratingQuantitativeLabel)).replace("1$s", String(t + 1)).replace("2$s", String(e))), m = n === "qualitative" ? i : Array.from({
202
+ length: e
203
+ }, ()=>I), g = O !== null && O !== void 0 ? O : n === "qualitative" && (0, _helpers.isEqual)(m, V) ? $ : B, b = S === "radiogroup", _ = b ? 16 : a <= 16 ? 2 : a <= 24 ? 4 : 8, y = (0, _themevariantcontext.useThemeVariant)(), [N, E] = _react.useState(void 0), C = (0, _environment.isTouchableDevice)(), [s, M] = Go({
204
+ value: R,
205
+ defaultValue: F,
206
+ iconsCount: m.length,
207
+ onChangeValue: A
208
+ }), j = (o)=>N !== void 0 && !l ? n === "qualitative" && o === N || n === "quantitative" && o <= N ? "active" : "inactive" : n === "qualitative" ? o === s ? "active" : "inactive" : b ? o <= s ? "active" : "inactive" : Q ? o - 0.75 <= s && s < o - 0.25 ? "half" : o - 0.25 <= s ? "active" : "inactive" : o - 0.5 < s ? "active" : "inactive", w = (o, t)=>{
209
+ const d = y === "inverse" ? _skincontractcssmistica.vars.colors.inverse : m[t].color, h = y === "inverse" ? _skincontractcssmistica.vars.colors.inverse : b ? _skincontractcssmistica.vars.colors.control : m[0].color;
210
+ switch(j(t + 1)){
211
+ case "active":
212
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(o.ActiveIcon, {
213
+ size: a,
214
+ color: d
215
+ }, t);
216
+ case "inactive":
217
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(o.InactiveIcon, {
218
+ size: a,
219
+ color: h
220
+ }, t);
221
+ case "half":
222
+ default:
223
+ return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
224
+ className: _ratingcssmistica.halfIconContainer,
225
+ children: [
226
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
227
+ className: _ratingcssmistica.halfIconInactive,
228
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(o.InactiveIcon, {
229
+ size: a,
230
+ color: h
231
+ })
232
+ }),
233
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
234
+ className: _ratingcssmistica.halfIconActive,
235
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(o.ActiveIcon, {
236
+ size: a,
237
+ color: d
238
+ })
239
+ })
240
+ ]
241
+ }, t);
242
+ }
243
+ }, G = (o, t)=>{
244
+ const d = w(o, t);
245
+ return b ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_radiobutton.default, {
246
+ "aria-label": g[t],
247
+ value: g[t],
248
+ render: (param)=>{
249
+ let { labelId: h, disabled: Z } = param;
250
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
251
+ id: h,
252
+ onMouseEnter: ()=>{
253
+ C || E(t + 1);
254
+ },
255
+ onMouseLeave: ()=>{
256
+ C || E(void 0);
257
+ },
258
+ style: (0, _css.applyCssVars)({
259
+ [_ratingcssmistica.vars.iconSize]: `${a}px`
260
+ }),
261
+ className: (0, _classnames.default)(_ratingcssmistica.touchable, {
262
+ [_ratingcssmistica.disabled]: Z,
263
+ [_ratingcssmistica.firstIcon]: t === 0,
264
+ [_ratingcssmistica.lastIcon]: t === m.length - 1
265
+ }),
266
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
267
+ className: _ratingcssmistica.IconWrapper,
268
+ children: d
269
+ })
270
+ });
271
+ }
272
+ }, t) : d;
273
+ };
274
+ return S === "img" ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
275
+ space: _,
276
+ dataAttributes: p,
277
+ role: S,
278
+ "aria-label": f !== null && f !== void 0 ? f : L ? void 0 : `${s} de ${e}`,
279
+ "aria-labelledby": f ? void 0 : L,
280
+ children: m.map(G)
281
+ }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_radiobutton.RadioGroup, {
282
+ name: "info-rating",
283
+ "aria-label": f,
284
+ "aria-labelledby": f ? void 0 : L,
285
+ disabled: l,
286
+ onChange: (o)=>{
287
+ M(g.findIndex((t)=>t === o) + 1);
288
+ },
289
+ value: g[s - 1],
290
+ dataAttributes: p,
291
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
292
+ space: _,
293
+ children: m.map(G)
294
+ })
295
+ });
296
+ }, rt = (_param)=>{
297
+ var { dataAttributes: i } = _param, e = _object_without_properties(_param, [
298
+ "dataAttributes"
299
+ ]);
300
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(H, _object_spread({
301
+ role: "radiogroup",
302
+ dataAttributes: _object_spread({
303
+ "component-name": "Rating"
304
+ }, i)
305
+ }, e));
306
+ }, at = (_param)=>{
307
+ var { dataAttributes: i, icon: e, size: I } = _param, a = _object_without_properties(_param, [
308
+ "dataAttributes",
309
+ "icon",
310
+ "size"
311
+ ]);
312
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(H, _object_spread({
313
+ size: I !== null && I !== void 0 ? I : _o,
314
+ icon: e !== null && e !== void 0 ? e : Co,
315
+ role: "img",
316
+ dataAttributes: _object_spread({
317
+ "component-name": "InfoRating"
318
+ }, i)
319
+ }, a));
320
+ };
@@ -3,6 +3,7 @@ import type { CommonFormFieldProps } from './text-field-base';
3
3
  export interface SearchFieldProps extends CommonFormFieldProps {
4
4
  onChangeValue?: (value: string, rawValue: string) => void;
5
5
  getSuggestions?: (value: string) => ReadonlyArray<string>;
6
+ inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];
6
7
  }
7
8
  declare const SearchField: React.ForwardRefExoticComponent<SearchFieldProps & React.RefAttributes<any>>;
8
9
  export default SearchField;