@happyvertical/smrt-commerce 0.60.16 → 0.60.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 (33) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist/manifest.json +1 -1
  4. package/dist/smrt-knowledge.json +3 -3
  5. package/dist/svelte/components/CustomerDetail.svelte +60 -15
  6. package/dist/svelte/components/CustomerDirectory.svelte +82 -22
  7. package/dist/svelte/components/CustomerForm.svelte +74 -18
  8. package/dist/svelte/components/InvoiceActions.svelte +7 -3
  9. package/dist/svelte/components/InvoiceAllocationFields.svelte +22 -4
  10. package/dist/svelte/components/InvoiceCard.svelte +81 -82
  11. package/dist/svelte/components/InvoiceHeader.svelte +56 -57
  12. package/dist/svelte/components/InvoiceLineItems.svelte +142 -123
  13. package/dist/svelte/components/InvoiceRecordScreen.svelte +30 -7
  14. package/dist/svelte/components/InvoiceReview.svelte +16 -3
  15. package/dist/svelte/components/InvoiceTotals.svelte +37 -40
  16. package/dist/svelte/components/MoneyInvoiceEditor.svelte +44 -15
  17. package/dist/svelte/components/PartyAddressFields.svelte +32 -6
  18. package/dist/svelte/components/PartyContactFields.svelte +83 -26
  19. package/dist/svelte/components/PricingVersionDecision.svelte +20 -5
  20. package/dist/svelte/components/PricingVersionSummary.svelte +20 -5
  21. package/dist/svelte/components/PurchaseOrderEditor.svelte +42 -9
  22. package/dist/svelte/components/PurchaseSourceSelector.svelte +13 -2
  23. package/dist/svelte/components/QuoteEditor.svelte +35 -7
  24. package/dist/svelte/components/QuoteRevisionComparison.svelte +18 -4
  25. package/dist/svelte/components/QuoteRevisionHistory.svelte +25 -5
  26. package/dist/svelte/components/UnbilledItems.svelte +106 -106
  27. package/dist/svelte/components/VendorDetail.svelte +57 -12
  28. package/dist/svelte/components/VendorDirectory.svelte +82 -22
  29. package/dist/svelte/components/VendorForm.svelte +70 -16
  30. package/dist/svelte/playground/InvoicePreparationPreview.svelte +9 -2
  31. package/dist/svelte/playground/PartyFormPreview.svelte +1 -1
  32. package/dist/svelte/playground/PartySelectPreview.svelte +10 -4
  33. package/package.json +16 -16
@@ -87,83 +87,83 @@ 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" data-smrt-component="InvoiceLineItems">
90
+ <div class="smrt-invoice-line-items__root" data-smrt-component="InvoiceLineItems">
91
91
  {#if retained}
92
92
  {#if retained.lines.length === 0}
93
- <div class="empty-state"><p>{emptyMessage}</p></div>
93
+ <div class="smrt-invoice-line-items__empty" data-smrt-part="empty"><p>{emptyMessage}</p></div>
94
94
  {:else}
95
- <table class="line-items-table">
96
- <thead><tr><th class="col-description">Description</th><th class="col-source">Source</th><th class="col-qty">Qty</th><th class="col-price">{t(M['commerce.invoice_line_items.unit_price'])}</th><th class="col-amount">Amount</th></tr></thead>
95
+ <table class="smrt-invoice-line-items__table" data-smrt-part="list">
96
+ <thead><tr><th class="smrt-invoice-line-items__cell-description" data-smrt-part="cell">Description</th><th class="smrt-invoice-line-items__cell-source" data-smrt-part="cell">Source</th><th class="smrt-invoice-line-items__cell-qty" data-smrt-part="cell">Qty</th><th class="smrt-invoice-line-items__cell-price" data-smrt-part="cell">{t(M['commerce.invoice_line_items.unit_price'])}</th><th class="smrt-invoice-line-items__cell-amount" data-smrt-part="cell">Amount</th></tr></thead>
97
97
  <tbody>
98
98
  {#each retained.lines as line (line.id)}
99
99
  <tr>
100
- <td class="col-description">
101
- {#if line.category}<span class="item-category">{line.category}</span>{/if}
102
- <span class="item-description">{line.description}</span>
100
+ <td class="smrt-invoice-line-items__cell-description" data-smrt-part="cell">
101
+ {#if line.category}<span class="smrt-invoice-line-items__category" data-smrt-part="label">{line.category}</span>{/if}
102
+ <span class="smrt-invoice-line-items__description" data-smrt-part="title">{line.description}</span>
103
103
  {#if line.discountLabel}<span>{line.discountLabel}</span>{/if}
104
104
  {#each line.taxLabels ?? [] as tax}<span>{tax}</span>{/each}
105
105
  {#if line.correctionLabel}<span>{line.correctionLabel}</span>{/if}
106
106
  {@render details?.(line)}
107
107
  </td>
108
- <td class="col-source">{line.sourceLabel ?? '—'}</td>
109
- <td class="col-qty">{line.quantity}</td>
110
- <td class="col-price">{line.unitPriceMinor === undefined || line.unitPriceMinor === null ? '—' : formatInvoiceMinorUnits(line.unitPriceMinor, retained.currency)}</td>
111
- <td class="col-amount">{formatInvoiceMinorUnits(line.amountMinor, retained.currency)}</td>
108
+ <td class="smrt-invoice-line-items__cell-source" data-smrt-part="cell">{line.sourceLabel ?? '—'}</td>
109
+ <td class="smrt-invoice-line-items__cell-qty" data-smrt-part="cell">{line.quantity}</td>
110
+ <td class="smrt-invoice-line-items__cell-price" data-smrt-part="cell">{line.unitPriceMinor === undefined || line.unitPriceMinor === null ? '—' : formatInvoiceMinorUnits(line.unitPriceMinor, retained.currency)}</td>
111
+ <td class="smrt-invoice-line-items__cell-amount" data-smrt-part="cell">{formatInvoiceMinorUnits(line.amountMinor, retained.currency)}</td>
112
112
  </tr>
113
113
  {/each}
114
114
  </tbody>
115
- <tfoot><tr class="total-row"><td colspan="4" class="total-label">Subtotal</td><td class="col-amount">{formatInvoiceMinorUnits(retained.subtotalMinor, retained.currency)}</td></tr></tfoot>
115
+ <tfoot><tr class="smrt-invoice-line-items__total-row" data-smrt-part="row"><td colspan="4" class="smrt-invoice-line-items__total-label" data-smrt-part="label">Subtotal</td><td class="smrt-invoice-line-items__cell-amount" data-smrt-part="cell">{formatInvoiceMinorUnits(retained.subtotalMinor, retained.currency)}</td></tr></tfoot>
116
116
  </table>
117
117
  {/if}
118
118
  {:else if items.length === 0}
119
- <div class="empty-state">
119
+ <div class="smrt-invoice-line-items__empty" data-smrt-part="empty">
120
120
  <p>{emptyMessage}</p>
121
121
  {#if editable && onadd}
122
- <Button variant="ghost" class="add-btn" onclick={onadd}>
122
+ <Button class="smrt-invoice-line-items__add" variant="ghost" onclick={onadd}>
123
123
  {t(M['commerce.invoice_line_items.add_item'])}
124
124
  </Button>
125
125
  {/if}
126
126
  </div>
127
127
  {:else}
128
- <table class="line-items-table">
128
+ <table class="smrt-invoice-line-items__table" data-smrt-part="list">
129
129
  <thead>
130
130
  <tr>
131
- <th class="col-description">Description</th>
131
+ <th class="smrt-invoice-line-items__cell-description" data-smrt-part="cell">Description</th>
132
132
  {#if showSource}
133
- <th class="col-source">Source</th>
133
+ <th class="smrt-invoice-line-items__cell-source" data-smrt-part="cell">Source</th>
134
134
  {/if}
135
- <th class="col-qty">Qty</th>
136
- <th class="col-price">{t(M['commerce.invoice_line_items.unit_price'])}</th>
137
- <th class="col-amount">Amount</th>
135
+ <th class="smrt-invoice-line-items__cell-qty" data-smrt-part="cell">Qty</th>
136
+ <th class="smrt-invoice-line-items__cell-price" data-smrt-part="cell">{t(M['commerce.invoice_line_items.unit_price'])}</th>
137
+ <th class="smrt-invoice-line-items__cell-amount" data-smrt-part="cell">Amount</th>
138
138
  {#if editable}
139
- <th class="col-actions"></th>
139
+ <th class="smrt-invoice-line-items__cell-actions" data-smrt-part="cell"></th>
140
140
  {/if}
141
141
  </tr>
142
142
  </thead>
143
143
  <tbody>
144
144
  {#each items as item (item.id)}
145
145
  <tr>
146
- <td class="col-description">
146
+ <td class="smrt-invoice-line-items__cell-description" data-smrt-part="cell">
147
147
  {#if item.category}
148
- <span class="item-category">{item.category}</span>
148
+ <span class="smrt-invoice-line-items__category" data-smrt-part="label">{item.category}</span>
149
149
  {/if}
150
- <span class="item-description">{item.description}</span>
150
+ <span class="smrt-invoice-line-items__description" data-smrt-part="title">{item.description}</span>
151
151
  </td>
152
152
  {#if showSource}
153
- <td class="col-source">
154
- <span class="source-badge source-{item.sourceType ?? 'manual'}">
153
+ <td class="smrt-invoice-line-items__cell-source" data-smrt-part="cell">
154
+ <span class="smrt-invoice-line-items__badge smrt-invoice-line-items__source-{item.sourceType ?? 'manual'}" data-smrt-part="badge">
155
155
  {sourceLabels[item.sourceType ?? 'manual']}
156
156
  </span>
157
157
  </td>
158
158
  {/if}
159
- <td class="col-qty">{item.quantity}</td>
160
- <td class="col-price">{formatMoney(item.unitPrice)}</td>
161
- <td class="col-amount">{formatMoney(item.amount)}</td>
159
+ <td class="smrt-invoice-line-items__cell-qty" data-smrt-part="cell">{item.quantity}</td>
160
+ <td class="smrt-invoice-line-items__cell-price" data-smrt-part="cell">{formatMoney(item.unitPrice)}</td>
161
+ <td class="smrt-invoice-line-items__cell-amount" data-smrt-part="cell">{formatMoney(item.amount)}</td>
162
162
  {#if editable}
163
- <td class="col-actions">
163
+ <td class="smrt-invoice-line-items__cell-actions" data-smrt-part="cell">
164
164
  <Button
165
165
  variant="ghost"
166
- class="action-btn delete"
166
+ class="smrt-invoice-line-items__delete"
167
167
  title={t(M['commerce.invoice_line_items.remove_item'])}
168
168
  onclick={() => ondelete?.(item.id)}
169
169
  >
@@ -177,9 +177,9 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
177
177
  {/each}
178
178
  </tbody>
179
179
  <tfoot>
180
- <tr class="total-row">
181
- <td colspan={showSource ? 4 : 3} class="total-label">{t(M['commerce.invoice_line_items.line_total'])}</td>
182
- <td class="col-amount">{formatMoney(total)}</td>
180
+ <tr class="smrt-invoice-line-items__total-row" data-smrt-part="row">
181
+ <td colspan={showSource ? 4 : 3} class="smrt-invoice-line-items__total-label" data-smrt-part="label">{t(M['commerce.invoice_line_items.line_total'])}</td>
182
+ <td class="smrt-invoice-line-items__cell-amount" data-smrt-part="cell">{formatMoney(total)}</td>
183
183
  {#if editable}
184
184
  <td></td>
185
185
  {/if}
@@ -188,7 +188,7 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
188
188
  </table>
189
189
 
190
190
  {#if editable && onadd}
191
- <Button variant="ghost" class="add-btn add-btn-below" onclick={onadd}>
191
+ <Button class="smrt-invoice-line-items__add" variant="ghost" onclick={onadd}>
192
192
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2">
193
193
  <path d="M8 3v10M3 8h10" />
194
194
  </svg>
@@ -200,161 +200,185 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
200
200
 
201
201
  <style>
202
202
  @layer smrt.reset, smrt.structure, smrt.theme;
203
- @layer smrt.theme {
204
- .line-items-container {
203
+ @layer smrt.structure {
204
+ .smrt-invoice-line-items__root {
205
205
  width: 100%;
206
206
  }
207
-
208
- .empty-state {
207
+ .smrt-invoice-line-items__empty {
209
208
  display: flex;
210
209
  flex-direction: column;
211
210
  align-items: center;
212
211
  padding: var(--smrt-spacing-8, 2rem) var(--smrt-spacing-4, 1rem);
212
+ }
213
+ .smrt-invoice-line-items__empty p {
214
+ margin: 0 0 var(--smrt-spacing-4, 1rem);
215
+ }
216
+ .smrt-invoice-line-items__table {
217
+ width: 100%;
218
+ }
219
+ .smrt-invoice-line-items__table th {
220
+ padding: var(--smrt-spacing-3, 0.75rem) var(--smrt-spacing-2, 0.5rem);
221
+ }
222
+ .smrt-invoice-line-items__table td {
223
+ padding: var(--smrt-spacing-3, 0.75rem) var(--smrt-spacing-2, 0.5rem);
224
+ }
225
+ .smrt-invoice-line-items__cell-description {
226
+ width: 50%;
227
+ }
228
+ .smrt-invoice-line-items__cell-source {
229
+ width: 80px;
230
+ }
231
+ .smrt-invoice-line-items__cell-qty {
232
+ width: 60px;
233
+ }
234
+ .smrt-invoice-line-items__cell-price,
235
+ .smrt-invoice-line-items__cell-amount {
236
+ width: 100px;
237
+ }
238
+ .smrt-invoice-line-items__cell-actions {
239
+ width: 40px;
240
+ }
241
+ .smrt-invoice-line-items__category {
242
+ display: block;
243
+ }
244
+ .smrt-invoice-line-items__badge {
245
+ display: inline-block;
246
+ padding: var(--smrt-spacing-0_5, 0.125rem) var(--smrt-spacing-2, 0.5rem);
247
+ }
248
+ .smrt-invoice-line-items__total-row td {
249
+ padding-top: var(--smrt-spacing-4, 1rem);
250
+ }
251
+ /*
252
+ * These rules style the <button> rendered *inside* the smrt-ui <Button>
253
+ * child component (issue #1589). A plain scoped `.smrt-invoice-line-items__root
254
+ * [data-smrt-component="Button"] {}` rule would not reach it (no parent scope
255
+ * hash), so each is written as `.smrt-invoice-line-items__root
256
+ * :global([data-smrt-component="Button"])` — Svelte compiles the ancestor to
257
+ * `.smrt-invoice-line-items__root.svelte-HASH [data-smrt-component="Button"]`,
258
+ * which pierces into the child. Each rule anchors on the container that owns
259
+ * the button so the delete and add actions stay distinct.
260
+ * Overrides cover sizing/shape/color; the ghost variant owns the base.
261
+ */
262
+ .smrt-invoice-line-items__cell-actions :global([data-smrt-component="Button"]) {
263
+ display: inline-flex;
264
+ align-items: center;
265
+ justify-content: center;
266
+ width: 28px;
267
+ height: 28px;
268
+ }
269
+ .smrt-invoice-line-items__root :global(.smrt-invoice-line-items__add) {
270
+ display: inline-flex;
271
+ align-items: center;
272
+ gap: var(--smrt-spacing-2, 0.5rem);
273
+ padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-4, 1rem);
274
+ }
275
+ .smrt-invoice-line-items__root > :global([data-smrt-component="Button"]) {
276
+ margin-top: var(--smrt-spacing-3, 0.75rem);
277
+ }
278
+ }
279
+
280
+ @layer smrt.theme {
281
+ .smrt-invoice-line-items__empty {
213
282
  background: var(--smrt-color-surface-container-low);
214
283
  border: 1px dashed var(--smrt-color-outline);
215
284
  border-radius: var(--smrt-radius-medium, 0.5rem);
216
285
  text-align: center;
217
286
  }
218
-
219
- .empty-state p {
287
+ .smrt-invoice-line-items__empty p {
220
288
  color: var(--smrt-color-on-surface-variant);
221
- margin: 0 0 var(--smrt-spacing-4, 1rem);
222
289
  }
223
-
224
- .line-items-table {
225
- width: 100%;
290
+ .smrt-invoice-line-items__table {
226
291
  border-collapse: collapse;
227
292
  font: var(--smrt-typography-body-medium-font);
228
293
  }
229
-
230
- .line-items-table th {
294
+ .smrt-invoice-line-items__table th {
231
295
  text-align: left;
232
296
  font-weight: var(--smrt-typography-weight-medium, 500);
233
297
  color: var(--smrt-color-on-surface-variant);
234
- padding: var(--smrt-spacing-3, 0.75rem) var(--smrt-spacing-2, 0.5rem);
235
298
  border-bottom: var(--smrt-hairline);
236
299
  }
237
-
238
- .line-items-table td {
239
- padding: var(--smrt-spacing-3, 0.75rem) var(--smrt-spacing-2, 0.5rem);
300
+ .smrt-invoice-line-items__table td {
240
301
  border-bottom: 1px solid var(--smrt-color-surface-variant);
241
302
  vertical-align: top;
242
303
  }
243
-
244
- .col-description {
245
- width: 50%;
246
- }
247
-
248
- .col-source {
249
- width: 80px;
250
- }
251
-
252
- .col-qty {
253
- width: 60px;
304
+ .smrt-invoice-line-items__cell-qty {
254
305
  text-align: right;
255
306
  }
256
-
257
- .col-price,
258
- .col-amount {
259
- width: 100px;
307
+ .smrt-invoice-line-items__cell-price,
308
+ .smrt-invoice-line-items__cell-amount {
260
309
  text-align: right;
261
310
  font-variant-numeric: tabular-nums;
262
311
  }
263
-
264
- .col-actions {
265
- width: 40px;
312
+ .smrt-invoice-line-items__cell-actions {
266
313
  text-align: center;
267
314
  }
268
-
269
- .item-category {
270
- display: block;
315
+ .smrt-invoice-line-items__category {
271
316
  font: var(--smrt-typography-label-small-font);
272
317
  color: var(--smrt-color-on-surface-variant);
273
318
  text-transform: uppercase;
274
319
  letter-spacing: 0.025em;
275
320
  }
276
-
277
- .item-description {
321
+ .smrt-invoice-line-items__description {
278
322
  color: var(--smrt-color-on-surface);
279
323
  }
280
-
281
- .source-badge {
282
- display: inline-block;
283
- padding: var(--smrt-spacing-0_5, 0.125rem) var(--smrt-spacing-2, 0.5rem);
324
+ .smrt-invoice-line-items__badge {
284
325
  font: var(--smrt-typography-label-small-font);
285
326
  font-weight: var(--smrt-typography-weight-medium, 500);
286
327
  border-radius: var(--smrt-radius-full);
287
328
  }
288
-
289
- .source-expense {
329
+ .smrt-invoice-line-items__source-expense {
290
330
  background: var(--smrt-color-tertiary-container);
291
331
  color: var(--smrt-color-on-tertiary-container);
292
332
  }
293
-
294
- .source-time {
333
+ .smrt-invoice-line-items__source-time {
295
334
  background: var(--smrt-color-primary-container);
296
335
  color: var(--smrt-color-on-primary-container);
297
336
  }
298
-
299
- .source-manual {
337
+ .smrt-invoice-line-items__source-manual {
300
338
  background: var(--smrt-color-surface-variant);
301
339
  color: var(--smrt-color-on-surface-variant);
302
340
  }
303
-
304
- .total-row td {
341
+ .smrt-invoice-line-items__total-row td {
305
342
  border-top: 2px solid var(--smrt-color-outline-variant);
306
343
  border-bottom: none;
307
344
  font-weight: var(--smrt-typography-weight-semibold, 600);
308
- padding-top: var(--smrt-spacing-4, 1rem);
309
345
  }
310
-
311
- .total-label {
346
+ .smrt-invoice-line-items__total-label {
312
347
  text-align: right;
313
348
  color: var(--smrt-color-on-surface);
314
349
  }
315
-
316
350
  /*
317
- * These rules style the <button> rendered *inside* the smrt-ui <Button>
318
- * child component (issue #1589). A plain scoped `.action-btn {}` rule would
319
- * not reach it (no parent scope hash), so each is written as
320
- * `.line-items-container :global(.class)` — Svelte compiles the ancestor to
321
- * `.line-items-container.svelte-HASH .class`, which pierces into the child.
322
- * Overrides cover sizing/shape/color; the ghost variant owns the base.
323
- */
324
- .line-items-container :global(.action-btn) {
325
- display: inline-flex;
326
- align-items: center;
327
- justify-content: center;
328
- width: 28px;
329
- height: 28px;
351
+ * These rules style the <button> rendered *inside* the smrt-ui <Button>
352
+ * child component (issue #1589). A plain scoped `.smrt-invoice-line-items__root
353
+ * [data-smrt-component="Button"] {}` rule would not reach it (no parent scope
354
+ * hash), so each is written as `.smrt-invoice-line-items__root
355
+ * :global([data-smrt-component="Button"])` — Svelte compiles the ancestor to
356
+ * `.smrt-invoice-line-items__root.svelte-HASH [data-smrt-component="Button"]`,
357
+ * which pierces into the child. Each rule anchors on the container that owns
358
+ * the button so the delete and add actions stay distinct.
359
+ * Overrides cover sizing/shape/color; the ghost variant owns the base.
360
+ */
361
+ .smrt-invoice-line-items__cell-actions :global([data-smrt-component="Button"]) {
330
362
  background: transparent;
331
363
  border: none;
332
364
  border-radius: var(--smrt-radius-extra-small, 0.25rem);
333
365
  color: var(--smrt-color-on-surface-variant);
334
366
  transition: all var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, cubic-bezier(0.2, 0, 0, 1));
335
367
  }
336
-
337
368
  @media (prefers-reduced-motion: reduce) {
338
- .line-items-container :global(.action-btn) {
369
+ .smrt-invoice-line-items__cell-actions :global([data-smrt-component="Button"]) {
339
370
  transition: none;
340
371
  }
341
372
  }
342
-
343
- .line-items-container :global(.action-btn:hover) {
373
+ .smrt-invoice-line-items__cell-actions :global([data-smrt-component="Button"]:hover) {
344
374
  background: var(--smrt-color-surface-variant);
345
375
  color: var(--smrt-color-on-surface);
346
376
  }
347
-
348
- .line-items-container :global(.action-btn.delete:hover) {
377
+ .smrt-invoice-line-items__cell-actions :global([data-smrt-component="Button"].smrt-invoice-line-items__delete:hover) {
349
378
  background: var(--smrt-color-error-container);
350
379
  color: var(--smrt-color-error);
351
380
  }
352
-
353
- .line-items-container :global(.add-btn) {
354
- display: inline-flex;
355
- align-items: center;
356
- gap: var(--smrt-spacing-2, 0.5rem);
357
- padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-4, 1rem);
381
+ .smrt-invoice-line-items__root :global(.smrt-invoice-line-items__add) {
358
382
  font: var(--smrt-typography-label-large-font);
359
383
  font-weight: var(--smrt-typography-weight-medium, 500);
360
384
  color: var(--smrt-color-primary);
@@ -363,19 +387,14 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
363
387
  border-radius: var(--smrt-radius-small, 0.375rem);
364
388
  transition: all var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, cubic-bezier(0.2, 0, 0, 1));
365
389
  }
366
-
367
390
  @media (prefers-reduced-motion: reduce) {
368
- .line-items-container :global(.add-btn) {
391
+ .smrt-invoice-line-items__root :global(.smrt-invoice-line-items__add) {
369
392
  transition: none;
370
393
  }
371
394
  }
372
-
373
- .line-items-container :global(.add-btn:hover) {
395
+ .smrt-invoice-line-items__root :global(.smrt-invoice-line-items__add:hover) {
374
396
  background: var(--smrt-color-primary-container);
375
397
  }
376
-
377
- .line-items-container :global(.add-btn-below) {
378
- margin-top: var(--smrt-spacing-3, 0.75rem);
379
- }
380
398
  }
399
+
381
400
  </style>
@@ -44,7 +44,7 @@ const showCreditAction = $derived(
44
44
 
45
45
  {#snippet relatedCredits()}
46
46
  {#if data.creditNotes.length > 0}
47
- <section class="invoice-record-screen__credits" aria-label={t(M['commerce.invoice_record.credit_notes'])}>
47
+ <section class="smrt-invoice-record-screen__credits" data-smrt-part="body" aria-label={t(M['commerce.invoice_record.credit_notes'])}>
48
48
  <h2>{t(M['commerce.invoice_record.credit_notes'])}</h2>
49
49
  <ul>
50
50
  {#each data.creditNotes as credit (credit.id)}
@@ -80,15 +80,38 @@ const showCreditAction = $derived(
80
80
 
81
81
  <style>
82
82
  @layer smrt.reset, smrt.structure, smrt.theme;
83
- @layer smrt.theme {
84
- .invoice-record-screen__credits {
83
+ @layer smrt.structure {
84
+ .smrt-invoice-record-screen__credits {
85
85
  display: grid;
86
86
  gap: var(--smrt-spacing-sm, 0.5rem);
87
87
  margin-block-start: var(--smrt-spacing-md, 1rem);
88
88
  }
89
- .invoice-record-screen__credits h2 { margin: 0; font: var(--smrt-typography-title-small-font); }
90
- .invoice-record-screen__credits ul { display: grid; gap: var(--smrt-spacing-xs, 0.25rem); margin: 0; padding-inline-start: 1.25rem; }
91
- .invoice-record-screen__credits li { display: flex; flex-wrap: wrap; gap: var(--smrt-spacing-sm, 0.5rem); color: var(--smrt-color-on-surface); }
92
- .invoice-record-screen__credits li span, .invoice-record-screen__credits time { color: var(--smrt-color-on-surface-variant); }
89
+ .smrt-invoice-record-screen__credits h2 {
90
+ margin: 0;
91
+ }
92
+ .smrt-invoice-record-screen__credits ul {
93
+ display: grid;
94
+ gap: var(--smrt-spacing-xs, 0.25rem);
95
+ margin: 0;
96
+ padding-inline-start: 1.25rem;
97
+ }
98
+ .smrt-invoice-record-screen__credits li {
99
+ display: flex;
100
+ flex-wrap: wrap;
101
+ gap: var(--smrt-spacing-sm, 0.5rem);
102
+ }
93
103
  }
104
+
105
+ @layer smrt.theme {
106
+ .smrt-invoice-record-screen__credits h2 {
107
+ font: var(--smrt-typography-title-small-font);
108
+ }
109
+ .smrt-invoice-record-screen__credits li {
110
+ color: var(--smrt-color-on-surface);
111
+ }
112
+ .smrt-invoice-record-screen__credits li span, .smrt-invoice-record-screen__credits time {
113
+ color: var(--smrt-color-on-surface-variant);
114
+ }
115
+ }
116
+
94
117
  </style>
@@ -12,15 +12,28 @@ 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" data-smrt-component="InvoiceReview">
15
+ <section aria-label={t(M['commerce.preparation.review'])} class="smrt-invoice-review__root" 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
21
  @layer smrt.reset, smrt.structure, smrt.theme;
22
+ @layer smrt.structure {
23
+ .smrt-invoice-review__root {
24
+ padding: var(--smrt-spacing-3);
25
+ overflow-wrap: anywhere;
26
+ }
27
+ p {
28
+ margin-block: var(--smrt-spacing-2) 0;
29
+ }
30
+ }
31
+
22
32
  @layer smrt.theme {
23
- .invoice-review { padding: var(--smrt-spacing-3); border: var(--smrt-hairline-strong); border-radius: var(--smrt-radius-small); overflow-wrap: anywhere; }
24
- p { margin-block: var(--smrt-spacing-2) 0; }
33
+ .smrt-invoice-review__root {
34
+ border: var(--smrt-hairline-strong);
35
+ border-radius: var(--smrt-radius-small);
36
+ }
25
37
  }
38
+
26
39
  </style>
@@ -31,21 +31,21 @@ export type Props = RetainedInvoiceTotalsProps;
31
31
  const { retained, details, size = 'md' }: Props = $props();
32
32
  </script>
33
33
 
34
- <div class="invoice-totals" class:sm={size === 'sm'} class:lg={size === 'lg'} data-smrt-component="InvoiceTotals">
35
- <div class="totals-row"><span class="totals-label">Subtotal</span><span class="totals-value">{formatInvoiceMinorUnits(retained.subtotalMinor, retained.currency)}</span></div>
36
- {#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}
37
- {#each retained.taxes ?? [] as tax (tax.id)}<div class="totals-row"><span class="totals-label">{tax.label}</span><span class="totals-value">{formatInvoiceMinorUnits(tax.amountMinor, retained.currency)}</span></div>{/each}
38
- {#if retained.holdbackMinor !== undefined}<div class="totals-row"><span class="totals-label">{retained.holdbackLabel ?? 'Holdback'}</span><span class="totals-value">{formatInvoiceMinorUnits(retained.holdbackMinor, retained.currency)}</span></div>{/if}
39
- <div class="totals-row total"><span class="totals-label">Total</span><span class="totals-value">{formatInvoiceMinorUnits(retained.totalMinor, retained.currency)}</span></div>
40
- {#if retained.paidMinor !== undefined}<div class="totals-row paid"><span class="totals-label">{t(M['commerce.invoice_totals.amount_paid'])}</span><span class="totals-value">{formatInvoiceMinorUnits(retained.paidMinor, retained.currency)}</span></div>{/if}
41
- {#if retained.payableMinor !== undefined}<div class="totals-row balance"><span class="totals-label">Payable</span><span class="totals-value">{formatInvoiceMinorUnits(retained.payableMinor, retained.currency)}</span></div>{/if}
34
+ <div class="smrt-invoice-totals__root" class:smrt-invoice-totals__sm={size === 'sm'} class:smrt-invoice-totals__lg={size === 'lg'} data-smrt-component="InvoiceTotals">
35
+ <div class="smrt-invoice-totals__row" data-smrt-part="row"><span class="smrt-invoice-totals__label" data-smrt-part="label">Subtotal</span><span class="smrt-invoice-totals__value" data-smrt-part="value">{formatInvoiceMinorUnits(retained.subtotalMinor, retained.currency)}</span></div>
36
+ {#if retained.discountMinor !== undefined}<div class="smrt-invoice-totals__row" data-smrt-part="row"><span class="smrt-invoice-totals__label" data-smrt-part="label">Discount</span><span class="smrt-invoice-totals__value" data-smrt-part="value">{formatInvoiceMinorUnits(retained.discountMinor, retained.currency)}</span></div>{/if}
37
+ {#each retained.taxes ?? [] as tax (tax.id)}<div class="smrt-invoice-totals__row" data-smrt-part="row"><span class="smrt-invoice-totals__label" data-smrt-part="label">{tax.label}</span><span class="smrt-invoice-totals__value" data-smrt-part="value">{formatInvoiceMinorUnits(tax.amountMinor, retained.currency)}</span></div>{/each}
38
+ {#if retained.holdbackMinor !== undefined}<div class="smrt-invoice-totals__row" data-smrt-part="row"><span class="smrt-invoice-totals__label" data-smrt-part="label">{retained.holdbackLabel ?? 'Holdback'}</span><span class="smrt-invoice-totals__value" data-smrt-part="value">{formatInvoiceMinorUnits(retained.holdbackMinor, retained.currency)}</span></div>{/if}
39
+ <div class="smrt-invoice-totals__row smrt-invoice-totals__total" data-smrt-part="row"><span class="smrt-invoice-totals__label" data-smrt-part="label">Total</span><span class="smrt-invoice-totals__value" data-smrt-part="value">{formatInvoiceMinorUnits(retained.totalMinor, retained.currency)}</span></div>
40
+ {#if retained.paidMinor !== undefined}<div class="smrt-invoice-totals__row smrt-invoice-totals__paid" data-smrt-part="row"><span class="smrt-invoice-totals__label" data-smrt-part="label">{t(M['commerce.invoice_totals.amount_paid'])}</span><span class="smrt-invoice-totals__value" data-smrt-part="value">{formatInvoiceMinorUnits(retained.paidMinor, retained.currency)}</span></div>{/if}
41
+ {#if retained.payableMinor !== undefined}<div class="smrt-invoice-totals__row smrt-invoice-totals__balance" data-smrt-part="row"><span class="smrt-invoice-totals__label" data-smrt-part="label">Payable</span><span class="smrt-invoice-totals__value" data-smrt-part="value">{formatInvoiceMinorUnits(retained.payableMinor, retained.currency)}</span></div>{/if}
42
42
  {@render details?.(retained)}
43
43
  </div>
44
44
 
45
45
  <style>
46
46
  @layer smrt.reset, smrt.structure, smrt.theme;
47
- @layer smrt.theme {
48
- .invoice-totals {
47
+ @layer smrt.structure {
48
+ .smrt-invoice-totals__root {
49
49
  display: flex;
50
50
  flex-direction: column;
51
51
  gap: var(--smrt-spacing-2, 0.5rem);
@@ -53,72 +53,69 @@ const { retained, details, size = 'md' }: Props = $props();
53
53
  max-width: 280px;
54
54
  margin-left: auto;
55
55
  }
56
-
57
- .invoice-totals.sm {
56
+ .smrt-invoice-totals__root.smrt-invoice-totals__sm {
58
57
  max-width: 220px;
59
58
  gap: var(--smrt-spacing-1_5, 0.375rem);
60
59
  }
61
-
62
- .invoice-totals.lg {
60
+ .smrt-invoice-totals__root.smrt-invoice-totals__lg {
63
61
  max-width: 320px;
64
62
  gap: var(--smrt-spacing-3, 0.75rem);
65
63
  }
66
-
67
- .totals-row {
64
+ .smrt-invoice-totals__row {
68
65
  display: flex;
69
66
  justify-content: space-between;
70
67
  align-items: center;
68
+ }
69
+ .smrt-invoice-totals__row.smrt-invoice-totals__total {
70
+ padding-top: var(--smrt-spacing-2, 0.5rem);
71
+ }
72
+ .smrt-invoice-totals__row.smrt-invoice-totals__balance {
73
+ padding-top: var(--smrt-spacing-2, 0.5rem);
74
+ }
75
+ }
76
+
77
+ @layer smrt.theme {
78
+ .smrt-invoice-totals__row {
71
79
  font: var(--smrt-typography-body-medium-font);
72
80
  color: var(--smrt-color-on-surface);
73
81
  }
74
-
75
- .sm .totals-row {
82
+ .smrt-invoice-totals__sm .smrt-invoice-totals__row {
76
83
  font: var(--smrt-typography-body-small-font);
77
84
  }
78
-
79
- .lg .totals-row {
85
+ .smrt-invoice-totals__lg .smrt-invoice-totals__row {
80
86
  font: var(--smrt-typography-body-large-font);
81
87
  }
82
-
83
- .totals-label {
88
+ .smrt-invoice-totals__label {
84
89
  color: var(--smrt-color-on-surface-variant);
85
90
  }
86
-
87
- .totals-value {
91
+ .smrt-invoice-totals__value {
88
92
  font-variant-numeric: tabular-nums;
89
93
  font-weight: var(--smrt-typography-weight-medium, 500);
90
94
  color: var(--smrt-color-on-surface);
91
95
  }
92
-
93
- .totals-row.total {
94
- padding-top: var(--smrt-spacing-2, 0.5rem);
96
+ .smrt-invoice-totals__row.smrt-invoice-totals__total {
95
97
  border-top: 2px solid var(--smrt-color-outline-variant);
96
98
  font-weight: var(--smrt-typography-weight-semibold, 600);
97
99
  }
98
-
99
- .totals-row.total .totals-label,
100
- .totals-row.total .totals-value {
100
+ .smrt-invoice-totals__row.smrt-invoice-totals__total .smrt-invoice-totals__label,
101
+ .smrt-invoice-totals__row.smrt-invoice-totals__total .smrt-invoice-totals__value {
101
102
  color: var(--smrt-color-on-surface);
102
103
  font: var(--smrt-typography-title-medium-font);
103
104
  }
104
-
105
- .lg .totals-row.total .totals-label,
106
- .lg .totals-row.total .totals-value {
105
+ .smrt-invoice-totals__lg .smrt-invoice-totals__row.smrt-invoice-totals__total .smrt-invoice-totals__label,
106
+ .smrt-invoice-totals__lg .smrt-invoice-totals__row.smrt-invoice-totals__total .smrt-invoice-totals__value {
107
107
  font: var(--smrt-typography-title-large-font);
108
108
  }
109
-
110
- .totals-row.paid {
109
+ .smrt-invoice-totals__row.smrt-invoice-totals__paid {
111
110
  color: var(--smrt-color-tertiary);
112
111
  }
113
-
114
- .totals-row.paid .totals-label {
112
+ .smrt-invoice-totals__row.smrt-invoice-totals__paid .smrt-invoice-totals__label {
115
113
  color: var(--smrt-color-tertiary);
116
114
  }
117
-
118
- .totals-row.balance {
119
- padding-top: var(--smrt-spacing-2, 0.5rem);
115
+ .smrt-invoice-totals__row.smrt-invoice-totals__balance {
120
116
  border-top: var(--smrt-hairline);
121
117
  font-weight: var(--smrt-typography-weight-semibold, 600);
122
118
  }
123
119
  }
120
+
124
121
  </style>