@delightui/components 0.1.105 → 0.1.107
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 +104 -1
- package/dist/cjs/components/molecules/Modal/DemoModal.d.ts +8 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/index.d.ts +3 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
- package/dist/cjs/components/molecules/Modal/index.d.ts +2 -0
- package/dist/cjs/components/molecules/index.d.ts +2 -0
- package/dist/cjs/library.css +19 -6
- package/dist/cjs/library.js +3 -3
- package/dist/cjs/library.js.map +1 -1
- package/dist/esm/components/molecules/Modal/DemoModal.d.ts +8 -0
- package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
- package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
- package/dist/esm/components/molecules/Modal/ModalContext/index.d.ts +3 -0
- package/dist/esm/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
- package/dist/esm/components/molecules/Modal/index.d.ts +2 -0
- package/dist/esm/components/molecules/index.d.ts +2 -0
- package/dist/esm/library.css +19 -6
- package/dist/esm/library.js +3 -3
- package/dist/esm/library.js.map +1 -1
- package/dist/index.d.ts +108 -2
- package/docs/README.md +264 -0
- package/docs/components/atoms/ActionImage.md +119 -0
- package/docs/components/atoms/Button.md +197 -0
- package/docs/components/atoms/Checkbox.md +299 -0
- package/docs/components/atoms/CheckboxItem.md +314 -0
- package/docs/components/atoms/Chip.md +380 -0
- package/docs/components/atoms/CustomToggle.md +270 -0
- package/docs/components/atoms/Icon.md +365 -0
- package/docs/components/atoms/IconButton.md +407 -0
- package/docs/components/atoms/Image.md +448 -0
- package/docs/components/atoms/Input.md +430 -0
- package/docs/components/atoms/ListItem.md +502 -0
- package/docs/components/atoms/Password.md +472 -0
- package/docs/components/atoms/RadioButton.md +614 -0
- package/docs/components/atoms/RadioButtonItem.md +588 -0
- package/docs/components/atoms/ResponsiveComponent.md +612 -0
- package/docs/components/atoms/SelectListItem.md +609 -0
- package/docs/components/atoms/Slider.md +605 -0
- package/docs/components/atoms/Spinner.md +605 -0
- package/docs/components/atoms/Text.md +463 -0
- package/docs/components/atoms/TextArea.md +670 -0
- package/docs/components/atoms/ToastNotification.md +668 -0
- package/docs/components/atoms/Toggle.md +737 -0
- package/docs/components/atoms/ToggleButton.md +751 -0
- package/docs/components/atoms/Tooltip.md +391 -0
- package/docs/components/molecules/Accordion.md +440 -0
- package/docs/components/molecules/AccordionGroup.md +547 -0
- package/docs/components/molecules/ActionCard.md +546 -0
- package/docs/components/molecules/Breadcrumb.md +403 -0
- package/docs/components/molecules/Breadcrumbs.md +485 -0
- package/docs/components/molecules/ButtonGroup.md +383 -0
- package/docs/components/molecules/Card.md +298 -0
- package/docs/components/molecules/ChipInput.md +646 -0
- package/docs/components/molecules/ContextMenu.md +768 -0
- package/docs/components/molecules/CustomTimeSelector.md +116 -0
- package/docs/components/molecules/DatePicker.md +516 -0
- package/docs/components/molecules/DateTimeSelector.md +166 -0
- package/docs/components/molecules/FormField.md +312 -0
- package/docs/components/molecules/Grid.md +577 -0
- package/docs/components/molecules/GridItem.md +834 -0
- package/docs/components/molecules/GridList.md +244 -0
- package/docs/components/molecules/List.md +485 -0
- package/docs/components/molecules/Modal.md +470 -0
- package/docs/components/molecules/ModalFooter.md +702 -0
- package/docs/components/molecules/ModalHeader.md +756 -0
- package/docs/components/molecules/ModalProvider.md +205 -0
- package/docs/components/molecules/Nav.md +530 -0
- package/docs/components/molecules/NavItem.md +572 -0
- package/docs/components/molecules/NavLink.md +499 -0
- package/docs/components/molecules/Option.md +521 -0
- package/docs/components/molecules/Pagination.md +592 -0
- package/docs/components/molecules/PaginationNumberField.md +722 -0
- package/docs/components/molecules/Popover.md +516 -0
- package/docs/components/molecules/ProgressBar.md +624 -0
- package/docs/components/molecules/RadioGroup.md +831 -0
- package/docs/components/molecules/RepeaterList.md +185 -0
- package/docs/components/molecules/Select.md +402 -0
- package/docs/components/molecules/SortableTrigger.md +82 -0
- package/docs/components/molecules/useModal.md +379 -0
- package/docs/components/organisms/Dropzone.md +346 -0
- package/docs/components/organisms/DropzoneClear.md +135 -0
- package/docs/components/organisms/DropzoneContent.md +216 -0
- package/docs/components/organisms/DropzoneFilename.md +191 -0
- package/docs/components/organisms/DropzoneSupportedFormats.md +184 -0
- package/docs/components/organisms/DropzoneTrigger.md +209 -0
- package/docs/components/organisms/Form.md +533 -0
- package/docs/components/organisms/SlideOutPanel.md +662 -0
- package/docs/components/organisms/TabContent.md +902 -0
- package/docs/components/organisms/TabItem.md +1091 -0
- package/docs/components/organisms/Table.md +611 -0
- package/docs/components/organisms/TableBody.md +679 -0
- package/docs/components/organisms/TableCell.md +482 -0
- package/docs/components/organisms/TableHeader.md +513 -0
- package/docs/components/organisms/TableHeaderCell.md +661 -0
- package/docs/components/organisms/TableRow.md +715 -0
- package/docs/components/organisms/Tabs.md +1330 -0
- package/docs/components/utils/ConditionalView.md +568 -0
- package/docs/components/utils/RenderStateView.md +726 -0
- package/docs/components/utils/WrapTextNodes.md +614 -0
- package/package.json +3 -2
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
# Text
|
|
2
|
+
|
|
3
|
+
A comprehensive text component that provides a standardized way to display text content with consistent typography. It offers extensive customization options including different text types, weights, decorations, transformations, and layout controls, making it the foundation for all text display in the UI.
|
|
4
|
+
|
|
5
|
+
## Aliases
|
|
6
|
+
|
|
7
|
+
- Text
|
|
8
|
+
- Typography
|
|
9
|
+
- TextElement
|
|
10
|
+
|
|
11
|
+
## Props Breakdown
|
|
12
|
+
|
|
13
|
+
**Extends:** Standalone interface (no HTML element inheritance)
|
|
14
|
+
|
|
15
|
+
| Prop | Type | Default | Required | Description |
|
|
16
|
+
|------|------|---------|----------|-------------|
|
|
17
|
+
| `className` | `string` | `undefined` | No | Additional class for styling |
|
|
18
|
+
| `type` | `'Heading1' \| 'Heading2' \| 'Heading3' \| 'Heading4' \| 'Heading5' \| 'Heading6' \| 'BodyLarge' \| 'BodyMedium' \| 'BodySmall'` | `'BodyMedium'` | No | Type of the text |
|
|
19
|
+
| `weight` | `'Thin' \| 'ExtraLight' \| 'Light' \| 'Regular' \| 'Medium' \| 'SemiBold' \| 'Bold' \| 'ExtraBold' \| 'Black' \| 'ExtraBlack' \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 950` | `'Regular'` | No | Weight of the text |
|
|
20
|
+
| `children` | `ReactNode` | `undefined` | No | The content to be displayed as text |
|
|
21
|
+
| `noWrap` | `boolean` | `false` | No | Flag to prevent text from wrapping |
|
|
22
|
+
| `whiteSpaceNoWrap` | `boolean` | `false` | No | Flag to handle how white space inside an element is handled |
|
|
23
|
+
| `italic` | `boolean` | `false` | No | Flag to italicize the text |
|
|
24
|
+
| `decoration` | `'None' \| 'Underline' \| 'Strikethrough'` | `'None'` | No | Decoration style for the text |
|
|
25
|
+
| `ellipsis` | `boolean` | `false` | No | Flag to show ellipsis for overflowing text |
|
|
26
|
+
| `transform` | `'None' \| 'Capitalize' \| 'UpperCase' \| 'LowerCase'` | `'None'` | No | Transform style for the text |
|
|
27
|
+
| `as` | `React.ElementType` | `undefined` | No | Modify the element type used for rendering |
|
|
28
|
+
|
|
29
|
+
This component uses a polymorphic `as` prop to render different HTML elements while maintaining consistent styling.
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
### Basic Text Types
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { Text } from '@delightui/components';
|
|
37
|
+
|
|
38
|
+
function BasicTextTypesExample() {
|
|
39
|
+
return (
|
|
40
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
41
|
+
<Text type="Heading1">Heading 1 Text</Text>
|
|
42
|
+
<Text type="Heading2">Heading 2 Text</Text>
|
|
43
|
+
<Text type="Heading3">Heading 3 Text</Text>
|
|
44
|
+
<Text type="Heading4">Heading 4 Text</Text>
|
|
45
|
+
<Text type="Heading5">Heading 5 Text</Text>
|
|
46
|
+
<Text type="Heading6">Heading 6 Text</Text>
|
|
47
|
+
<Text type="BodyLarge">Body Large Text</Text>
|
|
48
|
+
<Text type="BodyMedium">Body Medium Text (Default)</Text>
|
|
49
|
+
<Text type="BodySmall">Body Small Text</Text>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Text Weights
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { Text } from '@delightui/components';
|
|
59
|
+
|
|
60
|
+
function TextWeightsExample() {
|
|
61
|
+
return (
|
|
62
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
63
|
+
<Text weight="Thin">Thin Weight (100)</Text>
|
|
64
|
+
<Text weight="ExtraLight">Extra Light Weight (200)</Text>
|
|
65
|
+
<Text weight="Light">Light Weight (300)</Text>
|
|
66
|
+
<Text weight="Regular">Regular Weight (400)</Text>
|
|
67
|
+
<Text weight="Medium">Medium Weight (500)</Text>
|
|
68
|
+
<Text weight="SemiBold">Semi Bold Weight (600)</Text>
|
|
69
|
+
<Text weight="Bold">Bold Weight (700)</Text>
|
|
70
|
+
<Text weight="ExtraBold">Extra Bold Weight (800)</Text>
|
|
71
|
+
<Text weight="Black">Black Weight (900)</Text>
|
|
72
|
+
<Text weight="ExtraBlack">Extra Black Weight (950)</Text>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Numeric Font Weights
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { Text } from '@delightui/components';
|
|
82
|
+
|
|
83
|
+
function NumericWeightsExample() {
|
|
84
|
+
return (
|
|
85
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
86
|
+
<Text weight={100}>Weight 100</Text>
|
|
87
|
+
<Text weight={200}>Weight 200</Text>
|
|
88
|
+
<Text weight={300}>Weight 300</Text>
|
|
89
|
+
<Text weight={400}>Weight 400</Text>
|
|
90
|
+
<Text weight={500}>Weight 500</Text>
|
|
91
|
+
<Text weight={600}>Weight 600</Text>
|
|
92
|
+
<Text weight={700}>Weight 700</Text>
|
|
93
|
+
<Text weight={800}>Weight 800</Text>
|
|
94
|
+
<Text weight={900}>Weight 900</Text>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Text Decorations
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import { Text } from '@delightui/components';
|
|
104
|
+
|
|
105
|
+
function TextDecorationsExample() {
|
|
106
|
+
return (
|
|
107
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
|
|
108
|
+
<Text decoration="None">Normal text without decoration</Text>
|
|
109
|
+
<Text decoration="Underline">Underlined text</Text>
|
|
110
|
+
<Text decoration="Strikethrough">Strikethrough text</Text>
|
|
111
|
+
|
|
112
|
+
<Text decoration="Underline" weight="Bold">
|
|
113
|
+
Bold underlined text
|
|
114
|
+
</Text>
|
|
115
|
+
|
|
116
|
+
<Text decoration="Strikethrough" italic>
|
|
117
|
+
Italic strikethrough text
|
|
118
|
+
</Text>
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Text Transformations
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
import { Text } from '@delightui/components';
|
|
128
|
+
|
|
129
|
+
function TextTransformationsExample() {
|
|
130
|
+
const sampleText = "this is sample text for transformation";
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
|
|
134
|
+
<Text transform="None">{sampleText}</Text>
|
|
135
|
+
<Text transform="Capitalize">{sampleText}</Text>
|
|
136
|
+
<Text transform="UpperCase">{sampleText}</Text>
|
|
137
|
+
<Text transform="LowerCase">{sampleText.toUpperCase()}</Text>
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Italic Text
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { Text } from '@delightui/components';
|
|
147
|
+
|
|
148
|
+
function ItalicTextExample() {
|
|
149
|
+
return (
|
|
150
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
|
|
151
|
+
<Text>Normal text</Text>
|
|
152
|
+
<Text italic>Italic text</Text>
|
|
153
|
+
<Text italic weight="Bold">Bold italic text</Text>
|
|
154
|
+
<Text italic type="Heading3">Italic heading</Text>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Text Wrapping and Ellipsis
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
import { Text } from '@delightui/components';
|
|
164
|
+
|
|
165
|
+
function TextWrappingExample() {
|
|
166
|
+
const longText = "This is a very long text that will demonstrate how the text wrapping and ellipsis properties work with different configurations.";
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
|
|
170
|
+
<div style={{ width: '250px', border: '1px solid #ccc', padding: '12px' }}>
|
|
171
|
+
<Text weight="Bold" style={{ marginBottom: '8px' }}>Normal Wrapping:</Text>
|
|
172
|
+
<Text>{longText}</Text>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<div style={{ width: '250px', border: '1px solid #ccc', padding: '12px' }}>
|
|
176
|
+
<Text weight="Bold" style={{ marginBottom: '8px' }}>No Wrap:</Text>
|
|
177
|
+
<Text noWrap>{longText}</Text>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<div style={{ width: '250px', border: '1px solid #ccc', padding: '12px' }}>
|
|
181
|
+
<Text weight="Bold" style={{ marginBottom: '8px' }}>With Ellipsis:</Text>
|
|
182
|
+
<Text ellipsis>{longText}</Text>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div style={{ width: '250px', border: '1px solid #ccc', padding: '12px' }}>
|
|
186
|
+
<Text weight="Bold" style={{ marginBottom: '8px' }}>White Space No Wrap:</Text>
|
|
187
|
+
<Text whiteSpaceNoWrap>{"Text with multiple spaces preserved"}</Text>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Semantic HTML Elements
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
import { Text } from '@delightui/components';
|
|
198
|
+
|
|
199
|
+
function SemanticElementsExample() {
|
|
200
|
+
return (
|
|
201
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
202
|
+
<Text as="h1" type="Heading1">Rendered as H1</Text>
|
|
203
|
+
<Text as="h2" type="Heading2">Rendered as H2</Text>
|
|
204
|
+
<Text as="h3" type="Heading3">Rendered as H3</Text>
|
|
205
|
+
<Text as="p" type="BodyLarge">Rendered as Paragraph</Text>
|
|
206
|
+
<Text as="span" type="BodyMedium">Rendered as Span</Text>
|
|
207
|
+
|
|
208
|
+
<div>
|
|
209
|
+
<Text as="strong" weight="Bold">Strong element</Text> within normal text
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<div>
|
|
213
|
+
<Text as="em" italic>Emphasized element</Text> within normal text
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Complex Text Combinations
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
import { Text } from '@delightui/components';
|
|
224
|
+
|
|
225
|
+
function ComplexTextExample() {
|
|
226
|
+
return (
|
|
227
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
|
|
228
|
+
<Text
|
|
229
|
+
type="Heading2"
|
|
230
|
+
weight="Bold"
|
|
231
|
+
decoration="Underline"
|
|
232
|
+
transform="Capitalize"
|
|
233
|
+
>
|
|
234
|
+
complex heading with multiple styles
|
|
235
|
+
</Text>
|
|
236
|
+
|
|
237
|
+
<Text
|
|
238
|
+
type="BodyLarge"
|
|
239
|
+
weight="Medium"
|
|
240
|
+
italic
|
|
241
|
+
decoration="None"
|
|
242
|
+
>
|
|
243
|
+
This is a medium-weight, italic body text that demonstrates multiple styling options combined together.
|
|
244
|
+
</Text>
|
|
245
|
+
|
|
246
|
+
<div style={{ width: '300px', border: '1px solid #ccc', padding: '12px' }}>
|
|
247
|
+
<Text
|
|
248
|
+
type="BodySmall"
|
|
249
|
+
weight="SemiBold"
|
|
250
|
+
transform="UpperCase"
|
|
251
|
+
ellipsis
|
|
252
|
+
>
|
|
253
|
+
This uppercase text will be truncated with ellipsis when it overflows the container width
|
|
254
|
+
</Text>
|
|
255
|
+
</div>
|
|
256
|
+
|
|
257
|
+
<Text
|
|
258
|
+
type="Heading4"
|
|
259
|
+
weight="Light"
|
|
260
|
+
decoration="Strikethrough"
|
|
261
|
+
transform="LowerCase"
|
|
262
|
+
>
|
|
263
|
+
LIGHT WEIGHT HEADING WITH STRIKETHROUGH
|
|
264
|
+
</Text>
|
|
265
|
+
</div>
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Article Layout Example
|
|
271
|
+
|
|
272
|
+
```tsx
|
|
273
|
+
import { Text, List, ListItem } from '@delightui/components';
|
|
274
|
+
|
|
275
|
+
function ArticleLayoutExample() {
|
|
276
|
+
return (
|
|
277
|
+
<article style={{ maxWidth: '600px', lineHeight: 1.6 }}>
|
|
278
|
+
<Text as="h1" type="Heading1" weight="Bold" style={{ marginBottom: '8px' }}>
|
|
279
|
+
The Future of Web Development
|
|
280
|
+
</Text>
|
|
281
|
+
|
|
282
|
+
<Text as="p" type="BodySmall" weight="Medium" style={{ marginBottom: '24px', color: '#666' }}>
|
|
283
|
+
Published on March 15, 2024 by John Doe
|
|
284
|
+
</Text>
|
|
285
|
+
|
|
286
|
+
<Text as="h2" type="Heading3" weight="SemiBold" style={{ marginBottom: '12px', marginTop: '24px' }}>
|
|
287
|
+
Introduction
|
|
288
|
+
</Text>
|
|
289
|
+
|
|
290
|
+
<Text as="p" type="BodyMedium" style={{ marginBottom: '16px' }}>
|
|
291
|
+
Web development continues to evolve at a rapid pace, with new technologies and frameworks
|
|
292
|
+
emerging regularly. In this article, we'll explore the trends that are shaping the future
|
|
293
|
+
of how we build web applications.
|
|
294
|
+
</Text>
|
|
295
|
+
|
|
296
|
+
<Text as="h2" type="Heading3" weight="SemiBold" style={{ marginBottom: '12px', marginTop: '24px' }}>
|
|
297
|
+
Key Technologies
|
|
298
|
+
</Text>
|
|
299
|
+
|
|
300
|
+
<Text as="p" type="BodyMedium" style={{ marginBottom: '12px' }}>
|
|
301
|
+
Several technologies are driving innovation in web development:
|
|
302
|
+
</Text>
|
|
303
|
+
|
|
304
|
+
<List style={{ marginBottom: '16px' }}>
|
|
305
|
+
<ListItem><Text as="span" type="BodyMedium" weight="Medium">React and Vue.js</Text> - Component-based frameworks</ListItem>
|
|
306
|
+
<ListItem><Text as="span" type="BodyMedium" weight="Medium">TypeScript</Text> - Type-safe JavaScript development</ListItem>
|
|
307
|
+
<ListItem><Text as="span" type="BodyMedium" weight="Medium">WebAssembly</Text> - High-performance web applications</ListItem>
|
|
308
|
+
</List>
|
|
309
|
+
|
|
310
|
+
<Text as="blockquote" type="BodyLarge" italic style={{
|
|
311
|
+
borderLeft: '4px solid #007bff',
|
|
312
|
+
paddingLeft: '16px',
|
|
313
|
+
margin: '20px 0',
|
|
314
|
+
color: '#555'
|
|
315
|
+
}}>
|
|
316
|
+
"The future of web development lies in creating more interactive, performant, and accessible experiences for users across all devices."
|
|
317
|
+
</Text>
|
|
318
|
+
|
|
319
|
+
<Text as="h2" type="Heading3" weight="SemiBold" style={{ marginBottom: '12px', marginTop: '24px' }}>
|
|
320
|
+
Conclusion
|
|
321
|
+
</Text>
|
|
322
|
+
|
|
323
|
+
<Text as="p" type="BodyMedium" style={{ marginBottom: '16px' }}>
|
|
324
|
+
As we look ahead, the emphasis on <Text as="strong" weight="Bold">performance</Text>,
|
|
325
|
+
<Text as="em" italic> accessibility</Text>, and <Text decoration="Underline">user experience</Text> will
|
|
326
|
+
continue to drive innovation in web development practices and tools.
|
|
327
|
+
</Text>
|
|
328
|
+
</article>
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Status and Alert Text
|
|
334
|
+
|
|
335
|
+
```tsx
|
|
336
|
+
import { Text } from '@delightui/components';
|
|
337
|
+
|
|
338
|
+
function StatusTextExample() {
|
|
339
|
+
return (
|
|
340
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
341
|
+
<div style={{ padding: '12px', backgroundColor: '#d4edda', borderRadius: '4px' }}>
|
|
342
|
+
<Text weight="Bold" style={{ color: '#155724' }}>
|
|
343
|
+
Success: Operation completed successfully
|
|
344
|
+
</Text>
|
|
345
|
+
</div>
|
|
346
|
+
|
|
347
|
+
<div style={{ padding: '12px', backgroundColor: '#f8d7da', borderRadius: '4px' }}>
|
|
348
|
+
<Text weight="Bold" style={{ color: '#721c24' }}>
|
|
349
|
+
Error: Something went wrong
|
|
350
|
+
</Text>
|
|
351
|
+
</div>
|
|
352
|
+
|
|
353
|
+
<div style={{ padding: '12px', backgroundColor: '#fff3cd', borderRadius: '4px' }}>
|
|
354
|
+
<Text weight="Bold" style={{ color: '#856404' }}>
|
|
355
|
+
Warning: Please review your input
|
|
356
|
+
</Text>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
<div style={{ padding: '12px', backgroundColor: '#d1ecf1', borderRadius: '4px' }}>
|
|
360
|
+
<Text weight="Bold" style={{ color: '#0c5460' }}>
|
|
361
|
+
Info: Additional information available
|
|
362
|
+
</Text>
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Card Content Example
|
|
370
|
+
|
|
371
|
+
```tsx
|
|
372
|
+
import { Text, Button } from '@delightui/components';
|
|
373
|
+
|
|
374
|
+
function CardContentExample() {
|
|
375
|
+
return (
|
|
376
|
+
<div style={{
|
|
377
|
+
border: '1px solid #ccc',
|
|
378
|
+
borderRadius: '8px',
|
|
379
|
+
padding: '20px',
|
|
380
|
+
maxWidth: '350px',
|
|
381
|
+
backgroundColor: '#fff'
|
|
382
|
+
}}>
|
|
383
|
+
<Text as="h3" type="Heading4" weight="Bold" style={{ marginBottom: '8px' }}>
|
|
384
|
+
Product Title
|
|
385
|
+
</Text>
|
|
386
|
+
|
|
387
|
+
<Text type="BodySmall" weight="Medium" style={{ color: '#666', marginBottom: '12px' }}>
|
|
388
|
+
Category: Electronics
|
|
389
|
+
</Text>
|
|
390
|
+
|
|
391
|
+
<Text type="BodyMedium" style={{ marginBottom: '16px', lineHeight: 1.5 }}>
|
|
392
|
+
This is a detailed description of the product that explains its features,
|
|
393
|
+
benefits, and why customers should consider purchasing it.
|
|
394
|
+
</Text>
|
|
395
|
+
|
|
396
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '16px' }}>
|
|
397
|
+
<Text type="Heading4" weight="Bold" style={{ color: '#007bff' }}>
|
|
398
|
+
$299.99
|
|
399
|
+
</Text>
|
|
400
|
+
<Text type="BodySmall" decoration="Strikethrough" style={{ color: '#999' }}>
|
|
401
|
+
$399.99
|
|
402
|
+
</Text>
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
<Text type="BodySmall" weight="SemiBold" transform="UpperCase" style={{
|
|
406
|
+
color: '#28a745',
|
|
407
|
+
marginBottom: '16px'
|
|
408
|
+
}}>
|
|
409
|
+
In Stock
|
|
410
|
+
</Text>
|
|
411
|
+
|
|
412
|
+
<Button style={{ width: '100%' }}>
|
|
413
|
+
Add to Cart
|
|
414
|
+
</Button>
|
|
415
|
+
</div>
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
### Form Labels and Help Text
|
|
421
|
+
|
|
422
|
+
```tsx
|
|
423
|
+
import { Text, Input, Button, FormField, Form } from '@delightui/components';
|
|
424
|
+
|
|
425
|
+
function FormTextExample() {
|
|
426
|
+
return (
|
|
427
|
+
<Form onSubmit={(data) => console.log(data)}>
|
|
428
|
+
<FormField name="username" label="Username" required>
|
|
429
|
+
<Input placeholder="Enter your username" />
|
|
430
|
+
</FormField>
|
|
431
|
+
|
|
432
|
+
<div style={{ marginTop: '8px', marginBottom: '16px' }}>
|
|
433
|
+
<Text type="BodySmall" style={{ color: '#666' }}>
|
|
434
|
+
Username must be 3-20 characters long and contain only letters, numbers, and underscores.
|
|
435
|
+
</Text>
|
|
436
|
+
</div>
|
|
437
|
+
|
|
438
|
+
<FormField name="email" label="Email Address" required>
|
|
439
|
+
<Input inputType="Email" placeholder="Enter your email" />
|
|
440
|
+
</FormField>
|
|
441
|
+
|
|
442
|
+
<div style={{ marginTop: '8px', marginBottom: '16px' }}>
|
|
443
|
+
<Text type="BodySmall" style={{ color: '#666' }}>
|
|
444
|
+
We'll never share your email with anyone else.
|
|
445
|
+
</Text>
|
|
446
|
+
</div>
|
|
447
|
+
|
|
448
|
+
<Text type="BodySmall" style={{ color: '#666', marginBottom: '16px' }}>
|
|
449
|
+
By clicking "Sign Up", you agree to our{' '}
|
|
450
|
+
<Text as="a" decoration="Underline" style={{ color: '#007bff' }}>
|
|
451
|
+
Terms of Service
|
|
452
|
+
</Text>{' '}
|
|
453
|
+
and{' '}
|
|
454
|
+
<Text as="a" decoration="Underline" style={{ color: '#007bff' }}>
|
|
455
|
+
Privacy Policy
|
|
456
|
+
</Text>.
|
|
457
|
+
</Text>
|
|
458
|
+
|
|
459
|
+
<Button type="submit">Sign Up</Button>
|
|
460
|
+
</Form>
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
```
|