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