@taruvi/navkit 0.0.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.
@@ -0,0 +1,61 @@
1
+ // Design Tokens - Centralized design values for consistent theming
2
+
3
+ export const colours = {
4
+ text: {
5
+ primary: '#333333',
6
+ secondary: '#424242',
7
+ tertiary: '#9e9e9e',
8
+ },
9
+ bg: {
10
+ white: '#fff',
11
+ light: '#f5f5f5',
12
+ avatar: '#E0E0E0',
13
+ },
14
+ border: {
15
+ light: '#e0e0e0',
16
+ },
17
+ }
18
+
19
+ export const spacing = {
20
+ xs: '10px',
21
+ sm: 1.5,
22
+ md: 2,
23
+ lg: 3,
24
+ }
25
+
26
+ export const shadows = {
27
+ dropdown: '0 4px 20px rgba(0,0,0,0.1)',
28
+ }
29
+
30
+ export const borderRadius = {
31
+ default: 2,
32
+ }
33
+
34
+ export const typography = {
35
+ sizes: {
36
+ xs: '0.8125rem',
37
+ sm: '0.875rem',
38
+ md: '1.125rem',
39
+ },
40
+ weights: {
41
+ regular: 400,
42
+ semibold: 600,
43
+ },
44
+ letterSpacing: {
45
+ default: '0.5px',
46
+ },
47
+ }
48
+
49
+ export const zIndex = {
50
+ overlay: 1300,
51
+ }
52
+
53
+ export const dimensions = {
54
+ navHeight: '60px',
55
+ avatarSize: 30,
56
+ iconSize: {
57
+ sm: '18px',
58
+ md: '24px',
59
+ lg: '1.25rem',
60
+ },
61
+ }
package/src/types.ts ADDED
@@ -0,0 +1,38 @@
1
+ import type { ReactNode } from "react"
2
+
3
+ export interface AppData {
4
+ appname: string,
5
+ icon: string,
6
+ url: string,
7
+ id: string
8
+ }
9
+
10
+ export interface UserData {
11
+ fullName?: string
12
+ pfp?: string
13
+ username?: string
14
+ email?: string
15
+ }
16
+
17
+ export interface SiteSettings {
18
+ shortcuts?: AppData[]
19
+ logo?: string
20
+ showChat: boolean
21
+ frontendUrl: string
22
+ mattermostUrl: string
23
+ }
24
+
25
+ export interface NavigationContextType {
26
+ navigateToUrl: (url: string, openInLine: boolean) => void
27
+ isDesk: boolean
28
+ appsList: AppData[]
29
+ userData: UserData | null
30
+ siteSettings: SiteSettings
31
+ jwtToken: string
32
+ isUserAuthenticated: boolean
33
+ }
34
+
35
+ export interface NavkitProviderProps {
36
+ children: ReactNode
37
+ client: object
38
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2022",
5
+ "useDefineForClassFields": true,
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "types": ["vite/client"],
9
+ "skipLibCheck": true,
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+ "jsx": "react-jsx",
18
+
19
+ /* Linting */
20
+ "strict": true,
21
+ "noUnusedLocals": true,
22
+ "noUnusedParameters": true,
23
+ "erasableSyntaxOnly": true,
24
+ "noFallthroughCasesInSwitch": true,
25
+ "noUncheckedSideEffectImports": true
26
+ },
27
+ "include": ["src"]
28
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "erasableSyntaxOnly": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true
24
+ },
25
+ "include": ["vite.config.ts"]
26
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+
4
+ // https://vite.dev/config/
5
+ export default defineConfig({
6
+ plugins: [
7
+ react({
8
+ babel: {
9
+ plugins: [['babel-plugin-react-compiler']],
10
+ },
11
+ }),
12
+ ],
13
+ })