@agnos-ui/core 0.4.0-next.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,81 +3,131 @@ import type { FloatingUI } from '../../services/floatingUI';
3
3
  import type { HasFocus } from '../../services/focustrack';
4
4
  import type { Directive, PropsConfig, Widget } from '../../types';
5
5
  import type { WidgetsCommonPropsAndState } from '../commonProps';
6
- export interface SelectCommonPropsAndState<Item> extends WidgetsCommonPropsAndState {
6
+ interface SelectCommonPropsAndState<Item> extends WidgetsCommonPropsAndState {
7
7
  /**
8
8
  * id used for the input inside the select
9
9
  */
10
10
  id: string | undefined;
11
11
  /**
12
12
  * aria-label used for the input inside the select
13
+ *
14
+ * @defaultValue `'Select'`
13
15
  */
14
16
  ariaLabel: string | undefined;
15
17
  /**
16
18
  * List of selected item ids
19
+ *
20
+ * @defaultValue `[]`
17
21
  */
18
22
  selected: Item[];
19
23
  /**
20
24
  * Filtered text to be display in the filter input
25
+ *
26
+ * @defaultValue `''`
21
27
  */
22
28
  filterText: string;
23
29
  /**
24
30
  * true if the select is disabled
31
+ *
32
+ * @defaultValue `false`
25
33
  */
26
34
  disabled: boolean;
27
35
  /**
28
36
  * true if the select is open
37
+ *
38
+ * @defaultValue `false`
29
39
  */
30
40
  open: boolean;
31
41
  /**
32
42
  * Class to be added on the dropdown menu container
43
+ *
44
+ * @defaultValue `''`
33
45
  */
34
46
  menuClassName: string;
35
47
  /**
36
48
  * Class to be added on menu items
49
+ *
50
+ * @defaultValue `''`
37
51
  */
38
52
  menuItemClassName: string;
39
53
  /**
40
54
  * Class to be added on selected items (displayed in the input zone)
55
+ *
56
+ * @defaultValue `''`
41
57
  */
42
58
  badgeClassName: string;
43
59
  /**
44
60
  * true if a loading process is being done
61
+ *
62
+ * @defaultValue `false`
45
63
  */
46
64
  loading: boolean;
47
65
  }
48
66
  export interface SelectProps<Item> extends SelectCommonPropsAndState<Item> {
49
67
  /**
50
68
  * List of available items for the dropdown
69
+ *
70
+ * @defaultValue `[]`
51
71
  */
52
72
  items: Item[];
53
73
  /**
54
74
  * List of allowed placements for the dropdown.
55
75
  * This refers to the [allowedPlacements from floating UI](https://floating-ui.com/docs/autoPlacement#allowedplacements), given the different [Placement possibilities](https://floating-ui.com/docs/computePosition#placement).
76
+ *
77
+ * @defaultValue
78
+ * ```ts
79
+ * ['bottom-start', 'top-start', 'bottom-end', 'top-end']
80
+ * ```
56
81
  */
57
82
  allowedPlacements: Placement[];
58
83
  /**
59
84
  * Custom function to get the id of an item
60
85
  * By default, the item is returned
86
+ *
87
+ * @defaultValue
88
+ * ```ts
89
+ * (item: any) => '' + item
90
+ * ```
61
91
  */
62
92
  itemIdFn(item: Item): string;
63
93
  /**
64
94
  * Retrieves navigable elements within an HTML element containing badges and the input.
65
95
  *
66
96
  * @param node - HTMLElement that contains the badges and the input
97
+ *
98
+ * @defaultValue
99
+ * ```ts
100
+ * (node: HTMLElement) => node.querySelectorAll('.au-select-badge,input')
101
+ * ```
67
102
  */
68
103
  navSelector(node: HTMLElement): NodeListOf<HTMLSpanElement | HTMLInputElement>;
69
104
  /**
70
105
  * Callback called dropdown open state change
71
106
  * @param isOpen - updated open state
107
+ *
108
+ * @defaultValue
109
+ * ```ts
110
+ * () => {}
111
+ * ```
72
112
  */
73
113
  onOpenChange(isOpen: boolean): void;
74
114
  /**
75
115
  * Callback called when the text filter change
76
116
  * @param text - Filtered text
117
+ *
118
+ * @defaultValue
119
+ * ```ts
120
+ * () => {}
121
+ * ```
77
122
  */
78
123
  onFilterTextChange(text: string): void;
79
124
  /**
80
125
  * Callback called when the selection change
126
+ *
127
+ * @defaultValue
128
+ * ```ts
129
+ * () => {}
130
+ * ```
81
131
  */
82
132
  onSelectedChange(selected: Item[]): void;
83
133
  }
@@ -234,7 +284,6 @@ export interface SelectActions<Item> {
234
284
  onBadgeKeydown: (event: KeyboardEvent, item: Item) => void;
235
285
  }
236
286
  export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, SelectApi<Item>, SelectActions<Item>, SelectDirectives<Item>>;
237
- export declare const defaultConfig: SelectProps<any>;
238
287
  /**
239
288
  * Returns a shallow copy of the default select config.
240
289
  * @returns a copy of the default config
@@ -242,36 +291,68 @@ export declare const defaultConfig: SelectProps<any>;
242
291
  export declare function getSelectDefaultConfig(): {
243
292
  /**
244
293
  * List of available items for the dropdown
294
+ *
295
+ * @defaultValue `[]`
245
296
  */
246
297
  items: any[];
247
298
  /**
248
299
  * List of allowed placements for the dropdown.
249
300
  * This refers to the [allowedPlacements from floating UI](https://floating-ui.com/docs/autoPlacement#allowedplacements), given the different [Placement possibilities](https://floating-ui.com/docs/computePosition#placement).
301
+ *
302
+ * @defaultValue
303
+ * ```ts
304
+ * ['bottom-start', 'top-start', 'bottom-end', 'top-end']
305
+ * ```
250
306
  */
251
307
  allowedPlacements: Placement[];
252
308
  /**
253
309
  * Custom function to get the id of an item
254
310
  * By default, the item is returned
311
+ *
312
+ * @defaultValue
313
+ * ```ts
314
+ * (item: any) => '' + item
315
+ * ```
255
316
  */
256
317
  itemIdFn(item: any): string;
257
318
  /**
258
319
  * Retrieves navigable elements within an HTML element containing badges and the input.
259
320
  *
260
321
  * @param node - HTMLElement that contains the badges and the input
322
+ *
323
+ * @defaultValue
324
+ * ```ts
325
+ * (node: HTMLElement) => node.querySelectorAll('.au-select-badge,input')
326
+ * ```
261
327
  */
262
- navSelector(node: HTMLElement): NodeListOf<HTMLInputElement | HTMLSpanElement>;
328
+ navSelector(node: HTMLElement): NodeListOf<HTMLSpanElement | HTMLInputElement>;
263
329
  /**
264
330
  * Callback called dropdown open state change
265
331
  * @param isOpen - updated open state
332
+ *
333
+ * @defaultValue
334
+ * ```ts
335
+ * () => {}
336
+ * ```
266
337
  */
267
338
  onOpenChange(isOpen: boolean): void;
268
339
  /**
269
340
  * Callback called when the text filter change
270
341
  * @param text - Filtered text
342
+ *
343
+ * @defaultValue
344
+ * ```ts
345
+ * () => {}
346
+ * ```
271
347
  */
272
348
  onFilterTextChange(text: string): void;
273
349
  /**
274
350
  * Callback called when the selection change
351
+ *
352
+ * @defaultValue
353
+ * ```ts
354
+ * () => {}
355
+ * ```
275
356
  */
276
357
  onSelectedChange(selected: any[]): void;
277
358
  /**
@@ -280,38 +361,56 @@ export declare function getSelectDefaultConfig(): {
280
361
  id: string | undefined;
281
362
  /**
282
363
  * aria-label used for the input inside the select
364
+ *
365
+ * @defaultValue `'Select'`
283
366
  */
284
367
  ariaLabel: string | undefined;
285
368
  /**
286
369
  * List of selected item ids
370
+ *
371
+ * @defaultValue `[]`
287
372
  */
288
373
  selected: any[];
289
374
  /**
290
375
  * Filtered text to be display in the filter input
376
+ *
377
+ * @defaultValue `''`
291
378
  */
292
379
  filterText: string;
293
380
  /**
294
381
  * true if the select is disabled
382
+ *
383
+ * @defaultValue `false`
295
384
  */
296
385
  disabled: boolean;
297
386
  /**
298
387
  * true if the select is open
388
+ *
389
+ * @defaultValue `false`
299
390
  */
300
391
  open: boolean;
301
392
  /**
302
393
  * Class to be added on the dropdown menu container
394
+ *
395
+ * @defaultValue `''`
303
396
  */
304
397
  menuClassName: string;
305
398
  /**
306
399
  * Class to be added on menu items
400
+ *
401
+ * @defaultValue `''`
307
402
  */
308
403
  menuItemClassName: string;
309
404
  /**
310
405
  * Class to be added on selected items (displayed in the input zone)
406
+ *
407
+ * @defaultValue `''`
311
408
  */
312
409
  badgeClassName: string;
313
410
  /**
314
411
  * true if a loading process is being done
412
+ *
413
+ * @defaultValue `false`
315
414
  */
316
415
  loading: boolean;
317
416
  className: string;
@@ -322,3 +421,4 @@ export declare function getSelectDefaultConfig(): {
322
421
  * @returns a SelectWidget
323
422
  */
324
423
  export declare function createSelect<Item>(config?: PropsConfig<SelectProps<Item>>): SelectWidget<Item>;
424
+ export {};
@@ -54,45 +54,65 @@ export interface SliderHandle {
54
54
  */
55
55
  ariaValueText: string;
56
56
  }
57
- export interface SliderCommonPropsAndState extends WidgetsCommonPropsAndState {
57
+ interface SliderCommonPropsAndState extends WidgetsCommonPropsAndState {
58
58
  /**
59
59
  * Minimum value that can be assigned to the slider
60
+ *
61
+ * @defaultValue `0`
60
62
  */
61
63
  min: number;
62
64
  /**
63
65
  * Maximum value that can be assigned to the slider
66
+ *
67
+ * @defaultValue `100`
64
68
  */
65
69
  max: number;
66
70
  /**
67
71
  * Unit value between slider steps
72
+ *
73
+ * @defaultValue `1`
68
74
  */
69
75
  stepSize: number;
70
76
  /**
71
77
  * If `true` slider value cannot be changed but the slider is still focusable
78
+ *
79
+ * @defaultValue `false`
72
80
  */
73
81
  readonly: boolean;
74
82
  /**
75
83
  * If `true` slider value cannot be changed and the slider cannot be focused
84
+ *
85
+ * @defaultValue `false`
76
86
  */
77
87
  disabled: boolean;
78
88
  /**
79
89
  * If `true` is vertically positioned otherwise it is horizontal
90
+ *
91
+ * @defaultValue `false`
80
92
  */
81
93
  vertical: boolean;
82
94
  /**
83
95
  * Current slider values
96
+ *
97
+ * @defaultValue `[0]`
84
98
  */
85
99
  values: number[];
86
100
  /**
87
101
  * If `true` the value labels are displayed on the slider
102
+ *
103
+ * @defaultValue `true`
88
104
  */
89
105
  showValueLabels: boolean;
90
106
  /**
91
107
  * If `true` the min and max labels are displayed on the slider
108
+ *
109
+ * @defaultValue `true`
92
110
  */
93
111
  showMinMaxLabels: boolean;
94
112
  /**
95
113
  * It `true` slider display is inversed
114
+ *
115
+ * @defaultValue `false`
96
116
  */
97
117
  rtl: boolean;
98
118
  }
@@ -144,6 +164,11 @@ export interface SliderProps extends SliderCommonPropsAndState {
144
164
  * @param value - value of the handle
145
165
  * @param sortedIndex - index of the handle in the sorted list
146
166
  * @param index - index of the handle in the original list
167
+ *
168
+ * @defaultValue
169
+ * ```ts
170
+ * (value: number) => '' + value
171
+ * ```
147
172
  */
148
173
  ariaLabelHandle: (value: number, sortedIndex: number, index: number) => string;
149
174
  /**
@@ -151,12 +176,22 @@ export interface SliderProps extends SliderCommonPropsAndState {
151
176
  * @param value - value of the handle
152
177
  * @param sortedIndex - index of the handle in the sorted list
153
178
  * @param index - index of the handle in the original list
179
+ *
180
+ * @defaultValue
181
+ * ```ts
182
+ * (value: number) => '' + value
183
+ * ```
154
184
  */
155
185
  ariaValueText: (value: number, sortedIndex: number, index: number) => string;
156
186
  /**
157
187
  * An event emitted when slider values are changed
158
188
  *
159
189
  * Event payload equals to the updated slider values
190
+ *
191
+ * @defaultValue
192
+ * ```ts
193
+ * () => {}
194
+ * ```
160
195
  */
161
196
  onValuesChange: (values: number[]) => void;
162
197
  }
@@ -238,6 +273,11 @@ export declare function getSliderDefaultConfig(): {
238
273
  * @param value - value of the handle
239
274
  * @param sortedIndex - index of the handle in the sorted list
240
275
  * @param index - index of the handle in the original list
276
+ *
277
+ * @defaultValue
278
+ * ```ts
279
+ * (value: number) => '' + value
280
+ * ```
241
281
  */
242
282
  ariaLabelHandle: (value: number, sortedIndex: number, index: number) => string;
243
283
  /**
@@ -245,52 +285,82 @@ export declare function getSliderDefaultConfig(): {
245
285
  * @param value - value of the handle
246
286
  * @param sortedIndex - index of the handle in the sorted list
247
287
  * @param index - index of the handle in the original list
288
+ *
289
+ * @defaultValue
290
+ * ```ts
291
+ * (value: number) => '' + value
292
+ * ```
248
293
  */
249
294
  ariaValueText: (value: number, sortedIndex: number, index: number) => string;
250
295
  /**
251
296
  * An event emitted when slider values are changed
252
297
  *
253
298
  * Event payload equals to the updated slider values
299
+ *
300
+ * @defaultValue
301
+ * ```ts
302
+ * () => {}
303
+ * ```
254
304
  */
255
305
  onValuesChange: (values: number[]) => void;
256
306
  /**
257
307
  * Minimum value that can be assigned to the slider
308
+ *
309
+ * @defaultValue `0`
258
310
  */
259
311
  min: number;
260
312
  /**
261
313
  * Maximum value that can be assigned to the slider
314
+ *
315
+ * @defaultValue `100`
262
316
  */
263
317
  max: number;
264
318
  /**
265
319
  * Unit value between slider steps
320
+ *
321
+ * @defaultValue `1`
266
322
  */
267
323
  stepSize: number;
268
324
  /**
269
325
  * If `true` slider value cannot be changed but the slider is still focusable
326
+ *
327
+ * @defaultValue `false`
270
328
  */
271
329
  readonly: boolean;
272
330
  /**
273
331
  * If `true` slider value cannot be changed and the slider cannot be focused
332
+ *
333
+ * @defaultValue `false`
274
334
  */
275
335
  disabled: boolean;
276
336
  /**
277
337
  * If `true` is vertically positioned otherwise it is horizontal
338
+ *
339
+ * @defaultValue `false`
278
340
  */
279
341
  vertical: boolean;
280
342
  /**
281
343
  * Current slider values
344
+ *
345
+ * @defaultValue `[0]`
282
346
  */
283
347
  values: number[];
284
348
  /**
285
349
  * If `true` the value labels are displayed on the slider
350
+ *
351
+ * @defaultValue `true`
286
352
  */
287
353
  showValueLabels: boolean;
288
354
  /**
289
355
  * If `true` the min and max labels are displayed on the slider
356
+ *
357
+ * @defaultValue `true`
290
358
  */
291
359
  showMinMaxLabels: boolean;
292
360
  /**
293
361
  * It `true` slider display is inversed
362
+ *
363
+ * @defaultValue `false`
294
364
  */
295
365
  rtl: boolean;
296
366
  className: string;
@@ -301,3 +371,4 @@ export declare function getSliderDefaultConfig(): {
301
371
  * @returns a SliderWidget
302
372
  */
303
373
  export declare function createSlider(config?: PropsConfig<SliderProps>): SliderWidget;
374
+ export {};
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const toast = require("../../toast-DR8b0zpm.cjs");
3
+ const toast = require("../../toast-Dy3ck2cM.cjs");
4
4
  exports.createToast = toast.createToast;
5
5
  exports.getToastDefaultConfig = toast.getToastDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../toast-DN0HwUbs.js";
1
+ import { c, g } from "../../toast-BzxextBQ.js";
2
2
  export {
3
3
  c as createToast,
4
4
  g as getToastDefaultConfig
@@ -1,16 +1,20 @@
1
1
  import type { Directive, PropsConfig, Widget } from '../../types';
2
2
  import type { CommonAlertApi, CommonAlertDirectives, CommonAlertProps, CommonAlertState } from '../alert/common';
3
- export interface ToastExtraProps {
3
+ interface ToastExtraProps {
4
4
  /**
5
5
  * If `true` automatically hides the toast after the delay.
6
+ *
7
+ * @defaultValue `true`
6
8
  */
7
9
  autoHide: boolean;
8
10
  /**
9
11
  * Delay in milliseconds before hiding the toast.
12
+ *
13
+ * @defaultValue `5000`
10
14
  */
11
15
  delay: number;
12
16
  }
13
- export interface ExtraDirectives {
17
+ interface ExtraDirectives {
14
18
  /**
15
19
  * Directive that handles the autohide of the toast component
16
20
  */
@@ -44,3 +48,4 @@ export declare function getToastDefaultConfig(): ToastProps;
44
48
  * @returns a ToastWidget
45
49
  */
46
50
  export declare function createToast(config?: PropsConfig<ToastProps>): ToastWidget;
51
+ export {};
package/index.cjs CHANGED
@@ -2,15 +2,14 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const types = require("./types.cjs");
4
4
  const accordion = require("./accordion-DmPT0O0j.cjs");
5
- const common = require("./common-Kb96q7i4.cjs");
6
- const alert = require("./alert-C-V64Qcs.cjs");
5
+ const alert = require("./alert-CEFbEgvG.cjs");
7
6
  const modal = require("./modal-D4d8sy85.cjs");
8
7
  const pagination = require("./pagination-B9WFv70F.cjs");
9
8
  const progressbar = require("./progressbar-DXCMeJvL.cjs");
10
9
  const rating = require("./rating-C2Y95r50.cjs");
11
- const select = require("./select-CBlGWfZY.cjs");
10
+ const select = require("./select-BBiF-m3N.cjs");
12
11
  const slider = require("./slider-BdsZpxJr.cjs");
13
- const toast = require("./toast-DR8b0zpm.cjs");
12
+ const toast = require("./toast-Dy3ck2cM.cjs");
14
13
  const config = require("./config.cjs");
15
14
  const services_extendWidget = require("./services/extendWidget.cjs");
16
15
  const services_floatingUI = require("./services/floatingUI.cjs");
@@ -21,6 +20,7 @@ const services_navManager = require("./services/navManager.cjs");
21
20
  const services_portal = require("./services/portal.cjs");
22
21
  const services_resizeObserver = require("./services/resizeObserver.cjs");
23
22
  const services_siblingsInert = require("./services/siblingsInert.cjs");
23
+ const services_hash = require("./services/hash.cjs");
24
24
  const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
25
25
  const services_transitions_cssTransitions = require("./services/transitions/cssTransitions.cjs");
26
26
  const services_transitions_simpleClassTransition = require("./services/transitions/simpleClassTransition.cjs");
@@ -33,10 +33,6 @@ exports.createAccordion = accordion.createAccordion;
33
33
  exports.createAccordionItem = accordion.createAccordionItem;
34
34
  exports.factoryCreateAccordion = accordion.factoryCreateAccordion;
35
35
  exports.getAccordionDefaultConfig = accordion.getAccordionDefaultConfig;
36
- exports.commonAlertConfigValidator = common.commonAlertConfigValidator;
37
- exports.createCommonAlert = common.createCommonAlert;
38
- exports.defaultCommonAlertConfig = common.defaultCommonAlertConfig;
39
- exports.getCommonAlertDefaultConfig = common.getCommonAlertDefaultConfig;
40
36
  exports.createAlert = alert.createAlert;
41
37
  exports.getAlertDefaultConfig = alert.getAlertDefaultConfig;
42
38
  exports.createModal = modal.createModal;
@@ -50,7 +46,6 @@ exports.getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
50
46
  exports.createRating = rating.createRating;
51
47
  exports.getRatingDefaultConfig = rating.getRatingDefaultConfig;
52
48
  exports.createSelect = select.createSelect;
53
- exports.defaultConfig = select.defaultConfig;
54
49
  exports.getSelectDefaultConfig = select.getSelectDefaultConfig;
55
50
  exports.createSlider = slider.createSlider;
56
51
  exports.getSliderDefaultConfig = slider.getSliderDefaultConfig;
@@ -70,6 +65,7 @@ exports.isInternalInputNavigation = services_navManager.isInternalInputNavigatio
70
65
  exports.portal = services_portal.portal;
71
66
  exports.createResizeObserver = services_resizeObserver.createResizeObserver;
72
67
  exports.sliblingsInert = services_siblingsInert.sliblingsInert;
68
+ exports.hash$ = services_hash.hash$;
73
69
  exports.createTransition = services_transitions_baseTransitions.createTransition;
74
70
  exports.noAnimation = services_transitions_baseTransitions.noAnimation;
75
71
  exports.createCSSTransition = services_transitions_cssTransitions.createCSSTransition;
package/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from './components/commonProps';
2
1
  export * from './types';
3
2
  export * from './components/accordion';
4
3
  export * from './components/alert';
@@ -19,6 +18,7 @@ export * from './services/navManager';
19
18
  export * from './services/portal';
20
19
  export * from './services/resizeObserver';
21
20
  export * from './services/siblingsInert';
21
+ export * from './services/hash';
22
22
  export * from './services/transitions/baseTransitions';
23
23
  export * from './services/transitions/cssTransitions';
24
24
  export * from './services/transitions/simpleClassTransition';