@vvedantb/ui 0.33.0 → 0.34.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vvedantb/ui",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "license": "MIT",
5
5
  "description": "Shared React 19 UI for web apps: one main 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), a client entry without @vvedantb/server, convex or Clerk for Chrome extensions, design-token CSS, shared Tailwind v4 CSS, a Tailwind preset and packaged Instrument Sans fonts.",
6
6
  "type": "module",
package/tokens/README.md CHANGED
@@ -13,7 +13,7 @@ Design tokens and shared Tailwind v4 CSS for the vvedantb web apps. The CSS and
13
13
  | `@vvedantb/ui/tokens/css/modal.css` | `src/css/modal.css` | `.t-modal`, `.is-open`, `.is-closing` and `t-modal-presence-wait` (`@layer components`). |
14
14
  | `@vvedantb/ui/tokens/css/tabs.css` | `src/css/tabs.css` | `.t-tabs` container (0.15.0), `.t-tab` with its press scale, active colour, `.t-tabs-pill`, small-screen `.t-tabs` scrolling. |
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
- | `@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. |
16
+ | `@vvedantb/ui/tokens/css/utilities.css` | `src/css/utilities.css` | `@utility hit-target`, `reveal-on-hover`, `motion-press`, `motion-base`, `motion-emphasized` and `scrollbar-none`. The motion utilities read `--motion-fast`, `--motion-base`, `--motion-ease-out` and `--motion-ease-emphasized`, with defaults in the utility. `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
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`. |
@@ -72,7 +72,7 @@ Tailwind inlines an `@import` where it sits, even in the middle of a file (it mu
72
72
  | `modal.css` | `--modal-open-dur`, `--modal-close-dur`, `--modal-scale`, `--modal-scale-close`, `--modal-ease` | tokens.css (0.15.0), or app `:root` with the compat file |
73
73
  | `tabs.css` | `--tabs-dur`, `--tabs-ease` (tokens.css, or app `:root` with the compat file); `--tabs-text-muted`, `--tabs-text-active`, `--tabs-pill-bg` | colours: tabs-pills.css or the app theme |
74
74
  | `tabs-pills.css` | `--muted`, `--segment`, `--segment-foreground`, `--default` | tokens.css or the app theme |
75
- | `utilities.css` | `--breakpoint-sm` (Tailwind default or app theme) | Tailwind |
75
+ | `utilities.css` | `--breakpoint-sm` (Tailwind default or app theme); optional `--motion-*` | Tailwind |
76
76
  | `scrollbar-thin.css` | `--scrollbar` | tokens.css or the app theme |
77
77
  | `clear-input.css`, `motion.css` | none (own `:root` defaults) | |
78
78
  | `type-scale.css` | none (own `@theme` values) | |
@@ -81,6 +81,16 @@
81
81
  border-radius: clamp(0.75rem, var(--radius), 1rem);
82
82
  }
83
83
 
84
+ @utility rounded-t-surface {
85
+ border-radius: clamp(0.75rem, var(--radius), 1rem)
86
+ clamp(0.75rem, var(--radius), 1rem) 0 0;
87
+ }
88
+
89
+ @utility rounded-b-surface {
90
+ border-radius: 0 0 clamp(0.75rem, var(--radius), 1rem)
91
+ clamp(0.75rem, var(--radius), 1rem);
92
+ }
93
+
84
94
  @utility rounded-menu-item {
85
95
  border-radius: min(var(--radius), 0.5rem);
86
96
  }
@@ -1,6 +1,13 @@
1
1
  /*
2
2
  * @vvedantb/ui/tokens/css/utilities.css: Tailwind `@utility` helpers. Generated
3
3
  * only when used, and they take variants (e.g. `max-sm:hit-target`).
4
+ *
5
+ * The motion utilities read these variables. Set them on :root to change
6
+ * (defaults shown):
7
+ * --motion-fast: 150ms (press feedback)
8
+ * --motion-base: 220ms (colour, shadow, opacity)
9
+ * --motion-ease-out: cubic-bezier(0.22, 1, 0.36, 1)
10
+ * --motion-ease-emphasized: cubic-bezier(0.2, 0.8, 0.2, 1)
4
11
  */
5
12
 
6
13
  /* Extends sub-40px controls to a 40x40px tap target without changing layout.
@@ -32,3 +39,52 @@
32
39
  }
33
40
  }
34
41
  }
42
+
43
+ /* Each motion utility lists `scale`, `translate` and `rotate` as well as
44
+ `transform`. Tailwind v4 compiles `scale-[0.98]` to `scale: 0.98` and
45
+ `translate-x-*` to `translate: ...`, the individual transform properties.
46
+ `transition-property: transform` does not match them, so without them a
47
+ press or slide would not animate. */
48
+
49
+ /* Hover and state changes: colour, shadow, opacity and transforms. */
50
+ @utility motion-base {
51
+ transition-property:
52
+ color, background-color, border-color, box-shadow, transform, scale,
53
+ translate, rotate, opacity;
54
+ transition-duration: var(--motion-base, 220ms);
55
+ transition-timing-function: var(--motion-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
56
+ }
57
+
58
+ /* Movement on screen: transforms, opacity and shadow on the emphasized curve. */
59
+ @utility motion-emphasized {
60
+ transition-property: transform, scale, translate, rotate, opacity, box-shadow;
61
+ transition-duration: var(--motion-base, 220ms);
62
+ transition-timing-function: var(--motion-ease-emphasized, cubic-bezier(0.2, 0.8, 0.2, 1));
63
+ }
64
+
65
+ /* Pressable controls: pair with `active:scale-[0.97]`. The press runs on
66
+ --motion-fast and colour trails on --motion-base. It covers colour too,
67
+ because Tailwind's `transition-colors` comes later in the sheet at the same
68
+ specificity and would replace this whole declaration. So call sites need no
69
+ separate `transition-*` class. */
70
+ @utility motion-press {
71
+ transition-property:
72
+ transform, scale, translate, rotate, color, background-color, border-color,
73
+ box-shadow, opacity, fill, stroke;
74
+ transition-duration:
75
+ var(--motion-fast, 150ms), var(--motion-fast, 150ms),
76
+ var(--motion-fast, 150ms), var(--motion-fast, 150ms),
77
+ var(--motion-base, 220ms), var(--motion-base, 220ms),
78
+ var(--motion-base, 220ms), var(--motion-base, 220ms),
79
+ var(--motion-base, 220ms), var(--motion-base, 220ms),
80
+ var(--motion-base, 220ms);
81
+ transition-timing-function: var(--motion-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
82
+ }
83
+
84
+ /* Hides the scrollbar. The element still scrolls (wheel, drag, script). */
85
+ @utility scrollbar-none {
86
+ scrollbar-width: none;
87
+ &::-webkit-scrollbar {
88
+ display: none;
89
+ }
90
+ }
@@ -118,6 +118,16 @@
118
118
  border-radius: clamp(0.75rem, var(--radius), 1rem);
119
119
  }
120
120
 
121
+ @utility rounded-t-surface {
122
+ border-radius: clamp(0.75rem, var(--radius), 1rem)
123
+ clamp(0.75rem, var(--radius), 1rem) 0 0;
124
+ }
125
+
126
+ @utility rounded-b-surface {
127
+ border-radius: 0 0 clamp(0.75rem, var(--radius), 1rem)
128
+ clamp(0.75rem, var(--radius), 1rem);
129
+ }
130
+
121
131
  @utility rounded-menu-item {
122
132
  border-radius: min(var(--radius), 0.5rem);
123
133
  }