goobs-frontend 0.8.14 → 0.8.15

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": "goobs-frontend",
3
- "version": "0.8.14",
3
+ "version": "0.8.15",
4
4
  "type": "module",
5
5
  "description": "A comprehensive React-based UI library built on Material-UI, offering a wide range of customizable components including grids, typography, buttons, cards, forms, navigation, pricing tables, steppers, tooltips, accordions, and more. Designed for building responsive and consistent user interfaces with advanced features like form validation, theming, and code syntax highlighting.",
6
6
  "license": "MIT",
@@ -22,13 +22,13 @@
22
22
  "@emotion/cache": "^11.14.0",
23
23
  "@emotion/react": "^11.14.0",
24
24
  "@emotion/styled": "^11.14.0",
25
- "@mui/icons-material": "^6.2.0",
26
- "@mui/material": "^6.2.0",
25
+ "@mui/icons-material": "^6.3.0",
26
+ "@mui/material": "^6.3.0",
27
27
  "@types/lodash": "^4.17.13",
28
- "highlight.js": "^11.10.0",
29
- "jotai": "^2.10.3",
28
+ "highlight.js": "^11.11.1",
29
+ "jotai": "^2.11.0",
30
30
  "lodash": "^4.17.21",
31
- "next": "15.1.2",
31
+ "next": "15.1.3",
32
32
  "otplib": "^12.0.1",
33
33
  "react-datepicker": "^7.5.0",
34
34
  "react-qr-code": "^2.0.15",
@@ -38,14 +38,14 @@
38
38
  "slate-react": "^0.112.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@next/eslint-plugin-next": "^15.1.0",
41
+ "@next/eslint-plugin-next": "^15.1.3",
42
42
  "@types/node": "^22.10.2",
43
- "@types/react": "19.0.1",
44
- "@types/react-dom": "^19.0.1",
45
- "@typescript-eslint/eslint-plugin": "^8.18.0",
46
- "@typescript-eslint/parser": "^8.18.0",
47
- "eslint": "^9.16.0",
48
- "eslint-config-next": "^15.1.2",
43
+ "@types/react": "19.0.2",
44
+ "@types/react-dom": "^19.0.2",
45
+ "@typescript-eslint/eslint-plugin": "^8.19.0",
46
+ "@typescript-eslint/parser": "^8.19.0",
47
+ "eslint": "^9.17.0",
48
+ "eslint-config-next": "^15.1.3",
49
49
  "eslint-config-prettier": "^9.1.0",
50
50
  "eslint-plugin-prettier": "^5.2.1",
51
51
  "prettier": "^3.4.2",
@@ -0,0 +1,163 @@
1
+ 'use client'
2
+ import React, { FC } from 'react'
3
+ import {
4
+ Accordion as MuiAccordion,
5
+ AccordionSummary,
6
+ AccordionDetails,
7
+ List,
8
+ } from '@mui/material'
9
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
10
+ import { white } from '../../../../styles/palette'
11
+ import { Typography } from '../../../Typography'
12
+
13
+ interface MainNavComponentProps {
14
+ /**
15
+ * The label/title for this main navigation item.
16
+ */
17
+ title?: string
18
+
19
+ /**
20
+ * If `true`, we show an expand icon and child subNav items.
21
+ */
22
+ hasChildren: boolean
23
+
24
+ /**
25
+ * Which top-level nav titles are expanded
26
+ */
27
+ expandedNavs: string[]
28
+
29
+ /**
30
+ * Setter for expandedNavs
31
+ */
32
+ setExpandedNavs: React.Dispatch<React.SetStateAction<string[]>>
33
+
34
+ /**
35
+ * A callback for route or onClick triggers
36
+ */
37
+ onClick?: () => void
38
+
39
+ /**
40
+ * The nesting level for indentation
41
+ */
42
+ level: number
43
+
44
+ /**
45
+ * Child nodes (subNav) if `hasChildren` is true
46
+ */
47
+ children?: React.ReactNode
48
+
49
+ /**
50
+ * Hover color (not used in the example styling, but available if needed)
51
+ */
52
+ activeAndHoverColor?: string
53
+ }
54
+
55
+ const MainNavComponent: FC<MainNavComponentProps> = ({
56
+ title,
57
+ hasChildren,
58
+ expandedNavs,
59
+ setExpandedNavs,
60
+ onClick,
61
+ level,
62
+ children,
63
+ }) => {
64
+ const isExpanded = expandedNavs.includes(title ?? '')
65
+
66
+ return (
67
+ <MuiAccordion
68
+ disableGutters
69
+ elevation={0}
70
+ square
71
+ expanded={isExpanded}
72
+ onChange={() => {
73
+ if (isExpanded) {
74
+ setExpandedNavs(expandedNavs.filter(t => t !== title))
75
+ } else {
76
+ setExpandedNavs([...expandedNavs, title ?? ''])
77
+ }
78
+ }}
79
+ sx={{
80
+ pl: 0,
81
+ backgroundColor: 'transparent',
82
+ '.MuiAccordionSummary-root': {
83
+ pl: 0,
84
+ whiteSpace: 'nowrap', // no wrapping
85
+ },
86
+ '&:before': {
87
+ display: 'none',
88
+ },
89
+ }}
90
+ >
91
+ <AccordionSummary
92
+ expandIcon={
93
+ hasChildren ? (
94
+ <ExpandMoreIcon
95
+ sx={{
96
+ color: 'transparent',
97
+ }}
98
+ />
99
+ ) : null
100
+ }
101
+ aria-controls="accordion-content"
102
+ id="accordion-header"
103
+ sx={{
104
+ boxSizing: 'border-box',
105
+ border: 'none',
106
+ py: '6px',
107
+ mt: 2,
108
+ ml: 3,
109
+ minHeight: 0,
110
+ height: '32px',
111
+ '& .MuiAccordionSummary-content': {
112
+ m: 0,
113
+ whiteSpace: 'nowrap', // keep text on one line
114
+ },
115
+ '&:hover': {
116
+ '& .MuiSvgIcon-root': {
117
+ color: white.main,
118
+ },
119
+ },
120
+ '&.Mui-expanded': {
121
+ '& .MuiSvgIcon-root': {
122
+ color: white.main,
123
+ },
124
+ },
125
+ }}
126
+ onClick={() => {
127
+ if (onClick) onClick()
128
+ }}
129
+ >
130
+ <Typography
131
+ fontvariant="merrih5"
132
+ fontcolor={white.main}
133
+ text={title ?? ''}
134
+ marginLeft={4 * level}
135
+ sx={{
136
+ whiteSpace: 'nowrap', // no wrapping
137
+ }}
138
+ />
139
+ </AccordionSummary>
140
+
141
+ {hasChildren && (
142
+ <AccordionDetails
143
+ sx={{
144
+ border: 'none',
145
+ p: 0,
146
+ whiteSpace: 'nowrap',
147
+ }}
148
+ >
149
+ <List
150
+ sx={{
151
+ py: 0,
152
+ whiteSpace: 'nowrap',
153
+ }}
154
+ >
155
+ {children}
156
+ </List>
157
+ </AccordionDetails>
158
+ )}
159
+ </MuiAccordion>
160
+ )
161
+ }
162
+
163
+ export default MainNavComponent
@@ -0,0 +1,156 @@
1
+ 'use client'
2
+ import React, { FC } from 'react'
3
+ import {
4
+ Accordion as MuiAccordion,
5
+ AccordionSummary,
6
+ AccordionDetails,
7
+ List,
8
+ MenuItem,
9
+ } from '@mui/material'
10
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
11
+ import Link from 'next/link'
12
+ import { white } from '../../../../styles/palette'
13
+ import { Typography } from '../../../Typography'
14
+
15
+ interface SubNavComponentProps {
16
+ title?: string
17
+ route?: string
18
+ trigger?: 'route' | 'onClick'
19
+ expandedSubnavs: string[]
20
+ setExpandedSubnavs: React.Dispatch<React.SetStateAction<string[]>>
21
+ activeAndHoverColor: string
22
+ onClose?: () => void
23
+ variant?: 'temporary' | 'permanent'
24
+ hasChildren: boolean
25
+ children?: React.ReactNode
26
+ }
27
+
28
+ const SubNavComponent: FC<SubNavComponentProps> = ({
29
+ title,
30
+ route,
31
+ trigger,
32
+ expandedSubnavs,
33
+ setExpandedSubnavs,
34
+ activeAndHoverColor,
35
+ onClose,
36
+ variant,
37
+ hasChildren,
38
+ children,
39
+ }) => {
40
+ const isExpanded = expandedSubnavs.includes(title ?? '')
41
+
42
+ // If no children => a single route
43
+ if (!hasChildren) {
44
+ return (
45
+ <Link
46
+ key={title}
47
+ style={{ textDecoration: 'none', color: 'white' }}
48
+ href={route ?? ''}
49
+ >
50
+ <MenuItem
51
+ sx={{
52
+ color: white.main,
53
+ ml: '25px',
54
+ '&:hover': { backgroundColor: activeAndHoverColor },
55
+ '&:active': { backgroundColor: activeAndHoverColor },
56
+ whiteSpace: 'nowrap', // keep text on a single line
57
+ }}
58
+ onClick={() => {
59
+ if (trigger === 'route' && variant === 'temporary' && onClose) {
60
+ onClose()
61
+ }
62
+ }}
63
+ >
64
+ <Typography
65
+ fontvariant="merrih6"
66
+ text={title ?? ''}
67
+ fontcolor={white.main}
68
+ />
69
+ </MenuItem>
70
+ </Link>
71
+ )
72
+ }
73
+
74
+ // If we do have children => an accordion with view items
75
+ return (
76
+ <MuiAccordion
77
+ key={title}
78
+ disableGutters
79
+ elevation={0}
80
+ square
81
+ expanded={isExpanded}
82
+ onChange={() => {
83
+ if (isExpanded) {
84
+ setExpandedSubnavs(expandedSubnavs.filter(t => t !== title))
85
+ } else {
86
+ setExpandedSubnavs([...expandedSubnavs, title ?? ''])
87
+ }
88
+ }}
89
+ sx={{
90
+ pl: 0,
91
+ backgroundColor: 'transparent',
92
+ '.MuiAccordionSummary-root': {
93
+ pl: 0,
94
+ whiteSpace: 'nowrap',
95
+ },
96
+ '&:before': { display: 'none' },
97
+ }}
98
+ >
99
+ <AccordionSummary
100
+ expandIcon={
101
+ <ExpandMoreIcon
102
+ sx={{
103
+ color: 'transparent',
104
+ }}
105
+ />
106
+ }
107
+ aria-controls="accordion-content"
108
+ id="accordion-header"
109
+ sx={{
110
+ boxSizing: 'border-box',
111
+ border: 'none',
112
+ py: '6px',
113
+ mt: 0,
114
+ ml: '8px',
115
+ minHeight: 0,
116
+ height: '32px',
117
+ '& .MuiAccordionSummary-content': {
118
+ m: 0,
119
+ whiteSpace: 'nowrap',
120
+ },
121
+ '&:hover': {
122
+ '& .MuiSvgIcon-root': {
123
+ color: white.main,
124
+ },
125
+ },
126
+ '&.Mui-expanded': {
127
+ '& .MuiSvgIcon-root': {
128
+ color: white.main,
129
+ },
130
+ },
131
+ }}
132
+ >
133
+ <Typography
134
+ fontvariant="merrih6"
135
+ fontcolor={white.main}
136
+ text={title ?? ''}
137
+ marginLeft={4}
138
+ sx={{
139
+ whiteSpace: 'nowrap',
140
+ }}
141
+ />
142
+ </AccordionSummary>
143
+ <AccordionDetails
144
+ sx={{
145
+ border: 'none',
146
+ p: 0,
147
+ whiteSpace: 'nowrap',
148
+ }}
149
+ >
150
+ <List sx={{ py: 0, whiteSpace: 'nowrap' }}>{children}</List>
151
+ </AccordionDetails>
152
+ </MuiAccordion>
153
+ )
154
+ }
155
+
156
+ export default SubNavComponent
@@ -0,0 +1,75 @@
1
+ 'use client'
2
+ import React, { FC } from 'react'
3
+ import { MenuItem } from '@mui/material'
4
+ import Link from 'next/link'
5
+ import { semiTransparentWhite, white } from '../../../../styles/palette'
6
+ import { Typography } from '../../../Typography'
7
+
8
+ interface ViewNavProps {
9
+ title?: string
10
+ route?: string
11
+ trigger?: 'route' | 'onClick'
12
+ onClick?: () => void
13
+ level: number
14
+ activeAndHoverColor?: string
15
+ onClose?: () => void
16
+ variant?: 'temporary' | 'permanent'
17
+ }
18
+
19
+ const ViewNav: FC<ViewNavProps> = ({
20
+ title,
21
+ route,
22
+ trigger,
23
+ onClick,
24
+ level,
25
+ activeAndHoverColor = semiTransparentWhite.main,
26
+ onClose,
27
+ variant,
28
+ }) => {
29
+ return (
30
+ <Link
31
+ key={title}
32
+ href={route ?? ''}
33
+ style={{
34
+ textDecoration: 'none',
35
+ color: 'white',
36
+ whiteSpace: 'nowrap', // keep text in one line
37
+ }}
38
+ onClick={() => {
39
+ if (trigger === 'route' && variant === 'temporary' && onClose) {
40
+ onClose()
41
+ } else if (trigger === 'onClick' && onClick) {
42
+ onClick()
43
+ if (variant === 'temporary' && onClose) {
44
+ onClose()
45
+ }
46
+ }
47
+ }}
48
+ >
49
+ <MenuItem
50
+ sx={{
51
+ color: white.main,
52
+ pl: level + 6,
53
+ whiteSpace: 'nowrap',
54
+ '&:hover': {
55
+ backgroundColor: activeAndHoverColor,
56
+ },
57
+ '&:active': {
58
+ backgroundColor: activeAndHoverColor,
59
+ },
60
+ }}
61
+ >
62
+ <Typography
63
+ fontvariant="merriparagraph"
64
+ text={title ?? ''}
65
+ fontcolor={white.main}
66
+ sx={{
67
+ whiteSpace: 'nowrap',
68
+ }}
69
+ />
70
+ </MenuItem>
71
+ </Link>
72
+ )
73
+ }
74
+
75
+ export default ViewNav