@threadlabs/looma 0.47.1 → 0.47.2

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 (110) hide show
  1. package/components/ui-combobox/ui-combobox.html +23 -4
  2. package/components/ui-combobox/ui-combobox.js +6 -0
  3. package/components/ui-top-bar/ui-top-bar.html +32 -2
  4. package/components/ui-top-bar/ui-top-bar.js +60 -0
  5. package/dist/index.js +4 -3
  6. package/docs/catalog.json +66 -3
  7. package/package.json +1 -1
  8. package/styles/ui-combobox.css +40 -6
  9. package/styles/ui-top-bar.css +24 -1
  10. package/vanilla/UiCombobox.d.ts +1 -0
  11. package/vanilla/UiCombobox.js +88 -82
  12. package/vanilla/UiTopBar.d.ts +1 -0
  13. package/vanilla/UiTopBar.js +50 -13
  14. package/vue/UiCombobox.d.ts +6 -0
  15. package/vue/UiCombobox.vue +76 -9
  16. package/vue/UiTopBar.d.ts +17 -1
  17. package/vue/UiTopBar.vue +171 -3
  18. package/vue/chunks/UiAffordanceScope.js +1 -1
  19. package/vue/chunks/UiAvatar.js +1 -1
  20. package/vue/chunks/UiAvatarGroup.js +1 -1
  21. package/vue/chunks/UiBadge.js +1 -1
  22. package/vue/chunks/UiBreadcrumbItem.js +1 -1
  23. package/vue/chunks/UiBreadcrumbs.js +1 -1
  24. package/vue/chunks/UiButton.js +1 -1
  25. package/vue/chunks/UiCallout.js +1 -1
  26. package/vue/chunks/UiCard.js +1 -1
  27. package/vue/chunks/UiCheckbox.js +1 -1
  28. package/vue/chunks/UiCluster.js +1 -1
  29. package/vue/chunks/UiColorPicker.js +1 -1
  30. package/vue/chunks/UiCombobox.js +74 -53
  31. package/vue/chunks/UiContainer.js +1 -1
  32. package/vue/chunks/UiContextMenu.js +1 -1
  33. package/vue/chunks/UiCover.js +1 -1
  34. package/vue/chunks/UiCurveEditor.js +1 -1
  35. package/vue/chunks/UiCycleButton.js +1 -1
  36. package/vue/chunks/UiDescriptionItem.js +1 -1
  37. package/vue/chunks/UiDescriptionList.js +1 -1
  38. package/vue/chunks/UiDialog.js +1 -1
  39. package/vue/chunks/UiDisclosure.js +1 -1
  40. package/vue/chunks/UiEditable.js +1 -1
  41. package/vue/chunks/UiEditorBlockActions.js +1 -1
  42. package/vue/chunks/UiEditorChipEditor.js +1 -1
  43. package/vue/chunks/UiEditorCodeLanguage.js +1 -1
  44. package/vue/chunks/UiEditorFootnoteEditor.js +1 -1
  45. package/vue/chunks/UiEditorImageToolbar.js +1 -1
  46. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  47. package/vue/chunks/UiEditorLinkCard.js +1 -1
  48. package/vue/chunks/UiEditorLinkForm.js +1 -1
  49. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  50. package/vue/chunks/UiEditorMentionMenuItem.js +1 -1
  51. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  52. package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
  53. package/vue/chunks/UiEditorSlashMenuItem.js +1 -1
  54. package/vue/chunks/UiEditorSurface.js +1 -1
  55. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  56. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  57. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  58. package/vue/chunks/UiEditorToolbar.js +1 -1
  59. package/vue/chunks/UiFloatingActionButton.js +1 -1
  60. package/vue/chunks/UiFormField.js +1 -1
  61. package/vue/chunks/UiGrid.js +1 -1
  62. package/vue/chunks/UiIcon.js +1 -1
  63. package/vue/chunks/UiIconButton.js +1 -1
  64. package/vue/chunks/UiImage.js +1 -1
  65. package/vue/chunks/UiInput.js +1 -1
  66. package/vue/chunks/UiInputGroup.js +1 -1
  67. package/vue/chunks/UiLightEditor.js +1 -1
  68. package/vue/chunks/UiList.js +1 -1
  69. package/vue/chunks/UiListItem.js +1 -1
  70. package/vue/chunks/UiListbox.js +1 -1
  71. package/vue/chunks/UiMenu.js +1 -1
  72. package/vue/chunks/UiMenuGroup.js +1 -1
  73. package/vue/chunks/UiMenuItem.js +1 -1
  74. package/vue/chunks/UiMeter.js +1 -1
  75. package/vue/chunks/UiNavItem.js +1 -1
  76. package/vue/chunks/UiNumberInput.js +1 -1
  77. package/vue/chunks/UiPageHeader.js +1 -1
  78. package/vue/chunks/UiPagination.js +1 -1
  79. package/vue/chunks/UiPopover.js +1 -1
  80. package/vue/chunks/UiRadio.js +1 -1
  81. package/vue/chunks/UiRadioGroup.js +1 -1
  82. package/vue/chunks/UiReel.js +1 -1
  83. package/vue/chunks/UiScrollArea.js +1 -1
  84. package/vue/chunks/UiSearchResultRow.js +1 -1
  85. package/vue/chunks/UiSearchShell.js +1 -1
  86. package/vue/chunks/UiSection.js +1 -1
  87. package/vue/chunks/UiSelect.js +1 -1
  88. package/vue/chunks/UiSeparator.js +1 -1
  89. package/vue/chunks/UiSidebar.js +1 -1
  90. package/vue/chunks/UiSiteHeader.js +1 -1
  91. package/vue/chunks/UiSkeleton.js +1 -1
  92. package/vue/chunks/UiSlider.js +1 -1
  93. package/vue/chunks/UiSpinner.js +1 -1
  94. package/vue/chunks/UiStack.js +1 -1
  95. package/vue/chunks/UiStatusMessage.js +1 -1
  96. package/vue/chunks/UiSwatch.js +1 -1
  97. package/vue/chunks/UiSwitch.js +1 -1
  98. package/vue/chunks/UiSwitcher.js +1 -1
  99. package/vue/chunks/UiTable.js +1 -1
  100. package/vue/chunks/UiTabs.js +1 -1
  101. package/vue/chunks/UiText.js +1 -1
  102. package/vue/chunks/UiTextarea.js +1 -1
  103. package/vue/chunks/UiToast.js +1 -1
  104. package/vue/chunks/UiToastRegion.js +1 -1
  105. package/vue/chunks/UiTooltip.js +1 -1
  106. package/vue/chunks/UiTopBar.js +105 -17
  107. package/vue/chunks/UiTree.js +1 -1
  108. package/vue/chunks/UiTreeItem.js +1 -1
  109. package/vue/chunks/props.js +1 -1
  110. package/vue/components.css +65 -8
package/docs/catalog.json CHANGED
@@ -463,7 +463,7 @@
463
463
  ],
464
464
  "schemaVersion": 1,
465
465
  "package": "@threadlabs/looma",
466
- "version": "0.47.1",
466
+ "version": "0.47.2",
467
467
  "groups": [
468
468
  {
469
469
  "id": "layout",
@@ -5261,6 +5261,12 @@
5261
5261
  {
5262
5262
  "name": "--ui-accent-solid"
5263
5263
  },
5264
+ {
5265
+ "name": "--ui-badge-min-block-size",
5266
+ "fallbacks": [
5267
+ "1.5rem"
5268
+ ]
5269
+ },
5264
5270
  {
5265
5271
  "name": "--ui-border-default"
5266
5272
  },
@@ -5631,6 +5637,13 @@
5631
5637
  "type": "boolean",
5632
5638
  "default": false
5633
5639
  },
5640
+ {
5641
+ "name": "max-rows",
5642
+ "property": "maxRows",
5643
+ "description": "Visible rows of selected items and typing space in multiple mode. More than one lets the field grow and wrap before extra rows scroll vertically inside it. One or less keeps the single horizontally scrolling row; single-selection fields are unchanged.",
5644
+ "type": "integer",
5645
+ "default": 1
5646
+ },
5634
5647
  {
5635
5648
  "name": "multiple",
5636
5649
  "property": "multiple",
@@ -5880,6 +5893,12 @@
5880
5893
  "type": "boolean",
5881
5894
  "default": false
5882
5895
  },
5896
+ {
5897
+ "name": "maxRows",
5898
+ "description": "Visible rows of selected items and typing space in multiple mode. More than one lets the field grow and wrap before extra rows scroll vertically inside it. One or less keeps the single horizontally scrolling row; single-selection fields are unchanged.",
5899
+ "type": "number",
5900
+ "default": 1
5901
+ },
5883
5902
  {
5884
5903
  "name": "multiple",
5885
5904
  "description": "Lets the user choose several options. Each choice becomes a removable badge before the input, the list stays open between picks, and choosing a checked option removes it. items-change then reports the whole list of items, and selected-values-change the list of their values; use selectedValues or items, not value, in this mode.",
@@ -6835,6 +6854,16 @@
6835
6854
  "resizable": false,
6836
6855
  "bindings": "",
6837
6856
  "frameworks": {}
6857
+ },
6858
+ {
6859
+ "id": "@threadlabs/looma/ui-combobox/08-multiple-rows",
6860
+ "name": "08-multiple-rows",
6861
+ "title": "Wrap selected items before scrolling",
6862
+ "description": "maxRows lets a multiple field grow through three rows before additional selections scroll vertically inside the field. The input remains reachable by keyboard.",
6863
+ "markup": "<ui-container fill>\n <ui-combobox label=\"Topics\" multiple max-rows=\"3\" disclosure placeholder=\"Add a topic…\">\n <option value=\"research\" selected>Research and discovery</option>\n <option value=\"design\" selected>Interface design</option>\n <option value=\"content\" selected>Content strategy</option>\n <option value=\"accessibility\" selected>Accessibility review</option>\n <option value=\"delivery\">Delivery</option>\n </ui-combobox>\n</ui-container>",
6864
+ "resizable": false,
6865
+ "bindings": "",
6866
+ "frameworks": {}
6838
6867
  }
6839
6868
  ]
6840
6869
  },
@@ -22480,9 +22509,18 @@
22480
22509
  {
22481
22510
  "name": "--ui-border-width"
22482
22511
  },
22512
+ {
22513
+ "name": "--ui-motion-ease"
22514
+ },
22515
+ {
22516
+ "name": "--ui-motion-fast"
22517
+ },
22483
22518
  {
22484
22519
  "name": "--ui-space-1"
22485
22520
  },
22521
+ {
22522
+ "name": "--ui-space-2"
22523
+ },
22486
22524
  {
22487
22525
  "name": "--ui-space-3"
22488
22526
  },
@@ -22494,8 +22532,23 @@
22494
22532
  }
22495
22533
  ]
22496
22534
  },
22497
- "attributes": [],
22498
- "properties": [],
22535
+ "attributes": [
22536
+ {
22537
+ "name": "title-for",
22538
+ "property": "titleFor",
22539
+ "description": "The ID of the page heading represented by the default title slot. While that heading is visible below the sticky bar, its duplicate title is concealed. After the heading scrolls above the bar, the single-line title slides up and fades in. Leading and action slots stay available, and the bar keeps its size. Omit it for an always-visible title. Reduced motion removes the transition.",
22540
+ "type": "string",
22541
+ "default": ""
22542
+ }
22543
+ ],
22544
+ "properties": [
22545
+ {
22546
+ "name": "titleFor",
22547
+ "description": "The ID of the page heading represented by the default title slot. While that heading is visible below the sticky bar, its duplicate title is concealed. After the heading scrolls above the bar, the single-line title slides up and fades in. Leading and action slots stay available, and the bar keeps its size. Omit it for an always-visible title. Reduced motion removes the transition.",
22548
+ "type": "string",
22549
+ "default": ""
22550
+ }
22551
+ ],
22499
22552
  "events": [],
22500
22553
  "slots": [
22501
22554
  {
@@ -22544,6 +22597,16 @@
22544
22597
  "resizable": false,
22545
22598
  "bindings": "",
22546
22599
  "frameworks": {}
22600
+ },
22601
+ {
22602
+ "id": "@threadlabs/looma/ui-top-bar/02-scroll-title",
22603
+ "name": "02-scroll-title",
22604
+ "title": "Reveal the title after its heading",
22605
+ "description": "Scroll the document past its heading. The sticky title slides up and fades in once the heading leaves the visible reading area, and disappears when the heading returns. Reduced motion removes that transition.",
22606
+ "markup": "<ui-stack height=\"256\" gap=\"none\">\n <ui-scroll-area fill>\n <ui-top-bar title-for=\"top-bar-example-heading\">\n <ui-button slot=\"leading\" size=\"sm\">Back</ui-button>\n A document with a long descriptive title\n <ui-button slot=\"actions\" size=\"sm\">Save</ui-button>\n </ui-top-bar>\n <ui-container fill>\n <ui-stack gap=\"m\">\n <ui-text as=\"h2\" variant=\"heading\" id=\"top-bar-example-heading\">A document with a long descriptive title</ui-text>\n <ui-text>The heading labels the document while it is visible. Navigation and actions stay available.</ui-text>\n <ui-text>Scroll to keep reading the document and its supporting notes.</ui-text>\n <ui-text>The toolbar keeps the same height as the heading leaves the reading area.</ui-text>\n <ui-text>Return to the beginning to show the full heading again.</ui-text>\n <ui-text>The duplicate toolbar title is concealed while the heading is visible.</ui-text>\n </ui-stack>\n </ui-container>\n </ui-scroll-area>\n</ui-stack>",
22607
+ "resizable": false,
22608
+ "bindings": "",
22609
+ "frameworks": {}
22547
22610
  }
22548
22611
  ]
22549
22612
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.47.1",
3
+ "version": "0.47.2",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -283,6 +283,7 @@
283
283
  /* Multiple mode keeps one control height. Chips and the input scroll within the entry,
284
284
  while the clear and disclosure controls remain fixed at the end of the field. */
285
285
  :scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"] .field {
286
+ --_item-row: 1.75rem;
286
287
  align-items: center !important;
287
288
  min-block-size: var(--_ui-combobox-item-min-block-size, var(--_row));
288
289
  padding: var(--ui-space-1) !important;
@@ -300,24 +301,39 @@
300
301
  max-block-size: none;
301
302
  flex: 1 0 var(--_ui-combobox-item-input-min-inline-size, 5rem);
302
303
  width: auto;
303
- min-block-size: 1.75rem;
304
+ min-block-size: var(--_item-row);
304
305
  padding: var(--ui-space-0-5) var(--ui-space-1) !important;
305
306
  }
306
307
  /* Size variants keep their control height as selections are added. */
307
308
  :scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"]:scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="size=sm"] .field {
309
+ --_item-row: calc(var(--_row) - 2 * var(--ui-border-width) - 2 * var(--ui-space-0-5));
308
310
  min-block-size: 0;
309
311
  padding: var(--ui-space-0-5) !important;
310
312
  }
311
313
  :scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"]:scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="size=sm"] input {
312
- min-block-size: calc(var(--_row) - 2 * var(--ui-border-width) - 2 * var(--ui-space-0-5));
314
+ min-block-size: var(--_item-row);
313
315
  padding: 0 var(--ui-space-1) !important;
314
316
  }
315
317
  /* A large multiple field starts at the large control height, as sm starts at the small one. */
316
318
  :scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"]:scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="size=lg"] .field {
319
+ --_item-row: calc(var(--ui-control-size-lg) - 2 * var(--ui-border-width) - 2 * var(--ui-space-1));
317
320
  min-block-size: 0;
318
321
  }
319
322
  :scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"]:scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="size=lg"] input {
320
- min-block-size: calc(var(--ui-control-size-lg) - 2 * var(--ui-border-width) - 2 * var(--ui-space-1));
323
+ min-block-size: var(--_item-row);
324
+ }
325
+ /* Grow through the requested rows, then keep the typing row in a bounded field.
326
+ The entry owns its scroll; clear/disclosure actions remain outside it. */
327
+ :scope:where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"] .entry.multiline {
328
+ --_entry-row: max(var(--ui-badge-min-block-size, 1.5rem), var(--_item-row));
329
+ flex-wrap: wrap !important;
330
+ align-content: flex-start !important;
331
+ max-block-size: calc(var(--_max-rows) * var(--_entry-row) + (var(--_max-rows) - 1) * var(--ui-space-1));
332
+ overflow-x: hidden;
333
+ overflow-y: auto;
334
+ }
335
+ .entry.multiline .item {
336
+ min-block-size: var(--_entry-row);
321
337
  }
322
338
  .item {
323
339
  appearance: none;
@@ -361,6 +377,8 @@
361
377
  while the clear and disclosure controls remain fixed at the end of the field. */
362
378
  /* Size variants keep their control height as selections are added. */
363
379
  /* A large multiple field starts at the large control height, as sm starts at the small one. */
380
+ /* Grow through the requested rows, then keep the typing row in a bounded field.
381
+ The entry owns its scroll; clear/disclosure actions remain outside it. */
364
382
 
365
383
  /* A component that sets its display still honours the hidden attribute on its root. */
366
384
  }
@@ -638,6 +656,7 @@
638
656
  /* Multiple mode keeps one control height. Chips and the input scroll within the entry,
639
657
  while the clear and disclosure controls remain fixed at the end of the field. */
640
658
  :where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"] .field:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-combobox"]))) {
659
+ --_item-row: 1.75rem;
641
660
  align-items: center !important;
642
661
  min-block-size: var(--_ui-combobox-item-min-block-size, var(--_row));
643
662
  padding: var(--ui-space-1) !important;
@@ -655,24 +674,39 @@
655
674
  max-block-size: none;
656
675
  flex: 1 0 var(--_ui-combobox-item-input-min-inline-size, 5rem);
657
676
  width: auto;
658
- min-block-size: 1.75rem;
677
+ min-block-size: var(--_item-row);
659
678
  padding: var(--ui-space-0-5) var(--ui-space-1) !important;
660
679
  }
661
680
  /* Size variants keep their control height as selections are added. */
662
681
  :where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"]:where([data-component~="ui-combobox"])[data-ui-combobox-state~="size=sm"] .field:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-combobox"]))) {
682
+ --_item-row: calc(var(--_row) - 2 * var(--ui-border-width) - 2 * var(--ui-space-0-5));
663
683
  min-block-size: 0;
664
684
  padding: var(--ui-space-0-5) !important;
665
685
  }
666
686
  :where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"]:where([data-component~="ui-combobox"])[data-ui-combobox-state~="size=sm"] input:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-combobox"]))) {
667
- min-block-size: calc(var(--_row) - 2 * var(--ui-border-width) - 2 * var(--ui-space-0-5));
687
+ min-block-size: var(--_item-row);
668
688
  padding: 0 var(--ui-space-1) !important;
669
689
  }
670
690
  /* A large multiple field starts at the large control height, as sm starts at the small one. */
671
691
  :where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"]:where([data-component~="ui-combobox"])[data-ui-combobox-state~="size=lg"] .field:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-combobox"]))) {
692
+ --_item-row: calc(var(--ui-control-size-lg) - 2 * var(--ui-border-width) - 2 * var(--ui-space-1));
672
693
  min-block-size: 0;
673
694
  }
674
695
  :where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"]:where([data-component~="ui-combobox"])[data-ui-combobox-state~="size=lg"] input:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-combobox"]))) {
675
- min-block-size: calc(var(--ui-control-size-lg) - 2 * var(--ui-border-width) - 2 * var(--ui-space-1));
696
+ min-block-size: var(--_item-row);
697
+ }
698
+ /* Grow through the requested rows, then keep the typing row in a bounded field.
699
+ The entry owns its scroll; clear/disclosure actions remain outside it. */
700
+ :where([data-component~="ui-combobox"])[data-ui-combobox-state~="multiple"] .entry.multiline:where(:scope, :not([data-component], [data-slotted]:not([data-slotted~="ui-combobox"]))) {
701
+ --_entry-row: max(var(--ui-badge-min-block-size, 1.5rem), var(--_item-row));
702
+ flex-wrap: wrap !important;
703
+ align-content: flex-start !important;
704
+ max-block-size: calc(var(--_max-rows) * var(--_entry-row) + (var(--_max-rows) - 1) * var(--ui-space-1));
705
+ overflow-x: hidden;
706
+ overflow-y: auto;
707
+ }
708
+ .entry.multiline:where(:scope, :scope *) .item {
709
+ min-block-size: var(--_entry-row);
676
710
  }
677
711
  .item:where(:scope, :scope *) {
678
712
  appearance: none;
@@ -41,6 +41,26 @@
41
41
  min-inline-size: 0;
42
42
  flex: 1;
43
43
  }
44
+ .title.scroll-title {
45
+ overflow: hidden;
46
+ white-space: nowrap;
47
+ text-overflow: ellipsis;
48
+ opacity: 1;
49
+ transform: translateY(0);
50
+ transition: opacity var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease);
51
+ }
52
+ .title.scroll-title.concealed {
53
+ opacity: 0;
54
+ transform: translateY(var(--ui-space-2));
55
+ pointer-events: none;
56
+ }
57
+ @media (prefers-reduced-motion: reduce) {
58
+ .title.scroll-title,
59
+ .title.scroll-title.concealed {
60
+ transition: none;
61
+ transform: none;
62
+ }
63
+ }
44
64
 
45
65
  /* An unused region takes no space, so it adds no gap. */
46
66
  .leading:empty,
@@ -55,7 +75,10 @@
55
75
  }
56
76
  }
57
77
  @scope ([data-component~="ui-top-bar"]) to ([data-component]) {
58
- /* An unused region takes no space, so it adds no gap. */
78
+ @media (prefers-reduced-motion: reduce) {
79
+ }
80
+
81
+ /* An unused region takes no space, so it adds no gap. */
59
82
 
60
83
  /* A component that sets its display still honours the hidden attribute on its root. */
61
84
  }
@@ -35,6 +35,7 @@ export interface UiComboboxProps {
35
35
  label?: string | null;
36
36
  labelVisibility?: "visible" | "sr-only" | null;
37
37
  loading?: boolean | null;
38
+ maxRows?: number | null;
38
39
  multiple?: boolean | null;
39
40
  muted?: boolean | null;
40
41
  name?: string | null;