cozy-ui 134.2.0 → 135.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 (119) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +4 -2
  3. package/react/ActionsBar/index.jsx +1 -1
  4. package/react/ActionsBar/locales/withActionsLocales.jsx +2 -1
  5. package/react/ActionsMenu/Actions/locales/withActionsLocales.jsx +2 -2
  6. package/react/ActionsMenu/ActionsItems.jsx +1 -1
  7. package/react/ActionsMenu/ActionsMenuButton.jsx +1 -1
  8. package/react/CozyDialogs/DialogBackButton.jsx +1 -1
  9. package/react/CozyDialogs/DialogCloseButton.jsx +1 -1
  10. package/react/CozyDialogs/SpecificDialogs/AllowLocationDialog.jsx +1 -1
  11. package/react/CozyDialogs/SpecificDialogs/InstallFlagshipAppDialog.jsx +1 -1
  12. package/react/CozyDialogs/SpecificDialogs/ShortcutDialog.jsx +1 -1
  13. package/react/CozyDialogs/SpecificDialogs/withSpecificDialogsLocales.jsx +2 -1
  14. package/react/DateMonthPicker/Readme.md +1 -1
  15. package/react/DateMonthPicker/index.jsx +1 -1
  16. package/react/DateMonthPicker/index.spec.jsx +1 -1
  17. package/react/DatePicker/index.jsx +1 -1
  18. package/react/DatePicker/locales/withOwnLocales.jsx +2 -1
  19. package/react/EditBadge/EditMenu.jsx +1 -1
  20. package/react/Labs/PasswordInput/index.jsx +1 -1
  21. package/react/Nav/index.jsx +1 -1
  22. package/react/Nav/locales/withNavLocales.jsx +2 -1
  23. package/react/PasswordField/index.jsx +1 -2
  24. package/react/SearchBar/index.jsx +1 -1
  25. package/react/SearchBar/locales/withOnlyLocales.jsx +2 -1
  26. package/react/SelectionBar/SelectionBarAction.jsx +1 -1
  27. package/react/SelectionBar/SelectionBarMore.jsx +1 -1
  28. package/react/SelectionBar/index.jsx +1 -1
  29. package/react/Spinner/Readme.md +1 -1
  30. package/react/Spinner/index.jsx +1 -1
  31. package/react/Table/Virtualized/Dnd/TableRow.jsx +1 -2
  32. package/react/Wizard/index.jsx +1 -1
  33. package/react/deprecated/ActionMenu/Actions/ActionsItems.jsx +1 -1
  34. package/react/deprecated/ActionMenu/Actions/call.js +1 -1
  35. package/react/deprecated/ActionMenu/Actions/emailTo.js +1 -1
  36. package/react/deprecated/ActionMenu/Actions/locales/withActionsLocales.jsx +2 -1
  37. package/react/deprecated/ActionMenu/Actions/smsTo.js +1 -1
  38. package/react/hooks/useConfirmExit/index.jsx +1 -1
  39. package/react/index.js +0 -1
  40. package/react/jestLib/I18n.js +1 -1
  41. package/react/providers/DemoProvider.jsx +1 -1
  42. package/transpiled/react/ActionsBar/index.js +1 -1
  43. package/transpiled/react/ActionsBar/locales/withActionsLocales.js +1 -1
  44. package/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales.d.ts +1 -1
  45. package/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales.js +1 -2
  46. package/transpiled/react/ActionsMenu/ActionsItems.js +1 -1
  47. package/transpiled/react/ActionsMenu/ActionsMenuButton.js +1 -1
  48. package/transpiled/react/CozyDialogs/DialogBackButton.js +1 -1
  49. package/transpiled/react/CozyDialogs/DialogCloseButton.js +1 -1
  50. package/transpiled/react/CozyDialogs/SpecificDialogs/AllowLocationDialog.js +1 -1
  51. package/transpiled/react/CozyDialogs/SpecificDialogs/InstallFlagshipAppDialog.js +1 -1
  52. package/transpiled/react/CozyDialogs/SpecificDialogs/ShortcutDialog.js +1 -1
  53. package/transpiled/react/CozyDialogs/SpecificDialogs/withSpecificDialogsLocales.js +1 -1
  54. package/transpiled/react/DateMonthPicker/index.js +1 -1
  55. package/transpiled/react/DatePicker/index.js +1 -1
  56. package/transpiled/react/DatePicker/locales/withOwnLocales.js +1 -1
  57. package/transpiled/react/EditBadge/EditMenu.js +1 -1
  58. package/transpiled/react/Labs/PasswordInput/index.js +1 -1
  59. package/transpiled/react/Nav/index.js +1 -1
  60. package/transpiled/react/Nav/locales/withNavLocales.js +1 -1
  61. package/transpiled/react/PasswordField/index.js +1 -2
  62. package/transpiled/react/SearchBar/index.js +1 -1
  63. package/transpiled/react/SearchBar/locales/withOnlyLocales.js +1 -1
  64. package/transpiled/react/SelectionBar/SelectionBarAction.js +1 -1
  65. package/transpiled/react/SelectionBar/SelectionBarMore.js +1 -1
  66. package/transpiled/react/SelectionBar/index.js +1 -1
  67. package/transpiled/react/Spinner/index.js +1 -1
  68. package/transpiled/react/Table/Virtualized/Dnd/TableRow.js +1 -1
  69. package/transpiled/react/Wizard/index.js +1 -1
  70. package/transpiled/react/deprecated/ActionMenu/Actions/ActionsItems.js +1 -1
  71. package/transpiled/react/deprecated/ActionMenu/Actions/call.js +1 -1
  72. package/transpiled/react/deprecated/ActionMenu/Actions/emailTo.js +1 -1
  73. package/transpiled/react/deprecated/ActionMenu/Actions/locales/withActionsLocales.js +1 -1
  74. package/transpiled/react/deprecated/ActionMenu/Actions/smsTo.js +1 -1
  75. package/transpiled/react/hooks/useConfirmExit/index.js +1 -1
  76. package/transpiled/react/index.d.ts +0 -1
  77. package/transpiled/react/index.js +0 -1
  78. package/transpiled/react/jestLib/I18n.d.ts +1 -1
  79. package/transpiled/react/jestLib/I18n.js +1 -1
  80. package/transpiled/react/providers/DemoProvider.js +1 -1
  81. package/react/I18n/index.js +0 -25
  82. package/react/I18n/withLocales.js +0 -14
  83. package/react/providers/I18n/createUseI18n.jsx +0 -32
  84. package/react/providers/I18n/format.jsx +0 -62
  85. package/react/providers/I18n/format.spec.jsx +0 -73
  86. package/react/providers/I18n/helpers.js +0 -33
  87. package/react/providers/I18n/index.jsx +0 -107
  88. package/react/providers/I18n/index.spec.jsx +0 -135
  89. package/react/providers/I18n/translate.jsx +0 -28
  90. package/react/providers/I18n/translation.jsx +0 -42
  91. package/react/providers/I18n/useExtendI18n.jsx +0 -37
  92. package/react/providers/I18n/withLocales.jsx +0 -47
  93. package/react/providers/I18n/withLocales.spec.jsx +0 -58
  94. package/react/providers/I18n/withOnlyLocales.jsx +0 -38
  95. package/transpiled/react/I18n/index.d.ts +0 -3
  96. package/transpiled/react/I18n/index.js +0 -16
  97. package/transpiled/react/I18n/withLocales.d.ts +0 -2
  98. package/transpiled/react/I18n/withLocales.js +0 -10
  99. package/transpiled/react/providers/I18n/createUseI18n.d.ts +0 -6
  100. package/transpiled/react/providers/I18n/createUseI18n.js +0 -39
  101. package/transpiled/react/providers/I18n/format.d.ts +0 -3
  102. package/transpiled/react/providers/I18n/format.js +0 -72
  103. package/transpiled/react/providers/I18n/format.spec.d.ts +0 -1
  104. package/transpiled/react/providers/I18n/helpers.d.ts +0 -5
  105. package/transpiled/react/providers/I18n/helpers.js +0 -35
  106. package/transpiled/react/providers/I18n/index.d.ts +0 -62
  107. package/transpiled/react/providers/I18n/index.js +0 -132
  108. package/transpiled/react/providers/I18n/index.spec.d.ts +0 -1
  109. package/transpiled/react/providers/I18n/translate.d.ts +0 -3
  110. package/transpiled/react/providers/I18n/translate.js +0 -21
  111. package/transpiled/react/providers/I18n/translation.d.ts +0 -3
  112. package/transpiled/react/providers/I18n/translation.js +0 -40
  113. package/transpiled/react/providers/I18n/useExtendI18n.d.ts +0 -7
  114. package/transpiled/react/providers/I18n/useExtendI18n.js +0 -42
  115. package/transpiled/react/providers/I18n/withLocales.d.ts +0 -8
  116. package/transpiled/react/providers/I18n/withLocales.js +0 -69
  117. package/transpiled/react/providers/I18n/withLocales.spec.d.ts +0 -1
  118. package/transpiled/react/providers/I18n/withOnlyLocales.d.ts +0 -8
  119. package/transpiled/react/providers/I18n/withOnlyLocales.js +0 -39
@@ -1,12 +1,12 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { useState, useRef } from 'react';
3
+ import { useI18n, useExtendI18n } from 'twake-i18n';
3
4
  import ActionsMenu from "cozy-ui/transpiled/react/ActionsMenu";
4
5
  import { locales } from "cozy-ui/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales";
5
6
  import Icon from "cozy-ui/transpiled/react/Icon";
6
7
  import IconButton from "cozy-ui/transpiled/react/IconButton";
7
8
  import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots";
8
9
  import ListItemIcon from "cozy-ui/transpiled/react/ListItemIcon";
9
- import { useI18n, useExtendI18n } from "cozy-ui/transpiled/react/providers/I18n";
10
10
 
11
11
  var ActionsMenuButton = function ActionsMenuButton(_ref) {
12
12
  var docs = _ref.docs,
@@ -3,6 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["onClick"];
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
+ import { createUseI18n } from 'twake-i18n';
6
7
  import locales from "cozy-ui/transpiled/react/CozyDialogs/locales";
7
8
  var styles = {
8
9
  "DialogCloseButton": "styles__DialogCloseButton___cxKPO",
@@ -11,7 +12,6 @@ var styles = {
11
12
  import Icon from "cozy-ui/transpiled/react/Icon";
12
13
  import IconButton from "cozy-ui/transpiled/react/IconButton";
13
14
  import PreviousIcon from "cozy-ui/transpiled/react/Icons/Previous";
14
- import { createUseI18n } from "cozy-ui/transpiled/react/providers/I18n";
15
15
  var useI18n = createUseI18n(locales);
16
16
 
17
17
  var DialogBackButton = function DialogBackButton(_ref) {
@@ -3,6 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["onClick"];
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
+ import { createUseI18n } from 'twake-i18n';
6
7
  import locales from "cozy-ui/transpiled/react/CozyDialogs/locales";
7
8
  var styles = {
8
9
  "DialogCloseButton": "styles__DialogCloseButton___cxKPO",
@@ -11,7 +12,6 @@ var styles = {
11
12
  import Icon from "cozy-ui/transpiled/react/Icon";
12
13
  import IconButton from "cozy-ui/transpiled/react/IconButton";
13
14
  import CrossMediumIcon from "cozy-ui/transpiled/react/Icons/CrossMedium";
14
- import { createUseI18n } from "cozy-ui/transpiled/react/providers/I18n";
15
15
  var useI18n = createUseI18n(locales);
16
16
 
17
17
  var CloseButton = function CloseButton(_ref) {
@@ -1,12 +1,12 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { forwardRef } from 'react';
3
+ import { useI18n } from 'twake-i18n';
3
4
  import CozyLocation from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/icons/CozyLocation";
4
5
  import withSpecificDialogsLocales from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/withSpecificDialogsLocales";
5
6
  import { IllustrationDialog } from "cozy-ui/transpiled/react/CozyDialogs";
6
7
  import Button from "cozy-ui/transpiled/react/Buttons";
7
8
  import Icon from "cozy-ui/transpiled/react/Icon";
8
9
  import Typography from "cozy-ui/transpiled/react/Typography";
9
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
10
10
 
11
11
  var createStyles = function createStyles() {
12
12
  return {
@@ -1,5 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { forwardRef } from 'react';
3
+ import { useI18n } from 'twake-i18n';
3
4
  import DefaultQRCode from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/icons/QRCodeInstallFlagshipAppDialog.png";
4
5
  import appStoreIcon from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/icons/appstore.png";
5
6
  import playStoreIcon from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/icons/playstore.png";
@@ -7,7 +8,6 @@ import withSpecificDialogsLocales from "cozy-ui/transpiled/react/CozyDialogs/Spe
7
8
  import { IllustrationDialog } from "cozy-ui/transpiled/react/CozyDialogs";
8
9
  import Link from "cozy-ui/transpiled/react/Link";
9
10
  import Typography from "cozy-ui/transpiled/react/Typography";
10
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
11
11
  var InstallFlagshipAppDialog = /*#__PURE__*/forwardRef(function (_ref, ref) {
12
12
  var onClose = _ref.onClose,
13
13
  playStoreUrl = _ref.playStoreUrl,
@@ -1,6 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { useState } from 'react';
4
+ import { useI18n } from 'twake-i18n';
4
5
  import { checkAndSaveShortcut, makeHumanReadableFileName } from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/helpers/shortcuts";
5
6
  import withSpecificDialogsLocales from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/withSpecificDialogsLocales";
6
7
  import { ConfirmDialog } from "cozy-ui/transpiled/react/CozyDialogs";
@@ -8,7 +9,6 @@ import Button from "cozy-ui/transpiled/react/Buttons";
8
9
  import Stack from "cozy-ui/transpiled/react/Stack";
9
10
  import TextField from "cozy-ui/transpiled/react/TextField";
10
11
  import { useAlert } from "cozy-ui/transpiled/react/providers/Alert";
11
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
12
12
  var ENTER_KEY = 13;
13
13
 
14
14
  var ShortcutDialog = function ShortcutDialog(_ref) {
@@ -1,3 +1,4 @@
1
+ import { withOnlyLocales } from 'twake-i18n';
1
2
  var en = {
2
3
  cancel: "Cancel",
3
4
  allow: "Allow",
@@ -162,7 +163,6 @@ var vi = {
162
163
  "url-bad-format": "URL \u0111\xE3 nh\u1EADp kh\xF4ng \u0111\xFAng \u0111\u1ECBnh d\u1EA1ng"
163
164
  }
164
165
  };
165
- import withOnlyLocales from "cozy-ui/transpiled/react/providers/I18n/withOnlyLocales";
166
166
  export var locales = {
167
167
  en: en,
168
168
  fr: fr,
@@ -4,6 +4,7 @@ import format from 'date-fns/format';
4
4
  import range from 'lodash/range';
5
5
  import PropTypes from 'prop-types';
6
6
  import React, { useState } from 'react';
7
+ import { useI18n } from 'twake-i18n';
7
8
  var styles = {
8
9
  "DateMonthPicker__YearControls": "styles__DateMonthPicker__YearControls___1DGlB",
9
10
  "DateMonthPicker__YearButton": "styles__DateMonthPicker__YearButton___3zNDK",
@@ -15,7 +16,6 @@ var styles = {
15
16
  import Icon from "cozy-ui/transpiled/react/Icon";
16
17
  import LeftIcon from "cozy-ui/transpiled/react/Icons/Left";
17
18
  import RightIcon from "cozy-ui/transpiled/react/Icons/Right";
18
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
19
19
 
20
20
  var MonthButton = function MonthButton(_ref) {
21
21
  var monthNum = _ref.monthNum,
@@ -18,10 +18,10 @@ import LocaleFR from 'date-fns/locale/fr';
18
18
  import subDays from 'date-fns/subDays';
19
19
  import PropTypes from 'prop-types';
20
20
  import React, { forwardRef, useState } from 'react';
21
+ import { useI18n } from 'twake-i18n';
21
22
  import { makeFormat } from "cozy-ui/transpiled/react/DatePicker/helpers";
22
23
  import withOwnLocales from "cozy-ui/transpiled/react/DatePicker/locales/withOwnLocales";
23
24
  import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
24
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
25
25
  import { makeStyles } from "cozy-ui/transpiled/react/styles";
26
26
  var localesFNS = {
27
27
  fr: LocaleFR,
@@ -1,3 +1,4 @@
1
+ import { withOnlyLocales } from 'twake-i18n';
1
2
  var en = {
2
3
  cancel: "Cancel",
3
4
  clear: "Clear",
@@ -30,7 +31,6 @@ var vi = {
30
31
  today: "H\xF4m nay",
31
32
  minDateLabelError: "Ng\xE0y kh\xF4ng \u0111\u01B0\u1EE3c tr\u01B0\u1EDBc ng\xE0y t\u1ED1i thi\u1EC3u (%{date})"
32
33
  };
33
- import withOnlyLocales from "cozy-ui/transpiled/react/providers/I18n/withOnlyLocales";
34
34
  export var locales = {
35
35
  en: en,
36
36
  fr: fr,
@@ -1,4 +1,5 @@
1
1
  import React, { useRef } from 'react';
2
+ import { useI18n, useExtendI18n } from 'twake-i18n';
2
3
  import { handleDelete, handleUpload } from "cozy-ui/transpiled/react/EditBadge/helpers";
3
4
  import { locales } from "cozy-ui/transpiled/react/EditBadge/locales";
4
5
  import Icon from "cozy-ui/transpiled/react/Icon";
@@ -9,7 +10,6 @@ import ListItemText from "cozy-ui/transpiled/react/ListItemText";
9
10
  import Menu from "cozy-ui/transpiled/react/Menu";
10
11
  import MenuItem from "cozy-ui/transpiled/react/MenuItem";
11
12
  import { useAlert } from "cozy-ui/transpiled/react/providers/Alert";
12
- import { useI18n, useExtendI18n } from "cozy-ui/transpiled/react/providers/I18n";
13
13
 
14
14
  var EditMenu = function EditMenu(_ref) {
15
15
  var anchorRef = _ref.anchorRef,
@@ -20,8 +20,8 @@ var styles = {
20
20
  import Icon from "cozy-ui/transpiled/react/Icon";
21
21
  import EyeIcon from "cozy-ui/transpiled/react/Icons/Eye";
22
22
  import EyeClosedIcon from "cozy-ui/transpiled/react/Icons/EyeClosed";
23
- import Input from "cozy-ui/transpiled/react/legacy/Input";
24
23
  import InputGroup from "cozy-ui/transpiled/react/InputGroup";
24
+ import Input from "cozy-ui/transpiled/react/legacy/Input";
25
25
 
26
26
  var HideShowButton = function HideShowButton(props) {
27
27
  var hidden = props.hidden,
@@ -11,6 +11,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
11
11
 
12
12
  import cx from 'classnames';
13
13
  import React, { Children, isValidElement, useState, forwardRef } from 'react';
14
+ import { useI18n } from 'twake-i18n';
14
15
  import withNavLocales from "cozy-ui/transpiled/react/Nav/locales/withNavLocales";
15
16
  var styles = {
16
17
  "c-nav": "styles__c-nav___33dZy",
@@ -28,7 +29,6 @@ import BottomIcon from "cozy-ui/transpiled/react/Icons/Bottom";
28
29
  import TopIcon from "cozy-ui/transpiled/react/Icons/Top";
29
30
  import ListItem from "cozy-ui/transpiled/react/ListItem";
30
31
  import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
31
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
32
32
  export var NavItem = function NavItem(_ref) {
33
33
  var className = _ref.className,
34
34
  children = _ref.children,
@@ -1,3 +1,4 @@
1
+ import { withOnlyLocales } from 'twake-i18n';
1
2
  var en = {
2
3
  navLimiter: {
3
4
  showMore: "Show More",
@@ -22,7 +23,6 @@ var vi = {
22
23
  showLess: "Hi\u1EC7n \xEDt h\u01A1n"
23
24
  }
24
25
  };
25
- import withOnlyLocales from "cozy-ui/transpiled/react/providers/I18n/withOnlyLocales";
26
26
  export var locales = {
27
27
  en: en,
28
28
  fr: fr,
@@ -7,6 +7,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
7
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
8
 
9
9
  import React, { useState } from 'react';
10
+ import { useI18n, withOnlyLocales } from 'twake-i18n';
10
11
  var en = {
11
12
  "password-field": {
12
13
  show: "Show password",
@@ -37,8 +38,6 @@ import EyeIcon from "cozy-ui/transpiled/react/Icons/Eye";
37
38
  import EyeClosedIcon from "cozy-ui/transpiled/react/Icons/EyeClosed";
38
39
  import InputAdornment from "cozy-ui/transpiled/react/InputAdornment";
39
40
  import TextField from "cozy-ui/transpiled/react/TextField";
40
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
41
- import withOnlyLocales from "cozy-ui/transpiled/react/providers/I18n/withOnlyLocales";
42
41
  export var locales = {
43
42
  en: en,
44
43
  fr: fr,
@@ -12,6 +12,7 @@ import cx from 'classnames';
12
12
  import debounce from 'lodash/debounce';
13
13
  import PropTypes from 'prop-types';
14
14
  import React, { forwardRef, useState, useMemo } from 'react';
15
+ import { useI18n, useExtendI18n } from 'twake-i18n';
15
16
  import { locales } from "cozy-ui/transpiled/react/SearchBar/locales/withOnlyLocales";
16
17
  import ButtonBase from "cozy-ui/transpiled/react/ButtonBase";
17
18
  import Icon from "cozy-ui/transpiled/react/Icon";
@@ -22,7 +23,6 @@ import MagnifierIcon from "cozy-ui/transpiled/react/Icons/Magnifier";
22
23
  import InputBase from "cozy-ui/transpiled/react/InputBase";
23
24
  import Paper from "cozy-ui/transpiled/react/Paper";
24
25
  import Typography from "cozy-ui/transpiled/react/Typography";
25
- import { useI18n, useExtendI18n } from "cozy-ui/transpiled/react/providers/I18n";
26
26
  import { makeStyles } from "cozy-ui/transpiled/react/styles";
27
27
  var sizeToPixel = {
28
28
  small: 40,
@@ -1,3 +1,4 @@
1
+ import { withOnlyLocales } from 'twake-i18n';
1
2
  var en = {
2
3
  SearchBar: {
3
4
  placeholder: "Search"
@@ -18,7 +19,6 @@ var vi = {
18
19
  placeholder: "T\xECm ki\u1EBFm"
19
20
  }
20
21
  };
21
- import withOnlyLocales from "cozy-ui/transpiled/react/providers/I18n/withOnlyLocales";
22
22
  export var locales = {
23
23
  en: en,
24
24
  fr: fr,
@@ -1,6 +1,7 @@
1
1
  import cx from 'classnames';
2
2
  import PropTypes from 'prop-types';
3
3
  import React from 'react';
4
+ import { useI18n } from 'twake-i18n';
4
5
  var styles = {
5
6
  "SelectionBar": "styles__SelectionBar___3UOqy",
6
7
  "SelectionBar-count": "styles__SelectionBar-count___1e2yD",
@@ -13,7 +14,6 @@ import Button from "cozy-ui/transpiled/react/Button";
13
14
  import Icon from "cozy-ui/transpiled/react/Icon";
14
15
  import IconButton from "cozy-ui/transpiled/react/IconButton";
15
16
  import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
16
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
17
17
 
18
18
  var SelectionBarAction = function SelectionBarAction(_ref) {
19
19
  var selectedCount = _ref.selectedCount,
@@ -1,6 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { useState, useRef } from 'react';
4
+ import { useI18n } from 'twake-i18n';
4
5
  var styles = {
5
6
  "SelectionBar": "styles__SelectionBar___3UOqy",
6
7
  "SelectionBar-count": "styles__SelectionBar-count___1e2yD",
@@ -13,7 +14,6 @@ import Icon from "cozy-ui/transpiled/react/Icon";
13
14
  import IconButton from "cozy-ui/transpiled/react/IconButton";
14
15
  import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots";
15
16
  import { ActionMenuWithClose, ActionMenuItem } from "cozy-ui/transpiled/react/deprecated/ActionMenu";
16
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
17
17
 
18
18
  var SelectionBarMore = function SelectionBarMore(_ref) {
19
19
  var actions = _ref.actions,
@@ -7,6 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
  import { useTheme } from '@material-ui/core';
8
8
  import PropTypes from 'prop-types';
9
9
  import React, { useEffect } from 'react';
10
+ import { useI18n } from 'twake-i18n';
10
11
  import { useWebviewIntent } from 'cozy-intent';
11
12
  import SelectionBarAction from "cozy-ui/transpiled/react/SelectionBar/SelectionBarAction";
12
13
  import SelectionBarMore from "cozy-ui/transpiled/react/SelectionBar/SelectionBarMore";
@@ -23,7 +24,6 @@ import Icon from "cozy-ui/transpiled/react/Icon";
23
24
  import IconButton from "cozy-ui/transpiled/react/IconButton";
24
25
  import CrossIcon from "cozy-ui/transpiled/react/Icons/Cross";
25
26
  import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
26
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
27
27
  /*
28
28
 
29
29
  If you want use SelectionBar component, you must have `actions` parameter, like :
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import cx from 'classnames';
3
3
  import PropTypes from 'prop-types';
4
4
  import React from 'react';
5
+ import { translate } from 'twake-i18n';
5
6
  var styles = {
6
7
  "c-spinner": "styles__c-spinner___1snK7",
7
8
  "c-spinner--middle": "styles__c-spinner--middle___RwyII",
@@ -12,7 +13,6 @@ var styles = {
12
13
  import Icon from "cozy-ui/transpiled/react/Icon";
13
14
  import SpinnerIcon from "cozy-ui/transpiled/react/Icons/Spinner";
14
15
  import Typography from "cozy-ui/transpiled/react/Typography";
15
- import { translate } from "cozy-ui/transpiled/react/providers/I18n";
16
16
  export var Spinner = function Spinner(_ref) {
17
17
  var _cx;
18
18
 
@@ -4,8 +4,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
5
  var _excluded = ["item", "context", "componentsProps"];
6
6
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
- import React, { useEffect } from 'react';
8
7
  import cx from 'classnames';
8
+ import React, { useEffect } from 'react';
9
9
  import { useDrag, useDrop } from 'react-dnd';
10
10
  import { getEmptyImage } from 'react-dnd-html5-backend';
11
11
  import TableRowClassic from "cozy-ui/transpiled/react/TableRow";
@@ -46,9 +46,9 @@ var styles = {
46
46
  };
47
47
  import Icon from "cozy-ui/transpiled/react/Icon";
48
48
  import CloudIcon from "cozy-ui/transpiled/react/Icons/Cloud";
49
- import Input from "cozy-ui/transpiled/react/legacy/Input";
50
49
  import Typography from "cozy-ui/transpiled/react/Typography";
51
50
  import Button from "cozy-ui/transpiled/react/deprecated/Button";
51
+ import Input from "cozy-ui/transpiled/react/legacy/Input";
52
52
  export var Wizard = function Wizard(_ref) {
53
53
  var children = _ref.children,
54
54
  tag = _ref.tag,
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useMemo } from 'react';
3
+ import { useI18n } from 'twake-i18n';
3
4
  import { getActionName, getOnlyNeededActions } from "cozy-ui/transpiled/react/deprecated/ActionMenu/Actions/helpers";
4
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
5
5
 
6
6
  var ActionsItems = function ActionsItems(_ref) {
7
7
  var doc = _ref.doc,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
+ import { useI18n } from 'twake-i18n';
2
3
  import withActionsLocales from "cozy-ui/transpiled/react/deprecated/ActionMenu/Actions/locales/withActionsLocales";
3
4
  import TelephoneIcon from "cozy-ui/transpiled/react/Icons/Telephone";
4
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
5
5
  import ActionMenuItemWrapper from "cozy-ui/transpiled/react/deprecated/ActionMenu/ActionMenuItemWrapper";
6
6
  export var call = function call() {
7
7
  return {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
+ import { useI18n } from 'twake-i18n';
2
3
  import withActionsLocales from "cozy-ui/transpiled/react/deprecated/ActionMenu/Actions/locales/withActionsLocales";
3
4
  import EmailIcon from "cozy-ui/transpiled/react/Icons/Email";
4
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
5
5
  import ActionMenuItemWrapper from "cozy-ui/transpiled/react/deprecated/ActionMenu/ActionMenuItemWrapper";
6
6
  export var emailTo = function emailTo() {
7
7
  return {
@@ -1,3 +1,4 @@
1
+ import { withLocales } from 'twake-i18n';
1
2
  var en = {
2
3
  viewInContacts: "View in Cozy Contacts",
3
4
  modify: "Modify",
@@ -30,7 +31,6 @@ var vi = {
30
31
  print: "In",
31
32
  call: "G\u1ECDi"
32
33
  };
33
- import withLocales from "cozy-ui/transpiled/react/providers/I18n/withLocales";
34
34
  export var locales = {
35
35
  en: en,
36
36
  fr: fr,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
+ import { useI18n } from 'twake-i18n';
2
3
  import withActionsLocales from "cozy-ui/transpiled/react/deprecated/ActionMenu/Actions/locales/withActionsLocales";
3
4
  import CommentIcon from "cozy-ui/transpiled/react/Icons/Comment";
4
- import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
5
5
  import ActionMenuItemWrapper from "cozy-ui/transpiled/react/deprecated/ActionMenu/ActionMenuItemWrapper";
6
6
  export var smsTo = function smsTo() {
7
7
  return {
@@ -1,6 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { useCallback, useRef, useState } from 'react';
4
+ import { withLocales } from 'twake-i18n';
4
5
  var en = {
5
6
  useConfirmExit: {
6
7
  back: "Cancel",
@@ -35,7 +36,6 @@ var vi = {
35
36
  };
36
37
  import { ConfirmDialog } from "cozy-ui/transpiled/react/CozyDialogs";
37
38
  import Button from "cozy-ui/transpiled/react/deprecated/Button";
38
- import withLocales from "cozy-ui/transpiled/react/providers/I18n/withLocales";
39
39
  import useEventListener from "cozy-ui/transpiled/react/hooks/useEventListener";
40
40
  /**
41
41
  * Confirmation modal
@@ -81,7 +81,6 @@ export { default as ActionsBar } from "./ActionsBar";
81
81
  export { default as Markdown } from "./Markdown";
82
82
  export { default as DatePicker } from "./DatePicker";
83
83
  export { Button, ButtonLink } from "./deprecated/Button";
84
- export { default as I18n, translate, useI18n } from "./providers/I18n";
85
84
  export { default as Nav, NavItem, NavIcon, NavText, NavDesktopLimiter, NavLink, genNavLink } from "./Nav";
86
85
  export { Media, Img, Bd } from "./deprecated/Media";
87
86
  export { Layout, Main, Content } from "./Layout";
@@ -6,7 +6,6 @@ export { default as Banner } from './Banner';
6
6
  export { default as ButtonAction } from './deprecated/ButtonAction';
7
7
  export { default as BottomDrawer } from './deprecated/BottomDrawer';
8
8
  export { default as BarButton } from './BarButton';
9
- export { default as I18n, translate, useI18n } from './providers/I18n';
10
9
  export { default as Icon } from './Icon';
11
10
  export { default as Sprite } from './Icon/Sprite';
12
11
  export { default as Sidebar } from './Sidebar';
@@ -1,6 +1,6 @@
1
1
  export function I18nContext(options: any): {
2
2
  t: any;
3
- f: ((date: any, formatStr: any, opts?: {}) => string | undefined) | undefined;
3
+ f: (date: any, formatStr: any, opts?: {} | undefined) => string;
4
4
  polyglot: any;
5
5
  lang: any;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import { I18n } from "cozy-ui/transpiled/react/providers/I18n";
3
+ import { I18n } from 'twake-i18n';
4
4
  export var I18nContext = function I18nContext(options) {
5
5
  var I18nComponent = new I18n({
6
6
  lang: options.lang,
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
+ import I18n from 'twake-i18n';
2
3
  import { BreakpointsProvider } from "cozy-ui/transpiled/react/providers/Breakpoints";
3
4
  import CozyTheme from "cozy-ui/transpiled/react/providers/CozyTheme";
4
5
  import AlertProvider from "cozy-ui/transpiled/react/providers/Alert";
5
- import I18n from "cozy-ui/transpiled/react/providers/I18n";
6
6
 
7
7
  var DemoProvider = function DemoProvider(_ref) {
8
8
  var variant = _ref.variant,
@@ -1,25 +0,0 @@
1
- import React from 'react'
2
-
3
- import createDepreciationLogger from '../helpers/createDepreciationLogger'
4
- import DeprecatedI18n, { useI18n as deprecatedUseI18n } from '../providers/I18n'
5
-
6
- const logDeprecatedFunc = createDepreciationLogger()
7
- const logDeprecatedComp = createDepreciationLogger()
8
-
9
- export const useI18n = props => {
10
- logDeprecatedFunc(
11
- `"useI18n" is now exported elsewhere. Please change the import path to "cozy-ui/transpiled/react/providers/I18n"`
12
- )
13
-
14
- return deprecatedUseI18n(props)
15
- }
16
-
17
- const I18n = props => {
18
- logDeprecatedComp(
19
- `"I18n" is now exported elsewhere. Please change the import path to "cozy-ui/transpiled/react/providers/I18n"`
20
- )
21
-
22
- return <DeprecatedI18n {...props} />
23
- }
24
-
25
- export default I18n
@@ -1,14 +0,0 @@
1
- import createDepreciationLogger from '../helpers/createDepreciationLogger'
2
- import withLocales from '../providers/I18n/withLocales'
3
-
4
- const logDeprecatedWithLocale = createDepreciationLogger()
5
-
6
- const deprecatedWithLocales = props => {
7
- logDeprecatedWithLocale(
8
- `"withLocales" is now exported elsewhere. Please change the import path to "cozy-ui/transpiled/react/providers/I18n"`
9
- )
10
-
11
- return withLocales(props)
12
- }
13
-
14
- export default deprecatedWithLocales
@@ -1,32 +0,0 @@
1
- import Polyglot from 'node-polyglot'
2
- import { useMemo } from 'react'
3
-
4
- import { useI18n, DEFAULT_LANG } from '.'
5
- import { initFormat } from './format'
6
-
7
- const createUseI18n = locales => () => {
8
- const { lang } = useI18n() || { lang: DEFAULT_LANG }
9
-
10
- return useMemo(() => {
11
- const polyglot = new Polyglot({
12
- locale: DEFAULT_LANG,
13
- phrases: locales[DEFAULT_LANG]
14
- })
15
-
16
- if (lang && lang !== DEFAULT_LANG) {
17
- try {
18
- polyglot.locale(lang)
19
- polyglot.extend(locales[lang])
20
- } catch (e) {
21
- console.warn(`The dict phrases for "${lang}" can't be loaded`)
22
- }
23
- }
24
-
25
- const f = initFormat(lang)
26
- const t = polyglot.t.bind(polyglot)
27
-
28
- return { t, f, lang }
29
- }, [lang])
30
- }
31
-
32
- export default createUseI18n
@@ -1,62 +0,0 @@
1
- import format from 'date-fns/format'
2
- import formatDistanceToNow from 'date-fns/formatDistanceToNow'
3
- import {
4
- enGB as enLocale,
5
- fr as frLocale,
6
- es as esLocale
7
- } from 'date-fns/locale'
8
-
9
- import { DEFAULT_LANG } from '.'
10
-
11
- let currentLocale
12
-
13
- const getDateFnsLocale = lang => {
14
- switch (lang) {
15
- case 'en':
16
- return enLocale
17
- case 'fr':
18
- return frLocale
19
- case 'es':
20
- return esLocale
21
- default:
22
- throw new Error('Locale not found')
23
- }
24
- }
25
-
26
- const getWarningMessage = lang =>
27
- `The "${lang}" locale isn't supported by date-fns or has not been included in the build. Check if you have configured a ContextReplacementPlugin that is too restrictive.`
28
-
29
- export const provideDateFnsLocale = (userLang, defaultLang = DEFAULT_LANG) => {
30
- try {
31
- const userLocale = getDateFnsLocale(userLang)
32
- currentLocale = userLocale
33
- return userLocale
34
- } catch (e) {
35
- console.warn(getWarningMessage(userLang))
36
- }
37
-
38
- try {
39
- const defaultLocale = getDateFnsLocale(defaultLang)
40
- currentLocale = defaultLocale
41
- return defaultLocale
42
- } catch (err) {
43
- console.warn(getWarningMessage(defaultLang))
44
- }
45
- }
46
-
47
- export const initFormat =
48
- (userLang, defaultLang = DEFAULT_LANG) =>
49
- (date, formatStr, opts = {}) => {
50
- const locale = provideDateFnsLocale(userLang, defaultLang)
51
- const ensureDate = date && typeof date === 'string' ? new Date(date) : date
52
-
53
- try {
54
- return format(ensureDate, formatStr, { locale, ...opts })
55
- } catch (error) {
56
- console.error('Error in initFormat', error)
57
- }
58
- }
59
-
60
- export const formatLocallyDistanceToNow = date => {
61
- return formatDistanceToNow(date, { locale: currentLocale })
62
- }