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