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.
Files changed (123) hide show
  1. package/dist/module.d.mts +3 -0
  2. package/dist/module.json +8 -0
  3. package/dist/module.mjs +26 -0
  4. package/dist/runtime/components/Accordion.d.vue.ts +39 -0
  5. package/{ui-library → dist/runtime}/components/Accordion.vue +44 -70
  6. package/dist/runtime/components/Accordion.vue.d.ts +39 -0
  7. package/dist/runtime/components/Avatar.d.vue.ts +141 -0
  8. package/dist/runtime/components/Avatar.vue +72 -0
  9. package/dist/runtime/components/Avatar.vue.d.ts +141 -0
  10. package/dist/runtime/components/Badge.d.vue.ts +133 -0
  11. package/dist/runtime/components/Badge.vue +99 -0
  12. package/dist/runtime/components/Badge.vue.d.ts +133 -0
  13. package/dist/runtime/components/Breadcrumbs.d.vue.ts +83 -0
  14. package/{ui-library → dist/runtime}/components/Breadcrumbs.vue +37 -59
  15. package/dist/runtime/components/Breadcrumbs.vue.d.ts +83 -0
  16. package/dist/runtime/components/Button.d.vue.ts +199 -0
  17. package/dist/runtime/components/Button.vue +125 -0
  18. package/dist/runtime/components/Button.vue.d.ts +199 -0
  19. package/dist/runtime/components/Card.d.vue.ts +83 -0
  20. package/{ui-library → dist/runtime}/components/Card.vue +26 -39
  21. package/dist/runtime/components/Card.vue.d.ts +83 -0
  22. package/dist/runtime/components/Checkbox.d.vue.ts +190 -0
  23. package/{ui-library → dist/runtime}/components/Checkbox.vue +45 -68
  24. package/dist/runtime/components/Checkbox.vue.d.ts +190 -0
  25. package/dist/runtime/components/CodeBlock.d.vue.ts +16 -0
  26. package/dist/runtime/components/CodeBlock.vue +75 -0
  27. package/dist/runtime/components/CodeBlock.vue.d.ts +16 -0
  28. package/dist/runtime/components/ColorPicker.d.vue.ts +91 -0
  29. package/dist/runtime/components/ColorPicker.vue +244 -0
  30. package/dist/runtime/components/ColorPicker.vue.d.ts +91 -0
  31. package/dist/runtime/components/Date.d.vue.ts +137 -0
  32. package/dist/runtime/components/Date.vue +201 -0
  33. package/dist/runtime/components/Date.vue.d.ts +137 -0
  34. package/dist/runtime/components/Dialog.d.vue.ts +103 -0
  35. package/{ui-library → dist/runtime}/components/Dialog.vue +30 -65
  36. package/dist/runtime/components/Dialog.vue.d.ts +103 -0
  37. package/dist/runtime/components/Divider.d.vue.ts +51 -0
  38. package/dist/runtime/components/Divider.vue +52 -0
  39. package/dist/runtime/components/Divider.vue.d.ts +51 -0
  40. package/dist/runtime/components/Drawer.d.vue.ts +30 -0
  41. package/dist/runtime/components/Drawer.vue +43 -0
  42. package/dist/runtime/components/Drawer.vue.d.ts +30 -0
  43. package/dist/runtime/components/Dropdown.d.vue.ts +34 -0
  44. package/dist/runtime/components/Dropdown.vue +127 -0
  45. package/dist/runtime/components/Dropdown.vue.d.ts +34 -0
  46. package/dist/runtime/components/FileUploader.d.vue.ts +58 -0
  47. package/dist/runtime/components/FileUploader.vue +202 -0
  48. package/dist/runtime/components/FileUploader.vue.d.ts +58 -0
  49. package/dist/runtime/components/Icon.d.vue.ts +41 -0
  50. package/dist/runtime/components/Icon.vue +66 -0
  51. package/dist/runtime/components/Icon.vue.d.ts +41 -0
  52. package/dist/runtime/components/Image.d.vue.ts +77 -0
  53. package/dist/runtime/components/Image.vue +61 -0
  54. package/dist/runtime/components/Image.vue.d.ts +77 -0
  55. package/dist/runtime/components/Input.d.vue.ts +66 -0
  56. package/dist/runtime/components/Input.vue +233 -0
  57. package/dist/runtime/components/Input.vue.d.ts +66 -0
  58. package/dist/runtime/components/Radio.d.vue.ts +41 -0
  59. package/dist/runtime/components/Radio.vue +222 -0
  60. package/dist/runtime/components/Radio.vue.d.ts +41 -0
  61. package/dist/runtime/components/ScrollArea.d.vue.ts +79 -0
  62. package/dist/runtime/components/ScrollArea.vue +36 -0
  63. package/dist/runtime/components/ScrollArea.vue.d.ts +79 -0
  64. package/dist/runtime/components/Select.d.vue.ts +43 -0
  65. package/dist/runtime/components/Select.vue +200 -0
  66. package/dist/runtime/components/Select.vue.d.ts +43 -0
  67. package/dist/runtime/components/Stepper.d.vue.ts +46 -0
  68. package/dist/runtime/components/Stepper.vue +218 -0
  69. package/dist/runtime/components/Stepper.vue.d.ts +46 -0
  70. package/dist/runtime/components/TabPanel.d.vue.ts +17 -0
  71. package/dist/runtime/components/TabPanel.vue +21 -0
  72. package/dist/runtime/components/TabPanel.vue.d.ts +17 -0
  73. package/dist/runtime/components/Table.d.vue.ts +40 -0
  74. package/dist/runtime/components/Table.vue +92 -0
  75. package/dist/runtime/components/Table.vue.d.ts +40 -0
  76. package/dist/runtime/components/Tabs.d.vue.ts +20 -0
  77. package/dist/runtime/components/Tabs.vue +62 -0
  78. package/dist/runtime/components/Tabs.vue.d.ts +20 -0
  79. package/dist/runtime/components/Textarea.d.vue.ts +208 -0
  80. package/dist/runtime/components/Textarea.vue +185 -0
  81. package/dist/runtime/components/Textarea.vue.d.ts +208 -0
  82. package/dist/runtime/components/Toggle.d.vue.ts +36 -0
  83. package/dist/runtime/components/Toggle.vue +173 -0
  84. package/dist/runtime/components/Toggle.vue.d.ts +36 -0
  85. package/dist/runtime/components/Tooltip.d.vue.ts +63 -0
  86. package/dist/runtime/components/Tooltip.vue +144 -0
  87. package/dist/runtime/components/Tooltip.vue.d.ts +63 -0
  88. package/dist/runtime/components/uiProps.d.ts +38 -0
  89. package/{ui-library/components/uiProps.ts → dist/runtime/components/uiProps.js} +2 -2
  90. package/dist/runtime/components/useUiClasses.d.ts +43 -0
  91. package/{ui-library/components/useUiClasses.ts → dist/runtime/components/useUiClasses.js} +25 -60
  92. package/dist/runtime/composables/plugin.d.ts +2 -0
  93. package/dist/runtime/composables/plugin.js +3 -0
  94. package/dist/runtime/tailwind-color.d.ts +2 -0
  95. package/dist/runtime/tailwind-color.js +5859 -0
  96. package/dist/types.d.mts +7 -0
  97. package/package.json +14 -16
  98. package/README.md +0 -208
  99. package/ui-library/components/Avatar.vue +0 -121
  100. package/ui-library/components/Badge.vue +0 -116
  101. package/ui-library/components/Button.vue +0 -154
  102. package/ui-library/components/CodeBlock.vue +0 -99
  103. package/ui-library/components/ColorPicker.vue +0 -302
  104. package/ui-library/components/Date.vue +0 -240
  105. package/ui-library/components/Divider.vue +0 -78
  106. package/ui-library/components/Drawer.vue +0 -67
  107. package/ui-library/components/Dropdown.vue +0 -248
  108. package/ui-library/components/FileUploader.vue +0 -330
  109. package/ui-library/components/Icon.vue +0 -82
  110. package/ui-library/components/Image.vue +0 -78
  111. package/ui-library/components/Input.vue +0 -531
  112. package/ui-library/components/Radio.vue +0 -356
  113. package/ui-library/components/ScrollArea.vue +0 -43
  114. package/ui-library/components/Select.vue +0 -309
  115. package/ui-library/components/Stepper.vue +0 -361
  116. package/ui-library/components/TabPanel.vue +0 -25
  117. package/ui-library/components/Table.vue +0 -152
  118. package/ui-library/components/Tabs.vue +0 -71
  119. package/ui-library/components/Textarea.vue +0 -233
  120. package/ui-library/components/Toggle.vue +0 -319
  121. package/ui-library/components/Tooltip.vue +0 -200
  122. package/ui-library/components/plugin.ts +0 -8
  123. 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
- })
@@ -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
- })