ece-docs-components 1.0.4 → 1.0.6
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/dist/ThemeProvider.d.ts +12 -0
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/cjs/ThemeProvider.js +158 -0
- package/dist/cjs/ThemeProvider.js.map +1 -0
- package/dist/cjs/components/ActionButton.js +31 -0
- package/dist/cjs/components/ActionButton.js.map +1 -0
- package/dist/cjs/components/Alert.js +79 -0
- package/dist/cjs/components/Alert.js.map +1 -0
- package/dist/cjs/components/Breadcrumb.js +120 -0
- package/dist/cjs/components/Breadcrumb.js.map +1 -0
- package/dist/cjs/components/Button.js +109 -0
- package/dist/cjs/components/Button.js.map +1 -0
- package/dist/cjs/components/Card.js +45 -0
- package/dist/cjs/components/Card.js.map +1 -0
- package/dist/cjs/components/Checkbox.js +42 -0
- package/dist/cjs/components/Checkbox.js.map +1 -0
- package/dist/cjs/components/Concertina.js +153 -0
- package/dist/cjs/components/Concertina.js.map +1 -0
- package/dist/cjs/components/DefinitionBox.js +77 -0
- package/dist/cjs/components/DefinitionBox.js.map +1 -0
- package/dist/cjs/components/Header.js +177 -0
- package/dist/cjs/components/Header.js.map +1 -0
- package/dist/cjs/components/Input.js +77 -0
- package/dist/cjs/components/Input.js.map +1 -0
- package/dist/cjs/components/Modal.js +114 -0
- package/dist/cjs/components/Modal.js.map +1 -0
- package/dist/cjs/components/NoteBox.js +111 -0
- package/dist/cjs/components/NoteBox.js.map +1 -0
- package/dist/cjs/components/Progress.js +83 -0
- package/dist/cjs/components/Progress.js.map +1 -0
- package/dist/cjs/components/Radio.js +61 -0
- package/dist/cjs/components/Radio.js.map +1 -0
- package/dist/cjs/components/ReadBy.js +58 -0
- package/dist/cjs/components/ReadBy.js.map +1 -0
- package/dist/cjs/components/Select.js +96 -0
- package/dist/cjs/components/Select.js.map +1 -0
- package/dist/cjs/components/Sidebar.js +206 -0
- package/dist/cjs/components/Sidebar.js.map +1 -0
- package/dist/cjs/components/SimpleModal.js +40 -0
- package/dist/cjs/components/SimpleModal.js.map +1 -0
- package/dist/cjs/components/StatusBar.js +64 -0
- package/dist/cjs/components/StatusBar.js.map +1 -0
- package/dist/cjs/components/TableOfContents.js +62 -0
- package/dist/cjs/components/TableOfContents.js.map +1 -0
- package/dist/cjs/components/Tabs.js +97 -0
- package/dist/cjs/components/Tabs.js.map +1 -0
- package/dist/cjs/components/Toggle.js +60 -0
- package/dist/cjs/components/Toggle.js.map +1 -0
- package/dist/cjs/index.js +57 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/esm/ThemeProvider.d.ts +117 -0
- package/dist/esm/ThemeProvider.js +136 -0
- package/dist/esm/ThemeProvider.js.map +1 -0
- package/dist/esm/components/ActionButton.d.ts +11 -0
- package/dist/esm/components/ActionButton.js +29 -0
- package/dist/esm/components/ActionButton.js.map +1 -0
- package/dist/esm/components/Alert.d.ts +11 -0
- package/dist/esm/components/Alert.js +77 -0
- package/dist/esm/components/Alert.js.map +1 -0
- package/dist/esm/components/Breadcrumb.d.ts +13 -0
- package/dist/esm/components/Breadcrumb.js +118 -0
- package/dist/esm/components/Breadcrumb.js.map +1 -0
- package/dist/esm/components/Button.d.ts +8 -0
- package/dist/esm/components/Button.js +107 -0
- package/dist/esm/components/Button.js.map +1 -0
- package/dist/esm/components/Card.d.ts +11 -0
- package/dist/esm/components/Card.js +43 -0
- package/dist/esm/components/Card.js.map +1 -0
- package/dist/esm/components/Checkbox.d.ts +8 -0
- package/dist/esm/components/Checkbox.js +40 -0
- package/dist/esm/components/Checkbox.js.map +1 -0
- package/dist/esm/components/Concertina.d.ts +10 -0
- package/dist/esm/components/Concertina.js +151 -0
- package/dist/esm/components/Concertina.js.map +1 -0
- package/dist/esm/components/DefinitionBox.d.ts +8 -0
- package/dist/esm/components/DefinitionBox.js +75 -0
- package/dist/esm/components/DefinitionBox.js.map +1 -0
- package/dist/esm/components/Header.d.ts +7 -0
- package/dist/esm/components/Header.js +175 -0
- package/dist/esm/components/Header.js.map +1 -0
- package/dist/esm/components/Input.d.ts +7 -0
- package/dist/esm/components/Input.js +75 -0
- package/dist/esm/components/Input.js.map +1 -0
- package/dist/esm/components/Modal.d.ts +20 -0
- package/dist/esm/components/Modal.js +112 -0
- package/dist/esm/components/Modal.js.map +1 -0
- package/dist/esm/components/NoteBox.d.ts +10 -0
- package/dist/esm/components/NoteBox.js +109 -0
- package/dist/esm/components/NoteBox.js.map +1 -0
- package/dist/esm/components/Progress.d.ts +15 -0
- package/dist/esm/components/Progress.js +80 -0
- package/dist/esm/components/Progress.js.map +1 -0
- package/dist/esm/components/Radio.d.ts +14 -0
- package/dist/esm/components/Radio.js +58 -0
- package/dist/esm/components/Radio.js.map +1 -0
- package/dist/esm/components/ReadBy.d.ts +6 -0
- package/dist/esm/components/ReadBy.js +56 -0
- package/dist/esm/components/ReadBy.js.map +1 -0
- package/dist/esm/components/Select.d.ts +19 -0
- package/dist/esm/components/Select.js +94 -0
- package/dist/esm/components/Select.js.map +1 -0
- package/dist/esm/components/Sidebar.d.ts +10 -0
- package/dist/esm/components/Sidebar.js +204 -0
- package/dist/esm/components/Sidebar.js.map +1 -0
- package/dist/esm/components/SimpleModal.d.ts +9 -0
- package/dist/esm/components/SimpleModal.js +38 -0
- package/dist/esm/components/SimpleModal.js.map +1 -0
- package/dist/esm/components/StatusBar.d.ts +9 -0
- package/dist/esm/components/StatusBar.js +62 -0
- package/dist/esm/components/StatusBar.js.map +1 -0
- package/dist/esm/components/TableOfContents.d.ts +11 -0
- package/dist/esm/components/TableOfContents.js +60 -0
- package/dist/esm/components/TableOfContents.js.map +1 -0
- package/dist/esm/components/Tabs.d.ts +12 -0
- package/dist/esm/components/Tabs.js +95 -0
- package/dist/esm/components/Tabs.js.map +1 -0
- package/dist/esm/components/Toggle.d.ts +8 -0
- package/dist/esm/components/Toggle.js +58 -0
- package/dist/esm/components/Toggle.js.map +1 -0
- package/dist/esm/components/index.d.ts +22 -0
- package/dist/esm/index.d.ts +25 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/theme-types.d.ts +39 -0
- package/dist/{index.esm.js → index.cjs} +317 -190
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +272 -190
- package/dist/index.js.map +1 -1
- package/dist/theme-types.d.ts.map +1 -1
- package/package.json +18 -11
- package/dist/index.esm.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,45 @@
|
|
|
1
|
-
'use
|
|
1
|
+
'use client';
|
|
2
|
+
import { createTheme, ThemeProvider as ThemeProvider$1, styled } from '@mui/material/styles';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { deepmerge } from '@mui/utils';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import React__default, { useState } from 'react';
|
|
7
|
+
import { Button as Button$1, styled as styled$1, InputLabel, TextField, Box, Select as Select$1, FormControl, MenuItem, FormHelperText, FormControlLabel, Typography, FormLabel, Checkbox as Checkbox$1, LinearProgress, Alert as Alert$1, IconButton, Dialog, DialogContent, Chip, Collapse, ListItemButton, List, ListItemText, Link, DialogTitle, Menu, Breadcrumbs } from '@mui/material';
|
|
8
|
+
import { ExpandMoreRounded, InfoOutlineRounded, HighlightOffRounded, ErrorOutlineRounded, TaskAltRounded, EditRounded, CloseRounded, StickyNote2Rounded, ChevronLeftRounded, ChevronRightRounded, LinkRounded, ExpandLessRounded, PieChartRounded, HomeRounded, TextSnippetRounded, HelpOutlineRounded, SchoolRounded, SearchRounded, AddRounded } from '@mui/icons-material';
|
|
9
|
+
|
|
10
|
+
const baseTheme = createTheme({
|
|
11
|
+
palette: {
|
|
12
|
+
text: {
|
|
13
|
+
primary: '#4D3019',
|
|
14
|
+
secondary: '#826E5C',
|
|
15
|
+
}
|
|
16
|
+
},
|
|
2
17
|
typography: {
|
|
3
18
|
fontFamily: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'].join(','),
|
|
19
|
+
allVariants: {
|
|
20
|
+
color: '#4D3019'
|
|
21
|
+
}
|
|
4
22
|
},
|
|
5
23
|
components: {
|
|
24
|
+
MuiTypography: {
|
|
25
|
+
styleOverrides: {
|
|
26
|
+
root: {
|
|
27
|
+
color: '#4D3019',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
6
31
|
MuiCssBaseline: {
|
|
7
|
-
styleOverrides:
|
|
32
|
+
styleOverrides: {
|
|
8
33
|
body: {
|
|
9
34
|
WebkitFontSmoothing: 'antialiased',
|
|
10
35
|
MozOsxFontSmoothing: 'grayscale',
|
|
11
36
|
backgroundColor: '#FDFCEE',
|
|
37
|
+
color: '#4D3019',
|
|
12
38
|
},
|
|
13
39
|
'input[type="checkbox"], input[type="radio"]': {
|
|
14
|
-
accentColor:
|
|
40
|
+
accentColor: '#D79AFC',
|
|
15
41
|
},
|
|
16
|
-
}
|
|
42
|
+
},
|
|
17
43
|
},
|
|
18
44
|
},
|
|
19
45
|
breakpoints: {
|
|
@@ -26,7 +52,6 @@
|
|
|
26
52
|
},
|
|
27
53
|
},
|
|
28
54
|
});
|
|
29
|
-
// Store only the configuration overrides, not full themes
|
|
30
55
|
const themeConfigs = {
|
|
31
56
|
default: {
|
|
32
57
|
palette: {
|
|
@@ -36,6 +61,10 @@ const themeConfigs = {
|
|
|
36
61
|
dark: { main: '#4D3019' },
|
|
37
62
|
light: { main: '#FEFDF7' },
|
|
38
63
|
markedRead: { main: '#A3D977' },
|
|
64
|
+
text: {
|
|
65
|
+
primary: '#4D3019',
|
|
66
|
+
secondary: '#826E5C',
|
|
67
|
+
},
|
|
39
68
|
custom: {
|
|
40
69
|
iconColor: '#ebc7ff',
|
|
41
70
|
primaryButtonTextColor: '#FFFFFF',
|
|
@@ -55,6 +84,10 @@ const themeConfigs = {
|
|
|
55
84
|
dark: { main: '#4D3019' },
|
|
56
85
|
light: { main: '#FEFDF7' },
|
|
57
86
|
markedRead: { main: '#A3D977' },
|
|
87
|
+
text: {
|
|
88
|
+
primary: '#4D3019',
|
|
89
|
+
secondary: '#826E5C',
|
|
90
|
+
},
|
|
58
91
|
custom: {
|
|
59
92
|
primaryButtonTextColor: '#FFFFFF',
|
|
60
93
|
stepIndicatorTextColor: '#FFFFFF',
|
|
@@ -70,6 +103,10 @@ const themeConfigs = {
|
|
|
70
103
|
dark: { main: '#4D3019' },
|
|
71
104
|
light: { main: '#FEFDF7' },
|
|
72
105
|
markedRead: { main: '#A3D977' },
|
|
106
|
+
text: {
|
|
107
|
+
primary: '#4D3019',
|
|
108
|
+
secondary: '#826E5C',
|
|
109
|
+
},
|
|
73
110
|
custom: {
|
|
74
111
|
iconColor: '#a4d6ff',
|
|
75
112
|
primaryButtonTextColor: '#FFFFFF',
|
|
@@ -82,24 +119,24 @@ const themeConfigs = {
|
|
|
82
119
|
appName: 'GP Docs',
|
|
83
120
|
},
|
|
84
121
|
};
|
|
85
|
-
// Create themes on-demand using useMemo
|
|
86
122
|
const createMuiTheme = (key) => {
|
|
87
|
-
return
|
|
123
|
+
return createTheme(deepmerge(baseTheme, themeConfigs[key]));
|
|
88
124
|
};
|
|
89
|
-
const ThemeContext =
|
|
125
|
+
const ThemeContext = React.createContext(undefined);
|
|
90
126
|
const ThemeProvider = ({ children }) => {
|
|
91
|
-
const [currentTheme, setCurrentTheme] =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return (jsxRuntime.jsx(ThemeContext.Provider, { value: { currentTheme, setTheme: setCurrentTheme, theme }, children: jsxRuntime.jsx(styles.ThemeProvider, { theme: theme, children: children }) }));
|
|
127
|
+
const [currentTheme, setCurrentTheme] = React.useState('default');
|
|
128
|
+
const theme = React.useMemo(() => createMuiTheme(currentTheme), [currentTheme]);
|
|
129
|
+
return (jsx(ThemeContext.Provider, { value: { currentTheme, setTheme: setCurrentTheme, theme }, children: jsx(ThemeProvider$1, { theme: theme, children: children }) }));
|
|
95
130
|
};
|
|
96
131
|
const useTheme = () => {
|
|
97
|
-
const context =
|
|
132
|
+
const context = React.useContext(ThemeContext);
|
|
98
133
|
if (context === undefined) {
|
|
99
134
|
throw new Error('useTheme must be used within a ThemeProvider');
|
|
100
135
|
}
|
|
101
136
|
return context;
|
|
102
|
-
};
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const StyledButton = styled(Button$1, {
|
|
103
140
|
shouldForwardProp: (prop) => prop !== 'customVariant' && prop !== 'customSize',
|
|
104
141
|
})(({ theme, customVariant, customSize }) => {
|
|
105
142
|
const currentTheme = theme.palette;
|
|
@@ -197,11 +234,13 @@ const useTheme = () => {
|
|
|
197
234
|
};
|
|
198
235
|
});
|
|
199
236
|
const Button = ({ variant = 'primary', size = 'md', children, fullWidth = false, ...props }) => {
|
|
200
|
-
return (
|
|
201
|
-
};
|
|
237
|
+
return (jsx(StyledButton, { customVariant: variant, customSize: size, fullWidth: fullWidth, disableRipple: true, ...props, children: children }));
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const InputWrapper = styled$1('div')(({ theme }) => ({
|
|
202
241
|
width: '100%',
|
|
203
242
|
}));
|
|
204
|
-
const StyledLabel$1 =
|
|
243
|
+
const StyledLabel$1 = styled$1(InputLabel)(({ theme }) => ({
|
|
205
244
|
fontSize: '0.875rem',
|
|
206
245
|
fontWeight: 500,
|
|
207
246
|
color: theme.palette.dark.main,
|
|
@@ -213,7 +252,7 @@ const StyledLabel$1 = material.styled(material.InputLabel)(({ theme }) => ({
|
|
|
213
252
|
color: theme.palette.dark.main,
|
|
214
253
|
},
|
|
215
254
|
}));
|
|
216
|
-
const StyledTextField$1 =
|
|
255
|
+
const StyledTextField$1 = styled$1(TextField, {
|
|
217
256
|
shouldForwardProp: (prop) => !['errorMessage'].includes(prop),
|
|
218
257
|
})(({ theme, errorMessage }) => ({
|
|
219
258
|
width: '100%',
|
|
@@ -264,8 +303,10 @@ const StyledTextField$1 = material.styled(material.TextField, {
|
|
|
264
303
|
}));
|
|
265
304
|
const Input = ({ error, fullWidth = false, id, label, ...props }) => {
|
|
266
305
|
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
267
|
-
return (
|
|
268
|
-
};
|
|
306
|
+
return (jsxs(InputWrapper, { sx: { ...(!fullWidth && { width: 'auto' }) }, children: [label && (jsx(StyledLabel$1, { htmlFor: inputId, children: label })), jsx(StyledTextField$1, { id: inputId, error: !!error, helperText: error || props.helperText, errorMessage: error, fullWidth: fullWidth, variant: "outlined", ...props })] }));
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
const StyledCard = styled$1(Box, {
|
|
269
310
|
shouldForwardProp: (prop) => prop !== 'customPadding' && prop !== 'customVariant',
|
|
270
311
|
})(({ theme, customPadding, customVariant }) => {
|
|
271
312
|
const paddingStyles = {
|
|
@@ -299,8 +340,10 @@ const Input = ({ error, fullWidth = false, id, label, ...props }) => {
|
|
|
299
340
|
});
|
|
300
341
|
const Card = ({ children, className = '', padding = 'md', variant = 'default', sx, // Destructure sx prop
|
|
301
342
|
}) => {
|
|
302
|
-
return (
|
|
303
|
-
};
|
|
343
|
+
return (jsx(StyledCard, { className: className, customPadding: padding, customVariant: variant, sx: sx, children: children }));
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
const StyledSelect = styled$1(Select$1)(({ theme, error }) => ({
|
|
304
347
|
backgroundColor: theme.palette.light.main,
|
|
305
348
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
306
349
|
? parseInt(theme.shape.borderRadius, 10)
|
|
@@ -328,7 +371,7 @@ const Card = ({ children, className = '', padding = 'md', variant = 'default', s
|
|
|
328
371
|
color: `${theme.palette.dark.main}66`,
|
|
329
372
|
},
|
|
330
373
|
}));
|
|
331
|
-
const StyledInputLabel =
|
|
374
|
+
const StyledInputLabel = styled$1(InputLabel)(({ theme }) => ({
|
|
332
375
|
fontSize: '0.875rem',
|
|
333
376
|
fontWeight: 500,
|
|
334
377
|
color: theme.palette.dark.main,
|
|
@@ -355,7 +398,7 @@ const Select = ({ label, error, helperText, fullWidth = false, options, classNam
|
|
|
355
398
|
onChange(syntheticEvent);
|
|
356
399
|
}
|
|
357
400
|
};
|
|
358
|
-
return (
|
|
401
|
+
return (jsxs(FormControl, { fullWidth: fullWidth, error: !!error, className: className, children: [label && (jsx(StyledInputLabel, { htmlFor: selectId, shrink: false, children: label })), jsx(StyledSelect, { id: selectId, name: name, value: value || '', onChange: handleChange, disabled: disabled, error: !!error, IconComponent: ExpandMoreRounded, MenuProps: {
|
|
359
402
|
PaperProps: {
|
|
360
403
|
sx: {
|
|
361
404
|
mt: 1,
|
|
@@ -363,7 +406,7 @@ const Select = ({ label, error, helperText, fullWidth = false, options, classNam
|
|
|
363
406
|
boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
364
407
|
},
|
|
365
408
|
},
|
|
366
|
-
}, children: options.map((option) => (
|
|
409
|
+
}, children: options.map((option) => (jsx(MenuItem, { value: option.value, sx: {
|
|
367
410
|
fontSize: '1rem',
|
|
368
411
|
color: theme.palette.dark.main,
|
|
369
412
|
'&:hover': {
|
|
@@ -375,16 +418,18 @@ const Select = ({ label, error, helperText, fullWidth = false, options, classNam
|
|
|
375
418
|
backgroundColor: `${theme.palette.primary.main}33`,
|
|
376
419
|
},
|
|
377
420
|
},
|
|
378
|
-
}, children: option.label }, option.value))) }), error && (
|
|
421
|
+
}, children: option.label }, option.value))) }), error && (jsx(FormHelperText, { sx: {
|
|
379
422
|
mt: 0.75,
|
|
380
423
|
fontSize: '0.875rem',
|
|
381
424
|
color: theme.palette.accent.main,
|
|
382
|
-
}, children: error })), helperText && !error && (
|
|
425
|
+
}, children: error })), helperText && !error && (jsx(FormHelperText, { sx: {
|
|
383
426
|
mt: 0.75,
|
|
384
427
|
fontSize: '0.875rem',
|
|
385
428
|
color: `${theme.palette.dark.main}99`,
|
|
386
429
|
}, children: helperText }))] }));
|
|
387
|
-
};
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
const CustomRadioIcon = styled$1('span')(({ theme, checked }) => ({
|
|
388
433
|
width: 20,
|
|
389
434
|
height: 20,
|
|
390
435
|
borderRadius: '50%',
|
|
@@ -398,7 +443,7 @@ const Select = ({ label, error, helperText, fullWidth = false, options, classNam
|
|
|
398
443
|
const Radio = ({ label, description, className = '', id, checked, ...props }) => {
|
|
399
444
|
const radioId = id || `radio-${Math.random().toString(36).substr(2, 9)}`;
|
|
400
445
|
const { theme } = useTheme();
|
|
401
|
-
return (
|
|
446
|
+
return (jsx(FormControlLabel, { className: className, control: jsxs(Box, { sx: { display: 'flex', alignItems: 'center', height: 24, mr: 1.5 }, children: [jsx("input", { id: radioId, type: "radio", style: { display: 'none' }, checked: checked, ...props }), jsx(CustomRadioIcon, { checked: checked, onClick: (e) => {
|
|
402
447
|
const input = document.getElementById(radioId);
|
|
403
448
|
if (input && !props.disabled) {
|
|
404
449
|
input.click();
|
|
@@ -406,13 +451,13 @@ const Radio = ({ label, description, className = '', id, checked, ...props }) =>
|
|
|
406
451
|
}, sx: {
|
|
407
452
|
cursor: props.disabled ? 'not-allowed' : 'pointer',
|
|
408
453
|
opacity: props.disabled ? 0.5 : 1,
|
|
409
|
-
} })] }), label:
|
|
454
|
+
} })] }), label: jsxs(Box, { sx: { ml: 0 }, children: [jsx(Typography, { component: "label", htmlFor: radioId, sx: {
|
|
410
455
|
fontSize: '1rem',
|
|
411
456
|
fontWeight: 500,
|
|
412
457
|
color: theme.palette.dark.main,
|
|
413
458
|
cursor: props.disabled ? 'not-allowed' : 'pointer',
|
|
414
459
|
opacity: props.disabled ? 0.5 : 1,
|
|
415
|
-
}, children: label }), description && (
|
|
460
|
+
}, children: label }), description && (jsx(Typography, { variant: "body2", sx: {
|
|
416
461
|
fontSize: '0.875rem',
|
|
417
462
|
color: `${theme.palette.dark.main}99`,
|
|
418
463
|
mt: 0.25,
|
|
@@ -420,7 +465,7 @@ const Radio = ({ label, description, className = '', id, checked, ...props }) =>
|
|
|
420
465
|
};
|
|
421
466
|
const RadioGroup = ({ label, error, children, className = '' }) => {
|
|
422
467
|
const { theme } = useTheme();
|
|
423
|
-
return (
|
|
468
|
+
return (jsxs(FormControl, { component: "fieldset", className: className, error: !!error, fullWidth: true, children: [label && (jsx(FormLabel, { component: "legend", sx: {
|
|
424
469
|
fontSize: '0.875rem',
|
|
425
470
|
fontWeight: 500,
|
|
426
471
|
color: theme.palette.dark.main,
|
|
@@ -428,16 +473,18 @@ const RadioGroup = ({ label, error, children, className = '' }) => {
|
|
|
428
473
|
'&.Mui-focused': {
|
|
429
474
|
color: theme.palette.dark.main,
|
|
430
475
|
},
|
|
431
|
-
}, children: label })),
|
|
476
|
+
}, children: label })), jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1.5 }, children: children }), error && (jsx(FormHelperText, { sx: {
|
|
432
477
|
mt: 1,
|
|
433
478
|
fontSize: '0.875rem',
|
|
434
479
|
color: theme.palette.accent.main,
|
|
435
480
|
}, children: error }))] }));
|
|
436
|
-
};
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
const StyledWrapper$1 = styled$1(Box)(({ theme }) => ({
|
|
437
484
|
display: 'flex',
|
|
438
485
|
alignItems: 'flex-start',
|
|
439
486
|
}));
|
|
440
|
-
const StyledCheckbox =
|
|
487
|
+
const StyledCheckbox = styled$1(Checkbox$1)(({ theme }) => ({
|
|
441
488
|
width: 16, // Matches Tailwind's w-4 (16px)
|
|
442
489
|
height: 16, // Matches Tailwind's h-4 (16px)
|
|
443
490
|
color: theme.palette.dark.main + '33', // dark.main with 20% opacity (border-dark/20)
|
|
@@ -451,21 +498,23 @@ const StyledCheckbox = material.styled(material.Checkbox)(({ theme }) => ({
|
|
|
451
498
|
borderRadius: theme.shape.borderRadius, // Matches rounded
|
|
452
499
|
cursor: 'pointer',
|
|
453
500
|
}));
|
|
454
|
-
const StyledLabel =
|
|
501
|
+
const StyledLabel = styled$1(Typography)(({ theme }) => ({
|
|
455
502
|
fontSize: '1rem', // text-base (16px)
|
|
456
503
|
fontWeight: 500, // font-medium
|
|
457
504
|
color: theme.palette.dark.main, // text-dark
|
|
458
505
|
cursor: 'pointer',
|
|
459
506
|
}));
|
|
460
|
-
const StyledDescription =
|
|
507
|
+
const StyledDescription = styled$1(Typography)(({ theme }) => ({
|
|
461
508
|
fontSize: '0.875rem', // text-sm (14px)
|
|
462
509
|
color: theme.palette.dark.main + '99', // dark.main with 60% opacity (text-dark/60)
|
|
463
510
|
marginTop: theme.spacing(0.5), // mt-0.5
|
|
464
511
|
}));
|
|
465
512
|
const Checkbox = ({ label, description, className = '', id, ...props }) => {
|
|
466
513
|
const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
467
|
-
return (
|
|
468
|
-
};
|
|
514
|
+
return (jsx(StyledWrapper$1, { className: className, children: jsx(FormControlLabel, { control: jsx(StyledCheckbox, { id: checkboxId, ...props }), label: jsxs(Box, { sx: { ml: 1.5, display: 'flex', flexDirection: 'column' }, children: [jsx(StyledLabel, { children: label }), description && jsx(StyledDescription, { children: description })] }) }) }));
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
const StyledLinearProgress = styled$1(LinearProgress)(({ theme }) => ({
|
|
469
518
|
height: 10,
|
|
470
519
|
borderRadius: 9999,
|
|
471
520
|
backgroundColor: `${theme.palette.dark.main}1A`,
|
|
@@ -477,9 +526,9 @@ const Checkbox = ({ label, description, className = '', id, ...props }) => {
|
|
|
477
526
|
}));
|
|
478
527
|
const Progress = ({ current, total, showLabel = true, className = '' }) => {
|
|
479
528
|
const percentage = Math.min(Math.max((current / total) * 100, 0), 100);
|
|
480
|
-
return (
|
|
529
|
+
return (jsxs(Box, { className: className, children: [showLabel && (jsxs(Box, { sx: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 1 }, children: [jsxs(Typography, { variant: "body2", fontWeight: 500, children: ["Step ", current, " of ", total] }), jsxs(Typography, { variant: "body2", fontWeight: 500, children: [Math.round(percentage), "%"] })] })), jsx(StyledLinearProgress, { variant: "determinate", value: percentage })] }));
|
|
481
530
|
};
|
|
482
|
-
const StepNumber =
|
|
531
|
+
const StepNumber = styled$1(Box)(({ theme, isActive, isCompleted }) => ({
|
|
483
532
|
width: 40,
|
|
484
533
|
height: 40,
|
|
485
534
|
borderRadius: '50%',
|
|
@@ -502,7 +551,7 @@ const StepNumber = material.styled(material.Box)(({ theme, isActive, isCompleted
|
|
|
502
551
|
fontSize: '0.75rem',
|
|
503
552
|
},
|
|
504
553
|
}));
|
|
505
|
-
const StepLine =
|
|
554
|
+
const StepLine = styled$1(Box)(({ theme, isCompleted }) => ({
|
|
506
555
|
flex: 1,
|
|
507
556
|
height: 4,
|
|
508
557
|
borderRadius: 2,
|
|
@@ -517,7 +566,7 @@ const StepLine = material.styled(material.Box)(({ theme, isCompleted }) => ({
|
|
|
517
566
|
}));
|
|
518
567
|
const StepIndicator = ({ steps, currentStep, className = '' }) => {
|
|
519
568
|
const { theme } = useTheme();
|
|
520
|
-
return (
|
|
569
|
+
return (jsx(Box, { className: className, sx: {
|
|
521
570
|
display: 'flex',
|
|
522
571
|
alignItems: 'center',
|
|
523
572
|
justifyContent: 'space-between',
|
|
@@ -527,15 +576,17 @@ const StepIndicator = ({ steps, currentStep, className = '' }) => {
|
|
|
527
576
|
const stepNumber = index + 1;
|
|
528
577
|
const isActive = stepNumber === currentStep;
|
|
529
578
|
const isCompleted = stepNumber < currentStep;
|
|
530
|
-
return (
|
|
579
|
+
return (jsxs(React__default.Fragment, { children: [jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', alignItems: 'center', flexShrink: 0 }, children: [jsx(StepNumber, { isActive: isActive, isCompleted: isCompleted, children: stepNumber }), jsx(Typography, { sx: {
|
|
531
580
|
mt: { xs: 0.5, sm: 1 },
|
|
532
581
|
fontSize: { xs: '10px', sm: '12px' },
|
|
533
582
|
fontWeight: 500,
|
|
534
583
|
whiteSpace: 'nowrap',
|
|
535
584
|
color: isActive ? theme.palette.primary.main : `${theme.palette.dark.main}99`,
|
|
536
|
-
}, children: step })] }), index < steps.length - 1 && (
|
|
585
|
+
}, children: step })] }), index < steps.length - 1 && (jsx(StepLine, { isCompleted: isCompleted }))] }, index));
|
|
537
586
|
}) }));
|
|
538
|
-
};
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
const StyledAlert = styled$1(Alert$1)(({ theme, customvariant }) => {
|
|
539
590
|
const variants = {
|
|
540
591
|
info: {
|
|
541
592
|
backgroundColor: '#eff6ff',
|
|
@@ -589,11 +640,11 @@ const StepIndicator = ({ steps, currentStep, className = '' }) => {
|
|
|
589
640
|
});
|
|
590
641
|
const Alert = ({ variant = 'info', children, className = '', icon = true, sx, }) => {
|
|
591
642
|
const iconMap = {
|
|
592
|
-
info:
|
|
593
|
-
success:
|
|
594
|
-
warning:
|
|
595
|
-
error:
|
|
596
|
-
custom:
|
|
643
|
+
info: jsx(InfoOutlineRounded, { sx: { fontSize: 20 } }),
|
|
644
|
+
success: jsx(TaskAltRounded, { sx: { fontSize: 20 } }),
|
|
645
|
+
warning: jsx(ErrorOutlineRounded, { sx: { fontSize: 20 } }),
|
|
646
|
+
error: jsx(HighlightOffRounded, { sx: { fontSize: 20 } }),
|
|
647
|
+
custom: jsx(InfoOutlineRounded, { sx: { fontSize: 20 } }),
|
|
597
648
|
};
|
|
598
649
|
const severityMap = {
|
|
599
650
|
info: 'info',
|
|
@@ -602,12 +653,14 @@ const Alert = ({ variant = 'info', children, className = '', icon = true, sx, })
|
|
|
602
653
|
error: 'error',
|
|
603
654
|
custom: 'info',
|
|
604
655
|
};
|
|
605
|
-
return (
|
|
606
|
-
};
|
|
656
|
+
return (jsx(StyledAlert, { customvariant: variant, severity: severityMap[variant], icon: icon ? iconMap[variant] : false, className: className, sx: sx, children: children }));
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
const NoteContainer = styled$1(Box)({
|
|
607
660
|
position: 'relative',
|
|
608
661
|
maxWidth: '100%',
|
|
609
662
|
});
|
|
610
|
-
const EditButton =
|
|
663
|
+
const EditButton = styled$1(IconButton)(({ theme }) => ({
|
|
611
664
|
position: 'absolute',
|
|
612
665
|
right: -4,
|
|
613
666
|
top: '50%',
|
|
@@ -623,7 +676,7 @@ const EditButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
623
676
|
transform: 'translateY(-50%) scale(1.1)',
|
|
624
677
|
},
|
|
625
678
|
}));
|
|
626
|
-
const HighlightWrapper =
|
|
679
|
+
const HighlightWrapper = styled$1(Box)(({ isHovered, highlightColor, highlightSelectedColor, isCustom }) => ({
|
|
627
680
|
position: 'relative',
|
|
628
681
|
display: 'inline-block',
|
|
629
682
|
maxWidth: '100%',
|
|
@@ -645,7 +698,7 @@ const HighlightWrapper = material.styled(material.Box)(({ isHovered, highlightCo
|
|
|
645
698
|
},
|
|
646
699
|
}));
|
|
647
700
|
const NoteBox = ({ variant = 'default', label, children, className = '', onEditClick, }) => {
|
|
648
|
-
const [isHovered, setIsHovered] =
|
|
701
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
649
702
|
const variants = {
|
|
650
703
|
default: {
|
|
651
704
|
highlight: '#FFEACD',
|
|
@@ -692,17 +745,19 @@ const NoteBox = ({ variant = 'default', label, children, className = '', onEditC
|
|
|
692
745
|
};
|
|
693
746
|
const style = variants[variant];
|
|
694
747
|
const displayLabel = label || style.label;
|
|
695
|
-
return (
|
|
748
|
+
return (jsxs(NoteContainer, { className: className, children: [displayLabel && (jsx(Box, { sx: { mb: 1 }, children: jsx(Typography, { component: "span", sx: {
|
|
696
749
|
fontSize: '13px',
|
|
697
750
|
fontWeight: 500,
|
|
698
751
|
color: style.labelColor || 'rgba(0, 0, 0, 0.6)',
|
|
699
|
-
}, children: displayLabel }) })),
|
|
752
|
+
}, children: displayLabel }) })), jsxs(HighlightWrapper, { isHovered: isHovered, highlightColor: style.highlight, highlightSelectedColor: style.highlightSelected, isCustom: variant === 'custom', onMouseEnter: () => variant !== 'custom' && setIsHovered(true), onMouseLeave: () => variant !== 'custom' && setIsHovered(false), children: [jsx("span", { className: "highlight-span", children: children }), jsx(EditButton, { className: "edit-button", onClick: (e) => {
|
|
700
753
|
e.stopPropagation();
|
|
701
754
|
if (onEditClick) {
|
|
702
755
|
onEditClick();
|
|
703
756
|
}
|
|
704
|
-
}, title: "Edit variable highlight", size: "small", children:
|
|
705
|
-
};
|
|
757
|
+
}, title: "Edit variable highlight", size: "small", children: jsx(EditRounded, { sx: { fontSize: 14, color: "#FFFFFF", strokeWidth: 2 } }) })] })] }));
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
const StyledDialog$1 = styled$1(Dialog)(({ theme }) => ({
|
|
706
761
|
'& .MuiDialog-paper': {
|
|
707
762
|
borderRadius: theme.shape.borderRadius,
|
|
708
763
|
maxWidth: '896px',
|
|
@@ -710,7 +765,7 @@ const NoteBox = ({ variant = 'default', label, children, className = '', onEditC
|
|
|
710
765
|
maxHeight: '90vh',
|
|
711
766
|
},
|
|
712
767
|
}));
|
|
713
|
-
const NavButton =
|
|
768
|
+
const NavButton = styled$1(IconButton)(({ theme }) => ({
|
|
714
769
|
width: '40px',
|
|
715
770
|
height: '40px',
|
|
716
771
|
border: `2px solid ${theme.palette.dark.main}`,
|
|
@@ -721,8 +776,8 @@ const NavButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
721
776
|
},
|
|
722
777
|
}));
|
|
723
778
|
const Modal = ({ isOpen, onClose, status, description, defaultText, note, acceptSuggestion: initialAcceptSuggestion = true, onAcceptSuggestionChange, onSave, onSubmit, onDeclineWording, onPrevious, onNext, currentPage = 1, totalPages = 1, }) => {
|
|
724
|
-
const [textValue, setTextValue] =
|
|
725
|
-
const [acceptSuggestion, setAcceptSuggestion] =
|
|
779
|
+
const [textValue, setTextValue] = useState(defaultText);
|
|
780
|
+
const [acceptSuggestion, setAcceptSuggestion] = useState(initialAcceptSuggestion);
|
|
726
781
|
const statusConfig = {
|
|
727
782
|
mandatory: {
|
|
728
783
|
color: '#F5A623',
|
|
@@ -750,12 +805,12 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
750
805
|
},
|
|
751
806
|
};
|
|
752
807
|
const statusStyle = statusConfig[status];
|
|
753
|
-
return (
|
|
808
|
+
return (jsxs(StyledDialog$1, { open: isOpen, onClose: onClose, maxWidth: "md", fullWidth: true, children: [jsx(IconButton, { onClick: onClose, sx: {
|
|
754
809
|
position: 'absolute',
|
|
755
810
|
top: 16,
|
|
756
811
|
right: 16,
|
|
757
812
|
zIndex: 1,
|
|
758
|
-
}, children:
|
|
813
|
+
}, children: jsx(CloseRounded, { sx: { fontSize: 24 } }) }), jsxs(DialogContent, { sx: { p: { xs: 3, sm: 4, md: 6 } }, children: [jsx(Box, { sx: { mb: 3 }, children: jsx(Chip, { label: statusStyle.label, sx: {
|
|
759
814
|
backgroundColor: statusStyle.color,
|
|
760
815
|
color: status === 'optional' ? '#4D3019' : '#fff',
|
|
761
816
|
fontWeight: 600,
|
|
@@ -763,7 +818,7 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
763
818
|
height: 'auto',
|
|
764
819
|
py: 1,
|
|
765
820
|
px: 2,
|
|
766
|
-
} }) }),
|
|
821
|
+
} }) }), jsx(Typography, { sx: { mb: 3, lineHeight: 1.6 }, children: description }), status === 'action-required-note' && note && (jsx(Alert$1, { icon: jsx(ErrorOutlineRounded, { sx: { fontSize: 20 } }), severity: "error", sx: {
|
|
767
822
|
mb: 2,
|
|
768
823
|
backgroundColor: '#FFE6E6',
|
|
769
824
|
borderLeft: '4px solid #F56B6B',
|
|
@@ -773,7 +828,7 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
773
828
|
'& .MuiAlert-message': {
|
|
774
829
|
color: '#4D3019',
|
|
775
830
|
},
|
|
776
|
-
}, children: note })), status === 'accepted-note' && note && (
|
|
831
|
+
}, children: note })), status === 'accepted-note' && note && (jsx(Alert$1, { icon: jsx(StickyNote2Rounded, { sx: { fontSize: 20 } }), severity: "warning", sx: {
|
|
777
832
|
mb: 2,
|
|
778
833
|
backgroundColor: '#FFF9E6',
|
|
779
834
|
borderLeft: '4px solid #F5D76E',
|
|
@@ -783,12 +838,12 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
783
838
|
'& .MuiAlert-message': {
|
|
784
839
|
color: '#4D3019',
|
|
785
840
|
},
|
|
786
|
-
}, children: note })),
|
|
841
|
+
}, children: note })), jsx(TextField, { multiline: true, rows: 4, fullWidth: true, value: textValue, onChange: (e) => setTextValue(e.target.value), disabled: acceptSuggestion, sx: {
|
|
787
842
|
mb: 2,
|
|
788
843
|
'& .MuiOutlinedInput-root': {
|
|
789
844
|
backgroundColor: acceptSuggestion ? 'rgba(0, 0, 0, 0.05)' : '#fff',
|
|
790
845
|
},
|
|
791
|
-
} }),
|
|
846
|
+
} }), jsxs(Box, { sx: {
|
|
792
847
|
display: 'flex',
|
|
793
848
|
flexDirection: { xs: 'column', sm: 'row' },
|
|
794
849
|
alignItems: { xs: 'stretch', sm: 'center' },
|
|
@@ -797,26 +852,28 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
797
852
|
pt: 3,
|
|
798
853
|
borderTop: '1px solid',
|
|
799
854
|
borderColor: 'divider',
|
|
800
|
-
}, children: [
|
|
855
|
+
}, children: [jsxs(Box, { sx: { display: 'flex', gap: 1.5 }, children: [jsx(Button, { onClick: onSave, variant: "secondary", size: "md", children: "Save" }), jsx(Button, { onClick: onSubmit, variant: "primary", size: "md", children: "Submit for review" }), jsx(Button, { onClick: onDeclineWording, variant: "danger", size: "md", children: "Decline Wording" })] }), jsxs(Box, { sx: {
|
|
801
856
|
display: 'flex',
|
|
802
857
|
alignItems: 'center',
|
|
803
858
|
gap: 2,
|
|
804
859
|
justifyContent: { xs: 'space-between', sm: 'flex-end' },
|
|
805
|
-
}, children: [
|
|
806
|
-
};
|
|
860
|
+
}, children: [jsxs(Box, { sx: { display: 'flex', gap: 1.5 }, children: [jsx(NavButton, { onClick: onPrevious, "aria-label": "Previous", children: jsx(ChevronLeftRounded, { sx: { fontSize: 20 } }) }), jsx(NavButton, { onClick: onNext, "aria-label": "Next", children: jsx(ChevronRightRounded, { sx: { fontSize: 20 } }) })] }), jsxs(Typography, { fontWeight: 500, fontSize: "1.125rem", sx: { ml: 1 }, children: [currentPage, "/", totalPages] })] })] })] })] }));
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
const StyledConcertina = styled$1(Box)(({ theme }) => ({
|
|
807
864
|
width: '100%',
|
|
808
865
|
display: 'flex',
|
|
809
866
|
flexDirection: 'column',
|
|
810
867
|
gap: theme.spacing(1), // space-y-2
|
|
811
868
|
}));
|
|
812
|
-
const StyledSection =
|
|
869
|
+
const StyledSection = styled$1(Box)(({ theme }) => ({
|
|
813
870
|
border: `1px solid ${theme.palette.grey[200]}`, // border-gray-200
|
|
814
871
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
815
872
|
? parseInt(theme.shape.borderRadius, 10)
|
|
816
873
|
: theme.shape.borderRadius || 4) * 2, // rounded-lg
|
|
817
874
|
overflow: 'hidden',
|
|
818
875
|
}));
|
|
819
|
-
const StyledHeader$1 =
|
|
876
|
+
const StyledHeader$1 = styled$1(Box)(({ theme }) => ({
|
|
820
877
|
display: 'flex',
|
|
821
878
|
alignItems: 'center',
|
|
822
879
|
justifyContent: 'space-between',
|
|
@@ -834,7 +891,7 @@ const StyledHeader$1 = material.styled(material.Box)(({ theme }) => ({
|
|
|
834
891
|
padding: theme.spacing(6),
|
|
835
892
|
},
|
|
836
893
|
}));
|
|
837
|
-
const StyledTitleWrapper =
|
|
894
|
+
const StyledTitleWrapper = styled$1(Box)(({ theme }) => ({
|
|
838
895
|
display: 'flex',
|
|
839
896
|
alignItems: 'center',
|
|
840
897
|
gap: theme.spacing(3), // sm:gap-3
|
|
@@ -844,7 +901,7 @@ const StyledTitleWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
|
844
901
|
gap: theme.spacing(2), // gap-2
|
|
845
902
|
},
|
|
846
903
|
}));
|
|
847
|
-
const StyledTitle =
|
|
904
|
+
const StyledTitle = styled$1(Typography, {
|
|
848
905
|
shouldForwardProp: (prop) => prop !== 'isHovered',
|
|
849
906
|
})(({ theme, isHovered }) => ({
|
|
850
907
|
fontWeight: 700, // font-bold
|
|
@@ -873,14 +930,14 @@ const StyledTitle = material.styled(material.Typography, {
|
|
|
873
930
|
fontSize: '1rem', // sm:text-lg
|
|
874
931
|
},
|
|
875
932
|
}));
|
|
876
|
-
const StyledLinkButton =
|
|
933
|
+
const StyledLinkButton = styled$1(IconButton)(({ theme }) => ({
|
|
877
934
|
color: theme.palette.accent.main, // text-orange-500
|
|
878
935
|
'&:hover': {
|
|
879
936
|
color: theme.palette.accent.dark || theme.palette.accent.main, // hover:text-orange-600
|
|
880
937
|
},
|
|
881
938
|
padding: 0,
|
|
882
939
|
}));
|
|
883
|
-
const StyledTooltip =
|
|
940
|
+
const StyledTooltip = styled$1(Box)(({ theme }) => ({
|
|
884
941
|
position: 'absolute',
|
|
885
942
|
top: -40, // -top-10
|
|
886
943
|
left: '50%',
|
|
@@ -897,7 +954,7 @@ const StyledTooltip = material.styled(material.Box)(({ theme }) => ({
|
|
|
897
954
|
padding: theme.spacing(1.5, 3), // sm:px-3 sm:py-1.5
|
|
898
955
|
},
|
|
899
956
|
}));
|
|
900
|
-
const StyledChevron =
|
|
957
|
+
const StyledChevron = styled$1(ExpandMoreRounded)(({ theme }) => ({
|
|
901
958
|
color: theme.palette.grey[500], // text-gray-500
|
|
902
959
|
transition: 'transform 0.2s', // transition-transform duration-200
|
|
903
960
|
width: 24, // sm:w-6
|
|
@@ -907,7 +964,7 @@ const StyledChevron = material.styled(iconsMaterial.ExpandMoreRounded)(({ theme
|
|
|
907
964
|
height: 20,
|
|
908
965
|
},
|
|
909
966
|
}));
|
|
910
|
-
const StyledContent =
|
|
967
|
+
const StyledContent = styled$1(Box)(({ theme }) => ({
|
|
911
968
|
padding: theme.spacing(2, 3, 3), // px-3 pb-3 pt-2
|
|
912
969
|
[theme.breakpoints.up('sm')]: {
|
|
913
970
|
padding: theme.spacing(2, 4, 4), // sm:px-4 sm:pb-4
|
|
@@ -916,16 +973,16 @@ const StyledContent = material.styled(material.Box)(({ theme }) => ({
|
|
|
916
973
|
padding: theme.spacing(2, 6, 6), // md:px-6 md:pb-6
|
|
917
974
|
},
|
|
918
975
|
}));
|
|
919
|
-
const StyledContentText =
|
|
976
|
+
const StyledContentText = styled$1(Typography)(({ theme }) => ({
|
|
920
977
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
921
978
|
lineHeight: 1.5, // leading-relaxed
|
|
922
979
|
wordBreak: 'break-word', // break-words
|
|
923
980
|
fontSize: 13, // style={{ fontSize: '13px' }}
|
|
924
981
|
}));
|
|
925
982
|
function Concertina({ sections }) {
|
|
926
|
-
const [openSections, setOpenSections] =
|
|
927
|
-
const [hoveredTitle, setHoveredTitle] =
|
|
928
|
-
const [copiedId, setCopiedId] =
|
|
983
|
+
const [openSections, setOpenSections] = useState(new Set());
|
|
984
|
+
const [hoveredTitle, setHoveredTitle] = useState(null);
|
|
985
|
+
const [copiedId, setCopiedId] = useState(null);
|
|
929
986
|
const toggleSection = (id) => {
|
|
930
987
|
const newOpenSections = new Set(openSections);
|
|
931
988
|
if (newOpenSections.has(id)) {
|
|
@@ -943,8 +1000,10 @@ function Concertina({ sections }) {
|
|
|
943
1000
|
setCopiedId(id);
|
|
944
1001
|
setTimeout(() => setCopiedId(null), 2000);
|
|
945
1002
|
};
|
|
946
|
-
return (
|
|
947
|
-
}
|
|
1003
|
+
return (jsx(StyledConcertina, { children: sections.map((section) => (jsxs(StyledSection, { id: section.id, children: [jsxs(StyledHeader$1, { onClick: () => toggleSection(section.id), onMouseEnter: () => setHoveredTitle(section.id), onMouseLeave: () => setHoveredTitle(null), children: [jsxs(StyledTitleWrapper, { children: [jsx(StyledTitle, { isHovered: hoveredTitle === section.id, variant: "h3", children: section.title }), hoveredTitle === section.id && (jsxs(Box, { sx: { position: 'relative', flexShrink: 0 }, children: [jsx(StyledLinkButton, { onClick: (e) => copyJumpLink(section.id, e), "aria-label": "Copy link", children: jsx(LinkRounded, { sx: { fontSize: 20 } }) }), copiedId === section.id && (jsx(StyledTooltip, { children: "Link copied" }))] }))] }), jsx(StyledChevron, { sx: { fontSize: 20, transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' } })] }), jsx(Collapse, { in: openSections.has(section.id), children: jsx(StyledContent, { children: jsx(StyledContentText, { children: section.content }) }) })] }, section.id))) }));
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
const ReadByContainer = styled$1(Box)(({ theme }) => ({
|
|
948
1007
|
display: 'flex',
|
|
949
1008
|
flexDirection: 'row',
|
|
950
1009
|
alignItems: 'flex-start',
|
|
@@ -958,7 +1017,7 @@ function Concertina({ sections }) {
|
|
|
958
1017
|
padding: theme.spacing(1.5),
|
|
959
1018
|
},
|
|
960
1019
|
}));
|
|
961
|
-
const ExpandButton =
|
|
1020
|
+
const ExpandButton = styled$1(IconButton)(({ theme }) => ({
|
|
962
1021
|
width: 32,
|
|
963
1022
|
height: 32,
|
|
964
1023
|
backgroundColor: '#4d3019',
|
|
@@ -974,22 +1033,24 @@ const ExpandButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
974
1033
|
}));
|
|
975
1034
|
const ReadBy = ({ names }) => {
|
|
976
1035
|
const { theme } = useTheme();
|
|
977
|
-
const [isExpanded, setIsExpanded] =
|
|
1036
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
978
1037
|
const displayText = isExpanded
|
|
979
1038
|
? names.join(', ')
|
|
980
1039
|
: names.length > 5
|
|
981
1040
|
? `${names.slice(0, 5).join(', ')}...`
|
|
982
1041
|
: names.join(', ');
|
|
983
|
-
return (
|
|
1042
|
+
return (jsxs(ReadByContainer, { children: [jsxs(Box, { sx: { flex: 1, minWidth: 0, wordBreak: 'break-word' }, children: [jsx(Typography, { component: "span", sx: {
|
|
984
1043
|
fontSize: { xs: '13px', sm: '14px' },
|
|
985
1044
|
fontWeight: 700,
|
|
986
1045
|
color: theme.palette.dark.main,
|
|
987
|
-
}, children: "Read by:" }),
|
|
1046
|
+
}, children: "Read by:" }), jsx(Typography, { component: "span", sx: {
|
|
988
1047
|
fontSize: { xs: '13px', sm: '14px' },
|
|
989
1048
|
color: theme.palette.dark.main,
|
|
990
1049
|
ml: 1,
|
|
991
|
-
}, children: displayText })] }), names.length > 5 && (
|
|
992
|
-
};
|
|
1050
|
+
}, children: displayText })] }), names.length > 5 && (jsx(ExpandButton, { onClick: () => setIsExpanded(!isExpanded), "aria-label": isExpanded ? 'Collapse' : 'Expand', size: "small", children: isExpanded ? (jsx(ExpandLessRounded, { sx: { fontSize: 16 } })) : (jsx(ExpandMoreRounded, { sx: { fontSize: 16 } })) }))] }));
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
const StatusBarContainer = styled$1(Box)(({ theme }) => ({
|
|
993
1054
|
width: '100%',
|
|
994
1055
|
backgroundColor: '#F5C98E',
|
|
995
1056
|
padding: theme.spacing(1.5, 3),
|
|
@@ -1003,7 +1064,7 @@ const ReadBy = ({ names }) => {
|
|
|
1003
1064
|
padding: theme.spacing(1.25, 2),
|
|
1004
1065
|
},
|
|
1005
1066
|
}));
|
|
1006
|
-
const ContentWrapper =
|
|
1067
|
+
const ContentWrapper = styled$1(Box)(({ theme }) => ({
|
|
1007
1068
|
display: 'flex',
|
|
1008
1069
|
alignItems: 'center',
|
|
1009
1070
|
gap: theme.spacing(1.5),
|
|
@@ -1015,7 +1076,7 @@ const ContentWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
|
1015
1076
|
gap: theme.spacing(1),
|
|
1016
1077
|
},
|
|
1017
1078
|
}));
|
|
1018
|
-
const NextButton =
|
|
1079
|
+
const NextButton = styled$1(IconButton)(({ theme }) => ({
|
|
1019
1080
|
width: 40,
|
|
1020
1081
|
height: 40,
|
|
1021
1082
|
border: `2px solid rgba(77, 48, 25, 0.25)`,
|
|
@@ -1031,28 +1092,30 @@ const NextButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
1031
1092
|
}));
|
|
1032
1093
|
const StatusBar = ({ itemCount, variant = 'actionstarted', onTailorClick, onNextClick }) => {
|
|
1033
1094
|
const message = `There are ${itemCount} items that need attention.`;
|
|
1034
|
-
return (
|
|
1095
|
+
return (jsxs(StatusBarContainer, { children: [jsxs(ContentWrapper, { children: [jsx(PieChartRounded, { sx: {
|
|
1035
1096
|
fontSize: 24,
|
|
1036
1097
|
color: "#4D3019",
|
|
1037
1098
|
flexShrink: 0,
|
|
1038
|
-
} }),
|
|
1099
|
+
} }), jsx(Typography, { sx: {
|
|
1039
1100
|
fontSize: { xs: '14px', sm: '15px', md: '16px' },
|
|
1040
1101
|
color: '#4D3019',
|
|
1041
1102
|
wordBreak: 'break-word',
|
|
1042
1103
|
textAlign: { xs: 'center', sm: 'left' },
|
|
1043
|
-
}, children: variant === 'actionstarted' ? (
|
|
1044
|
-
};
|
|
1104
|
+
}, children: variant === 'actionstarted' ? (jsxs(Fragment, { children: [jsx(Box, { component: "span", sx: { fontWeight: 700 }, children: "Incomplete." }), " ", message] })) : (jsxs(Fragment, { children: [jsx(Box, { component: "span", sx: { fontWeight: 700 }, children: "Not started." }), " ", message] })) })] }), variant === 'actionstarted' ? (jsx(Box, { sx: { display: 'flex', gap: 1.5, flexShrink: 0 }, children: jsx(NextButton, { onClick: onNextClick, "aria-label": "Next", children: jsx(ChevronRightRounded, { sx: { fontSize: 20 } }) }) })) : (jsx(Box, { sx: { flexShrink: 0 }, children: jsx(Button, { variant: "outline", size: "sm", onClick: onTailorClick, children: "Tailor policies" }) }))] }));
|
|
1105
|
+
};
|
|
1106
|
+
|
|
1107
|
+
const TabsContainer = styled$1(Box)({
|
|
1045
1108
|
display: 'none',
|
|
1046
1109
|
'@media (min-width: 900px)': {
|
|
1047
1110
|
display: 'block',
|
|
1048
1111
|
},
|
|
1049
1112
|
});
|
|
1050
|
-
const TabButtonsWrapper =
|
|
1113
|
+
const TabButtonsWrapper = styled$1(Box)({
|
|
1051
1114
|
display: 'flex',
|
|
1052
1115
|
gap: '4px',
|
|
1053
1116
|
backgroundColor: '#FDFCEE',
|
|
1054
1117
|
});
|
|
1055
|
-
const TabButton =
|
|
1118
|
+
const TabButton = styled$1(Button$1)(({ theme, isActive }) => ({
|
|
1056
1119
|
padding: theme.spacing(2, 3),
|
|
1057
1120
|
fontSize: '16px',
|
|
1058
1121
|
fontWeight: 500,
|
|
@@ -1076,18 +1139,18 @@ const TabButton = material.styled(material.Button)(({ theme, isActive }) => ({
|
|
|
1076
1139
|
backgroundColor: theme.palette.primary.main,
|
|
1077
1140
|
} : {},
|
|
1078
1141
|
}));
|
|
1079
|
-
const TabContent =
|
|
1142
|
+
const TabContent = styled$1(Box)(({ theme }) => ({
|
|
1080
1143
|
padding: theme.spacing(3),
|
|
1081
1144
|
color: '#4D3019',
|
|
1082
1145
|
backgroundColor: theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main,
|
|
1083
1146
|
}));
|
|
1084
|
-
const MobileContainer =
|
|
1147
|
+
const MobileContainer = styled$1(Box)({
|
|
1085
1148
|
backgroundColor: '#FDFCEE',
|
|
1086
1149
|
'@media (min-width: 900px)': {
|
|
1087
1150
|
display: 'none',
|
|
1088
1151
|
},
|
|
1089
1152
|
});
|
|
1090
|
-
const MobileTabButton =
|
|
1153
|
+
const MobileTabButton = styled$1(Button$1)(({ theme, isExpanded }) => ({
|
|
1091
1154
|
width: '100%',
|
|
1092
1155
|
display: 'flex',
|
|
1093
1156
|
alignItems: 'center',
|
|
@@ -1101,32 +1164,34 @@ const MobileTabButton = material.styled(material.Button)(({ theme, isExpanded })
|
|
|
1101
1164
|
backgroundColor: isExpanded ? theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main : 'rgba(77, 48, 25, 0.05)',
|
|
1102
1165
|
},
|
|
1103
1166
|
}));
|
|
1104
|
-
const MobileTabContent =
|
|
1167
|
+
const MobileTabContent = styled$1(Box)(({ theme }) => ({
|
|
1105
1168
|
padding: theme.spacing(2, 2, 3, 2),
|
|
1106
1169
|
color: '#4D3019',
|
|
1107
1170
|
backgroundColor: theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main,
|
|
1108
1171
|
}));
|
|
1109
1172
|
const Tabs = ({ tabs, defaultTab }) => {
|
|
1110
|
-
const [activeTab, setActiveTab] =
|
|
1111
|
-
const [mobileExpandedTab, setMobileExpandedTab] =
|
|
1173
|
+
const [activeTab, setActiveTab] = useState(defaultTab || tabs[0]?.id);
|
|
1174
|
+
const [mobileExpandedTab, setMobileExpandedTab] = useState(null);
|
|
1112
1175
|
const activeTabContent = tabs.find(tab => tab.id === activeTab)?.content;
|
|
1113
1176
|
const handleMobileTabClick = (tabId) => {
|
|
1114
1177
|
setActiveTab(tabId);
|
|
1115
1178
|
setMobileExpandedTab(mobileExpandedTab === tabId ? null : tabId);
|
|
1116
1179
|
};
|
|
1117
|
-
return (
|
|
1180
|
+
return (jsxs(Fragment, { children: [jsxs(TabsContainer, { children: [jsx(TabButtonsWrapper, { children: tabs.map((tab) => (jsx(TabButton, { onClick: () => setActiveTab(tab.id), isActive: activeTab === tab.id, children: tab.label }, tab.id))) }), jsx(TabContent, { children: activeTabContent })] }), jsx(MobileContainer, { children: tabs.map((tab, index) => (jsxs(Box, { sx: {
|
|
1118
1181
|
borderTop: index !== 0 ? '2px solid #e5e7eb' : 'none',
|
|
1119
|
-
}, children: [
|
|
1182
|
+
}, children: [jsxs(MobileTabButton, { onClick: () => handleMobileTabClick(tab.id), isExpanded: mobileExpandedTab === tab.id, children: [jsx(Box, { component: "span", sx: {
|
|
1120
1183
|
fontSize: '16px',
|
|
1121
1184
|
fontWeight: 500,
|
|
1122
1185
|
color: activeTab === tab.id ? '#4D3019' : '#826E5C',
|
|
1123
|
-
}, children: tab.label }),
|
|
1186
|
+
}, children: tab.label }), jsx(ExpandMoreRounded, { sx: {
|
|
1124
1187
|
fontSize: 20,
|
|
1125
1188
|
color: activeTab === tab.id ? '#4D3019' : '#826E5C',
|
|
1126
1189
|
transform: mobileExpandedTab === tab.id ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
1127
1190
|
transition: 'transform 0.2s',
|
|
1128
|
-
} })] }),
|
|
1129
|
-
};
|
|
1191
|
+
} })] }), jsx(Collapse, { in: mobileExpandedTab === tab.id, children: jsx(MobileTabContent, { children: tab.content }) })] }, tab.id))) })] }));
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1194
|
+
const SidebarContainer = styled$1(Box)(({ theme, isOpen }) => ({
|
|
1130
1195
|
height: '100vh',
|
|
1131
1196
|
position: 'sticky',
|
|
1132
1197
|
top: 0,
|
|
@@ -1145,7 +1210,7 @@ const Tabs = ({ tabs, defaultTab }) => {
|
|
|
1145
1210
|
width: isOpen ? '288px' : '80px',
|
|
1146
1211
|
},
|
|
1147
1212
|
}));
|
|
1148
|
-
const ToggleButton$1 =
|
|
1213
|
+
const ToggleButton$1 = styled$1(IconButton)(({ theme }) => ({
|
|
1149
1214
|
width: 40,
|
|
1150
1215
|
height: 40,
|
|
1151
1216
|
borderRadius: theme.shape.borderRadius,
|
|
@@ -1155,7 +1220,7 @@ const ToggleButton$1 = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
1155
1220
|
backgroundColor: '#3d2614',
|
|
1156
1221
|
},
|
|
1157
1222
|
}));
|
|
1158
|
-
const MenuItemButton =
|
|
1223
|
+
const MenuItemButton = styled$1(ListItemButton)(({ theme, isActive, isOpen }) => ({
|
|
1159
1224
|
borderRadius: theme.shape.borderRadius,
|
|
1160
1225
|
padding: isOpen ? '10px 8px' : '12px 0',
|
|
1161
1226
|
justifyContent: isOpen ? 'flex-start' : 'center',
|
|
@@ -1167,7 +1232,7 @@ const MenuItemButton = material.styled(material.ListItemButton)(({ theme, isActi
|
|
|
1167
1232
|
backgroundColor: `${theme.palette.dark.main}1A`,
|
|
1168
1233
|
}),
|
|
1169
1234
|
}));
|
|
1170
|
-
const IconWrapper =
|
|
1235
|
+
const IconWrapper = styled$1(Box)(({ theme, isOpen }) => ({
|
|
1171
1236
|
width: isOpen ? 32 : 40,
|
|
1172
1237
|
height: isOpen ? 32 : 40,
|
|
1173
1238
|
borderRadius: theme.shape.borderRadius,
|
|
@@ -1179,8 +1244,8 @@ const IconWrapper = material.styled(material.Box)(({ theme, isOpen }) => ({
|
|
|
1179
1244
|
}));
|
|
1180
1245
|
const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n across two lines", activePage = 'dashboard', onPageChange }) => {
|
|
1181
1246
|
const { theme } = useTheme();
|
|
1182
|
-
const [expandedItems, setExpandedItems] =
|
|
1183
|
-
const [expandedSubItems, setExpandedSubItems] =
|
|
1247
|
+
const [expandedItems, setExpandedItems] = useState([]);
|
|
1248
|
+
const [expandedSubItems, setExpandedSubItems] = useState([]);
|
|
1184
1249
|
const handlePageClick = (pageId) => {
|
|
1185
1250
|
if (onPageChange) {
|
|
1186
1251
|
onPageChange(pageId);
|
|
@@ -1190,12 +1255,12 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1190
1255
|
{
|
|
1191
1256
|
id: 'dashboard',
|
|
1192
1257
|
label: 'Dashboard',
|
|
1193
|
-
icon:
|
|
1258
|
+
icon: jsx(HomeRounded, { sx: { fontSize: 20, color: "#4D3019" } }),
|
|
1194
1259
|
},
|
|
1195
1260
|
{
|
|
1196
1261
|
id: 'policies',
|
|
1197
1262
|
label: 'Policies',
|
|
1198
|
-
icon:
|
|
1263
|
+
icon: jsx(TextSnippetRounded, { sx: { fontSize: 20, color: "#4D3019" } }),
|
|
1199
1264
|
hasChildren: true,
|
|
1200
1265
|
children: [
|
|
1201
1266
|
{ id: 'legislation', label: 'Legislation' },
|
|
@@ -1221,7 +1286,7 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1221
1286
|
{
|
|
1222
1287
|
id: 'support',
|
|
1223
1288
|
label: 'Support',
|
|
1224
|
-
icon:
|
|
1289
|
+
icon: jsx(HelpOutlineRounded, { sx: { fontSize: 20, color: "#4D3019" } }),
|
|
1225
1290
|
},
|
|
1226
1291
|
];
|
|
1227
1292
|
const toggleItem = (itemId) => {
|
|
@@ -1236,37 +1301,37 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1236
1301
|
const toggleSubItem = (subItemId) => {
|
|
1237
1302
|
setExpandedSubItems((prev) => prev.includes(subItemId) ? prev.filter((id) => id !== subItemId) : [...prev, subItemId]);
|
|
1238
1303
|
};
|
|
1239
|
-
return (
|
|
1304
|
+
return (jsxs(Fragment, { children: [isOpen && (jsx(Box, { sx: {
|
|
1240
1305
|
position: 'fixed',
|
|
1241
1306
|
inset: 0,
|
|
1242
1307
|
bgcolor: 'rgba(0, 0, 0, 0.5)',
|
|
1243
1308
|
zIndex: 40,
|
|
1244
1309
|
display: { xs: 'block', md: 'none' },
|
|
1245
|
-
}, onClick: onToggle })),
|
|
1310
|
+
}, onClick: onToggle })), jsx(SidebarContainer, { isOpen: isOpen, children: jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', height: '100%' }, children: [isOpen && (jsxs(Box, { sx: {
|
|
1246
1311
|
px: 2,
|
|
1247
1312
|
py: 3,
|
|
1248
1313
|
borderBottom: `1px solid ${theme.palette.dark.main}1A`,
|
|
1249
1314
|
flexShrink: 0,
|
|
1250
1315
|
position: 'relative',
|
|
1251
|
-
}, children: [
|
|
1316
|
+
}, children: [jsx(Typography, { variant: "h6", sx: {
|
|
1252
1317
|
fontSize: '18px',
|
|
1253
1318
|
fontWeight: 700,
|
|
1254
1319
|
color: '#4D3019',
|
|
1255
1320
|
lineHeight: 1.3,
|
|
1256
1321
|
whiteSpace: 'pre-line',
|
|
1257
1322
|
pr: 7,
|
|
1258
|
-
}, children: centreName }),
|
|
1323
|
+
}, children: centreName }), jsx(ToggleButton$1, { onClick: onToggle, sx: { position: 'absolute', top: 24, right: 16 }, "aria-label": "Collapse sidebar", children: jsx(ChevronLeftRounded, { sx: { fontSize: 20 } }) })] })), !isOpen && (jsx(Box, { sx: {
|
|
1259
1324
|
px: 1,
|
|
1260
1325
|
py: 3,
|
|
1261
1326
|
borderBottom: `1px solid ${theme.palette.dark.main}1A`,
|
|
1262
1327
|
display: 'flex',
|
|
1263
1328
|
justifyContent: 'center',
|
|
1264
|
-
}, children:
|
|
1329
|
+
}, children: jsx(ToggleButton$1, { onClick: onToggle, "aria-label": "Expand sidebar", children: jsx(ChevronRightRounded, { sx: { fontSize: 20 } }) }) })), jsx(Box, { sx: {
|
|
1265
1330
|
flex: 1,
|
|
1266
1331
|
overflowY: 'auto',
|
|
1267
1332
|
px: isOpen ? 1.5 : 1,
|
|
1268
1333
|
py: 3,
|
|
1269
|
-
}, children:
|
|
1334
|
+
}, children: jsx(List, { sx: { p: 0 }, children: menuItems.map((item) => (jsxs(Box, { sx: { mb: 1 }, children: [jsxs(MenuItemButton, { isOpen: isOpen, isActive: activePage === item.id, onClick: () => {
|
|
1270
1335
|
if (item.hasChildren) {
|
|
1271
1336
|
toggleItem(item.id);
|
|
1272
1337
|
}
|
|
@@ -1276,10 +1341,10 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1276
1341
|
}
|
|
1277
1342
|
handlePageClick(item.id);
|
|
1278
1343
|
}
|
|
1279
|
-
}, title: !isOpen ? item.label : undefined, children: [
|
|
1344
|
+
}, title: !isOpen ? item.label : undefined, children: [jsx(IconWrapper, { isOpen: isOpen, children: item.icon }), isOpen && (jsxs(Fragment, { children: [jsx(ListItemText, { primary: item.label, primaryTypographyProps: {
|
|
1280
1345
|
fontSize: '1rem',
|
|
1281
1346
|
fontWeight: 600,
|
|
1282
|
-
}, sx: { flex: 1 } }), item.hasChildren && (
|
|
1347
|
+
}, sx: { flex: 1 } }), item.hasChildren && (jsx(Box, { children: expandedItems.includes(item.id) ? (jsx(ExpandLessRounded, { sx: { fontSize: 20, color: "#4D3019" } })) : (jsx(ExpandMoreRounded, { sx: { fontSize: 20, color: "#4D3019" } })) }))] }))] }), item.hasChildren && expandedItems.includes(item.id) && item.children && isOpen && (jsx(Collapse, { in: true, timeout: "auto", children: jsx(List, { sx: { p: 0, mt: 0.5 }, children: item.children.map((subItem) => (jsxs(Box, { children: [jsxs(Box, { sx: { display: 'flex', alignItems: 'stretch' }, children: [jsx(ListItemButton, { onClick: () => handlePageClick(subItem.id), sx: {
|
|
1283
1348
|
flex: 1,
|
|
1284
1349
|
pl: 8,
|
|
1285
1350
|
py: 1.25,
|
|
@@ -1290,22 +1355,22 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1290
1355
|
...(activePage === subItem.id && {
|
|
1291
1356
|
backgroundColor: `${theme.palette.dark.main}1A`,
|
|
1292
1357
|
}),
|
|
1293
|
-
}, children:
|
|
1358
|
+
}, children: jsx(ListItemText, { primary: subItem.label, primaryTypographyProps: {
|
|
1294
1359
|
fontSize: '0.875rem',
|
|
1295
|
-
} }) }), subItem.hasChildren && subItem.children && subItem.children.length > 0 && (
|
|
1360
|
+
} }) }), subItem.hasChildren && subItem.children && subItem.children.length > 0 && (jsx(IconButton, { onClick: () => toggleSubItem(subItem.id), sx: {
|
|
1296
1361
|
px: 1,
|
|
1297
1362
|
borderRadius: `0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px 0`,
|
|
1298
1363
|
'&:hover': {
|
|
1299
1364
|
backgroundColor: `${theme.palette.dark.main}0D`,
|
|
1300
1365
|
},
|
|
1301
|
-
}, children:
|
|
1366
|
+
}, children: jsx(ChevronRightRounded, { sx: {
|
|
1302
1367
|
fontSize: 16,
|
|
1303
1368
|
color: '#4D3019',
|
|
1304
1369
|
transition: 'transform 0.2s',
|
|
1305
1370
|
transform: expandedSubItems.includes(subItem.id) ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
1306
|
-
} }) }))] }), subItem.hasChildren && expandedSubItems.includes(subItem.id) && subItem.children && (
|
|
1371
|
+
} }) }))] }), subItem.hasChildren && expandedSubItems.includes(subItem.id) && subItem.children && (jsx(Collapse, { in: true, timeout: "auto", children: jsx(List, { sx: { p: 0, mt: 0.5 }, children: subItem.children.map((nestedItem, index) => {
|
|
1307
1372
|
const nestedPageId = `${subItem.id}-${index}`;
|
|
1308
|
-
return (
|
|
1373
|
+
return (jsx(ListItemButton, { onClick: () => handlePageClick(nestedPageId), sx: {
|
|
1309
1374
|
pl: 10,
|
|
1310
1375
|
py: 1,
|
|
1311
1376
|
borderRadius: theme.shape.borderRadius,
|
|
@@ -1315,11 +1380,13 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1315
1380
|
...(activePage === nestedPageId && {
|
|
1316
1381
|
backgroundColor: `${theme.palette.dark.main}1A`,
|
|
1317
1382
|
}),
|
|
1318
|
-
}, children:
|
|
1383
|
+
}, children: jsx(ListItemText, { primary: nestedItem, primaryTypographyProps: {
|
|
1319
1384
|
fontSize: '0.875rem',
|
|
1320
1385
|
} }) }, index));
|
|
1321
1386
|
}) }) }))] }, subItem.id))) }) }))] }, item.id))) }) })] }) })] }));
|
|
1322
|
-
};
|
|
1387
|
+
};
|
|
1388
|
+
|
|
1389
|
+
const StyledHeader = styled$1(Box)(({ theme }) => ({
|
|
1323
1390
|
padding: theme.spacing(1.5, 4), // px-4 py-3
|
|
1324
1391
|
display: 'flex',
|
|
1325
1392
|
alignItems: 'center',
|
|
@@ -1334,7 +1401,7 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1334
1401
|
gap: theme.spacing(4), // md:gap-4
|
|
1335
1402
|
},
|
|
1336
1403
|
}));
|
|
1337
|
-
const StyledLogoWrapper =
|
|
1404
|
+
const StyledLogoWrapper = styled$1(Box)(({ theme }) => ({
|
|
1338
1405
|
display: 'flex',
|
|
1339
1406
|
alignItems: 'center',
|
|
1340
1407
|
gap: theme.spacing(2), // md:gap-2
|
|
@@ -1342,7 +1409,7 @@ const StyledLogoWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
|
1342
1409
|
gap: theme.spacing(1.5), // gap-1.5
|
|
1343
1410
|
},
|
|
1344
1411
|
}));
|
|
1345
|
-
const StyledLogoIcon =
|
|
1412
|
+
const StyledLogoIcon = styled$1(Box)(({ theme }) => ({
|
|
1346
1413
|
width: 32, // md:w-8 md:h-8
|
|
1347
1414
|
height: 32,
|
|
1348
1415
|
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
@@ -1351,7 +1418,7 @@ const StyledLogoIcon = material.styled(material.Box)(({ theme }) => ({
|
|
|
1351
1418
|
height: 24, // h-6
|
|
1352
1419
|
},
|
|
1353
1420
|
}));
|
|
1354
|
-
const StyledLogoText =
|
|
1421
|
+
const StyledLogoText = styled$1(Typography)(({ theme }) => ({
|
|
1355
1422
|
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
1356
1423
|
fontWeight: 700, // font-bold
|
|
1357
1424
|
letterSpacing: '0.05em', // tracking-wide
|
|
@@ -1363,7 +1430,7 @@ const StyledLogoText = material.styled(material.Typography)(({ theme }) => ({
|
|
|
1363
1430
|
fontSize: '1.125rem', // text-lg
|
|
1364
1431
|
},
|
|
1365
1432
|
}));
|
|
1366
|
-
const StyledSearchContainer =
|
|
1433
|
+
const StyledSearchContainer = styled$1(Box)(({ theme }) => ({
|
|
1367
1434
|
flex: 1,
|
|
1368
1435
|
maxWidth: '32rem', // max-w-2xl
|
|
1369
1436
|
margin: theme.spacing(0, 8), // mx-8
|
|
@@ -1375,7 +1442,7 @@ const StyledSearchContainer = material.styled(material.Box)(({ theme }) => ({
|
|
|
1375
1442
|
margin: theme.spacing(0, 2), // mx-2
|
|
1376
1443
|
},
|
|
1377
1444
|
}));
|
|
1378
|
-
const StyledTextField =
|
|
1445
|
+
const StyledTextField = styled$1(TextField)(({ theme }) => ({
|
|
1379
1446
|
'& .MuiInputBase-root': {
|
|
1380
1447
|
backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]
|
|
1381
1448
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
@@ -1405,7 +1472,7 @@ const StyledTextField = material.styled(material.TextField)(({ theme }) => ({
|
|
|
1405
1472
|
outlineOffset: 0,
|
|
1406
1473
|
},
|
|
1407
1474
|
}));
|
|
1408
|
-
const StyledSearchButton =
|
|
1475
|
+
const StyledSearchButton = styled$1(IconButton)(({ theme }) => ({
|
|
1409
1476
|
position: 'absolute',
|
|
1410
1477
|
right: theme.spacing(2), // md:right-2
|
|
1411
1478
|
top: '50%',
|
|
@@ -1424,7 +1491,7 @@ const StyledSearchButton = material.styled(material.IconButton)(({ theme }) => (
|
|
|
1424
1491
|
height: theme.spacing(4), // h-8
|
|
1425
1492
|
},
|
|
1426
1493
|
}));
|
|
1427
|
-
const StyledSearchIcon =
|
|
1494
|
+
const StyledSearchIcon = styled$1(Box)(({ theme }) => ({
|
|
1428
1495
|
width: 20, // md:w-5 md:h-5
|
|
1429
1496
|
height: 20,
|
|
1430
1497
|
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
@@ -1433,7 +1500,7 @@ const StyledSearchIcon = material.styled(material.Box)(({ theme }) => ({
|
|
|
1433
1500
|
height: 16, // h-4
|
|
1434
1501
|
},
|
|
1435
1502
|
}));
|
|
1436
|
-
const StyledUserContainer =
|
|
1503
|
+
const StyledUserContainer = styled$1(Box)(({ theme }) => ({
|
|
1437
1504
|
display: 'flex',
|
|
1438
1505
|
alignItems: 'center',
|
|
1439
1506
|
gap: theme.spacing(3), // md:gap-3
|
|
@@ -1441,7 +1508,7 @@ const StyledUserContainer = material.styled(material.Box)(({ theme }) => ({
|
|
|
1441
1508
|
gap: theme.spacing(2), // gap-2
|
|
1442
1509
|
},
|
|
1443
1510
|
}));
|
|
1444
|
-
const StyledAvatar =
|
|
1511
|
+
const StyledAvatar = styled$1(Box)(({ theme }) => ({
|
|
1445
1512
|
width: theme.spacing(6), // md:w-12
|
|
1446
1513
|
height: theme.spacing(6), // md:h-12
|
|
1447
1514
|
borderRadius: '50%', // rounded-full
|
|
@@ -1459,7 +1526,7 @@ const StyledAvatar = material.styled(material.Box)(({ theme }) => ({
|
|
|
1459
1526
|
height: theme.spacing(4), // h-8
|
|
1460
1527
|
},
|
|
1461
1528
|
}));
|
|
1462
|
-
const StyledAvatarText =
|
|
1529
|
+
const StyledAvatarText = styled$1(Typography)(({ theme }) => ({
|
|
1463
1530
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
1464
1531
|
fontWeight: 700, // font-bold
|
|
1465
1532
|
fontSize: '1.125rem', // text-lg
|
|
@@ -1467,7 +1534,7 @@ const StyledAvatarText = material.styled(material.Typography)(({ theme }) => ({
|
|
|
1467
1534
|
fontSize: '0.875rem', // text-sm
|
|
1468
1535
|
},
|
|
1469
1536
|
}));
|
|
1470
|
-
const StyledUserName =
|
|
1537
|
+
const StyledUserName = styled$1(Typography)(({ theme }) => ({
|
|
1471
1538
|
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
1472
1539
|
fontWeight: 500, // font-medium
|
|
1473
1540
|
fontSize: '1.125rem', // text-lg
|
|
@@ -1481,10 +1548,12 @@ const StyledUserName = material.styled(material.Typography)(({ theme }) => ({
|
|
|
1481
1548
|
}));
|
|
1482
1549
|
const Header = ({ userName = 'John Doe', userInitials = 'JD', }) => {
|
|
1483
1550
|
const { theme } = useTheme();
|
|
1484
|
-
return (
|
|
1485
|
-
endAdornment: (
|
|
1486
|
-
} }) }),
|
|
1487
|
-
};
|
|
1551
|
+
return (jsxs(StyledHeader, { children: [jsxs(StyledLogoWrapper, { children: [jsx(StyledLogoIcon, { children: jsx(SchoolRounded, { sx: { fontSize: 32, color: 'currentColor' } }) }), jsx(StyledLogoText, { variant: "h1", children: theme.appName })] }), jsx(StyledSearchContainer, { children: jsx(StyledTextField, { placeholder: "Search for a policy", variant: "outlined", fullWidth: true, InputProps: {
|
|
1552
|
+
endAdornment: (jsx(StyledSearchButton, { children: jsx(StyledSearchIcon, { children: jsx(SearchRounded, { sx: { fontSize: 20 } }) }) })),
|
|
1553
|
+
} }) }), jsxs(StyledUserContainer, { children: [jsx(StyledAvatar, { children: jsx(StyledAvatarText, { children: userInitials }) }), jsx(StyledUserName, { children: userName })] })] }));
|
|
1554
|
+
};
|
|
1555
|
+
|
|
1556
|
+
const Container = styled$1(Box)(({ theme }) => ({
|
|
1488
1557
|
width: '100%',
|
|
1489
1558
|
[theme.breakpoints.up('md')]: {
|
|
1490
1559
|
position: 'sticky',
|
|
@@ -1501,7 +1570,7 @@ const Header = ({ userName = 'John Doe', userInitials = 'JD', }) => {
|
|
|
1501
1570
|
},
|
|
1502
1571
|
marginBottom: theme.spacing(2),
|
|
1503
1572
|
}));
|
|
1504
|
-
const ContentBox =
|
|
1573
|
+
const ContentBox = styled$1(Box)(({ theme }) => ({
|
|
1505
1574
|
backgroundColor: '#FEFDF7',
|
|
1506
1575
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
1507
1576
|
? parseInt(theme.shape.borderRadius, 10)
|
|
@@ -1512,7 +1581,7 @@ const ContentBox = material.styled(material.Box)(({ theme }) => ({
|
|
|
1512
1581
|
padding: theme.spacing(3),
|
|
1513
1582
|
},
|
|
1514
1583
|
}));
|
|
1515
|
-
const NavLink =
|
|
1584
|
+
const NavLink = styled$1(Link)(({ theme, isActive }) => ({
|
|
1516
1585
|
display: 'block',
|
|
1517
1586
|
padding: theme.spacing(1, 2),
|
|
1518
1587
|
fontSize: '0.875rem',
|
|
@@ -1527,16 +1596,18 @@ const NavLink = material.styled(material.Link)(({ theme, isActive }) => ({
|
|
|
1527
1596
|
},
|
|
1528
1597
|
}));
|
|
1529
1598
|
const TableOfContents = ({ sections, activeSection = 'current-section', }) => {
|
|
1530
|
-
return (
|
|
1599
|
+
return (jsx(Container, { children: jsxs(ContentBox, { children: [jsx(Typography, { variant: "h6", sx: {
|
|
1531
1600
|
color: '#4D3019',
|
|
1532
1601
|
fontWeight: 600,
|
|
1533
1602
|
fontSize: '16px',
|
|
1534
1603
|
mb: 3,
|
|
1535
|
-
}, children: "In this policy" }),
|
|
1604
|
+
}, children: "In this policy" }), jsx(Box, { component: "nav", sx: { display: 'flex', flexDirection: 'column', gap: 0.25 }, children: sections.map((section) => {
|
|
1536
1605
|
const isActive = section.id === activeSection;
|
|
1537
|
-
return (
|
|
1606
|
+
return (jsx(NavLink, { href: `#${section.id}`, isActive: isActive, children: section.title }, section.id));
|
|
1538
1607
|
}) })] }) }));
|
|
1539
|
-
};
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1610
|
+
const ToggleButton = styled$1(Box)(({ theme }) => ({
|
|
1540
1611
|
display: 'inline-flex',
|
|
1541
1612
|
alignItems: 'center',
|
|
1542
1613
|
gap: theme.spacing(1.5),
|
|
@@ -1552,7 +1623,7 @@ const TableOfContents = ({ sections, activeSection = 'current-section', }) => {
|
|
|
1552
1623
|
borderColor: `${theme.palette.dark.main}4D`,
|
|
1553
1624
|
},
|
|
1554
1625
|
}));
|
|
1555
|
-
const ToggleTrack =
|
|
1626
|
+
const ToggleTrack = styled$1(Box)(({ theme, isChecked }) => ({
|
|
1556
1627
|
position: 'relative',
|
|
1557
1628
|
width: '56px',
|
|
1558
1629
|
height: '32px',
|
|
@@ -1560,7 +1631,7 @@ const ToggleTrack = material.styled(material.Box)(({ theme, isChecked }) => ({
|
|
|
1560
1631
|
backgroundColor: isChecked ? theme.palette.secondary.main : '#e5e7eb',
|
|
1561
1632
|
transition: 'background-color 0.2s',
|
|
1562
1633
|
}));
|
|
1563
|
-
const ToggleThumb =
|
|
1634
|
+
const ToggleThumb = styled$1(Box)(({ isChecked }) => ({
|
|
1564
1635
|
position: 'absolute',
|
|
1565
1636
|
top: '4px',
|
|
1566
1637
|
width: '24px',
|
|
@@ -1571,21 +1642,23 @@ const ToggleThumb = material.styled(material.Box)(({ isChecked }) => ({
|
|
|
1571
1642
|
transform: isChecked ? 'translateX(28px)' : 'translateX(4px)',
|
|
1572
1643
|
}));
|
|
1573
1644
|
const Toggle = ({ label = 'Admin view', checked = false, onChange, }) => {
|
|
1574
|
-
const [isChecked, setIsChecked] =
|
|
1645
|
+
const [isChecked, setIsChecked] = useState(checked);
|
|
1575
1646
|
const handleToggle = () => {
|
|
1576
1647
|
const newValue = !isChecked;
|
|
1577
1648
|
setIsChecked(newValue);
|
|
1578
1649
|
onChange?.(newValue);
|
|
1579
1650
|
};
|
|
1580
|
-
|
|
1651
|
+
React__default.useEffect(() => {
|
|
1581
1652
|
setIsChecked(checked);
|
|
1582
1653
|
}, [checked]);
|
|
1583
|
-
return (
|
|
1654
|
+
return (jsxs(ToggleButton, { onClick: handleToggle, children: [jsx(ToggleTrack, { isChecked: isChecked, children: jsx(ToggleThumb, { isChecked: isChecked }) }), jsx(Typography, { sx: {
|
|
1584
1655
|
color: '#4D3019',
|
|
1585
1656
|
fontWeight: 500,
|
|
1586
1657
|
fontSize: '0.875rem',
|
|
1587
1658
|
}, children: label })] }));
|
|
1588
|
-
};
|
|
1659
|
+
};
|
|
1660
|
+
|
|
1661
|
+
const StyledDialog = styled$1(Dialog)(({ theme }) => ({
|
|
1589
1662
|
'& .MuiDialog-paper': {
|
|
1590
1663
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
1591
1664
|
? parseInt(theme.shape.borderRadius, 10)
|
|
@@ -1594,7 +1667,7 @@ const Toggle = ({ label = 'Admin view', checked = false, onChange, }) => {
|
|
|
1594
1667
|
width: '100%',
|
|
1595
1668
|
},
|
|
1596
1669
|
}));
|
|
1597
|
-
const StyledDialogTitle =
|
|
1670
|
+
const StyledDialogTitle = styled$1(DialogTitle)(({ theme }) => ({
|
|
1598
1671
|
display: 'flex',
|
|
1599
1672
|
alignItems: 'center',
|
|
1600
1673
|
justifyContent: 'space-between',
|
|
@@ -1604,7 +1677,7 @@ const StyledDialogTitle = material.styled(material.DialogTitle)(({ theme }) => (
|
|
|
1604
1677
|
fontWeight: 600,
|
|
1605
1678
|
color: theme.palette.dark.main,
|
|
1606
1679
|
}));
|
|
1607
|
-
const CloseButton =
|
|
1680
|
+
const CloseButton = styled$1(IconButton)(({ theme }) => ({
|
|
1608
1681
|
padding: theme.spacing(0.5),
|
|
1609
1682
|
'&:hover': {
|
|
1610
1683
|
backgroundColor: `${theme.palette.dark.main}0D`,
|
|
@@ -1612,8 +1685,10 @@ const CloseButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
1612
1685
|
}));
|
|
1613
1686
|
const SimpleModal = ({ isOpen, onClose, title, children, }) => {
|
|
1614
1687
|
const { theme } = useTheme();
|
|
1615
|
-
return (
|
|
1616
|
-
};
|
|
1688
|
+
return (jsxs(StyledDialog, { open: isOpen, onClose: onClose, maxWidth: "sm", fullWidth: true, children: [jsxs(StyledDialogTitle, { children: [title, jsx(CloseButton, { onClick: onClose, "aria-label": "Close", children: jsx(CloseRounded, { sx: { fontSize: 20, color: theme.palette.dark.main } }) })] }), jsx(DialogContent, { sx: { p: 3 }, children: children })] }));
|
|
1689
|
+
};
|
|
1690
|
+
|
|
1691
|
+
const StyledIconButton = styled$1(IconButton)(({ theme }) => ({
|
|
1617
1692
|
width: 48,
|
|
1618
1693
|
height: 48,
|
|
1619
1694
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
@@ -1633,24 +1708,26 @@ const SimpleModal = ({ isOpen, onClose, title, children, }) => {
|
|
|
1633
1708
|
},
|
|
1634
1709
|
}));
|
|
1635
1710
|
const ActionButton = ({ icon: Icon, onClick, label, sx, }) => {
|
|
1636
|
-
return (
|
|
1637
|
-
};
|
|
1711
|
+
return (jsx(StyledIconButton, { onClick: onClick, "aria-label": label, sx: sx, children: jsx(Icon, {}) }));
|
|
1712
|
+
};
|
|
1713
|
+
|
|
1714
|
+
const StyledWrapper = styled$1(Box)(({ theme }) => ({
|
|
1638
1715
|
// No specific wrapper styles needed, just a container
|
|
1639
1716
|
}));
|
|
1640
|
-
const StyledParagraph =
|
|
1717
|
+
const StyledParagraph = styled$1(Typography)(({ theme }) => ({
|
|
1641
1718
|
fontSize: '14px', // text-[14px]
|
|
1642
1719
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
1643
1720
|
display: 'inline-flex',
|
|
1644
1721
|
alignItems: 'center',
|
|
1645
1722
|
}));
|
|
1646
|
-
const StyledTermWrapper =
|
|
1723
|
+
const StyledTermWrapper = styled$1(Box)(({ theme }) => ({
|
|
1647
1724
|
position: 'relative',
|
|
1648
1725
|
display: 'inline-flex',
|
|
1649
1726
|
alignItems: 'center',
|
|
1650
1727
|
cursor: 'pointer',
|
|
1651
1728
|
marginLeft: theme.spacing(0.5), // ml-1
|
|
1652
1729
|
}));
|
|
1653
|
-
const StyledTerm =
|
|
1730
|
+
const StyledTerm = styled$1('span', {
|
|
1654
1731
|
shouldForwardProp: (prop) => prop !== 'isOpen',
|
|
1655
1732
|
})(({ theme, isOpen }) => ({
|
|
1656
1733
|
paddingBottom: '1px', // style={{ paddingBottom: '1px' }}
|
|
@@ -1660,14 +1737,14 @@ const StyledTerm = material.styled('span', {
|
|
|
1660
1737
|
borderBottomColor: theme.palette.secondary.main, // hover effect
|
|
1661
1738
|
},
|
|
1662
1739
|
}));
|
|
1663
|
-
const StyledIconWrapper =
|
|
1740
|
+
const StyledIconWrapper = styled$1(Box)(({ theme }) => ({
|
|
1664
1741
|
display: 'inline-flex',
|
|
1665
1742
|
alignItems: 'center',
|
|
1666
1743
|
justifyContent: 'center',
|
|
1667
1744
|
marginLeft: theme.spacing(0.5), // ml-1
|
|
1668
1745
|
transition: 'color 0.2s', // transition-colors
|
|
1669
1746
|
}));
|
|
1670
|
-
const StyledDefinitionBox =
|
|
1747
|
+
const StyledDefinitionBox = styled$1(Box)(({ theme }) => ({
|
|
1671
1748
|
marginTop: theme.spacing(2), // mt-4
|
|
1672
1749
|
padding: theme.spacing(2), // p-4
|
|
1673
1750
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
@@ -1677,28 +1754,30 @@ const StyledDefinitionBox = material.styled(material.Box)(({ theme }) => ({
|
|
|
1677
1754
|
borderRight: `4px solid ${theme.palette.dark.main}33`, // border-r-4
|
|
1678
1755
|
backgroundColor: theme.palette.light.main, // style={{ backgroundColor: '#FDFCEE' }}
|
|
1679
1756
|
}));
|
|
1680
|
-
const StyledDefinitionText =
|
|
1757
|
+
const StyledDefinitionText = styled$1(Typography)(({ theme }) => ({
|
|
1681
1758
|
fontSize: '14px', // text-[14px]
|
|
1682
1759
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
1683
1760
|
lineHeight: 1.5, // leading-relaxed
|
|
1684
1761
|
}));
|
|
1685
1762
|
function DefinitionBox({ term, definition, children }) {
|
|
1686
1763
|
const { theme } = useTheme();
|
|
1687
|
-
const [isOpen, setIsOpen] =
|
|
1688
|
-
return (
|
|
1764
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
1765
|
+
return (jsxs(StyledWrapper, { children: [jsxs(StyledParagraph, { children: [children, jsxs(StyledTermWrapper, { onClick: () => setIsOpen(!isOpen), children: [jsx(StyledTerm, { isOpen: isOpen, onMouseEnter: (e) => (e.currentTarget.style.borderBottomColor = theme.palette.secondary.main), onMouseLeave: (e) => (e.currentTarget.style.borderBottomColor = isOpen ? theme.palette.secondary.main : theme.palette.dark.main), children: term }), jsx(StyledIconWrapper, { children: isOpen ? (jsx(CloseRounded, { sx: {
|
|
1689
1766
|
fontSize: 16,
|
|
1690
1767
|
color: isOpen ? theme.palette.secondary.main : theme.palette.dark.main,
|
|
1691
1768
|
'&:hover': {
|
|
1692
1769
|
color: theme.palette.secondary.main
|
|
1693
1770
|
}
|
|
1694
|
-
} })) : (
|
|
1771
|
+
} })) : (jsx(AddRounded, { sx: {
|
|
1695
1772
|
fontSize: 16,
|
|
1696
1773
|
color: theme.palette.dark.main,
|
|
1697
1774
|
'&:hover': {
|
|
1698
1775
|
color: theme.palette.secondary.main
|
|
1699
1776
|
}
|
|
1700
|
-
} })) })] })] }), isOpen && (
|
|
1701
|
-
}
|
|
1777
|
+
} })) })] })] }), isOpen && (jsx(StyledDefinitionBox, { children: jsx(StyledDefinitionText, { children: definition }) }))] }));
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
const HomeButton = styled$1(IconButton)(({ theme }) => ({
|
|
1702
1781
|
width: 40,
|
|
1703
1782
|
height: 40,
|
|
1704
1783
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
@@ -1715,7 +1794,7 @@ function DefinitionBox({ term, definition, children }) {
|
|
|
1715
1794
|
opacity: 0.8,
|
|
1716
1795
|
},
|
|
1717
1796
|
}));
|
|
1718
|
-
const DropdownButton =
|
|
1797
|
+
const DropdownButton = styled$1('button')(({ theme }) => ({
|
|
1719
1798
|
display: 'flex',
|
|
1720
1799
|
alignItems: 'center',
|
|
1721
1800
|
gap: theme.spacing(1),
|
|
@@ -1739,7 +1818,7 @@ const DropdownButton = material.styled('button')(({ theme }) => ({
|
|
|
1739
1818
|
gap: theme.spacing(0.5),
|
|
1740
1819
|
},
|
|
1741
1820
|
}));
|
|
1742
|
-
const StyledMenu =
|
|
1821
|
+
const StyledMenu = styled$1(Menu)(({ theme }) => ({
|
|
1743
1822
|
'& .MuiPaper-root': {
|
|
1744
1823
|
marginTop: theme.spacing(1),
|
|
1745
1824
|
width: '256px',
|
|
@@ -1750,7 +1829,7 @@ const StyledMenu = material.styled(material.Menu)(({ theme }) => ({
|
|
|
1750
1829
|
boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
1751
1830
|
},
|
|
1752
1831
|
}));
|
|
1753
|
-
const StyledMenuItem =
|
|
1832
|
+
const StyledMenuItem = styled$1(MenuItem)(({ theme, isActive }) => ({
|
|
1754
1833
|
padding: theme.spacing(1.25, 2),
|
|
1755
1834
|
fontSize: '0.875rem',
|
|
1756
1835
|
color: isActive ? theme.palette.primary.main : '#4D3019',
|
|
@@ -1762,7 +1841,7 @@ const StyledMenuItem = material.styled(material.MenuItem)(({ theme, isActive })
|
|
|
1762
1841
|
}));
|
|
1763
1842
|
const Breadcrumb = ({ items, currentItem, dropdownItems = [], onItemSelect, }) => {
|
|
1764
1843
|
const { theme } = useTheme();
|
|
1765
|
-
const [anchorEl, setAnchorEl] =
|
|
1844
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
1766
1845
|
const isDropdownOpen = Boolean(anchorEl);
|
|
1767
1846
|
const handleDropdownToggle = (event) => {
|
|
1768
1847
|
setAnchorEl(event.currentTarget);
|
|
@@ -1774,35 +1853,38 @@ const Breadcrumb = ({ items, currentItem, dropdownItems = [], onItemSelect, }) =
|
|
|
1774
1853
|
onItemSelect?.(item);
|
|
1775
1854
|
handleClose();
|
|
1776
1855
|
};
|
|
1777
|
-
return (
|
|
1856
|
+
return (jsxs(Box, { component: "nav", sx: {
|
|
1778
1857
|
display: 'flex',
|
|
1779
1858
|
alignItems: 'center',
|
|
1780
1859
|
gap: { xs: 0.5, sm: 1 },
|
|
1781
1860
|
fontSize: { xs: '0.75rem', sm: '0.875rem' },
|
|
1782
1861
|
overflow: 'visible',
|
|
1783
|
-
}, children: [
|
|
1862
|
+
}, children: [jsx(HomeButton, { "aria-label": "Home", children: jsx(HomeRounded, { sx: { fontSize: 20, color: "#4D3019" } }) }), jsx(Breadcrumbs, { separator: "/", sx: {
|
|
1784
1863
|
display: { xs: 'none', md: 'flex' },
|
|
1785
1864
|
'& .MuiBreadcrumbs-separator': {
|
|
1786
1865
|
color: `${theme.palette.dark.main}66`,
|
|
1787
1866
|
},
|
|
1788
|
-
}, children: items.map((item, index) => (
|
|
1867
|
+
}, children: items.map((item, index) => (jsx(Typography, { sx: {
|
|
1789
1868
|
color: theme.palette.dark.main,
|
|
1790
1869
|
fontWeight: 500,
|
|
1791
1870
|
px: { xs: 0.5, sm: 1 },
|
|
1792
1871
|
whiteSpace: 'nowrap',
|
|
1793
1872
|
fontSize: 'inherit',
|
|
1794
|
-
}, children: item.label }, index))) }),
|
|
1873
|
+
}, children: item.label }, index))) }), jsx(Typography, { sx: {
|
|
1795
1874
|
display: { xs: 'none', md: 'inline' },
|
|
1796
1875
|
color: `${theme.palette.dark.main}66`,
|
|
1797
|
-
}, children: "/" }),
|
|
1876
|
+
}, children: "/" }), jsxs(Box, { sx: { position: 'relative', flexShrink: 0 }, children: [jsxs(DropdownButton, { type: "button", onClick: handleDropdownToggle, children: [jsx("span", { children: currentItem }), jsx(ExpandMoreRounded, { sx: {
|
|
1798
1877
|
fontSize: 20,
|
|
1799
1878
|
transition: 'transform 0.2s',
|
|
1800
1879
|
transform: isDropdownOpen ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
1801
|
-
} })] }), dropdownItems.length > 0 && (
|
|
1880
|
+
} })] }), dropdownItems.length > 0 && (jsx(StyledMenu, { anchorEl: anchorEl, open: isDropdownOpen, onClose: handleClose, anchorOrigin: {
|
|
1802
1881
|
vertical: 'bottom',
|
|
1803
1882
|
horizontal: 'left',
|
|
1804
1883
|
}, transformOrigin: {
|
|
1805
1884
|
vertical: 'top',
|
|
1806
1885
|
horizontal: 'left',
|
|
1807
|
-
}, children: dropdownItems.map((item, index) => (
|
|
1808
|
-
};
|
|
1886
|
+
}, children: dropdownItems.map((item, index) => (jsx(StyledMenuItem, { onClick: () => handleItemClick(item), isActive: item === currentItem, children: item }, index))) }))] })] }));
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
export { ActionButton, Alert, Breadcrumb, Button, Card, Checkbox, Concertina, DefinitionBox, Header, Input, Modal, NoteBox, Progress, Radio, RadioGroup, ReadBy, Select, Sidebar, SimpleModal, StatusBar, StepIndicator, TableOfContents, Tabs, ThemeProvider, Toggle, useTheme };
|
|
1890
|
+
//# sourceMappingURL=index.js.map
|