@cardano-slips/flow 0.2.0 → 0.3.1

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.
Files changed (73) hide show
  1. package/README.md +53 -9
  2. package/dist/address.d.ts +12 -0
  3. package/dist/address.d.ts.map +1 -1
  4. package/dist/address.js +43 -0
  5. package/dist/address.js.map +1 -1
  6. package/dist/card.css +492 -0
  7. package/dist/card.d.ts +41 -0
  8. package/dist/card.d.ts.map +1 -0
  9. package/dist/card.js +69 -0
  10. package/dist/card.js.map +1 -0
  11. package/dist/complete-error.d.ts +8 -1
  12. package/dist/complete-error.d.ts.map +1 -1
  13. package/dist/complete-error.js +6 -1
  14. package/dist/complete-error.js.map +1 -1
  15. package/dist/complete.d.ts +29 -10
  16. package/dist/complete.d.ts.map +1 -1
  17. package/dist/complete.js +83 -9
  18. package/dist/complete.js.map +1 -1
  19. package/dist/derived.d.ts +8 -0
  20. package/dist/derived.d.ts.map +1 -0
  21. package/dist/derived.js +2 -0
  22. package/dist/derived.js.map +1 -0
  23. package/dist/effects-panel.d.ts +37 -0
  24. package/dist/effects-panel.d.ts.map +1 -0
  25. package/dist/effects-panel.js +64 -0
  26. package/dist/effects-panel.js.map +1 -0
  27. package/dist/effects.css +629 -0
  28. package/dist/exchange.d.ts +54 -0
  29. package/dist/exchange.d.ts.map +1 -0
  30. package/dist/exchange.js +136 -0
  31. package/dist/exchange.js.map +1 -0
  32. package/dist/explain.d.ts +39 -0
  33. package/dist/explain.d.ts.map +1 -0
  34. package/dist/explain.js +172 -0
  35. package/dist/explain.js.map +1 -0
  36. package/dist/index.d.ts +19 -3
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +9 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/ledger.d.ts +74 -0
  41. package/dist/ledger.d.ts.map +1 -0
  42. package/dist/ledger.js +402 -0
  43. package/dist/ledger.js.map +1 -0
  44. package/dist/outcome-panel.d.ts +63 -0
  45. package/dist/outcome-panel.d.ts.map +1 -0
  46. package/dist/outcome-panel.js +40 -0
  47. package/dist/outcome-panel.js.map +1 -0
  48. package/dist/parameter-form.d.ts +26 -0
  49. package/dist/parameter-form.d.ts.map +1 -0
  50. package/dist/parameter-form.js +42 -0
  51. package/dist/parameter-form.js.map +1 -0
  52. package/dist/slip-card.d.ts +55 -0
  53. package/dist/slip-card.d.ts.map +1 -0
  54. package/dist/slip-card.js +89 -0
  55. package/dist/slip-card.js.map +1 -0
  56. package/dist/tokens.css +57 -32
  57. package/package.json +11 -7
  58. package/src/address.ts +53 -0
  59. package/src/card.css +492 -0
  60. package/src/card.ts +86 -0
  61. package/src/complete-error.ts +14 -2
  62. package/src/complete.ts +128 -19
  63. package/src/derived.ts +8 -0
  64. package/src/effects-panel.tsx +386 -0
  65. package/src/effects.css +629 -0
  66. package/src/exchange.ts +212 -0
  67. package/src/explain.ts +211 -0
  68. package/src/index.ts +39 -3
  69. package/src/ledger.ts +503 -0
  70. package/src/outcome-panel.tsx +263 -0
  71. package/src/parameter-form.tsx +138 -0
  72. package/src/slip-card.tsx +244 -0
  73. package/src/tokens.css +57 -32
package/src/tokens.css CHANGED
@@ -10,7 +10,7 @@
10
10
  * already called `--ink`. Put `slip-root` on the element that wraps the Slip.
11
11
  *
12
12
  * There is no reset here and no rule that selects an element. Nothing sets a
13
- * font-family on anything — a component reads `var(--font-text)` — so a host
13
+ * font-family on anything — a component reads a `--type-*` role — so a host
14
14
  * page's own stack stays where it is until something of ours asks for a token.
15
15
  *
16
16
  * One theme. The sheet collapsed an earlier light/dark pair into a single
@@ -47,21 +47,26 @@
47
47
  * for and not about the ratio it happens to reach.
48
48
  */
49
49
  --accent-fill: #728ef3;
50
- --accent-text: #2f4bc4; /* links */
51
- --accent-action: #4361e8; /* button background */
52
- --accent-hover: #2f4bc4;
50
+ --accent-text: #123cd3; /* links */
51
+ --accent-action: #123cd3; /* the outline and the label of a button */
52
+ --accent-hover: #0e2fa6;
53
53
  --accent-deep: #0c288d; /* headings */
54
- --on-accent: #ffffff; /* anything drawn on --accent-action */
55
- --focus: #4361e8;
54
+ --on-accent: #ffffff; /* anything drawn on a filled accent */
55
+ --focus: #123cd3;
56
+
57
+ /* The accent lightened for slate, where #123cd3 disappears into the ground. */
58
+ --accent-on-slate: #8fa9ff;
56
59
 
57
60
  /* Semantic, and rare. A page that colours everything says nothing. */
58
- --pos: #1f7a5c; /* positive, refundable */
59
- --warn: #8c5a12;
60
- --bad: #b3261e;
61
- --bad-tint: rgba(179, 38, 30, 0.06);
62
- --bad-line: rgba(179, 38, 30, 0.24);
63
- --warn-tint: rgba(233, 180, 76, 0.16);
64
- --warn-line: rgba(233, 180, 76, 0.5);
61
+ --pos: #065708; /* value arriving */
62
+ --warn: #7a5200; /* held, taken, caution */
63
+ --bad: #d20a19; /* problem, blocked */
64
+ --bad-tint: rgba(210, 10, 25, 0.06);
65
+ --bad-line: rgba(210, 10, 25, 0.24);
66
+ --warn-tint: rgba(254, 206, 82, 0.22);
67
+ --warn-line: rgba(254, 206, 82, 0.85);
68
+ --warn-fill: #fece52; /* the warning as a fill, never as a word on a light ground */
69
+ --on-warn: #3a2600; /* words on the warning fill: the testnet bar */
65
70
 
66
71
  /* The alternating rows of the effects list, on and off. */
67
72
  --stripe-a: rgba(90, 110, 205, 0.16);
@@ -82,14 +87,19 @@
82
87
  --vault-border: rgba(255, 255, 255, 0.16);
83
88
  --vault-chip: rgba(168, 188, 255, 0.22);
84
89
  --vault-rule: rgba(168, 188, 255, 0.7);
85
- --vault-pos: #5fd1a6;
86
- --vault-warn: #e9b44c;
87
- --vault-bad: #ffa39b;
88
- --vault-bad-tint: rgba(255, 163, 155, 0.1);
89
- --vault-bad-line: rgba(255, 163, 155, 0.45);
90
- --vault-bad-chip: rgba(255, 163, 155, 0.18);
91
- --vault-warn-tint: rgba(233, 180, 76, 0.12);
92
- --vault-warn-line: rgba(233, 180, 76, 0.5);
90
+ --vault-pos: #6fcb72;
91
+ --vault-warn: #fece52;
92
+ /*
93
+ * #ff5247 on the sheet, lightened here: that value measures 4.42:1 on the
94
+ * vault and the sheet's own row calls it a pass. This is the colour the
95
+ * mismatch block is written in, so it clears AA or it does not ship.
96
+ */
97
+ --vault-bad: #ff5a50;
98
+ --vault-bad-tint: rgba(210, 10, 25, 0.16);
99
+ --vault-bad-line: rgba(255, 82, 71, 0.55);
100
+ --vault-bad-chip: rgba(210, 10, 25, 0.28);
101
+ --vault-warn-tint: rgba(254, 206, 82, 0.14);
102
+ --vault-warn-line: rgba(254, 206, 82, 0.55);
93
103
 
94
104
  /*
95
105
  * Code blocks in the docs and the Open Graph card. Both land on a ground we
@@ -101,21 +111,36 @@
101
111
  --dark-text: #ffffff;
102
112
  --dark-muted: #ccd6ff;
103
113
 
104
- /* Type. Each stack ends in a generic family, so a missing webfont degrades. */
105
- --font-display: Poppins, system-ui, sans-serif;
106
- --font-text: Figtree, system-ui, sans-serif;
107
- --font-mono: "IBM Plex Mono", ui-monospace, monospace;
114
+ /*
115
+ * One family, for everything. The sheet's earlier display/text/mono trio is
116
+ * gone: weight and size separate a heading from a label perfectly well, and
117
+ * three names for one face is three chances to drift apart. The stack ends in
118
+ * a generic family, so a missing webfont degrades rather than disappears.
119
+ */
120
+ --font: Poppins, system-ui, sans-serif;
108
121
 
109
122
  /* Whole roles, so half a role cannot be applied without the other half. */
110
- --type-h1: 700 44px/48px var(--font-display);
123
+ --type-h1: 700 44px/48px var(--font);
111
124
  --type-h1-tracking: -0.01em;
112
- --type-card-title: 700 18px/24px var(--font-display);
113
- --type-numeral: 700 26px/32px var(--font-display); /* a figure is always Poppins 700 */
114
- --type-body: 500 16px/24px var(--font-text);
115
- --type-button: 500 14px/20px var(--font-text);
125
+ --type-card-title: 700 18px/24px var(--font);
126
+ --type-numeral: 700 26px/32px var(--font); /* a figure is always 700 */
127
+ --type-body: 400 16px/24px var(--font);
128
+ --type-button: 500 14px/20px var(--font);
116
129
  --type-button-tracking: 0.1px;
117
- --type-label: 500 13px var(--font-text);
118
- --type-mono: 400 12px/20px var(--font-mono); /* addresses, hashes, the tx block */
130
+ --type-label: 500 13px var(--font);
131
+ /* Addresses, hashes, error codes, the tx block — text meant for a machine. */
132
+ --type-technical: 400 12px/20px var(--font);
133
+
134
+ /* The transaction preview's own scale, from `4 · Anatomy` and `6 · Preview states`. */
135
+ --type-headline: 700 32px/38px var(--font); /* the one figure the person is deciding on */
136
+ --type-preview-title: 700 20px/26px var(--font);
137
+ --type-amount: 700 20px/26px var(--font); /* a row's figure, one size so the column scans */
138
+ --type-countdown: 700 16px/20px var(--font);
139
+ --type-row: 400 14px/20px var(--font);
140
+ --type-note: 400 13px/19px var(--font);
141
+ --type-kicker: 400 11px/16px var(--font);
142
+ --type-kicker-tracking: 0.12em;
143
+ --type-chip: 600 11px/20px var(--font);
119
144
 
120
145
  /* Spacing, on a 4px base. */
121
146
  --space-4: 4px;