@arquimedes.co/eureka-forms 3.0.50-test → 3.0.52-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.
Files changed (102) hide show
  1. package/dist/@Types/AvailabilityFormStep.d.ts +48 -0
  2. package/dist/@Types/AvailabilityFormStep.js +24 -0
  3. package/dist/@Types/BankAccountFormStep.d.ts +67 -0
  4. package/dist/@Types/BankAccountFormStep.js +14 -0
  5. package/dist/@Types/BookingFormStep.d.ts +166 -0
  6. package/dist/@Types/BookingFormStep.js +44 -0
  7. package/dist/@Types/CalendarFormStep.d.ts +192 -0
  8. package/dist/@Types/CalendarFormStep.js +48 -0
  9. package/dist/@Types/CommunicationChannelFormStep.d.ts +51 -0
  10. package/dist/@Types/CommunicationChannelFormStep.js +15 -0
  11. package/dist/@Types/ConsentFormStep.d.ts +36 -0
  12. package/dist/@Types/ConsentFormStep.js +8 -0
  13. package/dist/@Types/EntityFormFormStep.d.ts +66 -0
  14. package/dist/@Types/EntityFormFormStep.js +20 -0
  15. package/dist/@Types/EventFormStep.d.ts +52 -0
  16. package/dist/@Types/EventFormStep.js +13 -0
  17. package/dist/@Types/ExternalReferenceFormStep.d.ts +74 -0
  18. package/dist/@Types/ExternalReferenceFormStep.js +20 -0
  19. package/dist/@Types/FormStep.d.ts +7 -2
  20. package/dist/@Types/FormStep.js +2 -1
  21. package/dist/@Types/LocationFormStep.d.ts +159 -0
  22. package/dist/@Types/LocationFormStep.js +46 -0
  23. package/dist/@Types/NumericFormSteps.d.ts +108 -0
  24. package/dist/@Types/NumericFormSteps.js +20 -0
  25. package/dist/@Types/PredefinedSelectorFormStep.d.ts +51 -0
  26. package/dist/@Types/PredefinedSelectorFormStep.js +39 -0
  27. package/dist/@Types/StepRef.d.ts +135 -0
  28. package/dist/@Types/StepRef.js +49 -0
  29. package/dist/App/App.stories.d.ts +30 -0
  30. package/dist/App/App.stories.js +298 -0
  31. package/dist/App/App.stories.test.d.ts +1 -0
  32. package/dist/App/App.stories.test.js +56 -0
  33. package/dist/FormSteps/BookingStep/BookingStep.d.ts +17 -0
  34. package/dist/FormSteps/BookingStep/BookingStep.js +14 -0
  35. package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.d.ts +7 -0
  36. package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.js +31 -0
  37. package/dist/FormSteps/CalendarStep/CalendarStep.d.ts +7 -0
  38. package/dist/FormSteps/CalendarStep/CalendarStep.js +14 -0
  39. package/dist/FormSteps/CalendarStep/MaterialCalendarStep/MaterialCalendarStep.d.ts +3 -0
  40. package/dist/FormSteps/CalendarStep/MaterialCalendarStep/MaterialCalendarStep.js +269 -0
  41. package/dist/FormSteps/CalendarStep/MaterialCalendarStep/MaterialCalendarStep.module.css +531 -0
  42. package/dist/FormSteps/DatePickerStep/DatePickerStep.required.test.d.ts +1 -0
  43. package/dist/FormSteps/DatePickerStep/DatePickerStep.required.test.js +94 -0
  44. package/dist/FormSteps/LocationStep/LocationStep.d.ts +10 -0
  45. package/dist/FormSteps/LocationStep/LocationStep.js +14 -0
  46. package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.d.ts +3 -0
  47. package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.js +47 -0
  48. package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.module.css +18 -0
  49. package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.d.ts +3 -0
  50. package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.js +168 -0
  51. package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.module.css +94 -0
  52. package/dist/FormSteps/NumberStep/NumberStep.d.ts +10 -0
  53. package/dist/FormSteps/NumberStep/NumberStep.js +14 -0
  54. package/dist/FormSteps/Step.js +16 -0
  55. package/dist/FormSteps/StepFunctions.js +14 -0
  56. package/dist/FormSteps/StepFunctions.test.js +54 -0
  57. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +3 -1
  58. package/dist/Icons/AddIcon.d.ts +3 -0
  59. package/dist/Icons/AddIcon.js +7 -0
  60. package/dist/Icons/EditIcon.d.ts +3 -0
  61. package/dist/Icons/EditIcon.js +7 -0
  62. package/dist/Icons/RemoveIcon.d.ts +3 -0
  63. package/dist/Icons/RemoveIcon.js +7 -0
  64. package/dist/Icons/ViewDayIcon.d.ts +3 -0
  65. package/dist/Icons/ViewDayIcon.js +7 -0
  66. package/dist/Icons/ViewWeekIcon.d.ts +3 -0
  67. package/dist/Icons/ViewWeekIcon.js +7 -0
  68. package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.d.ts +19 -0
  69. package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.js +80 -0
  70. package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.module.css +82 -0
  71. package/dist/Shared/ErkAddressAutocomplete/googlePlaces.d.ts +29 -0
  72. package/dist/Shared/ErkAddressAutocomplete/googlePlaces.js +139 -0
  73. package/dist/Shared/ErkAutocompleteOption.d.ts +12 -0
  74. package/dist/Shared/ErkAutocompleteOption.js +37 -0
  75. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.d.ts +28 -0
  76. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.js +149 -0
  77. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.module.css +113 -0
  78. package/dist/Shared/ErkDatePicker/ErkDatePicker.js +3 -10
  79. package/dist/Shared/ErkDatePicker/ErkDatePicker.required.test.d.ts +1 -0
  80. package/dist/Shared/ErkDatePicker/ErkDatePicker.required.test.js +30 -0
  81. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.d.ts +2 -3
  82. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +1 -2
  83. package/dist/Shared/ErkLocationField/ErkLocationField.d.ts +23 -0
  84. package/dist/Shared/ErkLocationField/ErkLocationField.js +73 -0
  85. package/dist/Shared/ErkLocationField/ErkLocationField.module.css +29 -0
  86. package/dist/Shared/ErkLocationField/addressFields.d.ts +12 -0
  87. package/dist/Shared/ErkLocationField/addressFields.js +34 -0
  88. package/dist/Shared/ErkLocationField/locationRestrictions.d.ts +6 -0
  89. package/dist/Shared/ErkLocationField/locationRestrictions.js +51 -0
  90. package/dist/Shared/ErkLocationInput/ErkLocationInput.d.ts +15 -0
  91. package/dist/Shared/ErkLocationInput/ErkLocationInput.js +502 -0
  92. package/dist/Shared/ErkLocationInput/ErkLocationInput.module.css +115 -0
  93. package/dist/Shared/ErkNumberField/ErkNumberField.d.ts +42 -0
  94. package/dist/Shared/ErkNumberField/ErkNumberField.js +170 -0
  95. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +2 -1
  96. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.test.d.ts +1 -0
  97. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.test.js +33 -0
  98. package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +7 -1
  99. package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +2 -2
  100. package/dist/constants/FormStepTypes.d.ts +5 -1
  101. package/dist/constants/FormStepTypes.js +4 -0
  102. package/package.json +2 -1
@@ -0,0 +1,82 @@
1
+ .input {
2
+ width: 100%;
3
+ box-sizing: border-box;
4
+ height: 40px;
5
+ padding: 6px 12px;
6
+ font-size: 1rem;
7
+ color: var(--eureka-text, #333);
8
+ background-color: var(--eureka-bg, #fff);
9
+ border: 1px solid var(--eureka-outline, #ccc);
10
+ border-radius: 10px;
11
+ outline: none;
12
+ }
13
+
14
+ .input:hover:not(:disabled) {
15
+ border-color: var(--eureka-primary, #1976d2);
16
+ }
17
+
18
+ .input:focus {
19
+ border-color: var(--eureka-primary, #1976d2);
20
+ border-width: 2px;
21
+ padding: 5px 11px;
22
+ }
23
+
24
+ .input:disabled {
25
+ opacity: 0.5;
26
+ }
27
+
28
+ .inputError {
29
+ border-color: var(--eureka-error, #e53935);
30
+ }
31
+
32
+ .positioner {
33
+ z-index: 1400;
34
+ width: var(--anchor-width);
35
+ }
36
+
37
+ .popup {
38
+ box-sizing: border-box;
39
+ max-height: 320px;
40
+ overflow-y: auto;
41
+ padding: 4px;
42
+ background-color: var(--eureka-bg, #fff);
43
+ border: 1px solid var(--eureka-outline, #ccc);
44
+ border-radius: 10px;
45
+ box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
46
+ }
47
+
48
+ .list {
49
+ display: flex;
50
+ flex-direction: column;
51
+ }
52
+
53
+ .status {
54
+ padding: 10px 12px;
55
+ font-size: 0.875rem;
56
+ color: var(--eureka-text, #666);
57
+ opacity: 0.7;
58
+ }
59
+
60
+ .item {
61
+ display: flex;
62
+ flex-direction: column;
63
+ gap: 2px;
64
+ padding: 8px 12px;
65
+ border-radius: 8px;
66
+ cursor: pointer;
67
+ }
68
+
69
+ .item[data-highlighted],
70
+ .item:hover {
71
+ background-color: var(--eureka-primary, #1976d2);
72
+ color: #fff;
73
+ }
74
+
75
+ .optionLabel {
76
+ font-size: 0.9375rem;
77
+ }
78
+
79
+ .optionDescription {
80
+ font-size: 0.8125rem;
81
+ opacity: 0.7;
82
+ }
@@ -0,0 +1,29 @@
1
+ import { LocationAddressDetail, LocationStepValue } from '../../@Types/LocationFormStep';
2
+ /** Asegura el script cargado y las clases de Places listas. Idempotente. */
3
+ export declare function loadPlaces(apiKey: string): Promise<void>;
4
+ /** Token de sesión nuevo (mejora el billing/relevancia de Google). */
5
+ export declare function newSessionToken(): any;
6
+ /** Reverse-geocoding para el modo GPS: coordenadas → dirección estructurada. */
7
+ export declare function reverseGeocode(apiKey: string, lat: number, lng: number): Promise<{
8
+ address?: string;
9
+ addressDetail: LocationAddressDetail;
10
+ }>;
11
+ export interface AddressPrediction {
12
+ placeId: string;
13
+ label: string;
14
+ description: string;
15
+ toPlace: () => any;
16
+ }
17
+ export interface FetchSuggestionsOptions {
18
+ sessionToken?: any;
19
+ /** ISO-2, ej. ['co'] */
20
+ regionCodes?: string[];
21
+ }
22
+ export declare function fetchAddressSuggestions(input: string, options?: FetchSuggestionsOptions): Promise<AddressPrediction[]>;
23
+ /**
24
+ * Descompone los `addressComponents` de un Place en el shape estructurado del step.
25
+ * Acepta el formato nuevo (`longText`/`shortText`) y el legacy (`long_name`/`short_name`).
26
+ */
27
+ export declare function parseAddressComponents(components: any[] | null | undefined): LocationAddressDetail;
28
+ /** Resuelve una predicción a un `LocationStepValue` completo (fetchFields + parse). */
29
+ export declare function resolvePrediction(prediction: AddressPrediction): Promise<LocationStepValue>;
@@ -0,0 +1,139 @@
1
+ import { LocationInputMode } from '../../@Types/LocationFormStep';
2
+ /**
3
+ * Carga y consulta de Google Places (nueva API `AutocompleteSuggestion`).
4
+ * Encapsula el script loader + importLibrary que antes vivía inline en ErkLocationInput,
5
+ * para reutilizarlo desde el autocomplete de Base UI sin duplicar lógica.
6
+ */
7
+ // Google's new Places classes (AutocompleteSuggestion/SessionToken) are untyped in the
8
+ // installed @types/google.maps, so they're kept as `any` — same approach as ErkLocationInput.
9
+ let loadPromise = null;
10
+ let suggestionClass = null;
11
+ let sessionTokenClass = null;
12
+ let geocoderClass = null;
13
+ function loadScript(apiKey) {
14
+ if (typeof window === 'undefined')
15
+ return Promise.resolve();
16
+ const win = window;
17
+ if (win.google?.maps?.importLibrary)
18
+ return Promise.resolve();
19
+ if (loadPromise)
20
+ return loadPromise;
21
+ loadPromise = new Promise((resolve, reject) => {
22
+ const script = document.createElement('script');
23
+ script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&loading=async`;
24
+ script.async = true;
25
+ script.defer = true;
26
+ script.onload = () => resolve();
27
+ script.onerror = () => {
28
+ loadPromise = null;
29
+ reject(new Error('Google Maps script failed to load.'));
30
+ };
31
+ document.head.appendChild(script);
32
+ });
33
+ return loadPromise;
34
+ }
35
+ /** Asegura el script cargado y las clases de Places listas. Idempotente. */
36
+ export async function loadPlaces(apiKey) {
37
+ await loadScript(apiKey);
38
+ const win = window;
39
+ if (win.google?.maps?.importLibrary && !suggestionClass) {
40
+ const places = await win.google.maps.importLibrary('places');
41
+ suggestionClass = places.AutocompleteSuggestion;
42
+ sessionTokenClass = places.AutocompleteSessionToken;
43
+ }
44
+ }
45
+ /** Token de sesión nuevo (mejora el billing/relevancia de Google). */
46
+ export function newSessionToken() {
47
+ return sessionTokenClass ? new sessionTokenClass() : undefined;
48
+ }
49
+ /** Reverse-geocoding para el modo GPS: coordenadas → dirección estructurada. */
50
+ export async function reverseGeocode(apiKey, lat, lng) {
51
+ await loadScript(apiKey);
52
+ const win = window;
53
+ if (win.google?.maps?.importLibrary && !geocoderClass) {
54
+ const geocoding = await win.google.maps.importLibrary('geocoding');
55
+ geocoderClass = geocoding.Geocoder;
56
+ }
57
+ else if (!geocoderClass && win.google?.maps?.Geocoder) {
58
+ geocoderClass = win.google.maps.Geocoder;
59
+ }
60
+ if (!geocoderClass)
61
+ return { addressDetail: {} };
62
+ const geocoder = new geocoderClass();
63
+ return new Promise((resolve) => {
64
+ geocoder.geocode({ location: { lat, lng } }, (results, status) => {
65
+ if (status === 'OK' && results?.[0]) {
66
+ resolve({
67
+ address: results[0].formatted_address,
68
+ addressDetail: parseAddressComponents(results[0].address_components),
69
+ });
70
+ }
71
+ else {
72
+ resolve({ addressDetail: {} });
73
+ }
74
+ });
75
+ });
76
+ }
77
+ export async function fetchAddressSuggestions(input, options) {
78
+ if (!suggestionClass)
79
+ return [];
80
+ const request = { input };
81
+ if (options?.sessionToken)
82
+ request.sessionToken = options.sessionToken;
83
+ if (options?.regionCodes)
84
+ request.includedRegionCodes = options.regionCodes;
85
+ const { suggestions } = await suggestionClass.fetchAutocompleteSuggestions(request);
86
+ return suggestions
87
+ .filter((s) => s.placePrediction)
88
+ .map((s) => ({
89
+ placeId: s.placePrediction.placeId,
90
+ label: s.placePrediction.mainText?.text ?? s.placePrediction.text.text,
91
+ description: s.placePrediction.secondaryText?.text ?? s.placePrediction.text.text,
92
+ toPlace: () => s.placePrediction.toPlace(),
93
+ }));
94
+ }
95
+ /**
96
+ * Descompone los `addressComponents` de un Place en el shape estructurado del step.
97
+ * Acepta el formato nuevo (`longText`/`shortText`) y el legacy (`long_name`/`short_name`).
98
+ */
99
+ export function parseAddressComponents(components) {
100
+ const detail = {};
101
+ for (const component of components ?? []) {
102
+ const types = component.types;
103
+ const longName = component.longText ?? component.long_name;
104
+ const shortName = component.shortText ?? component.short_name;
105
+ if (types.includes('route'))
106
+ detail.street = longName;
107
+ else if (types.includes('street_number'))
108
+ detail.streetNumber = longName;
109
+ else if (types.includes('subpremise'))
110
+ detail.unit = longName;
111
+ else if (types.includes('neighborhood') || types.includes('sublocality'))
112
+ detail.neighborhood = longName;
113
+ else if (types.includes('locality'))
114
+ detail.city = longName;
115
+ else if (types.includes('administrative_area_level_1'))
116
+ detail.state = longName;
117
+ else if (types.includes('country')) {
118
+ detail.country = longName;
119
+ detail.countryCode = shortName;
120
+ }
121
+ else if (types.includes('postal_code'))
122
+ detail.postalCode = longName;
123
+ }
124
+ return detail;
125
+ }
126
+ /** Resuelve una predicción a un `LocationStepValue` completo (fetchFields + parse). */
127
+ export async function resolvePrediction(prediction) {
128
+ const place = prediction.toPlace();
129
+ await place.fetchFields({ fields: ['displayName', 'formattedAddress', 'location', 'addressComponents'] });
130
+ return {
131
+ source: LocationInputMode.GOOGLE_PLACES,
132
+ latitude: place.location?.lat(),
133
+ longitude: place.location?.lng(),
134
+ name: place.displayName ?? prediction.label,
135
+ address: place.formattedAddress ?? undefined,
136
+ placeId: prediction.placeId,
137
+ addressDetail: parseAddressComponents(place.addressComponents),
138
+ };
139
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Option element for the searchable `ErkSmartSelect` (MUI `Autocomplete`). Replaces MUI `MenuItem`
3
+ * in `renderOption`: v9's `MenuItem` requires a surrounding `MenuList` context (it throws without
4
+ * one), but an Autocomplete's listbox is a plain `<ul>`, so a styled `<li>` is used instead.
5
+ * Hover/focus styling comes from MUI's own `.Erk-MuiAutocomplete-option` rules (the option props
6
+ * carry that class); this just ports the `ErkMenuItem` look (padding, wrapping, leading-icon layout)
7
+ * and the selected background.
8
+ */
9
+ declare const ErkAutocompleteOption: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
10
+ selected?: boolean;
11
+ }, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
12
+ export default ErkAutocompleteOption;
@@ -0,0 +1,37 @@
1
+ import { styled } from '@mui/material';
2
+ /**
3
+ * Option element for the searchable `ErkSmartSelect` (MUI `Autocomplete`). Replaces MUI `MenuItem`
4
+ * in `renderOption`: v9's `MenuItem` requires a surrounding `MenuList` context (it throws without
5
+ * one), but an Autocomplete's listbox is a plain `<ul>`, so a styled `<li>` is used instead.
6
+ * Hover/focus styling comes from MUI's own `.Erk-MuiAutocomplete-option` rules (the option props
7
+ * carry that class); this just ports the `ErkMenuItem` look (padding, wrapping, leading-icon layout)
8
+ * and the selected background.
9
+ */
10
+ const ErkAutocompleteOption = styled('li', {
11
+ // `ownerState` is injected by MUI v9 into the option props (spread here via Autocomplete's
12
+ // renderOption); a custom shouldForwardProp drops MUI's default exclusion, so filter it too or it
13
+ // leaks onto the <li> (React "unrecognized prop" warning).
14
+ shouldForwardProp: (prop) => prop !== 'selected' && prop !== 'ownerState',
15
+ })(({ theme, selected }) => ({
16
+ display: 'flex',
17
+ alignItems: 'center',
18
+ position: 'relative',
19
+ listStyle: 'none',
20
+ padding: '6px 12px',
21
+ whiteSpace: 'normal',
22
+ cursor: 'pointer',
23
+ backgroundColor: selected ? theme.palette.action.selected : undefined,
24
+ '&:has(.ErkIcon)': {
25
+ paddingLeft: '40px',
26
+ '& .ErkIcon': {
27
+ left: 12,
28
+ top: '50%',
29
+ position: 'absolute',
30
+ transform: 'translateY(-50%)',
31
+ fill: theme.palette.primary.main,
32
+ width: '20px',
33
+ height: '20px',
34
+ },
35
+ },
36
+ }));
37
+ export default ErkAutocompleteOption;
@@ -0,0 +1,28 @@
1
+ import { BookablePerson, BookingMode, BookingSlot, BookingValue, PersonSelectionMode } from '../../@Types/BookingFormStep';
2
+ export interface ErkBookingPickerProps {
3
+ value: BookingValue | null;
4
+ onChange: (value: BookingValue | null) => void;
5
+ label: string;
6
+ description?: string | null;
7
+ durationMinutes: number;
8
+ bufferMinutes?: number;
9
+ bookingMode?: BookingMode;
10
+ temporaryLockMinutes?: number;
11
+ personSelectionMode?: PersonSelectionMode;
12
+ persons?: BookablePerson[];
13
+ /** Recopila nombre/correo del que agenda. */
14
+ collectContact?: boolean;
15
+ /** Provee los slots disponibles para una persona + día. */
16
+ fetchSlots?: (args: {
17
+ personId?: string;
18
+ date: string;
19
+ }) => Promise<BookingSlot[]>;
20
+ readOnly?: boolean;
21
+ error?: string;
22
+ }
23
+ /**
24
+ * Selector de cita reutilizable en una sola vista (persona · día · hora), con panel
25
+ * de resumen a la izquierda y barra de confirmación. Réplica del diseño del mockup.
26
+ */
27
+ declare function ErkBookingPicker({ value, onChange, label, description, durationMinutes, bufferMinutes, bookingMode, temporaryLockMinutes, personSelectionMode, persons, collectContact, fetchSlots, readOnly, error, }: ErkBookingPickerProps): JSX.Element;
28
+ export default ErkBookingPicker;
@@ -0,0 +1,149 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useMemo, useState } from 'react';
3
+ import { addDays, addMonths, format, isBefore, isSameDay, isSameMonth, startOfDay, startOfMonth, startOfWeek, } from 'date-fns';
4
+ import { es } from 'date-fns/locale';
5
+ import { BookingMode, PersonSelectionMode, } from '../../@Types/BookingFormStep';
6
+ import ErkTextField from '../ErkTextField/ErkTextField';
7
+ import styles from './ErkBookingPicker.module.css';
8
+ const WEEK_STARTS_ON = 1;
9
+ const DOW = ['L', 'M', 'M', 'J', 'V', 'S', 'D'];
10
+ const MODE_LABEL = {
11
+ [BookingMode.IN_PERSON]: 'Presencial',
12
+ [BookingMode.VIRTUAL]: 'Virtual',
13
+ [BookingMode.HYBRID]: 'Híbrida',
14
+ };
15
+ function fmtDate(date) {
16
+ return format(date, 'yyyy-MM-dd');
17
+ }
18
+ function longDate(date) {
19
+ return format(date, 'EEEE d MMM', { locale: es });
20
+ }
21
+ function initials(name) {
22
+ return name
23
+ .split(' ')
24
+ .map((p) => p[0])
25
+ .filter(Boolean)
26
+ .slice(0, 2)
27
+ .join('')
28
+ .toUpperCase();
29
+ }
30
+ function capitalize(text) {
31
+ return text.charAt(0).toUpperCase() + text.slice(1);
32
+ }
33
+ /**
34
+ * Selector de cita reutilizable en una sola vista (persona · día · hora), con panel
35
+ * de resumen a la izquierda y barra de confirmación. Réplica del diseño del mockup.
36
+ */
37
+ function ErkBookingPicker({ value, onChange, label, description, durationMinutes, bufferMinutes, bookingMode, temporaryLockMinutes, personSelectionMode, persons, collectContact = false, fetchSlots, readOnly = false, error, }) {
38
+ const needsPerson = !!personSelectionMode && personSelectionMode !== PersonSelectionMode.NONE;
39
+ const personsOptional = personSelectionMode === PersonSelectionMode.OPTIONAL;
40
+ const today = startOfDay(new Date());
41
+ const [person, setPerson] = useState(undefined);
42
+ const [personTouched, setPersonTouched] = useState(false);
43
+ const [date, setDate] = useState(today);
44
+ const [viewMonth, setViewMonth] = useState(() => startOfMonth(today));
45
+ const [slot, setSlot] = useState(undefined);
46
+ const [slots, setSlots] = useState([]);
47
+ const [loading, setLoading] = useState(false);
48
+ const [contactName, setContactName] = useState('');
49
+ const [contactEmail, setContactEmail] = useState('');
50
+ const monthCells = useMemo(() => {
51
+ const first = startOfWeek(startOfMonth(viewMonth), { weekStartsOn: WEEK_STARTS_ON });
52
+ return Array.from({ length: 42 }, (_, i) => addDays(first, i));
53
+ }, [viewMonth]);
54
+ const loadSlots = useCallback(async (day, personId) => {
55
+ if (!fetchSlots)
56
+ return;
57
+ setLoading(true);
58
+ setSlots([]);
59
+ try {
60
+ setSlots(await fetchSlots({ personId, date: fmtDate(day) }));
61
+ }
62
+ catch {
63
+ setSlots([]);
64
+ }
65
+ finally {
66
+ setLoading(false);
67
+ }
68
+ }, [fetchSlots]);
69
+ useEffect(() => {
70
+ if (value)
71
+ return;
72
+ if (needsPerson && !personsOptional && !personTouched)
73
+ return;
74
+ void loadSlots(date, person?.id);
75
+ }, [value, needsPerson, personsOptional, personTouched, date, person, loadSlots]);
76
+ const confirm = () => {
77
+ if (!slot)
78
+ return;
79
+ onChange({
80
+ type: 'BOOKING_VALUE',
81
+ slotId: slot.id,
82
+ date: fmtDate(date),
83
+ startTime: slot.startTime,
84
+ endTime: slot.endTime,
85
+ personId: person?.id,
86
+ personName: person?.name,
87
+ contactName: contactName || undefined,
88
+ contactEmail: contactEmail || undefined,
89
+ status: 'PENDING',
90
+ });
91
+ };
92
+ const reset = () => {
93
+ onChange(null);
94
+ setPerson(undefined);
95
+ setPersonTouched(false);
96
+ setSlot(undefined);
97
+ setContactName('');
98
+ setContactEmail('');
99
+ };
100
+ const pickPerson = (p) => {
101
+ setPerson(p);
102
+ setPersonTouched(true);
103
+ setSlot(undefined);
104
+ };
105
+ // Read-only / already booked → compact summary
106
+ if (readOnly || value) {
107
+ return (_jsx("div", { className: styles.container, children: _jsxs("div", { className: styles.booked, children: [_jsx("div", { className: styles.bookedIcon, children: "\u2713" }), _jsxs("div", { className: styles.bookedInfo, children: [_jsx("span", { className: styles.bookedLabel, children: label }), _jsx("span", { className: styles.bookedMain, children: value
108
+ ? [
109
+ value.personName,
110
+ capitalize(longDate(new Date(value.date + 'T00:00:00'))),
111
+ `${value.startTime}–${value.endTime}`,
112
+ ]
113
+ .filter(Boolean)
114
+ .join(' · ')
115
+ : 'Sin cita' })] }), value && !readOnly && (_jsx("button", { type: "button", className: styles.changeBtn, onClick: reset, children: "Cambiar" }))] }) }));
116
+ }
117
+ // Stepper state
118
+ const steps = [...(needsPerson ? ['Persona'] : []), 'Día y hora', 'Confirmar'];
119
+ const current = needsPerson && !personTouched ? 0 : slot ? steps.length - 1 : needsPerson ? 1 : 0;
120
+ return (_jsxs("div", { className: styles.container, children: [_jsxs("div", { className: styles.card, children: [_jsxs("div", { className: styles.book, children: [_jsxs("aside", { className: styles.who, children: [_jsxs("div", { className: styles.brand, children: [_jsx("div", { className: styles.avatar, children: person ? initials(person.name) : '📅' }), _jsxs("div", { children: [_jsx("h2", { className: styles.brandName, children: person?.name ?? label }), _jsx("p", { className: styles.brandRole, children: person?.role ?? description ?? 'Agenda tu cita' }), person && (_jsx("button", { type: "button", className: styles.change, onClick: () => pickPerson(undefined), children: "Cambiar persona" }))] })] }), _jsxs("div", { className: styles.meta, children: [_jsx("span", { className: styles.metaLbl, children: "Detalles" }), _jsxs("div", { className: styles.row, children: [_jsx("span", { className: styles.ic, children: "\u25F7" }), durationMinutes, " min", bufferMinutes ? ` · buffer ${bufferMinutes} min` : ''] }), bookingMode && (_jsxs("div", { className: styles.row, children: [_jsx("span", { className: styles.ic, children: "\u25F1" }), _jsx("span", { className: styles.pill, children: MODE_LABEL[bookingMode] })] }))] }), !!temporaryLockMinutes && (_jsxs("div", { className: styles.lock, children: ["\u23F3 Reservaremos el horario ", _jsxs("b", { children: [temporaryLockMinutes, " min"] }), " mientras confirmas."] }))] }), _jsxs("div", { className: styles.right, children: [_jsx("div", { className: styles.stepper, children: steps.map((s, i) => (_jsxs("span", { className: styles.stepGroup, children: [_jsxs("span", { className: i < current
121
+ ? `${styles.stepItem} ${styles.stepDone}`
122
+ : i === current
123
+ ? `${styles.stepItem} ${styles.stepOn}`
124
+ : styles.stepItem, children: [_jsx("span", { className: styles.stepNum, children: i < current ? '✓' : i + 1 }), s] }), i < steps.length - 1 && _jsx("span", { className: styles.stepSep })] }, s))) }), needsPerson && (_jsxs(_Fragment, { children: [_jsx("p", { className: styles.blockLbl, children: "\u00BFCon qui\u00E9n quieres agendar?" }), _jsxs("div", { className: styles.persons, children: [(persons ?? []).map((p) => (_jsxs("button", { type: "button", className: person?.id === p.id ? `${styles.pcard} ${styles.pcardOn}` : styles.pcard, onClick: () => pickPerson(p), children: [_jsx("span", { className: styles.pav, children: initials(p.name) }), _jsxs("span", { className: styles.pinfo, children: [_jsx("span", { className: styles.pn, children: p.name }), p.role && _jsx("span", { className: styles.pr, children: p.role })] })] }, p.id))), personsOptional && (_jsxs("button", { type: "button", className: personTouched && !person
125
+ ? `${styles.pcard} ${styles.pcardAny} ${styles.pcardOn}`
126
+ : `${styles.pcard} ${styles.pcardAny}`, onClick: () => pickPerson(undefined), children: [_jsx("span", { className: styles.pav, children: "\u2726" }), _jsxs("span", { className: styles.pinfo, children: [_jsx("span", { className: styles.pn, children: "Cualquiera" }), _jsx("span", { className: styles.pr, children: "El sistema asigna" })] })] }))] })] })), _jsxs("div", { className: styles.pick, children: [_jsxs("div", { children: [_jsx("p", { className: styles.blockLbl, children: "Elige un d\u00EDa" }), _jsxs("div", { className: styles.monthHead, children: [_jsx("span", { className: styles.monthTitle, children: capitalize(format(viewMonth, 'MMMM yyyy', { locale: es })) }), _jsxs("span", { className: styles.monthNav, children: [_jsx("button", { type: "button", onClick: () => setViewMonth((m) => addMonths(m, -1)), children: "\u2039" }), _jsx("button", { type: "button", onClick: () => setViewMonth((m) => addMonths(m, 1)), children: "\u203A" })] })] }), _jsxs("div", { className: styles.mgrid, children: [DOW.map((d, i) => (_jsx("span", { className: styles.mdow, children: d }, i))), monthCells.map((d) => {
127
+ const outside = !isSameMonth(d, viewMonth);
128
+ const past = isBefore(d, today);
129
+ const selectable = !outside && !past;
130
+ const cls = isSameDay(d, date)
131
+ ? `${styles.mday} ${styles.mdaySel}`
132
+ : selectable
133
+ ? `${styles.mday} ${styles.mdayFree}`
134
+ : `${styles.mday} ${styles.mdayNone}`;
135
+ return (_jsx("button", { type: "button", disabled: !selectable, className: cls, onClick: () => {
136
+ setDate(d);
137
+ setSlot(undefined);
138
+ }, children: format(d, 'd') }, d.toISOString()));
139
+ })] })] }), _jsxs("div", { children: [_jsx("p", { className: styles.blockLbl, children: "Horarios libres" }), _jsxs("div", { className: styles.slotsHead, children: [_jsx("b", { children: capitalize(longDate(date)) }), " \u00B7 ", durationMinutes, " min"] }), loading ? (_jsx("div", { className: styles.empty, children: "Buscando horarios\u2026" })) : slots.length === 0 ? (_jsx("div", { className: styles.empty, children: "No hay horarios disponibles ese d\u00EDa." })) : (_jsx("div", { className: styles.slots, children: slots.map((s) => (_jsx("button", { type: "button", disabled: !s.available, className: slot?.id === s.id
140
+ ? `${styles.slot} ${styles.slotSel}`
141
+ : s.available
142
+ ? styles.slot
143
+ : `${styles.slot} ${styles.slotTaken}`, onClick: () => s.available && setSlot(s), children: s.startTime }, s.id))) }))] })] })] })] }), _jsxs("div", { className: styles.confirm, children: [_jsx("div", { className: styles.selSummary, children: slot
144
+ ? [person?.name, capitalize(longDate(date)), `${slot.startTime}–${slot.endTime}`]
145
+ .filter(Boolean)
146
+ .join(' · ')
147
+ : 'Elige día y hora' }), collectContact && (_jsxs("div", { className: styles.cfields, children: [_jsx(ErkTextField, { label: "Nombre", value: contactName, onChange: setContactName }), _jsx(ErkTextField, { label: "Correo", value: contactEmail, onChange: setContactEmail })] })), _jsx("button", { type: "button", className: styles.cta, disabled: !slot, onClick: confirm, children: "Confirmar cita" })] })] }), error && _jsx("div", { className: styles.err, children: error })] }));
148
+ }
149
+ export default ErkBookingPicker;
@@ -0,0 +1,113 @@
1
+ .container { max-width: 100%; box-sizing: border-box; }
2
+
3
+ .card {
4
+ border: 1px solid var(--eureka-outline, #d9dee6);
5
+ border-radius: 16px;
6
+ overflow: hidden;
7
+ background: var(--eureka-bg, #fff);
8
+ box-shadow: 0 12px 34px rgba(43, 65, 93, 0.08);
9
+ }
10
+ .book { display: grid; grid-template-columns: 290px 1fr; }
11
+
12
+ /* ---------- Left: who + details ---------- */
13
+ .who {
14
+ padding: 22px 20px;
15
+ border-right: 1px solid var(--eureka-outline, #eceff3);
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: 16px;
19
+ background: color-mix(in srgb, var(--eureka-primary, #3d5a7f) 4%, #fff);
20
+ }
21
+ .brand { display: flex; align-items: center; gap: 11px; }
22
+ .avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--eureka-primary, #3d5a7f); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; }
23
+ .brandName { margin: 0; font-size: 16px; font-weight: 800; color: var(--eureka-text, #22303f); }
24
+ .brandRole { margin: 2px 0 0; font-size: 12.5px; color: #787878; }
25
+ .change { margin-top: 2px; border: none; background: none; padding: 0; font-size: 12px; font-weight: 700; color: var(--eureka-primary, #3d5a7f); cursor: pointer; }
26
+ .meta { display: flex; flex-direction: column; gap: 11px; }
27
+ .metaLbl { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #9aa3b0; font-weight: 700; }
28
+ .row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--eureka-text, #22303f); }
29
+ .ic { color: var(--eureka-primary, #3d5a7f); width: 16px; text-align: center; flex: none; }
30
+ .pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: color-mix(in srgb, var(--eureka-primary, #3d5a7f) 10%, #fff); color: var(--eureka-primary, #3d5a7f); }
31
+ .lock { margin-top: auto; font-size: 12px; color: #787878; background: #fff7ed; border: 1px solid #f4d9b0; border-radius: 9px; padding: 8px 10px; }
32
+ .lock b { color: #b7791f; }
33
+
34
+ /* ---------- Right ---------- */
35
+ .right { padding: 18px 22px; min-width: 0; }
36
+
37
+ .stepper { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #787878; margin-bottom: 16px; flex-wrap: wrap; }
38
+ .stepGroup { display: inline-flex; align-items: center; gap: 8px; }
39
+ .stepItem { display: inline-flex; align-items: center; gap: 7px; }
40
+ .stepNum { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: color-mix(in srgb, var(--eureka-primary, #3d5a7f) 8%, #fff); color: #9aa3b0; }
41
+ .stepDone { color: var(--eureka-text, #22303f); }
42
+ .stepDone .stepNum { background: #2e9367; color: #fff; }
43
+ .stepOn { color: var(--eureka-text, #22303f); font-weight: 700; }
44
+ .stepOn .stepNum { background: var(--eureka-primary, #3d5a7f); color: #fff; }
45
+ .stepSep { width: 22px; height: 1px; background: var(--eureka-outline, #d9dee6); }
46
+
47
+ .blockLbl { margin: 0 0 9px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #787878; font-weight: 700; }
48
+
49
+ /* persons */
50
+ .persons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
51
+ .pcard { display: flex; align-items: center; gap: 10px; border: 1px solid var(--eureka-outline, #d9dee6); border-radius: 12px; padding: 8px 13px 8px 8px; background: #fff; cursor: pointer; text-align: left; min-width: 168px; }
52
+ .pcard:hover { border-color: var(--eureka-primary, #3d5a7f); }
53
+ .pcardOn { border-color: var(--eureka-primary, #3d5a7f); background: color-mix(in srgb, var(--eureka-primary, #3d5a7f) 8%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--eureka-primary, #3d5a7f) 12%, transparent); }
54
+ .pav { width: 34px; height: 34px; border-radius: 50%; background: #c9d4e2; color: #2b415d; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
55
+ .pcardAny .pav { background: #eef1f6; color: var(--eureka-primary, #3d5a7f); }
56
+ .pinfo { display: flex; flex-direction: column; }
57
+ .pn { font-size: 13.5px; font-weight: 700; color: var(--eureka-text, #22303f); }
58
+ .pr { font-size: 11.5px; color: #787878; }
59
+
60
+ /* day (month grid) + slots */
61
+ .pick { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
62
+ .monthHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
63
+ .monthTitle { font-size: 13.5px; font-weight: 700; color: var(--eureka-text, #22303f); }
64
+ .monthNav button { border: none; background: none; color: #787878; cursor: pointer; font-size: 15px; padding: 2px 6px; border-radius: 6px; }
65
+ .monthNav button:hover { background: color-mix(in srgb, var(--eureka-primary, #3d5a7f) 8%, #fff); }
66
+ .mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; font-variant-numeric: tabular-nums; }
67
+ .mdow { text-align: center; font-size: 10px; font-weight: 700; color: #9aa3b0; padding-bottom: 2px; }
68
+ .mday { position: relative; aspect-ratio: 1; display: grid; place-items: center; font-size: 12.5px; border: none; background: none; border-radius: 9px; cursor: pointer; }
69
+ .mdayFree { color: var(--eureka-text, #22303f); font-weight: 600; }
70
+ .mdayFree::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: #2e9367; }
71
+ .mdayFree:hover { background: color-mix(in srgb, var(--eureka-primary, #3d5a7f) 8%, #fff); }
72
+ .mdayNone { color: #c8ced7; cursor: default; }
73
+ .mdaySel { background: var(--eureka-primary, #3d5a7f); color: #fff; font-weight: 700; }
74
+
75
+ .slotsHead { font-size: 12.5px; color: #787878; margin-bottom: 10px; }
76
+ .slotsHead b { color: var(--eureka-text, #22303f); }
77
+ .slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
78
+ .slot { border: 1px solid var(--eureka-outline, #d9dee6); background: #fff; border-radius: 10px; padding: 9px 0; font-size: 13px; font-weight: 600; color: var(--eureka-primary, #3d5a7f); cursor: pointer; font-variant-numeric: tabular-nums; }
79
+ .slot:hover { border-color: var(--eureka-primary, #3d5a7f); background: color-mix(in srgb, var(--eureka-primary, #3d5a7f) 7%, #fff); }
80
+ .slotSel { background: var(--eureka-primary, #3d5a7f); color: #fff; border-color: var(--eureka-primary, #3d5a7f); }
81
+ .slotTaken { color: #c3c9d2; border-style: dashed; cursor: not-allowed; text-decoration: line-through; }
82
+ .empty { font-size: 13px; color: #787878; padding: 12px 0; }
83
+
84
+ /* confirm bar */
85
+ .confirm { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--eureka-outline, #eceff3); background: color-mix(in srgb, var(--eureka-primary, #3d5a7f) 3%, #fff); }
86
+ .selSummary { font-size: 14px; font-weight: 700; color: var(--eureka-text, #22303f); }
87
+ .cfields { display: flex; gap: 10px; flex: 1; min-width: 220px; }
88
+ .cta { margin-left: auto; border: none; border-radius: 11px; padding: 11px 22px; font-size: 14px; font-weight: 800; color: #fff; background: var(--booking-accent, #c0417a); cursor: pointer; }
89
+ .cta:hover { filter: brightness(0.95); }
90
+ .cta:disabled { opacity: 0.45; cursor: not-allowed; }
91
+
92
+ .err { font-size: 12px; color: #d0473f; margin-top: 6px; }
93
+
94
+ /* booked / read-only summary */
95
+ .booked { display: flex; align-items: center; gap: 12px; border: 1px solid var(--eureka-outline, #d9dee6); border-radius: 12px; padding: 12px 14px; background: var(--eureka-bg, #fff); }
96
+ .bookedIcon { width: 30px; height: 30px; border-radius: 50%; background: #2e9367; color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
97
+ .bookedInfo { display: flex; flex-direction: column; min-width: 0; }
98
+ .bookedLabel { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #787878; font-weight: 700; }
99
+ .bookedMain { font-size: 14px; font-weight: 700; color: var(--eureka-text, #22303f); }
100
+ .changeBtn { margin-left: auto; border: 1px solid var(--eureka-outline, #d9dee6); background: #fff; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--eureka-primary, #3d5a7f); cursor: pointer; }
101
+
102
+ /* responsive */
103
+ @media (max-width: 760px) {
104
+ .book { grid-template-columns: 1fr; }
105
+ .who { border-right: none; border-bottom: 1px solid var(--eureka-outline, #eceff3); }
106
+ .lock { margin-top: 12px; }
107
+ .pick { grid-template-columns: 1fr; gap: 18px; }
108
+ .persons { flex-direction: column; }
109
+ .pcard { min-width: 0; width: 100%; }
110
+ .confirm { flex-direction: column; align-items: stretch; }
111
+ .cfields { min-width: 0; }
112
+ .cta { margin-left: 0; width: 100%; }
113
+ }
@@ -2,11 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React, { useMemo } from 'react';
3
3
  import { format as dateFnsFormat, isValid } from 'date-fns';
4
4
  import { InputAdornment, styled, Dialog as MuiDialog } from '@mui/material';
5
- import { MobileDatePicker as MuiDatePicker, MobileDateTimePicker as MuiDateTimePicker, DatePickerToolbar as MuiDatePickerToolbar, DateTimePickerToolbar as MuiDateTimePickerToolbar, usePickerContext, } from '@mui/x-date-pickers';
6
- import { PickerDay as MuiPickerDay } from '@mui/x-date-pickers/PickerDay';
5
+ import { MobileDatePicker as MuiDatePicker, MobileDateTimePicker as MuiDateTimePicker, DatePickerToolbar as MuiDatePickerToolbar, DateTimePickerToolbar as MuiDateTimePickerToolbar, usePickerContext, PickerDay as MuiPickerDay, renderTimeViewClock, } from '@mui/x-date-pickers';
7
6
  import { StyledTextField } from '../ErkTextField/ErkTextField';
8
7
  import CalendarIcon from '../../Icons/CalendarIcon';
9
- import { renderTimeViewClock } from '@mui/x-date-pickers/timeViewRenderers';
10
8
  const StyledDateTimePicker = styled(MuiDateTimePicker, {
11
9
  shouldForwardProp: (propName) => propName !== 'size',
12
10
  })(({ disabled, readOnly, size }) => ({
@@ -170,13 +168,8 @@ function CustomPickerField({ error, required, helperText, size = 'small', labelM
170
168
  function CustomDatePicker({ error, required, disabled, readOnly, helperText, size = 'small', labelMargin = 5, pickTime = false, inputRef, label,
171
169
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
172
170
  orientation: _orientation, ...others }) {
173
- // MUI X v9 no longer forwards `required` to the field-slot label when the field is a Material
174
- // TextField (the legacy `slots.field` shape used here), so the required asterisk never renders.
175
- // The picker's `label` does propagate to the field via the picker context, so bake the marker
176
- // into the label to keep the required indicator visible.
177
- const displayLabel = required && typeof label === 'string' ? `${label} *` : label;
178
171
  if (pickTime) {
179
- return (_jsx(StyledDateTimePicker, { ampm: true, size: size, reduceAnimations: true, ...others, label: displayLabel, disabled: disabled, readOnly: readOnly, defaultValue: required ? new Date() : undefined, showDaysOutsideCurrentMonth: true, slotProps: {
172
+ return (_jsx(StyledDateTimePicker, { ampm: true, size: size, reduceAnimations: true, ...others, label: label, disabled: disabled, readOnly: readOnly, showDaysOutsideCurrentMonth: true, slotProps: {
180
173
  actionBar: {
181
174
  actions: ['clear', 'accept'],
182
175
  },
@@ -236,7 +229,7 @@ orientation: _orientation, ...others }) {
236
229
  } }));
237
230
  }
238
231
  else {
239
- return (_jsx(StyledDatePicker, { ...others, label: displayLabel, size: size, reduceAnimations: true, readOnly: readOnly, disabled: disabled, defaultValue: required ? new Date() : undefined, showDaysOutsideCurrentMonth: true, views: ['year', 'month', 'day'], slotProps: {
232
+ return (_jsx(StyledDatePicker, { ...others, label: label, size: size, reduceAnimations: true, readOnly: readOnly, disabled: disabled, showDaysOutsideCurrentMonth: true, views: ['year', 'month', 'day'], slotProps: {
240
233
  actionBar: {
241
234
  actions: ['clear', 'accept'],
242
235
  },
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';