goobs-frontend 0.8.13 → 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 +13 -13
- package/src/components/Button/index.tsx +44 -27
- package/src/components/DataGrid/Footer/index.tsx +1 -0
- package/src/components/Form/DataGrid/index.tsx +2 -0
- package/src/components/Nav/VerticalVariant/mainNav/index.tsx +163 -0
- package/src/components/Nav/VerticalVariant/subNav/index.tsx +156 -0
- package/src/components/Nav/VerticalVariant/viewNav/index.tsx +75 -0
- package/src/components/Nav/index.tsx +313 -119
- package/src/components/PricingTable/defaultconfig.tsx +9 -0
- package/src/components/Tabs/index.tsx +195 -0
- package/src/index.ts +41 -12
- package/src/components/Nav/HorizontalVariant/index.tsx +0 -146
- package/src/components/Nav/VerticalVariant/index.tsx +0 -445
package/src/index.ts
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from './components/Accordion'
|
|
29
29
|
import Card, { CardProps } from './components/Card'
|
|
30
30
|
import CodeCopy, { CodeCopyProps } from './components/CodeCopy'
|
|
31
|
-
import Nav, { NavProps } from './components/Nav'
|
|
31
|
+
import Nav, { NavProps, NavItem } from './components/Nav' // <-- Vertical-only Nav
|
|
32
32
|
import PricingTable, { PricingProps } from './components/PricingTable'
|
|
33
33
|
import { CustomStepper, CustomStepperProps } from './components/Stepper'
|
|
34
34
|
import CustomToolbar, { ToolbarProps } from './components/Toolbar'
|
|
@@ -39,6 +39,9 @@ import SearchableDropdown, {
|
|
|
39
39
|
SearchableDropdownProps,
|
|
40
40
|
} from './components/SearchableDropdown'
|
|
41
41
|
|
|
42
|
+
// Here is the new horizontal `Tabs` import
|
|
43
|
+
import Tabs, { TabsProps } from './components/Tabs'
|
|
44
|
+
|
|
42
45
|
// New imports
|
|
43
46
|
import DateField from './components/DateField'
|
|
44
47
|
import Dropdown, { DropdownOption } from './components/Dropdown'
|
|
@@ -48,13 +51,15 @@ import PasswordField from './components/PasswordField'
|
|
|
48
51
|
import PhoneNumberField from './components/PhoneNumberField'
|
|
49
52
|
import Searchbar from './components/Searchbar'
|
|
50
53
|
import TextField from './components/TextField'
|
|
54
|
+
|
|
51
55
|
// Add FormDataGrid import
|
|
52
56
|
import FormDataGrid from './components/Form/DataGrid'
|
|
53
57
|
import type { FormDataGridProps } from './components/Form/DataGrid'
|
|
58
|
+
|
|
54
59
|
// Animations
|
|
55
60
|
import { Animation } from './components/Content/Structure/animations'
|
|
56
61
|
|
|
57
|
-
// Importing
|
|
62
|
+
// Importing Extended Props
|
|
58
63
|
import { ExtendedComplexEditorProps } from './components/Content/Structure/complexeditor/useComplexEditor'
|
|
59
64
|
import { ExtendedButtonProps } from './components/Content/Structure/button/useButton'
|
|
60
65
|
import { ExtendedTypographyProps } from './components/Content/Structure/typography/useGridTypography'
|
|
@@ -190,7 +195,10 @@ declare type PhoneNumberFieldProps = React.ComponentProps<
|
|
|
190
195
|
declare type SearchbarProps = React.ComponentProps<typeof Searchbar>
|
|
191
196
|
declare type TextFieldProps = React.ComponentProps<typeof TextField>
|
|
192
197
|
|
|
193
|
-
|
|
198
|
+
/* -------------------------------------------------------------------------- */
|
|
199
|
+
/* Named Component Exports */
|
|
200
|
+
/* -------------------------------------------------------------------------- */
|
|
201
|
+
|
|
194
202
|
export { CustomButton }
|
|
195
203
|
export { CustomGrid }
|
|
196
204
|
export { Typography }
|
|
@@ -201,7 +209,7 @@ export { ContentSection }
|
|
|
201
209
|
export { Accordion, AccordionSummary, AccordionDetails }
|
|
202
210
|
export { Card }
|
|
203
211
|
export { CodeCopy }
|
|
204
|
-
export { Nav }
|
|
212
|
+
export { Nav } // vertical-only Nav
|
|
205
213
|
export { PricingTable }
|
|
206
214
|
export { CustomStepper }
|
|
207
215
|
export { CustomToolbar }
|
|
@@ -211,6 +219,9 @@ export { formContainerStyle }
|
|
|
211
219
|
export { QRCodeComponent }
|
|
212
220
|
export { SearchableDropdown }
|
|
213
221
|
|
|
222
|
+
// Horizontal Tabs export
|
|
223
|
+
export { Tabs }
|
|
224
|
+
|
|
214
225
|
// New named exports
|
|
215
226
|
export { DateField }
|
|
216
227
|
export { Dropdown }
|
|
@@ -224,14 +235,17 @@ export { TextField }
|
|
|
224
235
|
// Add FormDataGrid to named exports
|
|
225
236
|
export { FormDataGrid }
|
|
226
237
|
|
|
227
|
-
|
|
238
|
+
/* -------------------------------------------------------------------------- */
|
|
239
|
+
/* Named Type Exports */
|
|
240
|
+
/* -------------------------------------------------------------------------- */
|
|
241
|
+
|
|
228
242
|
export type { FormDataGridProps }
|
|
229
243
|
export type { DatagridProps }
|
|
230
244
|
export type { ColumnDef, RowData }
|
|
231
245
|
export type { CellParams, HeaderParams }
|
|
232
246
|
export type { SearchableDropdownProps }
|
|
233
247
|
|
|
234
|
-
//
|
|
248
|
+
// Extended Props
|
|
235
249
|
export type { ExtendedButtonProps }
|
|
236
250
|
export type { ExtendedTypographyProps }
|
|
237
251
|
export type { ExtendedTextFieldProps }
|
|
@@ -250,7 +264,11 @@ export type { ExtendedRadioGroupProps }
|
|
|
250
264
|
export type { ExtendedPhoneNumberFieldProps }
|
|
251
265
|
export type { ExtendedComplexEditorProps }
|
|
252
266
|
|
|
253
|
-
|
|
267
|
+
/* -------------------------------------------------------------------------- */
|
|
268
|
+
/* Additional Type Exports */
|
|
269
|
+
/* -------------------------------------------------------------------------- */
|
|
270
|
+
|
|
271
|
+
// "Local" type exports for existing components
|
|
254
272
|
export type { CustomButtonProps }
|
|
255
273
|
export type { CustomGridProps }
|
|
256
274
|
export type { columnconfig, gridconfig, cellconfig }
|
|
@@ -261,7 +279,7 @@ export type { PopupFormProps }
|
|
|
261
279
|
export type { ContentSectionProps }
|
|
262
280
|
export type { CardProps }
|
|
263
281
|
export type { CodeCopyProps }
|
|
264
|
-
export type { NavProps }
|
|
282
|
+
export type { NavProps } // vertical-only
|
|
265
283
|
export type { PricingProps }
|
|
266
284
|
export type { CustomStepperProps }
|
|
267
285
|
export type { ToolbarProps }
|
|
@@ -272,7 +290,7 @@ export type { ExtendedQRCodeProps }
|
|
|
272
290
|
export type { ExtendedDropdownProps }
|
|
273
291
|
export type { ExtendedDateFieldProps }
|
|
274
292
|
|
|
275
|
-
// Additional
|
|
293
|
+
// Additional types for newly declared fields
|
|
276
294
|
export type { TypographyComponentProps }
|
|
277
295
|
export type { ConfirmationCodeInputProps }
|
|
278
296
|
export type { RadioGroupComponentProps }
|
|
@@ -299,10 +317,19 @@ export type { PhoneNumberFieldProps }
|
|
|
299
317
|
export type { SearchbarProps }
|
|
300
318
|
export type { TextFieldProps }
|
|
301
319
|
|
|
302
|
-
//
|
|
320
|
+
// Horizontal Tabs Props
|
|
321
|
+
export type { TabsProps }
|
|
322
|
+
export type { NavItem }
|
|
323
|
+
|
|
324
|
+
/* -------------------------------------------------------------------------- */
|
|
325
|
+
/* Animation Exports */
|
|
326
|
+
/* -------------------------------------------------------------------------- */
|
|
327
|
+
|
|
303
328
|
export type { Animation }
|
|
304
329
|
|
|
305
|
-
|
|
330
|
+
/* -------------------------------------------------------------------------- */
|
|
331
|
+
/* Color Exports */
|
|
332
|
+
/* -------------------------------------------------------------------------- */
|
|
306
333
|
export {
|
|
307
334
|
moss,
|
|
308
335
|
aqua,
|
|
@@ -330,7 +357,9 @@ export {
|
|
|
330
357
|
greyborder,
|
|
331
358
|
}
|
|
332
359
|
|
|
333
|
-
|
|
360
|
+
/* -------------------------------------------------------------------------- */
|
|
361
|
+
/* Typography Exports */
|
|
362
|
+
/* -------------------------------------------------------------------------- */
|
|
334
363
|
export {
|
|
335
364
|
arapeyh1,
|
|
336
365
|
arapeyh2,
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React, { useState, useEffect } from 'react'
|
|
3
|
-
import { Box, Tabs, Tab } from '@mui/material'
|
|
4
|
-
import { NavProps, SubNav, View } from '../index'
|
|
5
|
-
import { usePathname } from 'next/navigation'
|
|
6
|
-
|
|
7
|
-
type Alignment = 'left' | 'center' | 'right' | 'inherit' | 'justify'
|
|
8
|
-
|
|
9
|
-
export interface ActiveTabValue {
|
|
10
|
-
tabId: string | false
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface HorizontalVariantProps {
|
|
14
|
-
items: (NavProps | SubNav | View)[]
|
|
15
|
-
height?: string
|
|
16
|
-
alignment?: Alignment
|
|
17
|
-
navname?: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function HorizontalVariant({
|
|
21
|
-
items,
|
|
22
|
-
height = '80px',
|
|
23
|
-
alignment = 'left',
|
|
24
|
-
navname = '',
|
|
25
|
-
}: HorizontalVariantProps) {
|
|
26
|
-
const [activeTabValues, setActiveTabValues] = useState<
|
|
27
|
-
Record<string, ActiveTabValue>
|
|
28
|
-
>({})
|
|
29
|
-
const pathname = usePathname()
|
|
30
|
-
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
const currentTab = items.find(
|
|
33
|
-
item => 'orientation' in item && item.route === pathname
|
|
34
|
-
) as NavProps | undefined
|
|
35
|
-
|
|
36
|
-
setActiveTabValues(prev => ({
|
|
37
|
-
...prev,
|
|
38
|
-
[navname]: { tabId: currentTab?.title || false },
|
|
39
|
-
}))
|
|
40
|
-
}, [items, navname, pathname])
|
|
41
|
-
|
|
42
|
-
const handleTabChange = (event: React.SyntheticEvent, newValue: string) => {
|
|
43
|
-
setActiveTabValues(prev => ({
|
|
44
|
-
...prev,
|
|
45
|
-
[navname]: { tabId: newValue },
|
|
46
|
-
}))
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const handleTabClick = (tab: NavProps) => {
|
|
50
|
-
if (tab.trigger === 'route') {
|
|
51
|
-
if (tab.route) {
|
|
52
|
-
window.location.href = tab.route
|
|
53
|
-
}
|
|
54
|
-
} else if (tab.trigger === 'onClick') {
|
|
55
|
-
if (tab.onClick) {
|
|
56
|
-
tab.onClick()
|
|
57
|
-
}
|
|
58
|
-
} else if (tab.trigger === 'routeonhorizontal') {
|
|
59
|
-
if (tab.route) {
|
|
60
|
-
window.location.href = tab.route
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<Box
|
|
67
|
-
sx={{
|
|
68
|
-
flexGrow: 1,
|
|
69
|
-
bgcolor: 'black',
|
|
70
|
-
display: 'flex',
|
|
71
|
-
height: height,
|
|
72
|
-
justifyContent: alignment,
|
|
73
|
-
paddingLeft: '5px',
|
|
74
|
-
paddingRight: '5px',
|
|
75
|
-
}}
|
|
76
|
-
>
|
|
77
|
-
<Tabs
|
|
78
|
-
value={activeTabValues[navname]?.tabId || false}
|
|
79
|
-
onChange={handleTabChange}
|
|
80
|
-
aria-label="nav tabs"
|
|
81
|
-
sx={{
|
|
82
|
-
height: height,
|
|
83
|
-
'& .MuiTabs-flexContainer': {
|
|
84
|
-
height: '100%',
|
|
85
|
-
},
|
|
86
|
-
'& .MuiTab-root': {
|
|
87
|
-
height: '100%',
|
|
88
|
-
minHeight: 'unset',
|
|
89
|
-
},
|
|
90
|
-
}}
|
|
91
|
-
>
|
|
92
|
-
{items.map((item: NavProps | SubNav | View) => {
|
|
93
|
-
if ('orientation' in item) {
|
|
94
|
-
const tab = item as NavProps
|
|
95
|
-
return (
|
|
96
|
-
<Tab
|
|
97
|
-
key={tab.title}
|
|
98
|
-
value={tab.title || ''}
|
|
99
|
-
label={tab.title || ''}
|
|
100
|
-
onClick={() => handleTabClick(tab)}
|
|
101
|
-
sx={{
|
|
102
|
-
minHeight: 0,
|
|
103
|
-
textTransform: 'none',
|
|
104
|
-
border: 'none',
|
|
105
|
-
boxSizing: 'border-box',
|
|
106
|
-
backgroundColor: 'black',
|
|
107
|
-
color: '#fff',
|
|
108
|
-
fontWeight: 500,
|
|
109
|
-
fontFamily: 'Merriweather',
|
|
110
|
-
fontSize: 16,
|
|
111
|
-
height: height,
|
|
112
|
-
'&:hover': {
|
|
113
|
-
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
114
|
-
},
|
|
115
|
-
'& .MuiTouchRipple-root': {
|
|
116
|
-
color: '#fff',
|
|
117
|
-
},
|
|
118
|
-
'&.Mui-selected': {
|
|
119
|
-
color: '#fff',
|
|
120
|
-
backgroundColor: 'rgba(255, 255, 255, 0.2)',
|
|
121
|
-
},
|
|
122
|
-
'& .MuiSvgIcon-root': {
|
|
123
|
-
color: '#fff',
|
|
124
|
-
},
|
|
125
|
-
...(tab.hasleftborder === 'true' && {
|
|
126
|
-
borderLeft: '1px solid white',
|
|
127
|
-
}),
|
|
128
|
-
...(tab.hasrightborder === 'true' && {
|
|
129
|
-
borderRight: '1px solid white',
|
|
130
|
-
}),
|
|
131
|
-
width: 'auto',
|
|
132
|
-
justifyContent: 'center',
|
|
133
|
-
alignItems: 'center',
|
|
134
|
-
px: 4,
|
|
135
|
-
}}
|
|
136
|
-
/>
|
|
137
|
-
)
|
|
138
|
-
}
|
|
139
|
-
return null
|
|
140
|
-
})}
|
|
141
|
-
</Tabs>
|
|
142
|
-
</Box>
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export default HorizontalVariant
|