@desource/phone-mask-react 1.0.0 → 1.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @desource/phone-mask-react
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Svelte Upgrades:
8
+ - Added attachment `phoneMaskAttachment` for usage in native input (for Svelte 5.29+ versions)
9
+ - Added action `phoneMaskAction` for usage in native input (for Svelte 5.0+ versions)
10
+ - Improved keyboard country selection flow and active-descendant accessibility behavior
11
+ - Refined dropdown/key navigation handling and related focus behavior
12
+ - `usePhoneMask` now exposes `formatter` in the return object
13
+
14
+ - Vue Upgrades:
15
+ - Directive was refactored to align with Svelte action
16
+ - Improved keyboard country selection flow and active-descendant accessibility behavior
17
+ - Refined dropdown/key navigation handling and related focus behavior
18
+ - `usePhoneMask` now exposes `formatter` in the return object
19
+
20
+ - React Upgrades:
21
+ - Improved keyboard country selection flow and active-descendant accessibility behavior
22
+ - Refined dropdown/key navigation handling and related focus behavior
23
+ - `usePhoneMask` now exposes `formatter` in the return object
24
+
25
+ - Core Upgrades:
26
+ - Fixed edge cases in mask variant selection and improved input handler robustness
27
+ - Applied reliability-focused refactors in formatter/handlers and build script generation logic
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies []:
32
+ - @desource/phone-mask@1.1.0
33
+
3
34
  ## 1.0.0
4
35
 
5
36
  ### Major Changes
package/README.md CHANGED
@@ -250,15 +250,37 @@ interface UsePhoneMaskOptions {
250
250
 
251
251
  ```ts
252
252
  interface UsePhoneMaskReturn {
253
- ref: RefObject<HTMLInputElement>;
253
+ // Ref to attach to your input element
254
+ ref: RefObject<HTMLInputElement | null>;
255
+
256
+ // Raw digits without formatting (e.g., "1234567890")
254
257
  digits: string;
258
+
259
+ // Phone formatter instance
260
+ formatter: FormatterHelpers;
261
+
262
+ // Full phone number with country code (e.g., "+11234567890")
255
263
  full: string;
264
+
265
+ // Full phone number formatted (e.g., "+1 123-456-7890")
256
266
  fullFormatted: string;
267
+
268
+ // Whether the phone number is complete
257
269
  isComplete: boolean;
270
+
271
+ // Whether the input is empty
258
272
  isEmpty: boolean;
273
+
274
+ // Whether to show validation warning
259
275
  shouldShowWarn: boolean;
276
+
277
+ // Current country data
260
278
  country: MaskFull;
279
+
280
+ // Change country programmatically
261
281
  setCountry: (countryCode: string) => void;
282
+
283
+ // Clear the input
262
284
  clear: () => void;
263
285
  }
264
286
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/components/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA4W/D,eAAO,MAAM,UAAU,uFAA8D,CAAC"}
1
+ {"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/components/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAmX/D,eAAO,MAAM,UAAU,uFAA8D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/hooks/internal/useTheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,UAAU,eAAe;IACvB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,eAAe;;EA0BlD"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/hooks/internal/useTheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,UAAU,eAAe;IACvB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,eAAe;;EA6BlD"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePhoneMask.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePhoneMask.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CA2F7E"}
1
+ {"version":3,"file":"usePhoneMask.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePhoneMask.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CA4F7E"}