@oc-digital/react-component-library 8.28.0 → 8.29.0-beta.0

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
@@ -60,9 +60,16 @@ _Remember to change back the package.json once you're done._
60
60
  4. once happy with the changes remove -beta.0 part and part and publish component library
61
61
  4a. update the version in the receiving library to "^2.0.7"
62
62
 
63
- ## Building and publishing
63
+ ### Publishing a new version
64
64
 
65
- To publish new version login using `npm login`, increment version in `package.json` and run `npm publish`. Subsequently it will build the library to `build` folder and push it's contents to the npm.
65
+ 1. Update the version in `package.json`
66
+ 2. Create and push a git tag:
67
+ ```bash
68
+ git tag v1.2.3
69
+ git push origin v1.2.3
70
+ ```
71
+
72
+ **The package will be automatically published to npm via GitHub Actions.**
66
73
 
67
74
  ## Playground
68
75
 
@@ -37,13 +37,19 @@ export interface ISecondaryNavigationItem<T = any> {
37
37
  original?: T;
38
38
  }
39
39
  export type SortingFunction<T = any> = (a: ISecondaryNavigationItem<T>, b: ISecondaryNavigationItem<T>) => number;
40
+ export type NavigateButton = {
41
+ url: string;
42
+ text: string;
43
+ };
44
+ export type ActionButton = {
45
+ onClick: () => void;
46
+ text: string;
47
+ type: "action";
48
+ };
40
49
  export interface ISecondaryNavigationElement<T = any> {
41
50
  items: ISecondaryNavigationItem<T>[];
42
51
  archivedItems?: ISecondaryNavigationItem<T>[];
43
- button?: {
44
- url: string;
45
- text: string;
46
- };
52
+ button?: NavigateButton | ActionButton;
47
53
  defaultSortDirection?: "asc" | "desc";
48
54
  onSortReverse?: (direction: -1 | 1) => void;
49
55
  sortFunction?: SortingFunction<T>;