@tecsinapse/cortex-react 1.9.40 → 1.9.42-beta.0

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.
@@ -18,6 +18,7 @@ const Carousel = ({ images }) => {
18
18
  return /* @__PURE__ */ React.createElement("div", { className: "overflow-hidden w-fit relative" }, itemsCarousel.length > 1 ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
19
19
  Button.Button,
20
20
  {
21
+ type: "button",
21
22
  "data-testid": "button-carousel-prev",
22
23
  variants: {
23
24
  size: "square",
@@ -29,6 +30,7 @@ const Carousel = ({ images }) => {
29
30
  ), /* @__PURE__ */ React.createElement(
30
31
  Button.Button,
31
32
  {
33
+ type: "button",
32
34
  "data-testid": "button-carousel-next",
33
35
  variants: {
34
36
  size: "square",
@@ -37,6 +37,7 @@ const CarouselItem = ({ item }) => {
37
37
  ), item.button ? /* @__PURE__ */ React.createElement(
38
38
  "a",
39
39
  {
40
+ type: "button",
40
41
  href: item.button.link,
41
42
  target: item.button.target ?? "_self",
42
43
  rel: "noopener noreferrer"
@@ -44,6 +45,7 @@ const CarouselItem = ({ item }) => {
44
45
  /* @__PURE__ */ React.createElement(
45
46
  Button.Button,
46
47
  {
48
+ type: "button",
47
49
  "data-testid": "button-link-carousel",
48
50
  variants: {
49
51
  className: "z-absolute absolute bottom-deca left-[10%]"
@@ -27,7 +27,7 @@ const SelectMultiGroupedOptions = ({
27
27
  const { options: _options, isLoading } = useSelectGroupedOptions.useSelectGroupedOptions({ options });
28
28
  const flattenMap = React.useMemo(
29
29
  () => _options ? Array.from(_options?.values()).flatMap((value) => value) : [],
30
- [options]
30
+ [_options]
31
31
  );
32
32
  return /* @__PURE__ */ React.createElement(
33
33
  context.SelectMultiOptionsContext.Provider,
@@ -23,7 +23,12 @@ class SnackbarSonner {
23
23
  {
24
24
  text: message,
25
25
  variants: { intent: type },
26
- onDismiss: () => sonner.toast.dismiss(t)
26
+ onDismiss: () => {
27
+ sonner.toast.dismiss(t);
28
+ if (options?.onDismiss && typeof options?.onDismiss === "function") {
29
+ options.onDismiss();
30
+ }
31
+ }
27
32
  }
28
33
  );
29
34
  },
@@ -16,6 +16,7 @@ const Carousel = ({ images }) => {
16
16
  return /* @__PURE__ */ React__default.createElement("div", { className: "overflow-hidden w-fit relative" }, itemsCarousel.length > 1 ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
17
17
  Button,
18
18
  {
19
+ type: "button",
19
20
  "data-testid": "button-carousel-prev",
20
21
  variants: {
21
22
  size: "square",
@@ -27,6 +28,7 @@ const Carousel = ({ images }) => {
27
28
  ), /* @__PURE__ */ React__default.createElement(
28
29
  Button,
29
30
  {
31
+ type: "button",
30
32
  "data-testid": "button-carousel-next",
31
33
  variants: {
32
34
  size: "square",
@@ -35,6 +35,7 @@ const CarouselItem = ({ item }) => {
35
35
  ), item.button ? /* @__PURE__ */ React__default.createElement(
36
36
  "a",
37
37
  {
38
+ type: "button",
38
39
  href: item.button.link,
39
40
  target: item.button.target ?? "_self",
40
41
  rel: "noopener noreferrer"
@@ -42,6 +43,7 @@ const CarouselItem = ({ item }) => {
42
43
  /* @__PURE__ */ React__default.createElement(
43
44
  Button,
44
45
  {
46
+ type: "button",
45
47
  "data-testid": "button-link-carousel",
46
48
  variants: {
47
49
  className: "z-absolute absolute bottom-deca left-[10%]"
@@ -25,7 +25,7 @@ const SelectMultiGroupedOptions = ({
25
25
  const { options: _options, isLoading } = useSelectGroupedOptions({ options });
26
26
  const flattenMap = useMemo(
27
27
  () => _options ? Array.from(_options?.values()).flatMap((value) => value) : [],
28
- [options]
28
+ [_options]
29
29
  );
30
30
  return /* @__PURE__ */ React__default.createElement(
31
31
  SelectMultiOptionsContext.Provider,
@@ -21,7 +21,12 @@ class SnackbarSonner {
21
21
  {
22
22
  text: message,
23
23
  variants: { intent: type },
24
- onDismiss: () => toast.dismiss(t)
24
+ onDismiss: () => {
25
+ toast.dismiss(t);
26
+ if (options?.onDismiss && typeof options?.onDismiss === "function") {
27
+ options.onDismiss();
28
+ }
29
+ }
25
30
  }
26
31
  );
27
32
  },
@@ -1,12 +1,12 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { type ExternalToast } from 'sonner';
3
- import { SnackbarSonner } from '../service/SnackbarSonner';
2
+ import { SnackbarSonner } from '../service';
3
+ import { IExternalToast } from '../service/IExternalToast';
4
4
  interface SnackbarProviderProps {
5
5
  snackbar: SnackbarSonner;
6
6
  }
7
7
  export declare const SnackbarProvider: ({ children, options, }: {
8
8
  children: ReactNode;
9
- options?: ExternalToast;
9
+ options?: IExternalToast;
10
10
  }) => React.JSX.Element;
11
11
  export declare const useSnackbar: () => SnackbarProviderProps;
12
12
  export {};
@@ -0,0 +1,4 @@
1
+ import { ExternalToast } from 'sonner';
2
+ export type IExternalToast = Omit<ExternalToast, 'onDismiss'> & {
3
+ onDismiss?: () => void;
4
+ };
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import { ExternalToast } from 'sonner';
3
3
  import { ISnackbar, TypeSnack } from './ISnackbar';
4
- export declare class SnackbarSonner implements ISnackbar<ExternalToast> {
5
- _options?: ExternalToast;
6
- constructor(options?: ExternalToast);
4
+ import { IExternalToast } from './IExternalToast';
5
+ export declare class SnackbarSonner implements ISnackbar<IExternalToast> {
6
+ _options?: IExternalToast;
7
+ constructor(options?: IExternalToast);
7
8
  custom(Component: React.ReactElement, options?: ExternalToast): string | number;
8
- show(type: TypeSnack, message: string, options?: Omit<ExternalToast, 'className' | 'style'>): string | number;
9
+ show(type: TypeSnack, message: string, options?: Omit<IExternalToast, 'className' | 'style'>): string | number;
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tecsinapse/cortex-react",
3
- "version": "1.9.40",
3
+ "version": "1.9.42-beta.0",
4
4
  "description": "React components based in @tecsinapse/cortex-core",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
@@ -48,5 +48,5 @@
48
48
  "react-dom": ">=18.0.0",
49
49
  "tailwind": ">=3.3.0"
50
50
  },
51
- "gitHead": "1842d0748c989af59ed462dea1a68b85230c03af"
51
+ "gitHead": "ade58b0d96e60203c34fe273fb672a7f1afa30b9"
52
52
  }