@synerise/ds-core 1.11.0 → 1.11.1

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 (125) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/i18n/{en.json → en.json.d.ts} +4 -2
  3. package/dist/i18n/en.json.js +8 -0
  4. package/dist/i18n/{es.json → es.json.d.ts} +4 -2
  5. package/dist/i18n/es.json.js +8 -0
  6. package/dist/i18n/index.js +14 -11
  7. package/dist/i18n/{pl.json → pl.json.d.ts} +4 -2
  8. package/dist/i18n/pl.json.js +8 -0
  9. package/dist/i18n/{pt.json → pt.json.d.ts} +4 -2
  10. package/dist/i18n/pt.json.js +8 -0
  11. package/dist/js/DSProvider/DSProvider.d.ts +5 -6
  12. package/dist/js/DSProvider/DSProvider.js +36 -31
  13. package/dist/js/DSProvider/LocaleProvider/LocaleProvider.d.ts +2 -2
  14. package/dist/js/DSProvider/LocaleProvider/LocaleProvider.js +29 -38
  15. package/dist/js/DSProvider/LocaleProvider/LocaleProvider.types.d.ts +3 -3
  16. package/dist/js/DSProvider/LocaleProvider/LocaleProvider.types.js +1 -1
  17. package/dist/js/DSProvider/LocaleProvider/LocaleProvider.utils.d.ts +1 -1
  18. package/dist/js/DSProvider/LocaleProvider/LocaleProvider.utils.js +22 -19
  19. package/dist/js/DSProvider/LocaleProvider/antLocales.d.ts +6 -6
  20. package/dist/js/DSProvider/LocaleProvider/antLocales.js +16 -13
  21. package/dist/js/DSProvider/LocaleProvider/index.js +4 -1
  22. package/dist/js/DSProvider/ThemeProvider/ThemeProvider.d.ts +2 -2
  23. package/dist/js/DSProvider/ThemeProvider/ThemeProvider.js +14 -12
  24. package/dist/js/DSProvider/ThemeProvider/breakpoints.js +5 -2
  25. package/dist/js/DSProvider/ThemeProvider/index.js +4 -1
  26. package/dist/js/DSProvider/ThemeProvider/theme.d.ts +1 -1
  27. package/dist/js/DSProvider/ThemeProvider/theme.js +17 -17
  28. package/dist/js/DSProvider/ThemeProvider/variables.d.ts +8 -0
  29. package/dist/js/DSProvider/ThemeProvider/variables.js +531 -530
  30. package/dist/js/DSProvider/index.js +4 -1
  31. package/dist/js/DropdownContext/DropdownContext/DropdownContextProvider.d.ts +2 -2
  32. package/dist/js/DropdownContext/DropdownContext/DropdownContextProvider.js +11 -11
  33. package/dist/js/DropdownContext/DropdownContext.d.ts +1 -1
  34. package/dist/js/DropdownContext/DropdownContext.js +5 -2
  35. package/dist/js/DropdownContext/DropdownContextProvider.d.ts +2 -2
  36. package/dist/js/DropdownContext/DropdownContextProvider.js +11 -11
  37. package/dist/js/DropdownContext/index.js +8 -3
  38. package/dist/js/DropdownContext/useDropdown.d.ts +1 -1
  39. package/dist/js/DropdownContext/useDropdown.js +7 -4
  40. package/dist/js/data-format/components/FormattedDate.d.ts +4 -4
  41. package/dist/js/data-format/components/FormattedDate.js +23 -9
  42. package/dist/js/data-format/components/FormattedDateTime.d.ts +4 -4
  43. package/dist/js/data-format/components/FormattedDateTime.js +26 -12
  44. package/dist/js/data-format/components/FormattedNumber.d.ts +2 -2
  45. package/dist/js/data-format/components/FormattedNumber.js +23 -9
  46. package/dist/js/data-format/components/FormattedRelativeDateTime.d.ts +3 -3
  47. package/dist/js/data-format/components/FormattedRelativeDateTime.js +40 -21
  48. package/dist/js/data-format/components/FormattedTime.d.ts +4 -4
  49. package/dist/js/data-format/components/FormattedTime.js +26 -12
  50. package/dist/js/data-format/components/index.js +13 -5
  51. package/dist/js/data-format/constants/dataFormat.constants.d.ts +2 -2
  52. package/dist/js/data-format/constants/dataFormat.constants.js +85 -49
  53. package/dist/js/data-format/constants/dataFormatConfig.constants.d.ts +2 -2
  54. package/dist/js/data-format/constants/dataFormatConfig.constants.js +15 -8
  55. package/dist/js/data-format/constants/dateTimeParts.constants.d.ts +1 -1
  56. package/dist/js/data-format/constants/dateTimeParts.constants.js +10 -4
  57. package/dist/js/data-format/constants/index.js +48 -3
  58. package/dist/js/data-format/contexts/DataFormatConfigContext.d.ts +2 -2
  59. package/dist/js/data-format/contexts/DataFormatConfigContext.js +6 -3
  60. package/dist/js/data-format/contexts/DataFormatIntlsContext.d.ts +2 -2
  61. package/dist/js/data-format/contexts/DataFormatIntlsContext.js +7 -4
  62. package/dist/js/data-format/contexts/index.js +6 -2
  63. package/dist/js/data-format/hocs/withDataFormat.d.ts +2 -2
  64. package/dist/js/data-format/hocs/withDataFormat.js +23 -9
  65. package/dist/js/data-format/hooks/index.js +14 -6
  66. package/dist/js/data-format/hooks/useDataFormat.d.ts +1 -1
  67. package/dist/js/data-format/hooks/useDataFormat.js +93 -90
  68. package/dist/js/data-format/hooks/useDataFormatConfig.d.ts +1 -1
  69. package/dist/js/data-format/hooks/useDataFormatConfig.js +8 -4
  70. package/dist/js/data-format/hooks/useDataFormatIntls.d.ts +1 -1
  71. package/dist/js/data-format/hooks/useDataFormatIntls.js +8 -4
  72. package/dist/js/data-format/hooks/useDataFormatUtils.d.ts +4 -4
  73. package/dist/js/data-format/hooks/useDataFormatUtils.js +62 -63
  74. package/dist/js/data-format/hooks/useRelativeDateTimeUpdate.d.ts +2 -2
  75. package/dist/js/data-format/hooks/useRelativeDateTimeUpdate.js +19 -23
  76. package/dist/js/data-format/hooks/useSingleIntl.d.ts +1 -1
  77. package/dist/js/data-format/hooks/useSingleIntl.js +11 -8
  78. package/dist/js/data-format/index.js +83 -7
  79. package/dist/js/data-format/providers/DataFormatConfigProvider.d.ts +2 -2
  80. package/dist/js/data-format/providers/DataFormatConfigProvider.js +37 -26
  81. package/dist/js/data-format/types/dataFormat.types.d.ts +3 -3
  82. package/dist/js/data-format/types/dataFormat.types.js +1 -5
  83. package/dist/js/data-format/types/dataFormatConfig.types.d.ts +1 -1
  84. package/dist/js/data-format/types/dataFormatConfig.types.js +1 -2
  85. package/dist/js/data-format/types/dateTimeParts.types.js +1 -2
  86. package/dist/js/data-format/types/index.js +1 -1
  87. package/dist/js/data-format/utils/dataFormat.utils.d.ts +2 -2
  88. package/dist/js/data-format/utils/dataFormat.utils.js +82 -67
  89. package/dist/js/data-format/utils/dataFormatConfig.utils.d.ts +1 -1
  90. package/dist/js/data-format/utils/dataFormatConfig.utils.js +9 -8
  91. package/dist/js/data-format/utils/date.utils.d.ts +2 -2
  92. package/dist/js/data-format/utils/date.utils.js +25 -21
  93. package/dist/js/data-format/utils/dateTimeParts.utils.d.ts +2 -2
  94. package/dist/js/data-format/utils/dateTimeParts.utils.js +68 -52
  95. package/dist/js/data-format/utils/index.js +41 -5
  96. package/dist/js/data-format/utils/timeZone.utils.d.ts +1 -1
  97. package/dist/js/data-format/utils/timeZone.utils.js +59 -51
  98. package/dist/js/index.js +112 -7
  99. package/dist/js/mediaQuery/mediaQuery.d.ts +2 -2
  100. package/dist/js/mediaQuery/mediaQuery.js +15 -25
  101. package/dist/js/style.d.ts +0 -2
  102. package/dist/js/style.js +1 -2
  103. package/dist/js/testing/index.js +6 -2
  104. package/dist/js/testing/renderWithProvider/renderWithProvider.d.ts +4 -4
  105. package/dist/js/testing/renderWithProvider/renderWithProvider.js +35 -27
  106. package/dist/js/testing/sleep.js +6 -8
  107. package/dist/js/toaster/Toaster.d.ts +1 -1
  108. package/dist/js/toaster/Toaster.js +12 -8
  109. package/dist/js/toaster/Toaster.types.js +1 -1
  110. package/dist/js/toaster/constants.d.ts +1 -1
  111. package/dist/js/toaster/constants.js +7 -4
  112. package/dist/js/toaster/contexts/ToasterContext.d.ts +2 -2
  113. package/dist/js/toaster/contexts/ToasterContext.js +9 -5
  114. package/dist/js/toaster/hooks/useToaster.d.ts +1 -1
  115. package/dist/js/toaster/hooks/useToaster.js +7 -4
  116. package/dist/js/toaster/index.js +12 -5
  117. package/dist/js/toaster/providers/ToasterProvider.d.ts +2 -2
  118. package/dist/js/toaster/providers/ToasterProvider.js +17 -17
  119. package/package.json +4 -4
  120. package/dist/js/testing/renderWithProvider/renderWithProvider.spec.d.ts +0 -1
  121. package/dist/style/colors.less +0 -137
  122. package/dist/style/config.less +0 -521
  123. package/dist/style/core.less +0 -55
  124. package/dist/style/variables.less +0 -2
  125. /package/dist/{style/variables.css → assets/style/core-tn0RQdqM.css} +0 -0
@@ -1 +1,4 @@
1
- export { default } from './DSProvider';
1
+ import { default as default2 } from "./DSProvider.js";
2
+ export {
3
+ default2 as default
4
+ };
@@ -1,5 +1,5 @@
1
- import React, { type ReactNode } from 'react';
2
- import { type DropdownContextProps } from '../DropdownContext';
1
+ import { default as React, ReactNode } from 'react';
2
+ import { DropdownContextProps } from '../DropdownContext';
3
3
  export declare const DropdownContextProvider: ({ children, ...rest }: DropdownContextProps & {
4
4
  children?: ReactNode;
5
5
  }) => React.JSX.Element;
@@ -1,11 +1,11 @@
1
- var _excluded = ["children"];
2
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
3
- import React from 'react';
4
- import { DropdownContext } from '../DropdownContext';
5
- export var DropdownContextProvider = function DropdownContextProvider(_ref) {
6
- var children = _ref.children,
7
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
8
- return /*#__PURE__*/React.createElement(DropdownContext.Provider, {
9
- value: rest
10
- }, children);
11
- };
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { DropdownContext } from "../DropdownContext.js";
3
+ const DropdownContextProvider = ({
4
+ children,
5
+ ...rest
6
+ }) => {
7
+ return /* @__PURE__ */ jsx(DropdownContext.Provider, { value: rest, children });
8
+ };
9
+ export {
10
+ DropdownContextProvider
11
+ };
@@ -4,4 +4,4 @@ export type DropdownContextProps = {
4
4
  setIsOpen: (newOpen: boolean) => void;
5
5
  hideOnItemClick?: string | boolean;
6
6
  };
7
- export declare const DropdownContext: import("react").Context<DropdownContextProps | undefined>;
7
+ export declare const DropdownContext: import('react').Context<DropdownContextProps | undefined>;
@@ -1,2 +1,5 @@
1
- import { createContext } from 'react';
2
- export var DropdownContext = /*#__PURE__*/createContext(undefined);
1
+ import { createContext } from "react";
2
+ const DropdownContext = createContext(void 0);
3
+ export {
4
+ DropdownContext
5
+ };
@@ -1,5 +1,5 @@
1
- import React, { type ReactNode } from 'react';
2
- import { type DropdownContextProps } from './DropdownContext';
1
+ import { default as React, ReactNode } from 'react';
2
+ import { DropdownContextProps } from './DropdownContext';
3
3
  export declare const DropdownContextProvider: ({ children, ...rest }: DropdownContextProps & {
4
4
  children?: ReactNode;
5
5
  }) => React.JSX.Element;
@@ -1,11 +1,11 @@
1
- var _excluded = ["children"];
2
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
3
- import React from 'react';
4
- import { DropdownContext } from './DropdownContext';
5
- export var DropdownContextProvider = function DropdownContextProvider(_ref) {
6
- var children = _ref.children,
7
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
8
- return /*#__PURE__*/React.createElement(DropdownContext.Provider, {
9
- value: rest
10
- }, children);
11
- };
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { DropdownContext } from "./DropdownContext.js";
3
+ const DropdownContextProvider = ({
4
+ children,
5
+ ...rest
6
+ }) => {
7
+ return /* @__PURE__ */ jsx(DropdownContext.Provider, { value: rest, children });
8
+ };
9
+ export {
10
+ DropdownContextProvider
11
+ };
@@ -1,3 +1,8 @@
1
- export * from './DropdownContext';
2
- export * from './DropdownContextProvider';
3
- export * from './useDropdown';
1
+ import { DropdownContext } from "./DropdownContext.js";
2
+ import { DropdownContextProvider } from "./DropdownContextProvider.js";
3
+ import { useDropdown } from "./useDropdown.js";
4
+ export {
5
+ DropdownContext,
6
+ DropdownContextProvider,
7
+ useDropdown
8
+ };
@@ -1 +1 @@
1
- export declare const useDropdown: () => import("./DropdownContext").DropdownContextProps | undefined;
1
+ export declare const useDropdown: () => import('./DropdownContext').DropdownContextProps | undefined;
@@ -1,5 +1,8 @@
1
- import { useContext } from 'react';
2
- import { DropdownContext } from './DropdownContext';
3
- export var useDropdown = function useDropdown() {
1
+ import { useContext } from "react";
2
+ import { DropdownContext } from "./DropdownContext.js";
3
+ const useDropdown = () => {
4
4
  return useContext(DropdownContext);
5
- };
5
+ };
6
+ export {
7
+ useDropdown
8
+ };
@@ -1,7 +1,7 @@
1
- import { type Dayjs } from 'dayjs';
2
- import { type Moment } from 'moment';
3
- import React from 'react';
4
- import { type DateToFormatOptions } from '../types';
1
+ import { Dayjs } from 'dayjs';
2
+ import { Moment } from 'moment';
3
+ import { default as React } from 'react';
4
+ import { DateToFormatOptions } from '../types';
5
5
  export type FormattedDateProps = {
6
6
  value: Date | Moment | Dayjs;
7
7
  options?: DateToFormatOptions;
@@ -1,9 +1,23 @@
1
- import React from 'react';
2
- import { useDataFormat } from '../hooks';
3
- export var FormattedDate = function FormattedDate(_ref) {
4
- var value = _ref.value,
5
- options = _ref.options;
6
- var _useDataFormat = useDataFormat(),
7
- formatValue = _useDataFormat.formatValue;
8
- return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, options));
9
- };
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import "react";
3
+ import "../contexts/DataFormatConfigContext.js";
4
+ import "../contexts/DataFormatIntlsContext.js";
5
+ import { useDataFormat } from "../hooks/useDataFormat.js";
6
+ import "dayjs";
7
+ import "moment";
8
+ import "react-intl";
9
+ import "../constants/dataFormatConfig.constants.js";
10
+ import "../utils/timeZone.utils.js";
11
+ import "../utils/dataFormat.utils.js";
12
+ const FormattedDate = ({
13
+ value,
14
+ options
15
+ }) => {
16
+ const {
17
+ formatValue
18
+ } = useDataFormat();
19
+ return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, options) });
20
+ };
21
+ export {
22
+ FormattedDate
23
+ };
@@ -1,7 +1,7 @@
1
- import { type Dayjs } from 'dayjs';
2
- import { type Moment } from 'moment';
3
- import React from 'react';
4
- import { type DateToFormatOptions } from '../types';
1
+ import { Dayjs } from 'dayjs';
2
+ import { Moment } from 'moment';
3
+ import { default as React } from 'react';
4
+ import { DateToFormatOptions } from '../types';
5
5
  export type FormattedTimeProps = {
6
6
  value: Date | Moment | Dayjs;
7
7
  options?: DateToFormatOptions;
@@ -1,13 +1,27 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React from 'react';
3
- import { DATETIME } from '../constants';
4
- import { useDataFormat } from '../hooks';
5
- export var FormattedDateTime = function FormattedDateTime(_ref) {
6
- var value = _ref.value,
7
- options = _ref.options;
8
- var _useDataFormat = useDataFormat(),
9
- formatValue = _useDataFormat.formatValue;
10
- return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, _extends({}, options, {
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import "../constants/dataFormatConfig.constants.js";
3
+ import { DATETIME } from "../constants/dataFormat.constants.js";
4
+ import "react";
5
+ import "../contexts/DataFormatConfigContext.js";
6
+ import "../contexts/DataFormatIntlsContext.js";
7
+ import { useDataFormat } from "../hooks/useDataFormat.js";
8
+ import "dayjs";
9
+ import "moment";
10
+ import "react-intl";
11
+ import "../utils/timeZone.utils.js";
12
+ import "../utils/dataFormat.utils.js";
13
+ const FormattedDateTime = ({
14
+ value,
15
+ options
16
+ }) => {
17
+ const {
18
+ formatValue
19
+ } = useDataFormat();
20
+ return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, {
21
+ ...options,
11
22
  targetFormat: DATETIME
12
- })));
13
- };
23
+ }) });
24
+ };
25
+ export {
26
+ FormattedDateTime
27
+ };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type NumberToFormatOptions } from '../types';
1
+ import { default as React } from 'react';
2
+ import { NumberToFormatOptions } from '../types';
3
3
  export type FormattedNumberProps = {
4
4
  value: number;
5
5
  options?: NumberToFormatOptions;
@@ -1,9 +1,23 @@
1
- import React from 'react';
2
- import { useDataFormat } from '../hooks';
3
- export var FormattedNumber = function FormattedNumber(_ref) {
4
- var value = _ref.value,
5
- options = _ref.options;
6
- var _useDataFormat = useDataFormat(),
7
- formatValue = _useDataFormat.formatValue;
8
- return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, options));
9
- };
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import "react";
3
+ import "../contexts/DataFormatConfigContext.js";
4
+ import "../contexts/DataFormatIntlsContext.js";
5
+ import { useDataFormat } from "../hooks/useDataFormat.js";
6
+ import "dayjs";
7
+ import "moment";
8
+ import "react-intl";
9
+ import "../constants/dataFormatConfig.constants.js";
10
+ import "../utils/timeZone.utils.js";
11
+ import "../utils/dataFormat.utils.js";
12
+ const FormattedNumber = ({
13
+ value,
14
+ options
15
+ }) => {
16
+ const {
17
+ formatValue
18
+ } = useDataFormat();
19
+ return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, options) });
20
+ };
21
+ export {
22
+ FormattedNumber
23
+ };
@@ -1,6 +1,6 @@
1
- import { type Dayjs } from 'dayjs';
2
- import { type Moment } from 'moment';
3
- import { type DateToFormatOptions } from '../types';
1
+ import { Dayjs } from 'dayjs';
2
+ import { Moment } from 'moment';
3
+ import { DateToFormatOptions } from '../types';
4
4
  export type FormattedRelativeDateTimeProps = {
5
5
  value: Date | Moment | Dayjs;
6
6
  withoutSuffix?: boolean;
@@ -1,26 +1,45 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React from 'react';
3
- import { RELATIVE_FROM, RELATIVE_FROM_WITHOUT_SUFFIX, RELATIVE_TO, RELATIVE_TO_WITHOUT_SUFFIX } from '../constants';
4
- import { useDataFormat, useRelativeDateTimeUpdate } from '../hooks';
5
- export var FormattedRelativeDateTimeTo = function FormattedRelativeDateTimeTo(_ref) {
6
- var value = _ref.value,
7
- withoutSuffix = _ref.withoutSuffix,
8
- options = _ref.options;
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import "../constants/dataFormatConfig.constants.js";
3
+ import { RELATIVE_FROM_WITHOUT_SUFFIX, RELATIVE_FROM, RELATIVE_TO_WITHOUT_SUFFIX, RELATIVE_TO } from "../constants/dataFormat.constants.js";
4
+ import "react";
5
+ import "../contexts/DataFormatConfigContext.js";
6
+ import "../contexts/DataFormatIntlsContext.js";
7
+ import { useDataFormat } from "../hooks/useDataFormat.js";
8
+ import "dayjs";
9
+ import "moment";
10
+ import "react-intl";
11
+ import "../utils/timeZone.utils.js";
12
+ import "../utils/dataFormat.utils.js";
13
+ import { useRelativeDateTimeUpdate } from "../hooks/useRelativeDateTimeUpdate.js";
14
+ const FormattedRelativeDateTimeTo = ({
15
+ value,
16
+ withoutSuffix,
17
+ options
18
+ }) => {
9
19
  useRelativeDateTimeUpdate(value);
10
- var _useDataFormat = useDataFormat(),
11
- formatValue = _useDataFormat.formatValue;
12
- return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, _extends({}, options, {
20
+ const {
21
+ formatValue
22
+ } = useDataFormat();
23
+ return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, {
24
+ ...options,
13
25
  targetFormat: withoutSuffix ? RELATIVE_TO_WITHOUT_SUFFIX : RELATIVE_TO
14
- })));
26
+ }) });
15
27
  };
16
- export var FormattedRelativeDateTimeFrom = function FormattedRelativeDateTimeFrom(_ref2) {
17
- var value = _ref2.value,
18
- withoutSuffix = _ref2.withoutSuffix,
19
- options = _ref2.options;
28
+ const FormattedRelativeDateTimeFrom = ({
29
+ value,
30
+ withoutSuffix,
31
+ options
32
+ }) => {
20
33
  useRelativeDateTimeUpdate(value);
21
- var _useDataFormat2 = useDataFormat(),
22
- formatValue = _useDataFormat2.formatValue;
23
- return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, _extends({}, options, {
34
+ const {
35
+ formatValue
36
+ } = useDataFormat();
37
+ return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, {
38
+ ...options,
24
39
  targetFormat: withoutSuffix ? RELATIVE_FROM_WITHOUT_SUFFIX : RELATIVE_FROM
25
- })));
26
- };
40
+ }) });
41
+ };
42
+ export {
43
+ FormattedRelativeDateTimeFrom,
44
+ FormattedRelativeDateTimeTo
45
+ };
@@ -1,7 +1,7 @@
1
- import { type Dayjs } from 'dayjs';
2
- import { type Moment } from 'moment';
3
- import React from 'react';
4
- import { type DateToFormatOptions } from '../types';
1
+ import { Dayjs } from 'dayjs';
2
+ import { Moment } from 'moment';
3
+ import { default as React } from 'react';
4
+ import { DateToFormatOptions } from '../types';
5
5
  export type FormattedTimeProps = {
6
6
  value: Date | Moment | Dayjs;
7
7
  options?: DateToFormatOptions;
@@ -1,13 +1,27 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React from 'react';
3
- import { TIME } from '../constants';
4
- import { useDataFormat } from '../hooks';
5
- export var FormattedTime = function FormattedTime(_ref) {
6
- var value = _ref.value,
7
- options = _ref.options;
8
- var _useDataFormat = useDataFormat(),
9
- formatValue = _useDataFormat.formatValue;
10
- return /*#__PURE__*/React.createElement(React.Fragment, null, formatValue(value, _extends({}, options, {
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import "../constants/dataFormatConfig.constants.js";
3
+ import { TIME } from "../constants/dataFormat.constants.js";
4
+ import "react";
5
+ import "../contexts/DataFormatConfigContext.js";
6
+ import "../contexts/DataFormatIntlsContext.js";
7
+ import { useDataFormat } from "../hooks/useDataFormat.js";
8
+ import "dayjs";
9
+ import "moment";
10
+ import "react-intl";
11
+ import "../utils/timeZone.utils.js";
12
+ import "../utils/dataFormat.utils.js";
13
+ const FormattedTime = ({
14
+ value,
15
+ options
16
+ }) => {
17
+ const {
18
+ formatValue
19
+ } = useDataFormat();
20
+ return /* @__PURE__ */ jsx(Fragment, { children: formatValue(value, {
21
+ ...options,
11
22
  targetFormat: TIME
12
- })));
13
- };
23
+ }) });
24
+ };
25
+ export {
26
+ FormattedTime
27
+ };
@@ -1,5 +1,13 @@
1
- export { FormattedDate } from './FormattedDate';
2
- export { FormattedDateTime } from './FormattedDateTime';
3
- export { FormattedNumber } from './FormattedNumber';
4
- export { FormattedTime } from './FormattedTime';
5
- export { FormattedRelativeDateTimeFrom, FormattedRelativeDateTimeTo } from './FormattedRelativeDateTime';
1
+ import { FormattedDate } from "./FormattedDate.js";
2
+ import { FormattedDateTime } from "./FormattedDateTime.js";
3
+ import { FormattedNumber } from "./FormattedNumber.js";
4
+ import { FormattedTime } from "./FormattedTime.js";
5
+ import { FormattedRelativeDateTimeFrom, FormattedRelativeDateTimeTo } from "./FormattedRelativeDateTime.js";
6
+ export {
7
+ FormattedDate,
8
+ FormattedDateTime,
9
+ FormattedNumber,
10
+ FormattedRelativeDateTimeFrom,
11
+ FormattedRelativeDateTimeTo,
12
+ FormattedTime
13
+ };
@@ -1,5 +1,5 @@
1
- import { type FormatDateOptions, type FormatNumberOptions } from 'react-intl';
2
- import { type DateConstantsTargetFormat, type DateTargetFormat, type Delimiter, type NamingConvention, type NumberTargetFormat } from '../types';
1
+ import { FormatDateOptions, FormatNumberOptions } from 'react-intl';
2
+ import { DateConstantsTargetFormat, DateTargetFormat, Delimiter, NamingConvention, NumberTargetFormat } from '../types';
3
3
  export declare const DEFAULT_FORMAT_NUMBER_OPTIONS: FormatNumberOptions;
4
4
  export declare const DEFAULT_FORMAT_DATE_OPTIONS: FormatDateOptions;
5
5
  export declare const DEFAULT_FORMAT_TIME_OPTIONS: FormatDateOptions;
@@ -1,52 +1,88 @@
1
- export var DEFAULT_FORMAT_NUMBER_OPTIONS = {
1
+ const DEFAULT_FORMAT_NUMBER_OPTIONS = {
2
2
  maximumFractionDigits: 2,
3
3
  useGrouping: true
4
4
  };
5
- export var DEFAULT_FORMAT_DATE_OPTIONS = {
6
- year: 'numeric',
7
- month: 'numeric',
8
- day: 'numeric'
9
- };
10
- export var DEFAULT_FORMAT_TIME_OPTIONS = {
11
- hour: 'numeric',
12
- minute: 'numeric'
13
- };
14
- export var DEFAULT_FORMAT_WEEKDAY_LONG_OPTIONS = {
15
- weekday: 'long'
16
- };
17
- export var DEFAULT_FORMAT_WEEKDAY_SHORT_OPTIONS = {
18
- weekday: 'short'
19
- };
20
- export var DEFAULT_FORMAT_MONTH_LONG_OPTIONS = {
21
- month: 'long'
22
- };
23
- export var DEFAULT_FORMAT_MONTH_SHORT_OPTIONS = {
24
- month: 'short'
25
- };
26
- export var DATE = 'date';
27
- export var TIME = 'time';
28
- export var DATETIME = 'datetime';
29
- export var RELATIVE_FROM = 'relative-from';
30
- export var RELATIVE_TO = 'relative-to';
31
- export var RELATIVE_FROM_WITHOUT_SUFFIX = 'relative-from-without-suffix';
32
- export var RELATIVE_TO_WITHOUT_SUFFIX = 'relative-to-without-suffix';
33
- export var WEEKDAY_LONG = 'weekday-long';
34
- export var WEEKDAY_SHORT = 'weekday-short';
35
- export var MONTH_LONG = 'month-long';
36
- export var MONTH_SHORT = 'month-short';
37
- export var COMPACT_LARGER_NUMBER = 'compact-larger-number';
38
- export var COMPACT_DECIMAL_LARGER_NUMBER = 'compact-decimal-larger-number';
39
- export var LARGER_NUMBER_LIMIT = 999;
40
- export var UPPER_CASE = 'upperCase';
41
- export var UPPER_FIRST = 'upperFirst';
42
- export var LOWER_CASE = 'lowerCase';
43
- export var LOWER_FIRST = 'lowerFirst';
44
- export var US_THOUSAND_DELIMITER = ',';
45
- export var US_DECIMAL_DELIMITER = '.';
46
- export var EU_THOUSAND_DELIMITER = ' ';
47
- export var EU_DECIMAL_DELIMITER = ',';
48
- export var DATE_CONSTANTS_TARGET_FORMATS = ['months-long', 'months-short', 'weekdays-long', 'weekdays-short'];
49
- export var MONTHS_LONG = 'months-long';
50
- export var MONTHS_SHORT = 'months-short';
51
- export var WEEKDAYS_LONG = 'weekdays-long';
52
- export var WEEKDAYS_SHORT = 'weekdays-short';
5
+ const DEFAULT_FORMAT_DATE_OPTIONS = {
6
+ year: "numeric",
7
+ month: "numeric",
8
+ day: "numeric"
9
+ };
10
+ const DEFAULT_FORMAT_TIME_OPTIONS = {
11
+ hour: "numeric",
12
+ minute: "numeric"
13
+ };
14
+ const DEFAULT_FORMAT_WEEKDAY_LONG_OPTIONS = {
15
+ weekday: "long"
16
+ };
17
+ const DEFAULT_FORMAT_WEEKDAY_SHORT_OPTIONS = {
18
+ weekday: "short"
19
+ };
20
+ const DEFAULT_FORMAT_MONTH_LONG_OPTIONS = {
21
+ month: "long"
22
+ };
23
+ const DEFAULT_FORMAT_MONTH_SHORT_OPTIONS = {
24
+ month: "short"
25
+ };
26
+ const DATE = "date";
27
+ const TIME = "time";
28
+ const DATETIME = "datetime";
29
+ const RELATIVE_FROM = "relative-from";
30
+ const RELATIVE_TO = "relative-to";
31
+ const RELATIVE_FROM_WITHOUT_SUFFIX = "relative-from-without-suffix";
32
+ const RELATIVE_TO_WITHOUT_SUFFIX = "relative-to-without-suffix";
33
+ const WEEKDAY_LONG = "weekday-long";
34
+ const WEEKDAY_SHORT = "weekday-short";
35
+ const MONTH_LONG = "month-long";
36
+ const MONTH_SHORT = "month-short";
37
+ const COMPACT_LARGER_NUMBER = "compact-larger-number";
38
+ const COMPACT_DECIMAL_LARGER_NUMBER = "compact-decimal-larger-number";
39
+ const LARGER_NUMBER_LIMIT = 999;
40
+ const UPPER_CASE = "upperCase";
41
+ const UPPER_FIRST = "upperFirst";
42
+ const LOWER_CASE = "lowerCase";
43
+ const LOWER_FIRST = "lowerFirst";
44
+ const US_THOUSAND_DELIMITER = ",";
45
+ const US_DECIMAL_DELIMITER = ".";
46
+ const EU_THOUSAND_DELIMITER = " ";
47
+ const EU_DECIMAL_DELIMITER = ",";
48
+ const DATE_CONSTANTS_TARGET_FORMATS = ["months-long", "months-short", "weekdays-long", "weekdays-short"];
49
+ const MONTHS_LONG = "months-long";
50
+ const MONTHS_SHORT = "months-short";
51
+ const WEEKDAYS_LONG = "weekdays-long";
52
+ const WEEKDAYS_SHORT = "weekdays-short";
53
+ export {
54
+ COMPACT_DECIMAL_LARGER_NUMBER,
55
+ COMPACT_LARGER_NUMBER,
56
+ DATE,
57
+ DATETIME,
58
+ DATE_CONSTANTS_TARGET_FORMATS,
59
+ DEFAULT_FORMAT_DATE_OPTIONS,
60
+ DEFAULT_FORMAT_MONTH_LONG_OPTIONS,
61
+ DEFAULT_FORMAT_MONTH_SHORT_OPTIONS,
62
+ DEFAULT_FORMAT_NUMBER_OPTIONS,
63
+ DEFAULT_FORMAT_TIME_OPTIONS,
64
+ DEFAULT_FORMAT_WEEKDAY_LONG_OPTIONS,
65
+ DEFAULT_FORMAT_WEEKDAY_SHORT_OPTIONS,
66
+ EU_DECIMAL_DELIMITER,
67
+ EU_THOUSAND_DELIMITER,
68
+ LARGER_NUMBER_LIMIT,
69
+ LOWER_CASE,
70
+ LOWER_FIRST,
71
+ MONTHS_LONG,
72
+ MONTHS_SHORT,
73
+ MONTH_LONG,
74
+ MONTH_SHORT,
75
+ RELATIVE_FROM,
76
+ RELATIVE_FROM_WITHOUT_SUFFIX,
77
+ RELATIVE_TO,
78
+ RELATIVE_TO_WITHOUT_SUFFIX,
79
+ TIME,
80
+ UPPER_CASE,
81
+ UPPER_FIRST,
82
+ US_DECIMAL_DELIMITER,
83
+ US_THOUSAND_DELIMITER,
84
+ WEEKDAYS_LONG,
85
+ WEEKDAYS_SHORT,
86
+ WEEKDAY_LONG,
87
+ WEEKDAY_SHORT
88
+ };
@@ -1,5 +1,5 @@
1
- import { type IntlShape } from 'react-intl';
2
- import { type DataFormatConfig, type DataFormatNotationType } from '../types';
1
+ import { IntlShape } from 'react-intl';
2
+ import { DataFormatConfig, DataFormatNotationType } from '../types';
3
3
  export declare const EU_NOTATION: DataFormatNotationType;
4
4
  export declare const US_NOTATION: DataFormatNotationType;
5
5
  export declare const DEFAULT_DATA_FORMAT_NOTATION: DataFormatNotationType;
@@ -1,14 +1,21 @@
1
- import { createIntl } from 'react-intl';
2
- export var EU_NOTATION = 'EU';
3
- export var US_NOTATION = 'US';
4
- export var DEFAULT_DATA_FORMAT_NOTATION = EU_NOTATION;
5
- export var DEFAULT_DATA_FORMAT_CONFIG = {
1
+ import { createIntl } from "react-intl";
2
+ const EU_NOTATION = "EU";
3
+ const US_NOTATION = "US";
4
+ const DEFAULT_DATA_FORMAT_NOTATION = EU_NOTATION;
5
+ const DEFAULT_DATA_FORMAT_CONFIG = {
6
6
  startWeekDayNotation: DEFAULT_DATA_FORMAT_NOTATION,
7
7
  dateFormatNotation: DEFAULT_DATA_FORMAT_NOTATION,
8
8
  timeFormatNotation: DEFAULT_DATA_FORMAT_NOTATION,
9
9
  numberFormatNotation: DEFAULT_DATA_FORMAT_NOTATION,
10
10
  applyTimeZoneOffset: false
11
11
  };
12
- export var DEFAULT_DATA_FORMAT_INTL = createIntl({
13
- locale: 'pl'
14
- });
12
+ const DEFAULT_DATA_FORMAT_INTL = createIntl({
13
+ locale: "pl"
14
+ });
15
+ export {
16
+ DEFAULT_DATA_FORMAT_CONFIG,
17
+ DEFAULT_DATA_FORMAT_INTL,
18
+ DEFAULT_DATA_FORMAT_NOTATION,
19
+ EU_NOTATION,
20
+ US_NOTATION
21
+ };
@@ -1,4 +1,4 @@
1
- import { type DateTimePartFormat } from '../types';
1
+ import { DateTimePartFormat } from '../types';
2
2
  export declare const WEEKDAY: Intl.DateTimeFormatPartTypes;
3
3
  export declare const MONTH: Intl.DateTimeFormatPartTypes;
4
4
  export declare const LONG: DateTimePartFormat;
@@ -1,4 +1,10 @@
1
- export var WEEKDAY = 'weekday';
2
- export var MONTH = 'month';
3
- export var LONG = 'long';
4
- export var SHORT = 'short';
1
+ const WEEKDAY = "weekday";
2
+ const MONTH = "month";
3
+ const LONG = "long";
4
+ const SHORT = "short";
5
+ export {
6
+ LONG,
7
+ MONTH,
8
+ SHORT,
9
+ WEEKDAY
10
+ };