@wereform/pkgm-shared 1.0.0 → 1.0.1

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 +282 -18
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,30 +1,294 @@
1
1
  # @begenone/pkgm-shared
2
2
 
3
- This is the **shared utility and components** package used across all BEGENONE modules.
3
+ Shared UI components and utilities for the BEGENONE / WeReform ecosystem.
4
4
 
5
- ## Overview
5
+ This package contains reusable, design-system–level building blocks used across mobile and web experiences. It includes buttons, inputs, dropdowns, headers, menus, metadata components, and small utilities that standardize interaction and presentation across the platform.
6
6
 
7
- It holds **reusable code** that needs to be accessed from multiple packages — reducing duplication and ensuring consistent logic.
7
+ ---
8
8
 
9
- ## Contents
9
+ ## Install
10
10
 
11
- - 🧩 UI components (buttons, cards, loaders)
12
- - 🔁 Utility functions (formatting, parsing, validators)
13
- - 🔐 Auth context & hooks
14
- - 🌐 API layer helpers
11
+ ```bash
12
+ npm install @begenone/pkgm-shared
13
+ # or
14
+ yarn add @begenone/pkgm-shared
15
+ # or
16
+ pnpm add @begenone/pkgm-shared
17
+ ```
15
18
 
16
- ## Features
19
+ ---
17
20
 
18
- - Single source of truth for design components
19
- - Shared logic between channel, video, wire, and settings packages
20
- - Centralized error and logging utilities
21
+ ## What this package gives you
21
22
 
22
- ## Usage
23
+ - Core UI components:
23
24
 
24
- Imported by all other packages that require consistent behavior or style.
25
+ - Customizable buttons
26
+ - Input fields and comment inputs
27
+ - Dropdown selector
28
+ - Global header
29
+ - Navigation menus
30
+ - Interaction menus
31
+ - Channel metadata blocks
32
+ - Title and date/views helpers
25
33
 
26
- ## Tech Stack
34
+ - Utilities:
27
35
 
28
- - React + React Native
29
- - TypeScript
30
- - React Context & Hooks
36
+ - URL normalization helper
37
+
38
+ - Built for:
39
+
40
+ - React Native / Expo
41
+ - Mobile-first layouts
42
+ - Reuse across multiple packages (`pkgm-channel`, `pkgm-settings`, etc.)
43
+
44
+ ---
45
+
46
+ ## Exports
47
+
48
+ From `@begenone/pkgm-shared` you can import:
49
+
50
+ ```ts
51
+ import {
52
+ CustomizedButton,
53
+ DropDown,
54
+ InputField,
55
+ InputComment,
56
+ HeaderGlobal,
57
+ MenuNav,
58
+ MenuInteraction,
59
+ MenuChannelMeta,
60
+ CustomizedTitle,
61
+ DateViews,
62
+ normalizeUrl,
63
+ } from "@begenone/pkgm-shared";
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Core components
69
+
70
+ ## CustomizedButton
71
+
72
+ Highly flexible button component with press feedback and optional icons.
73
+
74
+ ### Props
75
+
76
+ ```ts
77
+ CustomizedButton({
78
+ label,
79
+ onPress,
80
+ onPressStyle,
81
+ textColor,
82
+ fontSize,
83
+ fontFamily,
84
+ fontWeight,
85
+ customIcon,
86
+ style,
87
+ isDisabled,
88
+ });
89
+ ```
90
+
91
+ - Supports press-in visual feedback
92
+ - Allows custom icons and typography
93
+ - Gracefully warns if required props are missing
94
+
95
+ ---
96
+
97
+ ## InputField
98
+
99
+ Reusable text input component with icon support and multiline handling.
100
+
101
+ ### Props
102
+
103
+ ```ts
104
+ InputField({
105
+ placeholder,
106
+ error,
107
+ iconLeft,
108
+ iconRight,
109
+ onIconPress,
110
+ iconRightColor,
111
+ inputStyle,
112
+ inputWrapper,
113
+ multiline,
114
+ onChangeText,
115
+ isEditable,
116
+ secureTextEntry,
117
+ });
118
+ ```
119
+
120
+ - Uses Inter font via Expo
121
+ - Supports left and right icons
122
+ - Handles single-line and multi-line inputs
123
+
124
+ ---
125
+
126
+ ## DropDown
127
+
128
+ Modal-based dropdown selector built on `react-native-modal-selector`.
129
+
130
+ ### Props
131
+
132
+ ```ts
133
+ DropDown({
134
+ selectText,
135
+ data,
136
+ styles,
137
+ iconStyles,
138
+ });
139
+ ```
140
+
141
+ - Displays label-based selections
142
+ - Fully stylable container and icon
143
+
144
+ ---
145
+
146
+ ## HeaderGlobal
147
+
148
+ Top-level header with brand logo and action icons.
149
+
150
+ ```ts
151
+ HeaderGlobal({
152
+ aiIcon,
153
+ notificationIcon,
154
+ searchIcon,
155
+ });
156
+ ```
157
+
158
+ ---
159
+
160
+ ## MenuNav
161
+
162
+ Bottom or primary navigation bar component.
163
+
164
+ ```ts
165
+ MenuNav({
166
+ homeIcon,
167
+ wireIcon,
168
+ uploadIcon,
169
+ channelIcon,
170
+ profileIcon,
171
+ onPressHome,
172
+ onPressWire,
173
+ onPressUpload,
174
+ onPressChannel,
175
+ onPressProfile,
176
+ });
177
+ ```
178
+
179
+ ---
180
+
181
+ ## MenuInteraction
182
+
183
+ Interaction menu for content actions such as share, comment, repost, like, and dislike.
184
+
185
+ ```ts
186
+ MenuInteraction({
187
+ containerStyles,
188
+ columnMainIconStyles,
189
+ pressed,
190
+ });
191
+ ```
192
+
193
+ ---
194
+
195
+ ## MenuChannelMeta
196
+
197
+ Displays channel metadata including logo, username, subscriber count, and subscribe action.
198
+
199
+ ```ts
200
+ MenuChannelMeta({
201
+ timeAgo,
202
+ viewsText,
203
+ channelLogo,
204
+ userName,
205
+ subscribersCount,
206
+ containerStyles,
207
+ channelContainerStyles,
208
+ });
209
+ ```
210
+
211
+ ---
212
+
213
+ ## CustomizedTitle
214
+
215
+ Title renderer with automatic truncation and typography control.
216
+
217
+ ```ts
218
+ CustomizedTitle({
219
+ title,
220
+ fontSize,
221
+ fontFamily,
222
+ textColor,
223
+ style,
224
+ textStyle,
225
+ });
226
+ ```
227
+
228
+ ---
229
+
230
+ ## Utilities
231
+
232
+ ## DateViews
233
+
234
+ Displays publish date and view count metadata.
235
+
236
+ ```ts
237
+ DateViews({
238
+ timeAgo,
239
+ viewsText,
240
+ containerStyles,
241
+ dateTextStyles,
242
+ viewsTextStyles,
243
+ dateContainerStyles,
244
+ });
245
+ ```
246
+
247
+ ---
248
+
249
+ ## normalizeUrl
250
+
251
+ Normalizes user-provided URLs into safe, clickable links.
252
+
253
+ ```ts
254
+ normalizeUrl(url): string | null
255
+ ```
256
+
257
+ - Adds `https://` when missing
258
+ - Returns `null` for invalid inputs
259
+
260
+ ---
261
+
262
+ ## Design philosophy
263
+
264
+ - Single source of truth for shared UI
265
+ - No API calls or business logic
266
+ - Consistent visual language across packages
267
+ - Mobile-first, composable components
268
+ - Designed to scale with the BEGENONE ecosystem
269
+
270
+ ---
271
+
272
+ ## License
273
+
274
+ MIT License
275
+
276
+ Copyright (c) 2025 BEGENONE / WeReform
277
+
278
+ Permission is hereby granted, free of charge, to any person obtaining a copy
279
+ of this software and associated documentation files (the “Software”), to deal
280
+ in the Software without restriction, including without limitation the rights
281
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
282
+ copies of the Software, and to permit persons to whom the Software is
283
+ furnished to do so, subject to the following conditions:
284
+
285
+ The above copyright notice and this permission notice shall be included in
286
+ all copies or substantial portions of the Software.
287
+
288
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
289
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
290
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
291
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
292
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
293
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
294
+ THE SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wereform/pkgm-shared",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "build": "babel src --out-dir dist --extensions .js,.jsx"