@ttoss/components 2.2.6 → 2.2.7

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.
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
2
  import { BoxProps } from '@ttoss/ui';
3
+ import * as React from 'react';
4
4
  import DrawerUi from 'react-modern-drawer';
5
5
 
6
6
  type DrawerUiProps = React.ComponentProps<typeof DrawerUi>;
@@ -2,51 +2,65 @@
2
2
 
3
3
  // src/components/Drawer/Drawer.tsx
4
4
  import { Box } from "@ttoss/ui";
5
- import { css as createClassName } from "@emotion/css";
6
5
  import DrawerUi from "react-modern-drawer";
7
6
  import { jsx } from "react/jsx-runtime";
8
- var reactModernDrawerClassName = createClassName(`
9
- .EZDrawer .EZDrawer__checkbox {
10
- display: none;
11
- }
12
- .EZDrawer .EZDrawer__checkbox:checked ~ .EZDrawer__overlay {
13
- display: block;
14
- opacity: 1;
15
- }
16
- .EZDrawer .EZDrawer__checkbox:checked ~ .EZDrawer__container {
17
- visibility: visible;
18
- transform: translate3d(0, 0, 0) !important;
19
- }
20
- .EZDrawer .EZDrawer__overlay {
21
- display: none;
22
- height: 100vh;
23
- left: 0;
24
- position: fixed;
25
- top: 0;
26
- width: 100%;
27
- }
28
- .EZDrawer .EZDrawer__container {
29
- position: fixed;
30
- visibility: hidden;
31
- background: white;
32
- transition: all;
33
- box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.1);
34
- }`);
35
7
  var Drawer = ({
36
8
  children,
37
9
  sx,
38
10
  ...props
39
11
  }) => {
40
- return /* @__PURE__ */jsx(DrawerUi, {
41
- ...props,
42
- className: reactModernDrawerClassName,
43
- children: /* @__PURE__ */jsx(Box, {
44
- sx: {
45
- width: "100%",
46
- height: "100%",
47
- ...sx
12
+ return /* @__PURE__ */jsx(Box, {
13
+ "data-testid": "drawer-container",
14
+ sx: {
15
+ /**
16
+ * https://github.com/Farzin-Firoozi/react-modern-drawer/blob/master/src/styles.css
17
+ */
18
+ zIndex: "dropdown",
19
+ width: "100%",
20
+ height: "100%",
21
+ ".EZDrawer__checkbox": {
22
+ display: "none"
48
23
  },
49
- children
24
+ ".EZDrawer__checkbox:checked ~ .EZDrawer__overlay": {
25
+ display: "block",
26
+ opacity: 1
27
+ },
28
+ ".EZDrawer__checkbox:checked ~ .EZDrawer__container": {
29
+ visibility: "visible",
30
+ transform: "translate3d(0, 0, 0) !important"
31
+ },
32
+ ".EZDrawer__overlay ": {
33
+ display: "none",
34
+ height: "100vh",
35
+ left: "0",
36
+ position: "absolute",
37
+ top: "0",
38
+ width: "100%"
39
+ },
40
+ ".EZDrawer__container": {
41
+ position: "absolute",
42
+ visibility: "hidden",
43
+ backgroundColor: "navigation.background.muted.default",
44
+ transition: "all",
45
+ boxShadow: "0 0 10px 5px rgba(0, 0, 0, 0.1)",
46
+ paddingY: "6",
47
+ paddingX: "6",
48
+ overflowY: "auto",
49
+ "@media (max-width: 768px)": {
50
+ position: "sticky"
51
+ }
52
+ },
53
+ ...sx
54
+ },
55
+ children: /* @__PURE__ */jsx(DrawerUi, {
56
+ ...props,
57
+ children: /* @__PURE__ */jsx(Box, {
58
+ sx: {
59
+ width: "100%",
60
+ height: "100%"
61
+ },
62
+ children
63
+ })
50
64
  })
51
65
  });
52
66
  };
@@ -2263,51 +2263,65 @@ import { Box as Box2, Flex, Image, Text, useResponsiveValue } from "@ttoss/ui";
2263
2263
 
2264
2264
  // src/components/Drawer/Drawer.tsx
2265
2265
  import { Box } from "@ttoss/ui";
2266
- import { css as createClassName } from "@emotion/css";
2267
2266
  import DrawerUi from "react-modern-drawer";
2268
2267
  import { jsx as jsx2 } from "react/jsx-runtime";
2269
- var reactModernDrawerClassName = createClassName(`
2270
- .EZDrawer .EZDrawer__checkbox {
2271
- display: none;
2272
- }
2273
- .EZDrawer .EZDrawer__checkbox:checked ~ .EZDrawer__overlay {
2274
- display: block;
2275
- opacity: 1;
2276
- }
2277
- .EZDrawer .EZDrawer__checkbox:checked ~ .EZDrawer__container {
2278
- visibility: visible;
2279
- transform: translate3d(0, 0, 0) !important;
2280
- }
2281
- .EZDrawer .EZDrawer__overlay {
2282
- display: none;
2283
- height: 100vh;
2284
- left: 0;
2285
- position: fixed;
2286
- top: 0;
2287
- width: 100%;
2288
- }
2289
- .EZDrawer .EZDrawer__container {
2290
- position: fixed;
2291
- visibility: hidden;
2292
- background: white;
2293
- transition: all;
2294
- box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.1);
2295
- }`);
2296
2268
  var Drawer = ({
2297
2269
  children,
2298
2270
  sx,
2299
2271
  ...props
2300
2272
  }) => {
2301
- return /* @__PURE__ */jsx2(DrawerUi, {
2302
- ...props,
2303
- className: reactModernDrawerClassName,
2304
- children: /* @__PURE__ */jsx2(Box, {
2305
- sx: {
2306
- width: "100%",
2307
- height: "100%",
2308
- ...sx
2273
+ return /* @__PURE__ */jsx2(Box, {
2274
+ "data-testid": "drawer-container",
2275
+ sx: {
2276
+ /**
2277
+ * https://github.com/Farzin-Firoozi/react-modern-drawer/blob/master/src/styles.css
2278
+ */
2279
+ zIndex: "dropdown",
2280
+ width: "100%",
2281
+ height: "100%",
2282
+ ".EZDrawer__checkbox": {
2283
+ display: "none"
2284
+ },
2285
+ ".EZDrawer__checkbox:checked ~ .EZDrawer__overlay": {
2286
+ display: "block",
2287
+ opacity: 1
2288
+ },
2289
+ ".EZDrawer__checkbox:checked ~ .EZDrawer__container": {
2290
+ visibility: "visible",
2291
+ transform: "translate3d(0, 0, 0) !important"
2292
+ },
2293
+ ".EZDrawer__overlay ": {
2294
+ display: "none",
2295
+ height: "100vh",
2296
+ left: "0",
2297
+ position: "absolute",
2298
+ top: "0",
2299
+ width: "100%"
2300
+ },
2301
+ ".EZDrawer__container": {
2302
+ position: "absolute",
2303
+ visibility: "hidden",
2304
+ backgroundColor: "navigation.background.muted.default",
2305
+ transition: "all",
2306
+ boxShadow: "0 0 10px 5px rgba(0, 0, 0, 0.1)",
2307
+ paddingY: "6",
2308
+ paddingX: "6",
2309
+ overflowY: "auto",
2310
+ "@media (max-width: 768px)": {
2311
+ position: "sticky"
2312
+ }
2309
2313
  },
2310
- children
2314
+ ...sx
2315
+ },
2316
+ children: /* @__PURE__ */jsx2(DrawerUi, {
2317
+ ...props,
2318
+ children: /* @__PURE__ */jsx2(Box, {
2319
+ sx: {
2320
+ width: "100%",
2321
+ height: "100%"
2322
+ },
2323
+ children
2324
+ })
2311
2325
  })
2312
2326
  });
2313
2327
  };
@@ -2364,8 +2378,10 @@ var Menu = ({
2364
2378
  maxWidth: "200px",
2365
2379
  height: "44px",
2366
2380
  objectFit: "cover"
2367
- }
2381
+ },
2382
+ "data-testid": "img"
2368
2383
  }), /* @__PURE__ */jsx3(Text, {
2384
+ "data-testid": "button",
2369
2385
  sx: {
2370
2386
  marginLeft: "auto",
2371
2387
  fontSize: "2xl",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/components",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "description": "React components for ttoss ecosystem.",
5
5
  "license": "MIT",
6
6
  "author": "ttoss",
@@ -94,7 +94,7 @@
94
94
  "peerDependencies": {
95
95
  "react": ">=16.8.0",
96
96
  "@ttoss/react-hooks": "^2.0.10",
97
- "@ttoss/ui": "^5.5.4"
97
+ "@ttoss/ui": "^5.5.5"
98
98
  },
99
99
  "devDependencies": {
100
100
  "@types/jest": "^29.5.14",
@@ -103,11 +103,11 @@
103
103
  "react": "^19.0.0",
104
104
  "tsup": "^8.3.5",
105
105
  "tsx": "^4.19.2",
106
- "@ttoss/react-icons": "^0.4.9",
107
106
  "@ttoss/config": "^1.35.2",
108
107
  "@ttoss/react-hooks": "^2.0.10",
108
+ "@ttoss/react-icons": "^0.4.9",
109
109
  "@ttoss/test-utils": "^2.1.22",
110
- "@ttoss/ui": "^5.5.4"
110
+ "@ttoss/ui": "^5.5.5"
111
111
  },
112
112
  "keywords": [
113
113
  "React",