@sparkvault/sdk-js 17.0.2 → 18.0.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.
package/README.md CHANGED
@@ -375,13 +375,90 @@ contact uses the same native Identity verification in both layouts.
375
375
  follow it.
376
376
 
377
377
  The shared journey uses the desk's `branding.color` for actions, links and
378
- focus rings. Its scoped `--hd-accent`, `--hd-on-accent`, `--hd-accent-ink`,
379
- `--hd-accent-hover` and `--hd-focus` properties also work on unrelated widget
380
- hosts. Labels choose white or product ink to maintain 4.5:1 contrast; the rare
381
- mid-tone fill that cannot support either is darkened to meet that floor.
382
- Dark fills deepen by 10% on hover; light fills keep their accessible pairing.
383
- Links and focus rings use product ink when a light brand color is unreadable
384
- on the support surface. Without a valid brand color, existing defaults apply.
378
+ focus rings, paired by the same rule as the hosted portal: a label takes white
379
+ or product ink, whichever reads more strongly; the rare mid-tone fill that
380
+ supports neither at 4.5:1 is moved in lightness, at its own hue, until one
381
+ does; links and focus rings use product ink where the color does not read at
382
+ 4.5:1 on white and on the light canvas tone; and under the pointer a fill moves
383
+ a visible step further from its label, darker under white and lighter under
384
+ ink, or toward its label where the fill already sits at that end of the range
385
+ (black under white, white under ink). The widget's launcher
386
+ (`.sv-support-launcher`), its panel (`.svhs-panel`), the request form's
387
+ container (`.svhd-container`, from `mountForm` and inside the panel) and the
388
+ form's modal (`.svhd-modal`, from `openForm`) each carry that pairing for a
389
+ light page (`--hd-light-accent`,
390
+ `--hd-light-on-accent`, `--hd-light-accent-ink`, `--hd-light-accent-hover`)
391
+ and one for a dark page (the same names under `--hd-dark-`), whose fill and
392
+ its hover stand at 3:1 and whose text reads at 4.5:1 on the design system's
393
+ dark grounds (`#071217` and `#0d1a20`). Without a valid brand color, both
394
+ pairings are the defaults the hosted portal paints too: on a light page the
395
+ design system's primary button blue under white, with Action Blue for links
396
+ and focus rings, and on a dark page their dark-scheme blues. The launcher's
397
+ focus ring opens with a white and a near-black band, so it shows on any page
398
+ color, and rings in the desk's color outside them.
399
+
400
+ The widget's colors are custom properties a page can set, to theme it or to
401
+ give it a dark scheme of the page's own. The widget never follows the reader's
402
+ color scheme by itself: on a page that sets none, it paints its light colors
403
+ and the light pairing. The neutral properties apply from any ancestor of the
404
+ widget, so a page that uses `--hd-` names of its own for something else scopes
405
+ them to its own elements, away from the widget's. The accent properties take
406
+ precedence over the desk's pairing, so a page gives the widget a dark scheme by
407
+ pointing them at the dark pairing on the elements that carry it: a custom
408
+ property resolves `var()` where it is declared, and only those elements hold
409
+ the pairing. For example, on a page whose dark scheme follows the reader's
410
+ setting:
411
+
412
+ ```css
413
+ @media (prefers-color-scheme: dark) {
414
+ body {
415
+ --hd-surface: #0d1a20;
416
+ --hd-canvas: #071217;
417
+ --hd-field: #030a0e;
418
+ --hd-hover: #1b2b33;
419
+ --hd-fill: #1b2b33;
420
+ --hd-fill-strong: #2f434d;
421
+ --hd-line-strong: #5e757f;
422
+ --hd-selection: #1b2e4c;
423
+ --hd-ink: #f0f5f7;
424
+ --hd-text-body: #c9d6dc;
425
+ --hd-text-muted: #91a5ae;
426
+ --hd-error: #ff6e62;
427
+ }
428
+ .sv-support-launcher,
429
+ .svhs-panel,
430
+ .svhd-container,
431
+ .svhd-modal {
432
+ --hd-accent: var(--hd-dark-accent);
433
+ --hd-on-accent: var(--hd-dark-on-accent);
434
+ --hd-accent-hover: var(--hd-dark-accent-hover);
435
+ --hd-accent-ink: var(--hd-dark-accent-ink);
436
+ }
437
+ }
438
+ ```
439
+
440
+ A page whose dark grounds are lighter than the design system's should check
441
+ that the dark pairing still reads on them.
442
+
443
+ | Property | Paints |
444
+ | --- | --- |
445
+ | `--hd-accent` | A primary action's fill; else `--hd-light-accent` |
446
+ | `--hd-on-accent` | The label on that fill; else `--hd-light-on-accent` |
447
+ | `--hd-accent-hover` | That fill under the pointer; else `--hd-light-accent-hover` |
448
+ | `--hd-accent-ink` | Links and text actions; else `--hd-light-accent-ink` |
449
+ | `--hd-focus` | Focus rings; else `--hd-accent-ink` |
450
+ | `--hd-surface` | The panel, its cards and a secondary action's fill |
451
+ | `--hd-canvas` | Quiet grounds inside the panel: the question's recap, the sign-in notice, code, an attachment |
452
+ | `--hd-field` | A field's ground |
453
+ | `--hd-hover` | A search result, the back action or a secondary action under the pointer |
454
+ | `--hd-fill` | An icon control under the pointer, and the quietest rules |
455
+ | `--hd-fill-strong` | The panel's rules and edges |
456
+ | `--hd-line-strong` | A field's and a secondary action's edge, and a quote's rule |
457
+ | `--hd-selection` | The message box's ground while files are dragged over it |
458
+ | `--hd-ink` | Headings and primary text |
459
+ | `--hd-text-body` | Body text |
460
+ | `--hd-text-muted` | Secondary text |
461
+ | `--hd-error` | Error text and an invalid field's edge |
385
462
 
386
463
  With `persist: true`, recoverable issue text, anonymous summary and details edits
387
464
  and verified requester drafts stay in this browser tab for 30 minutes. The
@@ -410,9 +487,10 @@ one-line question starts as the Summary, a longer one as the details. Files
410
487
  attach from the details composer by its Attach control, paste or drop. A
411
488
  verified website session sends from that step, named in a "Posting as" line,
412
489
  without another login. Anonymous visitors continue to a second step that asks
413
- nothing: **Sign in and send** opens the native auth.SV Identity window, which
414
- offers the accounts already signed in on the browser or a fresh sign-in, before
415
- the request is sent. An inline (`target`) wizard asks before its page is left
490
+ nothing: **Sign in and send** opens Help Desk's sign-in window
491
+ (`https://signin.help.sv`), which signs the visitor in with an auth.SV account
492
+ and asks them to confirm the website and the account before the request is
493
+ sent. An inline (`target`) wizard asks before its page is left
416
494
  with an unsent request. "Switch account" changes only the support account, once
417
495
  the window answers with one (closing it changes nothing); "Sign out" ends the
418
496
  support session without a window and revokes it, even a session the host lent
@@ -644,8 +722,7 @@ own `onError`.
644
722
  A host can also supply an existing server-issued desk session through
645
723
  `getSessionToken` or `onAuthRequired`; never construct a session from browser
646
724
  user IDs/emails. Return the session answer from `onAuthRequired` and let the form
647
- install it, rather than calling `setSession` inside the callback. Identity-mode
648
- completion remains restricted to desk portal origins. See the
725
+ install it, rather than calling `setSession` inside the callback. See the
649
726
  [website integration guide](https://github.com/Spark-Vault/platform/blob/main/docs/HELP_DESK_WEBSITE_INTEGRATION.md)
650
727
  and [company-session contract](https://github.com/Spark-Vault/platform/blob/main/docs/HELP_DESK_IDENTITY_HANDOFF.md).
651
728