@tellescope/react-components 1.237.3 → 1.237.5

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/lib/cjs/Forms/hooks.d.ts +2 -0
  2. package/lib/cjs/Forms/hooks.d.ts.map +1 -1
  3. package/lib/cjs/Forms/inputs.d.ts +12 -12
  4. package/lib/cjs/Forms/inputs.d.ts.map +1 -1
  5. package/lib/cjs/Forms/inputs.js +73 -73
  6. package/lib/cjs/Forms/inputs.js.map +1 -1
  7. package/lib/cjs/Forms/inputs.v2.d.ts +11 -11
  8. package/lib/cjs/Forms/inputs.v2.d.ts.map +1 -1
  9. package/lib/cjs/Forms/inputs.v2.js +47 -47
  10. package/lib/cjs/Forms/inputs.v2.js.map +1 -1
  11. package/lib/cjs/Forms/localization.d.ts +2 -1
  12. package/lib/cjs/Forms/localization.d.ts.map +1 -1
  13. package/lib/cjs/Forms/localization.js +198 -61
  14. package/lib/cjs/Forms/localization.js.map +1 -1
  15. package/lib/cjs/state.d.ts +0 -4
  16. package/lib/cjs/state.d.ts.map +1 -1
  17. package/lib/cjs/state.js +2 -26
  18. package/lib/cjs/state.js.map +1 -1
  19. package/lib/esm/Forms/hooks.d.ts +2 -0
  20. package/lib/esm/Forms/hooks.d.ts.map +1 -1
  21. package/lib/esm/Forms/inputs.d.ts +12 -12
  22. package/lib/esm/Forms/inputs.d.ts.map +1 -1
  23. package/lib/esm/Forms/inputs.js +73 -73
  24. package/lib/esm/Forms/inputs.js.map +1 -1
  25. package/lib/esm/Forms/inputs.v2.d.ts +11 -11
  26. package/lib/esm/Forms/inputs.v2.d.ts.map +1 -1
  27. package/lib/esm/Forms/inputs.v2.js +47 -47
  28. package/lib/esm/Forms/inputs.v2.js.map +1 -1
  29. package/lib/esm/Forms/localization.d.ts +2 -1
  30. package/lib/esm/Forms/localization.d.ts.map +1 -1
  31. package/lib/esm/Forms/localization.js +196 -60
  32. package/lib/esm/Forms/localization.js.map +1 -1
  33. package/lib/esm/state.d.ts +0 -4
  34. package/lib/esm/state.d.ts.map +1 -1
  35. package/lib/esm/state.js +0 -23
  36. package/lib/esm/state.js.map +1 -1
  37. package/lib/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +9 -9
  39. package/src/Forms/inputs.tsx +116 -116
  40. package/src/Forms/inputs.v2.tsx +78 -79
  41. package/src/Forms/localization.ts +232 -30
  42. package/src/state.tsx +0 -30
@@ -1,38 +1,240 @@
1
- import { Form } from "@tellescope/types-client"
1
+ import { Form, AppointmentBookingPage } from "@tellescope/types-client"
2
+
3
+ const SPANISH_TRANSLATIONS: Record<string, string> = {
4
+ // Personal Information
5
+ 'First Name': 'Nombre',
6
+ 'Last Name': 'Apellido',
7
+ 'Date of Birth (MM-DD-YYYY)': 'Cumpleaños (MM-DD-AAAA)',
8
+ 'Email': 'Email',
9
+ 'Gender': 'Género',
10
+ 'Sex at Birth': 'Sexo',
11
+ 'Phone': 'Número Celular',
12
+
13
+ // Navigation
14
+ 'Next': 'Próximo',
15
+ 'Continue': 'Continuar',
16
+ 'Previous': 'Previo',
17
+ 'Submit': 'Entregar',
18
+ 'Back': 'Atrás',
19
+
20
+ // Common UI
21
+ 'Select One': 'Seleccione una',
22
+ 'Other': 'Otra',
23
+ 'Remove': 'Eliminar',
24
+ 'No results found': 'No se encontraron resultados',
25
+ 'Type to start search': 'Escriba para comenzar la búsqueda',
26
+ 'Answer here...': 'Responda aquí...',
27
+ 'Enter phone...': 'Ingrese teléfono...',
28
+ 'Enter email...': 'Ingrese correo electrónico...',
29
+ 'Enter a number...': 'Ingrese un número...',
30
+ 'Full Name': 'Nombre Completo',
31
+ 'MM-DD-YYYY': 'MM-DD-AAAA',
32
+ 'Enter your legal full name to complete the signature': 'Ingrese su nombre legal completo para completar la firma',
33
+ 'I consent to use': 'Consiento usar',
34
+ 'electronic signatures': 'firmas electrónicas',
35
+ 'View document in new tab': 'Ver documento en nueva pestaña',
36
+ 'Drag and drop to re-order the above options': 'Arrastre y suelte para reordenar las opciones anteriores',
37
+
38
+ // Address
39
+ 'Address Line 1': 'Dirección Línea 1',
40
+ 'Address Line 2': 'Dirección Línea 2',
41
+ 'City': 'Ciudad',
42
+ 'State': 'Estado',
43
+ 'ZIP Code': 'Código Postal',
44
+
45
+ // Table Input
46
+ 'Add new entry': 'Agregar nueva entrada',
47
+
48
+ // File Input
49
+ 'Select a File': 'Seleccionar un Archivo',
50
+ 'Select Files': 'Seleccionar Archivos',
51
+ 'Select file or take picture': 'Seleccionar archivo o tomar foto',
52
+ 'Select files or take pictures': 'Seleccionar archivos o tomar fotos',
53
+ 'Drop to select file': 'Soltar para seleccionar archivo',
54
+ 'Drop to select files': 'Soltar para seleccionar archivos',
55
+ 'Click or drag and drop': 'Haga clic o arrastre y suelte',
56
+
57
+ // Related Contacts
58
+ 'Relationship': 'Relación',
59
+ 'Phone Number': 'Número de Teléfono',
60
+ 'Save Contact': 'Guardar Contacto',
61
+ 'Add Contact': 'Agregar Contacto',
62
+ 'Unnamed Contact': 'Contacto Sin Nombre',
63
+
64
+ // Medications
65
+ 'Search medications...': 'Buscar medicamentos...',
66
+ 'Add Medication': 'Agregar Medicamento',
67
+ 'Remove medication': 'Eliminar medicamento',
68
+ 'Medication Name': 'Nombre del Medicamento',
69
+ 'Reason for taking medication': 'Razón para tomar el medicamento',
70
+ 'Medication instructions: how much you take, how often, and when':
71
+ 'Instrucciones del medicamento: cuánto toma, con qué frecuencia y cuándo',
72
+
73
+ // Payment
74
+ 'Make Payment': 'Realizar Pago',
75
+ 'Save Payment Details': 'Guardar Detalles de Pago',
76
+
77
+ // Appointment Booking
78
+ 'Add to Calendar': 'Agregar al Calendario',
79
+ 'Downloading...': 'Descargando...',
80
+ 'Your appointment has been booked': 'Su cita ha sido reservada',
81
+
82
+ // Allergies/Conditions
83
+ 'Search allergies...': 'Buscar alergias...',
84
+ 'Search conditions...': 'Buscar condiciones...',
85
+
86
+ // Emotii Survey
87
+ 'Please click Next or Submit to continue.':
88
+ 'Por favor haga clic en Próximo o Entregar para continuar.',
89
+
90
+ // Insurance Input
91
+ 'Insurer': 'Aseguradora',
92
+ 'Search insurer...': 'Buscar aseguradora...',
93
+ 'Member ID': 'Número de Miembro',
94
+ 'Plan Name': 'Nombre del Plan',
95
+ 'Group Number': 'Número de Grupo',
96
+ 'Plan Start Date': 'Fecha de Inicio del Plan',
97
+ 'Relationship to Policy Owner': 'Relación con el Titular de la Póliza',
98
+ 'Policy Owner Details': 'Detalles del Titular de la Póliza',
99
+ 'Cell Phone': 'Teléfono Celular',
100
+ 'Address': 'Dirección',
101
+ 'Line Two': 'Línea Dos',
102
+ 'Date of Birth': 'Fecha de Nacimiento',
103
+
104
+ // BelugaPatientPreference (Prescription fields)
105
+ 'Strength': 'Concentración',
106
+ 'Dispense Unit': 'Unidad de Dispensación',
107
+ 'Quantity': 'Cantidad',
108
+ 'Refills': 'Recargas',
109
+ 'Days Supply': 'Días de Suministro',
110
+ 'Sig (Instructions)': 'Sig (Instrucciones)',
111
+ 'Med ID (NDC11)': 'ID del Medicamento (NDC11)',
112
+
113
+ // Medications Search
114
+ 'Search': 'Buscar',
115
+ 'Drug Select': 'Seleccionar Medicamento',
116
+ 'Other Drug': 'Otro Medicamento',
117
+
118
+ // Height Input
119
+ 'Feet': 'Pies',
120
+ 'Inches': 'Pulgadas',
121
+
122
+ // Allergies Input
123
+ 'Severity': 'Gravedad',
124
+ 'Note': 'Nota',
125
+
126
+ // Bridge Eligibility
127
+ 'Check Provider Eligibility (Free)': 'Verificar Elegibilidad del Proveedor (Gratis)',
128
+ 'Checking...': 'Verificando...',
129
+ 'Check Service Eligibility (Paid)': 'Verificar Elegibilidad del Servicio (Pagado)',
130
+ 'Polling...': 'Consultando...',
131
+ 'Initiating...': 'Iniciando...',
132
+ 'Polling for results... (this may take 15-30 seconds)': 'Consultando resultados... (esto puede tardar 15-30 segundos)',
133
+
134
+ // Other UI
135
+ 'ZIP+4': 'Código Postal+4',
136
+ 'ZIP + 4': 'Código Postal + 4',
137
+ 'None': 'Ninguno',
138
+ 'No booking page specified': 'No se especificó página de reserva',
139
+ 'Try Again': 'Intentar de Nuevo',
140
+ 'Loading...': 'Cargando...',
141
+ 'No input choices available': 'No hay opciones de entrada disponibles',
142
+ 'Loading product information...': 'Cargando información del producto...',
143
+ 'No eligible users found for booking': 'No se encontraron usuarios elegibles para la reserva',
144
+ }
2
145
 
3
146
  export const form_display_text_for_language = (form: Pick<Form, 'language'> | undefined, text: string, placeholder?: string) => {
4
147
  if (!form) return text
5
148
 
6
149
  if (form.language === 'Spanish' || form.language === 'Español') {
7
- if (text === 'First Name') { return "Nombre" }
8
- if (text === 'Last Name') { return "Apellido" }
9
- if (text === 'Date of Birth (MM-DD-YYYY)') { return "Cumpleaños (MM-DD-AAAA)" }
10
- if (text === 'Email') {
11
- return "Email"
12
- // return "Correo Electrónico"
13
- }
14
- if (text === 'Gender') { return "Género" }
15
- if (text === 'Sex at Birth') { return "Sexo" }
16
-
17
- if (text === 'Phone') { return "Número Celular" }
18
- if (text === 'State') { return "Estado" }
19
-
20
- if (text === 'Next') { return "Próximo" }
21
- if (text === 'Continue') { return "Continuar" }
22
- if (text === 'Previous') { return "Previo" }
23
- if (text === 'Submit') { return "Entregar" }
24
-
25
- if (text === 'Select One') { return "Seleccione una" }
26
- if (text === 'Other') { return "Otra" }
27
-
28
- if (text === 'Address Line 1') { return "Dirección Línea 1" }
29
- if (text === 'Address Line 2') { return "Dirección Línea 2" }
30
- if (text === 'City') { return "Ciudad" }
31
- if (text === 'State') { return "Estado" }
32
- if (text === 'ZIP Code') { return "Código Postal" }
33
-
34
- if (typeof placeholder === 'string') { return placeholder }
150
+ const translation = SPANISH_TRANSLATIONS[text]
151
+ if (translation) return translation
152
+ if (typeof placeholder === 'string') return placeholder
153
+ }
154
+
155
+ return text
156
+ }
157
+
158
+ const SPANISH_BOOKING_TRANSLATIONS: Record<string, string> = {
159
+ // Event Selection
160
+ 'What would you like to schedule?': '¿Qué desea programar?',
161
+ 'Minute Appointment': 'Minutos de Cita',
162
+
163
+ // Calendar/Time Selection
164
+ 'Pick a date and time for your visit': 'Seleccione fecha y hora para su visita',
165
+ 'Select a visit time:': 'Seleccione una hora:',
166
+ 'No appointments are available at this date': 'No hay citas disponibles en esta fecha',
167
+ 'Loading...': 'Cargando...',
168
+ 'Location': 'Ubicación',
169
+ 'Timezone': 'Zona Horaria',
170
+ 'Event Type': 'Tipo de Evento',
171
+ 'Back': 'Atrás',
172
+ 'Back to host selection': 'Volver a selección de anfitrión',
173
+ 'Scroll down to view more times': 'Desplácese hacia abajo para ver más horarios',
174
+ 'Tap and scroll down to view more times': 'Toque y desplácese hacia abajo para ver más horarios',
175
+ 'No valid appointment hosts found': 'No se encontraron anfitriones válidos',
176
+ 'Your care team must be assigned before booking this appointment type': 'Su equipo de atención debe ser asignado antes de reservar este tipo de cita',
177
+ 'No users found': 'No se encontraron usuarios',
178
+ 'of': 'de',
179
+ 'Booking': 'Reservando',
180
+
181
+ // Intake Form
182
+ 'Enter your contact information': 'Ingrese su información de contacto',
183
+ 'First Name': 'Nombre',
184
+ 'Last Name': 'Apellido',
185
+ 'Phone': 'Número Celular',
186
+ 'Email': 'Email',
187
+ 'Birth Date': 'Fecha de Nacimiento',
188
+ 'MM-DD-YYYY': 'MM-DD-AAAA',
189
+ 'State': 'Estado',
190
+ 'Next': 'Próximo',
191
+
192
+ // Validation messages
193
+ 'First name is required': 'Nombre es requerido',
194
+ 'Last name is required': 'Apellido es requerido',
195
+ 'Email is required': 'Email es requerido',
196
+ 'Must be a valid email': 'Debe ser un email válido',
197
+ 'State is required': 'Estado es requerido',
198
+
199
+ // Confirmation
200
+ 'Confirm your appointment': 'Confirme su cita',
201
+ 'Reason for Appointment': 'Razón de la Cita',
202
+ 'I agree to the': 'Acepto los',
203
+ 'Confirm': 'Confirmar',
204
+ 'for this appointment': 'por esta cita',
205
+
206
+ // Thank You
207
+ 'Appointment Confirmed': 'Cita Confirmada',
208
+ 'Check your email for next steps': 'Revise su correo para los próximos pasos',
209
+ 'Add to Calendar': 'Agregar al Calendario',
210
+ 'Add to Google Calendar': 'Agregar a Google Calendar',
211
+ 'Downloading...': 'Descargando...',
212
+ 'Opening...': 'Abriendo...',
213
+
214
+ // State Selection
215
+ 'Which state are you a resident of?': '¿En qué estado reside?',
216
+ 'Save': 'Guardar',
217
+ 'Saving...': 'Guardando...',
218
+
219
+ // Errors
220
+ 'This link has expired': 'Este enlace ha expirado',
221
+ 'This link is invalid': 'Este enlace no es válido',
222
+
223
+ // Payment
224
+ 'Your payment details have been saved!': '¡Sus datos de pago han sido guardados!',
225
+ 'Save Payment Details': 'Guardar Datos de Pago',
226
+ }
227
+
228
+ export const booking_display_text_for_language = (
229
+ bookingPage: Pick<AppointmentBookingPage, 'language'> | undefined,
230
+ text: string,
231
+ placeholder?: string
232
+ ) => {
233
+ if (!bookingPage) return text
234
+
235
+ if (bookingPage.language === 'Spanish' || bookingPage.language === 'Español') {
236
+ return SPANISH_BOOKING_TRANSLATIONS[text] ?? placeholder ?? text
35
237
  }
36
238
 
37
239
  return text
38
- }
240
+ }
package/src/state.tsx CHANGED
@@ -2328,36 +2328,6 @@ export const useManagedContentRecordAssignments = (options={} as HookOptions<Man
2328
2328
  {...options}
2329
2329
  )
2330
2330
  }
2331
- export const useAssignedManagedContentRecords = () => {
2332
- const session = useEnduserSession()
2333
-
2334
- const [, { filtered }] = useManagedContentRecords()
2335
- const [eventsLoading] = useCalendarEvents()
2336
-
2337
- const [assignmentsLoading] = useManagedContentRecordAssignments()
2338
-
2339
- if (!value_is_loaded(assignmentsLoading)) return {
2340
- status: assignmentsLoading.status,
2341
- value: undefined
2342
- } as LoadedData<ManagedContentRecord[]>
2343
-
2344
- const recordsLoading = filtered(r =>
2345
- r.assignmentType === 'All'
2346
- || r.enduserId === session.userInfo.id
2347
- || !!assignmentsLoading.value.find(e => e.contentId === r.id)
2348
- || (
2349
- r.assignmentType === 'By Tags'
2350
- && r.tags?.length
2351
- && !!r.tags.find(t => session.userInfo.tags?.includes(t))
2352
- )
2353
- || (
2354
- value_is_loaded(eventsLoading)
2355
- && !!eventsLoading.value.find(e => e.sharedContentIds?.includes(r.id))
2356
- )
2357
- )
2358
-
2359
- return recordsLoading
2360
- }
2361
2331
 
2362
2332
  export const useForums = (options={} as HookOptions<Forum>) => {
2363
2333
  const session = useResolvedSession()