@rubenpazch/ui 0.16.0 → 0.17.0

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.
package/AGENTS.md CHANGED
@@ -231,11 +231,34 @@ function GuardarUsuario() {
231
231
  - `TextInput` con `maxLength` muestra un contador de caracteres. Úsalo cuando el límite importa al
232
232
  usuario, no como validación de seguridad (esa va en el servidor).
233
233
 
234
- ## Textos
234
+ ## Textos e idioma
235
235
 
236
- La interfaz va en **español**. Varios componentes reciben un objeto `labels` con todos sus textos
237
- (por ejemplo `ImageUpload`, `IdentificationInput`, `PatientDetails`, `PrescriptionCard`):
238
- pásalo siempre completo y en español.
236
+ Sin configurar nada, todos los textos de la librería están en **castellano** y los números y fechas
237
+ con formato peruano (`es-PE`). Para otro idioma, envuelve la app **una vez**:
238
+
239
+ ```tsx
240
+ import { UiLocaleProvider } from "@rubenpazch/ui";
241
+
242
+ <UiLocaleProvider locale="en">
243
+ {" "}
244
+ {/* "es" (por defecto) o "en" */}
245
+ <App />
246
+ </UiLocaleProvider>;
247
+ ```
248
+
249
+ - Cambia los textos de todos los componentes (botones, `aria-label`, mensajes, días y meses del
250
+ calendario, nombres de países) y el formato de números, fechas y orden (`en-US`).
251
+ `intlLocale="en-GB"` cambia solo el formato.
252
+ - Un texto para toda la app: `messages={{ drawer: { close: "Dismiss" } }}`.
253
+ - Un texto en un solo uso: la prop `labels` del componente (`<Drawer labels={{ close: "…" }} />`).
254
+ Gana sobre el proveedor. Basta con las claves que cambias.
255
+ - Las secciones y claves son las de `UiMessages` (tipado); los textos por defecto se ven en
256
+ `uiMessagesEs` y `uiMessagesEn`.
257
+ - Si la app usa `react-i18next` u otra librería, pasa su idioma al proveedor
258
+ (`<UiLocaleProvider locale={i18n.language.startsWith("es") ? "es" : "en"}>`), no `labels` con
259
+ `t()` en cada componente.
260
+ - Props viejas como `closeLabel`, `closeAriaLabel`, `deleteAriaLabel`, `passwordToggleLabels` u
261
+ `openCalendarLabel` siguen funcionando, pero están obsoletas: usa `labels`.
239
262
 
240
263
  ## Si falta un componente
241
264
 
package/dist/index.cjs.js CHANGED
@@ -753,6 +753,10 @@ Object.defineProperty(exports, "PHONE_COUNTRIES", {
753
753
  get: function () { return phoneInput.PHONE_COUNTRIES; }
754
754
  });
755
755
  exports.PhoneInput = phoneInput;
756
+ Object.defineProperty(exports, "countryName", {
757
+ enumerable: true,
758
+ get: function () { return phoneInput.countryName; }
759
+ });
756
760
  Object.defineProperty(exports, "formatPhone", {
757
761
  enumerable: true,
758
762
  get: function () { return phoneInput.formatPhone; }
@@ -779,10 +783,18 @@ Object.defineProperty(exports, "Select", {
779
783
  enumerable: true,
780
784
  get: function () { return select.Select; }
781
785
  });
786
+ Object.defineProperty(exports, "DEFAULT_INTL_LOCALE", {
787
+ enumerable: true,
788
+ get: function () { return shared.DEFAULT_INTL_LOCALE; }
789
+ });
782
790
  Object.defineProperty(exports, "MOBILE_QUERY", {
783
791
  enumerable: true,
784
792
  get: function () { return shared.MOBILE_QUERY; }
785
793
  });
794
+ Object.defineProperty(exports, "UiLocaleProvider", {
795
+ enumerable: true,
796
+ get: function () { return shared.UiLocaleProvider; }
797
+ });
786
798
  Object.defineProperty(exports, "classList", {
787
799
  enumerable: true,
788
800
  get: function () { return shared.classList; }
@@ -795,10 +807,18 @@ Object.defineProperty(exports, "formatLocalDate", {
795
807
  enumerable: true,
796
808
  get: function () { return shared.formatLocalDate; }
797
809
  });
810
+ Object.defineProperty(exports, "formatMessage", {
811
+ enumerable: true,
812
+ get: function () { return shared.formatMessage; }
813
+ });
798
814
  Object.defineProperty(exports, "formatMonthYear", {
799
815
  enumerable: true,
800
816
  get: function () { return shared.formatMonthYear; }
801
817
  });
818
+ Object.defineProperty(exports, "getUiMessages", {
819
+ enumerable: true,
820
+ get: function () { return shared.getUiMessages; }
821
+ });
802
822
  Object.defineProperty(exports, "isDayFirst", {
803
823
  enumerable: true,
804
824
  get: function () { return shared.isDayFirst; }
@@ -823,6 +843,14 @@ Object.defineProperty(exports, "parseLocalDate", {
823
843
  enumerable: true,
824
844
  get: function () { return shared.parseLocalDate; }
825
845
  });
846
+ Object.defineProperty(exports, "shortMonths", {
847
+ enumerable: true,
848
+ get: function () { return shared.shortMonths; }
849
+ });
850
+ Object.defineProperty(exports, "shortWeekdays", {
851
+ enumerable: true,
852
+ get: function () { return shared.shortWeekdays; }
853
+ });
826
854
  Object.defineProperty(exports, "toISODate", {
827
855
  enumerable: true,
828
856
  get: function () { return shared.toISODate; }
@@ -831,6 +859,18 @@ Object.defineProperty(exports, "toLegacySize", {
831
859
  enumerable: true,
832
860
  get: function () { return shared.toLegacySize; }
833
861
  });
862
+ Object.defineProperty(exports, "uiLocaleOf", {
863
+ enumerable: true,
864
+ get: function () { return shared.uiLocaleOf; }
865
+ });
866
+ Object.defineProperty(exports, "uiMessagesEn", {
867
+ enumerable: true,
868
+ get: function () { return shared.uiMessagesEn; }
869
+ });
870
+ Object.defineProperty(exports, "uiMessagesEs", {
871
+ enumerable: true,
872
+ get: function () { return shared.uiMessagesEs; }
873
+ });
834
874
  Object.defineProperty(exports, "useClickOutside", {
835
875
  enumerable: true,
836
876
  get: function () { return shared.useClickOutside; }
@@ -855,6 +895,14 @@ Object.defineProperty(exports, "useMediaQuery", {
855
895
  enumerable: true,
856
896
  get: function () { return shared.useMediaQuery; }
857
897
  });
898
+ Object.defineProperty(exports, "useUiLocale", {
899
+ enumerable: true,
900
+ get: function () { return shared.useUiLocale; }
901
+ });
902
+ Object.defineProperty(exports, "useUiMessages", {
903
+ enumerable: true,
904
+ get: function () { return shared.useUiMessages; }
905
+ });
858
906
  exports.Sidebar = sidebar;
859
907
  exports.Skeleton = skeleton;
860
908
  exports.Stepper = stepper;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export { default as ConfirmationDialog, ConfirmationDialogProps } from '@rubenpa
14
14
  export { default as DataTable, DataTableColumn, DataTableProps, SortDirection, SortState } from '@rubenpazch/data-table';
15
15
  export { default as DateInput, DateInputLabels, DateInputProps } from '@rubenpazch/date-input';
16
16
  export { default as DatePicker, DatePickerProps } from '@rubenpazch/date-picker';
17
- export { DEFAULT_DATE_RANGE_LABELS, DEFAULT_DATE_RANGE_PRESETS, DateRange, default as DateRangePicker, DateRangePickerLabels, DateRangePickerProps, DateRangePreset, rangoValido } from '@rubenpazch/date-range-picker';
17
+ export { DEFAULT_DATE_RANGE_LABELS, DEFAULT_DATE_RANGE_PRESETS, DateRange, default as DateRangePicker, DateRangePickerLabels, DateRangePickerProps, DateRangePreset, DateRangePresetId, rangoValido } from '@rubenpazch/date-range-picker';
18
18
  export { DescriptionItem, default as DescriptionList, DescriptionListProps } from '@rubenpazch/description-list';
19
19
  export { default as DraggableList, DraggableListProps } from '@rubenpazch/draggable-list';
20
20
  export { default as Drawer, DrawerAlign, DrawerPosition, DrawerProps, DrawerSize } from '@rubenpazch/drawer';
@@ -41,7 +41,7 @@ export { Breadcrumb, default as PageHeader, PageHeaderProps } from '@rubenpazch/
41
41
  export { Pagination, PaginationItem, PaginationItemProps, PaginationItemType, PaginationLabels, PaginationProps, PaginationShape, PaginationSize, PaginationVariant } from '@rubenpazch/pagination';
42
42
  export { default as PatientDetails } from '@rubenpazch/patient-details';
43
43
  export { default as PatientSearch } from '@rubenpazch/patient-search';
44
- export { DEFAULT_PHONE_INPUT_LABELS, PHONE_COUNTRIES, PhoneCountry, default as PhoneInput, PhoneInputLabels, PhoneInputProps, formatPhone, isValidPhone, phoneDigits } from '@rubenpazch/phone-input';
44
+ export { DEFAULT_PHONE_INPUT_LABELS, PHONE_COUNTRIES, PhoneCountry, default as PhoneInput, PhoneInputLabels, PhoneInputProps, countryName, formatPhone, isValidPhone, phoneDigits } from '@rubenpazch/phone-input';
45
45
  export { default as PinInput, PinInputProps } from '@rubenpazch/pin-input';
46
46
  export { default as PrescriptionCard } from '@rubenpazch/prescription-card';
47
47
  export { default as PrescriptionEyeCard, PrescriptionEyeCardLabels, PrescriptionEyeCardProps, PrescriptionEyeInfo } from '@rubenpazch/prescription-eye-card';
@@ -49,7 +49,7 @@ export { default as ProgressBar, ProgressBarProps } from '@rubenpazch/progress-b
49
49
  export { default as RadioButton, RadioButtonProps, RadioGroup, RadioGroupOrientation, RadioGroupProps, RadioOption, RadioSize, RadioVariant } from '@rubenpazch/radio-button';
50
50
  export { default as SegmentedControl, SegmentedControlProps, SegmentedOption } from '@rubenpazch/segmented-control';
51
51
  export { Select, SelectOption, SelectProps } from '@rubenpazch/select';
52
- export { Color, ComponentSize, FieldIds, FieldProps, LegacySize, MOBILE_QUERY, Size, SizeProp, Variant, classList, datePlaceholder, formatLocalDate, formatMonthYear, isDayFirst, isSameDay, mergeRefs, normalizeSize, parseISODate, parseLocalDate, toISODate, toLegacySize, useClickOutside, useEscapeKey, useFieldIds, useFocusTrap, useLockBodyScroll, useMediaQuery } from '@rubenpazch/shared';
52
+ export { Color, ComponentSize, DEFAULT_INTL_LOCALE, FieldIds, FieldProps, LegacySize, MOBILE_QUERY, Size, SizeProp, UiLocale, UiLocaleProvider, UiLocaleProviderProps, UiMessageSection, UiMessages, UiMessagesOverrides, Variant, classList, datePlaceholder, formatLocalDate, formatMessage, formatMonthYear, getUiMessages, isDayFirst, isSameDay, mergeRefs, normalizeSize, parseISODate, parseLocalDate, shortMonths, shortWeekdays, toISODate, toLegacySize, uiLocaleOf, uiMessagesEn, uiMessagesEs, useClickOutside, useEscapeKey, useFieldIds, useFocusTrap, useLockBodyScroll, useMediaQuery, useUiLocale, useUiMessages } from '@rubenpazch/shared';
53
53
  export { default as Sidebar, SidebarItem, SidebarLabels, SidebarProps, SidebarSection } from '@rubenpazch/sidebar';
54
54
  export { default as Skeleton, SkeletonProps } from '@rubenpazch/skeleton';
55
55
  export { default as Stepper } from '@rubenpazch/stepper';
package/dist/index.esm.js CHANGED
@@ -42,7 +42,7 @@ export { default as PageHeader } from '@rubenpazch/page-header';
42
42
  export { Pagination, PaginationItem } from '@rubenpazch/pagination';
43
43
  export { default as PatientDetails } from '@rubenpazch/patient-details';
44
44
  export { default as PatientSearch } from '@rubenpazch/patient-search';
45
- export { DEFAULT_PHONE_INPUT_LABELS, PHONE_COUNTRIES, default as PhoneInput, formatPhone, isValidPhone, phoneDigits } from '@rubenpazch/phone-input';
45
+ export { DEFAULT_PHONE_INPUT_LABELS, PHONE_COUNTRIES, default as PhoneInput, countryName, formatPhone, isValidPhone, phoneDigits } from '@rubenpazch/phone-input';
46
46
  export { default as PinInput } from '@rubenpazch/pin-input';
47
47
  export { default as PrescriptionCard } from '@rubenpazch/prescription-card';
48
48
  export { default as PrescriptionEyeCard } from '@rubenpazch/prescription-eye-card';
@@ -50,7 +50,7 @@ export { default as ProgressBar } from '@rubenpazch/progress-bar';
50
50
  export { default as RadioButton, RadioGroup } from '@rubenpazch/radio-button';
51
51
  export { default as SegmentedControl } from '@rubenpazch/segmented-control';
52
52
  export { Select } from '@rubenpazch/select';
53
- export { MOBILE_QUERY, classList, datePlaceholder, formatLocalDate, formatMonthYear, isDayFirst, isSameDay, mergeRefs, normalizeSize, parseISODate, parseLocalDate, toISODate, toLegacySize, useClickOutside, useEscapeKey, useFieldIds, useFocusTrap, useLockBodyScroll, useMediaQuery } from '@rubenpazch/shared';
53
+ export { DEFAULT_INTL_LOCALE, MOBILE_QUERY, UiLocaleProvider, classList, datePlaceholder, formatLocalDate, formatMessage, formatMonthYear, getUiMessages, isDayFirst, isSameDay, mergeRefs, normalizeSize, parseISODate, parseLocalDate, shortMonths, shortWeekdays, toISODate, toLegacySize, uiLocaleOf, uiMessagesEn, uiMessagesEs, useClickOutside, useEscapeKey, useFieldIds, useFocusTrap, useLockBodyScroll, useMediaQuery, useUiLocale, useUiMessages } from '@rubenpazch/shared';
54
54
  export { default as Sidebar } from '@rubenpazch/sidebar';
55
55
  export { default as Skeleton } from '@rubenpazch/skeleton';
56
56
  export { default as Stepper } from '@rubenpazch/stepper';