@producteca/producteca-ui-kit 1.83.0 → 1.85.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/README.md CHANGED
@@ -120,6 +120,21 @@ Follow these steps to integrate and configure the `@producteca/producteca-ui-kit
120
120
  import { SelectField, CheckboxInput /* other components */ } from '@producteca/producteca-ui-kit'
121
121
  ```
122
122
 
123
+ 4. **Configure the locale (optional)**
124
+ The kit ships in Spanish by default. To render it in another language, call `configureLocale` **once, during your app bootstrap**, before rendering any component:
125
+
126
+ ```typescript
127
+ import { configureLocale } from '@producteca/producteca-ui-kit'
128
+
129
+ configureLocale('en')
130
+ ```
131
+
132
+ Supported locales: `'es'` (default), `'pt-BR'` and `'en'`.
133
+
134
+ This single call covers the kit's own strings, the day and month names of both date pickers, and the internal labels of the MUI pickers.
135
+
136
+ **The locale is read at render time and is not reactive.** Calling `configureLocale` after components have mounted will not update them — it is meant for bootstrap, not for a runtime language switcher. Keys that are missing from a non-Spanish bundle fall back to Spanish rather than showing the raw key.
137
+
123
138
  ## 📦 Publishing a New Version
124
139
 
125
140
  Package publishing is now handled automatically via a GitHub Action triggered on `push` to the `main` or `master` branches.
@@ -1,19 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { BaseSelectProps, SelectOption } from '../selectField/selectField.types';
2
+ import { SearcherProps } from './searcher.types';
3
3
 
4
- export interface SearcherProps extends BaseSelectProps {
5
- clearOnSelect?: boolean;
6
- onInputChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
7
- isLoading?: boolean;
8
- loadOptions?: (inputValue: string, callback: (options: SelectOption[]) => void) => void;
9
- cacheOptions?: boolean;
10
- defaultOptions?: boolean | SelectOption[];
11
- value?: string;
12
- input?: {
13
- value: any;
14
- onChange: (value: any) => void;
15
- onBlur: () => void;
16
- name: string;
17
- };
18
- }
19
4
  export declare const Searcher: React.FC<SearcherProps>;
5
+ export type { SearcherProps };
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ import { BaseSelectProps, SelectOption } from '../selectField/selectField.types';
3
+ import { ReduxFormInput } from '../../../hooks/useReduxFormField';
4
+ import { InputValue, Meta } from '../../../validators';
5
+
6
+ export interface SearcherProps extends BaseSelectProps {
7
+ clearOnSelect?: boolean;
8
+ onInputChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
9
+ isLoading?: boolean;
10
+ loadOptions?: (inputValue: string, callback: (options: SelectOption[]) => void) => void;
11
+ cacheOptions?: boolean;
12
+ defaultOptions?: boolean | SelectOption[];
13
+ value?: string;
14
+ input?: ReduxFormInput;
15
+ meta?: Meta;
16
+ isValid?: (value: InputValue) => boolean;
17
+ noErrors?: boolean;
18
+ }
package/dist/index.d.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
2
  export * from './styles/colors';
3
- export * from './hooks/useReduxFormField';
3
+ export * from './hooks/useReduxFormField';
4
+ export { configureLocale, getActiveLocale } from './locales/localeConfig';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './components';
2
2
  export * from './styles/colors';
3
3
  export * from './hooks/useReduxFormField';
4
+ export { configureLocale, getActiveLocale } from './locales/localeConfig';
5
+ export type { UiKitLocale, LocaleEntry } from './locales/localeRegistry';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,70 @@
1
+ declare const _default: {
2
+ a11y: {
3
+ close: string;
4
+ dialog: string;
5
+ loading: string;
6
+ moreActions: string;
7
+ navigation: string;
8
+ progress: string;
9
+ remove: string;
10
+ reorder: string;
11
+ search: string;
12
+ toggleSidebar: string;
13
+ };
14
+ addPlus: string;
15
+ asyncContent: {
16
+ errorOccurred: string;
17
+ noResultsFound: string;
18
+ retry: string;
19
+ successCompleted: string;
20
+ };
21
+ cancel: string;
22
+ conditionalOperator: {
23
+ and: string;
24
+ or: string;
25
+ };
26
+ continue: string;
27
+ copyButton: {
28
+ copied: string;
29
+ copy: string;
30
+ };
31
+ datePicker: {
32
+ selectDate: string;
33
+ selectDateTime: string;
34
+ selectTime: string;
35
+ selectYear: string;
36
+ };
37
+ guide: string;
38
+ maintenance: {
39
+ description: string;
40
+ subtitle: string;
41
+ title: string;
42
+ };
43
+ modalTitle: {
44
+ instructive: string;
45
+ };
46
+ noFoundOptions: string;
47
+ noResultsFound: string;
48
+ permissionSelector: {
49
+ ariaLabel: string;
50
+ };
51
+ permissions: {
52
+ edit: string;
53
+ noAccess: string;
54
+ read: string;
55
+ };
56
+ pickChannelModal: {
57
+ title: string;
58
+ };
59
+ previous: string;
60
+ reloadPage: string;
61
+ save: string;
62
+ selectPlaceholder: string;
63
+ selected: string;
64
+ selectedPlural: string;
65
+ warningModal: {
66
+ dontShowAgain: string;
67
+ warning: string;
68
+ };
69
+ };
70
+ export default _default;
@@ -153,6 +153,10 @@ declare const _default: {
153
153
  defaultOptions: string;
154
154
  apiSimulationDescription: string;
155
155
  apiSimulationLabel: string;
156
+ meta: string;
157
+ isValid: string;
158
+ noErrors: string;
159
+ requiredErrorDescription: string;
156
160
  };
157
161
  breadcrumb: {
158
162
  itemFormat: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { LocaleEntry, UiKitLocale } from './localeRegistry';
2
+
3
+ export declare const getActiveLocale: () => UiKitLocale;
4
+ export declare const getActiveDateLocale: () => LocaleEntry;
5
+ export declare const configureLocale: (locale: UiKitLocale) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { DayPickerLocale } from 'react-day-picker/locale';
2
+ import { PickersInputLocaleText } from '@mui/x-date-pickers';
3
+
4
+ export type UiKitLocale = 'es' | 'pt-BR' | 'en';
5
+ export interface LocaleEntry {
6
+ i18n: string;
7
+ dayjs: string;
8
+ dateFns: DayPickerLocale;
9
+ mui: PickersInputLocaleText;
10
+ }
11
+ export declare const DEFAULT_LOCALE: UiKitLocale;
12
+ export declare const LOCALE_REGISTRY: Record<UiKitLocale, LocaleEntry>;
13
+ export declare const isRegisteredLocale: (locale: string) => locale is UiKitLocale;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,70 @@
1
+ declare const _default: {
2
+ a11y: {
3
+ close: string;
4
+ dialog: string;
5
+ loading: string;
6
+ moreActions: string;
7
+ navigation: string;
8
+ progress: string;
9
+ remove: string;
10
+ reorder: string;
11
+ search: string;
12
+ toggleSidebar: string;
13
+ };
14
+ addPlus: string;
15
+ asyncContent: {
16
+ errorOccurred: string;
17
+ noResultsFound: string;
18
+ retry: string;
19
+ successCompleted: string;
20
+ };
21
+ cancel: string;
22
+ conditionalOperator: {
23
+ and: string;
24
+ or: string;
25
+ };
26
+ continue: string;
27
+ copyButton: {
28
+ copied: string;
29
+ copy: string;
30
+ };
31
+ datePicker: {
32
+ selectDate: string;
33
+ selectDateTime: string;
34
+ selectTime: string;
35
+ selectYear: string;
36
+ };
37
+ guide: string;
38
+ maintenance: {
39
+ description: string;
40
+ subtitle: string;
41
+ title: string;
42
+ };
43
+ modalTitle: {
44
+ instructive: string;
45
+ };
46
+ noFoundOptions: string;
47
+ noResultsFound: string;
48
+ permissionSelector: {
49
+ ariaLabel: string;
50
+ };
51
+ permissions: {
52
+ edit: string;
53
+ noAccess: string;
54
+ read: string;
55
+ };
56
+ pickChannelModal: {
57
+ title: string;
58
+ };
59
+ previous: string;
60
+ reloadPage: string;
61
+ save: string;
62
+ selectPlaceholder: string;
63
+ selected: string;
64
+ selectedPlural: string;
65
+ warningModal: {
66
+ dontShowAgain: string;
67
+ warning: string;
68
+ };
69
+ };
70
+ export default _default;