@sovereignfs/ui 0.107.0 → 0.107.4
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/CHANGELOG.md +43 -0
- package/dist/AppFrame.module.css +6 -0
- package/dist/SettingsDialog.module.css +20 -0
- package/dist/index.d.ts +44 -9
- package/dist/index.js +477 -448
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,49 @@ versions follow [semver](https://semver.org/). A version's section is written in
|
|
|
5
5
|
and becomes the release notes when the version is published. This file starts at 0.96.0; earlier versions are in the repository's
|
|
6
6
|
history and tags.
|
|
7
7
|
|
|
8
|
+
## [0.107.4] - 2026-11-26
|
|
9
|
+
|
|
10
|
+
### Security
|
|
11
|
+
|
|
12
|
+
- A password could end up in the address. A form pressed before its script had run, on a slow connection for example,
|
|
13
|
+
was sent by the browser itself: a GET with every named box in the address, which the history and a reverse proxy’s
|
|
14
|
+
access log can keep. The submit button of `AuthButton`, and the buttons of `ChangePasswordForm` and
|
|
15
|
+
`LinkSovereignPanel`, are now off until the page is running, which also stops the Enter key. An app’s own forms that
|
|
16
|
+
use `AuthButton` are covered with it. A form meant to work without a script (`action={serverAction}`) uses `Button`.
|
|
17
|
+
- A script that sends a form itself, past its button, now sends it by POST, with nothing in the address: `AuthForm`,
|
|
18
|
+
`ChangePasswordForm`, `LinkSovereignPanel` and the password step of `TwoFactorPanel`. `AuthForm` is `method="post"`
|
|
19
|
+
only when it is given neither a `method` nor an `action`; an app that counted on the browser’s GET gives it
|
|
20
|
+
`method="get"`.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- `SignInForm` sends what is in its boxes. A password manager can fill them without telling the page (AutoFill on iOS, until a box
|
|
25
|
+
is focused), and the form then sent what it had last heard, usually nothing: "The email or password is incorrect" for a password
|
|
26
|
+
that was right. Its boxes are no longer held in React state, so drawing the form again cannot empty what was filled either.
|
|
27
|
+
- `SignUpForm`, `ResetPasswordForm`, `ChangePasswordForm`, `LinkSovereignPanel` and the password step of `TwoFactorPanel` had the
|
|
28
|
+
same fault and are fixed the same way: what is in their boxes is what is sent. What each hands to `onSubmit` is unchanged.
|
|
29
|
+
- `ExportPanel` reads its password box when it needs it. Its button is no longer greyed out while the box is empty, since a box filled
|
|
30
|
+
without a word to the page looked empty to it and left the button dead. Pressed with an empty box, the browser asks for it.
|
|
31
|
+
|
|
32
|
+
## [0.107.3] - 2026-11-25
|
|
33
|
+
|
|
34
|
+
This version carries 0.107.1 and 0.107.2, which were set on `develop` and never published.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- `IconPicker`'s panel is no longer cut off when the picker is at the left of a page. It opened leftwards from its trigger always, which
|
|
39
|
+
a scrolling page beside a sidebar clips; it now opens on the side with room, rightwards from a trigger at the left. `Popover`'s `align`
|
|
40
|
+
takes `auto` for this (`right`, its default side, where the panel fits, else `left`, counting as room only what is visible: the
|
|
41
|
+
viewport less what a scrolling ancestor would clip), and `IconPicker` has an `align` that defaults to `auto`. An explicit `left` or
|
|
42
|
+
`right` is unchanged, and so is every `Popover` that has one.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- `AppFrame`: the header's menu button draws its icon at 24px with a heavier stroke, in place of the 20px icon at the default weight, so it
|
|
47
|
+
stands beside an app's wordmark and reads as a button. Nothing else changes.
|
|
48
|
+
- `SettingsDialog`'s title row is compact: 49px on a desktop in place of 69, with the title at 18px in place of 20 and a 2rem close button (the × is where it was). A phone keeps the 44px
|
|
49
|
+
touch target and is 61px in place of 69. Only this dialog's header changes: `Dialog`, `Drawer` and `Sheet` have the shared one as before.
|
|
50
|
+
|
|
8
51
|
## [0.107.0] - 2026-11-23
|
|
9
52
|
|
|
10
53
|
### Added
|
package/dist/AppFrame.module.css
CHANGED
|
@@ -41,6 +41,12 @@
|
|
|
41
41
|
cursor: pointer;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/* The menu icon is the heaviest control in the header's corner, so it is drawn bolder than the icons around it (the Icon's stroke is 2),
|
|
45
|
+
* to stand beside the wordmark and to read as a button. Its size is the Icon's `lg`, set in the component. */
|
|
46
|
+
.toggle svg {
|
|
47
|
+
stroke-width: 2.5;
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
@media (hover: hover) {
|
|
45
51
|
.toggle:hover {
|
|
46
52
|
background: var(--sv-color-surface-sunken);
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
/* SettingsDialog — a side navigation and a section, inside a flush `Dialog`. The frame never changes size: the
|
|
2
2
|
* navigation and the section each scroll on their own. Tokens only. */
|
|
3
3
|
|
|
4
|
+
/* The title row, compact. In a dialog that is all navigation and content the title only names it, so the row is as tall as its close button and no
|
|
5
|
+
* more: the shared header's own is a 44px touch target with a row's padding round it, and the title a size larger. Through `Dialog`'s `rowClassName` and
|
|
6
|
+
* `titleClassName`, so that no other dialog, drawer or sheet changes. Where the pointer is a mouse the button is 2rem, its × as far from the edge as it
|
|
7
|
+
* was; where it is a finger it keeps the touch target. */
|
|
8
|
+
.headerRow {
|
|
9
|
+
padding-block: var(--sv-space-2);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.headerTitle {
|
|
13
|
+
font-size: var(--sv-font-size-lg);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@media (pointer: fine) {
|
|
17
|
+
.headerRow button {
|
|
18
|
+
width: 2rem;
|
|
19
|
+
height: 2rem;
|
|
20
|
+
margin-right: calc(-1 * (2rem - var(--sv-icon-size-sm)) / 2);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
4
24
|
.frame {
|
|
5
25
|
display: flex;
|
|
6
26
|
flex: 1 1 auto;
|
package/dist/index.d.ts
CHANGED
|
@@ -99,10 +99,18 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
99
99
|
*/
|
|
100
100
|
declare function Button({ variant, size, type, loading, disabled, className, children, ...rest }: ButtonProps): react.JSX.Element;
|
|
101
101
|
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
/**
|
|
103
|
+
* The form of a page before sign-in: its boxes one under another. Its script sends it. Should the browser send it all the same, because
|
|
104
|
+
* someone else's script called `submit()` on it, it goes by POST, so nothing in its boxes is put in the address. A form with a `method`
|
|
105
|
+
* or an `action` of the app's own is left as the app has it.
|
|
106
|
+
*/
|
|
107
|
+
declare function AuthForm({ className, action, method, ...rest }: FormHTMLAttributes<HTMLFormElement>): react.JSX.Element;
|
|
108
|
+
/**
|
|
109
|
+
* A button as wide as the card. A submit button sits a little apart from the box above it, and is off until the page is running: these
|
|
110
|
+
* forms are sent by their script, and a browser that sends one itself before that puts what is in it, the password included, in the
|
|
111
|
+
* address. For a form that is meant to work without a script (`action={serverAction}`), use `Button`.
|
|
112
|
+
*/
|
|
113
|
+
declare function AuthButton({ className, type, disabled, ...rest }: ButtonProps): react.JSX.Element;
|
|
106
114
|
/** The line between one way of signing in and another: "or". */
|
|
107
115
|
declare function AuthDivider({ children }: {
|
|
108
116
|
children?: ReactNode;
|
|
@@ -174,6 +182,9 @@ interface SignInFormProps {
|
|
|
174
182
|
/**
|
|
175
183
|
* The sign-in form of core and every app (auth.md §7): an email, a password, a passkey if the browser has one, and a way to create an
|
|
176
184
|
* account. It draws and collects; the consumer signs in (`@sovereignfs/auth/client`) and says what happened through its props.
|
|
185
|
+
*
|
|
186
|
+
* The boxes keep their own values and are read when the form is sent. A password manager can fill them without telling the page
|
|
187
|
+
* (AutoFill on iOS, until a box is focused): a copy kept in state would then be sent in their place, and written back over them.
|
|
177
188
|
*/
|
|
178
189
|
declare function SignInForm({ appName, notice, error, renderUnverified, unverified, pending, passkey, onSubmit, forgotPasswordHref, otherWays, signUpHref, renderLink, }: SignInFormProps): react.JSX.Element;
|
|
179
190
|
|
|
@@ -209,7 +220,10 @@ interface ResetPasswordFormProps {
|
|
|
209
220
|
newLinkHref: string;
|
|
210
221
|
renderLink?: AuthLinkRenderer;
|
|
211
222
|
}
|
|
212
|
-
/**
|
|
223
|
+
/**
|
|
224
|
+
* Setting a new password from an emailed link (auth.md §7), for core and every app. The boxes are read when the form is sent, as in
|
|
225
|
+
* `SignInForm`: a password manager can fill them without telling the page.
|
|
226
|
+
*/
|
|
213
227
|
declare function ResetPasswordForm({ passwordHint, error, expired, pending, onSubmit, signInHref, newLinkHref, renderLink, }: ResetPasswordFormProps): react.JSX.Element;
|
|
214
228
|
|
|
215
229
|
/** What a sign-up hands over. */
|
|
@@ -246,6 +260,9 @@ interface SignUpFormProps {
|
|
|
246
260
|
/**
|
|
247
261
|
* Creating an account (auth.md §7), for core and every app: a name, the address (an invitation's, when there is one), the password
|
|
248
262
|
* typed twice, and the terms when the app has them. Once a verification link is sent, it says so and waits.
|
|
263
|
+
*
|
|
264
|
+
* The boxes keep their own values and are read when the form is sent, as in `SignInForm`: a password manager can fill them without
|
|
265
|
+
* telling the page.
|
|
249
266
|
*/
|
|
250
267
|
declare function SignUpForm({ appName, passwordHint, invitedEmail, terms, error, pending, waitingFor, renderWaiting, onSubmit, signInHref, renderLink, }: SignUpFormProps): react.JSX.Element;
|
|
251
268
|
|
|
@@ -326,7 +343,11 @@ interface ChangePasswordFormProps {
|
|
|
326
343
|
next: string;
|
|
327
344
|
}) => void;
|
|
328
345
|
}
|
|
329
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* Changing the password (auth.md §7): it asks for the current one, and ends every other session. The boxes are read when the form is
|
|
348
|
+
* sent, as in `SignInForm`: a password manager can fill them without telling the page. The button is off until the page is running,
|
|
349
|
+
* as `AuthButton`'s is, so a browser never sends the passwords itself.
|
|
350
|
+
*/
|
|
330
351
|
declare function ChangePasswordForm({ error, done, pending, onSubmit, }: ChangePasswordFormProps): react.JSX.Element;
|
|
331
352
|
|
|
332
353
|
/** How a link came back from Sovereign: `done`, or why it was refused. */
|
|
@@ -639,8 +660,13 @@ interface PopoverProps {
|
|
|
639
660
|
trigger: ReactElement;
|
|
640
661
|
open: boolean;
|
|
641
662
|
onClose: () => void;
|
|
642
|
-
/**
|
|
643
|
-
|
|
663
|
+
/**
|
|
664
|
+
* Which edge of the trigger the panel aligns to: `'right'` opens it leftwards from the trigger, `'left'` rightwards.
|
|
665
|
+
* `'auto'` is `'right'` where the panel fits on that side and the other side where it does not, counting as room only
|
|
666
|
+
* what is visible: the viewport, less whatever a scrolling ancestor would clip (a trigger at the left of a page beside
|
|
667
|
+
* a sidebar has none to its left, though the viewport has). Default: 'right'.
|
|
668
|
+
*/
|
|
669
|
+
align?: 'left' | 'right' | 'auto';
|
|
644
670
|
/** Panel width in px, or `'trigger'` to match the trigger element's own
|
|
645
671
|
* rendered width exactly (e.g. a dropdown under a full-width form field,
|
|
646
672
|
* where a fixed pixel width would either overflow or leave a gap
|
|
@@ -3328,6 +3354,12 @@ interface IconPickerProps {
|
|
|
3328
3354
|
triggerLabel?: string;
|
|
3329
3355
|
disabled?: boolean;
|
|
3330
3356
|
className?: string;
|
|
3357
|
+
/**
|
|
3358
|
+
* Which edge of the trigger the panel aligns to (`Popover`'s `align`). Default `'auto'`: opens leftwards from the
|
|
3359
|
+
* trigger where there is room for it, and rightwards where there is not, so a picker at the left of a page, or of a
|
|
3360
|
+
* row, is never cut off.
|
|
3361
|
+
*/
|
|
3362
|
+
align?: 'left' | 'right' | 'auto';
|
|
3331
3363
|
}
|
|
3332
3364
|
/**
|
|
3333
3365
|
* IconPicker — a trigger button showing the current icon that opens a
|
|
@@ -3335,10 +3367,13 @@ interface IconPickerProps {
|
|
|
3335
3367
|
* bounded icon set (e.g. Sovereign Shopper's grocery category icons,
|
|
3336
3368
|
* SHP-05) rather than the full design-system icon library.
|
|
3337
3369
|
*
|
|
3370
|
+
* The panel opens on the side of the trigger that has room (`align`), so the picker can sit
|
|
3371
|
+
* at either end of a row.
|
|
3372
|
+
*
|
|
3338
3373
|
* Selecting an icon both closes the picker and calls `onChange` — a
|
|
3339
3374
|
* consumer's `onChange` never needs to close the picker itself.
|
|
3340
3375
|
*/
|
|
3341
|
-
declare function IconPicker({ value, onChange, options, 'aria-label': ariaLabel, triggerLabel, disabled, className, }: IconPickerProps): react.JSX.Element;
|
|
3376
|
+
declare function IconPicker({ value, onChange, options, 'aria-label': ariaLabel, triggerLabel, disabled, className, align, }: IconPickerProps): react.JSX.Element;
|
|
3342
3377
|
|
|
3343
3378
|
interface ColorPickerSwatch {
|
|
3344
3379
|
/** Accessible name and tooltip, e.g. "Sky". */
|