@arkitektbedriftene/fe-lib 0.2.4 → 0.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektbedriftene/fe-lib",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.es.js",
@@ -14,8 +14,12 @@
14
14
  "require": "./dist/oidc.umd.cjs"
15
15
  },
16
16
  "./hooks": {
17
- "import": "./dist/oidc.es.js",
18
- "require": "./dist/oidc.umd.cjs"
17
+ "import": "./dist/hooks.es.js",
18
+ "require": "./dist/hooks.umd.cjs"
19
+ },
20
+ "./icons": {
21
+ "import": "./dist/hooksicon.es.js",
22
+ "require": "./dist/icon.umd.cjs"
19
23
  }
20
24
  },
21
25
  "typesVersions": {
@@ -26,8 +30,8 @@
26
30
  "oidc": [
27
31
  "dist/oidc.d.ts"
28
32
  ],
29
- "hooks": [
30
- "dist/hooks.d.ts"
33
+ "icon": [
34
+ "dist/icon.d.ts"
31
35
  ]
32
36
  }
33
37
  },
@@ -59,6 +63,7 @@
59
63
  },
60
64
  "dependencies": {
61
65
  "oidc-client-ts": "^2.2.2",
66
+ "react-icons": "^4.8.0",
62
67
  "use-local-storage-state": "^18.2.1"
63
68
  }
64
69
  }
package/src/App.tsx CHANGED
@@ -1,7 +1,6 @@
1
1
  import { useState } from 'react'
2
2
  import reactLogo from './assets/react.svg'
3
- import viteLogo from '/vite.svg'
4
- import './App.css'
3
+ import './App.css'
5
4
 
6
5
  function App() {
7
6
  const [count, setCount] = useState(0)
@@ -9,9 +8,7 @@ function App() {
9
8
  return (
10
9
  <div className="App">
11
10
  <div>
12
- <a href="https://vitejs.dev" target="_blank">
13
- <img src={viteLogo} className="logo" alt="Vite logo" />
14
- </a>
11
+
15
12
  <a href="https://reactjs.org" target="_blank">
16
13
  <img src={reactLogo} className="logo react" alt="React logo" />
17
14
  </a>
@@ -0,0 +1,51 @@
1
+
2
+ import React from "react";
3
+ import { MdOutlineSick, MdSchool, MdVerified } from 'react-icons/md'
4
+ import { BsBuilding } from 'react-icons/bs';
5
+ import { GiTribunalJury } from 'react-icons/gi'
6
+ import { BiClinic } from 'react-icons/bi'
7
+ import { MdTravelExplore } from 'react-icons/md'
8
+ import { GrMoney, GrUserWorker } from 'react-icons/gr'
9
+ import { GiMoneyStack } from 'react-icons/gi'
10
+ import { MdCardTravel } from 'react-icons/md'
11
+ import { FaFileContract, FaHandsHelping } from 'react-icons/fa'
12
+ import { GiBreakingChain } from 'react-icons/gi'
13
+ import { GrStatusUnknown } from 'react-icons/gr'
14
+ import { AiOutlineMedium } from "react-icons/ai";
15
+
16
+
17
+ export default function Icon(props: { ExternalId: string }) {
18
+ if (props.ExternalId == null || props.ExternalId == '')
19
+ return <GrStatusUnknown />;
20
+ if (props.ExternalId.indexOf("SYKELONN") > -1)
21
+ return <span><MdOutlineSick></MdOutlineSick></span>;
22
+ else if (props.ExternalId.indexOf("ANSVAR") > -1)
23
+ return <span><BsBuilding></BsBuilding></span>;
24
+ else if (props.ExternalId.indexOf("RETTS") > -1)
25
+ return <span><GiTribunalJury></GiTribunalJury></span>;
26
+ else if (props.ExternalId.indexOf("BEHAND") > -1)
27
+ return <span><BiClinic></BiClinic></span>;
28
+ else if (props.ExternalId.indexOf("REISE") > -1)
29
+ return <span><MdTravelExplore></MdTravelExplore></span>;
30
+ else if (props.ExternalId.indexOf("YRKE") > -1)
31
+ return <span><GrUserWorker></GrUserWorker></span>;
32
+ else if (props.ExternalId.indexOf("VERDI") > -1)
33
+ return <span><GiMoneyStack></GiMoneyStack></span>;
34
+ else if (props.ExternalId.indexOf("TJENESTE") > -1)
35
+ return <span><MdCardTravel></MdCardTravel></span>;
36
+ else if (props.ExternalId.indexOf("GRUPPELIV") > -1)
37
+ return <span><FaHandsHelping></FaHandsHelping></span>;
38
+ else if (props.ExternalId.indexOf("SYKEAV") > -1)
39
+ return <span><GiBreakingChain></GiBreakingChain></span>;
40
+ else if (props.ExternalId.indexOf("_MAKS") > -1)
41
+ return <span><MdVerified color="green"></MdVerified></span>;
42
+ else if (props.ExternalId.indexOf("_MEDLEM") > -1)
43
+ return <span><AiOutlineMedium color="#B22222"></AiOutlineMedium></span>;
44
+ else if (props.ExternalId.indexOf("_PRAKSIS") > -1)
45
+ return <span><MdSchool color="#8cc6ce"></MdSchool></span>;
46
+ else if (props.ExternalId.indexOf("_AY") > -1)
47
+ return <span><FaFileContract color="#e8b281"></FaFileContract></span>;
48
+ else if (props.ExternalId.indexOf("_TARIFF") > -1)
49
+ return <span><GrMoney color="#626FFE "></GrMoney></span>;
50
+ return <GrStatusUnknown />;
51
+ }
package/vite.config.ts CHANGED
@@ -10,6 +10,7 @@ export default defineConfig({
10
10
  "src/lib/index.ts",
11
11
  "src/lib/oidc/oidc.tsx",
12
12
  "src/lib/hooks/hooks.ts",
13
+ "src/lib/icons/icon.tsx",
13
14
  ],
14
15
  name: "fe-lib",
15
16
  fileName: (format, entryname) => `${entryname}.${format}.js`,
@@ -1,21 +0,0 @@
1
- name: Publish package to NPM
2
- on:
3
- release:
4
- types: [published]
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- permissions:
9
- contents: read
10
- packages: write
11
- steps:
12
- - uses: actions/checkout@v3
13
- - uses: actions/setup-node@v3
14
- with:
15
- node-version: '16.x'
16
- registry-url: 'https://registry.npmjs.org'
17
- - run: npm ci
18
- - run: npm run build
19
- - run: npm publish
20
- env:
21
- NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
@@ -1,16 +0,0 @@
1
- name: Create Tag
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
-
8
- jobs:
9
- build:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - uses: actions/checkout@v2
13
- - uses: Klemensas/action-autotag@1.2.3
14
- with:
15
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
16
- tag_prefix: "v"