@siyahi/ui 0.1.2-next.1 → 0.1.3-next.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 CHANGED
@@ -19,12 +19,14 @@ is Tailwind source, so a plain CSS import leaves every component unstyled.
19
19
 
20
20
  ```sh
21
21
  npm install @siyahi/ui@next tailwindcss @tailwindcss/vite
22
+ npm install --save-dev @siyahi/tools@next
22
23
  ```
23
24
 
24
25
  ```ts
25
26
  // vite.config.ts
26
27
  import tailwindcss from "@tailwindcss/vite";
27
- export default defineConfig({ plugins: [react(), tailwindcss()] });
28
+ import { preloadFonts } from "@siyahi/tools/vite";
29
+ export default defineConfig({ plugins: [react(), tailwindcss(), preloadFonts()] });
28
30
  ```
29
31
 
30
32
  ```css
@@ -43,6 +45,14 @@ createRoot(root).render(
43
45
  );
44
46
  ```
45
47
 
48
+ `preloadFonts()` adds `<link rel="preload">` tags for Geist and Geist Mono to
49
+ the built `index.html`, so the fonts download with the scripts instead of after
50
+ the first paint. Until they arrive the theme draws Arial (or its Linux twins,
51
+ Liberation Sans and Arimo) scaled to Geist's metrics, so nothing moves when
52
+ Geist swaps in. An app that renders its own HTML adds the tags itself, with
53
+ the hashed URLs of `geist-latin-wght-normal.woff2`,
54
+ `geist-latin-ext-wght-normal.woff2` and `geist-mono-latin-wght-normal.woff2`.
55
+
46
56
  Everything comes from `@siyahi/ui`: the shadcn components, the registry
47
57
  add-ons (data table, heatmaps, stat tiles, sidebar), Siyahi's own components
48
58
  and the Recharts pieces charts are built from. Add `lucide-react` only if your
@@ -137,17 +147,18 @@ npm install --save-dev @siyahi/tools@next oxlint
137
147
  ```
138
148
 
139
149
  `@siyahi/tools` also has `siyahi-shots` (screenshots of a page at 1920 and 390
140
- pixels wide in both schemes, with layout checks) and `siyahi-contrast` (the
150
+ pixels wide in both schemes, with layout checks), `siyahi-cls` (how far a page
151
+ moves after its first paint on a slow network) and `siyahi-contrast` (the
141
152
  theme contrast check). See [packages/tools](packages/tools/README.md).
142
153
 
143
154
  ## This repository
144
155
 
145
- | Path | What |
146
- | ----------------- | --------------------------------------------------------------------------------- |
147
- | `packages/ui` | `@siyahi/ui`. The theme is `styles/siyahi.css`, the only file with colour values. |
148
- | `packages/tools` | `@siyahi/tools`: lint plugin, contrast check, screenshot script. |
149
- | `apps/catalogue` | The catalogue site, a Vite app deployed as a Cloudflare Worker. |
150
- | `assets/icon.svg` | The mark. |
156
+ | Path | What |
157
+ | ----------------- | ---------------------------------------------------------------------------------- |
158
+ | `packages/ui` | `@siyahi/ui`. The theme is `styles/siyahi.css`, the only file with colour values. |
159
+ | `packages/tools` | `@siyahi/tools`: lint plugin, font preload, contrast, screenshot and shift checks. |
160
+ | `apps/catalogue` | The catalogue site, a Vite app deployed as a Cloudflare Worker. |
161
+ | `assets/icon.svg` | The mark. |
151
162
 
152
163
  Development uses pnpm and [Vite+](https://viteplus.dev):
153
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siyahi/ui",
3
- "version": "0.1.2-next.1",
3
+ "version": "0.1.3-next.2",
4
4
  "description": "Stock shadcn/ui on Base UI and Tailwind v4, a finance theme, a few compositions and formatters.",
5
5
  "keywords": [
6
6
  "base-ui",
@@ -58,6 +58,7 @@
58
58
  "tw-animate-css": "^1.4.0"
59
59
  },
60
60
  "devDependencies": {
61
+ "@tailwindcss/node": "4.3.3",
61
62
  "@types/d3-hierarchy": "^3.1.7",
62
63
  "@types/node": "24.19.2",
63
64
  "@types/react": "~19.3.0",
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Generated by scripts/generate.ts. Do not edit.
3
+ * System fonts scaled to Geist's and Geist Mono's metrics. The theme names
4
+ * them right after Geist, so the text a browser draws while Geist loads takes
5
+ * the space Geist will, and nothing moves when Geist swaps in.
6
+ */
7
+ @font-face {
8
+ font-family: "Geist Fallback";
9
+ src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans"), local("Arimo Regular"), local("Arimo-Regular");
10
+ font-weight: 100 450;
11
+ size-adjust: 102.87%;
12
+ ascent-override: 97.7%;
13
+ descent-override: 28.68%;
14
+ line-gap-override: 0%;
15
+ }
16
+
17
+ @font-face {
18
+ font-family: "Geist Fallback";
19
+ src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans"), local("Arimo Regular"), local("Arimo-Regular");
20
+ font-weight: 451 550;
21
+ size-adjust: 105.29%;
22
+ ascent-override: 95.45%;
23
+ descent-override: 28.02%;
24
+ line-gap-override: 0%;
25
+ }
26
+
27
+ @font-face {
28
+ font-family: "Geist Fallback";
29
+ src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("LiberationSans-Bold"), local("Arimo Bold"), local("Arimo-Bold");
30
+ font-weight: 551 650;
31
+ size-adjust: 100.05%;
32
+ ascent-override: 100.45%;
33
+ descent-override: 29.49%;
34
+ line-gap-override: 0%;
35
+ }
36
+
37
+ @font-face {
38
+ font-family: "Geist Fallback";
39
+ src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("LiberationSans-Bold"), local("Arimo Bold"), local("Arimo-Bold");
40
+ font-weight: 651 900;
41
+ size-adjust: 102.09%;
42
+ ascent-override: 98.44%;
43
+ descent-override: 28.9%;
44
+ line-gap-override: 0%;
45
+ }
46
+
47
+ @font-face {
48
+ font-family: "Geist Mono Fallback";
49
+ src: local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"), local("LiberationMono"), local("Cousine Regular"), local("Cousine-Regular");
50
+ font-weight: 100 550;
51
+ size-adjust: 99.98%;
52
+ ascent-override: 100.52%;
53
+ descent-override: 29.5%;
54
+ line-gap-override: 0%;
55
+ }
56
+
57
+ @font-face {
58
+ font-family: "Geist Mono Fallback";
59
+ src: local("Courier New Bold"), local("CourierNewPS-BoldMT"), local("Liberation Mono Bold"), local("LiberationMono-Bold"), local("Cousine Bold"), local("Cousine-Bold");
60
+ font-weight: 551 900;
61
+ size-adjust: 99.98%;
62
+ ascent-override: 100.52%;
63
+ descent-override: 29.5%;
64
+ line-gap-override: 0%;
65
+ }
package/styles/siyahi.css CHANGED
@@ -9,6 +9,7 @@
9
9
  @import "./shadcn.css";
10
10
  @import "@fontsource-variable/geist";
11
11
  @import "@fontsource-variable/geist-mono";
12
+ @import "./fallback-fonts.css";
12
13
 
13
14
  /* Tailwind does not scan node_modules, so name the package's own classes. */
14
15
  @source "../dist";
@@ -21,9 +22,15 @@
21
22
  @custom-variant dark (@media (prefers-color-scheme: dark));
22
23
 
23
24
  @theme inline {
24
- --font-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
25
- --font-mono: "Geist Mono Variable", ui-monospace, monospace;
25
+ --font-sans: "Geist Variable", "Geist Fallback", ui-sans-serif, system-ui, sans-serif;
26
+ --font-mono: "Geist Mono Variable", "Geist Mono Fallback", ui-monospace, monospace;
26
27
  --font-heading: var(--font-sans);
28
+ /*
29
+ * Tailwind's 65ch, measured in Geist, whose "0" is 0.663em wide. A ch
30
+ * follows whichever font is drawing, so a plain 65ch is narrower while the
31
+ * fallback draws and every prose block rewraps when Geist arrives.
32
+ */
33
+ --max-width-prose: 43.1em;
27
34
  --color-background: var(--background);
28
35
  --color-foreground: var(--foreground);
29
36
  --color-card: var(--card);