@arquimedes.co/eureka-forms 3.0.57-new-steps → 3.0.59-new-steps

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,22 +1,28 @@
1
1
  .input {
2
2
  width: 100%;
3
3
  box-sizing: border-box;
4
- height: 40px;
4
+ height: 31px;
5
5
  padding: 6px 12px;
6
6
  font-size: 1rem;
7
- color: var(--eureka-text, #333);
7
+ font-family: inherit;
8
+ color: var(--eureka-text, #293241);
8
9
  background-color: var(--eureka-bg, #fff);
9
- border: 1px solid var(--eureka-outline, #ccc);
10
+ border: 1px solid var(--eureka-outline, #b8b8b8);
10
11
  border-radius: 10px;
11
12
  outline: none;
12
13
  }
13
14
 
14
- .input:hover:not(:disabled) {
15
- border-color: var(--eureka-primary, #1976d2);
15
+ .input::placeholder {
16
+ color: var(--eureka-text, #293241);
17
+ opacity: 0.5;
18
+ }
19
+
20
+ .input:hover:not(:disabled):not(:read-only) {
21
+ border-color: var(--eureka-primary, #3d5a7f);
16
22
  }
17
23
 
18
- .input:focus {
19
- border-color: var(--eureka-primary, #1976d2);
24
+ .input:focus:not(:read-only) {
25
+ border-color: var(--eureka-primary, #3d5a7f);
20
26
  border-width: 2px;
21
27
  padding: 5px 11px;
22
28
  }
@@ -40,7 +46,7 @@
40
46
  overflow-y: auto;
41
47
  padding: 4px;
42
48
  background-color: var(--eureka-bg, #fff);
43
- border: 1px solid var(--eureka-outline, #ccc);
49
+ border: 1px solid var(--eureka-outline, #b8b8b8);
44
50
  border-radius: 10px;
45
51
  box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
46
52
  }
@@ -68,7 +74,7 @@
68
74
 
69
75
  .item[data-highlighted],
70
76
  .item:hover {
71
- background-color: var(--eureka-primary, #1976d2);
77
+ background-color: var(--eureka-primary, #3d5a7f);
72
78
  color: #fff;
73
79
  }
74
80
 
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export interface ErkIconButtonProps {
3
+ /** Tooltip y nombre accesible del botón. */
4
+ title: string;
5
+ onClick?: () => void;
6
+ disabled?: boolean;
7
+ /** Muestra un spinner en lugar del icono (y deshabilita el botón). */
8
+ loading?: boolean;
9
+ children: React.ReactNode;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * Botón de icono de la casa: cuadrado redondeado con la misma altura y borde
14
+ * que los inputs del form (theming vía variables --eureka-*), con tooltip.
15
+ */
16
+ declare function ErkIconButton({ title, onClick, disabled, loading, children, className }: ErkIconButtonProps): JSX.Element;
17
+ export default ErkIconButton;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CircularProgress, Tooltip } from '@mui/material';
3
+ import styles from './ErkIconButton.module.css';
4
+ /**
5
+ * Botón de icono de la casa: cuadrado redondeado con la misma altura y borde
6
+ * que los inputs del form (theming vía variables --eureka-*), con tooltip.
7
+ */
8
+ function ErkIconButton({ title, onClick, disabled = false, loading = false, children, className }) {
9
+ return (_jsx(Tooltip, { title: title, children: _jsx("span", { className: styles.wrap, children: _jsx("button", { type: "button", "aria-label": title, disabled: disabled || loading, className: className ? `${styles.button} ${className}` : styles.button, onClick: onClick, children: loading ? _jsx(CircularProgress, { size: 16 }) : children }) }) }));
10
+ }
11
+ export default ErkIconButton;
@@ -0,0 +1,41 @@
1
+ .wrap {
2
+ display: inline-flex;
3
+ flex-shrink: 0;
4
+ }
5
+
6
+ /* Mismo alto, radio y borde que los inputs del form (ErkTextField small) */
7
+ .button {
8
+ height: 31px;
9
+ width: 31px;
10
+ box-sizing: border-box;
11
+ border: 1px solid var(--eureka-outline, #b8b8b8);
12
+ border-radius: 10px;
13
+ background-color: var(--eureka-bg, #fff);
14
+ color: var(--eureka-text, #293241);
15
+ display: grid;
16
+ place-items: center;
17
+ padding: 0;
18
+ cursor: pointer;
19
+ transition: all 0.2s ease-in-out;
20
+ }
21
+
22
+ .button svg {
23
+ width: 18px;
24
+ height: 18px;
25
+ }
26
+
27
+ .button:hover:not(:disabled) {
28
+ background-color: rgba(0, 0, 0, 0.04);
29
+ border-color: var(--eureka-primary, #3d5a7f);
30
+ color: var(--eureka-primary, #3d5a7f);
31
+ }
32
+
33
+ .button:focus-visible {
34
+ outline: 2px solid var(--eureka-primary, #3d5a7f);
35
+ outline-offset: 1px;
36
+ }
37
+
38
+ .button:disabled {
39
+ opacity: 0.5;
40
+ cursor: default;
41
+ }
@@ -1,12 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useState } from 'react';
3
- import { CircularProgress, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Tooltip } from '@mui/material';
3
+ import { Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material';
4
4
  import { AddressFieldMode, LocationInputMode, } from '../../@Types/LocationFormStep';
5
5
  import ErkAddressAutocomplete from '../ErkAddressAutocomplete/ErkAddressAutocomplete';
6
6
  import { reverseGeocode } from '../ErkAddressAutocomplete/googlePlaces';
7
7
  import { applyAddressFields, fieldConfig } from './addressFields';
8
8
  import ErkTextField from '../ErkTextField/ErkTextField';
9
9
  import ErkButton from '../ErkButton/ErkButton';
10
+ import ErkIconButton from '../ErkIconButton/ErkIconButton';
10
11
  import LocationIcon from '../../Icons/LocationIcon';
11
12
  import EditIcon from '../../Icons/EditIcon';
12
13
  import CloseIcon from '../../Icons/CloseIcon';
@@ -120,6 +121,8 @@ function ErkLocationField({ value, onChange, allowedModes, addressFields, region
120
121
  if (readOnly) {
121
122
  return (_jsx("div", { className: styles.readOnlyContainer, children: _jsxs("div", { className: styles.readOnlyCard, children: [_jsx("div", { className: styles.readOnlyIcon, children: _jsx(LocationIcon, { fill: "var(--eureka-primary)" }) }), _jsxs("div", { className: styles.readOnlyDetails, children: [value?.name && _jsx("span", { className: styles.readOnlyName, children: value.name }), _jsx("span", { className: styles.readOnlyAddress, children: value?.address ?? 'Ubicación no proporcionada' }), value?.latitude !== undefined && value?.longitude !== undefined && (_jsxs("span", { className: styles.readOnlyCoords, children: ["Coordenadas: ", value.latitude.toFixed(6), ", ", value.longitude.toFixed(6)] }))] })] }) }));
122
123
  }
123
- return (_jsxs("div", { className: styles.container, children: [_jsx("div", { className: styles.inputRow, children: value?.address ? (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.grow, children: _jsx(ErkTextField, { label: "Ubicaci\u00F3n seleccionada", value: value.address, readOnly: true, error: error, helperText: helperText, required: required, inputRef: inputRef }) }), canManual && (_jsx(Tooltip, { title: "Editar direcci\u00F3n manualmente", children: _jsx(IconButton, { "aria-label": "Editar direcci\u00F3n manualmente", className: styles.actionButton, onClick: openManual, children: _jsx(EditIcon, { fill: "currentColor" }) }) })), _jsx(Tooltip, { title: "Limpiar selecci\u00F3n", children: _jsx(IconButton, { "aria-label": "Limpiar selecci\u00F3n", className: styles.actionButton, onClick: clearValue, children: _jsx(CloseIcon, { fill: "currentColor" }) }) })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.grow, children: canGoogle ? (_jsx(ErkAddressAutocomplete, { value: value, onChange: handleGoogle, regionCodes: regionCodes, error: error, required: required, inputRef: inputRef })) : canManual ? (_jsx(ErkTextField, { label: "Ingresa una ubicaci\u00F3n...", value: value?.address ?? '', onChange: (text) => onChange(text ? { source: LocationInputMode.MANUAL, address: text } : null), error: error, helperText: helperText, required: required, inputRef: inputRef })) : (_jsx(ErkTextField, { label: "Usa el bot\u00F3n para obtener tu ubicaci\u00F3n", value: "", readOnly: true, error: error, helperText: helperText, required: required, inputRef: inputRef })) }), canGps && (_jsx(Tooltip, { title: "Obtener ubicaci\u00F3n por GPS", children: _jsx(IconButton, { "aria-label": "Obtener ubicaci\u00F3n por GPS", className: styles.actionButton, disabled: gpsLoading, onClick: handleGps, children: gpsLoading ? _jsx(CircularProgress, { size: 18 }) : _jsx(LocationIcon, { fill: "currentColor" }) }) })), canManual && (_jsx(Tooltip, { title: "Ingresar direcci\u00F3n manualmente", children: _jsx(IconButton, { "aria-label": "Ingresar direcci\u00F3n manualmente", className: styles.actionButton, onClick: openManual, children: _jsx(EditIcon, { fill: "currentColor" }) }) }))] })) }), (gpsError ?? (!value?.address && canGoogle && helperText)) && (_jsx("div", { className: error || gpsError ? styles.errorText : styles.helperText, children: gpsError ?? helperText })), _jsxs(Dialog, { open: manualOpen, onClose: () => setManualOpen(false), maxWidth: "sm", fullWidth: true, slotProps: { paper: { className: styles.dialogPaper } }, children: [_jsx(DialogTitle, { className: styles.dialogTitle, children: "Ingresar Direcci\u00F3n" }), _jsx(DialogContent, { className: styles.dialogContent, children: _jsxs("div", { className: styles.manualGrid, children: [_jsx("div", { className: styles.manualRow, children: _jsx("div", { className: styles.col12, children: manualField('street', 'Calle / Carrera / Avenida (Línea 1)', true) }) }), _jsxs("div", { className: styles.manualRow, children: [_jsx("div", { className: styles.col6, children: manualField('streetNumber', 'Número / Portal') }), _jsx("div", { className: styles.col6, children: manualField('unit', 'Apto / Oficina / Interior') })] }), _jsxs("div", { className: styles.manualRow, children: [_jsx("div", { className: styles.col6, children: manualField('neighborhood', 'Barrio / Zona') }), _jsx("div", { className: styles.col6, children: manualField('city', 'Ciudad', true) })] }), _jsxs("div", { className: styles.manualRow, children: [_jsx("div", { className: styles.col4, children: manualField('state', 'Estado / Provincia / Dpto') }), _jsx("div", { className: styles.col4, children: manualField('postalCode', 'Código Postal') }), _jsx("div", { className: styles.col4, children: manualField('country', 'País', true) })] })] }) }), _jsxs(DialogActions, { style: { padding: '16px 0 0 0', gap: '12px' }, children: [_jsx(ErkButton, { text: "Cancelar", variant: "outlined", onClick: () => setManualOpen(false) }), _jsx(ErkButton, { text: "Guardar", variant: "contained", disabled: !canSaveManual, onClick: saveManual })] })] })] }));
124
+ return (_jsxs("div", { className: styles.container, children: [_jsx("div", { className: styles.inputRow, children: value?.address ? (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.grow, children: _jsx("input", { ref: inputRef, className: error ? `${styles.plainInput} ${styles.plainInputError}` : styles.plainInput, value: value.address, readOnly: true, "aria-label": "Ubicaci\u00F3n seleccionada" }) }), canManual && (_jsx(ErkIconButton, { title: "Editar direcci\u00F3n manualmente", onClick: openManual, children: _jsx(EditIcon, { fill: "currentColor" }) })), _jsx(ErkIconButton, { title: "Limpiar selecci\u00F3n", onClick: clearValue, children: _jsx(CloseIcon, { fill: "currentColor" }) })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.grow, children: canGoogle ? (_jsx(ErkAddressAutocomplete, { value: value, onChange: handleGoogle, regionCodes: regionCodes, error: error, required: required, inputRef: inputRef })) : canManual ? (_jsx("input", { ref: inputRef, className: error ? `${styles.plainInput} ${styles.plainInputError}` : styles.plainInput, placeholder: "Ingresa una ubicaci\u00F3n...", value: value?.address ?? '', required: required, onChange: (e) => onChange(e.target.value
125
+ ? { source: LocationInputMode.MANUAL, address: e.target.value }
126
+ : null) })) : (_jsx("input", { ref: inputRef, className: error ? `${styles.plainInput} ${styles.plainInputError}` : styles.plainInput, placeholder: "Usa el bot\u00F3n para obtener tu ubicaci\u00F3n", value: "", readOnly: true })) }), canGps && (_jsx(ErkIconButton, { title: "Obtener ubicaci\u00F3n por GPS", loading: gpsLoading, onClick: handleGps, children: _jsx(LocationIcon, { fill: "currentColor" }) })), canManual && (_jsx(ErkIconButton, { title: "Ingresar direcci\u00F3n manualmente", onClick: openManual, children: _jsx(EditIcon, { fill: "currentColor" }) }))] })) }), (gpsError ?? helperText) && (_jsx("div", { className: error || gpsError ? styles.errorText : styles.helperText, children: gpsError ?? helperText })), _jsxs(Dialog, { open: manualOpen, onClose: () => setManualOpen(false), maxWidth: "sm", fullWidth: true, slotProps: { paper: { className: styles.dialogPaper } }, children: [_jsx(DialogTitle, { className: styles.dialogTitle, children: "Ingresar Direcci\u00F3n" }), _jsx(DialogContent, { className: styles.dialogContent, children: _jsxs("div", { className: styles.manualGrid, children: [_jsx("div", { className: styles.manualRow, children: _jsx("div", { className: styles.col12, children: manualField('street', 'Calle / Carrera / Avenida (Línea 1)', true) }) }), _jsxs("div", { className: styles.manualRow, children: [_jsx("div", { className: styles.col6, children: manualField('streetNumber', 'Número / Portal') }), _jsx("div", { className: styles.col6, children: manualField('unit', 'Apto / Oficina / Interior') })] }), _jsxs("div", { className: styles.manualRow, children: [_jsx("div", { className: styles.col6, children: manualField('neighborhood', 'Barrio / Zona') }), _jsx("div", { className: styles.col6, children: manualField('city', 'Ciudad', true) })] }), _jsxs("div", { className: styles.manualRow, children: [_jsx("div", { className: styles.col4, children: manualField('state', 'Estado / Provincia / Dpto') }), _jsx("div", { className: styles.col4, children: manualField('postalCode', 'Código Postal') }), _jsx("div", { className: styles.col4, children: manualField('country', 'País', true) })] })] }) }), _jsxs(DialogActions, { style: { padding: '16px 0 0 0', gap: '12px' }, children: [_jsx(ErkButton, { text: "Cancelar", variant: "outlined", onClick: () => setManualOpen(false) }), _jsx(ErkButton, { text: "Guardar", variant: "contained", disabled: !canSaveManual, onClick: saveManual })] })] })] }));
124
127
  }
125
128
  export default ErkLocationField;
@@ -18,27 +18,38 @@
18
18
  min-width: 0;
19
19
  }
20
20
 
21
- .actionButton {
22
- border: 1px solid var(--eureka-outline, #d9dee6) !important;
23
- border-radius: 10px !important;
24
- padding: 5px !important;
25
- height: 33px !important;
26
- width: 33px !important;
27
- background-color: var(--eureka-bg, #fff) !important;
28
- color: var(--eureka-text, #333) !important;
29
- flex-shrink: 0;
30
- transition: all 0.2s ease-in-out;
31
- margin-top: 5px !important;
21
+ /* Mismo input del buscador de direcciones, para estados sin autocomplete */
22
+ .plainInput {
23
+ width: 100%;
24
+ box-sizing: border-box;
25
+ height: 31px;
26
+ padding: 6px 12px;
27
+ font-size: 1rem;
28
+ font-family: inherit;
29
+ color: var(--eureka-text, #293241);
30
+ background-color: var(--eureka-bg, #fff);
31
+ border: 1px solid var(--eureka-outline, #b8b8b8);
32
+ border-radius: 10px;
33
+ outline: none;
32
34
  }
33
35
 
34
- .actionButton:hover:not(:disabled) {
35
- background-color: rgba(0, 0, 0, 0.04) !important;
36
- border-color: var(--eureka-primary, #1976d2) !important;
37
- color: var(--eureka-primary, #1976d2) !important;
36
+ .plainInput::placeholder {
37
+ color: var(--eureka-text, #293241);
38
+ opacity: 0.5;
38
39
  }
39
40
 
40
- .actionButton:disabled {
41
- opacity: 0.5;
41
+ .plainInput:hover:not(:disabled):not(:read-only) {
42
+ border-color: var(--eureka-primary, #3d5a7f);
43
+ }
44
+
45
+ .plainInput:focus:not(:read-only) {
46
+ border-color: var(--eureka-primary, #3d5a7f);
47
+ border-width: 2px;
48
+ padding: 5px 11px;
49
+ }
50
+
51
+ .plainInputError {
52
+ border-color: var(--eureka-error, #e53935);
42
53
  }
43
54
 
44
55
  .helperText {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version":"3.0.57-new-steps",
4
+ "version":"3.0.59-new-steps",
5
5
  "scripts": {
6
6
  "watch": "tsgo --noEmit --watch --project tsconfig.app.json",
7
7
  "start": "vite",