@agnos-ui/react-bootstrap 0.8.0-next.1 → 0.8.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 (35) hide show
  1. package/{accordion-QclyKh8E.cjs → accordion-CKX3QpIN.cjs} +3 -1
  2. package/{accordion-Id2wOeL4.js → accordion-CrXiNNLE.js} +4 -2
  3. package/carousel-B8b91cHo.cjs +72 -0
  4. package/carousel-CB4uoAm0.js +73 -0
  5. package/{collapse-UMbDs6Gh.cjs → collapse-BQNW5NFj.cjs} +2 -1
  6. package/{collapse-BOXBa8_8.js → collapse-DojQXsLN.js} +3 -2
  7. package/components/accordion/index.cjs +1 -1
  8. package/components/accordion/index.js +1 -1
  9. package/components/carousel/carousel.d.ts +39 -0
  10. package/components/carousel/carousel.gen.d.ts +358 -0
  11. package/components/carousel/index.cjs +8 -0
  12. package/components/carousel/index.d.ts +2 -0
  13. package/components/carousel/index.js +8 -0
  14. package/components/collapse/index.cjs +1 -1
  15. package/components/collapse/index.js +1 -1
  16. package/components/slider/index.cjs +1 -1
  17. package/components/slider/index.js +1 -1
  18. package/components/toast/index.cjs +10 -5
  19. package/components/toast/index.d.ts +1 -0
  20. package/components/toast/index.js +7 -2
  21. package/components/toast/toast.gen.d.ts +85 -0
  22. package/components/toast/toasterProvider.d.ts +34 -0
  23. package/config.gen.d.ts +5 -0
  24. package/generated/types.cjs +7 -0
  25. package/generated/types.d.ts +1 -1
  26. package/generated/types.js +1 -0
  27. package/index.cjs +26 -8
  28. package/index.d.ts +1 -0
  29. package/index.js +52 -40
  30. package/package.json +5 -3
  31. package/{slider-BQ9e4Vf9.cjs → slider-CkKKSyai.cjs} +1 -1
  32. package/{slider-CkQ5_vKI.js → slider-ZmbENVpb.js} +1 -1
  33. package/{toast-BUHjCme7.js → toasterProvider-DO_5lfVp.js} +61 -3
  34. package/{toast-CkwIDuRg.cjs → toasterProvider-glQ29Go3.cjs} +60 -2
  35. package/types.d.ts +2 -0
@@ -1,4 +1,4 @@
1
- import { c, S, b, a, d, e } from "../../slider-CkQ5_vKI.js";
1
+ import { c, S, b, a, d, e } from "../../slider-ZmbENVpb.js";
2
2
  export {
3
3
  c as Slider,
4
4
  S as SliderDefaultSlotHandle,
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const toast = require("../../toast-CkwIDuRg.cjs");
4
- exports.Toast = toast.Toast;
5
- exports.ToastDefaultSlotStructure = toast.ToastDefaultSlotStructure;
6
- exports.createToast = toast.export_createToast;
7
- exports.getToastDefaultConfig = toast.export_getToastDefaultConfig;
3
+ const toasterProvider = require("../../toasterProvider-glQ29Go3.cjs");
4
+ exports.Toast = toasterProvider.Toast;
5
+ exports.ToastDefaultSlotStructure = toasterProvider.ToastDefaultSlotStructure;
6
+ exports.ToasterContainer = toasterProvider.ToasterContainer;
7
+ exports.ToasterProvider = toasterProvider.ToasterProvider;
8
+ exports.createToast = toasterProvider.export_createToast;
9
+ exports.defaultToasterProps = toasterProvider.export_defaultToasterProps;
10
+ exports.getToastDefaultConfig = toasterProvider.export_getToastDefaultConfig;
11
+ exports.toastPositions = toasterProvider.export_toastPositions;
12
+ exports.useToaster = toasterProvider.useToaster;
@@ -1,2 +1,3 @@
1
1
  export * from './toast';
2
2
  export * from './toast.gen';
3
+ export * from './toasterProvider';
@@ -1,7 +1,12 @@
1
- import { a, T, b, e } from "../../toast-BUHjCme7.js";
1
+ import { a, T, f, g, b, d, e, c, u } from "../../toasterProvider-DO_5lfVp.js";
2
2
  export {
3
3
  a as Toast,
4
4
  T as ToastDefaultSlotStructure,
5
+ f as ToasterContainer,
6
+ g as ToasterProvider,
5
7
  b as createToast,
6
- e as getToastDefaultConfig
8
+ d as defaultToasterProps,
9
+ e as getToastDefaultConfig,
10
+ c as toastPositions,
11
+ u as useToaster
7
12
  };
@@ -188,6 +188,21 @@ export type ToastWidget = Widget<ToastProps, ToastState, ToastApi, ToastDirectiv
188
188
  */
189
189
  declare const export_createToast: WidgetFactory<ToastWidget>;
190
190
  export { export_createToast as createToast };
191
+ /**
192
+ * A mapping of toast position keys to their corresponding CSS class strings of bootstrap.
193
+ * These classes define the positioning of toast notifications on the screen.
194
+ *
195
+ * The keys represent various positions on the screen, such as top-left, top-center,
196
+ * middle-right, etc., and the values are the CSS classes of bootstrap that apply the respective
197
+ * positioning styles.
198
+ *
199
+ * Example usage:
200
+ * ```typescript
201
+ * const positionClass = toastPositions.topLeft; // "top-0 start-0"
202
+ * ```
203
+ */
204
+ declare const export_toastPositions: Record<ToastPositions, string>;
205
+ export { export_toastPositions as toastPositions };
191
206
  /**
192
207
  * Represents the API for the toast component.
193
208
  */
@@ -222,3 +237,73 @@ export interface ToastDirectives {
222
237
  */
223
238
  closeButtonDirective: Directive;
224
239
  }
240
+ /**
241
+ * Represents the possible positions for displaying a toast notification.
242
+ *
243
+ * The positions are defined based on a grid layout with three horizontal
244
+ * alignments (left, center, right) and three vertical alignments (top, middle, bottom).
245
+ *
246
+ * Available positions:
247
+ * - `topLeft`: Top-left corner of the screen.
248
+ * - `topCenter`: Top-center of the screen.
249
+ * - `topRight`: Top-right corner of the screen.
250
+ * - `middleLeft`: Middle-left side of the screen.
251
+ * - `middleCenter`: Center of the screen.
252
+ * - `middleRight`: Middle-right side of the screen.
253
+ * - `bottomLeft`: Bottom-left corner of the screen.
254
+ * - `bottomCenter`: Bottom-center of the screen.
255
+ * - `bottomRight`: Bottom-right corner of the screen.
256
+ */
257
+ export type ToastPositions = 'topLeft' | 'topCenter' | 'topRight' | 'middleLeft' | 'middleCenter' | 'middleRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
258
+ /**
259
+ * Props of the toaster
260
+ */
261
+ export interface ToasterProps {
262
+ /** How much time (ms) a toast is displayed; 0 means it won't be removed until a manual action */
263
+ duration: number;
264
+ /** Where to position the toasts */
265
+ position: ToastPositions;
266
+ /** Maximum number of toasts displayed */
267
+ limit?: number;
268
+ /** Pause toast when hover */
269
+ pauseOnHover?: boolean;
270
+ /** Display a dismiss button on each toast. When duration = 0, this is enforced to true */
271
+ dismissible: boolean;
272
+ /** Add a button to close all the toasts at once */
273
+ closeAll?: boolean;
274
+ /** Close all label */
275
+ closeAllLabel?: string;
276
+ }
277
+ /**
278
+ * Toast object
279
+ * @template Props Type of the toast properties.
280
+ */
281
+ export interface ToasterToast<Props> {
282
+ /** Identifier of the toasts in the toaster */
283
+ id: number;
284
+ /** Properties of the toast */
285
+ props: Props;
286
+ }
287
+ /**
288
+ * Represents a timer used by the toaster service.
289
+ */
290
+ export interface ToasterTimer {
291
+ /**
292
+ * The timeout identifier returned by `setTimeout`.
293
+ */
294
+ timeout: ReturnType<typeof setTimeout> | null;
295
+ /**
296
+ * The timestamp when the timer was started.
297
+ */
298
+ started: number;
299
+ /**
300
+ * The timestamp when the timer was paused (optional).
301
+ */
302
+ paused?: number;
303
+ /**
304
+ * The duration for which the timer is set (optional). Used internally to compute the remaining time.
305
+ */
306
+ duration: number;
307
+ }
308
+ declare const export_defaultToasterProps: ToasterProps;
309
+ export { export_defaultToasterProps as defaultToasterProps };
@@ -0,0 +1,34 @@
1
+ import type { ToasterProps, ToastProps } from './toast.gen';
2
+ import type { PropsWithChildren } from 'react';
3
+ /**
4
+ * Toaster component that displays a list of toast notifications.
5
+ *
6
+ * This component uses the `useToaster` hook to manage the state of the toasts.
7
+ * It renders a container with a list of toasts and an optional "Close all" button
8
+ * if the `closeAll` option is enabled and there is more than one toast.
9
+ *
10
+ * @returns The rendered Toaster component.
11
+ */
12
+ export declare function ToasterContainer(): import("react/jsx-runtime").JSX.Element;
13
+ /**
14
+ * ToasterProvider component to provide toaster context to its children.
15
+ * @param props - The properties object.
16
+ * @param [props.options] - Optional toaster properties.
17
+ * @param props.children - The children components.
18
+ * @returns The ToasterProvider component.
19
+ */
20
+ export declare const ToasterProvider: ({ options, children }: PropsWithChildren<{
21
+ options?: ToasterProps;
22
+ }>) => import("react/jsx-runtime").JSX.Element;
23
+ /**
24
+ * Custom hook to use the toaster context.
25
+ * @returns The toaster context.
26
+ */
27
+ export declare const useToaster: () => {
28
+ toasts: import("core/dist/components/toast").ToasterToast<Partial<ToastProps>>[];
29
+ options: import("core/dist/components/toast").ToasterProps;
30
+ addToast: (props: Partial<ToastProps>) => number;
31
+ removeToast: (id: number) => void;
32
+ eventsDirective: import("core/dist/types").Directive<number>;
33
+ closeAll: () => void;
34
+ };
package/config.gen.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { AccordionProps } from './components/accordion';
2
2
  import type { AlertProps } from './components/alert';
3
+ import type { CarouselProps } from './components/carousel';
3
4
  import type { CollapseProps } from './components/collapse';
4
5
  import type { ModalProps } from './components/modal';
5
6
  import type { PaginationProps } from './components/pagination';
@@ -18,6 +19,10 @@ export type WidgetsConfig = {
18
19
  * the alert widget config
19
20
  */
20
21
  alert: AlertProps;
22
+ /**
23
+ * the carousel widget config
24
+ */
25
+ carousel: CarouselProps<any>;
21
26
  /**
22
27
  * the collapse widget config
23
28
  */
@@ -1,9 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const types = require("@agnos-ui/react-headless/types");
4
+ const types$1 = require("@agnos-ui/core-bootstrap/types");
4
5
  Object.keys(types).forEach((k) => {
5
6
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
7
  enumerable: true,
7
8
  get: () => types[k]
8
9
  });
9
10
  });
11
+ Object.keys(types$1).forEach((k) => {
12
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
13
+ enumerable: true,
14
+ get: () => types$1[k]
15
+ });
16
+ });
@@ -1 +1 @@
1
- export * from '@agnos-ui/react-headless/types';
1
+ export * from './../types';
@@ -1 +1,2 @@
1
1
  export * from "@agnos-ui/react-headless/types";
2
+ export * from "@agnos-ui/core-bootstrap/types";
package/index.cjs CHANGED
@@ -1,17 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const accordion = require("./accordion-QclyKh8E.cjs");
3
+ const accordion = require("./accordion-CKX3QpIN.cjs");
4
4
  const alert = require("./alert-BGVw_vsM.cjs");
5
- const collapse = require("./collapse-UMbDs6Gh.cjs");
5
+ const carousel = require("./carousel-B8b91cHo.cjs");
6
+ const collapse = require("./collapse-BQNW5NFj.cjs");
6
7
  const modal = require("./modal-DQLOz7TE.cjs");
7
8
  const pagination = require("./pagination-Bq4Hvm1j.cjs");
8
9
  const progressbar = require("./progressbar-CnbqCXqH.cjs");
9
10
  const rating = require("./rating-BaZTCQi1.cjs");
10
11
  const select = require("./select-DHNspXXB.cjs");
11
- const slider = require("./slider-BQ9e4Vf9.cjs");
12
- const toast = require("./toast-CkwIDuRg.cjs");
12
+ const slider = require("./slider-CkKKSyai.cjs");
13
+ const toasterProvider = require("./toasterProvider-glQ29Go3.cjs");
13
14
  const tree = require("./tree-DT261j-0.cjs");
14
15
  const types = require("@agnos-ui/react-headless/types");
16
+ const types$1 = require("@agnos-ui/core-bootstrap/types");
15
17
  const slot = require("@agnos-ui/react-headless/slot");
16
18
  const config = require("@agnos-ui/react-headless/config");
17
19
  const generated_config = require("./generated/config.cjs");
@@ -47,6 +49,11 @@ exports.Alert = alert.Alert;
47
49
  exports.AlertDefaultSlotStructure = alert.AlertDefaultSlotStructure;
48
50
  exports.createAlert = alert.export_createAlert;
49
51
  exports.getAlertDefaultConfig = alert.export_getAlertDefaultConfig;
52
+ exports.Carousel = carousel.Carousel;
53
+ exports.CarouselDefaultNavigation = carousel.CarouselDefaultNavigation;
54
+ exports.CarouselDefaultStructure = carousel.CarouselDefaultStructure;
55
+ exports.createCarousel = carousel.export_createCarousel;
56
+ exports.getCarouselDefaultConfig = carousel.export_getCarouselDefaultConfig;
50
57
  exports.Collapse = collapse.Collapse;
51
58
  exports.createCollapse = collapse.export_createCollapse;
52
59
  exports.getCollapseDefaultConfig = collapse.export_getCollapseDefaultConfig;
@@ -81,10 +88,15 @@ exports.SliderDefaultSlotStructure = slider.SliderDefaultSlotStructure;
81
88
  exports.SliderDefaultTick = slider.SliderDefaultTick;
82
89
  exports.createSlider = slider.export_createSlider;
83
90
  exports.getSliderDefaultConfig = slider.export_getSliderDefaultConfig;
84
- exports.Toast = toast.Toast;
85
- exports.ToastDefaultSlotStructure = toast.ToastDefaultSlotStructure;
86
- exports.createToast = toast.export_createToast;
87
- exports.getToastDefaultConfig = toast.export_getToastDefaultConfig;
91
+ exports.Toast = toasterProvider.Toast;
92
+ exports.ToastDefaultSlotStructure = toasterProvider.ToastDefaultSlotStructure;
93
+ exports.ToasterContainer = toasterProvider.ToasterContainer;
94
+ exports.ToasterProvider = toasterProvider.ToasterProvider;
95
+ exports.createToast = toasterProvider.export_createToast;
96
+ exports.defaultToasterProps = toasterProvider.export_defaultToasterProps;
97
+ exports.getToastDefaultConfig = toasterProvider.export_getToastDefaultConfig;
98
+ exports.toastPositions = toasterProvider.export_toastPositions;
99
+ exports.useToaster = toasterProvider.useToaster;
88
100
  exports.DefaultTreeSlotItem = tree.DefaultTreeSlotItem;
89
101
  exports.DefaultTreeSlotItemContent = tree.DefaultTreeSlotItemContent;
90
102
  exports.DefaultTreeSlotItemToggle = tree.DefaultTreeSlotItemToggle;
@@ -102,6 +114,12 @@ Object.keys(types).forEach((k) => {
102
114
  get: () => types[k]
103
115
  });
104
116
  });
117
+ Object.keys(types$1).forEach((k) => {
118
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
119
+ enumerable: true,
120
+ get: () => types$1[k]
121
+ });
122
+ });
105
123
  Object.keys(slot).forEach((k) => {
106
124
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
107
125
  enumerable: true,
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './components/accordion';
2
2
  export * from './components/alert';
3
+ export * from './components/carousel';
3
4
  export * from './components/collapse';
4
5
  export * from './components/modal';
5
6
  export * from './components/pagination';
package/index.js CHANGED
@@ -1,15 +1,17 @@
1
- import { b, a, A, d, c, f, e } from "./accordion-Id2wOeL4.js";
1
+ import { b, a, A, d, c, f, e } from "./accordion-CrXiNNLE.js";
2
2
  import { a as a2, A as A2, b as b2, e as e2 } from "./alert-BM4ImSpO.js";
3
- import { C, a as a3, e as e3 } from "./collapse-BOXBa8_8.js";
4
- import { b as b3, M, a as a4, c as c2, e as e4, f as f2, d as d2, o } from "./modal-apFubipB.js";
5
- import { N, P, c as c3, a as a5, b as b4, d as d3, e as e5 } from "./pagination-B1Ho_-r4.js";
6
- import { a as a6, P as P2, b as b5, e as e6 } from "./progressbar-Ck20N_ee.js";
7
- import { R, a as a7, e as e7 } from "./rating-DziC4Tsh.js";
8
- import { S, a as a8, e as e8 } from "./select-ClQGKBMF.js";
9
- import { c as c4, S as S2, b as b6, a as a9, d as d4, e as e9 } from "./slider-CkQ5_vKI.js";
10
- import { a as a10, T, b as b7, e as e10 } from "./toast-BUHjCme7.js";
11
- import { b as b8, a as a11, D, c as c5, T as T2, d as d5, e as e11 } from "./tree-BflF5hyD.js";
3
+ import { c as c2, C, b as b3, a as a3, e as e3 } from "./carousel-CB4uoAm0.js";
4
+ import { C as C2, a as a4, e as e4 } from "./collapse-DojQXsLN.js";
5
+ import { b as b4, M, a as a5, c as c3, e as e5, f as f2, d as d2, o } from "./modal-apFubipB.js";
6
+ import { N, P, c as c4, a as a6, b as b5, d as d3, e as e6 } from "./pagination-B1Ho_-r4.js";
7
+ import { a as a7, P as P2, b as b6, e as e7 } from "./progressbar-Ck20N_ee.js";
8
+ import { R, a as a8, e as e8 } from "./rating-DziC4Tsh.js";
9
+ import { S, a as a9, e as e9 } from "./select-ClQGKBMF.js";
10
+ import { c as c5, S as S2, b as b7, a as a10, d as d4, e as e10 } from "./slider-ZmbENVpb.js";
11
+ import { a as a11, T, f as f3, g, b as b8, d as d5, e as e11, c as c6, u } from "./toasterProvider-DO_5lfVp.js";
12
+ import { b as b9, a as a12, D, c as c7, T as T2, d as d6, e as e12 } from "./tree-BflF5hyD.js";
12
13
  export * from "@agnos-ui/react-headless/types";
14
+ export * from "@agnos-ui/core-bootstrap/types";
13
15
  export * from "@agnos-ui/react-headless/slot";
14
16
  export * from "@agnos-ui/react-headless/config";
15
17
  import { WidgetsConfigContext, WidgetsDefaultConfig, useWidgetContext, useWidgetWithConfig } from "./generated/config.js";
@@ -40,59 +42,69 @@ export {
40
42
  A as AccordionItemDefaultSlotStructure,
41
43
  a2 as Alert,
42
44
  A2 as AlertDefaultSlotStructure,
43
- C as Collapse,
44
- b8 as DefaultTreeSlotItem,
45
- a11 as DefaultTreeSlotItemContent,
45
+ c2 as Carousel,
46
+ C as CarouselDefaultNavigation,
47
+ b3 as CarouselDefaultStructure,
48
+ C2 as Collapse,
49
+ b9 as DefaultTreeSlotItem,
50
+ a12 as DefaultTreeSlotItemContent,
46
51
  D as DefaultTreeSlotItemToggle,
47
- c5 as DefaultTreeSlotStructure,
48
- b3 as Modal,
52
+ c7 as DefaultTreeSlotStructure,
53
+ b4 as Modal,
49
54
  M as ModalDefaultSlotHeader,
50
- a4 as ModalDefaultSlotStructure,
55
+ a5 as ModalDefaultSlotStructure,
51
56
  N as NavButton,
52
57
  P as PageItem,
53
- c3 as Pagination,
54
- a5 as PaginationDefaultSlotPages,
55
- b4 as PaginationDefaultSlotStructure,
56
- a6 as Progressbar,
58
+ c4 as Pagination,
59
+ a6 as PaginationDefaultSlotPages,
60
+ b5 as PaginationDefaultSlotStructure,
61
+ a7 as Progressbar,
57
62
  P2 as ProgressbarDefaultSlotStructure,
58
63
  R as Rating,
59
64
  S as Select,
60
- c4 as Slider,
65
+ c5 as Slider,
61
66
  S2 as SliderDefaultSlotHandle,
62
- b6 as SliderDefaultSlotStructure,
63
- a9 as SliderDefaultTick,
64
- a10 as Toast,
67
+ b7 as SliderDefaultSlotStructure,
68
+ a10 as SliderDefaultTick,
69
+ a11 as Toast,
65
70
  T as ToastDefaultSlotStructure,
71
+ f3 as ToasterContainer,
72
+ g as ToasterProvider,
66
73
  T2 as Tree,
67
74
  WidgetsConfigContext,
68
75
  WidgetsDefaultConfig,
69
76
  d as createAccordion,
70
77
  c as createAccordionItem,
71
78
  b2 as createAlert,
72
- a3 as createCollapse,
73
- c2 as createModal,
79
+ a3 as createCarousel,
80
+ a4 as createCollapse,
81
+ c3 as createModal,
74
82
  d3 as createPagination,
75
- b5 as createProgressbar,
76
- a7 as createRating,
77
- a8 as createSelect,
83
+ b6 as createProgressbar,
84
+ a8 as createRating,
85
+ a9 as createSelect,
78
86
  d4 as createSlider,
79
- b7 as createToast,
80
- d5 as createTree,
87
+ b8 as createToast,
88
+ d6 as createTree,
89
+ d5 as defaultToasterProps,
81
90
  f as factoryCreateAccordion,
82
91
  e as getAccordionDefaultConfig,
83
92
  e2 as getAlertDefaultConfig,
84
- e3 as getCollapseDefaultConfig,
85
- e4 as getModalDefaultConfig,
86
- e5 as getPaginationDefaultConfig,
87
- e6 as getProgressbarDefaultConfig,
88
- e7 as getRatingDefaultConfig,
89
- e8 as getSelectDefaultConfig,
90
- e9 as getSliderDefaultConfig,
91
- e10 as getToastDefaultConfig,
92
- e11 as getTreeDefaultConfig,
93
+ e3 as getCarouselDefaultConfig,
94
+ e4 as getCollapseDefaultConfig,
95
+ e5 as getModalDefaultConfig,
96
+ e6 as getPaginationDefaultConfig,
97
+ e7 as getProgressbarDefaultConfig,
98
+ e8 as getRatingDefaultConfig,
99
+ e9 as getSelectDefaultConfig,
100
+ e10 as getSliderDefaultConfig,
101
+ e11 as getToastDefaultConfig,
102
+ e12 as getTreeDefaultConfig,
93
103
  f2 as modalCloseButtonClick,
94
104
  d2 as modalOutsideClick,
95
105
  o as openModal,
106
+ c6 as toastPositions,
107
+ u as useToaster,
96
108
  useWidgetContext,
97
109
  useWidgetWithConfig
98
110
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agnos-ui/react-bootstrap",
3
3
  "description": "Bootstrap-based component library for React.",
4
- "version": "0.8.0-next.1",
4
+ "version": "0.8.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.8.0-next.1",
53
- "@agnos-ui/react-headless": "0.8.0-next.1",
52
+ "@agnos-ui/core-bootstrap": "0.8.0",
53
+ "@agnos-ui/react-headless": "0.8.0",
54
54
  "clsx": "^2.1.1"
55
55
  },
56
56
  "peerDependencies": {
@@ -73,6 +73,7 @@
73
73
  "accordion",
74
74
  "AgnosUI",
75
75
  "alert",
76
+ "carousel",
76
77
  "collapse",
77
78
  "components",
78
79
  "modal",
@@ -81,6 +82,7 @@
81
82
  "rating",
82
83
  "slider",
83
84
  "toast",
85
+ "tree",
84
86
  "widgets"
85
87
  ]
86
88
  }
@@ -9,7 +9,7 @@ const slider = require("@agnos-ui/core-bootstrap/components/slider");
9
9
  const export_getSliderDefaultConfig = slider.getSliderDefaultConfig;
10
10
  const export_createSlider = slider.createSlider;
11
11
  const SliderDefaultSlotHandle = (slotContext) => {
12
- return /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirective(slotContext.directives.handleDirective, { item: slotContext.item }), children: " " });
12
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirective(slotContext.directives.handleDirective, { item: slotContext.item }) });
13
13
  };
14
14
  const TickLabelDisplay = ({ directive: directive$1, tick }) => {
15
15
  return /* @__PURE__ */ jsxRuntime.jsx("span", { ...directive.useDirective(directive$1, { tick }), children: tick.value });
@@ -8,7 +8,7 @@ import { getSliderDefaultConfig, createSlider } from "@agnos-ui/core-bootstrap/c
8
8
  const export_getSliderDefaultConfig = getSliderDefaultConfig;
9
9
  const export_createSlider = createSlider;
10
10
  const SliderDefaultSlotHandle = (slotContext) => {
11
- return /* @__PURE__ */ jsx("button", { ...useDirective(slotContext.directives.handleDirective, { item: slotContext.item }), children: " " });
11
+ return /* @__PURE__ */ jsx("button", { ...useDirective(slotContext.directives.handleDirective, { item: slotContext.item }) });
12
12
  };
13
13
  const TickLabelDisplay = ({ directive, tick }) => {
14
14
  return /* @__PURE__ */ jsx("span", { ...useDirective(directive, { tick }), children: tick.value });
@@ -1,11 +1,14 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useDirectives, classDirective, useDirective } from "@agnos-ui/react-headless/utils/directive";
3
+ import { useToaster as useToaster$1, ToasterProvider as ToasterProvider$1 } from "@agnos-ui/react-headless/components/toast";
4
+ import { getToastDefaultConfig, createToast, toastPositions, defaultToasterProps } from "@agnos-ui/core-bootstrap/components/toast";
2
5
  import { Slot } from "@agnos-ui/react-headless/slot";
3
- import { useDirectives, classDirective } from "@agnos-ui/react-headless/utils/directive";
4
6
  import { useImperativeHandle } from "react";
5
7
  import { useWidgetWithConfig } from "./generated/config.js";
6
- import { getToastDefaultConfig, createToast } from "@agnos-ui/core-bootstrap/components/toast";
7
8
  const export_getToastDefaultConfig = getToastDefaultConfig;
8
9
  const export_createToast = createToast;
10
+ const export_toastPositions = toastPositions;
11
+ const export_defaultToasterProps = defaultToasterProps;
9
12
  const ToastHeaderContent = (slotContext) => /* @__PURE__ */ jsx("button", { ...useDirectives([classDirective, "btn-close me-0 ms-auto"], slotContext.directives.closeButtonDirective) });
10
13
  const ToastHeader = (slotContext) => /* @__PURE__ */ jsxs("div", { className: "toast-header", children: [
11
14
  /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.header, props: slotContext }),
@@ -37,9 +40,64 @@ function Toast(props) {
37
40
  useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
38
41
  return /* @__PURE__ */ jsx(Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsx(ToastElement, { ...widgetContext }) });
39
42
  }
43
+ const ToastToaster = ({
44
+ id,
45
+ className,
46
+ visible,
47
+ structure,
48
+ children,
49
+ header,
50
+ dismissible,
51
+ ariaCloseButtonLabel,
52
+ animated,
53
+ animatedOnInit,
54
+ onShown,
55
+ onHidden,
56
+ onVisibleChange,
57
+ transition,
58
+ toaster
59
+ }) => /* @__PURE__ */ jsx("div", { ...useDirective(toaster.eventsDirective, id), children: /* @__PURE__ */ jsx(
60
+ Toast,
61
+ {
62
+ animated,
63
+ animatedOnInit,
64
+ autoHide: false,
65
+ className,
66
+ dismissible: dismissible ?? toaster.options.dismissible,
67
+ ariaCloseButtonLabel,
68
+ structure,
69
+ header,
70
+ onShown,
71
+ onHidden: () => {
72
+ toaster.removeToast(id);
73
+ onHidden == null ? void 0 : onHidden();
74
+ },
75
+ onVisibleChange,
76
+ visible,
77
+ transition,
78
+ children
79
+ }
80
+ ) });
81
+ function ToasterContainer() {
82
+ const toaster = useToaster();
83
+ return /* @__PURE__ */ jsx("div", { className: "au-toaster", "aria-live": "polite", "aria-atomic": "true", children: /* @__PURE__ */ jsxs("div", { className: `au-toaster-container toast-container ${export_toastPositions[toaster.options.position]}`, children: [
84
+ toaster.options.closeAll && toaster.toasts.length > 1 && /* @__PURE__ */ jsx("div", { className: "d-flex position-relative align-items-end pb-2", children: /* @__PURE__ */ jsx("button", { className: "au-toaster-closeAll btn btn-secondary me-0 ms-auto pe-auto", onClick: () => toaster.closeAll(), children: toaster.options.closeAllLabel || "Close all" }) }),
85
+ toaster.toasts.map(({ id, props }) => /* @__PURE__ */ jsx(ToastToaster, { id, ...props, toaster }, id))
86
+ ] }) });
87
+ }
88
+ const ToasterProvider = ({ options, children }) => /* @__PURE__ */ jsxs(ToasterProvider$1, { options, children: [
89
+ children,
90
+ /* @__PURE__ */ jsx(ToasterContainer, {})
91
+ ] });
92
+ const useToaster = () => useToaster$1();
40
93
  export {
41
94
  ToastDefaultSlotStructure as T,
42
95
  Toast as a,
43
96
  export_createToast as b,
44
- export_getToastDefaultConfig as e
97
+ export_toastPositions as c,
98
+ export_defaultToasterProps as d,
99
+ export_getToastDefaultConfig as e,
100
+ ToasterContainer as f,
101
+ ToasterProvider as g,
102
+ useToaster as u
45
103
  };
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
- const slot = require("@agnos-ui/react-headless/slot");
4
3
  const directive = require("@agnos-ui/react-headless/utils/directive");
4
+ const toast$1 = require("@agnos-ui/react-headless/components/toast");
5
+ const toast = require("@agnos-ui/core-bootstrap/components/toast");
6
+ const slot = require("@agnos-ui/react-headless/slot");
5
7
  const React = require("react");
6
8
  const generated_config = require("./generated/config.cjs");
7
- const toast = require("@agnos-ui/core-bootstrap/components/toast");
8
9
  const export_getToastDefaultConfig = toast.getToastDefaultConfig;
9
10
  const export_createToast = toast.createToast;
11
+ const export_toastPositions = toast.toastPositions;
12
+ const export_defaultToasterProps = toast.defaultToasterProps;
10
13
  const ToastHeaderContent = (slotContext) => /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirectives([directive.classDirective, "btn-close me-0 ms-auto"], slotContext.directives.closeButtonDirective) });
11
14
  const ToastHeader = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "toast-header", children: [
12
15
  /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.header, props: slotContext }),
@@ -38,7 +41,62 @@ function Toast(props) {
38
41
  React.useImperativeHandle(props.ref, () => widgetContext.api, [widgetContext.api]);
39
42
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !widgetContext.state.hidden && /* @__PURE__ */ jsxRuntime.jsx(ToastElement, { ...widgetContext }) });
40
43
  }
44
+ const ToastToaster = ({
45
+ id,
46
+ className,
47
+ visible,
48
+ structure,
49
+ children,
50
+ header,
51
+ dismissible,
52
+ ariaCloseButtonLabel,
53
+ animated,
54
+ animatedOnInit,
55
+ onShown,
56
+ onHidden,
57
+ onVisibleChange,
58
+ transition,
59
+ toaster
60
+ }) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(toaster.eventsDirective, id), children: /* @__PURE__ */ jsxRuntime.jsx(
61
+ Toast,
62
+ {
63
+ animated,
64
+ animatedOnInit,
65
+ autoHide: false,
66
+ className,
67
+ dismissible: dismissible ?? toaster.options.dismissible,
68
+ ariaCloseButtonLabel,
69
+ structure,
70
+ header,
71
+ onShown,
72
+ onHidden: () => {
73
+ toaster.removeToast(id);
74
+ onHidden == null ? void 0 : onHidden();
75
+ },
76
+ onVisibleChange,
77
+ visible,
78
+ transition,
79
+ children
80
+ }
81
+ ) });
82
+ function ToasterContainer() {
83
+ const toaster = useToaster();
84
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "au-toaster", "aria-live": "polite", "aria-atomic": "true", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `au-toaster-container toast-container ${export_toastPositions[toaster.options.position]}`, children: [
85
+ toaster.options.closeAll && toaster.toasts.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "d-flex position-relative align-items-end pb-2", children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: "au-toaster-closeAll btn btn-secondary me-0 ms-auto pe-auto", onClick: () => toaster.closeAll(), children: toaster.options.closeAllLabel || "Close all" }) }),
86
+ toaster.toasts.map(({ id, props }) => /* @__PURE__ */ jsxRuntime.jsx(ToastToaster, { id, ...props, toaster }, id))
87
+ ] }) });
88
+ }
89
+ const ToasterProvider = ({ options, children }) => /* @__PURE__ */ jsxRuntime.jsxs(toast$1.ToasterProvider, { options, children: [
90
+ children,
91
+ /* @__PURE__ */ jsxRuntime.jsx(ToasterContainer, {})
92
+ ] });
93
+ const useToaster = () => toast$1.useToaster();
41
94
  exports.Toast = Toast;
42
95
  exports.ToastDefaultSlotStructure = ToastDefaultSlotStructure;
96
+ exports.ToasterContainer = ToasterContainer;
97
+ exports.ToasterProvider = ToasterProvider;
43
98
  exports.export_createToast = export_createToast;
99
+ exports.export_defaultToasterProps = export_defaultToasterProps;
44
100
  exports.export_getToastDefaultConfig = export_getToastDefaultConfig;
101
+ exports.export_toastPositions = export_toastPositions;
102
+ exports.useToaster = useToaster;
package/types.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from '@agnos-ui/react-headless/types';
2
+ export * from '@agnos-ui/core-bootstrap/types';