@intl-tel-input/react 28.0.2 → 28.0.4

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # IntlTelInput React Component
1
+ # React component for intl-tel-input
2
2
 
3
- A React component for the [intl-tel-input](https://github.com/jackocnr/intl-tel-input) JavaScript library. View the [source code](https://github.com/jackocnr/intl-tel-input/blob/master/packages/react/src/IntlTelInput.tsx).
3
+ For entering, formatting, and validating international telephone numbers.
4
4
 
5
5
  [Explore docs »](https://intl-tel-input.com/docs/react-component)
6
6
 
@@ -10,6 +10,10 @@ A React component for the [intl-tel-input](https://github.com/jackocnr/intl-tel-
10
10
  <img width="271" height="279" alt="intl-tel-input screenshot showing country dropdown open" src="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/iti-github-light.png">
11
11
  </picture>
12
12
 
13
+ ## Resources
14
+
15
+ Check out the [website](https://intl-tel-input.com), where you can find [a full set of docs](https://intl-tel-input.com/docs/react-component), a [live playground](https://intl-tel-input.com/playground/) where you can try out all of the options, as well as plenty of [examples](https://intl-tel-input.com/examples/react-component/validation) of different setups.
16
+
13
17
  ## Running the demos locally
14
18
 
15
19
  1. Initialise the submodules: `git submodule update --init --recursive`
@@ -17,3 +21,11 @@ A React component for the [intl-tel-input](https://github.com/jackocnr/intl-tel-
17
21
  3. Build: `npm run build`
18
22
 
19
23
  You can then open `packages/react/demo/validation/index.html` in your browser to try the validation demo. View the full list of [available demos](https://github.com/jackocnr/intl-tel-input/tree/master/packages/react/demo).
24
+
25
+ ## Issues and contributing
26
+
27
+ Please report issues and open pull requests on the [main repository](https://github.com/jackocnr/intl-tel-input).
28
+
29
+ ## License
30
+
31
+ MIT
@@ -1965,7 +1965,7 @@ var defaults = {
1965
1965
  //* A function to load the utils script.
1966
1966
  loadUtils: null,
1967
1967
  //* National vs international formatting for numbers e.g. placeholders and displaying existing numbers.
1968
- nationalMode: true,
1968
+ nationalMode: false,
1969
1969
  //* Display only these countries.
1970
1970
  onlyCountries: null,
1971
1971
  //* Number type to use for placeholders.
@@ -2250,31 +2250,50 @@ var createEl = (tagName, attrs, container) => {
2250
2250
  };
2251
2251
 
2252
2252
  // packages/core/src/js/core/icons.ts
2253
- var buildSearchIcon = () => `
2254
- <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${ARIA.HIDDEN}="true">
2255
- <circle cx="11" cy="11" r="7" />
2256
- <line x1="21" y1="21" x2="16.65" y2="16.65" />
2257
- </svg>`;
2253
+ var SVG_NS = "http://www.w3.org/2000/svg";
2254
+ var buildSvg = ([tag, attrs, children]) => {
2255
+ const el = document.createElementNS(SVG_NS, tag);
2256
+ if (attrs) {
2257
+ for (const k in attrs) {
2258
+ el.setAttribute(k, String(attrs[k]));
2259
+ }
2260
+ }
2261
+ if (children) {
2262
+ for (const c of children) {
2263
+ el.appendChild(buildSvg(c));
2264
+ }
2265
+ }
2266
+ return el;
2267
+ };
2268
+ var buildSearchIcon = () => buildSvg(
2269
+ ["svg", { class: "iti__search-icon-svg", width: 14, height: 14, viewBox: "0 0 24 24", focusable: "false", [ARIA.HIDDEN]: "true" }, [
2270
+ ["circle", { cx: 11, cy: 11, r: 7 }],
2271
+ ["line", { x1: 21, y1: 21, x2: 16.65, y2: 16.65 }]
2272
+ ]]
2273
+ );
2258
2274
  var buildClearIcon = (id) => {
2259
2275
  const maskId = `iti-${id}-clear-mask`;
2260
- return `
2261
- <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${ARIA.HIDDEN}="true" focusable="false">
2262
- <mask id="${maskId}" maskUnits="userSpaceOnUse">
2263
- <rect width="16" height="16" fill="white" />
2264
- <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
2265
- </mask>
2266
- <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${maskId})" />
2267
- </svg>`;
2276
+ return buildSvg(
2277
+ ["svg", { class: "iti__search-clear-svg", width: 12, height: 12, viewBox: "0 0 16 16", [ARIA.HIDDEN]: "true", focusable: "false" }, [
2278
+ ["mask", { id: maskId, maskUnits: "userSpaceOnUse" }, [
2279
+ ["rect", { width: 16, height: 16, fill: "white" }],
2280
+ ["path", { d: "M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8", stroke: "black", "stroke-linecap": "round", class: "iti__search-clear-x" }]
2281
+ ]],
2282
+ ["circle", { cx: 8, cy: 8, r: 8, class: "iti__search-clear-bg", mask: `url(#${maskId})` }]
2283
+ ]]
2284
+ );
2268
2285
  };
2269
- var buildCheckIcon = () => `
2270
- <svg class="iti__country-check-svg" width="14" height="14" viewBox="0 0 16 16" fill="currentColor" focusable="false" ${ARIA.HIDDEN}="true">
2271
- <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
2272
- </svg>`;
2273
- var buildGlobeIcon = () => `
2274
- <svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
2275
- <path d="M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"/>
2276
- <path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
2277
- </svg>`;
2286
+ var buildCheckIcon = () => buildSvg(
2287
+ ["svg", { class: "iti__country-check-svg", width: 14, height: 14, viewBox: "0 0 16 16", fill: "currentColor", focusable: "false", [ARIA.HIDDEN]: "true" }, [
2288
+ ["path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }]
2289
+ ]]
2290
+ );
2291
+ var buildGlobeIcon = () => buildSvg(
2292
+ ["svg", { width: 256, height: 256, viewBox: "0 0 512 512", class: "iti__globe-svg" }, [
2293
+ ["path", { d: "M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39" }],
2294
+ ["path", { d: "m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40" }]
2295
+ ]]
2296
+ );
2278
2297
 
2279
2298
  // packages/core/src/js/core/countrySearch.ts
2280
2299
  var buildSearchTokens = (countries) => {
@@ -2627,7 +2646,7 @@ var UI = class _UI {
2627
2646
  },
2628
2647
  searchWrapper
2629
2648
  );
2630
- this.#searchIconEl.innerHTML = buildSearchIcon();
2649
+ this.#searchIconEl.appendChild(buildSearchIcon());
2631
2650
  this.#searchInputEl = createEl(
2632
2651
  "input",
2633
2652
  {
@@ -2656,7 +2675,7 @@ var UI = class _UI {
2656
2675
  },
2657
2676
  searchWrapper
2658
2677
  );
2659
- this.#searchClearButtonEl.innerHTML = buildClearIcon(this.#id);
2678
+ this.#searchClearButtonEl.appendChild(buildClearIcon(this.#id));
2660
2679
  this.#searchResultsLiveRegionEl = createEl(
2661
2680
  "span",
2662
2681
  { class: "iti__a11y-text" },
@@ -3156,7 +3175,7 @@ var UI = class _UI {
3156
3175
  { class: "iti__country-check", [ARIA.HIDDEN]: "true" },
3157
3176
  newListItem
3158
3177
  );
3159
- checkIcon.innerHTML = buildCheckIcon();
3178
+ checkIcon.appendChild(buildCheckIcon());
3160
3179
  this.#selectedListItemEl = newListItem;
3161
3180
  if (this.#options.dropdownAlwaysOpen) {
3162
3181
  this.#highlightListItem(newListItem);
@@ -3301,20 +3320,27 @@ var UI = class _UI {
3301
3320
  }
3302
3321
  if (this.#selectedCountryEl) {
3303
3322
  const flagClass = iso2 && showFlags ? `${CLASSES.FLAG} iti__${iso2}` : `${CLASSES.FLAG} ${CLASSES.GLOBE}`;
3304
- let ariaLabel, title, flagInnerHtml;
3323
+ let ariaLabel, title;
3324
+ let flagContent = null;
3305
3325
  if (iso2) {
3306
3326
  title = name;
3307
3327
  ariaLabel = i18n.selectedCountryAriaLabel.replace("${countryName}", name).replace("${dialCode}", `+${dialCode}`);
3308
- flagInnerHtml = showFlags ? "" : buildGlobeIcon();
3328
+ if (!showFlags) {
3329
+ flagContent = buildGlobeIcon();
3330
+ }
3309
3331
  } else {
3310
3332
  title = i18n.noCountrySelected;
3311
3333
  ariaLabel = i18n.noCountrySelected;
3312
- flagInnerHtml = buildGlobeIcon();
3334
+ flagContent = buildGlobeIcon();
3313
3335
  }
3314
3336
  this.#selectedFlagEl.className = flagClass;
3315
3337
  this.#selectedCountryEl.setAttribute("title", title);
3316
3338
  this.#selectedCountryEl.setAttribute(ARIA.LABEL, ariaLabel);
3317
- this.#selectedFlagEl.innerHTML = flagInnerHtml;
3339
+ if (flagContent) {
3340
+ this.#selectedFlagEl.replaceChildren(flagContent);
3341
+ } else {
3342
+ this.#selectedFlagEl.replaceChildren();
3343
+ }
3318
3344
  }
3319
3345
  if (separateDialCode) {
3320
3346
  const fullDialCode = dialCode ? `+${dialCode}` : "";
@@ -4633,7 +4659,7 @@ var intlTelInput = Object.assign(
4633
4659
  attachUtils,
4634
4660
  startedLoadingUtils: false,
4635
4661
  startedLoadingAutoCountry: false,
4636
- version: "28.0.2",
4662
+ version: "28.0.4",
4637
4663
  NUMBER_FORMAT,
4638
4664
  NUMBER_TYPE,
4639
4665
  VALIDATION_ERROR
@@ -4671,7 +4697,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
4671
4697
  }, ref) {
4672
4698
  const inputRef = useRef(null);
4673
4699
  const itiRef = useRef(null);
4674
- const pluginInputClassesRef = useRef("");
4700
+ const libraryInputClassesRef = useRef("");
4675
4701
  const lastEmittedNumberRef = useRef(void 0);
4676
4702
  const lastEmittedCountryRef = useRef(void 0);
4677
4703
  const lastEmittedValidityRef = useRef(void 0);
@@ -4738,7 +4764,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
4738
4764
  return void 0;
4739
4765
  }
4740
4766
  itiRef.current = intlTelInput_default(inputEl, initOptions);
4741
- pluginInputClassesRef.current = inputEl.className;
4767
+ libraryInputClassesRef.current = inputEl.className;
4742
4768
  const handleOpen = () => onOpenCountryDropdownRef.current?.();
4743
4769
  const handleClose = () => onCloseCountryDropdownRef.current?.();
4744
4770
  const handleStrictReject = (e) => {
@@ -4802,7 +4828,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
4802
4828
  if (ignoredInputProps.has(key)) {
4803
4829
  warnInputProp(key);
4804
4830
  } else if (key === "className") {
4805
- sanitizedInputProps[key] = `${pluginInputClassesRef.current} ${val}`;
4831
+ sanitizedInputProps[key] = `${libraryInputClassesRef.current} ${val}`;
4806
4832
  } else {
4807
4833
  sanitizedInputProps[key] = val;
4808
4834
  }
@@ -1965,7 +1965,7 @@ var defaults = {
1965
1965
  //* A function to load the utils script.
1966
1966
  loadUtils: null,
1967
1967
  //* National vs international formatting for numbers e.g. placeholders and displaying existing numbers.
1968
- nationalMode: true,
1968
+ nationalMode: false,
1969
1969
  //* Display only these countries.
1970
1970
  onlyCountries: null,
1971
1971
  //* Number type to use for placeholders.
@@ -2250,31 +2250,50 @@ var createEl = (tagName, attrs, container) => {
2250
2250
  };
2251
2251
 
2252
2252
  // packages/core/src/js/core/icons.ts
2253
- var buildSearchIcon = () => `
2254
- <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${ARIA.HIDDEN}="true">
2255
- <circle cx="11" cy="11" r="7" />
2256
- <line x1="21" y1="21" x2="16.65" y2="16.65" />
2257
- </svg>`;
2253
+ var SVG_NS = "http://www.w3.org/2000/svg";
2254
+ var buildSvg = ([tag, attrs, children]) => {
2255
+ const el = document.createElementNS(SVG_NS, tag);
2256
+ if (attrs) {
2257
+ for (const k in attrs) {
2258
+ el.setAttribute(k, String(attrs[k]));
2259
+ }
2260
+ }
2261
+ if (children) {
2262
+ for (const c of children) {
2263
+ el.appendChild(buildSvg(c));
2264
+ }
2265
+ }
2266
+ return el;
2267
+ };
2268
+ var buildSearchIcon = () => buildSvg(
2269
+ ["svg", { class: "iti__search-icon-svg", width: 14, height: 14, viewBox: "0 0 24 24", focusable: "false", [ARIA.HIDDEN]: "true" }, [
2270
+ ["circle", { cx: 11, cy: 11, r: 7 }],
2271
+ ["line", { x1: 21, y1: 21, x2: 16.65, y2: 16.65 }]
2272
+ ]]
2273
+ );
2258
2274
  var buildClearIcon = (id) => {
2259
2275
  const maskId = `iti-${id}-clear-mask`;
2260
- return `
2261
- <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${ARIA.HIDDEN}="true" focusable="false">
2262
- <mask id="${maskId}" maskUnits="userSpaceOnUse">
2263
- <rect width="16" height="16" fill="white" />
2264
- <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
2265
- </mask>
2266
- <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${maskId})" />
2267
- </svg>`;
2276
+ return buildSvg(
2277
+ ["svg", { class: "iti__search-clear-svg", width: 12, height: 12, viewBox: "0 0 16 16", [ARIA.HIDDEN]: "true", focusable: "false" }, [
2278
+ ["mask", { id: maskId, maskUnits: "userSpaceOnUse" }, [
2279
+ ["rect", { width: 16, height: 16, fill: "white" }],
2280
+ ["path", { d: "M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8", stroke: "black", "stroke-linecap": "round", class: "iti__search-clear-x" }]
2281
+ ]],
2282
+ ["circle", { cx: 8, cy: 8, r: 8, class: "iti__search-clear-bg", mask: `url(#${maskId})` }]
2283
+ ]]
2284
+ );
2268
2285
  };
2269
- var buildCheckIcon = () => `
2270
- <svg class="iti__country-check-svg" width="14" height="14" viewBox="0 0 16 16" fill="currentColor" focusable="false" ${ARIA.HIDDEN}="true">
2271
- <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
2272
- </svg>`;
2273
- var buildGlobeIcon = () => `
2274
- <svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
2275
- <path d="M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"/>
2276
- <path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
2277
- </svg>`;
2286
+ var buildCheckIcon = () => buildSvg(
2287
+ ["svg", { class: "iti__country-check-svg", width: 14, height: 14, viewBox: "0 0 16 16", fill: "currentColor", focusable: "false", [ARIA.HIDDEN]: "true" }, [
2288
+ ["path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }]
2289
+ ]]
2290
+ );
2291
+ var buildGlobeIcon = () => buildSvg(
2292
+ ["svg", { width: 256, height: 256, viewBox: "0 0 512 512", class: "iti__globe-svg" }, [
2293
+ ["path", { d: "M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39" }],
2294
+ ["path", { d: "m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40" }]
2295
+ ]]
2296
+ );
2278
2297
 
2279
2298
  // packages/core/src/js/core/countrySearch.ts
2280
2299
  var buildSearchTokens = (countries) => {
@@ -2627,7 +2646,7 @@ var UI = class _UI {
2627
2646
  },
2628
2647
  searchWrapper
2629
2648
  );
2630
- this.#searchIconEl.innerHTML = buildSearchIcon();
2649
+ this.#searchIconEl.appendChild(buildSearchIcon());
2631
2650
  this.#searchInputEl = createEl(
2632
2651
  "input",
2633
2652
  {
@@ -2656,7 +2675,7 @@ var UI = class _UI {
2656
2675
  },
2657
2676
  searchWrapper
2658
2677
  );
2659
- this.#searchClearButtonEl.innerHTML = buildClearIcon(this.#id);
2678
+ this.#searchClearButtonEl.appendChild(buildClearIcon(this.#id));
2660
2679
  this.#searchResultsLiveRegionEl = createEl(
2661
2680
  "span",
2662
2681
  { class: "iti__a11y-text" },
@@ -3156,7 +3175,7 @@ var UI = class _UI {
3156
3175
  { class: "iti__country-check", [ARIA.HIDDEN]: "true" },
3157
3176
  newListItem
3158
3177
  );
3159
- checkIcon.innerHTML = buildCheckIcon();
3178
+ checkIcon.appendChild(buildCheckIcon());
3160
3179
  this.#selectedListItemEl = newListItem;
3161
3180
  if (this.#options.dropdownAlwaysOpen) {
3162
3181
  this.#highlightListItem(newListItem);
@@ -3301,20 +3320,27 @@ var UI = class _UI {
3301
3320
  }
3302
3321
  if (this.#selectedCountryEl) {
3303
3322
  const flagClass = iso2 && showFlags ? `${CLASSES.FLAG} iti__${iso2}` : `${CLASSES.FLAG} ${CLASSES.GLOBE}`;
3304
- let ariaLabel, title, flagInnerHtml;
3323
+ let ariaLabel, title;
3324
+ let flagContent = null;
3305
3325
  if (iso2) {
3306
3326
  title = name;
3307
3327
  ariaLabel = i18n.selectedCountryAriaLabel.replace("${countryName}", name).replace("${dialCode}", `+${dialCode}`);
3308
- flagInnerHtml = showFlags ? "" : buildGlobeIcon();
3328
+ if (!showFlags) {
3329
+ flagContent = buildGlobeIcon();
3330
+ }
3309
3331
  } else {
3310
3332
  title = i18n.noCountrySelected;
3311
3333
  ariaLabel = i18n.noCountrySelected;
3312
- flagInnerHtml = buildGlobeIcon();
3334
+ flagContent = buildGlobeIcon();
3313
3335
  }
3314
3336
  this.#selectedFlagEl.className = flagClass;
3315
3337
  this.#selectedCountryEl.setAttribute("title", title);
3316
3338
  this.#selectedCountryEl.setAttribute(ARIA.LABEL, ariaLabel);
3317
- this.#selectedFlagEl.innerHTML = flagInnerHtml;
3339
+ if (flagContent) {
3340
+ this.#selectedFlagEl.replaceChildren(flagContent);
3341
+ } else {
3342
+ this.#selectedFlagEl.replaceChildren();
3343
+ }
3318
3344
  }
3319
3345
  if (separateDialCode) {
3320
3346
  const fullDialCode = dialCode ? `+${dialCode}` : "";
@@ -4633,7 +4659,7 @@ var intlTelInput = Object.assign(
4633
4659
  attachUtils,
4634
4660
  startedLoadingUtils: false,
4635
4661
  startedLoadingAutoCountry: false,
4636
- version: "28.0.2",
4662
+ version: "28.0.4",
4637
4663
  NUMBER_FORMAT,
4638
4664
  NUMBER_TYPE,
4639
4665
  VALIDATION_ERROR
@@ -11025,7 +11051,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
11025
11051
  }, ref) {
11026
11052
  const inputRef = useRef(null);
11027
11053
  const itiRef = useRef(null);
11028
- const pluginInputClassesRef = useRef("");
11054
+ const libraryInputClassesRef = useRef("");
11029
11055
  const lastEmittedNumberRef = useRef(void 0);
11030
11056
  const lastEmittedCountryRef = useRef(void 0);
11031
11057
  const lastEmittedValidityRef = useRef(void 0);
@@ -11092,7 +11118,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
11092
11118
  return void 0;
11093
11119
  }
11094
11120
  itiRef.current = intlTelInput_default(inputEl, initOptions);
11095
- pluginInputClassesRef.current = inputEl.className;
11121
+ libraryInputClassesRef.current = inputEl.className;
11096
11122
  const handleOpen = () => onOpenCountryDropdownRef.current?.();
11097
11123
  const handleClose = () => onCloseCountryDropdownRef.current?.();
11098
11124
  const handleStrictReject = (e) => {
@@ -11156,7 +11182,7 @@ var IntlTelInput = forwardRef(function IntlTelInput2({
11156
11182
  if (ignoredInputProps.has(key)) {
11157
11183
  warnInputProp(key);
11158
11184
  } else if (key === "className") {
11159
- sanitizedInputProps[key] = `${pluginInputClassesRef.current} ${val}`;
11185
+ sanitizedInputProps[key] = `${libraryInputClassesRef.current} ${val}`;
11160
11186
  } else {
11161
11187
  sanitizedInputProps[key] = val;
11162
11188
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@intl-tel-input/react",
3
- "version": "28.0.2",
4
- "description": "A React component for the intl-tel-input JavaScript plugin",
3
+ "version": "28.0.4",
4
+ "description": "A React component for intl-tel-input, for entering, formatting, and validating international telephone numbers",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Jack O'Connor (http://jackocnr.com)",
@@ -34,7 +34,7 @@
34
34
  "README.md"
35
35
  ],
36
36
  "dependencies": {
37
- "intl-tel-input": "^28.0.2"
37
+ "intl-tel-input": "^28.0.4"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": ">=18",