@egovernments/digit-ui-components 0.2.3 → 2.0.0-dev-01

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,437 +1,137 @@
1
1
 
2
- # DIGIT UI Components
2
+ # digit-ui-components
3
3
 
4
- A comprehensive React component library for DIGIT platform applications, providing standardized UI components, form composers, and search interfaces.
5
-
6
- ## 📦 Install
4
+ ## Install
7
5
 
8
6
  ```bash
9
7
  npm install --save @egovernments/digit-ui-components
10
8
  ```
11
9
 
12
- **Latest Version: 0.2.1** 🎉
13
-
14
- ## 🚀 What's New in v0.2.1
15
-
16
- ### 🔄 InboxSearchComposer Enhancements
17
-
18
- #### 1. **Enhanced Table Component**
19
- - Replaced old table with **ResultsDataTable** using react-data-table-component (v7.6.2)
20
- - Features: sorting, filtering, selection, pagination, and expandable rows
21
- - Better performance and customization options
22
-
23
- #### 2. **Link Column Support**
24
- ```jsx
25
- {
26
- label: "Id",
27
- jsonPath: "id",
28
- link: true, // Creates clickable links
29
- buttonProps: {
30
- size: "medium",
31
- icon: "Edit",
32
- linkTo: "/edit-page" // Optional: direct navigation
33
- }
34
- }
35
- ```
36
-
37
- #### 3. **Row Selection & Actions**
38
- ```jsx
39
- // Row selection configuration
40
- selectionProps: {
41
- showCheckBox: true,
42
- showSelectedState: true,
43
- selectableRowsNoSelectAll: false,
44
- showSelectedStatePosition: "top" // or "bottom"
45
- }
46
-
47
- // Action buttons for selected rows
48
- actionProps: {
49
- actions: [
50
- { label: "Edit", variation: "secondary", icon: "Edit" },
51
- { label: "Delete", variation: "primary", icon: "Delete" }
52
- ]
53
- }
54
- ```
55
-
56
- #### 4. **Footer Actions**
57
- ```jsx
58
- footerProps: {
59
- showFooter: true,
60
- allowedRolesForFooter: ["ADMIN"],
61
- actionFields: [
62
- {
63
- label: "Previous",
64
- icon: "ArrowBack",
65
- variation: "secondary",
66
- allowedRoles: ["USER"]
67
- },
68
- {
69
- label: "Next",
70
- icon: "ArrowForward",
71
- variation: "primary",
72
- allowedRoles: ["ADMIN"]
73
- }
74
- ],
75
- setactionFieldsToRight: true
76
- }
77
- ```
78
-
79
- #### 5. **Expandable Rows**
80
- ```jsx
81
- const ExpandedComponent = ({ data }) => (
82
- <pre>{JSON.stringify(data, null, 2)}</pre>
83
- );
84
-
85
- expandableProps: {
86
- expandableRows: true,
87
- expandableRowsComponent: ExpandedComponent
88
- }
89
- ```
10
+ ## Limitation
90
11
 
91
- #### 6. **Editable Tables**
92
- - **Inline Editing:** Edit fields directly within table rows
93
- - **Popup Editing:** Edit in modal with additional fields
94
- - **Field Validation:** FieldV1 configurations for consistency
95
-
96
- ```jsx
97
- // Inline editable column
98
- {
99
- label: "Name",
100
- jsonPath: "data.name",
101
- editable: true,
102
- editableFieldConfig: {
103
- type: "text",
104
- validation: { minlength: 2 },
105
- populators: { name: "row.name" }
106
- }
107
- }
108
-
109
- // Additional popup fields
110
- additionalPopupColumns: [
111
- {
112
- label: "Description",
113
- jsonPath: "data.description",
114
- editable: true,
115
- editableFieldConfig: {
116
- type: "textarea",
117
- populators: { name: "row.description" }
118
- }
119
- }
120
- ]
12
+ ```bash
13
+ This Package is more specific to DIGIT-UI's can be used across mission's
121
14
  ```
122
15
 
123
- #### 7. **UICustomizations Handlers**
124
- Enhanced event handling through UICustomizations:
125
-
126
- ```jsx
127
- // Handle link column clicks
128
- linkColumnHandler: (row) => {
129
- const url = `/${window.contextPath}/employee/view?id=${row?.id}`;
130
- window.location.href = url;
131
- },
132
-
133
- // Handle row selections
134
- selectionHandler: (event) => {
135
- const { allSelected, selectedCount, selectedRows } = event;
136
- console.log('Selected:', selectedCount, 'rows');
137
- },
138
-
139
- // Handle action button clicks
140
- actionSelectHandler: (index, label, selectedRows) => {
141
- if (label === "Delete") {
142
- // Handle delete action
143
- }
144
- },
145
-
146
- // Handle footer action clicks
147
- footerActionHandler: (index, event) => {
148
- console.log('Footer action:', index, event);
149
- }
150
- ```
16
+ ## Usage
151
17
 
152
- ### 🎯 FormComposer Enhancements
18
+ After adding the dependency make sure you have this dependency in
153
19
 
154
- #### 1. **Extended Field Types**
155
- Now supports 20+ field types:
156
- ```jsx
157
- // New field types added
158
- "text", "date", "time", "geolocation", "password",
159
- "search", "number", "numeric", "textarea", "radio",
160
- "dropdown", "select", "radioordropdown", "toggle",
161
- "checkbox", "multiselectdropdown", "mobileNumber",
162
- "component", "custom", "amount", "locationdropdown",
163
- "apidropdown", "dateRange"
20
+ ```bash
21
+ frontend/micro-ui/web/package.json
164
22
  ```
165
23
 
166
- #### 2. **Boundary Dropdowns (Dependent Dropdowns)**
167
- ```jsx
168
- {
169
- type: "boundary",
170
- label: "Administrative Area",
171
- populators: {
172
- name: "boundary",
173
- levelConfig: {
174
- lowestLevel: "VILLAGE",
175
- highestLevel: "STATE",
176
- isSingleSelect: ["STATE"] // Single selection for state level
177
- },
178
- hierarchyType: "ADMIN_BOUNDARY",
179
- layoutConfig: {
180
- isDropdownLayoutHorizontal: true,
181
- isLabelFieldLayoutHorizontal: false
182
- },
183
- preSelected: ["STATE_001", "DISTRICT_001"], // Pre-fill values
184
- frozenData: [ // Locked selections
185
- { code: "STATE_001", name: "State 1" }
186
- ]
187
- }
188
- }
24
+ ```json
25
+ "@egovernments/digit-ui-components":"0.0.1",
189
26
  ```
190
27
 
191
- ### 🎨 Major Enhancements
192
- - **🌍 Boundary Dropdowns** for hierarchical administrative boundary selection
193
- - **📊 Editable Tables** with inline editing and popup functionality
194
- - **🎨 Improved Typography & Styling** with responsive design updates
195
- - **🔧 Better Component Variants** for increased flexibility
196
-
197
- ### Breaking Changes
198
- - **MDMS v2 Integration** - Updated prop formats required
199
- - **Pagination Updates** - Enhanced pagination implementation
200
- - **Employee → UserType** - Configuration property updates
201
- - **Custom Row Components** - New structure requirements
202
-
203
- 📖 **[Migration Guide](./migration/v0.2.0-to-v0.2.1-migration-guide.md)** - Complete guide for upgrading from v0.2.0
28
+ then navigate to App.js
204
29
 
205
- ## 🎯 Usage
206
-
207
- ### Installation
208
-
209
- Add the dependency to your package.json:
210
-
211
- ```json
212
- "@egovernments/digit-ui-components": "0.2.1"
30
+ ```bash
31
+ frontend/micro-ui/web/src/App.js
213
32
  ```
214
33
 
215
- ### Basic Import
34
+ # Syntax for importing any components
216
35
 
217
36
  ```jsx
218
- // Import individual components
219
- import { Button, TextInput, FormComposerV2, InboxSearchComposer } from "@egovernments/digit-ui-components";
220
-
221
- // Import SVG icons
222
37
  import { SVG } from "@egovernments/digit-ui-components";
223
38
 
224
- // Usage
225
- <Button variant="primary">Click Me</Button>
226
- <SVG.Accessibility />
39
+ <SVG.Accessibility />;
227
40
  ```
228
41
 
229
- ### Component Categories
230
-
231
- #### 🔧 **Atoms** (Basic Components)
232
- - Button, TextInput, Toggle, Tag, RadioButtons, OTPInput
233
- - Dropdown, MultiSelectDropdown, CheckBox, Chip
234
- - Loader, Toast, Timeline, Stepper, and more
42
+ # Local Development to check storybook
43
+ Use Node 14 version
235
44
 
236
- #### 🧩 **Molecules** (Composite Components)
237
- - CustomDropdown, ApiDropdown, ResultsDataTable
238
- - FilterCard, SummaryCard, FormCard, PanelCard
239
- - Header, Footer, SideNav, BottomSheet
45
+ Step 1
240
46
 
241
- #### 🎯 **HOCs** (Higher Order Components)
242
- - **FormComposerV2** - Dynamic form builder
243
- - **InboxSearchComposer** - Search & inbox interfaces
244
- - **BoundaryFilter** - Hierarchical boundary selection
245
-
246
- ## 📋 Quick Start Examples
247
-
248
- ### FormComposer Usage
249
- ```jsx
250
- import { FormComposerV2 } from "@egovernments/digit-ui-components";
251
-
252
- const formConfig = {
253
- head: "User Details",
254
- body: [
255
- {
256
- type: "text",
257
- label: "Name",
258
- isMandatory: true,
259
- populators: { name: "userName" }
260
- },
261
- {
262
- type: "boundary", // New boundary dropdown
263
- label: "Location",
264
- populators: {
265
- name: "location",
266
- hierarchyType: "ADMIN",
267
- levelConfig: {
268
- lowestLevel: "LOCALITY",
269
- highestLevel: "STATE"
270
- }
271
- }
272
- }
273
- ]
274
- };
275
-
276
- <FormComposerV2
277
- config={[formConfig]}
278
- onSubmit={handleSubmit}
279
- defaultValues={defaultData}
280
- />
281
- ```
282
-
283
- ### InboxSearchComposer Usage
284
- ```jsx
285
- import { InboxSearchComposer } from "@egovernments/digit-ui-components";
286
-
287
- const searchConfig = {
288
- headerLabel: "Search Applications", // Updated from 'label'
289
- type: "search",
290
- actions: { // Updated structure
291
- actionLabel: "Create New",
292
- actionRoles: ["ADMIN"],
293
- actionLink: "/create"
294
- },
295
- // ... rest of config
296
- };
297
-
298
- <div className="digit-inbox-search-wrapper">
299
- <InboxSearchComposer configs={searchConfig} />
300
- </div>
47
+ ```bash
48
+ yarn install
301
49
  ```
302
50
 
303
- ## 🛠️ Local Development
51
+ Step 2
304
52
 
305
- ### Prerequisites
306
- - Node.js 14+
307
- - Yarn package manager
308
-
309
- ### Setup Storybook
310
-
311
- ```bash
312
- # Step 1: Install dependencies
313
- yarn install
314
-
315
- # Step 2: Start Storybook
53
+ ```bash
316
54
  yarn storybook
317
55
  ```
318
56
 
319
- ## 🔄 Migration & Version History
320
-
321
- ### **v0.2.1** (Current) - 2025-10-23
57
+ ### New Changes
322
58
 
323
- #### Major Features
324
- - **Enhanced FormComposer & InboxSearchComposer** with improved config structure
325
- - **Boundary Dropdowns** for hierarchical selection (Country → State → City)
326
- - **Editable Tables** with inline editing and popup functionality
327
- - **Footer Actions** support in InboxSearchComposer
328
- - **Custom Row Components** in ResultsDataTable
59
+ ## [0.0.1-beta.28] - 2024-05-24
329
60
 
330
- #### 🐛 Key Fixes
331
- - Fixed pagination issues in InboxSearchComposer
332
- - Resolved dropdown text clearing after re-render
333
- - Fixed multiple API call prevention
334
- - Improved error handling across components
61
+ - Added restrictSelection prop in Multiselectdropdown. If this is sent as true, it restricts any option to get selected.
335
62
 
336
- #### ⚠️ Breaking Changes
337
- - `label` → `headerLabel` in InboxSearchComposer configs
338
- - `employee` → `userType` in actionLink configurations
339
- - MDMS v2 prop format requirements
340
- - Enhanced pagination implementation
63
+ - Usage:
64
+ ```jsx
65
+ <MultiSelectDropdown
66
+ restrictSelection={true}
67
+ />
68
+ ```
341
69
 
342
- **📖 [Full Migration Guide](./migration/v0.2.0-to-v0.2.1-migration-guide.md)**
70
+ ### Breaking Changes while migrating from any version below 0.0.1-beta.22
343
71
 
344
- ### **v0.2.0** - Previous Major Release
72
+ ## [0.0.1-beta.22] - 2024-05-20
345
73
 
346
- #### New Components Added
347
- - Error Message, Info Button, Panels, Popup Components
348
- - Stepper, TextBlock, Timeline Components
349
- - Uploader variants (UploadFile, UploadPopup, UploadImage)
350
- - PanelCard Molecule
74
+ - Toast Component: From this version of `ui-components`, the `Toast` component has a new prop named `type`, replacing the separate props for `info`, `warning`, and `error`.
75
+ - Old Usage:
76
+ ```jsx
77
+ <Toast info={true} label={"Info Toast"} />
78
+ <Toast warning="warning" label={"Warning Toast"}/>
79
+ <Toast error={true} label={"Error Toast"}/>
80
+ ```
81
+ - New Usage:
82
+ ```jsx
83
+ <Toast type="info" label={"Info Toast"} />
84
+ <Toast type="warning" label={"Warning Toast"} />
85
+ <Toast type="error" label={"Error Toast"} />
86
+ <Toast type="success" label={"Success Toast"} />
87
+ ```
351
88
 
352
- #### Enhancements
353
- - Updated Button & Dropdown Component Styles
354
- - Toast animations and new `type` prop
355
- - Typography updates with lineHeight
356
- - Enhanced Color Typography
89
+ ## Changelog
357
90
 
358
- ### Migration Examples
91
+ ### Summary for Version [0.0.2] - 2024-06-03
359
92
 
360
- #### Toast Component (v0.2.0 Breaking Change)
361
- ```jsx
362
- // ❌ Old Usage (pre v0.2.0)
363
- <Toast info={true} label={"Info Toast"} />
364
- <Toast warning="warning" label={"Warning Toast"}/>
365
-
366
- // ✅ New Usage (v0.2.0+)
367
- <Toast type="info" label={"Info Toast"} />
368
- <Toast type="warning" label={"Warning Toast"} />
369
- <Toast type="success" label={"Success Toast"} />
370
- ```
93
+ #### New Changes
371
94
 
372
- #### InboxSearchComposer Config (v0.2.1 Breaking Change)
373
- ```jsx
374
- // Old Config (v0.2.0)
375
- const oldConfig = {
376
- label: "Search Applications",
377
- actionLabel: "Create",
378
- actionRoles: ["ADMIN"]
379
- };
380
-
381
- // New Config (v0.2.1)
382
- const newConfig = {
383
- headerLabel: "Search Applications", // Changed from 'label'
384
- actions: { // Grouped under 'actions'
385
- actionLabel: "Create",
386
- actionRoles: ["ADMIN"],
387
- actionLink: "/create"
388
- }
389
- };
390
- ```
95
+ - Added Error Message Component.
96
+ - Added Info Button Component.
97
+ - Added Panels Component.
98
+ - Added Popup Component with two variants: `default` and `alert`.
99
+ - Added RemoveableTag Component.
100
+ - Added Stepper Component.
101
+ - Added TextBlock Component.
102
+ - Added Timeline Component.
103
+ - Added Uploader Component with three variants: `UploadFile`, `UploadPopup`, and `UploadImage`.
104
+ - Added PanelCard Molecule.
391
105
 
392
- ## 📖 Documentation & Resources
106
+ #### Enhancements
393
107
 
394
- ### 📚 **Documentation**
395
- - **[Full Documentation](./DOCUMENTATION.md)** - Comprehensive component documentation
396
- - **[Migration Guide](./migration/v0.2.0-to-v0.2.1-migration-guide.md)** - Step-by-step upgrade instructions
397
- - **[Changelog](./CHANGELOG.md)** - Detailed version history and changes
108
+ - Updated Button Component Styles.
109
+ - Updated Dropdown Component Styles and added SelectAll Option.
110
+ - Updated InfoCard Component Styles.
111
+ - Added Animation for Toast.
112
+ - Added new prop `type` for Toast, replacing the separate props for `info`, `warning`, and `error`.
113
+ - Updated Typography with lineHeight.
114
+ - Updated Color Typography.
398
115
 
399
- ### 📋 **Sample Configurations & Examples**
400
- - **[Sample Configs](https://github.com/egovernments/DIGIT-Frontend/tree/sample/micro-ui/web/micro-ui-internals/packages/modules/sample/src/configs/uiComponentsConfigs)** - Complete configuration examples
401
- - **[Sample Module Screens](https://github.com/egovernments/DIGIT-Frontend/tree/sample/micro-ui/web/micro-ui-internals/packages/modules/sample)** - Integration examples with new components
402
- - **[Boundary Dropdown Examples](https://github.com/egovernments/DIGIT-Frontend/blob/sample/micro-ui/web/micro-ui-internals/packages/modules/sample/src/configs/uiComponentsConfigs/boundaryConfig.js)** - Dependent dropdown configurations
403
- - **[Editable Table Examples](https://github.com/egovernments/DIGIT-Frontend/blob/sample/micro-ui/web/micro-ui-internals/packages/modules/sample/src/configs/uiComponentsConfigs/editableTableConfig.js)** - Inline and popup editing configs
116
+ For a detailed changelog, see the [CHANGELOG.md](./CHANGELOG.md) file.
404
117
 
405
- ### 🎨 **Live Examples**
406
- - **[Storybook](https://unified-dev.digit.org/storybook/)** - Interactive component playground
407
- - **[Official DIGIT Documentation](https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui/ui-components-standardisation/digit-ui-components0.2.0)** - Integration guides
118
+ ## Published from DIGIT-UI-LIBRARIES
408
119
 
409
- ### 🔗 **Links**
410
- - **[Source Repository](https://github.com/egovernments/DIGIT-UI-LIBRARIES/tree/develop)** - Main development repository
411
- - **[NPM Package](https://www.npmjs.com/package/@egovernments/digit-ui-components)** - Published package
120
+ DIGIT-UI-LIBRARIES Repo (https://github.com/egovernments/DIGIT-UI-LIBRARIES/tree/master)
412
121
 
413
- ## 🤝 Contributors
122
+ # Contributors
414
123
 
415
- Special thanks to our contributors:
416
- - [@swathi-egov](https://github.com/swathi-egov)
417
- - [@nabeelmd-egov](https://github.com/nabeelmd-egov)
418
- - [@bhavya-eGov](https://github.com/bhavya-eGov)
419
- - [@nipunarora-eGov](https://github.com/nipunarora-eGov)
420
- - [@tulika-egov](https://github.com/tulika-egov)
421
- - [@jagankumar-egov](https://github.com/jagankumar-egov)
422
- - [@Ramkrishna-egov](https://github.com/Ramkrishna-egov)
423
- - [@piyushraj-egov](https://github.com/piyushraj-egov)
124
+ [nabeelmd-egov] [bhavya-eGov] [nipunarora-eGov] [swathi-egov] [jagankumar-egov]
424
125
 
425
- ## 📄 License
126
+ # Reference
426
127
 
427
- MIT © [jagankumar-egov](https://github.com/jagankumar-egov)
128
+ Storybook (https://unified-dev.digit.org/storybook/)
428
129
 
429
- ## 🏛️ About DIGIT
130
+ Documentation (https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui/ui-components-standardisation/digit-ui-components0.2.0)
430
131
 
431
- This component library is part of the **DIGIT** (Digital Infrastructure for Governance, Impact & Transformation) platform - India's largest open-source platform for digital governance.
132
+ ## License
432
133
 
433
- ![DIGIT Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png)
134
+ MIT © [jagankumar-egov](https://github.com/jagankumar-egov)
434
135
 
435
- ---
136
+ ![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png)
436
137
 
437
- **🎯 Ready to build with DIGIT UI Components?** Start with our [Quick Start Guide](#-quick-start-examples) or explore the [Storybook](https://unified-dev.digit.org/storybook/) for interactive examples!