pesona-ui 0.1.31 → 0.1.32

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 (2) hide show
  1. package/README.md +227 -66
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,69 +1,230 @@
1
- # React + TypeScript + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13
-
14
- ```js
15
- export default tseslint.config([
16
- globalIgnores(['dist']),
17
- {
18
- files: ['**/*.{ts,tsx}'],
19
- extends: [
20
- // Other configs...
21
-
22
- // Remove tseslint.configs.recommended and replace with this
23
- ...tseslint.configs.recommendedTypeChecked,
24
- // Alternatively, use this for stricter rules
25
- ...tseslint.configs.strictTypeChecked,
26
- // Optionally, add this for stylistic rules
27
- ...tseslint.configs.stylisticTypeChecked,
28
-
29
- // Other configs...
30
- ],
31
- languageOptions: {
32
- parserOptions: {
33
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
34
- tsconfigRootDir: import.meta.dirname,
35
- },
36
- // other options...
37
- },
38
- },
39
- ])
1
+ # Pesona UI
2
+
3
+ Library komponen UI React yang modern dan dapat dikustomisasi, dibangun dengan TypeScript, Vite, dan SCSS. Pesona UI menyediakan set komponen yang lengkap dan dapat digunakan kembali untuk membangun aplikasi web yang indah.
4
+
5
+ ## Fitur
6
+
7
+ - 🎨 **18+ Komponen Siap Pakai** - Button, Card, Modal, Dropdown, Table, Form, dan lainnya
8
+ - 💪 **Dukungan TypeScript** - Definisi tipe lengkap sudah termasuk
9
+ - 🎭 **Dapat di-Theme** - Kustomisasi mudah dengan SCSS variables
10
+ - 📦 **Tree-shakeable** - Import hanya yang Anda butuhkan
11
+ - ⚡ **Cepat** - Dibangun dengan Vite untuk performa optimal
12
+ - 🔧 **Fleksibel** - Komponen yang sangat dapat dikustomisasi
13
+ - 📱 **Responsive** - Pendekatan desain mobile-first
14
+
15
+ ## 📦 Komponen yang Tersedia
16
+
17
+ - **Button** - Komponen tombol serbaguna dengan berbagai varian
18
+ - **Card** - Komponen container untuk konten
19
+ - **Spinner** - Indikator loading
20
+ - **Dropdown** - Menu dropdown dan select
21
+ - **Badge** - Badge status dan label
22
+ - **Box** - Container layout
23
+ - **Tab** - Navigasi tab
24
+ - **Alert** - Pesan alert
25
+ - **Callout** - Blok konten yang di-highlight
26
+ - **Tooltip** - Tooltip kontekstual
27
+ - **Popover** - Overlay popover
28
+ - **Modal** - Dialog modal
29
+ - **Accordion** - Panel konten yang dapat dilipat
30
+ - **Progress** - Progress bar dan indikator
31
+ - **Form** - Komponen form (Input, Select, Checkbox, dll.)
32
+ - **Loading** - State loading
33
+ - **List** - Komponen list
34
+ - **Table** - Tabel data
35
+
36
+ ## 🚀 Instalasi
37
+
38
+ ```bash
39
+ npm install pesona-ui
40
+ # atau
41
+ yarn add pesona-ui
42
+ ```
43
+
44
+ ## 📖 Cara Penggunaan
45
+
46
+ Import komponen dan styles di aplikasi React Anda:
47
+
48
+ ```tsx
49
+ import { Button, Card, Modal } from 'pesona-ui';
50
+ import 'pesona-ui/dist/pesona-ui.css';
51
+
52
+ function App() {
53
+ return (
54
+ <Card>
55
+ <Button className="btn btn-primary">
56
+ Klik saya
57
+ </Button>
58
+ </Card>
59
+ );
60
+ }
61
+ ```
62
+
63
+ ## 🏗️ Struktur Project
64
+
65
+ Project ini menggunakan struktur monorepo:
66
+
67
+ ```
68
+ pesona-ui-react/
69
+ ├── src/ # Library Komponen UI
70
+ │ ├── components/ # Semua komponen yang dapat digunakan kembali
71
+ │ ├── styles/ # Global styles dan variables
72
+ │ ├── hooks/ # Custom React hooks
73
+ │ └── index.ts # Entry point utama
74
+ ├── demo/ # Aplikasi Demo
75
+ │ └── src/
76
+ │ ├── presentation/ # Demo pages dan contoh
77
+ │ ├── domain/ # Business logic
78
+ │ └── data/ # Data layer
79
+ └── dist/ # Output build
80
+ ```
81
+
82
+ ### Root Folder (Library)
83
+
84
+ Berisi library komponen UI yang dapat dipublikasikan ke npm. Setiap komponen mengikuti struktur yang konsisten:
85
+
86
+ ```
87
+ Component/
88
+ ├── Component.tsx # Logic komponen
89
+ ├── Component.scss # Styles komponen
90
+ └── index.ts # Export
91
+ ```
92
+
93
+ ### Demo Folder
94
+
95
+ Aplikasi admin dashboard lengkap yang mendemonstrasikan cara menggunakan komponen. Fitur yang tersedia:
96
+
97
+ - Contoh komponen live
98
+ - Dokumentasi interaktif
99
+ - Pola penggunaan real-world
100
+ - State management dengan Redux Toolkit
101
+ - Routing dengan React Router
102
+ - Internationalization (i18n)
103
+ - Form handling dengan React Hook Form
104
+ - Data fetching dengan React Query
105
+
106
+ ## 🛠️ Development
107
+
108
+ ### Prerequisites
109
+
110
+ - Node.js >= 18
111
+ - Yarn atau npm
112
+
113
+ ### Setup
114
+
115
+ 1. Clone repository:
116
+ ```bash
117
+ git clone <repository-url>
118
+ cd pesona-ui-react
119
+ ```
120
+
121
+ 2. Install dependencies:
122
+ ```bash
123
+ yarn install
124
+ ```
125
+
126
+ 3. Build library:
127
+ ```bash
128
+ yarn build
129
+ ```
130
+
131
+ 4. Jalankan aplikasi demo:
132
+ ```bash
133
+ cd demo
134
+ yarn install
135
+ yarn dev
136
+ ```
137
+
138
+ Demo akan tersedia di `http://localhost:5180`
139
+
140
+ ### Script yang Tersedia
141
+
142
+ **Root (Library):**
143
+ - `yarn dev` - Mulai mode development
144
+ - `yarn build` - Build library
145
+ - `yarn lint` - Jalankan ESLint
146
+ - `yarn lint:fix` - Perbaiki error ESLint
147
+ - `yarn format` - Format code dengan Prettier
148
+ - `yarn test` - Jalankan tests
149
+ - `yarn test:watch` - Jalankan tests dalam watch mode
150
+
151
+ **Demo:**
152
+ - `yarn dev` - Mulai aplikasi demo
153
+ - `yarn build` - Build aplikasi demo
154
+ - `yarn preview` - Preview production build
155
+ - `yarn lint` - Jalankan ESLint
156
+ - `yarn lint:fix` - Perbaiki error ESLint
157
+
158
+ ## 📦 Building untuk Production
159
+
160
+ Build library:
161
+
162
+ ```bash
163
+ yarn build
164
+ ```
165
+
166
+ Ini akan menghasilkan:
167
+ - `dist/pesona-ui.es.js` - ES module
168
+ - `dist/pesona-ui.cjs.js` - CommonJS module
169
+ - `dist/pesona-ui.css` - Compiled styles
170
+ - `dist/index.d.ts` - TypeScript definitions
171
+
172
+ ## 🎨 Kustomisasi
173
+
174
+ ### Theming
175
+
176
+ Override SCSS variables untuk mengkustomisasi tampilan:
177
+
178
+ ```scss
179
+ // Custom styles Anda
180
+ @use 'pesona-ui/src/styles/variables' as vars with (
181
+ $primary-color: #your-color,
182
+ $font-family: 'Your Font'
183
+ );
40
184
  ```
41
185
 
42
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
43
-
44
- ```js
45
- // eslint.config.js
46
- import reactX from 'eslint-plugin-react-x'
47
- import reactDom from 'eslint-plugin-react-dom'
48
-
49
- export default tseslint.config([
50
- globalIgnores(['dist']),
51
- {
52
- files: ['**/*.{ts,tsx}'],
53
- extends: [
54
- // Other configs...
55
- // Enable lint rules for React
56
- reactX.configs['recommended-typescript'],
57
- // Enable lint rules for React DOM
58
- reactDom.configs.recommended,
59
- ],
60
- languageOptions: {
61
- parserOptions: {
62
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
63
- tsconfigRootDir: import.meta.dirname,
64
- },
65
- // other options...
66
- },
67
- },
68
- ])
186
+ ### Styling Komponen
187
+
188
+ Semua komponen menerima prop `className` untuk custom styling:
189
+
190
+ ```tsx
191
+ <Button className="btn btn-primary custom-class">
192
+ Custom Button
193
+ </Button>
69
194
  ```
195
+
196
+ ## 🔧 Tech Stack
197
+
198
+ - **React 18+** - UI library
199
+ - **TypeScript** - Type safety
200
+ - **Vite** - Build tool
201
+ - **SCSS** - Styling
202
+ - **ESLint** - Code linting
203
+ - **Prettier** - Code formatting
204
+ - **Vitest** - Testing framework
205
+
206
+ ## 🎭 Fitur Demo
207
+
208
+ Aplikasi demo menampilkan:
209
+
210
+ - Galeri komponen dengan contoh live
211
+ - Contoh validasi form
212
+ - Tabel data dengan sorting dan filtering
213
+ - Fungsionalitas drag and drop
214
+ - Alur autentikasi
215
+ - Role-based access control (RBAC)
216
+ - Switching tema Dark/Light
217
+ - Dukungan multi-bahasa
218
+ - Layout responsive
219
+
220
+ ## 🤝 Kontribusi
221
+
222
+ Kontribusi sangat diterima! Silakan submit Pull Request.
223
+
224
+ ## 📄 License
225
+
226
+ MIT
227
+
228
+ ## 📞 Support
229
+
230
+ Jika Anda menemukan bug atau memiliki pertanyaan, silakan buat issue di repository ini.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pesona-ui",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./dist/pesona-ui.cjs.js",