@apliteni/apliteni-ui 0.142.4 → 0.142.6

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.
@@ -8,11 +8,11 @@
8
8
 
9
9
  **Why:** Without a legend, readers need labels for unfamiliar glyphs.
10
10
 
11
- **Except:** New entries require a decision and pass Earn a wordless button on Button labels. Allowed: close, copy, overflow, expand, collapse and export. Theme toggles, sidebar toggles and collapsed-rail links have separate approval.
11
+ **Except:** New entries require a decision and pass Earn a wordless button on Button labels. Allowed: close, copy, overflow, expand, collapse and export. Theme and sidebar toggles and collapsed-rail links have separate approval. On [#729](https://github.com/apliteni/apliteni-ui/issues/729), the owner chose a glyph-only React AppShell search trigger below 560px for one light row of icons. Its sentence stays the accessible name: phones have no hover title.
12
12
 
13
- **Do:** Show an overflow menu without words; keep the Settings label.
13
+ **Do:** A wordless overflow menu and a labelled Settings.
14
14
 
15
- **Don't:** Use a cog without words, even with a perfect `aria-label`.
15
+ **Don't:** A wordless cog, even with a perfect `aria-label`.
16
16
 
17
17
  ## State and action
18
18
 
@@ -20,9 +20,9 @@
20
20
 
21
21
  **Rule:** A circled glyph is a state; a bare glyph is an action.
22
22
 
23
- **Why:** Two meanings force readers to decide from context each time.
23
+ **Why:** Two meanings make readers guess from context.
24
24
 
25
- **Except:** Most glyphs show a thing, not a state or action, including `globe`, `database` and `layers`. The split guides component choice, not the catalogue.
25
+ **Except:** Most glyphs, such as `globe`, `database` and `layers`, show a thing, not a state or action. The split guides component choice only.
26
26
 
27
27
  **Do:** `circleX` reports the failure; the bare `x` closes the toast.
28
28
 
@@ -32,25 +32,25 @@
32
32
 
33
33
  <!-- rule: provenance -->
34
34
 
35
- **Rule:** Use the Lucide path unchanged, and state when a glyph name differs.
35
+ **Rule:** Use the Lucide path unchanged, and record any rename.
36
36
 
37
- **Why:** One source keeps the set consistent, and a recorded rename still traces back to it.
37
+ **Why:** One source keeps the set consistent, and a recorded rename stays traceable.
38
38
 
39
- **Except:** A brand mark with no Lucide original is allowed: `github` and `linkedin` are the vendor’s own marks and belong in BRAND.
39
+ **Except:** Vendor marks with no Lucide original, such as `github` and `linkedin`, are allowed in BRAND.
40
40
 
41
- **Do:** `circleCheck` is Lucide’s circle-check-big, path unchanged and name recorded.
41
+ **Do:** `circleCheck`: Lucide’s circle-check-big, same path, rename recorded.
42
42
 
43
- **Don't:** A redrawn path, or a rename nobody recorded.
43
+ **Don't:** A redrawn path or an unrecorded rename.
44
44
 
45
45
  ## Status stroke width
46
46
 
47
47
  <!-- rule: stroke-earns-the-bar -->
48
48
 
49
- **Rule:** Stroke a status glyph at 1.5 CSS px or wider, or require 4.5:1 text contrast instead of 3:1 graphic contrast.
49
+ **Rule:** Stroke a status glyph at 1.5 CSS px or wider, or use 4.5:1 text contrast, not 3:1.
50
50
 
51
- **Why:** Visible width is `stroke-width × box ÷ 24`; below 1.5 CSS px a stroke reads as a text stem and needs 4.5:1; above it, WCAG 1.4.11’s 3:1 graphic bar applies.
51
+ **Why:** Visible width is `stroke-width × box ÷ 24`. A thinner stroke reads as a text stem and needs 4.5:1. A wider one gets WCAG 1.4.11’s 3:1 graphic bar.
52
52
 
53
- **Except:** Non-status glyphs, such as close buttons and chevrons, have no five-status pair to measure; their control owns their contrast.
53
+ **Except:** Non-status glyphs, such as close buttons and chevrons, have no five-status pair. Their control owns their contrast.
54
54
 
55
55
  **Do:** A 1.5 CSS px stroke, held to 3:1.
56
56
 
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.6",
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 {
@@ -1035,11 +1060,15 @@
1035
1060
  }
1036
1061
  @media (max-width: 560px) {
1037
1062
  .ui-react-app .ui-app__bar {
1038
- gap: var(--space-1);
1063
+ gap: 0;
1039
1064
  padding-inline: var(--space-2);
1040
1065
  }
1066
+ .ui-react-app .ui-app__bar {
1067
+ --tap-clear-x: 0px;
1068
+ }
1041
1069
  .ui-react-app .ui-app__bar--phone {
1042
1070
  gap: var(--space-3);
1071
+ --tap-clear-x: var(--space-3);
1043
1072
  }
1044
1073
  .ui-react-app .ui-app__bar:not(:has(> .ui-app__menu:first-child)) {
1045
1074
  padding-inline-start: var(--space-4);
@@ -1047,38 +1076,73 @@
1047
1076
  .ui-react-app .ui-app__bar-gap {
1048
1077
  display: none;
1049
1078
  }
1050
- .ui-react-app .ui-app__search-ic {
1051
- display: none;
1079
+ .ui-react-app .ui-app__bar .ui-app__menu,
1080
+ .ui-react-app .ui-app__bar .ui-app__search,
1081
+ .ui-react-app .ui-app__bar .toggle,
1082
+ .ui-react-app .ui-app__bar .ui-app__user-trigger {
1083
+ flex: none;
1084
+ justify-content: center;
1085
+ width: 40px;
1086
+ min-width: 40px;
1087
+ height: 40px;
1088
+ min-height: 40px;
1089
+ padding: 0;
1090
+ margin: 0;
1091
+ border: 0;
1092
+ border-radius: var(--radius-md);
1093
+ background: transparent;
1094
+ }
1095
+ .ui-react-app .ui-app__bar .ui-app__search:hover,
1096
+ .ui-react-app .ui-app__bar .toggle:hover,
1097
+ .ui-react-app .ui-app__bar .ui-app__user-trigger:hover {
1098
+ transform: none;
1099
+ background: var(--surface);
1100
+ }
1101
+ .ui-react-app .ui-app__bar > .ui-app__brand--band {
1102
+ min-width: 40px;
1103
+ min-height: 40px;
1104
+ margin-inline-start: var(--space-1);
1105
+ }
1106
+ .ui-react-app .ui-app__user--bar {
1107
+ margin: 0;
1052
1108
  }
1053
1109
  .ui-react-app .ui-app__search {
1054
- flex: 1 1 auto;
1055
- min-width: 56px;
1056
- padding-inline: var(--space-2);
1110
+ order: 2;
1057
1111
  }
1058
- .ui-react-app__band-control {
1112
+ .ui-react-app .ui-app__search-ic {
1059
1113
  display: flex;
1060
- flex: 0 1 auto;
1061
- min-width: 56px;
1062
- max-width: min(90px, calc(100vw - 263px));
1063
1114
  }
1064
- .ui-react-app__band-control > .ui-btn {
1115
+ .ui-react-app__band-control > :first-child {
1116
+ order: 1;
1065
1117
  min-width: 0;
1066
- min-height: 34px;
1067
- max-width: 100%;
1118
+ margin-inline: var(--space-1) auto;
1068
1119
  }
1069
- .ui-react-app .ui-app__bar .toggle {
1070
- margin-inline-start: 2px;
1120
+ .ui-react-app__band-control > :not(:first-child) {
1121
+ order: 3;
1122
+ }
1123
+ .ui-react-app .ui-app__bar:not(:has(.ui-react-app__band-control)) .ui-app__search {
1124
+ margin-inline-start: auto;
1071
1125
  }
1072
- .ui-react-app .ui-app__bar:not(.ui-app__bar--phone) > .ui-app__menu + .ui-app__brand--band {
1073
- margin-inline-start: 1px;
1126
+ .ui-react-app .ui-app__bar .toggle {
1127
+ order: 4;
1074
1128
  }
1075
1129
  .ui-react-app .ui-app__user--bar {
1076
- margin-inline-start: 2px;
1130
+ order: 5;
1077
1131
  }
1078
- .ui-react-app .ui-app__user-trigger {
1079
- min-width: 44px;
1132
+ .ui-react-app__band-control > .ui-btn,
1133
+ .ui-react-app__band-control > .ui-dropdown > .ui-dropdown__trigger {
1134
+ min-height: 40px;
1080
1135
  }
1081
- .ui-react-app__band-control > .ui-btn .ui-btn__label {
1136
+ .ui-react-app__band-control > .ui-dropdown > .ui-dropdown__trigger {
1137
+ max-width: 100%;
1138
+ border-color: transparent;
1139
+ background: transparent;
1140
+ }
1141
+ .ui-react-app__band-control > .ui-dropdown > .ui-dropdown__trigger:hover {
1142
+ background: var(--surface);
1143
+ }
1144
+ .ui-react-app__band-control > .ui-btn .ui-btn__label,
1145
+ .ui-react-app__band-control .ui-dropdown__text {
1082
1146
  overflow: hidden;
1083
1147
  text-overflow: ellipsis;
1084
1148
  white-space: nowrap;
@@ -1086,6 +1150,14 @@
1086
1150
  .ui-react-app .ui-app__bar > .ui-app__brand:not(.ui-app__brand--band) {
1087
1151
  display: none;
1088
1152
  }
1153
+ .ui-react-app .ui-app__bar {
1154
+ container-type: inline-size;
1155
+ }
1156
+ }
1157
+ @container (max-width: 373px) {
1158
+ .ui-react-app .ui-app__bar > .ui-app__brand--band {
1159
+ display: none;
1160
+ }
1089
1161
  }
1090
1162
 
1091
1163
  /* src/AuthShell.css */
@@ -931,9 +931,10 @@ type AppShellProps = {
931
931
  lede?: string;
932
932
  actions?: ReactNode;
933
933
  bandControl?: ReactNode;
934
- /** The band trigger's words. Below 560px the shell draws `searchShortLabel` instead;
935
- * both stay the button's name, which does not change with the viewport. */
934
+ /** The band trigger's words and its name at every width. Below 560px the trigger shows
935
+ * only its glyph (#729), and the words stay its accessible name. */
936
936
  searchLabel?: string;
937
+ /** @deprecated Not drawn since #729: the phone trigger shows only its glyph. */
937
938
  searchShortLabel?: string;
938
939
  account: {
939
940
  name: string;
@@ -946,7 +947,7 @@ type AppShellProps = {
946
947
  /** Spread linkProps onto the router link, including children and onClick. */
947
948
  renderLink?: (section: AppShellSection, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
948
949
  };
949
- declare function AppShell({ sections, pathname, title, children, word, brand, layout, brandHref, width, back, crumbs, lede, actions, bandControl, account, onSignOut, searchLabel, searchShortLabel, defaultCollapsed, palette, renderLink }: AppShellProps): react.JSX.Element;
950
+ declare function AppShell({ sections, pathname, title, children, word, brand, layout, brandHref, width, back, crumbs, lede, actions, bandControl, account, onSignOut, searchLabel, defaultCollapsed, palette, renderLink }: AppShellProps): react.JSX.Element;
950
951
 
951
952
  type AuthShellProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
952
953
  brand: ReactNode;
@@ -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 })
@@ -4362,7 +4386,6 @@ function AppShell({
4362
4386
  account,
4363
4387
  onSignOut,
4364
4388
  searchLabel = "Search or run a command\u2026",
4365
- searchShortLabel = "Search",
4366
4389
  defaultCollapsed = false,
4367
4390
  palette,
4368
4391
  renderLink
@@ -4544,7 +4567,6 @@ function AppShell({
4544
4567
  /* @__PURE__ */ jsxs34("button", { type: "button", className: "ui-app__search", "aria-haspopup": "dialog", onClick: () => setSearch(true), children: [
4545
4568
  /* @__PURE__ */ jsx39("span", { className: "ui-app__search-ic", children: /* @__PURE__ */ jsx39(Icon, { name: "search" }) }),
4546
4569
  /* @__PURE__ */ jsx39("span", { className: "ui-app__search-txt", children: searchLabel }),
4547
- /* @__PURE__ */ jsx39("span", { className: "ui-app__search-short", "aria-hidden": "true", children: searchShortLabel }),
4548
4570
  /* @__PURE__ */ jsx39("kbd", { className: "ui-cmdk__key", children: paletteHotkey() })
4549
4571
  ] }),
4550
4572
  /* @__PURE__ */ jsx39("span", { className: "ui-app__bar-gap" }),
@@ -402,11 +402,6 @@
402
402
  .ui-app__search-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
403
403
  /* The other half of the name, so it never gives way. */
404
404
  .ui-app__search kbd { flex: none; }
405
- /* The one word the phone band draws instead of the sentence. Above 560px the
406
- sentence fits and this is a second copy of it, so it is not drawn.
407
- why: docs/components.md#the-page-shell */
408
- .ui-app__search-short { display: none; }
409
-
410
405
  /* The mark alone — no room for two lines on a 52px row. No rule over it, since the
411
406
  band's hairline is under the whole of it, and no column, since this is not the rail.
412
407
  why: docs/components.md#the-page-shell */
@@ -555,8 +550,8 @@
555
550
 
556
551
  /* -- The band's search at one column --------------------------------------- */
557
552
  /* The band holds the trigger, the reader's mark and whatever the page puts between
558
- them, so the sentence broke mid-word — "Search or run a co…". The short word takes
559
- its place. Neither the sentence nor the cap is `display: none`: both are inside
553
+ them, so the sentence broke mid-word — "Search or run a co…". The search glyph takes
554
+ its place (#729). Neither the sentence nor the cap is `display: none`: both are inside
560
555
  the button's accessible name — the cap by Artur's call on #308 — so they are
561
556
  clipped the way `.ui-sr` in loading.css clips, and the name holds at every width.
562
557
  why: docs/components.md#the-page-shell */
@@ -573,9 +568,6 @@
573
568
  white-space: nowrap;
574
569
  border: 0;
575
570
  }
576
- /* It gives way before the band does: at a large font scale the word ellipsises
577
- rather than pushing the reader's mark off the row. */
578
- .ui-app__search-short { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
579
571
  }
580
572
 
581
573
  /* -- Auth card (sign-in / consent) — centered, glowing --------------------- */
@@ -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);