@ttoss/components 2.0.0 → 2.0.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.
package/dist/esm/index.js CHANGED
@@ -2492,9 +2492,36 @@ var Menu = ({
2492
2492
 
2493
2493
  // src/components/Drawer.tsx
2494
2494
  import { Box as Box4 } from "@ttoss/ui";
2495
+ import { css as createClassName2 } from "@emotion/css";
2495
2496
  import DrawerUi from "react-modern-drawer";
2496
- import "react-modern-drawer/dist/index.css";
2497
2497
  import { jsx as jsx9 } from "react/jsx-runtime";
2498
+ var reactModernDrawerClassName = createClassName2(`
2499
+ .EZDrawer .EZDrawer__checkbox {
2500
+ display: none;
2501
+ }
2502
+ .EZDrawer .EZDrawer__checkbox:checked ~ .EZDrawer__overlay {
2503
+ display: block;
2504
+ opacity: 1;
2505
+ }
2506
+ .EZDrawer .EZDrawer__checkbox:checked ~ .EZDrawer__container {
2507
+ visibility: visible;
2508
+ transform: translate3d(0, 0, 0) !important;
2509
+ }
2510
+ .EZDrawer .EZDrawer__overlay {
2511
+ display: none;
2512
+ height: 100vh;
2513
+ left: 0;
2514
+ position: fixed;
2515
+ top: 0;
2516
+ width: 100%;
2517
+ }
2518
+ .EZDrawer .EZDrawer__container {
2519
+ position: fixed;
2520
+ visibility: hidden;
2521
+ background: white;
2522
+ transition: all;
2523
+ box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.1);
2524
+ }`);
2498
2525
  var Drawer = ({
2499
2526
  children,
2500
2527
  sx,
@@ -2502,6 +2529,7 @@ var Drawer = ({
2502
2529
  }) => {
2503
2530
  return /* @__PURE__ */jsx9(DrawerUi, {
2504
2531
  ...props,
2532
+ className: reactModernDrawerClassName,
2505
2533
  children: /* @__PURE__ */jsx9(Box4, {
2506
2534
  sx: {
2507
2535
  width: "100%",
package/dist/index.d.ts CHANGED
@@ -352,7 +352,6 @@ type MenuProps = {
352
352
  declare const Menu: ({ children, srcLogo, onClose, onOpen, isOpen, sx, direction, sizeOnDesktop, sizeOnMobile, menuIcon, }: MenuProps) => react_jsx_runtime.JSX.Element;
353
353
 
354
354
  type DrawerUiProps = React.ComponentProps<typeof DrawerUi>;
355
-
356
355
  type DrawerProps = DrawerUiProps & {
357
356
  sx?: BoxProps['sx'];
358
357
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/components",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "React components for ttoss ecosystem.",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -47,7 +47,7 @@
47
47
  "peerDependencies": {
48
48
  "react": ">=16.8.0",
49
49
  "@ttoss/react-hooks": "^2.0.0",
50
- "@ttoss/ui": "^5.0.0"
50
+ "@ttoss/ui": "^5.0.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/jest": "^29.5.12",
@@ -57,9 +57,9 @@
57
57
  "tsup": "^8.2.4",
58
58
  "@ttoss/config": "^1.32.9",
59
59
  "@ttoss/react-hooks": "^2.0.0",
60
- "@ttoss/test-utils": "^2.1.13",
61
60
  "@ttoss/react-icons": "^0.4.0",
62
- "@ttoss/ui": "^5.0.0"
61
+ "@ttoss/test-utils": "^2.1.13",
62
+ "@ttoss/ui": "^5.0.1"
63
63
  },
64
64
  "keywords": [
65
65
  "React",
@@ -1,18 +1,48 @@
1
1
  import * as React from 'react';
2
2
  import { Box, type BoxProps } from '@ttoss/ui';
3
+ import { css as createClassName } from '@emotion/css';
3
4
  import DrawerUi from 'react-modern-drawer';
4
5
 
5
6
  type DrawerUiProps = React.ComponentProps<typeof DrawerUi>;
6
7
 
7
- import 'react-modern-drawer/dist/index.css';
8
-
9
8
  export type DrawerProps = DrawerUiProps & {
10
9
  sx?: BoxProps['sx'];
11
10
  };
12
11
 
12
+ /**
13
+ * https://github.com/Farzin-Firoozi/react-modern-drawer/blob/master/src/styles.css
14
+ */
15
+ const reactModernDrawerClassName = createClassName(`
16
+ .EZDrawer .EZDrawer__checkbox {
17
+ display: none;
18
+ }
19
+ .EZDrawer .EZDrawer__checkbox:checked ~ .EZDrawer__overlay {
20
+ display: block;
21
+ opacity: 1;
22
+ }
23
+ .EZDrawer .EZDrawer__checkbox:checked ~ .EZDrawer__container {
24
+ visibility: visible;
25
+ transform: translate3d(0, 0, 0) !important;
26
+ }
27
+ .EZDrawer .EZDrawer__overlay {
28
+ display: none;
29
+ height: 100vh;
30
+ left: 0;
31
+ position: fixed;
32
+ top: 0;
33
+ width: 100%;
34
+ }
35
+ .EZDrawer .EZDrawer__container {
36
+ position: fixed;
37
+ visibility: hidden;
38
+ background: white;
39
+ transition: all;
40
+ box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.1);
41
+ }`);
42
+
13
43
  export const Drawer = ({ children, sx, ...props }: DrawerProps) => {
14
44
  return (
15
- <DrawerUi {...props}>
45
+ <DrawerUi {...props} className={reactModernDrawerClassName}>
16
46
  <Box
17
47
  sx={{
18
48
  width: '100%',