@apliteni/apliteni-ui 0.166.0 → 0.167.0
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/docs/components.md
CHANGED
|
@@ -1443,7 +1443,15 @@ asterisk. **A `dropdown()` inside `field()` is wired through its trigger button*
|
|
|
1443
1443
|
dropdown's `id` sits on a wrapper that a label cannot name. The label and then the chosen value name
|
|
1444
1444
|
the trigger, the error or hint describes it, and an error marks it invalid. The list is named by the
|
|
1445
1445
|
label unless you give it an `ariaLabel`. A control outside a `field()` needs its own `ariaLabel`. A
|
|
1446
|
-
placeholder is not a name.
|
|
1446
|
+
placeholder is not a name. **In a field, a dropdown trigger has the shape of a text input.** It
|
|
1447
|
+
takes the input's corner, its top and bottom padding and its type size, so the two have the same
|
|
1448
|
+
height. Its side padding is 16px, 1px more than the input's. On a touch screen its text is a
|
|
1449
|
+
fixed 16px, as the input's is, also when the host changes `--text-base`. A long value stays on
|
|
1450
|
+
one line, starts at the left and ends with an ellipsis, as in a select, so the trigger keeps the
|
|
1451
|
+
input's height at every value length. A person mark stands as far from the left edge as from the
|
|
1452
|
+
top and bottom edges. A date picker in a field does the same. Outside a field, for example in a
|
|
1453
|
+
filter bar, a toolbar or the topbar, the trigger keeps the pill.
|
|
1454
|
+
Put a form on a card, not on the page ground. A field is drawn by its edge, but the page ground
|
|
1447
1455
|
is too close to the field's own fill for you to see that edge. See
|
|
1448
1456
|
[Colour and contrast](foundations.md#colour-and-contrast).
|
|
1449
1457
|
|
package/package.json
CHANGED
package/react/dist/index.css
CHANGED
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
--tap-clear-y: var(--tap-gap);
|
|
125
125
|
}
|
|
126
126
|
.ui-confirm__acts,
|
|
127
|
-
.ui-toolbar,
|
|
127
|
+
.ui-toolbar:not(.ui-table *),
|
|
128
128
|
.ui-empty__actions,
|
|
129
129
|
.ui-sx__actions,
|
|
130
130
|
.ui-fbc__foot,
|
|
@@ -1365,6 +1365,14 @@
|
|
|
1365
1365
|
.ui-react-app__band-control > :first-child {
|
|
1366
1366
|
min-width: 0;
|
|
1367
1367
|
}
|
|
1368
|
+
.ui-react-app__band-control > * {
|
|
1369
|
+
position: relative;
|
|
1370
|
+
z-index: var(--z-base);
|
|
1371
|
+
}
|
|
1372
|
+
.ui-react-app__band-control > .ui-dropdown > .ui-dropdown__trigger::after {
|
|
1373
|
+
min-width: calc(100% + 2px);
|
|
1374
|
+
min-height: calc(100% + 2px);
|
|
1375
|
+
}
|
|
1368
1376
|
.ui-react-app__band-control > .ui-btn,
|
|
1369
1377
|
.ui-react-app__band-control > .ui-dropdown > .ui-dropdown__trigger {
|
|
1370
1378
|
min-height: 40px;
|
package/react/dist/index.js
CHANGED
|
@@ -2633,7 +2633,8 @@ function DatePicker({
|
|
|
2633
2633
|
if (!got) return;
|
|
2634
2634
|
el.style.setProperty("--ui-dropdown-ceiling", got.max > 0 ? `${got.max}px` : "");
|
|
2635
2635
|
if (got.width > got.max) got = dropdownViewportFit(el) ?? got;
|
|
2636
|
-
el.style.
|
|
2636
|
+
el.style.marginLeft = got.shift ? `${got.shift}px` : "";
|
|
2637
|
+
el.style.marginRight = got.shift ? `${-got.shift}px` : "";
|
|
2637
2638
|
};
|
|
2638
2639
|
fit();
|
|
2639
2640
|
const ro = typeof view.ResizeObserver === "function" ? new view.ResizeObserver(fit) : null;
|
|
@@ -3298,7 +3299,8 @@ function Dropdown({
|
|
|
3298
3299
|
if (!got) return;
|
|
3299
3300
|
el.style.setProperty("--ui-dropdown-ceiling", got.max > 0 ? `${got.max}px` : "");
|
|
3300
3301
|
if (got.width > got.max) got = dropdownViewportFit2(el) ?? got;
|
|
3301
|
-
el.style.
|
|
3302
|
+
el.style.marginLeft = got.shift ? `${got.shift}px` : "";
|
|
3303
|
+
el.style.marginRight = got.shift ? `${-got.shift}px` : "";
|
|
3302
3304
|
};
|
|
3303
3305
|
fit();
|
|
3304
3306
|
const view = root.current?.ownerDocument?.defaultView;
|
|
@@ -350,7 +350,8 @@ function ddPlaceLifted(dd, panel) {
|
|
|
350
350
|
const other = configured ? below : above;
|
|
351
351
|
const up = mine < Math.min(ddMin(panel), ddContentHeight(panel)) && other > mine ? !configured : configured;
|
|
352
352
|
const s = panel.style;
|
|
353
|
-
s.
|
|
353
|
+
s.marginLeft = '';
|
|
354
|
+
s.marginRight = '';
|
|
354
355
|
if (panel.getAttribute('data-dd-lifted') !== (up ? 'up' : 'down')) {
|
|
355
356
|
const held = s.transition;
|
|
356
357
|
s.transition = 'none';
|
|
@@ -624,8 +625,10 @@ export const DD_EXIT_SLACK_MS = 50;
|
|
|
624
625
|
/** The shift a panel is already carrying, the one ddFitViewport() wrote. Taken
|
|
625
626
|
* off before the next measurement, so asking twice answers the same as asking
|
|
626
627
|
* once — the fit is measured from where the sheet puts the panel, not from where
|
|
627
|
-
* the last fit left it.
|
|
628
|
-
|
|
628
|
+
* the last fit left it. The shift is side margins, not a translate: Chromium 158
|
|
629
|
+
* kept the page as wide as a translated panel's old place after a transition
|
|
630
|
+
* ended (#812). The far margin gives the room back, so the panel keeps its width. */
|
|
631
|
+
const ddShiftOf = (panel) => parseFloat(panel.style?.marginLeft) || 0;
|
|
629
632
|
|
|
630
633
|
/** The widest a panel may be: the view it is laid out in, less the keep-out it owes
|
|
631
634
|
* each edge. It is the bound a PORTALLED panel needs, whose room is the whole view
|
package/src/styles/dropdown.css
CHANGED
|
@@ -546,3 +546,36 @@
|
|
|
546
546
|
.ui-field > .ui-dropdown { display: grid; }
|
|
547
547
|
.ui-field > .ui-dropdown > .ui-dropdown__trigger > .ui-dropdown__chevron { margin-left: auto; }
|
|
548
548
|
.ui-field > .ui-dropdown > .ui-dropdown__panel { inline-size: 100%; min-width: 0; }
|
|
549
|
+
/* In a form the trigger takes the text input's corner, block padding and type, so the
|
|
550
|
+
two stand at one height. Elsewhere it keeps the pill. #812
|
|
551
|
+
why: docs/components.md#forms */
|
|
552
|
+
@property --ui-dropdown-line { syntax: "<length>"; inherits: true; initial-value: 0px; }
|
|
553
|
+
.ui-field > .ui-dropdown > .ui-dropdown__trigger {
|
|
554
|
+
border-radius: var(--radius-md);
|
|
555
|
+
padding: var(--space-3) var(--space-4);
|
|
556
|
+
font-size: var(--text-base);
|
|
557
|
+
min-inline-size: 0;
|
|
558
|
+
/* The value line, as a length the mark below can read. */
|
|
559
|
+
--ui-dropdown-line: 1lh;
|
|
560
|
+
}
|
|
561
|
+
/* A long value keeps one line from the left and ends in an ellipsis, as the select
|
|
562
|
+
does, so the trigger keeps the input's height at every length. */
|
|
563
|
+
.ui-field > .ui-dropdown > .ui-dropdown__trigger > .ui-dropdown__value,
|
|
564
|
+
.ui-field > .ui-dropdown > .ui-dropdown__trigger > .ui-dropdown__text {
|
|
565
|
+
min-inline-size: 0;
|
|
566
|
+
overflow: hidden;
|
|
567
|
+
white-space: nowrap;
|
|
568
|
+
text-overflow: ellipsis;
|
|
569
|
+
text-align: start;
|
|
570
|
+
}
|
|
571
|
+
/* The mark stands as far from the left edge as from the top and bottom edges. */
|
|
572
|
+
.ui-field > .ui-dropdown > .ui-dropdown__trigger > .ui-avatar {
|
|
573
|
+
--ui-avatar-pull-start: calc(var(--space-4) - var(--space-3) - (var(--ui-dropdown-line) - var(--ui-avatar-size)) / 2);
|
|
574
|
+
}
|
|
575
|
+
/* The input beside it is 16px on a touch screen, so the trigger follows it. A flat
|
|
576
|
+
16px like the zoom net, so a host's --text-base does not move it off the input.
|
|
577
|
+
Not the net's job: the trigger takes no typing.
|
|
578
|
+
why: docs/foundations.md#a-field-is-16px-on-a-touch-screen */
|
|
579
|
+
@media (pointer: coarse) {
|
|
580
|
+
.ui-field > .ui-dropdown > .ui-dropdown__trigger { font-size: 16px; }
|
|
581
|
+
}
|
package/src/styles/tap-zone.css
CHANGED
|
@@ -195,9 +195,10 @@
|
|
|
195
195
|
at 390 is often already full, so widening its column gap does not move the
|
|
196
196
|
buttons apart — it makes them narrower, and that is the half #488 rules
|
|
197
197
|
out. Measured on a toolbar of three buttons and a dropdown. These rows
|
|
198
|
-
wrap, which is also where the review measured them colliding.
|
|
198
|
+
wrap, which is also where the review measured them colliding. Not a toolbar in a
|
|
199
|
+
table cell: the row would grow, and a table's rows keep their height. #812 */
|
|
199
200
|
.ui-confirm__acts,
|
|
200
|
-
.ui-toolbar,
|
|
201
|
+
.ui-toolbar:not(.ui-table *),
|
|
201
202
|
.ui-empty__actions,
|
|
202
203
|
.ui-sx__actions,
|
|
203
204
|
.ui-fbc__foot,
|