@apliteni/apliteni-ui 0.188.0 → 0.189.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.
@@ -982,6 +982,9 @@ destructive question.
982
982
  body scrolls, and the title, the close control and the footer stay visible. The title is an `h2`.
983
983
  `initialFocusRef` chooses the first focus.
984
984
 
985
+ `size="sm"` gives a 360px panel for a short sign-in form. Without `size`, Modal uses its default
986
+ wide panel.
987
+
985
988
  **On a phone.** At 560px and narrower, with a coarse pointer, each footer button has a 44px tap
986
989
  zone. The buttons keep their drawn size.
987
990
 
@@ -31,4 +31,5 @@ Each row names one guideline page, the screen parts it covers, and when to read
31
31
  | [Going back](going-back.md) | The back link, its destination and the parent address. | Read it when a page sits under another page. |
32
32
  | [Account and settings](account-and-settings.md) | The account window, the account menu and settings rows. | Read it before you build the account menu or settings. |
33
33
  | [Notifications](notifications.md) | The bell, its unread count, read state and a failed load. | Read it before you build a bell or a notifications list. |
34
+ | [Session expired](session-expired.md) | A session-ended dialog, its page state and its lasting sign-in notice. | Read it before you handle an ended session. |
34
35
  | [Guidelines](overview.md) | No screen parts. The file holds only the collection heading. | Read it only for the heading. The six-card overview is in Storybook, not in the package. |
@@ -0,0 +1,61 @@
1
+ # Session expired
2
+
3
+ ## Sign in on the same page
4
+
5
+ <!-- rule: sign-in-same-page -->
6
+
7
+ **Rule:** When a session ends, open a sign-in dialog over the current page.
8
+
9
+ **Why:** The reader can see where work will continue.
10
+
11
+ **Do:** Open “Sign in again” over Payouts.
12
+
13
+ **Don't:** Send the reader to a sign-in page.
14
+
15
+ ## Keep the work
16
+
17
+ <!-- rule: keep-work -->
18
+
19
+ **Rule:** After sign-in, return the reader to the same place with the same input and filters.
20
+
21
+ **Why:** The reader loses time when they must set the search and filter again.
22
+
23
+ **Do:** Keep the search text and the pending filter.
24
+
25
+ **Don't:** Clear the search text or the filter.
26
+
27
+ ## Say that the session ended
28
+
29
+ <!-- rule: say-session-ended -->
30
+
31
+ **Rule:** Say that the session ended and that sign-in continues the work.
32
+
33
+ **Why:** The reader needs to know why the dialog opened.
34
+
35
+ **Do:** Say “Your session ended. Sign in to keep working.”
36
+
37
+ **Don't:** Say only “Sign in required.”
38
+
39
+ ## Keep the shell and title
40
+
41
+ <!-- rule: skeleton-behind-dialog -->
42
+
43
+ **Rule:** Keep the page shell and title, and replace page data with skeleton shapes until sign-in.
44
+
45
+ **Why:** The reader keeps their place without seeing protected data.
46
+
47
+ **Do:** Keep Payouts and show a table-shaped skeleton.
48
+
49
+ **Don't:** Blank the whole page behind the dialog.
50
+
51
+ ## Keep a way back in
52
+
53
+ <!-- rule: lasting-sign-in -->
54
+
55
+ **Rule:** If the reader closes the dialog, keep a lasting notice with a Sign in button on the page.
56
+
57
+ **Why:** The reader can sign in when ready without losing the page.
58
+
59
+ **Do:** Show “You are signed out” with Sign in.
60
+
61
+ **Don't:** Remove the dialog and show no sign-in action.
@@ -122,7 +122,7 @@
122
122
 
123
123
  **Don't:** Open one automatically when the page loads.
124
124
 
125
- **Except:** When a session ends while the reader works, open a sign-in dialog over the page and keep the page as it was.
125
+ **Except:** When a session ends while the reader works, open a sign-in dialog over the page, keep its shell and title, and replace its data with skeleton shapes until sign-in.
126
126
 
127
127
  ## Keep table density consistent
128
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.188.0",
3
+ "version": "0.189.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
@@ -287,6 +287,9 @@
287
287
  .rx-scrim.is-open .rx-modal {
288
288
  transform: none;
289
289
  }
290
+ .rx-modal--sm {
291
+ width: min(calc(var(--panel-sm) + var(--space-10)), 96vw);
292
+ }
290
293
  .rx-modal__head {
291
294
  display: flex;
292
295
  align-items: center;
@@ -212,10 +212,11 @@ type ModalProps = {
212
212
  onClose: () => void;
213
213
  footer?: ReactNode;
214
214
  children?: ReactNode;
215
+ size?: 'sm';
215
216
  role?: 'dialog' | 'alertdialog';
216
217
  initialFocusRef?: RefObject<HTMLElement | null>;
217
218
  };
218
- declare function Modal({ open, title, onClose, footer, children, initialFocusRef, role }: ModalProps): react.ReactPortal | null;
219
+ declare function Modal({ open, title, onClose, footer, children, initialFocusRef, role, size }: ModalProps): react.ReactPortal | null;
219
220
 
220
221
  type AccountSection = {
221
222
  id: string;
@@ -1011,7 +1011,7 @@ function useDialog(active, { root, panel, body, initialFocus, fallbackFocus }, o
1011
1011
 
1012
1012
  // src/Modal.tsx
1013
1013
  import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
1014
- function Modal({ open, title, onClose, footer, children, initialFocusRef, role = "dialog" }) {
1014
+ function Modal({ open, title, onClose, footer, children, initialFocusRef, role = "dialog", size }) {
1015
1015
  const id = useId5();
1016
1016
  const titleId = `${id}-title`;
1017
1017
  const bodyId = `${id}-body`;
@@ -1025,7 +1025,7 @@ function Modal({ open, title, onClose, footer, children, initialFocusRef, role =
1025
1025
  /* @__PURE__ */ jsx13(DialogScope.Provider, { value: scope, children: /* @__PURE__ */ jsx13("div", { className: shown ? "rx-scrim is-open" : "rx-scrim", ref: root, onMouseDown: dismissOnScrim(onClose), children: /* @__PURE__ */ jsxs9(
1026
1026
  "div",
1027
1027
  {
1028
- className: "rx-modal",
1028
+ className: `rx-modal${size === "sm" ? " rx-modal--sm" : ""}`,
1029
1029
  role,
1030
1030
  "aria-modal": "true",
1031
1031
  "aria-labelledby": titleId,