@happyvertical/smrt-commerce 0.55.15 → 0.55.17

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.
Files changed (53) hide show
  1. package/agents/invoice-calculations.md +28 -1
  2. package/agents/payment-allocations.md +19 -0
  3. package/dist/chunks/{calculations-DwBf83UE.js → calculations-Bz7RB3qK.js} +36 -2
  4. package/dist/chunks/calculations-Bz7RB3qK.js.map +1 -0
  5. package/dist/chunks/{units-BhVZswof.js → units-BpZ0_Dpk.js} +2 -2
  6. package/dist/chunks/{units-BhVZswof.js.map → units-BpZ0_Dpk.js.map} +1 -1
  7. package/dist/index.js +29 -8
  8. package/dist/index.js.map +1 -1
  9. package/dist/invoices.js +1 -1
  10. package/dist/manifest.json +1 -1
  11. package/dist/models/Invoice.d.ts +5 -3
  12. package/dist/models/Invoice.d.ts.map +1 -1
  13. package/dist/smrt-knowledge.json +5 -5
  14. package/dist/svelte/components/CustomerDetail.svelte +4 -1
  15. package/dist/svelte/components/CustomerDirectory.svelte +4 -1
  16. package/dist/svelte/components/CustomerForm.svelte +3 -0
  17. package/dist/svelte/components/InvoiceActions.svelte +4 -1
  18. package/dist/svelte/components/InvoiceAllocationFields.svelte +4 -1
  19. package/dist/svelte/components/InvoiceCard.svelte +12 -9
  20. package/dist/svelte/components/InvoiceEditor.svelte +7 -3
  21. package/dist/svelte/components/InvoiceEditor.svelte.d.ts.map +1 -1
  22. package/dist/svelte/components/InvoiceHeader.svelte +25 -22
  23. package/dist/svelte/components/InvoiceLineEditor.svelte +8 -1
  24. package/dist/svelte/components/InvoiceLineEditor.svelte.d.ts.map +1 -1
  25. package/dist/svelte/components/InvoiceLineItems.svelte +29 -26
  26. package/dist/svelte/components/InvoiceReview.svelte +4 -1
  27. package/dist/svelte/components/InvoiceTotals.svelte +14 -11
  28. package/dist/svelte/components/PartyAddressFields.svelte +3 -0
  29. package/dist/svelte/components/PartyContactFields.svelte +4 -1
  30. package/dist/svelte/components/PricingVersionDecision.svelte +4 -1
  31. package/dist/svelte/components/PricingVersionSummary.svelte +4 -1
  32. package/dist/svelte/components/PurchaseOrderEditor.svelte +4 -1
  33. package/dist/svelte/components/PurchaseOrderHeaderForm.svelte +1 -1
  34. package/dist/svelte/components/PurchaseSourceSelector.svelte +7 -2
  35. package/dist/svelte/components/QuoteEditor.svelte +4 -1
  36. package/dist/svelte/components/QuoteRevisionComparison.svelte +4 -1
  37. package/dist/svelte/components/QuoteRevisionHistory.svelte +4 -1
  38. package/dist/svelte/components/UnbilledItems.svelte +27 -24
  39. package/dist/svelte/components/VendorDetail.svelte +4 -1
  40. package/dist/svelte/components/VendorDirectory.svelte +4 -1
  41. package/dist/svelte/components/VendorForm.svelte +3 -0
  42. package/dist/svelte/invoices/calculations.d.ts +12 -3
  43. package/dist/svelte/invoices/calculations.d.ts.map +1 -1
  44. package/dist/svelte/invoices/calculations.js +40 -1
  45. package/dist/svelte/invoices/messages.d.ts +1 -0
  46. package/dist/svelte/invoices/messages.d.ts.map +1 -1
  47. package/dist/svelte/invoices/messages.js +1 -0
  48. package/dist/svelte/invoices/types.d.ts +3 -2
  49. package/dist/svelte/invoices/types.d.ts.map +1 -1
  50. package/dist/svelte/playground/InvoicePreparationPreview.svelte +6 -1
  51. package/dist/svelte/playground/PartySelectPreview.svelte +4 -1
  52. package/package.json +9 -9
  53. package/dist/chunks/calculations-DwBf83UE.js.map +0 -1
@@ -87,7 +87,7 @@ const sourceLabels: Record<string, string> = {
87
87
  const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
88
88
  </script>
89
89
 
90
- <div class="line-items-container">
90
+ <div class="line-items-container" data-smrt-component="InvoiceLineItems">
91
91
  {#if retained}
92
92
  {#if retained.lines.length === 0}
93
93
  <div class="empty-state"><p>{emptyMessage}</p></div>
@@ -199,6 +199,8 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
199
199
  </div>
200
200
 
201
201
  <style>
202
+ @layer smrt.reset, smrt.structure, smrt.theme;
203
+ @layer smrt.theme {
202
204
  .line-items-container {
203
205
  width: 100%;
204
206
  }
@@ -208,14 +210,14 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
208
210
  flex-direction: column;
209
211
  align-items: center;
210
212
  padding: var(--smrt-spacing-8, 2rem) var(--smrt-spacing-4, 1rem);
211
- background: var(--smrt-color-surface-container-low, #f7f2fa);
212
- border: 1px dashed var(--smrt-color-outline, #79747e);
213
+ background: var(--smrt-color-surface-container-low);
214
+ border: 1px dashed var(--smrt-color-outline);
213
215
  border-radius: var(--smrt-radius-medium, 0.5rem);
214
216
  text-align: center;
215
217
  }
216
218
 
217
219
  .empty-state p {
218
- color: var(--smrt-color-on-surface-variant, #49454f);
220
+ color: var(--smrt-color-on-surface-variant);
219
221
  margin: 0 0 var(--smrt-spacing-4, 1rem);
220
222
  }
221
223
 
@@ -228,14 +230,14 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
228
230
  .line-items-table th {
229
231
  text-align: left;
230
232
  font-weight: var(--smrt-typography-weight-medium, 500);
231
- color: var(--smrt-color-on-surface-variant, #49454f);
233
+ color: var(--smrt-color-on-surface-variant);
232
234
  padding: var(--smrt-spacing-3, 0.75rem) var(--smrt-spacing-2, 0.5rem);
233
- border-bottom: 1px solid var(--smrt-color-outline-variant, #c4c6d0);
235
+ border-bottom: 1px solid var(--smrt-color-outline-variant);
234
236
  }
235
237
 
236
238
  .line-items-table td {
237
239
  padding: var(--smrt-spacing-3, 0.75rem) var(--smrt-spacing-2, 0.5rem);
238
- border-bottom: 1px solid var(--smrt-color-surface-variant, #e7e0ec);
240
+ border-bottom: 1px solid var(--smrt-color-surface-variant);
239
241
  vertical-align: top;
240
242
  }
241
243
 
@@ -267,13 +269,13 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
267
269
  .item-category {
268
270
  display: block;
269
271
  font: var(--smrt-typography-label-small-font);
270
- color: var(--smrt-color-on-surface-variant, #49454f);
272
+ color: var(--smrt-color-on-surface-variant);
271
273
  text-transform: uppercase;
272
274
  letter-spacing: 0.025em;
273
275
  }
274
276
 
275
277
  .item-description {
276
- color: var(--smrt-color-on-surface, #1c1b1f);
278
+ color: var(--smrt-color-on-surface);
277
279
  }
278
280
 
279
281
  .source-badge {
@@ -281,26 +283,26 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
281
283
  padding: var(--smrt-spacing-0_5, 0.125rem) var(--smrt-spacing-2, 0.5rem);
282
284
  font: var(--smrt-typography-label-small-font);
283
285
  font-weight: var(--smrt-typography-weight-medium, 500);
284
- border-radius: var(--smrt-radius-full, 9999px);
286
+ border-radius: var(--smrt-radius-full);
285
287
  }
286
288
 
287
289
  .source-expense {
288
- background: var(--smrt-color-tertiary-container, #ddf5e5);
289
- color: var(--smrt-color-on-tertiary-container, #0c1f15);
290
+ background: var(--smrt-color-tertiary-container);
291
+ color: var(--smrt-color-on-tertiary-container);
290
292
  }
291
293
 
292
294
  .source-time {
293
- background: var(--smrt-color-primary-container, #d3e3fd);
294
- color: var(--smrt-color-on-primary-container, #041e49);
295
+ background: var(--smrt-color-primary-container);
296
+ color: var(--smrt-color-on-primary-container);
295
297
  }
296
298
 
297
299
  .source-manual {
298
- background: var(--smrt-color-surface-variant, #e7e0ec);
299
- color: var(--smrt-color-on-surface-variant, #49454f);
300
+ background: var(--smrt-color-surface-variant);
301
+ color: var(--smrt-color-on-surface-variant);
300
302
  }
301
303
 
302
304
  .total-row td {
303
- border-top: 2px solid var(--smrt-color-outline-variant, #c4c6d0);
305
+ border-top: 2px solid var(--smrt-color-outline-variant);
304
306
  border-bottom: none;
305
307
  font-weight: var(--smrt-typography-weight-semibold, 600);
306
308
  padding-top: var(--smrt-spacing-4, 1rem);
@@ -308,7 +310,7 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
308
310
 
309
311
  .total-label {
310
312
  text-align: right;
311
- color: var(--smrt-color-on-surface, #1c1b1f);
313
+ color: var(--smrt-color-on-surface);
312
314
  }
313
315
 
314
316
  /*
@@ -328,7 +330,7 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
328
330
  background: transparent;
329
331
  border: none;
330
332
  border-radius: var(--smrt-radius-extra-small, 0.25rem);
331
- color: var(--smrt-color-on-surface-variant, #49454f);
333
+ color: var(--smrt-color-on-surface-variant);
332
334
  transition: all var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, cubic-bezier(0.2, 0, 0, 1));
333
335
  }
334
336
 
@@ -339,13 +341,13 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
339
341
  }
340
342
 
341
343
  .line-items-container :global(.action-btn:hover) {
342
- background: var(--smrt-color-surface-variant, #e7e0ec);
343
- color: var(--smrt-color-on-surface, #1c1b1f);
344
+ background: var(--smrt-color-surface-variant);
345
+ color: var(--smrt-color-on-surface);
344
346
  }
345
347
 
346
348
  .line-items-container :global(.action-btn.delete:hover) {
347
- background: var(--smrt-color-error-container, #ffdad6);
348
- color: var(--smrt-color-error, #ba1a1a);
349
+ background: var(--smrt-color-error-container);
350
+ color: var(--smrt-color-error);
349
351
  }
350
352
 
351
353
  .line-items-container :global(.add-btn) {
@@ -355,9 +357,9 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
355
357
  padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-4, 1rem);
356
358
  font: var(--smrt-typography-label-large-font);
357
359
  font-weight: var(--smrt-typography-weight-medium, 500);
358
- color: var(--smrt-color-primary, #005ac1);
360
+ color: var(--smrt-color-primary);
359
361
  background: transparent;
360
- border: 1px dashed var(--smrt-color-primary, #005ac1);
362
+ border: 1px dashed var(--smrt-color-primary);
361
363
  border-radius: var(--smrt-radius-small, 0.375rem);
362
364
  transition: all var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, cubic-bezier(0.2, 0, 0, 1));
363
365
  }
@@ -369,10 +371,11 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
369
371
  }
370
372
 
371
373
  .line-items-container :global(.add-btn:hover) {
372
- background: var(--smrt-color-primary-container, #d3e3fd);
374
+ background: var(--smrt-color-primary-container);
373
375
  }
374
376
 
375
377
  .line-items-container :global(.add-btn-below) {
376
378
  margin-top: var(--smrt-spacing-3, 0.75rem);
377
379
  }
380
+ }
378
381
  </style>
@@ -12,12 +12,15 @@ let { review }: Props = $props();
12
12
  const { t } = useI18n();
13
13
  </script>
14
14
 
15
- <section aria-label={t(M['commerce.preparation.review'])} class="invoice-review" aria-live="polite">
15
+ <section aria-label={t(M['commerce.preparation.review'])} class="invoice-review" aria-live="polite" data-smrt-component="InvoiceReview">
16
16
  <strong>{review.label}</strong>
17
17
  {#if review.message}<p>{review.message}</p>{/if}
18
18
  </section>
19
19
 
20
20
  <style>
21
+ @layer smrt.reset, smrt.structure, smrt.theme;
22
+ @layer smrt.theme {
21
23
  .invoice-review { padding: var(--smrt-spacing-3); border: 1px solid var(--smrt-color-outline); border-radius: var(--smrt-radius-small); overflow-wrap: anywhere; }
22
24
  p { margin-block: var(--smrt-spacing-2) 0; }
25
+ }
23
26
  </style>
@@ -86,7 +86,7 @@ function formatMoney(amount: number): string {
86
86
  }
87
87
  </script>
88
88
 
89
- <div class="invoice-totals" class:sm={size === 'sm'} class:lg={size === 'lg'}>
89
+ <div class="invoice-totals" class:sm={size === 'sm'} class:lg={size === 'lg'} data-smrt-component="InvoiceTotals">
90
90
  {#if retained}
91
91
  <div class="totals-row"><span class="totals-label">Subtotal</span><span class="totals-value">{formatInvoiceMinorUnits(retained.subtotalMinor, retained.currency)}</span></div>
92
92
  {#if retained.discountMinor !== undefined}<div class="totals-row"><span class="totals-label">Discount</span><span class="totals-value">{formatInvoiceMinorUnits(retained.discountMinor, retained.currency)}</span></div>{/if}
@@ -137,6 +137,8 @@ function formatMoney(amount: number): string {
137
137
  </div>
138
138
 
139
139
  <style>
140
+ @layer smrt.reset, smrt.structure, smrt.theme;
141
+ @layer smrt.theme {
140
142
  .invoice-totals {
141
143
  display: flex;
142
144
  flex-direction: column;
@@ -161,7 +163,7 @@ function formatMoney(amount: number): string {
161
163
  justify-content: space-between;
162
164
  align-items: center;
163
165
  font: var(--smrt-typography-body-medium-font);
164
- color: var(--smrt-color-on-surface, #1c1b1f);
166
+ color: var(--smrt-color-on-surface);
165
167
  }
166
168
 
167
169
  .sm .totals-row {
@@ -173,24 +175,24 @@ function formatMoney(amount: number): string {
173
175
  }
174
176
 
175
177
  .totals-label {
176
- color: var(--smrt-color-on-surface-variant, #49454f);
178
+ color: var(--smrt-color-on-surface-variant);
177
179
  }
178
180
 
179
181
  .totals-value {
180
182
  font-variant-numeric: tabular-nums;
181
183
  font-weight: var(--smrt-typography-weight-medium, 500);
182
- color: var(--smrt-color-on-surface, #1c1b1f);
184
+ color: var(--smrt-color-on-surface);
183
185
  }
184
186
 
185
187
  .totals-row.total {
186
188
  padding-top: var(--smrt-spacing-2, 0.5rem);
187
- border-top: 2px solid var(--smrt-color-outline-variant, #c4c6d0);
189
+ border-top: 2px solid var(--smrt-color-outline-variant);
188
190
  font-weight: var(--smrt-typography-weight-semibold, 600);
189
191
  }
190
192
 
191
193
  .totals-row.total .totals-label,
192
194
  .totals-row.total .totals-value {
193
- color: var(--smrt-color-on-surface, #1c1b1f);
195
+ color: var(--smrt-color-on-surface);
194
196
  font: var(--smrt-typography-title-medium-font);
195
197
  }
196
198
 
@@ -200,26 +202,27 @@ function formatMoney(amount: number): string {
200
202
  }
201
203
 
202
204
  .totals-row.paid {
203
- color: var(--smrt-color-tertiary, #006c4c);
205
+ color: var(--smrt-color-tertiary);
204
206
  }
205
207
 
206
208
  .totals-row.paid .totals-label {
207
- color: var(--smrt-color-tertiary, #006c4c);
209
+ color: var(--smrt-color-tertiary);
208
210
  }
209
211
 
210
212
  .totals-row.balance {
211
213
  padding-top: var(--smrt-spacing-2, 0.5rem);
212
- border-top: 1px solid var(--smrt-color-outline-variant, #c4c6d0);
214
+ border-top: 1px solid var(--smrt-color-outline-variant);
213
215
  font-weight: var(--smrt-typography-weight-semibold, 600);
214
216
  }
215
217
 
216
218
  .totals-row.balance.due .totals-label,
217
219
  .totals-row.balance.due .totals-value {
218
- color: var(--smrt-color-error, #ba1a1a);
220
+ color: var(--smrt-color-error);
219
221
  }
220
222
 
221
223
  .totals-row.balance.credit .totals-label,
222
224
  .totals-row.balance.credit .totals-value {
223
- color: var(--smrt-color-tertiary, #006c4c);
225
+ color: var(--smrt-color-tertiary);
224
226
  }
227
+ }
225
228
  </style>
@@ -88,8 +88,11 @@ $effect(() => {
88
88
  </fieldset>
89
89
 
90
90
  <style>
91
+ @layer smrt.reset, smrt.structure, smrt.theme;
92
+ @layer smrt.theme {
91
93
  .address-fields { min-inline-size: 0; margin: 0; padding: var(--smrt-spacing-4); border: 1px solid var(--smrt-color-outline-variant); border-radius: var(--smrt-radius-medium); }
92
94
  legend { padding-inline: var(--smrt-spacing-2); font: var(--smrt-typography-title-medium-font); color: var(--smrt-color-on-surface); }
93
95
  .address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--smrt-spacing-4); }
94
96
  @media (max-width: 30rem) { .address-grid { grid-template-columns: minmax(0, 1fr); } }
97
+ }
95
98
  </style>
@@ -65,7 +65,7 @@ const text = $derived({
65
65
  });
66
66
  </script>
67
67
 
68
- <section class="contacts" aria-labelledby={headingId}>
68
+ <section class="contacts" aria-labelledby={headingId} data-smrt-component="PartyContactFields">
69
69
  <div class="contacts-heading">
70
70
  <h2 id={headingId}>{text.heading}</h2>
71
71
  {#if !readOnly && canAdd}
@@ -132,6 +132,8 @@ const text = $derived({
132
132
  </section>
133
133
 
134
134
  <style>
135
+ @layer smrt.reset, smrt.structure, smrt.theme;
136
+ @layer smrt.theme {
135
137
  .contacts { display: grid; gap: var(--smrt-spacing-4); min-inline-size: 0; }
136
138
  .contacts-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--smrt-spacing-3); flex-wrap: wrap; }
137
139
  h2, h3, p { margin: 0; }
@@ -150,4 +152,5 @@ const text = $derived({
150
152
  .field-grid { grid-template-columns: minmax(0, 1fr); }
151
153
  .contact-card { padding: var(--smrt-spacing-3); }
152
154
  }
155
+ }
153
156
  </style>
@@ -59,7 +59,7 @@ const { t } = useI18n();
59
59
  const id = $props.id();
60
60
  </script>
61
61
 
62
- <section class="pricing-decision">
62
+ <section class="pricing-decision" data-smrt-component="PricingVersionDecision">
63
63
  <PricingVersionSummary {version} />
64
64
  {#if error}<p role="alert">{error}</p>{/if}
65
65
  {#if readOnly}
@@ -82,7 +82,10 @@ const id = $props.id();
82
82
  </section>
83
83
 
84
84
  <style>
85
+ @layer smrt.reset, smrt.structure, smrt.theme;
86
+ @layer smrt.theme {
85
87
  .pricing-decision { min-width: 0; overflow-wrap: anywhere; }
86
88
  .decisions { display: flex; flex-wrap: wrap; gap: var(--smrt-spacing-3); margin-top: var(--smrt-spacing-3); }
87
89
  .decisions :global(button) { max-width: 100%; white-space: normal; }
90
+ }
88
91
  </style>
@@ -23,7 +23,7 @@ function amount(value: number | null): string {
23
23
  }
24
24
  </script>
25
25
 
26
- <section class="pricing-summary" aria-label={version.label}>
26
+ <section class="pricing-summary" aria-label={version.label} data-smrt-component="PricingVersionSummary">
27
27
  <h3>{version.label}</h3>
28
28
  <p>{version.counterparty} · {version.status}</p>
29
29
  <p><strong>{t(M['commerce.pricing.total'])}: {amount(version.total.amountMinor)} {version.total.currency}</strong></p>
@@ -39,8 +39,11 @@ function amount(value: number | null): string {
39
39
  </section>
40
40
 
41
41
  <style>
42
+ @layer smrt.reset, smrt.structure, smrt.theme;
43
+ @layer smrt.theme {
42
44
  .pricing-summary { min-width: 0; overflow-wrap: anywhere; }
43
45
  .pricing-summary ul { display: grid; gap: var(--smrt-spacing-3); padding-inline-start: var(--smrt-spacing-5); }
44
46
  .pricing-summary li { min-width: 0; }
45
47
  .pricing-summary li strong { display: block; }
48
+ }
46
49
  </style>
@@ -137,7 +137,7 @@ function displayMoney(value: QuoteMoneyMinor): string {
137
137
  const money = (amountMinor: number | null) =>
138
138
  displayMoney({ currency, minorUnitDigits, amountMinor });
139
139
  </script>
140
- <section class="purchase-editor" aria-label={title}>
140
+ <section class="purchase-editor" aria-label={title} data-smrt-component="PurchaseOrderEditor">
141
141
  <h2>{title}</h2>
142
142
  <p>{t(P['commerce.purchase.boundary'])}</p>
143
143
  <p>{source.vendor} — {source.label} · {currency}</p>
@@ -202,9 +202,12 @@ const money = (amountMinor: number | null) =>
202
202
  {/if}
203
203
  </section>
204
204
  <style>
205
+ @layer smrt.reset, smrt.structure, smrt.theme;
206
+ @layer smrt.theme {
205
207
  .editor-attachments { min-width: 0; margin: 0; padding: 0; border: 0; }
206
208
  .purchase-editor{max-width:48rem;min-width:0;overflow-wrap:anywhere;color:var(--smrt-color-on-surface)}
207
209
  fieldset{min-width:0;margin-block:var(--smrt-spacing-4,1rem);padding:var(--smrt-spacing-4,1rem);border:1px solid var(--smrt-color-outline-variant);border-radius:var(--smrt-radius-md,0.5rem)}
208
210
  .allocation{margin-block:var(--smrt-spacing-4,1rem)}
209
211
  .actions{display:flex;flex-wrap:wrap;gap:var(--smrt-spacing-3,0.75rem);margin-block:var(--smrt-spacing-4,1rem)}
212
+ }
210
213
  </style>
@@ -71,7 +71,7 @@ const textFields = [
71
71
  ] as const;
72
72
  </script>
73
73
 
74
- <section aria-label={title}>
74
+ <section aria-label={title} data-smrt-component="PurchaseOrderHeaderForm">
75
75
  <h2>{title}</h2>
76
76
  {#if message}<p role="alert">{message}</p>{/if}
77
77
  <Form {...formAttributes} {action} method="post" {onsubmit} preventDefault={false}>
@@ -39,7 +39,7 @@ let {
39
39
  }: Props = $props();
40
40
  const { t } = useI18n();
41
41
  </script>
42
- <div class="purchase-source">
42
+ <div class="purchase-source" data-smrt-component="PurchaseSourceSelector">
43
43
  <Form {action} {onsubmit} method="get" preventDefault={false}>
44
44
  {#each hiddenFields as field}<Input type="hidden" name={field.name} value={field.value} />{/each}
45
45
  <FormGroup label={label ?? t(P['commerce.purchase.source'])} {error} required>
@@ -53,4 +53,9 @@ const { t } = useI18n();
53
53
  <Button type="submit" disabled={disabled || sources.every(source=>source.disabled)} density="touch">{t(P['commerce.purchase.use'])}</Button>
54
54
  </Form>
55
55
  </div>
56
- <style>.purchase-source{max-width:48rem;min-width:0;overflow-wrap:anywhere;color:var(--smrt-color-on-surface)}</style>
56
+ <style>
57
+ @layer smrt.reset, smrt.structure, smrt.theme;
58
+ @layer smrt.theme {
59
+ .purchase-source{max-width:48rem;min-width:0;overflow-wrap:anywhere;color:var(--smrt-color-on-surface)}
60
+ }
61
+ </style>
@@ -115,7 +115,7 @@ const title = $derived(
115
115
  );
116
116
  </script>
117
117
 
118
- <section class="quote-editor" aria-label={title}>
118
+ <section class="quote-editor" aria-label={title} data-smrt-component="QuoteEditor">
119
119
  <h2>{title}</h2>
120
120
  <p>{t(Q[kind === 'vendor-quotation' ? 'commerce.quote.vendor_hint' : 'commerce.quote.estimate_hint'])}</p>
121
121
  {#if readonly}<p>{t(Q['commerce.quote.readonly'])}</p>{/if}
@@ -170,8 +170,11 @@ const title = $derived(
170
170
  </section>
171
171
 
172
172
  <style>
173
+ @layer smrt.reset, smrt.structure, smrt.theme;
174
+ @layer smrt.theme {
173
175
  .editor-attachments { min-width: 0; margin: 0; padding: 0; border: 0; }
174
176
  .quote-editor { max-width: 48rem; min-width: 0; color: var(--smrt-color-on-surface); overflow-wrap: anywhere; }
175
177
  fieldset { min-width: 0; margin-block: var(--smrt-spacing-4, 1rem); padding: var(--smrt-spacing-4, 1rem); border: 1px solid var(--smrt-color-outline-variant); border-radius: var(--smrt-radius-md, 0.5rem); }
176
178
  .actions { margin-top: var(--smrt-spacing-4, 1rem); }
179
+ }
177
180
  </style>
@@ -28,7 +28,7 @@ const delta = $derived.by(() => {
28
28
  }
29
29
  });
30
30
  </script>
31
- <section class="quote-comparison" aria-label={title ?? t(Q['commerce.quote.compare'])}>
31
+ <section class="quote-comparison" aria-label={title ?? t(Q['commerce.quote.compare'])} data-smrt-component="QuoteRevisionComparison">
32
32
  <h2>{title ?? t(Q['commerce.quote.compare'])}</h2>
33
33
  <div class="versions">
34
34
  <QuoteRevisionHistory revisions={[previous]} title={t(Q['commerce.quote.before'])} />
@@ -39,6 +39,9 @@ const delta = $derived.by(() => {
39
39
  {:else}<p>{t(Q['commerce.quote.incomparable'])}</p>{/if}
40
40
  </section>
41
41
  <style>
42
+ @layer smrt.reset, smrt.structure, smrt.theme;
43
+ @layer smrt.theme {
42
44
  .quote-comparison { min-width: 0; color: var(--smrt-color-on-surface); overflow-wrap: anywhere; }
43
45
  .versions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--smrt-spacing-4, 1rem); }
46
+ }
44
47
  </style>
@@ -28,7 +28,7 @@ function amount(money: QuoteMoneyMinor): string {
28
28
  }
29
29
  }
30
30
  </script>
31
- <section class="quote-history" aria-label={title ?? t(Q['commerce.quote.history'])}>
31
+ <section class="quote-history" aria-label={title ?? t(Q['commerce.quote.history'])} data-smrt-component="QuoteRevisionHistory">
32
32
  <h2>{title ?? t(Q['commerce.quote.history'])}</h2>
33
33
  <ol>
34
34
  {#each revisions as revision (revision.id)}
@@ -48,8 +48,11 @@ function amount(money: QuoteMoneyMinor): string {
48
48
  </ol>
49
49
  </section>
50
50
  <style>
51
+ @layer smrt.reset, smrt.structure, smrt.theme;
52
+ @layer smrt.theme {
51
53
  .quote-history { min-width: 0; color: var(--smrt-color-on-surface); overflow-wrap: anywhere; }
52
54
  ol { padding-inline-start: var(--smrt-spacing-6, 1.5rem); }
53
55
  li { margin-block: var(--smrt-spacing-4, 1rem); }
54
56
  article { padding: var(--smrt-spacing-4, 1rem); border: 1px solid var(--smrt-color-outline-variant); border-radius: var(--smrt-radius-md, 0.5rem); }
57
+ }
55
58
  </style>
@@ -98,7 +98,7 @@ const someSelected = $derived(
98
98
  );
99
99
  </script>
100
100
 
101
- <div class="unbilled-items">
101
+ <div class="unbilled-items" data-smrt-component="UnbilledItems">
102
102
  {#if items.length === 0}
103
103
  <div class="empty-state">
104
104
  <p>{emptyMessage}</p>
@@ -166,10 +166,12 @@ const someSelected = $derived(
166
166
  </div>
167
167
 
168
168
  <style>
169
+ @layer smrt.reset, smrt.structure, smrt.theme;
170
+ @layer smrt.theme {
169
171
  .unbilled-items {
170
172
  display: flex;
171
173
  flex-direction: column;
172
- border: 1px solid var(--smrt-color-outline-variant, #c4c6d0);
174
+ border: 1px solid var(--smrt-color-outline-variant);
173
175
  border-radius: var(--smrt-radius-medium, 0.5rem);
174
176
  overflow: hidden;
175
177
  }
@@ -179,7 +181,7 @@ const someSelected = $derived(
179
181
  align-items: center;
180
182
  justify-content: center;
181
183
  padding: var(--smrt-spacing-8, 2rem) var(--smrt-spacing-4, 1rem);
182
- color: var(--smrt-color-on-surface-variant, #49454f);
184
+ color: var(--smrt-color-on-surface-variant);
183
185
  }
184
186
 
185
187
  .empty-state p {
@@ -191,8 +193,8 @@ const someSelected = $derived(
191
193
  justify-content: space-between;
192
194
  align-items: center;
193
195
  padding: var(--smrt-spacing-3, 0.75rem) var(--smrt-spacing-4, 1rem);
194
- background: var(--smrt-color-surface-container-low, #f7f2fa);
195
- border-bottom: 1px solid var(--smrt-color-outline-variant, #c4c6d0);
196
+ background: var(--smrt-color-surface-container-low);
197
+ border-bottom: 1px solid var(--smrt-color-outline-variant);
196
198
  }
197
199
 
198
200
  .select-all {
@@ -201,13 +203,13 @@ const someSelected = $derived(
201
203
  gap: var(--smrt-spacing-2, 0.5rem);
202
204
  font: var(--smrt-typography-body-medium-font);
203
205
  font-weight: var(--smrt-typography-weight-medium, 500);
204
- color: var(--smrt-color-on-surface, #1c1b1f);
206
+ color: var(--smrt-color-on-surface);
205
207
  cursor: pointer;
206
208
  }
207
209
 
208
210
  .selected-count {
209
211
  font: var(--smrt-typography-label-small-font);
210
- color: var(--smrt-color-on-surface-variant, #49454f);
212
+ color: var(--smrt-color-on-surface-variant);
211
213
  }
212
214
 
213
215
  .items-list {
@@ -215,7 +217,7 @@ const someSelected = $derived(
215
217
  flex-direction: column;
216
218
  max-height: 400px;
217
219
  overflow-y: auto;
218
- background: var(--smrt-color-surface, #ffffff);
220
+ background: var(--smrt-color-surface);
219
221
  }
220
222
 
221
223
  .item-row {
@@ -223,7 +225,7 @@ const someSelected = $derived(
223
225
  align-items: center;
224
226
  gap: var(--smrt-spacing-3, 0.75rem);
225
227
  padding: var(--smrt-spacing-3, 0.75rem) var(--smrt-spacing-4, 1rem);
226
- border-bottom: 1px solid var(--smrt-color-surface-variant, #e7e0ec);
228
+ border-bottom: 1px solid var(--smrt-color-surface-variant);
227
229
  cursor: pointer;
228
230
  transition: background var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, cubic-bezier(0.2, 0, 0, 1));
229
231
  }
@@ -235,11 +237,11 @@ const someSelected = $derived(
235
237
  }
236
238
 
237
239
  .item-row:hover {
238
- background: var(--smrt-color-surface-container-low, #f7f2fa);
240
+ background: var(--smrt-color-surface-container-low);
239
241
  }
240
242
 
241
243
  .item-row.selected {
242
- background: var(--smrt-color-primary-container, #d3e3fd);
244
+ background: var(--smrt-color-primary-container);
243
245
  }
244
246
 
245
247
  .item-row:last-child {
@@ -267,22 +269,22 @@ const someSelected = $derived(
267
269
  font-weight: var(--smrt-typography-weight-medium, 500);
268
270
  text-transform: uppercase;
269
271
  letter-spacing: 0.025em;
270
- border-radius: var(--smrt-radius-full, 9999px);
272
+ border-radius: var(--smrt-radius-full);
271
273
  }
272
274
 
273
275
  .type-expense {
274
- background: var(--smrt-color-tertiary-container, #ddf5e5);
275
- color: var(--smrt-color-on-tertiary-container, #0c1f15);
276
+ background: var(--smrt-color-tertiary-container);
277
+ color: var(--smrt-color-on-tertiary-container);
276
278
  }
277
279
 
278
280
  .type-time {
279
- background: var(--smrt-color-primary-container, #d3e3fd);
280
- color: var(--smrt-color-on-primary-container, #041e49);
281
+ background: var(--smrt-color-primary-container);
282
+ color: var(--smrt-color-on-primary-container);
281
283
  }
282
284
 
283
285
  .item-description {
284
286
  font: var(--smrt-typography-body-medium-font);
285
- color: var(--smrt-color-on-surface, #1c1b1f);
287
+ color: var(--smrt-color-on-surface);
286
288
  white-space: nowrap;
287
289
  overflow: hidden;
288
290
  text-overflow: ellipsis;
@@ -292,17 +294,17 @@ const someSelected = $derived(
292
294
  display: flex;
293
295
  gap: var(--smrt-spacing-3, 0.75rem);
294
296
  font: var(--smrt-typography-body-small-font);
295
- color: var(--smrt-color-on-surface-variant, #49454f);
297
+ color: var(--smrt-color-on-surface-variant);
296
298
  }
297
299
 
298
300
  .item-category {
299
- color: var(--smrt-color-on-surface-variant, #49454f);
301
+ color: var(--smrt-color-on-surface-variant);
300
302
  }
301
303
 
302
304
  .item-amount {
303
305
  font: var(--smrt-typography-body-medium-font);
304
306
  font-weight: var(--smrt-typography-weight-medium, 500);
305
- color: var(--smrt-color-on-surface, #1c1b1f);
307
+ color: var(--smrt-color-on-surface);
306
308
  font-variant-numeric: tabular-nums;
307
309
  }
308
310
 
@@ -311,8 +313,8 @@ const someSelected = $derived(
311
313
  justify-content: space-between;
312
314
  align-items: center;
313
315
  padding: var(--smrt-spacing-4, 1rem);
314
- background: var(--smrt-color-surface-container-low, #f7f2fa);
315
- border-top: 1px solid var(--smrt-color-outline-variant, #c4c6d0);
316
+ background: var(--smrt-color-surface-container-low);
317
+ border-top: 1px solid var(--smrt-color-outline-variant);
316
318
  }
317
319
 
318
320
  .selected-summary {
@@ -323,12 +325,13 @@ const someSelected = $derived(
323
325
 
324
326
  .summary-label {
325
327
  font: var(--smrt-typography-body-medium-font);
326
- color: var(--smrt-color-on-surface-variant, #49454f);
328
+ color: var(--smrt-color-on-surface-variant);
327
329
  }
328
330
 
329
331
  .summary-value {
330
332
  font: var(--smrt-typography-title-large-font);
331
333
  font-weight: var(--smrt-typography-weight-semibold, 600);
332
- color: var(--smrt-color-on-surface, #1c1b1f);
334
+ color: var(--smrt-color-on-surface);
333
335
  }
336
+ }
334
337
  </style>
@@ -80,7 +80,7 @@ function minimumOrder(amountMinor: number): string {
80
80
  }
81
81
  </script>
82
82
 
83
- <section class="party-detail">
83
+ <section class="party-detail" data-smrt-component="VendorDetail">
84
84
  {#if backHref}<Button href={backHref} variant="ghost">{t(M['commerce.party.back_to'], { plural })}</Button>{/if}
85
85
  <PageHeader title={vendor.profile.name} subtitle={vendor.profile.description ?? t(M['commerce.vendor.details'])}>
86
86
  {#snippet actions()}
@@ -122,6 +122,8 @@ function minimumOrder(amountMinor: number): string {
122
122
  </section>
123
123
 
124
124
  <style>
125
+ @layer smrt.reset, smrt.structure, smrt.theme;
126
+ @layer smrt.theme {
125
127
  .party-detail { display: grid; gap: var(--smrt-spacing-5); max-inline-size: 64rem; min-inline-size: 0; overflow-wrap: anywhere; }
126
128
  .summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--smrt-spacing-4); }
127
129
  h2 { margin: 0 0 var(--smrt-spacing-4); font: var(--smrt-typography-title-medium-font); color: var(--smrt-color-on-surface); }
@@ -131,4 +133,5 @@ function minimumOrder(amountMinor: number): string {
131
133
  a { color: var(--smrt-color-primary); }
132
134
  .notes { margin: 0; white-space: pre-wrap; }
133
135
  @media (max-width: 42rem) { .summary-grid { grid-template-columns: minmax(0, 1fr); } dl { grid-template-columns: minmax(0, 1fr); gap: var(--smrt-spacing-1); } dd { margin-block-end: var(--smrt-spacing-2); } }
136
+ }
134
137
  </style>