@avenirs-esr/avenirs-dsav 0.1.56 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avenirs-dsav.css +2 -2
- package/dist/components/badges/AvTag/AvTag.stub.d.ts +4 -4
- package/dist/components/badges/AvTag/AvTag.vue.d.ts +11 -7
- package/dist/components/base/AvFieldset/AvFieldset.stub.d.ts +13 -0
- package/dist/components/base/AvFieldset/AvFieldset.test.d.ts +1 -0
- package/dist/components/base/AvFieldset/AvFieldset.vue.d.ts +64 -0
- package/dist/components/base/AvIcon/AvIcon.stories.d.ts +47 -0
- package/dist/components/base/{AvVIcon/AvVIcon.stub.d.ts → AvIcon/AvIcon.stub.d.ts} +5 -1
- package/dist/components/base/AvIcon/AvIcon.test.d.ts +1 -0
- package/dist/components/base/{AvVIcon/AvVIcon.vue.d.ts → AvIcon/AvIcon.vue.d.ts} +9 -15
- package/dist/components/base/AvIconText/AvIconText.stories.d.ts +1 -1
- package/dist/components/base/index.d.ts +2 -1
- package/dist/components/feedback/AvAlert/AvAlert.vue.d.ts +1 -1
- package/dist/components/header/AvHeader/AvHeader.stories.d.ts +28 -0
- package/dist/components/header/AvHeader/AvHeader.vue.d.ts +12 -26
- package/dist/components/header/AvHeader/injection-key.d.ts +4 -0
- package/dist/components/header/AvHeaderMenuLinks/AvHeaderMenuLinks.vue.d.ts +3 -4
- package/dist/components/interaction/accordions/AvAccordion/AvAccordion.stories.d.ts +13 -16
- package/dist/components/interaction/accordions/AvAccordion/AvAccordion.stub.d.ts +10 -0
- package/dist/components/interaction/accordions/AvAccordion/AvAccordion.vue.d.ts +5 -0
- package/dist/components/interaction/accordions/AvAccordionsGroup/AvAccordionsGroup.stories.d.ts +5 -12
- package/dist/components/interaction/accordions/AvAccordionsGroup/AvAccordionsGroup.vue.d.ts +5 -9
- package/dist/components/interaction/accordions/injection-key.d.ts +7 -0
- package/dist/components/interaction/buttons/AvButton/AvButton.stub.d.ts +2 -0
- package/dist/components/interaction/buttons/AvButton/AvButton.vue.d.ts +6 -14
- package/dist/components/interaction/buttons/AvLanguageSelector/AvLanguageSelector.stories.d.ts +26 -0
- package/dist/components/interaction/buttons/AvLanguageSelector/AvLanguageSelector.test.d.ts +1 -0
- package/dist/components/interaction/buttons/AvLanguageSelector/AvLanguageSelector.vue.d.ts +38 -0
- package/dist/components/interaction/buttons/index.d.ts +1 -0
- package/dist/components/interaction/checkboxes/AvCheckbox/AvChecbox.stories.d.ts +36 -0
- package/dist/components/interaction/checkboxes/AvCheckbox/AvCheckbox.stub.d.ts +49 -0
- package/dist/components/interaction/checkboxes/AvCheckbox/AvCheckbox.test.d.ts +1 -0
- package/dist/components/interaction/checkboxes/AvCheckbox/AvCheckbox.vue.d.ts +71 -0
- package/dist/components/interaction/checkboxes/index.d.ts +1 -0
- package/dist/components/interaction/files/AvFileUpload/AvFileUpload.vue.d.ts +1 -1
- package/dist/components/interaction/index.d.ts +1 -0
- package/dist/components/interaction/inputs/AvInput/AvInput.stories.d.ts +7 -7
- package/dist/components/interaction/inputs/AvInput/AvInput.vue.d.ts +18 -9
- package/dist/components/interaction/inputs/AvSearchBar/AvSearchBar.stories.d.ts +27 -0
- package/dist/components/interaction/inputs/AvSearchBar/AvSearchBar.test.d.ts +1 -0
- package/dist/components/interaction/inputs/AvSearchBar/AvSearchBar.vue.d.ts +35 -0
- package/dist/components/interaction/inputs/index.d.ts +1 -0
- package/dist/components/interaction/lists/AvListItem/AvListItem.stub.d.ts +2 -2
- package/dist/components/interaction/radios/AvRadioButtonSet/AvRadioButtonSet.vue.d.ts +10 -0
- package/dist/components/interaction/radios/AvRadioButtonSet/components/RadioButton.vue.d.ts +50 -0
- package/dist/components/interaction/selects/AvAutocomplete/AvAutocomplete.stories.d.ts +13 -13
- package/dist/components/interaction/selects/AvAutocomplete/AvAutocomplete.stub.d.ts +1 -1
- package/dist/components/interaction/selects/AvAutocomplete/AvAutocomplete.vue.d.ts +7 -7
- package/dist/components/interaction/selects/AvAutocomplete/AvAutocompleteContext.d.ts +1 -1
- package/dist/components/interaction/selects/AvAutocomplete/AvAutocompleteDropdown.vue.d.ts +2 -2
- package/dist/components/interaction/selects/AvAutocomplete/AvAutocompleteInput.vue.d.ts +63 -117
- package/dist/components/interaction/selects/AvAutocomplete/AvAutocompleteSelectedTags.vue.d.ts +3 -3
- package/dist/components/interaction/selects/AvMultiselect/AvMultiselect.stories.d.ts +6 -4
- package/dist/components/interaction/selects/AvMultiselect/AvMultiselect.types.d.ts +17 -0
- package/dist/components/interaction/selects/AvMultiselect/AvMultiselect.vue.d.ts +34 -27
- package/dist/components/interaction/selects/AvMultiselect/components/MultiselectCollapse.test.d.ts +1 -0
- package/dist/components/interaction/selects/AvMultiselect/components/MultiselectCollapse.vue.d.ts +39 -0
- package/dist/components/interaction/selects/index.d.ts +2 -1
- package/dist/components/interaction/toggles/AvToggle/AvToggle.stories.d.ts +2 -0
- package/dist/components/interaction/toggles/AvToggle/AvToggle.stub.d.ts +4 -4
- package/dist/components/navigation/AvBreadcrumb/AvBreadcrumb.stories.d.ts +2 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/use-collapsable/use-collapsable.d.ts +101 -0
- package/dist/composables/use-collapsable/use-collapsable.test.d.ts +1 -0
- package/dist/index.cjs.js +8 -8
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +6601 -6834
- package/dist/injection-key.cjs.js +1 -0
- package/dist/injection-key.es.js +4 -0
- package/dist/test-utils.cjs.js +39 -12
- package/dist/test-utils.es.js +105 -44
- package/dist/tests/index.d.ts +5 -2
- package/dist/tests/stubs.d.ts +0 -43
- package/package.json +2 -1
- package/dist/components/base/AvVIcon/AvVIcon.stories.d.ts +0 -40
- package/dist/types/index.d.ts +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type AvIcon from '@/components/base/AvIcon/AvIcon.vue';
|
|
2
2
|
/**
|
|
3
|
-
* AvButton component
|
|
3
|
+
* AvButton component
|
|
4
4
|
*/
|
|
5
5
|
export interface AvButtonProps {
|
|
6
6
|
/**
|
|
@@ -56,23 +56,15 @@ export interface AvButtonProps {
|
|
|
56
56
|
/**
|
|
57
57
|
* Icon to be displayed in the button. Can be a name or an icon configuration (eg: `{"name": "mdi:stars"}`).
|
|
58
58
|
*/
|
|
59
|
-
icon?: string | InstanceType<typeof
|
|
59
|
+
icon?: string | InstanceType<typeof AvIcon>['$props'];
|
|
60
60
|
/**
|
|
61
61
|
* Function called when button is clicked.
|
|
62
62
|
* @param event The click MouseEvent
|
|
63
63
|
*/
|
|
64
64
|
onClick?: ($event: MouseEvent) => void;
|
|
65
65
|
}
|
|
66
|
+
declare function focus(): void;
|
|
66
67
|
declare const _default: import("vue").DefineComponent<AvButtonProps, {
|
|
67
|
-
|
|
68
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvButtonProps> & Readonly<{}>, {
|
|
69
|
-
size: "" | "small" | "sm" | "lg" | "large" | "md" | "medium";
|
|
70
|
-
variant: "DEFAULT" | "OUTLINED" | "FLAT";
|
|
71
|
-
theme: "PRIMARY" | "SECONDARY";
|
|
72
|
-
isLoading: boolean;
|
|
73
|
-
noRadius: boolean;
|
|
74
|
-
disabled: boolean;
|
|
75
|
-
iconRight: boolean;
|
|
76
|
-
iconOnly: boolean;
|
|
77
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
68
|
+
focus: typeof focus;
|
|
69
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
78
70
|
export default _default;
|
package/dist/components/interaction/buttons/AvLanguageSelector/AvLanguageSelector.stories.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
import { type AvLanguageSelectorProps } from '@/components/interaction/buttons/AvLanguageSelector/AvLanguageSelector.vue';
|
|
3
|
+
/**
|
|
4
|
+
* <h2 class="n2">✨ Introduction</h2>
|
|
5
|
+
*
|
|
6
|
+
* <p>
|
|
7
|
+
* <span class="b2-regular">
|
|
8
|
+
* The <code>AvLanguageSelector</code> allows users to choose the language in which the site content is displayed, if it is available in several languages.
|
|
9
|
+
* It takes the form of a button that opens a drop-down list.
|
|
10
|
+
* </span>
|
|
11
|
+
* </p>
|
|
12
|
+
*
|
|
13
|
+
* <h2 class="n2">🏗️ Structure</h2>
|
|
14
|
+
*
|
|
15
|
+
* <p>
|
|
16
|
+
* <span class="b2-regular">The language selector is composed by:</span>
|
|
17
|
+
* </p>
|
|
18
|
+
*
|
|
19
|
+
* <ul>
|
|
20
|
+
* <li><span class="b2-regular">a button that opens or closes a drop-down menu of languages</span></li>
|
|
21
|
+
* <li><span class="b2-regular">a drop-down menu of available languages</span></li>
|
|
22
|
+
* </ul>
|
|
23
|
+
*/
|
|
24
|
+
declare const meta: Meta<AvLanguageSelectorProps>;
|
|
25
|
+
export default meta;
|
|
26
|
+
export declare const Default: StoryFn<AvLanguageSelectorProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface of a language selector dropdown element
|
|
3
|
+
*/
|
|
4
|
+
export interface AvLanguageSelectorElement {
|
|
5
|
+
codeIso: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* AvLanguageSelector component props
|
|
10
|
+
*/
|
|
11
|
+
export interface AvLanguageSelectorProps {
|
|
12
|
+
/**
|
|
13
|
+
* Unique id for accessibility
|
|
14
|
+
* @default crypto.randomUUID()
|
|
15
|
+
*/
|
|
16
|
+
id?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Available languages list.
|
|
19
|
+
* Each language is represented by an object containing a `codeIso` and a `label`
|
|
20
|
+
*/
|
|
21
|
+
languages: AvLanguageSelectorElement[];
|
|
22
|
+
/**
|
|
23
|
+
* ISO code of the current selected language
|
|
24
|
+
* @default 'fr'
|
|
25
|
+
*/
|
|
26
|
+
currentLanguage?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Title attribute for accessibility
|
|
29
|
+
* @default 'Sélectionner une langue'
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
}
|
|
33
|
+
declare const _default: import("vue").DefineComponent<AvLanguageSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
34
|
+
select: (payload: AvLanguageSelectorElement) => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<AvLanguageSelectorProps> & Readonly<{
|
|
36
|
+
onSelect?: ((payload: AvLanguageSelectorElement) => any) | undefined;
|
|
37
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as AvButton, type AvButtonProps } from './AvButton/AvButton.vue';
|
|
2
2
|
export { default as AvCancelConfirmButtons } from './AvCancelConfirmButtons/AvCancelConfirmButtons.vue';
|
|
3
|
+
export { default as AvLanguageSelector, type AvLanguageSelectorElement, type AvLanguageSelectorProps } from './AvLanguageSelector/AvLanguageSelector.vue';
|
|
3
4
|
export { default as AvRichButton } from './AvRichButton/AvRichButton.vue';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
import { type AvCheckboxProps } from '@/components/interaction/checkboxes/AvCheckbox/AvCheckbox.vue';
|
|
3
|
+
/**
|
|
4
|
+
* <h2 class="n2">✨ Introduction</h2>
|
|
5
|
+
*
|
|
6
|
+
* <p class="b2-regular">
|
|
7
|
+
* The <code>AvCheckbox</code> allows the user to select one or more options from a list.
|
|
8
|
+
* They are used to make multiple selections (from 0 to N items) or to allow a binary choice,
|
|
9
|
+
* where the user can select or deselect a single option.
|
|
10
|
+
* </p>
|
|
11
|
+
*
|
|
12
|
+
* <p class="b2-regular">
|
|
13
|
+
* Checkboxes can be used alone or in a list. Avoid lists with more than 5 items, and when you want to restrict
|
|
14
|
+
* the choice to a single item, use radio buttons (see <code>AvRadioButton</code>).
|
|
15
|
+
* </p>
|
|
16
|
+
*
|
|
17
|
+
* <h2 class="n2">🏗️ Structure</h2>
|
|
18
|
+
*
|
|
19
|
+
* <ul class="b2-regular">
|
|
20
|
+
* <li>a checkbox <code><input type="checkbox"></code></li>
|
|
21
|
+
* <li>a label associated with the checkbox, defined by the <code>label</code> prop</li>
|
|
22
|
+
* <li>an information, error (<code>errorMessage</code> prop), or validation (<code>validMessage</code> prop) message, displayed below the checkbox</li>
|
|
23
|
+
* </ul>
|
|
24
|
+
*/
|
|
25
|
+
declare const meta: Meta<AvCheckboxProps>;
|
|
26
|
+
export default meta;
|
|
27
|
+
export declare const Default: StoryFn<AvCheckboxProps>;
|
|
28
|
+
export declare const WithIcon: StoryFn<AvCheckboxProps>;
|
|
29
|
+
export declare const Required: StoryFn<AvCheckboxProps>;
|
|
30
|
+
export declare const Disabled: StoryFn<AvCheckboxProps>;
|
|
31
|
+
export declare const Error: StoryFn<AvCheckboxProps>;
|
|
32
|
+
export declare const Valid: StoryFn<AvCheckboxProps>;
|
|
33
|
+
export declare const Hint: StoryFn<AvCheckboxProps>;
|
|
34
|
+
export declare const Small: StoryFn<AvCheckboxProps>;
|
|
35
|
+
export declare const SmallWithIcon: StoryFn<AvCheckboxProps>;
|
|
36
|
+
export declare const SmallRequired: StoryFn<AvCheckboxProps>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const AvCheckboxStub: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
id: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
name: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
value: {
|
|
11
|
+
type: (BooleanConstructor | NumberConstructor | StringConstructor)[];
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: ArrayConstructor;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
label: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
id: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
name: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
value: {
|
|
32
|
+
type: (BooleanConstructor | NumberConstructor | StringConstructor)[];
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
modelValue: {
|
|
36
|
+
type: ArrayConstructor;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
label: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
}>> & Readonly<{
|
|
44
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
45
|
+
}>, {
|
|
46
|
+
label: string;
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvCheckbox component props
|
|
3
|
+
*/
|
|
4
|
+
export interface AvCheckboxProps {
|
|
5
|
+
/**
|
|
6
|
+
* Unique ID of the component
|
|
7
|
+
* @default `checkbox-${crypto.randomUUID()}`
|
|
8
|
+
*/
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Custom icon to add between the checkbox and the label (Iconify naming convention)
|
|
12
|
+
*/
|
|
13
|
+
icon?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Name of the field `<input>`
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* Indicates if the checkbox is mandatory
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
required?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Value associated to the checkbox
|
|
25
|
+
*/
|
|
26
|
+
value: string | number | boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Displays the checkbox in its small version
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
small?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Displays the chekbox in its inline version
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
inline?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Simulates a disabled state to make the checkbox as disabled
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Label to be displayed next to the checkbox
|
|
44
|
+
*/
|
|
45
|
+
label: string;
|
|
46
|
+
/**
|
|
47
|
+
* Error message to be displayed under the checkbox
|
|
48
|
+
* @default ''
|
|
49
|
+
*/
|
|
50
|
+
errorMessage?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Valid message to be displayed under the checkbox
|
|
53
|
+
* @default ''
|
|
54
|
+
*/
|
|
55
|
+
validMessage?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Hint to be displayed under the checkbox
|
|
58
|
+
* @default ''
|
|
59
|
+
*/
|
|
60
|
+
hint?: string;
|
|
61
|
+
}
|
|
62
|
+
type __VLS_Props = AvCheckboxProps;
|
|
63
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
64
|
+
modelValue: (string | number | boolean | undefined)[];
|
|
65
|
+
};
|
|
66
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
67
|
+
"update:modelValue": (value: (string | number | boolean | undefined)[]) => any;
|
|
68
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
69
|
+
"onUpdate:modelValue"?: ((value: (string | number | boolean | undefined)[]) => any) | undefined;
|
|
70
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
71
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AvCheckbox, type AvCheckboxProps } from './AvCheckbox/AvCheckbox.vue';
|
|
@@ -20,13 +20,13 @@ import { type AvInputProps } from '@/components/interaction/inputs/AvInput/AvInp
|
|
|
20
20
|
*
|
|
21
21
|
* <p><span class="b2-regular">The input component consists of the following elements:</span></p>
|
|
22
22
|
* <ul>
|
|
23
|
-
* <li><span class="b2-regular"
|
|
24
|
-
* <li><span class="b2-regular"
|
|
25
|
-
* <li><span class="b2-regular"
|
|
26
|
-
* <li><span class="b2-regular"
|
|
27
|
-
* <li><span class="b2-regular"
|
|
28
|
-
* <li><span class="b2-regular"
|
|
29
|
-
* <li><span class="b2-regular"
|
|
23
|
+
* <li><span class="b2-regular">a <strong>Wrapper</strong>: Container that manages the overall layout and positioning</span></li>
|
|
24
|
+
* <li><span class="b2-regular">a <strong>Prefix Icon</strong> (optional): Visual icon positioned at the beginning of the input field</span></li>
|
|
25
|
+
* <li><span class="b2-regular">a <strong>Input Field</strong>: The main input element (can be rendered as input or textarea)</span></li>
|
|
26
|
+
* <li><span class="b2-regular">a <strong>Label</strong>: Descriptive text for the input field</span></li>
|
|
27
|
+
* <li><span class="b2-regular">a <strong>Hint</strong>: Optional helper text displayed below the label</span></li>
|
|
28
|
+
* <li><span class="b2-regular">optional <strong>Error Messages</strong>: Validation error messages displayed when validation fails</span></li>
|
|
29
|
+
* <li><span class="b2-regular">optional <strong>Success Messages</strong>: Validation success messages displayed when validation passes</span></li>
|
|
30
30
|
* </ul>
|
|
31
31
|
*
|
|
32
32
|
* <p>
|
|
@@ -2,6 +2,7 @@ import type { Slot } from 'vue';
|
|
|
2
2
|
export interface AvInputProps {
|
|
3
3
|
/**
|
|
4
4
|
* ID of the input element
|
|
5
|
+
* @default `av-input-${crypto.randomUUID()}`
|
|
5
6
|
*/
|
|
6
7
|
id?: string;
|
|
7
8
|
/**
|
|
@@ -14,10 +15,12 @@ export interface AvInputProps {
|
|
|
14
15
|
hint?: string;
|
|
15
16
|
/**
|
|
16
17
|
* Validation state - valid
|
|
18
|
+
* @default false
|
|
17
19
|
*/
|
|
18
20
|
isValid?: boolean;
|
|
19
21
|
/**
|
|
20
22
|
* Render as textarea instead of input
|
|
23
|
+
* @default false
|
|
21
24
|
*/
|
|
22
25
|
isTextarea?: boolean;
|
|
23
26
|
/**
|
|
@@ -26,14 +29,17 @@ export interface AvInputProps {
|
|
|
26
29
|
labelVisible?: boolean;
|
|
27
30
|
/**
|
|
28
31
|
* Label text
|
|
32
|
+
* @default ''
|
|
29
33
|
*/
|
|
30
34
|
label?: string;
|
|
31
35
|
/**
|
|
32
36
|
* CSS class for the label
|
|
37
|
+
* @default 'b2-light'
|
|
33
38
|
*/
|
|
34
39
|
labelClass?: string;
|
|
35
40
|
/**
|
|
36
41
|
* Model value for v-model
|
|
42
|
+
* @default ''
|
|
37
43
|
*/
|
|
38
44
|
modelValue?: string | number | null;
|
|
39
45
|
/**
|
|
@@ -42,6 +48,7 @@ export interface AvInputProps {
|
|
|
42
48
|
placeholder?: string;
|
|
43
49
|
/**
|
|
44
50
|
* Input type (text, email, password, etc.)
|
|
51
|
+
* @default 'text'
|
|
45
52
|
*/
|
|
46
53
|
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'datetime-local' | 'month' | 'time' | 'week' | 'color' | 'file' | 'hidden' | 'range';
|
|
47
54
|
/**
|
|
@@ -54,10 +61,12 @@ export interface AvInputProps {
|
|
|
54
61
|
maxDate?: Date;
|
|
55
62
|
/**
|
|
56
63
|
* Whether the input is disabled
|
|
64
|
+
* @default false
|
|
57
65
|
*/
|
|
58
66
|
disabled?: boolean;
|
|
59
67
|
/**
|
|
60
68
|
* Whether the input is required
|
|
69
|
+
* @default false
|
|
61
70
|
*/
|
|
62
71
|
required?: boolean;
|
|
63
72
|
/**
|
|
@@ -84,6 +93,11 @@ export interface AvInputProps {
|
|
|
84
93
|
* Width of the input
|
|
85
94
|
*/
|
|
86
95
|
width?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Removes radii from the input border.
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
noRadius?: boolean;
|
|
87
101
|
}
|
|
88
102
|
/**
|
|
89
103
|
* Slots available for the component.
|
|
@@ -103,18 +117,13 @@ type __VLS_Slots = {
|
|
|
103
117
|
maxlength?: number;
|
|
104
118
|
}>;
|
|
105
119
|
};
|
|
106
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AvInputProps, {
|
|
120
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AvInputProps, {
|
|
121
|
+
focus: () => void | undefined;
|
|
122
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
107
123
|
"update:modelValue": (value: string | number | null) => any;
|
|
108
124
|
}, string, import("vue").PublicProps, Readonly<AvInputProps> & Readonly<{
|
|
109
125
|
"onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
|
|
110
|
-
}>, {
|
|
111
|
-
type: "number" | "time" | "text" | "color" | "search" | "email" | "password" | "tel" | "url" | "date" | "datetime-local" | "month" | "week" | "file" | "hidden" | "range";
|
|
112
|
-
disabled: boolean;
|
|
113
|
-
required: boolean;
|
|
114
|
-
isValid: boolean;
|
|
115
|
-
isTextarea: boolean;
|
|
116
|
-
labelVisible: boolean;
|
|
117
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
126
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
118
127
|
export default _default;
|
|
119
128
|
type __VLS_WithSlots<T, S> = T & {
|
|
120
129
|
new (): {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
import { type AvSearchBarProps } from '@/components/interaction/inputs/AvSearchBar/AvSearchBar.vue';
|
|
3
|
+
/**
|
|
4
|
+
* <h2 class="n2">✨ Introduction</h2>
|
|
5
|
+
*
|
|
6
|
+
* <p>
|
|
7
|
+
* <span class="b2-regular">
|
|
8
|
+
* The <code>AvSearchBar</code> is a navigation system that allows users
|
|
9
|
+
* to quickly access content by searching for a keyword or phrase.
|
|
10
|
+
* </span>
|
|
11
|
+
* </p>
|
|
12
|
+
*
|
|
13
|
+
* <h2 class="n2">🏗️ Structure</h2>
|
|
14
|
+
*
|
|
15
|
+
* <p>
|
|
16
|
+
* <span class="b2-regular">The search bar is composed by:</span>
|
|
17
|
+
* </p>
|
|
18
|
+
*
|
|
19
|
+
* <ul>
|
|
20
|
+
* <li><span class="b2-regular">an input</span></li>
|
|
21
|
+
* <li><span class="b2-regular">a button</span></li>
|
|
22
|
+
* </ul>
|
|
23
|
+
*/
|
|
24
|
+
declare const meta: Meta<AvSearchBarProps>;
|
|
25
|
+
export default meta;
|
|
26
|
+
export declare const Default: StoryFn<AvSearchBarProps>;
|
|
27
|
+
export declare const Disabled: StoryFn<AvSearchBarProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface AvSearchBarProps {
|
|
2
|
+
/**
|
|
3
|
+
* Unique id for the search bar
|
|
4
|
+
* @default crypto.randomUUID()
|
|
5
|
+
*/
|
|
6
|
+
id?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Label of the search bar
|
|
9
|
+
* @default 'Recherche'
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Current value linked to the search bar
|
|
14
|
+
* @default ''
|
|
15
|
+
*/
|
|
16
|
+
modelValue?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Placeholder for the search bar
|
|
19
|
+
* @default 'Rechercher...'
|
|
20
|
+
*/
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/**
|
|
23
|
+
* If `true`, disable the search bar
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare const _default: import("vue").DefineComponent<AvSearchBarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
29
|
+
search: (payload: string) => any;
|
|
30
|
+
"update:modelValue": (payload: string) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<AvSearchBarProps> & Readonly<{
|
|
32
|
+
onSearch?: ((payload: string) => any) | undefined;
|
|
33
|
+
"onUpdate:modelValue"?: ((payload: string) => any) | undefined;
|
|
34
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
export default _default;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const AvListItemStub: import("vue").DefineComponent<{
|
|
2
2
|
icon?: any;
|
|
3
|
-
selected?: any;
|
|
4
3
|
iconSize?: any;
|
|
5
4
|
iconColor?: any;
|
|
6
5
|
hoverBackgroundColor?: any;
|
|
7
6
|
colorOnHover?: any;
|
|
8
7
|
clickable?: any;
|
|
8
|
+
selected?: any;
|
|
9
9
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<{
|
|
10
10
|
icon?: any;
|
|
11
|
-
selected?: any;
|
|
12
11
|
iconSize?: any;
|
|
13
12
|
iconColor?: any;
|
|
14
13
|
hoverBackgroundColor?: any;
|
|
15
14
|
colorOnHover?: any;
|
|
16
15
|
clickable?: any;
|
|
16
|
+
selected?: any;
|
|
17
17
|
}> & Readonly<{
|
|
18
18
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
19
19
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -3,6 +3,11 @@ import { type Slot } from 'vue';
|
|
|
3
3
|
* AvRadioButtonSet component props.
|
|
4
4
|
*/
|
|
5
5
|
export interface AvRadioButtonSetProps {
|
|
6
|
+
/**
|
|
7
|
+
* ID of the legend element
|
|
8
|
+
* @default `av-radio-button-set-${crypto.randomUUID()}`
|
|
9
|
+
*/
|
|
10
|
+
id?: string;
|
|
6
11
|
/**
|
|
7
12
|
* Name of the radio group, applied to each radio `<input name>`.
|
|
8
13
|
* Used for form submission and accessibility.
|
|
@@ -11,6 +16,7 @@ export interface AvRadioButtonSetProps {
|
|
|
11
16
|
/**
|
|
12
17
|
* Label (legend) for the radio group, rendered visually as a title.
|
|
13
18
|
* Helps screen readers understand the group context.
|
|
19
|
+
* @default ''
|
|
14
20
|
*/
|
|
15
21
|
legend?: string;
|
|
16
22
|
/**
|
|
@@ -20,18 +26,22 @@ export interface AvRadioButtonSetProps {
|
|
|
20
26
|
modelValue: string | number | boolean | undefined;
|
|
21
27
|
/**
|
|
22
28
|
* If true, disables all radio buttons in the group.
|
|
29
|
+
* @default false
|
|
23
30
|
*/
|
|
24
31
|
disabled?: boolean;
|
|
25
32
|
/**
|
|
26
33
|
* If true, marks the group as required and shows a required indicator.
|
|
34
|
+
* @default false
|
|
27
35
|
*/
|
|
28
36
|
required?: boolean;
|
|
29
37
|
/**
|
|
30
38
|
* If true, displays the radio buttons in compact (small) mode.
|
|
39
|
+
* @default false
|
|
31
40
|
*/
|
|
32
41
|
small?: boolean;
|
|
33
42
|
/**
|
|
34
43
|
* If true, displays the radio buttons inline (horizontally).
|
|
44
|
+
* @default false
|
|
35
45
|
*/
|
|
36
46
|
inline?: boolean;
|
|
37
47
|
/**
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Slot } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* RadioButton component props.
|
|
4
|
+
*/
|
|
5
|
+
export interface RadioButtonProps {
|
|
6
|
+
/**
|
|
7
|
+
* Value of the radio button.
|
|
8
|
+
* This value will be emitted when the radio is selected.
|
|
9
|
+
*/
|
|
10
|
+
value: string | number | boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Model value of the radio button.
|
|
13
|
+
*/
|
|
14
|
+
modelValue: string | number | boolean | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* If true, disables this radio button.
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If true, displays the button in its small version.
|
|
21
|
+
*/
|
|
22
|
+
small?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If true, displays the button in its inline version.
|
|
25
|
+
*/
|
|
26
|
+
inline?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Name of the input field.
|
|
29
|
+
* Must be the same for each AvRadioButton in an AvRadioButtonSet
|
|
30
|
+
* @default ''
|
|
31
|
+
*/
|
|
32
|
+
name?: string;
|
|
33
|
+
}
|
|
34
|
+
type __VLS_Slots = {
|
|
35
|
+
/**
|
|
36
|
+
* Default slot used to fully customize the radio label.
|
|
37
|
+
*/
|
|
38
|
+
default?: Slot;
|
|
39
|
+
};
|
|
40
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<RadioButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
41
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
42
|
+
}, string, import("vue").PublicProps, Readonly<RadioButtonProps> & Readonly<{
|
|
43
|
+
"onUpdate:modelValue"?: ((value: string | number | boolean) => any) | undefined;
|
|
44
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
45
|
+
export default _default;
|
|
46
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
47
|
+
new (): {
|
|
48
|
+
$slots: S;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StoryFn } from '@storybook/vue3';
|
|
2
|
-
import type { AvAutocompleteOption } from '
|
|
2
|
+
import type { AvAutocompleteOption } from '@/components/interaction/selects/AvAutocomplete/AvAutocomplete.types';
|
|
3
3
|
interface ExtendedOption extends AvAutocompleteOption {
|
|
4
4
|
role?: string;
|
|
5
5
|
department?: string;
|
|
@@ -60,6 +60,12 @@ declare const meta: {
|
|
|
60
60
|
serverSideFiltering?: boolean | undefined;
|
|
61
61
|
modelValue?: T[] | undefined;
|
|
62
62
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
|
|
63
|
+
emit: {
|
|
64
|
+
(e: "search", query: string): void;
|
|
65
|
+
(e: "loadMore"): void;
|
|
66
|
+
(e: "clear"): void;
|
|
67
|
+
} & ((evt: "update:modelValue", value: T[]) => void);
|
|
68
|
+
attrs: any;
|
|
63
69
|
slots: {
|
|
64
70
|
requiredTip?: (() => import("vue").Slot) | undefined;
|
|
65
71
|
item?: import("vue").Slot<{
|
|
@@ -73,12 +79,6 @@ declare const meta: {
|
|
|
73
79
|
}> | undefined;
|
|
74
80
|
empty?: import("vue").Slot | undefined;
|
|
75
81
|
};
|
|
76
|
-
emit: {
|
|
77
|
-
(e: "search", query: string): void;
|
|
78
|
-
(e: "loadMore"): void;
|
|
79
|
-
(e: "clear"): void;
|
|
80
|
-
} & ((evt: "update:modelValue", value: T[]) => void);
|
|
81
|
-
attrs: any;
|
|
82
82
|
} | undefined, __VLS_expose?: ((exposed: import("vue").ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
83
83
|
props: {
|
|
84
84
|
readonly "onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|
|
@@ -345,6 +345,12 @@ export declare const WithCustomItemSlotExample: {
|
|
|
345
345
|
serverSideFiltering?: boolean | undefined;
|
|
346
346
|
modelValue?: T[] | undefined;
|
|
347
347
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
|
|
348
|
+
emit: {
|
|
349
|
+
(e: "search", query: string): void;
|
|
350
|
+
(e: "loadMore"): void;
|
|
351
|
+
(e: "clear"): void;
|
|
352
|
+
} & ((evt: "update:modelValue", value: T[]) => void);
|
|
353
|
+
attrs: any;
|
|
348
354
|
slots: {
|
|
349
355
|
requiredTip?: (() => import("vue").Slot) | undefined;
|
|
350
356
|
item?: import("vue").Slot<{
|
|
@@ -358,12 +364,6 @@ export declare const WithCustomItemSlotExample: {
|
|
|
358
364
|
}> | undefined;
|
|
359
365
|
empty?: import("vue").Slot | undefined;
|
|
360
366
|
};
|
|
361
|
-
emit: {
|
|
362
|
-
(e: "search", query: string): void;
|
|
363
|
-
(e: "loadMore"): void;
|
|
364
|
-
(e: "clear"): void;
|
|
365
|
-
} & ((evt: "update:modelValue", value: T[]) => void);
|
|
366
|
-
attrs: any;
|
|
367
367
|
} | undefined, __VLS_expose?: ((exposed: import("vue").ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
368
368
|
props: {
|
|
369
369
|
readonly "onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|