@apliteni/apliteni-ui 0.142.3 → 0.142.5
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 +1 -1
- package/react/dist/index.css +68 -5
- package/react/dist/index.js +28 -4
- package/src/styles/tap-zone.css +12 -4
package/package.json
CHANGED
package/react/dist/index.css
CHANGED
|
@@ -131,11 +131,15 @@
|
|
|
131
131
|
--tap-clear-x: var(--space-1, 4px);
|
|
132
132
|
--tap-clear-y: var(--tap-gap);
|
|
133
133
|
}
|
|
134
|
+
.ui-datepicker__panel {
|
|
135
|
+
--ui-dropdown-max: 100dvh;
|
|
136
|
+
}
|
|
134
137
|
.ui-datepicker__head {
|
|
135
138
|
--tap-clear-x: var(--tap-gap-bordered);
|
|
136
139
|
--tap-clear-y: var(--tap-gap-bordered);
|
|
137
140
|
}
|
|
138
141
|
.ui-datepicker__presets {
|
|
142
|
+
row-gap: var(--tap-gap-bordered) !important;
|
|
139
143
|
--tap-clear-x: var(--space-1, 4px);
|
|
140
144
|
--tap-clear-y: var(--tap-gap-bordered);
|
|
141
145
|
}
|
|
@@ -395,6 +399,7 @@
|
|
|
395
399
|
font-size: var(--text-sm);
|
|
396
400
|
font-weight: var(--weight-medium);
|
|
397
401
|
font-variant-numeric: tabular-nums;
|
|
402
|
+
white-space: nowrap;
|
|
398
403
|
color: var(--text);
|
|
399
404
|
background: transparent;
|
|
400
405
|
border: 1px solid transparent;
|
|
@@ -496,10 +501,31 @@
|
|
|
496
501
|
border-inline-end: 0;
|
|
497
502
|
border-block-end: 1px solid var(--border);
|
|
498
503
|
}
|
|
499
|
-
.ui-datepicker__body.is-sheet .ui-datepicker__presets:focus-visible
|
|
504
|
+
.ui-datepicker__body.is-sheet .ui-datepicker__presets:focus-visible,
|
|
505
|
+
.ui-datepicker__panel .ui-datepicker__presets:focus-visible {
|
|
500
506
|
outline: var(--ring-scroll);
|
|
501
507
|
outline-offset: var(--ring-scroll-offset);
|
|
502
508
|
}
|
|
509
|
+
@media (max-width: 560px) {
|
|
510
|
+
.ui-dropdown__panel.ui-datepicker__panel {
|
|
511
|
+
--ui-dropdown-edge: 8px;
|
|
512
|
+
width: var(--ui-dropdown-ceiling, calc(100vw - 16px));
|
|
513
|
+
max-width: none;
|
|
514
|
+
}
|
|
515
|
+
.ui-datepicker__panel .ui-datepicker__body {
|
|
516
|
+
flex-direction: column;
|
|
517
|
+
align-items: stretch;
|
|
518
|
+
}
|
|
519
|
+
.ui-datepicker__panel .ui-datepicker__presets {
|
|
520
|
+
grid-auto-flow: column;
|
|
521
|
+
grid-auto-columns: max-content;
|
|
522
|
+
overflow-x: auto;
|
|
523
|
+
scroll-padding-inline: var(--space-1);
|
|
524
|
+
padding: var(--space-3) var(--space-1);
|
|
525
|
+
border-inline-end: 0;
|
|
526
|
+
border-block-end: 1px solid var(--border);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
503
529
|
|
|
504
530
|
/* src/KeyValueList.css */
|
|
505
531
|
.ui-kv {
|
|
@@ -1058,14 +1084,21 @@
|
|
|
1058
1084
|
display: flex;
|
|
1059
1085
|
flex: 0 1 auto;
|
|
1060
1086
|
min-width: 56px;
|
|
1061
|
-
max-width: min(
|
|
1087
|
+
max-width: min(108px, calc(100vw - 263px));
|
|
1062
1088
|
}
|
|
1063
|
-
.ui-react-app__band-control > .ui-btn
|
|
1089
|
+
.ui-react-app__band-control > .ui-btn,
|
|
1090
|
+
.ui-react-app__band-control > .ui-dropdown,
|
|
1091
|
+
.ui-react-app__band-control > .ui-dropdown > .ui-dropdown__trigger {
|
|
1064
1092
|
min-width: 0;
|
|
1065
|
-
min-height: 34px;
|
|
1066
1093
|
max-width: 100%;
|
|
1067
1094
|
}
|
|
1095
|
+
.ui-react-app__band-control > .ui-btn {
|
|
1096
|
+
min-height: 34px;
|
|
1097
|
+
}
|
|
1068
1098
|
.ui-react-app .ui-app__bar .toggle {
|
|
1099
|
+
margin-inline-start: 2px;
|
|
1100
|
+
}
|
|
1101
|
+
.ui-react-app .ui-app__bar:not(.ui-app__bar--phone) > .ui-app__menu + .ui-app__brand--band {
|
|
1069
1102
|
margin-inline-start: 1px;
|
|
1070
1103
|
}
|
|
1071
1104
|
.ui-react-app .ui-app__user--bar {
|
|
@@ -1074,7 +1107,8 @@
|
|
|
1074
1107
|
.ui-react-app .ui-app__user-trigger {
|
|
1075
1108
|
min-width: 44px;
|
|
1076
1109
|
}
|
|
1077
|
-
.ui-react-app__band-control > .ui-btn .ui-btn__label
|
|
1110
|
+
.ui-react-app__band-control > .ui-btn .ui-btn__label,
|
|
1111
|
+
.ui-react-app__band-control .ui-dropdown__text {
|
|
1078
1112
|
overflow: hidden;
|
|
1079
1113
|
text-overflow: ellipsis;
|
|
1080
1114
|
white-space: nowrap;
|
|
@@ -1082,6 +1116,35 @@
|
|
|
1082
1116
|
.ui-react-app .ui-app__bar > .ui-app__brand:not(.ui-app__brand--band) {
|
|
1083
1117
|
display: none;
|
|
1084
1118
|
}
|
|
1119
|
+
.ui-react-app .ui-app__bar {
|
|
1120
|
+
container-type: inline-size;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
@container (max-width: 373px) {
|
|
1124
|
+
.ui-react-app .ui-app__search {
|
|
1125
|
+
flex: none;
|
|
1126
|
+
justify-content: center;
|
|
1127
|
+
width: 34px;
|
|
1128
|
+
height: 34px;
|
|
1129
|
+
min-width: 0;
|
|
1130
|
+
padding: 0;
|
|
1131
|
+
border-radius: 10px;
|
|
1132
|
+
}
|
|
1133
|
+
.ui-react-app .ui-app__search-ic {
|
|
1134
|
+
display: flex;
|
|
1135
|
+
}
|
|
1136
|
+
.ui-react-app .ui-app__search-short {
|
|
1137
|
+
display: none;
|
|
1138
|
+
}
|
|
1139
|
+
.ui-react-app .ui-app__bar > .ui-app__brand--band {
|
|
1140
|
+
display: none;
|
|
1141
|
+
}
|
|
1142
|
+
.ui-react-app__band-control {
|
|
1143
|
+
max-width: 108px;
|
|
1144
|
+
}
|
|
1145
|
+
.ui-react-app .ui-app__bar .toggle {
|
|
1146
|
+
margin-inline-start: auto;
|
|
1147
|
+
}
|
|
1085
1148
|
}
|
|
1086
1149
|
|
|
1087
1150
|
/* src/AuthShell.css */
|
package/react/dist/index.js
CHANGED
|
@@ -1906,6 +1906,7 @@ import {
|
|
|
1906
1906
|
useRef as useRef11,
|
|
1907
1907
|
useState as useState8
|
|
1908
1908
|
} from "react";
|
|
1909
|
+
import { dropdownViewportFit } from "@apliteni/apliteni-ui";
|
|
1909
1910
|
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1910
1911
|
var cx5 = (...a) => a.filter(Boolean).join(" ");
|
|
1911
1912
|
var pad = (n) => String(n).padStart(2, "0");
|
|
@@ -2014,6 +2015,7 @@ function DatePicker({
|
|
|
2014
2015
|
const root = useRef11(null);
|
|
2015
2016
|
const trigger = useRef11(null);
|
|
2016
2017
|
const grid = useRef11(null);
|
|
2018
|
+
const panel = useRef11(null);
|
|
2017
2019
|
const [selfOpen, setSelfOpen] = useState8(defaultOpen);
|
|
2018
2020
|
const open = openProp ?? selfOpen;
|
|
2019
2021
|
const [selfValue, setSelfValue] = useState8(defaultValue);
|
|
@@ -2062,6 +2064,27 @@ function DatePicker({
|
|
|
2062
2064
|
useEffect7(() => {
|
|
2063
2065
|
if (open) setCursor(clamp(anchor, lo, hi));
|
|
2064
2066
|
}, [open]);
|
|
2067
|
+
useIsoLayoutEffect(() => {
|
|
2068
|
+
const el = panel.current;
|
|
2069
|
+
const view = el?.ownerDocument?.defaultView;
|
|
2070
|
+
if (!el || !view || !open) return;
|
|
2071
|
+
const fit = () => {
|
|
2072
|
+
let got = dropdownViewportFit(el);
|
|
2073
|
+
if (!got) return;
|
|
2074
|
+
el.style.setProperty("--ui-dropdown-ceiling", got.max > 0 ? `${got.max}px` : "");
|
|
2075
|
+
if (got.width > got.max) got = dropdownViewportFit(el) ?? got;
|
|
2076
|
+
el.style.translate = got.shift ? `${got.shift}px` : "";
|
|
2077
|
+
};
|
|
2078
|
+
fit();
|
|
2079
|
+
const ro = typeof view.ResizeObserver === "function" ? new view.ResizeObserver(fit) : null;
|
|
2080
|
+
if (trigger.current) ro?.observe(trigger.current);
|
|
2081
|
+
ro?.observe(el);
|
|
2082
|
+
view.addEventListener("resize", fit);
|
|
2083
|
+
return () => {
|
|
2084
|
+
ro?.disconnect();
|
|
2085
|
+
view.removeEventListener("resize", fit);
|
|
2086
|
+
};
|
|
2087
|
+
}, [open, asSheet]);
|
|
2065
2088
|
useEffect7(() => {
|
|
2066
2089
|
if (!open || asSheet) return;
|
|
2067
2090
|
const doc = root.current?.ownerDocument ?? document;
|
|
@@ -2358,6 +2381,7 @@ function DatePicker({
|
|
|
2358
2381
|
"div",
|
|
2359
2382
|
{
|
|
2360
2383
|
className: cx5("ui-dropdown__panel", "ui-datepicker__panel", align === "end" && "is-end"),
|
|
2384
|
+
ref: panel,
|
|
2361
2385
|
role: "dialog",
|
|
2362
2386
|
"aria-label": name,
|
|
2363
2387
|
inert: !open,
|
|
@@ -2385,7 +2409,7 @@ import {
|
|
|
2385
2409
|
dropdownFiltering,
|
|
2386
2410
|
filterPanelFit,
|
|
2387
2411
|
transitionMs as transitionMs2,
|
|
2388
|
-
dropdownViewportFit,
|
|
2412
|
+
dropdownViewportFit as dropdownViewportFit2,
|
|
2389
2413
|
dropdownHeightFit,
|
|
2390
2414
|
dropdownLift,
|
|
2391
2415
|
dropdownReveal,
|
|
@@ -2710,10 +2734,10 @@ function Dropdown({
|
|
|
2710
2734
|
if (!el || el.closest(".ui-filter-bar")) return;
|
|
2711
2735
|
const fit = () => {
|
|
2712
2736
|
if (el.hasAttribute("data-dd-lifted")) return;
|
|
2713
|
-
let got =
|
|
2737
|
+
let got = dropdownViewportFit2(el);
|
|
2714
2738
|
if (!got) return;
|
|
2715
2739
|
el.style.setProperty("--ui-dropdown-ceiling", got.max > 0 ? `${got.max}px` : "");
|
|
2716
|
-
if (got.width > got.max) got =
|
|
2740
|
+
if (got.width > got.max) got = dropdownViewportFit2(el) ?? got;
|
|
2717
2741
|
el.style.translate = got.shift ? `${got.shift}px` : "";
|
|
2718
2742
|
};
|
|
2719
2743
|
fit();
|
|
@@ -2921,7 +2945,7 @@ function Dropdown({
|
|
|
2921
2945
|
setOpen(!open);
|
|
2922
2946
|
},
|
|
2923
2947
|
children: [
|
|
2924
|
-
triggerContent != null ? triggerContent : /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
2948
|
+
triggerContent != null ? typeof triggerContent === "string" ? /* @__PURE__ */ jsx22("span", { className: "ui-dropdown__text", children: triggerContent }) : triggerContent : /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
2925
2949
|
marked2 && (chosen?.avatar ? /* @__PURE__ */ jsx22(Avatar, { personKey: chosen.avatar.key, name: chosen.avatar.name, src: chosen.avatar.src, empty: chosen.avatar.empty }) : /* @__PURE__ */ jsx22(Avatar, { empty: true })),
|
|
2926
2950
|
label && /* @__PURE__ */ jsx22("span", { className: "ui-dropdown__pre", children: label }),
|
|
2927
2951
|
/* @__PURE__ */ jsx22("span", { className: cx6("ui-dropdown__value", marked2 && !chosen && "is-placeholder"), children: shown != null ? shown : placeholder })
|
package/src/styles/tap-zone.css
CHANGED
|
@@ -209,16 +209,24 @@
|
|
|
209
209
|
--tap-clear-x: var(--space-1, 4px);
|
|
210
210
|
--tap-clear-y: var(--tap-gap);
|
|
211
211
|
}
|
|
212
|
+
/* The opened rows outgrow the menu's 300px cap, whose scroll edge cut the last
|
|
213
|
+
week's tap layers in a phone popover. The panel keeps the viewport and edge limits. */
|
|
214
|
+
.ui-datepicker__panel { --ui-dropdown-max: 100dvh; }
|
|
212
215
|
|
|
213
216
|
/* Neither axis is opened: the room is already there, a hundred pixels to the
|
|
214
217
|
caption and twelve to the grid, which is how `.ui-tabs__list` declares its
|
|
215
218
|
own. The bordered step, because both controls are bordered at --tap-aa. */
|
|
216
219
|
.ui-datepicker__head { --tap-clear-x: var(--tap-gap-bordered); --tap-clear-y: var(--tap-gap-bordered); }
|
|
217
220
|
|
|
218
|
-
/*
|
|
219
|
-
past the chip is clipped rather than hit. The chips are already
|
|
220
|
-
than the floor, so the gap across stays the kit's.
|
|
221
|
-
|
|
221
|
+
/* In the sheet the row scrolls, so its own block padding is the clearance —
|
|
222
|
+
anything past the chip is clipped rather than hit. The chips are already
|
|
223
|
+
wider than the floor, so the gap across stays the kit's. The phone popover
|
|
224
|
+
scrolls its row the same way. */
|
|
225
|
+
.ui-datepicker__presets {
|
|
226
|
+
row-gap: var(--tap-gap-bordered) !important;
|
|
227
|
+
--tap-clear-x: var(--space-1, 4px);
|
|
228
|
+
--tap-clear-y: var(--tap-gap-bordered);
|
|
229
|
+
}
|
|
222
230
|
|
|
223
231
|
/* Both ways: fixed squares cannot overflow the way labels can, and a drawer
|
|
224
232
|
header spends its column gap on the title. Not the accent picker — its
|