@buerokratt-ria/menu 0.2.0 → 0.2.1

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/.eslintrc.json CHANGED
@@ -1,18 +1,18 @@
1
- {
2
- "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
3
- "ignorePatterns": ["!**/*"],
4
- "overrides": [
5
- {
6
- "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7
- "rules": {}
8
- },
9
- {
10
- "files": ["*.ts", "*.tsx"],
11
- "rules": {}
12
- },
13
- {
14
- "files": ["*.js", "*.jsx"],
15
- "rules": {}
16
- }
17
- ]
18
- }
1
+ {
2
+ "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
3
+ "ignorePatterns": ["!**/*"],
4
+ "overrides": [
5
+ {
6
+ "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7
+ "rules": {}
8
+ },
9
+ {
10
+ "files": ["*.ts", "*.tsx"],
11
+ "rules": {}
12
+ },
13
+ {
14
+ "files": ["*.js", "*.jsx"],
15
+ "rules": {}
16
+ }
17
+ ]
18
+ }
package/CHANGELOG.md CHANGED
@@ -1,70 +1,73 @@
1
- # Changelog
2
-
3
- All changes to this project will be documented in this file.
4
-
5
- ## [0.1.16] - 10-06-2024
6
-
7
- - Improve close menu functionality
8
-
9
- ## [0.1.15] - 10-06-2024
10
-
11
- - Fix a bug
12
-
13
- ## [0.1.14] - 07-06-2024
14
-
15
- - Fix a bug
16
-
17
- ## [0.1.13] - 07-06-2024
18
-
19
- - Fix a bug
20
-
21
- ## [0.1.12] - 07-06-2024
22
-
23
- - Add dynamic hidden menu items
24
- - Refactor code for better readability
25
- - Remove unnecessary component arguments
26
-
27
- ## [0.1.11] - 30-05-2024
28
-
29
- - Hide some Training Module menu items from production
30
-
31
- ## [0.1.10] - 30-05-2024
32
-
33
- - Hide some menu items from production
34
-
35
- ## [0.1.9] - 28-04-2024
36
-
37
- - Merge previous code
38
-
39
- ## [0.1.8] - 28-04-2024
40
-
41
- - Hide some menu items
42
-
43
- ## [0.1.7] - 27-05-2024
44
-
45
- - Fix close menu button
46
-
47
- ## [0.1.6] - 25-04-2024
48
-
49
- - Updated api call addresses
50
-
51
- ## [0.1.5] - 27-02-2024
52
-
53
- - Added path /auto-services menu element to Training module
54
- - Replaced path /followup-training /auto-services menu element to Service module
55
-
56
- ## [0.1.4] - 09-02-2024
57
-
58
- - Removed /buerokratt menu element from Analytics module
59
-
60
- ## [0.1.3] - 06-02-2024
61
-
62
- - Removed /training for /train-new-model menu element
63
-
64
- ## [0.1.2] - 01-02-2024
65
-
66
- - Added new element in menu /pending
67
-
68
- ## [0.1.1] - 28-12-2023
69
-
70
- - Initial package structure for menu for ruuter v2.
1
+ # Changelog
2
+
3
+ All changes to this project will be documented in this file.
4
+ ## [0.1.17] - 24-10-2024
5
+
6
+ - Add /delete to chat
7
+
8
+ ## [0.1.16] - 10-06-2024
9
+
10
+ - Improve close menu functionality
11
+
12
+ ## [0.1.15] - 10-06-2024
13
+
14
+ - Fix a bug
15
+
16
+ ## [0.1.14] - 07-06-2024
17
+
18
+ - Fix a bug
19
+
20
+ ## [0.1.13] - 07-06-2024
21
+
22
+ - Fix a bug
23
+
24
+ ## [0.1.12] - 07-06-2024
25
+
26
+ - Add dynamic hidden menu items
27
+ - Refactor code for better readability
28
+ - Remove unnecessary component arguments
29
+
30
+ ## [0.1.11] - 30-05-2024
31
+
32
+ - Hide some Training Module menu items from production
33
+
34
+ ## [0.1.10] - 30-05-2024
35
+
36
+ - Hide some menu items from production
37
+
38
+ ## [0.1.9] - 28-04-2024
39
+
40
+ - Merge previous code
41
+
42
+ ## [0.1.8] - 28-04-2024
43
+
44
+ - Hide some menu items
45
+
46
+ ## [0.1.7] - 27-05-2024
47
+
48
+ - Fix close menu button
49
+
50
+ ## [0.1.6] - 25-04-2024
51
+
52
+ - Updated api call addresses
53
+
54
+ ## [0.1.5] - 27-02-2024
55
+
56
+ - Added path /auto-services menu element to Training module
57
+ - Replaced path /followup-training /auto-services menu element to Service module
58
+
59
+ ## [0.1.4] - 09-02-2024
60
+
61
+ - Removed /buerokratt menu element from Analytics module
62
+
63
+ ## [0.1.3] - 06-02-2024
64
+
65
+ - Removed /training for /train-new-model menu element
66
+
67
+ ## [0.1.2] - 01-02-2024
68
+
69
+ - Added new element in menu /pending
70
+
71
+ ## [0.1.1] - 28-12-2023
72
+
73
+ - Initial package structure for menu for ruuter v2.
package/MAKING_CHANGES.md CHANGED
@@ -1,8 +1,8 @@
1
- ## Making Changes
2
-
3
- #### If you want to make changes to export menu component:
4
- * Make necessary changes
5
- * Update version in file [package.json](package.json)
6
- * Template: `major v.mid v.minor v`
7
- * Add brief description to [changelog file](CHANGELOG.md)
8
- * Proceed with deploying or testing package locally by information provided by [readme](README.md)
1
+ ## Making Changes
2
+
3
+ #### If you want to make changes to export menu component:
4
+ * Make necessary changes
5
+ * Update version in file [package.json](package.json)
6
+ * Template: `major v.mid v.minor v`
7
+ * Add brief description to [changelog file](CHANGELOG.md)
8
+ * Proceed with deploying or testing package locally by information provided by [readme](README.md)
package/README.md CHANGED
@@ -1,49 +1,49 @@
1
- ## MainNavigation component
2
-
3
- ### General information
4
-
5
- Changelog file could be found here [link](CHANGELOG.md)
6
-
7
- ## Creating package
8
-
9
- To create npm package for future usage:
10
- * Navigate to the root directory of the package.
11
- * Run `npm pack` command, to create package file.
12
- * If you made updates to the package please relate to this [file](MAKING_CHANGES.md) before creating package
13
-
14
- To publish created package:
15
- * Run `npm publish --access public`
16
- * Authorize in npm and package would be published
17
-
18
- ## Adding dependency from remote
19
- - Since this package currently being deployed to @buerokratt-ria account therefore it would need to be related as @buerokratt-ria
20
- - Add to `package.json` @buerokratt-ria/menu: followed by version, list of available version could be found [here](CHANGELOG.md)
21
-
22
- ## Adding dependency as local package
23
- - When you build the package file, put it in `root` directory of the application
24
- - Add to `package.json` @buerokratt-ria/header: file:name-of-the-generated-package
25
- - If having import issues like `NOT FOUND` try adding to `vite.config.ts`
26
- `resolve: {
27
- alias: {
28
- '@buerokratt-ria': `${path.resolve(__dirname, 'node_modules/@buerokratt-ria/menu/src')}`
29
- },
30
- }`
31
-
32
- ## Using package
33
- * Importing component
34
- * `import { MainNavigation } from '@buerokratt-ria/menu/src'` for Header and Menu
35
- * If you want to use local package, put created package to the root of react app and add dependency like "@buerokratt-ria/header": "file:buerokratt-ria-menu-0.0.5.tgz" (use proper version)
36
- ### Using MainNavigation component
37
- * MainNavigation uses four env variable:
38
- * use `REACT_APP_MENU_URL` & `REACT_APP_MENU_PATH` to set the url for json that contains the menu item array
39
- * use `REACT_APP_MENU_JSON` with json string of the menu item array
40
- * `REACT_APP_MENU_JSON` will overrides buth the local file provieded by package and the `REACT_APP_MENU_URL` & `REACT_APP_MENU_PATH`
41
- * If you want to use only local file provided by package then remove `REACT_APP_MENU_JSON`, `REACT_APP_MENU_URL` & `REACT_APP_MENU_PATH` variables
42
- * `REACT_APP_SERVICE_ID` set of values seperated by comma resembling current module, examples of this value could be found in following links
43
-
44
-
45
-
46
- ### Implemented examples:
47
- * https://github.com/buerokratt/Training-Module
48
- * https://github.com/buerokratt/Service-Module
49
- * https://github.com/buerokratt/Analytics-Module
1
+ ## MainNavigation component
2
+
3
+ ### General information
4
+
5
+ Changelog file could be found here [link](CHANGELOG.md)
6
+
7
+ ## Creating package
8
+
9
+ To create npm package for future usage:
10
+ * Navigate to the root directory of the package.
11
+ * Run `npm pack` command, to create package file.
12
+ * If you made updates to the package please relate to this [file](MAKING_CHANGES.md) before creating package
13
+
14
+ To publish created package:
15
+ * Run `npm publish --access public`
16
+ * Authorize in npm and package would be published
17
+
18
+ ## Adding dependency from remote
19
+ - Since this package currently being deployed to @buerokratt-ria account therefore it would need to be related as @buerokratt-ria
20
+ - Add to `package.json` @buerokratt-ria/menu: followed by version, list of available version could be found [here](CHANGELOG.md)
21
+
22
+ ## Adding dependency as local package
23
+ - When you build the package file, put it in `root` directory of the application
24
+ - Add to `package.json` @buerokratt-ria/header: file:name-of-the-generated-package
25
+ - If having import issues like `NOT FOUND` try adding to `vite.config.ts`
26
+ `resolve: {
27
+ alias: {
28
+ '@buerokratt-ria': `${path.resolve(__dirname, 'node_modules/@buerokratt-ria/menu/src')}`
29
+ },
30
+ }`
31
+
32
+ ## Using package
33
+ * Importing component
34
+ * `import { MainNavigation } from '@buerokratt-ria/menu/src'` for Header and Menu
35
+ * If you want to use local package, put created package to the root of react app and add dependency like "@buerokratt-ria/header": "file:buerokratt-ria-menu-0.0.5.tgz" (use proper version)
36
+ ### Using MainNavigation component
37
+ * MainNavigation uses four env variable:
38
+ * use `REACT_APP_MENU_URL` & `REACT_APP_MENU_PATH` to set the url for json that contains the menu item array
39
+ * use `REACT_APP_MENU_JSON` with json string of the menu item array
40
+ * `REACT_APP_MENU_JSON` will overrides buth the local file provieded by package and the `REACT_APP_MENU_URL` & `REACT_APP_MENU_PATH`
41
+ * If you want to use only local file provided by package then remove `REACT_APP_MENU_JSON`, `REACT_APP_MENU_URL` & `REACT_APP_MENU_PATH` variables
42
+ * `REACT_APP_SERVICE_ID` set of values seperated by comma resembling current module, examples of this value could be found in following links
43
+
44
+
45
+
46
+ ### Implemented examples:
47
+ * https://github.com/buerokratt/Training-Module
48
+ * https://github.com/buerokratt/Service-Module
49
+ * https://github.com/buerokratt/Analytics-Module
Binary file
package/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export {
2
- default as MainNavigation
1
+ export {
2
+ default as MainNavigation
3
3
  } from './src/menu';
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
- {
2
- "name": "@buerokratt-ria/menu",
3
- "version": "0.2.0",
4
- "description": "Generic MainNavigation component that would be injected as dependency.",
5
- "main": "index.js",
6
- "scripts": {},
7
- "author": "ExiRain",
8
- "license": "ISC",
9
- "peerDependencies": {
10
- "@radix-ui/react-accessible-icon": "^1.0.3",
11
- "@radix-ui/react-dialog": "^1.0.4",
12
- "@radix-ui/react-switch": "^1.0.3",
13
- "@radix-ui/react-toast": "^1.1.4",
14
- "@tanstack/react-query": "^4.32.1",
15
- "clsx": "^1.2.1",
16
- "i18next": "^23.2.3",
17
- "i18next-browser-languagedetector": "^7.1.0",
18
- "path": "^0.12.7",
19
- "react": "^18.2.0",
20
- "react-cookie": "^4.1.1",
21
- "react-dom": "^18.2.0",
22
- "react-hook-form": "^7.45.4",
23
- "react-i18next": "^12.1.1",
24
- "react-icons": "^4.10.1",
25
- "react-idle-timer": "^5.7.2",
26
- "react-router-dom": "^6.14.2",
27
- "rxjs": "^7.8.1",
28
- "tslib": "^2.3.0",
29
- "vite-plugin-dts": "^3.5.2",
30
- "vite-plugin-svgr": "^3.2.0",
31
- "zustand": "^4.4.0"
32
- },
33
- "dependencies": {
34
- "react": "^18.2.0",
35
- "@types/react": "^18.2.21",
36
- "@buerokratt-ria/styles": "^0.0.1"
37
- },
38
- "devDependencies": {
39
- "@types/react": "^18.0.26",
40
- "@types/react-dom": "^18.0.9"
41
- }
42
- }
1
+ {
2
+ "name": "@buerokratt-ria/menu",
3
+ "version": "0.2.1",
4
+ "description": "Generic MainNavigation component that would be injected as dependency.",
5
+ "main": "index.js",
6
+ "scripts": {},
7
+ "author": "ExiRain",
8
+ "license": "ISC",
9
+ "peerDependencies": {
10
+ "@radix-ui/react-accessible-icon": "^1.0.3",
11
+ "@radix-ui/react-dialog": "^1.0.4",
12
+ "@radix-ui/react-switch": "^1.0.3",
13
+ "@radix-ui/react-toast": "^1.1.4",
14
+ "@tanstack/react-query": "^4.32.1",
15
+ "clsx": "^1.2.1",
16
+ "i18next": "^23.2.3",
17
+ "i18next-browser-languagedetector": "^7.1.0",
18
+ "path": "^0.12.7",
19
+ "react": "^18.2.0",
20
+ "react-cookie": "^4.1.1",
21
+ "react-dom": "^18.2.0",
22
+ "react-hook-form": "^7.45.4",
23
+ "react-i18next": "^12.1.1",
24
+ "react-icons": "^4.10.1",
25
+ "react-idle-timer": "^5.7.2",
26
+ "react-router-dom": "^6.14.2",
27
+ "rxjs": "^7.8.1",
28
+ "tslib": "^2.3.0",
29
+ "vite-plugin-dts": "^3.5.2",
30
+ "vite-plugin-svgr": "^3.2.0",
31
+ "zustand": "^4.4.0"
32
+ },
33
+ "dependencies": {
34
+ "react": "^18.2.0",
35
+ "@types/react": "^18.2.21",
36
+ "@buerokratt-ria/styles": "^0.0.1"
37
+ },
38
+ "devDependencies": {
39
+ "@types/react": "^18.0.26",
40
+ "@types/react-dom": "^18.0.9"
41
+ }
42
+ }
package/project.json CHANGED
@@ -1,52 +1,52 @@
1
- {
2
- "name": "header",
3
- "sourceRoot": "header/src",
4
- "projectType": "library",
5
- "tags": ["scope:header"],
6
- "targets": {
7
- "lint": {
8
- "executor": "@nrwl/linter:eslint",
9
- "outputs": ["{options.outputFile}"],
10
- "options": {
11
- "lintFilePatterns": ["header/**/*.{ts,tsx,js,jsx}"]
12
- }
13
- },
14
- "build": {
15
- "executor": "@nrwl/vite:build",
16
- "outputs": ["{options.outputPath}"],
17
- "defaultConfiguration": "production",
18
- "options": {
19
- "project": "./ng-package.json",
20
- "outputPath": "dist/header"
21
- },
22
- "configurations": {
23
- "production": {
24
- "tsConfig": "./tsconfig.lib.prod.json",
25
- "mode": "production"
26
- },
27
- "development": {
28
- "tsConfig": "./tsconfig.lib.json",
29
- "mode": "development"
30
- }
31
- }
32
- },
33
- "test": {
34
- "executor": "@nrwl/vite:test",
35
- "outputs": ["{projectRoot}/coverage"],
36
- "options": {
37
- "passWithNoTests": true
38
- }
39
- },
40
- "version": {
41
- "executor": "@jscutlery/semver:version",
42
- "options": {
43
- "preset": "angular",
44
- "baseBranch": "main",
45
- "push": true,
46
- "noVerify": true,
47
- "commitMessageFormat": "chore(${projectName}): release version ${version} [skip ci]",
48
- "skipCommitTypes": ["chore", "ci", "docs", "style", "test", "format"]
49
- }
50
- }
51
- }
52
- }
1
+ {
2
+ "name": "header",
3
+ "sourceRoot": "header/src",
4
+ "projectType": "library",
5
+ "tags": ["scope:header"],
6
+ "targets": {
7
+ "lint": {
8
+ "executor": "@nrwl/linter:eslint",
9
+ "outputs": ["{options.outputFile}"],
10
+ "options": {
11
+ "lintFilePatterns": ["header/**/*.{ts,tsx,js,jsx}"]
12
+ }
13
+ },
14
+ "build": {
15
+ "executor": "@nrwl/vite:build",
16
+ "outputs": ["{options.outputPath}"],
17
+ "defaultConfiguration": "production",
18
+ "options": {
19
+ "project": "./ng-package.json",
20
+ "outputPath": "dist/header"
21
+ },
22
+ "configurations": {
23
+ "production": {
24
+ "tsConfig": "./tsconfig.lib.prod.json",
25
+ "mode": "production"
26
+ },
27
+ "development": {
28
+ "tsConfig": "./tsconfig.lib.json",
29
+ "mode": "development"
30
+ }
31
+ }
32
+ },
33
+ "test": {
34
+ "executor": "@nrwl/vite:test",
35
+ "outputs": ["{projectRoot}/coverage"],
36
+ "options": {
37
+ "passWithNoTests": true
38
+ }
39
+ },
40
+ "version": {
41
+ "executor": "@jscutlery/semver:version",
42
+ "options": {
43
+ "preset": "angular",
44
+ "baseBranch": "main",
45
+ "push": true,
46
+ "noVerify": true,
47
+ "commitMessageFormat": "chore(${projectName}): release version ${version} [skip ci]",
48
+ "skipCommitTypes": ["chore", "ci", "docs", "style", "test", "format"]
49
+ }
50
+ }
51
+ }
52
+ }
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export {
2
- default as MainNavigation
1
+ export {
2
+ default as MainNavigation
3
3
  } from './menu';
@@ -1,33 +1,33 @@
1
- import React, {
2
- CSSProperties,
3
- forwardRef,
4
- ReactNode,
5
- StyleHTMLAttributes,
6
- } from 'react';
7
- import * as AccessibleIcon from '@radix-ui/react-accessible-icon';
8
- import clsx from 'clsx';
9
-
10
- import '../icon.scss';
11
-
12
- type IconProps = StyleHTMLAttributes<CSSProperties> & {
13
- label?: string | null;
14
- icon: ReactNode;
15
- size?: 'small' | 'medium' | 'large';
16
- className?: string;
17
- };
18
-
19
- const IconComponent = forwardRef<HTMLSpanElement, IconProps>(
20
- ({ label, icon, className, size = 'small', ...rest }, ref) => {
21
- const iconClasses = clsx('icon', `icon--${size}`, className);
22
-
23
- return (
24
- <AccessibleIcon.Root label={label ?? ''}>
25
- <span ref={ref} className={iconClasses} style={rest.style}>
26
- {icon}
27
- </span>
28
- </AccessibleIcon.Root>
29
- );
30
- }
31
- );
32
-
33
- export default IconComponent;
1
+ import React, {
2
+ CSSProperties,
3
+ forwardRef,
4
+ ReactNode,
5
+ StyleHTMLAttributes,
6
+ } from 'react';
7
+ import * as AccessibleIcon from '@radix-ui/react-accessible-icon';
8
+ import clsx from 'clsx';
9
+
10
+ import '../icon.scss';
11
+
12
+ type IconProps = StyleHTMLAttributes<CSSProperties> & {
13
+ label?: string | null;
14
+ icon: ReactNode;
15
+ size?: 'small' | 'medium' | 'large';
16
+ className?: string;
17
+ };
18
+
19
+ const IconComponent = forwardRef<HTMLSpanElement, IconProps>(
20
+ ({ label, icon, className, size = 'small', ...rest }, ref) => {
21
+ const iconClasses = clsx('icon', `icon--${size}`, className);
22
+
23
+ return (
24
+ <AccessibleIcon.Root label={label ?? ''}>
25
+ <span ref={ref} className={iconClasses} style={rest.style}>
26
+ {icon}
27
+ </span>
28
+ </AccessibleIcon.Root>
29
+ );
30
+ }
31
+ );
32
+
33
+ export default IconComponent;
@@ -1,22 +1,22 @@
1
- @import '@buerokratt-ria/styles/styles/tools/spacing';
2
-
3
- .icon {
4
- display: inline-flex;
5
- align-items: center;
6
- justify-content: center;
7
-
8
- &--small {
9
- width: get-spacing(haapsalu);
10
- height: get-spacing(haapsalu);
11
- }
12
-
13
- &--medium {
14
- width: get-spacing(kuressaare);
15
- height: get-spacing(kuressaare);
16
- }
17
-
18
- &--large {
19
- width: get-spacing(viljandi);
20
- height: get-spacing(viljandi);
21
- }
22
- }
1
+ @import '@buerokratt-ria/styles/styles/tools/spacing';
2
+
3
+ .icon {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+
8
+ &--small {
9
+ width: get-spacing(haapsalu);
10
+ height: get-spacing(haapsalu);
11
+ }
12
+
13
+ &--medium {
14
+ width: get-spacing(kuressaare);
15
+ height: get-spacing(kuressaare);
16
+ }
17
+
18
+ &--large {
19
+ width: get-spacing(viljandi);
20
+ height: get-spacing(viljandi);
21
+ }
22
+ }