@agnos-ui/react-bootstrap 0.4.4 → 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.
- package/README.md +2 -2
- package/{accordion-DKdL2Sr3.js → accordion-BX1iR5BO.js} +19 -22
- package/{accordion-CG9yl3xh.cjs → accordion-CxT3atuW.cjs} +12 -15
- package/{alert-0W1n8ahW.js → alert-D1FXDsJn.js} +12 -16
- package/{alert-DeQRFTm3.cjs → alert-LKMMYmg_.cjs} +9 -13
- package/collapse-BpPYsx89.cjs +18 -0
- package/collapse-DhsL8j2h.js +19 -0
- package/components/accordion/accordion.d.ts +40 -1
- package/components/accordion/accordion.gen.d.ts +37 -9
- package/components/accordion/index.cjs +2 -1
- package/components/accordion/index.js +7 -6
- package/components/alert/alert.d.ts +19 -1
- package/components/alert/alert.gen.d.ts +21 -2
- package/components/alert/index.cjs +2 -1
- package/components/alert/index.js +4 -3
- package/components/collapse/collapse.d.ts +15 -0
- package/components/collapse/collapse.gen.d.ts +146 -0
- package/components/collapse/index.cjs +6 -0
- package/components/collapse/index.d.ts +2 -0
- package/components/collapse/index.js +6 -0
- package/components/modal/index.cjs +3 -1
- package/components/modal/index.js +7 -5
- package/components/modal/modal.d.ts +34 -1
- package/components/modal/modal.gen.d.ts +35 -18
- package/components/pagination/index.cjs +3 -3
- package/components/pagination/index.js +5 -5
- package/components/pagination/pageItem.d.ts +35 -3
- package/components/pagination/pagination.d.ts +34 -2
- package/components/pagination/pagination.gen.d.ts +49 -29
- package/components/progressbar/index.cjs +2 -1
- package/components/progressbar/index.js +4 -3
- package/components/progressbar/progressbar.d.ts +16 -1
- package/components/progressbar/progressbar.gen.d.ts +21 -4
- package/components/rating/index.cjs +1 -1
- package/components/rating/index.js +1 -1
- package/components/rating/rating.d.ts +11 -0
- package/components/rating/rating.gen.d.ts +25 -17
- package/components/select/index.cjs +1 -1
- package/components/select/index.js +1 -1
- package/components/select/select.d.ts +15 -0
- package/components/select/select.gen.d.ts +41 -25
- package/components/slider/index.cjs +3 -3
- package/components/slider/index.js +5 -5
- package/components/slider/slider.d.ts +26 -2
- package/components/slider/slider.gen.d.ts +54 -33
- package/components/toast/index.cjs +2 -1
- package/components/toast/index.js +4 -3
- package/components/toast/toast.d.ts +20 -1
- package/components/toast/toast.gen.d.ts +22 -2
- package/config.d.ts +9 -2
- package/config.gen.d.ts +5 -0
- package/index.cjs +26 -16
- package/index.d.ts +1 -0
- package/index.js +51 -41
- package/{modal-qidZ4ghL.js → modal-CWuYx5n5.js} +23 -29
- package/{modal-Cyt40iyH.cjs → modal-DpMvOtL2.cjs} +17 -23
- package/package.json +6 -5
- package/{pagination-BDq1dOoH.js → pagination-5jlJWfFj.js} +19 -22
- package/{pagination-ChA90-py.cjs → pagination-b4pKj3Kx.cjs} +17 -20
- package/{progressbar-B0keLNtE.js → progressbar-DKFR5epE.js} +9 -10
- package/{progressbar-Fa1PDviu.cjs → progressbar-JO1ey9mx.cjs} +7 -8
- package/{rating-CWOEBPWs.js → rating-CTfRQGGu.js} +2 -2
- package/{rating-D5-3ELHv.cjs → rating-eI8T0zvS.cjs} +2 -2
- package/{select-DmgOBdqs.js → select-BriGqe3k.js} +15 -32
- package/{select-C4STYCmG.cjs → select-XHUAqTDw.cjs} +15 -32
- package/{slider-CxodlRoZ.js → slider--K7ri_0l.js} +18 -21
- package/{slider-MNZTN_vu.cjs → slider-BUQne5aJ.cjs} +16 -19
- package/{toast-3amUxqw1.js → toast-Dgfv5S_p.js} +16 -19
- package/{toast-BXMjE9E3.cjs → toast-E1DM85iZ.cjs} +13 -16
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { PropsConfig, Directive, Widget } from '@agnos-ui/react-headless/types';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieve a shallow copy of the default collapse config
|
|
4
|
+
* @returns the default collapse config
|
|
5
|
+
*/
|
|
6
|
+
declare const export_getCollapseDefaultConfig: () => CollapseProps;
|
|
7
|
+
export { export_getCollapseDefaultConfig as getCollapseDefaultConfig };
|
|
8
|
+
/**
|
|
9
|
+
* Create an CollapseWidget with given config props
|
|
10
|
+
* @param config - an optional collapse config
|
|
11
|
+
* @returns an CollapseWidget
|
|
12
|
+
*/
|
|
13
|
+
declare const export_createCollapse: (config?: PropsConfig<CollapseProps>) => CollapseWidget;
|
|
14
|
+
export { export_createCollapse as createCollapse };
|
|
15
|
+
/**
|
|
16
|
+
* Represents the state of a collapse component.
|
|
17
|
+
* Extends the properties and state from `CollapseCommonPropsAndState`.
|
|
18
|
+
*/
|
|
19
|
+
export interface CollapseState {
|
|
20
|
+
/**
|
|
21
|
+
* Is `true` when the collapse is hidden. Compared to `visible`, this is updated after the transition is executed.
|
|
22
|
+
*/
|
|
23
|
+
hidden: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* CSS classes to be applied on the widget main container
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue `''`
|
|
28
|
+
*/
|
|
29
|
+
className: string;
|
|
30
|
+
/**
|
|
31
|
+
* If `true`, collapse will be done horizontally.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue `false`
|
|
34
|
+
*/
|
|
35
|
+
horizontal: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* If `true` the collapse is visible to the user
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue `true`
|
|
40
|
+
*/
|
|
41
|
+
visible: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Properties for the Collapse component.
|
|
45
|
+
*/
|
|
46
|
+
export interface CollapseProps {
|
|
47
|
+
/**
|
|
48
|
+
* Callback called when the collapse visibility changed.
|
|
49
|
+
*
|
|
50
|
+
* @defaultValue
|
|
51
|
+
* ```ts
|
|
52
|
+
* () => {}
|
|
53
|
+
* ```
|
|
54
|
+
* @param visible - The new visibility state of the collapse.
|
|
55
|
+
*/
|
|
56
|
+
onVisibleChange: (visible: boolean) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Callback called when the collapse is hidden.
|
|
59
|
+
*
|
|
60
|
+
* @defaultValue
|
|
61
|
+
* ```ts
|
|
62
|
+
* () => {}
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
onHidden: () => void;
|
|
66
|
+
/**
|
|
67
|
+
* Callback called when the collapse is shown.
|
|
68
|
+
*
|
|
69
|
+
* @defaultValue
|
|
70
|
+
* ```ts
|
|
71
|
+
* () => {}
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
onShown: () => void;
|
|
75
|
+
/**
|
|
76
|
+
* If `true`, collapse opening will be animated at init time.
|
|
77
|
+
*
|
|
78
|
+
* @defaultValue `false`
|
|
79
|
+
*/
|
|
80
|
+
animatedOnInit: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* If `true`, collapse closing and opening will be animated.
|
|
83
|
+
*
|
|
84
|
+
* @defaultValue `true`
|
|
85
|
+
*/
|
|
86
|
+
animated: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* id of the collapse
|
|
89
|
+
*
|
|
90
|
+
* @defaultValue `''`
|
|
91
|
+
*/
|
|
92
|
+
id: string;
|
|
93
|
+
/**
|
|
94
|
+
* CSS classes to be applied on the widget main container
|
|
95
|
+
*
|
|
96
|
+
* @defaultValue `''`
|
|
97
|
+
*/
|
|
98
|
+
className: string;
|
|
99
|
+
/**
|
|
100
|
+
* If `true`, collapse will be done horizontally.
|
|
101
|
+
*
|
|
102
|
+
* @defaultValue `false`
|
|
103
|
+
*/
|
|
104
|
+
horizontal: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* If `true` the collapse is visible to the user
|
|
107
|
+
*
|
|
108
|
+
* @defaultValue `true`
|
|
109
|
+
*/
|
|
110
|
+
visible: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Interface representing the API for a collapsible component.
|
|
114
|
+
*/
|
|
115
|
+
export interface CollapseApi {
|
|
116
|
+
/**
|
|
117
|
+
* Triggers collapse closing programmatically.
|
|
118
|
+
*/
|
|
119
|
+
close(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Triggers the collapse content to be displayed for the user.
|
|
122
|
+
*/
|
|
123
|
+
open(): void;
|
|
124
|
+
/**
|
|
125
|
+
* Toggles the collapse content visibility.
|
|
126
|
+
*/
|
|
127
|
+
toggle(): void;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Interface representing the directives used in a collapse component.
|
|
131
|
+
*/
|
|
132
|
+
export interface CollapseDirectives {
|
|
133
|
+
/**
|
|
134
|
+
* Directive to apply the collapse.
|
|
135
|
+
*/
|
|
136
|
+
collapseDirective: Directive;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Represents a widget for handling collapse functionality.
|
|
140
|
+
*
|
|
141
|
+
* This type defines the structure of a CollapseWidget, which includes properties, state, API, and directives
|
|
142
|
+
* necessary for managing the collapse behavior in the UI.
|
|
143
|
+
*
|
|
144
|
+
* @type {Widget<CollapseProps, CollapseState, CollapseApi, CollapseDirectives>}
|
|
145
|
+
*/
|
|
146
|
+
export type CollapseWidget = Widget<CollapseProps, CollapseState, CollapseApi, CollapseDirectives>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const collapse = require("../../collapse-BpPYsx89.cjs");
|
|
4
|
+
exports.Collapse = collapse.Collapse;
|
|
5
|
+
exports.createCollapse = collapse.export_createCollapse;
|
|
6
|
+
exports.getCollapseDefaultConfig = collapse.export_getCollapseDefaultConfig;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const modal = require("../../modal-
|
|
3
|
+
const modal = require("../../modal-DpMvOtL2.cjs");
|
|
4
4
|
exports.Modal = modal.Modal;
|
|
5
|
+
exports.ModalDefaultSlotHeader = modal.ModalDefaultSlotHeader;
|
|
6
|
+
exports.ModalDefaultSlotStructure = modal.ModalDefaultSlotStructure;
|
|
5
7
|
exports.createModal = modal.export_createModal;
|
|
6
8
|
exports.getModalDefaultConfig = modal.export_getModalDefaultConfig;
|
|
7
9
|
exports.modalCloseButtonClick = modal.export_modalCloseButtonClick;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { M, a, e,
|
|
1
|
+
import { b, M, a, c, e, f, d, o } from "../../modal-CWuYx5n5.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
b as Modal,
|
|
4
|
+
M as ModalDefaultSlotHeader,
|
|
5
|
+
a as ModalDefaultSlotStructure,
|
|
6
|
+
c as createModal,
|
|
5
7
|
e as getModalDefaultConfig,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
f as modalCloseButtonClick,
|
|
9
|
+
d as modalOutsideClick,
|
|
8
10
|
o as openModal
|
|
9
11
|
};
|
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
import type { RefAttributes } from 'react';
|
|
2
|
-
import type { ModalApi, ModalProps } from './modal.gen';
|
|
2
|
+
import type { ModalApi, ModalContext, ModalProps } from './modal.gen';
|
|
3
|
+
/**
|
|
4
|
+
* A default header component for the modal that displays a title and an optional close button.
|
|
5
|
+
*
|
|
6
|
+
* @template Data - The type of data used in the modal context.
|
|
7
|
+
* @param {ModalContext<Data>} slotContext - The context object containing the state and directives for the modal.
|
|
8
|
+
* @returns {JSX.Element} The JSX element representing the modal header.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ModalDefaultSlotHeader: <Data>(slotContext: ModalContext<Data>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* Renders the default slot structure for a modal component.
|
|
13
|
+
*
|
|
14
|
+
* @template Data - The type of the data used in the modal context.
|
|
15
|
+
* @param {ModalContext<Data>} slotContext - The context containing the state and props for the modal slots.
|
|
16
|
+
* @returns {JSX.Element} The JSX structure for the modal's default slots.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ModalDefaultSlotStructure: <Data>(slotContext: ModalContext<Data>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* A Modal component that uses a forwardRef to expose its API.
|
|
21
|
+
*
|
|
22
|
+
* @template Data - The type of data that the modal will handle.
|
|
23
|
+
*
|
|
24
|
+
* @param {Partial<ModalProps<Data>>} props - The properties for the Modal component.
|
|
25
|
+
* @param {Ref<ModalApi<Data>>} ref - A ref to access the Modal API.
|
|
26
|
+
*
|
|
27
|
+
* @returns {JSX.Element} The rendered Modal component.
|
|
28
|
+
*/
|
|
3
29
|
export declare const Modal: <Data>(props: Partial<ModalProps<Data>> & RefAttributes<ModalApi<Data>>) => JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* Opens a modal dialog with the specified options.
|
|
32
|
+
*
|
|
33
|
+
* @template Data - The type of data that the modal will handle.
|
|
34
|
+
* @param {Partial<ModalProps<Data>>} options - The options to configure the modal.
|
|
35
|
+
* @returns {Promise<any>} A promise that resolves when the modal is closed.
|
|
36
|
+
*/
|
|
4
37
|
export declare function openModal<Data>(options: Partial<ModalProps<Data>>): Promise<any>;
|
|
@@ -7,7 +7,18 @@ import type { TransitionFn } from '@agnos-ui/react-headless/services/transitions
|
|
|
7
7
|
*/
|
|
8
8
|
declare const export_getModalDefaultConfig: () => ModalProps<any>;
|
|
9
9
|
export { export_getModalDefaultConfig as getModalDefaultConfig };
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Represents the context for a modal component.
|
|
12
|
+
*
|
|
13
|
+
* @template Data - The type of data associated with the modal.
|
|
14
|
+
*/
|
|
15
|
+
export interface ModalContext<Data> extends WidgetSlotContext<ModalWidget<Data>> {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Represents the state of a modal component.
|
|
19
|
+
*
|
|
20
|
+
* @template Data - The type of the data associated with the modal.
|
|
21
|
+
*/
|
|
11
22
|
export interface ModalState<Data> {
|
|
12
23
|
/**
|
|
13
24
|
* Whether the backdrop is fully hidden. This can be true either because {@link ModalProps.backdrop|backdrop} is false or
|
|
@@ -99,6 +110,11 @@ export interface ModalState<Data> {
|
|
|
99
110
|
*/
|
|
100
111
|
fullscreen: boolean;
|
|
101
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Interface representing the properties for a modal component.
|
|
115
|
+
*
|
|
116
|
+
* @template Data - The type of data that the modal will handle.
|
|
117
|
+
*/
|
|
102
118
|
export interface ModalProps<Data> {
|
|
103
119
|
/**
|
|
104
120
|
* The transition to use for the backdrop behind the modal (if present).
|
|
@@ -244,6 +260,11 @@ export interface ModalProps<Data> {
|
|
|
244
260
|
*/
|
|
245
261
|
fullscreen: boolean;
|
|
246
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Interface representing the API for a modal component.
|
|
265
|
+
*
|
|
266
|
+
* @template Data - The type of data associated with the modal.
|
|
267
|
+
*/
|
|
247
268
|
export interface ModalApi<Data> {
|
|
248
269
|
/**
|
|
249
270
|
* Method to change some modal properties.
|
|
@@ -263,7 +284,12 @@ export interface ModalApi<Data> {
|
|
|
263
284
|
*/
|
|
264
285
|
open(): Promise<any>;
|
|
265
286
|
}
|
|
266
|
-
|
|
287
|
+
/**
|
|
288
|
+
* Represents a modal widget with specific data type.
|
|
289
|
+
*
|
|
290
|
+
* @template Data - The type of data that the modal widget will handle.
|
|
291
|
+
*/
|
|
292
|
+
export type ModalWidget<Data> = Widget<ModalProps<Data>, ModalState<Data>, ModalApi<Data>, ModalDirectives>;
|
|
267
293
|
/**
|
|
268
294
|
* Creates a new modal widget instance.
|
|
269
295
|
* @param config - config of the modal, either as a store or as an object containing values or stores.
|
|
@@ -283,6 +309,9 @@ export { export_modalOutsideClick as modalOutsideClick };
|
|
|
283
309
|
*/
|
|
284
310
|
declare const export_modalCloseButtonClick: typeof modalCloseButtonClick;
|
|
285
311
|
export { export_modalCloseButtonClick as modalCloseButtonClick };
|
|
312
|
+
/**
|
|
313
|
+
* Type of the parameter of {@link ModalProps.onBeforeClose|onBeforeClose}.
|
|
314
|
+
*/
|
|
286
315
|
export interface ModalBeforeCloseEvent {
|
|
287
316
|
/**
|
|
288
317
|
* Result of the modal, which is the value passed to the {@link ModalApi.close|close} method
|
|
@@ -296,21 +325,9 @@ export interface ModalBeforeCloseEvent {
|
|
|
296
325
|
*/
|
|
297
326
|
cancel: boolean;
|
|
298
327
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
* @param event - mouse event
|
|
303
|
-
*/
|
|
304
|
-
closeButtonClick(event: Pick<MouseEvent, never>): void;
|
|
305
|
-
/**
|
|
306
|
-
* Action to be called when the user clicks on the modal DOM element (which is supposed to have the size of the full viewport).
|
|
307
|
-
* If the click is not done on a descendant of the modal DOM element, it is considered to be done outside the modal
|
|
308
|
-
* and, depending on the value of the {@link ModalProps.closeOnOutsideClick|closeOnOutsideClick} prop, the modal is or isn't closed
|
|
309
|
-
* (with the {@link modalOutsideClick} result).
|
|
310
|
-
* @param event - mouse event
|
|
311
|
-
*/
|
|
312
|
-
modalClick(event: Pick<MouseEvent, 'target' | 'currentTarget'>): void;
|
|
313
|
-
}
|
|
328
|
+
/**
|
|
329
|
+
* Directives of the modal widget.
|
|
330
|
+
*/
|
|
314
331
|
export interface ModalDirectives {
|
|
315
332
|
/**
|
|
316
333
|
* Directive to put on the modal DOM element.
|
|
@@ -333,7 +350,7 @@ export interface ModalDirectives {
|
|
|
333
350
|
*/
|
|
334
351
|
closeButtonDirective: Directive;
|
|
335
352
|
/**
|
|
336
|
-
* Directive to apply to the dialog element when using the native
|
|
353
|
+
* Directive to apply to the dialog element when using the native {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement | HTMLDialogElement}
|
|
337
354
|
*/
|
|
338
355
|
dialogDirective: Directive;
|
|
339
356
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const pagination = require("../../pagination-
|
|
4
|
-
exports.DefaultPages = pagination.DefaultPages;
|
|
5
|
-
exports.DefaultStructure = pagination.DefaultStructure;
|
|
3
|
+
const pagination = require("../../pagination-b4pKj3Kx.cjs");
|
|
6
4
|
exports.NavButton = pagination.NavButton;
|
|
7
5
|
exports.PageItem = pagination.PageItem;
|
|
8
6
|
exports.Pagination = pagination.Pagination;
|
|
7
|
+
exports.PaginationDefaultSlotPages = pagination.PaginationDefaultSlotPages;
|
|
8
|
+
exports.PaginationDefaultSlotStructure = pagination.PaginationDefaultSlotStructure;
|
|
9
9
|
exports.createPagination = pagination.export_createPagination;
|
|
10
10
|
exports.getPaginationDefaultConfig = pagination.export_getPaginationDefaultConfig;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N, P, c, a, b, d, e } from "../../pagination-5jlJWfFj.js";
|
|
2
2
|
export {
|
|
3
|
-
D as DefaultPages,
|
|
4
|
-
a as DefaultStructure,
|
|
5
3
|
N as NavButton,
|
|
6
4
|
P as PageItem,
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
c as Pagination,
|
|
6
|
+
a as PaginationDefaultSlotPages,
|
|
7
|
+
b as PaginationDefaultSlotStructure,
|
|
8
|
+
d as createPagination,
|
|
9
9
|
e as getPaginationDefaultConfig
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type Directive } from '@agnos-ui/react-headless/types';
|
|
3
|
-
|
|
3
|
+
interface PageItemProps extends React.HTMLAttributes<HTMLAnchorElement> {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
active?: boolean;
|
|
6
6
|
activeLabel?: string;
|
|
@@ -9,12 +9,44 @@ export interface PageItemProps extends React.HTMLAttributes<HTMLAnchorElement> {
|
|
|
9
9
|
}>;
|
|
10
10
|
page: number;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interface NavItemProps extends React.HTMLAttributes<HTMLAnchorElement> {
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
active?: boolean;
|
|
15
15
|
activeLabel?: string;
|
|
16
16
|
directive: Directive;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* `PageItem` is a React component that renders a list item (`<li>`) element
|
|
20
|
+
* with the appropriate classes for pagination. It uses `React.forwardRef` to
|
|
21
|
+
* forward the ref to the `<li>` element.
|
|
22
|
+
*
|
|
23
|
+
* @param {PageItemProps} props - The properties passed to the component.
|
|
24
|
+
* @param {boolean} props.disabled - If true, the page item will be disabled.
|
|
25
|
+
* @param {boolean} props.active - If true, the page item will be marked as active.
|
|
26
|
+
* @param {string} [props.activeLabel] - An optional label for the active page item,
|
|
27
|
+
* which will be visually hidden but accessible to screen readers.
|
|
28
|
+
* @param {string} [props.className] - Additional class names to apply to the page link.
|
|
29
|
+
* @param {React.ReactNode} props.children - The content to be displayed inside the page link.
|
|
30
|
+
* @param {any} props.directive - A directive to be used with the `useDirectives` hook.
|
|
31
|
+
* @param {any} props.page - The page number or identifier.
|
|
32
|
+
* @param {React.Ref<HTMLLIElement>} ref - The ref to be forwarded to the `<li>` element.
|
|
33
|
+
*
|
|
34
|
+
* @returns {JSX.Element} The rendered page item component.
|
|
35
|
+
*/
|
|
18
36
|
export declare const PageItem: React.ForwardRefExoticComponent<PageItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
19
|
-
|
|
37
|
+
/**
|
|
38
|
+
* `NavButton` is a React functional component that renders a navigation button
|
|
39
|
+
* within a list item (`<li>`) element. It uses `React.forwardRef` to forward the ref
|
|
40
|
+
* to the `<li>` element.
|
|
41
|
+
*
|
|
42
|
+
* @param {NavItemProps} props - The properties passed to the component.
|
|
43
|
+
* @param {boolean} props.disabled - Determines if the navigation button is disabled.
|
|
44
|
+
* @param {string} props.className - Additional class names to apply to the button.
|
|
45
|
+
* @param {React.ReactNode} props.children - The content to be displayed inside the button.
|
|
46
|
+
* @param {any} props.directive - Directives to be applied to the anchor (`<a>`) element.
|
|
47
|
+
* @param {React.Ref<HTMLLIElement>} ref - The ref to be forwarded to the `<li>` element.
|
|
48
|
+
*
|
|
49
|
+
* @returns {JSX.Element} A list item containing a navigation button.
|
|
50
|
+
*/
|
|
20
51
|
export declare const NavButton: React.ForwardRefExoticComponent<NavItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
52
|
+
export {};
|
|
@@ -1,4 +1,36 @@
|
|
|
1
1
|
import type { PaginationContext, PaginationProps } from './pagination.gen';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Renders the default slot pages for the pagination component.
|
|
4
|
+
*
|
|
5
|
+
* @param {PaginationContext} slotContext - The context containing pagination state and directives.
|
|
6
|
+
* @returns {JSX.Element | null} The rendered pagination items or null if there are no pages.
|
|
7
|
+
*
|
|
8
|
+
* The function iterates over the pages in the pagination state and generates JSX elements for each page.
|
|
9
|
+
* If a page is represented by -1, it renders an ellipsis item. Otherwise, it renders a page item.
|
|
10
|
+
*
|
|
11
|
+
* - Ellipsis items are rendered as disabled list items with an aria-hidden attribute for accessibility.
|
|
12
|
+
* - Page items are rendered using the `PageItem` component, with properties for disabled state, active state, and directives.
|
|
13
|
+
*
|
|
14
|
+
* The function returns a fragment containing the generated JSX elements, or null if there are no pages to render.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PaginationDefaultSlotPages: (slotContext: PaginationContext) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
/**
|
|
18
|
+
* Renders the default slot structure for the pagination component.
|
|
19
|
+
*
|
|
20
|
+
* @param {PaginationContext} slotContext - The context containing the state and directives for pagination.
|
|
21
|
+
* @returns {JSX.Element} The rendered pagination component.
|
|
22
|
+
*
|
|
23
|
+
* The function constructs the pagination structure based on the provided state and directives.
|
|
24
|
+
* It conditionally includes navigation buttons for first, previous, next, and last pages based on the state.
|
|
25
|
+
* The pagination items are wrapped in an unordered list with appropriate classes.
|
|
26
|
+
* Additionally, an aria-live region is included for accessibility purposes.
|
|
27
|
+
*/
|
|
28
|
+
export declare const PaginationDefaultSlotStructure: (slotContext: PaginationContext) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* Pagination component that renders a navigation element for paginated content.
|
|
31
|
+
* It uses the {@link useWidgetWithConfig} hook to create a pagination widget with the provided props.
|
|
32
|
+
*
|
|
33
|
+
* @param {Partial<PaginationProps>} props - The properties for the Pagination component.
|
|
34
|
+
* @returns {JSX.Element} The rendered pagination navigation element.
|
|
35
|
+
*/
|
|
4
36
|
export declare function Pagination(props: Partial<PaginationProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,16 +8,20 @@ export { export_getPaginationDefaultConfig as getPaginationDefaultConfig };
|
|
|
8
8
|
/**
|
|
9
9
|
* A type for the slot context of the pagination widget
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export interface PaginationContext extends WidgetSlotContext<PaginationWidget> {
|
|
12
|
+
}
|
|
12
13
|
/**
|
|
13
14
|
* A type for the slot context of the pagination widget when the slot is the number label
|
|
14
15
|
*/
|
|
15
|
-
export
|
|
16
|
+
export interface PaginationNumberContext extends PaginationContext {
|
|
16
17
|
/**
|
|
17
18
|
* Displayed page
|
|
18
19
|
*/
|
|
19
20
|
displayedPage: number;
|
|
20
|
-
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Represents the state of a pagination component.
|
|
24
|
+
*/
|
|
21
25
|
export interface PaginationState {
|
|
22
26
|
/**
|
|
23
27
|
* The number of pages.
|
|
@@ -53,14 +57,6 @@ export interface PaginationState {
|
|
|
53
57
|
* @defaultValue `1`
|
|
54
58
|
*/
|
|
55
59
|
page: number;
|
|
56
|
-
/**
|
|
57
|
-
* The pagination display size.
|
|
58
|
-
*
|
|
59
|
-
* Bootstrap currently supports small and large sizes.
|
|
60
|
-
*
|
|
61
|
-
* @defaultValue `null`
|
|
62
|
-
*/
|
|
63
|
-
size: 'sm' | 'lg' | null;
|
|
64
60
|
/**
|
|
65
61
|
* The label for the nav element.
|
|
66
62
|
*
|
|
@@ -223,7 +219,18 @@ export interface PaginationState {
|
|
|
223
219
|
* ```
|
|
224
220
|
*/
|
|
225
221
|
numberLabel: SlotContent<PaginationNumberContext>;
|
|
222
|
+
/**
|
|
223
|
+
* The pagination display size.
|
|
224
|
+
*
|
|
225
|
+
* Bootstrap currently supports small and large sizes.
|
|
226
|
+
*
|
|
227
|
+
* @defaultValue `null`
|
|
228
|
+
*/
|
|
229
|
+
size: 'sm' | 'lg' | null;
|
|
226
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Represents the properties for the Pagination component.
|
|
233
|
+
*/
|
|
227
234
|
export interface PaginationProps {
|
|
228
235
|
/**
|
|
229
236
|
* The number of items in your paginated collection.
|
|
@@ -300,7 +307,7 @@ export interface PaginationProps {
|
|
|
300
307
|
*
|
|
301
308
|
* @defaultValue
|
|
302
309
|
* ```ts
|
|
303
|
-
* (currentPage: number
|
|
310
|
+
* (currentPage: number) => `Current page is ${currentPage}`
|
|
304
311
|
* ```
|
|
305
312
|
*/
|
|
306
313
|
ariaLiveLabel: (currentPage: number, pageCount: number) => string;
|
|
@@ -323,14 +330,6 @@ export interface PaginationProps {
|
|
|
323
330
|
* @defaultValue `1`
|
|
324
331
|
*/
|
|
325
332
|
page: number;
|
|
326
|
-
/**
|
|
327
|
-
* The pagination display size.
|
|
328
|
-
*
|
|
329
|
-
* Bootstrap currently supports small and large sizes.
|
|
330
|
-
*
|
|
331
|
-
* @defaultValue `null`
|
|
332
|
-
*/
|
|
333
|
-
size: 'sm' | 'lg' | null;
|
|
334
333
|
/**
|
|
335
334
|
* The label for the nav element.
|
|
336
335
|
*
|
|
@@ -493,8 +492,22 @@ export interface PaginationProps {
|
|
|
493
492
|
* ```
|
|
494
493
|
*/
|
|
495
494
|
numberLabel: SlotContent<PaginationNumberContext>;
|
|
495
|
+
/**
|
|
496
|
+
* The pagination display size.
|
|
497
|
+
*
|
|
498
|
+
* Bootstrap currently supports small and large sizes.
|
|
499
|
+
*
|
|
500
|
+
* @defaultValue `null`
|
|
501
|
+
*/
|
|
502
|
+
size: 'sm' | 'lg' | null;
|
|
496
503
|
}
|
|
497
|
-
|
|
504
|
+
/**
|
|
505
|
+
* Represents a pagination widget component.
|
|
506
|
+
*
|
|
507
|
+
* This type defines a widget that handles pagination functionality,
|
|
508
|
+
* including properties, state, api and directives specific to pagination.
|
|
509
|
+
*/
|
|
510
|
+
export type PaginationWidget = Widget<PaginationProps, PaginationState, PaginationApi, PaginationDirectives>;
|
|
498
511
|
/**
|
|
499
512
|
* Create a PaginationWidget with given config props
|
|
500
513
|
* @param config - an optional alert config
|
|
@@ -502,6 +515,9 @@ export type PaginationWidget = Widget<PaginationProps, PaginationState, Paginati
|
|
|
502
515
|
*/
|
|
503
516
|
declare const export_createPagination: WidgetFactory<PaginationWidget>;
|
|
504
517
|
export { export_createPagination as createPagination };
|
|
518
|
+
/**
|
|
519
|
+
* Interface representing the hrefs for pagination navigation links.
|
|
520
|
+
*/
|
|
505
521
|
export interface DirectionsHrefs {
|
|
506
522
|
/**
|
|
507
523
|
* The href for the 'Previous' navigation link
|
|
@@ -512,29 +528,35 @@ export interface DirectionsHrefs {
|
|
|
512
528
|
*/
|
|
513
529
|
next: string;
|
|
514
530
|
}
|
|
515
|
-
|
|
531
|
+
/**
|
|
532
|
+
* Interface representing pagination API for navigating through pages.
|
|
533
|
+
*/
|
|
534
|
+
export interface PaginationApi {
|
|
516
535
|
/**
|
|
517
536
|
* To "go" to a specific page
|
|
518
537
|
* @param page - The page number to select
|
|
519
538
|
*/
|
|
520
|
-
select(page: number
|
|
539
|
+
select(page: number): void;
|
|
521
540
|
/**
|
|
522
541
|
* To "go" to the first page
|
|
523
542
|
*/
|
|
524
|
-
first(
|
|
543
|
+
first(): void;
|
|
525
544
|
/**
|
|
526
545
|
* To "go" to the previous page
|
|
527
546
|
*/
|
|
528
|
-
previous(
|
|
547
|
+
previous(): void;
|
|
529
548
|
/**
|
|
530
549
|
* To "go" to the next page
|
|
531
550
|
*/
|
|
532
|
-
next(
|
|
551
|
+
next(): void;
|
|
533
552
|
/**
|
|
534
553
|
* To "go" to the last page
|
|
535
554
|
*/
|
|
536
|
-
last(
|
|
555
|
+
last(): void;
|
|
537
556
|
}
|
|
557
|
+
/**
|
|
558
|
+
* Interface representing the directives for pagination components.
|
|
559
|
+
*/
|
|
538
560
|
export interface PaginationDirectives {
|
|
539
561
|
/**
|
|
540
562
|
* A directive to be applied to each page link
|
|
@@ -560,5 +582,3 @@ export interface PaginationDirectives {
|
|
|
560
582
|
*/
|
|
561
583
|
pageLast: Directive;
|
|
562
584
|
}
|
|
563
|
-
export interface PaginationApi {
|
|
564
|
-
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const progressbar = require("../../progressbar-
|
|
3
|
+
const progressbar = require("../../progressbar-JO1ey9mx.cjs");
|
|
4
4
|
exports.Progressbar = progressbar.Progressbar;
|
|
5
|
+
exports.ProgressbarDefaultSlotStructure = progressbar.ProgressbarDefaultSlotStructure;
|
|
5
6
|
exports.createProgressbar = progressbar.export_createProgressbar;
|
|
6
7
|
exports.getProgressbarDefaultConfig = progressbar.export_getProgressbarDefaultConfig;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { P,
|
|
1
|
+
import { a, P, b, e } from "../../progressbar-DKFR5epE.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
a as Progressbar,
|
|
4
|
+
P as ProgressbarDefaultSlotStructure,
|
|
5
|
+
b as createProgressbar,
|
|
5
6
|
e as getProgressbarDefaultConfig
|
|
6
7
|
};
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
import type { ProgressbarProps } from './progressbar.gen';
|
|
1
|
+
import type { ProgressbarContext, ProgressbarProps } from './progressbar.gen';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a progress bar component with customizable appearance and behavior.
|
|
4
|
+
*
|
|
5
|
+
* @param {ProgressbarContext} slotContext - The context containing the state and properties for the progress bar.
|
|
6
|
+
*
|
|
7
|
+
* @returns {JSX.Element} The rendered progress bar component.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ProgressbarDefaultSlotStructure: (slotContext: ProgressbarContext) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Progressbar component that utilizes the {@link useWidgetWithConfig} hook to create a progress bar widget.
|
|
12
|
+
*
|
|
13
|
+
* @param {Partial<ProgressbarProps>} props - The properties to configure the progress bar.
|
|
14
|
+
*
|
|
15
|
+
* @returns {JSX.Element} A div element containing the progress bar with appropriate ARIA directives and slot content.
|
|
16
|
+
*/
|
|
2
17
|
export declare const Progressbar: (props: Partial<ProgressbarProps>) => import("react/jsx-runtime").JSX.Element;
|