@factorialco/f0-react-native 0.26.0 → 0.27.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.
- package/lib/module/components/exports.js +1 -1
- package/lib/module/components/exports.js.map +1 -1
- package/lib/module/components/primitives/F0Text/F0Text.js +2 -0
- package/lib/module/components/primitives/F0Text/F0Text.js.map +1 -0
- package/lib/module/components/primitives/F0Text/F0Text.md +297 -0
- package/lib/module/components/primitives/F0Text/F0Text.styles.js +2 -0
- package/lib/module/components/primitives/F0Text/F0Text.styles.js.map +1 -0
- package/lib/module/components/primitives/F0Text/F0Text.types.js +2 -0
- package/lib/module/components/primitives/F0Text/F0Text.types.js.map +1 -0
- package/lib/module/components/primitives/F0Text/index.js +2 -0
- package/lib/module/components/primitives/F0Text/index.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/utils.js +1 -1
- package/lib/module/lib/utils.js.map +1 -1
- package/lib/typescript/components/exports.d.ts +1 -0
- package/lib/typescript/components/exports.d.ts.map +1 -1
- package/lib/typescript/components/primitives/F0Text/F0Text.d.ts +8 -0
- package/lib/typescript/components/primitives/F0Text/F0Text.d.ts.map +1 -0
- package/lib/typescript/components/primitives/F0Text/F0Text.styles.d.ts +141 -0
- package/lib/typescript/components/primitives/F0Text/F0Text.styles.d.ts.map +1 -0
- package/lib/typescript/components/primitives/F0Text/F0Text.types.d.ts +86 -0
- package/lib/typescript/components/primitives/F0Text/F0Text.types.d.ts.map +1 -0
- package/lib/typescript/components/primitives/F0Text/index.d.ts +9 -0
- package/lib/typescript/components/primitives/F0Text/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/lib/utils.d.ts +9 -0
- package/lib/typescript/lib/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/exports.ts +3 -0
- package/src/components/primitives/F0Text/F0Text.md +297 -0
- package/src/components/primitives/F0Text/F0Text.styles.ts +69 -0
- package/src/components/primitives/F0Text/F0Text.tsx +76 -0
- package/src/components/primitives/F0Text/F0Text.types.ts +133 -0
- package/src/components/primitives/F0Text/__tests__/__snapshots__/index.spec.tsx.snap +316 -0
- package/src/components/primitives/F0Text/__tests__/index.spec.tsx +227 -0
- package/src/components/primitives/F0Text/index.ts +22 -0
- package/src/index.ts +1 -1
- package/src/lib/__tests__/utils.spec.ts +48 -0
- package/src/lib/utils.ts +19 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./Activity/ActivityItem";export*from"./Avatars/exports";export*from"./Badge";export*from"./Button";export*from"./Counter";export*from"./ExampleComponent";export*from"./Icon";export*from"./Navigation/PageHeader";export*from"./OneChip";export*from"./OnePreset";export*from"./PressableFeedback";export*from"./Tags/exports";export*from"./experimental/Lists/DataList";export*from"./experimental/Lists/DetailsItem";export*from"./experimental/Lists/DetailsItemsList";
|
|
1
|
+
export*from"./Activity/ActivityItem";export*from"./Avatars/exports";export*from"./Badge";export*from"./Button";export*from"./Counter";export*from"./ExampleComponent";export*from"./Icon";export*from"./Navigation/PageHeader";export*from"./OneChip";export*from"./OnePreset";export*from"./PressableFeedback";export*from"./Tags/exports";export*from"./experimental/Lists/DataList";export*from"./experimental/Lists/DetailsItem";export*from"./experimental/Lists/DetailsItemsList";export*from"./primitives/F0Text";
|
|
2
2
|
//# sourceMappingURL=exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/exports.ts"],"mappings":"AACA,WAAc,yBAAyB,CACvC,WAAc,mBAAmB,CACjC,WAAc,SAAS,CACvB,WAAc,UAAU,CACxB,WAAc,WAAW,CACzB,WAAc,oBAAoB,CAClC,WAAc,QAAQ,CACtB,WAAc,yBAAyB,CACvC,WAAc,WAAW,CACzB,WAAc,aAAa,CAC3B,WAAc,qBAAqB,CACnC,WAAc,gBAAgB,CAC9B,WAAc,+BAA+B,CAC7C,WAAc,kCAAkC,CAChD,WAAc,uCAAuC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/exports.ts"],"mappings":"AACA,WAAc,yBAAyB,CACvC,WAAc,mBAAmB,CACjC,WAAc,SAAS,CACvB,WAAc,UAAU,CACxB,WAAc,WAAW,CACzB,WAAc,oBAAoB,CAClC,WAAc,QAAQ,CACtB,WAAc,yBAAyB,CACvC,WAAc,WAAW,CACzB,WAAc,aAAa,CAC3B,WAAc,qBAAqB,CACnC,WAAc,gBAAgB,CAC9B,WAAc,+BAA+B,CAC7C,WAAc,kCAAkC,CAChD,WAAc,uCAAuC,CAGrD,WAAc,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["variant","color","align","decoration","transform","children","numberOfLines"];import React from"react";import{Text as RNText}from"react-native";import{omitProps}from"../../../lib/utils";import{textVariants}from"./F0Text.styles";import{F0_TEXT_BANNED_PROPS}from"./F0Text.types";import{jsx as _jsx}from"react/jsx-runtime";var F0TextComponent=React.forwardRef(function(_ref,ref){var _ref$variant=_ref.variant,variant=_ref$variant===void 0?"body-sm-default":_ref$variant,_ref$color=_ref.color,color=_ref$color===void 0?"default":_ref$color,_ref$align=_ref.align,align=_ref$align===void 0?"left":_ref$align,_ref$decoration=_ref.decoration,decoration=_ref$decoration===void 0?"none":_ref$decoration,_ref$transform=_ref.transform,transform=_ref$transform===void 0?"none":_ref$transform,children=_ref.children,numberOfLines=_ref.numberOfLines,rest=_objectWithoutProperties(_ref,_excluded);var textClassName=React.useMemo(function(){return textVariants({variant:variant,color:color,align:align,decoration:decoration,transform:transform});},[variant,color,align,decoration,transform]);return _jsx(RNText,Object.assign({ref:ref},omitProps(rest,F0_TEXT_BANNED_PROPS),{className:textClassName,numberOfLines:numberOfLines,ellipsizeMode:numberOfLines?"tail":undefined,children:children}));});F0TextComponent.displayName="F0Text";export var F0Text=React.memo(F0TextComponent);export{TYPOGRAPHY_VARIANTS,TEXT_COLORS,TEXT_ALIGN,TEXT_DECORATIONS,TEXT_TRANSFORMS}from"./F0Text.types";
|
|
2
|
+
//# sourceMappingURL=F0Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","RNText","omitProps","textVariants","F0_TEXT_BANNED_PROPS","jsx","_jsx","F0TextComponent","forwardRef","_ref","ref","_ref$variant","variant","_ref$color","color","_ref$align","align","_ref$decoration","decoration","_ref$transform","transform","children","numberOfLines","rest","_objectWithoutProperties","_excluded","textClassName","useMemo","Object","assign","className","ellipsizeMode","undefined","displayName","F0Text","memo","TYPOGRAPHY_VARIANTS","TEXT_COLORS","TEXT_ALIGN","TEXT_DECORATIONS","TEXT_TRANSFORMS"],"sourceRoot":"../../../../../src","sources":["components/primitives/F0Text/F0Text.tsx"],"mappings":"mLAAA,MAAO,CAAAA,KAAK,KAAM,OAAO,CACzB,OAASC,IAAI,GAAI,CAAAC,MAAM,KAAQ,cAAc,CAE7C,OAASC,SAAS,KAAQ,oBAAoB,CAE9C,OAASC,YAAY,KAAQ,iBAAiB,CAC9C,OAASC,oBAAoB,KAA0B,gBAAgB,QAAAC,GAAA,IAAAC,IAAA,yBAUvE,GAAM,CAAAC,eAAe,CAAGR,KAAK,CAACS,UAAU,CACtC,SAAAC,IAAA,CAWEC,GAAG,CACA,KAAAC,YAAA,CAAAF,IAAA,CAVDG,OAAO,CAAPA,OAAO,CAAAD,YAAA,UAAG,iBAAiB,CAAAA,YAAA,CAAAE,UAAA,CAAAJ,IAAA,CAC3BK,KAAK,CAALA,KAAK,CAAAD,UAAA,UAAG,SAAS,CAAAA,UAAA,CAAAE,UAAA,CAAAN,IAAA,CACjBO,KAAK,CAALA,KAAK,CAAAD,UAAA,UAAG,MAAM,CAAAA,UAAA,CAAAE,eAAA,CAAAR,IAAA,CACdS,UAAU,CAAVA,UAAU,CAAAD,eAAA,UAAG,MAAM,CAAAA,eAAA,CAAAE,cAAA,CAAAV,IAAA,CACnBW,SAAS,CAATA,SAAS,CAAAD,cAAA,UAAG,MAAM,CAAAA,cAAA,CAClBE,QAAQ,CAAAZ,IAAA,CAARY,QAAQ,CACRC,aAAa,CAAAb,IAAA,CAAba,aAAa,CACVC,IAAI,CAAAC,wBAAA,CAAAf,IAAA,CAAAgB,SAAA,EAIT,GAAM,CAAAC,aAAa,CAAG3B,KAAK,CAAC4B,OAAO,CACjC,iBACE,CAAAxB,YAAY,CAAC,CACXS,OAAO,CAAPA,OAAO,CACPE,KAAK,CAALA,KAAK,CACLE,KAAK,CAALA,KAAK,CACLE,UAAU,CAAVA,UAAU,CACVE,SAAS,CAATA,SACF,CAAC,CAAC,GACJ,CAACR,OAAO,CAAEE,KAAK,CAAEE,KAAK,CAAEE,UAAU,CAAEE,SAAS,CAC/C,CAAC,CAED,MACE,CAAAd,IAAA,CAACL,MAAM,CAAA2B,MAAA,CAAAC,MAAA,EACLnB,GAAG,CAAEA,GAAI,EACLR,SAAS,CAACqB,IAAI,CAAEnB,oBAAoB,CAAC,EACzC0B,SAAS,CAAEJ,aAAc,CACzBJ,aAAa,CAAEA,aAAc,CAC7BS,aAAa,CAAET,aAAa,CAAG,MAAM,CAAGU,SAAU,CAAAX,QAAA,CAEjDA,QAAQ,EACH,CAAC,CAEb,CACF,CAAC,CAEDd,eAAe,CAAC0B,WAAW,CAAG,QAAQ,CAEtC,MAAO,IAAM,CAAAC,MAAM,CAAGnC,KAAK,CAACoC,IAAI,CAAC5B,eAAe,CAAC,CAIjD,OACE6B,mBAAmB,CACnBC,WAAW,CACXC,UAAU,CACVC,gBAAgB,CAChBC,eAAe,KACV,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# F0Text
|
|
2
|
+
|
|
3
|
+
Primitive text component for React Native with semantic typography variants and optimized performance.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Semantic typography variants (heading and body styles)
|
|
8
|
+
- F0 semantic color system integration
|
|
9
|
+
- Inter font family support
|
|
10
|
+
- Type-safe TypeScript API
|
|
11
|
+
- Uniwind (Tailwind) styling
|
|
12
|
+
- Performance optimized with React.memo and useMemo
|
|
13
|
+
- Full accessibility support
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { F0Text } from "@factorialco/f0-react-native"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<>
|
|
25
|
+
<F0Text variant="heading-lg">Welcome</F0Text>
|
|
26
|
+
<F0Text variant="body-sm-default" color="secondary">
|
|
27
|
+
Secondary text
|
|
28
|
+
</F0Text>
|
|
29
|
+
<F0Text variant="body-md-medium" align="center">
|
|
30
|
+
Centered text
|
|
31
|
+
</F0Text>
|
|
32
|
+
<F0Text variant="body-sm-default" numberOfLines={2}>
|
|
33
|
+
Truncated text...
|
|
34
|
+
</F0Text>
|
|
35
|
+
</>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## API Reference
|
|
39
|
+
|
|
40
|
+
### Props
|
|
41
|
+
|
|
42
|
+
| Prop | Type | Default | Description |
|
|
43
|
+
| --------------- | ------------------- | ------------------- | ------------------------------------------------------- |
|
|
44
|
+
| `variant` | `TypographyVariant` | `'body-sm-default'` | Typography variant with weight included |
|
|
45
|
+
| `color` | `TextColor` | `'default'` | Text color from F0 semantic color system |
|
|
46
|
+
| `align` | `TextAlign` | `'left'` | Text alignment (left, center, right, justify) |
|
|
47
|
+
| `decoration` | `TextDecoration` | `'none'` | Text decoration (none, underline, line-through) |
|
|
48
|
+
| `transform` | `TextTransform` | `'none'` | Text transform (none, uppercase, lowercase, capitalize) |
|
|
49
|
+
| `numberOfLines` | `number` | `undefined` | Max lines before truncation with ellipsis |
|
|
50
|
+
|
|
51
|
+
All React Native `TextProps` are also supported (onPress, testID, etc.).
|
|
52
|
+
|
|
53
|
+
**Note**: `className` and `style` props are **not available**. Use semantic props for typography. For spacing/layout, wrap F0Text in a View. Both props are filtered at runtime to prevent override via spread.
|
|
54
|
+
|
|
55
|
+
### Typography Variants
|
|
56
|
+
|
|
57
|
+
All variants use **Inter** font family with the weight included in the variant name.
|
|
58
|
+
|
|
59
|
+
#### Heading Variants
|
|
60
|
+
|
|
61
|
+
| Variant | Size | Line Height | Weight | Letter Spacing |
|
|
62
|
+
| ------------ | ---- | ----------- | -------------- | -------------- |
|
|
63
|
+
| `heading-lg` | 24px | 32px | Semibold (600) | -0.2px |
|
|
64
|
+
| `heading-md` | 20px | 28px | Semibold (600) | -0.2px |
|
|
65
|
+
| `heading-sm` | 16px | 24px | Semibold (600) | - |
|
|
66
|
+
|
|
67
|
+
#### Body Variants
|
|
68
|
+
|
|
69
|
+
| Variant | Size | Line Height | Weight | Letter Spacing |
|
|
70
|
+
| ------------------ | ---- | ----------- | -------------- | -------------- |
|
|
71
|
+
| `body-md-default` | 16px | 24px | Regular (400) | - |
|
|
72
|
+
| `body-md-medium` | 16px | 24px | Medium (500) | - |
|
|
73
|
+
| `body-md-semibold` | 16px | 24px | Semibold (600) | - |
|
|
74
|
+
| `body-sm-default` | 14px | 20px | Regular (400) | - |
|
|
75
|
+
| `body-sm-medium` | 14px | 20px | Medium (500) | - |
|
|
76
|
+
| `body-sm-semibold` | 14px | 20px | Semibold (600) | - |
|
|
77
|
+
| `body-xs-medium` | 12px | 16px | Medium (500) | - |
|
|
78
|
+
|
|
79
|
+
### Color Variants
|
|
80
|
+
|
|
81
|
+
| Color | Usage |
|
|
82
|
+
| ------------------- | ---------------------------------- |
|
|
83
|
+
| `default` | Primary text |
|
|
84
|
+
| `secondary` | Secondary information |
|
|
85
|
+
| `tertiary` | Tertiary/subtle text |
|
|
86
|
+
| `inverse` | Text on dark backgrounds |
|
|
87
|
+
| `inverse-secondary` | Secondary text on dark backgrounds |
|
|
88
|
+
| `disabled` | Disabled state text |
|
|
89
|
+
| `accent` | Highlighted/accent text |
|
|
90
|
+
| `critical` | Error messages |
|
|
91
|
+
| `info` | Informational text |
|
|
92
|
+
| `warning` | Warning messages |
|
|
93
|
+
| `positive` | Success messages |
|
|
94
|
+
| `selected` | Selected state text |
|
|
95
|
+
|
|
96
|
+
## Examples
|
|
97
|
+
|
|
98
|
+
### Typography Variants
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
<>
|
|
102
|
+
{/* Headings */}
|
|
103
|
+
<F0Text variant="heading-lg">Large Heading</F0Text>
|
|
104
|
+
<F0Text variant="heading-md">Medium Heading</F0Text>
|
|
105
|
+
<F0Text variant="heading-sm">Small Heading</F0Text>
|
|
106
|
+
|
|
107
|
+
{/* Body with different weights */}
|
|
108
|
+
<F0Text variant="body-md-default">Regular body text</F0Text>
|
|
109
|
+
<F0Text variant="body-md-medium">Medium body text</F0Text>
|
|
110
|
+
<F0Text variant="body-md-semibold">Semibold body text</F0Text>
|
|
111
|
+
|
|
112
|
+
{/* Smaller sizes */}
|
|
113
|
+
<F0Text variant="body-sm-default">Small regular text</F0Text>
|
|
114
|
+
<F0Text variant="body-xs-medium">Extra small medium text</F0Text>
|
|
115
|
+
</>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Colors
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
<>
|
|
122
|
+
<F0Text variant="body-sm-default" color="default">
|
|
123
|
+
Primary text
|
|
124
|
+
</F0Text>
|
|
125
|
+
<F0Text variant="body-sm-default" color="secondary">
|
|
126
|
+
Secondary information
|
|
127
|
+
</F0Text>
|
|
128
|
+
<F0Text variant="body-sm-default" color="critical">
|
|
129
|
+
Error message
|
|
130
|
+
</F0Text>
|
|
131
|
+
<F0Text variant="body-sm-default" color="positive">
|
|
132
|
+
Success message
|
|
133
|
+
</F0Text>
|
|
134
|
+
<F0Text variant="body-sm-default" color="accent">
|
|
135
|
+
Highlighted text
|
|
136
|
+
</F0Text>
|
|
137
|
+
</>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Text Decorations & Transforms
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
<>
|
|
144
|
+
<F0Text variant="body-sm-default" decoration="underline">
|
|
145
|
+
Underlined text
|
|
146
|
+
</F0Text>
|
|
147
|
+
<F0Text variant="body-sm-default" decoration="line-through">
|
|
148
|
+
Strikethrough text
|
|
149
|
+
</F0Text>
|
|
150
|
+
<F0Text variant="body-sm-default" transform="uppercase">
|
|
151
|
+
uppercase text
|
|
152
|
+
</F0Text>
|
|
153
|
+
<F0Text variant="body-sm-default" transform="capitalize">
|
|
154
|
+
capitalize words
|
|
155
|
+
</F0Text>
|
|
156
|
+
</>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Truncation
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
<>
|
|
163
|
+
<F0Text variant="body-sm-default" numberOfLines={1}>
|
|
164
|
+
This long text will be truncated after one line with an ellipsis...
|
|
165
|
+
</F0Text>
|
|
166
|
+
|
|
167
|
+
<F0Text variant="body-md-default" numberOfLines={3}>
|
|
168
|
+
This text can span up to three lines before being truncated with an ellipsis
|
|
169
|
+
at the end. Perfect for card descriptions or preview text.
|
|
170
|
+
</F0Text>
|
|
171
|
+
</>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Spacing & Layout
|
|
175
|
+
|
|
176
|
+
F0Text doesn't accept `className` to prevent typography override. Use a View wrapper for spacing:
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
<>
|
|
180
|
+
{/* Spacing with View wrapper */}
|
|
181
|
+
<View className="mt-4 mb-2">
|
|
182
|
+
<F0Text variant="body-sm-default">Text with margin</F0Text>
|
|
183
|
+
</View>
|
|
184
|
+
|
|
185
|
+
{/* Layout with View wrapper */}
|
|
186
|
+
<View className="flex-1">
|
|
187
|
+
<F0Text variant="body-sm-default">Flexible text</F0Text>
|
|
188
|
+
</View>
|
|
189
|
+
|
|
190
|
+
{/* Icon + Text pattern */}
|
|
191
|
+
<View className="flex-row items-center gap-2">
|
|
192
|
+
<F0Icon icon={Check} size="sm" />
|
|
193
|
+
<F0Text variant="body-sm-default">Success message</F0Text>
|
|
194
|
+
</View>
|
|
195
|
+
</>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Combined Props
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
<F0Text
|
|
202
|
+
variant="heading-md"
|
|
203
|
+
color="accent"
|
|
204
|
+
align="center"
|
|
205
|
+
decoration="underline"
|
|
206
|
+
transform="uppercase"
|
|
207
|
+
>
|
|
208
|
+
Featured Title
|
|
209
|
+
</F0Text>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Nested Text
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
<F0Text variant="body-sm-default">
|
|
216
|
+
This is regular text with{" "}
|
|
217
|
+
<F0Text variant="body-sm-semibold" color="accent">
|
|
218
|
+
bold accent nested text
|
|
219
|
+
</F0Text>{" "}
|
|
220
|
+
inside.
|
|
221
|
+
</F0Text>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Real-world Card Example
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
<View className="rounded-lg bg-f0-background-secondary p-4">
|
|
228
|
+
<View className="mb-2">
|
|
229
|
+
<F0Text variant="heading-sm">Card Title</F0Text>
|
|
230
|
+
</View>
|
|
231
|
+
<F0Text variant="body-sm-default" color="secondary" numberOfLines={2}>
|
|
232
|
+
This is a description that will be truncated after two lines if it's too
|
|
233
|
+
long to fit in the available space.
|
|
234
|
+
</F0Text>
|
|
235
|
+
<View className="mt-2">
|
|
236
|
+
<F0Text variant="body-xs-medium" color="tertiary">
|
|
237
|
+
Last updated 2 hours ago
|
|
238
|
+
</F0Text>
|
|
239
|
+
</View>
|
|
240
|
+
</View>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Architecture
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
F0Text/
|
|
247
|
+
├── F0Text.tsx # Main component
|
|
248
|
+
├── F0Text.md # Documentation
|
|
249
|
+
├── F0Text.types.ts # TypeScript types
|
|
250
|
+
├── F0Text.styles.ts # Tailwind variants config
|
|
251
|
+
├── index.ts # Public exports
|
|
252
|
+
└── __tests__/
|
|
253
|
+
├── index.spec.tsx
|
|
254
|
+
└── __snapshots__/
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Font Family
|
|
258
|
+
|
|
259
|
+
F0Text uses **Inter** font family through Tailwind/Uniwind font weight classes:
|
|
260
|
+
|
|
261
|
+
| Tailwind Class | React Native Font Family | Font Weight |
|
|
262
|
+
| --------------- | ------------------------ | ----------- |
|
|
263
|
+
| `font-normal` | Inter-Regular | 400 |
|
|
264
|
+
| `font-medium` | Inter-Medium | 500 |
|
|
265
|
+
| `font-semibold` | Inter-SemiBold | 600 |
|
|
266
|
+
| `font-bold` | Inter-Bold | 700 |
|
|
267
|
+
|
|
268
|
+
## Accessibility
|
|
269
|
+
|
|
270
|
+
- Fully supports React Native `Text` accessibility props
|
|
271
|
+
- Supports `accessibilityRole`, `accessibilityLabel`, `accessibilityHint`, `accessibilityState`, and `accessible`
|
|
272
|
+
- Proper ellipsis and truncation with `numberOfLines`
|
|
273
|
+
- F0 color system helps ensure sufficient contrast; verify with platform accessibility tools
|
|
274
|
+
|
|
275
|
+
## Performance
|
|
276
|
+
|
|
277
|
+
- **React.memo**: Prevents re-renders when props unchanged
|
|
278
|
+
- **useMemo**: Memoizes className computation
|
|
279
|
+
|
|
280
|
+
### Best Practices
|
|
281
|
+
|
|
282
|
+
```tsx
|
|
283
|
+
// ✅ Good: Use appropriate variant
|
|
284
|
+
<F0Text variant="body-md-semibold">Bold text</F0Text>
|
|
285
|
+
|
|
286
|
+
// ❌ Bad: Don't try to override with className (not supported)
|
|
287
|
+
// <F0Text className="font-bold">Text</F0Text>
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
```tsx
|
|
291
|
+
// ✅ Good: Memoized handler
|
|
292
|
+
const handlePress = useCallback(() => {}, [])
|
|
293
|
+
;<F0Text onPress={handlePress}>Click</F0Text>
|
|
294
|
+
|
|
295
|
+
// ❌ Bad: Inline function
|
|
296
|
+
;<F0Text onPress={() => {}}>Click</F0Text>
|
|
297
|
+
```
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{tv}from"tailwind-variants";export var textVariants=tv({base:"",variants:{variant:{"heading-lg":"text-[24px] leading-[32px] tracking-[-0.2px] font-semibold","heading-md":"text-[20px] leading-[28px] tracking-[-0.2px] font-semibold","heading-sm":"text-[16px] leading-[24px] font-semibold","body-md-default":"text-[16px] leading-[24px] font-normal","body-md-medium":"text-[16px] leading-[24px] font-medium","body-md-semibold":"text-[16px] leading-[24px] font-semibold","body-sm-default":"text-[14px] leading-[20px] font-normal","body-sm-medium":"text-[14px] leading-[20px] font-medium","body-sm-semibold":"text-[14px] leading-[20px] font-semibold","body-xs-medium":"text-[12px] leading-[16px] font-medium"},color:{default:"text-f0-foreground",secondary:"text-f0-foreground-secondary",tertiary:"text-f0-foreground-tertiary",inverse:"text-f0-foreground-inverse","inverse-secondary":"text-f0-foreground-inverse-secondary",disabled:"text-f0-foreground-disabled",accent:"text-f0-foreground-accent",critical:"text-f0-foreground-critical",info:"text-f0-foreground-info",warning:"text-f0-foreground-warning",positive:"text-f0-foreground-positive",selected:"text-f0-foreground-selected"},align:{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"},decoration:{none:"",underline:"underline","line-through":"line-through"},transform:{none:"",uppercase:"uppercase",lowercase:"lowercase",capitalize:"capitalize"}},defaultVariants:{variant:"body-sm-default",color:"default",align:"left",decoration:"none",transform:"none"}});
|
|
2
|
+
//# sourceMappingURL=F0Text.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["tv","textVariants","base","variants","variant","color","default","secondary","tertiary","inverse","disabled","accent","critical","info","warning","positive","selected","align","left","center","right","justify","decoration","none","underline","transform","uppercase","lowercase","capitalize","defaultVariants"],"sourceRoot":"../../../../../src","sources":["components/primitives/F0Text/F0Text.styles.ts"],"mappings":"AAAA,OAASA,EAAE,KAA2B,mBAAmB,CAOzD,MAAO,IAAM,CAAAC,YAAY,CAAGD,EAAE,CAAC,CAC7BE,IAAI,CAAE,EAAE,CACRC,QAAQ,CAAE,CACRC,OAAO,CAAE,CAEP,YAAY,CACV,4DAA4D,CAC9D,YAAY,CACV,4DAA4D,CAC9D,YAAY,CAAE,0CAA0C,CAGxD,iBAAiB,CAAE,wCAAwC,CAC3D,gBAAgB,CAAE,wCAAwC,CAC1D,kBAAkB,CAAE,0CAA0C,CAC9D,iBAAiB,CAAE,wCAAwC,CAC3D,gBAAgB,CAAE,wCAAwC,CAC1D,kBAAkB,CAAE,0CAA0C,CAC9D,gBAAgB,CAAE,wCACpB,CAAC,CACDC,KAAK,CAAE,CACLC,OAAO,CAAE,oBAAoB,CAC7BC,SAAS,CAAE,8BAA8B,CACzCC,QAAQ,CAAE,6BAA6B,CACvCC,OAAO,CAAE,4BAA4B,CACrC,mBAAmB,CAAE,sCAAsC,CAC3DC,QAAQ,CAAE,6BAA6B,CACvCC,MAAM,CAAE,2BAA2B,CACnCC,QAAQ,CAAE,6BAA6B,CACvCC,IAAI,CAAE,yBAAyB,CAC/BC,OAAO,CAAE,4BAA4B,CACrCC,QAAQ,CAAE,6BAA6B,CACvCC,QAAQ,CAAE,6BACZ,CAAC,CACDC,KAAK,CAAE,CACLC,IAAI,CAAE,WAAW,CACjBC,MAAM,CAAE,aAAa,CACrBC,KAAK,CAAE,YAAY,CACnBC,OAAO,CAAE,cACX,CAAC,CACDC,UAAU,CAAE,CACVC,IAAI,CAAE,EAAE,CACRC,SAAS,CAAE,WAAW,CACtB,cAAc,CAAE,cAClB,CAAC,CACDC,SAAS,CAAE,CACTF,IAAI,CAAE,EAAE,CACRG,SAAS,CAAE,WAAW,CACtBC,SAAS,CAAE,WAAW,CACtBC,UAAU,CAAE,YACd,CACF,CAAC,CACDC,eAAe,CAAE,CACfzB,OAAO,CAAE,iBAAiB,CAC1BC,KAAK,CAAE,SAAS,CAChBY,KAAK,CAAE,MAAM,CACbK,UAAU,CAAE,MAAM,CAClBG,SAAS,CAAE,MACb,CACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export var F0_TEXT_BANNED_PROPS=["style","className"];export var TYPOGRAPHY_VARIANTS=["heading-lg","heading-md","heading-sm","body-md-default","body-md-medium","body-md-semibold","body-sm-default","body-sm-medium","body-sm-semibold","body-xs-medium"];export var TEXT_COLORS=["default","secondary","tertiary","inverse","inverse-secondary","disabled","accent","critical","info","warning","positive","selected"];export var TEXT_ALIGN=["left","center","right","justify"];export var TEXT_DECORATIONS=["none","underline","line-through"];export var TEXT_TRANSFORMS=["none","uppercase","lowercase","capitalize"];
|
|
2
|
+
//# sourceMappingURL=F0Text.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["F0_TEXT_BANNED_PROPS","TYPOGRAPHY_VARIANTS","TEXT_COLORS","TEXT_ALIGN","TEXT_DECORATIONS","TEXT_TRANSFORMS"],"sourceRoot":"../../../../../src","sources":["components/primitives/F0Text/F0Text.types.ts"],"mappings":"AAOA,MAAO,IAAM,CAAAA,oBAAoB,CAAG,CAAC,OAAO,CAAE,WAAW,CAAU,CAKnE,MAAO,IAAM,CAAAC,mBAAmB,CAAG,CACjC,YAAY,CACZ,YAAY,CACZ,YAAY,CACZ,iBAAiB,CACjB,gBAAgB,CAChB,kBAAkB,CAClB,iBAAiB,CACjB,gBAAgB,CAChB,kBAAkB,CAClB,gBAAgB,CACR,CAOV,MAAO,IAAM,CAAAC,WAAW,CAAG,CACzB,SAAS,CACT,WAAW,CACX,UAAU,CACV,SAAS,CACT,mBAAmB,CACnB,UAAU,CACV,QAAQ,CACR,UAAU,CACV,MAAM,CACN,SAAS,CACT,UAAU,CACV,UAAU,CACF,CAOV,MAAO,IAAM,CAAAC,UAAU,CAAG,CAAC,MAAM,CAAE,QAAQ,CAAE,OAAO,CAAE,SAAS,CAAU,CAOzE,MAAO,IAAM,CAAAC,gBAAgB,CAAG,CAAC,MAAM,CAAE,WAAW,CAAE,cAAc,CAAU,CAO9E,MAAO,IAAM,CAAAC,eAAe,CAAG,CAC7B,MAAM,CACN,WAAW,CACX,WAAW,CACX,YAAY,CACJ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["F0Text","TYPOGRAPHY_VARIANTS","TEXT_COLORS","TEXT_ALIGN","TEXT_DECORATIONS","TEXT_TRANSFORMS"],"sourceRoot":"../../../../../src","sources":["components/primitives/F0Text/index.ts"],"mappings":"AAMA,OAASA,MAAM,KAAQ,UAAU,CASjC,OACEC,mBAAmB,CACnBC,WAAW,CACXC,UAAU,CACVC,gBAAgB,CAChBC,eAAe,KACV,UAAU","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./components/exports";export*from"./icons";export{cn}from"./lib/utils";
|
|
1
|
+
export*from"./components/exports";export*from"./icons";export{cn,omitProps}from"./lib/utils";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cn"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AACA,WAAc,sBAAsB,CAGpC,WAAc,SAAS,CAGvB,OAASA,EAAE,KAAQ,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["cn","omitProps"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AACA,WAAc,sBAAsB,CAGpC,WAAc,SAAS,CAGvB,OAASA,EAAE,CAAEC,SAAS,KAAQ,aAAa","ignoreList":[]}
|
package/lib/module/lib/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cnMerge}from"tailwind-variants";export function cn(){var _cnMerge;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return(_cnMerge=cnMerge(args)({twMerge:true}))!=null?_cnMerge:"";}
|
|
1
|
+
import{cnMerge}from"tailwind-variants";export function cn(){var _cnMerge;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return(_cnMerge=cnMerge(args)({twMerge:true}))!=null?_cnMerge:"";}export function omitProps(obj,keys){var result=Object.assign({},obj);for(var key of keys){delete result[key];}return result;}
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cnMerge","cn","_cnMerge","_len","arguments","length","args","Array","_key","twMerge"],"sourceRoot":"../../../src","sources":["lib/utils.ts"],"mappings":"AAAA,OAASA,OAAO,KAAwB,mBAAmB,CAE3D,MAAO,SAAS,CAAAC,EAAEA,CAAA,CAA6B,KAAAC,QAAA,SAAAC,IAAA,CAAAC,SAAA,CAAAC,MAAA,CAAzBC,IAAI,KAAAC,KAAA,CAAAJ,IAAA,EAAAK,IAAA,GAAAA,IAAA,CAAAL,IAAA,CAAAK,IAAA,IAAJF,IAAI,CAAAE,IAAA,EAAAJ,SAAA,CAAAI,IAAA,GACxB,OAAAN,QAAA,CACEF,OAAO,CAACM,IAAI,CAAC,CAAC,CACZG,OAAO,CAAE,IACX,CAAC,CAAC,QAAAP,QAAA,CAAI,EAAE,CAEZ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["cnMerge","cn","_cnMerge","_len","arguments","length","args","Array","_key","twMerge","omitProps","obj","keys","result","Object","assign","key"],"sourceRoot":"../../../src","sources":["lib/utils.ts"],"mappings":"AAAA,OAASA,OAAO,KAAwB,mBAAmB,CAE3D,MAAO,SAAS,CAAAC,EAAEA,CAAA,CAA6B,KAAAC,QAAA,SAAAC,IAAA,CAAAC,SAAA,CAAAC,MAAA,CAAzBC,IAAI,KAAAC,KAAA,CAAAJ,IAAA,EAAAK,IAAA,GAAAA,IAAA,CAAAL,IAAA,CAAAK,IAAA,IAAJF,IAAI,CAAAE,IAAA,EAAAJ,SAAA,CAAAI,IAAA,GACxB,OAAAN,QAAA,CACEF,OAAO,CAACM,IAAI,CAAC,CAAC,CACZG,OAAO,CAAE,IACX,CAAC,CAAC,QAAAP,QAAA,CAAI,EAAE,CAEZ,CAUA,MAAO,SAAS,CAAAQ,SAASA,CACvBC,GAAM,CACNC,IAAkB,CACN,CACZ,GAAM,CAAAC,MAAM,CAAAC,MAAA,CAAAC,MAAA,IAAQJ,GAAG,CAAE,CACzB,IAAK,GAAM,CAAAK,GAAG,GAAI,CAAAJ,IAAI,CAAE,CACtB,MAAO,CAAAC,MAAM,CAACG,GAAG,CAAY,CAC/B,CACA,MAAO,CAAAH,MAAM,CACf","ignoreList":[]}
|
|
@@ -13,4 +13,5 @@ export * from "./Tags/exports";
|
|
|
13
13
|
export * from "./experimental/Lists/DataList";
|
|
14
14
|
export * from "./experimental/Lists/DetailsItem";
|
|
15
15
|
export * from "./experimental/Lists/DetailsItemsList";
|
|
16
|
+
export * from "./primitives/F0Text";
|
|
16
17
|
//# sourceMappingURL=exports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/components/exports.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,QAAQ,CAAA;AACtB,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kCAAkC,CAAA;AAChD,cAAc,uCAAuC,CAAA"}
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/components/exports.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,QAAQ,CAAA;AACtB,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kCAAkC,CAAA;AAChD,cAAc,uCAAuC,CAAA;AAGrD,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text as RNText } from "react-native";
|
|
3
|
+
import { type F0TextProps } from "./F0Text.types";
|
|
4
|
+
export declare const F0Text: React.MemoExoticComponent<React.ForwardRefExoticComponent<F0TextProps & React.RefAttributes<RNText>>>;
|
|
5
|
+
export type { F0TextProps };
|
|
6
|
+
export { TYPOGRAPHY_VARIANTS, TEXT_COLORS, TEXT_ALIGN, TEXT_DECORATIONS, TEXT_TRANSFORMS, } from "./F0Text.types";
|
|
7
|
+
export type { TypographyVariant, TextColor, TextAlign, TextDecoration, TextTransform, } from "./F0Text.types";
|
|
8
|
+
//# sourceMappingURL=F0Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"F0Text.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Text/F0Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AAK7C,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAoDvE,eAAO,MAAM,MAAM,uGAA8B,CAAA;AAGjD,YAAY,EAAE,WAAW,EAAE,CAAA;AAC3B,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EACV,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,cAAc,EACd,aAAa,GACd,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
/**
|
|
3
|
+
* Text component variants using tailwind-variants
|
|
4
|
+
* Font weights (font-normal, font-medium, font-semibold) map to
|
|
5
|
+
* Inter font families (Inter-Regular, Inter-Medium, Inter-SemiBold)
|
|
6
|
+
*/
|
|
7
|
+
export declare const textVariants: import("tailwind-variants").TVReturnType<{
|
|
8
|
+
variant: {
|
|
9
|
+
"heading-lg": string;
|
|
10
|
+
"heading-md": string;
|
|
11
|
+
"heading-sm": string;
|
|
12
|
+
"body-md-default": string;
|
|
13
|
+
"body-md-medium": string;
|
|
14
|
+
"body-md-semibold": string;
|
|
15
|
+
"body-sm-default": string;
|
|
16
|
+
"body-sm-medium": string;
|
|
17
|
+
"body-sm-semibold": string;
|
|
18
|
+
"body-xs-medium": string;
|
|
19
|
+
};
|
|
20
|
+
color: {
|
|
21
|
+
default: string;
|
|
22
|
+
secondary: string;
|
|
23
|
+
tertiary: string;
|
|
24
|
+
inverse: string;
|
|
25
|
+
"inverse-secondary": string;
|
|
26
|
+
disabled: string;
|
|
27
|
+
accent: string;
|
|
28
|
+
critical: string;
|
|
29
|
+
info: string;
|
|
30
|
+
warning: string;
|
|
31
|
+
positive: string;
|
|
32
|
+
selected: string;
|
|
33
|
+
};
|
|
34
|
+
align: {
|
|
35
|
+
left: string;
|
|
36
|
+
center: string;
|
|
37
|
+
right: string;
|
|
38
|
+
justify: string;
|
|
39
|
+
};
|
|
40
|
+
decoration: {
|
|
41
|
+
none: string;
|
|
42
|
+
underline: string;
|
|
43
|
+
"line-through": string;
|
|
44
|
+
};
|
|
45
|
+
transform: {
|
|
46
|
+
none: string;
|
|
47
|
+
uppercase: string;
|
|
48
|
+
lowercase: string;
|
|
49
|
+
capitalize: string;
|
|
50
|
+
};
|
|
51
|
+
}, undefined, "", {
|
|
52
|
+
variant: {
|
|
53
|
+
"heading-lg": string;
|
|
54
|
+
"heading-md": string;
|
|
55
|
+
"heading-sm": string;
|
|
56
|
+
"body-md-default": string;
|
|
57
|
+
"body-md-medium": string;
|
|
58
|
+
"body-md-semibold": string;
|
|
59
|
+
"body-sm-default": string;
|
|
60
|
+
"body-sm-medium": string;
|
|
61
|
+
"body-sm-semibold": string;
|
|
62
|
+
"body-xs-medium": string;
|
|
63
|
+
};
|
|
64
|
+
color: {
|
|
65
|
+
default: string;
|
|
66
|
+
secondary: string;
|
|
67
|
+
tertiary: string;
|
|
68
|
+
inverse: string;
|
|
69
|
+
"inverse-secondary": string;
|
|
70
|
+
disabled: string;
|
|
71
|
+
accent: string;
|
|
72
|
+
critical: string;
|
|
73
|
+
info: string;
|
|
74
|
+
warning: string;
|
|
75
|
+
positive: string;
|
|
76
|
+
selected: string;
|
|
77
|
+
};
|
|
78
|
+
align: {
|
|
79
|
+
left: string;
|
|
80
|
+
center: string;
|
|
81
|
+
right: string;
|
|
82
|
+
justify: string;
|
|
83
|
+
};
|
|
84
|
+
decoration: {
|
|
85
|
+
none: string;
|
|
86
|
+
underline: string;
|
|
87
|
+
"line-through": string;
|
|
88
|
+
};
|
|
89
|
+
transform: {
|
|
90
|
+
none: string;
|
|
91
|
+
uppercase: string;
|
|
92
|
+
lowercase: string;
|
|
93
|
+
capitalize: string;
|
|
94
|
+
};
|
|
95
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
96
|
+
variant: {
|
|
97
|
+
"heading-lg": string;
|
|
98
|
+
"heading-md": string;
|
|
99
|
+
"heading-sm": string;
|
|
100
|
+
"body-md-default": string;
|
|
101
|
+
"body-md-medium": string;
|
|
102
|
+
"body-md-semibold": string;
|
|
103
|
+
"body-sm-default": string;
|
|
104
|
+
"body-sm-medium": string;
|
|
105
|
+
"body-sm-semibold": string;
|
|
106
|
+
"body-xs-medium": string;
|
|
107
|
+
};
|
|
108
|
+
color: {
|
|
109
|
+
default: string;
|
|
110
|
+
secondary: string;
|
|
111
|
+
tertiary: string;
|
|
112
|
+
inverse: string;
|
|
113
|
+
"inverse-secondary": string;
|
|
114
|
+
disabled: string;
|
|
115
|
+
accent: string;
|
|
116
|
+
critical: string;
|
|
117
|
+
info: string;
|
|
118
|
+
warning: string;
|
|
119
|
+
positive: string;
|
|
120
|
+
selected: string;
|
|
121
|
+
};
|
|
122
|
+
align: {
|
|
123
|
+
left: string;
|
|
124
|
+
center: string;
|
|
125
|
+
right: string;
|
|
126
|
+
justify: string;
|
|
127
|
+
};
|
|
128
|
+
decoration: {
|
|
129
|
+
none: string;
|
|
130
|
+
underline: string;
|
|
131
|
+
"line-through": string;
|
|
132
|
+
};
|
|
133
|
+
transform: {
|
|
134
|
+
none: string;
|
|
135
|
+
uppercase: string;
|
|
136
|
+
lowercase: string;
|
|
137
|
+
capitalize: string;
|
|
138
|
+
};
|
|
139
|
+
}, undefined, "", unknown, unknown, undefined>>;
|
|
140
|
+
export type TextVariants = VariantProps<typeof textVariants>;
|
|
141
|
+
//# sourceMappingURL=F0Text.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"F0Text.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Text/F0Text.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEzD;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA2DvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { TextProps as RNTextProps } from "react-native";
|
|
2
|
+
/**
|
|
3
|
+
* Props that must not be passed through to the underlying RN Text
|
|
4
|
+
* (`style` and `className` are handled by F0 instead).
|
|
5
|
+
* Used with omitProps for runtime safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const F0_TEXT_BANNED_PROPS: readonly ["style", "className"];
|
|
8
|
+
/**
|
|
9
|
+
* Typography variant types based on semantic design tokens
|
|
10
|
+
*/
|
|
11
|
+
export declare const TYPOGRAPHY_VARIANTS: readonly ["heading-lg", "heading-md", "heading-sm", "body-md-default", "body-md-medium", "body-md-semibold", "body-sm-default", "body-sm-medium", "body-sm-semibold", "body-xs-medium"];
|
|
12
|
+
export type TypographyVariant = (typeof TYPOGRAPHY_VARIANTS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* Text color variants aligned with F0 semantic color system
|
|
15
|
+
*/
|
|
16
|
+
export declare const TEXT_COLORS: readonly ["default", "secondary", "tertiary", "inverse", "inverse-secondary", "disabled", "accent", "critical", "info", "warning", "positive", "selected"];
|
|
17
|
+
export type TextColor = (typeof TEXT_COLORS)[number];
|
|
18
|
+
/**
|
|
19
|
+
* Text alignment options
|
|
20
|
+
*/
|
|
21
|
+
export declare const TEXT_ALIGN: readonly ["left", "center", "right", "justify"];
|
|
22
|
+
export type TextAlign = (typeof TEXT_ALIGN)[number];
|
|
23
|
+
/**
|
|
24
|
+
* Text decoration options
|
|
25
|
+
*/
|
|
26
|
+
export declare const TEXT_DECORATIONS: readonly ["none", "underline", "line-through"];
|
|
27
|
+
export type TextDecoration = (typeof TEXT_DECORATIONS)[number];
|
|
28
|
+
/**
|
|
29
|
+
* Text transform options
|
|
30
|
+
*/
|
|
31
|
+
export declare const TEXT_TRANSFORMS: readonly ["none", "uppercase", "lowercase", "capitalize"];
|
|
32
|
+
export type TextTransform = (typeof TEXT_TRANSFORMS)[number];
|
|
33
|
+
/**
|
|
34
|
+
* Internal props for the F0Text component.
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
interface F0TextPropsInternal extends Omit<RNTextProps, "style"> {
|
|
38
|
+
/**
|
|
39
|
+
* Semantic typography variant
|
|
40
|
+
* @default "body-sm-default"
|
|
41
|
+
*/
|
|
42
|
+
variant?: TypographyVariant;
|
|
43
|
+
/**
|
|
44
|
+
* Text color from F0 semantic color system
|
|
45
|
+
* @default "default"
|
|
46
|
+
*/
|
|
47
|
+
color?: TextColor;
|
|
48
|
+
/**
|
|
49
|
+
* Text alignment
|
|
50
|
+
* @default "left"
|
|
51
|
+
*/
|
|
52
|
+
align?: TextAlign;
|
|
53
|
+
/**
|
|
54
|
+
* Text decoration
|
|
55
|
+
* @default "none"
|
|
56
|
+
*/
|
|
57
|
+
decoration?: TextDecoration;
|
|
58
|
+
/**
|
|
59
|
+
* Text transform
|
|
60
|
+
* @default "none"
|
|
61
|
+
*/
|
|
62
|
+
transform?: TextTransform;
|
|
63
|
+
/**
|
|
64
|
+
* Maximum number of lines before truncating with ellipsis
|
|
65
|
+
*/
|
|
66
|
+
numberOfLines?: number;
|
|
67
|
+
/**
|
|
68
|
+
* Children content
|
|
69
|
+
*/
|
|
70
|
+
children?: React.ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* Excluded from public API via Omit<F0TextPropsInternal, "className">.
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Public props for the F0Text component
|
|
79
|
+
*
|
|
80
|
+
* Note: `className` and `style` props are NOT available.
|
|
81
|
+
* Use semantic props (variant, color, align, etc.) for typography.
|
|
82
|
+
* For spacing/layout, wrap F0Text in a View with className.
|
|
83
|
+
*/
|
|
84
|
+
export type F0TextProps = Omit<F0TextPropsInternal, "className">;
|
|
85
|
+
export {};
|
|
86
|
+
//# sourceMappingURL=F0Text.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"F0Text.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Text/F0Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAA;AAE5D;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,iCAAkC,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,mBAAmB,yLAWtB,CAAA;AAEV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE;;GAEG;AACH,eAAO,MAAM,WAAW,4JAad,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,UAAU,iDAAkD,CAAA;AAEzE,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;AAEnD;;GAEG;AACH,eAAO,MAAM,gBAAgB,gDAAiD,CAAA;AAE9E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9D;;GAEG;AACH,eAAO,MAAM,eAAe,2DAKlB,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE5D;;;GAGG;AACH,UAAU,mBAAoB,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9D;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAA;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,aAAa,CAAA;IAEzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* F0Text - Text primitive component
|
|
3
|
+
*
|
|
4
|
+
* @see F0Text.md for documentation
|
|
5
|
+
*/
|
|
6
|
+
export { F0Text } from "./F0Text";
|
|
7
|
+
export type { F0TextProps, TypographyVariant, TextColor, TextAlign, TextDecoration, TextTransform, } from "./F0Text";
|
|
8
|
+
export { TYPOGRAPHY_VARIANTS, TEXT_COLORS, TEXT_ALIGN, TEXT_DECORATIONS, TEXT_TRANSFORMS, } from "./F0Text";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Text/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,cAAc,EACd,aAAa,GACd,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,UAAU,CAAA"}
|