@kiva/kv-tokens 2.10.0 → 2.11.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,27 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.11.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-tokens@2.10.0...@kiva/kv-tokens@2.11.0) (2024-04-23)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * adjust type styles for dovetail-mvb 500, adjust font weights to match tailwind naming ([75e32d1](https://github.com/kiva/kv-ui-elements/commit/75e32d110b0c0c99fce77366b6bef621bbcd2401))
12
+ * import serif from primitives ([dd96190](https://github.com/kiva/kv-ui-elements/commit/dd961906c359c9d67943ea05762224fd5500ed0a))
13
+ * refine letter spacing to match figma to our dynamic em calculations ([6567f6c](https://github.com/kiva/kv-ui-elements/commit/6567f6c9b147bdab812c006ea9f7c403d5937a8e))
14
+ * remove h6, re-apply letter spacing, remove bold dovetail styles ([163b657](https://github.com/kiva/kv-ui-elements/commit/163b65793cd1490210368f5fac9325a881e11354))
15
+ * set h3 bold, remove unused italic/em element style ([9835f05](https://github.com/kiva/kv-ui-elements/commit/9835f05358f03cc8903db835b95dd7dd03399aba))
16
+ * testing baseline configs for including new dovetail webfont ([7079590](https://github.com/kiva/kv-ui-elements/commit/7079590f9b3ab0bbfb91b81ab6aa98fd4ae2f113))
17
+
18
+
19
+ ### Features
20
+
21
+ * implement kiva ecosystem default type styles ([c87d6fc](https://github.com/kiva/kv-ui-elements/commit/c87d6fc700cb130a4c55b0723438a89202c985ee))
22
+
23
+
24
+
25
+
26
+
6
27
  # [2.10.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-tokens@2.9.0...@kiva/kv-tokens@2.10.0) (2023-09-07)
7
28
 
8
29
 
@@ -2,6 +2,7 @@ const { rem, em } = require('./util.cjs');
2
2
  const designtokens = require('../primitives.json');
3
3
 
4
4
  const {
5
+ fonts,
5
6
  fontSizes,
6
7
  fontWeights,
7
8
  letterSpacings,
@@ -14,24 +15,29 @@ const {
14
15
  WEB FONT DEFINITIONS
15
16
  */
16
17
  const webFonts = [
18
+ // Note corresponding font weight in Tailwind is "normal"
17
19
  {
18
20
  '@font-face': {
19
21
  fontFamily: 'PostGrotesk',
20
22
  fontWeight: '400',
21
23
  fontStyle: 'normal',
22
24
  fontDisplay: 'swap',
25
+ // eslint-disable-next-line max-len
23
26
  src: 'url(//www-kiva-org.freetls.fastly.net/static/fonts/PostGrotesk-Medium.8c8a585.woff2) format(\'woff2\')',
24
27
  },
25
28
  },
29
+ // Note corresponding font weight in Tailwind is "normal"
26
30
  {
27
31
  '@font-face': {
28
32
  fontFamily: 'PostGrotesk',
29
33
  fontWeight: '400',
30
34
  fontStyle: 'italic',
31
35
  fontDisplay: 'swap',
36
+ // eslint-disable-next-line max-len
32
37
  src: 'url(//www-kiva-org.freetls.fastly.net/static/fonts/PostGrotesk-MediumItalic.133f41d.woff2) format(\'woff2\')',
33
38
  },
34
39
  },
40
+ // Note corresponding font weight in Tailwind is "light"
35
41
  {
36
42
  '@font-face': {
37
43
  fontFamily: 'PostGrotesk',
@@ -41,12 +47,14 @@ const webFonts = [
41
47
  src: 'url(//www-kiva-org.freetls.fastly.net/static/fonts/PostGrotesk-Book.246fc8e.woff2) format(\'woff2\')',
42
48
  },
43
49
  },
50
+ // Note corresponding font weight in Tailwind is "light"
44
51
  {
45
52
  '@font-face': {
46
53
  fontFamily: 'PostGrotesk',
47
54
  fontWeight: '300',
48
55
  fontStyle: 'italic',
49
56
  fontDisplay: 'swap',
57
+ // eslint-disable-next-line max-len
50
58
  src: 'url(//www-kiva-org.freetls.fastly.net/static/fonts/PostGrotesk-BookItalic.4d06d39.woff2) format(\'woff2\')',
51
59
  },
52
60
  },
@@ -60,9 +68,10 @@ const textBaseColor = 'rgb(var(--text-primary))';
60
68
  */
61
69
  const textStyles = (() => {
62
70
  const textJumbo = {
71
+ fontFamily: fonts.serif,
63
72
  fontWeight: fontWeights.medium,
64
73
  fontSize: rem(fontSizes.jumbo.sm),
65
- letterSpacing: letterSpacings['-2'],
74
+ letterSpacing: letterSpacings['-1'],
66
75
  lineHeight: lineHeights.tight,
67
76
  '@screen md': {
68
77
  fontSize: rem(fontSizes.jumbo.md),
@@ -73,54 +82,52 @@ const textStyles = (() => {
73
82
  };
74
83
 
75
84
  const textH1 = {
85
+ fontFamily: fonts.serif,
76
86
  fontSize: rem(fontSizes.h1.sm),
77
87
  fontWeight: fontWeights.medium,
78
- letterSpacing: em(letterSpacings['-0.3'], fontSizes.h1.sm),
88
+ letterSpacing: em(letterSpacings['-0.5'], fontSizes.h1.md),
79
89
  lineHeight: lineHeights.tight,
80
90
  '@screen md': {
81
91
  fontSize: rem(fontSizes.h1.md),
82
- letterSpacing: em(letterSpacings['-1'], fontSizes.h1.md),
83
92
  },
84
93
  '@screen lg': {
85
94
  fontSize: rem(fontSizes.h1.lg),
86
- letterSpacing: em(letterSpacings['-2'], fontSizes.h1.lg),
87
95
  },
88
96
  };
89
97
 
90
98
  const textH2 = {
99
+ fontFamily: fonts.serif,
91
100
  fontSize: rem(fontSizes.h2.sm),
92
101
  fontWeight: fontWeights.medium,
93
- letterSpacing: em(letterSpacings['-1'], fontSizes.h2.sm),
102
+ letterSpacing: em(letterSpacings.normal, fontSizes.h2.sm),
94
103
  lineHeight: lineHeights.tight,
95
104
  '@screen md': {
96
105
  fontSize: rem(fontSizes.h2.md),
97
- letterSpacing: em(letterSpacings['-1'], fontSizes.h2.md),
106
+ letterSpacing: em(letterSpacings['-0.3'], fontSizes.h2.md),
98
107
  },
99
108
  '@screen lg': {
100
109
  fontSize: rem(fontSizes.h2.lg),
101
- letterSpacing: em(letterSpacings['-1'], fontSizes.h2.lg),
102
- lineHeight: lineHeights.normal,
110
+ letterSpacing: em(letterSpacings['-0.3'], fontSizes.h2.lg),
111
+ lineHeight: lineHeights['nearly-none'],
103
112
  },
104
113
  };
105
114
 
106
115
  const textH3 = {
107
116
  fontSize: rem(fontSizes.h3.sm),
108
- fontWeight: fontWeights.medium,
109
- letterSpacing: em(letterSpacings['-1'], fontSizes.h3.sm),
117
+ fontWeight: fontWeights.normal,
118
+ letterSpacing: em(letterSpacings['-0.3'], fontSizes.h3.sm),
110
119
  lineHeight: lineHeights.tight,
111
120
  '@screen md': {
112
121
  fontSize: rem(fontSizes.h3.md),
113
- letterSpacing: em(letterSpacings['-0.3'], fontSizes.h3.md),
114
122
  },
115
123
  '@screen lg': {
116
124
  fontSize: rem(fontSizes.h3.lg),
117
- letterSpacing: em(letterSpacings['-1'], fontSizes.h3.lg),
118
125
  },
119
126
  };
120
127
 
121
128
  const textH4 = {
122
129
  fontSize: rem(fontSizes.h4.sm),
123
- fontWeight: fontWeights.medium,
130
+ fontWeight: fontWeights.normal,
124
131
  lineHeight: lineHeights.normal,
125
132
  textTransform: 'uppercase',
126
133
  '@screen md': {
@@ -131,27 +138,36 @@ const textStyles = (() => {
131
138
  },
132
139
  };
133
140
 
141
+ const textH5 = {
142
+ fontFamily: fonts.sans,
143
+ fontSize: rem(fontSizes.h4.sm),
144
+ fontWeight: fontWeights.normal,
145
+ letterSpacing: em(letterSpacings.normal, fontSizes.subhead.sm),
146
+ lineHeight: lineHeights['nearly-none'],
147
+ };
148
+
134
149
  const textSubhead = {
150
+ fontFamily: fonts.sans,
135
151
  fontSize: rem(fontSizes.subhead.sm),
136
- fontWeight: fontWeights.book,
137
- letterSpacing: em(letterSpacings['-0.5'], fontSizes.subhead.sm),
138
- lineHeight: lineHeights.normal,
152
+ fontWeight: fontWeights.light,
153
+ letterSpacing: em(letterSpacings.normal, fontSizes.subhead.sm),
154
+ lineHeight: lineHeights.tight,
139
155
  '@screen md': {
140
156
  fontSize: rem(fontSizes.subhead.md),
141
- letterSpacing: em(letterSpacings['-0.5'], fontSizes.subhead.md),
142
157
  },
143
158
  '@screen lg': {
144
159
  fontSize: rem(fontSizes.subhead.lg),
145
- letterSpacing: em(letterSpacings['-0.5'], fontSizes.subhead.lg),
146
160
  },
147
161
  };
148
162
 
149
163
  const textBase = {
150
- fontWeight: fontWeights.book,
164
+ fontWeight: fontWeights.light,
151
165
  fontSize: rem(fontSizes.base.sm),
166
+ letterSpacing: em(letterSpacings.normal, fontSizes.base.sm),
152
167
  lineHeight: lineHeights.normal,
153
168
  '@screen lg': {
154
169
  fontSize: rem(fontSizes.base.lg),
170
+ letterSpacing: em(letterSpacings.normal, fontSizes.base.sm),
155
171
  },
156
172
  };
157
173
 
@@ -175,7 +191,22 @@ const textStyles = (() => {
175
191
  const textPlaceholder = {
176
192
  color: 'rgb(var(--text-tertiary))',
177
193
  opacity: 1,
178
- fontWeight: fontWeights.book,
194
+ fontWeight: fontWeights.light,
195
+ };
196
+
197
+ const textBlockquote = {
198
+ fontFamily: fonts.serif,
199
+ fontSize: rem(fontSizes.h2.sm),
200
+ fontStyle: 'italic',
201
+ fontWeight: fontWeights.medium,
202
+ letterSpacing: em(letterSpacings['-0.5'], fontSizes.h2.sm),
203
+ lineHeight: lineHeights.tight,
204
+ '@screen md': {
205
+ fontSize: rem(fontSizes.h2.md),
206
+ },
207
+ '@screen lg': {
208
+ fontSize: rem(fontSizes.h2.lg),
209
+ },
179
210
  };
180
211
 
181
212
  return {
@@ -184,11 +215,13 @@ const textStyles = (() => {
184
215
  textH2,
185
216
  textH3,
186
217
  textH4,
218
+ textH5,
187
219
  textSubhead,
188
220
  textBase,
189
221
  textSmall,
190
222
  textLink,
191
223
  textPlaceholder,
224
+ textBlockquote,
192
225
  };
193
226
  })();
194
227
 
@@ -260,39 +293,45 @@ const proseOverrides = () => ({
260
293
  fontSize: false,
261
294
  lineHeight: false,
262
295
  p: {
263
- marginTop: rem(space[4]),
264
- marginBottom: rem(space[4]),
296
+ marginTop: rem(space[2]),
297
+ marginBottom: rem(space[2]),
265
298
  },
266
299
  blockquote: {
267
- marginTop: rem(space[4]),
268
- marginBottom: rem(space[4]),
300
+ marginTop: rem(space[2]),
301
+ marginBottom: rem(space[2]),
269
302
  padding: `0 0 0 ${rem(space['6'])}`,
270
303
  },
271
304
  h1: {
272
305
  fontSize: false,
273
306
  letterSpacing: false,
274
307
  marginTop: '0',
275
- marginBottom: rem(space[4]),
308
+ marginBottom: rem(space[2]),
276
309
  color: textBaseColor,
277
310
  },
278
311
  h2: {
279
312
  fontSize: false,
280
313
  letterSpacing: false,
281
- marginTop: rem(space[4]),
282
- marginBottom: rem(space[4]),
314
+ marginTop: rem(space[2]),
315
+ marginBottom: rem(space[2]),
283
316
  color: textBaseColor,
284
317
  },
285
318
  h3: {
286
319
  fontSize: false,
287
320
  letterSpacing: false,
288
- marginTop: rem(space[4]),
321
+ marginTop: rem(space[2]),
289
322
  marginBottom: rem(space[2]),
290
323
  color: textBaseColor,
291
324
  },
292
325
  h4: {
293
326
  letterSpacing: false,
294
327
  marginTop: false,
295
- marginBottom: rem(space[4]),
328
+ marginBottom: rem(space[2]),
329
+ color: textBaseColor,
330
+ },
331
+ h5: {
332
+ letterSpacing: false,
333
+ marginTop: false,
334
+ marginBottom: rem(space[2]),
296
335
  color: textBaseColor,
297
336
  },
298
337
  img: false,
@@ -308,7 +347,7 @@ const proseOverrides = () => ({
308
347
  'figure figcaption': {
309
348
  fontSize: false,
310
349
  lineHeight: false,
311
- marginTop: rem(space[4]),
350
+ marginTop: rem(space[2]),
312
351
  },
313
352
  code: false,
314
353
  'code::before': false,
@@ -329,16 +368,16 @@ const proseOverrides = () => ({
329
368
  },
330
369
  'pre code': false,
331
370
  ol: {
332
- marginTop: rem(space[4]),
333
- marginBottom: rem(space[4]),
371
+ marginTop: rem(space[2]),
372
+ marginBottom: rem(space[2]),
334
373
  paddingLeft: em(18, 16),
335
374
  },
336
375
  'ol > li': {
337
376
  paddingLeft: em(10, 16),
338
377
  },
339
378
  ul: {
340
- marginTop: rem(space[4]),
341
- marginBottom: rem(space[4]),
379
+ marginTop: rem(space[2]),
380
+ marginBottom: rem(space[2]),
342
381
  paddingLeft: em(18, 16),
343
382
  },
344
383
  'ul > li': {
@@ -74,10 +74,16 @@ module.exports = {
74
74
  16: rem(space['16']),
75
75
  },
76
76
  fontFamily: {
77
+ // eslint-disable-next-line max-len
77
78
  sans: [`${fonts.sans}, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif`],
79
+ // eslint-disable-next-line max-len
80
+ serif: [`${fonts.serif}, ui-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Palatino', Georgia, 'Times New Roman', serif`],
78
81
  },
79
82
  fontWeight: {
80
- book: `${fontWeights.book}`,
83
+ // Keeping "book" defined here for backwards compatibility
84
+ book: `${fontWeights.light}`,
85
+ light: `${fontWeights.light}`,
86
+ normal: `${fontWeights.normal}`,
81
87
  medium: `${fontWeights.medium}`,
82
88
  },
83
89
  borderWidth: {
@@ -192,18 +198,19 @@ module.exports = {
192
198
  h2: textStyles.textH2,
193
199
  h3: textStyles.textH3,
194
200
  h4: textStyles.textH4,
201
+ h5: textStyles.textH5,
195
202
  small: textStyles.textSmall,
196
203
  code: {
197
204
  fontSize: '0.875em',
198
205
  },
199
- blockquote: textStyles.textSubhead,
206
+ blockquote: textStyles.textBlockquote,
200
207
  'figure figcaption': textStyles.textSmall,
201
208
  'button:focus': {
202
209
  outline: 'revert', // undo tailwind button focus styling
203
210
  },
204
211
  a: textStyles.textLink,
205
212
  'strong, b': {
206
- fontWeight: fontWeights.medium,
213
+ fontWeight: fontWeights.normal,
207
214
  },
208
215
  hr: {
209
216
  borderColor: colors.gray['500'],
@@ -226,10 +233,12 @@ module.exports = {
226
233
  '.text-h2': textStyles.textH2,
227
234
  '.text-h3': textStyles.textH3,
228
235
  '.text-h4': textStyles.textH4,
236
+ '.text-h5': textStyles.textH5,
229
237
  '.text-subhead': textStyles.textSubhead,
230
238
  '.text-jumbo': textStyles.textJumbo,
231
239
  '.text-small': textStyles.textSmall,
232
240
  '.text-link': textStyles.textLink,
241
+ '.text-blockquote': textStyles.textBlockquote,
233
242
  }, ['responsive']);
234
243
  }),
235
244
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-tokens",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -16,5 +16,5 @@
16
16
  "@tailwindcss/typography": "^0.5.1",
17
17
  "tailwindcss": "^3.0.18"
18
18
  },
19
- "gitHead": "4ce025324410f92a58a6e235886145d501290f79"
19
+ "gitHead": "9cd04b768af71aead30d08320229402bf3c79989"
20
20
  }
package/primitives.json CHANGED
@@ -190,7 +190,8 @@
190
190
  "16": 128
191
191
  },
192
192
  "fonts": {
193
- "sans": "PostGrotesk"
193
+ "sans": "PostGrotesk",
194
+ "serif": "dovetail-mvb"
194
195
  },
195
196
  "fontSizes": {
196
197
  "base": {
@@ -199,9 +200,9 @@
199
200
  "lg": 17
200
201
  },
201
202
  "jumbo": {
202
- "sm": 64,
203
- "md": 96,
204
- "lg": 112
203
+ "sm": 42,
204
+ "md": 48,
205
+ "lg": 72
205
206
  },
206
207
  "small": {
207
208
  "sm": 13,
@@ -209,36 +210,43 @@
209
210
  "lg": 14
210
211
  },
211
212
  "h1": {
212
- "sm": 40,
213
- "md": 50,
214
- "lg": 54
213
+ "sm": 36,
214
+ "md": 40,
215
+ "lg": 48
215
216
  },
216
217
  "h2": {
217
- "sm": 24,
218
+ "sm": 28,
218
219
  "md": 28,
219
220
  "lg": 32
220
221
  },
221
222
  "h3": {
222
- "sm": 20,
223
+ "sm": 22,
223
224
  "md": 22,
224
225
  "lg": 24
225
226
  },
226
227
  "h4": {
227
- "sm": 12,
228
+ "sm": 14,
228
229
  "md": 14,
229
230
  "lg": 14
230
231
  },
232
+ "h5": {
233
+ "sm": 13,
234
+ "md": 13,
235
+ "lg": 14
236
+ },
231
237
  "subhead": {
232
- "sm": 20,
238
+ "sm": 22,
233
239
  "md": 22,
234
240
  "lg": 24
235
241
  }
236
242
  },
237
243
  "fontWeights": {
238
- "book": 300,
239
- "medium": 400
244
+ "light": 300,
245
+ "normal": 400,
246
+ "medium": 500
240
247
  },
241
248
  "lineHeights": {
249
+ "nearly-none": 1.05,
242
250
  "tight": 1.25,
243
251
  "normal": 1.5
244
252
  },