ece-docs-components 1.0.5 → 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/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} +270 -198
- 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 +224 -242
- package/dist/index.js.map +1 -1
- package/package.json +11 -12
- package/dist/index.esm.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,47 +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';
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function _interopNamespaceDefault(e) {
|
|
11
|
-
var n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
Object.keys(e).forEach(function (k) {
|
|
14
|
-
if (k !== 'default') {
|
|
15
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return e[k]; }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
n.default = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
28
|
-
|
|
29
|
-
const baseTheme = styles.createTheme({
|
|
10
|
+
const baseTheme = createTheme({
|
|
11
|
+
palette: {
|
|
12
|
+
text: {
|
|
13
|
+
primary: '#4D3019',
|
|
14
|
+
secondary: '#826E5C',
|
|
15
|
+
}
|
|
16
|
+
},
|
|
30
17
|
typography: {
|
|
31
18
|
fontFamily: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'].join(','),
|
|
19
|
+
allVariants: {
|
|
20
|
+
color: '#4D3019'
|
|
21
|
+
}
|
|
32
22
|
},
|
|
33
23
|
components: {
|
|
24
|
+
MuiTypography: {
|
|
25
|
+
styleOverrides: {
|
|
26
|
+
root: {
|
|
27
|
+
color: '#4D3019',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
34
31
|
MuiCssBaseline: {
|
|
35
|
-
styleOverrides:
|
|
32
|
+
styleOverrides: {
|
|
36
33
|
body: {
|
|
37
34
|
WebkitFontSmoothing: 'antialiased',
|
|
38
35
|
MozOsxFontSmoothing: 'grayscale',
|
|
39
36
|
backgroundColor: '#FDFCEE',
|
|
37
|
+
color: '#4D3019',
|
|
40
38
|
},
|
|
41
39
|
'input[type="checkbox"], input[type="radio"]': {
|
|
42
|
-
accentColor:
|
|
40
|
+
accentColor: '#D79AFC',
|
|
43
41
|
},
|
|
44
|
-
}
|
|
42
|
+
},
|
|
45
43
|
},
|
|
46
44
|
},
|
|
47
45
|
breakpoints: {
|
|
@@ -54,7 +52,6 @@ const baseTheme = styles.createTheme({
|
|
|
54
52
|
},
|
|
55
53
|
},
|
|
56
54
|
});
|
|
57
|
-
// Store only the configuration overrides, not full themes
|
|
58
55
|
const themeConfigs = {
|
|
59
56
|
default: {
|
|
60
57
|
palette: {
|
|
@@ -64,6 +61,10 @@ const themeConfigs = {
|
|
|
64
61
|
dark: { main: '#4D3019' },
|
|
65
62
|
light: { main: '#FEFDF7' },
|
|
66
63
|
markedRead: { main: '#A3D977' },
|
|
64
|
+
text: {
|
|
65
|
+
primary: '#4D3019',
|
|
66
|
+
secondary: '#826E5C',
|
|
67
|
+
},
|
|
67
68
|
custom: {
|
|
68
69
|
iconColor: '#ebc7ff',
|
|
69
70
|
primaryButtonTextColor: '#FFFFFF',
|
|
@@ -83,6 +84,10 @@ const themeConfigs = {
|
|
|
83
84
|
dark: { main: '#4D3019' },
|
|
84
85
|
light: { main: '#FEFDF7' },
|
|
85
86
|
markedRead: { main: '#A3D977' },
|
|
87
|
+
text: {
|
|
88
|
+
primary: '#4D3019',
|
|
89
|
+
secondary: '#826E5C',
|
|
90
|
+
},
|
|
86
91
|
custom: {
|
|
87
92
|
primaryButtonTextColor: '#FFFFFF',
|
|
88
93
|
stepIndicatorTextColor: '#FFFFFF',
|
|
@@ -98,6 +103,10 @@ const themeConfigs = {
|
|
|
98
103
|
dark: { main: '#4D3019' },
|
|
99
104
|
light: { main: '#FEFDF7' },
|
|
100
105
|
markedRead: { main: '#A3D977' },
|
|
106
|
+
text: {
|
|
107
|
+
primary: '#4D3019',
|
|
108
|
+
secondary: '#826E5C',
|
|
109
|
+
},
|
|
101
110
|
custom: {
|
|
102
111
|
iconColor: '#a4d6ff',
|
|
103
112
|
primaryButtonTextColor: '#FFFFFF',
|
|
@@ -110,26 +119,24 @@ const themeConfigs = {
|
|
|
110
119
|
appName: 'GP Docs',
|
|
111
120
|
},
|
|
112
121
|
};
|
|
113
|
-
// Create themes on-demand using useMemo
|
|
114
122
|
const createMuiTheme = (key) => {
|
|
115
|
-
return
|
|
123
|
+
return createTheme(deepmerge(baseTheme, themeConfigs[key]));
|
|
116
124
|
};
|
|
117
|
-
const ThemeContext =
|
|
125
|
+
const ThemeContext = React.createContext(undefined);
|
|
118
126
|
const ThemeProvider = ({ children }) => {
|
|
119
|
-
const [currentTheme, setCurrentTheme] =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
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 }) }));
|
|
123
130
|
};
|
|
124
131
|
const useTheme = () => {
|
|
125
|
-
const context =
|
|
132
|
+
const context = React.useContext(ThemeContext);
|
|
126
133
|
if (context === undefined) {
|
|
127
134
|
throw new Error('useTheme must be used within a ThemeProvider');
|
|
128
135
|
}
|
|
129
136
|
return context;
|
|
130
137
|
};
|
|
131
138
|
|
|
132
|
-
const StyledButton =
|
|
139
|
+
const StyledButton = styled(Button$1, {
|
|
133
140
|
shouldForwardProp: (prop) => prop !== 'customVariant' && prop !== 'customSize',
|
|
134
141
|
})(({ theme, customVariant, customSize }) => {
|
|
135
142
|
const currentTheme = theme.palette;
|
|
@@ -227,13 +234,13 @@ const StyledButton = styles.styled(material.Button, {
|
|
|
227
234
|
};
|
|
228
235
|
});
|
|
229
236
|
const Button = ({ variant = 'primary', size = 'md', children, fullWidth = false, ...props }) => {
|
|
230
|
-
return (
|
|
237
|
+
return (jsx(StyledButton, { customVariant: variant, customSize: size, fullWidth: fullWidth, disableRipple: true, ...props, children: children }));
|
|
231
238
|
};
|
|
232
239
|
|
|
233
|
-
const InputWrapper =
|
|
240
|
+
const InputWrapper = styled$1('div')(({ theme }) => ({
|
|
234
241
|
width: '100%',
|
|
235
242
|
}));
|
|
236
|
-
const StyledLabel$1 =
|
|
243
|
+
const StyledLabel$1 = styled$1(InputLabel)(({ theme }) => ({
|
|
237
244
|
fontSize: '0.875rem',
|
|
238
245
|
fontWeight: 500,
|
|
239
246
|
color: theme.palette.dark.main,
|
|
@@ -245,7 +252,7 @@ const StyledLabel$1 = material.styled(material.InputLabel)(({ theme }) => ({
|
|
|
245
252
|
color: theme.palette.dark.main,
|
|
246
253
|
},
|
|
247
254
|
}));
|
|
248
|
-
const StyledTextField$1 =
|
|
255
|
+
const StyledTextField$1 = styled$1(TextField, {
|
|
249
256
|
shouldForwardProp: (prop) => !['errorMessage'].includes(prop),
|
|
250
257
|
})(({ theme, errorMessage }) => ({
|
|
251
258
|
width: '100%',
|
|
@@ -296,10 +303,10 @@ const StyledTextField$1 = material.styled(material.TextField, {
|
|
|
296
303
|
}));
|
|
297
304
|
const Input = ({ error, fullWidth = false, id, label, ...props }) => {
|
|
298
305
|
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
299
|
-
return (
|
|
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 })] }));
|
|
300
307
|
};
|
|
301
308
|
|
|
302
|
-
const StyledCard =
|
|
309
|
+
const StyledCard = styled$1(Box, {
|
|
303
310
|
shouldForwardProp: (prop) => prop !== 'customPadding' && prop !== 'customVariant',
|
|
304
311
|
})(({ theme, customPadding, customVariant }) => {
|
|
305
312
|
const paddingStyles = {
|
|
@@ -333,10 +340,10 @@ const StyledCard = material.styled(material.Box, {
|
|
|
333
340
|
});
|
|
334
341
|
const Card = ({ children, className = '', padding = 'md', variant = 'default', sx, // Destructure sx prop
|
|
335
342
|
}) => {
|
|
336
|
-
return (
|
|
343
|
+
return (jsx(StyledCard, { className: className, customPadding: padding, customVariant: variant, sx: sx, children: children }));
|
|
337
344
|
};
|
|
338
345
|
|
|
339
|
-
const StyledSelect =
|
|
346
|
+
const StyledSelect = styled$1(Select$1)(({ theme, error }) => ({
|
|
340
347
|
backgroundColor: theme.palette.light.main,
|
|
341
348
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
342
349
|
? parseInt(theme.shape.borderRadius, 10)
|
|
@@ -364,7 +371,7 @@ const StyledSelect = material.styled(material.Select)(({ theme, error }) => ({
|
|
|
364
371
|
color: `${theme.palette.dark.main}66`,
|
|
365
372
|
},
|
|
366
373
|
}));
|
|
367
|
-
const StyledInputLabel =
|
|
374
|
+
const StyledInputLabel = styled$1(InputLabel)(({ theme }) => ({
|
|
368
375
|
fontSize: '0.875rem',
|
|
369
376
|
fontWeight: 500,
|
|
370
377
|
color: theme.palette.dark.main,
|
|
@@ -391,7 +398,7 @@ const Select = ({ label, error, helperText, fullWidth = false, options, classNam
|
|
|
391
398
|
onChange(syntheticEvent);
|
|
392
399
|
}
|
|
393
400
|
};
|
|
394
|
-
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: {
|
|
395
402
|
PaperProps: {
|
|
396
403
|
sx: {
|
|
397
404
|
mt: 1,
|
|
@@ -399,7 +406,7 @@ const Select = ({ label, error, helperText, fullWidth = false, options, classNam
|
|
|
399
406
|
boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
400
407
|
},
|
|
401
408
|
},
|
|
402
|
-
}, children: options.map((option) => (
|
|
409
|
+
}, children: options.map((option) => (jsx(MenuItem, { value: option.value, sx: {
|
|
403
410
|
fontSize: '1rem',
|
|
404
411
|
color: theme.palette.dark.main,
|
|
405
412
|
'&:hover': {
|
|
@@ -411,18 +418,18 @@ const Select = ({ label, error, helperText, fullWidth = false, options, classNam
|
|
|
411
418
|
backgroundColor: `${theme.palette.primary.main}33`,
|
|
412
419
|
},
|
|
413
420
|
},
|
|
414
|
-
}, children: option.label }, option.value))) }), error && (
|
|
421
|
+
}, children: option.label }, option.value))) }), error && (jsx(FormHelperText, { sx: {
|
|
415
422
|
mt: 0.75,
|
|
416
423
|
fontSize: '0.875rem',
|
|
417
424
|
color: theme.palette.accent.main,
|
|
418
|
-
}, children: error })), helperText && !error && (
|
|
425
|
+
}, children: error })), helperText && !error && (jsx(FormHelperText, { sx: {
|
|
419
426
|
mt: 0.75,
|
|
420
427
|
fontSize: '0.875rem',
|
|
421
428
|
color: `${theme.palette.dark.main}99`,
|
|
422
429
|
}, children: helperText }))] }));
|
|
423
430
|
};
|
|
424
431
|
|
|
425
|
-
const CustomRadioIcon =
|
|
432
|
+
const CustomRadioIcon = styled$1('span')(({ theme, checked }) => ({
|
|
426
433
|
width: 20,
|
|
427
434
|
height: 20,
|
|
428
435
|
borderRadius: '50%',
|
|
@@ -436,7 +443,7 @@ const CustomRadioIcon = material.styled('span')(({ theme, checked }) => ({
|
|
|
436
443
|
const Radio = ({ label, description, className = '', id, checked, ...props }) => {
|
|
437
444
|
const radioId = id || `radio-${Math.random().toString(36).substr(2, 9)}`;
|
|
438
445
|
const { theme } = useTheme();
|
|
439
|
-
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) => {
|
|
440
447
|
const input = document.getElementById(radioId);
|
|
441
448
|
if (input && !props.disabled) {
|
|
442
449
|
input.click();
|
|
@@ -444,13 +451,13 @@ const Radio = ({ label, description, className = '', id, checked, ...props }) =>
|
|
|
444
451
|
}, sx: {
|
|
445
452
|
cursor: props.disabled ? 'not-allowed' : 'pointer',
|
|
446
453
|
opacity: props.disabled ? 0.5 : 1,
|
|
447
|
-
} })] }), label:
|
|
454
|
+
} })] }), label: jsxs(Box, { sx: { ml: 0 }, children: [jsx(Typography, { component: "label", htmlFor: radioId, sx: {
|
|
448
455
|
fontSize: '1rem',
|
|
449
456
|
fontWeight: 500,
|
|
450
457
|
color: theme.palette.dark.main,
|
|
451
458
|
cursor: props.disabled ? 'not-allowed' : 'pointer',
|
|
452
459
|
opacity: props.disabled ? 0.5 : 1,
|
|
453
|
-
}, children: label }), description && (
|
|
460
|
+
}, children: label }), description && (jsx(Typography, { variant: "body2", sx: {
|
|
454
461
|
fontSize: '0.875rem',
|
|
455
462
|
color: `${theme.palette.dark.main}99`,
|
|
456
463
|
mt: 0.25,
|
|
@@ -458,7 +465,7 @@ const Radio = ({ label, description, className = '', id, checked, ...props }) =>
|
|
|
458
465
|
};
|
|
459
466
|
const RadioGroup = ({ label, error, children, className = '' }) => {
|
|
460
467
|
const { theme } = useTheme();
|
|
461
|
-
return (
|
|
468
|
+
return (jsxs(FormControl, { component: "fieldset", className: className, error: !!error, fullWidth: true, children: [label && (jsx(FormLabel, { component: "legend", sx: {
|
|
462
469
|
fontSize: '0.875rem',
|
|
463
470
|
fontWeight: 500,
|
|
464
471
|
color: theme.palette.dark.main,
|
|
@@ -466,18 +473,18 @@ const RadioGroup = ({ label, error, children, className = '' }) => {
|
|
|
466
473
|
'&.Mui-focused': {
|
|
467
474
|
color: theme.palette.dark.main,
|
|
468
475
|
},
|
|
469
|
-
}, children: label })),
|
|
476
|
+
}, children: label })), jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1.5 }, children: children }), error && (jsx(FormHelperText, { sx: {
|
|
470
477
|
mt: 1,
|
|
471
478
|
fontSize: '0.875rem',
|
|
472
479
|
color: theme.palette.accent.main,
|
|
473
480
|
}, children: error }))] }));
|
|
474
481
|
};
|
|
475
482
|
|
|
476
|
-
const StyledWrapper$1 =
|
|
483
|
+
const StyledWrapper$1 = styled$1(Box)(({ theme }) => ({
|
|
477
484
|
display: 'flex',
|
|
478
485
|
alignItems: 'flex-start',
|
|
479
486
|
}));
|
|
480
|
-
const StyledCheckbox =
|
|
487
|
+
const StyledCheckbox = styled$1(Checkbox$1)(({ theme }) => ({
|
|
481
488
|
width: 16, // Matches Tailwind's w-4 (16px)
|
|
482
489
|
height: 16, // Matches Tailwind's h-4 (16px)
|
|
483
490
|
color: theme.palette.dark.main + '33', // dark.main with 20% opacity (border-dark/20)
|
|
@@ -491,23 +498,23 @@ const StyledCheckbox = material.styled(material.Checkbox)(({ theme }) => ({
|
|
|
491
498
|
borderRadius: theme.shape.borderRadius, // Matches rounded
|
|
492
499
|
cursor: 'pointer',
|
|
493
500
|
}));
|
|
494
|
-
const StyledLabel =
|
|
501
|
+
const StyledLabel = styled$1(Typography)(({ theme }) => ({
|
|
495
502
|
fontSize: '1rem', // text-base (16px)
|
|
496
503
|
fontWeight: 500, // font-medium
|
|
497
504
|
color: theme.palette.dark.main, // text-dark
|
|
498
505
|
cursor: 'pointer',
|
|
499
506
|
}));
|
|
500
|
-
const StyledDescription =
|
|
507
|
+
const StyledDescription = styled$1(Typography)(({ theme }) => ({
|
|
501
508
|
fontSize: '0.875rem', // text-sm (14px)
|
|
502
509
|
color: theme.palette.dark.main + '99', // dark.main with 60% opacity (text-dark/60)
|
|
503
510
|
marginTop: theme.spacing(0.5), // mt-0.5
|
|
504
511
|
}));
|
|
505
512
|
const Checkbox = ({ label, description, className = '', id, ...props }) => {
|
|
506
513
|
const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
507
|
-
return (
|
|
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 })] }) }) }));
|
|
508
515
|
};
|
|
509
516
|
|
|
510
|
-
const StyledLinearProgress =
|
|
517
|
+
const StyledLinearProgress = styled$1(LinearProgress)(({ theme }) => ({
|
|
511
518
|
height: 10,
|
|
512
519
|
borderRadius: 9999,
|
|
513
520
|
backgroundColor: `${theme.palette.dark.main}1A`,
|
|
@@ -519,9 +526,9 @@ const StyledLinearProgress = material.styled(material.LinearProgress)(({ theme }
|
|
|
519
526
|
}));
|
|
520
527
|
const Progress = ({ current, total, showLabel = true, className = '' }) => {
|
|
521
528
|
const percentage = Math.min(Math.max((current / total) * 100, 0), 100);
|
|
522
|
-
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 })] }));
|
|
523
530
|
};
|
|
524
|
-
const StepNumber =
|
|
531
|
+
const StepNumber = styled$1(Box)(({ theme, isActive, isCompleted }) => ({
|
|
525
532
|
width: 40,
|
|
526
533
|
height: 40,
|
|
527
534
|
borderRadius: '50%',
|
|
@@ -544,7 +551,7 @@ const StepNumber = material.styled(material.Box)(({ theme, isActive, isCompleted
|
|
|
544
551
|
fontSize: '0.75rem',
|
|
545
552
|
},
|
|
546
553
|
}));
|
|
547
|
-
const StepLine =
|
|
554
|
+
const StepLine = styled$1(Box)(({ theme, isCompleted }) => ({
|
|
548
555
|
flex: 1,
|
|
549
556
|
height: 4,
|
|
550
557
|
borderRadius: 2,
|
|
@@ -559,7 +566,7 @@ const StepLine = material.styled(material.Box)(({ theme, isCompleted }) => ({
|
|
|
559
566
|
}));
|
|
560
567
|
const StepIndicator = ({ steps, currentStep, className = '' }) => {
|
|
561
568
|
const { theme } = useTheme();
|
|
562
|
-
return (
|
|
569
|
+
return (jsx(Box, { className: className, sx: {
|
|
563
570
|
display: 'flex',
|
|
564
571
|
alignItems: 'center',
|
|
565
572
|
justifyContent: 'space-between',
|
|
@@ -569,17 +576,17 @@ const StepIndicator = ({ steps, currentStep, className = '' }) => {
|
|
|
569
576
|
const stepNumber = index + 1;
|
|
570
577
|
const isActive = stepNumber === currentStep;
|
|
571
578
|
const isCompleted = stepNumber < currentStep;
|
|
572
|
-
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: {
|
|
573
580
|
mt: { xs: 0.5, sm: 1 },
|
|
574
581
|
fontSize: { xs: '10px', sm: '12px' },
|
|
575
582
|
fontWeight: 500,
|
|
576
583
|
whiteSpace: 'nowrap',
|
|
577
584
|
color: isActive ? theme.palette.primary.main : `${theme.palette.dark.main}99`,
|
|
578
|
-
}, children: step })] }), index < steps.length - 1 && (
|
|
585
|
+
}, children: step })] }), index < steps.length - 1 && (jsx(StepLine, { isCompleted: isCompleted }))] }, index));
|
|
579
586
|
}) }));
|
|
580
587
|
};
|
|
581
588
|
|
|
582
|
-
const StyledAlert =
|
|
589
|
+
const StyledAlert = styled$1(Alert$1)(({ theme, customvariant }) => {
|
|
583
590
|
const variants = {
|
|
584
591
|
info: {
|
|
585
592
|
backgroundColor: '#eff6ff',
|
|
@@ -633,11 +640,11 @@ const StyledAlert = material.styled(material.Alert)(({ theme, customvariant }) =
|
|
|
633
640
|
});
|
|
634
641
|
const Alert = ({ variant = 'info', children, className = '', icon = true, sx, }) => {
|
|
635
642
|
const iconMap = {
|
|
636
|
-
info:
|
|
637
|
-
success:
|
|
638
|
-
warning:
|
|
639
|
-
error:
|
|
640
|
-
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 } }),
|
|
641
648
|
};
|
|
642
649
|
const severityMap = {
|
|
643
650
|
info: 'info',
|
|
@@ -646,14 +653,14 @@ const Alert = ({ variant = 'info', children, className = '', icon = true, sx, })
|
|
|
646
653
|
error: 'error',
|
|
647
654
|
custom: 'info',
|
|
648
655
|
};
|
|
649
|
-
return (
|
|
656
|
+
return (jsx(StyledAlert, { customvariant: variant, severity: severityMap[variant], icon: icon ? iconMap[variant] : false, className: className, sx: sx, children: children }));
|
|
650
657
|
};
|
|
651
658
|
|
|
652
|
-
const NoteContainer =
|
|
659
|
+
const NoteContainer = styled$1(Box)({
|
|
653
660
|
position: 'relative',
|
|
654
661
|
maxWidth: '100%',
|
|
655
662
|
});
|
|
656
|
-
const EditButton =
|
|
663
|
+
const EditButton = styled$1(IconButton)(({ theme }) => ({
|
|
657
664
|
position: 'absolute',
|
|
658
665
|
right: -4,
|
|
659
666
|
top: '50%',
|
|
@@ -669,7 +676,7 @@ const EditButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
669
676
|
transform: 'translateY(-50%) scale(1.1)',
|
|
670
677
|
},
|
|
671
678
|
}));
|
|
672
|
-
const HighlightWrapper =
|
|
679
|
+
const HighlightWrapper = styled$1(Box)(({ isHovered, highlightColor, highlightSelectedColor, isCustom }) => ({
|
|
673
680
|
position: 'relative',
|
|
674
681
|
display: 'inline-block',
|
|
675
682
|
maxWidth: '100%',
|
|
@@ -691,7 +698,7 @@ const HighlightWrapper = material.styled(material.Box)(({ isHovered, highlightCo
|
|
|
691
698
|
},
|
|
692
699
|
}));
|
|
693
700
|
const NoteBox = ({ variant = 'default', label, children, className = '', onEditClick, }) => {
|
|
694
|
-
const [isHovered, setIsHovered] =
|
|
701
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
695
702
|
const variants = {
|
|
696
703
|
default: {
|
|
697
704
|
highlight: '#FFEACD',
|
|
@@ -738,19 +745,19 @@ const NoteBox = ({ variant = 'default', label, children, className = '', onEditC
|
|
|
738
745
|
};
|
|
739
746
|
const style = variants[variant];
|
|
740
747
|
const displayLabel = label || style.label;
|
|
741
|
-
return (
|
|
748
|
+
return (jsxs(NoteContainer, { className: className, children: [displayLabel && (jsx(Box, { sx: { mb: 1 }, children: jsx(Typography, { component: "span", sx: {
|
|
742
749
|
fontSize: '13px',
|
|
743
750
|
fontWeight: 500,
|
|
744
751
|
color: style.labelColor || 'rgba(0, 0, 0, 0.6)',
|
|
745
|
-
}, 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) => {
|
|
746
753
|
e.stopPropagation();
|
|
747
754
|
if (onEditClick) {
|
|
748
755
|
onEditClick();
|
|
749
756
|
}
|
|
750
|
-
}, title: "Edit variable highlight", size: "small", children:
|
|
757
|
+
}, title: "Edit variable highlight", size: "small", children: jsx(EditRounded, { sx: { fontSize: 14, color: "#FFFFFF", strokeWidth: 2 } }) })] })] }));
|
|
751
758
|
};
|
|
752
759
|
|
|
753
|
-
const StyledDialog$1 =
|
|
760
|
+
const StyledDialog$1 = styled$1(Dialog)(({ theme }) => ({
|
|
754
761
|
'& .MuiDialog-paper': {
|
|
755
762
|
borderRadius: theme.shape.borderRadius,
|
|
756
763
|
maxWidth: '896px',
|
|
@@ -758,7 +765,7 @@ const StyledDialog$1 = material.styled(material.Dialog)(({ theme }) => ({
|
|
|
758
765
|
maxHeight: '90vh',
|
|
759
766
|
},
|
|
760
767
|
}));
|
|
761
|
-
const NavButton =
|
|
768
|
+
const NavButton = styled$1(IconButton)(({ theme }) => ({
|
|
762
769
|
width: '40px',
|
|
763
770
|
height: '40px',
|
|
764
771
|
border: `2px solid ${theme.palette.dark.main}`,
|
|
@@ -769,8 +776,8 @@ const NavButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
769
776
|
},
|
|
770
777
|
}));
|
|
771
778
|
const Modal = ({ isOpen, onClose, status, description, defaultText, note, acceptSuggestion: initialAcceptSuggestion = true, onAcceptSuggestionChange, onSave, onSubmit, onDeclineWording, onPrevious, onNext, currentPage = 1, totalPages = 1, }) => {
|
|
772
|
-
const [textValue, setTextValue] =
|
|
773
|
-
const [acceptSuggestion, setAcceptSuggestion] =
|
|
779
|
+
const [textValue, setTextValue] = useState(defaultText);
|
|
780
|
+
const [acceptSuggestion, setAcceptSuggestion] = useState(initialAcceptSuggestion);
|
|
774
781
|
const statusConfig = {
|
|
775
782
|
mandatory: {
|
|
776
783
|
color: '#F5A623',
|
|
@@ -798,12 +805,12 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
798
805
|
},
|
|
799
806
|
};
|
|
800
807
|
const statusStyle = statusConfig[status];
|
|
801
|
-
return (
|
|
808
|
+
return (jsxs(StyledDialog$1, { open: isOpen, onClose: onClose, maxWidth: "md", fullWidth: true, children: [jsx(IconButton, { onClick: onClose, sx: {
|
|
802
809
|
position: 'absolute',
|
|
803
810
|
top: 16,
|
|
804
811
|
right: 16,
|
|
805
812
|
zIndex: 1,
|
|
806
|
-
}, 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: {
|
|
807
814
|
backgroundColor: statusStyle.color,
|
|
808
815
|
color: status === 'optional' ? '#4D3019' : '#fff',
|
|
809
816
|
fontWeight: 600,
|
|
@@ -811,7 +818,7 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
811
818
|
height: 'auto',
|
|
812
819
|
py: 1,
|
|
813
820
|
px: 2,
|
|
814
|
-
} }) }),
|
|
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: {
|
|
815
822
|
mb: 2,
|
|
816
823
|
backgroundColor: '#FFE6E6',
|
|
817
824
|
borderLeft: '4px solid #F56B6B',
|
|
@@ -821,7 +828,7 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
821
828
|
'& .MuiAlert-message': {
|
|
822
829
|
color: '#4D3019',
|
|
823
830
|
},
|
|
824
|
-
}, 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: {
|
|
825
832
|
mb: 2,
|
|
826
833
|
backgroundColor: '#FFF9E6',
|
|
827
834
|
borderLeft: '4px solid #F5D76E',
|
|
@@ -831,12 +838,12 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
831
838
|
'& .MuiAlert-message': {
|
|
832
839
|
color: '#4D3019',
|
|
833
840
|
},
|
|
834
|
-
}, children: note })),
|
|
841
|
+
}, children: note })), jsx(TextField, { multiline: true, rows: 4, fullWidth: true, value: textValue, onChange: (e) => setTextValue(e.target.value), disabled: acceptSuggestion, sx: {
|
|
835
842
|
mb: 2,
|
|
836
843
|
'& .MuiOutlinedInput-root': {
|
|
837
844
|
backgroundColor: acceptSuggestion ? 'rgba(0, 0, 0, 0.05)' : '#fff',
|
|
838
845
|
},
|
|
839
|
-
} }),
|
|
846
|
+
} }), jsxs(Box, { sx: {
|
|
840
847
|
display: 'flex',
|
|
841
848
|
flexDirection: { xs: 'column', sm: 'row' },
|
|
842
849
|
alignItems: { xs: 'stretch', sm: 'center' },
|
|
@@ -845,28 +852,28 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
|
|
|
845
852
|
pt: 3,
|
|
846
853
|
borderTop: '1px solid',
|
|
847
854
|
borderColor: 'divider',
|
|
848
|
-
}, 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: {
|
|
849
856
|
display: 'flex',
|
|
850
857
|
alignItems: 'center',
|
|
851
858
|
gap: 2,
|
|
852
859
|
justifyContent: { xs: 'space-between', sm: 'flex-end' },
|
|
853
|
-
}, children: [
|
|
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] })] })] })] })] }));
|
|
854
861
|
};
|
|
855
862
|
|
|
856
|
-
const StyledConcertina =
|
|
863
|
+
const StyledConcertina = styled$1(Box)(({ theme }) => ({
|
|
857
864
|
width: '100%',
|
|
858
865
|
display: 'flex',
|
|
859
866
|
flexDirection: 'column',
|
|
860
867
|
gap: theme.spacing(1), // space-y-2
|
|
861
868
|
}));
|
|
862
|
-
const StyledSection =
|
|
869
|
+
const StyledSection = styled$1(Box)(({ theme }) => ({
|
|
863
870
|
border: `1px solid ${theme.palette.grey[200]}`, // border-gray-200
|
|
864
871
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
865
872
|
? parseInt(theme.shape.borderRadius, 10)
|
|
866
873
|
: theme.shape.borderRadius || 4) * 2, // rounded-lg
|
|
867
874
|
overflow: 'hidden',
|
|
868
875
|
}));
|
|
869
|
-
const StyledHeader$1 =
|
|
876
|
+
const StyledHeader$1 = styled$1(Box)(({ theme }) => ({
|
|
870
877
|
display: 'flex',
|
|
871
878
|
alignItems: 'center',
|
|
872
879
|
justifyContent: 'space-between',
|
|
@@ -884,7 +891,7 @@ const StyledHeader$1 = material.styled(material.Box)(({ theme }) => ({
|
|
|
884
891
|
padding: theme.spacing(6),
|
|
885
892
|
},
|
|
886
893
|
}));
|
|
887
|
-
const StyledTitleWrapper =
|
|
894
|
+
const StyledTitleWrapper = styled$1(Box)(({ theme }) => ({
|
|
888
895
|
display: 'flex',
|
|
889
896
|
alignItems: 'center',
|
|
890
897
|
gap: theme.spacing(3), // sm:gap-3
|
|
@@ -894,7 +901,7 @@ const StyledTitleWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
|
894
901
|
gap: theme.spacing(2), // gap-2
|
|
895
902
|
},
|
|
896
903
|
}));
|
|
897
|
-
const StyledTitle =
|
|
904
|
+
const StyledTitle = styled$1(Typography, {
|
|
898
905
|
shouldForwardProp: (prop) => prop !== 'isHovered',
|
|
899
906
|
})(({ theme, isHovered }) => ({
|
|
900
907
|
fontWeight: 700, // font-bold
|
|
@@ -923,14 +930,14 @@ const StyledTitle = material.styled(material.Typography, {
|
|
|
923
930
|
fontSize: '1rem', // sm:text-lg
|
|
924
931
|
},
|
|
925
932
|
}));
|
|
926
|
-
const StyledLinkButton =
|
|
933
|
+
const StyledLinkButton = styled$1(IconButton)(({ theme }) => ({
|
|
927
934
|
color: theme.palette.accent.main, // text-orange-500
|
|
928
935
|
'&:hover': {
|
|
929
936
|
color: theme.palette.accent.dark || theme.palette.accent.main, // hover:text-orange-600
|
|
930
937
|
},
|
|
931
938
|
padding: 0,
|
|
932
939
|
}));
|
|
933
|
-
const StyledTooltip =
|
|
940
|
+
const StyledTooltip = styled$1(Box)(({ theme }) => ({
|
|
934
941
|
position: 'absolute',
|
|
935
942
|
top: -40, // -top-10
|
|
936
943
|
left: '50%',
|
|
@@ -947,7 +954,7 @@ const StyledTooltip = material.styled(material.Box)(({ theme }) => ({
|
|
|
947
954
|
padding: theme.spacing(1.5, 3), // sm:px-3 sm:py-1.5
|
|
948
955
|
},
|
|
949
956
|
}));
|
|
950
|
-
const StyledChevron =
|
|
957
|
+
const StyledChevron = styled$1(ExpandMoreRounded)(({ theme }) => ({
|
|
951
958
|
color: theme.palette.grey[500], // text-gray-500
|
|
952
959
|
transition: 'transform 0.2s', // transition-transform duration-200
|
|
953
960
|
width: 24, // sm:w-6
|
|
@@ -957,7 +964,7 @@ const StyledChevron = material.styled(iconsMaterial.ExpandMoreRounded)(({ theme
|
|
|
957
964
|
height: 20,
|
|
958
965
|
},
|
|
959
966
|
}));
|
|
960
|
-
const StyledContent =
|
|
967
|
+
const StyledContent = styled$1(Box)(({ theme }) => ({
|
|
961
968
|
padding: theme.spacing(2, 3, 3), // px-3 pb-3 pt-2
|
|
962
969
|
[theme.breakpoints.up('sm')]: {
|
|
963
970
|
padding: theme.spacing(2, 4, 4), // sm:px-4 sm:pb-4
|
|
@@ -966,16 +973,16 @@ const StyledContent = material.styled(material.Box)(({ theme }) => ({
|
|
|
966
973
|
padding: theme.spacing(2, 6, 6), // md:px-6 md:pb-6
|
|
967
974
|
},
|
|
968
975
|
}));
|
|
969
|
-
const StyledContentText =
|
|
976
|
+
const StyledContentText = styled$1(Typography)(({ theme }) => ({
|
|
970
977
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
971
978
|
lineHeight: 1.5, // leading-relaxed
|
|
972
979
|
wordBreak: 'break-word', // break-words
|
|
973
980
|
fontSize: 13, // style={{ fontSize: '13px' }}
|
|
974
981
|
}));
|
|
975
982
|
function Concertina({ sections }) {
|
|
976
|
-
const [openSections, setOpenSections] =
|
|
977
|
-
const [hoveredTitle, setHoveredTitle] =
|
|
978
|
-
const [copiedId, setCopiedId] =
|
|
983
|
+
const [openSections, setOpenSections] = useState(new Set());
|
|
984
|
+
const [hoveredTitle, setHoveredTitle] = useState(null);
|
|
985
|
+
const [copiedId, setCopiedId] = useState(null);
|
|
979
986
|
const toggleSection = (id) => {
|
|
980
987
|
const newOpenSections = new Set(openSections);
|
|
981
988
|
if (newOpenSections.has(id)) {
|
|
@@ -993,10 +1000,10 @@ function Concertina({ sections }) {
|
|
|
993
1000
|
setCopiedId(id);
|
|
994
1001
|
setTimeout(() => setCopiedId(null), 2000);
|
|
995
1002
|
};
|
|
996
|
-
return (
|
|
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))) }));
|
|
997
1004
|
}
|
|
998
1005
|
|
|
999
|
-
const ReadByContainer =
|
|
1006
|
+
const ReadByContainer = styled$1(Box)(({ theme }) => ({
|
|
1000
1007
|
display: 'flex',
|
|
1001
1008
|
flexDirection: 'row',
|
|
1002
1009
|
alignItems: 'flex-start',
|
|
@@ -1010,7 +1017,7 @@ const ReadByContainer = material.styled(material.Box)(({ theme }) => ({
|
|
|
1010
1017
|
padding: theme.spacing(1.5),
|
|
1011
1018
|
},
|
|
1012
1019
|
}));
|
|
1013
|
-
const ExpandButton =
|
|
1020
|
+
const ExpandButton = styled$1(IconButton)(({ theme }) => ({
|
|
1014
1021
|
width: 32,
|
|
1015
1022
|
height: 32,
|
|
1016
1023
|
backgroundColor: '#4d3019',
|
|
@@ -1026,24 +1033,24 @@ const ExpandButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
1026
1033
|
}));
|
|
1027
1034
|
const ReadBy = ({ names }) => {
|
|
1028
1035
|
const { theme } = useTheme();
|
|
1029
|
-
const [isExpanded, setIsExpanded] =
|
|
1036
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
1030
1037
|
const displayText = isExpanded
|
|
1031
1038
|
? names.join(', ')
|
|
1032
1039
|
: names.length > 5
|
|
1033
1040
|
? `${names.slice(0, 5).join(', ')}...`
|
|
1034
1041
|
: names.join(', ');
|
|
1035
|
-
return (
|
|
1042
|
+
return (jsxs(ReadByContainer, { children: [jsxs(Box, { sx: { flex: 1, minWidth: 0, wordBreak: 'break-word' }, children: [jsx(Typography, { component: "span", sx: {
|
|
1036
1043
|
fontSize: { xs: '13px', sm: '14px' },
|
|
1037
1044
|
fontWeight: 700,
|
|
1038
1045
|
color: theme.palette.dark.main,
|
|
1039
|
-
}, children: "Read by:" }),
|
|
1046
|
+
}, children: "Read by:" }), jsx(Typography, { component: "span", sx: {
|
|
1040
1047
|
fontSize: { xs: '13px', sm: '14px' },
|
|
1041
1048
|
color: theme.palette.dark.main,
|
|
1042
1049
|
ml: 1,
|
|
1043
|
-
}, children: displayText })] }), names.length > 5 && (
|
|
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 } })) }))] }));
|
|
1044
1051
|
};
|
|
1045
1052
|
|
|
1046
|
-
const StatusBarContainer =
|
|
1053
|
+
const StatusBarContainer = styled$1(Box)(({ theme }) => ({
|
|
1047
1054
|
width: '100%',
|
|
1048
1055
|
backgroundColor: '#F5C98E',
|
|
1049
1056
|
padding: theme.spacing(1.5, 3),
|
|
@@ -1057,7 +1064,7 @@ const StatusBarContainer = material.styled(material.Box)(({ theme }) => ({
|
|
|
1057
1064
|
padding: theme.spacing(1.25, 2),
|
|
1058
1065
|
},
|
|
1059
1066
|
}));
|
|
1060
|
-
const ContentWrapper =
|
|
1067
|
+
const ContentWrapper = styled$1(Box)(({ theme }) => ({
|
|
1061
1068
|
display: 'flex',
|
|
1062
1069
|
alignItems: 'center',
|
|
1063
1070
|
gap: theme.spacing(1.5),
|
|
@@ -1069,7 +1076,7 @@ const ContentWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
|
1069
1076
|
gap: theme.spacing(1),
|
|
1070
1077
|
},
|
|
1071
1078
|
}));
|
|
1072
|
-
const NextButton =
|
|
1079
|
+
const NextButton = styled$1(IconButton)(({ theme }) => ({
|
|
1073
1080
|
width: 40,
|
|
1074
1081
|
height: 40,
|
|
1075
1082
|
border: `2px solid rgba(77, 48, 25, 0.25)`,
|
|
@@ -1085,30 +1092,30 @@ const NextButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
1085
1092
|
}));
|
|
1086
1093
|
const StatusBar = ({ itemCount, variant = 'actionstarted', onTailorClick, onNextClick }) => {
|
|
1087
1094
|
const message = `There are ${itemCount} items that need attention.`;
|
|
1088
|
-
return (
|
|
1095
|
+
return (jsxs(StatusBarContainer, { children: [jsxs(ContentWrapper, { children: [jsx(PieChartRounded, { sx: {
|
|
1089
1096
|
fontSize: 24,
|
|
1090
1097
|
color: "#4D3019",
|
|
1091
1098
|
flexShrink: 0,
|
|
1092
|
-
} }),
|
|
1099
|
+
} }), jsx(Typography, { sx: {
|
|
1093
1100
|
fontSize: { xs: '14px', sm: '15px', md: '16px' },
|
|
1094
1101
|
color: '#4D3019',
|
|
1095
1102
|
wordBreak: 'break-word',
|
|
1096
1103
|
textAlign: { xs: 'center', sm: 'left' },
|
|
1097
|
-
}, children: variant === 'actionstarted' ? (
|
|
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" }) }))] }));
|
|
1098
1105
|
};
|
|
1099
1106
|
|
|
1100
|
-
const TabsContainer =
|
|
1107
|
+
const TabsContainer = styled$1(Box)({
|
|
1101
1108
|
display: 'none',
|
|
1102
1109
|
'@media (min-width: 900px)': {
|
|
1103
1110
|
display: 'block',
|
|
1104
1111
|
},
|
|
1105
1112
|
});
|
|
1106
|
-
const TabButtonsWrapper =
|
|
1113
|
+
const TabButtonsWrapper = styled$1(Box)({
|
|
1107
1114
|
display: 'flex',
|
|
1108
1115
|
gap: '4px',
|
|
1109
1116
|
backgroundColor: '#FDFCEE',
|
|
1110
1117
|
});
|
|
1111
|
-
const TabButton =
|
|
1118
|
+
const TabButton = styled$1(Button$1)(({ theme, isActive }) => ({
|
|
1112
1119
|
padding: theme.spacing(2, 3),
|
|
1113
1120
|
fontSize: '16px',
|
|
1114
1121
|
fontWeight: 500,
|
|
@@ -1132,18 +1139,18 @@ const TabButton = material.styled(material.Button)(({ theme, isActive }) => ({
|
|
|
1132
1139
|
backgroundColor: theme.palette.primary.main,
|
|
1133
1140
|
} : {},
|
|
1134
1141
|
}));
|
|
1135
|
-
const TabContent =
|
|
1142
|
+
const TabContent = styled$1(Box)(({ theme }) => ({
|
|
1136
1143
|
padding: theme.spacing(3),
|
|
1137
1144
|
color: '#4D3019',
|
|
1138
1145
|
backgroundColor: theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main,
|
|
1139
1146
|
}));
|
|
1140
|
-
const MobileContainer =
|
|
1147
|
+
const MobileContainer = styled$1(Box)({
|
|
1141
1148
|
backgroundColor: '#FDFCEE',
|
|
1142
1149
|
'@media (min-width: 900px)': {
|
|
1143
1150
|
display: 'none',
|
|
1144
1151
|
},
|
|
1145
1152
|
});
|
|
1146
|
-
const MobileTabButton =
|
|
1153
|
+
const MobileTabButton = styled$1(Button$1)(({ theme, isExpanded }) => ({
|
|
1147
1154
|
width: '100%',
|
|
1148
1155
|
display: 'flex',
|
|
1149
1156
|
alignItems: 'center',
|
|
@@ -1157,34 +1164,34 @@ const MobileTabButton = material.styled(material.Button)(({ theme, isExpanded })
|
|
|
1157
1164
|
backgroundColor: isExpanded ? theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main : 'rgba(77, 48, 25, 0.05)',
|
|
1158
1165
|
},
|
|
1159
1166
|
}));
|
|
1160
|
-
const MobileTabContent =
|
|
1167
|
+
const MobileTabContent = styled$1(Box)(({ theme }) => ({
|
|
1161
1168
|
padding: theme.spacing(2, 2, 3, 2),
|
|
1162
1169
|
color: '#4D3019',
|
|
1163
1170
|
backgroundColor: theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main,
|
|
1164
1171
|
}));
|
|
1165
1172
|
const Tabs = ({ tabs, defaultTab }) => {
|
|
1166
|
-
const [activeTab, setActiveTab] =
|
|
1167
|
-
const [mobileExpandedTab, setMobileExpandedTab] =
|
|
1173
|
+
const [activeTab, setActiveTab] = useState(defaultTab || tabs[0]?.id);
|
|
1174
|
+
const [mobileExpandedTab, setMobileExpandedTab] = useState(null);
|
|
1168
1175
|
const activeTabContent = tabs.find(tab => tab.id === activeTab)?.content;
|
|
1169
1176
|
const handleMobileTabClick = (tabId) => {
|
|
1170
1177
|
setActiveTab(tabId);
|
|
1171
1178
|
setMobileExpandedTab(mobileExpandedTab === tabId ? null : tabId);
|
|
1172
1179
|
};
|
|
1173
|
-
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: {
|
|
1174
1181
|
borderTop: index !== 0 ? '2px solid #e5e7eb' : 'none',
|
|
1175
|
-
}, children: [
|
|
1182
|
+
}, children: [jsxs(MobileTabButton, { onClick: () => handleMobileTabClick(tab.id), isExpanded: mobileExpandedTab === tab.id, children: [jsx(Box, { component: "span", sx: {
|
|
1176
1183
|
fontSize: '16px',
|
|
1177
1184
|
fontWeight: 500,
|
|
1178
1185
|
color: activeTab === tab.id ? '#4D3019' : '#826E5C',
|
|
1179
|
-
}, children: tab.label }),
|
|
1186
|
+
}, children: tab.label }), jsx(ExpandMoreRounded, { sx: {
|
|
1180
1187
|
fontSize: 20,
|
|
1181
1188
|
color: activeTab === tab.id ? '#4D3019' : '#826E5C',
|
|
1182
1189
|
transform: mobileExpandedTab === tab.id ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
1183
1190
|
transition: 'transform 0.2s',
|
|
1184
|
-
} })] }),
|
|
1191
|
+
} })] }), jsx(Collapse, { in: mobileExpandedTab === tab.id, children: jsx(MobileTabContent, { children: tab.content }) })] }, tab.id))) })] }));
|
|
1185
1192
|
};
|
|
1186
1193
|
|
|
1187
|
-
const SidebarContainer =
|
|
1194
|
+
const SidebarContainer = styled$1(Box)(({ theme, isOpen }) => ({
|
|
1188
1195
|
height: '100vh',
|
|
1189
1196
|
position: 'sticky',
|
|
1190
1197
|
top: 0,
|
|
@@ -1203,7 +1210,7 @@ const SidebarContainer = material.styled(material.Box)(({ theme, isOpen }) => ({
|
|
|
1203
1210
|
width: isOpen ? '288px' : '80px',
|
|
1204
1211
|
},
|
|
1205
1212
|
}));
|
|
1206
|
-
const ToggleButton$1 =
|
|
1213
|
+
const ToggleButton$1 = styled$1(IconButton)(({ theme }) => ({
|
|
1207
1214
|
width: 40,
|
|
1208
1215
|
height: 40,
|
|
1209
1216
|
borderRadius: theme.shape.borderRadius,
|
|
@@ -1213,7 +1220,7 @@ const ToggleButton$1 = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
1213
1220
|
backgroundColor: '#3d2614',
|
|
1214
1221
|
},
|
|
1215
1222
|
}));
|
|
1216
|
-
const MenuItemButton =
|
|
1223
|
+
const MenuItemButton = styled$1(ListItemButton)(({ theme, isActive, isOpen }) => ({
|
|
1217
1224
|
borderRadius: theme.shape.borderRadius,
|
|
1218
1225
|
padding: isOpen ? '10px 8px' : '12px 0',
|
|
1219
1226
|
justifyContent: isOpen ? 'flex-start' : 'center',
|
|
@@ -1225,7 +1232,7 @@ const MenuItemButton = material.styled(material.ListItemButton)(({ theme, isActi
|
|
|
1225
1232
|
backgroundColor: `${theme.palette.dark.main}1A`,
|
|
1226
1233
|
}),
|
|
1227
1234
|
}));
|
|
1228
|
-
const IconWrapper =
|
|
1235
|
+
const IconWrapper = styled$1(Box)(({ theme, isOpen }) => ({
|
|
1229
1236
|
width: isOpen ? 32 : 40,
|
|
1230
1237
|
height: isOpen ? 32 : 40,
|
|
1231
1238
|
borderRadius: theme.shape.borderRadius,
|
|
@@ -1237,8 +1244,8 @@ const IconWrapper = material.styled(material.Box)(({ theme, isOpen }) => ({
|
|
|
1237
1244
|
}));
|
|
1238
1245
|
const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n across two lines", activePage = 'dashboard', onPageChange }) => {
|
|
1239
1246
|
const { theme } = useTheme();
|
|
1240
|
-
const [expandedItems, setExpandedItems] =
|
|
1241
|
-
const [expandedSubItems, setExpandedSubItems] =
|
|
1247
|
+
const [expandedItems, setExpandedItems] = useState([]);
|
|
1248
|
+
const [expandedSubItems, setExpandedSubItems] = useState([]);
|
|
1242
1249
|
const handlePageClick = (pageId) => {
|
|
1243
1250
|
if (onPageChange) {
|
|
1244
1251
|
onPageChange(pageId);
|
|
@@ -1248,12 +1255,12 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1248
1255
|
{
|
|
1249
1256
|
id: 'dashboard',
|
|
1250
1257
|
label: 'Dashboard',
|
|
1251
|
-
icon:
|
|
1258
|
+
icon: jsx(HomeRounded, { sx: { fontSize: 20, color: "#4D3019" } }),
|
|
1252
1259
|
},
|
|
1253
1260
|
{
|
|
1254
1261
|
id: 'policies',
|
|
1255
1262
|
label: 'Policies',
|
|
1256
|
-
icon:
|
|
1263
|
+
icon: jsx(TextSnippetRounded, { sx: { fontSize: 20, color: "#4D3019" } }),
|
|
1257
1264
|
hasChildren: true,
|
|
1258
1265
|
children: [
|
|
1259
1266
|
{ id: 'legislation', label: 'Legislation' },
|
|
@@ -1279,7 +1286,7 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1279
1286
|
{
|
|
1280
1287
|
id: 'support',
|
|
1281
1288
|
label: 'Support',
|
|
1282
|
-
icon:
|
|
1289
|
+
icon: jsx(HelpOutlineRounded, { sx: { fontSize: 20, color: "#4D3019" } }),
|
|
1283
1290
|
},
|
|
1284
1291
|
];
|
|
1285
1292
|
const toggleItem = (itemId) => {
|
|
@@ -1294,37 +1301,37 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1294
1301
|
const toggleSubItem = (subItemId) => {
|
|
1295
1302
|
setExpandedSubItems((prev) => prev.includes(subItemId) ? prev.filter((id) => id !== subItemId) : [...prev, subItemId]);
|
|
1296
1303
|
};
|
|
1297
|
-
return (
|
|
1304
|
+
return (jsxs(Fragment, { children: [isOpen && (jsx(Box, { sx: {
|
|
1298
1305
|
position: 'fixed',
|
|
1299
1306
|
inset: 0,
|
|
1300
1307
|
bgcolor: 'rgba(0, 0, 0, 0.5)',
|
|
1301
1308
|
zIndex: 40,
|
|
1302
1309
|
display: { xs: 'block', md: 'none' },
|
|
1303
|
-
}, onClick: onToggle })),
|
|
1310
|
+
}, onClick: onToggle })), jsx(SidebarContainer, { isOpen: isOpen, children: jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', height: '100%' }, children: [isOpen && (jsxs(Box, { sx: {
|
|
1304
1311
|
px: 2,
|
|
1305
1312
|
py: 3,
|
|
1306
1313
|
borderBottom: `1px solid ${theme.palette.dark.main}1A`,
|
|
1307
1314
|
flexShrink: 0,
|
|
1308
1315
|
position: 'relative',
|
|
1309
|
-
}, children: [
|
|
1316
|
+
}, children: [jsx(Typography, { variant: "h6", sx: {
|
|
1310
1317
|
fontSize: '18px',
|
|
1311
1318
|
fontWeight: 700,
|
|
1312
1319
|
color: '#4D3019',
|
|
1313
1320
|
lineHeight: 1.3,
|
|
1314
1321
|
whiteSpace: 'pre-line',
|
|
1315
1322
|
pr: 7,
|
|
1316
|
-
}, 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: {
|
|
1317
1324
|
px: 1,
|
|
1318
1325
|
py: 3,
|
|
1319
1326
|
borderBottom: `1px solid ${theme.palette.dark.main}1A`,
|
|
1320
1327
|
display: 'flex',
|
|
1321
1328
|
justifyContent: 'center',
|
|
1322
|
-
}, children:
|
|
1329
|
+
}, children: jsx(ToggleButton$1, { onClick: onToggle, "aria-label": "Expand sidebar", children: jsx(ChevronRightRounded, { sx: { fontSize: 20 } }) }) })), jsx(Box, { sx: {
|
|
1323
1330
|
flex: 1,
|
|
1324
1331
|
overflowY: 'auto',
|
|
1325
1332
|
px: isOpen ? 1.5 : 1,
|
|
1326
1333
|
py: 3,
|
|
1327
|
-
}, 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: () => {
|
|
1328
1335
|
if (item.hasChildren) {
|
|
1329
1336
|
toggleItem(item.id);
|
|
1330
1337
|
}
|
|
@@ -1334,10 +1341,10 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1334
1341
|
}
|
|
1335
1342
|
handlePageClick(item.id);
|
|
1336
1343
|
}
|
|
1337
|
-
}, 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: {
|
|
1338
1345
|
fontSize: '1rem',
|
|
1339
1346
|
fontWeight: 600,
|
|
1340
|
-
}, 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: {
|
|
1341
1348
|
flex: 1,
|
|
1342
1349
|
pl: 8,
|
|
1343
1350
|
py: 1.25,
|
|
@@ -1348,22 +1355,22 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1348
1355
|
...(activePage === subItem.id && {
|
|
1349
1356
|
backgroundColor: `${theme.palette.dark.main}1A`,
|
|
1350
1357
|
}),
|
|
1351
|
-
}, children:
|
|
1358
|
+
}, children: jsx(ListItemText, { primary: subItem.label, primaryTypographyProps: {
|
|
1352
1359
|
fontSize: '0.875rem',
|
|
1353
|
-
} }) }), subItem.hasChildren && subItem.children && subItem.children.length > 0 && (
|
|
1360
|
+
} }) }), subItem.hasChildren && subItem.children && subItem.children.length > 0 && (jsx(IconButton, { onClick: () => toggleSubItem(subItem.id), sx: {
|
|
1354
1361
|
px: 1,
|
|
1355
1362
|
borderRadius: `0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px 0`,
|
|
1356
1363
|
'&:hover': {
|
|
1357
1364
|
backgroundColor: `${theme.palette.dark.main}0D`,
|
|
1358
1365
|
},
|
|
1359
|
-
}, children:
|
|
1366
|
+
}, children: jsx(ChevronRightRounded, { sx: {
|
|
1360
1367
|
fontSize: 16,
|
|
1361
1368
|
color: '#4D3019',
|
|
1362
1369
|
transition: 'transform 0.2s',
|
|
1363
1370
|
transform: expandedSubItems.includes(subItem.id) ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
1364
|
-
} }) }))] }), 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) => {
|
|
1365
1372
|
const nestedPageId = `${subItem.id}-${index}`;
|
|
1366
|
-
return (
|
|
1373
|
+
return (jsx(ListItemButton, { onClick: () => handlePageClick(nestedPageId), sx: {
|
|
1367
1374
|
pl: 10,
|
|
1368
1375
|
py: 1,
|
|
1369
1376
|
borderRadius: theme.shape.borderRadius,
|
|
@@ -1373,13 +1380,13 @@ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n acro
|
|
|
1373
1380
|
...(activePage === nestedPageId && {
|
|
1374
1381
|
backgroundColor: `${theme.palette.dark.main}1A`,
|
|
1375
1382
|
}),
|
|
1376
|
-
}, children:
|
|
1383
|
+
}, children: jsx(ListItemText, { primary: nestedItem, primaryTypographyProps: {
|
|
1377
1384
|
fontSize: '0.875rem',
|
|
1378
1385
|
} }) }, index));
|
|
1379
1386
|
}) }) }))] }, subItem.id))) }) }))] }, item.id))) }) })] }) })] }));
|
|
1380
1387
|
};
|
|
1381
1388
|
|
|
1382
|
-
const StyledHeader =
|
|
1389
|
+
const StyledHeader = styled$1(Box)(({ theme }) => ({
|
|
1383
1390
|
padding: theme.spacing(1.5, 4), // px-4 py-3
|
|
1384
1391
|
display: 'flex',
|
|
1385
1392
|
alignItems: 'center',
|
|
@@ -1394,7 +1401,7 @@ const StyledHeader = material.styled(material.Box)(({ theme }) => ({
|
|
|
1394
1401
|
gap: theme.spacing(4), // md:gap-4
|
|
1395
1402
|
},
|
|
1396
1403
|
}));
|
|
1397
|
-
const StyledLogoWrapper =
|
|
1404
|
+
const StyledLogoWrapper = styled$1(Box)(({ theme }) => ({
|
|
1398
1405
|
display: 'flex',
|
|
1399
1406
|
alignItems: 'center',
|
|
1400
1407
|
gap: theme.spacing(2), // md:gap-2
|
|
@@ -1402,7 +1409,7 @@ const StyledLogoWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
|
1402
1409
|
gap: theme.spacing(1.5), // gap-1.5
|
|
1403
1410
|
},
|
|
1404
1411
|
}));
|
|
1405
|
-
const StyledLogoIcon =
|
|
1412
|
+
const StyledLogoIcon = styled$1(Box)(({ theme }) => ({
|
|
1406
1413
|
width: 32, // md:w-8 md:h-8
|
|
1407
1414
|
height: 32,
|
|
1408
1415
|
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
@@ -1411,7 +1418,7 @@ const StyledLogoIcon = material.styled(material.Box)(({ theme }) => ({
|
|
|
1411
1418
|
height: 24, // h-6
|
|
1412
1419
|
},
|
|
1413
1420
|
}));
|
|
1414
|
-
const StyledLogoText =
|
|
1421
|
+
const StyledLogoText = styled$1(Typography)(({ theme }) => ({
|
|
1415
1422
|
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
1416
1423
|
fontWeight: 700, // font-bold
|
|
1417
1424
|
letterSpacing: '0.05em', // tracking-wide
|
|
@@ -1423,7 +1430,7 @@ const StyledLogoText = material.styled(material.Typography)(({ theme }) => ({
|
|
|
1423
1430
|
fontSize: '1.125rem', // text-lg
|
|
1424
1431
|
},
|
|
1425
1432
|
}));
|
|
1426
|
-
const StyledSearchContainer =
|
|
1433
|
+
const StyledSearchContainer = styled$1(Box)(({ theme }) => ({
|
|
1427
1434
|
flex: 1,
|
|
1428
1435
|
maxWidth: '32rem', // max-w-2xl
|
|
1429
1436
|
margin: theme.spacing(0, 8), // mx-8
|
|
@@ -1435,7 +1442,7 @@ const StyledSearchContainer = material.styled(material.Box)(({ theme }) => ({
|
|
|
1435
1442
|
margin: theme.spacing(0, 2), // mx-2
|
|
1436
1443
|
},
|
|
1437
1444
|
}));
|
|
1438
|
-
const StyledTextField =
|
|
1445
|
+
const StyledTextField = styled$1(TextField)(({ theme }) => ({
|
|
1439
1446
|
'& .MuiInputBase-root': {
|
|
1440
1447
|
backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]
|
|
1441
1448
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
@@ -1465,7 +1472,7 @@ const StyledTextField = material.styled(material.TextField)(({ theme }) => ({
|
|
|
1465
1472
|
outlineOffset: 0,
|
|
1466
1473
|
},
|
|
1467
1474
|
}));
|
|
1468
|
-
const StyledSearchButton =
|
|
1475
|
+
const StyledSearchButton = styled$1(IconButton)(({ theme }) => ({
|
|
1469
1476
|
position: 'absolute',
|
|
1470
1477
|
right: theme.spacing(2), // md:right-2
|
|
1471
1478
|
top: '50%',
|
|
@@ -1484,7 +1491,7 @@ const StyledSearchButton = material.styled(material.IconButton)(({ theme }) => (
|
|
|
1484
1491
|
height: theme.spacing(4), // h-8
|
|
1485
1492
|
},
|
|
1486
1493
|
}));
|
|
1487
|
-
const StyledSearchIcon =
|
|
1494
|
+
const StyledSearchIcon = styled$1(Box)(({ theme }) => ({
|
|
1488
1495
|
width: 20, // md:w-5 md:h-5
|
|
1489
1496
|
height: 20,
|
|
1490
1497
|
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
@@ -1493,7 +1500,7 @@ const StyledSearchIcon = material.styled(material.Box)(({ theme }) => ({
|
|
|
1493
1500
|
height: 16, // h-4
|
|
1494
1501
|
},
|
|
1495
1502
|
}));
|
|
1496
|
-
const StyledUserContainer =
|
|
1503
|
+
const StyledUserContainer = styled$1(Box)(({ theme }) => ({
|
|
1497
1504
|
display: 'flex',
|
|
1498
1505
|
alignItems: 'center',
|
|
1499
1506
|
gap: theme.spacing(3), // md:gap-3
|
|
@@ -1501,7 +1508,7 @@ const StyledUserContainer = material.styled(material.Box)(({ theme }) => ({
|
|
|
1501
1508
|
gap: theme.spacing(2), // gap-2
|
|
1502
1509
|
},
|
|
1503
1510
|
}));
|
|
1504
|
-
const StyledAvatar =
|
|
1511
|
+
const StyledAvatar = styled$1(Box)(({ theme }) => ({
|
|
1505
1512
|
width: theme.spacing(6), // md:w-12
|
|
1506
1513
|
height: theme.spacing(6), // md:h-12
|
|
1507
1514
|
borderRadius: '50%', // rounded-full
|
|
@@ -1519,7 +1526,7 @@ const StyledAvatar = material.styled(material.Box)(({ theme }) => ({
|
|
|
1519
1526
|
height: theme.spacing(4), // h-8
|
|
1520
1527
|
},
|
|
1521
1528
|
}));
|
|
1522
|
-
const StyledAvatarText =
|
|
1529
|
+
const StyledAvatarText = styled$1(Typography)(({ theme }) => ({
|
|
1523
1530
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
1524
1531
|
fontWeight: 700, // font-bold
|
|
1525
1532
|
fontSize: '1.125rem', // text-lg
|
|
@@ -1527,7 +1534,7 @@ const StyledAvatarText = material.styled(material.Typography)(({ theme }) => ({
|
|
|
1527
1534
|
fontSize: '0.875rem', // text-sm
|
|
1528
1535
|
},
|
|
1529
1536
|
}));
|
|
1530
|
-
const StyledUserName =
|
|
1537
|
+
const StyledUserName = styled$1(Typography)(({ theme }) => ({
|
|
1531
1538
|
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
1532
1539
|
fontWeight: 500, // font-medium
|
|
1533
1540
|
fontSize: '1.125rem', // text-lg
|
|
@@ -1541,12 +1548,12 @@ const StyledUserName = material.styled(material.Typography)(({ theme }) => ({
|
|
|
1541
1548
|
}));
|
|
1542
1549
|
const Header = ({ userName = 'John Doe', userInitials = 'JD', }) => {
|
|
1543
1550
|
const { theme } = useTheme();
|
|
1544
|
-
return (
|
|
1545
|
-
endAdornment: (
|
|
1546
|
-
} }) }),
|
|
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 })] })] }));
|
|
1547
1554
|
};
|
|
1548
1555
|
|
|
1549
|
-
const Container =
|
|
1556
|
+
const Container = styled$1(Box)(({ theme }) => ({
|
|
1550
1557
|
width: '100%',
|
|
1551
1558
|
[theme.breakpoints.up('md')]: {
|
|
1552
1559
|
position: 'sticky',
|
|
@@ -1563,7 +1570,7 @@ const Container = material.styled(material.Box)(({ theme }) => ({
|
|
|
1563
1570
|
},
|
|
1564
1571
|
marginBottom: theme.spacing(2),
|
|
1565
1572
|
}));
|
|
1566
|
-
const ContentBox =
|
|
1573
|
+
const ContentBox = styled$1(Box)(({ theme }) => ({
|
|
1567
1574
|
backgroundColor: '#FEFDF7',
|
|
1568
1575
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
1569
1576
|
? parseInt(theme.shape.borderRadius, 10)
|
|
@@ -1574,7 +1581,7 @@ const ContentBox = material.styled(material.Box)(({ theme }) => ({
|
|
|
1574
1581
|
padding: theme.spacing(3),
|
|
1575
1582
|
},
|
|
1576
1583
|
}));
|
|
1577
|
-
const NavLink =
|
|
1584
|
+
const NavLink = styled$1(Link)(({ theme, isActive }) => ({
|
|
1578
1585
|
display: 'block',
|
|
1579
1586
|
padding: theme.spacing(1, 2),
|
|
1580
1587
|
fontSize: '0.875rem',
|
|
@@ -1589,18 +1596,18 @@ const NavLink = material.styled(material.Link)(({ theme, isActive }) => ({
|
|
|
1589
1596
|
},
|
|
1590
1597
|
}));
|
|
1591
1598
|
const TableOfContents = ({ sections, activeSection = 'current-section', }) => {
|
|
1592
|
-
return (
|
|
1599
|
+
return (jsx(Container, { children: jsxs(ContentBox, { children: [jsx(Typography, { variant: "h6", sx: {
|
|
1593
1600
|
color: '#4D3019',
|
|
1594
1601
|
fontWeight: 600,
|
|
1595
1602
|
fontSize: '16px',
|
|
1596
1603
|
mb: 3,
|
|
1597
|
-
}, 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) => {
|
|
1598
1605
|
const isActive = section.id === activeSection;
|
|
1599
|
-
return (
|
|
1606
|
+
return (jsx(NavLink, { href: `#${section.id}`, isActive: isActive, children: section.title }, section.id));
|
|
1600
1607
|
}) })] }) }));
|
|
1601
1608
|
};
|
|
1602
1609
|
|
|
1603
|
-
const ToggleButton =
|
|
1610
|
+
const ToggleButton = styled$1(Box)(({ theme }) => ({
|
|
1604
1611
|
display: 'inline-flex',
|
|
1605
1612
|
alignItems: 'center',
|
|
1606
1613
|
gap: theme.spacing(1.5),
|
|
@@ -1616,7 +1623,7 @@ const ToggleButton = material.styled(material.Box)(({ theme }) => ({
|
|
|
1616
1623
|
borderColor: `${theme.palette.dark.main}4D`,
|
|
1617
1624
|
},
|
|
1618
1625
|
}));
|
|
1619
|
-
const ToggleTrack =
|
|
1626
|
+
const ToggleTrack = styled$1(Box)(({ theme, isChecked }) => ({
|
|
1620
1627
|
position: 'relative',
|
|
1621
1628
|
width: '56px',
|
|
1622
1629
|
height: '32px',
|
|
@@ -1624,7 +1631,7 @@ const ToggleTrack = material.styled(material.Box)(({ theme, isChecked }) => ({
|
|
|
1624
1631
|
backgroundColor: isChecked ? theme.palette.secondary.main : '#e5e7eb',
|
|
1625
1632
|
transition: 'background-color 0.2s',
|
|
1626
1633
|
}));
|
|
1627
|
-
const ToggleThumb =
|
|
1634
|
+
const ToggleThumb = styled$1(Box)(({ isChecked }) => ({
|
|
1628
1635
|
position: 'absolute',
|
|
1629
1636
|
top: '4px',
|
|
1630
1637
|
width: '24px',
|
|
@@ -1635,23 +1642,23 @@ const ToggleThumb = material.styled(material.Box)(({ isChecked }) => ({
|
|
|
1635
1642
|
transform: isChecked ? 'translateX(28px)' : 'translateX(4px)',
|
|
1636
1643
|
}));
|
|
1637
1644
|
const Toggle = ({ label = 'Admin view', checked = false, onChange, }) => {
|
|
1638
|
-
const [isChecked, setIsChecked] =
|
|
1645
|
+
const [isChecked, setIsChecked] = useState(checked);
|
|
1639
1646
|
const handleToggle = () => {
|
|
1640
1647
|
const newValue = !isChecked;
|
|
1641
1648
|
setIsChecked(newValue);
|
|
1642
1649
|
onChange?.(newValue);
|
|
1643
1650
|
};
|
|
1644
|
-
|
|
1651
|
+
React__default.useEffect(() => {
|
|
1645
1652
|
setIsChecked(checked);
|
|
1646
1653
|
}, [checked]);
|
|
1647
|
-
return (
|
|
1654
|
+
return (jsxs(ToggleButton, { onClick: handleToggle, children: [jsx(ToggleTrack, { isChecked: isChecked, children: jsx(ToggleThumb, { isChecked: isChecked }) }), jsx(Typography, { sx: {
|
|
1648
1655
|
color: '#4D3019',
|
|
1649
1656
|
fontWeight: 500,
|
|
1650
1657
|
fontSize: '0.875rem',
|
|
1651
1658
|
}, children: label })] }));
|
|
1652
1659
|
};
|
|
1653
1660
|
|
|
1654
|
-
const StyledDialog =
|
|
1661
|
+
const StyledDialog = styled$1(Dialog)(({ theme }) => ({
|
|
1655
1662
|
'& .MuiDialog-paper': {
|
|
1656
1663
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
1657
1664
|
? parseInt(theme.shape.borderRadius, 10)
|
|
@@ -1660,7 +1667,7 @@ const StyledDialog = material.styled(material.Dialog)(({ theme }) => ({
|
|
|
1660
1667
|
width: '100%',
|
|
1661
1668
|
},
|
|
1662
1669
|
}));
|
|
1663
|
-
const StyledDialogTitle =
|
|
1670
|
+
const StyledDialogTitle = styled$1(DialogTitle)(({ theme }) => ({
|
|
1664
1671
|
display: 'flex',
|
|
1665
1672
|
alignItems: 'center',
|
|
1666
1673
|
justifyContent: 'space-between',
|
|
@@ -1670,7 +1677,7 @@ const StyledDialogTitle = material.styled(material.DialogTitle)(({ theme }) => (
|
|
|
1670
1677
|
fontWeight: 600,
|
|
1671
1678
|
color: theme.palette.dark.main,
|
|
1672
1679
|
}));
|
|
1673
|
-
const CloseButton =
|
|
1680
|
+
const CloseButton = styled$1(IconButton)(({ theme }) => ({
|
|
1674
1681
|
padding: theme.spacing(0.5),
|
|
1675
1682
|
'&:hover': {
|
|
1676
1683
|
backgroundColor: `${theme.palette.dark.main}0D`,
|
|
@@ -1678,10 +1685,10 @@ const CloseButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
1678
1685
|
}));
|
|
1679
1686
|
const SimpleModal = ({ isOpen, onClose, title, children, }) => {
|
|
1680
1687
|
const { theme } = useTheme();
|
|
1681
|
-
return (
|
|
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 })] }));
|
|
1682
1689
|
};
|
|
1683
1690
|
|
|
1684
|
-
const StyledIconButton =
|
|
1691
|
+
const StyledIconButton = styled$1(IconButton)(({ theme }) => ({
|
|
1685
1692
|
width: 48,
|
|
1686
1693
|
height: 48,
|
|
1687
1694
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
@@ -1701,26 +1708,26 @@ const StyledIconButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
1701
1708
|
},
|
|
1702
1709
|
}));
|
|
1703
1710
|
const ActionButton = ({ icon: Icon, onClick, label, sx, }) => {
|
|
1704
|
-
return (
|
|
1711
|
+
return (jsx(StyledIconButton, { onClick: onClick, "aria-label": label, sx: sx, children: jsx(Icon, {}) }));
|
|
1705
1712
|
};
|
|
1706
1713
|
|
|
1707
|
-
const StyledWrapper =
|
|
1714
|
+
const StyledWrapper = styled$1(Box)(({ theme }) => ({
|
|
1708
1715
|
// No specific wrapper styles needed, just a container
|
|
1709
1716
|
}));
|
|
1710
|
-
const StyledParagraph =
|
|
1717
|
+
const StyledParagraph = styled$1(Typography)(({ theme }) => ({
|
|
1711
1718
|
fontSize: '14px', // text-[14px]
|
|
1712
1719
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
1713
1720
|
display: 'inline-flex',
|
|
1714
1721
|
alignItems: 'center',
|
|
1715
1722
|
}));
|
|
1716
|
-
const StyledTermWrapper =
|
|
1723
|
+
const StyledTermWrapper = styled$1(Box)(({ theme }) => ({
|
|
1717
1724
|
position: 'relative',
|
|
1718
1725
|
display: 'inline-flex',
|
|
1719
1726
|
alignItems: 'center',
|
|
1720
1727
|
cursor: 'pointer',
|
|
1721
1728
|
marginLeft: theme.spacing(0.5), // ml-1
|
|
1722
1729
|
}));
|
|
1723
|
-
const StyledTerm =
|
|
1730
|
+
const StyledTerm = styled$1('span', {
|
|
1724
1731
|
shouldForwardProp: (prop) => prop !== 'isOpen',
|
|
1725
1732
|
})(({ theme, isOpen }) => ({
|
|
1726
1733
|
paddingBottom: '1px', // style={{ paddingBottom: '1px' }}
|
|
@@ -1730,14 +1737,14 @@ const StyledTerm = material.styled('span', {
|
|
|
1730
1737
|
borderBottomColor: theme.palette.secondary.main, // hover effect
|
|
1731
1738
|
},
|
|
1732
1739
|
}));
|
|
1733
|
-
const StyledIconWrapper =
|
|
1740
|
+
const StyledIconWrapper = styled$1(Box)(({ theme }) => ({
|
|
1734
1741
|
display: 'inline-flex',
|
|
1735
1742
|
alignItems: 'center',
|
|
1736
1743
|
justifyContent: 'center',
|
|
1737
1744
|
marginLeft: theme.spacing(0.5), // ml-1
|
|
1738
1745
|
transition: 'color 0.2s', // transition-colors
|
|
1739
1746
|
}));
|
|
1740
|
-
const StyledDefinitionBox =
|
|
1747
|
+
const StyledDefinitionBox = styled$1(Box)(({ theme }) => ({
|
|
1741
1748
|
marginTop: theme.spacing(2), // mt-4
|
|
1742
1749
|
padding: theme.spacing(2), // p-4
|
|
1743
1750
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
@@ -1747,30 +1754,30 @@ const StyledDefinitionBox = material.styled(material.Box)(({ theme }) => ({
|
|
|
1747
1754
|
borderRight: `4px solid ${theme.palette.dark.main}33`, // border-r-4
|
|
1748
1755
|
backgroundColor: theme.palette.light.main, // style={{ backgroundColor: '#FDFCEE' }}
|
|
1749
1756
|
}));
|
|
1750
|
-
const StyledDefinitionText =
|
|
1757
|
+
const StyledDefinitionText = styled$1(Typography)(({ theme }) => ({
|
|
1751
1758
|
fontSize: '14px', // text-[14px]
|
|
1752
1759
|
color: theme.palette.dark.main, // text-[#4D3019]
|
|
1753
1760
|
lineHeight: 1.5, // leading-relaxed
|
|
1754
1761
|
}));
|
|
1755
1762
|
function DefinitionBox({ term, definition, children }) {
|
|
1756
1763
|
const { theme } = useTheme();
|
|
1757
|
-
const [isOpen, setIsOpen] =
|
|
1758
|
-
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: {
|
|
1759
1766
|
fontSize: 16,
|
|
1760
1767
|
color: isOpen ? theme.palette.secondary.main : theme.palette.dark.main,
|
|
1761
1768
|
'&:hover': {
|
|
1762
1769
|
color: theme.palette.secondary.main
|
|
1763
1770
|
}
|
|
1764
|
-
} })) : (
|
|
1771
|
+
} })) : (jsx(AddRounded, { sx: {
|
|
1765
1772
|
fontSize: 16,
|
|
1766
1773
|
color: theme.palette.dark.main,
|
|
1767
1774
|
'&:hover': {
|
|
1768
1775
|
color: theme.palette.secondary.main
|
|
1769
1776
|
}
|
|
1770
|
-
} })) })] })] }), isOpen && (
|
|
1777
|
+
} })) })] })] }), isOpen && (jsx(StyledDefinitionBox, { children: jsx(StyledDefinitionText, { children: definition }) }))] }));
|
|
1771
1778
|
}
|
|
1772
1779
|
|
|
1773
|
-
const HomeButton =
|
|
1780
|
+
const HomeButton = styled$1(IconButton)(({ theme }) => ({
|
|
1774
1781
|
width: 40,
|
|
1775
1782
|
height: 40,
|
|
1776
1783
|
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
@@ -1787,7 +1794,7 @@ const HomeButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
|
1787
1794
|
opacity: 0.8,
|
|
1788
1795
|
},
|
|
1789
1796
|
}));
|
|
1790
|
-
const DropdownButton =
|
|
1797
|
+
const DropdownButton = styled$1('button')(({ theme }) => ({
|
|
1791
1798
|
display: 'flex',
|
|
1792
1799
|
alignItems: 'center',
|
|
1793
1800
|
gap: theme.spacing(1),
|
|
@@ -1811,7 +1818,7 @@ const DropdownButton = material.styled('button')(({ theme }) => ({
|
|
|
1811
1818
|
gap: theme.spacing(0.5),
|
|
1812
1819
|
},
|
|
1813
1820
|
}));
|
|
1814
|
-
const StyledMenu =
|
|
1821
|
+
const StyledMenu = styled$1(Menu)(({ theme }) => ({
|
|
1815
1822
|
'& .MuiPaper-root': {
|
|
1816
1823
|
marginTop: theme.spacing(1),
|
|
1817
1824
|
width: '256px',
|
|
@@ -1822,7 +1829,7 @@ const StyledMenu = material.styled(material.Menu)(({ theme }) => ({
|
|
|
1822
1829
|
boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
1823
1830
|
},
|
|
1824
1831
|
}));
|
|
1825
|
-
const StyledMenuItem =
|
|
1832
|
+
const StyledMenuItem = styled$1(MenuItem)(({ theme, isActive }) => ({
|
|
1826
1833
|
padding: theme.spacing(1.25, 2),
|
|
1827
1834
|
fontSize: '0.875rem',
|
|
1828
1835
|
color: isActive ? theme.palette.primary.main : '#4D3019',
|
|
@@ -1834,7 +1841,7 @@ const StyledMenuItem = material.styled(material.MenuItem)(({ theme, isActive })
|
|
|
1834
1841
|
}));
|
|
1835
1842
|
const Breadcrumb = ({ items, currentItem, dropdownItems = [], onItemSelect, }) => {
|
|
1836
1843
|
const { theme } = useTheme();
|
|
1837
|
-
const [anchorEl, setAnchorEl] =
|
|
1844
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
1838
1845
|
const isDropdownOpen = Boolean(anchorEl);
|
|
1839
1846
|
const handleDropdownToggle = (event) => {
|
|
1840
1847
|
setAnchorEl(event.currentTarget);
|
|
@@ -1846,63 +1853,38 @@ const Breadcrumb = ({ items, currentItem, dropdownItems = [], onItemSelect, }) =
|
|
|
1846
1853
|
onItemSelect?.(item);
|
|
1847
1854
|
handleClose();
|
|
1848
1855
|
};
|
|
1849
|
-
return (
|
|
1856
|
+
return (jsxs(Box, { component: "nav", sx: {
|
|
1850
1857
|
display: 'flex',
|
|
1851
1858
|
alignItems: 'center',
|
|
1852
1859
|
gap: { xs: 0.5, sm: 1 },
|
|
1853
1860
|
fontSize: { xs: '0.75rem', sm: '0.875rem' },
|
|
1854
1861
|
overflow: 'visible',
|
|
1855
|
-
}, children: [
|
|
1862
|
+
}, children: [jsx(HomeButton, { "aria-label": "Home", children: jsx(HomeRounded, { sx: { fontSize: 20, color: "#4D3019" } }) }), jsx(Breadcrumbs, { separator: "/", sx: {
|
|
1856
1863
|
display: { xs: 'none', md: 'flex' },
|
|
1857
1864
|
'& .MuiBreadcrumbs-separator': {
|
|
1858
1865
|
color: `${theme.palette.dark.main}66`,
|
|
1859
1866
|
},
|
|
1860
|
-
}, children: items.map((item, index) => (
|
|
1867
|
+
}, children: items.map((item, index) => (jsx(Typography, { sx: {
|
|
1861
1868
|
color: theme.palette.dark.main,
|
|
1862
1869
|
fontWeight: 500,
|
|
1863
1870
|
px: { xs: 0.5, sm: 1 },
|
|
1864
1871
|
whiteSpace: 'nowrap',
|
|
1865
1872
|
fontSize: 'inherit',
|
|
1866
|
-
}, children: item.label }, index))) }),
|
|
1873
|
+
}, children: item.label }, index))) }), jsx(Typography, { sx: {
|
|
1867
1874
|
display: { xs: 'none', md: 'inline' },
|
|
1868
1875
|
color: `${theme.palette.dark.main}66`,
|
|
1869
|
-
}, 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: {
|
|
1870
1877
|
fontSize: 20,
|
|
1871
1878
|
transition: 'transform 0.2s',
|
|
1872
1879
|
transform: isDropdownOpen ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
1873
|
-
} })] }), dropdownItems.length > 0 && (
|
|
1880
|
+
} })] }), dropdownItems.length > 0 && (jsx(StyledMenu, { anchorEl: anchorEl, open: isDropdownOpen, onClose: handleClose, anchorOrigin: {
|
|
1874
1881
|
vertical: 'bottom',
|
|
1875
1882
|
horizontal: 'left',
|
|
1876
1883
|
}, transformOrigin: {
|
|
1877
1884
|
vertical: 'top',
|
|
1878
1885
|
horizontal: 'left',
|
|
1879
|
-
}, children: dropdownItems.map((item, index) => (
|
|
1886
|
+
}, children: dropdownItems.map((item, index) => (jsx(StyledMenuItem, { onClick: () => handleItemClick(item), isActive: item === currentItem, children: item }, index))) }))] })] }));
|
|
1880
1887
|
};
|
|
1881
1888
|
|
|
1882
|
-
|
|
1883
|
-
exports.Alert = Alert;
|
|
1884
|
-
exports.Breadcrumb = Breadcrumb;
|
|
1885
|
-
exports.Button = Button;
|
|
1886
|
-
exports.Card = Card;
|
|
1887
|
-
exports.Checkbox = Checkbox;
|
|
1888
|
-
exports.Concertina = Concertina;
|
|
1889
|
-
exports.DefinitionBox = DefinitionBox;
|
|
1890
|
-
exports.Header = Header;
|
|
1891
|
-
exports.Input = Input;
|
|
1892
|
-
exports.Modal = Modal;
|
|
1893
|
-
exports.NoteBox = NoteBox;
|
|
1894
|
-
exports.Progress = Progress;
|
|
1895
|
-
exports.Radio = Radio;
|
|
1896
|
-
exports.RadioGroup = RadioGroup;
|
|
1897
|
-
exports.ReadBy = ReadBy;
|
|
1898
|
-
exports.Select = Select;
|
|
1899
|
-
exports.Sidebar = Sidebar;
|
|
1900
|
-
exports.SimpleModal = SimpleModal;
|
|
1901
|
-
exports.StatusBar = StatusBar;
|
|
1902
|
-
exports.StepIndicator = StepIndicator;
|
|
1903
|
-
exports.TableOfContents = TableOfContents;
|
|
1904
|
-
exports.Tabs = Tabs;
|
|
1905
|
-
exports.ThemeProvider = ThemeProvider;
|
|
1906
|
-
exports.Toggle = Toggle;
|
|
1907
|
-
exports.useTheme = useTheme;
|
|
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 };
|
|
1908
1890
|
//# sourceMappingURL=index.js.map
|