@agnos-ui/react-bootstrap 0.4.0-next.0 → 0.4.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 (67) hide show
  1. package/{accordion-DnlQmoOX.cjs → accordion-CG9yl3xh.cjs} +10 -8
  2. package/{accordion-CMbgQzoG.js → accordion-DKdL2Sr3.js} +12 -10
  3. package/{alert-DKl7HLhb.js → alert-0W1n8ahW.js} +7 -7
  4. package/{alert-Bn5ooyqK.cjs → alert-DeQRFTm3.cjs} +6 -6
  5. package/components/accordion/accordion.d.ts +1 -6
  6. package/components/accordion/accordion.gen.d.ts +77 -5
  7. package/components/accordion/index.cjs +5 -4
  8. package/components/accordion/index.d.ts +1 -0
  9. package/components/accordion/index.js +5 -4
  10. package/components/alert/alert.d.ts +1 -5
  11. package/components/alert/alert.gen.d.ts +61 -7
  12. package/components/alert/index.cjs +3 -3
  13. package/components/alert/index.d.ts +1 -0
  14. package/components/alert/index.js +3 -3
  15. package/components/modal/index.cjs +5 -12
  16. package/components/modal/index.d.ts +1 -0
  17. package/components/modal/index.js +5 -6
  18. package/components/modal/modal.d.ts +1 -6
  19. package/components/modal/modal.gen.d.ts +131 -31
  20. package/components/pagination/index.cjs +3 -3
  21. package/components/pagination/index.d.ts +2 -0
  22. package/components/pagination/index.js +4 -4
  23. package/components/pagination/pagination.d.ts +1 -6
  24. package/components/pagination/pagination.gen.d.ts +204 -34
  25. package/components/progressbar/index.cjs +3 -3
  26. package/components/progressbar/index.d.ts +1 -0
  27. package/components/progressbar/index.js +3 -3
  28. package/components/progressbar/progressbar.d.ts +1 -5
  29. package/components/progressbar/progressbar.gen.d.ts +56 -3
  30. package/components/rating/index.cjs +3 -3
  31. package/components/rating/index.d.ts +1 -0
  32. package/components/rating/index.js +3 -3
  33. package/components/rating/rating.d.ts +1 -5
  34. package/components/rating/rating.gen.d.ts +84 -1
  35. package/components/select/index.cjs +3 -3
  36. package/components/select/index.d.ts +1 -0
  37. package/components/select/index.js +3 -3
  38. package/components/select/select.d.ts +1 -5
  39. package/components/select/select.gen.d.ts +121 -1
  40. package/components/slider/index.cjs +3 -3
  41. package/components/slider/index.d.ts +1 -0
  42. package/components/slider/index.js +3 -3
  43. package/components/slider/slider.d.ts +1 -5
  44. package/components/slider/slider.gen.d.ts +98 -3
  45. package/components/toast/index.cjs +3 -3
  46. package/components/toast/index.d.ts +1 -0
  47. package/components/toast/index.js +3 -3
  48. package/components/toast/toast.d.ts +1 -5
  49. package/components/toast/toast.gen.d.ts +65 -7
  50. package/config.d.ts +1 -1
  51. package/index.cjs +31 -37
  52. package/index.js +35 -35
  53. package/{modal-Vd0W6U05.cjs → modal-Cyt40iyH.cjs} +20 -17
  54. package/{modal-B9xclGji.js → modal-qidZ4ghL.js} +21 -18
  55. package/package.json +3 -3
  56. package/{pagination-BGHP7K6U.js → pagination-BDq1dOoH.js} +19 -19
  57. package/{pagination-BO6qrpA6.cjs → pagination-ChA90-py.cjs} +16 -16
  58. package/{progressbar-D8_F2wYh.js → progressbar-B0keLNtE.js} +10 -10
  59. package/{progressbar-Bi9aS9jg.cjs → progressbar-Fa1PDviu.cjs} +9 -9
  60. package/{rating-DRAx20tg.js → rating-CWOEBPWs.js} +7 -7
  61. package/{rating-DB4Ze-r4.cjs → rating-D5-3ELHv.cjs} +6 -6
  62. package/{select-CxX_TdVh.cjs → select-C4STYCmG.cjs} +6 -6
  63. package/{select-CEXxOyRB.js → select-DmgOBdqs.js} +6 -6
  64. package/{slider-CnK847iw.js → slider-CxodlRoZ.js} +9 -9
  65. package/{slider-Du37lWVJ.cjs → slider-MNZTN_vu.cjs} +8 -8
  66. package/{toast-Bvz7Uyrd.js → toast-3amUxqw1.js} +7 -7
  67. package/{toast-cd5__9Rl.cjs → toast-BXMjE9E3.cjs} +6 -6
@@ -1,5 +1,11 @@
1
- import type { WidgetSlotContext, SlotContent, Widget, Directive } from '@agnos-ui/react-headless/types';
1
+ import type { WidgetSlotContext, SlotContent, Widget, WidgetFactory, Directive } from '@agnos-ui/react-headless/types';
2
2
  import type { TransitionFn } from '@agnos-ui/react-headless/services/transitions/baseTransitions';
3
+ /**
4
+ * Retrieve a shallow copy of the default Toast config
5
+ * @returns the default Toast config
6
+ */
7
+ declare const export_getToastDefaultConfig: () => ToastProps;
8
+ export { export_getToastDefaultConfig as getToastDefaultConfig };
3
9
  export type ToastContext = WidgetSlotContext<ToastWidget>;
4
10
  export interface ToastState {
5
11
  /**
@@ -9,26 +15,38 @@ export interface ToastState {
9
15
  /**
10
16
  * If `true`, alert can be dismissed by the user.
11
17
  * The close button (×) will be displayed and you can be notified of the event with the (close) output.
18
+ *
19
+ * @defaultValue `true`
12
20
  */
13
21
  dismissible: boolean;
14
22
  /**
15
23
  * If `true` the alert is visible to the user
24
+ *
25
+ * @defaultValue `true`
16
26
  */
17
27
  visible: boolean;
18
28
  /**
19
29
  * Accessibility close button label
30
+ *
31
+ * @defaultValue `'Close'`
20
32
  */
21
33
  ariaCloseButtonLabel: string;
22
34
  /**
23
35
  * CSS classes to be applied on the widget main container
36
+ *
37
+ * @defaultValue `''`
24
38
  */
25
39
  className: string;
26
40
  /**
27
41
  * If `true` automatically hides the toast after the delay.
42
+ *
43
+ * @defaultValue `true`
28
44
  */
29
45
  autoHide: boolean;
30
46
  /**
31
47
  * Delay in milliseconds before hiding the toast.
48
+ *
49
+ * @defaultValue `5000`
32
50
  */
33
51
  delay: number;
34
52
  /**
@@ -45,29 +63,48 @@ export interface ToastState {
45
63
  header: SlotContent<ToastContext>;
46
64
  }
47
65
  export interface ToastProps {
66
+ /**
67
+ * The transition function will be executed when the alert is displayed or hidden.
68
+ *
69
+ * Depending on the value of `animatedOnInit`, the animation can be optionally skipped during the showing process.
70
+ *
71
+ * @defaultValue `fadeTransition`
72
+ */
73
+ transition: TransitionFn;
48
74
  /**
49
75
  * Callback called when the alert visibility changed.
76
+ *
77
+ * @defaultValue
78
+ * ```ts
79
+ * () => {}
80
+ * ```
50
81
  */
51
82
  onVisibleChange: (visible: boolean) => void;
52
83
  /**
53
84
  * Callback called when the alert is hidden.
85
+ *
86
+ * @defaultValue
87
+ * ```ts
88
+ * () => {}
89
+ * ```
54
90
  */
55
91
  onHidden: () => void;
56
92
  /**
57
93
  * Callback called when the alert is shown.
58
- */
59
- onShown: () => void;
60
- /**
61
- * The transition function will be executed when the alert is displayed or hidden.
62
94
  *
63
- * Depending on the value of `animatedOnInit`, the animation can be optionally skipped during the showing process.
95
+ * @defaultValue
96
+ * ```ts
97
+ * () => {}
98
+ * ```
64
99
  */
65
- transition: TransitionFn;
100
+ onShown: () => void;
66
101
  /**
67
102
  * If `true`, alert opening will be animated.
68
103
  *
69
104
  * Animation is triggered when the `.open()` function is called
70
105
  * or the visible prop is changed
106
+ *
107
+ * @defaultValue `false`
71
108
  */
72
109
  animatedOnInit: boolean;
73
110
  /**
@@ -75,31 +112,45 @@ export interface ToastProps {
75
112
  *
76
113
  * Animation is triggered when clicked on the close button (×),
77
114
  * via the `.close()` function or the visible prop is changed
115
+ *
116
+ * @defaultValue `true`
78
117
  */
79
118
  animated: boolean;
80
119
  /**
81
120
  * If `true`, alert can be dismissed by the user.
82
121
  * The close button (×) will be displayed and you can be notified of the event with the (close) output.
122
+ *
123
+ * @defaultValue `true`
83
124
  */
84
125
  dismissible: boolean;
85
126
  /**
86
127
  * If `true` the alert is visible to the user
128
+ *
129
+ * @defaultValue `true`
87
130
  */
88
131
  visible: boolean;
89
132
  /**
90
133
  * Accessibility close button label
134
+ *
135
+ * @defaultValue `'Close'`
91
136
  */
92
137
  ariaCloseButtonLabel: string;
93
138
  /**
94
139
  * CSS classes to be applied on the widget main container
140
+ *
141
+ * @defaultValue `''`
95
142
  */
96
143
  className: string;
97
144
  /**
98
145
  * If `true` automatically hides the toast after the delay.
146
+ *
147
+ * @defaultValue `true`
99
148
  */
100
149
  autoHide: boolean;
101
150
  /**
102
151
  * Delay in milliseconds before hiding the toast.
152
+ *
153
+ * @defaultValue `5000`
103
154
  */
104
155
  delay: number;
105
156
  /**
@@ -116,6 +167,13 @@ export interface ToastProps {
116
167
  header: SlotContent<ToastContext>;
117
168
  }
118
169
  export type ToastWidget = Widget<ToastProps, ToastState, ToastApi, object, ToastDirectives>;
170
+ /**
171
+ * Create an ToastWidget with given config props
172
+ * @param config - an optional alert config
173
+ * @returns an ToastWidget
174
+ */
175
+ declare const export_createToast: WidgetFactory<ToastWidget>;
176
+ export { export_createToast as createToast };
119
177
  export interface ToastApi {
120
178
  /**
121
179
  * Triggers alert closing programmatically (same as clicking on the close button (×)).
package/config.d.ts CHANGED
@@ -9,4 +9,4 @@ type DefaultConfigInput = Partial2Levels<WidgetsConfig> & {
9
9
  adaptParentConfig?: (config: Partial2Levels<WidgetsConfig>) => Partial2Levels<WidgetsConfig>;
10
10
  children?: ReactNode | undefined;
11
11
  };
12
- 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> | undefined) => import('@amadeus-it-group/tansu').ReadableSignal<Partial<Props>>, useWidgetWithConfig: <W extends Widget<object, object, object, object, object>>(factory: WidgetFactory<W>, props: Partial<WidgetProps<W>> | undefined, widgetName: keyof BootstrapWidgetsConfig | null, defaultProps?: Partial<WidgetProps<W>> | undefined) => [WidgetState<W>, W];
12
+ 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> | undefined) => import("@amadeus-it-group/tansu").ReadableSignal<Partial<Props>>, useWidgetWithConfig: <W extends Widget<object, object, object, object, object>>(factory: WidgetFactory<W>, props: Partial<WidgetProps<W>> | undefined, widgetName: keyof BootstrapWidgetsConfig | null, defaultProps?: Partial<WidgetProps<W>> | undefined) => [WidgetState<W>, W];
package/index.cjs CHANGED
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const accordion = require("./accordion-DnlQmoOX.cjs");
4
- const alert = require("./alert-Bn5ooyqK.cjs");
5
- const modal = require("./modal-Vd0W6U05.cjs");
6
- const pagination = require("./pagination-BO6qrpA6.cjs");
7
- const progressbar = require("./progressbar-Bi9aS9jg.cjs");
8
- const rating = require("./rating-DB4Ze-r4.cjs");
9
- const select = require("./select-CxX_TdVh.cjs");
10
- const slider = require("./slider-Du37lWVJ.cjs");
11
- const toast = require("./toast-cd5__9Rl.cjs");
12
- const modal$1 = require("@agnos-ui/react-headless/components/modal");
3
+ const accordion = require("./accordion-CG9yl3xh.cjs");
4
+ const alert = require("./alert-DeQRFTm3.cjs");
5
+ const modal = require("./modal-Cyt40iyH.cjs");
6
+ const pagination = require("./pagination-ChA90-py.cjs");
7
+ const progressbar = require("./progressbar-Fa1PDviu.cjs");
8
+ const rating = require("./rating-D5-3ELHv.cjs");
9
+ const select = require("./select-C4STYCmG.cjs");
10
+ const slider = require("./slider-MNZTN_vu.cjs");
11
+ const toast = require("./toast-BXMjE9E3.cjs");
13
12
  const types = require("@agnos-ui/react-headless/types");
14
13
  const slot = require("@agnos-ui/react-headless/slot");
15
14
  const config = require("@agnos-ui/react-headless/config");
@@ -36,48 +35,43 @@ const baseTransitions = require("@agnos-ui/react-headless/services/transitions/b
36
35
  const transitions = require("@agnos-ui/core-bootstrap/services/transitions");
37
36
  exports.Accordion = accordion.Accordion;
38
37
  exports.AccordionItem = accordion.AccordionItem;
39
- exports.createAccordion = accordion.createAccordion;
40
- exports.createAccordionItem = accordion.createAccordionItem;
41
- exports.getAccordionDefaultConfig = accordion.getAccordionDefaultConfig;
38
+ exports.createAccordion = accordion.export_createAccordion;
39
+ exports.createAccordionItem = accordion.export_createAccordionItem;
40
+ exports.factoryCreateAccordion = accordion.export_factoryCreateAccordion;
41
+ exports.getAccordionDefaultConfig = accordion.export_getAccordionDefaultConfig;
42
42
  exports.Alert = alert.Alert;
43
- exports.createAlert = alert.createAlert;
44
- exports.getAlertDefaultConfig = alert.getAlertDefaultConfig;
43
+ exports.createAlert = alert.export_createAlert;
44
+ exports.getAlertDefaultConfig = alert.export_getAlertDefaultConfig;
45
45
  exports.Modal = modal.Modal;
46
- exports.createModal = modal.createModal;
47
- exports.getModalDefaultConfig = modal.getModalDefaultConfig;
46
+ exports.createModal = modal.export_createModal;
47
+ exports.getModalDefaultConfig = modal.export_getModalDefaultConfig;
48
+ exports.modalCloseButtonClick = modal.export_modalCloseButtonClick;
49
+ exports.modalOutsideClick = modal.export_modalOutsideClick;
48
50
  exports.openModal = modal.openModal;
49
51
  exports.DefaultPages = pagination.DefaultPages;
50
52
  exports.DefaultStructure = pagination.DefaultStructure;
51
53
  exports.NavButton = pagination.NavButton;
52
54
  exports.PageItem = pagination.PageItem;
53
55
  exports.Pagination = pagination.Pagination;
54
- exports.createPagination = pagination.createPagination;
55
- exports.getPaginationDefaultConfig = pagination.getPaginationDefaultConfig;
56
+ exports.createPagination = pagination.export_createPagination;
57
+ exports.getPaginationDefaultConfig = pagination.export_getPaginationDefaultConfig;
56
58
  exports.Progressbar = progressbar.Progressbar;
57
- exports.createProgressbar = progressbar.createProgressbar;
58
- exports.getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
59
+ exports.createProgressbar = progressbar.export_createProgressbar;
60
+ exports.getProgressbarDefaultConfig = progressbar.export_getProgressbarDefaultConfig;
59
61
  exports.Rating = rating.Rating;
60
- exports.createRating = rating.createRating;
61
- exports.getRatingDefaultConfig = rating.getRatingDefaultConfig;
62
+ exports.createRating = rating.export_createRating;
63
+ exports.getRatingDefaultConfig = rating.export_getRatingDefaultConfig;
62
64
  exports.Select = select.Select;
63
- exports.createSelect = select.createSelect;
64
- exports.getSelectDefaultConfig = select.getSelectDefaultConfig;
65
+ exports.createSelect = select.export_createSelect;
66
+ exports.getSelectDefaultConfig = select.export_getSelectDefaultConfig;
65
67
  exports.DefaultSlotHandle = slider.DefaultSlotHandle;
66
68
  exports.DefaultSlotStructure = slider.DefaultSlotStructure;
67
69
  exports.Slider = slider.Slider;
68
- exports.createSlider = slider.createSlider;
69
- exports.getSliderDefaultConfig = slider.getSliderDefaultConfig;
70
+ exports.createSlider = slider.export_createSlider;
71
+ exports.getSliderDefaultConfig = slider.export_getSliderDefaultConfig;
70
72
  exports.Toast = toast.Toast;
71
- exports.createToast = toast.createToast;
72
- exports.getToastDefaultConfig = toast.getToastDefaultConfig;
73
- Object.defineProperty(exports, "modalCloseButtonClick", {
74
- enumerable: true,
75
- get: () => modal$1.modalCloseButtonClick
76
- });
77
- Object.defineProperty(exports, "modalOutsideClick", {
78
- enumerable: true,
79
- get: () => modal$1.modalOutsideClick
80
- });
73
+ exports.createToast = toast.export_createToast;
74
+ exports.getToastDefaultConfig = toast.export_getToastDefaultConfig;
81
75
  exports.WidgetsDefaultConfig = generated_config.WidgetsDefaultConfig;
82
76
  exports.useWidgetContext = generated_config.useWidgetContext;
83
77
  exports.useWidgetWithConfig = generated_config.useWidgetWithConfig;
package/index.js CHANGED
@@ -1,13 +1,12 @@
1
- import { b, A, c, a, g } from "./accordion-CMbgQzoG.js";
2
- import { A as A2, c as c2, g as g2 } from "./alert-DKl7HLhb.js";
3
- import { M, c as c3, g as g3, o } from "./modal-B9xclGji.js";
4
- import { D, a as a2, N, b as b2, P, c as c4, g as g4 } from "./pagination-BGHP7K6U.js";
5
- import { P as P2, c as c5, g as g5 } from "./progressbar-D8_F2wYh.js";
6
- import { R, c as c6, g as g6 } from "./rating-DRAx20tg.js";
7
- import { S, c as c7, g as g7 } from "./select-CEXxOyRB.js";
8
- import { D as D2, a as a3, S as S2, c as c8, g as g8 } from "./slider-CnK847iw.js";
9
- import { T, c as c9, g as g9 } from "./toast-Bvz7Uyrd.js";
10
- import { modalCloseButtonClick, modalOutsideClick } from "@agnos-ui/react-headless/components/modal";
1
+ import { a, A, c, b, d, e } from "./accordion-DKdL2Sr3.js";
2
+ import { A as A2, a as a2, e as e2 } from "./alert-0W1n8ahW.js";
3
+ import { M, a as a3, e as e3, c as c2, b as b2, o } from "./modal-qidZ4ghL.js";
4
+ import { D, a as a4, N, P, b as b3, c as c3, e as e4 } from "./pagination-BDq1dOoH.js";
5
+ import { P as P2, a as a5, e as e5 } from "./progressbar-B0keLNtE.js";
6
+ import { R, a as a6, e as e6 } from "./rating-CWOEBPWs.js";
7
+ import { S, a as a7, e as e7 } from "./select-DmgOBdqs.js";
8
+ import { D as D2, a as a8, S as S2, b as b4, e as e8 } from "./slider-CxodlRoZ.js";
9
+ import { T, a as a9, e as e9 } from "./toast-3amUxqw1.js";
11
10
  export * from "@agnos-ui/react-headless/types";
12
11
  export * from "@agnos-ui/react-headless/slot";
13
12
  export * from "@agnos-ui/react-headless/config";
@@ -33,17 +32,17 @@ export * from "@agnos-ui/react-headless/services/transitions/collapse";
33
32
  export * from "@agnos-ui/react-headless/services/transitions/baseTransitions";
34
33
  export * from "@agnos-ui/core-bootstrap/services/transitions";
35
34
  export {
36
- b as Accordion,
35
+ a as Accordion,
37
36
  A as AccordionItem,
38
37
  A2 as Alert,
39
38
  D as DefaultPages,
40
39
  D2 as DefaultSlotHandle,
41
- a3 as DefaultSlotStructure,
42
- a2 as DefaultStructure,
40
+ a8 as DefaultSlotStructure,
41
+ a4 as DefaultStructure,
43
42
  M as Modal,
44
43
  N as NavButton,
45
- b2 as PageItem,
46
- P as Pagination,
44
+ P as PageItem,
45
+ b3 as Pagination,
47
46
  P2 as Progressbar,
48
47
  R as Rating,
49
48
  S as Select,
@@ -51,26 +50,27 @@ export {
51
50
  T as Toast,
52
51
  WidgetsDefaultConfig,
53
52
  c as createAccordion,
54
- a as createAccordionItem,
55
- c2 as createAlert,
56
- c3 as createModal,
57
- c4 as createPagination,
58
- c5 as createProgressbar,
59
- c6 as createRating,
60
- c7 as createSelect,
61
- c8 as createSlider,
62
- c9 as createToast,
63
- g as getAccordionDefaultConfig,
64
- g2 as getAlertDefaultConfig,
65
- g3 as getModalDefaultConfig,
66
- g4 as getPaginationDefaultConfig,
67
- g5 as getProgressbarDefaultConfig,
68
- g6 as getRatingDefaultConfig,
69
- g7 as getSelectDefaultConfig,
70
- g8 as getSliderDefaultConfig,
71
- g9 as getToastDefaultConfig,
72
- modalCloseButtonClick,
73
- modalOutsideClick,
53
+ b as createAccordionItem,
54
+ a2 as createAlert,
55
+ a3 as createModal,
56
+ c3 as createPagination,
57
+ a5 as createProgressbar,
58
+ a6 as createRating,
59
+ a7 as createSelect,
60
+ b4 as createSlider,
61
+ a9 as createToast,
62
+ d as factoryCreateAccordion,
63
+ e as getAccordionDefaultConfig,
64
+ e2 as getAlertDefaultConfig,
65
+ e3 as getModalDefaultConfig,
66
+ e4 as getPaginationDefaultConfig,
67
+ e5 as getProgressbarDefaultConfig,
68
+ e6 as getRatingDefaultConfig,
69
+ e7 as getSelectDefaultConfig,
70
+ e8 as getSliderDefaultConfig,
71
+ e9 as getToastDefaultConfig,
72
+ c2 as modalCloseButtonClick,
73
+ b2 as modalOutsideClick,
74
74
  o as openModal,
75
75
  useWidgetContext,
76
76
  useWidgetWithConfig,
@@ -1,40 +1,41 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
- const portal = require("@agnos-ui/react-headless/utils/portal");
4
- const types = require("@agnos-ui/react-headless/types");
5
3
  const slot = require("@agnos-ui/react-headless/slot");
6
- const generated_config = require("./generated/config.cjs");
4
+ const types = require("@agnos-ui/react-headless/types");
7
5
  const directive = require("@agnos-ui/react-headless/utils/directive");
8
- const ReactDOM = require("react-dom/client");
6
+ const portal = require("@agnos-ui/react-headless/utils/portal");
7
+ const classNames = require("classnames");
9
8
  const React = require("react");
9
+ const ReactDOM = require("react-dom/client");
10
+ const generated_config = require("./generated/config.cjs");
10
11
  const modal = require("@agnos-ui/core-bootstrap/components/modal");
11
- const classNames = require("classnames");
12
- require("@agnos-ui/react-headless/components/modal");
13
- const createModal = modal.createModal;
14
- const getModalDefaultConfig = modal.getModalDefaultConfig;
12
+ const export_getModalDefaultConfig = modal.getModalDefaultConfig;
13
+ const export_createModal = modal.createModal;
14
+ const export_modalOutsideClick = modal.modalOutsideClick;
15
+ const export_modalCloseButtonClick = modal.modalCloseButtonClick;
15
16
  const CloseButton = ({ directive: directive$1 }) => /* @__PURE__ */ jsxRuntime.jsx("button", { className: "btn-close", ...directive.useDirective(directive$1) });
16
17
  const DefaultSlotHeader = (slotContext) => {
17
18
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
18
- /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "modal-title", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotTitle, props: slotContext }) }),
19
+ /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "modal-title", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.title, props: slotContext }) }),
19
20
  slotContext.state.closeButton && /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { directive: slotContext.widget.directives.closeButtonDirective })
20
21
  ] });
21
22
  };
22
23
  const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
23
- slotContext.state.slotTitle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-header", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotHeader, props: slotContext }) }),
24
+ slotContext.state.title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-header", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.header, props: slotContext }) }),
24
25
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-body", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
25
- slotContext.state.slotFooter && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-footer", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.slotFooter, props: slotContext }) })
26
+ slotContext.state.footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-footer", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.footer, props: slotContext }) })
26
27
  ] });
27
28
  const defaultConfig = {
28
- slotHeader: DefaultSlotHeader,
29
- slotStructure: DefaultSlotStructure
29
+ header: DefaultSlotHeader,
30
+ structure: DefaultSlotStructure
30
31
  };
31
32
  const BackdropElement = ({ widget }) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "modal-backdrop"], widget.directives.backdropDirective) });
32
33
  const ModalElement = (slotContext) => {
33
34
  const { fullscreen } = slotContext.state;
34
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "modal d-block"], slotContext.widget.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.slotStructure, props: slotContext }) }) }) });
35
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "modal d-block"], slotContext.widget.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 }) }) }) });
35
36
  };
36
37
  const Modal = React.forwardRef(function Modal2(props, ref) {
37
- const [state, widget] = generated_config.useWidgetWithConfig(createModal, props, "modal", defaultConfig);
38
+ const [state, widget] = generated_config.useWidgetWithConfig(export_createModal, props, "modal", defaultConfig);
38
39
  React.useImperativeHandle(ref, () => widget.api, []);
39
40
  const slotContext = {
40
41
  state,
@@ -57,6 +58,8 @@ async function openModal(options) {
57
58
  }
58
59
  }
59
60
  exports.Modal = Modal;
60
- exports.createModal = createModal;
61
- exports.getModalDefaultConfig = getModalDefaultConfig;
61
+ exports.export_createModal = export_createModal;
62
+ exports.export_getModalDefaultConfig = export_getModalDefaultConfig;
63
+ exports.export_modalCloseButtonClick = export_modalCloseButtonClick;
64
+ exports.export_modalOutsideClick = export_modalOutsideClick;
62
65
  exports.openModal = openModal;
@@ -1,39 +1,40 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { Portal } from "@agnos-ui/react-headless/utils/portal";
3
- import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
4
2
  import { Slot } from "@agnos-ui/react-headless/slot";
5
- import { useWidgetWithConfig } from "./generated/config.js";
3
+ import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
6
4
  import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-headless/utils/directive";
7
- import ReactDOM from "react-dom/client";
8
- import { forwardRef, useImperativeHandle } from "react";
9
- import { createModal as createModal$1, getModalDefaultConfig as getModalDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/modal";
5
+ import { Portal } from "@agnos-ui/react-headless/utils/portal";
10
6
  import classNames from "classnames";
11
- import "@agnos-ui/react-headless/components/modal";
12
- const createModal = createModal$1;
13
- const getModalDefaultConfig = getModalDefaultConfig$1;
7
+ import { forwardRef, useImperativeHandle } from "react";
8
+ import ReactDOM from "react-dom/client";
9
+ import { useWidgetWithConfig } from "./generated/config.js";
10
+ import { getModalDefaultConfig, createModal, modalOutsideClick, modalCloseButtonClick } from "@agnos-ui/core-bootstrap/components/modal";
11
+ const export_getModalDefaultConfig = getModalDefaultConfig;
12
+ const export_createModal = createModal;
13
+ const export_modalOutsideClick = modalOutsideClick;
14
+ const export_modalCloseButtonClick = modalCloseButtonClick;
14
15
  const CloseButton = ({ directive }) => /* @__PURE__ */ jsx("button", { className: "btn-close", ...useDirective(directive) });
15
16
  const DefaultSlotHeader = (slotContext) => {
16
17
  return /* @__PURE__ */ jsxs(Fragment, { children: [
17
- /* @__PURE__ */ jsx("h5", { className: "modal-title", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotTitle, props: slotContext }) }),
18
+ /* @__PURE__ */ jsx("h5", { className: "modal-title", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.title, props: slotContext }) }),
18
19
  slotContext.state.closeButton && /* @__PURE__ */ jsx(CloseButton, { directive: slotContext.widget.directives.closeButtonDirective })
19
20
  ] });
20
21
  };
21
22
  const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
22
- slotContext.state.slotTitle && /* @__PURE__ */ jsx("div", { className: "modal-header", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotHeader, props: slotContext }) }),
23
+ slotContext.state.title && /* @__PURE__ */ jsx("div", { className: "modal-header", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.header, props: slotContext }) }),
23
24
  /* @__PURE__ */ jsx("div", { className: "modal-body", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
24
- slotContext.state.slotFooter && /* @__PURE__ */ jsx("div", { className: "modal-footer", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.slotFooter, props: slotContext }) })
25
+ slotContext.state.footer && /* @__PURE__ */ jsx("div", { className: "modal-footer", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.footer, props: slotContext }) })
25
26
  ] });
26
27
  const defaultConfig = {
27
- slotHeader: DefaultSlotHeader,
28
- slotStructure: DefaultSlotStructure
28
+ header: DefaultSlotHeader,
29
+ structure: DefaultSlotStructure
29
30
  };
30
31
  const BackdropElement = ({ widget }) => /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "modal-backdrop"], widget.directives.backdropDirective) });
31
32
  const ModalElement = (slotContext) => {
32
33
  const { fullscreen } = slotContext.state;
33
- return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "modal d-block"], slotContext.widget.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.slotStructure, props: slotContext }) }) }) });
34
+ return /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "modal d-block"], slotContext.widget.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 }) }) }) });
34
35
  };
35
36
  const Modal = forwardRef(function Modal2(props, ref) {
36
- const [state, widget] = useWidgetWithConfig(createModal, props, "modal", defaultConfig);
37
+ const [state, widget] = useWidgetWithConfig(export_createModal, props, "modal", defaultConfig);
37
38
  useImperativeHandle(ref, () => widget.api, []);
38
39
  const slotContext = {
39
40
  state,
@@ -57,7 +58,9 @@ async function openModal(options) {
57
58
  }
58
59
  export {
59
60
  Modal as M,
60
- createModal as c,
61
- getModalDefaultConfig as g,
61
+ export_createModal as a,
62
+ export_modalOutsideClick as b,
63
+ export_modalCloseButtonClick as c,
64
+ export_getModalDefaultConfig as e,
62
65
  openModal as o
63
66
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agnos-ui/react-bootstrap",
3
3
  "description": "Bootstrap-based widget library for React.",
4
- "version": "0.4.0-next.0",
4
+ "version": "0.4.0",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",
7
7
  "module": "./index.js",
@@ -49,8 +49,8 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@agnos-ui/core-bootstrap": "0.4.0-next.0",
53
- "@agnos-ui/react-headless": "0.4.0-next.0",
52
+ "@agnos-ui/core-bootstrap": "0.4.0",
53
+ "@agnos-ui/react-headless": "0.4.0",
54
54
  "classnames": "^2.5.1"
55
55
  },
56
56
  "peerDependencies": {
@@ -1,11 +1,11 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useWidgetWithConfig } from "./generated/config.js";
3
2
  import { Slot } from "@agnos-ui/react-headless/slot";
4
3
  import { toSlotContextWidget } from "@agnos-ui/react-headless/types";
5
4
  import classNames from "classnames";
5
+ import { useWidgetWithConfig } from "./generated/config.js";
6
6
  import * as React from "react";
7
7
  import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
8
- import { createPagination as createPagination$1, getPaginationDefaultConfig as getPaginationDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/pagination";
8
+ import { getPaginationDefaultConfig, createPagination } from "@agnos-ui/core-bootstrap/components/pagination";
9
9
  const PageItem = React.forwardRef(
10
10
  ({ disabled, active, activeLabel, className, children, directive, page }, ref) => {
11
11
  return /* @__PURE__ */ jsx("li", { ref, className: classNames("page-item", { active, disabled }), children: /* @__PURE__ */ jsxs("a", { ...useDirectives([directive, { page }], [classDirective, classNames("page-link", className)]), children: [
@@ -19,8 +19,8 @@ const NavButton = React.forwardRef(({ disabled, className, children, directive }
19
19
  return /* @__PURE__ */ jsx("li", { ref, className: classNames("page-item", { disabled }), children: /* @__PURE__ */ jsx("a", { ...useDirectives(directive, [classDirective, classNames("page-link", className)]), children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children }) }) });
20
20
  });
21
21
  NavButton.displayName = "NavButton";
22
- const createPagination = createPagination$1;
23
- const getPaginationDefaultConfig = getPaginationDefaultConfig$1;
22
+ const export_getPaginationDefaultConfig = getPaginationDefaultConfig;
23
+ const export_createPagination = createPagination;
24
24
  function DefaultPages(slotContext) {
25
25
  const { widget, state } = slotContext;
26
26
  const jsxPages = [];
@@ -28,7 +28,7 @@ function DefaultPages(slotContext) {
28
28
  if (state.pages[i] === -1) {
29
29
  jsxPages.push(
30
30
  /* @__PURE__ */ jsxs("li", { className: "page-item disabled", children: [
31
- /* @__PURE__ */ jsx("div", { className: "page-link au-ellipsis", "aria-hidden": "true", children: /* @__PURE__ */ jsx(Slot, { slotContent: state.slotEllipsis, props: slotContext }) }),
31
+ /* @__PURE__ */ jsx("div", { className: "page-link au-ellipsis", "aria-hidden": "true", children: /* @__PURE__ */ jsx(Slot, { slotContent: state.ellipsisLabel, props: slotContext }) }),
32
32
  /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: state.ariaEllipsisLabel })
33
33
  ] }, "Ellipsis" + i)
34
34
  );
@@ -42,7 +42,7 @@ function DefaultPages(slotContext) {
42
42
  activeLabel: state.activeLabel,
43
43
  directive: widget.directives["pageLink"],
44
44
  page: state.pages[i],
45
- children: /* @__PURE__ */ jsx(Slot, { slotContent: state.slotNumberLabel, props: { ...slotContext, displayedPage: state.pages[i] } })
45
+ children: /* @__PURE__ */ jsx(Slot, { slotContent: state.numberLabel, props: { ...slotContext, displayedPage: state.pages[i] } })
46
46
  },
47
47
  state.pages[i]
48
48
  )
@@ -52,8 +52,8 @@ function DefaultPages(slotContext) {
52
52
  return jsxPages.length ? /* @__PURE__ */ jsx(Fragment, { children: jsxPages }) : null;
53
53
  }
54
54
  const defaultConfig = {
55
- slotPages: DefaultPages,
56
- slotStructure: DefaultStructure
55
+ pagesDisplay: DefaultPages,
56
+ structure: DefaultStructure
57
57
  };
58
58
  function DefaultStructure(slotContext) {
59
59
  const { widget, state } = slotContext;
@@ -61,44 +61,44 @@ function DefaultStructure(slotContext) {
61
61
  const ItemsAfter = [];
62
62
  if (state.boundaryLinks) {
63
63
  ItemsBefore.push(
64
- /* @__PURE__ */ jsx(NavButton, { disabled: state.previousDisabled, directive: widget.directives["pageFirst"], children: /* @__PURE__ */ jsx(Slot, { slotContent: state.slotFirst, props: slotContext }) }, "first")
64
+ /* @__PURE__ */ jsx(NavButton, { disabled: state.previousDisabled, directive: widget.directives["pageFirst"], children: /* @__PURE__ */ jsx(Slot, { slotContent: state.firstPageLabel, props: slotContext }) }, "first")
65
65
  );
66
66
  }
67
67
  if (state.directionLinks) {
68
68
  ItemsBefore.push(
69
- /* @__PURE__ */ jsx(NavButton, { disabled: state.previousDisabled, directive: widget.directives["pagePrev"], children: /* @__PURE__ */ jsx(Slot, { slotContent: state.slotPrevious, props: slotContext }) }, "prev")
69
+ /* @__PURE__ */ jsx(NavButton, { disabled: state.previousDisabled, directive: widget.directives["pagePrev"], children: /* @__PURE__ */ jsx(Slot, { slotContent: state.previousPageLabel, props: slotContext }) }, "prev")
70
70
  );
71
71
  }
72
72
  if (state.directionLinks) {
73
73
  ItemsAfter.push(
74
- /* @__PURE__ */ jsx(NavButton, { disabled: state.nextDisabled, directive: widget.directives["pageNext"], children: /* @__PURE__ */ jsx(Slot, { slotContent: state.slotNext, props: slotContext }) }, "next")
74
+ /* @__PURE__ */ jsx(NavButton, { disabled: state.nextDisabled, directive: widget.directives["pageNext"], children: /* @__PURE__ */ jsx(Slot, { slotContent: state.nextPageLabel, props: slotContext }) }, "next")
75
75
  );
76
76
  }
77
77
  if (state.boundaryLinks) {
78
78
  ItemsAfter.push(
79
- /* @__PURE__ */ jsx(NavButton, { disabled: state.nextDisabled, directive: widget.directives["pageLast"], children: /* @__PURE__ */ jsx(Slot, { slotContent: state.slotLast, props: slotContext }) }, "last")
79
+ /* @__PURE__ */ jsx(NavButton, { disabled: state.nextDisabled, directive: widget.directives["pageLast"], children: /* @__PURE__ */ jsx(Slot, { slotContent: state.lastPageLabel, props: slotContext }) }, "last")
80
80
  );
81
81
  }
82
82
  return /* @__PURE__ */ jsxs(Fragment, { children: [
83
83
  /* @__PURE__ */ jsxs("ul", { className: classNames("au-pagination", "pagination", { [`pagination-${state.size}`]: !!state.size }, state.className), children: [
84
84
  ItemsBefore,
85
- /* @__PURE__ */ jsx(Slot, { slotContent: state.slotPages, props: slotContext }),
85
+ /* @__PURE__ */ jsx(Slot, { slotContent: state.pagesDisplay, props: slotContext }),
86
86
  ItemsAfter
87
87
  ] }),
88
88
  /* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "visually-hidden", children: `${state.ariaLiveLabelText}` })
89
89
  ] });
90
90
  }
91
91
  function Pagination(props) {
92
- const [state, widget] = useWidgetWithConfig(createPagination, props, "pagination", defaultConfig);
92
+ const [state, widget] = useWidgetWithConfig(export_createPagination, props, "pagination", defaultConfig);
93
93
  const slotContext = { state, widget: toSlotContextWidget(widget) };
94
- return /* @__PURE__ */ jsx("nav", { "aria-label": state.ariaLabel, children: /* @__PURE__ */ jsx(Slot, { slotContent: state.slotStructure, props: slotContext }) });
94
+ return /* @__PURE__ */ jsx("nav", { "aria-label": state.ariaLabel, children: /* @__PURE__ */ jsx(Slot, { slotContent: state.structure, props: slotContext }) });
95
95
  }
96
96
  export {
97
97
  DefaultPages as D,
98
98
  NavButton as N,
99
- Pagination as P,
99
+ PageItem as P,
100
100
  DefaultStructure as a,
101
- PageItem as b,
102
- createPagination as c,
103
- getPaginationDefaultConfig as g
101
+ Pagination as b,
102
+ export_createPagination as c,
103
+ export_getPaginationDefaultConfig as e
104
104
  };