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