@agnos-ui/react-bootstrap 0.4.0-next.1 → 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 +123 -23
  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 +188 -18
  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 +54 -1
  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-1m6cSYmZ.cjs → modal-Cyt40iyH.cjs} +14 -11
  54. package/{modal-BJy1upw0.js → modal-qidZ4ghL.js} +15 -12
  55. package/package.json +3 -3
  56. package/{pagination-B76wbKhG.js → pagination-BDq1dOoH.js} +9 -9
  57. package/{pagination-DeZ2Eb3e.cjs → pagination-ChA90-py.cjs} +6 -6
  58. package/{progressbar-UDs4TPtQ.js → progressbar-B0keLNtE.js} +8 -8
  59. package/{progressbar-DKshX5DJ.cjs → progressbar-Fa1PDviu.cjs} +7 -7
  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,13 +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 directive = require("@agnos-ui/react-headless/utils/directive");
4
5
  const React = require("react");
5
6
  const generated_config = require("./generated/config.cjs");
6
- const directive = require("@agnos-ui/react-headless/utils/directive");
7
7
  const accordion = require("@agnos-ui/core-bootstrap/components/accordion");
8
- const createAccordion = accordion.createAccordion;
9
- const getAccordionDefaultConfig = accordion.getAccordionDefaultConfig;
10
- const createAccordionItem = accordion.createAccordionItem;
8
+ const export_getAccordionDefaultConfig = accordion.getAccordionDefaultConfig;
9
+ const export_createAccordionItem = accordion.createAccordionItem;
10
+ const export_createAccordion = accordion.createAccordion;
11
+ const export_factoryCreateAccordion = accordion.factoryCreateAccordion;
11
12
  const Header = (props) => {
12
13
  const re = new RegExp("^h[1-6]$");
13
14
  const Heading = re.test(props.headerTag) ? props.headerTag : "h2";
@@ -39,13 +40,14 @@ const AccordionItem = React.forwardRef(
39
40
  );
40
41
  const Accordion = React.forwardRef(
41
42
  function Accordion2(props, ref) {
42
- const widget = generated_config.useWidgetWithConfig(createAccordion, props, "accordion")[1];
43
+ const widget = generated_config.useWidgetWithConfig(export_createAccordion, props, "accordion")[1];
43
44
  React.useImperativeHandle(ref, () => widget.api, []);
44
45
  return /* @__PURE__ */ jsxRuntime.jsx(AccordionDIContext.Provider, { value: widget.api, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirectives([directive.classDirective, "accordion"], widget.directives.accordionDirective), children: props.children }) });
45
46
  }
46
47
  );
47
48
  exports.Accordion = Accordion;
48
49
  exports.AccordionItem = AccordionItem;
49
- exports.createAccordion = createAccordion;
50
- exports.createAccordionItem = createAccordionItem;
51
- exports.getAccordionDefaultConfig = getAccordionDefaultConfig;
50
+ exports.export_createAccordion = export_createAccordion;
51
+ exports.export_createAccordionItem = export_createAccordionItem;
52
+ exports.export_factoryCreateAccordion = export_factoryCreateAccordion;
53
+ exports.export_getAccordionDefaultConfig = export_getAccordionDefaultConfig;
@@ -1,12 +1,13 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
+ import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
3
4
  import { createContext, forwardRef, useContext, useImperativeHandle, useEffect } from "react";
4
5
  import { useWidgetWithConfig } from "./generated/config.js";
5
- import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
6
- import { createAccordion as createAccordion$1, getAccordionDefaultConfig as getAccordionDefaultConfig$1, createAccordionItem as createAccordionItem$1 } from "@agnos-ui/core-bootstrap/components/accordion";
7
- const createAccordion = createAccordion$1;
8
- const getAccordionDefaultConfig = getAccordionDefaultConfig$1;
9
- const createAccordionItem = createAccordionItem$1;
6
+ import { getAccordionDefaultConfig, createAccordionItem, createAccordion, factoryCreateAccordion } from "@agnos-ui/core-bootstrap/components/accordion";
7
+ const export_getAccordionDefaultConfig = getAccordionDefaultConfig;
8
+ const export_createAccordionItem = createAccordionItem;
9
+ const export_createAccordion = createAccordion;
10
+ const export_factoryCreateAccordion = factoryCreateAccordion;
10
11
  const Header = (props) => {
11
12
  const re = new RegExp("^h[1-6]$");
12
13
  const Heading = re.test(props.headerTag) ? props.headerTag : "h2";
@@ -38,15 +39,16 @@ const AccordionItem = forwardRef(
38
39
  );
39
40
  const Accordion = forwardRef(
40
41
  function Accordion2(props, ref) {
41
- const widget = useWidgetWithConfig(createAccordion, props, "accordion")[1];
42
+ const widget = useWidgetWithConfig(export_createAccordion, props, "accordion")[1];
42
43
  useImperativeHandle(ref, () => widget.api, []);
43
44
  return /* @__PURE__ */ jsx(AccordionDIContext.Provider, { value: widget.api, children: /* @__PURE__ */ jsx("div", { ...useDirectives([classDirective, "accordion"], widget.directives.accordionDirective), children: props.children }) });
44
45
  }
45
46
  );
46
47
  export {
47
48
  AccordionItem as A,
48
- createAccordionItem as a,
49
- Accordion as b,
50
- createAccordion as c,
51
- getAccordionDefaultConfig as g
49
+ Accordion as a,
50
+ export_createAccordionItem as b,
51
+ export_createAccordion as c,
52
+ export_factoryCreateAccordion as d,
53
+ export_getAccordionDefaultConfig as e
52
54
  };
@@ -1,11 +1,11 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import { Slot } from "@agnos-ui/react-headless/slot";
3
- import { useWidgetWithConfig } from "./generated/config.js";
4
3
  import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
5
4
  import { forwardRef, useImperativeHandle } from "react";
6
- import { createAlert as createAlert$1, getAlertDefaultConfig as getAlertDefaultConfig$1 } from "@agnos-ui/core-bootstrap/components/alert";
7
- const createAlert = createAlert$1;
8
- const getAlertDefaultConfig = getAlertDefaultConfig$1;
5
+ import { useWidgetWithConfig } from "./generated/config.js";
6
+ import { getAlertDefaultConfig, createAlert } from "@agnos-ui/core-bootstrap/components/alert";
7
+ const export_getAlertDefaultConfig = getAlertDefaultConfig;
8
+ const export_createAlert = createAlert;
9
9
  const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
10
10
  /* @__PURE__ */ jsx("div", { className: "alert-body", children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
11
11
  slotContext.state.dismissible && /* @__PURE__ */ jsx("button", { type: "button", className: "btn-close", onClick: slotContext.widget.api.close, "aria-label": slotContext.state.ariaCloseButtonLabel })
@@ -28,7 +28,7 @@ const AlertElement = (slotContext) => /* @__PURE__ */ jsx(
28
28
  }
29
29
  );
30
30
  const Alert = forwardRef(function Alert2(props, ref) {
31
- const [state, widget] = useWidgetWithConfig(createAlert, props, "alert", defaultConfig);
31
+ const [state, widget] = useWidgetWithConfig(export_createAlert, props, "alert", defaultConfig);
32
32
  useImperativeHandle(ref, () => widget.api, []);
33
33
  const slotContext = {
34
34
  state,
@@ -38,6 +38,6 @@ const Alert = forwardRef(function Alert2(props, ref) {
38
38
  });
39
39
  export {
40
40
  Alert as A,
41
- createAlert as c,
42
- getAlertDefaultConfig as g
41
+ export_createAlert as a,
42
+ export_getAlertDefaultConfig as e
43
43
  };
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const slot = require("@agnos-ui/react-headless/slot");
4
- const generated_config = require("./generated/config.cjs");
5
4
  const directive = require("@agnos-ui/react-headless/utils/directive");
6
5
  const React = require("react");
6
+ const generated_config = require("./generated/config.cjs");
7
7
  const alert = require("@agnos-ui/core-bootstrap/components/alert");
8
- const createAlert = alert.createAlert;
9
- const getAlertDefaultConfig = alert.getAlertDefaultConfig;
8
+ const export_getAlertDefaultConfig = alert.getAlertDefaultConfig;
9
+ const export_createAlert = alert.createAlert;
10
10
  const DefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11
11
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "alert-body", children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.children, props: slotContext }) }),
12
12
  slotContext.state.dismissible && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "btn-close", onClick: slotContext.widget.api.close, "aria-label": slotContext.state.ariaCloseButtonLabel })
@@ -29,7 +29,7 @@ const AlertElement = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx(
29
29
  }
30
30
  );
31
31
  const Alert = React.forwardRef(function Alert2(props, ref) {
32
- const [state, widget] = generated_config.useWidgetWithConfig(createAlert, props, "alert", defaultConfig);
32
+ const [state, widget] = generated_config.useWidgetWithConfig(export_createAlert, props, "alert", defaultConfig);
33
33
  React.useImperativeHandle(ref, () => widget.api, []);
34
34
  const slotContext = {
35
35
  state,
@@ -38,5 +38,5 @@ const Alert = React.forwardRef(function Alert2(props, ref) {
38
38
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !state.hidden && /* @__PURE__ */ jsxRuntime.jsx(AlertElement, { ...slotContext }) });
39
39
  });
40
40
  exports.Alert = Alert;
41
- exports.createAlert = createAlert;
42
- exports.getAlertDefaultConfig = getAlertDefaultConfig;
41
+ exports.export_createAlert = export_createAlert;
42
+ exports.export_getAlertDefaultConfig = export_getAlertDefaultConfig;
@@ -1,9 +1,4 @@
1
1
  import type { ForwardRefExoticComponent, PropsWithChildren, RefAttributes } from 'react';
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';
5
- export declare const createAccordion: WidgetFactory<AccordionWidget>;
6
- export declare const getAccordionDefaultConfig: () => AccordionProps;
7
- export declare const createAccordionItem: WidgetFactory<AccordionItemWidget>;
2
+ import type { AccordionApi, AccordionItemApi, AccordionItemProps, AccordionProps } from './accordion.gen';
8
3
  export declare const AccordionItem: ForwardRefExoticComponent<Partial<AccordionItemProps> & RefAttributes<AccordionItemApi>>;
9
4
  export declare const Accordion: ForwardRefExoticComponent<PropsWithChildren<Partial<AccordionProps>> & RefAttributes<AccordionApi>>;
@@ -1,5 +1,11 @@
1
- import type { WidgetSlotContext, SlotContent, Widget, PropsConfig, Directive } from '@agnos-ui/react-headless/types';
1
+ import type { WidgetSlotContext, SlotContent, Widget, WidgetFactory, ConfigValidator, PropsConfig, 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 accordion config
5
+ * @returns the default accordion config
6
+ */
7
+ declare const export_getAccordionDefaultConfig: () => AccordionProps;
8
+ export { export_getAccordionDefaultConfig as getAccordionDefaultConfig };
3
9
  export type AccordionItemContext = WidgetSlotContext<AccordionItemWidget>;
4
10
  export interface AccordionState {
5
11
  /**
@@ -8,6 +14,8 @@ export interface AccordionState {
8
14
  itemWidgets: AccordionItemWidget[];
9
15
  /**
10
16
  * CSS classes to be applied on the widget main container
17
+ *
18
+ * @defaultValue `''`
11
19
  */
12
20
  className: string;
13
21
  /**
@@ -21,61 +29,96 @@ export interface AccordionState {
21
29
  itemStructure: SlotContent<AccordionItemContext>;
22
30
  }
23
31
  export interface AccordionProps {
32
+ /**
33
+ * The transition to use for the accordion-item body-container when the accordion-item is toggled.
34
+ *
35
+ * @defaultValue
36
+ * ```ts
37
+ * collapseVerticalTransition
38
+ * ```
39
+ */
40
+ itemTransition: TransitionFn;
24
41
  /**
25
42
  * If `true`, only one accordion-item at the time can stay open.
43
+ *
44
+ * @defaultValue `false`
26
45
  */
27
46
  closeOthers: boolean;
28
47
  /**
29
48
  * An event fired when an item is shown.
30
49
  *
31
50
  * Event payload is the id of the item.
51
+ *
52
+ * @defaultValue
53
+ * ```ts
54
+ * () => {}
55
+ * ```
32
56
  */
33
57
  onItemShown: (itemId: string) => void;
34
58
  /**
35
59
  * An event fired when an item is hidden.
36
60
  *
37
61
  * Event payload is the id of the item.
62
+ *
63
+ * @defaultValue
64
+ * ```ts
65
+ * () => {}
66
+ * ```
38
67
  */
39
68
  onItemHidden: (itemId: string) => void;
40
69
  /**
41
70
  * 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.
71
+ *
72
+ * @defaultValue `true`
42
73
  */
43
74
  itemDestroyOnHide: boolean;
44
75
  /**
45
76
  * If `true`, accordion-item will be animated.
77
+ *
78
+ * @defaultValue `true`
46
79
  */
47
80
  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
81
  /**
53
82
  * CSS classes to add on the accordion-item DOM element.
83
+ *
84
+ * @defaultValue `''`
54
85
  */
55
86
  itemClassName: string;
56
87
  /**
57
88
  * CSS classes to add on the accordion-item header DOM element.
89
+ *
90
+ * @defaultValue `''`
58
91
  */
59
92
  itemHeaderClassName: string;
60
93
  /**
61
94
  * CSS classes to add on the accordion-item toggle button DOM element.
95
+ *
96
+ * @defaultValue `''`
62
97
  */
63
98
  itemButtonClassName: string;
64
99
  /**
65
100
  * CSS classes to add on the accordion-item body container DOM element.
66
101
  * The accordion-item body container is the DOM element on what the itemTransition is applied.
102
+ *
103
+ * @defaultValue `''`
67
104
  */
68
105
  itemBodyContainerClassName: string;
69
106
  /**
70
107
  * CSS classes to add on the accordion-item body DOM element.
108
+ *
109
+ * @defaultValue `''`
71
110
  */
72
111
  itemBodyClassName: string;
73
112
  /**
74
113
  * The html tag to use for the accordion-item-header.
114
+ *
115
+ * @defaultValue `''`
75
116
  */
76
117
  itemHeadingTag: string;
77
118
  /**
78
119
  * CSS classes to be applied on the widget main container
120
+ *
121
+ * @defaultValue `''`
79
122
  */
80
123
  className: string;
81
124
  /**
@@ -131,6 +174,8 @@ export interface AccordionItemState {
131
174
  headingTag: string;
132
175
  /**
133
176
  * CSS classes to be applied on the widget main container
177
+ *
178
+ * @defaultValue `''`
134
179
  */
135
180
  className: string;
136
181
  /**
@@ -218,6 +263,8 @@ export interface AccordionItemProps {
218
263
  headingTag: string;
219
264
  /**
220
265
  * CSS classes to be applied on the widget main container
266
+ *
267
+ * @defaultValue `''`
221
268
  */
222
269
  className: string;
223
270
  /**
@@ -243,6 +290,31 @@ export interface AccordionItemProps {
243
290
  header: SlotContent<AccordionItemContext>;
244
291
  }
245
292
  export type AccordionItemWidget = Widget<AccordionItemProps, AccordionItemState, AccordionItemApi, AccordionItemActions, AccordionItemDirectives>;
293
+ /**
294
+ * Create an AccordionItemWidget with given config props
295
+ * @param config - an optional AccordionItem config
296
+ * @returns an AccordionItemWidget
297
+ */
298
+ declare const export_createAccordionItem: WidgetFactory<AccordionItemWidget>;
299
+ export { export_createAccordionItem as createAccordionItem };
300
+ /**
301
+ * Create an AccordionWidget with given config props
302
+ * @param config - an optional accordion config
303
+ * @returns an AccordionWidget
304
+ */
305
+ declare const export_createAccordion: WidgetFactory<AccordionWidget>;
306
+ export { export_createAccordion as createAccordion };
307
+ /**
308
+ * Create an accordion WidgetFactory based on a item factory and the list of item props that should inherit from the parent accordion
309
+ *
310
+ * @param itemFactory - the item factory
311
+ * @param accordionItemProps - the list of item props
312
+ * @param accordionConfig - the default accordion config
313
+ * @param accordionValidator - the validator of props
314
+ * @returns the accordion widget factory
315
+ */
316
+ declare const export_factoryCreateAccordion: (itemFactory?: WidgetFactory<AccordionItemWidget>, accordionItemProps?: string[], accordionConfig?: AccordionProps, accordionValidator?: ConfigValidator<AccordionProps>) => WidgetFactory<AccordionWidget>;
317
+ export { export_factoryCreateAccordion as factoryCreateAccordion };
246
318
  export interface AccordionApi {
247
319
  /**
248
320
  * Given the itemId, will expand the corresponding accordion-item.
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const accordion = require("../../accordion-DnlQmoOX.cjs");
3
+ const accordion = require("../../accordion-CG9yl3xh.cjs");
4
4
  exports.Accordion = accordion.Accordion;
5
5
  exports.AccordionItem = accordion.AccordionItem;
6
- exports.createAccordion = accordion.createAccordion;
7
- exports.createAccordionItem = accordion.createAccordionItem;
8
- exports.getAccordionDefaultConfig = accordion.getAccordionDefaultConfig;
6
+ exports.createAccordion = accordion.export_createAccordion;
7
+ exports.createAccordionItem = accordion.export_createAccordionItem;
8
+ exports.factoryCreateAccordion = accordion.export_factoryCreateAccordion;
9
+ exports.getAccordionDefaultConfig = accordion.export_getAccordionDefaultConfig;
@@ -1 +1,2 @@
1
1
  export * from './accordion';
2
+ export * from './accordion.gen';
@@ -1,8 +1,9 @@
1
- import { b, A, c, a, g } from "../../accordion-CMbgQzoG.js";
1
+ import { a, A, c, b, d, e } from "../../accordion-DKdL2Sr3.js";
2
2
  export {
3
- b as Accordion,
3
+ a as Accordion,
4
4
  A as AccordionItem,
5
5
  c as createAccordion,
6
- a as createAccordionItem,
7
- g as getAccordionDefaultConfig
6
+ b as createAccordionItem,
7
+ d as factoryCreateAccordion,
8
+ e as getAccordionDefaultConfig
8
9
  };
@@ -1,7 +1,3 @@
1
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';
5
- export declare const createAlert: WidgetFactory<AlertWidget>;
6
- export declare const getAlertDefaultConfig: () => AlertProps;
2
+ import type { AlertApi, AlertProps } from './alert.gen';
7
3
  export declare const Alert: ForwardRefExoticComponent<Partial<AlertProps> & RefAttributes<AlertApi>>;
@@ -1,6 +1,12 @@
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 { BSContextualClass } from '@agnos-ui/core-bootstrap/types';
3
3
  import type { TransitionFn } from '@agnos-ui/react-headless/services/transitions/baseTransitions';
4
+ /**
5
+ * Retrieve a shallow copy of the default Alert config
6
+ * @returns the default Alert config
7
+ */
8
+ declare const export_getAlertDefaultConfig: () => AlertProps;
9
+ export { export_getAlertDefaultConfig as getAlertDefaultConfig };
4
10
  export type AlertContext = WidgetSlotContext<AlertWidget>;
5
11
  export interface AlertState {
6
12
  /**
@@ -10,18 +16,26 @@ export interface AlertState {
10
16
  /**
11
17
  * If `true`, alert can be dismissed by the user.
12
18
  * The close button (×) will be displayed and you can be notified of the event with the (close) output.
19
+ *
20
+ * @defaultValue `true`
13
21
  */
14
22
  dismissible: boolean;
15
23
  /**
16
24
  * If `true` the alert is visible to the user
25
+ *
26
+ * @defaultValue `true`
17
27
  */
18
28
  visible: boolean;
19
29
  /**
20
30
  * Accessibility close button label
31
+ *
32
+ * @defaultValue `'Close'`
21
33
  */
22
34
  ariaCloseButtonLabel: string;
23
35
  /**
24
36
  * CSS classes to be applied on the widget main container
37
+ *
38
+ * @defaultValue `''`
25
39
  */
26
40
  className: string;
27
41
  /**
@@ -34,33 +48,54 @@ export interface AlertState {
34
48
  children: SlotContent<AlertContext>;
35
49
  /**
36
50
  * Type of the alert, following bootstrap types.
51
+ *
52
+ * @defaultValue `'primary'`
37
53
  */
38
54
  type: BSContextualClass;
39
55
  }
40
56
  export interface AlertProps {
57
+ /**
58
+ * The transition function will be executed when the alert is displayed or hidden.
59
+ *
60
+ * Depending on the value of `animatedOnInit`, the animation can be optionally skipped during the showing process.
61
+ *
62
+ * @defaultValue `fadeTransition`
63
+ */
64
+ transition: TransitionFn;
41
65
  /**
42
66
  * Callback called when the alert visibility changed.
67
+ *
68
+ * @defaultValue
69
+ * ```ts
70
+ * () => {}
71
+ * ```
43
72
  */
44
73
  onVisibleChange: (visible: boolean) => void;
45
74
  /**
46
75
  * Callback called when the alert is hidden.
76
+ *
77
+ * @defaultValue
78
+ * ```ts
79
+ * () => {}
80
+ * ```
47
81
  */
48
82
  onHidden: () => void;
49
83
  /**
50
84
  * Callback called when the alert is shown.
51
- */
52
- onShown: () => void;
53
- /**
54
- * The transition function will be executed when the alert is displayed or hidden.
55
85
  *
56
- * Depending on the value of `animatedOnInit`, the animation can be optionally skipped during the showing process.
86
+ * @defaultValue
87
+ * ```ts
88
+ * () => {}
89
+ * ```
57
90
  */
58
- transition: TransitionFn;
91
+ onShown: () => void;
59
92
  /**
60
93
  * If `true`, alert opening will be animated.
61
94
  *
62
95
  * Animation is triggered when the `.open()` function is called
63
96
  * or the visible prop is changed
97
+ *
98
+ * @defaultValue `false`
64
99
  */
65
100
  animatedOnInit: boolean;
66
101
  /**
@@ -68,23 +103,33 @@ export interface AlertProps {
68
103
  *
69
104
  * Animation is triggered when clicked on the close button (×),
70
105
  * via the `.close()` function or the visible prop is changed
106
+ *
107
+ * @defaultValue `true`
71
108
  */
72
109
  animated: boolean;
73
110
  /**
74
111
  * If `true`, alert can be dismissed by the user.
75
112
  * The close button (×) will be displayed and you can be notified of the event with the (close) output.
113
+ *
114
+ * @defaultValue `true`
76
115
  */
77
116
  dismissible: boolean;
78
117
  /**
79
118
  * If `true` the alert is visible to the user
119
+ *
120
+ * @defaultValue `true`
80
121
  */
81
122
  visible: boolean;
82
123
  /**
83
124
  * Accessibility close button label
125
+ *
126
+ * @defaultValue `'Close'`
84
127
  */
85
128
  ariaCloseButtonLabel: string;
86
129
  /**
87
130
  * CSS classes to be applied on the widget main container
131
+ *
132
+ * @defaultValue `''`
88
133
  */
89
134
  className: string;
90
135
  /**
@@ -97,10 +142,19 @@ export interface AlertProps {
97
142
  children: SlotContent<AlertContext>;
98
143
  /**
99
144
  * Type of the alert, following bootstrap types.
145
+ *
146
+ * @defaultValue `'primary'`
100
147
  */
101
148
  type: BSContextualClass;
102
149
  }
103
150
  export type AlertWidget = Widget<AlertProps, AlertState, AlertApi, object, AlertDirectives>;
151
+ /**
152
+ * Create an AlertWidget with given config props
153
+ * @param config - an optional alert config
154
+ * @returns an AlertWidget
155
+ */
156
+ declare const export_createAlert: WidgetFactory<AlertWidget>;
157
+ export { export_createAlert as createAlert };
104
158
  export interface AlertApi {
105
159
  /**
106
160
  * Triggers alert closing programmatically (same as clicking on the close button (×)).
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const alert = require("../../alert-Bn5ooyqK.cjs");
3
+ const alert = require("../../alert-DeQRFTm3.cjs");
4
4
  exports.Alert = alert.Alert;
5
- exports.createAlert = alert.createAlert;
6
- exports.getAlertDefaultConfig = alert.getAlertDefaultConfig;
5
+ exports.createAlert = alert.export_createAlert;
6
+ exports.getAlertDefaultConfig = alert.export_getAlertDefaultConfig;
@@ -1 +1,2 @@
1
1
  export * from './alert';
2
+ export * from './alert.gen';
@@ -1,6 +1,6 @@
1
- import { A, c, g } from "../../alert-DKl7HLhb.js";
1
+ import { A, a, e } from "../../alert-0W1n8ahW.js";
2
2
  export {
3
3
  A as Alert,
4
- c as createAlert,
5
- g as getAlertDefaultConfig
4
+ a as createAlert,
5
+ e as getAlertDefaultConfig
6
6
  };
@@ -1,16 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const modal = require("../../modal-1m6cSYmZ.cjs");
4
- const modal$1 = require("@agnos-ui/react-headless/components/modal");
3
+ const modal = require("../../modal-Cyt40iyH.cjs");
5
4
  exports.Modal = modal.Modal;
6
- exports.createModal = modal.createModal;
7
- exports.getModalDefaultConfig = modal.getModalDefaultConfig;
5
+ exports.createModal = modal.export_createModal;
6
+ exports.getModalDefaultConfig = modal.export_getModalDefaultConfig;
7
+ exports.modalCloseButtonClick = modal.export_modalCloseButtonClick;
8
+ exports.modalOutsideClick = modal.export_modalOutsideClick;
8
9
  exports.openModal = modal.openModal;
9
- Object.defineProperty(exports, "modalCloseButtonClick", {
10
- enumerable: true,
11
- get: () => modal$1.modalCloseButtonClick
12
- });
13
- Object.defineProperty(exports, "modalOutsideClick", {
14
- enumerable: true,
15
- get: () => modal$1.modalOutsideClick
16
- });
@@ -1 +1,2 @@
1
1
  export * from './modal';
2
+ export * from './modal.gen';
@@ -1,10 +1,9 @@
1
- import { M, c, g, o } from "../../modal-BJy1upw0.js";
2
- import { modalCloseButtonClick, modalOutsideClick } from "@agnos-ui/react-headless/components/modal";
1
+ import { M, a, e, c, b, o } from "../../modal-qidZ4ghL.js";
3
2
  export {
4
3
  M as Modal,
5
- c as createModal,
6
- g as getModalDefaultConfig,
7
- modalCloseButtonClick,
8
- modalOutsideClick,
4
+ a as createModal,
5
+ e as getModalDefaultConfig,
6
+ c as modalCloseButtonClick,
7
+ b as modalOutsideClick,
9
8
  o as openModal
10
9
  };
@@ -1,9 +1,4 @@
1
- import type { PropsConfig } from '@agnos-ui/react-headless/types';
2
1
  import type { RefAttributes } from 'react';
3
- import type { ModalApi, ModalProps, ModalWidget } from './modal.gen';
4
- export type * from './modal.gen';
5
- export declare const createModal: <Data>(propsConfig?: PropsConfig<ModalProps<Data>>) => ModalWidget<Data>;
6
- export { modalCloseButtonClick, modalOutsideClick } from '@agnos-ui/react-headless/components/modal';
7
- export declare const getModalDefaultConfig: () => ModalProps<any>;
2
+ import type { ModalApi, ModalProps } from './modal.gen';
8
3
  export declare const Modal: <Data>(props: Partial<ModalProps<Data>> & RefAttributes<ModalApi<Data>>) => JSX.Element;
9
4
  export declare function openModal<Data>(options: Partial<ModalProps<Data>>): Promise<any>;