@zag-js/i18n-utils 1.17.1 → 1.17.2

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/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ declare function createCollator(locale?: string, options?: Intl.CollatorOptions): Intl.Collator;
2
+
1
3
  interface FilterReturn {
2
4
  startsWith(string: string, substring: string): boolean;
3
5
  endsWith(string: string, substring: string): boolean;
@@ -48,4 +50,4 @@ interface LocaleOptions {
48
50
  }
49
51
  declare function trackLocale(options?: LocaleOptions): () => void;
50
52
 
51
- export { type FilterOptions, type FilterReturn, type FormatBytesOptions, type Locale, type LocaleOptions, createFilter, formatBytes, formatDate, formatList, formatNumber, formatRelativeTime, getDefaultLocale, getLocaleDir, isRTL, trackLocale };
53
+ export { type FilterOptions, type FilterReturn, type FormatBytesOptions, type Locale, type LocaleOptions, createCollator, createFilter, formatBytes, formatDate, formatList, formatNumber, formatRelativeTime, getDefaultLocale, getLocaleDir, isRTL, trackLocale };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ declare function createCollator(locale?: string, options?: Intl.CollatorOptions): Intl.Collator;
2
+
1
3
  interface FilterReturn {
2
4
  startsWith(string: string, substring: string): boolean;
3
5
  endsWith(string: string, substring: string): boolean;
@@ -48,4 +50,4 @@ interface LocaleOptions {
48
50
  }
49
51
  declare function trackLocale(options?: LocaleOptions): () => void;
50
52
 
51
- export { type FilterOptions, type FilterReturn, type FormatBytesOptions, type Locale, type LocaleOptions, createFilter, formatBytes, formatDate, formatList, formatNumber, formatRelativeTime, getDefaultLocale, getLocaleDir, isRTL, trackLocale };
53
+ export { type FilterOptions, type FilterReturn, type FormatBytesOptions, type Locale, type LocaleOptions, createCollator, createFilter, formatBytes, formatDate, formatList, formatNumber, formatRelativeTime, getDefaultLocale, getLocaleDir, isRTL, trackLocale };
package/dist/index.js CHANGED
@@ -16,6 +16,12 @@ function i18nCache(Ins) {
16
16
  };
17
17
  }
18
18
 
19
+ // src/collator.ts
20
+ var getCollator = i18nCache(Intl.Collator);
21
+ function createCollator(locale = "en-US", options = {}) {
22
+ return getCollator(locale, options);
23
+ }
24
+
19
25
  // src/filter.ts
20
26
  var collatorCache = i18nCache(Intl.Collator);
21
27
  function createFilter(options) {
@@ -435,6 +441,7 @@ function trackLocale(options = {}) {
435
441
  };
436
442
  }
437
443
 
444
+ exports.createCollator = createCollator;
438
445
  exports.createFilter = createFilter;
439
446
  exports.formatBytes = formatBytes;
440
447
  exports.formatDate = formatDate;
package/dist/index.mjs CHANGED
@@ -14,6 +14,12 @@ function i18nCache(Ins) {
14
14
  };
15
15
  }
16
16
 
17
+ // src/collator.ts
18
+ var getCollator = i18nCache(Intl.Collator);
19
+ function createCollator(locale = "en-US", options = {}) {
20
+ return getCollator(locale, options);
21
+ }
22
+
17
23
  // src/filter.ts
18
24
  var collatorCache = i18nCache(Intl.Collator);
19
25
  function createFilter(options) {
@@ -433,4 +439,4 @@ function trackLocale(options = {}) {
433
439
  };
434
440
  }
435
441
 
436
- export { createFilter, formatBytes, formatDate, formatList, formatNumber, formatRelativeTime, getDefaultLocale, getLocaleDir, isRTL, trackLocale };
442
+ export { createCollator, createFilter, formatBytes, formatDate, formatList, formatNumber, formatRelativeTime, getDefaultLocale, getLocaleDir, isRTL, trackLocale };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/i18n-utils",
3
- "version": "1.17.1",
3
+ "version": "1.17.2",
4
4
  "description": "Interationalization utilities for Zag.js",
5
5
  "keywords": [
6
6
  "js",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "clean-package": "../../../clean-package.config.json",
26
26
  "dependencies": {
27
- "@zag-js/dom-query": "1.17.1"
27
+ "@zag-js/dom-query": "1.17.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "clean-package": "2.2.0",