ece-docs-components 1.0.0

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.
Files changed (57) hide show
  1. package/dist/ThemeProvider.d.ts +19 -0
  2. package/dist/ThemeProvider.d.ts.map +1 -0
  3. package/dist/components/ActionButton.d.ts +12 -0
  4. package/dist/components/ActionButton.d.ts.map +1 -0
  5. package/dist/components/Alert.d.ts +12 -0
  6. package/dist/components/Alert.d.ts.map +1 -0
  7. package/dist/components/Breadcrumb.d.ts +14 -0
  8. package/dist/components/Breadcrumb.d.ts.map +1 -0
  9. package/dist/components/Button.d.ts +9 -0
  10. package/dist/components/Button.d.ts.map +1 -0
  11. package/dist/components/Card.d.ts +12 -0
  12. package/dist/components/Card.d.ts.map +1 -0
  13. package/dist/components/Checkbox.d.ts +9 -0
  14. package/dist/components/Checkbox.d.ts.map +1 -0
  15. package/dist/components/Concertina.d.ts +11 -0
  16. package/dist/components/Concertina.d.ts.map +1 -0
  17. package/dist/components/DefinitionBox.d.ts +9 -0
  18. package/dist/components/DefinitionBox.d.ts.map +1 -0
  19. package/dist/components/Header.d.ts +8 -0
  20. package/dist/components/Header.d.ts.map +1 -0
  21. package/dist/components/Input.d.ts +8 -0
  22. package/dist/components/Input.d.ts.map +1 -0
  23. package/dist/components/Modal.d.ts +20 -0
  24. package/dist/components/Modal.d.ts.map +1 -0
  25. package/dist/components/NoteBox.d.ts +11 -0
  26. package/dist/components/NoteBox.d.ts.map +1 -0
  27. package/dist/components/Progress.d.ts +16 -0
  28. package/dist/components/Progress.d.ts.map +1 -0
  29. package/dist/components/Radio.d.ts +15 -0
  30. package/dist/components/Radio.d.ts.map +1 -0
  31. package/dist/components/ReadBy.d.ts +7 -0
  32. package/dist/components/ReadBy.d.ts.map +1 -0
  33. package/dist/components/Select.d.ts +20 -0
  34. package/dist/components/Select.d.ts.map +1 -0
  35. package/dist/components/Sidebar.d.ts +11 -0
  36. package/dist/components/Sidebar.d.ts.map +1 -0
  37. package/dist/components/SimpleModal.d.ts +10 -0
  38. package/dist/components/SimpleModal.d.ts.map +1 -0
  39. package/dist/components/StatusBar.d.ts +10 -0
  40. package/dist/components/StatusBar.d.ts.map +1 -0
  41. package/dist/components/TableOfContents.d.ts +12 -0
  42. package/dist/components/TableOfContents.d.ts.map +1 -0
  43. package/dist/components/Tabs.d.ts +13 -0
  44. package/dist/components/Tabs.d.ts.map +1 -0
  45. package/dist/components/Toggle.d.ts +9 -0
  46. package/dist/components/Toggle.d.ts.map +1 -0
  47. package/dist/components/index.d.ts +23 -0
  48. package/dist/components/index.d.ts.map +1 -0
  49. package/dist/index.d.ts +6 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.esm.js +1862 -0
  52. package/dist/index.esm.js.map +1 -0
  53. package/dist/index.js +1908 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/theme-types.d.ts +40 -0
  56. package/dist/theme-types.d.ts.map +1 -0
  57. package/package.json +46 -0
@@ -0,0 +1,1862 @@
1
+ import { createTheme, ThemeProvider as ThemeProvider$1, styled } from '@mui/material/styles';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { deepmerge } from '@mui/utils';
4
+ import * as React from 'react';
5
+ import React__default, { useState } from 'react';
6
+ import { Button as Button$1, styled as styled$1, InputLabel, TextField, Box, Select as Select$1, FormControl, MenuItem, FormHelperText, FormControlLabel, Typography, FormLabel, Checkbox as Checkbox$1, LinearProgress, Alert as Alert$1, IconButton, Dialog, DialogContent, Chip, Collapse, ListItemButton, List, ListItemText, Link, DialogTitle, Menu, Breadcrumbs } from '@mui/material';
7
+ import { ExpandMoreRounded, InfoOutlineRounded, HighlightOffRounded, ErrorOutlineRounded, TaskAltRounded, EditRounded, CloseRounded, StickyNote2Rounded, ChevronLeftRounded, ChevronRightRounded, LinkRounded, ExpandLessRounded, PieChartRounded, HomeRounded, TextSnippetRounded, HelpOutlineRounded, SchoolRounded, SearchRounded, AddRounded } from '@mui/icons-material';
8
+
9
+ // Base MUI theme configuration (shared across all themes)
10
+ const baseTheme = createTheme({
11
+ typography: {
12
+ fontFamily: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'].join(','),
13
+ },
14
+ components: {
15
+ MuiCssBaseline: {
16
+ styleOverrides: (theme) => ({
17
+ body: {
18
+ WebkitFontSmoothing: 'antialiased',
19
+ MozOsxFontSmoothing: 'grayscale',
20
+ backgroundColor: '#FDFCEE', // Add background color here
21
+ },
22
+ 'input[type="checkbox"], input[type="radio"]': {
23
+ accentColor: theme.palette.secondary.main,
24
+ },
25
+ }),
26
+ },
27
+ },
28
+ breakpoints: {
29
+ values: {
30
+ xs: 320,
31
+ sm: 640,
32
+ md: 768,
33
+ lg: 1024,
34
+ xl: 1280,
35
+ },
36
+ },
37
+ });
38
+ // Theme configurations
39
+ const muiThemes = {
40
+ default: createTheme(deepmerge(baseTheme, {
41
+ palette: {
42
+ primary: { main: '#AD46FF' },
43
+ secondary: { main: '#D79AFC' },
44
+ accent: { main: '#FFEDD1' },
45
+ dark: { main: '#4D3019' },
46
+ light: { main: '#FEFDF7' },
47
+ markedRead: { main: '#A3D977' },
48
+ custom: {
49
+ iconColor: '#ebc7ff',
50
+ primaryButtonTextColor: '#FFFFFF',
51
+ readByBackgroundColor: '#ebc7ff',
52
+ stepIndicatorTextColor: '#FFFFFF',
53
+ markAsReadBackgroundColor: '#ebc7ff',
54
+ tabBackgroundColor: '#F8F0FC',
55
+ },
56
+ },
57
+ appName: 'ECE Docs', // Add appName
58
+ })),
59
+ school: createTheme(deepmerge(baseTheme, {
60
+ palette: {
61
+ primary: { main: '#386e41' },
62
+ secondary: { main: '#8fc790' },
63
+ accent: { main: '#d5ebde' },
64
+ dark: { main: '#4D3019' },
65
+ light: { main: '#FEFDF7' },
66
+ markedRead: { main: '#A3D977' },
67
+ custom: {
68
+ primaryButtonTextColor: '#FFFFFF',
69
+ stepIndicatorTextColor: '#FFFFFF',
70
+ },
71
+ },
72
+ appName: 'School Docs', // Add appName
73
+ })),
74
+ health: createTheme(deepmerge(baseTheme, {
75
+ palette: {
76
+ primary: { main: '#4871cf' },
77
+ secondary: { main: '#a4d6ff' },
78
+ accent: { main: '#FF9ecb' },
79
+ dark: { main: '#4D3019' },
80
+ light: { main: '#FEFDF7' },
81
+ markedRead: { main: '#A3D977' },
82
+ custom: {
83
+ iconColor: '#a4d6ff',
84
+ primaryButtonTextColor: '#FFFFFF',
85
+ markAsReadBorderColor: '#FF9ecb',
86
+ readByBackgroundColor: '#a4d6ff',
87
+ stepIndicatorTextColor: '#FFFFFF',
88
+ tabBackgroundColor: '#a4d6ff',
89
+ },
90
+ },
91
+ appName: 'GP Docs', // Add appName
92
+ })),
93
+ };
94
+ const ThemeContext = React.createContext(undefined);
95
+ const ThemeProvider = ({ children }) => {
96
+ const [currentTheme, setCurrentTheme] = React.useState('default');
97
+ return (jsx(ThemeContext.Provider, { value: { currentTheme, setTheme: setCurrentTheme, theme: muiThemes[currentTheme] }, children: jsx(ThemeProvider$1, { theme: muiThemes[currentTheme], children: children }) }));
98
+ };
99
+ const useTheme = () => {
100
+ const context = React.useContext(ThemeContext);
101
+ if (context === undefined) {
102
+ throw new Error('useTheme must be used within a ThemeProvider');
103
+ }
104
+ return context;
105
+ };
106
+
107
+ const StyledButton = styled(Button$1, {
108
+ shouldForwardProp: (prop) => prop !== 'customVariant' && prop !== 'customSize',
109
+ })(({ theme, customVariant, customSize }) => {
110
+ const currentTheme = theme.palette;
111
+ // Size styles
112
+ const sizeStyles = {
113
+ sm: {
114
+ padding: '6px 12px',
115
+ fontSize: '0.875rem',
116
+ },
117
+ md: {
118
+ padding: '10px 16px',
119
+ fontSize: '1rem',
120
+ },
121
+ lg: {
122
+ padding: '12px 24px',
123
+ fontSize: '1.125rem',
124
+ },
125
+ };
126
+ // Base styles
127
+ const baseStyles = {
128
+ fontWeight: 500,
129
+ borderRadius: '8px',
130
+ textTransform: 'none',
131
+ transition: 'all 0.2s',
132
+ boxShadow: 'none',
133
+ '&:hover': {
134
+ boxShadow: 'none',
135
+ },
136
+ '&.Mui-disabled': {
137
+ opacity: 0.5,
138
+ cursor: 'not-allowed',
139
+ },
140
+ ...sizeStyles[customSize],
141
+ };
142
+ // Variant styles
143
+ const variantStyles = {
144
+ primary: {
145
+ backgroundColor: currentTheme.primary.main,
146
+ color: currentTheme.custom?.primaryButtonTextColor || '#FFFFFF',
147
+ boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
148
+ '&:hover': {
149
+ backgroundColor: currentTheme.primary.main,
150
+ opacity: 0.9,
151
+ },
152
+ },
153
+ secondary: {
154
+ backgroundColor: currentTheme.secondary.main,
155
+ color: currentTheme.dark.main,
156
+ boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
157
+ '&:hover': {
158
+ backgroundColor: currentTheme.secondary.main,
159
+ opacity: 0.9,
160
+ },
161
+ },
162
+ outline: {
163
+ backgroundColor: currentTheme.light.main,
164
+ border: `2px solid rgba(77, 48, 25, 0.2)`,
165
+ color: currentTheme.dark.main,
166
+ '&:hover': {
167
+ backgroundColor: 'rgba(77, 48, 25, 0.05)',
168
+ borderColor: 'rgba(77, 48, 25, 0.3)',
169
+ },
170
+ },
171
+ 'marked-read': {
172
+ backgroundColor: 'rgba(163, 217, 119, 0.1)',
173
+ border: `2px solid ${currentTheme.markedRead.main}`,
174
+ color: currentTheme.dark.main,
175
+ isDisabled: true,
176
+ '&:hover': {
177
+ backgroundColor: 'rgba(163, 217, 119, 0.2)',
178
+ cursor: 'not-allowed',
179
+ },
180
+ },
181
+ 'mark-read': {
182
+ backgroundColor: currentTheme.custom?.markAsReadBackgroundColor || currentTheme.accent.main,
183
+ border: `2px solid ${currentTheme.custom?.markAsReadBorderColor || currentTheme.secondary.main}`,
184
+ color: currentTheme.dark.main,
185
+ '&:hover': {
186
+ opacity: 0.9,
187
+ },
188
+ },
189
+ danger: {
190
+ backgroundColor: '#D32F2F', // Material-UI red
191
+ color: '#FFFFFF',
192
+ boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
193
+ '&:hover': {
194
+ backgroundColor: '#B71C1C',
195
+ opacity: 0.9,
196
+ },
197
+ },
198
+ };
199
+ return {
200
+ ...baseStyles,
201
+ ...variantStyles[customVariant],
202
+ };
203
+ });
204
+ const Button = ({ variant = 'primary', size = 'md', children, fullWidth = false, ...props }) => {
205
+ return (jsx(StyledButton, { customVariant: variant, customSize: size, fullWidth: fullWidth, disableRipple: true, ...props, children: children }));
206
+ };
207
+
208
+ const InputWrapper = styled$1('div')(({ theme }) => ({
209
+ width: '100%',
210
+ }));
211
+ const StyledLabel$1 = styled$1(InputLabel)(({ theme }) => ({
212
+ fontSize: '0.875rem',
213
+ fontWeight: 500,
214
+ color: theme.palette.dark.main,
215
+ marginBottom: theme.spacing(0.75),
216
+ display: 'block',
217
+ position: 'static',
218
+ transform: 'none',
219
+ '&.Mui-focused': {
220
+ color: theme.palette.dark.main,
221
+ },
222
+ }));
223
+ const StyledTextField$1 = styled$1(TextField, {
224
+ shouldForwardProp: (prop) => !['errorMessage'].includes(prop),
225
+ })(({ theme, errorMessage }) => ({
226
+ width: '100%',
227
+ '& .MuiInputBase-root': {
228
+ backgroundColor: theme.palette.light.main,
229
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
230
+ ? parseInt(theme.shape.borderRadius, 10)
231
+ : theme.shape.borderRadius || 4) * 2,
232
+ fontSize: '1rem',
233
+ color: theme.palette.dark.main,
234
+ minWidth: 0,
235
+ padding: theme.spacing(0, 3),
236
+ [theme.breakpoints.up('sm')]: {
237
+ padding: theme.spacing(0, 4),
238
+ },
239
+ '& .MuiInputBase-input': {
240
+ padding: theme.spacing(1, 0),
241
+ [theme.breakpoints.up('sm')]: {
242
+ padding: theme.spacing(1.25, 0),
243
+ },
244
+ },
245
+ '&:focus-within': {
246
+ outline: `2px solid ${errorMessage ? theme.palette.accent.main : theme.palette.primary.main}`,
247
+ outlineOffset: 0,
248
+ },
249
+ '& .MuiOutlinedInput-notchedOutline': {
250
+ borderColor: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}33`,
251
+ },
252
+ '&:hover .MuiOutlinedInput-notchedOutline': {
253
+ borderColor: errorMessage ? theme.palette.accent.main : theme.palette.primary.main,
254
+ },
255
+ '&.Mui-disabled': {
256
+ backgroundColor: `${theme.palette.dark.main}0D`,
257
+ '& .MuiInputBase-input': {
258
+ color: `${theme.palette.dark.main}80`,
259
+ cursor: 'not-allowed',
260
+ },
261
+ '& .MuiOutlinedInput-notchedOutline': {
262
+ borderColor: `${theme.palette.dark.main}33`,
263
+ },
264
+ },
265
+ },
266
+ '& .MuiFormHelperText-root': {
267
+ marginTop: theme.spacing(0.75),
268
+ fontSize: '0.875rem',
269
+ color: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}99`,
270
+ },
271
+ }));
272
+ const Input = ({ error, fullWidth = false, id, label, ...props }) => {
273
+ const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
274
+ 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 })] }));
275
+ };
276
+
277
+ const StyledCard = styled$1(Box, {
278
+ shouldForwardProp: (prop) => prop !== 'customPadding' && prop !== 'customVariant',
279
+ })(({ theme, customPadding, customVariant }) => {
280
+ const paddingStyles = {
281
+ none: { padding: 0 },
282
+ sm: { padding: theme.spacing(2) }, // 16px
283
+ md: { padding: theme.spacing(3) }, // 24px
284
+ lg: { padding: theme.spacing(4) }, // 32px
285
+ };
286
+ const variantStyles = {
287
+ default: {
288
+ border: `1px solid ${theme.palette.dark.main}10`, // dark.main with 10% opacity
289
+ },
290
+ bordered: {
291
+ border: `2px solid ${theme.palette.dark.main}20`, // dark.main with 20% opacity
292
+ },
293
+ elevated: {
294
+ border: `1px solid ${theme.palette.dark.main}05`, // dark.main with 5% opacity
295
+ boxShadow: theme.shadows[4], // MUI shadow level 4 for "elevated"
296
+ },
297
+ };
298
+ const borderRadiusValue = typeof theme.shape.borderRadius === 'string'
299
+ ? parseInt(theme.shape.borderRadius, 10)
300
+ : theme.shape.borderRadius || 4;
301
+ return {
302
+ borderRadius: borderRadiusValue * 2, // Matches rounded-xl (approx 12px)
303
+ overflow: 'visible',
304
+ backgroundColor: theme.palette.light.main, // Matches #FEFDF7
305
+ ...paddingStyles[customPadding],
306
+ ...variantStyles[customVariant],
307
+ };
308
+ });
309
+ const Card = ({ children, className = '', padding = 'md', variant = 'default', sx, // Destructure sx prop
310
+ }) => {
311
+ return (jsx(StyledCard, { className: className, customPadding: padding, customVariant: variant, sx: sx, children: children }));
312
+ };
313
+
314
+ const StyledSelect = styled$1(Select$1)(({ theme, error }) => ({
315
+ backgroundColor: theme.palette.light.main,
316
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
317
+ ? parseInt(theme.shape.borderRadius, 10)
318
+ : theme.shape.borderRadius || 4) * 2,
319
+ fontSize: '1rem',
320
+ color: theme.palette.dark.main,
321
+ '& .MuiOutlinedInput-notchedOutline': {
322
+ borderColor: error ? theme.palette.accent.main : `${theme.palette.dark.main}33`,
323
+ },
324
+ '&:hover .MuiOutlinedInput-notchedOutline': {
325
+ borderColor: error ? theme.palette.accent.main : theme.palette.primary.main,
326
+ },
327
+ '&.Mui-focused .MuiOutlinedInput-notchedOutline': {
328
+ borderWidth: 2,
329
+ borderColor: error ? theme.palette.accent.main : theme.palette.primary.main,
330
+ },
331
+ '&.Mui-disabled': {
332
+ backgroundColor: `${theme.palette.dark.main}0D`,
333
+ '& .MuiSelect-select': {
334
+ color: `${theme.palette.dark.main}80`,
335
+ cursor: 'not-allowed',
336
+ },
337
+ },
338
+ '& .MuiSelect-icon': {
339
+ color: `${theme.palette.dark.main}66`,
340
+ },
341
+ }));
342
+ const StyledInputLabel = styled$1(InputLabel)(({ theme }) => ({
343
+ fontSize: '0.875rem',
344
+ fontWeight: 500,
345
+ color: theme.palette.dark.main,
346
+ position: 'relative',
347
+ transform: 'none',
348
+ marginBottom: theme.spacing(0.75),
349
+ '&.Mui-focused': {
350
+ color: theme.palette.dark.main,
351
+ },
352
+ }));
353
+ const Select = ({ label, error, helperText, fullWidth = false, options, className = '', id, value, onChange, disabled, name, }) => {
354
+ const { theme } = useTheme();
355
+ const selectId = id || `select-${Math.random().toString(36).substr(2, 9)}`;
356
+ const handleChange = (event) => {
357
+ if (onChange) {
358
+ // Create a synthetic event that matches React.ChangeEvent<HTMLSelectElement>
359
+ const syntheticEvent = {
360
+ target: {
361
+ value: event.target.value,
362
+ name: name || '',
363
+ },
364
+ currentTarget: event.currentTarget,
365
+ };
366
+ onChange(syntheticEvent);
367
+ }
368
+ };
369
+ 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: {
370
+ PaperProps: {
371
+ sx: {
372
+ mt: 1,
373
+ borderRadius: 2,
374
+ boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
375
+ },
376
+ },
377
+ }, children: options.map((option) => (jsx(MenuItem, { value: option.value, sx: {
378
+ fontSize: '1rem',
379
+ color: theme.palette.dark.main,
380
+ '&:hover': {
381
+ backgroundColor: `${theme.palette.primary.main}1A`,
382
+ },
383
+ '&.Mui-selected': {
384
+ backgroundColor: `${theme.palette.primary.main}26`,
385
+ '&:hover': {
386
+ backgroundColor: `${theme.palette.primary.main}33`,
387
+ },
388
+ },
389
+ }, children: option.label }, option.value))) }), error && (jsx(FormHelperText, { sx: {
390
+ mt: 0.75,
391
+ fontSize: '0.875rem',
392
+ color: theme.palette.accent.main,
393
+ }, children: error })), helperText && !error && (jsx(FormHelperText, { sx: {
394
+ mt: 0.75,
395
+ fontSize: '0.875rem',
396
+ color: `${theme.palette.dark.main}99`,
397
+ }, children: helperText }))] }));
398
+ };
399
+
400
+ const CustomRadioIcon = styled$1('span')(({ theme, checked }) => ({
401
+ width: 20,
402
+ height: 20,
403
+ borderRadius: '50%',
404
+ border: checked ? `5px solid ${theme.palette.secondary.main}` : `2px solid ${theme.palette.dark.main}4D`,
405
+ transition: 'all 0.2s',
406
+ backgroundColor: 'transparent',
407
+ display: 'flex',
408
+ alignItems: 'center',
409
+ justifyContent: 'center',
410
+ }));
411
+ const Radio = ({ label, description, className = '', id, checked, ...props }) => {
412
+ const radioId = id || `radio-${Math.random().toString(36).substr(2, 9)}`;
413
+ const { theme } = useTheme();
414
+ 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) => {
415
+ const input = document.getElementById(radioId);
416
+ if (input && !props.disabled) {
417
+ input.click();
418
+ }
419
+ }, sx: {
420
+ cursor: props.disabled ? 'not-allowed' : 'pointer',
421
+ opacity: props.disabled ? 0.5 : 1,
422
+ } })] }), label: jsxs(Box, { sx: { ml: 0 }, children: [jsx(Typography, { component: "label", htmlFor: radioId, sx: {
423
+ fontSize: '1rem',
424
+ fontWeight: 500,
425
+ color: theme.palette.dark.main,
426
+ cursor: props.disabled ? 'not-allowed' : 'pointer',
427
+ opacity: props.disabled ? 0.5 : 1,
428
+ }, children: label }), description && (jsx(Typography, { variant: "body2", sx: {
429
+ fontSize: '0.875rem',
430
+ color: `${theme.palette.dark.main}99`,
431
+ mt: 0.25,
432
+ }, children: description }))] }), sx: { alignItems: 'flex-start', ml: 0 } }));
433
+ };
434
+ const RadioGroup = ({ label, error, children, className = '' }) => {
435
+ const { theme } = useTheme();
436
+ return (jsxs(FormControl, { component: "fieldset", className: className, error: !!error, fullWidth: true, children: [label && (jsx(FormLabel, { component: "legend", sx: {
437
+ fontSize: '0.875rem',
438
+ fontWeight: 500,
439
+ color: theme.palette.dark.main,
440
+ mb: 1.5,
441
+ '&.Mui-focused': {
442
+ color: theme.palette.dark.main,
443
+ },
444
+ }, children: label })), jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1.5 }, children: children }), error && (jsx(FormHelperText, { sx: {
445
+ mt: 1,
446
+ fontSize: '0.875rem',
447
+ color: theme.palette.accent.main,
448
+ }, children: error }))] }));
449
+ };
450
+
451
+ const StyledWrapper$1 = styled$1(Box)(({ theme }) => ({
452
+ display: 'flex',
453
+ alignItems: 'flex-start',
454
+ }));
455
+ const StyledCheckbox = styled$1(Checkbox$1)(({ theme }) => ({
456
+ width: 16, // Matches Tailwind's w-4 (16px)
457
+ height: 16, // Matches Tailwind's h-4 (16px)
458
+ color: theme.palette.dark.main + '33', // dark.main with 20% opacity (border-dark/20)
459
+ '&.Mui-checked': {
460
+ color: theme.palette.primary.main, // text-primary
461
+ },
462
+ '&:focus': {
463
+ outline: `2px solid ${theme.palette.primary.main}`, // focus:ring-2 focus:ring-primary
464
+ outlineOffset: 2,
465
+ },
466
+ borderRadius: theme.shape.borderRadius, // Matches rounded
467
+ cursor: 'pointer',
468
+ }));
469
+ const StyledLabel = styled$1(Typography)(({ theme }) => ({
470
+ fontSize: '1rem', // text-base (16px)
471
+ fontWeight: 500, // font-medium
472
+ color: theme.palette.dark.main, // text-dark
473
+ cursor: 'pointer',
474
+ }));
475
+ const StyledDescription = styled$1(Typography)(({ theme }) => ({
476
+ fontSize: '0.875rem', // text-sm (14px)
477
+ color: theme.palette.dark.main + '99', // dark.main with 60% opacity (text-dark/60)
478
+ marginTop: theme.spacing(0.5), // mt-0.5
479
+ }));
480
+ const Checkbox = ({ label, description, className = '', id, ...props }) => {
481
+ const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
482
+ 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 })] }) }) }));
483
+ };
484
+
485
+ const StyledLinearProgress = styled$1(LinearProgress)(({ theme }) => ({
486
+ height: 10,
487
+ borderRadius: 9999,
488
+ backgroundColor: `${theme.palette.dark.main}1A`,
489
+ '& .MuiLinearProgress-bar': {
490
+ borderRadius: 9999,
491
+ backgroundColor: theme.palette.primary.main,
492
+ transition: 'transform 0.3s ease-out',
493
+ },
494
+ }));
495
+ const Progress = ({ current, total, showLabel = true, className = '' }) => {
496
+ const percentage = Math.min(Math.max((current / total) * 100, 0), 100);
497
+ 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 })] }));
498
+ };
499
+ const StepNumber = styled$1(Box)(({ theme, isActive, isCompleted }) => ({
500
+ width: 40,
501
+ height: 40,
502
+ borderRadius: '50%',
503
+ display: 'flex',
504
+ alignItems: 'center',
505
+ justifyContent: 'center',
506
+ fontWeight: 600,
507
+ fontSize: '0.875rem',
508
+ transition: 'all 0.2s',
509
+ backgroundColor: isCompleted || isActive
510
+ ? theme.palette.primary.main
511
+ : `${theme.palette.dark.main}1A`,
512
+ color: isCompleted || isActive
513
+ ? (theme.palette.custom?.stepIndicatorTextColor || theme.palette.dark.main)
514
+ : `${theme.palette.dark.main}99`,
515
+ boxShadow: isActive ? `0 0 0 4px ${theme.palette.primary.main}33` : 'none',
516
+ [theme.breakpoints.down('sm')]: {
517
+ width: 32,
518
+ height: 32,
519
+ fontSize: '0.75rem',
520
+ },
521
+ }));
522
+ const StepLine = styled$1(Box)(({ theme, isCompleted }) => ({
523
+ flex: 1,
524
+ height: 4,
525
+ borderRadius: 2,
526
+ margin: '0 8px',
527
+ minWidth: '1rem',
528
+ transition: 'background-color 0.2s',
529
+ backgroundColor: isCompleted ? theme.palette.primary.main : `${theme.palette.dark.main}1A`,
530
+ [theme.breakpoints.down('sm')]: {
531
+ height: 2,
532
+ margin: '0 4px',
533
+ },
534
+ }));
535
+ const StepIndicator = ({ steps, currentStep, className = '' }) => {
536
+ const { theme } = useTheme();
537
+ return (jsx(Box, { className: className, sx: {
538
+ display: 'flex',
539
+ alignItems: 'center',
540
+ justifyContent: 'space-between',
541
+ overflowX: 'auto',
542
+ pb: 1,
543
+ }, children: steps.map((step, index) => {
544
+ const stepNumber = index + 1;
545
+ const isActive = stepNumber === currentStep;
546
+ const isCompleted = stepNumber < currentStep;
547
+ return (jsxs(React__default.Fragment, { children: [jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', alignItems: 'center', flexShrink: 0 }, children: [jsx(StepNumber, { isActive: isActive, isCompleted: isCompleted, children: stepNumber }), jsx(Typography, { sx: {
548
+ mt: { xs: 0.5, sm: 1 },
549
+ fontSize: { xs: '10px', sm: '12px' },
550
+ fontWeight: 500,
551
+ whiteSpace: 'nowrap',
552
+ color: isActive ? theme.palette.primary.main : `${theme.palette.dark.main}99`,
553
+ }, children: step })] }), index < steps.length - 1 && (jsx(StepLine, { isCompleted: isCompleted }))] }, index));
554
+ }) }));
555
+ };
556
+
557
+ const StyledAlert = styled$1(Alert$1)(({ theme, customvariant }) => {
558
+ const variants = {
559
+ info: {
560
+ backgroundColor: '#eff6ff',
561
+ borderColor: '#bfdbfe',
562
+ color: '#1e3a8a',
563
+ },
564
+ success: {
565
+ backgroundColor: '#f0fdf4',
566
+ borderColor: '#bbf7d0',
567
+ color: '#14532d',
568
+ },
569
+ warning: {
570
+ backgroundColor: '#fefce8',
571
+ borderColor: '#fef08a',
572
+ color: '#713f12',
573
+ },
574
+ error: {
575
+ backgroundColor: '#fef2f2',
576
+ borderColor: '#fecaca',
577
+ color: '#7f1d1d',
578
+ },
579
+ custom: {
580
+ backgroundColor: theme.palette.light.main,
581
+ borderColor: `${theme.palette.dark.main}33`,
582
+ color: theme.palette.dark.main,
583
+ },
584
+ };
585
+ const variantKey = customvariant || 'info';
586
+ const style = variants[variantKey];
587
+ return {
588
+ display: 'flex',
589
+ alignItems: 'flex-start',
590
+ gap: theme.spacing(1.5),
591
+ padding: theme.spacing(2),
592
+ border: `1px solid ${style.borderColor}`,
593
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
594
+ ? parseInt(theme.shape.borderRadius, 10)
595
+ : theme.shape.borderRadius || 4) * 2,
596
+ backgroundColor: style.backgroundColor,
597
+ color: style.color,
598
+ '& .MuiAlert-icon': {
599
+ marginRight: 0,
600
+ padding: 0,
601
+ marginTop: '2px',
602
+ },
603
+ '& .MuiAlert-message': {
604
+ padding: 0,
605
+ flex: 1,
606
+ },
607
+ };
608
+ });
609
+ const Alert = ({ variant = 'info', children, className = '', icon = true, sx, }) => {
610
+ const iconMap = {
611
+ info: jsx(InfoOutlineRounded, { sx: { fontSize: 20 } }),
612
+ success: jsx(TaskAltRounded, { sx: { fontSize: 20 } }),
613
+ warning: jsx(ErrorOutlineRounded, { sx: { fontSize: 20 } }),
614
+ error: jsx(HighlightOffRounded, { sx: { fontSize: 20 } }),
615
+ custom: jsx(InfoOutlineRounded, { sx: { fontSize: 20 } }),
616
+ };
617
+ const severityMap = {
618
+ info: 'info',
619
+ success: 'success',
620
+ warning: 'warning',
621
+ error: 'error',
622
+ custom: 'info',
623
+ };
624
+ return (jsx(StyledAlert, { customvariant: variant, severity: severityMap[variant], icon: icon ? iconMap[variant] : false, className: className, sx: sx, children: children }));
625
+ };
626
+
627
+ const NoteContainer = styled$1(Box)({
628
+ position: 'relative',
629
+ maxWidth: '100%',
630
+ });
631
+ const EditButton = styled$1(IconButton)(({ theme }) => ({
632
+ position: 'absolute',
633
+ right: -4,
634
+ top: '50%',
635
+ transform: 'translateY(-50%)',
636
+ width: 24,
637
+ height: 24,
638
+ backgroundColor: '#4D3019',
639
+ opacity: 0,
640
+ transition: 'all 0.2s ease',
641
+ boxShadow: '0 1px 3px rgba(0,0,0,0.12)',
642
+ '&:hover': {
643
+ backgroundColor: '#4D3019',
644
+ transform: 'translateY(-50%) scale(1.1)',
645
+ },
646
+ }));
647
+ const HighlightWrapper = styled$1(Box)(({ isHovered, highlightColor, highlightSelectedColor, isCustom }) => ({
648
+ position: 'relative',
649
+ display: 'inline-block',
650
+ maxWidth: '100%',
651
+ '&:hover .edit-button': {
652
+ opacity: 1,
653
+ },
654
+ '& .highlight-span': {
655
+ background: isCustom ? highlightColor : (isHovered ? highlightSelectedColor : highlightColor),
656
+ padding: '2px 4px',
657
+ boxDecorationBreak: 'clone',
658
+ WebkitBoxDecorationBreak: 'clone',
659
+ transition: isCustom ? 'none' : 'background 0.2s ease',
660
+ cursor: isCustom ? 'default' : 'pointer',
661
+ fontSize: '13px',
662
+ wordWrap: 'break-word',
663
+ overflowWrap: 'break-word',
664
+ display: 'inline',
665
+ color: '#4D3019',
666
+ },
667
+ }));
668
+ const NoteBox = ({ variant = 'default', label, children, className = '', onEditClick, }) => {
669
+ const [isHovered, setIsHovered] = useState(false);
670
+ const variants = {
671
+ default: {
672
+ highlight: '#FFEACD',
673
+ highlightSelected: '#FFC365',
674
+ label: '',
675
+ labelColor: '',
676
+ },
677
+ mandatory: {
678
+ highlight: '#FFEACD',
679
+ highlightSelected: '#FFC365',
680
+ label: 'Not Answered (Mandatory)',
681
+ labelColor: 'var(--color-secondary)',
682
+ },
683
+ optional: {
684
+ highlight: '#FFF6D1',
685
+ highlightSelected: '#FDE58E',
686
+ label: 'Not Answered (Optional)',
687
+ labelColor: 'var(--color-secondary)',
688
+ },
689
+ pending: {
690
+ highlight: '#F5E2FF',
691
+ highlightSelected: '#EBC7FF',
692
+ label: 'Pending',
693
+ labelColor: 'var(--color-secondary)',
694
+ },
695
+ accepted: {
696
+ highlight: '#EDF9CD',
697
+ highlightSelected: '#DBF59A',
698
+ label: 'Accepted',
699
+ labelColor: '#2D5016',
700
+ },
701
+ 'action-required': {
702
+ highlight: '#FBEEEE',
703
+ highlightSelected: '#FFBCB3',
704
+ label: 'Action required before approval',
705
+ labelColor: '#CC0000',
706
+ },
707
+ custom: {
708
+ highlight: '#D9EDF8',
709
+ highlightSelected: '#B3E0F2',
710
+ label: 'Custom Text',
711
+ labelColor: 'var(--color-secondary)',
712
+ },
713
+ };
714
+ const style = variants[variant];
715
+ const displayLabel = label || style.label;
716
+ return (jsxs(NoteContainer, { className: className, children: [displayLabel && (jsx(Box, { sx: { mb: 1 }, children: jsx(Typography, { component: "span", sx: {
717
+ fontSize: '13px',
718
+ fontWeight: 500,
719
+ color: style.labelColor || 'rgba(0, 0, 0, 0.6)',
720
+ }, 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) => {
721
+ e.stopPropagation();
722
+ if (onEditClick) {
723
+ onEditClick();
724
+ }
725
+ }, title: "Edit variable highlight", size: "small", children: jsx(EditRounded, { sx: { fontSize: 14, color: "#FFFFFF", strokeWidth: 2 } }) })] })] }));
726
+ };
727
+
728
+ const StyledDialog$1 = styled$1(Dialog)(({ theme }) => ({
729
+ '& .MuiDialog-paper': {
730
+ borderRadius: theme.shape.borderRadius,
731
+ maxWidth: '896px',
732
+ width: '100%',
733
+ maxHeight: '90vh',
734
+ },
735
+ }));
736
+ const NavButton = styled$1(IconButton)(({ theme }) => ({
737
+ width: '40px',
738
+ height: '40px',
739
+ border: `2px solid ${theme.palette.dark.main}`,
740
+ backgroundColor: theme.palette.light.main,
741
+ '&:hover': {
742
+ backgroundColor: theme.palette.dark.main,
743
+ color: theme.palette.light.main,
744
+ },
745
+ }));
746
+ const Modal = ({ isOpen, onClose, status, description, defaultText, note, acceptSuggestion: initialAcceptSuggestion = true, onAcceptSuggestionChange, onSave, onSubmit, onPrevious, onNext, currentPage = 1, totalPages = 1, }) => {
747
+ const [textValue, setTextValue] = useState(defaultText);
748
+ const [acceptSuggestion, setAcceptSuggestion] = useState(initialAcceptSuggestion);
749
+ const handleAcceptSuggestionChange = (checked) => {
750
+ setAcceptSuggestion(checked);
751
+ onAcceptSuggestionChange?.(checked);
752
+ };
753
+ const statusConfig = {
754
+ mandatory: {
755
+ color: '#F5A623',
756
+ label: 'Mandatory',
757
+ },
758
+ optional: {
759
+ color: '#F5D76E',
760
+ label: 'Optional',
761
+ },
762
+ accepted: {
763
+ color: '#A3D977',
764
+ label: 'Accepted',
765
+ },
766
+ 'action-required': {
767
+ color: '#F56B6B',
768
+ label: 'Action Required',
769
+ },
770
+ 'action-required-note': {
771
+ color: '#F56B6B',
772
+ label: 'Action Required',
773
+ },
774
+ 'accepted-note': {
775
+ color: '#A3D977',
776
+ label: 'Accepted',
777
+ },
778
+ };
779
+ const statusStyle = statusConfig[status];
780
+ return (jsxs(StyledDialog$1, { open: isOpen, onClose: onClose, maxWidth: "md", fullWidth: true, children: [jsx(IconButton, { onClick: onClose, sx: {
781
+ position: 'absolute',
782
+ top: 16,
783
+ right: 16,
784
+ zIndex: 1,
785
+ }, 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: {
786
+ backgroundColor: statusStyle.color,
787
+ color: status === 'optional' ? '#4D3019' : '#fff',
788
+ fontWeight: 600,
789
+ fontSize: '0.875rem',
790
+ height: 'auto',
791
+ py: 1,
792
+ px: 2,
793
+ } }) }), jsx(Typography, { sx: { mb: 3, lineHeight: 1.6 }, children: description }), status === 'action-required-note' && note && (jsx(Alert$1, { icon: jsx(ErrorOutlineRounded, { sx: { fontSize: 20 } }), severity: "error", sx: {
794
+ mb: 2,
795
+ backgroundColor: '#FFE6E6',
796
+ borderLeft: '4px solid #F56B6B',
797
+ '& .MuiAlert-icon': {
798
+ color: '#F56B6B',
799
+ },
800
+ '& .MuiAlert-message': {
801
+ color: '#4D3019',
802
+ },
803
+ }, children: note })), status === 'accepted-note' && note && (jsx(Alert$1, { icon: jsx(StickyNote2Rounded, { sx: { fontSize: 20 } }), severity: "warning", sx: {
804
+ mb: 2,
805
+ backgroundColor: '#FFF9E6',
806
+ borderLeft: '4px solid #F5D76E',
807
+ '& .MuiAlert-icon': {
808
+ color: '#F5A623',
809
+ },
810
+ '& .MuiAlert-message': {
811
+ color: '#4D3019',
812
+ },
813
+ }, children: note })), jsx(TextField, { multiline: true, rows: 4, fullWidth: true, value: textValue, onChange: (e) => setTextValue(e.target.value), disabled: acceptSuggestion, sx: {
814
+ mb: 2,
815
+ '& .MuiOutlinedInput-root': {
816
+ backgroundColor: acceptSuggestion ? 'rgba(0, 0, 0, 0.05)' : '#fff',
817
+ },
818
+ } }), jsx(FormControlLabel, { control: jsx(Checkbox$1, { checked: acceptSuggestion, onChange: (e) => handleAcceptSuggestionChange(e.target.checked) }), label: "Accept suggestion", sx: { mb: 4 } }), jsxs(Box, { sx: {
819
+ display: 'flex',
820
+ flexDirection: { xs: 'column', sm: 'row' },
821
+ alignItems: { xs: 'stretch', sm: 'center' },
822
+ justifyContent: 'space-between',
823
+ gap: 2,
824
+ pt: 3,
825
+ borderTop: '1px solid',
826
+ borderColor: 'divider',
827
+ }, 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" })] }), jsxs(Box, { sx: {
828
+ display: 'flex',
829
+ alignItems: 'center',
830
+ gap: 2,
831
+ justifyContent: { xs: 'space-between', sm: 'flex-end' },
832
+ }, 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] })] })] })] })] }));
833
+ };
834
+
835
+ const StyledConcertina = styled$1(Box)(({ theme }) => ({
836
+ width: '100%',
837
+ display: 'flex',
838
+ flexDirection: 'column',
839
+ gap: theme.spacing(1), // space-y-2
840
+ }));
841
+ const StyledSection = styled$1(Box)(({ theme }) => ({
842
+ border: `1px solid ${theme.palette.grey[200]}`, // border-gray-200
843
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
844
+ ? parseInt(theme.shape.borderRadius, 10)
845
+ : theme.shape.borderRadius || 4) * 2, // rounded-lg
846
+ overflow: 'hidden',
847
+ }));
848
+ const StyledHeader$1 = styled$1(Box)(({ theme }) => ({
849
+ display: 'flex',
850
+ alignItems: 'center',
851
+ justifyContent: 'space-between',
852
+ padding: theme.spacing(3), // p-3 sm:p-4 md:p-6
853
+ cursor: 'pointer',
854
+ transition: 'background-color 0.2s',
855
+ gap: theme.spacing(2), // gap-2
856
+ '&:hover': {
857
+ backgroundColor: theme.palette.light.main, // hover:bg-[#FDFCEE]
858
+ },
859
+ [theme.breakpoints.up('sm')]: {
860
+ padding: theme.spacing(4),
861
+ },
862
+ [theme.breakpoints.up('md')]: {
863
+ padding: theme.spacing(6),
864
+ },
865
+ }));
866
+ const StyledTitleWrapper = styled$1(Box)(({ theme }) => ({
867
+ display: 'flex',
868
+ alignItems: 'center',
869
+ gap: theme.spacing(3), // sm:gap-3
870
+ flex: 1,
871
+ minWidth: 0,
872
+ [theme.breakpoints.down('sm')]: {
873
+ gap: theme.spacing(2), // gap-2
874
+ },
875
+ }));
876
+ const StyledTitle = styled$1(Typography, {
877
+ shouldForwardProp: (prop) => prop !== 'isHovered',
878
+ })(({ theme, isHovered }) => ({
879
+ fontWeight: 700, // font-bold
880
+ fontSize: '1.5rem', // text-2xl
881
+ lineHeight: 1.2, // leading-tight
882
+ color: theme.palette.dark.main, // text-[#4D3019]
883
+ wordBreak: 'break-word', // break-words
884
+ position: 'relative',
885
+ '&:after': {
886
+ content: '""',
887
+ position: 'absolute',
888
+ bottom: 0,
889
+ left: 0,
890
+ width: '100%',
891
+ height: 1,
892
+ backgroundColor: theme.palette.accent.main, // bg-orange-500
893
+ display: isHovered ? 'block' : 'none',
894
+ },
895
+ [theme.breakpoints.down('lg')]: {
896
+ fontSize: '1.25rem', // lg:text-[28px]
897
+ },
898
+ [theme.breakpoints.down('md')]: {
899
+ fontSize: '1.125rem', // md:text-xl
900
+ },
901
+ [theme.breakpoints.down('sm')]: {
902
+ fontSize: '1rem', // sm:text-lg
903
+ },
904
+ }));
905
+ const StyledLinkButton = styled$1(IconButton)(({ theme }) => ({
906
+ color: theme.palette.accent.main, // text-orange-500
907
+ '&:hover': {
908
+ color: theme.palette.accent.dark || theme.palette.accent.main, // hover:text-orange-600
909
+ },
910
+ padding: 0,
911
+ }));
912
+ const StyledTooltip = styled$1(Box)(({ theme }) => ({
913
+ position: 'absolute',
914
+ top: -40, // -top-10
915
+ left: '50%',
916
+ transform: 'translateX(-50%)',
917
+ backgroundColor: theme.palette.grey[900], // bg-gray-900
918
+ color: theme.palette.common.white, // text-white
919
+ fontSize: '0.75rem', // text-xs
920
+ padding: theme.spacing(1, 2), // px-2 py-1
921
+ borderRadius: theme.shape.borderRadius, // rounded
922
+ whiteSpace: 'nowrap',
923
+ zIndex: 10,
924
+ [theme.breakpoints.up('sm')]: {
925
+ fontSize: '0.875rem', // sm:text-sm
926
+ padding: theme.spacing(1.5, 3), // sm:px-3 sm:py-1.5
927
+ },
928
+ }));
929
+ const StyledChevron = styled$1(ExpandMoreRounded)(({ theme }) => ({
930
+ color: theme.palette.grey[500], // text-gray-500
931
+ transition: 'transform 0.2s', // transition-transform duration-200
932
+ width: 24, // sm:w-6
933
+ height: 24, // sm:h-6
934
+ [theme.breakpoints.down('sm')]: {
935
+ width: 20,
936
+ height: 20,
937
+ },
938
+ }));
939
+ const StyledContent = styled$1(Box)(({ theme }) => ({
940
+ padding: theme.spacing(2, 3, 3), // px-3 pb-3 pt-2
941
+ [theme.breakpoints.up('sm')]: {
942
+ padding: theme.spacing(2, 4, 4), // sm:px-4 sm:pb-4
943
+ },
944
+ [theme.breakpoints.up('md')]: {
945
+ padding: theme.spacing(2, 6, 6), // md:px-6 md:pb-6
946
+ },
947
+ }));
948
+ const StyledContentText = styled$1(Typography)(({ theme }) => ({
949
+ color: theme.palette.dark.main, // text-[#4D3019]
950
+ lineHeight: 1.5, // leading-relaxed
951
+ wordBreak: 'break-word', // break-words
952
+ fontSize: 13, // style={{ fontSize: '13px' }}
953
+ }));
954
+ function Concertina({ sections }) {
955
+ const [openSections, setOpenSections] = useState(new Set());
956
+ const [hoveredTitle, setHoveredTitle] = useState(null);
957
+ const [copiedId, setCopiedId] = useState(null);
958
+ const toggleSection = (id) => {
959
+ const newOpenSections = new Set(openSections);
960
+ if (newOpenSections.has(id)) {
961
+ newOpenSections.delete(id);
962
+ }
963
+ else {
964
+ newOpenSections.add(id);
965
+ }
966
+ setOpenSections(newOpenSections);
967
+ };
968
+ const copyJumpLink = (id, e) => {
969
+ e.stopPropagation();
970
+ const url = `${window.location.origin}${window.location.pathname}#${id}`;
971
+ navigator.clipboard.writeText(url);
972
+ setCopiedId(id);
973
+ setTimeout(() => setCopiedId(null), 2000);
974
+ };
975
+ 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))) }));
976
+ }
977
+
978
+ const ReadByContainer = styled$1(Box)(({ theme }) => ({
979
+ display: 'flex',
980
+ flexDirection: 'row',
981
+ alignItems: 'flex-start',
982
+ gap: theme.spacing(2),
983
+ padding: theme.spacing(2),
984
+ borderLeft: `4px solid ${theme.palette.primary.main}`,
985
+ borderRadius: '0 8px 8px 0',
986
+ backgroundColor: theme.palette.custom?.readByBackgroundColor || theme.palette.accent.main,
987
+ [theme.breakpoints.down('sm')]: {
988
+ flexDirection: 'column',
989
+ padding: theme.spacing(1.5),
990
+ },
991
+ }));
992
+ const ExpandButton = styled$1(IconButton)(({ theme }) => ({
993
+ width: 32,
994
+ height: 32,
995
+ backgroundColor: '#4d3019',
996
+ color: '#fff',
997
+ flexShrink: 0,
998
+ '&:hover': {
999
+ backgroundColor: '#4d3019',
1000
+ opacity: 0.8,
1001
+ },
1002
+ [theme.breakpoints.down('sm')]: {
1003
+ alignSelf: 'flex-end',
1004
+ },
1005
+ }));
1006
+ const ReadBy = ({ names }) => {
1007
+ const { theme } = useTheme();
1008
+ const [isExpanded, setIsExpanded] = useState(false);
1009
+ const displayText = isExpanded
1010
+ ? names.join(', ')
1011
+ : names.length > 5
1012
+ ? `${names.slice(0, 5).join(', ')}...`
1013
+ : names.join(', ');
1014
+ return (jsxs(ReadByContainer, { children: [jsxs(Box, { sx: { flex: 1, minWidth: 0, wordBreak: 'break-word' }, children: [jsx(Typography, { component: "span", sx: {
1015
+ fontSize: { xs: '13px', sm: '14px' },
1016
+ fontWeight: 700,
1017
+ color: theme.palette.dark.main,
1018
+ }, children: "Read by:" }), jsx(Typography, { component: "span", sx: {
1019
+ fontSize: { xs: '13px', sm: '14px' },
1020
+ color: theme.palette.dark.main,
1021
+ ml: 1,
1022
+ }, 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 } })) }))] }));
1023
+ };
1024
+
1025
+ const StatusBarContainer = styled$1(Box)(({ theme }) => ({
1026
+ width: '100%',
1027
+ backgroundColor: '#F5C98E',
1028
+ padding: theme.spacing(1.5, 3),
1029
+ display: 'flex',
1030
+ alignItems: 'center',
1031
+ justifyContent: 'space-between',
1032
+ gap: theme.spacing(3),
1033
+ flexDirection: 'row',
1034
+ [theme.breakpoints.down('sm')]: {
1035
+ flexDirection: 'column',
1036
+ padding: theme.spacing(1.25, 2),
1037
+ },
1038
+ }));
1039
+ const ContentWrapper = styled$1(Box)(({ theme }) => ({
1040
+ display: 'flex',
1041
+ alignItems: 'center',
1042
+ gap: theme.spacing(1.5),
1043
+ flex: 1,
1044
+ minWidth: 0,
1045
+ justifyContent: 'flex-start',
1046
+ [theme.breakpoints.down('sm')]: {
1047
+ justifyContent: 'center',
1048
+ gap: theme.spacing(1),
1049
+ },
1050
+ }));
1051
+ const NextButton = styled$1(IconButton)(({ theme }) => ({
1052
+ width: 40,
1053
+ height: 40,
1054
+ border: `2px solid rgba(77, 48, 25, 0.25)`,
1055
+ backgroundColor: '#fff',
1056
+ '&:hover': {
1057
+ backgroundColor: '#4D3019',
1058
+ color: '#fff',
1059
+ },
1060
+ [theme.breakpoints.down('sm')]: {
1061
+ width: 36,
1062
+ height: 36,
1063
+ },
1064
+ }));
1065
+ const StatusBar = ({ itemCount, variant = 'actionstarted', onTailorClick, onNextClick }) => {
1066
+ const message = `There are ${itemCount} items that need attention.`;
1067
+ return (jsxs(StatusBarContainer, { children: [jsxs(ContentWrapper, { children: [jsx(PieChartRounded, { sx: {
1068
+ fontSize: 24,
1069
+ color: "#4D3019",
1070
+ flexShrink: 0,
1071
+ } }), jsx(Typography, { sx: {
1072
+ fontSize: { xs: '14px', sm: '15px', md: '16px' },
1073
+ color: '#4D3019',
1074
+ wordBreak: 'break-word',
1075
+ textAlign: { xs: 'center', sm: 'left' },
1076
+ }, 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" }) }))] }));
1077
+ };
1078
+
1079
+ const TabsContainer = styled$1(Box)({
1080
+ display: 'none',
1081
+ '@media (min-width: 900px)': {
1082
+ display: 'block',
1083
+ },
1084
+ });
1085
+ const TabButtonsWrapper = styled$1(Box)({
1086
+ display: 'flex',
1087
+ gap: '4px',
1088
+ backgroundColor: '#FDFCEE',
1089
+ });
1090
+ const TabButton = styled$1(Button$1)(({ theme, isActive }) => ({
1091
+ padding: theme.spacing(2, 3),
1092
+ fontSize: '16px',
1093
+ fontWeight: 500,
1094
+ textTransform: 'none',
1095
+ color: isActive ? '#4D3019' : '#826E5C',
1096
+ backgroundColor: isActive ? theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main : 'transparent',
1097
+ borderRadius: 0,
1098
+ position: 'relative',
1099
+ minWidth: 'auto',
1100
+ '&:hover': {
1101
+ backgroundColor: isActive ? theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main : 'rgba(77, 48, 25, 0.05)',
1102
+ color: '#4D3019',
1103
+ },
1104
+ '&::after': isActive ? {
1105
+ content: '""',
1106
+ position: 'absolute',
1107
+ bottom: 0,
1108
+ left: 0,
1109
+ right: 0,
1110
+ height: '4px',
1111
+ backgroundColor: theme.palette.primary.main,
1112
+ } : {},
1113
+ }));
1114
+ const TabContent = styled$1(Box)(({ theme }) => ({
1115
+ padding: theme.spacing(3),
1116
+ color: '#4D3019',
1117
+ backgroundColor: theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main,
1118
+ }));
1119
+ const MobileContainer = styled$1(Box)({
1120
+ backgroundColor: '#FDFCEE',
1121
+ '@media (min-width: 900px)': {
1122
+ display: 'none',
1123
+ },
1124
+ });
1125
+ const MobileTabButton = styled$1(Button$1)(({ theme, isExpanded }) => ({
1126
+ width: '100%',
1127
+ display: 'flex',
1128
+ alignItems: 'center',
1129
+ justifyContent: 'space-between',
1130
+ padding: theme.spacing(2, 2),
1131
+ textAlign: 'left',
1132
+ textTransform: 'none',
1133
+ borderRadius: 0,
1134
+ backgroundColor: isExpanded ? theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main : 'transparent',
1135
+ '&:hover': {
1136
+ backgroundColor: isExpanded ? theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main : 'rgba(77, 48, 25, 0.05)',
1137
+ },
1138
+ }));
1139
+ const MobileTabContent = styled$1(Box)(({ theme }) => ({
1140
+ padding: theme.spacing(2, 2, 3, 2),
1141
+ color: '#4D3019',
1142
+ backgroundColor: theme.palette.custom?.tabBackgroundColor || theme.palette.accent.main,
1143
+ }));
1144
+ const Tabs = ({ tabs, defaultTab }) => {
1145
+ const [activeTab, setActiveTab] = useState(defaultTab || tabs[0]?.id);
1146
+ const [mobileExpandedTab, setMobileExpandedTab] = useState(null);
1147
+ const activeTabContent = tabs.find(tab => tab.id === activeTab)?.content;
1148
+ const handleMobileTabClick = (tabId) => {
1149
+ setActiveTab(tabId);
1150
+ setMobileExpandedTab(mobileExpandedTab === tabId ? null : tabId);
1151
+ };
1152
+ 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: {
1153
+ borderTop: index !== 0 ? '2px solid #e5e7eb' : 'none',
1154
+ }, children: [jsxs(MobileTabButton, { onClick: () => handleMobileTabClick(tab.id), isExpanded: mobileExpandedTab === tab.id, children: [jsx(Box, { component: "span", sx: {
1155
+ fontSize: '16px',
1156
+ fontWeight: 500,
1157
+ color: activeTab === tab.id ? '#4D3019' : '#826E5C',
1158
+ }, children: tab.label }), jsx(ExpandMoreRounded, { sx: {
1159
+ fontSize: 20,
1160
+ color: activeTab === tab.id ? '#4D3019' : '#826E5C',
1161
+ transform: mobileExpandedTab === tab.id ? 'rotate(180deg)' : 'rotate(0deg)',
1162
+ transition: 'transform 0.2s',
1163
+ } })] }), jsx(Collapse, { in: mobileExpandedTab === tab.id, children: jsx(MobileTabContent, { children: tab.content }) })] }, tab.id))) })] }));
1164
+ };
1165
+
1166
+ const SidebarContainer = styled$1(Box)(({ theme, isOpen }) => ({
1167
+ height: '100vh',
1168
+ position: 'sticky',
1169
+ top: 0,
1170
+ backgroundColor: '#fff',
1171
+ borderRight: `1px solid ${theme.palette.dark.main}1A`,
1172
+ flexShrink: 0,
1173
+ transition: 'all 0.3s ease-in-out',
1174
+ width: isOpen ? '288px' : '64px',
1175
+ zIndex: 50,
1176
+ [theme.breakpoints.down('md')]: {
1177
+ position: 'fixed',
1178
+ left: isOpen ? 0 : '-288px',
1179
+ width: '288px',
1180
+ },
1181
+ [theme.breakpoints.up('sm')]: {
1182
+ width: isOpen ? '288px' : '80px',
1183
+ },
1184
+ }));
1185
+ const ToggleButton$1 = styled$1(IconButton)(({ theme }) => ({
1186
+ width: 40,
1187
+ height: 40,
1188
+ borderRadius: theme.shape.borderRadius,
1189
+ backgroundColor: '#4D3019',
1190
+ color: '#fff',
1191
+ '&:hover': {
1192
+ backgroundColor: '#3d2614',
1193
+ },
1194
+ }));
1195
+ const MenuItemButton = styled$1(ListItemButton)(({ theme, isActive, isOpen }) => ({
1196
+ borderRadius: theme.shape.borderRadius,
1197
+ padding: isOpen ? '10px 8px' : '12px 0',
1198
+ justifyContent: isOpen ? 'flex-start' : 'center',
1199
+ gap: isOpen ? theme.spacing(1) : 0,
1200
+ '&:hover': {
1201
+ backgroundColor: `${theme.palette.dark.main}0D`,
1202
+ },
1203
+ ...(isActive && {
1204
+ backgroundColor: `${theme.palette.dark.main}1A`,
1205
+ }),
1206
+ }));
1207
+ const IconWrapper = styled$1(Box)(({ theme, isOpen }) => ({
1208
+ width: isOpen ? 32 : 40,
1209
+ height: isOpen ? 32 : 40,
1210
+ borderRadius: theme.shape.borderRadius,
1211
+ display: 'flex',
1212
+ alignItems: 'center',
1213
+ justifyContent: 'center',
1214
+ flexShrink: 0,
1215
+ backgroundColor: theme.palette.custom?.iconColor || theme.palette.accent.main,
1216
+ }));
1217
+ const Sidebar = ({ isOpen, onToggle, centreName = "Centre name goes here \n across two lines", activePage = 'dashboard', onPageChange }) => {
1218
+ const { theme } = useTheme();
1219
+ const [expandedItems, setExpandedItems] = useState([]);
1220
+ const [expandedSubItems, setExpandedSubItems] = useState([]);
1221
+ const handlePageClick = (pageId) => {
1222
+ if (onPageChange) {
1223
+ onPageChange(pageId);
1224
+ }
1225
+ };
1226
+ const menuItems = [
1227
+ {
1228
+ id: 'dashboard',
1229
+ label: 'Dashboard',
1230
+ icon: jsx(HomeRounded, { sx: { fontSize: 20, color: "#4D3019" } }),
1231
+ },
1232
+ {
1233
+ id: 'policies',
1234
+ label: 'Policies',
1235
+ icon: jsx(TextSnippetRounded, { sx: { fontSize: 20, color: "#4D3019" } }),
1236
+ hasChildren: true,
1237
+ children: [
1238
+ { id: 'legislation', label: 'Legislation' },
1239
+ { id: 'service-assurances', label: 'Service Assurances / Compliance Checklist' },
1240
+ {
1241
+ id: 'governance',
1242
+ label: 'Governance, Management, and Administration',
1243
+ hasChildren: true,
1244
+ children: [
1245
+ 'Philosophy and Values',
1246
+ 'Te Tiriti o Waitangi – policy options',
1247
+ 'Self-Review and Internal Evaluation',
1248
+ ],
1249
+ },
1250
+ {
1251
+ id: 'curriculum',
1252
+ label: 'Curriculum and Learning V1',
1253
+ hasChildren: true,
1254
+ children: [],
1255
+ },
1256
+ ],
1257
+ },
1258
+ {
1259
+ id: 'support',
1260
+ label: 'Support',
1261
+ icon: jsx(HelpOutlineRounded, { sx: { fontSize: 20, color: "#4D3019" } }),
1262
+ },
1263
+ ];
1264
+ const toggleItem = (itemId) => {
1265
+ if (!isOpen) {
1266
+ onToggle();
1267
+ setExpandedItems([itemId]);
1268
+ }
1269
+ else {
1270
+ setExpandedItems((prev) => prev.includes(itemId) ? prev.filter((id) => id !== itemId) : [...prev, itemId]);
1271
+ }
1272
+ };
1273
+ const toggleSubItem = (subItemId) => {
1274
+ setExpandedSubItems((prev) => prev.includes(subItemId) ? prev.filter((id) => id !== subItemId) : [...prev, subItemId]);
1275
+ };
1276
+ return (jsxs(Fragment, { children: [isOpen && (jsx(Box, { sx: {
1277
+ position: 'fixed',
1278
+ inset: 0,
1279
+ bgcolor: 'rgba(0, 0, 0, 0.5)',
1280
+ zIndex: 40,
1281
+ display: { xs: 'block', md: 'none' },
1282
+ }, onClick: onToggle })), jsx(SidebarContainer, { isOpen: isOpen, children: jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', height: '100%' }, children: [isOpen && (jsxs(Box, { sx: {
1283
+ px: 2,
1284
+ py: 3,
1285
+ borderBottom: `1px solid ${theme.palette.dark.main}1A`,
1286
+ flexShrink: 0,
1287
+ position: 'relative',
1288
+ }, children: [jsx(Typography, { variant: "h6", sx: {
1289
+ fontSize: '18px',
1290
+ fontWeight: 700,
1291
+ color: '#4D3019',
1292
+ lineHeight: 1.3,
1293
+ whiteSpace: 'pre-line',
1294
+ pr: 7,
1295
+ }, 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: {
1296
+ px: 1,
1297
+ py: 3,
1298
+ borderBottom: `1px solid ${theme.palette.dark.main}1A`,
1299
+ display: 'flex',
1300
+ justifyContent: 'center',
1301
+ }, children: jsx(ToggleButton$1, { onClick: onToggle, "aria-label": "Expand sidebar", children: jsx(ChevronRightRounded, { sx: { fontSize: 20 } }) }) })), jsx(Box, { sx: {
1302
+ flex: 1,
1303
+ overflowY: 'auto',
1304
+ px: isOpen ? 1.5 : 1,
1305
+ py: 3,
1306
+ }, 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: () => {
1307
+ if (item.hasChildren) {
1308
+ toggleItem(item.id);
1309
+ }
1310
+ else {
1311
+ if (!isOpen) {
1312
+ onToggle();
1313
+ }
1314
+ handlePageClick(item.id);
1315
+ }
1316
+ }, title: !isOpen ? item.label : undefined, children: [jsx(IconWrapper, { isOpen: isOpen, children: item.icon }), isOpen && (jsxs(Fragment, { children: [jsx(ListItemText, { primary: item.label, primaryTypographyProps: {
1317
+ fontSize: '1rem',
1318
+ fontWeight: 600,
1319
+ }, 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: {
1320
+ flex: 1,
1321
+ pl: 8,
1322
+ py: 1.25,
1323
+ borderRadius: `${theme.shape.borderRadius}px 0 0 ${theme.shape.borderRadius}px`,
1324
+ '&:hover': {
1325
+ backgroundColor: `${theme.palette.dark.main}0D`,
1326
+ },
1327
+ ...(activePage === subItem.id && {
1328
+ backgroundColor: `${theme.palette.dark.main}1A`,
1329
+ }),
1330
+ }, children: jsx(ListItemText, { primary: subItem.label, primaryTypographyProps: {
1331
+ fontSize: '0.875rem',
1332
+ } }) }), subItem.hasChildren && subItem.children && subItem.children.length > 0 && (jsx(IconButton, { onClick: () => toggleSubItem(subItem.id), sx: {
1333
+ px: 1,
1334
+ borderRadius: `0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px 0`,
1335
+ '&:hover': {
1336
+ backgroundColor: `${theme.palette.dark.main}0D`,
1337
+ },
1338
+ }, children: jsx(ChevronRightRounded, { sx: {
1339
+ fontSize: 16,
1340
+ color: '#4D3019',
1341
+ transition: 'transform 0.2s',
1342
+ transform: expandedSubItems.includes(subItem.id) ? 'rotate(90deg)' : 'rotate(0deg)',
1343
+ } }) }))] }), 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) => {
1344
+ const nestedPageId = `${subItem.id}-${index}`;
1345
+ return (jsx(ListItemButton, { onClick: () => handlePageClick(nestedPageId), sx: {
1346
+ pl: 10,
1347
+ py: 1,
1348
+ borderRadius: theme.shape.borderRadius,
1349
+ '&:hover': {
1350
+ backgroundColor: `${theme.palette.dark.main}0D`,
1351
+ },
1352
+ ...(activePage === nestedPageId && {
1353
+ backgroundColor: `${theme.palette.dark.main}1A`,
1354
+ }),
1355
+ }, children: jsx(ListItemText, { primary: nestedItem, primaryTypographyProps: {
1356
+ fontSize: '0.875rem',
1357
+ } }) }, index));
1358
+ }) }) }))] }, subItem.id))) }) }))] }, item.id))) }) })] }) })] }));
1359
+ };
1360
+
1361
+ const StyledHeader = styled$1(Box)(({ theme }) => ({
1362
+ padding: theme.spacing(1.5, 4), // px-4 py-3
1363
+ display: 'flex',
1364
+ alignItems: 'center',
1365
+ justifyContent: 'space-between',
1366
+ gap: theme.spacing(2), // gap-2
1367
+ backgroundColor: theme.palette.primary.main, // var(--color-primary)
1368
+ [theme.breakpoints.up('sm')]: {
1369
+ padding: theme.spacing(2, 6), // sm:px-6
1370
+ },
1371
+ [theme.breakpoints.up('md')]: {
1372
+ padding: theme.spacing(2, 8), // md:px-8
1373
+ gap: theme.spacing(4), // md:gap-4
1374
+ },
1375
+ }));
1376
+ const StyledLogoWrapper = styled$1(Box)(({ theme }) => ({
1377
+ display: 'flex',
1378
+ alignItems: 'center',
1379
+ gap: theme.spacing(2), // md:gap-2
1380
+ [theme.breakpoints.down('md')]: {
1381
+ gap: theme.spacing(1.5), // gap-1.5
1382
+ },
1383
+ }));
1384
+ const StyledLogoIcon = styled$1(Box)(({ theme }) => ({
1385
+ width: 32, // md:w-8 md:h-8
1386
+ height: 32,
1387
+ color: theme.palette.light.main, // text-[#FDFCEE]
1388
+ [theme.breakpoints.down('md')]: {
1389
+ width: 24, // w-6
1390
+ height: 24, // h-6
1391
+ },
1392
+ }));
1393
+ const StyledLogoText = styled$1(Typography)(({ theme }) => ({
1394
+ color: theme.palette.light.main, // text-[#FDFCEE]
1395
+ fontWeight: 700, // font-bold
1396
+ letterSpacing: '0.05em', // tracking-wide
1397
+ fontSize: '1.5rem', // text-2xl
1398
+ [theme.breakpoints.down('md')]: {
1399
+ fontSize: '1.25rem', // sm:text-xl
1400
+ },
1401
+ [theme.breakpoints.down('sm')]: {
1402
+ fontSize: '1.125rem', // text-lg
1403
+ },
1404
+ }));
1405
+ const StyledSearchContainer = styled$1(Box)(({ theme }) => ({
1406
+ flex: 1,
1407
+ maxWidth: '32rem', // max-w-2xl
1408
+ margin: theme.spacing(0, 8), // mx-8
1409
+ position: 'relative',
1410
+ [theme.breakpoints.down('md')]: {
1411
+ margin: theme.spacing(0, 4), // sm:mx-4
1412
+ },
1413
+ [theme.breakpoints.down('sm')]: {
1414
+ margin: theme.spacing(0, 2), // mx-2
1415
+ },
1416
+ }));
1417
+ const StyledTextField = styled$1(TextField)(({ theme }) => ({
1418
+ '& .MuiInputBase-root': {
1419
+ backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]
1420
+ color: theme.palette.dark.main, // text-[#4D3019]
1421
+ borderRadius: '9999px', // rounded-full
1422
+ paddingRight: theme.spacing(6), // pr-12
1423
+ fontSize: '1rem', // text-base
1424
+ [theme.breakpoints.down('md')]: {
1425
+ paddingRight: theme.spacing(5), // sm:pr-10
1426
+ fontSize: '0.875rem', // text-sm
1427
+ },
1428
+ },
1429
+ '& .MuiInputBase-input': {
1430
+ padding: theme.spacing(1.5, 3), // px-4 py-2
1431
+ [theme.breakpoints.up('md')]: {
1432
+ padding: theme.spacing(1.5, 4), // md:px-6 md:py-3
1433
+ },
1434
+ [theme.breakpoints.down('sm')]: {
1435
+ padding: theme.spacing(1.5, 2.5), // sm:px-5
1436
+ },
1437
+ },
1438
+ '& .MuiInputBase-input::placeholder': {
1439
+ color: `${theme.palette.dark.main}99`, // placeholder-[#4D3019]/60
1440
+ opacity: 1,
1441
+ },
1442
+ '& .MuiInputBase-root:focus-within': {
1443
+ outline: `2px solid ${theme.palette.light.main}`, // focus:ring-2 focus:ring-[#FDFCEE]
1444
+ outlineOffset: 0,
1445
+ },
1446
+ }));
1447
+ const StyledSearchButton = styled$1(IconButton)(({ theme }) => ({
1448
+ position: 'absolute',
1449
+ right: theme.spacing(2), // md:right-2
1450
+ top: '50%',
1451
+ transform: 'translateY(-50%)',
1452
+ width: theme.spacing(5), // md:w-10
1453
+ height: theme.spacing(5), // md:h-10
1454
+ borderRadius: '50%', // rounded-full
1455
+ backgroundColor: theme.palette.primary.main, // var(--color-primary)
1456
+ '&:hover': {
1457
+ opacity: 0.9, // hover:opacity-90
1458
+ backgroundColor: theme.palette.primary.main,
1459
+ },
1460
+ [theme.breakpoints.down('md')]: {
1461
+ right: theme.spacing(1), // right-1
1462
+ width: theme.spacing(4), // w-8
1463
+ height: theme.spacing(4), // h-8
1464
+ },
1465
+ }));
1466
+ const StyledSearchIcon = styled$1(Box)(({ theme }) => ({
1467
+ width: 20, // md:w-5 md:h-5
1468
+ height: 20,
1469
+ color: theme.palette.light.main, // text-[#FDFCEE]
1470
+ [theme.breakpoints.down('md')]: {
1471
+ width: 16, // w-4
1472
+ height: 16, // h-4
1473
+ },
1474
+ }));
1475
+ const StyledUserContainer = styled$1(Box)(({ theme }) => ({
1476
+ display: 'flex',
1477
+ alignItems: 'center',
1478
+ gap: theme.spacing(3), // md:gap-3
1479
+ [theme.breakpoints.down('md')]: {
1480
+ gap: theme.spacing(2), // gap-2
1481
+ },
1482
+ }));
1483
+ const StyledAvatar = styled$1(Box)(({ theme }) => ({
1484
+ width: theme.spacing(6), // md:w-12
1485
+ height: theme.spacing(6), // md:h-12
1486
+ borderRadius: '50%', // rounded-full
1487
+ backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]
1488
+ display: 'flex',
1489
+ alignItems: 'center',
1490
+ justifyContent: 'center',
1491
+ flexShrink: 0,
1492
+ [theme.breakpoints.down('md')]: {
1493
+ width: theme.spacing(5), // sm:w-10
1494
+ height: theme.spacing(5), // sm:h-10
1495
+ },
1496
+ [theme.breakpoints.down('sm')]: {
1497
+ width: theme.spacing(4), // w-8
1498
+ height: theme.spacing(4), // h-8
1499
+ },
1500
+ }));
1501
+ const StyledAvatarText = styled$1(Typography)(({ theme }) => ({
1502
+ color: theme.palette.dark.main, // text-[#4D3019]
1503
+ fontWeight: 700, // font-bold
1504
+ fontSize: '1.125rem', // text-lg
1505
+ [theme.breakpoints.down('md')]: {
1506
+ fontSize: '0.875rem', // text-sm
1507
+ },
1508
+ }));
1509
+ const StyledUserName = styled$1(Typography)(({ theme }) => ({
1510
+ color: theme.palette.light.main, // text-[#FDFCEE]
1511
+ fontWeight: 500, // font-medium
1512
+ fontSize: '1.125rem', // text-lg
1513
+ display: 'none', // hidden
1514
+ [theme.breakpoints.up('sm')]: {
1515
+ display: 'inline', // sm:inline
1516
+ },
1517
+ [theme.breakpoints.down('md')]: {
1518
+ fontSize: '0.875rem', // text-sm
1519
+ },
1520
+ }));
1521
+ const Header = ({ userName = 'John Doe', userInitials = 'JD', }) => {
1522
+ const { theme } = useTheme();
1523
+ 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: {
1524
+ endAdornment: (jsx(StyledSearchButton, { children: jsx(StyledSearchIcon, { children: jsx(SearchRounded, { sx: { fontSize: 20 } }) }) })),
1525
+ } }) }), jsxs(StyledUserContainer, { children: [jsx(StyledAvatar, { children: jsx(StyledAvatarText, { children: userInitials }) }), jsx(StyledUserName, { children: userName })] })] }));
1526
+ };
1527
+
1528
+ const Container = styled$1(Box)(({ theme }) => ({
1529
+ width: '100%',
1530
+ [theme.breakpoints.up('md')]: {
1531
+ position: 'sticky',
1532
+ right: 0,
1533
+ top: 0,
1534
+ width: '224px',
1535
+ float: 'right',
1536
+ marginLeft: theme.spacing(1.5),
1537
+ marginBottom: 0,
1538
+ },
1539
+ [theme.breakpoints.up('lg')]: {
1540
+ width: '256px',
1541
+ marginLeft: theme.spacing(2),
1542
+ },
1543
+ marginBottom: theme.spacing(2),
1544
+ }));
1545
+ const ContentBox = styled$1(Box)(({ theme }) => ({
1546
+ backgroundColor: '#FEFDF7',
1547
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
1548
+ ? parseInt(theme.shape.borderRadius, 10)
1549
+ : theme.shape.borderRadius || 4) * 2,
1550
+ padding: theme.spacing(2.5),
1551
+ boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 0.1)',
1552
+ [theme.breakpoints.up('md')]: {
1553
+ padding: theme.spacing(3),
1554
+ },
1555
+ }));
1556
+ const NavLink = styled$1(Link)(({ theme, isActive }) => ({
1557
+ display: 'block',
1558
+ padding: theme.spacing(1, 2),
1559
+ fontSize: '0.875rem',
1560
+ textDecoration: 'none',
1561
+ color: '#4D3019',
1562
+ transition: 'background-color 0.2s',
1563
+ borderLeft: isActive ? '4px solid #FFC365' : '4px solid transparent',
1564
+ backgroundColor: isActive ? '#FFEDD1' : 'transparent',
1565
+ fontWeight: isActive ? 700 : 400,
1566
+ '&:hover': {
1567
+ backgroundColor: '#FFEDD1',
1568
+ },
1569
+ }));
1570
+ const TableOfContents = ({ sections, activeSection = 'current-section', }) => {
1571
+ return (jsx(Container, { children: jsxs(ContentBox, { children: [jsx(Typography, { variant: "h6", sx: {
1572
+ color: '#4D3019',
1573
+ fontWeight: 600,
1574
+ fontSize: '16px',
1575
+ mb: 3,
1576
+ }, children: "In this policy" }), jsx(Box, { component: "nav", sx: { display: 'flex', flexDirection: 'column', gap: 0.25 }, children: sections.map((section) => {
1577
+ const isActive = section.id === activeSection;
1578
+ return (jsx(NavLink, { href: `#${section.id}`, isActive: isActive, children: section.title }, section.id));
1579
+ }) })] }) }));
1580
+ };
1581
+
1582
+ const ToggleButton = styled$1(Box)(({ theme }) => ({
1583
+ display: 'inline-flex',
1584
+ alignItems: 'center',
1585
+ gap: theme.spacing(1.5),
1586
+ padding: theme.spacing(0.75, 1.5),
1587
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
1588
+ ? parseInt(theme.shape.borderRadius, 10)
1589
+ : theme.shape.borderRadius || 4) * 2,
1590
+ backgroundColor: '#fff',
1591
+ border: `1px solid ${theme.palette.dark.main}33`,
1592
+ cursor: 'pointer',
1593
+ transition: 'border-color 0.2s',
1594
+ '&:hover': {
1595
+ borderColor: `${theme.palette.dark.main}4D`,
1596
+ },
1597
+ }));
1598
+ const ToggleTrack = styled$1(Box)(({ theme, isChecked }) => ({
1599
+ position: 'relative',
1600
+ width: '56px',
1601
+ height: '32px',
1602
+ borderRadius: '9999px',
1603
+ backgroundColor: isChecked ? theme.palette.secondary.main : '#e5e7eb',
1604
+ transition: 'background-color 0.2s',
1605
+ }));
1606
+ const ToggleThumb = styled$1(Box)(({ isChecked }) => ({
1607
+ position: 'absolute',
1608
+ top: '4px',
1609
+ width: '24px',
1610
+ height: '24px',
1611
+ backgroundColor: '#fff',
1612
+ borderRadius: '9999px',
1613
+ transition: 'transform 0.2s',
1614
+ transform: isChecked ? 'translateX(28px)' : 'translateX(4px)',
1615
+ }));
1616
+ const Toggle = ({ label = 'Admin view', checked = false, onChange, }) => {
1617
+ const [isChecked, setIsChecked] = useState(checked);
1618
+ const handleToggle = () => {
1619
+ const newValue = !isChecked;
1620
+ setIsChecked(newValue);
1621
+ onChange?.(newValue);
1622
+ };
1623
+ React__default.useEffect(() => {
1624
+ setIsChecked(checked);
1625
+ }, [checked]);
1626
+ return (jsxs(ToggleButton, { onClick: handleToggle, children: [jsx(ToggleTrack, { isChecked: isChecked, children: jsx(ToggleThumb, { isChecked: isChecked }) }), jsx(Typography, { sx: {
1627
+ color: '#4D3019',
1628
+ fontWeight: 500,
1629
+ fontSize: '0.875rem',
1630
+ }, children: label })] }));
1631
+ };
1632
+
1633
+ const StyledDialog = styled$1(Dialog)(({ theme }) => ({
1634
+ '& .MuiDialog-paper': {
1635
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
1636
+ ? parseInt(theme.shape.borderRadius, 10)
1637
+ : theme.shape.borderRadius || 4) * 2,
1638
+ maxWidth: '448px',
1639
+ width: '100%',
1640
+ },
1641
+ }));
1642
+ const StyledDialogTitle = styled$1(DialogTitle)(({ theme }) => ({
1643
+ display: 'flex',
1644
+ alignItems: 'center',
1645
+ justifyContent: 'space-between',
1646
+ padding: theme.spacing(3),
1647
+ borderBottom: `1px solid ${theme.palette.divider}`,
1648
+ fontSize: '1.125rem',
1649
+ fontWeight: 600,
1650
+ color: theme.palette.dark.main,
1651
+ }));
1652
+ const CloseButton = styled$1(IconButton)(({ theme }) => ({
1653
+ padding: theme.spacing(0.5),
1654
+ '&:hover': {
1655
+ backgroundColor: `${theme.palette.dark.main}0D`,
1656
+ },
1657
+ }));
1658
+ const SimpleModal = ({ isOpen, onClose, title, children, }) => {
1659
+ const { theme } = useTheme();
1660
+ 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 })] }));
1661
+ };
1662
+
1663
+ const StyledIconButton = styled$1(IconButton)(({ theme }) => ({
1664
+ width: 48,
1665
+ height: 48,
1666
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
1667
+ ? parseInt(theme.shape.borderRadius, 10)
1668
+ : theme.shape.borderRadius || 4) * 2,
1669
+ backgroundColor: '#fff',
1670
+ border: `1px solid ${theme.palette.dark.main}1A`,
1671
+ '&:hover': {
1672
+ backgroundColor: '#f9fafb',
1673
+ },
1674
+ '& svg': {
1675
+ color: '#4D3019',
1676
+ transition: 'color 0.2s',
1677
+ },
1678
+ '&:hover svg': {
1679
+ color: theme.palette.primary.main,
1680
+ },
1681
+ }));
1682
+ const ActionButton = ({ icon: Icon, onClick, label, sx, }) => {
1683
+ return (jsx(StyledIconButton, { onClick: onClick, "aria-label": label, sx: sx, children: jsx(Icon, {}) }));
1684
+ };
1685
+
1686
+ const StyledWrapper = styled$1(Box)(({ theme }) => ({
1687
+ // No specific wrapper styles needed, just a container
1688
+ }));
1689
+ const StyledParagraph = styled$1(Typography)(({ theme }) => ({
1690
+ fontSize: '14px', // text-[14px]
1691
+ color: theme.palette.dark.main, // text-[#4D3019]
1692
+ display: 'inline-flex',
1693
+ alignItems: 'center',
1694
+ }));
1695
+ const StyledTermWrapper = styled$1(Box)(({ theme }) => ({
1696
+ position: 'relative',
1697
+ display: 'inline-flex',
1698
+ alignItems: 'center',
1699
+ cursor: 'pointer',
1700
+ marginLeft: theme.spacing(0.5), // ml-1
1701
+ }));
1702
+ const StyledTerm = styled$1('span', {
1703
+ shouldForwardProp: (prop) => prop !== 'isOpen',
1704
+ })(({ theme, isOpen }) => ({
1705
+ paddingBottom: '1px', // style={{ paddingBottom: '1px' }}
1706
+ borderBottom: `2px solid ${isOpen ? theme.palette.secondary.main : theme.palette.dark.main}`, // border-b-2
1707
+ transition: 'border-bottom-color 0.2s', // transition-colors
1708
+ '&:hover': {
1709
+ borderBottomColor: theme.palette.secondary.main, // hover effect
1710
+ },
1711
+ }));
1712
+ const StyledIconWrapper = styled$1(Box)(({ theme }) => ({
1713
+ display: 'inline-flex',
1714
+ alignItems: 'center',
1715
+ justifyContent: 'center',
1716
+ marginLeft: theme.spacing(0.5), // ml-1
1717
+ transition: 'color 0.2s', // transition-colors
1718
+ }));
1719
+ const StyledDefinitionBox = styled$1(Box)(({ theme }) => ({
1720
+ marginTop: theme.spacing(2), // mt-4
1721
+ padding: theme.spacing(2), // p-4
1722
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
1723
+ ? parseInt(theme.shape.borderRadius, 10)
1724
+ : theme.shape.borderRadius || 4) * 2, // rounded-lg
1725
+ border: `1px solid ${theme.palette.dark.main}33`, // border-[#4D3019]/20
1726
+ borderRight: `4px solid ${theme.palette.dark.main}33`, // border-r-4
1727
+ backgroundColor: theme.palette.light.main, // style={{ backgroundColor: '#FDFCEE' }}
1728
+ }));
1729
+ const StyledDefinitionText = styled$1(Typography)(({ theme }) => ({
1730
+ fontSize: '14px', // text-[14px]
1731
+ color: theme.palette.dark.main, // text-[#4D3019]
1732
+ lineHeight: 1.5, // leading-relaxed
1733
+ }));
1734
+ function DefinitionBox({ term, definition, children }) {
1735
+ const { theme } = useTheme();
1736
+ const [isOpen, setIsOpen] = useState(false);
1737
+ 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: {
1738
+ fontSize: 16,
1739
+ color: isOpen ? theme.palette.secondary.main : theme.palette.dark.main,
1740
+ '&:hover': {
1741
+ color: theme.palette.secondary.main
1742
+ }
1743
+ } })) : (jsx(AddRounded, { sx: {
1744
+ fontSize: 16,
1745
+ color: theme.palette.dark.main,
1746
+ '&:hover': {
1747
+ color: theme.palette.secondary.main
1748
+ }
1749
+ } })) })] })] }), isOpen && (jsx(StyledDefinitionBox, { children: jsx(StyledDefinitionText, { children: definition }) }))] }));
1750
+ }
1751
+
1752
+ const HomeButton = styled$1(IconButton)(({ theme }) => ({
1753
+ width: 40,
1754
+ height: 40,
1755
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
1756
+ ? parseInt(theme.shape.borderRadius, 10)
1757
+ : theme.shape.borderRadius || 4) * 2,
1758
+ backgroundColor: theme.palette.custom?.iconColor || theme.palette.accent.main,
1759
+ flexShrink: 0,
1760
+ display: 'none',
1761
+ [theme.breakpoints.up('md')]: {
1762
+ display: 'flex',
1763
+ },
1764
+ '&:hover': {
1765
+ backgroundColor: theme.palette.custom?.iconColor || theme.palette.accent.main,
1766
+ opacity: 0.8,
1767
+ },
1768
+ }));
1769
+ const DropdownButton = styled$1('button')(({ theme }) => ({
1770
+ display: 'flex',
1771
+ alignItems: 'center',
1772
+ gap: theme.spacing(1),
1773
+ padding: theme.spacing(0.75, 2),
1774
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
1775
+ ? parseInt(theme.shape.borderRadius, 10)
1776
+ : theme.shape.borderRadius || 4) * 2,
1777
+ border: `1px solid ${theme.palette.dark.main}33`,
1778
+ backgroundColor: '#fff',
1779
+ color: theme.palette.dark.main,
1780
+ fontWeight: 500,
1781
+ whiteSpace: 'nowrap',
1782
+ cursor: 'pointer',
1783
+ transition: 'border-color 0.2s',
1784
+ fontSize: '0.875rem',
1785
+ '&:hover': {
1786
+ borderColor: `${theme.palette.dark.main}4D`,
1787
+ },
1788
+ [theme.breakpoints.down('sm')]: {
1789
+ padding: theme.spacing(0.75, 1),
1790
+ gap: theme.spacing(0.5),
1791
+ },
1792
+ }));
1793
+ const StyledMenu = styled$1(Menu)(({ theme }) => ({
1794
+ '& .MuiPaper-root': {
1795
+ marginTop: theme.spacing(1),
1796
+ width: '256px',
1797
+ borderRadius: (typeof theme.shape.borderRadius === 'string'
1798
+ ? parseInt(theme.shape.borderRadius, 10)
1799
+ : theme.shape.borderRadius || 4) * 2,
1800
+ border: `1px solid ${theme.palette.dark.main}33`,
1801
+ boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
1802
+ },
1803
+ }));
1804
+ const StyledMenuItem = styled$1(MenuItem)(({ theme, isActive }) => ({
1805
+ padding: theme.spacing(1.25, 2),
1806
+ fontSize: '0.875rem',
1807
+ color: isActive ? theme.palette.primary.main : '#4D3019',
1808
+ fontWeight: isActive ? 500 : 400,
1809
+ backgroundColor: isActive ? '#F5F1ED' : 'transparent',
1810
+ '&:hover': {
1811
+ backgroundColor: '#F5F1ED',
1812
+ },
1813
+ }));
1814
+ const Breadcrumb = ({ items, currentItem, dropdownItems = [], onItemSelect, }) => {
1815
+ const { theme } = useTheme();
1816
+ const [anchorEl, setAnchorEl] = useState(null);
1817
+ const isDropdownOpen = Boolean(anchorEl);
1818
+ const handleDropdownToggle = (event) => {
1819
+ setAnchorEl(event.currentTarget);
1820
+ };
1821
+ const handleClose = () => {
1822
+ setAnchorEl(null);
1823
+ };
1824
+ const handleItemClick = (item) => {
1825
+ onItemSelect?.(item);
1826
+ handleClose();
1827
+ };
1828
+ return (jsxs(Box, { component: "nav", sx: {
1829
+ display: 'flex',
1830
+ alignItems: 'center',
1831
+ gap: { xs: 0.5, sm: 1 },
1832
+ fontSize: { xs: '0.75rem', sm: '0.875rem' },
1833
+ overflow: 'visible',
1834
+ }, children: [jsx(HomeButton, { "aria-label": "Home", children: jsx(HomeRounded, { sx: { fontSize: 20, color: "#4D3019" } }) }), jsx(Breadcrumbs, { separator: "/", sx: {
1835
+ display: { xs: 'none', md: 'flex' },
1836
+ '& .MuiBreadcrumbs-separator': {
1837
+ color: `${theme.palette.dark.main}66`,
1838
+ },
1839
+ }, children: items.map((item, index) => (jsx(Typography, { sx: {
1840
+ color: theme.palette.dark.main,
1841
+ fontWeight: 500,
1842
+ px: { xs: 0.5, sm: 1 },
1843
+ whiteSpace: 'nowrap',
1844
+ fontSize: 'inherit',
1845
+ }, children: item.label }, index))) }), jsx(Typography, { sx: {
1846
+ display: { xs: 'none', md: 'inline' },
1847
+ color: `${theme.palette.dark.main}66`,
1848
+ }, children: "/" }), jsxs(Box, { sx: { position: 'relative', flexShrink: 0 }, children: [jsxs(DropdownButton, { type: "button", onClick: handleDropdownToggle, children: [jsx("span", { children: currentItem }), jsx(ExpandMoreRounded, { sx: {
1849
+ fontSize: 20,
1850
+ transition: 'transform 0.2s',
1851
+ transform: isDropdownOpen ? 'rotate(180deg)' : 'rotate(0deg)',
1852
+ } })] }), dropdownItems.length > 0 && (jsx(StyledMenu, { anchorEl: anchorEl, open: isDropdownOpen, onClose: handleClose, anchorOrigin: {
1853
+ vertical: 'bottom',
1854
+ horizontal: 'left',
1855
+ }, transformOrigin: {
1856
+ vertical: 'top',
1857
+ horizontal: 'left',
1858
+ }, children: dropdownItems.map((item, index) => (jsx(StyledMenuItem, { onClick: () => handleItemClick(item), isActive: item === currentItem, children: item }, index))) }))] })] }));
1859
+ };
1860
+
1861
+ export { ActionButton, Alert, Breadcrumb, Button, Card, Checkbox, Concertina, DefinitionBox, Header, Input, Modal, NoteBox, Progress, Radio, RadioGroup, ReadBy, Select, Sidebar, SimpleModal, StatusBar, StepIndicator, TableOfContents, Tabs, ThemeProvider, Toggle, muiThemes, useTheme };
1862
+ //# sourceMappingURL=index.esm.js.map