@oscarpalmer/oui 0.36.0 → 0.37.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.
Files changed (51) hide show
  1. package/dist/css/badge.css +18 -15
  2. package/dist/css/button.css +35 -31
  3. package/dist/css/color.css +20 -20
  4. package/dist/css/combobox.css +133 -34
  5. package/dist/css/content.css +29 -10
  6. package/dist/css/floatable.css +10 -10
  7. package/dist/css/form.css +393 -129
  8. package/dist/css/listbox.css +41 -17
  9. package/dist/css/message.css +13 -10
  10. package/dist/css/reset.css +29 -88
  11. package/dist/css/splitter.css +2 -2
  12. package/dist/css/tabs.css +103 -0
  13. package/dist/js/focus-trap/focus-trap.embedded.mjs +6 -10
  14. package/dist/js/index.d.mts +2 -1
  15. package/dist/js/index.mjs +2 -1
  16. package/dist/js/internal/draggable.mjs +16 -22
  17. package/dist/js/internal/listbox/listbox.form.mjs +1 -1
  18. package/dist/js/internal/listbox/listbox.state.mjs +1 -1
  19. package/dist/js/internal/navigable.d.mts +11 -5
  20. package/dist/js/internal/navigable.mjs +44 -18
  21. package/dist/js/movable/movable.embedded.mjs +3 -6
  22. package/dist/js/resizable/resizable.embedded.mjs +16 -26
  23. package/dist/js/splitter.mjs +15 -12
  24. package/dist/js/tabs.d.mts +25 -0
  25. package/dist/js/tabs.mjs +240 -0
  26. package/dist/js/tooltip.mjs +13 -12
  27. package/package.json +1 -1
  28. package/src/css/badge.scss +6 -18
  29. package/src/css/button.scss +6 -45
  30. package/src/css/color.scss +20 -20
  31. package/src/css/combobox.scss +20 -51
  32. package/src/css/content.scss +30 -3
  33. package/src/css/floatable.scss +17 -17
  34. package/src/css/form.scss +84 -72
  35. package/src/css/listbox.scss +2 -31
  36. package/src/css/message.scss +13 -28
  37. package/src/css/mixins.scss +253 -28
  38. package/src/css/reset.scss +37 -86
  39. package/src/css/splitter.scss +2 -2
  40. package/src/css/tabs.scss +85 -0
  41. package/src/js/focus-trap/focus-trap.embedded.ts +11 -19
  42. package/src/js/index.ts +1 -0
  43. package/src/js/internal/draggable.ts +29 -33
  44. package/src/js/internal/listbox/listbox.form.ts +1 -1
  45. package/src/js/internal/listbox/listbox.state.ts +1 -1
  46. package/src/js/internal/navigable.ts +80 -23
  47. package/src/js/movable/movable.embedded.ts +11 -13
  48. package/src/js/resizable/resizable.embedded.ts +25 -39
  49. package/src/js/splitter.ts +21 -18
  50. package/src/js/tabs.ts +447 -0
  51. package/src/js/tooltip.ts +20 -17
@@ -6,31 +6,29 @@
6
6
  * A reset I use for a lot of personal stuff, and elsewhere, of course.
7
7
  * It's a mix of a few different resets mixed together with some of my own ideas.
8
8
  *
9
- * When rules are explained, such comments will be suffixed with one ore more square brackets
10
- * with a two-letter code, all of which are listed below. My own code is "OP", which are my initials.
11
- *
12
- * - Andy Bell's "A (more) Modern CSS Reset" [AB]
9
+ * - Andy Bell's "A (more) Modern CSS Reset"
13
10
  * https://andy-bell.co.uk/a-more-modern-css-reset/
14
11
  *
15
- * - Chris Coyier's "The Coyier CSS Starter" [CC]
12
+ * - Chris Coyier's "The Coyier CSS Starter"
16
13
  * https://frontendmasters.com/blog/the-coyier-css-starter/
17
14
  *
18
- * - CSS Remedy [CR]
15
+ * - CSS Remedy
19
16
  * https://github.com/jensimmons/cssremedy
20
17
  *
21
- * - Harry Roberts [HR]
18
+ * - Harry Roberts
22
19
  * - https://github.com/csswizardry
23
20
  *
24
- * - RESS [RS]
21
+ * - Interface Cheat sheet
22
+ * - https://interfaces.dev/cheat-sheet
23
+ *
24
+ * - RESS
25
25
  * https://github.com/filipelinhares/ress
26
26
  *
27
- * - Sanitize.css [SE]
27
+ * - Sanitize.css
28
28
  * https://github.com/csstools/sanitize.css
29
29
  */
30
30
 
31
- /**
32
- * Catch-alls
33
- */
31
+ // #region Globals
34
32
 
35
33
  :where(*) {
36
34
  padding: 0;
@@ -43,18 +41,19 @@
43
41
  box-sizing: border-box;
44
42
  }
45
43
 
46
- /**
47
- * Document
48
- */
44
+ // #endregion
45
+
46
+ // #region Document
49
47
 
50
48
  :where(:root) {
51
49
  font-family: system-ui, sans-serif;
52
50
  font-size: 100%;
53
51
  line-height: 1.5;
54
- /** Prevent text size inflation (e.g., after orientation change) [AB][RE][SE] */
55
52
  text-size-adjust: none;
56
53
  tab-size: 4;
57
54
  overflow-wrap: break-word;
55
+ -webkit-font-smoothing: antialiased;
56
+ -moz-osx-font-smoothing: grayscale;
58
57
  }
59
58
 
60
59
  :where(body) {
@@ -62,13 +61,14 @@
62
61
  font-size: 1rem;
63
62
  }
64
63
 
65
- /**
66
- * General
67
- */
64
+ // #endregion
65
+
66
+ // #region General
68
67
 
69
68
  :where(a) {
70
69
  text-decoration-skip-ink: auto;
71
70
  text-underline-offset: 0.125em;
71
+ text-underline-position: from-font;
72
72
  }
73
73
 
74
74
  :where(abbr[title], dfn[title]) {
@@ -76,19 +76,15 @@
76
76
  }
77
77
 
78
78
  :where(abbr[title]) {
79
- /** Add the correct text decoration in Safari [RS][SE] */
80
79
  text-decoration: underline;
81
- /** Ditto */
82
80
  text-decoration: underline dotted;
83
81
  }
84
82
 
85
83
  :where(b, strong) {
86
- /** Add the correct font weight in Chrome, Edge, and Safari [RS][SE], without compounding [HR] */
87
84
  font-weight: bold;
88
85
  }
89
86
 
90
87
  :where(button, h1, h2, h3, h4, h5, h6, input, label, legend) {
91
- /** Set shorter line heights on headings and interactive elements [AB] */
92
88
  line-height: 1.125;
93
89
  }
94
90
 
@@ -103,21 +99,16 @@
103
99
  input[type='submit' i],
104
100
  summary
105
101
  ) {
106
- /** Correct the inability to style clickable types in iOS [HR][RS][SE] */
107
102
  appearance: auto;
108
- /** Ditto */
109
103
  cursor: pointer;
110
104
  }
111
105
 
112
106
  :where(code, kbd, output, pre, samp) {
113
- /** Specify the font family of code elements [HR][RS][SE] */
114
107
  font-family: monospace, monospace;
115
- /** Correct the odd 'em' font sizing in all browsers [HR][RS][SE] */
116
108
  font-size: inherit;
117
109
  }
118
110
 
119
111
  :where(details > summary:first-of-type) {
120
- /** Add the correct display in Safari [SE] */
121
112
  display: list-item;
122
113
  }
123
114
 
@@ -140,7 +131,6 @@
140
131
  }
141
132
 
142
133
  :where(dl, ol, ul) :where(dl, ol, ul) {
143
- /** Remove the margin on nested lists in Chrome, Edge, and Safari [SE] */
144
134
  margin: 0;
145
135
  }
146
136
 
@@ -149,23 +139,18 @@
149
139
  }
150
140
 
151
141
  :where(h1) {
152
- /** Consistent sizing across browsers [HR] */
153
142
  font-size: 2em;
154
143
  }
155
144
 
156
145
  :where(hr) {
157
- /** Add the correct box sizing in Firefox [CR][RS][SE] */
158
146
  height: 0;
159
- /** Show the overflow in Edge and IE [CR][RS] */
160
147
  overflow: visible;
161
148
  border-style: solid;
162
149
  border-width: 1px 0 0;
163
- /** // Correct the inheritance of border colour in Firefox [CR][RS][SE] */
164
150
  color: inherit;
165
151
  }
166
152
 
167
153
  :where(ins, u) {
168
- /** Prevent link styling [HR] */
169
154
  text-decoration: none;
170
155
  }
171
156
 
@@ -176,15 +161,12 @@
176
161
  }
177
162
 
178
163
  :where(nav li)::before {
179
- /** Prevent VoiceOver from ignoring list semantics in Safari [SE] */
180
164
  content: '\200B';
181
165
  float: left;
182
166
  }
183
167
 
184
168
  :where(pre) {
185
- /** Prevent overflow of the container in all browsers [SE] */
186
169
  overflow: auto;
187
- /** Overflow by default is bad… [CR] */
188
170
  white-space: pre-wrap;
189
171
  }
190
172
 
@@ -208,29 +190,22 @@
208
190
 
209
191
  :where(table) {
210
192
  border-collapse: collapse;
211
- /** Correct table border colour in Chrome, Edge, and Safari [SE] */
212
193
  border-color: currentcolor;
213
- /** Modernized border spacing [HR] */
214
194
  border-spacing: 0;
215
- /** More legible numbers [HR] */
216
195
  font-variant-numeric: tabular-nums;
217
- /** Remove text indentation from table contents in Chrome, Edge, and Safari [RS][SE] */
218
196
  text-indent: 0;
219
197
  }
220
198
 
221
- /**
222
- * Form-related
223
- */
199
+ // #endregion
200
+
201
+ // #region Forms
224
202
 
225
203
  :where(button, input, optgroup, select, textarea) {
226
- /** Correct the font inheritance in Firefox, Edge, and Safari [HR][RS][SE] */
227
204
  font: inherit;
228
205
  }
229
206
 
230
207
  :where(button, input, select, textarea) {
231
- /** Change the inconsistent appearance in all browsers [SE] */
232
208
  padding: 0.25em 0.5em;
233
- /** Ditto for all */
234
209
  background-color: transparent;
235
210
  border: 1px solid WindowFrame;
236
211
  color: inherit;
@@ -238,24 +213,19 @@
238
213
  }
239
214
 
240
215
  :where(fieldset) {
241
- /** Change the inconsistent appearance in all browsers [SE] */
242
216
  border: 1px solid darkgrey;
243
217
  }
244
218
 
245
219
  :where(optgroup) {
246
- /** Restore the font weight unset by previous rules [RS] */
247
220
  font-weight: bold;
248
221
  }
249
222
 
250
223
  :where(progress) {
251
- /** Add the correct vertical alignment in Chrome, Edge, and Firefox [RS][SE] */
252
224
  vertical-align: baseline;
253
225
  }
254
226
 
255
227
  :where(select, input[list]) {
256
- /** Change the inconsistent appearance in all browsers [SE] */
257
228
  appearance: none;
258
- /** Ditto for all */
259
229
  padding-right: 1em;
260
230
  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");
261
231
  background-position: right center / 1em;
@@ -264,31 +234,24 @@
264
234
  }
265
235
 
266
236
  :where(select[multiple]) {
267
- /** Don't show the arrow for multiple choice selects [SE] */
268
237
  background-image: none;
269
238
  }
270
239
 
271
240
  :where(textarea) {
272
- /** Change the resize direction in all browsers [RS][SE] */
273
241
  resize: vertical;
274
242
  }
275
243
 
276
244
  :where([type='color' i], [type='range' i]) {
277
- /** Remove the padding in all browsers [SE] */
278
245
  padding: 0;
279
- /** Remove the border in all browsers [SE] */
280
246
  border-width: 0;
281
247
  }
282
248
 
283
249
  :where([type='search' i]) {
284
- /** Correct the odd appearance in Chrome, Edge, and Safari [RS][SE] */
285
250
  appearance: textfield;
286
- /** Correct the outline style in Safari [RS][SE] */
287
251
  outline-offset: -2px;
288
252
  }
289
253
 
290
254
  ::file-selector-button {
291
- /** Correct the inability to style upload buttons in iOS and Safari [RS][SE] */
292
255
  appearance: auto;
293
256
  color: inherit;
294
257
  font: inherit;
@@ -296,26 +259,22 @@
296
259
  }
297
260
 
298
261
  ::placeholder {
299
- /** Better default text opacity [OP] */
300
262
  opacity: 0.67;
301
- /** Better default text color [HR][SE] */
302
263
  color: inherit;
303
264
  }
304
265
 
305
266
  ::-webkit-inner-spin-button,
306
267
  ::-webkit-outer-spin-button {
307
- /** Correct the cursor style of increment and decrement buttons in Safari [RS][SE] */
308
268
  height: auto;
309
269
  }
310
270
 
311
271
  ::-webkit-search-decoration {
312
- /** Remove the inner padding in Chrome, Edge, and Safari on macOS [SE] */
313
272
  appearance: none;
314
273
  }
315
274
 
316
- /**
317
- * Media-related
318
- */
275
+ // #endregion
276
+
277
+ // #region Media
319
278
 
320
279
  :where(audio, canvas, embed, iframe, img, object, picture, svg, video) {
321
280
  max-inline-size: 100%;
@@ -327,7 +286,6 @@
327
286
  }
328
287
 
329
288
  :where(audio) {
330
- /** Better default width [CR] */
331
289
  width: 100%;
332
290
  }
333
291
 
@@ -336,7 +294,6 @@
336
294
  }
337
295
 
338
296
  :where(canvas, img, svg, video) {
339
- /** Proportional height based on width [HR] */
340
297
  block-size: auto;
341
298
  }
342
299
 
@@ -345,21 +302,17 @@
345
302
  }
346
303
 
347
304
  :where(img) {
348
- /** CSS magic! [HR] */
349
305
  background-repeat: no-repeat;
350
- /** Ditto */
351
306
  background-size: cover;
352
- /** Offset alt-text if image does not load [HR] */
307
+ outline: 1px solid light-dark(rgb(255 255 255 / 8%), rgb(0 0 0 / 8%));
353
308
  font-style: italic;
354
309
  }
355
310
 
356
311
  :where(picture) {
357
- /** Remove the unnecessary wrapping 'picture', while maintaining contents [CR] */
358
312
  display: contents;
359
313
  }
360
314
 
361
315
  :where(source) {
362
- /** Source elements have nothing to display, so we hide them entirely [CR] */
363
316
  display: none;
364
317
  }
365
318
 
@@ -367,9 +320,9 @@
367
320
  fill: currentcolor;
368
321
  }
369
322
 
370
- /**
371
- * Attributes
372
- */
323
+ // #endregion
324
+
325
+ // #region Attributes
373
326
 
374
327
  :where([aria-busy='true' i]) {
375
328
  cursor: progress;
@@ -399,37 +352,33 @@
399
352
  display: inherit !important;
400
353
  }
401
354
 
402
- /**
403
- * Pseudo-classes
404
- */
355
+ // #endregion
356
+
357
+ // #region Pseudo-classes
405
358
 
406
359
  :where(:target) {
407
360
  scroll-margin: 2rlh;
408
361
  }
409
362
 
410
- /**
411
- * Media queries
412
- */
363
+ // #endregion
364
+
365
+ // #region Media queries
413
366
 
414
367
  @media (prefers-reduced-motion: no-preference) {
415
368
  :where(:root) {
416
- /** Allow for animations on auto-sizes [CC] */
417
369
  interpolate-size: allow-keywords;
418
370
  }
419
371
 
420
372
  :where(:root:focus-within) {
421
- /** Allow for smooth scrolling to focused elements */
422
373
  scroll-behavior: smooth;
423
374
  }
424
375
  }
425
376
 
426
377
  @media (prefers-reduced-motion: reduce) {
427
378
  :where(:root:focus-within) {
428
- /** Disable smooth scrolling, when requested */
429
379
  scroll-behavior: auto;
430
380
  }
431
381
 
432
- /** Disable animations and transitions, when requested */
433
382
  :where(*),
434
383
  ::after,
435
384
  ::before {
@@ -439,3 +388,5 @@
439
388
  scroll-behavior: auto !important;
440
389
  }
441
390
  }
391
+
392
+ // #endregion
@@ -24,7 +24,7 @@ oui-splitter {
24
24
  transition: background 0.125s ease-in-out;
25
25
  }
26
26
 
27
- :where([oui-splitter-separator]:has([oui-splitter-handle]:focus)),
27
+ :where([oui-splitter-separator]:has([oui-splitter-handle]:focus-visible)),
28
28
  :where([oui-splitter-separator]:has([oui-splitter-handle]:hover)),
29
29
  :where([oui-splitter-separator][oui-splitter-active]) {
30
30
  background-color: color-mix(in oklab, var(--oui-blue-6), transparent 82.5%);
@@ -58,7 +58,7 @@ oui-splitter {
58
58
  }
59
59
  }
60
60
 
61
- :where([oui-splitter-handle]:focus),
61
+ :where([oui-splitter-handle]:focus-visible),
62
62
  :where([oui-splitter-handle]:hover),
63
63
  :where([oui-splitter-handle][oui-splitter-active]) {
64
64
  &::after {
@@ -0,0 +1,85 @@
1
+ @use './mixins.scss' as mixins;
2
+
3
+ oui-tabs {
4
+ :where(&) {
5
+ display: flex;
6
+ }
7
+
8
+ :where(&[orientation='horizontal' i]) {
9
+ flex-flow: column nowrap;
10
+ }
11
+
12
+ :where(&[orientation='vertical' i]) {
13
+ flex-flow: row nowrap;
14
+ }
15
+ }
16
+
17
+ [oui-tabs-content] {
18
+ :where(&) {
19
+ padding: 1em;
20
+ flex: 1;
21
+ background-color: var(--oui-absolute);
22
+ }
23
+
24
+ :where(oui-tabs[orientation='horizontal' i] > &) {
25
+ border-radius: 0 0 0.5em 0.5em;
26
+ box-shadow:
27
+ 0 0 0 1px rgb(0 0 0 / 12.5%),
28
+ inset 0 1px 2px -0.5px rgb(0 0 0 / 5%),
29
+ inset 0 2px 4px -1px rgb(0 0 0 / 5%);
30
+ }
31
+
32
+ :where(oui-tabs[orientation='vertical' i] > &) {
33
+ border-radius: 0 0.5em 0.5em 0;
34
+ box-shadow:
35
+ 0 0 0 1px rgb(0 0 0 / 12.5%),
36
+ inset 1px 1px 2px -0.5px rgb(0 0 0 / 5%),
37
+ inset 2px 2px 4px -1px rgb(0 0 0 / 5%);
38
+ }
39
+ }
40
+
41
+ [oui-tabs-tab] {
42
+ :where(&) {
43
+ @include mixins.button;
44
+ @include mixins.button-blue;
45
+
46
+ font-size: 0.875rem;
47
+ align-self: flex-end;
48
+ }
49
+
50
+ :where(&[aria-selected='true' i]) {
51
+ --oui-background-percentage: 80%;
52
+
53
+ box-shadow:
54
+ 0 0 0 1px var(--oui-shadow-value),
55
+ inset 0 1px 2px -0.5px var(--oui-shadow-value),
56
+ inset 0 2px 4px -1px var(--oui-shadow-value);
57
+ }
58
+ }
59
+
60
+ [oui-tabs-tablist] {
61
+ :where(&) {
62
+ display: flex;
63
+ gap: 0.5em;
64
+ }
65
+
66
+ &[aria-orientation='horizontal' i] {
67
+ :where(&) {
68
+ flex-flow: row nowrap;
69
+ }
70
+
71
+ :where(& > [oui-tabs-tab]) {
72
+ border-radius: 0.25em 0.25em 0 0;
73
+ }
74
+ }
75
+
76
+ &[aria-orientation='vertical' i] {
77
+ :where(&) {
78
+ flex-flow: column nowrap;
79
+ }
80
+
81
+ :where(& > [oui-tabs-tab]) {
82
+ border-radius: 0.25em 0 0 0.25em;
83
+ }
84
+ }
85
+ }
@@ -285,31 +285,23 @@ function onTab(event: KeyboardEvent): void {
285
285
 
286
286
  const instance = instances.get(element);
287
287
 
288
- if (instance == null) {
288
+ if (instance == null || dispatch(element, 'oui:focus-trap').defaultPrevented) {
289
289
  return;
290
290
  }
291
291
 
292
- const dispatched = dispatch(element, 'focus-trap');
293
-
294
- setTimeout(() => {
295
- if (dispatched.defaultPrevented) {
296
- return;
297
- }
298
-
299
- if (!instance.disabled) {
300
- event.preventDefault();
301
- }
292
+ if (!instance.disabled) {
293
+ event.preventDefault();
294
+ }
302
295
 
303
- const elements = getFocusable(element);
296
+ const elements = getFocusable(element);
304
297
 
305
- const index = elements.indexOf(event.target as HTMLElement);
298
+ const index = elements.indexOf(event.target as HTMLElement);
306
299
 
307
- if (index === -1 || elements.length === 0) {
308
- tabToTrap(instance, elements, element);
309
- } else {
310
- tabToElement(instance, elements, index, event.shiftKey ? -1 : 1);
311
- }
312
- });
300
+ if (index === -1 || elements.length === 0) {
301
+ tabToTrap(instance, elements, element);
302
+ } else {
303
+ tabToElement(instance, elements, index, event.shiftKey ? -1 : 1);
304
+ }
313
305
  }
314
306
 
315
307
  export function removeFocusTrap(element: HTMLElement): void {
package/src/js/index.ts CHANGED
@@ -11,4 +11,5 @@ export * from './popover';
11
11
  export * from './resizable/resizable.standalone';
12
12
  export * from './sortable/sortable.standalone';
13
13
  export * from './splitter';
14
+ export * from './tabs';
14
15
  export * from './tooltip';
@@ -258,7 +258,7 @@ function cancelDrag(item?: OuiDraggableItem): void {
258
258
 
259
259
  item.state.options.drag.onCancel?.(globals, item);
260
260
 
261
- dispatch(item.state.element, `${item.state.name}:cancel`, {
261
+ dispatch(item.state.element, `oui:${item.state.name}:cancel`, {
262
262
  detail: {
263
263
  element: item.state.options.getOrigin(),
264
264
  },
@@ -406,35 +406,33 @@ function onPointerdown(event: MouseEvent | TouchEvent): void {
406
406
  globals.offset = item.state.options.position.getOffset(globals, item, element, position);
407
407
  globals.original = item.state.options.position.getOriginal(globals, item, position);
408
408
 
409
- const dispatched = dispatch(item.state.element, `${item.state.name}:begin`, {
410
- detail: {
411
- element,
412
- position: {...globals.original},
413
- },
414
- });
415
-
416
- setTimeout(() => {
417
- if (dispatched.defaultPrevented) {
418
- item.state.options.drag.onCancel?.(globals, item);
409
+ if (
410
+ dispatch(item.state.element, `oui:${item.state.name}:begin`, {
411
+ detail: {
412
+ element,
413
+ position: {...globals.original},
414
+ },
415
+ }).defaultPrevented
416
+ ) {
417
+ item.state.options.drag.onCancel?.(globals, item);
419
418
 
420
- reset();
419
+ reset();
421
420
 
422
- return;
423
- }
421
+ return;
422
+ }
424
423
 
425
- const next = getNextPosition(item, position);
424
+ const next = getNextPosition(item, position);
426
425
 
427
- setStyles(dragged, {
428
- position: 'fixed',
429
- inset: `${next.y}px auto auto ${next.x}px`,
430
- transform: 'translate3d(0, 0, 0)',
431
- });
426
+ setStyles(dragged, {
427
+ position: 'fixed',
428
+ inset: `${next.y}px auto auto ${next.x}px`,
429
+ transform: 'translate3d(0, 0, 0)',
430
+ });
432
431
 
433
- item.state.options.drag.onBegin?.(event, globals, item, element, handle, next);
432
+ item.state.options.drag.onBegin?.(event, globals, item, element, handle, next);
434
433
 
435
- item.state.styling.set();
436
- styleToggler.set();
437
- });
434
+ item.state.styling.set();
435
+ styleToggler.set();
438
436
  }
439
437
 
440
438
  function onPointermove(event: MouseEvent | TouchEvent): void {
@@ -459,15 +457,13 @@ function onPointermove(event: MouseEvent | TouchEvent): void {
459
457
  original: position,
460
458
  });
461
459
 
462
- const dispatched = dispatch(current.state.element, `${current.state.name}:move`, {
463
- detail,
464
- });
465
-
466
- setTimeout(() => {
467
- if (dispatched.defaultPrevented) {
468
- cancelDrag(current);
469
- }
470
- });
460
+ if (
461
+ dispatch(current.state.element, `oui:${current.state.name}:move`, {
462
+ detail,
463
+ }).defaultPrevented
464
+ ) {
465
+ cancelDrag(current);
466
+ }
471
467
  }
472
468
 
473
469
  function onPointerup(event: MouseEvent | TouchEvent): void {
@@ -32,7 +32,7 @@ export function updateListboxForm<State extends OuiListboxState>(
32
32
  updateListboxValidity(state);
33
33
 
34
34
  if (emit ?? true) {
35
- dispatch(state.host, 'change');
35
+ dispatch(state.host, 'oui:change');
36
36
  }
37
37
  }
38
38
 
@@ -73,7 +73,7 @@ export function initializeListboxState<State extends OuiListboxState>(
73
73
  updateListboxValueLabel(state);
74
74
 
75
75
  if (state.options.selected.length > 0) {
76
- updateListboxPreview('none', state, state.options.selected[0]);
76
+ updateListboxPreview('none', state, state.options.selected[0], false);
77
77
  }
78
78
 
79
79
  return state;