@asdp/ferryui 0.1.16 → 0.1.19
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 +229 -225
- package/dist/assets/images/banner/usemanifest-banner.svg +9 -9
- package/dist/assets/images/illustrations/mobile-pay.svg +218 -218
- package/dist/assets/images/illustrations/pay.svg +294 -294
- package/dist/assets/images/illustrations/radius.svg +68 -68
- package/dist/assets/images/illustrations/sessionexp.svg +486 -486
- package/dist/assets/logo/asdp-default.svg +184 -184
- package/dist/index.d.mts +192 -18
- package/dist/index.d.ts +192 -18
- package/dist/index.js +807 -404
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +774 -373
- package/dist/index.mjs.map +1 -1
- package/package.json +82 -82
package/README.md
CHANGED
|
@@ -1,225 +1,229 @@
|
|
|
1
|
-
# @asdp/ferry-ui
|
|
2
|
-
|
|
3
|
-
ASDP Ferry UI Component Library - Internal npm package untuk komponen UI yang digunakan di aplikasi ASDP Integrated Ticketing System.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @asdp/ferry-ui
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Setup untuk Development
|
|
12
|
-
|
|
13
|
-
### 1. Clone Repository
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
git clone https://gitlab.swamedia.xyz/asdp/ferry-ui
|
|
17
|
-
cd ferry-ui
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### 2. Install Dependencies
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### 3. Build Package
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
npm run build
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Components
|
|
33
|
-
|
|
34
|
-
### ModalRadius
|
|
35
|
-
|
|
36
|
-
Modal component untuk menampilkan pesan ketika user berada di luar area pemesanan.
|
|
37
|
-
|
|
38
|
-
#### Props
|
|
39
|
-
|
|
40
|
-
| Prop | Type | Default | Description |
|
|
41
|
-
| --------------- | ------------ | -------------------------------------------- | ---------------------------------------------------- |
|
|
42
|
-
| `open` | `boolean` | - | Whether the modal is open (required) |
|
|
43
|
-
| `onClose` | `() => void` | - | Callback when modal should close (required) |
|
|
44
|
-
| `title` | `string` | `"Anda berada di luar area pemesanan"` | Modal title |
|
|
45
|
-
| `message` | `string` | `"Pemesanan tiket tidak dapat dilakukan..."` | Modal message content |
|
|
46
|
-
| `imageSrc` | `string` | `"/assets/images/illustrations/radius.svg"` | Image source URL |
|
|
47
|
-
| `imageAlt` | `string` | `"Radius Illustration"` | Image alt text |
|
|
48
|
-
| `imageWidth` | `number` | `361` | Image width |
|
|
49
|
-
| `imageHeight` | `number` | `203` | Image height |
|
|
50
|
-
| `buttonText` | `string` | `"Tutup & Coba Lagi"` | Button text |
|
|
51
|
-
| `onButtonClick` | `() => void` | - | Button click handler (optional, defaults to onClose) |
|
|
52
|
-
|
|
53
|
-
#### Usage
|
|
54
|
-
|
|
55
|
-
```tsx
|
|
56
|
-
import { ModalRadius } from "@asdp/ferry-ui";
|
|
57
|
-
|
|
58
|
-
function App() {
|
|
59
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<ModalRadius
|
|
63
|
-
open={isOpen}
|
|
64
|
-
onClose={() => setIsOpen(false)}
|
|
65
|
-
title="Anda berada di luar area pemesanan"
|
|
66
|
-
message="Pemesanan tiket tidak dapat dilakukan dari lokasi Anda saat ini."
|
|
67
|
-
imageSrc="/assets/images/illustrations/radius.svg"
|
|
68
|
-
buttonText="Tutup & Coba Lagi"
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
#### With Custom Handler
|
|
75
|
-
|
|
76
|
-
```tsx
|
|
77
|
-
import { ModalRadius } from "@asdp/ferry-ui";
|
|
78
|
-
|
|
79
|
-
function App() {
|
|
80
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
81
|
-
|
|
82
|
-
const handleRetry = () => {
|
|
83
|
-
// Custom logic
|
|
84
|
-
checkLocation();
|
|
85
|
-
setIsOpen(false);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<ModalRadius
|
|
90
|
-
open={isOpen}
|
|
91
|
-
onClose={() => setIsOpen(false)}
|
|
92
|
-
onButtonClick={handleRetry}
|
|
93
|
-
/>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
#### Using Assets
|
|
99
|
-
|
|
100
|
-
The `ModalRadius` component uses an illustration image by default. The asset is included in the published package. You have two options:
|
|
101
|
-
|
|
102
|
-
**Option 1: Copy assets to your public directory (Recommended)**
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
# Copy assets from the package to your public directory
|
|
106
|
-
cp -r node_modules/@asdp/ferryui/dist/assets public/
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Or on Windows:
|
|
110
|
-
|
|
111
|
-
```powershell
|
|
112
|
-
Copy-Item -Recurse node_modules/@asdp/ferryui/dist/assets -Destination public/
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**Option 2: Provide custom image**
|
|
116
|
-
|
|
117
|
-
```tsx
|
|
118
|
-
<ModalRadius
|
|
119
|
-
open={isOpen}
|
|
120
|
-
onClose={() => setIsOpen(false)}
|
|
121
|
-
imageSrc="https://your-cdn.com/custom-image.svg"
|
|
122
|
-
/>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Menggunakan Package di Project Lain
|
|
126
|
-
|
|
127
|
-
### 1. Setup .npmrc
|
|
128
|
-
|
|
129
|
-
Buat file `.npmrc` di root project Anda:
|
|
130
|
-
|
|
131
|
-
```ini
|
|
132
|
-
@asdp:registry=https://gitlab.swamedia.xyz/api/v4/projects/285/packages/npm/
|
|
133
|
-
//gitlab.swamedia.xyz/api/v4/projects/285/packages/npm/:_authToken=${NPM_TOKEN}
|
|
134
|
-
registry=https://registry.npmjs.org/
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### 2. Set Environment Variable
|
|
138
|
-
|
|
139
|
-
**Windows (PowerShell):**
|
|
140
|
-
|
|
141
|
-
```powershell
|
|
142
|
-
$env:NPM_TOKEN="glpat-S6RrDvDBQx5kLzDLbn4W"
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
**Windows (CMD):**
|
|
146
|
-
|
|
147
|
-
```cmd
|
|
148
|
-
set NPM_TOKEN=glpat-S6RrDvDBQx5kLzDLbn4W
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
**Linux/Mac:**
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
export NPM_TOKEN=glpat-S6RrDvDBQx5kLzDLbn4W
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### 3. Install Package
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
npm install @asdp/ferry-ui
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### 4. Import dan Gunakan
|
|
164
|
-
|
|
165
|
-
```typescript
|
|
166
|
-
import { ModalRadius } from "@asdp/ferry-ui";
|
|
167
|
-
|
|
168
|
-
// Gunakan komponen
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## Publishing Package (untuk Maintainers)
|
|
172
|
-
|
|
173
|
-
### 1. Update Version
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
# Patch release (0.1.0 → 0.1.1)
|
|
177
|
-
npm version patch
|
|
178
|
-
|
|
179
|
-
# Minor release (0.1.0 → 0.2.0)
|
|
180
|
-
npm version minor
|
|
181
|
-
|
|
182
|
-
# Major release (0.1.0 → 1.0.0)
|
|
183
|
-
npm version major
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### 2. Publish ke GitLab Registry
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
npm publish
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## CI/CD Integration
|
|
193
|
-
|
|
194
|
-
Package ini bisa dipublish otomatis menggunakan GitLab CI/CD. Lihat `.gitlab-ci.yml` untuk konfigurasi.
|
|
195
|
-
|
|
196
|
-
## Development
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
1
|
+
# @asdp/ferry-ui
|
|
2
|
+
|
|
3
|
+
ASDP Ferry UI Component Library - Internal npm package untuk komponen UI yang digunakan di aplikasi ASDP Integrated Ticketing System.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @asdp/ferry-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup untuk Development
|
|
12
|
+
|
|
13
|
+
### 1. Clone Repository
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git clone https://gitlab.swamedia.xyz/asdp/ferry-ui
|
|
17
|
+
cd ferry-ui
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. Install Dependencies
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 3. Build Package
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm run build
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Components
|
|
33
|
+
|
|
34
|
+
### ModalRadius
|
|
35
|
+
|
|
36
|
+
Modal component untuk menampilkan pesan ketika user berada di luar area pemesanan.
|
|
37
|
+
|
|
38
|
+
#### Props
|
|
39
|
+
|
|
40
|
+
| Prop | Type | Default | Description |
|
|
41
|
+
| --------------- | ------------ | -------------------------------------------- | ---------------------------------------------------- |
|
|
42
|
+
| `open` | `boolean` | - | Whether the modal is open (required) |
|
|
43
|
+
| `onClose` | `() => void` | - | Callback when modal should close (required) |
|
|
44
|
+
| `title` | `string` | `"Anda berada di luar area pemesanan"` | Modal title |
|
|
45
|
+
| `message` | `string` | `"Pemesanan tiket tidak dapat dilakukan..."` | Modal message content |
|
|
46
|
+
| `imageSrc` | `string` | `"/assets/images/illustrations/radius.svg"` | Image source URL |
|
|
47
|
+
| `imageAlt` | `string` | `"Radius Illustration"` | Image alt text |
|
|
48
|
+
| `imageWidth` | `number` | `361` | Image width |
|
|
49
|
+
| `imageHeight` | `number` | `203` | Image height |
|
|
50
|
+
| `buttonText` | `string` | `"Tutup & Coba Lagi"` | Button text |
|
|
51
|
+
| `onButtonClick` | `() => void` | - | Button click handler (optional, defaults to onClose) |
|
|
52
|
+
|
|
53
|
+
#### Usage
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { ModalRadius } from "@asdp/ferry-ui";
|
|
57
|
+
|
|
58
|
+
function App() {
|
|
59
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<ModalRadius
|
|
63
|
+
open={isOpen}
|
|
64
|
+
onClose={() => setIsOpen(false)}
|
|
65
|
+
title="Anda berada di luar area pemesanan"
|
|
66
|
+
message="Pemesanan tiket tidak dapat dilakukan dari lokasi Anda saat ini."
|
|
67
|
+
imageSrc="/assets/images/illustrations/radius.svg"
|
|
68
|
+
buttonText="Tutup & Coba Lagi"
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### With Custom Handler
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { ModalRadius } from "@asdp/ferry-ui";
|
|
78
|
+
|
|
79
|
+
function App() {
|
|
80
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
81
|
+
|
|
82
|
+
const handleRetry = () => {
|
|
83
|
+
// Custom logic
|
|
84
|
+
checkLocation();
|
|
85
|
+
setIsOpen(false);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<ModalRadius
|
|
90
|
+
open={isOpen}
|
|
91
|
+
onClose={() => setIsOpen(false)}
|
|
92
|
+
onButtonClick={handleRetry}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### Using Assets
|
|
99
|
+
|
|
100
|
+
The `ModalRadius` component uses an illustration image by default. The asset is included in the published package. You have two options:
|
|
101
|
+
|
|
102
|
+
**Option 1: Copy assets to your public directory (Recommended)**
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Copy assets from the package to your public directory
|
|
106
|
+
cp -r node_modules/@asdp/ferryui/dist/assets public/
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Or on Windows:
|
|
110
|
+
|
|
111
|
+
```powershell
|
|
112
|
+
Copy-Item -Recurse node_modules/@asdp/ferryui/dist/assets -Destination public/
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Option 2: Provide custom image**
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
<ModalRadius
|
|
119
|
+
open={isOpen}
|
|
120
|
+
onClose={() => setIsOpen(false)}
|
|
121
|
+
imageSrc="https://your-cdn.com/custom-image.svg"
|
|
122
|
+
/>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Menggunakan Package di Project Lain
|
|
126
|
+
|
|
127
|
+
### 1. Setup .npmrc
|
|
128
|
+
|
|
129
|
+
Buat file `.npmrc` di root project Anda:
|
|
130
|
+
|
|
131
|
+
```ini
|
|
132
|
+
@asdp:registry=https://gitlab.swamedia.xyz/api/v4/projects/285/packages/npm/
|
|
133
|
+
//gitlab.swamedia.xyz/api/v4/projects/285/packages/npm/:_authToken=${NPM_TOKEN}
|
|
134
|
+
registry=https://registry.npmjs.org/
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 2. Set Environment Variable
|
|
138
|
+
|
|
139
|
+
**Windows (PowerShell):**
|
|
140
|
+
|
|
141
|
+
```powershell
|
|
142
|
+
$env:NPM_TOKEN="glpat-S6RrDvDBQx5kLzDLbn4W"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Windows (CMD):**
|
|
146
|
+
|
|
147
|
+
```cmd
|
|
148
|
+
set NPM_TOKEN=glpat-S6RrDvDBQx5kLzDLbn4W
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Linux/Mac:**
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
export NPM_TOKEN=glpat-S6RrDvDBQx5kLzDLbn4W
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 3. Install Package
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npm install @asdp/ferry-ui
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 4. Import dan Gunakan
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
import { ModalRadius } from "@asdp/ferry-ui";
|
|
167
|
+
|
|
168
|
+
// Gunakan komponen
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Publishing Package (untuk Maintainers)
|
|
172
|
+
|
|
173
|
+
### 1. Update Version
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Patch release (0.1.0 → 0.1.1)
|
|
177
|
+
npm version patch
|
|
178
|
+
|
|
179
|
+
# Minor release (0.1.0 → 0.2.0)
|
|
180
|
+
npm version minor
|
|
181
|
+
|
|
182
|
+
# Major release (0.1.0 → 1.0.0)
|
|
183
|
+
npm version major
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 2. Publish ke GitLab Registry
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
npm publish
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## CI/CD Integration
|
|
193
|
+
|
|
194
|
+
Package ini bisa dipublish otomatis menggunakan GitLab CI/CD. Lihat `.gitlab-ci.yml` untuk konfigurasi.
|
|
195
|
+
|
|
196
|
+
## Local Development
|
|
197
|
+
|
|
198
|
+
## Development
|
|
199
|
+
|
|
200
|
+
yalc publish
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Install dependencies
|
|
204
|
+
npm install
|
|
205
|
+
|
|
206
|
+
# Build package
|
|
207
|
+
npm run build
|
|
208
|
+
|
|
209
|
+
# Watch mode for development
|
|
210
|
+
npm run dev
|
|
211
|
+
|
|
212
|
+
# Type checking
|
|
213
|
+
npm run typecheck
|
|
214
|
+
|
|
215
|
+
# Run tests
|
|
216
|
+
npm test
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Peer Dependencies
|
|
220
|
+
|
|
221
|
+
Package ini membutuhkan dependencies berikut di project consumer:
|
|
222
|
+
|
|
223
|
+
- `react` ^18.0.0
|
|
224
|
+
- `react-dom` ^18.0.0
|
|
225
|
+
- `@fluentui/react-components` ^9.0.0
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
UNLICENSED - Internal use only
|