@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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/dist/svelte/components/CustomerDetail.svelte +60 -15
- package/dist/svelte/components/CustomerDirectory.svelte +82 -22
- package/dist/svelte/components/CustomerForm.svelte +74 -18
- package/dist/svelte/components/InvoiceActions.svelte +7 -3
- package/dist/svelte/components/InvoiceAllocationFields.svelte +22 -4
- package/dist/svelte/components/InvoiceCard.svelte +81 -82
- package/dist/svelte/components/InvoiceHeader.svelte +56 -57
- package/dist/svelte/components/InvoiceLineItems.svelte +142 -123
- package/dist/svelte/components/InvoiceRecordScreen.svelte +30 -7
- package/dist/svelte/components/InvoiceReview.svelte +16 -3
- package/dist/svelte/components/InvoiceTotals.svelte +37 -40
- package/dist/svelte/components/MoneyInvoiceEditor.svelte +44 -15
- package/dist/svelte/components/PartyAddressFields.svelte +32 -6
- package/dist/svelte/components/PartyContactFields.svelte +83 -26
- package/dist/svelte/components/PricingVersionDecision.svelte +20 -5
- package/dist/svelte/components/PricingVersionSummary.svelte +20 -5
- package/dist/svelte/components/PurchaseOrderEditor.svelte +42 -9
- package/dist/svelte/components/PurchaseSourceSelector.svelte +13 -2
- package/dist/svelte/components/QuoteEditor.svelte +35 -7
- package/dist/svelte/components/QuoteRevisionComparison.svelte +18 -4
- package/dist/svelte/components/QuoteRevisionHistory.svelte +25 -5
- package/dist/svelte/components/UnbilledItems.svelte +106 -106
- package/dist/svelte/components/VendorDetail.svelte +57 -12
- package/dist/svelte/components/VendorDirectory.svelte +82 -22
- package/dist/svelte/components/VendorForm.svelte +70 -16
- package/dist/svelte/playground/InvoicePreparationPreview.svelte +9 -2
- package/dist/svelte/playground/PartyFormPreview.svelte +1 -1
- package/dist/svelte/playground/PartySelectPreview.svelte +10 -4
- 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-
|
|
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="
|
|
93
|
+
<div class="smrt-invoice-line-items__empty" data-smrt-part="empty"><p>{emptyMessage}</p></div>
|
|
94
94
|
{:else}
|
|
95
|
-
<table class="line-
|
|
96
|
-
<thead><tr><th class="
|
|
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="
|
|
101
|
-
{#if line.category}<span class="
|
|
102
|
-
<span class="
|
|
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="
|
|
109
|
-
<td class="
|
|
110
|
-
<td class="
|
|
111
|
-
<td class="
|
|
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="
|
|
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="
|
|
119
|
+
<div class="smrt-invoice-line-items__empty" data-smrt-part="empty">
|
|
120
120
|
<p>{emptyMessage}</p>
|
|
121
121
|
{#if editable && onadd}
|
|
122
|
-
<Button
|
|
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-
|
|
128
|
+
<table class="smrt-invoice-line-items__table" data-smrt-part="list">
|
|
129
129
|
<thead>
|
|
130
130
|
<tr>
|
|
131
|
-
<th class="
|
|
131
|
+
<th class="smrt-invoice-line-items__cell-description" data-smrt-part="cell">Description</th>
|
|
132
132
|
{#if showSource}
|
|
133
|
-
<th class="
|
|
133
|
+
<th class="smrt-invoice-line-items__cell-source" data-smrt-part="cell">Source</th>
|
|
134
134
|
{/if}
|
|
135
|
-
<th class="
|
|
136
|
-
<th class="
|
|
137
|
-
<th class="
|
|
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="
|
|
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="
|
|
146
|
+
<td class="smrt-invoice-line-items__cell-description" data-smrt-part="cell">
|
|
147
147
|
{#if item.category}
|
|
148
|
-
<span class="
|
|
148
|
+
<span class="smrt-invoice-line-items__category" data-smrt-part="label">{item.category}</span>
|
|
149
149
|
{/if}
|
|
150
|
-
<span class="
|
|
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="
|
|
154
|
-
<span class="
|
|
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="
|
|
160
|
-
<td class="
|
|
161
|
-
<td class="
|
|
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="
|
|
163
|
+
<td class="smrt-invoice-line-items__cell-actions" data-smrt-part="cell">
|
|
164
164
|
<Button
|
|
165
165
|
variant="ghost"
|
|
166
|
-
class="
|
|
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="
|
|
181
|
-
<td colspan={showSource ? 4 : 3} class="
|
|
182
|
-
<td class="
|
|
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
|
|
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.
|
|
204
|
-
.line-
|
|
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
|
-
.
|
|
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
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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-
|
|
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-
|
|
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.
|
|
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 {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.
|
|
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-
|
|
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-
|
|
24
|
-
|
|
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-
|
|
35
|
-
<div class="
|
|
36
|
-
{#if retained.discountMinor !== undefined}<div class="
|
|
37
|
-
{#each retained.taxes ?? [] as tax (tax.id)}<div class="
|
|
38
|
-
{#if retained.holdbackMinor !== undefined}<div class="
|
|
39
|
-
<div class="
|
|
40
|
-
{#if retained.paidMinor !== undefined}<div class="
|
|
41
|
-
{#if retained.payableMinor !== undefined}<div class="
|
|
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.
|
|
48
|
-
.invoice-
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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>
|