@agnos-ui/react-bootstrap 0.4.3 → 0.5.0-next.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 (69) hide show
  1. package/README.md +2 -2
  2. package/{accordion-DKdL2Sr3.js → accordion-BX1iR5BO.js} +19 -22
  3. package/{accordion-CG9yl3xh.cjs → accordion-CxT3atuW.cjs} +12 -15
  4. package/{alert-0W1n8ahW.js → alert-D1FXDsJn.js} +12 -16
  5. package/{alert-DeQRFTm3.cjs → alert-LKMMYmg_.cjs} +9 -13
  6. package/collapse-BpPYsx89.cjs +18 -0
  7. package/collapse-DhsL8j2h.js +19 -0
  8. package/components/accordion/accordion.d.ts +40 -1
  9. package/components/accordion/accordion.gen.d.ts +37 -9
  10. package/components/accordion/index.cjs +2 -1
  11. package/components/accordion/index.js +7 -6
  12. package/components/alert/alert.d.ts +19 -1
  13. package/components/alert/alert.gen.d.ts +21 -2
  14. package/components/alert/index.cjs +2 -1
  15. package/components/alert/index.js +4 -3
  16. package/components/collapse/collapse.d.ts +15 -0
  17. package/components/collapse/collapse.gen.d.ts +146 -0
  18. package/components/collapse/index.cjs +6 -0
  19. package/components/collapse/index.d.ts +2 -0
  20. package/components/collapse/index.js +6 -0
  21. package/components/modal/index.cjs +3 -1
  22. package/components/modal/index.js +7 -5
  23. package/components/modal/modal.d.ts +34 -1
  24. package/components/modal/modal.gen.d.ts +35 -18
  25. package/components/pagination/index.cjs +3 -3
  26. package/components/pagination/index.js +5 -5
  27. package/components/pagination/pageItem.d.ts +35 -3
  28. package/components/pagination/pagination.d.ts +34 -2
  29. package/components/pagination/pagination.gen.d.ts +49 -29
  30. package/components/progressbar/index.cjs +2 -1
  31. package/components/progressbar/index.js +4 -3
  32. package/components/progressbar/progressbar.d.ts +16 -1
  33. package/components/progressbar/progressbar.gen.d.ts +21 -4
  34. package/components/rating/index.cjs +1 -1
  35. package/components/rating/index.js +1 -1
  36. package/components/rating/rating.d.ts +11 -0
  37. package/components/rating/rating.gen.d.ts +25 -17
  38. package/components/select/index.cjs +1 -1
  39. package/components/select/index.js +1 -1
  40. package/components/select/select.d.ts +15 -0
  41. package/components/select/select.gen.d.ts +41 -25
  42. package/components/slider/index.cjs +3 -3
  43. package/components/slider/index.js +5 -5
  44. package/components/slider/slider.d.ts +26 -2
  45. package/components/slider/slider.gen.d.ts +54 -33
  46. package/components/toast/index.cjs +2 -1
  47. package/components/toast/index.js +4 -3
  48. package/components/toast/toast.d.ts +20 -1
  49. package/components/toast/toast.gen.d.ts +22 -2
  50. package/config.d.ts +9 -2
  51. package/config.gen.d.ts +5 -0
  52. package/index.cjs +26 -16
  53. package/index.d.ts +1 -0
  54. package/index.js +51 -41
  55. package/{modal-qidZ4ghL.js → modal-CWuYx5n5.js} +23 -29
  56. package/{modal-Cyt40iyH.cjs → modal-DpMvOtL2.cjs} +17 -23
  57. package/package.json +6 -5
  58. package/{pagination-BDq1dOoH.js → pagination-5jlJWfFj.js} +19 -22
  59. package/{pagination-ChA90-py.cjs → pagination-b4pKj3Kx.cjs} +17 -20
  60. package/{progressbar-B0keLNtE.js → progressbar-DKFR5epE.js} +9 -10
  61. package/{progressbar-Fa1PDviu.cjs → progressbar-JO1ey9mx.cjs} +7 -8
  62. package/{rating-CWOEBPWs.js → rating-CTfRQGGu.js} +2 -2
  63. package/{rating-D5-3ELHv.cjs → rating-eI8T0zvS.cjs} +2 -2
  64. package/{select-DmgOBdqs.js → select-BriGqe3k.js} +15 -32
  65. package/{select-C4STYCmG.cjs → select-XHUAqTDw.cjs} +15 -32
  66. package/{slider-CxodlRoZ.js → slider--K7ri_0l.js} +18 -21
  67. package/{slider-MNZTN_vu.cjs → slider-BUQne5aJ.cjs} +16 -19
  68. package/{toast-3amUxqw1.js → toast-Dgfv5S_p.js} +16 -19
  69. package/{toast-BXMjE9E3.cjs → toast-E1DM85iZ.cjs} +13 -16
@@ -1,27 +1,26 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
- import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
4
3
  import { useDirective } from "@agnos-ui/react-headless/utils/directive";
5
4
  import classNames from "classnames";
6
5
  import { useWidgetWithConfig } from "./generated/config.js";
7
6
  import { getProgressbarDefaultConfig, createProgressbar } from "@agnos-ui/core-bootstrap/components/progressbar";
8
7
  const export_getProgressbarDefaultConfig = getProgressbarDefaultConfig;
9
8
  const export_createProgressbar = createProgressbar;
10
- function DefaultSlotContent(slotContext) {
9
+ const ProgressbarDefaultSlotStructure = (slotContext) => {
11
10
  const { striped, animated, type } = slotContext.state;
12
11
  const classes = classNames("progress-bar", { "progress-bar-striped": striped }, { "progress-bar-animated": animated }, { [`text-bg-${type}`]: !!type });
13
12
  return /* @__PURE__ */ jsx("div", { className: "progress", style: { height: slotContext.state.height || void 0 }, children: /* @__PURE__ */ jsx("div", { className: classes, style: { width: `${slotContext.state.percentage}%` }, children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.children, props: slotContext }) }) });
14
- }
15
- const defaultConfig = {
16
- structure: DefaultSlotContent
17
13
  };
18
14
  const Progressbar = (props) => {
19
- const [state, widget] = useWidgetWithConfig(export_createProgressbar, props, "progressbar", defaultConfig);
20
- const slotContext = { state, widget: toSlotContextWidget(widget) };
21
- return /* @__PURE__ */ jsx("div", { ...useDirective(widget.directives.ariaDirective), className: state.className || void 0, children: /* @__PURE__ */ jsx(Slot, { slotContent: state.structure, props: slotContext }) });
15
+ const widgetContext = useWidgetWithConfig(export_createProgressbar, props, "progressbar", {
16
+ structure: ProgressbarDefaultSlotStructure
17
+ });
18
+ const { state, directives } = widgetContext;
19
+ return /* @__PURE__ */ jsx("div", { ...useDirective(directives.ariaDirective), className: state.className || void 0, children: /* @__PURE__ */ jsx(Slot, { slotContent: state.structure, props: widgetContext }) });
22
20
  };
23
21
  export {
24
- Progressbar as P,
25
- export_createProgressbar as a,
22
+ ProgressbarDefaultSlotStructure as P,
23
+ Progressbar as a,
24
+ export_createProgressbar as b,
26
25
  export_getProgressbarDefaultConfig as e
27
26
  };
@@ -1,26 +1,25 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const slot = require("@agnos-ui/react-headless/slot");
4
- const types = require("@agnos-ui/react-headless/types");
5
4
  const directive = require("@agnos-ui/react-headless/utils/directive");
6
5
  const classNames = require("classnames");
7
6
  const generated_config = require("./generated/config.cjs");
8
7
  const progressbar = require("@agnos-ui/core-bootstrap/components/progressbar");
9
8
  const export_getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
10
9
  const export_createProgressbar = progressbar.createProgressbar;
11
- function DefaultSlotContent(slotContext) {
10
+ const ProgressbarDefaultSlotStructure = (slotContext) => {
12
11
  const { striped, animated, type } = slotContext.state;
13
12
  const classes = classNames("progress-bar", { "progress-bar-striped": striped }, { "progress-bar-animated": animated }, { [`text-bg-${type}`]: !!type });
14
13
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "progress", style: { height: slotContext.state.height || void 0 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, style: { width: `${slotContext.state.percentage}%` }, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.children, props: slotContext }) }) });
15
- }
16
- const defaultConfig = {
17
- structure: DefaultSlotContent
18
14
  };
19
15
  const Progressbar = (props) => {
20
- const [state, widget] = generated_config.useWidgetWithConfig(export_createProgressbar, props, "progressbar", defaultConfig);
21
- const slotContext = { state, widget: types.toSlotContextWidget(widget) };
22
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(widget.directives.ariaDirective), className: state.className || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.structure, props: slotContext }) });
16
+ const widgetContext = generated_config.useWidgetWithConfig(export_createProgressbar, props, "progressbar", {
17
+ structure: ProgressbarDefaultSlotStructure
18
+ });
19
+ const { state, directives } = widgetContext;
20
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(directives.ariaDirective), className: state.className || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.structure, props: widgetContext }) });
23
21
  };
24
22
  exports.Progressbar = Progressbar;
23
+ exports.ProgressbarDefaultSlotStructure = ProgressbarDefaultSlotStructure;
25
24
  exports.export_createProgressbar = export_createProgressbar;
26
25
  exports.export_getProgressbarDefaultConfig = export_getProgressbarDefaultConfig;
@@ -18,10 +18,10 @@ function Star({ star, state, directive }) {
18
18
  ] }, star.index);
19
19
  }
20
20
  function Rating(props) {
21
- const [state, widget] = useWidgetWithConfig(export_createRating, props, "rating");
22
21
  const {
22
+ state,
23
23
  directives: { containerDirective, starDirective }
24
- } = widget;
24
+ } = useWidgetWithConfig(export_createRating, props, "rating");
25
25
  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
26
  }
27
27
  export {
@@ -19,10 +19,10 @@ function Star({ star, state, directive: directive$1 }) {
19
19
  ] }, star.index);
20
20
  }
21
21
  function Rating(props) {
22
- const [state, widget] = generated_config.useWidgetWithConfig(export_createRating, props, "rating");
23
22
  const {
23
+ state,
24
24
  directives: { containerDirective, starDirective }
25
- } = widget;
25
+ } = generated_config.useWidgetWithConfig(export_createRating, props, "rating");
26
26
  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
27
  }
28
28
  exports.Rating = Rating;
@@ -1,6 +1,5 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
- import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
4
3
  import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-headless/utils/directive";
5
4
  import classNames from "classnames";
6
5
  import { useWidgetWithConfig } from "./generated/config.js";
@@ -14,7 +13,7 @@ function DefaultItem(slotContext) {
14
13
  return /* @__PURE__ */ jsx(Fragment, { children: "" + slotContext.itemContext.item });
15
14
  }
16
15
  function BadgeContainer({ itemContext, slotContext }) {
17
- return /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.badgeAttributesDirective, itemContext), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.badgeLabel, props: { ...slotContext, itemContext } }) });
16
+ return /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.directives.badgeAttributesDirective, itemContext), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.badgeLabel, props: { ...slotContext, itemContext } }) });
18
17
  }
19
18
  function Badges({ slotContext }) {
20
19
  const badges = [];
@@ -25,49 +24,33 @@ function Badges({ slotContext }) {
25
24
  }
26
25
  function SelectItem({ itemContext, slotContext }) {
27
26
  const classname = classNames("dropdown-item", "position-relative", { "text-bg-primary": itemContext === slotContext.state.highlighted });
28
- return /* @__PURE__ */ jsx("li", { className: classname, ...useDirective(slotContext.widget.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.itemLabel, props: { ...slotContext, itemContext } }) });
27
+ return /* @__PURE__ */ jsx("li", { className: classname, ...useDirective(slotContext.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.itemLabel, props: { ...slotContext, itemContext } }) });
29
28
  }
30
29
  function Rows({ slotContext }) {
31
30
  const {
32
31
  directives: { hasFocusDirective, floatingDirective, menuAttributesDirective }
33
- } = slotContext.widget;
32
+ } = slotContext;
34
33
  return /* @__PURE__ */ jsx("ul", { ...useDirectives([classDirective, "dropdown-menu show"], hasFocusDirective, floatingDirective, menuAttributesDirective), children: slotContext.state.visibleItems.map((itemContext) => {
35
34
  return /* @__PURE__ */ jsx(SelectItem, { slotContext, itemContext }, itemContext.id);
36
35
  }) });
37
36
  }
38
- const defaultConfig = {
39
- badgeLabel: DefaultBadge,
40
- itemLabel: DefaultItem
41
- };
42
37
  function Select(props) {
43
- const [state, widget] = useWidgetWithConfig(export_createSelect, props, "select", defaultConfig);
44
- const slotContext = { state, widget: toSlotContextWidget(widget) };
45
- const { id, ariaLabel, visibleItems, filterText, open, className } = state;
46
- const menuId = `${id}-menu`;
38
+ const widgetContext = useWidgetWithConfig(export_createSelect, props, "select", {
39
+ badgeLabel: DefaultBadge,
40
+ itemLabel: DefaultItem
41
+ });
47
42
  const {
48
- directives: { hasFocusDirective, referenceDirective, inputContainerDirective }
49
- } = widget;
43
+ state: { id, visibleItems, filterText, open, className },
44
+ directives: { hasFocusDirective, referenceDirective, inputContainerDirective, inputDirective }
45
+ } = widgetContext;
46
+ const menuId = `${id}-menu`;
50
47
  return /* @__PURE__ */ jsxs("div", { ...useDirectives([classDirective, `au-select dropdown border border-1 p-1 mb-3 d-block ${className}`], referenceDirective), children: [
51
48
  /* @__PURE__ */ jsxs("div", { ...useDirectives([classDirective, "d-flex align-items-center flex-wrap gap-1"], hasFocusDirective, inputContainerDirective), children: [
52
- /* @__PURE__ */ jsx(Badges, { slotContext }),
53
- /* @__PURE__ */ jsx(
54
- "input",
55
- {
56
- id,
57
- "aria-label": ariaLabel,
58
- className: "au-select-input flex-grow-1 border-0",
59
- type: "text",
60
- value: filterText,
61
- "aria-autocomplete": "list",
62
- autoCorrect: "off",
63
- autoCapitalize: "none",
64
- autoComplete: "off",
65
- onInput: widget.actions.onInput,
66
- onKeyDown: (e) => widget.actions.onInputKeydown(e.nativeEvent)
67
- }
68
- )
49
+ /* @__PURE__ */ jsx(Badges, { slotContext: widgetContext }),
50
+ /* @__PURE__ */ jsx("input", { value: filterText, ...useDirective(inputDirective), onChange: () => {
51
+ } })
69
52
  ] }),
70
- open && visibleItems.length > 0 && /* @__PURE__ */ jsx(Rows, { slotContext, menuId })
53
+ open && visibleItems.length > 0 && /* @__PURE__ */ jsx(Rows, { slotContext: widgetContext, menuId })
71
54
  ] });
72
55
  }
73
56
  export {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const slot = require("@agnos-ui/react-headless/slot");
4
- const types = require("@agnos-ui/react-headless/types");
5
4
  const directive = require("@agnos-ui/react-headless/utils/directive");
6
5
  const classNames = require("classnames");
7
6
  const generated_config = require("./generated/config.cjs");
@@ -15,7 +14,7 @@ function DefaultItem(slotContext) {
15
14
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "" + slotContext.itemContext.item });
16
15
  }
17
16
  function BadgeContainer({ itemContext, slotContext }) {
18
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.badgeAttributesDirective, itemContext), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.badgeLabel, props: { ...slotContext, itemContext } }) });
17
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.directives.badgeAttributesDirective, itemContext), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.badgeLabel, props: { ...slotContext, itemContext } }) });
19
18
  }
20
19
  function Badges({ slotContext }) {
21
20
  const badges = [];
@@ -26,49 +25,33 @@ function Badges({ slotContext }) {
26
25
  }
27
26
  function SelectItem({ itemContext, slotContext }) {
28
27
  const classname = classNames("dropdown-item", "position-relative", { "text-bg-primary": itemContext === slotContext.state.highlighted });
29
- return /* @__PURE__ */ jsxRuntime.jsx("li", { className: classname, ...directive.useDirective(slotContext.widget.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.itemLabel, props: { ...slotContext, itemContext } }) });
28
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { className: classname, ...directive.useDirective(slotContext.directives.itemAttributesDirective, itemContext), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.itemLabel, props: { ...slotContext, itemContext } }) });
30
29
  }
31
30
  function Rows({ slotContext }) {
32
31
  const {
33
32
  directives: { hasFocusDirective, floatingDirective, menuAttributesDirective }
34
- } = slotContext.widget;
33
+ } = slotContext;
35
34
  return /* @__PURE__ */ jsxRuntime.jsx("ul", { ...directive.useDirectives([directive.classDirective, "dropdown-menu show"], hasFocusDirective, floatingDirective, menuAttributesDirective), children: slotContext.state.visibleItems.map((itemContext) => {
36
35
  return /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { slotContext, itemContext }, itemContext.id);
37
36
  }) });
38
37
  }
39
- const defaultConfig = {
40
- badgeLabel: DefaultBadge,
41
- itemLabel: DefaultItem
42
- };
43
38
  function Select(props) {
44
- const [state, widget] = generated_config.useWidgetWithConfig(export_createSelect, props, "select", defaultConfig);
45
- const slotContext = { state, widget: types.toSlotContextWidget(widget) };
46
- const { id, ariaLabel, visibleItems, filterText, open, className } = state;
47
- const menuId = `${id}-menu`;
39
+ const widgetContext = generated_config.useWidgetWithConfig(export_createSelect, props, "select", {
40
+ badgeLabel: DefaultBadge,
41
+ itemLabel: DefaultItem
42
+ });
48
43
  const {
49
- directives: { hasFocusDirective, referenceDirective, inputContainerDirective }
50
- } = widget;
44
+ state: { id, visibleItems, filterText, open, className },
45
+ directives: { hasFocusDirective, referenceDirective, inputContainerDirective, inputDirective }
46
+ } = widgetContext;
47
+ const menuId = `${id}-menu`;
51
48
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...directive.useDirectives([directive.classDirective, `au-select dropdown border border-1 p-1 mb-3 d-block ${className}`], referenceDirective), children: [
52
49
  /* @__PURE__ */ jsxRuntime.jsxs("div", { ...directive.useDirectives([directive.classDirective, "d-flex align-items-center flex-wrap gap-1"], hasFocusDirective, inputContainerDirective), children: [
53
- /* @__PURE__ */ jsxRuntime.jsx(Badges, { slotContext }),
54
- /* @__PURE__ */ jsxRuntime.jsx(
55
- "input",
56
- {
57
- id,
58
- "aria-label": ariaLabel,
59
- className: "au-select-input flex-grow-1 border-0",
60
- type: "text",
61
- value: filterText,
62
- "aria-autocomplete": "list",
63
- autoCorrect: "off",
64
- autoCapitalize: "none",
65
- autoComplete: "off",
66
- onInput: widget.actions.onInput,
67
- onKeyDown: (e) => widget.actions.onInputKeydown(e.nativeEvent)
68
- }
69
- )
50
+ /* @__PURE__ */ jsxRuntime.jsx(Badges, { slotContext: widgetContext }),
51
+ /* @__PURE__ */ jsxRuntime.jsx("input", { value: filterText, ...directive.useDirective(inputDirective), onChange: () => {
52
+ } })
70
53
  ] }),
71
- open && visibleItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Rows, { slotContext, menuId })
54
+ open && visibleItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Rows, { slotContext: widgetContext, menuId })
72
55
  ] });
73
56
  }
74
57
  exports.Select = Select;
@@ -1,14 +1,13 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
- import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
4
3
  import { useDirective } from "@agnos-ui/react-headless/utils/directive";
5
4
  import React__default from "react";
6
5
  import { useWidgetWithConfig } from "./generated/config.js";
7
6
  import { getSliderDefaultConfig, createSlider } from "@agnos-ui/core-bootstrap/components/slider";
8
7
  const export_getSliderDefaultConfig = getSliderDefaultConfig;
9
8
  const export_createSlider = createSlider;
10
- const DefaultSlotHandle = (slotContext) => {
11
- return /* @__PURE__ */ jsx("button", { ...useDirective(slotContext.widget.directives.handleDirective, { item: slotContext.item }), children: " " });
9
+ const SliderDefaultSlotHandle = (slotContext) => {
10
+ return /* @__PURE__ */ jsx("button", { ...useDirective(slotContext.directives.handleDirective, { item: slotContext.item }), children: " " });
12
11
  };
13
12
  const ProgressDisplay = ({ directive, option }) => {
14
13
  return /* @__PURE__ */ jsx("div", { ...useDirective(directive, { option }) });
@@ -21,10 +20,10 @@ const HandleLabelDisplay = ({
21
20
  return /* @__PURE__ */ jsx("div", { ...useDirective(directive, { index }), children });
22
21
  };
23
22
  const MinMaxLabels = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
24
- /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.minLabelDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.min, ...slotContext } }) }),
25
- /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.maxLabelDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.max, ...slotContext } }) })
23
+ /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.directives.minLabelDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.min, ...slotContext } }) }),
24
+ /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.directives.maxLabelDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.max, ...slotContext } }) })
26
25
  ] });
27
- const CombinedLabel = (slotContext) => /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.combinedHandleLabelDisplayDirective), children: slotContext.state.rtl ? /* @__PURE__ */ jsxs(Fragment, { children: [
26
+ const CombinedLabel = (slotContext) => /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.directives.combinedHandleLabelDisplayDirective), children: slotContext.state.rtl ? /* @__PURE__ */ jsxs(Fragment, { children: [
28
27
  /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } }),
29
28
  " - ",
30
29
  /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[0], ...slotContext } })
@@ -33,29 +32,27 @@ const CombinedLabel = (slotContext) => /* @__PURE__ */ jsx("div", { ...useDirect
33
32
  " - ",
34
33
  /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } })
35
34
  ] }) });
36
- const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
37
- slotContext.state.progressDisplayOptions.map((option, index) => /* @__PURE__ */ jsx(ProgressDisplay, { directive: slotContext.widget.directives.progressDisplayDirective, option }, index)),
38
- /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.widget.directives.clickableAreaDirective) }),
35
+ const SliderDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
36
+ slotContext.state.progressDisplayOptions.map((option, index) => /* @__PURE__ */ jsx(ProgressDisplay, { directive: slotContext.directives.progressDisplayDirective, option }, index)),
37
+ /* @__PURE__ */ jsx("div", { ...useDirective(slotContext.directives.clickableAreaDirective) }),
39
38
  slotContext.state.showMinMaxLabels && /* @__PURE__ */ jsx(MinMaxLabels, { ...slotContext }),
40
39
  slotContext.state.showValueLabels && slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsx(CombinedLabel, { ...slotContext }),
41
40
  slotContext.state.sortedHandles.map((item, i) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
42
41
  /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.handle, props: { item, ...slotContext } }),
43
- slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsx(HandleLabelDisplay, { directive: slotContext.widget.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.values[i], ...slotContext } }) })
42
+ slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsx(HandleLabelDisplay, { directive: slotContext.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.values[i], ...slotContext } }) })
44
43
  ] }, item.id))
45
44
  ] });
46
- const defaultConfig = {
47
- structure: DefaultSlotStructure,
48
- handle: DefaultSlotHandle
49
- };
50
45
  function Slider(props) {
51
- const [state, widget] = useWidgetWithConfig(export_createSlider, props, "slider", { ...defaultConfig });
52
- const slotContext = { state, widget: toSlotContextWidget(widget) };
53
- return /* @__PURE__ */ jsx("div", { ...useDirective(widget.directives.sliderDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: state.structure, props: slotContext }) });
46
+ const widgetContext = useWidgetWithConfig(export_createSlider, props, "slider", {
47
+ structure: SliderDefaultSlotStructure,
48
+ handle: SliderDefaultSlotHandle
49
+ });
50
+ return /* @__PURE__ */ jsx("div", { ...useDirective(widgetContext.directives.sliderDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: widgetContext.state.structure, props: widgetContext }) });
54
51
  }
55
52
  export {
56
- DefaultSlotHandle as D,
57
- Slider as S,
58
- DefaultSlotStructure as a,
59
- export_createSlider as b,
53
+ SliderDefaultSlotHandle as S,
54
+ SliderDefaultSlotStructure as a,
55
+ Slider as b,
56
+ export_createSlider as c,
60
57
  export_getSliderDefaultConfig as e
61
58
  };
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const slot = require("@agnos-ui/react-headless/slot");
4
- const types = require("@agnos-ui/react-headless/types");
5
4
  const directive = require("@agnos-ui/react-headless/utils/directive");
6
5
  const React = require("react");
7
6
  const generated_config = require("./generated/config.cjs");
8
7
  const slider = require("@agnos-ui/core-bootstrap/components/slider");
9
8
  const export_getSliderDefaultConfig = slider.getSliderDefaultConfig;
10
9
  const export_createSlider = slider.createSlider;
11
- const DefaultSlotHandle = (slotContext) => {
12
- return /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirective(slotContext.widget.directives.handleDirective, { item: slotContext.item }), children: " " });
10
+ const SliderDefaultSlotHandle = (slotContext) => {
11
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirective(slotContext.directives.handleDirective, { item: slotContext.item }), children: " " });
13
12
  };
14
13
  const ProgressDisplay = ({ directive: directive$1, option }) => {
15
14
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(directive$1, { option }) });
@@ -22,10 +21,10 @@ const HandleLabelDisplay = ({
22
21
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(directive$1, { index }), children });
23
22
  };
24
23
  const MinMaxLabels = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
25
- /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.minLabelDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.min, ...slotContext } }) }),
26
- /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.maxLabelDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.max, ...slotContext } }) })
24
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.directives.minLabelDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.min, ...slotContext } }) }),
25
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.directives.maxLabelDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.max, ...slotContext } }) })
27
26
  ] });
28
- const CombinedLabel = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.combinedHandleLabelDisplayDirective), children: slotContext.state.rtl ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
27
+ const CombinedLabel = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.directives.combinedHandleLabelDisplayDirective), children: slotContext.state.rtl ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
29
28
  /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } }),
30
29
  " - ",
31
30
  /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[0], ...slotContext } })
@@ -34,27 +33,25 @@ const CombinedLabel = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("div", { .
34
33
  " - ",
35
34
  /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.sortedValues[1], ...slotContext } })
36
35
  ] }) });
37
- const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
38
- slotContext.state.progressDisplayOptions.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(ProgressDisplay, { directive: slotContext.widget.directives.progressDisplayDirective, option }, index)),
39
- /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.widget.directives.clickableAreaDirective) }),
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)),
38
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.directives.clickableAreaDirective) }),
40
39
  slotContext.state.showMinMaxLabels && /* @__PURE__ */ jsxRuntime.jsx(MinMaxLabels, { ...slotContext }),
41
40
  slotContext.state.showValueLabels && slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsxRuntime.jsx(CombinedLabel, { ...slotContext }),
42
41
  slotContext.state.sortedHandles.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
43
42
  /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.handle, props: { item, ...slotContext } }),
44
- slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsxRuntime.jsx(HandleLabelDisplay, { directive: slotContext.widget.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.values[i], ...slotContext } }) })
43
+ slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsxRuntime.jsx(HandleLabelDisplay, { directive: slotContext.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.values[i], ...slotContext } }) })
45
44
  ] }, item.id))
46
45
  ] });
47
- const defaultConfig = {
48
- structure: DefaultSlotStructure,
49
- handle: DefaultSlotHandle
50
- };
51
46
  function Slider(props) {
52
- const [state, widget] = generated_config.useWidgetWithConfig(export_createSlider, props, "slider", { ...defaultConfig });
53
- const slotContext = { state, widget: types.toSlotContextWidget(widget) };
54
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(widget.directives.sliderDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: state.structure, props: slotContext }) });
47
+ const widgetContext = generated_config.useWidgetWithConfig(export_createSlider, props, "slider", {
48
+ structure: SliderDefaultSlotStructure,
49
+ handle: SliderDefaultSlotHandle
50
+ });
51
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(widgetContext.directives.sliderDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: widgetContext.state.structure, props: widgetContext }) });
55
52
  }
56
- exports.DefaultSlotHandle = DefaultSlotHandle;
57
- exports.DefaultSlotStructure = DefaultSlotStructure;
58
53
  exports.Slider = Slider;
54
+ exports.SliderDefaultSlotHandle = SliderDefaultSlotHandle;
55
+ exports.SliderDefaultSlotStructure = SliderDefaultSlotStructure;
59
56
  exports.export_createSlider = export_createSlider;
60
57
  exports.export_getSliderDefaultConfig = export_getSliderDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
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
4
  import { forwardRef, useImperativeHandle } from "react";
@@ -8,40 +8,37 @@ const export_getToastDefaultConfig = getToastDefaultConfig;
8
8
  const export_createToast = createToast;
9
9
  const ToastHeader = (slotContext) => /* @__PURE__ */ jsxs("div", { className: "toast-header", children: [
10
10
  /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.header, props: slotContext }),
11
- slotContext.state.dismissible && /* @__PURE__ */ jsx("button", { ...useDirectives([classDirective, "btn-close me-0 ms-auto"], slotContext.widget.directives.closeButtonDirective) })
11
+ slotContext.state.dismissible && /* @__PURE__ */ jsx("button", { ...useDirectives([classDirective, "btn-close me-0 ms-auto"], slotContext.directives.closeButtonDirective) })
12
12
  ] });
13
- const ToastCloseButtonNoHeader = (slotContext) => /* @__PURE__ */ jsx("button", { ...useDirectives([classDirective, "btn-close btn-close-white me-2 m-auto"], slotContext.widget.directives.closeButtonDirective) });
14
- const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
13
+ const ToastCloseButtonNoHeader = (slotContext) => /* @__PURE__ */ jsx("button", { ...useDirectives([classDirective, "btn-close btn-close-white me-2 m-auto"], slotContext.directives.closeButtonDirective) });
14
+ const ToastDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
15
15
  slotContext.state.header && /* @__PURE__ */ jsx(ToastHeader, { ...slotContext }),
16
16
  /* @__PURE__ */ jsx("div", { className: "toast-body", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
17
17
  slotContext.state.dismissible && !slotContext.state.header && /* @__PURE__ */ jsx(ToastCloseButtonNoHeader, { ...slotContext })
18
18
  ] });
19
- const defaultConfig = {
20
- structure: DefaultSlotStructure
21
- };
22
19
  const ToastElement = (slotContext) => /* @__PURE__ */ jsx(
23
20
  "div",
24
21
  {
25
22
  ...useDirectives(
26
23
  [classDirective, `toast ${slotContext.state.dismissible ? "toast-dismissible" : ""} ${!slotContext.state.header ? "d-flex" : ""}`],
27
- slotContext.widget.directives.transitionDirective,
28
- slotContext.widget.directives.autoHideDirective,
29
- slotContext.widget.directives.bodyDirective
24
+ slotContext.directives.transitionDirective,
25
+ slotContext.directives.autoHideDirective,
26
+ slotContext.directives.bodyDirective
30
27
  ),
31
28
  children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.structure, props: slotContext })
32
29
  }
33
30
  );
34
31
  const Toast = forwardRef(function Toast2(props, ref) {
35
- const [state, widget] = useWidgetWithConfig(export_createToast, props, "toast", { ...defaultConfig, children: props.children });
36
- useImperativeHandle(ref, () => widget.api, []);
37
- const slotContext = {
38
- state,
39
- widget
40
- };
41
- return /* @__PURE__ */ jsx(Fragment, { children: !state.hidden && /* @__PURE__ */ jsx(ToastElement, { ...slotContext }) });
32
+ const widgetContext = useWidgetWithConfig(export_createToast, props, "toast", {
33
+ structure: ToastDefaultSlotStructure,
34
+ children: props.children
35
+ });
36
+ useImperativeHandle(ref, () => widgetContext.api, []);
37
+ return /* @__PURE__ */ jsx(Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsx(ToastElement, { ...widgetContext }) });
42
38
  });
43
39
  export {
44
- Toast as T,
45
- export_createToast as a,
40
+ ToastDefaultSlotStructure as T,
41
+ Toast as a,
42
+ export_createToast as b,
46
43
  export_getToastDefaultConfig as e
47
44
  };
@@ -9,38 +9,35 @@ const export_getToastDefaultConfig = toast.getToastDefaultConfig;
9
9
  const export_createToast = toast.createToast;
10
10
  const ToastHeader = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "toast-header", children: [
11
11
  /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.header, props: slotContext }),
12
- slotContext.state.dismissible && /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirectives([directive.classDirective, "btn-close me-0 ms-auto"], slotContext.widget.directives.closeButtonDirective) })
12
+ slotContext.state.dismissible && /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirectives([directive.classDirective, "btn-close me-0 ms-auto"], slotContext.directives.closeButtonDirective) })
13
13
  ] });
14
- const ToastCloseButtonNoHeader = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirectives([directive.classDirective, "btn-close btn-close-white me-2 m-auto"], slotContext.widget.directives.closeButtonDirective) });
15
- const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14
+ const ToastCloseButtonNoHeader = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirectives([directive.classDirective, "btn-close btn-close-white me-2 m-auto"], slotContext.directives.closeButtonDirective) });
15
+ const ToastDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16
16
  slotContext.state.header && /* @__PURE__ */ jsxRuntime.jsx(ToastHeader, { ...slotContext }),
17
17
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "toast-body", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
18
18
  slotContext.state.dismissible && !slotContext.state.header && /* @__PURE__ */ jsxRuntime.jsx(ToastCloseButtonNoHeader, { ...slotContext })
19
19
  ] });
20
- const defaultConfig = {
21
- structure: DefaultSlotStructure
22
- };
23
20
  const ToastElement = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx(
24
21
  "div",
25
22
  {
26
23
  ...directive.useDirectives(
27
24
  [directive.classDirective, `toast ${slotContext.state.dismissible ? "toast-dismissible" : ""} ${!slotContext.state.header ? "d-flex" : ""}`],
28
- slotContext.widget.directives.transitionDirective,
29
- slotContext.widget.directives.autoHideDirective,
30
- slotContext.widget.directives.bodyDirective
25
+ slotContext.directives.transitionDirective,
26
+ slotContext.directives.autoHideDirective,
27
+ slotContext.directives.bodyDirective
31
28
  ),
32
29
  children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.structure, props: slotContext })
33
30
  }
34
31
  );
35
32
  const Toast = React.forwardRef(function Toast2(props, ref) {
36
- const [state, widget] = generated_config.useWidgetWithConfig(export_createToast, props, "toast", { ...defaultConfig, children: props.children });
37
- React.useImperativeHandle(ref, () => widget.api, []);
38
- const slotContext = {
39
- state,
40
- widget
41
- };
42
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !state.hidden && /* @__PURE__ */ jsxRuntime.jsx(ToastElement, { ...slotContext }) });
33
+ const widgetContext = generated_config.useWidgetWithConfig(export_createToast, props, "toast", {
34
+ structure: ToastDefaultSlotStructure,
35
+ children: props.children
36
+ });
37
+ React.useImperativeHandle(ref, () => widgetContext.api, []);
38
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsxRuntime.jsx(ToastElement, { ...widgetContext }) });
43
39
  });
44
40
  exports.Toast = Toast;
41
+ exports.ToastDefaultSlotStructure = ToastDefaultSlotStructure;
45
42
  exports.export_createToast = export_createToast;
46
43
  exports.export_getToastDefaultConfig = export_getToastDefaultConfig;