@apliteni/apliteni-ui 0.162.3 → 0.163.1

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.
@@ -228,7 +228,7 @@ losing both ends to a clip. There is one limit: a folded rail flush with a page'
228
228
  Every guarantee above still applies. The band stands beside the rail. It does not span the top
229
229
  of both. **The rail holds the shell's own controls:** the fold's control in its head, beside the
230
230
  mark, the theme switch above the reader's block, and the reader's block at its foot. The band
231
- control stands under the head (#732, `react/src/AppShell.tsx:191` `ui-react-app__control`). **The band carries the search
231
+ control stands under the head (#732, `react/src/AppShell.tsx:195` `ui-react-app__control`). **The band carries the search
232
232
  field and nothing else** above 720px. At 720px and below it carries the mark, the page title on one
233
233
  line, the search trigger and the menu button (`react/src/AppShell.css:97` `@media (max-width: 720px)`). It is a `<header>`
234
234
  outside the navigation landmark. The field is the palette's own trigger, drawn as a field, with
@@ -771,7 +771,7 @@ and Escape closes the top overlay. Tab is trapped in the panel. Home and End sta
771
771
  caret, which is what the ARIA combobox pattern gives them for, and Ctrl+K inside another text
772
772
  box is left alone, because it is kill-to-end-of-line there — Cmd+K still opens from one.
773
773
  **Focus opens in the text box and never leaves it while the palette is open**, over an inert page.
774
- The search row shows the accent ring inside its edges while the text box has keyboard focus, and its divider hides under the ring.
774
+ The search row shows the accent ring inside its edges while the text box has keyboard focus. The ring follows the panel's top corners, and the divider hides under the ring.
775
775
  **It opens empty**, and **it paints one step above the drawer and one below the confirm**. A
776
776
  confirm opened by a row appears over both and answers the first Escape.
777
777
 
@@ -1303,8 +1303,11 @@ The button and tick follow `value` until the caller updates it. `AccountMenu` ma
1303
1303
  or `onSelect` to open something in place.
1304
1304
  The existing band layout stays the default. The longest matching section
1305
1305
  path wins. **At 720px and below, a menu button and the brand mark on the band replace the
1306
- rail:** the button opens the full section list in the left drawer, and the page takes the full
1307
- width. A press on a section, Escape or a wider window closes the drawer, and focus returns to
1306
+ rail:** the button opens the full section list in a drawer, and the page takes the full
1307
+ width. **The drawer opens from the side of its menu button:** the right in the topbar
1308
+ layout, where the button ends the band, and the left in the rail layout. Set `drawerSide`
1309
+ to `'left'` or `'right'` to choose the side in either layout (#790,
1310
+ `react/src/AppShell.tsx:185` `side={drawerSide ?? 'left'}`). A press on a section, Escape or a wider window closes the drawer, and focus returns to
1308
1311
  the button. **A shell whose list has nowhere to go — one section and no back
1309
1312
  link — draws no rail, no fold control and no menu button;** the brand lockup moves to the band
1310
1313
  and the section stays in the command palette. One section under a child page is a destination,
@@ -1316,13 +1319,13 @@ The button and tick follow `value` until the caller updates it. `AccountMenu` ma
1316
1319
  theme is a row of the account menu** (#732). The rail keeps the fold's control
1317
1320
  in its head, `bandControl` under the head, then the sections and the account at its foot. A
1318
1321
  folded rail keeps the account mark, and makes `bandControl` inert. The drawer puts
1319
- `bandControl` above the sections, and the account in its footer (`react/src/AppShell.tsx:229` `{accountBlock(true, true)}`).
1322
+ `bandControl` above the sections, and the account in its footer (`react/src/AppShell.tsx:233` `{accountBlock(true, true)}`).
1320
1323
  **`headControl` is one glyph control in the sidebar head, before the fold button** (#732). It
1321
1324
  is drawn as the fold is: a plain glyph with no border and no fill, the fold's size, ink and
1322
1325
  hover (`react/src/AppShell.css:56` `.ui-react-app__head-control > :is(button, a)`). A folded
1323
1326
  rail moves it out of the head row onto the glyph column, one rail gap under the head, and it
1324
1327
  stays usable. The drawer puts it in the panel's head, before the close button, as a 40px tap
1325
- target (`react/src/AppShell.tsx:229` `headerActions={headSlot}`). `Drawer` takes
1328
+ target (`react/src/AppShell.tsx:233` `headerActions={headSlot}`). `Drawer` takes
1326
1329
  `headerActions` for controls between its title and its close button. A shell with no sidebar
1327
1330
  puts `headControl` on the band after `bandControl`.
1328
1331
  **The Theme row opens a submenu of Auto, Light and Dark** (#736). The row shows the current
@@ -357,8 +357,9 @@ override reaches every control. There is no gap colour to hand down.
357
357
 
358
358
  **`--ring-scroll` is the indicator a box takes when its own edges are a surface's edges.** It uses
359
359
  the same 1px gap and 2px band, but draws them inward. A scroll region inside a surface is one such
360
- box. A link filling a table cell is another, and so is a line of text inside a cell that clips. You
361
- need both values, or the band appears outside the box.
360
+ box. A link filling a table cell is another, and so is a line of text inside a cell that clips.
361
+ A navigation rail row takes it too, because the rows stand 2px apart and an outward band covers
362
+ the next row. You need both values, or the band appears outside the box.
362
363
 
363
364
  **Every focusable control the kit ships draws the band**, including a roving row the keyboard
364
365
  reaches with an arrow key rather than Tab. None falls back to the browser's own outline, which
@@ -10,7 +10,7 @@ Each row names one guideline page, the screen parts it covers, and when to read
10
10
  | [Colour and theming](colour-and-theming.md) | Colour tokens, accents, signal colours, theme checks and forced colours. | Read it before you pick colours, accents or check contrast. |
11
11
  | [The full state set](state-set.md) | Focus rings, busy controls, errors and screen loading. | Read it before you build focus, busy, error or loading states. |
12
12
  | [Empty states](empty-states.md) | An empty page or list and a no-matches message. | Read it when a screen can show no content. |
13
- | [Component choice](component-choice.md) | Buttons, dialogs, toasts, tabs, segmented controls and dropdown search. | Read it before you choose a control, a dialog or a notice. |
13
+ | [Component choice](component-choice.md) | Buttons, dialogs, toasts, tabs, segmented controls, dropdown search and where a panel opens. | Read it before you choose a control, a dialog or a notice. |
14
14
  | [Microcopy and tone](microcopy.md) | Names for controls and their current state. | Read it before you name controls or states. |
15
15
  | [Text length](text-length.md) | Labels, buttons, captions, callouts and introductions. | Read it when you write labels, captions or callouts. |
16
16
  | [Labels and titles](labels-and-titles.md) | Text ink, sentence case, card titles and eyebrows. | Read it when you write labels, titles or eyebrows. |
@@ -54,6 +54,20 @@
54
54
 
55
55
  **Don't:** Give those same list filters tab roles when they have no separate panels.
56
56
 
57
+ ## Open a panel at its control
58
+
59
+ <!-- rule: panel-origin -->
60
+
61
+ **Rule:** A panel opens next to the control that opened it.
62
+
63
+ **Why:** The eye and pointer are already there; a far-edge drawer looks unrelated to its button.
64
+
65
+ **Except:** A dialog that asks a question opens in the screen centre.
66
+
67
+ **Do:** Open a drawer, menu or popover beside its button.
68
+
69
+ **Don't:** Open that drawer across the page from its button.
70
+
57
71
  ## Group one category at a time
58
72
 
59
73
  <!-- rule: one-category -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.162.3",
3
+ "version": "0.163.1",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
@@ -951,6 +951,9 @@ type AppShellProps = {
951
951
  sections: AppShellSection[];
952
952
  /** The vanilla rail layout, or the existing band layout. */
953
953
  layout?: 'rail' | 'topbar';
954
+ /** The side the phone menu drawer opens from. By default it is the menu button's side:
955
+ * right in the topbar layout, left in the rail layout (#790). */
956
+ drawerSide?: 'left' | 'right';
954
957
  /** Current router pathname; the longest matching section wins. */
955
958
  pathname: string;
956
959
  title: string;
@@ -993,7 +996,7 @@ type AppShellProps = {
993
996
  /** Spread linkProps onto the router link, including children and onClick. */
994
997
  renderLink?: (section: AppShellSection, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
995
998
  };
996
- declare function AppShell({ sections, pathname, title, children, word, brand, layout, brandHref, width, back, lede, actions, tools, bandControl, headControl, account, accountItems, onSignOut, searchLabel, defaultCollapsed, palette, onNavigate, renderLink }: AppShellProps): react.JSX.Element;
999
+ declare function AppShell({ sections, pathname, title, children, word, brand, layout, drawerSide, brandHref, width, back, lede, actions, tools, bandControl, headControl, account, accountItems, onSignOut, searchLabel, defaultCollapsed, palette, onNavigate, renderLink }: AppShellProps): react.JSX.Element;
997
1000
 
998
1001
  type AuthShellProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
999
1002
  brand: ReactNode;
@@ -4910,6 +4910,7 @@ function AppShell({
4910
4910
  word = "apliteni-ui",
4911
4911
  brand,
4912
4912
  layout = "topbar",
4913
+ drawerSide,
4913
4914
  brandHref = "/",
4914
4915
  width = "centered",
4915
4916
  back,
@@ -5074,7 +5075,7 @@ function AppShell({
5074
5075
  open: menu,
5075
5076
  onClose: () => setMenu(false),
5076
5077
  title: word,
5077
- side: "left",
5078
+ side: drawerSide ?? "left",
5078
5079
  size: "sm",
5079
5080
  footer: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: accountBlock() }),
5080
5081
  children: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: sidebar("Menu sections") })
@@ -5149,7 +5150,7 @@ function AppShell({
5149
5150
  open: menu,
5150
5151
  onClose: () => setMenu(false),
5151
5152
  title: word,
5152
- side: "left",
5153
+ side: drawerSide ?? "right",
5153
5154
  size: "sm",
5154
5155
  initialFocusRef: firstRow,
5155
5156
  headerActions: headSlot,
@@ -97,6 +97,8 @@
97
97
  gap: var(--space-3);
98
98
  padding: 0 var(--space-4);
99
99
  border-bottom: 1px solid var(--border);
100
+ /* The panel's inner corner, so the inward ring follows it. */
101
+ border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
100
102
  }
101
103
  .ui-cmdk__search-ic {
102
104
  display: inline-flex;
@@ -377,7 +377,7 @@
377
377
  .ui-app__search:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
378
378
  /* The same glyph the palette draws in its own search box, at the same box and the
379
379
  same stroke: the trigger and the thing it opens are not two search marks.
380
- src/styles/command-palette.css:108 `.ui-cmdk__search-ic svg` */
380
+ src/styles/command-palette.css:110 `.ui-cmdk__search-ic svg` */
381
381
  .ui-app__search-ic { display: flex; flex: none; }
382
382
  .ui-app__search-ic svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.2; }
383
383
  /* Part of the button's name, so it is squeezed rather than dropped: an ellipsis
@@ -86,8 +86,10 @@
86
86
  ground the rail stands on, so layout.css takes it the next rung where the rail
87
87
  is itself --surface. #475 r33/r34. why: docs/components.md#the-page-shell */
88
88
 
89
- .ui-nav__item:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
90
- .ui-nav__item.is-active:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
89
+ /* Drawn inward: rows stand 2px apart, so an outward band crossed into the next row.
90
+ why: docs/foundations.md#the-focus-ring */
91
+ .ui-nav__item:focus-visible { outline: var(--ring-scroll); outline-offset: var(--ring-scroll-offset); }
92
+ .ui-nav__item.is-active:focus-visible { outline: var(--ring-scroll); outline-offset: var(--ring-scroll-offset); }
91
93
 
92
94
  .ui-nav__ic { display: inline-flex; flex: none; }
93
95
  .ui-nav__ic svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.2; opacity: 0.72; }