@lets-events/react 12.2.0 → 12.2.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- > @lets-events/react@12.2.0 build
3
+ > @lets-events/react@12.2.1 build
4
4
  > tsup src/index.tsx --format esm,cjs --dts --external react
5
5
 
6
6
  CLI Building entry: src/index.tsx
@@ -10,12 +10,12 @@
10
10
  CLI Target: es6
11
11
  ESM Build start
12
12
  CJS Build start
13
- CJS dist/index.js 391.96 KB
14
- CJS ⚡️ Build success in 499ms
15
- ESM dist/index.mjs 378.06 KB
16
- ESM ⚡️ Build success in 501ms
13
+ ESM dist/index.mjs 378.47 KB
14
+ ESM ⚡️ Build success in 358ms
15
+ CJS dist/index.js 392.42 KB
16
+ CJS ⚡️ Build success in 360ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 8126ms
19
- DTS dist/index.d.mts 388.96 KB
20
- DTS dist/index.d.ts 388.96 KB
18
+ DTS ⚡️ Build success in 7045ms
19
+ DTS dist/index.d.mts 389.04 KB
20
+ DTS dist/index.d.ts 389.04 KB
21
21
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 12.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Drawer Go Back Button
8
+
3
9
  ## 12.2.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -5054,8 +5054,10 @@ type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
5054
5054
  backgroundColor?: keyof Colors;
5055
5055
  title: string;
5056
5056
  children?: ReactNode;
5057
+ goBackIcon?: ReactNode;
5058
+ goBackAction: () => void;
5057
5059
  };
5058
- declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, }: DrawerProps): react_jsx_runtime.JSX.Element | null;
5060
+ declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, goBackIcon, goBackAction }: DrawerProps): react_jsx_runtime.JSX.Element | null;
5059
5061
 
5060
5062
  declare const TimePickerStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
5061
5063
  expand?: boolean | "true" | undefined;
package/dist/index.d.ts CHANGED
@@ -5054,8 +5054,10 @@ type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
5054
5054
  backgroundColor?: keyof Colors;
5055
5055
  title: string;
5056
5056
  children?: ReactNode;
5057
+ goBackIcon?: ReactNode;
5058
+ goBackAction: () => void;
5057
5059
  };
5058
- declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, }: DrawerProps): react_jsx_runtime.JSX.Element | null;
5060
+ declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, goBackIcon, goBackAction }: DrawerProps): react_jsx_runtime.JSX.Element | null;
5059
5061
 
5060
5062
  declare const TimePickerStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
5061
5063
  expand?: boolean | "true" | undefined;
package/dist/index.js CHANGED
@@ -8112,6 +8112,12 @@ var DrawerHeaderCloseButton = styled("button", {
8112
8112
  border: "none",
8113
8113
  cursor: "pointer"
8114
8114
  });
8115
+ var GoBackButtonStyled = styled("button", {
8116
+ background: "none",
8117
+ padding: "0",
8118
+ border: "none",
8119
+ cursor: "pointer"
8120
+ });
8115
8121
 
8116
8122
  // src/components/Drawer/index.tsx
8117
8123
  var import_jsx_runtime16 = require("react/jsx-runtime");
@@ -8121,7 +8127,9 @@ function Drawer({
8121
8127
  width,
8122
8128
  backgroundColor,
8123
8129
  title,
8124
- children
8130
+ children,
8131
+ goBackIcon,
8132
+ goBackAction
8125
8133
  }) {
8126
8134
  if (!isOpen) return null;
8127
8135
  const drawerContainerRef = (0, import_react8.useRef)(null);
@@ -8175,7 +8183,10 @@ function Drawer({
8175
8183
  },
8176
8184
  children: [
8177
8185
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DrawerHeaderDiv, { children: [
8178
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderTitle, { children: title }),
8186
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex2, { gap: 8, children: [
8187
+ goBackIcon && goBackIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
8188
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderTitle, { children: title })
8189
+ ] }),
8179
8190
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
8180
8191
  ] }),
8181
8192
  children
@@ -9682,6 +9693,7 @@ var MultiSelect = import_react16.default.forwardRef(
9682
9693
  {
9683
9694
  css: itemStyle,
9684
9695
  onClick: (e) => handleSelectAll(e),
9696
+ type: "button",
9685
9697
  children: [
9686
9698
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: allOptionsSelected ? "checked" : "" }),
9687
9699
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "labelSmall", children: selectedAllText ? selectedAllText : "Selecionar Todos" })
package/dist/index.mjs CHANGED
@@ -8001,6 +8001,12 @@ var DrawerHeaderCloseButton = styled("button", {
8001
8001
  border: "none",
8002
8002
  cursor: "pointer"
8003
8003
  });
8004
+ var GoBackButtonStyled = styled("button", {
8005
+ background: "none",
8006
+ padding: "0",
8007
+ border: "none",
8008
+ cursor: "pointer"
8009
+ });
8004
8010
 
8005
8011
  // src/components/Drawer/index.tsx
8006
8012
  import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
@@ -8010,7 +8016,9 @@ function Drawer({
8010
8016
  width,
8011
8017
  backgroundColor,
8012
8018
  title,
8013
- children
8019
+ children,
8020
+ goBackIcon,
8021
+ goBackAction
8014
8022
  }) {
8015
8023
  if (!isOpen) return null;
8016
8024
  const drawerContainerRef = useRef4(null);
@@ -8064,7 +8072,10 @@ function Drawer({
8064
8072
  },
8065
8073
  children: [
8066
8074
  /* @__PURE__ */ jsxs7(DrawerHeaderDiv, { children: [
8067
- /* @__PURE__ */ jsx16(DrawerHeaderTitle, { children: title }),
8075
+ /* @__PURE__ */ jsxs7(Flex2, { gap: 8, children: [
8076
+ goBackIcon && goBackIcon && /* @__PURE__ */ jsx16(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
8077
+ /* @__PURE__ */ jsx16(DrawerHeaderTitle, { children: title })
8078
+ ] }),
8068
8079
  /* @__PURE__ */ jsx16(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ jsx16(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
8069
8080
  ] }),
8070
8081
  children
@@ -9575,6 +9586,7 @@ var MultiSelect = React9.forwardRef(
9575
9586
  {
9576
9587
  css: itemStyle,
9577
9588
  onClick: (e) => handleSelectAll(e),
9589
+ type: "button",
9578
9590
  children: [
9579
9591
  /* @__PURE__ */ jsx26("div", { className: allOptionsSelected ? "checked" : "" }),
9580
9592
  /* @__PURE__ */ jsx26(Text, { typography: "labelSmall", children: selectedAllText ? selectedAllText : "Selecionar Todos" })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.2.0",
3
+ "version": "12.2.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -7,8 +7,10 @@ import {
7
7
  DrawerHeaderDiv,
8
8
  DrawerHeaderTitle,
9
9
  DrawerHeaderCloseButton,
10
+ GoBackButtonStyled,
10
11
  } from "./styledComponents";
11
12
  import { useOnClickOutside } from "../../hooks/useOnClickOutside";
13
+ import { Flex } from "../Flex";
12
14
 
13
15
  export type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
14
16
  isOpen: boolean;
@@ -17,6 +19,8 @@ export type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
17
19
  backgroundColor?: keyof Colors;
18
20
  title: string;
19
21
  children?: ReactNode;
22
+ goBackIcon?: ReactNode;
23
+ goBackAction: () => void;
20
24
  };
21
25
 
22
26
  export function Drawer({
@@ -26,6 +30,8 @@ export function Drawer({
26
30
  backgroundColor,
27
31
  title,
28
32
  children,
33
+ goBackIcon,
34
+ goBackAction
29
35
  }: DrawerProps) {
30
36
  if (!isOpen) return null;
31
37
  const drawerContainerRef = useRef<HTMLDivElement>(null);
@@ -117,7 +123,10 @@ export function Drawer({
117
123
  }}
118
124
  >
119
125
  <DrawerHeaderDiv>
120
- <DrawerHeaderTitle>{title}</DrawerHeaderTitle>
126
+ <Flex gap={8}>
127
+ {(goBackIcon && goBackIcon) && <GoBackButtonStyled type="button" onClick={goBackAction}>{goBackIcon}</GoBackButtonStyled>}
128
+ <DrawerHeaderTitle>{title}</DrawerHeaderTitle>
129
+ </Flex>
121
130
  <DrawerHeaderCloseButton onClick={onClose}>
122
131
  <Icon size={"xl"} color="$dark600" name="xmark" />
123
132
  </DrawerHeaderCloseButton>
@@ -44,3 +44,9 @@ export const DrawerHeaderCloseButton = styled("button", {
44
44
  border: "none",
45
45
  cursor: "pointer",
46
46
  });
47
+ export const GoBackButtonStyled = styled("button", {
48
+ background: "none",
49
+ padding: "0",
50
+ border: "none",
51
+ cursor: "pointer",
52
+ });
@@ -170,6 +170,7 @@ export const MultiSelect = React.forwardRef<HTMLDivElement, MultiSelectProps>(
170
170
  <ButtonSelectAllStyled
171
171
  css={itemStyle}
172
172
  onClick={(e) => handleSelectAll(e)}
173
+ type="button"
173
174
  >
174
175
  <div className={allOptionsSelected ? "checked" : ""}></div>
175
176
  <Text typography="labelSmall">