@tenthbilling/design 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaw Apps LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
- # Temporary Holding Version
1
+ # @tenthbilling/design
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Tenth's design tokens and React Native themes. `@tenthbilling/expo` installs it for its default paywall; you don't need to install or import it yourself.
4
+
5
+ If you build a custom paywall and want it to match Tenth's themes, `themes`, `fontStacks` and `contrastRatio` are exported here, and the raw tokens are at `@tenthbilling/design/tokens.json`.
6
+
7
+ Docs: https://tenthbilling.com/docs/expo
@@ -0,0 +1,188 @@
1
+ export declare const colors: {
2
+ readonly light: {
3
+ readonly surface: "#f5f7f6";
4
+ readonly surfaceRaised: "#ffffff";
5
+ readonly surfaceSunken: "#ebefed";
6
+ readonly line: "#d3dcd9";
7
+ readonly lineStrong: "#7d8e8b";
8
+ readonly ink: "#13201f";
9
+ readonly inkMuted: "#4f605e";
10
+ readonly brand: "#0f5257";
11
+ readonly brandHover: "#0a3f43";
12
+ readonly onBrand: "#ffffff";
13
+ readonly brandTint: "#dcebe9";
14
+ readonly stamp: "#e8833a";
15
+ readonly stampInk: "#9a4510";
16
+ readonly onStamp: "#2a1404";
17
+ readonly success: "#1e7346";
18
+ readonly successTint: "#e0f1e6";
19
+ readonly warning: "#865700";
20
+ readonly warningTint: "#fbefd3";
21
+ readonly danger: "#b3261e";
22
+ readonly dangerTint: "#fbe3e1";
23
+ readonly info: "#2b5aa8";
24
+ readonly infoTint: "#e3ebf9";
25
+ readonly focus: "#1f4fbf";
26
+ readonly chart1: "#0f5257";
27
+ readonly chart2: "#e8833a";
28
+ readonly chart3: "#2b5aa8";
29
+ readonly chartGrid: "#d3dcd9";
30
+ };
31
+ readonly dark: {
32
+ readonly surface: "#0d1416";
33
+ readonly surfaceRaised: "#142023";
34
+ readonly surfaceSunken: "#091012";
35
+ readonly line: "#27363a";
36
+ readonly lineStrong: "#62777b";
37
+ readonly ink: "#e4eded";
38
+ readonly inkMuted: "#9aabab";
39
+ readonly brand: "#5cbcb6";
40
+ readonly brandHover: "#7dcdc8";
41
+ readonly onBrand: "#04211f";
42
+ readonly brandTint: "#163538";
43
+ readonly stamp: "#f0954f";
44
+ readonly stampInk: "#f4a868";
45
+ readonly onStamp: "#2a1404";
46
+ readonly success: "#62c98f";
47
+ readonly successTint: "#11301f";
48
+ readonly warning: "#e8b04a";
49
+ readonly warningTint: "#33280f";
50
+ readonly danger: "#f2867d";
51
+ readonly dangerTint: "#3a1714";
52
+ readonly info: "#8fb2f0";
53
+ readonly infoTint: "#16233b";
54
+ readonly focus: "#9cbcf5";
55
+ readonly chart1: "#5cbcb6";
56
+ readonly chart2: "#f0954f";
57
+ readonly chart3: "#8fb2f0";
58
+ readonly chartGrid: "#27363a";
59
+ };
60
+ };
61
+ export declare const shadows: {
62
+ readonly light: {
63
+ readonly shadowOverlay: "0 8px 24px rgba(19, 32, 31, 0.14), 0 1px 2px rgba(19, 32, 31, 0.08)";
64
+ };
65
+ readonly dark: {
66
+ readonly shadowOverlay: "0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06)";
67
+ };
68
+ };
69
+ /** Spacing scale in px, keyed by step: space[4] is the space-4 token. */
70
+ export declare const space: {
71
+ readonly 1: 4;
72
+ readonly 2: 8;
73
+ readonly 3: 12;
74
+ readonly 4: 16;
75
+ readonly 5: 24;
76
+ readonly 6: 32;
77
+ readonly 7: 48;
78
+ readonly 8: 80;
79
+ };
80
+ /** Radii in px, keyed by size: radius.md is the radius-md token. */
81
+ export declare const radius: {
82
+ readonly sm: 4;
83
+ readonly md: 6;
84
+ readonly lg: 10;
85
+ readonly xl: 20;
86
+ };
87
+ /** CSS font stacks, for web surfaces that don't go through React Native. */
88
+ export declare const fontStacks: {
89
+ readonly display: "\"Familjen Grotesk\", \"Helvetica Neue\", Arial, sans-serif";
90
+ readonly sans: "\"Public Sans\", system-ui, -apple-system, \"Segoe UI\", sans-serif";
91
+ readonly mono: "\"IBM Plex Mono\", ui-monospace, SFMono-Regular, Menlo, monospace";
92
+ };
93
+ /** React Native text styles. fontFamily names match @expo-google-fonts exports. */
94
+ export declare const typography: {
95
+ readonly displayXl: {
96
+ readonly fontFamily: "FamiljenGrotesk_600SemiBold";
97
+ readonly fontSize: 56;
98
+ readonly lineHeight: 60;
99
+ readonly letterSpacing: -1.12;
100
+ };
101
+ readonly display: {
102
+ readonly fontFamily: "FamiljenGrotesk_600SemiBold";
103
+ readonly fontSize: 40;
104
+ readonly lineHeight: 44;
105
+ readonly letterSpacing: -0.6;
106
+ };
107
+ readonly heading1: {
108
+ readonly fontFamily: "FamiljenGrotesk_600SemiBold";
109
+ readonly fontSize: 28;
110
+ readonly lineHeight: 34;
111
+ readonly letterSpacing: -0.28;
112
+ };
113
+ readonly heading2: {
114
+ readonly fontFamily: "FamiljenGrotesk_600SemiBold";
115
+ readonly fontSize: 20;
116
+ readonly lineHeight: 28;
117
+ readonly letterSpacing: 0;
118
+ };
119
+ readonly heading3: {
120
+ readonly fontFamily: "PublicSans_600SemiBold";
121
+ readonly fontSize: 16;
122
+ readonly lineHeight: 24;
123
+ readonly letterSpacing: 0;
124
+ };
125
+ readonly bodyLg: {
126
+ readonly fontFamily: "PublicSans_400Regular";
127
+ readonly fontSize: 17;
128
+ readonly lineHeight: 26;
129
+ readonly letterSpacing: 0;
130
+ };
131
+ readonly body: {
132
+ readonly fontFamily: "PublicSans_400Regular";
133
+ readonly fontSize: 15;
134
+ readonly lineHeight: 22;
135
+ readonly letterSpacing: 0;
136
+ };
137
+ readonly bodySm: {
138
+ readonly fontFamily: "PublicSans_400Regular";
139
+ readonly fontSize: 13;
140
+ readonly lineHeight: 20;
141
+ readonly letterSpacing: 0;
142
+ };
143
+ readonly label: {
144
+ readonly fontFamily: "PublicSans_600SemiBold";
145
+ readonly fontSize: 12;
146
+ readonly lineHeight: 16;
147
+ readonly letterSpacing: 0.72;
148
+ readonly textTransform: "uppercase";
149
+ };
150
+ readonly figureLg: {
151
+ readonly fontFamily: "PublicSans_600SemiBold";
152
+ readonly fontSize: 32;
153
+ readonly lineHeight: 36;
154
+ readonly letterSpacing: -0.32;
155
+ readonly fontVariant: readonly ["tabular-nums"];
156
+ };
157
+ readonly figure: {
158
+ readonly fontFamily: "PublicSans_500Medium";
159
+ readonly fontSize: 15;
160
+ readonly lineHeight: 22;
161
+ readonly letterSpacing: 0;
162
+ readonly fontVariant: readonly ["tabular-nums"];
163
+ };
164
+ readonly code: {
165
+ readonly fontFamily: "IBMPlexMono_400Regular";
166
+ readonly fontSize: 13;
167
+ readonly lineHeight: 20;
168
+ readonly letterSpacing: 0;
169
+ };
170
+ readonly identifier: {
171
+ readonly fontFamily: "IBMPlexMono_500Medium";
172
+ readonly fontSize: 12;
173
+ readonly lineHeight: 16;
174
+ readonly letterSpacing: 0;
175
+ };
176
+ };
177
+ export type ThemeName = keyof typeof colors;
178
+ export type ColorToken = keyof (typeof colors)['light'];
179
+ export type TypographyStyle = keyof typeof typography;
180
+ export interface Theme {
181
+ name: ThemeName;
182
+ colors: Record<ColorToken, string>;
183
+ shadows: Record<keyof (typeof shadows)['light'], string>;
184
+ space: typeof space;
185
+ radius: typeof radius;
186
+ typography: typeof typography;
187
+ }
188
+ export declare const themes: Record<ThemeName, Theme>;
@@ -0,0 +1,108 @@
1
+ export const colors = {
2
+ light: {
3
+ surface: '#f5f7f6',
4
+ surfaceRaised: '#ffffff',
5
+ surfaceSunken: '#ebefed',
6
+ line: '#d3dcd9',
7
+ lineStrong: '#7d8e8b',
8
+ ink: '#13201f',
9
+ inkMuted: '#4f605e',
10
+ brand: '#0f5257',
11
+ brandHover: '#0a3f43',
12
+ onBrand: '#ffffff',
13
+ brandTint: '#dcebe9',
14
+ stamp: '#e8833a',
15
+ stampInk: '#9a4510',
16
+ onStamp: '#2a1404',
17
+ success: '#1e7346',
18
+ successTint: '#e0f1e6',
19
+ warning: '#865700',
20
+ warningTint: '#fbefd3',
21
+ danger: '#b3261e',
22
+ dangerTint: '#fbe3e1',
23
+ info: '#2b5aa8',
24
+ infoTint: '#e3ebf9',
25
+ focus: '#1f4fbf',
26
+ chart1: '#0f5257',
27
+ chart2: '#e8833a',
28
+ chart3: '#2b5aa8',
29
+ chartGrid: '#d3dcd9',
30
+ },
31
+ dark: {
32
+ surface: '#0d1416',
33
+ surfaceRaised: '#142023',
34
+ surfaceSunken: '#091012',
35
+ line: '#27363a',
36
+ lineStrong: '#62777b',
37
+ ink: '#e4eded',
38
+ inkMuted: '#9aabab',
39
+ brand: '#5cbcb6',
40
+ brandHover: '#7dcdc8',
41
+ onBrand: '#04211f',
42
+ brandTint: '#163538',
43
+ stamp: '#f0954f',
44
+ stampInk: '#f4a868',
45
+ onStamp: '#2a1404',
46
+ success: '#62c98f',
47
+ successTint: '#11301f',
48
+ warning: '#e8b04a',
49
+ warningTint: '#33280f',
50
+ danger: '#f2867d',
51
+ dangerTint: '#3a1714',
52
+ info: '#8fb2f0',
53
+ infoTint: '#16233b',
54
+ focus: '#9cbcf5',
55
+ chart1: '#5cbcb6',
56
+ chart2: '#f0954f',
57
+ chart3: '#8fb2f0',
58
+ chartGrid: '#27363a',
59
+ },
60
+ };
61
+ export const shadows = {
62
+ light: {
63
+ shadowOverlay: '0 8px 24px rgba(19, 32, 31, 0.14), 0 1px 2px rgba(19, 32, 31, 0.08)',
64
+ },
65
+ dark: {
66
+ shadowOverlay: '0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06)',
67
+ },
68
+ };
69
+ export const space = {
70
+ 1: 4,
71
+ 2: 8,
72
+ 3: 12,
73
+ 4: 16,
74
+ 5: 24,
75
+ 6: 32,
76
+ 7: 48,
77
+ 8: 80,
78
+ };
79
+ export const radius = {
80
+ sm: 4,
81
+ md: 6,
82
+ lg: 10,
83
+ xl: 20,
84
+ };
85
+ export const fontStacks = {
86
+ display: '"Familjen Grotesk", "Helvetica Neue", Arial, sans-serif',
87
+ sans: '"Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif',
88
+ mono: '"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace',
89
+ };
90
+ export const typography = {
91
+ displayXl: { fontFamily: 'FamiljenGrotesk_600SemiBold', fontSize: 56, lineHeight: 60, letterSpacing: -1.12 },
92
+ display: { fontFamily: 'FamiljenGrotesk_600SemiBold', fontSize: 40, lineHeight: 44, letterSpacing: -0.6 },
93
+ heading1: { fontFamily: 'FamiljenGrotesk_600SemiBold', fontSize: 28, lineHeight: 34, letterSpacing: -0.28 },
94
+ heading2: { fontFamily: 'FamiljenGrotesk_600SemiBold', fontSize: 20, lineHeight: 28, letterSpacing: 0 },
95
+ heading3: { fontFamily: 'PublicSans_600SemiBold', fontSize: 16, lineHeight: 24, letterSpacing: 0 },
96
+ bodyLg: { fontFamily: 'PublicSans_400Regular', fontSize: 17, lineHeight: 26, letterSpacing: 0 },
97
+ body: { fontFamily: 'PublicSans_400Regular', fontSize: 15, lineHeight: 22, letterSpacing: 0 },
98
+ bodySm: { fontFamily: 'PublicSans_400Regular', fontSize: 13, lineHeight: 20, letterSpacing: 0 },
99
+ label: { fontFamily: 'PublicSans_600SemiBold', fontSize: 12, lineHeight: 16, letterSpacing: 0.72, textTransform: 'uppercase' },
100
+ figureLg: { fontFamily: 'PublicSans_600SemiBold', fontSize: 32, lineHeight: 36, letterSpacing: -0.32, fontVariant: ['tabular-nums'] },
101
+ figure: { fontFamily: 'PublicSans_500Medium', fontSize: 15, lineHeight: 22, letterSpacing: 0, fontVariant: ['tabular-nums'] },
102
+ code: { fontFamily: 'IBMPlexMono_400Regular', fontSize: 13, lineHeight: 20, letterSpacing: 0 },
103
+ identifier: { fontFamily: 'IBMPlexMono_500Medium', fontSize: 12, lineHeight: 16, letterSpacing: 0 },
104
+ };
105
+ export const themes = {
106
+ light: { name: 'light', colors: colors.light, shadows: shadows.light, space, radius, typography },
107
+ dark: { name: 'dark', colors: colors.dark, shadows: shadows.dark, space, radius, typography },
108
+ };
@@ -0,0 +1,6 @@
1
+ export declare function contrastRatio(a: string, b: string): number;
2
+ /**
3
+ * Text color for a fill: white or near-black (ink), whichever reaches 4.5:1.
4
+ * Returns null when neither does, so the dashboard can warn the tenant.
5
+ */
6
+ export declare function onColorFor(fill: string): string | null;
@@ -0,0 +1,23 @@
1
+ function channel(c) {
2
+ const s = c / 255;
3
+ return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
4
+ }
5
+ function luminance(hex) {
6
+ const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());
7
+ if (!m)
8
+ throw new Error(`Expected a 6-digit hex color, got ${hex}`);
9
+ const n = parseInt(m[1], 16);
10
+ return (0.2126 * channel((n >> 16) & 255) + 0.7152 * channel((n >> 8) & 255) + 0.0722 * channel(n & 255));
11
+ }
12
+ export function contrastRatio(a, b) {
13
+ const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x);
14
+ return (hi + 0.05) / (lo + 0.05);
15
+ }
16
+ const ON_LIGHT = '#ffffff';
17
+ const ON_DARK = '#13201f';
18
+ export function onColorFor(fill) {
19
+ const white = contrastRatio(fill, ON_LIGHT);
20
+ const dark = contrastRatio(fill, ON_DARK);
21
+ const best = white >= dark ? ON_LIGHT : ON_DARK;
22
+ return Math.max(white, dark) >= 4.5 ? best : null;
23
+ }
@@ -0,0 +1,2 @@
1
+ export * from '../generated/theme';
2
+ export { contrastRatio, onColorFor } from './contrast';
@@ -0,0 +1,2 @@
1
+ export * from '../generated/theme';
2
+ export { contrastRatio, onColorFor } from './contrast';
@@ -0,0 +1,221 @@
1
+ /* Generated from packages/design/tokens.json (v1). Do not edit. */
2
+
3
+ :root {
4
+ --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
5
+ --font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
6
+ --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
7
+ --space-1: 4px;
8
+ --space-2: 8px;
9
+ --space-3: 12px;
10
+ --space-4: 16px;
11
+ --space-5: 24px;
12
+ --space-6: 32px;
13
+ --space-7: 48px;
14
+ --space-8: 80px;
15
+ --radius-sm: 4px;
16
+ --radius-md: 6px;
17
+ --radius-lg: 10px;
18
+ --radius-xl: 20px;
19
+ --surface: #f5f7f6;
20
+ --surface-raised: #ffffff;
21
+ --surface-sunken: #ebefed;
22
+ --line: #d3dcd9;
23
+ --line-strong: #7d8e8b;
24
+ --ink: #13201f;
25
+ --ink-muted: #4f605e;
26
+ --brand: #0f5257;
27
+ --brand-hover: #0a3f43;
28
+ --on-brand: #ffffff;
29
+ --brand-tint: #dcebe9;
30
+ --stamp: #e8833a;
31
+ --stamp-ink: #9a4510;
32
+ --on-stamp: #2a1404;
33
+ --success: #1e7346;
34
+ --success-tint: #e0f1e6;
35
+ --warning: #865700;
36
+ --warning-tint: #fbefd3;
37
+ --danger: #b3261e;
38
+ --danger-tint: #fbe3e1;
39
+ --info: #2b5aa8;
40
+ --info-tint: #e3ebf9;
41
+ --focus: #1f4fbf;
42
+ --chart-1: var(--brand);
43
+ --chart-2: var(--stamp);
44
+ --chart-3: var(--info);
45
+ --chart-grid: var(--line);
46
+ --shadow-overlay: 0 8px 24px rgba(19, 32, 31, 0.14), 0 1px 2px rgba(19, 32, 31, 0.08);
47
+ color-scheme: light;
48
+ }
49
+
50
+ :root[data-theme="dark"] {
51
+ --surface: #0d1416;
52
+ --surface-raised: #142023;
53
+ --surface-sunken: #091012;
54
+ --line: #27363a;
55
+ --line-strong: #62777b;
56
+ --ink: #e4eded;
57
+ --ink-muted: #9aabab;
58
+ --brand: #5cbcb6;
59
+ --brand-hover: #7dcdc8;
60
+ --on-brand: #04211f;
61
+ --brand-tint: #163538;
62
+ --stamp: #f0954f;
63
+ --stamp-ink: #f4a868;
64
+ --on-stamp: #2a1404;
65
+ --success: #62c98f;
66
+ --success-tint: #11301f;
67
+ --warning: #e8b04a;
68
+ --warning-tint: #33280f;
69
+ --danger: #f2867d;
70
+ --danger-tint: #3a1714;
71
+ --info: #8fb2f0;
72
+ --info-tint: #16233b;
73
+ --focus: #9cbcf5;
74
+ --chart-1: var(--brand);
75
+ --chart-2: var(--stamp);
76
+ --chart-3: var(--info);
77
+ --chart-grid: var(--line);
78
+ --shadow-overlay: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
79
+ color-scheme: dark;
80
+ }
81
+
82
+ @media (prefers-color-scheme: dark) {
83
+ :root:not([data-theme="light"]) {
84
+ --surface: #0d1416;
85
+ --surface-raised: #142023;
86
+ --surface-sunken: #091012;
87
+ --line: #27363a;
88
+ --line-strong: #62777b;
89
+ --ink: #e4eded;
90
+ --ink-muted: #9aabab;
91
+ --brand: #5cbcb6;
92
+ --brand-hover: #7dcdc8;
93
+ --on-brand: #04211f;
94
+ --brand-tint: #163538;
95
+ --stamp: #f0954f;
96
+ --stamp-ink: #f4a868;
97
+ --on-stamp: #2a1404;
98
+ --success: #62c98f;
99
+ --success-tint: #11301f;
100
+ --warning: #e8b04a;
101
+ --warning-tint: #33280f;
102
+ --danger: #f2867d;
103
+ --danger-tint: #3a1714;
104
+ --info: #8fb2f0;
105
+ --info-tint: #16233b;
106
+ --focus: #9cbcf5;
107
+ --chart-1: var(--brand);
108
+ --chart-2: var(--stamp);
109
+ --chart-3: var(--info);
110
+ --chart-grid: var(--line);
111
+ --shadow-overlay: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
112
+ color-scheme: dark;
113
+ }
114
+ }
115
+
116
+ .text-display-xl {
117
+ font-family: var(--font-display);
118
+ font-size: 56px;
119
+ line-height: 60px;
120
+ font-weight: 600;
121
+ letter-spacing: -0.02em;
122
+ }
123
+
124
+ .text-display {
125
+ font-family: var(--font-display);
126
+ font-size: 40px;
127
+ line-height: 44px;
128
+ font-weight: 600;
129
+ letter-spacing: -0.015em;
130
+ }
131
+
132
+ .text-heading-1 {
133
+ font-family: var(--font-display);
134
+ font-size: 28px;
135
+ line-height: 34px;
136
+ font-weight: 600;
137
+ letter-spacing: -0.01em;
138
+ }
139
+
140
+ .text-heading-2 {
141
+ font-family: var(--font-display);
142
+ font-size: 20px;
143
+ line-height: 28px;
144
+ font-weight: 600;
145
+ letter-spacing: 0;
146
+ }
147
+
148
+ .text-heading-3 {
149
+ font-family: var(--font-sans);
150
+ font-size: 16px;
151
+ line-height: 24px;
152
+ font-weight: 600;
153
+ letter-spacing: 0;
154
+ }
155
+
156
+ .text-body-lg {
157
+ font-family: var(--font-sans);
158
+ font-size: 17px;
159
+ line-height: 26px;
160
+ font-weight: 400;
161
+ letter-spacing: 0;
162
+ }
163
+
164
+ .text-body {
165
+ font-family: var(--font-sans);
166
+ font-size: 15px;
167
+ line-height: 22px;
168
+ font-weight: 400;
169
+ letter-spacing: 0;
170
+ }
171
+
172
+ .text-body-sm {
173
+ font-family: var(--font-sans);
174
+ font-size: 13px;
175
+ line-height: 20px;
176
+ font-weight: 400;
177
+ letter-spacing: 0;
178
+ }
179
+
180
+ .text-label {
181
+ font-family: var(--font-sans);
182
+ font-size: 12px;
183
+ line-height: 16px;
184
+ font-weight: 600;
185
+ letter-spacing: 0.06em;
186
+ text-transform: uppercase;
187
+ }
188
+
189
+ .text-figure-lg {
190
+ font-family: var(--font-sans);
191
+ font-size: 32px;
192
+ line-height: 36px;
193
+ font-weight: 600;
194
+ letter-spacing: -0.01em;
195
+ font-variant-numeric: tabular-nums;
196
+ }
197
+
198
+ .text-figure {
199
+ font-family: var(--font-sans);
200
+ font-size: 15px;
201
+ line-height: 22px;
202
+ font-weight: 500;
203
+ letter-spacing: 0;
204
+ font-variant-numeric: tabular-nums;
205
+ }
206
+
207
+ .text-code {
208
+ font-family: var(--font-mono);
209
+ font-size: 13px;
210
+ line-height: 20px;
211
+ font-weight: 400;
212
+ letter-spacing: 0;
213
+ }
214
+
215
+ .text-identifier {
216
+ font-family: var(--font-mono);
217
+ font-size: 12px;
218
+ line-height: 16px;
219
+ font-weight: 500;
220
+ letter-spacing: 0;
221
+ }
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@tenthbilling/design",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "private": false,
5
+ "description": "Tenth design tokens and the React Native themes used by @tenthbilling/expo's paywall",
6
+ "license": "MIT",
7
+ "author": "Tenth",
8
+ "homepage": "https://tenthbilling.com/docs/expo",
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/src/index.d.ts",
13
+ "default": "./dist/src/index.js"
14
+ },
15
+ "./tokens.json": "./tokens.json",
16
+ "./tokens.css": "./generated/tokens.css",
17
+ "./package.json": "./package.json"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "tokens.json",
25
+ "generated/tokens.css",
26
+ "README.md"
27
+ ],
28
+ "sideEffects": false,
29
+ "scripts": {
30
+ "build": "node ../../scripts/packages/clean-dist.mjs && tsc -p tsconfig.build.json && tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --removeComments false",
31
+ "build:tokens": "tsx scripts/build-tokens.ts",
32
+ "check:tokens": "tsx scripts/build-tokens.ts --check",
33
+ "lint": "eslint src scripts",
34
+ "typecheck": "tsc -p tsconfig.json",
35
+ "test": "vitest run"
36
+ },
37
+ "main": "./dist/src/index.js",
38
+ "types": "./dist/src/index.d.ts"
6
39
  }
package/tokens.json ADDED
@@ -0,0 +1,455 @@
1
+ {
2
+ "name": "Tenth",
3
+ "version": 1,
4
+ "color": {
5
+ "themes": [
6
+ {
7
+ "id": "light",
8
+ "name": "Light"
9
+ },
10
+ {
11
+ "id": "dark",
12
+ "name": "Dark"
13
+ }
14
+ ],
15
+ "tokens": [
16
+ {
17
+ "name": "surface",
18
+ "value": {
19
+ "light": "#f5f7f6",
20
+ "dark": "#0d1416"
21
+ },
22
+ "usage": "Page background behind everything in the dashboard and docs."
23
+ },
24
+ {
25
+ "name": "surface-raised",
26
+ "value": {
27
+ "light": "#ffffff",
28
+ "dark": "#142023"
29
+ },
30
+ "usage": "Cards, tables, panels, dialogs and the paywall sheet."
31
+ },
32
+ {
33
+ "name": "surface-sunken",
34
+ "value": {
35
+ "light": "#ebefed",
36
+ "dark": "#091012"
37
+ },
38
+ "usage": "Code blocks, input wells, table header rows."
39
+ },
40
+ {
41
+ "name": "line",
42
+ "value": {
43
+ "light": "#d3dcd9",
44
+ "dark": "#27363a"
45
+ },
46
+ "usage": "Hairlines: table rules, card borders, dividers. Decorative only; never the only cue for a control."
47
+ },
48
+ {
49
+ "name": "line-strong",
50
+ "value": {
51
+ "light": "#7d8e8b",
52
+ "dark": "#62777b"
53
+ },
54
+ "usage": "Borders that carry meaning: inputs, checkboxes, selectable paywall options. 3:1 on surface and surface-raised."
55
+ },
56
+ {
57
+ "name": "ink",
58
+ "value": {
59
+ "light": "#13201f",
60
+ "dark": "#e4eded"
61
+ },
62
+ "usage": "Primary text on surface, surface-raised, surface-sunken and brand-tint."
63
+ },
64
+ {
65
+ "name": "ink-muted",
66
+ "value": {
67
+ "light": "#4f605e",
68
+ "dark": "#9aabab"
69
+ },
70
+ "usage": "Secondary text, captions, table metadata, placeholder text. On surface, surface-raised, surface-sunken."
71
+ },
72
+ {
73
+ "name": "brand",
74
+ "value": {
75
+ "light": "#0f5257",
76
+ "dark": "#5cbcb6"
77
+ },
78
+ "usage": "Ledger teal. Primary buttons, links, selected states, chart series 1. Text in brand reads on surface, surface-raised and brand-tint."
79
+ },
80
+ {
81
+ "name": "brand-hover",
82
+ "value": {
83
+ "light": "#0a3f43",
84
+ "dark": "#7dcdc8"
85
+ },
86
+ "usage": "Hover and pressed fill for brand buttons."
87
+ },
88
+ {
89
+ "name": "on-brand",
90
+ "value": {
91
+ "light": "#ffffff",
92
+ "dark": "#04211f"
93
+ },
94
+ "usage": "Text and icons on brand and brand-hover fills."
95
+ },
96
+ {
97
+ "name": "brand-tint",
98
+ "value": {
99
+ "light": "#dcebe9",
100
+ "dark": "#163538"
101
+ },
102
+ "usage": "Selected table rows, active nav item, the selected paywall option's fill."
103
+ },
104
+ {
105
+ "name": "stamp",
106
+ "value": {
107
+ "light": "#e8833a",
108
+ "dark": "#f0954f"
109
+ },
110
+ "usage": "The 10th-day stamp. Highlights, the fixed-date badge fill, chart series 2. Never text on light grounds (2.5:1); use stamp-ink for that."
111
+ },
112
+ {
113
+ "name": "stamp-ink",
114
+ "value": {
115
+ "light": "#9a4510",
116
+ "dark": "#f4a868"
117
+ },
118
+ "usage": "Text in the stamp hue, e.g. 'Bills on the 10th'. On surface and surface-raised."
119
+ },
120
+ {
121
+ "name": "on-stamp",
122
+ "value": {
123
+ "light": "#2a1404",
124
+ "dark": "#2a1404"
125
+ },
126
+ "usage": "Text on a stamp fill."
127
+ },
128
+ {
129
+ "name": "success",
130
+ "value": {
131
+ "light": "#1e7346",
132
+ "dark": "#62c98f"
133
+ },
134
+ "usage": "Healthy states: active subscriptions, delivered webhooks, passed setup checks. Text on success-tint and surface-raised; always with a word and icon."
135
+ },
136
+ {
137
+ "name": "success-tint",
138
+ "value": {
139
+ "light": "#e0f1e6",
140
+ "dark": "#11301f"
141
+ },
142
+ "usage": "Fill behind success pills and banners."
143
+ },
144
+ {
145
+ "name": "warning",
146
+ "value": {
147
+ "light": "#865700",
148
+ "dark": "#e8b04a"
149
+ },
150
+ "usage": "Needs attention soon: grace period, canceling, threshold reminders, estimated amounts. Text on warning-tint and surface-raised."
151
+ },
152
+ {
153
+ "name": "warning-tint",
154
+ "value": {
155
+ "light": "#fbefd3",
156
+ "dark": "#33280f"
157
+ },
158
+ "usage": "Fill behind warning pills and banners."
159
+ },
160
+ {
161
+ "name": "danger",
162
+ "value": {
163
+ "light": "#b3261e",
164
+ "dark": "#f2867d"
165
+ },
166
+ "usage": "Broken or lost: billing retry, expired, failed deliveries, refunds and chargebacks in the ledger. Text on danger-tint and surface-raised; always with a word and icon."
167
+ },
168
+ {
169
+ "name": "danger-tint",
170
+ "value": {
171
+ "light": "#fbe3e1",
172
+ "dark": "#3a1714"
173
+ },
174
+ "usage": "Fill behind danger pills and banners."
175
+ },
176
+ {
177
+ "name": "info",
178
+ "value": {
179
+ "light": "#2b5aa8",
180
+ "dark": "#8fb2f0"
181
+ },
182
+ "usage": "Neutral notices: trialing, test environment, sandbox data. Text on info-tint and surface-raised."
183
+ },
184
+ {
185
+ "name": "info-tint",
186
+ "value": {
187
+ "light": "#e3ebf9",
188
+ "dark": "#16233b"
189
+ },
190
+ "usage": "Fill behind info pills and the test-mode banner."
191
+ },
192
+ {
193
+ "name": "focus",
194
+ "value": {
195
+ "light": "#1f4fbf",
196
+ "dark": "#9cbcf5"
197
+ },
198
+ "usage": "Keyboard focus ring, 2px solid with 2px offset, on every surface. At least 5.8:1 on all grounds in both themes."
199
+ },
200
+ {
201
+ "name": "chart-1",
202
+ "value": {
203
+ "light": "{brand}",
204
+ "dark": "{brand}"
205
+ },
206
+ "usage": "Chart series 1 (e.g. App Store revenue)."
207
+ },
208
+ {
209
+ "name": "chart-2",
210
+ "value": {
211
+ "light": "{stamp}",
212
+ "dark": "{stamp}"
213
+ },
214
+ "usage": "Chart series 2 (e.g. Google Play revenue)."
215
+ },
216
+ {
217
+ "name": "chart-3",
218
+ "value": {
219
+ "light": "{info}",
220
+ "dark": "{info}"
221
+ },
222
+ "usage": "Chart series 3 (e.g. web / Stripe revenue)."
223
+ },
224
+ {
225
+ "name": "chart-grid",
226
+ "value": {
227
+ "light": "{line}",
228
+ "dark": "{line}"
229
+ },
230
+ "usage": "Chart gridlines and axes."
231
+ }
232
+ ]
233
+ },
234
+ "type": {
235
+ "fonts": [],
236
+ "families": {
237
+ "display": "\"Familjen Grotesk\", \"Helvetica Neue\", Arial, sans-serif",
238
+ "sans": "\"Public Sans\", system-ui, -apple-system, \"Segoe UI\", sans-serif",
239
+ "mono": "\"IBM Plex Mono\", ui-monospace, SFMono-Regular, Menlo, monospace"
240
+ },
241
+ "groups": [
242
+ {
243
+ "name": "Display",
244
+ "family": "display",
245
+ "styles": [
246
+ {
247
+ "name": "display-xl",
248
+ "fontSize": "56px",
249
+ "lineHeight": "60px",
250
+ "fontWeight": 600,
251
+ "letterSpacing": "-0.02em",
252
+ "sample": "Bill on the 10th.",
253
+ "usage": "Marketing hero only. One per page."
254
+ },
255
+ {
256
+ "name": "display",
257
+ "fontSize": "40px",
258
+ "lineHeight": "44px",
259
+ "fontWeight": 600,
260
+ "letterSpacing": "-0.015em",
261
+ "sample": "Pay a tenth.",
262
+ "usage": "Marketing section heads, empty-state headlines, paywall title."
263
+ },
264
+ {
265
+ "name": "heading-1",
266
+ "fontSize": "28px",
267
+ "lineHeight": "34px",
268
+ "fontWeight": 600,
269
+ "letterSpacing": "-0.01em",
270
+ "sample": "Revenue",
271
+ "usage": "Dashboard page title. One per screen."
272
+ },
273
+ {
274
+ "name": "heading-2",
275
+ "fontSize": "20px",
276
+ "lineHeight": "28px",
277
+ "fontWeight": 600,
278
+ "sample": "Active subscriptions",
279
+ "usage": "Card and section titles."
280
+ }
281
+ ]
282
+ },
283
+ {
284
+ "name": "Text",
285
+ "family": "sans",
286
+ "styles": [
287
+ {
288
+ "name": "heading-3",
289
+ "fontSize": "16px",
290
+ "lineHeight": "24px",
291
+ "fontWeight": 600,
292
+ "sample": "Webhook endpoints",
293
+ "usage": "Sub-section titles, dialog titles, table group headers."
294
+ },
295
+ {
296
+ "name": "body-lg",
297
+ "fontSize": "17px",
298
+ "lineHeight": "26px",
299
+ "fontWeight": 400,
300
+ "sample": "Tenth verifies every receipt with Apple before it grants access.",
301
+ "usage": "Docs prose and marketing body."
302
+ },
303
+ {
304
+ "name": "body",
305
+ "fontSize": "15px",
306
+ "lineHeight": "22px",
307
+ "fontWeight": 400,
308
+ "sample": "Grace period ends Nov 3. The customer keeps access until then.",
309
+ "usage": "Default dashboard text and paywall body."
310
+ },
311
+ {
312
+ "name": "body-sm",
313
+ "fontSize": "13px",
314
+ "lineHeight": "20px",
315
+ "fontWeight": 400,
316
+ "sample": "Updated 2 minutes ago",
317
+ "usage": "Table cells, captions, helper text."
318
+ },
319
+ {
320
+ "name": "label",
321
+ "fontSize": "12px",
322
+ "lineHeight": "16px",
323
+ "fontWeight": 600,
324
+ "letterSpacing": "0.06em",
325
+ "sample": "MONTHLY TRACKED REVENUE",
326
+ "usage": "Uppercase field labels, metric labels, table column heads. Set in uppercase via text-transform."
327
+ },
328
+ {
329
+ "name": "figure-lg",
330
+ "fontSize": "32px",
331
+ "lineHeight": "36px",
332
+ "fontWeight": 600,
333
+ "letterSpacing": "-0.01em",
334
+ "sample": "$48,210.55",
335
+ "usage": "The headline number in a metric tile. Tabular figures."
336
+ },
337
+ {
338
+ "name": "figure",
339
+ "fontSize": "15px",
340
+ "lineHeight": "22px",
341
+ "fontWeight": 500,
342
+ "sample": "−$12.99",
343
+ "usage": "Money and counts in tables and lists. Tabular figures, right-aligned."
344
+ }
345
+ ]
346
+ },
347
+ {
348
+ "name": "Mono",
349
+ "family": "mono",
350
+ "styles": [
351
+ {
352
+ "name": "code",
353
+ "fontSize": "13px",
354
+ "lineHeight": "20px",
355
+ "fontWeight": 400,
356
+ "sample": "npx expo install @tenthbilling/expo",
357
+ "usage": "Code blocks and inline code in docs and setup screens."
358
+ },
359
+ {
360
+ "name": "identifier",
361
+ "fontSize": "12px",
362
+ "lineHeight": "16px",
363
+ "fontWeight": 500,
364
+ "sample": "tenth_live_pk_8Kd2…",
365
+ "usage": "API keys, transaction IDs, customer IDs, webhook event IDs."
366
+ }
367
+ ]
368
+ }
369
+ ]
370
+ },
371
+ "spacing": {
372
+ "tokens": [
373
+ {
374
+ "name": "space-1",
375
+ "value": "4px",
376
+ "usage": "Icon-to-label gap, pill padding block."
377
+ },
378
+ {
379
+ "name": "space-2",
380
+ "value": "8px",
381
+ "usage": "Gap between related controls; table cell padding block."
382
+ },
383
+ {
384
+ "name": "space-3",
385
+ "value": "12px",
386
+ "usage": "Input and button padding inline; table cell padding inline."
387
+ },
388
+ {
389
+ "name": "space-4",
390
+ "value": "16px",
391
+ "usage": "Card padding on phones; minimum page gutter."
392
+ },
393
+ {
394
+ "name": "space-5",
395
+ "value": "24px",
396
+ "usage": "Card padding on desktop; gap between cards."
397
+ },
398
+ {
399
+ "name": "space-6",
400
+ "value": "32px",
401
+ "usage": "Gap between page sections."
402
+ },
403
+ {
404
+ "name": "space-7",
405
+ "value": "48px",
406
+ "usage": "Dashboard page top padding; docs section spacing."
407
+ },
408
+ {
409
+ "name": "space-8",
410
+ "value": "80px",
411
+ "usage": "Marketing section spacing."
412
+ }
413
+ ]
414
+ },
415
+ "radius": {
416
+ "tokens": [
417
+ {
418
+ "name": "radius-sm",
419
+ "value": "4px",
420
+ "usage": "Pills, checkboxes, inline code, calendar day cells."
421
+ },
422
+ {
423
+ "name": "radius-md",
424
+ "value": "6px",
425
+ "usage": "Buttons, inputs, menus."
426
+ },
427
+ {
428
+ "name": "radius-lg",
429
+ "value": "10px",
430
+ "usage": "Cards, dialogs, paywall options."
431
+ },
432
+ {
433
+ "name": "radius-xl",
434
+ "value": "20px",
435
+ "usage": "The paywall sheet's top corners on phones."
436
+ }
437
+ ]
438
+ },
439
+ "shadow": {
440
+ "note": "Tenth separates surfaces with lines first. Shadows mark only things that float.",
441
+ "tokens": [
442
+ {
443
+ "name": "shadow-overlay",
444
+ "value": {
445
+ "light": "0 8px 24px rgba(19, 32, 31, 0.14), 0 1px 2px rgba(19, 32, 31, 0.08)",
446
+ "dark": "0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06)"
447
+ },
448
+ "usage": "Menus, popovers, dialogs, the paywall sheet."
449
+ }
450
+ ]
451
+ },
452
+ "meta": {
453
+ "source": "from scratch, 2026-10-25"
454
+ }
455
+ }