@agnos-ui/react-bootstrap 0.7.0-next.0 → 0.7.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.
Files changed (60) hide show
  1. package/{accordion-D3SZgVk6.js → accordion-GX854ooE.js} +18 -22
  2. package/{accordion-01ch6GZW.cjs → accordion-QclyKh8E.cjs} +17 -21
  3. package/{alert-DGvp2r3W.cjs → alert-BGVw_vsM.cjs} +4 -4
  4. package/{alert-CTTuh9t9.js → alert-BM4ImSpO.js} +5 -5
  5. package/{collapse-DNwn7xgF.js → collapse-BOXBa8_8.js} +6 -8
  6. package/{collapse-Dodvr8dn.cjs → collapse-UMbDs6Gh.cjs} +5 -7
  7. package/components/accordion/accordion.d.ts +9 -5
  8. package/components/accordion/index.cjs +1 -1
  9. package/components/accordion/index.js +1 -1
  10. package/components/alert/alert.d.ts +5 -3
  11. package/components/alert/index.cjs +1 -1
  12. package/components/alert/index.js +1 -1
  13. package/components/collapse/collapse.d.ts +5 -3
  14. package/components/collapse/index.cjs +1 -1
  15. package/components/collapse/index.js +1 -1
  16. package/components/modal/index.cjs +1 -1
  17. package/components/modal/index.js +1 -1
  18. package/components/modal/modal.d.ts +6 -4
  19. package/components/pagination/index.cjs +1 -1
  20. package/components/pagination/index.js +1 -1
  21. package/components/pagination/pagination.d.ts +6 -2
  22. package/components/progressbar/index.cjs +1 -1
  23. package/components/progressbar/index.js +1 -1
  24. package/components/rating/index.cjs +1 -1
  25. package/components/rating/index.js +1 -1
  26. package/components/rating/rating.d.ts +5 -2
  27. package/components/select/index.cjs +1 -1
  28. package/components/select/index.js +1 -1
  29. package/components/select/select.d.ts +5 -2
  30. package/components/slider/index.cjs +1 -1
  31. package/components/slider/index.js +1 -1
  32. package/components/slider/slider.gen.d.ts +25 -10
  33. package/components/toast/index.cjs +1 -1
  34. package/components/toast/index.js +1 -1
  35. package/components/toast/toast.d.ts +5 -3
  36. package/components/tree/index.cjs +1 -1
  37. package/components/tree/index.js +1 -1
  38. package/components/tree/tree.gen.d.ts +1 -1
  39. package/config.d.ts +2 -2
  40. package/generated/config.cjs +2 -2
  41. package/generated/config.js +3 -3
  42. package/index.cjs +12 -12
  43. package/index.js +14 -14
  44. package/{modal-_OcXelvY.cjs → modal-DQLOz7TE.cjs} +5 -5
  45. package/{modal-DuCmvYiX.js → modal-apFubipB.js} +6 -6
  46. package/package.json +6 -6
  47. package/{pagination-5jlJWfFj.js → pagination-B1Ho_-r4.js} +6 -4
  48. package/{pagination-b4pKj3Kx.cjs → pagination-Bq4Hvm1j.cjs} +5 -4
  49. package/{progressbar-DKFR5epE.js → progressbar-Ck20N_ee.js} +2 -2
  50. package/{progressbar-JO1ey9mx.cjs → progressbar-CnbqCXqH.cjs} +2 -2
  51. package/{rating-eI8T0zvS.cjs → rating-BaZTCQi1.cjs} +4 -3
  52. package/{rating-CTfRQGGu.js → rating-DziC4Tsh.js} +6 -5
  53. package/{select-BriGqe3k.js → select-C2jCf6jT.js} +5 -3
  54. package/{select-XHUAqTDw.cjs → select-DHNspXXB.cjs} +5 -3
  55. package/{slider-BUQne5aJ.cjs → slider-D0knY75x.cjs} +1 -1
  56. package/{slider--K7ri_0l.js → slider-UQlY3PHn.js} +1 -1
  57. package/{toast-CS1mMdhx.js → toast-BUHjCme7.js} +5 -5
  58. package/{toast-Vv1dxnuA.cjs → toast-CkwIDuRg.cjs} +4 -4
  59. package/{tree-CrXS0sFt.js → tree-BflF5hyD.js} +2 -2
  60. package/{tree-CCmlpEPq.cjs → tree-DT261j-0.cjs} +2 -2
@@ -1,4 +1,4 @@
1
- import type { ForwardRefExoticComponent, RefAttributes } from 'react';
1
+ import { type Ref } from 'react';
2
2
  import type { ToastApi, ToastContext, ToastProps } from './toast.gen';
3
3
  /**
4
4
  * Renders the default slot structure for a Toast component.
@@ -15,8 +15,10 @@ export declare const ToastDefaultSlotStructure: (slotContext: ToastContext) => i
15
15
  * to expose the widget's API through the forwarded ref.
16
16
  *
17
17
  * @param props - Partial properties of `ToastProps` to configure the toast widget.
18
- * @param ref - Ref to expose the Toast API.
18
+ * @param props.ref - Ref to expose the Toast API.
19
19
  *
20
20
  * @returns A JSX element that conditionally renders the `ToastElement` based on the widget's state.
21
21
  */
22
- export declare const Toast: ForwardRefExoticComponent<Partial<ToastProps> & RefAttributes<ToastApi>>;
22
+ export declare function Toast(props: Partial<ToastProps> & {
23
+ ref?: Ref<ToastApi>;
24
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const tree = require("../../tree-CCmlpEPq.cjs");
3
+ const tree = require("../../tree-DT261j-0.cjs");
4
4
  exports.DefaultTreeSlotItem = tree.DefaultTreeSlotItem;
5
5
  exports.DefaultTreeSlotItemContent = tree.DefaultTreeSlotItemContent;
6
6
  exports.DefaultTreeSlotItemToggle = tree.DefaultTreeSlotItemToggle;
@@ -1,4 +1,4 @@
1
- import { b, a, D, c, T, d, e } from "../../tree-CrXS0sFt.js";
1
+ import { b, a, D, c, T, d, e } from "../../tree-BflF5hyD.js";
2
2
  export {
3
3
  b as DefaultTreeSlotItem,
4
4
  a as DefaultTreeSlotItemContent,
@@ -91,7 +91,7 @@ export interface TreeProps {
91
91
  * (node: HTMLElement) => node.querySelectorAll('button')
92
92
  * ```
93
93
  */
94
- navSelector(node: HTMLElement): NodeListOf<HTMLButtonElement>;
94
+ navSelector(node: HTMLElement): NodeListOf<HTMLElement>;
95
95
  /**
96
96
  * Return the value for the 'aria-label' attribute of the toggle
97
97
  * @param label - tree item label
package/config.d.ts CHANGED
@@ -11,9 +11,9 @@ type DefaultConfigInput = Partial2Levels<WidgetsConfig> & {
11
11
  };
12
12
  /**
13
13
  * Destructures and exports the following from `widgetFactories`:
14
- * - `widgetsConfigContext`: The context for widget configurations.
14
+ * - `WidgetsConfigContext`: The context for widget configurations.
15
15
  * - `WidgetsDefaultConfig`: The default configuration for widgets.
16
16
  * - `useWidgetContext`: A hook to use the widget context.
17
17
  * - `useWidgetWithConfig`: A hook to use a widget with a specific configuration.
18
18
  */
19
- export declare const widgetsConfigContext: Context<WidgetsConfigStore<WidgetsConfig> | undefined>, WidgetsDefaultConfig: ({ children, adaptParentConfig, ...props }: DefaultConfigInput) => import("react/jsx-runtime").JSX.Element, useWidgetContext: <Props extends object>(widgetName: keyof BootstrapWidgetsConfig | null, defaultConfig?: Partial<Props>) => import("@amadeus-it-group/tansu").ReadableSignal<Partial<Props>>, useWidgetWithConfig: <W extends Widget<object, object, object, object>>(factory: WidgetFactory<W>, props: Partial<WidgetProps<W>> | undefined, widgetName: keyof BootstrapWidgetsConfig | null, defaultProps?: Partial<WidgetProps<W>>) => WidgetSlotContext<W>;
19
+ export declare const WidgetsConfigContext: Context<WidgetsConfigStore<WidgetsConfig> | undefined>, WidgetsDefaultConfig: ({ children, adaptParentConfig, ...props }: DefaultConfigInput) => import("react/jsx-runtime").JSX.Element, useWidgetContext: <Props extends object>(widgetName: keyof BootstrapWidgetsConfig | null, defaultConfig?: Partial<Props>) => import("@amadeus-it-group/tansu").ReadableSignal<Partial<Props>>, useWidgetWithConfig: <W extends Widget<object, object, object, object>>(factory: WidgetFactory<W>, props: Partial<WidgetProps<W>> | undefined, widgetName: keyof BootstrapWidgetsConfig | null, defaultProps?: Partial<WidgetProps<W>>) => WidgetSlotContext<W>;
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const config = require("@agnos-ui/react-headless/config");
4
4
  const widgetFactories = config.widgetsConfigFactory();
5
- const { widgetsConfigContext, WidgetsDefaultConfig, useWidgetContext, useWidgetWithConfig } = widgetFactories;
5
+ const { WidgetsConfigContext, WidgetsDefaultConfig, useWidgetContext, useWidgetWithConfig } = widgetFactories;
6
+ exports.WidgetsConfigContext = WidgetsConfigContext;
6
7
  exports.WidgetsDefaultConfig = WidgetsDefaultConfig;
7
8
  exports.useWidgetContext = useWidgetContext;
8
9
  exports.useWidgetWithConfig = useWidgetWithConfig;
9
- exports.widgetsConfigContext = widgetsConfigContext;
10
10
  Object.keys(config).forEach((k) => {
11
11
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
12
12
  enumerable: true,
@@ -1,10 +1,10 @@
1
1
  import { widgetsConfigFactory } from "@agnos-ui/react-headless/config";
2
2
  export * from "@agnos-ui/react-headless/config";
3
3
  const widgetFactories = widgetsConfigFactory();
4
- const { widgetsConfigContext, WidgetsDefaultConfig, useWidgetContext, useWidgetWithConfig } = widgetFactories;
4
+ const { WidgetsConfigContext, WidgetsDefaultConfig, useWidgetContext, useWidgetWithConfig } = widgetFactories;
5
5
  export {
6
+ WidgetsConfigContext,
6
7
  WidgetsDefaultConfig,
7
8
  useWidgetContext,
8
- useWidgetWithConfig,
9
- widgetsConfigContext
9
+ useWidgetWithConfig
10
10
  };
package/index.cjs CHANGED
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const accordion = require("./accordion-01ch6GZW.cjs");
4
- const alert = require("./alert-DGvp2r3W.cjs");
5
- const collapse = require("./collapse-Dodvr8dn.cjs");
6
- const modal = require("./modal-_OcXelvY.cjs");
7
- const pagination = require("./pagination-b4pKj3Kx.cjs");
8
- const progressbar = require("./progressbar-JO1ey9mx.cjs");
9
- const rating = require("./rating-eI8T0zvS.cjs");
10
- const select = require("./select-XHUAqTDw.cjs");
11
- const slider = require("./slider-BUQne5aJ.cjs");
12
- const toast = require("./toast-Vv1dxnuA.cjs");
13
- const tree = require("./tree-CCmlpEPq.cjs");
3
+ const accordion = require("./accordion-QclyKh8E.cjs");
4
+ const alert = require("./alert-BGVw_vsM.cjs");
5
+ const collapse = require("./collapse-UMbDs6Gh.cjs");
6
+ const modal = require("./modal-DQLOz7TE.cjs");
7
+ const pagination = require("./pagination-Bq4Hvm1j.cjs");
8
+ const progressbar = require("./progressbar-CnbqCXqH.cjs");
9
+ const rating = require("./rating-BaZTCQi1.cjs");
10
+ const select = require("./select-DHNspXXB.cjs");
11
+ const slider = require("./slider-D0knY75x.cjs");
12
+ const toast = require("./toast-CkwIDuRg.cjs");
13
+ const tree = require("./tree-DT261j-0.cjs");
14
14
  const types = require("@agnos-ui/react-headless/types");
15
15
  const slot = require("@agnos-ui/react-headless/slot");
16
16
  const config = require("@agnos-ui/react-headless/config");
@@ -90,10 +90,10 @@ exports.DefaultTreeSlotStructure = tree.DefaultTreeSlotStructure;
90
90
  exports.Tree = tree.Tree;
91
91
  exports.createTree = tree.export_createTree;
92
92
  exports.getTreeDefaultConfig = tree.export_getTreeDefaultConfig;
93
+ exports.WidgetsConfigContext = generated_config.WidgetsConfigContext;
93
94
  exports.WidgetsDefaultConfig = generated_config.WidgetsDefaultConfig;
94
95
  exports.useWidgetContext = generated_config.useWidgetContext;
95
96
  exports.useWidgetWithConfig = generated_config.useWidgetWithConfig;
96
- exports.widgetsConfigContext = generated_config.widgetsConfigContext;
97
97
  Object.keys(types).forEach((k) => {
98
98
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
99
99
  enumerable: true,
package/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { b, a, A, d, c, f, e } from "./accordion-D3SZgVk6.js";
2
- import { a as a2, A as A2, b as b2, e as e2 } from "./alert-CTTuh9t9.js";
3
- import { C, a as a3, e as e3 } from "./collapse-DNwn7xgF.js";
4
- import { b as b3, M, a as a4, c as c2, e as e4, f as f2, d as d2, o } from "./modal-DuCmvYiX.js";
5
- import { N, P, c as c3, a as a5, b as b4, d as d3, e as e5 } from "./pagination-5jlJWfFj.js";
6
- import { a as a6, P as P2, b as b5, e as e6 } from "./progressbar-DKFR5epE.js";
7
- import { R, a as a7, e as e7 } from "./rating-CTfRQGGu.js";
8
- import { S, a as a8, e as e8 } from "./select-BriGqe3k.js";
9
- import { b as b6, S as S2, a as a9, c as c4, e as e9 } from "./slider--K7ri_0l.js";
10
- import { a as a10, T, b as b7, e as e10 } from "./toast-CS1mMdhx.js";
11
- import { b as b8, a as a11, D, c as c5, T as T2, d as d4, e as e11 } from "./tree-CrXS0sFt.js";
1
+ import { b, a, A, d, c, f, e } from "./accordion-GX854ooE.js";
2
+ import { a as a2, A as A2, b as b2, e as e2 } from "./alert-BM4ImSpO.js";
3
+ import { C, a as a3, e as e3 } from "./collapse-BOXBa8_8.js";
4
+ import { b as b3, M, a as a4, c as c2, e as e4, f as f2, d as d2, o } from "./modal-apFubipB.js";
5
+ import { N, P, c as c3, a as a5, b as b4, d as d3, e as e5 } from "./pagination-B1Ho_-r4.js";
6
+ import { a as a6, P as P2, b as b5, e as e6 } from "./progressbar-Ck20N_ee.js";
7
+ import { R, a as a7, e as e7 } from "./rating-DziC4Tsh.js";
8
+ import { S, a as a8, e as e8 } from "./select-C2jCf6jT.js";
9
+ import { b as b6, S as S2, a as a9, c as c4, e as e9 } from "./slider-UQlY3PHn.js";
10
+ import { a as a10, T, b as b7, e as e10 } from "./toast-BUHjCme7.js";
11
+ import { b as b8, a as a11, D, c as c5, T as T2, d as d4, e as e11 } from "./tree-BflF5hyD.js";
12
12
  export * from "@agnos-ui/react-headless/types";
13
13
  export * from "@agnos-ui/react-headless/slot";
14
14
  export * from "@agnos-ui/react-headless/config";
15
- import { WidgetsDefaultConfig, useWidgetContext, useWidgetWithConfig, widgetsConfigContext } from "./generated/config.js";
15
+ import { WidgetsConfigContext, WidgetsDefaultConfig, useWidgetContext, useWidgetWithConfig } from "./generated/config.js";
16
16
  export * from "@agnos-ui/react-headless/utils/widget";
17
17
  export * from "@agnos-ui/react-headless/utils/stores";
18
18
  export * from "@agnos-ui/react-headless/utils/portal";
@@ -62,6 +62,7 @@ export {
62
62
  a10 as Toast,
63
63
  T as ToastDefaultSlotStructure,
64
64
  T2 as Tree,
65
+ WidgetsConfigContext,
65
66
  WidgetsDefaultConfig,
66
67
  d as createAccordion,
67
68
  c as createAccordionItem,
@@ -91,6 +92,5 @@ export {
91
92
  d2 as modalOutsideClick,
92
93
  o as openModal,
93
94
  useWidgetContext,
94
- useWidgetWithConfig,
95
- widgetsConfigContext
95
+ useWidgetWithConfig
96
96
  };
@@ -3,7 +3,7 @@ const jsxRuntime = require("react/jsx-runtime");
3
3
  const slot = require("@agnos-ui/react-headless/slot");
4
4
  const directive = require("@agnos-ui/react-headless/utils/directive");
5
5
  const portal = require("@agnos-ui/react-headless/utils/portal");
6
- const classNames = require("classnames");
6
+ const clsx = require("clsx");
7
7
  const React = require("react");
8
8
  const ReactDOM = require("react-dom/client");
9
9
  const generated_config = require("./generated/config.cjs");
@@ -25,19 +25,19 @@ const ModalDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.js
25
25
  const BackdropElement = ({ directives }) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "modal-backdrop"], directives.backdropDirective) });
26
26
  const ModalElement = (slotContext) => {
27
27
  const { fullscreen } = slotContext.state;
28
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "modal d-block"], slotContext.directives.modalDirective), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames("modal-dialog", { "modal-fullscreen": fullscreen }), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-content", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.structure, props: slotContext }) }) }) });
28
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "modal d-block"], slotContext.directives.modalDirective), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx("modal-dialog", { "modal-fullscreen": fullscreen }), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-content", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.structure, props: slotContext }) }) }) });
29
29
  };
30
- const Modal = React.forwardRef(function Modal2(props, ref) {
30
+ function Modal(props) {
31
31
  const widgetContext = generated_config.useWidgetWithConfig(export_createModal, props, "modal", {
32
32
  header: ModalDefaultSlotHeader,
33
33
  structure: ModalDefaultSlotStructure
34
34
  });
35
- React.useImperativeHandle(ref, () => widgetContext.api, [widgetContext.api]);
35
+ React.useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
36
36
  return /* @__PURE__ */ jsxRuntime.jsxs(portal.Portal, { container: widgetContext.state.container, children: [
37
37
  !widgetContext.state.backdropHidden && /* @__PURE__ */ jsxRuntime.jsx(BackdropElement, { ...widgetContext }),
38
38
  !widgetContext.state.hidden && /* @__PURE__ */ jsxRuntime.jsx(ModalElement, { ...widgetContext })
39
39
  ] });
40
- });
40
+ }
41
41
  async function openModal(options) {
42
42
  const root = ReactDOM.createRoot(document.createElement("div"));
43
43
  try {
@@ -2,8 +2,8 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
3
  import { useDirective, useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
4
4
  import { Portal } from "@agnos-ui/react-headless/utils/portal";
5
- import classNames from "classnames";
6
- import { forwardRef, useImperativeHandle } from "react";
5
+ import clsx from "clsx";
6
+ import { useImperativeHandle } from "react";
7
7
  import ReactDOM from "react-dom/client";
8
8
  import { useWidgetWithConfig } from "./generated/config.js";
9
9
  import { getModalDefaultConfig, createModal, modalOutsideClick, modalCloseButtonClick } from "@agnos-ui/core-bootstrap/components/modal";
@@ -24,19 +24,19 @@ const ModalDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment
24
24
  const BackdropElement = ({ directives }) => /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "modal-backdrop"], directives.backdropDirective) });
25
25
  const ModalElement = (slotContext) => {
26
26
  const { fullscreen } = slotContext.state;
27
- return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "modal d-block"], slotContext.directives.modalDirective), children: /* @__PURE__ */ jsx("div", { className: classNames("modal-dialog", { "modal-fullscreen": fullscreen }), children: /* @__PURE__ */ jsx("div", { className: "modal-content", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.structure, props: slotContext }) }) }) });
27
+ return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "modal d-block"], slotContext.directives.modalDirective), children: /* @__PURE__ */ jsx("div", { className: clsx("modal-dialog", { "modal-fullscreen": fullscreen }), children: /* @__PURE__ */ jsx("div", { className: "modal-content", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.structure, props: slotContext }) }) }) });
28
28
  };
29
- const Modal = forwardRef(function Modal2(props, ref) {
29
+ function Modal(props) {
30
30
  const widgetContext = useWidgetWithConfig(export_createModal, props, "modal", {
31
31
  header: ModalDefaultSlotHeader,
32
32
  structure: ModalDefaultSlotStructure
33
33
  });
34
- useImperativeHandle(ref, () => widgetContext.api, [widgetContext.api]);
34
+ useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
35
35
  return /* @__PURE__ */ jsxs(Portal, { container: widgetContext.state.container, children: [
36
36
  !widgetContext.state.backdropHidden && /* @__PURE__ */ jsx(BackdropElement, { ...widgetContext }),
37
37
  !widgetContext.state.hidden && /* @__PURE__ */ jsx(ModalElement, { ...widgetContext })
38
38
  ] });
39
- });
39
+ }
40
40
  async function openModal(options) {
41
41
  const root = ReactDOM.createRoot(document.createElement("div"));
42
42
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agnos-ui/react-bootstrap",
3
3
  "description": "Bootstrap-based component library for React.",
4
- "version": "0.7.0-next.0",
4
+ "version": "0.7.1",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",
7
7
  "module": "./index.js",
@@ -49,14 +49,14 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@agnos-ui/core-bootstrap": "0.7.0-next.0",
53
- "@agnos-ui/react-headless": "0.7.0-next.0",
54
- "classnames": "^2.5.1"
52
+ "@agnos-ui/core-bootstrap": "0.7.1",
53
+ "@agnos-ui/react-headless": "0.7.1",
54
+ "clsx": "^2.1.1"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@amadeus-it-group/tansu": "^2.0.0",
58
- "react": "^18.3.1",
59
- "react-dom": "^18.3.1"
58
+ "react": "^19.0.0",
59
+ "react-dom": "^19.0.0"
60
60
  },
61
61
  "sideEffects": false,
62
62
  "homepage": "https://www.agnosui.dev/latest/",
@@ -1,13 +1,14 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
- import classNames from "classnames";
3
+ import clsx from "clsx";
4
4
  import { useWidgetWithConfig } from "./generated/config.js";
5
5
  import * as React from "react";
6
+ import { useImperativeHandle } from "react";
6
7
  import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
7
8
  import { getPaginationDefaultConfig, createPagination } from "@agnos-ui/core-bootstrap/components/pagination";
8
9
  const PageItem = React.forwardRef(
9
10
  ({ disabled, active, activeLabel, className, children, directive, page }, ref) => {
10
- return /* @__PURE__ */ jsx("li", { ref, className: classNames("page-item", { active, disabled }), children: /* @__PURE__ */ jsxs("a", { ...useDirectives([directive, { page }], [classDirective, classNames("page-link", className)]), children: [
11
+ return /* @__PURE__ */ jsx("li", { ref, className: clsx("page-item", { active, disabled }), children: /* @__PURE__ */ jsxs("a", { ...useDirectives([directive, { page }], [classDirective, ["page-link", className]]), children: [
11
12
  children,
12
13
  active && activeLabel && /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: activeLabel })
13
14
  ] }) });
@@ -15,7 +16,7 @@ const PageItem = React.forwardRef(
15
16
  );
16
17
  PageItem.displayName = "PageItem";
17
18
  const NavButton = React.forwardRef(({ disabled, className, children, directive }, ref) => {
18
- return /* @__PURE__ */ jsx("li", { ref, className: classNames("page-item", { disabled }), children: /* @__PURE__ */ jsx("a", { ...useDirectives(directive, [classDirective, classNames("page-link", className)]), children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children }) }) });
19
+ return /* @__PURE__ */ jsx("li", { ref, className: clsx("page-item", { disabled }), children: /* @__PURE__ */ jsx("a", { ...useDirectives(directive, [classDirective, ["page-link", className]]), children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children }) }) });
19
20
  });
20
21
  NavButton.displayName = "NavButton";
21
22
  const export_getPaginationDefaultConfig = getPaginationDefaultConfig;
@@ -75,7 +76,7 @@ const PaginationDefaultSlotStructure = (slotContext) => {
75
76
  );
76
77
  }
77
78
  return /* @__PURE__ */ jsxs(Fragment, { children: [
78
- /* @__PURE__ */ jsxs("ul", { className: classNames("au-pagination", "pagination", { [`pagination-${state.size}`]: !!state.size }, state.className), children: [
79
+ /* @__PURE__ */ jsxs("ul", { className: clsx("au-pagination", "pagination", { [`pagination-${state.size}`]: !!state.size }, state.className), children: [
79
80
  ItemsBefore,
80
81
  /* @__PURE__ */ jsx(Slot, { slotContent: state.pagesDisplay, props: slotContext }),
81
82
  ItemsAfter
@@ -88,6 +89,7 @@ function Pagination(props) {
88
89
  pagesDisplay: PaginationDefaultSlotPages,
89
90
  structure: PaginationDefaultSlotStructure
90
91
  });
92
+ useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
91
93
  return /* @__PURE__ */ jsx("nav", { "aria-label": widgetContext.state.ariaLabel, children: /* @__PURE__ */ jsx(Slot, { slotContent: widgetContext.state.structure, props: widgetContext }) });
92
94
  }
93
95
  export {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const slot = require("@agnos-ui/react-headless/slot");
4
- const classNames = require("classnames");
4
+ const clsx = require("clsx");
5
5
  const generated_config = require("./generated/config.cjs");
6
6
  const React = require("react");
7
7
  const directive = require("@agnos-ui/react-headless/utils/directive");
@@ -25,7 +25,7 @@ function _interopNamespaceDefault(e) {
25
25
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
26
26
  const PageItem = React__namespace.forwardRef(
27
27
  ({ disabled, active, activeLabel, className, children, directive: directive$1, page }, ref) => {
28
- return /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: classNames("page-item", { active, disabled }), children: /* @__PURE__ */ jsxRuntime.jsxs("a", { ...directive.useDirectives([directive$1, { page }], [directive.classDirective, classNames("page-link", className)]), children: [
28
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: clsx("page-item", { active, disabled }), children: /* @__PURE__ */ jsxRuntime.jsxs("a", { ...directive.useDirectives([directive$1, { page }], [directive.classDirective, ["page-link", className]]), children: [
29
29
  children,
30
30
  active && activeLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "visually-hidden", children: activeLabel })
31
31
  ] }) });
@@ -33,7 +33,7 @@ const PageItem = React__namespace.forwardRef(
33
33
  );
34
34
  PageItem.displayName = "PageItem";
35
35
  const NavButton = React__namespace.forwardRef(({ disabled, className, children, directive: directive$1 }, ref) => {
36
- return /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: classNames("page-item", { disabled }), children: /* @__PURE__ */ jsxRuntime.jsx("a", { ...directive.useDirectives(directive$1, [directive.classDirective, classNames("page-link", className)]), children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children }) }) });
36
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: clsx("page-item", { disabled }), children: /* @__PURE__ */ jsxRuntime.jsx("a", { ...directive.useDirectives(directive$1, [directive.classDirective, ["page-link", className]]), children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children }) }) });
37
37
  });
38
38
  NavButton.displayName = "NavButton";
39
39
  const export_getPaginationDefaultConfig = pagination.getPaginationDefaultConfig;
@@ -93,7 +93,7 @@ const PaginationDefaultSlotStructure = (slotContext) => {
93
93
  );
94
94
  }
95
95
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
96
- /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: classNames("au-pagination", "pagination", { [`pagination-${state.size}`]: !!state.size }, state.className), children: [
96
+ /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: clsx("au-pagination", "pagination", { [`pagination-${state.size}`]: !!state.size }, state.className), children: [
97
97
  ItemsBefore,
98
98
  /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.pagesDisplay, props: slotContext }),
99
99
  ItemsAfter
@@ -106,6 +106,7 @@ function Pagination(props) {
106
106
  pagesDisplay: PaginationDefaultSlotPages,
107
107
  structure: PaginationDefaultSlotStructure
108
108
  });
109
+ React.useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
109
110
  return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": widgetContext.state.ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: widgetContext.state.structure, props: widgetContext }) });
110
111
  }
111
112
  exports.NavButton = NavButton;
@@ -1,14 +1,14 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
3
  import { useDirective } from "@agnos-ui/react-headless/utils/directive";
4
- import classNames from "classnames";
4
+ import clsx from "clsx";
5
5
  import { useWidgetWithConfig } from "./generated/config.js";
6
6
  import { getProgressbarDefaultConfig, createProgressbar } from "@agnos-ui/core-bootstrap/components/progressbar";
7
7
  const export_getProgressbarDefaultConfig = getProgressbarDefaultConfig;
8
8
  const export_createProgressbar = createProgressbar;
9
9
  const ProgressbarDefaultSlotStructure = (slotContext) => {
10
10
  const { striped, animated, type } = slotContext.state;
11
- const classes = classNames("progress-bar", { "progress-bar-striped": striped }, { "progress-bar-animated": animated }, { [`text-bg-${type}`]: !!type });
11
+ const classes = clsx("progress-bar", { "progress-bar-striped": striped }, { "progress-bar-animated": animated }, { [`text-bg-${type}`]: !!type });
12
12
  return /* @__PURE__ */ jsx("div", { className: "progress", style: { height: slotContext.state.height || void 0 }, children: /* @__PURE__ */ jsx("div", { className: classes, style: { width: `${slotContext.state.percentage}%` }, children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.children, props: slotContext }) }) });
13
13
  };
14
14
  const Progressbar = (props) => {
@@ -2,14 +2,14 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const slot = require("@agnos-ui/react-headless/slot");
4
4
  const directive = require("@agnos-ui/react-headless/utils/directive");
5
- const classNames = require("classnames");
5
+ const clsx = require("clsx");
6
6
  const generated_config = require("./generated/config.cjs");
7
7
  const progressbar = require("@agnos-ui/core-bootstrap/components/progressbar");
8
8
  const export_getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
9
9
  const export_createProgressbar = progressbar.createProgressbar;
10
10
  const ProgressbarDefaultSlotStructure = (slotContext) => {
11
11
  const { striped, animated, type } = slotContext.state;
12
- const classes = classNames("progress-bar", { "progress-bar-striped": striped }, { "progress-bar-animated": animated }, { [`text-bg-${type}`]: !!type });
12
+ const classes = clsx("progress-bar", { "progress-bar-striped": striped }, { "progress-bar-animated": animated }, { [`text-bg-${type}`]: !!type });
13
13
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "progress", style: { height: slotContext.state.height || void 0 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, style: { width: `${slotContext.state.percentage}%` }, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.children, props: slotContext }) }) });
14
14
  };
15
15
  const Progressbar = (props) => {
@@ -8,21 +8,22 @@ const rating = require("@agnos-ui/core-bootstrap/components/rating");
8
8
  const export_getRatingDefaultConfig = rating.getRatingDefaultConfig;
9
9
  const export_createRating = rating.createRating;
10
10
  function Star({ star, state, directive: directive$1 }) {
11
- const arg = { index: star.index };
12
11
  return /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
13
12
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "visually-hidden", children: [
14
13
  "(",
15
14
  star.index < state.visibleRating ? "*" : " ",
16
15
  ")"
17
16
  ] }),
18
- /* @__PURE__ */ jsxRuntime.jsx("span", { ...directive.useDirective(directive$1, arg), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.star, props: star }) })
17
+ /* @__PURE__ */ jsxRuntime.jsx("span", { ...directive.useDirective(directive$1, { index: star.index }), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.star, props: star }) })
19
18
  ] }, star.index);
20
19
  }
21
20
  function Rating(props) {
22
21
  const {
23
22
  state,
24
- directives: { containerDirective, starDirective }
23
+ directives: { containerDirective, starDirective },
24
+ api
25
25
  } = generated_config.useWidgetWithConfig(export_createRating, props, "rating");
26
+ React.useImperativeHandle(props.ref, () => api, [api]);
26
27
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "d-inline-flex"], containerDirective), children: state.stars.map((star) => /* @__PURE__ */ jsxRuntime.jsx(Star, { star, state, directive: starDirective }, star.index)) });
27
28
  }
28
29
  exports.Rating = Rating;
@@ -1,27 +1,28 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
3
  import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-headless/utils/directive";
4
- import React__default from "react";
4
+ import { useImperativeHandle, Fragment } from "react";
5
5
  import { useWidgetWithConfig } from "./generated/config.js";
6
6
  import { getRatingDefaultConfig, createRating } from "@agnos-ui/core-bootstrap/components/rating";
7
7
  const export_getRatingDefaultConfig = getRatingDefaultConfig;
8
8
  const export_createRating = createRating;
9
9
  function Star({ star, state, directive }) {
10
- const arg = { index: star.index };
11
- return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
10
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
12
11
  /* @__PURE__ */ jsxs("span", { className: "visually-hidden", children: [
13
12
  "(",
14
13
  star.index < state.visibleRating ? "*" : " ",
15
14
  ")"
16
15
  ] }),
17
- /* @__PURE__ */ jsx("span", { ...useDirective(directive, arg), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.star, props: star }) })
16
+ /* @__PURE__ */ jsx("span", { ...useDirective(directive, { index: star.index }), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.star, props: star }) })
18
17
  ] }, star.index);
19
18
  }
20
19
  function Rating(props) {
21
20
  const {
22
21
  state,
23
- directives: { containerDirective, starDirective }
22
+ directives: { containerDirective, starDirective },
23
+ api
24
24
  } = useWidgetWithConfig(export_createRating, props, "rating");
25
+ useImperativeHandle(props.ref, () => api, [api]);
25
26
  return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "d-inline-flex"], containerDirective), children: state.stars.map((star) => /* @__PURE__ */ jsx(Star, { star, state, directive: starDirective }, star.index)) });
26
27
  }
27
28
  export {
@@ -1,9 +1,10 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
3
  import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-headless/utils/directive";
4
- import classNames from "classnames";
4
+ import clsx from "clsx";
5
5
  import { useWidgetWithConfig } from "./generated/config.js";
6
6
  import { getSelectDefaultConfig, createSelect } from "@agnos-ui/core-bootstrap/components/select";
7
+ import { useImperativeHandle } from "react";
7
8
  const export_getSelectDefaultConfig = getSelectDefaultConfig;
8
9
  const export_createSelect = createSelect;
9
10
  function DefaultBadge(slotContext) {
@@ -23,7 +24,7 @@ function Badges({ slotContext }) {
23
24
  return badges.length ? /* @__PURE__ */ jsx(Fragment, { children: badges }) : null;
24
25
  }
25
26
  function SelectItem({ itemContext, slotContext }) {
26
- const classname = classNames("dropdown-item", "position-relative", { "text-bg-primary": itemContext === slotContext.state.highlighted });
27
+ const classname = clsx("dropdown-item", "position-relative", { "text-bg-primary": itemContext === slotContext.state.highlighted });
27
28
  return /* @__PURE__ */ jsx("li", { className: classname, ...useDirective(slotContext.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.itemLabel, props: { ...slotContext, itemContext } }) });
28
29
  }
29
30
  function Rows({ slotContext }) {
@@ -39,6 +40,7 @@ function Select(props) {
39
40
  badgeLabel: DefaultBadge,
40
41
  itemLabel: DefaultItem
41
42
  });
43
+ useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
42
44
  const {
43
45
  state: { id, visibleItems, filterText, open, className },
44
46
  directives: { hasFocusDirective, referenceDirective, inputContainerDirective, inputDirective }
@@ -47,7 +49,7 @@ function Select(props) {
47
49
  return /* @__PURE__ */ jsxs("div", { ...useDirectives([classDirective, `au-select dropdown border border-1 p-1 mb-3 d-block ${className}`], referenceDirective), children: [
48
50
  /* @__PURE__ */ jsxs("div", { ...useDirectives([classDirective, "d-flex align-items-center flex-wrap gap-1"], hasFocusDirective, inputContainerDirective), children: [
49
51
  /* @__PURE__ */ jsx(Badges, { slotContext: widgetContext }),
50
- /* @__PURE__ */ jsx("input", { value: filterText, ...useDirective(inputDirective), onChange: () => {
52
+ /* @__PURE__ */ jsx("input", { type: "text", value: filterText, ...useDirective(inputDirective), onChange: () => {
51
53
  } })
52
54
  ] }),
53
55
  open && visibleItems.length > 0 && /* @__PURE__ */ jsx(Rows, { slotContext: widgetContext, menuId })
@@ -2,9 +2,10 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const slot = require("@agnos-ui/react-headless/slot");
4
4
  const directive = require("@agnos-ui/react-headless/utils/directive");
5
- const classNames = require("classnames");
5
+ const clsx = require("clsx");
6
6
  const generated_config = require("./generated/config.cjs");
7
7
  const select = require("@agnos-ui/core-bootstrap/components/select");
8
+ const React = require("react");
8
9
  const export_getSelectDefaultConfig = select.getSelectDefaultConfig;
9
10
  const export_createSelect = select.createSelect;
10
11
  function DefaultBadge(slotContext) {
@@ -24,7 +25,7 @@ function Badges({ slotContext }) {
24
25
  return badges.length ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: badges }) : null;
25
26
  }
26
27
  function SelectItem({ itemContext, slotContext }) {
27
- const classname = classNames("dropdown-item", "position-relative", { "text-bg-primary": itemContext === slotContext.state.highlighted });
28
+ const classname = clsx("dropdown-item", "position-relative", { "text-bg-primary": itemContext === slotContext.state.highlighted });
28
29
  return /* @__PURE__ */ jsxRuntime.jsx("li", { className: classname, ...directive.useDirective(slotContext.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.itemLabel, props: { ...slotContext, itemContext } }) });
29
30
  }
30
31
  function Rows({ slotContext }) {
@@ -40,6 +41,7 @@ function Select(props) {
40
41
  badgeLabel: DefaultBadge,
41
42
  itemLabel: DefaultItem
42
43
  });
44
+ React.useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
43
45
  const {
44
46
  state: { id, visibleItems, filterText, open, className },
45
47
  directives: { hasFocusDirective, referenceDirective, inputContainerDirective, inputDirective }
@@ -48,7 +50,7 @@ function Select(props) {
48
50
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...directive.useDirectives([directive.classDirective, `au-select dropdown border border-1 p-1 mb-3 d-block ${className}`], referenceDirective), children: [
49
51
  /* @__PURE__ */ jsxRuntime.jsxs("div", { ...directive.useDirectives([directive.classDirective, "d-flex align-items-center flex-wrap gap-1"], hasFocusDirective, inputContainerDirective), children: [
50
52
  /* @__PURE__ */ jsxRuntime.jsx(Badges, { slotContext: widgetContext }),
51
- /* @__PURE__ */ jsxRuntime.jsx("input", { value: filterText, ...directive.useDirective(inputDirective), onChange: () => {
53
+ /* @__PURE__ */ jsxRuntime.jsx("input", { type: "text", value: filterText, ...directive.useDirective(inputDirective), onChange: () => {
52
54
  } })
53
55
  ] }),
54
56
  open && visibleItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Rows, { slotContext: widgetContext, menuId })
@@ -34,7 +34,7 @@ const CombinedLabel = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("div", { .
34
34
  /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } })
35
35
  ] }) });
36
36
  const SliderDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
37
- slotContext.state.progressDisplayOptions.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(ProgressDisplay, { directive: slotContext.directives.progressDisplayDirective, option }, index)),
37
+ slotContext.state.progressDisplayOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx(ProgressDisplay, { directive: slotContext.directives.progressDisplayDirective, option }, option.id)),
38
38
  /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.directives.clickableAreaDirective) }),
39
39
  slotContext.state.showMinMaxLabels && /* @__PURE__ */ jsxRuntime.jsx(MinMaxLabels, { ...slotContext }),
40
40
  slotContext.state.showValueLabels && slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsxRuntime.jsx(CombinedLabel, { ...slotContext }),
@@ -33,7 +33,7 @@ const CombinedLabel = (slotContext) => /* @__PURE__ */ jsx("div", { ...useDirect
33
33
  /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } })
34
34
  ] }) });
35
35
  const SliderDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
36
- slotContext.state.progressDisplayOptions.map((option, index) => /* @__PURE__ */ jsx(ProgressDisplay, { directive: slotContext.directives.progressDisplayDirective, option }, index)),
36
+ slotContext.state.progressDisplayOptions.map((option) => /* @__PURE__ */ jsx(ProgressDisplay, { directive: slotContext.directives.progressDisplayDirective, option }, option.id)),
37
37
  /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.directives.clickableAreaDirective) }),
38
38
  slotContext.state.showMinMaxLabels && /* @__PURE__ */ jsx(MinMaxLabels, { ...slotContext }),
39
39
  slotContext.state.showValueLabels && slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsx(CombinedLabel, { ...slotContext }),
@@ -1,7 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
3
  import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
4
- import { forwardRef, useImperativeHandle } from "react";
4
+ import { useImperativeHandle } from "react";
5
5
  import { useWidgetWithConfig } from "./generated/config.js";
6
6
  import { getToastDefaultConfig, createToast } from "@agnos-ui/core-bootstrap/components/toast";
7
7
  const export_getToastDefaultConfig = getToastDefaultConfig;
@@ -21,7 +21,7 @@ const ToastElement = (slotContext) => /* @__PURE__ */ jsx(
21
21
  "div",
22
22
  {
23
23
  ...useDirectives(
24
- [classDirective, `toast ${slotContext.state.dismissible ? "toast-dismissible" : ""} ${!slotContext.state.header ? "d-flex" : ""}`],
24
+ [classDirective, { "toast-dismissible": slotContext.state.dismissible, "d-flex": !slotContext.state.header }],
25
25
  slotContext.directives.transitionDirective,
26
26
  slotContext.directives.autoHideDirective,
27
27
  slotContext.directives.bodyDirective
@@ -29,14 +29,14 @@ const ToastElement = (slotContext) => /* @__PURE__ */ jsx(
29
29
  children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.structure, props: slotContext })
30
30
  }
31
31
  );
32
- const Toast = forwardRef(function Toast2(props, ref) {
32
+ function Toast(props) {
33
33
  const widgetContext = useWidgetWithConfig(export_createToast, props, "toast", {
34
34
  structure: ToastDefaultSlotStructure,
35
35
  children: props.children
36
36
  });
37
- useImperativeHandle(ref, () => widgetContext.api, [widgetContext.api]);
37
+ useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
38
38
  return /* @__PURE__ */ jsx(Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsx(ToastElement, { ...widgetContext }) });
39
- });
39
+ }
40
40
  export {
41
41
  ToastDefaultSlotStructure as T,
42
42
  Toast as a,