@le-space/ui 0.3.2 → 0.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/ui",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Floating Aleph sponsor relay UI components for Svelte and React.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -36,8 +36,8 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@le-space/browser": "0.3.2",
40
- "@le-space/core": "0.3.2",
39
+ "@le-space/browser": "0.3.3",
40
+ "@le-space/core": "0.3.3",
41
41
  "viem": "^2.38.5"
42
42
  },
43
43
  "peerDependencies": {
package/react/index.js CHANGED
@@ -2634,9 +2634,7 @@ function defaultState(props = {}) {
2634
2634
  sshPublicKey: props.sshPublicKey ?? "",
2635
2635
  instanceName: props.instanceName ?? DEFAULT_INSTANCE_NAME,
2636
2636
  tierId: DEFAULT_TIER_ID,
2637
- showAdvanced: Boolean(
2638
- props.manifestUrl && props.manifestUrl !== DEFAULT_MANIFEST_URL || props.manifestJson?.trim() || props.sshPublicKey?.trim()
2639
- ),
2637
+ showAdvanced: Boolean(props.manifestJson?.trim() || props.sshPublicKey?.trim()),
2640
2638
  showInstances: props.showInstances ?? true,
2641
2639
  showPasteManifest: Boolean(props.manifestJson?.trim()),
2642
2640
  busy: {
@@ -2674,6 +2672,14 @@ function defaultState(props = {}) {
2674
2672
  deploymentProgress: IDLE_DEPLOYMENT_PROGRESS
2675
2673
  };
2676
2674
  }
2675
+ function manifestLoadErrorState(error) {
2676
+ const message = error instanceof Error ? error.message : String(error);
2677
+ return {
2678
+ manifest: null,
2679
+ valid: false,
2680
+ errors: [message]
2681
+ };
2682
+ }
2677
2683
  function isDebugEnabled(props) {
2678
2684
  if (props.debug) {
2679
2685
  return true;
@@ -3461,15 +3467,15 @@ var SponsorRelayController = class {
3461
3467
  statusText: "Refreshing relay sponsor data"
3462
3468
  });
3463
3469
  try {
3464
- const manifestState = await resolveManifest({
3465
- manifestUrl: this.state.manifestUrl,
3466
- manifestJson: this.state.manifestJson
3467
- });
3468
- const manifest = manifestState.manifest;
3469
3470
  const [pricingSummary, crns] = await Promise.all([
3470
3471
  fetchInstancePricing(this.client.apiHost),
3471
3472
  this.client.fetchCrns()
3472
3473
  ]);
3474
+ const manifestState = await resolveManifest({
3475
+ manifestUrl: this.state.manifestUrl,
3476
+ manifestJson: this.state.manifestJson
3477
+ }).catch((error) => manifestLoadErrorState(error));
3478
+ const manifest = manifestState.manifest;
3473
3479
  let balance = this.state.balance;
3474
3480
  let instances = [];
3475
3481
  if (this.state.wallet.address) {
@@ -3959,11 +3965,11 @@ var basePanelStyle = {
3959
3965
  zIndex: 9999,
3960
3966
  width: "min(28rem, calc(100vw - 2rem))",
3961
3967
  overflow: "auto",
3962
- border: "1px solid rgba(255,255,255,0.12)",
3968
+ border: "1px solid var(--le-space-sponsor-relay-panel-border, rgba(199, 210, 254, 0.22))",
3963
3969
  borderRadius: "1.4rem",
3964
- background: "rgba(12,20,31,0.92)",
3970
+ background: "var(--le-space-sponsor-relay-panel-bg, rgba(49, 46, 129, 0.94))",
3965
3971
  color: "#f8fafc",
3966
- boxShadow: "0 28px 80px rgba(3,8,20,0.45)",
3972
+ boxShadow: "var(--le-space-sponsor-relay-panel-shadow, 0 28px 80px rgba(49, 46, 129, 0.34))",
3967
3973
  padding: "1rem",
3968
3974
  fontFamily: '"DM Sans", "Inter", sans-serif'
3969
3975
  };
@@ -3978,6 +3984,11 @@ var fieldStyle = {
3978
3984
  fontSize: "0.98rem",
3979
3985
  lineHeight: 1.45
3980
3986
  };
3987
+ var themedLauncherBackground = "linear-gradient(135deg, var(--le-space-sponsor-relay-launcher-start, #4f46e5) 0%, var(--le-space-sponsor-relay-launcher-end, #6366f1) 100%)";
3988
+ var themedLauncherBorder = "var(--le-space-sponsor-relay-launcher-border, rgba(199, 210, 254, 0.42))";
3989
+ var themedLauncherBadgeBackground = "var(--le-space-sponsor-relay-launcher-badge-bg, rgba(49, 46, 129, 0.92))";
3990
+ var themedLauncherBadgeBorder = "var(--le-space-sponsor-relay-launcher-badge-border, rgba(191, 219, 254, 0.24))";
3991
+ var themedLauncherDot = "var(--le-space-sponsor-relay-launcher-dot, #f59e0b)";
3981
3992
  function progressToneColor(status) {
3982
3993
  switch (status) {
3983
3994
  case "success":
@@ -4158,11 +4169,11 @@ function SponsorRelayFab(props) {
4158
4169
  const progressActive = state.deploymentProgress.stage !== "idle" && state.deploymentProgress.stage !== "completed" && state.deploymentProgress.stage !== "error";
4159
4170
  const deploymentProgressVisible = isDeploymentProgressVisible(state);
4160
4171
  const pulseScale = progressActive ? 1.03 : hovered ? 1.015 : 1;
4161
- const pulseShadow = progressActive ? `0 0 0 4px ${progressToneColor(indicator.tone)}22, 0 12px 28px rgba(15, 23, 42, 0.22)` : successFlash ? `0 0 0 5px rgba(55, 214, 122, 0.22), 0 14px 32px rgba(55, 214, 122, 0.22)` : launcherMode === "inline" ? hovered ? "0 14px 30px rgba(79, 70, 229, 0.28)" : "0 10px 24px rgba(99, 102, 241, 0.22)" : void 0;
4162
- const inlineButtonBackground = indicator.tone === "error" ? "linear-gradient(135deg, #b91c1c 0%, #dc2626 100%)" : indicator.tone === "warning" ? "linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%)" : indicator.tone === "success" ? "linear-gradient(135deg, #4f46e5 0%, #6366f1 100%)" : "linear-gradient(135deg, #4f46e5 0%, #6366f1 100%)";
4163
- const inlineButtonBorder = indicator.tone === "error" ? "1px solid rgba(254, 202, 202, 0.45)" : indicator.tone === "warning" ? "1px solid rgba(196, 181, 253, 0.42)" : "1px solid rgba(199, 210, 254, 0.42)";
4164
- const inlineBadgeBackground = indicator.tone === "error" ? "rgba(127, 29, 29, 0.88)" : indicator.tone === "warning" ? "rgba(88, 28, 135, 0.88)" : indicator.tone === "success" ? "rgba(49, 46, 129, 0.92)" : "rgba(30, 41, 59, 0.92)";
4165
- const inlineBadgeBorder = indicator.tone === "error" ? "1px solid rgba(254, 202, 202, 0.34)" : indicator.tone === "warning" ? "1px solid rgba(233, 213, 255, 0.28)" : indicator.tone === "success" ? "1px solid rgba(191, 219, 254, 0.24)" : "1px solid rgba(191, 219, 254, 0.2)";
4172
+ const pulseShadow = progressActive ? `0 0 0 4px ${progressToneColor(indicator.tone)}22, 0 12px 28px rgba(15, 23, 42, 0.22)` : successFlash ? `0 0 0 5px rgba(55, 214, 122, 0.22), 0 14px 32px rgba(55, 214, 122, 0.22)` : launcherMode === "inline" ? hovered ? "var(--le-space-sponsor-relay-launcher-hover-shadow, 0 14px 30px rgba(79, 70, 229, 0.28))" : "var(--le-space-sponsor-relay-launcher-shadow, 0 10px 24px rgba(99, 102, 241, 0.22))" : void 0;
4173
+ const inlineButtonBackground = themedLauncherBackground;
4174
+ const inlineButtonBorder = `1px solid ${themedLauncherBorder}`;
4175
+ const inlineBadgeBackground = themedLauncherBadgeBackground;
4176
+ const inlineBadgeBorder = `1px solid ${themedLauncherBadgeBorder}`;
4166
4177
  const panelStyle = launcherMode === "inline" ? inlinePanelStyle ?? {
4167
4178
  ...basePanelStyle,
4168
4179
  top: "4.75rem",
@@ -4194,8 +4205,8 @@ function SponsorRelayFab(props) {
4194
4205
  bottom: launcherMode === "floating" ? "5.8rem" : void 0,
4195
4206
  zIndex: launcherMode === "floating" ? 1e4 : "auto",
4196
4207
  borderRadius: "999px",
4197
- border: launcherMode === "floating" ? "2px solid rgba(255,255,255,0.9)" : inlineButtonBorder,
4198
- background: launcherMode === "floating" ? "linear-gradient(135deg, #e91315 0%, #ffc83f 100%)" : inlineButtonBackground,
4208
+ border: launcherMode === "floating" ? `2px solid ${themedLauncherBorder}` : inlineButtonBorder,
4209
+ background: launcherMode === "floating" ? themedLauncherBackground : inlineButtonBackground,
4199
4210
  color: "white",
4200
4211
  minHeight: launcherMode === "floating" ? void 0 : "2.25rem",
4201
4212
  padding: launcherMode === "floating" ? "0.9rem 1.2rem" : "0.42rem 0.56rem 0.42rem 0.76rem",
@@ -4231,8 +4242,8 @@ function SponsorRelayFab(props) {
4231
4242
  width: launcherMode === "floating" ? "0.5rem" : "0.42rem",
4232
4243
  height: launcherMode === "floating" ? "0.5rem" : "0.42rem",
4233
4244
  borderRadius: "999px",
4234
- background: launcherMode === "floating" ? "rgba(255,255,255,0.96)" : "#f59e0b",
4235
- boxShadow: launcherMode === "floating" ? "0 0 0 3px rgba(255,255,255,0.22)" : "0 0 0 3px rgba(245, 158, 11, 0.18)"
4245
+ background: launcherMode === "floating" ? "rgba(255,255,255,0.96)" : themedLauncherDot,
4246
+ boxShadow: launcherMode === "floating" ? "0 0 0 3px rgba(255,255,255,0.22)" : "0 0 0 3px var(--le-space-sponsor-relay-launcher-dot-ring, rgba(245, 158, 11, 0.18))"
4236
4247
  }
4237
4248
  }
4238
4249
  ),
@@ -4291,7 +4302,7 @@ function SponsorRelayFab(props) {
4291
4302
  position: "fixed",
4292
4303
  inset: 0,
4293
4304
  zIndex: 9998,
4294
- background: "radial-gradient(circle at 88% 82%, rgba(233,19,21,0.18), transparent 34%)"
4305
+ background: "radial-gradient(circle at 88% 82%, var(--le-space-sponsor-relay-backdrop-accent, rgba(79, 70, 229, 0.2)), transparent 34%)"
4295
4306
  }
4296
4307
  }
4297
4308
  ),
@@ -4527,7 +4538,7 @@ function SponsorRelayFab(props) {
4527
4538
  style: fieldStyle,
4528
4539
  value: state.pricingSummary.tier?.id ?? state.tierId,
4529
4540
  onChange: (event) => controller.setTierId(event.currentTarget.value),
4530
- children: (state.pricingSummary.pricing?.tiers ?? []).map((tier) => {
4541
+ children: (state.pricingSummary.pricing?.tiers?.length ? state.pricingSummary.pricing.tiers : [{ id: state.tierId, compute_units: 1 }]).map((tier) => {
4531
4542
  const unit = state.pricingSummary.pricing?.compute_unit;
4532
4543
  const vcpus = unit ? unit.vcpus * tier.compute_units : null;
4533
4544
  const memoryMiB = unit ? unit.memory_mib * tier.compute_units : null;
package/shared/index.js CHANGED
@@ -2633,9 +2633,7 @@ function defaultState(props = {}) {
2633
2633
  sshPublicKey: props.sshPublicKey ?? "",
2634
2634
  instanceName: props.instanceName ?? DEFAULT_INSTANCE_NAME,
2635
2635
  tierId: DEFAULT_TIER_ID,
2636
- showAdvanced: Boolean(
2637
- props.manifestUrl && props.manifestUrl !== DEFAULT_MANIFEST_URL || props.manifestJson?.trim() || props.sshPublicKey?.trim()
2638
- ),
2636
+ showAdvanced: Boolean(props.manifestJson?.trim() || props.sshPublicKey?.trim()),
2639
2637
  showInstances: props.showInstances ?? true,
2640
2638
  showPasteManifest: Boolean(props.manifestJson?.trim()),
2641
2639
  busy: {
@@ -2673,6 +2671,14 @@ function defaultState(props = {}) {
2673
2671
  deploymentProgress: IDLE_DEPLOYMENT_PROGRESS
2674
2672
  };
2675
2673
  }
2674
+ function manifestLoadErrorState(error) {
2675
+ const message = error instanceof Error ? error.message : String(error);
2676
+ return {
2677
+ manifest: null,
2678
+ valid: false,
2679
+ errors: [message]
2680
+ };
2681
+ }
2676
2682
  function isDebugEnabled(props) {
2677
2683
  if (props.debug) {
2678
2684
  return true;
@@ -3460,15 +3466,15 @@ var SponsorRelayController = class {
3460
3466
  statusText: "Refreshing relay sponsor data"
3461
3467
  });
3462
3468
  try {
3463
- const manifestState = await resolveManifest({
3464
- manifestUrl: this.state.manifestUrl,
3465
- manifestJson: this.state.manifestJson
3466
- });
3467
- const manifest = manifestState.manifest;
3468
3469
  const [pricingSummary, crns] = await Promise.all([
3469
3470
  fetchInstancePricing(this.client.apiHost),
3470
3471
  this.client.fetchCrns()
3471
3472
  ]);
3473
+ const manifestState = await resolveManifest({
3474
+ manifestUrl: this.state.manifestUrl,
3475
+ manifestJson: this.state.manifestJson
3476
+ }).catch((error) => manifestLoadErrorState(error));
3477
+ const manifest = manifestState.manifest;
3472
3478
  let balance = this.state.balance;
3473
3479
  let instances = [];
3474
3480
  if (this.state.wallet.address) {
package/styles.css CHANGED
@@ -5,13 +5,17 @@
5
5
  "DM Sans", "Inter", "Segoe UI", sans-serif;
6
6
  --relay-font-mono:
7
7
  "DM Mono", "SFMono-Regular", "Menlo", monospace;
8
- --relay-panel-bg: rgba(12, 20, 31, 0.92);
9
- --relay-panel-border: rgba(255, 255, 255, 0.12);
10
- --relay-panel-shadow: 0 28px 80px rgba(3, 8, 20, 0.45);
8
+ --relay-panel-bg: rgba(49, 46, 129, 0.94);
9
+ --relay-panel-border: rgba(199, 210, 254, 0.22);
10
+ --relay-panel-shadow: 0 28px 80px rgba(49, 46, 129, 0.34);
11
11
  --relay-text: #f8fafc;
12
12
  --relay-muted: #9fb2ca;
13
- --relay-blue: #0176ce;
14
- --relay-red: #e91315;
13
+ --relay-blue: #4f46e5;
14
+ --relay-red: #6366f1;
15
15
  --relay-yellow: #ffc83f;
16
16
  --relay-green: #37d67a;
17
+ --relay-launcher-border: rgba(199, 210, 254, 0.42);
18
+ --relay-launcher-badge-bg: rgba(49, 46, 129, 0.92);
19
+ --relay-launcher-badge-border: rgba(191, 219, 254, 0.24);
20
+ --relay-backdrop-accent: rgba(79, 70, 229, 0.2);
17
21
  }
@@ -111,7 +111,7 @@ export let apiHost = undefined
111
111
  <label class="field">
112
112
  <span>Tier</span>
113
113
  <select value={state.pricingSummary.tier?.id ?? state.tierId} on:change={(event) => controller.setTierId(event.currentTarget.value)}>
114
- {#each state.pricingSummary.pricing?.tiers ?? [] as tier}
114
+ {#each (state.pricingSummary.pricing?.tiers?.length ? state.pricingSummary.pricing.tiers : [{ id: state.tierId, compute_units: 1 }]) as tier}
115
115
  <option value={tier.id}>
116
116
  {tier.id} {formatTierSpecLabel(
117
117
  state.pricingSummary.pricing ? state.pricingSummary.pricing.compute_unit.vcpus * tier.compute_units : null,
@@ -275,7 +275,7 @@ export let apiHost = undefined
275
275
  position: fixed;
276
276
  inset: 0;
277
277
  z-index: 9998;
278
- background: radial-gradient(circle at 88% 82%, rgba(233, 19, 21, 0.18), transparent 34%);
278
+ background: radial-gradient(circle at 88% 82%, var(--relay-backdrop-accent), transparent 34%);
279
279
  backdrop-filter: blur(2px);
280
280
  }
281
281
 
@@ -10,12 +10,12 @@
10
10
 
11
11
  <style>
12
12
  .launcher {
13
- border: 2px solid rgba(255, 255, 255, 0.88);
13
+ border: 2px solid var(--relay-launcher-border);
14
14
  border-radius: 999px;
15
15
  padding: 0.9rem 1.2rem;
16
- background: linear-gradient(135deg, var(--relay-red) 0%, var(--relay-yellow) 100%);
16
+ background: linear-gradient(135deg, var(--relay-blue) 0%, var(--relay-red) 100%);
17
17
  color: white;
18
- box-shadow: 0 18px 40px rgba(233, 19, 21, 0.28);
18
+ box-shadow: 0 18px 40px rgba(79, 70, 229, 0.28);
19
19
  font: 700 0.84rem/1 var(--relay-font-heading);
20
20
  letter-spacing: 0.08em;
21
21
  text-transform: uppercase;
@@ -5,13 +5,17 @@
5
5
  "DM Sans", "Inter", "Segoe UI", sans-serif;
6
6
  --relay-font-mono:
7
7
  "DM Mono", "SFMono-Regular", "Menlo", monospace;
8
- --relay-panel-bg: rgba(12, 20, 31, 0.92);
9
- --relay-panel-border: rgba(255, 255, 255, 0.12);
10
- --relay-panel-shadow: 0 28px 80px rgba(3, 8, 20, 0.45);
8
+ --relay-panel-bg: rgba(49, 46, 129, 0.94);
9
+ --relay-panel-border: rgba(199, 210, 254, 0.22);
10
+ --relay-panel-shadow: 0 28px 80px rgba(49, 46, 129, 0.34);
11
11
  --relay-text: #f8fafc;
12
12
  --relay-muted: #9fb2ca;
13
- --relay-blue: #0176ce;
14
- --relay-red: #e91315;
13
+ --relay-blue: #4f46e5;
14
+ --relay-red: #6366f1;
15
15
  --relay-yellow: #ffc83f;
16
16
  --relay-green: #37d67a;
17
+ --relay-launcher-border: rgba(199, 210, 254, 0.42);
18
+ --relay-launcher-badge-bg: rgba(49, 46, 129, 0.92);
19
+ --relay-launcher-badge-border: rgba(191, 219, 254, 0.24);
20
+ --relay-backdrop-accent: rgba(79, 70, 229, 0.2);
17
21
  }