@alikhalilll/ui 1.0.0 → 1.1.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.
Files changed (43) hide show
  1. package/README.md +155 -187
  2. package/dist/chunks/ADrawerContent.vue_vue_type_script_setup_true_lang-BivIZvV1.mjs +108 -0
  3. package/dist/chunks/ADrawerContent.vue_vue_type_script_setup_true_lang-BivIZvV1.mjs.map +1 -0
  4. package/dist/chunks/AInput.vue_vue_type_script_setup_true_lang-BJUP7ePq.mjs +81 -0
  5. package/dist/chunks/AInput.vue_vue_type_script_setup_true_lang-BJUP7ePq.mjs.map +1 -0
  6. package/dist/chunks/APopoverContent.vue_vue_type_script_setup_true_lang-o1XhV9DM.mjs +132 -0
  7. package/dist/chunks/APopoverContent.vue_vue_type_script_setup_true_lang-o1XhV9DM.mjs.map +1 -0
  8. package/dist/chunks/AResponsivePopoverContent.vue_vue_type_script_setup_true_lang-BYEb5UBL.mjs +92 -0
  9. package/dist/chunks/AResponsivePopoverContent.vue_vue_type_script_setup_true_lang-BYEb5UBL.mjs.map +1 -0
  10. package/dist/chunks/ATellInput.vue_vue_type_script_setup_true_lang-Clc-B8SW.mjs +1353 -0
  11. package/dist/chunks/ATellInput.vue_vue_type_script_setup_true_lang-Clc-B8SW.mjs.map +1 -0
  12. package/dist/chunks/cn-B6yFEsav.mjs +9 -0
  13. package/dist/chunks/cn-B6yFEsav.mjs.map +1 -0
  14. package/dist/chunks/sizes-B_9MfLkz.mjs +34 -0
  15. package/dist/chunks/sizes-B_9MfLkz.mjs.map +1 -0
  16. package/dist/drawer.d.ts +116 -0
  17. package/dist/drawer.mjs +8 -0
  18. package/dist/drawer.mjs.map +1 -0
  19. package/dist/index.d.ts +84 -57
  20. package/dist/index.mjs +35 -1516
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/input.d.ts +65 -0
  23. package/dist/input.mjs +5 -0
  24. package/dist/input.mjs.map +1 -0
  25. package/dist/popover.d.ts +117 -0
  26. package/dist/popover.mjs +8 -0
  27. package/dist/popover.mjs.map +1 -0
  28. package/dist/responsive-popover.d.ts +124 -0
  29. package/dist/responsive-popover.mjs +7 -0
  30. package/dist/responsive-popover.mjs.map +1 -0
  31. package/dist/tell-input.d.ts +637 -0
  32. package/dist/tell-input.mjs +13 -0
  33. package/dist/tell-input.mjs.map +1 -0
  34. package/dist/utils.d.ts +29 -0
  35. package/dist/utils.mjs +12 -0
  36. package/dist/utils.mjs.map +1 -0
  37. package/entries/drawer/README.md +39 -0
  38. package/entries/input/README.md +42 -0
  39. package/entries/popover/README.md +37 -0
  40. package/entries/responsive-popover/README.md +47 -0
  41. package/entries/tell-input/README.md +52 -0
  42. package/package.json +30 -4
  43. /package/dist/{styles.css → assets/styles.css} +0 -0
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, Comp
26
26
  size: Size;
27
27
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
28
28
 
29
- declare const __VLS_component_10: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{}>, {
29
+ declare const __VLS_component_10: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{}>, {
30
30
  sideOffset: number;
31
31
  align: "start" | "center" | "end";
32
32
  overlay: boolean;
@@ -40,16 +40,18 @@ selectedDialCode: ComputedRef<string | null>;
40
40
  validationState: ComputedRef<"error" | "idle" | "valid">;
41
41
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
42
42
  "update:phone": (value: string) => any;
43
- "update:country": (value: string) => any;
43
+ "update:country": (value: number | null) => any;
44
44
  }, string, PublicProps, Readonly<__VLS_PublicProps_2> & Readonly<{
45
45
  "onUpdate:phone"?: ((value: string) => any) | undefined;
46
- "onUpdate:country"?: ((value: string) => any) | undefined;
46
+ "onUpdate:country"?: ((value: number | null) => any) | undefined;
47
47
  }>, {
48
48
  size: ATellInputSize;
49
49
  placeholder: string;
50
50
  ipEndpoint: string;
51
51
  defaultCountry: string;
52
52
  detectCountry: DetectionStrategy;
53
+ detectFromInput: boolean;
54
+ detectDebounceMs: number;
53
55
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
54
56
 
55
57
  declare const __VLS_component_12: DefineComponent<__VLS_PublicProps_3, {
@@ -78,7 +80,7 @@ kbdOpen: string | null;
78
80
  kbdClose: string | null;
79
81
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
80
82
 
81
- declare const __VLS_component_13: DefineComponent<__VLS_Props_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_10> & Readonly<{}>, {
83
+ declare const __VLS_component_13: DefineComponent<__VLS_Props_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_11> & Readonly<{}>, {
82
84
  width: number;
83
85
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
84
86
 
@@ -132,14 +134,14 @@ shouldScaleBackground: boolean;
132
134
 
133
135
  declare const __VLS_component_6: DefineComponent<DrawerTriggerProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DrawerTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
134
136
 
135
- declare const __VLS_component_7: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
137
+ declare const __VLS_component_7: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
136
138
  escapeKeyDown: (event: KeyboardEvent) => any;
137
139
  pointerDownOutside: (event: PointerDownOutsideEvent) => any;
138
140
  focusOutside: (event: FocusOutsideEvent) => any;
139
141
  interactOutside: (event: PointerDownOutsideEvent | FocusOutsideEvent) => any;
140
142
  openAutoFocus: (event: Event) => any;
141
143
  closeAutoFocus: (event: Event) => any;
142
- }, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{
144
+ }, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
143
145
  onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
144
146
  onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
145
147
  onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
@@ -157,7 +159,7 @@ modal: boolean;
157
159
  breakpoint: string;
158
160
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
159
161
 
160
- declare const __VLS_component_9: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{}>, {
162
+ declare const __VLS_component_9: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{}>, {
161
163
  breakpoint: string;
162
164
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
163
165
 
@@ -175,6 +177,43 @@ declare type __VLS_Props = {
175
177
  };
176
178
 
177
179
  declare type __VLS_Props_10 = {
180
+ class?: HTMLAttributes['class'];
181
+ triggerClass?: HTMLAttributes['class'];
182
+ contentClass?: HTMLAttributes['class'];
183
+ popoverClass?: HTMLAttributes['class'];
184
+ drawerClass?: HTMLAttributes['class'];
185
+ searchPlaceholder?: string;
186
+ emptyText?: string;
187
+ loadingText?: string;
188
+ suggestedLabel?: string;
189
+ allCountriesLabel?: string;
190
+ /** ISO2 codes that are selectable. Others are listed but disabled. */
191
+ allowedDialCodes?: string[];
192
+ disabled?: boolean;
193
+ /** Drives the trigger button padding + text size. Matches ATellInput's `size`. */
194
+ size?: Size;
195
+ /** Max items rendered under the "Suggested" header (current + recents, deduped). */
196
+ suggestedLimit?: number;
197
+ /** Cap the number of matching countries shown in search results. */
198
+ maxResults?: number;
199
+ /** Override the flag URL builder, e.g. `(iso, w) => \`/flags/${iso}.svg\``. */
200
+ flagUrl?: (iso2: string, width: number) => string;
201
+ /**
202
+ * Custom search predicate. Default: substring match on the precomputed `search_key`.
203
+ * Return `true` to keep the country in results.
204
+ */
205
+ searcher?: (query: string, country: CountryOption) => boolean;
206
+ /**
207
+ * Provide your own country list (bypasses the REST Countries fetch). Useful when you
208
+ * already have a curated subset, an i18n'd list, or want to avoid the network call.
209
+ */
210
+ countries?: CountryOption[];
211
+ /** Override the right-side kbd hints. Pass `null` to hide. */
212
+ kbdOpen?: string | null;
213
+ kbdClose?: string | null;
214
+ };
215
+
216
+ declare type __VLS_Props_11 = {
178
217
  /** ISO 3166-1 alpha-2 country code, case-insensitive. */
179
218
  iso2: string;
180
219
  /** Pixel width served by flagcdn. 40 is crisp at retina up to ~24px wide. */
@@ -189,20 +228,26 @@ declare type __VLS_Props_10 = {
189
228
 
190
229
  declare type __VLS_Props_2 = PopoverContentProps & {
191
230
  class?: HTMLAttributes['class'];
192
- /** Render a dimmed, clickable backdrop behind the popover. Pair with `<APopover modal>`. */
231
+ /** Dim the entire viewport behind the popover and block all interaction with the
232
+ * page (clicks are captured by the overlay; body scroll is locked while open).
233
+ * Pair with `<APopover :modal="true">` (the default) for the full modal behaviour. */
193
234
  overlay?: boolean;
194
235
  overlayClass?: HTMLAttributes['class'];
195
236
  };
196
237
 
197
- declare type __VLS_Props_3 = DialogContentProps & {
238
+ declare type __VLS_Props_3 = {
239
+ class?: HTMLAttributes['class'];
240
+ };
241
+
242
+ declare type __VLS_Props_4 = DialogContentProps & {
198
243
  class?: HTMLAttributes['class'];
199
244
  };
200
245
 
201
- declare type __VLS_Props_4 = DialogOverlayProps & {
246
+ declare type __VLS_Props_5 = DialogOverlayProps & {
202
247
  class?: HTMLAttributes['class'];
203
248
  };
204
249
 
205
- declare type __VLS_Props_5 = {
250
+ declare type __VLS_Props_6 = {
206
251
  /** CSS media query for the desktop break. Below this width we render a vaul drawer. */
207
252
  breakpoint?: string;
208
253
  /**
@@ -212,12 +257,12 @@ declare type __VLS_Props_5 = {
212
257
  modal?: boolean;
213
258
  };
214
259
 
215
- declare type __VLS_Props_6 = {
260
+ declare type __VLS_Props_7 = {
216
261
  breakpoint?: string;
217
262
  asChild?: boolean;
218
263
  };
219
264
 
220
- declare type __VLS_Props_7 = {
265
+ declare type __VLS_Props_8 = {
221
266
  breakpoint?: string;
222
267
  /** Classes applied on both branches. Avoid width / inset classes here. */
223
268
  class?: HTMLAttributes['class'];
@@ -235,57 +280,20 @@ declare type __VLS_Props_7 = {
235
280
  sideOffset?: number;
236
281
  };
237
282
 
238
- declare type __VLS_Props_8 = ExtendedProps;
239
-
240
- declare type __VLS_Props_9 = {
241
- class?: HTMLAttributes['class'];
242
- triggerClass?: HTMLAttributes['class'];
243
- contentClass?: HTMLAttributes['class'];
244
- popoverClass?: HTMLAttributes['class'];
245
- drawerClass?: HTMLAttributes['class'];
246
- searchPlaceholder?: string;
247
- emptyText?: string;
248
- loadingText?: string;
249
- suggestedLabel?: string;
250
- allCountriesLabel?: string;
251
- /** ISO2 codes that are selectable. Others are listed but disabled. */
252
- allowedDialCodes?: string[];
253
- disabled?: boolean;
254
- /** Drives the trigger button padding + text size. Matches ATellInput's `size`. */
255
- size?: Size;
256
- /** Max items rendered under the "Suggested" header (current + recents, deduped). */
257
- suggestedLimit?: number;
258
- /** Cap the number of matching countries shown in search results. */
259
- maxResults?: number;
260
- /** Override the flag URL builder, e.g. `(iso, w) => \`/flags/${iso}.svg\``. */
261
- flagUrl?: (iso2: string, width: number) => string;
262
- /**
263
- * Custom search predicate. Default: substring match on the precomputed `search_key`.
264
- * Return `true` to keep the country in results.
265
- */
266
- searcher?: (query: string, country: CountryOption) => boolean;
267
- /**
268
- * Provide your own country list (bypasses the REST Countries fetch). Useful when you
269
- * already have a curated subset, an i18n'd list, or want to avoid the network call.
270
- */
271
- countries?: CountryOption[];
272
- /** Override the right-side kbd hints. Pass `null` to hide. */
273
- kbdOpen?: string | null;
274
- kbdClose?: string | null;
275
- };
283
+ declare type __VLS_Props_9 = ExtendedProps;
276
284
 
277
285
  declare type __VLS_PublicProps = {
278
286
  'open'?: boolean;
279
- } & __VLS_Props_5;
287
+ } & __VLS_Props_6;
280
288
 
281
289
  declare type __VLS_PublicProps_2 = {
282
290
  'phone'?: string;
283
- 'country'?: string;
284
- } & __VLS_Props_8;
291
+ 'country'?: number | null;
292
+ } & __VLS_Props_9;
285
293
 
286
294
  declare type __VLS_PublicProps_3 = {
287
295
  'selected'?: string;
288
- } & __VLS_Props_9;
296
+ } & __VLS_Props_10;
289
297
 
290
298
  declare function __VLS_template(): {
291
299
  attrs: Partial<{}>;
@@ -744,7 +752,7 @@ export declare const ADrawer: __VLS_WithTemplateSlots_5<typeof __VLS_component_5
744
752
 
745
753
  export declare const ADrawerContent: __VLS_WithTemplateSlots_7<typeof __VLS_component_7, __VLS_TemplateResult_7["slots"]>;
746
754
 
747
- export declare const ADrawerOverlay: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
755
+ export declare const ADrawerOverlay: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
748
756
 
749
757
  export declare const ADrawerTrigger: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
750
758
 
@@ -754,6 +762,8 @@ export declare const APopover: __VLS_WithTemplateSlots_2<typeof __VLS_component_
754
762
 
755
763
  export declare const APopoverContent: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
756
764
 
765
+ export declare const APopoverOverlay: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
766
+
757
767
  export declare const APopoverTrigger: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
758
768
 
759
769
  export declare const AResponsivePopover: __VLS_WithTemplateSlots_8<typeof __VLS_component_8, __VLS_TemplateResult_8["slots"]>;
@@ -782,7 +792,11 @@ export declare interface ATellInputProps {
782
792
  * timezone, then `navigator.language`, finally `defaultCountry`.
783
793
  */
784
794
  detectCountry?: DetectionStrategy;
785
- /** Fallback ISO2 when detection fails or is disabled. */
795
+ /**
796
+ * Initial country. Accepts either an ISO2 code (`'EG'`) or a dial-digit string
797
+ * (`'20'`, `'+20'`). When set, the picker is visible at mount with this country
798
+ * pre-selected — overrides the hidden-until-detected default.
799
+ */
786
800
  defaultCountry?: string;
787
801
  /** Override the IP geolocation endpoint. Must return JSON with `country_code` or `country`. */
788
802
  ipEndpoint?: string;
@@ -792,6 +806,19 @@ export declare interface ATellInputProps {
792
806
  loadingText?: string;
793
807
  /** Error labels keyed by reason. Each gets a sensible English default. */
794
808
  errorMessages?: Partial<Record<PhoneValidationReason, string>>;
809
+ /**
810
+ * When true, the country picker is hidden until a leading dial code is detected in the
811
+ * phone input. Every keystroke runs a longest-prefix match against known dial codes; on
812
+ * first match the picker reveals with that country and the matched dial digits are
813
+ * stripped from `phone`. Skips the onMount IP/timezone/locale detection chain.
814
+ */
815
+ detectFromInput?: boolean;
816
+ /**
817
+ * Debounce window (ms) for `detectFromInput` detection. Each keystroke schedules the
818
+ * libphonenumber parse + lookup; bursts of typing/paste collapse into a single call.
819
+ * Clearing the input is not debounced — the picker hides immediately. Default 150ms.
820
+ */
821
+ detectDebounceMs?: number;
795
822
  }
796
823
 
797
824
  /** Alias for the shared `Size` scale — kept for backwards-friendly naming. */