@happyvertical/smrt-commerce 0.60.16 → 0.60.18

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
@@ -170,7 +170,7 @@ function changeMode(event: Event) {
170
170
  }
171
171
  </script>
172
172
 
173
- <section class="invoice-editor money-editor" aria-label={t(M['commerce.invoice_money.aria_label'])} data-smrt-component="MoneyInvoiceEditor" data-money-model="v2">
173
+ <section class="smrt-money-invoice-editor__root" aria-label={t(M['commerce.invoice_money.aria_label'])} data-smrt-component="MoneyInvoiceEditor" data-money-model="v2">
174
174
  {#if frozen}
175
175
  <p role="status">Frozen{money.status ? ` · ${money.status}` : ''}</p>
176
176
  {#if money.kind !== 'credit_note'}
@@ -183,7 +183,7 @@ function changeMode(event: Event) {
183
183
  {/if}
184
184
  {/if}
185
185
  {#if money.sellerTaxRegistrations?.length || money.partyTaxId}
186
- <p class="tax-registrations">
186
+ <p class="smrt-money-invoice-editor__tax-registrations" data-smrt-part="meta">
187
187
  {#each money.sellerTaxRegistrations ?? [] as registration}{registration}{#if money.partyTaxId || registration !== money.sellerTaxRegistrations?.at(-1)} · {/if}{/each}
188
188
  {#if money.partyTaxId}{money.partyTaxId}{/if}
189
189
  </p>
@@ -202,7 +202,7 @@ function changeMode(event: Event) {
202
202
  <Input type="hidden" name={names.roundingScope} value={money.draft.roundingScope} interaction={false} />
203
203
  {#if money.customerTaxExempt && lineAmountType === 'inclusive'}<p>{t(M['commerce.invoice_money.exempt_inclusive'])}</p>{/if}
204
204
  {#each lines as line, index (line.id)}
205
- <fieldset class="money-line">
205
+ <fieldset class="smrt-money-invoice-editor__line" data-smrt-part="group">
206
206
  <legend>{t(M['commerce.invoice_money.line'], { number: index + 1 })}</legend>
207
207
  <Input type="hidden" name={names.lineId} value={line.id} interaction={false} />
208
208
  <label>Description <Input name={names.lineDescription} value={line.description} oninput={(event) => patchLine(index, { description: (event.currentTarget as HTMLInputElement).value })} /></label>
@@ -230,19 +230,19 @@ function changeMode(event: Event) {
230
230
  {#if !totals}
231
231
  <p role="alert">{calculation?.valid || frozen ? 'Stored totals are required for a frozen document.' : calculation?.message}</p>
232
232
  {:else}
233
- <dl class="summary" aria-live="polite">
233
+ <dl class="smrt-money-invoice-editor__summary" data-smrt-part="summary" aria-live="polite">
234
234
  {#if totals.lineAmountType !== 'inclusive' || totals.taxMinor === 0}
235
235
  <div><dt>Subtotal</dt><dd><CurrencyDisplay amount={totals.subtotalMinor} currency={money.draft.currency} unit="cents" /></dd></div>
236
236
  {/if}
237
- {#if totals.discountTotalMinor !== 0}<div class="muted"><dt>{t(M['commerce.invoice_money.includes_discounts'])} <CurrencyDisplay amount={Math.abs(totals.discountTotalMinor)} currency={money.draft.currency} unit="cents" /></dt></div>{/if}
237
+ {#if totals.discountTotalMinor !== 0}<div class="smrt-money-invoice-editor__muted" data-smrt-part="row"><dt>{t(M['commerce.invoice_money.includes_discounts'])} <CurrencyDisplay amount={Math.abs(totals.discountTotalMinor)} currency={money.draft.currency} unit="cents" /></dt></div>{/if}
238
238
  {#each groupedTaxes(totals.taxes).filter((tax) => tax.taxMinor !== 0) as tax (tax.id)}
239
- <div class:muted={totals.lineAmountType === 'inclusive'}>
239
+ <div class:smrt-money-invoice-editor__muted={totals.lineAmountType === 'inclusive'} data-smrt-part="meta">
240
240
  <dt>{totals.lineAmountType === 'inclusive' ? `Includes ${tax.name} ${tax.percent}% of` : `${tax.name} ${tax.percent}% on`} <CurrencyDisplay amount={totals.lineAmountType === 'inclusive' ? tax.taxMinor : tax.taxableMinor} currency={money.draft.currency} unit="cents" /></dt>
241
241
  {#if totals.lineAmountType !== 'inclusive'}<dd><CurrencyDisplay amount={tax.taxMinor} currency={money.draft.currency} unit="cents" /></dd>{/if}
242
242
  </div>
243
243
  {/each}
244
- {#if totals.roundingScope === 'document'}<div class="muted"><dt>{t(M['commerce.invoice_money.rounded_document'])}</dt></div>{/if}
245
- <div class="total"><dt>Total</dt><dd><CurrencyDisplay amount={totals.totalMinor} currency={money.draft.currency} unit="cents" /></dd></div>
244
+ {#if totals.roundingScope === 'document'}<div class="smrt-money-invoice-editor__muted" data-smrt-part="row"><dt>{t(M['commerce.invoice_money.rounded_document'])}</dt></div>{/if}
245
+ <div class="smrt-money-invoice-editor__total" data-smrt-part="row"><dt>Total</dt><dd><CurrencyDisplay amount={totals.totalMinor} currency={money.draft.currency} unit="cents" /></dd></div>
246
246
  {#if totals.lineAmountType === 'inclusive' && totals.taxMinor !== 0 && money.showNetSubtotal}<div><dt>Subtotal (excl. tax)</dt><dd><CurrencyDisplay amount={totals.subtotalMinor} currency={money.draft.currency} unit="cents" /></dd></div>{/if}
247
247
  </dl>
248
248
  {/if}
@@ -250,13 +250,42 @@ function changeMode(event: Event) {
250
250
 
251
251
  <style>
252
252
  @layer smrt.reset, smrt.structure, smrt.theme;
253
+ @layer smrt.structure {
254
+ .smrt-money-invoice-editor__root, .smrt-money-invoice-editor__root :global([data-smrt-component="Form"]), fieldset, .smrt-money-invoice-editor__line {
255
+ display: grid;
256
+ gap: var(--smrt-spacing-3);
257
+ min-width: 0;
258
+ }
259
+ .smrt-money-invoice-editor__root {
260
+ max-width: 48rem;
261
+ overflow-wrap: anywhere;
262
+ }
263
+ .smrt-money-invoice-editor__summary {
264
+ display: grid;
265
+ gap: var(--smrt-spacing-2);
266
+ }
267
+ .smrt-money-invoice-editor__summary > div {
268
+ display: flex;
269
+ justify-content: space-between;
270
+ gap: var(--smrt-spacing-4);
271
+ }
272
+ .smrt-money-invoice-editor__summary .smrt-money-invoice-editor__total {
273
+ padding-top: var(--smrt-spacing-2);
274
+ }
275
+ dd {
276
+ margin: 0;
277
+ }
278
+ }
279
+
253
280
  @layer smrt.theme {
254
- .money-editor, .money-editor :global(.form), fieldset, .money-line { display: grid; gap: var(--smrt-spacing-3); min-width: 0; }
255
- .money-editor { max-width: 48rem; overflow-wrap: anywhere; }
256
- .summary { display: grid; gap: var(--smrt-spacing-2); }
257
- .summary > div { display: flex; justify-content: space-between; gap: var(--smrt-spacing-4); }
258
- .summary .muted { color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-body-small-size); }
259
- .summary .total { border-top: var(--smrt-hairline-strong); padding-top: var(--smrt-spacing-2); font-weight: var(--smrt-typography-weight-semibold); }
260
- dd { margin: 0; }
281
+ .smrt-money-invoice-editor__summary .smrt-money-invoice-editor__muted {
282
+ color: var(--smrt-color-on-surface-variant);
283
+ font-size: var(--smrt-typography-body-small-size);
284
+ }
285
+ .smrt-money-invoice-editor__summary .smrt-money-invoice-editor__total {
286
+ border-top: var(--smrt-hairline-strong);
287
+ font-weight: var(--smrt-typography-weight-semibold);
288
+ }
261
289
  }
290
+
262
291
  </style>
@@ -63,7 +63,7 @@ $effect(() => {
63
63
  });
64
64
  </script>
65
65
 
66
- <fieldset class="address-fields">
66
+ <fieldset class="smrt-party-address-fields__root" data-smrt-component="PartyAddressFields">
67
67
  <legend>{heading}</legend>
68
68
  <FormGroup label={t(M['commerce.party.street_address'])} error={errors.street1}>
69
69
  <Input name={names.street1} value={value.street1 ?? ''} maxlength={160} readonly={readOnly} />
@@ -71,7 +71,7 @@ $effect(() => {
71
71
  <FormGroup label={t(M['commerce.party.address_line_2'])} error={errors.street2}>
72
72
  <Input name={names.street2} value={value.street2 ?? ''} maxlength={160} readonly={readOnly} />
73
73
  </FormGroup>
74
- <div class="address-grid">
74
+ <div class="smrt-party-address-fields__grid" data-smrt-part="group">
75
75
  <FormGroup label={t(M['commerce.party.city'])} error={errors.city}>
76
76
  <Input name={names.city} value={value.city ?? ''} maxlength={100} readonly={readOnly} />
77
77
  </FormGroup>
@@ -89,10 +89,36 @@ $effect(() => {
89
89
 
90
90
  <style>
91
91
  @layer smrt.reset, smrt.structure, smrt.theme;
92
+ @layer smrt.structure {
93
+ .smrt-party-address-fields__root {
94
+ min-inline-size: 0;
95
+ margin: 0;
96
+ padding: var(--smrt-spacing-4);
97
+ }
98
+ legend {
99
+ padding-inline: var(--smrt-spacing-2);
100
+ }
101
+ .smrt-party-address-fields__grid {
102
+ display: grid;
103
+ grid-template-columns: repeat(2, minmax(0, 1fr));
104
+ gap: 0 var(--smrt-spacing-4);
105
+ }
106
+ @media (max-width: 30rem) {
107
+ .smrt-party-address-fields__grid {
108
+ grid-template-columns: minmax(0, 1fr);
109
+ }
110
+ }
111
+ }
112
+
92
113
  @layer smrt.theme {
93
- .address-fields { min-inline-size: 0; margin: 0; padding: var(--smrt-spacing-4); border: var(--smrt-hairline); border-radius: var(--smrt-radius-medium); }
94
- legend { padding-inline: var(--smrt-spacing-2); font: var(--smrt-typography-title-medium-font); color: var(--smrt-color-on-surface); }
95
- .address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--smrt-spacing-4); }
96
- @media (max-width: 30rem) { .address-grid { grid-template-columns: minmax(0, 1fr); } }
114
+ .smrt-party-address-fields__root {
115
+ border: var(--smrt-hairline);
116
+ border-radius: var(--smrt-radius-medium);
117
+ }
118
+ legend {
119
+ font: var(--smrt-typography-title-medium-font);
120
+ color: var(--smrt-color-on-surface);
121
+ }
97
122
  }
123
+
98
124
  </style>
@@ -65,12 +65,12 @@ const text = $derived({
65
65
  });
66
66
  </script>
67
67
 
68
- <section class="contacts" aria-labelledby={headingId} data-smrt-component="PartyContactFields">
68
+ <section class="smrt-party-contact-fields__root" aria-labelledby={headingId} data-smrt-component="PartyContactFields">
69
69
  {#if !readOnly}
70
70
  <!-- Presence marker: the server only treats zero posted rows as "remove all" when this block rendered. -->
71
71
  <Input interaction={false} type="hidden" name={names.contactCount} value={String(contacts.length)} />
72
72
  {/if}
73
- <div class="contacts-heading">
73
+ <div class="smrt-party-contact-fields__heading" data-smrt-part="header">
74
74
  <h2 id={headingId}>{text.heading}</h2>
75
75
  {#if !readOnly && canAdd}
76
76
  <Button
@@ -84,23 +84,23 @@ const text = $derived({
84
84
  </div>
85
85
 
86
86
  {#if contacts.length === 0}
87
- <p class="empty">{text.empty}</p>
87
+ <p class="smrt-party-contact-fields__empty" data-smrt-part="empty">{text.empty}</p>
88
88
  {:else}
89
- <div class="contact-list">
89
+ <div class="smrt-party-contact-fields__list" data-smrt-part="list">
90
90
  {#each contacts as contact, index (`${contact.id ?? 'new'}-${index}`)}
91
91
  {#if readOnly}
92
- <article class="contact-card">
92
+ <article class="smrt-party-contact-fields__card" data-smrt-part="item">
93
93
  <h3>{contact.name || `${text.contact} ${index + 1}`}</h3>
94
94
  {#if contact.label}<p>{contact.label}</p>{/if}
95
95
  {#if contact.email}<p><a href={`mailto:${contact.email}`}>{contact.email}</a></p>{/if}
96
96
  {#if contact.phone}<p><a href={`tel:${contact.phone}`}>{contact.phone}</a></p>{/if}
97
- {#if contact.address}<p class="address">{contact.address}</p>{/if}
97
+ {#if contact.address}<p class="smrt-party-contact-fields__address" data-smrt-part="body">{contact.address}</p>{/if}
98
98
  </article>
99
99
  {:else}
100
- <fieldset class="contact-card">
100
+ <fieldset class="smrt-party-contact-fields__card" data-smrt-part="item">
101
101
  <legend>{text.contact} {index + 1}</legend>
102
102
  <Input interaction={false} type="hidden" name={names.contactId} value={contact.id ?? ''} />
103
- <div class="field-grid">
103
+ <div class="smrt-party-contact-fields__field-grid" data-smrt-part="group">
104
104
  <FormGroup label={text.name} error={errors[index]?.name}>
105
105
  <Input name={names.contactName} value={contact.name ?? ''} maxlength={160} />
106
106
  </FormGroup>
@@ -118,7 +118,7 @@ const text = $derived({
118
118
  <Textarea name={names.contactAddress} value={contact.address ?? ''} rows={3} maxlength={500} />
119
119
  </FormGroup>
120
120
  {#if canRemove}
121
- <div class="contact-actions">
121
+ <div class="smrt-party-contact-fields__actions" data-smrt-part="actions">
122
122
  <Button
123
123
  type="submit"
124
124
  variant="ghost"
@@ -137,24 +137,81 @@ const text = $derived({
137
137
 
138
138
  <style>
139
139
  @layer smrt.reset, smrt.structure, smrt.theme;
140
- @layer smrt.theme {
141
- .contacts { display: grid; gap: var(--smrt-spacing-4); min-inline-size: 0; }
142
- .contacts-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--smrt-spacing-3); flex-wrap: wrap; }
143
- h2, h3, p { margin: 0; }
144
- h2 { font: var(--smrt-typography-title-large-font); color: var(--smrt-color-on-surface); }
145
- h3, legend { font: var(--smrt-typography-title-medium-font); color: var(--smrt-color-on-surface); }
146
- .contact-list { display: grid; gap: var(--smrt-spacing-4); }
147
- .contact-card { min-inline-size: 0; margin: 0; padding: var(--smrt-spacing-4); border: var(--smrt-hairline); border-radius: var(--smrt-radius-medium); background: var(--smrt-color-surface-container-low); overflow-wrap: anywhere; }
148
- article.contact-card { display: grid; gap: var(--smrt-spacing-2); }
149
- .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--smrt-spacing-4); }
150
- .field-grid :global(.form-group) { min-inline-size: 0; }
151
- .contact-actions { display: flex; justify-content: flex-end; }
152
- .empty { color: var(--smrt-color-on-surface-variant); }
153
- .address { white-space: pre-wrap; }
154
- a { color: var(--smrt-color-primary); }
140
+ @layer smrt.structure {
141
+ .smrt-party-contact-fields__root {
142
+ display: grid;
143
+ gap: var(--smrt-spacing-4);
144
+ min-inline-size: 0;
145
+ }
146
+ .smrt-party-contact-fields__heading {
147
+ display: flex;
148
+ align-items: center;
149
+ justify-content: space-between;
150
+ gap: var(--smrt-spacing-3);
151
+ flex-wrap: wrap;
152
+ }
153
+ h2, h3, p {
154
+ margin: 0;
155
+ }
156
+ .smrt-party-contact-fields__list {
157
+ display: grid;
158
+ gap: var(--smrt-spacing-4);
159
+ }
160
+ .smrt-party-contact-fields__card {
161
+ min-inline-size: 0;
162
+ margin: 0;
163
+ padding: var(--smrt-spacing-4);
164
+ overflow-wrap: anywhere;
165
+ }
166
+ article.smrt-party-contact-fields__card {
167
+ display: grid;
168
+ gap: var(--smrt-spacing-2);
169
+ }
170
+ .smrt-party-contact-fields__field-grid {
171
+ display: grid;
172
+ grid-template-columns: repeat(2, minmax(0, 1fr));
173
+ gap: 0 var(--smrt-spacing-4);
174
+ }
175
+ .smrt-party-contact-fields__field-grid :global([data-smrt-component="FormGroup"]) {
176
+ min-inline-size: 0;
177
+ }
178
+ .smrt-party-contact-fields__actions {
179
+ display: flex;
180
+ justify-content: flex-end;
181
+ }
182
+ .smrt-party-contact-fields__address {
183
+ white-space: pre-wrap;
184
+ }
155
185
  @media (max-width: 30rem) {
156
- .field-grid { grid-template-columns: minmax(0, 1fr); }
157
- .contact-card { padding: var(--smrt-spacing-3); }
186
+ .smrt-party-contact-fields__field-grid {
187
+ grid-template-columns: minmax(0, 1fr);
188
+ }
189
+ .smrt-party-contact-fields__card {
190
+ padding: var(--smrt-spacing-3);
191
+ }
192
+ }
193
+ }
194
+
195
+ @layer smrt.theme {
196
+ h2 {
197
+ font: var(--smrt-typography-title-large-font);
198
+ color: var(--smrt-color-on-surface);
199
+ }
200
+ h3, legend {
201
+ font: var(--smrt-typography-title-medium-font);
202
+ color: var(--smrt-color-on-surface);
203
+ }
204
+ .smrt-party-contact-fields__card {
205
+ border: var(--smrt-hairline);
206
+ border-radius: var(--smrt-radius-medium);
207
+ background: var(--smrt-color-surface-container-low);
208
+ }
209
+ .smrt-party-contact-fields__empty {
210
+ color: var(--smrt-color-on-surface-variant);
211
+ }
212
+ a {
213
+ color: var(--smrt-color-primary);
158
214
  }
159
215
  }
216
+
160
217
  </style>
@@ -59,7 +59,7 @@ const { t } = useI18n();
59
59
  const id = $props.id();
60
60
  </script>
61
61
 
62
- <section class="pricing-decision" data-smrt-component="PricingVersionDecision">
62
+ <section class="smrt-pricing-version-decision__root" data-smrt-component="PricingVersionDecision">
63
63
  <PricingVersionSummary {version} />
64
64
  {#if error}<p role="alert">{error}</p>{/if}
65
65
  {#if readOnly}
@@ -74,7 +74,7 @@ const id = $props.id();
74
74
  <Textarea id={`${id}-reason`} name={reasonName} value={reason} required={reasonRequired} readonly={busy} />
75
75
  </FormGroup>
76
76
  {#if children}{@render children()}{/if}
77
- <div class="decisions">{#each actions as decision}
77
+ <div class="smrt-pricing-version-decision__actions" data-smrt-part="actions">{#each actions as decision}
78
78
  <Button type="submit" name={decision.name} value={decision.value} formaction={decision.formAction} disabled={busy || decision.disabled}>{decision.label}</Button>
79
79
  {/each}</div>
80
80
  </Form>
@@ -83,9 +83,24 @@ const id = $props.id();
83
83
 
84
84
  <style>
85
85
  @layer smrt.reset, smrt.structure, smrt.theme;
86
+ @layer smrt.structure {
87
+ .smrt-pricing-version-decision__root {
88
+ min-width: 0;
89
+ overflow-wrap: anywhere;
90
+ }
91
+ .smrt-pricing-version-decision__actions {
92
+ display: flex;
93
+ flex-wrap: wrap;
94
+ gap: var(--smrt-spacing-3);
95
+ margin-top: var(--smrt-spacing-3);
96
+ }
97
+ .smrt-pricing-version-decision__actions :global(button) {
98
+ max-width: 100%;
99
+ white-space: normal;
100
+ }
101
+ }
102
+
86
103
  @layer smrt.theme {
87
- .pricing-decision { min-width: 0; overflow-wrap: anywhere; }
88
- .decisions { display: flex; flex-wrap: wrap; gap: var(--smrt-spacing-3); margin-top: var(--smrt-spacing-3); }
89
- .decisions :global(button) { max-width: 100%; white-space: normal; }
90
104
  }
105
+
91
106
  </style>
@@ -23,7 +23,7 @@ function amount(value: number | null): string {
23
23
  }
24
24
  </script>
25
25
 
26
- <section class="pricing-summary" aria-label={version.label} data-smrt-component="PricingVersionSummary">
26
+ <section class="smrt-pricing-version-summary__root" aria-label={version.label} data-smrt-component="PricingVersionSummary">
27
27
  <h3>{version.label}</h3>
28
28
  <p>{version.counterparty} · {version.status}</p>
29
29
  <p><strong>{t(M['commerce.pricing.total'])}: {amount(version.total.amountMinor)} {version.total.currency}</strong></p>
@@ -40,10 +40,25 @@ function amount(value: number | null): string {
40
40
 
41
41
  <style>
42
42
  @layer smrt.reset, smrt.structure, smrt.theme;
43
+ @layer smrt.structure {
44
+ .smrt-pricing-version-summary__root {
45
+ min-width: 0;
46
+ overflow-wrap: anywhere;
47
+ }
48
+ .smrt-pricing-version-summary__root ul {
49
+ display: grid;
50
+ gap: var(--smrt-spacing-3);
51
+ padding-inline-start: var(--smrt-spacing-5);
52
+ }
53
+ .smrt-pricing-version-summary__root li {
54
+ min-width: 0;
55
+ }
56
+ .smrt-pricing-version-summary__root li strong {
57
+ display: block;
58
+ }
59
+ }
60
+
43
61
  @layer smrt.theme {
44
- .pricing-summary { min-width: 0; overflow-wrap: anywhere; }
45
- .pricing-summary ul { display: grid; gap: var(--smrt-spacing-3); padding-inline-start: var(--smrt-spacing-5); }
46
- .pricing-summary li { min-width: 0; }
47
- .pricing-summary li strong { display: block; }
48
62
  }
63
+
49
64
  </style>
@@ -187,7 +187,7 @@ const moneyTaxError = $derived.by(() =>
187
187
  ),
188
188
  );
189
189
  </script>
190
- <section class="purchase-editor" aria-label={title} data-smrt-component="PurchaseOrderEditor">
190
+ <section class="smrt-purchase-order-editor__root" aria-label={title} data-smrt-component="PurchaseOrderEditor">
191
191
  <h2>{title}</h2>
192
192
  <p>{t(P['commerce.purchase.boundary'])}</p>
193
193
  <p>{source.vendor} — {source.label} · {currency}</p>
@@ -213,7 +213,7 @@ const moneyTaxError = $derived.by(() =>
213
213
  <fieldset>
214
214
  <legend>{labels.allocations??t(P['commerce.purchase.allocations'])} ({currency})</legend>
215
215
  {#each values.allocations as allocation (allocation.id)}
216
- <div class="allocation">
216
+ <div class="smrt-purchase-order-editor__allocation" data-smrt-part="item">
217
217
  <Input type="hidden" name={fields.allocationId} value={allocation.id} />
218
218
  <FormGroup label={allocation.label} error={errors[allocation.id]} required={operation==='reduce' && allocation.retained || allocation.required}>
219
219
  <Input name={fields.allocationAmount} value={allocation.amount} inputmode="decimal" required={operation==='reduce' && allocation.retained || allocation.required} density="touch" />
@@ -241,25 +241,58 @@ const moneyTaxError = $derived.by(() =>
241
241
  <Input type="hidden" name={fields.fingerprint} value={fingerprint} />
242
242
  {#if !readonly}
243
243
  {#key fingerprint}<Checkbox name={fields.confirmation} value={confirmationValue} label={labels.confirmation??t(P['commerce.purchase.confirm'])} required density="touch" />{/key}
244
- <div class="actions"><Button type="submit" name={intents.name} value={intents.record} density="touch">{labels.record??t(P['commerce.purchase.record'])}</Button><Button type="submit" name={intents.name} value={intents.edit} formnovalidate variant="secondary" density="touch">{t(P['commerce.purchase.edit'])}</Button></div>
244
+ <div class="smrt-purchase-order-editor__actions" data-smrt-part="actions"><Button type="submit" name={intents.name} value={intents.record} density="touch">{labels.record??t(P['commerce.purchase.record'])}</Button><Button type="submit" name={intents.name} value={intents.edit} formnovalidate variant="secondary" density="touch">{t(P['commerce.purchase.edit'])}</Button></div>
245
245
  {/if}
246
246
  {:else if !readonly}<Button type="submit" name={intents.name} value={intents.review} density="touch">{labels.review??t(P['commerce.purchase.review_button'])}</Button>{/if}
247
247
  </fieldset>
248
248
  {#if cancelHref}<Button href={cancelHref} variant="secondary" density="touch">{t(P['commerce.purchase.cancel'])}</Button>{/if}
249
249
  </Form>
250
250
  {#if attachments}
251
- <fieldset class="editor-attachments" disabled={readonly || busy}>
251
+ <fieldset class="smrt-purchase-order-editor__attachments" data-smrt-part="group" disabled={readonly || busy}>
252
252
  {@render attachments()}
253
253
  </fieldset>
254
254
  {/if}
255
255
  </section>
256
256
  <style>
257
257
  @layer smrt.reset, smrt.structure, smrt.theme;
258
+ @layer smrt.structure {
259
+ .smrt-purchase-order-editor__attachments {
260
+ min-width: 0;
261
+ margin: 0;
262
+ padding: 0;
263
+ }
264
+ .smrt-purchase-order-editor__root {
265
+ max-width:48rem;
266
+ min-width:0;
267
+ overflow-wrap:anywhere;
268
+ }
269
+ fieldset {
270
+ min-width:0;
271
+ margin-block:var(--smrt-spacing-4,1rem);
272
+ padding:var(--smrt-spacing-4,1rem);
273
+ }
274
+ .smrt-purchase-order-editor__allocation {
275
+ margin-block:var(--smrt-spacing-4,1rem);
276
+ }
277
+ .smrt-purchase-order-editor__actions {
278
+ display:flex;
279
+ flex-wrap:wrap;
280
+ gap:var(--smrt-spacing-3,0.75rem);
281
+ margin-block:var(--smrt-spacing-4,1rem);
282
+ }
283
+ }
284
+
258
285
  @layer smrt.theme {
259
- .editor-attachments { min-width: 0; margin: 0; padding: 0; border: 0; }
260
- .purchase-editor{max-width:48rem;min-width:0;overflow-wrap:anywhere;color:var(--smrt-color-on-surface)}
261
- fieldset{min-width:0;margin-block:var(--smrt-spacing-4,1rem);padding:var(--smrt-spacing-4,1rem);border:var(--smrt-hairline);border-radius:var(--smrt-radius-md,0.5rem)}
262
- .allocation{margin-block:var(--smrt-spacing-4,1rem)}
263
- .actions{display:flex;flex-wrap:wrap;gap:var(--smrt-spacing-3,0.75rem);margin-block:var(--smrt-spacing-4,1rem)}
286
+ .smrt-purchase-order-editor__attachments {
287
+ border: 0;
288
+ }
289
+ .smrt-purchase-order-editor__root {
290
+ color:var(--smrt-color-on-surface);
291
+ }
292
+ fieldset {
293
+ border:var(--smrt-hairline);
294
+ border-radius:var(--smrt-radius-md,0.5rem);
295
+ }
264
296
  }
297
+
265
298
  </style>
@@ -39,7 +39,7 @@ let {
39
39
  }: Props = $props();
40
40
  const { t } = useI18n();
41
41
  </script>
42
- <div class="purchase-source" data-smrt-component="PurchaseSourceSelector">
42
+ <div class="smrt-purchase-source-selector__root" data-smrt-component="PurchaseSourceSelector">
43
43
  <Form {action} {onsubmit} method="get" preventDefault={false}>
44
44
  {#each hiddenFields as field}<Input type="hidden" name={field.name} value={field.value} />{/each}
45
45
  <FormGroup label={label ?? t(P['commerce.purchase.source'])} {error} required>
@@ -55,7 +55,18 @@ const { t } = useI18n();
55
55
  </div>
56
56
  <style>
57
57
  @layer smrt.reset, smrt.structure, smrt.theme;
58
+ @layer smrt.structure {
59
+ .smrt-purchase-source-selector__root {
60
+ max-width:48rem;
61
+ min-width:0;
62
+ overflow-wrap:anywhere;
63
+ }
64
+ }
65
+
58
66
  @layer smrt.theme {
59
- .purchase-source{max-width:48rem;min-width:0;overflow-wrap:anywhere;color:var(--smrt-color-on-surface)}
67
+ .smrt-purchase-source-selector__root {
68
+ color:var(--smrt-color-on-surface);
69
+ }
60
70
  }
71
+
61
72
  </style>
@@ -166,7 +166,7 @@ const title = $derived(
166
166
  );
167
167
  </script>
168
168
 
169
- <section class="quote-editor" aria-label={title} data-smrt-component="QuoteEditor">
169
+ <section class="smrt-quote-editor__root" aria-label={title} data-smrt-component="QuoteEditor">
170
170
  <h2>{title}</h2>
171
171
  <p>{t(Q[kind === 'vendor-quotation' ? 'commerce.quote.vendor_hint' : 'commerce.quote.estimate_hint'])}</p>
172
172
  {#if money}<p>{t(Q['commerce.quote.money_amounts_are'], { amountType: lineAmountTypeText(money.lineAmountType) })}</p>{#if money.lineAmountType === 'inclusive' && money.taxMinor !== 0}<p>{t(Q['commerce.quote.money_includes_tax'], { amount: quoteMinorText({currency: values.currency, minorUnitDigits: money.minorUnitDigits, amountMinor: money.taxMinor}) })}</p>{/if}{/if}
@@ -177,7 +177,7 @@ const title = $derived(
177
177
  {#if money}<Input type="hidden" name={moneyFieldName} value={money.lineAmountType} />{/if}
178
178
  <fieldset disabled={readonly || busy}>
179
179
  <legend>{title}</legend>
180
- {#if !readonly}<div class="actions"><Button type="submit" name={intents.name} value={intents.save} density="touch">{labels.save ?? t(Q['commerce.quote.save'])}</Button></div>{/if}
180
+ {#if !readonly}<div class="smrt-quote-editor__actions" data-smrt-part="actions"><Button type="submit" name={intents.name} value={intents.save} density="touch">{labels.save ?? t(Q['commerce.quote.save'])}</Button></div>{/if}
181
181
  <FormGroup label={labels.counterparty ?? t(Q[kind === 'vendor-quotation' ? 'commerce.quote.vendor_party' : 'commerce.quote.customer_party'])} error={errors.counterpartyId} required>
182
182
  <Select name={fields.counterpartyId} value={values.counterpartyId} required density="touch">
183
183
  <option value="">{t(Q['commerce.quote.choose'])}</option>
@@ -216,7 +216,7 @@ const title = $derived(
216
216
  {#if cancelHref}<Button href={cancelHref} variant="secondary" density="touch">{t(Q['commerce.quote.cancel'])}</Button>{/if}
217
217
  </Form>
218
218
  {#if attachments}
219
- <fieldset class="editor-attachments" disabled={readonly || busy}>
219
+ <fieldset class="smrt-quote-editor__attachments" data-smrt-part="group" disabled={readonly || busy}>
220
220
  {@render attachments()}
221
221
  </fieldset>
222
222
  {/if}
@@ -224,10 +224,38 @@ const title = $derived(
224
224
 
225
225
  <style>
226
226
  @layer smrt.reset, smrt.structure, smrt.theme;
227
+ @layer smrt.structure {
228
+ .smrt-quote-editor__attachments {
229
+ min-width: 0;
230
+ margin: 0;
231
+ padding: 0;
232
+ }
233
+ .smrt-quote-editor__root {
234
+ max-width: 48rem;
235
+ min-width: 0;
236
+ overflow-wrap: anywhere;
237
+ }
238
+ fieldset {
239
+ min-width: 0;
240
+ margin-block: var(--smrt-spacing-4, 1rem);
241
+ padding: var(--smrt-spacing-4, 1rem);
242
+ }
243
+ .smrt-quote-editor__actions {
244
+ margin-top: var(--smrt-spacing-4, 1rem);
245
+ }
246
+ }
247
+
227
248
  @layer smrt.theme {
228
- .editor-attachments { min-width: 0; margin: 0; padding: 0; border: 0; }
229
- .quote-editor { max-width: 48rem; min-width: 0; color: var(--smrt-color-on-surface); overflow-wrap: anywhere; }
230
- fieldset { min-width: 0; margin-block: var(--smrt-spacing-4, 1rem); padding: var(--smrt-spacing-4, 1rem); border: var(--smrt-hairline); border-radius: var(--smrt-radius-md, 0.5rem); }
231
- .actions { margin-top: var(--smrt-spacing-4, 1rem); }
249
+ .smrt-quote-editor__attachments {
250
+ border: 0;
251
+ }
252
+ .smrt-quote-editor__root {
253
+ color: var(--smrt-color-on-surface);
254
+ }
255
+ fieldset {
256
+ border: var(--smrt-hairline);
257
+ border-radius: var(--smrt-radius-md, 0.5rem);
258
+ }
232
259
  }
260
+
233
261
  </style>
@@ -28,9 +28,9 @@ const delta = $derived.by(() => {
28
28
  }
29
29
  });
30
30
  </script>
31
- <section class="quote-comparison" aria-label={title ?? t(Q['commerce.quote.compare'])} data-smrt-component="QuoteRevisionComparison">
31
+ <section class="smrt-quote-revision-comparison__root" aria-label={title ?? t(Q['commerce.quote.compare'])} data-smrt-component="QuoteRevisionComparison">
32
32
  <h2>{title ?? t(Q['commerce.quote.compare'])}</h2>
33
- <div class="versions">
33
+ <div class="smrt-quote-revision-comparison__versions" data-smrt-part="group">
34
34
  <QuoteRevisionHistory revisions={[previous]} title={t(Q['commerce.quote.before'])} />
35
35
  <QuoteRevisionHistory revisions={[current]} title={t(Q['commerce.quote.after'])} />
36
36
  </div>
@@ -40,8 +40,22 @@ const delta = $derived.by(() => {
40
40
  </section>
41
41
  <style>
42
42
  @layer smrt.reset, smrt.structure, smrt.theme;
43
+ @layer smrt.structure {
44
+ .smrt-quote-revision-comparison__root {
45
+ min-width: 0;
46
+ overflow-wrap: anywhere;
47
+ }
48
+ .smrt-quote-revision-comparison__versions {
49
+ display: grid;
50
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
51
+ gap: var(--smrt-spacing-4, 1rem);
52
+ }
53
+ }
54
+
43
55
  @layer smrt.theme {
44
- .quote-comparison { min-width: 0; color: var(--smrt-color-on-surface); overflow-wrap: anywhere; }
45
- .versions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--smrt-spacing-4, 1rem); }
56
+ .smrt-quote-revision-comparison__root {
57
+ color: var(--smrt-color-on-surface);
58
+ }
46
59
  }
60
+
47
61
  </style>