@apliteni/apliteni-ui 0.142.4 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.142.4",
3
+ "version": "0.142.5",
4
4
 
5
5
  "workspaces": [
6
6
  "react"
@@ -131,6 +131,9 @@
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);
@@ -396,6 +399,7 @@
396
399
  font-size: var(--text-sm);
397
400
  font-weight: var(--weight-medium);
398
401
  font-variant-numeric: tabular-nums;
402
+ white-space: nowrap;
399
403
  color: var(--text);
400
404
  background: transparent;
401
405
  border: 1px solid transparent;
@@ -497,10 +501,31 @@
497
501
  border-inline-end: 0;
498
502
  border-block-end: 1px solid var(--border);
499
503
  }
500
- .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 {
501
506
  outline: var(--ring-scroll);
502
507
  outline-offset: var(--ring-scroll-offset);
503
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
+ }
504
529
 
505
530
  /* src/KeyValueList.css */
506
531
  .ui-kv {
@@ -1059,13 +1084,17 @@
1059
1084
  display: flex;
1060
1085
  flex: 0 1 auto;
1061
1086
  min-width: 56px;
1062
- max-width: min(90px, calc(100vw - 263px));
1087
+ max-width: min(108px, calc(100vw - 263px));
1063
1088
  }
1064
- .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 {
1065
1092
  min-width: 0;
1066
- min-height: 34px;
1067
1093
  max-width: 100%;
1068
1094
  }
1095
+ .ui-react-app__band-control > .ui-btn {
1096
+ min-height: 34px;
1097
+ }
1069
1098
  .ui-react-app .ui-app__bar .toggle {
1070
1099
  margin-inline-start: 2px;
1071
1100
  }
@@ -1078,7 +1107,8 @@
1078
1107
  .ui-react-app .ui-app__user-trigger {
1079
1108
  min-width: 44px;
1080
1109
  }
1081
- .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 {
1082
1112
  overflow: hidden;
1083
1113
  text-overflow: ellipsis;
1084
1114
  white-space: nowrap;
@@ -1086,6 +1116,35 @@
1086
1116
  .ui-react-app .ui-app__bar > .ui-app__brand:not(.ui-app__brand--band) {
1087
1117
  display: none;
1088
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
+ }
1089
1148
  }
1090
1149
 
1091
1150
  /* src/AuthShell.css */
@@ -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 = dropdownViewportFit(el);
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 = dropdownViewportFit(el) ?? 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 })
@@ -209,6 +209,9 @@
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
@@ -217,8 +220,8 @@
217
220
 
218
221
  /* In the sheet the row scrolls, so its own block padding is the clearance —
219
222
  anything past the chip is clipped rather than hit. The chips are already
220
- wider than the floor, so the gap across stays the kit's. A popover keeps
221
- the column, where the row gap opens to the clearance it declares. */
223
+ wider than the floor, so the gap across stays the kit's. The phone popover
224
+ scrolls its row the same way. */
222
225
  .ui-datepicker__presets {
223
226
  row-gap: var(--tap-gap-bordered) !important;
224
227
  --tap-clear-x: var(--space-1, 4px);