@kaizen/components 0.0.0-canary-remove-notification-list-20240307230320 → 0.0.0-canary-no-optint-or-toast-20240308001132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/KaizenProvider/KaizenProvider.cjs +17 -26
- package/dist/cjs/KaizenProvider/KaizenProvider.cjs.map +1 -1
- package/dist/cjs/index.css +5 -5
- package/dist/esm/KaizenProvider/KaizenProvider.mjs +19 -27
- package/dist/esm/KaizenProvider/KaizenProvider.mjs.map +1 -1
- package/dist/esm/index.css +6 -6
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/KaizenProvider/KaizenProvider.tsx +19 -19
- package/dist/cjs/KaizenProvider/subcomponents/OptionalIntlProvider/OptionalIntlProvider.cjs +0 -20
- package/dist/cjs/KaizenProvider/subcomponents/OptionalIntlProvider/OptionalIntlProvider.cjs.map +0 -1
- package/dist/esm/KaizenProvider/subcomponents/OptionalIntlProvider/OptionalIntlProvider.mjs +0 -18
- package/dist/esm/KaizenProvider/subcomponents/OptionalIntlProvider/OptionalIntlProvider.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-no-optint-or-toast-20240308001132",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { ToastNotificationsList } from "~components/Notification"
|
|
3
|
-
import { ToastNotificationProvider } from "~components/Notification/ToastNotification/context/ToastNotificationContext"
|
|
1
|
+
import React from "react"
|
|
2
|
+
// import { ToastNotificationsList } from "~components/Notification"
|
|
3
|
+
// import { ToastNotificationProvider } from "~components/Notification/ToastNotification/context/ToastNotificationContext"
|
|
4
4
|
import { FontDefinitions } from "./subcomponents/FontDefinitions"
|
|
5
|
-
import { OptionalIntlProvider } from "./subcomponents/OptionalIntlProvider"
|
|
5
|
+
// import { OptionalIntlProvider } from "./subcomponents/OptionalIntlProvider"
|
|
6
6
|
|
|
7
7
|
export type KaizenProviderProps = {
|
|
8
8
|
children: React.ReactNode
|
|
@@ -12,21 +12,21 @@ export type KaizenProviderProps = {
|
|
|
12
12
|
export const KaizenProvider = ({
|
|
13
13
|
children,
|
|
14
14
|
locale = "en",
|
|
15
|
-
}: KaizenProviderProps): JSX.Element =>
|
|
16
|
-
const [documentIsAvailable, setDocumentIsAvailable] = useState<boolean>(false)
|
|
17
|
-
const [notificationsList, setNotificationsList] = useState<JSX.Element>()
|
|
15
|
+
}: KaizenProviderProps): JSX.Element =>
|
|
16
|
+
// const [documentIsAvailable, setDocumentIsAvailable] = useState<boolean>(false)
|
|
17
|
+
// const [notificationsList, setNotificationsList] = useState<JSX.Element>()
|
|
18
18
|
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, [documentIsAvailable])
|
|
19
|
+
// useEffect(() => {
|
|
20
|
+
// // SSR does not have a document, which is required for ToastNotificationsList.
|
|
21
|
+
// // Await document render before rendering the component.
|
|
22
|
+
// if (document !== undefined) {
|
|
23
|
+
// setNotificationsList(<ToastNotificationsList />)
|
|
24
|
+
// setDocumentIsAvailable(true)
|
|
25
|
+
// }
|
|
26
|
+
// }, [documentIsAvailable])
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
<OptionalIntlProvider locale={locale}>
|
|
28
|
+
(
|
|
29
|
+
// <OptionalIntlProvider locale={locale}>
|
|
30
30
|
<>
|
|
31
31
|
{/* <ToastNotificationProvider> */}
|
|
32
32
|
{/* {notificationsList} */}
|
|
@@ -34,8 +34,8 @@ export const KaizenProvider = ({
|
|
|
34
34
|
{/* </ToastNotificationProvider> */}
|
|
35
35
|
<FontDefinitions />
|
|
36
36
|
</>
|
|
37
|
-
</OptionalIntlProvider>
|
|
37
|
+
// </OptionalIntlProvider>
|
|
38
38
|
)
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
|
|
41
41
|
KaizenProvider.displayName = "KaizenProvider"
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var i18nReactIntl = require('@cultureamp/i18n-react-intl');
|
|
5
|
-
var reactIntl = require('react-intl');
|
|
6
|
-
const OptionalIntlProvider = /*#__PURE__*/function () {
|
|
7
|
-
const OptionalIntlProvider = function (_a) {
|
|
8
|
-
var locale = _a.locale,
|
|
9
|
-
children = _a.children;
|
|
10
|
-
var parent = React.useContext(reactIntl.IntlContext);
|
|
11
|
-
if (parent) return children;
|
|
12
|
-
return React.createElement(i18nReactIntl.StaticIntlProvider, {
|
|
13
|
-
locale: locale
|
|
14
|
-
}, children);
|
|
15
|
-
};
|
|
16
|
-
OptionalIntlProvider.displayName = "OptionalIntlProvider";
|
|
17
|
-
return OptionalIntlProvider;
|
|
18
|
-
}();
|
|
19
|
-
exports.OptionalIntlProvider = OptionalIntlProvider;
|
|
20
|
-
//# sourceMappingURL=OptionalIntlProvider.cjs.map
|
package/dist/cjs/KaizenProvider/subcomponents/OptionalIntlProvider/OptionalIntlProvider.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionalIntlProvider.cjs","sources":["../../../../../src/KaizenProvider/subcomponents/OptionalIntlProvider/OptionalIntlProvider.tsx"],"sourcesContent":["import React, { useContext } from \"react\"\nimport { StaticIntlProvider } from \"@cultureamp/i18n-react-intl\"\nimport { IntlContext } from \"react-intl\"\n\ntype Props = {\n locale: string\n children: React.ReactElement\n}\nexport const OptionalIntlProvider = ({\n locale,\n children,\n}: Props): JSX.Element => {\n const parent = useContext(IntlContext)\n\n if (parent) return children\n return <StaticIntlProvider locale={locale}>{children}</StaticIntlProvider>\n}\n\nOptionalIntlProvider.displayName = \"OptionalIntlProvider\"\n"],"names":["OptionalIntlProvider","_a","locale","children","parent","useContext","IntlContext","React","createElement","StaticIntlProvider","displayName"],"mappings":";;;;;MAQaA,oBAAoB;EAAA,MAApBA,oBAAoB,GAAG,SAAAA,CAACC,EAG7B,EAAA;QAFNC,MAAM,GAAAD,EAAA,CAAAC,MAAA;MACNC,QAAQ,GAAAF,EAAA,CAAAE,QAAA;IAER,IAAMC,MAAM,GAAGC,gBAAU,CAACC,SAAAA,CAAAA,WAAW,CAAC;IAEtC,IAAIF,MAAM,EAAE,OAAOD,QAAQ;IAC3B,OAAOI,KAAA,CAAAC,aAAA,CAACC,aAAkB,CAAAA,kBAAA,EAAC;MAAAP,MAAM,EAAEA;IAAM,CAAA,EAAGC,QAAQ,CAAsB;EAC5E,CAAC;EAEDH,oBAAoB,CAACU,WAAW,GAAG,sBAAsB;EAAA,OAV5CV,oBAAoB;AAAA;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import { StaticIntlProvider } from '@cultureamp/i18n-react-intl';
|
|
3
|
-
import { IntlContext } from 'react-intl';
|
|
4
|
-
const OptionalIntlProvider = /*#__PURE__*/function () {
|
|
5
|
-
const OptionalIntlProvider = function (_a) {
|
|
6
|
-
var locale = _a.locale,
|
|
7
|
-
children = _a.children;
|
|
8
|
-
var parent = useContext(IntlContext);
|
|
9
|
-
if (parent) return children;
|
|
10
|
-
return /*#__PURE__*/React.createElement(StaticIntlProvider, {
|
|
11
|
-
locale: locale
|
|
12
|
-
}, children);
|
|
13
|
-
};
|
|
14
|
-
OptionalIntlProvider.displayName = "OptionalIntlProvider";
|
|
15
|
-
return OptionalIntlProvider;
|
|
16
|
-
}();
|
|
17
|
-
export { OptionalIntlProvider };
|
|
18
|
-
//# sourceMappingURL=OptionalIntlProvider.mjs.map
|
package/dist/esm/KaizenProvider/subcomponents/OptionalIntlProvider/OptionalIntlProvider.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionalIntlProvider.mjs","sources":["../../../../../src/KaizenProvider/subcomponents/OptionalIntlProvider/OptionalIntlProvider.tsx"],"sourcesContent":["import React, { useContext } from \"react\"\nimport { StaticIntlProvider } from \"@cultureamp/i18n-react-intl\"\nimport { IntlContext } from \"react-intl\"\n\ntype Props = {\n locale: string\n children: React.ReactElement\n}\nexport const OptionalIntlProvider = ({\n locale,\n children,\n}: Props): JSX.Element => {\n const parent = useContext(IntlContext)\n\n if (parent) return children\n return <StaticIntlProvider locale={locale}>{children}</StaticIntlProvider>\n}\n\nOptionalIntlProvider.displayName = \"OptionalIntlProvider\"\n"],"names":["OptionalIntlProvider","_a","locale","children","parent","useContext","IntlContext","React","createElement","StaticIntlProvider","displayName"],"mappings":";;;MAQaA,oBAAoB;EAAA,MAApBA,oBAAoB,GAAG,SAAAA,CAACC,EAG7B,EAAA;QAFNC,MAAM,GAAAD,EAAA,CAAAC,MAAA;MACNC,QAAQ,GAAAF,EAAA,CAAAE,QAAA;IAER,IAAMC,MAAM,GAAGC,UAAU,CAACC,WAAW,CAAC;IAEtC,IAAIF,MAAM,EAAE,OAAOD,QAAQ;IAC3B,oBAAOI,KAAA,CAAAC,aAAA,CAACC,kBAAkB,EAAC;MAAAP,MAAM,EAAEA;IAAM,CAAA,EAAGC,QAAQ,CAAsB;EAC5E,CAAC;EAEDH,oBAAoB,CAACU,WAAW,GAAG,sBAAsB;EAAA,OAV5CV,oBAAoB;AAAA;"}
|