@majoo-ui/react 2.4.9 → 3.0.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.
Files changed (83) hide show
  1. package/components/alertDialog/AlertDialog.esm.js +45 -3
  2. package/components/alertDialog/locale.esm.js +2 -9
  3. package/components/avatar/Avatar.esm.js +14 -1
  4. package/components/banner/Banner.esm.js +47 -8
  5. package/components/buttonGroup/ButtonGroup.esm.js +39 -2
  6. package/components/datePicker/CustomDatePicker.esm.js +28 -14
  7. package/components/datePicker/InputDatePicker.esm.js +1 -3
  8. package/components/datePicker/locale.esm.js +8 -47
  9. package/components/drawer/Drawer.esm.js +26 -2
  10. package/components/dropdownMenu/DropdownMenu.esm.js +25 -2
  11. package/components/form/components/FormGroup/FormGroup.esm.js +12 -1
  12. package/components/form/components/FormHelper/Helper.esm.js +10 -1
  13. package/components/form/components/FormLabel/Label.esm.js +15 -1
  14. package/components/form/components/InputCheckbox/CheckboxGroup.esm.js +11 -1
  15. package/components/form/components/InputCounter/InputCounter.esm.js +4 -1
  16. package/components/form/components/InputCreatable/InputCreatable.esm.js +17 -1
  17. package/components/form/components/InputCreatable/locale.esm.js +2 -8
  18. package/components/form/components/InputDateRange/locale.esm.js +2 -5
  19. package/components/form/components/InputGroup/InputGroup.esm.js +13 -1
  20. package/components/form/components/InputOTP/locale.esm.js +2 -5
  21. package/components/form/components/InputRadio/InputRadio.esm.js +20 -2
  22. package/components/form/components/InputRadio/InputRadioGroup.esm.js +15 -1
  23. package/components/form/components/InputResourceList/locale.esm.js +2 -14
  24. package/components/form/components/InputSearchbox/locale.esm.js +2 -6
  25. package/components/form/components/InputSelect/InputSelect.esm.js +48 -16
  26. package/components/form/components/InputSelect/locale.esm.js +2 -11
  27. package/components/form/components/InputSelectCheck/InputSelectCheck.esm.js +58 -3
  28. package/components/form/components/InputSelectCheck/locale.esm.js +5 -14
  29. package/components/form/components/InputSelectTag/InputSelectTag.esm.js +6 -1
  30. package/components/form/components/InputSignature/locale.esm.js +2 -13
  31. package/components/form/components/InputSwitch/InputSwitch.esm.js +15 -1
  32. package/components/form/components/InputSwitch/InputSwitchWithImage.esm.js +19 -1
  33. package/components/form/components/InputTags/InputTags.esm.js +24 -1
  34. package/components/form/components/InputTextArea/InputTextArea.esm.js +16 -1
  35. package/components/image/locale.esm.js +2 -5
  36. package/components/notificationBadge/NotificationBadge.esm.js +14 -1
  37. package/components/pagination/Pagination.esm.js +26 -1
  38. package/components/paper/Paper.esm.js +14 -1
  39. package/components/periodSelect/locale.esm.js +2 -12
  40. package/components/popover/Popover.esm.js +41 -4
  41. package/components/progress/Progress.esm.js +16 -1
  42. package/components/slider/Slider.esm.js +24 -1
  43. package/components/table/Table.esm.js +4 -13
  44. package/components/table/components/columns/DateColumn.esm.js +2 -1
  45. package/components/table/locale.esm.js +4 -47
  46. package/components/tableOfContent/TableOfContent.esm.js +4 -0
  47. package/components/tabs/Tabs.esm.js +45 -4
  48. package/components/tagList/locale.esm.js +2 -10
  49. package/components/tagStatus/TagStatus.esm.js +14 -1
  50. package/components/toast/context/ToastProvider.esm.js +9 -1
  51. package/components/toast/context/locale.esm.js +2 -9
  52. package/components/upload/Upload.esm.js +50 -1
  53. package/config/locale/LocaleContext.esm.js +2 -8
  54. package/config/locale/useLocaleText.esm.js +4 -12
  55. package/index.esm.css +4 -4
  56. package/layout/grid/Grid.esm.js +29 -3
  57. package/layout/pageContainer/PageContainer.esm.js +12 -1
  58. package/majoo-provider/MajooProvider.esm.js +43 -13
  59. package/package.json +2 -4
  60. package/src/components/alertDialog/locale.d.ts +1 -1
  61. package/src/components/datePicker/CustomDatePicker.d.ts +12 -1
  62. package/src/components/datePicker/InputDatePicker.d.ts +10 -10
  63. package/src/components/datePicker/components/CalendarMulti.d.ts +1 -2
  64. package/src/components/datePicker/locale.d.ts +1 -2
  65. package/src/components/editableTable/EditableTable.d.ts +1 -0
  66. package/src/components/form/components/InputCounter/InputCounter.d.ts +1 -1
  67. package/src/components/form/components/InputCreatable/locale.d.ts +1 -2
  68. package/src/components/form/components/InputDateRange/InputDateRange.d.ts +2 -2
  69. package/src/components/form/components/InputDateRange/locale.d.ts +1 -1
  70. package/src/components/form/components/InputOTP/locale.d.ts +1 -1
  71. package/src/components/form/components/InputResourceList/locale.d.ts +1 -2
  72. package/src/components/form/components/InputSearchbox/locale.d.ts +1 -2
  73. package/src/components/form/components/InputSelect/locale.d.ts +1 -2
  74. package/src/components/form/components/InputSelectCheck/locale.d.ts +1 -2
  75. package/src/components/form/components/InputSignature/locale.d.ts +1 -2
  76. package/src/components/image/locale.d.ts +1 -1
  77. package/src/components/periodSelect/PeriodSelect.d.ts +1 -2
  78. package/src/components/periodSelect/locale.d.ts +1 -2
  79. package/src/components/table/locale.d.ts +2 -4
  80. package/src/components/tagList/locale.d.ts +1 -1
  81. package/src/components/toast/context/locale.d.ts +1 -1
  82. package/src/config/locale/LocaleContext.d.ts +1 -1
  83. package/src/config/locale/useLocaleText.d.ts +3 -3
@@ -189,7 +189,20 @@ const GridComponent = styled('div', {
189
189
  }
190
190
  }
191
191
  });
192
- const Grid = ({
192
+ const Grid = (
193
+ /**
194
+ * @type {{
195
+ * children?: import('react').ReactNode,
196
+ * autoColumns?: string | number,
197
+ * autoRows?: string | number,
198
+ * autoFlow?: string,
199
+ * templateColumns?: string,
200
+ * templateRows?: string,
201
+ * css?: object,
202
+ * [key: string]: any,
203
+ * }}
204
+ */
205
+ {
193
206
  children,
194
207
  ...props
195
208
  }) => {
@@ -249,7 +262,20 @@ const GridItemComponent = styled('div', {
249
262
  }
250
263
  }
251
264
  });
252
- const GridItem = ({
265
+ const GridItem = (
266
+ /**
267
+ * @type {{
268
+ * children?: import('react').ReactNode,
269
+ * area?: string | number,
270
+ * colStart?: string | number,
271
+ * colEnd?: string | number,
272
+ * rowStart?: string | number,
273
+ * rowEnd?: string | number,
274
+ * css?: object,
275
+ * [key: string]: any,
276
+ * }}
277
+ */
278
+ {
253
279
  children,
254
280
  ...props
255
281
  }) => {
@@ -276,7 +302,7 @@ const GridItem = ({
276
302
  });
277
303
  };
278
304
  GridItem.propTypes = {
279
- gridArea: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
305
+ area: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
280
306
  colSpan: PropTypes.number,
281
307
  rowSpan: PropTypes.number,
282
308
  colStart: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
@@ -38,7 +38,18 @@ const StyledDiv = styled(Flex, {
38
38
  }
39
39
  }
40
40
  });
41
- const PageContainer = ({
41
+ const PageContainer = (
42
+ /**
43
+ * @type {{
44
+ * children?: import('react').ReactNode,
45
+ * isCollapse?: boolean,
46
+ * isLoading?: boolean,
47
+ * css?: object,
48
+ * contentHeader?: import('react').ReactNode,
49
+ * [key: string]: any,
50
+ * }}
51
+ */
52
+ {
42
53
  children,
43
54
  isCollapse,
44
55
  isLoading: _isLoading,
@@ -1,29 +1,58 @@
1
- import 'react';
1
+ import React__default from 'react';
2
2
  import ThemeProvider from './ThemeProvider.esm.js';
3
3
  import { applyGlobalStyles } from './globalStyles.esm.js';
4
4
  import { theme } from '../config/stitches.config.esm.js';
5
5
  import PropTypes from 'prop-types';
6
- import { useTranslation } from 'react-i18next';
7
6
  import moment from 'moment';
8
7
  import { LocaleTextContext } from '../config/locale/LocaleTextContext.esm.js';
9
8
  import { LocaleContext } from '../config/locale/LocaleContext.esm.js';
10
9
  import { jsx } from 'react/jsx-runtime';
11
10
 
12
- const EMPTY_LOCALE_TEXT = {};
13
- function MajooProvider({
11
+ function MajooProvider(
12
+ /**
13
+ * @type {{
14
+ * name?: string,
15
+ * theme?: object,
16
+ * children: import('react').ReactNode,
17
+ * extendStyle?: object,
18
+ * disableGlobalStyle?: boolean,
19
+ * locale?: string,
20
+ * localeText?: {
21
+ * alertDialog?: object,
22
+ * datePicker?: object,
23
+ * image?: object,
24
+ * inputCreatable?: object,
25
+ * inputDateRange?: object,
26
+ * inputOtp?: object,
27
+ * inputResourceList?: object,
28
+ * inputSearchbox?: object,
29
+ * inputSelect?: object,
30
+ * inputSelectCheck?: object,
31
+ * inputSignature?: object,
32
+ * periodSelect?: object,
33
+ * table?: object,
34
+ * tagList?: object,
35
+ * toast?: object,
36
+ * },
37
+ * }}
38
+ */
39
+ {
14
40
  children,
15
41
  name,
16
42
  theme: theme$1 = theme,
17
43
  extendStyle,
18
44
  disableGlobalStyle,
19
- locale,
20
- localeText = EMPTY_LOCALE_TEXT
45
+ locale: ownLocale,
46
+ localeText: ownLocaleText
21
47
  }) {
48
+ // Left unset, both come from an enclosing MajooProvider. DevicePreview renders its preview inside
49
+ // one, which would otherwise switch the app-wide moment locale to `id`.
50
+ const enclosingLocale = React__default.useContext(LocaleContext);
51
+ const enclosingLocaleText = React__default.useContext(LocaleTextContext);
52
+ const locale = ownLocale || enclosingLocale;
53
+ const localeText = ownLocaleText || enclosingLocaleText;
22
54
  !disableGlobalStyle && applyGlobalStyles(extendStyle, theme$1);
23
- const {
24
- i18n
25
- } = useTranslation();
26
- moment.locale(locale || i18n && i18n.language || 'id');
55
+ moment.locale(locale || 'id');
27
56
  return /*#__PURE__*/jsx(ThemeProvider, {
28
57
  name: name,
29
58
  theme: theme$1,
@@ -43,13 +72,14 @@ MajooProvider.propTypes = {
43
72
  extendStyle: PropTypes.object,
44
73
  disableGlobalStyle: PropTypes.bool,
45
74
  /**
46
- * Language of the components, e.g. `en` or `en-US`. Unset, the app's i18next language is used,
47
- * then `id`. Also sets the `moment` locale.
75
+ * Language of the components, e.g. `en` or `en-US`. Unset, an enclosing `MajooProvider`'s is used,
76
+ * else `id`. Also sets the `moment` locale.
48
77
  */
49
78
  locale: PropTypes.string,
50
79
  /**
51
80
  * Component texts for the whole app, e.g. `{ table: { emptyDataTitle: 'No data' } }`.
52
- * Memoize it: every new object re-renders all components that read it.
81
+ * Memoize it: every new object re-renders all components that read it. Unset, an enclosing
82
+ * `MajooProvider`'s is used.
53
83
  */
54
84
  localeText: PropTypes.shape({
55
85
  alertDialog: PropTypes.object,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majoo-ui/react",
3
- "version": "2.4.9",
3
+ "version": "3.0.0",
4
4
  "main": "./index.esm.js",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -37,7 +37,7 @@
37
37
  "@floating-ui/react": "^0.19.2",
38
38
  "@majoo-ui/core": "1.32.0",
39
39
  "@majoo-ui/helpers": "1.30.10",
40
- "@majoo-ui/icons": "1.40.5",
40
+ "@majoo-ui/icons": "1.41.0",
41
41
  "@monsonjeremy/react-leaflet": "^3.2.2",
42
42
  "@radix-ui/react-accordion": "^1.0.0",
43
43
  "@radix-ui/react-alert-dialog": "^1.0.3",
@@ -62,7 +62,6 @@
62
62
  "dayzed": "^3.2.3",
63
63
  "downshift": "^6.1.7",
64
64
  "draft-js": "^0.11.7",
65
- "i18next": "^22.0.8",
66
65
  "leaflet": "1.9.3",
67
66
  "leaflet-defaulticon-compatibility": "^0.1.2",
68
67
  "lodash": "^4.17.21",
@@ -73,7 +72,6 @@
73
72
  "react-color": "^2.19.3",
74
73
  "react-draft-wysiwyg": "^1.15.0",
75
74
  "react-hook-form": "^7.31.3",
76
- "react-i18next": "^12.0.0",
77
75
  "react-image-crop": "^10.0.4",
78
76
  "react-infinite-scroller": "^1.2.6",
79
77
  "react-loading-skeleton": "^3.1.0",
@@ -5,6 +5,6 @@ export interface AlertDialogLocaleText {
5
5
  export declare const defaultAlertDialogLocaleText: AlertDialogLocaleText;
6
6
  /**
7
7
  * Resolves the alert dialog texts. Precedence: the dialog's own `localeText`, then `MajooProvider`'s
8
- * `localeText.alertDialog`, then the app's `translation` keys, then the Indonesian defaults.
8
+ * `localeText.alertDialog`, then the Indonesian defaults.
9
9
  */
10
10
  export declare const useAlertDialogLocaleText: (localeText?: Partial<AlertDialogLocaleText>) => AlertDialogLocaleText;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { ADVANCE_PICKER, RANGE_PICKER, SINGLE_PICKER, DATE_RANGE_PICKER } from './DatePicker';
3
3
  import { PopoverPlacement } from '../../type/base.types';
4
+ import { DatePickerLocaleText } from './locale';
4
5
  export interface CustomDatePickerProps {
5
6
  children: React.ReactElement<any>;
6
7
  /**
@@ -59,5 +60,15 @@ export interface CustomDatePickerProps {
59
60
  * Specify distance between the children and DatePicker.
60
61
  */
61
62
  sideOffset?: number;
63
+ /**
64
+ * Language of the month and weekday names and the picked dates. Falls back to `MajooProvider`'s
65
+ * `locale`, then `id`.
66
+ */
67
+ locale?: string;
68
+ /**
69
+ * Texts of this date picker. Keys left unset fall back to `MajooProvider`'s `localeText.datePicker`,
70
+ * then to the Indonesian defaults (`defaultDatePickerLocaleText`).
71
+ */
72
+ localeText?: Partial<DatePickerLocaleText>;
62
73
  }
63
- export declare function CustomDatePicker({ children, type, disabled, onChange, defaultValue: defaultDateValue, value: dateValue, defaultDate, date, advanceView, placement, showTimePicker, minDate, maxDate, allowReset, sideOffset, }: CustomDatePickerProps): JSX.Element;
74
+ export declare function CustomDatePicker({ children, type, disabled, onChange, defaultValue: defaultDateValue, value: dateValue, defaultDate, date, advanceView, placement, showTimePicker, minDate, maxDate, allowReset, sideOffset, locale, localeText, }: CustomDatePickerProps): JSX.Element;
@@ -7,39 +7,39 @@ interface TimePickerProps {
7
7
  /**
8
8
  Resize time picker.
9
9
  */
10
- size: 'sm' | 'lg';
10
+ size?: 'sm' | 'lg';
11
11
  /**
12
12
  Change handler.
13
13
  */
14
- onChange: () => void;
14
+ onChange?: () => void;
15
15
  /**
16
16
  Time picker default value; support moment format.
17
17
  */
18
- defaultValue: Date;
18
+ defaultValue?: Date;
19
19
  /**
20
20
  Time picker value; support moment format.
21
21
  */
22
- value: Date;
22
+ value?: Date;
23
23
  /**
24
24
  Disabled state.
25
25
  */
26
- disabled: boolean;
26
+ disabled?: boolean;
27
27
  /**
28
28
  Disabled hour state.
29
29
  */
30
- disabledHour: boolean;
30
+ disabledHour?: boolean;
31
31
  /**
32
32
  Disabled minute state.
33
33
  */
34
- disabledMinute: boolean;
34
+ disabledMinute?: boolean;
35
35
  /**
36
36
  Specify the minimum date.
37
37
  */
38
- minDate: Date;
38
+ minDate?: Date;
39
39
  /**
40
40
  Specify the maximum date.
41
41
  */
42
- maxDate: Date;
42
+ maxDate?: Date;
43
43
  }
44
44
  export interface InputDatePickerProps {
45
45
  /**
@@ -177,7 +177,7 @@ export interface InputDatePickerProps {
177
177
  monthRangeHelper?: React.ReactNode;
178
178
  /**
179
179
  * Language of the month and weekday names and the picked dates. Falls back to `MajooProvider`'s
180
- * `locale`, then the app's i18next language, then `id`.
180
+ * `locale`, then `id`.
181
181
  */
182
182
  locale?: string;
183
183
  /**
@@ -17,8 +17,7 @@ export interface CalendarProps extends RenderProps {
17
17
  maxDate?: Date;
18
18
  disabledDate?: Date[];
19
19
  /**
20
- * Language of the month and weekday names. Falls back to `MajooProvider`'s `locale`, then the
21
- * app's i18next language, then `id`.
20
+ * Language of the month and weekday names. Falls back to `MajooProvider`'s `locale`, then `id`.
22
21
  */
23
22
  locale?: string;
24
23
  }
@@ -37,12 +37,11 @@ export interface DatePickerLocaleText {
37
37
  nextYearLabel: string;
38
38
  }
39
39
  export declare const defaultDatePickerLocaleText: DatePickerLocaleText;
40
- export declare const i18nDatePickerLocaleText: (t: any, locale: MajooLocale) => DatePickerLocaleText;
41
40
  /** Later sources win; an `undefined` value never erases an earlier one. */
42
41
  export declare const mergeDatePickerLocaleText: (base: DatePickerLocaleText, ...overrides: (Partial<DatePickerLocaleText> | undefined)[]) => DatePickerLocaleText;
43
42
  /**
44
43
  * Resolves the date picker texts. Precedence: the component's own `localeText`, then `MajooProvider`'s
45
- * `localeText.datePicker`, then the app's `MajooUI/datePicker` translations, then the Indonesian defaults.
44
+ * `localeText.datePicker`, then the defaults (Indonesian, except the quick range and month range texts for `en`).
46
45
  */
47
46
  export declare const useDatePickerLocaleText: (locale: MajooLocale, localeText?: Partial<DatePickerLocaleText>) => DatePickerLocaleText;
48
47
  /** The quick range options with their labels taken from the resolved texts. */
@@ -96,6 +96,7 @@ interface EditableTableProps<Data extends object> {
96
96
  localeText?: Partial<TableLocaleText>;
97
97
  }
98
98
  interface RemoveProps {
99
+ css?: CSS;
99
100
  position?: 'leftBottom' | 'rightBottom' | 'leftTop' | 'rightTop';
100
101
  onRemove?: React.ChangeEventHandler;
101
102
  }
@@ -8,7 +8,7 @@ interface CounterProps {
8
8
  /**
9
9
  * Input counter size.
10
10
  */
11
- size: 'sm' | 'md' | 'lg';
11
+ size?: 'sm' | 'md' | 'lg';
12
12
  /**
13
13
  * Change event handler.
14
14
  */
@@ -7,7 +7,6 @@ export interface InputCreatableLocaleText {
7
7
  export declare const defaultInputCreatableLocaleText: InputCreatableLocaleText;
8
8
  /**
9
9
  * Resolves the creatable input texts. Precedence: the input's own `localeText`, then `MajooProvider`'s
10
- * `localeText.inputCreatable`, then the app's `MajooUI/inputCreatable` translations, then the Indonesian
11
- * defaults.
10
+ * `localeText.inputCreatable`, then the Indonesian defaults.
12
11
  */
13
12
  export declare const useInputCreatableLocaleText: (localeText?: Partial<InputCreatableLocaleText>) => InputCreatableLocaleText;
@@ -37,8 +37,8 @@ interface InputDateRangeProps extends InputSelectProps {
37
37
  */
38
38
  css?: CSS;
39
39
  /**
40
- * Language the quick range labels follow while the transition lasts (`en` keeps the English ones).
41
- * Falls back to `MajooProvider`'s `locale`, then the app's i18next language, then `id`.
40
+ * Language the quick range labels follow (`en` defaults to the English ones). Falls back to
41
+ * `MajooProvider`'s `locale`, then `id`.
42
42
  */
43
43
  locale?: string;
44
44
  /**
@@ -5,6 +5,6 @@ export interface InputDateRangeLocaleText {
5
5
  export declare const defaultInputDateRangeLocaleText: InputDateRangeLocaleText;
6
6
  /**
7
7
  * Resolves the date range select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
8
- * `localeText.inputDateRange`, then the app's `translation` keys, then the Indonesian defaults.
8
+ * `localeText.inputDateRange`, then the Indonesian defaults.
9
9
  */
10
10
  export declare const useInputDateRangeLocaleText: (localeText?: Partial<InputDateRangeLocaleText>) => InputDateRangeLocaleText;
@@ -5,6 +5,6 @@ export interface InputOtpLocaleText {
5
5
  export declare const defaultInputOtpLocaleText: InputOtpLocaleText;
6
6
  /**
7
7
  * Resolves the OTP texts. Precedence: the component's own `localeText`, then `MajooProvider`'s
8
- * `localeText.inputOtp`, then the app's `MajooUI/inputOtp` translations, then the Indonesian defaults.
8
+ * `localeText.inputOtp`, then the Indonesian defaults.
9
9
  */
10
10
  export declare const useInputOtpLocaleText: (localeText?: Partial<InputOtpLocaleText>) => InputOtpLocaleText;
@@ -11,7 +11,6 @@ export interface InputResourceListLocaleText {
11
11
  export declare const defaultInputResourceListLocaleText: InputResourceListLocaleText;
12
12
  /**
13
13
  * Resolves the resource list texts. Precedence: the list's own `localeText`, then `MajooProvider`'s
14
- * `localeText.inputResourceList`, then the app's `MajooUI/inputResourceList` translations, then the
15
- * Indonesian defaults.
14
+ * `localeText.inputResourceList`, then the Indonesian defaults.
16
15
  */
17
16
  export declare const useInputResourceListLocaleText: (localeText?: Partial<InputResourceListLocaleText>) => InputResourceListLocaleText;
@@ -5,7 +5,6 @@ export interface InputSearchboxLocaleText {
5
5
  export declare const defaultInputSearchboxLocaleText: InputSearchboxLocaleText;
6
6
  /**
7
7
  * Resolves the search box texts. Precedence: the search box's own `localeText`, then `MajooProvider`'s
8
- * `localeText.inputSearchbox`, then the app's `MajooUI/inputSearchbox` translations, then the Indonesian
9
- * defaults.
8
+ * `localeText.inputSearchbox`, then the Indonesian defaults.
10
9
  */
11
10
  export declare const useInputSearchboxLocaleText: (localeText?: Partial<InputSearchboxLocaleText>) => InputSearchboxLocaleText;
@@ -9,7 +9,6 @@ export interface InputSelectLocaleText {
9
9
  export declare const defaultInputSelectLocaleText: InputSelectLocaleText;
10
10
  /**
11
11
  * Resolves the select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
12
- * `localeText.inputSelect`, then the app's `MajooUI/inputSelect` translations, then the Indonesian
13
- * defaults.
12
+ * `localeText.inputSelect`, then the Indonesian defaults.
14
13
  */
15
14
  export declare const useInputSelectLocaleText: (localeText?: Partial<InputSelectLocaleText>) => InputSelectLocaleText;
@@ -14,7 +14,6 @@ export interface InputSelectCheckLocaleText {
14
14
  export declare const defaultInputSelectCheckLocaleText: InputSelectCheckLocaleText;
15
15
  /**
16
16
  * Resolves the multi-select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
17
- * `localeText.inputSelectCheck`, then the app's `MajooUI/inputSelectCheck` translations, then the
18
- * Indonesian defaults.
17
+ * `localeText.inputSelectCheck`, then the defaults (Indonesian, except `selectAllLabel` for `en`).
19
18
  */
20
19
  export declare const useInputSelectCheckLocaleText: (localeText?: Partial<InputSelectCheckLocaleText>, locale?: string) => InputSelectCheckLocaleText;
@@ -10,7 +10,6 @@ export interface InputSignatureLocaleText {
10
10
  export declare const defaultInputSignatureLocaleText: InputSignatureLocaleText;
11
11
  /**
12
12
  * Resolves the signature input texts. Precedence: the input's own `localeText`, then `MajooProvider`'s
13
- * `localeText.inputSignature`, then the app's `MajooUI/inputSignature` translations, then the Indonesian
14
- * defaults.
13
+ * `localeText.inputSignature`, then the Indonesian defaults.
15
14
  */
16
15
  export declare const useInputSignatureLocaleText: (localeText?: Partial<InputSignatureLocaleText>) => InputSignatureLocaleText;
@@ -5,6 +5,6 @@ export interface ImageLocaleText {
5
5
  export declare const defaultImageLocaleText: ImageLocaleText;
6
6
  /**
7
7
  * Resolves the image texts. Precedence: the image's own `localeText`, then `MajooProvider`'s
8
- * `localeText.image`, then the app's `translation` keys, then the Indonesian defaults.
8
+ * `localeText.image`, then the Indonesian defaults.
9
9
  */
10
10
  export declare const useImageLocaleText: (localeText?: Partial<ImageLocaleText>) => ImageLocaleText;
@@ -73,8 +73,7 @@ export interface PeriodSelectProps {
73
73
  */
74
74
  css?: CSS;
75
75
  /**
76
- * Language of the weekday names. Falls back to `MajooProvider`'s `locale`, then the app's i18next
77
- * language, then `id`.
76
+ * Language of the weekday names. Falls back to `MajooProvider`'s `locale`, then `id`.
78
77
  */
79
78
  locale?: string;
80
79
  /**
@@ -9,7 +9,6 @@ export interface PeriodSelectLocaleText {
9
9
  export declare const defaultPeriodSelectLocaleText: PeriodSelectLocaleText;
10
10
  /**
11
11
  * Resolves the period select texts. Precedence: the select's own `localeText`, then `MajooProvider`'s
12
- * `localeText.periodSelect`, then the app's `MajooUI/periodSelect` translations, then the Indonesian
13
- * defaults.
12
+ * `localeText.periodSelect`, then the Indonesian defaults.
14
13
  */
15
14
  export declare const usePeriodSelectLocaleText: (localeText?: Partial<PeriodSelectLocaleText>) => PeriodSelectLocaleText;
@@ -29,12 +29,10 @@ export interface TableLocaleText {
29
29
  pagination: PaginationLabel;
30
30
  }
31
31
  export declare const defaultTableLocaleText: TableLocaleText;
32
- export declare const i18nTableLocaleText: (t: any) => TableLocaleText;
33
32
  /** Later sources win; an `undefined` value never erases an earlier one. */
34
33
  export declare const mergeTableLocaleText: (base: TableLocaleText, ...overrides: (Partial<TableLocaleText> | undefined)[]) => TableLocaleText;
35
34
  /**
36
35
  * Resolves the table texts. Precedence: the table's own `localeText`, then `MajooProvider`'s
37
- * `localeText.table`, then the app's `MajooUI/table` translations, then the Indonesian defaults.
38
- * Several table-level overrides may be passed; later ones win. Pass the same number on every render.
36
+ * `localeText.table`, then the Indonesian defaults.
39
37
  */
40
- export declare const useTableLocaleText: (...localeTexts: (Partial<TableLocaleText> | undefined)[]) => TableLocaleText;
38
+ export declare const useTableLocaleText: (localeText?: Partial<TableLocaleText>) => TableLocaleText;
@@ -8,6 +8,6 @@ export interface TagListLocaleText {
8
8
  export declare const defaultTagListLocaleText: TagListLocaleText;
9
9
  /**
10
10
  * Resolves the tag list texts. Precedence: the list's own `localeText`, then `MajooProvider`'s
11
- * `localeText.tagList`, then the app's `MajooUI/inputSelectCheck` translations, then the Indonesian defaults.
11
+ * `localeText.tagList`, then the Indonesian defaults.
12
12
  */
13
13
  export declare const useTagListLocaleText: (localeText?: Partial<TagListLocaleText>) => TagListLocaleText;
@@ -6,6 +6,6 @@ export interface ToastLocaleText {
6
6
  export declare const defaultToastLocaleText: ToastLocaleText;
7
7
  /**
8
8
  * Resolves the toast texts. Precedence: `ToastProvider`'s own `localeText`, then `MajooProvider`'s
9
- * `localeText.toast`, then the app's `MajooUI/toast` translations, then the Indonesian defaults.
9
+ * `localeText.toast`, then the Indonesian defaults.
10
10
  */
11
11
  export declare const useToastLocaleText: (localeText?: Partial<ToastLocaleText>) => ToastLocaleText;
@@ -8,6 +8,6 @@ export declare const LocaleContext: React.Context<string | undefined>;
8
8
  export declare const normalizeLocale: (locale?: string | null) => MajooLocale;
9
9
  /**
10
10
  * Resolves the language. Precedence: the component's own `locale`, then `MajooProvider`'s `locale`,
11
- * then the app's i18next language, then `id`.
11
+ * then `id`.
12
12
  */
13
13
  export declare const useLocale: (locale?: string) => MajooLocale;
@@ -4,7 +4,7 @@ import { MajooLocale } from './LocaleContext';
4
4
  export declare const mergeLocaleText: <T extends object>(base: T, ...overrides: (Partial<T> | undefined)[]) => T;
5
5
  /**
6
6
  * Resolves the flat texts of a component. Precedence: the component's own `localeText`, then
7
- * `MajooProvider`'s `localeText[key]`, then the app's i18next translations, then the defaults that
8
- * `fromI18n` falls back to.
7
+ * `MajooProvider`'s `localeText[key]`, then `defaults`. Pass `defaults` as a function of the resolved
8
+ * language when some default texts differ per language.
9
9
  */
10
- export declare const useLocaleText: <T extends object>(key: keyof MajooLocaleText, namespaces: string | string[], fromI18n: (t, locale: MajooLocale) => T, localeText?: Partial<T>, locale?: string) => T;
10
+ export declare const useLocaleText: <T extends object>(key: keyof MajooLocaleText, defaults: T | ((locale: MajooLocale) => T), localeText?: Partial<T>, locale?: string) => T;