@vvedantb/ui 0.31.1 → 0.32.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.31.1",
3
+ "version": "0.32.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",
@@ -35,6 +35,7 @@
35
35
  "./tokens/css/border-beam.css": "./tokens/src/css/border-beam.css",
36
36
  "./tokens/css/markdown.css": "./tokens/src/css/markdown.css",
37
37
  "./tokens/css/marquee.css": "./tokens/src/css/marquee.css",
38
+ "./tokens/css/type-scale.css": "./tokens/src/css/type-scale.css",
38
39
  "./tokens/compat/shadcn-rgb.css": "./tokens/src/css/compat-shadcn-rgb.css",
39
40
  "./tokens/css/*.css": "./tokens/src/css/*.css",
40
41
  "./tokens/tailwind-preset": {
package/tokens/README.md CHANGED
@@ -17,6 +17,7 @@ Design tokens and shared Tailwind v4 CSS for the vvedantb web apps. The CSS and
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`. |
20
+ | `@vvedantb/ui/tokens/css/type-scale.css` | `src/css/type-scale.css` | The `text-*` scale (`3xs` 10px to `7xl` 72px, with `2xs` 11px and `2sm` 13px) as `@theme` variables. Each tier has its own line height and letter-spacing: positive below 14px (`+0.01em` at 10-11px), `0` at `sm`, negative above (`-0.03em` at `7xl`). Imported by `tokens.css`. |
20
21
  | `@vvedantb/ui/tokens/css/animations.css` | `src/css/animations.css` | `animate-aurora`, `animate-fade-in-up`, `animate-indeterminate` as `@theme` (CSS-first apps). |
21
22
  | `@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` (both `min(var(--radius), 0.625rem)` from 0.16.3), 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. |
22
23
  | `@vvedantb/ui/tokens/css/index.css` | `src/css/index.css` | base + dialog + modal + tabs + tabs-pills + utilities + animations + nav-icons, for new CSS-first apps (`tokens.css` brings scrollbar-thin). |
@@ -74,6 +75,7 @@ Tailwind inlines an `@import` where it sits, even in the middle of a file (it mu
74
75
  | `utilities.css` | `--breakpoint-sm` (Tailwind default or app theme) | Tailwind |
75
76
  | `scrollbar-thin.css` | `--scrollbar` | tokens.css or the app theme |
76
77
  | `clear-input.css`, `motion.css` | none (own `:root` defaults) | |
78
+ | `type-scale.css` | none (own `@theme` values) | |
77
79
  | `animations.css` | none | |
78
80
  | `tailwind-preset` | the CSS variables named in its colour map, `--radius`, `--field-radius` | tokens.css or the app theme |
79
81
 
@@ -0,0 +1,61 @@
1
+ /*
2
+ * @vvedantb/ui/tokens/css/type-scale.css: the `text-*` scale with size-specific
3
+ * tracking. tokens.css imports it. Apps that pick files one by one can import
4
+ * it alone, after tailwindcss.
5
+ *
6
+ * Tracking is never one value for all sizes. Small UI text gets positive
7
+ * letter-spacing to stay legible. Display text gets negative letter-spacing,
8
+ * because letters look further apart as they grow. Line heights are the
9
+ * Tailwind defaults, so only tracking changes for the standard tiers.
10
+ *
11
+ * `3xs` (10px), `2xs` (11px) and `2sm` (13px) fill the gaps below `text-base`,
12
+ * so call sites do not need arbitrary `text-[11px]` classes.
13
+ *
14
+ * An explicit `tracking-*` or `leading-*` utility still wins. To change a tier,
15
+ * set its variable in the app's own `@theme` block.
16
+ */
17
+
18
+ @theme {
19
+ --text-3xs: 0.625rem;
20
+ --text-3xs--line-height: 0.875rem;
21
+ --text-3xs--letter-spacing: 0.01em;
22
+ --text-2xs: 0.6875rem;
23
+ --text-2xs--line-height: 1rem;
24
+ --text-2xs--letter-spacing: 0.01em;
25
+ --text-xs: 0.75rem;
26
+ --text-xs--line-height: 1rem;
27
+ --text-xs--letter-spacing: 0.005em;
28
+ --text-2sm: 0.8125rem;
29
+ --text-2sm--line-height: 1.125rem;
30
+ --text-2sm--letter-spacing: 0.005em;
31
+ --text-sm: 0.875rem;
32
+ --text-sm--line-height: 1.25rem;
33
+ --text-sm--letter-spacing: 0em;
34
+ --text-base: 1rem;
35
+ --text-base--line-height: 1.5rem;
36
+ --text-base--letter-spacing: -0.006em;
37
+ --text-lg: 1.125rem;
38
+ --text-lg--line-height: 1.75rem;
39
+ --text-lg--letter-spacing: -0.01em;
40
+ --text-xl: 1.25rem;
41
+ --text-xl--line-height: 1.75rem;
42
+ --text-xl--letter-spacing: -0.012em;
43
+ --text-2xl: 1.5rem;
44
+ --text-2xl--line-height: 2rem;
45
+ --text-2xl--letter-spacing: -0.015em;
46
+ --text-3xl: 1.875rem;
47
+ --text-3xl--line-height: 2.25rem;
48
+ --text-3xl--letter-spacing: -0.018em;
49
+ --text-4xl: 2.25rem;
50
+ --text-4xl--line-height: 2.5rem;
51
+ --text-4xl--letter-spacing: -0.022em;
52
+ --text-5xl: 3rem;
53
+ --text-5xl--line-height: 1;
54
+ --text-5xl--letter-spacing: -0.025em;
55
+ --text-6xl: 3.75rem;
56
+ --text-6xl--line-height: 1;
57
+ --text-6xl--letter-spacing: -0.028em;
58
+ --text-7xl: 4.5rem;
59
+ --text-7xl--line-height: 1;
60
+ --text-7xl--letter-spacing: -0.03em;
61
+ }
@@ -23,11 +23,15 @@
23
23
  * modal / tabs motion variables. Every rule sits in a Tailwind layer and the
24
24
  * timings and strengths are `:root` variables, so app rules and app `:root`
25
25
  * values win.
26
+ *
27
+ * It also brings the `text-*` type scale with size-specific
28
+ * tracking (css/type-scale.css), including the `3xs`, `2xs` and `2sm` tiers.
26
29
  */
27
30
 
28
31
  @import "./css/clear-input.css";
29
32
  @import "./css/scrollbar-thin.css";
30
33
  @import "./css/motion.css";
34
+ @import "./css/type-scale.css";
31
35
 
32
36
  @custom-variant dark (&:where(.dark, .dark *));
33
37