@happyvertical/smrt-commerce 0.34.4 → 0.34.6
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/manifest.json +6323 -6323
- package/dist/smrt-knowledge.json +1878 -1878
- package/dist/svelte/components/InvoiceActions.svelte +14 -83
- package/dist/svelte/components/InvoiceActions.svelte.d.ts.map +1 -1
- package/dist/svelte/components/InvoiceCard.svelte +1 -0
- package/dist/svelte/components/InvoiceCard.svelte.d.ts.map +1 -1
- package/dist/svelte/components/InvoiceLineItems.svelte +24 -17
- package/dist/svelte/components/InvoiceLineItems.svelte.d.ts.map +1 -1
- package/dist/svelte/components/UnbilledItems.svelte +6 -28
- package/dist/svelte/components/UnbilledItems.svelte.d.ts.map +1 -1
- package/package.json +8 -7
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
9
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
9
10
|
import { M } from '../i18n.js';
|
|
10
11
|
import type { InvoiceStatus } from '../types.js';
|
|
11
12
|
|
|
@@ -54,61 +55,61 @@ const canMarkPaid = $derived(
|
|
|
54
55
|
const canDelete = $derived(status === 'draft');
|
|
55
56
|
</script>
|
|
56
57
|
|
|
57
|
-
<div class="invoice-actions"
|
|
58
|
+
<div class="invoice-actions">
|
|
58
59
|
{#if canSend && onsend}
|
|
59
|
-
<
|
|
60
|
+
<Button variant="primary" {size} onclick={onsend} disabled={loading}>
|
|
60
61
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
61
62
|
<path d="M14 2L7 9M14 2l-4 12-3-5-5-3 12-4z" />
|
|
62
63
|
</svg>
|
|
63
64
|
{t(M['commerce.invoice_actions.send_invoice'])}
|
|
64
|
-
</
|
|
65
|
+
</Button>
|
|
65
66
|
{/if}
|
|
66
67
|
|
|
67
68
|
{#if canMarkPaid && onmarkpaid}
|
|
68
|
-
<
|
|
69
|
+
<Button variant="primary" {size} onclick={onmarkpaid} disabled={loading}>
|
|
69
70
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2">
|
|
70
71
|
<path d="M3 8l4 4 6-8" />
|
|
71
72
|
</svg>
|
|
72
73
|
{t(M['commerce.invoice_actions.mark_as_paid'])}
|
|
73
|
-
</
|
|
74
|
+
</Button>
|
|
74
75
|
{/if}
|
|
75
76
|
|
|
76
77
|
{#if canEdit && onedit}
|
|
77
|
-
<
|
|
78
|
+
<Button variant="secondary" {size} onclick={onedit} disabled={loading}>
|
|
78
79
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
79
80
|
<path d="M11.5 2.5l2 2-8 8H3.5v-2l8-8z" />
|
|
80
81
|
</svg>
|
|
81
82
|
Edit
|
|
82
|
-
</
|
|
83
|
+
</Button>
|
|
83
84
|
{/if}
|
|
84
85
|
|
|
85
86
|
{#if onprint}
|
|
86
|
-
<
|
|
87
|
+
<Button variant="secondary" {size} onclick={onprint} disabled={loading}>
|
|
87
88
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
88
89
|
<path d="M4 5V2h8v3M4 11h8M2 5h12v6H2z" />
|
|
89
90
|
<path d="M4 11v3h8v-3" />
|
|
90
91
|
</svg>
|
|
91
92
|
Print
|
|
92
|
-
</
|
|
93
|
+
</Button>
|
|
93
94
|
{/if}
|
|
94
95
|
|
|
95
96
|
{#if onexport}
|
|
96
|
-
<
|
|
97
|
+
<Button variant="secondary" {size} onclick={onexport} disabled={loading}>
|
|
97
98
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
98
99
|
<path d="M8 2v8M4 6l4-4 4 4M2 12v2h12v-2" />
|
|
99
100
|
</svg>
|
|
100
101
|
Export
|
|
101
|
-
</
|
|
102
|
+
</Button>
|
|
102
103
|
{/if}
|
|
103
104
|
|
|
104
105
|
{#if canDelete && ondelete}
|
|
105
|
-
<
|
|
106
|
+
<Button variant="danger" {size} onclick={ondelete} disabled={loading}>
|
|
106
107
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
107
108
|
<path d="M3 4h10M5 4V3a1 1 0 011-1h4a1 1 0 011 1v1M6 7v5M10 7v5" />
|
|
108
109
|
<path d="M4 4l1 10h6l1-10" />
|
|
109
110
|
</svg>
|
|
110
111
|
Delete
|
|
111
|
-
</
|
|
112
|
+
</Button>
|
|
112
113
|
{/if}
|
|
113
114
|
</div>
|
|
114
115
|
|
|
@@ -118,74 +119,4 @@ const canDelete = $derived(status === 'draft');
|
|
|
118
119
|
gap: var(--smrt-spacing-2, 0.5rem);
|
|
119
120
|
flex-wrap: wrap;
|
|
120
121
|
}
|
|
121
|
-
|
|
122
|
-
.btn {
|
|
123
|
-
display: inline-flex;
|
|
124
|
-
align-items: center;
|
|
125
|
-
gap: var(--smrt-spacing-2, 0.5rem);
|
|
126
|
-
padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-4, 1rem);
|
|
127
|
-
font: var(--smrt-typography-label-large-font);
|
|
128
|
-
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
129
|
-
border: none;
|
|
130
|
-
border-radius: var(--smrt-radius-small, 0.375rem);
|
|
131
|
-
cursor: pointer;
|
|
132
|
-
transition: all var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
133
|
-
white-space: nowrap;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
@media (prefers-reduced-motion: reduce) {
|
|
137
|
-
.btn {
|
|
138
|
-
transition: none;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.sm .btn {
|
|
143
|
-
padding: var(--smrt-spacing-1_5, 0.375rem) var(--smrt-spacing-3, 0.75rem);
|
|
144
|
-
font: var(--smrt-typography-label-medium-font);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.btn:disabled {
|
|
148
|
-
opacity: 0.38;
|
|
149
|
-
cursor: not-allowed;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.btn-primary {
|
|
153
|
-
background: var(--smrt-color-primary, #005ac1);
|
|
154
|
-
color: var(--smrt-color-on-primary, #ffffff);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.btn-primary:hover:not(:disabled) {
|
|
158
|
-
background: color-mix(in srgb, var(--smrt-color-primary, #005ac1) 85%, var(--smrt-color-shadow, #000));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.btn-success {
|
|
162
|
-
background: var(--smrt-color-tertiary, #006c4c);
|
|
163
|
-
color: var(--smrt-color-on-tertiary, #ffffff);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.btn-success:hover:not(:disabled) {
|
|
167
|
-
background: color-mix(in srgb, var(--smrt-color-tertiary, #006c4c) 85%, var(--smrt-color-shadow, #000));
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.btn-secondary {
|
|
171
|
-
background: var(--smrt-color-surface-container-lowest, #ffffff);
|
|
172
|
-
color: var(--smrt-color-on-surface-variant, #44474e);
|
|
173
|
-
border: 1px solid var(--smrt-color-outline, #74777f);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.btn-secondary:hover:not(:disabled) {
|
|
177
|
-
background: var(--smrt-color-surface-container-low, #f7f2fa);
|
|
178
|
-
border-color: var(--smrt-color-on-surface-variant, #44474e);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.btn-danger {
|
|
182
|
-
background: var(--smrt-color-surface-container-lowest, #ffffff);
|
|
183
|
-
color: var(--smrt-color-error, #ba1a1a);
|
|
184
|
-
border: 1px solid var(--smrt-color-error-container, #ffdad6);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.btn-danger:hover:not(:disabled) {
|
|
188
|
-
background: var(--smrt-color-error-container, #ffdad6);
|
|
189
|
-
border-color: var(--smrt-color-error, #ba1a1a);
|
|
190
|
-
}
|
|
191
122
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceActions.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InvoiceActions.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InvoiceActions.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InvoiceActions.svelte.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,yCAAyC;AACzC,MAAM,WAAW,KAAK;IACpB,6BAA6B;IAC7B,MAAM,EAAE,aAAa,CAAC;IACtB,oBAAoB;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,mBAAmB;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB;AA+FD,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
|
@@ -99,6 +99,7 @@ const isOverdue = $derived.by(() => {
|
|
|
99
99
|
</div>
|
|
100
100
|
</a>
|
|
101
101
|
{:else}
|
|
102
|
+
<!-- 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) -->
|
|
102
103
|
<button type="button" class="invoice-card" onclick={onclick} use:ripple>
|
|
103
104
|
<div class="card-header">
|
|
104
105
|
<span class="invoice-number">{invoice.invoiceNumber}</span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceCard.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InvoiceCard.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,aAAa,CAAC;AAG9D,sCAAsC;AACtC,MAAM,WAAW,KAAK;IACpB,mBAAmB;IACnB,OAAO,EAAE,WAAW,CAAC;IACrB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"InvoiceCard.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InvoiceCard.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,aAAa,CAAC;AAG9D,sCAAsC;AACtC,MAAM,WAAW,KAAK;IACpB,mBAAmB;IACnB,OAAO,EAAE,WAAW,CAAC;IACrB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAoHD,QAAA,MAAM,WAAW,2CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
10
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
10
11
|
import type { Snippet } from 'svelte';
|
|
11
12
|
import { M } from '../i18n.js';
|
|
12
13
|
import type { LineItem } from '../types.js';
|
|
@@ -70,9 +71,9 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
|
|
|
70
71
|
<div class="empty-state">
|
|
71
72
|
<p>{emptyMessage}</p>
|
|
72
73
|
{#if editable && onadd}
|
|
73
|
-
<
|
|
74
|
+
<Button variant="ghost" class="add-btn" onclick={onadd}>
|
|
74
75
|
{t(M['commerce.invoice_line_items.add_item'])}
|
|
75
|
-
</
|
|
76
|
+
</Button>
|
|
76
77
|
{/if}
|
|
77
78
|
</div>
|
|
78
79
|
{:else}
|
|
@@ -112,8 +113,8 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
|
|
|
112
113
|
<td class="col-amount">{formatMoney(item.amount)}</td>
|
|
113
114
|
{#if editable}
|
|
114
115
|
<td class="col-actions">
|
|
115
|
-
<
|
|
116
|
-
|
|
116
|
+
<Button
|
|
117
|
+
variant="ghost"
|
|
117
118
|
class="action-btn delete"
|
|
118
119
|
title={t(M['commerce.invoice_line_items.remove_item'])}
|
|
119
120
|
onclick={() => ondelete?.(item.id)}
|
|
@@ -121,7 +122,7 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
|
|
|
121
122
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2">
|
|
122
123
|
<path d="M4 4l8 8M4 12l8-8" />
|
|
123
124
|
</svg>
|
|
124
|
-
</
|
|
125
|
+
</Button>
|
|
125
126
|
</td>
|
|
126
127
|
{/if}
|
|
127
128
|
</tr>
|
|
@@ -139,12 +140,12 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
|
|
|
139
140
|
</table>
|
|
140
141
|
|
|
141
142
|
{#if editable && onadd}
|
|
142
|
-
<
|
|
143
|
+
<Button variant="ghost" class="add-btn add-btn-below" onclick={onadd}>
|
|
143
144
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2">
|
|
144
145
|
<path d="M8 3v10M3 8h10" />
|
|
145
146
|
</svg>
|
|
146
147
|
{t(M['commerce.invoice_line_items.add_item'])}
|
|
147
|
-
</
|
|
148
|
+
</Button>
|
|
148
149
|
{/if}
|
|
149
150
|
{/if}
|
|
150
151
|
</div>
|
|
@@ -262,7 +263,15 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
|
|
|
262
263
|
color: var(--smrt-color-on-surface, #1c1b1f);
|
|
263
264
|
}
|
|
264
265
|
|
|
265
|
-
|
|
266
|
+
/*
|
|
267
|
+
* These rules style the <button> rendered *inside* the smrt-ui <Button>
|
|
268
|
+
* child component (issue #1589). A plain scoped `.action-btn {}` rule would
|
|
269
|
+
* not reach it (no parent scope hash), so each is written as
|
|
270
|
+
* `.line-items-container :global(.class)` — Svelte compiles the ancestor to
|
|
271
|
+
* `.line-items-container.svelte-HASH .class`, which pierces into the child.
|
|
272
|
+
* Overrides cover sizing/shape/color; the ghost variant owns the base.
|
|
273
|
+
*/
|
|
274
|
+
.line-items-container :global(.action-btn) {
|
|
266
275
|
display: inline-flex;
|
|
267
276
|
align-items: center;
|
|
268
277
|
justify-content: center;
|
|
@@ -271,28 +280,27 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
|
|
|
271
280
|
background: transparent;
|
|
272
281
|
border: none;
|
|
273
282
|
border-radius: var(--smrt-radius-extra-small, 0.25rem);
|
|
274
|
-
cursor: pointer;
|
|
275
283
|
color: var(--smrt-color-on-surface-variant, #49454f);
|
|
276
284
|
transition: all var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
277
285
|
}
|
|
278
286
|
|
|
279
287
|
@media (prefers-reduced-motion: reduce) {
|
|
280
|
-
.action-btn {
|
|
288
|
+
.line-items-container :global(.action-btn) {
|
|
281
289
|
transition: none;
|
|
282
290
|
}
|
|
283
291
|
}
|
|
284
292
|
|
|
285
|
-
.action-btn:hover {
|
|
293
|
+
.line-items-container :global(.action-btn:hover) {
|
|
286
294
|
background: var(--smrt-color-surface-variant, #e7e0ec);
|
|
287
295
|
color: var(--smrt-color-on-surface, #1c1b1f);
|
|
288
296
|
}
|
|
289
297
|
|
|
290
|
-
.action-btn.delete:hover {
|
|
298
|
+
.line-items-container :global(.action-btn.delete:hover) {
|
|
291
299
|
background: var(--smrt-color-error-container, #ffdad6);
|
|
292
300
|
color: var(--smrt-color-error, #ba1a1a);
|
|
293
301
|
}
|
|
294
302
|
|
|
295
|
-
.add-btn {
|
|
303
|
+
.line-items-container :global(.add-btn) {
|
|
296
304
|
display: inline-flex;
|
|
297
305
|
align-items: center;
|
|
298
306
|
gap: var(--smrt-spacing-2, 0.5rem);
|
|
@@ -303,21 +311,20 @@ const total = $derived(items.reduce((sum, item) => sum + item.amount, 0));
|
|
|
303
311
|
background: transparent;
|
|
304
312
|
border: 1px dashed var(--smrt-color-primary, #005ac1);
|
|
305
313
|
border-radius: var(--smrt-radius-small, 0.375rem);
|
|
306
|
-
cursor: pointer;
|
|
307
314
|
transition: all var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
308
315
|
}
|
|
309
316
|
|
|
310
317
|
@media (prefers-reduced-motion: reduce) {
|
|
311
|
-
.add-btn {
|
|
318
|
+
.line-items-container :global(.add-btn) {
|
|
312
319
|
transition: none;
|
|
313
320
|
}
|
|
314
321
|
}
|
|
315
322
|
|
|
316
|
-
.add-btn:hover {
|
|
323
|
+
.line-items-container :global(.add-btn:hover) {
|
|
317
324
|
background: var(--smrt-color-primary-container, #d3e3fd);
|
|
318
325
|
}
|
|
319
326
|
|
|
320
|
-
.add-btn-below {
|
|
327
|
+
.line-items-container :global(.add-btn-below) {
|
|
321
328
|
margin-top: var(--smrt-spacing-3, 0.75rem);
|
|
322
329
|
}
|
|
323
330
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceLineItems.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InvoiceLineItems.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InvoiceLineItems.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InvoiceLineItems.svelte.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,2CAA2C;AAC3C,MAAM,WAAW,KAAK;IACpB,4BAA4B;IAC5B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IACzD,kCAAkC;IAClC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAgID,QAAA,MAAM,gBAAgB,2CAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
9
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
9
10
|
import { M } from '../i18n.js';
|
|
10
11
|
import type { UnbilledItem } from '../types.js';
|
|
11
12
|
|
|
@@ -105,6 +106,7 @@ const someSelected = $derived(
|
|
|
105
106
|
{:else}
|
|
106
107
|
<div class="items-header">
|
|
107
108
|
<label class="select-all">
|
|
109
|
+
<!-- raw-primitive-allow: tri-state select-all checkbox needs the indeterminate flag for the some-but-not-all state; neither CheckboxInput nor Toggle exposes indeterminate, and a use action cannot be applied to a component -->
|
|
108
110
|
<input
|
|
109
111
|
type="checkbox"
|
|
110
112
|
checked={allSelected}
|
|
@@ -121,6 +123,7 @@ const someSelected = $derived(
|
|
|
121
123
|
<div class="items-list">
|
|
122
124
|
{#each items as item (item.id)}
|
|
123
125
|
<label class="item-row" class:selected={selectedIds.has(item.id)}>
|
|
126
|
+
<!-- raw-primitive-allow: native checkbox kept for visual + behavioral consistency with the indeterminate select-all checkbox above (which must stay native); the only checkbox primitive, CheckboxInput, also requires a smrt-svelte Provider in context, which this standalone presentational component does not assume -->
|
|
124
127
|
<input
|
|
125
128
|
type="checkbox"
|
|
126
129
|
checked={selectedIds.has(item.id)}
|
|
@@ -150,13 +153,12 @@ const someSelected = $derived(
|
|
|
150
153
|
<span class="summary-value">{formatMoney(selectedTotal)}</span>
|
|
151
154
|
</div>
|
|
152
155
|
{#if oncreate}
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
class="create-btn"
|
|
156
|
+
<Button
|
|
157
|
+
variant="primary"
|
|
156
158
|
onclick={() => oncreate?.([...selectedIds])}
|
|
157
159
|
>
|
|
158
160
|
{t(M['commerce.unbilled_items.create_invoice'])}
|
|
159
|
-
</
|
|
161
|
+
</Button>
|
|
160
162
|
{/if}
|
|
161
163
|
</div>
|
|
162
164
|
{/if}
|
|
@@ -329,28 +331,4 @@ const someSelected = $derived(
|
|
|
329
331
|
font-weight: var(--smrt-typography-weight-semibold, 600);
|
|
330
332
|
color: var(--smrt-color-on-surface, #1c1b1f);
|
|
331
333
|
}
|
|
332
|
-
|
|
333
|
-
.create-btn {
|
|
334
|
-
display: inline-flex;
|
|
335
|
-
align-items: center;
|
|
336
|
-
padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-4, 1rem);
|
|
337
|
-
font: var(--smrt-typography-label-large-font);
|
|
338
|
-
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
339
|
-
color: var(--smrt-color-on-primary, #ffffff);
|
|
340
|
-
background: var(--smrt-color-primary, #005ac1);
|
|
341
|
-
border: none;
|
|
342
|
-
border-radius: var(--smrt-radius-small, 0.375rem);
|
|
343
|
-
cursor: pointer;
|
|
344
|
-
transition: background var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
@media (prefers-reduced-motion: reduce) {
|
|
348
|
-
.create-btn {
|
|
349
|
-
transition: none;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.create-btn:hover {
|
|
354
|
-
background: color-mix(in srgb, var(--smrt-color-primary, #005ac1) 85%, var(--smrt-color-shadow, #000));
|
|
355
|
-
}
|
|
356
334
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnbilledItems.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/UnbilledItems.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnbilledItems.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/UnbilledItems.svelte.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,wCAAwC;AACxC,MAAM,WAAW,KAAK;IACpB,qBAAqB;IACrB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3C,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA+ID,QAAA,MAAM,aAAa,gDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-commerce",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.6",
|
|
4
4
|
"description": "Commerce models for the SMRT framework - contracts, fulfillments, payments",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"smrtRawPrimitives": "strict",
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
8
9
|
"exports": {
|
|
@@ -48,11 +49,11 @@
|
|
|
48
49
|
"access": "public"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
|
-
"@happyvertical/smrt-core": "0.34.
|
|
52
|
-
"@happyvertical/smrt-
|
|
53
|
-
"@happyvertical/smrt-
|
|
54
|
-
"@happyvertical/smrt-types": "0.34.
|
|
55
|
-
"@happyvertical/smrt-ui": "0.34.
|
|
52
|
+
"@happyvertical/smrt-core": "0.34.6",
|
|
53
|
+
"@happyvertical/smrt-ledgers": "0.34.6",
|
|
54
|
+
"@happyvertical/smrt-tenancy": "0.34.6",
|
|
55
|
+
"@happyvertical/smrt-types": "0.34.6",
|
|
56
|
+
"@happyvertical/smrt-ui": "0.34.6"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"svelte": "^5.18.0"
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
"typescript": "^5.9.3",
|
|
73
74
|
"vite": "^7.3.1",
|
|
74
75
|
"vitest": "^4.0.17",
|
|
75
|
-
"@happyvertical/smrt-vitest": "0.34.
|
|
76
|
+
"@happyvertical/smrt-vitest": "0.34.6"
|
|
76
77
|
},
|
|
77
78
|
"scripts": {
|
|
78
79
|
"build": "vite build --mode library && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json",
|