@tachui/primitives 0.11.0 → 0.11.1
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 +19 -19
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ ZStack({
|
|
|
58
58
|
children: [
|
|
59
59
|
Image('/hero-background.jpg'),
|
|
60
60
|
Text('Overlay Text')
|
|
61
|
-
.
|
|
61
|
+
.padding(16)
|
|
62
62
|
.backgroundColor('rgba(0,0,0,0.7)')
|
|
63
63
|
.foregroundColor('white')
|
|
64
64
|
,
|
|
@@ -98,7 +98,7 @@ Displays text content with full typography control.
|
|
|
98
98
|
|
|
99
99
|
```typescript
|
|
100
100
|
Text('Hello, tachUI!')
|
|
101
|
-
.
|
|
101
|
+
.font({ family: 'San Francisco', size: 18, weight: 600 })
|
|
102
102
|
.foregroundColor('#007AFF')
|
|
103
103
|
.textAlign('center')
|
|
104
104
|
|
|
@@ -108,7 +108,7 @@ Text('Hello, tachUI!')
|
|
|
108
108
|
|
|
109
109
|
```typescript
|
|
110
110
|
// Multiline text with line clamping
|
|
111
|
-
Text(longContent).
|
|
111
|
+
Text(longContent).lineClamp(3).wordBreak('break-word')
|
|
112
112
|
|
|
113
113
|
// Reactive text content
|
|
114
114
|
const [count, setCount] = createSignal(0)
|
|
@@ -121,7 +121,7 @@ Displays images with loading states and aspect ratio control.
|
|
|
121
121
|
|
|
122
122
|
```typescript
|
|
123
123
|
Image('/path/to/image.jpg')
|
|
124
|
-
.
|
|
124
|
+
.size({ width: 200, height: 150 })
|
|
125
125
|
.cornerRadius(8)
|
|
126
126
|
.aspectRatio('cover')
|
|
127
127
|
|
|
@@ -133,7 +133,7 @@ Image('/path/to/image.jpg')
|
|
|
133
133
|
import { Assets } from '@tachui/core'
|
|
134
134
|
|
|
135
135
|
Image(Assets.profilePicture)
|
|
136
|
-
.
|
|
136
|
+
.size({ width: 60, height: 60 })
|
|
137
137
|
.cornerRadius(30)
|
|
138
138
|
|
|
139
139
|
```
|
|
@@ -159,7 +159,7 @@ Interactive button component with full customization support.
|
|
|
159
159
|
Button('Click Me', () => {
|
|
160
160
|
console.log('Button clicked!')
|
|
161
161
|
})
|
|
162
|
-
.
|
|
162
|
+
.padding({ horizontal: 16, vertical: 8 })
|
|
163
163
|
.backgroundColor('#007AFF')
|
|
164
164
|
.foregroundColor('white')
|
|
165
165
|
.cornerRadius(8)
|
|
@@ -170,7 +170,7 @@ Button('Click Me', () => {
|
|
|
170
170
|
|
|
171
171
|
```typescript
|
|
172
172
|
Button('Stateful Button', handleClick)
|
|
173
|
-
.
|
|
173
|
+
.backgroundColor('#007AFF')
|
|
174
174
|
.hover({ backgroundColor: '#0051D5' })
|
|
175
175
|
.active({ transform: 'scale(0.95)' })
|
|
176
176
|
.disabled({ opacity: 0.5 })
|
|
@@ -188,7 +188,7 @@ Toggle({
|
|
|
188
188
|
isOn: () => isEnabled(),
|
|
189
189
|
onToggle: setIsEnabled,
|
|
190
190
|
})
|
|
191
|
-
.
|
|
191
|
+
.accentColor('#007AFF')
|
|
192
192
|
|
|
193
193
|
```
|
|
194
194
|
|
|
@@ -222,7 +222,7 @@ BasicInput({
|
|
|
222
222
|
onInput: setText,
|
|
223
223
|
placeholder: 'Enter your name',
|
|
224
224
|
})
|
|
225
|
-
.
|
|
225
|
+
.padding(12)
|
|
226
226
|
.border(1, '#E5E5EA')
|
|
227
227
|
.cornerRadius(8)
|
|
228
228
|
|
|
@@ -269,8 +269,8 @@ VStack({
|
|
|
269
269
|
HStack({
|
|
270
270
|
alignment: 'center',
|
|
271
271
|
children: [
|
|
272
|
-
Image(Assets.logo).
|
|
273
|
-
Text('My App').
|
|
272
|
+
Image(Assets.logo).size({ width: 40, height: 40 }),
|
|
273
|
+
Text('My App').font({ size: 24, weight: 'bold' }),
|
|
274
274
|
Spacer(),
|
|
275
275
|
Button('Menu', toggleMenu),
|
|
276
276
|
],
|
|
@@ -281,7 +281,7 @@ VStack({
|
|
|
281
281
|
spacing: 16,
|
|
282
282
|
children: [
|
|
283
283
|
Text('Welcome to tachUI!')
|
|
284
|
-
.
|
|
284
|
+
.font({ size: 18 })
|
|
285
285
|
.textAlign('center')
|
|
286
286
|
,
|
|
287
287
|
|
|
@@ -292,7 +292,7 @@ VStack({
|
|
|
292
292
|
children: [
|
|
293
293
|
Button('Get Started', startOnboarding),
|
|
294
294
|
Button('Learn More', openDocs)
|
|
295
|
-
.
|
|
295
|
+
.backgroundColor('transparent')
|
|
296
296
|
.foregroundColor('#007AFF')
|
|
297
297
|
,
|
|
298
298
|
],
|
|
@@ -312,7 +312,7 @@ VStack({
|
|
|
312
312
|
spacing: { mobile: 8, desktop: 16 },
|
|
313
313
|
children: [
|
|
314
314
|
Image(item.image)
|
|
315
|
-
.
|
|
315
|
+
.size({ mobile: 40, desktop: 60 })
|
|
316
316
|
.cornerRadius({ mobile: 4, desktop: 8 })
|
|
317
317
|
,
|
|
318
318
|
|
|
@@ -320,11 +320,11 @@ VStack({
|
|
|
320
320
|
alignment: 'leading',
|
|
321
321
|
children: [
|
|
322
322
|
Text(item.title)
|
|
323
|
-
.
|
|
323
|
+
.font({ size: { mobile: 16, desktop: 18 } })
|
|
324
324
|
,
|
|
325
325
|
|
|
326
326
|
Text(item.description)
|
|
327
|
-
.
|
|
327
|
+
.font({ size: { mobile: 14, desktop: 16 } })
|
|
328
328
|
.opacity(0.7)
|
|
329
329
|
,
|
|
330
330
|
],
|
|
@@ -347,7 +347,7 @@ All primitive components include comprehensive accessibility support:
|
|
|
347
347
|
|
|
348
348
|
```typescript
|
|
349
349
|
Button('Accessible Button', handleClick)
|
|
350
|
-
.
|
|
350
|
+
.accessibilityLabel('Save document')
|
|
351
351
|
.accessibilityRole('button')
|
|
352
352
|
.accessibilityHint('Saves the current document')
|
|
353
353
|
|
|
@@ -361,7 +361,7 @@ Primitives work seamlessly with the modifier system:
|
|
|
361
361
|
import { padding, margin, backgroundColor } from '@tachui/modifiers'
|
|
362
362
|
|
|
363
363
|
Text('Styled with modifiers')
|
|
364
|
-
.
|
|
364
|
+
.apply(padding(16))
|
|
365
365
|
.apply(margin({ vertical: 8 }))
|
|
366
366
|
.apply(backgroundColor('#F2F2F7'))
|
|
367
367
|
|
|
@@ -431,7 +431,7 @@ VStack({
|
|
|
431
431
|
Image(userAvatar),
|
|
432
432
|
Text(userName),
|
|
433
433
|
Spacer(),
|
|
434
|
-
Text('>').
|
|
434
|
+
Text('>').opacity(0.5),
|
|
435
435
|
],
|
|
436
436
|
}),
|
|
437
437
|
}),
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachui/primitives",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Basic UI components for tachUI framework",
|
|
5
5
|
"homepage": "https://tachui.dev/",
|
|
6
6
|
"type": "module",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"lint": "oxlint src"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@tachui/core": "0.11.
|
|
52
|
-
"@tachui/modifiers": "0.11.
|
|
51
|
+
"@tachui/core": "0.11.1",
|
|
52
|
+
"@tachui/modifiers": "0.11.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^20.0.0",
|