@grantcodes/ui 2.10.0 → 2.10.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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/components/accordion/accordion.component.js +3 -1
- package/src/components/accordion/accordion.css +47 -42
- package/src/components/accordion/accordion.react.js +4 -4
- package/src/components/app-bar/app-bar.component.js +15 -9
- package/src/components/app-bar/app-bar.css +256 -250
- package/src/components/app-bar/app-bar.react.js +4 -4
- package/src/components/app-bar/app-bar.test.js +1 -3
- package/src/components/app-bar/nav-link.component.js +3 -1
- package/src/components/app-bar/nav-link.css +50 -45
- package/src/components/app-bar/nav-link.react.js +4 -4
- package/src/components/avatar/avatar.css +19 -21
- package/src/components/avatar/avatar.react.js +4 -4
- package/src/components/badge/badge.css +51 -51
- package/src/components/badge/badge.react.js +4 -4
- package/src/components/breadcrumb/breadcrumb.component.js +3 -1
- package/src/components/breadcrumb/breadcrumb.css +73 -73
- package/src/components/breadcrumb/breadcrumb.react.js +8 -5
- package/src/components/button/button.component.js +3 -1
- package/src/components/button/button.css +38 -38
- package/src/components/button/button.react.js +4 -4
- package/src/components/button-group/button-group.css +33 -33
- package/src/components/button-group/button-group.react.js +4 -4
- package/src/components/card/card.css +150 -150
- package/src/components/card/card.react.js +4 -4
- package/src/components/code-preview/code-preview.css +11 -12
- package/src/components/code-preview/code-preview.react.js +4 -4
- package/src/components/container/container.css +37 -37
- package/src/components/container/container.react.js +4 -4
- package/src/components/countdown/countdown.component.js +5 -3
- package/src/components/countdown/countdown.stories.js +1 -2
- package/src/components/cta/cta.css +55 -55
- package/src/components/cta/cta.react.js +4 -4
- package/src/components/dialog/dialog.css +48 -49
- package/src/components/dialog/dialog.react.js +4 -4
- package/src/components/dropdown/dropdown.css +123 -121
- package/src/components/dropdown/dropdown.react.js +5 -5
- package/src/components/dropzone/dropzone.css +5 -3
- package/src/components/dropzone/dropzone.react.js +4 -4
- package/src/components/feature-list/feature-list.css +71 -71
- package/src/components/feature-list/feature-list.react.js +4 -4
- package/src/components/footer/footer-column.css +39 -39
- package/src/components/footer/footer.css +68 -69
- package/src/components/footer/footer.react.js +5 -5
- package/src/components/form-field/form-field.css +40 -40
- package/src/components/form-field/form-field.react.js +4 -4
- package/src/components/gallery/gallery-image.react.js +4 -4
- package/src/components/gallery/gallery.css +72 -72
- package/src/components/gallery/gallery.react.js +4 -4
- package/src/components/gallery/gallery.test.js +5 -1
- package/src/components/hero/hero.css +61 -57
- package/src/components/hero/hero.react.js +4 -4
- package/src/components/icon/icon.css +27 -27
- package/src/components/icon/icon.react.js +4 -4
- package/src/components/loading/loading.css +30 -31
- package/src/components/loading/loading.react.js +4 -4
- package/src/components/logo-cloud/logo-cloud.css +60 -60
- package/src/components/logo-cloud/logo-cloud.react.js +4 -4
- package/src/components/map/map.component.js +3 -4
- package/src/components/map/map.css +36 -36
- package/src/components/media-text/media-text.css +58 -58
- package/src/components/media-text/media-text.react.js +4 -4
- package/src/components/newsletter/newsletter.css +78 -78
- package/src/components/newsletter/newsletter.react.js +4 -4
- package/src/components/notice/notice.css +38 -38
- package/src/components/notice/notice.react.js +4 -4
- package/src/components/pagination/pagination.css +6 -7
- package/src/components/pagination/pagination.react.js +4 -4
- package/src/components/pricing/pricing.css +137 -137
- package/src/components/pricing/pricing.react.js +4 -4
- package/src/components/sidebar/sidebar.component.js +3 -1
- package/src/components/sidebar/sidebar.css +180 -180
- package/src/components/sidebar/sidebar.react.js +4 -4
- package/src/components/stats/stats.css +58 -58
- package/src/components/stats/stats.react.js +4 -4
- package/src/components/tabs/internal/tabs-button.component.js +3 -1
- package/src/components/tabs/internal/tabs-button.react.js +4 -4
- package/src/components/tabs/tab.component.js +3 -1
- package/src/components/tabs/tab.react.js +4 -4
- package/src/components/tabs/tabs.component.js +3 -1
- package/src/components/tabs/tabs.css +82 -82
- package/src/components/tabs/tabs.react.js +4 -4
- package/src/components/testimonials/testimonials.css +72 -72
- package/src/components/testimonials/testimonials.react.js +4 -4
- package/src/components/toast/toast.component.js +3 -1
- package/src/components/toast/toast.css +198 -198
- package/src/components/toast/toast.react.js +5 -5
- package/src/components/tooltip/tooltip.css +52 -51
- package/src/components/tooltip/tooltip.react.js +4 -4
- package/src/css/reset.css +102 -102
- package/src/css/typography.css +13 -11
- package/src/exports.test.js +101 -95
- package/src/lib/styles/all.css +37 -37
- package/src/lib/styles/focus-ring.css +20 -20
- package/src/react.js +45 -39
- package/vite-plugin-css-import-attributes.js +5 -2
package/src/css/reset.css
CHANGED
|
@@ -5,256 +5,256 @@
|
|
|
5
5
|
*,
|
|
6
6
|
::before,
|
|
7
7
|
::after {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
background-repeat: no-repeat;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
::before,
|
|
13
13
|
::after {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
text-decoration: inherit;
|
|
15
|
+
vertical-align: inherit;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/* Root defaults */
|
|
19
19
|
:where(:root) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
font: var(--g-typography-body-font);
|
|
21
|
+
cursor: default;
|
|
22
|
+
line-height: 1.5;
|
|
23
|
+
overflow-wrap: break-word;
|
|
24
|
+
scrollbar-gutter: stable;
|
|
25
|
+
-moz-tab-size: 4;
|
|
26
|
+
tab-size: 4;
|
|
27
|
+
-webkit-tap-highlight-color: transparent;
|
|
28
|
+
-webkit-text-size-adjust: 100%;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
:where(:root, body) {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
padding: 0;
|
|
33
|
+
margin: 0;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
:where(body) {
|
|
37
|
-
|
|
37
|
+
min-block-size: 100svh;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
code,
|
|
41
41
|
kbd,
|
|
42
42
|
samp,
|
|
43
43
|
pre {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
font-family:
|
|
45
|
+
ui-monospace,
|
|
46
|
+
"Menlo",
|
|
47
|
+
"Consolas",
|
|
48
|
+
"Roboto Mono",
|
|
49
|
+
"Ubuntu Monospace",
|
|
50
|
+
"Noto Mono",
|
|
51
|
+
"Oxygen Mono",
|
|
52
|
+
"Liberation Mono",
|
|
53
|
+
monospace,
|
|
54
|
+
"Apple Color Emoji",
|
|
55
|
+
"Segoe UI Emoji",
|
|
56
|
+
"Segoe UI Symbol",
|
|
57
|
+
"Noto Color Emoji";
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/* Grouping */
|
|
61
61
|
:where(dl, ol, ul) :where(dl, ol, ul) {
|
|
62
|
-
|
|
62
|
+
margin: 0;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
:where(hr) {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
color: inherit;
|
|
67
|
+
height: 0;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
:where(nav) :where(ol, ul) {
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
list-style-type: none;
|
|
72
|
+
padding: 0;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/* Prevent VoiceOver from ignoring list semantics in Safari */
|
|
76
76
|
:where(nav li)::before {
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
content: "\200B";
|
|
78
|
+
float: left;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
:where(pre) {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
font-size: 1em;
|
|
83
|
+
overflow: auto;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/* Text-level semantics */
|
|
87
87
|
:where(abbr[title]) {
|
|
88
|
-
|
|
88
|
+
text-decoration: underline dotted;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
:where(b, strong) {
|
|
92
|
-
|
|
92
|
+
font-weight: bolder;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
:where(code, kbd, samp) {
|
|
96
|
-
|
|
96
|
+
font-size: 1em;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
:where(small) {
|
|
100
|
-
|
|
100
|
+
font-size: 80%;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
/* Embedded content */
|
|
104
104
|
:where(audio, canvas, iframe, img, svg, video) {
|
|
105
|
-
|
|
105
|
+
vertical-align: middle;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
:where(iframe) {
|
|
109
|
-
|
|
109
|
+
border-style: none;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
:where(svg:not([fill])) {
|
|
113
|
-
|
|
113
|
+
fill: currentColor;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/* Tabular data */
|
|
117
117
|
:where(table) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
border-collapse: collapse;
|
|
119
|
+
border-color: inherit;
|
|
120
|
+
text-indent: 0;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/* Forms — baseline normalisation */
|
|
124
124
|
:where(button, input, select) {
|
|
125
|
-
|
|
125
|
+
margin: 0;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
:where(button, [type="button" i], [type="reset" i], [type="submit" i]) {
|
|
129
|
-
|
|
129
|
+
-webkit-appearance: button;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
:where(fieldset) {
|
|
133
|
-
|
|
133
|
+
border: 1px solid #a0a0a0;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
:where(progress) {
|
|
137
|
-
|
|
137
|
+
vertical-align: baseline;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
:where(textarea) {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
margin: 0;
|
|
142
|
+
resize: vertical;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
:where([type="search" i]) {
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
-webkit-appearance: textfield;
|
|
147
|
+
outline-offset: -2px;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
::-webkit-inner-spin-button,
|
|
151
151
|
::-webkit-outer-spin-button {
|
|
152
|
-
|
|
152
|
+
height: auto;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
::-webkit-input-placeholder {
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
color: inherit;
|
|
157
|
+
opacity: 0.54;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
::-webkit-search-decoration {
|
|
161
|
-
|
|
161
|
+
-webkit-appearance: none;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
::-webkit-file-upload-button {
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
-webkit-appearance: button;
|
|
166
|
+
font: inherit;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
/* Forms — typography and colour inheritance */
|
|
170
170
|
:where(button, input, select, textarea) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
background-color: transparent;
|
|
172
|
+
border: 1px solid WindowFrame;
|
|
173
|
+
color: inherit;
|
|
174
|
+
font: inherit;
|
|
175
|
+
letter-spacing: inherit;
|
|
176
|
+
padding: 0.25em 0.375em;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
:where([type="color" i], [type="range" i]) {
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
border-width: 0;
|
|
181
|
+
padding: 0;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/* Interactive */
|
|
185
185
|
:where(details > summary:first-of-type) {
|
|
186
|
-
|
|
186
|
+
display: list-item;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
/* Accessibility */
|
|
190
190
|
:where([aria-busy="true" i]) {
|
|
191
|
-
|
|
191
|
+
cursor: progress;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
:where([aria-controls]) {
|
|
195
|
-
|
|
195
|
+
cursor: pointer;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
:where([aria-disabled="true" i], [disabled]) {
|
|
199
|
-
|
|
199
|
+
cursor: not-allowed;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
:where([aria-hidden="false" i][hidden]) {
|
|
203
|
-
|
|
203
|
+
display: initial;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
:where([aria-hidden="false" i][hidden]:not(:focus)) {
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
clip: rect(0, 0, 0, 0);
|
|
208
|
+
position: absolute;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
/* Reduced motion — !important is required here to override any animation/transition regardless of specificity */
|
|
212
212
|
@media (prefers-reduced-motion: reduce) {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
213
|
+
*,
|
|
214
|
+
::before,
|
|
215
|
+
::after {
|
|
216
|
+
animation-delay: -1ms !important;
|
|
217
|
+
animation-duration: 1ms !important;
|
|
218
|
+
animation-iteration-count: 1 !important;
|
|
219
|
+
background-attachment: initial !important;
|
|
220
|
+
scroll-behavior: auto !important;
|
|
221
|
+
transition-delay: 0s !important;
|
|
222
|
+
transition-duration: 0s !important;
|
|
223
|
+
}
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
/* Design tokens are provided by @grantcodes/style-dictionary and applied to :root */
|
|
227
227
|
:root {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
color-scheme: light dark;
|
|
229
|
+
--grantcodes-ui-theme: "none";
|
|
230
|
+
background-color: var(--g-theme-color-background-default);
|
|
231
|
+
color: var(--g-theme-color-content-default);
|
|
232
|
+
fill: currentColor;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
/* Force dark mode on any element or subtree */
|
|
236
236
|
.dark {
|
|
237
|
-
|
|
237
|
+
color-scheme: dark;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
/* Force light mode on any element or subtree */
|
|
241
241
|
.light {
|
|
242
|
-
|
|
242
|
+
color-scheme: light;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
/* Allow transitioning auto */
|
|
246
246
|
:root {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
@supports (interpolate-size: allow-keywords) {
|
|
248
|
+
interpolate-size: allow-keywords;
|
|
249
|
+
}
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
::selection {
|
|
253
|
-
|
|
253
|
+
background-color: var(--g-theme-color-background-primary);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
/* Default backdrop styles */
|
|
257
257
|
::backdrop {
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
259
|
+
backdrop-filter: blur(6px);
|
|
260
260
|
}
|
package/src/css/typography.css
CHANGED
|
@@ -4,21 +4,23 @@
|
|
|
4
4
|
}
|
|
5
5
|
@media (min-width: 40em) {
|
|
6
6
|
:root {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/* TODO: Would like to get rid of important */
|
|
8
|
+
--g-typography-font-scale-default: var(
|
|
9
|
+
--g-typography-font-scale-lg
|
|
10
|
+
) !important;
|
|
11
|
+
}
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
:where(h1,h1,h3,h4,h5,h6,p) {
|
|
13
|
-
|
|
14
|
+
:where(h1, h1, h3, h4, h5, h6, p) {
|
|
15
|
+
margin-block-end: 1rem;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
:where(h1,h1,h3,h4,h5,h6,p):first-child {
|
|
17
|
-
|
|
18
|
+
:where(h1, h1, h3, h4, h5, h6, p):first-child {
|
|
19
|
+
margin-block-start: 0;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
:where(h1,h1,h3,h4,h5,h6,p):last-child {
|
|
21
|
-
|
|
22
|
+
:where(h1, h1, h3, h4, h5, h6, p):last-child {
|
|
23
|
+
margin-block-end: 0;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
h1,
|
|
@@ -56,11 +58,11 @@ h6 {
|
|
|
56
58
|
|
|
57
59
|
p {
|
|
58
60
|
text-wrap: pretty;
|
|
59
|
-
margin: 0
|
|
61
|
+
margin: 0;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
p + p {
|
|
63
|
-
|
|
65
|
+
margin-block-start: 1rem;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
pre {
|
package/src/exports.test.js
CHANGED
|
@@ -1,119 +1,125 @@
|
|
|
1
|
-
import { describe, it } from
|
|
2
|
-
import assert from
|
|
3
|
-
import fs from
|
|
4
|
-
import path from
|
|
5
|
-
import { fileURLToPath } from
|
|
1
|
+
import { describe, it } from "node:test";
|
|
2
|
+
import assert from "node:assert";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
6
|
|
|
7
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
8
|
-
const pkgPath = path.resolve(__dirname,
|
|
9
|
-
const pkgRoot = path.dirname(pkgPath)
|
|
10
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath,
|
|
11
|
-
const exports = pkg.exports
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const pkgPath = path.resolve(__dirname, "..", "package.json");
|
|
9
|
+
const pkgRoot = path.dirname(pkgPath);
|
|
10
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
11
|
+
const exports = pkg.exports;
|
|
12
12
|
|
|
13
13
|
// All 34 component CSS files expected to exist on disk
|
|
14
14
|
// These are resolved via the ./components/* wildcard export
|
|
15
15
|
const expectedComponentCss = [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]
|
|
16
|
+
"accordion/accordion.css",
|
|
17
|
+
"app-bar/app-bar.css",
|
|
18
|
+
"avatar/avatar.css",
|
|
19
|
+
"badge/badge.css",
|
|
20
|
+
"breadcrumb/breadcrumb.css",
|
|
21
|
+
"button/button.css",
|
|
22
|
+
"button-group/button-group.css",
|
|
23
|
+
"card/card.css",
|
|
24
|
+
"code-preview/code-preview.css",
|
|
25
|
+
"container/container.css",
|
|
26
|
+
"cta/cta.css",
|
|
27
|
+
"dialog/dialog.css",
|
|
28
|
+
"dropdown/dropdown.css",
|
|
29
|
+
"dropzone/dropzone.css",
|
|
30
|
+
"feature-list/feature-list.css",
|
|
31
|
+
"footer/footer.css",
|
|
32
|
+
"footer/footer-column.css",
|
|
33
|
+
"form-field/form-field.css",
|
|
34
|
+
"gallery/gallery.css",
|
|
35
|
+
"hero/hero.css",
|
|
36
|
+
"icon/icon.css",
|
|
37
|
+
"loading/loading.css",
|
|
38
|
+
"logo-cloud/logo-cloud.css",
|
|
39
|
+
"media-text/media-text.css",
|
|
40
|
+
"newsletter/newsletter.css",
|
|
41
|
+
"notice/notice.css",
|
|
42
|
+
"pagination/pagination.css",
|
|
43
|
+
"pricing/pricing.css",
|
|
44
|
+
"sidebar/sidebar.css",
|
|
45
|
+
"stats/stats.css",
|
|
46
|
+
"tabs/tabs.css",
|
|
47
|
+
"testimonials/testimonials.css",
|
|
48
|
+
"toast/toast.css",
|
|
49
|
+
"tooltip/tooltip.css",
|
|
50
|
+
];
|
|
51
51
|
|
|
52
|
-
describe(
|
|
53
|
-
describe(
|
|
52
|
+
describe("package.json exports", () => {
|
|
53
|
+
describe("component CSS files exist (resolved via ./components/* wildcard)", () => {
|
|
54
54
|
for (const cssFile of expectedComponentCss) {
|
|
55
55
|
it(`src/components/${cssFile} exists on disk`, () => {
|
|
56
|
-
const fullPath = path.resolve(pkgRoot,
|
|
56
|
+
const fullPath = path.resolve(pkgRoot, "src", "components", cssFile);
|
|
57
57
|
assert.ok(
|
|
58
58
|
fs.existsSync(fullPath),
|
|
59
59
|
`CSS file does not exist: ${fullPath}`,
|
|
60
|
-
)
|
|
61
|
-
})
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
it(
|
|
64
|
+
it("has ./components/* wildcard export that covers CSS files", () => {
|
|
65
65
|
assert.ok(
|
|
66
|
-
exports[
|
|
67
|
-
|
|
68
|
-
)
|
|
69
|
-
})
|
|
70
|
-
})
|
|
66
|
+
exports["./components/*"],
|
|
67
|
+
"Missing ./components/* wildcard export",
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
71
|
|
|
72
|
-
describe(
|
|
73
|
-
it(
|
|
72
|
+
describe("focus-ring shared styles export", () => {
|
|
73
|
+
it("has export for ./styles/focus-ring.css", () => {
|
|
74
74
|
assert.ok(
|
|
75
|
-
exports[
|
|
76
|
-
|
|
77
|
-
)
|
|
78
|
-
})
|
|
75
|
+
exports["./styles/focus-ring.css"] !== undefined,
|
|
76
|
+
"Missing export for ./styles/focus-ring.css",
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
79
|
|
|
80
|
-
it(
|
|
81
|
-
const exportValue = exports[
|
|
80
|
+
it("./styles/focus-ring.css points to an existing file", () => {
|
|
81
|
+
const exportValue = exports["./styles/focus-ring.css"];
|
|
82
82
|
const filePath =
|
|
83
|
-
typeof exportValue ===
|
|
84
|
-
assert.ok(filePath,
|
|
85
|
-
const fullPath = path.resolve(pkgRoot, filePath)
|
|
86
|
-
assert.ok(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
)
|
|
90
|
-
})
|
|
91
|
-
})
|
|
83
|
+
typeof exportValue === "string" ? exportValue : exportValue?.import;
|
|
84
|
+
assert.ok(filePath, "No file path found for ./styles/focus-ring.css");
|
|
85
|
+
const fullPath = path.resolve(pkgRoot, filePath);
|
|
86
|
+
assert.ok(fs.existsSync(fullPath), `File does not exist: ${fullPath}`);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
92
89
|
|
|
93
|
-
describe(
|
|
94
|
-
it(
|
|
95
|
-
assert.ok(exports[
|
|
96
|
-
assert.ok(exports[
|
|
97
|
-
})
|
|
90
|
+
describe("existing exports preserved", () => {
|
|
91
|
+
it("has root export (.)", () => {
|
|
92
|
+
assert.ok(exports["."], "Missing root export");
|
|
93
|
+
assert.ok(exports["."].import, "Missing root import");
|
|
94
|
+
});
|
|
98
95
|
|
|
99
|
-
it(
|
|
100
|
-
assert.ok(exports[
|
|
101
|
-
})
|
|
96
|
+
it("has ./icons export", () => {
|
|
97
|
+
assert.ok(exports["./icons"], "Missing ./icons export");
|
|
98
|
+
});
|
|
102
99
|
|
|
103
|
-
it(
|
|
104
|
-
assert.ok(
|
|
105
|
-
|
|
100
|
+
it("has ./styles/base.css export", () => {
|
|
101
|
+
assert.ok(
|
|
102
|
+
exports["./styles/base.css"],
|
|
103
|
+
"Missing ./styles/base.css export",
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
106
|
|
|
107
|
-
it(
|
|
108
|
-
assert.ok(
|
|
109
|
-
|
|
107
|
+
it("has ./styles/themes/* export", () => {
|
|
108
|
+
assert.ok(
|
|
109
|
+
exports["./styles/themes/*"],
|
|
110
|
+
"Missing ./styles/themes/* export",
|
|
111
|
+
);
|
|
112
|
+
});
|
|
110
113
|
|
|
111
|
-
it(
|
|
112
|
-
assert.ok(
|
|
113
|
-
|
|
114
|
+
it("has ./components/* wildcard export", () => {
|
|
115
|
+
assert.ok(
|
|
116
|
+
exports["./components/*"],
|
|
117
|
+
"Missing ./components/* wildcard export",
|
|
118
|
+
);
|
|
119
|
+
});
|
|
114
120
|
|
|
115
|
-
it(
|
|
116
|
-
assert.ok(exports[
|
|
117
|
-
})
|
|
118
|
-
})
|
|
119
|
-
})
|
|
121
|
+
it("has ./fonts/* export", () => {
|
|
122
|
+
assert.ok(exports["./fonts/*"], "Missing ./fonts/* export");
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
});
|