@vue-interface/dropdown-menu 2.0.0-beta.8 → 3.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.
- package/LICENSE +22 -0
- package/README.md +36 -0
- package/dist/dropdown-menu.js +44 -59
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/dropdown-menu.umd.cjs +2 -1
- package/dist/dropdown-menu.umd.cjs.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/src/DropdownHeader.vue.d.ts +17 -0
- package/dist/src/DropdownItem.vue.d.ts +17 -0
- package/dist/src/DropdownItemText.vue.d.ts +17 -0
- package/dist/src/DropdownMenu.vue.d.ts +21 -37
- package/index.css +220 -0
- package/package.json +24 -50
- package/dist/src/DropdownMenuItems.vue.d.ts +0 -4
- package/tailwindcss/index.cjs +0 -302
- package/tailwindcss/safelist.cjs +0 -15
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Justin Kimbrell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Dropdown Menu
|
|
2
|
+
|
|
3
|
+
The `dropdown-menu` component displays a list of actionable or informational items, similar to traditional dropdown lists. It supports headers, dividers, links, and plain text items.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm i @vue-interface/dropdown-menu
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
yarn add @vue-interface/dropdown-menu
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i @vue-interface/dropdown-menu
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun i @vue-interface/dropdown-menu
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Basic Usage
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<div class="dropdown-menu show relative z-1">
|
|
27
|
+
<h3 class="dropdown-header">Vue Router</h3>
|
|
28
|
+
<a href="#" class="dropdown-item active">Item #2</a>
|
|
29
|
+
<a href="#" class="dropdown-item">Item #3</a>
|
|
30
|
+
<hr class="dropdown-divider" />
|
|
31
|
+
<a href="#" class="dropdown-item">Item #4</a>
|
|
32
|
+
</div>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For more comprehensive documentation and examples, please visit the [online documentation](https://vue-interface.github.io/packages/dropdown-menu/).
|
|
36
|
+
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1,65 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { createElementBlock as o, openBlock as t, renderSlot as r, defineComponent as l, normalizeClass as i } from "vue";
|
|
2
|
+
const d = (e, n) => {
|
|
3
|
+
const s = e.__vccOpts || e;
|
|
4
|
+
for (const [c, a] of n)
|
|
5
|
+
s[c] = a;
|
|
6
|
+
return s;
|
|
7
|
+
}, _ = {}, f = { class: "dropdown-header" };
|
|
8
|
+
function u(e, n) {
|
|
9
|
+
return t(), o("h3", f, [
|
|
10
|
+
r(e.$slots, "default")
|
|
11
|
+
]);
|
|
4
12
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
return e;
|
|
13
|
+
const b = /* @__PURE__ */ d(_, [["render", u]]), m = {}, p = { class: "dropdown-item" };
|
|
14
|
+
function h(e, n) {
|
|
15
|
+
return t(), o("div", p, [
|
|
16
|
+
r(e.$slots, "default")
|
|
17
|
+
]);
|
|
12
18
|
}
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const y = /* @__PURE__ */ d(m, [["render", h]]), w = {}, $ = { class: "dropdown-item-text" };
|
|
20
|
+
function g(e, n) {
|
|
21
|
+
return t(), o("div", $, [
|
|
22
|
+
r(e.$slots, "default")
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
const k = /* @__PURE__ */ d(w, [["render", g]]), v = ["aria-labelledby"], x = /* @__PURE__ */ l({
|
|
26
|
+
__name: "DropdownMenu",
|
|
18
27
|
props: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
* @property Object
|
|
35
|
-
*/
|
|
36
|
-
show: Boolean
|
|
28
|
+
align: { default: "left" },
|
|
29
|
+
show: { type: Boolean }
|
|
30
|
+
},
|
|
31
|
+
setup(e) {
|
|
32
|
+
return (n, s) => (t(), o("div", {
|
|
33
|
+
class: i(["dropdown-menu", {
|
|
34
|
+
"dropdown-menu-left": e.align === "left",
|
|
35
|
+
"dropdown-menu-right": e.align === "right",
|
|
36
|
+
show: e.show
|
|
37
|
+
}]),
|
|
38
|
+
"aria-labelledby": n.$attrs.id
|
|
39
|
+
}, [
|
|
40
|
+
r(n.$slots, "default")
|
|
41
|
+
], 10, v));
|
|
37
42
|
}
|
|
38
|
-
})
|
|
39
|
-
const t = e.__vccOpts || e;
|
|
40
|
-
for (const [n, r] of o)
|
|
41
|
-
t[n] = r;
|
|
42
|
-
return t;
|
|
43
|
-
}, $ = ["aria-labelledby"];
|
|
44
|
-
function b(e, o, t, n, r, C) {
|
|
45
|
-
const d = c("dropdown-menu-items");
|
|
46
|
-
return f(), m("div", {
|
|
47
|
-
class: u(["dropdown-menu", {
|
|
48
|
-
"dropdown-menu-left": e.align === "left",
|
|
49
|
-
"dropdown-menu-right": e.align === "right",
|
|
50
|
-
show: e.show
|
|
51
|
-
}]),
|
|
52
|
-
"aria-labelledby": e.$attrs.id
|
|
53
|
-
}, [
|
|
54
|
-
w(d, null, {
|
|
55
|
-
default: h(() => [
|
|
56
|
-
g(e.$slots, "default")
|
|
57
|
-
]),
|
|
58
|
-
_: 3
|
|
59
|
-
})
|
|
60
|
-
], 10, $);
|
|
61
|
-
}
|
|
62
|
-
const M = /* @__PURE__ */ y(v, [["render", b]]);
|
|
43
|
+
});
|
|
63
44
|
export {
|
|
64
|
-
|
|
45
|
+
b as DropdownHeader,
|
|
46
|
+
y as DropdownItem,
|
|
47
|
+
k as DropdownItemText,
|
|
48
|
+
x as DropdownMenu
|
|
65
49
|
};
|
|
50
|
+
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","sources":["../src/DropdownHeader.vue","../src/DropdownItem.vue","../src/DropdownItemText.vue","../src/DropdownMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <h3 class=\"dropdown-header\">\n <slot />\n </h3>\n</template>","<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <div class=\"dropdown-item\">\n <slot />\n </div>\n</template>","<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <div class=\"dropdown-item-text\">\n <slot />\n </div>\n</template>","<script setup lang=\"ts\">\nexport type DropdownMenuProps = {\n align?: 'left' | 'right',\n show?: boolean\n};\n\nwithDefaults(defineProps<DropdownMenuProps>(), {\n align: 'left'\n});\n</script>\n\n<template>\n <div\n class=\"dropdown-menu\"\n :aria-labelledby=\"($attrs.id as string|undefined)\"\n :class=\"{\n 'dropdown-menu-left': align === 'left',\n 'dropdown-menu-right': align === 'right',\n 'show': show\n }\">\n <slot />\n </div>\n</template>"],"names":["_hoisted_1","_openBlock","_createElementBlock","_renderSlot","_ctx","__props","$attrs"],"mappings":";;;;;;WAKQA,IAAA,EAAA,OAAM,kBAAiB;;AAA3B,SAAAC,EAAA,GAAAC,EAEK,MAFLF,GAEK;AAAA,IADDG,EAAQC,EAAA,QAAA,SAAA;AAAA;;yDCDPJ,IAAA,EAAA,OAAM,gBAAe;;AAA1B,SAAAC,EAAA,GAAAC,EAEM,OAFNF,GAEM;AAAA,IADFG,EAAQC,EAAA,QAAA,SAAA;AAAA;;yDCDPJ,IAAA,EAAA,OAAM,qBAAoB;;AAA/B,SAAAC,EAAA,GAAAC,EAEM,OAFNF,GAEM;AAAA,IADFG,EAAQC,EAAA,QAAA,SAAA;AAAA;;;;;;;;;2BCMZF,EASM,OAAA;AAAA,MARF,UAAM,iBAAe;AAAA,8BAEuBG,EAAA,UAAK;AAAA,+BAAgDA,EAAA,UAAK;AAAA,cAAkCA,EAAA;AAAA,MAAA;MADvI,mBAAkBC,EAAAA,OAAO;AAAA,IAAA;MAM1BH,EAAQC,EAAA,QAAA,SAAA;AAAA,IAAA;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.DropdownMenu={},o.Vue))})(this,(function(o,e){"use strict";const r=(n,t)=>{const d=n.__vccOpts||n;for(const[B,D]of t)d[B]=D;return d},c={},s={class:"dropdown-header"};function l(n,t){return e.openBlock(),e.createElementBlock("h3",s,[e.renderSlot(n.$slots,"default")])}const i=r(c,[["render",l]]),a={},f={class:"dropdown-item"};function _(n,t){return e.openBlock(),e.createElementBlock("div",f,[e.renderSlot(n.$slots,"default")])}const p=r(a,[["render",_]]),m={},u={class:"dropdown-item-text"};function h(n,t){return e.openBlock(),e.createElementBlock("div",u,[e.renderSlot(n.$slots,"default")])}const w=r(m,[["render",h]]),$=["aria-labelledby"],k=e.defineComponent({__name:"DropdownMenu",props:{align:{default:"left"},show:{type:Boolean}},setup(n){return(t,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dropdown-menu",{"dropdown-menu-left":n.align==="left","dropdown-menu-right":n.align==="right",show:n.show}]),"aria-labelledby":t.$attrs.id},[e.renderSlot(t.$slots,"default")],10,$))}});o.DropdownHeader=i,o.DropdownItem=p,o.DropdownItemText=w,o.DropdownMenu=k,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
+
//# sourceMappingURL=dropdown-menu.umd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.umd.cjs","sources":["../src/DropdownHeader.vue","../src/DropdownItem.vue","../src/DropdownItemText.vue","../src/DropdownMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <h3 class=\"dropdown-header\">\n <slot />\n </h3>\n</template>","<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <div class=\"dropdown-item\">\n <slot />\n </div>\n</template>","<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <div class=\"dropdown-item-text\">\n <slot />\n </div>\n</template>","<script setup lang=\"ts\">\nexport type DropdownMenuProps = {\n align?: 'left' | 'right',\n show?: boolean\n};\n\nwithDefaults(defineProps<DropdownMenuProps>(), {\n align: 'left'\n});\n</script>\n\n<template>\n <div\n class=\"dropdown-menu\"\n :aria-labelledby=\"($attrs.id as string|undefined)\"\n :class=\"{\n 'dropdown-menu-left': align === 'left',\n 'dropdown-menu-right': align === 'right',\n 'show': show\n }\">\n <slot />\n </div>\n</template>"],"names":["_hoisted_1","_openBlock","_createElementBlock","_renderSlot","_ctx","__props","$attrs"],"mappings":"kVAKQA,EAAA,CAAA,MAAM,iBAAiB,kBAA3B,OAAAC,YAAA,EAAAC,qBAEK,KAFLF,EAEK,CADDG,aAAQC,EAAA,OAAA,SAAA,qCCDPJ,EAAA,CAAA,MAAM,eAAe,kBAA1B,OAAAC,YAAA,EAAAC,qBAEM,MAFNF,EAEM,CADFG,aAAQC,EAAA,OAAA,SAAA,qCCDPJ,EAAA,CAAA,MAAM,oBAAoB,kBAA/B,OAAAC,YAAA,EAAAC,qBAEM,MAFNF,EAEM,CADFG,aAAQC,EAAA,OAAA,SAAA,yLCMZF,EAAAA,mBASM,MAAA,CARF,wBAAM,gBAAe,sBAEuBG,EAAA,QAAK,6BAAgDA,EAAA,QAAK,aAAkCA,EAAA,IAAA,IADvI,kBAAkBC,EAAAA,OAAO,EAAA,GAM1BH,aAAQC,EAAA,OAAA,SAAA,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { default as DropdownHeader } from './src/DropdownHeader.vue';
|
|
2
|
+
import { default as DropdownItem } from './src/DropdownItem.vue';
|
|
3
|
+
import { default as DropdownItemText } from './src/DropdownItemText.vue';
|
|
4
|
+
import { default as DropdownMenu } from './src/DropdownMenu.vue';
|
|
5
|
+
export { DropdownHeader, DropdownItem, DropdownItemText, DropdownMenu };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLHeadingElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLHeadingElement>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLDivElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLDivElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -1,39 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
default: string;
|
|
10
|
-
validate(value: any): boolean;
|
|
1
|
+
export type DropdownMenuProps = {
|
|
2
|
+
align?: 'left' | 'right';
|
|
3
|
+
show?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
slots: {
|
|
8
|
+
default?(_: {}): any;
|
|
11
9
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
align: {
|
|
25
|
-
type: StringConstructor;
|
|
26
|
-
default: string;
|
|
27
|
-
validate(value: any): boolean;
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: HTMLDivElement;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<DropdownMenuProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<DropdownMenuProps> & Readonly<{}>, {
|
|
15
|
+
align: "left" | "right";
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
28
22
|
};
|
|
29
|
-
|
|
30
|
-
* The default visibility of the dropdown menu.
|
|
31
|
-
*
|
|
32
|
-
* @property Object
|
|
33
|
-
*/
|
|
34
|
-
show: BooleanConstructor;
|
|
35
|
-
}>>, {
|
|
36
|
-
align: string;
|
|
37
|
-
show: boolean;
|
|
38
|
-
}>;
|
|
39
|
-
export default _sfc_main;
|
|
23
|
+
};
|
package/index.css
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
--dropdown-menu-position: absolute;
|
|
5
|
+
--dropdown-menu-top: 100%;
|
|
6
|
+
--dropdown-menu-left: 0;
|
|
7
|
+
--dropdown-menu-z-index: 1000;
|
|
8
|
+
--dropdown-menu-display: none;
|
|
9
|
+
--dropdown-menu-min-width: 10rem;
|
|
10
|
+
--dropdown-menu-padding: 0.5rem 0;
|
|
11
|
+
--dropdown-menu-font-size: 1rem;
|
|
12
|
+
--dropdown-menu-text-align: left;
|
|
13
|
+
--dropdown-menu-list-style: none;
|
|
14
|
+
--dropdown-menu-bg: var(--color-white, #fff);
|
|
15
|
+
--dropdown-menu-bg-dark: var(--color-neutral-800, oklch(26.9% 0 0));
|
|
16
|
+
--dropdown-menu-bg-clip: padding-box;
|
|
17
|
+
--dropdown-menu-border: 1px solid var(--color-neutral-400, oklch(70.8% 0 0));
|
|
18
|
+
--dropdown-menu-border-dark: 1px solid var(--color-neutral-600, oklch(43.9% 0 0));
|
|
19
|
+
--dropdown-menu-border-radius: 0.25rem;
|
|
20
|
+
--dropdown-menu-box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.5);
|
|
21
|
+
--dropdown-menu-text-decoration: none;
|
|
22
|
+
--dropdown-menu-white-space: nowrap;
|
|
23
|
+
|
|
24
|
+
--dropdown-menu-item-display: flex;
|
|
25
|
+
--dropdown-menu-item-width: 100%;
|
|
26
|
+
--dropdown-menu-item-padding: 0.25rem 1rem;
|
|
27
|
+
--dropdown-menu-item-font-weight: normal;
|
|
28
|
+
--dropdown-menu-item-color: var(--color-neutral-800, oklch(26.9% 0 0));
|
|
29
|
+
--dropdown-menu-item-color-dark: var(--color-neutral-200, oklch(92.2% 0 0));
|
|
30
|
+
--dropdown-menu-item-text-align: inherit;
|
|
31
|
+
--dropdown-menu-item-bg: transparent;
|
|
32
|
+
--dropdown-menu-item-border: 0;
|
|
33
|
+
--dropdown-menu-item-hover-color: var(--color-neutral-900, oklch(20.5% 0 0));
|
|
34
|
+
--dropdown-menu-item-hover-color-dark: var(--color-neutral-100, oklch(97% 0 0));
|
|
35
|
+
--dropdown-menu-item-hover-bg: var(--color-neutral-100, oklch(97% 0 0));
|
|
36
|
+
--dropdown-menu-item-hover-bg-dark: var(--color-neutral-700, oklch(37.1% 0 0));
|
|
37
|
+
--dropdown-menu-item-active-color: var(--color-white, #fff);
|
|
38
|
+
--dropdown-menu-item-active-color-dark: var(--dropdown-menu-item-active-color);
|
|
39
|
+
--dropdown-menu-item-active-bg: var(--color-blue-500, oklch(62.3% 0.214 259.815));
|
|
40
|
+
--dropdown-menu-item-active-bg-dark: var(--dropdown-menu-item-active-bg);
|
|
41
|
+
--dropdown-menu-item-disabled-color: var(--color-neutral-500, oklch(55.6% 0 0));
|
|
42
|
+
--dropdown-menu-item-disabled-pointer-events: none;
|
|
43
|
+
--dropdown-menu-item-disabled-bg: transparent;
|
|
44
|
+
|
|
45
|
+
--dropdown-menu-header-display: block;
|
|
46
|
+
--dropdown-menu-header-padding: 0.5rem;
|
|
47
|
+
--dropdown-menu-header-font-size: 0.875rem;
|
|
48
|
+
--dropdown-menu-header-font-weight: bold;
|
|
49
|
+
--dropdown-menu-header-color: var(--color-neutral-500, oklch(55.6% 0 0));
|
|
50
|
+
--dropdown-menu-header-color-dark: var(--color-neutral-400, oklch(70.8% 0 0));
|
|
51
|
+
|
|
52
|
+
--dropdown-menu-divider-height: 0;
|
|
53
|
+
--dropdown-menu-divider-margin: 0.25rem 0;
|
|
54
|
+
--dropdown-menu-divider-overflow: hidden;
|
|
55
|
+
--dropdown-menu-divider-border-top: 1px solid var(--color-neutral-200, oklch(92.2% 0 0));
|
|
56
|
+
--dropdown-menu-divider-border-top-dark: 1px solid var(--color-neutral-700, oklch(37.1% 0 0));
|
|
57
|
+
|
|
58
|
+
--dropdown-menu-text-padding: 0.25rem 1rem;
|
|
59
|
+
--dropdown-menu-text-color: var(--color-neutral-800, oklch(26.9% 0 0));
|
|
60
|
+
--dropdown-menu-text-color-dark: var(--color-neutral-200, oklch(92.2% 0 0));
|
|
61
|
+
|
|
62
|
+
--dropdown-menu-show-display: inline-block;
|
|
63
|
+
|
|
64
|
+
--dropdown-menu-left-right: auto;
|
|
65
|
+
--dropdown-menu-left-left: 0;
|
|
66
|
+
--dropdown-menu-right-right: 0;
|
|
67
|
+
--dropdown-menu-right-left: auto;
|
|
68
|
+
--dropdown-menu-reset-right: auto;
|
|
69
|
+
--dropdown-menu-reset-bottom: auto;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@utility dropdown-menu {
|
|
74
|
+
position: var(--dropdown-menu-position);
|
|
75
|
+
top: var(--dropdown-menu-top);
|
|
76
|
+
left: var(--dropdown-menu-left);
|
|
77
|
+
z-index: var(--dropdown-menu-z-index);
|
|
78
|
+
display: var(--dropdown-menu-display);
|
|
79
|
+
min-width: var(--dropdown-menu-min-width);
|
|
80
|
+
padding: var(--dropdown-menu-padding);
|
|
81
|
+
font-size: var(--dropdown-menu-font-size);
|
|
82
|
+
text-align: var(--dropdown-menu-text-align);
|
|
83
|
+
list-style: var(--dropdown-menu-list-style);
|
|
84
|
+
background-color: var(--dropdown-menu-bg);
|
|
85
|
+
background-clip: var(--dropdown-menu-bg-clip);
|
|
86
|
+
border: var(--dropdown-menu-border);
|
|
87
|
+
border-radius: var(--dropdown-menu-border-radius);
|
|
88
|
+
box-shadow: var(--dropdown-menu-box-shadow);
|
|
89
|
+
|
|
90
|
+
@variant dark {
|
|
91
|
+
background-color: var(--dropdown-menu-bg-dark) !important;
|
|
92
|
+
border: var(--dropdown-menu-border-dark);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.dropup:has(&),
|
|
96
|
+
.dropright:has(&),
|
|
97
|
+
.dropdown:has(&),
|
|
98
|
+
.dropleft:has(&) {
|
|
99
|
+
position: relative;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&[x-placement^="top"],
|
|
103
|
+
&[x-placement^="right"],
|
|
104
|
+
&[x-placement^="bottom"],
|
|
105
|
+
&[x-placement^="left"] {
|
|
106
|
+
right: auto;
|
|
107
|
+
bottom: auto;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.dropdown-item,
|
|
111
|
+
& > :not(hr, .dropdown-header, .dropdown-item-text, .dropdown-item-plain, .dropdown-divider) {
|
|
112
|
+
display: var(--dropdown-menu-item-display);
|
|
113
|
+
width: var(--dropdown-menu-item-width);
|
|
114
|
+
padding: var(--dropdown-menu-item-padding);
|
|
115
|
+
clear: both;
|
|
116
|
+
font-weight: var(--dropdown-menu-item-font-weight);
|
|
117
|
+
color: var(--dropdown-menu-item-color);
|
|
118
|
+
text-align: var(--dropdown-menu-item-text-align);
|
|
119
|
+
text-decoration: var(--dropdown-menu-text-decoration);
|
|
120
|
+
white-space: var(--dropdown-menu-white-space);
|
|
121
|
+
background-color: var(--dropdown-menu-item-bg);
|
|
122
|
+
border: var(--dropdown-menu-item-border);
|
|
123
|
+
|
|
124
|
+
@variant dark {
|
|
125
|
+
color: var(--dropdown-menu-item-color-dark);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:hover,
|
|
129
|
+
&:focus {
|
|
130
|
+
color: var(--dropdown-menu-item-hover-color);
|
|
131
|
+
background-color: var(--dropdown-menu-item-hover-bg);
|
|
132
|
+
text-decoration: var(--dropdown-menu-text-decoration);
|
|
133
|
+
|
|
134
|
+
@variant dark {
|
|
135
|
+
color: var(--dropdown-menu-item-hover-color-dark);
|
|
136
|
+
background-color: var(--dropdown-menu-item-hover-bg-dark);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&.active,
|
|
141
|
+
&:active {
|
|
142
|
+
color: var(--dropdown-menu-item-active-color);
|
|
143
|
+
background-color: var(--dropdown-menu-item-active-bg);
|
|
144
|
+
text-decoration: var(--dropdown-menu-text-decoration);
|
|
145
|
+
|
|
146
|
+
@variant dark {
|
|
147
|
+
color: var(--dropdown-menu-item-active-color-dark);
|
|
148
|
+
background-color: var(--dropdown-menu-item-active-bg-dark);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.disabled,
|
|
153
|
+
&:disabled {
|
|
154
|
+
color: var(--dropdown-menu-item-disabled-color);
|
|
155
|
+
pointer-events: var(--dropdown-menu-item-disabled-pointer-events);
|
|
156
|
+
background-color: var(--dropdown-menu-item-disabled-bg);
|
|
157
|
+
background-image: none;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.dropdown-item sub, .dropdown-item sup {
|
|
162
|
+
line-height: inherit;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.dropdown-header,
|
|
166
|
+
& > h1,
|
|
167
|
+
& > h2,
|
|
168
|
+
& > h3,
|
|
169
|
+
& > h4,
|
|
170
|
+
& > h5,
|
|
171
|
+
& > h6 {
|
|
172
|
+
display: block;
|
|
173
|
+
padding: var(--dropdown-menu-header-padding);
|
|
174
|
+
margin-bottom: 0;
|
|
175
|
+
font-size: var(--dropdown-menu-header-font-size);
|
|
176
|
+
font-weight: var(--dropdown-menu-header-font-weight);
|
|
177
|
+
color: var(--dropdown-menu-header-color);
|
|
178
|
+
white-space: var(--dropdown-menu-white-space);
|
|
179
|
+
|
|
180
|
+
@variant dark {
|
|
181
|
+
color: var(--dropdown-menu-header-color-dark);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.dropdown-divider,
|
|
186
|
+
& > hr {
|
|
187
|
+
height: 0;
|
|
188
|
+
margin: var(--dropdown-menu-divider-margin);
|
|
189
|
+
overflow: var(--dropdown-menu-divider-overflow);
|
|
190
|
+
border-top: var(--dropdown-menu-divider-border-top);
|
|
191
|
+
|
|
192
|
+
@variant dark {
|
|
193
|
+
border-top: var(--dropdown-menu-divider-border-top-dark);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.dropdown-item-text {
|
|
198
|
+
display: block;
|
|
199
|
+
padding: var(--dropdown-menu-text-padding);
|
|
200
|
+
color: var(--dropdown-menu-text-color);
|
|
201
|
+
|
|
202
|
+
@variant dark {
|
|
203
|
+
color: var(--dropdown-menu-text-color-dark);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&.show {
|
|
208
|
+
display: var(--dropdown-menu-show-display);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
&.dropdown-menu-left {
|
|
212
|
+
right: var(--dropdown-menu-left-right);
|
|
213
|
+
left: var(--dropdown-menu-left-left);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&.dropdown-menu-right {
|
|
217
|
+
right: var(--dropdown-menu-right-right);
|
|
218
|
+
left: var(--dropdown-menu-right-left);
|
|
219
|
+
}
|
|
220
|
+
}
|
package/package.json
CHANGED
|
@@ -1,77 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-interface/dropdown-menu",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "A Vue dropdown menu component.",
|
|
5
|
-
"files": [
|
|
6
|
-
"dist",
|
|
7
|
-
"tailwindcss"
|
|
8
|
-
],
|
|
9
5
|
"type": "module",
|
|
10
6
|
"main": "./dist/dropdown-menu.umd.cjs",
|
|
11
7
|
"module": "./dist/dropdown-menu.js",
|
|
12
8
|
"types": "./dist/index.d.ts",
|
|
13
9
|
"exports": {
|
|
14
10
|
".": {
|
|
11
|
+
"source": "./index.ts",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
15
13
|
"import": "./dist/dropdown-menu.js",
|
|
16
|
-
"require": "./dist/dropdown-menu.umd.
|
|
17
|
-
"types": "./dist/index.d.ts"
|
|
14
|
+
"require": "./dist/dropdown-menu.umd.js"
|
|
18
15
|
},
|
|
19
|
-
"./
|
|
20
|
-
"./tailwindcss/safelist": "./tailwindcss/safelist.cjs"
|
|
16
|
+
"./css": "./demo.css"
|
|
21
17
|
},
|
|
22
18
|
"browserslist": "last 2 versions, > 0.5%, ie >= 11",
|
|
23
|
-
"scripts": {
|
|
24
|
-
"dev": "vite",
|
|
25
|
-
"build": "vite build",
|
|
26
|
-
"preview": "vite preview",
|
|
27
|
-
"pre-release": "npm run build; git add . -A; git commit -m 'pre-release commit'",
|
|
28
|
-
"release-patch": "npm run pre-release && npm version patch -m \"%s\" && npm run release;",
|
|
29
|
-
"release-minor": "npm run pre-release && npm version minor -m \"%s\" && npm run release;",
|
|
30
|
-
"release-major": "npm run pre-release && npm version major -m \"%s\" && npm run release;",
|
|
31
|
-
"release": "git add . -A; git commit; git push --tags origin; npm publish;"
|
|
32
|
-
},
|
|
33
19
|
"repository": {
|
|
34
20
|
"type": "git",
|
|
35
|
-
"url": "git+https://github.com/vue-interface/
|
|
21
|
+
"url": "git+https://github.com/vue-interface/vue-interface.github.io"
|
|
36
22
|
},
|
|
37
23
|
"keywords": [
|
|
38
|
-
"
|
|
39
|
-
"
|
|
24
|
+
"Button",
|
|
25
|
+
"Control",
|
|
40
26
|
"Vue",
|
|
41
|
-
"Component",
|
|
42
27
|
"Tailwind",
|
|
43
28
|
"Bootstrap"
|
|
44
29
|
],
|
|
45
30
|
"author": "Justin Kimbrell",
|
|
46
|
-
"license": "
|
|
31
|
+
"license": "MIT",
|
|
47
32
|
"bugs": {
|
|
48
|
-
"url": "https://github.com/vue-interface/
|
|
49
|
-
},
|
|
50
|
-
"homepage": "https://github.com/vue-interface/dropdown-menu",
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"@vue-interface/variant": "^2.0.0-beta.0",
|
|
53
|
-
"color": "^4.2.0"
|
|
33
|
+
"url": "https://github.com/vue-interface/vue-interface.github.io"
|
|
54
34
|
},
|
|
35
|
+
"homepage": "https://github.com/vue-interface/vue-interface",
|
|
36
|
+
"readme": "README.md",
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"index.css",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE"
|
|
42
|
+
],
|
|
55
43
|
"peerDependencies": {
|
|
56
|
-
"vue": "^3.
|
|
44
|
+
"vue": "^3.3.4"
|
|
57
45
|
},
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"autoprefixer": "^10.4.2",
|
|
63
|
-
"babel-eslint": "^10.1.0",
|
|
64
|
-
"babel-preset-vue": "^2.0.2",
|
|
65
|
-
"change-case": "^4.1.2",
|
|
66
|
-
"eslint": "^8.25.0",
|
|
67
|
-
"eslint-plugin-vue": "^9.6.0",
|
|
68
|
-
"pascalcase": "^2.0.0",
|
|
69
|
-
"postcss": "^8.4.6",
|
|
70
|
-
"tailwindcss": "^3.1.0",
|
|
71
|
-
"ts-vue": "^0.1.0",
|
|
72
|
-
"typescript": "^4.9.4",
|
|
73
|
-
"vite": "^4.0.0",
|
|
74
|
-
"vite-plugin-dts": "^1.7.1",
|
|
75
|
-
"vue": "^3.2.41"
|
|
46
|
+
"scripts": {
|
|
47
|
+
"dev": "vite",
|
|
48
|
+
"build": "vue-tsc && vite build",
|
|
49
|
+
"preview": "vite preview"
|
|
76
50
|
}
|
|
77
|
-
}
|
|
51
|
+
}
|
package/tailwindcss/index.cjs
DELETED
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
const Color = require('color');
|
|
2
|
-
const plugin = require('tailwindcss/plugin');
|
|
3
|
-
const colors = require('tailwindcss/colors');
|
|
4
|
-
const variations = require('@vue-interface/variant/tailwindcss/variations');
|
|
5
|
-
|
|
6
|
-
module.exports = plugin(function({ addComponents, theme }) {
|
|
7
|
-
const component = {
|
|
8
|
-
// ':root': {
|
|
9
|
-
// '--dropdown-menu-z-index': theme('dropdownMenu.zIndex'),
|
|
10
|
-
// '--dropdown-menu-min-width': theme('dropdownMenu.minWidth'),
|
|
11
|
-
// '--dropdown-menu-padding-y': theme('dropdownMenu.paddingY'),
|
|
12
|
-
// '--dropdown-menu-spacer': theme('dropdownMenu.spacer'),
|
|
13
|
-
// '--dropdown-menu-font-size': theme('dropdownMenu.fontSize'),
|
|
14
|
-
// '--dropdown-menu-color': theme('dropdownMenu.color'),
|
|
15
|
-
// '--dropdown-menu-background-color': theme('dropdownMenu.backgroundColor'),
|
|
16
|
-
// '--dropdown-menu-border-color': theme('dropdownMenu.borderColor'),
|
|
17
|
-
// '--dropdown-menu-border-radius': theme('dropdownMenu.borderRadius'),
|
|
18
|
-
// '--dropdown-menu-border-width': theme('dropdownMenu.borderWidth'),
|
|
19
|
-
// '--dropdown-menu-box-shadow': theme('dropdownMenu.boxShadow'),
|
|
20
|
-
|
|
21
|
-
// '--dropdown-menu-inner-border-radius': theme('dropdownMenu.inner.borderRadius'),
|
|
22
|
-
|
|
23
|
-
// '--dropdown-menu-divider-background-color': theme('dropdownMenu.divider.backgroundColor'),
|
|
24
|
-
|
|
25
|
-
// '--dropdown-menu-link-color': theme('dropdownMenu.link.color'),
|
|
26
|
-
|
|
27
|
-
// '--dropdown-menu-link-hover-color': theme('dropdownMenu.link.hover.color'),
|
|
28
|
-
// '--dropdown-menu-link-hover-background-color': theme('dropdownMenu.link.hover.backgroundColor'),
|
|
29
|
-
|
|
30
|
-
// '--dropdown-menu-link-active-color': theme('dropdownMenu.link.active.color'),
|
|
31
|
-
// '--dropdown-menu-link-active-background-color': theme('dropdownMenu.link.active.backgroundColor'),
|
|
32
|
-
|
|
33
|
-
// '--dropdown-menu-link-disabled-color': theme('dropdownMenu.link.disabled.color'),
|
|
34
|
-
|
|
35
|
-
// '--dropdown-menu-item-padding-x': theme('dropdownMenu.item.paddingX'),
|
|
36
|
-
|
|
37
|
-
// '--dropdown-menu-header-color': theme('dropdownMenu.header.color'),
|
|
38
|
-
// '--dropdown-menu-header-padding-y': theme('dropdownMenu.header.paddingY')
|
|
39
|
-
// },
|
|
40
|
-
|
|
41
|
-
// The dropdown wrapper (`<div>`)
|
|
42
|
-
'.dropup, .dropright, .dropdown, .dropleft': {
|
|
43
|
-
position: 'relative'
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
'.dropdown-toggle': {
|
|
47
|
-
whiteSpace: 'nowrap',
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
'.dropdown-toggle::after': theme('dropdownMenu.enableCarets') ? {
|
|
51
|
-
display: 'inline-block',
|
|
52
|
-
marginLeft: '.3em',
|
|
53
|
-
verticalAlign: 'calc(.3em * .85)',
|
|
54
|
-
content: '""',
|
|
55
|
-
borderTop: '.3em solid',
|
|
56
|
-
borderRight: '.3em solid transparent',
|
|
57
|
-
borderBottom: 0,
|
|
58
|
-
borderLeft: '.3em solid transparent'
|
|
59
|
-
} : undefined,
|
|
60
|
-
|
|
61
|
-
// The dropdown menu
|
|
62
|
-
'.dropdown-menu': {
|
|
63
|
-
position: 'absolute',
|
|
64
|
-
top: '100%',
|
|
65
|
-
left: 0,
|
|
66
|
-
zIndex: theme('dropdownMenu.zIndex'),
|
|
67
|
-
display: 'none', // none by default, but block on "open" of the menu
|
|
68
|
-
minWidth: theme('dropdownMenu.minWidth'),
|
|
69
|
-
padding: `${theme('dropdownMenu.paddingY')} 0`,
|
|
70
|
-
// margin: `${theme('dropdownMenu.spacer')} 0 0`, // override default ul
|
|
71
|
-
fontSize: theme('dropdownMenu.fontSize'),
|
|
72
|
-
color: theme('dropdownMenu.color'),
|
|
73
|
-
textAlign: 'left', // Ensures proper alignment if parent has it changed (e.g., modal footer)
|
|
74
|
-
listStyle: 'none',
|
|
75
|
-
backgroundColor: theme('dropdownMenu.backgroundColor'),
|
|
76
|
-
backgroundClip: 'padding-box',
|
|
77
|
-
border: `${theme('dropdownMenu.borderWidth')} solid ${theme('dropdownMenu.borderColor')}`,
|
|
78
|
-
borderRadius: `${theme('dropdownMenu.borderRadius')}`,
|
|
79
|
-
boxShadow: theme('dropdownMenu.enableShadows') ? theme('dropdownMenu.boxShadow') : undefined,
|
|
80
|
-
|
|
81
|
-
// When enabled Popper.js, reset basic dropdown position
|
|
82
|
-
// stylelint-disable-next-line no-duplicate-selectors
|
|
83
|
-
'&[x-placement^="top"], &[x-placement^="right"], &[x-placement^="bottom"], &[x-placement^="left"]': {
|
|
84
|
-
right: 'auto',
|
|
85
|
-
bottom: 'auto'
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
// Allow for dropdowns to go bottom up (aka, dropup-menu)
|
|
90
|
-
// Just add .dropup after the standard .dropdown class and you're set.
|
|
91
|
-
'.dropup .dropdown-menu': {
|
|
92
|
-
top: 'auto',
|
|
93
|
-
bottom: '100%',
|
|
94
|
-
marginTop: 0,
|
|
95
|
-
// marginBottom: theme('dropdownMenu.spacer')
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
'.dropup .dropdown-toggle::after': theme('dropdownMenu.enableCarets') ? {
|
|
99
|
-
display: 'inline-block',
|
|
100
|
-
marginLeft: '.3em',
|
|
101
|
-
verticalAlign: 'calc(.3em * .85)',
|
|
102
|
-
content: '""',
|
|
103
|
-
borderTop: 0,
|
|
104
|
-
borderRight: '.3em solid transparent',
|
|
105
|
-
borderBottom: '.3em solid',
|
|
106
|
-
borderLeft: '.3em solid transparent'
|
|
107
|
-
} : undefined,
|
|
108
|
-
|
|
109
|
-
'.dropright .dropdown-menu': {
|
|
110
|
-
top: 0,
|
|
111
|
-
right: 'auto',
|
|
112
|
-
left: '100%',
|
|
113
|
-
marginTop: 0,
|
|
114
|
-
// marginLeft: theme('dropdownMenu.spacer')
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
'.dropright .dropdown-toggle::after': theme('dropdownMenu.enableCarets') ? {
|
|
118
|
-
display: 'inline-block',
|
|
119
|
-
marginLeft: '.3em',
|
|
120
|
-
verticalAlign: 'calc(.3em * .85)',
|
|
121
|
-
content: '""',
|
|
122
|
-
borderTop: '.3em solid transparent',
|
|
123
|
-
borderRight: 0,
|
|
124
|
-
borderBottom: '.3em solid transparent',
|
|
125
|
-
borderLeft: '.3em solid',
|
|
126
|
-
verticalAlign: 0
|
|
127
|
-
} : undefined,
|
|
128
|
-
|
|
129
|
-
'.dropleft .dropdown-menu': {
|
|
130
|
-
top: 0,
|
|
131
|
-
right: '100%',
|
|
132
|
-
left: 'auto',
|
|
133
|
-
marginTop: 0,
|
|
134
|
-
// marginRight: theme('dropdownMenu.spacer')
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
'.dropleft .dropdown-toggle::after': {
|
|
138
|
-
display: 'none'
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
'.dropleft .dropdown-toggle::before': {
|
|
142
|
-
display: 'inline-block',
|
|
143
|
-
marginRight: '.3em',
|
|
144
|
-
verticalAlign: 'calc(.3em * .85)',
|
|
145
|
-
content: '""',
|
|
146
|
-
borderTop: '.3em solid transparent',
|
|
147
|
-
borderLeft: 0,
|
|
148
|
-
borderBottom: '.3em solid transparent',
|
|
149
|
-
borderRight: '.3em solid',
|
|
150
|
-
verticalAlign: 0
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
// Dividers (basically an `<hr>`) within the dropdown
|
|
154
|
-
'.dropdown-divider': {
|
|
155
|
-
height: 0,
|
|
156
|
-
margin: `calc(${theme('dropdownMenu.spacer')} / 2) 0`,
|
|
157
|
-
overflow: 'hidden',
|
|
158
|
-
borderTop: `1px solid ${theme('dropdownMenu.divider.backgroundColor')}`,
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
// Links, buttons, and more within the dropdown menu
|
|
162
|
-
//
|
|
163
|
-
// `<button>`-specific styles are denoted with `// For <button>s`
|
|
164
|
-
'.dropdown-item': {
|
|
165
|
-
display: 'block',
|
|
166
|
-
width: '100%', // For `<button>`s
|
|
167
|
-
padding: `${theme('dropdownMenu.item.paddingY')} ${theme('dropdownMenu.item.paddingX')}`,
|
|
168
|
-
clear: 'both',
|
|
169
|
-
fontWeight: 'normal',
|
|
170
|
-
color: theme('dropdownMenu.link.color'),
|
|
171
|
-
textAlign: 'inherit', // For `<button>`s
|
|
172
|
-
textDecoration: 'none',
|
|
173
|
-
whiteSpace: 'nowrap', // prevent links from randomly breaking onto new lines
|
|
174
|
-
backgroundColor: 'transparent', // For `<button>`s
|
|
175
|
-
border: 0, // For `<button>`s
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
'.dropdown-item:hover, .dropdown-item:focus': {
|
|
179
|
-
color: theme('dropdownMenu.link.hover.color'),
|
|
180
|
-
textDecoration: 'none',
|
|
181
|
-
backgroundColor: theme('dropdownMenu.link.hover.backgroundColor')
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
'.dropdown-item.active, .dropdown-item:active': {
|
|
185
|
-
color: theme('dropdownMenu.link.active.color'),
|
|
186
|
-
textDecoration: 'none',
|
|
187
|
-
backgroundColor: theme('dropdownMenu.link.active.backgroundColor')
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
'.dropdown-item.disabled, .dropdown-item:disabled': {
|
|
191
|
-
color: theme('dropdownMenu.link.disabled.color'),
|
|
192
|
-
pointerEvents: 'none',
|
|
193
|
-
backgroundColor: 'transparent',
|
|
194
|
-
backgroundImage: 'none'
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
'.dropdown-menu.show': {
|
|
198
|
-
display: 'block'
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
// Dropdown section headers
|
|
202
|
-
'.dropdown-header': {
|
|
203
|
-
display: theme('dropdownMenu.header.display'),
|
|
204
|
-
padding: `${theme('dropdownMenu.header.paddingY')} ${theme('dropdownMenu.header.paddingX')}`,
|
|
205
|
-
marginBottom: 0, // for use with heading elements
|
|
206
|
-
fontSize: theme('dropdownMenu.header.fontSize'),
|
|
207
|
-
fontWeight: theme('dropdownMenu.header.fontWeight'),
|
|
208
|
-
color: theme('dropdownMenu.header.color'),
|
|
209
|
-
whiteSpace: 'nowrap' // as with > li > a
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
// Dropdown text
|
|
213
|
-
'.dropdown-item-text': {
|
|
214
|
-
display: theme('dropdownMenu.item.display'),
|
|
215
|
-
padding: `${theme('dropdownMenu.item.paddingY')} ${theme('dropdownMenu.item.paddingX')}`,
|
|
216
|
-
color: theme('dropdownMenu.link.color'),
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
'.dropdown-menu-left': {
|
|
220
|
-
right: 'auto',
|
|
221
|
-
left: 0
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
'.dropdown-menu-right': {
|
|
225
|
-
// right: 0,
|
|
226
|
-
left: 'auto'
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
if(theme('dropdownMenu.paddingY') === 0) {
|
|
231
|
-
component['.dropdown-item']['&:first-child'] = {
|
|
232
|
-
borderTopLeftRadius: theme('dropdownMenu.inner.borderRadius'),
|
|
233
|
-
borderTopRightRadius: theme('dropdownMenu.inner.borderRadius'),
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
component['.dropdown-item']['&:last-child'] = {
|
|
237
|
-
borderBottomLeftRadius: theme('dropdownMenu.inner.borderRadius'),
|
|
238
|
-
borderBottomRightRadius: theme('dropdownMenu.inner.borderRadius'),
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
addComponents(component);
|
|
243
|
-
}, {
|
|
244
|
-
theme: {
|
|
245
|
-
dropdownMenu: theme => ({
|
|
246
|
-
enableShadows: true,
|
|
247
|
-
enableCarets: true,
|
|
248
|
-
zIndex: 1000,
|
|
249
|
-
minWidth: '10rem',
|
|
250
|
-
paddingY: '.5rem',
|
|
251
|
-
spacer: '.125rem',
|
|
252
|
-
fontSize: '1rem',
|
|
253
|
-
color: 'inherit',
|
|
254
|
-
backgroundColor: theme('colors.white', colors.white),
|
|
255
|
-
borderColor: Color(theme('colors.black', colors.black)).fade(.85),
|
|
256
|
-
borderRadius: '.25rem',
|
|
257
|
-
borderWidth: '1px',
|
|
258
|
-
boxShadow: `0 .5rem 1rem ${Color(theme('colors.black', colors.black)).fade(.85)}`,
|
|
259
|
-
|
|
260
|
-
inner: {
|
|
261
|
-
borderRadius: 'calc(.25rem - 1px)'
|
|
262
|
-
},
|
|
263
|
-
|
|
264
|
-
divider: {
|
|
265
|
-
backgroundColor: theme('colors.gray.100', colors.gray[100]),
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
link: {
|
|
269
|
-
color: theme('colors.gray.800', colors.gray[800]),
|
|
270
|
-
|
|
271
|
-
hover: {
|
|
272
|
-
color: Color(theme('colors.gray.800', colors.gray[800])).darken(.5).hex(),
|
|
273
|
-
backgroundColor: theme('colors.gray.100', colors.gray[100])
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
active: {
|
|
277
|
-
color: theme('colors.white', colors.white),
|
|
278
|
-
backgroundColor: theme('variations.primary', variations.primary),
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
disabled: {
|
|
282
|
-
color: theme('colors.gray.500', colors.gray[500])
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
|
|
286
|
-
item: {
|
|
287
|
-
display: 'block',
|
|
288
|
-
paddingY: '.25rem',
|
|
289
|
-
paddingX: '1rem',
|
|
290
|
-
},
|
|
291
|
-
|
|
292
|
-
header: {
|
|
293
|
-
color: theme('colors.gray.500', colors.gray[500]),
|
|
294
|
-
display: 'block',
|
|
295
|
-
fontSize: '.875rem',
|
|
296
|
-
fontWeight: 'bold',
|
|
297
|
-
paddingX: '.5rem',
|
|
298
|
-
paddingY: '.5rem'
|
|
299
|
-
}
|
|
300
|
-
})
|
|
301
|
-
}
|
|
302
|
-
});
|
package/tailwindcss/safelist.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = () => ([
|
|
2
|
-
'dropdown-divider',
|
|
3
|
-
'dropdown-header',
|
|
4
|
-
'dropdown-item',
|
|
5
|
-
'dropdown-item-text',
|
|
6
|
-
'dropdown-menu',
|
|
7
|
-
'dropdown-menu-left',
|
|
8
|
-
'dropdown-menu-right',
|
|
9
|
-
'dropdown-toggle',
|
|
10
|
-
'dropdown-toggle-split',
|
|
11
|
-
'dropup',
|
|
12
|
-
'dropdown',
|
|
13
|
-
'dropright',
|
|
14
|
-
'dropleft',
|
|
15
|
-
]);
|