@kkkarsss/ui 1.3.0 → 1.4.0
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,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LucideProps } from 'lucide-react';
|
|
2
|
+
import { type FC, type PropsWithChildren, type ReactNode, ReactElement } from 'react';
|
|
2
3
|
type TProps = {
|
|
3
4
|
leftPanel?: ReactNode;
|
|
4
5
|
rightPanel?: ReactNode;
|
|
6
|
+
leftIcon?: ReactElement<LucideProps>;
|
|
7
|
+
rightIcon?: ReactElement<LucideProps>;
|
|
5
8
|
};
|
|
6
9
|
export declare const MainPageLayout: FC<PropsWithChildren<TProps>>;
|
|
7
10
|
export {};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Menu, X } from 'lucide-react';
|
|
3
|
+
import { Fragment, useState } from 'react';
|
|
3
4
|
import { useWidget } from '../../../providers';
|
|
5
|
+
import { jc } from '../../../utils';
|
|
4
6
|
import { Flex } from '../flex/flex';
|
|
5
|
-
|
|
7
|
+
import { IconAction } from '../icon-action/icon-action';
|
|
8
|
+
export const MainPageLayout = ({ children, leftPanel, rightPanel, leftIcon, rightIcon, }) => {
|
|
6
9
|
const { widget } = useWidget();
|
|
7
|
-
|
|
10
|
+
const [expandedPanel, setExpandedPanel] = useState(null);
|
|
11
|
+
const toggleLeft = () => setExpandedPanel(expandedPanel === 'left' ? null : 'left');
|
|
12
|
+
const toggleRight = () => setExpandedPanel(expandedPanel === 'right' ? null : 'right');
|
|
13
|
+
return (_jsx("div", { className: "@container/layout w-full h-[100dvh]", children: _jsxs("main", { className: "grid h-full w-full grid-cols-1 @s/layout:grid-cols-[300px_1fr_300px] @s/layout:py-xl @s/layout:px-l @s/layout:gap-l py-m px-s gap-s relative overflow-hidden", children: [_jsx("aside", { className: "hidden @s/layout:block h-full w-full", children: leftPanel }), _jsx("div", { className: "@s/layout:hidden absolute left-4 top-4 z-50", children: _jsx(IconAction, { icon: expandedPanel === 'left' ? _jsx(X, { size: 20 }) : leftIcon || _jsx(Menu, { size: 20 }), onClick: toggleLeft }) }), _jsxs(Flex, { justify: 'center', gap: '16px', type: 'fill', className: jc(expandedPanel ? 'hidden @s/layout:flex' : 'flex', 'h-full mt-[50px] @s/layout:m-0'), children: [children, widget && _jsx(Fragment, { children: widget.ui }, widget.id)] }), _jsx("aside", { className: "hidden @s/layout:block h-full w-full", children: rightPanel }), _jsx("div", { className: "@s/layout:hidden absolute right-4 top-4 z-50", children: _jsx(IconAction, { icon: expandedPanel === 'right' ? _jsx(X, { size: 20 }) : rightIcon || _jsx(Menu, { size: 20 }), onClick: toggleRight }) }), expandedPanel && (_jsx("div", { className: "@s/layout:hidden absolute inset-0 z-40 bg-[var(--background)] pt-16 px-4 pb-4 overflow-auto", children: expandedPanel === 'left' ? leftPanel : rightPanel }))] }) }));
|
|
8
14
|
};
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Activity, BookmarkCheck, Calendar, Clock3, LandPlot, Newspaper, Settings, User } from 'lucide-react';
|
|
2
3
|
import { MainPageLayout } from './main-page-layout';
|
|
3
|
-
import { Typo } from '../../information';
|
|
4
|
+
import { Block, Cell, CellsBlock, Typo } from '../../information';
|
|
5
|
+
import { Flex } from '../flex/flex';
|
|
6
|
+
import { Offset } from '../offset/offset';
|
|
4
7
|
const meta = {
|
|
5
8
|
title: 'Layout/MainPageLayout',
|
|
6
9
|
component: MainPageLayout,
|
|
7
10
|
tags: ['autodocs'],
|
|
8
11
|
parameters: {
|
|
9
12
|
layout: 'fullscreen',
|
|
13
|
+
chromatic: { delay: 300 },
|
|
10
14
|
},
|
|
11
15
|
};
|
|
12
16
|
export default meta;
|
|
17
|
+
const LeftSidebarMock = () => (_jsx(Flex, { direction: 'column', gap: '16px', type: 'fill', children: _jsxs(CellsBlock, { title: _jsx(Typo, { size: 'm', weight: '500', color: 'secondary', children: "John Doe" }), children: [_jsx(Cell, { title: _jsx(Typo, { children: "Tasks" }), description: _jsx(Typo, { size: 's', color: 'secondary', children: "Manage everything you should do" }), accLeft: [{ icon: BookmarkCheck }], active: true }), _jsx(Cell, { title: _jsx(Typo, { children: "Projects" }), description: _jsx(Typo, { size: 's', color: 'secondary', children: "Unite tasks and data in one screen" }), accLeft: [{ icon: LandPlot }] }), _jsx(Cell, { title: _jsx(Typo, { children: "Tips" }), description: _jsx(Typo, { size: 's', color: 'secondary', children: "Notes to your tasks and projects" }), accLeft: [{ icon: Newspaper }] }), _jsx(Cell, { title: _jsx(Typo, { children: "Calendar" }), description: _jsx(Typo, { size: 's', color: 'secondary', children: "Your routine and added tasks" }), accLeft: [{ icon: Calendar }] })] }) }));
|
|
18
|
+
const RightSidebarMock = () => (_jsxs(Flex, { direction: 'column', type: 'fill', gap: '16px', children: [_jsx(CellsBlock, { title: _jsx(Typo, { size: 'm', color: 'secondary', weight: '500', children: "Variables" }), children: _jsx(Cell, { title: _jsx(Typo, { children: "System settings" }), description: _jsx(Typo, { size: 's', color: 'secondary', children: "Do not affect the calculation" }), accLeft: [{ icon: Settings }] }) }), _jsxs(CellsBlock, { title: _jsx(Typo, { size: 'm', color: 'secondary', weight: '500', children: "Stats" }), children: [_jsx(Cell, { title: _jsx(Typo, { children: "Productivity" }), description: _jsx(Typo, { size: 's', color: 'secondary', children: "Tasks/day" }), accLeft: [{ icon: Activity }] }), _jsx(Cell, { title: _jsx(Typo, { children: "Latest activity" }), description: _jsx(Typo, { size: 's', color: 'secondary', children: "History of your actions across service" }), accLeft: [{ icon: Clock3 }] })] })] }));
|
|
13
19
|
export const Default = {
|
|
14
20
|
args: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
leftIcon: _jsx(Settings, { size: 20 }),
|
|
22
|
+
rightIcon: _jsx(User, { size: 20 }),
|
|
23
|
+
leftPanel: _jsx(LeftSidebarMock, {}),
|
|
24
|
+
rightPanel: _jsx(RightSidebarMock, {}),
|
|
25
|
+
children: (_jsx(Block, { title: _jsx(Typo, { size: "xl", weight: "500", children: "Main Content Area" }), children: _jsxs(Offset, { children: [_jsx(Typo, { children: "\u042D\u0442\u043E \u0434\u0435\u043C\u043E-\u0432\u0435\u0440\u0441\u0438\u044F \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0433\u043E \u043C\u0430\u043A\u0435\u0442\u0430 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0441 \u0430\u0434\u0430\u043F\u0442\u0438\u0432\u043D\u044B\u043C\u0438 \u0441\u0430\u0439\u0434\u0431\u0430\u0440\u0430\u043C\u0438." }), _jsx(Typo, { color: "secondary", children: "\u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u043E\u043A\u043D\u0430 (\u0438\u043B\u0438 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440\u0430 \u0432 Storybook), \u0447\u0442\u043E\u0431\u044B \u0443\u0432\u0438\u0434\u0435\u0442\u044C \u0430\u0434\u0430\u043F\u0442\u0438\u0432\u043D\u043E\u0435 \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435:" }), _jsxs("ul", { className: "list-disc ml-6 space-y-2", children: [_jsx("li", { children: _jsx(Typo, { size: "s", children: "\u041F\u0440\u0438 \u0448\u0438\u0440\u0438\u043D\u0435 > 1100px (L): \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u044E\u0442\u0441\u044F \u043E\u0431\u0430 \u0441\u0430\u0439\u0434\u0431\u0430\u0440\u0430." }) }), _jsx("li", { children: _jsx(Typo, { size: "s", children: "\u041F\u0440\u0438 \u0448\u0438\u0440\u0438\u043D\u0435 680px - 1100px (M): \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u044E\u0442\u0441\u044F \u043E\u0431\u0430 \u0441\u0430\u0439\u0434\u0431\u0430\u0440\u0430 (\u043D\u0430 \u0431\u0430\u0437\u0435 @m/layout)." }) }), _jsx("li", { children: _jsx(Typo, { size: "s", children: "\u041F\u0440\u0438 \u0448\u0438\u0440\u0438\u043D\u0435 < 680px (S): \u0441\u0430\u0439\u0434\u0431\u0430\u0440\u044B \u0441\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u043F\u043E\u044F\u0432\u043B\u044F\u044E\u0442\u0441\u044F \u0438\u043A\u043E\u043D\u043A\u0438 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u043E\u0432 \u0432 \u0443\u0433\u043B\u0430\u0445." }) }), _jsx("li", { children: _jsx(Typo, { size: "s", children: "\u041D\u0430\u0436\u0430\u0442\u0438\u0435 \u043D\u0430 \u0438\u043A\u043E\u043D\u043A\u0443 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u0441\u0430\u0439\u0434\u0431\u0430\u0440 \u0432\u043E \u0432\u0435\u0441\u044C \u044D\u043A\u0440\u0430\u043D." }) })] }), _jsx("div", { className: "h-[1000px] bg-secondary/10 flex items-center justify-center rounded-lg border-2 border-dashed border-secondary/20", children: _jsx(Typo, { color: "secondary", children: "\u0414\u043B\u0438\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442 \u0434\u043B\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438" }) })] }) })),
|
|
18
26
|
},
|
|
19
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kkkarsss/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "UI Kit for kkkarsss projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"@storybook/addon-vitest": "^10.2.7",
|
|
33
33
|
"@storybook/react": "^10.2.7",
|
|
34
34
|
"@storybook/react-vite": "^10.2.7",
|
|
35
|
+
"@tailwindcss/container-queries": "^0.1.1",
|
|
36
|
+
"tailwindcss": "^3.4.19",
|
|
35
37
|
"@types/node": "^25.0.10",
|
|
36
38
|
"@types/react": "^19.2.9",
|
|
37
39
|
"@types/react-dom": "^19.2.3",
|
|
@@ -53,7 +55,6 @@
|
|
|
53
55
|
"react": "^19.2.3",
|
|
54
56
|
"react-dom": "^19.2.3",
|
|
55
57
|
"storybook": "^10.2.7",
|
|
56
|
-
"tailwindcss": "^3.4.19",
|
|
57
58
|
"typescript": "5.9.3",
|
|
58
59
|
"typescript-eslint": "^8.53.1",
|
|
59
60
|
"vite": "^7.3.1",
|