najm-kit 2.11.22 → 2.12.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +22 -7
  2. package/README.md +28 -1
  3. package/dist/NIcon-D73-C51g.d.ts +21 -0
  4. package/dist/{NNotFoundState-BmGDW2Bx.d.ts → NNotFoundState-Z2n2gbhS.d.ts} +1 -16
  5. package/dist/{NajmUIProvider-BwL5HFIV.d.ts → NajmUIProvider-C9IJW1ya.d.ts} +2 -19
  6. package/dist/adapters/app.d.ts +6 -4
  7. package/dist/adapters/app.mjs +9 -6
  8. package/dist/adapters/next.d.ts +2 -1
  9. package/dist/adapters/next.mjs +5 -3
  10. package/dist/chunk-5UY7U2ED.mjs +9 -0
  11. package/dist/chunk-A34LRQYI.mjs +7 -0
  12. package/dist/chunk-BFFTC7LD.mjs +66 -0
  13. package/dist/{chunk-5ZTOCWRA.mjs → chunk-F32O3WRX.mjs} +7 -197
  14. package/dist/chunk-FZX3DONZ.mjs +200 -0
  15. package/dist/chunk-GYPQLOQ5.mjs +2202 -0
  16. package/dist/{chunk-BDQK6ECA.mjs → chunk-LMW4DM5L.mjs} +43 -101
  17. package/dist/{chunk-DKHIQFXX.mjs → chunk-QDFLHSWO.mjs} +1 -1
  18. package/dist/{chunk-5JVFMOLI.mjs → chunk-QJ22WAQY.mjs} +2 -28
  19. package/dist/{chunk-LK3SMYUP.mjs → chunk-TZRTOQCC.mjs} +1 -6
  20. package/dist/chunk-VZXMMC72.mjs +31 -0
  21. package/dist/{chunk-M5VGBZ7R.mjs → chunk-WHGRN7PP.mjs} +2 -1
  22. package/dist/formFill-CQkTA0JS.d.ts +17 -0
  23. package/dist/index.d.ts +20 -436
  24. package/dist/index.mjs +338 -1950
  25. package/dist/json.mjs +5 -3
  26. package/dist/location/google.d.ts +14 -0
  27. package/dist/location/google.mjs +184 -0
  28. package/dist/location/index.d.ts +33 -0
  29. package/dist/location/index.mjs +9 -0
  30. package/dist/location/leaflet.d.ts +13 -0
  31. package/dist/location/leaflet.mjs +168 -0
  32. package/dist/theme.css +23 -2
  33. package/dist/types-BQBx0RZd.d.ts +578 -0
  34. package/package.json +29 -2
@@ -0,0 +1,578 @@
1
+ import * as React$1 from 'react';
2
+ import React__default, { InputHTMLAttributes, ReactNode, ComponentType, CSSProperties } from 'react';
3
+ import { UseFormProps, SubmitHandler, UseFormReturn } from 'react-hook-form';
4
+ import { ZodTypeAny, TypeOf } from 'zod';
5
+ import * as culori from 'culori';
6
+ import { N as NIconSource } from './NIcon-D73-C51g.js';
7
+ import { a as FormDevTools } from './formFill-CQkTA0JS.js';
8
+ import * as class_variance_authority_types from 'class-variance-authority/types';
9
+ import * as SliderPrimitive from '@radix-ui/react-slider';
10
+
11
+ type ColorFormat = "hex" | "rgb" | "hsl" | "oklch";
12
+ declare function parseColor(input: string): culori.Color;
13
+ declare function formatColor(input: string, format: ColorFormat): string;
14
+ declare function detectFormat(input: string): ColorFormat;
15
+ declare function toPickerHex(input: string): string;
16
+
17
+ type SliderVariant = "default" | "secondary" | "destructive" | "accent" | "success" | "warning" | "info";
18
+ type SliderSize = "sm" | "md" | "lg";
19
+ type SliderOrientation = "horizontal" | "vertical";
20
+ declare const sliderVariants: (props?: {
21
+ size?: "sm" | "md" | "lg";
22
+ orientation?: "horizontal" | "vertical";
23
+ } & class_variance_authority_types.ClassProp) => string;
24
+ interface NSliderProps extends Omit<React$1.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>, "value" | "defaultValue" | "onValueChange" | "orientation" | "dir" | "asChild"> {
25
+ value?: number | [number, number];
26
+ defaultValue?: number | [number, number];
27
+ onValueChange?: (value: number | [number, number]) => void;
28
+ min?: number;
29
+ max?: number;
30
+ step?: number;
31
+ variant?: SliderVariant;
32
+ size?: SliderSize;
33
+ orientation?: SliderOrientation;
34
+ disabled?: boolean;
35
+ showTooltip?: boolean;
36
+ formatTooltip?: (n: number) => string;
37
+ dir?: "ltr" | "rtl";
38
+ name?: string;
39
+ id?: string;
40
+ "aria-label"?: string;
41
+ "aria-labelledby"?: string;
42
+ }
43
+ declare function NSlider({ value: controlledValue, defaultValue, onValueChange, min, max, step, variant, size, orientation, disabled, showTooltip, formatTooltip, dir, name, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: NSliderProps): React$1.JSX.Element;
44
+ declare namespace NSlider {
45
+ var displayName: string;
46
+ }
47
+
48
+ interface SliderProps extends Omit<NSliderProps, "value" | "defaultValue" | "onValueChange"> {
49
+ value: number[];
50
+ onValueChange: (value: number[]) => void;
51
+ }
52
+ declare function Slider({ value, onValueChange, ...rest }: SliderProps): React$1.JSX.Element;
53
+ interface SliderInputProps extends Omit<NSliderProps, "value" | "defaultValue" | "onValueChange" | "onChange"> {
54
+ value?: number;
55
+ onChange?: (value: number) => void;
56
+ status?: "default" | "error";
57
+ icon?: unknown;
58
+ iconColor?: string;
59
+ readOnly?: boolean;
60
+ }
61
+ declare function SliderInput({ value, onChange, status: _status, icon: _icon, iconColor: _iconColor, readOnly: _readOnly, ...rest }: SliderInputProps): React$1.JSX.Element;
62
+
63
+ type InputIcon = string | ReactNode | ComponentType<{
64
+ className?: string;
65
+ style?: CSSProperties;
66
+ }>;
67
+ declare const TAILWIND_COLORS: readonly ["black", "white", "gray", "slate", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "green", "teal", "blue", "indigo", "purple"];
68
+ type TailwindColor = "muted" | "primary" | "accent" | "success" | "warning" | "destructive" | typeof TAILWIND_COLORS[number];
69
+ interface BaseProps {
70
+ className?: string;
71
+ variant?: "default" | "rounded" | "ghost";
72
+ status?: "default" | "error";
73
+ bordered?: boolean;
74
+ borderColor?: TailwindColor;
75
+ iconColor?: string;
76
+ }
77
+ interface SelectItemType {
78
+ value: string;
79
+ label: string;
80
+ icon?: string | ComponentType<{
81
+ className?: string;
82
+ }>;
83
+ }
84
+ interface TextInputProps extends BaseProps, Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "onChange" | "placeholder" | "type" | "value"> {
85
+ value: string;
86
+ onChange: (value: string) => void;
87
+ placeholder?: string;
88
+ icon?: InputIcon;
89
+ showIcon?: boolean;
90
+ }
91
+ interface NumberInputProps extends BaseProps, Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "onChange" | "placeholder" | "type" | "value"> {
92
+ value: string | number;
93
+ onChange: (value: number) => void;
94
+ placeholder?: string;
95
+ icon?: InputIcon;
96
+ showIcon?: boolean;
97
+ }
98
+ interface PasswordInputProps extends BaseProps, Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "onChange" | "placeholder" | "type" | "value"> {
99
+ value: string;
100
+ onChange: (value: string) => void;
101
+ placeholder?: string;
102
+ icon?: InputIcon;
103
+ showIcon?: boolean;
104
+ }
105
+ interface TextAreaInputProps extends BaseProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "className" | "onChange" | "placeholder" | "value"> {
106
+ value: string;
107
+ onChange: (value: string) => void;
108
+ placeholder?: string;
109
+ rows?: number;
110
+ }
111
+ interface SelectInputProps extends BaseProps {
112
+ value: string;
113
+ onChange: (value: string) => void;
114
+ items: (string | SelectItemType)[];
115
+ placeholder?: string;
116
+ ariaLabel?: string;
117
+ icon?: InputIcon;
118
+ showIcon?: boolean;
119
+ disabled?: boolean;
120
+ /** Class applied to the portalled dropdown surface. */
121
+ dropdownClassName?: string;
122
+ }
123
+ interface ComboboxInputProps extends BaseProps {
124
+ value: string;
125
+ onChange: (value: string) => void;
126
+ items: (string | SelectItemType)[];
127
+ placeholder?: string;
128
+ searchPlaceholder?: string;
129
+ emptyMessage?: string;
130
+ loading?: boolean;
131
+ loadingMessage?: string;
132
+ onSearchChange?: (query: string) => void;
133
+ shouldFilter?: boolean;
134
+ icon?: InputIcon;
135
+ showIcon?: boolean;
136
+ disabled?: boolean;
137
+ allowFreeText?: boolean;
138
+ ariaLabel?: string;
139
+ }
140
+ interface MultiSelectInputProps extends BaseProps {
141
+ value: string[];
142
+ onChange: (value: string[]) => void;
143
+ items: (string | SelectItemType)[];
144
+ ariaLabel?: string;
145
+ placeholder?: string;
146
+ searchPlaceholder?: string;
147
+ emptyMessage?: string;
148
+ icon?: InputIcon;
149
+ showIcon?: boolean;
150
+ disabled?: boolean;
151
+ maxDisplay?: number;
152
+ showSearch?: boolean;
153
+ }
154
+ interface RadioGroupInputProps extends BaseProps {
155
+ value: string;
156
+ onChange: (value: string) => void;
157
+ items: (string | SelectItemType)[];
158
+ layout?: "row" | "column";
159
+ }
160
+ interface SwitchInputProps extends BaseProps {
161
+ value: boolean;
162
+ onChange: (checked: boolean) => void;
163
+ label?: string;
164
+ helper?: string;
165
+ icon?: InputIcon;
166
+ showIcon?: boolean;
167
+ iconPosition?: "label" | "input";
168
+ }
169
+ interface CheckboxInputProps extends BaseProps {
170
+ value: boolean;
171
+ onChange: (checked: boolean) => void;
172
+ label?: string;
173
+ helper?: string;
174
+ checkboxClassName?: string;
175
+ }
176
+ interface CheckboxGroupInputProps extends BaseProps {
177
+ value: string[];
178
+ onChange: (newValue: string[]) => void;
179
+ items: (string | SelectItemType)[];
180
+ layout?: "row" | "column";
181
+ }
182
+ interface FileInputProps extends BaseProps {
183
+ value: File | string | null;
184
+ onChange: (file: File | null) => void;
185
+ placeholder?: string;
186
+ icon?: InputIcon;
187
+ showIcon?: boolean;
188
+ }
189
+ interface DateInputProps extends BaseProps {
190
+ value: Date | undefined;
191
+ onChange: (date: string | undefined) => void;
192
+ placeholder?: string;
193
+ icon?: InputIcon;
194
+ showIcon?: boolean;
195
+ ariaLabel?: string;
196
+ }
197
+ interface StarRatingInputProps extends BaseProps {
198
+ value: number;
199
+ onChange: (starNumber: number | undefined) => void;
200
+ maxStars?: number;
201
+ }
202
+ interface ColorArrayInputProps extends BaseProps {
203
+ value: string;
204
+ onChange: (color: string) => void;
205
+ colors?: string[];
206
+ }
207
+ interface ColorPickerInputProps extends ColorArrayInputProps {
208
+ disabled?: boolean;
209
+ /** `"swatches"` keeps the legacy inline UI. `"popover"` opens a tweakcn-style picker. */
210
+ mode?: "popover" | "swatches";
211
+ /** Which format tabs the popover exposes. */
212
+ formats?: ColorFormat[];
213
+ /** How emitted values are formatted. `"preserve"` keeps the input's own format. */
214
+ output?: ColorFormat | "preserve";
215
+ hideSwatches?: boolean;
216
+ }
217
+ interface TimeInputProps extends BaseProps, Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "onChange" | "placeholder" | "type" | "value"> {
218
+ value?: string;
219
+ onChange: (value: string) => void;
220
+ placeholder?: string;
221
+ icon?: InputIcon;
222
+ showIcon?: boolean;
223
+ format24?: boolean;
224
+ showSeconds?: boolean;
225
+ }
226
+ interface TimeZoneInputProps extends Omit<ComboboxInputProps, "items"> {
227
+ items?: SelectItemType[];
228
+ }
229
+ type ImageInputPreviewSource = "value" | "fallback" | "default";
230
+ interface ImageInputPreviewError {
231
+ source: ImageInputPreviewSource;
232
+ src: string;
233
+ }
234
+ interface ImageInputProps extends BaseProps {
235
+ value: File | string | null;
236
+ onChange: (file: File | null) => void;
237
+ placeholder?: string;
238
+ icon?: InputIcon;
239
+ showIcon?: boolean;
240
+ uploadIcon?: React.ReactNode;
241
+ /** Class applied to the component's outer layout container. */
242
+ containerClassName?: string;
243
+ previewClassName?: string;
244
+ /** Inline styles applied to the preview container. */
245
+ previewStyle?: CSSProperties;
246
+ /** Class applied to the empty and replace-overlay content inside the preview. */
247
+ contentClassName?: string;
248
+ /** Class applied to the preview <img> element to control object-fit / sizing. */
249
+ imageClassName?: string;
250
+ showPreview?: boolean;
251
+ previewPosition?: "top" | "bottom" | "left" | "right";
252
+ allowClear?: boolean;
253
+ accept?: string;
254
+ defaultImage?: string;
255
+ imageSize?: "sm" | "md" | "lg" | "xl";
256
+ imageVersion?: string | number | null;
257
+ title?: string;
258
+ subtitle?: string;
259
+ titleClassName?: string;
260
+ subtitleClassName?: string;
261
+ replaceTitle?: string;
262
+ replaceSubtitle?: string;
263
+ trigger?: "icon" | "button" | "both";
264
+ buttonLabel?: string;
265
+ disabled?: boolean;
266
+ /** Accessible name for the primary preview image. Falls back to `replaceTitle`. */
267
+ previewAlt?: string;
268
+ /** Accessible name for the fallback/default preview image. Falls back to `previewAlt`. */
269
+ fallbackAlt?: string;
270
+ /**
271
+ * URL tried when the primary `value` fails to load.
272
+ * The same URL is never attempted twice, so a failing primary cannot loop.
273
+ */
274
+ fallbackImage?: string | null;
275
+ /**
276
+ * Rendered inside the preview area when every candidate URL has failed.
277
+ * When omitted, a small neutral unavailable state is rendered instead.
278
+ */
279
+ unavailableContent?: React.ReactNode;
280
+ /** Fires once for every URL that failed to load, with its source. */
281
+ onPreviewError?: (error: ImageInputPreviewError) => void;
282
+ /** Accessible name for the replace (re-upload) control. */
283
+ replaceAriaLabel?: string;
284
+ /** Accessible name for the clear control. */
285
+ clearAriaLabel?: string;
286
+ }
287
+ interface OtpInputProps extends BaseProps {
288
+ value: string;
289
+ onChange: (value: string) => void;
290
+ /** Number of one-character cells. */
291
+ length?: number;
292
+ /** Restrict the code to decimal digits. */
293
+ numeric?: boolean;
294
+ ariaLabel?: string;
295
+ digitAriaLabel?: (position: number, length: number) => string;
296
+ autoFocus?: boolean;
297
+ autoComplete?: React.HTMLInputAutoCompleteAttribute;
298
+ disabled?: boolean;
299
+ readOnly?: boolean;
300
+ inputClassName?: string;
301
+ onComplete?: (value: string) => void;
302
+ }
303
+ type AvatarInputRadius = "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
304
+ /** ImageInput options with avatar-specific radius defaults. */
305
+ interface AvatarInputProps extends ImageInputProps {
306
+ /** Preview corner radius. `none` is square and `full` is circular. */
307
+ radius?: AvatarInputRadius;
308
+ /** Exact width and height. Numbers are interpreted as pixels. */
309
+ size?: number | string;
310
+ /** Fill the available width and remaining height of the form item. */
311
+ fill?: boolean;
312
+ }
313
+ interface EmojiInputProps extends BaseProps {
314
+ value: number;
315
+ onChange: (value: number) => void;
316
+ options?: {
317
+ value: number;
318
+ label: string;
319
+ }[];
320
+ }
321
+ interface PhoneInputProps extends BaseProps {
322
+ value: string;
323
+ onChange: (value: string) => void;
324
+ defaultCountry?: string;
325
+ placeholder?: string;
326
+ disabled?: boolean;
327
+ }
328
+ interface LangInputProps extends BaseProps {
329
+ value: string;
330
+ onChange: (value: string) => void;
331
+ items: {
332
+ value: string;
333
+ label: string;
334
+ icon?: string | ComponentType<{
335
+ className?: string;
336
+ }>;
337
+ }[];
338
+ placeholder?: string;
339
+ disabled?: boolean;
340
+ }
341
+
342
+ type FormVariant = "default" | "studio" | "compact";
343
+ interface FormSlotClassNames {
344
+ item?: string;
345
+ label?: string;
346
+ input?: string;
347
+ description?: string;
348
+ error?: string;
349
+ }
350
+ declare const VariantProvider: React__default.FC<{
351
+ variant?: FormVariant;
352
+ bordered?: boolean;
353
+ children: React__default.ReactNode;
354
+ }>;
355
+ declare const useVariant: () => FormVariant;
356
+ declare const useVariantPreset: () => FormSlotClassNames;
357
+
358
+ type FormInputBackground = "card" | "background" | "secondary" | "muted" | "transparent";
359
+ interface BaseFormInputProps {
360
+ name: string;
361
+ formLabel?: string;
362
+ formDescription?: string;
363
+ required?: boolean;
364
+ icon?: NIconSource;
365
+ iconColor?: string;
366
+ items?: any;
367
+ disabled?: boolean;
368
+ readOnly?: boolean;
369
+ hidden?: boolean;
370
+ className?: string;
371
+ /** Semantic surface color for the input control. */
372
+ background?: FormInputBackground;
373
+ classNames?: FormSlotClassNames;
374
+ onChange?: (value: any) => void;
375
+ }
376
+ type FormInputSpecificProps<T> = Omit<T, "value" | "onChange" | keyof BaseFormInputProps>;
377
+ type FormImageInputProps = FormInputSpecificProps<ImageInputProps> & {
378
+ /**
379
+ * Optional controlled preview value.
380
+ * React Hook Form owns the value when omitted.
381
+ */
382
+ value?: ImageInputProps["value"];
383
+ };
384
+ type FormAvatarInputProps = FormInputSpecificProps<AvatarInputProps> & {
385
+ /** Optional controlled preview value. React Hook Form owns it when omitted. */
386
+ value?: AvatarInputProps["value"];
387
+ };
388
+ type InputTypeMap = {
389
+ text: FormInputSpecificProps<TextInputProps>;
390
+ number: FormInputSpecificProps<NumberInputProps>;
391
+ password: FormInputSpecificProps<PasswordInputProps>;
392
+ otp: FormInputSpecificProps<OtpInputProps>;
393
+ textarea: FormInputSpecificProps<TextAreaInputProps>;
394
+ select: FormInputSpecificProps<SelectInputProps>;
395
+ combobox: FormInputSpecificProps<ComboboxInputProps>;
396
+ multiselect: FormInputSpecificProps<MultiSelectInputProps>;
397
+ radio: FormInputSpecificProps<RadioGroupInputProps>;
398
+ switch: FormInputSpecificProps<SwitchInputProps>;
399
+ checkbox: FormInputSpecificProps<CheckboxInputProps>;
400
+ checkboxGroup: FormInputSpecificProps<CheckboxGroupInputProps>;
401
+ file: FormInputSpecificProps<FileInputProps>;
402
+ image: FormImageInputProps;
403
+ avatar: FormAvatarInputProps;
404
+ date: FormInputSpecificProps<DateInputProps>;
405
+ starRating: FormInputSpecificProps<StarRatingInputProps>;
406
+ colorArray: FormInputSpecificProps<ColorArrayInputProps>;
407
+ emoji: FormInputSpecificProps<EmojiInputProps>;
408
+ lang: FormInputSpecificProps<LangInputProps>;
409
+ phone: FormInputSpecificProps<PhoneInputProps>;
410
+ time: FormInputSpecificProps<TimeInputProps>;
411
+ timeZone: FormInputSpecificProps<TimeZoneInputProps>;
412
+ slider: FormInputSpecificProps<SliderInputProps>;
413
+ };
414
+ type FormInputProps = {
415
+ [K in keyof InputTypeMap]: BaseFormInputProps & {
416
+ type: K;
417
+ } & InputTypeMap[K];
418
+ }[keyof InputTypeMap];
419
+ type FormProps<T extends ZodTypeAny = ZodTypeAny> = {
420
+ schema?: T;
421
+ defaultValues?: UseFormProps<TypeOf<T>>["defaultValues"];
422
+ onSubmit: SubmitHandler<TypeOf<T>>;
423
+ form?: UseFormReturn<TypeOf<T>>;
424
+ variant?: FormVariant;
425
+ bordered?: boolean;
426
+ as?: "form" | "div";
427
+ className?: string;
428
+ id?: string;
429
+ devTools?: FormDevTools<T>;
430
+ children: React.ReactNode;
431
+ };
432
+
433
+ interface NCoordinates {
434
+ latitude: number;
435
+ longitude: number;
436
+ }
437
+ interface NLocationValue {
438
+ address: string;
439
+ latitude: number | null;
440
+ longitude: number | null;
441
+ }
442
+ interface NLocationCandidate {
443
+ id: string;
444
+ label: string;
445
+ description?: string;
446
+ coordinates?: NCoordinates;
447
+ providerId?: string;
448
+ }
449
+ interface NLocationSearchContext {
450
+ signal: AbortSignal;
451
+ center: NCoordinates;
452
+ language?: string;
453
+ }
454
+ interface NLocationGeocoderAdapter {
455
+ id: string;
456
+ search(query: string, context: NLocationSearchContext): Promise<readonly NLocationCandidate[]>;
457
+ resolve?(candidate: NLocationCandidate, signal: AbortSignal): Promise<NLocationCandidate>;
458
+ reverse?(coordinates: NCoordinates, signal: AbortSignal): Promise<NLocationCandidate | null>;
459
+ resetSession?(): void;
460
+ }
461
+ interface NLocationMapControls {
462
+ zoomIn(): void;
463
+ zoomOut(): void;
464
+ recenter(coordinates: NCoordinates): void;
465
+ }
466
+ interface NLocationMapProps {
467
+ value: NCoordinates | null;
468
+ initialCenter: NCoordinates;
469
+ initialZoom: number;
470
+ onChange: (coordinates: NCoordinates) => void;
471
+ onReady?: () => void;
472
+ onLoadingChange?: (loading: boolean) => void;
473
+ onError?: (error: Error) => void;
474
+ onControlsReady?: (controls: NLocationMapControls | null) => void;
475
+ reducedMotion?: boolean;
476
+ className?: string;
477
+ }
478
+ interface NLocationMapAdapter {
479
+ id: string;
480
+ Map: ComponentType<NLocationMapProps>;
481
+ }
482
+ interface NLocationLabels {
483
+ dialogTitle: string;
484
+ dialogDescription: string;
485
+ openMap: string;
486
+ close: string;
487
+ cancel: string;
488
+ confirm: string;
489
+ clearPin: string;
490
+ searchPlaceholder: string;
491
+ search: string;
492
+ searching: string;
493
+ searchEmpty: string;
494
+ searchError: string;
495
+ findingAddress: string;
496
+ selected: string;
497
+ notSelected: string;
498
+ changedAfterPin: string;
499
+ loading: string;
500
+ unavailable: string;
501
+ retry: string;
502
+ currentLocation: string;
503
+ zoomIn: string;
504
+ zoomOut: string;
505
+ mapInstructions: string;
506
+ readyAnnouncement: string;
507
+ selectedAnnouncement: string;
508
+ addressUpdatedAnnouncement: string;
509
+ clearedAnnouncement: string;
510
+ geolocationUnsupported: string;
511
+ geolocationDenied: string;
512
+ geolocationTimeout: string;
513
+ geolocationUnavailable: string;
514
+ providerError: string;
515
+ resultsAnnouncement: (count: number) => string;
516
+ }
517
+ interface NLocationClassNames {
518
+ root?: string;
519
+ input?: string;
520
+ status?: string;
521
+ dialog?: string;
522
+ search?: string;
523
+ map?: string;
524
+ footer?: string;
525
+ }
526
+ interface NLocationProviderProps {
527
+ children: ReactNode;
528
+ adapter?: NLocationMapAdapter | null;
529
+ geocoder?: NLocationGeocoderAdapter | null;
530
+ defaultCenter?: NCoordinates;
531
+ defaultZoom?: number;
532
+ labels?: Partial<NLocationLabels>;
533
+ searchMode?: "submit" | "autocomplete";
534
+ unavailableReason?: string;
535
+ }
536
+ interface NLocationDialogProps {
537
+ open: boolean;
538
+ value: NLocationValue;
539
+ onOpenChange: (open: boolean) => void;
540
+ onConfirm: (value: NLocationValue) => void;
541
+ labels?: Partial<NLocationLabels>;
542
+ classNames?: NLocationClassNames;
543
+ }
544
+ interface NLocationInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "className"> {
545
+ value: NLocationValue;
546
+ onChange: (value: NLocationValue) => void;
547
+ labels?: Partial<NLocationLabels>;
548
+ classNames?: NLocationClassNames;
549
+ status?: "default" | "error";
550
+ bordered?: boolean;
551
+ className?: string;
552
+ }
553
+ interface FormLocationInputProps extends Omit<NLocationInputProps, "value" | "onChange" | "status"> {
554
+ name: string;
555
+ formLabel?: ReactNode;
556
+ formDescription?: ReactNode;
557
+ required?: boolean;
558
+ hidden?: boolean;
559
+ background?: FormInputBackground;
560
+ classNames?: NLocationClassNames & FormSlotClassNames;
561
+ onChange?: (value: NLocationValue) => void;
562
+ }
563
+ interface LeafletLocationAdapterOptions {
564
+ tileUrl: string;
565
+ attribution: string;
566
+ tileOptions?: {
567
+ maxZoom?: number;
568
+ minZoom?: number;
569
+ };
570
+ }
571
+ interface GoogleLocationAdapterOptions {
572
+ apiKey: string;
573
+ mapId?: string;
574
+ language?: string;
575
+ region?: string;
576
+ }
577
+
578
+ export { SliderInput as $, type AvatarInputProps as A, type NLocationCandidate as B, type ComboboxInputProps as C, type DateInputProps as D, type EmojiInputProps as E, type FileInputProps as F, type GoogleLocationAdapterOptions as G, type NLocationClassNames as H, type ImageInputProps as I, type NLocationDialogProps as J, type NLocationInputProps as K, type LeafletLocationAdapterOptions as L, type MultiSelectInputProps as M, type NLocationMapAdapter as N, type OtpInputProps as O, type PasswordInputProps as P, type NLocationLabels as Q, type RadioGroupInputProps as R, type SelectInputProps as S, type TailwindColor as T, type NLocationMapProps as U, type NLocationProviderProps as V, type NLocationValue as W, NSlider as X, type NSliderProps as Y, type SelectItemType as Z, Slider as _, type NLocationGeocoderAdapter as a, type SliderInputProps as a0, type SliderOrientation as a1, type SliderProps as a2, type SliderSize as a3, type SliderVariant as a4, VariantProvider as a5, detectFormat as a6, formatColor as a7, parseColor as a8, sliderVariants as a9, toPickerHex as aa, useVariant as ab, useVariantPreset as ac, type NLocationMapControls as ad, type NLocationSearchContext as ae, type TextInputProps as b, type NumberInputProps as c, type TextAreaInputProps as d, type CheckboxInputProps as e, type CheckboxGroupInputProps as f, type SwitchInputProps as g, type StarRatingInputProps as h, type ColorArrayInputProps as i, type ColorPickerInputProps as j, type LangInputProps as k, type PhoneInputProps as l, type TimeInputProps as m, type TimeZoneInputProps as n, type FormProps as o, type FormInputProps as p, type FormVariant as q, type AvatarInputRadius as r, type ColorFormat as s, type FormInputBackground as t, type FormLocationInputProps as u, type FormSlotClassNames as v, type ImageInputPreviewError as w, type ImageInputPreviewSource as x, type InputIcon as y, type NCoordinates as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najm-kit",
3
- "version": "2.11.22",
3
+ "version": "2.12.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Reusable React UI component package for Najm framework",
@@ -69,6 +69,21 @@
69
69
  "types": "./dist/person-images.d.ts",
70
70
  "import": "./dist/person-images.mjs",
71
71
  "default": "./dist/person-images.mjs"
72
+ },
73
+ "./location": {
74
+ "types": "./dist/location/index.d.ts",
75
+ "import": "./dist/location/index.mjs",
76
+ "default": "./dist/location/index.mjs"
77
+ },
78
+ "./location/leaflet": {
79
+ "types": "./dist/location/leaflet.d.ts",
80
+ "import": "./dist/location/leaflet.mjs",
81
+ "default": "./dist/location/leaflet.mjs"
82
+ },
83
+ "./location/google": {
84
+ "types": "./dist/location/google.d.ts",
85
+ "import": "./dist/location/google.mjs",
86
+ "default": "./dist/location/google.mjs"
72
87
  }
73
88
  },
74
89
  "scripts": {
@@ -104,7 +119,9 @@
104
119
  "@codemirror/commands": "^6.10.0",
105
120
  "@codemirror/lang-json": "^6.0.0",
106
121
  "@codemirror/theme-one-dark": "^6.1.0",
107
- "@lezer/highlight": "^1.2.0"
122
+ "@lezer/highlight": "^1.2.0",
123
+ "leaflet": "^1.9.4",
124
+ "@googlemaps/js-api-loader": "^2.1.1"
108
125
  },
109
126
  "peerDependenciesMeta": {
110
127
  "next": {
@@ -139,6 +156,12 @@
139
156
  },
140
157
  "@lezer/highlight": {
141
158
  "optional": true
159
+ },
160
+ "leaflet": {
161
+ "optional": true
162
+ },
163
+ "@googlemaps/js-api-loader": {
164
+ "optional": true
142
165
  }
143
166
  },
144
167
  "dependencies": {
@@ -185,6 +208,7 @@
185
208
  "@codemirror/state": "^6.6.0",
186
209
  "@codemirror/theme-one-dark": "^6.1.0",
187
210
  "@codemirror/view": "^6.42.0",
211
+ "@googlemaps/js-api-loader": "^2.1.1",
188
212
  "@hookform/resolvers": "^5",
189
213
  "@lezer/highlight": "^1.2.0",
190
214
  "@tailwindcss/postcss": "^4",
@@ -192,12 +216,15 @@
192
216
  "@testing-library/react": "^16",
193
217
  "@testing-library/user-event": "^14.6.1",
194
218
  "@types/culori": "^4.0.1",
219
+ "@types/google.maps": "^3.66.2",
220
+ "@types/leaflet": "^1.9.22",
195
221
  "@types/react": "^19",
196
222
  "@types/react-dom": "^19",
197
223
  "@types/react-file-icon": "^1.0.5",
198
224
  "@uiw/react-codemirror": "^4.25.0",
199
225
  "@vitejs/plugin-react": "^5.2.0",
200
226
  "happy-dom": "^20.11.1",
227
+ "leaflet": "^1.9.4",
201
228
  "najm-i18n": "^2.1.2",
202
229
  "postcss": "^8.5.22",
203
230
  "react-hook-form": "^7",