@threadlabs/looma 0.39.2 → 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.
package/vue/UiDialog.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { PropType } from 'vue';
2
2
  import { type InputBindings } from './props.js';
3
- declare var __VLS_7: {}, __VLS_9: {};
3
+ declare var __VLS_20: {}, __VLS_22: {};
4
4
  type __VLS_Slots = {} & {
5
- default?: (props: typeof __VLS_7) => any;
5
+ default?: (props: typeof __VLS_20) => any;
6
6
  } & {
7
- actions?: (props: typeof __VLS_9) => any;
7
+ actions?: (props: typeof __VLS_22) => any;
8
8
  };
9
9
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
10
  alert: {
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;
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);
@@ -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 };
@@ -704,6 +704,6 @@ var UiInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
704
704
  }]]);
705
705
  };
706
706
  }
707
- }), [["__scopeId", "data-v-d1d52f1a"]]);
707
+ }), [["__scopeId", "data-v-a7bff040"]]);
708
708
  //#endregion
709
709
  export { UiInput_default as t };
@@ -220,6 +220,6 @@ var UiInputGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
220
220
  }]]);
221
221
  };
222
222
  }
223
- }), [["__scopeId", "data-v-6e5b8e59"]]);
223
+ }), [["__scopeId", "data-v-5717ef0c"]]);
224
224
  //#endregion
225
225
  export { UiInputGroup_default as t };
@@ -246,6 +246,6 @@ var UiSelect_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
246
246
  }]]);
247
247
  };
248
248
  }
249
- }), [["__scopeId", "data-v-988e4463"]]);
249
+ }), [["__scopeId", "data-v-aa155548"]]);
250
250
  //#endregion
251
251
  export { UiSelect_default as t };