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,175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { styled, Box, Typography, TextField, IconButton } from '@mui/material';
|
|
4
|
+
import { useTheme } from '../ThemeProvider.js';
|
|
5
|
+
import { SchoolRounded, SearchRounded } from '@mui/icons-material';
|
|
6
|
+
|
|
7
|
+
const StyledHeader = styled(Box)(({ theme }) => ({
|
|
8
|
+
padding: theme.spacing(1.5, 4), // px-4 py-3
|
|
9
|
+
display: 'flex',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'space-between',
|
|
12
|
+
gap: theme.spacing(2), // gap-2
|
|
13
|
+
backgroundColor: theme.palette.primary.main, // var(--color-primary)
|
|
14
|
+
[theme.breakpoints.up('sm')]: {
|
|
15
|
+
padding: theme.spacing(2, 6), // sm:px-6
|
|
16
|
+
},
|
|
17
|
+
[theme.breakpoints.up('md')]: {
|
|
18
|
+
padding: theme.spacing(2, 8), // md:px-8
|
|
19
|
+
gap: theme.spacing(4), // md:gap-4
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
const StyledLogoWrapper = styled(Box)(({ theme }) => ({
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
gap: theme.spacing(2), // md:gap-2
|
|
26
|
+
[theme.breakpoints.down('md')]: {
|
|
27
|
+
gap: theme.spacing(1.5), // gap-1.5
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
30
|
+
const StyledLogoIcon = styled(Box)(({ theme }) => ({
|
|
31
|
+
width: 32, // md:w-8 md:h-8
|
|
32
|
+
height: 32,
|
|
33
|
+
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
34
|
+
[theme.breakpoints.down('md')]: {
|
|
35
|
+
width: 24, // w-6
|
|
36
|
+
height: 24, // h-6
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
const StyledLogoText = styled(Typography)(({ theme }) => ({
|
|
40
|
+
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
41
|
+
fontWeight: 700, // font-bold
|
|
42
|
+
letterSpacing: '0.05em', // tracking-wide
|
|
43
|
+
fontSize: '1.5rem', // text-2xl
|
|
44
|
+
[theme.breakpoints.down('md')]: {
|
|
45
|
+
fontSize: '1.25rem', // sm:text-xl
|
|
46
|
+
},
|
|
47
|
+
[theme.breakpoints.down('sm')]: {
|
|
48
|
+
fontSize: '1.125rem', // text-lg
|
|
49
|
+
},
|
|
50
|
+
}));
|
|
51
|
+
const StyledSearchContainer = styled(Box)(({ theme }) => ({
|
|
52
|
+
flex: 1,
|
|
53
|
+
maxWidth: '32rem', // max-w-2xl
|
|
54
|
+
margin: theme.spacing(0, 8), // mx-8
|
|
55
|
+
position: 'relative',
|
|
56
|
+
[theme.breakpoints.down('md')]: {
|
|
57
|
+
margin: theme.spacing(0, 4), // sm:mx-4
|
|
58
|
+
},
|
|
59
|
+
[theme.breakpoints.down('sm')]: {
|
|
60
|
+
margin: theme.spacing(0, 2), // mx-2
|
|
61
|
+
},
|
|
62
|
+
}));
|
|
63
|
+
const StyledTextField = styled(TextField)(({ theme }) => ({
|
|
64
|
+
'& .MuiInputBase-root': {
|
|
65
|
+
backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]
|
|
66
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
67
|
+
borderRadius: '9999px', // rounded-full
|
|
68
|
+
paddingRight: theme.spacing(6), // pr-12
|
|
69
|
+
fontSize: '1rem', // text-base
|
|
70
|
+
[theme.breakpoints.down('md')]: {
|
|
71
|
+
paddingRight: theme.spacing(5), // sm:pr-10
|
|
72
|
+
fontSize: '0.875rem', // text-sm
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
'& .MuiInputBase-input': {
|
|
76
|
+
padding: theme.spacing(1.5, 3), // px-4 py-2
|
|
77
|
+
[theme.breakpoints.up('md')]: {
|
|
78
|
+
padding: theme.spacing(1.5, 4), // md:px-6 md:py-3
|
|
79
|
+
},
|
|
80
|
+
[theme.breakpoints.down('sm')]: {
|
|
81
|
+
padding: theme.spacing(1.5, 2.5), // sm:px-5
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
'& .MuiInputBase-input::placeholder': {
|
|
85
|
+
color: `${theme.palette.dark.main}99`, // placeholder-[#4D3019]/60
|
|
86
|
+
opacity: 1,
|
|
87
|
+
},
|
|
88
|
+
'& .MuiInputBase-root:focus-within': {
|
|
89
|
+
outline: `2px solid ${theme.palette.light.main}`, // focus:ring-2 focus:ring-[#FDFCEE]
|
|
90
|
+
outlineOffset: 0,
|
|
91
|
+
},
|
|
92
|
+
}));
|
|
93
|
+
const StyledSearchButton = styled(IconButton)(({ theme }) => ({
|
|
94
|
+
position: 'absolute',
|
|
95
|
+
right: theme.spacing(2), // md:right-2
|
|
96
|
+
top: '50%',
|
|
97
|
+
transform: 'translateY(-50%)',
|
|
98
|
+
width: theme.spacing(5), // md:w-10
|
|
99
|
+
height: theme.spacing(5), // md:h-10
|
|
100
|
+
borderRadius: '50%', // rounded-full
|
|
101
|
+
backgroundColor: theme.palette.primary.main, // var(--color-primary)
|
|
102
|
+
'&:hover': {
|
|
103
|
+
opacity: 0.9, // hover:opacity-90
|
|
104
|
+
backgroundColor: theme.palette.primary.main,
|
|
105
|
+
},
|
|
106
|
+
[theme.breakpoints.down('md')]: {
|
|
107
|
+
right: theme.spacing(1), // right-1
|
|
108
|
+
width: theme.spacing(4), // w-8
|
|
109
|
+
height: theme.spacing(4), // h-8
|
|
110
|
+
},
|
|
111
|
+
}));
|
|
112
|
+
const StyledSearchIcon = styled(Box)(({ theme }) => ({
|
|
113
|
+
width: 20, // md:w-5 md:h-5
|
|
114
|
+
height: 20,
|
|
115
|
+
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
116
|
+
[theme.breakpoints.down('md')]: {
|
|
117
|
+
width: 16, // w-4
|
|
118
|
+
height: 16, // h-4
|
|
119
|
+
},
|
|
120
|
+
}));
|
|
121
|
+
const StyledUserContainer = styled(Box)(({ theme }) => ({
|
|
122
|
+
display: 'flex',
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
gap: theme.spacing(3), // md:gap-3
|
|
125
|
+
[theme.breakpoints.down('md')]: {
|
|
126
|
+
gap: theme.spacing(2), // gap-2
|
|
127
|
+
},
|
|
128
|
+
}));
|
|
129
|
+
const StyledAvatar = styled(Box)(({ theme }) => ({
|
|
130
|
+
width: theme.spacing(6), // md:w-12
|
|
131
|
+
height: theme.spacing(6), // md:h-12
|
|
132
|
+
borderRadius: '50%', // rounded-full
|
|
133
|
+
backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]
|
|
134
|
+
display: 'flex',
|
|
135
|
+
alignItems: 'center',
|
|
136
|
+
justifyContent: 'center',
|
|
137
|
+
flexShrink: 0,
|
|
138
|
+
[theme.breakpoints.down('md')]: {
|
|
139
|
+
width: theme.spacing(5), // sm:w-10
|
|
140
|
+
height: theme.spacing(5), // sm:h-10
|
|
141
|
+
},
|
|
142
|
+
[theme.breakpoints.down('sm')]: {
|
|
143
|
+
width: theme.spacing(4), // w-8
|
|
144
|
+
height: theme.spacing(4), // h-8
|
|
145
|
+
},
|
|
146
|
+
}));
|
|
147
|
+
const StyledAvatarText = styled(Typography)(({ theme }) => ({
|
|
148
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
149
|
+
fontWeight: 700, // font-bold
|
|
150
|
+
fontSize: '1.125rem', // text-lg
|
|
151
|
+
[theme.breakpoints.down('md')]: {
|
|
152
|
+
fontSize: '0.875rem', // text-sm
|
|
153
|
+
},
|
|
154
|
+
}));
|
|
155
|
+
const StyledUserName = styled(Typography)(({ theme }) => ({
|
|
156
|
+
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
157
|
+
fontWeight: 500, // font-medium
|
|
158
|
+
fontSize: '1.125rem', // text-lg
|
|
159
|
+
display: 'none', // hidden
|
|
160
|
+
[theme.breakpoints.up('sm')]: {
|
|
161
|
+
display: 'inline', // sm:inline
|
|
162
|
+
},
|
|
163
|
+
[theme.breakpoints.down('md')]: {
|
|
164
|
+
fontSize: '0.875rem', // text-sm
|
|
165
|
+
},
|
|
166
|
+
}));
|
|
167
|
+
const Header = ({ userName = 'John Doe', userInitials = 'JD', }) => {
|
|
168
|
+
const { theme } = useTheme();
|
|
169
|
+
return (jsxs(StyledHeader, { children: [jsxs(StyledLogoWrapper, { children: [jsx(StyledLogoIcon, { children: jsx(SchoolRounded, { sx: { fontSize: 32, color: 'currentColor' } }) }), jsx(StyledLogoText, { variant: "h1", children: theme.appName })] }), jsx(StyledSearchContainer, { children: jsx(StyledTextField, { placeholder: "Search for a policy", variant: "outlined", fullWidth: true, InputProps: {
|
|
170
|
+
endAdornment: (jsx(StyledSearchButton, { children: jsx(StyledSearchIcon, { children: jsx(SearchRounded, { sx: { fontSize: 20 } }) }) })),
|
|
171
|
+
} }) }), jsxs(StyledUserContainer, { children: [jsx(StyledAvatar, { children: jsx(StyledAvatarText, { children: userInitials }) }), jsx(StyledUserName, { children: userName })] })] }));
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export { Header };
|
|
175
|
+
//# sourceMappingURL=Header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../../src/components/Header.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { Box, styled, Typography, TextField, IconButton } from '@mui/material';\nimport { useTheme } from '../ThemeProvider';\nimport { SchoolRounded, SearchRounded } from '@mui/icons-material';\n\ninterface HeaderProps {\n userName?: string;\n userInitials?: string;\n}\n\nconst StyledHeader = styled(Box)(({ theme }) => ({\n padding: theme.spacing(1.5, 4), // px-4 py-3\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(2), // gap-2\n backgroundColor: theme.palette.primary.main, // var(--color-primary)\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(2, 6), // sm:px-6\n },\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(2, 8), // md:px-8\n gap: theme.spacing(4), // md:gap-4\n },\n}));\n\nconst StyledLogoWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(2), // md:gap-2\n [theme.breakpoints.down('md')]: {\n gap: theme.spacing(1.5), // gap-1.5\n },\n}));\n\nconst StyledLogoIcon = styled(Box)(({ theme }) => ({\n width: 32, // md:w-8 md:h-8\n height: 32,\n color: theme.palette.light.main, // text-[#FDFCEE]\n [theme.breakpoints.down('md')]: {\n width: 24, // w-6\n height: 24, // h-6\n },\n}));\n\nconst StyledLogoText = styled(Typography)(({ theme }) => ({\n color: theme.palette.light.main, // text-[#FDFCEE]\n fontWeight: 700, // font-bold\n letterSpacing: '0.05em', // tracking-wide\n fontSize: '1.5rem', // text-2xl\n [theme.breakpoints.down('md')]: {\n fontSize: '1.25rem', // sm:text-xl\n },\n [theme.breakpoints.down('sm')]: {\n fontSize: '1.125rem', // text-lg\n },\n}));\n\nconst StyledSearchContainer = styled(Box)(({ theme }) => ({\n flex: 1,\n maxWidth: '32rem', // max-w-2xl\n margin: theme.spacing(0, 8), // mx-8\n position: 'relative',\n [theme.breakpoints.down('md')]: {\n margin: theme.spacing(0, 4), // sm:mx-4\n },\n [theme.breakpoints.down('sm')]: {\n margin: theme.spacing(0, 2), // mx-2\n },\n}));\n\nconst StyledTextField = styled(TextField)(({ theme }) => ({\n '& .MuiInputBase-root': {\n backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]\n color: theme.palette.dark.main, // text-[#4D3019]\n borderRadius: '9999px', // rounded-full\n paddingRight: theme.spacing(6), // pr-12\n fontSize: '1rem', // text-base\n [theme.breakpoints.down('md')]: {\n paddingRight: theme.spacing(5), // sm:pr-10\n fontSize: '0.875rem', // text-sm\n },\n },\n '& .MuiInputBase-input': {\n padding: theme.spacing(1.5, 3), // px-4 py-2\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(1.5, 4), // md:px-6 md:py-3\n },\n [theme.breakpoints.down('sm')]: {\n padding: theme.spacing(1.5, 2.5), // sm:px-5\n },\n },\n '& .MuiInputBase-input::placeholder': {\n color: `${theme.palette.dark.main}99`, // placeholder-[#4D3019]/60\n opacity: 1,\n },\n '& .MuiInputBase-root:focus-within': {\n outline: `2px solid ${theme.palette.light.main}`, // focus:ring-2 focus:ring-[#FDFCEE]\n outlineOffset: 0,\n },\n}));\n\nconst StyledSearchButton = styled(IconButton)(({ theme }) => ({\n position: 'absolute',\n right: theme.spacing(2), // md:right-2\n top: '50%',\n transform: 'translateY(-50%)',\n width: theme.spacing(5), // md:w-10\n height: theme.spacing(5), // md:h-10\n borderRadius: '50%', // rounded-full\n backgroundColor: theme.palette.primary.main, // var(--color-primary)\n '&:hover': {\n opacity: 0.9, // hover:opacity-90\n backgroundColor: theme.palette.primary.main,\n },\n [theme.breakpoints.down('md')]: {\n right: theme.spacing(1), // right-1\n width: theme.spacing(4), // w-8\n height: theme.spacing(4), // h-8\n },\n}));\n\nconst StyledSearchIcon = styled(Box)(({ theme }) => ({\n width: 20, // md:w-5 md:h-5\n height: 20,\n color: theme.palette.light.main, // text-[#FDFCEE]\n [theme.breakpoints.down('md')]: {\n width: 16, // w-4\n height: 16, // h-4\n },\n}));\n\nconst StyledUserContainer = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(3), // md:gap-3\n [theme.breakpoints.down('md')]: {\n gap: theme.spacing(2), // gap-2\n },\n}));\n\nconst StyledAvatar = styled(Box)(({ theme }) => ({\n width: theme.spacing(6), // md:w-12\n height: theme.spacing(6), // md:h-12\n borderRadius: '50%', // rounded-full\n backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n [theme.breakpoints.down('md')]: {\n width: theme.spacing(5), // sm:w-10\n height: theme.spacing(5), // sm:h-10\n },\n [theme.breakpoints.down('sm')]: {\n width: theme.spacing(4), // w-8\n height: theme.spacing(4), // h-8\n },\n}));\n\nconst StyledAvatarText = styled(Typography)(({ theme }) => ({\n color: theme.palette.dark.main, // text-[#4D3019]\n fontWeight: 700, // font-bold\n fontSize: '1.125rem', // text-lg\n [theme.breakpoints.down('md')]: {\n fontSize: '0.875rem', // text-sm\n },\n}));\n\nconst StyledUserName = styled(Typography)(({ theme }) => ({\n color: theme.palette.light.main, // text-[#FDFCEE]\n fontWeight: 500, // font-medium\n fontSize: '1.125rem', // text-lg\n display: 'none', // hidden\n [theme.breakpoints.up('sm')]: {\n display: 'inline', // sm:inline\n },\n [theme.breakpoints.down('md')]: {\n fontSize: '0.875rem', // text-sm\n },\n}));\n\nexport const Header: React.FC<HeaderProps> = ({\n userName = 'John Doe',\n userInitials = 'JD',\n}) => {\n const { theme } = useTheme();\n\n return (\n <StyledHeader>\n <StyledLogoWrapper>\n <StyledLogoIcon>\n <SchoolRounded sx={{fontSize:32, color: 'currentColor'}} />\n </StyledLogoIcon>\n <StyledLogoText variant=\"h1\">{theme.appName}</StyledLogoText>\n </StyledLogoWrapper>\n\n <StyledSearchContainer>\n <StyledTextField\n placeholder=\"Search for a policy\"\n variant=\"outlined\"\n fullWidth\n InputProps={{\n endAdornment: (\n <StyledSearchButton>\n <StyledSearchIcon>\n <SearchRounded sx={{fontSize: 20}} />\n </StyledSearchIcon>\n </StyledSearchButton>\n ),\n }}\n />\n </StyledSearchContainer>\n\n <StyledUserContainer>\n <StyledAvatar>\n <StyledAvatarText>{userInitials}</StyledAvatarText>\n </StyledAvatar>\n <StyledUserName>{userName}</StyledUserName>\n </StyledUserContainer>\n </StyledHeader>\n );\n};"],"names":[],"mappings":";;;;;;AAYA;;AAEE;AACA;AACA;;;;;AAKC;;;;AAIA;AACF;AAED;AACE;AACA;;;;AAIC;AACF;AAED;;AAEE;;;;;AAKC;AACF;AAED;;;;;;;AAOG;;;AAGA;AACF;AAED;AACE;;;AAGA;;;AAGC;;;AAGA;AACF;AAED;AACE;;;;;;;;;AASG;AACF;AACD;;;;AAIG;;;AAGA;AACF;AACD;;AAEE;AACD;AACD;;AAEE;AACD;AACF;AAED;AACE;;AAEA;AACA;;;;;AAKA;;AAEE;AACD;;;;;AAKA;AACF;AAED;;AAEE;;;;;AAKC;AACF;AAED;AACE;AACA;;;;AAIC;AACF;AAED;;;;;AAKE;AACA;AACA;AACA;;;;AAIC;;;;AAIA;AACF;AAED;;;;;;AAMG;AACF;AAED;;;;;;;AAOG;;;AAGA;AACF;AAEM;AAIL;;;;AAoCF;;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { styled, InputLabel, TextField } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
const InputWrapper = styled('div')(({ theme }) => ({
|
|
6
|
+
width: '100%',
|
|
7
|
+
}));
|
|
8
|
+
const StyledLabel = styled(InputLabel)(({ theme }) => ({
|
|
9
|
+
fontSize: '0.875rem',
|
|
10
|
+
fontWeight: 500,
|
|
11
|
+
color: theme.palette.dark.main,
|
|
12
|
+
marginBottom: theme.spacing(0.75),
|
|
13
|
+
display: 'block',
|
|
14
|
+
position: 'static',
|
|
15
|
+
transform: 'none',
|
|
16
|
+
'&.Mui-focused': {
|
|
17
|
+
color: theme.palette.dark.main,
|
|
18
|
+
},
|
|
19
|
+
}));
|
|
20
|
+
const StyledTextField = styled(TextField, {
|
|
21
|
+
shouldForwardProp: (prop) => !['errorMessage'].includes(prop),
|
|
22
|
+
})(({ theme, errorMessage }) => ({
|
|
23
|
+
width: '100%',
|
|
24
|
+
'& .MuiInputBase-root': {
|
|
25
|
+
backgroundColor: theme.palette.light.main,
|
|
26
|
+
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
27
|
+
? parseInt(theme.shape.borderRadius, 10)
|
|
28
|
+
: theme.shape.borderRadius || 4) * 2,
|
|
29
|
+
fontSize: '1rem',
|
|
30
|
+
color: theme.palette.dark.main,
|
|
31
|
+
minWidth: 0,
|
|
32
|
+
padding: theme.spacing(0, 3),
|
|
33
|
+
[theme.breakpoints.up('sm')]: {
|
|
34
|
+
padding: theme.spacing(0, 4),
|
|
35
|
+
},
|
|
36
|
+
'& .MuiInputBase-input': {
|
|
37
|
+
padding: theme.spacing(1, 0),
|
|
38
|
+
[theme.breakpoints.up('sm')]: {
|
|
39
|
+
padding: theme.spacing(1.25, 0),
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
'&:focus-within': {
|
|
43
|
+
outline: `2px solid ${errorMessage ? theme.palette.accent.main : theme.palette.primary.main}`,
|
|
44
|
+
outlineOffset: 0,
|
|
45
|
+
},
|
|
46
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
47
|
+
borderColor: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}33`,
|
|
48
|
+
},
|
|
49
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
50
|
+
borderColor: errorMessage ? theme.palette.accent.main : theme.palette.primary.main,
|
|
51
|
+
},
|
|
52
|
+
'&.Mui-disabled': {
|
|
53
|
+
backgroundColor: `${theme.palette.dark.main}0D`,
|
|
54
|
+
'& .MuiInputBase-input': {
|
|
55
|
+
color: `${theme.palette.dark.main}80`,
|
|
56
|
+
cursor: 'not-allowed',
|
|
57
|
+
},
|
|
58
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
59
|
+
borderColor: `${theme.palette.dark.main}33`,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
'& .MuiFormHelperText-root': {
|
|
64
|
+
marginTop: theme.spacing(0.75),
|
|
65
|
+
fontSize: '0.875rem',
|
|
66
|
+
color: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}99`,
|
|
67
|
+
},
|
|
68
|
+
}));
|
|
69
|
+
const Input = ({ error, fullWidth = false, id, label, ...props }) => {
|
|
70
|
+
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
71
|
+
return (jsxs(InputWrapper, { sx: { ...(!fullWidth && { width: 'auto' }) }, children: [label && (jsx(StyledLabel, { htmlFor: inputId, children: label })), jsx(StyledTextField, { id: inputId, error: !!error, helperText: error || props.helperText, errorMessage: error, fullWidth: fullWidth, variant: "outlined", ...props })] }));
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { Input };
|
|
75
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../../src/components/Input.tsx"],"sourcesContent":["'use client';\n\nimport 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: theme.spacing(0, 3),\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(0, 4),\n },\n '& .MuiInputBase-input': {\n padding: theme.spacing(1, 0),\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(1.25, 0),\n },\n },\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 '& .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};"],"names":[],"mappings":";;;;AASA;AACE;AACD;AAED;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE;AACD;AACF;AAED;AACE;;AAEA;AACA;AACE;;;;AAIA;AACA;AACA;;;;AAIC;AACD;;;;AAIG;AACF;AACD;;AAEE;AACD;AACD;;AAEC;AACD;;AAEC;AACD;;AAEE;;AAEE;AACD;AACD;;AAEC;AACF;AACF;AACD;AACE;AACA;;AAED;AACF;;;AAWC;AAkBF;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
status: 'mandatory' | 'optional' | 'accepted' | 'action-required' | 'action-required-note' | 'accepted-note';
|
|
6
|
+
description: string;
|
|
7
|
+
defaultText: string;
|
|
8
|
+
note?: string;
|
|
9
|
+
acceptSuggestion?: boolean;
|
|
10
|
+
onAcceptSuggestionChange?: (checked: boolean) => void;
|
|
11
|
+
onSave?: () => void;
|
|
12
|
+
onSubmit?: () => void;
|
|
13
|
+
onDeclineWording?: () => void;
|
|
14
|
+
onPrevious?: () => void;
|
|
15
|
+
onNext?: () => void;
|
|
16
|
+
currentPage?: number;
|
|
17
|
+
totalPages?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { styled, Dialog, IconButton, DialogContent, Box, Chip, Typography, Alert, TextField } from '@mui/material';
|
|
5
|
+
import { Button } from './Button.js';
|
|
6
|
+
import { CloseRounded, ErrorOutlineRounded, StickyNote2Rounded, ChevronLeftRounded, ChevronRightRounded } from '@mui/icons-material';
|
|
7
|
+
|
|
8
|
+
const StyledDialog = styled(Dialog)(({ theme }) => ({
|
|
9
|
+
'& .MuiDialog-paper': {
|
|
10
|
+
borderRadius: theme.shape.borderRadius,
|
|
11
|
+
maxWidth: '896px',
|
|
12
|
+
width: '100%',
|
|
13
|
+
maxHeight: '90vh',
|
|
14
|
+
},
|
|
15
|
+
}));
|
|
16
|
+
const NavButton = styled(IconButton)(({ theme }) => ({
|
|
17
|
+
width: '40px',
|
|
18
|
+
height: '40px',
|
|
19
|
+
border: `2px solid ${theme.palette.dark.main}`,
|
|
20
|
+
backgroundColor: theme.palette.light.main,
|
|
21
|
+
'&:hover': {
|
|
22
|
+
backgroundColor: theme.palette.dark.main,
|
|
23
|
+
color: theme.palette.light.main,
|
|
24
|
+
},
|
|
25
|
+
}));
|
|
26
|
+
const Modal = ({ isOpen, onClose, status, description, defaultText, note, acceptSuggestion: initialAcceptSuggestion = true, onAcceptSuggestionChange, onSave, onSubmit, onDeclineWording, onPrevious, onNext, currentPage = 1, totalPages = 1, }) => {
|
|
27
|
+
const [textValue, setTextValue] = useState(defaultText);
|
|
28
|
+
const [acceptSuggestion, setAcceptSuggestion] = useState(initialAcceptSuggestion);
|
|
29
|
+
const statusConfig = {
|
|
30
|
+
mandatory: {
|
|
31
|
+
color: '#F5A623',
|
|
32
|
+
label: 'Mandatory',
|
|
33
|
+
},
|
|
34
|
+
optional: {
|
|
35
|
+
color: '#F5D76E',
|
|
36
|
+
label: 'Optional',
|
|
37
|
+
},
|
|
38
|
+
accepted: {
|
|
39
|
+
color: '#A3D977',
|
|
40
|
+
label: 'Accepted',
|
|
41
|
+
},
|
|
42
|
+
'action-required': {
|
|
43
|
+
color: '#F56B6B',
|
|
44
|
+
label: 'Action Required',
|
|
45
|
+
},
|
|
46
|
+
'action-required-note': {
|
|
47
|
+
color: '#F56B6B',
|
|
48
|
+
label: 'Action Required',
|
|
49
|
+
},
|
|
50
|
+
'accepted-note': {
|
|
51
|
+
color: '#A3D977',
|
|
52
|
+
label: 'Accepted',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
const statusStyle = statusConfig[status];
|
|
56
|
+
return (jsxs(StyledDialog, { open: isOpen, onClose: onClose, maxWidth: "md", fullWidth: true, children: [jsx(IconButton, { onClick: onClose, sx: {
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
top: 16,
|
|
59
|
+
right: 16,
|
|
60
|
+
zIndex: 1,
|
|
61
|
+
}, 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: {
|
|
62
|
+
backgroundColor: statusStyle.color,
|
|
63
|
+
color: status === 'optional' ? '#4D3019' : '#fff',
|
|
64
|
+
fontWeight: 600,
|
|
65
|
+
fontSize: '0.875rem',
|
|
66
|
+
height: 'auto',
|
|
67
|
+
py: 1,
|
|
68
|
+
px: 2,
|
|
69
|
+
} }) }), 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: {
|
|
70
|
+
mb: 2,
|
|
71
|
+
backgroundColor: '#FFE6E6',
|
|
72
|
+
borderLeft: '4px solid #F56B6B',
|
|
73
|
+
'& .MuiAlert-icon': {
|
|
74
|
+
color: '#F56B6B',
|
|
75
|
+
},
|
|
76
|
+
'& .MuiAlert-message': {
|
|
77
|
+
color: '#4D3019',
|
|
78
|
+
},
|
|
79
|
+
}, children: note })), status === 'accepted-note' && note && (jsx(Alert, { icon: jsx(StickyNote2Rounded, { sx: { fontSize: 20 } }), severity: "warning", sx: {
|
|
80
|
+
mb: 2,
|
|
81
|
+
backgroundColor: '#FFF9E6',
|
|
82
|
+
borderLeft: '4px solid #F5D76E',
|
|
83
|
+
'& .MuiAlert-icon': {
|
|
84
|
+
color: '#F5A623',
|
|
85
|
+
},
|
|
86
|
+
'& .MuiAlert-message': {
|
|
87
|
+
color: '#4D3019',
|
|
88
|
+
},
|
|
89
|
+
}, children: note })), jsx(TextField, { multiline: true, rows: 4, fullWidth: true, value: textValue, onChange: (e) => setTextValue(e.target.value), disabled: acceptSuggestion, sx: {
|
|
90
|
+
mb: 2,
|
|
91
|
+
'& .MuiOutlinedInput-root': {
|
|
92
|
+
backgroundColor: acceptSuggestion ? 'rgba(0, 0, 0, 0.05)' : '#fff',
|
|
93
|
+
},
|
|
94
|
+
} }), jsxs(Box, { sx: {
|
|
95
|
+
display: 'flex',
|
|
96
|
+
flexDirection: { xs: 'column', sm: 'row' },
|
|
97
|
+
alignItems: { xs: 'stretch', sm: 'center' },
|
|
98
|
+
justifyContent: 'space-between',
|
|
99
|
+
gap: 2,
|
|
100
|
+
pt: 3,
|
|
101
|
+
borderTop: '1px solid',
|
|
102
|
+
borderColor: 'divider',
|
|
103
|
+
}, 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: {
|
|
104
|
+
display: 'flex',
|
|
105
|
+
alignItems: 'center',
|
|
106
|
+
gap: 2,
|
|
107
|
+
justifyContent: { xs: 'space-between', sm: 'flex-end' },
|
|
108
|
+
}, 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] })] })] })] })] }));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export { Modal };
|
|
112
|
+
//# 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,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface NoteBoxProps {
|
|
3
|
+
variant?: 'default' | 'mandatory' | 'optional' | 'pending' | 'accepted' | 'action-required' | 'custom';
|
|
4
|
+
label?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
onEditClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const NoteBox: React.FC<NoteBoxProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { styled, Box, IconButton, Typography } from '@mui/material';
|
|
5
|
+
import { EditRounded } from '@mui/icons-material';
|
|
6
|
+
|
|
7
|
+
const NoteContainer = styled(Box)({
|
|
8
|
+
position: 'relative',
|
|
9
|
+
maxWidth: '100%',
|
|
10
|
+
});
|
|
11
|
+
const EditButton = styled(IconButton)(({ theme }) => ({
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
right: -4,
|
|
14
|
+
top: '50%',
|
|
15
|
+
transform: 'translateY(-50%)',
|
|
16
|
+
width: 24,
|
|
17
|
+
height: 24,
|
|
18
|
+
backgroundColor: '#4D3019',
|
|
19
|
+
opacity: 0,
|
|
20
|
+
transition: 'all 0.2s ease',
|
|
21
|
+
boxShadow: '0 1px 3px rgba(0,0,0,0.12)',
|
|
22
|
+
'&:hover': {
|
|
23
|
+
backgroundColor: '#4D3019',
|
|
24
|
+
transform: 'translateY(-50%) scale(1.1)',
|
|
25
|
+
},
|
|
26
|
+
}));
|
|
27
|
+
const HighlightWrapper = styled(Box)(({ isHovered, highlightColor, highlightSelectedColor, isCustom }) => ({
|
|
28
|
+
position: 'relative',
|
|
29
|
+
display: 'inline-block',
|
|
30
|
+
maxWidth: '100%',
|
|
31
|
+
'&:hover .edit-button': {
|
|
32
|
+
opacity: 1,
|
|
33
|
+
},
|
|
34
|
+
'& .highlight-span': {
|
|
35
|
+
background: isCustom ? highlightColor : (isHovered ? highlightSelectedColor : highlightColor),
|
|
36
|
+
padding: '2px 4px',
|
|
37
|
+
boxDecorationBreak: 'clone',
|
|
38
|
+
WebkitBoxDecorationBreak: 'clone',
|
|
39
|
+
transition: isCustom ? 'none' : 'background 0.2s ease',
|
|
40
|
+
cursor: isCustom ? 'default' : 'pointer',
|
|
41
|
+
fontSize: '13px',
|
|
42
|
+
wordWrap: 'break-word',
|
|
43
|
+
overflowWrap: 'break-word',
|
|
44
|
+
display: 'inline',
|
|
45
|
+
color: '#4D3019',
|
|
46
|
+
},
|
|
47
|
+
}));
|
|
48
|
+
const NoteBox = ({ variant = 'default', label, children, className = '', onEditClick, }) => {
|
|
49
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
50
|
+
const variants = {
|
|
51
|
+
default: {
|
|
52
|
+
highlight: '#FFEACD',
|
|
53
|
+
highlightSelected: '#FFC365',
|
|
54
|
+
label: '',
|
|
55
|
+
labelColor: '',
|
|
56
|
+
},
|
|
57
|
+
mandatory: {
|
|
58
|
+
highlight: '#FFEACD',
|
|
59
|
+
highlightSelected: '#FFC365',
|
|
60
|
+
label: 'Not Answered (Mandatory)',
|
|
61
|
+
labelColor: 'var(--color-secondary)',
|
|
62
|
+
},
|
|
63
|
+
optional: {
|
|
64
|
+
highlight: '#FFF6D1',
|
|
65
|
+
highlightSelected: '#FDE58E',
|
|
66
|
+
label: 'Not Answered (Optional)',
|
|
67
|
+
labelColor: 'var(--color-secondary)',
|
|
68
|
+
},
|
|
69
|
+
pending: {
|
|
70
|
+
highlight: '#F5E2FF',
|
|
71
|
+
highlightSelected: '#EBC7FF',
|
|
72
|
+
label: 'Pending',
|
|
73
|
+
labelColor: 'var(--color-secondary)',
|
|
74
|
+
},
|
|
75
|
+
accepted: {
|
|
76
|
+
highlight: '#EDF9CD',
|
|
77
|
+
highlightSelected: '#DBF59A',
|
|
78
|
+
label: 'Accepted',
|
|
79
|
+
labelColor: '#2D5016',
|
|
80
|
+
},
|
|
81
|
+
'action-required': {
|
|
82
|
+
highlight: '#FBEEEE',
|
|
83
|
+
highlightSelected: '#FFBCB3',
|
|
84
|
+
label: 'Action required before approval',
|
|
85
|
+
labelColor: '#CC0000',
|
|
86
|
+
},
|
|
87
|
+
custom: {
|
|
88
|
+
highlight: '#D9EDF8',
|
|
89
|
+
highlightSelected: '#B3E0F2',
|
|
90
|
+
label: 'Custom Text',
|
|
91
|
+
labelColor: 'var(--color-secondary)',
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
const style = variants[variant];
|
|
95
|
+
const displayLabel = label || style.label;
|
|
96
|
+
return (jsxs(NoteContainer, { className: className, children: [displayLabel && (jsx(Box, { sx: { mb: 1 }, children: jsx(Typography, { component: "span", sx: {
|
|
97
|
+
fontSize: '13px',
|
|
98
|
+
fontWeight: 500,
|
|
99
|
+
color: style.labelColor || 'rgba(0, 0, 0, 0.6)',
|
|
100
|
+
}, children: displayLabel }) })), jsxs(HighlightWrapper, { isHovered: isHovered, highlightColor: style.highlight, highlightSelectedColor: style.highlightSelected, isCustom: variant === 'custom', onMouseEnter: () => variant !== 'custom' && setIsHovered(true), onMouseLeave: () => variant !== 'custom' && setIsHovered(false), children: [jsx("span", { className: "highlight-span", children: children }), jsx(EditButton, { className: "edit-button", onClick: (e) => {
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
if (onEditClick) {
|
|
103
|
+
onEditClick();
|
|
104
|
+
}
|
|
105
|
+
}, title: "Edit variable highlight", size: "small", children: jsx(EditRounded, { sx: { fontSize: 14, color: "#FFFFFF", strokeWidth: 2 } }) })] })] }));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export { NoteBox };
|
|
109
|
+
//# 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,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ProgressProps {
|
|
3
|
+
current: number;
|
|
4
|
+
total: number;
|
|
5
|
+
showLabel?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Progress: React.FC<ProgressProps>;
|
|
9
|
+
interface StepIndicatorProps {
|
|
10
|
+
steps: string[];
|
|
11
|
+
currentStep: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const StepIndicator: React.FC<StepIndicatorProps>;
|
|
15
|
+
export {};
|