@danarakca/keu-ui 0.0.1 → 1.1.0
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/README.md
CHANGED
|
@@ -1,63 +1,208 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Danarakca Design System
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Keu Design System** - Shared UI components library
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/danarakca-design-system)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
## 📦 Instalasi
|
|
8
9
|
|
|
9
10
|
```bash
|
|
10
|
-
|
|
11
|
+
npm install danarakca-design-system
|
|
11
12
|
```
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
## 🚀 Quick Start
|
|
15
|
+
|
|
16
|
+
### 1. Import Komponen (Standalone Components)
|
|
17
|
+
|
|
18
|
+
Semua komponen adalah **standalone components**, jadi bisa langsung diimport tanpa perlu NgModule.
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// app.component.ts
|
|
22
|
+
import { Component } from '@angular/core';
|
|
23
|
+
import { KeuButtonComponent, KeuInputComponent, KeuAlertComponent } from 'danarakca-design-system';
|
|
24
|
+
|
|
25
|
+
@Component({
|
|
26
|
+
selector: 'app-root',
|
|
27
|
+
standalone: true,
|
|
28
|
+
imports: [
|
|
29
|
+
KeuButtonComponent,
|
|
30
|
+
KeuInputComponent,
|
|
31
|
+
KeuAlertComponent
|
|
32
|
+
],
|
|
33
|
+
template: `
|
|
34
|
+
<keu-alert variant="success" [dismissible]="true">
|
|
35
|
+
Welcome to Danarakca Design System!
|
|
36
|
+
</keu-alert>
|
|
37
|
+
|
|
38
|
+
<keu-input
|
|
39
|
+
label="Username"
|
|
40
|
+
placeholder="Enter your username"
|
|
41
|
+
[(ngModel)]="username">
|
|
42
|
+
</keu-input>
|
|
43
|
+
|
|
44
|
+
<keu-button variant="primary" size="md" (click)="handleClick()">
|
|
45
|
+
Submit
|
|
46
|
+
</keu-button>
|
|
47
|
+
`
|
|
48
|
+
})
|
|
49
|
+
export class AppComponent {
|
|
50
|
+
username = '';
|
|
51
|
+
|
|
52
|
+
handleClick() {
|
|
53
|
+
console.log('Button clicked!', this.username);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
17
56
|
```
|
|
18
57
|
|
|
19
|
-
|
|
58
|
+
### 2. Setup Styles
|
|
20
59
|
|
|
21
|
-
|
|
60
|
+
Import theme di `styles.scss`:
|
|
22
61
|
|
|
23
|
-
```
|
|
24
|
-
|
|
62
|
+
```scss
|
|
63
|
+
@use 'danarakca-design-system/styles/keu-ui.theme';
|
|
25
64
|
```
|
|
26
65
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
###
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
66
|
+
## 📚 Komponen yang Tersedia
|
|
67
|
+
|
|
68
|
+
### Form Components
|
|
69
|
+
- ✅ `KeuInputComponent` - Text input field
|
|
70
|
+
- ✅ `KeuTextareaComponent` - Multi-line text input
|
|
71
|
+
- ✅ `KeuSelectComponent` - Select dropdown
|
|
72
|
+
- ✅ `KeuCheckboxComponent` - Checkbox input
|
|
73
|
+
- ✅ `KeuRadioComponent` - Radio button
|
|
74
|
+
- ✅ `KeuToggleComponent` - Toggle switch
|
|
75
|
+
- ✅ `KeuSliderComponent` - Range slider
|
|
76
|
+
- ✅ `KeuDatepickerComponent` - Date picker
|
|
77
|
+
- ✅ `KeuRichtextComponent` - Rich text editor (CKEditor)
|
|
78
|
+
- ✅ `KeuAutocompleteComponent` - Autocomplete input
|
|
79
|
+
- ✅ `KeuTreeSelectComponent` - Tree select dropdown
|
|
80
|
+
- ✅ `KeuRatingComponent` - Star rating
|
|
81
|
+
|
|
82
|
+
### Button & Navigation
|
|
83
|
+
- ✅ `KeuButtonComponent` - Button
|
|
84
|
+
- ✅ `KeuButtonGroupComponent` - Button group
|
|
85
|
+
- ✅ `KeuLinkComponent` - Link/Anchor
|
|
86
|
+
- ✅ `KeuBreadcrumbComponent` - Breadcrumb navigation
|
|
87
|
+
- ✅ `KeuPaginationComponent` - Pagination
|
|
88
|
+
- ✅ `KeuTabsComponent` - Tabs navigation
|
|
89
|
+
- ✅ `KeuDropdownComponent` - Dropdown menu
|
|
90
|
+
|
|
91
|
+
### Data Display
|
|
92
|
+
- ✅ `KeuTableComponent` - Data table with sorting
|
|
93
|
+
- ✅ `KeuBadgeComponent` - Badge/label
|
|
94
|
+
- ✅ `KeuChipComponent` - Chip/tag
|
|
95
|
+
- ✅ `KeuAvatarComponent` - User avatar
|
|
96
|
+
- ✅ `KeuAvatarGroupComponent` - Avatar group
|
|
97
|
+
- ✅ `KeuProgressBarComponent` - Progress bar
|
|
98
|
+
- ✅ `KeuProgressCircleComponent` - Circular progress
|
|
99
|
+
- ✅ `KeuTooltipComponent` - Tooltip
|
|
100
|
+
|
|
101
|
+
### Feedback & Overlay
|
|
102
|
+
- ✅ `KeuAlertComponent` - Alert message
|
|
103
|
+
- ✅ `KeuModalComponent` - Modal dialog
|
|
104
|
+
- ✅ `KeuSidebarComponent` - Sidebar panel
|
|
105
|
+
|
|
106
|
+
### Layout
|
|
107
|
+
- ✅ `KeuContainerDirective` - Container
|
|
108
|
+
- ✅ `KeuRowDirective` - Grid row
|
|
109
|
+
- ✅ `KeuColDirective` - Grid column
|
|
110
|
+
- ✅ `KeuDividerComponent` - Divider line
|
|
111
|
+
- ✅ `KeuIconComponent` - Icon (Tabler Icons)
|
|
112
|
+
|
|
113
|
+
## 💡 Contoh Penggunaan
|
|
114
|
+
|
|
115
|
+
### Button dengan Icon
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { KeuButtonComponent } from 'danarakca-design-system';
|
|
119
|
+
|
|
120
|
+
@Component({
|
|
121
|
+
template: `
|
|
122
|
+
<keu-button
|
|
123
|
+
variant="primary"
|
|
124
|
+
size="md"
|
|
125
|
+
icon="ti-plus"
|
|
126
|
+
(click)="addItem()">
|
|
127
|
+
Add New Item
|
|
128
|
+
</keu-button>
|
|
129
|
+
`
|
|
130
|
+
})
|
|
49
131
|
```
|
|
50
132
|
|
|
51
|
-
|
|
133
|
+
### Form Input dengan Validasi
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
import { KeuInputComponent } from 'danarakca-design-system';
|
|
137
|
+
|
|
138
|
+
@Component({
|
|
139
|
+
template: `
|
|
140
|
+
<keu-input
|
|
141
|
+
label="Email"
|
|
142
|
+
type="email"
|
|
143
|
+
placeholder="your@email.com"
|
|
144
|
+
[state]="emailValid ? 'default' : 'error'"
|
|
145
|
+
helperText="Please enter a valid email"
|
|
146
|
+
[(ngModel)]="email">
|
|
147
|
+
</keu-input>
|
|
148
|
+
`
|
|
149
|
+
})
|
|
150
|
+
```
|
|
52
151
|
|
|
53
|
-
|
|
152
|
+
### Data Table
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
import { KeuTableComponent, KeuColumnDef } from 'danarakca-design-system';
|
|
156
|
+
|
|
157
|
+
@Component({
|
|
158
|
+
template: `
|
|
159
|
+
<keu-table
|
|
160
|
+
[data]="users"
|
|
161
|
+
[columns]="columns"
|
|
162
|
+
[sortable]="true"
|
|
163
|
+
(sortChange)="onSort($event)">
|
|
164
|
+
</keu-table>
|
|
165
|
+
`
|
|
166
|
+
})
|
|
167
|
+
export class UsersComponent {
|
|
168
|
+
columns: KeuColumnDef[] = [
|
|
169
|
+
{ key: 'name', header: 'Name' },
|
|
170
|
+
{ key: 'email', header: 'Email' },
|
|
171
|
+
{ key: 'role', header: 'Role' }
|
|
172
|
+
];
|
|
173
|
+
|
|
174
|
+
users = [
|
|
175
|
+
{ name: 'John Doe', email: 'john@example.com', role: 'Admin' },
|
|
176
|
+
{ name: 'Jane Smith', email: 'jane@example.com', role: 'User' }
|
|
177
|
+
];
|
|
178
|
+
}
|
|
179
|
+
```
|
|
54
180
|
|
|
55
|
-
|
|
56
|
-
|
|
181
|
+
### Modal Dialog
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
import { KeuModalComponent } from 'danarakca-design-system';
|
|
185
|
+
|
|
186
|
+
@Component({
|
|
187
|
+
template: `
|
|
188
|
+
<keu-modal
|
|
189
|
+
[(visible)]="showModal"
|
|
190
|
+
title="Confirm Delete"
|
|
191
|
+
variant="danger"
|
|
192
|
+
okText="Delete"
|
|
193
|
+
cancelText="Cancel"
|
|
194
|
+
(ok)="handleDelete()"
|
|
195
|
+
(cancel)="showModal = false">
|
|
196
|
+
Are you sure you want to delete this item?
|
|
197
|
+
</keu-modal>
|
|
198
|
+
`
|
|
199
|
+
})
|
|
57
200
|
```
|
|
58
201
|
|
|
59
|
-
|
|
202
|
+
## 📄 License
|
|
203
|
+
|
|
204
|
+
MIT License - CORE APBN Team
|
|
60
205
|
|
|
61
|
-
|
|
206
|
+
---
|
|
62
207
|
|
|
63
|
-
|
|
208
|
+
**Built with ❤️ by CORE APBN Team**
|