@stll/ui 0.82.0 → 0.83.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.
@@ -1,4 +1,4 @@
1
- import { DocumentMarkContract, DocumentMarkKind, isDocumentMarkKind } from "./document-mark.shared.js";
1
+ import { DOCUMENT_MARK_KINDS, DocumentMarkContract, DocumentMarkKind, isDocumentMarkKind } from "./document-mark.shared.js";
2
2
  import { SVGProps } from "react";
3
3
  /**
4
4
  * A file format's mark (the Word, Excel or PDF page), drawn from the artwork
@@ -6,4 +6,4 @@ import { SVGProps } from "react";
6
6
  */
7
7
  export declare const DocumentMark: ({ kind, ...props }: DocumentMarkProps) => import("react").ReactSVGElement;
8
8
  type DocumentMarkProps = DocumentMarkContract & Omit<SVGProps<SVGSVGElement>, "children" | "viewBox">;
9
- export { type DocumentMarkKind, isDocumentMarkKind };
9
+ export { DOCUMENT_MARK_KINDS, type DocumentMarkKind, isDocumentMarkKind };
@@ -1,4 +1,4 @@
1
- import { DOCUMENT_MARKS, GRADIENT_REFERENCE, isDocumentMarkKind } from "./document-mark.shared.js";
1
+ import { DOCUMENT_MARKS, DOCUMENT_MARK_KINDS, GRADIENT_REFERENCE, isDocumentMarkKind } from "./document-mark.shared.js";
2
2
  import { createElement, useId } from "react";
3
3
  // src/components/document-mark.tsx
4
4
  /**
@@ -26,4 +26,4 @@ const scoped = (attrs, scope) => Object.fromEntries(Object.entries(attrs).map(([
26
26
  return [name, id === void 0 ? value : `url(#${scope}-${id})`];
27
27
  }));
28
28
  const draw = (shape, scope) => createElement(shape.tag, scoped(shape.attrs, scope), ...(shape.children ?? []).map((child) => draw(child, scope)));
29
- export { DocumentMark, isDocumentMarkKind };
29
+ export { DOCUMENT_MARK_KINDS, DocumentMark, isDocumentMarkKind };
@@ -1,5 +1,5 @@
1
1
  import Svg from "react-native-svg";
2
- import { DocumentMarkContract, DocumentMarkKind, isDocumentMarkKind } from "./document-mark.shared.js";
2
+ import { DOCUMENT_MARK_KINDS, DocumentMarkContract, DocumentMarkKind, isDocumentMarkKind } from "./document-mark.shared.js";
3
3
  /**
4
4
  * A file format's mark (the Word, Excel or PDF page), drawn from the artwork
5
5
  * the web shares. `color` paints a mark drawn in the text colour (Markdown).
@@ -8,4 +8,4 @@ export declare const DocumentMark: ({ color, kind, size }: DocumentMarkContract
8
8
  color?: string | undefined;
9
9
  size?: number | undefined;
10
10
  }) => import("react").CElement<Readonly<import("react-native-svg").SvgProps> | import("react-native-svg").SvgProps, Svg>;
11
- export { type DocumentMarkKind, isDocumentMarkKind };
11
+ export { DOCUMENT_MARK_KINDS, type DocumentMarkKind, isDocumentMarkKind };
@@ -1,4 +1,4 @@
1
- import { DOCUMENT_MARKS, GRADIENT_REFERENCE, isDocumentMarkKind } from "./document-mark.shared.js";
1
+ import { DOCUMENT_MARKS, DOCUMENT_MARK_KINDS, GRADIENT_REFERENCE, isDocumentMarkKind } from "./document-mark.shared.js";
2
2
  import { createElement, useId } from "react";
3
3
  import Svg, { Defs, G, LinearGradient, Path, Polygon, Rect, Stop } from "react-native-svg";
4
4
  // src/components/document-mark.native.tsx
@@ -33,4 +33,4 @@ const scoped = (attrs, scope) => Object.fromEntries(Object.entries(attrs).map(([
33
33
  return [name, id === void 0 ? value : `url(#${scope}-${id})`];
34
34
  }));
35
35
  const draw = (shape, scope) => createElement(ELEMENTS[shape.tag], scoped(shape.attrs, scope), ...(shape.children ?? []).map((child) => draw(child, scope)));
36
- export { DocumentMark, isDocumentMarkKind };
36
+ export { DOCUMENT_MARK_KINDS, DocumentMark, isDocumentMarkKind };
@@ -32,6 +32,12 @@ export declare const DOCUMENT_MARKS: {
32
32
  readonly et3: DocumentMarkArtwork;
33
33
  readonly zep: DocumentMarkArtwork;
34
34
  readonly xadesZep: DocumentMarkArtwork;
35
+ readonly wordPerfect: DocumentMarkArtwork;
36
+ readonly works: DocumentMarkArtwork;
37
+ readonly pages: DocumentMarkArtwork;
38
+ readonly numbers: DocumentMarkArtwork;
39
+ readonly webArchive: DocumentMarkArtwork;
40
+ readonly epub: DocumentMarkArtwork;
35
41
  readonly dataBox: {
36
42
  readonly viewBox: "0 0 24 24";
37
43
  readonly gradients: readonly [];
@@ -413,4 +419,6 @@ export declare const isDocumentMarkKind: (kind: string) => kind is DocumentMarkK
413
419
  /** What both renderers draw a mark from. */
414
420
  export type DocumentMarkContract = {
415
421
  kind: DocumentMarkKind;
416
- };
422
+ };
423
+ /** Every mark, so a registry can be checked to draw each one. */
424
+ export declare const DOCUMENT_MARK_KINDS: readonly DocumentMarkKind[];
@@ -348,14 +348,19 @@ const MARK_GLYPHS = {
348
348
  D: "0 0,2 0,3 1,3 3,2 4,0 4,0 0",
349
349
  E: "3 0,0 0,0 4,3 4|0 2,2.2 2",
350
350
  F: "3 0,0 0,0 4|0 2,2.2 2",
351
+ G: "3 0,0 0,0 4,3 4,3 2,1.5 2",
352
+ H: "0 0,0 4|3 0,3 4|0 2,3 2",
351
353
  I: "0.5 0,2.5 0|1.5 0,1.5 4|0.5 4,2.5 4",
352
354
  L: "0 0,0 4,3 4",
353
355
  M: "0 4,0 0,1.5 2,3 0,3 4",
356
+ N: "0 4,0 0,3 4,3 0",
354
357
  O: "0 0,3 0,3 4,0 4,0 0",
355
358
  P: "0 4,0 0,3 0,3 2,0 2",
359
+ R: "0 4,0 0,3 0,3 2,0 2|1.2 2,3 4",
356
360
  S: "3 0,0 0,0 2,3 2,3 4,0 4",
357
361
  T: "0 0,3 0|1.5 0,1.5 4",
358
362
  U: "0 0,0 4,3 4,3 0",
363
+ W: "0 0,0 4,1.5 2,3 4,3 0",
359
364
  X: "0 0,3 4|3 0,0 4",
360
365
  Z: "0 0,3 0,0 4,3 4",
361
366
  "3": "0 0,3 0,1.5 2,3 2,3 4,0 4",
@@ -404,7 +409,7 @@ const tagPath = (lines) => {
404
409
  strokeWidth: coordinate(TAG_STROKE_WIDTH * Math.min(1, scale))
405
410
  };
406
411
  };
407
- const legalFormatMark = ({ color, lines }) => {
412
+ const taggedFormatMark = ({ color, lines }) => {
408
413
  const tag = tagPath(lines);
409
414
  return {
410
415
  viewBox: "0 0 24 24",
@@ -440,7 +445,7 @@ const legalFormatMark = ({ color, lines }) => {
440
445
  };
441
446
  };
442
447
  const DOCUMENT_MARKS = {
443
- ofd: legalFormatMark({
448
+ ofd: taggedFormatMark({
444
449
  color: "#9a5b00",
445
450
  lines: [[
446
451
  "O",
@@ -448,7 +453,7 @@ const DOCUMENT_MARKS = {
448
453
  "D"
449
454
  ]]
450
455
  }),
451
- uyap: legalFormatMark({
456
+ uyap: taggedFormatMark({
452
457
  color: "#b3261e",
453
458
  lines: [[
454
459
  "U",
@@ -456,7 +461,7 @@ const DOCUMENT_MARKS = {
456
461
  "F"
457
462
  ]]
458
463
  }),
459
- asicE: legalFormatMark({
464
+ asicE: taggedFormatMark({
460
465
  color: "#2e6b4f",
461
466
  lines: [[
462
467
  "A",
@@ -465,7 +470,7 @@ const DOCUMENT_MARKS = {
465
470
  "C"
466
471
  ], ["E"]]
467
472
  }),
468
- asicS: legalFormatMark({
473
+ asicS: taggedFormatMark({
469
474
  color: "#4f7a2e",
470
475
  lines: [[
471
476
  "A",
@@ -474,7 +479,7 @@ const DOCUMENT_MARKS = {
474
479
  "C"
475
480
  ], ["S"]]
476
481
  }),
477
- bdoc: legalFormatMark({
482
+ bdoc: taggedFormatMark({
478
483
  color: "#0f6e7a",
479
484
  lines: [[
480
485
  "B",
@@ -483,7 +488,7 @@ const DOCUMENT_MARKS = {
483
488
  "C"
484
489
  ]]
485
490
  }),
486
- cades: legalFormatMark({
491
+ cades: taggedFormatMark({
487
492
  color: "#6b4c9a",
488
493
  lines: [[
489
494
  "P",
@@ -491,7 +496,7 @@ const DOCUMENT_MARKS = {
491
496
  "M"
492
497
  ]]
493
498
  }),
494
- fatturaPA: legalFormatMark({
499
+ fatturaPA: taggedFormatMark({
495
500
  color: "#1d6f42",
496
501
  lines: [[
497
502
  "F",
@@ -499,7 +504,7 @@ const DOCUMENT_MARKS = {
499
504
  "A"
500
505
  ]]
501
506
  }),
502
- isdoc: legalFormatMark({
507
+ isdoc: taggedFormatMark({
503
508
  color: "#1f5fa8",
504
509
  lines: [[
505
510
  "I",
@@ -509,7 +514,7 @@ const DOCUMENT_MARKS = {
509
514
  "C"
510
515
  ]]
511
516
  }),
512
- isdocx: legalFormatMark({
517
+ isdocx: taggedFormatMark({
513
518
  color: "#2a4f8f",
514
519
  lines: [[
515
520
  "I",
@@ -519,7 +524,7 @@ const DOCUMENT_MARKS = {
519
524
  "C"
520
525
  ], ["X"]]
521
526
  }),
522
- xml: legalFormatMark({
527
+ xml: taggedFormatMark({
523
528
  color: "#5c6470",
524
529
  lines: [[
525
530
  "X",
@@ -527,7 +532,7 @@ const DOCUMENT_MARKS = {
527
532
  "L"
528
533
  ]]
529
534
  }),
530
- eAkta: legalFormatMark({
535
+ eAkta: taggedFormatMark({
531
536
  color: "#8c2f5d",
532
537
  lines: [[
533
538
  "E",
@@ -535,7 +540,7 @@ const DOCUMENT_MARKS = {
535
540
  "3"
536
541
  ]]
537
542
  }),
538
- et3: legalFormatMark({
543
+ et3: taggedFormatMark({
539
544
  color: "#a2481f",
540
545
  lines: [[
541
546
  "E",
@@ -543,7 +548,7 @@ const DOCUMENT_MARKS = {
543
548
  "3"
544
549
  ]]
545
550
  }),
546
- zep: legalFormatMark({
551
+ zep: taggedFormatMark({
547
552
  color: "#24529c",
548
553
  lines: [[
549
554
  "Z",
@@ -551,7 +556,7 @@ const DOCUMENT_MARKS = {
551
556
  "P"
552
557
  ]]
553
558
  }),
554
- xadesZep: legalFormatMark({
559
+ xadesZep: taggedFormatMark({
555
560
  color: "#3d4f8f",
556
561
  lines: [[
557
562
  "X",
@@ -560,6 +565,62 @@ const DOCUMENT_MARKS = {
560
565
  "P"
561
566
  ]]
562
567
  }),
568
+ wordPerfect: taggedFormatMark({
569
+ color: "#2f4f9e",
570
+ lines: [[
571
+ "W",
572
+ "P",
573
+ "D"
574
+ ]]
575
+ }),
576
+ works: taggedFormatMark({
577
+ color: "#4a6b8a",
578
+ lines: [[
579
+ "W",
580
+ "P",
581
+ "S"
582
+ ]]
583
+ }),
584
+ pages: taggedFormatMark({
585
+ color: "#c25400",
586
+ lines: [[
587
+ "P",
588
+ "A",
589
+ "G",
590
+ "E",
591
+ "S"
592
+ ]]
593
+ }),
594
+ numbers: taggedFormatMark({
595
+ color: "#2e7d32",
596
+ lines: [[
597
+ "N",
598
+ "U",
599
+ "M"
600
+ ], [
601
+ "B",
602
+ "E",
603
+ "R",
604
+ "S"
605
+ ]]
606
+ }),
607
+ webArchive: taggedFormatMark({
608
+ color: "#00728f",
609
+ lines: [[
610
+ "M",
611
+ "H",
612
+ "T"
613
+ ]]
614
+ }),
615
+ epub: taggedFormatMark({
616
+ color: "#6b7a1c",
617
+ lines: [[
618
+ "E",
619
+ "P",
620
+ "U",
621
+ "B"
622
+ ]]
623
+ }),
563
624
  dataBox: {
564
625
  viewBox: "0 0 24 24",
565
626
  gradients: [],
@@ -1000,4 +1061,6 @@ const DOCUMENT_MARKS = {
1000
1061
  }
1001
1062
  };
1002
1063
  const isDocumentMarkKind = (kind) => Object.hasOwn(DOCUMENT_MARKS, kind);
1003
- export { DOCUMENT_MARKS, GRADIENT_REFERENCE, isDocumentMarkKind };
1064
+ /** Every mark, so a registry can be checked to draw each one. */
1065
+ const DOCUMENT_MARK_KINDS = Object.keys(DOCUMENT_MARKS).filter(isDocumentMarkKind);
1066
+ export { DOCUMENT_MARKS, DOCUMENT_MARK_KINDS, GRADIENT_REFERENCE, isDocumentMarkKind };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/ui",
3
- "version": "0.82.0",
3
+ "version": "0.83.0",
4
4
  "description": "Stella's design system: bidi-aware React primitives built on Base UI, the dockable inspector pane, and the Tailwind v4 theme they are styled with.",
5
5
  "keywords": [
6
6
  "base-ui",