@fiscozen/dropdown 0.1.27 → 1.0.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.
@@ -1,48 +1,41 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`FzDropdown > matches snapshot 1`] = `
3
+ exports[`FzDropdown > Snapshots > should match snapshot - backoffice environment 1`] = `
4
4
  "<div>
5
- <div class="inline-flex"><button type="button" class="relative rounded flex flex-shrink items-center justify-center font-medium border-1 border-transparent h-32 focus:border-blue-600 focus:border-solid focus:border-1 bg-blue-500 hover:bg-blue-600 disabled:bg-blue-200 text-core-white focus:bg-blue-500">
6
- <div class="flex items-center justify-items-center mr-6 pl-10">
7
- <!--v-if-->
8
- </div>
9
- <div class="truncate">This is a dropdown</div>
10
- <div class="flex items-center justify-items-center ml-6 pr-10">
11
- <div class="flex items-center justify-center w-[25px] h-[25px]"><svg class="svg-inline--fa fa-angle-down fa-lg h-[20px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="angle-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
5
+ <div class="inline-flex w-full sm:w-auto"><button type="button" aria-disabled="false" class="relative rounded flex flex-shrink items-center justify-center font-normal !text-[16px] !leading-[20px] border-1 border-transparent gap-8 h-32 px-12 min-w-96 bg-blue-500 text-core-white hover:bg-blue-600 focus:bg-blue-500 focus:!border-blue-600 disabled:bg-blue-200">
6
+ <!--v-if-->
7
+ <div class="truncate font-normal !text-[16px] !leading-[20px]">Backoffice Dropdown</div>
8
+ <div class="flex items-center justify-items-center">
9
+ <div class="flex items-center justify-center w-[20px] h-[20px]"><svg class="svg-inline--fa fa-angle-down h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="angle-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
12
10
  <path class="" fill="currentColor" d="M241 369c-9.4 9.4-24.6 9.4-33.9 0L47 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143L367 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L241 369z"></path>
13
11
  </svg></div>
14
- </div><span class="hidden h-0 w-0"></span>
15
- </button></div>
16
- <div class="fz__floating__content fixed pt-4 z-10" style="display: none;">
17
- <div class="fz__actionlist bg-core-white inline-flex grow-0 flex-col rounded p-4">
18
- <div class="text-grey-400 flex h-32 items-center px-12 text-xs"><span>This is the items label</span></div>
19
- <div class="flex flex-col">
20
- <router-link to="[object Object]" disabled="true" class="px-12 py-6 text-grey-500 hover:bg-background-alice-blue border-1 focus:border-1 focus:bg-background-alice-blue disabled:text-grey-100 disabled:bg-core-white h-32 items-center rounded border-transparent text-sm hover:text-blue-500 focus:border-blue-500 focus:text-blue-500 disabled:border-transparent font-medium grow-1 flex justify-start">
21
- <!--v-if-->Item #1
22
- </router-link>
23
- </div>
24
- <div class="flex flex-col">
25
- <router-link to="[object Object]" disabled="false" class="px-12 py-6 text-grey-500 hover:bg-background-alice-blue border-1 focus:border-1 focus:bg-background-alice-blue disabled:text-grey-100 disabled:bg-core-white h-32 items-center rounded border-transparent text-sm hover:text-blue-500 focus:border-blue-500 focus:text-blue-500 disabled:border-transparent font-medium grow-1 flex justify-start">
26
- <!--v-if-->Item #2
27
- </router-link>
28
12
  </div>
29
- </div>
30
- </div>
13
+ </button></div>
31
14
  <!--v-if-->
15
+ <!--teleport start-->
16
+ <!--teleport end-->
32
17
  </div>"
33
18
  `;
34
19
 
35
- exports[`FzDropdown > matches snapshot 2`] = `
36
- "<div iconname="bars" buttonvariant="secondary">
37
- <div class="inline-flex"><button type="button" class="relative rounded flex flex-shrink items-center justify-center font-medium border-1 border-transparent h-32 focus:border-blue-600 focus:border-solid focus:border-1 px-16 text-grey-500 bg-core-white !border-grey-200 hover:bg-grey-100 focus:!border-blue-600 disabled:text-grey-100 w-32 h-32">
20
+ exports[`FzDropdown > Snapshots > should match snapshot - custom opener 1`] = `
21
+ "<div>
22
+ <div class="inline-flex w-full sm:w-auto"><button class="custom">Custom</button></div>
23
+ <!--v-if-->
24
+ <!--teleport start-->
25
+ <!--teleport end-->
26
+ </div>"
27
+ `;
28
+
29
+ exports[`FzDropdown > Snapshots > should match snapshot - default state 1`] = `
30
+ "<div>
31
+ <div class="inline-flex w-full sm:w-auto"><button type="button" aria-disabled="false" class="relative rounded flex flex-shrink items-center justify-center font-normal !text-[16px] !leading-[20px] border-1 border-transparent gap-8 h-44 px-12 min-w-96 bg-blue-500 text-core-white hover:bg-blue-600 focus:bg-blue-500 focus:!border-blue-600 disabled:bg-blue-200">
38
32
  <!--v-if-->
39
- <div class="">
40
- <div class="flex items-center justify-center w-[25px] h-[25px]"><svg class="svg-inline--fa fa-bars fa-lg h-[20px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="bars" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
41
- <path class="" fill="currentColor" d="M0 88C0 74.7 10.7 64 24 64l400 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 112C10.7 112 0 101.3 0 88zM0 248c0-13.3 10.7-24 24-24l400 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 272c-13.3 0-24-10.7-24-24zM448 408c0 13.3-10.7 24-24 24L24 432c-13.3 0-24-10.7-24-24s10.7-24 24-24l400 0c13.3 0 24 10.7 24 24z"></path>
33
+ <div class="truncate font-normal !text-[16px] !leading-[20px]">This is a dropdown</div>
34
+ <div class="flex items-center justify-items-center">
35
+ <div class="flex items-center justify-center w-[20px] h-[20px]"><svg class="svg-inline--fa fa-angle-down h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="angle-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
36
+ <path class="" fill="currentColor" d="M241 369c-9.4 9.4-24.6 9.4-33.9 0L47 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143L367 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L241 369z"></path>
42
37
  </svg></div>
43
- <!--v-if-->
44
38
  </div>
45
- <!--v-if--><span class="hidden h-0 w-0"></span>
46
39
  </button></div>
47
40
  <!--v-if-->
48
41
  <!--teleport start-->
@@ -50,17 +43,16 @@ exports[`FzDropdown > matches snapshot 2`] = `
50
43
  </div>"
51
44
  `;
52
45
 
53
- exports[`FzDropdown > matches snapshot 3`] = `
54
- "<div iconname="bars" buttonvariant="secondary">
55
- <div class="inline-flex"><button type="button" class="relative rounded flex flex-shrink items-center justify-center font-medium border-1 border-transparent h-32 focus:border-blue-600 focus:border-solid focus:border-1 px-16 text-grey-500 bg-core-white !border-grey-200 hover:bg-grey-100 focus:!border-blue-600 disabled:text-grey-100 w-32 h-32">
46
+ exports[`FzDropdown > Snapshots > should match snapshot - disabled state 1`] = `
47
+ "<div>
48
+ <div class="inline-flex w-full sm:w-auto"><button type="button" disabled="" aria-disabled="true" class="relative rounded flex flex-shrink items-center justify-center font-normal !text-[16px] !leading-[20px] border-1 border-transparent gap-8 h-44 px-12 min-w-96 bg-blue-500 text-core-white disabled:bg-blue-200">
56
49
  <!--v-if-->
57
- <div class="">
58
- <div class="flex items-center justify-center w-[25px] h-[25px]"><svg class="svg-inline--fa fa-bars fa-lg h-[20px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="bars" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
59
- <path class="" fill="currentColor" d="M0 88C0 74.7 10.7 64 24 64l400 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 112C10.7 112 0 101.3 0 88zM0 248c0-13.3 10.7-24 24-24l400 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 272c-13.3 0-24-10.7-24-24zM448 408c0 13.3-10.7 24-24 24L24 432c-13.3 0-24-10.7-24-24s10.7-24 24-24l400 0c13.3 0 24 10.7 24 24z"></path>
50
+ <div class="truncate font-normal !text-[16px] !leading-[20px]">Disabled Dropdown</div>
51
+ <div class="flex items-center justify-items-center">
52
+ <div class="flex items-center justify-center w-[20px] h-[20px]"><svg class="svg-inline--fa fa-angle-down h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="angle-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
53
+ <path class="" fill="currentColor" d="M241 369c-9.4 9.4-24.6 9.4-33.9 0L47 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143L367 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L241 369z"></path>
60
54
  </svg></div>
61
- <!--v-if-->
62
55
  </div>
63
- <!--v-if--><span class="hidden h-0 w-0"></span>
64
56
  </button></div>
65
57
  <!--v-if-->
66
58
  <!--teleport start-->
@@ -68,33 +60,67 @@ exports[`FzDropdown > matches snapshot 3`] = `
68
60
  </div>"
69
61
  `;
70
62
 
71
- exports[`FzTopbar > matches snapshot 1`] = `
63
+ exports[`FzDropdown > Snapshots > should match snapshot - open state 1`] = `
72
64
  "<div>
73
- <div class="inline-flex"><button type="button" class="relative rounded flex flex-shrink items-center justify-center font-medium border-1 border-transparent h-32 focus:border-blue-600 focus:border-solid focus:border-1 bg-blue-500 hover:bg-blue-600 disabled:bg-blue-200 text-core-white focus:bg-blue-500">
74
- <div class="flex items-center justify-items-center mr-6 pl-10">
75
- <!--v-if-->
76
- </div>
77
- <div class="truncate">This is a dropdown</div>
78
- <div class="flex items-center justify-items-center ml-6 pr-10">
79
- <div class="flex items-center justify-center w-[25px] h-[25px]"><svg class="svg-inline--fa fa-angle-down fa-lg h-[20px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="angle-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
80
- <path class="" fill="currentColor" d="M241 369c-9.4 9.4-24.6 9.4-33.9 0L47 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143L367 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L241 369z"></path>
65
+ <div class="inline-flex w-full sm:w-auto"><button type="button" aria-disabled="false" class="relative rounded flex flex-shrink items-center justify-center font-normal !text-[16px] !leading-[20px] border-1 border-transparent gap-8 h-44 px-12 min-w-96 bg-blue-500 text-core-white hover:bg-blue-600 focus:bg-blue-500 focus:!border-blue-600 disabled:bg-blue-200">
66
+ <!--v-if-->
67
+ <div class="truncate font-normal !text-[16px] !leading-[20px]">Open Dropdown</div>
68
+ <div class="flex items-center justify-items-center">
69
+ <div class="flex items-center justify-center w-[20px] h-[20px]"><svg class="svg-inline--fa fa-angle-up h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="angle-up" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
70
+ <path class="" fill="currentColor" d="M207 143c9.4-9.4 24.6-9.4 33.9 0L401 303c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-143-143L81 337c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L207 143z"></path>
81
71
  </svg></div>
82
- </div><span class="hidden h-0 w-0"></span>
83
- </button></div>
84
- <div class="bg-core-white fixed p-4 z-10" style="display: none;">
85
- <div class="fz__actionlist inline-flex grow-0 flex-col rounded p-4">
86
- <div class="text-grey-400 flex h-32 items-center px-12 text-xs"><span>This is the items label</span></div>
87
- <div class="flex flex-col">
88
- <router-link to="[object Object]" disabled="true" class="px-12 py-6 text-grey-500 hover:bg-background-alice-blue border-1 focus:border-1 focus:bg-background-alice-blue disabled:text-grey-100 disabled:bg-core-white h-32 items-center rounded border-transparent text-sm hover:text-blue-500 focus:border-blue-500 focus:text-blue-500 disabled:border-transparent font-medium grow-1 flex justify-start">
89
- <!--v-if-->Item #1
90
- </router-link>
91
72
  </div>
92
- <div class="flex flex-col">
93
- <router-link to="[object Object]" disabled="false" class="px-12 py-6 text-grey-500 hover:bg-background-alice-blue border-1 focus:border-1 focus:bg-background-alice-blue disabled:text-grey-100 disabled:bg-core-white h-32 items-center rounded border-transparent text-sm hover:text-blue-500 focus:border-blue-500 focus:text-blue-500 disabled:border-transparent font-medium grow-1 flex justify-start">
94
- <!--v-if-->Item #2
95
- </router-link>
73
+ </button></div>
74
+ <!--v-if-->
75
+ <div to="body">
76
+ <div class="fz__floating__content mt-4 z-70">
77
+ <div data-v-ca7f3405="" class="fz__actionlist bg-core-white rounded flex flex-col gap-20 p-4 min-w-[240px]">
78
+ <div class="flex flex-col gap-4" role="group" aria-labelledby="fz-action-section-label-normalized" environment="frontoffice">
79
+ <!--v-if--><button data-v-f322a564="" aria-disabled="false" aria-selected="false" type="button" class="group inline-flex max-w-full rounded border border-transparent border-2 transition-colors duration-200 gap-2 p-12 flex-row gap-8 text-core-black hover:bg-background-alice-blue hover:!text-blue-500 focus:!border-blue-200 focus:!outline-none focus:text-core-black">
80
+ <!--v-if-->
81
+ <div data-v-f322a564="" class="flex flex-1 flex-col gap-4 overflow-hidden"><span data-v-f322a564="" class="text-base text-left" title="Action 1">Action 1</span>
82
+ <!--v-if-->
83
+ </div>
84
+ <!--v-if-->
85
+ </button>
86
+ </div>
96
87
  </div>
97
88
  </div>
98
89
  </div>
99
90
  </div>"
100
91
  `;
92
+
93
+ exports[`FzDropdown > Snapshots > should match snapshot - with actions 1`] = `
94
+ "<div>
95
+ <div class="inline-flex w-full sm:w-auto"><button type="button" aria-disabled="false" class="relative rounded flex flex-shrink items-center justify-center font-normal !text-[16px] !leading-[20px] border-1 border-transparent gap-8 h-44 px-12 min-w-96 bg-blue-500 text-core-white hover:bg-blue-600 focus:bg-blue-500 focus:!border-blue-600 disabled:bg-blue-200">
96
+ <!--v-if-->
97
+ <div class="truncate font-normal !text-[16px] !leading-[20px]">Dropdown</div>
98
+ <div class="flex items-center justify-items-center">
99
+ <div class="flex items-center justify-center w-[20px] h-[20px]"><svg class="svg-inline--fa fa-angle-down h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="angle-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
100
+ <path class="" fill="currentColor" d="M241 369c-9.4 9.4-24.6 9.4-33.9 0L47 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143L367 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L241 369z"></path>
101
+ </svg></div>
102
+ </div>
103
+ </button></div>
104
+ <!--v-if-->
105
+ <!--teleport start-->
106
+ <!--teleport end-->
107
+ </div>"
108
+ `;
109
+
110
+ exports[`FzIconDropdown > Snapshots > should match snapshot 1`] = `
111
+ "<div iconname="bars" hasnotification="false" label="Open dropdown" actionslabel="This is the items label">
112
+ <div class="inline-flex w-full sm:w-auto"><span data-v-8090b1b6="" class="fz-icon-button-wrapper relative fz-icon-button-wrapper--frontoffice"><button data-v-8090b1b6="" type="button" aria-disabled="false" class="relative rounded flex flex-shrink items-center justify-center font-normal !text-[16px] !leading-[20px] border-1 border-transparent gap-8 h-44 px-12 min-w-96 bg-core-white text-grey-500 !border-grey-200 hover:bg-grey-100 hover:!border-grey-200 focus:bg-core-white focus:!border-blue-600 disabled:bg-grey-50 disabled:text-grey-200 disabled:!border-grey-200" aria-label="Open dropdown"><div class="flex items-center justify-items-center"><div class="flex items-center justify-center w-[20px] h-[20px]"><svg class="svg-inline--fa fa-bars h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="bars" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path class="" fill="currentColor" d="M0 88C0 74.7 10.7 64 24 64l400 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 112C10.7 112 0 101.3 0 88zM0 248c0-13.3 10.7-24 24-24l400 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 272c-13.3 0-24-10.7-24-24zM448 408c0 13.3-10.7 24-24 24L24 432c-13.3 0-24-10.7-24-24s10.7-24 24-24l400 0c13.3 0 24 10.7 24 24z"></path></svg></div></div><!--v-if--><!--v-if--></button><!--v-if--></span></div>
113
+ <!--v-if-->
114
+ <!--teleport start-->
115
+ <!--teleport end-->
116
+ </div>"
117
+ `;
118
+
119
+ exports[`FzIconDropdown > Snapshots > should match snapshot 2`] = `
120
+ "<div iconname="bars" hasnotification="false" label="Open dropdown" actionslabel="This is the items label">
121
+ <div class="inline-flex w-full sm:w-auto"><span data-v-8090b1b6="" class="fz-icon-button-wrapper relative fz-icon-button-wrapper--frontoffice"><button data-v-8090b1b6="" type="button" aria-disabled="false" class="relative rounded flex flex-shrink items-center justify-center font-normal !text-[16px] !leading-[20px] border-1 border-transparent gap-8 h-44 px-12 min-w-96 bg-core-white text-grey-500 !border-grey-200 hover:bg-grey-100 hover:!border-grey-200 focus:bg-core-white focus:!border-blue-600 disabled:bg-grey-50 disabled:text-grey-200 disabled:!border-grey-200" aria-label="Open dropdown"><div class="flex items-center justify-items-center"><div class="flex items-center justify-center w-[20px] h-[20px]"><svg class="svg-inline--fa fa-bars h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="bars" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path class="" fill="currentColor" d="M0 88C0 74.7 10.7 64 24 64l400 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 112C10.7 112 0 101.3 0 88zM0 248c0-13.3 10.7-24 24-24l400 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 272c-13.3 0-24-10.7-24-24zM448 408c0 13.3-10.7 24-24 24L24 432c-13.3 0-24-10.7-24-24s10.7-24 24-24l400 0c13.3 0 24 10.7 24 24z"></path></svg></div></div><!--v-if--><!--v-if--></button><!--v-if--></span></div>
122
+ <!--v-if-->
123
+ <!--teleport start-->
124
+ <!--teleport end-->
125
+ </div>"
126
+ `;
package/src/types.ts CHANGED
@@ -1,23 +1,28 @@
1
- import { ButtonSize } from '@fiscozen/button'
2
- import { FzActionlistProps } from '@fiscozen/actionlist'
3
- import { IconButtonVariant, ButtonVariant } from '@fiscozen/button'
1
+ import { ButtonSize, IconButtonVariant } from '@fiscozen/button'
2
+ import { FzActionProps, FzActionSectionProps } from '@fiscozen/action'
3
+ import { ButtonVariant } from '@fiscozen/button'
4
4
  import { VNode } from 'vue'
5
5
 
6
6
  type FzDropdownProps = {
7
7
  /**
8
+ * @deprecated Use the environment prop instead
8
9
  * Size of the dropdown trigger
9
10
  */
10
11
  size?: ButtonSize
12
+
11
13
  /**
12
- * Label of the action list
14
+ * Environment of the dropdown trigger
15
+ * @default 'frontoffice'
13
16
  */
14
- actionsLabel?: string
17
+ environment?: 'frontoffice' | 'backoffice'
15
18
  /**
19
+ * @deprecated Declare your actions list inside the actionsList slot instead
16
20
  * List of actions
17
21
  */
18
- actions: FzActionlistProps['items']
22
+ actions: (FzActionProps | (FzActionSectionProps & { type: 'section' }))[]
19
23
  /**
20
24
  * Whether to align to the left or right
25
+ * @default 'center'
21
26
  */
22
27
  align?: 'left' | 'right' | 'center'
23
28
  /**
@@ -25,29 +30,23 @@ type FzDropdownProps = {
25
30
  */
26
31
  closeOnActionClick?: boolean
27
32
  /**
28
- * Whether opener is disabled
29
- */
30
- openerDisabled?: boolean
31
- /**
32
- * Class binded to opener
33
- */
34
- openerClass?: string
35
- /**
36
- * teleport floating to body
33
+ * Class to apply to the actions list
37
34
  */
38
- teleport?: boolean
35
+ listClass?: string
39
36
  /**
40
- * Class binded to the action list
37
+ * Whether opener is disabled
41
38
  */
42
- listClass?: string
39
+ disabled?: boolean
43
40
  /**
44
- * Class binded to the floating element
41
+ * Button variant
42
+ * @default 'primary'
45
43
  */
46
- floatingClass?: string
44
+ buttonVariant?: ButtonVariant
47
45
  /**
48
- * variant of the button
46
+ * Teleport floating to body
47
+ * @default true
49
48
  */
50
- variant?: ButtonVariant
49
+ teleport?: boolean
51
50
  }
52
51
 
53
52
  type FzDropdownSlots = {
@@ -56,22 +55,40 @@ type FzDropdownSlots = {
56
55
  * Label of the standard button opener
57
56
  */
58
57
  default(props: { isOpen: boolean }): VNode | VNode[]
58
+ /**
59
+ * Actions list slot
60
+ */
61
+ actionList(): VNode | VNode[]
59
62
  /**
60
63
  *
61
64
  * Use this to replace the button opener entirely
62
65
  */
63
- opener(props: { isOpen: boolean, open: () => void, close: () => void }): VNode | VNode[]
66
+ opener(props: { isOpen: boolean; open: () => void; close: () => void }): VNode | VNode[]
64
67
  }
65
68
 
66
- interface FzIconDropdownProps extends FzDropdownProps {
69
+ export type FzIconDropdownProps = Omit<FzDropdownProps, 'buttonVariant'> & {
67
70
  /**
68
71
  * icon name
69
72
  */
70
73
  iconName: string
74
+ hasNotification?: boolean
75
+ /**
76
+ * A11y label for the button opener
77
+ * @default 'Open dropdown'
78
+ */
79
+ label?: string
71
80
  /**
72
- * button variant
81
+ * Button variant (limited to IconButton variants)
82
+ * @default 'secondary'
73
83
  */
74
84
  buttonVariant?: IconButtonVariant
75
85
  }
76
86
 
77
- export type { FzDropdownProps, FzDropdownSlots, FzIconDropdownProps }
87
+ export type FzIconDropdownSlots = {
88
+ /**
89
+ * Actions list slot
90
+ */
91
+ actionList(): VNode | VNode[]
92
+ }
93
+
94
+ export type { FzDropdownProps, FzDropdownSlots }
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/.pnpm/@vue+shared@3.5.26/node_modules/@vue/shared/dist/shared.d.ts","../../node_modules/.pnpm/@vue+reactivity@3.5.26/node_modules/@vue/reactivity/dist/reactivity.d.ts","../../node_modules/.pnpm/@vue+runtime-core@3.5.26/node_modules/@vue/runtime-core/dist/runtime-core.d.ts","../../node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/index.d.ts","../../node_modules/.pnpm/@vue+runtime-dom@3.5.26/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts","../../node_modules/.pnpm/vue@3.5.26_typescript@5.3.3/node_modules/vue/jsx-runtime/index.d.ts","../../node_modules/.pnpm/@babel+types@7.28.6/node_modules/@babel/types/lib/index.d.ts","../../node_modules/.pnpm/@babel+parser@7.28.6/node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/.pnpm/@vue+compiler-core@3.5.26/node_modules/@vue/compiler-core/dist/compiler-core.d.ts","../../node_modules/.pnpm/@vue+compiler-dom@3.5.26/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts","../../node_modules/.pnpm/vue@3.5.26_typescript@5.3.3/node_modules/vue/dist/vue.d.mts","../../node_modules/.pnpm/@fortawesome+fontawesome-common-types@6.7.2/node_modules/@fortawesome/fontawesome-common-types/index.d.ts","../../node_modules/.pnpm/@fortawesome+fontawesome-svg-core@6.7.2/node_modules/@fortawesome/fontawesome-svg-core/index.d.ts","../../node_modules/.pnpm/@awesome.me+kit-8137893ad3@1.0.396/node_modules/@awesome.me/kit-8137893ad3/icons/modules/icon-types.ts","../../node_modules/.pnpm/@awesome.me+kit-8137893ad3@1.0.396/node_modules/@awesome.me/kit-8137893ad3/icons/modules/index.d.ts","../../node_modules/.pnpm/@fortawesome+vue-fontawesome@3.1.3_@fortawesome+fontawesome-svg-core@6.7.2_vue@3.5.26_typescript@5.3.3_/node_modules/@fortawesome/vue-fontawesome/index.d.ts","../icons/src/types.ts","../icons/src/fzicon.vue.ts","../icons/src/index.ts","../button/src/types.ts","../button/src/utils.ts","../button/src/fzbutton.vue.ts","../button/src/fziconbutton.vue.ts","../container/src/types.ts","../container/src/fzcontainer.vue.ts","../container/src/index.ts","../button/src/fzbuttongroup.vue.ts","../button/src/index.ts","../../node_modules/.pnpm/vue-router@4.6.4_vue@3.5.26_typescript@5.3.3_/node_modules/vue-router/dist/router-cwonjprp.d.mts","../../node_modules/.pnpm/vue-router@4.6.4_vue@3.5.26_typescript@5.3.3_/node_modules/vue-router/dist/vue-router.d.mts","../link/src/types.ts","../link/src/fzlink.vue.ts","../link/src/index.ts","../action/src/types.ts","../action/src/composables/useactionclasses.ts","../action/src/fzaction.vue.ts","../action/src/fzactionlist.vue.ts","../action/src/fzactionsection.vue.ts","../action/src/index.ts","../composables/src/types.ts","../composables/src/utils/number/index.ts","../composables/src/utils/position/index.ts","../composables/src/utils/index.ts","../composables/src/composables/usefloating.ts","../composables/src/composables/usemediaquery.ts","../composables/src/composables/usebreakpoints.ts","../composables/src/composables/useclickoutside.ts","../composables/src/composables/usekeydown.ts","../composables/src/composables/usekeyup.ts","../composables/src/composables/usecurrency.ts","../composables/src/composables/index.ts","../style/src/custom-directives/validation.ts","../style/src/custom-directives/config.ts","../style/src/custom-directives/vbold.ts","../style/tokens.json","../style/safe-colors.json","../style/safe-semantic-colors.json","../style/src/custom-directives/vcolor.ts","../style/src/custom-directives/vsmall.ts","../style/src/custom-directives/index.ts","../style/src/constants.ts","../style/src/index.ts","../composables/src/fzfloating.vue.ts","../composables/src/index.ts","./src/types.ts","./src/fzdropdown.vue.ts","./src/fzicondropdown.vue.ts","./__vls_types.d.ts","./dist/src/types.d.ts","./dist/src/fzdropdown.vue.d.ts","./dist/src/fzicondropdown.vue.d.ts","./dist/src/index.d.ts","./dist/index.d.ts","./src/index.ts","../link/src/fzlink.vue"],"fileInfos":[{"version":"0","affectsGlobalScope":true},"0","0","0","0","0","0",{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},{"version":"0","affectsGlobalScope":true},"0","0",{"version":"0","affectsGlobalScope":true},"0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0",{"version":"0","affectsGlobalScope":true},"0","0","0","0","0","0"],"root":[[110,119]],"options":{"composite":true,"esModuleInterop":true,"jsx":1,"jsxImportSource":"vue","module":99,"noImplicitThis":true,"skipLibCheck":true,"strict":true,"target":99,"useDefineForClassFields":true},"fileIdsList":[[51,57],[59],[52],[57],[56,58,75],[46,52,53],[54],[46],[46,47,48,50],[47,48,49,50],[56,75],[56,74,75],[50,55],[50],[51,56,75,79],[51,56,64,75,78,79,80],[51,79,81,82,83],[51,64,75,78],[51,56,64,65,66,75],[51,56,65,66,71,75],[51,56,65,66,67,75],[51,65,67,68,72],[51,64],[51,56,65,67,75],[51,89,90,91,92,93,94,95],[51,90],[51,56,75],[51,85,88],[51,56,75,85,88],[51,56,75,85,96,107],[51,85,88,96,108],[51,86,87],[51],[51,85],[51,56,69,75],[51,69,70],[117],[56,73,75,84,114],[114,115,116],[56,73,75,84],[51,56,66,73,75,84,109,110],[51,56,66,73,75,84,110,111],[51,110,111,112],[51,56,73,75,84],[51,56,60,61,62,75],[51,56,58,60,62,63,75],[51,56,75,76],[51,76,77],[51,75],[51,100],[51,97],[51,97,98,99,103,104],[51,56,75,97,98],[51,56,75,97,98,100,101,102],[51,56,75,105,106],[51,79,120],[51,65],[51,56,65,75],[51,85,88,96],[51,69],[51,56,58,60,62,75],[51,76]],"referencedMap":[[59,1],[60,2],[53,3],[58,4],[61,5],[54,6],[55,7],[47,8],[48,9],[50,10],[74,11],[75,12],[56,13],[51,14],[80,15],[81,16],[82,15],[83,15],[84,17],[79,18],[67,19],[72,20],[68,21],[73,22],[65,23],[66,24],[96,25],[91,26],[92,27],[95,28],[89,29],[93,27],[94,27],[90,27],[108,30],[109,31],[85,27],[88,32],[86,33],[87,34],[70,35],[71,36],[69,33],[113,27],[118,37],[115,38],[116,38],[117,39],[114,40],[111,41],[112,42],[119,43],[110,44],[63,45],[64,46],[62,33],[77,47],[78,48],[76,49],[106,50],[98,51],[105,52],[97,27],[99,53],[103,54],[104,53],[107,55]],"exportedModulesMap":[[59,1],[60,2],[53,3],[58,4],[61,5],[54,6],[55,7],[47,8],[48,9],[50,10],[74,11],[75,12],[56,13],[51,14],[80,15],[81,16],[82,15],[83,15],[84,56],[79,18],[67,19],[72,20],[68,21],[73,57],[65,23],[66,58],[96,25],[91,26],[92,27],[95,28],[89,29],[93,27],[94,27],[90,27],[108,30],[109,59],[85,27],[88,32],[86,33],[87,34],[70,35],[71,60],[69,33],[113,27],[118,27],[115,27],[116,27],[117,27],[114,27],[111,41],[112,42],[119,27],[110,44],[63,45],[64,61],[62,33],[77,47],[78,62],[76,49],[106,50],[98,51],[105,52],[97,27],[99,53],[103,54],[104,53],[107,55]],"semanticDiagnosticsPerFile":[59,60,53,52,57,58,61,54,55,47,48,50,46,49,44,45,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,20,24,21,22,23,25,26,27,5,28,29,30,31,6,35,32,33,34,36,7,37,42,43,38,39,40,41,1,74,75,56,51,80,81,82,83,84,79,67,72,68,73,65,66,96,91,92,95,89,93,94,90,108,109,85,88,86,87,70,71,69,113,118,115,116,117,114,111,112,119,110,63,64,62,77,78,76,101,102,106,98,105,97,99,103,104,107,100],"affectedFilesPendingEmit":[111,112,119,110],"emitSignatures":[110,111,112]},"version":"5.3.3"}
package/vitest.config.ts CHANGED
@@ -9,11 +9,19 @@ export default mergeConfig(
9
9
  environment: 'jsdom',
10
10
  exclude: [...configDefaults.exclude, 'e2e/*'],
11
11
  root: fileURLToPath(new URL('./', import.meta.url)),
12
+ setupFiles: ['../vitest.setup.ts'],
12
13
  coverage: {
13
14
  provider: 'v8',
14
15
  include: ['**/src/**'],
15
- exclude: ['**/index.ts']
16
+ exclude: ['**/index.ts', '**/__tests__/**', '**/*.stories.ts'],
17
+ thresholds: {
18
+ statements: 80,
19
+ branches: 75,
20
+ functions: 80,
21
+ lines: 80
22
+ }
16
23
  }
17
24
  }
18
25
  })
19
26
  )
27
+