@r2digisolutions/components 0.19.9 → 0.19.10

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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  export type SelectCardLayout = 'media' | 'row';
7
7
  export type SelectCardCheck = 'box' | 'badge' | 'none';
8
- export type SelectCardTone = 'brand' | 'success' | 'error' | 'warning' | 'info';
8
+ export type SelectCardTone = 'brand' | 'neutral' | 'success' | 'error' | 'warning' | 'info';
9
9
 
10
10
  interface SelectCardProps {
11
11
  title?: string;
@@ -50,6 +50,7 @@
50
50
 
51
51
  const selectedTone: Record<SelectCardTone, string> = {
52
52
  brand: 'border-brand-500 bg-brand-50/50 ring-2 ring-brand-500/20 dark:bg-brand-950/30',
53
+ neutral: 'border-border-strong bg-surface-overlay ring-2 ring-border dark:bg-surface-overlay/80',
53
54
  success:
54
55
  'border-emerald-500 bg-emerald-50/70 ring-2 ring-emerald-500/20 dark:border-emerald-400 dark:bg-emerald-950/35',
55
56
  error: 'border-red-500 bg-red-50/70 ring-2 ring-red-500/20 dark:border-red-400 dark:bg-red-950/35',
@@ -60,6 +61,7 @@
60
61
 
61
62
  const hoverTone: Record<SelectCardTone, string> = {
62
63
  brand: 'hover:border-brand-300 dark:hover:border-brand-700',
64
+ neutral: 'hover:border-border-strong',
63
65
  success: 'hover:border-emerald-300 dark:hover:border-emerald-700',
64
66
  error: 'hover:border-red-300 dark:hover:border-red-700',
65
67
  warning: 'hover:border-amber-300 dark:hover:border-amber-700',
@@ -68,6 +70,7 @@
68
70
 
69
71
  const badgeTone: Record<SelectCardTone, string> = {
70
72
  brand: 'border-brand-500 bg-brand-500 text-white',
73
+ neutral: 'border-border-strong bg-surface-overlay text-primary',
71
74
  success: 'border-emerald-500 bg-emerald-500 text-white',
72
75
  error: 'border-red-500 bg-red-500 text-white',
73
76
  warning: 'border-amber-500 bg-amber-500 text-white',
@@ -76,6 +79,7 @@
76
79
 
77
80
  const focusTone: Record<SelectCardTone, string> = {
78
81
  brand: 'focus-visible:ring-brand-500/30',
82
+ neutral: 'focus-visible:ring-border',
79
83
  success: 'focus-visible:ring-emerald-500/30',
80
84
  error: 'focus-visible:ring-red-500/30',
81
85
  warning: 'focus-visible:ring-amber-500/30',
@@ -1,7 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  export type SelectCardLayout = 'media' | 'row';
3
3
  export type SelectCardCheck = 'box' | 'badge' | 'none';
4
- export type SelectCardTone = 'brand' | 'success' | 'error' | 'warning' | 'info';
4
+ export type SelectCardTone = 'brand' | 'neutral' | 'success' | 'error' | 'warning' | 'info';
5
5
  interface SelectCardProps {
6
6
  title?: string;
7
7
  description?: string;
@@ -240,11 +240,12 @@
240
240
  onbillingperiodchange?.(billingPeriod);
241
241
  }
242
242
 
243
- function planColClass(plan: PricingPlan) {
243
+ /** Selection chrome only on the plan header — never paint feature rows. */
244
+ function planHeaderClass(plan: PricingPlan) {
244
245
  const selected = selectedId === plan.id;
245
246
  return [
246
- plan.featured && 'bg-brand-50/50 dark:bg-brand-950/20',
247
- selected && 'bg-brand-50/80 ring-inset ring-2 ring-brand-500/35 dark:bg-brand-950/30'
247
+ plan.featured && !selected && 'bg-brand-50/40 dark:bg-brand-950/15',
248
+ selected && 'bg-surface-elevated'
248
249
  ];
249
250
  }
250
251
  </script>
@@ -447,15 +448,17 @@
447
448
  scope="col"
448
449
  class={[
449
450
  'min-w-40 px-3 py-4 text-center align-top font-normal',
450
- planColClass(plan)
451
+ planHeaderClass(plan)
451
452
  ]}
452
453
  >
453
454
  <button
454
455
  type="button"
455
456
  class={[
456
- 'flex w-full flex-col items-center gap-2 rounded-xl px-2 py-2 text-center transition-colors',
457
- selected && 'bg-brand-500/10',
458
- !plan.disabled && 'hover:bg-surface-overlay/50',
457
+ 'flex w-full flex-col items-center gap-2 rounded-xl border px-2 py-2 text-center transition-colors',
458
+ selected
459
+ ? 'border-border-strong bg-surface-overlay ring-2 ring-border'
460
+ : 'border-transparent',
461
+ !plan.disabled && !selected && 'hover:border-border hover:bg-surface-overlay/40',
459
462
  plan.disabled && 'cursor-not-allowed opacity-50'
460
463
  ]}
461
464
  disabled={plan.disabled}
@@ -465,7 +468,11 @@
465
468
  <div class="flex min-h-6 flex-wrap items-center justify-center gap-1.5">
466
469
  <span class="text-sm font-semibold text-primary">{plan.name}</span>
467
470
  {#if badgeText}
468
- <Badge size="sm" variant="primary" class="whitespace-nowrap">
471
+ <Badge
472
+ size="sm"
473
+ variant={selected ? 'default' : 'primary'}
474
+ class="whitespace-nowrap"
475
+ >
469
476
  {badgeText}
470
477
  </Badge>
471
478
  {/if}
@@ -479,9 +486,11 @@
479
486
  <span
480
487
  class={[
481
488
  'inline-flex h-8 w-full max-w-40 items-center justify-center rounded-lg px-3 text-xs font-medium',
482
- selected || plan.featured
483
- ? 'bg-brand-600 text-white'
484
- : 'bg-surface-overlay text-primary ring-1 ring-border'
489
+ selected
490
+ ? 'bg-surface-overlay text-primary ring-2 ring-border-strong'
491
+ : plan.featured
492
+ ? 'bg-brand-600 text-white'
493
+ : 'bg-surface-overlay text-primary ring-1 ring-border'
485
494
  ]}
486
495
  >
487
496
  {plan.cta ?? 'Select'}
@@ -497,18 +506,24 @@
497
506
  class="sticky left-0 z-40 bg-surface px-4 py-2.5 text-left"
498
507
  ></th>
499
508
  {#each plans as plan (plan.id)}
509
+ {@const selected = selectedId === plan.id}
500
510
  <th
501
511
  scope="col"
502
512
  class={[
503
513
  'px-3 py-2.5 text-center text-xs font-semibold text-secondary',
504
- planColClass(plan)
514
+ planHeaderClass(plan)
505
515
  ]}
506
516
  >
507
517
  <button
508
518
  type="button"
509
- class="w-full rounded-md px-1 py-0.5 hover:bg-surface-overlay/60"
519
+ class={[
520
+ 'w-full rounded-lg border px-2 py-1 transition-colors',
521
+ selected
522
+ ? 'border-border-strong bg-surface-overlay text-primary ring-2 ring-border'
523
+ : 'border-transparent hover:bg-surface-overlay/60'
524
+ ]}
510
525
  disabled={plan.disabled}
511
- aria-pressed={selectedId === plan.id}
526
+ aria-pressed={selected}
512
527
  onclick={() => select(plan.id, plan.disabled)}
513
528
  >
514
529
  {plan.name}
@@ -536,13 +551,7 @@
536
551
  {row.label}
537
552
  </th>
538
553
  {#each row.values as value, vi (`${row.id}-${plans[vi]?.id ?? vi}`)}
539
- {@const plan = plans[vi]}
540
- <td
541
- class={[
542
- 'px-3 py-3 text-center',
543
- plan && planColClass(plan)
544
- ]}
545
- >
554
+ <td class="px-3 py-3 text-center">
546
555
  {@render matrixCell(value)}
547
556
  </td>
548
557
  {/each}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.19.9",
3
+ "version": "0.19.10",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",