@agnos-ui/react-bootstrap 0.4.3 → 0.5.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +2 -2
  2. package/{accordion-DKdL2Sr3.js → accordion-BX1iR5BO.js} +19 -22
  3. package/{accordion-CG9yl3xh.cjs → accordion-CxT3atuW.cjs} +12 -15
  4. package/{alert-0W1n8ahW.js → alert-D1FXDsJn.js} +12 -16
  5. package/{alert-DeQRFTm3.cjs → alert-LKMMYmg_.cjs} +9 -13
  6. package/collapse-BpPYsx89.cjs +18 -0
  7. package/collapse-DhsL8j2h.js +19 -0
  8. package/components/accordion/accordion.d.ts +40 -1
  9. package/components/accordion/accordion.gen.d.ts +37 -9
  10. package/components/accordion/index.cjs +2 -1
  11. package/components/accordion/index.js +7 -6
  12. package/components/alert/alert.d.ts +19 -1
  13. package/components/alert/alert.gen.d.ts +21 -2
  14. package/components/alert/index.cjs +2 -1
  15. package/components/alert/index.js +4 -3
  16. package/components/collapse/collapse.d.ts +15 -0
  17. package/components/collapse/collapse.gen.d.ts +146 -0
  18. package/components/collapse/index.cjs +6 -0
  19. package/components/collapse/index.d.ts +2 -0
  20. package/components/collapse/index.js +6 -0
  21. package/components/modal/index.cjs +3 -1
  22. package/components/modal/index.js +7 -5
  23. package/components/modal/modal.d.ts +34 -1
  24. package/components/modal/modal.gen.d.ts +35 -18
  25. package/components/pagination/index.cjs +3 -3
  26. package/components/pagination/index.js +5 -5
  27. package/components/pagination/pageItem.d.ts +35 -3
  28. package/components/pagination/pagination.d.ts +34 -2
  29. package/components/pagination/pagination.gen.d.ts +49 -29
  30. package/components/progressbar/index.cjs +2 -1
  31. package/components/progressbar/index.js +4 -3
  32. package/components/progressbar/progressbar.d.ts +16 -1
  33. package/components/progressbar/progressbar.gen.d.ts +21 -4
  34. package/components/rating/index.cjs +1 -1
  35. package/components/rating/index.js +1 -1
  36. package/components/rating/rating.d.ts +11 -0
  37. package/components/rating/rating.gen.d.ts +25 -17
  38. package/components/select/index.cjs +1 -1
  39. package/components/select/index.js +1 -1
  40. package/components/select/select.d.ts +15 -0
  41. package/components/select/select.gen.d.ts +41 -25
  42. package/components/slider/index.cjs +3 -3
  43. package/components/slider/index.js +5 -5
  44. package/components/slider/slider.d.ts +26 -2
  45. package/components/slider/slider.gen.d.ts +54 -33
  46. package/components/toast/index.cjs +2 -1
  47. package/components/toast/index.js +4 -3
  48. package/components/toast/toast.d.ts +20 -1
  49. package/components/toast/toast.gen.d.ts +22 -2
  50. package/config.d.ts +9 -2
  51. package/config.gen.d.ts +5 -0
  52. package/index.cjs +26 -16
  53. package/index.d.ts +1 -0
  54. package/index.js +51 -41
  55. package/{modal-qidZ4ghL.js → modal-CWuYx5n5.js} +23 -29
  56. package/{modal-Cyt40iyH.cjs → modal-DpMvOtL2.cjs} +17 -23
  57. package/package.json +6 -5
  58. package/{pagination-BDq1dOoH.js → pagination-5jlJWfFj.js} +19 -22
  59. package/{pagination-ChA90-py.cjs → pagination-b4pKj3Kx.cjs} +17 -20
  60. package/{progressbar-B0keLNtE.js → progressbar-DKFR5epE.js} +9 -10
  61. package/{progressbar-Fa1PDviu.cjs → progressbar-JO1ey9mx.cjs} +7 -8
  62. package/{rating-CWOEBPWs.js → rating-CTfRQGGu.js} +2 -2
  63. package/{rating-D5-3ELHv.cjs → rating-eI8T0zvS.cjs} +2 -2
  64. package/{select-DmgOBdqs.js → select-BriGqe3k.js} +15 -32
  65. package/{select-C4STYCmG.cjs → select-XHUAqTDw.cjs} +15 -32
  66. package/{slider-CxodlRoZ.js → slider--K7ri_0l.js} +18 -21
  67. package/{slider-MNZTN_vu.cjs → slider-BUQne5aJ.cjs} +16 -19
  68. package/{toast-3amUxqw1.js → toast-Dgfv5S_p.js} +16 -19
  69. package/{toast-BXMjE9E3.cjs → toast-E1DM85iZ.cjs} +13 -16
@@ -6,7 +6,15 @@ import type { BSContextualClass } from '@agnos-ui/core-bootstrap/types';
6
6
  */
7
7
  declare const export_getProgressbarDefaultConfig: () => ProgressbarProps;
8
8
  export { export_getProgressbarDefaultConfig as getProgressbarDefaultConfig };
9
- export type ProgressbarContext = WidgetSlotContext<ProgressbarWidget>;
9
+ /**
10
+ * Represents the context for a Progressbar widget.
11
+ * This interface is used to define the context object that is passed to the Progressbar widget.
12
+ */
13
+ export interface ProgressbarContext extends WidgetSlotContext<ProgressbarWidget> {
14
+ }
15
+ /**
16
+ * Represents the state of a Progressbar component.
17
+ */
10
18
  export interface ProgressbarState {
11
19
  /**
12
20
  * Percentage of completion.
@@ -86,6 +94,9 @@ export interface ProgressbarState {
86
94
  */
87
95
  type: BSContextualClass | undefined;
88
96
  }
97
+ /**
98
+ * Interface representing the properties for the Progressbar component.
99
+ */
89
100
  export interface ProgressbarProps {
90
101
  /**
91
102
  * Return the value for the 'aria-valuetext' attribute.
@@ -161,7 +172,12 @@ export interface ProgressbarProps {
161
172
  */
162
173
  type: BSContextualClass | undefined;
163
174
  }
164
- export type ProgressbarWidget = Widget<ProgressbarProps, ProgressbarState, ProgressbarApi, object, ProgressbarDirectives>;
175
+ /**
176
+ * Represents a Progressbar widget.
177
+ *
178
+ * This type defines the structure of a Progressbar widget, including its properties, state, and directives.
179
+ */
180
+ export type ProgressbarWidget = Widget<ProgressbarProps, ProgressbarState, object, ProgressbarDirectives>;
165
181
  /**
166
182
  * Create a Progressbar with given config props
167
183
  * @param config - an optional progressbar config
@@ -169,11 +185,12 @@ export type ProgressbarWidget = Widget<ProgressbarProps, ProgressbarState, Progr
169
185
  */
170
186
  declare const export_createProgressbar: WidgetFactory<ProgressbarWidget>;
171
187
  export { export_createProgressbar as createProgressbar };
188
+ /**
189
+ * Interface representing directives for a progress bar component.
190
+ */
172
191
  export interface ProgressbarDirectives {
173
192
  /**
174
193
  * A directive to be applied to the main container that handles aria attributes.
175
194
  */
176
195
  ariaDirective: Directive;
177
196
  }
178
- export interface ProgressbarApi {
179
- }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const rating = require("../../rating-D5-3ELHv.cjs");
3
+ const rating = require("../../rating-eI8T0zvS.cjs");
4
4
  exports.Rating = rating.Rating;
5
5
  exports.createRating = rating.export_createRating;
6
6
  exports.getRatingDefaultConfig = rating.export_getRatingDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { R, a, e } from "../../rating-CWOEBPWs.js";
1
+ import { R, a, e } from "../../rating-CTfRQGGu.js";
2
2
  export {
3
3
  R as Rating,
4
4
  a as createRating,
@@ -1,2 +1,13 @@
1
1
  import type { RatingProps } from './rating.gen';
2
+ /**
3
+ * Rating component that displays a series of stars based on the provided state.
4
+ *
5
+ * @param {Partial<RatingProps>} props - The properties for the Rating component.
6
+ * @returns {JSX.Element} The rendered Rating component.
7
+ *
8
+ * @remarks
9
+ * This component uses the {@link useWidgetWithConfig} hook to initialize and configure the rating widget.
10
+ * It applies directives to the container and individual stars for styling and behavior.
11
+ *
12
+ */
2
13
  export declare function Rating(props: Partial<RatingProps>): import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,9 @@ import type { SlotContent, Widget, WidgetFactory, Directive } from '@agnos-ui/re
5
5
  */
6
6
  declare const export_getRatingDefaultConfig: () => RatingProps;
7
7
  export { export_getRatingDefaultConfig as getRatingDefaultConfig };
8
+ /**
9
+ * Represents the state of a rating component.
10
+ */
8
11
  export interface RatingState {
9
12
  /**
10
13
  * the aria value of the rating
@@ -89,6 +92,9 @@ export interface RatingState {
89
92
  */
90
93
  star: SlotContent<StarContext>;
91
94
  }
95
+ /**
96
+ * Represents the properties for the Rating component.
97
+ */
92
98
  export interface RatingProps {
93
99
  /**
94
100
  * Return the value for the 'aria-valuetext' attribute.
@@ -201,7 +207,10 @@ export interface RatingProps {
201
207
  */
202
208
  star: SlotContent<StarContext>;
203
209
  }
204
- export type RatingWidget = Widget<RatingProps, RatingState, object, RatingActions, RatingDirectives>;
210
+ /**
211
+ * Represents a Rating Widget component.
212
+ */
213
+ export type RatingWidget = Widget<RatingProps, RatingState, RatingApi, RatingDirectives>;
205
214
  /**
206
215
  * Create a RatingWidget with given config props
207
216
  * @param config - an optional rating config
@@ -209,6 +218,9 @@ export type RatingWidget = Widget<RatingProps, RatingState, object, RatingAction
209
218
  */
210
219
  declare const export_createRating: WidgetFactory<RatingWidget>;
211
220
  export { export_createRating as createRating };
221
+ /**
222
+ * Represents the context for a star in a rating component.
223
+ */
212
224
  export interface StarContext {
213
225
  /**
214
226
  * indicates how much the current star is filled, from 0 to 100
@@ -219,6 +231,9 @@ export interface StarContext {
219
231
  */
220
232
  index: number;
221
233
  }
234
+ /**
235
+ * Interface representing directives for a rating component.
236
+ */
222
237
  export interface RatingDirectives {
223
238
  /**
224
239
  * A directive to be applied to the main container
@@ -232,31 +247,24 @@ export interface RatingDirectives {
232
247
  index: number;
233
248
  }>;
234
249
  }
235
- export interface RatingActions {
250
+ /**
251
+ * Interface representing the API that can be performed on a rating component.
252
+ */
253
+ export interface RatingApi {
236
254
  /**
237
- * Method to be used when a star is clicked.
255
+ * Sets the rating value.
238
256
  *
239
- * To be used in the onclick event of a star
240
257
  * @param index - Star index, starting from 1
241
258
  */
242
- click(index: number): void;
259
+ setRating(index: number): void;
243
260
  /**
244
- * Method to be used when the mouse enter in a star.
261
+ * Sets the hovered rating value.
245
262
  *
246
- * To be used in the onmouseenter of a star
247
263
  * @param index - Star index, starting from 1
248
264
  */
249
- hover(index: number): void;
265
+ setHoveredRating(index: number): void;
250
266
  /**
251
- * Method to be used when the mouse leave the widget.
252
- *
253
- * To be used in the onmouseleave of the rating container
267
+ * Leave the rating, resetting the visible rating to the rating value and triggering the onLeave callback
254
268
  */
255
269
  leave(): void;
256
- /**
257
- * Method to be used to handle the keyboard.
258
- *
259
- * To be used in the onkeydown of the rating container
260
- */
261
- handleKey(event: KeyboardEvent): void;
262
270
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const select = require("../../select-C4STYCmG.cjs");
3
+ const select = require("../../select-XHUAqTDw.cjs");
4
4
  exports.Select = select.Select;
5
5
  exports.createSelect = select.export_createSelect;
6
6
  exports.getSelectDefaultConfig = select.export_getSelectDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { S, a, e } from "../../select-DmgOBdqs.js";
1
+ import { S, a, e } from "../../select-BriGqe3k.js";
2
2
  export {
3
3
  S as Select,
4
4
  a as createSelect,
@@ -1,2 +1,17 @@
1
1
  import type { SelectProps } from './select.gen';
2
+ /**
3
+ * A generic Select component that provides a customizable dropdown selection interface.
4
+ *
5
+ * @template Item - The type of the items in the selection.
6
+ * @param {Partial<SelectProps<Item>>} props - The properties for the Select component.
7
+ * @returns {JSX.Element} The rendered Select component.
8
+ *
9
+ * @remarks
10
+ * This component uses a widget context to manage its state and directives. It supports
11
+ * custom badge labels and item labels through the widget configuration.
12
+ *
13
+ * @component
14
+ * @param {Partial<SelectProps<Item>>} props - The properties for the Select component.
15
+ * @returns {JSX.Element} The rendered Select component.
16
+ */
2
17
  export declare function Select<Item>(props: Partial<SelectProps<Item>>): import("react/jsx-runtime").JSX.Element;
@@ -9,15 +9,28 @@ import type { FloatingUI } from '@agnos-ui/react-headless/services/floatingUI';
9
9
  declare const export_getSelectDefaultConfig: () => SelectProps<any>;
10
10
  export { export_getSelectDefaultConfig as getSelectDefaultConfig };
11
11
  /**
12
- * A type for the slot context of the pagination widget
12
+ * Interface for the slot context of the pagination widget
13
+ * @template Item - The type of the items in the Select component.
13
14
  */
14
- export type SelectContext<Item> = WidgetSlotContext<SelectWidget<Item>>;
15
- export type SelectItemContext<Item> = SelectContext<Item> & {
15
+ export interface SelectContext<Item> extends WidgetSlotContext<SelectWidget<Item>> {
16
+ }
17
+ /**
18
+ * Represents the context for a select item, extending the base `SelectContext` with additional
19
+ * contextual data specific to an item.
20
+ *
21
+ * @template Item - The type of the item within the select context.
22
+ */
23
+ export interface SelectItemContext<Item> extends SelectContext<Item> {
16
24
  /**
17
25
  * Contextual data related to an item
18
26
  */
19
27
  itemContext: ItemContext<Item>;
20
- };
28
+ }
29
+ /**
30
+ * Represents the state of a Select component.
31
+ *
32
+ * @template Item - The type of the items in the select component.
33
+ */
21
34
  export interface SelectState<Item> {
22
35
  /**
23
36
  * List of item contexts, to be displayed in the menu
@@ -121,6 +134,11 @@ export interface SelectState<Item> {
121
134
  */
122
135
  itemLabel: SlotContent<SelectItemContext<Item>>;
123
136
  }
137
+ /**
138
+ * Represents the properties for the Select component.
139
+ *
140
+ * @template Item - The type of the items in the select component.
141
+ */
124
142
  export interface SelectProps<Item> {
125
143
  /**
126
144
  * List of available items for the dropdown
@@ -273,7 +291,12 @@ export interface SelectProps<Item> {
273
291
  */
274
292
  itemLabel: SlotContent<SelectItemContext<Item>>;
275
293
  }
276
- export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, SelectApi<Item>, SelectActions<Item>, SelectDirectives<Item>>;
294
+ /**
295
+ * Represents a Select widget component.
296
+ *
297
+ * @template Item - The type of the items that the select widget will handle.
298
+ */
299
+ export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, SelectApi<Item>, SelectDirectives<Item>>;
277
300
  /**
278
301
  * Creates a new select widget instance.
279
302
  * @param config - config of the modal, either as a store or as an object containing values or stores.
@@ -281,6 +304,9 @@ export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, Se
281
304
  */
282
305
  declare const export_createSelect: <Item>(config?: PropsConfig<SelectProps<Item>>) => SelectWidget<Item>;
283
306
  export { export_createSelect as createSelect };
307
+ /**
308
+ * Item representation built from the items provided in parameters
309
+ */
284
310
  export interface ItemContext<T> {
285
311
  /**
286
312
  * Original item given in the parameters
@@ -295,6 +321,9 @@ export interface ItemContext<T> {
295
321
  */
296
322
  selected: boolean;
297
323
  }
324
+ /**
325
+ * Interface representing the API for a Select component.
326
+ */
298
327
  export interface SelectApi<Item> {
299
328
  /**
300
329
  * Clear all the selected items
@@ -357,6 +386,9 @@ export interface SelectApi<Item> {
357
386
  */
358
387
  toggle(isOpen?: boolean): void;
359
388
  }
389
+ /**
390
+ * Interface representing the directives used in the Select component.
391
+ */
360
392
  export interface SelectDirectives<Item> {
361
393
  /**
362
394
  * Directive to be used in the input group and the menu containers
@@ -386,28 +418,12 @@ export interface SelectDirectives<Item> {
386
418
  * A directive that applies all the necessary attributes to the dropdown item
387
419
  */
388
420
  itemAttributesDirective: Directive<ItemContext<Item>>;
389
- }
390
- export interface SelectActions<Item> {
391
421
  /**
392
- * Method to be plugged to on the 'input' event. The input text will be used as the filter text.
422
+ * A directive to be applied to the input
393
423
  */
394
- onInput: (e: {
395
- target: any;
396
- }) => void;
424
+ inputDirective: Directive;
397
425
  /**
398
- * Method to be attached to the node element to close a badge on click.
399
- */
400
- onRemoveBadgeClick: (event: MouseEvent, item: Item) => void;
401
- /**
402
- * Method to be plugged to on an keydown event of the main input, in order to control the keyboard interactions with the highlighted item.
403
- * It manages arrow keys to move the highlighted item, or enter to toggle the item.
404
- */
405
- onInputKeydown: (event: KeyboardEvent) => void;
406
- /**
407
- * Method to be plugged to on an keydown event of a badge container, in order to manage main actions on badges.
408
- *
409
- * @param event - keyboard event
410
- * @param item - corresponding item
426
+ * A directive to be applied to a button that closes a badge
411
427
  */
412
- onBadgeKeydown: (event: KeyboardEvent, item: Item) => void;
428
+ badgeCloseButtonDirective: Directive<ItemContext<Item>>;
413
429
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const slider = require("../../slider-MNZTN_vu.cjs");
4
- exports.DefaultSlotHandle = slider.DefaultSlotHandle;
5
- exports.DefaultSlotStructure = slider.DefaultSlotStructure;
3
+ const slider = require("../../slider-BUQne5aJ.cjs");
6
4
  exports.Slider = slider.Slider;
5
+ exports.SliderDefaultSlotHandle = slider.SliderDefaultSlotHandle;
6
+ exports.SliderDefaultSlotStructure = slider.SliderDefaultSlotStructure;
7
7
  exports.createSlider = slider.export_createSlider;
8
8
  exports.getSliderDefaultConfig = slider.export_getSliderDefaultConfig;
@@ -1,8 +1,8 @@
1
- import { D, a, S, b, e } from "../../slider-CxodlRoZ.js";
1
+ import { b, S, a, c, e } from "../../slider--K7ri_0l.js";
2
2
  export {
3
- D as DefaultSlotHandle,
4
- a as DefaultSlotStructure,
5
- S as Slider,
6
- b as createSlider,
3
+ b as Slider,
4
+ S as SliderDefaultSlotHandle,
5
+ a as SliderDefaultSlotStructure,
6
+ c as createSlider,
7
7
  e as getSliderDefaultConfig
8
8
  };
@@ -1,5 +1,29 @@
1
1
  import type { PropsWithChildren } from 'react';
2
2
  import type { SliderContext, SliderProps, SliderSlotHandleContext } from './slider.gen';
3
- export declare const DefaultSlotHandle: (slotContext: SliderSlotHandleContext) => import("react/jsx-runtime").JSX.Element;
4
- export declare const DefaultSlotStructure: (slotContext: SliderContext) => import("react/jsx-runtime").JSX.Element;
3
+ /**
4
+ * A functional component that renders a button element with a directive applied to it.
5
+ * The directive is provided through the `slotContext` parameter.
6
+ *
7
+ * @param {SliderSlotHandleContext} slotContext - The context object containing the directives and item for the slider handle.
8
+ * @returns {JSX.Element} A button element with the applied directive.
9
+ */
10
+ export declare const SliderDefaultSlotHandle: (slotContext: SliderSlotHandleContext) => import("react/jsx-runtime").JSX.Element;
11
+ /**
12
+ * Renders the default slot structure for the Slider component.
13
+ *
14
+ * @param {SliderContext} slotContext - The context object containing state and directives for the slider.
15
+ * @returns {JSX.Element} The JSX element representing the default slot structure.
16
+ *
17
+ */
18
+ export declare const SliderDefaultSlotStructure: (slotContext: SliderContext) => import("react/jsx-runtime").JSX.Element;
19
+ /**
20
+ * Slider component that integrates with a widget context and renders a slot structure.
21
+ *
22
+ * @param {PropsWithChildren<Partial<SliderProps>>} props - The properties for the Slider component.
23
+ * @returns {JSX.Element} The rendered Slider component.
24
+ *
25
+ * The Slider component uses the {@link useWidgetWithConfig} hook to create a widget context with the provided
26
+ * configuration. It then applies the `sliderDirective` to a `div` element and renders the slot content
27
+ * using the `Slot` component.
28
+ */
5
29
  export declare function Slider(props: PropsWithChildren<Partial<SliderProps>>): import("react/jsx-runtime").JSX.Element;
@@ -5,13 +5,35 @@ import type { WidgetSlotContext, SlotContent, Widget, WidgetFactory, Directive }
5
5
  */
6
6
  declare const export_getSliderDefaultConfig: () => SliderProps;
7
7
  export { export_getSliderDefaultConfig as getSliderDefaultConfig };
8
- export type SliderContext = WidgetSlotContext<SliderWidget>;
9
- export type SliderSlotLabelContext = SliderContext & {
8
+ /**
9
+ * Represents the context for a Slider component.
10
+ * This type is an alias for `WidgetSlotContext<SliderWidget>`.
11
+ */
12
+ export interface SliderContext extends WidgetSlotContext<SliderWidget> {
13
+ }
14
+ /**
15
+ * Represents the context for a slider slot label, extending the base `SliderContext`
16
+ * with an additional `value` property.
17
+ */
18
+ export interface SliderSlotLabelContext extends SliderContext {
19
+ /**
20
+ * the value of the handle the label is attached to
21
+ */
10
22
  value: number;
11
- };
12
- export type SliderSlotHandleContext = SliderContext & {
23
+ }
24
+ /**
25
+ * Represents the context for a slider slot handle.
26
+ * This type extends the `SliderContext` and includes an additional `item` property of type `SliderHandle`.
27
+ */
28
+ export interface SliderSlotHandleContext extends SliderContext {
29
+ /**
30
+ * the handle context
31
+ */
13
32
  item: SliderHandle;
14
- };
33
+ }
34
+ /**
35
+ * Represents the state of a slider component.
36
+ */
15
37
  export interface SliderState {
16
38
  /**
17
39
  * Sorted slider values
@@ -137,6 +159,9 @@ export interface SliderState {
137
159
  */
138
160
  handle: SlotContent<SliderSlotHandleContext>;
139
161
  }
162
+ /**
163
+ * Represents the properties for the Slider component.
164
+ */
140
165
  export interface SliderProps {
141
166
  /**
142
167
  * Return the value for the 'aria-label' attribute for the handle
@@ -257,7 +282,10 @@ export interface SliderProps {
257
282
  */
258
283
  handle: SlotContent<SliderSlotHandleContext>;
259
284
  }
260
- export type SliderWidget = Widget<SliderProps, SliderState, SliderApi, SliderActions, SliderDirectives>;
285
+ /**
286
+ * Represents a slider widget component.
287
+ */
288
+ export type SliderWidget = Widget<SliderProps, SliderState, object, SliderDirectives>;
261
289
  /**
262
290
  * Create a Slider with given config props
263
291
  * @param config - an optional slider config
@@ -265,6 +293,9 @@ export type SliderWidget = Widget<SliderProps, SliderState, SliderApi, SliderAct
265
293
  */
266
294
  declare const export_createSlider: WidgetFactory<SliderWidget>;
267
295
  export { export_createSlider as createSlider };
296
+ /**
297
+ * Options for displaying progress in a slider component.
298
+ */
268
299
  export interface ProgressDisplayOptions {
269
300
  /**
270
301
  * Right offset of the progress in %
@@ -291,6 +322,9 @@ export interface ProgressDisplayOptions {
291
322
  */
292
323
  height: number;
293
324
  }
325
+ /**
326
+ * Options for displaying a handle in a slider component.
327
+ */
294
328
  export interface HandleDisplayOptions {
295
329
  /**
296
330
  * Left offset of the handle in %
@@ -301,6 +335,9 @@ export interface HandleDisplayOptions {
301
335
  */
302
336
  top: number | null;
303
337
  }
338
+ /**
339
+ * Represents a handle in a slider component.
340
+ */
304
341
  export interface SliderHandle {
305
342
  /**
306
343
  * Value of the handle
@@ -319,8 +356,9 @@ export interface SliderHandle {
319
356
  */
320
357
  ariaValueText: string;
321
358
  }
322
- export interface SliderApi {
323
- }
359
+ /**
360
+ * Interface representing various directives used in the slider component.
361
+ */
324
362
  export interface SliderDirectives {
325
363
  /**
326
364
  * Directive to get the slider component elementRef
@@ -336,6 +374,14 @@ export interface SliderDirectives {
336
374
  * Directive to apply to the slider clickable area, to directly move the handle to a given specific position
337
375
  */
338
376
  clickableAreaDirective: Directive;
377
+ /**
378
+ * Directive to apply handle events handlers
379
+ */
380
+ handleEventsDirective: Directive<{
381
+ item: {
382
+ id: number;
383
+ };
384
+ }>;
339
385
  /**
340
386
  * Directive to apply to the slider handle if any
341
387
  */
@@ -361,28 +407,3 @@ export interface SliderDirectives {
361
407
  index: number;
362
408
  }>;
363
409
  }
364
- export interface SliderActions {
365
- /**
366
- * Method to handle click on the slider
367
- * @param event - mouse event
368
- */
369
- click(event: MouseEvent): void;
370
- /**
371
- * Method to process the keyboard event
372
- * @param event - keyboard event object
373
- * @param handleNumber - id of the modified handle
374
- */
375
- keydown(event: KeyboardEvent, handleNumber: number): void;
376
- /**
377
- * Method describing the behavior of the slider handle on mouse down event
378
- * @param event - mouse event
379
- * @param handleId - numeric id of the handle
380
- */
381
- mouseDown(event: MouseEvent, handleId: number): void;
382
- /**
383
- * Method describing the behavior of the slider handle on touch start event
384
- * @param event - touch event
385
- * @param handleId - number id of the handle
386
- */
387
- touchStart(event: TouchEvent, handleId: number): void;
388
- }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const toast = require("../../toast-BXMjE9E3.cjs");
3
+ const toast = require("../../toast-E1DM85iZ.cjs");
4
4
  exports.Toast = toast.Toast;
5
+ exports.ToastDefaultSlotStructure = toast.ToastDefaultSlotStructure;
5
6
  exports.createToast = toast.export_createToast;
6
7
  exports.getToastDefaultConfig = toast.export_getToastDefaultConfig;
@@ -1,6 +1,7 @@
1
- import { T, a, e } from "../../toast-3amUxqw1.js";
1
+ import { a, T, b, e } from "../../toast-Dgfv5S_p.js";
2
2
  export {
3
- T as Toast,
4
- a as createToast,
3
+ a as Toast,
4
+ T as ToastDefaultSlotStructure,
5
+ b as createToast,
5
6
  e as getToastDefaultConfig
6
7
  };
@@ -1,3 +1,22 @@
1
1
  import type { ForwardRefExoticComponent, RefAttributes } from 'react';
2
- import type { ToastApi, ToastProps } from './toast.gen';
2
+ import type { ToastApi, ToastContext, ToastProps } from './toast.gen';
3
+ /**
4
+ * Renders the default slot structure for a Toast component.
5
+ *
6
+ * @param {ToastContext} slotContext - The context containing the state and properties for the Toast component.
7
+ * @returns {JSX.Element} The JSX element representing the default slot structure of the Toast.
8
+ */
9
+ export declare const ToastDefaultSlotStructure: (slotContext: ToastContext) => import("react/jsx-runtime").JSX.Element;
10
+ /**
11
+ * Toast component that uses a forward ref to expose the Toast API.
12
+ *
13
+ * This component utilizes the {@link useWidgetWithConfig} hook to create a toast widget
14
+ * with the provided properties and configuration. It also uses {@link https://react.dev/reference/react/useImperativeHandle | useImperativeHandle}
15
+ * to expose the widget's API through the forwarded ref.
16
+ *
17
+ * @param props - Partial properties of `ToastProps` to configure the toast widget.
18
+ * @param ref - Ref to expose the Toast API.
19
+ *
20
+ * @returns A JSX element that conditionally renders the `ToastElement` based on the widget's state.
21
+ */
3
22
  export declare const Toast: ForwardRefExoticComponent<Partial<ToastProps> & RefAttributes<ToastApi>>;
@@ -6,7 +6,15 @@ import type { TransitionFn } from '@agnos-ui/react-headless/services/transitions
6
6
  */
7
7
  declare const export_getToastDefaultConfig: () => ToastProps;
8
8
  export { export_getToastDefaultConfig as getToastDefaultConfig };
9
- export type ToastContext = WidgetSlotContext<ToastWidget>;
9
+ /**
10
+ * Represents the context for a Toast widget.
11
+ * This interface is an alias for `WidgetSlotContext<ToastWidget>`.
12
+ */
13
+ export interface ToastContext extends WidgetSlotContext<ToastWidget> {
14
+ }
15
+ /**
16
+ * Represents the state of a Toast component.
17
+ */
10
18
  export interface ToastState {
11
19
  /**
12
20
  * Is `true` when the alert is hidden. Compared to `visible`, this is updated after the transition is executed.
@@ -62,6 +70,9 @@ export interface ToastState {
62
70
  */
63
71
  header: SlotContent<ToastContext>;
64
72
  }
73
+ /**
74
+ * Interface representing the properties for the Toast component.
75
+ */
65
76
  export interface ToastProps {
66
77
  /**
67
78
  * The transition function will be executed when the alert is displayed or hidden.
@@ -166,7 +177,10 @@ export interface ToastProps {
166
177
  */
167
178
  header: SlotContent<ToastContext>;
168
179
  }
169
- export type ToastWidget = Widget<ToastProps, ToastState, ToastApi, object, ToastDirectives>;
180
+ /**
181
+ * Represents a Toast widget component.
182
+ */
183
+ export type ToastWidget = Widget<ToastProps, ToastState, ToastApi, ToastDirectives>;
170
184
  /**
171
185
  * Create an ToastWidget with given config props
172
186
  * @param config - an optional alert config
@@ -174,6 +188,9 @@ export type ToastWidget = Widget<ToastProps, ToastState, ToastApi, object, Toast
174
188
  */
175
189
  declare const export_createToast: WidgetFactory<ToastWidget>;
176
190
  export { export_createToast as createToast };
191
+ /**
192
+ * Represents the API for the toast component.
193
+ */
177
194
  export interface ToastApi {
178
195
  /**
179
196
  * Triggers alert closing programmatically (same as clicking on the close button (×)).
@@ -184,6 +201,9 @@ export interface ToastApi {
184
201
  */
185
202
  open(): void;
186
203
  }
204
+ /**
205
+ * Interface representing the directives for a toast component.
206
+ */
187
207
  export interface ToastDirectives {
188
208
  /**
189
209
  * the transition directive, piloting what is the visual effect of going from hidden to visible
package/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Partial2Levels, WidgetsConfigStore } from '@agnos-ui/react-headless/config';
2
- import type { Widget, WidgetFactory, WidgetProps, WidgetState } from '@agnos-ui/react-headless/types';
2
+ import type { Widget, WidgetFactory, WidgetProps, WidgetSlotContext } from '@agnos-ui/react-headless/types';
3
3
  import type { BootstrapWidgetsConfig } from '@agnos-ui/core-bootstrap/config';
4
4
  import type { ReactNode, Context } from 'react';
5
5
  export * from '@agnos-ui/react-headless/config';
@@ -9,4 +9,11 @@ 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
+ /**
13
+ * Destructures and exports the following from `widgetFactories`:
14
+ * - `widgetsConfigContext`: The context for widget configurations.
15
+ * - `WidgetsDefaultConfig`: The default configuration for widgets.
16
+ * - `useWidgetContext`: A hook to use the widget context.
17
+ * - `useWidgetWithConfig`: A hook to use a widget with a specific configuration.
18
+ */
19
+ 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>) => import("@amadeus-it-group/tansu").ReadableSignal<Partial<Props>>, useWidgetWithConfig: <W extends Widget<object, object, object, object>>(factory: WidgetFactory<W>, props: Partial<WidgetProps<W>> | undefined, widgetName: keyof BootstrapWidgetsConfig | null, defaultProps?: Partial<WidgetProps<W>>) => WidgetSlotContext<W>;