@sparkvault/sdk-js 16.4.0 → 16.4.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/dist/index.cjs CHANGED
@@ -4396,15 +4396,108 @@ class LoadingView {
4396
4396
  }
4397
4397
  }
4398
4398
 
4399
+ /**
4400
+ * The sign-in providers' marks and the social networks' marks, each stated
4401
+ * once: the identity dialog (the browser SDK, which bundles this module) and
4402
+ * the console's Identity page draw the providers from here, and the marketing
4403
+ * site's footer and the help center's X post cards draw the networks, so no
4404
+ * two surfaces show one brand two ways.
4405
+ *
4406
+ * Every mark sits in one 24-unit box (BRAND_MARK_VIEWBOX), in one of two
4407
+ * forms, so each surface takes only the form it draws:
4408
+ * - BRAND_MARK_LAYERS: a sign-in provider's mark in its owner's colors, its
4409
+ * shapes painted in order, each `{ d, fill }`. A letter its owner draws
4410
+ * white (Facebook's "f", LinkedIn's "in") is a white shape over a solid
4411
+ * ground, never a cut-out, so a dark button cannot show through it. A
4412
+ * one-color logo (Apple, GitHub) fills with `currentColor`, taking the
4413
+ * color its surface sets for its icons.
4414
+ * - BRAND_MARK_SILHOUETTES: a network's mark as one shape with its letters
4415
+ * cut out, for a surface that paints it in one color.
4416
+ *
4417
+ * Facebook's, LinkedIn's, Instagram's and X's shapes are Simple Icons'
4418
+ * (CC0-1.0): Instagram's, Facebook's and X's from 16.38.0, LinkedIn's from
4419
+ * 13.21.0, the last release that ships it. Each silhouette is that path
4420
+ * exactly. LinkedIn's colored form is the silhouette's square and letters
4421
+ * apart; Facebook's is its whole circle under the cut-out "f", closed along
4422
+ * that circle.
4423
+ *
4424
+ * Browser-safe and import-free.
4425
+ */
4426
+
4427
+ /** The box every mark is drawn in. */
4428
+ const BRAND_MARK_VIEWBOX = '0 0 24 24';
4429
+
4430
+ /**
4431
+ * Facebook's "f", from its left foot on the circle's edge up and around to its
4432
+ * right foot, (13.454, 23.956), also on the edge. The circle is centered on
4433
+ * (12, 12.044) with radius 12.
4434
+ */
4435
+ const FACEBOOK_F_OUTLINE = 'M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245';
4436
+
4437
+ /** The short way along the circle's edge between the f's feet, closing the "f" itself. */
4438
+ const FACEBOOK_F_FOOT = 'A12 12 0 0 1 9.101 23.691Z';
4439
+
4440
+ /** Facebook's whole circle, the ground its white "f" stands on. */
4441
+ const FACEBOOK_DISC = 'M24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12 5.373 12 12 12 12-5.373 12-12Z';
4442
+
4443
+ /** LinkedIn's "in": the n, the i's dot, the i's stem. */
4444
+ const LINKEDIN_IN = 'M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452z';
4445
+
4446
+ /** LinkedIn's rounded square, the ground its white "in" stands on. */
4447
+ const LINKEDIN_SQUARE = 'M22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z';
4448
+
4449
+ /** A white letter on its owner's ground. */
4450
+ const WHITE = '#FFFFFF';
4451
+
4452
+ function deepFreeze(value) {
4453
+ for (const child of Object.values(value)) {
4454
+ if (child && typeof child === 'object') deepFreeze(child);
4455
+ }
4456
+ return Object.freeze(value);
4457
+ }
4458
+
4459
+ /**
4460
+ * Each sign-in provider's mark in its owner's colors, by the identity
4461
+ * methods' icon name. Pure, so a bundle that draws no provider drops it.
4462
+ */
4463
+ const BRAND_MARK_LAYERS = /* @__PURE__ */ deepFreeze({
4464
+ google: [
4465
+ { d: 'M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z', fill: '#4285F4' },
4466
+ { d: 'M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z', fill: '#34A853' },
4467
+ { d: 'M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z', fill: '#FBBC05' },
4468
+ { d: 'M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z', fill: '#EA4335' },
4469
+ ],
4470
+ apple: [
4471
+ { d: 'M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z', fill: 'currentColor' },
4472
+ ],
4473
+ microsoft: [
4474
+ { d: 'M1 1h10v10H1z', fill: '#F25022' },
4475
+ { d: 'M1 13h10v10H1z', fill: '#00A4EF' },
4476
+ { d: 'M13 1h10v10H13z', fill: '#7FBA00' },
4477
+ { d: 'M13 13h10v10H13z', fill: '#FFB900' },
4478
+ ],
4479
+ github: [
4480
+ { d: 'M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z', fill: 'currentColor' },
4481
+ ],
4482
+ facebook: [
4483
+ { d: FACEBOOK_DISC, fill: '#0866FF' },
4484
+ { d: FACEBOOK_F_OUTLINE + FACEBOOK_F_FOOT, fill: WHITE },
4485
+ ],
4486
+ linkedin: [
4487
+ { d: LINKEDIN_SQUARE, fill: '#0A66C2' },
4488
+ { d: LINKEDIN_IN, fill: WHITE },
4489
+ ],
4490
+ });
4491
+
4399
4492
  /**
4400
4493
  * SVG Icon Factory
4401
4494
  *
4402
4495
  * Bare outline glyphs per the SparkVault design system: stroke `currentColor`
4403
4496
  * so the stylesheet drives color, no tinted container backgrounds, round
4404
- * caps/joins. The sign-in providers' marks are the one exception: each is its
4405
- * owner's filled logo, in the owner's colors, or in `currentColor` where the
4406
- * owner's mark is one-color (Apple, GitHub). Uses proper DOM element creation
4407
- * for security.
4497
+ * caps/joins. The sign-in providers' marks are their owners' filled logos,
4498
+ * drawn from `@sparkvault/app-sdk/brand-marks` in their owners' colors, a
4499
+ * one-color logo (Apple, GitHub) in `currentColor`. Uses proper DOM element
4500
+ * creation for security.
4408
4501
  */
4409
4502
  function createSvgElement(viewBox, width = 16, height = 16) {
4410
4503
  const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
@@ -4554,17 +4647,12 @@ function methodIconGlyph(iconName) {
4554
4647
  case 'link':
4555
4648
  return createLinkIcon();
4556
4649
  case 'google':
4557
- return createGoogleIcon();
4558
4650
  case 'apple':
4559
- return createAppleIcon();
4560
4651
  case 'microsoft':
4561
- return createMicrosoftIcon();
4562
4652
  case 'github':
4563
- return createGithubIcon();
4564
4653
  case 'facebook':
4565
- return createFacebookIcon();
4566
4654
  case 'linkedin':
4567
- return createLinkedinIcon();
4655
+ return createBrandMarkIcon(iconName);
4568
4656
  case 'building':
4569
4657
  return createBuildingIcon();
4570
4658
  case 'users':
@@ -4646,43 +4734,15 @@ function createLinkIcon() {
4646
4734
  svg.appendChild(createPath('M11.67 9.17a3.75 3.75 0 00-5.66-.41l-2.25 2.25a3.75 3.75 0 005.3 5.3l1.28-1.28'));
4647
4735
  return svg;
4648
4736
  }
4649
- function createGoogleIcon() {
4650
- const svg = createSvgElement('0 0 20 20', 20, 20);
4651
- svg.appendChild(createPath('M18.8 10.21c0-.65-.06-1.28-.17-1.88H10v3.55h4.93c-.21 1.14-.87 2.11-1.84 2.76v2.3h2.98c1.73-1.6 2.73-3.96 2.73-6.73z', { fill: '#4285F4' }));
4652
- svg.appendChild(createPath('M10 19.17c2.48 0 4.55-.82 6.07-2.23l-2.98-2.3c-.82.55-1.86.88-3.09.88-2.38 0-4.4-1.6-5.13-3.77H1.82v2.37c1.52 3.02 4.6 5.05 8.18 5.05z', { fill: '#34A853' }));
4653
- svg.appendChild(createPath('M4.87 11.74c-.18-.55-.29-1.14-.29-1.74s.1-1.19.29-1.74V5.89H1.82c-.6 1.23-.94 2.6-.94 4.11s.34 2.88.94 4.11l3.05-2.37z', { fill: '#FBBC05' }));
4654
- svg.appendChild(createPath('M10 4.48c1.35 0 2.55.47 3.5 1.37l2.63-2.63C14.53 1.74 12.47.83 10 .83c-3.58 0-6.66 2.03-8.18 5.05l3.05 2.37c.72-2.17 2.75-3.77 5.13-3.77z', { fill: '#EA4335' }));
4655
- return svg;
4656
- }
4657
- function createAppleIcon() {
4658
- const svg = createSvgElement('0 0 20 20', 20, 20);
4659
- svg.setAttribute('fill', 'currentColor');
4660
- svg.appendChild(createPath('M14.21 16.9c-.82.79-1.71.67-2.57.29-.91-.38-1.74-.4-2.7 0-1.2.51-1.83.37-2.55-.29C2.7 12.71 3.3 6.33 7.54 6.09c1.13.06 1.91.61 2.57.66.98-.2 1.92-.78 2.97-.7 1.26.1 2.21.6 2.83 1.5-2.6 1.56-1.98 4.99.4 5.94-.48 1.25-1.09 2.49-2.11 3.41h.01zM10.02 6.04c-.12-1.86 1.38-3.39 3.11-3.54.24 2.15-1.95 3.75-3.11 3.54z'));
4661
- return svg;
4662
- }
4663
- function createMicrosoftIcon() {
4664
- const svg = createSvgElement('0 0 20 20', 20, 20);
4665
- svg.appendChild(createPath('M1 1h8.33v8.33H1z', { fill: '#F25022' }));
4666
- svg.appendChild(createPath('M1 10.67h8.33V19H1z', { fill: '#00A4EF' }));
4667
- svg.appendChild(createPath('M10.67 1H19v8.33h-8.33z', { fill: '#7FBA00' }));
4668
- svg.appendChild(createPath('M10.67 10.67H19V19h-8.33z', { fill: '#FFB900' }));
4669
- return svg;
4670
- }
4671
- function createGithubIcon() {
4672
- const svg = createSvgElement('0 0 20 20', 20, 20);
4673
- svg.setAttribute('fill', 'currentColor');
4674
- svg.appendChild(createPath('M10 0C4.48 0 0 4.48 0 10c0 4.42 2.86 8.17 6.84 9.49.5.09.68-.22.68-.48 0-.24-.01-1.02-.01-1.86-2.51.46-3.16-.61-3.36-1.18-.11-.29-.6-1.18-1.02-1.41-.35-.19-.85-.65-.01-.66.79-.01 1.35.72 1.54 1.02.9 1.51 2.34 1.09 2.91.83.09-.65.35-1.09.64-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.99 1.02-2.69-.1-.25-.45-1.27.1-2.65 0 0 .84-.27 2.75 1.02.8-.22 1.65-.33 2.5-.33s1.7.11 2.5.33c1.91-1.3 2.75-1.02 2.75-1.02.55 1.38.2 2.4.1 2.65.64.7 1.02 1.59 1.02 2.69 0 3.84-2.34 4.69-4.57 4.94.36.31.67.91.67 1.85 0 1.34-.01 2.41-.01 2.75 0 .27.18.58.69.48C17.14 18.16 20 14.42 20 10c0-5.52-4.48-10-10-10z'));
4675
- return svg;
4676
- }
4677
- /** Facebook's mark and blue as Simple Icons (CC0-1.0) draws them, in its own 24-unit box. */
4678
- function createFacebookIcon() {
4679
- const svg = createSvgElement('0 0 24 24', 20, 20);
4680
- svg.appendChild(createPath('M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z', { fill: '#0866FF' }));
4681
- return svg;
4682
- }
4683
- function createLinkedinIcon() {
4684
- const svg = createSvgElement('0 0 20 20', 20, 20);
4685
- svg.appendChild(createPath('M17.04 17.04h-2.96v-4.64c0-1.11-.02-2.53-1.54-2.53-1.55 0-1.78 1.2-1.78 2.45v4.73H7.8V7.5h2.84v1.3h.04c.4-.75 1.36-1.54 2.81-1.54 3 0 3.56 1.98 3.56 4.55v5.24zM4.45 6.19c-.95 0-1.72-.77-1.72-1.72s.77-1.72 1.72-1.72 1.72.77 1.72 1.72-.77 1.72-1.72 1.72zm1.48 10.85H2.96V7.5h2.97v9.54zM18.52 0H1.47C.66 0 0 .65 0 1.44v17.12c0 .79.66 1.44 1.48 1.44h17.04c.82 0 1.48-.65 1.48-1.44V1.44c0-.79-.66-1.44-1.48-1.44z', { fill: '#0A66C2' }));
4737
+ /**
4738
+ * A sign-in provider's mark: its layers painted in order, each path carrying
4739
+ * its layer's own fill, which the svg's `fill="none"` never reaches.
4740
+ */
4741
+ function createBrandMarkIcon(name) {
4742
+ const svg = createSvgElement(BRAND_MARK_VIEWBOX, 20, 20);
4743
+ for (const { d, fill } of BRAND_MARK_LAYERS[name]) {
4744
+ svg.appendChild(createPath(d, { fill }));
4745
+ }
4686
4746
  return svg;
4687
4747
  }
4688
4748
  function createBuildingIcon() {
@@ -6398,8 +6458,9 @@ class ErrorView {
6398
6458
  * neutrals. The published bundle cannot read those CSS files, so the values
6399
6459
  * the widgets use are mirrored here, each naming the token it mirrors.
6400
6460
  * tests/ds-tokens.test.ts holds every value to the design system's own, and
6401
- * refuses a hex color anywhere else in the SDK's source (provider logos keep
6402
- * their owners' colors) and an rgba() whose color is not the design system's.
6461
+ * refuses a hex color anywhere else in the SDK's source and an rgba() whose
6462
+ * color is not the design system's. The sign-in providers' marks keep their
6463
+ * owners' colors, which live in @sparkvault/app-sdk/brand-marks.
6403
6464
  */
6404
6465
  /** The design-system token each mirrored value is. */
6405
6466
  /** The design system's values for {@link DS_TOKEN_SOURCES}. */
@@ -29557,7 +29618,7 @@ class SparkVault {
29557
29618
  }
29558
29619
  /** Get the SDK version */
29559
29620
  static get version() {
29560
- return '16.4.0';
29621
+ return '16.4.1';
29561
29622
  }
29562
29623
  }
29563
29624
  if (typeof window !== 'undefined') {