ece-docs-components 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ThemeProvider.d.ts +12 -0
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/cjs/ThemeProvider.js +158 -0
- package/dist/cjs/ThemeProvider.js.map +1 -0
- package/dist/cjs/components/ActionButton.js +31 -0
- package/dist/cjs/components/ActionButton.js.map +1 -0
- package/dist/cjs/components/Alert.js +79 -0
- package/dist/cjs/components/Alert.js.map +1 -0
- package/dist/cjs/components/Breadcrumb.js +120 -0
- package/dist/cjs/components/Breadcrumb.js.map +1 -0
- package/dist/cjs/components/Button.js +109 -0
- package/dist/cjs/components/Button.js.map +1 -0
- package/dist/cjs/components/Card.js +45 -0
- package/dist/cjs/components/Card.js.map +1 -0
- package/dist/cjs/components/Checkbox.js +42 -0
- package/dist/cjs/components/Checkbox.js.map +1 -0
- package/dist/cjs/components/Concertina.js +153 -0
- package/dist/cjs/components/Concertina.js.map +1 -0
- package/dist/cjs/components/DefinitionBox.js +77 -0
- package/dist/cjs/components/DefinitionBox.js.map +1 -0
- package/dist/cjs/components/Header.js +177 -0
- package/dist/cjs/components/Header.js.map +1 -0
- package/dist/cjs/components/Input.js +77 -0
- package/dist/cjs/components/Input.js.map +1 -0
- package/dist/cjs/components/Modal.js +114 -0
- package/dist/cjs/components/Modal.js.map +1 -0
- package/dist/cjs/components/NoteBox.js +111 -0
- package/dist/cjs/components/NoteBox.js.map +1 -0
- package/dist/cjs/components/Progress.js +83 -0
- package/dist/cjs/components/Progress.js.map +1 -0
- package/dist/cjs/components/Radio.js +61 -0
- package/dist/cjs/components/Radio.js.map +1 -0
- package/dist/cjs/components/ReadBy.js +58 -0
- package/dist/cjs/components/ReadBy.js.map +1 -0
- package/dist/cjs/components/Select.js +96 -0
- package/dist/cjs/components/Select.js.map +1 -0
- package/dist/cjs/components/Sidebar.js +206 -0
- package/dist/cjs/components/Sidebar.js.map +1 -0
- package/dist/cjs/components/SimpleModal.js +40 -0
- package/dist/cjs/components/SimpleModal.js.map +1 -0
- package/dist/cjs/components/StatusBar.js +64 -0
- package/dist/cjs/components/StatusBar.js.map +1 -0
- package/dist/cjs/components/TableOfContents.js +62 -0
- package/dist/cjs/components/TableOfContents.js.map +1 -0
- package/dist/cjs/components/Tabs.js +97 -0
- package/dist/cjs/components/Tabs.js.map +1 -0
- package/dist/cjs/components/Toggle.js +60 -0
- package/dist/cjs/components/Toggle.js.map +1 -0
- package/dist/cjs/index.js +57 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/esm/ThemeProvider.d.ts +117 -0
- package/dist/esm/ThemeProvider.js +136 -0
- package/dist/esm/ThemeProvider.js.map +1 -0
- package/dist/esm/components/ActionButton.d.ts +11 -0
- package/dist/esm/components/ActionButton.js +29 -0
- package/dist/esm/components/ActionButton.js.map +1 -0
- package/dist/esm/components/Alert.d.ts +11 -0
- package/dist/esm/components/Alert.js +77 -0
- package/dist/esm/components/Alert.js.map +1 -0
- package/dist/esm/components/Breadcrumb.d.ts +13 -0
- package/dist/esm/components/Breadcrumb.js +118 -0
- package/dist/esm/components/Breadcrumb.js.map +1 -0
- package/dist/esm/components/Button.d.ts +8 -0
- package/dist/esm/components/Button.js +107 -0
- package/dist/esm/components/Button.js.map +1 -0
- package/dist/esm/components/Card.d.ts +11 -0
- package/dist/esm/components/Card.js +43 -0
- package/dist/esm/components/Card.js.map +1 -0
- package/dist/esm/components/Checkbox.d.ts +8 -0
- package/dist/esm/components/Checkbox.js +40 -0
- package/dist/esm/components/Checkbox.js.map +1 -0
- package/dist/esm/components/Concertina.d.ts +10 -0
- package/dist/esm/components/Concertina.js +151 -0
- package/dist/esm/components/Concertina.js.map +1 -0
- package/dist/esm/components/DefinitionBox.d.ts +8 -0
- package/dist/esm/components/DefinitionBox.js +75 -0
- package/dist/esm/components/DefinitionBox.js.map +1 -0
- package/dist/esm/components/Header.d.ts +7 -0
- package/dist/esm/components/Header.js +175 -0
- package/dist/esm/components/Header.js.map +1 -0
- package/dist/esm/components/Input.d.ts +7 -0
- package/dist/esm/components/Input.js +75 -0
- package/dist/esm/components/Input.js.map +1 -0
- package/dist/esm/components/Modal.d.ts +20 -0
- package/dist/esm/components/Modal.js +112 -0
- package/dist/esm/components/Modal.js.map +1 -0
- package/dist/esm/components/NoteBox.d.ts +10 -0
- package/dist/esm/components/NoteBox.js +109 -0
- package/dist/esm/components/NoteBox.js.map +1 -0
- package/dist/esm/components/Progress.d.ts +15 -0
- package/dist/esm/components/Progress.js +80 -0
- package/dist/esm/components/Progress.js.map +1 -0
- package/dist/esm/components/Radio.d.ts +14 -0
- package/dist/esm/components/Radio.js +58 -0
- package/dist/esm/components/Radio.js.map +1 -0
- package/dist/esm/components/ReadBy.d.ts +6 -0
- package/dist/esm/components/ReadBy.js +56 -0
- package/dist/esm/components/ReadBy.js.map +1 -0
- package/dist/esm/components/Select.d.ts +19 -0
- package/dist/esm/components/Select.js +94 -0
- package/dist/esm/components/Select.js.map +1 -0
- package/dist/esm/components/Sidebar.d.ts +10 -0
- package/dist/esm/components/Sidebar.js +204 -0
- package/dist/esm/components/Sidebar.js.map +1 -0
- package/dist/esm/components/SimpleModal.d.ts +9 -0
- package/dist/esm/components/SimpleModal.js +38 -0
- package/dist/esm/components/SimpleModal.js.map +1 -0
- package/dist/esm/components/StatusBar.d.ts +9 -0
- package/dist/esm/components/StatusBar.js +62 -0
- package/dist/esm/components/StatusBar.js.map +1 -0
- package/dist/esm/components/TableOfContents.d.ts +11 -0
- package/dist/esm/components/TableOfContents.js +60 -0
- package/dist/esm/components/TableOfContents.js.map +1 -0
- package/dist/esm/components/Tabs.d.ts +12 -0
- package/dist/esm/components/Tabs.js +95 -0
- package/dist/esm/components/Tabs.js.map +1 -0
- package/dist/esm/components/Toggle.d.ts +8 -0
- package/dist/esm/components/Toggle.js +58 -0
- package/dist/esm/components/Toggle.js.map +1 -0
- package/dist/esm/components/index.d.ts +22 -0
- package/dist/esm/index.d.ts +25 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/theme-types.d.ts +39 -0
- package/dist/{index.esm.js → index.cjs} +317 -190
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +272 -190
- package/dist/index.js.map +1 -1
- package/dist/theme-types.d.ts.map +1 -1
- package/package.json +18 -11
- package/dist/index.esm.js.map +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var material = require('@mui/material');
|
|
7
|
+
var Button = require('./Button.js');
|
|
8
|
+
var iconsMaterial = require('@mui/icons-material');
|
|
9
|
+
|
|
10
|
+
const StyledDialog = material.styled(material.Dialog)(({ theme }) => ({
|
|
11
|
+
'& .MuiDialog-paper': {
|
|
12
|
+
borderRadius: theme.shape.borderRadius,
|
|
13
|
+
maxWidth: '896px',
|
|
14
|
+
width: '100%',
|
|
15
|
+
maxHeight: '90vh',
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
18
|
+
const NavButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
19
|
+
width: '40px',
|
|
20
|
+
height: '40px',
|
|
21
|
+
border: `2px solid ${theme.palette.dark.main}`,
|
|
22
|
+
backgroundColor: theme.palette.light.main,
|
|
23
|
+
'&:hover': {
|
|
24
|
+
backgroundColor: theme.palette.dark.main,
|
|
25
|
+
color: theme.palette.light.main,
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
const Modal = ({ isOpen, onClose, status, description, defaultText, note, acceptSuggestion: initialAcceptSuggestion = true, onAcceptSuggestionChange, onSave, onSubmit, onDeclineWording, onPrevious, onNext, currentPage = 1, totalPages = 1, }) => {
|
|
29
|
+
const [textValue, setTextValue] = React.useState(defaultText);
|
|
30
|
+
const [acceptSuggestion, setAcceptSuggestion] = React.useState(initialAcceptSuggestion);
|
|
31
|
+
const statusConfig = {
|
|
32
|
+
mandatory: {
|
|
33
|
+
color: '#F5A623',
|
|
34
|
+
label: 'Mandatory',
|
|
35
|
+
},
|
|
36
|
+
optional: {
|
|
37
|
+
color: '#F5D76E',
|
|
38
|
+
label: 'Optional',
|
|
39
|
+
},
|
|
40
|
+
accepted: {
|
|
41
|
+
color: '#A3D977',
|
|
42
|
+
label: 'Accepted',
|
|
43
|
+
},
|
|
44
|
+
'action-required': {
|
|
45
|
+
color: '#F56B6B',
|
|
46
|
+
label: 'Action Required',
|
|
47
|
+
},
|
|
48
|
+
'action-required-note': {
|
|
49
|
+
color: '#F56B6B',
|
|
50
|
+
label: 'Action Required',
|
|
51
|
+
},
|
|
52
|
+
'accepted-note': {
|
|
53
|
+
color: '#A3D977',
|
|
54
|
+
label: 'Accepted',
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
const statusStyle = statusConfig[status];
|
|
58
|
+
return (jsxRuntime.jsxs(StyledDialog, { open: isOpen, onClose: onClose, maxWidth: "md", fullWidth: true, children: [jsxRuntime.jsx(material.IconButton, { onClick: onClose, sx: {
|
|
59
|
+
position: 'absolute',
|
|
60
|
+
top: 16,
|
|
61
|
+
right: 16,
|
|
62
|
+
zIndex: 1,
|
|
63
|
+
}, 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: {
|
|
64
|
+
backgroundColor: statusStyle.color,
|
|
65
|
+
color: status === 'optional' ? '#4D3019' : '#fff',
|
|
66
|
+
fontWeight: 600,
|
|
67
|
+
fontSize: '0.875rem',
|
|
68
|
+
height: 'auto',
|
|
69
|
+
py: 1,
|
|
70
|
+
px: 2,
|
|
71
|
+
} }) }), 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: {
|
|
72
|
+
mb: 2,
|
|
73
|
+
backgroundColor: '#FFE6E6',
|
|
74
|
+
borderLeft: '4px solid #F56B6B',
|
|
75
|
+
'& .MuiAlert-icon': {
|
|
76
|
+
color: '#F56B6B',
|
|
77
|
+
},
|
|
78
|
+
'& .MuiAlert-message': {
|
|
79
|
+
color: '#4D3019',
|
|
80
|
+
},
|
|
81
|
+
}, children: note })), status === 'accepted-note' && note && (jsxRuntime.jsx(material.Alert, { icon: jsxRuntime.jsx(iconsMaterial.StickyNote2Rounded, { sx: { fontSize: 20 } }), severity: "warning", sx: {
|
|
82
|
+
mb: 2,
|
|
83
|
+
backgroundColor: '#FFF9E6',
|
|
84
|
+
borderLeft: '4px solid #F5D76E',
|
|
85
|
+
'& .MuiAlert-icon': {
|
|
86
|
+
color: '#F5A623',
|
|
87
|
+
},
|
|
88
|
+
'& .MuiAlert-message': {
|
|
89
|
+
color: '#4D3019',
|
|
90
|
+
},
|
|
91
|
+
}, children: note })), jsxRuntime.jsx(material.TextField, { multiline: true, rows: 4, fullWidth: true, value: textValue, onChange: (e) => setTextValue(e.target.value), disabled: acceptSuggestion, sx: {
|
|
92
|
+
mb: 2,
|
|
93
|
+
'& .MuiOutlinedInput-root': {
|
|
94
|
+
backgroundColor: acceptSuggestion ? 'rgba(0, 0, 0, 0.05)' : '#fff',
|
|
95
|
+
},
|
|
96
|
+
} }), jsxRuntime.jsxs(material.Box, { sx: {
|
|
97
|
+
display: 'flex',
|
|
98
|
+
flexDirection: { xs: 'column', sm: 'row' },
|
|
99
|
+
alignItems: { xs: 'stretch', sm: 'center' },
|
|
100
|
+
justifyContent: 'space-between',
|
|
101
|
+
gap: 2,
|
|
102
|
+
pt: 3,
|
|
103
|
+
borderTop: '1px solid',
|
|
104
|
+
borderColor: 'divider',
|
|
105
|
+
}, children: [jsxRuntime.jsxs(material.Box, { sx: { display: 'flex', gap: 1.5 }, children: [jsxRuntime.jsx(Button.Button, { onClick: onSave, variant: "secondary", size: "md", children: "Save" }), jsxRuntime.jsx(Button.Button, { onClick: onSubmit, variant: "primary", size: "md", children: "Submit for review" }), jsxRuntime.jsx(Button.Button, { onClick: onDeclineWording, variant: "danger", size: "md", children: "Decline Wording" })] }), jsxRuntime.jsxs(material.Box, { sx: {
|
|
106
|
+
display: 'flex',
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
gap: 2,
|
|
109
|
+
justifyContent: { xs: 'space-between', sm: 'flex-end' },
|
|
110
|
+
}, 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] })] })] })] })] }));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
exports.Modal = Modal;
|
|
114
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../../src/components/Modal.tsx"],"sourcesContent":["'use client';\n\nimport React, { useState } from 'react';\nimport {\n Dialog,\n DialogContent,\n IconButton,\n Box,\n Typography,\n TextField,\n Checkbox,\n FormControlLabel,\n Alert as MuiAlert,\n Chip,\n styled,\n} from '@mui/material';\nimport { Button } from './Button';\nimport { ChevronLeftRounded, ChevronRightRounded, CloseRounded, ErrorOutlineRounded, StickyNote2Rounded } from '@mui/icons-material';\n\ninterface ModalProps {\n isOpen: boolean;\n onClose: () => void;\n status: 'mandatory' | 'optional' | 'accepted' | 'action-required' | 'action-required-note' | 'accepted-note';\n description: string;\n defaultText: string;\n note?: string;\n acceptSuggestion?: boolean;\n onAcceptSuggestionChange?: (checked: boolean) => void;\n onSave?: () => void;\n onSubmit?: () => void;\n onDeclineWording?: () => void;\n onPrevious?: () => void;\n onNext?: () => void;\n currentPage?: number;\n totalPages?: number;\n}\n\nconst StyledDialog = styled(Dialog)(({ theme }) => ({\n '& .MuiDialog-paper': {\n borderRadius: theme.shape.borderRadius,\n maxWidth: '896px',\n width: '100%',\n maxHeight: '90vh',\n },\n}));\n\nconst NavButton = styled(IconButton)(({ theme }) => ({\n width: '40px',\n height: '40px',\n border: `2px solid ${theme.palette.dark.main}`,\n backgroundColor: theme.palette.light.main,\n '&:hover': {\n backgroundColor: theme.palette.dark.main,\n color: theme.palette.light.main,\n },\n}));\n\nexport const Modal: React.FC<ModalProps> = ({\n isOpen,\n onClose,\n status,\n description,\n defaultText,\n note,\n acceptSuggestion: initialAcceptSuggestion = true,\n onAcceptSuggestionChange,\n onSave,\n onSubmit,\n onDeclineWording,\n onPrevious,\n onNext,\n currentPage = 1,\n totalPages = 1,\n}) => {\n const [textValue, setTextValue] = useState(defaultText);\n const [acceptSuggestion, setAcceptSuggestion] = useState(initialAcceptSuggestion);\n\n const handleAcceptSuggestionChange = (checked: boolean) => {\n setAcceptSuggestion(checked);\n onAcceptSuggestionChange?.(checked);\n };\n\n const statusConfig = {\n mandatory: {\n color: '#F5A623',\n label: 'Mandatory',\n },\n optional: {\n color: '#F5D76E',\n label: 'Optional',\n },\n accepted: {\n color: '#A3D977',\n label: 'Accepted',\n },\n 'action-required': {\n color: '#F56B6B',\n label: 'Action Required',\n },\n 'action-required-note': {\n color: '#F56B6B',\n label: 'Action Required',\n },\n 'accepted-note': {\n color: '#A3D977',\n label: 'Accepted',\n },\n };\n\n const statusStyle = statusConfig[status];\n\n return (\n <StyledDialog open={isOpen} onClose={onClose} maxWidth=\"md\" fullWidth>\n <IconButton\n onClick={onClose}\n sx={{\n position: 'absolute',\n top: 16,\n right: 16,\n zIndex: 1,\n }}\n >\n <CloseRounded sx={{fontSize:24}} />\n </IconButton>\n\n <DialogContent sx={{ p: { xs: 3, sm: 4, md: 6 } }}>\n <Box sx={{ mb: 3 }}>\n <Chip\n label={statusStyle.label}\n sx={{\n backgroundColor: statusStyle.color,\n color: status === 'optional' ? '#4D3019' : '#fff',\n fontWeight: 600,\n fontSize: '0.875rem',\n height: 'auto',\n py: 1,\n px: 2,\n }}\n />\n </Box>\n\n <Typography sx={{ mb: 3, lineHeight: 1.6 }}>\n {description}\n </Typography>\n\n {status === 'action-required-note' && note && (\n <MuiAlert\n icon={<ErrorOutlineRounded sx={{fontSize:20}} />}\n severity=\"error\"\n sx={{\n mb: 2,\n backgroundColor: '#FFE6E6',\n borderLeft: '4px solid #F56B6B',\n '& .MuiAlert-icon': {\n color: '#F56B6B',\n },\n '& .MuiAlert-message': {\n color: '#4D3019',\n },\n }}\n >\n {note}\n </MuiAlert>\n )}\n\n {status === 'accepted-note' && note && (\n <MuiAlert\n icon={<StickyNote2Rounded sx={{fontSize:20}} />}\n severity=\"warning\"\n sx={{\n mb: 2,\n backgroundColor: '#FFF9E6',\n borderLeft: '4px solid #F5D76E',\n '& .MuiAlert-icon': {\n color: '#F5A623',\n },\n '& .MuiAlert-message': {\n color: '#4D3019',\n },\n }}\n >\n {note}\n </MuiAlert>\n )}\n\n <TextField\n multiline\n rows={4}\n fullWidth\n value={textValue}\n onChange={(e) => setTextValue(e.target.value)}\n disabled={acceptSuggestion}\n sx={{\n mb: 2,\n '& .MuiOutlinedInput-root': {\n backgroundColor: acceptSuggestion ? 'rgba(0, 0, 0, 0.05)' : '#fff',\n },\n }}\n />\n\n <Box\n sx={{\n display: 'flex',\n flexDirection: { xs: 'column', sm: 'row' },\n alignItems: { xs: 'stretch', sm: 'center' },\n justifyContent: 'space-between',\n gap: 2,\n pt: 3,\n borderTop: '1px solid',\n borderColor: 'divider',\n }}\n >\n <Box sx={{ display: 'flex', gap: 1.5 }}>\n <Button onClick={onSave} variant=\"secondary\" size=\"md\">\n Save\n </Button>\n <Button onClick={onSubmit} variant=\"primary\" size=\"md\">\n Submit for review\n </Button>\n <Button onClick={onDeclineWording} variant=\"danger\" size=\"md\">\n Decline Wording\n </Button>\n </Box>\n\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: 2,\n justifyContent: { xs: 'space-between', sm: 'flex-end' },\n }}\n >\n <Box sx={{ display: 'flex', gap: 1.5 }}>\n <NavButton onClick={onPrevious} aria-label=\"Previous\">\n <ChevronLeftRounded sx={{fontSize:20}} />\n </NavButton>\n <NavButton onClick={onNext} aria-label=\"Next\">\n <ChevronRightRounded sx={{fontSize:20}} />\n </NavButton>\n </Box>\n <Typography fontWeight={500} fontSize=\"1.125rem\" sx={{ ml: 1 }}>\n {currentPage}/{totalPages}\n </Typography>\n </Box>\n </Box>\n </DialogContent>\n </StyledDialog>\n );\n};"],"names":[],"mappings":";;;;;;;;;AAqCA;AACE;AACE;AACA;AACA;AACA;AACD;AACF;AAED;AACE;AACA;;AAEA;AACA;AACE;AACA;AACD;AACF;;;;AA2BC;AACE;AACE;AACA;AACD;AACD;AACE;AACA;AACD;AACD;AACE;AACA;AACD;AACD;AACE;AACA;AACD;AACD;AACE;AACA;AACD;AACD;AACE;AACA;AACD;;AAGH;;AAOQ;AACA;AACA;AACA;;;;AAaI;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACE;AACD;AACD;AACE;AACD;AACF;AAWC;AACA;AACA;AACA;AACE;AACD;AACD;AACE;AACD;AACF;AAcD;AACA;;AAEC;AACF;AAKC;;;AAGA;AACA;AACA;AACA;AACA;AACD;AAgBG;AACA;AACA;;AAED;AAkBb;;"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var material = require('@mui/material');
|
|
7
|
+
var iconsMaterial = require('@mui/icons-material');
|
|
8
|
+
|
|
9
|
+
const NoteContainer = material.styled(material.Box)({
|
|
10
|
+
position: 'relative',
|
|
11
|
+
maxWidth: '100%',
|
|
12
|
+
});
|
|
13
|
+
const EditButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
right: -4,
|
|
16
|
+
top: '50%',
|
|
17
|
+
transform: 'translateY(-50%)',
|
|
18
|
+
width: 24,
|
|
19
|
+
height: 24,
|
|
20
|
+
backgroundColor: '#4D3019',
|
|
21
|
+
opacity: 0,
|
|
22
|
+
transition: 'all 0.2s ease',
|
|
23
|
+
boxShadow: '0 1px 3px rgba(0,0,0,0.12)',
|
|
24
|
+
'&:hover': {
|
|
25
|
+
backgroundColor: '#4D3019',
|
|
26
|
+
transform: 'translateY(-50%) scale(1.1)',
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
const HighlightWrapper = material.styled(material.Box)(({ isHovered, highlightColor, highlightSelectedColor, isCustom }) => ({
|
|
30
|
+
position: 'relative',
|
|
31
|
+
display: 'inline-block',
|
|
32
|
+
maxWidth: '100%',
|
|
33
|
+
'&:hover .edit-button': {
|
|
34
|
+
opacity: 1,
|
|
35
|
+
},
|
|
36
|
+
'& .highlight-span': {
|
|
37
|
+
background: isCustom ? highlightColor : (isHovered ? highlightSelectedColor : highlightColor),
|
|
38
|
+
padding: '2px 4px',
|
|
39
|
+
boxDecorationBreak: 'clone',
|
|
40
|
+
WebkitBoxDecorationBreak: 'clone',
|
|
41
|
+
transition: isCustom ? 'none' : 'background 0.2s ease',
|
|
42
|
+
cursor: isCustom ? 'default' : 'pointer',
|
|
43
|
+
fontSize: '13px',
|
|
44
|
+
wordWrap: 'break-word',
|
|
45
|
+
overflowWrap: 'break-word',
|
|
46
|
+
display: 'inline',
|
|
47
|
+
color: '#4D3019',
|
|
48
|
+
},
|
|
49
|
+
}));
|
|
50
|
+
const NoteBox = ({ variant = 'default', label, children, className = '', onEditClick, }) => {
|
|
51
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
52
|
+
const variants = {
|
|
53
|
+
default: {
|
|
54
|
+
highlight: '#FFEACD',
|
|
55
|
+
highlightSelected: '#FFC365',
|
|
56
|
+
label: '',
|
|
57
|
+
labelColor: '',
|
|
58
|
+
},
|
|
59
|
+
mandatory: {
|
|
60
|
+
highlight: '#FFEACD',
|
|
61
|
+
highlightSelected: '#FFC365',
|
|
62
|
+
label: 'Not Answered (Mandatory)',
|
|
63
|
+
labelColor: 'var(--color-secondary)',
|
|
64
|
+
},
|
|
65
|
+
optional: {
|
|
66
|
+
highlight: '#FFF6D1',
|
|
67
|
+
highlightSelected: '#FDE58E',
|
|
68
|
+
label: 'Not Answered (Optional)',
|
|
69
|
+
labelColor: 'var(--color-secondary)',
|
|
70
|
+
},
|
|
71
|
+
pending: {
|
|
72
|
+
highlight: '#F5E2FF',
|
|
73
|
+
highlightSelected: '#EBC7FF',
|
|
74
|
+
label: 'Pending',
|
|
75
|
+
labelColor: 'var(--color-secondary)',
|
|
76
|
+
},
|
|
77
|
+
accepted: {
|
|
78
|
+
highlight: '#EDF9CD',
|
|
79
|
+
highlightSelected: '#DBF59A',
|
|
80
|
+
label: 'Accepted',
|
|
81
|
+
labelColor: '#2D5016',
|
|
82
|
+
},
|
|
83
|
+
'action-required': {
|
|
84
|
+
highlight: '#FBEEEE',
|
|
85
|
+
highlightSelected: '#FFBCB3',
|
|
86
|
+
label: 'Action required before approval',
|
|
87
|
+
labelColor: '#CC0000',
|
|
88
|
+
},
|
|
89
|
+
custom: {
|
|
90
|
+
highlight: '#D9EDF8',
|
|
91
|
+
highlightSelected: '#B3E0F2',
|
|
92
|
+
label: 'Custom Text',
|
|
93
|
+
labelColor: 'var(--color-secondary)',
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
const style = variants[variant];
|
|
97
|
+
const displayLabel = label || style.label;
|
|
98
|
+
return (jsxRuntime.jsxs(NoteContainer, { className: className, children: [displayLabel && (jsxRuntime.jsx(material.Box, { sx: { mb: 1 }, children: jsxRuntime.jsx(material.Typography, { component: "span", sx: {
|
|
99
|
+
fontSize: '13px',
|
|
100
|
+
fontWeight: 500,
|
|
101
|
+
color: style.labelColor || 'rgba(0, 0, 0, 0.6)',
|
|
102
|
+
}, 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) => {
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
if (onEditClick) {
|
|
105
|
+
onEditClick();
|
|
106
|
+
}
|
|
107
|
+
}, title: "Edit variable highlight", size: "small", children: jsxRuntime.jsx(iconsMaterial.EditRounded, { sx: { fontSize: 14, color: "#FFFFFF", strokeWidth: 2 } }) })] })] }));
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
exports.NoteBox = NoteBox;
|
|
111
|
+
//# sourceMappingURL=NoteBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoteBox.js","sources":["../../../../src/components/NoteBox.tsx"],"sourcesContent":["'use client';\n\nimport React, { useState } from 'react';\nimport { Box, Typography, IconButton, styled } from '@mui/material';\nimport { EditRounded } from '@mui/icons-material';\n\ninterface NoteBoxProps {\n variant?: 'default' | 'mandatory' | 'optional' | 'pending' | 'accepted' | 'action-required' | 'custom';\n label?: string;\n children: React.ReactNode;\n className?: string;\n onEditClick?: () => void;\n}\n\nconst NoteContainer = styled(Box)({\n position: 'relative',\n maxWidth: '100%',\n});\n\nconst EditButton = styled(IconButton)(({ theme }) => ({\n position: 'absolute',\n right: -4,\n top: '50%',\n transform: 'translateY(-50%)',\n width: 24,\n height: 24,\n backgroundColor: '#4D3019',\n opacity: 0,\n transition: 'all 0.2s ease',\n boxShadow: '0 1px 3px rgba(0,0,0,0.12)',\n '&:hover': {\n backgroundColor: '#4D3019',\n transform: 'translateY(-50%) scale(1.1)',\n },\n}));\n\nconst HighlightWrapper = styled(Box)<{ \n isHovered: boolean; \n highlightColor: string; \n highlightSelectedColor: string;\n isCustom: boolean;\n}>(({ isHovered, highlightColor, highlightSelectedColor, isCustom }) => ({\n position: 'relative',\n display: 'inline-block',\n maxWidth: '100%',\n '&:hover .edit-button': {\n opacity: 1,\n },\n '& .highlight-span': {\n background: isCustom ? highlightColor : (isHovered ? highlightSelectedColor : highlightColor),\n padding: '2px 4px',\n boxDecorationBreak: 'clone',\n WebkitBoxDecorationBreak: 'clone',\n transition: isCustom ? 'none' : 'background 0.2s ease',\n cursor: isCustom ? 'default' : 'pointer',\n fontSize: '13px',\n wordWrap: 'break-word',\n overflowWrap: 'break-word',\n display: 'inline',\n color: '#4D3019',\n },\n}));\n\nexport const NoteBox: React.FC<NoteBoxProps> = ({\n variant = 'default',\n label,\n children,\n className = '',\n onEditClick,\n}) => {\n const [isHovered, setIsHovered] = useState(false);\n\n const variants = {\n default: {\n highlight: '#FFEACD',\n highlightSelected: '#FFC365',\n label: '',\n labelColor: '',\n },\n mandatory: {\n highlight: '#FFEACD',\n highlightSelected: '#FFC365',\n label: 'Not Answered (Mandatory)',\n labelColor: 'var(--color-secondary)',\n },\n optional: {\n highlight: '#FFF6D1',\n highlightSelected: '#FDE58E',\n label: 'Not Answered (Optional)',\n labelColor: 'var(--color-secondary)',\n },\n pending: {\n highlight: '#F5E2FF',\n highlightSelected: '#EBC7FF',\n label: 'Pending',\n labelColor: 'var(--color-secondary)',\n },\n accepted: {\n highlight: '#EDF9CD',\n highlightSelected: '#DBF59A',\n label: 'Accepted',\n labelColor: '#2D5016',\n },\n 'action-required': {\n highlight: '#FBEEEE',\n highlightSelected: '#FFBCB3',\n label: 'Action required before approval',\n labelColor: '#CC0000',\n },\n custom: {\n highlight: '#D9EDF8',\n highlightSelected: '#B3E0F2',\n label: 'Custom Text',\n labelColor: 'var(--color-secondary)',\n },\n };\n\n const style = variants[variant];\n const displayLabel = label || style.label;\n\n return (\n <NoteContainer className={className}>\n {displayLabel && (\n <Box sx={{ mb: 1 }}>\n <Typography\n component=\"span\"\n sx={{\n fontSize: '13px',\n fontWeight: 500,\n color: style.labelColor || 'rgba(0, 0, 0, 0.6)',\n }}\n >\n {displayLabel}\n </Typography>\n </Box>\n )}\n <HighlightWrapper\n isHovered={isHovered}\n highlightColor={style.highlight}\n highlightSelectedColor={style.highlightSelected}\n isCustom={variant === 'custom'}\n onMouseEnter={() => variant !== 'custom' && setIsHovered(true)}\n onMouseLeave={() => variant !== 'custom' && setIsHovered(false)}\n >\n <span className=\"highlight-span\">\n {children}\n </span>\n <EditButton\n className=\"edit-button\"\n onClick={(e) => {\n e.stopPropagation();\n if (onEditClick) {\n onEditClick();\n }\n }}\n title=\"Edit variable highlight\"\n size=\"small\"\n >\n <EditRounded sx={{fontSize:14, color:\"#FFFFFF\", strokeWidth:2}} />\n </EditButton>\n </HighlightWrapper>\n </NoteContainer>\n );\n};"],"names":[],"mappings":";;;;;;;;AAcA;AACE;AACA;AACD;AAED;AACE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE;AACA;AACD;AACF;AAED;AAME;AACA;AACA;AACA;AACE;AACD;AACD;AACE;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACD;AACF;;;AAWC;AACE;AACE;AACA;AACA;AACA;AACD;AACD;AACE;AACA;AACA;AACA;AACD;AACD;AACE;AACA;AACA;AACA;AACD;AACD;AACE;AACA;AACA;AACA;AACD;AACD;AACE;AACA;AACA;AACA;AACD;AACD;AACE;AACA;AACA;AACA;AACD;AACD;AACE;AACA;AACA;AACA;AACD;;AAGH;AACA;AAEA;AAOY;AACA;AACA;AACD;;;AAsBC;;AAEJ;AASV;;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var material = require('@mui/material');
|
|
7
|
+
var ThemeProvider = require('../ThemeProvider.js');
|
|
8
|
+
|
|
9
|
+
const StyledLinearProgress = material.styled(material.LinearProgress)(({ theme }) => ({
|
|
10
|
+
height: 10,
|
|
11
|
+
borderRadius: 9999,
|
|
12
|
+
backgroundColor: `${theme.palette.dark.main}1A`,
|
|
13
|
+
'& .MuiLinearProgress-bar': {
|
|
14
|
+
borderRadius: 9999,
|
|
15
|
+
backgroundColor: theme.palette.primary.main,
|
|
16
|
+
transition: 'transform 0.3s ease-out',
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
const Progress = ({ current, total, showLabel = true, className = '' }) => {
|
|
20
|
+
const percentage = Math.min(Math.max((current / total) * 100, 0), 100);
|
|
21
|
+
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 })] }));
|
|
22
|
+
};
|
|
23
|
+
const StepNumber = material.styled(material.Box)(({ theme, isActive, isCompleted }) => ({
|
|
24
|
+
width: 40,
|
|
25
|
+
height: 40,
|
|
26
|
+
borderRadius: '50%',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
fontWeight: 600,
|
|
31
|
+
fontSize: '0.875rem',
|
|
32
|
+
transition: 'all 0.2s',
|
|
33
|
+
backgroundColor: isCompleted || isActive
|
|
34
|
+
? theme.palette.primary.main
|
|
35
|
+
: `${theme.palette.dark.main}1A`,
|
|
36
|
+
color: isCompleted || isActive
|
|
37
|
+
? (theme.palette.custom?.stepIndicatorTextColor || theme.palette.dark.main)
|
|
38
|
+
: `${theme.palette.dark.main}99`,
|
|
39
|
+
boxShadow: isActive ? `0 0 0 4px ${theme.palette.primary.main}33` : 'none',
|
|
40
|
+
[theme.breakpoints.down('sm')]: {
|
|
41
|
+
width: 32,
|
|
42
|
+
height: 32,
|
|
43
|
+
fontSize: '0.75rem',
|
|
44
|
+
},
|
|
45
|
+
}));
|
|
46
|
+
const StepLine = material.styled(material.Box)(({ theme, isCompleted }) => ({
|
|
47
|
+
flex: 1,
|
|
48
|
+
height: 4,
|
|
49
|
+
borderRadius: 2,
|
|
50
|
+
margin: '0 8px',
|
|
51
|
+
minWidth: '1rem',
|
|
52
|
+
transition: 'background-color 0.2s',
|
|
53
|
+
backgroundColor: isCompleted ? theme.palette.primary.main : `${theme.palette.dark.main}1A`,
|
|
54
|
+
[theme.breakpoints.down('sm')]: {
|
|
55
|
+
height: 2,
|
|
56
|
+
margin: '0 4px',
|
|
57
|
+
},
|
|
58
|
+
}));
|
|
59
|
+
const StepIndicator = ({ steps, currentStep, className = '' }) => {
|
|
60
|
+
const { theme } = ThemeProvider.useTheme();
|
|
61
|
+
return (jsxRuntime.jsx(material.Box, { className: className, sx: {
|
|
62
|
+
display: 'flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
justifyContent: 'space-between',
|
|
65
|
+
overflowX: 'auto',
|
|
66
|
+
pb: 1,
|
|
67
|
+
}, children: steps.map((step, index) => {
|
|
68
|
+
const stepNumber = index + 1;
|
|
69
|
+
const isActive = stepNumber === currentStep;
|
|
70
|
+
const isCompleted = stepNumber < currentStep;
|
|
71
|
+
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: {
|
|
72
|
+
mt: { xs: 0.5, sm: 1 },
|
|
73
|
+
fontSize: { xs: '10px', sm: '12px' },
|
|
74
|
+
fontWeight: 500,
|
|
75
|
+
whiteSpace: 'nowrap',
|
|
76
|
+
color: isActive ? theme.palette.primary.main : `${theme.palette.dark.main}99`,
|
|
77
|
+
}, children: step })] }), index < steps.length - 1 && (jsxRuntime.jsx(StepLine, { isCompleted: isCompleted }))] }, index));
|
|
78
|
+
}) }));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
exports.Progress = Progress;
|
|
82
|
+
exports.StepIndicator = StepIndicator;
|
|
83
|
+
//# sourceMappingURL=Progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.js","sources":["../../../../src/components/Progress.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { Box, Typography, LinearProgress, styled } from '@mui/material';\nimport { useTheme } from '../ThemeProvider';\n\ninterface ProgressProps {\n current: number;\n total: number;\n showLabel?: boolean;\n className?: string;\n}\n\nconst StyledLinearProgress = styled(LinearProgress)(({ theme }) => ({\n height: 10,\n borderRadius: 9999,\n backgroundColor: `${theme.palette.dark.main}1A`,\n '& .MuiLinearProgress-bar': {\n borderRadius: 9999,\n backgroundColor: theme.palette.primary.main,\n transition: 'transform 0.3s ease-out',\n },\n}));\n\nexport const Progress: React.FC<ProgressProps> = ({\n current,\n total,\n showLabel = true,\n className = ''\n}) => {\n const percentage = Math.min(Math.max((current / total) * 100, 0), 100);\n\n return (\n <Box className={className}>\n {showLabel && (\n <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 1 }}>\n <Typography variant=\"body2\" fontWeight={500}>\n Step {current} of {total}\n </Typography>\n <Typography variant=\"body2\" fontWeight={500}>\n {Math.round(percentage)}%\n </Typography>\n </Box>\n )}\n <StyledLinearProgress variant=\"determinate\" value={percentage} />\n </Box>\n );\n};\n\ninterface StepIndicatorProps {\n steps: string[];\n currentStep: number;\n className?: string;\n}\n\nconst StepNumber = styled(Box)<{ isActive: boolean; isCompleted: boolean }>(\n ({ theme, isActive, isCompleted }) => ({\n width: 40,\n height: 40,\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 600,\n fontSize: '0.875rem',\n transition: 'all 0.2s',\n backgroundColor: isCompleted || isActive \n ? theme.palette.primary.main \n : `${theme.palette.dark.main}1A`,\n color: isCompleted || isActive \n ? (theme.palette.custom?.stepIndicatorTextColor || theme.palette.dark.main)\n : `${theme.palette.dark.main}99`,\n boxShadow: isActive ? `0 0 0 4px ${theme.palette.primary.main}33` : 'none',\n [theme.breakpoints.down('sm')]: {\n width: 32,\n height: 32,\n fontSize: '0.75rem',\n },\n })\n);\n\nconst StepLine = styled(Box)<{ isCompleted: boolean }>(({ theme, isCompleted }) => ({\n flex: 1,\n height: 4,\n borderRadius: 2,\n margin: '0 8px',\n minWidth: '1rem',\n transition: 'background-color 0.2s',\n backgroundColor: isCompleted ? theme.palette.primary.main : `${theme.palette.dark.main}1A`,\n [theme.breakpoints.down('sm')]: {\n height: 2,\n margin: '0 4px',\n },\n}));\n\nexport const StepIndicator: React.FC<StepIndicatorProps> = ({\n steps,\n currentStep,\n className = ''\n}) => {\n const { theme } = useTheme();\n\n return (\n <Box \n className={className}\n sx={{ \n display: 'flex', \n alignItems: 'center', \n justifyContent: 'space-between',\n overflowX: 'auto',\n pb: 1,\n }}\n >\n {steps.map((step, index) => {\n const stepNumber = index + 1;\n const isActive = stepNumber === currentStep;\n const isCompleted = stepNumber < currentStep;\n\n return (\n <React.Fragment key={index}>\n <Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', flexShrink: 0 }}>\n <StepNumber isActive={isActive} isCompleted={isCompleted}>\n {stepNumber}\n </StepNumber>\n <Typography\n sx={{\n mt: { xs: 0.5, sm: 1 },\n fontSize: { xs: '10px', sm: '12px' },\n fontWeight: 500,\n whiteSpace: 'nowrap',\n color: isActive ? theme.palette.primary.main : `${theme.palette.dark.main}99`,\n }}\n >\n {step}\n </Typography>\n </Box>\n {index < steps.length - 1 && (\n <StepLine isCompleted={isCompleted} />\n )}\n </React.Fragment>\n );\n })}\n </Box>\n );\n};"],"names":[],"mappings":";;;;;;;;AAaA;AACE;AACA;;AAEA;AACE;AACA;AACA;AACD;AACF;AAEM;;AAQL;AAeF;AAQA;AAEI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEE;;;AAGA;;AAEF;;AAEE;AACA;AACA;AACD;AACF;AAGH;AACE;AACA;AACA;AACA;AACA;AACA;;;AAGE;AACA;AACD;AACF;AAEM;AAKL;;AAMM;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;;;;AAYU;AACA;;;;AAelB;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var material = require('@mui/material');
|
|
6
|
+
var ThemeProvider = require('../ThemeProvider.js');
|
|
7
|
+
|
|
8
|
+
const CustomRadioIcon = material.styled('span')(({ theme, checked }) => ({
|
|
9
|
+
width: 20,
|
|
10
|
+
height: 20,
|
|
11
|
+
borderRadius: '50%',
|
|
12
|
+
border: checked ? `5px solid ${theme.palette.secondary.main}` : `2px solid ${theme.palette.dark.main}4D`,
|
|
13
|
+
transition: 'all 0.2s',
|
|
14
|
+
backgroundColor: 'transparent',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
}));
|
|
19
|
+
const Radio = ({ label, description, className = '', id, checked, ...props }) => {
|
|
20
|
+
const radioId = id || `radio-${Math.random().toString(36).substr(2, 9)}`;
|
|
21
|
+
const { theme } = ThemeProvider.useTheme();
|
|
22
|
+
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) => {
|
|
23
|
+
const input = document.getElementById(radioId);
|
|
24
|
+
if (input && !props.disabled) {
|
|
25
|
+
input.click();
|
|
26
|
+
}
|
|
27
|
+
}, sx: {
|
|
28
|
+
cursor: props.disabled ? 'not-allowed' : 'pointer',
|
|
29
|
+
opacity: props.disabled ? 0.5 : 1,
|
|
30
|
+
} })] }), label: jsxRuntime.jsxs(material.Box, { sx: { ml: 0 }, children: [jsxRuntime.jsx(material.Typography, { component: "label", htmlFor: radioId, sx: {
|
|
31
|
+
fontSize: '1rem',
|
|
32
|
+
fontWeight: 500,
|
|
33
|
+
color: theme.palette.dark.main,
|
|
34
|
+
cursor: props.disabled ? 'not-allowed' : 'pointer',
|
|
35
|
+
opacity: props.disabled ? 0.5 : 1,
|
|
36
|
+
}, children: label }), description && (jsxRuntime.jsx(material.Typography, { variant: "body2", sx: {
|
|
37
|
+
fontSize: '0.875rem',
|
|
38
|
+
color: `${theme.palette.dark.main}99`,
|
|
39
|
+
mt: 0.25,
|
|
40
|
+
}, children: description }))] }), sx: { alignItems: 'flex-start', ml: 0 } }));
|
|
41
|
+
};
|
|
42
|
+
const RadioGroup = ({ label, error, children, className = '' }) => {
|
|
43
|
+
const { theme } = ThemeProvider.useTheme();
|
|
44
|
+
return (jsxRuntime.jsxs(material.FormControl, { component: "fieldset", className: className, error: !!error, fullWidth: true, children: [label && (jsxRuntime.jsx(material.FormLabel, { component: "legend", sx: {
|
|
45
|
+
fontSize: '0.875rem',
|
|
46
|
+
fontWeight: 500,
|
|
47
|
+
color: theme.palette.dark.main,
|
|
48
|
+
mb: 1.5,
|
|
49
|
+
'&.Mui-focused': {
|
|
50
|
+
color: theme.palette.dark.main,
|
|
51
|
+
},
|
|
52
|
+
}, children: label })), jsxRuntime.jsx(material.Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1.5 }, children: children }), error && (jsxRuntime.jsx(material.FormHelperText, { sx: {
|
|
53
|
+
mt: 1,
|
|
54
|
+
fontSize: '0.875rem',
|
|
55
|
+
color: theme.palette.accent.main,
|
|
56
|
+
}, children: error }))] }));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
exports.Radio = Radio;
|
|
60
|
+
exports.RadioGroup = RadioGroup;
|
|
61
|
+
//# sourceMappingURL=Radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../../../../src/components/Radio.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { Box, FormControl, FormLabel, FormHelperText, FormControlLabel, styled, Typography } from '@mui/material';\nimport { useTheme } from '../ThemeProvider';\n\ninterface RadioProps extends React.InputHTMLAttributes<HTMLInputElement> {\n label: string;\n description?: string;\n}\n\nconst CustomRadioIcon = styled('span')<{ checked?: boolean }>(({ theme, checked }) => ({\n width: 20,\n height: 20,\n borderRadius: '50%',\n border: checked ? `5px solid ${theme.palette.secondary.main}` : `2px solid ${theme.palette.dark.main}4D`,\n transition: 'all 0.2s',\n backgroundColor: 'transparent',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n}));\n\nexport const Radio: React.FC<RadioProps> = ({\n label,\n description,\n className = '',\n id,\n checked,\n ...props\n}) => {\n const radioId = id || `radio-${Math.random().toString(36).substr(2, 9)}`;\n const { theme } = useTheme();\n\n return (\n <FormControlLabel\n className={className}\n control={\n <Box sx={{ display: 'flex', alignItems: 'center', height: 24, mr: 1.5 }}>\n <input\n id={radioId}\n type=\"radio\"\n style={{ display: 'none' }}\n checked={checked}\n {...props}\n />\n <CustomRadioIcon \n checked={checked}\n onClick={(e) => {\n const input = document.getElementById(radioId) as HTMLInputElement;\n if (input && !props.disabled) {\n input.click();\n }\n }}\n sx={{\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n opacity: props.disabled ? 0.5 : 1,\n }}\n />\n </Box>\n }\n label={\n <Box sx={{ ml: 0 }}>\n <Typography\n component=\"label\"\n htmlFor={radioId}\n sx={{\n fontSize: '1rem',\n fontWeight: 500,\n color: theme.palette.dark.main,\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n opacity: props.disabled ? 0.5 : 1,\n }}\n >\n {label}\n </Typography>\n {description && (\n <Typography\n variant=\"body2\"\n sx={{\n fontSize: '0.875rem',\n color: `${theme.palette.dark.main}99`,\n mt: 0.25,\n }}\n >\n {description}\n </Typography>\n )}\n </Box>\n }\n sx={{ alignItems: 'flex-start', ml: 0 }}\n />\n );\n};\n\ninterface RadioGroupProps {\n label?: string;\n error?: string;\n children: React.ReactNode;\n className?: string;\n}\n\nexport const RadioGroup: React.FC<RadioGroupProps> = ({\n label,\n error,\n children,\n className = ''\n}) => {\n const { theme } = useTheme();\n\n return (\n <FormControl component=\"fieldset\" className={className} error={!!error} fullWidth>\n {label && (\n <FormLabel\n component=\"legend\"\n sx={{\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.palette.dark.main,\n mb: 1.5,\n '&.Mui-focused': {\n color: theme.palette.dark.main,\n },\n }}\n >\n {label}\n </FormLabel>\n )}\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>\n {children}\n </Box>\n {error && (\n <FormHelperText\n sx={{\n mt: 1,\n fontSize: '0.875rem',\n color: theme.palette.accent.main,\n }}\n >\n {error}\n </FormHelperText>\n )}\n </FormControl>\n );\n};"],"names":[],"mappings":";;;;;;;AAWA;AACE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACD;;;AAWC;AAEA;;AAgBY;;;;;;;AAiBA;AACA;AACA;;;AAGD;AAQG;;AAEA;AACD;AAUf;AASO;AAML;AAEA;AAMU;AACA;AACA;AACA;AACA;AACE;AACD;AACF;AAWC;AACA;AACA;AACD;AAOX;;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var material = require('@mui/material');
|
|
7
|
+
var ThemeProvider = require('../ThemeProvider.js');
|
|
8
|
+
var iconsMaterial = require('@mui/icons-material');
|
|
9
|
+
|
|
10
|
+
const ReadByContainer = material.styled(material.Box)(({ theme }) => ({
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
alignItems: 'flex-start',
|
|
14
|
+
gap: theme.spacing(2),
|
|
15
|
+
padding: theme.spacing(2),
|
|
16
|
+
borderLeft: `4px solid ${theme.palette.primary.main}`,
|
|
17
|
+
borderRadius: '0 8px 8px 0',
|
|
18
|
+
backgroundColor: theme.palette.custom?.readByBackgroundColor || theme.palette.accent.main,
|
|
19
|
+
[theme.breakpoints.down('sm')]: {
|
|
20
|
+
flexDirection: 'column',
|
|
21
|
+
padding: theme.spacing(1.5),
|
|
22
|
+
},
|
|
23
|
+
}));
|
|
24
|
+
const ExpandButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
25
|
+
width: 32,
|
|
26
|
+
height: 32,
|
|
27
|
+
backgroundColor: '#4d3019',
|
|
28
|
+
color: '#fff',
|
|
29
|
+
flexShrink: 0,
|
|
30
|
+
'&:hover': {
|
|
31
|
+
backgroundColor: '#4d3019',
|
|
32
|
+
opacity: 0.8,
|
|
33
|
+
},
|
|
34
|
+
[theme.breakpoints.down('sm')]: {
|
|
35
|
+
alignSelf: 'flex-end',
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
38
|
+
const ReadBy = ({ names }) => {
|
|
39
|
+
const { theme } = ThemeProvider.useTheme();
|
|
40
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
41
|
+
const displayText = isExpanded
|
|
42
|
+
? names.join(', ')
|
|
43
|
+
: names.length > 5
|
|
44
|
+
? `${names.slice(0, 5).join(', ')}...`
|
|
45
|
+
: names.join(', ');
|
|
46
|
+
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: {
|
|
47
|
+
fontSize: { xs: '13px', sm: '14px' },
|
|
48
|
+
fontWeight: 700,
|
|
49
|
+
color: theme.palette.dark.main,
|
|
50
|
+
}, children: "Read by:" }), jsxRuntime.jsx(material.Typography, { component: "span", sx: {
|
|
51
|
+
fontSize: { xs: '13px', sm: '14px' },
|
|
52
|
+
color: theme.palette.dark.main,
|
|
53
|
+
ml: 1,
|
|
54
|
+
}, 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 } })) }))] }));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.ReadBy = ReadBy;
|
|
58
|
+
//# sourceMappingURL=ReadBy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadBy.js","sources":["../../../../src/components/ReadBy.tsx"],"sourcesContent":["'use client';\n\nimport React, { useState } from 'react';\nimport { Box, IconButton, Typography, styled } from '@mui/material';\nimport { useTheme } from '../ThemeProvider';\nimport { ExpandLessRounded, ExpandMoreRounded } from '@mui/icons-material';\n\ninterface ReadByProps {\n names: string[];\n}\n\nconst ReadByContainer = styled(Box)(({ theme }) => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'flex-start',\n gap: theme.spacing(2),\n padding: theme.spacing(2),\n borderLeft: `4px solid ${theme.palette.primary.main}`,\n borderRadius: '0 8px 8px 0',\n backgroundColor: theme.palette.custom?.readByBackgroundColor || theme.palette.accent.main,\n [theme.breakpoints.down('sm')]: {\n flexDirection: 'column',\n padding: theme.spacing(1.5),\n },\n}));\n\nconst ExpandButton = styled(IconButton)(({ theme }) => ({\n width: 32,\n height: 32,\n backgroundColor: '#4d3019',\n color: '#fff',\n flexShrink: 0,\n '&:hover': {\n backgroundColor: '#4d3019',\n opacity: 0.8,\n },\n [theme.breakpoints.down('sm')]: {\n alignSelf: 'flex-end',\n },\n}));\n\nexport const ReadBy: React.FC<ReadByProps> = ({ names }) => {\n const { theme } = useTheme();\n const [isExpanded, setIsExpanded] = useState(false);\n\n const displayText = isExpanded\n ? names.join(', ')\n : names.length > 5\n ? `${names.slice(0, 5).join(', ')}...`\n : names.join(', ');\n\n return (\n <ReadByContainer>\n <Box sx={{ flex: 1, minWidth: 0, wordBreak: 'break-word' }}>\n <Typography\n component=\"span\"\n sx={{\n fontSize: { xs: '13px', sm: '14px' },\n fontWeight: 700,\n color: theme.palette.dark.main,\n }}\n >\n Read by:\n </Typography>\n <Typography\n component=\"span\"\n sx={{\n fontSize: { xs: '13px', sm: '14px' },\n color: theme.palette.dark.main,\n ml: 1,\n }}\n >\n {displayText}\n </Typography>\n </Box>\n {names.length > 5 && (\n <ExpandButton\n onClick={() => setIsExpanded(!isExpanded)}\n aria-label={isExpanded ? 'Collapse' : 'Expand'}\n size=\"small\"\n >\n {isExpanded ? (\n <ExpandLessRounded sx={{fontSize: 16}} />\n ) : (\n <ExpandMoreRounded sx={{fontSize: 16}} />\n )}\n </ExpandButton>\n )}\n </ReadByContainer>\n );\n};"],"names":[],"mappings":";;;;;;;;;AAWA;AACE;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEE;AACA;AACD;AACF;AAED;AACE;AACA;AACA;AACA;AACA;AACA;AACE;AACA;AACD;;AAEC;AACD;AACF;;AAGC;;;AAIE;AACA;AACE;AACA;AAEJ;;AAOU;AACA;;;AASA;AACA;AACD;AAoBX;;"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var material = require('@mui/material');
|
|
6
|
+
var ThemeProvider = require('../ThemeProvider.js');
|
|
7
|
+
var iconsMaterial = require('@mui/icons-material');
|
|
8
|
+
|
|
9
|
+
const StyledSelect = material.styled(material.Select)(({ theme, error }) => ({
|
|
10
|
+
backgroundColor: theme.palette.light.main,
|
|
11
|
+
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
12
|
+
? parseInt(theme.shape.borderRadius, 10)
|
|
13
|
+
: theme.shape.borderRadius || 4) * 2,
|
|
14
|
+
fontSize: '1rem',
|
|
15
|
+
color: theme.palette.dark.main,
|
|
16
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
17
|
+
borderColor: error ? theme.palette.accent.main : `${theme.palette.dark.main}33`,
|
|
18
|
+
},
|
|
19
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
20
|
+
borderColor: error ? theme.palette.accent.main : theme.palette.primary.main,
|
|
21
|
+
},
|
|
22
|
+
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
23
|
+
borderWidth: 2,
|
|
24
|
+
borderColor: error ? theme.palette.accent.main : theme.palette.primary.main,
|
|
25
|
+
},
|
|
26
|
+
'&.Mui-disabled': {
|
|
27
|
+
backgroundColor: `${theme.palette.dark.main}0D`,
|
|
28
|
+
'& .MuiSelect-select': {
|
|
29
|
+
color: `${theme.palette.dark.main}80`,
|
|
30
|
+
cursor: 'not-allowed',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
'& .MuiSelect-icon': {
|
|
34
|
+
color: `${theme.palette.dark.main}66`,
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
37
|
+
const StyledInputLabel = material.styled(material.InputLabel)(({ theme }) => ({
|
|
38
|
+
fontSize: '0.875rem',
|
|
39
|
+
fontWeight: 500,
|
|
40
|
+
color: theme.palette.dark.main,
|
|
41
|
+
position: 'relative',
|
|
42
|
+
transform: 'none',
|
|
43
|
+
marginBottom: theme.spacing(0.75),
|
|
44
|
+
'&.Mui-focused': {
|
|
45
|
+
color: theme.palette.dark.main,
|
|
46
|
+
},
|
|
47
|
+
}));
|
|
48
|
+
const Select = ({ label, error, helperText, fullWidth = false, options, className = '', id, value, onChange, disabled, name, }) => {
|
|
49
|
+
const { theme } = ThemeProvider.useTheme();
|
|
50
|
+
const selectId = id || `select-${Math.random().toString(36).substr(2, 9)}`;
|
|
51
|
+
const handleChange = (event) => {
|
|
52
|
+
if (onChange) {
|
|
53
|
+
// Create a synthetic event that matches React.ChangeEvent<HTMLSelectElement>
|
|
54
|
+
const syntheticEvent = {
|
|
55
|
+
target: {
|
|
56
|
+
value: event.target.value,
|
|
57
|
+
name: name || '',
|
|
58
|
+
},
|
|
59
|
+
currentTarget: event.currentTarget,
|
|
60
|
+
};
|
|
61
|
+
onChange(syntheticEvent);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
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: {
|
|
65
|
+
PaperProps: {
|
|
66
|
+
sx: {
|
|
67
|
+
mt: 1,
|
|
68
|
+
borderRadius: 2,
|
|
69
|
+
boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
}, children: options.map((option) => (jsxRuntime.jsx(material.MenuItem, { value: option.value, sx: {
|
|
73
|
+
fontSize: '1rem',
|
|
74
|
+
color: theme.palette.dark.main,
|
|
75
|
+
'&:hover': {
|
|
76
|
+
backgroundColor: `${theme.palette.primary.main}1A`,
|
|
77
|
+
},
|
|
78
|
+
'&.Mui-selected': {
|
|
79
|
+
backgroundColor: `${theme.palette.primary.main}26`,
|
|
80
|
+
'&:hover': {
|
|
81
|
+
backgroundColor: `${theme.palette.primary.main}33`,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
}, children: option.label }, option.value))) }), error && (jsxRuntime.jsx(material.FormHelperText, { sx: {
|
|
85
|
+
mt: 0.75,
|
|
86
|
+
fontSize: '0.875rem',
|
|
87
|
+
color: theme.palette.accent.main,
|
|
88
|
+
}, children: error })), helperText && !error && (jsxRuntime.jsx(material.FormHelperText, { sx: {
|
|
89
|
+
mt: 0.75,
|
|
90
|
+
fontSize: '0.875rem',
|
|
91
|
+
color: `${theme.palette.dark.main}99`,
|
|
92
|
+
}, children: helperText }))] }));
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
exports.Select = Select;
|
|
96
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../src/components/Select.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { FormControl, InputLabel, Select as MuiSelect, MenuItem, FormHelperText, styled } from '@mui/material';\nimport { useTheme } from '../ThemeProvider';\nimport { ExpandMoreRounded } from '@mui/icons-material';\n\ninterface SelectProps {\n label?: string;\n error?: string;\n helperText?: string;\n fullWidth?: boolean;\n options: { value: string; label: string }[];\n value?: string;\n onChange?: (event: React.ChangeEvent<HTMLSelectElement>) => void;\n disabled?: boolean;\n className?: string;\n id?: string;\n name?: string;\n}\n\nconst StyledSelect = styled(MuiSelect)(({ theme, error }) => ({\n backgroundColor: theme.palette.light.main,\n borderRadius: (typeof theme.shape.borderRadius === 'string'\n ? parseInt(theme.shape.borderRadius, 10)\n : theme.shape.borderRadius || 4) * 2,\n fontSize: '1rem',\n color: theme.palette.dark.main,\n '& .MuiOutlinedInput-notchedOutline': {\n borderColor: error ? theme.palette.accent.main : `${theme.palette.dark.main}33`,\n },\n '&:hover .MuiOutlinedInput-notchedOutline': {\n borderColor: error ? theme.palette.accent.main : theme.palette.primary.main,\n },\n '&.Mui-focused .MuiOutlinedInput-notchedOutline': {\n borderWidth: 2,\n borderColor: error ? theme.palette.accent.main : theme.palette.primary.main,\n },\n '&.Mui-disabled': {\n backgroundColor: `${theme.palette.dark.main}0D`,\n '& .MuiSelect-select': {\n color: `${theme.palette.dark.main}80`,\n cursor: 'not-allowed',\n },\n },\n '& .MuiSelect-icon': {\n color: `${theme.palette.dark.main}66`,\n },\n}));\n\nconst StyledInputLabel = styled(InputLabel)(({ theme }) => ({\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.palette.dark.main,\n position: 'relative',\n transform: 'none',\n marginBottom: theme.spacing(0.75),\n '&.Mui-focused': {\n color: theme.palette.dark.main,\n },\n}));\n\nexport const Select: React.FC<SelectProps> = ({\n label,\n error,\n helperText,\n fullWidth = false,\n options,\n className = '',\n id,\n value,\n onChange,\n disabled,\n name,\n}) => {\n const { theme } = useTheme();\n const selectId = id || `select-${Math.random().toString(36).substr(2, 9)}`;\n\n const handleChange = (event: any) => {\n if (onChange) {\n // Create a synthetic event that matches React.ChangeEvent<HTMLSelectElement>\n const syntheticEvent = {\n target: {\n value: event.target.value,\n name: name || '',\n },\n currentTarget: event.currentTarget,\n } as React.ChangeEvent<HTMLSelectElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <FormControl \n fullWidth={fullWidth} \n error={!!error}\n className={className}\n >\n {label && (\n <StyledInputLabel htmlFor={selectId} shrink={false}>\n {label}\n </StyledInputLabel>\n )}\n <StyledSelect\n id={selectId}\n name={name}\n value={value || ''}\n onChange={handleChange}\n disabled={disabled}\n error={!!error}\n IconComponent={ExpandMoreRounded}\n MenuProps={{\n PaperProps: {\n sx: {\n mt: 1,\n borderRadius: 2,\n boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',\n },\n },\n }}\n >\n {options.map((option) => (\n <MenuItem \n key={option.value} \n value={option.value}\n sx={{\n fontSize: '1rem',\n color: theme.palette.dark.main,\n '&:hover': {\n backgroundColor: `${theme.palette.primary.main}1A`,\n },\n '&.Mui-selected': {\n backgroundColor: `${theme.palette.primary.main}26`,\n '&:hover': {\n backgroundColor: `${theme.palette.primary.main}33`,\n },\n },\n }}\n >\n {option.label}\n </MenuItem>\n ))}\n </StyledSelect>\n {error && (\n <FormHelperText\n sx={{\n mt: 0.75,\n fontSize: '0.875rem',\n color: theme.palette.accent.main,\n }}\n >\n {error}\n </FormHelperText>\n )}\n {helperText && !error && (\n <FormHelperText\n sx={{\n mt: 0.75,\n fontSize: '0.875rem',\n color: `${theme.palette.dark.main}99`,\n }}\n >\n {helperText}\n </FormHelperText>\n )}\n </FormControl>\n );\n};"],"names":[],"mappings":";;;;;;;;AAqBA;AACE;;;;AAIA;AACA;AACA;;AAEC;AACD;;AAEC;AACD;AACE;;AAED;AACD;;AAEE;;AAEE;AACD;AACF;AACD;;AAEC;AACF;AAED;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACE;AACD;AACF;AAEM;AAaL;;AAGA;;;AAGI;AACE;AACE;;AAED;;;;;AAKP;AAEA;AAoBQ;AACE;AACE;AACA;AACA;AACD;AACF;;AAQG;AACA;AACA;;AAEC;AACD;;AAEE;;AAEC;AACF;AACF;AASD;AACA;AACA;AACD;AAQC;AACA;;AAED;AAOX;;"}
|