@almadar/std 13.0.1 → 13.0.3

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-pagination",
3
3
  "version": "1.0.0",
4
- "description": "std-pagination as a Function",
4
+ "description": "std-pagination as a Function — single primitive: pagination + infinite-scroll-sentinel",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "PagedItemOrbital",
@@ -142,8 +142,8 @@
142
142
  "PagedItem",
143
143
  {
144
144
  "emit": {
145
- "failure": "PagedItemLoadFailed",
146
- "success": "PagedItemLoaded"
145
+ "success": "PagedItemLoaded",
146
+ "failure": "PagedItemLoadFailed"
147
147
  }
148
148
  }
149
149
  ],
@@ -151,22 +151,8 @@
151
151
  "render-ui",
152
152
  "main",
153
153
  {
154
- "direction": "vertical",
155
- "gap": "md",
156
- "children": [
157
- {
158
- "type": "spinner"
159
- },
160
- {
161
- "content": "Loading…",
162
- "variant": "caption",
163
- "type": "typography",
164
- "color": "muted"
165
- }
166
- ],
167
- "type": "stack",
168
- "align": "center",
169
- "className": "py-12"
154
+ "type": "spinner",
155
+ "size": "sm"
170
156
  }
171
157
  ]
172
158
  ]
@@ -180,72 +166,22 @@
180
166
  "render-ui",
181
167
  "main",
182
168
  {
169
+ "type": "stack",
170
+ "gap": "sm",
183
171
  "children": [
184
172
  {
185
- "align": "center",
186
- "direction": "horizontal",
187
- "type": "stack",
188
- "justify": "between",
189
- "children": [
190
- {
191
- "align": "center",
192
- "direction": "horizontal",
193
- "gap": "sm",
194
- "children": [
195
- {
196
- "type": "icon",
197
- "name": "list"
198
- },
199
- {
200
- "content": "PagedItems",
201
- "variant": "h2",
202
- "type": "typography"
203
- }
204
- ],
205
- "type": "stack"
206
- }
207
- ],
208
- "gap": "sm"
209
- },
210
- {
211
- "type": "divider"
212
- },
213
- {
214
- "type": "data-grid",
215
- "fields": [
216
- {
217
- "variant": "h4",
218
- "name": "name",
219
- "label": "Name"
220
- },
221
- {
222
- "name": "description",
223
- "variant": "caption",
224
- "label": "Description"
225
- },
226
- {
227
- "name": "status",
228
- "label": "Status",
229
- "variant": "badge"
230
- }
231
- ],
232
- "entity": "@payload.data"
233
- },
234
- {
235
- "showPageSize": false,
236
- "onPageChange": "PAGE",
237
- "totalPages": 10.0,
173
+ "totalPages": "@config.totalPages",
174
+ "currentPage": 1.0,
238
175
  "type": "pagination",
239
- "currentPage": 1.0
176
+ "onPageChange": "@config.event",
177
+ "showPageSize": false
240
178
  },
241
179
  {
242
- "loadMoreEvent": "PAGE",
243
- "type": "infinite-scroll-sentinel"
180
+ "type": "infinite-scroll-sentinel",
181
+ "loadMoreEvent": "@config.event"
244
182
  }
245
183
  ],
246
- "direction": "vertical",
247
- "gap": "lg",
248
- "type": "stack"
184
+ "direction": "vertical"
249
185
  }
250
186
  ]
251
187
  ]
@@ -260,35 +196,34 @@
260
196
  "main",
261
197
  {
262
198
  "type": "stack",
263
- "align": "center",
264
199
  "children": [
265
200
  {
266
- "type": "icon",
267
- "name": "alert-triangle",
268
- "color": "destructive"
201
+ "gap": "sm",
202
+ "children": [
203
+ {
204
+ "type": "pagination",
205
+ "onPageChange": "@config.event",
206
+ "totalPages": "@config.totalPages",
207
+ "currentPage": 1.0,
208
+ "showPageSize": false
209
+ },
210
+ {
211
+ "type": "infinite-scroll-sentinel",
212
+ "loadMoreEvent": "@config.event"
213
+ }
214
+ ],
215
+ "direction": "vertical",
216
+ "type": "stack"
269
217
  },
270
218
  {
271
- "content": "Failed to load",
272
- "variant": "h3",
219
+ "variant": "caption",
220
+ "color": "error",
221
+ "content": "@payload.error",
273
222
  "type": "typography"
274
- },
275
- {
276
- "type": "typography",
277
- "variant": "body",
278
- "color": "muted",
279
- "content": "@payload.error"
280
- },
281
- {
282
- "variant": "primary",
283
- "type": "button",
284
- "action": "INIT",
285
- "icon": "rotate-ccw",
286
- "label": "Retry"
287
223
  }
288
224
  ],
289
- "direction": "vertical",
290
- "className": "py-12",
291
- "gap": "md"
225
+ "gap": "xs",
226
+ "direction": "vertical"
292
227
  }
293
228
  ]
294
229
  ]
@@ -303,8 +238,8 @@
303
238
  "PagedItem",
304
239
  {
305
240
  "emit": {
306
- "failure": "PagedItemLoadFailed",
307
- "success": "PagedItemLoaded"
241
+ "success": "PagedItemLoaded",
242
+ "failure": "PagedItemLoadFailed"
308
243
  }
309
244
  }
310
245
  ],
@@ -312,7 +247,34 @@
312
247
  "render-ui",
313
248
  "main",
314
249
  {
315
- "type": "spinner"
250
+ "direction": "horizontal",
251
+ "gap": "sm",
252
+ "align": "center",
253
+ "type": "stack",
254
+ "children": [
255
+ {
256
+ "gap": "sm",
257
+ "type": "stack",
258
+ "children": [
259
+ {
260
+ "showPageSize": false,
261
+ "type": "pagination",
262
+ "totalPages": "@config.totalPages",
263
+ "currentPage": 1.0,
264
+ "onPageChange": "@config.event"
265
+ },
266
+ {
267
+ "type": "infinite-scroll-sentinel",
268
+ "loadMoreEvent": "@config.event"
269
+ }
270
+ ],
271
+ "direction": "vertical"
272
+ },
273
+ {
274
+ "type": "spinner",
275
+ "size": "sm"
276
+ }
277
+ ]
316
278
  }
317
279
  ]
318
280
  ]
@@ -336,13 +298,24 @@
336
298
  "render-ui",
337
299
  "main",
338
300
  {
339
- "type": "spinner"
301
+ "type": "spinner",
302
+ "size": "sm"
340
303
  }
341
304
  ]
342
305
  ]
343
306
  }
344
307
  ]
345
308
  },
309
+ "config": {
310
+ "totalPages": {
311
+ "type": "number",
312
+ "default": 10.0
313
+ },
314
+ "event": {
315
+ "type": "string",
316
+ "default": "PAGE"
317
+ }
318
+ },
346
319
  "scope": "collection"
347
320
  }
348
321
  ],
@@ -359,4 +332,4 @@
359
332
  ]
360
333
  }
361
334
  ]
362
- }
335
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-search",
3
3
  "version": "1.0.0",
4
- "description": "std-search as a Function",
4
+ "description": "std-search as a Function — single primitive: search-input",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "SearchResultOrbital",
@@ -142,8 +142,8 @@
142
142
  "SearchResult",
143
143
  {
144
144
  "emit": {
145
- "failure": "SearchResultLoadFailed",
146
- "success": "SearchResultLoaded"
145
+ "success": "SearchResultLoaded",
146
+ "failure": "SearchResultLoadFailed"
147
147
  }
148
148
  }
149
149
  ],
@@ -151,42 +151,9 @@
151
151
  "render-ui",
152
152
  "main",
153
153
  {
154
- "direction": "vertical",
155
- "gap": "lg",
156
- "children": [
157
- {
158
- "direction": "horizontal",
159
- "gap": "md",
160
- "type": "stack",
161
- "align": "center",
162
- "children": [
163
- {
164
- "name": "search",
165
- "type": "icon"
166
- },
167
- {
168
- "variant": "h2",
169
- "content": "Search SearchResults",
170
- "type": "typography"
171
- }
172
- ]
173
- },
174
- {
175
- "type": "divider"
176
- },
177
- {
178
- "type": "search-input",
179
- "event": "SEARCH",
180
- "placeholder": "Search..."
181
- },
182
- {
183
- "type": "empty-state",
184
- "icon": "search",
185
- "title": "Search to find results",
186
- "description": "Type a query to search across searchresults."
187
- }
188
- ],
189
- "type": "stack"
154
+ "event": "@config.event",
155
+ "placeholder": "@config.placeholder",
156
+ "type": "search-input"
190
157
  }
191
158
  ]
192
159
  ]
@@ -201,8 +168,8 @@
201
168
  "SearchResult",
202
169
  {
203
170
  "emit": {
204
- "failure": "SearchResultLoadFailed",
205
- "success": "SearchResultLoaded"
171
+ "success": "SearchResultLoaded",
172
+ "failure": "SearchResultLoadFailed"
206
173
  }
207
174
  }
208
175
  ],
@@ -210,27 +177,21 @@
210
177
  "render-ui",
211
178
  "main",
212
179
  {
213
- "direction": "vertical",
214
- "type": "stack",
215
- "align": "center",
216
- "className": "py-8",
217
- "gap": "md",
218
180
  "children": [
219
181
  {
220
- "type": "spinner"
182
+ "type": "search-input",
183
+ "event": "@config.event",
184
+ "placeholder": "@config.placeholder"
221
185
  },
222
186
  {
223
- "type": "typography",
224
- "color": "muted",
225
- "variant": "caption",
226
- "content": [
227
- "str/concat",
228
- "Searching for \"",
229
- "@payload.query",
230
- "\"…"
231
- ]
187
+ "size": "sm",
188
+ "type": "spinner"
232
189
  }
233
- ]
190
+ ],
191
+ "type": "stack",
192
+ "direction": "horizontal",
193
+ "gap": "sm",
194
+ "align": "center"
234
195
  }
235
196
  ]
236
197
  ]
@@ -244,68 +205,9 @@
244
205
  "render-ui",
245
206
  "main",
246
207
  {
247
- "type": "stack",
248
- "direction": "vertical",
249
- "children": [
250
- {
251
- "children": [
252
- {
253
- "type": "stack",
254
- "gap": "md",
255
- "align": "center",
256
- "direction": "horizontal",
257
- "children": [
258
- {
259
- "type": "icon",
260
- "name": "search"
261
- },
262
- {
263
- "variant": "h2",
264
- "content": "Results",
265
- "type": "typography"
266
- }
267
- ]
268
- },
269
- {
270
- "action": "CLEAR",
271
- "type": "button",
272
- "icon": "x",
273
- "label": "Clear",
274
- "variant": "ghost"
275
- }
276
- ],
277
- "type": "stack",
278
- "gap": "md",
279
- "justify": "between",
280
- "direction": "horizontal",
281
- "align": "center"
282
- },
283
- {
284
- "type": "divider"
285
- },
286
- {
287
- "type": "data-grid",
288
- "renderItem": [
289
- "fn",
290
- "item",
291
- {
292
- "gap": "sm",
293
- "direction": "vertical",
294
- "type": "stack",
295
- "children": [
296
- {
297
- "variant": "h4",
298
- "content": "@item.name",
299
- "type": "typography"
300
- }
301
- ]
302
- }
303
- ],
304
- "entity": "@payload.data",
305
- "fields": []
306
- }
307
- ],
308
- "gap": "lg"
208
+ "event": "@config.event",
209
+ "placeholder": "@config.placeholder",
210
+ "type": "search-input"
309
211
  }
310
212
  ]
311
213
  ]
@@ -319,34 +221,20 @@
319
221
  "render-ui",
320
222
  "main",
321
223
  {
322
- "align": "center",
323
- "className": "py-8",
324
- "type": "stack",
224
+ "gap": "xs",
325
225
  "direction": "vertical",
326
- "gap": "md",
226
+ "type": "stack",
327
227
  "children": [
328
228
  {
329
- "type": "icon",
330
- "color": "destructive",
331
- "name": "alert-triangle"
332
- },
333
- {
334
- "content": "Search failed",
335
- "type": "typography",
336
- "variant": "body"
229
+ "event": "@config.event",
230
+ "placeholder": "@config.placeholder",
231
+ "type": "search-input"
337
232
  },
338
233
  {
339
- "type": "typography",
340
- "color": "muted",
341
234
  "content": "@payload.error",
235
+ "type": "typography",
236
+ "color": "error",
342
237
  "variant": "caption"
343
- },
344
- {
345
- "action": "SEARCH",
346
- "label": "Retry",
347
- "icon": "rotate-ccw",
348
- "type": "button",
349
- "variant": "ghost"
350
238
  }
351
239
  ]
352
240
  }
@@ -363,8 +251,8 @@
363
251
  "SearchResult",
364
252
  {
365
253
  "emit": {
366
- "failure": "SearchResultLoadFailed",
367
- "success": "SearchResultLoaded"
254
+ "success": "SearchResultLoaded",
255
+ "failure": "SearchResultLoadFailed"
368
256
  }
369
257
  }
370
258
  ],
@@ -372,7 +260,21 @@
372
260
  "render-ui",
373
261
  "main",
374
262
  {
375
- "type": "spinner"
263
+ "children": [
264
+ {
265
+ "placeholder": "@config.placeholder",
266
+ "type": "search-input",
267
+ "event": "@config.event"
268
+ },
269
+ {
270
+ "type": "spinner",
271
+ "size": "sm"
272
+ }
273
+ ],
274
+ "type": "stack",
275
+ "gap": "sm",
276
+ "align": "center",
277
+ "direction": "horizontal"
376
278
  }
377
279
  ]
378
280
  ]
@@ -387,8 +289,8 @@
387
289
  "SearchResult",
388
290
  {
389
291
  "emit": {
390
- "failure": "SearchResultLoadFailed",
391
- "success": "SearchResultLoaded"
292
+ "success": "SearchResultLoaded",
293
+ "failure": "SearchResultLoadFailed"
392
294
  }
393
295
  }
394
296
  ],
@@ -396,7 +298,21 @@
396
298
  "render-ui",
397
299
  "main",
398
300
  {
399
- "type": "spinner"
301
+ "children": [
302
+ {
303
+ "placeholder": "@config.placeholder",
304
+ "event": "@config.event",
305
+ "type": "search-input"
306
+ },
307
+ {
308
+ "type": "spinner",
309
+ "size": "sm"
310
+ }
311
+ ],
312
+ "direction": "horizontal",
313
+ "gap": "sm",
314
+ "type": "stack",
315
+ "align": "center"
400
316
  }
401
317
  ]
402
318
  ]
@@ -406,56 +322,13 @@
406
322
  "to": "idle",
407
323
  "event": "CLEAR",
408
324
  "effects": [
409
- [
410
- "fetch",
411
- "SearchResult",
412
- {
413
- "emit": {
414
- "failure": "SearchResultLoadFailed",
415
- "success": "SearchResultLoaded"
416
- }
417
- }
418
- ],
419
325
  [
420
326
  "render-ui",
421
327
  "main",
422
328
  {
423
- "direction": "vertical",
424
- "gap": "lg",
425
- "children": [
426
- {
427
- "align": "center",
428
- "type": "stack",
429
- "gap": "md",
430
- "children": [
431
- {
432
- "name": "search",
433
- "type": "icon"
434
- },
435
- {
436
- "variant": "h2",
437
- "type": "typography",
438
- "content": "Search SearchResults"
439
- }
440
- ],
441
- "direction": "horizontal"
442
- },
443
- {
444
- "type": "divider"
445
- },
446
- {
447
- "type": "search-input",
448
- "placeholder": "Search...",
449
- "event": "SEARCH"
450
- },
451
- {
452
- "type": "empty-state",
453
- "icon": "search",
454
- "title": "Search to find results",
455
- "description": "Type a query to search across searchresults."
456
- }
457
- ],
458
- "type": "stack"
329
+ "event": "@config.event",
330
+ "placeholder": "@config.placeholder",
331
+ "type": "search-input"
459
332
  }
460
333
  ]
461
334
  ]
@@ -470,8 +343,8 @@
470
343
  "SearchResult",
471
344
  {
472
345
  "emit": {
473
- "failure": "SearchResultLoadFailed",
474
- "success": "SearchResultLoaded"
346
+ "success": "SearchResultLoaded",
347
+ "failure": "SearchResultLoadFailed"
475
348
  }
476
349
  }
477
350
  ],
@@ -479,13 +352,37 @@
479
352
  "render-ui",
480
353
  "main",
481
354
  {
482
- "type": "spinner"
355
+ "direction": "horizontal",
356
+ "children": [
357
+ {
358
+ "placeholder": "@config.placeholder",
359
+ "event": "@config.event",
360
+ "type": "search-input"
361
+ },
362
+ {
363
+ "type": "spinner",
364
+ "size": "sm"
365
+ }
366
+ ],
367
+ "gap": "sm",
368
+ "align": "center",
369
+ "type": "stack"
483
370
  }
484
371
  ]
485
372
  ]
486
373
  }
487
374
  ]
488
375
  },
376
+ "config": {
377
+ "placeholder": {
378
+ "type": "string",
379
+ "default": "Search…"
380
+ },
381
+ "event": {
382
+ "type": "string",
383
+ "default": "SEARCH"
384
+ }
385
+ },
489
386
  "scope": "collection"
490
387
  }
491
388
  ],
@@ -502,4 +399,4 @@
502
399
  ]
503
400
  }
504
401
  ]
505
- }
402
+ }