@emporix/cockpit-component-library 1.0.2 โ 1.0.4
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 +78 -50
- package/dist/index.d.ts +1252 -0
- package/dist/index.es.js +2513 -0
- package/dist/index.umd.js +49 -0
- package/dist/quill-B5-e7UWH.js +7531 -0
- package/dist/style.css +7 -0
- package/dist/styles.d.ts +1 -0
- package/package.json +6 -4
- package/dist/assets/index-2pPRHV5R.css +0 -1
- package/dist/assets/index-Ds9O7aHV.js +0 -40
- package/dist/index.html +0 -14
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ A modern React component library built with TypeScript, Vite, and SCSS modules.
|
|
|
9
9
|
- ๐ **Storybook**: Interactive component documentation
|
|
10
10
|
- ๐งช **Testing**: Comprehensive test suite with Vitest and React Testing Library
|
|
11
11
|
- ๐ฆ **Library Build**: Optimized for npm package distribution
|
|
12
|
-
- ๐ **CI/CD**: Automated testing
|
|
12
|
+
- ๐ **CI/CD**: Automated testing on push/PR; npm publish on version tags
|
|
13
13
|
- ๐จ **CSS Variables**: Global theming system with CSS custom properties
|
|
14
14
|
|
|
15
15
|
## Quick Start
|
|
@@ -362,8 +362,7 @@ Secondary action button variant with API similar to `PrimaryButton`.
|
|
|
362
362
|
|
|
363
363
|
```tsx
|
|
364
364
|
import { SecondaryButton } from '@emporix/cockpit-component-library'
|
|
365
|
-
|
|
366
|
-
<SecondaryButton label="Cancel" />
|
|
365
|
+
;<SecondaryButton label='Cancel' />
|
|
367
366
|
```
|
|
368
367
|
|
|
369
368
|
### TertiaryButton
|
|
@@ -372,8 +371,7 @@ Low-emphasis button for tertiary actions.
|
|
|
372
371
|
|
|
373
372
|
```tsx
|
|
374
373
|
import { TertiaryButton } from '@emporix/cockpit-component-library'
|
|
375
|
-
|
|
376
|
-
<TertiaryButton label="Learn more" />
|
|
374
|
+
;<TertiaryButton label='Learn more' />
|
|
377
375
|
```
|
|
378
376
|
|
|
379
377
|
### ContrastButton
|
|
@@ -382,8 +380,7 @@ Button variant designed for high-contrast contexts.
|
|
|
382
380
|
|
|
383
381
|
```tsx
|
|
384
382
|
import { ContrastButton } from '@emporix/cockpit-component-library'
|
|
385
|
-
|
|
386
|
-
<ContrastButton label="Open" />
|
|
383
|
+
;<ContrastButton label='Open' />
|
|
387
384
|
```
|
|
388
385
|
|
|
389
386
|
### Dropdown
|
|
@@ -392,8 +389,7 @@ Single-select dropdown component with optional filtering, editable mode, and tem
|
|
|
392
389
|
|
|
393
390
|
```tsx
|
|
394
391
|
import { Dropdown } from '@emporix/cockpit-component-library'
|
|
395
|
-
|
|
396
|
-
<Dropdown options={options} value={value} onChange={(e) => setValue(e.value)} />
|
|
392
|
+
;<Dropdown options={options} value={value} onChange={e => setValue(e.value)} />
|
|
397
393
|
```
|
|
398
394
|
|
|
399
395
|
### MultiSelect
|
|
@@ -402,8 +398,11 @@ Multi-value selection component for choosing multiple options from a list.
|
|
|
402
398
|
|
|
403
399
|
```tsx
|
|
404
400
|
import { MultiSelect } from '@emporix/cockpit-component-library'
|
|
405
|
-
|
|
406
|
-
|
|
401
|
+
;<MultiSelect
|
|
402
|
+
options={options}
|
|
403
|
+
value={value}
|
|
404
|
+
onChange={e => setValue(e.value)}
|
|
405
|
+
/>
|
|
407
406
|
```
|
|
408
407
|
|
|
409
408
|
### RichTextEditor
|
|
@@ -412,8 +411,7 @@ Rich text input component for formatted content editing.
|
|
|
412
411
|
|
|
413
412
|
```tsx
|
|
414
413
|
import { RichTextEditor } from '@emporix/cockpit-component-library'
|
|
415
|
-
|
|
416
|
-
<RichTextEditor value={value} onChange={setValue} />
|
|
414
|
+
;<RichTextEditor value={value} onChange={setValue} />
|
|
417
415
|
```
|
|
418
416
|
|
|
419
417
|
### Spinner
|
|
@@ -422,8 +420,7 @@ Loading indicator component with configurable size.
|
|
|
422
420
|
|
|
423
421
|
```tsx
|
|
424
422
|
import { Spinner } from '@emporix/cockpit-component-library'
|
|
425
|
-
|
|
426
|
-
<Spinner size="md" />
|
|
423
|
+
;<Spinner size='md' />
|
|
427
424
|
```
|
|
428
425
|
|
|
429
426
|
### Breadcrumb
|
|
@@ -432,8 +429,7 @@ Navigation breadcrumb for representing hierarchical page location.
|
|
|
432
429
|
|
|
433
430
|
```tsx
|
|
434
431
|
import { Breadcrumb } from '@emporix/cockpit-component-library'
|
|
435
|
-
|
|
436
|
-
<Breadcrumb items={items} />
|
|
432
|
+
;<Breadcrumb items={items} />
|
|
437
433
|
```
|
|
438
434
|
|
|
439
435
|
### IconCard
|
|
@@ -442,8 +438,7 @@ Card-like container with a prominent icon/content layout.
|
|
|
442
438
|
|
|
443
439
|
```tsx
|
|
444
440
|
import { IconCard } from '@emporix/cockpit-component-library'
|
|
445
|
-
|
|
446
|
-
<IconCard title="Title" description="Description" icon={<span />} />
|
|
441
|
+
;<IconCard title='Title' description='Description' icon={<span />} />
|
|
447
442
|
```
|
|
448
443
|
|
|
449
444
|
### FileUploadDropzone
|
|
@@ -452,8 +447,7 @@ Dropzone component for drag-and-drop file uploads with type constraints.
|
|
|
452
447
|
|
|
453
448
|
```tsx
|
|
454
449
|
import { FileUploadDropzone } from '@emporix/cockpit-component-library'
|
|
455
|
-
|
|
456
|
-
<FileUploadDropzone acceptedTypes={['image']} onFilesSelected={handleFiles} />
|
|
450
|
+
;<FileUploadDropzone acceptedTypes={['image']} onFilesSelected={handleFiles} />
|
|
457
451
|
```
|
|
458
452
|
|
|
459
453
|
### AlertBox
|
|
@@ -462,8 +456,7 @@ Inline alert component for success, info, warning, and error messages.
|
|
|
462
456
|
|
|
463
457
|
```tsx
|
|
464
458
|
import { AlertBox } from '@emporix/cockpit-component-library'
|
|
465
|
-
|
|
466
|
-
<AlertBox variant="info" title="Heads up" />
|
|
459
|
+
;<AlertBox variant='info' title='Heads up' />
|
|
467
460
|
```
|
|
468
461
|
|
|
469
462
|
### SideMenu
|
|
@@ -472,8 +465,7 @@ Composable side navigation menu with brand, nav items, and footer slots.
|
|
|
472
465
|
|
|
473
466
|
```tsx
|
|
474
467
|
import { SideMenu } from '@emporix/cockpit-component-library'
|
|
475
|
-
|
|
476
|
-
<SideMenu>{/* ... */}</SideMenu>
|
|
468
|
+
;<SideMenu>{/* ... */}</SideMenu>
|
|
477
469
|
```
|
|
478
470
|
|
|
479
471
|
### TopNav
|
|
@@ -482,8 +474,7 @@ Top navigation/header component for page-level actions and context.
|
|
|
482
474
|
|
|
483
475
|
```tsx
|
|
484
476
|
import { TopNav } from '@emporix/cockpit-component-library'
|
|
485
|
-
|
|
486
|
-
<TopNav title="Dashboard" />
|
|
477
|
+
;<TopNav title='Dashboard' />
|
|
487
478
|
```
|
|
488
479
|
|
|
489
480
|
### Toast
|
|
@@ -500,8 +491,7 @@ Dialog modal component for focused workflows and confirmations.
|
|
|
500
491
|
|
|
501
492
|
```tsx
|
|
502
493
|
import { Modal } from '@emporix/cockpit-component-library'
|
|
503
|
-
|
|
504
|
-
<Modal isOpen={open} onClose={onClose} title="Edit item" />
|
|
494
|
+
;<Modal isOpen={open} onClose={onClose} title='Edit item' />
|
|
505
495
|
```
|
|
506
496
|
|
|
507
497
|
### ConfirmDialog
|
|
@@ -510,8 +500,7 @@ Preset confirmation dialog for destructive or high-impact actions.
|
|
|
510
500
|
|
|
511
501
|
```tsx
|
|
512
502
|
import { ConfirmDialog } from '@emporix/cockpit-component-library'
|
|
513
|
-
|
|
514
|
-
<ConfirmDialog open={open} onConfirm={onConfirm} onCancel={onCancel} />
|
|
503
|
+
;<ConfirmDialog open={open} onConfirm={onConfirm} onCancel={onCancel} />
|
|
515
504
|
```
|
|
516
505
|
|
|
517
506
|
### ProductTable
|
|
@@ -520,8 +509,7 @@ Data table component focused on product records and common actions.
|
|
|
520
509
|
|
|
521
510
|
```tsx
|
|
522
511
|
import { ProductTable } from '@emporix/cockpit-component-library'
|
|
523
|
-
|
|
524
|
-
<ProductTable items={items} columns={columns} />
|
|
512
|
+
;<ProductTable items={items} columns={columns} />
|
|
525
513
|
```
|
|
526
514
|
|
|
527
515
|
### ProductTableIconAddButton
|
|
@@ -530,8 +518,7 @@ Compact icon button variant used with `ProductTable` add flows.
|
|
|
530
518
|
|
|
531
519
|
```tsx
|
|
532
520
|
import { ProductTableIconAddButton } from '@emporix/cockpit-component-library'
|
|
533
|
-
|
|
534
|
-
<ProductTableIconAddButton onClick={onAdd} />
|
|
521
|
+
;<ProductTableIconAddButton onClick={onAdd} />
|
|
535
522
|
```
|
|
536
523
|
|
|
537
524
|
### OrderTable
|
|
@@ -540,8 +527,7 @@ Data table for order rows and order-oriented workflows.
|
|
|
540
527
|
|
|
541
528
|
```tsx
|
|
542
529
|
import { OrderTable } from '@emporix/cockpit-component-library'
|
|
543
|
-
|
|
544
|
-
<OrderTable rows={rows} />
|
|
530
|
+
;<OrderTable rows={rows} />
|
|
545
531
|
```
|
|
546
532
|
|
|
547
533
|
### OrderStatusTag
|
|
@@ -550,8 +536,7 @@ Status badge component for order state presentation.
|
|
|
550
536
|
|
|
551
537
|
```tsx
|
|
552
538
|
import { OrderStatusTag } from '@emporix/cockpit-component-library'
|
|
553
|
-
|
|
554
|
-
<OrderStatusTag status="submitted" />
|
|
539
|
+
;<OrderStatusTag status='submitted' />
|
|
555
540
|
```
|
|
556
541
|
|
|
557
542
|
### Wizard
|
|
@@ -560,8 +545,7 @@ Step-based workflow component for multi-stage forms and processes.
|
|
|
560
545
|
|
|
561
546
|
```tsx
|
|
562
547
|
import { Wizard } from '@emporix/cockpit-component-library'
|
|
563
|
-
|
|
564
|
-
<Wizard steps={steps} />
|
|
548
|
+
;<Wizard steps={steps} />
|
|
565
549
|
```
|
|
566
550
|
|
|
567
551
|
### Timeline
|
|
@@ -570,8 +554,7 @@ Chronological event list component for activity/history views.
|
|
|
570
554
|
|
|
571
555
|
```tsx
|
|
572
556
|
import { Timeline } from '@emporix/cockpit-component-library'
|
|
573
|
-
|
|
574
|
-
<Timeline events={events} />
|
|
557
|
+
;<Timeline events={events} />
|
|
575
558
|
```
|
|
576
559
|
|
|
577
560
|
## Theming with CSS Variables
|
|
@@ -815,21 +798,66 @@ npm run build-storybook
|
|
|
815
798
|
The library is built using Vite with optimized settings for npm distribution.
|
|
816
799
|
|
|
817
800
|
```bash
|
|
818
|
-
# Build the library
|
|
801
|
+
# Build the library locally
|
|
819
802
|
npm run build:lib
|
|
820
803
|
```
|
|
821
804
|
|
|
822
805
|
The build output includes:
|
|
823
806
|
|
|
824
|
-
- ES modules (`index.es.js`)
|
|
825
|
-
- UMD bundle (`index.umd.js`)
|
|
826
|
-
- TypeScript declarations (`index.d.ts`)
|
|
827
|
-
- CSS styles (`
|
|
807
|
+
- ES modules (`dist/index.es.js`)
|
|
808
|
+
- UMD bundle (`dist/index.umd.js`)
|
|
809
|
+
- TypeScript declarations (`dist/index.d.ts`)
|
|
810
|
+
- CSS styles (`dist/style.css`)
|
|
811
|
+
|
|
812
|
+
The publish workflow runs `npm run build:lib` before `npm publish`.
|
|
813
|
+
|
|
814
|
+
## Publishing a new version
|
|
815
|
+
|
|
816
|
+
Releases are published to npm automatically when a **version tag** is pushed to GitHub. The workflow is defined in [`.github/workflows/publish.yml`](.github/workflows/publish.yml).
|
|
817
|
+
|
|
818
|
+
### Prerequisites (one-time setup)
|
|
819
|
+
|
|
820
|
+
1. **npm package** โ `@emporix/cockpit-component-library` must exist on [npm](https://www.npmjs.com/package/@emporix/cockpit-component-library) with publish access configured for this repository.
|
|
821
|
+
2. **npm Trusted Publishing** โ On [npmjs.com](https://www.npmjs.com/), configure a trusted publisher for this package with:
|
|
822
|
+
- GitHub organization/repository: `emporix/cockpit-component-library`
|
|
823
|
+
- Workflow filename: `publish.yml`
|
|
824
|
+
- Environment: (optional)
|
|
825
|
+
|
|
826
|
+
The workflow uses OIDC (`id-token: write`); no `NPM_TOKEN` secret is required when Trusted Publishing is enabled.
|
|
827
|
+
|
|
828
|
+
### Release steps
|
|
829
|
+
|
|
830
|
+
1. Merge your changes to the default branch (`main`).
|
|
831
|
+
2. Bump the version in `package.json` (semver, **without** the `v` prefix), for example `1.0.4` or `2.1.1`.
|
|
832
|
+
3. Commit the version bump and push to `main`.
|
|
833
|
+
4. Create and push a Git tag that matches the version with a `v` prefix:
|
|
834
|
+
|
|
835
|
+
```bash
|
|
836
|
+
git tag v1.0.4
|
|
837
|
+
git push origin v1.0.4
|
|
838
|
+
```
|
|
839
|
+
|
|
840
|
+
5. Open **Actions** in GitHub and confirm the **Publish to npm** workflow succeeded.
|
|
841
|
+
6. Verify the new version on npm:
|
|
842
|
+
|
|
843
|
+
```bash
|
|
844
|
+
npm view @emporix/cockpit-component-library version
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
The tag must match `package.json` `version` (e.g. tag `v2.1.1` requires `"version": "2.1.1"`) and follow the format `v{major}.{minor}.{patch}`.
|
|
848
|
+
|
|
849
|
+
### Example: publish `2.1.1`
|
|
850
|
+
|
|
851
|
+
```bash
|
|
852
|
+
# After updating package.json to "2.1.1" and pushing main:
|
|
853
|
+
git tag v2.1.1
|
|
854
|
+
git push origin v2.1.1
|
|
855
|
+
```
|
|
828
856
|
|
|
829
|
-
To
|
|
857
|
+
To remove a tag locally before pushing:
|
|
830
858
|
|
|
831
859
|
```bash
|
|
832
|
-
|
|
860
|
+
git tag -d v2.1.1
|
|
833
861
|
```
|
|
834
862
|
|
|
835
863
|
## Code Formatting
|