@avenirs-esr/avenirs-dsav 0.1.50 → 0.1.53

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 (174) hide show
  1. package/dist/App.vue.d.ts +2 -0
  2. package/dist/avenirs-dsav.es.js +1606 -1494
  3. package/dist/avenirs-dsav.umd.js +7 -7
  4. package/dist/components/badges/AvBadge/AvBadge.stories.d.ts +36 -0
  5. package/dist/components/badges/AvBadge/AvBadge.stub.d.ts +18 -0
  6. package/dist/components/badges/AvBadge/AvBadge.test.d.ts +1 -0
  7. package/dist/components/badges/AvBadge/AvBadge.vue.d.ts +44 -0
  8. package/dist/components/badges/index.d.ts +2 -0
  9. package/dist/components/base/AvIconText/AvIconText.stories.d.ts +36 -0
  10. package/dist/components/base/AvIconText/AvIconText.test.d.ts +1 -0
  11. package/dist/components/base/AvIconText/AvIconText.vue.d.ts +40 -0
  12. package/dist/components/base/AvNotice/AvNotice.stories.d.ts +56 -0
  13. package/dist/components/base/AvNotice/AvNotice.test.d.ts +1 -0
  14. package/dist/components/base/AvNotice/AvNotice.vue.d.ts +22 -0
  15. package/dist/components/base/AvVIcon/AvVIcon.stories.d.ts +40 -0
  16. package/dist/components/base/AvVIcon/AvVIcon.stub.d.ts +5 -0
  17. package/dist/components/base/AvVIcon/AvVIcon.vue.d.ts +54 -0
  18. package/dist/components/base/index.d.ts +4 -0
  19. package/dist/components/cards/AvCard/AvCard.stories.d.ts +28 -0
  20. package/dist/components/cards/AvCard/AvCard.test.d.ts +1 -0
  21. package/dist/components/cards/AvCard/AvCard.vue.d.ts +58 -0
  22. package/dist/components/cards/index.d.ts +1 -0
  23. package/dist/components/feedback/AvAlert/AvAlert.test.d.ts +1 -0
  24. package/dist/components/feedback/AvAlert/AvAlert.vue.d.ts +77 -0
  25. package/dist/components/feedback/AvToaster/AvToaster.test.d.ts +1 -0
  26. package/dist/components/feedback/AvToaster/AvToaster.vue.d.ts +79 -0
  27. package/dist/components/feedback/index.d.ts +2 -0
  28. package/dist/components/header/AvHeader/AvHeader.test.d.ts +1 -0
  29. package/dist/components/header/AvHeader/AvHeader.vue.d.ts +132 -0
  30. package/dist/components/header/AvHeaderMenuLinks/AvHeaderMenuLinks.test.d.ts +1 -0
  31. package/dist/components/header/AvHeaderMenuLinks/AvHeaderMenuLinks.vue.d.ts +38 -0
  32. package/dist/components/header/AvLogo.vue.d.ts +2 -0
  33. package/dist/components/header/EsupLogo.test.d.ts +1 -0
  34. package/dist/components/header/EsupLogo.vue.d.ts +7 -0
  35. package/dist/components/header/index.d.ts +5 -0
  36. package/dist/components/index.d.ts +8 -0
  37. package/dist/components/interaction/accordions/AvAccordion/AvAccordion.stories.d.ts +30 -0
  38. package/dist/components/interaction/accordions/AvAccordion/AvAccordion.test.d.ts +1 -0
  39. package/dist/components/interaction/accordions/AvAccordion/AvAccordion.vue.d.ts +31 -0
  40. package/dist/components/interaction/accordions/AvAccordionsGroup/AvAccordionsGroup.stories.d.ts +41 -0
  41. package/dist/components/interaction/accordions/AvAccordionsGroup/AvAccordionsGroup.test.d.ts +1 -0
  42. package/dist/components/interaction/accordions/AvAccordionsGroup/AvAccordionsGroup.vue.d.ts +36 -0
  43. package/dist/components/interaction/accordions/index.d.ts +2 -0
  44. package/dist/components/interaction/buttons/AvButton/AvButton.stories.d.ts +66 -0
  45. package/dist/components/interaction/buttons/AvButton/AvButton.stub.d.ts +6 -0
  46. package/dist/components/interaction/buttons/AvButton/AvButton.test.d.ts +1 -0
  47. package/dist/components/interaction/buttons/AvButton/AvButton.vue.d.ts +78 -0
  48. package/dist/components/interaction/buttons/AvCancelConfirmButtons/AvCancelConfirmButtons.stories.d.ts +44 -0
  49. package/dist/components/interaction/buttons/AvCancelConfirmButtons/AvCancelConfirmButtons.stub.d.ts +6 -0
  50. package/dist/components/interaction/buttons/AvCancelConfirmButtons/AvCancelConfirmButtons.test.d.ts +1 -0
  51. package/dist/components/interaction/buttons/AvCancelConfirmButtons/AvCancelConfirmButtons.vue.d.ts +47 -0
  52. package/dist/components/interaction/buttons/AvRichButton/AvRichButton.stories.d.ts +39 -0
  53. package/dist/components/interaction/buttons/AvRichButton/AvRichButton.test.d.ts +1 -0
  54. package/dist/components/interaction/buttons/AvRichButton/AvRichButton.vue.d.ts +48 -0
  55. package/dist/components/interaction/buttons/index.d.ts +4 -0
  56. package/dist/components/interaction/files/AvFileUpload/AvFileUpload.stories.d.ts +22 -0
  57. package/dist/components/interaction/files/AvFileUpload/AvFileUpload.test.d.ts +1 -0
  58. package/dist/components/interaction/files/AvFileUpload/AvFileUpload.vue.d.ts +121 -0
  59. package/dist/components/interaction/files/AvFileUpload/AvFileUploadAlert.vue.d.ts +19 -0
  60. package/dist/components/interaction/files/index.d.ts +1 -0
  61. package/dist/components/interaction/index.d.ts +10 -0
  62. package/dist/components/interaction/inputs/AvInput/AvInput.stories.d.ts +61 -0
  63. package/dist/components/interaction/inputs/AvInput/AvInput.test.d.ts +1 -0
  64. package/dist/components/interaction/inputs/AvInput/AvInput.vue.d.ts +123 -0
  65. package/dist/components/interaction/inputs/index.d.ts +1 -0
  66. package/dist/components/interaction/lists/AvList/AvList.stories.d.ts +55 -0
  67. package/dist/components/interaction/lists/AvList/AvList.stub.d.ts +5 -0
  68. package/dist/components/interaction/lists/AvList/AvList.test.d.ts +1 -0
  69. package/dist/components/interaction/lists/AvList/AvList.vue.d.ts +74 -0
  70. package/dist/components/interaction/lists/AvListItem/AvListItem.stories.d.ts +59 -0
  71. package/dist/components/interaction/lists/AvListItem/AvListItem.stub.d.ts +6 -0
  72. package/dist/components/interaction/lists/AvListItem/AvListItem.test.d.ts +1 -0
  73. package/dist/components/interaction/lists/AvListItem/AvListItem.vue.d.ts +112 -0
  74. package/dist/components/interaction/lists/index.d.ts +4 -0
  75. package/dist/components/interaction/pickers/AvPageSizePicker/AvPageSizePicker.stories.d.ts +24 -0
  76. package/dist/components/interaction/pickers/AvPageSizePicker/AvPageSizePicker.test.d.ts +1 -0
  77. package/dist/components/interaction/pickers/AvPageSizePicker/AvPageSizePicker.vue.d.ts +23 -0
  78. package/dist/components/interaction/pickers/AvTagPicker/AvTagPicker.stories.d.ts +96 -0
  79. package/dist/components/interaction/pickers/AvTagPicker/AvTagPicker.stub.d.ts +5 -0
  80. package/dist/components/interaction/pickers/AvTagPicker/AvTagPicker.test.d.ts +1 -0
  81. package/dist/components/interaction/pickers/AvTagPicker/AvTagPicker.vue.d.ts +79 -0
  82. package/dist/components/interaction/pickers/index.d.ts +3 -0
  83. package/dist/components/interaction/radios/AvRadioButton/AvRadioButton.stories.d.ts +34 -0
  84. package/dist/components/interaction/radios/AvRadioButton/AvRadioButton.test.d.ts +1 -0
  85. package/dist/components/interaction/radios/AvRadioButton/AvRadioButton.vue.d.ts +38 -0
  86. package/dist/components/interaction/radios/AvRadioButtonSet/AvRadioButtonSet.stories.d.ts +47 -0
  87. package/dist/components/interaction/radios/AvRadioButtonSet/AvRadioButtonSet.test.d.ts +1 -0
  88. package/dist/components/interaction/radios/AvRadioButtonSet/AvRadioButtonSet.vue.d.ts +76 -0
  89. package/dist/components/interaction/radios/index.d.ts +2 -0
  90. package/dist/components/interaction/selects/AvAutocomplete/AvAutocomplete.stories.d.ts +565 -0
  91. package/dist/components/interaction/selects/AvAutocomplete/AvAutocomplete.stub.d.ts +6 -0
  92. package/dist/components/interaction/selects/AvAutocomplete/AvAutocomplete.test.d.ts +1 -0
  93. package/dist/components/interaction/selects/AvAutocomplete/AvAutocomplete.types.d.ts +101 -0
  94. package/dist/components/interaction/selects/AvAutocomplete/AvAutocomplete.vue.d.ts +204 -0
  95. package/dist/components/interaction/selects/AvAutocomplete/AvAutocompleteContext.d.ts +14 -0
  96. package/dist/components/interaction/selects/AvAutocomplete/AvAutocompleteDropdown.vue.d.ts +60 -0
  97. package/dist/components/interaction/selects/AvAutocomplete/AvAutocompleteInput.vue.d.ts +585 -0
  98. package/dist/components/interaction/selects/AvAutocomplete/AvAutocompleteSelectedTags.vue.d.ts +42 -0
  99. package/dist/components/interaction/selects/AvMultiselect/AvMultiselect.stories.d.ts +132 -0
  100. package/dist/components/interaction/selects/AvMultiselect/AvMultiselect.test.d.ts +1 -0
  101. package/dist/components/interaction/selects/AvMultiselect/AvMultiselect.vue.d.ts +94 -0
  102. package/dist/components/interaction/selects/AvSelect/AvSelect.stories.d.ts +96 -0
  103. package/dist/components/interaction/selects/AvSelect/AvSelect.stub.d.ts +11 -0
  104. package/dist/components/interaction/selects/AvSelect/AvSelect.test.d.ts +1 -0
  105. package/dist/components/interaction/selects/AvSelect/AvSelect.vue.d.ts +63 -0
  106. package/dist/components/interaction/selects/index.d.ts +6 -0
  107. package/dist/components/interaction/tabs/AvTab/AvTab.stories.d.ts +34 -0
  108. package/dist/components/interaction/tabs/AvTab/AvTab.test.d.ts +1 -0
  109. package/dist/components/interaction/tabs/AvTab/AvTab.vue.d.ts +31 -0
  110. package/dist/components/interaction/tabs/AvTabs/AvTabs.stories.d.ts +45 -0
  111. package/dist/components/interaction/tabs/AvTabs/AvTabs.test.d.ts +1 -0
  112. package/dist/components/interaction/tabs/AvTabs/AvTabs.vue.d.ts +46 -0
  113. package/dist/components/interaction/tabs/index.d.ts +2 -0
  114. package/dist/components/interaction/toggles/AvToggle/AvToggle.stories.d.ts +21 -0
  115. package/dist/components/interaction/toggles/AvToggle/AvToggle.test.d.ts +1 -0
  116. package/dist/components/interaction/toggles/AvToggle/AvToggle.vue.d.ts +46 -0
  117. package/dist/components/interaction/toggles/index.d.ts +1 -0
  118. package/dist/components/navigation/AvNavigation/AvNavigation.stories.d.ts +27 -0
  119. package/dist/components/navigation/AvNavigation/AvNavigation.test.d.ts +1 -0
  120. package/dist/components/navigation/AvNavigation/AvNavigation.vue.d.ts +16 -0
  121. package/dist/components/navigation/AvNavigation/index.d.ts +1 -0
  122. package/dist/components/navigation/AvPagination/AvPagination.test.d.ts +1 -0
  123. package/dist/components/navigation/AvPagination/AvPagination.vue.d.ts +57 -0
  124. package/dist/components/navigation/AvPagination/utils.d.ts +14 -0
  125. package/dist/components/navigation/AvPagination/utils.test.d.ts +1 -0
  126. package/dist/components/navigation/AvSideMenu/AvSideMenu.stories.d.ts +55 -0
  127. package/dist/components/navigation/AvSideMenu/AvSideMenu.test.d.ts +1 -0
  128. package/dist/components/navigation/AvSideMenu/AvSideMenu.vue.d.ts +61 -0
  129. package/dist/components/navigation/AvSideNavigation/AvSideNavigation.stories.d.ts +59 -0
  130. package/dist/components/navigation/AvSideNavigation/AvSideNavigation.stub.d.ts +11 -0
  131. package/dist/components/navigation/AvSideNavigation/AvSideNavigation.test.d.ts +1 -0
  132. package/dist/components/navigation/AvSideNavigation/AvSideNavigation.vue.d.ts +42 -0
  133. package/dist/components/navigation/AvStepper/AvStepper.stories.d.ts +28 -0
  134. package/dist/components/navigation/AvStepper/AvStepper.stub.d.ts +14 -0
  135. package/dist/components/navigation/AvStepper/AvStepper.test.d.ts +1 -0
  136. package/dist/components/navigation/AvStepper/AvStepper.vue.d.ts +19 -0
  137. package/dist/components/navigation/index.d.ts +8 -0
  138. package/dist/components/overlay/drawers/AvDrawer/AvDrawer.stories.d.ts +53 -0
  139. package/dist/components/overlay/drawers/AvDrawer/AvDrawer.stub.d.ts +6 -0
  140. package/dist/components/overlay/drawers/AvDrawer/AvDrawer.test.d.ts +1 -0
  141. package/dist/components/overlay/drawers/AvDrawer/AvDrawer.vue.d.ts +60 -0
  142. package/dist/components/overlay/index.d.ts +4 -0
  143. package/dist/components/overlay/modals/AvModal/AvModal.test.d.ts +1 -0
  144. package/dist/components/overlay/modals/AvModal/AvModal.vue.d.ts +92 -0
  145. package/dist/components/overlay/popovers/AvPopover/AvPopover.stories.d.ts +49 -0
  146. package/dist/components/overlay/popovers/AvPopover/AvPopover.test.d.ts +1 -0
  147. package/dist/components/overlay/popovers/AvPopover/AvPopover.vue.d.ts +48 -0
  148. package/dist/components/overlay/popovers/AvPopover/use-popover.d.ts +41 -0
  149. package/dist/components/overlay/popovers/AvPopover/use-popover.test.d.ts +1 -0
  150. package/dist/composables/index.d.ts +3 -0
  151. package/dist/composables/use-av-breakpoints/use-av-breakpoints.d.ts +72 -0
  152. package/dist/composables/use-av-breakpoints/use-av-breakpoints.test.d.ts +1 -0
  153. package/dist/composables/use-focus-trap/use-focus-trap.d.ts +25 -0
  154. package/dist/composables/use-focus-trap/use-focus-trap.test.d.ts +1 -0
  155. package/dist/composables/use-global-background-color/use-global-background-color.d.ts +19 -0
  156. package/dist/composables/use-global-background-color/use-global-background-color.test.d.ts +1 -0
  157. package/dist/config/index.d.ts +1 -0
  158. package/dist/config/page-sizes.d.ts +6 -0
  159. package/dist/index.d.ts +7 -0
  160. package/dist/main.d.ts +8 -0
  161. package/dist/stories/foundations/icons.stories.d.ts +6 -0
  162. package/dist/stories/foundations/typography.stories.d.ts +5 -0
  163. package/dist/tests/index.d.ts +1 -0
  164. package/dist/tests/stubs.d.ts +41 -0
  165. package/dist/tests/utils.d.ts +30 -0
  166. package/dist/tokens/icons.d.ts +92 -0
  167. package/dist/tokens/index.d.ts +1 -0
  168. package/dist/utils/array/array.d.ts +8 -0
  169. package/dist/utils/forms/form.test.d.ts +1 -0
  170. package/dist/utils/forms/forms.d.ts +6 -0
  171. package/dist/utils/index.d.ts +3 -0
  172. package/dist/utils/string/string.d.ts +27 -0
  173. package/dist/utils/string/string.test.d.ts +1 -0
  174. package/package.json +3 -3
@@ -0,0 +1,92 @@
1
+ import type { Slot } from 'vue';
2
+ /**
3
+ * AvModal component props.
4
+ */
5
+ export interface AvModalProps {
6
+ /**
7
+ * Unique identifier for the modal.
8
+ * @default useRandomId('modal', 'dialog')
9
+ */
10
+ modalId?: string;
11
+ /**
12
+ * Indicates whether the modal is open.
13
+ * @default false
14
+ */
15
+ opened?: boolean;
16
+ /**
17
+ * Specifies whether the modal is an alert (role `"alertdialog"` if `true`) or not (role will be `"dialog"`).
18
+ * @default false
19
+ */
20
+ isAlert?: boolean;
21
+ /**
22
+ * Reference to original element to restore focus after closing.
23
+ * @default { focus() {} }
24
+ */
25
+ origin?: {
26
+ focus: () => void;
27
+ };
28
+ /**
29
+ * Name of icon to be displayed in modal title.
30
+ */
31
+ icon?: string;
32
+ /**
33
+ * Modal size.
34
+ * @default 'md'
35
+ */
36
+ size?: 'sm' | 'md' | 'lg' | 'xl';
37
+ /**
38
+ * Label and title (for accessibility) of the close button.
39
+ */
40
+ closeButtonLabel: string;
41
+ /**
42
+ * Icon name of the confirm button.
43
+ * @default 'mdi:close-circle-outline'
44
+ */
45
+ closeButtonIcon?: string;
46
+ /**
47
+ * Adds a disabled state on the close button.
48
+ */
49
+ closeButtonDisabled?: boolean;
50
+ /**
51
+ * Label and title (for accessibility) of the confirm button.
52
+ */
53
+ confirmButtonLabel?: string;
54
+ /**
55
+ * Icon name of the confirm button.
56
+ * @default 'mdi:check-circle-outline'
57
+ */
58
+ confirmButtonIcon?: string;
59
+ /**
60
+ * Adds a disabled state on the confirm button.
61
+ */
62
+ confirmButtonDisabled?: boolean;
63
+ /**
64
+ * Adds a loading state on the close button.
65
+ */
66
+ isLoading?: boolean;
67
+ }
68
+ /**
69
+ * Slots available in the component.
70
+ *
71
+ * @slot default - Default slot for modal content.
72
+ * @slot header - Slot for modal title.
73
+ * @slot footer - Slot for modal footer.
74
+ */
75
+ type __VLS_Slots = {
76
+ default?: Slot;
77
+ header?: Slot;
78
+ footer?: Slot;
79
+ };
80
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AvModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
81
+ close: () => any;
82
+ confirm: () => any;
83
+ }, string, import("vue").PublicProps, Readonly<AvModalProps> & Readonly<{
84
+ onClose?: (() => any) | undefined;
85
+ onConfirm?: (() => any) | undefined;
86
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
87
+ export default _default;
88
+ type __VLS_WithSlots<T, S> = T & {
89
+ new (): {
90
+ $slots: S;
91
+ };
92
+ };
@@ -0,0 +1,49 @@
1
+ import type { Meta, StoryFn } from '@storybook/vue3';
2
+ import { type AvPopoverProps } from '@/components/overlay/popovers/AvPopover/AvPopover.vue';
3
+ /**
4
+ * <h1 class="n1">Popovers - <code>AvPopover</code></h1>
5
+ *
6
+ * <h2 class="n2">✨ Introduction</h2>
7
+ *
8
+ * <p>
9
+ * <span class="b2-regular">
10
+ * The popover is a contextual container that is displayed as an overlay near its trigger element.
11
+ * This component can be used to display additional content or interactions, without leaving the current page or completely obscuring its context.
12
+ * </span>
13
+ * </p>
14
+ *
15
+ * <p>
16
+ * <span class="b2-regular">
17
+ * The <code>AvPopover</code> component is designed to offer accessible, ergonomic content,
18
+ * by trapping the focus inside the popover when it's open, and managing closure via the Escape key.
19
+ * It offers great flexibility via dedicated trigger (<code>trigger</code>) and content (<code>popover</code>) slots,
20
+ * allowing any content or interaction to be inserted.
21
+ * </span>
22
+ * </p>
23
+ *
24
+ * <p>
25
+ * <span class="b2-regular">
26
+ * It uses a dynamic positioning system to display itself in the right place in relation to its trigger,
27
+ * while guaranteeing good keyboard control and a good user experience.
28
+ * </span>
29
+ * </p>
30
+ *
31
+ * <h2 class="n2">🏗️ Structure</h2>
32
+ *
33
+ * <p><span class="b2-regular">The popover consists of the following elements:</span></p>
34
+ *
35
+ * <ul>
36
+ * <li><span class="b2-regular">The trigger (slot <code>trigger</code>), mandatory: Interactive element (for example, a button) that opens or closes the popover.</span></li>
37
+ * <li><span class="b2-regular">The content (slot <code>popover</code>), mandatory: Content area that can contain text, buttons, lists or any other interactive element. This zone is displayed close to the trigger and captures the focus when opened.</span></li>
38
+ * </ul>
39
+ *
40
+ * <p><span class="b2-regular">The popover integrates :</span></p>
41
+ *
42
+ * <ul>
43
+ * <li><span class="b2-regular">Focus trap for keyboard accessibility.</span></li>
44
+ * <li><span class="b2-regular">Close by pressing the Escape key or clicking outside the popover.</span></li>
45
+ * </ul>
46
+ */
47
+ declare const meta: Meta<AvPopoverProps>;
48
+ export default meta;
49
+ export declare const Default: StoryFn<AvPopoverProps>;
@@ -0,0 +1,48 @@
1
+ import { type ComponentPublicInstance } from 'vue';
2
+ /**
3
+ * AvPopover component props.
4
+ */
5
+ export interface AvPopoverProps {
6
+ /**
7
+ * Popover width.
8
+ * @default '12.5rem'
9
+ */
10
+ width?: string;
11
+ /**
12
+ * Internal popover padding.
13
+ * @default 'var(--spacing-md)'
14
+ */
15
+ padding?: string;
16
+ }
17
+ type __VLS_Slots = {
18
+ /**
19
+ * Slot for the popover trigger.
20
+ * Provides the prop:
21
+ * - toggle: function to open/close the popover
22
+ */
23
+ trigger: (props: {
24
+ toggle: () => void;
25
+ }) => void;
26
+ /**
27
+ * Slot for the popover content.
28
+ * Provides the prop:
29
+ * - close: function to close the popover
30
+ */
31
+ popover: (props: {
32
+ close: () => void;
33
+ }) => void;
34
+ };
35
+ declare function setTriggerRef(el: Element | ComponentPublicInstance | null): void;
36
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AvPopoverProps, {
37
+ setTriggerRef: typeof setTriggerRef;
38
+ triggerRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
39
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvPopoverProps> & Readonly<{}>, {
40
+ width: string;
41
+ padding: string;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
43
+ export default _default;
44
+ type __VLS_WithSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -0,0 +1,41 @@
1
+ import { type Ref } from 'vue';
2
+ /**
3
+ * Result returned by the usePopover composable.
4
+ */
5
+ export interface UsePopoverReturn {
6
+ /** Indicates whether the popover is visible */
7
+ showPopover: Ref<boolean>;
8
+ /** Position of the popover in rem */
9
+ popoverPosition: Ref<{
10
+ top: number;
11
+ left: number;
12
+ }>;
13
+ /** Function to open/close the popover */
14
+ togglePopover: () => Promise<void>;
15
+ /** Function to close the popover */
16
+ closePopover: () => void;
17
+ }
18
+ /**
19
+ * Vue composable to manage the display state and position of a popover.
20
+ *
21
+ * This function provides:
22
+ * - a reactive `showPopover` state indicating whether the popover is visible,
23
+ * - a `popoverPosition` object calculating the top/left position in REM,
24
+ * - a `togglePopover` function to open or close the popover,
25
+ * - a `closePopover` function to explicitly close the popover,
26
+ *
27
+ * It also ensures that the popover is closed when an outside click is detected.
28
+ *
29
+ * The popover position is calculated based on the trigger element position,
30
+ * taking into account the window width to prevent the popover from overflowing.
31
+ *
32
+ * @param {Ref<HTMLElement | null>} triggerRef Reference to the popover trigger element.
33
+ * @param {Ref<HTMLElement | null>} popoverRef Reference to the popover DOM element.
34
+ *
35
+ * @returns {UsePopoverReturn} Object containing:
36
+ * - `showPopover` (Ref<boolean>): Visible state of the popover,
37
+ * - `popoverPosition` (Ref<{ top: number, left: number }>): Position calculated in rem,
38
+ * - `togglePopover` (function): Function to toggle the popover display,
39
+ * - `closePopover` (function): Function to close the popover.
40
+ */
41
+ export declare function usePopover(triggerRef: Ref<HTMLElement | null>, popoverRef: Ref<HTMLElement | null>): UsePopoverReturn;
@@ -0,0 +1,3 @@
1
+ export * from './use-av-breakpoints/use-av-breakpoints';
2
+ export * from './use-focus-trap/use-focus-trap';
3
+ export * from './use-global-background-color/use-global-background-color';
@@ -0,0 +1,72 @@
1
+ import type { Ref } from 'vue';
2
+ /**
3
+ * Named viewport breakpoints for responsive behavior.
4
+ * These values are aligned with the DSFR / Avenirs design system.
5
+ */
6
+ export declare const AV_BREAKPOINTS: {
7
+ readonly sm: 576;
8
+ readonly md: 768;
9
+ readonly lg: 1024;
10
+ readonly xl: 1440;
11
+ };
12
+ /**
13
+ * Result returned by the `useAvBreakpoints` composable.
14
+ *
15
+ * Each property is a reactive reference (`Ref<boolean>`) that updates automatically
16
+ * when the viewport width changes. It provides both **granular breakpoint flags**
17
+ * (`isBelowSm`, `isAboveLg`, etc.) and **semantic viewport categories**
18
+ * (`isMobile`, `isTablet`, `isDesktop`).
19
+ */
20
+ export interface UseAvBreakpointsReturn {
21
+ /**
22
+ * True if the viewport width is considered mobile.
23
+ * Equivalent to `width < 768px (48rem)` (below md).
24
+ */
25
+ isMobile: Ref<boolean>;
26
+ /**
27
+ * True if the viewport width is considered tablet.
28
+ * Equivalent to `768px (48rem) <= width < 1024px (64rem)` (between md and lg).
29
+ */
30
+ isTablet: Ref<boolean>;
31
+ /**
32
+ * True if the viewport width is considered desktop.
33
+ * Equivalent to `width >= 1024px (64rem)` (lg and above).
34
+ */
35
+ isDesktop: Ref<boolean>;
36
+ /** True if viewport width is below 576px (36rem). */
37
+ isBelowSm: Ref<boolean>;
38
+ /** True if viewport width is below 768px (48rem). */
39
+ isBelowMd: Ref<boolean>;
40
+ /** True if viewport width is below 1024px (64rem). */
41
+ isBelowLg: Ref<boolean>;
42
+ /** True if viewport width is below 1440px (90rem). */
43
+ isBelowXl: Ref<boolean>;
44
+ /** True if viewport width is above or equal to 768px (48rem). */
45
+ isAboveMd: Ref<boolean>;
46
+ /** True if viewport width is above or equal to 1024px (64rem). */
47
+ isAboveLg: Ref<boolean>;
48
+ }
49
+ /**
50
+ * Vue composable providing reactive responsive utilities
51
+ * based on the current viewport width.
52
+ *
53
+ * It uses VueUse useBreakpoints with DSAV breakpoints:
54
+ * - sm: 576px (36rem),
55
+ * - md: 768px (48rem),
56
+ * - lg: 1024px (64rem),
57
+ * - xl: 1440px (90rem),
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * import { useAvBreakpoints } from '@avenirs-esr/avenirs-dsav'
62
+ *
63
+ * const { isMobile, isDesktop, isBelowMd, isAboveLg } = useAvBreakpoints()
64
+ * ```
65
+ *
66
+ * @returns {UseAvBreakpointsReturn} Object containing:
67
+ * - `isBelowSm|Md|Lg|Xl`: computed refs returning true if below a breakpoint
68
+ * - `isAboveMd|Lg`: computed refs returning true if above a breakpoint
69
+ *
70
+ * @see {@link https://vueuse.org/core/useBreakpoints/ useBreakpoints on VueUse}
71
+ */
72
+ export declare function useAvBreakpoints(): UseAvBreakpointsReturn;
@@ -0,0 +1,25 @@
1
+ import type { Ref } from 'vue';
2
+ /**
3
+ * Result returned by the useFocusTrap composable.
4
+ */
5
+ export interface UseFocusTrapReturn {
6
+ /** Initializes and activates the focus trap on the referenced element */
7
+ initializeFocusTrap: () => void;
8
+ /** Disables and cleans the focus trap */
9
+ cleanupFocusTrap: () => void;
10
+ }
11
+ /**
12
+ * Vue composable to manage a focus trap on a DOM element.
13
+ *
14
+ * This composable uses the [focus-trap](https://github.com/focus-trap/focus-trap) library
15
+ * to enclose keyboard navigation within a given element (e.g., a modal).
16
+ *
17
+ * @param elementRef Reference to the DOM element to trap (focus trap)
18
+ * @param onClose Callback function called when the focus trap is disabled (e.g., closing)
19
+ *
20
+ * @returns {UseFocusTrapReturn} Object containing the functions to manage the focus trap:
21
+ * - `initializeFocusTrap`: Enables the focus trap,
22
+ * - `cleanupFocusTrap`: Disables and cleans the focus trap.
23
+ *
24
+ */
25
+ export declare function useFocusTrap(elementRef: Ref<HTMLElement | null>, onClose: () => void): UseFocusTrapReturn;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Vue composable to dynamically update the global background color using a CSS variable.
3
+ *
4
+ * This composable sets the CSS custom property `--global-background-color`
5
+ * on the `#app`, `<html>` and `<body>` elements when the component is mounted,
6
+ * and automatically * resets it to its default value (`var(--default-global-background-color)`)
7
+ * when the component is unmounted.
8
+ *
9
+ * It allows you to control page-level background color transitions
10
+ * when navigating between views.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * useGlobalBackgroundColor('var(--my-color)') // sets the global background to 'var(--my-color)' while mounted
15
+ * ```
16
+ *
17
+ * @param {string} color - The background color value to apply (e.g., `'red'`, `'#f0f0f0'`, or `'var(--my-color)'`).
18
+ */
19
+ export declare function useGlobalBackgroundColor(color: string): void;
@@ -0,0 +1 @@
1
+ export * from './page-sizes';
@@ -0,0 +1,6 @@
1
+ export declare enum PageSizes {
2
+ FOUR = 4,
3
+ EIGHT = 8,
4
+ TWELVE = 12
5
+ }
6
+ export declare const pageSizeValues: readonly [PageSizes.FOUR, PageSizes.EIGHT, PageSizes.TWELVE];
@@ -0,0 +1,7 @@
1
+ import '@/styles/main.scss';
2
+ export * from './components/index';
3
+ export * from './composables';
4
+ export * from './config';
5
+ export * from './tests';
6
+ export * from './tokens';
7
+ export * from './utils';
package/dist/main.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import '@gouvfr/dsfr/dist/core/core.main.min.css';
2
+ import '@gouvfr/dsfr/dist/component/component.main.min.css';
3
+ import '@gouvfr/dsfr/dist/utility/utility.main.min.css';
4
+ import '@gouvminint/vue-dsfr/styles';
5
+ import '@gouvfr/dsfr/dist/scheme/scheme.min.css';
6
+ import '@gouvfr/dsfr/dist/utility/icons/icons.min.css';
7
+ import './main.css';
8
+ import '@/styles/main.scss';
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryFn } from '@storybook/vue3';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ export declare const AllIcons: StoryFn;
5
+ export declare const MdiIcons: StoryFn;
6
+ export declare const RiIcons: StoryFn;
@@ -0,0 +1,5 @@
1
+ import type { Meta, StoryFn } from '@storybook/vue3';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ export declare const Titles: StoryFn;
5
+ export declare const Texts: StoryFn;
@@ -0,0 +1 @@
1
+ export * from './stubs';
@@ -0,0 +1,41 @@
1
+ export declare const DsfrBadgeStub: {
2
+ name: string;
3
+ template: string;
4
+ props: string[];
5
+ };
6
+ export declare const DsfrModalStub: {
7
+ name: string;
8
+ props: string[];
9
+ template: string;
10
+ emits: string[];
11
+ methods: {
12
+ triggerEscape(this: {
13
+ $emit: (event: string, payload?: any) => void;
14
+ }): void;
15
+ };
16
+ };
17
+ export declare const DsfrNavigationStub: {
18
+ name: string;
19
+ props: {
20
+ navItems: {
21
+ (arrayLength: number): (import("@gouvminint/vue-dsfr").DsfrNavigationMenuLinkProps | import("@gouvminint/vue-dsfr").DsfrNavigationMenuProps | import("@gouvminint/vue-dsfr").DsfrNavigationMegaMenuProps)[][];
22
+ (...items: (import("@gouvminint/vue-dsfr").DsfrNavigationMenuLinkProps | import("@gouvminint/vue-dsfr").DsfrNavigationMenuProps | import("@gouvminint/vue-dsfr").DsfrNavigationMegaMenuProps)[][]): (import("@gouvminint/vue-dsfr").DsfrNavigationMenuLinkProps | import("@gouvminint/vue-dsfr").DsfrNavigationMenuProps | import("@gouvminint/vue-dsfr").DsfrNavigationMegaMenuProps)[][];
23
+ new (arrayLength: number): (import("@gouvminint/vue-dsfr").DsfrNavigationMenuLinkProps | import("@gouvminint/vue-dsfr").DsfrNavigationMenuProps | import("@gouvminint/vue-dsfr").DsfrNavigationMegaMenuProps)[][];
24
+ new (...items: (import("@gouvminint/vue-dsfr").DsfrNavigationMenuLinkProps | import("@gouvminint/vue-dsfr").DsfrNavigationMenuProps | import("@gouvminint/vue-dsfr").DsfrNavigationMegaMenuProps)[][]): (import("@gouvminint/vue-dsfr").DsfrNavigationMenuLinkProps | import("@gouvminint/vue-dsfr").DsfrNavigationMenuProps | import("@gouvminint/vue-dsfr").DsfrNavigationMegaMenuProps)[][];
25
+ isArray(arg: any): arg is any[];
26
+ readonly prototype: any[];
27
+ from<T>(arrayLike: ArrayLike<T>): T[];
28
+ from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
29
+ from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
30
+ from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
31
+ of<T_4>(...items: T_4[]): T_4[];
32
+ readonly [Symbol.species]: ArrayConstructor;
33
+ };
34
+ };
35
+ template: string;
36
+ };
37
+ export declare const VIconStub: {
38
+ name: string;
39
+ props: string[];
40
+ template: string;
41
+ };
@@ -0,0 +1,30 @@
1
+ import { type ComponentMountingOptions, type VueWrapper } from '@vue/test-utils';
2
+ import { type Component } from 'vue';
3
+ /**
4
+ * Function allowing developpers to use a common BDD format for tests
5
+ * @returns given (describe), when (describe) and then (it)
6
+ */
7
+ export declare function BddTest(): {
8
+ given(description: string, fn: () => void): any;
9
+ when(description: string, fn: () => void): any;
10
+ and(description: string, fn: () => void): any;
11
+ then(description: string, fn: () => void): any;
12
+ };
13
+ declare function mountComposable<T>(fn: () => T): {
14
+ result: T;
15
+ unmount: () => void;
16
+ };
17
+ /**
18
+ * Mounts a Vue component with a mock router for testing.
19
+ *
20
+ * This function uses Vue Test Utils to mount the component by injecting
21
+ * stubs for `RouterLink` and `RouterView` to simulate the router behavior
22
+ * without launching a real instance.
23
+ *
24
+ * @template T
25
+ * @param {Component} component - Vue component to mount.
26
+ * @param {ComponentMountingOptions<T>} [options] - Additional options for mounting the component.
27
+ * @returns {Promise<VueWrapper<InstanceType<any>>>} the function return any as type because ts type is too complicated.
28
+ */
29
+ declare function mountWithRouter<T>(component: Component, options?: ComponentMountingOptions<T>): Promise<VueWrapper<InstanceType<any>>>;
30
+ export { mountComposable, mountWithRouter, };
@@ -0,0 +1,92 @@
1
+ export declare const MDI_ICONS: {
2
+ ACCOUNT_CIRCLE_OUTLINE: string;
3
+ ACCOUNT_STUDENT_OUTLINE: string;
4
+ ALERT_CIRCLE_OUTLINE: string;
5
+ ALERT_OUTLINE: string;
6
+ ARROW_DECISION: string;
7
+ ARROW_LEFT_THIN: string;
8
+ ARROW_RIGHT: string;
9
+ ARROW_RIGHT_THIN: string;
10
+ ARROW_TOP_RIGHT_THICK: string;
11
+ ATTACH_FILE: string;
12
+ ATTACHMENT_PLUS: string;
13
+ BELL_NOTIFICATION: string;
14
+ BOOK_LOCATION_OUTLINE: string;
15
+ BRIEFCASE_VARIANT_OUTLINE: string;
16
+ CALENDAR_MONTH_OUTLINE: string;
17
+ CHART_TIMELINE_VARIANT_SHIMMER: string;
18
+ CHAT_ALERT: string;
19
+ CHAT_BUBBLE_OUTLINE: string;
20
+ CHECK: string;
21
+ CHECK_CIRCLE: string;
22
+ CHECK_CIRCLE_OUTLINE: string;
23
+ CHECKBOX_BLANK_OUTLINE: string;
24
+ CHECKBOX_MARKED: string;
25
+ CHEVRON_DOUBLE_LEFT: string;
26
+ CHEVRON_DOUBLE_RIGHT: string;
27
+ CLOSE_CIRCLE_OUTLINE: string;
28
+ CONTENT_SAVE_OUTLINE: string;
29
+ DOTS_VERTICAL: string;
30
+ ELECTRON_FRAMEWORK: string;
31
+ FAMILY: string;
32
+ FILE: string;
33
+ FILE_ACCOUNT_OUTLINE: string;
34
+ FILE_DOCUMENT_BOX_MULTIPLE_OUTLINE: string;
35
+ FILE_DOCUMENT_EDIT_OUTLINE: string;
36
+ FILE_DOCUMENT_MULTIPLE_OUTLINE: string;
37
+ FILE_IMAGE_OUTLINE: string;
38
+ FILE_TREE_OUTLINE: string;
39
+ FLAG_VARIANT: string;
40
+ FORMAT_LIST_BULLETED: string;
41
+ HOME_VARIANT_OUTLINE: string;
42
+ HOURGLASS: string;
43
+ IMAGE_FILTER_CENTER_FOCUS_WEAK: string;
44
+ IMAGE_OUTLINE: string;
45
+ INFORMATION_OUTLINE: string;
46
+ LINK: string;
47
+ LOADING_OUTLINE: string;
48
+ LOGOUT: string;
49
+ NAVIGATE_BEFORE: string;
50
+ NAVIGATE_NEXT: string;
51
+ NOTEBOOK_CHECK: string;
52
+ NOTIFICATIONS_NONE: string;
53
+ PAGE_FIRST: string;
54
+ PAGE_LAST: string;
55
+ PENCIL_OUTLINE: string;
56
+ PEOPLE_GROUP_OUTLINE: string;
57
+ PLUS_CIRCLE_OUTLINE: string;
58
+ POST_IT_NOTES_OUTLINE: string;
59
+ RECORD_CIRCLE_OUTLINE: string;
60
+ SCHOOL_OUTLINE: string;
61
+ SHARE_VARIANT_OUTLINE: string;
62
+ STAR_CHECK_OUTLINE: string;
63
+ STAR_SHOOTING_OUTLINE: string;
64
+ STARS: string;
65
+ SWAP_HORIZONTAL: string;
66
+ SWAP_VERTICAL_VARIANT: string;
67
+ TARGET_ARROW: string;
68
+ TEST_TUBE_EMPTY: string;
69
+ TRASH_CAN_OUTLINE: string;
70
+ TRAY_UPLOAD: string;
71
+ VECTOR_POLYGON_VARIANT: string;
72
+ WARNING_OUTLINE: string;
73
+ };
74
+ export declare const RI_ICONS: {
75
+ DICE_1_LINE: string;
76
+ DICE_4_LINE: string;
77
+ };
78
+ /**
79
+ * contains icon as base64 to be used in img src or also for components that need iconPath
80
+ * Useful for icons that are in MDI but we cannot use them using icon name, so we can use them
81
+ * without creating svg files in assets/icons, also simple to use (no need for basePath ...)
82
+ * e.g. using mdi icons with AvBadge
83
+ */
84
+ export declare const ICONS_DATA_URL: {
85
+ AMS_SAE: string;
86
+ CLOCK_ALMOST_CHECK: string;
87
+ CLOCK_HALF_PLUS_CHECK: string;
88
+ CLOCK_QUARTER_CHECK: string;
89
+ CLOCK_THIRD_CHECK: string;
90
+ FILE_DOCUMENT_MULTIPLE_OUTLINE: string;
91
+ MDI_CHECK_CIRCLE: string;
92
+ };
@@ -0,0 +1 @@
1
+ export * from './icons';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Removes duplicates from an array and returns a new array containing only unique elements.
3
+ *
4
+ * @template T - The type of the elements in the array.
5
+ * @param {T[]} array - The array that can contain duplicates.
6
+ * @returns {T[]} A new array containing only the unique elements of the original array, in the order they appear.
7
+ */
8
+ export declare function removeDuplicates<T>(array: T[]): T[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns the email validation status
3
+ * @param email
4
+ * @returns email is valid (true) or invalid (false)
5
+ */
6
+ export declare function isValidEmail(email: string): boolean;
@@ -0,0 +1,3 @@
1
+ export * from './array/array';
2
+ export * from './forms/forms';
3
+ export * from './string/string';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Formats a string by applying structured HTML transformations based on specific patterns:
3
+ *
4
+ * - Text between `**...**` is underlined using a `<span class="text-underline">`.
5
+ * - Text between `##...##` is colored and bold using a `<strong style="color: ...">`.
6
+ * - Text within `(-...)` is converted to `<li>` items with an indentation class.
7
+ * - Line breaks (`\n`, `\r`, `\\n`, etc.) are converted to `<div class="line-break"></div>`
8
+ * for visual spacing (e.g., adjustable height via CSS).
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * formatTextToHtml('(-##Important## and **underlined**)\nNext line')
13
+ * // Returns:
14
+ * // '<li class="indented-list"><strong style="color: var(--dark-background-primary1)">Important</strong> and <span class="text-underline">underlined</span></li><div class="line-break"></div>Next line'
15
+ * ```
16
+ *
17
+ * @param {string} text - The raw input string that may contain styling markers like `**`, `##`, or `(-...)`.
18
+ * @param {string} color - The color applied to text wrapped in `**` and '###'. Defaults to 'var(--dark-background-primary1)'.
19
+ * @returns {string} A string of HTML with appropriate tags for styling and structure.
20
+ */
21
+ export declare function formatTextToHtml(text: string, color?: string): string;
22
+ /**
23
+ *
24
+ * @param text the text to format to sentence case
25
+ * @returns the text formatted to sentence case
26
+ */
27
+ export declare function toSentenceCase(text: string): string;
@@ -0,0 +1 @@
1
+ export {};