@avenirs-esr/avenirs-dsav 0.1.57 → 0.1.59
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 +1 -1
- package/dist/components/interaction/inputs/AvInput/AvInput.vue.d.ts +1 -0
- package/dist/components/overlay/dropdowns/AvDropdown/AvDropdown.stories.d.ts +61 -0
- package/dist/components/overlay/dropdowns/AvDropdown/AvDropdown.stub.d.ts +19 -0
- package/dist/components/overlay/dropdowns/AvDropdown/AvDropdown.vue.d.ts +81 -0
- package/dist/components/overlay/index.d.ts +1 -0
- package/dist/index.cjs.js +8 -8
- package/dist/index.es.js +626 -571
- package/dist/test-utils.cjs.js +19 -8
- package/dist/test-utils.es.js +33 -16
- package/dist/tests/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
import { type AvDropdownProps } from '@/components/overlay/dropdowns/AvDropdown/AvDropdown.vue';
|
|
3
|
+
/**
|
|
4
|
+
* <h1 class="n1">Dropdowns - <code>AvDropdown</code></h1>
|
|
5
|
+
*
|
|
6
|
+
* <h2 class="n2">✨ Introduction</h2>
|
|
7
|
+
*
|
|
8
|
+
* <p>
|
|
9
|
+
* <span class="b2-regular">
|
|
10
|
+
* The <code>AvDropdown</code> is a contextual menu component that displays a list of actionable items in a popover.
|
|
11
|
+
* </span>
|
|
12
|
+
* </p>
|
|
13
|
+
*
|
|
14
|
+
* <p>
|
|
15
|
+
* <span class="b2-regular">
|
|
16
|
+
* The <code>AvDropdown</code> is built on top of <code>AvPopover</code> and <code>AvButton</code> components,
|
|
17
|
+
* providing a convenient way to create dropdown menus with customizable trigger buttons and menu items.
|
|
18
|
+
* </span>
|
|
19
|
+
* </p>
|
|
20
|
+
*
|
|
21
|
+
* <p>
|
|
22
|
+
* <span class="b2-regular">
|
|
23
|
+
* Each menu item can have an optional icon and emits an event when clicked, making it perfect for settings menus,
|
|
24
|
+
* action lists, or contextual operations.
|
|
25
|
+
* </span>
|
|
26
|
+
* </p>
|
|
27
|
+
*
|
|
28
|
+
* <h2 class="n2">🏗️ Structure</h2>
|
|
29
|
+
*
|
|
30
|
+
* <p><span class="b2-regular">The dropdown consists of:</span></p>
|
|
31
|
+
*
|
|
32
|
+
* <ul>
|
|
33
|
+
* <li>
|
|
34
|
+
* <span class="b2-regular">
|
|
35
|
+
* A trigger button - mandatory, configured via <code>trigger*</code> props;
|
|
36
|
+
* </span>
|
|
37
|
+
* </li>
|
|
38
|
+
* <li>
|
|
39
|
+
* <span class="b2-regular">
|
|
40
|
+
* A list of menu items - mandatory, defined via the <code>items</code> prop, each with a name, label, and optional icon;
|
|
41
|
+
* </span>
|
|
42
|
+
* </li>
|
|
43
|
+
* <li>
|
|
44
|
+
* <span class="b2-regular">
|
|
45
|
+
* A popover container - automatically managed, with customizable width and padding.
|
|
46
|
+
* </span>
|
|
47
|
+
* </li>
|
|
48
|
+
* </ul>
|
|
49
|
+
*/
|
|
50
|
+
declare const meta: Meta<AvDropdownProps>;
|
|
51
|
+
export default meta;
|
|
52
|
+
export declare const Default: StoryFn<AvDropdownProps>;
|
|
53
|
+
export declare const WithLabel: StoryFn<AvDropdownProps>;
|
|
54
|
+
export declare const FlatTrigger: StoryFn<AvDropdownProps>;
|
|
55
|
+
export declare const DefaultTrigger: StoryFn<AvDropdownProps>;
|
|
56
|
+
export declare const LargeTrigger: StoryFn<AvDropdownProps>;
|
|
57
|
+
export declare const WideMenu: StoryFn<AvDropdownProps>;
|
|
58
|
+
export declare const LargeItems: StoryFn<AvDropdownProps>;
|
|
59
|
+
export declare const PrimaryItems: StoryFn<AvDropdownProps>;
|
|
60
|
+
export declare const WithoutIcons: StoryFn<AvDropdownProps>;
|
|
61
|
+
export declare const SettingsMenu: StoryFn<AvDropdownProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const AvDropdownStub: import("vue").DefineComponent<{
|
|
2
|
+
padding?: any;
|
|
3
|
+
items?: any;
|
|
4
|
+
triggerAriaLabel?: any;
|
|
5
|
+
triggerIcon?: any;
|
|
6
|
+
triggerLabel?: any;
|
|
7
|
+
triggerVariant?: any;
|
|
8
|
+
triggerSize?: any;
|
|
9
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "itemSelected"[], "itemSelected", import("vue").PublicProps, Readonly<{
|
|
10
|
+
padding?: any;
|
|
11
|
+
items?: any;
|
|
12
|
+
triggerAriaLabel?: any;
|
|
13
|
+
triggerIcon?: any;
|
|
14
|
+
triggerLabel?: any;
|
|
15
|
+
triggerVariant?: any;
|
|
16
|
+
triggerSize?: any;
|
|
17
|
+
}> & Readonly<{
|
|
18
|
+
onItemSelected?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type AvButtonProps } from '@/components/interaction/buttons/AvButton/AvButton.vue';
|
|
2
|
+
/**
|
|
3
|
+
* AvDropdownItem interface representing a single menu item.
|
|
4
|
+
*/
|
|
5
|
+
export interface AvDropdownItem {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for the item.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Display text for the item.
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional icon (MDI icon name).
|
|
16
|
+
*/
|
|
17
|
+
icon?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* AvDropdown props interface.
|
|
21
|
+
*/
|
|
22
|
+
export interface AvDropdownProps {
|
|
23
|
+
/**
|
|
24
|
+
* Array of menu items to display. Each item must have `name` and `label`, with optional `icon`.
|
|
25
|
+
*/
|
|
26
|
+
items: AvDropdownItem[];
|
|
27
|
+
/**
|
|
28
|
+
* Accessibility label for the trigger button.
|
|
29
|
+
*/
|
|
30
|
+
triggerAriaLabel: string;
|
|
31
|
+
/**
|
|
32
|
+
* Icon for the trigger button.
|
|
33
|
+
* @default MDI_ICONS.DOTS_VERTICAL
|
|
34
|
+
*/
|
|
35
|
+
triggerIcon?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Text label for the trigger button. If not provided, only the icon is shown.
|
|
38
|
+
*/
|
|
39
|
+
triggerLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Variant of the trigger button.
|
|
42
|
+
* @default 'OUTLINED'
|
|
43
|
+
*/
|
|
44
|
+
triggerVariant?: AvButtonProps['variant'];
|
|
45
|
+
/**
|
|
46
|
+
* Size of the trigger button.
|
|
47
|
+
* @default 'sm'
|
|
48
|
+
*/
|
|
49
|
+
triggerSize?: AvButtonProps['size'];
|
|
50
|
+
/**
|
|
51
|
+
* Width of the dropdown menu.
|
|
52
|
+
* @default '15rem'
|
|
53
|
+
*/
|
|
54
|
+
width?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Internal padding of the dropdown menu.
|
|
57
|
+
* @default 'var(--spacing-xs)'
|
|
58
|
+
*/
|
|
59
|
+
padding?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Size of menu item buttons.
|
|
62
|
+
* @default 'sm'
|
|
63
|
+
*/
|
|
64
|
+
itemSize?: AvButtonProps['size'];
|
|
65
|
+
/**
|
|
66
|
+
* Theme of menu item buttons.
|
|
67
|
+
* @default 'SECONDARY'
|
|
68
|
+
*/
|
|
69
|
+
itemTheme?: AvButtonProps['theme'];
|
|
70
|
+
/**
|
|
71
|
+
* Scale factor for menu item icons.
|
|
72
|
+
* @default 1.3
|
|
73
|
+
*/
|
|
74
|
+
itemIconScale?: number;
|
|
75
|
+
}
|
|
76
|
+
declare const _default: import("vue").DefineComponent<AvDropdownProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
77
|
+
itemSelected: (itemName: string) => any;
|
|
78
|
+
}, string, import("vue").PublicProps, Readonly<AvDropdownProps> & Readonly<{
|
|
79
|
+
onItemSelected?: ((itemName: string) => any) | undefined;
|
|
80
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
81
|
+
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as AvDrawer } from './drawers/AvDrawer/AvDrawer.vue';
|
|
2
|
+
export { default as AvDropdown, type AvDropdownItem, type AvDropdownProps } from './dropdowns/AvDropdown/AvDropdown.vue';
|
|
2
3
|
export { default as AvModal, type AvModalProps } from './modals/AvModal/AvModal.vue';
|
|
3
4
|
export { default as AvPopover } from './popovers/AvPopover/AvPopover.vue';
|