@talelk/newui-tailwind 1.0.0 → 1.1.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/package.json +2 -2
- package/src/contrast.test.ts +66 -0
- package/src/fonts/IBMPlexSans/IBMPlexSans-latin-ext-italic.var.woff2 +0 -0
- package/src/fonts/IBMPlexSans/IBMPlexSans-latin-ext-normal.var.woff2 +0 -0
- package/src/fonts/IBMPlexSans/IBMPlexSans-latin-italic.var.woff2 +0 -0
- package/src/fonts/IBMPlexSans/IBMPlexSans-latin-normal.var.woff2 +0 -0
- package/src/fonts/{Inter → IBMPlexSans}/LICENSE.txt +3 -2
- package/src/fonts/IBMPlexSans/plex.css +48 -0
- package/src/generated/theme.css +213 -173
- package/src/generated/tokens.css +188 -178
- package/src/generated.test.ts +20 -0
- package/src/plugins/theme.js +5 -1
- package/src/style.css +1 -1
- package/src/utilities.css +83 -3
- package/src/fonts/Inter/Inter-Italic.var.woff2 +0 -0
- package/src/fonts/Inter/Inter.var.woff2 +0 -0
- package/src/fonts/Inter/inter.css +0 -61
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talelk/newui-tailwind",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Tailwind CSS v4 layer: the newui design tokens as @theme, @utility and plugins.",
|
|
6
6
|
"exports": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"src"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@talelk/newui-tokens": "0.
|
|
20
|
+
"@talelk/newui-tokens": "0.2.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@tailwindcss/forms": "^0.5.11",
|
package/src/contrast.test.ts
CHANGED
|
@@ -59,14 +59,54 @@ const PAIRS: Pair[] = [
|
|
|
59
59
|
what: 'chart subtitle and card caption',
|
|
60
60
|
},
|
|
61
61
|
|
|
62
|
+
// the shared overlay panel (atoms/lib overlayPanel + listboxRow): body ink
|
|
63
|
+
// and the checked step on the panel and on the highlighted row
|
|
64
|
+
{
|
|
65
|
+
fg: 'ink-gray-8',
|
|
66
|
+
bg: 'surface-elevation-1',
|
|
67
|
+
what: 'overlay panel body and listbox row',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
fg: 'ink-gray-8',
|
|
71
|
+
bg: 'surface-gray-3',
|
|
72
|
+
what: 'highlighted listbox row',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
fg: 'ink-blue-8',
|
|
76
|
+
bg: 'surface-elevation-1',
|
|
77
|
+
what: 'checked listbox row',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
fg: 'ink-blue-8',
|
|
81
|
+
bg: 'surface-gray-3',
|
|
82
|
+
what: 'checked and highlighted listbox row',
|
|
83
|
+
},
|
|
84
|
+
|
|
62
85
|
// a board column is the one tinted region muted text lands on
|
|
63
86
|
{ fg: 'ink-gray-8', bg: 'surface-gray-1', what: 'column heading' },
|
|
64
87
|
{ fg: 'ink-gray-6', bg: 'surface-gray-1', what: 'muted on a board column' },
|
|
65
88
|
|
|
66
89
|
{ fg: 'ink-blue-link', bg: 'surface-base', what: 'blue link on base' },
|
|
67
90
|
{ fg: 'ink-blue-link', bg: 'surface-elevation-1', what: 'blue link on card' },
|
|
91
|
+
// The Mist frame carries the page header's description and the sidebar.
|
|
92
|
+
{ fg: 'ink-gray-6', bg: 'surface-canvas', what: 'muted text on the frame' },
|
|
93
|
+
{ fg: 'ink-gray-7', bg: 'surface-canvas', what: 'nav label on the frame' },
|
|
68
94
|
{ fg: 'ink-blue-link', bg: 'surface-gray-1', what: 'blue link on canvas' },
|
|
69
95
|
|
|
96
|
+
// required marker on a label, on the page or a card
|
|
97
|
+
{ fg: 'ink-red-8', bg: 'surface-base', what: 'required marker on base' },
|
|
98
|
+
// StatGrid deltas are toned text straight on the strip's cells, no pill.
|
|
99
|
+
{
|
|
100
|
+
fg: 'ink-green-8',
|
|
101
|
+
bg: 'surface-elevation-1',
|
|
102
|
+
what: 'good delta on a stat cell',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
fg: 'ink-red-8',
|
|
106
|
+
bg: 'surface-elevation-1',
|
|
107
|
+
what: 'required marker on a card',
|
|
108
|
+
},
|
|
109
|
+
|
|
70
110
|
{
|
|
71
111
|
fg: 'ink-blue-8',
|
|
72
112
|
bg: 'surface-blue-1',
|
|
@@ -158,3 +198,29 @@ for (const mode of ['light', 'dark'] as Mode[]) {
|
|
|
158
198
|
).toBeGreaterThanOrEqual(3)
|
|
159
199
|
})
|
|
160
200
|
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Solid buttons use the `-9` surface on hover and while open/pressed. The ramp
|
|
204
|
+
* inverts with the theme: `-9` is darker than the resting `-8` in light mode
|
|
205
|
+
* and lighter in dark mode. The foreground stays `ink-base`, so both
|
|
206
|
+
* directions are asserted — this is the pair that ships while the pointer is
|
|
207
|
+
* on the button, separate from the resting pair above.
|
|
208
|
+
*/
|
|
209
|
+
describe('solid button state contract (WCAG AA)', () => {
|
|
210
|
+
const SOLID_THEMES = ['gray', 'blue', 'green', 'red'] as const
|
|
211
|
+
|
|
212
|
+
for (const theme of SOLID_THEMES) {
|
|
213
|
+
for (const mode of ['light', 'dark'] as Mode[]) {
|
|
214
|
+
it(`${mode}: ${theme} solid hover/open ≥ ${AA}`, () => {
|
|
215
|
+
const ratio = contrast(
|
|
216
|
+
resolve(mode, 'ink-base'),
|
|
217
|
+
resolve(mode, `surface-${theme}-9`),
|
|
218
|
+
)
|
|
219
|
+
expect(
|
|
220
|
+
Number(ratio.toFixed(2)),
|
|
221
|
+
`ink-base on surface-${theme}-9 = ${ratio.toFixed(2)}:1`,
|
|
222
|
+
).toBeGreaterThanOrEqual(AA)
|
|
223
|
+
})
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2019 IBM Corp. All rights reserved. IBMPlexSans-Italic[wdth,wght].ttf: Copyright 2019 IBM Corp. All rights reserved.
|
|
2
2
|
|
|
3
3
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
4
|
This license is copied below, and is also available with a FAQ at:
|
|
5
5
|
http://scripts.sil.org/OFL
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
-----------------------------------------------------------
|
|
8
9
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
9
10
|
-----------------------------------------------------------
|
|
@@ -43,7 +44,7 @@ new environment.
|
|
|
43
44
|
"Author" refers to any designer, engineer, programmer, technical
|
|
44
45
|
writer or other person who contributed to the Font Software.
|
|
45
46
|
|
|
46
|
-
PERMISSION
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
47
48
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
48
49
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
49
50
|
redistribute, and sell modified and unmodified copies of the Font
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* IBM Plex Sans, variable (wght 100–700, wdth 75–100), self-hosted.
|
|
2
|
+
* Source: @fontsource-variable/ibm-plex-sans 5.3.0, SIL OFL 1.1 (LICENSE.txt).
|
|
3
|
+
*
|
|
4
|
+
* One family, two jobs: the interface face at 100% width, and the condensed
|
|
5
|
+
* face (`font-stretch: 85%`, the `font-condensed` utility) for table headers
|
|
6
|
+
* and narrow columns. Its default figures are tabular, so numbers align in
|
|
7
|
+
* columns without `tnum`. Latin is the common download; Latin Extended loads
|
|
8
|
+
* only when a page uses it. */
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: "IBM Plex Sans";
|
|
11
|
+
font-style: normal;
|
|
12
|
+
font-weight: 100 700;
|
|
13
|
+
font-stretch: 75% 100%;
|
|
14
|
+
font-display: swap;
|
|
15
|
+
src: url("IBMPlexSans-latin-normal.var.woff2?v=5.3.0") format("woff2");
|
|
16
|
+
unicode-range:
|
|
17
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
18
|
+
}
|
|
19
|
+
@font-face {
|
|
20
|
+
font-family: "IBM Plex Sans";
|
|
21
|
+
font-style: normal;
|
|
22
|
+
font-weight: 100 700;
|
|
23
|
+
font-stretch: 75% 100%;
|
|
24
|
+
font-display: swap;
|
|
25
|
+
src: url("IBMPlexSans-latin-ext-normal.var.woff2?v=5.3.0") format("woff2");
|
|
26
|
+
unicode-range:
|
|
27
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
28
|
+
}
|
|
29
|
+
@font-face {
|
|
30
|
+
font-family: "IBM Plex Sans";
|
|
31
|
+
font-style: italic;
|
|
32
|
+
font-weight: 100 700;
|
|
33
|
+
font-stretch: 75% 100%;
|
|
34
|
+
font-display: swap;
|
|
35
|
+
src: url("IBMPlexSans-latin-italic.var.woff2?v=5.3.0") format("woff2");
|
|
36
|
+
unicode-range:
|
|
37
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
38
|
+
}
|
|
39
|
+
@font-face {
|
|
40
|
+
font-family: "IBM Plex Sans";
|
|
41
|
+
font-style: italic;
|
|
42
|
+
font-weight: 100 700;
|
|
43
|
+
font-stretch: 75% 100%;
|
|
44
|
+
font-display: swap;
|
|
45
|
+
src: url("IBMPlexSans-latin-ext-italic.var.woff2?v=5.3.0") format("woff2");
|
|
46
|
+
unicode-range:
|
|
47
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
48
|
+
}
|