@janbox/storefront-ui 1.0.12 → 1.0.13
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/lib/notifications/helpers.d.ts +1 -0
- package/dist/lib/notifications/helpers.d.ts.map +1 -1
- package/dist/lib/notifications/helpers.js +1 -0
- package/dist/lib/notifications/notifications.d.ts.map +1 -1
- package/dist/lib/notifications/notifications.js +5 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -2
- package/dist/theme/provider.d.ts +7 -0
- package/dist/theme/provider.d.ts.map +1 -0
- package/dist/theme/{css-baseline.js → provider.js} +8 -6
- package/package.json +1 -1
- package/dist/theme/css-baseline.d.ts +0 -2
- package/dist/theme/css-baseline.d.ts.map +0 -1
|
@@ -12,6 +12,7 @@ export type NotificationAtomValue = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare const notificationStore: {
|
|
14
14
|
getSnapshot: () => NotificationAtomValue;
|
|
15
|
+
getServerSnapshot: () => NotificationAtomValue;
|
|
15
16
|
subscribe: (listener: () => void) => () => boolean;
|
|
16
17
|
setState: (updater: (prev: NotificationAtomValue) => NotificationAtomValue) => void;
|
|
17
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B,CAAC;AAKF,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B,CAAC;AAKF,eAAO,MAAM,iBAAiB;;;0BAGN,MAAM,IAAI;wBAIZ,CAAC,IAAI,EAAE,qBAAqB,KAAK,qBAAqB;CAI3E,CAAC;AAEF,KAAK,wBAAwB,GAAG,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;AAE9D,eAAO,MAAM,gBAAgB;wBAExB,CAAC,SAAS,wBAAwB,4CAA4C,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI;CAqBlG,CAAC"}
|
|
@@ -6,6 +6,7 @@ let _state = { entries: [] };
|
|
|
6
6
|
const _listeners = /* @__PURE__ */ new Set();
|
|
7
7
|
const notificationStore = {
|
|
8
8
|
getSnapshot: () => _state,
|
|
9
|
+
getServerSnapshot: () => _state,
|
|
9
10
|
subscribe: (listener) => {
|
|
10
11
|
_listeners.add(listener);
|
|
11
12
|
return () => _listeners.delete(listener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/notifications.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/notifications.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,aAAa,wDAgCzB,CAAC"}
|
|
@@ -9,7 +9,11 @@ import { FLOATING_Z_INDEX } from "../../theme/index.js";
|
|
|
9
9
|
import { mediaQuery } from "../../theme/screens.js";
|
|
10
10
|
import { getTypographyVar } from "../../theme/typography.js";
|
|
11
11
|
const Notifications = () => {
|
|
12
|
-
const { entries } = useSyncExternalStore(
|
|
12
|
+
const { entries } = useSyncExternalStore(
|
|
13
|
+
notificationStore.subscribe,
|
|
14
|
+
notificationStore.getSnapshot,
|
|
15
|
+
notificationStore.getServerSnapshot
|
|
16
|
+
);
|
|
13
17
|
return /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(
|
|
14
18
|
"div",
|
|
15
19
|
{
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAE3B,eAAO,MAAM,gBAAgB,OAAO,CAAC"}
|
package/dist/theme/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { breakpoint, getSmallerScreens, mediaQuery, screens } from "./screens.js";
|
|
2
2
|
import { getColorVar, groupedColors, paletteVars, parseColor } from "./palette.js";
|
|
3
3
|
import { getSmallerTypographyVariants, getTypographyVar, typographyVars } from "./typography.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeProvider } from "./provider.js";
|
|
5
5
|
const FLOATING_Z_INDEX = 9999;
|
|
6
6
|
export {
|
|
7
|
-
CssBaseline,
|
|
8
7
|
FLOATING_Z_INDEX,
|
|
8
|
+
ThemeProvider,
|
|
9
9
|
breakpoint,
|
|
10
10
|
getColorVar,
|
|
11
11
|
getSmallerScreens,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
export type ThemeProviderProps = PropsWithChildren<{
|
|
4
|
+
theme: Theme;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ThemeProvider: ({ theme, children }: ThemeProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/theme/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAwD,MAAM,gBAAgB,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAO1C,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;IACjD,KAAK,EAAE,KAAK,CAAC;CACd,CAAC,CAAC;AAEH,eAAO,MAAM,aAAa,wBAAyB,kBAAkB,qDAOpE,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { ThemeProvider as ThemeProvider$1, Global } from "@emotion/react";
|
|
3
3
|
import { getColorVar } from "./palette.js";
|
|
4
4
|
import { flatten } from "flat";
|
|
5
5
|
import { flatMap } from "lodash-es";
|
|
6
6
|
import { getTypographyVar } from "./typography.js";
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const ThemeProvider = ({ theme, children }) => {
|
|
8
|
+
return /* @__PURE__ */ jsxs(ThemeProvider$1, { theme, children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Global, { styles: createGlobalStyle(theme) }),
|
|
10
|
+
children
|
|
11
|
+
] });
|
|
10
12
|
};
|
|
11
13
|
const createGlobalStyle = ({ palette, typography }) => {
|
|
12
14
|
const flattenPalette = flatten(palette);
|
|
@@ -291,5 +293,5 @@ const createGlobalStyle = ({ palette, typography }) => {
|
|
|
291
293
|
};
|
|
292
294
|
};
|
|
293
295
|
export {
|
|
294
|
-
|
|
296
|
+
ThemeProvider
|
|
295
297
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css-baseline.d.ts","sourceRoot":"","sources":["../../src/theme/css-baseline.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,wDAIvB,CAAC"}
|