@agnos-ui/react-bootstrap 0.8.0-next.0 → 0.8.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.
Files changed (37) hide show
  1. package/{accordion-QclyKh8E.cjs → accordion-CKX3QpIN.cjs} +3 -1
  2. package/{accordion-GX854ooE.js → accordion-CrXiNNLE.js} +4 -2
  3. package/carousel-B8b91cHo.cjs +72 -0
  4. package/carousel-CB4uoAm0.js +73 -0
  5. package/{collapse-UMbDs6Gh.cjs → collapse-BQNW5NFj.cjs} +2 -1
  6. package/{collapse-BOXBa8_8.js → collapse-DojQXsLN.js} +3 -2
  7. package/components/accordion/index.cjs +1 -1
  8. package/components/accordion/index.js +1 -1
  9. package/components/carousel/carousel.d.ts +39 -0
  10. package/components/carousel/carousel.gen.d.ts +358 -0
  11. package/components/carousel/index.cjs +8 -0
  12. package/components/carousel/index.d.ts +2 -0
  13. package/components/carousel/index.js +8 -0
  14. package/components/collapse/index.cjs +1 -1
  15. package/components/collapse/index.js +1 -1
  16. package/components/select/index.js +1 -1
  17. package/components/slider/index.cjs +1 -1
  18. package/components/slider/index.js +1 -1
  19. package/components/toast/index.cjs +10 -5
  20. package/components/toast/index.d.ts +1 -0
  21. package/components/toast/index.js +7 -2
  22. package/components/toast/toast.gen.d.ts +85 -0
  23. package/components/toast/toasterProvider.d.ts +34 -0
  24. package/config.gen.d.ts +5 -0
  25. package/generated/types.cjs +7 -0
  26. package/generated/types.d.ts +1 -1
  27. package/generated/types.js +1 -0
  28. package/index.cjs +26 -8
  29. package/index.d.ts +1 -0
  30. package/index.js +52 -40
  31. package/package.json +5 -3
  32. package/{select-C2jCf6jT.js → select-ClQGKBMF.js} +1 -1
  33. package/{slider-DyvRcMCK.cjs → slider-CkKKSyai.cjs} +15 -39
  34. package/{slider-vFEkaZP-.js → slider-ZmbENVpb.js} +16 -40
  35. package/{toast-BUHjCme7.js → toasterProvider-DO_5lfVp.js} +61 -3
  36. package/{toast-CkwIDuRg.cjs → toasterProvider-glQ29Go3.cjs} +60 -2
  37. package/types.d.ts +2 -0
@@ -1,11 +1,14 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-headless/utils/directive";
3
+ import { useToaster as useToaster$1, ToasterProvider as ToasterProvider$1 } from "@agnos-ui/react-headless/components/toast";
4
+ import { getToastDefaultConfig, createToast, toastPositions, defaultToasterProps } from "@agnos-ui/core-bootstrap/components/toast";
2
5
  import { Slot } from "@agnos-ui/react-headless/slot";
3
- import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
4
6
  import { useImperativeHandle } from "react";
5
7
  import { useWidgetWithConfig } from "./generated/config.js";
6
- import { getToastDefaultConfig, createToast } from "@agnos-ui/core-bootstrap/components/toast";
7
8
  const export_getToastDefaultConfig = getToastDefaultConfig;
8
9
  const export_createToast = createToast;
10
+ const export_toastPositions = toastPositions;
11
+ const export_defaultToasterProps = defaultToasterProps;
9
12
  const ToastHeaderContent = (slotContext) => /* @__PURE__ */ jsx("button", { ...useDirectives([classDirective, "btn-close me-0 ms-auto"], slotContext.directives.closeButtonDirective) });
10
13
  const ToastHeader = (slotContext) => /* @__PURE__ */ jsxs("div", { className: "toast-header", children: [
11
14
  /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.header, props: slotContext }),
@@ -37,9 +40,64 @@ function Toast(props) {
37
40
  useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
38
41
  return /* @__PURE__ */ jsx(Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsx(ToastElement, { ...widgetContext }) });
39
42
  }
43
+ const ToastToaster = ({
44
+ id,
45
+ className,
46
+ visible,
47
+ structure,
48
+ children,
49
+ header,
50
+ dismissible,
51
+ ariaCloseButtonLabel,
52
+ animated,
53
+ animatedOnInit,
54
+ onShown,
55
+ onHidden,
56
+ onVisibleChange,
57
+ transition,
58
+ toaster
59
+ }) => /* @__PURE__ */ jsx("div", { ...useDirective(toaster.eventsDirective, id), children: /* @__PURE__ */ jsx(
60
+ Toast,
61
+ {
62
+ animated,
63
+ animatedOnInit,
64
+ autoHide: false,
65
+ className,
66
+ dismissible: dismissible ?? toaster.options.dismissible,
67
+ ariaCloseButtonLabel,
68
+ structure,
69
+ header,
70
+ onShown,
71
+ onHidden: () => {
72
+ toaster.removeToast(id);
73
+ onHidden == null ? void 0 : onHidden();
74
+ },
75
+ onVisibleChange,
76
+ visible,
77
+ transition,
78
+ children
79
+ }
80
+ ) });
81
+ function ToasterContainer() {
82
+ const toaster = useToaster();
83
+ return /* @__PURE__ */ jsx("div", { className: "au-toaster", "aria-live": "polite", "aria-atomic": "true", children: /* @__PURE__ */ jsxs("div", { className: `au-toaster-container toast-container ${export_toastPositions[toaster.options.position]}`, children: [
84
+ toaster.options.closeAll && toaster.toasts.length > 1 && /* @__PURE__ */ jsx("div", { className: "d-flex position-relative align-items-end pb-2", children: /* @__PURE__ */ jsx("button", { className: "au-toaster-closeAll btn btn-secondary me-0 ms-auto pe-auto", onClick: () => toaster.closeAll(), children: toaster.options.closeAllLabel || "Close all" }) }),
85
+ toaster.toasts.map(({ id, props }) => /* @__PURE__ */ jsx(ToastToaster, { id, ...props, toaster }, id))
86
+ ] }) });
87
+ }
88
+ const ToasterProvider = ({ options, children }) => /* @__PURE__ */ jsxs(ToasterProvider$1, { options, children: [
89
+ children,
90
+ /* @__PURE__ */ jsx(ToasterContainer, {})
91
+ ] });
92
+ const useToaster = () => useToaster$1();
40
93
  export {
41
94
  ToastDefaultSlotStructure as T,
42
95
  Toast as a,
43
96
  export_createToast as b,
44
- export_getToastDefaultConfig as e
97
+ export_toastPositions as c,
98
+ export_defaultToasterProps as d,
99
+ export_getToastDefaultConfig as e,
100
+ ToasterContainer as f,
101
+ ToasterProvider as g,
102
+ useToaster as u
45
103
  };
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
- const slot = require("@agnos-ui/react-headless/slot");
4
3
  const directive = require("@agnos-ui/react-headless/utils/directive");
4
+ const toast$1 = require("@agnos-ui/react-headless/components/toast");
5
+ const toast = require("@agnos-ui/core-bootstrap/components/toast");
6
+ const slot = require("@agnos-ui/react-headless/slot");
5
7
  const React = require("react");
6
8
  const generated_config = require("./generated/config.cjs");
7
- const toast = require("@agnos-ui/core-bootstrap/components/toast");
8
9
  const export_getToastDefaultConfig = toast.getToastDefaultConfig;
9
10
  const export_createToast = toast.createToast;
11
+ const export_toastPositions = toast.toastPositions;
12
+ const export_defaultToasterProps = toast.defaultToasterProps;
10
13
  const ToastHeaderContent = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirectives([directive.classDirective, "btn-close me-0 ms-auto"], slotContext.directives.closeButtonDirective) });
11
14
  const ToastHeader = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "toast-header", children: [
12
15
  /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.header, props: slotContext }),
@@ -38,7 +41,62 @@ function Toast(props) {
38
41
  React.useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
39
42
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsxRuntime.jsx(ToastElement, { ...widgetContext }) });
40
43
  }
44
+ const ToastToaster = ({
45
+ id,
46
+ className,
47
+ visible,
48
+ structure,
49
+ children,
50
+ header,
51
+ dismissible,
52
+ ariaCloseButtonLabel,
53
+ animated,
54
+ animatedOnInit,
55
+ onShown,
56
+ onHidden,
57
+ onVisibleChange,
58
+ transition,
59
+ toaster
60
+ }) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(toaster.eventsDirective, id), children: /* @__PURE__ */ jsxRuntime.jsx(
61
+ Toast,
62
+ {
63
+ animated,
64
+ animatedOnInit,
65
+ autoHide: false,
66
+ className,
67
+ dismissible: dismissible ?? toaster.options.dismissible,
68
+ ariaCloseButtonLabel,
69
+ structure,
70
+ header,
71
+ onShown,
72
+ onHidden: () => {
73
+ toaster.removeToast(id);
74
+ onHidden == null ? void 0 : onHidden();
75
+ },
76
+ onVisibleChange,
77
+ visible,
78
+ transition,
79
+ children
80
+ }
81
+ ) });
82
+ function ToasterContainer() {
83
+ const toaster = useToaster();
84
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "au-toaster", "aria-live": "polite", "aria-atomic": "true", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `au-toaster-container toast-container ${export_toastPositions[toaster.options.position]}`, children: [
85
+ toaster.options.closeAll && toaster.toasts.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "d-flex position-relative align-items-end pb-2", children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: "au-toaster-closeAll btn btn-secondary me-0 ms-auto pe-auto", onClick: () => toaster.closeAll(), children: toaster.options.closeAllLabel || "Close all" }) }),
86
+ toaster.toasts.map(({ id, props }) => /* @__PURE__ */ jsxRuntime.jsx(ToastToaster, { id, ...props, toaster }, id))
87
+ ] }) });
88
+ }
89
+ const ToasterProvider = ({ options, children }) => /* @__PURE__ */ jsxRuntime.jsxs(toast$1.ToasterProvider, { options, children: [
90
+ children,
91
+ /* @__PURE__ */ jsxRuntime.jsx(ToasterContainer, {})
92
+ ] });
93
+ const useToaster = () => toast$1.useToaster();
41
94
  exports.Toast = Toast;
42
95
  exports.ToastDefaultSlotStructure = ToastDefaultSlotStructure;
96
+ exports.ToasterContainer = ToasterContainer;
97
+ exports.ToasterProvider = ToasterProvider;
43
98
  exports.export_createToast = export_createToast;
99
+ exports.export_defaultToasterProps = export_defaultToasterProps;
44
100
  exports.export_getToastDefaultConfig = export_getToastDefaultConfig;
101
+ exports.export_toastPositions = export_toastPositions;
102
+ exports.useToaster = useToaster;
package/types.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from '@agnos-ui/react-headless/types';
2
+ export * from '@agnos-ui/core-bootstrap/types';