@oscarpalmer/oui 0.17.0 → 0.18.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/dist/css/badge.css +3 -3
- package/dist/css/content.css +9 -11
- package/dist/css/form.css +36 -22
- package/dist/css/message.css +4 -0
- package/dist/css/reset.css +176 -56
- package/dist/css/tooltip.css +8 -0
- package/dist/js/attributable.full.js +48 -0
- package/dist/js/attributable.js +30 -45
- package/dist/js/floatable.full.js +413 -0
- package/dist/js/floatable.js +254 -169
- package/dist/js/focus-trap/embedded.full.js +351 -0
- package/dist/js/focus-trap/embedded.js +131 -131
- package/dist/js/focus-trap/standalone.full.js +402 -0
- package/dist/js/focus-trap/standalone.js +4 -4
- package/dist/js/index.js +4 -5
- package/dist/js/oui.full.js +1596 -0
- package/dist/js/popover.full.js +822 -0
- package/dist/js/popover.js +83 -162
- package/dist/js/splitter.full.js +605 -0
- package/dist/js/splitter.js +263 -245
- package/dist/js/tooltip.full.js +679 -0
- package/dist/js/tooltip.js +159 -150
- package/package.json +31 -59
- package/src/css/content.scss +1 -2
- package/src/css/form.scss +12 -4
- package/src/css/message.scss +3 -0
- package/src/css/mixins.scss +7 -0
- package/src/css/reset.scss +180 -54
- package/src/css/tooltip.scss +8 -0
- package/src/js/floatable.ts +380 -133
- package/src/js/focus-trap/embedded.ts +149 -64
- package/src/js/focus-trap/standalone.ts +4 -4
- package/src/js/index.ts +1 -0
- package/src/js/popover.ts +50 -120
- package/src/js/splitter.ts +250 -103
- package/src/js/tooltip.ts +155 -68
- package/types/floatable.d.ts +17 -10
- package/types/focus-trap/embedded.d.ts +18 -5
- package/types/index.d.ts +1 -0
- package/types/popover.d.ts +2 -0
- package/types/splitter.d.ts +13 -1
- package/types/tooltip.d.ts +2 -1
- package/dist/js/attributable.cjs +0 -51
- package/dist/js/floatable.cjs +0 -176
- package/dist/js/focus-trap/embedded.cjs +0 -150
- package/dist/js/focus-trap/standalone.cjs +0 -8
- package/dist/js/index.cjs +0 -6
- package/dist/js/popover.cjs +0 -166
- package/dist/js/splitter.cjs +0 -272
- package/dist/js/tooltip.cjs +0 -166
- package/types/attributable.d.cts +0 -5
- package/types/floatable.d.cts +0 -20
- package/types/focus-trap/embedded.d.cts +0 -15
- package/types/focus-trap/standalone.d.cts +0 -3
- package/types/index.d.cts +0 -14
- package/types/popover.d.cts +0 -14
- package/types/splitter.d.cts +0 -10
- package/types/tooltip.d.cts +0 -3
package/src/css/reset.scss
CHANGED
|
@@ -12,9 +12,15 @@
|
|
|
12
12
|
* - Andy Bell's "A (more) Modern CSS Reset" [AB]
|
|
13
13
|
* https://andy-bell.co.uk/a-more-modern-css-reset/
|
|
14
14
|
*
|
|
15
|
+
* - Chris Coyier's "The Coyier CSS Starter" [CC]
|
|
16
|
+
* https://frontendmasters.com/blog/the-coyier-css-starter/
|
|
17
|
+
*
|
|
15
18
|
* - CSS Remedy [CR]
|
|
16
19
|
* https://github.com/jensimmons/cssremedy
|
|
17
20
|
*
|
|
21
|
+
* - Harry Roberts [HR]
|
|
22
|
+
* - https://github.com/csswizardry
|
|
23
|
+
*
|
|
18
24
|
* - RESS [RS]
|
|
19
25
|
* https://github.com/filipelinhares/ress
|
|
20
26
|
*
|
|
@@ -45,8 +51,10 @@
|
|
|
45
51
|
font-family: system-ui, sans-serif;
|
|
46
52
|
font-size: 100%;
|
|
47
53
|
line-height: 1.5;
|
|
48
|
-
|
|
54
|
+
/** Prevent text size inflation (e.g., after orientation change) [AB][RE][SE] */
|
|
55
|
+
text-size-adjust: none;
|
|
49
56
|
tab-size: 4;
|
|
57
|
+
word-break: break-word;
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
:where(body) {
|
|
@@ -63,47 +71,84 @@
|
|
|
63
71
|
text-underline-offset: 0.125em;
|
|
64
72
|
}
|
|
65
73
|
|
|
74
|
+
:where(abbr[title], dfn[title]) {
|
|
75
|
+
cursor: help;
|
|
76
|
+
}
|
|
77
|
+
|
|
66
78
|
:where(abbr[title]) {
|
|
67
|
-
|
|
68
|
-
text-decoration: underline
|
|
79
|
+
/** Add the correct text decoration in Safari [RS][SE] */
|
|
80
|
+
text-decoration: underline;
|
|
81
|
+
/** Ditto */
|
|
82
|
+
text-decoration: underline dotted;
|
|
69
83
|
}
|
|
70
84
|
|
|
71
85
|
:where(b, strong) {
|
|
72
|
-
|
|
86
|
+
/** Add the correct font weight in Chrome, Edge, and Safari [RS][SE], without compounding [HR] */
|
|
87
|
+
font-weight: bold;
|
|
73
88
|
}
|
|
74
89
|
|
|
75
90
|
:where(button, h1, h2, h3, h4, h5, h6, input, label, legend) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
/** Set shorter line heights on headings and interactive elements [AB] */
|
|
92
|
+
line-height: 1.125;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:where(
|
|
96
|
+
button,
|
|
97
|
+
input[type='button' i],
|
|
98
|
+
input[type='checkbox' i],
|
|
99
|
+
input[type='file' i],
|
|
100
|
+
input[type='image' i],
|
|
101
|
+
input[type='radio' i],
|
|
102
|
+
input[type='reset' i],
|
|
103
|
+
input[type='submit' i],
|
|
104
|
+
summary
|
|
105
|
+
) {
|
|
106
|
+
/** Correct the inability to style clickable types in iOS [HR][RS][SE] */
|
|
107
|
+
appearance: button;
|
|
108
|
+
/** Ditto */
|
|
81
109
|
cursor: pointer;
|
|
82
110
|
}
|
|
83
111
|
|
|
84
|
-
:where(code, kbd, pre, samp) {
|
|
85
|
-
|
|
86
|
-
font-
|
|
112
|
+
:where(code, kbd, output, pre, samp) {
|
|
113
|
+
/** Specify the font family of code elements [HR][RS][SE] */
|
|
114
|
+
font-family: monospace, monospace;
|
|
115
|
+
/** Correct the odd 'em' font sizing in all browsers [HR][RS][SE] */
|
|
116
|
+
font-size: inherit;
|
|
87
117
|
}
|
|
88
118
|
|
|
89
119
|
:where(details > summary:first-of-type) {
|
|
90
|
-
|
|
120
|
+
/** Add the correct display in Safari [SE] */
|
|
121
|
+
display: list-item;
|
|
91
122
|
}
|
|
92
123
|
|
|
93
124
|
:where(dl, ol, ul) :where(dl, ol, ul) {
|
|
94
|
-
|
|
125
|
+
/** Remove the margin on nested lists in Chrome, Edge, and Safari [SE] */
|
|
126
|
+
margin: 0;
|
|
95
127
|
}
|
|
96
128
|
|
|
97
129
|
:where(h1, h2, h3, h4, h5, h6) {
|
|
98
130
|
text-wrap: balance;
|
|
99
131
|
}
|
|
100
132
|
|
|
133
|
+
:where(h1) {
|
|
134
|
+
/** Consistent sizing across browsers [HR] */
|
|
135
|
+
font-size: 2em;
|
|
136
|
+
}
|
|
137
|
+
|
|
101
138
|
:where(hr) {
|
|
102
|
-
|
|
103
|
-
|
|
139
|
+
/** Add the correct box sizing in Firefox [CR][RS][SE] */
|
|
140
|
+
height: 0;
|
|
141
|
+
/** Show the overflow in Edge and IE [CR][RS] */
|
|
142
|
+
overflow: visible;
|
|
104
143
|
border-style: solid;
|
|
105
144
|
border-width: 1px 0 0;
|
|
106
|
-
|
|
145
|
+
/** // Correct the inheritance of border colour in Firefox [CR][RS][SE] */
|
|
146
|
+
color: inherit;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:where(ins, u) {
|
|
150
|
+
/** Prevent link styling [HR] */
|
|
151
|
+
text-decoration: none;
|
|
107
152
|
}
|
|
108
153
|
|
|
109
154
|
:where(nav) :where(ol, ul),
|
|
@@ -113,22 +158,24 @@
|
|
|
113
158
|
}
|
|
114
159
|
|
|
115
160
|
:where(nav li)::before {
|
|
116
|
-
|
|
161
|
+
/** Prevent VoiceOver from ignoring list semantics in Safari [SE] */
|
|
162
|
+
content: '\200B';
|
|
117
163
|
float: left;
|
|
118
164
|
}
|
|
119
165
|
|
|
120
166
|
:where(pre) {
|
|
121
|
-
|
|
122
|
-
|
|
167
|
+
/** Prevent overflow of the container in all browsers [SE] */
|
|
168
|
+
overflow: auto;
|
|
169
|
+
/** Overflow by default is bad… [CR] */
|
|
170
|
+
white-space: pre-wrap;
|
|
123
171
|
}
|
|
124
172
|
|
|
125
|
-
:where(small) {
|
|
173
|
+
:where(small, sub, sup) {
|
|
126
174
|
font-size: 0.875rem;
|
|
127
175
|
}
|
|
128
176
|
|
|
129
177
|
:where(sub, sup) {
|
|
130
178
|
vertical-align: baseline;
|
|
131
|
-
font-size: 0.75rem;
|
|
132
179
|
line-height: 0;
|
|
133
180
|
position: relative;
|
|
134
181
|
}
|
|
@@ -143,8 +190,14 @@
|
|
|
143
190
|
|
|
144
191
|
:where(table) {
|
|
145
192
|
border-collapse: collapse;
|
|
146
|
-
|
|
147
|
-
|
|
193
|
+
/** Correct table border colour in Chrome, Edge, and Safari [SE] */
|
|
194
|
+
border-color: currentColor;
|
|
195
|
+
/** Modernized border spacing [HR] */
|
|
196
|
+
border-spacing: 0;
|
|
197
|
+
/** More legible numbers [HR] */
|
|
198
|
+
font-variant-numeric: tabular-nums;
|
|
199
|
+
/** Remove text indentation from table contents in Chrome, Edge, and Safari [RS][SE] */
|
|
200
|
+
text-indent: 0;
|
|
148
201
|
}
|
|
149
202
|
|
|
150
203
|
/**
|
|
@@ -152,75 +205,94 @@
|
|
|
152
205
|
*/
|
|
153
206
|
|
|
154
207
|
:where(button, input, optgroup, select, textarea) {
|
|
155
|
-
|
|
208
|
+
/** Correct the font inheritance in Firefox, Edge, and Safari [HR][RS][SE] */
|
|
209
|
+
font: inherit;
|
|
156
210
|
}
|
|
157
211
|
|
|
158
212
|
:where(button, input, select, textarea) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
color:
|
|
163
|
-
|
|
213
|
+
/** Change the inconsistent appearance in all browsers [SE] */
|
|
214
|
+
padding: 0.25em 0.5em;
|
|
215
|
+
/** Ditto for all */
|
|
216
|
+
background-color: transparent;
|
|
217
|
+
border: 1px solid WindowFrame;
|
|
218
|
+
color: inherit;
|
|
219
|
+
letter-spacing: inherit;
|
|
164
220
|
}
|
|
165
221
|
|
|
166
222
|
:where(fieldset) {
|
|
167
|
-
|
|
223
|
+
/** Change the inconsistent appearance in all browsers [SE] */
|
|
224
|
+
border: 1px solid darkgrey;
|
|
168
225
|
}
|
|
169
226
|
|
|
170
227
|
:where(optgroup) {
|
|
171
|
-
|
|
228
|
+
/** Restore the font weight unset by previous rules [RS] */
|
|
229
|
+
font-weight: bold;
|
|
172
230
|
}
|
|
173
231
|
|
|
174
232
|
:where(progress) {
|
|
175
|
-
|
|
233
|
+
/** Add the correct vertical alignment in Chrome, Edge, and Firefox [RS][SE] */
|
|
234
|
+
vertical-align: baseline;
|
|
176
235
|
}
|
|
177
236
|
|
|
178
237
|
:where(select, input[list]) {
|
|
179
|
-
|
|
180
|
-
|
|
238
|
+
/** Change the inconsistent appearance in all browsers [SE] */
|
|
239
|
+
appearance: none;
|
|
240
|
+
/** Ditto for all */
|
|
241
|
+
padding-right: 1em;
|
|
181
242
|
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E");
|
|
182
|
-
background-position: right center / 1em;
|
|
183
|
-
background-repeat: no-repeat;
|
|
184
|
-
border-radius: 0;
|
|
243
|
+
background-position: right center / 1em;
|
|
244
|
+
background-repeat: no-repeat;
|
|
245
|
+
border-radius: 0;
|
|
185
246
|
}
|
|
186
247
|
|
|
187
248
|
:where(select[multiple]) {
|
|
188
|
-
|
|
249
|
+
/** Don't show the arrow for multiple choice selects [SE] */
|
|
250
|
+
background-image: none;
|
|
189
251
|
}
|
|
190
252
|
|
|
191
253
|
:where(textarea) {
|
|
192
|
-
|
|
254
|
+
/** Change the resize direction in all browsers [RS][SE] */
|
|
255
|
+
resize: vertical;
|
|
193
256
|
}
|
|
194
257
|
|
|
195
258
|
:where([type='color' i], [type='range' i]) {
|
|
196
|
-
|
|
197
|
-
|
|
259
|
+
/** Remove the padding in all browsers [SE] */
|
|
260
|
+
padding: 0;
|
|
261
|
+
/** Remove the border in all browsers [SE] */
|
|
262
|
+
border-width: 0;
|
|
198
263
|
}
|
|
199
264
|
|
|
200
265
|
:where([type='search' i]) {
|
|
201
|
-
|
|
202
|
-
|
|
266
|
+
/** Correct the odd appearance in Chrome, Edge, and Safari [RS][SE] */
|
|
267
|
+
appearance: textfield;
|
|
268
|
+
/** Correct the outline style in Safari [RS][SE] */
|
|
269
|
+
outline-offset: -2px;
|
|
203
270
|
}
|
|
204
271
|
|
|
205
272
|
::file-selector-button {
|
|
206
|
-
|
|
273
|
+
/** Correct the inability to style upload buttons in iOS and Safari [RS][SE] */
|
|
274
|
+
appearance: button;
|
|
207
275
|
color: inherit;
|
|
208
276
|
font: inherit;
|
|
209
277
|
line-height: 1.25;
|
|
210
278
|
}
|
|
211
279
|
|
|
212
280
|
::placeholder {
|
|
213
|
-
|
|
214
|
-
|
|
281
|
+
/** Better default text opacity [OP] */
|
|
282
|
+
opacity: 0.67;
|
|
283
|
+
/** Better default text color [HR][SE] */
|
|
284
|
+
color: inherit;
|
|
215
285
|
}
|
|
216
286
|
|
|
217
287
|
::-webkit-inner-spin-button,
|
|
218
288
|
::-webkit-outer-spin-button {
|
|
219
|
-
|
|
289
|
+
/** Correct the cursor style of increment and decrement buttons in Safari [RS][SE] */
|
|
290
|
+
height: auto;
|
|
220
291
|
}
|
|
221
292
|
|
|
222
293
|
::-webkit-search-decoration {
|
|
223
|
-
|
|
294
|
+
/** Remove the inner padding in Chrome, Edge, and Safari on macOS [SE] */
|
|
295
|
+
-webkit-appearance: none;
|
|
224
296
|
}
|
|
225
297
|
|
|
226
298
|
/**
|
|
@@ -228,7 +300,7 @@
|
|
|
228
300
|
*/
|
|
229
301
|
|
|
230
302
|
:where(audio, canvas, embed, iframe, img, object, picture, svg, video) {
|
|
231
|
-
max-
|
|
303
|
+
max-inline-size: 100%;
|
|
232
304
|
vertical-align: middle;
|
|
233
305
|
}
|
|
234
306
|
|
|
@@ -237,7 +309,8 @@
|
|
|
237
309
|
}
|
|
238
310
|
|
|
239
311
|
:where(audio) {
|
|
240
|
-
|
|
312
|
+
/** Better default width [CR] */
|
|
313
|
+
width: 100%;
|
|
241
314
|
}
|
|
242
315
|
|
|
243
316
|
:where(audio:not([controls])) {
|
|
@@ -245,19 +318,31 @@
|
|
|
245
318
|
}
|
|
246
319
|
|
|
247
320
|
:where(canvas, img, svg, video) {
|
|
248
|
-
|
|
321
|
+
/** Proportional height based on width [HR] */
|
|
322
|
+
block-size: auto;
|
|
249
323
|
}
|
|
250
324
|
|
|
251
325
|
:where(iframe) {
|
|
252
326
|
border-style: none;
|
|
253
327
|
}
|
|
254
328
|
|
|
329
|
+
:where(img) {
|
|
330
|
+
/** CSS magic! [HR] */
|
|
331
|
+
background-repeat: no-repeat;
|
|
332
|
+
/** Ditto */
|
|
333
|
+
background-size: cover;
|
|
334
|
+
/** Offset alt-text if image does not load [HR] */
|
|
335
|
+
font-style: italic;
|
|
336
|
+
}
|
|
337
|
+
|
|
255
338
|
:where(picture) {
|
|
256
|
-
|
|
339
|
+
/** Remove the unnecessary wrapping 'picture', while maintaining contents [CR] */
|
|
340
|
+
display: contents;
|
|
257
341
|
}
|
|
258
342
|
|
|
259
343
|
:where(source) {
|
|
260
|
-
|
|
344
|
+
/** Source elements have nothing to display, so we hide them entirely [CR] */
|
|
345
|
+
display: none;
|
|
261
346
|
}
|
|
262
347
|
|
|
263
348
|
:where(svg:not([fill])) {
|
|
@@ -283,3 +368,44 @@
|
|
|
283
368
|
:where([aria-controls]) {
|
|
284
369
|
cursor: pointer;
|
|
285
370
|
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Pseudo-classes
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
:where(:target) {
|
|
377
|
+
scroll-margin: 2rlh;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Media queries
|
|
382
|
+
*/
|
|
383
|
+
|
|
384
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
385
|
+
:where(:root) {
|
|
386
|
+
/** Allow for animations on auto-sizes [CC] */
|
|
387
|
+
interpolate-size: allow-keywords;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
:where(:root:focus-within) {
|
|
391
|
+
/** Allow for smooth scrolling to focused elements */
|
|
392
|
+
scroll-behavior: smooth;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
@media (prefers-reduced-motion: reduce) {
|
|
397
|
+
:where(:root:focus-within) {
|
|
398
|
+
/** Disable smooth scrolling, when requested */
|
|
399
|
+
scroll-behavior: auto;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/** Disable animations and transitions, when requested */
|
|
403
|
+
:where(*),
|
|
404
|
+
::after,
|
|
405
|
+
::before {
|
|
406
|
+
animation-duration: 0.01ms !important;
|
|
407
|
+
animation-iteration-count: 1 !important;
|
|
408
|
+
transition-duration: 0.01ms !important;
|
|
409
|
+
scroll-behavior: auto !important;
|
|
410
|
+
}
|
|
411
|
+
}
|
package/src/css/tooltip.scss
CHANGED
|
@@ -12,7 +12,15 @@
|
|
|
12
12
|
|
|
13
13
|
max-width: 48ch;
|
|
14
14
|
padding: 0.75em 1em;
|
|
15
|
+
opacity: 0;
|
|
15
16
|
background-color: var(--oui-absolute);
|
|
16
17
|
border-radius: 0.25rem;
|
|
17
18
|
font-size: 0.875rem;
|
|
19
|
+
transition: opacity .125s ease-in-out;
|
|
20
|
+
transition-delay: 0s;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:where([oui-tooltip-content][oui-tooltip-content-active]) {
|
|
24
|
+
opacity: 1;
|
|
25
|
+
transition-delay: .25s;
|
|
18
26
|
}
|