@happyvertical/smrt-sales 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.
@@ -26,66 +26,66 @@ let { rows = [], periodLabel, locale }: Props = $props();
26
26
  const totals = $derived(sumExpenseRowsByCurrency(rows));
27
27
  </script>
28
28
 
29
- <div class="sales-expense-summary" data-smrt-component="CommissionExpenseSummary">
30
- <header class="head">
31
- <h3>Commission expense{periodLabel ? ` — ${periodLabel}` : ''}</h3>
32
- <p class="note">
29
+ <div class="smrt-commission-expense-summary__root" data-smrt-component="CommissionExpenseSummary">
30
+ <header class="smrt-commission-expense-summary__header" data-smrt-part="header">
31
+ <h3 data-smrt-part="title">Commission expense{periodLabel ? ` — ${periodLabel}` : ''}</h3>
32
+ <p class="smrt-commission-expense-summary__note" data-smrt-part="description">
33
33
  Amounts owed to earners (operator reconciliation). This is commission
34
34
  expense — distinct from client invoices and client revenue.
35
35
  </p>
36
36
  </header>
37
37
 
38
38
  {#if rows.length === 0}
39
- <p class="empty">Nothing to reconcile for this period.</p>
39
+ <p class="smrt-commission-expense-summary__empty" data-smrt-part="empty">Nothing to reconcile for this period.</p>
40
40
  {:else}
41
- <dl class="tiles">
41
+ <dl class="smrt-commission-expense-summary__tiles" data-smrt-part="list">
42
42
  {#each totals as total (total.currency)}
43
- <div class="tile">
43
+ <div class="smrt-commission-expense-summary__tile" data-smrt-part="item">
44
44
  <dt>Expense ({total.currency})</dt>
45
45
  <dd>{formatCents(total.commissionExpenseCents, total.currency, locale)}</dd>
46
46
  </div>
47
- <div class="tile">
47
+ <div class="smrt-commission-expense-summary__tile" data-smrt-part="item">
48
48
  <dt>Adjustments ({total.currency})</dt>
49
- <dd class:negative={total.adjustmentCents < 0}>
49
+ <dd class:smrt-commission-expense-summary__negative={total.adjustmentCents < 0} data-smrt-part="value">
50
50
  {formatCents(total.adjustmentCents, total.currency, locale)}
51
51
  </dd>
52
52
  </div>
53
- <div class="tile">
53
+ <div class="smrt-commission-expense-summary__tile" data-smrt-part="item">
54
54
  <dt>Paid out ({total.currency})</dt>
55
55
  <dd>{formatCents(total.payoutCents, total.currency, locale)}</dd>
56
56
  </div>
57
- <div class="tile tile--net">
57
+ <div class="smrt-commission-expense-summary__tile smrt-commission-expense-summary__tile--net" data-smrt-part="item">
58
58
  <dt>Net accrued ({total.currency})</dt>
59
- <dd class:negative={total.netAccruedCents < 0}>
59
+ <dd class:smrt-commission-expense-summary__negative={total.netAccruedCents < 0} data-smrt-part="value">
60
60
  {formatCents(total.netAccruedCents, total.currency, locale)}
61
61
  </dd>
62
62
  </div>
63
63
  {/each}
64
64
  </dl>
65
65
 
66
- <table>
66
+ <table data-smrt-part="table">
67
67
  <thead>
68
68
  <tr>
69
69
  <th scope="col">Segment</th>
70
- <th scope="col" class="num">Expense</th>
71
- <th scope="col" class="num">Adjustments</th>
72
- <th scope="col" class="num">Paid out</th>
73
- <th scope="col" class="num">Net accrued</th>
70
+ <th scope="col" class="smrt-commission-expense-summary__number" data-smrt-part="cell">Expense</th>
71
+ <th scope="col" class="smrt-commission-expense-summary__number" data-smrt-part="cell">Adjustments</th>
72
+ <th scope="col" class="smrt-commission-expense-summary__number" data-smrt-part="cell">Paid out</th>
73
+ <th scope="col" class="smrt-commission-expense-summary__number" data-smrt-part="cell">Net accrued</th>
74
74
  </tr>
75
75
  </thead>
76
- <tbody>
76
+ <tbody data-smrt-part="body">
77
77
  {#each rows as row (row.id)}
78
78
  {@const net = row.commissionExpenseCents + row.adjustmentCents - row.payoutCents}
79
- <tr>
79
+ <tr data-smrt-part="row">
80
80
  <td>{row.label}</td>
81
- <td class="num">
81
+ <td class="smrt-commission-expense-summary__number" data-smrt-part="cell">
82
82
  {formatCents(row.commissionExpenseCents, row.currency, locale)}
83
83
  </td>
84
- <td class="num" class:negative={row.adjustmentCents < 0}>
84
+ <td class="smrt-commission-expense-summary__number" class:smrt-commission-expense-summary__negative={row.adjustmentCents < 0} data-smrt-part="cell">
85
85
  {formatCents(row.adjustmentCents, row.currency, locale)}
86
86
  </td>
87
- <td class="num">{formatCents(row.payoutCents, row.currency, locale)}</td>
88
- <td class="num net" class:negative={net < 0}>
87
+ <td class="smrt-commission-expense-summary__number" data-smrt-part="cell">{formatCents(row.payoutCents, row.currency, locale)}</td>
88
+ <td class="smrt-commission-expense-summary__number smrt-commission-expense-summary__net" class:smrt-commission-expense-summary__negative={net < 0} data-smrt-part="cell">
89
89
  {formatCents(net, row.currency, locale)}
90
90
  </td>
91
91
  </tr>
@@ -97,93 +97,101 @@ const totals = $derived(sumExpenseRowsByCurrency(rows));
97
97
 
98
98
  <style>
99
99
  @layer smrt.reset, smrt.structure, smrt.theme;
100
- @layer smrt.theme {
101
- .sales-expense-summary {
100
+ @layer smrt.structure {
101
+ .smrt-commission-expense-summary__root {
102
102
  display: flex;
103
103
  flex-direction: column;
104
104
  gap: var(--smrt-spacing-3, 0.75rem);
105
105
  width: 100%;
106
106
  overflow-x: auto;
107
107
  }
108
-
109
- .head h3 {
108
+ .smrt-commission-expense-summary__header h3 {
110
109
  margin: 0;
111
- font-size: var(--smrt-typography-title-medium-size, 1rem);
112
110
  }
113
-
114
- .note {
111
+ .smrt-commission-expense-summary__note {
115
112
  margin: var(--smrt-spacing-1, 0.25rem) 0 0;
116
- color: var(--smrt-color-on-surface-variant);
117
- font-size: var(--smrt-typography-body-small-size, 0.8125rem);
118
113
  }
119
-
120
- .empty {
114
+ .smrt-commission-expense-summary__empty {
121
115
  margin: 0;
122
- color: var(--smrt-color-on-surface-variant);
123
- font-style: italic;
124
116
  }
125
-
126
- .tiles {
117
+ .smrt-commission-expense-summary__tiles {
127
118
  display: grid;
128
119
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
129
120
  gap: var(--smrt-spacing-3, 0.75rem);
130
121
  margin: 0;
131
122
  }
123
+ .smrt-commission-expense-summary__tile {
124
+ padding: var(--smrt-spacing-3, 0.75rem);
125
+ }
126
+ .smrt-commission-expense-summary__tile dd {
127
+ margin: var(--smrt-spacing-1, 0.25rem) 0 0;
128
+ }
129
+ table {
130
+ width: 100%;
131
+ }
132
+ th {
133
+ padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-3, 0.75rem);
134
+ white-space: nowrap;
135
+ }
136
+ td {
137
+ padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-3, 0.75rem);
138
+ }
139
+ .smrt-commission-expense-summary__number {
140
+ white-space: nowrap;
141
+ }
142
+ }
132
143
 
133
- .tile {
144
+ @layer smrt.theme {
145
+ .smrt-commission-expense-summary__header h3 {
146
+ font-size: var(--smrt-typography-title-medium-size, 1rem);
147
+ }
148
+ .smrt-commission-expense-summary__note {
149
+ color: var(--smrt-color-on-surface-variant);
150
+ font-size: var(--smrt-typography-body-small-size, 0.8125rem);
151
+ }
152
+ .smrt-commission-expense-summary__empty {
153
+ color: var(--smrt-color-on-surface-variant);
154
+ font-style: italic;
155
+ }
156
+ .smrt-commission-expense-summary__tile {
134
157
  background: var(--smrt-color-surface);
135
158
  border: var(--smrt-hairline);
136
159
  border-radius: var(--smrt-radius-md);
137
- padding: var(--smrt-spacing-3, 0.75rem);
138
160
  }
139
-
140
- .tile--net {
161
+ .smrt-commission-expense-summary__tile--net {
141
162
  border-color: var(--smrt-color-primary);
142
163
  }
143
-
144
- .tile dt {
164
+ .smrt-commission-expense-summary__tile dt {
145
165
  color: var(--smrt-color-on-surface-variant);
146
166
  font-size: var(--smrt-typography-label-medium-size, 0.75rem);
147
167
  text-transform: uppercase;
148
168
  letter-spacing: 0.04em;
149
169
  }
150
-
151
- .tile dd {
152
- margin: var(--smrt-spacing-1, 0.25rem) 0 0;
170
+ .smrt-commission-expense-summary__tile dd {
153
171
  font-weight: var(--smrt-typography-weight-bold, 700);
154
172
  }
155
-
156
- .negative {
173
+ .smrt-commission-expense-summary__negative {
157
174
  color: var(--smrt-color-error);
158
175
  }
159
-
160
176
  table {
161
- width: 100%;
162
177
  border-collapse: collapse;
163
178
  font-size: var(--smrt-typography-body-medium-size, 0.875rem);
164
179
  }
165
-
166
180
  th {
167
- padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-3, 0.75rem);
168
181
  text-align: left;
169
182
  font-weight: var(--smrt-typography-weight-semibold, 600);
170
183
  background: var(--smrt-color-surface-container);
171
184
  border-bottom: var(--smrt-hairline);
172
- white-space: nowrap;
173
185
  }
174
-
175
186
  td {
176
- padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-3, 0.75rem);
177
187
  border-bottom: var(--smrt-hairline);
178
188
  }
179
-
180
- .num {
189
+ .smrt-commission-expense-summary__number {
181
190
  text-align: right;
182
- white-space: nowrap;
183
191
  }
184
-
185
- .net {
192
+ .smrt-commission-expense-summary__net {
186
193
  font-weight: var(--smrt-typography-weight-semibold, 600);
187
194
  }
188
195
  }
196
+
189
197
  </style>
@@ -26,25 +26,25 @@ export interface Props {
26
26
  let { agreements = [], locale, artifactHref }: Props = $props();
27
27
  </script>
28
28
 
29
- <div class="sales-agreements" data-smrt-component="ExecutedAgreementsList">
29
+ <div class="smrt-executed-agreements-list__root" data-smrt-component="ExecutedAgreementsList">
30
30
  {#if agreements.length === 0}
31
- <p class="empty">No agreements yet.</p>
31
+ <p class="smrt-executed-agreements-list__empty" data-smrt-part="empty">No agreements yet.</p>
32
32
  {:else}
33
33
  <table>
34
- <thead>
34
+ <thead data-smrt-part="header">
35
35
  <tr>
36
36
  <th scope="col">Version</th>
37
37
  <th scope="col">Status</th>
38
38
  <th scope="col">Effective</th>
39
39
  <th scope="col">Commission plan</th>
40
- <th scope="col" class="num">Clearing</th>
40
+ <th scope="col" class="smrt-executed-agreements-list__number" data-smrt-part="cell">Clearing</th>
41
41
  <th scope="col">Approval</th>
42
42
  <th scope="col">Executed artifact</th>
43
43
  </tr>
44
44
  </thead>
45
- <tbody>
45
+ <tbody data-smrt-part="body">
46
46
  {#each agreements as agreement (agreement.id)}
47
- <tr>
47
+ <tr data-smrt-part="row">
48
48
  <td>v{agreement.version}</td>
49
49
  <td>
50
50
  <Badge variant={agreementStatusBadgeVariant(agreement.status)} size="sm">
@@ -63,7 +63,7 @@ let { agreements = [], locale, artifactHref }: Props = $props();
63
63
  <td>
64
64
  <code>{formatPlanRef(agreement.planKey, agreement.planVersion)}</code>
65
65
  </td>
66
- <td class="num">{agreement.clearingDays} days</td>
66
+ <td class="smrt-executed-agreements-list__number" data-smrt-part="cell">{agreement.clearingDays} days</td>
67
67
  <td>{agreement.approvalMode}</td>
68
68
  <td>
69
69
  {#if agreement.signedDocumentAssetId}
@@ -77,12 +77,16 @@ let { agreements = [], locale, artifactHref }: Props = $props();
77
77
  <code title={agreement.signedDocumentAssetId}>signed asset</code>
78
78
  {/if}
79
79
  {#if agreement.signedDocumentSha256}
80
- <code class="hash" title={agreement.signedDocumentSha256}>
80
+ <code
81
+ class="smrt-executed-agreements-list__hash"
82
+ data-smrt-part="meta"
83
+ title={agreement.signedDocumentSha256}
84
+ >
81
85
  {agreement.signedDocumentSha256.slice(0, 12)}…
82
86
  </code>
83
87
  {/if}
84
88
  {#if agreement.auditTrailAssetId}
85
- <span class="separator">·</span>
89
+ <span class="smrt-executed-agreements-list__separator" data-smrt-part="indicator">·</span>
86
90
  {#if artifactHref}
87
91
  <a
88
92
  href={artifactHref(agreement.id, 'audit_trail')}
@@ -106,60 +110,67 @@ let { agreements = [], locale, artifactHref }: Props = $props();
106
110
 
107
111
  <style>
108
112
  @layer smrt.reset, smrt.structure, smrt.theme;
109
- @layer smrt.theme {
110
- .sales-agreements {
113
+ @layer smrt.structure {
114
+ .smrt-executed-agreements-list__root {
111
115
  width: 100%;
112
116
  overflow-x: auto;
113
117
  }
114
-
115
- .empty {
118
+ .smrt-executed-agreements-list__empty {
116
119
  margin: 0;
120
+ }
121
+ table {
122
+ width: 100%;
123
+ }
124
+ th {
125
+ padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-3, 0.75rem);
126
+ white-space: nowrap;
127
+ }
128
+ td {
129
+ padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-3, 0.75rem);
130
+ }
131
+ .smrt-executed-agreements-list__number {
132
+ white-space: nowrap;
133
+ }
134
+ .smrt-executed-agreements-list__hash {
135
+ margin-left: var(--smrt-spacing-1, 0.25rem);
136
+ }
137
+ .smrt-executed-agreements-list__separator {
138
+ margin: 0 var(--smrt-spacing-1, 0.25rem);
139
+ }
140
+ }
141
+
142
+ @layer smrt.theme {
143
+ .smrt-executed-agreements-list__empty {
117
144
  color: var(--smrt-color-on-surface-variant);
118
145
  font-style: italic;
119
146
  }
120
-
121
147
  table {
122
- width: 100%;
123
148
  border-collapse: collapse;
124
149
  font-size: var(--smrt-typography-body-medium-size, 0.875rem);
125
150
  }
126
-
127
151
  th {
128
- padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-3, 0.75rem);
129
152
  text-align: left;
130
153
  font-weight: var(--smrt-typography-weight-semibold, 600);
131
154
  background: var(--smrt-color-surface-container);
132
155
  border-bottom: var(--smrt-hairline);
133
- white-space: nowrap;
134
156
  }
135
-
136
157
  td {
137
- padding: var(--smrt-spacing-2, 0.5rem) var(--smrt-spacing-3, 0.75rem);
138
158
  border-bottom: var(--smrt-hairline);
139
159
  vertical-align: top;
140
160
  }
141
-
142
- .num {
161
+ .smrt-executed-agreements-list__number {
143
162
  text-align: right;
144
- white-space: nowrap;
145
163
  }
146
-
147
164
  code {
148
165
  font-family: var(--smrt-font-family-mono, ui-monospace, monospace);
149
166
  font-size: var(--smrt-typography-body-small-size, 0.8125rem);
150
167
  }
151
-
152
- .hash {
153
- margin-left: var(--smrt-spacing-1, 0.25rem);
168
+ .smrt-executed-agreements-list__hash {
154
169
  color: var(--smrt-color-on-surface-variant);
155
170
  }
156
-
157
- .separator {
158
- margin: 0 var(--smrt-spacing-1, 0.25rem);
159
- }
160
-
161
171
  a {
162
172
  color: var(--smrt-color-primary);
163
173
  }
164
174
  }
175
+
165
176
  </style>
@@ -84,7 +84,7 @@ function submit() {
84
84
  }
85
85
  </script>
86
86
 
87
- <section class="sales-lead-create" aria-label="Create lead" data-smrt-component="LeadCreateForm">
87
+ <section class="smrt-lead-create-form__root" aria-label="Create lead" data-smrt-component="LeadCreateForm">
88
88
  <Form class="sales-lead-create__form" onsubmit={submit}>
89
89
  <FormGroup label="Lead name" required>
90
90
  <Input value={name} required disabled={busy} oninput={(event) => (name = event.currentTarget.value)} />
@@ -124,12 +124,12 @@ function submit() {
124
124
  </FormGroup>
125
125
  {/if}
126
126
  {#if validationError || error}
127
- <p class="sales-lead-create__error" role="alert">{validationError || error}</p>
127
+ <p class="smrt-lead-create-form__error" data-smrt-part="message" role="alert">{validationError || error}</p>
128
128
  {/if}
129
129
  {#if duplicate}
130
- <p class="sales-lead-create__duplicate" role="status">Possible duplicate: {duplicate.name}</p>
130
+ <p class="smrt-lead-create-form__duplicate" data-smrt-part="message" role="status">Possible duplicate: {duplicate.name}</p>
131
131
  {/if}
132
- <div class="sales-lead-create__actions">
132
+ <div class="smrt-lead-create-form__actions" data-smrt-part="actions">
133
133
  {#if onCancel}
134
134
  <Button type="button" variant="secondary" disabled={busy} onclick={() => onCancel?.()}>Cancel</Button>
135
135
  {/if}
@@ -140,10 +140,31 @@ function submit() {
140
140
 
141
141
  <style>
142
142
  @layer smrt.reset, smrt.structure, smrt.theme;
143
+ @layer smrt.structure {
144
+ :global(.sales-lead-create__form) {
145
+ display: grid;
146
+ gap: var(--smrt-spacing-3, 0.75rem);
147
+ }
148
+ .smrt-lead-create-form__actions {
149
+ display: flex;
150
+ justify-content: flex-end;
151
+ gap: var(--smrt-spacing-2, 0.5rem);
152
+ }
153
+ .smrt-lead-create-form__error {
154
+ margin: 0;
155
+ }
156
+ .smrt-lead-create-form__duplicate {
157
+ margin: 0;
158
+ }
159
+ }
160
+
143
161
  @layer smrt.theme {
144
- :global(.sales-lead-create__form) { display: grid; gap: var(--smrt-spacing-3, 0.75rem); }
145
- .sales-lead-create__actions { display: flex; justify-content: flex-end; gap: var(--smrt-spacing-2, 0.5rem); }
146
- .sales-lead-create__error { color: var(--smrt-color-error); margin: 0; }
147
- .sales-lead-create__duplicate { color: var(--smrt-color-warning); margin: 0; }
162
+ .smrt-lead-create-form__error {
163
+ color: var(--smrt-color-error);
164
+ }
165
+ .smrt-lead-create-form__duplicate {
166
+ color: var(--smrt-color-warning);
167
+ }
148
168
  }
169
+
149
170
  </style>