@janbox/storefront-ui 1.0.10 → 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/components/virtualized-list.d.ts +2 -2
- package/dist/components/virtualized-list.d.ts.map +1 -1
- package/dist/components/virtualized-list.js +2 -15
- package/dist/hooks/use-is-hydrated/index.d.ts +2 -0
- package/dist/hooks/use-is-hydrated/index.d.ts.map +1 -0
- package/dist/hooks/use-is-hydrated/index.js +11 -0
- package/dist/hooks/use-toggle/index.d.ts +3 -0
- package/dist/hooks/use-toggle/index.d.ts.map +1 -0
- package/dist/hooks/use-toggle/index.js +11 -0
- package/dist/index.js +2 -2
- package/dist/lib/filter-panel/filter-panel.d.ts +1 -1
- package/dist/lib/filter-panel/filter-panel.d.ts.map +1 -1
- package/dist/lib/filter-panel/filter-panel.js +2 -2
- package/dist/lib/floating/floating-content/floating-content.d.ts.map +1 -1
- package/dist/lib/floating/floating-content/floating-content.js +18 -32
- package/dist/lib/loading/block-skeleton/block-skeleton.d.ts.map +1 -1
- package/dist/lib/loading/block-skeleton/block-skeleton.js +3 -3
- package/dist/lib/loading/image-skeleton/image-skeleton.d.ts.map +1 -1
- package/dist/lib/loading/image-skeleton/image-skeleton.js +4 -4
- package/dist/lib/loading/text-skeleton/text-skeleton.d.ts.map +1 -1
- package/dist/lib/loading/text-skeleton/text-skeleton.js +3 -3
- package/dist/lib/notifications/helpers.d.ts +5 -2
- package/dist/lib/notifications/helpers.d.ts.map +1 -1
- package/dist/lib/notifications/helpers.js +29 -24
- package/dist/lib/notifications/notifications.d.ts.map +1 -1
- package/dist/lib/notifications/notifications.js +22 -13
- package/dist/lib/phone-input/phone-input.d.ts.map +1 -1
- package/dist/lib/phone-input/phone-input.js +106 -104
- package/dist/theme/provider.d.ts.map +1 -1
- package/dist/theme/provider.js +2 -8
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +5 -17
|
@@ -2,8 +2,8 @@ import { JSX, Ref } from 'react';
|
|
|
2
2
|
import { useVirtualizer, VirtualItem } from '@tanstack/react-virtual';
|
|
3
3
|
import { ScrollViewRef } from './scroll-view';
|
|
4
4
|
import { ShallowMerge } from '../types';
|
|
5
|
-
type VirtualizedListOptions = Omit<Parameters<typeof useVirtualizer<HTMLDivElement, HTMLDivElement>>[0],
|
|
6
|
-
type VirtualizedListProps = ShallowMerge<JSX.IntrinsicElements[
|
|
5
|
+
type VirtualizedListOptions = Omit<Parameters<typeof useVirtualizer<HTMLDivElement, HTMLDivElement>>[0], 'getScrollElement'>;
|
|
6
|
+
type VirtualizedListProps = ShallowMerge<JSX.IntrinsicElements['div'], {
|
|
7
7
|
RowComponent: React.ComponentType<{
|
|
8
8
|
row: VirtualItem;
|
|
9
9
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtualized-list.d.ts","sourceRoot":"","sources":["../../src/components/virtualized-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAU,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtE,OAAO,EAAc,aAAa,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,KAAK,sBAAsB,GAAG,IAAI,CAChC,UAAU,CAAC,OAAO,cAAc,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EACpE,kBAAkB,CACnB,CAAC;AAEF,KAAK,oBAAoB,GAAG,YAAY,CACtC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC5B;IACE,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,GAAG,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IACxD,OAAO,EAAE,sBAAsB,CAAC;IAChC,GAAG,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;CAC1B,CACF,CAAC;AAEF,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAC;AAE1E,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"virtualized-list.d.ts","sourceRoot":"","sources":["../../src/components/virtualized-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAU,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtE,OAAO,EAAc,aAAa,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,KAAK,sBAAsB,GAAG,IAAI,CAChC,UAAU,CAAC,OAAO,cAAc,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EACpE,kBAAkB,CACnB,CAAC;AAEF,KAAK,oBAAoB,GAAG,YAAY,CACtC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC5B;IACE,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,GAAG,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IACxD,OAAO,EAAE,sBAAsB,CAAC;IAChC,GAAG,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;CAC1B,CACF,CAAC;AAEF,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAC;AAE1E,eAAO,MAAM,eAAe,6CAA8C,oBAAoB,qDAyC7F,CAAC"}
|
|
@@ -4,12 +4,7 @@ import { useMergeRefs } from "@floating-ui/react";
|
|
|
4
4
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
5
5
|
import { motion } from "motion/react";
|
|
6
6
|
import { ScrollView } from "./scroll-view.js";
|
|
7
|
-
const VirtualizedList = ({
|
|
8
|
-
RowComponent,
|
|
9
|
-
options,
|
|
10
|
-
ref,
|
|
11
|
-
...props
|
|
12
|
-
}) => {
|
|
7
|
+
const VirtualizedList = ({ RowComponent, options, ref, ...props }) => {
|
|
13
8
|
var _a;
|
|
14
9
|
const scrollRef = useRef(null);
|
|
15
10
|
const mergedRefs = useMergeRefs([scrollRef, ref]);
|
|
@@ -37,15 +32,7 @@ const VirtualizedList = ({
|
|
|
37
32
|
style: {
|
|
38
33
|
transform: `translateY(${((_a = items.at(0)) == null ? void 0 : _a.start) ?? 0}px)`
|
|
39
34
|
},
|
|
40
|
-
children: items.map((virtualRow) => /* @__PURE__ */ jsx(
|
|
41
|
-
"div",
|
|
42
|
-
{
|
|
43
|
-
"data-index": virtualRow.index,
|
|
44
|
-
ref: virtualizer.measureElement,
|
|
45
|
-
children: /* @__PURE__ */ jsx(RowComponent, { row: virtualRow })
|
|
46
|
-
},
|
|
47
|
-
virtualRow.key
|
|
48
|
-
))
|
|
35
|
+
children: items.map((virtualRow) => /* @__PURE__ */ jsx("div", { "data-index": virtualRow.index, ref: virtualizer.measureElement, children: /* @__PURE__ */ jsx(RowComponent, { row: virtualRow }) }, virtualRow.key))
|
|
49
36
|
}
|
|
50
37
|
)
|
|
51
38
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-is-hydrated/index.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,YAQ5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-toggle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAyB,MAAM,OAAO,CAAC;AAExE,wBAAgB,SAAS,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAQ1G"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useState, useCallback } from "react";
|
|
2
|
+
function useToggle(defaultValue) {
|
|
3
|
+
const [value, setValue] = useState(!!defaultValue);
|
|
4
|
+
const toggle = useCallback(() => {
|
|
5
|
+
setValue((x) => !x);
|
|
6
|
+
}, []);
|
|
7
|
+
return [value, toggle, setValue];
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
useToggle
|
|
11
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -134,7 +134,7 @@ import { getTextCssByVariant, getTextProps } from "./lib/text/helpers.js";
|
|
|
134
134
|
import { getTextareaProps } from "./lib/textarea/helpers.js";
|
|
135
135
|
import { getUnorderedListProps } from "./lib/unordered-list/unordered-list/helpers.js";
|
|
136
136
|
import { getVideoProps } from "./lib/video/helpers.js";
|
|
137
|
-
import {
|
|
137
|
+
import { notificationStore, useNotifications } from "./lib/notifications/helpers.js";
|
|
138
138
|
import { states } from "./lib/stepper/types.js";
|
|
139
139
|
import { useDrawerContext } from "./lib/drawer/drawer/helpers.js";
|
|
140
140
|
import { usePopoverContext } from "./lib/popover/popover/helpers.js";
|
|
@@ -285,7 +285,7 @@ export {
|
|
|
285
285
|
getTextareaProps,
|
|
286
286
|
getUnorderedListProps,
|
|
287
287
|
getVideoProps,
|
|
288
|
-
|
|
288
|
+
notificationStore,
|
|
289
289
|
states,
|
|
290
290
|
useAccordionContext,
|
|
291
291
|
useAccordionGroupContext,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FilterPanelProps } from './types';
|
|
2
|
-
export declare const FilterPanel: ({ label, defaultOpen,
|
|
2
|
+
export declare const FilterPanel: ({ label, defaultOpen, ...props }: FilterPanelProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=filter-panel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-panel.d.ts","sourceRoot":"","sources":["../../../src/lib/filter-panel/filter-panel.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAO3C,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"filter-panel.d.ts","sourceRoot":"","sources":["../../../src/lib/filter-panel/filter-panel.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAO3C,eAAO,MAAM,WAAW,qCAA6C,gBAAgB,qDA2BpF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { isValidElement } from "react";
|
|
3
|
-
import { useToggle } from "
|
|
3
|
+
import { useToggle } from "../../hooks/use-toggle/index.js";
|
|
4
4
|
import { CheckboxFilterPanel } from "./checkbox-filter-panel.js";
|
|
5
5
|
import { InputRangeFilterPanel } from "./input-range-filter-panel.js";
|
|
6
6
|
import { InputTextFilterPanel } from "./input-text-filter-panel.js";
|
|
@@ -8,7 +8,7 @@ import { RadioFilterPanel } from "./radio-filter-panel.js";
|
|
|
8
8
|
import ArrowDownIcon from "../../assets/svg/arrow-down.svg.js";
|
|
9
9
|
import { Collapse } from "../collapse/collapse.js";
|
|
10
10
|
import { Icon } from "../icon/icon.js";
|
|
11
|
-
const FilterPanel = ({ label, defaultOpen = true,
|
|
11
|
+
const FilterPanel = ({ label, defaultOpen = true, ...props }) => {
|
|
12
12
|
const [open, toggle] = useToggle(defaultOpen);
|
|
13
13
|
return /* @__PURE__ */ jsxs("div", { css: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
14
14
|
/* @__PURE__ */ jsxs("button", { css: { display: "flex", alignItems: "center", gap: 8, textAlign: "left" }, onClick: toggle, children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-content.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-content/floating-content.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"floating-content.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-content/floating-content.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAO/C,eAAO,MAAM,eAAe,8HAuC3B,CAAC"}
|
|
@@ -2,21 +2,15 @@ import { jsx } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { useMergeRefs, FloatingPortal, FloatingOverlay, FloatingFocusManager } from "@floating-ui/react";
|
|
4
4
|
import { AnimatePresence, motion } from "motion/react";
|
|
5
|
-
import { useIsClient } from "usehooks-ts";
|
|
6
5
|
import { useFloatingContext } from "../floating/helpers.js";
|
|
7
6
|
import { FLOATING_Z_INDEX } from "../../../theme/index.js";
|
|
7
|
+
import { useIsHydrated } from "../../../hooks/use-is-hydrated/index.js";
|
|
8
8
|
const FloatingContent = forwardRef(
|
|
9
|
-
({
|
|
10
|
-
style,
|
|
11
|
-
floatingPortalProps,
|
|
12
|
-
floatingFocusManagerProps,
|
|
13
|
-
floatingOverlayProps,
|
|
14
|
-
...props
|
|
15
|
-
}, ref) => {
|
|
9
|
+
({ style, floatingPortalProps, floatingFocusManagerProps, floatingOverlayProps, ...props }, ref) => {
|
|
16
10
|
const { getFloatingProps, context } = useFloatingContext();
|
|
17
11
|
const mergedRefs = useMergeRefs([context.refs.setFloating, ref]);
|
|
18
|
-
const
|
|
19
|
-
return /* @__PURE__ */ jsx(AnimatePresence, { children: context.open &&
|
|
12
|
+
const isHydrated = useIsHydrated();
|
|
13
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: context.open && isHydrated && /* @__PURE__ */ jsx(FloatingPortal, { root: document.body, ...floatingPortalProps, children: /* @__PURE__ */ jsx(
|
|
20
14
|
FloatingOverlay,
|
|
21
15
|
{
|
|
22
16
|
...floatingOverlayProps,
|
|
@@ -24,30 +18,22 @@ const FloatingContent = forwardRef(
|
|
|
24
18
|
display: (floatingOverlayProps == null ? void 0 : floatingOverlayProps.disabled) ?? true ? "contents" : void 0,
|
|
25
19
|
...floatingOverlayProps == null ? void 0 : floatingOverlayProps.style
|
|
26
20
|
},
|
|
27
|
-
children: /* @__PURE__ */ jsx(
|
|
28
|
-
|
|
21
|
+
children: /* @__PURE__ */ jsx(FloatingFocusManager, { disabled: true, context, ...floatingFocusManagerProps, children: /* @__PURE__ */ jsx(
|
|
22
|
+
motion.div,
|
|
29
23
|
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
...style,
|
|
42
|
-
zIndex: FLOATING_Z_INDEX
|
|
43
|
-
},
|
|
44
|
-
...getFloatingProps(props),
|
|
45
|
-
ref: mergedRefs,
|
|
46
|
-
children: props.children
|
|
47
|
-
}
|
|
48
|
-
)
|
|
24
|
+
initial: { opacity: 0 },
|
|
25
|
+
animate: { opacity: 1 },
|
|
26
|
+
exit: { opacity: 0 },
|
|
27
|
+
style: {
|
|
28
|
+
...context.elements.reference ? context.floatingStyles : {},
|
|
29
|
+
...style,
|
|
30
|
+
zIndex: FLOATING_Z_INDEX
|
|
31
|
+
},
|
|
32
|
+
...getFloatingProps(props),
|
|
33
|
+
ref: mergedRefs,
|
|
34
|
+
children: props.children
|
|
49
35
|
}
|
|
50
|
-
)
|
|
36
|
+
) })
|
|
51
37
|
}
|
|
52
38
|
) }) });
|
|
53
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/block-skeleton/block-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAK5B,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAE9D,eAAO,MAAM,aAAa,UAAW,kBAAkB,
|
|
1
|
+
{"version":3,"file":"block-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/block-skeleton/block-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAK5B,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAE9D,eAAO,MAAM,aAAa,UAAW,kBAAkB,qDAEtD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { animatePulseStyle } from "../../../constants/emotion.js";
|
|
3
|
-
import
|
|
3
|
+
import "lodash-es";
|
|
4
|
+
import { getColorVar } from "../../../theme/palette.js";
|
|
4
5
|
const BlockSkeleton = (props) => {
|
|
5
|
-
|
|
6
|
-
return /* @__PURE__ */ jsx("div", { css: [animatePulseStyle, { borderRadius: 4, backgroundColor: palette.neutral[200] }], ...props });
|
|
6
|
+
return /* @__PURE__ */ jsx("div", { css: [animatePulseStyle, { borderRadius: 4, backgroundColor: getColorVar("neutral.200") }], ...props });
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
BlockSkeleton
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/image-skeleton/image-skeleton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/image-skeleton/image-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,aAAa,UAAW,kBAAkB,qDA4BtD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useTheme } from "@emotion/react";
|
|
3
2
|
import { animatePulseStyle } from "../../../constants/emotion.js";
|
|
3
|
+
import "lodash-es";
|
|
4
|
+
import { getColorVar } from "../../../theme/palette.js";
|
|
4
5
|
const ImageSkeleton = (props) => {
|
|
5
|
-
const { palette } = useTheme();
|
|
6
6
|
return /* @__PURE__ */ jsx(
|
|
7
7
|
"div",
|
|
8
8
|
{
|
|
@@ -15,14 +15,14 @@ const ImageSkeleton = (props) => {
|
|
|
15
15
|
width: "100%",
|
|
16
16
|
height: "100%",
|
|
17
17
|
borderRadius: "0.25rem",
|
|
18
|
-
backgroundColor:
|
|
18
|
+
backgroundColor: getColorVar("neutral.200")
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
...props,
|
|
22
22
|
children: /* @__PURE__ */ jsx(
|
|
23
23
|
"svg",
|
|
24
24
|
{
|
|
25
|
-
css: { width: "25%", height: "25%", color:
|
|
25
|
+
css: { width: "25%", height: "25%", color: getColorVar("neutral.400") },
|
|
26
26
|
"aria-hidden": "true",
|
|
27
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
28
|
fill: "currentColor",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/text-skeleton/text-skeleton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/text-skeleton/text-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAK5C,eAAO,MAAM,YAAY,UAAW,iBAAiB,qDAcpD,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useTheme } from "@emotion/react";
|
|
3
2
|
import { animatePulseStyle } from "../../../constants/emotion.js";
|
|
3
|
+
import "lodash-es";
|
|
4
|
+
import { getColorVar } from "../../../theme/palette.js";
|
|
4
5
|
const TextSkeleton = (props) => {
|
|
5
|
-
const { palette } = useTheme();
|
|
6
6
|
return /* @__PURE__ */ jsxs("span", { css: { width: "100%", overflow: "hidden", display: "inline-flex", alignItems: "center" }, ...props, children: [
|
|
7
7
|
/* @__PURE__ */ jsx(
|
|
8
8
|
"span",
|
|
9
9
|
{
|
|
10
10
|
css: [
|
|
11
11
|
animatePulseStyle,
|
|
12
|
-
{ flex: "1 1 0%", borderRadius: "0.125rem", lineHeight: 1, backgroundColor:
|
|
12
|
+
{ flex: "1 1 0%", borderRadius: "0.125rem", lineHeight: 1, backgroundColor: getColorVar("neutral.200") }
|
|
13
13
|
],
|
|
14
14
|
children: " "
|
|
15
15
|
}
|
|
@@ -10,8 +10,11 @@ export type NotificationEntry = {
|
|
|
10
10
|
export type NotificationAtomValue = {
|
|
11
11
|
entries: NotificationEntry[];
|
|
12
12
|
};
|
|
13
|
-
export declare const
|
|
14
|
-
|
|
13
|
+
export declare const notificationStore: {
|
|
14
|
+
getSnapshot: () => NotificationAtomValue;
|
|
15
|
+
getServerSnapshot: () => NotificationAtomValue;
|
|
16
|
+
subscribe: (listener: () => void) => () => boolean;
|
|
17
|
+
setState: (updater: (prev: NotificationAtomValue) => NotificationAtomValue) => void;
|
|
15
18
|
};
|
|
16
19
|
type PushNotificationTemplate = Omit<NotificationEntry, 'id'>;
|
|
17
20
|
export declare const useNotifications: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/helpers.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
|
-
import { atom, useAtom } from "jotai";
|
|
3
|
-
import { v4 } from "uuid";
|
|
4
2
|
import "lodash-es";
|
|
5
3
|
import "../../theme/palette.js";
|
|
6
4
|
import { ensureArray } from "../../utils/common.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
let _state = { entries: [] };
|
|
6
|
+
const _listeners = /* @__PURE__ */ new Set();
|
|
7
|
+
const notificationStore = {
|
|
8
|
+
getSnapshot: () => _state,
|
|
9
|
+
getServerSnapshot: () => _state,
|
|
10
|
+
subscribe: (listener) => {
|
|
11
|
+
_listeners.add(listener);
|
|
12
|
+
return () => _listeners.delete(listener);
|
|
13
|
+
},
|
|
14
|
+
setState: (updater) => {
|
|
15
|
+
_state = updater(_state);
|
|
16
|
+
_listeners.forEach((l) => l());
|
|
17
|
+
}
|
|
18
|
+
};
|
|
10
19
|
const useNotifications = () => {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
...prev,
|
|
17
|
-
|
|
18
|
-
...
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
[setAtomValue]
|
|
28
|
-
);
|
|
20
|
+
const pushNotifications = useCallback((notifications) => {
|
|
21
|
+
return notificationStore.setState((prev) => {
|
|
22
|
+
return {
|
|
23
|
+
...prev,
|
|
24
|
+
entries: [
|
|
25
|
+
...prev.entries,
|
|
26
|
+
...ensureArray(notifications).map((notification) => ({
|
|
27
|
+
...notification,
|
|
28
|
+
id: Math.random().toString(36).slice(2)
|
|
29
|
+
}))
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
}, []);
|
|
29
34
|
return useMemo(() => {
|
|
30
35
|
return {
|
|
31
36
|
pushNotifications
|
|
@@ -33,6 +38,6 @@ const useNotifications = () => {
|
|
|
33
38
|
}, [pushNotifications]);
|
|
34
39
|
};
|
|
35
40
|
export {
|
|
36
|
-
|
|
41
|
+
notificationStore,
|
|
37
42
|
useNotifications
|
|
38
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/notifications.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/notifications.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,aAAa,wDAgCzB,CAAC"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useRef, useCallback, useEffect } from "react";
|
|
2
|
+
import { useSyncExternalStore, useRef, useCallback, useEffect } from "react";
|
|
3
3
|
import { FloatingPortal } from "@floating-ui/react";
|
|
4
|
-
import { useAtomValue, useAtom } from "jotai";
|
|
5
4
|
import { isNil } from "lodash-es";
|
|
6
5
|
import { AnimatePresence, useAnimation, motion } from "motion/react";
|
|
7
|
-
import {
|
|
6
|
+
import { notificationStore } from "./helpers.js";
|
|
8
7
|
import { getColorShadesByVariant } from "../../utils/index.js";
|
|
9
8
|
import { FLOATING_Z_INDEX } from "../../theme/index.js";
|
|
10
9
|
import { mediaQuery } from "../../theme/screens.js";
|
|
10
|
+
import { getTypographyVar } from "../../theme/typography.js";
|
|
11
11
|
const Notifications = () => {
|
|
12
|
-
const { entries } =
|
|
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
|
{
|
|
@@ -34,18 +38,17 @@ const Notifications = () => {
|
|
|
34
38
|
};
|
|
35
39
|
const Notification = ({ notification }) => {
|
|
36
40
|
const { main, light } = getColorShadesByVariant(notification.color);
|
|
37
|
-
const [, setAtomValue] = useAtom(notificationAtom);
|
|
38
41
|
const timerRef = useRef(null);
|
|
39
42
|
const controls = useAnimation();
|
|
40
43
|
const progressControls = useAnimation();
|
|
41
44
|
const startTimeRef = useRef(Date.now());
|
|
42
45
|
const remainingTimeRef = useRef(notification.duration ?? 3e3);
|
|
43
46
|
const removeNotification = useCallback(() => {
|
|
44
|
-
|
|
47
|
+
notificationStore.setState((prev) => ({
|
|
45
48
|
...prev,
|
|
46
49
|
entries: prev.entries.filter((n) => n.id !== notification.id)
|
|
47
50
|
}));
|
|
48
|
-
}, [notification.id
|
|
51
|
+
}, [notification.id]);
|
|
49
52
|
const clearTimer = useCallback(() => {
|
|
50
53
|
if (isNil(timerRef.current)) return;
|
|
51
54
|
clearTimeout(timerRef.current);
|
|
@@ -133,10 +136,13 @@ const Notification = ({ notification }) => {
|
|
|
133
136
|
"div",
|
|
134
137
|
{
|
|
135
138
|
css: {
|
|
136
|
-
fontSize: "
|
|
137
|
-
lineHeight: "
|
|
139
|
+
fontSize: getTypographyVar("sm").fontSize,
|
|
140
|
+
lineHeight: getTypographyVar("sm").lineHeight,
|
|
138
141
|
fontWeight: 500,
|
|
139
|
-
[mediaQuery("
|
|
142
|
+
[mediaQuery("md")]: {
|
|
143
|
+
fontSize: getTypographyVar("base").fontSize,
|
|
144
|
+
lineHeight: getTypographyVar("base").lineHeight
|
|
145
|
+
}
|
|
140
146
|
},
|
|
141
147
|
children: notification.title ?? /* @__PURE__ */ jsx(Fragment, { children: " " })
|
|
142
148
|
}
|
|
@@ -145,9 +151,12 @@ const Notification = ({ notification }) => {
|
|
|
145
151
|
"div",
|
|
146
152
|
{
|
|
147
153
|
css: {
|
|
148
|
-
fontSize: "
|
|
149
|
-
lineHeight: "
|
|
150
|
-
[mediaQuery("
|
|
154
|
+
fontSize: getTypographyVar("xs").fontSize,
|
|
155
|
+
lineHeight: getTypographyVar("xs").lineHeight,
|
|
156
|
+
[mediaQuery("md")]: {
|
|
157
|
+
fontSize: getTypographyVar("sm").fontSize,
|
|
158
|
+
lineHeight: getTypographyVar("sm").lineHeight
|
|
159
|
+
}
|
|
151
160
|
},
|
|
152
161
|
children: notification.message ?? /* @__PURE__ */ jsx(Fragment, { children: " " })
|
|
153
162
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-input.d.ts","sourceRoot":"","sources":["../../../src/lib/phone-input/phone-input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"phone-input.d.ts","sourceRoot":"","sources":["../../../src/lib/phone-input/phone-input.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAmB,MAAM,SAAS,CAAC;AAsD3D,eAAO,MAAM,UAAU,yHAqJtB,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useState, useRef } from "react";
|
|
2
|
+
import { forwardRef, useState, useRef, useEffect } from "react";
|
|
3
3
|
import { useMergeRefs } from "@floating-ui/react";
|
|
4
4
|
import { isNil } from "lodash-es";
|
|
5
5
|
import { phone } from "phone";
|
|
6
|
-
import { useResizeObserver } from "usehooks-ts";
|
|
7
6
|
import countries from "../../assets/json/countries.json.js";
|
|
8
7
|
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
9
8
|
import { getColorShadesByVariant } from "../../utils/index.js";
|
|
@@ -55,16 +54,26 @@ const PhoneInput = forwardRef(
|
|
|
55
54
|
const inputRef = useRef(null);
|
|
56
55
|
const wrapperRef = useRef(null);
|
|
57
56
|
const mergedRefs = useMergeRefs([ref, wrapperRef]);
|
|
57
|
+
const [wrapperWidth, setWrapperWidth] = useState(0);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
60
|
+
var _a2;
|
|
61
|
+
const domRect = (_a2 = entries.at(0)) == null ? void 0 : _a2.target.getBoundingClientRect();
|
|
62
|
+
if (domRect) {
|
|
63
|
+
setWrapperWidth(domRect.width);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
if (wrapperRef.current) {
|
|
67
|
+
resizeObserver.observe(wrapperRef.current);
|
|
68
|
+
}
|
|
69
|
+
return () => resizeObserver.disconnect();
|
|
70
|
+
}, []);
|
|
58
71
|
const [internalValue, setInternalValue] = useControllableState({
|
|
59
72
|
defaultValue: parsePhoneInputValue(defaultValue) ?? {
|
|
60
73
|
countryCode: (_a = countries.at(0)) == null ? void 0 : _a.code
|
|
61
74
|
},
|
|
62
75
|
value: parsePhoneInputValue(value)
|
|
63
76
|
});
|
|
64
|
-
const { width: wrapperWidth = 0 } = useResizeObserver({
|
|
65
|
-
ref: wrapperRef,
|
|
66
|
-
box: "border-box"
|
|
67
|
-
});
|
|
68
77
|
const triggerChange = (next) => {
|
|
69
78
|
setInternalValue(next);
|
|
70
79
|
onChange == null ? void 0 : onChange(next);
|
|
@@ -89,110 +98,103 @@ const PhoneInput = forwardRef(
|
|
|
89
98
|
const originalValue = internalValue.nationalNumber ?? "";
|
|
90
99
|
return inputFocused ? originalValue : originalValue.replace(/^(\d{1,3})(\d{0,3})?(\d*)$/, "$1 $2 $3");
|
|
91
100
|
})();
|
|
92
|
-
return /* @__PURE__ */ jsxs(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
return /* @__PURE__ */ jsxs("div", { ...containerProps, css: [{ display: "flex", flexDirection: "column", width: "100%" }, containerProps == null ? void 0 : containerProps.css], children: [
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
ForwardRefInputMask,
|
|
104
|
+
{
|
|
105
|
+
...props,
|
|
106
|
+
css: [
|
|
107
|
+
error && !selectOpen && {
|
|
108
|
+
"&::after": { borderColor: getColorVar("red.600") }
|
|
109
|
+
},
|
|
110
|
+
inputFocused && {
|
|
111
|
+
"&::after": { borderColor: getColorVar("primary.600") },
|
|
112
|
+
boxShadow: `0 0 0 3px ${getColorVar("primary.300")}`
|
|
113
|
+
},
|
|
114
|
+
disabled && {
|
|
115
|
+
backgroundColor: getColorShadesByVariant("neutral").disabledSurface,
|
|
116
|
+
pointerEvents: "none"
|
|
117
|
+
},
|
|
118
|
+
props.css
|
|
119
|
+
],
|
|
120
|
+
ref: mergedRefs,
|
|
121
|
+
children: /* @__PURE__ */ jsxs("div", { css: { position: "absolute", inset: 0, display: "flex", alignItems: "center" }, children: [
|
|
122
|
+
/* @__PURE__ */ jsx(
|
|
123
|
+
Select,
|
|
124
|
+
{
|
|
125
|
+
containerProps: {
|
|
126
|
+
css: { width: "fit-content", minWidth: 80 }
|
|
105
127
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
boxShadow: `0 0 0 3px ${getColorVar("primary.300")}`
|
|
128
|
+
css: {
|
|
129
|
+
paddingRight: 0
|
|
109
130
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
131
|
+
xs: {
|
|
132
|
+
outline: {
|
|
133
|
+
top: 0,
|
|
134
|
+
right: 0,
|
|
135
|
+
bottom: 0,
|
|
136
|
+
left: 0
|
|
137
|
+
}
|
|
113
138
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
children: /* @__PURE__ */ jsxs("div", { css: { position: "absolute", inset: 0, display: "flex", alignItems: "center" }, children: [
|
|
118
|
-
/* @__PURE__ */ jsx(
|
|
119
|
-
Select,
|
|
120
|
-
{
|
|
121
|
-
containerProps: {
|
|
122
|
-
css: { width: "fit-content", minWidth: 80 }
|
|
123
|
-
},
|
|
124
|
-
css: {
|
|
125
|
-
paddingRight: 0
|
|
126
|
-
},
|
|
127
|
-
xs: {
|
|
128
|
-
outline: {
|
|
129
|
-
top: 0,
|
|
130
|
-
right: 0,
|
|
131
|
-
bottom: 0,
|
|
132
|
-
left: 0
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
listProps: {
|
|
136
|
-
style: {
|
|
137
|
-
width: wrapperWidth
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
value: internalValue.countryCode ?? null,
|
|
141
|
-
onChange: onDialCodeChange,
|
|
142
|
-
options: countries,
|
|
143
|
-
disabled,
|
|
144
|
-
selectedRenderer: SelectedRenderer,
|
|
145
|
-
optionLabel: CountryRowLabel,
|
|
146
|
-
optionValue: "code",
|
|
147
|
-
optionSearchLabel: ["name", "dial_code", "code"],
|
|
148
|
-
open: selectOpen,
|
|
149
|
-
onOpenChange: setSelectOpen
|
|
139
|
+
listProps: {
|
|
140
|
+
style: {
|
|
141
|
+
width: wrapperWidth
|
|
150
142
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
143
|
+
},
|
|
144
|
+
value: internalValue.countryCode ?? null,
|
|
145
|
+
onChange: onDialCodeChange,
|
|
146
|
+
options: countries,
|
|
147
|
+
disabled,
|
|
148
|
+
selectedRenderer: SelectedRenderer,
|
|
149
|
+
optionLabel: CountryRowLabel,
|
|
150
|
+
optionValue: "code",
|
|
151
|
+
optionSearchLabel: ["name", "dial_code", "code"],
|
|
152
|
+
open: selectOpen,
|
|
153
|
+
onOpenChange: setSelectOpen
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ jsx(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
css: {
|
|
160
|
+
borderRight: "1px solid",
|
|
161
|
+
borderColor: getColorVar("border.default"),
|
|
162
|
+
height: "66.666667%",
|
|
163
|
+
marginLeft: 8,
|
|
164
|
+
marginRight: 8
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ jsx(
|
|
169
|
+
Input,
|
|
170
|
+
{
|
|
171
|
+
value: inputDisplayValue,
|
|
172
|
+
disabled,
|
|
173
|
+
containerProps: {
|
|
174
|
+
css: { flex: 1 }
|
|
175
|
+
},
|
|
176
|
+
mainProps: {
|
|
177
|
+
style: {
|
|
178
|
+
paddingLeft: 0,
|
|
179
|
+
boxShadow: "none"
|
|
162
180
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
{
|
|
167
|
-
|
|
168
|
-
disabled,
|
|
169
|
-
containerProps: {
|
|
170
|
-
css: { flex: 1 }
|
|
171
|
-
},
|
|
172
|
-
mainProps: {
|
|
173
|
-
style: {
|
|
174
|
-
paddingLeft: 0,
|
|
175
|
-
boxShadow: "none"
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
onChange: onNationalNumberChange,
|
|
179
|
-
xs: {
|
|
180
|
-
css: {
|
|
181
|
-
borderWidth: 0
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
onFocus: () => setInputFocused(true),
|
|
185
|
-
onBlur: () => setInputFocused(false),
|
|
186
|
-
ref: inputRef
|
|
181
|
+
},
|
|
182
|
+
onChange: onNationalNumberChange,
|
|
183
|
+
xs: {
|
|
184
|
+
css: {
|
|
185
|
+
borderWidth: 0
|
|
187
186
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
187
|
+
},
|
|
188
|
+
onFocus: () => setInputFocused(true),
|
|
189
|
+
onBlur: () => setInputFocused(false),
|
|
190
|
+
ref: inputRef
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
] })
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
|
|
197
|
+
] });
|
|
196
198
|
}
|
|
197
199
|
);
|
|
198
200
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/theme/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
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"}
|
package/dist/theme/provider.js
CHANGED
|
@@ -13,18 +13,12 @@ const ThemeProvider = ({ theme, children }) => {
|
|
|
13
13
|
const createGlobalStyle = ({ palette, typography }) => {
|
|
14
14
|
const flattenPalette = flatten(palette);
|
|
15
15
|
const colorVars = Object.fromEntries(
|
|
16
|
-
Object.keys(flattenPalette).map((key) => [
|
|
17
|
-
getColorVar(key, false),
|
|
18
|
-
flattenPalette[key]
|
|
19
|
-
])
|
|
16
|
+
Object.keys(flattenPalette).map((key) => [getColorVar(key, false), flattenPalette[key]])
|
|
20
17
|
);
|
|
21
18
|
const typographyVars = Object.fromEntries(
|
|
22
19
|
flatMap(
|
|
23
20
|
Object.keys(typography).map((key) => {
|
|
24
|
-
const typographyVar = getTypographyVar(
|
|
25
|
-
key,
|
|
26
|
-
false
|
|
27
|
-
);
|
|
21
|
+
const typographyVar = getTypographyVar(key, false);
|
|
28
22
|
const { fontSize, lineHeight } = typography[key];
|
|
29
23
|
return [
|
|
30
24
|
[typographyVar.fontSize, fontSize],
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,KAAK,GAAG,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAEnC,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAExC,MAAM,MAAM,YAAY,CAAC,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC;AAE3D,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvE,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAErG,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE1D;;;;;;GAMG;AAEH,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,UAAU,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,GAC/E,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG;KAAG,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS;CAAE,CAAC;AAEvE,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG;IACxD,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@janbox/storefront-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "Storefront UI component library for Janbox",
|
|
5
5
|
"author": "Janbox",
|
|
6
6
|
"keywords": [
|
|
@@ -23,10 +23,6 @@
|
|
|
23
23
|
"types": "./dist/theme/index.d.ts",
|
|
24
24
|
"default": "./dist/theme/index.js"
|
|
25
25
|
},
|
|
26
|
-
"./theme/*": {
|
|
27
|
-
"types": "./dist/theme/*.d.ts",
|
|
28
|
-
"default": "./dist/theme/*.js"
|
|
29
|
-
},
|
|
30
26
|
"./hooks": {
|
|
31
27
|
"types": "./dist/hooks/index.d.ts",
|
|
32
28
|
"default": "./dist/hooks/index.js"
|
|
@@ -57,9 +53,9 @@
|
|
|
57
53
|
"access": "restricted"
|
|
58
54
|
},
|
|
59
55
|
"peerDependencies": {
|
|
60
|
-
"@emotion/react": "
|
|
61
|
-
"react": ">=
|
|
62
|
-
"react-dom": ">=
|
|
56
|
+
"@emotion/react": "*",
|
|
57
|
+
"react": ">=19.0.0",
|
|
58
|
+
"react-dom": ">=19.0.0"
|
|
63
59
|
},
|
|
64
60
|
"dependencies": {
|
|
65
61
|
"@floating-ui/react": "^0.27.13",
|
|
@@ -75,7 +71,6 @@
|
|
|
75
71
|
"flat": "^6.0.1",
|
|
76
72
|
"highlight-words-core": "^1.2.3",
|
|
77
73
|
"html-react-parser": "^5.2.2",
|
|
78
|
-
"jotai": "^2.12.2",
|
|
79
74
|
"lodash-es": "^4.17.21",
|
|
80
75
|
"motion": "^11.15.0",
|
|
81
76
|
"overlayscrollbars-react": "^0.5.6",
|
|
@@ -84,13 +79,9 @@
|
|
|
84
79
|
"react-i18next": "^14.0.0",
|
|
85
80
|
"react-player": "^3.3.3",
|
|
86
81
|
"react-router": "^7.9.6",
|
|
87
|
-
"react-zoom-pan-pinch": "^3.7.0"
|
|
88
|
-
"usehooks-ts": "^3.1.1",
|
|
89
|
-
"uuid": "^10.0.0"
|
|
82
|
+
"react-zoom-pan-pinch": "^3.7.0"
|
|
90
83
|
},
|
|
91
84
|
"devDependencies": {
|
|
92
|
-
"@emotion/react": "^11.13.3",
|
|
93
|
-
"@emotion/serialize": "^1.3.3",
|
|
94
85
|
"@eslint/js": "^9.24.0",
|
|
95
86
|
"@storybook/builder-vite": "^10.2.14",
|
|
96
87
|
"@storybook/react-vite": "^10.2.14",
|
|
@@ -100,7 +91,6 @@
|
|
|
100
91
|
"@types/react": "^19.1.8",
|
|
101
92
|
"@types/react-date-range": "^1.4.10",
|
|
102
93
|
"@types/react-dom": "^19.1.6",
|
|
103
|
-
"@types/uuid": "^10.0.0",
|
|
104
94
|
"csstype": "^3.1.3",
|
|
105
95
|
"eslint": "^9.24.0",
|
|
106
96
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -111,8 +101,6 @@
|
|
|
111
101
|
"globals": "^17.4.0",
|
|
112
102
|
"i18next": "^25.8.13",
|
|
113
103
|
"prettier": "^3.8.1",
|
|
114
|
-
"react": "^19.1.0",
|
|
115
|
-
"react-dom": "^19.1.0",
|
|
116
104
|
"sass-embedded": "^1.97.3",
|
|
117
105
|
"storybook": "^10.2.14",
|
|
118
106
|
"type-fest": "^5.2.0",
|