windly-ui 1.0.1 → 1.0.3
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/module.d.mts +3 -0
- package/dist/module.json +8 -0
- package/dist/module.mjs +26 -0
- package/dist/runtime/components/Accordion.d.vue.ts +39 -0
- package/{ui-library → dist/runtime}/components/Accordion.vue +44 -70
- package/dist/runtime/components/Accordion.vue.d.ts +39 -0
- package/dist/runtime/components/Avatar.d.vue.ts +141 -0
- package/dist/runtime/components/Avatar.vue +72 -0
- package/dist/runtime/components/Avatar.vue.d.ts +141 -0
- package/dist/runtime/components/Badge.d.vue.ts +133 -0
- package/dist/runtime/components/Badge.vue +99 -0
- package/dist/runtime/components/Badge.vue.d.ts +133 -0
- package/dist/runtime/components/Breadcrumbs.d.vue.ts +83 -0
- package/{ui-library → dist/runtime}/components/Breadcrumbs.vue +37 -59
- package/dist/runtime/components/Breadcrumbs.vue.d.ts +83 -0
- package/dist/runtime/components/Button.d.vue.ts +199 -0
- package/dist/runtime/components/Button.vue +125 -0
- package/dist/runtime/components/Button.vue.d.ts +199 -0
- package/dist/runtime/components/Card.d.vue.ts +83 -0
- package/{ui-library → dist/runtime}/components/Card.vue +26 -39
- package/dist/runtime/components/Card.vue.d.ts +83 -0
- package/dist/runtime/components/Checkbox.d.vue.ts +190 -0
- package/{ui-library → dist/runtime}/components/Checkbox.vue +45 -68
- package/dist/runtime/components/Checkbox.vue.d.ts +190 -0
- package/dist/runtime/components/CodeBlock.d.vue.ts +16 -0
- package/dist/runtime/components/CodeBlock.vue +75 -0
- package/dist/runtime/components/CodeBlock.vue.d.ts +16 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +91 -0
- package/dist/runtime/components/ColorPicker.vue +244 -0
- package/dist/runtime/components/ColorPicker.vue.d.ts +91 -0
- package/dist/runtime/components/Date.d.vue.ts +137 -0
- package/dist/runtime/components/Date.vue +201 -0
- package/dist/runtime/components/Date.vue.d.ts +137 -0
- package/dist/runtime/components/Dialog.d.vue.ts +103 -0
- package/{ui-library → dist/runtime}/components/Dialog.vue +30 -65
- package/dist/runtime/components/Dialog.vue.d.ts +103 -0
- package/dist/runtime/components/Divider.d.vue.ts +51 -0
- package/dist/runtime/components/Divider.vue +52 -0
- package/dist/runtime/components/Divider.vue.d.ts +51 -0
- package/dist/runtime/components/Drawer.d.vue.ts +30 -0
- package/dist/runtime/components/Drawer.vue +43 -0
- package/dist/runtime/components/Drawer.vue.d.ts +30 -0
- package/dist/runtime/components/Dropdown.d.vue.ts +34 -0
- package/dist/runtime/components/Dropdown.vue +127 -0
- package/dist/runtime/components/Dropdown.vue.d.ts +34 -0
- package/dist/runtime/components/FileUploader.d.vue.ts +58 -0
- package/dist/runtime/components/FileUploader.vue +202 -0
- package/dist/runtime/components/FileUploader.vue.d.ts +58 -0
- package/dist/runtime/components/Icon.d.vue.ts +41 -0
- package/dist/runtime/components/Icon.vue +66 -0
- package/dist/runtime/components/Icon.vue.d.ts +41 -0
- package/dist/runtime/components/Image.d.vue.ts +77 -0
- package/dist/runtime/components/Image.vue +61 -0
- package/dist/runtime/components/Image.vue.d.ts +77 -0
- package/dist/runtime/components/Input.d.vue.ts +66 -0
- package/dist/runtime/components/Input.vue +233 -0
- package/dist/runtime/components/Input.vue.d.ts +66 -0
- package/dist/runtime/components/Radio.d.vue.ts +41 -0
- package/dist/runtime/components/Radio.vue +222 -0
- package/dist/runtime/components/Radio.vue.d.ts +41 -0
- package/dist/runtime/components/ScrollArea.d.vue.ts +79 -0
- package/dist/runtime/components/ScrollArea.vue +36 -0
- package/dist/runtime/components/ScrollArea.vue.d.ts +79 -0
- package/dist/runtime/components/Select.d.vue.ts +43 -0
- package/dist/runtime/components/Select.vue +200 -0
- package/dist/runtime/components/Select.vue.d.ts +43 -0
- package/dist/runtime/components/Stepper.d.vue.ts +46 -0
- package/dist/runtime/components/Stepper.vue +218 -0
- package/dist/runtime/components/Stepper.vue.d.ts +46 -0
- package/dist/runtime/components/TabPanel.d.vue.ts +17 -0
- package/dist/runtime/components/TabPanel.vue +21 -0
- package/dist/runtime/components/TabPanel.vue.d.ts +17 -0
- package/dist/runtime/components/Table.d.vue.ts +40 -0
- package/dist/runtime/components/Table.vue +92 -0
- package/dist/runtime/components/Table.vue.d.ts +40 -0
- package/dist/runtime/components/Tabs.d.vue.ts +20 -0
- package/dist/runtime/components/Tabs.vue +62 -0
- package/dist/runtime/components/Tabs.vue.d.ts +20 -0
- package/dist/runtime/components/Textarea.d.vue.ts +208 -0
- package/dist/runtime/components/Textarea.vue +185 -0
- package/dist/runtime/components/Textarea.vue.d.ts +208 -0
- package/dist/runtime/components/Toggle.d.vue.ts +36 -0
- package/dist/runtime/components/Toggle.vue +173 -0
- package/dist/runtime/components/Toggle.vue.d.ts +36 -0
- package/dist/runtime/components/Tooltip.d.vue.ts +63 -0
- package/dist/runtime/components/Tooltip.vue +144 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +63 -0
- package/dist/runtime/components/uiProps.d.ts +38 -0
- package/{ui-library/components/uiProps.ts → dist/runtime/components/uiProps.js} +2 -2
- package/dist/runtime/components/useUiClasses.d.ts +43 -0
- package/{ui-library/components/useUiClasses.ts → dist/runtime/components/useUiClasses.js} +25 -60
- package/dist/runtime/composables/plugin.d.ts +2 -0
- package/dist/runtime/composables/plugin.js +3 -0
- package/dist/runtime/tailwind-color.d.ts +2 -0
- package/dist/runtime/tailwind-color.js +5859 -0
- package/dist/types.d.mts +7 -0
- package/package.json +14 -16
- package/README.md +0 -208
- package/ui-library/components/Avatar.vue +0 -121
- package/ui-library/components/Badge.vue +0 -116
- package/ui-library/components/Button.vue +0 -154
- package/ui-library/components/CodeBlock.vue +0 -99
- package/ui-library/components/ColorPicker.vue +0 -302
- package/ui-library/components/Date.vue +0 -240
- package/ui-library/components/Divider.vue +0 -78
- package/ui-library/components/Drawer.vue +0 -67
- package/ui-library/components/Dropdown.vue +0 -248
- package/ui-library/components/FileUploader.vue +0 -330
- package/ui-library/components/Icon.vue +0 -82
- package/ui-library/components/Image.vue +0 -78
- package/ui-library/components/Input.vue +0 -531
- package/ui-library/components/Radio.vue +0 -356
- package/ui-library/components/ScrollArea.vue +0 -43
- package/ui-library/components/Select.vue +0 -309
- package/ui-library/components/Stepper.vue +0 -361
- package/ui-library/components/TabPanel.vue +0 -25
- package/ui-library/components/Table.vue +0 -152
- package/ui-library/components/Tabs.vue +0 -71
- package/ui-library/components/Textarea.vue +0 -233
- package/ui-library/components/Toggle.vue +0 -319
- package/ui-library/components/Tooltip.vue +0 -200
- package/ui-library/components/plugin.ts +0 -8
- package/ui-library/module.ts +0 -20
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineOptions({
|
|
3
|
-
name: 'UITooltip',
|
|
4
|
-
inheritAttrs: false,
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
import { computed, ref } from 'vue'
|
|
8
|
-
|
|
9
|
-
type TooltipPlacement =
|
|
10
|
-
| 'top'
|
|
11
|
-
| 'right'
|
|
12
|
-
| 'bottom'
|
|
13
|
-
| 'left'
|
|
14
|
-
|
|
15
|
-
const props = defineProps({
|
|
16
|
-
text: {
|
|
17
|
-
type: String,
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
20
|
-
placement: {
|
|
21
|
-
type: String as () => TooltipPlacement,
|
|
22
|
-
default: 'top',
|
|
23
|
-
|
|
24
|
-
validator: (v: string) =>
|
|
25
|
-
['top', 'right', 'bottom', 'left'].includes(v),
|
|
26
|
-
},
|
|
27
|
-
arrow: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: true,
|
|
30
|
-
},
|
|
31
|
-
color: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: 'gray-800',
|
|
34
|
-
},
|
|
35
|
-
textColor: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: 'white',
|
|
38
|
-
},
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
const baseClasses = computed(() => ('px-3 py-2 text-sm rounded-lg shadow-lg whitespace-nowrap'))
|
|
42
|
-
|
|
43
|
-
const visible = ref(false)
|
|
44
|
-
|
|
45
|
-
const isHex = (val: string) => val.startsWith('#')
|
|
46
|
-
|
|
47
|
-
const showTooltip = () => {
|
|
48
|
-
visible.value = true
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const hideTooltip = () => {
|
|
52
|
-
visible.value = false
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const tooltipStyle = computed(() => {
|
|
56
|
-
const style: Record<string, string> = {}
|
|
57
|
-
|
|
58
|
-
if (isHex(props.color)) {
|
|
59
|
-
style.backgroundColor = props.color
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (isHex(props.textColor)) {
|
|
63
|
-
style.color = props.textColor
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return style
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
const tooltipClasses = computed(() => [
|
|
70
|
-
baseClasses.value,
|
|
71
|
-
|
|
72
|
-
!isHex(props.color)
|
|
73
|
-
? `bg-${props.color}`
|
|
74
|
-
: '',
|
|
75
|
-
|
|
76
|
-
!isHex(props.textColor)
|
|
77
|
-
? `text-${props.textColor}`
|
|
78
|
-
: '',
|
|
79
|
-
])
|
|
80
|
-
|
|
81
|
-
const placementClasses = computed(() => {
|
|
82
|
-
switch (props.placement) {
|
|
83
|
-
case 'top':
|
|
84
|
-
return 'bottom-full left-1/2 -translate-x-1/2 mb-3'
|
|
85
|
-
|
|
86
|
-
case 'right':
|
|
87
|
-
return 'left-full top-1/2 -translate-y-1/2 ml-3'
|
|
88
|
-
|
|
89
|
-
case 'bottom':
|
|
90
|
-
return 'top-full left-1/2 -translate-x-1/2 mt-3'
|
|
91
|
-
|
|
92
|
-
case 'left':
|
|
93
|
-
return 'right-full top-1/2 -translate-y-1/2 mr-3'
|
|
94
|
-
|
|
95
|
-
default:
|
|
96
|
-
return ''
|
|
97
|
-
}
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
const arrowClasses = computed(() => {
|
|
101
|
-
switch (props.placement) {
|
|
102
|
-
case 'top':
|
|
103
|
-
return 'left-1/2 -translate-x-1/2 bottom-0 -mb-3.5'
|
|
104
|
-
|
|
105
|
-
case 'right':
|
|
106
|
-
return 'top-1/2 -translate-y-1/2 left-0 -ml-3.5'
|
|
107
|
-
|
|
108
|
-
case 'bottom':
|
|
109
|
-
return 'left-1/2 -translate-x-1/2 top-0 -mt-3.5'
|
|
110
|
-
|
|
111
|
-
case 'left':
|
|
112
|
-
return 'top-1/2 -translate-y-1/2 right-0 -mr-3.5'
|
|
113
|
-
|
|
114
|
-
default:
|
|
115
|
-
return ''
|
|
116
|
-
}
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
const arrowIcon = computed(() => {
|
|
120
|
-
switch (props.placement) {
|
|
121
|
-
case 'top':
|
|
122
|
-
return 'arrow_drop_down'
|
|
123
|
-
|
|
124
|
-
case 'right':
|
|
125
|
-
return 'arrow_left'
|
|
126
|
-
|
|
127
|
-
case 'bottom':
|
|
128
|
-
return 'arrow_drop_up'
|
|
129
|
-
|
|
130
|
-
case 'left':
|
|
131
|
-
return 'arrow_right'
|
|
132
|
-
|
|
133
|
-
default:
|
|
134
|
-
return ''
|
|
135
|
-
}
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
const arrowStyle = computed(() => {
|
|
139
|
-
const style: Record<string, string> = {}
|
|
140
|
-
if (isHex(props.color))
|
|
141
|
-
style.color = props.color
|
|
142
|
-
return style
|
|
143
|
-
})
|
|
144
|
-
</script>
|
|
145
|
-
|
|
146
|
-
<template>
|
|
147
|
-
<div
|
|
148
|
-
class="relative inline-block"
|
|
149
|
-
tabindex="0"
|
|
150
|
-
@mouseenter="showTooltip"
|
|
151
|
-
@mouseleave="hideTooltip"
|
|
152
|
-
@focus="showTooltip"
|
|
153
|
-
@blur="hideTooltip"
|
|
154
|
-
>
|
|
155
|
-
<!-- Trigger -->
|
|
156
|
-
<slot />
|
|
157
|
-
|
|
158
|
-
<!-- Tooltip -->
|
|
159
|
-
<transition name="fade">
|
|
160
|
-
<div
|
|
161
|
-
v-if="visible"
|
|
162
|
-
role="tooltip"
|
|
163
|
-
class="absolute z-50"
|
|
164
|
-
:class="[tooltipClasses, placementClasses]"
|
|
165
|
-
:style="tooltipStyle"
|
|
166
|
-
v-bind="$attrs"
|
|
167
|
-
>
|
|
168
|
-
<!-- Arrow -->
|
|
169
|
-
<i
|
|
170
|
-
v-if="arrow"
|
|
171
|
-
class="material-icons tooltip-arrow"
|
|
172
|
-
:class="[ arrowClasses, !isHex(props.color) ? `text-${props.color}` : '', ]"
|
|
173
|
-
:style="arrowStyle"
|
|
174
|
-
>
|
|
175
|
-
{{ arrowIcon }}
|
|
176
|
-
</i>
|
|
177
|
-
|
|
178
|
-
{{ text }}
|
|
179
|
-
</div>
|
|
180
|
-
</transition>
|
|
181
|
-
</div>
|
|
182
|
-
</template>
|
|
183
|
-
|
|
184
|
-
<style scoped>
|
|
185
|
-
.fade-enter-active,
|
|
186
|
-
.fade-leave-active {
|
|
187
|
-
transition: opacity 0.2s ease;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.fade-enter-from,
|
|
191
|
-
.fade-leave-to {
|
|
192
|
-
opacity: 0;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.tooltip-arrow {
|
|
196
|
-
position: absolute;
|
|
197
|
-
font-size: 1.5rem;
|
|
198
|
-
line-height: 1;
|
|
199
|
-
}
|
|
200
|
-
</style>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from '#app'
|
|
2
|
-
import Button from './Button.vue'
|
|
3
|
-
import Accordian from './Accordion.vue'
|
|
4
|
-
|
|
5
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
6
|
-
nuxtApp.vueApp.component('UIButton', Button)
|
|
7
|
-
nuxtApp.vueApp.component('UIAccordian', Accordian)
|
|
8
|
-
})
|
package/ui-library/module.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { defineNuxtModule, addComponentsDir, createResolver } from '@nuxt/kit'
|
|
2
|
-
|
|
3
|
-
export default defineNuxtModule({
|
|
4
|
-
meta: {
|
|
5
|
-
name: 'ui-library',
|
|
6
|
-
configKey: 'uiLibrary'
|
|
7
|
-
},
|
|
8
|
-
setup(_, nuxt) {
|
|
9
|
-
const resolver = createResolver(import.meta.url)
|
|
10
|
-
|
|
11
|
-
// Auto-register all components from the ui-library/components folder
|
|
12
|
-
addComponentsDir({
|
|
13
|
-
path: resolver.resolve('./components'),
|
|
14
|
-
prefix: 'UI', // This will prefix components with <UIButton />, <UICard /> etc.
|
|
15
|
-
pathPrefix: false, // Don't include folder names as prefix
|
|
16
|
-
extensions: ['vue'],
|
|
17
|
-
watch: nuxt.options.dev
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
})
|