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,107 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Button as Button$1 } from '@mui/material';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
|
|
5
|
+
const StyledButton = styled(Button$1, {
|
|
6
|
+
shouldForwardProp: (prop) => prop !== 'customVariant' && prop !== 'customSize',
|
|
7
|
+
})(({ theme, customVariant, customSize }) => {
|
|
8
|
+
const currentTheme = theme.palette;
|
|
9
|
+
// Size styles
|
|
10
|
+
const sizeStyles = {
|
|
11
|
+
sm: {
|
|
12
|
+
padding: '6px 12px',
|
|
13
|
+
fontSize: '0.875rem',
|
|
14
|
+
},
|
|
15
|
+
md: {
|
|
16
|
+
padding: '10px 16px',
|
|
17
|
+
fontSize: '1rem',
|
|
18
|
+
},
|
|
19
|
+
lg: {
|
|
20
|
+
padding: '12px 24px',
|
|
21
|
+
fontSize: '1.125rem',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
// Base styles
|
|
25
|
+
const baseStyles = {
|
|
26
|
+
fontWeight: 500,
|
|
27
|
+
borderRadius: '8px',
|
|
28
|
+
textTransform: 'none',
|
|
29
|
+
transition: 'all 0.2s',
|
|
30
|
+
boxShadow: 'none',
|
|
31
|
+
'&:hover': {
|
|
32
|
+
boxShadow: 'none',
|
|
33
|
+
},
|
|
34
|
+
'&.Mui-disabled': {
|
|
35
|
+
opacity: 0.5,
|
|
36
|
+
cursor: 'not-allowed',
|
|
37
|
+
},
|
|
38
|
+
...sizeStyles[customSize],
|
|
39
|
+
};
|
|
40
|
+
// Variant styles
|
|
41
|
+
const variantStyles = {
|
|
42
|
+
primary: {
|
|
43
|
+
backgroundColor: currentTheme.primary.main,
|
|
44
|
+
color: currentTheme.custom?.primaryButtonTextColor || '#FFFFFF',
|
|
45
|
+
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
46
|
+
'&:hover': {
|
|
47
|
+
backgroundColor: currentTheme.primary.main,
|
|
48
|
+
opacity: 0.9,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
secondary: {
|
|
52
|
+
backgroundColor: currentTheme.secondary.main,
|
|
53
|
+
color: currentTheme.dark.main,
|
|
54
|
+
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
55
|
+
'&:hover': {
|
|
56
|
+
backgroundColor: currentTheme.secondary.main,
|
|
57
|
+
opacity: 0.9,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
outline: {
|
|
61
|
+
backgroundColor: currentTheme.light.main,
|
|
62
|
+
border: `2px solid rgba(77, 48, 25, 0.2)`,
|
|
63
|
+
color: currentTheme.dark.main,
|
|
64
|
+
'&:hover': {
|
|
65
|
+
backgroundColor: 'rgba(77, 48, 25, 0.05)',
|
|
66
|
+
borderColor: 'rgba(77, 48, 25, 0.3)',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
'marked-read': {
|
|
70
|
+
backgroundColor: 'rgba(163, 217, 119, 0.1)',
|
|
71
|
+
border: `2px solid ${currentTheme.markedRead.main}`,
|
|
72
|
+
color: currentTheme.dark.main,
|
|
73
|
+
isDisabled: true,
|
|
74
|
+
'&:hover': {
|
|
75
|
+
backgroundColor: 'rgba(163, 217, 119, 0.2)',
|
|
76
|
+
cursor: 'not-allowed',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
'mark-read': {
|
|
80
|
+
backgroundColor: currentTheme.custom?.markAsReadBackgroundColor || currentTheme.accent.main,
|
|
81
|
+
border: `2px solid ${currentTheme.custom?.markAsReadBorderColor || currentTheme.secondary.main}`,
|
|
82
|
+
color: currentTheme.dark.main,
|
|
83
|
+
'&:hover': {
|
|
84
|
+
opacity: 0.9,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
danger: {
|
|
88
|
+
backgroundColor: '#D32F2F', // Material-UI red
|
|
89
|
+
color: '#FFFFFF',
|
|
90
|
+
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
91
|
+
'&:hover': {
|
|
92
|
+
backgroundColor: '#B71C1C',
|
|
93
|
+
opacity: 0.9,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
return {
|
|
98
|
+
...baseStyles,
|
|
99
|
+
...variantStyles[customVariant],
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
const Button = ({ variant = 'primary', size = 'md', children, fullWidth = false, ...props }) => {
|
|
103
|
+
return (jsx(StyledButton, { customVariant: variant, customSize: size, fullWidth: fullWidth, disableRipple: true, ...props, children: children }));
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export { Button };
|
|
107
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../src/components/Button.tsx"],"sourcesContent":["import React from 'react';\nimport { Button as MuiButton, ButtonProps as MuiButtonProps } from '@mui/material';\nimport { styled } from '@mui/material/styles';\n\ninterface CustomButtonProps extends Omit<MuiButtonProps, 'variant' | 'size'> {\n variant?: 'primary' | 'secondary' | 'outline' | 'marked-read' | 'mark-read' | 'danger'; // Add 'danger'\n size?: 'sm' | 'md' | 'lg';\n}\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) => prop !== 'customVariant' && prop !== 'customSize',\n})<{ customVariant: string; customSize: string }>(({ theme, customVariant, customSize }) => {\n const currentTheme = theme.palette;\n\n // Size styles\n const sizeStyles = {\n sm: {\n padding: '6px 12px',\n fontSize: '0.875rem',\n },\n md: {\n padding: '10px 16px',\n fontSize: '1rem',\n },\n lg: {\n padding: '12px 24px',\n fontSize: '1.125rem',\n },\n };\n\n // Base styles\n const baseStyles = {\n fontWeight: 500,\n borderRadius: '8px',\n textTransform: 'none' as const,\n transition: 'all 0.2s',\n boxShadow: 'none',\n '&:hover': {\n boxShadow: 'none',\n },\n '&.Mui-disabled': {\n opacity: 0.5,\n cursor: 'not-allowed',\n },\n ...sizeStyles[customSize as keyof typeof sizeStyles],\n };\n\n // Variant styles\n const variantStyles = {\n primary: {\n backgroundColor: currentTheme.primary.main,\n color: currentTheme.custom?.primaryButtonTextColor || '#FFFFFF',\n boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n '&:hover': {\n backgroundColor: currentTheme.primary.main,\n opacity: 0.9,\n },\n },\n secondary: {\n backgroundColor: currentTheme.secondary.main,\n color: currentTheme.dark.main,\n boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n '&:hover': {\n backgroundColor: currentTheme.secondary.main,\n opacity: 0.9,\n },\n },\n outline: {\n backgroundColor: currentTheme.light.main,\n border: `2px solid rgba(77, 48, 25, 0.2)`,\n color: currentTheme.dark.main,\n '&:hover': {\n backgroundColor: 'rgba(77, 48, 25, 0.05)',\n borderColor: 'rgba(77, 48, 25, 0.3)',\n },\n },\n 'marked-read': {\n backgroundColor: 'rgba(163, 217, 119, 0.1)',\n border: `2px solid ${currentTheme.markedRead.main}`,\n color: currentTheme.dark.main,\n isDisabled: true,\n '&:hover': {\n backgroundColor: 'rgba(163, 217, 119, 0.2)',\n cursor: 'not-allowed',\n },\n },\n 'mark-read': {\n backgroundColor: currentTheme.custom?.markAsReadBackgroundColor || currentTheme.accent.main,\n border: `2px solid ${currentTheme.custom?.markAsReadBorderColor || currentTheme.secondary.main}`,\n color: currentTheme.dark.main,\n '&:hover': {\n opacity: 0.9,\n },\n },\n danger: { // New danger variant\n backgroundColor: '#D32F2F', // Material-UI red\n color: '#FFFFFF',\n boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n '&:hover': {\n backgroundColor: '#B71C1C',\n opacity: 0.9,\n },\n },\n };\n\n return {\n ...baseStyles,\n ...variantStyles[customVariant as keyof typeof variantStyles],\n };\n});\n\nexport const Button: React.FC<CustomButtonProps> = ({\n variant = 'primary',\n size = 'md',\n children,\n fullWidth = false,\n ...props\n}) => {\n\n return (\n <StyledButton\n customVariant={variant}\n customSize={size}\n fullWidth={fullWidth}\n disableRipple\n {...props}\n >\n {children}\n </StyledButton>\n );\n};"],"names":["MuiButton","_jsx"],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
interface CardProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
7
|
+
variant?: 'default' | 'bordered' | 'elevated';
|
|
8
|
+
sx?: SxProps<Theme>;
|
|
9
|
+
}
|
|
10
|
+
export declare const Card: React.FC<CardProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { styled, Box } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
const StyledCard = styled(Box, {
|
|
6
|
+
shouldForwardProp: (prop) => prop !== 'customPadding' && prop !== 'customVariant',
|
|
7
|
+
})(({ theme, customPadding, customVariant }) => {
|
|
8
|
+
const paddingStyles = {
|
|
9
|
+
none: { padding: 0 },
|
|
10
|
+
sm: { padding: theme.spacing(2) }, // 16px
|
|
11
|
+
md: { padding: theme.spacing(3) }, // 24px
|
|
12
|
+
lg: { padding: theme.spacing(4) }, // 32px
|
|
13
|
+
};
|
|
14
|
+
const variantStyles = {
|
|
15
|
+
default: {
|
|
16
|
+
border: `1px solid ${theme.palette.dark.main}10`, // dark.main with 10% opacity
|
|
17
|
+
},
|
|
18
|
+
bordered: {
|
|
19
|
+
border: `2px solid ${theme.palette.dark.main}20`, // dark.main with 20% opacity
|
|
20
|
+
},
|
|
21
|
+
elevated: {
|
|
22
|
+
border: `1px solid ${theme.palette.dark.main}05`, // dark.main with 5% opacity
|
|
23
|
+
boxShadow: theme.shadows[4], // MUI shadow level 4 for "elevated"
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const borderRadiusValue = typeof theme.shape.borderRadius === 'string'
|
|
27
|
+
? parseInt(theme.shape.borderRadius, 10)
|
|
28
|
+
: theme.shape.borderRadius || 4;
|
|
29
|
+
return {
|
|
30
|
+
borderRadius: borderRadiusValue * 2, // Matches rounded-xl (approx 12px)
|
|
31
|
+
overflow: 'visible',
|
|
32
|
+
backgroundColor: theme.palette.light.main, // Matches #FEFDF7
|
|
33
|
+
...paddingStyles[customPadding],
|
|
34
|
+
...variantStyles[customVariant],
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const Card = ({ children, className = '', padding = 'md', variant = 'default', sx, // Destructure sx prop
|
|
38
|
+
}) => {
|
|
39
|
+
return (jsx(StyledCard, { className: className, customPadding: padding, customVariant: variant, sx: sx, children: children }));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { Card };
|
|
43
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -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,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { styled, Box, Checkbox as Checkbox$1, Typography, FormControlLabel } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
const StyledWrapper = styled(Box)(({ theme }) => ({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
alignItems: 'flex-start',
|
|
8
|
+
}));
|
|
9
|
+
const StyledCheckbox = styled(Checkbox$1)(({ theme }) => ({
|
|
10
|
+
width: 16, // Matches Tailwind's w-4 (16px)
|
|
11
|
+
height: 16, // Matches Tailwind's h-4 (16px)
|
|
12
|
+
color: theme.palette.dark.main + '33', // dark.main with 20% opacity (border-dark/20)
|
|
13
|
+
'&.Mui-checked': {
|
|
14
|
+
color: theme.palette.primary.main, // text-primary
|
|
15
|
+
},
|
|
16
|
+
'&:focus': {
|
|
17
|
+
outline: `2px solid ${theme.palette.primary.main}`, // focus:ring-2 focus:ring-primary
|
|
18
|
+
outlineOffset: 2,
|
|
19
|
+
},
|
|
20
|
+
borderRadius: theme.shape.borderRadius, // Matches rounded
|
|
21
|
+
cursor: 'pointer',
|
|
22
|
+
}));
|
|
23
|
+
const StyledLabel = styled(Typography)(({ theme }) => ({
|
|
24
|
+
fontSize: '1rem', // text-base (16px)
|
|
25
|
+
fontWeight: 500, // font-medium
|
|
26
|
+
color: theme.palette.dark.main, // text-dark
|
|
27
|
+
cursor: 'pointer',
|
|
28
|
+
}));
|
|
29
|
+
const StyledDescription = styled(Typography)(({ theme }) => ({
|
|
30
|
+
fontSize: '0.875rem', // text-sm (14px)
|
|
31
|
+
color: theme.palette.dark.main + '99', // dark.main with 60% opacity (text-dark/60)
|
|
32
|
+
marginTop: theme.spacing(0.5), // mt-0.5
|
|
33
|
+
}));
|
|
34
|
+
const Checkbox = ({ label, description, className = '', id, ...props }) => {
|
|
35
|
+
const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
36
|
+
return (jsx(StyledWrapper, { className: className, children: jsx(FormControlLabel, { control: jsx(StyledCheckbox, { id: checkboxId, ...props }), label: jsxs(Box, { sx: { ml: 1.5, display: 'flex', flexDirection: 'column' }, children: [jsx(StyledLabel, { children: label }), description && jsx(StyledDescription, { children: description })] }) }) }));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { Checkbox };
|
|
40
|
+
//# 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,10 @@
|
|
|
1
|
+
interface ConcertinaSection {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
interface ConcertinaProps {
|
|
7
|
+
sections: ConcertinaSection[];
|
|
8
|
+
}
|
|
9
|
+
export declare function Concertina({ sections }: ConcertinaProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { styled, Box, Typography, IconButton, Collapse } from '@mui/material';
|
|
5
|
+
import { ExpandMoreRounded, LinkRounded } from '@mui/icons-material';
|
|
6
|
+
|
|
7
|
+
const StyledConcertina = styled(Box)(({ theme }) => ({
|
|
8
|
+
width: '100%',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
gap: theme.spacing(1), // space-y-2
|
|
12
|
+
}));
|
|
13
|
+
const StyledSection = styled(Box)(({ theme }) => ({
|
|
14
|
+
border: `1px solid ${theme.palette.grey[200]}`, // border-gray-200
|
|
15
|
+
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
16
|
+
? parseInt(theme.shape.borderRadius, 10)
|
|
17
|
+
: theme.shape.borderRadius || 4) * 2, // rounded-lg
|
|
18
|
+
overflow: 'hidden',
|
|
19
|
+
}));
|
|
20
|
+
const StyledHeader = styled(Box)(({ theme }) => ({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
padding: theme.spacing(3), // p-3 sm:p-4 md:p-6
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
transition: 'background-color 0.2s',
|
|
27
|
+
gap: theme.spacing(2), // gap-2
|
|
28
|
+
'&:hover': {
|
|
29
|
+
backgroundColor: theme.palette.light.main, // hover:bg-[#FDFCEE]
|
|
30
|
+
},
|
|
31
|
+
[theme.breakpoints.up('sm')]: {
|
|
32
|
+
padding: theme.spacing(4),
|
|
33
|
+
},
|
|
34
|
+
[theme.breakpoints.up('md')]: {
|
|
35
|
+
padding: theme.spacing(6),
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
38
|
+
const StyledTitleWrapper = styled(Box)(({ theme }) => ({
|
|
39
|
+
display: 'flex',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
gap: theme.spacing(3), // sm:gap-3
|
|
42
|
+
flex: 1,
|
|
43
|
+
minWidth: 0,
|
|
44
|
+
[theme.breakpoints.down('sm')]: {
|
|
45
|
+
gap: theme.spacing(2), // gap-2
|
|
46
|
+
},
|
|
47
|
+
}));
|
|
48
|
+
const StyledTitle = styled(Typography, {
|
|
49
|
+
shouldForwardProp: (prop) => prop !== 'isHovered',
|
|
50
|
+
})(({ theme, isHovered }) => ({
|
|
51
|
+
fontWeight: 700, // font-bold
|
|
52
|
+
fontSize: '1.5rem', // text-2xl
|
|
53
|
+
lineHeight: 1.2, // leading-tight
|
|
54
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
55
|
+
wordBreak: 'break-word', // break-words
|
|
56
|
+
position: 'relative',
|
|
57
|
+
'&:after': {
|
|
58
|
+
content: '""',
|
|
59
|
+
position: 'absolute',
|
|
60
|
+
bottom: 0,
|
|
61
|
+
left: 0,
|
|
62
|
+
width: '100%',
|
|
63
|
+
height: 1,
|
|
64
|
+
backgroundColor: theme.palette.accent.main, // bg-orange-500
|
|
65
|
+
display: isHovered ? 'block' : 'none',
|
|
66
|
+
},
|
|
67
|
+
[theme.breakpoints.down('lg')]: {
|
|
68
|
+
fontSize: '1.25rem', // lg:text-[28px]
|
|
69
|
+
},
|
|
70
|
+
[theme.breakpoints.down('md')]: {
|
|
71
|
+
fontSize: '1.125rem', // md:text-xl
|
|
72
|
+
},
|
|
73
|
+
[theme.breakpoints.down('sm')]: {
|
|
74
|
+
fontSize: '1rem', // sm:text-lg
|
|
75
|
+
},
|
|
76
|
+
}));
|
|
77
|
+
const StyledLinkButton = styled(IconButton)(({ theme }) => ({
|
|
78
|
+
color: theme.palette.accent.main, // text-orange-500
|
|
79
|
+
'&:hover': {
|
|
80
|
+
color: theme.palette.accent.dark || theme.palette.accent.main, // hover:text-orange-600
|
|
81
|
+
},
|
|
82
|
+
padding: 0,
|
|
83
|
+
}));
|
|
84
|
+
const StyledTooltip = styled(Box)(({ theme }) => ({
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
top: -40, // -top-10
|
|
87
|
+
left: '50%',
|
|
88
|
+
transform: 'translateX(-50%)',
|
|
89
|
+
backgroundColor: theme.palette.grey[900], // bg-gray-900
|
|
90
|
+
color: theme.palette.common.white, // text-white
|
|
91
|
+
fontSize: '0.75rem', // text-xs
|
|
92
|
+
padding: theme.spacing(1, 2), // px-2 py-1
|
|
93
|
+
borderRadius: theme.shape.borderRadius, // rounded
|
|
94
|
+
whiteSpace: 'nowrap',
|
|
95
|
+
zIndex: 10,
|
|
96
|
+
[theme.breakpoints.up('sm')]: {
|
|
97
|
+
fontSize: '0.875rem', // sm:text-sm
|
|
98
|
+
padding: theme.spacing(1.5, 3), // sm:px-3 sm:py-1.5
|
|
99
|
+
},
|
|
100
|
+
}));
|
|
101
|
+
const StyledChevron = styled(ExpandMoreRounded)(({ theme }) => ({
|
|
102
|
+
color: theme.palette.grey[500], // text-gray-500
|
|
103
|
+
transition: 'transform 0.2s', // transition-transform duration-200
|
|
104
|
+
width: 24, // sm:w-6
|
|
105
|
+
height: 24, // sm:h-6
|
|
106
|
+
[theme.breakpoints.down('sm')]: {
|
|
107
|
+
width: 20,
|
|
108
|
+
height: 20,
|
|
109
|
+
},
|
|
110
|
+
}));
|
|
111
|
+
const StyledContent = styled(Box)(({ theme }) => ({
|
|
112
|
+
padding: theme.spacing(2, 3, 3), // px-3 pb-3 pt-2
|
|
113
|
+
[theme.breakpoints.up('sm')]: {
|
|
114
|
+
padding: theme.spacing(2, 4, 4), // sm:px-4 sm:pb-4
|
|
115
|
+
},
|
|
116
|
+
[theme.breakpoints.up('md')]: {
|
|
117
|
+
padding: theme.spacing(2, 6, 6), // md:px-6 md:pb-6
|
|
118
|
+
},
|
|
119
|
+
}));
|
|
120
|
+
const StyledContentText = styled(Typography)(({ theme }) => ({
|
|
121
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
122
|
+
lineHeight: 1.5, // leading-relaxed
|
|
123
|
+
wordBreak: 'break-word', // break-words
|
|
124
|
+
fontSize: 13, // style={{ fontSize: '13px' }}
|
|
125
|
+
}));
|
|
126
|
+
function Concertina({ sections }) {
|
|
127
|
+
const [openSections, setOpenSections] = useState(new Set());
|
|
128
|
+
const [hoveredTitle, setHoveredTitle] = useState(null);
|
|
129
|
+
const [copiedId, setCopiedId] = useState(null);
|
|
130
|
+
const toggleSection = (id) => {
|
|
131
|
+
const newOpenSections = new Set(openSections);
|
|
132
|
+
if (newOpenSections.has(id)) {
|
|
133
|
+
newOpenSections.delete(id);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
newOpenSections.add(id);
|
|
137
|
+
}
|
|
138
|
+
setOpenSections(newOpenSections);
|
|
139
|
+
};
|
|
140
|
+
const copyJumpLink = (id, e) => {
|
|
141
|
+
e.stopPropagation();
|
|
142
|
+
const url = `${window.location.origin}${window.location.pathname}#${id}`;
|
|
143
|
+
navigator.clipboard.writeText(url);
|
|
144
|
+
setCopiedId(id);
|
|
145
|
+
setTimeout(() => setCopiedId(null), 2000);
|
|
146
|
+
};
|
|
147
|
+
return (jsx(StyledConcertina, { children: sections.map((section) => (jsxs(StyledSection, { id: section.id, children: [jsxs(StyledHeader, { onClick: () => toggleSection(section.id), onMouseEnter: () => setHoveredTitle(section.id), onMouseLeave: () => setHoveredTitle(null), children: [jsxs(StyledTitleWrapper, { children: [jsx(StyledTitle, { isHovered: hoveredTitle === section.id, variant: "h3", children: section.title }), hoveredTitle === section.id && (jsxs(Box, { sx: { position: 'relative', flexShrink: 0 }, children: [jsx(StyledLinkButton, { onClick: (e) => copyJumpLink(section.id, e), "aria-label": "Copy link", children: jsx(LinkRounded, { sx: { fontSize: 20 } }) }), copiedId === section.id && (jsx(StyledTooltip, { children: "Link copied" }))] }))] }), jsx(StyledChevron, { sx: { fontSize: 20, transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' } })] }), jsx(Collapse, { in: openSections.has(section.id), children: jsx(StyledContent, { children: jsx(StyledContentText, { children: section.content }) }) })] }, section.id))) }));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export { Concertina };
|
|
151
|
+
//# 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,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface DefinitionBoxProps {
|
|
3
|
+
term: string;
|
|
4
|
+
definition: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function DefinitionBox({ term, definition, children }: DefinitionBoxProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { styled, Box, Typography } from '@mui/material';
|
|
5
|
+
import { useTheme } from '../ThemeProvider.js';
|
|
6
|
+
import { CloseRounded, AddRounded } from '@mui/icons-material';
|
|
7
|
+
|
|
8
|
+
const StyledWrapper = styled(Box)(({ theme }) => ({
|
|
9
|
+
// No specific wrapper styles needed, just a container
|
|
10
|
+
}));
|
|
11
|
+
const StyledParagraph = styled(Typography)(({ theme }) => ({
|
|
12
|
+
fontSize: '14px', // text-[14px]
|
|
13
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
14
|
+
display: 'inline-flex',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
}));
|
|
17
|
+
const StyledTermWrapper = styled(Box)(({ theme }) => ({
|
|
18
|
+
position: 'relative',
|
|
19
|
+
display: 'inline-flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
cursor: 'pointer',
|
|
22
|
+
marginLeft: theme.spacing(0.5), // ml-1
|
|
23
|
+
}));
|
|
24
|
+
const StyledTerm = styled('span', {
|
|
25
|
+
shouldForwardProp: (prop) => prop !== 'isOpen',
|
|
26
|
+
})(({ theme, isOpen }) => ({
|
|
27
|
+
paddingBottom: '1px', // style={{ paddingBottom: '1px' }}
|
|
28
|
+
borderBottom: `2px solid ${isOpen ? theme.palette.secondary.main : theme.palette.dark.main}`, // border-b-2
|
|
29
|
+
transition: 'border-bottom-color 0.2s', // transition-colors
|
|
30
|
+
'&:hover': {
|
|
31
|
+
borderBottomColor: theme.palette.secondary.main, // hover effect
|
|
32
|
+
},
|
|
33
|
+
}));
|
|
34
|
+
const StyledIconWrapper = styled(Box)(({ theme }) => ({
|
|
35
|
+
display: 'inline-flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
marginLeft: theme.spacing(0.5), // ml-1
|
|
39
|
+
transition: 'color 0.2s', // transition-colors
|
|
40
|
+
}));
|
|
41
|
+
const StyledDefinitionBox = styled(Box)(({ theme }) => ({
|
|
42
|
+
marginTop: theme.spacing(2), // mt-4
|
|
43
|
+
padding: theme.spacing(2), // p-4
|
|
44
|
+
borderRadius: (typeof theme.shape.borderRadius === 'string'
|
|
45
|
+
? parseInt(theme.shape.borderRadius, 10)
|
|
46
|
+
: theme.shape.borderRadius || 4) * 2, // rounded-lg
|
|
47
|
+
border: `1px solid ${theme.palette.dark.main}33`, // border-[#4D3019]/20
|
|
48
|
+
borderRight: `4px solid ${theme.palette.dark.main}33`, // border-r-4
|
|
49
|
+
backgroundColor: theme.palette.light.main, // style={{ backgroundColor: '#FDFCEE' }}
|
|
50
|
+
}));
|
|
51
|
+
const StyledDefinitionText = styled(Typography)(({ theme }) => ({
|
|
52
|
+
fontSize: '14px', // text-[14px]
|
|
53
|
+
color: theme.palette.dark.main, // text-[#4D3019]
|
|
54
|
+
lineHeight: 1.5, // leading-relaxed
|
|
55
|
+
}));
|
|
56
|
+
function DefinitionBox({ term, definition, children }) {
|
|
57
|
+
const { theme } = useTheme();
|
|
58
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
59
|
+
return (jsxs(StyledWrapper, { children: [jsxs(StyledParagraph, { children: [children, jsxs(StyledTermWrapper, { onClick: () => setIsOpen(!isOpen), children: [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 }), jsx(StyledIconWrapper, { children: isOpen ? (jsx(CloseRounded, { sx: {
|
|
60
|
+
fontSize: 16,
|
|
61
|
+
color: isOpen ? theme.palette.secondary.main : theme.palette.dark.main,
|
|
62
|
+
'&:hover': {
|
|
63
|
+
color: theme.palette.secondary.main
|
|
64
|
+
}
|
|
65
|
+
} })) : (jsx(AddRounded, { sx: {
|
|
66
|
+
fontSize: 16,
|
|
67
|
+
color: theme.palette.dark.main,
|
|
68
|
+
'&:hover': {
|
|
69
|
+
color: theme.palette.secondary.main
|
|
70
|
+
}
|
|
71
|
+
} })) })] })] }), isOpen && (jsx(StyledDefinitionBox, { children: jsx(StyledDefinitionText, { children: definition }) }))] }));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { DefinitionBox };
|
|
75
|
+
//# 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;;"}
|