@agnos-ui/react-bootstrap 0.3.1 → 0.4.0-next.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 (82) hide show
  1. package/{accordion-Bpx0new2.js → accordion-CMbgQzoG.js} +12 -10
  2. package/{accordion-BaQCaLLI.cjs → accordion-DnlQmoOX.cjs} +9 -7
  3. package/{alert-DOBOL4nD.cjs → alert-Bn5ooyqK.cjs} +9 -17
  4. package/{alert-DWq65Emo.js → alert-DKl7HLhb.js} +11 -19
  5. package/components/accordion/accordion.d.ts +6 -12
  6. package/components/accordion/accordion.gen.d.ts +343 -0
  7. package/components/accordion/index.cjs +3 -9
  8. package/components/accordion/index.js +5 -4
  9. package/components/alert/alert.d.ts +6 -9
  10. package/components/alert/alert.gen.d.ts +119 -0
  11. package/components/alert/index.cjs +2 -9
  12. package/components/alert/index.js +3 -3
  13. package/components/modal/index.cjs +10 -8
  14. package/components/modal/index.js +5 -2
  15. package/components/modal/modal.d.ts +7 -9
  16. package/components/modal/modal.gen.d.ts +239 -0
  17. package/components/pagination/index.cjs +2 -9
  18. package/components/pagination/index.js +3 -3
  19. package/components/pagination/pagination.d.ts +4 -7
  20. package/components/pagination/pagination.gen.d.ts +394 -0
  21. package/components/progressbar/index.cjs +2 -9
  22. package/components/progressbar/index.js +3 -3
  23. package/components/progressbar/progressbar.d.ts +5 -8
  24. package/components/progressbar/progressbar.gen.d.ts +126 -0
  25. package/components/rating/index.cjs +2 -9
  26. package/components/rating/index.js +3 -3
  27. package/components/rating/rating.d.ts +4 -5
  28. package/components/rating/rating.gen.d.ts +179 -0
  29. package/components/select/index.cjs +2 -9
  30. package/components/select/index.js +3 -3
  31. package/components/select/select.d.ts +4 -7
  32. package/components/select/select.gen.d.ts +293 -0
  33. package/components/slider/index.cjs +2 -9
  34. package/components/slider/index.js +3 -3
  35. package/components/slider/slider.d.ts +4 -8
  36. package/components/slider/slider.gen.d.ts +293 -0
  37. package/components/toast/index.cjs +2 -9
  38. package/components/toast/index.js +3 -3
  39. package/components/toast/toast.d.ts +6 -9
  40. package/components/toast/toast.gen.d.ts +146 -0
  41. package/config.d.ts +3 -4
  42. package/config.gen.d.ts +47 -0
  43. package/generated/config.cjs +4 -5
  44. package/generated/services/extendWidget.cjs +4 -5
  45. package/generated/services/floatingUI.cjs +4 -5
  46. package/generated/services/focustrack.cjs +4 -5
  47. package/generated/services/hash.cjs +4 -5
  48. package/generated/services/intersection.cjs +4 -5
  49. package/generated/services/matchMedia.cjs +4 -5
  50. package/generated/services/navManager.cjs +4 -5
  51. package/generated/services/portal.cjs +4 -5
  52. package/generated/services/resizeObserver.cjs +4 -5
  53. package/generated/services/siblingsInert.cjs +4 -5
  54. package/generated/services/transitions/baseTransitions.cjs +4 -5
  55. package/generated/services/transitions/bootstrap.cjs +4 -5
  56. package/generated/services/transitions/collapse.cjs +4 -5
  57. package/generated/services/transitions/cssTransitions.cjs +4 -5
  58. package/generated/services/transitions/simpleClassTransition.cjs +4 -5
  59. package/generated/slot.cjs +4 -5
  60. package/generated/types.cjs +4 -5
  61. package/generated/utils/directive.cjs +4 -5
  62. package/generated/utils/portal.cjs +4 -5
  63. package/generated/utils/stores.cjs +4 -5
  64. package/generated/utils/widget.cjs +4 -5
  65. package/generated/utils/writables.cjs +4 -5
  66. package/index.cjs +120 -196
  67. package/index.js +24 -20
  68. package/{modal-2qAV4Hjl.cjs → modal-1m6cSYmZ.cjs} +13 -10
  69. package/{modal-B6rJgzVm.js → modal-BJy1upw0.js} +14 -11
  70. package/package.json +6 -6
  71. package/{pagination-X2bugeX-.js → pagination-B76wbKhG.js} +15 -13
  72. package/{pagination-CKUbq-OI.cjs → pagination-DeZ2Eb3e.cjs} +13 -11
  73. package/{progressbar-D-yo9AHH.cjs → progressbar-DKshX5DJ.cjs} +6 -4
  74. package/{progressbar-D1-6Dzrf.js → progressbar-UDs4TPtQ.js} +8 -6
  75. package/{rating-D2Ajh4vg.cjs → rating-DB4Ze-r4.cjs} +3 -2
  76. package/{rating-Cvad2Z2H.js → rating-DRAx20tg.js} +5 -4
  77. package/{select-B_Thv-qd.js → select-CEXxOyRB.js} +8 -6
  78. package/{select-DHik5ocI.cjs → select-CxX_TdVh.cjs} +6 -4
  79. package/{slider-DLdA-y4u.js → slider-CnK847iw.js} +15 -13
  80. package/{slider-DUv6gRI9.cjs → slider-Du37lWVJ.cjs} +13 -11
  81. package/{toast-BUiyh5r_.js → toast-Bvz7Uyrd.js} +12 -10
  82. package/{toast-Dp_zjIff.cjs → toast-cd5__9Rl.cjs} +10 -8
@@ -3,28 +3,28 @@ import { Slot } from "@agnos-ui/react-headless/slot";
3
3
  import { createContext, forwardRef, useContext, useImperativeHandle, useEffect } from "react";
4
4
  import { useWidgetWithConfig } from "./generated/config.js";
5
5
  import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
6
- import { createAccordion as createAccordion$1 } from "@agnos-ui/core-bootstrap/components/accordion";
6
+ import { createAccordion as createAccordion$1, getAccordionDefaultConfig as getAccordionDefaultConfig$1, createAccordionItem as createAccordionItem$1 } from "@agnos-ui/core-bootstrap/components/accordion";
7
7
  const createAccordion = createAccordion$1;
8
+ const getAccordionDefaultConfig = getAccordionDefaultConfig$1;
9
+ const createAccordionItem = createAccordionItem$1;
8
10
  const Header = (props) => {
9
11
  const re = new RegExp("^h[1-6]$");
10
12
  const Heading = re.test(props.headerTag) ? props.headerTag : "h2";
11
13
  return /* @__PURE__ */ jsx(Heading, { ...useDirectives([classDirective, "accordion-header"], props.directive), children: props.children });
12
14
  };
13
- const ItemContent = (slotContext) => /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "accordion-collapse"], slotContext.widget.directives.bodyContainerDirective), children: /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "accordion-body"], slotContext.widget.directives.bodyDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotItemBody, props: slotContext }) }) });
15
+ const ItemContent = (slotContext) => /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "accordion-collapse"], slotContext.widget.directives.bodyContainerDirective), children: /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "accordion-body"], slotContext.widget.directives.bodyDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.children, props: slotContext }) }) });
14
16
  const AccordionDIContext = createContext({});
15
17
  const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
16
- /* @__PURE__ */ jsx(Header, { directive: slotContext.widget.directives.headerDirective, headerTag: slotContext.state.itemHeadingTag, children: /* @__PURE__ */ jsx("button", { ...useDirectives([classDirective, "accordion-button"], slotContext.widget.directives.buttonDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotItemHeader, props: slotContext }) }) }),
18
+ /* @__PURE__ */ jsx(Header, { directive: slotContext.widget.directives.headerDirective, headerTag: slotContext.state.headingTag, children: /* @__PURE__ */ jsx("button", { ...useDirectives([classDirective, "accordion-button"], slotContext.widget.directives.buttonDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.header, props: slotContext }) }) }),
17
19
  slotContext.state.shouldBeInDOM && /* @__PURE__ */ jsx(ItemContent, { ...slotContext })
18
20
  ] });
19
21
  const defaultConfig = {
20
- slotItemStructure: DefaultSlotStructure
22
+ structure: DefaultSlotStructure
21
23
  };
22
24
  const AccordionItem = forwardRef(
23
25
  function AccordionItem2(props, ref) {
24
26
  const { registerItem } = useContext(AccordionDIContext);
25
- const [state, widget] = useWidgetWithConfig(registerItem, props, null, {
26
- ...defaultConfig
27
- });
27
+ const [state, widget] = useWidgetWithConfig(registerItem, props, null, defaultConfig);
28
28
  const slotContext = {
29
29
  state,
30
30
  widget
@@ -33,7 +33,7 @@ const AccordionItem = forwardRef(
33
33
  useEffect(() => {
34
34
  widget.api.initDone();
35
35
  }, []);
36
- return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, `accordion-item ${state.itemClass}`], widget.directives.accordionItemDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.slotItemStructure, props: slotContext }) });
36
+ return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, `accordion-item ${state.className}`], widget.directives.itemDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.structure, props: slotContext }) });
37
37
  }
38
38
  );
39
39
  const Accordion = forwardRef(
@@ -45,6 +45,8 @@ const Accordion = forwardRef(
45
45
  );
46
46
  export {
47
47
  AccordionItem as A,
48
- Accordion as a,
49
- createAccordion as c
48
+ createAccordionItem as a,
49
+ Accordion as b,
50
+ createAccordion as c,
51
+ getAccordionDefaultConfig as g
50
52
  };
@@ -6,26 +6,26 @@ const generated_config = require("./generated/config.cjs");
6
6
  const directive = require("@agnos-ui/react-headless/utils/directive");
7
7
  const accordion = require("@agnos-ui/core-bootstrap/components/accordion");
8
8
  const createAccordion = accordion.createAccordion;
9
+ const getAccordionDefaultConfig = accordion.getAccordionDefaultConfig;
10
+ const createAccordionItem = accordion.createAccordionItem;
9
11
  const Header = (props) => {
10
12
  const re = new RegExp("^h[1-6]$");
11
13
  const Heading = re.test(props.headerTag) ? props.headerTag : "h2";
12
14
  return /* @__PURE__ */ jsxRuntime.jsx(Heading, { ...directive.useDirectives([directive.classDirective, "accordion-header"], props.directive), children: props.children });
13
15
  };
14
- const ItemContent = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "accordion-collapse"], slotContext.widget.directives.bodyContainerDirective), children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "accordion-body"], slotContext.widget.directives.bodyDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotItemBody, props: slotContext }) }) });
16
+ const ItemContent = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "accordion-collapse"], slotContext.widget.directives.bodyContainerDirective), children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "accordion-body"], slotContext.widget.directives.bodyDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.children, props: slotContext }) }) });
15
17
  const AccordionDIContext = React.createContext({});
16
18
  const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17
- /* @__PURE__ */ jsxRuntime.jsx(Header, { directive: slotContext.widget.directives.headerDirective, headerTag: slotContext.state.itemHeadingTag, children: /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirectives([directive.classDirective, "accordion-button"], slotContext.widget.directives.buttonDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotItemHeader, props: slotContext }) }) }),
19
+ /* @__PURE__ */ jsxRuntime.jsx(Header, { directive: slotContext.widget.directives.headerDirective, headerTag: slotContext.state.headingTag, children: /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirectives([directive.classDirective, "accordion-button"], slotContext.widget.directives.buttonDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.header, props: slotContext }) }) }),
18
20
  slotContext.state.shouldBeInDOM && /* @__PURE__ */ jsxRuntime.jsx(ItemContent, { ...slotContext })
19
21
  ] });
20
22
  const defaultConfig = {
21
- slotItemStructure: DefaultSlotStructure
23
+ structure: DefaultSlotStructure
22
24
  };
23
25
  const AccordionItem = React.forwardRef(
24
26
  function AccordionItem2(props, ref) {
25
27
  const { registerItem } = React.useContext(AccordionDIContext);
26
- const [state, widget] = generated_config.useWidgetWithConfig(registerItem, props, null, {
27
- ...defaultConfig
28
- });
28
+ const [state, widget] = generated_config.useWidgetWithConfig(registerItem, props, null, defaultConfig);
29
29
  const slotContext = {
30
30
  state,
31
31
  widget
@@ -34,7 +34,7 @@ const AccordionItem = React.forwardRef(
34
34
  React.useEffect(() => {
35
35
  widget.api.initDone();
36
36
  }, []);
37
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, `accordion-item ${state.itemClass}`], widget.directives.accordionItemDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.slotItemStructure, props: slotContext }) });
37
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, `accordion-item ${state.className}`], widget.directives.itemDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.structure, props: slotContext }) });
38
38
  }
39
39
  );
40
40
  const Accordion = React.forwardRef(
@@ -47,3 +47,5 @@ const Accordion = React.forwardRef(
47
47
  exports.Accordion = Accordion;
48
48
  exports.AccordionItem = AccordionItem;
49
49
  exports.createAccordion = createAccordion;
50
+ exports.createAccordionItem = createAccordionItem;
51
+ exports.getAccordionDefaultConfig = getAccordionDefaultConfig;
@@ -6,22 +6,13 @@ const directive = require("@agnos-ui/react-headless/utils/directive");
6
6
  const React = require("react");
7
7
  const alert = require("@agnos-ui/core-bootstrap/components/alert");
8
8
  const createAlert = alert.createAlert;
9
- const DefaultSlotStructure = (slotContext) => {
10
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "alert-body", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotDefault, props: slotContext }) }),
12
- slotContext.state.dismissible && /* @__PURE__ */ jsxRuntime.jsx(
13
- "button",
14
- {
15
- type: "button",
16
- className: "btn-close",
17
- onClick: slotContext.widget.api.close,
18
- "aria-label": slotContext.state.ariaCloseButtonLabel
19
- }
20
- )
21
- ] });
22
- };
9
+ const getAlertDefaultConfig = alert.getAlertDefaultConfig;
10
+ const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "alert-body", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
12
+ slotContext.state.dismissible && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "btn-close", onClick: slotContext.widget.api.close, "aria-label": slotContext.state.ariaCloseButtonLabel })
13
+ ] });
23
14
  const defaultConfig = {
24
- slotStructure: DefaultSlotStructure
15
+ structure: DefaultSlotStructure
25
16
  };
26
17
  const AlertElement = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx(
27
18
  "div",
@@ -34,11 +25,11 @@ const AlertElement = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx(
34
25
  ],
35
26
  slotContext.widget.directives.transitionDirective
36
27
  ),
37
- children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotStructure, props: slotContext })
28
+ children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.structure, props: slotContext })
38
29
  }
39
30
  );
40
31
  const Alert = React.forwardRef(function Alert2(props, ref) {
41
- const [state, widget] = generated_config.useWidgetWithConfig(createAlert, props, "alert", { ...defaultConfig, slotDefault: props.children });
32
+ const [state, widget] = generated_config.useWidgetWithConfig(createAlert, props, "alert", defaultConfig);
42
33
  React.useImperativeHandle(ref, () => widget.api, []);
43
34
  const slotContext = {
44
35
  state,
@@ -48,3 +39,4 @@ const Alert = React.forwardRef(function Alert2(props, ref) {
48
39
  });
49
40
  exports.Alert = Alert;
50
41
  exports.createAlert = createAlert;
42
+ exports.getAlertDefaultConfig = getAlertDefaultConfig;
@@ -3,24 +3,15 @@ import { Slot } from "@agnos-ui/react-headless/slot";
3
3
  import { useWidgetWithConfig } from "./generated/config.js";
4
4
  import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
5
5
  import { forwardRef, useImperativeHandle } from "react";
6
- import { createAlert as createAlert$1 } from "@agnos-ui/core-bootstrap/components/alert";
6
+ import { createAlert as createAlert$1, getAlertDefaultConfig as getAlertDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/alert";
7
7
  const createAlert = createAlert$1;
8
- const DefaultSlotStructure = (slotContext) => {
9
- return /* @__PURE__ */ jsxs(Fragment, { children: [
10
- /* @__PURE__ */ jsx("div", { className: "alert-body", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotDefault, props: slotContext }) }),
11
- slotContext.state.dismissible && /* @__PURE__ */ jsx(
12
- "button",
13
- {
14
- type: "button",
15
- className: "btn-close",
16
- onClick: slotContext.widget.api.close,
17
- "aria-label": slotContext.state.ariaCloseButtonLabel
18
- }
19
- )
20
- ] });
21
- };
8
+ const getAlertDefaultConfig = getAlertDefaultConfig$1;
9
+ const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
10
+ /* @__PURE__ */ jsx("div", { className: "alert-body", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
11
+ slotContext.state.dismissible && /* @__PURE__ */ jsx("button", { type: "button", className: "btn-close", onClick: slotContext.widget.api.close, "aria-label": slotContext.state.ariaCloseButtonLabel })
12
+ ] });
22
13
  const defaultConfig = {
23
- slotStructure: DefaultSlotStructure
14
+ structure: DefaultSlotStructure
24
15
  };
25
16
  const AlertElement = (slotContext) => /* @__PURE__ */ jsx(
26
17
  "div",
@@ -33,11 +24,11 @@ const AlertElement = (slotContext) => /* @__PURE__ */ jsx(
33
24
  ],
34
25
  slotContext.widget.directives.transitionDirective
35
26
  ),
36
- children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotStructure, props: slotContext })
27
+ children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.structure, props: slotContext })
37
28
  }
38
29
  );
39
30
  const Alert = forwardRef(function Alert2(props, ref) {
40
- const [state, widget] = useWidgetWithConfig(createAlert, props, "alert", { ...defaultConfig, slotDefault: props.children });
31
+ const [state, widget] = useWidgetWithConfig(createAlert, props, "alert", defaultConfig);
41
32
  useImperativeHandle(ref, () => widget.api, []);
42
33
  const slotContext = {
43
34
  state,
@@ -47,5 +38,6 @@ const Alert = forwardRef(function Alert2(props, ref) {
47
38
  });
48
39
  export {
49
40
  Alert as A,
50
- createAlert as c
41
+ createAlert as c,
42
+ getAlertDefaultConfig as g
51
43
  };
@@ -1,15 +1,9 @@
1
1
  import type { ForwardRefExoticComponent, PropsWithChildren, RefAttributes } from 'react';
2
- import type { AdaptSlotContentProps, AdaptWidgetSlots, WidgetFactory, WidgetProps, WidgetState } from '@agnos-ui/react-headless/types';
3
- import type { AccordionItemApi } from '@agnos-ui/core-bootstrap/components/accordion';
4
- export * from '@agnos-ui/core-bootstrap/components/accordion';
5
- export type AccordionWidget = AdaptWidgetSlots<import('@agnos-ui/core-bootstrap/components/accordion').AccordionWidget>;
6
- export type AccordionProps = WidgetProps<AccordionWidget>;
7
- export type AccordionState = WidgetState<AccordionWidget>;
8
- export type AccordionApi = AccordionWidget['api'];
9
- export type AccordionItemWidget = AdaptWidgetSlots<import('@agnos-ui/core-bootstrap/components/accordion').AccordionItemWidget>;
10
- export type AccordionItemProps = WidgetProps<AccordionItemWidget>;
11
- export type AccordionItemState = WidgetState<AccordionItemWidget>;
12
- export type AccordionItemContext = AdaptSlotContentProps<import('@agnos-ui/core-bootstrap/components/accordion').AccordionItemContext>;
2
+ import type { WidgetFactory } from '@agnos-ui/react-headless/types';
3
+ import type { AccordionWidget, AccordionApi, AccordionItemProps, AccordionProps, AccordionItemApi, AccordionItemWidget } from './accordion.gen';
4
+ export type * from './accordion.gen';
13
5
  export declare const createAccordion: WidgetFactory<AccordionWidget>;
14
- export declare const AccordionItem: ForwardRefExoticComponent<PropsWithChildren<Partial<AccordionItemProps>> & RefAttributes<AccordionItemApi>>;
6
+ export declare const getAccordionDefaultConfig: () => AccordionProps;
7
+ export declare const createAccordionItem: WidgetFactory<AccordionItemWidget>;
8
+ export declare const AccordionItem: ForwardRefExoticComponent<Partial<AccordionItemProps> & RefAttributes<AccordionItemApi>>;
15
9
  export declare const Accordion: ForwardRefExoticComponent<PropsWithChildren<Partial<AccordionProps>> & RefAttributes<AccordionApi>>;
@@ -0,0 +1,343 @@
1
+ import type { WidgetSlotContext, SlotContent, Widget, PropsConfig, Directive } from '@agnos-ui/react-headless/types';
2
+ import type { TransitionFn } from '@agnos-ui/react-headless/services/transitions/baseTransitions';
3
+ export type AccordionItemContext = WidgetSlotContext<AccordionItemWidget>;
4
+ export interface AccordionState {
5
+ /**
6
+ * Array containing all the accordion-items contained in the accordion.
7
+ */
8
+ itemWidgets: AccordionItemWidget[];
9
+ /**
10
+ * CSS classes to be applied on the widget main container
11
+ */
12
+ className: string;
13
+ /**
14
+ * Structure of the accordion-item. The default item structure is: accordion-item
15
+ * contains accordion header and accordion-item body container; the accordion header contains the accordion button
16
+ * (that contains `header`), while the accordion-item body container contains the accordion body (that contains `children`).
17
+ * The itemTransition is applied on this element.
18
+ *
19
+ * It is a prop of the accordion-item.
20
+ */
21
+ itemStructure: SlotContent<AccordionItemContext>;
22
+ }
23
+ export interface AccordionProps {
24
+ /**
25
+ * If `true`, only one accordion-item at the time can stay open.
26
+ */
27
+ closeOthers: boolean;
28
+ /**
29
+ * An event fired when an item is shown.
30
+ *
31
+ * Event payload is the id of the item.
32
+ */
33
+ onItemShown: (itemId: string) => void;
34
+ /**
35
+ * An event fired when an item is hidden.
36
+ *
37
+ * Event payload is the id of the item.
38
+ */
39
+ onItemHidden: (itemId: string) => void;
40
+ /**
41
+ * If `true`, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
42
+ */
43
+ itemDestroyOnHide: boolean;
44
+ /**
45
+ * If `true`, accordion-item will be animated.
46
+ */
47
+ itemAnimated: boolean;
48
+ /**
49
+ * The transition to use for the accordion-item body-container when the accordion-item is toggled.
50
+ */
51
+ itemTransition: TransitionFn;
52
+ /**
53
+ * CSS classes to add on the accordion-item DOM element.
54
+ */
55
+ itemClassName: string;
56
+ /**
57
+ * CSS classes to add on the accordion-item header DOM element.
58
+ */
59
+ itemHeaderClassName: string;
60
+ /**
61
+ * CSS classes to add on the accordion-item toggle button DOM element.
62
+ */
63
+ itemButtonClassName: string;
64
+ /**
65
+ * CSS classes to add on the accordion-item body container DOM element.
66
+ * The accordion-item body container is the DOM element on what the itemTransition is applied.
67
+ */
68
+ itemBodyContainerClassName: string;
69
+ /**
70
+ * CSS classes to add on the accordion-item body DOM element.
71
+ */
72
+ itemBodyClassName: string;
73
+ /**
74
+ * The html tag to use for the accordion-item-header.
75
+ */
76
+ itemHeadingTag: string;
77
+ /**
78
+ * CSS classes to be applied on the widget main container
79
+ */
80
+ className: string;
81
+ /**
82
+ * Structure of the accordion-item. The default item structure is: accordion-item
83
+ * contains accordion header and accordion-item body container; the accordion header contains the accordion button
84
+ * (that contains `header`), while the accordion-item body container contains the accordion body (that contains `children`).
85
+ * The itemTransition is applied on this element.
86
+ *
87
+ * It is a prop of the accordion-item.
88
+ */
89
+ itemStructure: SlotContent<AccordionItemContext>;
90
+ }
91
+ export type AccordionWidget = Widget<AccordionProps, AccordionState, AccordionApi, object, AccordionDirectives>;
92
+ export interface AccordionItemState {
93
+ /**
94
+ * If `true` the content of the accordion-item collapse should be in DOM. Its value depends on the
95
+ * value of the `visible` and `destroyOnHide`.
96
+ */
97
+ shouldBeInDOM: boolean;
98
+ /**
99
+ * If `true`, the accordion-item will be visible (expanded). Otherwise, it will be hidden (collapsed).
100
+ */
101
+ visible: boolean;
102
+ /**
103
+ * If `true`, the accordion-item will be disabled.
104
+ * It will not react to user's clicks, but still will be possible to toggle programmatically.
105
+ */
106
+ disabled: boolean;
107
+ /**
108
+ * The id of the accordion-item. It can be used for controlling the accordion-item via the accordion api.
109
+ */
110
+ id: string;
111
+ /**
112
+ * CSS classes to add on the accordion-item header DOM element.
113
+ */
114
+ headerClassName: string;
115
+ /**
116
+ * CSS classes to add on the accordion-item collapse DOM element.
117
+ */
118
+ buttonClassName: string;
119
+ /**
120
+ * CSS classes to add on the accordion-item body container DOM element.
121
+ * The accordion-item body container is the DOM element on what the itemTransition is applied.
122
+ */
123
+ bodyContainerClassName: string;
124
+ /**
125
+ * CSS classes to add on the accordion-item body DOM element.
126
+ */
127
+ bodyClassName: string;
128
+ /**
129
+ * The html tag to use for the accordion-item-header.
130
+ */
131
+ headingTag: string;
132
+ /**
133
+ * CSS classes to be applied on the widget main container
134
+ */
135
+ className: string;
136
+ /**
137
+ * Structure of the accordion-item. The default item structure is: accordion-item
138
+ * contains accordion header and accordion-item body container; the accordion header contains the accordion button
139
+ * (that contains `header`), while the accordion-item body container contains the accordion body (that contains `children`).
140
+ * The itemTransition is applied on this element.
141
+ *
142
+ * It is a prop of the accordion-item.
143
+ */
144
+ structure: SlotContent<AccordionItemContext>;
145
+ /**
146
+ * Content present in the accordion body.
147
+ *
148
+ * It is a prop of the accordion-item.
149
+ */
150
+ children: SlotContent<AccordionItemContext>;
151
+ /**
152
+ * Content present in the accordion button inside the accordion header.
153
+ *
154
+ * It is a prop of the accordion-item.
155
+ */
156
+ header: SlotContent<AccordionItemContext>;
157
+ }
158
+ export interface AccordionItemProps {
159
+ /**
160
+ * If `true`, accordion-item will be animated.
161
+ */
162
+ animated: boolean;
163
+ /**
164
+ * The transition to use for the accordion-item body-container when the accordion-item is toggled.
165
+ */
166
+ transition: TransitionFn;
167
+ /**
168
+ * If `true`, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
169
+ */
170
+ destroyOnHide: boolean;
171
+ /**
172
+ * An event fired when an item is shown.
173
+ */
174
+ onShown: () => void;
175
+ /**
176
+ * An event fired when an item is hidden.
177
+ */
178
+ onHidden: () => void;
179
+ /**
180
+ * An event fired when the `visible` value changes.
181
+ *
182
+ * Event payload is the new value of visible.
183
+ */
184
+ onVisibleChange: (visible: boolean) => void;
185
+ /**
186
+ * If `true`, the accordion-item will be visible (expanded). Otherwise, it will be hidden (collapsed).
187
+ */
188
+ visible: boolean;
189
+ /**
190
+ * If `true`, the accordion-item will be disabled.
191
+ * It will not react to user's clicks, but still will be possible to toggle programmatically.
192
+ */
193
+ disabled: boolean;
194
+ /**
195
+ * The id of the accordion-item. It can be used for controlling the accordion-item via the accordion api.
196
+ */
197
+ id: string;
198
+ /**
199
+ * CSS classes to add on the accordion-item header DOM element.
200
+ */
201
+ headerClassName: string;
202
+ /**
203
+ * CSS classes to add on the accordion-item collapse DOM element.
204
+ */
205
+ buttonClassName: string;
206
+ /**
207
+ * CSS classes to add on the accordion-item body container DOM element.
208
+ * The accordion-item body container is the DOM element on what the itemTransition is applied.
209
+ */
210
+ bodyContainerClassName: string;
211
+ /**
212
+ * CSS classes to add on the accordion-item body DOM element.
213
+ */
214
+ bodyClassName: string;
215
+ /**
216
+ * The html tag to use for the accordion-item-header.
217
+ */
218
+ headingTag: string;
219
+ /**
220
+ * CSS classes to be applied on the widget main container
221
+ */
222
+ className: string;
223
+ /**
224
+ * Structure of the accordion-item. The default item structure is: accordion-item
225
+ * contains accordion header and accordion-item body container; the accordion header contains the accordion button
226
+ * (that contains `header`), while the accordion-item body container contains the accordion body (that contains `children`).
227
+ * The itemTransition is applied on this element.
228
+ *
229
+ * It is a prop of the accordion-item.
230
+ */
231
+ structure: SlotContent<AccordionItemContext>;
232
+ /**
233
+ * Content present in the accordion body.
234
+ *
235
+ * It is a prop of the accordion-item.
236
+ */
237
+ children: SlotContent<AccordionItemContext>;
238
+ /**
239
+ * Content present in the accordion button inside the accordion header.
240
+ *
241
+ * It is a prop of the accordion-item.
242
+ */
243
+ header: SlotContent<AccordionItemContext>;
244
+ }
245
+ export type AccordionItemWidget = Widget<AccordionItemProps, AccordionItemState, AccordionItemApi, AccordionItemActions, AccordionItemDirectives>;
246
+ export interface AccordionApi {
247
+ /**
248
+ * Given the itemId, will expand the corresponding accordion-item.
249
+ *
250
+ * If the itemId is not valid, nothing will happen.
251
+ */
252
+ expand(itemId: string): void;
253
+ /**
254
+ * Given the itemId, will collapse the corresponding accordion-item.
255
+ *
256
+ * If the itemId is not valid, nothing will happen.
257
+ */
258
+ collapse(itemId: string): void;
259
+ /**
260
+ * Given the itemId, will toggle the corresponding accordion-item.
261
+ *
262
+ * If the itemId is not valid, nothing will happen.
263
+ */
264
+ toggle(itemId: string): void;
265
+ /**
266
+ * It will expand all the items in the accordion.
267
+ *
268
+ * If `closeOthers` is `true` it will expand only the last accordion-item.
269
+ */
270
+ expandAll(): void;
271
+ /**
272
+ * It will collapse all the accordion-items in the accordion.
273
+ */
274
+ collapseAll(): void;
275
+ /**
276
+ * Creates a new accordionItem.
277
+ */
278
+ registerItem(itemConfig?: PropsConfig<AccordionItemProps>): AccordionItemWidget;
279
+ }
280
+ export interface AccordionDirectives {
281
+ /**
282
+ * Directive to put on the accordion DOM element
283
+ */
284
+ accordionDirective: Directive;
285
+ }
286
+ export interface AccordionItemActions {
287
+ /**
288
+ * Action to be called when the user clicks on the accordion-item button. If the accordion-item is disabled nothing will happen.
289
+ */
290
+ click(): void;
291
+ }
292
+ export interface AccordionItemApi {
293
+ /**
294
+ * It will collapse the accordion-item.
295
+ */
296
+ collapse(): void;
297
+ /**
298
+ * It will expand the accordion-item.
299
+ */
300
+ expand(): void;
301
+ /**
302
+ * It will toggle the accordion-item.
303
+ */
304
+ toggle(): void;
305
+ /**
306
+ * Method to be called after the initialization to allow animations.
307
+ */
308
+ initDone(): void;
309
+ }
310
+ export interface AccordionItemDirectives {
311
+ /**
312
+ * Directive to use in special cases, if the accordion header does not use a button element to control the collapsing.
313
+ */
314
+ toggleDirective: Directive;
315
+ /**
316
+ * Directive to put on the button element that will control the collapsing of the accordion-item.
317
+ */
318
+ buttonDirective: Directive;
319
+ /**
320
+ * Directive to put on the accordion-item header that will contain the button element.
321
+ */
322
+ headerDirective: Directive;
323
+ /**
324
+ * Directive to put on the accordion-item body.
325
+ */
326
+ bodyDirective: Directive;
327
+ /**
328
+ * Directive to apply the itemTransition
329
+ */
330
+ transitionDirective: Directive;
331
+ /**
332
+ * Directive to apply aria attributes to the expanded body panel
333
+ */
334
+ bodyContainerAttrsDirective: Directive;
335
+ /**
336
+ * Directive to be put on the accordion-item body container. It will handle the animation.
337
+ */
338
+ bodyContainerDirective: Directive;
339
+ /**
340
+ * Directive to be put on the accordion-item. It will handle adding the accordion-item to the accordion.
341
+ */
342
+ itemDirective: Directive;
343
+ }
@@ -1,14 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const accordion = require("../../accordion-BaQCaLLI.cjs");
4
- const accordion$1 = require("@agnos-ui/core-bootstrap/components/accordion");
3
+ const accordion = require("../../accordion-DnlQmoOX.cjs");
5
4
  exports.Accordion = accordion.Accordion;
6
5
  exports.AccordionItem = accordion.AccordionItem;
7
6
  exports.createAccordion = accordion.createAccordion;
8
- Object.keys(accordion$1).forEach((k) => {
9
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
10
- Object.defineProperty(exports, k, {
11
- enumerable: true,
12
- get: () => accordion$1[k]
13
- });
14
- });
7
+ exports.createAccordionItem = accordion.createAccordionItem;
8
+ exports.getAccordionDefaultConfig = accordion.getAccordionDefaultConfig;
@@ -1,7 +1,8 @@
1
- import { a, A, c } from "../../accordion-Bpx0new2.js";
2
- export * from "@agnos-ui/core-bootstrap/components/accordion";
1
+ import { b, A, c, a, g } from "../../accordion-CMbgQzoG.js";
3
2
  export {
4
- a as Accordion,
3
+ b as Accordion,
5
4
  A as AccordionItem,
6
- c as createAccordion
5
+ c as createAccordion,
6
+ a as createAccordionItem,
7
+ g as getAccordionDefaultConfig
7
8
  };
@@ -1,10 +1,7 @@
1
- import type { PropsWithChildren, ForwardRefExoticComponent, RefAttributes } from 'react';
2
- import type { AlertApi } from '@agnos-ui/core-bootstrap/components/alert';
3
- import type { AdaptSlotContentProps, AdaptWidgetSlots, WidgetFactory, WidgetProps, WidgetState } from '@agnos-ui/react-headless/types';
4
- export * from '@agnos-ui/core-bootstrap/components/alert';
5
- export type AlertWidget = AdaptWidgetSlots<import('@agnos-ui/core-bootstrap/components/alert').AlertWidget>;
6
- export type AlertProps = WidgetProps<AlertWidget>;
7
- export type AlertState = WidgetState<AlertWidget>;
8
- export type AlertContext = AdaptSlotContentProps<import('@agnos-ui/core-bootstrap/components/alert').AlertContext>;
1
+ import type { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ import type { WidgetFactory } from '@agnos-ui/react-headless/types';
3
+ import type { AlertProps, AlertWidget, AlertApi } from './alert.gen';
4
+ export type * from './alert.gen';
9
5
  export declare const createAlert: WidgetFactory<AlertWidget>;
10
- export declare const Alert: ForwardRefExoticComponent<PropsWithChildren<Partial<AlertProps>> & RefAttributes<AlertApi>>;
6
+ export declare const getAlertDefaultConfig: () => AlertProps;
7
+ export declare const Alert: ForwardRefExoticComponent<Partial<AlertProps> & RefAttributes<AlertApi>>;