@astral/ui 1.19.1 → 1.19.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.
@@ -2,14 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useBackdropStackToggle = void 0;
4
4
  const react_1 = require("react");
5
- const nanoid_1 = require("nanoid");
6
5
  const BackdropStackManager_1 = require("../../services/BackdropStackManager");
7
6
  /**
8
7
  * @description хук предназначен для быстрого использования backdropStackManager в реакт компонентах, хранит неуправляемый стейт, если вам нужно управлять этим стейтом, воспользуйтесь backdropStackManager в своем компоненте напрямую.
9
8
  */
10
9
  const useBackdropStackToggle = ({ id: parentId, } = {}) => {
11
- const id = (0, react_1.useRef)(parentId || (0, nanoid_1.nanoid)());
12
- const { pop, push, remove } = BackdropStackManager_1.backdropStackManager;
10
+ const { pop, push, remove, generateID } = BackdropStackManager_1.backdropStackManager;
11
+ const id = (0, react_1.useRef)(parentId || generateID());
13
12
  const [isOpened, setOpened] = (0, react_1.useState)(false);
14
13
  const handleOpen = () => {
15
14
  push(id.current);
@@ -7,6 +7,7 @@ declare class BackdropStackManager {
7
7
  private currentPointerId;
8
8
  constructor();
9
9
  private checkOn;
10
+ generateID: () => string;
10
11
  remove: (id: PopId) => void;
11
12
  push: (id: PopId) => void;
12
13
  pop: (id: PopId, reason?: Reason) => boolean;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.backdropStackManager = void 0;
4
- const nanoid_1 = require("nanoid");
5
4
  class BackdropStackManager {
6
5
  constructor() {
7
6
  this.stack = [];
@@ -15,6 +14,9 @@ class BackdropStackManager {
15
14
  previousReason === 'blur' &&
16
15
  previousPointerId === this.currentPointerId);
17
16
  };
17
+ this.generateID = () => {
18
+ return String(Math.random());
19
+ };
18
20
  this.remove = (id) => {
19
21
  this.stack = this.stack.filter((item) => item !== id);
20
22
  };
@@ -33,7 +35,7 @@ class BackdropStackManager {
33
35
  }
34
36
  return false;
35
37
  };
36
- document === null || document === void 0 ? void 0 : document.addEventListener('pointerdown', () => (this.currentPointerId = (0, nanoid_1.nanoid)()));
38
+ document === null || document === void 0 ? void 0 : document.addEventListener('pointerdown', () => (this.currentPointerId = this.generateID()));
37
39
  }
38
40
  }
39
41
  exports.backdropStackManager = new BackdropStackManager();
package/Grid/styled.js CHANGED
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StyledGrid = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const styles_1 = require("../styles");
6
- exports.StyledGrid = (0, styles_1.styled)(material_1.Box) `
6
+ exports.StyledGrid = (0, styles_1.styled)(material_1.Box, {
7
+ shouldForwardProp: (prop) => prop !== 'container',
8
+ }) `
7
9
  display: ${({ container }) => container && 'grid'};
8
10
  `;
@@ -1,12 +1,11 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
- import { nanoid } from 'nanoid';
3
2
  import { backdropStackManager, } from '../../services/BackdropStackManager';
4
3
  /**
5
4
  * @description хук предназначен для быстрого использования backdropStackManager в реакт компонентах, хранит неуправляемый стейт, если вам нужно управлять этим стейтом, воспользуйтесь backdropStackManager в своем компоненте напрямую.
6
5
  */
7
6
  export const useBackdropStackToggle = ({ id: parentId, } = {}) => {
8
- const id = useRef(parentId || nanoid());
9
- const { pop, push, remove } = backdropStackManager;
7
+ const { pop, push, remove, generateID } = backdropStackManager;
8
+ const id = useRef(parentId || generateID());
10
9
  const [isOpened, setOpened] = useState(false);
11
10
  const handleOpen = () => {
12
11
  push(id.current);
@@ -7,6 +7,7 @@ declare class BackdropStackManager {
7
7
  private currentPointerId;
8
8
  constructor();
9
9
  private checkOn;
10
+ generateID: () => string;
10
11
  remove: (id: PopId) => void;
11
12
  push: (id: PopId) => void;
12
13
  pop: (id: PopId, reason?: Reason) => boolean;
@@ -1,4 +1,3 @@
1
- import { nanoid } from 'nanoid';
2
1
  class BackdropStackManager {
3
2
  constructor() {
4
3
  this.stack = [];
@@ -12,6 +11,9 @@ class BackdropStackManager {
12
11
  previousReason === 'blur' &&
13
12
  previousPointerId === this.currentPointerId);
14
13
  };
14
+ this.generateID = () => {
15
+ return String(Math.random());
16
+ };
15
17
  this.remove = (id) => {
16
18
  this.stack = this.stack.filter((item) => item !== id);
17
19
  };
@@ -30,7 +32,7 @@ class BackdropStackManager {
30
32
  }
31
33
  return false;
32
34
  };
33
- document === null || document === void 0 ? void 0 : document.addEventListener('pointerdown', () => (this.currentPointerId = nanoid()));
35
+ document === null || document === void 0 ? void 0 : document.addEventListener('pointerdown', () => (this.currentPointerId = this.generateID()));
34
36
  }
35
37
  }
36
38
  export const backdropStackManager = new BackdropStackManager();
@@ -1,5 +1,7 @@
1
1
  import { Box } from '@mui/material';
2
2
  import { styled } from '../styles';
3
- export const StyledGrid = styled(Box) `
3
+ export const StyledGrid = styled(Box, {
4
+ shouldForwardProp: (prop) => prop !== 'container',
5
+ }) `
4
6
  display: ${({ container }) => container && 'grid'};
5
7
  `;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "1.19.1",
3
+ "version": "1.19.3",
4
4
  "browser": "./esm/index.js",
5
5
  "main": "./index.js",
6
6
  "dependencies": {
7
- "@astral/icons": "^1.19.1",
7
+ "@astral/icons": "^1.19.3",
8
8
  "@emotion/cache": "11.7.1",
9
9
  "@emotion/react": "11.9.0",
10
10
  "@emotion/server": "11.4.0",
@@ -14,7 +14,6 @@
14
14
  "@mui/material": "^5.8.4",
15
15
  "date-fns": "^2.28.0",
16
16
  "lodash-es": "^4.17.21",
17
- "nanoid": "^4.0.0",
18
17
  "react-datepicker": "4.7.0",
19
18
  "react-imask": "^6.4.2",
20
19
  "react-toastify": "9.0.3",