@vue-interface/dropdown-menu 0.9.7 → 1.0.2
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/dropdown-menu.es.js +144 -0
- package/dist/dropdown-menu.umd.js +1 -0
- package/{public → dist}/favicon.ico +0 -0
- package/package.json +28 -19
- package/.eslintrc.js +0 -53
- package/babel.config.js +0 -7
- package/dist/DropdownMenu.common.js +0 -2928
- package/dist/DropdownMenu.common.js.map +0 -1
- package/dist/DropdownMenu.css +0 -1
- package/dist/DropdownMenu.umd.js +0 -2938
- package/dist/DropdownMenu.umd.js.map +0 -1
- package/dist/DropdownMenu.umd.min.js +0 -2
- package/dist/DropdownMenu.umd.min.js.map +0 -1
- package/dist/demo.html +0 -19
- package/docs/.vuepress/config.js +0 -44
- package/docs/.vuepress/dist/404.html +0 -19
- package/docs/.vuepress/dist/assets/css/0.styles.275ee968.css +0 -1
- package/docs/.vuepress/dist/assets/img/search.83621669.svg +0 -1
- package/docs/.vuepress/dist/assets/js/10.5d93d289.js +0 -1
- package/docs/.vuepress/dist/assets/js/11.97ab3884.js +0 -1
- package/docs/.vuepress/dist/assets/js/2.f3d148c3.js +0 -1
- package/docs/.vuepress/dist/assets/js/3.81681fff.js +0 -1
- package/docs/.vuepress/dist/assets/js/4.82fa7382.js +0 -1
- package/docs/.vuepress/dist/assets/js/5.3dae6ad4.js +0 -1
- package/docs/.vuepress/dist/assets/js/6.6a04f815.js +0 -1
- package/docs/.vuepress/dist/assets/js/7.c033cb49.js +0 -1
- package/docs/.vuepress/dist/assets/js/8.6d6eb599.js +0 -1
- package/docs/.vuepress/dist/assets/js/9.eaefe866.js +0 -1
- package/docs/.vuepress/dist/assets/js/app.7ed065d3.js +0 -13
- package/docs/.vuepress/dist/examples/index.html +0 -21
- package/docs/.vuepress/dist/examples/test.html +0 -17
- package/docs/.vuepress/dist/index.html +0 -53
- package/docs/.vuepress/dist/options.html +0 -41
- package/docs/.vuepress/dist/tailwindcss.html +0 -85
- package/docs/README.md +0 -17
- package/docs/examples/README.md +0 -3
- package/docs/options.md +0 -44
- package/index.html +0 -61
- package/index.js +0 -2
- package/main.vue +0 -5
- package/postcss.config.js +0 -1
- package/public/index.html +0 -17
- package/src/DropdownMenu.vue +0 -54
- package/src/DropdownMenuItems.vue +0 -68
- package/src/css/DropdownMenu.css +0 -1
- package/tailwind.config.js +0 -12
- package/tailwindcss/index.js +0 -301
- package/vue.config.js +0 -11
package/tailwindcss/index.js
DELETED
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
const Color = require('color');
|
|
2
|
-
const rgba = require('hex-to-rgba');
|
|
3
|
-
const plugin = require('tailwindcss/plugin');
|
|
4
|
-
const { colors } = require('tailwindcss/defaultTheme');
|
|
5
|
-
const defaultVariations = require('@vue-interface/variant/tailwindcss/defaultVariations');
|
|
6
|
-
|
|
7
|
-
function darken(color, ...args) {
|
|
8
|
-
return Color(color).darken(...args).hex();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = plugin(function({ addComponents, theme, postcss }) {
|
|
12
|
-
const component = {
|
|
13
|
-
':root': {
|
|
14
|
-
'--dropdown-menu-z-index': theme('dropdownMenu.zIndex'),
|
|
15
|
-
'--dropdown-menu-min-width': theme('dropdownMenu.minWidth'),
|
|
16
|
-
'--dropdown-menu-padding-y': theme('dropdownMenu.paddingY'),
|
|
17
|
-
'--dropdown-menu-spacer': theme('dropdownMenu.spacer'),
|
|
18
|
-
'--dropdown-menu-font-size': theme('dropdownMenu.fontSize'),
|
|
19
|
-
'--dropdown-menu-color': theme('dropdownMenu.color'),
|
|
20
|
-
'--dropdown-menu-background-color': theme('dropdownMenu.backgroundColor'),
|
|
21
|
-
'--dropdown-menu-border-color': theme('dropdownMenu.borderColor'),
|
|
22
|
-
'--dropdown-menu-border-radius': theme('dropdownMenu.borderRadius'),
|
|
23
|
-
'--dropdown-menu-border-width': theme('dropdownMenu.borderWidth'),
|
|
24
|
-
'--dropdown-menu-box-shadow': theme('dropdownMenu.boxShadow'),
|
|
25
|
-
|
|
26
|
-
'--dropdown-menu-inner-border-radius': theme('dropdownMenu.inner.borderRadius'),
|
|
27
|
-
|
|
28
|
-
'--dropdown-menu-divider-background-color': theme('dropdownMenu.divider.backgroundColor'),
|
|
29
|
-
|
|
30
|
-
'--dropdown-menu-link-color': theme('dropdownMenu.link.color'),
|
|
31
|
-
|
|
32
|
-
'--dropdown-menu-link-hover-color': theme('dropdownMenu.link.hover.color'),
|
|
33
|
-
'--dropdown-menu-link-hover-background-color': theme('dropdownMenu.link.hover.backgroundColor'),
|
|
34
|
-
|
|
35
|
-
'--dropdown-menu-link-active-color': theme('dropdownMenu.link.active.color'),
|
|
36
|
-
'--dropdown-menu-link-active-background-color': theme('dropdownMenu.link.active.backgroundColor'),
|
|
37
|
-
|
|
38
|
-
'--dropdown-menu-link-disabled-color': theme('dropdownMenu.link.disabled.color'),
|
|
39
|
-
|
|
40
|
-
'--dropdown-menu-item-padding-x': theme('dropdownMenu.item.paddingX'),
|
|
41
|
-
|
|
42
|
-
'--dropdown-menu-header-color': theme('dropdownMenu.header.color'),
|
|
43
|
-
'--dropdown-menu-header-padding-y': theme('dropdownMenu.header.paddingY')
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
// The dropdown wrapper (`<div>`)
|
|
47
|
-
'.dropup, .dropright, .dropdown, .dropleft': {
|
|
48
|
-
position: 'relative'
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
'.dropdown-toggle': {
|
|
52
|
-
whiteSpace: 'nowrap',
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
'.dropdown-toggle::after': theme('dropdownMenu.enableCarets') ? {
|
|
56
|
-
display: 'inline-block',
|
|
57
|
-
marginLeft: '.3em',
|
|
58
|
-
verticalAlign: 'calc(.3em * .85)',
|
|
59
|
-
content: '""',
|
|
60
|
-
borderTop: '.3em solid',
|
|
61
|
-
borderRight: '.3em solid transparent',
|
|
62
|
-
borderBottom: 0,
|
|
63
|
-
borderLeft: '.3em solid transparent'
|
|
64
|
-
} : undefined,
|
|
65
|
-
|
|
66
|
-
// The dropdown menu
|
|
67
|
-
'.dropdown-menu': {
|
|
68
|
-
position: 'absolute',
|
|
69
|
-
top: '100%',
|
|
70
|
-
left: 0,
|
|
71
|
-
zIndex: theme('dropdownMenu.zIndex'),
|
|
72
|
-
display: 'none', // none by default, but block on "open" of the menu
|
|
73
|
-
minWidth: theme('dropdownMenu.minWidth'),
|
|
74
|
-
padding: `${theme('dropdownMenu.paddingY')} 0`,
|
|
75
|
-
margin: `${theme('dropdownMenu.spacer')} 0 0`, // override default ul
|
|
76
|
-
fontSize: theme('dropdownMenu.fontSize'),
|
|
77
|
-
color: theme('dropdownMenu.color'),
|
|
78
|
-
textAlign: 'left', // Ensures proper alignment if parent has it changed (e.g., modal footer)
|
|
79
|
-
listStyle: 'none',
|
|
80
|
-
backgroundColor: theme('dropdownMenu.backgroundColor'),
|
|
81
|
-
backgroundClip: 'padding-box',
|
|
82
|
-
border: `${theme('dropdownMenu.borderWidth')} solid ${theme('dropdownMenu.borderColor')}`,
|
|
83
|
-
borderRadius: `${theme('dropdownMenu.borderRadius')}`,
|
|
84
|
-
boxShadow: theme('dropdownMenu.enableShadows') ? theme('dropdownMenu.boxShadow') : undefined,
|
|
85
|
-
|
|
86
|
-
// When enabled Popper.js, reset basic dropdown position
|
|
87
|
-
// stylelint-disable-next-line no-duplicate-selectors
|
|
88
|
-
'&[x-placement^="top"], &[x-placement^="right"], &[x-placement^="bottom"], &[x-placement^="left"]': {
|
|
89
|
-
right: 'auto',
|
|
90
|
-
bottom: 'auto'
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
// Allow for dropdowns to go bottom up (aka, dropup-menu)
|
|
95
|
-
// Just add .dropup after the standard .dropdown class and you're set.
|
|
96
|
-
'.dropup .dropdown-menu': {
|
|
97
|
-
top: 'auto',
|
|
98
|
-
bottom: '100%',
|
|
99
|
-
marginTop: 0,
|
|
100
|
-
marginBottom: theme('dropdownMenu.spacer')
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
'.dropup .dropdown-toggle::after': theme('dropdownMenu.enableCarets') ? {
|
|
104
|
-
display: 'inline-block',
|
|
105
|
-
marginLeft: '.3em',
|
|
106
|
-
verticalAlign: 'calc(.3em * .85)',
|
|
107
|
-
content: '""',
|
|
108
|
-
borderTop: 0,
|
|
109
|
-
borderRight: '.3em solid transparent',
|
|
110
|
-
borderBottom: '.3em solid',
|
|
111
|
-
borderLeft: '.3em solid transparent'
|
|
112
|
-
} : undefined,
|
|
113
|
-
|
|
114
|
-
'.dropright .dropdown-menu': {
|
|
115
|
-
top: 0,
|
|
116
|
-
right: 'auto',
|
|
117
|
-
left: '100%',
|
|
118
|
-
marginTop: 0,
|
|
119
|
-
marginLeft: theme('dropdownMenu.spacer')
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
'.dropright .dropdown-toggle::after': theme('dropdownMenu.enableCarets') ? {
|
|
123
|
-
display: 'inline-block',
|
|
124
|
-
marginLeft: '.3em',
|
|
125
|
-
verticalAlign: 'calc(.3em * .85)',
|
|
126
|
-
content: '""',
|
|
127
|
-
borderTop: '.3em solid transparent',
|
|
128
|
-
borderRight: 0,
|
|
129
|
-
borderBottom: '.3em solid transparent',
|
|
130
|
-
borderLeft: '.3em solid',
|
|
131
|
-
verticalAlign: 0
|
|
132
|
-
} : undefined,
|
|
133
|
-
|
|
134
|
-
'.dropleft .dropdown-menu': {
|
|
135
|
-
top: 0,
|
|
136
|
-
right: '100%',
|
|
137
|
-
left: 'auto',
|
|
138
|
-
marginTop: 0,
|
|
139
|
-
marginRight: theme('dropdownMenu.spacer')
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
'.dropleft .dropdown-toggle::after': {
|
|
143
|
-
display: 'none'
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
'.dropleft .dropdown-toggle::before': {
|
|
147
|
-
display: 'inline-block',
|
|
148
|
-
marginRight: '.3em',
|
|
149
|
-
verticalAlign: 'calc(.3em * .85)',
|
|
150
|
-
content: '""',
|
|
151
|
-
borderTop: '.3em solid transparent',
|
|
152
|
-
borderLeft: 0,
|
|
153
|
-
borderBottom: '.3em solid transparent',
|
|
154
|
-
borderRight: '.3em solid',
|
|
155
|
-
verticalAlign: 0
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
// Dividers (basically an `<hr>`) within the dropdown
|
|
159
|
-
'.dropdown-divider': {
|
|
160
|
-
height: 0,
|
|
161
|
-
margin: `calc(${theme('dropdownMenu.spacer')} / 2) 0`,
|
|
162
|
-
overflow: 'hidden',
|
|
163
|
-
borderTop: `1px solid ${theme('dropdownMenu.divider.backgroundColor')}`,
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
// Links, buttons, and more within the dropdown menu
|
|
167
|
-
//
|
|
168
|
-
// `<button>`-specific styles are denoted with `// For <button>s`
|
|
169
|
-
'.dropdown-item': {
|
|
170
|
-
display: 'block',
|
|
171
|
-
width: '100%', // For `<button>`s
|
|
172
|
-
padding: `${theme('dropdownMenu.item.paddingY')} ${theme('dropdownMenu.item.paddingX')}`,
|
|
173
|
-
clear: 'both',
|
|
174
|
-
fontWeight: 'normal',
|
|
175
|
-
color: theme('dropdownMenu.link.color'),
|
|
176
|
-
textAlign: 'inherit', // For `<button>`s
|
|
177
|
-
textDecoration: 'none',
|
|
178
|
-
whiteSpace: 'nowrap', // prevent links from randomly breaking onto new lines
|
|
179
|
-
backgroundColor: 'transparent', // For `<button>`s
|
|
180
|
-
border: 0, // For `<button>`s
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
'.dropdown-item:hover, .dropdown-item:focus': {
|
|
184
|
-
color: theme('dropdownMenu.link.hover.color'),
|
|
185
|
-
textDecoration: 'none',
|
|
186
|
-
backgroundColor: theme('dropdownMenu.link.hover.backgroundColor')
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
'dropdown-item.active, dropdown-item:active': {
|
|
190
|
-
color: theme('dropdownMenu.link.active.color'),
|
|
191
|
-
textDecoration: 'none',
|
|
192
|
-
backgroundColor: theme('dropdownMenu.link.active.backgroundColor')
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
'dropdown-item.disabled, dropdown-item:disabled': {
|
|
196
|
-
color: theme('dropdownMenu.link.disabled.color'),
|
|
197
|
-
pointerEvents: 'none',
|
|
198
|
-
backgroundColor: 'transparent',
|
|
199
|
-
backgroundImage: 'none'
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
'.dropdown-menu.show': {
|
|
203
|
-
display: 'block'
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
// Dropdown section headers
|
|
207
|
-
'.dropdown-header': {
|
|
208
|
-
display: 'block',
|
|
209
|
-
padding: `${theme('dropdownMenu.paddingY')} ${theme('dropdownMenu.item.paddingX')}`,
|
|
210
|
-
marginBottom: 0, // for use with heading elements
|
|
211
|
-
fontSize: '.875rem',
|
|
212
|
-
color: theme('dropdownMenu.header.color'),
|
|
213
|
-
whiteSpace: 'nowrap' // as with > li > a
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
// Dropdown text
|
|
217
|
-
'.dropdown-item-text': {
|
|
218
|
-
display: 'block',
|
|
219
|
-
padding: `${theme('dropdownMenu.item.paddingY')} ${theme('dropdownMenu.item.paddingX')}`,
|
|
220
|
-
color: theme('dropdownMenu.link.color'),
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
'.dropdown-menu-left': {
|
|
224
|
-
right: 'auto',
|
|
225
|
-
left: 0
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
-
'.dropdown-menu-right': {
|
|
229
|
-
right: 0,
|
|
230
|
-
left: 'auto'
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
if(theme('dropdownMenu.paddingY') === 0) {
|
|
235
|
-
component['.dropdown-item']['&:first-child'] = {
|
|
236
|
-
borderTopLeftRadius: theme('dropdownMenu.inner.borderRadius'),
|
|
237
|
-
borderTopRightRadius: theme('dropdownMenu.inner.borderRadius'),
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
component['.dropdown-item']['&:last-child'] = {
|
|
241
|
-
borderBottomLeftRadius: theme('dropdownMenu.inner.borderRadius'),
|
|
242
|
-
borderBottomRightRadius: theme('dropdownMenu.inner.borderRadius'),
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
addComponents(component);
|
|
247
|
-
}, {
|
|
248
|
-
theme: {
|
|
249
|
-
dropdownMenu: theme => ({
|
|
250
|
-
enableShadows: true,
|
|
251
|
-
enableCarets: true,
|
|
252
|
-
zIndex: 1000,
|
|
253
|
-
minWidth: '10rem',
|
|
254
|
-
paddingY: '.5rem',
|
|
255
|
-
spacer: '.125rem',
|
|
256
|
-
fontSize: '1rem',
|
|
257
|
-
color: 'inherit',
|
|
258
|
-
backgroundColor: theme('colors.white', colors.white),
|
|
259
|
-
borderColor: rgba(theme('colors.black', colors.black), .15),
|
|
260
|
-
borderRadius: '.25rem',
|
|
261
|
-
borderWidth: '1px',
|
|
262
|
-
boxShadow: `0 .5rem 1rem ${rgba(theme('colors.black', colors.black), .15)}`,
|
|
263
|
-
|
|
264
|
-
inner: {
|
|
265
|
-
borderRadius: 'calc(.25rem - 1px)'
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
divider: {
|
|
269
|
-
backgroundColor: theme('colors.gray.100', colors.gray[100]),
|
|
270
|
-
},
|
|
271
|
-
|
|
272
|
-
link: {
|
|
273
|
-
color: theme('colors.gray.800', colors.gray[800]),
|
|
274
|
-
|
|
275
|
-
hover: {
|
|
276
|
-
color: darken(theme('colors.gray.800', colors.gray[800]), .5),
|
|
277
|
-
backgroundColor: theme('colors.gray.100', colors.gray[100])
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
active: {
|
|
281
|
-
color: theme('colors.white', colors.white),
|
|
282
|
-
backgroundColor: theme('variations.primary', defaultVariations.primary),
|
|
283
|
-
},
|
|
284
|
-
|
|
285
|
-
disabled: {
|
|
286
|
-
color: theme('colors.gray.500', colors.gray[500])
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
|
|
290
|
-
item: {
|
|
291
|
-
paddingY: '.25rem',
|
|
292
|
-
paddingX: '1rem',
|
|
293
|
-
},
|
|
294
|
-
|
|
295
|
-
header: {
|
|
296
|
-
color: theme('colors.gray.500', colors.gray[500]),
|
|
297
|
-
paddingY: '.5rem'
|
|
298
|
-
}
|
|
299
|
-
})
|
|
300
|
-
}
|
|
301
|
-
});
|