@brickclay-org/ui 0.1.76 → 0.1.78

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickclay-org/ui",
3
- "version": "0.1.76",
3
+ "version": "0.1.78",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "ng-add": {
6
6
  "save": "dependencies"
@@ -6,9 +6,10 @@
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  overflow-y: auto;
9
+ max-height: 225px;
9
10
  }
10
11
 
11
- @media (max-height: 700px) {
12
+ /* @media (max-height: 700px) {
12
13
  .column-select-options-list {
13
14
  max-height: 125px;
14
15
  }
@@ -24,4 +25,4 @@
24
25
  .column-select-options-list {
25
26
  max-height: 210px;
26
27
  }
27
- }
28
+ } */
@@ -16,7 +16,7 @@
16
16
  }
17
17
 
18
18
  .hierarchical-select-control.disabled {
19
- @apply cursor-not-allowed opacity-60;
19
+ @apply cursor-not-allowed;
20
20
  /* !important beats the inline accent (showDots): a disabled control must read
21
21
  as disabled even when a node's colour is applied. */
22
22
  background-color: #f4f4f6 !important;
@@ -164,6 +164,16 @@
164
164
  @apply flex-shrink-0 text-[#141414];
165
165
  }
166
166
 
167
+ /* Selects the parent; the rest of the row still navigates into it. */
168
+ .hierarchical-option-checkbox {
169
+ @apply flex-shrink-0 flex items-center cursor-pointer;
170
+ }
171
+
172
+ /* Matches the sm checkbox (16px) so childless rows keep the column aligned. */
173
+ .hierarchical-option-checkbox-spacer {
174
+ @apply flex-shrink-0 w-4;
175
+ }
176
+
167
177
  .hierarchical-option-empty {
168
178
  @apply px-3 py-2 text-gray-400 cursor-default text-sm;
169
179
  }
@@ -258,3 +258,91 @@
258
258
  .input-container ::-webkit-scrollbar-thumb:hover {
259
259
  background: #909090;
260
260
  }
261
+
262
+ /* ============================== Compact / sm size ============================== */
263
+ .input-container--sm .input-label {
264
+ @apply text-xs;
265
+ }
266
+
267
+ .input-container--sm .input-hint,
268
+ .input-container--sm .input-error {
269
+ @apply text-[11px];
270
+ }
271
+
272
+ .input-container--sm .input-field {
273
+ @apply py-1.5 px-2.5 text-xs;
274
+ height: 32px;
275
+ }
276
+
277
+ .input-container--sm .input-field--icon,
278
+ .input-container--sm .input-field--icon-left {
279
+ @apply pl-8;
280
+ }
281
+
282
+ .input-container--sm .input-field--icon-right {
283
+ @apply pr-8;
284
+ }
285
+
286
+ .input-container--sm .input-field--password {
287
+ @apply pr-8;
288
+ }
289
+
290
+ .input-container--sm .input-field--phone {
291
+ @apply pl-16;
292
+ }
293
+
294
+ .input-container--sm .input-field--url {
295
+ @apply pl-16;
296
+ }
297
+
298
+ .input-container--sm .input-field--icon.input-field--url {
299
+ @apply pl-24;
300
+ }
301
+
302
+ .input-container--sm .input-field--phone.input-field--icon {
303
+ @apply pl-24;
304
+ }
305
+
306
+ .input-container--sm .input-search-icon {
307
+ @apply w-4 h-4;
308
+ }
309
+
310
+ .input-container--sm .input-search-icon--left {
311
+ @apply left-2;
312
+ }
313
+
314
+ .input-container--sm .input-search-icon--right {
315
+ @apply right-2;
316
+ }
317
+
318
+ .input-container--sm .input-password-toggle {
319
+ @apply right-2 w-4 h-4;
320
+ }
321
+
322
+ .input-container--sm .input-password-icon {
323
+ @apply w-4 h-4;
324
+ }
325
+
326
+ .input-container--sm .input-phone-selector {
327
+ @apply px-2;
328
+ }
329
+
330
+ .input-container--sm .input-phone-selector-text {
331
+ @apply text-[11px];
332
+ }
333
+
334
+ .input-container--sm .input-url-prefix {
335
+ @apply py-1.5 px-2.5 text-xs;
336
+ }
337
+
338
+ .input-container--sm .input-phone-dropdown {
339
+ @apply w-[68px] mt-0.5;
340
+ }
341
+
342
+ .input-container--sm .input-phone-dropdown-item {
343
+ @apply px-3 py-1.5 text-[11px];
344
+ }
345
+
346
+ .input-container--sm .input-phone-selector-arrow {
347
+ @apply w-3 h-3;
348
+ }
@@ -7,6 +7,12 @@
7
7
 
8
8
  .bk-menu {
9
9
  --menu-bg: #ffffff;
10
+ /* Lightest gray — opt-in tint for an inline submenu's whole block (title +
11
+ rows) via [submenuBackground]="true". One shade lighter than
12
+ --menu-hover-bg, so a hovered row inside it still reads. Popups don't
13
+ offer this: their padding/insets differ, and the panel's own border
14
+ already sets it apart from the page. */
15
+ --menu-submenu-bg: #f8f8f8;
10
16
  --menu-text: #141414;
11
17
  --menu-subtext: #6b7080;
12
18
  --menu-hover-bg: #edeef0;
@@ -18,11 +24,57 @@
18
24
  --menu-radius: 8px;
19
25
  --menu-disabled: 0.5;
20
26
 
27
+ /* Metrics — the compact variant below is nothing but a second set of these. */
28
+ --menu-font-size: 14px;
29
+ --menu-tracking: -0.28px;
30
+ --menu-pad-y: 10px;
31
+ /* Submenu rows (inline and pop-up) sit a touch tighter vertically than
32
+ top-level rows. */
33
+ --menu-submenu-pad-y: 8px;
34
+ --menu-pad-x: 12px;
35
+ --menu-gap: 8px;
36
+ --menu-icon-size: 16px;
37
+ --menu-chevron-size: 16px;
38
+ --menu-group-font-size: 11px;
39
+ /* How far a group title sits left of the rows it heads. */
40
+ --menu-title-outdent: 8px;
41
+ --menu-popup-pad: 4px;
42
+ /* Top/bottom inset for the pop-up panel — roomier than the horizontal pad
43
+ so the first/last row don't sit flush against the panel's rounded edge. */
44
+ --menu-popup-pad-y: 8px;
45
+ /* Horizontal padding for a pop-up's own rows and group-title label — wider
46
+ than the shared --menu-pad-x so pop-up text sits roomier than inline. */
47
+ --menu-popup-item-pad-x: 16px;
48
+ --menu-popup-min-w: 200px;
49
+ --menu-popup-max-w: 280px;
50
+
21
51
  /* Safe to clip to rounded corners: pop-up fly-outs are position:fixed and
22
52
  escape this box entirely, so nothing gets cut off. */
23
- @apply block w-full max-w-full text-sm font-medium tracking-[-0.28px]
53
+ @apply block w-full max-w-full font-medium
24
54
  bg-[var(--menu-bg)] text-[color:var(--menu-text)]
25
55
  border border-[var(--menu-border)] rounded-[var(--menu-radius)] overflow-hidden;
56
+ font-size: var(--menu-font-size);
57
+ letter-spacing: var(--menu-tracking);
58
+ }
59
+
60
+ /* ---- Compact variant: same menu, tighter type and spacing. ---- */
61
+ .bk-menu--compact {
62
+ --menu-radius: 6px;
63
+ --menu-font-size: 12px;
64
+ --menu-tracking: -0.24px;
65
+ --menu-pad-y: 6px;
66
+ --menu-submenu-pad-y: 4px;
67
+ --menu-pad-x: 8px;
68
+ --menu-gap: 6px;
69
+ --menu-icon-size: 14px;
70
+ --menu-chevron-size: 14px;
71
+ --menu-group-font-size: 10px;
72
+ --menu-title-outdent: 6px;
73
+ --menu-popup-pad: 3px;
74
+ --menu-popup-pad-y: 6px;
75
+ --menu-popup-item-pad-x: 14px;
76
+ --menu-popup-min-w: 160px;
77
+ --menu-popup-max-w: 240px;
26
78
  }
27
79
 
28
80
  /* ---- Lists ---- */
@@ -49,11 +101,13 @@
49
101
  }
50
102
 
51
103
  .bk-menu__button {
52
- @apply flex items-center gap-2 w-full py-2.5 px-3 m-0 border-0
104
+ @apply flex items-center w-full m-0 border-0
53
105
  bg-transparent text-inherit text-left cursor-pointer whitespace-nowrap
54
106
  transition-colors duration-100;
55
107
  font: inherit;
56
108
  letter-spacing: inherit;
109
+ gap: var(--menu-gap);
110
+ padding: var(--menu-pad-y) var(--menu-pad-x);
57
111
  }
58
112
 
59
113
  .bk-menu--horizontal > .bk-menu__list > .bk-menu__item > .bk-menu__button {
@@ -93,15 +147,68 @@
93
147
  /* Nested (child) items use the muted sub-text colour. */
94
148
  .bk-menu__submenu .bk-menu__button {
95
149
  @apply text-[color:var(--menu-subtext)] font-normal;
150
+ padding-top: var(--menu-submenu-pad-y);
151
+ padding-bottom: var(--menu-submenu-pad-y);
152
+ }
153
+
154
+ /* Pop-up rows get their own, roomier horizontal padding (see
155
+ --menu-popup-item-pad-x) instead of the shared --menu-pad-x — vertical
156
+ padding is untouched, inherited from the base .bk-menu__button rule. */
157
+ .bk-menu__submenu--popup .bk-menu__button {
158
+ padding-left: var(--menu-popup-item-pad-x);
159
+ padding-right: var(--menu-popup-item-pad-x);
96
160
  }
97
161
 
98
162
  .bk-menu__submenu .bk-menu__button--active {
99
163
  @apply text-[color:var(--menu-active-text)];
100
164
  }
101
165
 
166
+ /* ---- Group title: names the child group, not selectable.
167
+ Reads as a heading over the rows it titles, not a rule under itself — a
168
+ group is only ever separated from what comes *after* it (the next group,
169
+ if any), never from its own rows. See the `--divider` modifier below. ---- */
170
+ .bk-menu__group-title {
171
+ @apply font-semibold uppercase tracking-wider text-[color:var(--menu-subtext)]
172
+ whitespace-nowrap overflow-hidden text-ellipsis select-none;
173
+ font-size: var(--menu-group-font-size);
174
+ padding: var(--menu-pad-y) var(--menu-pad-x) calc(var(--menu-pad-y) / 2);
175
+ /* Inline levels set padding-left themselves, indent-aware, from the template. */
176
+ padding-left: calc(var(--menu-pad-x) - var(--menu-title-outdent));
177
+ }
178
+
179
+ /* The panel is padded so its rows sit in from the border; a divider rule (see
180
+ `--divider` below) is supposed to span it edge to edge, so pull the title
181
+ back out to the edge and pad the text back in. Net indent then matches the
182
+ inline case exactly regardless of whether this particular title has one. */
183
+ .bk-menu__submenu--popup > .bk-menu__group-title {
184
+ margin-left: calc(var(--menu-popup-pad) * -1);
185
+ margin-right: calc(var(--menu-popup-pad) * -1);
186
+ /* +2px on top of the row's own inset — a touch roomier than the rows it titles. */
187
+ padding-left: calc(var(--menu-popup-item-pad-x) - var(--menu-title-outdent) + var(--menu-popup-pad) + 2px);
188
+ padding-right: calc(var(--menu-popup-item-pad-x) + var(--menu-popup-pad) + 2px);
189
+ }
190
+
191
+ /* ---- Flat multi-group sections (MenuItem.groupLabel): several named groups
192
+ inside one always-visible list, e.g. a mega-menu. Extra breathing room
193
+ above each section's own heading, since it follows another group's rows. ---- */
194
+ .bk-menu__group-title--section {
195
+ @apply mb-0 tracking-wide;
196
+ padding-top: calc(var(--menu-pad-y) * 1.25);
197
+ }
198
+
199
+ /* The rule that actually separates one group from the next — applied only
200
+ when a group has a preceding sibling group (never under a lone title, and
201
+ never trailing after the last group). */
202
+ .bk-menu__group-title--divider {
203
+ @apply border-t border-[var(--menu-border)];
204
+ margin-top: calc(var(--menu-pad-y) / 2);
205
+ }
206
+
102
207
  /* ---- Icon (optional). Tinted monochrome when .bk-menu--tint. ---- */
103
208
  .bk-menu__icon {
104
- @apply w-4 h-4 shrink-0 object-contain;
209
+ @apply shrink-0 object-contain;
210
+ width: var(--menu-icon-size);
211
+ height: var(--menu-icon-size);
105
212
  }
106
213
 
107
214
  .bk-menu--tint .bk-menu__icon {
@@ -124,6 +231,8 @@
124
231
  /* ---- Chevron ---- */
125
232
  .bk-menu__chevron {
126
233
  @apply shrink-0 opacity-80 transition-transform duration-[180ms];
234
+ width: var(--menu-chevron-size);
235
+ height: var(--menu-chevron-size);
127
236
  }
128
237
 
129
238
  /* Inline: rotate down → up on open. */
@@ -131,11 +240,15 @@
131
240
  @apply rotate-180;
132
241
  }
133
242
 
134
- /* Pop-up fly-out: static caret pointing to where the panel opens (right). */
243
+ /* Pop-up fly-out: static caret pointing at the side the panel opens on. */
135
244
  .bk-menu__chevron--right {
136
245
  @apply -rotate-90;
137
246
  }
138
247
 
248
+ .bk-menu__chevron--left {
249
+ @apply rotate-90;
250
+ }
251
+
139
252
  /* =========================================================================
140
253
  Inline submenus (accordion) — expand in place.
141
254
  ========================================================================= */
@@ -147,32 +260,43 @@
147
260
  @apply max-h-[1000px]; /* large enough to reveal nested content */
148
261
  }
149
262
 
263
+ /* Opt-in tint, set via [submenuBackground]="true" — see --menu-submenu-bg above. */
264
+ .bk-menu__submenu--inline.bk-menu__submenu--bg {
265
+ background-color: var(--menu-submenu-bg);
266
+ }
267
+
150
268
  /* =========================================================================
151
269
  Pop-up submenus — floating panels, hidden until open.
152
270
  ========================================================================= */
153
271
  .bk-menu__submenu--popup {
154
272
  /* Fixed so the fly-out escapes the menu's overflow/scroll box and renders
155
273
  outside the nav. Coordinates are set inline (top/left) from JS. */
156
- @apply fixed z-[1000] min-w-[200px] max-w-[280px] max-h-[calc(100vh-16px)]
157
- overflow-y-auto bg-[var(--menu-bg)] border border-[var(--menu-border)]
158
- rounded-xl shadow-[var(--menu-shadow)] p-1 hidden;
274
+ /* max-width/max-height below are the ceiling; menu.ts narrows them inline to
275
+ whatever room the viewport actually leaves, and the panel scrolls past it.
276
+ overflow-x is hidden because rows ellipsise rather than widen the panel. */
277
+ @apply fixed z-[1000] max-h-[calc(100vh-16px)]
278
+ overflow-y-auto overflow-x-hidden bg-[var(--menu-bg)] border border-[var(--menu-border)]
279
+ rounded-xl shadow-[var(--menu-shadow)] hidden;
280
+ padding: var(--menu-popup-pad-y) var(--menu-popup-pad);
281
+ min-width: var(--menu-popup-min-w);
282
+ max-width: var(--menu-popup-max-w);
159
283
  }
160
284
 
161
285
  .bk-menu__submenu--popup.bk-menu__submenu--open {
162
286
  @apply block;
163
287
  }
164
288
 
165
- /* Invisible bridges spanning the gap between a parent and its fly-out, so the
166
- pointer stays "inside" the item while crossing prevents hover flicker. */
167
- .bk-menu__submenu--popup-right::before {
168
- content: '';
169
- @apply absolute top-0 left-[-6px] w-1.5 h-full;
170
- }
171
- .bk-menu__submenu--popup-down::before {
172
- content: '';
173
- @apply absolute top-[-6px] left-0 w-full h-1.5;
289
+ /* Open but not yet measured: on-screen so its size can be read, invisible so
290
+ the estimated position never flashes before the real one lands. */
291
+ .bk-menu__submenu--placing {
292
+ @apply opacity-0 pointer-events-none;
174
293
  }
175
294
 
295
+ /* The gap between a parent and its fly-out is dead space the pointer has to
296
+ cross, and crossing it fires mouseleave. An invisible bridge element can't
297
+ span it — the panel is a scroll container, so anything at a negative offset
298
+ is clipped — so hover mode closes on a short delay instead (see menu.ts). */
299
+
176
300
  /* =========================================================================
177
301
  Responsive: a horizontal menu STAYS horizontal on small screens and scrolls
178
302
  sideways when the items don't fit (overflow-x: auto). Items keep their