@ezpg/app-ui 0.20.0 → 0.21.0
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/CHANGELOG.md +14 -0
- package/lib/module/blocks/choice-art/choice-art.js +589 -0
- package/lib/module/blocks/choice-art/choice-art.js.map +1 -0
- package/lib/module/blocks/choice-art/index.js +4 -0
- package/lib/module/blocks/choice-art/index.js.map +1 -0
- package/lib/module/blocks/index.js +1 -0
- package/lib/module/blocks/index.js.map +1 -1
- package/lib/module/components/page-header/page-header.js +25 -1
- package/lib/module/components/page-header/page-header.js.map +1 -1
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/components/toast/toast.js +8 -4
- package/lib/module/components/toast/toast.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/glyphs.js +457 -0
- package/lib/module/internal/glyphs.js.map +1 -1
- package/lib/module/templates/index.js +1 -0
- package/lib/module/templates/index.js.map +1 -1
- package/lib/module/templates/preview-edit-template.js +422 -0
- package/lib/module/templates/preview-edit-template.js.map +1 -0
- package/lib/typescript/src/blocks/choice-art/choice-art.d.ts +73 -0
- package/lib/typescript/src/blocks/choice-art/choice-art.d.ts.map +1 -0
- package/lib/typescript/src/blocks/choice-art/index.d.ts +2 -0
- package/lib/typescript/src/blocks/choice-art/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/index.d.ts +1 -0
- package/lib/typescript/src/blocks/index.d.ts.map +1 -1
- package/lib/typescript/src/components/page-header/page-header.d.ts +1 -0
- package/lib/typescript/src/components/page-header/page-header.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts +1 -1
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/toast.d.ts +4 -1
- package/lib/typescript/src/components/toast/toast.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/internal/glyphs.d.ts +12 -0
- package/lib/typescript/src/internal/glyphs.d.ts.map +1 -1
- package/lib/typescript/src/templates/index.d.ts +2 -0
- package/lib/typescript/src/templates/index.d.ts.map +1 -1
- package/lib/typescript/src/templates/preview-edit-template.d.ts +39 -0
- package/lib/typescript/src/templates/preview-edit-template.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/blocks/choice-art/choice-art.tsx +500 -0
- package/src/blocks/choice-art/index.ts +29 -0
- package/src/blocks/index.tsx +1 -0
- package/src/components/page-header/page-header.tsx +28 -1
- package/src/components/toast/index.ts +1 -0
- package/src/components/toast/toast.tsx +12 -4
- package/src/index.tsx +12 -0
- package/src/internal/glyphs.tsx +409 -0
- package/src/templates/index.ts +7 -0
- package/src/templates/preview-edit-template.tsx +467 -0
package/src/internal/glyphs.tsx
CHANGED
|
@@ -320,3 +320,412 @@ export const SlidersGlyph = imageGlyph(SLIDERS);
|
|
|
320
320
|
export const CropGlyph = imageGlyph(CROP);
|
|
321
321
|
export const EraserGlyph = imageGlyph(ERASER);
|
|
322
322
|
export const BucketGlyph = imageGlyph(BUCKET);
|
|
323
|
+
|
|
324
|
+
function lineOf(size: number) {
|
|
325
|
+
return Math.max(1.5, size / 12);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export function MonitorGlyph({ color, size }: IconRenderProps) {
|
|
329
|
+
const stroke = lineOf(size);
|
|
330
|
+
return (
|
|
331
|
+
<View style={{ width: size, height: size, alignItems: 'center' }}>
|
|
332
|
+
<View
|
|
333
|
+
style={{
|
|
334
|
+
marginTop: size * 0.16,
|
|
335
|
+
width: size * 0.8,
|
|
336
|
+
height: size * 0.54,
|
|
337
|
+
borderWidth: stroke,
|
|
338
|
+
borderRadius: size * 0.08,
|
|
339
|
+
borderColor: color,
|
|
340
|
+
}}
|
|
341
|
+
/>
|
|
342
|
+
<View
|
|
343
|
+
style={{ width: stroke, height: size * 0.12, backgroundColor: color }}
|
|
344
|
+
/>
|
|
345
|
+
<View
|
|
346
|
+
style={{
|
|
347
|
+
width: size * 0.36,
|
|
348
|
+
height: stroke,
|
|
349
|
+
borderRadius: stroke,
|
|
350
|
+
backgroundColor: color,
|
|
351
|
+
}}
|
|
352
|
+
/>
|
|
353
|
+
</View>
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export function MobileGlyph({ color, size }: IconRenderProps) {
|
|
358
|
+
const stroke = lineOf(size);
|
|
359
|
+
return (
|
|
360
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
361
|
+
<View
|
|
362
|
+
style={{
|
|
363
|
+
width: size * 0.48,
|
|
364
|
+
height: size * 0.78,
|
|
365
|
+
alignItems: 'center',
|
|
366
|
+
justifyContent: 'flex-end',
|
|
367
|
+
paddingBottom: size * 0.08,
|
|
368
|
+
borderWidth: stroke,
|
|
369
|
+
borderRadius: size * 0.12,
|
|
370
|
+
borderColor: color,
|
|
371
|
+
}}
|
|
372
|
+
>
|
|
373
|
+
<View
|
|
374
|
+
style={{
|
|
375
|
+
width: size * 0.12,
|
|
376
|
+
height: stroke,
|
|
377
|
+
borderRadius: stroke,
|
|
378
|
+
backgroundColor: color,
|
|
379
|
+
}}
|
|
380
|
+
/>
|
|
381
|
+
</View>
|
|
382
|
+
</View>
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
function columnsGlyph(count: number) {
|
|
387
|
+
return function Columns({ color, size }: IconRenderProps) {
|
|
388
|
+
const stroke = lineOf(size);
|
|
389
|
+
const column = {
|
|
390
|
+
width: size * (count > 2 ? 0.2 : 0.26),
|
|
391
|
+
height: size * 0.66,
|
|
392
|
+
borderWidth: stroke,
|
|
393
|
+
borderRadius: size * 0.06,
|
|
394
|
+
borderColor: color,
|
|
395
|
+
};
|
|
396
|
+
return (
|
|
397
|
+
<View
|
|
398
|
+
style={[
|
|
399
|
+
styles.center,
|
|
400
|
+
{ width: size, height: size, flexDirection: 'row', gap: size * 0.06 },
|
|
401
|
+
]}
|
|
402
|
+
>
|
|
403
|
+
{Array.from({ length: count }, (_, i) => (
|
|
404
|
+
<View key={i} style={column} />
|
|
405
|
+
))}
|
|
406
|
+
</View>
|
|
407
|
+
);
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export const ColumnsGlyph = columnsGlyph(3);
|
|
412
|
+
|
|
413
|
+
export const TwoColumnsGlyph = columnsGlyph(2);
|
|
414
|
+
|
|
415
|
+
export function TagGlyph({ color, size }: IconRenderProps) {
|
|
416
|
+
const stroke = lineOf(size);
|
|
417
|
+
const height = size * 0.46;
|
|
418
|
+
const body = size * 0.4;
|
|
419
|
+
const tip = height / Math.SQRT2;
|
|
420
|
+
const hole = stroke * 1.3;
|
|
421
|
+
const round = size * 0.08;
|
|
422
|
+
return (
|
|
423
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
424
|
+
<View
|
|
425
|
+
style={{
|
|
426
|
+
width: body + height / 2,
|
|
427
|
+
height,
|
|
428
|
+
transform: [{ rotate: '45deg' }],
|
|
429
|
+
}}
|
|
430
|
+
>
|
|
431
|
+
<View
|
|
432
|
+
style={{
|
|
433
|
+
position: 'absolute',
|
|
434
|
+
left: height / 2,
|
|
435
|
+
top: 0,
|
|
436
|
+
width: body,
|
|
437
|
+
height,
|
|
438
|
+
borderRightWidth: stroke,
|
|
439
|
+
borderTopWidth: stroke,
|
|
440
|
+
borderBottomWidth: stroke,
|
|
441
|
+
borderTopRightRadius: round,
|
|
442
|
+
borderBottomRightRadius: round,
|
|
443
|
+
borderColor: color,
|
|
444
|
+
}}
|
|
445
|
+
/>
|
|
446
|
+
<View
|
|
447
|
+
style={{
|
|
448
|
+
position: 'absolute',
|
|
449
|
+
left: (height - tip) / 2,
|
|
450
|
+
top: (height - tip) / 2,
|
|
451
|
+
width: tip,
|
|
452
|
+
height: tip,
|
|
453
|
+
borderLeftWidth: stroke,
|
|
454
|
+
borderBottomWidth: stroke,
|
|
455
|
+
borderBottomLeftRadius: round * 0.75,
|
|
456
|
+
borderColor: color,
|
|
457
|
+
transform: [{ rotate: '45deg' }],
|
|
458
|
+
}}
|
|
459
|
+
/>
|
|
460
|
+
<View
|
|
461
|
+
style={{
|
|
462
|
+
position: 'absolute',
|
|
463
|
+
left: height / 2 - hole / 2,
|
|
464
|
+
top: (height - hole) / 2,
|
|
465
|
+
width: hole,
|
|
466
|
+
height: hole,
|
|
467
|
+
borderRadius: hole,
|
|
468
|
+
backgroundColor: color,
|
|
469
|
+
}}
|
|
470
|
+
/>
|
|
471
|
+
</View>
|
|
472
|
+
</View>
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export function SortGlyph({ color, size }: IconRenderProps) {
|
|
477
|
+
const stroke = lineOf(size);
|
|
478
|
+
const head = size * 0.24;
|
|
479
|
+
const shaft = {
|
|
480
|
+
position: 'absolute' as const,
|
|
481
|
+
top: size * 0.16,
|
|
482
|
+
width: stroke,
|
|
483
|
+
height: size * 0.68,
|
|
484
|
+
borderRadius: stroke,
|
|
485
|
+
backgroundColor: color,
|
|
486
|
+
};
|
|
487
|
+
const tip = {
|
|
488
|
+
position: 'absolute' as const,
|
|
489
|
+
width: head,
|
|
490
|
+
height: head,
|
|
491
|
+
borderColor: color,
|
|
492
|
+
transform: [{ rotate: '45deg' }],
|
|
493
|
+
};
|
|
494
|
+
const left = size * 0.3;
|
|
495
|
+
const right = size * 0.7;
|
|
496
|
+
return (
|
|
497
|
+
<View style={{ width: size, height: size }}>
|
|
498
|
+
<View style={[shaft, { left: left - stroke / 2 }]} />
|
|
499
|
+
<View
|
|
500
|
+
style={[
|
|
501
|
+
tip,
|
|
502
|
+
{
|
|
503
|
+
left: left - head / 2,
|
|
504
|
+
top: size * 0.84 - head * 1.2,
|
|
505
|
+
borderRightWidth: stroke,
|
|
506
|
+
borderBottomWidth: stroke,
|
|
507
|
+
},
|
|
508
|
+
]}
|
|
509
|
+
/>
|
|
510
|
+
<View style={[shaft, { left: right - stroke / 2 }]} />
|
|
511
|
+
<View
|
|
512
|
+
style={[
|
|
513
|
+
tip,
|
|
514
|
+
{
|
|
515
|
+
left: right - head / 2,
|
|
516
|
+
top: size * 0.16 + head * 0.2,
|
|
517
|
+
borderLeftWidth: stroke,
|
|
518
|
+
borderTopWidth: stroke,
|
|
519
|
+
},
|
|
520
|
+
]}
|
|
521
|
+
/>
|
|
522
|
+
</View>
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export function PositionGlyph({ color, size }: IconRenderProps) {
|
|
527
|
+
const stroke = lineOf(size);
|
|
528
|
+
const box = size * 0.78;
|
|
529
|
+
const dot = size * 0.26;
|
|
530
|
+
return (
|
|
531
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
532
|
+
<View
|
|
533
|
+
style={{
|
|
534
|
+
width: box,
|
|
535
|
+
height: box * 0.92,
|
|
536
|
+
alignItems: 'flex-end',
|
|
537
|
+
justifyContent: 'flex-end',
|
|
538
|
+
padding: size * 0.1,
|
|
539
|
+
borderWidth: stroke,
|
|
540
|
+
borderRadius: size * 0.12,
|
|
541
|
+
borderColor: color,
|
|
542
|
+
}}
|
|
543
|
+
>
|
|
544
|
+
<View
|
|
545
|
+
style={{
|
|
546
|
+
width: dot,
|
|
547
|
+
height: dot,
|
|
548
|
+
borderRadius: size * 0.04,
|
|
549
|
+
backgroundColor: color,
|
|
550
|
+
}}
|
|
551
|
+
/>
|
|
552
|
+
</View>
|
|
553
|
+
</View>
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export function ResizeGlyph({ color, size }: IconRenderProps) {
|
|
558
|
+
const stroke = lineOf(size);
|
|
559
|
+
const arm = size * 0.3;
|
|
560
|
+
const line = {
|
|
561
|
+
position: 'absolute' as const,
|
|
562
|
+
left: size * 0.12,
|
|
563
|
+
top: (size - stroke) / 2,
|
|
564
|
+
width: size * 0.76,
|
|
565
|
+
height: stroke,
|
|
566
|
+
borderRadius: stroke,
|
|
567
|
+
backgroundColor: color,
|
|
568
|
+
transform: [{ rotate: '-45deg' }],
|
|
569
|
+
};
|
|
570
|
+
const corner = {
|
|
571
|
+
position: 'absolute' as const,
|
|
572
|
+
width: arm,
|
|
573
|
+
height: arm,
|
|
574
|
+
borderColor: color,
|
|
575
|
+
};
|
|
576
|
+
return (
|
|
577
|
+
<View style={{ width: size, height: size }}>
|
|
578
|
+
<View style={line} />
|
|
579
|
+
<View
|
|
580
|
+
style={[
|
|
581
|
+
corner,
|
|
582
|
+
{
|
|
583
|
+
right: size * 0.14,
|
|
584
|
+
top: size * 0.14,
|
|
585
|
+
borderTopWidth: stroke,
|
|
586
|
+
borderRightWidth: stroke,
|
|
587
|
+
},
|
|
588
|
+
]}
|
|
589
|
+
/>
|
|
590
|
+
<View
|
|
591
|
+
style={[
|
|
592
|
+
corner,
|
|
593
|
+
{
|
|
594
|
+
left: size * 0.14,
|
|
595
|
+
bottom: size * 0.14,
|
|
596
|
+
borderBottomWidth: stroke,
|
|
597
|
+
borderLeftWidth: stroke,
|
|
598
|
+
},
|
|
599
|
+
]}
|
|
600
|
+
/>
|
|
601
|
+
</View>
|
|
602
|
+
);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export function OverlayGlyph({ color, size }: IconRenderProps) {
|
|
606
|
+
const stroke = lineOf(size);
|
|
607
|
+
const box = size * 0.78;
|
|
608
|
+
const hatch = {
|
|
609
|
+
position: 'absolute' as const,
|
|
610
|
+
width: box * 1.6,
|
|
611
|
+
height: stroke * 0.85,
|
|
612
|
+
backgroundColor: color,
|
|
613
|
+
transform: [{ rotate: '-45deg' }],
|
|
614
|
+
};
|
|
615
|
+
return (
|
|
616
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
617
|
+
<View
|
|
618
|
+
style={[
|
|
619
|
+
styles.center,
|
|
620
|
+
{
|
|
621
|
+
width: box,
|
|
622
|
+
height: box * 0.92,
|
|
623
|
+
overflow: 'hidden',
|
|
624
|
+
borderWidth: stroke,
|
|
625
|
+
borderRadius: size * 0.12,
|
|
626
|
+
borderColor: color,
|
|
627
|
+
},
|
|
628
|
+
]}
|
|
629
|
+
>
|
|
630
|
+
<View style={[hatch, { top: box * 0.06 }]} />
|
|
631
|
+
<View style={hatch} />
|
|
632
|
+
<View style={[hatch, { bottom: box * 0.06 }]} />
|
|
633
|
+
</View>
|
|
634
|
+
</View>
|
|
635
|
+
);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
export function MailGlyph({ color, size }: IconRenderProps) {
|
|
639
|
+
const stroke = lineOf(size);
|
|
640
|
+
const width = size * 0.8;
|
|
641
|
+
const height = size * 0.6;
|
|
642
|
+
const flap = width * 0.58;
|
|
643
|
+
return (
|
|
644
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
645
|
+
<View
|
|
646
|
+
style={{
|
|
647
|
+
width,
|
|
648
|
+
height,
|
|
649
|
+
alignItems: 'center',
|
|
650
|
+
overflow: 'hidden',
|
|
651
|
+
borderWidth: stroke,
|
|
652
|
+
borderRadius: size * 0.08,
|
|
653
|
+
borderColor: color,
|
|
654
|
+
}}
|
|
655
|
+
>
|
|
656
|
+
<View
|
|
657
|
+
style={{
|
|
658
|
+
width: flap,
|
|
659
|
+
height: flap,
|
|
660
|
+
marginTop: -flap * 0.62,
|
|
661
|
+
borderRightWidth: stroke,
|
|
662
|
+
borderBottomWidth: stroke,
|
|
663
|
+
borderColor: color,
|
|
664
|
+
transform: [{ rotate: '45deg' }],
|
|
665
|
+
}}
|
|
666
|
+
/>
|
|
667
|
+
</View>
|
|
668
|
+
</View>
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export function TicketGlyph({ color, size }: IconRenderProps) {
|
|
673
|
+
const stroke = lineOf(size);
|
|
674
|
+
const height = size * 0.6;
|
|
675
|
+
const dash = {
|
|
676
|
+
width: stroke,
|
|
677
|
+
height: height * 0.16,
|
|
678
|
+
borderRadius: stroke,
|
|
679
|
+
backgroundColor: color,
|
|
680
|
+
};
|
|
681
|
+
return (
|
|
682
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
683
|
+
<View
|
|
684
|
+
style={{
|
|
685
|
+
width: size * 0.82,
|
|
686
|
+
height,
|
|
687
|
+
justifyContent: 'center',
|
|
688
|
+
paddingLeft: size * 0.24,
|
|
689
|
+
borderWidth: stroke,
|
|
690
|
+
borderRadius: size * 0.1,
|
|
691
|
+
borderColor: color,
|
|
692
|
+
}}
|
|
693
|
+
>
|
|
694
|
+
<View style={{ gap: height * 0.1 }}>
|
|
695
|
+
<View style={dash} />
|
|
696
|
+
<View style={dash} />
|
|
697
|
+
<View style={dash} />
|
|
698
|
+
</View>
|
|
699
|
+
</View>
|
|
700
|
+
</View>
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
export function ButtonGlyph({ color, size }: IconRenderProps) {
|
|
705
|
+
const stroke = lineOf(size);
|
|
706
|
+
return (
|
|
707
|
+
<View style={[styles.center, { width: size, height: size }]}>
|
|
708
|
+
<View
|
|
709
|
+
style={[
|
|
710
|
+
styles.center,
|
|
711
|
+
{
|
|
712
|
+
width: size * 0.84,
|
|
713
|
+
height: size * 0.46,
|
|
714
|
+
borderWidth: stroke,
|
|
715
|
+
borderRadius: size,
|
|
716
|
+
borderColor: color,
|
|
717
|
+
},
|
|
718
|
+
]}
|
|
719
|
+
>
|
|
720
|
+
<View
|
|
721
|
+
style={{
|
|
722
|
+
width: size * 0.4,
|
|
723
|
+
height: stroke,
|
|
724
|
+
borderRadius: stroke,
|
|
725
|
+
backgroundColor: color,
|
|
726
|
+
}}
|
|
727
|
+
/>
|
|
728
|
+
</View>
|
|
729
|
+
</View>
|
|
730
|
+
);
|
|
731
|
+
}
|
package/src/templates/index.ts
CHANGED
|
@@ -47,3 +47,10 @@ export type {
|
|
|
47
47
|
SheetBlockProps,
|
|
48
48
|
SheetFormTemplateProps,
|
|
49
49
|
} from './sheet-form-template';
|
|
50
|
+
export { PreviewEditTemplate } from './preview-edit-template';
|
|
51
|
+
export type {
|
|
52
|
+
PreviewDevice,
|
|
53
|
+
PreviewEditChoice,
|
|
54
|
+
PreviewEditTemplateProps,
|
|
55
|
+
PreviewEditTool,
|
|
56
|
+
} from './preview-edit-template';
|