@ticketmaster/tm-global-address 0.9.0 → 0.11.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.
@@ -274,7 +274,9 @@ const _e = ({
274
274
  if (typeof n != "string") return;
275
275
  const i = D(a.country);
276
276
  let l = null;
277
- t === "firstName" ? l = k("firstName", n, F.firstName) : t === "lastName" ? l = k("lastName", n, F.lastName) : t === "address1" ? l = k("address1", n, F.address1) : t === "address2" && n !== "" ? l = k("address2", n, F.address2) : t === "city" ? l = k("city", n, F.city) : t === "postal" && n !== "" ? l = ue(n, F.postal, i) : t === "state" ? l = pe(n || void 0, i) : t === "phoneNumber" && n !== "" && C ? l = me(n, i) : t === "country" && n === "" && (l = { message: S.validation.FIELD_REQUIRED.replace("{{field}}", c.country) }), E((v) => {
277
+ t === "firstName" ? l = k("firstName", n, F.firstName) : t === "lastName" ? l = k("lastName", n, F.lastName) : t === "address1" ? l = k("address1", n, F.address1) : t === "address2" && n !== "" ? l = k("address2", n, F.address2) : t === "city" ? l = k("city", n, F.city) : t === "postal" && n !== "" ? l = ue(n, F.postal, i) : t === "state" ? l = pe(n || void 0, i) : t === "phoneNumber" && n !== "" && C ? l = me(n, i) : t === "country" && n === "" && (l = {
278
+ message: S.validation.FIELD_REQUIRED.replace("{{field}}", c.country)
279
+ }), E((v) => {
278
280
  if (l) return { ...v, [t]: l.message };
279
281
  const { [t]: x, ...T } = v;
280
282
  return T;
@@ -87,8 +87,12 @@ const G = {
87
87
  margin-block-end: ${i.space3};
88
88
 
89
89
  @keyframes shimmer {
90
- 0% { background-position: -200% 0; }
91
- 100% { background-position: 200% 0; }
90
+ 0% {
91
+ background-position: -200% 0;
92
+ }
93
+ 100% {
94
+ background-position: 200% 0;
95
+ }
92
96
  }
93
97
  `, W = R.div`
94
98
  padding: ${i.space4};
@@ -19,4 +19,4 @@ export { SUBDIVISIONS, getSubdivisions } from './states';
19
19
  export type { PostalPattern } from './postalPatterns';
20
20
  export { POSTAL_PATTERNS, getPostalPattern } from './postalPatterns';
21
21
  export { getCountryConfig, STATE_REQUIRED_CODES } from './countryConfig';
22
- export { COUNTRY_OPTIONS, COUNTRY_CONFIGS, getCountryName, } from './countryData';
22
+ export { COUNTRY_OPTIONS, COUNTRY_CONFIGS, getCountryName } from './countryData';
@@ -57,7 +57,11 @@ const e = {
57
57
  ZA: { stateCode: "State", stateCodePlaceholder: "Select the state" },
58
58
  // Postal-code overrides
59
59
  IN: { postal: "PIN Code" },
60
- JP: { postal: "Postal Code", stateCode: "Prefecture", stateCodePlaceholder: "Select the prefecture" },
60
+ JP: {
61
+ postal: "Postal Code",
62
+ stateCode: "Prefecture",
63
+ stateCodePlaceholder: "Select the prefecture"
64
+ },
61
65
  AE: { stateCode: "Emirate", stateCodePlaceholder: "Select the emirate" }
62
66
  }
63
67
  };
@@ -1,7 +1,7 @@
1
1
  import { resolveLabels, isRTLLocale, interpolate, loadBundle } from './labelResolver';
2
2
  import { ResolvedLabels, LocaleBundle, InterpolationVars } from './types';
3
3
  export type { ResolvedLabels, LocaleBundle, InterpolationVars };
4
- export type { FormLabels, ValidationLabels, CountryOverrides, } from './types';
4
+ export type { FormLabels, ValidationLabels, CountryOverrides } from './types';
5
5
  export { isRTLLocale, interpolate, loadBundle, resolveLabels };
6
6
  /**
7
7
  * React hook that returns resolved labels for the given locale and country.
@@ -2,10 +2,7 @@ import { useMemo as r } from "react";
2
2
  import { resolveLabels as s } from "./labelResolver.js";
3
3
  import { interpolate as i, isRTLLocale as p, loadBundle as d } from "./labelResolver.js";
4
4
  function f(e, n) {
5
- return r(
6
- () => s(e, n),
7
- [e, n]
8
- );
5
+ return r(() => s(e, n), [e, n]);
9
6
  }
10
7
  const l = [
11
8
  "ar-sa",
@@ -1,3 +1,3 @@
1
1
  export type { AddressData, SaveAddressPayload, ActionResult, ActionSuccess, ActionFailure, ActionError, FieldError, } from './AddressData';
2
- export type { CountryValidationConfig, CountryOption, SubdivisionOption, } from './CountryConfig';
2
+ export type { CountryValidationConfig, CountryOption, SubdivisionOption } from './CountryConfig';
3
3
  export type { GlobalAddressProps } from './GlobalAddressProps';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticketmaster/tm-global-address",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Shared React UI Library for Global Address Management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -35,6 +35,7 @@
35
35
  "@testing-library/jest-dom": "^6.4.6",
36
36
  "@testing-library/react": "^16.0.0",
37
37
  "@testing-library/user-event": "^14.5.2",
38
+ "@types/jest-axe": "^3.5.9",
38
39
  "@types/node": "^20.14.10",
39
40
  "@types/react": "^18.3.3",
40
41
  "@types/react-dom": "^18.3.0",
@@ -48,6 +49,7 @@
48
49
  "eslint-plugin-react-hooks": "^7.0.1",
49
50
  "globals": "^17.0.0",
50
51
  "happy-dom": "^14.12.3",
52
+ "jest-axe": "^10.0.0",
51
53
  "jiti": "^2.6.1",
52
54
  "prettier": "3.0.3",
53
55
  "react": "^18.3.1",
@@ -79,6 +81,10 @@
79
81
  "optional": true
80
82
  }
81
83
  },
84
+ "publishConfig": {
85
+ "registry": "https://registry.npmjs.org",
86
+ "access": "public"
87
+ },
82
88
  "packageManager": "pnpm@9.13.0",
83
89
  "dependencies": {
84
90
  "libphonenumber-js": "^1.12.41"