@threadlabs/looma 0.47.2 → 0.47.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.
@@ -19,10 +19,26 @@
19
19
  >The native element the card renders. Choose the one that names the content: a section of a page, a self-contained article, or an aside.</prop>
20
20
  </defs>
21
21
  <template $match>
22
- <section $when="$as = 'section'"><slot></slot></section>
23
- <article $when="$as = 'article'"><slot></slot></article>
24
- <aside $when="$as = 'aside'"><slot></slot></aside>
25
- <div $else><slot></slot></div>
22
+ <section $when="$as = 'section'">
23
+ <div class="header"><slot name="header"></slot></div>
24
+ <div class="content"><slot></slot></div>
25
+ <div class="actions"><slot name="actions"></slot></div>
26
+ </section>
27
+ <article $when="$as = 'article'">
28
+ <div class="header"><slot name="header"></slot></div>
29
+ <div class="content"><slot></slot></div>
30
+ <div class="actions"><slot name="actions"></slot></div>
31
+ </article>
32
+ <aside $when="$as = 'aside'">
33
+ <div class="header"><slot name="header"></slot></div>
34
+ <div class="content"><slot></slot></div>
35
+ <div class="actions"><slot name="actions"></slot></div>
36
+ </aside>
37
+ <div $else>
38
+ <div class="header"><slot name="header"></slot></div>
39
+ <div class="content"><slot></slot></div>
40
+ <div class="actions"><slot name="actions"></slot></div>
41
+ </div>
26
42
  </template>
27
43
  <style>
28
44
  /* A surface that groups content. Its children stack with even space between them, so a card
@@ -34,7 +50,11 @@
34
50
  --_ui-selection-context-surface: initial;
35
51
  --_ui-selection-context-border: initial;
36
52
  --_ui-selection-context-text: initial;
37
- display: flex !important;
53
+ --_ui-card-layout: var(--_ui-card-group-layout, flex);
54
+ --_ui-card-region-layout: var(--_ui-card-group-region-layout, contents);
55
+ display: var(--_ui-card-layout) !important;
56
+ grid-template-rows: var(--_ui-card-group-rows, none) !important;
57
+ grid-row: var(--_ui-card-group-span, auto) !important;
38
58
  flex-direction: column !important;
39
59
  gap: var(--ui-space-4) !important;
40
60
  box-sizing: border-box !important;
@@ -46,6 +66,20 @@
46
66
  color: var(--_ui-surface-text, var(--ui-text-primary));
47
67
  }
48
68
 
69
+ .header,
70
+ .content,
71
+ .actions {
72
+ display: var(--_ui-card-region-layout) !important;
73
+ flex-direction: column !important;
74
+ gap: inherit !important;
75
+ min-inline-size: 0;
76
+ /* Group context stops at this card; nested cards start a fresh layout. */
77
+ --_ui-card-group-layout: initial;
78
+ --_ui-card-group-rows: initial;
79
+ --_ui-card-group-span: initial;
80
+ --_ui-card-group-region-layout: initial;
81
+ }
82
+
49
83
  :host([padding="xs"]) {
50
84
  gap: var(--ui-space-1) !important;
51
85
  padding: var(--ui-space-2) !important;
@@ -0,0 +1,29 @@
1
+ <link rel="component" href="../ui-grid/ui-grid.html">
2
+ <link rel="component" href="../ui-card/ui-card.html">
3
+ <template component="ui-card-group">
4
+ <defs>
5
+ <prop name="gap" type="keyword" values="xs, s, m, l, xl" default="l"
6
+ >Space between cards, using Grid’s spacing scale. Grid’s public --ui-grid-gap custom property also applies.</prop>
7
+ <prop name="min" type="keyword" values="sm, md, lg" default="lg"
8
+ >Minimum card column width: sm is 12rem, md 16rem and lg 20rem. A narrower container still fits one column.</prop>
9
+ <prop name="columns" type="integer">Maximum columns when there is room. Omit for no cap; cards wrap as the container narrows.</prop>
10
+ </defs>
11
+ <div>
12
+ <ui-grid from:gap="$gap" from:min="$min" from:columns="$columns"><slot></slot></ui-grid>
13
+ </div>
14
+ <style>
15
+ /* Grid owns columns and spacing; Card owns its surface and three aligned regions. */
16
+ :host {
17
+ display: block !important;
18
+ min-inline-size: 0;
19
+ max-inline-size: 100%;
20
+ --_ui-card-group-layout: grid;
21
+ --_ui-card-group-rows: subgrid;
22
+ --_ui-card-group-span: span 3;
23
+ --_ui-card-group-region-layout: flex;
24
+ }
25
+ :host[hidden] {
26
+ display: none !important;
27
+ }
28
+ </style>
29
+ </template>
@@ -895,7 +895,8 @@
895
895
  /* Grow through the requested rows, then keep the typing row in a bounded field.
896
896
  The entry owns its scroll; clear/disclosure actions remain outside it. */
897
897
  :host([multiple]) .entry.multiline {
898
- --_entry-row: max(var(--ui-badge-min-block-size, 1.5rem), var(--_item-row));
898
+ /* The field owns its nominal row size; nested badges keep their own sizing hooks. */
899
+ --_entry-row: max(1.5rem, var(--_item-row));
899
900
  flex-wrap: wrap !important;
900
901
  align-content: flex-start !important;
901
902
  max-block-size: calc(var(--_max-rows) * var(--_entry-row) + (var(--_max-rows) - 1) * var(--ui-space-1));
@@ -71,23 +71,25 @@
71
71
  justify-items: center !important;
72
72
  margin-inline-start: auto !important;
73
73
  }
74
- /* Text shares a baseline inside one group; the group is centred beside any control height. */
74
+ /* Brand, navigation and actions centre their own containers, including mixed font sizes. */
75
75
  .identity {
76
76
  display: flex !important;
77
77
  flex: 1 1 0;
78
78
  flex-wrap: wrap !important;
79
- align-items: baseline !important;
79
+ align-items: center !important;
80
80
  gap: var(--ui-space-2) var(--ui-space-6) !important;
81
81
  min-inline-size: 0;
82
82
  }
83
83
  .brand {
84
+ display: flex !important;
85
+ align-items: center !important;
84
86
  min-inline-size: 0;
85
87
  font-size: var(--ui-font-size-lg);
86
88
  font-weight: var(--ui-font-bold);
87
89
  }
88
90
  .brand > :slotted(a) {
89
91
  display: inline-flex !important;
90
- align-items: baseline !important;
92
+ align-items: center !important;
91
93
  gap: var(--ui-space-3) !important;
92
94
  min-inline-size: 0;
93
95
  max-inline-size: 100%;
@@ -97,7 +99,7 @@
97
99
  .navigation {
98
100
  display: flex !important;
99
101
  flex-wrap: wrap !important;
100
- align-items: baseline !important;
102
+ align-items: center !important;
101
103
  gap: var(--ui-space-2) var(--ui-space-5) !important;
102
104
  min-inline-size: 0;
103
105
  font-size: var(--ui-font-size-sm);
@@ -139,7 +141,7 @@
139
141
  .inline-navigation {
140
142
  position: static;
141
143
  display: flex !important;
142
- align-items: baseline !important;
144
+ align-items: center !important;
143
145
  min-inline-size: 0;
144
146
  max-inline-size: none;
145
147
  margin: 0 !important;