@stainless-api/ui-primitives 0.1.0-beta.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.
@@ -0,0 +1,199 @@
1
+ @layer stl-ui {
2
+ /* Typography - Stainless */
3
+ :root {
4
+ --stl-ui-typography-font: 'Geist', system-ui, sans-serif;
5
+ --stl-ui-typography-font-mono: 'Geist Mono', ui-monospace, monospace;
6
+ --stl-ui-typography-line-height: 1.5;
7
+ --stl-ui-typography-line-height-headings: 1.2;
8
+
9
+ --stl-ui-typography-text-body: var(--stl-ui-type-scale-text);
10
+ --stl-ui-typography-text-body-sm: var(--stl-ui-type-scale-text-sm);
11
+ --stl-ui-typography-text-body-xs: var(--stl-ui-type-scale-text-xs);
12
+
13
+ --stl-ui-typography-text-code: var(--stl-ui-type-scale-text-sm);
14
+ --stl-ui-typography-text-code-sm: var(--stl-ui-type-scale-text-xs);
15
+
16
+ --stl-ui-typography-text-h1: var(--stl-ui-type-scale-text-5xl);
17
+ --stl-ui-typography-text-h2: var(--stl-ui-type-scale-text-4xl);
18
+ --stl-ui-typography-text-h3: var(--stl-ui-type-scale-text-3xl);
19
+ --stl-ui-typography-text-h4: var(--stl-ui-type-scale-text-2xl);
20
+ --stl-ui-typography-text-h5: var(--stl-ui-type-scale-text-xl);
21
+
22
+ --stl-ui-type-scale-text-xs: 12px;
23
+ --stl-ui-type-scale-text-sm: 14px;
24
+ --stl-ui-type-scale-text: 16px;
25
+ --stl-ui-type-scale-text-lg: 18px;
26
+ --stl-ui-type-scale-text-xl: 20px;
27
+ --stl-ui-type-scale-text-2xl: 24px;
28
+ --stl-ui-type-scale-text-3xl: 29px;
29
+ --stl-ui-type-scale-text-4xl: 35px;
30
+ --stl-ui-type-scale-text-5xl: 42px;
31
+ --stl-ui-type-scale-text-6xl: 64px;
32
+ }
33
+
34
+ /* Prose exists in its own sub-layer for easy reverting */
35
+ @layer typography {
36
+ body {
37
+ font-family: var(--stl-ui-typography-font);
38
+ font-feature-settings:
39
+ 'ss01' on,
40
+ 'ss03' on,
41
+ 'ss04' on,
42
+ 'ss06' on,
43
+ 'ss08' on;
44
+ }
45
+
46
+ .stl-ui-prose {
47
+ color: var(--stl-ui-foreground-secondary);
48
+
49
+ /* Body/Regular */
50
+ font-size: var(--stl-ui-typography-text-body);
51
+ font-style: normal;
52
+ font-weight: 400;
53
+ line-height: var(--stl-ui-typography-line-height);
54
+ letter-spacing: -0.01em;
55
+
56
+ * {
57
+ margin: 0;
58
+ }
59
+
60
+ p {
61
+ margin-top: 16px;
62
+ }
63
+
64
+ p,
65
+ li {
66
+ color: var(--stl-ui-foreground-secondary);
67
+ }
68
+
69
+ strong {
70
+ color: var(--stl-ui-foreground);
71
+ }
72
+
73
+ aside {
74
+ p,
75
+ li {
76
+ color: var(--stl-ui-foreground);
77
+ }
78
+ }
79
+
80
+ a {
81
+ color: var(--stl-ui-foreground-accent);
82
+
83
+ /* Body/Link */
84
+ font-weight: 600;
85
+ text-decoration-line: underline;
86
+ text-decoration-style: solid;
87
+ text-decoration-skip-ink: auto;
88
+ text-decoration-thickness: auto;
89
+ text-underline-offset: auto;
90
+ text-underline-position: from-font;
91
+ }
92
+
93
+ h1,
94
+ h2,
95
+ h3,
96
+ h4,
97
+ h5,
98
+ h6 {
99
+ color: var(--stl-ui-foreground);
100
+ font-weight: 500;
101
+ line-height: var(--stl-ui-typography-line-height-headings);
102
+ }
103
+
104
+ h1 {
105
+ /* Heading 1/Medium */
106
+ font-size: var(--stl-ui-typography-text-h1);
107
+ letter-spacing: -0.03em;
108
+
109
+ margin-top: 64px;
110
+ }
111
+
112
+ h2 {
113
+ /* Heading 2/Medium */
114
+ font-size: var(--stl-ui-typography-text-h2);
115
+ letter-spacing: -0.03em;
116
+ margin-top: 48px;
117
+ }
118
+
119
+ h3 {
120
+ /* Heading 3/Medium */
121
+ font-size: var(--stl-ui-typography-text-h3);
122
+ letter-spacing: -0.02em;
123
+ margin-top: 40px;
124
+ }
125
+
126
+ h4 {
127
+ /* Heading 4/Medium */
128
+ font-size: var(--stl-ui-typography-text-h4);
129
+ letter-spacing: -0.02em;
130
+ margin-top: 32px;
131
+ }
132
+
133
+ h5 {
134
+ /* Heading 5/Medium */
135
+ font-size: var(--stl-ui-typography-text-h5);
136
+ letter-spacing: -0.02em;
137
+ margin-top: 24px;
138
+ }
139
+
140
+ li {
141
+ &:not(:last-child) {
142
+ margin-bottom: 8px;
143
+ }
144
+
145
+ h1,
146
+ h2,
147
+ h3,
148
+ h4,
149
+ h5,
150
+ p,
151
+ a {
152
+ &:first-child {
153
+ display: inline;
154
+ }
155
+ }
156
+ }
157
+
158
+ ol,
159
+ ul {
160
+ padding-left: 26px;
161
+ }
162
+
163
+ ol,
164
+ ul,
165
+ aside,
166
+ img,
167
+ svg,
168
+ figure,
169
+ details {
170
+ margin-top: 16px;
171
+ }
172
+
173
+ :not(pre) > code {
174
+ color: var(--stl-ui-foreground);
175
+ font-feature-settings:
176
+ 'ss01' on,
177
+ 'ss03' on,
178
+ 'ss04' on,
179
+ 'ss06' on;
180
+
181
+ /* Code/Regular */
182
+ font-family: var(--stl-ui-typography-font-mono);
183
+ font-size: var(--stl-ui-typography-text-body-sm);
184
+ font-style: normal;
185
+ font-weight: 400;
186
+ line-height: 150%; /* 21px */
187
+
188
+ padding: 0 4px;
189
+ background-color: oklch(from var(--stl-ui-foreground) l c h / 0.1);
190
+ border-radius: var(--stl-ui-layout-border-radius-xs);
191
+ }
192
+
193
+ /* Escape hatch for non-prose content */
194
+ .stl-ui-not-prose * {
195
+ all: revert-layer;
196
+ }
197
+ }
198
+ }
199
+ }
package/src/styles.css ADDED
@@ -0,0 +1,11 @@
1
+ @import './styles/scales.css';
2
+ @import './styles/swatches.css';
3
+ @import './styles/typography.css';
4
+ @import './styles/layout.css';
5
+ @import './styles/theme.css';
6
+ @import './styles/starlight-compat.css';
7
+
8
+ @import './components/button.css';
9
+ @import './components/dropdown-button.css';
10
+ @import './components/callout.css';
11
+ @import './components/details.css';
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "declaration": true,
6
+ "declarationDir": "dist",
7
+ "outDir": "dist",
8
+ "jsx": "react-jsx",
9
+ "esModuleInterop": true,
10
+ "moduleResolution": "Node",
11
+ "skipLibCheck": true,
12
+ "strict": true
13
+ },
14
+ "include": ["src"]
15
+ }