zc-ui-library 0.1.2 → 0.1.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zc-ui-library",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
package/src/App.tsx CHANGED
@@ -1,11 +1,9 @@
1
1
  import './App.css'
2
- import {ZcButton} from "./components/Button/ZcButton.tsx";
3
-
4
2
  function App() {
5
3
 
6
4
  return (
7
5
  <>
8
- <ZcButton variant='primary'>clicked</ZcButton>
6
+
9
7
  </>
10
8
  )
11
9
  }
@@ -1,49 +1,7 @@
1
- import * as React from "react";
2
-
3
- export type ButtonVariant = 'primary' | 'secondary'
4
- export type ButtonSize = 'sm' | 'md' | 'lg'
5
-
6
- export interface ButtonProps
7
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
8
- variant?: ButtonVariant
9
- size?: ButtonSize
10
- }
11
-
12
- export const ZcButton = React.forwardRef<HTMLButtonElement, ButtonProps>(function ZcButton(
13
- {
14
- variant = 'primary',
15
- size = 'md',
16
- disabled,
17
- children,
18
- ...props
19
- },
20
- ref
21
- ) {
1
+ export default function ZcButton() {
22
2
  return (
23
- <button
24
- ref={ref}
25
- disabled={disabled}
26
- data-variant={variant}
27
- data-size={size}
28
- style={{
29
- padding:
30
- size === 'sm'
31
- ? '6px 10px'
32
- : size === 'lg'
33
- ? '12px 18px'
34
- : '8px 14px',
35
- borderRadius: 6,
36
- border: '1px solid transparent',
37
- cursor: disabled ? 'not-allowed' : 'pointer',
38
- background:
39
- variant === 'secondary' ? '#fff' : '#2563eb',
40
- color:
41
- variant === 'secondary' ? '#111' : '#fff',
42
- opacity: disabled ? 0.6 : 1,
43
- }}
44
- {...props}
45
- >
46
- {children}
3
+ <button>
4
+ clicked
47
5
  </button>
48
6
  )
49
- })
7
+ }
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export {ZcButton} from './components/Button/ZcButton.tsx';
1
+ export {default as ZcButton} from './components/Button/ZcButton.tsx';
package/vite.config.js CHANGED
@@ -1,26 +1,38 @@
1
- import { defineConfig } from 'vite'
1
+ import {defineConfig} from 'vite'
2
2
  import react from '@vitejs/plugin-react'
3
3
  import dts from 'vite-plugin-dts'
4
- import {resolve} from "path";
4
+ import path from 'node:path'
5
+ import tailwindcss from 'tailwindcss'
5
6
 
6
7
  export default defineConfig({
7
- plugins: [
8
- react(),
9
- dts({
10
- entryRoot: 'src',
11
- insertTypesEntry: true,
12
- }),
13
- ],
14
- build: {
15
- lib: {
16
- entry: resolve(__dirname, 'src/index.ts'),
17
- name: 'zc-ui-library',
18
- formats: ['es', 'cjs'],
19
- fileName: (format) =>
20
- format === 'es' ? 'index.js' : 'index.cjs',
21
- },
22
- rollupOptions: {
23
- external: ['react', 'react-dom'],
24
- },
25
- },
26
- })
8
+ plugins: [
9
+ react(),
10
+ dts({
11
+ entryRoot: path.resolve(__dirname, 'src'),
12
+ outDir: path.resolve(__dirname, 'dist'),
13
+ insertTypesEntry: true,
14
+ rollupTypes: false, // ✅ MUST be false
15
+ }),
16
+ ],
17
+
18
+ build: {
19
+ lib: {
20
+ entry: path.resolve(__dirname, 'src/index.ts'),
21
+ name: 'ZcUILibrary',
22
+ formats: ['es', 'cjs'],
23
+ fileName: (format) =>
24
+ format === 'es' ? 'index.js' : 'index.cjs',
25
+ },
26
+ rollupOptions: {
27
+ external: ['react', 'react-dom'], // ✅ ONLY runtime deps
28
+ },
29
+ sourcemap: true,
30
+ emptyOutDir: true,
31
+ },
32
+
33
+ css: {
34
+ postcss: {
35
+ plugins: [tailwindcss],
36
+ },
37
+ },
38
+ })