@telefonica/mistica 15.16.4 → 15.18.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 (114) hide show
  1. package/css/mistica.css +1 -1
  2. package/css/roboto.css +102 -34
  3. package/dist/box.d.ts +1 -0
  4. package/dist/box.js +11 -10
  5. package/dist/callout.d.ts +1 -0
  6. package/dist/callout.js +10 -10
  7. package/dist/card.d.ts +6 -1
  8. package/dist/card.js +375 -365
  9. package/dist/chip.d.ts +1 -0
  10. package/dist/chip.js +25 -26
  11. package/dist/dialog.d.ts +1 -0
  12. package/dist/dialog.js +65 -62
  13. package/dist/feedback.js +58 -52
  14. package/dist/generated/mistica-icons/icon-box-star-filled.d.ts +4 -0
  15. package/dist/generated/mistica-icons/icon-box-star-filled.js +121 -0
  16. package/dist/generated/mistica-icons/icon-box-star-light.d.ts +4 -0
  17. package/dist/generated/mistica-icons/icon-box-star-light.js +117 -0
  18. package/dist/generated/mistica-icons/icon-box-star-regular.d.ts +4 -0
  19. package/dist/generated/mistica-icons/icon-box-star-regular.js +117 -0
  20. package/dist/generated/mistica-icons/icon-high-priority-filled.d.ts +4 -0
  21. package/dist/generated/mistica-icons/icon-high-priority-filled.js +111 -0
  22. package/dist/generated/mistica-icons/icon-high-priority-light.d.ts +4 -0
  23. package/dist/generated/mistica-icons/icon-high-priority-light.js +111 -0
  24. package/dist/generated/mistica-icons/icon-high-priority-regular.d.ts +4 -0
  25. package/dist/generated/mistica-icons/icon-high-priority-regular.js +111 -0
  26. package/dist/generated/mistica-icons/icon-mms-filled.d.ts +4 -0
  27. package/dist/generated/mistica-icons/icon-mms-filled.js +122 -0
  28. package/dist/generated/mistica-icons/icon-mms-light.d.ts +4 -0
  29. package/dist/generated/mistica-icons/icon-mms-light.js +134 -0
  30. package/dist/generated/mistica-icons/icon-mms-regular.d.ts +4 -0
  31. package/dist/generated/mistica-icons/icon-mms-regular.js +134 -0
  32. package/dist/generated/mistica-icons/icon-vivo-valoriza-filled.d.ts +4 -0
  33. package/dist/generated/mistica-icons/icon-vivo-valoriza-filled.js +111 -0
  34. package/dist/generated/mistica-icons/icon-vivo-valoriza-light.d.ts +4 -0
  35. package/dist/generated/mistica-icons/icon-vivo-valoriza-light.js +117 -0
  36. package/dist/generated/mistica-icons/icon-vivo-valoriza-regular.d.ts +4 -0
  37. package/dist/generated/mistica-icons/icon-vivo-valoriza-regular.js +117 -0
  38. package/dist/generated/mistica-icons/icons-keywords.js +31 -0
  39. package/dist/index.d.ts +12 -0
  40. package/dist/index.js +48 -0
  41. package/dist/inline.css-mistica.js +11 -8
  42. package/dist/inline.css.d.ts +1 -0
  43. package/dist/inline.js +12 -12
  44. package/dist/list.d.ts +1 -0
  45. package/dist/list.js +163 -157
  46. package/dist/package-version.js +1 -1
  47. package/dist/popover.d.ts +1 -0
  48. package/dist/popover.js +9 -7
  49. package/dist/select.js +103 -95
  50. package/dist/skins/blau.js +96 -8
  51. package/dist/skins/defaults.js +98 -10
  52. package/dist/skins/movistar.js +94 -6
  53. package/dist/skins/o2-new.js +95 -7
  54. package/dist/skins/o2.js +94 -6
  55. package/dist/skins/skin-contract.css-mistica.js +42 -10
  56. package/dist/skins/skin-contract.css.d.ts +32 -0
  57. package/dist/skins/telefonica.js +96 -8
  58. package/dist/skins/tu.js +94 -6
  59. package/dist/skins/types/index.d.ts +36 -28
  60. package/dist/skins/vivo-new.js +95 -7
  61. package/dist/skins/vivo.js +94 -6
  62. package/dist/snackbar-context.js +23 -22
  63. package/dist/snackbar.d.ts +1 -0
  64. package/dist/snackbar.js +63 -57
  65. package/dist/theme-context-provider.js +91 -63
  66. package/dist/theme-context.css-mistica.js +452 -0
  67. package/dist/theme-context.css.d.ts +432 -0
  68. package/dist/theme-context.css.ts.vanilla.css-mistica.js +11 -0
  69. package/dist/tooltip.d.ts +1 -0
  70. package/dist/tooltip.js +110 -110
  71. package/dist-es/box.js +17 -16
  72. package/dist-es/callout.js +38 -38
  73. package/dist-es/card.js +492 -482
  74. package/dist-es/chip.js +49 -50
  75. package/dist-es/dialog.js +78 -75
  76. package/dist-es/feedback.js +96 -89
  77. package/dist-es/generated/mistica-icons/icon-box-star-filled.js +112 -0
  78. package/dist-es/generated/mistica-icons/icon-box-star-light.js +108 -0
  79. package/dist-es/generated/mistica-icons/icon-box-star-regular.js +108 -0
  80. package/dist-es/generated/mistica-icons/icon-high-priority-filled.js +102 -0
  81. package/dist-es/generated/mistica-icons/icon-high-priority-light.js +102 -0
  82. package/dist-es/generated/mistica-icons/icon-high-priority-regular.js +102 -0
  83. package/dist-es/generated/mistica-icons/icon-mms-filled.js +113 -0
  84. package/dist-es/generated/mistica-icons/icon-mms-light.js +125 -0
  85. package/dist-es/generated/mistica-icons/icon-mms-regular.js +125 -0
  86. package/dist-es/generated/mistica-icons/icon-vivo-valoriza-filled.js +102 -0
  87. package/dist-es/generated/mistica-icons/icon-vivo-valoriza-light.js +108 -0
  88. package/dist-es/generated/mistica-icons/icon-vivo-valoriza-regular.js +108 -0
  89. package/dist-es/generated/mistica-icons/icons-keywords.js +31 -0
  90. package/dist-es/index.js +1563 -1551
  91. package/dist-es/inline.css-mistica.js +3 -3
  92. package/dist-es/inline.js +23 -23
  93. package/dist-es/list.js +225 -219
  94. package/dist-es/package-version.js +1 -1
  95. package/dist-es/popover.js +26 -24
  96. package/dist-es/select.js +146 -138
  97. package/dist-es/skins/blau.js +96 -8
  98. package/dist-es/skins/defaults.js +97 -9
  99. package/dist-es/skins/movistar.js +94 -6
  100. package/dist-es/skins/o2-new.js +95 -7
  101. package/dist-es/skins/o2.js +94 -6
  102. package/dist-es/skins/skin-contract.css-mistica.js +42 -10
  103. package/dist-es/skins/telefonica.js +98 -10
  104. package/dist-es/skins/tu.js +94 -6
  105. package/dist-es/skins/vivo-new.js +95 -7
  106. package/dist-es/skins/vivo.js +94 -6
  107. package/dist-es/snackbar-context.js +25 -24
  108. package/dist-es/snackbar.js +91 -85
  109. package/dist-es/style.css +1 -1
  110. package/dist-es/theme-context-provider.js +133 -105
  111. package/dist-es/theme-context.css-mistica.js +432 -0
  112. package/dist-es/theme-context.css.ts.vanilla.css-mistica.js +2 -0
  113. package/dist-es/tooltip.js +149 -149
  114. package/package.json +2 -3
@@ -1,2 +1,2 @@
1
- const o = "15.16.4";
1
+ const o = "15.18.0";
2
2
  export { o as PACKAGE_VERSION };
@@ -55,48 +55,49 @@ function _object_without_properties_loose(source, excluded) {
55
55
  return target;
56
56
  }
57
57
  import { jsx as r, jsxs as t } from "react/jsx-runtime";
58
- import { BaseTooltip as f } from "./tooltip.js";
59
- import d from "./inline.js";
60
- import h from "./stack.js";
61
- import { Text3 as u, Text2 as x } from "./text.js";
62
- import v from "./box.js";
63
- import { content as g } from "./popover.css-mistica.js";
64
- import { vars as y } from "./skins/skin-contract.css-mistica.js";
65
- import { iconContainerSize as P } from "./icon-button.css-mistica.js";
66
- const S = (_param)=>{
67
- var { open: a, extra: m, children: c, onClose: i = ()=>{}, dataAttributes: l, trackingEvent: p, title: o, description: e, asset: n } = _param, s = _object_without_properties(_param, [
58
+ import { BaseTooltip as d } from "./tooltip.js";
59
+ import h from "./inline.js";
60
+ import u from "./stack.js";
61
+ import { Text3 as x, Text2 as v } from "./text.js";
62
+ import g from "./box.js";
63
+ import { content as y } from "./popover.css-mistica.js";
64
+ import { vars as P } from "./skins/skin-contract.css-mistica.js";
65
+ import { iconContainerSize as S } from "./icon-button.css-mistica.js";
66
+ const T = (_param)=>{
67
+ var { open: a, extra: m, children: c, onClose: i = ()=>{}, closeButtonLabel: l, dataAttributes: p, trackingEvent: s, title: o, description: e, asset: n } = _param, f = _object_without_properties(_param, [
68
68
  "open",
69
69
  "extra",
70
70
  "children",
71
71
  "onClose",
72
+ "closeButtonLabel",
72
73
  "dataAttributes",
73
74
  "trackingEvent",
74
75
  "title",
75
76
  "description",
76
77
  "asset"
77
78
  ]);
78
- return /* @__PURE__ */ r(f, _object_spread({
79
- content: /* @__PURE__ */ t(v, {
80
- className: g,
79
+ return /* @__PURE__ */ r(d, _object_spread({
80
+ content: /* @__PURE__ */ t(g, {
81
+ className: y,
81
82
  children: [
82
83
  (o || e || n) && /* @__PURE__ */ r("div", {
83
84
  style: {
84
- paddingRight: `calc((${P.small} - 8px)`
85
+ paddingRight: `calc((${S.small} - 8px)`
85
86
  },
86
- children: /* @__PURE__ */ t(d, {
87
+ children: /* @__PURE__ */ t(h, {
87
88
  space: 16,
88
89
  children: [
89
90
  n,
90
- /* @__PURE__ */ t(h, {
91
+ /* @__PURE__ */ t(u, {
91
92
  space: 4,
92
93
  children: [
93
- o && /* @__PURE__ */ r(u, {
94
+ o && /* @__PURE__ */ r(x, {
94
95
  regular: !0,
95
96
  children: o
96
97
  }),
97
- e && /* @__PURE__ */ r(x, {
98
+ e && /* @__PURE__ */ r(v, {
98
99
  regular: !0,
99
- color: y.colors.textSecondary,
100
+ color: P.colors.textSecondary,
100
101
  children: e
101
102
  })
102
103
  ]
@@ -112,10 +113,11 @@ const S = (_param)=>{
112
113
  hasPointerInteractionOnly: !0,
113
114
  delay: !1,
114
115
  onClose: i,
115
- trackingEvent: p,
116
+ closeButtonLabel: l,
117
+ trackingEvent: s,
116
118
  dataAttributes: _object_spread({
117
119
  "component-name": "Popover"
118
- }, l)
119
- }, s));
120
- }, A = S;
121
- export { A as default };
120
+ }, p)
121
+ }, f));
122
+ }, N = T;
123
+ export { N as default };
package/dist-es/select.js CHANGED
@@ -51,29 +51,29 @@ function _object_spread_props(target, source) {
51
51
  }
52
52
  return target;
53
53
  }
54
- import { jsx as r, jsxs as k, Fragment as ke } from "react/jsx-runtime";
54
+ import { jsx as r, jsxs as _, Fragment as ke } from "react/jsx-runtime";
55
55
  import * as n from "react";
56
- import C from "classnames";
56
+ import k from "classnames";
57
57
  import { useForm as Ce } from "./form-context.js";
58
- import { useAriaId as Ve, useTheme as Pe } from "./hooks.js";
59
- import { SPACE as ne, ENTER as re, ESC as De, TAB as Me, UP as He, DOWN as Fe } from "./utils/keys.js";
60
- import { FieldContainer as We, HelperText as Ge, Label as Le } from "./text-field-components.js";
61
- import se from "./generated/mistica-icons/icon-chevron-down-regular.js";
62
- import { TextFieldBaseAutosuggest as Ze } from "./text-field-base.js";
63
- import $e from "./overlay.js";
64
- import { isAndroid as Be, isIos as qe } from "./utils/platform.js";
65
- import { cancelEvent as m } from "./utils/dom.js";
66
- import { Text3 as ze } from "./text.js";
67
- import { selectVariants as je, arrowDown as Ke, iconContainer as oe, selectContainerVariants as Ue, selectTextVariants as Xe, vars as b, optionsContainer as Je, optionsAnimationsVariants as ie, menuItem as Qe, menuItemSelected as Ye } from "./select.css-mistica.js";
68
- import { inputWithLabel as ce, inputWithoutLabel as ae } from "./text-field-base.css-mistica.js";
69
- import { Portal as et } from "./portal.js";
70
- import { pxToRem as tt, applyCssVars as nt } from "./utils/css.js";
71
- import { ThemeVariant as rt } from "./theme-variant-context.js";
72
- const st = (param)=>{
73
- let { id: le, label: w, helperText: ue, value: fe, defaultValue: de, onChangeValue: V, name: i, fullWidth: P, options: f, optional: D, disabled: pe, error: me, onBlur: M, autoFocus: z = !1, native: he } = param;
74
- var te;
75
- const h = n.useRef(null), d = n.useRef(null), S = n.useRef(null), v = n.useRef(null), N = n.useRef(/* @__PURE__ */ new Map()), [Se, ve] = n.useState(!0), [l, ge] = n.useState(de), [H, j] = n.useState(!1), [K, U] = n.useState(!1), [X, x] = n.useState(!1), [u, F] = n.useState({}), [g, W] = n.useState(), G = n.useRef(null), L = Ve(le), { rawValues: Te, setRawValue: Z, setValue: $, formStatus: Ie, formErrors: J, setFormError: Ee, register: B } = Ce(), { platformOverrides: Q } = Pe(), we = he || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || Be(Q) || qe(Q), T = pe || Ie === "sending", R = me || !!J[i], Y = J[i] || ue, a = fe !== null && fe !== void 0 ? fe : Te[i], A = (e)=>{
76
- V == null || V(e), Ee({
58
+ import { useAriaId as Pe, useTheme as De } from "./hooks.js";
59
+ import { SPACE as re, ENTER as se, ESC as Me, TAB as He, UP as Fe, DOWN as We } from "./utils/keys.js";
60
+ import { FieldContainer as Ge, HelperText as Le, Label as Ze } from "./text-field-components.js";
61
+ import oe from "./generated/mistica-icons/icon-chevron-down-regular.js";
62
+ import { TextFieldBaseAutosuggest as $e } from "./text-field-base.js";
63
+ import Be from "./overlay.js";
64
+ import { isAndroid as qe, isIos as ze } from "./utils/platform.js";
65
+ import { cancelEvent as p } from "./utils/dom.js";
66
+ import { Text3 as je } from "./text.js";
67
+ import { selectVariants as Ke, arrowDown as Ue, iconContainer as ie, selectContainerVariants as Xe, selectTextVariants as Je, vars as N, optionsContainer as Qe, optionsAnimationsVariants as ce, menuItem as Ye, menuItemSelected as et } from "./select.css-mistica.js";
68
+ import { inputWithLabel as ae, inputWithoutLabel as le } from "./text-field-base.css-mistica.js";
69
+ import { Portal as tt } from "./portal.js";
70
+ import { pxToRem as nt, applyCssVars as rt } from "./utils/css.js";
71
+ import { ThemeVariant as st } from "./theme-variant-context.js";
72
+ const ot = (param)=>{
73
+ let { id: ue, label: m, helperText: de, value: fe, defaultValue: pe, onChangeValue: C, name: i, fullWidth: P, options: u, optional: D, disabled: me, error: he, onBlur: M, autoFocus: z = !1, native: Se } = param;
74
+ var ne;
75
+ const h = n.useRef(null), d = n.useRef(null), S = n.useRef(null), v = n.useRef(null), R = n.useRef(/* @__PURE__ */ new Map()), [ve, ge] = n.useState(!0), [g, Te] = n.useState(pe), [H, j] = n.useState(!1), [K, U] = n.useState(!1), [X, O] = n.useState(!1), [a, F] = n.useState({}), [T, W] = n.useState(), G = n.useRef(null), L = Pe(ue), { rawValues: Ie, setRawValue: Z, setValue: $, formStatus: Ee, formErrors: J, setFormError: we, register: B } = Ce(), { platformOverrides: Q } = De(), xe = Se || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || qe(Q) || ze(Q), I = me || Ee === "sending", A = he || !!J[i], Y = J[i] || de, l = fe !== null && fe !== void 0 ? fe : Ie[i], ee = (e)=>{
76
+ C == null || C(e), we({
77
77
  name: i,
78
78
  error: ""
79
79
  }), Z({
@@ -83,68 +83,68 @@ const st = (param)=>{
83
83
  name: i,
84
84
  value: e
85
85
  });
86
- }, I = (e)=>{
86
+ }, E = (e)=>{
87
87
  if (e) {
88
88
  if (S != null && S.current) {
89
- const o = S.current.getBoundingClientRect(), p = o.top, E = o.width, O = o.left, Re = o.height, y = p + Re, _ = Math.min(f.length, 8) * 48 + 16;
90
- if (y + _ + 12 > window.innerHeight) {
91
- const Ae = window.innerHeight - y;
92
- if (p > Ae) {
93
- const _e = p - _;
89
+ const o = S.current.getBoundingClientRect(), f = o.top, x = o.width, y = o.left, Ae = o.height, b = f + Ae, V = Math.min(u.length, 8) * 48 + 16;
90
+ if (b + V + 12 > window.innerHeight) {
91
+ const Ve = window.innerHeight - b;
92
+ if (f > Ve) {
93
+ const _e = f - V;
94
94
  F({
95
- minWidth: E,
96
- left: O,
95
+ minWidth: x,
96
+ left: y,
97
97
  top: Math.max(_e, 12),
98
- maxHeight: Math.min(p - 12, _),
98
+ maxHeight: Math.min(f - 12, V),
99
99
  transformOrigin: "center bottom"
100
100
  });
101
101
  } else F({
102
- minWidth: E,
103
- top: y,
104
- left: O,
105
- maxHeight: window.innerHeight - y - 12,
102
+ minWidth: x,
103
+ top: b,
104
+ left: y,
105
+ maxHeight: window.innerHeight - b - 12,
106
106
  transformOrigin: "center top"
107
107
  });
108
108
  } else F({
109
- minWidth: E,
110
- top: y,
111
- left: O,
112
- maxHeight: _,
109
+ minWidth: x,
110
+ top: b,
111
+ left: y,
112
+ maxHeight: V,
113
113
  transformOrigin: "center top"
114
114
  });
115
115
  }
116
116
  j(!0), requestAnimationFrame(()=>{
117
117
  G.current && v.current && "scrollTop" in v.current && (v.current.scrollTop = G.current), U(!0);
118
- }), W(l !== null && l !== void 0 ? l : a);
118
+ }), W(g !== null && g !== void 0 ? g : l);
119
119
  } else U(!1), j(!1), W(void 0);
120
120
  }, q = (e)=>{
121
121
  var t;
122
- G.current = (t = v.current) == null ? void 0 : t.scrollTop, I(!1), A && typeof e == "string" && A(e), typeof a > "u" && ge(e);
123
- }, xe = (e)=>{
122
+ G.current = (t = v.current) == null ? void 0 : t.scrollTop, E(!1), ee && typeof e == "string" && ee(e), typeof l > "u" && Te(e);
123
+ }, Oe = (e)=>{
124
124
  var s;
125
125
  const t = (s = v.current) == null ? void 0 : s.getBoundingClientRect();
126
- if (t && e && N.current.has(e)) {
127
- const c = N.current.get(e), o = c == null ? void 0 : c.getBoundingClientRect();
126
+ if (t && e && R.current.has(e)) {
127
+ const c = R.current.get(e), o = c == null ? void 0 : c.getBoundingClientRect();
128
128
  if (o && o.top + o.height / 2 >= t.top + t.height) {
129
129
  c == null || c.scrollIntoView();
130
130
  return;
131
131
  }
132
132
  o && o.top + o.height / 2 <= t.top && (c == null || c.scrollIntoView(!1));
133
133
  }
134
- }, Oe = d.current, ye = h.current;
134
+ }, ye = d.current, be = h.current;
135
135
  n.useEffect(()=>{
136
136
  Z({
137
137
  name: i,
138
- value: a
138
+ value: l
139
139
  }), $({
140
140
  name: i,
141
- value: a
141
+ value: l
142
142
  });
143
143
  }, [
144
144
  i,
145
145
  Z,
146
146
  $,
147
- a
147
+ l
148
148
  ]), n.useEffect(()=>(B(i, {
149
149
  input: h.current,
150
150
  focusableElement: d.current
@@ -158,38 +158,38 @@ const st = (param)=>{
158
158
  B,
159
159
  d,
160
160
  h,
161
- Oe,
162
- ye
161
+ ye,
162
+ be
163
163
  ]), n.useEffect(()=>{
164
164
  const e = (s)=>{
165
- var p;
165
+ var f;
166
166
  const o = {
167
- [He]: -1,
168
- [Fe]: 1
167
+ [Fe]: -1,
168
+ [We]: 1
169
169
  }[s.key];
170
170
  if (o) {
171
- m(s);
171
+ p(s);
172
172
  var _ref;
173
- const E = (_ref = (p = f[f.findIndex((param)=>{
174
- let { value: O } = param;
175
- return O === g;
176
- }) + o]) == null ? void 0 : p.value) !== null && _ref !== void 0 ? _ref : g;
177
- W(E), xe(E);
173
+ const x = (_ref = (f = u[u.findIndex((param)=>{
174
+ let { value: y } = param;
175
+ return y === T;
176
+ }) + o]) == null ? void 0 : f.value) !== null && _ref !== void 0 ? _ref : T;
177
+ W(x), Oe(x);
178
178
  }
179
179
  }, t = (s)=>{
180
180
  if (H) switch(s.key){
181
- case Me:
182
- m(s);
181
+ case He:
182
+ p(s);
183
183
  break;
184
- case De:
185
- I(!1);
184
+ case Me:
185
+ E(!1);
186
186
  break;
187
+ case se:
187
188
  case re:
188
- case ne:
189
- m(s), f.findIndex((param)=>{
189
+ p(s), u.findIndex((param)=>{
190
190
  let { value: c } = param;
191
- return c === g;
192
- }) !== -1 && g !== l && q(g), I(!1);
191
+ return c === T;
192
+ }) !== -1 && T !== g && q(T), E(!1);
193
193
  break;
194
194
  }
195
195
  K && e(s);
@@ -202,57 +202,57 @@ const st = (param)=>{
202
202
  }, [
203
203
  z
204
204
  ]), n.useEffect(()=>{
205
- ve(!1);
205
+ ge(!1);
206
206
  }, []);
207
- const be = (e)=>{
207
+ const Ne = (e)=>{
208
208
  var t;
209
- return e ? (t = f.find((param)=>{
209
+ return e ? (t = u.find((param)=>{
210
210
  let { value: s } = param;
211
211
  return s === e;
212
212
  })) == null ? void 0 : t.text : "";
213
- }, Ne = {
213
+ }, Re = {
214
214
  tabIndex: 0,
215
- onFocus: ()=>x(!0),
216
- onBlur: ()=>x(!1),
215
+ onFocus: ()=>O(!0),
216
+ onBlur: ()=>O(!1),
217
217
  onClick: ()=>{
218
- I(!0), x(!0);
218
+ E(!0), O(!0);
219
219
  },
220
220
  onKeyDown: (e)=>{
221
- !H && (e.key === ne || e.key === re) && (m(e), I(!0));
221
+ !H && (e.key === re || e.key === se) && (p(e), E(!0));
222
222
  }
223
- }, ee = tt(20);
224
- var _ref, _u_transformOrigin;
225
- return /* @__PURE__ */ r(rt, {
223
+ }, te = nt(20), w = g !== null && g !== void 0 ? g : l;
224
+ var _a_transformOrigin;
225
+ return /* @__PURE__ */ r(st, {
226
226
  isInverse: !1,
227
- children: we || Se ? /* @__PURE__ */ k(We, {
228
- disabled: T,
229
- helperText: /* @__PURE__ */ r(Ge, {
230
- error: R,
227
+ children: xe || ve ? /* @__PURE__ */ _(Ge, {
228
+ disabled: I,
229
+ helperText: /* @__PURE__ */ r(Le, {
230
+ error: A,
231
231
  leftText: Y
232
232
  }),
233
233
  fieldRef: S,
234
234
  fullWidth: P,
235
235
  children: [
236
- w && /* @__PURE__ */ r(Le, {
237
- error: R,
236
+ m && /* @__PURE__ */ r(Ze, {
237
+ error: A,
238
238
  forId: L,
239
- inputState: X ? "focused" : ((_ref = a !== null && a !== void 0 ? a : l) !== null && _ref !== void 0 ? _ref : (te = h.current) == null ? void 0 : te.value) ? "filled" : "default",
239
+ inputState: X ? "focused" : (w !== null && w !== void 0 ? w : (ne = h.current) == null ? void 0 : ne.value) ? "filled" : "default",
240
240
  optional: D,
241
- children: w
241
+ children: m
242
242
  }),
243
- /* @__PURE__ */ k("select", {
244
- className: C(je[T ? "disabled" : "default"], w ? ce : ae),
243
+ /* @__PURE__ */ _("select", {
244
+ className: k(Ke[I ? "disabled" : "default"], m ? ae : le),
245
245
  id: L,
246
- "aria-invalid": !!R,
247
- value: a !== null && a !== void 0 ? a : l,
246
+ "aria-invalid": !!A,
247
+ value: w,
248
248
  required: !D,
249
- disabled: T,
249
+ disabled: I,
250
250
  onChange: (e)=>{
251
- q(e.target.value), A && A(e.target.value);
251
+ q(e.target.value);
252
252
  },
253
- onFocus: ()=>x(!0),
253
+ onFocus: ()=>O(!0),
254
254
  onBlur: (e)=>{
255
- x(!1), M == null || M(e);
255
+ O(!1), M == null || M(e);
256
256
  },
257
257
  ref: (e)=>{
258
258
  [
@@ -265,21 +265,29 @@ const st = (param)=>{
265
265
  style: {
266
266
  // Override default browser opacity when disabled. This opacity also affects the label.
267
267
  // Without this fix, the label is invisible when disabled
268
- opacity: 1
268
+ opacity: 1,
269
+ // Use transparent color for the empty option (show below) to avoid showing it when the menu is closed
270
+ color: w ? void 0 : "transparent"
269
271
  },
270
272
  children: [
271
- f.every((param)=>{
273
+ !w && u.every((param)=>{
272
274
  let { value: e } = param;
273
275
  return !!e;
274
- }) && // if no "empty" option exists, insert a dummy empty option
275
- // this is needed to allow a native select with no selected option
276
+ }) && // If no "empty" option exists, insert a dummy empty option. Once an option is selected,
277
+ // this empty option is removed. This is needed to allow a native select without a selected
278
+ // default option.
279
+ // Chrome doesn't show this option when the select menu is open (because of display: none),
280
+ // but Safari does. So we use the select's label for this option, otherwise it would be shown
281
+ // as an empty option, which is weirder.
276
282
  /* @__PURE__ */ r("option", {
277
283
  value: "",
278
284
  style: {
279
285
  display: "none"
280
- }
286
+ },
287
+ "aria-label": "",
288
+ children: m
281
289
  }),
282
- f.map((param)=>{
290
+ u.map((param)=>{
283
291
  let { value: e, text: t } = param;
284
292
  return(// Set color: 'initial' to avoid wrong text color in some browsers when using dark mode.
285
293
  // Similar issue in another lib: https://github.com/chakra-ui/chakra-ui/issues/417#issue-566611352
@@ -294,88 +302,88 @@ const st = (param)=>{
294
302
  ]
295
303
  }),
296
304
  /* @__PURE__ */ r("div", {
297
- className: Ke,
305
+ className: Ue,
298
306
  "aria-hidden": !0,
299
307
  children: /* @__PURE__ */ r("div", {
300
- className: oe,
301
- children: /* @__PURE__ */ r(se, {
302
- size: ee
308
+ className: ie,
309
+ children: /* @__PURE__ */ r(oe, {
310
+ size: te
303
311
  })
304
312
  })
305
313
  })
306
314
  ]
307
- }) : /* @__PURE__ */ k(ke, {
315
+ }) : /* @__PURE__ */ _(ke, {
308
316
  children: [
309
- /* @__PURE__ */ k("div", _object_spread_props(_object_spread({
310
- className: Ue[P ? "fullWidth" : "default"],
317
+ /* @__PURE__ */ _("div", _object_spread_props(_object_spread({
318
+ className: Xe[P ? "fullWidth" : "default"],
311
319
  role: "button",
312
320
  "aria-haspopup": "listbox",
313
321
  ref: d
314
- }, !T && Ne), {
322
+ }, !I && Re), {
315
323
  children: [
316
- /* @__PURE__ */ r(Ze, {
324
+ /* @__PURE__ */ r($e, {
317
325
  style: {
318
326
  visibility: "hidden"
319
327
  },
320
328
  fullWidth: P,
321
329
  endIcon: /* @__PURE__ */ r("div", {
322
- className: oe,
323
- children: /* @__PURE__ */ r(se, {
324
- size: ee
330
+ className: ie,
331
+ children: /* @__PURE__ */ r(oe, {
332
+ size: te
325
333
  })
326
334
  }),
327
335
  focus: X,
328
- label: w,
329
- value: a !== null && a !== void 0 ? a : l,
330
- shrinkLabel: !!(a || l),
336
+ label: m,
337
+ value: w,
338
+ shrinkLabel: !!(l || g),
331
339
  name: i,
332
340
  helperText: Y,
333
341
  required: !D,
334
- disabled: T,
342
+ disabled: I,
335
343
  id: L,
336
- error: R,
344
+ error: A,
337
345
  inputRef: h,
338
346
  fieldRef: S
339
347
  }),
340
348
  /* @__PURE__ */ r("div", {
341
- className: C(Xe[T ? "disabled" : "default"], w ? ce : ae),
342
- children: be(a !== null && a !== void 0 ? a : l)
349
+ className: k(Je[I ? "disabled" : "default"], m ? ae : le),
350
+ children: Ne(w)
343
351
  })
344
352
  ]
345
353
  })),
346
- H && /* @__PURE__ */ r($e, {
354
+ H && /* @__PURE__ */ r(Be, {
347
355
  onPress: (e)=>{
348
- I(!1), m(e);
356
+ E(!1), p(e);
349
357
  },
350
358
  disableScroll: !0,
351
- children: /* @__PURE__ */ r(et, {
359
+ children: /* @__PURE__ */ r(tt, {
352
360
  children: /* @__PURE__ */ r("ul", {
353
- style: nt({
354
- [b.top]: u.top ? `${u.top}px` : "",
355
- [b.left]: u.left ? `${u.left}px` : "",
356
- [b.maxHeight]: u.maxHeight ? `${u.maxHeight}px` : "",
357
- [b.minWidth]: u.minWidth ? `${u.minWidth}px` : "",
358
- [b.transformOrigin]: (_u_transformOrigin = u.transformOrigin) !== null && _u_transformOrigin !== void 0 ? _u_transformOrigin : ""
361
+ style: rt({
362
+ [N.top]: a.top ? `${a.top}px` : "",
363
+ [N.left]: a.left ? `${a.left}px` : "",
364
+ [N.maxHeight]: a.maxHeight ? `${a.maxHeight}px` : "",
365
+ [N.minWidth]: a.minWidth ? `${a.minWidth}px` : "",
366
+ [N.transformOrigin]: (_a_transformOrigin = a.transformOrigin) !== null && _a_transformOrigin !== void 0 ? _a_transformOrigin : ""
359
367
  }),
360
- onPointerDown: m,
361
- className: C(Je, K ? ie.show : ie.hide),
368
+ onPointerDown: p,
369
+ className: k(Qe, K ? ce.show : ce.hide),
362
370
  role: "listbox",
363
371
  ref: v,
364
- children: f.map((param)=>{
372
+ children: u.map((param)=>{
365
373
  let { value: e, text: t } = param;
366
374
  return /* @__PURE__ */ r("li", {
367
375
  role: "option",
368
- "aria-selected": e === (l !== null && l !== void 0 ? l : a),
376
+ "aria-selected": e === (g !== null && g !== void 0 ? g : l),
369
377
  "data-value": e,
370
- className: C(Qe, {
371
- [Ye]: e === g || e === (l !== null && l !== void 0 ? l : a)
378
+ className: k(Ye, {
379
+ [et]: e === T || e === (g !== null && g !== void 0 ? g : l)
372
380
  }),
373
- onPointerDown: m,
381
+ onPointerDown: p,
374
382
  onClick: ()=>q(e),
375
383
  ref: (s)=>{
376
- s ? N.current.set(e, s) : N.current.delete(e);
384
+ s ? R.current.set(e, s) : R.current.delete(e);
377
385
  },
378
- children: /* @__PURE__ */ r(ze, {
386
+ children: /* @__PURE__ */ r(je, {
379
387
  regular: !0,
380
388
  children: t
381
389
  })
@@ -387,5 +395,5 @@ const st = (param)=>{
387
395
  ]
388
396
  })
389
397
  });
390
- }, xt = st;
391
- export { xt as default };
398
+ }, Ot = ot;
399
+ export { Ot as default };