lecom-ui 4.4.9 → 4.5.1

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.
@@ -13,13 +13,7 @@ import { Typography } from '../Typography/Typography.js';
13
13
  initializeI18n();
14
14
  const Layout = ({ children, header, sideBar }) => {
15
15
  const { items, info } = sideBar;
16
- const [sidebarState, setSidebarState] = React.useState(
17
- void 0
18
- );
19
- React.useEffect(() => {
20
- const cookieState = getCookie("sidebar:state") === "true";
21
- setSidebarState(cookieState);
22
- }, []);
16
+ const sidebarState = getCookie("sidebar:state") === "true";
23
17
  return /* @__PURE__ */ React.createElement(SidebarProvider, { className: "flex-col", defaultOpen: sidebarState }, /* @__PURE__ */ React.createElement(Header, { ...header }), /* @__PURE__ */ React.createElement("div", { className: "flex grow" }, /* @__PURE__ */ React.createElement(Sidebar, { collapsible: "icon", variant: "sidebar" }, /* @__PURE__ */ React.createElement(SidebarContent, null, /* @__PURE__ */ React.createElement(SidebarGroup, null, /* @__PURE__ */ React.createElement(SidebarGroupContent, null, /* @__PURE__ */ React.createElement(SidebarMenu, null, items.map((item) => /* @__PURE__ */ React.createElement(SidebarMenuItem, { key: item.title }, /* @__PURE__ */ React.createElement(
24
18
  SidebarMenuButton,
25
19
  {
@@ -1,13 +1,10 @@
1
1
  const getCookie = (name) => {
2
- if (typeof window !== "undefined" && typeof document !== "undefined") {
3
- const matches = document.cookie.match(
4
- new RegExp(
5
- `(?:^|; )${name.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1")}=([^;]*)`
6
- )
7
- );
8
- return matches ? decodeURIComponent(matches[1]) : void 0;
9
- }
10
- return void 0;
2
+ const matches = document.cookie.match(
3
+ new RegExp(
4
+ `(?:^|; )${name.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1")}=([^;]*)`
5
+ )
6
+ );
7
+ return matches ? decodeURIComponent(matches[1]) : void 0;
11
8
  };
12
9
 
13
10
  export { getCookie };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "4.4.9",
3
+ "version": "4.5.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
@@ -90,6 +90,18 @@
90
90
  "react": ">=18.0.0",
91
91
  "react-dom": ">=18.0.0"
92
92
  },
93
+ "peerDependenciesMeta": {
94
+ "react": {
95
+ "optional": true
96
+ },
97
+ "react-dom": {
98
+ "optional": true
99
+ }
100
+ },
101
+ "resolutions": {
102
+ "react": "^19.0.0",
103
+ "react-dom": "^19.0.0"
104
+ },
93
105
  "eslintConfig": {
94
106
  "extends": [
95
107
  "plugin:storybook/recommended"