@happyvertical/smrt-products 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.
- package/dist/lib/chunks/{__smrt-register__-DCxRzaaR.js → __smrt-register__-D7kk6NH8.js} +2 -2
- package/dist/lib/chunks/{__smrt-register__-DCxRzaaR.js.map → __smrt-register__-D7kk6NH8.js.map} +1 -1
- package/dist/lib/chunks/{collections-CdoY699J.js → collections-CgsrBQJ3.js} +2 -2
- package/dist/lib/chunks/{collections-CdoY699J.js.map → collections-CgsrBQJ3.js.map} +1 -1
- package/dist/lib/chunks/{components-DMJz1geh.js → components-j1pkLwKV.js} +14 -14
- package/dist/lib/chunks/components-j1pkLwKV.js.map +1 -0
- package/dist/lib/chunks/{generated-CEDw1Uka.js → generated-DshStXp5.js} +2 -2
- package/dist/lib/chunks/{generated-CEDw1Uka.js.map → generated-DshStXp5.js.map} +1 -1
- package/dist/lib/chunks/models-BWyt9OMl.js +2 -0
- package/dist/lib/collections.js +1 -1
- package/dist/lib/components.js +1 -1
- package/dist/lib/generated.js +1 -1
- package/dist/lib/index.js +5 -5
- package/dist/lib/lib/components/LiveProductList.svelte +56 -51
- package/dist/lib/lib/components/ProductCard.svelte +65 -59
- package/dist/lib/lib/components/ProductForm.svelte +55 -51
- package/dist/lib/lib/components/TestComponent.svelte +9 -3
- package/dist/lib/lib/components/auto-generated/AutoForm.svelte +52 -42
- package/dist/lib/lib/components/auto-generated/FieldRenderer.svelte +18 -18
- package/dist/lib/lib/features/CategoryManager.svelte +33 -23
- package/dist/lib/lib/features/ProductCatalog.svelte +69 -64
- package/dist/lib/manifest.json +1 -1
- package/dist/lib/models.js +1 -1
- package/dist/lib/smrt-knowledge.json +3 -3
- package/dist/lib/smrt-products.css +92 -82
- package/package.json +14 -14
- package/dist/lib/chunks/components-DMJz1geh.js.map +0 -1
- package/dist/lib/chunks/models-CCSb3kln.js +0 -2
|
@@ -71,24 +71,24 @@ function handleSubmit(event: Event) {
|
|
|
71
71
|
}
|
|
72
72
|
</script>
|
|
73
73
|
|
|
74
|
-
<div class="product-
|
|
75
|
-
<Form onsubmit={handleSubmit} class="product-
|
|
76
|
-
<div class="
|
|
74
|
+
<div class="smrt-product-form__root" data-smrt-component="ProductForm">
|
|
75
|
+
<Form onsubmit={handleSubmit} class="smrt-product-form__form">
|
|
76
|
+
<div class="smrt-product-form__field" data-smrt-part="field">
|
|
77
77
|
<label for="name">{t(M['products.product_form.name_label'])}</label>
|
|
78
78
|
<Input
|
|
79
79
|
id="name"
|
|
80
80
|
type="text"
|
|
81
81
|
bind:value={formData.name}
|
|
82
82
|
disabled={loading}
|
|
83
|
-
class={errors.name ? '
|
|
83
|
+
class={errors.name ? 'smrt-product-form__error' : ''}
|
|
84
84
|
placeholder={t(M['products.product_form.name_placeholder'])}
|
|
85
85
|
/>
|
|
86
86
|
{#if errors.name}
|
|
87
|
-
<span class="
|
|
87
|
+
<span class="smrt-product-form__error-message" data-smrt-part="error">{errors.name}</span>
|
|
88
88
|
{/if}
|
|
89
89
|
</div>
|
|
90
90
|
|
|
91
|
-
<div class="
|
|
91
|
+
<div class="smrt-product-form__field" data-smrt-part="field">
|
|
92
92
|
<label for="description">Description</label>
|
|
93
93
|
<Textarea
|
|
94
94
|
id="description"
|
|
@@ -99,8 +99,8 @@ function handleSubmit(event: Event) {
|
|
|
99
99
|
></Textarea>
|
|
100
100
|
</div>
|
|
101
101
|
|
|
102
|
-
<div class="
|
|
103
|
-
<div class="
|
|
102
|
+
<div class="smrt-product-form__row" data-smrt-part="row">
|
|
103
|
+
<div class="smrt-product-form__field" data-smrt-part="field">
|
|
104
104
|
<label for="price">Price *</label>
|
|
105
105
|
<Input
|
|
106
106
|
id="price"
|
|
@@ -109,15 +109,15 @@ function handleSubmit(event: Event) {
|
|
|
109
109
|
min="0"
|
|
110
110
|
bind:value={formData.price}
|
|
111
111
|
disabled={loading}
|
|
112
|
-
class={errors.price ? '
|
|
112
|
+
class={errors.price ? 'smrt-product-form__error' : ''}
|
|
113
113
|
placeholder="0.00"
|
|
114
114
|
/>
|
|
115
115
|
{#if errors.price}
|
|
116
|
-
<span class="
|
|
116
|
+
<span class="smrt-product-form__error-message" data-smrt-part="error">{errors.price}</span>
|
|
117
117
|
{/if}
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
|
-
<div class="
|
|
120
|
+
<div class="smrt-product-form__field" data-smrt-part="field">
|
|
121
121
|
<label for="category">Category</label>
|
|
122
122
|
<Input
|
|
123
123
|
id="category"
|
|
@@ -129,7 +129,7 @@ function handleSubmit(event: Event) {
|
|
|
129
129
|
</div>
|
|
130
130
|
</div>
|
|
131
131
|
|
|
132
|
-
<div class="
|
|
132
|
+
<div class="smrt-product-form__field" data-smrt-part="field">
|
|
133
133
|
<label for="tags">Tags</label>
|
|
134
134
|
<Input
|
|
135
135
|
id="tags"
|
|
@@ -138,23 +138,23 @@ function handleSubmit(event: Event) {
|
|
|
138
138
|
disabled={loading}
|
|
139
139
|
placeholder={t(M['products.product_form.tags_placeholder'])}
|
|
140
140
|
/>
|
|
141
|
-
<small class="
|
|
141
|
+
<small class="smrt-product-form__hint" data-smrt-part="description">{t(M['products.product_form.tags_hint'])}</small>
|
|
142
142
|
</div>
|
|
143
143
|
|
|
144
|
-
<div class="
|
|
145
|
-
<label class="
|
|
144
|
+
<div class="smrt-product-form__field" data-smrt-part="field">
|
|
145
|
+
<label class="smrt-product-form__checkbox-label" data-smrt-part="label">
|
|
146
146
|
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
147
147
|
<input
|
|
148
148
|
type="checkbox"
|
|
149
149
|
bind:checked={formData.inStock}
|
|
150
150
|
disabled={loading}
|
|
151
|
-
class="
|
|
151
|
+
class="smrt-product-form__checkbox" data-smrt-part="input"
|
|
152
152
|
/>
|
|
153
153
|
{t(M['products.product_form.in_stock_label'])}
|
|
154
154
|
</label>
|
|
155
155
|
</div>
|
|
156
156
|
|
|
157
|
-
<div class="
|
|
157
|
+
<div class="smrt-product-form__actions" data-smrt-part="actions">
|
|
158
158
|
{#if onCancel}
|
|
159
159
|
<Button type="button" variant="secondary" onclick={onCancel} disabled={loading}>
|
|
160
160
|
Cancel
|
|
@@ -174,71 +174,75 @@ function handleSubmit(event: Event) {
|
|
|
174
174
|
|
|
175
175
|
<style>
|
|
176
176
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
177
|
-
@layer smrt.
|
|
178
|
-
.product-
|
|
177
|
+
@layer smrt.structure {
|
|
178
|
+
.smrt-product-form__root :global([data-smrt-component="Form"]) {
|
|
179
179
|
max-width: 500px;
|
|
180
180
|
padding: 1.5rem;
|
|
181
|
-
background: var(--smrt-color-surface);
|
|
182
|
-
border-radius: var(--smrt-radius-md);
|
|
183
|
-
border: var(--smrt-hairline);
|
|
184
181
|
}
|
|
185
|
-
|
|
186
|
-
.form-group {
|
|
182
|
+
.smrt-product-form__field {
|
|
187
183
|
margin-bottom: 1rem;
|
|
188
184
|
}
|
|
189
|
-
|
|
190
|
-
.form-row {
|
|
185
|
+
.smrt-product-form__row {
|
|
191
186
|
display: grid;
|
|
192
187
|
grid-template-columns: 1fr 1fr;
|
|
193
188
|
gap: 1rem;
|
|
194
189
|
}
|
|
195
|
-
|
|
196
190
|
label {
|
|
197
191
|
display: block;
|
|
198
192
|
margin-bottom: 0.25rem;
|
|
199
|
-
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
200
|
-
color: var(--smrt-color-on-surface);
|
|
201
|
-
font-size: var(--smrt-typography-label-large-size, 0.875rem);
|
|
202
193
|
}
|
|
203
|
-
|
|
204
|
-
/* Error border on the migrated <Input>. The primitive renders the inner
|
|
205
|
-
<input class="input error"> inside its own component, so the scoped class
|
|
206
|
-
can't reach it without :global (#1589). */
|
|
207
|
-
.product-form-shell :global([data-smrt-component="Input"].error) {
|
|
208
|
-
border-color: var(--smrt-color-error);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.checkbox-label {
|
|
194
|
+
.smrt-product-form__checkbox-label {
|
|
212
195
|
display: flex;
|
|
213
196
|
align-items: center;
|
|
214
197
|
gap: 0.5rem;
|
|
215
198
|
cursor: pointer;
|
|
216
199
|
}
|
|
217
|
-
|
|
218
|
-
.form-checkbox {
|
|
200
|
+
.smrt-product-form__checkbox {
|
|
219
201
|
width: auto;
|
|
220
202
|
}
|
|
221
|
-
|
|
222
|
-
.form-hint {
|
|
223
|
-
color: var(--smrt-color-on-surface-variant);
|
|
224
|
-
font-size: var(--smrt-typography-body-small-size, 0.75rem);
|
|
203
|
+
.smrt-product-form__hint {
|
|
225
204
|
margin-top: 0.25rem;
|
|
226
205
|
}
|
|
227
|
-
|
|
228
|
-
.error-message {
|
|
229
|
-
color: var(--smrt-color-error);
|
|
230
|
-
font-size: var(--smrt-typography-label-medium-size, 0.75rem);
|
|
206
|
+
.smrt-product-form__error-message {
|
|
231
207
|
margin-top: 0.25rem;
|
|
232
208
|
display: block;
|
|
233
209
|
}
|
|
234
|
-
|
|
235
|
-
.form-actions {
|
|
210
|
+
.smrt-product-form__actions {
|
|
236
211
|
display: flex;
|
|
237
212
|
gap: 0.75rem;
|
|
238
213
|
justify-content: flex-end;
|
|
239
214
|
margin-top: 1.5rem;
|
|
240
215
|
padding-top: 1rem;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@layer smrt.theme {
|
|
220
|
+
.smrt-product-form__root :global([data-smrt-component="Form"]) {
|
|
221
|
+
background: var(--smrt-color-surface);
|
|
222
|
+
border-radius: var(--smrt-radius-md);
|
|
223
|
+
border: var(--smrt-hairline);
|
|
224
|
+
}
|
|
225
|
+
label {
|
|
226
|
+
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
227
|
+
color: var(--smrt-color-on-surface);
|
|
228
|
+
font-size: var(--smrt-typography-label-large-size, 0.875rem);
|
|
229
|
+
}
|
|
230
|
+
/* Error border on the migrated <Input>. The primitive forwards `class` onto
|
|
231
|
+
its root element, so the scoped rule can't reach it without :global (#1589). */
|
|
232
|
+
.smrt-product-form__root :global([data-smrt-component="Input"].smrt-product-form__error) {
|
|
233
|
+
border-color: var(--smrt-color-error);
|
|
234
|
+
}
|
|
235
|
+
.smrt-product-form__hint {
|
|
236
|
+
color: var(--smrt-color-on-surface-variant);
|
|
237
|
+
font-size: var(--smrt-typography-body-small-size, 0.75rem);
|
|
238
|
+
}
|
|
239
|
+
.smrt-product-form__error-message {
|
|
240
|
+
color: var(--smrt-color-error);
|
|
241
|
+
font-size: var(--smrt-typography-label-medium-size, 0.75rem);
|
|
242
|
+
}
|
|
243
|
+
.smrt-product-form__actions {
|
|
241
244
|
border-top: var(--smrt-hairline);
|
|
242
245
|
}
|
|
243
246
|
}
|
|
247
|
+
|
|
244
248
|
</style>
|
|
@@ -10,19 +10,25 @@ const { message = 'Hello Federation!' }: Props = $props();
|
|
|
10
10
|
const { t } = useI18n();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
|
-
<div class="test-component">
|
|
13
|
+
<div class="smrt-test-component__root" data-smrt-component="TestComponent">
|
|
14
14
|
<h3>{t(M['products.test_component.title'])}</h3>
|
|
15
15
|
<p>{message}</p>
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
18
|
<style>
|
|
19
19
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
20
|
-
@layer smrt.
|
|
21
|
-
.test-
|
|
20
|
+
@layer smrt.structure {
|
|
21
|
+
.smrt-test-component__root {
|
|
22
22
|
padding: 1rem;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@layer smrt.theme {
|
|
27
|
+
.smrt-test-component__root {
|
|
23
28
|
border: var(--smrt-hairline);
|
|
24
29
|
border-radius: var(--smrt-radius-sm);
|
|
25
30
|
background: var(--smrt-color-surface-container-low);
|
|
26
31
|
}
|
|
27
32
|
}
|
|
33
|
+
|
|
28
34
|
</style>
|
|
@@ -108,16 +108,16 @@ function _getFieldType(
|
|
|
108
108
|
}
|
|
109
109
|
</script>
|
|
110
110
|
|
|
111
|
-
<div class="auto-
|
|
112
|
-
<header class="
|
|
113
|
-
<h2 class="
|
|
114
|
-
<div class="
|
|
111
|
+
<div class="smrt-auto-form__root" data-smrt-component="AutoForm">
|
|
112
|
+
<header class="smrt-auto-form__header" data-smrt-part="header">
|
|
113
|
+
<h2 class="smrt-auto-form__title" data-smrt-part="title">{title}</h2>
|
|
114
|
+
<div class="smrt-auto-form__subtitle" data-smrt-part="meta">
|
|
115
115
|
{t(M['products.auto_form.subtitle'])}
|
|
116
116
|
</div>
|
|
117
117
|
</header>
|
|
118
118
|
|
|
119
|
-
<div class="
|
|
120
|
-
<Form class="
|
|
119
|
+
<div class="smrt-auto-form__content-shell" data-smrt-part="body">
|
|
120
|
+
<Form class="smrt-auto-form__content" onsubmit={handleSubmit}>
|
|
121
121
|
{#each fieldSchema as field}
|
|
122
122
|
<FieldRenderer
|
|
123
123
|
fieldName={field.name}
|
|
@@ -132,7 +132,7 @@ function _getFieldType(
|
|
|
132
132
|
{/each}
|
|
133
133
|
|
|
134
134
|
{#if !readonly}
|
|
135
|
-
<div class="
|
|
135
|
+
<div class="smrt-auto-form__actions" data-smrt-part="actions">
|
|
136
136
|
<Button type="submit" variant="primary">
|
|
137
137
|
{submitLabel}
|
|
138
138
|
</Button>
|
|
@@ -145,7 +145,7 @@ function _getFieldType(
|
|
|
145
145
|
</div>
|
|
146
146
|
|
|
147
147
|
<!-- Demo: Show current form state -->
|
|
148
|
-
<details class="
|
|
148
|
+
<details class="smrt-auto-form__debug" data-smrt-part="panel">
|
|
149
149
|
<summary>{t(M['products.auto_form.debug_summary'])}</summary>
|
|
150
150
|
<pre>{JSON.stringify(formData, null, 2)}</pre>
|
|
151
151
|
</details>
|
|
@@ -153,68 +153,78 @@ function _getFieldType(
|
|
|
153
153
|
|
|
154
154
|
<style>
|
|
155
155
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
156
|
-
@layer smrt.
|
|
157
|
-
.auto-
|
|
156
|
+
@layer smrt.structure {
|
|
157
|
+
.smrt-auto-form__root {
|
|
158
158
|
max-width: 600px;
|
|
159
159
|
margin: 0 auto;
|
|
160
160
|
padding: 1.5rem;
|
|
161
|
-
background: var(--smrt-color-surface);
|
|
162
|
-
border-radius: var(--smrt-radius-md);
|
|
163
|
-
box-shadow: var(--smrt-elevation-1, 0 1px 3px color-mix(in srgb, var(--smrt-color-shadow) 10%, transparent));
|
|
164
161
|
}
|
|
165
|
-
|
|
166
|
-
.form-header {
|
|
162
|
+
.smrt-auto-form__header {
|
|
167
163
|
margin-bottom: 2rem;
|
|
168
|
-
text-align: center;
|
|
169
164
|
}
|
|
170
|
-
|
|
171
|
-
.form-title {
|
|
172
|
-
font-size: var(--smrt-typography-headline-small-size, 1.5rem);
|
|
173
|
-
font-weight: var(--smrt-typography-weight-semibold, 600);
|
|
174
|
-
color: var(--smrt-color-on-surface);
|
|
165
|
+
.smrt-auto-form__title {
|
|
175
166
|
margin: 0 0 0.5rem 0;
|
|
176
167
|
}
|
|
177
|
-
|
|
178
|
-
.form-subtitle {
|
|
179
|
-
font-size: var(--smrt-typography-body-medium-size, 0.875rem);
|
|
180
|
-
color: var(--smrt-color-on-surface-variant);
|
|
181
|
-
font-style: italic;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.form-content-shell :global(.form-content) {
|
|
168
|
+
.smrt-auto-form__content-shell :global([data-smrt-component="Form"]) {
|
|
185
169
|
display: flex;
|
|
186
170
|
flex-direction: column;
|
|
187
171
|
gap: 1rem;
|
|
188
172
|
}
|
|
189
|
-
|
|
190
|
-
.form-actions {
|
|
173
|
+
.smrt-auto-form__actions {
|
|
191
174
|
display: flex;
|
|
192
175
|
gap: 0.75rem;
|
|
193
176
|
margin-top: 1.5rem;
|
|
194
177
|
padding-top: 1.5rem;
|
|
195
|
-
border-top: var(--smrt-hairline);
|
|
196
178
|
}
|
|
197
|
-
|
|
198
|
-
.form-debug {
|
|
179
|
+
.smrt-auto-form__debug {
|
|
199
180
|
margin-top: 2rem;
|
|
200
181
|
padding: 1rem;
|
|
182
|
+
}
|
|
183
|
+
.smrt-auto-form__debug summary {
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
}
|
|
186
|
+
.smrt-auto-form__debug pre {
|
|
187
|
+
margin-top: 0.5rem;
|
|
188
|
+
white-space: pre-wrap;
|
|
189
|
+
word-break: break-word;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@layer smrt.theme {
|
|
194
|
+
.smrt-auto-form__root {
|
|
195
|
+
background: var(--smrt-color-surface);
|
|
196
|
+
border-radius: var(--smrt-radius-md);
|
|
197
|
+
box-shadow: var(--smrt-elevation-1, 0 1px 3px color-mix(in srgb, var(--smrt-color-shadow) 10%, transparent));
|
|
198
|
+
}
|
|
199
|
+
.smrt-auto-form__header {
|
|
200
|
+
text-align: center;
|
|
201
|
+
}
|
|
202
|
+
.smrt-auto-form__title {
|
|
203
|
+
font-size: var(--smrt-typography-headline-small-size, 1.5rem);
|
|
204
|
+
font-weight: var(--smrt-typography-weight-semibold, 600);
|
|
205
|
+
color: var(--smrt-color-on-surface);
|
|
206
|
+
}
|
|
207
|
+
.smrt-auto-form__subtitle {
|
|
208
|
+
font-size: var(--smrt-typography-body-medium-size, 0.875rem);
|
|
209
|
+
color: var(--smrt-color-on-surface-variant);
|
|
210
|
+
font-style: italic;
|
|
211
|
+
}
|
|
212
|
+
.smrt-auto-form__actions {
|
|
213
|
+
border-top: var(--smrt-hairline);
|
|
214
|
+
}
|
|
215
|
+
.smrt-auto-form__debug {
|
|
201
216
|
background: var(--smrt-color-surface-container-low);
|
|
202
217
|
border-radius: var(--smrt-radius-sm, 0.375rem);
|
|
203
218
|
border: var(--smrt-hairline);
|
|
204
219
|
}
|
|
205
|
-
|
|
206
|
-
.form-debug summary {
|
|
207
|
-
cursor: pointer;
|
|
220
|
+
.smrt-auto-form__debug summary {
|
|
208
221
|
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
209
222
|
color: var(--smrt-color-on-surface);
|
|
210
223
|
}
|
|
211
|
-
|
|
212
|
-
.form-debug pre {
|
|
213
|
-
margin-top: 0.5rem;
|
|
224
|
+
.smrt-auto-form__debug pre {
|
|
214
225
|
font-size: var(--smrt-typography-body-small-size, 0.75rem);
|
|
215
226
|
color: var(--smrt-color-on-surface-variant);
|
|
216
|
-
white-space: pre-wrap;
|
|
217
|
-
word-break: break-word;
|
|
218
227
|
}
|
|
219
228
|
}
|
|
229
|
+
|
|
220
230
|
</style>
|
|
@@ -87,10 +87,10 @@ function handleObjectInput(event: Event) {
|
|
|
87
87
|
}
|
|
88
88
|
</script>
|
|
89
89
|
|
|
90
|
-
<div class="field-
|
|
91
|
-
<label for={fieldId} class="field-label">
|
|
90
|
+
<div class="smrt-field-renderer__root" data-smrt-component="FieldRenderer">
|
|
91
|
+
<label for={fieldId} class="smrt-field-renderer__label" data-smrt-part="label">
|
|
92
92
|
{displayLabel}
|
|
93
|
-
{#if required}<span class="
|
|
93
|
+
{#if required}<span class="smrt-field-renderer__required" data-smrt-part="marker">*</span>{/if}
|
|
94
94
|
</label>
|
|
95
95
|
|
|
96
96
|
{#if fieldType === 'string'}
|
|
@@ -118,7 +118,7 @@ function handleObjectInput(event: Event) {
|
|
|
118
118
|
<input
|
|
119
119
|
id={fieldId}
|
|
120
120
|
type="checkbox"
|
|
121
|
-
class="field-
|
|
121
|
+
class="smrt-field-renderer__checkbox" data-smrt-part="input"
|
|
122
122
|
checked={Boolean(value)}
|
|
123
123
|
{readonly}
|
|
124
124
|
onchange={handleBooleanInput}
|
|
@@ -132,7 +132,7 @@ function handleObjectInput(event: Event) {
|
|
|
132
132
|
{required}
|
|
133
133
|
oninput={handleArrayInput}
|
|
134
134
|
></Textarea>
|
|
135
|
-
<div class="field-
|
|
135
|
+
<div class="smrt-field-renderer__hint" data-smrt-part="description">{t(M['products.field_renderer.array_hint'])}</div>
|
|
136
136
|
{:else if fieldType === 'object'}
|
|
137
137
|
<Textarea
|
|
138
138
|
id={fieldId}
|
|
@@ -142,39 +142,39 @@ function handleObjectInput(event: Event) {
|
|
|
142
142
|
{required}
|
|
143
143
|
oninput={handleObjectInput}
|
|
144
144
|
></Textarea>
|
|
145
|
-
<div class="field-
|
|
145
|
+
<div class="smrt-field-renderer__hint" data-smrt-part="description">{t(M['products.field_renderer.object_hint'])}</div>
|
|
146
146
|
{/if}
|
|
147
147
|
</div>
|
|
148
148
|
|
|
149
149
|
<style>
|
|
150
150
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
151
|
-
@layer smrt.
|
|
152
|
-
.field-
|
|
151
|
+
@layer smrt.structure {
|
|
152
|
+
.smrt-field-renderer__root {
|
|
153
153
|
display: flex;
|
|
154
154
|
flex-direction: column;
|
|
155
155
|
gap: 0.5rem;
|
|
156
156
|
margin-bottom: 1rem;
|
|
157
157
|
}
|
|
158
|
+
.smrt-field-renderer__checkbox {
|
|
159
|
+
width: 1rem;
|
|
160
|
+
height: 1rem;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
158
163
|
|
|
159
|
-
|
|
164
|
+
@layer smrt.theme {
|
|
165
|
+
.smrt-field-renderer__label {
|
|
160
166
|
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
161
167
|
color: var(--smrt-color-on-surface);
|
|
162
168
|
font-size: var(--smrt-typography-label-large-size, 0.875rem);
|
|
163
169
|
}
|
|
164
|
-
|
|
165
|
-
.required {
|
|
170
|
+
.smrt-field-renderer__required {
|
|
166
171
|
color: var(--smrt-color-error);
|
|
167
172
|
}
|
|
168
|
-
|
|
169
|
-
.field-checkbox {
|
|
170
|
-
width: 1rem;
|
|
171
|
-
height: 1rem;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.field-hint {
|
|
173
|
+
.smrt-field-renderer__hint {
|
|
175
174
|
font-size: var(--smrt-typography-body-small-size, 0.75rem);
|
|
176
175
|
color: var(--smrt-color-on-surface-variant);
|
|
177
176
|
font-style: italic;
|
|
178
177
|
}
|
|
179
178
|
}
|
|
179
|
+
|
|
180
180
|
</style>
|
|
@@ -16,13 +16,13 @@ const _categories = $state<CategoryData[]>([]);
|
|
|
16
16
|
const _loading = $state(false);
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
|
-
<div class="category-
|
|
20
|
-
<div class="
|
|
19
|
+
<div class="smrt-category-manager__root" data-smrt-component="CategoryManager">
|
|
20
|
+
<div class="smrt-category-manager__header" data-smrt-part="header">
|
|
21
21
|
<h2>{t(M['products.category_manager.title'])}</h2>
|
|
22
22
|
<p>{t(M['products.category_manager.subtitle'])}</p>
|
|
23
23
|
</div>
|
|
24
24
|
|
|
25
|
-
<div class="
|
|
25
|
+
<div class="smrt-category-manager__content" data-smrt-part="body">
|
|
26
26
|
<p>{t(M['products.category_manager.coming_soon'])}</p>
|
|
27
27
|
<p>{t(M['products.category_manager.will_include'])}</p>
|
|
28
28
|
<ul>
|
|
@@ -36,48 +36,58 @@ const _loading = $state(false);
|
|
|
36
36
|
|
|
37
37
|
<style>
|
|
38
38
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
39
|
-
@layer smrt.
|
|
40
|
-
.category-
|
|
39
|
+
@layer smrt.structure {
|
|
40
|
+
.smrt-category-manager__root {
|
|
41
41
|
max-width: 800px;
|
|
42
42
|
margin: 0 auto;
|
|
43
43
|
padding: 1rem;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
.manager-header {
|
|
47
|
-
text-align: center;
|
|
45
|
+
.smrt-category-manager__header {
|
|
48
46
|
margin-bottom: 2rem;
|
|
49
47
|
}
|
|
50
|
-
|
|
51
|
-
.manager-header h2 {
|
|
48
|
+
.smrt-category-manager__header h2 {
|
|
52
49
|
margin: 0 0 0.5rem 0;
|
|
50
|
+
}
|
|
51
|
+
.smrt-category-manager__header p {
|
|
52
|
+
margin: 0;
|
|
53
|
+
}
|
|
54
|
+
.smrt-category-manager__content {
|
|
55
|
+
padding: 2rem;
|
|
56
|
+
}
|
|
57
|
+
.smrt-category-manager__content p {
|
|
58
|
+
margin: 0 0 1rem 0;
|
|
59
|
+
}
|
|
60
|
+
.smrt-category-manager__content ul {
|
|
61
|
+
margin: 1rem 0 0 0;
|
|
62
|
+
display: inline-block;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@layer smrt.theme {
|
|
67
|
+
.smrt-category-manager__header {
|
|
68
|
+
text-align: center;
|
|
69
|
+
}
|
|
70
|
+
.smrt-category-manager__header h2 {
|
|
53
71
|
color: var(--smrt-color-on-surface);
|
|
54
72
|
font-size: var(--smrt-typography-headline-small-size, 1.5rem);
|
|
55
73
|
font-weight: var(--smrt-typography-weight-semibold, 600);
|
|
56
74
|
}
|
|
57
|
-
|
|
58
|
-
.manager-header p {
|
|
59
|
-
margin: 0;
|
|
75
|
+
.smrt-category-manager__header p {
|
|
60
76
|
color: var(--smrt-color-on-surface-variant);
|
|
61
77
|
}
|
|
62
|
-
|
|
63
|
-
.placeholder-content {
|
|
78
|
+
.smrt-category-manager__content {
|
|
64
79
|
background: var(--smrt-color-surface-container-low);
|
|
65
80
|
border: var(--smrt-hairline);
|
|
66
81
|
border-radius: var(--smrt-radius-md);
|
|
67
|
-
padding: 2rem;
|
|
68
82
|
text-align: center;
|
|
69
83
|
}
|
|
70
|
-
|
|
71
|
-
.placeholder-content p {
|
|
72
|
-
margin: 0 0 1rem 0;
|
|
84
|
+
.smrt-category-manager__content p {
|
|
73
85
|
color: var(--smrt-color-on-surface-variant);
|
|
74
86
|
}
|
|
75
|
-
|
|
76
|
-
.placeholder-content ul {
|
|
77
|
-
margin: 1rem 0 0 0;
|
|
87
|
+
.smrt-category-manager__content ul {
|
|
78
88
|
text-align: left;
|
|
79
|
-
display: inline-block;
|
|
80
89
|
color: var(--smrt-color-on-surface-variant);
|
|
81
90
|
}
|
|
82
91
|
}
|
|
92
|
+
|
|
83
93
|
</style>
|