@lets-events/react 12.3.3 → 12.3.5

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/index.mjs CHANGED
@@ -1236,6 +1236,9 @@ var {
1236
1236
  lineHeights,
1237
1237
  radii,
1238
1238
  space
1239
+ },
1240
+ media: {
1241
+ md: "(max-width: 690px)"
1239
1242
  }
1240
1243
  });
1241
1244
 
@@ -8033,27 +8036,70 @@ var DrawerOverlayStyled = styled("div", {
8033
8036
  right: 0,
8034
8037
  width: "100vw",
8035
8038
  height: "100vh",
8036
- background: "rgba(0, 0, 0, 0.4)"
8039
+ background: "rgba(0, 0, 0, 0.4)",
8040
+ transition: "opacity 200ms ease",
8041
+ variants: {
8042
+ open: {
8043
+ true: {
8044
+ opacity: "1"
8045
+ },
8046
+ false: {
8047
+ pointerEvents: "none",
8048
+ opacity: "0"
8049
+ }
8050
+ }
8051
+ }
8052
+ });
8053
+ var DrawerWrapper = styled("div", {
8054
+ position: "absolute",
8055
+ top: 0,
8056
+ right: 0,
8057
+ height: "100vh",
8058
+ overflow: "hidden",
8059
+ variants: {
8060
+ open: {
8061
+ true: {},
8062
+ false: {
8063
+ pointerEvents: "none"
8064
+ }
8065
+ }
8066
+ }
8037
8067
  });
8038
8068
  var DrawerContainerStyled = styled("div", {
8039
8069
  position: "absolute",
8040
8070
  top: 0,
8041
8071
  right: 0,
8042
- maxWidth: "calc(100% - 2rem)",
8043
- height: "100%",
8072
+ height: "100vh",
8044
8073
  background: "$neutral50",
8045
8074
  display: "flex",
8046
8075
  flexDirection: "column",
8047
8076
  boxShadow: "-4px 0 12px rgba(0, 0, 0, 0.2)",
8048
- padding: "1.5rem 0",
8049
- overflowY: "auto"
8077
+ overflowY: "auto",
8078
+ width: "100%",
8079
+ boxSizing: "border-box",
8080
+ "@md": {
8081
+ minWidth: "100vw",
8082
+ maxWidth: "100vw"
8083
+ },
8084
+ transition: "transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)",
8085
+ paddingBottom: "1.5rem",
8086
+ variants: {
8087
+ open: {
8088
+ true: {
8089
+ transform: "translateX(0) scale(1)"
8090
+ },
8091
+ false: {
8092
+ transform: "translateX(110%) scale(0.98)"
8093
+ }
8094
+ }
8095
+ }
8050
8096
  });
8051
8097
  var DrawerHeaderDiv = styled("div", {
8052
8098
  display: "flex",
8053
8099
  justifyContent: "space-between",
8054
8100
  alignItems: "center",
8055
8101
  borderBottom: "1px solid $neutral300",
8056
- padding: "0 1.5rem 1rem",
8102
+ padding: "1.5rem 1rem",
8057
8103
  position: "relative"
8058
8104
  });
8059
8105
  var DrawerHeaderTitle = styled("h2", {
@@ -8088,7 +8134,6 @@ function Drawer({
8088
8134
  goBackAction,
8089
8135
  zIndex = 1e3
8090
8136
  }) {
8091
- if (!isOpen) return null;
8092
8137
  return /* @__PURE__ */ jsxs7(Fragment, { children: [
8093
8138
  /* @__PURE__ */ jsx16(
8094
8139
  DrawerOverlayStyled,
@@ -8096,27 +8141,36 @@ function Drawer({
8096
8141
  css: {
8097
8142
  zIndex
8098
8143
  },
8099
- onClick: onClose
8144
+ onClick: onClose,
8145
+ open: isOpen
8100
8146
  }
8101
8147
  ),
8102
- /* @__PURE__ */ jsxs7(
8103
- DrawerContainerStyled,
8148
+ /* @__PURE__ */ jsx16(
8149
+ DrawerWrapper,
8104
8150
  {
8105
- style: {
8106
- width: width != null ? width : "34.25rem",
8107
- backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"],
8108
- zIndex: zIndex + 1
8151
+ css: {
8152
+ zIndex: zIndex + 1,
8153
+ width: width != null ? width : "34.25rem"
8109
8154
  },
8110
- children: [
8111
- /* @__PURE__ */ jsxs7(DrawerHeaderDiv, { children: [
8112
- /* @__PURE__ */ jsxs7(Flex2, { gap: 8, align: "center", children: [
8113
- goBackIcon && goBackIcon && /* @__PURE__ */ jsx16(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
8114
- /* @__PURE__ */ jsx16(DrawerHeaderTitle, { children: title })
8115
- ] }),
8116
- /* @__PURE__ */ jsx16(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ jsx16(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
8117
- ] }),
8118
- children
8119
- ]
8155
+ children: /* @__PURE__ */ jsxs7(
8156
+ DrawerContainerStyled,
8157
+ {
8158
+ open: isOpen,
8159
+ css: {
8160
+ backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"]
8161
+ },
8162
+ children: [
8163
+ /* @__PURE__ */ jsxs7(DrawerHeaderDiv, { children: [
8164
+ /* @__PURE__ */ jsxs7(Flex2, { gap: 8, align: "center", children: [
8165
+ goBackIcon && goBackIcon && /* @__PURE__ */ jsx16(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
8166
+ /* @__PURE__ */ jsx16(DrawerHeaderTitle, { children: title })
8167
+ ] }),
8168
+ /* @__PURE__ */ jsx16(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ jsx16(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
8169
+ ] }),
8170
+ isOpen ? children : null
8171
+ ]
8172
+ }
8173
+ )
8120
8174
  }
8121
8175
  )
8122
8176
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.3.3",
3
+ "version": "12.3.5",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -8,6 +8,7 @@ import {
8
8
  DrawerHeaderTitle,
9
9
  DrawerHeaderCloseButton,
10
10
  GoBackButtonStyled,
11
+ DrawerWrapper,
11
12
  } from "./styledComponents";
12
13
  import { useOnClickOutside } from "../../hooks/useOnClickOutside";
13
14
  import { Flex } from "../Flex";
@@ -35,8 +36,6 @@ export function Drawer({
35
36
  goBackAction,
36
37
  zIndex = 1000,
37
38
  }: DrawerProps) {
38
- if (!isOpen) return null;
39
-
40
39
  return (
41
40
  <>
42
41
  <DrawerOverlayStyled
@@ -44,29 +43,36 @@ export function Drawer({
44
43
  zIndex,
45
44
  }}
46
45
  onClick={onClose}
46
+ open={isOpen}
47
47
  />
48
- <DrawerContainerStyled
49
- style={{
50
- width: width ?? "34.25rem",
51
- backgroundColor: colors[backgroundColor ?? "neutral50"],
48
+ <DrawerWrapper
49
+ css={{
52
50
  zIndex: zIndex + 1,
51
+ width: width ?? "34.25rem",
53
52
  }}
54
53
  >
55
- <DrawerHeaderDiv>
56
- <Flex gap={8} align="center">
57
- {goBackIcon && goBackIcon && (
58
- <GoBackButtonStyled type="button" onClick={goBackAction}>
59
- {goBackIcon}
60
- </GoBackButtonStyled>
61
- )}
62
- <DrawerHeaderTitle>{title}</DrawerHeaderTitle>
63
- </Flex>
64
- <DrawerHeaderCloseButton onClick={onClose}>
65
- <Icon size={"xl"} color="$dark600" name="xmark" />
66
- </DrawerHeaderCloseButton>
67
- </DrawerHeaderDiv>
68
- {children}
69
- </DrawerContainerStyled>
54
+ <DrawerContainerStyled
55
+ open={isOpen}
56
+ css={{
57
+ backgroundColor: colors[backgroundColor ?? "neutral50"],
58
+ }}
59
+ >
60
+ <DrawerHeaderDiv>
61
+ <Flex gap={8} align="center">
62
+ {goBackIcon && goBackIcon && (
63
+ <GoBackButtonStyled type="button" onClick={goBackAction}>
64
+ {goBackIcon}
65
+ </GoBackButtonStyled>
66
+ )}
67
+ <DrawerHeaderTitle>{title}</DrawerHeaderTitle>
68
+ </Flex>
69
+ <DrawerHeaderCloseButton onClick={onClose}>
70
+ <Icon size={"xl"} color="$dark600" name="xmark" />
71
+ </DrawerHeaderCloseButton>
72
+ </DrawerHeaderDiv>
73
+ {isOpen ? children : null}
74
+ </DrawerContainerStyled>
75
+ </DrawerWrapper>
70
76
  </>
71
77
  );
72
78
  }
@@ -7,20 +7,71 @@ export const DrawerOverlayStyled = styled("div", {
7
7
  width: "100vw",
8
8
  height: "100vh",
9
9
  background: "rgba(0, 0, 0, 0.4)",
10
+
11
+ transition: "opacity 200ms ease",
12
+
13
+ variants: {
14
+ open: {
15
+ true: {
16
+ opacity: "1",
17
+ },
18
+ false: {
19
+ pointerEvents: "none",
20
+ opacity: "0",
21
+ },
22
+ },
23
+ },
24
+ });
25
+
26
+ export const DrawerWrapper = styled("div", {
27
+ position: "absolute",
28
+ top: 0,
29
+ right: 0,
30
+ height: "100vh",
31
+ overflow: "hidden",
32
+
33
+ variants: {
34
+ open: {
35
+ true: {},
36
+ false: {
37
+ pointerEvents: "none",
38
+ },
39
+ },
40
+ },
10
41
  });
11
42
 
12
43
  export const DrawerContainerStyled = styled("div", {
13
44
  position: "absolute",
14
45
  top: 0,
15
46
  right: 0,
16
- maxWidth: "calc(100% - 2rem)",
17
- height: "100%",
47
+ height: "100vh",
18
48
  background: "$neutral50",
19
49
  display: "flex",
20
50
  flexDirection: "column",
21
51
  boxShadow: "-4px 0 12px rgba(0, 0, 0, 0.2)",
22
- padding: "1.5rem 0",
23
52
  overflowY: "auto",
53
+ width: "100%",
54
+ boxSizing: 'border-box',
55
+
56
+ "@md": {
57
+ minWidth: "100vw",
58
+ maxWidth: "100vw",
59
+ },
60
+
61
+ transition: "transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)",
62
+
63
+ paddingBottom: "1.5rem",
64
+
65
+ variants: {
66
+ open: {
67
+ true: {
68
+ transform: "translateX(0) scale(1)",
69
+ },
70
+ false: {
71
+ transform: "translateX(110%) scale(0.98)",
72
+ },
73
+ },
74
+ },
24
75
  });
25
76
 
26
77
  export const DrawerHeaderDiv = styled("div", {
@@ -28,9 +79,10 @@ export const DrawerHeaderDiv = styled("div", {
28
79
  justifyContent: "space-between",
29
80
  alignItems: "center",
30
81
  borderBottom: "1px solid $neutral300",
31
- padding: "0 1.5rem 1rem",
82
+ padding: "1.5rem 1rem",
32
83
  position: "relative",
33
84
  });
85
+
34
86
  export const DrawerHeaderTitle = styled("h2", {
35
87
  fontSize: "1.125rem",
36
88
  fontWeight: "400",
@@ -6,9 +6,9 @@ import {
6
6
  lineHeights,
7
7
  radii,
8
8
  space,
9
- } from '@lets-events/tokens'
9
+ } from "@lets-events/tokens";
10
10
 
11
- import { createStitches, defaultThemeMap } from '@stitches/react'
11
+ import { createStitches, defaultThemeMap } from "@stitches/react";
12
12
 
13
13
  export const {
14
14
  styled,
@@ -22,9 +22,9 @@ export const {
22
22
  } = createStitches({
23
23
  themeMap: {
24
24
  ...defaultThemeMap,
25
- height: 'space',
26
- width: 'space',
27
- gap: 'space'
25
+ height: "space",
26
+ width: "space",
27
+ gap: "space",
28
28
  },
29
29
  theme: {
30
30
  colors,
@@ -35,4 +35,7 @@ export const {
35
35
  radii,
36
36
  space,
37
37
  },
38
- })
38
+ media: {
39
+ md: "(max-width: 690px)",
40
+ },
41
+ });