ece-docs-components 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ThemeProvider.js +75 -6
- package/dist/cjs/ThemeProvider.js.map +1 -1
- package/dist/cjs/components/Alert.js +1 -1
- package/dist/cjs/components/Alert.js.map +1 -1
- package/dist/cjs/components/Concertina.js +82 -64
- package/dist/cjs/components/Concertina.js.map +1 -1
- package/dist/cjs/components/Input.js +4 -4
- package/dist/cjs/components/Input.js.map +1 -1
- package/dist/cjs/components/Modal.js +39 -15
- package/dist/cjs/components/Modal.js.map +1 -1
- package/dist/cjs/components/NoteBox.js +19 -17
- package/dist/cjs/components/NoteBox.js.map +1 -1
- package/dist/cjs/components/TableOfContents.js +11 -3
- package/dist/cjs/components/TableOfContents.js.map +1 -1
- package/dist/esm/ThemeProvider.js +75 -6
- package/dist/esm/ThemeProvider.js.map +1 -1
- package/dist/esm/components/Alert.js +1 -1
- package/dist/esm/components/Alert.js.map +1 -1
- package/dist/esm/components/Concertina.d.ts +2 -1
- package/dist/esm/components/Concertina.js +85 -67
- package/dist/esm/components/Concertina.js.map +1 -1
- package/dist/esm/components/Input.js +4 -4
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/Modal.js +41 -17
- package/dist/esm/components/Modal.js.map +1 -1
- package/dist/esm/components/NoteBox.js +19 -17
- package/dist/esm/components/NoteBox.js.map +1 -1
- package/dist/esm/components/TableOfContents.d.ts +1 -0
- package/dist/esm/components/TableOfContents.js +12 -4
- package/dist/esm/components/TableOfContents.js.map +1 -1
- package/package.json +1 -1
|
@@ -78,45 +78,84 @@ const theme = styles.createTheme({
|
|
|
78
78
|
fontFamily: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'].join(','),
|
|
79
79
|
h1: {
|
|
80
80
|
color: '#4D3019',
|
|
81
|
+
fontWeight: 700,
|
|
82
|
+
fontSize: '2.5rem',
|
|
83
|
+
lineHeight: 1.2,
|
|
81
84
|
},
|
|
82
85
|
h2: {
|
|
83
86
|
color: '#4D3019',
|
|
87
|
+
fontWeight: 700,
|
|
88
|
+
fontSize: '2rem',
|
|
89
|
+
lineHeight: 1.3,
|
|
84
90
|
},
|
|
85
91
|
h3: {
|
|
86
92
|
color: '#4D3019',
|
|
93
|
+
fontWeight: 600,
|
|
94
|
+
fontSize: '1.75rem',
|
|
95
|
+
lineHeight: 1.3,
|
|
87
96
|
},
|
|
88
97
|
h4: {
|
|
89
98
|
color: '#4D3019',
|
|
99
|
+
fontWeight: 600,
|
|
100
|
+
fontSize: '1.5rem',
|
|
101
|
+
lineHeight: 1.4,
|
|
90
102
|
},
|
|
91
103
|
h5: {
|
|
92
104
|
color: '#4D3019',
|
|
105
|
+
fontWeight: 600,
|
|
106
|
+
fontSize: '1.25rem',
|
|
107
|
+
lineHeight: 1.4,
|
|
93
108
|
},
|
|
94
109
|
h6: {
|
|
95
110
|
color: '#4D3019',
|
|
111
|
+
fontWeight: 600,
|
|
112
|
+
fontSize: '1rem',
|
|
113
|
+
lineHeight: 1.4,
|
|
96
114
|
},
|
|
97
115
|
body1: {
|
|
98
116
|
color: '#4D3019',
|
|
117
|
+
fontWeight: 400,
|
|
118
|
+
fontSize: '1rem',
|
|
119
|
+
lineHeight: 1.5,
|
|
99
120
|
},
|
|
100
121
|
body2: {
|
|
101
122
|
color: '#826E5C',
|
|
123
|
+
fontWeight: 400,
|
|
124
|
+
fontSize: '0.875rem',
|
|
125
|
+
lineHeight: 1.5,
|
|
102
126
|
},
|
|
103
127
|
subtitle1: {
|
|
104
128
|
color: '#4D3019',
|
|
129
|
+
fontWeight: 500,
|
|
130
|
+
fontSize: '1rem',
|
|
131
|
+
lineHeight: 1.5,
|
|
105
132
|
},
|
|
106
133
|
subtitle2: {
|
|
107
134
|
color: '#826E5C',
|
|
135
|
+
fontWeight: 500,
|
|
136
|
+
fontSize: '0.875rem',
|
|
137
|
+
lineHeight: 1.5,
|
|
108
138
|
},
|
|
109
139
|
button: {
|
|
110
140
|
color: '#4D3019',
|
|
141
|
+
fontWeight: 500,
|
|
142
|
+
fontSize: '0.875rem',
|
|
143
|
+
lineHeight: 1.75,
|
|
144
|
+
textTransform: 'none',
|
|
111
145
|
},
|
|
112
146
|
caption: {
|
|
113
147
|
color: '#826E5C',
|
|
148
|
+
fontWeight: 400,
|
|
149
|
+
fontSize: '0.75rem',
|
|
150
|
+
lineHeight: 1.66,
|
|
114
151
|
},
|
|
115
152
|
overline: {
|
|
116
153
|
color: '#826E5C',
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
154
|
+
fontWeight: 500,
|
|
155
|
+
fontSize: '0.75rem',
|
|
156
|
+
lineHeight: 2.66,
|
|
157
|
+
textTransform: 'uppercase',
|
|
158
|
+
letterSpacing: '0.08em',
|
|
120
159
|
},
|
|
121
160
|
},
|
|
122
161
|
shape: {
|
|
@@ -133,9 +172,18 @@ const theme = styles.createTheme({
|
|
|
133
172
|
},
|
|
134
173
|
components: {
|
|
135
174
|
MuiTypography: {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
175
|
+
defaultProps: {
|
|
176
|
+
variantMapping: {
|
|
177
|
+
h1: 'h1',
|
|
178
|
+
h2: 'h2',
|
|
179
|
+
h3: 'h3',
|
|
180
|
+
h4: 'h4',
|
|
181
|
+
h5: 'h5',
|
|
182
|
+
h6: 'h6',
|
|
183
|
+
subtitle1: 'p',
|
|
184
|
+
subtitle2: 'p',
|
|
185
|
+
body1: 'p',
|
|
186
|
+
body2: 'p',
|
|
139
187
|
},
|
|
140
188
|
},
|
|
141
189
|
},
|
|
@@ -150,6 +198,27 @@ const theme = styles.createTheme({
|
|
|
150
198
|
'input[type="checkbox"], input[type="radio"]': {
|
|
151
199
|
accentColor: '#D79AFC',
|
|
152
200
|
},
|
|
201
|
+
'h1, h2, h3, h4, h5, h6': {
|
|
202
|
+
fontWeight: 'inherit !important',
|
|
203
|
+
},
|
|
204
|
+
'.MuiTypography-h1': {
|
|
205
|
+
fontWeight: '700 !important',
|
|
206
|
+
},
|
|
207
|
+
'.MuiTypography-h2': {
|
|
208
|
+
fontWeight: '700 !important',
|
|
209
|
+
},
|
|
210
|
+
'.MuiTypography-h3': {
|
|
211
|
+
fontWeight: '600 !important',
|
|
212
|
+
},
|
|
213
|
+
'.MuiTypography-h4': {
|
|
214
|
+
fontWeight: '600 !important',
|
|
215
|
+
},
|
|
216
|
+
'.MuiTypography-h5': {
|
|
217
|
+
fontWeight: '600 !important',
|
|
218
|
+
},
|
|
219
|
+
'.MuiTypography-h6': {
|
|
220
|
+
fontWeight: '600 !important',
|
|
221
|
+
},
|
|
153
222
|
},
|
|
154
223
|
},
|
|
155
224
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sources":["../../../src/ThemeProvider.tsx"],"sourcesContent":["import { createTheme, ThemeProvider as MuiThemeProvider } from '@mui/material/styles';\r\nimport { CssBaseline } from '@mui/material';\r\nimport * as React from 'react';\r\nimport './theme-types';\r\n\r\nconst theme = createTheme({\r\n palette: {\r\n mode: 'light',\r\n primary: {\r\n main: '#AD46FF',\r\n light: '#AD46FF',\r\n dark: '#AD46FF',\r\n contrastText: '#FFFFFF',\r\n },\r\n secondary: {\r\n main: '#D79AFC',\r\n light: '#D79AFC',\r\n dark: '#D79AFC',\r\n contrastText: '#FFFFFF',\r\n },\r\n error: {\r\n main: '#F56B6B',\r\n light: '#F56B6B',\r\n dark: '#F56B6B',\r\n contrastText: '#FFFFFF',\r\n },\r\n warning: {\r\n main: '#F5D76E',\r\n light: '#F5D76E',\r\n dark: '#F5D76E',\r\n contrastText: '#FFFBFF',\r\n },\r\n info: {\r\n main: '#F5A623',\r\n light: '#F5A623',\r\n dark: '#F5A623',\r\n contrastText: '#FFFFFF',\r\n },\r\n success: {\r\n main: '#A3D977',\r\n light: '#A3D977',\r\n dark: '#A3D977',\r\n contrastText: '#FFFFFF',\r\n },\r\n background: {\r\n default: '#FDFCEE',\r\n paper: '#FEFDF7',\r\n },\r\n text: {\r\n primary: '#4D3019',\r\n secondary: '#826E5C',\r\n disabled: '#93908F',\r\n },\r\n divider: '#C6C7C0',\r\n accent: {\r\n main: '#FFEDD1',\r\n },\r\n dark: {\r\n main: '#4D3019',\r\n },\r\n light: {\r\n main: '#FEFDF7',\r\n },\r\n markedRead: {\r\n main: '#A3D977',\r\n },\r\n custom: {\r\n iconColor: '#ebc7ff',\r\n primaryButtonTextColor: '#FFFFFF',\r\n readByBackgroundColor: '#ebc7ff',\r\n stepIndicatorTextColor: '#FFFFFF',\r\n markAsReadBackgroundColor: '#ebc7ff',\r\n tabBackgroundColor: '#F8F0FC',\r\n },\r\n },\r\n typography: {\r\n fontFamily: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'].join(','),\r\n h1: {\r\n color: '#4D3019',\r\n },\r\n h2: {\r\n color: '#4D3019',\r\n },\r\n h3: {\r\n color: '#4D3019',\r\n },\r\n h4: {\r\n color: '#4D3019',\r\n },\r\n h5: {\r\n color: '#4D3019',\r\n },\r\n h6: {\r\n color: '#4D3019',\r\n },\r\n body1: {\r\n color: '#4D3019',\r\n },\r\n body2: {\r\n color: '#826E5C',\r\n },\r\n subtitle1: {\r\n color: '#4D3019',\r\n },\r\n subtitle2: {\r\n color: '#826E5C',\r\n },\r\n button: {\r\n color: '#4D3019',\r\n },\r\n caption: {\r\n color: '#826E5C',\r\n },\r\n overline: {\r\n color: '#826E5C',\r\n },\r\n allVariants: {\r\n color: '#4D3019',\r\n },\r\n },\r\n shape: {\r\n borderRadius: 8,\r\n },\r\n breakpoints: {\r\n values: {\r\n xs: 320,\r\n sm: 640,\r\n md: 768,\r\n lg: 1024,\r\n xl: 1280,\r\n },\r\n },\r\n components: {\r\n MuiTypography: {\r\n styleOverrides: {\r\n root: {\r\n color: '#4D3019',\r\n },\r\n },\r\n },\r\n MuiCssBaseline: {\r\n styleOverrides: {\r\n body: {\r\n WebkitFontSmoothing: 'antialiased',\r\n MozOsxFontSmoothing: 'grayscale',\r\n backgroundColor: '#FDFCEE',\r\n color: '#4D3019',\r\n },\r\n 'input[type=\"checkbox\"], input[type=\"radio\"]': {\r\n accentColor: '#D79AFC',\r\n },\r\n },\r\n },\r\n },\r\n appName: 'ECE Docs',\r\n});\r\n\r\nexport const ThemeProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {\r\n return (\r\n <MuiThemeProvider theme={theme}>\r\n <CssBaseline />\r\n {children}\r\n </MuiThemeProvider>\r\n );\r\n};\r\n\r\nexport const useTheme = () => {\r\n return theme;\r\n};\r\n"],"names":["createTheme","_jsxs","MuiThemeProvider","_jsx","CssBaseline"],"mappings":";;;;;;AAKA,MAAM,KAAK,GAAGA,kBAAW,CAAC;AACxB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,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ACF,aAAA;AACF,SAAA;AACD,QAAA,cAAc,EAAE;AACd,YAAA,cAAc,EAAE;AACd,gBAAA,IAAI,EAAE;AACJ,oBAAA,mBAAmB,EAAE,aAAa;AAClC,oBAAA,mBAAmB,EAAE,WAAW;AAChC,oBAAA,eAAe,EAAE,SAAS;AAC1B,oBAAA,KAAK,EAAE,SAAS;AACjB,iBAAA;AACD,gBAAA,6CAA6C,EAAE;AAC7C,oBAAA,WAAW,EAAE,SAAS;AACvB,iBAAA;AACF,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,OAAO,EAAE,UAAU;AACpB,CAAA,CAAC;MAEW,aAAa,GAA4C,CAAC,EAAE,QAAQ,EAAE,KAAI;AACrF,IAAA,QACEC,eAAA,CAACC,oBAAgB,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,QAAA,EAAA,CAC5BC,cAAA,CAACC,oBAAW,EAAA,EAAA,CAAG,EACd,QAAQ,CAAA,EAAA,CACQ;AAEvB;AAEO,MAAM,QAAQ,GAAG,MAAK;AAC3B,IAAA,OAAO,KAAK;AACd;;;;;"}
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sources":["../../../src/ThemeProvider.tsx"],"sourcesContent":["import { createTheme, ThemeProvider as MuiThemeProvider } from '@mui/material/styles';\r\nimport { CssBaseline } from '@mui/material';\r\nimport * as React from 'react';\r\nimport './theme-types';\r\n\r\n\r\nconst theme = createTheme({\r\n palette: {\r\n mode: 'light',\r\n primary: {\r\n main: '#AD46FF',\r\n light: '#AD46FF',\r\n dark: '#AD46FF',\r\n contrastText: '#FFFFFF',\r\n },\r\n secondary: {\r\n main: '#D79AFC',\r\n light: '#D79AFC',\r\n dark: '#D79AFC',\r\n contrastText: '#FFFFFF',\r\n },\r\n error: {\r\n main: '#F56B6B',\r\n light: '#F56B6B',\r\n dark: '#F56B6B',\r\n contrastText: '#FFFFFF',\r\n },\r\n warning: {\r\n main: '#F5D76E',\r\n light: '#F5D76E',\r\n dark: '#F5D76E',\r\n contrastText: '#FFFBFF',\r\n },\r\n info: {\r\n main: '#F5A623',\r\n light: '#F5A623',\r\n dark: '#F5A623',\r\n contrastText: '#FFFFFF',\r\n },\r\n success: {\r\n main: '#A3D977',\r\n light: '#A3D977',\r\n dark: '#A3D977',\r\n contrastText: '#FFFFFF',\r\n },\r\n background: {\r\n default: '#FDFCEE',\r\n paper: '#FEFDF7',\r\n },\r\n text: {\r\n primary: '#4D3019',\r\n secondary: '#826E5C',\r\n disabled: '#93908F',\r\n },\r\n divider: '#C6C7C0',\r\n accent: {\r\n main: '#FFEDD1',\r\n },\r\n dark: {\r\n main: '#4D3019',\r\n },\r\n light: {\r\n main: '#FEFDF7',\r\n },\r\n markedRead: {\r\n main: '#A3D977',\r\n },\r\n custom: {\r\n iconColor: '#ebc7ff',\r\n primaryButtonTextColor: '#FFFFFF',\r\n readByBackgroundColor: '#ebc7ff',\r\n stepIndicatorTextColor: '#FFFFFF',\r\n markAsReadBackgroundColor: '#ebc7ff',\r\n tabBackgroundColor: '#F8F0FC',\r\n },\r\n },\r\n typography: {\r\n fontFamily: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'].join(','),\r\n h1: {\r\n color: '#4D3019',\r\n fontWeight: 700,\r\n fontSize: '2.5rem',\r\n lineHeight: 1.2,\r\n },\r\n h2: {\r\n color: '#4D3019',\r\n fontWeight: 700,\r\n fontSize: '2rem',\r\n lineHeight: 1.3,\r\n },\r\n h3: {\r\n color: '#4D3019',\r\n fontWeight: 600,\r\n fontSize: '1.75rem',\r\n lineHeight: 1.3,\r\n },\r\n h4: {\r\n color: '#4D3019',\r\n fontWeight: 600,\r\n fontSize: '1.5rem',\r\n lineHeight: 1.4,\r\n },\r\n h5: {\r\n color: '#4D3019',\r\n fontWeight: 600,\r\n fontSize: '1.25rem',\r\n lineHeight: 1.4,\r\n },\r\n h6: {\r\n color: '#4D3019',\r\n fontWeight: 600,\r\n fontSize: '1rem',\r\n lineHeight: 1.4,\r\n },\r\n body1: {\r\n color: '#4D3019',\r\n fontWeight: 400,\r\n fontSize: '1rem',\r\n lineHeight: 1.5,\r\n },\r\n body2: {\r\n color: '#826E5C',\r\n fontWeight: 400,\r\n fontSize: '0.875rem',\r\n lineHeight: 1.5,\r\n },\r\n subtitle1: {\r\n color: '#4D3019',\r\n fontWeight: 500,\r\n fontSize: '1rem',\r\n lineHeight: 1.5,\r\n },\r\n subtitle2: {\r\n color: '#826E5C',\r\n fontWeight: 500,\r\n fontSize: '0.875rem',\r\n lineHeight: 1.5,\r\n },\r\n button: {\r\n color: '#4D3019',\r\n fontWeight: 500,\r\n fontSize: '0.875rem',\r\n lineHeight: 1.75,\r\n textTransform: 'none',\r\n },\r\n caption: {\r\n color: '#826E5C',\r\n fontWeight: 400,\r\n fontSize: '0.75rem',\r\n lineHeight: 1.66,\r\n },\r\n overline: {\r\n color: '#826E5C',\r\n fontWeight: 500,\r\n fontSize: '0.75rem',\r\n lineHeight: 2.66,\r\n textTransform: 'uppercase',\r\n letterSpacing: '0.08em',\r\n },\r\n },\r\n shape: {\r\n borderRadius: 8,\r\n },\r\n breakpoints: {\r\n values: {\r\n xs: 320,\r\n sm: 640,\r\n md: 768,\r\n lg: 1024,\r\n xl: 1280,\r\n },\r\n },\r\n components: {\r\n MuiTypography: {\r\n defaultProps: {\r\n variantMapping: {\r\n h1: 'h1',\r\n h2: 'h2',\r\n h3: 'h3',\r\n h4: 'h4',\r\n h5: 'h5',\r\n h6: 'h6',\r\n subtitle1: 'p',\r\n subtitle2: 'p',\r\n body1: 'p',\r\n body2: 'p',\r\n },\r\n },\r\n },\r\n MuiCssBaseline: {\r\n styleOverrides: {\r\n body: {\r\n WebkitFontSmoothing: 'antialiased',\r\n MozOsxFontSmoothing: 'grayscale',\r\n backgroundColor: '#FDFCEE',\r\n color: '#4D3019',\r\n },\r\n 'input[type=\"checkbox\"], input[type=\"radio\"]': {\r\n accentColor: '#D79AFC',\r\n },\r\n 'h1, h2, h3, h4, h5, h6': {\r\n fontWeight: 'inherit !important',\r\n },\r\n '.MuiTypography-h1': {\r\n fontWeight: '700 !important',\r\n },\r\n '.MuiTypography-h2': {\r\n fontWeight: '700 !important',\r\n },\r\n '.MuiTypography-h3': {\r\n fontWeight: '600 !important',\r\n },\r\n '.MuiTypography-h4': {\r\n fontWeight: '600 !important',\r\n },\r\n '.MuiTypography-h5': {\r\n fontWeight: '600 !important',\r\n },\r\n '.MuiTypography-h6': {\r\n fontWeight: '600 !important',\r\n },\r\n },\r\n },\r\n },\r\n appName: 'ECE Docs',\r\n});\r\n\r\n\r\nexport const ThemeProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {\r\n return (\r\n <MuiThemeProvider theme={theme}>\r\n <CssBaseline />\r\n {children}\r\n </MuiThemeProvider>\r\n );\r\n};\r\n\r\n\r\nexport const useTheme = () => {\r\n return theme;\r\n};\r\n"],"names":["createTheme","_jsxs","MuiThemeProvider","_jsx","CssBaseline"],"mappings":";;;;;;AAMA,MAAM,KAAK,GAAGA,kBAAW,CAAC;AACxB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,YAAY,EAAE,SAAS;AACxB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,SAAS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KAAA;AACD,IAAA,OAAO,EAAE,UAAU;AACpB,CAAA,CAAC;MAGW,aAAa,GAA4C,CAAC,EAAE,QAAQ,EAAE,KAAI;AACrF,IAAA,QACEC,eAAA,CAACC,oBAAgB,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,QAAA,EAAA,CAC5BC,cAAA,CAACC,oBAAW,EAAA,EAAA,CAAG,EACd,QAAQ,CAAA,EAAA,CACQ;AAEvB;AAGO,MAAM,QAAQ,GAAG,MAAK;AAC3B,IAAA,OAAO,KAAK;AACd;;;;;"}
|
|
@@ -58,7 +58,7 @@ const StyledAlert = material.styled(material.Alert)(({ theme, customvariant }) =
|
|
|
58
58
|
});
|
|
59
59
|
const Alert = ({ variant = 'info', children, className = '', icon = true, sx, }) => {
|
|
60
60
|
const iconMap = {
|
|
61
|
-
info: jsxRuntime.jsx(iconsMaterial.InfoOutlineRounded, { sx: { fontSize: 20 } }),
|
|
61
|
+
info: jsxRuntime.jsx(iconsMaterial.InfoOutlineRounded, { sx: { fontSize: 20, color: '#1e3a8a' } }),
|
|
62
62
|
success: jsxRuntime.jsx(iconsMaterial.TaskAltRounded, { sx: { fontSize: 20 } }),
|
|
63
63
|
warning: jsxRuntime.jsx(iconsMaterial.ErrorOutlineRounded, { sx: { fontSize: 20 } }),
|
|
64
64
|
error: jsxRuntime.jsx(iconsMaterial.HighlightOffRounded, { sx: { fontSize: 20 } }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alert.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { Alert as MuiAlert, AlertProps as MuiAlertProps, styled, SxProps, Theme } from '@mui/material';\nimport InfoOutlineIcon from '@mui/icons-material/InfoOutline';\nimport { ErrorOutlineRounded, HighlightOffRounded, InfoOutlineRounded, TaskAltRounded } from '@mui/icons-material';\n\ninterface AlertProps {\n variant?: 'info' | 'success' | 'warning' | 'error' | 'custom';\n children: React.ReactNode;\n className?: string;\n icon?: boolean;\n sx?: SxProps<Theme>; \n}\n\nconst StyledAlert = styled(MuiAlert)<{ customvariant?: string }>(({ theme, customvariant }) => {\n const variants = {\n info: {\n backgroundColor: '#eff6ff',\n borderColor: '#bfdbfe',\n color: '#1e3a8a',\n },\n success: {\n backgroundColor: '#f0fdf4',\n borderColor: '#bbf7d0',\n color: '#14532d',\n },\n warning: {\n backgroundColor: '#fefce8',\n borderColor: '#fef08a',\n color: '#713f12',\n },\n error: {\n backgroundColor: '#fef2f2',\n borderColor: '#fecaca',\n color: '#7f1d1d',\n },\n custom: {\n backgroundColor: theme.palette.light.main,\n borderColor: `${theme.palette.dark.main}33`,\n color: theme.palette.dark.main,\n },\n };\n\n const variantKey = customvariant as keyof typeof variants || 'info';\n const style = variants[variantKey];\n\n return {\n display: 'flex',\n alignItems: 'flex-start',\n gap: theme.spacing(1.5),\n padding: theme.spacing(2),\n border: `1px solid ${style.borderColor}`,\n borderRadius: (typeof theme.shape.borderRadius === 'string'\n ? parseInt(theme.shape.borderRadius, 10)\n : theme.shape.borderRadius || 4) * 2,\n backgroundColor: style.backgroundColor,\n color: style.color,\n '& .MuiAlert-icon': {\n marginRight: 0,\n padding: 0,\n marginTop: '2px',\n },\n '& .MuiAlert-message': {\n padding: 0,\n flex: 1,\n },\n };\n});\n\nexport const Alert: React.FC<AlertProps> = ({\n variant = 'info',\n children,\n className = '',\n icon = true,\n sx,\n}) => {\n const iconMap = {\n info: <InfoOutlineRounded sx={{fontSize: 20}} />,\n success: <TaskAltRounded sx={{fontSize: 20}} />,\n warning: <ErrorOutlineRounded sx={{fontSize: 20}} />,\n error: <HighlightOffRounded sx={{fontSize: 20}} />,\n custom: <InfoOutlineRounded sx={{fontSize: 20}} />,\n };\n\n const severityMap: Record<string, MuiAlertProps['severity']> = {\n info: 'info',\n success: 'success',\n warning: 'warning',\n error: 'error',\n custom: 'info',\n };\n\n return (\n <StyledAlert\n customvariant={variant}\n severity={severityMap[variant]}\n icon={icon ? iconMap[variant] : false}\n className={className}\n sx={sx}\n >\n {children}\n </StyledAlert>\n );\n};"],"names":["styled","MuiAlert","_jsx","InfoOutlineRounded","TaskAltRounded","ErrorOutlineRounded","HighlightOffRounded"],"mappings":";;;;;;AAeA,MAAM,WAAW,GAAGA,eAAM,CAACC,cAAQ,CAAC,CAA6B,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAI;AAC5F,IAAA,MAAM,QAAQ,GAAG;AACf,QAAA,IAAI,EAAE;AACJ,YAAA,eAAe,EAAE,SAAS;AAC1B,YAAA,WAAW,EAAE,SAAS;AACtB,YAAA,KAAK,EAAE,SAAS;AACjB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,eAAe,EAAE,SAAS;AAC1B,YAAA,WAAW,EAAE,SAAS;AACtB,YAAA,KAAK,EAAE,SAAS;AACjB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,eAAe,EAAE,SAAS;AAC1B,YAAA,WAAW,EAAE,SAAS;AACtB,YAAA,KAAK,EAAE,SAAS;AACjB,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,eAAe,EAAE,SAAS;AAC1B,YAAA,WAAW,EAAE,SAAS;AACtB,YAAA,KAAK,EAAE,SAAS;AACjB,SAAA;AACD,QAAA,MAAM,EAAE;AACN,YAAA,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI;YACzC,WAAW,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,EAAA,CAAI;AAC3C,YAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;AAC/B,SAAA;KACF;AAED,IAAA,MAAM,UAAU,GAAG,aAAsC,IAAI,MAAM;AACnE,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC;IAElC,OAAO;AACL,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,UAAU,EAAE,YAAY;AACxB,QAAA,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACzB,QAAA,MAAM,EAAE,CAAA,UAAA,EAAa,KAAK,CAAC,WAAW,CAAA,CAAE;QACxC,YAAY,EAAE,CAAC,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,KAAK;cACnD,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE;cACrC,KAAK,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC;QAClC,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,KAAK,EAAE,KAAK,CAAC,KAAK;AAClB,QAAA,kBAAkB,EAAE;AAClB,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,SAAS,EAAE,KAAK;AACjB,SAAA;AACD,QAAA,qBAAqB,EAAE;AACrB,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,IAAI,EAAE,CAAC;AACR,SAAA;KACF;AACH,CAAC,CAAC;MAEW,KAAK,GAAyB,CAAC,EAC1C,OAAO,GAAG,MAAM,EAChB,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,IAAI,GAAG,IAAI,EACX,EAAE,GACH,KAAI;AACH,IAAA,MAAM,OAAO,GAAG;
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alert.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { Alert as MuiAlert, AlertProps as MuiAlertProps, styled, SxProps, Theme } from '@mui/material';\nimport InfoOutlineIcon from '@mui/icons-material/InfoOutline';\nimport { ErrorOutlineRounded, HighlightOffRounded, InfoOutlineRounded, TaskAltRounded } from '@mui/icons-material';\n\ninterface AlertProps {\n variant?: 'info' | 'success' | 'warning' | 'error' | 'custom';\n children: React.ReactNode;\n className?: string;\n icon?: boolean;\n sx?: SxProps<Theme>; \n}\n\nconst StyledAlert = styled(MuiAlert)<{ customvariant?: string }>(({ theme, customvariant }) => {\n const variants = {\n info: {\n backgroundColor: '#eff6ff',\n borderColor: '#bfdbfe',\n color: '#1e3a8a',\n },\n success: {\n backgroundColor: '#f0fdf4',\n borderColor: '#bbf7d0',\n color: '#14532d',\n },\n warning: {\n backgroundColor: '#fefce8',\n borderColor: '#fef08a',\n color: '#713f12',\n },\n error: {\n backgroundColor: '#fef2f2',\n borderColor: '#fecaca',\n color: '#7f1d1d',\n },\n custom: {\n backgroundColor: theme.palette.light.main,\n borderColor: `${theme.palette.dark.main}33`,\n color: theme.palette.dark.main,\n },\n };\n\n const variantKey = customvariant as keyof typeof variants || 'info';\n const style = variants[variantKey];\n\n return {\n display: 'flex',\n alignItems: 'flex-start',\n gap: theme.spacing(1.5),\n padding: theme.spacing(2),\n border: `1px solid ${style.borderColor}`,\n borderRadius: (typeof theme.shape.borderRadius === 'string'\n ? parseInt(theme.shape.borderRadius, 10)\n : theme.shape.borderRadius || 4) * 2,\n backgroundColor: style.backgroundColor,\n color: style.color,\n '& .MuiAlert-icon': {\n marginRight: 0,\n padding: 0,\n marginTop: '2px',\n },\n '& .MuiAlert-message': {\n padding: 0,\n flex: 1,\n },\n };\n});\n\nexport const Alert: React.FC<AlertProps> = ({\n variant = 'info',\n children,\n className = '',\n icon = true,\n sx,\n}) => {\n const iconMap = {\n info: <InfoOutlineRounded sx={{fontSize: 20, color:'#1e3a8a'}} />,\n success: <TaskAltRounded sx={{fontSize: 20}} />,\n warning: <ErrorOutlineRounded sx={{fontSize: 20}} />,\n error: <HighlightOffRounded sx={{fontSize: 20}} />,\n custom: <InfoOutlineRounded sx={{fontSize: 20}} />,\n };\n\n const severityMap: Record<string, MuiAlertProps['severity']> = {\n info: 'info',\n success: 'success',\n warning: 'warning',\n error: 'error',\n custom: 'info',\n };\n\n return (\n <StyledAlert\n customvariant={variant}\n severity={severityMap[variant]}\n icon={icon ? iconMap[variant] : false}\n className={className}\n sx={sx}\n >\n {children}\n </StyledAlert>\n );\n};"],"names":["styled","MuiAlert","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J,cAAA,CAACC,gCAAkB,EAAA,EAAC,EAAE,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAC,EAAA,CAAI;KACnD;AAED,IAAA,MAAM,WAAW,GAA8C;AAC7D,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,MAAM,EAAE,MAAM;KACf;AAED,IAAA,QACED,cAAA,CAAC,WAAW,IACV,aAAa,EAAE,OAAO,EACtB,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,EAC9B,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,KAAK,EACrC,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,EAAE,YAEL,QAAQ,EAAA,CACG;AAElB;;;;"}
|
|
@@ -9,25 +9,23 @@ const StyledConcertina = material.styled(material.Box)(({ theme }) => ({
|
|
|
9
9
|
width: '100%',
|
|
10
10
|
display: 'flex',
|
|
11
11
|
flexDirection: 'column',
|
|
12
|
-
gap: theme.spacing(1),
|
|
12
|
+
gap: theme.spacing(1),
|
|
13
13
|
}));
|
|
14
14
|
const StyledSection = material.styled(material.Box)(({ theme }) => ({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
? parseInt(theme.shape.borderRadius, 10)
|
|
18
|
-
: theme.shape.borderRadius || 4) * 2, // rounded-lg
|
|
15
|
+
borderTop: `2px solid ${theme.palette.grey[200]}`,
|
|
16
|
+
borderBottom: `2px solid ${theme.palette.grey[200]}`,
|
|
19
17
|
overflow: 'hidden',
|
|
20
18
|
}));
|
|
21
19
|
const StyledHeader = material.styled(material.Box)(({ theme }) => ({
|
|
22
20
|
display: 'flex',
|
|
23
21
|
alignItems: 'center',
|
|
24
22
|
justifyContent: 'space-between',
|
|
25
|
-
padding: theme.spacing(3),
|
|
23
|
+
padding: theme.spacing(3),
|
|
26
24
|
cursor: 'pointer',
|
|
27
25
|
transition: 'background-color 0.2s',
|
|
28
|
-
gap: theme.spacing(2),
|
|
26
|
+
gap: theme.spacing(2),
|
|
29
27
|
'&:hover': {
|
|
30
|
-
backgroundColor: theme.palette.
|
|
28
|
+
backgroundColor: theme.palette.background.default,
|
|
31
29
|
},
|
|
32
30
|
[theme.breakpoints.up('sm')]: {
|
|
33
31
|
padding: theme.spacing(4),
|
|
@@ -39,95 +37,108 @@ const StyledHeader = material.styled(material.Box)(({ theme }) => ({
|
|
|
39
37
|
const StyledTitleWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
40
38
|
display: 'flex',
|
|
41
39
|
alignItems: 'center',
|
|
42
|
-
gap:
|
|
40
|
+
gap: 0,
|
|
43
41
|
flex: 1,
|
|
44
42
|
minWidth: 0,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
}));
|
|
44
|
+
const StyledHashtag = material.styled('span', {
|
|
45
|
+
shouldForwardProp: (prop) => prop !== 'isVisible',
|
|
46
|
+
})(({ theme, isVisible }) => ({
|
|
47
|
+
color: theme.palette.info.main,
|
|
48
|
+
fontWeight: 700,
|
|
49
|
+
fontSize: 'inherit',
|
|
50
|
+
opacity: isVisible ? 1 : 0,
|
|
51
|
+
transition: 'opacity 0.2s',
|
|
52
|
+
marginRight: isVisible ? '0.25em' : 0,
|
|
53
|
+
cursor: 'pointer',
|
|
48
54
|
}));
|
|
49
55
|
const StyledTitle = material.styled(material.Typography, {
|
|
50
56
|
shouldForwardProp: (prop) => prop !== 'isHovered',
|
|
51
57
|
})(({ theme, isHovered }) => ({
|
|
52
|
-
fontWeight: 700,
|
|
53
|
-
fontSize: '1.
|
|
54
|
-
lineHeight: 1.2,
|
|
55
|
-
color: theme.palette.dark.main,
|
|
56
|
-
wordBreak: 'break-word',
|
|
58
|
+
fontWeight: 700,
|
|
59
|
+
fontSize: '1.75rem',
|
|
60
|
+
lineHeight: 1.2,
|
|
61
|
+
color: theme.palette.dark.main,
|
|
62
|
+
wordBreak: 'break-word',
|
|
63
|
+
display: 'inline-block',
|
|
57
64
|
position: 'relative',
|
|
58
|
-
'
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
bottom: 0,
|
|
62
|
-
left: 0,
|
|
63
|
-
width: '100%',
|
|
64
|
-
height: 1,
|
|
65
|
-
backgroundColor: theme.palette.accent.main, // bg-orange-500
|
|
66
|
-
display: isHovered ? 'block' : 'none',
|
|
67
|
-
},
|
|
65
|
+
paddingBottom: '2px',
|
|
66
|
+
borderBottom: isHovered ? `3px solid ${theme.palette.info.main}` : '3px solid transparent',
|
|
67
|
+
transition: 'border-bottom 0.2s',
|
|
68
68
|
[theme.breakpoints.down('lg')]: {
|
|
69
|
-
fontSize: '1.25rem',
|
|
69
|
+
fontSize: '1.25rem',
|
|
70
70
|
},
|
|
71
71
|
[theme.breakpoints.down('md')]: {
|
|
72
|
-
fontSize: '1.125rem',
|
|
72
|
+
fontSize: '1.125rem',
|
|
73
73
|
},
|
|
74
74
|
[theme.breakpoints.down('sm')]: {
|
|
75
|
-
fontSize: '1rem',
|
|
75
|
+
fontSize: '1rem',
|
|
76
76
|
},
|
|
77
77
|
}));
|
|
78
|
-
const StyledLinkButton = material.styled(material.IconButton)(({ theme }) => ({
|
|
79
|
-
color: theme.palette.accent.main, // text-orange-500
|
|
80
|
-
'&:hover': {
|
|
81
|
-
color: theme.palette.accent.dark || theme.palette.accent.main, // hover:text-orange-600
|
|
82
|
-
},
|
|
83
|
-
padding: 0,
|
|
84
|
-
}));
|
|
85
78
|
const StyledTooltip = material.styled(material.Box)(({ theme }) => ({
|
|
86
|
-
position: '
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
padding: theme.spacing(1, 2), // px-2 py-1
|
|
94
|
-
borderRadius: theme.shape.borderRadius, // rounded
|
|
79
|
+
position: 'fixed',
|
|
80
|
+
transform: 'translate(-50%, -120%)',
|
|
81
|
+
backgroundColor: theme.palette.grey[900],
|
|
82
|
+
color: theme.palette.common.white,
|
|
83
|
+
fontSize: '0.75rem',
|
|
84
|
+
padding: theme.spacing(1, 2),
|
|
85
|
+
borderRadius: theme.shape.borderRadius,
|
|
95
86
|
whiteSpace: 'nowrap',
|
|
96
|
-
zIndex:
|
|
87
|
+
zIndex: 1000,
|
|
88
|
+
pointerEvents: 'none',
|
|
97
89
|
[theme.breakpoints.up('sm')]: {
|
|
98
|
-
fontSize: '0.875rem',
|
|
99
|
-
padding: theme.spacing(1.5, 3),
|
|
90
|
+
fontSize: '0.875rem',
|
|
91
|
+
padding: theme.spacing(1.5, 3),
|
|
100
92
|
},
|
|
101
93
|
}));
|
|
102
|
-
|
|
103
|
-
color: theme.palette.grey[500],
|
|
104
|
-
transition: 'transform 0.2s',
|
|
105
|
-
width: 24,
|
|
106
|
-
height: 24,
|
|
94
|
+
material.styled(iconsMaterial.ExpandMoreRounded)(({ theme }) => ({
|
|
95
|
+
color: theme.palette.grey[500],
|
|
96
|
+
transition: 'transform 0.2s',
|
|
97
|
+
width: 24,
|
|
98
|
+
height: 24,
|
|
107
99
|
[theme.breakpoints.down('sm')]: {
|
|
108
100
|
width: 20,
|
|
109
101
|
height: 20,
|
|
110
102
|
},
|
|
111
103
|
}));
|
|
112
104
|
const StyledContent = material.styled(material.Box)(({ theme }) => ({
|
|
113
|
-
padding: theme.spacing(2, 3, 3),
|
|
105
|
+
padding: theme.spacing(2, 3, 3),
|
|
114
106
|
[theme.breakpoints.up('sm')]: {
|
|
115
|
-
padding: theme.spacing(2, 4, 4),
|
|
107
|
+
padding: theme.spacing(2, 4, 4),
|
|
116
108
|
},
|
|
117
109
|
[theme.breakpoints.up('md')]: {
|
|
118
|
-
padding: theme.spacing(2, 6, 6),
|
|
110
|
+
padding: theme.spacing(2, 6, 6),
|
|
119
111
|
},
|
|
120
112
|
}));
|
|
121
|
-
const
|
|
122
|
-
color: theme.palette.dark.main,
|
|
123
|
-
lineHeight: 1.5,
|
|
124
|
-
wordBreak: 'break-word',
|
|
125
|
-
fontSize: 13,
|
|
113
|
+
const StyledContentWrapper = material.styled(material.Box)(({ theme }) => ({
|
|
114
|
+
color: theme.palette.dark.main,
|
|
115
|
+
lineHeight: 1.5,
|
|
116
|
+
wordBreak: 'break-word',
|
|
117
|
+
fontSize: 13,
|
|
118
|
+
'& p': {
|
|
119
|
+
margin: 0,
|
|
120
|
+
marginBottom: theme.spacing(2),
|
|
121
|
+
'&:last-child': {
|
|
122
|
+
marginBottom: 0,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
'& ul, & ol': {
|
|
126
|
+
marginTop: theme.spacing(1),
|
|
127
|
+
marginBottom: theme.spacing(2),
|
|
128
|
+
paddingLeft: theme.spacing(3),
|
|
129
|
+
'&:last-child': {
|
|
130
|
+
marginBottom: 0,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
'& li': {
|
|
134
|
+
marginBottom: theme.spacing(0.5),
|
|
135
|
+
},
|
|
126
136
|
}));
|
|
127
137
|
function Concertina({ sections }) {
|
|
128
138
|
const [openSections, setOpenSections] = React.useState(new Set());
|
|
129
139
|
const [hoveredTitle, setHoveredTitle] = React.useState(null);
|
|
130
140
|
const [copiedId, setCopiedId] = React.useState(null);
|
|
141
|
+
const [tooltipPosition, setTooltipPosition] = React.useState(null);
|
|
131
142
|
const toggleSection = (id) => {
|
|
132
143
|
const newOpenSections = new Set(openSections);
|
|
133
144
|
if (newOpenSections.has(id)) {
|
|
@@ -143,9 +154,16 @@ function Concertina({ sections }) {
|
|
|
143
154
|
const url = `${window.location.origin}${window.location.pathname}#${id}`;
|
|
144
155
|
navigator.clipboard.writeText(url);
|
|
145
156
|
setCopiedId(id);
|
|
146
|
-
|
|
157
|
+
setTooltipPosition({ x: e.clientX, y: e.clientY });
|
|
158
|
+
setTimeout(() => {
|
|
159
|
+
setCopiedId(null);
|
|
160
|
+
setTooltipPosition(null);
|
|
161
|
+
}, 2000);
|
|
147
162
|
};
|
|
148
|
-
return (jsxRuntime.
|
|
163
|
+
return (jsxRuntime.jsxs(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.jsx(StyledTitleWrapper, { children: jsxRuntime.jsxs(StyledTitle, { isHovered: hoveredTitle === section.id, variant: "h3", children: [jsxRuntime.jsx(StyledHashtag, { isVisible: hoveredTitle === section.id, onClick: (e) => copyJumpLink(section.id, e), children: "#" }), section.title] }) }), jsxRuntime.jsx(iconsMaterial.ExpandCircleDownOutlined, { sx: { fontSize: '1.5rem', transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' } })] }), jsxRuntime.jsx(material.Collapse, { in: openSections.has(section.id), children: jsxRuntime.jsx(StyledContent, { children: jsxRuntime.jsx(StyledContentWrapper, { children: section.content }) }) })] }, section.id))), copiedId && tooltipPosition && (jsxRuntime.jsx(StyledTooltip, { sx: {
|
|
164
|
+
left: tooltipPosition.x,
|
|
165
|
+
top: tooltipPosition.y,
|
|
166
|
+
}, children: "Link copied" }))] }));
|
|
149
167
|
}
|
|
150
168
|
|
|
151
169
|
exports.Concertina = Concertina;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Concertina.js","sources":["../../../../src/components/Concertina.tsx"],"sourcesContent":["\n\nimport React, { useState } from 'react';\nimport { Box, styled, Typography, IconButton, Collapse } from '@mui/material';\nimport { ExpandMoreRounded, LinkRounded } from '@mui/icons-material';\n\ninterface ConcertinaSection {\n id: string;\n title: string;\n content: string;\n}\n\ninterface ConcertinaProps {\n sections: ConcertinaSection[];\n}\n\nconst StyledConcertina = styled(Box)(({ theme }) => ({\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(1), // space-y-2\n}));\n\nconst StyledSection = styled(Box)(({ theme }) => ({\n border: `1px solid ${theme.palette.grey[200]}`, // border-gray-200\n borderRadius: (typeof theme.shape.borderRadius === 'string'\n ? parseInt(theme.shape.borderRadius, 10)\n : theme.shape.borderRadius || 4) * 2, // rounded-lg\n overflow: 'hidden',\n}));\n\nconst StyledHeader = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: theme.spacing(3), // p-3 sm:p-4 md:p-6\n cursor: 'pointer',\n transition: 'background-color 0.2s',\n gap: theme.spacing(2), // gap-2\n '&:hover': {\n backgroundColor: theme.palette.light.main, // hover:bg-[#FDFCEE]\n },\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(4),\n },\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(6),\n },\n}));\n\nconst StyledTitleWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(3), // sm:gap-3\n flex: 1,\n minWidth: 0,\n [theme.breakpoints.down('sm')]: {\n gap: theme.spacing(2), // gap-2\n },\n}));\n\nconst StyledTitle = styled(Typography, {\n shouldForwardProp: (prop) => prop !== 'isHovered',\n})<{ isHovered: boolean }>(({ theme, isHovered }) => ({\n fontWeight: 700, // font-bold\n fontSize: '1.5rem', // text-2xl\n lineHeight: 1.2, // leading-tight\n color: theme.palette.dark.main, // text-[#4D3019]\n wordBreak: 'break-word', // break-words\n position: 'relative',\n '&:after': {\n content: '\"\"',\n position: 'absolute',\n bottom: 0,\n left: 0,\n width: '100%',\n height: 1,\n backgroundColor: theme.palette.accent.main, // bg-orange-500\n display: isHovered ? 'block' : 'none',\n },\n [theme.breakpoints.down('lg')]: {\n fontSize: '1.25rem', // lg:text-[28px]\n },\n [theme.breakpoints.down('md')]: {\n fontSize: '1.125rem', // md:text-xl\n },\n [theme.breakpoints.down('sm')]: {\n fontSize: '1rem', // sm:text-lg\n },\n}));\n\nconst StyledLinkButton = styled(IconButton)(({ theme }) => ({\n color: theme.palette.accent.main, // text-orange-500\n '&:hover': {\n color: theme.palette.accent.dark || theme.palette.accent.main, // hover:text-orange-600\n },\n padding: 0,\n}));\n\nconst StyledTooltip = styled(Box)(({ theme }) => ({\n position: 'absolute',\n top: -40, // -top-10\n left: '50%',\n transform: 'translateX(-50%)',\n backgroundColor: theme.palette.grey[900], // bg-gray-900\n color: theme.palette.common.white, // text-white\n fontSize: '0.75rem', // text-xs\n padding: theme.spacing(1, 2), // px-2 py-1\n borderRadius: theme.shape.borderRadius, // rounded\n whiteSpace: 'nowrap',\n zIndex: 10,\n [theme.breakpoints.up('sm')]: {\n fontSize: '0.875rem', // sm:text-sm\n padding: theme.spacing(1.5, 3), // sm:px-3 sm:py-1.5\n },\n}));\n\nconst StyledChevron = styled(ExpandMoreRounded)(({ theme }) => ({\n color: theme.palette.grey[500], // text-gray-500\n transition: 'transform 0.2s', // transition-transform duration-200\n width: 24, // sm:w-6\n height: 24, // sm:h-6\n [theme.breakpoints.down('sm')]: {\n width: 20,\n height: 20,\n },\n}));\n\nconst StyledContent = styled(Box)(({ theme }) => ({\n padding: theme.spacing(2, 3, 3), // px-3 pb-3 pt-2\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(2, 4, 4), // sm:px-4 sm:pb-4\n },\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(2, 6, 6), // md:px-6 md:pb-6\n },\n}));\n\nconst StyledContentText = styled(Typography)(({ theme }) => ({\n color: theme.palette.dark.main, // text-[#4D3019]\n lineHeight: 1.5, // leading-relaxed\n wordBreak: 'break-word', // break-words\n fontSize: 13, // style={{ fontSize: '13px' }}\n}));\n\nexport function Concertina({ sections }: ConcertinaProps) {\n const [openSections, setOpenSections] = useState<Set<string>>(new Set());\n const [hoveredTitle, setHoveredTitle] = useState<string | null>(null);\n const [copiedId, setCopiedId] = useState<string | null>(null);\n\n const toggleSection = (id: string) => {\n const newOpenSections = new Set(openSections);\n if (newOpenSections.has(id)) {\n newOpenSections.delete(id);\n } else {\n newOpenSections.add(id);\n }\n setOpenSections(newOpenSections);\n };\n\n const copyJumpLink = (id: string, e: React.MouseEvent) => {\n e.stopPropagation();\n const url = `${window.location.origin}${window.location.pathname}#${id}`;\n navigator.clipboard.writeText(url);\n setCopiedId(id);\n setTimeout(() => setCopiedId(null), 2000);\n };\n\n return (\n <StyledConcertina>\n {sections.map((section) => (\n <StyledSection key={section.id} id={section.id}>\n <StyledHeader\n onClick={() => toggleSection(section.id)}\n onMouseEnter={() => setHoveredTitle(section.id)}\n onMouseLeave={() => setHoveredTitle(null)}\n >\n <StyledTitleWrapper>\n <StyledTitle isHovered={hoveredTitle === section.id} variant=\"h3\">\n {section.title}\n </StyledTitle>\n {hoveredTitle === section.id && (\n <Box sx={{ position: 'relative', flexShrink: 0 }}>\n <StyledLinkButton\n onClick={(e) => copyJumpLink(section.id, e)}\n aria-label=\"Copy link\"\n >\n <LinkRounded sx={{fontSize: 20}} />\n </StyledLinkButton>\n {copiedId === section.id && (\n <StyledTooltip>\n Link copied\n </StyledTooltip>\n )}\n </Box>\n )}\n </StyledTitleWrapper>\n <StyledChevron\n sx={{ fontSize:20, transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' }}\n />\n </StyledHeader>\n <Collapse in={openSections.has(section.id)}>\n <StyledContent>\n <StyledContentText>{section.content}</StyledContentText>\n </StyledContent>\n </Collapse>\n </StyledSection>\n ))}\n </StyledConcertina>\n );\n}"],"names":["styled","Box","Typography","IconButton","ExpandMoreRounded","useState","_jsx","_jsxs","LinkRounded","Collapse"],"mappings":";;;;;;;AAgBA,MAAM,gBAAgB,GAAGA,eAAM,CAACC,YAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACnD,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,aAAa,EAAE,QAAQ;IACvB,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACtB,CAAA,CAAC,CAAC;AAEH,MAAM,aAAa,GAAGD,eAAM,CAACC,YAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAA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OAAO,CAAC,OAAO,EAAA,CAAqB,EAAA,CAC1C,EAAA,CACP,CAAA,EAAA,EAlCO,OAAO,CAAC,EAAE,CAmCd,CACjB,CAAC,EAAA,CACe;AAEvB;;;;"}
|
|
1
|
+
{"version":3,"file":"Concertina.js","sources":["../../../../src/components/Concertina.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Box, styled, Typography, Collapse } from '@mui/material';\nimport { ExpandCircleDown, ExpandCircleDownOutlined, ExpandMoreRounded } from '@mui/icons-material';\n\n\ninterface ConcertinaSection {\n id: string;\n title: string;\n content: React.ReactNode;\n}\n\n\ninterface ConcertinaProps {\n sections: ConcertinaSection[];\n}\n\n\nconst StyledConcertina = styled(Box)(({ theme }) => ({\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(1),\n}));\n\n\nconst StyledSection = styled(Box)(({ theme }) => ({\n borderTop: `2px solid ${theme.palette.grey[200]}`,\n borderBottom: `2px solid ${theme.palette.grey[200]}`,\n overflow: 'hidden',\n}));\n\n\nconst StyledHeader = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: theme.spacing(3),\n cursor: 'pointer',\n transition: 'background-color 0.2s',\n gap: theme.spacing(2),\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n },\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(4),\n },\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(6),\n },\n}));\n\n\nconst StyledTitleWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: 0,\n flex: 1,\n minWidth: 0,\n}));\n\n\nconst StyledHashtag = styled('span', {\n shouldForwardProp: (prop) => prop !== 'isVisible',\n})<{ isVisible: boolean }>(({ theme, isVisible }) => ({\n color: theme.palette.info.main,\n fontWeight: 700,\n fontSize: 'inherit',\n opacity: isVisible ? 1 : 0,\n transition: 'opacity 0.2s',\n marginRight: isVisible ? '0.25em' : 0,\n cursor: 'pointer',\n}));\n\n\nconst StyledTitle = styled(Typography, {\n shouldForwardProp: (prop) => prop !== 'isHovered',\n})<{ isHovered: boolean }>(({ theme, isHovered }) => ({\n fontWeight: 700,\n fontSize: '1.75rem',\n lineHeight: 1.2,\n color: theme.palette.dark.main,\n wordBreak: 'break-word',\n display: 'inline-block',\n position: 'relative',\n paddingBottom: '2px',\n borderBottom: isHovered ? `3px solid ${theme.palette.info.main}` : '3px solid transparent',\n transition: 'border-bottom 0.2s',\n [theme.breakpoints.down('lg')]: {\n fontSize: '1.25rem',\n },\n [theme.breakpoints.down('md')]: {\n fontSize: '1.125rem',\n },\n [theme.breakpoints.down('sm')]: {\n fontSize: '1rem',\n },\n}));\n\n\nconst StyledTooltip = styled(Box)(({ theme }) => ({\n position: 'fixed',\n transform: 'translate(-50%, -120%)',\n backgroundColor: theme.palette.grey[900],\n color: theme.palette.common.white,\n fontSize: '0.75rem',\n padding: theme.spacing(1, 2),\n borderRadius: theme.shape.borderRadius,\n whiteSpace: 'nowrap',\n zIndex: 1000,\n pointerEvents: 'none',\n [theme.breakpoints.up('sm')]: {\n fontSize: '0.875rem',\n padding: theme.spacing(1.5, 3),\n },\n}));\n\n\nconst StyledChevron = styled(ExpandMoreRounded)(({ theme }) => ({\n color: theme.palette.grey[500],\n transition: 'transform 0.2s',\n width: 24,\n height: 24,\n [theme.breakpoints.down('sm')]: {\n width: 20,\n height: 20,\n },\n}));\n\n\nconst StyledContent = styled(Box)(({ theme }) => ({\n padding: theme.spacing(2, 3, 3),\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(2, 4, 4),\n },\n [theme.breakpoints.up('md')]: {\n padding: theme.spacing(2, 6, 6),\n },\n}));\n\n\nconst StyledContentWrapper = styled(Box)(({ theme }) => ({\n color: theme.palette.dark.main,\n lineHeight: 1.5,\n wordBreak: 'break-word',\n fontSize: 13,\n '& p': {\n margin: 0,\n marginBottom: theme.spacing(2),\n '&:last-child': {\n marginBottom: 0,\n },\n },\n '& ul, & ol': {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(2),\n paddingLeft: theme.spacing(3),\n '&:last-child': {\n marginBottom: 0,\n },\n },\n '& li': {\n marginBottom: theme.spacing(0.5),\n },\n}));\n\n\nexport function Concertina({ sections }: ConcertinaProps) {\n const [openSections, setOpenSections] = useState<Set<string>>(new Set());\n const [hoveredTitle, setHoveredTitle] = useState<string | null>(null);\n const [copiedId, setCopiedId] = useState<string | null>(null);\n const [tooltipPosition, setTooltipPosition] = useState<{ x: number; y: number } | null>(null);\n\n\n const toggleSection = (id: string) => {\n const newOpenSections = new Set(openSections);\n if (newOpenSections.has(id)) {\n newOpenSections.delete(id);\n } else {\n newOpenSections.add(id);\n }\n setOpenSections(newOpenSections);\n };\n\n\n const copyJumpLink = (id: string, e: React.MouseEvent) => {\n e.stopPropagation();\n const url = `${window.location.origin}${window.location.pathname}#${id}`;\n navigator.clipboard.writeText(url);\n setCopiedId(id);\n setTooltipPosition({ x: e.clientX, y: e.clientY });\n setTimeout(() => {\n setCopiedId(null);\n setTooltipPosition(null);\n }, 2000);\n };\n\n\n return (\n <StyledConcertina>\n {sections.map((section) => (\n <StyledSection key={section.id} id={section.id}>\n <StyledHeader\n onClick={() => toggleSection(section.id)}\n onMouseEnter={() => setHoveredTitle(section.id)}\n onMouseLeave={() => setHoveredTitle(null)}\n >\n <StyledTitleWrapper>\n <StyledTitle isHovered={hoveredTitle === section.id} variant=\"h3\">\n <StyledHashtag\n isVisible={hoveredTitle === section.id}\n onClick={(e) => copyJumpLink(section.id, e as any)}\n >\n #\n </StyledHashtag>\n {section.title}\n </StyledTitle>\n </StyledTitleWrapper>\n <ExpandCircleDownOutlined\n sx={{ fontSize: '1.5rem', transform: openSections.has(section.id) ? 'rotate(180deg)' : 'none' }}\n />\n </StyledHeader>\n <Collapse in={openSections.has(section.id)}>\n <StyledContent>\n <StyledContentWrapper>{section.content}</StyledContentWrapper>\n </StyledContent>\n </Collapse>\n </StyledSection>\n ))}\n {copiedId && tooltipPosition && (\n <StyledTooltip\n sx={{\n left: tooltipPosition.x,\n top: tooltipPosition.y,\n }}\n >\n Link copied\n </StyledTooltip>\n )}\n </StyledConcertina>\n );\n}\n"],"names":["styled","Box","Typography","ExpandMoreRounded","useState","_jsxs","_jsx","ExpandCircleDownOutlined","Collapse"],"mappings":";;;;;;;AAiBA,MAAM,gBAAgB,GAAGA,eAAM,CAACC,YAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACnD,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,aAAa,EAAE,QAAQ;AACvB,IAAA,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACtB,CAAA,CAAC,CAAC;AAGH,MAAM,aAAa,GAAGD,eAAM,CAACC,YAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;IAChD,SAAS,EAAE,CAAA,UAAA,EAAa,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAE;IACjD,YAAY,EAAE,CAAA,UAAA,EAAa,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAE;AACpD,IAAA,QAAQ,EAAE,QAAQ;AACnB,CAAA,CAAC,CAAC;AAGH,MAAM,YAAY,GAAGD,eAAM,CAACC,YAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AAC/C,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,UAAU,EAAE,QAAQ;AACpB,IAAA,cAAc,EAAE,eAAe;AAC/B,IAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACzB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,UAAU,EAAE,uBAAuB;AACnC,IAAA,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACrB,IAAA,SAAS,EAAE;AACT,QAAA,eAAe,EAAE,KAAK,CAAC,OAAO,CAA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,QAAA,EACjBD,gBAAC,WAAW,EAAA,EAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAC,EAAE,EAAE,OAAO,EAAC,IAAI,EAAA,QAAA,EAAA,CAC/DC,eAAC,aAAa,EAAA,EACZ,SAAS,EAAE,YAAY,KAAK,OAAO,CAAC,EAAE,EACtC,OAAO,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE,CAAQ,CAAC,EAAA,QAAA,EAAA,GAAA,EAAA,CAGpC,EACf,OAAO,CAAC,KAAK,CAAA,EAAA,CACF,EAAA,CACK,EACrBA,cAAA,CAACC,sCAAwB,IACvB,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,gBAAgB,GAAG,MAAM,EAAE,GAC/F,CAAA,EAAA,CACW,EACfD,eAACE,iBAAQ,EAAA,EAAC,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAA,QAAA,EACxCF,cAAA,CAAC,aAAa,EAAA,EAAA,QAAA,EACZA,cAAA,CAAC,oBAAoB,EAAA,EAAA,QAAA,EAAE,OAAO,CAAC,OAAO,EAAA,CAAwB,GAChD,EAAA,CACP,CAAA,EAAA,EAzBO,OAAO,CAAC,EAAE,CA0Bd,CACjB,CAAC,EACD,QAAQ,IAAI,eAAe,KAC1BA,eAAC,aAAa,EAAA,EACZ,EAAE,EAAE;oBACF,IAAI,EAAE,eAAe,CAAC,CAAC;oBACvB,GAAG,EAAE,eAAe,CAAC,CAAC;iBACvB,EAAA,QAAA,EAAA,aAAA,EAAA,CAGa,CACjB,CAAA,EAAA,CACgB;AAEvB;;;;"}
|
|
@@ -32,14 +32,14 @@ const StyledTextField = material.styled(material.TextField, {
|
|
|
32
32
|
minWidth: 0,
|
|
33
33
|
padding: 0, // Remove padding from root
|
|
34
34
|
'&:focus-within': {
|
|
35
|
-
outline: `2px solid ${errorMessage ? theme.palette.
|
|
35
|
+
outline: `2px solid ${errorMessage ? theme.palette.error.main : theme.palette.primary.main}`,
|
|
36
36
|
outlineOffset: 0,
|
|
37
37
|
},
|
|
38
38
|
'& .MuiOutlinedInput-notchedOutline': {
|
|
39
|
-
borderColor: errorMessage ? theme.palette.
|
|
39
|
+
borderColor: errorMessage ? theme.palette.error.main : `${theme.palette.dark.main}33`,
|
|
40
40
|
},
|
|
41
41
|
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
42
|
-
borderColor: errorMessage ? theme.palette.
|
|
42
|
+
borderColor: errorMessage ? theme.palette.error.main : theme.palette.primary.main,
|
|
43
43
|
},
|
|
44
44
|
'&.Mui-disabled': {
|
|
45
45
|
backgroundColor: `${theme.palette.dark.main}0D`,
|
|
@@ -62,7 +62,7 @@ const StyledTextField = material.styled(material.TextField, {
|
|
|
62
62
|
'& .MuiFormHelperText-root': {
|
|
63
63
|
marginTop: theme.spacing(0.75),
|
|
64
64
|
fontSize: '0.875rem',
|
|
65
|
-
color: errorMessage ? theme.palette.
|
|
65
|
+
color: errorMessage ? theme.palette.error.main : `${theme.palette.dark.main}99`,
|
|
66
66
|
},
|
|
67
67
|
}));
|
|
68
68
|
const Input = ({ error, fullWidth = false, id, label, ...props }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../../src/components/Input.tsx"],"sourcesContent":["import React from 'react';\nimport { styled, TextField, TextFieldProps, InputLabel } from '@mui/material';\n\ninterface InputProps extends Omit<TextFieldProps, 'variant' | 'error'> {\n error?: string;\n}\n\nconst InputWrapper = styled('div')(({ theme }) => ({\n width: '100%',\n}));\n\nconst StyledLabel = styled(InputLabel)(({ theme }) => ({\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.palette.dark.main,\n marginBottom: theme.spacing(0.75),\n display: 'block',\n position: 'static',\n transform: 'none',\n '&.Mui-focused': {\n color: theme.palette.dark.main,\n },\n}));\n\nconst StyledTextField = styled(TextField, {\n shouldForwardProp: (prop) => !['errorMessage'].includes(prop as string),\n})<{ errorMessage?: string }>(({ theme, errorMessage }) => ({\n width: '100%',\n '& .MuiInputBase-root': {\n backgroundColor: theme.palette.light.main,\n borderRadius: (typeof theme.shape.borderRadius === 'string'\n ? parseInt(theme.shape.borderRadius, 10)\n : theme.shape.borderRadius || 4) * 2,\n fontSize: '1rem',\n color: theme.palette.dark.main,\n minWidth: 0,\n padding: 0, // Remove padding from root\n '&:focus-within': {\n outline: `2px solid ${errorMessage ? theme.palette.
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../../src/components/Input.tsx"],"sourcesContent":["import React from 'react';\nimport { styled, TextField, TextFieldProps, InputLabel } from '@mui/material';\n\ninterface InputProps extends Omit<TextFieldProps, 'variant' | 'error'> {\n error?: string;\n}\n\nconst InputWrapper = styled('div')(({ theme }) => ({\n width: '100%',\n}));\n\nconst StyledLabel = styled(InputLabel)(({ theme }) => ({\n fontSize: '0.875rem',\n fontWeight: 500,\n color: theme.palette.dark.main,\n marginBottom: theme.spacing(0.75),\n display: 'block',\n position: 'static',\n transform: 'none',\n '&.Mui-focused': {\n color: theme.palette.dark.main,\n },\n}));\n\nconst StyledTextField = styled(TextField, {\n shouldForwardProp: (prop) => !['errorMessage'].includes(prop as string),\n})<{ errorMessage?: string }>(({ theme, errorMessage }) => ({\n width: '100%',\n '& .MuiInputBase-root': {\n backgroundColor: theme.palette.light.main,\n borderRadius: (typeof theme.shape.borderRadius === 'string'\n ? parseInt(theme.shape.borderRadius, 10)\n : theme.shape.borderRadius || 4) * 2,\n fontSize: '1rem',\n color: theme.palette.dark.main,\n minWidth: 0,\n padding: 0, // Remove padding from root\n '&:focus-within': {\n outline: `2px solid ${errorMessage ? theme.palette.error.main : theme.palette.primary.main}`,\n outlineOffset: 0,\n },\n '& .MuiOutlinedInput-notchedOutline': {\n borderColor: errorMessage ? theme.palette.error.main : `${theme.palette.dark.main}33`,\n },\n '&:hover .MuiOutlinedInput-notchedOutline': {\n borderColor: errorMessage ? theme.palette.error.main : theme.palette.primary.main,\n },\n '&.Mui-disabled': {\n backgroundColor: `${theme.palette.dark.main}0D`,\n '& .MuiInputBase-input': {\n color: `${theme.palette.dark.main}80`,\n cursor: 'not-allowed',\n },\n '& .MuiOutlinedInput-notchedOutline': {\n borderColor: `${theme.palette.dark.main}33`,\n },\n },\n },\n // Target the actual input element for padding\n '& .MuiInputBase-input': {\n padding: theme.spacing(1, 3),\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(1.25, 4),\n },\n },\n '& .MuiFormHelperText-root': {\n marginTop: theme.spacing(0.75),\n fontSize: '0.875rem',\n color: errorMessage ? theme.palette.error.main : `${theme.palette.dark.main}99`,\n },\n}));\n\nexport const Input: React.FC<InputProps> = ({\n error,\n fullWidth = false,\n id,\n label,\n ...props\n}) => {\n const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;\n\n return (\n <InputWrapper sx={{ ...(!fullWidth && { width: 'auto' }) }}>\n {label && (\n <StyledLabel htmlFor={inputId}>\n {label}\n </StyledLabel>\n )}\n <StyledTextField\n id={inputId}\n error={!!error}\n helperText={error || props.helperText}\n errorMessage={error}\n fullWidth={fullWidth}\n variant=\"outlined\"\n {...props}\n />\n </InputWrapper>\n );\n};\n"],"names":["styled","InputLabel","TextField","_jsxs","_jsx"],"mappings":";;;;;AAOA,MAAM,YAAY,GAAGA,eAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACjD,IAAA,KAAK,EAAE,MAAM;AACd,CAAA,CAAC,CAAC;AAEH,MAAM,WAAW,GAAGA,eAAM,CAACC,mBAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;AACrD,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,UAAU,EAAE,GAAG;AACf,IAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;AAC9B,IAAA,YAAY,EAAE,KA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