@neynar/ui 0.3.1 → 0.4.0

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.
@@ -1,161 +0,0 @@
1
- # Typography
2
-
3
- **Type**: component
4
-
5
- Typography - Comprehensive text styling component for consistent design system implementation A flexible typography component that provides semantic text variants, color options, and accessibility features. Built with class-variance-authority (CVA) for type-safe variant management and supports both semantic HTML elements and composition patterns via Radix UI Slot. Designed to handle all text styling needs across the application with consistent visual hierarchy and accessibility compliance.
6
-
7
- ## JSX Usage
8
-
9
- ```jsx
10
- import { Typography } from '@neynar/ui';
11
-
12
- <Typography
13
- variant={value}
14
- color={value}
15
- align={value}
16
- transform={value}
17
- weight={value}
18
- as={value}
19
- htmlFor="value"
20
- asChild={true}
21
- italic={true}
22
- underline={true}
23
- strikethrough={true}
24
- truncate={true}
25
- srOnly={true}
26
- className="value"
27
- >
28
- {/* Your content here */}
29
- </Typography>
30
- ```
31
-
32
- ## Component Props
33
-
34
- ### variant
35
- - **Type**: `TypographyVariant`
36
- - **Required**: No
37
- - **Description**: No description available
38
-
39
- ### color
40
- - **Type**: `TypographyColor`
41
- - **Required**: No
42
- - **Description**: No description available
43
-
44
- ### align
45
- - **Type**: `"left" | "center" | "right" | "justify"`
46
- - **Required**: No
47
- - **Description**: No description available
48
-
49
- ### transform
50
- - **Type**: `"uppercase" | "lowercase" | "capitalize"`
51
- - **Required**: No
52
- - **Description**: No description available
53
-
54
- ### weight
55
- - **Type**: `"normal" | "medium" | "semibold" | "bold"`
56
- - **Required**: No
57
- - **Description**: No description available
58
-
59
- ### as
60
- - **Type**: `React.ElementType`
61
- - **Required**: No
62
- - **Description**: No description available
63
-
64
- ### htmlFor
65
- - **Type**: `string`
66
- - **Required**: No
67
- - **Description**: No description available
68
-
69
- ### asChild
70
- - **Type**: `boolean`
71
- - **Required**: No
72
- - **Description**: No description available
73
-
74
- ### italic
75
- - **Type**: `boolean`
76
- - **Required**: No
77
- - **Description**: No description available
78
-
79
- ### underline
80
- - **Type**: `boolean`
81
- - **Required**: No
82
- - **Description**: No description available
83
-
84
- ### strikethrough
85
- - **Type**: `boolean`
86
- - **Required**: No
87
- - **Description**: No description available
88
-
89
- ### truncate
90
- - **Type**: `boolean`
91
- - **Required**: No
92
- - **Description**: No description available
93
-
94
- ### srOnly
95
- - **Type**: `boolean`
96
- - **Required**: No
97
- - **Description**: No description available
98
-
99
- ### className
100
- - **Type**: `string`
101
- - **Required**: No
102
- - **Description**: No description available
103
-
104
- ### children
105
- - **Type**: `React.ReactNode`
106
- - **Required**: No
107
- - **Description**: No description available
108
-
109
- ## Examples
110
-
111
- ### Example 1
112
- ```tsx
113
- // Basic heading with semantic HTML
114
- <Typography variant="heading" as="h1">
115
- Welcome to Neynar
116
- </Typography>
117
- // Body text with color variant
118
- <Typography variant="body" color="muted">
119
- This is secondary body text with reduced visual prominence.
120
- </Typography>
121
- // Code snippet with proper semantics
122
- <Typography variant="code" as="code">
123
- const message = "Hello, world!";
124
- </Typography>
125
- ```
126
- ### Example 2
127
- ```tsx
128
- // Advanced styling with multiple variants
129
- <Typography
130
- variant="subheading"
131
- color="accent"
132
- align="center"
133
- weight="semibold"
134
- italic
135
- underline
136
- className="mb-4"
137
- >
138
- Styled Subheading with Multiple Variants
139
- </Typography>
140
- // Truncated text for constrained layouts
141
- <Typography variant="body" truncate className="max-w-xs">
142
- This is a very long text that will be truncated with ellipsis when it exceeds the container width
143
- </Typography>
144
- ```
145
- ### Example 3
146
- ```tsx
147
- // Accessibility features
148
- <Typography variant="details" srOnly>
149
- Additional context for screen readers only
150
- </Typography>
151
- // Form label with proper association
152
- <Typography variant="field" as="label" htmlFor="email-input">
153
- Email Address
154
- </Typography>
155
- // Composition with asChild for complex structures
156
- <Typography variant="body" asChild>
157
- <a href="/about" className="hover:underline">
158
- Learn more about our platform
159
- </a>
160
- </Typography>
161
- ```