@r2digisolutions/components 0.19.2 → 0.19.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.
@@ -16,6 +16,11 @@
16
16
  priceLabel: string;
17
17
  categoryLabel?: string;
18
18
  installed?: boolean;
19
+ /**
20
+ * Estado legible en el listado (p. ej. «Instalado», «En licencia», «No incluido»).
21
+ * Si no se pasa y `installed`, se usa «Instalado».
22
+ */
23
+ statusLabel?: string;
19
24
  /** landscape promotional card */
20
25
  featured?: boolean;
21
26
  tags?: StoreProductTag[];
@@ -32,6 +37,7 @@
32
37
  priceLabel,
33
38
  categoryLabel = '',
34
39
  installed = false,
40
+ statusLabel = '',
35
41
  featured = false,
36
42
  tags = [],
37
43
  icon: Icon,
@@ -51,6 +57,11 @@
51
57
  TAG_PRIORITY.filter((t) => visibleTags.includes(t)).slice(0, installed ? 1 : 2)
52
58
  );
53
59
 
60
+ const resolvedStatus = $derived(
61
+ statusLabel.trim() || (installed ? 'Instalado' : '')
62
+ );
63
+ const statusToneOk = $derived(installed || resolvedStatus === 'Instalado');
64
+
54
65
  function tagVariant(tag: StoreProductTag): 'info' | 'warning' | 'default' {
55
66
  if (tag === 'new') return 'info';
56
67
  // Featured uses custom amber + white via tagClass (avoid warning’s amber text).
@@ -78,7 +89,7 @@
78
89
  {#if featured}
79
90
  <div class="ms-tile__promo bg-gradient-to-br {accentClass}">
80
91
  <div class="ms-tile__promo-mesh" aria-hidden="true"></div>
81
- {#if displayTags.length || installed || badge}
92
+ {#if displayTags.length || resolvedStatus || badge}
82
93
  <div class="ms-tile__tags">
83
94
  {#if badge}
84
95
  {@render badge()}
@@ -88,8 +99,10 @@
88
99
  {TAG_LABELS[tag]}
89
100
  </Badge>
90
101
  {/each}
91
- {#if installed}
92
- <Badge variant="success" size="sm">Instalado</Badge>
102
+ {#if resolvedStatus}
103
+ <Badge variant={statusToneOk ? 'success' : 'secondary'} size="sm">
104
+ {resolvedStatus}
105
+ </Badge>
93
106
  {/if}
94
107
  {/if}
95
108
  </div>
@@ -102,7 +115,13 @@
102
115
  {#if description}
103
116
  <span class="ms-tile__promo-desc">{description}</span>
104
117
  {/if}
105
- <span class="ms-tile__promo-price">{priceLabel}</span>
118
+ <span class="ms-tile__promo-price">
119
+ {#if resolvedStatus && statusToneOk}
120
+ {resolvedStatus}
121
+ <span class="ms-tile__promo-sep" aria-hidden="true">·</span>
122
+ {/if}
123
+ {priceLabel}
124
+ </span>
106
125
  </div>
107
126
  <div class="ms-tile__promo-icon bg-gradient-to-br {accentClass}">
108
127
  <Icon class="size-10 text-white drop-shadow" />
@@ -114,7 +133,11 @@
114
133
  <div class="ms-tile__icon-shine" aria-hidden="true"></div>
115
134
  <Icon class="relative size-9 text-white drop-shadow-sm sm:size-10" />
116
135
  </div>
117
- {#if displayTags[0]}
136
+ {#if statusToneOk}
137
+ <span class="ms-tile__corner">
138
+ <Badge variant="success" size="sm">{resolvedStatus || 'Instalado'}</Badge>
139
+ </span>
140
+ {:else if displayTags[0]}
118
141
  <span class="ms-tile__corner">
119
142
  <Badge
120
143
  variant={tagVariant(displayTags[0])}
@@ -124,13 +147,23 @@
124
147
  {TAG_LABELS[displayTags[0]]}
125
148
  </Badge>
126
149
  </span>
127
- {:else if installed}
128
- <span class="ms-tile__dot" title="Instalado" aria-label="Instalado"></span>
150
+ {:else if resolvedStatus}
151
+ <span class="ms-tile__corner">
152
+ <Badge variant="secondary" size="sm">{resolvedStatus}</Badge>
153
+ </span>
129
154
  {/if}
130
155
  </div>
131
156
  <div class="ms-tile__meta">
132
157
  <span class="ms-tile__name">{name}</span>
133
158
  <span class="ms-tile__publisher">Evoteg</span>
159
+ {#if resolvedStatus}
160
+ <span
161
+ class="ms-tile__status"
162
+ class:ms-tile__status--ok={statusToneOk}
163
+ >
164
+ {resolvedStatus}
165
+ </span>
166
+ {/if}
134
167
  <span class="ms-tile__price">{priceLabel}</span>
135
168
  </div>
136
169
  {/if}
@@ -208,19 +241,6 @@
208
241
  left: 0.45rem;
209
242
  z-index: 2;
210
243
  }
211
- .ms-tile__dot {
212
- position: absolute;
213
- top: 0.55rem;
214
- right: 0.55rem;
215
- width: 0.55rem;
216
- height: 0.55rem;
217
- border-radius: 999px;
218
- background: #16a34a;
219
- box-shadow: 0 0 0 3px rgb(255 255 255 / 0.9);
220
- }
221
- :global(.dark) .ms-tile__dot {
222
- box-shadow: 0 0 0 3px rgb(28 28 28);
223
- }
224
244
  .ms-tile__meta {
225
245
  display: flex;
226
246
  flex-direction: column;
@@ -240,13 +260,27 @@
240
260
  color: var(--color-neutral-50, #fafafa);
241
261
  }
242
262
  .ms-tile__publisher,
243
- .ms-tile__price {
263
+ .ms-tile__price,
264
+ .ms-tile__status {
244
265
  color: var(--color-neutral-500, #737373);
245
266
  font-size: 0.75rem;
246
267
  overflow: hidden;
247
268
  text-overflow: ellipsis;
248
269
  white-space: nowrap;
249
270
  }
271
+ .ms-tile__status {
272
+ font-weight: 600;
273
+ color: var(--color-neutral-600, #525252);
274
+ }
275
+ .ms-tile__status--ok {
276
+ color: #15803d;
277
+ }
278
+ :global(.dark) .ms-tile__status {
279
+ color: var(--color-neutral-400, #a3a3a3);
280
+ }
281
+ :global(.dark) .ms-tile__status--ok {
282
+ color: #4ade80;
283
+ }
250
284
  .ms-tile__price {
251
285
  font-weight: 550;
252
286
  color: var(--color-neutral-700, #404040);
@@ -254,6 +288,10 @@
254
288
  :global(.dark) .ms-tile__price {
255
289
  color: var(--color-neutral-300, #d4d4d4);
256
290
  }
291
+ .ms-tile__promo-sep {
292
+ margin-inline: 0.25rem;
293
+ opacity: 0.65;
294
+ }
257
295
 
258
296
  .ms-tile--featured {
259
297
  height: 100%;
@@ -6,6 +6,11 @@ type Props = {
6
6
  priceLabel: string;
7
7
  categoryLabel?: string;
8
8
  installed?: boolean;
9
+ /**
10
+ * Estado legible en el listado (p. ej. «Instalado», «En licencia», «No incluido»).
11
+ * Si no se pasa y `installed`, se usa «Instalado».
12
+ */
13
+ statusLabel?: string;
9
14
  /** landscape promotional card */
10
15
  featured?: boolean;
11
16
  tags?: StoreProductTag[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.19.2",
3
+ "version": "0.19.3",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",