@quen-ui/components 1.0.1 → 1.1.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.
Files changed (44) hide show
  1. package/dist/Button/styles.cjs.js +6 -10
  2. package/dist/Button/styles.es.js +6 -10
  3. package/dist/Calendar/Calendar.cjs.js +5 -3
  4. package/dist/Calendar/Calendar.es.js +5 -3
  5. package/dist/Calendar/styles.cjs.js +0 -1
  6. package/dist/Calendar/styles.es.js +0 -1
  7. package/dist/Card/Card.cjs.js +8 -4
  8. package/dist/Card/Card.d.ts +1 -1
  9. package/dist/Card/Card.es.js +8 -4
  10. package/dist/Card/styles.cjs.js +9 -3
  11. package/dist/Card/styles.d.ts +3 -1
  12. package/dist/Card/styles.es.js +9 -3
  13. package/dist/Card/types.d.ts +2 -0
  14. package/dist/Form/Form.cjs.js +1 -1
  15. package/dist/Form/Form.es.js +1 -1
  16. package/dist/Image/styles.cjs.js +3 -1
  17. package/dist/Image/styles.es.js +3 -1
  18. package/dist/Layout/Footer.cjs.js +9 -0
  19. package/dist/Layout/Footer.d.ts +1 -2
  20. package/dist/Layout/Footer.es.js +9 -0
  21. package/dist/Layout/Header.cjs.js +12 -4
  22. package/dist/Layout/Header.es.js +12 -4
  23. package/dist/Layout/Layout.cjs.js +8 -3
  24. package/dist/Layout/Layout.d.ts +1 -1
  25. package/dist/Layout/Layout.es.js +8 -3
  26. package/dist/Layout/Sidebar.cjs.js +2 -1
  27. package/dist/Layout/Sidebar.es.js +2 -1
  28. package/dist/Layout/styles.cjs.js +6 -4
  29. package/dist/Layout/styles.d.ts +2 -0
  30. package/dist/Layout/styles.es.js +6 -4
  31. package/dist/Layout/types.d.ts +6 -0
  32. package/dist/Menu/MenuItem.cjs.js +9 -1
  33. package/dist/Menu/MenuItem.es.js +9 -1
  34. package/dist/Menu/styles.cjs.js +3 -1
  35. package/dist/Menu/styles.es.js +3 -1
  36. package/dist/Menu/types.d.ts +4 -1
  37. package/dist/Modal/Modal.cjs.js +2 -2
  38. package/dist/Modal/Modal.es.js +2 -2
  39. package/dist/Modal/styles.cjs.js +3 -1
  40. package/dist/Modal/styles.es.js +3 -1
  41. package/dist/typography/Text/Text.cjs.js +2 -2
  42. package/dist/typography/Text/Text.es.js +2 -2
  43. package/dist/typography/Text/types.d.ts +1 -1
  44. package/package.json +1 -1
@@ -6,21 +6,17 @@ const getBackground = (theme, view = "primary", isDisabled) => {
6
6
  switch (view) {
7
7
  case "secondary":
8
8
  return styled.css`
9
- background: ${theme.components.Button.secondaryBackground};
10
- color: ${theme.components.Button.color};
9
+ background: transparent;
10
+ border: 1px solid ${theme.components.Button.secondaryBackground};
11
11
 
12
12
  &:hover {
13
- background: ${polished.darken(
14
- 0.1,
15
- theme.components.Button.secondaryBackground
16
- )};
13
+ color: ${theme.colors[theme.primaryColor][7]};
14
+ border: 1px solid ${theme.colors[theme.primaryColor][7]};
17
15
  }
18
16
 
19
17
  &:active {
20
- background: ${polished.darken(
21
- 0.2,
22
- theme.components.Button.secondaryBackground
23
- )};
18
+ color: ${theme.colors[theme.primaryColor][9]};
19
+ border: 1px solid ${theme.colors[theme.primaryColor][9]};
24
20
  }
25
21
  `;
26
22
  case "danger":
@@ -4,21 +4,17 @@ const getBackground = (theme, view = "primary", isDisabled) => {
4
4
  switch (view) {
5
5
  case "secondary":
6
6
  return css`
7
- background: ${theme.components.Button.secondaryBackground};
8
- color: ${theme.components.Button.color};
7
+ background: transparent;
8
+ border: 1px solid ${theme.components.Button.secondaryBackground};
9
9
 
10
10
  &:hover {
11
- background: ${darken(
12
- 0.1,
13
- theme.components.Button.secondaryBackground
14
- )};
11
+ color: ${theme.colors[theme.primaryColor][7]};
12
+ border: 1px solid ${theme.colors[theme.primaryColor][7]};
15
13
  }
16
14
 
17
15
  &:active {
18
- background: ${darken(
19
- 0.2,
20
- theme.components.Button.secondaryBackground
21
- )};
16
+ color: ${theme.colors[theme.primaryColor][9]};
17
+ border: 1px solid ${theme.colors[theme.primaryColor][9]};
22
18
  }
23
19
  `;
24
20
  case "danger":
@@ -48,9 +48,11 @@ const Calendar = ({
48
48
  }
49
49
  }, [level]);
50
50
  React.useEffect(() => {
51
- setInternalSingleDate(null);
52
- setInternalEndDate(null);
53
- setInternalStartDate(null);
51
+ if (typeof range !== "undefined") {
52
+ setInternalSingleDate(null);
53
+ setInternalEndDate(null);
54
+ setInternalStartDate(null);
55
+ }
54
56
  }, [range]);
55
57
  const [currentMonth, setCurrentMonth] = React.useState(/* @__PURE__ */ new Date());
56
58
  const levelTitle = React.useMemo(() => {
@@ -47,9 +47,11 @@ const Calendar$1 = ({
47
47
  }
48
48
  }, [level]);
49
49
  useEffect(() => {
50
- setInternalSingleDate(null);
51
- setInternalEndDate(null);
52
- setInternalStartDate(null);
50
+ if (typeof range !== "undefined") {
51
+ setInternalSingleDate(null);
52
+ setInternalEndDate(null);
53
+ setInternalStartDate(null);
54
+ }
53
55
  }, [range]);
54
56
  const [currentMonth, setCurrentMonth] = useState(/* @__PURE__ */ new Date());
55
57
  const levelTitle = useMemo(() => {
@@ -59,7 +59,6 @@ const DayStyled = styled(Button).attrs({ view: "icon" }).withConfig({
59
59
 
60
60
  ${({ theme, isSelected, isCurrentMonth }) => {
61
61
  const { secondaryColor } = theme.components.Calendar;
62
- console.log(secondaryColor);
63
62
  return styled.css`
64
63
  color: ${isSelected ? "#fff" : isCurrentMonth ? theme.textColor : secondaryColor};
65
64
  `;
@@ -57,7 +57,6 @@ const DayStyled = styled(Button).attrs({ view: "icon" }).withConfig({
57
57
 
58
58
  ${({ theme, isSelected, isCurrentMonth }) => {
59
59
  const { secondaryColor } = theme.components.Calendar;
60
- console.log(secondaryColor);
61
60
  return css`
62
61
  color: ${isSelected ? "#fff" : isCurrentMonth ? theme.textColor : secondaryColor};
63
62
  `;
@@ -4,6 +4,7 @@ const Title = require("../typography/Title/Title.cjs.js");
4
4
  const styles = require("./styles.cjs.js");
5
5
  const Button = require("../Button/Button.cjs.js");
6
6
  const Divider = require("../Divider/Divider.cjs.js");
7
+ const Flex = require("../Flex/Flex.cjs.js");
7
8
  const Card = ({
8
9
  title,
9
10
  children,
@@ -18,14 +19,17 @@ const Card = ({
18
19
  leftContent,
19
20
  style,
20
21
  onClickExtra,
22
+ shadow,
21
23
  ...props
22
24
  }) => {
23
- return /* @__PURE__ */ jsxRuntime.jsxs(styles.CardStyled, { className, ...props, style, children: [
25
+ return /* @__PURE__ */ jsxRuntime.jsxs(styles.CardStyled, { className, ...props, style, shadow, children: [
24
26
  cover,
25
27
  title && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
26
- /* @__PURE__ */ jsxRuntime.jsxs(styles.CardHeaderStyled, { size, className: classNameHeader, children: [
27
- leftContent,
28
- /* @__PURE__ */ jsxRuntime.jsx(Title, { size, children: title }),
28
+ /* @__PURE__ */ jsxRuntime.jsxs(styles.CardHeaderStyled, { size, className: classNameHeader, "data-testid": "card-header", children: [
29
+ /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: "m", align: "center", children: [
30
+ leftContent,
31
+ /* @__PURE__ */ jsxRuntime.jsx(Title, { size, children: title })
32
+ ] }),
29
33
  extra && /* @__PURE__ */ jsxRuntime.jsx(Button, { view: "link", size: "s", onClick: onClickExtra, children: extra })
30
34
  ] }),
31
35
  /* @__PURE__ */ jsxRuntime.jsx(Divider, { direction: "horizontal" })
@@ -1,3 +1,3 @@
1
1
  import { ICardProps } from './types';
2
- declare const Card: ({ title, children, size, extra, className, classNameHeader, classNameContent, classNameAction, actionContent, cover, leftContent, style, onClickExtra, ...props }: ICardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const Card: ({ title, children, size, extra, className, classNameHeader, classNameContent, classNameAction, actionContent, cover, leftContent, style, onClickExtra, shadow, ...props }: ICardProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Card;
@@ -3,6 +3,7 @@ import Title from "../typography/Title/Title.es.js";
3
3
  import { CardStyled, CardHeaderStyled, CardContentStyled, CardActionsStyled } from "./styles.es.js";
4
4
  import Button from "../Button/Button.es.js";
5
5
  import Divider from "../Divider/Divider.es.js";
6
+ import Flex from "../Flex/Flex.es.js";
6
7
  const Card = ({
7
8
  title,
8
9
  children,
@@ -17,14 +18,17 @@ const Card = ({
17
18
  leftContent,
18
19
  style,
19
20
  onClickExtra,
21
+ shadow,
20
22
  ...props
21
23
  }) => {
22
- return /* @__PURE__ */ jsxs(CardStyled, { className, ...props, style, children: [
24
+ return /* @__PURE__ */ jsxs(CardStyled, { className, ...props, style, shadow, children: [
23
25
  cover,
24
26
  title && /* @__PURE__ */ jsxs(Fragment, { children: [
25
- /* @__PURE__ */ jsxs(CardHeaderStyled, { size, className: classNameHeader, children: [
26
- leftContent,
27
- /* @__PURE__ */ jsx(Title, { size, children: title }),
27
+ /* @__PURE__ */ jsxs(CardHeaderStyled, { size, className: classNameHeader, "data-testid": "card-header", children: [
28
+ /* @__PURE__ */ jsxs(Flex, { gap: "m", align: "center", children: [
29
+ leftContent,
30
+ /* @__PURE__ */ jsx(Title, { size, children: title })
31
+ ] }),
28
32
  extra && /* @__PURE__ */ jsx(Button, { view: "link", size: "s", onClick: onClickExtra, children: extra })
29
33
  ] }),
30
34
  /* @__PURE__ */ jsx(Divider, { direction: "horizontal" })
@@ -26,10 +26,16 @@ const getSizing = (size) => {
26
26
  `;
27
27
  }
28
28
  };
29
- const CardStyled = styled.div.attrs({ className: "quen-ui__card" })`
29
+ const CardStyled = styled.div.withConfig({
30
+ shouldForwardProp: (prop) => !["shadow"].includes(prop)
31
+ }).attrs({ className: "quen-ui__card" })`
30
32
  border-radius: ${({ theme }) => theme.components.Card.radius};
31
33
  border: 1px solid ${({ theme }) => theme.components.Card.borderColor};
32
- max-width: 350px;
34
+ width: 350px;
35
+
36
+ ${({ shadow, theme }) => shadow && styled.css`
37
+ box-shadow: ${theme.components.Card.shadow};
38
+ `};
33
39
  `;
34
40
  const CardHeaderStyled = styled.div`
35
41
  ${({ size }) => getSizing(size)};
@@ -46,7 +52,7 @@ const CardContentStyled = styled.div`
46
52
  const CardActionsStyled = styled.div`
47
53
  ${({ size }) => getSizing(size)};
48
54
  display: flex;
49
- justify-content: space-between;
55
+ justify-content: flex-end;
50
56
  align-items: center;
51
57
  `;
52
58
  exports.CardActionsStyled = CardActionsStyled;
@@ -1,5 +1,7 @@
1
1
  import { TQuenSize } from '../types/size';
2
- export declare const CardStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
2
+ export declare const CardStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('styled-components').FastOmit<import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, {
3
+ shadow?: boolean;
4
+ }>> & string;
3
5
  export declare const CardHeaderStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
6
  size: TQuenSize;
5
7
  }>> & string;
@@ -24,10 +24,16 @@ const getSizing = (size) => {
24
24
  `;
25
25
  }
26
26
  };
27
- const CardStyled = styled.div.attrs({ className: "quen-ui__card" })`
27
+ const CardStyled = styled.div.withConfig({
28
+ shouldForwardProp: (prop) => !["shadow"].includes(prop)
29
+ }).attrs({ className: "quen-ui__card" })`
28
30
  border-radius: ${({ theme }) => theme.components.Card.radius};
29
31
  border: 1px solid ${({ theme }) => theme.components.Card.borderColor};
30
- max-width: 350px;
32
+ width: 350px;
33
+
34
+ ${({ shadow, theme }) => shadow && css`
35
+ box-shadow: ${theme.components.Card.shadow};
36
+ `};
31
37
  `;
32
38
  const CardHeaderStyled = styled.div`
33
39
  ${({ size }) => getSizing(size)};
@@ -44,7 +50,7 @@ const CardContentStyled = styled.div`
44
50
  const CardActionsStyled = styled.div`
45
51
  ${({ size }) => getSizing(size)};
46
52
  display: flex;
47
- justify-content: space-between;
53
+ justify-content: flex-end;
48
54
  align-items: center;
49
55
  `;
50
56
  export {
@@ -24,5 +24,7 @@ export interface ICardProps {
24
24
  leftContent?: React.ReactNode;
25
25
  style?: React.CSSProperties;
26
26
  onClickExtra?: () => void;
27
+ /** Show shadow */
28
+ shadow?: boolean;
27
29
  [key: string]: any;
28
30
  }
@@ -40,7 +40,7 @@ const Form = ({
40
40
  };
41
41
  React.useEffect(() => {
42
42
  form.setSubmitCallback(() => handleSubmit);
43
- }, []);
43
+ }, [form.getFieldsValue, form.getFieldsError]);
44
44
  return /* @__PURE__ */ jsxRuntime.jsx(
45
45
  FormContext.Provider,
46
46
  {
@@ -38,7 +38,7 @@ const Form = ({
38
38
  };
39
39
  useEffect(() => {
40
40
  form.setSubmitCallback(() => handleSubmit);
41
- }, []);
41
+ }, [form.getFieldsValue, form.getFieldsError]);
42
42
  return /* @__PURE__ */ jsx(
43
43
  FormContext.Provider,
44
44
  {
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const styled = require("styled-components");
4
4
  const Button = require("../Button/Button.cjs.js");
5
- const ImageContainer = styled.div`
5
+ const ImageContainer = styled.div.withConfig({
6
+ shouldForwardProp: (prop) => !["width", "height", "preview"].includes(prop)
7
+ })`
6
8
  position: relative;
7
9
  width: ${({ width }) => typeof width === "number" ? `${width}px` : width || "auto"};
8
10
  height: ${({ height }) => typeof height === "number" ? `${height}px` : height || "auto"};
@@ -1,6 +1,8 @@
1
1
  import styled from "styled-components";
2
2
  import Button from "../Button/Button.es.js";
3
- const ImageContainer = styled.div`
3
+ const ImageContainer = styled.div.withConfig({
4
+ shouldForwardProp: (prop) => !["width", "height", "preview"].includes(prop)
5
+ })`
4
6
  position: relative;
5
7
  width: ${({ width }) => typeof width === "number" ? `${width}px` : width || "auto"};
6
8
  height: ${({ height }) => typeof height === "number" ? `${height}px` : height || "auto"};
@@ -1,7 +1,16 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
3
4
  const styles = require("./styles.cjs.js");
5
+ const Layout = require("./Layout.cjs.js");
4
6
  const Footer = ({ children }) => {
7
+ const { setIsFooter } = Layout.useLayout();
8
+ React.useEffect(() => {
9
+ setIsFooter(true);
10
+ return () => {
11
+ setIsFooter(false);
12
+ };
13
+ }, []);
5
14
  return /* @__PURE__ */ jsxRuntime.jsx(styles.FooterStyled, { children });
6
15
  };
7
16
  module.exports = Footer;
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { ILayoutFooterProps } from './types';
3
- declare const Footer: ({ children }: ILayoutFooterProps) => React.ReactElement;
2
+ declare const Footer: ({ children }: ILayoutFooterProps) => import("react/jsx-runtime").JSX.Element;
4
3
  export default Footer;
@@ -1,6 +1,15 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
2
3
  import { FooterStyled } from "./styles.es.js";
4
+ import { useLayout } from "./Layout.es.js";
3
5
  const Footer = ({ children }) => {
6
+ const { setIsFooter } = useLayout();
7
+ useEffect(() => {
8
+ setIsFooter(true);
9
+ return () => {
10
+ setIsFooter(false);
11
+ };
12
+ }, []);
4
13
  return /* @__PURE__ */ jsx(FooterStyled, { children });
5
14
  };
6
15
  export {
@@ -19,10 +19,18 @@ const Header = ({
19
19
  }) => {
20
20
  const { mobile, toggleSidebar, sidebarOpen } = Layout.useLayout();
21
21
  return /* @__PURE__ */ jsxRuntime.jsxs(styles.HeaderStyled, { className, style, height, children: [
22
- /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: "s", align: "center", className: "quen-ui__layout-header__logo-wrapper", children: [
23
- mobile && /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: toggleSidebar, children: sidebarOpen ? /* @__PURE__ */ jsxRuntime.jsx(iconClose, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconLines, {}) }),
24
- logo
25
- ] }),
22
+ (logo || mobile) && /* @__PURE__ */ jsxRuntime.jsxs(
23
+ Flex,
24
+ {
25
+ gap: "s",
26
+ align: "center",
27
+ className: "quen-ui__layout-header__logo-wrapper",
28
+ children: [
29
+ mobile && /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: toggleSidebar, children: sidebarOpen ? /* @__PURE__ */ jsxRuntime.jsx(iconClose, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconLines, {}) }),
30
+ logo
31
+ ]
32
+ }
33
+ ),
26
34
  /* @__PURE__ */ jsxRuntime.jsxs(
27
35
  Flex,
28
36
  {
@@ -18,10 +18,18 @@ const Header = ({
18
18
  }) => {
19
19
  const { mobile, toggleSidebar, sidebarOpen } = useLayout();
20
20
  return /* @__PURE__ */ jsxs(HeaderStyled, { className, style, height, children: [
21
- /* @__PURE__ */ jsxs(Flex, { gap: "s", align: "center", className: "quen-ui__layout-header__logo-wrapper", children: [
22
- mobile && /* @__PURE__ */ jsx(Button, { onClick: toggleSidebar, children: sidebarOpen ? /* @__PURE__ */ jsx(SvgIconClose, {}) : /* @__PURE__ */ jsx(SvgIconLines, {}) }),
23
- logo
24
- ] }),
21
+ (logo || mobile) && /* @__PURE__ */ jsxs(
22
+ Flex,
23
+ {
24
+ gap: "s",
25
+ align: "center",
26
+ className: "quen-ui__layout-header__logo-wrapper",
27
+ children: [
28
+ mobile && /* @__PURE__ */ jsx(Button, { onClick: toggleSidebar, children: sidebarOpen ? /* @__PURE__ */ jsx(SvgIconClose, {}) : /* @__PURE__ */ jsx(SvgIconLines, {}) }),
29
+ logo
30
+ ]
31
+ }
32
+ ),
25
33
  /* @__PURE__ */ jsxs(
26
34
  Flex,
27
35
  {
@@ -6,11 +6,14 @@ const styles = require("./styles.cjs.js");
6
6
  const LayoutContext = React.createContext(null);
7
7
  const Layout = ({
8
8
  children,
9
- breakpoint = 768
9
+ breakpoint = 768,
10
+ className,
11
+ style
10
12
  }) => {
11
13
  const [mobile, setMobile] = React.useState(false);
12
14
  const [sidebarOpen, setSidebarOpen] = React.useState(false);
13
15
  const [sliderCollapsed, setSliderCollapsed] = React.useState(false);
16
+ const [isFooter, setIsFooter] = React.useState(false);
14
17
  React.useEffect(() => {
15
18
  const checkScreenSize = () => {
16
19
  setMobile(window.innerWidth <= breakpoint);
@@ -32,9 +35,11 @@ const Layout = ({
32
35
  sidebarOpen,
33
36
  sliderCollapsed,
34
37
  toggleSidebar,
35
- toggleSliderCollapse
38
+ toggleSliderCollapse,
39
+ setIsFooter,
40
+ isFooter
36
41
  },
37
- children: /* @__PURE__ */ jsxRuntime.jsx(styles.LayoutStyled, { breakpoint, children })
42
+ children: /* @__PURE__ */ jsxRuntime.jsx(styles.LayoutStyled, { breakpoint, isFooter, className, style, children })
38
43
  }
39
44
  );
40
45
  };
@@ -1,5 +1,5 @@
1
1
  import { default as React, PropsWithChildren } from 'react';
2
2
  import { ILayoutProps, ILayoutContextProps } from './types';
3
- declare const Layout: ({ children, breakpoint }: PropsWithChildren<ILayoutProps>) => React.ReactNode;
3
+ declare const Layout: ({ children, breakpoint, className, style }: PropsWithChildren<ILayoutProps>) => React.ReactNode;
4
4
  export declare const useLayout: () => ILayoutContextProps;
5
5
  export default Layout;
@@ -4,11 +4,14 @@ import { LayoutStyled } from "./styles.es.js";
4
4
  const LayoutContext = createContext(null);
5
5
  const Layout = ({
6
6
  children,
7
- breakpoint = 768
7
+ breakpoint = 768,
8
+ className,
9
+ style
8
10
  }) => {
9
11
  const [mobile, setMobile] = useState(false);
10
12
  const [sidebarOpen, setSidebarOpen] = useState(false);
11
13
  const [sliderCollapsed, setSliderCollapsed] = useState(false);
14
+ const [isFooter, setIsFooter] = useState(false);
12
15
  useEffect(() => {
13
16
  const checkScreenSize = () => {
14
17
  setMobile(window.innerWidth <= breakpoint);
@@ -30,9 +33,11 @@ const Layout = ({
30
33
  sidebarOpen,
31
34
  sliderCollapsed,
32
35
  toggleSidebar,
33
- toggleSliderCollapse
36
+ toggleSliderCollapse,
37
+ setIsFooter,
38
+ isFooter
34
39
  },
35
- children: /* @__PURE__ */ jsx(LayoutStyled, { breakpoint, children })
40
+ children: /* @__PURE__ */ jsx(LayoutStyled, { breakpoint, isFooter, className, style, children })
36
41
  }
37
42
  );
38
43
  };
@@ -14,7 +14,7 @@ const Sidebar = ({
14
14
  classNameMenuItem,
15
15
  activeMenuKeys
16
16
  }) => {
17
- const { mobile, toggleSidebar, sidebarOpen } = Layout.useLayout();
17
+ const { mobile, toggleSidebar, sidebarOpen, isFooter } = Layout.useLayout();
18
18
  if (mobile) {
19
19
  return /* @__PURE__ */ jsxRuntime.jsxs(Drawer, { open: sidebarOpen, onClose: toggleSidebar, title: titleDrawer, children: [
20
20
  children,
@@ -33,6 +33,7 @@ const Sidebar = ({
33
33
  return /* @__PURE__ */ jsxRuntime.jsxs(
34
34
  styles.SidebarStyled,
35
35
  {
36
+ isFooter,
36
37
  collapsed,
37
38
  collapsible,
38
39
  className,
@@ -13,7 +13,7 @@ const Sidebar = ({
13
13
  classNameMenuItem,
14
14
  activeMenuKeys
15
15
  }) => {
16
- const { mobile, toggleSidebar, sidebarOpen } = useLayout();
16
+ const { mobile, toggleSidebar, sidebarOpen, isFooter } = useLayout();
17
17
  if (mobile) {
18
18
  return /* @__PURE__ */ jsxs(Drawer, { open: sidebarOpen, onClose: toggleSidebar, title: titleDrawer, children: [
19
19
  children,
@@ -32,6 +32,7 @@ const Sidebar = ({
32
32
  return /* @__PURE__ */ jsxs(
33
33
  SidebarStyled,
34
34
  {
35
+ isFooter,
35
36
  collapsed,
36
37
  collapsible,
37
38
  className,
@@ -18,6 +18,7 @@ const HeaderStyled = styled.styled.header.withConfig({
18
18
 
19
19
  display: flex;
20
20
  flex-wrap: wrap;
21
+ gap: 1rem;
21
22
 
22
23
  background: ${({ theme }) => theme.components.Layout.headerBackground};
23
24
 
@@ -34,18 +35,19 @@ const FooterStyled = styled.styled.footer`
34
35
  grid-area: footer;
35
36
  `;
36
37
  const SidebarStyled = styled.styled.aside.withConfig({
37
- shouldForwardProp: (prop) => !["isMobile", "isOpen", "isCollapsed", "collapsedWidth"].includes(prop)
38
+ shouldForwardProp: (prop) => !["isMobile", "isOpen", "isCollapsed", "collapsedWidth", "isFooter"].includes(prop)
38
39
  })`
39
40
  grid-area: slider;
40
41
  min-width: ${({ collapsible, collapsed, collapsedWidth }) => collapsible && collapsed ? collapsedWidth : "250px"};
41
42
  background: ${({ theme }) => theme.components.Layout.sidebarBackground};
42
43
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
44
+ border-right: 1px solid ${({ theme }) => theme.components.Layout.borderColor};
43
45
  position: relative;
44
46
  overflow: auto;
45
47
  padding: ${({ theme }) => theme.space.xs};
46
48
  flex-direction: column;
47
49
  display: flex;
48
- height: calc(100vh - 87px);
50
+ height: calc(100vh - ${({ isFooter }) => isFooter ? 87 : 53}px);
49
51
 
50
52
  ${({ mobile }) => mobile && styled.css`
51
53
  position: fixed;
@@ -68,7 +70,7 @@ const ContentStyled = styled.styled.main`
68
70
  height: 100vh;
69
71
  `;
70
72
  const LayoutStyled = styled.styled.div.withConfig({
71
- shouldForwardProp: (prop) => !["breakpoint"].includes(prop)
73
+ shouldForwardProp: (prop) => !["breakpoint", "isFooter"].includes(prop)
72
74
  })`
73
75
  display: grid;
74
76
  min-height: 100vh;
@@ -87,7 +89,7 @@ const LayoutStyled = styled.styled.div.withConfig({
87
89
 
88
90
  &:has(${HeaderStyled}) {
89
91
  ${ContentStyled} {
90
- height: calc(100vh - 71px);
92
+ height: calc(100vh - ${({ isFooter }) => isFooter ? 71 : 56}px);
91
93
  }
92
94
  }
93
95
  `;
@@ -10,10 +10,12 @@ export declare const SidebarStyled: import('styled-components/dist/types').IStyl
10
10
  collapsible?: boolean;
11
11
  collapsed?: boolean;
12
12
  collapsedWidth?: number;
13
+ isFooter: boolean;
13
14
  }>> & string;
14
15
  export declare const ContentStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
15
16
  export declare const LayoutStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
16
17
  breakpoint: number;
18
+ isFooter: boolean;
17
19
  }>> & string;
18
20
  export declare const OverlayStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
19
21
  export declare const SidebarMenuStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('..').IMenuProps<Record<string, any>>, never>> & string & Omit<(<Item extends Record<string, any> = import('..').IMenuDefaultItem>(props: import('..').IMenuProps<Item>) => import("react/jsx-runtime").JSX.Element), keyof import('react').Component<any, {}, any>>;
@@ -16,6 +16,7 @@ const HeaderStyled = styled.header.withConfig({
16
16
 
17
17
  display: flex;
18
18
  flex-wrap: wrap;
19
+ gap: 1rem;
19
20
 
20
21
  background: ${({ theme }) => theme.components.Layout.headerBackground};
21
22
 
@@ -32,18 +33,19 @@ const FooterStyled = styled.footer`
32
33
  grid-area: footer;
33
34
  `;
34
35
  const SidebarStyled = styled.aside.withConfig({
35
- shouldForwardProp: (prop) => !["isMobile", "isOpen", "isCollapsed", "collapsedWidth"].includes(prop)
36
+ shouldForwardProp: (prop) => !["isMobile", "isOpen", "isCollapsed", "collapsedWidth", "isFooter"].includes(prop)
36
37
  })`
37
38
  grid-area: slider;
38
39
  min-width: ${({ collapsible, collapsed, collapsedWidth }) => collapsible && collapsed ? collapsedWidth : "250px"};
39
40
  background: ${({ theme }) => theme.components.Layout.sidebarBackground};
40
41
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
42
+ border-right: 1px solid ${({ theme }) => theme.components.Layout.borderColor};
41
43
  position: relative;
42
44
  overflow: auto;
43
45
  padding: ${({ theme }) => theme.space.xs};
44
46
  flex-direction: column;
45
47
  display: flex;
46
- height: calc(100vh - 87px);
48
+ height: calc(100vh - ${({ isFooter }) => isFooter ? 87 : 53}px);
47
49
 
48
50
  ${({ mobile }) => mobile && css`
49
51
  position: fixed;
@@ -66,7 +68,7 @@ const ContentStyled = styled.main`
66
68
  height: 100vh;
67
69
  `;
68
70
  const LayoutStyled = styled.div.withConfig({
69
- shouldForwardProp: (prop) => !["breakpoint"].includes(prop)
71
+ shouldForwardProp: (prop) => !["breakpoint", "isFooter"].includes(prop)
70
72
  })`
71
73
  display: grid;
72
74
  min-height: 100vh;
@@ -85,7 +87,7 @@ const LayoutStyled = styled.div.withConfig({
85
87
 
86
88
  &:has(${HeaderStyled}) {
87
89
  ${ContentStyled} {
88
- height: calc(100vh - 71px);
90
+ height: calc(100vh - ${({ isFooter }) => isFooter ? 71 : 56}px);
89
91
  }
90
92
  }
91
93
  `;
@@ -11,6 +11,8 @@ export interface ILayoutContextProps {
11
11
  toggleSidebar: () => void;
12
12
  /** Toggles desktop sidebar collapse state */
13
13
  toggleSliderCollapse: () => void;
14
+ setIsFooter: (isFooter: boolean) => void;
15
+ isFooter: boolean;
14
16
  }
15
17
  export interface ILayoutHeaderProps {
16
18
  /** Custom CSS classes */
@@ -30,6 +32,10 @@ export interface ILayoutHeaderProps {
30
32
  export interface ILayoutProps {
31
33
  /** Viewport width (px) for mobile/desktop switch */
32
34
  breakpoint?: number;
35
+ /** Custom CSS classes */
36
+ className?: string;
37
+ /** Inline styles */
38
+ style?: React.CSSProperties;
33
39
  }
34
40
  export interface ILayoutSidebarProps {
35
41
  /** Desktop collapsed state */
@@ -24,6 +24,7 @@ const MenuItem = ({
24
24
  const refMenuItem = React.useRef(null);
25
25
  const hasChildren = !!item.children?.length;
26
26
  const [visible, setVisible] = React.useState(false);
27
+ const { key: _, ...otherProps } = item;
27
28
  const handleMouseEnter = () => {
28
29
  setVisible(true);
29
30
  };
@@ -42,13 +43,20 @@ const MenuItem = ({
42
43
  className: helpers.cnMerge(getItemClassName(item), className),
43
44
  active: activeKeys?.includes(getItemKey(item)),
44
45
  onClick: getItemOnClick(item),
46
+ as: item.as,
47
+ ...otherProps,
45
48
  children: [
46
49
  getItemLeftContent(item),
47
50
  /* @__PURE__ */ jsxRuntime.jsx(
48
51
  Text,
49
52
  {
50
53
  size,
51
- className: helpers.cnMerge({ "quen-ui--menu__item_group": hasChildren && direction === "vertical" }, "quen-ui--menu__item_label"),
54
+ className: helpers.cnMerge(
55
+ {
56
+ "quen-ui--menu__item_group": hasChildren && direction === "vertical"
57
+ },
58
+ "quen-ui--menu__item_label"
59
+ ),
52
60
  children: getItemLabel(item)
53
61
  }
54
62
  ),
@@ -23,6 +23,7 @@ const MenuItem = ({
23
23
  const refMenuItem = useRef(null);
24
24
  const hasChildren = !!item.children?.length;
25
25
  const [visible, setVisible] = useState(false);
26
+ const { key: _, ...otherProps } = item;
26
27
  const handleMouseEnter = () => {
27
28
  setVisible(true);
28
29
  };
@@ -41,13 +42,20 @@ const MenuItem = ({
41
42
  className: cnMerge(getItemClassName(item), className),
42
43
  active: activeKeys?.includes(getItemKey(item)),
43
44
  onClick: getItemOnClick(item),
45
+ as: item.as,
46
+ ...otherProps,
44
47
  children: [
45
48
  getItemLeftContent(item),
46
49
  /* @__PURE__ */ jsx(
47
50
  Text,
48
51
  {
49
52
  size,
50
- className: cnMerge({ "quen-ui--menu__item_group": hasChildren && direction === "vertical" }, "quen-ui--menu__item_label"),
53
+ className: cnMerge(
54
+ {
55
+ "quen-ui--menu__item_group": hasChildren && direction === "vertical"
56
+ },
57
+ "quen-ui--menu__item_label"
58
+ ),
51
59
  children: getItemLabel(item)
52
60
  }
53
61
  ),
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const styled = require("styled-components");
4
4
  const Flex = require("../Flex/Flex.cjs.js");
5
5
  const MenuItemStyled = styled.button.withConfig({
6
- shouldForwardProp: (prop) => !["disabled", "active", "hover"].includes(prop)
6
+ shouldForwardProp: (prop) => !["disabled", "active", "hover", "leftContent", "label"].includes(prop)
7
7
  }).attrs((props) => ({
8
8
  className: props.active ? "quen-ui__menu-item--active" : "quen-ui__menu-item"
9
9
  }))`
@@ -18,6 +18,7 @@ const MenuItemStyled = styled.button.withConfig({
18
18
  transition: background 0.2s ease;
19
19
  background: transparent;
20
20
  justify-content: flex-start;
21
+ text-decoration: none;
21
22
 
22
23
  color: ${({ theme, disabled }) => disabled ? theme.components.Menu.disabledColor : theme.components.Menu.color};
23
24
 
@@ -44,6 +45,7 @@ const MenuItemStyled = styled.button.withConfig({
44
45
 
45
46
  .quen-ui--menu__item_label {
46
47
  width: 100%;
48
+ text-align: left;
47
49
  }
48
50
 
49
51
  &:hover {
@@ -1,7 +1,7 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import Flex from "../Flex/Flex.es.js";
3
3
  const MenuItemStyled = styled.button.withConfig({
4
- shouldForwardProp: (prop) => !["disabled", "active", "hover"].includes(prop)
4
+ shouldForwardProp: (prop) => !["disabled", "active", "hover", "leftContent", "label"].includes(prop)
5
5
  }).attrs((props) => ({
6
6
  className: props.active ? "quen-ui__menu-item--active" : "quen-ui__menu-item"
7
7
  }))`
@@ -16,6 +16,7 @@ const MenuItemStyled = styled.button.withConfig({
16
16
  transition: background 0.2s ease;
17
17
  background: transparent;
18
18
  justify-content: flex-start;
19
+ text-decoration: none;
19
20
 
20
21
  color: ${({ theme, disabled }) => disabled ? theme.components.Menu.disabledColor : theme.components.Menu.color};
21
22
 
@@ -42,6 +43,7 @@ const MenuItemStyled = styled.button.withConfig({
42
43
 
43
44
  .quen-ui--menu__item_label {
44
45
  width: 100%;
46
+ text-align: left;
45
47
  }
46
48
 
47
49
  &:hover {
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { default as React, JSX } from 'react';
2
2
  import { TQuenSize } from '../types/size';
3
3
  export interface IMenuDefaultItem {
4
4
  /** Unique item identifier */
@@ -15,6 +15,9 @@ export interface IMenuDefaultItem {
15
15
  disabled?: boolean;
16
16
  /** Custom CSS classes */
17
17
  className?: string;
18
+ /** Renders as custom element (e.g., "a" for links) */
19
+ as?: keyof JSX.IntrinsicElements | React.ElementType;
20
+ [key: string]: any;
18
21
  }
19
22
  export type TMenuPropGetItemKey<Item> = (item: Item) => string;
20
23
  export type TMenuPropGetItemIcon<Item> = (item: Item) => React.ReactNode;
@@ -25,7 +25,6 @@ const Modal = ({
25
25
  width,
26
26
  ...props
27
27
  }) => {
28
- console.log(open);
29
28
  const [state, toggle] = reactTransitionState.useTransitionState({
30
29
  timeout: 500,
31
30
  unmountOnExit: true,
@@ -51,11 +50,12 @@ const Modal = ({
51
50
  };
52
51
  }, []);
53
52
  React.useEffect(() => {
53
+ const overflow = document.body.style.overflow;
54
54
  if (state.isEnter) {
55
55
  document.body.style.overflow = "hidden";
56
56
  }
57
57
  return () => {
58
- document.body.style.overflow = "unset";
58
+ document.body.style.overflow = overflow;
59
59
  };
60
60
  }, [state]);
61
61
  if (state.isEnter && container) {
@@ -24,7 +24,6 @@ const Modal = ({
24
24
  width,
25
25
  ...props
26
26
  }) => {
27
- console.log(open);
28
27
  const [state, toggle] = useTransitionState({
29
28
  timeout: 500,
30
29
  unmountOnExit: true,
@@ -50,11 +49,12 @@ const Modal = ({
50
49
  };
51
50
  }, []);
52
51
  useEffect(() => {
52
+ const overflow = document.body.style.overflow;
53
53
  if (state.isEnter) {
54
54
  document.body.style.overflow = "hidden";
55
55
  }
56
56
  return () => {
57
- document.body.style.overflow = "unset";
57
+ document.body.style.overflow = overflow;
58
58
  };
59
59
  }, [state]);
60
60
  if (state.isEnter && container) {
@@ -58,7 +58,9 @@ const ModalStyled = styled.div.withConfig({
58
58
  }
59
59
  `};
60
60
  `;
61
- const ModalContentStyled = styled.div`
61
+ const ModalContentStyled = styled.div.withConfig({
62
+ shouldForwardProp: (prop) => !["scrollable"].includes(prop)
63
+ })`
62
64
  ${({ scrollable }) => scrollable && styled.css`
63
65
  overflow-y: auto;
64
66
  max-height: 60vh;
@@ -56,7 +56,9 @@ const ModalStyled = styled.div.withConfig({
56
56
  }
57
57
  `};
58
58
  `;
59
- const ModalContentStyled = styled.div`
59
+ const ModalContentStyled = styled.div.withConfig({
60
+ shouldForwardProp: (prop) => !["scrollable"].includes(prop)
61
+ })`
60
62
  ${({ scrollable }) => scrollable && css`
61
63
  overflow-y: auto;
62
64
  max-height: 60vh;
@@ -10,7 +10,7 @@ const Text = ({
10
10
  type,
11
11
  as,
12
12
  className,
13
- styles: styles$1,
13
+ style,
14
14
  ...props
15
15
  }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
16
16
  styles.TextStyled,
@@ -21,7 +21,7 @@ const Text = ({
21
21
  onClick,
22
22
  type,
23
23
  as,
24
- styles: styles$1,
24
+ style,
25
25
  className,
26
26
  ...props,
27
27
  children
@@ -9,7 +9,7 @@ const Text$1 = ({
9
9
  type,
10
10
  as,
11
11
  className,
12
- styles,
12
+ style,
13
13
  ...props
14
14
  }, ref) => /* @__PURE__ */ jsx(
15
15
  TextStyled,
@@ -20,7 +20,7 @@ const Text$1 = ({
20
20
  onClick,
21
21
  type,
22
22
  as,
23
- styles,
23
+ style,
24
24
  className,
25
25
  ...props,
26
26
  children
@@ -17,6 +17,6 @@ export interface ITextProps {
17
17
  /** Custom CSS class */
18
18
  className?: string;
19
19
  /** Inline styles */
20
- styles?: CSSProperties;
20
+ style?: CSSProperties;
21
21
  [key: string]: any;
22
22
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quen-ui/components",
3
3
  "private": false,
4
- "version": "1.0.1",
4
+ "version": "1.1.0",
5
5
  "type": "module",
6
6
  "homepage": "https://quen-ui.github.io/quen-ui/",
7
7
  "repository": {