@threadlabs/looma 0.39.1 → 0.39.3

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 (50) hide show
  1. package/components/ui-button/ui-button.html +24 -3
  2. package/components/ui-checkbox/ui-checkbox.html +34 -18
  3. package/components/ui-combobox/ui-combobox.html +8 -3
  4. package/components/ui-combobox/ui-combobox.js +3 -2
  5. package/components/ui-dialog/ui-dialog.html +6 -52
  6. package/components/ui-input/ui-input.html +21 -3
  7. package/components/ui-input-group/ui-input-group.html +1 -0
  8. package/components/ui-light-editor/ui-light-editor.html +26 -25
  9. package/components/ui-select/ui-select.html +10 -3
  10. package/dist/index.js +1 -1
  11. package/docs/README.md +18 -7
  12. package/docs/catalog.json +2 -26
  13. package/docs/customizer-render.mjs +37 -33
  14. package/docs/customizer.js +82 -47
  15. package/docs/site.mjs +10 -6
  16. package/docs/theme-session.mjs +7 -8
  17. package/docs/theme.mjs +10 -22
  18. package/package.json +1 -1
  19. package/styles/ui-button.css +24 -1
  20. package/styles/ui-checkbox.css +39 -19
  21. package/styles/ui-combobox.css +16 -6
  22. package/styles/ui-dialog.css +6 -107
  23. package/styles/ui-input-group.css +1 -0
  24. package/styles/ui-input.css +24 -3
  25. package/styles/ui-light-editor.css +111 -0
  26. package/styles/ui-select.css +10 -3
  27. package/theme-system.css +4 -1
  28. package/tokens.css +9 -2
  29. package/vanilla/UiButton.js +14 -12
  30. package/vanilla/UiDialog.js +2 -2
  31. package/vanilla/UiLightEditor.js +2 -2
  32. package/vue/UiButton.vue +28 -7
  33. package/vue/UiCheckbox.vue +34 -19
  34. package/vue/UiCombobox.vue +22 -6
  35. package/vue/UiDialog.d.ts +3 -3
  36. package/vue/UiDialog.vue +18 -111
  37. package/vue/UiInput.vue +30 -3
  38. package/vue/UiInputGroup.vue +1 -0
  39. package/vue/UiLightEditor.vue +156 -40
  40. package/vue/UiSelect.vue +16 -3
  41. package/vue/chunks/UiButton.js +18 -10
  42. package/vue/chunks/UiCheckbox.js +1 -1
  43. package/vue/chunks/UiCombobox.js +1 -1
  44. package/vue/chunks/UiDialog.js +22 -14
  45. package/vue/chunks/UiInput.js +1 -1
  46. package/vue/chunks/UiInputGroup.js +1 -1
  47. package/vue/chunks/UiLightEditor.js +66 -58
  48. package/vue/chunks/UiSelect.js +1 -1
  49. package/vue/components.css +337 -160
  50. package/vue/editor/index.js +46 -36
package/vue/UiDialog.vue CHANGED
@@ -22,6 +22,8 @@ import {
22
22
  vPropValidity,
23
23
  vuePropInputs,
24
24
  } from './props'
25
+ import UiIcon from './UiIcon.vue'
26
+ import UiIconButton from './UiIconButton.vue'
25
27
  import UiScrollArea from './UiScrollArea.vue'
26
28
 
27
29
  defineOptions({ inheritAttrs: false })
@@ -320,10 +322,16 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
320
322
  ref="root"
321
323
  >
322
324
  <header data-hn-ui-dialog ref="headerElement">
323
- <h2 v-if="checkedProps.label" class="title" data-hn-ui-dialog>{{ checkedProps.label }}</h2>{{
324
- ' '
325
- }}<button class="close" type="button" aria-label="Close" data-hn-ui-dialog ref="closeElement">
326
- </button>
325
+ <h2 v-if="checkedProps.label" class="title" data-hn-ui-dialog>{{ checkedProps.label }}</h2>
326
+ <div class="close" data-hn-ui-dialog>
327
+ <UiIconButton
328
+ class="ui-icon-button"
329
+ size="sm"
330
+ :round="true"
331
+ label="Close"
332
+ ref="closeElement"
333
+ ><UiIcon class="ui-icon" name="x" /></UiIconButton>
334
+ </div>
327
335
  </header>
328
336
  <div class="body" data-hn-ui-dialog ref="bodyElement">
329
337
  <UiScrollArea class="ui-scroll-area" :trim="true"><slot /></UiScrollArea>
@@ -372,10 +380,6 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
372
380
 
373
381
  /* :host-qualified so page heading rules that reach in cannot outrank the dialog chrome. */
374
382
 
375
- /* A CSS-drawn X. */
376
-
377
- /* A touch target, like Button on coarse pointers. */
378
-
379
383
  @keyframes ui-dialog-enter {
380
384
  from {
381
385
  opacity: 0;
@@ -574,56 +578,10 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
574
578
  }
575
579
 
576
580
  :global(.close:where([data-hn-ui-dialog])) {
577
- display: inline-grid !important;
578
- place-items: center;
579
- flex: none;
581
+ display: flex !important;
582
+ align-items: center !important;
583
+ flex: none !important;
580
584
  margin-inline-start: auto !important;
581
- inline-size: var(--ui-control-size-sm);
582
- block-size: var(--ui-control-size-sm);
583
- padding: 0 !important;
584
- border: 0;
585
- border-radius: var(--ui-radius-round);
586
- background: transparent;
587
- color: var(--ui-text-secondary);
588
- cursor: pointer;
589
- transition:
590
- background-color var(--ui-motion-fast) var(--ui-motion-ease),
591
- color var(--ui-motion-fast) var(--ui-motion-ease);
592
- }
593
- :global(.close:where([data-hn-ui-dialog])::before),
594
- :global(.close:where([data-hn-ui-dialog])::after) {
595
- content: "";
596
- grid-area: 1 / 1;
597
- inline-size: 0.875rem;
598
- block-size: 1.5px;
599
- border-radius: 1px;
600
- background: currentColor;
601
- transform: rotate(45deg);
602
- }
603
-
604
- :global(.close:where([data-hn-ui-dialog])::after) {
605
- transform: rotate(-45deg);
606
- }
607
-
608
- :global(.close:hover:where([data-hn-ui-dialog])) {
609
- background: var(--ui-surface-muted);
610
- color: var(--ui-text-primary);
611
- }
612
-
613
- :global(.close:focus-visible:where([data-hn-ui-dialog])) {
614
- outline: var(--ui-focus-width) solid var(--ui-focus-ring);
615
- outline-offset: var(--ui-focus-width);
616
- }
617
- @media (pointer: coarse) {
618
- :global(.close:where([data-hn-ui-dialog])) {
619
- inline-size: var(--ui-control-min-block-size);
620
- block-size: var(--ui-control-min-block-size);
621
- }
622
- }
623
-
624
- :global(html[data-ui-input-modality="touch"] :scope .close:where([data-hn-ui-dialog])) {
625
- inline-size: var(--ui-control-min-block-size);
626
- block-size: var(--ui-control-min-block-size);
627
585
  }
628
586
 
629
587
  :global(.body:where([data-hn-ui-dialog])) {
@@ -858,61 +816,10 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
858
816
  }
859
817
 
860
818
  :global(.close:where(:scope, :scope *):where([data-hn-ui-dialog])) {
861
- display: inline-grid !important;
862
- place-items: center;
863
- flex: none;
819
+ display: flex !important;
820
+ align-items: center !important;
821
+ flex: none !important;
864
822
  margin-inline-start: auto !important;
865
- inline-size: var(--ui-control-size-sm);
866
- block-size: var(--ui-control-size-sm);
867
- padding: 0 !important;
868
- border: 0;
869
- border-radius: var(--ui-radius-round);
870
- background: transparent;
871
- color: var(--ui-text-secondary);
872
- cursor: pointer;
873
- transition:
874
- background-color var(--ui-motion-fast) var(--ui-motion-ease),
875
- color var(--ui-motion-fast) var(--ui-motion-ease);
876
- }
877
- :global(.close:where(:not([data-hn], [data-slotted]:not([data-slotted~="ui-dialog"]))):where(:scope, :scope
878
- *):where([data-hn-ui-dialog])::before),
879
- :global(.close:where(:not([data-hn], [data-slotted]:not([data-slotted~="ui-dialog"]))):where(:scope, :scope
880
- *):where([data-hn-ui-dialog])::after) {
881
- content: "";
882
- grid-area: 1 / 1;
883
- inline-size: 0.875rem;
884
- block-size: 1.5px;
885
- border-radius: 1px;
886
- background: currentColor;
887
- transform: rotate(45deg);
888
- }
889
-
890
- :global(.close:where(:not([data-hn], [data-slotted]:not([data-slotted~="ui-dialog"]))):where(:scope, :scope
891
- *):where([data-hn-ui-dialog])::after) {
892
- transform: rotate(-45deg);
893
- }
894
-
895
- :global(.close:hover:where(:scope, :scope *):where([data-hn-ui-dialog])) {
896
- background: var(--ui-surface-muted);
897
- color: var(--ui-text-primary);
898
- }
899
-
900
- :global(.close:focus-visible:where(:scope, :scope *):where([data-hn-ui-dialog])) {
901
- outline: var(--ui-focus-width) solid var(--ui-focus-ring);
902
- outline-offset: var(--ui-focus-width);
903
- }
904
- @media (pointer: coarse) {
905
- :global(.close:where(:scope, :scope *):where([data-hn-ui-dialog])) {
906
- inline-size: var(--ui-control-min-block-size);
907
- block-size: var(--ui-control-min-block-size);
908
- }
909
- }
910
-
911
- :global(html[data-ui-input-modality="touch"]
912
- :where(.ui-dialog)
913
- .close:where(:scope, :not([data-hn], [data-slotted]:not([data-slotted~="ui-dialog"]))):where([data-hn-ui-dialog])) {
914
- inline-size: var(--ui-control-min-block-size);
915
- block-size: var(--ui-control-min-block-size);
916
823
  }
917
824
 
918
825
  :global(.body:where(:scope, :scope *):where([data-hn-ui-dialog])) {
package/vue/UiInput.vue CHANGED
@@ -537,6 +537,14 @@ useComponentHost(() => import('../components/ui-input/ui-input.js'), {
537
537
  syntax: "*";
538
538
  inherits: false;
539
539
  }
540
+ /* Normalize a unitless zero border to a length before the box calculation. */
541
+ @property --_ui-input-stroke {
542
+ syntax: "<length>";
543
+ inherits: false;
544
+ initial-value: 1px;
545
+ }
546
+
547
+ /* Cap Safari's excess text metrics without changing native date, file, color or range widgets. */
540
548
 
541
549
  /* Each size reads the hook and then an Input Group's default first, so a group, which draws the frame, can zero it. */
542
550
 
@@ -555,6 +563,12 @@ useComponentHost(() => import('../components/ui-input/ui-input.js'), {
555
563
 
556
564
  @scope (.ui-input) to ([data-hn]) {
557
565
  :global(:scope) {
566
+ --_ui-input-size: var(--ui-control-size-md);
567
+ --_ui-input-inset-block: var(--ui-control-inset-block-md, var(--ui-space-2));
568
+ --_ui-input-stroke: var(
569
+ --ui-input-border-width,
570
+ var(--_ui-default-input-border-width, var(--ui-border-width))
571
+ );
558
572
  box-sizing: border-box !important;
559
573
  display: inline-block !important;
560
574
  inline-size: var(--ui-input-inline-size, 100%);
@@ -564,7 +578,7 @@ useComponentHost(() => import('../components/ui-input/ui-input.js'), {
564
578
  var(--_ui-default-input-min-block-size, var(--ui-control-size-md))
565
579
  );
566
580
  margin: 0 !important;
567
- padding: var(--ui-control-inset-block-md, var(--ui-space-2)) var(--ui-space-3) !important;
581
+ padding: var(--_ui-input-inset-block) var(--ui-space-3) !important;
568
582
  appearance: none;
569
583
  padding-inline-start: var(--_ui-default-input-padding-inline-start, var(--ui-space-3))
570
584
  !important;
@@ -594,21 +608,34 @@ useComponentHost(() => import('../components/ui-input/ui-input.js'), {
594
608
  box-shadow var(--ui-motion-fast) var(--ui-motion-ease),
595
609
  background-color var(--ui-motion-fast) var(--ui-motion-ease);
596
610
  }
611
+ :global(:scope:is([type="text"], [type="search"], [type="tel"], [type="url"], [type="email"], [type="password"], [type="number"])) {
612
+ max-block-size: max(
613
+ calc(var(--_ui-input-size) - var(--_ui-default-input-frame-width, 0px)),
614
+ calc(
615
+ 1em * var(--ui-line-height-tight) + 2 * var(--_ui-input-inset-block) +
616
+ 2 * var(--_ui-input-stroke)
617
+ )
618
+ );
619
+ }
597
620
  :global(:scope[data-ui-input-state~="size=sm"]) {
621
+ --_ui-input-size: var(--ui-control-size-sm);
622
+ --_ui-input-inset-block: var(--ui-control-inset-block-sm, var(--ui-space-1));
598
623
  min-block-size: var(
599
624
  --ui-input-min-block-size,
600
625
  var(--_ui-default-input-min-block-size, var(--ui-control-size-sm))
601
626
  );
602
- padding: var(--ui-control-inset-block-sm, var(--ui-space-1)) var(--ui-space-2) !important;
627
+ padding: var(--_ui-input-inset-block) var(--ui-space-2) !important;
603
628
  font-size: var(--ui-font-size-sm);
604
629
  }
605
630
 
606
631
  :global(:scope[data-ui-input-state~="size=lg"]) {
632
+ --_ui-input-size: var(--ui-control-size-lg);
633
+ --_ui-input-inset-block: var(--ui-control-inset-block-lg, var(--ui-space-3));
607
634
  min-block-size: var(
608
635
  --ui-input-min-block-size,
609
636
  var(--_ui-default-input-min-block-size, var(--ui-control-size-lg))
610
637
  );
611
- padding: var(--ui-control-inset-block-lg, var(--ui-space-3)) var(--ui-space-4) !important;
638
+ padding: var(--_ui-input-inset-block) var(--ui-space-4) !important;
612
639
  font-size: var(--ui-font-size-md);
613
640
  }
614
641
  @media (pointer: coarse) {
@@ -269,6 +269,7 @@ useComponentHost(() => import('../components/ui-input-group/ui-input-group.js'),
269
269
  Hooks do not inherit, so these are defaults for the input; its own hooks still win. */
270
270
  --_ui-default-input-border-width: 0;
271
271
  --_ui-default-input-min-block-size: 0;
272
+ --_ui-default-input-frame-width: calc(2 * var(--ui-border-width));
272
273
  --_ui-default-input-border: transparent;
273
274
  --_ui-default-input-border-hover: transparent;
274
275
  --_ui-default-input-focus-border: transparent;
@@ -23,6 +23,7 @@ import {
23
23
  vPropValidity,
24
24
  vuePropInputs,
25
25
  } from './props'
26
+ import UiDisclosure from './UiDisclosure.vue'
26
27
  import UiIcon from './UiIcon.vue'
27
28
  import UiNumberInput from './UiNumberInput.vue'
28
29
 
@@ -262,46 +263,45 @@ useComponentHost(() => import('../components/ui-light-editor/ui-light-editor.js'
262
263
  class="ui-icon"
263
264
  name="lightbulb"
264
265
  /></span>
265
- </button></span></span>{{ ' ' }}<span
266
- class="coordinates"
267
- data-hn-ui-light-editor
268
- ><UiNumberInput
269
- class="ui-number-input"
270
- data-coordinate="x"
271
- :min="0"
272
- :max="100"
273
- :step="1"
274
- unit="%"
275
- label="Light horizontal position"
276
- :value="horizontal"
277
- :size="checkedProps.size"
278
- :disabled="checkedProps.disabled"
279
- v-bind="{
280
- [BINDING_INPUTS_PROP]: {
281
- size: () => ({ value: checkedProps.size, status: inputStatus('size', true) }),
282
- disabled: () => ({ value: checkedProps.disabled, status: inputStatus('disabled', true) }),
283
- },
284
- }"
285
- />{{ ' ' }}<UiNumberInput
286
- class="ui-number-input"
287
- data-coordinate="y"
288
- :min="0"
289
- :max="100"
290
- :step="1"
291
- unit="%"
292
- label="Light vertical position"
293
- :value="vertical"
294
- :size="checkedProps.size"
295
- :disabled="checkedProps.disabled"
296
- v-bind="{
297
- [BINDING_INPUTS_PROP]: {
298
- size: () => ({ value: checkedProps.size, status: inputStatus('size', true) }),
299
- disabled: () => ({ value: checkedProps.disabled, status: inputStatus('disabled', true) }),
300
- },
301
- }"
302
- /></span>{{ ' ' }}<span class="hint" data-hn-ui-light-editor
303
- >Drag the light, tap the background, use arrow keys, or enter its position. Escape cancels a
304
- drag. Top centre is 50%, 0%.</span></span>
266
+ </button></span></span>{{ ' ' }}<span class="hint" data-hn-ui-light-editor
267
+ >Drag or tap to move the light. Arrow keys adjust; Escape cancels.</span>{{ ' ' }}<UiDisclosure
268
+ class="ui-disclosure"
269
+ summary="Exact position"
270
+ ><span class="coordinates" data-slotted="ui-light-editor" data-hn-ui-light-editor><UiNumberInput
271
+ class="ui-number-input"
272
+ data-coordinate="x"
273
+ :min="0"
274
+ :max="100"
275
+ :step="1"
276
+ unit="%"
277
+ label="Light horizontal position"
278
+ :value="horizontal"
279
+ :size="checkedProps.size"
280
+ :disabled="checkedProps.disabled"
281
+ v-bind="{
282
+ [BINDING_INPUTS_PROP]: {
283
+ size: () => ({ value: checkedProps.size, status: inputStatus('size', true) }),
284
+ disabled: () => ({ value: checkedProps.disabled, status: inputStatus('disabled', true) }),
285
+ },
286
+ }"
287
+ />{{ ' ' }}<UiNumberInput
288
+ class="ui-number-input"
289
+ data-coordinate="y"
290
+ :min="0"
291
+ :max="100"
292
+ :step="1"
293
+ unit="%"
294
+ label="Light vertical position"
295
+ :value="vertical"
296
+ :size="checkedProps.size"
297
+ :disabled="checkedProps.disabled"
298
+ v-bind="{
299
+ [BINDING_INPUTS_PROP]: {
300
+ size: () => ({ value: checkedProps.size, status: inputStatus('size', true) }),
301
+ disabled: () => ({ value: checkedProps.disabled, status: inputStatus('disabled', true) }),
302
+ },
303
+ }"
304
+ /></span></UiDisclosure></span>
305
305
  </template>
306
306
 
307
307
  <style scoped>
@@ -418,4 +418,120 @@ useComponentHost(() => import('../components/ui-light-editor/ui-light-editor.js'
418
418
  }
419
419
  }
420
420
  }
421
+ @scope ([data-slotted~="ui-light-editor"]:not([data-hn])) to ([data-hn], [data-slotted]) {
422
+ :global(:where(.ui-light-editor):where(:scope, :not([data-hn], [data-slotted]:not([data-slotted~="ui-light-editor"]))):where([data-hn-ui-light-editor])) {
423
+ display: grid !important;
424
+ gap: var(--ui-space-3) !important;
425
+ min-inline-size: 0;
426
+ padding: 0 !important;
427
+ margin: 0 !important;
428
+ }
429
+ :global(.stage:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
430
+ box-sizing: border-box !important;
431
+ display: block !important;
432
+ block-size: 13rem;
433
+ padding: calc(var(--ui-control-min-block-size) / 2) !important;
434
+ border: var(--ui-border-width) solid var(--ui-control-border);
435
+ border-radius: var(--ui-field-radius, var(--ui-radius-md));
436
+ background: var(--ui-neutral-surface, var(--ui-surface));
437
+ }
438
+ :global(.plane:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
439
+ position: relative;
440
+ display: block !important;
441
+ inline-size: 100%;
442
+ block-size: 100%;
443
+ }
444
+ :global(svg:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
445
+ inline-size: 100%;
446
+ block-size: 100%;
447
+ overflow: visible;
448
+ }
449
+ :global(path:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
450
+ fill: none;
451
+ stroke: var(--ui-border);
452
+ stroke-width: 1;
453
+ vector-effect: non-scaling-stroke;
454
+ }
455
+ :global(.specimen:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
456
+ position: absolute;
457
+ inset: 0;
458
+ display: grid !important;
459
+ place-items: center !important;
460
+ }
461
+ :global(.source:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
462
+ position: absolute;
463
+ left: 50%;
464
+ top: 0;
465
+ translate: -50% -50%;
466
+ display: grid !important;
467
+ place-items: center !important;
468
+ inline-size: max(2rem, var(--ui-control-min-block-size));
469
+ block-size: max(2rem, var(--ui-control-min-block-size));
470
+ padding: 0 !important;
471
+ margin: 0 !important;
472
+ border: 0;
473
+ border-radius: 50%;
474
+ background: transparent;
475
+ cursor: grab;
476
+ touch-action: none;
477
+ }
478
+ :global(.source-glyph:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
479
+ position: relative;
480
+ z-index: 1;
481
+ display: inline-flex !important;
482
+ color: var(--ui-accent);
483
+ font-size: var(--ui-font-size-lg);
484
+ }
485
+ :global(.source:where(:not([data-hn], [data-slotted]:not([data-slotted~="ui-light-editor"]))):where(:scope, :scope
486
+ *):where([data-hn-ui-light-editor])::after) {
487
+ content: "";
488
+ position: absolute;
489
+ inline-size: 2rem;
490
+ block-size: 2rem;
491
+ border: var(--ui-border-width) solid var(--ui-accent);
492
+ border-radius: 50%;
493
+ background: var(--ui-surface-raised);
494
+ box-shadow:
495
+ 0 0 0 var(--ui-space-2) color-mix(in srgb, var(--ui-accent) 12%, transparent),
496
+ var(--ui-shadow-sm);
497
+ }
498
+ :global(.source:active:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
499
+ cursor: grabbing;
500
+ }
501
+ :global(.source:focus-visible:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
502
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring);
503
+ outline-offset: var(--ui-space-1);
504
+ }
505
+ :global(.source:disabled:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
506
+ cursor: not-allowed;
507
+ }
508
+ :global(.source:disabled:where(:not([data-hn], [data-slotted]:not([data-slotted~="ui-light-editor"]))):where(:scope, :scope
509
+ *):where([data-hn-ui-light-editor])::after) {
510
+ background: var(--ui-disabled-surface);
511
+ border-color: var(--ui-disabled-border);
512
+ box-shadow: none;
513
+ }
514
+ :global(.coordinates:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
515
+ display: grid !important;
516
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
517
+ gap: var(--ui-space-2) !important;
518
+ }
519
+ :global(.hint:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
520
+ font-size: var(--ui-font-size-sm);
521
+ color: var(--ui-text-secondary);
522
+ }
523
+ @media (forced-colors: active) {
524
+ :global(.source-glyph:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
525
+ color: CanvasText;
526
+ }
527
+ :global(.source:where(:not([data-hn], [data-slotted]:not([data-slotted~="ui-light-editor"]))):where(:scope, :scope
528
+ *):where([data-hn-ui-light-editor])::after) {
529
+ background: Canvas;
530
+ border-color: CanvasText;
531
+ }
532
+ :global(.source:focus-visible:where(:scope, :scope *):where([data-hn-ui-light-editor])) {
533
+ outline-color: Highlight;
534
+ }
535
+ }
536
+ }
421
537
  </style>
package/vue/UiSelect.vue CHANGED
@@ -300,13 +300,22 @@ useComponentHost(() => import('../components/ui-select/ui-select.js'), {
300
300
 
301
301
  @scope (.ui-select) to ([data-hn]) {
302
302
  :global(:scope:where([data-hn-ui-select])) {
303
+ --_ui-select-size: var(--ui-control-size-md);
304
+ --_ui-select-inset-block: var(--ui-control-inset-block-md, var(--ui-space-2));
303
305
  box-sizing: border-box !important;
304
306
  display: inline-block !important;
305
307
  inline-size: var(--ui-select-inline-size, 100%);
306
308
  min-inline-size: 0;
309
+ max-block-size: max(
310
+ var(--_ui-select-size),
311
+ calc(
312
+ 1em * var(--ui-line-height-tight) + 2 * var(--_ui-select-inset-block) +
313
+ 2 * var(--ui-border-width)
314
+ )
315
+ );
307
316
  min-block-size: var(--ui-control-size-md);
308
317
  margin: 0 !important;
309
- padding: var(--ui-control-inset-block-md, var(--ui-space-2)) var(--ui-space-3) !important;
318
+ padding: var(--_ui-select-inset-block) var(--ui-space-3) !important;
310
319
  border: var(--ui-border-width) solid
311
320
  var(--ui-select-border, var(--ui-control-border, var(--ui-border-strong)));
312
321
  border-radius: var(--ui-select-radius, var(--ui-field-radius, var(--ui-radius-md)));
@@ -390,8 +399,10 @@ useComponentHost(() => import('../components/ui-select/ui-select.js'), {
390
399
  }
391
400
 
392
401
  :global(:scope[data-ui-select-state~="size=sm"]:where([data-hn-ui-select])) {
402
+ --_ui-select-size: var(--ui-control-size-sm);
403
+ --_ui-select-inset-block: var(--ui-control-inset-block-sm, var(--ui-space-1));
393
404
  min-block-size: var(--ui-control-size-sm);
394
- padding: var(--ui-control-inset-block-sm, var(--ui-space-1)) var(--ui-space-2) !important;
405
+ padding: var(--_ui-select-inset-block) var(--ui-space-2) !important;
395
406
  padding-inline-end: calc(var(--ui-space-2) + var(--ui-icon-size-sm) + var(--ui-space-1))
396
407
  !important;
397
408
  background-position: right var(--ui-space-2) center, center;
@@ -402,8 +413,10 @@ useComponentHost(() => import('../components/ui-select/ui-select.js'), {
402
413
  }
403
414
 
404
415
  :global(:scope[data-ui-select-state~="size=lg"]:where([data-hn-ui-select])) {
416
+ --_ui-select-size: var(--ui-control-size-lg);
417
+ --_ui-select-inset-block: var(--ui-control-inset-block-lg, var(--ui-space-3));
405
418
  min-block-size: var(--ui-control-size-lg);
406
- padding: var(--ui-control-inset-block-lg, var(--ui-space-3)) var(--ui-space-4) !important;
419
+ padding: var(--_ui-select-inset-block) var(--ui-space-4) !important;
407
420
  padding-inline-end: calc(var(--ui-space-4) + 1.5rem) !important;
408
421
  background-position: right var(--ui-space-4) center, center;
409
422
  font-size: var(--ui-font-size-md);
@@ -113,10 +113,14 @@ var _hoisted_10 = {
113
113
  "data-hn-ui-button": ""
114
114
  };
115
115
  var _hoisted_11 = {
116
+ class: "label",
117
+ "data-hn-ui-button": ""
118
+ };
119
+ var _hoisted_12 = {
116
120
  class: "badge",
117
121
  "data-hn-ui-button": ""
118
122
  };
119
- var _hoisted_12 = [
123
+ var _hoisted_13 = [
120
124
  "data-appearance",
121
125
  "data-tone",
122
126
  "type",
@@ -141,12 +145,16 @@ var _hoisted_12 = [
141
145
  "data-ui-button-prop-variant",
142
146
  "data-ui-button-state"
143
147
  ];
144
- var _hoisted_13 = {
148
+ var _hoisted_14 = {
145
149
  key: 0,
146
150
  class: "spinner-wrap",
147
151
  "data-hn-ui-button": ""
148
152
  };
149
- var _hoisted_14 = {
153
+ var _hoisted_15 = {
154
+ class: "label",
155
+ "data-hn-ui-button": ""
156
+ };
157
+ var _hoisted_16 = {
150
158
  class: "badge",
151
159
  "data-hn-ui-button": ""
152
160
  };
@@ -843,9 +851,9 @@ var UiButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
843
851
  size: "sm"
844
852
  })])) : createCommentVNode("v-if", true),
845
853
  _cache[4] || (_cache[4] = createTextVNode(toDisplayString(" "), -1)),
846
- renderSlot(_ctx.$slots, "default", {}, void 0, true),
854
+ createElementVNode("span", _hoisted_11, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
847
855
  _cache[5] || (_cache[5] = createTextVNode(toDisplayString(" "), -1)),
848
- createElementVNode("span", _hoisted_11, [renderSlot(_ctx.$slots, "badge", {}, void 0, true)])
856
+ createElementVNode("span", _hoisted_12, [renderSlot(_ctx.$slots, "badge", {}, void 0, true)])
849
857
  ], 16, _hoisted_9)), [[unref(vPropValidity), {
850
858
  contract: propValidityContract,
851
859
  values: { ...props }
@@ -880,20 +888,20 @@ var UiButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
880
888
  "data-ui-button-state": hostState.value || void 0,
881
889
  ref: "@html-next/root"
882
890
  }), [
883
- checkedProps.value.loading || checkedProps.value.pending ? (openBlock(), createElementBlock("span", _hoisted_13, [createVNode(UiSpinner_default, {
891
+ checkedProps.value.loading || checkedProps.value.pending ? (openBlock(), createElementBlock("span", _hoisted_14, [createVNode(UiSpinner_default, {
884
892
  class: "ui-spinner",
885
893
  size: "sm"
886
894
  })])) : createCommentVNode("v-if", true),
887
895
  _cache[6] || (_cache[6] = createTextVNode(toDisplayString(" "), -1)),
888
- renderSlot(_ctx.$slots, "default", {}, void 0, true),
896
+ createElementVNode("span", _hoisted_15, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
889
897
  _cache[7] || (_cache[7] = createTextVNode(toDisplayString(" "), -1)),
890
- createElementVNode("span", _hoisted_14, [renderSlot(_ctx.$slots, "badge", {}, void 0, true)])
891
- ], 16, _hoisted_12)), [[unref(vPropValidity), {
898
+ createElementVNode("span", _hoisted_16, [renderSlot(_ctx.$slots, "badge", {}, void 0, true)])
899
+ ], 16, _hoisted_13)), [[unref(vPropValidity), {
892
900
  contract: propValidityContract,
893
901
  values: { ...props }
894
902
  }]]);
895
903
  };
896
904
  }
897
- }), [["__scopeId", "data-v-1eb598b9"]]);
905
+ }), [["__scopeId", "data-v-290745d7"]]);
898
906
  //#endregion
899
907
  export { UiButton_default as t };
@@ -356,6 +356,6 @@ var UiCheckbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
356
356
  }]]);
357
357
  };
358
358
  }
359
- }), [["__scopeId", "data-v-d551a32f"]]);
359
+ }), [["__scopeId", "data-v-570a9f0b"]]);
360
360
  //#endregion
361
361
  export { UiCheckbox_default as t };
@@ -2160,6 +2160,6 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
2160
2160
  }]]);
2161
2161
  };
2162
2162
  }
2163
- }), [["__scopeId", "data-v-4630df88"]]);
2163
+ }), [["__scopeId", "data-v-5b47db0f"]]);
2164
2164
  //#endregion
2165
2165
  export { UiCombobox_default as t };
@@ -1,7 +1,9 @@
1
1
  import { C as useReflectedProp, S as useComponentHost, _ as nativeAttrs, a as checkHydratedRoot, s as createDispatch, t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
2
2
  import { d as propValidityState, h as vuePropInputs, i as checkPropInput, m as vPropValidity, r as acceptsControllerWrite, t as BINDING_INPUTS_PROP } from "./props.js";
3
+ import { t as UiIcon_default } from "./UiIcon.js";
4
+ import { t as UiIconButton_default } from "./UiIconButton.js";
3
5
  import { t as UiScrollArea_default } from "./UiScrollArea.js";
4
- import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, toDisplayString, unref, useTemplateRef, watchSyncEffect, withCtx, withDirectives } from "vue";
6
+ import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, toDisplayString, unref, useTemplateRef, watchSyncEffect, withCtx, withDirectives } from "vue";
5
7
  //#region .build/vue/UiDialog.vue?vue&type=script&setup=true&lang.ts
6
8
  var _hoisted_1 = [
7
9
  "aria-label",
@@ -20,6 +22,10 @@ var _hoisted_2 = {
20
22
  class: "title",
21
23
  "data-hn-ui-dialog": ""
22
24
  };
25
+ var _hoisted_3 = {
26
+ class: "close",
27
+ "data-hn-ui-dialog": ""
28
+ };
23
29
  //#endregion
24
30
  //#region .build/vue/UiDialog.vue
25
31
  var UiDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -319,18 +325,20 @@ var UiDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
319
325
  "data-hn-ui-dialog": "",
320
326
  ref_key: "headerElement",
321
327
  ref: headerElement
322
- }, [
323
- checkedProps.value.label ? (openBlock(), createElementBlock("h2", _hoisted_2, toDisplayString(checkedProps.value.label), 1)) : createCommentVNode("v-if", true),
324
- _cache[0] || (_cache[0] = createTextVNode(toDisplayString(" "), -1)),
325
- createElementVNode("button", {
326
- class: "close",
327
- type: "button",
328
- "aria-label": "Close",
329
- "data-hn-ui-dialog": "",
330
- ref_key: "closeElement",
331
- ref: closeElement
332
- }, null, 512)
333
- ], 512),
328
+ }, [checkedProps.value.label ? (openBlock(), createElementBlock("h2", _hoisted_2, toDisplayString(checkedProps.value.label), 1)) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_3, [createVNode(UiIconButton_default, {
329
+ class: "ui-icon-button",
330
+ size: "sm",
331
+ round: true,
332
+ label: "Close",
333
+ ref_key: "closeElement",
334
+ ref: closeElement
335
+ }, {
336
+ default: withCtx(() => [createVNode(UiIcon_default, {
337
+ class: "ui-icon",
338
+ name: "x"
339
+ })]),
340
+ _: 1
341
+ }, 512)])], 512),
334
342
  createElementVNode("div", {
335
343
  class: "body",
336
344
  "data-hn-ui-dialog": "",
@@ -354,6 +362,6 @@ var UiDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
354
362
  }]]);
355
363
  };
356
364
  }
357
- }), [["__scopeId", "data-v-6cfda64d"]]);
365
+ }), [["__scopeId", "data-v-45428506"]]);
358
366
  //#endregion
359
367
  export { UiDialog_default as t };