@agnos-ui/svelte-bootstrap 0.9.3 → 0.10.0-next.1

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 (32) hide show
  1. package/components/accordion/ItemDefaultStructure.svelte +1 -3
  2. package/components/accordion/accordion.gen.d.ts +8 -8
  3. package/components/accordion/accordion.gen.js +1 -1
  4. package/components/carousel/Carousel.svelte.d.ts +14 -3
  5. package/components/carousel/CarouselDefaultNavigation.svelte.d.ts +13 -3
  6. package/components/carousel/CarouselDefaultStructure.svelte.d.ts +13 -3
  7. package/components/carousel/carousel.gen.d.ts +19 -12
  8. package/components/collapse/collapse.gen.d.ts +2 -2
  9. package/components/drawer/Drawer.svelte +51 -0
  10. package/components/drawer/Drawer.svelte.d.ts +6 -0
  11. package/components/drawer/DrawerDefaultStructure.svelte +20 -0
  12. package/components/drawer/DrawerDefaultStructure.svelte.d.ts +3 -0
  13. package/components/drawer/drawer.gen.d.ts +300 -0
  14. package/components/drawer/drawer.gen.js +14 -0
  15. package/components/drawer/index.d.ts +3 -0
  16. package/components/drawer/index.js +3 -0
  17. package/components/modal/Modal.svelte.d.ts +12 -3
  18. package/components/modal/ModalDefaultHeader.svelte.d.ts +10 -3
  19. package/components/modal/ModalDefaultStructure.svelte.d.ts +10 -3
  20. package/components/modal/modal.gen.d.ts +7 -1
  21. package/components/modal/modal.gen.js +7 -1
  22. package/components/select/Select.svelte.d.ts +12 -3
  23. package/components/slider/slider.gen.d.ts +4 -4
  24. package/components/tree/tree.gen.d.ts +0 -12
  25. package/config.gen.d.ts +5 -0
  26. package/generated/index.d.ts +1 -0
  27. package/generated/index.js +1 -0
  28. package/generated/services/focusElement.d.ts +1 -0
  29. package/generated/services/focusElement.js +1 -0
  30. package/index.d.ts +1 -0
  31. package/index.js +2 -0
  32. package/package.json +3 -3
@@ -8,9 +8,7 @@ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
8
8
  let widget: AccordionItemContext = $props();
9
9
  const {state, directives} = widget;
10
10
 
11
- const re = new RegExp('^h[1-6]$');
12
-
13
- let headingTag = $derived(re.test(state.headingTag) ? state.headingTag : 'h2');
11
+ let headingTag = $derived(`h${state.headingLevel}`);
14
12
  </script>
15
13
 
16
14
  <svelte:element this={headingTag} use:__AgnosUISveltePreprocess__classDirective={"accordion-header"} use:directives.headerDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directives.headerDirective, [__AgnosUISveltePreprocess__classDirective, "accordion-header"])}>
@@ -120,11 +120,11 @@ export interface AccordionProps {
120
120
  */
121
121
  itemBodyClassName: string;
122
122
  /**
123
- * The html tag to use for the accordion-item-header.
123
+ * The html heading level to use for the accordion-item-header.
124
124
  *
125
- * @defaultValue `''`
125
+ * @defaultValue `2`
126
126
  */
127
- itemHeadingTag: string;
127
+ itemHeadingLevel: 1 | 2 | 3 | 4 | 5 | 6;
128
128
  /**
129
129
  * CSS classes to be applied on the widget main container
130
130
  *
@@ -185,9 +185,9 @@ export interface AccordionItemState {
185
185
  */
186
186
  bodyClassName: string;
187
187
  /**
188
- * The html tag to use for the accordion-item-header.
188
+ * The html heading level to use for the accordion-item-header.
189
189
  */
190
- headingTag: string;
190
+ headingLevel: 1 | 2 | 3 | 4 | 5 | 6;
191
191
  /**
192
192
  * CSS classes to be applied on the widget main container
193
193
  *
@@ -277,9 +277,9 @@ export interface AccordionItemProps {
277
277
  */
278
278
  bodyClassName: string;
279
279
  /**
280
- * The html tag to use for the accordion-item-header.
280
+ * The html heading level to use for the accordion-item-header.
281
281
  */
282
- headingTag: string;
282
+ headingLevel: 1 | 2 | 3 | 4 | 5 | 6;
283
283
  /**
284
284
  * CSS classes to be applied on the widget main container
285
285
  *
@@ -327,7 +327,7 @@ export { export_createAccordionItem as createAccordionItem };
327
327
  declare const export_createAccordion: WidgetFactory<AccordionWidget>;
328
328
  export { export_createAccordion as createAccordion };
329
329
  /**
330
- * Create an accordion WidgetFactory based on a item factory and the list of item props that should inherit from the parent accordion
330
+ * Create an accordion WidgetFactory based on an item factory and the list of item props that should inherit from the parent accordion
331
331
  *
332
332
  * @param itemFactory - the item factory
333
333
  * @param accordionItemProps - the list of item props
@@ -20,7 +20,7 @@ export { export_createAccordionItem as createAccordionItem };
20
20
  const export_createAccordion = createAccordion;
21
21
  export { export_createAccordion as createAccordion };
22
22
  /**
23
- * Create an accordion WidgetFactory based on a item factory and the list of item props that should inherit from the parent accordion
23
+ * Create an accordion WidgetFactory based on an item factory and the list of item props that should inherit from the parent accordion
24
24
  *
25
25
  * @param itemFactory - the item factory
26
26
  * @param accordionItemProps - the list of item props
@@ -1,10 +1,21 @@
1
1
  import type { CarouselProps, CarouselApi } from './carousel.gen';
2
+ declare function $$render<SlideData extends {
3
+ id: string;
4
+ }>(): {
5
+ props: Partial<CarouselProps<SlideData>>;
6
+ exports: {
7
+ api: CarouselApi;
8
+ };
9
+ bindings: "";
10
+ slots: {};
11
+ events: {};
12
+ };
2
13
  declare class __sveltets_Render<SlideData extends {
3
14
  id: string;
4
15
  }> {
5
- props(): Partial<CarouselProps<SlideData>>;
6
- events(): {};
7
- slots(): {};
16
+ props(): ReturnType<typeof $$render<SlideData>>['props'];
17
+ events(): ReturnType<typeof $$render<SlideData>>['events'];
18
+ slots(): ReturnType<typeof $$render<SlideData>>['slots'];
8
19
  bindings(): "";
9
20
  exports(): {
10
21
  api: CarouselApi;
@@ -1,9 +1,19 @@
1
+ import type { CarouselContext } from './carousel.gen';
2
+ declare function $$render<SlideData extends {
3
+ id: string;
4
+ }>(): {
5
+ props: CarouselContext<SlideData>;
6
+ exports: {};
7
+ bindings: "";
8
+ slots: {};
9
+ events: {};
10
+ };
1
11
  declare class __sveltets_Render<SlideData extends {
2
12
  id: string;
3
13
  }> {
4
- props(): WidgetSlotContext<Widget<import("./carousel.gen").CarouselProps<SlideData_1>, import("./carousel.gen").CarouselState<SlideData_1>, import("./carousel.gen").CarouselApi, import("./carousel.gen").CarouselDirectives>>;
5
- events(): {};
6
- slots(): {};
14
+ props(): ReturnType<typeof $$render<SlideData>>['props'];
15
+ events(): ReturnType<typeof $$render<SlideData>>['events'];
16
+ slots(): ReturnType<typeof $$render<SlideData>>['slots'];
7
17
  bindings(): "";
8
18
  exports(): {};
9
19
  }
@@ -1,9 +1,19 @@
1
+ import type { CarouselContext } from './carousel.gen';
2
+ declare function $$render<SlideData extends {
3
+ id: string;
4
+ }>(): {
5
+ props: CarouselContext<SlideData>;
6
+ exports: {};
7
+ bindings: "";
8
+ slots: {};
9
+ events: {};
10
+ };
1
11
  declare class __sveltets_Render<SlideData extends {
2
12
  id: string;
3
13
  }> {
4
- props(): WidgetSlotContext<Widget<import("./carousel.gen").CarouselProps<SlideData_1>, import("./carousel.gen").CarouselState<SlideData_1>, import("./carousel.gen").CarouselApi, import("./carousel.gen").CarouselDirectives>>;
5
- events(): {};
6
- slots(): {};
14
+ props(): ReturnType<typeof $$render<SlideData>>['props'];
15
+ events(): ReturnType<typeof $$render<SlideData>>['events'];
16
+ slots(): ReturnType<typeof $$render<SlideData>>['slots'];
7
17
  bindings(): "";
8
18
  exports(): {};
9
19
  }
@@ -52,10 +52,14 @@ export interface CarouselState<SlideData extends {
52
52
  initialized: boolean;
53
53
  /**
54
54
  * If `true`, 'previous' and 'next' navigation arrows will be visible.
55
+ *
56
+ * @defaultValue `true`
55
57
  */
56
58
  showNavigationArrows: boolean;
57
59
  /**
58
60
  * If `true`, navigation indicators at the bottom of the slide will be visible.
61
+ *
62
+ * @defaultValue `true`
59
63
  */
60
64
  showNavigationIndicators: boolean;
61
65
  /**
@@ -95,20 +99,14 @@ export interface CarouselState<SlideData extends {
95
99
  slidesData: SlideData[];
96
100
  /**
97
101
  * The structure of the carousel.
98
- *
99
- * @defaultValue `undefined`
100
102
  */
101
103
  structure: SlotContent<CarouselContext<SlideData>>;
102
104
  /**
103
105
  * The navigation layer of the carousel.
104
- *
105
- * @defaultValue `undefined`
106
106
  */
107
107
  navigation: SlotContent<CarouselContext<SlideData>>;
108
108
  /**
109
109
  * The content of each slide in the carousel.
110
- *
111
- * @defaultValue `undefined`
112
110
  */
113
111
  slide: SlotContent<CarouselSlideContext<SlideData>>;
114
112
  /**
@@ -133,14 +131,23 @@ export interface CarouselProps<SlideData extends {
133
131
  plugins: EmblaPluginType[];
134
132
  /**
135
133
  * Aria label for navigation indicators
134
+ *
135
+ * @defaultValue
136
+ * ```ts
137
+ * (index: number) => `Select slide ${index + 1}`
138
+ * ```
136
139
  */
137
140
  ariaIndicatorLabel: (index: number) => string;
138
141
  /**
139
142
  * Aria label for previous button
143
+ *
144
+ * @defaultValue `'Select previous slide'`
140
145
  */
141
146
  ariaPrevLabel: string;
142
147
  /**
143
148
  * Aria label for next button
149
+ *
150
+ * @defaultValue `'Select next slide'`
144
151
  */
145
152
  ariaNextLabel: string;
146
153
  /**
@@ -154,6 +161,8 @@ export interface CarouselProps<SlideData extends {
154
161
  * Enables choosing a custom container element which holds the slides. By default, Embla will choose the first direct child element of the root element. Provide a valid CSS selector string.
155
162
  *
156
163
  * @see {@link https://www.embla-carousel.com/api/options/#container}
164
+ *
165
+ * @defaultValue `null`
157
166
  */
158
167
  container: string | null;
159
168
  /**
@@ -207,10 +216,14 @@ export interface CarouselProps<SlideData extends {
207
216
  skipSnaps: boolean;
208
217
  /**
209
218
  * If `true`, 'previous' and 'next' navigation arrows will be visible.
219
+ *
220
+ * @defaultValue `true`
210
221
  */
211
222
  showNavigationArrows: boolean;
212
223
  /**
213
224
  * If `true`, navigation indicators at the bottom of the slide will be visible.
225
+ *
226
+ * @defaultValue `true`
214
227
  */
215
228
  showNavigationIndicators: boolean;
216
229
  /**
@@ -243,20 +256,14 @@ export interface CarouselProps<SlideData extends {
243
256
  slidesData: SlideData[];
244
257
  /**
245
258
  * The structure of the carousel.
246
- *
247
- * @defaultValue `undefined`
248
259
  */
249
260
  structure: SlotContent<CarouselContext<SlideData>>;
250
261
  /**
251
262
  * The navigation layer of the carousel.
252
- *
253
- * @defaultValue `undefined`
254
263
  */
255
264
  navigation: SlotContent<CarouselContext<SlideData>>;
256
265
  /**
257
266
  * The content of each slide in the carousel.
258
- *
259
- * @defaultValue `undefined`
260
267
  */
261
268
  slide: SlotContent<CarouselSlideContext<SlideData>>;
262
269
  /**
@@ -58,7 +58,7 @@ export interface CollapseProps {
58
58
  /**
59
59
  * If `true` the collapse is visible to the user
60
60
  *
61
- * @defaultValue `true`
61
+ * @defaultValue `false`
62
62
  */
63
63
  visible: boolean;
64
64
  /**
@@ -101,7 +101,7 @@ export interface CollapseState {
101
101
  /**
102
102
  * If `true` the collapse is visible to the user
103
103
  *
104
- * @defaultValue `true`
104
+ * @defaultValue `false`
105
105
  */
106
106
  visible: boolean;
107
107
  }
@@ -0,0 +1,51 @@
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 {callWidgetFactory} from '../../config';
7
+ import type {DrawerApi, DrawerContext, DrawerProps} from './drawer.gen';
8
+ import {createDrawer} from './drawer.gen';
9
+ import DrawerDefaultStructure from './DrawerDefaultStructure.svelte';
10
+
11
+ let {width = $bindable(), height = $bindable(), visible = $bindable(), ...props}: Partial<DrawerProps> = $props();
12
+
13
+ const widget = callWidgetFactory(createDrawer, {
14
+ get props() {
15
+ return {...props, width, height, visible};
16
+ },
17
+ defaultConfig: {structure},
18
+ events: {
19
+ onWidthChange: (value: number) => {
20
+ width = value;
21
+ },
22
+ onHeightChange: (value: number) => {
23
+ height = value;
24
+ },
25
+ onVisibleChange: (event) => {
26
+ visible = event;
27
+ },
28
+ },
29
+ });
30
+ const {
31
+ directives: {backdropDirective, backdropPortalDirective, drawerDirective, drawerPortalDirective, containerDirective},
32
+ state,
33
+ } = widget;
34
+
35
+ export const api: DrawerApi = widget.api;
36
+ </script>
37
+
38
+ {#snippet structure(props: DrawerContext)}
39
+ <DrawerDefaultStructure {...props} />
40
+ {/snippet}
41
+
42
+ {#if !state.hidden}
43
+ <div use:drawerPortalDirective use:drawerDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(drawerPortalDirective, drawerDirective)}>
44
+ <div use:containerDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(containerDirective)}>
45
+ <Slot content={state.structure} props={widget} />
46
+ </div>
47
+ </div>
48
+ {/if}
49
+ {#if !state.backdropHidden}
50
+ <div use:backdropPortalDirective use:backdropDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(backdropPortalDirective, backdropDirective)}></div>
51
+ {/if}
@@ -0,0 +1,6 @@
1
+ import type { DrawerApi, DrawerProps } from './drawer.gen';
2
+ declare const Drawer: import("svelte").Component<Partial<DrawerProps>, {
3
+ api: DrawerApi;
4
+ }, "visible" | "width" | "height">;
5
+ type Drawer = ReturnType<typeof Drawer>;
6
+ export default Drawer;
@@ -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 {DrawerContext} from './drawer.gen';
7
+
8
+ let widget: DrawerContext = $props();
9
+ let {state, directives} = widget;
10
+ </script>
11
+
12
+ <div class="au-drawer-header">
13
+ <Slot content={state.header} props={widget} />
14
+ </div>
15
+ <div class="au-drawer-body">
16
+ <Slot content={state.children} props={widget} />
17
+ </div>
18
+ {#if state.resizable}
19
+ <div use:directives.splitterDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directives.splitterDirective)}></div>
20
+ {/if}
@@ -0,0 +1,3 @@
1
+ declare const DrawerDefaultStructure: import("svelte").Component<WidgetSlotContext<Widget<import("./drawer.gen").DrawerProps, import("./drawer.gen").DrawerState, import("./drawer.gen").DrawerApi, import("./drawer.gen").DrawerDirectives>>, {}, "">;
2
+ type DrawerDefaultStructure = ReturnType<typeof DrawerDefaultStructure>;
3
+ export default DrawerDefaultStructure;
@@ -0,0 +1,300 @@
1
+ import type { WidgetSlotContext, SlotContent, Directive, Widget, WidgetFactory } from '@agnos-ui/svelte-headless/types';
2
+ import type { TransitionFn } from '@agnos-ui/svelte-headless/services/transitions/baseTransitions';
3
+ /**
4
+ * Retrieve a shallow copy of the default Drawer config
5
+ * @returns the default Drawer config
6
+ */
7
+ declare const export_getDrawerDefaultConfig: () => DrawerProps;
8
+ export { export_getDrawerDefaultConfig as getDrawerDefaultConfig };
9
+ /**
10
+ * Represents the context for a Drawer widget.
11
+ * This interface is an alias for `WidgetSlotContext<DrawerWidget>`.
12
+ */
13
+ export type DrawerContext = WidgetSlotContext<DrawerWidget>;
14
+ /**
15
+ * Represents the state of a Drawer component.
16
+ */
17
+ export interface DrawerState {
18
+ /**
19
+ * Whether the backdrop is fully hidden. This can be true either because {@link DrawerProps.backdrop|backdrop} is false or
20
+ * because {@link DrawerProps.visible|visible} is false and there is no current transition.
21
+ */
22
+ backdropHidden: boolean;
23
+ /**
24
+ * Flag to show whether the drawer is fully hidden.
25
+ */
26
+ hidden: boolean;
27
+ /**
28
+ * CSS classes to be applied on the widget main container
29
+ *
30
+ * @defaultValue `'w-full'`
31
+ */
32
+ className: string;
33
+ /**
34
+ * Which element should contain the drawer and backdrop DOM elements.
35
+ * If it is not null, the drawer and backdrop DOM elements are moved to the specified container.
36
+ * Otherwise, they stay where the widget is located.
37
+ *
38
+ * @defaultValue
39
+ * ```ts
40
+ * typeof window !== 'undefined' ? document.body : null
41
+ * ```
42
+ */
43
+ container: HTMLElement | null;
44
+ /**
45
+ * Classes to add on the backdrop DOM element.
46
+ *
47
+ * @defaultValue `''`
48
+ */
49
+ backdropClass: string;
50
+ /**
51
+ * If `true`, the drawer is shown; otherwise, it is hidden.
52
+ *
53
+ * @defaultValue `false`
54
+ */
55
+ visible: boolean;
56
+ /**
57
+ * If `true`, the drawer can be resized by the user.
58
+ *
59
+ * @defaultValue `false`
60
+ */
61
+ resizable: boolean;
62
+ /**
63
+ * Global template for the drawer component
64
+ */
65
+ structure: SlotContent<DrawerContext>;
66
+ /**
67
+ * Template for the drawer header
68
+ */
69
+ header: SlotContent<DrawerContext>;
70
+ /**
71
+ * Template for the drawer body
72
+ */
73
+ children: SlotContent<DrawerContext>;
74
+ }
75
+ /**
76
+ * Represents the properties for the Drawer component.
77
+ */
78
+ export interface DrawerProps {
79
+ /**
80
+ * The transition function will be executed when the drawer is displayed or hidden.
81
+ *
82
+ * @defaultValue
83
+ * ```ts
84
+ * collapseHorizontalTransition
85
+ * ```
86
+ */
87
+ transition: TransitionFn;
88
+ /**
89
+ * The transition function for vertically positioned drawer (top, bottom) that will be executed when the drawer is displayed or hidden.
90
+ *
91
+ * @defaultValue
92
+ * ```ts
93
+ * collapseVerticalTransition
94
+ * ```
95
+ */
96
+ verticalTransition: TransitionFn;
97
+ /**
98
+ * The transition to use for the backdrop behind the drawer (if present).
99
+ *
100
+ * @defaultValue `fadeTransition`
101
+ */
102
+ backdropTransition: TransitionFn;
103
+ /**
104
+ * If `true` opening and closing will be animated.
105
+ *
106
+ * @defaultValue `true`
107
+ */
108
+ animated: boolean;
109
+ /**
110
+ * aria-labelledby attribute to use for the drawer element.
111
+ *
112
+ * @defaultValue `''`
113
+ */
114
+ ariaLabelledBy: string;
115
+ /**
116
+ * aria-describedby attribute to use for the drawer element.
117
+ *
118
+ * @defaultValue `''`
119
+ */
120
+ ariaDescribedBy: string;
121
+ /**
122
+ * The width of the drawer in pixels.
123
+ *
124
+ * @defaultValue `200`
125
+ */
126
+ width: number;
127
+ /**
128
+ * The height of the drawer in pixels.
129
+ *
130
+ * @defaultValue `200`
131
+ */
132
+ height: number;
133
+ /**
134
+ * If `true` displays the backdrop element and disables the body scrolling, otherwise the body of the document is navigable
135
+ *
136
+ * @defaultValue `true`
137
+ */
138
+ backdrop: boolean;
139
+ /**
140
+ * If `true` allows body scrolling when the drawer is open.
141
+ *
142
+ * @defaultValue `false`
143
+ */
144
+ bodyScroll: boolean;
145
+ /**
146
+ * Event to be triggered when the transition is completed and the drawer is not visible.
147
+ *
148
+ * @defaultValue
149
+ * ```ts
150
+ * () => {}
151
+ * ```
152
+ */
153
+ onHidden: () => void;
154
+ /**
155
+ * Event to be triggered when the transition is completed and the drawer is visible.
156
+ *
157
+ * @defaultValue
158
+ * ```ts
159
+ * () => {}
160
+ * ```
161
+ */
162
+ onShown: () => void;
163
+ /**
164
+ * An event emitted when the width is changed.
165
+ *
166
+ * Event payload is equal to the newly selected width.
167
+ *
168
+ * @defaultValue
169
+ * ```ts
170
+ * () => {}
171
+ * ```
172
+ */
173
+ onWidthChange: (width: number) => void;
174
+ /**
175
+ * An event emitted when the height is changed.
176
+ *
177
+ * Event payload is equal to the newly selected height.
178
+ *
179
+ * @defaultValue
180
+ * ```ts
181
+ * () => {}
182
+ * ```
183
+ */
184
+ onHeightChange: (width: number) => void;
185
+ /**
186
+ * Event to be triggered when the visible property changes.
187
+ *
188
+ * @param visible - new value of the visible propery
189
+ *
190
+ * @defaultValue
191
+ * ```ts
192
+ * () => {}
193
+ * ```
194
+ */
195
+ onVisibleChange: (visible: boolean) => void;
196
+ /**
197
+ * CSS classes to be applied on the widget main container
198
+ *
199
+ * @defaultValue `'w-full'`
200
+ */
201
+ className: string;
202
+ /**
203
+ * Which element should contain the drawer and backdrop DOM elements.
204
+ * If it is not null, the drawer and backdrop DOM elements are moved to the specified container.
205
+ * Otherwise, they stay where the widget is located.
206
+ *
207
+ * @defaultValue
208
+ * ```ts
209
+ * typeof window !== 'undefined' ? document.body : null
210
+ * ```
211
+ */
212
+ container: HTMLElement | null;
213
+ /**
214
+ * Classes to add on the backdrop DOM element.
215
+ *
216
+ * @defaultValue `''`
217
+ */
218
+ backdropClass: string;
219
+ /**
220
+ * If `true`, the drawer is shown; otherwise, it is hidden.
221
+ *
222
+ * @defaultValue `false`
223
+ */
224
+ visible: boolean;
225
+ /**
226
+ * If `true`, the drawer can be resized by the user.
227
+ *
228
+ * @defaultValue `false`
229
+ */
230
+ resizable: boolean;
231
+ /**
232
+ * Global template for the drawer component
233
+ */
234
+ structure: SlotContent<DrawerContext>;
235
+ /**
236
+ * Template for the drawer header
237
+ */
238
+ header: SlotContent<DrawerContext>;
239
+ /**
240
+ * Template for the drawer body
241
+ */
242
+ children: SlotContent<DrawerContext>;
243
+ }
244
+ /**
245
+ * Represents the directives for the Drawer component.
246
+ */
247
+ export interface DrawerDirectives {
248
+ /**
249
+ * Directive to put on the drawer DOM element.
250
+ */
251
+ drawerDirective: Directive;
252
+ /**
253
+ * Directive to put on the backdrop DOM element.
254
+ */
255
+ backdropDirective: Directive;
256
+ /**
257
+ * Directive to put on the splitter DOM element.
258
+ */
259
+ splitterDirective: Directive;
260
+ /**
261
+ * Directive to put on the container DOM element in order for the drawer to size correctly.
262
+ */
263
+ containerDirective: Directive;
264
+ /**
265
+ * Portal directive to put on the drawer DOM element.
266
+ */
267
+ drawerPortalDirective: Directive;
268
+ /**
269
+ * Portal directive to put on the backdrop DOM element.
270
+ */
271
+ backdropPortalDirective: Directive;
272
+ }
273
+ /**
274
+ * Represents a Drawer widget component.
275
+ */
276
+ export type DrawerWidget = Widget<DrawerProps, DrawerState, DrawerApi, DrawerDirectives>;
277
+ /**
278
+ * Create a Drawer with given config props
279
+ * @param config - an optional Drawer config
280
+ * @returns a DrawerWidget
281
+ */
282
+ declare const export_createDrawer: WidgetFactory<DrawerWidget>;
283
+ export { export_createDrawer as createDrawer };
284
+ /**
285
+ * Possible values for the drawer positions
286
+ */
287
+ export type DrawerPositions = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';
288
+ /**
289
+ * Interface representing the API for a Drawer component.
290
+ */
291
+ export interface DrawerApi {
292
+ /**
293
+ * Trigger the opening of the drawer.
294
+ */
295
+ open: () => void;
296
+ /**
297
+ * Trigger the closing of the drawer.
298
+ */
299
+ close: () => void;
300
+ }
@@ -0,0 +1,14 @@
1
+ import { getDrawerDefaultConfig, createDrawer } from '@agnos-ui/core-bootstrap/components/drawer';
2
+ /**
3
+ * Retrieve a shallow copy of the default Drawer config
4
+ * @returns the default Drawer config
5
+ */
6
+ const export_getDrawerDefaultConfig = getDrawerDefaultConfig;
7
+ export { export_getDrawerDefaultConfig as getDrawerDefaultConfig };
8
+ /**
9
+ * Create a Drawer with given config props
10
+ * @param config - an optional Drawer config
11
+ * @returns a DrawerWidget
12
+ */
13
+ const export_createDrawer = createDrawer;
14
+ export { export_createDrawer as createDrawer };
@@ -0,0 +1,3 @@
1
+ export * from './drawer.gen';
2
+ import Drawer from './Drawer.svelte';
3
+ export { Drawer };
@@ -0,0 +1,3 @@
1
+ export * from './drawer.gen';
2
+ import Drawer from './Drawer.svelte';
3
+ export { Drawer };
@@ -1,8 +1,17 @@
1
1
  import type { ModalProps, ModalApi } from './modal.gen';
2
+ declare function $$render<Data>(): {
3
+ props: Partial<ModalProps<Data>>;
4
+ exports: {
5
+ api: ModalApi<Data>;
6
+ };
7
+ bindings: "visible";
8
+ slots: {};
9
+ events: {};
10
+ };
2
11
  declare class __sveltets_Render<Data> {
3
- props(): Partial<ModalProps<Data>>;
4
- events(): {};
5
- slots(): {};
12
+ props(): ReturnType<typeof $$render<Data>>['props'];
13
+ events(): ReturnType<typeof $$render<Data>>['events'];
14
+ slots(): ReturnType<typeof $$render<Data>>['slots'];
6
15
  bindings(): "visible";
7
16
  exports(): {
8
17
  api: ModalApi<Data>;
@@ -1,8 +1,15 @@
1
1
  import type { ModalContext } from './modal.gen';
2
+ declare function $$render<Data>(): {
3
+ props: ModalContext<Data>;
4
+ exports: {};
5
+ bindings: "";
6
+ slots: {};
7
+ events: {};
8
+ };
2
9
  declare class __sveltets_Render<Data> {
3
- props(): ModalContext<Data>;
4
- events(): {};
5
- slots(): {};
10
+ props(): ReturnType<typeof $$render<Data>>['props'];
11
+ events(): ReturnType<typeof $$render<Data>>['events'];
12
+ slots(): ReturnType<typeof $$render<Data>>['slots'];
6
13
  bindings(): "";
7
14
  exports(): {};
8
15
  }
@@ -1,8 +1,15 @@
1
1
  import type { ModalContext } from './modal.gen';
2
+ declare function $$render<Data>(): {
3
+ props: ModalContext<Data>;
4
+ exports: {};
5
+ bindings: "";
6
+ slots: {};
7
+ events: {};
8
+ };
2
9
  declare class __sveltets_Render<Data> {
3
- props(): ModalContext<Data>;
4
- events(): {};
5
- slots(): {};
10
+ props(): ReturnType<typeof $$render<Data>>['props'];
11
+ events(): ReturnType<typeof $$render<Data>>['events'];
12
+ slots(): ReturnType<typeof $$render<Data>>['slots'];
6
13
  bindings(): "";
7
14
  exports(): {};
8
15
  }
@@ -1,4 +1,4 @@
1
- import { modalOutsideClick, modalCloseButtonClick } from '@agnos-ui/core-bootstrap/components/modal';
1
+ import { modalOutsideClick, modalCloseButtonClick, modalCloseEscape } from '@agnos-ui/core-bootstrap/components/modal';
2
2
  import type { WidgetSlotContext, SlotContent, Widget, PropsConfig, Directive } from '@agnos-ui/svelte-headless/types';
3
3
  import type { TransitionFn } from '@agnos-ui/svelte-headless/services/transitions/baseTransitions';
4
4
  /**
@@ -309,6 +309,12 @@ export { export_modalOutsideClick as modalOutsideClick };
309
309
  */
310
310
  declare const export_modalCloseButtonClick: typeof modalCloseButtonClick;
311
311
  export { export_modalCloseButtonClick as modalCloseButtonClick };
312
+ /**
313
+ * Value present in the {@link ModalBeforeCloseEvent.result|result} property of the {@link ModalProps.onBeforeClose|onBeforeClose} event
314
+ * and returned by the {@link ModalApi.open|open} method, when the modal is closed by pressing the Escape key.
315
+ */
316
+ declare const export_modalCloseEscape: typeof modalCloseEscape;
317
+ export { export_modalCloseEscape as modalCloseEscape };
312
318
  /**
313
319
  * Type of the parameter of {@link ModalProps.onBeforeClose|onBeforeClose}.
314
320
  */
@@ -1,4 +1,4 @@
1
- import { getModalDefaultConfig, createModal, modalOutsideClick, modalCloseButtonClick } from '@agnos-ui/core-bootstrap/components/modal';
1
+ import { getModalDefaultConfig, createModal, modalOutsideClick, modalCloseButtonClick, modalCloseEscape } from '@agnos-ui/core-bootstrap/components/modal';
2
2
  /**
3
3
  * Retrieve a shallow copy of the default modal config
4
4
  * @returns the default modal config
@@ -24,3 +24,9 @@ export { export_modalOutsideClick as modalOutsideClick };
24
24
  */
25
25
  const export_modalCloseButtonClick = modalCloseButtonClick;
26
26
  export { export_modalCloseButtonClick as modalCloseButtonClick };
27
+ /**
28
+ * Value present in the {@link ModalBeforeCloseEvent.result|result} property of the {@link ModalProps.onBeforeClose|onBeforeClose} event
29
+ * and returned by the {@link ModalApi.open|open} method, when the modal is closed by pressing the Escape key.
30
+ */
31
+ const export_modalCloseEscape = modalCloseEscape;
32
+ export { export_modalCloseEscape as modalCloseEscape };
@@ -1,8 +1,17 @@
1
1
  import type { SelectApi, SelectProps } from './select.gen';
2
+ declare function $$render<Item>(): {
3
+ props: Partial<SelectProps<Item>>;
4
+ exports: {
5
+ api: SelectApi<Item>;
6
+ };
7
+ bindings: "open" | "selected" | "filterText";
8
+ slots: {};
9
+ events: {};
10
+ };
2
11
  declare class __sveltets_Render<Item> {
3
- props(): Partial<SelectProps<Item>>;
4
- events(): {};
5
- slots(): {};
12
+ props(): ReturnType<typeof $$render<Item>>['props'];
13
+ events(): ReturnType<typeof $$render<Item>>['events'];
14
+ slots(): ReturnType<typeof $$render<Item>>['slots'];
6
15
  bindings(): "open" | "selected" | "filterText";
7
16
  exports(): {
8
17
  api: SelectApi<Item>;
@@ -213,7 +213,7 @@ export interface SliderProps {
213
213
  *
214
214
  * @defaultValue
215
215
  * ```ts
216
- * (value: number) => ''
216
+ * () => ''
217
217
  * ```
218
218
  */
219
219
  ariaValueText: (value: number, sortedIndex: number) => string;
@@ -245,21 +245,21 @@ export interface SliderProps {
245
245
  * Minimum distance between two values.
246
246
  * When set to 0, no minimum distance constraint is applied.
247
247
  *
248
- * @defaultValue 0
248
+ * @defaultValue `0`
249
249
  */
250
250
  minRange: number;
251
251
  /**
252
252
  * Maximum distance between two values
253
253
  * When set to 0, no maximum distance constraint is applied.
254
254
  *
255
- * @defaultValue 0
255
+ * @defaultValue `0`
256
256
  */
257
257
  maxRange: number;
258
258
  /**
259
259
  * When true, if moving a value would break the minRange or maxRange constraint,
260
260
  * it will instead push or pull the neighboring values to keep the allowed range rather than just stopping.
261
261
  *
262
- * @defaultValue false
262
+ * @defaultValue `false`
263
263
  */
264
264
  pushRange: boolean;
265
265
  /**
@@ -31,12 +31,6 @@ export interface TreeState {
31
31
  expandedMap: {
32
32
  get(item: NormalizedTreeItem): boolean | undefined;
33
33
  };
34
- /**
35
- * Optional accessibility label for the tree if there is no explicit label
36
- *
37
- * @defaultValue `''`
38
- */
39
- ariaLabel?: string;
40
34
  /**
41
35
  * CSS classes to be applied on the widget main container
42
36
  *
@@ -102,12 +96,6 @@ export interface TreeProps {
102
96
  * ```
103
97
  */
104
98
  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
99
  /**
112
100
  * CSS classes to be applied on the widget main container
113
101
  *
package/config.gen.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { AccordionProps } from './components/accordion';
2
2
  import type { AlertProps } from './components/alert';
3
3
  import type { CarouselProps } from './components/carousel';
4
4
  import type { CollapseProps } from './components/collapse';
5
+ import type { DrawerProps } from './components/drawer';
5
6
  import type { ModalProps } from './components/modal';
6
7
  import type { PaginationProps } from './components/pagination';
7
8
  import type { ProgressbarProps } from './components/progressbar';
@@ -27,6 +28,10 @@ export type WidgetsConfig = {
27
28
  * the collapse widget config
28
29
  */
29
30
  collapse: CollapseProps;
31
+ /**
32
+ * the drawer widget config
33
+ */
34
+ drawer: DrawerProps;
30
35
  /**
31
36
  * the modal widget config
32
37
  */
@@ -16,6 +16,7 @@ export * from './services/matchMedia';
16
16
  export * from './services/intersection';
17
17
  export * from './services/hash';
18
18
  export * from './services/focustrack';
19
+ export * from './services/focusElement';
19
20
  export * from './services/floatingUI';
20
21
  export * from './services/extendWidget';
21
22
  export * from './services/transitions/simpleClassTransition';
@@ -16,6 +16,7 @@ export * from './services/matchMedia';
16
16
  export * from './services/intersection';
17
17
  export * from './services/hash';
18
18
  export * from './services/focustrack';
19
+ export * from './services/focusElement';
19
20
  export * from './services/floatingUI';
20
21
  export * from './services/extendWidget';
21
22
  export * from './services/transitions/simpleClassTransition';
@@ -0,0 +1 @@
1
+ export * from '@agnos-ui/svelte-headless/services/focusElement';
@@ -0,0 +1 @@
1
+ export * from '@agnos-ui/svelte-headless/services/focusElement';
package/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export * from './components/select';
10
10
  export * from './components/slider';
11
11
  export * from './components/toast';
12
12
  export * from './components/tree';
13
+ export * from './components/drawer';
13
14
  export * from './generated';
package/index.js CHANGED
@@ -10,4 +10,6 @@ export * from './components/select';
10
10
  export * from './components/slider';
11
11
  export * from './components/toast';
12
12
  export * from './components/tree';
13
+ export * from './components/drawer';
14
+ // [export-placeholder]
13
15
  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.9.3",
4
+ "version": "0.10.0-next.1",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "module": "./index.js",
@@ -49,8 +49,8 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@agnos-ui/core-bootstrap": "0.9.3",
53
- "@agnos-ui/svelte-headless": "0.9.3"
52
+ "@agnos-ui/core-bootstrap": "0.10.0-next.1",
53
+ "@agnos-ui/svelte-headless": "0.10.0-next.1"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@amadeus-it-group/tansu": "^2.0.0",