@equal-experts/kuat-vue 0.1.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/index.mjs +1 -0
- package/dist/index.umd.js +1 -0
- package/package.json +34 -0
- package/src/Button.vue +45 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +5 -0
- package/vite.config.ts +23 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@equal-experts/kuat-core";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@equal-experts/kuat-core")):typeof define=="function"&&define.amd?define(["exports","@equal-experts/kuat-core"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.KuatVue={},e.KuatCore))})(this,function(e,t){"use strict";Object.keys(t).forEach(u=>{u!=="default"&&!Object.prototype.hasOwnProperty.call(e,u)&&Object.defineProperty(e,u,{enumerable:!0,get:()=>t[u]})}),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@equal-experts/kuat-vue",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Vue components for the design system",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "vite build",
|
|
10
|
+
"dev": "vite"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@equal-experts/kuat-core": "^0.1.1",
|
|
14
|
+
"vue": "^3.3.11"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@vitejs/plugin-vue": "^4.5.2",
|
|
18
|
+
"vite": "^5.0.10",
|
|
19
|
+
"typescript": "^5.3.3",
|
|
20
|
+
"vue-tsc": "^1.8.25"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/EqualExperts/ee-design-foundations.git"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/EqualExperts/ee-design-foundations/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/EqualExperts/ee-design-foundations#readme"
|
|
34
|
+
}
|
package/src/Button.vue
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface ButtonProps {
|
|
5
|
+
variant?: 'primary' | 'secondary' | 'outline'
|
|
6
|
+
size?: 'sm' | 'md' | 'lg'
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
11
|
+
variant: 'primary',
|
|
12
|
+
size: 'md',
|
|
13
|
+
disabled: false
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const buttonClasses = computed(() => {
|
|
17
|
+
const baseClasses = 'rounded-md transition-all duration-200 ease-in-out'
|
|
18
|
+
const variantClasses = {
|
|
19
|
+
primary: 'bg-brand-primary text-white hover:bg-brand-primary/90',
|
|
20
|
+
secondary: 'bg-brand-secondary text-white hover:bg-brand-secondary/90',
|
|
21
|
+
outline: 'border border-brand-primary text-brand-primary hover:bg-brand-primary/10'
|
|
22
|
+
}
|
|
23
|
+
const sizeClasses = {
|
|
24
|
+
sm: 'px-2 py-1 text-xs',
|
|
25
|
+
md: 'px-4 py-2 text-sm',
|
|
26
|
+
lg: 'px-6 py-3 text-base'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return [
|
|
30
|
+
baseClasses,
|
|
31
|
+
variantClasses[props.variant],
|
|
32
|
+
sizeClasses[props.size],
|
|
33
|
+
props.disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'
|
|
34
|
+
].join(' ')
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<button
|
|
40
|
+
:class="buttonClasses"
|
|
41
|
+
:disabled="disabled"
|
|
42
|
+
>
|
|
43
|
+
<slot>Button</slot>
|
|
44
|
+
</button>
|
|
45
|
+
</template>
|
package/src/index.ts
ADDED
package/vite.config.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import vue from '@vitejs/plugin-vue'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [vue()],
|
|
7
|
+
build: {
|
|
8
|
+
lib: {
|
|
9
|
+
entry: resolve(__dirname, 'src/index.ts'),
|
|
10
|
+
name: 'KuatVue',
|
|
11
|
+
fileName: 'index'
|
|
12
|
+
},
|
|
13
|
+
rollupOptions: {
|
|
14
|
+
external: ['vue', '@equal-experts/kuat-core'],
|
|
15
|
+
output: {
|
|
16
|
+
globals: {
|
|
17
|
+
vue: 'Vue',
|
|
18
|
+
'@equal-experts/kuat-core': 'KuatCore'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
})
|