@agnos-ui/svelte-bootstrap 0.5.0-next.0 → 0.6.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 (40) hide show
  1. package/components/accordion/Accordion.svelte.d.ts +1 -0
  2. package/components/accordion/Item.svelte.d.ts +1 -0
  3. package/components/accordion/ItemDefaultStructure.svelte.d.ts +1 -0
  4. package/components/accordion/accordion.d.ts +1 -1
  5. package/components/accordion/accordion.js +1 -1
  6. package/components/alert/Alert.svelte.d.ts +1 -0
  7. package/components/alert/AlertDefaultStructure.svelte.d.ts +1 -0
  8. package/components/collapse/Collapse.svelte.d.ts +1 -0
  9. package/components/modal/modalService.d.ts +4 -4
  10. package/components/modal/modalService.js +4 -4
  11. package/components/pagination/Pagination.svelte.d.ts +1 -0
  12. package/components/pagination/PaginationDefaultPages.svelte.d.ts +1 -0
  13. package/components/pagination/PaginationDefaultStructure.svelte.d.ts +1 -0
  14. package/components/progressbar/Progressbar.svelte.d.ts +1 -0
  15. package/components/progressbar/ProgressbarDefaultStructure.svelte.d.ts +1 -0
  16. package/components/rating/Rating.svelte.d.ts +1 -0
  17. package/components/select/select.gen.d.ts +6 -0
  18. package/components/slider/Slider.svelte.d.ts +1 -0
  19. package/components/slider/SliderDefaultHandle.svelte.d.ts +1 -0
  20. package/components/slider/SliderDefaultStructure.svelte.d.ts +1 -0
  21. package/components/toast/Toast.svelte.d.ts +1 -0
  22. package/components/toast/ToastDefaultStructure.svelte.d.ts +1 -0
  23. package/components/tree/Tree.svelte +36 -0
  24. package/components/tree/Tree.svelte.d.ts +4 -0
  25. package/components/tree/TreeDefaultItem.svelte +20 -0
  26. package/components/tree/TreeDefaultItem.svelte.d.ts +3 -0
  27. package/components/tree/TreeDefaultItemContent.svelte +11 -0
  28. package/components/tree/TreeDefaultItemContent.svelte.d.ts +3 -0
  29. package/components/tree/TreeDefaultItemToggle.svelte +15 -0
  30. package/components/tree/TreeDefaultItemToggle.svelte.d.ts +3 -0
  31. package/components/tree/TreeDefaultStructure.svelte +16 -0
  32. package/components/tree/TreeDefaultStructure.svelte.d.ts +3 -0
  33. package/components/tree/index.d.ts +3 -0
  34. package/components/tree/index.js +3 -0
  35. package/components/tree/tree.gen.d.ts +216 -0
  36. package/components/tree/tree.gen.js +14 -0
  37. package/config.gen.d.ts +5 -0
  38. package/index.d.ts +1 -0
  39. package/index.js +1 -0
  40. package/package.json +4 -4
@@ -5,4 +5,5 @@ declare const Accordion: import("svelte").Component<Partial<AccordionProps> & {
5
5
  }, {
6
6
  api: AccordionApi;
7
7
  }, "">;
8
+ type Accordion = ReturnType<typeof Accordion>;
8
9
  export default Accordion;
@@ -2,4 +2,5 @@ import type { AccordionItemApi, AccordionItemProps } from './accordion';
2
2
  declare const Item: import("svelte").Component<Partial<AccordionItemProps>, {
3
3
  api: AccordionItemApi;
4
4
  }, "visible">;
5
+ type Item = ReturnType<typeof Item>;
5
6
  export default Item;
@@ -1,3 +1,4 @@
1
1
  import type { AccordionItemContext } from './accordion';
2
2
  declare const ItemDefaultStructure: import("svelte").Component<AccordionItemContext, {}, "">;
3
+ type ItemDefaultStructure = ReturnType<typeof ItemDefaultStructure>;
3
4
  export default ItemDefaultStructure;
@@ -9,6 +9,6 @@ export declare function setAccordionApi(accordionApi: AccordionApi): void;
9
9
  /**
10
10
  * Retrieves the Accordion API from the Svelte context.
11
11
  *
12
- * @returns {AccordionApi} The Accordion API instance.
12
+ * @returns The Accordion API instance.
13
13
  */
14
14
  export declare function getAccordionApi(): AccordionApi;
@@ -13,7 +13,7 @@ export function setAccordionApi(accordionApi) {
13
13
  /**
14
14
  * Retrieves the Accordion API from the Svelte context.
15
15
  *
16
- * @returns {AccordionApi} The Accordion API instance.
16
+ * @returns The Accordion API instance.
17
17
  */
18
18
  export function getAccordionApi() {
19
19
  return getContext(contextInjectionKey);
@@ -2,4 +2,5 @@ import { type AlertApi, type AlertProps } from './alert.gen';
2
2
  declare const Alert: import("svelte").Component<Partial<AlertProps>, {
3
3
  api: AlertApi;
4
4
  }, "visible">;
5
+ type Alert = ReturnType<typeof Alert>;
5
6
  export default Alert;
@@ -1,3 +1,4 @@
1
1
  import type { AlertContext } from './alert.gen';
2
2
  declare const AlertDefaultStructure: import("svelte").Component<AlertContext, {}, "">;
3
+ type AlertDefaultStructure = ReturnType<typeof AlertDefaultStructure>;
3
4
  export default AlertDefaultStructure;
@@ -5,4 +5,5 @@ declare const Collapse: import("svelte").Component<Partial<CollapseProps> & {
5
5
  }, {
6
6
  api: CollapseApi;
7
7
  }, "visible">;
8
+ type Collapse = ReturnType<typeof Collapse>;
8
9
  export default Collapse;
@@ -3,10 +3,10 @@ import type { ModalProps } from './modal.gen';
3
3
  * Opens a modal dialog with the specified options.
4
4
  *
5
5
  * @template Data - The type of data that the modal will handle.
6
- * @param {Partial<ModalProps<Data>>} options - The options to configure the modal.
7
- * @param {Object} [context] - Optional context to pass to the modal.
8
- * @param {Map<any, any>} [context.context] - A map of context values to pass to the modal.
9
- * @returns {Promise<any>} A promise that resolves when the modal is closed.
6
+ * @param options - The options to configure the modal.
7
+ * @param context - Optional context to pass to the modal.
8
+ * @param context.context - A map of context values to pass to the modal.
9
+ * @returns A promise that resolves when the modal is closed.
10
10
  *
11
11
  * @example
12
12
  * ```typescript
@@ -4,10 +4,10 @@ import Modal from './Modal.svelte';
4
4
  * Opens a modal dialog with the specified options.
5
5
  *
6
6
  * @template Data - The type of data that the modal will handle.
7
- * @param {Partial<ModalProps<Data>>} options - The options to configure the modal.
8
- * @param {Object} [context] - Optional context to pass to the modal.
9
- * @param {Map<any, any>} [context.context] - A map of context values to pass to the modal.
10
- * @returns {Promise<any>} A promise that resolves when the modal is closed.
7
+ * @param options - The options to configure the modal.
8
+ * @param context - Optional context to pass to the modal.
9
+ * @param context.context - A map of context values to pass to the modal.
10
+ * @returns A promise that resolves when the modal is closed.
11
11
  *
12
12
  * @example
13
13
  * ```typescript
@@ -1,3 +1,4 @@
1
1
  import type { PaginationProps } from './pagination.gen';
2
2
  declare const Pagination: import("svelte").Component<Partial<PaginationProps>, {}, "page">;
3
+ type Pagination = ReturnType<typeof Pagination>;
3
4
  export default Pagination;
@@ -1,3 +1,4 @@
1
1
  import type { PaginationContext } from './pagination.gen';
2
2
  declare const PaginationDefaultPages: import("svelte").Component<PaginationContext, {}, "">;
3
+ type PaginationDefaultPages = ReturnType<typeof PaginationDefaultPages>;
3
4
  export default PaginationDefaultPages;
@@ -1,3 +1,4 @@
1
1
  import type { PaginationContext } from './pagination.gen';
2
2
  declare const PaginationDefaultStructure: import("svelte").Component<PaginationContext, {}, "">;
3
+ type PaginationDefaultStructure = ReturnType<typeof PaginationDefaultStructure>;
3
4
  export default PaginationDefaultStructure;
@@ -1,3 +1,4 @@
1
1
  import { type ProgressbarProps } from './progressbar.gen';
2
2
  declare const Progressbar: import("svelte").Component<Partial<ProgressbarProps>, {}, "">;
3
+ type Progressbar = ReturnType<typeof Progressbar>;
3
4
  export default Progressbar;
@@ -1,3 +1,4 @@
1
1
  import type { ProgressbarContext } from './progressbar.gen';
2
2
  declare const ProgressbarDefaultStructure: import("svelte").Component<ProgressbarContext, {}, "">;
3
+ type ProgressbarDefaultStructure = ReturnType<typeof ProgressbarDefaultStructure>;
3
4
  export default ProgressbarDefaultStructure;
@@ -1,3 +1,4 @@
1
1
  import type { RatingProps } from './rating.gen';
2
2
  declare const Rating: import("svelte").Component<Partial<RatingProps>, {}, "rating">;
3
+ type Rating = ReturnType<typeof Rating>;
3
4
  export default Rating;
@@ -306,6 +306,8 @@ declare const export_createSelect: <Item>(config?: PropsConfig<SelectProps<Item>
306
306
  export { export_createSelect as createSelect };
307
307
  /**
308
308
  * Item representation built from the items provided in parameters
309
+ *
310
+ * @template T - The type of the Select Items
309
311
  */
310
312
  export interface ItemContext<T> {
311
313
  /**
@@ -323,6 +325,8 @@ export interface ItemContext<T> {
323
325
  }
324
326
  /**
325
327
  * Interface representing the API for a Select component.
328
+ *
329
+ * @template Item - The type of the Select Items
326
330
  */
327
331
  export interface SelectApi<Item> {
328
332
  /**
@@ -388,6 +392,8 @@ export interface SelectApi<Item> {
388
392
  }
389
393
  /**
390
394
  * Interface representing the directives used in the Select component.
395
+ *
396
+ * @template Item - The type of the Select Items
391
397
  */
392
398
  export interface SelectDirectives<Item> {
393
399
  /**
@@ -1,3 +1,4 @@
1
1
  import type { SliderProps } from './slider.gen';
2
2
  declare const Slider: import("svelte").Component<Partial<SliderProps>, {}, "values">;
3
+ type Slider = ReturnType<typeof Slider>;
3
4
  export default Slider;
@@ -1,3 +1,4 @@
1
1
  import type { SliderSlotHandleContext } from './slider.gen';
2
2
  declare const SliderDefaultHandle: import("svelte").Component<SliderSlotHandleContext, {}, "">;
3
+ type SliderDefaultHandle = ReturnType<typeof SliderDefaultHandle>;
3
4
  export default SliderDefaultHandle;
@@ -1,3 +1,4 @@
1
1
  import type { SliderContext } from './slider.gen';
2
2
  declare const SliderDefaultStructure: import("svelte").Component<SliderContext, {}, "">;
3
+ type SliderDefaultStructure = ReturnType<typeof SliderDefaultStructure>;
3
4
  export default SliderDefaultStructure;
@@ -2,4 +2,5 @@ import type { ToastApi, ToastProps } from './toast.gen';
2
2
  declare const Toast: import("svelte").Component<Partial<ToastProps>, {
3
3
  api: ToastApi;
4
4
  }, "visible">;
5
+ type Toast = ReturnType<typeof Toast>;
5
6
  export default Toast;
@@ -1,3 +1,4 @@
1
1
  import type { ToastContext } from './toast.gen';
2
2
  declare const ToastDefaultStructure: import("svelte").Component<ToastContext, {}, "">;
3
+ type ToastDefaultStructure = ReturnType<typeof ToastDefaultStructure>;
3
4
  export default ToastDefaultStructure;
@@ -0,0 +1,36 @@
1
+ <script lang="ts">
2
+ import {Slot} from '@agnos-ui/svelte-headless/slot';
3
+ import {callWidgetFactory} from '../../config';
4
+ import type {TreeContext, TreeProps, TreeSlotItemContext} from './tree.gen';
5
+ import {createTree} from './tree.gen';
6
+ import TreeDefaultItemContent from './TreeDefaultItemContent.svelte';
7
+ import TreeDefaultItem from './TreeDefaultItem.svelte';
8
+ import TreeDefaultStructure from './TreeDefaultStructure.svelte';
9
+ import TreeDefaultItemToggle from './TreeDefaultItemToggle.svelte';
10
+
11
+ let props: Partial<TreeProps> = $props();
12
+
13
+ const widget = callWidgetFactory({
14
+ factory: createTree,
15
+ widgetName: 'tree',
16
+ props,
17
+ enablePatchChanged: true,
18
+ defaultConfig: {structure, item, itemContent, itemToggle},
19
+ });
20
+ const {state} = widget;
21
+ </script>
22
+
23
+ {#snippet structure(props: TreeContext)}
24
+ <TreeDefaultStructure {...props} />
25
+ {/snippet}
26
+ {#snippet item(props: TreeSlotItemContext)}
27
+ <TreeDefaultItem {...props} />
28
+ {/snippet}
29
+ {#snippet itemContent(props: TreeSlotItemContext)}
30
+ <TreeDefaultItemContent {...props} />
31
+ {/snippet}
32
+ {#snippet itemToggle(props: TreeSlotItemContext)}
33
+ <TreeDefaultItemToggle {...props} />
34
+ {/snippet}
35
+
36
+ <Slot content={state.structure} props={widget} />
@@ -0,0 +1,4 @@
1
+ import type { TreeProps } from './tree.gen';
2
+ declare const Tree: import("svelte").Component<Partial<TreeProps>, {}, "">;
3
+ type Tree = ReturnType<typeof Tree>;
4
+ export default Tree;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import {ssrAttributes as __AgnosUISveltePreprocess__ssrAttributes} from '@agnos-ui/svelte-headless/utils/directive';
3
+ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
4
+
5
+ import {Slot} from '@agnos-ui/svelte-headless/slot';
6
+ import type {TreeSlotItemContext} from './tree.gen';
7
+
8
+ let {item, state, api, directives}: TreeSlotItemContext = $props();
9
+ </script>
10
+
11
+ <li use:directives.itemAttributesDirective={{item: item}} {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes([directives.itemAttributesDirective, {item: item}])}>
12
+ <Slot content={state.itemContent} props={{item, state, api, directives}} />
13
+ {#if state.expandedMap.get(item)}
14
+ <ul role="group">
15
+ {#each item.children as child, index (child.label + child.level + index)}
16
+ <Slot content={state.item} props={{item: child, state, api, directives}} />
17
+ {/each}
18
+ </ul>
19
+ {/if}
20
+ </li>
@@ -0,0 +1,3 @@
1
+ declare const TreeDefaultItem: import("svelte").Component<any, {}, "">;
2
+ type TreeDefaultItem = ReturnType<typeof TreeDefaultItem>;
3
+ export default TreeDefaultItem;
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import {Slot} from '@agnos-ui/svelte-headless/slot';
3
+ import type {TreeSlotItemContext} from './tree.gen';
4
+
5
+ let {item, state, api, directives}: TreeSlotItemContext = $props();
6
+ </script>
7
+
8
+ <span class="au-tree-item">
9
+ <Slot content={state.itemToggle} props={{item, state, api, directives}} />
10
+ {item.label}
11
+ </span>
@@ -0,0 +1,3 @@
1
+ declare const TreeDefaultItemContent: import("svelte").Component<any, {}, "">;
2
+ type TreeDefaultItemContent = ReturnType<typeof TreeDefaultItemContent>;
3
+ export default TreeDefaultItemContent;
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import {ssrAttributes as __AgnosUISveltePreprocess__ssrAttributes} from '@agnos-ui/svelte-headless/utils/directive';
3
+ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
4
+
5
+ import type {TreeSlotItemContext} from './tree.gen';
6
+
7
+ let {item, directives}: TreeSlotItemContext = $props();
8
+ </script>
9
+
10
+ {#if item.children.length > 0}
11
+ <!-- svelte-ignore a11y_consider_explicit_label -->
12
+ <button use:directives.itemToggleDirective={{item: item}} {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes([directives.itemToggleDirective, {item: item}])}></button>
13
+ {:else}
14
+ <span class="au-tree-expand-icon-placeholder"></span>
15
+ {/if}
@@ -0,0 +1,3 @@
1
+ declare const TreeDefaultItemToggle: import("svelte").Component<any, {}, "">;
2
+ type TreeDefaultItemToggle = ReturnType<typeof TreeDefaultItemToggle>;
3
+ export default TreeDefaultItemToggle;
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import {ssrAttributes as __AgnosUISveltePreprocess__ssrAttributes, classDirective as __AgnosUISveltePreprocess__classDirective} from '@agnos-ui/svelte-headless/utils/directive';
3
+ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
4
+
5
+ import {Slot} from '@agnos-ui/svelte-headless/slot';
6
+ import type {TreeContext} from './tree.gen';
7
+
8
+ let widget: TreeContext = $props();
9
+ let {state, directives} = widget;
10
+ </script>
11
+
12
+ <ul role="tree" use:__AgnosUISveltePreprocess__classDirective={"au-tree "+(state.className)} use:directives.navigationDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directives.navigationDirective, [__AgnosUISveltePreprocess__classDirective, "au-tree "+(state.className)])}>
13
+ {#each state.normalizedNodes as item, index (item.label + item.level + index)}
14
+ <Slot content={state.item} props={{item, ...widget}} />
15
+ {/each}
16
+ </ul>
@@ -0,0 +1,3 @@
1
+ declare const TreeDefaultStructure: import("svelte").Component<WidgetSlotContext<Widget<import("./tree.gen").TreeProps, import("./tree.gen").TreeState, import("./tree.gen").TreeApi, import("./tree.gen").TreeDirectives>>, {}, "">;
2
+ type TreeDefaultStructure = ReturnType<typeof TreeDefaultStructure>;
3
+ export default TreeDefaultStructure;
@@ -0,0 +1,3 @@
1
+ import Tree from './Tree.svelte';
2
+ export * from './tree.gen';
3
+ export { Tree };
@@ -0,0 +1,3 @@
1
+ import Tree from './Tree.svelte';
2
+ export * from './tree.gen';
3
+ export { Tree };
@@ -0,0 +1,216 @@
1
+ import type { WidgetSlotContext, SlotContent, Widget, WidgetFactory, Directive } from '@agnos-ui/svelte-headless/types';
2
+ /**
3
+ * Retrieve a shallow copy of the default Tree config
4
+ * @returns the default Tree config
5
+ */
6
+ declare const export_getTreeDefaultConfig: () => TreeProps;
7
+ export { export_getTreeDefaultConfig as getTreeDefaultConfig };
8
+ /**
9
+ * Represents the context for a Tree widget.
10
+ * This interface is an alias for `WidgetSlotContext<TreeWidget>`.
11
+ */
12
+ export type TreeContext = WidgetSlotContext<TreeWidget>;
13
+ /**
14
+ * Represents the context for a tree item, extending the base `TreeContext`
15
+ * with an additional `item` property.
16
+ */
17
+ export type TreeSlotItemContext = TreeContext & {
18
+ item: NormalizedTreeItem;
19
+ };
20
+ /**
21
+ * Represents the state of a Tree component.
22
+ */
23
+ export interface TreeState {
24
+ /**
25
+ * Array of normalized tree nodes
26
+ */
27
+ normalizedNodes: NormalizedTreeItem[];
28
+ /**
29
+ * Getter of expanded state for each tree node
30
+ */
31
+ expandedMap: {
32
+ get(item: NormalizedTreeItem): boolean | undefined;
33
+ };
34
+ /**
35
+ * Optional accessibility label for the tree if there is no explicit label
36
+ *
37
+ * @defaultValue `''`
38
+ */
39
+ ariaLabel?: string;
40
+ /**
41
+ * CSS classes to be applied on the widget main container
42
+ *
43
+ * @defaultValue `''`
44
+ */
45
+ className: string;
46
+ /**
47
+ * Slot to change the default display of the tree
48
+ */
49
+ structure: SlotContent<TreeContext>;
50
+ /**
51
+ * Slot to change the default tree item
52
+ */
53
+ item: SlotContent<TreeSlotItemContext>;
54
+ /**
55
+ * Slot to change the default tree item content
56
+ */
57
+ itemContent: SlotContent<TreeSlotItemContext>;
58
+ /**
59
+ * Slot to change the default tree item toggle
60
+ */
61
+ itemToggle: SlotContent<TreeSlotItemContext>;
62
+ }
63
+ /**
64
+ * Represents the properties for the Tree component.
65
+ */
66
+ export interface TreeProps {
67
+ /**
68
+ * Array of the tree nodes to display
69
+ *
70
+ * @defaultValue `[]`
71
+ */
72
+ nodes: TreeItem[];
73
+ /**
74
+ * An event emitted when the user toggles the expand of the TreeItem.
75
+ *
76
+ * Event payload is equal to the TreeItem clicked.
77
+ *
78
+ * @defaultValue
79
+ * ```ts
80
+ * () => {}
81
+ * ```
82
+ */
83
+ onExpandToggle: (node: NormalizedTreeItem) => void;
84
+ /**
85
+ * Retrieves expand items of the TreeItem
86
+ *
87
+ * @param node - HTML element that is representing the expand item
88
+ *
89
+ * @defaultValue
90
+ * ```ts
91
+ * (node: HTMLElement) => node.querySelectorAll('button')
92
+ * ```
93
+ */
94
+ navSelector(node: HTMLElement): NodeListOf<HTMLButtonElement>;
95
+ /**
96
+ * Return the value for the 'aria-label' attribute of the toggle
97
+ * @param label - tree item label
98
+ *
99
+ * @defaultValue
100
+ * ```ts
101
+ * (label: string) => `Toggle ${label}`
102
+ * ```
103
+ */
104
+ ariaLabelToggleFn: (label: string) => string;
105
+ /**
106
+ * Optional accessibility label for the tree if there is no explicit label
107
+ *
108
+ * @defaultValue `''`
109
+ */
110
+ ariaLabel?: string;
111
+ /**
112
+ * CSS classes to be applied on the widget main container
113
+ *
114
+ * @defaultValue `''`
115
+ */
116
+ className: string;
117
+ /**
118
+ * Slot to change the default display of the tree
119
+ */
120
+ structure: SlotContent<TreeContext>;
121
+ /**
122
+ * Slot to change the default tree item
123
+ */
124
+ item: SlotContent<TreeSlotItemContext>;
125
+ /**
126
+ * Slot to change the default tree item content
127
+ */
128
+ itemContent: SlotContent<TreeSlotItemContext>;
129
+ /**
130
+ * Slot to change the default tree item toggle
131
+ */
132
+ itemToggle: SlotContent<TreeSlotItemContext>;
133
+ }
134
+ /**
135
+ * Represents a Tree widget component.
136
+ */
137
+ export type TreeWidget = Widget<TreeProps, TreeState, TreeApi, TreeDirectives>;
138
+ /**
139
+ * Create a Tree with given config props
140
+ * @param config - an optional tree config
141
+ * @returns a TreeWidget
142
+ */
143
+ declare const export_createTree: WidgetFactory<TreeWidget>;
144
+ export { export_createTree as createTree };
145
+ /**
146
+ * Represents a tree item component.
147
+ */
148
+ export interface TreeItem {
149
+ /**
150
+ * Optional accessibility label for the node
151
+ */
152
+ ariaLabel?: string;
153
+ /**
154
+ * Optional array of children nodes
155
+ */
156
+ children?: TreeItem[];
157
+ /**
158
+ * If `true` the node is expanded
159
+ */
160
+ isExpanded?: boolean;
161
+ /**
162
+ * String title of the node
163
+ */
164
+ label: string;
165
+ }
166
+ /**
167
+ * Normalized TreeItem object
168
+ */
169
+ export interface NormalizedTreeItem {
170
+ /**
171
+ * Accessibility label for the node
172
+ */
173
+ ariaLabel: string;
174
+ /**
175
+ * Level in the hierarchy, starts with 0 for a root node
176
+ */
177
+ level: number;
178
+ /**
179
+ * An array of children nodes
180
+ */
181
+ children: NormalizedTreeItem[];
182
+ /**
183
+ * If `true` the node is expanded
184
+ */
185
+ isExpanded?: boolean;
186
+ /**
187
+ * String title of the node
188
+ */
189
+ label: string;
190
+ }
191
+ /**
192
+ * Interface representing the API for a Tree component.
193
+ */
194
+ export interface TreeApi {
195
+ }
196
+ /**
197
+ * Interface representing various directives used in the Tree component.
198
+ */
199
+ export interface TreeDirectives {
200
+ /**
201
+ * Directive to attach navManager for the tree
202
+ */
203
+ navigationDirective: Directive;
204
+ /**
205
+ * Directive to handle toggle for the tree item
206
+ */
207
+ itemToggleDirective: Directive<{
208
+ item: NormalizedTreeItem;
209
+ }>;
210
+ /**
211
+ * Directive to handle attributes for the tree item
212
+ */
213
+ itemAttributesDirective: Directive<{
214
+ item: NormalizedTreeItem;
215
+ }>;
216
+ }
@@ -0,0 +1,14 @@
1
+ import { getTreeDefaultConfig, createTree } from '@agnos-ui/core-bootstrap/components/tree';
2
+ /**
3
+ * Retrieve a shallow copy of the default Tree config
4
+ * @returns the default Tree config
5
+ */
6
+ const export_getTreeDefaultConfig = getTreeDefaultConfig;
7
+ export { export_getTreeDefaultConfig as getTreeDefaultConfig };
8
+ /**
9
+ * Create a Tree with given config props
10
+ * @param config - an optional tree config
11
+ * @returns a TreeWidget
12
+ */
13
+ const export_createTree = createTree;
14
+ export { export_createTree as createTree };
package/config.gen.d.ts CHANGED
@@ -8,6 +8,7 @@ import type { RatingProps } from './components/rating';
8
8
  import type { SelectProps } from './components/select';
9
9
  import type { SliderProps } from './components/slider';
10
10
  import type { ToastProps } from './components/toast';
11
+ import type { TreeProps } from './components/tree';
11
12
  export type WidgetsConfig = {
12
13
  /**
13
14
  * the accordion widget config
@@ -49,4 +50,8 @@ export type WidgetsConfig = {
49
50
  * the toast widget config
50
51
  */
51
52
  toast: ToastProps;
53
+ /**
54
+ * the tree widget config
55
+ */
56
+ tree: TreeProps;
52
57
  };
package/index.d.ts CHANGED
@@ -8,4 +8,5 @@ export * from './components/rating';
8
8
  export * from './components/select';
9
9
  export * from './components/slider';
10
10
  export * from './components/toast';
11
+ export * from './components/tree';
11
12
  export * from './generated';
package/index.js CHANGED
@@ -8,4 +8,5 @@ export * from './components/rating';
8
8
  export * from './components/select';
9
9
  export * from './components/slider';
10
10
  export * from './components/toast';
11
+ export * from './components/tree';
11
12
  export * from './generated';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agnos-ui/svelte-bootstrap",
3
3
  "description": "Bootstrap-based component library for Svelte.",
4
- "version": "0.5.0-next.0",
4
+ "version": "0.6.0-next.0",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "module": "./index.js",
@@ -49,13 +49,13 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@agnos-ui/core-bootstrap": "0.5.0-next.0",
53
- "@agnos-ui/svelte-headless": "0.5.0-next.0"
52
+ "@agnos-ui/core-bootstrap": "0.6.0-next.0",
53
+ "@agnos-ui/svelte-headless": "0.6.0-next.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@amadeus-it-group/tansu": "^1.0.0",
57
57
  "esm-env": "^1.1.4",
58
- "svelte": "^5.1.4"
58
+ "svelte": "^5.2.7"
59
59
  },
60
60
  "sideEffects": false,
61
61
  "homepage": "https://www.agnosui.dev/latest/",