@simplybusiness/mobius 6.10.2 → 6.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.10.4
4
+
5
+ ### Patch Changes
6
+
7
+ - ed30ae9: Update React peerDependencies from ^19.1.2 to ^19.2.0 to enable useEffectEvent hook
8
+ - @simplybusiness/icons@4.40.2
9
+
10
+ ## 6.10.3
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [961b1f9]
15
+ - @simplybusiness/icons@4.40.2
16
+
3
17
  ## 6.10.2
4
18
 
5
19
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __typeError = (msg) => {
9
+ throw TypeError(msg);
10
+ };
8
11
  var __export = (target, all) => {
9
12
  for (var name in all)
10
13
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -26,6 +29,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
29
  mod
27
30
  ));
28
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
33
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
34
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
35
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
29
36
 
30
37
  // index.tsx
31
38
  var index_exports = {};
@@ -1990,38 +1997,39 @@ var LOQATE_BASE_URL = "https://api.addressy.com/Capture/Interactive";
1990
1997
  var LOQATE_FIND_URL = "/Find/v1.00/json3.ws";
1991
1998
  var LOQATE_RETRIEVE_URL = "/Retrieve/v1.2/json3.ws";
1992
1999
  var DEFAULT_COUNTRIES = ["GB"];
2000
+ var _baseUrl, _apiKey, _countries, _filters;
1993
2001
  var LoqateAddressLookupService = class {
1994
- /**
1995
- * Base URL for the Loqate API
1996
- */
1997
- #baseUrl;
1998
- /**
1999
- * API key for the Loqate API
2000
- */
2001
- #apiKey;
2002
- /**
2003
- * List of allowed country codes for the Loqate API
2004
- * 2 or 3 character ISO country codes
2005
- */
2006
- #countries;
2007
- /**
2008
- * Optional filters for the Loqate API
2009
- * E.g., { AdministrativeArea: "CA", PostalCode: "90210" }
2010
- */
2011
- #filters;
2012
2002
  constructor({
2013
2003
  baseUrl,
2014
2004
  apiKey,
2015
2005
  countries,
2016
2006
  filters
2017
2007
  }) {
2018
- this.#apiKey = apiKey;
2019
- this.#baseUrl = baseUrl || LOQATE_BASE_URL;
2020
- this.#countries = countries || DEFAULT_COUNTRIES;
2021
- this.#filters = filters;
2008
+ /**
2009
+ * Base URL for the Loqate API
2010
+ */
2011
+ __privateAdd(this, _baseUrl);
2012
+ /**
2013
+ * API key for the Loqate API
2014
+ */
2015
+ __privateAdd(this, _apiKey);
2016
+ /**
2017
+ * List of allowed country codes for the Loqate API
2018
+ * 2 or 3 character ISO country codes
2019
+ */
2020
+ __privateAdd(this, _countries);
2021
+ /**
2022
+ * Optional filters for the Loqate API
2023
+ * E.g., { AdministrativeArea: "CA", PostalCode: "90210" }
2024
+ */
2025
+ __privateAdd(this, _filters);
2026
+ __privateSet(this, _apiKey, apiKey);
2027
+ __privateSet(this, _baseUrl, baseUrl || LOQATE_BASE_URL);
2028
+ __privateSet(this, _countries, countries || DEFAULT_COUNTRIES);
2029
+ __privateSet(this, _filters, filters);
2022
2030
  }
2023
2031
  fetchFromApi(url) {
2024
- return fetch(`${this.#baseUrl}${url}`).then((response) => response.json()).then((json) => {
2032
+ return fetch(`${__privateGet(this, _baseUrl)}${url}`).then((response) => response.json()).then((json) => {
2025
2033
  if (json.Items?.some((item) => item.Error)) {
2026
2034
  throw new LoqateAddressLookupError(json);
2027
2035
  }
@@ -2036,28 +2044,32 @@ var LoqateAddressLookupService = class {
2036
2044
  * @returns Empty string if no filters, otherwise "&Filters=key1:value1&key2:value2" (Loqate's expected format for Filters)
2037
2045
  */
2038
2046
  buildFiltersQuery() {
2039
- if (!this.#filters || Object.keys(this.#filters).length === 0) {
2047
+ if (!__privateGet(this, _filters) || Object.keys(__privateGet(this, _filters)).length === 0) {
2040
2048
  return "";
2041
2049
  }
2042
- const encodedFilters = Object.entries(this.#filters).map(([key, value]) => `${key}:${encodeURIComponent(value)}`).join("&");
2050
+ const encodedFilters = Object.entries(__privateGet(this, _filters)).map(([key, value]) => `${key}:${encodeURIComponent(value)}`).join("&");
2043
2051
  return `&Filters=${encodedFilters}`;
2044
2052
  }
2045
2053
  search(searchTerm) {
2046
- let url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Text=${searchTerm}&Countries=${this.#countries?.join(",")}`;
2054
+ let url = `${LOQATE_FIND_URL}?Key=${__privateGet(this, _apiKey)}&Text=${searchTerm}&Countries=${__privateGet(this, _countries)?.join(",")}`;
2047
2055
  url += this.buildFiltersQuery();
2048
2056
  return this.fetchFromApi(url);
2049
2057
  }
2050
2058
  findById(id) {
2051
- let url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Container=${id}&Countries=${this.#countries?.join(",")}`;
2059
+ let url = `${LOQATE_FIND_URL}?Key=${__privateGet(this, _apiKey)}&Container=${id}&Countries=${__privateGet(this, _countries)?.join(",")}`;
2052
2060
  url += this.buildFiltersQuery();
2053
2061
  return this.fetchFromApi(url);
2054
2062
  }
2055
2063
  async get(id) {
2056
- const url = `${LOQATE_RETRIEVE_URL}?Key=${this.#apiKey}&Id=${id}`;
2064
+ const url = `${LOQATE_RETRIEVE_URL}?Key=${__privateGet(this, _apiKey)}&Id=${id}`;
2057
2065
  const response = await this.fetchFromApi(url);
2058
2066
  return response.Items[0];
2059
2067
  }
2060
2068
  };
2069
+ _baseUrl = new WeakMap();
2070
+ _apiKey = new WeakMap();
2071
+ _countries = new WeakMap();
2072
+ _filters = new WeakMap();
2061
2073
 
2062
2074
  // src/components/Alert/Alert.tsx
2063
2075
  var import_icons4 = require("@simplybusiness/icons");
@@ -1218,6 +1218,11 @@
1218
1218
  "path": "src/components/AddressLookup/LoqateAddressLookupError.tsx",
1219
1219
  "kind": "import-statement",
1220
1220
  "original": "./LoqateAddressLookupError"
1221
+ },
1222
+ {
1223
+ "path": "<runtime>",
1224
+ "kind": "import-statement",
1225
+ "external": true
1221
1226
  }
1222
1227
  ],
1223
1228
  "format": "esm"
@@ -4859,7 +4864,7 @@
4859
4864
  "bytesInOutput": 193
4860
4865
  },
4861
4866
  "src/components/AddressLookup/LoqateAddressLookupService.tsx": {
4862
- "bytesInOutput": 2418
4867
+ "bytesInOutput": 2875
4863
4868
  },
4864
4869
  "src/components/Alert/Alert.tsx": {
4865
4870
  "bytesInOutput": 2091
@@ -5072,7 +5077,7 @@
5072
5077
  "bytesInOutput": 3743
5073
5078
  }
5074
5079
  },
5075
- "bytes": 164522
5080
+ "bytes": 165643
5076
5081
  }
5077
5082
  }
5078
5083
  }
package/dist/esm/index.js CHANGED
@@ -1,3 +1,11 @@
1
+ var __typeError = (msg) => {
2
+ throw TypeError(msg);
3
+ };
4
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
5
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
6
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
7
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
8
+
1
9
  // src/components/Accordion/Accordion.tsx
2
10
  import classNames4 from "classnames/dedupe";
3
11
  import { useEffect as useEffect11, useState as useState6, useId as useId3 } from "react";
@@ -1878,38 +1886,39 @@ var LOQATE_BASE_URL = "https://api.addressy.com/Capture/Interactive";
1878
1886
  var LOQATE_FIND_URL = "/Find/v1.00/json3.ws";
1879
1887
  var LOQATE_RETRIEVE_URL = "/Retrieve/v1.2/json3.ws";
1880
1888
  var DEFAULT_COUNTRIES = ["GB"];
1889
+ var _baseUrl, _apiKey, _countries, _filters;
1881
1890
  var LoqateAddressLookupService = class {
1882
- /**
1883
- * Base URL for the Loqate API
1884
- */
1885
- #baseUrl;
1886
- /**
1887
- * API key for the Loqate API
1888
- */
1889
- #apiKey;
1890
- /**
1891
- * List of allowed country codes for the Loqate API
1892
- * 2 or 3 character ISO country codes
1893
- */
1894
- #countries;
1895
- /**
1896
- * Optional filters for the Loqate API
1897
- * E.g., { AdministrativeArea: "CA", PostalCode: "90210" }
1898
- */
1899
- #filters;
1900
1891
  constructor({
1901
1892
  baseUrl,
1902
1893
  apiKey,
1903
1894
  countries,
1904
1895
  filters
1905
1896
  }) {
1906
- this.#apiKey = apiKey;
1907
- this.#baseUrl = baseUrl || LOQATE_BASE_URL;
1908
- this.#countries = countries || DEFAULT_COUNTRIES;
1909
- this.#filters = filters;
1897
+ /**
1898
+ * Base URL for the Loqate API
1899
+ */
1900
+ __privateAdd(this, _baseUrl);
1901
+ /**
1902
+ * API key for the Loqate API
1903
+ */
1904
+ __privateAdd(this, _apiKey);
1905
+ /**
1906
+ * List of allowed country codes for the Loqate API
1907
+ * 2 or 3 character ISO country codes
1908
+ */
1909
+ __privateAdd(this, _countries);
1910
+ /**
1911
+ * Optional filters for the Loqate API
1912
+ * E.g., { AdministrativeArea: "CA", PostalCode: "90210" }
1913
+ */
1914
+ __privateAdd(this, _filters);
1915
+ __privateSet(this, _apiKey, apiKey);
1916
+ __privateSet(this, _baseUrl, baseUrl || LOQATE_BASE_URL);
1917
+ __privateSet(this, _countries, countries || DEFAULT_COUNTRIES);
1918
+ __privateSet(this, _filters, filters);
1910
1919
  }
1911
1920
  fetchFromApi(url) {
1912
- return fetch(`${this.#baseUrl}${url}`).then((response) => response.json()).then((json) => {
1921
+ return fetch(`${__privateGet(this, _baseUrl)}${url}`).then((response) => response.json()).then((json) => {
1913
1922
  if (json.Items?.some((item) => item.Error)) {
1914
1923
  throw new LoqateAddressLookupError(json);
1915
1924
  }
@@ -1924,28 +1933,32 @@ var LoqateAddressLookupService = class {
1924
1933
  * @returns Empty string if no filters, otherwise "&Filters=key1:value1&key2:value2" (Loqate's expected format for Filters)
1925
1934
  */
1926
1935
  buildFiltersQuery() {
1927
- if (!this.#filters || Object.keys(this.#filters).length === 0) {
1936
+ if (!__privateGet(this, _filters) || Object.keys(__privateGet(this, _filters)).length === 0) {
1928
1937
  return "";
1929
1938
  }
1930
- const encodedFilters = Object.entries(this.#filters).map(([key, value]) => `${key}:${encodeURIComponent(value)}`).join("&");
1939
+ const encodedFilters = Object.entries(__privateGet(this, _filters)).map(([key, value]) => `${key}:${encodeURIComponent(value)}`).join("&");
1931
1940
  return `&Filters=${encodedFilters}`;
1932
1941
  }
1933
1942
  search(searchTerm) {
1934
- let url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Text=${searchTerm}&Countries=${this.#countries?.join(",")}`;
1943
+ let url = `${LOQATE_FIND_URL}?Key=${__privateGet(this, _apiKey)}&Text=${searchTerm}&Countries=${__privateGet(this, _countries)?.join(",")}`;
1935
1944
  url += this.buildFiltersQuery();
1936
1945
  return this.fetchFromApi(url);
1937
1946
  }
1938
1947
  findById(id) {
1939
- let url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Container=${id}&Countries=${this.#countries?.join(",")}`;
1948
+ let url = `${LOQATE_FIND_URL}?Key=${__privateGet(this, _apiKey)}&Container=${id}&Countries=${__privateGet(this, _countries)?.join(",")}`;
1940
1949
  url += this.buildFiltersQuery();
1941
1950
  return this.fetchFromApi(url);
1942
1951
  }
1943
1952
  async get(id) {
1944
- const url = `${LOQATE_RETRIEVE_URL}?Key=${this.#apiKey}&Id=${id}`;
1953
+ const url = `${LOQATE_RETRIEVE_URL}?Key=${__privateGet(this, _apiKey)}&Id=${id}`;
1945
1954
  const response = await this.fetchFromApi(url);
1946
1955
  return response.Items[0];
1947
1956
  }
1948
1957
  };
1958
+ _baseUrl = new WeakMap();
1959
+ _apiKey = new WeakMap();
1960
+ _countries = new WeakMap();
1961
+ _filters = new WeakMap();
1949
1962
 
1950
1963
  // src/components/Alert/Alert.tsx
1951
1964
  import { circleInfo, circleTick, error as error2, warning } from "@simplybusiness/icons";
@@ -1218,6 +1218,11 @@
1218
1218
  "path": "src/components/AddressLookup/LoqateAddressLookupError.tsx",
1219
1219
  "kind": "import-statement",
1220
1220
  "original": "./LoqateAddressLookupError"
1221
+ },
1222
+ {
1223
+ "path": "<runtime>",
1224
+ "kind": "import-statement",
1225
+ "external": true
1221
1226
  }
1222
1227
  ],
1223
1228
  "format": "esm"
@@ -4934,7 +4939,7 @@
4934
4939
  "bytesInOutput": 193
4935
4940
  },
4936
4941
  "src/components/AddressLookup/LoqateAddressLookupService.tsx": {
4937
- "bytesInOutput": 2418
4942
+ "bytesInOutput": 2875
4938
4943
  },
4939
4944
  "src/components/Alert/Alert.tsx": {
4940
4945
  "bytesInOutput": 1846
@@ -5150,7 +5155,7 @@
5150
5155
  "bytesInOutput": 0
5151
5156
  }
5152
5157
  },
5153
- "bytes": 152565
5158
+ "bytes": 153687
5154
5159
  }
5155
5160
  }
5156
5161
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simplybusiness/mobius",
3
3
  "license": "UNLICENSED",
4
- "version": "6.10.2",
4
+ "version": "6.10.4",
5
5
  "description": "Core library of Mobius react components",
6
6
  "repository": {
7
7
  "type": "git",
@@ -48,8 +48,9 @@
48
48
  "@eslint/eslintrc": "^3.3.1",
49
49
  "@eslint/js": "^9.39.1",
50
50
  "@react-types/progress": "^3.5.16",
51
- "@simplybusiness/eslint-config": "^1.1.2",
52
- "@simplybusiness/eslint-plugin": "^1.2.0",
51
+ "@simplybusiness/build-scripts": "^1.2.1",
52
+ "@simplybusiness/eslint-config": "^2.0.0",
53
+ "@simplybusiness/eslint-plugin": "^1.2.1",
53
54
  "@swc/core": "^1.12.5",
54
55
  "@swc/jest": "^0.2.39",
55
56
  "@testing-library/dom": "^10.4.1",
@@ -64,7 +65,6 @@
64
65
  "@types/react-dom": "^19.2.3",
65
66
  "@typescript-eslint/eslint-plugin": "^8.47.0",
66
67
  "@typescript-eslint/parser": "^8.47.0",
67
- "build-scripts": "^1.1.2",
68
68
  "csstype": "^3.2.3",
69
69
  "eslint": "^9.39.1",
70
70
  "eslint-plugin-ssr-friendly": "^1.3.0",
@@ -79,12 +79,12 @@
79
79
  "typescript": "^5.9.3"
80
80
  },
81
81
  "peerDependencies": {
82
- "react": "^19.1.2",
83
- "react-dom": "^19.1.2"
82
+ "react": "^19.2.0",
83
+ "react-dom": "^19.2.0"
84
84
  },
85
85
  "dependencies": {
86
86
  "@floating-ui/react": "^0.27.16",
87
- "@simplybusiness/icons": "^4.40.1",
87
+ "@simplybusiness/icons": "^4.40.2",
88
88
  "classnames": "^2.5.1",
89
89
  "dialog-polyfill": "^0.5.6",
90
90
  "lodash.debounce": "^4.0.8",