@rowkit/tokens 0.4.0 → 1.0.0-beta.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.
@@ -1,85 +1,108 @@
1
1
  /**
2
- * Typography scale.
2
+ * Typography.
3
3
  *
4
- * Weighted toward the small end: a dashboard spends most of its type budget
5
- * between 12px and 16px, and the sizes above `xl` exist for empty states and
6
- * page titles rather than for data.
4
+ * Two registers, as in the design: the interface, and long text for
5
+ * documentation. The interface is set at 13px — Windows 98's 8pt in its
6
+ * "Large Fonts" mode (120 DPI), which the system offered for exactly this
7
+ * reason: at 96 DPI 8pt is 11px, and on today's screens, whose pixels are far
8
+ * smaller than a 1998 monitor's, 11px is too small to read for long. The sizes
9
+ * are named after the Figma text styles (`ui/body` is `text-ui`, `doc/h1` is
10
+ * `text-doc-h1`), so a style picked in the design maps to one utility.
11
+ *
12
+ * Sizes are in `rem`, so a reader who raised their browser's base size gets
13
+ * larger text; at the default 16px base they land on the design's pixels.
7
14
  */
8
15
  /**
9
16
  * Font families.
10
17
  *
11
- * rowkit's face is **Geist** — designed for tools, not marketing pages. The
12
- * stack names the webfont first; system fallbacks keep layout honest before
13
- * the file lands. Loading the font is the app's job (one import from
14
- * `@fontsource-variable/geist`); without it, the stack falls through cleanly.
18
+ * The interface face is **PT Sans** (ParaType, OFL): the closest open match
19
+ * to Tahoma, which succeeded MS Sans Serif, and compact enough for dense
20
+ * tables. It covers Latin and Cyrillic in regular and bold. The fixed-width
21
+ * face is **VT323** (OFL), drawn after the Fixedsys terminal font.
22
+ *
23
+ * rowkit does not ship either font file: the app loads them, one import each
24
+ * from `@fontsource/pt-sans` and `@fontsource/vt323`. Without them the stacks
25
+ * fall through to Tahoma and the faces operating systems already ship.
15
26
  */
16
27
  export declare const fontFamily: {
17
28
  /** UI and body text. */
18
29
  readonly sans: string;
19
- /** IDs, hashes, numeric columns that must align vertically. */
30
+ /** Code, IDs and numbers that must align in a column. */
20
31
  readonly mono: string;
21
32
  };
22
33
  /**
23
- * Font sizes, each paired with the line height it should almost always use.
34
+ * Font sizes, each paired with the line height the design sets it in.
24
35
  *
25
36
  * Pairing them prevents the most common typographic bug in a dense table:
26
- * shrinking the font without shrinking leading, so rows stay tall and the
27
- * density gain evaporates.
37
+ * changing the size without the leading, so rows stay tall and the density
38
+ * the size was meant to buy evaporates.
28
39
  */
29
40
  export declare const fontSize: {
30
- /** 12px — table metadata, badges, column headers. */
31
- readonly xs: {
32
- readonly size: "0.75rem";
41
+ /** 13/16 — every control, label, menu and table cell. Bold for titles and the default button. */
42
+ readonly ui: {
43
+ readonly size: "0.8125rem";
33
44
  readonly lineHeight: "1rem";
34
45
  };
35
- /** 14px — the default for table cells and form controls. */
36
- readonly sm: {
37
- readonly size: "0.875rem";
46
+ /** 16/20, bold — the heading of an empty state or a group. */
47
+ readonly heading: {
48
+ readonly size: "1rem";
38
49
  readonly lineHeight: "1.25rem";
39
50
  };
40
- /** 16px — body copy outside of data views. */
41
- readonly base: {
51
+ /**
52
+ * 16/16 — the fixed-width face beside interface text. VT323's x-height is
53
+ * 0.4em to PT Sans's 0.5em, so 16px VT323 stands exactly as tall as 13px
54
+ * PT Sans.
55
+ */
56
+ readonly mono: {
42
57
  readonly size: "1rem";
43
- readonly lineHeight: "1.5rem";
58
+ readonly lineHeight: "1rem";
44
59
  };
45
- /** 18px — card titles. */
46
- readonly lg: {
47
- readonly size: "1.125rem";
48
- readonly lineHeight: "1.75rem";
60
+ /** 16/26 — documentation paragraphs, about seventy characters to a line. */
61
+ readonly doc: {
62
+ readonly size: "1rem";
63
+ readonly lineHeight: "1.625rem";
49
64
  };
50
- /** 20px — section headings. */
51
- readonly xl: {
65
+ /** 20/20 — code beside documentation text: as tall as 16px PT Sans, for the same reason as `mono`. */
66
+ readonly 'doc-mono': {
52
67
  readonly size: "1.25rem";
53
- readonly lineHeight: "1.75rem";
68
+ readonly lineHeight: "1.25rem";
69
+ };
70
+ /** 26/30, bold — a documentation page title. */
71
+ readonly 'doc-h1': {
72
+ readonly size: "1.625rem";
73
+ readonly lineHeight: "1.875rem";
54
74
  };
55
- /** 24px — page titles, empty-state headings. */
56
- readonly '2xl': {
57
- readonly size: "1.5rem";
58
- readonly lineHeight: "2rem";
75
+ /** 19/24, bold — a documentation section. */
76
+ readonly 'doc-h2': {
77
+ readonly size: "1.1875rem";
78
+ readonly lineHeight: "1.5rem";
59
79
  };
60
- /** 30px — the largest size rowkit ships. */
61
- readonly '3xl': {
62
- readonly size: "1.875rem";
63
- readonly lineHeight: "2.25rem";
80
+ /** 15/20, bold — a documentation subsection. */
81
+ readonly 'doc-h3': {
82
+ readonly size: "0.9375rem";
83
+ readonly lineHeight: "1.25rem";
64
84
  };
65
85
  };
66
- /** Font weights. */
86
+ /**
87
+ * Font weights. Two, because PT Sans has two: anything in between would be
88
+ * synthesised by the browser, and a faked weight is blurrier than either real
89
+ * one.
90
+ */
67
91
  export declare const fontWeight: {
68
92
  /** Body text. */
69
93
  readonly normal: "400";
70
- /** Buttons, labels, card titles — prefer this over semibold in dense UI. */
71
- readonly medium: "500";
72
- /** Page titles and dialog headings. */
73
- readonly semibold: "600";
74
- /** Display only. Rarely needed in data views. */
94
+ /** Window titles, headings, the default button. */
75
95
  readonly bold: "700";
96
+ /**
97
+ * The weight a theme gives emphasis: titles, headings, a table's totals.
98
+ * Components use this rather than `bold`, so a theme can make emphasis
99
+ * semibold without changing what `font-bold` means in the app around it.
100
+ */
101
+ readonly strong: "700";
76
102
  };
77
- /** Letter spacing. Tightening only pays off at display sizes. */
103
+ /** Letter spacing. Windows 98 sets every size at the face's own spacing. */
78
104
  export declare const letterSpacing: {
79
- readonly tight: "-0.015em";
80
105
  readonly normal: "0em";
81
- /** For uppercase micro-labels, which need air to stay readable. */
82
- readonly wide: "0.04em";
83
106
  };
84
107
  /** Standalone line heights, for when text is not using a paired {@link fontSize}. */
85
108
  export declare const lineHeight: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowkit/tokens",
3
- "version": "0.4.0",
3
+ "version": "1.0.0-beta.1",
4
4
  "description": "Design tokens for rowkit — consumable without importing components.",
5
5
  "license": "MIT",
6
6
  "author": "Nikolai Kushner",
@@ -29,6 +29,10 @@
29
29
  "types": "./dist/index.d.ts",
30
30
  "import": "./dist/index.js"
31
31
  },
32
+ "./reference": {
33
+ "types": "./dist/reference.d.ts",
34
+ "import": "./dist/reference.js"
35
+ },
32
36
  "./css": "./dist/tokens.css",
33
37
  "./package.json": "./package.json"
34
38
  },
@@ -40,8 +44,8 @@
40
44
  "node": ">=20.19.0"
41
45
  },
42
46
  "scripts": {
43
- "build": "vue-tsc -b tsconfig.lib.json --force && vite build && node scripts/fix-dts-specifiers.mjs && node scripts/emit-css.mjs && node scripts/emit-reference.mjs",
47
+ "build": "vue-tsc -b tsconfig.lib.json --force && vite build && node scripts/fix-dts-specifiers.mjs && node scripts/emit-css.mjs",
44
48
  "typecheck": "vue-tsc -b --force",
45
- "reference": "pnpm build && open dist/reference.html"
49
+ "docs:reference": "node scripts/generate-reference.mjs"
46
50
  }
47
51
  }
package/dist/blur.d.ts DELETED
@@ -1,18 +0,0 @@
1
- /**
2
- * Backdrop blur radii.
3
- *
4
- * One entry, and named for its job rather than a t-shirt size. Blur is not a
5
- * scale rowkit designs with — it appears in exactly one place, behind a modal,
6
- * and a second value would be a decision nobody has had to make yet.
7
- *
8
- * Deliberately small. The scrim separates the planes; the blur only stops the
9
- * page behind from competing for the eye. Anything heavier reads as an effect
10
- * and makes the content behind unrecognisable, which defeats the reason a
11
- * modal shows its context at all.
12
- */
13
- export declare const blur: {
14
- /** The dialog scrim. The reference `backdrop-blur-xs`. */
15
- readonly overlay: "4px";
16
- };
17
- /** Names of every blur token. */
18
- export type BlurName = keyof typeof blur;