@lotte-innovate/ui-component-test 0.2.68 → 0.2.70

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,6 @@ import { cn } from '../../../lib/utils/utils';
28
28
  import { bgColorStyle, scalingVariants } from '../../../lib/constants';
29
29
  import { useTheme } from '../../../lib/theme';
30
30
  import * as ReactProSidebar from 'react-pro-sidebar';
31
- import { useWindowSize } from '../../../lib/utils/useWindowSize';
32
31
  import * as alphaColors from '../../../lib/color/alpha';
33
32
  var sidebarVariants = cva('', {
34
33
  variants: {
@@ -40,12 +39,11 @@ export var Root = React.forwardRef(function (_a, forwardedRef) {
40
39
  var _b;
41
40
  var scaling = _a.scaling, size = _a.size, color = _a.color, className = _a.className, children = _a.children, props = __rest(_a, ["scaling", "size", "color", "className", "children"]);
42
41
  var theme = useTheme().theme;
43
- var windowSize = useWindowSize();
44
42
  var sidebarStyle = {
45
43
  scaling: scaling !== null && scaling !== void 0 ? scaling : theme.themeScaling,
46
44
  color: (_b = color !== null && color !== void 0 ? color : theme.themeColor) !== null && _b !== void 0 ? _b : 'slate',
47
45
  };
48
- return (_jsx(ReactProSidebar.Sidebar, __assign({ className: cn("bg-".concat(sidebarStyle.color, "A-6 dark:bg-").concat(sidebarStyle.color, "DarkA-6"), sidebarVariants({ scaling: sidebarStyle.scaling }), className) }, props, { collapsed: props.collapsed === undefined ? windowSize <= 250 : props.collapsed, children: children })));
46
+ return (_jsx(ReactProSidebar.Sidebar, __assign({ className: cn("bg-".concat(sidebarStyle.color, "A-6 dark:bg-").concat(sidebarStyle.color, "DarkA-6"), sidebarVariants({ scaling: sidebarStyle.scaling }), className) }, props, { collapsed: props.collapsed, children: children })));
49
47
  });
50
48
  Root.displayName = 'Sidebar.Root';
51
49
  export var Menu = React.forwardRef(function (_a, forwardedRef) {
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsx as e}from"react/jsx-runtime";import r from"react";import{cva as o}from"class-variance-authority";import{cn as a}from"../../utils/utils.mjs";import{scalingVariants as l,bgColorStyle as n}from"../../constants.mjs";import{useTheme as t}from"../../theme/ThemeProvider.mjs";import*as c from"react-pro-sidebar";import{useWindowSize as i}from"../../utils/useWindowSize.mjs";import*as s from"../../color/alpha.mjs";var m=function(){return m=Object.assign||function(e){for(var r,o=1,a=arguments.length;o<a;o++)for(var l in r=arguments[o])Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l]);return e},m.apply(this,arguments)},u=function(e,r){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(o[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(a=Object.getOwnPropertySymbols(e);l<a.length;l++)r.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(o[a[l]]=e[a[l]])}return o},d=o("",{variants:{scaling:m({},l),color:n()}}),p=r.forwardRef((function(r,o){var l,n=r.scaling;r.size;var s=r.color,p=r.className,f=r.children,h=u(r,["scaling","size","color","className","children"]),v=t().theme,g=i(),b={scaling:null!=n?n:v.themeScaling,color:null!==(l=null!=s?s:v.themeColor)&&void 0!==l?l:"slate"};return e(c.Sidebar,m({className:a("bg-".concat(b.color,"A-6 dark:bg-").concat(b.color,"DarkA-6"),d({scaling:b.scaling}),p)},h,{collapsed:void 0===h.collapsed?g<=250:h.collapsed,children:f}))}));p.displayName="Sidebar.Root";var f=r.forwardRef((function(r,o){var a,l=r.scaling,n=r.size,i=r.color;r.className;var d=r.menuItemStyles,p=r.children,f=u(r,["scaling","size","color","className","menuItemStyles","children"]),h="50px",v="16px";"small"==n&&(h="40px",v="14px"),"large"==n&&(h="60px",v="18px");var g=t().theme,b={scaling:null!=l?l:g.themeScaling,color:null!==(a=null!=i?i:g.themeColor)&&void 0!==a?a:"slate"},y="".concat(b.color,"A"),S=s[y];return e(c.Menu,m({menuItemStyles:m({button:function(e){e.level;var r=e.active;return e.disabled,e.open,{height:h,fontSize:v,backgroundColor:r?S[5]:"","&:hover":{backgroundColor:S[3]}}}},d)},f,{children:p}))}));f.displayName="Sidebar.Menu";var h=r.forwardRef((function(r,o){r.scaling,r.size,r.color,r.className;var a=r.children,l=u(r,["scaling","size","color","className","children"]);return e(c.MenuItem,m({},l,{children:a}))}));h.displayName="Sidebar.Item";var v=r.forwardRef((function(r,o){r.scaling,r.size,r.color,r.className;var a=r.children,l=u(r,["scaling","size","color","className","children"]);return e(c.SubMenu,m({},l,{children:a}))}));v.displayName="Sidebar.SubMenu";var g={Root:p,Menu:f,Item:h,SubMenu:v};export{h as Item,f as Menu,p as Root,v as SubMenu,g as default};
2
+ import{jsx as e}from"react/jsx-runtime";import r from"react";import{cva as a}from"class-variance-authority";import{cn as o}from"../../utils/utils.mjs";import{scalingVariants as l,bgColorStyle as n}from"../../constants.mjs";import{useTheme as t}from"../../theme/ThemeProvider.mjs";import*as c from"react-pro-sidebar";import*as i from"../../color/alpha.mjs";var s=function(){return s=Object.assign||function(e){for(var r,a=1,o=arguments.length;a<o;a++)for(var l in r=arguments[a])Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l]);return e},s.apply(this,arguments)},m=function(e,r){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)r.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(a[o[l]]=e[o[l]])}return a},u=a("",{variants:{scaling:s({},l),color:n()}}),d=r.forwardRef((function(r,a){var l,n=r.scaling;r.size;var i=r.color,d=r.className,p=r.children,f=m(r,["scaling","size","color","className","children"]),h=t().theme,g={scaling:null!=n?n:h.themeScaling,color:null!==(l=null!=i?i:h.themeColor)&&void 0!==l?l:"slate"};return e(c.Sidebar,s({className:o("bg-".concat(g.color,"A-6 dark:bg-").concat(g.color,"DarkA-6"),u({scaling:g.scaling}),d)},f,{collapsed:f.collapsed,children:p}))}));d.displayName="Sidebar.Root";var p=r.forwardRef((function(r,a){var o,l=r.scaling,n=r.size,u=r.color;r.className;var d=r.menuItemStyles,p=r.children,f=m(r,["scaling","size","color","className","menuItemStyles","children"]),h="50px",g="16px";"small"==n&&(h="40px",g="14px"),"large"==n&&(h="60px",g="18px");var v=t().theme,b={scaling:null!=l?l:v.themeScaling,color:null!==(o=null!=u?u:v.themeColor)&&void 0!==o?o:"slate"},y="".concat(b.color,"A"),S=i[y];return e(c.Menu,s({menuItemStyles:s({button:function(e){e.level;var r=e.active;return e.disabled,e.open,{height:h,fontSize:g,backgroundColor:r?S[5]:"","&:hover":{backgroundColor:S[3]}}}},d)},f,{children:p}))}));p.displayName="Sidebar.Menu";var f=r.forwardRef((function(r,a){r.scaling,r.size,r.color,r.className;var o=r.children,l=m(r,["scaling","size","color","className","children"]);return e(c.MenuItem,s({},l,{children:o}))}));f.displayName="Sidebar.Item";var h=r.forwardRef((function(r,a){r.scaling,r.size,r.color,r.className;var o=r.children,l=m(r,["scaling","size","color","className","children"]);return e(c.SubMenu,s({},l,{children:o}))}));h.displayName="Sidebar.SubMenu";var g={Root:d,Menu:p,Item:f,SubMenu:h};export{f as Item,p as Menu,d as Root,h as SubMenu,g as default};
3
3
  //# sourceMappingURL=index.mjs.map