@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.
- package/README.md +74 -12
- package/dist/color.d.ts +249 -493
- package/dist/css.d.ts +16 -4
- package/dist/index.d.ts +383 -352
- package/dist/index.js +90 -409
- package/dist/index.js.map +1 -1
- package/dist/radius.d.ts +21 -17
- package/dist/reference.d.ts +20 -0
- package/dist/reference.data.d.ts +2 -0
- package/dist/reference.js +403 -0
- package/dist/reference.js.map +1 -0
- package/dist/shadow.d.ts +76 -20
- package/dist/size.d.ts +194 -0
- package/dist/style.d.ts +129 -0
- package/dist/themes/index.d.ts +69 -0
- package/dist/themes/modern.d.ts +139 -0
- package/dist/themes-B0J8E0xq.js +1022 -0
- package/dist/themes-B0J8E0xq.js.map +1 -0
- package/dist/tokens.css +1268 -232
- package/dist/typography.d.ts +69 -46
- package/package.json +7 -3
- package/dist/blur.d.ts +0 -18
- package/dist/reference.html +0 -1275
package/dist/typography.d.ts
CHANGED
|
@@ -1,85 +1,108 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Typography
|
|
2
|
+
* Typography.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
*
|
|
27
|
-
*
|
|
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
|
-
/**
|
|
31
|
-
readonly
|
|
32
|
-
readonly size: "0.
|
|
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
|
-
/**
|
|
36
|
-
readonly
|
|
37
|
-
readonly size: "
|
|
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
|
-
/**
|
|
41
|
-
|
|
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: "
|
|
58
|
+
readonly lineHeight: "1rem";
|
|
44
59
|
};
|
|
45
|
-
/**
|
|
46
|
-
readonly
|
|
47
|
-
readonly size: "
|
|
48
|
-
readonly lineHeight: "1.
|
|
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
|
-
/**
|
|
51
|
-
readonly
|
|
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.
|
|
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
|
-
/**
|
|
56
|
-
readonly '
|
|
57
|
-
readonly size: "1.
|
|
58
|
-
readonly lineHeight: "
|
|
75
|
+
/** 19/24, bold — a documentation section. */
|
|
76
|
+
readonly 'doc-h2': {
|
|
77
|
+
readonly size: "1.1875rem";
|
|
78
|
+
readonly lineHeight: "1.5rem";
|
|
59
79
|
};
|
|
60
|
-
/**
|
|
61
|
-
readonly '
|
|
62
|
-
readonly size: "
|
|
63
|
-
readonly lineHeight: "
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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.
|
|
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.
|
|
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
|
|
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": "
|
|
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;
|