@app-studio/web 0.9.41 → 0.9.43
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/bot/Bot.d.ts +15 -0
- package/dist/bot/Cache.d.ts +13 -0
- package/dist/bot/Config.d.ts +13 -0
- package/dist/bot/ContentFetcher.d.ts +9 -0
- package/dist/bot/DocuCode.d.ts +19 -0
- package/dist/bot/FileHandler.d.ts +39 -0
- package/dist/bot/ai/AnthropicConnector.d.ts +6 -0
- package/dist/bot/ai/GeminiConnector.d.ts +7 -0
- package/dist/bot/ai/GroqConnector.d.ts +7 -0
- package/dist/bot/ai/HuggingFaceConnector.d.ts +6 -0
- package/dist/bot/ai/OpenAIConnector.d.ts +11 -0
- package/dist/bot/ai/ReplicateConnector.d.ts +7 -0
- package/dist/bot/ai/SambaNovaConnector.d.ts +6 -0
- package/dist/bot/ai/ai.config.d.ts +12 -0
- package/dist/bot/ai/ai.service.d.ts +36 -0
- package/dist/bot/data.d.ts +19 -0
- package/dist/bot/extractors.d.ts +8 -0
- package/dist/bot/index.d.ts +1 -0
- package/dist/bot/prompt/1-project.d.ts +1 -0
- package/dist/bot/prompt/2-response.d.ts +1 -0
- package/dist/bot/prompt/3-comment.d.ts +1 -0
- package/docs/components/Accordion.mdx +74 -121
- package/docs/components/Alert.mdx +19 -70
- package/docs/components/AspectRatio.mdx +13 -11
- package/docs/components/AudioInput.mdx +43 -0
- package/docs/components/Avatar.mdx +18 -43
- package/docs/components/Background.mdx +100 -492
- package/docs/components/Badge.mdx +45 -130
- package/docs/components/Button.mdx +76 -128
- package/docs/components/Calendar.mdx +7 -7
- package/docs/components/Card.mdx +247 -290
- package/docs/components/Carousel.mdx +94 -321
- package/docs/components/Chart.mdx +171 -26
- package/docs/components/ChatInput.mdx +327 -275
- package/docs/components/Checkbox.mdx +3 -5
- package/docs/components/ColorInput.mdx +6 -6
- package/docs/components/ColorPicker.mdx +452 -0
- package/docs/components/ComboBox.mdx +13 -13
- package/docs/components/Command.mdx +140 -188
- package/docs/components/ContextMenu.mdx +47 -171
- package/docs/components/CookieConsent.mdx +53 -0
- package/docs/components/CountryPicker.mdx +8 -8
- package/docs/components/DatePicker.mdx +3 -3
- package/docs/components/DragAndDrop.mdx +279 -463
- package/docs/components/Drawer.mdx +392 -231
- package/docs/components/DropdownMenu.mdx +37 -155
- package/docs/components/EmojiPicker.mdx +84 -0
- package/docs/components/File.mdx +130 -4
- package/docs/components/Formik.mdx +39 -39
- package/docs/components/Gradient.mdx +359 -182
- package/docs/components/Horizontal.mdx +1 -2
- package/docs/components/HoverCard.mdx +57 -125
- package/docs/components/KanbanBoard.mdx +9 -9
- package/docs/components/Link.mdx +22 -30
- package/docs/components/Loader.mdx +230 -413
- package/docs/components/Menubar.mdx +73 -69
- package/docs/components/Message.mdx +210 -525
- package/docs/components/Modal.mdx +351 -475
- package/docs/components/NavigationMenu.mdx +8 -8
- package/docs/components/OTPInput.mdx +194 -0
- package/docs/components/Pagination.mdx +451 -107
- package/docs/components/Password.mdx +8 -8
- package/docs/components/ProgressBar.mdx +460 -0
- package/docs/components/Resizable.mdx +103 -102
- package/docs/components/Select.mdx +5 -5
- package/docs/components/Separator.mdx +11 -98
- package/docs/components/ShareButton.mdx +29 -0
- package/docs/components/Sidebar.mdx +70 -131
- package/docs/components/Slider.mdx +99 -185
- package/docs/components/StatusIndicator.mdx +373 -0
- package/docs/components/Switch.mdx +3 -3
- package/docs/components/Table.mdx +25 -105
- package/docs/components/Tabs.mdx +40 -143
- package/docs/components/TagInput.mdx +17 -17
- package/docs/components/Text.mdx +3 -3
- package/docs/components/TextArea.mdx +6 -6
- package/docs/components/TextField.mdx +12 -12
- package/docs/components/Title.mdx +267 -525
- package/docs/components/Toast.mdx +65 -142
- package/docs/components/Toggle.mdx +37 -49
- package/docs/components/ToggleGroup.mdx +36 -57
- package/docs/components/Tooltip.mdx +501 -138
- package/docs/components/Uploader.mdx +205 -351
- package/package.json +1 -1
- package/dist/components/AuthGuard/AuthGuard.d.ts +0 -35
- package/dist/components/AuthGuard/index.d.ts +0 -1
- package/docs/adk-components.md +0 -319
- package/docs/adk-quick-start.md +0 -268
|
@@ -1,536 +1,278 @@
|
|
|
1
1
|
# Title
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Displays customizable titles with highlighting, responsive sizing, and animation effects.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Title } from "@app-studio/web";
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Default
|
|
12
|
-
|
|
13
|
-
```jsx
|
|
14
|
-
<Title>Simple Hero Title</Title>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Sizes
|
|
18
|
-
|
|
19
|
-
The `size` prop changes the title size. It has a type `TitleSize` with default value `"xl"`.
|
|
20
|
-
|
|
21
|
-
```jsx
|
|
22
|
-
<Vertical gap={32}>
|
|
23
|
-
<Title size="xs">Extra Small Title</Title>
|
|
24
|
-
<Title size="sm">Small Title</Title>
|
|
25
|
-
<Title size="md">Medium Title</Title>
|
|
26
|
-
<Title size="lg">Large Title</Title>
|
|
27
|
-
<Title size="xl">Extra Large Title</Title>
|
|
28
|
-
</Vertical>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Highlight Text
|
|
32
|
-
|
|
33
|
-
The `highlightText` prop specifies which part of the text should be highlighted. You can provide a string or an array of strings.
|
|
34
|
-
|
|
35
|
-
```jsx
|
|
36
|
-
<Title highlightText="highlighted" highlightStyle="background" highlightColor="theme.primary">
|
|
37
|
-
Text with highlighted words
|
|
38
|
-
</Title>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Highlight Styles
|
|
42
|
-
|
|
43
|
-
The `highlightStyle` prop determines how the highlighted text is styled. Options include `'background'`, `'underline'`, `'gradient'`, `'outline'`, and `'glow'`.
|
|
44
|
-
|
|
45
|
-
```jsx
|
|
46
|
-
<Vertical gap={32}>
|
|
47
|
-
<Title highlightText="background" highlightStyle="background" highlightColor="theme.primary">
|
|
48
|
-
Text with background highlight
|
|
49
|
-
</Title>
|
|
50
|
-
|
|
51
|
-
<Title highlightText="underlined" highlightStyle="underline" highlightColor="theme.secondary">
|
|
52
|
-
Text with underlined highlight
|
|
53
|
-
</Title>
|
|
54
|
-
|
|
55
|
-
<Title
|
|
56
|
-
highlightText="gradient"
|
|
57
|
-
highlightStyle="gradient"
|
|
58
|
-
highlightColor="theme.primary"
|
|
59
|
-
highlightSecondaryColor="theme.secondary"
|
|
60
|
-
>
|
|
61
|
-
Text with gradient highlight
|
|
62
|
-
</Title>
|
|
63
|
-
|
|
64
|
-
<Title highlightText="outline" highlightStyle="outline" highlightColor="theme.primary">
|
|
65
|
-
Text with outline highlight
|
|
66
|
-
</Title>
|
|
67
|
-
|
|
68
|
-
<Title highlightText="glow" highlightStyle="glow" highlightColor="theme.primary">
|
|
69
|
-
Text with glow highlight
|
|
70
|
-
</Title>
|
|
71
|
-
</Vertical>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Multiple Highlights
|
|
75
|
-
|
|
76
|
-
You can highlight multiple parts of the text by providing an array of strings.
|
|
77
|
-
|
|
78
|
-
```jsx
|
|
79
|
-
<Title
|
|
80
|
-
highlightText={["multiple", "highlights"]}
|
|
81
|
-
highlightStyle="background"
|
|
82
|
-
highlightColor="theme.primary"
|
|
83
|
-
>
|
|
84
|
-
Text with multiple highlights in the same sentence
|
|
85
|
-
</Title>
|
|
5
|
+
### **Import**
|
|
6
|
+
```tsx
|
|
7
|
+
import { Title } from '@app-studio/web';
|
|
86
8
|
```
|
|
87
9
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
to: { transform: 'translateX(0)' },
|
|
109
|
-
duration: '1s',
|
|
110
|
-
}}
|
|
111
|
-
animationLoop={3}
|
|
112
|
-
>
|
|
113
|
-
Slide In From Left (3 Times)
|
|
114
|
-
</Title>
|
|
115
|
-
|
|
116
|
-
<Title
|
|
117
|
-
animate={{
|
|
118
|
-
from: { transform: 'translateX(-10px)' },
|
|
119
|
-
to: { transform: 'translateX(10px)' },
|
|
120
|
-
duration: '2s',
|
|
121
|
-
direction: 'alternate',
|
|
122
|
-
}}
|
|
123
|
-
animationLoop="infinite"
|
|
124
|
-
>
|
|
125
|
-
Infinite Wiggle Animation
|
|
126
|
-
</Title>
|
|
127
|
-
</Vertical>
|
|
10
|
+
### **Default**
|
|
11
|
+
```tsx
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { Vertical } from 'app-studio';
|
|
14
|
+
import { Title } from '@app-studio/web';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Default Title examples showing different sizes
|
|
18
|
+
*/
|
|
19
|
+
export const DefaultTitle = () => {
|
|
20
|
+
return (
|
|
21
|
+
<Vertical gap={32}>
|
|
22
|
+
<Title size="xs">Extra Small Title (xs)</Title>
|
|
23
|
+
<Title size="sm">Small Title (sm)</Title>
|
|
24
|
+
<Title size="md">Medium Title (md)</Title>
|
|
25
|
+
<Title size="lg">Large Title (lg)</Title>
|
|
26
|
+
<Title size="xl">Extra Large Title</Title>
|
|
27
|
+
</Vertical>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
128
30
|
```
|
|
129
31
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
32
|
+
### **animationLoop**
|
|
33
|
+
Determines how many times the component's animation should repeat, or if it should loop infinitely.
|
|
34
|
+
|
|
35
|
+
- **Type:** `number | 'infinite'`
|
|
36
|
+
- **Default:** `1`
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import React from 'react';
|
|
40
|
+
import { Vertical } from 'app-studio';
|
|
41
|
+
import { Title } from '@app-studio/web';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Examples of Title with different animation loop controls
|
|
45
|
+
*/
|
|
46
|
+
export const AnimationLoopTitle = () => {
|
|
47
|
+
return (
|
|
48
|
+
<Vertical gap={48}>
|
|
49
|
+
{/* Title with single play animation (default) */}
|
|
50
|
+
<Title
|
|
51
|
+
animate={{
|
|
52
|
+
from: { opacity: 0, transform: 'translateY(-20px)' },
|
|
53
|
+
to: { opacity: 1, transform: 'translateY(0)' },
|
|
54
|
+
duration: '1s',
|
|
55
|
+
timingFunction: 'ease-out',
|
|
56
|
+
}}
|
|
57
|
+
animationLoop={1}
|
|
58
|
+
highlightText="Once"
|
|
59
|
+
highlightStyle="background"
|
|
60
|
+
highlightColor="theme.primary"
|
|
61
|
+
>
|
|
62
|
+
Animation Plays Once (Default)
|
|
63
|
+
</Title>
|
|
64
|
+
|
|
65
|
+
{/* Title with animation that plays 3 times */}
|
|
66
|
+
<Title
|
|
67
|
+
animate={{
|
|
68
|
+
from: { transform: 'scale(0.8)' },
|
|
69
|
+
to: { transform: 'scale(1)' },
|
|
70
|
+
duration: '0.8s',
|
|
71
|
+
timingFunction: 'ease-in-out',
|
|
72
|
+
}}
|
|
73
|
+
animationLoop={3}
|
|
74
|
+
highlightText="Three"
|
|
75
|
+
highlightStyle="gradient"
|
|
76
|
+
highlightColor="theme.primary"
|
|
77
|
+
highlightSecondaryColor="theme.secondary"
|
|
78
|
+
>
|
|
79
|
+
Animation Plays Three Times
|
|
80
|
+
</Title>
|
|
81
|
+
|
|
82
|
+
{/* Title with infinite animation loop */}
|
|
83
|
+
<Title
|
|
84
|
+
animate={{
|
|
85
|
+
from: { transform: 'translateX(-10px)' },
|
|
86
|
+
to: { transform: 'translateX(10px)' },
|
|
87
|
+
duration: '2s',
|
|
88
|
+
timingFunction: 'ease-in-out',
|
|
89
|
+
direction: 'alternate',
|
|
90
|
+
}}
|
|
91
|
+
animationLoop="infinite"
|
|
92
|
+
highlightText="Infinite"
|
|
93
|
+
highlightStyle="glow"
|
|
94
|
+
highlightColor="theme.accent"
|
|
95
|
+
>
|
|
96
|
+
Animation Loops Infinitely
|
|
97
|
+
</Title>
|
|
98
|
+
|
|
99
|
+
{/* Highlight animation with different loop control */}
|
|
100
|
+
<Title
|
|
101
|
+
highlightAnimate={{
|
|
102
|
+
from: { transform: 'rotate(-5deg)' },
|
|
103
|
+
to: { transform: 'rotate(5deg)' },
|
|
104
|
+
duration: '1s',
|
|
105
|
+
timingFunction: 'ease-in-out',
|
|
106
|
+
direction: 'alternate',
|
|
107
|
+
}}
|
|
108
|
+
highlightAnimationLoop="infinite"
|
|
109
|
+
highlightText="Wiggling"
|
|
110
|
+
highlightStyle="outline"
|
|
111
|
+
highlightColor="theme.warning"
|
|
112
|
+
>
|
|
113
|
+
Title with Wiggling Highlight
|
|
114
|
+
</Title>
|
|
115
|
+
|
|
116
|
+
{/* Both title and highlight with different loop controls */}
|
|
117
|
+
<Title
|
|
118
|
+
animate={{
|
|
119
|
+
from: { opacity: 0.5 },
|
|
120
|
+
to: { opacity: 1 },
|
|
121
|
+
duration: '2s',
|
|
122
|
+
timingFunction: 'ease-in-out',
|
|
123
|
+
direction: 'alternate',
|
|
124
|
+
}}
|
|
125
|
+
animationLoop="infinite"
|
|
126
|
+
highlightAnimate={{
|
|
127
|
+
from: { backgroundColor: 'theme.primary' },
|
|
128
|
+
to: { backgroundColor: 'theme.secondary' },
|
|
129
|
+
duration: '1.5s',
|
|
130
|
+
timingFunction: 'ease-in-out',
|
|
131
|
+
direction: 'alternate',
|
|
132
|
+
}}
|
|
133
|
+
highlightAnimationLoop="infinite"
|
|
134
|
+
highlightText="Pulsing"
|
|
135
|
+
highlightStyle="background"
|
|
136
|
+
>
|
|
137
|
+
Title with Pulsing Background and Highlight
|
|
138
|
+
</Title>
|
|
139
|
+
|
|
140
|
+
{/* Bounce animation with limited loops */}
|
|
141
|
+
<Title
|
|
142
|
+
animate={{
|
|
143
|
+
from: { transform: 'translateY(0)' },
|
|
144
|
+
'20%': { transform: 'translateY(-30px)' },
|
|
145
|
+
'40%': { transform: 'translateY(0)' },
|
|
146
|
+
'60%': { transform: 'translateY(-15px)' },
|
|
147
|
+
'80%': { transform: 'translateY(0)' },
|
|
148
|
+
to: { transform: 'translateY(0)' },
|
|
149
|
+
duration: '2s',
|
|
150
|
+
timingFunction: 'ease-in-out',
|
|
151
|
+
}}
|
|
152
|
+
animationLoop={2}
|
|
153
|
+
highlightText="Bounce"
|
|
154
|
+
highlightStyle="background"
|
|
155
|
+
highlightColor="theme.success"
|
|
156
|
+
>
|
|
157
|
+
Bounce Animation (2 Times)
|
|
158
|
+
</Title>
|
|
159
|
+
|
|
160
|
+
{/* Typewriter with infinite highlight animation */}
|
|
161
|
+
<Title
|
|
162
|
+
highlightAnimate={{
|
|
163
|
+
from: { textShadow: '0 0 5px theme.primary' },
|
|
164
|
+
to: { textShadow: '0 0 20px theme.primary' },
|
|
165
|
+
duration: '1.5s',
|
|
166
|
+
timingFunction: 'ease-in-out',
|
|
167
|
+
direction: 'alternate',
|
|
168
|
+
}}
|
|
169
|
+
highlightAnimationLoop="infinite"
|
|
170
|
+
highlightText="glowing"
|
|
171
|
+
highlightStyle="glow"
|
|
172
|
+
highlightColor="theme.primary"
|
|
173
|
+
highlightTypewriter={true}
|
|
174
|
+
highlightTypewriterDuration={2000}
|
|
175
|
+
>
|
|
176
|
+
Typewriter with glowing highlight
|
|
177
|
+
</Title>
|
|
178
|
+
</Vertical>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
189
181
|
```
|
|
190
182
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
183
|
+
### **responsive**
|
|
184
|
+
Enables responsive behavior for the title component, adjusting its display based on screen size.
|
|
185
|
+
|
|
186
|
+
- **Type:** `boolean`
|
|
187
|
+
- **Default:** `true`
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
import React from 'react';
|
|
191
|
+
import { Title } from '@app-studio/web';
|
|
192
|
+
import { Vertical } from 'app-studio';
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Example of responsive Title using the new responsive prop
|
|
196
|
+
*/
|
|
197
|
+
export const ResponsiveTitle = () => {
|
|
198
|
+
return (
|
|
199
|
+
<Vertical gap={32}>
|
|
200
|
+
{/* Using the new responsive prop - automatically adapts based on size */}
|
|
201
|
+
<Title
|
|
202
|
+
size="xl"
|
|
203
|
+
responsive={true}
|
|
204
|
+
highlightText="Responsive"
|
|
205
|
+
highlightStyle="background"
|
|
206
|
+
highlightColor="theme.primary"
|
|
207
|
+
>
|
|
208
|
+
Responsive XL Title (H1 scale)
|
|
209
|
+
</Title>
|
|
210
|
+
|
|
211
|
+
<Title
|
|
212
|
+
size="lg"
|
|
213
|
+
responsive={true}
|
|
214
|
+
highlightText="Responsive"
|
|
215
|
+
highlightStyle="gradient"
|
|
216
|
+
highlightColor="theme.primary"
|
|
217
|
+
highlightSecondaryColor="theme.secondary"
|
|
218
|
+
>
|
|
219
|
+
Responsive LG Title (H2 scale)
|
|
220
|
+
</Title>
|
|
221
|
+
|
|
222
|
+
<Title
|
|
223
|
+
size="md"
|
|
224
|
+
responsive={true}
|
|
225
|
+
highlightText="Responsive"
|
|
226
|
+
highlightStyle="underline"
|
|
227
|
+
highlightColor="theme.accent"
|
|
228
|
+
>
|
|
229
|
+
Responsive MD Title (H3 scale)
|
|
230
|
+
</Title>
|
|
231
|
+
|
|
232
|
+
<Title
|
|
233
|
+
size="sm"
|
|
234
|
+
responsive={true}
|
|
235
|
+
highlightText="Responsive"
|
|
236
|
+
highlightStyle="glow"
|
|
237
|
+
highlightColor="theme.primary"
|
|
238
|
+
>
|
|
239
|
+
Responsive SM Title (T1 scale)
|
|
240
|
+
</Title>
|
|
241
|
+
|
|
242
|
+
<Title
|
|
243
|
+
size="xs"
|
|
244
|
+
responsive={true}
|
|
245
|
+
highlightText="Responsive"
|
|
246
|
+
highlightStyle="outline"
|
|
247
|
+
highlightColor="theme.secondary"
|
|
248
|
+
>
|
|
249
|
+
Responsive XS Title (S1 scale)
|
|
250
|
+
</Title>
|
|
251
|
+
|
|
252
|
+
{/* Legacy example using manual media queries */}
|
|
253
|
+
<Title
|
|
254
|
+
media={{
|
|
255
|
+
mobile: {
|
|
256
|
+
fontSize: 32,
|
|
257
|
+
lineHeight: '100%',
|
|
258
|
+
},
|
|
259
|
+
tablet: {
|
|
260
|
+
fontSize: 48,
|
|
261
|
+
lineHeight: '110%',
|
|
262
|
+
},
|
|
263
|
+
desktop: {
|
|
264
|
+
fontSize: 64,
|
|
265
|
+
lineHeight: '120%',
|
|
266
|
+
},
|
|
267
|
+
}}
|
|
268
|
+
highlightText="Manual"
|
|
269
|
+
highlightStyle="background"
|
|
270
|
+
highlightColor="theme.primary"
|
|
271
|
+
>
|
|
272
|
+
Manual Media Queries Title
|
|
273
|
+
</Title>
|
|
274
|
+
</Vertical>
|
|
275
|
+
);
|
|
276
|
+
};
|
|
209
277
|
```
|
|
210
278
|
|
|
211
|
-
## Alternating Text
|
|
212
|
-
|
|
213
|
-
The Title component can cycle through different words in place of the highlighted text using the `alternateHighlightText` and `alternateAnimation` props.
|
|
214
|
-
|
|
215
|
-
```jsx
|
|
216
|
-
<Title
|
|
217
|
-
highlightText="changing"
|
|
218
|
-
alternateHighlightText={[
|
|
219
|
-
'innovative',
|
|
220
|
-
'powerful',
|
|
221
|
-
'flexible',
|
|
222
|
-
'intuitive',
|
|
223
|
-
]}
|
|
224
|
-
alternateAnimation={true}
|
|
225
|
-
alternateDuration={2000}
|
|
226
|
-
highlightStyle="background"
|
|
227
|
-
highlightColor="theme.primary"
|
|
228
|
-
>
|
|
229
|
-
Our changing solution for your business
|
|
230
|
-
</Title>
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
## Typewriter Effect
|
|
234
|
-
|
|
235
|
-
You can add a typewriter effect to the highlighted text using the `highlightTypewriter` prop.
|
|
236
|
-
|
|
237
|
-
```jsx
|
|
238
|
-
<Title
|
|
239
|
-
highlightText="typewriter"
|
|
240
|
-
highlightStyle="background"
|
|
241
|
-
highlightColor="theme.primary"
|
|
242
|
-
highlightTypewriter={true}
|
|
243
|
-
highlightTypewriterDuration={1500}
|
|
244
|
-
>
|
|
245
|
-
This text has a typewriter effect on the highlighted word
|
|
246
|
-
</Title>
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
## Responsive
|
|
250
|
-
|
|
251
|
-
You can make the title responsive in two ways:
|
|
252
|
-
|
|
253
|
-
### Using the `responsive` prop (Recommended)
|
|
254
|
-
|
|
255
|
-
The `responsive` prop automatically applies responsive sizing based on the current `size` prop using a predefined typography scale:
|
|
256
|
-
|
|
257
|
-
```jsx
|
|
258
|
-
<Title
|
|
259
|
-
size="xl"
|
|
260
|
-
responsive={true}
|
|
261
|
-
highlightText="Responsive"
|
|
262
|
-
highlightStyle="background"
|
|
263
|
-
highlightColor="theme.primary"
|
|
264
|
-
>
|
|
265
|
-
Responsive XL Title (H1 scale)
|
|
266
|
-
</Title>
|
|
267
|
-
|
|
268
|
-
<Title
|
|
269
|
-
size="lg"
|
|
270
|
-
responsive={true}
|
|
271
|
-
highlightText="Responsive"
|
|
272
|
-
highlightStyle="gradient"
|
|
273
|
-
highlightColor="theme.primary"
|
|
274
|
-
highlightSecondaryColor="theme.secondary"
|
|
275
|
-
>
|
|
276
|
-
Responsive LG Title (H2 scale)
|
|
277
|
-
</Title>
|
|
278
|
-
|
|
279
|
-
<Title
|
|
280
|
-
size="md"
|
|
281
|
-
responsive={true}
|
|
282
|
-
highlightText="Responsive"
|
|
283
|
-
highlightStyle="underline"
|
|
284
|
-
highlightColor="theme.accent"
|
|
285
|
-
>
|
|
286
|
-
Responsive MD Title (H3 scale)
|
|
287
|
-
</Title>
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
The responsive prop maps sizes to typography scales:
|
|
291
|
-
- `xl` → H1 scale (46px mobile, 52px tablet, 58px desktop)
|
|
292
|
-
- `lg` → H2 scale (28px mobile, 36px tablet, 48px desktop)
|
|
293
|
-
- `md` → H3 scale (28px mobile, 34px tablet, 40px desktop)
|
|
294
|
-
- `sm` → T1 scale (24px mobile, 28px tablet, 32px desktop)
|
|
295
|
-
- `xs` → S1 scale (16px mobile, 18px tablet, 20px desktop)
|
|
296
|
-
|
|
297
|
-
### Using the `media` prop (Manual)
|
|
298
|
-
|
|
299
|
-
For custom responsive behavior, you can use the `media` prop:
|
|
300
|
-
|
|
301
|
-
```jsx
|
|
302
|
-
<Title
|
|
303
|
-
media={{
|
|
304
|
-
mobile: {
|
|
305
|
-
fontSize: 32,
|
|
306
|
-
lineHeight: '40px',
|
|
307
|
-
},
|
|
308
|
-
tablet: {
|
|
309
|
-
fontSize: 48,
|
|
310
|
-
lineHeight: '56px',
|
|
311
|
-
},
|
|
312
|
-
desktop: {
|
|
313
|
-
fontSize: 64,
|
|
314
|
-
lineHeight: '72px',
|
|
315
|
-
},
|
|
316
|
-
}}
|
|
317
|
-
highlightText="Responsive"
|
|
318
|
-
highlightStyle="background"
|
|
319
|
-
highlightColor="theme.primary"
|
|
320
|
-
>
|
|
321
|
-
Manual Responsive Title
|
|
322
|
-
</Title>
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
## Custom Styling
|
|
326
|
-
|
|
327
|
-
You can customize the title using the `views` prop.
|
|
328
|
-
|
|
329
|
-
```jsx
|
|
330
|
-
<Title
|
|
331
|
-
views={{
|
|
332
|
-
container: {
|
|
333
|
-
fontFamily: 'Georgia, serif',
|
|
334
|
-
letterSpacing: '0.05em',
|
|
335
|
-
textTransform: 'uppercase',
|
|
336
|
-
},
|
|
337
|
-
highlight: {
|
|
338
|
-
borderRadius: '8px',
|
|
339
|
-
padding: '0 12px',
|
|
340
|
-
},
|
|
341
|
-
}}
|
|
342
|
-
highlightText="Custom"
|
|
343
|
-
highlightStyle="background"
|
|
344
|
-
highlightColor="color.purple.500"
|
|
345
|
-
>
|
|
346
|
-
Title with Custom Styling
|
|
347
|
-
</Title>
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
## Hero Section Example
|
|
351
|
-
|
|
352
|
-
```jsx
|
|
353
|
-
<View
|
|
354
|
-
backgroundColor="color.gray.50"
|
|
355
|
-
padding={48}
|
|
356
|
-
borderRadius={8}
|
|
357
|
-
width="100%"
|
|
358
|
-
>
|
|
359
|
-
<Vertical gap={24} maxWidth={800} marginX="auto">
|
|
360
|
-
<Title
|
|
361
|
-
size="xl"
|
|
362
|
-
animate={{
|
|
363
|
-
from: { opacity: 0 },
|
|
364
|
-
to: { opacity: 1 },
|
|
365
|
-
duration: '1s',
|
|
366
|
-
iterationCount: '1',
|
|
367
|
-
}}
|
|
368
|
-
highlightText="Platform"
|
|
369
|
-
highlightStyle="gradient"
|
|
370
|
-
highlightColor="theme.primary"
|
|
371
|
-
highlightSecondaryColor="theme.secondary"
|
|
372
|
-
centered
|
|
373
|
-
>
|
|
374
|
-
Welcome to Our Platform
|
|
375
|
-
</Title>
|
|
376
|
-
|
|
377
|
-
<Text
|
|
378
|
-
textAlign="center"
|
|
379
|
-
color="color.gray.600"
|
|
380
|
-
fontSize={20}
|
|
381
|
-
lineHeight={28}
|
|
382
|
-
>
|
|
383
|
-
Build beautiful, responsive, and interactive user interfaces with our powerful component library.
|
|
384
|
-
</Text>
|
|
385
|
-
|
|
386
|
-
<Horizontal gap={16} justifyContent="center" marginTop={16}>
|
|
387
|
-
<Button variant="primary" size="lg">
|
|
388
|
-
Get Started
|
|
389
|
-
</Button>
|
|
390
|
-
<Button variant="outline" size="lg">
|
|
391
|
-
Learn More
|
|
392
|
-
</Button>
|
|
393
|
-
</Horizontal>
|
|
394
|
-
</Vertical>
|
|
395
|
-
</View>
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
## Types
|
|
399
|
-
|
|
400
|
-
```typescript
|
|
401
|
-
export type HighlightStyle =
|
|
402
|
-
| 'underline' // Underline the text
|
|
403
|
-
| 'background' // Background color highlight
|
|
404
|
-
| 'gradient' // Gradient background
|
|
405
|
-
| 'outline' // Text with outline
|
|
406
|
-
| 'glow'; // Text with glow effect
|
|
407
|
-
|
|
408
|
-
export type TitleSize =
|
|
409
|
-
| 'xs'
|
|
410
|
-
| 'sm'
|
|
411
|
-
| 'md'
|
|
412
|
-
| 'lg'
|
|
413
|
-
| 'xl';
|
|
414
|
-
|
|
415
|
-
export interface TitleProps extends ViewProps {
|
|
416
|
-
/**
|
|
417
|
-
* The main text content of the title
|
|
418
|
-
*/
|
|
419
|
-
children: React.ReactNode;
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* Text to be highlighted within the title
|
|
423
|
-
*/
|
|
424
|
-
highlightText?: string | string[];
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Array of strings to cycle through, replacing the text specified in highlightText
|
|
428
|
-
*/
|
|
429
|
-
alternateHighlightText?: string[];
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* The visual style of the highlighted text
|
|
433
|
-
* @default 'background'
|
|
434
|
-
*/
|
|
435
|
-
highlightStyle?: HighlightStyle;
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* The color of the highlighted text or background
|
|
439
|
-
* @default 'theme.primary'
|
|
440
|
-
*/
|
|
441
|
-
highlightColor?: string;
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* The secondary color for gradient highlights
|
|
445
|
-
*/
|
|
446
|
-
highlightSecondaryColor?: string;
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Animation for the highlighted text
|
|
450
|
-
*/
|
|
451
|
-
highlightAnimate?: AnimationProps | AnimationProps[];
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* Animation for the title
|
|
455
|
-
*/
|
|
456
|
-
animate?: AnimationProps | AnimationProps[];
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* Controls the animation loop behavior for the title animation
|
|
460
|
-
* @default 1 (play once)
|
|
461
|
-
*/
|
|
462
|
-
animationLoop?: number | 'infinite';
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Controls the animation loop behavior for the highlight animation
|
|
466
|
-
* @default 1 (play once)
|
|
467
|
-
*/
|
|
468
|
-
highlightAnimationLoop?: number | 'infinite';
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Size of the title
|
|
472
|
-
* @default 'xl'
|
|
473
|
-
*/
|
|
474
|
-
size?: TitleSize;
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* Whether to enable responsive sizing based on breakpoints
|
|
478
|
-
* When true, the title will automatically adapt its size across mobile/tablet/desktop
|
|
479
|
-
* @default false
|
|
480
|
-
*/
|
|
481
|
-
responsive?: boolean;
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Whether to center the title
|
|
485
|
-
* @default false
|
|
486
|
-
*/
|
|
487
|
-
centered?: boolean;
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Whether to animate the alternating highlight text
|
|
491
|
-
* @default false
|
|
492
|
-
*/
|
|
493
|
-
alternateAnimation?: boolean;
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* Duration in milliseconds for each alternating highlight text
|
|
497
|
-
* @default 3000
|
|
498
|
-
*/
|
|
499
|
-
alternateDuration?: number;
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* Whether to apply a typewriter effect to the highlighted text
|
|
503
|
-
* @default false
|
|
504
|
-
*/
|
|
505
|
-
highlightTypewriter?: boolean;
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Duration in milliseconds for the typewriter effect
|
|
509
|
-
* @default 3000
|
|
510
|
-
*/
|
|
511
|
-
highlightTypewriterDuration?: number;
|
|
512
|
-
}
|
|
513
|
-
```
|
|
514
|
-
|
|
515
|
-
## **Accessibility**
|
|
516
|
-
|
|
517
|
-
The Title component:
|
|
518
|
-
|
|
519
|
-
- Uses semantic heading elements (`<h1>`) for proper document structure
|
|
520
|
-
- Maintains proper color contrast for highlighted text
|
|
521
|
-
- Supports keyboard navigation and focus management
|
|
522
|
-
- Works with screen readers by using appropriate ARIA attributes
|
|
523
|
-
|
|
524
|
-
## **Best Practices**
|
|
525
|
-
|
|
526
|
-
- Use the Title component for main headings and important text that needs emphasis
|
|
527
|
-
- Choose highlight styles that maintain good contrast with the background
|
|
528
|
-
- Use animations sparingly to avoid distracting users
|
|
529
|
-
- Use `animationLoop` and `highlightAnimationLoop` to control animation repetition
|
|
530
|
-
- Prefer finite loop counts over infinite animations for better user experience
|
|
531
|
-
- Use the `responsive` prop for automatic responsive sizing based on predefined typography scales
|
|
532
|
-
- Consider using responsive sizing for different screen sizes
|
|
533
|
-
- Limit the use of alternating text to avoid confusion
|
|
534
|
-
- Ensure that any animations respect user preferences for reduced motion
|
|
535
|
-
- Use semantic colors from the theme system rather than hardcoded values
|
|
536
|
-
|