@komensal/ui 0.16.1 → 0.17.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.
@@ -1,649 +0,0 @@
1
- // src/utils/cn.ts
2
- import { clsx } from "clsx";
3
- import { twMerge } from "tailwind-merge";
4
- function cn(...inputs) {
5
- return twMerge(clsx(inputs));
6
- }
7
-
8
- // src/utils/color.ts
9
- function isLightColor(hex) {
10
- const normalized = hex.replace("#", "");
11
- const r = parseInt(normalized.slice(0, 2), 16);
12
- const g = parseInt(normalized.slice(2, 4), 16);
13
- const b = parseInt(normalized.slice(4, 6), 16);
14
- const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
15
- return luminance > 0.6;
16
- }
17
-
18
- // src/utils/format.ts
19
- var DEFAULT_CURRENCY = "COP";
20
- var DEFAULT_LOCALE = "es-CO";
21
- function capitalize(value) {
22
- if (!value) return "";
23
- const trimmed = value.trimStart();
24
- if (trimmed.length === 0) return value;
25
- return trimmed.charAt(0).toLocaleUpperCase("es") + trimmed.slice(1);
26
- }
27
- function formatNumber(value, locale = DEFAULT_LOCALE) {
28
- return new Intl.NumberFormat(locale, { style: "decimal" }).format(value);
29
- }
30
- function formatPrice(value, locale = DEFAULT_LOCALE, currency = DEFAULT_CURRENCY) {
31
- return new Intl.NumberFormat(locale, {
32
- currency,
33
- maximumFractionDigits: 0,
34
- style: "currency"
35
- }).format(value).replace(/\s/g, "");
36
- }
37
-
38
- // src/utils/styles.ts
39
- var focusRing = cn("focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none");
40
- var inputSurface = cn(
41
- "w-full rounded-[10px] px-3 text-base font-normal",
42
- "border-border bg-surface text-foreground border",
43
- "transition-all duration-200 ease-in-out",
44
- "placeholder:text-icon-muted placeholder:text-sm placeholder:leading-none placeholder:font-normal",
45
- "disabled:bg-inactive disabled:text-inactive-text disabled:border-inactive disabled:placeholder:text-inactive-text disabled:cursor-not-allowed"
46
- );
47
- var inputBase = cn("flex h-[50px] items-center justify-between gap-[10px]", inputSurface);
48
- var inputPlaceholder = cn("text-icon-muted text-sm leading-none font-normal");
49
- var inputDisabled = cn("cursor-not-allowed opacity-50");
50
- var inputCompact = cn(
51
- "border-border bg-surface text-foreground focus:border-primary focus:ring-ring h-9 w-full rounded-lg border px-2.5 text-sm focus:ring-2 focus:outline-none"
52
- );
53
- var inputFocus = cn(
54
- "focus:outline-none focus-visible:outline-none",
55
- "focus-visible:ring-ring focus-visible:border-primary focus-visible:ring-2",
56
- "data-[state=open]:ring-ring data-[state=open]:border-primary data-[state=open]:ring-2"
57
- );
58
-
59
- // src/utils/tag-emoji.ts
60
- var TAG_EMOJI_RULES = [
61
- { emoji: "\u{1F336}\uFE0F", keywords: ["picante", "picoso", "spicy"] },
62
- { emoji: "\u{1F95C}", keywords: ["nuez", "nueces", "mani", "cacahuate", "frutos secos"] },
63
- { emoji: "\u{1F331}", keywords: ["vegano", "vegetariano", "vegan"] },
64
- { emoji: "\u{1F33E}", keywords: ["sin gluten", "gluten free"] },
65
- { emoji: "\u{1F95B}", keywords: ["lacteos", "leche", "lactosa"] },
66
- { emoji: "\u{1F990}", keywords: ["marisco", "camaron"] },
67
- { emoji: "\u{1F525}", keywords: ["popular", "top ventas"] },
68
- { emoji: "\u{1F195}", keywords: ["nuevo", "new"] },
69
- { emoji: "\u{1F36C}", keywords: ["dulce"] },
70
- { emoji: "\u{1F9CA}", keywords: ["frio", "helado"] }
71
- ];
72
- function getTagEmoji(tag) {
73
- const normalized = normalize(tag);
74
- const match = TAG_EMOJI_RULES.find((rule) => rule.keywords.some((keyword) => normalized.includes(keyword)));
75
- return match?.emoji ?? null;
76
- }
77
- function normalize(text) {
78
- return text.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
79
- }
80
-
81
- // src/utils/toast-emitter.ts
82
- var emitToast = null;
83
- var toast = {
84
- error(options) {
85
- emit("destructive", options);
86
- },
87
- info(options) {
88
- emit("info", options);
89
- },
90
- success(options) {
91
- emit("success", options);
92
- },
93
- wait(options) {
94
- emit("wait", options);
95
- },
96
- warning(options) {
97
- emit("warning", options);
98
- }
99
- };
100
- function registerToastEmitter(fn) {
101
- emitToast = fn;
102
- }
103
- function emit(type, options) {
104
- if (!emitToast) return;
105
- if (typeof options === "string") {
106
- emitToast(type, { title: options });
107
- } else {
108
- emitToast(type, options);
109
- }
110
- }
111
-
112
- // src/utils/url.ts
113
- function isSafeUrl(url) {
114
- try {
115
- const parsed = new URL(url, "https://placeholder.invalid");
116
- return parsed.protocol === "http:" || parsed.protocol === "https:";
117
- } catch {
118
- return false;
119
- }
120
- }
121
-
122
- // src/utils/z-index.ts
123
- var zPopover = "z-50";
124
- var zDialogOverlay = "z-60";
125
- var zDialogContent = "z-70";
126
- var zPopoverAboveDialog = "z-100";
127
- var zToast = "z-4000";
128
-
129
- // src/components/form-context.ts
130
- import * as React from "react";
131
- import { useFormContext } from "react-hook-form";
132
- var FormFieldContext = React.createContext(null);
133
- var FormItemContext = React.createContext(null);
134
- var getFormItemId = (id) => `${id}-form-item`;
135
- var useFormField = () => {
136
- const fieldContext = React.useContext(FormFieldContext);
137
- const itemContext = React.useContext(FormItemContext);
138
- const { formState, getFieldState } = useFormContext();
139
- if (!fieldContext) {
140
- throw new Error("useFormField must be used within <FormField>");
141
- }
142
- if (!itemContext) {
143
- throw new Error("useFormField must be used within <FormItem>");
144
- }
145
- const fieldState = getFieldState(fieldContext.name, formState);
146
- const { id } = itemContext;
147
- return {
148
- formDescriptionId: `${id}-form-item-description`,
149
- formItemId: getFormItemId(id),
150
- formMessageId: `${id}-form-item-message`,
151
- id,
152
- name: fieldContext.name,
153
- ...fieldState
154
- };
155
- };
156
- var useFormControlProps = () => {
157
- const { error, formItemId, formMessageId } = useFormField();
158
- return {
159
- "aria-describedby": error?.message ? formMessageId : void 0,
160
- "aria-invalid": !!error,
161
- id: formItemId
162
- };
163
- };
164
- var useOptionalFormItemId = () => {
165
- const itemContext = React.useContext(FormItemContext);
166
- return itemContext ? getFormItemId(itemContext.id) : void 0;
167
- };
168
-
169
- // src/components/form.tsx
170
- import { Slot } from "@radix-ui/react-slot";
171
- import * as React2 from "react";
172
- import { Controller, FormProvider } from "react-hook-form";
173
- import { jsx } from "react/jsx-runtime";
174
- var Form = FormProvider;
175
- var FormField = ({
176
- ...props
177
- }) => {
178
- return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
179
- };
180
- var FormItem = React2.forwardRef(
181
- ({ className, ...props }, ref) => {
182
- const id = React2.useId();
183
- return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { className: cn("space-y-1", className), ref, ...props }) });
184
- }
185
- );
186
- FormItem.displayName = "FormItem";
187
- var FormControl = React2.forwardRef(
188
- ({ ...props }, ref) => {
189
- const controlProps = useFormControlProps();
190
- return /* @__PURE__ */ jsx(Slot, { ...controlProps, ref, ...props });
191
- }
192
- );
193
- FormControl.displayName = "FormControl";
194
- var FormMessage = React2.forwardRef(
195
- ({ children, className, ...props }, ref) => {
196
- const { error, formMessageId } = useFormField();
197
- const body = error?.message ? String(error.message) : children;
198
- if (!body) {
199
- return null;
200
- }
201
- return /* @__PURE__ */ jsx("p", { className: cn("text-destructive text-xs font-medium", className), id: formMessageId, ref, ...props, children: body });
202
- }
203
- );
204
- FormMessage.displayName = "FormMessage";
205
-
206
- // src/components/label.tsx
207
- import * as LabelPrimitive from "@radix-ui/react-label";
208
- import { cva } from "class-variance-authority";
209
- import * as React3 from "react";
210
- import { jsx as jsx2 } from "react/jsx-runtime";
211
- var labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
212
- var Label = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(LabelPrimitive.Root, { className: cn(labelVariants(), className), ref, ...props }));
213
- Label.displayName = LabelPrimitive.Root.displayName;
214
-
215
- // src/components/form-fields/label-field.tsx
216
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
217
- var LabelField = ({ htmlFor, label, labelClassName, name, visualRequired }) => {
218
- const formItemId = useOptionalFormItemId();
219
- return /* @__PURE__ */ jsxs(
220
- Label,
221
- {
222
- className: cn("text-body mb-2 text-start text-sm leading-none font-normal tracking-normal", labelClassName),
223
- htmlFor: htmlFor ?? formItemId ?? name,
224
- children: [
225
- /* @__PURE__ */ jsx3("span", { children: label }),
226
- " ",
227
- visualRequired && /* @__PURE__ */ jsx3("span", { className: "text-destructive", children: " *" })
228
- ]
229
- }
230
- );
231
- };
232
-
233
- // src/components/google-map-picker.tsx
234
- import { AdvancedMarker, APIProvider, Map } from "@vis.gl/react-google-maps";
235
- import { useId as useId2 } from "react";
236
-
237
- // src/components/use-google-map-picker.ts
238
- import { useMap, useMapsLibrary } from "@vis.gl/react-google-maps";
239
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
240
- var PICKER_MAP_ID = "komensal-restaurant-map";
241
- var SELECTED_ZOOM = 15;
242
- var CITY_ZOOM = 12;
243
- var DEBOUNCE_MS = 300;
244
- var BLUR_CLOSE_DELAY_MS = 150;
245
- var parseComponents = (components) => {
246
- const find = (type) => components.find((c) => c.types.includes(type));
247
- const country = find("country");
248
- const department = find("administrative_area_level_1");
249
- const city = find("locality") ?? find("administrative_area_level_2");
250
- return {
251
- city: city?.long ?? null,
252
- country: country?.short ?? null,
253
- countryName: country?.long ?? null,
254
- department: department?.long ?? null
255
- };
256
- };
257
- function useGoogleMapPicker({
258
- centerOn,
259
- countryCode,
260
- disabled,
261
- initialPosition,
262
- locationQuery,
263
- locationZoom,
264
- onAddressResolved,
265
- onChange,
266
- onError,
267
- value
268
- }) {
269
- const placesLib = useMapsLibrary("places");
270
- const geocodingLib = useMapsLibrary("geocoding");
271
- const map = useMap(PICKER_MAP_ID);
272
- const onChangeRef = useRef(onChange);
273
- const onResolvedRef = useRef(onAddressResolved);
274
- const onErrorRef = useRef(onError);
275
- const geocoder = useMemo(
276
- () => geocodingLib ? new geocodingLib.Geocoder() : null,
277
- [geocodingLib]
278
- );
279
- const debounceRef = useRef(null);
280
- const blurTimeoutRef = useRef(null);
281
- const [inputValue, setInputValue] = useState(value);
282
- const [suggestions, setSuggestions] = useState([]);
283
- const [showDropdown, setShowDropdown] = useState(false);
284
- const [sessionToken, setSessionToken] = useState();
285
- const [position, setPosition] = useState(initialPosition ?? null);
286
- useEffect(() => {
287
- onChangeRef.current = onChange;
288
- onResolvedRef.current = onAddressResolved;
289
- onErrorRef.current = onError;
290
- });
291
- useEffect(
292
- () => () => {
293
- if (debounceRef.current) clearTimeout(debounceRef.current);
294
- if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
295
- },
296
- []
297
- );
298
- const [prevValue, setPrevValue] = useState(value);
299
- if (prevValue !== value) {
300
- setPrevValue(value);
301
- setInputValue(value);
302
- }
303
- useEffect(() => {
304
- if (map && centerOn) {
305
- map.panTo(centerOn);
306
- map.setZoom(CITY_ZOOM);
307
- }
308
- }, [map, centerOn]);
309
- useEffect(() => {
310
- if (map && position) {
311
- map.panTo(position);
312
- map.setZoom(SELECTED_ZOOM);
313
- }
314
- }, [map, position]);
315
- const [prevPlacesLib, setPrevPlacesLib] = useState(placesLib);
316
- if (prevPlacesLib !== placesLib) {
317
- setPrevPlacesLib(placesLib);
318
- if (placesLib) setSessionToken(new placesLib.AutocompleteSessionToken());
319
- }
320
- useEffect(() => {
321
- if (!geocoder || !locationQuery || !map || position) return;
322
- const g = geocoder;
323
- const ctrl = { cancelled: false };
324
- void (async () => {
325
- try {
326
- const { results } = await g.geocode({ address: locationQuery });
327
- if (ctrl.cancelled || results.length === 0) return;
328
- const loc = results[0].geometry.location;
329
- map.panTo({ lat: loc.lat(), lng: loc.lng() });
330
- map.setZoom(locationZoom ?? CITY_ZOOM);
331
- } catch (error) {
332
- if (!ctrl.cancelled) {
333
- console.error("[GoogleMapPicker] geocode by query failed", error);
334
- onErrorRef.current?.(error);
335
- }
336
- }
337
- })();
338
- return () => {
339
- ctrl.cancelled = true;
340
- };
341
- }, [geocoder, locationQuery, locationZoom, map, position]);
342
- const fetchSuggestions = useCallback(
343
- async (input) => {
344
- if (!placesLib || input.length < 2) {
345
- setSuggestions([]);
346
- return;
347
- }
348
- try {
349
- const result = await placesLib.AutocompleteSuggestion.fetchAutocompleteSuggestions({
350
- includedRegionCodes: countryCode ? [countryCode.trim().toLowerCase()] : void 0,
351
- input,
352
- sessionToken
353
- });
354
- setSuggestions(result.suggestions);
355
- setShowDropdown(true);
356
- } catch (error) {
357
- console.error("[GoogleMapPicker] fetchAutocompleteSuggestions failed", error);
358
- onErrorRef.current?.(error);
359
- setSuggestions([]);
360
- }
361
- },
362
- [placesLib, sessionToken, countryCode]
363
- );
364
- const reverseGeocode = useCallback(
365
- async (latLng) => {
366
- if (!geocoder) return;
367
- try {
368
- const { results } = await geocoder.geocode({ location: latLng });
369
- if (results.length > 0) {
370
- const result = results[0];
371
- const address = result.formatted_address;
372
- setInputValue(address);
373
- onChangeRef.current(address);
374
- const parts = parseComponents(
375
- result.address_components.map((c) => ({ long: c.long_name, short: c.short_name, types: c.types }))
376
- );
377
- onResolvedRef.current?.({ address, lat: latLng.lat, lng: latLng.lng, ...parts });
378
- }
379
- } catch (error) {
380
- console.error("[GoogleMapPicker] reverse geocode failed", error);
381
- onErrorRef.current?.(error);
382
- }
383
- },
384
- [geocoder]
385
- );
386
- const handleInputChange = (e) => {
387
- const val = e.target.value;
388
- setInputValue(val);
389
- onChangeRef.current(val);
390
- if (debounceRef.current) clearTimeout(debounceRef.current);
391
- debounceRef.current = setTimeout(() => void fetchSuggestions(val), DEBOUNCE_MS);
392
- };
393
- const handleSelect = async (suggestion) => {
394
- const prediction = suggestion.placePrediction;
395
- if (!prediction) return;
396
- const place = prediction.toPlace();
397
- await place.fetchFields({ fields: ["formattedAddress", "location", "addressComponents"] });
398
- const address = place.formattedAddress ?? prediction.text.text;
399
- setInputValue(address);
400
- onChangeRef.current(address);
401
- setSuggestions([]);
402
- setShowDropdown(false);
403
- const lat = place.location?.lat() ?? null;
404
- const lng = place.location?.lng() ?? null;
405
- if (place.location) {
406
- setPosition({ lat: place.location.lat(), lng: place.location.lng() });
407
- }
408
- const parts = parseComponents(
409
- (place.addressComponents ?? []).map((c) => ({ long: c.longText, short: c.shortText, types: c.types }))
410
- );
411
- onResolvedRef.current?.({ address, lat, lng, ...parts });
412
- if (placesLib) setSessionToken(new placesLib.AutocompleteSessionToken());
413
- };
414
- const handleBlur = () => {
415
- if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
416
- blurTimeoutRef.current = setTimeout(() => setShowDropdown(false), BLUR_CLOSE_DELAY_MS);
417
- };
418
- const handleMapClick = useCallback(
419
- (e) => {
420
- if (disabled || !e.detail.latLng) return;
421
- const latLng = e.detail.latLng;
422
- setPosition(latLng);
423
- void reverseGeocode(latLng);
424
- },
425
- [disabled, reverseGeocode]
426
- );
427
- const handleMarkerDragEnd = useCallback(
428
- (e) => {
429
- const latLng = e.latLng;
430
- if (!latLng) return;
431
- const pos = { lat: latLng.lat(), lng: latLng.lng() };
432
- setPosition(pos);
433
- void reverseGeocode(pos);
434
- },
435
- [reverseGeocode]
436
- );
437
- return {
438
- handleBlur,
439
- handleInputChange,
440
- handleMapClick,
441
- handleMarkerDragEnd,
442
- handleSelect,
443
- inputValue,
444
- position,
445
- setShowDropdown,
446
- showDropdown,
447
- suggestions
448
- };
449
- }
450
-
451
- // src/components/google-map-picker.tsx
452
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
453
- var DEFAULT_CENTER = { lat: 4.711, lng: -74.0721 };
454
- var MapPickerContent = (props) => {
455
- const {
456
- "aria-describedby": ariaDescribedBy,
457
- "aria-invalid": ariaInvalid,
458
- "aria-label": ariaLabel,
459
- "aria-labelledby": ariaLabelledBy,
460
- disabled,
461
- hasError,
462
- id,
463
- mapId,
464
- placeholder
465
- } = props;
466
- const listboxId = useId2();
467
- const {
468
- handleBlur,
469
- handleInputChange,
470
- handleMapClick,
471
- handleMarkerDragEnd,
472
- handleSelect,
473
- inputValue,
474
- position,
475
- setShowDropdown,
476
- showDropdown,
477
- suggestions
478
- } = useGoogleMapPicker(props);
479
- const isExpanded = showDropdown && suggestions.length > 0;
480
- return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-3", children: [
481
- /* @__PURE__ */ jsxs2("div", { className: "relative", children: [
482
- /* @__PURE__ */ jsx4(
483
- "input",
484
- {
485
- "aria-autocomplete": "list",
486
- "aria-controls": isExpanded ? listboxId : void 0,
487
- "aria-describedby": ariaDescribedBy,
488
- "aria-expanded": isExpanded,
489
- "aria-invalid": ariaInvalid ?? (hasError ? true : void 0),
490
- "aria-label": ariaLabel,
491
- "aria-labelledby": ariaLabelledBy,
492
- className: cn(inputBase, inputFocus, hasError && "border-destructive"),
493
- disabled,
494
- id,
495
- onBlur: handleBlur,
496
- onChange: handleInputChange,
497
- onFocus: () => suggestions.length > 0 && setShowDropdown(true),
498
- placeholder,
499
- role: "combobox",
500
- type: "text",
501
- value: inputValue
502
- }
503
- ),
504
- isExpanded && /* @__PURE__ */ jsx4(
505
- "ul",
506
- {
507
- className: cn(
508
- "border-border bg-surface absolute mt-1 w-full overflow-hidden rounded-[10px] border shadow-md",
509
- zPopover
510
- ),
511
- id: listboxId,
512
- role: "listbox",
513
- children: suggestions.map((suggestion) => /* @__PURE__ */ jsx4("li", { role: "none", children: /* @__PURE__ */ jsx4(
514
- "button",
515
- {
516
- "aria-selected": false,
517
- className: cn(
518
- "text-foreground hover:bg-hover w-full px-4 py-3 text-left text-sm transition-colors focus-visible:ring-inset",
519
- focusRing
520
- ),
521
- onClick: () => void handleSelect(suggestion),
522
- role: "option",
523
- type: "button",
524
- children: suggestion.placePrediction?.text.text ?? ""
525
- }
526
- ) }, suggestion.placePrediction?.placeId ?? suggestion.placePrediction?.text.text))
527
- }
528
- )
529
- ] }),
530
- /* @__PURE__ */ jsx4("div", { className: "border-border h-59 overflow-hidden rounded-[10px] border md:h-87.5", children: /* @__PURE__ */ jsx4(
531
- Map,
532
- {
533
- defaultCenter: DEFAULT_CENTER,
534
- defaultZoom: 5,
535
- disableDefaultUI: true,
536
- gestureHandling: "cooperative",
537
- id: PICKER_MAP_ID,
538
- mapId: mapId ?? import.meta.env.VITE_GOOGLE_MAPS_MAP_ID ?? "DEMO_MAP_ID",
539
- onClick: handleMapClick,
540
- style: { height: "100%", width: "100%" },
541
- children: position && /* @__PURE__ */ jsx4(AdvancedMarker, { draggable: !disabled, onDragEnd: handleMarkerDragEnd, position })
542
- }
543
- ) })
544
- ] });
545
- };
546
- var GoogleMapPicker = (props) => /* @__PURE__ */ jsx4(APIProvider, { apiKey: props.apiKey ?? import.meta.env.VITE_GOOGLE_MAPS_API_KEY ?? "", language: "es", region: "CO", children: /* @__PURE__ */ jsx4(MapPickerContent, { ...props }) });
547
-
548
- // src/components/form-fields/form-field-shell.tsx
549
- import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
550
- var FieldControl = ({ children }) => {
551
- const controlProps = useFormControlProps();
552
- return /* @__PURE__ */ jsx5(Fragment, { children: children(controlProps) });
553
- };
554
- var FormFieldShell = ({
555
- children,
556
- hasError,
557
- label,
558
- labelClassName,
559
- mainClassName,
560
- name,
561
- visualRequired
562
- }) => /* @__PURE__ */ jsxs3(FormItem, { className: cn("flex flex-col", mainClassName), children: [
563
- /* @__PURE__ */ jsx5(
564
- LabelField,
565
- {
566
- label,
567
- labelClassName: cn(labelClassName, hasError && "text-destructive"),
568
- name,
569
- visualRequired
570
- }
571
- ),
572
- /* @__PURE__ */ jsx5(FieldControl, { children }),
573
- /* @__PURE__ */ jsx5(FormMessage, {})
574
- ] });
575
-
576
- // src/components/form-fields/map-picker-field.tsx
577
- import { jsx as jsx6 } from "react/jsx-runtime";
578
- var MapPickerField = ({
579
- control,
580
- label,
581
- labelClassName,
582
- mainClassName,
583
- name,
584
- visualRequired,
585
- ...pickerProps
586
- }) => /* @__PURE__ */ jsx6(
587
- FormField,
588
- {
589
- control,
590
- name,
591
- render: ({ field, fieldState }) => /* @__PURE__ */ jsx6(
592
- FormFieldShell,
593
- {
594
- hasError: !!fieldState.error,
595
- label,
596
- labelClassName,
597
- mainClassName,
598
- name,
599
- visualRequired,
600
- children: (controlProps) => /* @__PURE__ */ jsx6(
601
- GoogleMapPicker,
602
- {
603
- ...pickerProps,
604
- ...controlProps,
605
- hasError: !!fieldState.error,
606
- onChange: field.onChange,
607
- value: field.value ?? ""
608
- }
609
- )
610
- }
611
- )
612
- }
613
- );
614
-
615
- export {
616
- cn,
617
- isLightColor,
618
- capitalize,
619
- formatNumber,
620
- formatPrice,
621
- focusRing,
622
- inputSurface,
623
- inputBase,
624
- inputPlaceholder,
625
- inputDisabled,
626
- inputCompact,
627
- inputFocus,
628
- getTagEmoji,
629
- toast,
630
- registerToastEmitter,
631
- isSafeUrl,
632
- zPopover,
633
- zDialogOverlay,
634
- zDialogContent,
635
- zPopoverAboveDialog,
636
- zToast,
637
- useFormField,
638
- Form,
639
- FormField,
640
- FormItem,
641
- FormControl,
642
- FormMessage,
643
- Label,
644
- LabelField,
645
- FormFieldShell,
646
- GoogleMapPicker,
647
- MapPickerField
648
- };
649
- //# sourceMappingURL=chunk-5VBG6IKL.js.map