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.
@@ -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: sideMenuProps): import("react/jsx-runtime").JSX.Element;
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;
@@ -11,7 +11,7 @@ declare const meta: {
11
11
  backgroundColor: {
12
12
  control: "color";
13
13
  };
14
- style: {
14
+ layoutStyle: {
15
15
  control: "text";
16
16
  };
17
17
  className: {
@@ -2,9 +2,15 @@ import React, { JSX } from "react";
2
2
  export interface LayoutProps {
3
3
  backgroundColor?: string;
4
4
  className?: string;
5
- style?: React.CSSProperties;
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
- style?: React.CSSProperties;
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
- top: number;
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 { jsx, jsxs } from 'react/jsx-runtime';
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
- const { backgroundColor, style, className, sideMenu } = props;
1962
- return (jsx("section", { className: `${className}`, style: {
1963
- width: '100vw',
1964
- height: '100vh',
1965
- position: 'relative',
1966
- backgroundColor,
1967
- ...style
1968
- }, children: sideMenu && SideMenu(sideMenu) }));
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
- const { width, height, style, menuItems, ElementType, menuItemsDynamicStyle } = props;
1972
- return (jsx("aside", { className: " quix_side_menu ", style: {
1973
- position: 'absolute',
1974
- left: style?.left ?? 0,
1975
- bottom: style?.bottom ?? 0,
1976
- width,
1977
- height,
1978
- top: style?.top ?? 80,
1979
- // ...style
1980
- }, children: menuItems && menuItems.map((item) => {
1981
- return MenuItem(item, ElementType, menuItemsDynamicStyle);
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
- const [isHover, setIsHover] = useState(false);
1986
- const color = {
1987
- bg: isHover ? menuItemsDynamicStyle?.activeColor?.background : 'transparent',
1988
- text: isHover ? menuItemsDynamicStyle?.activeColor?.text : menuItemsDynamicStyle?.textColor
1989
- };
1990
- function onHover() {
1991
- if (!isHover)
1992
- setIsHover((prev) => !prev);
1993
- }
1994
- function onLeave() {
1995
- if (isHover)
1996
- setIsHover((prev) => !prev);
1997
- }
1998
- const navigate = (route) => {
1999
- // window.location.replace(route)
2000
- };
2001
- const Element = ({ children }) => ElementType === 'NavLink' ?
2002
- jsx(NavLink, { style: {
2003
- width: "100%"
2004
- }, to: item.route, children: children }, item.label) :
2005
- ElementType === 'Link' ?
2006
- jsx(Link, { style: {
2007
- width: "100%"
2008
- }, to: item.route, children: children }, item.label) :
2009
- ElementType === 'a' ?
2010
- jsx("a", { style: {
2011
- width: "100%",
2012
- textDecoration: 'none'
2013
- }, href: item.route, children: children }, item.label) :
2014
- jsx("div", { style: {
2015
- width: "100%"
2016
- }, onClick: () => {
2017
- navigate(item.route);
2018
- }, children: children }, item.label);
2019
- return (jsx(Element, { children: jsx("div", { style: {
2020
- padding: 10,
2021
- width: '100%'
2022
- }, children: jsxs("div", { onMouseEnter: onHover, onMouseLeave: onLeave, className: 'quix_menu_item ', style: {
2023
- transition: '0.2s all',
2024
- backgroundColor: color.bg,
2025
- color: color.text,
2026
- border: isHover ? '' : '1px solid #121212 '
2027
- }, children: [item.icon && item.icon.position === 'left' && item.icon.component, jsx("p", { className: " quix_menuItem_label ", style: {
2028
- paddingInline: 10,
2029
- paddingBlock: 8,
2030
- color: color.text
2031
- }, children: item?.label }), item.icon && item.icon.position === 'right' && item.icon.component] }) }, item.label) }));
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
- const { isScrollable, direction, width, height, backgroundColor, paddingX, paddingY, textColor, className, rounded, gap, style, layout, onClick, onRightClick, tooltip } = props;
2036
- return jsxs("div", { onContextMenu: onRightClick, onClick: onClick, className: `${className} ${layout} quix_view `, style: {
2037
- overflowY: isScrollable ? 'scroll' : 'hidden',
2038
- flexDirection: direction || 'row',
2039
- width: width ? `${width}px` : 'auto',
2040
- height: height ? `${height}px` : 'auto',
2041
- backgroundColor: backgroundColor || 'transparent',
2042
- paddingInline: paddingX ? `${paddingX}px` : undefined,
2043
- paddingBlock: paddingY ? `${paddingY}px` : undefined,
2044
- color: textColor || 'inherit',
2045
- borderTopLeftRadius: typeof rounded === 'number' ? rounded : rounded?.topLeft ?? 4,
2046
- borderTopRightRadius: typeof rounded === 'number' ? rounded : rounded?.topRight ?? 4,
2047
- borderBottomLeftRadius: typeof rounded === 'number' ? rounded : rounded?.bottomLeft ?? 4,
2048
- borderBottomRightRadius: typeof rounded === 'number' ? rounded : rounded?.bottomRight ?? 4,
2049
- gap,
2050
- transition: '0.3s all',
2051
- position: tooltip ? 'relative' : 'unset',
2052
- ...style
2053
- }, children: [tooltip && jsx("div", { style: {
2054
- position: 'absolute',
2055
- width: '100px',
2056
- height: '200px',
2057
- padding: 2,
2058
- top: tooltip.position === 'top' ? (-(height ?? 100) + 10) : 0,
2059
- bottom: tooltip.position === 'bottom' ? (-(height ?? 100) + 10) : 0,
2060
- left: tooltip.position === 'left' ? (-(width ?? 100) - 10) : 0,
2061
- right: tooltip.position === 'right' ? (-(width ?? 100) + 10) : 0,
2062
- backgroundColor: '#d4d4',
2063
- zIndex: 10
2064
- }, className: "quix_tooltip", children: tooltip.component }), jsx(Layout, { style: {
2065
- display: 'flex',
2066
- justifyContent: 'flex-start',
2067
- alignItems: 'flex-start',
2068
- flexDirection: 'column',
2069
- borderRadius: 10,
2070
- }, backgroundColor: "#748873", sideMenu: {
2071
- menuItems: [
2072
- {
2073
- label: 'Home',
2074
- route: '/',
2075
- backgroundColor: '#E5E0D880',
2076
- textColor: '#121212',
2077
- activeColor: {
2078
- background: '#E5E0D8',
2079
- text: '#121212'
2080
- },
2081
- icon: {
2082
- position: 'right',
2083
- component: jsx("div", { style: {
2084
- width: 24,
2085
- height: 24,
2086
- border: '1px solid #333333',
2087
- marginInline: 10,
2088
- borderRadius: 4
2089
- } })
2090
- }
2091
- },
2092
- {
2093
- label: 'Setting',
2094
- route: '/setting',
2095
- backgroundColor: '#E5E0D880',
2096
- textColor: '#121212',
2097
- activeColor: {
2098
- background: '#E5E0D8',
2099
- text: '#121212'
2100
- },
2101
- icon: {
2102
- position: 'right',
2103
- component: jsx("div", { style: {
2104
- width: 24,
2105
- height: 24,
2106
- border: '1px solid #333333',
2107
- marginInline: 10,
2108
- borderRadius: 4
2109
- } })
2110
- }
2111
- }
2112
- ],
2113
- width: '20%',
2114
- height: '100%',
2115
- style: {
2116
- display: 'flex',
2117
- justifyContent: 'flex-start',
2118
- alignItems: 'flex-start',
2119
- borderRight: '1px solid #121212'
2120
- },
2121
- top: 80,
2122
- ElementStyle: {
2123
- height: 48,
2124
- width: '90%',
2125
- borderRadius: 8,
2126
- display: 'flex',
2127
- justifyContent: 'start',
2128
- alignItems: 'center',
2129
- gap: 8,
2130
- cursor: 'pointer'
2131
- },
2132
- ElementType: 'a',
2133
- menuItemsDynamicStyle: {
2134
- backgroundColor: '#E5E0D880',
2135
- textColor: '#121212',
2136
- activeColor: {
2137
- background: '#E5E0D8',
2138
- text: '#121212'
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
- const { onClick, width, height, label, paddingX, paddingY, backgroundColor, textColor, rounded, className, style } = props;
2146
- return jsx("button", { className: className, style: {
2147
- width: width ? `${width}px` : 'auto',
2148
- height: height ? `${height}px` : 'auto',
2149
- paddingInline: paddingX ?? 4,
2150
- paddingBlock: paddingY ?? 4,
2151
- backgroundColor: backgroundColor || 'transparent',
2152
- color: textColor || 'inherit',
2153
- borderTopLeftRadius: typeof rounded === 'number' ? rounded : rounded?.topLeft ?? 4,
2154
- borderTopRightRadius: typeof rounded === 'number' ? rounded : rounded?.topRight ?? 4,
2155
- borderBottomLeftRadius: typeof rounded === 'number' ? rounded : rounded?.bottomLeft ?? 4,
2156
- borderBottomRightRadius: typeof rounded === 'number' ? rounded : rounded?.bottomRight ?? 4,
2157
- cursor: 'pointer',
2158
- ...style
2159
- }, onClick: onClick, children: label });
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 };
@@ -15,10 +15,10 @@ declare const meta: {
15
15
  control: "color";
16
16
  };
17
17
  width: {
18
- control: "number";
18
+ control: "text";
19
19
  };
20
20
  height: {
21
- control: "number";
21
+ control: "text";
22
22
  };
23
23
  layout: {
24
24
  options: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quix-ui",
3
- "version": "1.2.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.6",
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"