goobs-frontend 0.8.12 → 0.8.13

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.12",
3
+ "version": "0.8.13",
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",
@@ -4,9 +4,6 @@ import React from 'react'
4
4
  import Grid2, { Grid2Props } from '@mui/material/Grid2'
5
5
  import { useMediaQuery } from '@mui/material'
6
6
 
7
- // Remove all theme creation and usage
8
- // We will manually define our media queries instead of using createTheme or ThemeProvider
9
-
10
7
  type Alignment = 'left' | 'center' | 'right' | 'inherit' | 'justify'
11
8
  type BorderProp = 'none' | 'solid'
12
9
  type WrapProp = 'nowrap' | 'wrap'
@@ -24,16 +21,34 @@ interface ResponsiveObject<T> {
24
21
 
25
22
  type ResponsiveValue<T> = T | ResponsiveObject<T>
26
23
 
24
+ type cellconfig = {
25
+ border?: BorderProp
26
+ minHeight?: string
27
+ maxHeight?: string
28
+ width?: string
29
+ mobilewidth?: string
30
+ tabletwidth?: string
31
+ computerwidth?: string
32
+ borderColor?: string
33
+ backgroundColor?: string
34
+ onClick?: () => void
35
+ wrap?: WrapProp
36
+ }
37
+
27
38
  type columnconfig = {
28
39
  row: number
29
40
  column: number
30
41
  gridname?: string
31
42
  alignment?: Alignment
32
43
  margintop?: ResponsiveValue<number>
33
- columnwidth?: string
34
44
  marginbottom?: ResponsiveValue<number>
35
45
  marginright?: ResponsiveValue<number>
36
46
  marginleft?: ResponsiveValue<number>
47
+ paddingtop?: ResponsiveValue<number>
48
+ paddingbottom?: ResponsiveValue<number>
49
+ paddingright?: ResponsiveValue<number>
50
+ paddingleft?: ResponsiveValue<number>
51
+ columnwidth?: string
37
52
  component?: React.ReactNode
38
53
  bordercolor?: string
39
54
  cellconfig?: cellconfig
@@ -49,24 +64,14 @@ type gridconfig = {
49
64
  marginbottom?: ResponsiveValue<number>
50
65
  marginright?: ResponsiveValue<number>
51
66
  marginleft?: ResponsiveValue<number>
67
+ paddingtop?: ResponsiveValue<number>
68
+ paddingbottom?: ResponsiveValue<number>
69
+ paddingright?: ResponsiveValue<number>
70
+ paddingleft?: ResponsiveValue<number>
52
71
  gridwidth?: string
53
72
  bordercolor?: string
54
73
  }
55
74
 
56
- type cellconfig = {
57
- border?: BorderProp
58
- minHeight?: string
59
- maxHeight?: string
60
- width?: string
61
- mobilewidth?: string
62
- tabletwidth?: string
63
- computerwidth?: string
64
- borderColor?: string
65
- backgroundColor?: string
66
- onClick?: () => void
67
- wrap?: WrapProp
68
- }
69
-
70
75
  type CustomGridProps = Omit<Grid2Props, 'children'> & {
71
76
  gridconfig?: gridconfig
72
77
  columnconfig?: columnconfig[]
@@ -134,6 +139,41 @@ function CustomGrid({
134
139
  ? 'flex-end'
135
140
  : 'center'
136
141
 
142
+ // Get responsive margin and padding values for the overall grid
143
+ const gridMarginTop = getResponsiveValue(
144
+ gridConfigValues?.margintop,
145
+ currentBreakpoint
146
+ )
147
+ const gridMarginBottom = getResponsiveValue(
148
+ gridConfigValues?.marginbottom,
149
+ currentBreakpoint
150
+ )
151
+ const gridMarginLeft = getResponsiveValue(
152
+ gridConfigValues?.marginleft,
153
+ currentBreakpoint
154
+ )
155
+ const gridMarginRight = getResponsiveValue(
156
+ gridConfigValues?.marginright,
157
+ currentBreakpoint
158
+ )
159
+
160
+ const gridPaddingTop = getResponsiveValue(
161
+ gridConfigValues?.paddingtop,
162
+ currentBreakpoint
163
+ )
164
+ const gridPaddingBottom = getResponsiveValue(
165
+ gridConfigValues?.paddingbottom,
166
+ currentBreakpoint
167
+ )
168
+ const gridPaddingLeft = getResponsiveValue(
169
+ gridConfigValues?.paddingleft,
170
+ currentBreakpoint
171
+ )
172
+ const gridPaddingRight = getResponsiveValue(
173
+ gridConfigValues?.paddingright,
174
+ currentBreakpoint
175
+ )
176
+
137
177
  const rows = Math.max(...(columnconfig || []).map(c => c.row || 1))
138
178
 
139
179
  return (
@@ -148,10 +188,16 @@ function CustomGrid({
148
188
  padding: 0,
149
189
  margin: 0,
150
190
  gap: 0,
191
+ // Apply grid-level margins and paddings
192
+ marginTop: gridMarginTop ? `${gridMarginTop * 8}px` : 0,
193
+ marginBottom: gridMarginBottom ? `${gridMarginBottom * 8}px` : 0,
194
+ marginLeft: gridMarginLeft ? `${gridMarginLeft * 8}px` : 0,
195
+ marginRight: gridMarginRight ? `${gridMarginRight * 8}px` : 0,
196
+ paddingTop: gridPaddingTop ? `${gridPaddingTop * 8}px` : 0,
197
+ paddingBottom: gridPaddingBottom ? `${gridPaddingBottom * 8}px` : 0,
198
+ paddingLeft: gridPaddingLeft ? `${gridPaddingLeft * 8}px` : 0,
199
+ paddingRight: gridPaddingRight ? `${gridPaddingRight * 8}px` : 0,
151
200
  // Remove or adjust the child selector that sets margin:0
152
- // If we must not remove code, we can make it more specific so it doesn't override column margins.
153
- // Change '& > *' to a more specific selector that doesn't conflict with column Grid2 items:
154
- // For example, limit it to direct child elements that are not Grid2:
155
201
  '& > *:not(.grid-column)': {
156
202
  border: 'none !important',
157
203
  padding: 0,
@@ -221,6 +267,7 @@ function CustomGrid({
221
267
  ? 'flex-end'
222
268
  : 'center'
223
269
 
270
+ // Get responsive margin and padding values for the column
224
271
  const marginTop = getResponsiveValue(
225
272
  currentColumnConfig?.margintop,
226
273
  currentBreakpoint
@@ -238,6 +285,23 @@ function CustomGrid({
238
285
  currentBreakpoint
239
286
  )
240
287
 
288
+ const paddingTop = getResponsiveValue(
289
+ currentColumnConfig?.paddingtop,
290
+ currentBreakpoint
291
+ )
292
+ const paddingBottom = getResponsiveValue(
293
+ currentColumnConfig?.paddingbottom,
294
+ currentBreakpoint
295
+ )
296
+ const paddingLeft = getResponsiveValue(
297
+ currentColumnConfig?.paddingleft,
298
+ currentBreakpoint
299
+ )
300
+ const paddingRight = getResponsiveValue(
301
+ currentColumnConfig?.paddingright,
302
+ currentBreakpoint
303
+ )
304
+
241
305
  return (
242
306
  <Grid2
243
307
  key={`column-${columnIndex}`}
@@ -252,8 +316,8 @@ function CustomGrid({
252
316
  flexShrink: hasFixedWidth ? 0 : 1,
253
317
  flexBasis: hasFixedWidth ? columnWidth : 'auto',
254
318
  height: 'fit-content',
255
- padding: 0,
256
- // Add !important to ensure we override any parent styles
319
+
320
+ // Apply margin
257
321
  marginLeft: marginLeft
258
322
  ? `${marginLeft * 8}px !important`
259
323
  : '0 !important',
@@ -266,6 +330,21 @@ function CustomGrid({
266
330
  marginBottom: marginBottom
267
331
  ? `${marginBottom * 8}px !important`
268
332
  : '0 !important',
333
+
334
+ // Apply padding
335
+ paddingLeft: paddingLeft
336
+ ? `${paddingLeft * 8}px !important`
337
+ : '0 !important',
338
+ paddingRight: paddingRight
339
+ ? `${paddingRight * 8}px !important`
340
+ : '0 !important',
341
+ paddingTop: paddingTop
342
+ ? `${paddingTop * 8}px !important`
343
+ : '0 !important',
344
+ paddingBottom: paddingBottom
345
+ ? `${paddingBottom * 8}px !important`
346
+ : '0 !important',
347
+
269
348
  border: 'none',
270
349
  backgroundColor: currentCellConfig?.backgroundColor,
271
350
  minHeight: 'min-content',
@@ -1,5 +1,4 @@
1
1
  'use client'
2
-
3
2
  import React, { useState, useCallback } from 'react'
4
3
  import {
5
4
  Drawer,
@@ -40,6 +39,7 @@ export interface VerticalVariantProps {
40
39
  mobileOpen?: boolean
41
40
  onClose?: () => void
42
41
  variant?: 'temporary' | 'permanent'
42
+ spacingfromtopofscreen?: string
43
43
  }
44
44
 
45
45
  function VerticalVariant({
@@ -62,6 +62,7 @@ function VerticalVariant({
62
62
  mobileOpen = false,
63
63
  onClose,
64
64
  variant = 'permanent',
65
+ spacingfromtopofscreen = '0px',
65
66
  }: VerticalVariantProps) {
66
67
  const router = useRouter()
67
68
  const [selectedNav, setSelectedNav] = useState<string | null>(null)
@@ -432,6 +433,7 @@ function VerticalVariant({
432
433
  backgroundColor: ocean.main,
433
434
  pt: '17px',
434
435
  boxSizing: 'border-box',
436
+ marginTop: spacingfromtopofscreen,
435
437
  },
436
438
  }}
437
439
  >
@@ -36,6 +36,7 @@ export interface NavProps {
36
36
  mobileOpen?: boolean // Controls mobile drawer open state
37
37
  onClose?: () => void // Handler for closing mobile drawer
38
38
  variant?: 'temporary' | 'permanent' // Drawer variant for mobile/desktop
39
+ spacingfromtopofscreen?: string // Spacing from top of screen
39
40
  }
40
41
 
41
42
  /**
@@ -83,6 +84,7 @@ function Nav({
83
84
  mobileOpen = false,
84
85
  onClose,
85
86
  variant = 'permanent',
87
+ spacingfromtopofscreen,
86
88
  }: NavProps): JSX.Element {
87
89
  // State for expanded navigation items
88
90
  const [expandedNavs, setExpandedNavs] = useState<string[]>([])
@@ -129,6 +131,7 @@ function Nav({
129
131
  mobileOpen={mobileOpen}
130
132
  onClose={onClose}
131
133
  variant={variant}
134
+ spacingfromtopofscreen={spacingfromtopofscreen}
132
135
  />
133
136
  )
134
137
  } else {
@@ -2,13 +2,16 @@ import { PricingProps } from './index'
2
2
 
3
3
  /**
4
4
  * Default configuration for the PricingTable component
5
+ *
6
+ * All margin and padding values are now defined as ResponsiveObject<number> directly
7
+ * in the columnconfig, allowing you to edit each breakpoint value individually.
5
8
  */
9
+
6
10
  const defaultConfig: PricingProps = {
7
11
  // Configuration for the header grid
8
12
  headerGridConfig: {
9
13
  gridname: 'pricingtableheader',
10
14
  alignment: 'center' as const,
11
- margintop: 1,
12
15
  gridwidth: '100%',
13
16
  },
14
17
  // Configuration for the table title
@@ -19,11 +22,27 @@ const defaultConfig: PricingProps = {
19
22
  column: 1,
20
23
  gridname: 'pricingtableheader',
21
24
  alignment: 'left' as const,
22
- marginleft: 3,
23
- marginbottom: 1,
25
+ paddingleft: {
26
+ xs: 2,
27
+ sm: 2,
28
+ md: 2,
29
+ ms: 2,
30
+ ml: 2,
31
+ lg: 2,
32
+ xl: 2,
33
+ },
34
+ paddingtop: {
35
+ xs: 1,
36
+ sm: 1,
37
+ md: 1,
38
+ ms: 1,
39
+ ml: 1,
40
+ lg: 1,
41
+ xl: 1,
42
+ },
24
43
  mobilewidth: '100%',
25
44
  tabletwidth: '100%',
26
- computerwidth: '100%',
45
+ computerwidth: '50%',
27
46
  },
28
47
  },
29
48
  // Configuration for package columns
@@ -31,10 +50,46 @@ const defaultConfig: PricingProps = {
31
50
  packagenames: ['ThothOS', 'ThothOS Pro', 'ThothOS Enterprise'],
32
51
  columnconfig: {
33
52
  row: 1,
34
- column: 2,
53
+ column: 1,
35
54
  gridname: 'pricingtableheader',
36
55
  alignment: 'center' as const,
37
- mobilewidth: '80%',
56
+ paddingleft: {
57
+ xs: 2,
58
+ sm: 2,
59
+ md: 2,
60
+ ms: 2,
61
+ ml: 2,
62
+ lg: 2,
63
+ xl: 2,
64
+ },
65
+ paddingright: {
66
+ xs: 2,
67
+ sm: 2,
68
+ md: 2,
69
+ ms: 2,
70
+ ml: 2,
71
+ lg: 2,
72
+ xl: 2,
73
+ },
74
+ paddingtop: {
75
+ xs: 2.5,
76
+ sm: 2.5,
77
+ md: 2.5,
78
+ ms: 2.5,
79
+ ml: 2.5,
80
+ lg: 2.5,
81
+ xl: 2.5,
82
+ },
83
+ paddingbottom: {
84
+ xs: 1,
85
+ sm: 2,
86
+ md: 2,
87
+ ms: 2,
88
+ ml: 2,
89
+ lg: 2,
90
+ xl: 2,
91
+ },
92
+ mobilewidth: '100%',
38
93
  tabletwidth: '48%',
39
94
  computerwidth: '48%',
40
95
  },
@@ -250,10 +305,35 @@ const defaultConfig: PricingProps = {
250
305
  ],
251
306
  columnconfig: {
252
307
  row: 7,
253
- column: 2,
308
+ column: 1,
254
309
  mobilewidth: '100%',
255
- marginbottom: 1,
256
- marginright: 1,
310
+ marginbottom: {
311
+ xs: 1,
312
+ sm: 1,
313
+ md: 1,
314
+ ms: 1,
315
+ ml: 1,
316
+ lg: 1,
317
+ xl: 1,
318
+ },
319
+ marginright: {
320
+ xs: 1,
321
+ sm: 1,
322
+ md: 1,
323
+ ms: 1,
324
+ ml: 1,
325
+ lg: 1,
326
+ xl: 1,
327
+ },
328
+ marginleft: {
329
+ xs: 1,
330
+ sm: 1,
331
+ md: 1,
332
+ ms: 1,
333
+ ml: 1,
334
+ lg: 1,
335
+ xl: 1,
336
+ },
257
337
  tabletwidth: '100%',
258
338
  computerwidth: '48%',
259
339
  gridname: 'pricingtablefeatures',
@@ -129,6 +129,9 @@ const PricingTable: React.FC<PricingProps> = props => {
129
129
  if (config.packagecolumns && config.packagecolumns.columnconfig) {
130
130
  headerColumnConfigs.push({
131
131
  ...config.packagecolumns.columnconfig,
132
+ // Add 5px margin above (margintop: 0.625) and to the right (marginright: 0.625)
133
+ margintop: 1,
134
+ marginright: 0.625,
132
135
  component: (
133
136
  <Dropdown
134
137
  label="Packages"
@@ -138,6 +141,7 @@ const PricingTable: React.FC<PricingProps> = props => {
138
141
  }))}
139
142
  defaultValue={selectedPackage}
140
143
  backgroundcolor={semiTransparentBlack.main}
144
+ shrunklabelposition="aboveNotch"
141
145
  outlinecolor={black.main}
142
146
  fontcolor={black.main}
143
147
  shrunkfontcolor={black.main}
@@ -177,6 +181,8 @@ const PricingTable: React.FC<PricingProps> = props => {
177
181
  if (feature.columnconfig) {
178
182
  featureColumnConfigs.push({
179
183
  ...feature.columnconfig,
184
+ margintop: 1,
185
+ paddingleft: 2,
180
186
  component: (
181
187
  <Box display="flex" alignItems="center">
182
188
  <Typography
@@ -207,6 +213,7 @@ const PricingTable: React.FC<PricingProps> = props => {
207
213
  if (feature.tiedtopackage && feature.tiedtopackage.columnconfig) {
208
214
  const tiedConfig: columnconfig = {
209
215
  ...feature.tiedtopackage.columnconfig,
216
+ margintop: 1,
210
217
  cellconfig: {
211
218
  minHeight: '40px',
212
219
  },
@@ -225,6 +232,8 @@ const PricingTable: React.FC<PricingProps> = props => {
225
232
  if (subFeature.columnconfig) {
226
233
  featureColumnConfigs.push({
227
234
  ...subFeature.columnconfig,
235
+ margintop: 1,
236
+ paddingleft: 3,
228
237
  component: (
229
238
  <Box display="flex" alignItems="center">
230
239
  <Typography
@@ -255,6 +264,7 @@ const PricingTable: React.FC<PricingProps> = props => {
255
264
  if (subFeature.tiedtopackage && subFeature.tiedtopackage.columnconfig) {
256
265
  const tiedConfig: columnconfig = {
257
266
  ...subFeature.tiedtopackage.columnconfig,
267
+ margintop: 1,
258
268
  cellconfig: {
259
269
  minHeight: '40px',
260
270
  },
@@ -279,6 +289,7 @@ const PricingTable: React.FC<PricingProps> = props => {
279
289
 
280
290
  featureColumnConfigs.push({
281
291
  ...config.buttoncolumns.columnconfig,
292
+ margintop: 1,
282
293
  component: (
283
294
  <CustomButton
284
295
  variant="contained"