quix-ui 1.2.2 → 1.2.3
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/forms/utils.d.ts +3 -0
- package/dist/components/layout/Layout.d.ts +4 -1
- package/dist/components/layout/Layout.stories.d.ts +1 -1
- package/dist/components/layout/types.d.ts +9 -3
- package/dist/index.js +431 -192
- package/dist/view/Layout.stories.d.ts +2 -2
- package/package.json +4 -3
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export declare function get(obj: any, path: string): any;
|
|
2
2
|
export declare function set(obj: any, path: string, value: any): any;
|
|
3
|
+
export declare const storageCache: Map<string, string | null>;
|
|
4
|
+
export declare function getLocalStorage(key: string): string | null | undefined;
|
|
5
|
+
export declare function setLocalStorage(key: string, value: string): void;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { LayoutProps, menuItemsDynamicStyleProps, menuItemsProps, sideMenuProps } from "./types";
|
|
2
2
|
import './layout.style.css';
|
|
3
3
|
export declare function Layout(props: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare function SideMenu(props:
|
|
4
|
+
export declare function SideMenu(props: {
|
|
5
|
+
sideMenu: sideMenuProps;
|
|
6
|
+
top: number;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
8
|
export declare function MenuItem(item: menuItemsProps, ElementType?: "NavLink" | "Link" | "a" | "div", menuItemsDynamicStyle?: menuItemsDynamicStyleProps): import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export declare function Header(): import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
export declare function Content(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,9 +2,15 @@ import React, { JSX } from "react";
|
|
|
2
2
|
export interface LayoutProps {
|
|
3
3
|
backgroundColor?: string;
|
|
4
4
|
className?: string;
|
|
5
|
-
|
|
5
|
+
layoutStyle?: React.CSSProperties;
|
|
6
6
|
sideMenu?: sideMenuProps;
|
|
7
7
|
ElementStyle?: React.CSSProperties;
|
|
8
|
+
children?: JSX.Element;
|
|
9
|
+
header?: HeaderProps;
|
|
10
|
+
}
|
|
11
|
+
export interface HeaderProps {
|
|
12
|
+
height: number;
|
|
13
|
+
style: React.CSSProperties;
|
|
8
14
|
}
|
|
9
15
|
export interface menuItemsProps {
|
|
10
16
|
label: string;
|
|
@@ -23,12 +29,12 @@ export interface menuItemsProps {
|
|
|
23
29
|
export interface sideMenuProps {
|
|
24
30
|
width: number | string;
|
|
25
31
|
height: number | string;
|
|
26
|
-
|
|
32
|
+
sideMenuStyle?: React.CSSProperties;
|
|
27
33
|
menuItems: menuItemsProps[];
|
|
28
34
|
ElementType?: "NavLink" | "Link" | "a" | "div";
|
|
29
35
|
ElementStyle?: React.CSSProperties;
|
|
30
36
|
menuItemsDynamicStyle?: menuItemsDynamicStyleProps;
|
|
31
|
-
|
|
37
|
+
bottomSection?: menuItemsProps[];
|
|
32
38
|
}
|
|
33
39
|
export interface menuItemsDynamicStyleProps {
|
|
34
40
|
backgroundColor: string;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,95 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import * as React3 from 'react';
|
|
3
|
-
import { useState } from 'react';
|
|
3
|
+
import { useRef, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
function _arrayLikeToArray(r, a) {
|
|
6
|
+
(null == a || a > r.length) && (a = r.length);
|
|
7
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
8
|
+
return n;
|
|
9
|
+
}
|
|
10
|
+
function _arrayWithHoles(r) {
|
|
11
|
+
if (Array.isArray(r)) return r;
|
|
12
|
+
}
|
|
13
|
+
function _defineProperty(e, r, t) {
|
|
14
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
15
|
+
value: t,
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true
|
|
19
|
+
}) : e[r] = t, e;
|
|
20
|
+
}
|
|
21
|
+
function _iterableToArrayLimit(r, l) {
|
|
22
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
23
|
+
if (null != t) {
|
|
24
|
+
var e,
|
|
25
|
+
n,
|
|
26
|
+
i,
|
|
27
|
+
u,
|
|
28
|
+
a = [],
|
|
29
|
+
f = true,
|
|
30
|
+
o = false;
|
|
31
|
+
try {
|
|
32
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
33
|
+
} catch (r) {
|
|
34
|
+
o = true, n = r;
|
|
35
|
+
} finally {
|
|
36
|
+
try {
|
|
37
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
38
|
+
} finally {
|
|
39
|
+
if (o) throw n;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return a;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function _nonIterableRest() {
|
|
46
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
47
|
+
}
|
|
48
|
+
function ownKeys(e, r) {
|
|
49
|
+
var t = Object.keys(e);
|
|
50
|
+
if (Object.getOwnPropertySymbols) {
|
|
51
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
52
|
+
r && (o = o.filter(function (r) {
|
|
53
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
54
|
+
})), t.push.apply(t, o);
|
|
55
|
+
}
|
|
56
|
+
return t;
|
|
57
|
+
}
|
|
58
|
+
function _objectSpread2(e) {
|
|
59
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
60
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
61
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
62
|
+
_defineProperty(e, r, t[r]);
|
|
63
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
64
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return e;
|
|
68
|
+
}
|
|
69
|
+
function _slicedToArray(r, e) {
|
|
70
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
71
|
+
}
|
|
72
|
+
function _toPrimitive(t, r) {
|
|
73
|
+
if ("object" != typeof t || !t) return t;
|
|
74
|
+
var e = t[Symbol.toPrimitive];
|
|
75
|
+
if (void 0 !== e) {
|
|
76
|
+
var i = e.call(t, r);
|
|
77
|
+
if ("object" != typeof i) return i;
|
|
78
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
79
|
+
}
|
|
80
|
+
return ("string" === r ? String : Number)(t);
|
|
81
|
+
}
|
|
82
|
+
function _toPropertyKey(t) {
|
|
83
|
+
var i = _toPrimitive(t, "string");
|
|
84
|
+
return "symbol" == typeof i ? i : i + "";
|
|
85
|
+
}
|
|
86
|
+
function _unsupportedIterableToArray(r, a) {
|
|
87
|
+
if (r) {
|
|
88
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
89
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
90
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
4
93
|
|
|
5
94
|
function styleInject(css, ref) {
|
|
6
95
|
if ( ref === void 0 ) ref = {};
|
|
@@ -1954,209 +2043,359 @@ function useViewTransitionState(to, { relative } = {}) {
|
|
|
1954
2043
|
return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;
|
|
1955
2044
|
}
|
|
1956
2045
|
|
|
1957
|
-
var css_248z = ".quix_side_menu{border-right:1px solid #333}.quix_menu_item{align-items:center;border-radius:4px;display:flex;height:48px;justify-content:space-between;opacity:100%;width:90%}";
|
|
2046
|
+
var css_248z = ".quix_side_menu{border-right:1px solid #333;height:88%;.sidemenu_bottom_section{align-items:center;display:flex;height:80%;justify-content:center;position:relative;width:100%;.items{bottom:20px;cursor:pointer;height:auto;position:absolute;width:100%}}}.quix_menu_item{align-items:center;border-radius:4px;display:flex;height:48px;justify-content:space-between;opacity:100%;width:90%}";
|
|
1958
2047
|
styleInject(css_248z);
|
|
1959
2048
|
|
|
1960
2049
|
function Layout(props) {
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
2050
|
+
var _header$height, _parentEl$current, _parentEl$current2, _parentEl$current$cli, _parentEl$current3, _sideMenu$width;
|
|
2051
|
+
var backgroundColor = props.backgroundColor,
|
|
2052
|
+
layoutStyle = props.layoutStyle,
|
|
2053
|
+
className = props.className,
|
|
2054
|
+
sideMenu = props.sideMenu,
|
|
2055
|
+
children = props.children,
|
|
2056
|
+
header = props.header;
|
|
2057
|
+
var parentEl = useRef(null);
|
|
2058
|
+
return jsxs("section", {
|
|
2059
|
+
ref: parentEl,
|
|
2060
|
+
className: "".concat(className),
|
|
2061
|
+
style: _objectSpread2({
|
|
2062
|
+
backgroundColor: backgroundColor
|
|
2063
|
+
}, layoutStyle),
|
|
2064
|
+
children: [header && jsx("section", {
|
|
2065
|
+
style: _objectSpread2({
|
|
2066
|
+
height: header.height
|
|
2067
|
+
}, header.style)
|
|
2068
|
+
}), sideMenu && SideMenu({
|
|
2069
|
+
sideMenu: sideMenu,
|
|
2070
|
+
top: (_header$height = header === null || header === void 0 ? void 0 : header.height) !== null && _header$height !== void 0 ? _header$height : 80
|
|
2071
|
+
}), jsx("section", {
|
|
2072
|
+
style: {
|
|
2073
|
+
position: 'absolute',
|
|
2074
|
+
left: sideMenu === null || sideMenu === void 0 ? void 0 : sideMenu.width,
|
|
2075
|
+
top: header === null || header === void 0 ? void 0 : header.height,
|
|
2076
|
+
padding: 10,
|
|
2077
|
+
maxHeight: Number(parentEl === null || parentEl === void 0 || (_parentEl$current = parentEl.current) === null || _parentEl$current === void 0 ? void 0 : _parentEl$current.clientHeight) - (Number(header === null || header === void 0 ? void 0 : header.height) + 20),
|
|
2078
|
+
height: Number(parentEl === null || parentEl === void 0 || (_parentEl$current2 = parentEl.current) === null || _parentEl$current2 === void 0 ? void 0 : _parentEl$current2.clientHeight) - (Number(header === null || header === void 0 ? void 0 : header.height) + 20),
|
|
2079
|
+
overflow: 'scroll',
|
|
2080
|
+
width: ((_parentEl$current$cli = parentEl === null || parentEl === void 0 || (_parentEl$current3 = parentEl.current) === null || _parentEl$current3 === void 0 ? void 0 : _parentEl$current3.clientWidth) !== null && _parentEl$current$cli !== void 0 ? _parentEl$current$cli : 1280) - (Number((_sideMenu$width = sideMenu === null || sideMenu === void 0 ? void 0 : sideMenu.width) !== null && _sideMenu$width !== void 0 ? _sideMenu$width : 270) + 20)
|
|
2081
|
+
},
|
|
2082
|
+
children: children
|
|
2083
|
+
})]
|
|
2084
|
+
});
|
|
1969
2085
|
}
|
|
1970
2086
|
function SideMenu(props) {
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2087
|
+
var _sideMenuStyle$left, _sideMenuStyle$bottom, _props$top;
|
|
2088
|
+
var _props$sideMenu = props.sideMenu,
|
|
2089
|
+
width = _props$sideMenu.width,
|
|
2090
|
+
sideMenuStyle = _props$sideMenu.sideMenuStyle,
|
|
2091
|
+
menuItems = _props$sideMenu.menuItems,
|
|
2092
|
+
ElementType = _props$sideMenu.ElementType,
|
|
2093
|
+
bottomSection = _props$sideMenu.bottomSection;
|
|
2094
|
+
var bottomNode = function bottomNode() {
|
|
2095
|
+
if (bottomSection) {
|
|
2096
|
+
return bottomSection.map(function (item) {
|
|
2097
|
+
return MenuItem(item);
|
|
2098
|
+
});
|
|
2099
|
+
}
|
|
2100
|
+
};
|
|
2101
|
+
return jsxs("aside", {
|
|
2102
|
+
className: " quix_side_menu ",
|
|
2103
|
+
style: _objectSpread2({
|
|
2104
|
+
position: 'absolute',
|
|
2105
|
+
left: (_sideMenuStyle$left = sideMenuStyle === null || sideMenuStyle === void 0 ? void 0 : sideMenuStyle.left) !== null && _sideMenuStyle$left !== void 0 ? _sideMenuStyle$left : 0,
|
|
2106
|
+
bottom: (_sideMenuStyle$bottom = sideMenuStyle === null || sideMenuStyle === void 0 ? void 0 : sideMenuStyle.bottom) !== null && _sideMenuStyle$bottom !== void 0 ? _sideMenuStyle$bottom : 0,
|
|
2107
|
+
width: width,
|
|
2108
|
+
// height,
|
|
2109
|
+
top: (_props$top = props === null || props === void 0 ? void 0 : props.top) !== null && _props$top !== void 0 ? _props$top : 80
|
|
2110
|
+
}, sideMenuStyle),
|
|
2111
|
+
children: [menuItems && menuItems.map(function (item) {
|
|
2112
|
+
return MenuItem(item, ElementType, item);
|
|
2113
|
+
}), jsx("div", {
|
|
2114
|
+
className: " sidemenu_bottom_section ",
|
|
2115
|
+
children: jsx("div", {
|
|
2116
|
+
className: " items ",
|
|
2117
|
+
children: bottomNode()
|
|
2118
|
+
})
|
|
2119
|
+
})]
|
|
2120
|
+
});
|
|
1983
2121
|
}
|
|
1984
2122
|
function MenuItem(item, ElementType, menuItemsDynamicStyle) {
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2123
|
+
var _menuItemsDynamicStyl, _menuItemsDynamicStyl2, _menuItemsDynamicStyl3, _menuItemsDynamicStyl4, _menuItemsDynamicStyl5, _menuItemsDynamicStyl6;
|
|
2124
|
+
var _useState = useState(false),
|
|
2125
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2126
|
+
isHover = _useState2[0],
|
|
2127
|
+
setIsHover = _useState2[1];
|
|
2128
|
+
var color = {
|
|
2129
|
+
bg: isHover ? (_menuItemsDynamicStyl = menuItemsDynamicStyle === null || menuItemsDynamicStyle === void 0 || (_menuItemsDynamicStyl2 = menuItemsDynamicStyle.activeColor) === null || _menuItemsDynamicStyl2 === void 0 ? void 0 : _menuItemsDynamicStyl2.background) !== null && _menuItemsDynamicStyl !== void 0 ? _menuItemsDynamicStyl : '#d4d4d4' : (_menuItemsDynamicStyl3 = menuItemsDynamicStyle === null || menuItemsDynamicStyle === void 0 ? void 0 : menuItemsDynamicStyle.backgroundColor) !== null && _menuItemsDynamicStyl3 !== void 0 ? _menuItemsDynamicStyl3 : '#d4d4d480',
|
|
2130
|
+
text: isHover ? (_menuItemsDynamicStyl4 = menuItemsDynamicStyle === null || menuItemsDynamicStyle === void 0 || (_menuItemsDynamicStyl5 = menuItemsDynamicStyle.activeColor) === null || _menuItemsDynamicStyl5 === void 0 ? void 0 : _menuItemsDynamicStyl5.text) !== null && _menuItemsDynamicStyl4 !== void 0 ? _menuItemsDynamicStyl4 : "#121212" : (_menuItemsDynamicStyl6 = menuItemsDynamicStyle === null || menuItemsDynamicStyle === void 0 ? void 0 : menuItemsDynamicStyle.textColor) !== null && _menuItemsDynamicStyl6 !== void 0 ? _menuItemsDynamicStyl6 : '#121314 '
|
|
2131
|
+
};
|
|
2132
|
+
function onHover() {
|
|
2133
|
+
if (!isHover) setIsHover(function (prev) {
|
|
2134
|
+
return !prev;
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
function onLeave() {
|
|
2138
|
+
if (isHover) setIsHover(function (prev) {
|
|
2139
|
+
return !prev;
|
|
2140
|
+
});
|
|
2141
|
+
}
|
|
2142
|
+
var navigate = function navigate(route) {
|
|
2143
|
+
window.location.replace(route);
|
|
2144
|
+
};
|
|
2145
|
+
var Element = function Element(_ref) {
|
|
2146
|
+
var children = _ref.children;
|
|
2147
|
+
return ElementType === 'NavLink' ? jsx(NavLink, {
|
|
2148
|
+
style: {
|
|
2149
|
+
width: "100%"
|
|
2150
|
+
},
|
|
2151
|
+
to: item.route,
|
|
2152
|
+
children: children
|
|
2153
|
+
}, item.label) : ElementType === 'Link' ? jsx(Link, {
|
|
2154
|
+
style: {
|
|
2155
|
+
width: "100%"
|
|
2156
|
+
},
|
|
2157
|
+
to: item.route,
|
|
2158
|
+
children: children
|
|
2159
|
+
}, item.label) : ElementType === 'a' ? jsx("a", {
|
|
2160
|
+
style: {
|
|
2161
|
+
width: "100%",
|
|
2162
|
+
textDecoration: 'none'
|
|
2163
|
+
},
|
|
2164
|
+
href: item.route,
|
|
2165
|
+
children: children
|
|
2166
|
+
}, item.label) : jsx("div", {
|
|
2167
|
+
style: {
|
|
2168
|
+
width: "100%"
|
|
2169
|
+
},
|
|
2170
|
+
onClick: function onClick() {
|
|
2171
|
+
navigate(item.route);
|
|
2172
|
+
},
|
|
2173
|
+
children: children
|
|
2174
|
+
}, item.label);
|
|
2175
|
+
};
|
|
2176
|
+
return jsx(Element, {
|
|
2177
|
+
children: jsx("div", {
|
|
2178
|
+
style: {
|
|
2179
|
+
padding: 10,
|
|
2180
|
+
width: '100%'
|
|
2181
|
+
},
|
|
2182
|
+
children: jsxs("div", {
|
|
2183
|
+
onMouseEnter: onHover,
|
|
2184
|
+
onMouseLeave: onLeave,
|
|
2185
|
+
className: 'quix_menu_item ',
|
|
2186
|
+
style: {
|
|
2187
|
+
transition: '0.2s all',
|
|
2188
|
+
backgroundColor: color.bg,
|
|
2189
|
+
color: color.text
|
|
2190
|
+
// border: isHover ? '' : '1px solid #121212 '
|
|
2191
|
+
},
|
|
2192
|
+
children: [item.icon && item.icon.position === 'left' && item.icon.component, jsx("p", {
|
|
2193
|
+
className: " quix_menuItem_label ",
|
|
2194
|
+
style: {
|
|
2195
|
+
paddingInline: 10,
|
|
2196
|
+
paddingBlock: 8,
|
|
2197
|
+
color: color.text
|
|
2198
|
+
},
|
|
2199
|
+
children: item === null || item === void 0 ? void 0 : item.label
|
|
2200
|
+
}), item.icon && item.icon.position === 'right' && item.icon.component]
|
|
2201
|
+
})
|
|
2202
|
+
}, item.label)
|
|
2203
|
+
});
|
|
2032
2204
|
}
|
|
2033
2205
|
|
|
2034
2206
|
function FlexView(props) {
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2207
|
+
var _rounded$topLeft, _rounded$topRight, _rounded$bottomLeft, _rounded$bottomRight;
|
|
2208
|
+
var isScrollable = props.isScrollable,
|
|
2209
|
+
direction = props.direction,
|
|
2210
|
+
width = props.width,
|
|
2211
|
+
height = props.height,
|
|
2212
|
+
backgroundColor = props.backgroundColor,
|
|
2213
|
+
paddingX = props.paddingX,
|
|
2214
|
+
paddingY = props.paddingY,
|
|
2215
|
+
textColor = props.textColor,
|
|
2216
|
+
className = props.className,
|
|
2217
|
+
rounded = props.rounded,
|
|
2218
|
+
gap = props.gap,
|
|
2219
|
+
style = props.style,
|
|
2220
|
+
layout = props.layout,
|
|
2221
|
+
onClick = props.onClick,
|
|
2222
|
+
onRightClick = props.onRightClick,
|
|
2223
|
+
tooltip = props.tooltip;
|
|
2224
|
+
return jsxs("div", {
|
|
2225
|
+
onContextMenu: onRightClick,
|
|
2226
|
+
onClick: onClick,
|
|
2227
|
+
className: "".concat(className, " ").concat(layout, " quix_view "),
|
|
2228
|
+
style: _objectSpread2({
|
|
2229
|
+
overflowY: isScrollable ? 'scroll' : 'hidden',
|
|
2230
|
+
flexDirection: direction || 'row',
|
|
2231
|
+
width: width ? width : 'auto',
|
|
2232
|
+
height: height ? height : 'auto',
|
|
2233
|
+
backgroundColor: backgroundColor || 'transparent',
|
|
2234
|
+
paddingInline: paddingX ? "".concat(paddingX, "px") : undefined,
|
|
2235
|
+
paddingBlock: paddingY ? "".concat(paddingY, "px") : undefined,
|
|
2236
|
+
color: textColor || 'inherit',
|
|
2237
|
+
borderTopLeftRadius: typeof rounded === 'number' ? rounded : (_rounded$topLeft = rounded === null || rounded === void 0 ? void 0 : rounded.topLeft) !== null && _rounded$topLeft !== void 0 ? _rounded$topLeft : 4,
|
|
2238
|
+
borderTopRightRadius: typeof rounded === 'number' ? rounded : (_rounded$topRight = rounded === null || rounded === void 0 ? void 0 : rounded.topRight) !== null && _rounded$topRight !== void 0 ? _rounded$topRight : 4,
|
|
2239
|
+
borderBottomLeftRadius: typeof rounded === 'number' ? rounded : (_rounded$bottomLeft = rounded === null || rounded === void 0 ? void 0 : rounded.bottomLeft) !== null && _rounded$bottomLeft !== void 0 ? _rounded$bottomLeft : 4,
|
|
2240
|
+
borderBottomRightRadius: typeof rounded === 'number' ? rounded : (_rounded$bottomRight = rounded === null || rounded === void 0 ? void 0 : rounded.bottomRight) !== null && _rounded$bottomRight !== void 0 ? _rounded$bottomRight : 4,
|
|
2241
|
+
gap: gap,
|
|
2242
|
+
transition: '0.3s all',
|
|
2243
|
+
position: tooltip ? 'relative' : 'unset'
|
|
2244
|
+
}, style),
|
|
2245
|
+
children: [tooltip && jsx("div", {
|
|
2246
|
+
style: {
|
|
2247
|
+
position: 'absolute',
|
|
2248
|
+
width: '100px',
|
|
2249
|
+
height: '200px',
|
|
2250
|
+
padding: 2,
|
|
2251
|
+
top: tooltip.position === 'top' ? -(height !== null && height !== void 0 ? height : 100) + 10 : 0,
|
|
2252
|
+
bottom: tooltip.position === 'bottom' ? -(height !== null && height !== void 0 ? height : 100) + 10 : 0,
|
|
2253
|
+
left: tooltip.position === 'left' ? -(width !== null && width !== void 0 ? width : 100) - 10 : 0,
|
|
2254
|
+
right: tooltip.position === 'right' ? -(width !== null && width !== void 0 ? width : 100) + 10 : 0,
|
|
2255
|
+
backgroundColor: '#d4d4',
|
|
2256
|
+
zIndex: 10
|
|
2257
|
+
},
|
|
2258
|
+
className: "quix_tooltip",
|
|
2259
|
+
children: tooltip.component
|
|
2260
|
+
}), jsx(Layout, {
|
|
2261
|
+
layoutStyle: {
|
|
2262
|
+
width: '100%',
|
|
2263
|
+
height: '100%',
|
|
2264
|
+
position: 'relative',
|
|
2265
|
+
display: 'flex',
|
|
2266
|
+
justifyContent: 'flex-start',
|
|
2267
|
+
alignItems: 'flex-start',
|
|
2268
|
+
flexDirection: 'column',
|
|
2269
|
+
borderRadius: 10
|
|
2270
|
+
},
|
|
2271
|
+
backgroundColor: "#748873",
|
|
2272
|
+
header: {
|
|
2273
|
+
height: 80,
|
|
2274
|
+
style: {
|
|
2275
|
+
width: '100%'
|
|
2276
|
+
}
|
|
2277
|
+
},
|
|
2278
|
+
sideMenu: {
|
|
2279
|
+
menuItems: [{
|
|
2280
|
+
label: 'Home',
|
|
2281
|
+
route: '/',
|
|
2282
|
+
icon: {
|
|
2283
|
+
position: 'right',
|
|
2284
|
+
component: jsx("div", {
|
|
2285
|
+
style: {
|
|
2286
|
+
width: 24,
|
|
2287
|
+
height: 24,
|
|
2288
|
+
border: '1px solid #333333',
|
|
2289
|
+
marginInline: 10,
|
|
2290
|
+
borderRadius: 4
|
|
2291
|
+
}
|
|
2292
|
+
})
|
|
2293
|
+
}
|
|
2294
|
+
}, {
|
|
2295
|
+
label: 'Setting',
|
|
2296
|
+
route: '/setting',
|
|
2297
|
+
icon: {
|
|
2298
|
+
position: 'right',
|
|
2299
|
+
component: jsx("div", {
|
|
2300
|
+
style: {
|
|
2301
|
+
width: 24,
|
|
2302
|
+
height: 24,
|
|
2303
|
+
border: '1px solid #333333',
|
|
2304
|
+
marginInline: 10,
|
|
2305
|
+
borderRadius: 4
|
|
2306
|
+
}
|
|
2307
|
+
})
|
|
2308
|
+
}
|
|
2309
|
+
}],
|
|
2310
|
+
bottomSection: [{
|
|
2311
|
+
label: 'Logout',
|
|
2312
|
+
route: '#logout',
|
|
2313
|
+
backgroundColor: '#E5E0D880',
|
|
2314
|
+
textColor: '#121212',
|
|
2315
|
+
activeColor: {
|
|
2316
|
+
background: '#E5E0D8',
|
|
2317
|
+
text: '#121212'
|
|
2318
|
+
},
|
|
2319
|
+
icon: {
|
|
2320
|
+
position: 'right',
|
|
2321
|
+
component: jsx("div", {
|
|
2322
|
+
style: {
|
|
2323
|
+
width: 24,
|
|
2324
|
+
height: 24,
|
|
2325
|
+
border: '1px solid #333333',
|
|
2326
|
+
marginInline: 10,
|
|
2327
|
+
borderRadius: 4
|
|
2328
|
+
}
|
|
2329
|
+
})
|
|
2330
|
+
}
|
|
2331
|
+
}],
|
|
2332
|
+
width: 270,
|
|
2333
|
+
height: '90%',
|
|
2334
|
+
sideMenuStyle: {
|
|
2335
|
+
display: 'flex',
|
|
2336
|
+
justifyContent: 'flex-start',
|
|
2337
|
+
alignItems: 'flex-start',
|
|
2338
|
+
borderRight: '1px solid #121212',
|
|
2339
|
+
flexDirection: 'column'
|
|
2340
|
+
},
|
|
2341
|
+
ElementStyle: {
|
|
2342
|
+
height: 48,
|
|
2343
|
+
width: '100%',
|
|
2344
|
+
borderRadius: 8,
|
|
2345
|
+
display: 'flex',
|
|
2346
|
+
justifyContent: 'start',
|
|
2347
|
+
alignItems: 'center',
|
|
2348
|
+
gap: 8,
|
|
2349
|
+
cursor: 'pointer'
|
|
2350
|
+
},
|
|
2351
|
+
ElementType: 'div',
|
|
2352
|
+
menuItemsDynamicStyle: {
|
|
2353
|
+
backgroundColor: '#d4d4d480',
|
|
2354
|
+
textColor: '#121212',
|
|
2355
|
+
activeColor: {
|
|
2356
|
+
background: '#d4d4d4',
|
|
2357
|
+
text: '#121212'
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
},
|
|
2361
|
+
children: jsx("div", {
|
|
2362
|
+
children: "Content"
|
|
2363
|
+
})
|
|
2364
|
+
})]
|
|
2365
|
+
});
|
|
2142
2366
|
}
|
|
2143
2367
|
|
|
2144
2368
|
function Buttons(props) {
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2369
|
+
var _rounded$topLeft, _rounded$topRight, _rounded$bottomLeft, _rounded$bottomRight;
|
|
2370
|
+
var onClick = props.onClick,
|
|
2371
|
+
width = props.width,
|
|
2372
|
+
height = props.height,
|
|
2373
|
+
label = props.label,
|
|
2374
|
+
paddingX = props.paddingX,
|
|
2375
|
+
paddingY = props.paddingY,
|
|
2376
|
+
backgroundColor = props.backgroundColor,
|
|
2377
|
+
textColor = props.textColor,
|
|
2378
|
+
rounded = props.rounded,
|
|
2379
|
+
className = props.className,
|
|
2380
|
+
style = props.style;
|
|
2381
|
+
return jsx("button", {
|
|
2382
|
+
className: className,
|
|
2383
|
+
style: _objectSpread2({
|
|
2384
|
+
width: width ? "".concat(width, "px") : 'auto',
|
|
2385
|
+
height: height ? "".concat(height, "px") : 'auto',
|
|
2386
|
+
paddingInline: paddingX !== null && paddingX !== void 0 ? paddingX : 4,
|
|
2387
|
+
paddingBlock: paddingY !== null && paddingY !== void 0 ? paddingY : 4,
|
|
2388
|
+
backgroundColor: backgroundColor || 'transparent',
|
|
2389
|
+
color: textColor || 'inherit',
|
|
2390
|
+
borderTopLeftRadius: typeof rounded === 'number' ? rounded : (_rounded$topLeft = rounded === null || rounded === void 0 ? void 0 : rounded.topLeft) !== null && _rounded$topLeft !== void 0 ? _rounded$topLeft : 4,
|
|
2391
|
+
borderTopRightRadius: typeof rounded === 'number' ? rounded : (_rounded$topRight = rounded === null || rounded === void 0 ? void 0 : rounded.topRight) !== null && _rounded$topRight !== void 0 ? _rounded$topRight : 4,
|
|
2392
|
+
borderBottomLeftRadius: typeof rounded === 'number' ? rounded : (_rounded$bottomLeft = rounded === null || rounded === void 0 ? void 0 : rounded.bottomLeft) !== null && _rounded$bottomLeft !== void 0 ? _rounded$bottomLeft : 4,
|
|
2393
|
+
borderBottomRightRadius: typeof rounded === 'number' ? rounded : (_rounded$bottomRight = rounded === null || rounded === void 0 ? void 0 : rounded.bottomRight) !== null && _rounded$bottomRight !== void 0 ? _rounded$bottomRight : 4,
|
|
2394
|
+
cursor: 'pointer'
|
|
2395
|
+
}, style),
|
|
2396
|
+
onClick: onClick,
|
|
2397
|
+
children: label
|
|
2398
|
+
});
|
|
2160
2399
|
}
|
|
2161
2400
|
|
|
2162
2401
|
export { Buttons, FlexView };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quix-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "This is a react component library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"@eslint/js": "^9.39.2",
|
|
56
56
|
"@figma/eslint-plugin-figma-plugins": "^1.0.0",
|
|
57
57
|
"@figma/plugin-typings": "^1.122.0",
|
|
58
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
58
59
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
59
60
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
60
61
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
"@types/jest": "^30.0.0",
|
|
66
67
|
"@types/react": "^19.2.8",
|
|
67
68
|
"@vitejs/plugin-react": "^5.1.2",
|
|
69
|
+
"antd": "^6.2.2",
|
|
68
70
|
"axios": "^1.13.2",
|
|
69
71
|
"babel-loader": "^10.0.0",
|
|
70
72
|
"eslint": "^9.39.2",
|
|
@@ -79,11 +81,10 @@
|
|
|
79
81
|
"react-router-dom": "^7.12.0",
|
|
80
82
|
"rimraf": "^6.1.2",
|
|
81
83
|
"rollup": "^4.55.1",
|
|
82
|
-
"rollup-plugin-babel": "^4.4.0",
|
|
83
84
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
84
85
|
"rollup-plugin-postcss": "^4.0.2",
|
|
85
86
|
"storybook": "^10.1.11",
|
|
86
|
-
"styled-components": "^6.3.
|
|
87
|
+
"styled-components": "^6.3.8",
|
|
87
88
|
"tslib": "^2.8.1",
|
|
88
89
|
"typescript": "^5.9.3",
|
|
89
90
|
"typescript-eslint": "^8.53.0"
|