@addsign/moje-agenda-shared-lib 0.0.7 → 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.
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ type ButtonVariant = "primary" | "secondary" | "transparent" | "success" | "danger" | "icon";
3
+ interface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
+ variant?: ButtonVariant;
5
+ }
6
+ declare const Button: React.FC<IButtonProps>;
7
+ export default Button;
@@ -0,0 +1,36 @@
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 = {
4
+ primary: "bg-primary text-gray-100 hover:bg-gray w-fit rounded-lg whitespace-nowrap font-medium",
5
+ secondary: "bg-white text-gray-800 hover:bg-gray-100 rounded-lg border border-gray-300 shadow whitespace-nowrap font-medium",
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 ",
7
+ success: "bg-gray-500 hover:bg-gray-700 text-white rounded-lg",
8
+ danger: "bg-gray-500 hover:bg-gray-700 text-white rounded-lg",
9
+ icon: "text-primary font-medium rounded-full text-sm text-center inline-flex items-center ml-4 h-full "
10
+ }, u = ({
11
+ variant: r = "primary",
12
+ children: t,
13
+ onClick: o,
14
+ className: n,
15
+ ...e
16
+ }) => {
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(
25
+ "button",
26
+ {
27
+ className: g + " " + (n || " sharedLibraryource..23 "),
28
+ onClick: o,
29
+ ...e,
30
+ children: t
31
+ }
32
+ );
33
+ };
34
+ export {
35
+ u as default
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
- export { Button } from './components/Button';
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 { Button as r } from "./components/Button/index.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
- r 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.7",
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
  }
@@ -1 +0,0 @@
1
- ._button_11bo7_1{padding:1rem}
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function Button(props: React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +0,0 @@
1
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import '../../assets/index.css';const u = "_button_11bo7_1", c = {
3
- button: u
4
- };
5
- function b(t) {
6
- const { className: o, ...s } = t;
7
- return /* @__PURE__ */ n("div", { children: [
8
- "MILA22..1",
9
- /* @__PURE__ */ r("button", { className: `${o} ${c.button}`, ...s })
10
- ] });
11
- }
12
- export {
13
- b as Button
14
- };