@kkkarsss/ui 1.4.5 → 1.4.6
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.
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { animated, config, useSpring } from '@react-spring/web';
|
|
3
|
+
import { CornerUpLeft } from 'lucide-react';
|
|
3
4
|
import { jc } from '../../../utils';
|
|
4
|
-
import { Flex, Offset } from '../../layout';
|
|
5
|
+
import { Flex, IconAction, Offset } from '../../layout';
|
|
5
6
|
const typeMap = {
|
|
6
7
|
fill: 'h-full',
|
|
7
8
|
hug: 'h-auto',
|
|
8
9
|
};
|
|
9
|
-
export const Block = ({ children, title, topAcc, filters, type = 'fill', maxWidth, maxHeight, minWidth, minHeight, animate = true, }) => {
|
|
10
|
+
export const Block = ({ children, title, topAcc, filters, type = 'fill', maxWidth, maxHeight, minWidth, minHeight, animate = true, onBack, }) => {
|
|
10
11
|
const springs = useSpring({
|
|
11
12
|
from: { opacity: 0, transform: 'translateY(10px)' },
|
|
12
13
|
to: { opacity: 1, transform: 'translateY(0px)' },
|
|
13
14
|
config: config.gentle,
|
|
14
15
|
immediate: !animate,
|
|
15
16
|
});
|
|
16
|
-
return (_jsxs(animated.div, { className: jc('w-full flex flex-col', 'rounded-2xl', 'bg-background-accent', 'shadow-[0_0_8px_var(--shadow)]', 'scrollbar-none', 'overflow-hidden', typeMap[type]), style: { ...springs, maxWidth, maxHeight, minWidth, minHeight }, children: [_jsx("div", { className: jc('sticky', 'top-0', 'z-20', 'bg-background-accent', 'w-full', 'shrink-0'), children: _jsxs(Flex, { direction: 'column', children: [_jsxs(Flex, { justify: 'space-between', align: 'center', children: [title && _jsx(Offset, { type: 'both', children: title }), _jsx("div", { className: 'mx-m', children: _jsx(Flex, { direction: 'column', children: _jsx(Flex, { align: 'center', gap: '4px', children: topAcc }) }) })] }), filters && _jsx("div", { className: 'mb-l', children: filters })] }) }), _jsx("div", { className: "flex-1 overflow-auto scrollbar-none", children: _jsx(Flex, { direction: 'column', type: 'fill', children: children }) })] }));
|
|
17
|
+
return (_jsxs(animated.div, { className: jc('w-full flex flex-col', 'rounded-2xl', 'bg-background-accent', 'shadow-[0_0_8px_var(--shadow)]', 'scrollbar-none', 'overflow-hidden', typeMap[type]), style: { ...springs, maxWidth, maxHeight, minWidth, minHeight }, children: [_jsx("div", { className: jc('sticky', 'top-0', 'z-20', 'bg-background-accent', 'w-full', 'shrink-0'), children: _jsxs(Flex, { direction: 'column', children: [_jsxs(Flex, { justify: 'space-between', align: 'center', children: [title && (_jsxs(Flex, { gap: '4px', align: 'center', children: [onBack && _jsx(IconAction, { icon: _jsx(CornerUpLeft, { size: 16, color: 'var(--accent)' }), onClick: onBack }), _jsx(Offset, { type: 'both', children: title })] })), _jsx("div", { className: 'mx-m', children: _jsx(Flex, { direction: 'column', children: _jsx(Flex, { align: 'center', gap: '4px', children: topAcc }) }) })] }), filters && _jsx("div", { className: 'mb-l', children: filters })] }) }), _jsx("div", { className: "flex-1 overflow-auto scrollbar-none", children: _jsx(Flex, { direction: 'column', type: 'fill', children: children }) })] }));
|
|
17
18
|
};
|