@sfperusacdev/sf-ui 0.2.4 → 0.2.6

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 (42) hide show
  1. package/dist/sf-ui.css +1 -1
  2. package/dist/sf-ui.js +2934 -1874
  3. package/dist/sf-ui.js.map +1 -1
  4. package/dist/sf-ui.umd.cjs +8 -8
  5. package/dist/sf-ui.umd.cjs.map +1 -1
  6. package/dist/theme/dark.css +1 -0
  7. package/dist/theme/sf-tokens.css +4 -0
  8. package/dist/types/src/adapters/maps/google/google.test.d.ts +1 -0
  9. package/dist/types/src/adapters/maps/google/index.d.ts +24 -1
  10. package/dist/types/src/components/dashboard/CardNote.d.ts +13 -0
  11. package/dist/types/src/components/dashboard/DashboardBoard.d.ts +37 -0
  12. package/dist/types/src/components/dashboard/DashboardBoard.test.d.ts +1 -0
  13. package/dist/types/src/components/dashboard/DashboardCard.d.ts +10 -2
  14. package/dist/types/src/components/dashboard/DashboardPageFrame.d.ts +43 -0
  15. package/dist/types/src/components/dashboard/DashboardPageFrame.test.d.ts +1 -0
  16. package/dist/types/src/components/dashboard/DashboardPlaceholder.d.ts +18 -0
  17. package/dist/types/src/components/dashboard/DetailPanel.d.ts +38 -0
  18. package/dist/types/src/components/dashboard/DetailPanel.test.d.ts +1 -0
  19. package/dist/types/src/components/dashboard/DrilldownCards.d.ts +68 -0
  20. package/dist/types/src/components/dashboard/detailTypes.d.ts +31 -0
  21. package/dist/types/src/components/dashboard/index.d.ts +12 -0
  22. package/dist/types/src/components/inputs/AsyncSearchSelect.d.ts +4 -1
  23. package/dist/types/src/components/inputs/FieldLeadingIcon.d.ts +6 -0
  24. package/dist/types/src/components/inputs/Input.d.ts +8 -1
  25. package/dist/types/src/components/inputs/SearchSelect.d.ts +4 -1
  26. package/dist/types/src/components/inputs/fieldClassName.d.ts +3 -1
  27. package/dist/types/src/components/maps/base/MapPointCard.d.ts +22 -0
  28. package/dist/types/src/components/maps/base/MapPointCard.test.d.ts +1 -0
  29. package/dist/types/src/components/maps/base/index.d.ts +2 -0
  30. package/dist/types/src/components/maps/forms/AddressSearchInput.test.d.ts +1 -0
  31. package/dist/types/src/components/maps/renderers/geometria.d.ts +5 -0
  32. package/dist/types/src/components/maps/renderers/google/GoogleMapRenderer.d.ts +1 -1
  33. package/dist/types/src/components/maps/renderers/leaflet/LeafletMapRenderer.d.ts +1 -1
  34. package/dist/types/src/components/maps/views/MapView.d.ts +20 -3
  35. package/dist/types/src/components/maps/views/MapView.test.d.ts +1 -0
  36. package/dist/types/src/constants/maps/index.d.ts +3 -0
  37. package/dist/types/src/contracts/maps/index.d.ts +2 -0
  38. package/dist/types/src/hooks/maps/index.d.ts +1 -0
  39. package/dist/types/src/hooks/maps/useReverseGeocode.d.ts +14 -0
  40. package/dist/types/src/services/maps/googleMapsLoader.d.ts +20 -0
  41. package/dist/types/src/types/maps/index.d.ts +61 -0
  42. package/package.json +1 -1
@@ -8,11 +8,19 @@ export type GoogleMapInstance = {
8
8
  lng: number;
9
9
  }) => void;
10
10
  setZoom?: (zoom: number) => void;
11
+ setMapTypeId?: (mapTypeId: string) => void;
12
+ getCenter?: () => {
13
+ lat: () => number;
14
+ lng: () => number;
15
+ } | undefined;
16
+ getZoom?: () => number | undefined;
11
17
  addListener?: (eventName: string, handler: (event: {
12
18
  latLng?: {
13
19
  lat: () => number;
14
20
  lng: () => number;
15
21
  };
22
+ placeId?: string;
23
+ stop?: () => void;
16
24
  }) => void) => GoogleMapsListener;
17
25
  };
18
26
  type GoogleMapsNamespace = {
@@ -56,9 +64,21 @@ type GoogleMapsNamespace = {
56
64
  lng: number;
57
65
  }[]) => void;
58
66
  };
67
+ Circle?: new (options: Record<string, unknown>) => {
68
+ setMap?: (map: unknown | null) => void;
69
+ setOptions?: (options: Record<string, unknown>) => void;
70
+ };
71
+ Point?: new (x: number, y: number) => unknown;
72
+ Size?: new (width: number, height: number) => unknown;
59
73
  event?: {
60
74
  clearInstanceListeners: (instance: unknown) => void;
61
75
  };
76
+ places?: {
77
+ PlacesService?: new (container: HTMLElement) => {
78
+ getDetails: (request: Record<string, unknown>, callback: (result: unknown | null, status: string) => void) => void;
79
+ };
80
+ };
81
+ importLibrary?: (name: string) => Promise<unknown>;
62
82
  };
63
83
  };
64
84
  export declare const getGoogleMapsNamespace: () => GoogleMapsNamespace | undefined;
@@ -7,18 +7,61 @@ export type SfLatLng = {
7
7
  lat: number;
8
8
  lng: number;
9
9
  };
10
+ /** Capa base del mapa: calles (`roadmap`) o imagen satelital. */
11
+ export type SfMapType = "roadmap" | "satellite";
12
+ /** Encuadre del mapa. Con `view` el mapa es controlado: sigue este encuadre y avisa con `onViewChange`. */
13
+ export type SfMapView = {
14
+ center: SfLatLng;
15
+ zoom: number;
16
+ };
17
+ /** Círculo en metros reales (geocercas). `label` se pinta fijo junto al borde. */
18
+ export type SfMapCircle = {
19
+ id: string;
20
+ center: SfLatLng;
21
+ radiusM: number;
22
+ color?: string;
23
+ fillColor?: string;
24
+ dashed?: boolean;
25
+ label?: string;
26
+ };
10
27
  export type SfBounds = {
11
28
  north: number;
12
29
  south: number;
13
30
  east: number;
14
31
  west: number;
15
32
  };
33
+ /** Partes de una dirección, con los nombres de la división política del Perú. */
34
+ export type SfAddressParts = {
35
+ /** Vía: "Jirón Independencia", "Av. Larco". */
36
+ street?: string;
37
+ /** Número o cuadra: "179", "cuadra 4". */
38
+ number?: string;
39
+ /** Vía y número, listo para un campo Dirección. */
40
+ line?: string;
41
+ /**
42
+ * Metros entre el punto consultado y la dirección de `line` (geocodificación inversa). Google da la dirección con
43
+ * número más cercana que conoce: en calles sin numeración puede estar a una cuadra. Sin valor = no se sabe.
44
+ */
45
+ lineDistanceM?: number;
46
+ /** Urbanización, barrio o sector. */
47
+ neighborhood?: string;
48
+ /** Ciudad o localidad como se escribe en una dirección ("Chepén"); el distrito puede venir sin tildes ("Chepen"). */
49
+ locality?: string;
50
+ district?: string;
51
+ province?: string;
52
+ department?: string;
53
+ country?: string;
54
+ postalCode?: string;
55
+ };
16
56
  export type SfPlace = {
17
57
  id: string;
18
58
  label: string;
19
59
  address?: string;
20
60
  location: SfLatLng;
21
61
  provider?: string;
62
+ /** Nombre del lugar (comercio, colegio, plaza) cuando el punto es uno. */
63
+ name?: string;
64
+ parts?: SfAddressParts;
22
65
  raw?: unknown;
23
66
  };
24
67
  export type SfAddress = SfPlace;
@@ -71,6 +114,15 @@ export type SfMapMarker = {
71
114
  export type SfMapMarkerOptions = {
72
115
  draggable?: boolean;
73
116
  selectable?: boolean;
117
+ /**
118
+ * `dot` (punto, el de siempre), `pin` (marcador de ubicación) o `badge` (círculo del color `color`, con `text`
119
+ * adentro si lo hay: p. ej. el orden de una parada; sin texto es un punto pequeño).
120
+ */
121
+ variant?: "dot" | "pin" | "badge";
122
+ /** Texto dentro del marcador `badge` (1–3 caracteres). */
123
+ text?: string;
124
+ /** Muestra `label` fijo sobre el marcador. */
125
+ showLabel?: boolean;
74
126
  };
75
127
  export type SfMapShape = {
76
128
  id: string;
@@ -81,6 +133,8 @@ export type SfMapShape = {
81
133
  };
82
134
  export type SfMapClickEvent = {
83
135
  location: SfLatLng;
136
+ /** Lugar del mapa base que se pulsó (comercio, colegio…). Solo lo informa el motor Google. */
137
+ placeId?: string;
84
138
  };
85
139
  export type SfMarkerClickEvent = {
86
140
  marker: SfMapMarker;
@@ -143,6 +197,13 @@ export type SfMapRendererProps = {
143
197
  markers?: SfMapMarker[];
144
198
  routes?: SfMapShape[];
145
199
  areas?: SfMapShape[];
200
+ circles?: SfMapCircle[];
201
+ mapType?: SfMapType;
202
+ /** Encuadre controlado. Sin `view`, `center`/`zoom` solo valen al montar (no recentra al mover puntos). */
203
+ view?: SfMapView;
204
+ onViewChange?: (view: SfMapView) => void;
205
+ /** Control de zoom propio del motor. `MapView` lo apaga cuando pinta sus propios controles. */
206
+ zoomControl?: boolean;
146
207
  height?: number | string;
147
208
  className?: string;
148
209
  readOnly?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfperusacdev/sf-ui",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "SF UI — librería de componentes React (inputs, tablas, hooks) para aplicaciones SF Perú.",
5
5
  "type": "module",
6
6
  "main": "./dist/sf-ui.umd.cjs",