@lyeve-labs/ui-kit 0.42.0 → 0.42.2

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.
@@ -152,6 +152,7 @@
152
152
  class="{cls} {inert ? 'pointer-events-none opacity-50' : ''}"
153
153
  aria-disabled={inert ? 'true' : undefined}
154
154
  tabindex={inert ? -1 : undefined}
155
+ onclick={inert ? undefined : onclick}
155
156
  {...rest}
156
157
  >
157
158
  {#if loading}<Spinner size={spinnerSize} />{/if}
@@ -54,6 +54,12 @@
54
54
  /** The period that quote was priced for. A monthly quote says nothing about a year. */
55
55
  quotePeriod?: BillingPeriod | null;
56
56
  period?: BillingPeriod;
57
+ /**
58
+ * What the total is charged per, when it differs from `period`. A
59
+ * one-time payment is quoted monthly and charged once, so its host passes
60
+ * `'once'` and the total reads "$6.00 once" rather than "$6.00/mo".
61
+ */
62
+ per?: BillingPeriod | 'once';
57
63
  /** True while a fresh price is in flight. */
58
64
  quoting?: boolean;
59
65
  /** The count the bill will carry, when the host knows better than the cart. */
@@ -117,6 +123,7 @@
117
123
  quote = null,
118
124
  quotePeriod = null,
119
125
  period = 'monthly',
126
+ per,
120
127
  quoting = false,
121
128
  billedSkus = null,
122
129
  currency = 'USD',
@@ -193,7 +200,13 @@
193
200
  ),
194
201
  );
195
202
 
196
- const perLabel = $derived(period === 'annual' ? '/yr' : '/mo');
203
+ const perLabel = $derived.by(() => {
204
+ const charged = per ?? period;
205
+ return charged === 'once' ? ' once' : charged === 'annual' ? '/yr' : '/mo';
206
+ });
207
+ // A card shows the monthly list price. A one-time payment charges it once,
208
+ // so "/mo" there would promise a renewal.
209
+ const cardPerLabel = $derived(per === 'once' ? ' once' : '/mo');
197
210
 
198
211
  // The volume ladder drawn as a meter: the rungs that take something off,
199
212
  // placed along the count of the last one.
@@ -318,9 +331,9 @@
318
331
  >{plugin.name}</span
319
332
  >
320
333
  </span>
321
- <span id="{id}-price" class="shrink-0 font-mono text-sm font-semibold text-fg">
334
+ <span id="{id}-price" class="shrink-0 tabular-nums text-sm font-semibold text-fg">
322
335
  {formatCents(plugin.price_cents, currency)}<span
323
- class="text-xs font-normal text-muted">/mo</span
336
+ class="text-xs font-normal text-muted">{cardPerLabel}</span
324
337
  >
325
338
  </span>
326
339
  </span>
@@ -350,13 +363,12 @@
350
363
  class="flex items-center justify-between gap-3 rounded-xl border border-brand bg-surface px-4 py-3 text-sm shadow-lg transition-colors hover:bg-surface-2"
351
364
  >
352
365
  <span class="text-fg">
353
- <span class="font-semibold">{count}</span> picked{#if total !== null}<span
354
- class="text-muted"
366
+ <span class="font-semibold">{count}</span> picked{#if total !== null}{' '}<span
367
+ class="text-muted">·</span
355
368
  >
356
- ·
357
- </span><span class="font-mono">{formatCents(total, currency)}{perLabel}</span>{/if}
369
+ <span class="tabular-nums">{formatCents(total, currency)}</span>{/if}
358
370
  </span>
359
- <span class="font-semibold text-brand">Review</span>
371
+ <span class="font-semibold text-brand">Review order</span>
360
372
  </a>
361
373
  </div>
362
374
  {/if}
@@ -404,7 +416,7 @@
404
416
  <li class="flex items-center justify-between gap-2 text-xs">
405
417
  <span class="truncate text-fg">{p?.name ?? sku}</span>
406
418
  <span class="flex items-center gap-1">
407
- <span class="font-mono text-muted"
419
+ <span class="tabular-nums text-muted"
408
420
  >{formatCents(p?.price_cents ?? 0, currency)}</span
409
421
  >
410
422
  <Button
@@ -445,7 +457,7 @@
445
457
  <div class="relative mt-2 h-4 text-[10px] text-muted">
446
458
  {#each rungs as r (r.plugins)}
447
459
  <span
448
- class="absolute -translate-x-1/2 whitespace-nowrap font-mono"
460
+ class="absolute -translate-x-1/2 whitespace-nowrap tabular-nums"
449
461
  style:left="{Math.min((r.plugins / ladderTop) * 100, 92)}%"
450
462
  >
451
463
  {r.plugins}+ · {r.discount_pct}%
@@ -479,7 +491,7 @@
479
491
  {:else}
480
492
  <p class="flex items-baseline justify-between gap-2">
481
493
  <span class="text-sm text-muted">Total</span>
482
- <span class="font-mono text-xl font-semibold text-fg">
494
+ <span class="tabular-nums text-xl font-semibold text-fg">
483
495
  {formatCents(total, currency)}<span class="text-sm font-normal text-muted"
484
496
  >{perLabel}</span
485
497
  >
@@ -20,6 +20,12 @@ interface Props {
20
20
  /** The period that quote was priced for. A monthly quote says nothing about a year. */
21
21
  quotePeriod?: BillingPeriod | null;
22
22
  period?: BillingPeriod;
23
+ /**
24
+ * What the total is charged per, when it differs from `period`. A
25
+ * one-time payment is quoted monthly and charged once, so its host passes
26
+ * `'once'` and the total reads "$6.00 once" rather than "$6.00/mo".
27
+ */
28
+ per?: BillingPeriod | 'once';
23
29
  /** True while a fresh price is in flight. */
24
30
  quoting?: boolean;
25
31
  /** The count the bill will carry, when the host knows better than the cart. */
package/dist/index.d.ts CHANGED
@@ -107,4 +107,4 @@ export { cn, type ClassValue } from './utils/cn.js';
107
107
  export { getTheme, getThemePreference, nextThemePreference, resolveTheme, setTheme, setThemePreference, systemTheme, themeBootScript, watchThemePreference, toggleTheme, watchSystemTheme, THEME_PREFERENCES, type Theme, type ThemePreference, } from './utils/theme.js';
108
108
  export * as motion from './motion.js';
109
109
  export type { Rung as MotionRung, Curve as MotionCurve } from './motion.js';
110
- export declare const VERSION = "0.42.0";
110
+ export declare const VERSION = "0.42.2";
package/dist/index.js CHANGED
@@ -119,4 +119,4 @@ export * as motion from './motion.js';
119
119
  // ── Version ────────────────────────────────────────────────────────────────
120
120
  // Generated from package.json by `pnpm version:sync`. Bump package.json, never
121
121
  // this line. The build and the test suite fail when the two disagree.
122
- export const VERSION = '0.42.0';
122
+ export const VERSION = '0.42.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyeve-labs/ui-kit",
3
- "version": "0.42.0",
3
+ "version": "0.42.2",
4
4
  "description": "A clean, accessible, palette-aware Svelte 5 component library. The design system behind LyEve.",
5
5
  "license": "MIT",
6
6
  "author": "LyEve Labs <hello@lyeve.com>",