@agnos-ui/react-bootstrap 0.7.0-next.0 → 0.7.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 (52) 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-BWfpiNSz.cjs} +3 -3
  4. package/{alert-CTTuh9t9.js → alert-CWbr08rp.js} +4 -4
  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/rating/index.cjs +1 -1
  23. package/components/rating/index.js +1 -1
  24. package/components/rating/rating.d.ts +5 -2
  25. package/components/select/index.cjs +1 -1
  26. package/components/select/index.js +1 -1
  27. package/components/select/select.d.ts +5 -2
  28. package/components/slider/index.cjs +1 -1
  29. package/components/slider/index.js +1 -1
  30. package/components/slider/slider.gen.d.ts +5 -1
  31. package/components/toast/index.cjs +1 -1
  32. package/components/toast/index.js +1 -1
  33. package/components/toast/toast.d.ts +5 -3
  34. package/components/tree/tree.gen.d.ts +1 -1
  35. package/config.d.ts +2 -2
  36. package/generated/config.cjs +2 -2
  37. package/generated/config.js +3 -3
  38. package/index.cjs +10 -10
  39. package/index.js +12 -12
  40. package/{modal-_OcXelvY.cjs → modal-C3hVG-lH.cjs} +3 -3
  41. package/{modal-DuCmvYiX.js → modal-DPKlan_9.js} +4 -4
  42. package/package.json +5 -5
  43. package/{pagination-5jlJWfFj.js → pagination-AH4hiASa.js} +2 -0
  44. package/{pagination-b4pKj3Kx.cjs → pagination-CYTSlunk.cjs} +1 -0
  45. package/{rating-eI8T0zvS.cjs → rating-BaZTCQi1.cjs} +4 -3
  46. package/{rating-CTfRQGGu.js → rating-DziC4Tsh.js} +6 -5
  47. package/{select-XHUAqTDw.cjs → select-D9kVpioc.cjs} +3 -1
  48. package/{select-BriGqe3k.js → select-VhhSuDsJ.js} +3 -1
  49. package/{slider-BUQne5aJ.cjs → slider-D0knY75x.cjs} +1 -1
  50. package/{slider--K7ri_0l.js → slider-UQlY3PHn.js} +1 -1
  51. package/{toast-Vv1dxnuA.cjs → toast-BdNereP2.cjs} +3 -3
  52. package/{toast-CS1mMdhx.js → toast-CDfXkRkD.js} +4 -4
@@ -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 { createContext, forwardRef, useContext, useImperativeHandle, useEffect } from "react";
4
+ import { createContext, useContext, useImperativeHandle, useEffect } from "react";
5
5
  import { useWidgetWithConfig } from "./generated/config.js";
6
6
  import { getAccordionDefaultConfig, createAccordionItem, createAccordion, factoryCreateAccordion } from "@agnos-ui/core-bootstrap/components/accordion";
7
7
  const export_getAccordionDefaultConfig = getAccordionDefaultConfig;
@@ -19,27 +19,23 @@ const AccordionItemDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(
19
19
  /* @__PURE__ */ jsx(Header, { directive: slotContext.directives.headerDirective, headerTag: slotContext.state.headingTag, children: /* @__PURE__ */ jsx("button", { ...useDirectives([classDirective, "accordion-button"], slotContext.directives.buttonDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.header, props: slotContext }) }) }),
20
20
  slotContext.state.shouldBeInDOM && /* @__PURE__ */ jsx(ItemContent, { ...slotContext })
21
21
  ] });
22
- const AccordionItem = forwardRef(
23
- function AccordionItem2(props, ref) {
24
- const { registerItem } = useContext(AccordionDIContext);
25
- const widgetContext = useWidgetWithConfig(registerItem, props, null, {
26
- structure: AccordionItemDefaultSlotStructure
27
- });
28
- const { state, api, directives } = widgetContext;
29
- useImperativeHandle(ref, () => api, [api]);
30
- useEffect(() => {
31
- api.initDone();
32
- }, [api]);
33
- return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, `accordion-item ${state.className}`], directives.itemDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.structure, props: widgetContext }) });
34
- }
35
- );
36
- const Accordion = forwardRef(
37
- function Accordion2(props, ref) {
38
- const widget = useWidgetWithConfig(export_createAccordion, props, "accordion");
39
- useImperativeHandle(ref, () => widget.api, [widget.api]);
40
- return /* @__PURE__ */ jsx(AccordionDIContext.Provider, { value: widget.api, children: /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "accordion"], widget.directives.accordionDirective), children: props.children }) });
41
- }
42
- );
22
+ function AccordionItem(props) {
23
+ const { registerItem } = useContext(AccordionDIContext);
24
+ const widgetContext = useWidgetWithConfig(registerItem, props, null, {
25
+ structure: AccordionItemDefaultSlotStructure
26
+ });
27
+ const { state, api, directives } = widgetContext;
28
+ useImperativeHandle(props.ref, () => api, [api]);
29
+ useEffect(() => {
30
+ api.initDone();
31
+ }, [api]);
32
+ return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, `accordion-item ${state.className}`], directives.itemDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.structure, props: widgetContext }) });
33
+ }
34
+ function Accordion(props) {
35
+ const widget = useWidgetWithConfig(export_createAccordion, props, "accordion");
36
+ useImperativeHandle(props.ref, () => widget.api, [widget.api]);
37
+ return /* @__PURE__ */ jsx(AccordionDIContext, { value: widget.api, children: /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "accordion"], widget.directives.accordionDirective), children: props.children }) });
38
+ }
43
39
  export {
44
40
  AccordionItemDefaultSlotStructure as A,
45
41
  AccordionItem as a,
@@ -20,27 +20,23 @@ const AccordionItemDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRu
20
20
  /* @__PURE__ */ jsxRuntime.jsx(Header, { directive: slotContext.directives.headerDirective, headerTag: slotContext.state.headingTag, children: /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirectives([directive.classDirective, "accordion-button"], slotContext.directives.buttonDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.header, props: slotContext }) }) }),
21
21
  slotContext.state.shouldBeInDOM && /* @__PURE__ */ jsxRuntime.jsx(ItemContent, { ...slotContext })
22
22
  ] });
23
- const AccordionItem = React.forwardRef(
24
- function AccordionItem2(props, ref) {
25
- const { registerItem } = React.useContext(AccordionDIContext);
26
- const widgetContext = generated_config.useWidgetWithConfig(registerItem, props, null, {
27
- structure: AccordionItemDefaultSlotStructure
28
- });
29
- const { state, api, directives } = widgetContext;
30
- React.useImperativeHandle(ref, () => api, [api]);
31
- React.useEffect(() => {
32
- api.initDone();
33
- }, [api]);
34
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, `accordion-item ${state.className}`], directives.itemDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.structure, props: widgetContext }) });
35
- }
36
- );
37
- const Accordion = React.forwardRef(
38
- function Accordion2(props, ref) {
39
- const widget = generated_config.useWidgetWithConfig(export_createAccordion, props, "accordion");
40
- React.useImperativeHandle(ref, () => widget.api, [widget.api]);
41
- return /* @__PURE__ */ jsxRuntime.jsx(AccordionDIContext.Provider, { value: widget.api, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "accordion"], widget.directives.accordionDirective), children: props.children }) });
42
- }
43
- );
23
+ function AccordionItem(props) {
24
+ const { registerItem } = React.useContext(AccordionDIContext);
25
+ const widgetContext = generated_config.useWidgetWithConfig(registerItem, props, null, {
26
+ structure: AccordionItemDefaultSlotStructure
27
+ });
28
+ const { state, api, directives } = widgetContext;
29
+ React.useImperativeHandle(props.ref, () => api, [api]);
30
+ React.useEffect(() => {
31
+ api.initDone();
32
+ }, [api]);
33
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, `accordion-item ${state.className}`], directives.itemDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.structure, props: widgetContext }) });
34
+ }
35
+ function Accordion(props) {
36
+ const widget = generated_config.useWidgetWithConfig(export_createAccordion, props, "accordion");
37
+ React.useImperativeHandle(props.ref, () => widget.api, [widget.api]);
38
+ return /* @__PURE__ */ jsxRuntime.jsx(AccordionDIContext, { value: widget.api, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "accordion"], widget.directives.accordionDirective), children: props.children }) });
39
+ }
44
40
  exports.Accordion = Accordion;
45
41
  exports.AccordionItem = AccordionItem;
46
42
  exports.AccordionItemDefaultSlotStructure = AccordionItemDefaultSlotStructure;
@@ -25,13 +25,13 @@ const AlertElement = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx(
25
25
  children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.structure, props: slotContext })
26
26
  }
27
27
  );
28
- const Alert = React.forwardRef(function Alert2(props, ref) {
28
+ function Alert(props) {
29
29
  const widgetContext = generated_config.useWidgetWithConfig(export_createAlert, props, "alert", {
30
30
  structure: AlertDefaultSlotStructure
31
31
  });
32
- React.useImperativeHandle(ref, () => widgetContext.api, [widgetContext.api]);
32
+ React.useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
33
33
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsxRuntime.jsx(AlertElement, { ...widgetContext }) });
34
- });
34
+ }
35
35
  exports.Alert = Alert;
36
36
  exports.AlertDefaultSlotStructure = AlertDefaultSlotStructure;
37
37
  exports.export_createAlert = export_createAlert;
@@ -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 { getAlertDefaultConfig, createAlert } from "@agnos-ui/core-bootstrap/components/alert";
7
7
  const export_getAlertDefaultConfig = getAlertDefaultConfig;
@@ -24,13 +24,13 @@ const AlertElement = (slotContext) => /* @__PURE__ */ jsx(
24
24
  children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.structure, props: slotContext })
25
25
  }
26
26
  );
27
- const Alert = forwardRef(function Alert2(props, ref) {
27
+ function Alert(props) {
28
28
  const widgetContext = useWidgetWithConfig(export_createAlert, props, "alert", {
29
29
  structure: AlertDefaultSlotStructure
30
30
  });
31
- useImperativeHandle(ref, () => widgetContext.api, [widgetContext.api]);
31
+ useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
32
32
  return /* @__PURE__ */ jsx(Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsx(AlertElement, { ...widgetContext }) });
33
- });
33
+ }
34
34
  export {
35
35
  AlertDefaultSlotStructure as A,
36
36
  Alert as a,
@@ -1,17 +1,15 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { forwardRef, useImperativeHandle } from "react";
2
+ import { useImperativeHandle } from "react";
3
3
  import { useWidgetWithConfig } from "./generated/config.js";
4
4
  import { getCollapseDefaultConfig, createCollapse } from "@agnos-ui/core-bootstrap/components/collapse";
5
5
  import { useDirectives } from "@agnos-ui/react-headless/utils/directive";
6
6
  const export_getCollapseDefaultConfig = getCollapseDefaultConfig;
7
7
  const export_createCollapse = createCollapse;
8
- const Collapse = forwardRef(
9
- function Collapse2(props, ref) {
10
- const { api, directives } = useWidgetWithConfig(export_createCollapse, props, "collapse");
11
- useImperativeHandle(ref, () => api, [api]);
12
- return /* @__PURE__ */ jsx("div", { ...useDirectives(directives.collapseDirective), children: props.children });
13
- }
14
- );
8
+ function Collapse(props) {
9
+ const { api, directives } = useWidgetWithConfig(export_createCollapse, props, "collapse");
10
+ useImperativeHandle(props.ref, () => api, [api]);
11
+ return /* @__PURE__ */ jsx("div", { ...useDirectives(directives.collapseDirective), children: props.children });
12
+ }
15
13
  export {
16
14
  Collapse as C,
17
15
  export_createCollapse as a,
@@ -6,13 +6,11 @@ const collapse = require("@agnos-ui/core-bootstrap/components/collapse");
6
6
  const directive = require("@agnos-ui/react-headless/utils/directive");
7
7
  const export_getCollapseDefaultConfig = collapse.getCollapseDefaultConfig;
8
8
  const export_createCollapse = collapse.createCollapse;
9
- const Collapse = React.forwardRef(
10
- function Collapse2(props, ref) {
11
- const { api, directives } = generated_config.useWidgetWithConfig(export_createCollapse, props, "collapse");
12
- React.useImperativeHandle(ref, () => api, [api]);
13
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives(directives.collapseDirective), children: props.children });
14
- }
15
- );
9
+ function Collapse(props) {
10
+ const { api, directives } = generated_config.useWidgetWithConfig(export_createCollapse, props, "collapse");
11
+ React.useImperativeHandle(props.ref, () => api, [api]);
12
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives(directives.collapseDirective), children: props.children });
13
+ }
16
14
  exports.Collapse = Collapse;
17
15
  exports.export_createCollapse = export_createCollapse;
18
16
  exports.export_getCollapseDefaultConfig = export_getCollapseDefaultConfig;
@@ -1,4 +1,4 @@
1
- import type { ForwardRefExoticComponent, PropsWithChildren, RefAttributes } from 'react';
1
+ import type { ForwardedRef, PropsWithChildren, Ref } from 'react';
2
2
  import type { AccordionApi, AccordionItemApi, AccordionItemContext, AccordionItemProps, AccordionProps } from './accordion.gen';
3
3
  /**
4
4
  * Renders the default slot structure for an accordion item.
@@ -11,7 +11,7 @@ export declare const AccordionItemDefaultSlotStructure: (slotContext: AccordionI
11
11
  * AccordionItem component is a part of the Accordion component suite.
12
12
  *
13
13
  * @param props - The properties for the AccordionItem component.
14
- * @param ref - The forwarded ref to the AccordionItemApi.
14
+ * @param props.ref - The forwarded ref to the AccordionItemApi.
15
15
  *
16
16
  * @returns The rendered AccordionItem component.
17
17
  * @remarks
@@ -26,7 +26,9 @@ export declare const AccordionItemDefaultSlotStructure: (slotContext: AccordionI
26
26
  * @see {@link useWidgetWithConfig}
27
27
  * @see {@link useDirectives}
28
28
  */
29
- export declare const AccordionItem: ForwardRefExoticComponent<Partial<AccordionItemProps> & RefAttributes<AccordionItemApi>>;
29
+ export declare function AccordionItem(props: Partial<AccordionItemProps> & {
30
+ ref?: Ref<AccordionItemApi>;
31
+ }): import("react/jsx-runtime").JSX.Element;
30
32
  /**
31
33
  * Accordion component that provides a collapsible content container.
32
34
  *
@@ -35,9 +37,11 @@ export declare const AccordionItem: ForwardRefExoticComponent<Partial<AccordionI
35
37
  * {@link https://react.dev/reference/react/useImperativeHandle | useImperativeHandle} to bind the widget API to the ref.
36
38
  *
37
39
  * @param props - The properties for the Accordion component.
38
- * @param ref - The ref to be forwarded to the Accordion API.
40
+ * @param props.ref - The ref to be forwarded to the Accordion API.
39
41
  *
40
42
  * @returns The rendered Accordion component.
41
43
  *
42
44
  */
43
- export declare const Accordion: ForwardRefExoticComponent<PropsWithChildren<Partial<AccordionProps>> & RefAttributes<AccordionApi>>;
45
+ export declare function Accordion(props: PropsWithChildren<Partial<AccordionProps>> & {
46
+ ref?: ForwardedRef<AccordionApi>;
47
+ }): 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 accordion = require("../../accordion-01ch6GZW.cjs");
3
+ const accordion = require("../../accordion-QclyKh8E.cjs");
4
4
  exports.Accordion = accordion.Accordion;
5
5
  exports.AccordionItem = accordion.AccordionItem;
6
6
  exports.AccordionItemDefaultSlotStructure = accordion.AccordionItemDefaultSlotStructure;
@@ -1,4 +1,4 @@
1
- import { b, a, A, d, c, f, e } from "../../accordion-D3SZgVk6.js";
1
+ import { b, a, A, d, c, f, e } from "../../accordion-GX854ooE.js";
2
2
  export {
3
3
  b as Accordion,
4
4
  a as AccordionItem,
@@ -1,4 +1,4 @@
1
- import type { ForwardRefExoticComponent, RefAttributes } from 'react';
1
+ import type { Ref } from 'react';
2
2
  import type { AlertApi, AlertContext, AlertProps } from './alert.gen';
3
3
  /**
4
4
  * Renders the default slot structure for an alert component.
@@ -14,8 +14,10 @@ export declare const AlertDefaultSlotStructure: (slotContext: AlertContext) => i
14
14
  * and the {@link https://react.dev/reference/react/useImperativeHandle | useImperativeHandle} hook to expose the widget's API via the ref.
15
15
  *
16
16
  * @param props - Partial properties of the AlertProps interface.
17
- * @param ref - Forwarded reference to the AlertApi.
17
+ * @param props.ref - Forwarded reference to the AlertApi.
18
18
  *
19
19
  * @returns A JSX element that conditionally renders the AlertElement based on the widget's hidden state.
20
20
  */
21
- export declare const Alert: ForwardRefExoticComponent<Partial<AlertProps> & RefAttributes<AlertApi>>;
21
+ export declare function Alert(props: Partial<AlertProps> & {
22
+ ref?: Ref<AlertApi>;
23
+ }): 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 alert = require("../../alert-DGvp2r3W.cjs");
3
+ const alert = require("../../alert-BWfpiNSz.cjs");
4
4
  exports.Alert = alert.Alert;
5
5
  exports.AlertDefaultSlotStructure = alert.AlertDefaultSlotStructure;
6
6
  exports.createAlert = alert.export_createAlert;
@@ -1,4 +1,4 @@
1
- import { a, A, b, e } from "../../alert-CTTuh9t9.js";
1
+ import { a, A, b, e } from "../../alert-CWbr08rp.js";
2
2
  export {
3
3
  a as Alert,
4
4
  A as AlertDefaultSlotStructure,
@@ -1,4 +1,4 @@
1
- import type { ForwardRefExoticComponent, PropsWithChildren, RefAttributes } from 'react';
1
+ import type { PropsWithChildren, Ref } from 'react';
2
2
  import type { CollapseApi, CollapseProps } from './collapse.gen';
3
3
  /**
4
4
  * Collapse component that provides a collapsible container.
@@ -8,8 +8,10 @@ import type { CollapseApi, CollapseProps } from './collapse.gen';
8
8
  *
9
9
  * @param props - The properties for the Collapse component.
10
10
  * @param props.children - The child elements to be rendered inside the collapsible container.
11
- * @param ref - A ref object to access the Collapse API.
11
+ * @param props.ref - A ref object to access the Collapse API.
12
12
  *
13
13
  * @returns A div element with transition directives applied, containing the child elements.
14
14
  */
15
- export declare const Collapse: ForwardRefExoticComponent<PropsWithChildren<Partial<CollapseProps>> & RefAttributes<CollapseApi>>;
15
+ export declare function Collapse(props: PropsWithChildren<Partial<CollapseProps>> & {
16
+ ref?: Ref<CollapseApi>;
17
+ }): 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 collapse = require("../../collapse-Dodvr8dn.cjs");
3
+ const collapse = require("../../collapse-UMbDs6Gh.cjs");
4
4
  exports.Collapse = collapse.Collapse;
5
5
  exports.createCollapse = collapse.export_createCollapse;
6
6
  exports.getCollapseDefaultConfig = collapse.export_getCollapseDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { C, a, e } from "../../collapse-DNwn7xgF.js";
1
+ import { C, a, e } from "../../collapse-BOXBa8_8.js";
2
2
  export {
3
3
  C as Collapse,
4
4
  a as createCollapse,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const modal = require("../../modal-_OcXelvY.cjs");
3
+ const modal = require("../../modal-C3hVG-lH.cjs");
4
4
  exports.Modal = modal.Modal;
5
5
  exports.ModalDefaultSlotHeader = modal.ModalDefaultSlotHeader;
6
6
  exports.ModalDefaultSlotStructure = modal.ModalDefaultSlotStructure;
@@ -1,4 +1,4 @@
1
- import { b, M, a, c, e, f, d, o } from "../../modal-DuCmvYiX.js";
1
+ import { b, M, a, c, e, f, d, o } from "../../modal-DPKlan_9.js";
2
2
  export {
3
3
  b as Modal,
4
4
  M as ModalDefaultSlotHeader,
@@ -1,4 +1,4 @@
1
- import type { RefAttributes } from 'react';
1
+ import type { Ref } from 'react';
2
2
  import type { ModalApi, ModalContext, ModalProps } from './modal.gen';
3
3
  /**
4
4
  * A default header component for the modal that displays a title and an optional close button.
@@ -17,16 +17,18 @@ export declare const ModalDefaultSlotHeader: <Data>(slotContext: ModalContext<Da
17
17
  */
18
18
  export declare const ModalDefaultSlotStructure: <Data>(slotContext: ModalContext<Data>) => import("react/jsx-runtime").JSX.Element;
19
19
  /**
20
- * A Modal component that uses a forwardRef to expose its API.
20
+ * A Modal component
21
21
  *
22
22
  * @template Data - The type of data that the modal will handle.
23
23
  *
24
24
  * @param props - The properties for the Modal component.
25
- * @param ref - A ref to access the Modal API.
25
+ * @param props.ref - A ref to access the Modal API.
26
26
  *
27
27
  * @returns The rendered Modal component.
28
28
  */
29
- export declare const Modal: <Data>(props: Partial<ModalProps<Data>> & RefAttributes<ModalApi<Data>>) => JSX.Element;
29
+ export declare function Modal<Data>(props: Partial<ModalProps<Data>> & {
30
+ ref?: Ref<ModalApi<Data>>;
31
+ }): import("react/jsx-runtime").JSX.Element;
30
32
  /**
31
33
  * Opens a modal dialog with the specified options.
32
34
  *
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const pagination = require("../../pagination-b4pKj3Kx.cjs");
3
+ const pagination = require("../../pagination-CYTSlunk.cjs");
4
4
  exports.NavButton = pagination.NavButton;
5
5
  exports.PageItem = pagination.PageItem;
6
6
  exports.Pagination = pagination.Pagination;
@@ -1,4 +1,4 @@
1
- import { N, P, c, a, b, d, e } from "../../pagination-5jlJWfFj.js";
1
+ import { N, P, c, a, b, d, e } from "../../pagination-AH4hiASa.js";
2
2
  export {
3
3
  N as NavButton,
4
4
  P as PageItem,
@@ -1,4 +1,5 @@
1
- import type { PaginationContext, PaginationProps } from './pagination.gen';
1
+ import type { PaginationApi, PaginationContext, PaginationProps } from './pagination.gen';
2
+ import { type Ref } from 'react';
2
3
  /**
3
4
  * Renders the default slot pages for the pagination component.
4
5
  *
@@ -31,6 +32,9 @@ export declare const PaginationDefaultSlotStructure: (slotContext: PaginationCon
31
32
  * It uses the {@link useWidgetWithConfig} hook to create a pagination widget with the provided props.
32
33
  *
33
34
  * @param props - The properties for the Pagination component.
35
+ * @param props.ref - Forwarded reference to the PaginationApi.
34
36
  * @returns The rendered pagination navigation element.
35
37
  */
36
- export declare function Pagination(props: Partial<PaginationProps>): import("react/jsx-runtime").JSX.Element;
38
+ export declare function Pagination(props: Partial<PaginationProps> & {
39
+ ref?: Ref<PaginationApi>;
40
+ }): 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 rating = require("../../rating-eI8T0zvS.cjs");
3
+ const rating = require("../../rating-BaZTCQi1.cjs");
4
4
  exports.Rating = rating.Rating;
5
5
  exports.createRating = rating.export_createRating;
6
6
  exports.getRatingDefaultConfig = rating.export_getRatingDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { R, a, e } from "../../rating-CTfRQGGu.js";
1
+ import { R, a, e } from "../../rating-DziC4Tsh.js";
2
2
  export {
3
3
  R as Rating,
4
4
  a as createRating,
@@ -1,4 +1,5 @@
1
- import type { RatingProps } from './rating.gen';
1
+ import { type Ref } from 'react';
2
+ import type { RatingApi, RatingProps } from './rating.gen';
2
3
  /**
3
4
  * Rating component that displays a series of stars based on the provided state.
4
5
  *
@@ -10,4 +11,6 @@ import type { RatingProps } from './rating.gen';
10
11
  * It applies directives to the container and individual stars for styling and behavior.
11
12
  *
12
13
  */
13
- export declare function Rating(props: Partial<RatingProps>): import("react/jsx-runtime").JSX.Element;
14
+ export declare function Rating(props: Partial<RatingProps> & {
15
+ ref?: Ref<RatingApi>;
16
+ }): 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 select = require("../../select-XHUAqTDw.cjs");
3
+ const select = require("../../select-D9kVpioc.cjs");
4
4
  exports.Select = select.Select;
5
5
  exports.createSelect = select.export_createSelect;
6
6
  exports.getSelectDefaultConfig = select.export_getSelectDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { S, a, e } from "../../select-BriGqe3k.js";
1
+ import { S, a, e } from "../../select-VhhSuDsJ.js";
2
2
  export {
3
3
  S as Select,
4
4
  a as createSelect,
@@ -1,4 +1,5 @@
1
- import type { SelectProps } from './select.gen';
1
+ import type { SelectApi, SelectProps } from './select.gen';
2
+ import { type Ref } from 'react';
2
3
  /**
3
4
  * A generic Select component that provides a customizable dropdown selection interface.
4
5
  *
@@ -10,4 +11,6 @@ import type { SelectProps } from './select.gen';
10
11
  * This component uses a widget context to manage its state and directives. It supports
11
12
  * custom badge labels and item labels through the widget configuration.
12
13
  */
13
- export declare function Select<Item>(props: Partial<SelectProps<Item>>): import("react/jsx-runtime").JSX.Element;
14
+ export declare function Select<Item>(props: Partial<SelectProps<Item>> & {
15
+ ref?: Ref<SelectApi<Item>>;
16
+ }): 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 slider = require("../../slider-BUQne5aJ.cjs");
3
+ const slider = require("../../slider-D0knY75x.cjs");
4
4
  exports.Slider = slider.Slider;
5
5
  exports.SliderDefaultSlotHandle = slider.SliderDefaultSlotHandle;
6
6
  exports.SliderDefaultSlotStructure = slider.SliderDefaultSlotStructure;
@@ -1,4 +1,4 @@
1
- import { b, S, a, c, e } from "../../slider--K7ri_0l.js";
1
+ import { b, S, a, c, e } from "../../slider-UQlY3PHn.js";
2
2
  export {
3
3
  b as Slider,
4
4
  S as SliderDefaultSlotHandle,
@@ -318,9 +318,13 @@ export interface ProgressDisplayOptions {
318
318
  */
319
319
  width: number;
320
320
  /**
321
- * Height of hte progress in %
321
+ * Height of the progress in %
322
322
  */
323
323
  height: number;
324
+ /**
325
+ * Id of the progress
326
+ */
327
+ id: number;
324
328
  }
325
329
  /**
326
330
  * Options for displaying a handle in a slider component.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const toast = require("../../toast-Vv1dxnuA.cjs");
3
+ const toast = require("../../toast-BdNereP2.cjs");
4
4
  exports.Toast = toast.Toast;
5
5
  exports.ToastDefaultSlotStructure = toast.ToastDefaultSlotStructure;
6
6
  exports.createToast = toast.export_createToast;
@@ -1,4 +1,4 @@
1
- import { a, T, b, e } from "../../toast-CS1mMdhx.js";
1
+ import { a, T, b, e } from "../../toast-CDfXkRkD.js";
2
2
  export {
3
3
  a as Toast,
4
4
  T as ToastDefaultSlotStructure,
@@ -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;
@@ -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,15 +1,15 @@
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");
3
+ const accordion = require("./accordion-QclyKh8E.cjs");
4
+ const alert = require("./alert-BWfpiNSz.cjs");
5
+ const collapse = require("./collapse-UMbDs6Gh.cjs");
6
+ const modal = require("./modal-C3hVG-lH.cjs");
7
+ const pagination = require("./pagination-CYTSlunk.cjs");
8
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");
9
+ const rating = require("./rating-BaZTCQi1.cjs");
10
+ const select = require("./select-D9kVpioc.cjs");
11
+ const slider = require("./slider-D0knY75x.cjs");
12
+ const toast = require("./toast-BdNereP2.cjs");
13
13
  const tree = require("./tree-CCmlpEPq.cjs");
14
14
  const types = require("@agnos-ui/react-headless/types");
15
15
  const slot = require("@agnos-ui/react-headless/slot");
@@ -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";
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-CWbr08rp.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-DPKlan_9.js";
5
+ import { N, P, c as c3, a as a5, b as b4, d as d3, e as e5 } from "./pagination-AH4hiASa.js";
6
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";
7
+ import { R, a as a7, e as e7 } from "./rating-DziC4Tsh.js";
8
+ import { S, a as a8, e as e8 } from "./select-VhhSuDsJ.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-CDfXkRkD.js";
11
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";
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
  };
@@ -27,17 +27,17 @@ const ModalElement = (slotContext) => {
27
27
  const { fullscreen } = slotContext.state;
28
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 }) }) }) });
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 {
@@ -3,7 +3,7 @@ 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
5
  import classNames from "classnames";
6
- import { forwardRef, useImperativeHandle } from "react";
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";
@@ -26,17 +26,17 @@ const ModalElement = (slotContext) => {
26
26
  const { fullscreen } = slotContext.state;
27
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 }) }) }) });
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.0",
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",
52
+ "@agnos-ui/core-bootstrap": "0.7.0",
53
+ "@agnos-ui/react-headless": "0.7.0",
54
54
  "classnames": "^2.5.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/",
@@ -3,6 +3,7 @@ import { Slot } from "@agnos-ui/react-headless/slot";
3
3
  import classNames from "classnames";
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(
@@ -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 {
@@ -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;
@@ -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 {
@@ -5,6 +5,7 @@ const directive = require("@agnos-ui/react-headless/utils/directive");
5
5
  const classNames = require("classnames");
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) {
@@ -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 })
@@ -4,6 +4,7 @@ import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-hea
4
4
  import classNames from "classnames";
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) {
@@ -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 })
@@ -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 }),
@@ -30,14 +30,14 @@ const ToastElement = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx(
30
30
  children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.structure, props: slotContext })
31
31
  }
32
32
  );
33
- const Toast = React.forwardRef(function Toast2(props, ref) {
33
+ function Toast(props) {
34
34
  const widgetContext = generated_config.useWidgetWithConfig(export_createToast, props, "toast", {
35
35
  structure: ToastDefaultSlotStructure,
36
36
  children: props.children
37
37
  });
38
- React.useImperativeHandle(ref, () => widgetContext.api, [widgetContext.api]);
38
+ React.useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
39
39
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsxRuntime.jsx(ToastElement, { ...widgetContext }) });
40
- });
40
+ }
41
41
  exports.Toast = Toast;
42
42
  exports.ToastDefaultSlotStructure = ToastDefaultSlotStructure;
43
43
  exports.export_createToast = export_createToast;
@@ -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;
@@ -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,