@equal-experts/kuat-react 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.cjs +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +34 -0
- package/src/Button.tsx +42 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +5 -0
- package/vite.config.ts +24 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@equal-experts/kuat-core");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@equal-experts/kuat-core";
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@equal-experts/kuat-react",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "React 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
|
+
"react": "^18.2.0",
|
|
15
|
+
"react-dom": "^18.2.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
19
|
+
"vite": "^5.0.10",
|
|
20
|
+
"typescript": "^5.3.3"
|
|
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.tsx
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'outline'
|
|
5
|
+
size?: 'sm' | 'md' | 'lg'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const Button: React.FC<ButtonProps> = ({
|
|
9
|
+
variant = 'primary',
|
|
10
|
+
size = 'md',
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}) => {
|
|
15
|
+
const baseClasses = 'rounded-md transition-all duration-200 ease-in-out'
|
|
16
|
+
const variantClasses = {
|
|
17
|
+
primary: 'bg-brand-primary text-white hover:bg-brand-primary/90',
|
|
18
|
+
secondary: 'bg-brand-secondary text-white hover:bg-brand-secondary/90',
|
|
19
|
+
outline: 'border border-brand-primary text-brand-primary hover:bg-brand-primary/10'
|
|
20
|
+
}
|
|
21
|
+
const sizeClasses = {
|
|
22
|
+
sm: 'px-2 py-1 text-xs',
|
|
23
|
+
md: 'px-4 py-2 text-sm',
|
|
24
|
+
lg: 'px-6 py-3 text-base'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const buttonClasses = [
|
|
28
|
+
baseClasses,
|
|
29
|
+
variantClasses[variant],
|
|
30
|
+
sizeClasses[size],
|
|
31
|
+
className
|
|
32
|
+
].filter(Boolean).join(' ')
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<button
|
|
36
|
+
className={buttonClasses}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</button>
|
|
41
|
+
)
|
|
42
|
+
}
|
package/src/index.ts
ADDED
package/vite.config.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
build: {
|
|
8
|
+
lib: {
|
|
9
|
+
entry: resolve(__dirname, 'src/index.ts'),
|
|
10
|
+
formats: ['es', 'cjs'],
|
|
11
|
+
fileName: (format) => `index.${format === 'es' ? 'mjs' : 'cjs'}`
|
|
12
|
+
},
|
|
13
|
+
rollupOptions: {
|
|
14
|
+
external: ['react', 'react-dom', '@equal-experts/kuat-core'],
|
|
15
|
+
output: {
|
|
16
|
+
globals: {
|
|
17
|
+
react: 'React',
|
|
18
|
+
'react-dom': 'ReactDOM',
|
|
19
|
+
'@equal-experts/kuat-core': 'KuatCore'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
})
|