goobs-frontend 0.7.69 → 0.7.71

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/README.md CHANGED
@@ -68,7 +68,7 @@ The Button component is a customizable button with support for icons, variants,
68
68
 
69
69
  ### Card
70
70
 
71
- The Card component offers various card layouts for displaying content, including product cards, pricing cards, and more.
71
+ The Card component offers various card layouts for displaying content, including product cards, pricing cards, and more. It supports different variants such as default, inventory, pricing summary, detailed pricing summary, product, and product summary.
72
72
 
73
73
  ### CodeCopy
74
74
 
@@ -80,7 +80,15 @@ The ConfirmationCodeInput component provides an input field for entering confirm
80
80
 
81
81
  ### Content
82
82
 
83
- The Content component is a flexible container for rendering various types of content within your application.
83
+ The Content component is a flexible container for rendering various types of content within your application. It supports different content types including typography, radio groups, confirmation code inputs, links, buttons, images, pricing tables, steppers, transfer lists, cards, code copy blocks, text fields, date fields, dropdowns, increment number fields, searchbars, number fields, password fields, and QR codes.
84
+
85
+ ### DateField
86
+
87
+ The DateField component provides a date picker input field with customizable styling options.
88
+
89
+ ### Dropdown
90
+
91
+ The Dropdown component offers a customizable select input with various styling options.
84
92
 
85
93
  ### Form
86
94
 
@@ -90,25 +98,49 @@ The Form component includes the PopupForm subcomponent, which renders a customiz
90
98
 
91
99
  The Grid component is a highly customizable and flexible grid system built with React and Material-UI. It allows you to create complex grid layouts with ease, providing a wide range of configuration options for grids, rows, columns, and cells.
92
100
 
101
+ ### IncrementNumberField
102
+
103
+ The IncrementNumberField component provides an input field for numeric values with increment and decrement buttons.
104
+
93
105
  ### Nav
94
106
 
95
107
  The Nav component provides navigation functionality, including both horizontal and vertical navigation options.
96
108
 
109
+ ### NumberField
110
+
111
+ The NumberField component offers an input field specifically designed for numeric input with optional minimum and maximum value constraints.
112
+
113
+ ### PasswordField
114
+
115
+ The PasswordField component provides a secure input field for password entry with a show/hide password toggle.
116
+
117
+ ### PhoneNumberField
118
+
119
+ The PhoneNumberField component offers an input field specifically formatted for phone number entry.
120
+
97
121
  ### PricingTable
98
122
 
99
123
  The PricingTable component renders a customizable pricing table for displaying product or service pricing information.
100
124
 
125
+ ### QRCode
126
+
127
+ The QRCode component generates and displays QR codes based on the provided value.
128
+
101
129
  ### RadioGroup
102
130
 
103
131
  The RadioGroup component renders a group of radio buttons for selecting a single option from multiple choices.
104
132
 
133
+ ### Searchbar
134
+
135
+ The Searchbar component provides a search input field with customizable styling options.
136
+
105
137
  ### Stepper
106
138
 
107
139
  The Stepper component provides a step-by-step interface for guiding users through a process or workflow.
108
140
 
109
- ### StyledComponent
141
+ ### TextField
110
142
 
111
- The StyledComponent is a versatile and customizable input component built with React and Material-UI. It provides a range of input variants and supports various styling options to match your application's design requirements.
143
+ The TextField component offers a customizable text input field with various styling and behavior options.
112
144
 
113
145
  ### Toolbar
114
146
 
@@ -120,20 +152,25 @@ The TransferList component provides a dual-list interface for transferring items
120
152
 
121
153
  ### Typography
122
154
 
123
- The Typography component is a text component for rendering customizable typography.
155
+ The Typography component is a text component for rendering customizable typography with support for different font families, variants, and colors.
124
156
 
125
157
  ## Usage
126
158
 
127
- To use the components and utilities in your project, you can import them from the `goobs-frontend` package. For example:
159
+ To use the components, types, and utilities in your project, you can import them from the `goobs-frontend` package. Here's a comprehensive list of all available imports:
128
160
 
129
- ```jsx
161
+ ```typescript
130
162
  import {
163
+ // Components
131
164
  CustomButton,
132
165
  CustomGrid,
133
- StyledComponent,
134
166
  Typography,
135
- RadioGroup,
136
167
  ConfirmationCodeInput,
168
+ RadioGroup,
169
+ PopupForm,
170
+ ContentSection,
171
+ Accordion,
172
+ AccordionSummary,
173
+ AccordionDetails,
137
174
  Card,
138
175
  CodeCopy,
139
176
  Nav,
@@ -141,7 +178,146 @@ import {
141
178
  CustomStepper,
142
179
  CustomToolbar,
143
180
  TransferList,
144
- Accordion,
181
+ StyledTooltip,
182
+ QRCodeComponent,
183
+ DateField,
184
+ Dropdown,
185
+ IncrementNumberField,
186
+ NumberField,
187
+ PasswordField,
188
+ PhoneNumberField,
189
+ Searchbar,
190
+ TextField,
191
+
192
+ // Types
193
+ CustomButtonProps,
194
+ CustomGridProps,
195
+ Alignment,
196
+ BorderProp,
197
+ columnconfig,
198
+ gridconfig,
199
+ cellconfig,
200
+ FontFamily,
201
+ TypographyVariant,
202
+ TypographyProps,
203
+ ConfirmationCodeInputsProps,
204
+ RadioOption,
205
+ RadioGroupProps,
206
+ PopupFormProps,
207
+ ContentSectionProps,
208
+ CardProps,
209
+ CodeCopyProps,
210
+ NavProps,
211
+ PricingProps,
212
+ CustomStepperProps,
213
+ ToolbarProps,
214
+ TransferListProps,
215
+ CustomTooltipProps,
216
+ QRCodeProps,
217
+ DateFieldProps,
218
+ DropdownProps,
219
+ IncrementNumberFieldProps,
220
+ NumberFieldProps,
221
+ PasswordFieldProps,
222
+ PhoneNumberFieldProps,
223
+ SearchbarProps,
224
+ TextFieldProps,
225
+
226
+ // Extended Types
227
+ ExtendedButtonProps,
228
+ ExtendedTypographyProps,
229
+ ExtendedTextFieldProps,
230
+ ExtendedQRCodeProps,
231
+ ExtendedDropdownProps,
232
+ ExtendedDateFieldProps,
233
+ ExtendedNumberFieldProps,
234
+ ExtendedIncrementNumberFieldProps,
235
+ ExtendedPasswordFieldProps,
236
+ ExtendedSearchbarProps,
237
+ ExtendedCodeCopyProps,
238
+ ExtendedCardProps,
239
+ ExtendedTransferListProps,
240
+ ExtendedStepperProps,
241
+ ExtendedPricingProps,
242
+ ExtendedImageProps,
243
+ ExtendedConfirmationCodeInputsProps,
244
+ ExtendedRadioGroupProps,
245
+
246
+ // Component Props Types
247
+ TypographyComponentProps,
248
+ ConfirmationCodeInputProps,
249
+ RadioGroupComponentProps,
250
+ PopupFormComponentProps,
251
+ ContentSectionComponentProps,
252
+ AccordionProps,
253
+ AccordionSummaryProps,
254
+ AccordionDetailsProps,
255
+ CardComponentProps,
256
+ CodeCopyComponentProps,
257
+ NavComponentProps,
258
+ PricingTableComponentProps,
259
+ CustomStepperComponentProps,
260
+ CustomToolbarComponentProps,
261
+ TransferListComponentProps,
262
+ StyledTooltipComponentProps,
263
+
264
+ // Styles
265
+ formContainerStyle,
266
+
267
+ // Animations
268
+ Animation,
269
+
270
+ // Colors
271
+ moss,
272
+ aqua,
273
+ madder,
274
+ woad,
275
+ marine,
276
+ pansy,
277
+ stainlessSteel,
278
+ coal,
279
+ ocean,
280
+ sky,
281
+ salmon,
282
+ lightning,
283
+ sage,
284
+ lilac,
285
+ gunpowder,
286
+ lightMadder,
287
+ black,
288
+ white,
289
+ none,
290
+ semiTransparentWhite,
291
+ semiTransparentBlack,
292
+ red,
293
+ green,
294
+ greyborder,
295
+
296
+ // Typography
297
+ arapeyh1,
298
+ arapeyh2,
299
+ arapeyh3,
300
+ arapeyh4,
301
+ arapeyh5,
302
+ arapeyh6,
303
+ arapeyparagraph,
304
+ interh1,
305
+ interh2,
306
+ interh3,
307
+ interh4,
308
+ interh5,
309
+ interh6,
310
+ interparagraph,
311
+ interhelperheader,
312
+ interhelperfooter,
313
+ merrih1,
314
+ merrih2,
315
+ merrih3,
316
+ merrih4,
317
+ merrih5,
318
+ merrih6,
319
+ merriparagraph,
320
+ merrihelperfooter,
145
321
  } from 'goobs-frontend'
146
322
  ```
147
323
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goobs-frontend",
3
- "version": "0.7.69",
3
+ "version": "0.7.71",
4
4
  "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.",
5
5
  "license": "MIT",
6
6
  "main": "./src/index.ts",
@@ -21,13 +21,13 @@
21
21
  "@emotion/cache": "^11.13.1",
22
22
  "@emotion/react": "^11.13.3",
23
23
  "@emotion/styled": "^11.13.0",
24
- "@mui/icons-material": "^5.16.7",
25
- "@mui/material": "^5.16.7",
24
+ "@mui/icons-material": "^6.0.2",
25
+ "@mui/material": "^6.0.2",
26
26
  "@types/lodash": "^4.17.7",
27
27
  "highlight.js": "^11.10.0",
28
28
  "jotai": "^2.9.3",
29
29
  "lodash": "^4.17.21",
30
- "next": "14.2.6",
30
+ "next": "14.2.8",
31
31
  "react-datepicker": "^7.3.0",
32
32
  "react-qr-code": "^2.0.15"
33
33
  },
@@ -39,7 +39,7 @@
39
39
  "@typescript-eslint/eslint-plugin": "^8.2.0",
40
40
  "@typescript-eslint/parser": "^8.2.0",
41
41
  "eslint": "^8.57.0",
42
- "eslint-config-next": "^14.2.6",
42
+ "eslint-config-next": "^14.2.8",
43
43
  "eslint-config-prettier": "^9.1.0",
44
44
  "eslint-plugin-prettier": "^5.2.1",
45
45
  "prettier": "^3.3.3",
@@ -4,19 +4,73 @@ import {
4
4
  MenuItem,
5
5
  FormControl,
6
6
  InputLabel,
7
- SelectChangeEvent,
7
+ SelectProps,
8
+ FormHelperText,
8
9
  } from '@mui/material'
9
10
  import { styled } from '@mui/material/styles'
10
11
 
11
- export interface DropdownProps {
12
+ export interface DropdownOption {
13
+ value: string
12
14
  label: string
13
- options: string[]
14
- defaultOption?: string
15
- onChange?: () => void
15
+ }
16
+
17
+ export interface DropdownProps extends Omit<SelectProps, 'onChange'> {
18
+ /**
19
+ * The label for the dropdown.
20
+ */
21
+ label: string
22
+ /**
23
+ * The options for the dropdown.
24
+ */
25
+ options: DropdownOption[]
26
+ /**
27
+ * The default value for the dropdown.
28
+ */
29
+ defaultValue?: string
30
+ /**
31
+ * The background color of the dropdown.
32
+ */
16
33
  backgroundcolor?: string
34
+ /**
35
+ * The outline color of the dropdown.
36
+ */
17
37
  outlinecolor?: string
38
+ /**
39
+ * The font color of the dropdown.
40
+ */
18
41
  fontcolor?: string
42
+ /**
43
+ * The font color of the dropdown label when shrunk.
44
+ */
19
45
  shrunkfontcolor?: string
46
+ /**
47
+ * Callback function triggered when the dropdown value changes.
48
+ */
49
+ onChange?: SelectProps['onChange']
50
+ /**
51
+ * Indicates if the dropdown is in an error state.
52
+ */
53
+ error?: boolean
54
+ /**
55
+ * The helper text to display below the dropdown.
56
+ */
57
+ helperText?: string
58
+ /**
59
+ * The name of the dropdown.
60
+ */
61
+ name?: string
62
+ /**
63
+ * Indicates if the dropdown is required.
64
+ */
65
+ required?: boolean
66
+ /**
67
+ * Callback function triggered when the dropdown loses focus.
68
+ */
69
+ onBlur?: SelectProps['onBlur']
70
+ /**
71
+ * Callback function triggered when the dropdown receives focus.
72
+ */
73
+ onFocus?: SelectProps['onFocus']
20
74
  }
21
75
 
22
76
  const StyledFormControl = styled(FormControl)<{
@@ -46,44 +100,74 @@ const StyledInputLabel = styled(InputLabel)<{ shrunkfontcolor?: string }>(
46
100
  })
47
101
  )
48
102
 
103
+ /**
104
+ * Dropdown component built with Material UI.
105
+ */
49
106
  const Dropdown: React.FC<DropdownProps> = ({
50
107
  label,
51
108
  options,
52
- defaultOption,
53
- onChange,
109
+ defaultValue,
54
110
  backgroundcolor,
55
111
  outlinecolor,
56
112
  fontcolor,
57
113
  shrunkfontcolor,
114
+ onChange,
115
+ error = false,
116
+ helperText,
117
+ name,
118
+ required = false,
119
+ onBlur,
120
+ onFocus,
121
+ ...rest
58
122
  }) => {
59
- const [selectedValue, setSelectedValue] = useState(defaultOption || '')
123
+ const [selectedValue, setSelectedValue] = useState(() => {
124
+ const defaultOption = options.find(option => option.value === defaultValue)
125
+ return defaultOption ? defaultOption.value : ''
126
+ })
60
127
 
61
- const handleChange = (event: SelectChangeEvent) => {
128
+ const handleChange: SelectProps['onChange'] = (event, child) => {
62
129
  const newValue = event.target.value as string
63
130
  setSelectedValue(newValue)
64
- onChange?.()
131
+ onChange?.(event, child)
132
+ }
133
+
134
+ const handleBlur: SelectProps['onBlur'] = event => {
135
+ onBlur?.(event)
136
+ }
137
+
138
+ const handleFocus: SelectProps['onFocus'] = event => {
139
+ onFocus?.(event)
65
140
  }
66
141
 
67
142
  return (
68
143
  <StyledFormControl
69
144
  backgroundcolor={backgroundcolor}
70
145
  outlinecolor={outlinecolor}
146
+ error={error}
147
+ required={required}
71
148
  >
72
- <StyledInputLabel shrunkfontcolor={shrunkfontcolor}>
149
+ <StyledInputLabel id={`${name}-label`} shrunkfontcolor={shrunkfontcolor}>
73
150
  {label}
74
151
  </StyledInputLabel>
75
152
  <Select
153
+ labelId={`${name}-label`}
76
154
  value={selectedValue}
77
155
  onChange={handleChange}
156
+ onBlur={handleBlur}
157
+ onFocus={handleFocus}
78
158
  label={label}
79
159
  sx={{ color: fontcolor }}
160
+ name={name}
161
+ aria-labelledby={`${name}-label`}
162
+ {...rest}
80
163
  >
81
164
  {options.map(option => (
82
- <MenuItem key={option} value={option}>
83
- {option}
165
+ <MenuItem key={option.value} value={option.value}>
166
+ {option.label}
84
167
  </MenuItem>
85
168
  ))}
86
169
  </Select>
170
+ {helperText && <FormHelperText>{helperText}</FormHelperText>}
87
171
  </StyledFormControl>
88
172
  )
89
173
  }
@@ -1,7 +1,8 @@
1
1
  'use client'
2
2
 
3
3
  import React from 'react'
4
- import { Grid, Box, GridProps, useMediaQuery, useTheme } from '@mui/material'
4
+ import Grid2, { Grid2Props } from '@mui/material/Grid2'
5
+ import { Box, useMediaQuery, useTheme } from '@mui/material'
5
6
 
6
7
  /** Defines the possible alignment options for grid content */
7
8
  export type Alignment = 'left' | 'center' | 'right' | 'inherit' | 'justify'
@@ -47,7 +48,7 @@ export interface gridconfig {
47
48
  /**
48
49
  * Props for the CustomGrid component
49
50
  */
50
- export interface CustomGridProps extends GridProps {
51
+ export interface CustomGridProps extends Grid2Props {
51
52
  gridconfig?: gridconfig
52
53
  columnconfig?: columnconfig[]
53
54
  cellconfig?: cellconfig
@@ -111,7 +112,6 @@ const CustomGrid: React.FC<CustomGridProps> = ({
111
112
  minWidth={minGridWidth}
112
113
  >
113
114
  <Box
114
- // @ts-ignore
115
115
  mt={gridConfigValues?.margintop || 0}
116
116
  mb={gridConfigValues?.marginbottom || 0}
117
117
  ml={gridConfigValues?.marginleft || 0}
@@ -132,7 +132,7 @@ const CustomGrid: React.FC<CustomGridProps> = ({
132
132
  )
133
133
 
134
134
  return (
135
- <Grid
135
+ <Grid2
136
136
  key={`row-${rowIndex}`}
137
137
  container
138
138
  alignItems="center"
@@ -194,8 +194,7 @@ const CustomGrid: React.FC<CustomGridProps> = ({
194
194
  const computerWidth = currentCellConfig?.computerwidth || '100%'
195
195
 
196
196
  return (
197
- <Grid
198
- item
197
+ <Grid2
199
198
  key={`column-${columnIndex}`}
200
199
  sx={{
201
200
  display: 'flex',
@@ -250,10 +249,10 @@ const CustomGrid: React.FC<CustomGridProps> = ({
250
249
  >
251
250
  {currentColumnConfig?.component || null}
252
251
  </Box>
253
- </Grid>
252
+ </Grid2>
254
253
  )
255
254
  })}
256
- </Grid>
255
+ </Grid2>
257
256
  )
258
257
  })}
259
258
  </Box>