@addsign/moje-agenda-shared-lib 0.0.8 → 0.0.9

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.
@@ -1,29 +1,36 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- const d = " py-2 px-4 leading-[25px] ", i = {
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { useFederationContext as s } from "../contexts/FederationContext.js";
3
+ const i = " py-2 px-4 leading-[25px] ", m = {
3
4
  primary: "bg-primary text-gray-100 hover:bg-gray w-fit rounded-lg whitespace-nowrap font-medium",
4
5
  secondary: "bg-white text-gray-800 hover:bg-gray-100 rounded-lg border border-gray-300 shadow whitespace-nowrap font-medium",
5
6
  transparent: "bg-transparent border border-transparent hover:bg-gray-100 hover:border-gray-200 rounded-lg text-primary font-medium text-gray-800 w-fit ",
6
7
  success: "bg-gray-500 hover:bg-gray-700 text-white rounded-lg",
7
8
  danger: "bg-gray-500 hover:bg-gray-700 text-white rounded-lg",
8
9
  icon: "text-primary font-medium rounded-full text-sm text-center inline-flex items-center ml-4 h-full "
9
- }, m = ({
10
+ }, u = ({
10
11
  variant: r = "primary",
11
12
  children: t,
12
- onClick: a,
13
+ onClick: o,
13
14
  className: n,
14
15
  ...e
15
16
  }) => {
16
- const o = d + i[r] + (e != null && e.disabled ? " bg-opacity-50" : " ");
17
- return /* @__PURE__ */ g(
17
+ const { userInfo: a } = s();
18
+ console.log(
19
+ "%clibcomponentsButton.tsx:34 userInfo",
20
+ "color: #007acc;",
21
+ a
22
+ );
23
+ const g = i + m[r] + (e != null && e.disabled ? " bg-opacity-50" : " ");
24
+ return /* @__PURE__ */ d(
18
25
  "button",
19
26
  {
20
- className: o + " " + (n || " sharedLibraryource.. "),
21
- onClick: a,
27
+ className: g + " " + (n || " sharedLibraryource..23 "),
28
+ onClick: o,
22
29
  ...e,
23
30
  children: t
24
31
  }
25
32
  );
26
33
  };
27
34
  export {
28
- m as default
35
+ u as default
29
36
  };
@@ -0,0 +1,10 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { IContextValue } from '../types';
3
+
4
+ export declare const FederationContext: import('react').Context<IContextValue>;
5
+ type FederationContextProviderProps = PropsWithChildren & {
6
+ value: IContextValue;
7
+ };
8
+ export declare const FederationContextProvider: FC<FederationContextProviderProps>;
9
+ export declare const useFederationContext: () => IContextValue;
10
+ export {};
@@ -0,0 +1,17 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { createContext as x, useContext as a } from "react";
3
+ const t = x({}), C = ({
4
+ children: e,
5
+ value: o
6
+ }) => {
7
+ const { userInfo: n, apiClient: r } = o, i = {
8
+ userInfo: n,
9
+ apiClient: r
10
+ };
11
+ return /* @__PURE__ */ s(t.Provider, { value: i, children: e });
12
+ }, d = () => a(t);
13
+ export {
14
+ t as FederationContext,
15
+ C as FederationContextProvider,
16
+ d as useFederationContext
17
+ };
package/dist/main.d.ts CHANGED
@@ -1 +1,3 @@
1
1
  export { default as Button } from './components/Button.tsx';
2
+ export * from './contexts/FederationContext.tsx';
3
+ export * from './types.ts';
package/dist/main.js CHANGED
@@ -1,4 +1,8 @@
1
- import { default as a } from "./components/Button.js";
1
+ import { default as o } from "./components/Button.js";
2
+ import { FederationContext as n, FederationContextProvider as a, useFederationContext as d } from "./contexts/FederationContext.js";
2
3
  export {
3
- a as Button
4
+ o as Button,
5
+ n as FederationContext,
6
+ a as FederationContextProvider,
7
+ d as useFederationContext
4
8
  };
@@ -0,0 +1,21 @@
1
+ import { AxiosInstance } from 'axios';
2
+
3
+ export interface IUserInfo {
4
+ contractGroup: number;
5
+ degreeAfter: string;
6
+ degreeBefore: string;
7
+ departmentId: string;
8
+ departmentName: string;
9
+ departmentNameLong: string;
10
+ email: string;
11
+ employeeId: number;
12
+ firstName: string;
13
+ lastName: string;
14
+ positionName: string;
15
+ positionNumber: string;
16
+ userId: string;
17
+ }
18
+ export interface IContextValue {
19
+ userInfo: IUserInfo;
20
+ apiClient: AxiosInstance;
21
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@addsign/moje-agenda-shared-lib",
3
3
  "private": false,
4
- "version": "0.0.8",
4
+ "version": "0.0.9",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -44,5 +44,10 @@
44
44
  "vite": "^5.2.0",
45
45
  "vite-plugin-dts": "^3.9.1",
46
46
  "vite-plugin-lib-inject-css": "^2.1.1"
47
+ },
48
+ "dependencies": {
49
+ "axios": "^1.7.2",
50
+ "react-icons": "^5.2.1",
51
+ "react-use": "^17.5.0"
47
52
  }
48
53
  }