ece-docs-components 1.0.9 → 1.0.10

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.
@@ -1,31 +1,29 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useState } from 'react';
3
- import { styled, Box, Typography, IconButton, Collapse } from '@mui/material';
4
- import { ExpandMoreRounded, LinkRounded } from '@mui/icons-material';
3
+ import { styled, Box, Typography, Collapse } from '@mui/material';
4
+ import { ExpandMoreRounded, ExpandCircleDownOutlined } from '@mui/icons-material';
5
5
 
6
6
  const StyledConcertina = styled(Box)(({ theme }) => ({
7
7
  width: '100%',
8
8
  display: 'flex',
9
9
  flexDirection: 'column',
10
- gap: theme.spacing(1), // space-y-2
10
+ gap: theme.spacing(1),
11
11
  }));
12
12
  const StyledSection = styled(Box)(({ theme }) => ({
13
- border: `1px solid ${theme.palette.grey[200]}`, // border-gray-200
14
- borderRadius: (typeof theme.shape.borderRadius === 'string'
15
- ? parseInt(theme.shape.borderRadius, 10)
16
- : theme.shape.borderRadius || 4) * 2, // rounded-lg
13
+ borderTop: `2px solid ${theme.palette.grey[200]}`,
14
+ borderBottom: `2px solid ${theme.palette.grey[200]}`,
17
15
  overflow: 'hidden',
18
16
  }));
19
17
  const StyledHeader = styled(Box)(({ theme }) => ({
20
18
  display: 'flex',
21
19
  alignItems: 'center',
22
20
  justifyContent: 'space-between',
23
- padding: theme.spacing(3), // p-3 sm:p-4 md:p-6
21
+ padding: theme.spacing(3),
24
22
  cursor: 'pointer',
25
23
  transition: 'background-color 0.2s',
26
- gap: theme.spacing(2), // gap-2
24
+ gap: theme.spacing(2),
27
25
  '&:hover': {
28
- backgroundColor: theme.palette.light.main, // hover:bg-[#FDFCEE]
26
+ backgroundColor: theme.palette.background.default,
29
27
  },
30
28
  [theme.breakpoints.up('sm')]: {
31
29
  padding: theme.spacing(4),
@@ -37,95 +35,108 @@ const StyledHeader = styled(Box)(({ theme }) => ({
37
35
  const StyledTitleWrapper = styled(Box)(({ theme }) => ({
38
36
  display: 'flex',
39
37
  alignItems: 'center',
40
- gap: theme.spacing(3), // sm:gap-3
38
+ gap: 0,
41
39
  flex: 1,
42
40
  minWidth: 0,
43
- [theme.breakpoints.down('sm')]: {
44
- gap: theme.spacing(2), // gap-2
45
- },
41
+ }));
42
+ const StyledHashtag = styled('span', {
43
+ shouldForwardProp: (prop) => prop !== 'isVisible',
44
+ })(({ theme, isVisible }) => ({
45
+ color: theme.palette.info.main,
46
+ fontWeight: 700,
47
+ fontSize: 'inherit',
48
+ opacity: isVisible ? 1 : 0,
49
+ transition: 'opacity 0.2s',
50
+ marginRight: isVisible ? '0.25em' : 0,
51
+ cursor: 'pointer',
46
52
  }));
47
53
  const StyledTitle = styled(Typography, {
48
54
  shouldForwardProp: (prop) => prop !== 'isHovered',
49
55
  })(({ theme, isHovered }) => ({
50
- fontWeight: 700, // font-bold
51
- fontSize: '1.5rem', // text-2xl
52
- lineHeight: 1.2, // leading-tight
53
- color: theme.palette.dark.main, // text-[#4D3019]
54
- wordBreak: 'break-word', // break-words
56
+ fontWeight: 700,
57
+ fontSize: '1.75rem',
58
+ lineHeight: 1.2,
59
+ color: theme.palette.dark.main,
60
+ wordBreak: 'break-word',
61
+ display: 'inline-block',
55
62
  position: 'relative',
56
- '&:after': {
57
- content: '""',
58
- position: 'absolute',
59
- bottom: 0,
60
- left: 0,
61
- width: '100%',
62
- height: 1,
63
- backgroundColor: theme.palette.accent.main, // bg-orange-500
64
- display: isHovered ? 'block' : 'none',
65
- },
63
+ paddingBottom: '2px',
64
+ borderBottom: isHovered ? `3px solid ${theme.palette.info.main}` : '3px solid transparent',
65
+ transition: 'border-bottom 0.2s',
66
66
  [theme.breakpoints.down('lg')]: {
67
- fontSize: '1.25rem', // lg:text-[28px]
67
+ fontSize: '1.25rem',
68
68
  },
69
69
  [theme.breakpoints.down('md')]: {
70
- fontSize: '1.125rem', // md:text-xl
70
+ fontSize: '1.125rem',
71
71
  },
72
72
  [theme.breakpoints.down('sm')]: {
73
- fontSize: '1rem', // sm:text-lg
73
+ fontSize: '1rem',
74
74
  },
75
75
  }));
76
- const StyledLinkButton = styled(IconButton)(({ theme }) => ({
77
- color: theme.palette.accent.main, // text-orange-500
78
- '&:hover': {
79
- color: theme.palette.accent.dark || theme.palette.accent.main, // hover:text-orange-600
80
- },
81
- padding: 0,
82
- }));
83
76
  const StyledTooltip = styled(Box)(({ theme }) => ({
84
- position: 'absolute',
85
- top: -40, // -top-10
86
- left: '50%',
87
- transform: 'translateX(-50%)',
88
- backgroundColor: theme.palette.grey[900], // bg-gray-900
89
- color: theme.palette.common.white, // text-white
90
- fontSize: '0.75rem', // text-xs
91
- padding: theme.spacing(1, 2), // px-2 py-1
92
- borderRadius: theme.shape.borderRadius, // rounded
77
+ position: 'fixed',
78
+ transform: 'translate(-50%, -120%)',
79
+ backgroundColor: theme.palette.grey[900],
80
+ color: theme.palette.common.white,
81
+ fontSize: '0.75rem',
82
+ padding: theme.spacing(1, 2),
83
+ borderRadius: theme.shape.borderRadius,
93
84
  whiteSpace: 'nowrap',
94
- zIndex: 10,
85
+ zIndex: 1000,
86
+ pointerEvents: 'none',
95
87
  [theme.breakpoints.up('sm')]: {
96
- fontSize: '0.875rem', // sm:text-sm
97
- padding: theme.spacing(1.5, 3), // sm:px-3 sm:py-1.5
88
+ fontSize: '0.875rem',
89
+ padding: theme.spacing(1.5, 3),
98
90
  },
99
91
  }));
100
- const StyledChevron = styled(ExpandMoreRounded)(({ theme }) => ({
101
- color: theme.palette.grey[500], // text-gray-500
102
- transition: 'transform 0.2s', // transition-transform duration-200
103
- width: 24, // sm:w-6
104
- height: 24, // sm:h-6
92
+ styled(ExpandMoreRounded)(({ theme }) => ({
93
+ color: theme.palette.grey[500],
94
+ transition: 'transform 0.2s',
95
+ width: 24,
96
+ height: 24,
105
97
  [theme.breakpoints.down('sm')]: {
106
98
  width: 20,
107
99
  height: 20,
108
100
  },
109
101
  }));
110
102
  const StyledContent = styled(Box)(({ theme }) => ({
111
- padding: theme.spacing(2, 3, 3), // px-3 pb-3 pt-2
103
+ padding: theme.spacing(2, 3, 3),
112
104
  [theme.breakpoints.up('sm')]: {
113
- padding: theme.spacing(2, 4, 4), // sm:px-4 sm:pb-4
105
+ padding: theme.spacing(2, 4, 4),
114
106
  },
115
107
  [theme.breakpoints.up('md')]: {
116
- padding: theme.spacing(2, 6, 6), // md:px-6 md:pb-6
108
+ padding: theme.spacing(2, 6, 6),
117
109
  },
118
110
  }));
119
- const StyledContentText = styled(Typography)(({ theme }) => ({
120
- color: theme.palette.dark.main, // text-[#4D3019]
121
- lineHeight: 1.5, // leading-relaxed
122
- wordBreak: 'break-word', // break-words
123
- fontSize: 13, // style={{ fontSize: '13px' }}
111
+ const StyledContentWrapper = styled(Box)(({ theme }) => ({
112
+ color: theme.palette.dark.main,
113
+ lineHeight: 1.5,
114
+ wordBreak: 'break-word',
115
+ fontSize: 13,
116
+ '& p': {
117
+ margin: 0,
118
+ marginBottom: theme.spacing(2),
119
+ '&:last-child': {
120
+ marginBottom: 0,
121
+ },
122
+ },
123
+ '& ul, & ol': {
124
+ marginTop: theme.spacing(1),
125
+ marginBottom: theme.spacing(2),
126
+ paddingLeft: theme.spacing(3),
127
+ '&:last-child': {
128
+ marginBottom: 0,
129
+ },
130
+ },
131
+ '& li': {
132
+ marginBottom: theme.spacing(0.5),
133
+ },
124
134
  }));
125
135
  function Concertina({ sections }) {
126
136
  const [openSections, setOpenSections] = useState(new Set());
127
137
  const [hoveredTitle, setHoveredTitle] = useState(null);
128
138
  const [copiedId, setCopiedId] = useState(null);
139
+ const [tooltipPosition, setTooltipPosition] = useState(null);
129
140
  const toggleSection = (id) => {
130
141
  const newOpenSections = new Set(openSections);
131
142
  if (newOpenSections.has(id)) {
@@ -141,9 +152,16 @@ function Concertina({ sections }) {
141
152
  const url = `${window.location.origin}${window.location.pathname}#${id}`;
142
153
  navigator.clipboard.writeText(url);
143
154
  setCopiedId(id);
144
- setTimeout(() => setCopiedId(null), 2000);
155
+ setTooltipPosition({ x: e.clientX, y: e.clientY });
156
+ setTimeout(() => {
157
+ setCopiedId(null);
158
+ setTooltipPosition(null);
159
+ }, 2000);
145
160
  };
146
- return (jsx(StyledConcertina, { children: sections.map((section) => (jsxs(StyledSection, { id: section.id, children: [jsxs(StyledHeader, { onClick: () => toggleSection(section.id), onMouseEnter: () => setHoveredTitle(section.id), onMouseLeave: () => setHoveredTitle(null), children: [jsxs(StyledTitleWrapper, { children: [jsx(StyledTitle, { isHovered: hoveredTitle === section.id, variant: "h3", children: section.title }), hoveredTitle === section.id && (jsxs(Box, { sx: { position: 'relative', flexShrink: 0 }, children: [jsx(StyledLinkButton, { onClick: (e) => copyJumpLink(section.id, e), "aria-label": "Copy link", children: jsx(LinkRounded, { sx: { fontSize: 20 } }) }), copiedId === section.id && (jsx(StyledTooltip, { children: "Link copied" }))] }))] }), jsx(StyledChevron, { sx: { fontSize: 20, transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' } })] }), jsx(Collapse, { in: openSections.has(section.id), children: jsx(StyledContent, { children: jsx(StyledContentText, { children: section.content }) }) })] }, section.id))) }));
161
+ return (jsxs(StyledConcertina, { children: [sections.map((section) => (jsxs(StyledSection, { id: section.id, children: [jsxs(StyledHeader, { onClick: () => toggleSection(section.id), onMouseEnter: () => setHoveredTitle(section.id), onMouseLeave: () => setHoveredTitle(null), children: [jsx(StyledTitleWrapper, { children: jsxs(StyledTitle, { isHovered: hoveredTitle === section.id, variant: "h3", children: [jsx(StyledHashtag, { isVisible: hoveredTitle === section.id, onClick: (e) => copyJumpLink(section.id, e), children: "#" }), section.title] }) }), jsx(ExpandCircleDownOutlined, { sx: { fontSize: '1.5rem', transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' } })] }), jsx(Collapse, { in: openSections.has(section.id), children: jsx(StyledContent, { children: jsx(StyledContentWrapper, { children: section.content }) }) })] }, section.id))), copiedId && tooltipPosition && (jsx(StyledTooltip, { sx: {
162
+ left: tooltipPosition.x,
163
+ top: tooltipPosition.y,
164
+ }, children: "Link copied" }))] }));
147
165
  }
148
166
 
149
167
  export { Concertina };
@@ -1 +1 @@
1
- {"version":3,"file":"Concertina.js","sources":["../../../../src/components/Concertina.tsx"],"sourcesContent":["\n\nimport React, { useState } from 'react';\nimport { Box, styled, Typography, IconButton, Collapse } from '@mui/material';\nimport { ExpandMoreRounded, LinkRounded } from '@mui/icons-material';\n\ninterface ConcertinaSection {\n id: string;\n title: string;\n content: string;\n}\n\ninterface ConcertinaProps {\n sections: ConcertinaSection[];\n}\n\nconst StyledConcertina = styled(Box)(({ theme }) => ({\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(1), // space-y-2\n}));\n\nconst StyledSection = styled(Box)(({ theme }) => ({\n border: `1px solid ${theme.palette.grey[200]}`, // border-gray-200\n borderRadius: (typeof theme.shape.borderRadius === 'string'\n ? parseInt(theme.shape.borderRadius, 10)\n : theme.shape.borderRadius || 4) * 2, // rounded-lg\n overflow: 'hidden',\n}));\n\nconst StyledHeader = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: theme.spacing(3), // p-3 sm:p-4 md:p-6\n cursor: 'pointer',\n transition: 'background-color 0.2s',\n gap: theme.spacing(2), // gap-2\n '&:hover': {\n backgroundColor: theme.palette.light.main, // hover:bg-[#FDFCEE]\n },\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(4),\n },\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(6),\n },\n}));\n\nconst StyledTitleWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(3), // sm:gap-3\n flex: 1,\n minWidth: 0,\n [theme.breakpoints.down('sm')]: {\n gap: theme.spacing(2), // gap-2\n },\n}));\n\nconst StyledTitle = styled(Typography, {\n shouldForwardProp: (prop) => prop !== 'isHovered',\n})<{ isHovered: boolean }>(({ theme, isHovered }) => ({\n fontWeight: 700, // font-bold\n fontSize: '1.5rem', // text-2xl\n lineHeight: 1.2, // leading-tight\n color: theme.palette.dark.main, // text-[#4D3019]\n wordBreak: 'break-word', // break-words\n position: 'relative',\n '&:after': {\n content: '\"\"',\n position: 'absolute',\n bottom: 0,\n left: 0,\n width: '100%',\n height: 1,\n backgroundColor: theme.palette.accent.main, // bg-orange-500\n display: isHovered ? 'block' : 'none',\n },\n [theme.breakpoints.down('lg')]: {\n fontSize: '1.25rem', // lg:text-[28px]\n },\n [theme.breakpoints.down('md')]: {\n fontSize: '1.125rem', // md:text-xl\n },\n [theme.breakpoints.down('sm')]: {\n fontSize: '1rem', // sm:text-lg\n },\n}));\n\nconst StyledLinkButton = styled(IconButton)(({ theme }) => ({\n color: theme.palette.accent.main, // text-orange-500\n '&:hover': {\n color: theme.palette.accent.dark || theme.palette.accent.main, // hover:text-orange-600\n },\n padding: 0,\n}));\n\nconst StyledTooltip = styled(Box)(({ theme }) => ({\n position: 'absolute',\n top: -40, // -top-10\n left: '50%',\n transform: 'translateX(-50%)',\n backgroundColor: theme.palette.grey[900], // bg-gray-900\n color: theme.palette.common.white, // text-white\n fontSize: '0.75rem', // text-xs\n padding: theme.spacing(1, 2), // px-2 py-1\n borderRadius: theme.shape.borderRadius, // rounded\n whiteSpace: 'nowrap',\n zIndex: 10,\n [theme.breakpoints.up('sm')]: {\n fontSize: '0.875rem', // sm:text-sm\n padding: theme.spacing(1.5, 3), // sm:px-3 sm:py-1.5\n },\n}));\n\nconst StyledChevron = styled(ExpandMoreRounded)(({ theme }) => ({\n color: theme.palette.grey[500], // text-gray-500\n transition: 'transform 0.2s', // transition-transform duration-200\n width: 24, // sm:w-6\n height: 24, // sm:h-6\n [theme.breakpoints.down('sm')]: {\n width: 20,\n height: 20,\n },\n}));\n\nconst StyledContent = styled(Box)(({ theme }) => ({\n padding: theme.spacing(2, 3, 3), // px-3 pb-3 pt-2\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(2, 4, 4), // sm:px-4 sm:pb-4\n },\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(2, 6, 6), // md:px-6 md:pb-6\n },\n}));\n\nconst StyledContentText = styled(Typography)(({ theme }) => ({\n color: theme.palette.dark.main, // text-[#4D3019]\n lineHeight: 1.5, // leading-relaxed\n wordBreak: 'break-word', // break-words\n fontSize: 13, // style={{ fontSize: '13px' }}\n}));\n\nexport function Concertina({ sections }: ConcertinaProps) {\n const [openSections, setOpenSections] = useState<Set<string>>(new Set());\n const [hoveredTitle, setHoveredTitle] = useState<string | null>(null);\n const [copiedId, setCopiedId] = useState<string | null>(null);\n\n const toggleSection = (id: string) => {\n const newOpenSections = new Set(openSections);\n if (newOpenSections.has(id)) {\n newOpenSections.delete(id);\n } else {\n newOpenSections.add(id);\n }\n setOpenSections(newOpenSections);\n };\n\n const copyJumpLink = (id: string, e: React.MouseEvent) => {\n e.stopPropagation();\n const url = `${window.location.origin}${window.location.pathname}#${id}`;\n navigator.clipboard.writeText(url);\n setCopiedId(id);\n setTimeout(() => setCopiedId(null), 2000);\n };\n\n return (\n <StyledConcertina>\n {sections.map((section) => (\n <StyledSection key={section.id} id={section.id}>\n <StyledHeader\n onClick={() => toggleSection(section.id)}\n onMouseEnter={() => setHoveredTitle(section.id)}\n onMouseLeave={() => setHoveredTitle(null)}\n >\n <StyledTitleWrapper>\n <StyledTitle isHovered={hoveredTitle === section.id} variant=\"h3\">\n {section.title}\n </StyledTitle>\n {hoveredTitle === section.id && (\n <Box sx={{ position: 'relative', flexShrink: 0 }}>\n <StyledLinkButton\n onClick={(e) => copyJumpLink(section.id, e)}\n aria-label=\"Copy link\"\n >\n <LinkRounded sx={{fontSize: 20}} />\n </StyledLinkButton>\n {copiedId === section.id && (\n <StyledTooltip>\n Link copied\n </StyledTooltip>\n )}\n </Box>\n )}\n </StyledTitleWrapper>\n <StyledChevron\n sx={{ fontSize:20, transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' }}\n />\n </StyledHeader>\n <Collapse in={openSections.has(section.id)}>\n <StyledContent>\n <StyledContentText>{section.content}</StyledContentText>\n </StyledContent>\n </Collapse>\n </StyledSection>\n ))}\n </StyledConcertina>\n );\n}"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAgBA,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACnD,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,aAAa,EAAE,QAAQ;IACvB,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACtB,CAAA,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AAChD,IAAA,MAAM,EAAE,CAAA,UAAA,EAAa,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAE;IAC9C,YAAY,EAAE,CAAC,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,KAAK;UACjD,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE;AACvC,UAAE,KAAK,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC;AACpC,IAAA,QAAQ,EAAE,QAAQ;AACnB,CAAA,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AAC/C,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,UAAU,EAAE,QAAQ;AACpB,IAAA,cAAc,EAAE,eAAe;IAC/B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACzB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,UAAU,EAAE,uBAAuB;IACnC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACrB,IAAA,SA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aAAa,EAAA,EAAA,QAAA,EAAA,aAAA,EAAA,CAEE,CACjB,CAAA,EAAA,CACG,CACP,IACkB,EACrBA,GAAA,CAAC,aAAa,EAAA,EACZ,EAAE,EAAE,EAAE,QAAQ,EAAC,EAAE,EAAE,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,gBAAgB,GAAG,MAAM,EAAE,EAAA,CACxF,CAAA,EAAA,CACW,EACfA,GAAA,CAAC,QAAQ,EAAA,EAAC,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAA,QAAA,EACxCA,GAAA,CAAC,aAAa,EAAA,EAAA,QAAA,EACZA,GAAA,CAAC,iBAAiB,EAAA,EAAA,QAAA,EAAE,OAAO,CAAC,OAAO,EAAA,CAAqB,EAAA,CAC1C,EAAA,CACP,CAAA,EAAA,EAlCO,OAAO,CAAC,EAAE,CAmCd,CACjB,CAAC,EAAA,CACe;AAEvB;;;;"}
1
+ {"version":3,"file":"Concertina.js","sources":["../../../../src/components/Concertina.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Box, styled, Typography, Collapse } from '@mui/material';\nimport { ExpandCircleDown, ExpandCircleDownOutlined, ExpandMoreRounded } from '@mui/icons-material';\n\n\ninterface ConcertinaSection {\n id: string;\n title: string;\n content: React.ReactNode;\n}\n\n\ninterface ConcertinaProps {\n sections: ConcertinaSection[];\n}\n\n\nconst StyledConcertina = styled(Box)(({ theme }) => ({\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(1),\n}));\n\n\nconst StyledSection = styled(Box)(({ theme }) => ({\n borderTop: `2px solid ${theme.palette.grey[200]}`,\n borderBottom: `2px solid ${theme.palette.grey[200]}`,\n overflow: 'hidden',\n}));\n\n\nconst StyledHeader = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: theme.spacing(3),\n cursor: 'pointer',\n transition: 'background-color 0.2s',\n gap: theme.spacing(2),\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n },\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(4),\n },\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(6),\n },\n}));\n\n\nconst StyledTitleWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: 0,\n flex: 1,\n minWidth: 0,\n}));\n\n\nconst StyledHashtag = styled('span', {\n shouldForwardProp: (prop) => prop !== 'isVisible',\n})<{ isVisible: boolean }>(({ theme, isVisible }) => ({\n color: theme.palette.info.main,\n fontWeight: 700,\n fontSize: 'inherit',\n opacity: isVisible ? 1 : 0,\n transition: 'opacity 0.2s',\n marginRight: isVisible ? '0.25em' : 0,\n cursor: 'pointer',\n}));\n\n\nconst StyledTitle = styled(Typography, {\n shouldForwardProp: (prop) => prop !== 'isHovered',\n})<{ isHovered: boolean }>(({ theme, isHovered }) => ({\n fontWeight: 700,\n fontSize: '1.75rem',\n lineHeight: 1.2,\n color: theme.palette.dark.main,\n wordBreak: 'break-word',\n display: 'inline-block',\n position: 'relative',\n paddingBottom: '2px',\n borderBottom: isHovered ? `3px solid ${theme.palette.info.main}` : '3px solid transparent',\n transition: 'border-bottom 0.2s',\n [theme.breakpoints.down('lg')]: {\n fontSize: '1.25rem',\n },\n [theme.breakpoints.down('md')]: {\n fontSize: '1.125rem',\n },\n [theme.breakpoints.down('sm')]: {\n fontSize: '1rem',\n },\n}));\n\n\nconst StyledTooltip = styled(Box)(({ theme }) => ({\n position: 'fixed',\n transform: 'translate(-50%, -120%)',\n backgroundColor: theme.palette.grey[900],\n color: theme.palette.common.white,\n fontSize: '0.75rem',\n padding: theme.spacing(1, 2),\n borderRadius: theme.shape.borderRadius,\n whiteSpace: 'nowrap',\n zIndex: 1000,\n pointerEvents: 'none',\n [theme.breakpoints.up('sm')]: {\n fontSize: '0.875rem',\n padding: theme.spacing(1.5, 3),\n },\n}));\n\n\nconst StyledChevron = styled(ExpandMoreRounded)(({ theme }) => ({\n color: theme.palette.grey[500],\n transition: 'transform 0.2s',\n width: 24,\n height: 24,\n [theme.breakpoints.down('sm')]: {\n width: 20,\n height: 20,\n },\n}));\n\n\nconst StyledContent = styled(Box)(({ theme }) => ({\n padding: theme.spacing(2, 3, 3),\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(2, 4, 4),\n },\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(2, 6, 6),\n },\n}));\n\n\nconst StyledContentWrapper = styled(Box)(({ theme }) => ({\n color: theme.palette.dark.main,\n lineHeight: 1.5,\n wordBreak: 'break-word',\n fontSize: 13,\n '& p': {\n margin: 0,\n marginBottom: theme.spacing(2),\n '&:last-child': {\n marginBottom: 0,\n },\n },\n '& ul, & ol': {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(2),\n paddingLeft: theme.spacing(3),\n '&:last-child': {\n marginBottom: 0,\n },\n },\n '& li': {\n marginBottom: theme.spacing(0.5),\n },\n}));\n\n\nexport function Concertina({ sections }: ConcertinaProps) {\n const [openSections, setOpenSections] = useState<Set<string>>(new Set());\n const [hoveredTitle, setHoveredTitle] = useState<string | null>(null);\n const [copiedId, setCopiedId] = useState<string | null>(null);\n const [tooltipPosition, setTooltipPosition] = useState<{ x: number; y: number } | null>(null);\n\n\n const toggleSection = (id: string) => {\n const newOpenSections = new Set(openSections);\n if (newOpenSections.has(id)) {\n newOpenSections.delete(id);\n } else {\n newOpenSections.add(id);\n }\n setOpenSections(newOpenSections);\n };\n\n\n const copyJumpLink = (id: string, e: React.MouseEvent) => {\n e.stopPropagation();\n const url = `${window.location.origin}${window.location.pathname}#${id}`;\n navigator.clipboard.writeText(url);\n setCopiedId(id);\n setTooltipPosition({ x: e.clientX, y: e.clientY });\n setTimeout(() => {\n setCopiedId(null);\n setTooltipPosition(null);\n }, 2000);\n };\n\n\n return (\n <StyledConcertina>\n {sections.map((section) => (\n <StyledSection key={section.id} id={section.id}>\n <StyledHeader\n onClick={() => toggleSection(section.id)}\n onMouseEnter={() => setHoveredTitle(section.id)}\n onMouseLeave={() => setHoveredTitle(null)}\n >\n <StyledTitleWrapper>\n <StyledTitle isHovered={hoveredTitle === section.id} variant=\"h3\">\n <StyledHashtag\n isVisible={hoveredTitle === section.id}\n onClick={(e) => copyJumpLink(section.id, e as any)}\n >\n #\n </StyledHashtag>\n {section.title}\n </StyledTitle>\n </StyledTitleWrapper>\n <ExpandCircleDownOutlined\n sx={{ fontSize: '1.5rem', transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' }}\n />\n </StyledHeader>\n <Collapse in={openSections.has(section.id)}>\n <StyledContent>\n <StyledContentWrapper>{section.content}</StyledContentWrapper>\n </StyledContent>\n </Collapse>\n </StyledSection>\n ))}\n {copiedId && tooltipPosition && (\n <StyledTooltip\n sx={{\n left: tooltipPosition.x,\n top: tooltipPosition.y,\n }}\n >\n Link copied\n </StyledTooltip>\n )}\n </StyledConcertina>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;AAiBA,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACnD,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,aAAa,EAAE,QAAQ;AACvB,IAAA,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACtB,CAAA,CAAC,CAAC;AAGH,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;IAChD,SAAS,EAAE,CAAA,UAAA,EAAa,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAE;IACjD,YAAY,EAAE,CAAA,UAAA,EAAa,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAE;AACpD,IAAA,QAAQ,EAAE,QAAQ;AACnB,CAAA,CAAC,CAAC;AAGH,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AzBO,OAAO,CAAC,EAAE,CA0Bd,CACjB,CAAC,EACD,QAAQ,IAAI,eAAe,KAC1BA,IAAC,aAAa,EAAA,EACZ,EAAE,EAAE;oBACF,IAAI,EAAE,eAAe,CAAC,CAAC;oBACvB,GAAG,EAAE,eAAe,CAAC,CAAC;iBACvB,EAAA,QAAA,EAAA,aAAA,EAAA,CAGa,CACjB,CAAA,EAAA,CACgB;AAEvB;;;;"}
@@ -30,14 +30,14 @@ const StyledTextField = styled(TextField, {
30
30
  minWidth: 0,
31
31
  padding: 0, // Remove padding from root
32
32
  '&:focus-within': {
33
- outline: `2px solid ${errorMessage ? theme.palette.accent.main : theme.palette.primary.main}`,
33
+ outline: `2px solid ${errorMessage ? theme.palette.error.main : theme.palette.primary.main}`,
34
34
  outlineOffset: 0,
35
35
  },
36
36
  '& .MuiOutlinedInput-notchedOutline': {
37
- borderColor: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}33`,
37
+ borderColor: errorMessage ? theme.palette.error.main : `${theme.palette.dark.main}33`,
38
38
  },
39
39
  '&:hover .MuiOutlinedInput-notchedOutline': {
40
- borderColor: errorMessage ? theme.palette.accent.main : theme.palette.primary.main,
40
+ borderColor: errorMessage ? theme.palette.error.main : theme.palette.primary.main,
41
41
  },
42
42
  '&.Mui-disabled': {
43
43
  backgroundColor: `${theme.palette.dark.main}0D`,
@@ -60,7 +60,7 @@ const StyledTextField = styled(TextField, {
60
60
  '& .MuiFormHelperText-root': {
61
61
  marginTop: theme.spacing(0.75),
62
62
  fontSize: '0.875rem',
63
- color: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}99`,
63
+ color: errorMessage ? theme.palette.error.main : `${theme.palette.dark.main}99`,
64
64
  },
65
65
  }));
66
66
  const Input = ({ error, fullWidth = false, id, label, ...props }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../../src/components/Input.tsx"],"sourcesContent":["import React from 'react';\nimport { styled, TextField, TextFieldProps, InputLabel } from '@mui/material';\n\ninterface InputProps extends Omit<TextFieldProps, 'variant' | 'error'> {\n error?: string;\n}\n\nconst InputWrapper = styled('div')(({ theme }) => ({\n width: '100%',\n}));\n\nconst StyledLabel = styled(InputLabel)(({ theme }) => ({\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.palette.dark.main,\n marginBottom: theme.spacing(0.75),\n display: 'block',\n position: 'static',\n transform: 'none',\n '&.Mui-focused': {\n color: theme.palette.dark.main,\n },\n}));\n\nconst StyledTextField = styled(TextField, {\n shouldForwardProp: (prop) => !['errorMessage'].includes(prop as string),\n})<{ errorMessage?: string }>(({ theme, errorMessage }) => ({\n width: '100%',\n '& .MuiInputBase-root': {\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 minWidth: 0,\n padding: 0, // Remove padding from root\n '&:focus-within': {\n outline: `2px solid ${errorMessage ? theme.palette.accent.main : theme.palette.primary.main}`,\n outlineOffset: 0,\n },\n '& .MuiOutlinedInput-notchedOutline': {\n borderColor: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}33`,\n },\n '&:hover .MuiOutlinedInput-notchedOutline': {\n borderColor: errorMessage ? theme.palette.accent.main : theme.palette.primary.main,\n },\n '&.Mui-disabled': {\n backgroundColor: `${theme.palette.dark.main}0D`,\n '& .MuiInputBase-input': {\n color: `${theme.palette.dark.main}80`,\n cursor: 'not-allowed',\n },\n '& .MuiOutlinedInput-notchedOutline': {\n borderColor: `${theme.palette.dark.main}33`,\n },\n },\n },\n // Target the actual input element for padding\n '& .MuiInputBase-input': {\n padding: theme.spacing(1, 3),\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(1.25, 4),\n },\n },\n '& .MuiFormHelperText-root': {\n marginTop: theme.spacing(0.75),\n fontSize: '0.875rem',\n color: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}99`,\n },\n}));\n\nexport const Input: React.FC<InputProps> = ({\n error,\n fullWidth = false,\n id,\n label,\n ...props\n}) => {\n const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;\n\n return (\n <InputWrapper sx={{ ...(!fullWidth && { width: 'auto' }) }}>\n {label && (\n <StyledLabel htmlFor={inputId}>\n {label}\n </StyledLabel>\n )}\n <StyledTextField\n id={inputId}\n error={!!error}\n helperText={error || props.helperText}\n errorMessage={error}\n fullWidth={fullWidth}\n variant=\"outlined\"\n {...props}\n />\n </InputWrapper>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;AAOA,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACjD,IAAA,KAAK,EAAE,MAAM;AACd,CAAA,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACrD,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,UAAU,EAAE,GAAG;AACf,IAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;AAC9B,IAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;AACjC,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;AAC/B,KAAA;AACF,CAAA,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,EAAE;AACxC,IAAA,iBAAiB,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,IAAc,CAAC;CACxE,CAAC,CAA4B,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM;AAC1D,IAAA,KAA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KAAK,EAAA,CACM,CACf,EACDA,GAAA,CAAC,eAAe,EAAA,EACd,EAAE,EAAE,OAAO,EACX,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,UAAU,EAAE,KAAK,IAAI,KAAK,CAAC,UAAU,EACrC,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,UAAU,EAAA,GACd,KAAK,EAAA,CACT,CAAA,EAAA,CACW;AAEnB;;;;"}
1
+ {"version":3,"file":"Input.js","sources":["../../../../src/components/Input.tsx"],"sourcesContent":["import React from 'react';\nimport { styled, TextField, TextFieldProps, InputLabel } from '@mui/material';\n\ninterface InputProps extends Omit<TextFieldProps, 'variant' | 'error'> {\n error?: string;\n}\n\nconst InputWrapper = styled('div')(({ theme }) => ({\n width: '100%',\n}));\n\nconst StyledLabel = styled(InputLabel)(({ theme }) => ({\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.palette.dark.main,\n marginBottom: theme.spacing(0.75),\n display: 'block',\n position: 'static',\n transform: 'none',\n '&.Mui-focused': {\n color: theme.palette.dark.main,\n },\n}));\n\nconst StyledTextField = styled(TextField, {\n shouldForwardProp: (prop) => !['errorMessage'].includes(prop as string),\n})<{ errorMessage?: string }>(({ theme, errorMessage }) => ({\n width: '100%',\n '& .MuiInputBase-root': {\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 minWidth: 0,\n padding: 0, // Remove padding from root\n '&:focus-within': {\n outline: `2px solid ${errorMessage ? theme.palette.error.main : theme.palette.primary.main}`,\n outlineOffset: 0,\n },\n '& .MuiOutlinedInput-notchedOutline': {\n borderColor: errorMessage ? theme.palette.error.main : `${theme.palette.dark.main}33`,\n },\n '&:hover .MuiOutlinedInput-notchedOutline': {\n borderColor: errorMessage ? theme.palette.error.main : theme.palette.primary.main,\n },\n '&.Mui-disabled': {\n backgroundColor: `${theme.palette.dark.main}0D`,\n '& .MuiInputBase-input': {\n color: `${theme.palette.dark.main}80`,\n cursor: 'not-allowed',\n },\n '& .MuiOutlinedInput-notchedOutline': {\n borderColor: `${theme.palette.dark.main}33`,\n },\n },\n },\n // Target the actual input element for padding\n '& .MuiInputBase-input': {\n padding: theme.spacing(1, 3),\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(1.25, 4),\n },\n },\n '& .MuiFormHelperText-root': {\n marginTop: theme.spacing(0.75),\n fontSize: '0.875rem',\n color: errorMessage ? theme.palette.error.main : `${theme.palette.dark.main}99`,\n },\n}));\n\nexport const Input: React.FC<InputProps> = ({\n error,\n fullWidth = false,\n id,\n label,\n ...props\n}) => {\n const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;\n\n return (\n <InputWrapper sx={{ ...(!fullWidth && { width: 'auto' }) }}>\n {label && (\n <StyledLabel htmlFor={inputId}>\n {label}\n </StyledLabel>\n )}\n <StyledTextField\n id={inputId}\n error={!!error}\n helperText={error || props.helperText}\n errorMessage={error}\n fullWidth={fullWidth}\n variant=\"outlined\"\n {...props}\n />\n </InputWrapper>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;AAOA,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACjD,IAAA,KAAK,EAAE,MAAM;AACd,CAAA,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACrD,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,UAAU,EAAE,GAAG;AACf,IAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;AAC9B,IAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;AACjC,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,QAAQ,EAAE,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I;IACH,MAAM,OAAO,GAAG,EAAE,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAE;AAExE,IAAA,QACEA,IAAA,CAAC,YAAY,EAAA,EAAC,EAAE,EAAE,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,EAAA,QAAA,EAAA,CACvD,KAAK,KACJC,GAAA,CAAC,WAAW,EAAA,EAAC,OAAO,EAAE,OAAO,EAAA,QAAA,EAC1B,KAAK,EAAA,CACM,CACf,EACDA,GAAA,CAAC,eAAe,EAAA,EACd,EAAE,EAAE,OAAO,EACX,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,UAAU,EAAE,KAAK,IAAI,KAAK,CAAC,UAAU,EACrC,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,UAAU,EAAA,GACd,KAAK,EAAA,CACT,CAAA,EAAA,CACW;AAEnB;;;;"}
@@ -1,11 +1,12 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useState } from 'react';
3
- import { styled, Dialog, IconButton, DialogContent, Box, Chip, Typography, Alert, TextField } from '@mui/material';
3
+ import { styled, Dialog, IconButton, DialogContent, Box, Chip, Typography, Alert, TextField, FormControlLabel, Checkbox } from '@mui/material';
4
4
  import { Button } from './Button.js';
5
- import { CloseRounded, ErrorOutlineRounded, StickyNote2Rounded, ChevronLeftRounded, ChevronRightRounded } from '@mui/icons-material';
5
+ import { CloseRounded, ErrorOutlineRounded, StickyNote2Rounded } from '@mui/icons-material';
6
6
 
7
7
  const StyledDialog = styled(Dialog)(({ theme }) => ({
8
8
  '& .MuiDialog-paper': {
9
+ color: theme.palette.background.default,
9
10
  borderRadius: theme.shape.borderRadius,
10
11
  maxWidth: '896px',
11
12
  width: '100%',
@@ -13,18 +14,24 @@ const StyledDialog = styled(Dialog)(({ theme }) => ({
13
14
  },
14
15
  }));
15
16
  const NavButton = styled(IconButton)(({ theme }) => ({
16
- width: '40px',
17
+ width: 'auto',
17
18
  height: '40px',
19
+ borderRadius: 8,
18
20
  border: `2px solid ${theme.palette.dark.main}`,
19
21
  backgroundColor: theme.palette.light.main,
22
+ padding: theme.spacing(1, 2),
20
23
  '&:hover': {
21
- backgroundColor: theme.palette.dark.main,
22
- color: theme.palette.light.main,
24
+ backgroundColor: theme.palette.grey[100], // Changed from dark.main to grey[100]
25
+ color: theme.palette.dark.main, // Keep text dark instead of light
26
+ borderColor: theme.palette.dark.main, // Keep border dark
23
27
  },
24
28
  }));
25
29
  const Modal = ({ isOpen, onClose, status, description, defaultText, note, acceptSuggestion: initialAcceptSuggestion = true, onAcceptSuggestionChange, onSave, onSubmit, onDeclineWording, onPrevious, onNext, currentPage = 1, totalPages = 1, }) => {
26
30
  const [textValue, setTextValue] = useState(defaultText);
27
- const [acceptSuggestion, setAcceptSuggestion] = useState(initialAcceptSuggestion);
31
+ const [useDefaultValue, setUseDefaultValue] = useState(true);
32
+ const handleUseDefaultValueChange = (event) => {
33
+ setUseDefaultValue(event.target.checked);
34
+ };
28
35
  const statusConfig = {
29
36
  mandatory: {
30
37
  color: '#F5A623',
@@ -57,17 +64,18 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
57
64
  top: 16,
58
65
  right: 16,
59
66
  zIndex: 1,
60
- }, children: jsx(CloseRounded, { sx: { fontSize: 24 } }) }), jsxs(DialogContent, { sx: { p: { xs: 3, sm: 4, md: 6 } }, children: [jsx(Box, { sx: { mb: 3 }, children: jsx(Chip, { label: statusStyle.label, sx: {
67
+ }, children: jsx(CloseRounded, { sx: { fontSize: 24 } }) }), jsxs(DialogContent, { sx: { p: { xs: 3, sm: 4, md: 6 } }, children: [jsx(Box, { sx: { mb: 3 }, children: jsx(Chip, { label: statusStyle.label.toUpperCase(), sx: {
61
68
  backgroundColor: statusStyle.color,
62
- color: status === 'optional' ? '#4D3019' : '#fff',
69
+ color: status === 'optional' || status === 'mandatory' ? '#4D3019' : '#fff',
63
70
  fontWeight: 600,
64
71
  fontSize: '0.875rem',
65
72
  height: 'auto',
66
73
  py: 1,
74
+ borderRadius: 0,
67
75
  px: 2,
68
- } }) }), jsx(Typography, { sx: { mb: 3, lineHeight: 1.6 }, children: description }), status === 'action-required-note' && note && (jsx(Alert, { icon: jsx(ErrorOutlineRounded, { sx: { fontSize: 20 } }), severity: "error", sx: {
76
+ } }) }), jsx(Typography, { sx: { mb: 3, lineHeight: 1.6, whiteSpace: 'pre-line' }, children: description }), status === 'action-required-note' && note && (jsx(Alert, { icon: jsx(ErrorOutlineRounded, { sx: { fontSize: 20 } }), severity: "error", sx: {
69
77
  mb: 2,
70
- backgroundColor: '#FFE6E6',
78
+ backgroundColor: '#FDFCEE',
71
79
  borderLeft: '4px solid #F56B6B',
72
80
  '& .MuiAlert-icon': {
73
81
  color: '#F56B6B',
@@ -77,7 +85,7 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
77
85
  },
78
86
  }, children: note })), status === 'accepted-note' && note && (jsx(Alert, { icon: jsx(StickyNote2Rounded, { sx: { fontSize: 20 } }), severity: "warning", sx: {
79
87
  mb: 2,
80
- backgroundColor: '#FFF9E6',
88
+ backgroundColor: '#FDFCEE',
81
89
  borderLeft: '4px solid #F5D76E',
82
90
  '& .MuiAlert-icon': {
83
91
  color: '#F5A623',
@@ -85,12 +93,18 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
85
93
  '& .MuiAlert-message': {
86
94
  color: '#4D3019',
87
95
  },
88
- }, children: note })), jsx(TextField, { multiline: true, rows: 4, fullWidth: true, value: textValue, onChange: (e) => setTextValue(e.target.value), disabled: acceptSuggestion, sx: {
96
+ }, children: note })), jsx(TextField, { multiline: true, rows: 6, fullWidth: true, value: textValue, onChange: (e) => setTextValue(e.target.value), disabled: useDefaultValue, sx: {
89
97
  mb: 2,
90
98
  '& .MuiOutlinedInput-root': {
91
- backgroundColor: acceptSuggestion ? 'rgba(0, 0, 0, 0.05)' : '#fff',
99
+ backgroundColor: useDefaultValue ? 'rgba(0, 0, 0, 0.05)' : '#fff',
100
+ borderRadius: 2,
92
101
  },
93
- } }), jsxs(Box, { sx: {
102
+ } }), jsx(FormControlLabel, { control: jsx(Checkbox, { checked: useDefaultValue, onChange: handleUseDefaultValueChange, sx: {
103
+ color: '#AC46FF',
104
+ '&.Mui-checked': {
105
+ color: '#AC46FF',
106
+ },
107
+ } }), label: "Use Default Value", sx: { mb: 3 } }), jsxs(Box, { sx: {
94
108
  display: 'flex',
95
109
  flexDirection: { xs: 'column', sm: 'row' },
96
110
  alignItems: { xs: 'stretch', sm: 'center' },
@@ -99,12 +113,22 @@ const Modal = ({ isOpen, onClose, status, description, defaultText, note, accept
99
113
  pt: 3,
100
114
  borderTop: '1px solid',
101
115
  borderColor: 'divider',
102
- }, children: [jsxs(Box, { sx: { display: 'flex', gap: 1.5 }, children: [jsx(Button, { onClick: onSave, variant: "secondary", size: "md", children: "Save" }), jsx(Button, { onClick: onSubmit, variant: "primary", size: "md", children: "Submit for review" }), jsx(Button, { onClick: onDeclineWording, variant: "danger", size: "md", children: "Decline Wording" })] }), jsxs(Box, { sx: {
116
+ }, children: [jsxs(Box, { sx: { display: 'flex', gap: 1.5, flexWrap: 'wrap' }, children: [jsx(Button, { onClick: onSave, variant: "outline", size: "md", children: "Save" }), jsx(Button, { onClick: onSubmit, variant: "outline", size: "md", sx: {
117
+ backgroundColor: '#ac46ff52',
118
+ '&:hover': {
119
+ backgroundColor: '#ac46ff80', // Darker purple on hover
120
+ }
121
+ }, children: "Submit for review" }), jsx(Button, { onClick: onDeclineWording, variant: "outline", size: "md", sx: {
122
+ backgroundColor: '#ff464652',
123
+ '&:hover': {
124
+ backgroundColor: '#ff464680', // Darker purple on hover
125
+ }
126
+ }, children: "Decline wording" })] }), jsxs(Box, { sx: {
103
127
  display: 'flex',
104
128
  alignItems: 'center',
105
- gap: 2,
129
+ gap: 1.5,
106
130
  justifyContent: { xs: 'space-between', sm: 'flex-end' },
107
- }, children: [jsxs(Box, { sx: { display: 'flex', gap: 1.5 }, children: [jsx(NavButton, { onClick: onPrevious, "aria-label": "Previous", children: jsx(ChevronLeftRounded, { sx: { fontSize: 20 } }) }), jsx(NavButton, { onClick: onNext, "aria-label": "Next", children: jsx(ChevronRightRounded, { sx: { fontSize: 20 } }) })] }), jsxs(Typography, { fontWeight: 500, fontSize: "1.125rem", sx: { ml: 1 }, children: [currentPage, "/", totalPages] })] })] })] })] }));
131
+ }, children: [jsxs(Typography, { fontWeight: 500, fontSize: "1.125rem", children: [currentPage, "/", totalPages] }), jsx(NavButton, { onClick: onPrevious, "aria-label": "Previous", children: jsx(Typography, { sx: { fontSize: 16, fontWeight: 500 }, children: "Previous" }) }), jsx(NavButton, { onClick: onNext, "aria-label": "Next", children: jsx(Typography, { sx: { fontSize: 16, fontWeight: 500 }, children: "Next" }) })] })] })] })] }));
108
132
  };
109
133
 
110
134
  export { Modal };
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../../src/components/Modal.tsx"],"sourcesContent":["\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":["_jsxs","_jsx","MuiAlert"],"mappings":";;;;;;AAqCA,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AAClD,IAAA,oBAAoB,EAAE;AACpB,QAAA,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY;AACtC,QAAA,QAAQ,EAAE,OAAO;AACjB,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,SAAS,EAAE,MAAM;AAClB,KAAA;AACF,CAAA,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACnD,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,aAAa,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,CAAE;AAC9C,IAAA,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI;AACzC,IAAA,SAAS,EAAE;AACT,QAAA,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;AACxC,QAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI;AAChC,KAAA;AACF,CAAA,CAAC,CAAC;MAEU,KAAK,GAAyB,CAAC,EAC1C,MAAM,EACN,OAAO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AAM,EAAE,GAAG,EAAE,GAAG,EAAE,EAAA,QAAA,EAAA,CACpCC,IAAC,SAAS,EAAA,EAAC,OAAO,EAAE,UAAU,EAAA,YAAA,EAAa,UAAU,YACnDA,GAAA,CAAC,kBAAkB,IAAC,EAAE,EAAE,EAAC,QAAQ,EAAC,EAAE,EAAC,EAAA,CAAI,GAC/B,EACZA,GAAA,CAAC,SAAS,EAAA,EAAC,OAAO,EAAE,MAAM,EAAA,YAAA,EAAa,MAAM,EAAA,QAAA,EAC3CA,IAAC,mBAAmB,EAAA,EAAC,EAAE,EAAE,EAAC,QAAQ,EAAC,EAAE,EAAC,EAAA,CAAI,EAAA,CAChC,IACR,EACND,IAAA,CAAC,UAAU,EAAA,EAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAC,UAAU,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,aAC3D,WAAW,EAAA,GAAA,EAAG,UAAU,CAAA,EAAA,CACd,CAAA,EAAA,CACT,IACF,CAAA,EAAA,CACQ,CAAA,EAAA,CACH;AAEnB;;;;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../../src/components/Modal.tsx"],"sourcesContent":["import 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 { CloseRounded, ErrorOutlineRounded, StickyNote2Rounded } from '@mui/icons-material';\n\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\n\nconst StyledDialog = styled(Dialog)(({ theme }) => ({\n '& .MuiDialog-paper': {\n color: theme.palette.background.default,\n borderRadius: theme.shape.borderRadius,\n maxWidth: '896px',\n width: '100%',\n maxHeight: '90vh',\n },\n}));\n\n\nconst NavButton = styled(IconButton)(({ theme }) => ({\n width: 'auto',\n height: '40px',\n borderRadius: 8,\n border: `2px solid ${theme.palette.dark.main}`,\n backgroundColor: theme.palette.light.main,\n padding: theme.spacing(1, 2),\n '&:hover': {\n backgroundColor: theme.palette.grey[100], // Changed from dark.main to grey[100]\n color: theme.palette.dark.main, // Keep text dark instead of light\n borderColor: theme.palette.dark.main, // Keep border dark\n },\n}));\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 [useDefaultValue, setUseDefaultValue] = useState(true);\n\n\n const handleUseDefaultValueChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n setUseDefaultValue(event.target.checked);\n };\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\n const statusStyle = statusConfig[status];\n\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\n <DialogContent sx={{ p: { xs: 3, sm: 4, md: 6 } }}>\n {/* Status Chip */}\n <Box sx={{ mb: 3 }}>\n <Chip\n label={statusStyle.label.toUpperCase()}\n sx={{\n backgroundColor: statusStyle.color,\n color: status === 'optional' || status === 'mandatory' ? '#4D3019' : '#fff',\n fontWeight: 600,\n fontSize: '0.875rem',\n height: 'auto',\n py: 1,\n borderRadius: 0,\n px: 2,\n }}\n />\n </Box>\n\n\n {/* Description */}\n <Typography sx={{ mb: 3, lineHeight: 1.6, whiteSpace: 'pre-line' }}>\n {description}\n </Typography>\n\n\n {/* Alerts */}\n {status === 'action-required-note' && note && (\n <MuiAlert\n icon={<ErrorOutlineRounded sx={{ fontSize: 20 }} />}\n severity=\"error\"\n sx={{\n mb: 2,\n backgroundColor: '#FDFCEE',\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\n {status === 'accepted-note' && note && (\n <MuiAlert\n icon={<StickyNote2Rounded sx={{ fontSize: 20 }} />}\n severity=\"warning\"\n sx={{\n mb: 2,\n backgroundColor: '#FDFCEE',\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\n {/* Text Field */}\n <TextField\n multiline\n rows={6}\n fullWidth\n value={textValue}\n onChange={(e) => setTextValue(e.target.value)}\n disabled={useDefaultValue}\n sx={{\n mb: 2,\n '& .MuiOutlinedInput-root': {\n backgroundColor: useDefaultValue ? 'rgba(0, 0, 0, 0.05)' : '#fff',\n borderRadius: 2,\n },\n }}\n />\n\n\n {/* Checkbox */}\n <FormControlLabel\n control={\n <Checkbox\n checked={useDefaultValue}\n onChange={handleUseDefaultValueChange}\n sx={{\n color: '#AC46FF',\n '&.Mui-checked': {\n color: '#AC46FF',\n },\n }}\n />\n }\n label=\"Use Default Value\"\n sx={{ mb: 3 }}\n />\n\n\n {/* Footer with Buttons and Navigation */}\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 {/* Action Buttons */}\n <Box sx={{ display: 'flex', gap: 1.5, flexWrap: 'wrap' }}>\n <Button onClick={onSave} variant=\"outline\" size=\"md\">\n Save\n </Button>\n <Button onClick={onSubmit} variant=\"outline\" size=\"md\" sx={{\n backgroundColor: '#ac46ff52',\n '&:hover': {\n backgroundColor: '#ac46ff80', // Darker purple on hover\n }\n }}>\n Submit for review\n </Button>\n <Button onClick={onDeclineWording} variant=\"outline\" size=\"md\" sx={{\n backgroundColor: '#ff464652',\n '&:hover': {\n backgroundColor: '#ff464680', // Darker purple on hover\n }\n }}>\n Decline wording\n </Button>\n </Box>\n\n\n {/* Navigation */}\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: 1.5,\n justifyContent: { xs: 'space-between', sm: 'flex-end' },\n }}\n >\n <Typography fontWeight={500} fontSize=\"1.125rem\">\n {currentPage}/{totalPages}\n </Typography>\n <NavButton onClick={onPrevious} aria-label=\"Previous\">\n <Typography sx={{ fontSize: 16, fontWeight: 500 }}>Previous</Typography>\n </NavButton>\n <NavButton onClick={onNext} aria-label=\"Next\">\n <Typography sx={{ fontSize: 16, fontWeight: 500 }}>Next</Typography>\n </NavButton>\n </Box>\n </Box>\n </DialogContent>\n </StyledDialog>\n );\n};\n"],"names":["_jsxs","_jsx","MuiAlert"],"mappings":";;;;;;AAqCA,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AAClD,IAAA,oBAAoB,EAAE;AACpB,QAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO;AACvC,QAAA,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,EAAE,EAAE;AAC/D,4CAAA,eAAe,EAAE,WAAW;AAC5B,4CAAA,SAAS,EAAE;gDACT,eAAe,EAAE,WAAW;AAC7B;AACF,yCAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,CAEM,IACL,EAIND,IAAA,CAAC,GAAG,EAAA,EACF,EAAE,EAAE;AACF,oCAAA,OAAO,EAAE,MAAM;AACf,oCAAA,UAAU,EAAE,QAAQ;AACpB,oCAAA,GAAG,EAAE,GAAG;oCACR,cAAc,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,UAAU,EAAE;AACxD,iCAAA,EAAA,QAAA,EAAA,CAEDA,IAAA,CAAC,UAAU,EAAA,EAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAC,UAAU,EAAA,QAAA,EAAA,CAC7C,WAAW,EAAA,GAAA,EAAG,UAAU,IACd,EACbC,GAAA,CAAC,SAAS,EAAA,EAAC,OAAO,EAAE,UAAU,EAAA,YAAA,EAAa,UAAU,EAAA,QAAA,EACnDA,GAAA,CAAC,UAAU,EAAA,EAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAA,QAAA,EAAA,UAAA,EAAA,CAAuB,EAAA,CAC9D,EACZA,IAAC,SAAS,EAAA,EAAC,OAAO,EAAE,MAAM,EAAA,YAAA,EAAa,MAAM,EAAA,QAAA,EAC3CA,GAAA,CAAC,UAAU,EAAA,EAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAA,QAAA,EAAA,MAAA,EAAA,CAAmB,GAC1D,CAAA,EAAA,CACR,CAAA,EAAA,CACF,CAAA,EAAA,CACQ,CAAA,EAAA,CACH;AAEnB;;;;"}
@@ -7,25 +7,9 @@ const NoteContainer = styled(Box)({
7
7
  position: 'relative',
8
8
  maxWidth: '100%',
9
9
  });
10
- const EditButton = styled(IconButton)(({ theme }) => ({
11
- position: 'absolute',
12
- right: -4,
13
- top: '50%',
14
- transform: 'translateY(-50%)',
15
- width: 24,
16
- height: 24,
17
- backgroundColor: '#4D3019',
18
- opacity: 0,
19
- transition: 'all 0.2s ease',
20
- boxShadow: '0 1px 3px rgba(0,0,0,0.12)',
21
- '&:hover': {
22
- backgroundColor: '#4D3019',
23
- transform: 'translateY(-50%) scale(1.1)',
24
- },
25
- }));
26
10
  const HighlightWrapper = styled(Box)(({ isHovered, highlightColor, highlightSelectedColor, isCustom }) => ({
27
11
  position: 'relative',
28
- display: 'inline-block',
12
+ display: 'inline-block', // Keep this as inline-block
29
13
  maxWidth: '100%',
30
14
  '&:hover .edit-button': {
31
15
  opacity: 1,
@@ -33,6 +17,7 @@ const HighlightWrapper = styled(Box)(({ isHovered, highlightColor, highlightSele
33
17
  '& .highlight-span': {
34
18
  background: isCustom ? highlightColor : (isHovered ? highlightSelectedColor : highlightColor),
35
19
  padding: '2px 4px',
20
+ borderBottom: '2px solid rgba(77, 48, 25, 0.3)',
36
21
  boxDecorationBreak: 'clone',
37
22
  WebkitBoxDecorationBreak: 'clone',
38
23
  transition: isCustom ? 'none' : 'background 0.2s ease',
@@ -44,6 +29,23 @@ const HighlightWrapper = styled(Box)(({ isHovered, highlightColor, highlightSele
44
29
  color: '#4D3019',
45
30
  },
46
31
  }));
32
+ const EditButton = styled(IconButton)(({ theme }) => ({
33
+ position: 'absolute',
34
+ top: 0,
35
+ right: 0,
36
+ transform: 'translate(50%, -50%)',
37
+ width: 20,
38
+ height: 20,
39
+ borderRadius: 4,
40
+ backgroundColor: '#4D3019',
41
+ opacity: 0,
42
+ transition: 'all 0.2s ease',
43
+ boxShadow: '0 1px 3px rgba(0,0,0,0.12)',
44
+ '&:hover': {
45
+ backgroundColor: '#4D3019',
46
+ transform: 'translate(50%, -50%) scale(1.1)',
47
+ },
48
+ }));
47
49
  const NoteBox = ({ variant = 'default', label, children, className = '', onEditClick, }) => {
48
50
  const [isHovered, setIsHovered] = useState(false);
49
51
  const variants = {