@happyvertical/smrt-commerce 0.55.16 → 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 (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 +4 -1
  6. package/dist/svelte/components/CustomerDirectory.svelte +4 -1
  7. package/dist/svelte/components/CustomerForm.svelte +3 -0
  8. package/dist/svelte/components/InvoiceActions.svelte +4 -1
  9. package/dist/svelte/components/InvoiceAllocationFields.svelte +4 -1
  10. package/dist/svelte/components/InvoiceCard.svelte +12 -9
  11. package/dist/svelte/components/InvoiceEditor.svelte +4 -1
  12. package/dist/svelte/components/InvoiceHeader.svelte +25 -22
  13. package/dist/svelte/components/InvoiceLineEditor.svelte +4 -1
  14. package/dist/svelte/components/InvoiceLineItems.svelte +29 -26
  15. package/dist/svelte/components/InvoiceReview.svelte +4 -1
  16. package/dist/svelte/components/InvoiceTotals.svelte +14 -11
  17. package/dist/svelte/components/PartyAddressFields.svelte +3 -0
  18. package/dist/svelte/components/PartyContactFields.svelte +4 -1
  19. package/dist/svelte/components/PricingVersionDecision.svelte +4 -1
  20. package/dist/svelte/components/PricingVersionSummary.svelte +4 -1
  21. package/dist/svelte/components/PurchaseOrderEditor.svelte +4 -1
  22. package/dist/svelte/components/PurchaseOrderHeaderForm.svelte +1 -1
  23. package/dist/svelte/components/PurchaseSourceSelector.svelte +7 -2
  24. package/dist/svelte/components/QuoteEditor.svelte +4 -1
  25. package/dist/svelte/components/QuoteRevisionComparison.svelte +4 -1
  26. package/dist/svelte/components/QuoteRevisionHistory.svelte +4 -1
  27. package/dist/svelte/components/UnbilledItems.svelte +27 -24
  28. package/dist/svelte/components/VendorDetail.svelte +4 -1
  29. package/dist/svelte/components/VendorDirectory.svelte +4 -1
  30. package/dist/svelte/components/VendorForm.svelte +3 -0
  31. package/dist/svelte/playground/InvoicePreparationPreview.svelte +6 -1
  32. package/dist/svelte/playground/PartySelectPreview.svelte +4 -1
  33. package/package.json +9 -9
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-commerce",
5
- "packageVersion": "0.55.16",
5
+ "packageVersion": "0.55.17",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-commerce:ContractCollection": {
8
8
  "name": "contractcollection",
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-commerce",
6
- "packageVersion": "0.55.16",
6
+ "packageVersion": "0.55.17",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "257cdf3e07aaf5bcb7b621e6169b5692d8d5b05fa089969891edfce7409f8351",
11
- "packageJson": "287bfec433d0fb58647280d0a08a0237e76e582eda16f32f5af695cfa1cd4dc5",
10
+ "manifest": "983906acad2c027023edf6bda224632b7eaa770f5767265089308997343a3dca",
11
+ "packageJson": "7b04148b9dfe3698d1e3b5743ef38d10601c4bf8dfc25aa66d6935ee793645e4",
12
12
  "agents": "5a4901577a0f007cf44f04658c4394e1b1fe292f24701d0ff00ccf66095b4217",
13
13
  "moduleDoc:agents/invoice-quantity.md": "bc3b617d4fb8cc87511763b281283107557ba64795e64522193ef967a3715d32",
14
14
  "moduleDoc:agents/payment-allocations.md": "46c0b921f0e40060cd1caec2dcefb01ed6612e31e4bf220a1a0b61e4e2a58212",
@@ -99,7 +99,7 @@ function creditLimit(amountMinor: number): string {
99
99
  }
100
100
  </script>
101
101
 
102
- <section class="party-detail">
102
+ <section class="party-detail" data-smrt-component="CustomerDetail">
103
103
  {#if backHref}<Button href={backHref} variant="ghost">{t(M['commerce.party.back_to'], { plural })}</Button>{/if}
104
104
  <PageHeader title={customer.profile.name} subtitle={customer.profile.description ?? t(M['commerce.customer.details'])}>
105
105
  {#snippet actions()}
@@ -138,6 +138,8 @@ function creditLimit(amountMinor: number): string {
138
138
  </section>
139
139
 
140
140
  <style>
141
+ @layer smrt.reset, smrt.structure, smrt.theme;
142
+ @layer smrt.theme {
141
143
  .party-detail { display: grid; gap: var(--smrt-spacing-5); max-inline-size: 64rem; min-inline-size: 0; overflow-wrap: anywhere; }
142
144
  .summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--smrt-spacing-4); }
143
145
  h2 { margin: 0 0 var(--smrt-spacing-4); font: var(--smrt-typography-title-medium-font); color: var(--smrt-color-on-surface); }
@@ -147,4 +149,5 @@ function creditLimit(amountMinor: number): string {
147
149
  a { color: var(--smrt-color-primary); }
148
150
  .address, .notes { margin: 0; white-space: pre-wrap; }
149
151
  @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); } }
152
+ }
150
153
  </style>
@@ -131,7 +131,7 @@ function customerTypeLabel(value: string | undefined): string {
131
131
  }
132
132
  </script>
133
133
 
134
- <section class="party-directory">
134
+ <section class="party-directory" data-smrt-component="CustomerDirectory">
135
135
  <PageHeader title={plural} subtitle={labels.plural ? t(M['commerce.party.manage_named'], { plural }) : t(M['commerce.customer.manage'])}>
136
136
  {#snippet actions()}
137
137
  {#if canCreate && addHref}<Button href={addHref}>{labels.add ?? (labels.singular ? t(M['commerce.party.add_named'], { singular }) : t(M['commerce.customer.add']))}</Button>{/if}
@@ -198,6 +198,8 @@ function customerTypeLabel(value: string | undefined): string {
198
198
  </section>
199
199
 
200
200
  <style>
201
+ @layer smrt.reset, smrt.structure, smrt.theme;
202
+ @layer smrt.theme {
201
203
  .party-directory { display: grid; gap: var(--smrt-spacing-5); max-inline-size: 64rem; min-inline-size: 0; }
202
204
  :global(.directory-search) { display: grid; grid-template-columns: minmax(12rem, 2fr) minmax(10rem, 1fr) auto; align-items: end; gap: var(--smrt-spacing-3); }
203
205
  :global(.directory-search .form-group) { margin: 0; min-inline-size: 0; }
@@ -211,4 +213,5 @@ function customerTypeLabel(value: string | undefined): string {
211
213
  .meta { margin-block-start: var(--smrt-spacing-2); color: var(--smrt-color-on-surface-variant); }
212
214
  .pagination { display: flex; align-items: center; justify-content: center; gap: var(--smrt-spacing-3); }
213
215
  @media (max-width: 42rem) { :global(.directory-search) { grid-template-columns: minmax(0, 1fr); } :global(.directory-search .button) { inline-size: 100%; } .party-row { align-items: start; } }
216
+ }
214
217
  </style>
@@ -222,6 +222,8 @@ const errorList = $derived(
222
222
  </Form>
223
223
 
224
224
  <style>
225
+ @layer smrt.reset, smrt.structure, smrt.theme;
226
+ @layer smrt.theme {
225
227
  :global(.party-form) { display: grid; gap: var(--smrt-spacing-5); min-inline-size: 0; padding-block-end: var(--smrt-spacing-8); }
226
228
  .native-default-submit { position: absolute; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
227
229
  .form-error { margin: 0; padding: var(--smrt-spacing-4); border-inline-start: 4px solid var(--smrt-color-error); background: var(--smrt-color-error-container); color: var(--smrt-color-on-error-container); border-radius: var(--smrt-radius-small); }
@@ -231,4 +233,5 @@ const errorList = $derived(
231
233
  .field-grid, .address-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--smrt-spacing-4); }
232
234
  .address-pair { gap: var(--smrt-spacing-4); }
233
235
  @media (max-width: 42rem) { .field-grid, .address-pair { grid-template-columns: minmax(0, 1fr); } }
236
+ }
234
237
  </style>
@@ -55,7 +55,7 @@ const canMarkPaid = $derived(
55
55
  const canDelete = $derived(status === 'draft');
56
56
  </script>
57
57
 
58
- <div class="invoice-actions">
58
+ <div class="invoice-actions" data-smrt-component="InvoiceActions">
59
59
  {#if canSend && onsend}
60
60
  <Button variant="primary" {size} onclick={onsend} disabled={loading}>
61
61
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
@@ -114,9 +114,12 @@ const canDelete = $derived(status === 'draft');
114
114
  </div>
115
115
 
116
116
  <style>
117
+ @layer smrt.reset, smrt.structure, smrt.theme;
118
+ @layer smrt.theme {
117
119
  .invoice-actions {
118
120
  display: flex;
119
121
  gap: var(--smrt-spacing-2, 0.5rem);
120
122
  flex-wrap: wrap;
121
123
  }
124
+ }
122
125
  </style>
@@ -33,7 +33,7 @@ const names = $derived({
33
33
  ...fields,
34
34
  });
35
35
  </script>
36
- <div class="allocations">
36
+ <div class="allocations" data-smrt-component="InvoiceAllocationFields">
37
37
  {#if !mayReadSources}<p>{t(M['commerce.preparation.restricted'])}</p>
38
38
  {:else if sources.length === 0}<p>{t(M['commerce.preparation.empty'])}</p>{/if}
39
39
  {#if allocations.length === 0}<p>{t(M['commerce.preparation.no_rows'])}</p>{/if}
@@ -66,7 +66,10 @@ const names = $derived({
66
66
  {#if canEdit}<Button type="submit" name={names.intent} value={addIntent} formnovalidate disabled={pending} variant="secondary">{t(M['commerce.preparation.add'])}</Button>{/if}
67
67
  </div>
68
68
  <style>
69
+ @layer smrt.reset, smrt.structure, smrt.theme;
70
+ @layer smrt.theme {
69
71
  .allocations { display: grid; gap: var(--smrt-spacing-4); min-width: 0; }
70
72
  fieldset { min-width: 0; margin: 0; padding: var(--smrt-spacing-4); border: 1px solid var(--smrt-color-outline); border-radius: var(--smrt-radius-small); }
71
73
  p { margin: 0; }
74
+ }
72
75
  </style>
@@ -107,7 +107,7 @@ const isOverdue = $derived.by(() => {
107
107
  </script>
108
108
 
109
109
  {#if href}
110
- <a class="invoice-card" {href} use:ripple>
110
+ <a class="invoice-card" {href} use:ripple data-smrt-component="InvoiceCard">
111
111
  <div class="card-header">
112
112
  <span class="invoice-number">{invoice.invoiceNumber}</span>
113
113
  <span class="status-badge {isOverdue ? 'status-error' : statusClass}">
@@ -133,7 +133,7 @@ const isOverdue = $derived.by(() => {
133
133
  {#if retained}{@render details?.(retained)}{/if}
134
134
  </a>
135
135
  {:else if retained}
136
- <article class="invoice-card">
136
+ <article class="invoice-card" data-smrt-component="InvoiceCard">
137
137
  <div class="card-header">
138
138
  <span class="invoice-number">{invoice.invoiceNumber}</span>
139
139
  <span class="status-badge {statusClass}">{retained.statusLabel}</span>
@@ -150,7 +150,7 @@ const isOverdue = $derived.by(() => {
150
150
  </article>
151
151
  {:else}
152
152
  <!-- raw-primitive-allow: large pressable invoice card wrapping rich header/body/footer content with use:ripple, a structural selection control no Button primitive should own (mirrors the href anchor branch) -->
153
- <button type="button" class="invoice-card" onclick={onclick} use:ripple>
153
+ <button type="button" class="invoice-card" onclick={onclick} use:ripple data-smrt-component="InvoiceCard">
154
154
  <div class="card-header">
155
155
  <span class="invoice-number">{invoice.invoiceNumber}</span>
156
156
  <span class="status-badge {isOverdue ? 'status-error' : statusClass}">
@@ -177,13 +177,15 @@ const isOverdue = $derived.by(() => {
177
177
  {/if}
178
178
 
179
179
  <style>
180
+ @layer smrt.reset, smrt.structure, smrt.theme;
181
+ @layer smrt.theme {
180
182
  .invoice-card {
181
183
  display: flex;
182
184
  flex-direction: column;
183
- gap: var(--smrt-spacing-3, 12px);
184
- padding: var(--smrt-spacing-4, 16px);
185
+ gap: var(--smrt-spacing-3);
186
+ padding: var(--smrt-spacing-4);
185
187
  background-color: var(--smrt-color-surface-container-low);
186
- border-radius: var(--smrt-radius-large, 12px);
188
+ border-radius: var(--smrt-radius-large);
187
189
  text-decoration: none;
188
190
  color: var(--smrt-color-on-surface);
189
191
  cursor: pointer;
@@ -223,12 +225,12 @@ const isOverdue = $derived.by(() => {
223
225
 
224
226
  .status-badge {
225
227
  display: inline-flex;
226
- padding: 0 var(--smrt-spacing-2, 8px);
228
+ padding: 0 var(--smrt-spacing-2);
227
229
  height: 20px;
228
230
  align-items: center;
229
231
  font: var(--smrt-typography-label-small-font);
230
232
  font-weight: var(--smrt-typography-weight-semibold, 600);
231
- border-radius: var(--smrt-radius-full, 10px);
233
+ border-radius: var(--smrt-radius-full);
232
234
  text-transform: uppercase;
233
235
  letter-spacing: 0.5px;
234
236
  }
@@ -254,7 +256,7 @@ const isOverdue = $derived.by(() => {
254
256
  .card-body {
255
257
  display: flex;
256
258
  flex-direction: column;
257
- gap: var(--smrt-spacing-1, 4px);
259
+ gap: var(--smrt-spacing-1);
258
260
  }
259
261
 
260
262
  .customer-name {
@@ -282,4 +284,5 @@ const isOverdue = $derived.by(() => {
282
284
  color: var(--smrt-color-error);
283
285
  font-weight: var(--smrt-typography-weight-semibold, 600);
284
286
  }
287
+ }
285
288
  </style>
@@ -86,7 +86,7 @@ function lineErrors(key: string) {
86
86
  ) as Partial<Record<keyof InvoiceLineFieldNames, string>>;
87
87
  }
88
88
  </script>
89
- <section class="invoice-editor" aria-labelledby={`${formId}-title`}>
89
+ <section class="invoice-editor" aria-labelledby={`${formId}-title`} data-smrt-component="InvoiceEditor">
90
90
  <h2 id={`${formId}-title`}>{title ?? t(M['commerce.preparation.title'])}</h2>
91
91
  {#if review}<InvoiceReview {review} />{/if}
92
92
  {#if !canEdit}<p>{t(M['commerce.preparation.readonly'])}</p>{/if}
@@ -127,9 +127,12 @@ function lineErrors(key: string) {
127
127
  </Form>
128
128
  </section>
129
129
  <style>
130
+ @layer smrt.reset, smrt.structure, smrt.theme;
131
+ @layer smrt.theme {
130
132
  .invoice-editor, .fields, .header-fields { display: grid; grid-template-columns: minmax(0,1fr); gap: var(--smrt-spacing-4); min-width: 0; }
131
133
  .invoice-editor { max-width: 48rem; overflow-wrap: anywhere; }
132
134
  .header-fields { margin: 0; padding: 0; border: 0; }
133
135
  h2, p, dl, dd { margin: 0; }
134
136
  .summary dl { display: flex; flex-wrap: wrap; gap: var(--smrt-spacing-4); }
137
+ }
135
138
  </style>
@@ -78,33 +78,33 @@ const statusConfig: Record<
78
78
  > = {
79
79
  draft: {
80
80
  label: 'Draft',
81
- bg: 'var(--smrt-color-surface-variant, #e7e0ec)',
82
- text: 'var(--smrt-color-on-surface-variant, #49454f)',
81
+ bg: 'var(--smrt-color-surface-variant)',
82
+ text: 'var(--smrt-color-on-surface-variant)',
83
83
  },
84
84
  sent: {
85
85
  label: 'Sent',
86
- bg: 'var(--smrt-color-primary-container, #d3e3fd)',
87
- text: 'var(--smrt-color-on-primary-container, #041e49)',
86
+ bg: 'var(--smrt-color-primary-container)',
87
+ text: 'var(--smrt-color-on-primary-container)',
88
88
  },
89
89
  viewed: {
90
90
  label: 'Viewed',
91
- bg: 'var(--smrt-color-secondary-container, #e3e0f9)',
92
- text: 'var(--smrt-color-on-secondary-container, #1d192b)',
91
+ bg: 'var(--smrt-color-secondary-container)',
92
+ text: 'var(--smrt-color-on-secondary-container)',
93
93
  },
94
94
  paid: {
95
95
  label: 'Paid',
96
- bg: 'var(--smrt-color-tertiary-container, #ddf5e5)',
97
- text: 'var(--smrt-color-on-tertiary-container, #0c1f15)',
96
+ bg: 'var(--smrt-color-tertiary-container)',
97
+ text: 'var(--smrt-color-on-tertiary-container)',
98
98
  },
99
99
  overdue: {
100
100
  label: 'Overdue',
101
- bg: 'var(--smrt-color-error-container, #ffdad6)',
102
- text: 'var(--smrt-color-on-error-container, #410002)',
101
+ bg: 'var(--smrt-color-error-container)',
102
+ text: 'var(--smrt-color-on-error-container)',
103
103
  },
104
104
  cancelled: {
105
105
  label: 'Cancelled',
106
- bg: 'var(--smrt-color-error-container, #ffdad6)',
107
- text: 'var(--smrt-color-error, #ba1a1a)',
106
+ bg: 'var(--smrt-color-error-container)',
107
+ text: 'var(--smrt-color-error)',
108
108
  },
109
109
  };
110
110
 
@@ -124,7 +124,7 @@ const isOverdue = $derived.by(() => {
124
124
  });
125
125
  </script>
126
126
 
127
- <div class="invoice-header">
127
+ <div class="invoice-header" data-smrt-component="InvoiceHeader">
128
128
  <div class="header-main">
129
129
  <div class="invoice-title">
130
130
  <h2 class="invoice-number">{invoiceNumber}</h2>
@@ -184,14 +184,16 @@ const isOverdue = $derived.by(() => {
184
184
  </div>
185
185
 
186
186
  <style>
187
+ @layer smrt.reset, smrt.structure, smrt.theme;
188
+ @layer smrt.theme {
187
189
  .invoice-header {
188
190
  display: flex;
189
191
  justify-content: space-between;
190
192
  align-items: flex-start;
191
193
  gap: var(--smrt-spacing-6, 1.5rem);
192
194
  padding: var(--smrt-spacing-6, 1.5rem);
193
- background: var(--smrt-color-surface, #ffffff);
194
- border: 1px solid var(--smrt-color-outline-variant, #c4c6d0);
195
+ background: var(--smrt-color-surface);
196
+ border: 1px solid var(--smrt-color-outline-variant);
195
197
  border-radius: var(--smrt-radius-medium, 0.5rem);
196
198
  flex-wrap: wrap;
197
199
  }
@@ -211,7 +213,7 @@ const isOverdue = $derived.by(() => {
211
213
  .invoice-number {
212
214
  font: var(--smrt-typography-title-large-font);
213
215
  font-weight: var(--smrt-typography-weight-semibold, 600);
214
- color: var(--smrt-color-on-surface, #1c1b1f);
216
+ color: var(--smrt-color-on-surface);
215
217
  margin: 0;
216
218
  }
217
219
 
@@ -221,7 +223,7 @@ const isOverdue = $derived.by(() => {
221
223
  padding: var(--smrt-spacing-1, 0.25rem) var(--smrt-spacing-3, 0.75rem);
222
224
  font: var(--smrt-typography-label-small-font);
223
225
  font-weight: var(--smrt-typography-weight-medium, 500);
224
- border-radius: var(--smrt-radius-full, 9999px);
226
+ border-radius: var(--smrt-radius-full);
225
227
  text-transform: capitalize;
226
228
  }
227
229
 
@@ -236,7 +238,7 @@ const isOverdue = $derived.by(() => {
236
238
  align-items: center;
237
239
  gap: var(--smrt-spacing-1_5, 0.375rem);
238
240
  font: var(--smrt-typography-body-medium-font);
239
- color: var(--smrt-color-on-surface-variant, #49454f);
241
+ color: var(--smrt-color-on-surface-variant);
240
242
  }
241
243
 
242
244
  .context-item svg {
@@ -257,7 +259,7 @@ const isOverdue = $derived.by(() => {
257
259
 
258
260
  .meta-label {
259
261
  font: var(--smrt-typography-label-small-font);
260
- color: var(--smrt-color-on-surface-variant, #49454f);
262
+ color: var(--smrt-color-on-surface-variant);
261
263
  text-transform: uppercase;
262
264
  letter-spacing: 0.025em;
263
265
  }
@@ -265,14 +267,15 @@ const isOverdue = $derived.by(() => {
265
267
  .meta-value {
266
268
  font: var(--smrt-typography-body-medium-font);
267
269
  font-weight: var(--smrt-typography-weight-medium, 500);
268
- color: var(--smrt-color-on-surface, #1c1b1f);
270
+ color: var(--smrt-color-on-surface);
269
271
  }
270
272
 
271
273
  .meta-item.overdue .meta-value {
272
- color: var(--smrt-color-error, #ba1a1a);
274
+ color: var(--smrt-color-error);
273
275
  }
274
276
 
275
277
  .meta-item.paid .meta-value {
276
- color: var(--smrt-color-tertiary, #006c4c);
278
+ color: var(--smrt-color-tertiary);
277
279
  }
280
+ }
278
281
  </style>
@@ -47,7 +47,7 @@ function refresh(event: Event) {
47
47
  onchange?.(draft);
48
48
  }
49
49
  </script>
50
- <fieldset oninput={refresh} onchange={refresh} disabled={!canEdit} class="invoice-line">
50
+ <fieldset oninput={refresh} onchange={refresh} disabled={!canEdit} class="invoice-line" data-smrt-component="InvoiceLineEditor">
51
51
  <legend>{t(M['commerce.invoice.line'], { number })}</legend>
52
52
  <Input type="hidden" name={names.key} value={draft.key} interaction={false} />
53
53
  {#each ['description', 'sku', 'quantity', 'unitPrice'] as field}
@@ -82,8 +82,11 @@ function refresh(event: Event) {
82
82
  {#if canEdit}<Button type="submit" name={intentField} value={`${removePrefix}${draft.key}`} formnovalidate disabled={pending} variant="secondary">{t(M['commerce.invoice.remove'])}</Button>{/if}
83
83
  </fieldset>
84
84
  <style>
85
+ @layer smrt.reset, smrt.structure, smrt.theme;
86
+ @layer smrt.theme {
85
87
  .invoice-line { display: grid; grid-template-columns: minmax(0,1fr); gap: var(--smrt-spacing-3); min-width: 0; margin: 0; padding: var(--smrt-spacing-4); border: 1px solid var(--smrt-color-outline); border-radius: var(--smrt-radius-small); }
86
88
  legend { padding-inline: var(--smrt-spacing-2); }
87
89
  .totals { display: flex; flex-wrap: wrap; gap: var(--smrt-spacing-4); }
88
90
  dd { margin: 0; } p, dl { margin: 0; }
91
+ }
89
92
  </style>
@@ -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>