@istmx/ui 0.1.0 → 0.1.2
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 +4 -0
- package/bin/istmx.mjs +10 -5
- package/package.json +2 -2
- package/registry/animated-text.tsx +12 -2
package/README.md
CHANGED
|
@@ -21,6 +21,10 @@ installs any missing `motion`, `clsx`, and `tailwind-merge` dependencies. The
|
|
|
21
21
|
component uses Tailwind utility classes, so your app should already have
|
|
22
22
|
Tailwind CSS configured.
|
|
23
23
|
|
|
24
|
+
The Animated Text component exposes `textClassName` for text styling and
|
|
25
|
+
`effectOptions.shimmer.color` / `effectOptions.shimmer.highlight` for custom
|
|
26
|
+
shimmer colors. Component names can be entered with spaces or hyphens.
|
|
27
|
+
|
|
24
28
|
## Options
|
|
25
29
|
|
|
26
30
|
- `--no-install` writes the source files and prints the dependency command.
|
package/bin/istmx.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { access, mkdir, readFile, writeFile } from 'node:fs/promises'
|
|
|
6
6
|
import path from 'node:path'
|
|
7
7
|
import { fileURLToPath } from 'node:url'
|
|
8
8
|
|
|
9
|
-
const VERSION = '0.1.
|
|
9
|
+
const VERSION = '0.1.2'
|
|
10
10
|
const DEPENDENCIES = ['motion', 'clsx', 'tailwind-merge']
|
|
11
11
|
const COMMANDS = {
|
|
12
12
|
npm: ['install'],
|
|
@@ -30,8 +30,9 @@ const green = (value) => color('32;1', value)
|
|
|
30
30
|
const red = (value) => color('31;1', value)
|
|
31
31
|
|
|
32
32
|
function printHeader() {
|
|
33
|
-
console.log(`\n${cyan('
|
|
34
|
-
console.log(muted('
|
|
33
|
+
console.log(`\n${cyan('┌')} ${cyan('ISTMX UI')} ${muted(`v${VERSION}`)}`)
|
|
34
|
+
console.log(`${cyan('│')} ${muted('Editable components for your codebase')}`)
|
|
35
|
+
console.log(`${cyan('└')}${muted('─'.repeat(42))}\n`)
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
function printStep(label) {
|
|
@@ -161,7 +162,7 @@ function installDependencies(manager, dependencies) {
|
|
|
161
162
|
async function addComponent(component, options) {
|
|
162
163
|
if (component !== 'animated-text') {
|
|
163
164
|
throw new Error(
|
|
164
|
-
`Unknown component "${component}".
|
|
165
|
+
`Unknown component "${component}". Available component: animated-text. Use \`istmx add animated-text\`.`,
|
|
165
166
|
)
|
|
166
167
|
}
|
|
167
168
|
|
|
@@ -213,7 +214,11 @@ async function addComponent(component, options) {
|
|
|
213
214
|
console.log(` ${muted('Dependencies')} ${cyan(DEPENDENCIES.join(', '))}\n`)
|
|
214
215
|
}
|
|
215
216
|
|
|
216
|
-
const [command,
|
|
217
|
+
const [command, ...argumentsList] = process.argv.slice(2)
|
|
218
|
+
const component = argumentsList
|
|
219
|
+
.filter((argument) => !argument.startsWith('--'))
|
|
220
|
+
.join('-')
|
|
221
|
+
.toLowerCase()
|
|
217
222
|
const options = {
|
|
218
223
|
noInstall: argumentsList.includes('--no-install'),
|
|
219
224
|
overwrite: argumentsList.includes('--overwrite'),
|
package/package.json
CHANGED
|
@@ -26,7 +26,12 @@ export type AnimatedTextEffectOptions = {
|
|
|
26
26
|
blur?: { amount?: number }
|
|
27
27
|
fade?: { from?: number }
|
|
28
28
|
slide?: { distance?: number }
|
|
29
|
-
shimmer?: {
|
|
29
|
+
shimmer?: {
|
|
30
|
+
duration?: number
|
|
31
|
+
width?: number
|
|
32
|
+
color?: string
|
|
33
|
+
highlight?: string
|
|
34
|
+
}
|
|
30
35
|
wave?: { amplitude?: number; stagger?: number }
|
|
31
36
|
}
|
|
32
37
|
|
|
@@ -73,6 +78,9 @@ export function AnimatedText({
|
|
|
73
78
|
80,
|
|
74
79
|
Math.max(5, effectOptions?.shimmer?.width ?? 30),
|
|
75
80
|
)
|
|
81
|
+
const shimmerColor = effectOptions?.shimmer?.color ?? 'var(--muted, #71717a)'
|
|
82
|
+
const shimmerHighlight =
|
|
83
|
+
effectOptions?.shimmer?.highlight ?? 'var(--foreground, #18181b)'
|
|
76
84
|
const slideDistance = Math.max(
|
|
77
85
|
0,
|
|
78
86
|
effectOptions?.slide?.distance ?? Math.abs(offset.enter),
|
|
@@ -167,7 +175,7 @@ export function AnimatedText({
|
|
|
167
175
|
'font-medium whitespace-nowrap',
|
|
168
176
|
activeEffects.has('shimmer') &&
|
|
169
177
|
(shimmerEnabled
|
|
170
|
-
? 'bg-[linear-gradient(100deg,var(--
|
|
178
|
+
? 'bg-[linear-gradient(100deg,var(--shimmer-color)_var(--shimmer-start),var(--shimmer-highlight)_50%,var(--shimmer-color)_var(--shimmer-end))] bg-[length:220%_100%] bg-clip-text text-transparent'
|
|
171
179
|
: 'text-foreground'),
|
|
172
180
|
textClassName,
|
|
173
181
|
)}
|
|
@@ -175,6 +183,8 @@ export function AnimatedText({
|
|
|
175
183
|
{
|
|
176
184
|
'--shimmer-start': 50 - shimmerWidth / 2 + '%',
|
|
177
185
|
'--shimmer-end': 50 + shimmerWidth / 2 + '%',
|
|
186
|
+
'--shimmer-color': shimmerColor,
|
|
187
|
+
'--shimmer-highlight': shimmerHighlight,
|
|
178
188
|
} as CSSProperties
|
|
179
189
|
}
|
|
180
190
|
>
|