@vvedantb/ui 0.15.0 → 0.15.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/package.json +1 -1
- package/src/ui/clear-input.tsx +18 -18
- package/tokens/README.md +1 -1
- package/tokens/src/css/clear-input.css +26 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvedantb/ui",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared React 19 UI for web apps: one JavaScript entry (primitives, shell pieces, app helpers including the Convex and Clerk provider, VITE env parsing and ensure-user, artifact viewers over the @vvedantb/server artifacts core, native tokens), design-token CSS, shared Tailwind v4 CSS and a Tailwind preset.",
|
|
6
6
|
"type": "module",
|
package/src/ui/clear-input.tsx
CHANGED
|
@@ -130,25 +130,25 @@ const ClearInput = React.forwardRef<HTMLInputElement, ClearInputProps>(
|
|
|
130
130
|
)}
|
|
131
131
|
{...props}
|
|
132
132
|
/>
|
|
133
|
-
<div
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
133
|
+
<div className="t-clear-clip" aria-hidden="true">
|
|
134
|
+
<div
|
|
135
|
+
ref={mirrorRef}
|
|
136
|
+
className={cn(
|
|
137
|
+
"t-clear-mirror border-0 bg-transparent text-foreground shadow-none",
|
|
138
|
+
fieldClassName,
|
|
139
|
+
)}
|
|
140
|
+
/>
|
|
141
|
+
<div
|
|
142
|
+
ref={placeholderRef}
|
|
143
|
+
className={cn(
|
|
144
|
+
"t-clear-placeholder border-0 bg-transparent text-field-placeholder shadow-none",
|
|
145
|
+
fieldClassName,
|
|
146
|
+
)}
|
|
147
|
+
>
|
|
148
|
+
{placeholder}
|
|
149
|
+
</div>
|
|
150
|
+
<div ref={glowRef} className="t-clear-glow" />
|
|
150
151
|
</div>
|
|
151
|
-
<div ref={glowRef} className="t-clear-glow" aria-hidden="true" />
|
|
152
152
|
{value.length > 0 && !clearing ? (
|
|
153
153
|
<button
|
|
154
154
|
type="button"
|
package/tokens/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Design tokens and shared Tailwind v4 CSS for the vvedantb web apps. The CSS and
|
|
|
15
15
|
| `@vvedantb/ui/tokens/css/tabs-pills.css` | `src/css/tabs-pills.css` | `--tabs-*` colour variables, `.t-tabs--segmented`, `.t-tabs--pills` and pill hover / active fills. |
|
|
16
16
|
| `@vvedantb/ui/tokens/css/utilities.css` | `src/css/utilities.css` | `@utility hit-target` and `@utility reveal-on-hover`. `rounded-surface` moved to `tokens.css` in 0.7.1. |
|
|
17
17
|
| `@vvedantb/ui/tokens/css/scrollbar-thin.css` | `src/css/scrollbar-thin.css` | `.scrollbar-thin` (`@layer utilities`, always emitted). Imported by `tokens.css` from 0.15.0. |
|
|
18
|
-
| `@vvedantb/ui/tokens/css/clear-input.css` | `src/css/clear-input.css` | `ClearInput` layers (`.t-clear*`) and the `--clear-*` / `--glow-*` timings. Imported by `tokens.css`. |
|
|
18
|
+
| `@vvedantb/ui/tokens/css/clear-input.css` | `src/css/clear-input.css` | `ClearInput` layers (`.t-clear*`) and the `--clear-*` / `--glow-*` timings. Imported by `tokens.css`. From 0.15.1 the layers clip in `.t-clear-clip`, so `.t-clear` keeps the focus ring, and the placeholder layer only shows during `.is-clearing`. |
|
|
19
19
|
| `@vvedantb/ui/tokens/css/motion.css` | `src/css/motion.css` | `.ui-page-enter`, `.ui-enter`, `.ui-enter-up`, `.ui-stagger`, their keyframes and reduced-motion rules, and the `html[data-page-motion="off"]` overrides for `PageMotionProvider`. Imported by `tokens.css`. |
|
|
20
20
|
| `@vvedantb/ui/tokens/css/animations.css` | `src/css/animations.css` | `animate-aurora`, `animate-fade-in-up`, `animate-indeterminate` as `@theme` (CSS-first apps). |
|
|
21
21
|
| `@vvedantb/ui/tokens/css/compat-shadcn-rgb.css`, `@vvedantb/ui/tokens/compat/shadcn-rgb.css` | `src/css/compat-shadcn-rgb.css` | Replaces `tokens.css` for apps with shadcn-style `R G B` channel variables. Defines only the UI-only `--color-*` names as `rgb(var(--x) / alpha)` references, `--radius-field`, `--scrollbar`, `--field-radius`, the same three radius utilities as `tokens.css` and `.glass-panel-strong` (solid `--popover` from 0.15.0). Import it **or** `tokens.css`, never both. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @vvedantb/ui/tokens/css/clear-input.css: layers for @vvedantb/ui
|
|
3
|
-
* ClearInput (`.t-clear`, mirror, placeholder and glow), the transitions.dev
|
|
3
|
+
* ClearInput (`.t-clear`, clip, mirror, placeholder and glow), the transitions.dev
|
|
4
4
|
* input clear with dissolve. tokens.css imports it.
|
|
5
5
|
*
|
|
6
6
|
* clearInputDissolve reads the variables below from `html`. Set any of them
|
|
@@ -27,39 +27,50 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@layer components {
|
|
30
|
+
/* No overflow clip on .t-clear: it would cut the input's focus ring.
|
|
31
|
+
.t-clear-clip clips the layers to the field instead. It never moves, so
|
|
32
|
+
the mirror and placeholder can fly in and out under it. Its radius
|
|
33
|
+
follows .t-clear; put a rounded-* class on wrapperClassName to match an
|
|
34
|
+
input with another radius. */
|
|
30
35
|
.t-clear {
|
|
31
36
|
position: relative;
|
|
32
|
-
|
|
37
|
+
border-radius: var(--radius-field, 0);
|
|
33
38
|
}
|
|
39
|
+
.t-clear-clip,
|
|
34
40
|
.t-clear-mirror,
|
|
35
|
-
.t-clear-placeholder
|
|
41
|
+
.t-clear-placeholder,
|
|
42
|
+
.t-clear-glow {
|
|
36
43
|
position: absolute;
|
|
37
44
|
inset: 0;
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
45
|
pointer-events: none;
|
|
41
|
-
white-space: nowrap;
|
|
42
46
|
overflow: hidden;
|
|
43
|
-
z-index: 2;
|
|
44
47
|
}
|
|
45
|
-
.t-clear-
|
|
48
|
+
.t-clear-clip {
|
|
49
|
+
border-radius: inherit;
|
|
50
|
+
}
|
|
51
|
+
.t-clear-mirror,
|
|
52
|
+
.t-clear-placeholder {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
white-space: nowrap;
|
|
46
56
|
opacity: 0;
|
|
57
|
+
z-index: 2;
|
|
47
58
|
}
|
|
59
|
+
/* The input's own placeholder shows at rest. The layer only shows while
|
|
60
|
+
clearInputDissolve drops it in, and the native one hides meanwhile. */
|
|
48
61
|
.t-clear.has-value .t-clear-mirror,
|
|
49
|
-
.t-clear.is-clearing .t-clear-mirror
|
|
62
|
+
.t-clear.is-clearing .t-clear-mirror,
|
|
63
|
+
.t-clear.is-clearing .t-clear-placeholder {
|
|
50
64
|
opacity: 1;
|
|
51
65
|
}
|
|
66
|
+
.t-clear.is-clearing > input::placeholder {
|
|
67
|
+
opacity: 0;
|
|
68
|
+
}
|
|
52
69
|
.t-clear.has-value > input,
|
|
53
70
|
.t-clear.is-clearing > input {
|
|
54
71
|
-webkit-text-fill-color: transparent;
|
|
55
72
|
}
|
|
56
|
-
.t-clear.has-value .t-clear-placeholder {
|
|
57
|
-
opacity: 0;
|
|
58
|
-
}
|
|
59
73
|
.t-clear-glow {
|
|
60
|
-
position: absolute;
|
|
61
|
-
inset: 0;
|
|
62
|
-
pointer-events: none;
|
|
63
74
|
opacity: 0;
|
|
64
75
|
z-index: 3;
|
|
65
76
|
mix-blend-mode: multiply;
|