@vkzstudio/muza-ui 1.9.2 → 1.9.3

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.
@@ -37,7 +37,7 @@ const Y = M(
37
37
  weight: "medium",
38
38
  fixY: !0
39
39
  }),
40
- "flex-1 bg-transparent outline-0 text-comp-input-text-primary transition-colors",
40
+ "autofill-field flex-1 bg-transparent outline-0 text-comp-input-text-primary transition-colors",
41
41
  "placeholder:text-comp-input-text-placeholder",
42
42
  "placeholder:font-regular",
43
43
  "disabled:cursor-not-allowed",
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/components/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAGnB,MAAM,2BAA2B,CAAA;AAOlC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAA;IAClB,4DAA4D;IAC5D,OAAO,EAAE,aAAa,CAAA;CACvB;AAKD,QAAA,MAAM,oBAAoB;;;8EAyBzB,CAAA;AAcD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eACf,SAAQ,IAAI,CACR,wBAAwB,CAAC,OAAO,CAAC,EACjC,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CACnE,EACD,YAAY,CAAC,OAAO,oBAAoB,CAAC;IAC3C,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG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AYG;AACH,MAAM,WAAW,eACf,SAAQ,IAAI,CACR,wBAAwB,CAAC,OAAO,CAAC,EACjC,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CACnE,EACD,YAAY,CAAC,OAAO,oBAAoB,CAAC;IAC3C,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAClC,4DAA4D;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC9D,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,WAAW,EAAE,CAAA;IACzB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,6FAA6F;IAC7F,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,UAAU,8GA6HtB,CAAA"}
@@ -1,13 +1,13 @@
1
- import { jsx as u, jsxs as W } from "react/jsx-runtime";
2
- import { forwardRef as Y, useId as B, useRef as G, useState as H, useEffect as J } from "react";
3
- import { cva as K } from "class-variance-authority";
4
- import { usePhoneInput as O, defaultCountries as Q } from "react-international-phone";
5
- import { useMuzaTranslations as U } from "../../translations/TranslationContext.js";
1
+ import { jsx as p, jsxs as W } from "react/jsx-runtime";
2
+ import { forwardRef as B, useId as G, useRef as H, useState as J, useEffect as K } from "react";
3
+ import { cva as O } from "class-variance-authority";
4
+ import { usePhoneInput as Q, defaultCountries as U } from "react-international-phone";
5
+ import { useMuzaTranslations as X } from "../../translations/TranslationContext.js";
6
6
  import { cn as v } from "../../utils/cn.js";
7
- import { FormField as X } from "../FormField/FormField.js";
7
+ import { FormField as Y } from "../FormField/FormField.js";
8
8
  import { typographyVariants as Z } from "../Typography/Typography.js";
9
9
  import { CountrySelector as _ } from "./CountrySelector.js";
10
- const q = K(
10
+ const q = O(
11
11
  [
12
12
  "group flex items-center",
13
13
  "rounded-full border border-comp-input-stroke-def bg-comp-input-fill-def transition-colors",
@@ -32,43 +32,51 @@ const q = K(
32
32
  error: !1
33
33
  }
34
34
  }
35
- ), ee = (t) => v(
36
- Z({
37
- size: t === "xs" || t === "sm" ? "input" : "base",
38
- weight: "medium",
39
- fixY: !0
40
- }),
41
- "h-full min-w-0 flex-1 bg-transparent px-comp-input-p-hor text-comp-input-text-primary outline-0 transition-colors",
42
- "placeholder:font-regular placeholder:text-comp-input-text-placeholder",
43
- "disabled:cursor-not-allowed"
44
- ), te = Y(
35
+ ), ee = (o) => {
36
+ const e = o === "xs" || o === "sm";
37
+ return v(
38
+ Z({
39
+ size: e ? "input" : "base",
40
+ weight: "medium"
41
+ }),
42
+ // This input fills the field's height, so the browser paints the autofill
43
+ // highlight across the whole segment. `fixY` would nudge that painted box
44
+ // down along with the text, past the wrapper's rounded bottom edge, so the
45
+ // baseline correction is applied as padding and the outer end is rounded to
46
+ // follow the pill.
47
+ e ? "fix-y-box-1" : "fix-y-box",
48
+ "autofill-field h-full min-w-0 flex-1 rounded-r-full bg-transparent px-comp-input-p-hor text-comp-input-text-primary outline-0 transition-colors",
49
+ "placeholder:font-regular placeholder:text-comp-input-text-placeholder",
50
+ "disabled:cursor-not-allowed"
51
+ );
52
+ }, te = B(
45
53
  ({
46
- className: t,
47
- label: p,
48
- hint: c,
49
- size: d,
50
- error: o,
54
+ className: o,
55
+ label: e,
56
+ hint: d,
57
+ size: c,
58
+ error: r,
51
59
  value: m,
52
60
  defaultValue: C,
53
61
  onChange: i,
54
62
  defaultCountry: V = "cz",
55
- countries: h = Q,
56
- disabled: f,
57
- required: l,
63
+ countries: f = U,
64
+ disabled: h,
65
+ required: s,
58
66
  disableRequiredAsterisk: w,
59
67
  labelExtra: P,
60
68
  infoTooltip: R,
61
69
  id: k,
62
70
  countrySelectorAriaLabel: N,
63
- searchPlaceholder: z,
64
- noResultsText: F,
71
+ searchPlaceholder: S,
72
+ noResultsText: z,
65
73
  ...b
66
- }, e) => {
67
- const s = U(), S = B(), r = k ?? S, y = c ? `${r}-hint` : void 0, x = p ? `${r}-label` : void 0, n = G(null), I = m !== void 0, [j, A] = H(C ?? ""), L = I ? m : j, { inputValue: M, country: T, setCountry: $, handlePhoneValueChange: D } = O({
74
+ }, t) => {
75
+ const u = X(), F = G(), n = k ?? F, x = d ? `${n}-hint` : void 0, y = e ? `${n}-label` : void 0, l = H(null), I = m !== void 0, [j, A] = J(C ?? ""), L = I ? m : j, { inputValue: M, country: T, setCountry: $, handlePhoneValueChange: D } = Q({
68
76
  defaultCountry: V,
69
77
  value: L,
70
- countries: h,
71
- inputRef: n,
78
+ countries: f,
79
+ inputRef: l,
72
80
  // Keep the dial code out of the number field — it lives in the country
73
81
  // selector segment. `phone` in onChange is still full E.164.
74
82
  disableDialCodeAndPrefix: !0,
@@ -83,54 +91,54 @@ const q = K(
83
91
  });
84
92
  }
85
93
  });
86
- return J(() => {
87
- e && (typeof e == "function" ? e(n.current) : e.current = n.current);
88
- }, [e]), /* @__PURE__ */ u(
89
- X,
94
+ return K(() => {
95
+ t && (typeof t == "function" ? t(l.current) : t.current = l.current);
96
+ }, [t]), /* @__PURE__ */ p(
97
+ Y,
90
98
  {
91
- label: p,
92
- hint: c,
93
- error: o,
94
- required: l,
99
+ label: e,
100
+ hint: d,
101
+ error: r,
102
+ required: s,
95
103
  disableRequiredAsterisk: w,
96
- htmlFor: r,
97
- labelId: x,
98
- hintId: y,
104
+ htmlFor: n,
105
+ labelId: y,
106
+ hintId: x,
99
107
  labelExtra: P,
100
108
  infoTooltip: R,
101
- children: /* @__PURE__ */ W("div", { className: v(q({ size: d, error: o }), t), children: [
102
- /* @__PURE__ */ u(
109
+ children: /* @__PURE__ */ W("div", { className: v(q({ size: c, error: r }), o), children: [
110
+ /* @__PURE__ */ p(
103
111
  _,
104
112
  {
105
113
  selectedCountry: T.iso2,
106
114
  onCountryChange: (a) => $(a),
107
- countries: h,
108
- disabled: f,
109
- error: o,
110
- ariaLabel: N ?? s.phoneInput.countrySelectorAriaLabel,
111
- searchPlaceholder: z ?? s.phoneInput.searchPlaceholder,
112
- noResultsText: F ?? s.phoneInput.noResults
115
+ countries: f,
116
+ disabled: h,
117
+ error: r,
118
+ ariaLabel: N ?? u.phoneInput.countrySelectorAriaLabel,
119
+ searchPlaceholder: S ?? u.phoneInput.searchPlaceholder,
120
+ noResultsText: z ?? u.phoneInput.noResults
113
121
  }
114
122
  ),
115
- /* @__PURE__ */ u(
123
+ /* @__PURE__ */ p(
116
124
  "input",
117
125
  {
118
126
  ...b,
119
- ref: n,
120
- id: r,
127
+ ref: l,
128
+ id: n,
121
129
  type: "tel",
122
130
  inputMode: "tel",
123
131
  autoComplete: b.autoComplete ?? "tel",
124
132
  "data-slot": "phone-input",
125
133
  value: M,
126
134
  onChange: D,
127
- disabled: f,
128
- required: l,
129
- "aria-describedby": y,
130
- "aria-labelledby": x,
131
- "aria-invalid": o,
132
- "aria-required": l,
133
- className: ee(d)
135
+ disabled: h,
136
+ required: s,
137
+ "aria-describedby": x,
138
+ "aria-labelledby": y,
139
+ "aria-invalid": r,
140
+ "aria-required": s,
141
+ className: ee(c)
134
142
  }
135
143
  )
136
144
  ] })
@@ -11,7 +11,7 @@ const E = x(
11
11
  weight: "medium",
12
12
  size: "base"
13
13
  }),
14
- "w-full font-text text-comp-input-text-primary transition-colors outline-none",
14
+ "w-full font-text text-comp-input-text-primary autofill-field transition-colors outline-none",
15
15
  "placeholder:font-regular placeholder:text-comp-input-text-placeholder",
16
16
  "mr-[calc(var(--spacing-xl)/2)] pt-xl pr-[calc(var(--spacing-comp-input-p-hor)-var(--spacing-xl)/2)] pb-[calc(var(--spacing-xl)/2)] pl-comp-input-p-hor",
17
17
  "disabled:cursor-not-allowed"