@quietmind/mdx-docs 0.1.18 → 0.1.20
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/README.md +12 -0
- package/dist/assets/Avatar-BJ0S7JKg.js +1 -0
- package/dist/assets/Button-BXcSdEL6.js +1 -0
- package/dist/assets/Favorite-DeeoxvxH.js +1 -0
- package/dist/assets/advanced-D_Pa36Nk.js +38 -0
- package/dist/assets/alert-a7rj56bx.js +191 -0
- package/dist/assets/button-D0caik7C.js +97 -0
- package/dist/assets/card-Fe9yzzA9.js +230 -0
- package/dist/assets/chip-CHAwrwxa.js +204 -0
- package/dist/assets/colors-BwOy54bA.js +8 -0
- package/dist/assets/customization-DuuWhJ6e.js +111 -0
- package/dist/assets/examples-DBDWp4fA.js +11 -0
- package/dist/assets/home-9ybgeCk8.js +90 -0
- package/dist/assets/index-C5FzG5L5.js +153 -0
- package/dist/assets/index-Do1AlBnD.css +1 -0
- package/dist/assets/prism-DjoQ0BfU.js +14 -0
- package/dist/assets/react-vendor-BVjvCnQb.js +56 -0
- package/dist/assets/router-d4Dt6g8h.js +12 -0
- package/dist/assets/tabs-D9qsbJnd.js +215 -0
- package/dist/assets/textfield-D0Z_oeqU.js +253 -0
- package/dist/assets/typography-hshX1pgi.js +429 -0
- package/dist/index.html +29 -0
- package/package.json +1 -1
- package/dist/index.css +0 -1
- package/dist/index.js +0 -1548
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import{n as l,o as e,p as i,F as h}from"./react-vendor-BVjvCnQb.js";import{T as t,B as a}from"./index-C5FzG5L5.js";import"./prism-DjoQ0BfU.js";import"./router-d4Dt6g8h.js";function o(r){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...l(),...r.components};return i(h,{children:[e(n.h1,{children:"Typography"}),`
|
|
2
|
+
`,e(n.p,{children:"The Typography component is a fundamental building block for displaying text content in your application. Material UI's Typography component provides consistent, accessible, and customizable text styling with predefined variants that follow design system principles."}),`
|
|
3
|
+
`,e(n.p,{children:"Typography components can be used to display text with consistent styling and proper semantic meaning."}),`
|
|
4
|
+
`,e(n.h2,{children:"Variants"}),`
|
|
5
|
+
`,e(n.p,{children:"Material UI typography comes with several predefined variants that map to common HTML elements:"}),`
|
|
6
|
+
`,e(n.h3,{children:"Heading Variants"}),`
|
|
7
|
+
`,e(n.h4,{children:"h1 - Main Page Title"}),`
|
|
8
|
+
`,e(t,{variant:"h1",children:"Heading 1"}),`
|
|
9
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="h1">Heading 1</Typography>
|
|
10
|
+
`})}),`
|
|
11
|
+
`,e(n.h4,{children:"h2 - Section Headers"}),`
|
|
12
|
+
`,e(t,{variant:"h2",children:"Heading 2"}),`
|
|
13
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="h2">Heading 2</Typography>
|
|
14
|
+
`})}),`
|
|
15
|
+
`,e(n.h4,{children:"h3 - Subsection Headers"}),`
|
|
16
|
+
`,e(t,{variant:"h3",children:"Heading 3"}),`
|
|
17
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="h3">Heading 3</Typography>
|
|
18
|
+
`})}),`
|
|
19
|
+
`,e(n.h4,{children:"h4 - Component Titles"}),`
|
|
20
|
+
`,e(t,{variant:"h4",children:"Heading 4"}),`
|
|
21
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="h4">Heading 4</Typography>
|
|
22
|
+
`})}),`
|
|
23
|
+
`,e(n.h4,{children:"h5 - Subcomponent Titles"}),`
|
|
24
|
+
`,e(t,{variant:"h5",children:"Heading 5"}),`
|
|
25
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="h5">Heading 5</Typography>
|
|
26
|
+
`})}),`
|
|
27
|
+
`,e(n.h4,{children:"h6 - Small Titles"}),`
|
|
28
|
+
`,e(t,{variant:"h6",children:"Heading 6"}),`
|
|
29
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="h6">Heading 6</Typography>
|
|
30
|
+
`})}),`
|
|
31
|
+
`,e(n.h3,{children:"Body Text Variants"}),`
|
|
32
|
+
`,e(n.h4,{children:"Body 1 - Default Body Text"}),`
|
|
33
|
+
`,e(t,{variant:"body1",component:"div",children:`This is body1 text. It's the default variant for body text and is used for
|
|
34
|
+
most content on the page. It provides good readability and is suitable for
|
|
35
|
+
paragraphs, descriptions, and general content.`}),`
|
|
36
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="body1" component="div">
|
|
37
|
+
This is body1 text. It's the default variant for body text.
|
|
38
|
+
</Typography>
|
|
39
|
+
`})}),`
|
|
40
|
+
`,e(n.h4,{children:"Body 2 - Smaller Body Text"}),`
|
|
41
|
+
`,e(t,{variant:"body2",component:"div",children:`This is body2 text. It's slightly smaller than body1 and is often used for
|
|
42
|
+
secondary information, captions, or when you need to fit more content in a
|
|
43
|
+
smaller space.`}),`
|
|
44
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="body2" component="div">
|
|
45
|
+
This is body2 text. It's slightly smaller than body1.
|
|
46
|
+
</Typography>
|
|
47
|
+
`})}),`
|
|
48
|
+
`,e(n.h3,{children:"Special Variants"}),`
|
|
49
|
+
`,e(n.h4,{children:"Subtitle 1"}),`
|
|
50
|
+
`,e(t,{variant:"subtitle1",children:"Subtitle 1 - Used for subtitles and secondary headings"}),`
|
|
51
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="subtitle1">
|
|
52
|
+
Subtitle 1 - Used for subtitles and secondary headings
|
|
53
|
+
</Typography>
|
|
54
|
+
`})}),`
|
|
55
|
+
`,e(n.h4,{children:"Subtitle 2"}),`
|
|
56
|
+
`,e(t,{variant:"subtitle2",children:"Subtitle 2 - Smaller subtitle variant"}),`
|
|
57
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="subtitle2">
|
|
58
|
+
Subtitle 2 - Smaller subtitle variant
|
|
59
|
+
</Typography>
|
|
60
|
+
`})}),`
|
|
61
|
+
`,e(n.h4,{children:"Caption"}),`
|
|
62
|
+
`,e(t,{variant:"caption",children:"Caption text - Used for small text like image captions, footnotes, or metadata"}),`
|
|
63
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="caption">
|
|
64
|
+
Caption text - Used for small text like image captions
|
|
65
|
+
</Typography>
|
|
66
|
+
`})}),`
|
|
67
|
+
`,e(n.h4,{children:"Overline"}),`
|
|
68
|
+
`,e(t,{variant:"overline",children:"OVERLINE TEXT - Used for small uppercase text like labels or categories"}),`
|
|
69
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="overline">
|
|
70
|
+
OVERLINE TEXT - Used for small uppercase text
|
|
71
|
+
</Typography>
|
|
72
|
+
`})}),`
|
|
73
|
+
`,e(n.h2,{children:"Customizing Typography Variants"}),`
|
|
74
|
+
`,e(n.p,{children:"You can customize the font-size, font-weight, line-height, and other typography properties for each variant by configuring the theme's typography settings. This allows you to create a consistent design system that matches your brand requirements."}),`
|
|
75
|
+
`,e(n.h3,{children:"Theme Configuration"}),`
|
|
76
|
+
`,e(n.p,{children:"To customize typography variants, you need to modify your theme configuration. Here's how to do it:"}),`
|
|
77
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`import { createTheme } from "@mui/material/styles";
|
|
78
|
+
|
|
79
|
+
const theme = createTheme({
|
|
80
|
+
typography: {
|
|
81
|
+
// Customize the default font family
|
|
82
|
+
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
|
|
83
|
+
|
|
84
|
+
// Customize specific variants
|
|
85
|
+
h1: {
|
|
86
|
+
fontSize: "2.5rem", // 40px
|
|
87
|
+
fontWeight: 700, // Bold
|
|
88
|
+
lineHeight: 1.2, // 120%
|
|
89
|
+
letterSpacing: "-0.02em", // Tighter letter spacing
|
|
90
|
+
fontFamily: '"Poppins", sans-serif', // Custom font for headings
|
|
91
|
+
},
|
|
92
|
+
h2: {
|
|
93
|
+
fontSize: "2rem", // 32px
|
|
94
|
+
fontWeight: 600, // Semi-bold
|
|
95
|
+
lineHeight: 1.3,
|
|
96
|
+
letterSpacing: "-0.01em",
|
|
97
|
+
},
|
|
98
|
+
h3: {
|
|
99
|
+
fontSize: "1.75rem", // 28px
|
|
100
|
+
fontWeight: 600,
|
|
101
|
+
lineHeight: 1.4,
|
|
102
|
+
},
|
|
103
|
+
h4: {
|
|
104
|
+
fontSize: "1.5rem", // 24px
|
|
105
|
+
fontWeight: 500, // Medium
|
|
106
|
+
lineHeight: 1.4,
|
|
107
|
+
},
|
|
108
|
+
h5: {
|
|
109
|
+
fontSize: "1.25rem", // 20px
|
|
110
|
+
fontWeight: 500,
|
|
111
|
+
lineHeight: 1.5,
|
|
112
|
+
},
|
|
113
|
+
h6: {
|
|
114
|
+
fontSize: "1.125rem", // 18px
|
|
115
|
+
fontWeight: 500,
|
|
116
|
+
lineHeight: 1.5,
|
|
117
|
+
},
|
|
118
|
+
subtitle1: {
|
|
119
|
+
fontSize: "1rem", // 16px
|
|
120
|
+
fontWeight: 400, // Regular
|
|
121
|
+
lineHeight: 1.5,
|
|
122
|
+
letterSpacing: "0.01em",
|
|
123
|
+
},
|
|
124
|
+
subtitle2: {
|
|
125
|
+
fontSize: "0.875rem", // 14px
|
|
126
|
+
fontWeight: 500,
|
|
127
|
+
lineHeight: 1.57,
|
|
128
|
+
},
|
|
129
|
+
body1: {
|
|
130
|
+
fontSize: "1rem", // 16px
|
|
131
|
+
fontWeight: 400,
|
|
132
|
+
lineHeight: 1.5,
|
|
133
|
+
letterSpacing: "0.01em",
|
|
134
|
+
},
|
|
135
|
+
body2: {
|
|
136
|
+
fontSize: "0.875rem", // 14px
|
|
137
|
+
fontWeight: 400,
|
|
138
|
+
lineHeight: 1.43,
|
|
139
|
+
},
|
|
140
|
+
caption: {
|
|
141
|
+
fontSize: "0.75rem", // 12px
|
|
142
|
+
fontWeight: 400,
|
|
143
|
+
lineHeight: 1.66,
|
|
144
|
+
letterSpacing: "0.03em",
|
|
145
|
+
},
|
|
146
|
+
overline: {
|
|
147
|
+
fontSize: "0.75rem", // 12px
|
|
148
|
+
fontWeight: 400,
|
|
149
|
+
lineHeight: 2.66,
|
|
150
|
+
letterSpacing: "0.1em",
|
|
151
|
+
textTransform: "uppercase",
|
|
152
|
+
},
|
|
153
|
+
// You can also add custom variants
|
|
154
|
+
button: {
|
|
155
|
+
fontSize: "0.875rem",
|
|
156
|
+
fontWeight: 500,
|
|
157
|
+
lineHeight: 1.75,
|
|
158
|
+
letterSpacing: "0.03em",
|
|
159
|
+
textTransform: "uppercase",
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
`})}),`
|
|
164
|
+
`,e(n.h3,{children:"Available Typography Properties"}),`
|
|
165
|
+
`,e(n.p,{children:"Each typography variant can be customized with the following properties:"}),`
|
|
166
|
+
`,i(n.ul,{children:[`
|
|
167
|
+
`,i(n.li,{children:[e(n.strong,{children:"fontSize"}),": Font size (can be px, rem, em, etc.)"]}),`
|
|
168
|
+
`,i(n.li,{children:[e(n.strong,{children:"fontWeight"}),": Font weight (100-900, or 'light', 'normal', 'bold', etc.)"]}),`
|
|
169
|
+
`,i(n.li,{children:[e(n.strong,{children:"lineHeight"}),": Line height (can be unitless ratio or specific values)"]}),`
|
|
170
|
+
`,i(n.li,{children:[e(n.strong,{children:"letterSpacing"}),": Letter spacing (em, px, etc.)"]}),`
|
|
171
|
+
`,i(n.li,{children:[e(n.strong,{children:"fontFamily"}),": Font family"]}),`
|
|
172
|
+
`,i(n.li,{children:[e(n.strong,{children:"textTransform"}),": Text transformation ('none', 'uppercase', 'lowercase', 'capitalize')"]}),`
|
|
173
|
+
`,i(n.li,{children:[e(n.strong,{children:"fontStyle"}),": Font style ('normal', 'italic')"]}),`
|
|
174
|
+
`,i(n.li,{children:[e(n.strong,{children:"textDecoration"}),": Text decoration ('none', 'underline', 'line-through')"]}),`
|
|
175
|
+
`]}),`
|
|
176
|
+
`,e(n.h3,{children:"Responsive Typography"}),`
|
|
177
|
+
`,e(n.p,{children:"You can also create responsive typography that adapts to different screen sizes:"}),`
|
|
178
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`const theme = createTheme({
|
|
179
|
+
typography: {
|
|
180
|
+
h1: {
|
|
181
|
+
fontSize: "2rem", // Default for mobile
|
|
182
|
+
"@media (min-width:600px)": {
|
|
183
|
+
fontSize: "2.5rem", // Tablet and up
|
|
184
|
+
},
|
|
185
|
+
"@media (min-width:900px)": {
|
|
186
|
+
fontSize: "3rem", // Desktop and up
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
body1: {
|
|
190
|
+
fontSize: "0.875rem", // Mobile
|
|
191
|
+
"@media (min-width:600px)": {
|
|
192
|
+
fontSize: "1rem", // Tablet and up
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
`})}),`
|
|
198
|
+
`,e(n.h3,{children:"Custom Typography Variants"}),`
|
|
199
|
+
`,e(n.p,{children:"You can also create completely custom typography variants:"}),`
|
|
200
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`const theme = createTheme({
|
|
201
|
+
typography: {
|
|
202
|
+
// Custom variant
|
|
203
|
+
display1: {
|
|
204
|
+
fontSize: "3.5rem",
|
|
205
|
+
fontWeight: 300,
|
|
206
|
+
lineHeight: 1.1,
|
|
207
|
+
letterSpacing: "-0.02em",
|
|
208
|
+
fontFamily: '"Playfair Display", serif',
|
|
209
|
+
},
|
|
210
|
+
display2: {
|
|
211
|
+
fontSize: "2.8125rem",
|
|
212
|
+
fontWeight: 300,
|
|
213
|
+
lineHeight: 1.2,
|
|
214
|
+
letterSpacing: "-0.01em",
|
|
215
|
+
fontFamily: '"Playfair Display", serif',
|
|
216
|
+
},
|
|
217
|
+
// Custom utility variant
|
|
218
|
+
code: {
|
|
219
|
+
fontSize: "0.875rem",
|
|
220
|
+
fontWeight: 400,
|
|
221
|
+
lineHeight: 1.5,
|
|
222
|
+
fontFamily: '"Roboto Mono", monospace',
|
|
223
|
+
backgroundColor: "rgba(0, 0, 0, 0.04)",
|
|
224
|
+
padding: "2px 4px",
|
|
225
|
+
borderRadius: "4px",
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
`})}),`
|
|
230
|
+
`,e(n.h3,{children:"Using Custom Variants"}),`
|
|
231
|
+
`,e(n.p,{children:"After defining custom variants, you can use them like any other variant:"}),`
|
|
232
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="display1">
|
|
233
|
+
Custom Display Heading
|
|
234
|
+
</Typography>
|
|
235
|
+
|
|
236
|
+
<Typography variant="code">
|
|
237
|
+
const example = "This is code text";
|
|
238
|
+
</Typography>
|
|
239
|
+
`})}),`
|
|
240
|
+
`,e(n.h3,{children:"Complete Theme Example"}),`
|
|
241
|
+
`,e(n.p,{children:"Here's a complete example of how to integrate typography customization into your existing theme:"}),`
|
|
242
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`// src/themes/lightTheme.js
|
|
243
|
+
export const lightTheme = {
|
|
244
|
+
palette: {
|
|
245
|
+
// ... existing palette configuration
|
|
246
|
+
},
|
|
247
|
+
typography: {
|
|
248
|
+
fontFamily: '"Inter", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
249
|
+
h1: {
|
|
250
|
+
fontSize: "2.5rem",
|
|
251
|
+
fontWeight: 700,
|
|
252
|
+
lineHeight: 1.2,
|
|
253
|
+
letterSpacing: "-0.02em",
|
|
254
|
+
},
|
|
255
|
+
h2: {
|
|
256
|
+
fontSize: "2rem",
|
|
257
|
+
fontWeight: 600,
|
|
258
|
+
lineHeight: 1.3,
|
|
259
|
+
},
|
|
260
|
+
h3: {
|
|
261
|
+
fontSize: "1.75rem",
|
|
262
|
+
fontWeight: 600,
|
|
263
|
+
lineHeight: 1.4,
|
|
264
|
+
},
|
|
265
|
+
h4: {
|
|
266
|
+
fontSize: "1.5rem",
|
|
267
|
+
fontWeight: 500,
|
|
268
|
+
lineHeight: 1.4,
|
|
269
|
+
},
|
|
270
|
+
h5: {
|
|
271
|
+
fontSize: "1.25rem",
|
|
272
|
+
fontWeight: 500,
|
|
273
|
+
lineHeight: 1.5,
|
|
274
|
+
},
|
|
275
|
+
h6: {
|
|
276
|
+
fontSize: "1.125rem",
|
|
277
|
+
fontWeight: 500,
|
|
278
|
+
lineHeight: 1.5,
|
|
279
|
+
},
|
|
280
|
+
subtitle1: {
|
|
281
|
+
fontSize: "1rem",
|
|
282
|
+
fontWeight: 400,
|
|
283
|
+
lineHeight: 1.5,
|
|
284
|
+
},
|
|
285
|
+
subtitle2: {
|
|
286
|
+
fontSize: "0.875rem",
|
|
287
|
+
fontWeight: 500,
|
|
288
|
+
lineHeight: 1.57,
|
|
289
|
+
},
|
|
290
|
+
body1: {
|
|
291
|
+
fontSize: "1rem",
|
|
292
|
+
fontWeight: 400,
|
|
293
|
+
lineHeight: 1.5,
|
|
294
|
+
},
|
|
295
|
+
body2: {
|
|
296
|
+
fontSize: "0.875rem",
|
|
297
|
+
fontWeight: 400,
|
|
298
|
+
lineHeight: 1.43,
|
|
299
|
+
},
|
|
300
|
+
caption: {
|
|
301
|
+
fontSize: "0.75rem",
|
|
302
|
+
fontWeight: 400,
|
|
303
|
+
lineHeight: 1.66,
|
|
304
|
+
},
|
|
305
|
+
overline: {
|
|
306
|
+
fontSize: "0.75rem",
|
|
307
|
+
fontWeight: 400,
|
|
308
|
+
lineHeight: 2.66,
|
|
309
|
+
letterSpacing: "0.1em",
|
|
310
|
+
textTransform: "uppercase",
|
|
311
|
+
},
|
|
312
|
+
button: {
|
|
313
|
+
fontSize: "0.875rem",
|
|
314
|
+
fontWeight: 500,
|
|
315
|
+
lineHeight: 1.75,
|
|
316
|
+
letterSpacing: "0.03em",
|
|
317
|
+
textTransform: "uppercase",
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
`})}),`
|
|
322
|
+
`,e(n.h2,{children:"Colors"}),`
|
|
323
|
+
`,e(n.p,{children:"Typography supports different color schemes that integrate with your Material UI theme:"}),`
|
|
324
|
+
`,i(a,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e(t,{variant:"h6",color:"primary",children:"Primary Color Text"}),e(t,{variant:"h6",color:"secondary",children:"Secondary Color Text"}),e(t,{variant:"h6",color:"error",children:"Error Color Text"}),e(t,{variant:"h6",color:"warning",children:"Warning Color Text"}),e(t,{variant:"h6",color:"info",children:"Info Color Text"}),e(t,{variant:"h6",color:"success",children:"Success Color Text"}),e(t,{variant:"h6",color:"text.primary",children:"Text Primary"}),e(t,{variant:"h6",color:"text.secondary",children:"Text Secondary"})]}),`
|
|
325
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="h6" color="primary">
|
|
326
|
+
Primary Color Text
|
|
327
|
+
</Typography>
|
|
328
|
+
<Typography variant="h6" color="secondary">
|
|
329
|
+
Secondary Color Text
|
|
330
|
+
</Typography>
|
|
331
|
+
<Typography variant="h6" color="error">
|
|
332
|
+
Error Color Text
|
|
333
|
+
</Typography>
|
|
334
|
+
<Typography variant="h6" color="warning">
|
|
335
|
+
Warning Color Text
|
|
336
|
+
</Typography>
|
|
337
|
+
<Typography variant="h6" color="info">
|
|
338
|
+
Info Color Text
|
|
339
|
+
</Typography>
|
|
340
|
+
<Typography variant="h6" color="success">
|
|
341
|
+
Success Color Text
|
|
342
|
+
</Typography>
|
|
343
|
+
<Typography variant="h6" color="text.primary">
|
|
344
|
+
Text Primary
|
|
345
|
+
</Typography>
|
|
346
|
+
<Typography variant="h6" color="text.secondary">
|
|
347
|
+
Text Secondary
|
|
348
|
+
</Typography>
|
|
349
|
+
`})}),`
|
|
350
|
+
`,e(n.h2,{children:"Alignment"}),`
|
|
351
|
+
`,e(n.p,{children:"Typography components can be aligned in different ways:"}),`
|
|
352
|
+
`,i(a,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e(t,{variant:"h6",align:"left",children:"Left Aligned Text"}),e(t,{variant:"h6",align:"center",children:"Center Aligned Text"}),e(t,{variant:"h6",align:"right",children:"Right Aligned Text"}),e(t,{variant:"h6",align:"justify",children:`Justified Text - This text is justified to create even margins on both
|
|
353
|
+
sides. It's useful for creating clean, professional-looking paragraphs.`})]}),`
|
|
354
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="h6" align="left">
|
|
355
|
+
Left Aligned Text
|
|
356
|
+
</Typography>
|
|
357
|
+
<Typography variant="h6" align="center">
|
|
358
|
+
Center Aligned Text
|
|
359
|
+
</Typography>
|
|
360
|
+
<Typography variant="h6" align="right">
|
|
361
|
+
Right Aligned Text
|
|
362
|
+
</Typography>
|
|
363
|
+
`})}),`
|
|
364
|
+
`,e(n.h2,{children:"Common Props"}),`
|
|
365
|
+
`,e(n.p,{children:"The Typography component accepts various props to customize its appearance and behavior:"}),`
|
|
366
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography
|
|
367
|
+
variant="body1" // 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2' | 'body1' | 'body2' | 'caption' | 'overline'
|
|
368
|
+
color="text.primary" // 'initial' | 'inherit' | 'primary' | 'secondary' | 'text.primary' | 'text.secondary' | 'error' | 'warning' | 'info' | 'success'
|
|
369
|
+
align="inherit" // 'inherit' | 'left' | 'center' | 'right' | 'justify'
|
|
370
|
+
gutterBottom={false} // boolean - adds bottom margin
|
|
371
|
+
noWrap={false} // boolean - prevents text wrapping
|
|
372
|
+
paragraph={false} // boolean - adds bottom margin (same as gutterBottom)
|
|
373
|
+
display="initial" // 'initial' | 'block' | 'inline'
|
|
374
|
+
variantMapping={{}} // object - maps variants to HTML elements
|
|
375
|
+
>
|
|
376
|
+
Typography content
|
|
377
|
+
</Typography>
|
|
378
|
+
`})}),`
|
|
379
|
+
`,e(n.h2,{children:"Accessibility"}),`
|
|
380
|
+
`,e(n.p,{children:"Material UI typography components are built with accessibility in mind:"}),`
|
|
381
|
+
`,i(n.ul,{children:[`
|
|
382
|
+
`,i(n.li,{children:[e(n.strong,{children:"Semantic HTML"}),": Each variant maps to the appropriate HTML element (h1, h2, p, etc.)"]}),`
|
|
383
|
+
`,i(n.li,{children:[e(n.strong,{children:"Screen readers"}),": Proper heading hierarchy and semantic structure"]}),`
|
|
384
|
+
`,i(n.li,{children:[e(n.strong,{children:"Color contrast"}),": Meets WCAG guidelines for text contrast ratios"]}),`
|
|
385
|
+
`,i(n.li,{children:[e(n.strong,{children:"Focus indicators"}),": Clear visual focus indicators for keyboard navigation"]}),`
|
|
386
|
+
`]}),`
|
|
387
|
+
`,e(n.h2,{children:"Best Practices"}),`
|
|
388
|
+
`,i(n.ol,{children:[`
|
|
389
|
+
`,i(n.li,{children:[e(n.strong,{children:"Use proper heading hierarchy"})," - Start with h1 for the main title, then h2, h3, etc."]}),`
|
|
390
|
+
`,i(n.li,{children:[e(n.strong,{children:"Choose appropriate variants"})," - Use body1 for main content, body2 for secondary text"]}),`
|
|
391
|
+
`,i(n.li,{children:[e(n.strong,{children:"Maintain consistent spacing"})," - Let natural document flow handle spacing"]}),`
|
|
392
|
+
`,i(n.li,{children:[e(n.strong,{children:"Consider color contrast"})," - Ensure text is readable in both light and dark modes"]}),`
|
|
393
|
+
`,i(n.li,{children:[e(n.strong,{children:"Use semantic meaning"})," - Choose variants based on content meaning, not just appearance"]}),`
|
|
394
|
+
`,i(n.li,{children:[e(n.strong,{children:"Customize systematically"})," - When customizing typography, maintain consistency across variants"]}),`
|
|
395
|
+
`,i(n.li,{children:[e(n.strong,{children:"Test readability"})," - Ensure your custom font sizes and weights maintain good readability"]}),`
|
|
396
|
+
`,i(n.li,{children:[e(n.strong,{children:"Consider responsive design"})," - Use responsive typography for better mobile experience"]}),`
|
|
397
|
+
`]}),`
|
|
398
|
+
`,e(n.h2,{children:"Examples"}),`
|
|
399
|
+
`,e(n.h3,{children:"Article Layout"}),`
|
|
400
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="h1">
|
|
401
|
+
Article Title
|
|
402
|
+
</Typography>
|
|
403
|
+
<Typography variant="subtitle1" color="text.secondary">
|
|
404
|
+
Article subtitle or description
|
|
405
|
+
</Typography>
|
|
406
|
+
<Typography variant="body1">
|
|
407
|
+
This is the main content of the article. It uses body1 for optimal readability.
|
|
408
|
+
</Typography>
|
|
409
|
+
<Typography variant="body2" color="text.secondary">
|
|
410
|
+
Additional information or metadata
|
|
411
|
+
</Typography>
|
|
412
|
+
`})}),`
|
|
413
|
+
`,e(n.h3,{children:"Form Labels"}),`
|
|
414
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="subtitle2">
|
|
415
|
+
Form Section Title
|
|
416
|
+
</Typography>
|
|
417
|
+
<Typography variant="body2" color="text.secondary">
|
|
418
|
+
Form field description or help text
|
|
419
|
+
</Typography>
|
|
420
|
+
`})}),`
|
|
421
|
+
`,e(n.h3,{children:"Error Messages"}),`
|
|
422
|
+
`,e(n.pre,{children:e(n.code,{className:"language-jsx",children:`<Typography variant="body2" color="error">
|
|
423
|
+
This field is required
|
|
424
|
+
</Typography>
|
|
425
|
+
`})}),`
|
|
426
|
+
`,e(n.h2,{children:"Documentation"}),`
|
|
427
|
+
`,i(n.ul,{children:[`
|
|
428
|
+
`,e(n.li,{children:e(n.a,{href:"https://mui.com/material-ui/react-typography/",children:"Material UI - Typography"})}),`
|
|
429
|
+
`]})]})}function g(r={}){const{wrapper:n}={...l(),...r.components};return n?e(n,{...r,children:e(o,{...r})}):o(r)}export{g as default};
|
package/dist/index.html
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<meta name="description" content="MDX-powered documentation" />
|
|
8
|
+
<title>MDX Docs</title>
|
|
9
|
+
<meta property="og:site_name" content="MDX Docs" />
|
|
10
|
+
<meta property="og:title" content="MDX Docs" />
|
|
11
|
+
<meta property="og:description" content="A lightweight React framework for MDX documentation sites." />
|
|
12
|
+
<meta property="og:image" content="https://mdxdocs.com/icon.svg" />
|
|
13
|
+
<meta property="og:url" content="https://mdxdocs.com/" />
|
|
14
|
+
<meta property="og:type" content="website" />
|
|
15
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
16
|
+
<meta name="twitter:title" content="MDX Docs" />
|
|
17
|
+
<meta name="twitter:description" content="A lightweight React framework for MDX documentation sites." />
|
|
18
|
+
<meta name="twitter:image" content="https://mdxdocs.com/og-image.png" />
|
|
19
|
+
<meta name="theme-color" content="#7c3aed" />
|
|
20
|
+
<script type="module" crossorigin src="/assets/index-C5FzG5L5.js"></script>
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/react-vendor-BVjvCnQb.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/prism-DjoQ0BfU.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/router-d4Dt6g8h.js">
|
|
24
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Do1AlBnD.css">
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<div id="root"></div>
|
|
28
|
+
</body>
|
|
29
|
+
</html>
|
package/package.json
CHANGED
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::selection{background-color:#1976d233;color:inherit}::-moz-selection{background-color:#1976d233;color:inherit}@media (prefers-color-scheme: dark){::selection{background-color:#90caf94d;color:inherit}::-moz-selection{background-color:#90caf94d;color:inherit}}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}html,body{min-height:100vh;width:100%;margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}@media (max-width: 768px){h1{font-size:2em}}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}@media (max-width: 600px){*{word-wrap:break-word;overflow-wrap:break-word}body{word-wrap:break-word;overflow-wrap:break-word;overflow-x:hidden}pre,code{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}h1,h2,h3,h4,h5,h6,p{word-wrap:break-word;overflow-wrap:break-word}}@media (max-width: 378px){html,body{overflow-x:hidden;width:100%}*{word-wrap:break-word;overflow-wrap:break-word;max-width:100%}pre,code{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word;max-width:100%}}
|