sodtrack-web-ui 0.103.0 → 0.103.1

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.
@@ -176,13 +176,13 @@ declare const AutocompleteMultiple_old: FC<AutocompleteMultipleProps>;
176
176
 
177
177
  declare const IdField: React$1.ForwardRefExoticComponent<{
178
178
  id?: string | undefined | undefined;
179
+ name?: string | undefined | undefined;
179
180
  onBlur?: React$1.FocusEventHandler<HTMLInputElement> | undefined;
180
181
  disabled?: boolean | undefined | undefined;
181
- name?: string | undefined | undefined;
182
- required?: boolean | undefined | undefined;
183
- readOnly?: boolean | undefined | undefined;
184
- placeholder?: string | undefined | undefined;
185
182
  autoComplete?: React$1.HTMLInputAutoCompleteAttribute | undefined;
183
+ placeholder?: string | undefined | undefined;
184
+ readOnly?: boolean | undefined | undefined;
185
+ required?: boolean | undefined | undefined;
186
186
  } & {
187
187
  className?: React$1.HTMLAttributes<HTMLDivElement>["className"];
188
188
  country?: IdCountryCode;
@@ -268,7 +268,7 @@ type PhoneInputProps = PhoneInputAllowedProps & {
268
268
  value?: Value | string;
269
269
  };
270
270
 
271
- declare const PhoneInput: React$1.ForwardRefExoticComponent<Pick<Props<PhoneNumberInputComponentProps>, "id" | "onBlur" | "disabled" | "name" | "required" | "readOnly" | "placeholder" | "autoComplete"> & {
271
+ declare const PhoneInput: React$1.ForwardRefExoticComponent<Pick<Props<PhoneNumberInputComponentProps>, "id" | "name" | "onBlur" | "disabled" | "autoComplete" | "placeholder" | "readOnly" | "required"> & {
272
272
  defaultCountry?: PhoneCountryCode;
273
273
  } & {
274
274
  className?: React$1.HTMLAttributes<HTMLDivElement>["className"];
@@ -32,6 +32,6 @@ declare const Select: React.ForwardRefExoticComponent<{
32
32
  defaultValue?: string | null;
33
33
  options: SelectOption[];
34
34
  clearable?: boolean;
35
- } & Omit<Select$1.RootProps<SelectOption>, "defaultValue" | "value" | "onValueChange" | "collection"> & React.RefAttributes<HTMLDivElement>>;
35
+ } & Omit<Select$1.RootProps<SelectOption>, "value" | "defaultValue" | "onValueChange" | "collection"> & React.RefAttributes<HTMLDivElement>>;
36
36
 
37
37
  export { Select, type SelectOption, type SelectProps };
@@ -11,7 +11,7 @@ type SignaturePadProps = Omit<SignaturePadRootProps, "onDrawEnd" | "value" | "de
11
11
  onChange?: (file: File | null) => void;
12
12
  rootClassName?: string;
13
13
  };
14
- declare const SignaturePad: React.ForwardRefExoticComponent<Omit<SignaturePad$1.RootProps, "defaultValue" | "onChange" | "value" | "onDrawEnd"> & {
14
+ declare const SignaturePad: React.ForwardRefExoticComponent<Omit<SignaturePad$1.RootProps, "onChange" | "value" | "defaultValue" | "onDrawEnd"> & {
15
15
  label?: string;
16
16
  required?: boolean;
17
17
  tooltip?: string;
@@ -24,6 +24,6 @@ declare const TimePicker: React.ForwardRefExoticComponent<{
24
24
  placeholder?: string;
25
25
  value?: string | null;
26
26
  defaultValue?: string | null;
27
- } & Omit<Select.RootProps<string>, "defaultValue" | "value" | "onValueChange" | "collection"> & React.RefAttributes<HTMLDivElement>>;
27
+ } & Omit<Select.RootProps<string>, "value" | "defaultValue" | "onValueChange" | "collection"> & React.RefAttributes<HTMLDivElement>>;
28
28
 
29
29
  export { TimePicker, type TimePickerProps };
package/dist/phone.d.ts CHANGED
@@ -1 +1,35 @@
1
+ import { PhoneCountryCode } from './components/country-code.js';
1
2
  export { isValidPhoneNumber } from 'libphonenumber-js';
3
+
4
+ /**
5
+ * Normalizes a phone number to E.164 format using a default country as fallback.
6
+ *
7
+ * Built to handle legacy phone data (e.g. customers loaded via API integrations)
8
+ * stored without a country prefix, so consumers don't have to manually prepend
9
+ * it every time they edit a record.
10
+ *
11
+ * Behavior:
12
+ * - Empty/null/undefined/whitespace → returns "".
13
+ * - Valid input (national for `defaultCountry`, or international with "+") →
14
+ * returned as strict E.164. Spaces or extra formatting get stripped.
15
+ * - Invalid input (parse error or `isValid()` false) → returned trimmed,
16
+ * so downstream validation can surface the bad data instead of silently
17
+ * producing a well-formed but bogus number.
18
+ *
19
+ * Note: this can only infer the country from `defaultCountry`. A bare national
20
+ * number is ambiguous across countries (e.g. "992289005" is a valid mobile in
21
+ * both AR and CL), so the result follows whichever country the caller passes.
22
+ *
23
+ * @example
24
+ * normalizePhoneToE164("992289005", "AR"); // "+54992289005"
25
+ * normalizePhoneToE164("+54992289005", "AR"); // "+54992289005"
26
+ * normalizePhoneToE164("+54 9 11 1234 5678", "AR"); // "+5491112345678"
27
+ * normalizePhoneToE164("992289005", "CL"); // "+56992289005"
28
+ * normalizePhoneToE164("999999", "AR"); // "999999" (parses but !isValid)
29
+ * normalizePhoneToE164("abc", "AR"); // "abc" (NOT_A_NUMBER)
30
+ * normalizePhoneToE164(" ", "AR"); // ""
31
+ * normalizePhoneToE164(null, "AR"); // ""
32
+ */
33
+ declare const normalizePhoneToE164: (raw: string | null | undefined, defaultCountry: PhoneCountryCode) => string;
34
+
35
+ export { normalizePhoneToE164 };
package/dist/phone.js CHANGED
@@ -1 +1 @@
1
- export{isValidPhoneNumber}from'libphonenumber-js';
1
+ import {parsePhoneNumberWithError}from'libphonenumber-js';export{isValidPhoneNumber}from'libphonenumber-js';var m=(e,n)=>{let r=e?.trim();if(!r)return "";try{let o=parsePhoneNumberWithError(r,n);return o.isValid()?o.number:r}catch{return r}};export{m as normalizePhoneToE164};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sodtrack-web-ui",
3
- "version": "0.103.0",
3
+ "version": "0.103.1",
4
4
  "type": "module",
5
5
  "description": "UI components for Sodtrack Web",
6
6
  "exports": {
@@ -33,20 +33,6 @@
33
33
  "files": [
34
34
  "dist"
35
35
  ],
36
- "scripts": {
37
- "test": "echo \"Error: no test specified\" && exit 1",
38
- "prepare": "husky",
39
- "check:trust-policy": "pnpm install --frozen-lockfile --config.trustPolicy=no-downgrade",
40
- "check": "pnpm run format && pnpm run lint:strict",
41
- "build": "tsup --publicDir",
42
- "storybook": "storybook dev -p 6006",
43
- "build-storybook": "storybook build",
44
- "format": "prettier --check .",
45
- "format:fix": "prettier --write .",
46
- "lint": "oxlint",
47
- "lint:fix": "oxlint --fix",
48
- "lint:strict": "oxlint --deny-warnings"
49
- },
50
36
  "author": "",
51
37
  "license": "ISC",
52
38
  "engines": {
@@ -107,9 +93,9 @@
107
93
  "tsup": "8.5.1",
108
94
  "typescript": "5.8.3",
109
95
  "vite": "7.3.1",
110
- "vite-plugin-svgr": "4.5.0"
96
+ "vite-plugin-svgr": "4.5.0",
97
+ "node": "runtime:22.22.1"
111
98
  },
112
- "packageManager": "pnpm@10.32.1",
113
99
  "devEngines": {
114
100
  "runtime": {
115
101
  "name": "node",
@@ -126,5 +112,18 @@
126
112
  "*.{json,md,css,yml,yaml}": [
127
113
  "prettier --write"
128
114
  ]
115
+ },
116
+ "scripts": {
117
+ "test": "echo \"Error: no test specified\" && exit 1",
118
+ "check:trust-policy": "pnpm install --frozen-lockfile --config.trustPolicy=no-downgrade",
119
+ "check": "pnpm run format && pnpm run lint:strict",
120
+ "build": "tsup --publicDir",
121
+ "storybook": "storybook dev -p 6006",
122
+ "build-storybook": "storybook build",
123
+ "format": "prettier --check .",
124
+ "format:fix": "prettier --write .",
125
+ "lint": "oxlint",
126
+ "lint:fix": "oxlint --fix",
127
+ "lint:strict": "oxlint --deny-warnings"
129
128
  }
130
- }
129
+ }