@janbox/storefront-ui 2.0.6 → 2.0.7
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/badge/badge.d.ts +2 -4
- package/dist/lib/badge/badge.d.ts.map +1 -1
- package/dist/lib/badge/badge.js +3 -4
- package/dist/lib/badge/types.d.ts +4 -4
- package/dist/lib/badge/types.d.ts.map +1 -1
- package/dist/lib/dialog/dialog-close/dialog-close.d.ts +1 -1
- package/dist/lib/dialog/dialog-close/dialog-close.d.ts.map +1 -1
- package/dist/lib/drawer/drawer-close/drawer-close.d.ts +1 -1
- package/dist/lib/drawer/drawer-close/drawer-close.d.ts.map +1 -1
- package/dist/lib/floating/floating/floating.d.ts +2 -53
- package/dist/lib/floating/floating/floating.d.ts.map +1 -1
- package/dist/lib/floating/floating/floating.js +85 -86
- package/dist/lib/floating/floating/types.d.ts +1 -0
- package/dist/lib/floating/floating/types.d.ts.map +1 -1
- package/dist/lib/floating/floating-close/floating-close.d.ts +1 -1
- package/dist/lib/floating/floating-close/floating-close.d.ts.map +1 -1
- package/dist/lib/floating/floating-close/floating-close.js +20 -22
- package/dist/lib/floating/floating-close/types.d.ts.map +1 -1
- package/dist/lib/icon-button/icon-button.d.ts +1 -1
- package/dist/lib/icon-button/icon-button.d.ts.map +1 -1
- package/dist/lib/icon-button/icon-button.js +4 -4
- package/dist/lib/pagination/pagination.d.ts +1 -1
- package/dist/lib/pagination/pagination.d.ts.map +1 -1
- package/dist/lib/pagination/pagination.js +3 -3
- package/dist/lib/popover/popover-close/popover-close.d.ts +1 -1
- package/dist/lib/popover/popover-close/popover-close.d.ts.map +1 -1
- package/dist/lib/tabs/tab-content/types.d.ts +3 -1
- package/dist/lib/tabs/tab-content/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
color?: import('../../types').ColorVariant;
|
|
4
|
-
} & Omit<import('react').HTMLAttributes<HTMLDivElement>, "color"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import { BadgeProps } from './types';
|
|
2
|
+
export declare const Badge: ({ children, ref, ..._props }: BadgeProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
3
|
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/lib/badge/badge.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/lib/badge/badge.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,eAAO,MAAM,KAAK,iCAAkC,UAAU,qDAmC7D,CAAC"}
|
package/dist/lib/badge/badge.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import { isNumber } from "lodash-es";
|
|
4
3
|
import { getBadgeProps } from "./helpers.js";
|
|
5
4
|
import { getColorShadesByVariant } from "../../utils/index.js";
|
|
6
|
-
const Badge =
|
|
7
|
-
const {
|
|
5
|
+
const Badge = ({ children, ref, ..._props }) => {
|
|
6
|
+
const { badgeContent, color = "primary", ...rest } = getBadgeProps(_props);
|
|
8
7
|
const { main } = getColorShadesByVariant(color);
|
|
9
8
|
return /* @__PURE__ */ jsxs("div", { css: { position: "relative", display: "inline-block" }, ...rest, ref, children: [
|
|
10
9
|
/* @__PURE__ */ jsx(
|
|
@@ -36,7 +35,7 @@ const Badge = forwardRef((_props, ref) => {
|
|
|
36
35
|
),
|
|
37
36
|
children
|
|
38
37
|
] });
|
|
39
|
-
}
|
|
38
|
+
};
|
|
40
39
|
export {
|
|
41
40
|
Badge
|
|
42
41
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ColorVariant } from '../../types';
|
|
3
|
-
export type BadgeProps = {
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { ColorVariant, ShallowMerge } from '../../types';
|
|
3
|
+
export type BadgeProps = ShallowMerge<JSX.IntrinsicElements['div'], {
|
|
4
4
|
badgeContent?: number | string;
|
|
5
5
|
color?: ColorVariant;
|
|
6
|
-
}
|
|
6
|
+
}>;
|
|
7
7
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/badge/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/badge/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,YAAY,CACnC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC5B;IACE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CACF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DialogClose:
|
|
1
|
+
export declare const DialogClose: ({ event, reason, className, ref, ...props }: import('../../floating').FloatingCloseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=dialog-close.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-close.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialog/dialog-close/dialog-close.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"dialog-close.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialog/dialog-close/dialog-close.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,gJAAgB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DrawerClose:
|
|
1
|
+
export declare const DrawerClose: ({ event, reason, className, ref, ...props }: import('../../floating').FloatingCloseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=drawer-close.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer-close.d.ts","sourceRoot":"","sources":["../../../../src/lib/drawer/drawer-close/drawer-close.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"drawer-close.d.ts","sourceRoot":"","sources":["../../../../src/lib/drawer/drawer-close/drawer-close.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,gJAAgB,CAAC"}
|
|
@@ -1,54 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Floating: import(
|
|
3
|
-
placement?: Placement;
|
|
4
|
-
onOpenChange?: import('@floating-ui/react').UseFloatingOptions["onOpenChange"];
|
|
5
|
-
open?: boolean;
|
|
6
|
-
elements?: import('@floating-ui/react').UseFloatingOptions["elements"];
|
|
7
|
-
clickProps?: import('@floating-ui/react').UseClickProps;
|
|
8
|
-
dismissProps?: import('@floating-ui/react').UseDismissProps;
|
|
9
|
-
hoverProps?: import('@floating-ui/react').UseHoverProps;
|
|
10
|
-
focusProps?: import('@floating-ui/react').UseFocusProps;
|
|
11
|
-
offsetOptions?: import('@floating-ui/react').OffsetOptions;
|
|
12
|
-
sizeOptions?: import('@floating-ui/react').SizeOptions;
|
|
13
|
-
autoUpdateOptions?: import('@floating-ui/react').AutoUpdateOptions;
|
|
14
|
-
} & {
|
|
15
|
-
children?: import('react').ReactNode | undefined;
|
|
16
|
-
} & import('react').RefAttributes<{
|
|
17
|
-
placement: Placement;
|
|
18
|
-
strategy: import('@floating-ui/react').Strategy;
|
|
19
|
-
middlewareData: import('@floating-ui/react').MiddlewareData;
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
isPositioned: boolean;
|
|
23
|
-
update: () => void;
|
|
24
|
-
floatingStyles: import('react').CSSProperties;
|
|
25
|
-
refs: {
|
|
26
|
-
reference: import('react').MutableRefObject<import('@floating-ui/react-dom').ReferenceType | null>;
|
|
27
|
-
floating: import('react').MutableRefObject<HTMLElement | null>;
|
|
28
|
-
setReference: (node: import('@floating-ui/react-dom').ReferenceType | null) => void;
|
|
29
|
-
setFloating: (node: HTMLElement | null) => void;
|
|
30
|
-
} & import('@floating-ui/react').ExtendedRefs<import('@floating-ui/react').ReferenceType>;
|
|
31
|
-
elements: {
|
|
32
|
-
reference: import('@floating-ui/react-dom').ReferenceType | null;
|
|
33
|
-
floating: HTMLElement | null;
|
|
34
|
-
} & import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
|
|
35
|
-
context: {
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
update: () => void;
|
|
39
|
-
placement: Placement;
|
|
40
|
-
strategy: import('@floating-ui/react').Strategy;
|
|
41
|
-
middlewareData: import('@floating-ui/react').MiddlewareData;
|
|
42
|
-
isPositioned: boolean;
|
|
43
|
-
floatingStyles: import('react').CSSProperties;
|
|
44
|
-
open: boolean;
|
|
45
|
-
onOpenChange: (open: boolean, event?: Event, reason?: import('@floating-ui/react').OpenChangeReason) => void;
|
|
46
|
-
events: import('@floating-ui/react').FloatingEvents;
|
|
47
|
-
dataRef: import('react').MutableRefObject<import('@floating-ui/react').ContextData>;
|
|
48
|
-
nodeId: string | undefined;
|
|
49
|
-
floatingId: string | undefined;
|
|
50
|
-
refs: import('@floating-ui/react').ExtendedRefs<import('@floating-ui/react').ReferenceType>;
|
|
51
|
-
elements: import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
|
|
52
|
-
};
|
|
53
|
-
}>>;
|
|
1
|
+
import { FloatingProps } from './types';
|
|
2
|
+
export declare const Floating: ({ ref, ...props }: FloatingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
54
3
|
//# sourceMappingURL=floating.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating/floating.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"floating.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating/floating.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,QAAQ,sBAAuB,aAAa,qDAYxD,CAAC"}
|
|
@@ -1,97 +1,96 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useImperativeHandle, useMemo } from "react";
|
|
3
3
|
import { useFloatingParentNodeId, FloatingTree, useFloating, autoUpdate, offset, flip, size, useClick, useHover, useFocus, useDismiss, useRole, useInteractions } from "@floating-ui/react";
|
|
4
4
|
import { FloatingContext } from "./helpers.js";
|
|
5
|
-
const
|
|
6
|
-
({
|
|
7
|
-
open,
|
|
8
|
-
placement = "bottom",
|
|
9
|
-
onOpenChange,
|
|
10
|
-
dismissProps = {
|
|
11
|
-
enabled: false
|
|
12
|
-
},
|
|
13
|
-
children,
|
|
14
|
-
clickProps = {
|
|
15
|
-
enabled: false
|
|
16
|
-
},
|
|
17
|
-
focusProps = {
|
|
18
|
-
enabled: false
|
|
19
|
-
},
|
|
20
|
-
hoverProps = {
|
|
21
|
-
enabled: false
|
|
22
|
-
},
|
|
23
|
-
elements,
|
|
24
|
-
offsetOptions = 4,
|
|
25
|
-
sizeOptions,
|
|
26
|
-
autoUpdateOptions
|
|
27
|
-
}, ref) => {
|
|
28
|
-
const floating = useFloating({
|
|
29
|
-
open,
|
|
30
|
-
onOpenChange,
|
|
31
|
-
placement,
|
|
32
|
-
middleware: [
|
|
33
|
-
offset(offsetOptions),
|
|
34
|
-
flip(),
|
|
35
|
-
size({
|
|
36
|
-
...sizeOptions,
|
|
37
|
-
apply(args) {
|
|
38
|
-
var _a;
|
|
39
|
-
const { availableHeight, availableWidth, rects, elements: elements2, placement: placement2, x } = args;
|
|
40
|
-
const styles = {};
|
|
41
|
-
if (rects.floating.height > availableHeight) {
|
|
42
|
-
styles.height = `${availableHeight}px`;
|
|
43
|
-
}
|
|
44
|
-
if (rects.floating.width > availableWidth) {
|
|
45
|
-
const maxWidth = Math.min(rects.floating.width, window.innerWidth);
|
|
46
|
-
styles.maxWidth = `${maxWidth}px`;
|
|
47
|
-
const verticalPlacements = [
|
|
48
|
-
"top",
|
|
49
|
-
"top-start",
|
|
50
|
-
"top-end",
|
|
51
|
-
"bottom",
|
|
52
|
-
"bottom-start",
|
|
53
|
-
"bottom-end"
|
|
54
|
-
];
|
|
55
|
-
const isVertical = verticalPlacements.includes(placement2);
|
|
56
|
-
if (isVertical) {
|
|
57
|
-
styles.left = `${-x + (window.innerWidth - rects.floating.width) / 2}px`;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
Object.assign(elements2.floating.style, styles);
|
|
61
|
-
(_a = sizeOptions == null ? void 0 : sizeOptions.apply) == null ? void 0 : _a.call(sizeOptions, args);
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
],
|
|
65
|
-
whileElementsMounted: (...args) => {
|
|
66
|
-
return autoUpdate(...args, autoUpdateOptions);
|
|
67
|
-
},
|
|
68
|
-
elements
|
|
69
|
-
});
|
|
70
|
-
useImperativeHandle(ref, () => floating, [floating]);
|
|
71
|
-
const { context } = floating;
|
|
72
|
-
const click = useClick(context, clickProps);
|
|
73
|
-
const hover = useHover(context, hoverProps);
|
|
74
|
-
const focus = useFocus(context, focusProps);
|
|
75
|
-
const dismiss = useDismiss(context, dismissProps);
|
|
76
|
-
const role = useRole(context);
|
|
77
|
-
const interactions = useInteractions([click, dismiss, role, hover, focus]);
|
|
78
|
-
const contextValue = useMemo(
|
|
79
|
-
() => ({
|
|
80
|
-
...floating,
|
|
81
|
-
...interactions
|
|
82
|
-
}),
|
|
83
|
-
[floating, interactions]
|
|
84
|
-
);
|
|
85
|
-
return /* @__PURE__ */ jsx(FloatingContext.Provider, { value: contextValue, children });
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
const Floating = forwardRef((props, ref) => {
|
|
5
|
+
const Floating = ({ ref, ...props }) => {
|
|
89
6
|
const parentId = useFloatingParentNodeId();
|
|
90
7
|
if (parentId) {
|
|
91
8
|
return /* @__PURE__ */ jsx(FloatingCore, { ...props, ref });
|
|
92
9
|
}
|
|
93
10
|
return /* @__PURE__ */ jsx(FloatingTree, { children: /* @__PURE__ */ jsx(FloatingCore, { ...props, ref }) });
|
|
94
|
-
}
|
|
11
|
+
};
|
|
12
|
+
const FloatingCore = ({
|
|
13
|
+
open,
|
|
14
|
+
placement = "bottom",
|
|
15
|
+
onOpenChange,
|
|
16
|
+
dismissProps = {
|
|
17
|
+
enabled: false
|
|
18
|
+
},
|
|
19
|
+
children,
|
|
20
|
+
clickProps = {
|
|
21
|
+
enabled: false
|
|
22
|
+
},
|
|
23
|
+
focusProps = {
|
|
24
|
+
enabled: false
|
|
25
|
+
},
|
|
26
|
+
hoverProps = {
|
|
27
|
+
enabled: false
|
|
28
|
+
},
|
|
29
|
+
elements,
|
|
30
|
+
offsetOptions = 4,
|
|
31
|
+
sizeOptions,
|
|
32
|
+
autoUpdateOptions,
|
|
33
|
+
ref
|
|
34
|
+
}) => {
|
|
35
|
+
const floating = useFloating({
|
|
36
|
+
open,
|
|
37
|
+
onOpenChange,
|
|
38
|
+
placement,
|
|
39
|
+
middleware: [
|
|
40
|
+
offset(offsetOptions),
|
|
41
|
+
flip(),
|
|
42
|
+
size({
|
|
43
|
+
...sizeOptions,
|
|
44
|
+
apply(args) {
|
|
45
|
+
var _a;
|
|
46
|
+
const { availableHeight, availableWidth, rects, elements: elements2, placement: placement2, x } = args;
|
|
47
|
+
const styles = {};
|
|
48
|
+
if (rects.floating.height > availableHeight) {
|
|
49
|
+
styles.height = `${availableHeight}px`;
|
|
50
|
+
}
|
|
51
|
+
if (rects.floating.width > availableWidth) {
|
|
52
|
+
const maxWidth = Math.min(rects.floating.width, window.innerWidth);
|
|
53
|
+
styles.maxWidth = `${maxWidth}px`;
|
|
54
|
+
const verticalPlacements = [
|
|
55
|
+
"top",
|
|
56
|
+
"top-start",
|
|
57
|
+
"top-end",
|
|
58
|
+
"bottom",
|
|
59
|
+
"bottom-start",
|
|
60
|
+
"bottom-end"
|
|
61
|
+
];
|
|
62
|
+
const isVertical = verticalPlacements.includes(placement2);
|
|
63
|
+
if (isVertical) {
|
|
64
|
+
styles.left = `${-x + (window.innerWidth - rects.floating.width) / 2}px`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
Object.assign(elements2.floating.style, styles);
|
|
68
|
+
(_a = sizeOptions == null ? void 0 : sizeOptions.apply) == null ? void 0 : _a.call(sizeOptions, args);
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
],
|
|
72
|
+
whileElementsMounted: (...args) => {
|
|
73
|
+
return autoUpdate(...args, autoUpdateOptions);
|
|
74
|
+
},
|
|
75
|
+
elements
|
|
76
|
+
});
|
|
77
|
+
useImperativeHandle(ref, () => floating, [floating]);
|
|
78
|
+
const { context } = floating;
|
|
79
|
+
const click = useClick(context, clickProps);
|
|
80
|
+
const hover = useHover(context, hoverProps);
|
|
81
|
+
const focus = useFocus(context, focusProps);
|
|
82
|
+
const dismiss = useDismiss(context, dismissProps);
|
|
83
|
+
const role = useRole(context);
|
|
84
|
+
const interactions = useInteractions([click, dismiss, role, hover, focus]);
|
|
85
|
+
const contextValue = useMemo(
|
|
86
|
+
() => ({
|
|
87
|
+
...floating,
|
|
88
|
+
...interactions
|
|
89
|
+
}),
|
|
90
|
+
[floating, interactions]
|
|
91
|
+
);
|
|
92
|
+
return /* @__PURE__ */ jsx(FloatingContext.Provider, { value: contextValue, children });
|
|
93
|
+
};
|
|
95
94
|
export {
|
|
96
95
|
Floating
|
|
97
96
|
};
|
|
@@ -12,6 +12,7 @@ export type FloatingProps = PropsWithChildren<{
|
|
|
12
12
|
offsetOptions?: OffsetOptions;
|
|
13
13
|
sizeOptions?: SizeOptions;
|
|
14
14
|
autoUpdateOptions?: AutoUpdateOptions;
|
|
15
|
+
ref?: React.Ref<FloatingRef>;
|
|
15
16
|
}>;
|
|
16
17
|
export type FloatingRef = UseFloatingReturn;
|
|
17
18
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;IAC5C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAClD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;IAC5C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAClD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B,CAAC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FloatingCloseProps } from './types';
|
|
2
|
-
export declare const FloatingClose:
|
|
2
|
+
export declare const FloatingClose: ({ event, reason, className, ref, ...props }: FloatingCloseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=floating-close.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-close.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-close/floating-close.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"floating-close.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-close/floating-close.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,aAAa,gDAA2D,kBAAkB,qDAwBtG,CAAC"}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
3
|
import { useMergeRefs } from "@floating-ui/react";
|
|
4
4
|
import { useFloatingContext } from "../floating/helpers.js";
|
|
5
5
|
import { cn } from "../../../utils/stylesheet.js";
|
|
6
|
-
const FloatingClose =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
);
|
|
6
|
+
const FloatingClose = ({ event = "click", reason, className, ref, ...props }) => {
|
|
7
|
+
const wrapperRef = useRef(null);
|
|
8
|
+
const {
|
|
9
|
+
context: { onOpenChange }
|
|
10
|
+
} = useFloatingContext();
|
|
11
|
+
const mergedRefs = useMergeRefs([ref, wrapperRef]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const wrapperEl = wrapperRef.current;
|
|
14
|
+
if (!wrapperEl) return;
|
|
15
|
+
const handleEvent = function(event2) {
|
|
16
|
+
onOpenChange == null ? void 0 : onOpenChange(false, event2, reason);
|
|
17
|
+
};
|
|
18
|
+
wrapperEl.addEventListener(event, handleEvent);
|
|
19
|
+
return () => {
|
|
20
|
+
wrapperEl.removeEventListener(event, handleEvent);
|
|
21
|
+
};
|
|
22
|
+
}, [event, onOpenChange, reason]);
|
|
23
|
+
return /* @__PURE__ */ jsx("div", { css: { display: "contents" }, className: cn(className), ...props, ref: mergedRefs });
|
|
24
|
+
};
|
|
27
25
|
export {
|
|
28
26
|
FloatingClose
|
|
29
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-close/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-close/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAC3C,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC5B;IACE,KAAK,CAAC,EAAE,MAAM,mBAAmB,CAAC;IAClC,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,CACF,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IconButtonProps } from './types';
|
|
2
|
-
export declare const IconButton:
|
|
2
|
+
export declare const IconButton: ({ children, ref, ..._props }: IconButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/lib/icon-button/icon-button.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAA6B,MAAM,SAAS,CAAC;AAWrE,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/lib/icon-button/icon-button.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAA6B,MAAM,SAAS,CAAC;AAWrE,eAAO,MAAM,UAAU,iCAAkC,eAAe,qDA2HvE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useRef } from "react";
|
|
3
3
|
import { useMergeRefs } from "@floating-ui/react";
|
|
4
4
|
import { getIconButtonProps } from "./helpers.js";
|
|
5
5
|
import { useRippleEffect } from "../../hooks/use-ripple-effect/index.js";
|
|
@@ -11,8 +11,8 @@ import { getColorShadesByVariant, getSizeVariantState } from "../../utils/index.
|
|
|
11
11
|
import { animateSpinStyle } from "../../constants/emotion.js";
|
|
12
12
|
import { ensureBoolean } from "../../utils/common.js";
|
|
13
13
|
import { Icon } from "../icon/icon.js";
|
|
14
|
-
const IconButton =
|
|
15
|
-
const { size, color, variant,
|
|
14
|
+
const IconButton = ({ children, ref, ..._props }) => {
|
|
15
|
+
const { size, color, variant, icon, isLoading, sx, sm, md, lg, ...rest } = getIconButtonProps(_props);
|
|
16
16
|
const {
|
|
17
17
|
dark,
|
|
18
18
|
light,
|
|
@@ -131,7 +131,7 @@ const IconButton = forwardRef((_props, ref) => {
|
|
|
131
131
|
}
|
|
132
132
|
)
|
|
133
133
|
] });
|
|
134
|
-
}
|
|
134
|
+
};
|
|
135
135
|
const createStyle = ({ size } = {}) => {
|
|
136
136
|
const { inputSize } = getSizeVariantState(size);
|
|
137
137
|
return [
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PaginationProps } from './types';
|
|
2
|
-
export declare const Pagination:
|
|
2
|
+
export declare const Pagination: ({ ref, ..._props }: PaginationProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/lib/pagination/pagination.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAY1C,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/lib/pagination/pagination.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAY1C,eAAO,MAAM,UAAU,uBAAwB,eAAe,qDAgL7D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment } from "react";
|
|
3
3
|
import { getPaginationProps, getPageRange } from "./helpers.js";
|
|
4
4
|
import ArrowLeftIcon from "../../assets/svg/arrow-left.svg.js";
|
|
5
5
|
import ArrowForwardIcon from "../../assets/svg/arrow-forward.svg.js";
|
|
@@ -11,7 +11,7 @@ import { getSizeVariantState } from "../../utils/index.js";
|
|
|
11
11
|
import { Text } from "../text/text.js";
|
|
12
12
|
import { IconButton } from "../icon-button/icon-button.js";
|
|
13
13
|
import { Icon } from "../icon/icon.js";
|
|
14
|
-
const Pagination =
|
|
14
|
+
const Pagination = ({ ref, ..._props }) => {
|
|
15
15
|
var _a, _b, _c, _d;
|
|
16
16
|
const {
|
|
17
17
|
page = 1,
|
|
@@ -141,7 +141,7 @@ const Pagination = forwardRef((_props, ref) => {
|
|
|
141
141
|
showNextPageButton && /* @__PURE__ */ jsx(PaginationButton, { "aria-disabled": page >= count, color: (_c = states == null ? void 0 : states.normal) == null ? void 0 : _c.color, onClick: handleNextClick, children: /* @__PURE__ */ jsx(PaginationIcon, { source: ArrowRightIcon }) }),
|
|
142
142
|
showLastPageButton && /* @__PURE__ */ jsx(PaginationButton, { "aria-disabled": page >= count, color: (_d = states == null ? void 0 : states.normal) == null ? void 0 : _d.color, onClick: handleLastClick, children: /* @__PURE__ */ jsx(PaginationIcon, { source: ArrowForwardIcon }) })
|
|
143
143
|
] });
|
|
144
|
-
}
|
|
144
|
+
};
|
|
145
145
|
export {
|
|
146
146
|
Pagination
|
|
147
147
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PopoverClose:
|
|
1
|
+
export declare const PopoverClose: ({ event, reason, className, ref, ...props }: import('../../floating').FloatingCloseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=popover-close.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-close.d.ts","sourceRoot":"","sources":["../../../../src/lib/popover/popover-close/popover-close.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"popover-close.d.ts","sourceRoot":"","sources":["../../../../src/lib/popover/popover-close/popover-close.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,gJAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/tabs/tab-content/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/tabs/tab-content/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;IAC9C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC,CAAC,CAAC"}
|