@apliteni/apliteni-ui 0.162.2 → 0.163.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.
@@ -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
@@ -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
@@ -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 -->
@@ -92,7 +92,7 @@
92
92
 
93
93
  <!-- rule: pinned-identity-sub-lines -->
94
94
 
95
- **Why:** An ellipsis cannot cut a flex or grid box, so the name spills past the cell. No specimen draws it, because the cut needs a phone viewport.
95
+ **Why:** An ellipsis cannot cut a flex or grid box, so the name spills past the cell.
96
96
 
97
97
  **Rule:** A pinned identity sub-line is running text.
98
98
 
@@ -82,7 +82,7 @@
82
82
 
83
83
  **Rule:** Use a row where the file joins a list on the page, a region when one panel owns the file, and a dialog only when the upload needs answers of its own.
84
84
 
85
- **Why:** A dialog that asks nothing is one more thing to dismiss. A drawing would show one container, not the choice.
85
+ **Why:** A dialog that asks nothing is one more thing to dismiss.
86
86
 
87
87
  **Do:** Take a statement into the row under the statements it joins.
88
88
 
@@ -38,4 +38,4 @@
38
38
 
39
39
  **Do:** The basis once, in a caption each change references or beside one exception; the caption before and outside every figure.
40
40
 
41
- **Don't:** A title attribute, the note below the tiles or inside the first figure, no basis, nested captions.
41
+ **Don't:** The caption below the tiles, after the changes it explains.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.162.2",
3
+ "version": "0.163.0",
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,