@asdp/ferryui 0.1.22-dev.0 → 0.1.22-dev.8491
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 +74 -180
- package/dist/index.css +31 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +895 -48
- package/dist/index.d.ts +895 -48
- package/dist/index.js +2946 -360
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2928 -363
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -2,228 +2,122 @@
|
|
|
2
2
|
|
|
3
3
|
ASDP Ferry UI Component Library - Internal npm package untuk komponen UI yang digunakan di aplikasi ASDP Integrated Ticketing System.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 🚀 Getting Started
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
npm install @asdp/ferry-ui
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
### Peer Dependencies
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
Ensure your project has the following dependencies:
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
cd ferry-ui
|
|
18
|
-
```
|
|
17
|
+
- `react` >= 18.0.0
|
|
18
|
+
- `@fluentui/react-components` >= 9.0.0
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
---
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
npm install
|
|
24
|
-
```
|
|
22
|
+
## 🛠️ Development
|
|
25
23
|
|
|
26
|
-
###
|
|
24
|
+
### Scripts
|
|
27
25
|
|
|
28
26
|
```bash
|
|
29
|
-
|
|
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
|
|
27
|
+
# Install dependencies
|
|
28
|
+
npm install
|
|
75
29
|
|
|
76
|
-
|
|
77
|
-
|
|
30
|
+
# Start development server (Watch mode)
|
|
31
|
+
npm run dev
|
|
78
32
|
|
|
79
|
-
|
|
80
|
-
|
|
33
|
+
# Build package
|
|
34
|
+
npm run build
|
|
81
35
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
checkLocation();
|
|
85
|
-
setIsOpen(false);
|
|
86
|
-
};
|
|
36
|
+
# Run Storybook
|
|
37
|
+
npm run storybook
|
|
87
38
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
open={isOpen}
|
|
91
|
-
onClose={() => setIsOpen(false)}
|
|
92
|
-
onButtonClick={handleRetry}
|
|
93
|
-
/>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
39
|
+
# Type Checking
|
|
40
|
+
npm run typecheck
|
|
96
41
|
```
|
|
97
42
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
The `ModalRadius` component uses an illustration image by default. The asset is included in the published package. You have two options:
|
|
43
|
+
### Local Development Workflow (Important!)
|
|
101
44
|
|
|
102
|
-
|
|
45
|
+
We use **yalc** to simulate package publishing locally.
|
|
103
46
|
|
|
104
|
-
|
|
105
|
-
# Copy assets from the package to your public directory
|
|
106
|
-
cp -r node_modules/@asdp/ferryui/dist/assets public/
|
|
107
|
-
```
|
|
47
|
+
1. **Install yalc globally** (if not already installed):
|
|
108
48
|
|
|
109
|
-
|
|
49
|
+
```bash
|
|
50
|
+
npm install -g yalc
|
|
51
|
+
```
|
|
110
52
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
```
|
|
53
|
+
2. **In `ferryui` directory:**
|
|
54
|
+
After making changes, publish them locally:
|
|
114
55
|
|
|
115
|
-
|
|
56
|
+
```bash
|
|
57
|
+
yalc publish --push
|
|
58
|
+
```
|
|
116
59
|
|
|
117
|
-
|
|
118
|
-
<ModalRadius
|
|
119
|
-
open={isOpen}
|
|
120
|
-
onClose={() => setIsOpen(false)}
|
|
121
|
-
imageSrc="https://your-cdn.com/custom-image.svg"
|
|
122
|
-
/>
|
|
123
|
-
```
|
|
60
|
+
_`--push` will automatically update projects that have added this package via yalc._
|
|
124
61
|
|
|
125
|
-
|
|
62
|
+
3. **In Consumer Project (e.g., ferizy):**
|
|
63
|
+
If the package doesn't update automatically, run:
|
|
64
|
+
```bash
|
|
65
|
+
yalc update
|
|
66
|
+
```
|
|
126
67
|
|
|
127
|
-
###
|
|
68
|
+
### CI/CD Deployment
|
|
128
69
|
|
|
129
|
-
|
|
70
|
+
- **Development/Staging**: Automated deployment to GitLab Package Registry runs on every merge to the `dev` branch.
|
|
71
|
+
- **Production**: Automated deployment runs when a new tag is created.
|
|
130
72
|
|
|
131
|
-
|
|
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
|
-
```
|
|
73
|
+
**Note:** You do not need to manually run `npm publish`.
|
|
136
74
|
|
|
137
|
-
|
|
75
|
+
---
|
|
138
76
|
|
|
139
|
-
|
|
77
|
+
## 📂 Project Structure
|
|
140
78
|
|
|
141
|
-
```powershell
|
|
142
|
-
$env:NPM_TOKEN="glpat-S6RrDvDBQx5kLzDLbn4W"
|
|
143
79
|
```
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
80
|
+
src/
|
|
81
|
+
├── components/ # Reusable UI Components
|
|
82
|
+
│ ├── [ComponentName]/ # Self-contained component folders
|
|
83
|
+
│ │ ├── index.ts # Public API
|
|
84
|
+
│ │ ├── [Name].tsx # Implementation
|
|
85
|
+
│ │ ├── [Name].stories.tsx # Documentation
|
|
86
|
+
│ │ └── ...
|
|
87
|
+
├── hooks/ # Shared hooks
|
|
88
|
+
├── utils/ # Utility functions
|
|
89
|
+
└── index.ts # Main library export
|
|
149
90
|
```
|
|
150
91
|
|
|
151
|
-
|
|
92
|
+
---
|
|
152
93
|
|
|
153
|
-
|
|
154
|
-
export NPM_TOKEN=glpat-S6RrDvDBQx5kLzDLbn4W
|
|
155
|
-
```
|
|
94
|
+
## 🧩 Components Usage
|
|
156
95
|
|
|
157
|
-
|
|
96
|
+
This library is built on top of **Fluent UI React v9**.
|
|
158
97
|
|
|
159
|
-
|
|
160
|
-
npm install @asdp/ferry-ui
|
|
161
|
-
```
|
|
98
|
+
### Example: ModalRadius
|
|
162
99
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
```typescript
|
|
100
|
+
```tsx
|
|
166
101
|
import { ModalRadius } from "@asdp/ferry-ui";
|
|
102
|
+
import { useState } from "react";
|
|
167
103
|
|
|
168
|
-
|
|
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
|
|
104
|
+
function App() {
|
|
105
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
214
106
|
|
|
215
|
-
|
|
216
|
-
|
|
107
|
+
return (
|
|
108
|
+
<ModalRadius
|
|
109
|
+
open={isOpen}
|
|
110
|
+
onClose={() => setIsOpen(false)}
|
|
111
|
+
title="Outside Area"
|
|
112
|
+
message="You are outside the allowed booking radius."
|
|
113
|
+
buttonText="Retry"
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
217
117
|
```
|
|
218
118
|
|
|
219
|
-
|
|
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
|
|
119
|
+
---
|
|
226
120
|
|
|
227
|
-
## License
|
|
121
|
+
## 📄 License
|
|
228
122
|
|
|
229
|
-
UNLICENSED - Internal use only
|
|
123
|
+
**UNLICENSED** - Internal use only for ASDP Indonesia Ferry.
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* src/components/ModalSelectDate/modalSelectDate.css */
|
|
2
|
+
.fui-Calendar {
|
|
3
|
+
width: 100% !important;
|
|
4
|
+
}
|
|
5
|
+
.fui-CalendarDay {
|
|
6
|
+
width: 100% !important;
|
|
7
|
+
}
|
|
8
|
+
.fui-CalendarDayGrid__table {
|
|
9
|
+
width: 100% !important;
|
|
10
|
+
}
|
|
11
|
+
.fui-Calendar__monthPickerWrapper {
|
|
12
|
+
width: 100% !important;
|
|
13
|
+
}
|
|
14
|
+
.fui-CalendarPicker {
|
|
15
|
+
width: 100% !important;
|
|
16
|
+
}
|
|
17
|
+
.fui-CalendarPicker__buttonRow {
|
|
18
|
+
justify-content: space-between !important;
|
|
19
|
+
display: flex !important;
|
|
20
|
+
}
|
|
21
|
+
.fui-CalendarPicker__selected {
|
|
22
|
+
background-color: var(--colorBrandBackground) !important;
|
|
23
|
+
color: var(--colorNeutralForegroundOnBrand) !important;
|
|
24
|
+
}
|
|
25
|
+
.fui-CalendarDayGrid__dayButton {
|
|
26
|
+
background-color: transparent !important;
|
|
27
|
+
:hover {
|
|
28
|
+
background-color: transparent !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ModalSelectDate/modalSelectDate.css"],"sourcesContent":[".fui-Calendar {\n width: 100% !important;\n}\n\n.fui-CalendarDay {\n width: 100% !important;\n}\n\n.fui-CalendarDayGrid__table {\n width: 100% !important;\n}\n\n.fui-Calendar__monthPickerWrapper {\n width: 100% !important;\n}\n\n.fui-CalendarPicker {\n width: 100% !important;\n}\n\n.fui-CalendarPicker__buttonRow {\n justify-content: space-between !important;\n display: flex !important;\n}\n.fui-CalendarPicker__selected{\n background-color: var(--colorBrandBackground) !important;\n color: var(--colorNeutralForegroundOnBrand) !important;\n}\n.fui-CalendarDayGrid__dayButton{\n background-color: transparent !important;\n :hover{\n background-color: transparent !important;\n }\n}"],"mappings":";AAAA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,mBAAiB;AACjB,WAAS;AACX;AACA,CAAC;AACC,oBAAkB,IAAI;AACtB,SAAO,IAAI;AACb;AACA,CAAC;AACC,oBAAkB;AAClB;AACE,sBAAkB;AACpB;AACF;","names":[]}
|