diff --git a/packages/windi/src/Types/enums/Components.ts b/packages/windi/src/Types/enums/Components.ts
index c4908de..10e6877 100644
--- a/packages/windi/src/Types/enums/Components.ts
+++ b/packages/windi/src/Types/enums/Components.ts
@@ -2,4 +2,5 @@ export enum Components {
WAlert = 'WAlert',
WAlertDescription = 'WAlertDescription',
WIcon = 'WIcon',
+ WAvatar = 'WAvatar',
}
diff --git a/packages/windi/src/Types/variant.ts b/packages/windi/src/Types/variant.ts
index d88b68b..f66a355 100644
--- a/packages/windi/src/Types/variant.ts
+++ b/packages/windi/src/Types/variant.ts
@@ -1,5 +1,5 @@
import type { Components } from './enums/Components'
-import type { WAlertVariants } from './componentsTypes/components'
+import type { WAlertVariants, WAvatarVariants, WIconVariants } from './componentsTypes/components'
export declare interface CSSClassKeyValuePair {
[key: string]: any
@@ -31,4 +31,7 @@ export interface Variants {
export interface WindiUIConfiguration {
transitions: Record>
[Components.WAlert]?: WAlertVariants
+ [Components.WAvatar]?: WAvatarVariants
+ [Components.WIcon]?: WIconVariants
+
}
diff --git a/packages/windi/src/components/Alert/WAlert.vue b/packages/windi/src/components/Alert/WAlert.vue
index 5dbd541..773cb10 100644
--- a/packages/windi/src/components/Alert/WAlert.vue
+++ b/packages/windi/src/components/Alert/WAlert.vue
@@ -108,7 +108,7 @@ export default defineComponent({
-
+
diff --git a/packages/windi/src/components/Avatar/WAvatar.vue b/packages/windi/src/components/Avatar/WAvatar.vue
new file mode 100644
index 0000000..fff7b67
--- /dev/null
+++ b/packages/windi/src/components/Avatar/WAvatar.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+ {{ fallback }}
+
+ {{ chipText }}
+
+
+
+
diff --git a/packages/windi/src/components/Avatar/index.ts b/packages/windi/src/components/Avatar/index.ts
new file mode 100644
index 0000000..7d11344
--- /dev/null
+++ b/packages/windi/src/components/Avatar/index.ts
@@ -0,0 +1,5 @@
+import Avatar from './WAvatar.vue'
+
+export default {
+ Avatar,
+}
diff --git a/packages/windi/src/index.ts b/packages/windi/src/index.ts
index a2b2902..ed0e4f5 100644
--- a/packages/windi/src/index.ts
+++ b/packages/windi/src/index.ts
@@ -2,6 +2,7 @@ import type { App, defineComponent } from 'vue'
import './assets/css/tailwind.css'
import Alert from './components/Alert/WAlert.vue'
import AlertDescription from './components/Alert/WAlertDescription.vue'
+import Avatar from './components/Avatar/WAvatar.vue'
import Icon from './components/Icon/WIcon.vue'
import type { WindiUIConfiguration } from './Types/variant'
import windiTheme from './theme/windiTheme'
@@ -10,14 +11,12 @@ const components: Record> = {
Alert,
AlertDescription,
Icon,
+ Avatar,
}
function install(app: App, configuration: WindiUIConfiguration) {
for (const component in components)
app.component(components[component].name, components[component])
- // app.component(Alert.name, Alert)
- // app.component(AlertDescription.name, AlertDescription)
- // app.component(Icon.name, Icon)
app.provide('config', configuration)
}
@@ -26,3 +25,4 @@ export default { install, windiTheme }
export { default as Alert } from './components/Alert'
export { default as AlertDescription } from './components/Alert'
export { default as Icon } from './components/Icon'
+export { default as Avatar } from './components/Avatar'
diff --git a/packages/windi/src/main.ts b/packages/windi/src/main.ts
new file mode 100644
index 0000000..b8c5d02
--- /dev/null
+++ b/packages/windi/src/main.ts
@@ -0,0 +1,9 @@
+import './assets/css/tailwind.css'
+import { createApp } from 'vue'
+import App from './App.vue'
+import config from './theme/windiTheme'
+import install from './index'
+
+const app = createApp(App)
+app.use(install, config)
+app.mount('#app')
diff --git a/packages/windi/src/theme/windiTheme.ts b/packages/windi/src/theme/windiTheme.ts
index 87f73fd..c7d1108 100644
--- a/packages/windi/src/theme/windiTheme.ts
+++ b/packages/windi/src/theme/windiTheme.ts
@@ -6,6 +6,8 @@ export default {
flexBetween: 'flex justify-between items-center w-full',
body: 'text-sm leading-none mt-2.5',
closeIcon: 'w-6 h-6 block',
+ isLeading: 'space-x-4',
+ isNotLeading: 'space-x-2',
closeButtonClass: 'p-0.5 rounded-md -m-1 block transition duration-200 ease-in',
leadingClass: 'absolute left-2.5 inset-y-0 cursor-pointer flex items-center overflow-hidden',
trailingClass: 'absolute right-4 inset-y-0 cursor-pointer flex items-center overflow-hidden',
@@ -133,6 +135,47 @@ export default {
},
},
},
+
+ WAvatar: {
+ base: {
+ 'root': 'relative cursor-pointer inline-flex items-center justify-center bg-gray-100 rounded-full',
+ 'rounded': 'rounded-full',
+ 'placeholderClass': 'font-medium cursor-pointer text-gray-600 upperCase',
+ 'xs': 'h-6 w-6 text-[11px]',
+ 'sm': 'h-8 w-8 text-xs',
+ 'md': 'h-10 w-10 text-sm',
+ 'lg': 'h-12 w-12 text-base',
+ 'xl': 'h-14 w-14 text-lg',
+ '2xl': 'h-16 w-16 text-xl',
+ '3xl': 'h-20 w-20 text-2xl',
+ 'avatarChipClass': 'flex justify-center items-center absolute rounded-full !text-white cursor-pointer ring-1 !ring-white dark:ring-gray-600 text-white dark:text-gray-900',
+ 'avatarChipPosition': {
+ 'top-right': 'top-0 right-0',
+ 'bottom-right': 'bottom-0 right-0',
+ 'top-left': 'top-0 left-0',
+ 'bottom-left': 'bottom-0 left-0',
+ },
+ 'avatarChipSize': {
+ 'xs': 'h-1.5 min-w-[0.375rem] text-[6px] p-px',
+ 'sm': 'h-2 min-w-[0.5rem] text-[7px] p-0.5',
+ 'md': 'h-2.5 min-w-[0.625rem] text-[8px] p-0.5',
+ 'lg': 'h-3 min-w-[0.75rem] text-[10px] p-0.5',
+ 'xl': 'h-3.5 min-w-[0.875rem] text-[11px] p-1',
+ '2xl': 'h-4 min-w-[1rem] text-[12px] p-1',
+ '3xl': 'h-5 min-w-[1.25rem] text-[14px] p-1',
+ },
+
+ },
+
+ variants: {
+ default: {
+ root: 'relative cursor-pointer inline-flex items-center justify-center bg-gray-100 rounded-full',
+ rounded: 'rounded-full',
+ placeholderClass: 'font-medium cursor-pointer text-gray-600 upperCase',
+ },
+ },
+
+ },
transitions: {
scale: {
'enter-active-class': 'duration-200 ease-[cubic-bezier(0.175,0.885,0.32,1.475)]',