ece-docs-components 1.0.5 → 1.0.7
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 +159 -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/esm/ThemeProvider.d.ts +117 -0
- package/dist/esm/ThemeProvider.js +137 -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} +270 -198
- 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 +224 -242
- package/dist/index.js.map +1 -1
- package/package.json +15 -13
- package/dist/index.esm.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../../src/components/Card.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { Box, styled, SxProps, Theme } from '@mui/material';\n\ninterface CardProps {\n children: React.ReactNode;\n className?: string;\n padding?: 'none' | 'sm' | 'md' | 'lg';\n variant?: 'default' | 'bordered' | 'elevated';\n sx?: SxProps<Theme>; // Add sx prop to support Material-UI styling\n}\n\nconst StyledCard = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'customPadding' && prop !== 'customVariant',\n})<{ customPadding: string; customVariant: string }>(({ theme, customPadding, customVariant }) => {\n const paddingStyles = {\n none: { padding: 0 },\n sm: { padding: theme.spacing(2) }, // 16px\n md: { padding: theme.spacing(3) }, // 24px\n lg: { padding: theme.spacing(4) }, // 32px\n };\n\n const variantStyles = {\n default: {\n border: `1px solid ${theme.palette.dark.main}10`, // dark.main with 10% opacity\n },\n bordered: {\n border: `2px solid ${theme.palette.dark.main}20`, // dark.main with 20% opacity\n },\n elevated: {\n border: `1px solid ${theme.palette.dark.main}05`, // dark.main with 5% opacity\n boxShadow: theme.shadows[4], // MUI shadow level 4 for \"elevated\"\n },\n };\n\n const borderRadiusValue = typeof theme.shape.borderRadius === 'string'\n ? parseInt(theme.shape.borderRadius, 10)\n : theme.shape.borderRadius || 4;\n\n return {\n borderRadius: borderRadiusValue * 2, // Matches rounded-xl (approx 12px)\n overflow: 'visible',\n backgroundColor: theme.palette.light.main, // Matches #FEFDF7\n ...paddingStyles[customPadding as keyof typeof paddingStyles],\n ...variantStyles[customVariant as keyof typeof variantStyles],\n };\n});\n\nexport const Card: React.FC<CardProps> = ({\n children,\n className = '',\n padding = 'md',\n variant = 'default',\n sx, // Destructure sx prop\n}) => {\n return (\n <StyledCard\n className={className}\n customPadding={padding}\n customVariant={variant}\n sx={sx} // Pass sx prop to StyledCard\n >\n {children}\n </StyledCard>\n );\n};"],"names":[],"mappings":";;;;;;AAaA;AACE;;AAEA;AACE;AACA;AACA;AACA;;AAGF;AACE;;AAEC;AACD;;AAEC;AACD;;;AAGC;;;;;;AAQD;AACA;;;;;AAKJ;;AAQC;;AAWD;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var material = require('@mui/material');
|
|
6
|
+
|
|
7
|
+
const StyledWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
8
|
+
display: 'flex',
|
|
9
|
+
alignItems: 'flex-start',
|
|
10
|
+
}));
|
|
11
|
+
const StyledCheckbox = material.styled(material.Checkbox)(({ theme }) => ({
|
|
12
|
+
width: 16, // Matches Tailwind's w-4 (16px)
|
|
13
|
+
height: 16, // Matches Tailwind's h-4 (16px)
|
|
14
|
+
color: theme.palette.dark.main + '33', // dark.main with 20% opacity (border-dark/20)
|
|
15
|
+
'&.Mui-checked': {
|
|
16
|
+
color: theme.palette.primary.main, // text-primary
|
|
17
|
+
},
|
|
18
|
+
'&:focus': {
|
|
19
|
+
outline: `2px solid ${theme.palette.primary.main}`, // focus:ring-2 focus:ring-primary
|
|
20
|
+
outlineOffset: 2,
|
|
21
|
+
},
|
|
22
|
+
borderRadius: theme.shape.borderRadius, // Matches rounded
|
|
23
|
+
cursor: 'pointer',
|
|
24
|
+
}));
|
|
25
|
+
const StyledLabel = material.styled(material.Typography)(({ theme }) => ({
|
|
26
|
+
fontSize: '1rem', // text-base (16px)
|
|
27
|
+
fontWeight: 500, // font-medium
|
|
28
|
+
color: theme.palette.dark.main, // text-dark
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
}));
|
|
31
|
+
const StyledDescription = material.styled(material.Typography)(({ theme }) => ({
|
|
32
|
+
fontSize: '0.875rem', // text-sm (14px)
|
|
33
|
+
color: theme.palette.dark.main + '99', // dark.main with 60% opacity (text-dark/60)
|
|
34
|
+
marginTop: theme.spacing(0.5), // mt-0.5
|
|
35
|
+
}));
|
|
36
|
+
const Checkbox = ({ label, description, className = '', id, ...props }) => {
|
|
37
|
+
const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
38
|
+
return (jsxRuntime.jsx(StyledWrapper, { className: className, children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(StyledCheckbox, { id: checkboxId, ...props }), label: jsxRuntime.jsxs(material.Box, { sx: { ml: 1.5, display: 'flex', flexDirection: 'column' }, children: [jsxRuntime.jsx(StyledLabel, { children: label }), description && jsxRuntime.jsx(StyledDescription, { children: description })] }) }) }));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.Checkbox = Checkbox;
|
|
42
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { Box, Checkbox as MuiCheckbox, CheckboxProps, FormControlLabel, styled, Typography } from '@mui/material';\n\ninterface CustomCheckboxProps extends CheckboxProps {\n label: string;\n description?: string;\n}\n\nconst StyledWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'flex-start',\n}));\n\nconst StyledCheckbox = styled(MuiCheckbox)(({ theme }) => ({\n width: 16, // Matches Tailwind's w-4 (16px)\n height: 16, // Matches Tailwind's h-4 (16px)\n color: theme.palette.dark.main + '33', // dark.main with 20% opacity (border-dark/20)\n '&.Mui-checked': {\n color: theme.palette.primary.main, // text-primary\n },\n '&:focus': {\n outline: `2px solid ${theme.palette.primary.main}`, // focus:ring-2 focus:ring-primary\n outlineOffset: 2,\n },\n borderRadius: theme.shape.borderRadius, // Matches rounded\n cursor: 'pointer',\n}));\n\nconst StyledLabel = styled(Typography)(({ theme }) => ({\n fontSize: '1rem', // text-base (16px)\n fontWeight: 500, // font-medium\n color: theme.palette.dark.main, // text-dark\n cursor: 'pointer',\n}));\n\nconst StyledDescription = styled(Typography)(({ theme }) => ({\n fontSize: '0.875rem', // text-sm (14px)\n color: theme.palette.dark.main + '99', // dark.main with 60% opacity (text-dark/60)\n marginTop: theme.spacing(0.5), // mt-0.5\n}));\n\nexport const Checkbox: React.FC<CustomCheckboxProps> = ({\n label,\n description,\n className = '',\n id,\n ...props\n}) => {\n const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;\n\n return (\n <StyledWrapper className={className}>\n <FormControlLabel\n control={\n <StyledCheckbox\n id={checkboxId}\n {...props}\n />\n }\n label={\n <Box sx={{ ml: 1.5, display: 'flex', flexDirection: 'column' }}>\n <StyledLabel>{label}</StyledLabel>\n {description && <StyledDescription>{description}</StyledDescription>}\n </Box>\n }\n />\n </StyledWrapper>\n );\n};"],"names":[],"mappings":";;;;;;AAUA;AACE;AACA;AACD;AAED;;;;AAIE;;AAEC;AACD;;AAEE;AACD;AACD;AACA;AACD;AAED;;;;AAIE;AACD;AAED;;;;AAIC;;;AAWC;AAkBF;;"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var material = require('@mui/material');
|
|
7
|
+
var iconsMaterial = require('@mui/icons-material');
|
|
8
|
+
|
|
9
|
+
const StyledConcertina = material.styled(material.Box)(({ theme }) => ({
|
|
10
|
+
width: '100%',
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
gap: theme.spacing(1), // space-y-2
|
|
14
|
+
}));
|
|
15
|
+
const StyledSection = material.styled(material.Box)(({ theme }) => ({
|
|
16
|
+
border: `1px solid ${theme.palette.grey[200]}`, // border-gray-200
|
|
17
|
+
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
18
|
+
? parseInt(theme.shape.borderRadius, 10)
|
|
19
|
+
: theme.shape.borderRadius || 4) * 2, // rounded-lg
|
|
20
|
+
overflow: 'hidden',
|
|
21
|
+
}));
|
|
22
|
+
const StyledHeader = material.styled(material.Box)(({ theme }) => ({
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'space-between',
|
|
26
|
+
padding: theme.spacing(3), // p-3 sm:p-4 md:p-6
|
|
27
|
+
cursor: 'pointer',
|
|
28
|
+
transition: 'background-color 0.2s',
|
|
29
|
+
gap: theme.spacing(2), // gap-2
|
|
30
|
+
'&:hover': {
|
|
31
|
+
backgroundColor: theme.palette.light.main, // hover:bg-[#FDFCEE]
|
|
32
|
+
},
|
|
33
|
+
[theme.breakpoints.up('sm')]: {
|
|
34
|
+
padding: theme.spacing(4),
|
|
35
|
+
},
|
|
36
|
+
[theme.breakpoints.up('md')]: {
|
|
37
|
+
padding: theme.spacing(6),
|
|
38
|
+
},
|
|
39
|
+
}));
|
|
40
|
+
const StyledTitleWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
41
|
+
display: 'flex',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
gap: theme.spacing(3), // sm:gap-3
|
|
44
|
+
flex: 1,
|
|
45
|
+
minWidth: 0,
|
|
46
|
+
[theme.breakpoints.down('sm')]: {
|
|
47
|
+
gap: theme.spacing(2), // gap-2
|
|
48
|
+
},
|
|
49
|
+
}));
|
|
50
|
+
const StyledTitle = material.styled(material.Typography, {
|
|
51
|
+
shouldForwardProp: (prop) => prop !== 'isHovered',
|
|
52
|
+
})(({ theme, isHovered }) => ({
|
|
53
|
+
fontWeight: 700, // font-bold
|
|
54
|
+
fontSize: '1.5rem', // text-2xl
|
|
55
|
+
lineHeight: 1.2, // leading-tight
|
|
56
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
57
|
+
wordBreak: 'break-word', // break-words
|
|
58
|
+
position: 'relative',
|
|
59
|
+
'&:after': {
|
|
60
|
+
content: '""',
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
bottom: 0,
|
|
63
|
+
left: 0,
|
|
64
|
+
width: '100%',
|
|
65
|
+
height: 1,
|
|
66
|
+
backgroundColor: theme.palette.accent.main, // bg-orange-500
|
|
67
|
+
display: isHovered ? 'block' : 'none',
|
|
68
|
+
},
|
|
69
|
+
[theme.breakpoints.down('lg')]: {
|
|
70
|
+
fontSize: '1.25rem', // lg:text-[28px]
|
|
71
|
+
},
|
|
72
|
+
[theme.breakpoints.down('md')]: {
|
|
73
|
+
fontSize: '1.125rem', // md:text-xl
|
|
74
|
+
},
|
|
75
|
+
[theme.breakpoints.down('sm')]: {
|
|
76
|
+
fontSize: '1rem', // sm:text-lg
|
|
77
|
+
},
|
|
78
|
+
}));
|
|
79
|
+
const StyledLinkButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
80
|
+
color: theme.palette.accent.main, // text-orange-500
|
|
81
|
+
'&:hover': {
|
|
82
|
+
color: theme.palette.accent.dark || theme.palette.accent.main, // hover:text-orange-600
|
|
83
|
+
},
|
|
84
|
+
padding: 0,
|
|
85
|
+
}));
|
|
86
|
+
const StyledTooltip = material.styled(material.Box)(({ theme }) => ({
|
|
87
|
+
position: 'absolute',
|
|
88
|
+
top: -40, // -top-10
|
|
89
|
+
left: '50%',
|
|
90
|
+
transform: 'translateX(-50%)',
|
|
91
|
+
backgroundColor: theme.palette.grey[900], // bg-gray-900
|
|
92
|
+
color: theme.palette.common.white, // text-white
|
|
93
|
+
fontSize: '0.75rem', // text-xs
|
|
94
|
+
padding: theme.spacing(1, 2), // px-2 py-1
|
|
95
|
+
borderRadius: theme.shape.borderRadius, // rounded
|
|
96
|
+
whiteSpace: 'nowrap',
|
|
97
|
+
zIndex: 10,
|
|
98
|
+
[theme.breakpoints.up('sm')]: {
|
|
99
|
+
fontSize: '0.875rem', // sm:text-sm
|
|
100
|
+
padding: theme.spacing(1.5, 3), // sm:px-3 sm:py-1.5
|
|
101
|
+
},
|
|
102
|
+
}));
|
|
103
|
+
const StyledChevron = material.styled(iconsMaterial.ExpandMoreRounded)(({ theme }) => ({
|
|
104
|
+
color: theme.palette.grey[500], // text-gray-500
|
|
105
|
+
transition: 'transform 0.2s', // transition-transform duration-200
|
|
106
|
+
width: 24, // sm:w-6
|
|
107
|
+
height: 24, // sm:h-6
|
|
108
|
+
[theme.breakpoints.down('sm')]: {
|
|
109
|
+
width: 20,
|
|
110
|
+
height: 20,
|
|
111
|
+
},
|
|
112
|
+
}));
|
|
113
|
+
const StyledContent = material.styled(material.Box)(({ theme }) => ({
|
|
114
|
+
padding: theme.spacing(2, 3, 3), // px-3 pb-3 pt-2
|
|
115
|
+
[theme.breakpoints.up('sm')]: {
|
|
116
|
+
padding: theme.spacing(2, 4, 4), // sm:px-4 sm:pb-4
|
|
117
|
+
},
|
|
118
|
+
[theme.breakpoints.up('md')]: {
|
|
119
|
+
padding: theme.spacing(2, 6, 6), // md:px-6 md:pb-6
|
|
120
|
+
},
|
|
121
|
+
}));
|
|
122
|
+
const StyledContentText = material.styled(material.Typography)(({ theme }) => ({
|
|
123
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
124
|
+
lineHeight: 1.5, // leading-relaxed
|
|
125
|
+
wordBreak: 'break-word', // break-words
|
|
126
|
+
fontSize: 13, // style={{ fontSize: '13px' }}
|
|
127
|
+
}));
|
|
128
|
+
function Concertina({ sections }) {
|
|
129
|
+
const [openSections, setOpenSections] = React.useState(new Set());
|
|
130
|
+
const [hoveredTitle, setHoveredTitle] = React.useState(null);
|
|
131
|
+
const [copiedId, setCopiedId] = React.useState(null);
|
|
132
|
+
const toggleSection = (id) => {
|
|
133
|
+
const newOpenSections = new Set(openSections);
|
|
134
|
+
if (newOpenSections.has(id)) {
|
|
135
|
+
newOpenSections.delete(id);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
newOpenSections.add(id);
|
|
139
|
+
}
|
|
140
|
+
setOpenSections(newOpenSections);
|
|
141
|
+
};
|
|
142
|
+
const copyJumpLink = (id, e) => {
|
|
143
|
+
e.stopPropagation();
|
|
144
|
+
const url = `${window.location.origin}${window.location.pathname}#${id}`;
|
|
145
|
+
navigator.clipboard.writeText(url);
|
|
146
|
+
setCopiedId(id);
|
|
147
|
+
setTimeout(() => setCopiedId(null), 2000);
|
|
148
|
+
};
|
|
149
|
+
return (jsxRuntime.jsx(StyledConcertina, { children: sections.map((section) => (jsxRuntime.jsxs(StyledSection, { id: section.id, children: [jsxRuntime.jsxs(StyledHeader, { onClick: () => toggleSection(section.id), onMouseEnter: () => setHoveredTitle(section.id), onMouseLeave: () => setHoveredTitle(null), children: [jsxRuntime.jsxs(StyledTitleWrapper, { children: [jsxRuntime.jsx(StyledTitle, { isHovered: hoveredTitle === section.id, variant: "h3", children: section.title }), hoveredTitle === section.id && (jsxRuntime.jsxs(material.Box, { sx: { position: 'relative', flexShrink: 0 }, children: [jsxRuntime.jsx(StyledLinkButton, { onClick: (e) => copyJumpLink(section.id, e), "aria-label": "Copy link", children: jsxRuntime.jsx(iconsMaterial.LinkRounded, { sx: { fontSize: 20 } }) }), copiedId === section.id && (jsxRuntime.jsx(StyledTooltip, { children: "Link copied" }))] }))] }), jsxRuntime.jsx(StyledChevron, { sx: { fontSize: 20, transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' } })] }), jsxRuntime.jsx(material.Collapse, { in: openSections.has(section.id), children: jsxRuntime.jsx(StyledContent, { children: jsxRuntime.jsx(StyledContentText, { children: section.content }) }) })] }, section.id))) }));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
exports.Concertina = Concertina;
|
|
153
|
+
//# sourceMappingURL=Concertina.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Concertina.js","sources":["../../../../src/components/Concertina.tsx"],"sourcesContent":["'use client';\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":[],"mappings":";;;;;;;;AAgBA;AACE;AACA;AACA;;AAED;AAED;AACE;;;AAGA;AACA;AACD;AAED;AACE;AACA;AACA;;AAEA;AACA;;AAEA;;AAEC;;AAEC;AACD;;AAEC;AACD;AACF;AAED;AACE;AACA;;AAEA;AACA;;;AAGC;AACF;AAED;;;;;;;;AAQE;AACA;AACE;AACA;AACA;AACA;AACA;AACA;;;AAGD;;;AAGA;;;AAGA;;;AAGA;AACF;AAED;;AAEE;AACE;AACD;AACD;AACD;AAED;AACE;AACA;AACA;AACA;;;;;AAKA;AACA;AACA;;;;AAIC;AACF;AAED;;;;;;AAMI;AACA;AACD;AACF;AAED;AACE;;AAEE;AACD;;AAEC;AACD;AACF;AAED;;;;;AAKC;AAEK;AACJ;;;AAIA;AACE;AACA;AACE;;;AAEA;;;AAGJ;AAEA;;AAEE;AACA;;;AAGF;;AA4CF;;"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var material = require('@mui/material');
|
|
7
|
+
var ThemeProvider = require('../ThemeProvider.js');
|
|
8
|
+
var iconsMaterial = require('@mui/icons-material');
|
|
9
|
+
|
|
10
|
+
const StyledWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
11
|
+
// No specific wrapper styles needed, just a container
|
|
12
|
+
}));
|
|
13
|
+
const StyledParagraph = material.styled(material.Typography)(({ theme }) => ({
|
|
14
|
+
fontSize: '14px', // text-[14px]
|
|
15
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
16
|
+
display: 'inline-flex',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
}));
|
|
19
|
+
const StyledTermWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
20
|
+
position: 'relative',
|
|
21
|
+
display: 'inline-flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
cursor: 'pointer',
|
|
24
|
+
marginLeft: theme.spacing(0.5), // ml-1
|
|
25
|
+
}));
|
|
26
|
+
const StyledTerm = material.styled('span', {
|
|
27
|
+
shouldForwardProp: (prop) => prop !== 'isOpen',
|
|
28
|
+
})(({ theme, isOpen }) => ({
|
|
29
|
+
paddingBottom: '1px', // style={{ paddingBottom: '1px' }}
|
|
30
|
+
borderBottom: `2px solid ${isOpen ? theme.palette.secondary.main : theme.palette.dark.main}`, // border-b-2
|
|
31
|
+
transition: 'border-bottom-color 0.2s', // transition-colors
|
|
32
|
+
'&:hover': {
|
|
33
|
+
borderBottomColor: theme.palette.secondary.main, // hover effect
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
const StyledIconWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
37
|
+
display: 'inline-flex',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
marginLeft: theme.spacing(0.5), // ml-1
|
|
41
|
+
transition: 'color 0.2s', // transition-colors
|
|
42
|
+
}));
|
|
43
|
+
const StyledDefinitionBox = material.styled(material.Box)(({ theme }) => ({
|
|
44
|
+
marginTop: theme.spacing(2), // mt-4
|
|
45
|
+
padding: theme.spacing(2), // p-4
|
|
46
|
+
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
47
|
+
? parseInt(theme.shape.borderRadius, 10)
|
|
48
|
+
: theme.shape.borderRadius || 4) * 2, // rounded-lg
|
|
49
|
+
border: `1px solid ${theme.palette.dark.main}33`, // border-[#4D3019]/20
|
|
50
|
+
borderRight: `4px solid ${theme.palette.dark.main}33`, // border-r-4
|
|
51
|
+
backgroundColor: theme.palette.light.main, // style={{ backgroundColor: '#FDFCEE' }}
|
|
52
|
+
}));
|
|
53
|
+
const StyledDefinitionText = material.styled(material.Typography)(({ theme }) => ({
|
|
54
|
+
fontSize: '14px', // text-[14px]
|
|
55
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
56
|
+
lineHeight: 1.5, // leading-relaxed
|
|
57
|
+
}));
|
|
58
|
+
function DefinitionBox({ term, definition, children }) {
|
|
59
|
+
const { theme } = ThemeProvider.useTheme();
|
|
60
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
61
|
+
return (jsxRuntime.jsxs(StyledWrapper, { children: [jsxRuntime.jsxs(StyledParagraph, { children: [children, jsxRuntime.jsxs(StyledTermWrapper, { onClick: () => setIsOpen(!isOpen), children: [jsxRuntime.jsx(StyledTerm, { isOpen: isOpen, onMouseEnter: (e) => (e.currentTarget.style.borderBottomColor = theme.palette.secondary.main), onMouseLeave: (e) => (e.currentTarget.style.borderBottomColor = isOpen ? theme.palette.secondary.main : theme.palette.dark.main), children: term }), jsxRuntime.jsx(StyledIconWrapper, { children: isOpen ? (jsxRuntime.jsx(iconsMaterial.CloseRounded, { sx: {
|
|
62
|
+
fontSize: 16,
|
|
63
|
+
color: isOpen ? theme.palette.secondary.main : theme.palette.dark.main,
|
|
64
|
+
'&:hover': {
|
|
65
|
+
color: theme.palette.secondary.main
|
|
66
|
+
}
|
|
67
|
+
} })) : (jsxRuntime.jsx(iconsMaterial.AddRounded, { sx: {
|
|
68
|
+
fontSize: 16,
|
|
69
|
+
color: theme.palette.dark.main,
|
|
70
|
+
'&:hover': {
|
|
71
|
+
color: theme.palette.secondary.main
|
|
72
|
+
}
|
|
73
|
+
} })) })] })] }), isOpen && (jsxRuntime.jsx(StyledDefinitionBox, { children: jsxRuntime.jsx(StyledDefinitionText, { children: definition }) }))] }));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
exports.DefinitionBox = DefinitionBox;
|
|
77
|
+
//# sourceMappingURL=DefinitionBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefinitionBox.js","sources":["../../../../src/components/DefinitionBox.tsx"],"sourcesContent":["'use client';\n\nimport React, { useState } from 'react';\nimport { Box, styled, Typography } from '@mui/material';\nimport { useTheme } from '../ThemeProvider';\nimport { AddRounded, CloseRounded } from '@mui/icons-material';\n\ninterface DefinitionBoxProps {\n term: string;\n definition: string;\n children: React.ReactNode;\n}\n\nconst StyledWrapper = styled(Box)(({ theme }) => ({\n // No specific wrapper styles needed, just a container\n}));\n\nconst StyledParagraph = styled(Typography)(({ theme }) => ({\n fontSize: '14px', // text-[14px]\n color: theme.palette.dark.main, // text-[#4D3019]\n display: 'inline-flex',\n alignItems: 'center',\n}));\n\nconst StyledTermWrapper = styled(Box)(({ theme }) => ({\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n cursor: 'pointer',\n marginLeft: theme.spacing(0.5), // ml-1\n}));\n\nconst StyledTerm = styled('span', {\n shouldForwardProp: (prop) => prop !== 'isOpen',\n})<{ isOpen: boolean }>(({ theme, isOpen }) => ({\n paddingBottom: '1px', // style={{ paddingBottom: '1px' }}\n borderBottom: `2px solid ${isOpen ? theme.palette.secondary.main : theme.palette.dark.main}`, // border-b-2\n transition: 'border-bottom-color 0.2s', // transition-colors\n '&:hover': {\n borderBottomColor: theme.palette.secondary.main, // hover effect\n },\n}));\n\nconst StyledIconWrapper = styled(Box)(({ theme }) => ({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n marginLeft: theme.spacing(0.5), // ml-1\n transition: 'color 0.2s', // transition-colors\n}));\n\nconst StyledDefinitionBox = styled(Box)(({ theme }) => ({\n marginTop: theme.spacing(2), // mt-4\n padding: theme.spacing(2), // p-4\n borderRadius: (typeof theme.shape.borderRadius === 'string'\n ? parseInt(theme.shape.borderRadius, 10)\n : theme.shape.borderRadius || 4) * 2, // rounded-lg\n border: `1px solid ${theme.palette.dark.main}33`, // border-[#4D3019]/20\n borderRight: `4px solid ${theme.palette.dark.main}33`, // border-r-4\n backgroundColor: theme.palette.light.main, // style={{ backgroundColor: '#FDFCEE' }}\n}));\n\nconst StyledDefinitionText = styled(Typography)(({ theme }) => ({\n fontSize: '14px', // text-[14px]\n color: theme.palette.dark.main, // text-[#4D3019]\n lineHeight: 1.5, // leading-relaxed\n}));\n\nexport function DefinitionBox({ term, definition, children }: DefinitionBoxProps) {\n const { theme } = useTheme();\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <StyledWrapper>\n <StyledParagraph>\n {children}\n <StyledTermWrapper onClick={() => setIsOpen(!isOpen)}>\n <StyledTerm\n isOpen={isOpen}\n onMouseEnter={(e) => (e.currentTarget.style.borderBottomColor = theme.palette.secondary.main)}\n onMouseLeave={(e) => (e.currentTarget.style.borderBottomColor = isOpen ? theme.palette.secondary.main : theme.palette.dark.main)}\n >\n {term}\n </StyledTerm>\n <StyledIconWrapper>\n {isOpen ? (\n <CloseRounded\n sx={{\n fontSize: 16,\n color: isOpen ? theme.palette.secondary.main : theme.palette.dark.main,\n '&:hover': {\n color: theme.palette.secondary.main\n }\n }}\n />\n ) : (\n <AddRounded\n sx={{\n fontSize: 16,\n color: theme.palette.dark.main,\n '&:hover': {\n color: theme.palette.secondary.main\n }\n }}\n />\n )}\n </StyledIconWrapper>\n </StyledTermWrapper>\n </StyledParagraph>\n {isOpen && (\n <StyledDefinitionBox>\n <StyledDefinitionText>{definition}</StyledDefinitionText>\n </StyledDefinitionBox>\n )}\n </StyledWrapper>\n );\n}"],"names":[],"mappings":";;;;;;;;;AAaA;AACE;AACD;AAED;;;AAGE;AACA;AACD;AAED;AACE;AACA;AACA;AACA;;AAED;AAED;;;;;;AAME;;AAEC;AACF;AAED;AACE;AACA;AACA;;;AAGD;AAED;;;;;AAKE;;;;AAID;AAED;;;;AAIC;AAEK;AACJ;;;AAmBgB;;AAEA;AACE;AACD;;AAMD;AACA;AACA;AACE;AACD;;AAcnB;;"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var material = require('@mui/material');
|
|
6
|
+
var ThemeProvider = require('../ThemeProvider.js');
|
|
7
|
+
var iconsMaterial = require('@mui/icons-material');
|
|
8
|
+
|
|
9
|
+
const StyledHeader = material.styled(material.Box)(({ theme }) => ({
|
|
10
|
+
padding: theme.spacing(1.5, 4), // px-4 py-3
|
|
11
|
+
display: 'flex',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
justifyContent: 'space-between',
|
|
14
|
+
gap: theme.spacing(2), // gap-2
|
|
15
|
+
backgroundColor: theme.palette.primary.main, // var(--color-primary)
|
|
16
|
+
[theme.breakpoints.up('sm')]: {
|
|
17
|
+
padding: theme.spacing(2, 6), // sm:px-6
|
|
18
|
+
},
|
|
19
|
+
[theme.breakpoints.up('md')]: {
|
|
20
|
+
padding: theme.spacing(2, 8), // md:px-8
|
|
21
|
+
gap: theme.spacing(4), // md:gap-4
|
|
22
|
+
},
|
|
23
|
+
}));
|
|
24
|
+
const StyledLogoWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
gap: theme.spacing(2), // md:gap-2
|
|
28
|
+
[theme.breakpoints.down('md')]: {
|
|
29
|
+
gap: theme.spacing(1.5), // gap-1.5
|
|
30
|
+
},
|
|
31
|
+
}));
|
|
32
|
+
const StyledLogoIcon = material.styled(material.Box)(({ theme }) => ({
|
|
33
|
+
width: 32, // md:w-8 md:h-8
|
|
34
|
+
height: 32,
|
|
35
|
+
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
36
|
+
[theme.breakpoints.down('md')]: {
|
|
37
|
+
width: 24, // w-6
|
|
38
|
+
height: 24, // h-6
|
|
39
|
+
},
|
|
40
|
+
}));
|
|
41
|
+
const StyledLogoText = material.styled(material.Typography)(({ theme }) => ({
|
|
42
|
+
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
43
|
+
fontWeight: 700, // font-bold
|
|
44
|
+
letterSpacing: '0.05em', // tracking-wide
|
|
45
|
+
fontSize: '1.5rem', // text-2xl
|
|
46
|
+
[theme.breakpoints.down('md')]: {
|
|
47
|
+
fontSize: '1.25rem', // sm:text-xl
|
|
48
|
+
},
|
|
49
|
+
[theme.breakpoints.down('sm')]: {
|
|
50
|
+
fontSize: '1.125rem', // text-lg
|
|
51
|
+
},
|
|
52
|
+
}));
|
|
53
|
+
const StyledSearchContainer = material.styled(material.Box)(({ theme }) => ({
|
|
54
|
+
flex: 1,
|
|
55
|
+
maxWidth: '32rem', // max-w-2xl
|
|
56
|
+
margin: theme.spacing(0, 8), // mx-8
|
|
57
|
+
position: 'relative',
|
|
58
|
+
[theme.breakpoints.down('md')]: {
|
|
59
|
+
margin: theme.spacing(0, 4), // sm:mx-4
|
|
60
|
+
},
|
|
61
|
+
[theme.breakpoints.down('sm')]: {
|
|
62
|
+
margin: theme.spacing(0, 2), // mx-2
|
|
63
|
+
},
|
|
64
|
+
}));
|
|
65
|
+
const StyledTextField = material.styled(material.TextField)(({ theme }) => ({
|
|
66
|
+
'& .MuiInputBase-root': {
|
|
67
|
+
backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]
|
|
68
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
69
|
+
borderRadius: '9999px', // rounded-full
|
|
70
|
+
paddingRight: theme.spacing(6), // pr-12
|
|
71
|
+
fontSize: '1rem', // text-base
|
|
72
|
+
[theme.breakpoints.down('md')]: {
|
|
73
|
+
paddingRight: theme.spacing(5), // sm:pr-10
|
|
74
|
+
fontSize: '0.875rem', // text-sm
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
'& .MuiInputBase-input': {
|
|
78
|
+
padding: theme.spacing(1.5, 3), // px-4 py-2
|
|
79
|
+
[theme.breakpoints.up('md')]: {
|
|
80
|
+
padding: theme.spacing(1.5, 4), // md:px-6 md:py-3
|
|
81
|
+
},
|
|
82
|
+
[theme.breakpoints.down('sm')]: {
|
|
83
|
+
padding: theme.spacing(1.5, 2.5), // sm:px-5
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
'& .MuiInputBase-input::placeholder': {
|
|
87
|
+
color: `${theme.palette.dark.main}99`, // placeholder-[#4D3019]/60
|
|
88
|
+
opacity: 1,
|
|
89
|
+
},
|
|
90
|
+
'& .MuiInputBase-root:focus-within': {
|
|
91
|
+
outline: `2px solid ${theme.palette.light.main}`, // focus:ring-2 focus:ring-[#FDFCEE]
|
|
92
|
+
outlineOffset: 0,
|
|
93
|
+
},
|
|
94
|
+
}));
|
|
95
|
+
const StyledSearchButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
96
|
+
position: 'absolute',
|
|
97
|
+
right: theme.spacing(2), // md:right-2
|
|
98
|
+
top: '50%',
|
|
99
|
+
transform: 'translateY(-50%)',
|
|
100
|
+
width: theme.spacing(5), // md:w-10
|
|
101
|
+
height: theme.spacing(5), // md:h-10
|
|
102
|
+
borderRadius: '50%', // rounded-full
|
|
103
|
+
backgroundColor: theme.palette.primary.main, // var(--color-primary)
|
|
104
|
+
'&:hover': {
|
|
105
|
+
opacity: 0.9, // hover:opacity-90
|
|
106
|
+
backgroundColor: theme.palette.primary.main,
|
|
107
|
+
},
|
|
108
|
+
[theme.breakpoints.down('md')]: {
|
|
109
|
+
right: theme.spacing(1), // right-1
|
|
110
|
+
width: theme.spacing(4), // w-8
|
|
111
|
+
height: theme.spacing(4), // h-8
|
|
112
|
+
},
|
|
113
|
+
}));
|
|
114
|
+
const StyledSearchIcon = material.styled(material.Box)(({ theme }) => ({
|
|
115
|
+
width: 20, // md:w-5 md:h-5
|
|
116
|
+
height: 20,
|
|
117
|
+
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
118
|
+
[theme.breakpoints.down('md')]: {
|
|
119
|
+
width: 16, // w-4
|
|
120
|
+
height: 16, // h-4
|
|
121
|
+
},
|
|
122
|
+
}));
|
|
123
|
+
const StyledUserContainer = material.styled(material.Box)(({ theme }) => ({
|
|
124
|
+
display: 'flex',
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
gap: theme.spacing(3), // md:gap-3
|
|
127
|
+
[theme.breakpoints.down('md')]: {
|
|
128
|
+
gap: theme.spacing(2), // gap-2
|
|
129
|
+
},
|
|
130
|
+
}));
|
|
131
|
+
const StyledAvatar = material.styled(material.Box)(({ theme }) => ({
|
|
132
|
+
width: theme.spacing(6), // md:w-12
|
|
133
|
+
height: theme.spacing(6), // md:h-12
|
|
134
|
+
borderRadius: '50%', // rounded-full
|
|
135
|
+
backgroundColor: theme.palette.light.main, // bg-[#FDFCEE]
|
|
136
|
+
display: 'flex',
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
justifyContent: 'center',
|
|
139
|
+
flexShrink: 0,
|
|
140
|
+
[theme.breakpoints.down('md')]: {
|
|
141
|
+
width: theme.spacing(5), // sm:w-10
|
|
142
|
+
height: theme.spacing(5), // sm:h-10
|
|
143
|
+
},
|
|
144
|
+
[theme.breakpoints.down('sm')]: {
|
|
145
|
+
width: theme.spacing(4), // w-8
|
|
146
|
+
height: theme.spacing(4), // h-8
|
|
147
|
+
},
|
|
148
|
+
}));
|
|
149
|
+
const StyledAvatarText = material.styled(material.Typography)(({ theme }) => ({
|
|
150
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
151
|
+
fontWeight: 700, // font-bold
|
|
152
|
+
fontSize: '1.125rem', // text-lg
|
|
153
|
+
[theme.breakpoints.down('md')]: {
|
|
154
|
+
fontSize: '0.875rem', // text-sm
|
|
155
|
+
},
|
|
156
|
+
}));
|
|
157
|
+
const StyledUserName = material.styled(material.Typography)(({ theme }) => ({
|
|
158
|
+
color: theme.palette.light.main, // text-[#FDFCEE]
|
|
159
|
+
fontWeight: 500, // font-medium
|
|
160
|
+
fontSize: '1.125rem', // text-lg
|
|
161
|
+
display: 'none', // hidden
|
|
162
|
+
[theme.breakpoints.up('sm')]: {
|
|
163
|
+
display: 'inline', // sm:inline
|
|
164
|
+
},
|
|
165
|
+
[theme.breakpoints.down('md')]: {
|
|
166
|
+
fontSize: '0.875rem', // text-sm
|
|
167
|
+
},
|
|
168
|
+
}));
|
|
169
|
+
const Header = ({ userName = 'John Doe', userInitials = 'JD', }) => {
|
|
170
|
+
const { theme } = ThemeProvider.useTheme();
|
|
171
|
+
return (jsxRuntime.jsxs(StyledHeader, { children: [jsxRuntime.jsxs(StyledLogoWrapper, { children: [jsxRuntime.jsx(StyledLogoIcon, { children: jsxRuntime.jsx(iconsMaterial.SchoolRounded, { sx: { fontSize: 32, color: 'currentColor' } }) }), jsxRuntime.jsx(StyledLogoText, { variant: "h1", children: theme.appName })] }), jsxRuntime.jsx(StyledSearchContainer, { children: jsxRuntime.jsx(StyledTextField, { placeholder: "Search for a policy", variant: "outlined", fullWidth: true, InputProps: {
|
|
172
|
+
endAdornment: (jsxRuntime.jsx(StyledSearchButton, { children: jsxRuntime.jsx(StyledSearchIcon, { children: jsxRuntime.jsx(iconsMaterial.SearchRounded, { sx: { fontSize: 20 } }) }) })),
|
|
173
|
+
} }) }), jsxRuntime.jsxs(StyledUserContainer, { children: [jsxRuntime.jsx(StyledAvatar, { children: jsxRuntime.jsx(StyledAvatarText, { children: userInitials }) }), jsxRuntime.jsx(StyledUserName, { children: userName })] })] }));
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
exports.Header = Header;
|
|
177
|
+
//# 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,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var material = require('@mui/material');
|
|
6
|
+
|
|
7
|
+
const InputWrapper = material.styled('div')(({ theme }) => ({
|
|
8
|
+
width: '100%',
|
|
9
|
+
}));
|
|
10
|
+
const StyledLabel = material.styled(material.InputLabel)(({ theme }) => ({
|
|
11
|
+
fontSize: '0.875rem',
|
|
12
|
+
fontWeight: 500,
|
|
13
|
+
color: theme.palette.dark.main,
|
|
14
|
+
marginBottom: theme.spacing(0.75),
|
|
15
|
+
display: 'block',
|
|
16
|
+
position: 'static',
|
|
17
|
+
transform: 'none',
|
|
18
|
+
'&.Mui-focused': {
|
|
19
|
+
color: theme.palette.dark.main,
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
const StyledTextField = material.styled(material.TextField, {
|
|
23
|
+
shouldForwardProp: (prop) => !['errorMessage'].includes(prop),
|
|
24
|
+
})(({ theme, errorMessage }) => ({
|
|
25
|
+
width: '100%',
|
|
26
|
+
'& .MuiInputBase-root': {
|
|
27
|
+
backgroundColor: theme.palette.light.main,
|
|
28
|
+
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
29
|
+
? parseInt(theme.shape.borderRadius, 10)
|
|
30
|
+
: theme.shape.borderRadius || 4) * 2,
|
|
31
|
+
fontSize: '1rem',
|
|
32
|
+
color: theme.palette.dark.main,
|
|
33
|
+
minWidth: 0,
|
|
34
|
+
padding: theme.spacing(0, 3),
|
|
35
|
+
[theme.breakpoints.up('sm')]: {
|
|
36
|
+
padding: theme.spacing(0, 4),
|
|
37
|
+
},
|
|
38
|
+
'& .MuiInputBase-input': {
|
|
39
|
+
padding: theme.spacing(1, 0),
|
|
40
|
+
[theme.breakpoints.up('sm')]: {
|
|
41
|
+
padding: theme.spacing(1.25, 0),
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
'&:focus-within': {
|
|
45
|
+
outline: `2px solid ${errorMessage ? theme.palette.accent.main : theme.palette.primary.main}`,
|
|
46
|
+
outlineOffset: 0,
|
|
47
|
+
},
|
|
48
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
49
|
+
borderColor: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}33`,
|
|
50
|
+
},
|
|
51
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
52
|
+
borderColor: errorMessage ? theme.palette.accent.main : theme.palette.primary.main,
|
|
53
|
+
},
|
|
54
|
+
'&.Mui-disabled': {
|
|
55
|
+
backgroundColor: `${theme.palette.dark.main}0D`,
|
|
56
|
+
'& .MuiInputBase-input': {
|
|
57
|
+
color: `${theme.palette.dark.main}80`,
|
|
58
|
+
cursor: 'not-allowed',
|
|
59
|
+
},
|
|
60
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
61
|
+
borderColor: `${theme.palette.dark.main}33`,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
'& .MuiFormHelperText-root': {
|
|
66
|
+
marginTop: theme.spacing(0.75),
|
|
67
|
+
fontSize: '0.875rem',
|
|
68
|
+
color: errorMessage ? theme.palette.accent.main : `${theme.palette.dark.main}99`,
|
|
69
|
+
},
|
|
70
|
+
}));
|
|
71
|
+
const Input = ({ error, fullWidth = false, id, label, ...props }) => {
|
|
72
|
+
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
73
|
+
return (jsxRuntime.jsxs(InputWrapper, { sx: { ...(!fullWidth && { width: 'auto' }) }, children: [label && (jsxRuntime.jsx(StyledLabel, { htmlFor: inputId, children: label })), jsxRuntime.jsx(StyledTextField, { id: inputId, error: !!error, helperText: error || props.helperText, errorMessage: error, fullWidth: fullWidth, variant: "outlined", ...props })] }));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
exports.Input = Input;
|
|
77
|
+
//# 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;;"}
|