@asdp/ferryui 0.1.20 → 0.1.22-dev.10038

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
@@ -2,228 +2,128 @@
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
- ## Installation
5
+ ## 🚀 Getting Started
6
+
7
+ ### Installation
6
8
 
7
9
  ```bash
8
10
  npm install @asdp/ferry-ui
9
11
  ```
10
12
 
11
- ## Setup untuk Development
13
+ ### Peer Dependencies
12
14
 
13
- ### 1. Clone Repository
15
+ Ensure your project has the following dependencies:
14
16
 
15
- ```bash
16
- git clone https://gitlab.swamedia.xyz/asdp/ferry-ui
17
- cd ferry-ui
18
- ```
17
+ - `react` >= 18.0.0
18
+ - `@fluentui/react-components` >= 9.0.0
19
19
 
20
- ### 2. Install Dependencies
20
+ ---
21
21
 
22
- ```bash
23
- npm install
24
- ```
22
+ ## 🛠️ Development
25
23
 
26
- ### 3. Build Package
24
+ ### Scripts
27
25
 
28
26
  ```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);
27
+ # Install dependencies
28
+ npm install
60
29
 
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
- ```
30
+ # Start development server (Watch mode)
31
+ npm run dev
73
32
 
74
- #### With Custom Handler
33
+ # Build package
34
+ npm run build
75
35
 
76
- ```tsx
77
- import { ModalRadius } from "@asdp/ferry-ui";
36
+ # Run Storybook
37
+ npm run storybook
78
38
 
79
- function App() {
80
- const [isOpen, setIsOpen] = useState(false);
39
+ # Build Storybook (Production)
40
+ npm run build-storybook
81
41
 
82
- const handleRetry = () => {
83
- // Custom logic
84
- checkLocation();
85
- setIsOpen(false);
86
- };
42
+ # Serve Production Build
43
+ npm run serve-storybook
87
44
 
88
- return (
89
- <ModalRadius
90
- open={isOpen}
91
- onClose={() => setIsOpen(false)}
92
- onButtonClick={handleRetry}
93
- />
94
- );
95
- }
45
+ # Type Checking
46
+ npm run typecheck
96
47
  ```
97
48
 
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:
49
+ ### Local Development Workflow (Important!)
101
50
 
102
- **Option 1: Copy assets to your public directory (Recommended)**
51
+ We use **yalc** to simulate package publishing locally.
103
52
 
104
- ```bash
105
- # Copy assets from the package to your public directory
106
- cp -r node_modules/@asdp/ferryui/dist/assets public/
107
- ```
53
+ 1. **Install yalc globally** (if not already installed):
108
54
 
109
- Or on Windows:
55
+ ```bash
56
+ npm install -g yalc
57
+ ```
110
58
 
111
- ```powershell
112
- Copy-Item -Recurse node_modules/@asdp/ferryui/dist/assets -Destination public/
113
- ```
59
+ 2. **In `ferryui` directory:**
60
+ After making changes, publish them locally:
114
61
 
115
- **Option 2: Provide custom image**
62
+ ```bash
63
+ yalc publish --push
64
+ ```
116
65
 
117
- ```tsx
118
- <ModalRadius
119
- open={isOpen}
120
- onClose={() => setIsOpen(false)}
121
- imageSrc="https://your-cdn.com/custom-image.svg"
122
- />
123
- ```
66
+ _`--push` will automatically update projects that have added this package via yalc._
124
67
 
125
- ## Menggunakan Package di Project Lain
68
+ 3. **In Consumer Project (e.g., ferizy):**
69
+ If the package doesn't update automatically, run:
70
+ ```bash
71
+ yalc update
72
+ ```
126
73
 
127
- ### 1. Setup .npmrc
74
+ ### CI/CD Deployment
128
75
 
129
- Buat file `.npmrc` di root project Anda:
76
+ - **Development/Staging**: Automated deployment to GitLab Package Registry runs on every merge to the `dev` branch.
77
+ - **Production**: Automated deployment runs when a new tag is created.
130
78
 
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
- ```
79
+ **Note:** You do not need to manually run `npm publish`.
136
80
 
137
- ### 2. Set Environment Variable
81
+ ---
138
82
 
139
- **Windows (PowerShell):**
83
+ ## 📂 Project Structure
140
84
 
141
- ```powershell
142
- $env:NPM_TOKEN="glpat-S6RrDvDBQx5kLzDLbn4W"
143
85
  ```
144
-
145
- **Windows (CMD):**
146
-
147
- ```cmd
148
- set NPM_TOKEN=glpat-S6RrDvDBQx5kLzDLbn4W
86
+ src/
87
+ ├── components/ # Reusable UI Components
88
+ │ ├── [ComponentName]/ # Self-contained component folders
89
+ │ │ ├── index.ts # Public API
90
+ │ │ ├── [Name].tsx # Implementation
91
+ │ │ ├── [Name].stories.tsx # Documentation
92
+ │ │ └── ...
93
+ ├── hooks/ # Shared hooks
94
+ ├── utils/ # Utility functions
95
+ └── index.ts # Main library export
149
96
  ```
150
97
 
151
- **Linux/Mac:**
98
+ ---
152
99
 
153
- ```bash
154
- export NPM_TOKEN=glpat-S6RrDvDBQx5kLzDLbn4W
155
- ```
100
+ ## 🧩 Components Usage
156
101
 
157
- ### 3. Install Package
102
+ This library is built on top of **Fluent UI React v9**.
158
103
 
159
- ```bash
160
- npm install @asdp/ferry-ui
161
- ```
162
-
163
- ### 4. Import dan Gunakan
104
+ ### Example: ModalRadius
164
105
 
165
- ```typescript
106
+ ```tsx
166
107
  import { ModalRadius } from "@asdp/ferry-ui";
108
+ import { useState } from "react";
167
109
 
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
110
+ function App() {
111
+ const [isOpen, setIsOpen] = useState(false);
214
112
 
215
- # Run tests
216
- npm test
113
+ return (
114
+ <ModalRadius
115
+ open={isOpen}
116
+ onClose={() => setIsOpen(false)}
117
+ title="Outside Area"
118
+ message="You are outside the allowed booking radius."
119
+ buttonText="Retry"
120
+ />
121
+ );
122
+ }
217
123
  ```
218
124
 
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
125
+ ---
226
126
 
227
- ## License
127
+ ## 📄 License
228
128
 
229
- UNLICENSED - Internal use only
129
+ **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":[]}