@syware/jlib 0.1.3 → 0.3.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.
Files changed (50) hide show
  1. package/README.md +3 -17
  2. package/dist/all.js +5 -4
  3. package/dist/atoms/jl-icon.css_raw.js +1 -1
  4. package/dist/atoms/jl-icon.d.ts +7 -1
  5. package/dist/atoms/jl-icon.js +4 -1
  6. package/dist/atoms/jl-input.d.ts +1 -0
  7. package/dist/atoms/jl-input.js +2 -0
  8. package/dist/atoms/jl-progress-ring.js +1 -6
  9. package/dist/atoms/jl-select.d.ts +6 -0
  10. package/dist/atoms/jl-select.js +18 -1
  11. package/dist/atoms/jl-switch.d.ts +12 -1
  12. package/dist/atoms/jl-switch.js +11 -1
  13. package/dist/index.d.ts +4 -2
  14. package/dist/index.js +4 -3
  15. package/dist/lib/calendar.d.ts +15 -1
  16. package/dist/lib/calendar.js +72 -1
  17. package/dist/lib/dom.d.ts +2 -0
  18. package/dist/lib/dom.js +8 -1
  19. package/dist/lib/flow.d.ts +70 -0
  20. package/dist/lib/flow.js +353 -0
  21. package/dist/lib/options.d.ts +5 -0
  22. package/dist/lib/options.js +13 -1
  23. package/dist/molecules/jl-accordion-item.css_raw.js +1 -1
  24. package/dist/molecules/jl-accordion-item.d.ts +6 -1
  25. package/dist/molecules/jl-accordion-item.js +21 -6
  26. package/dist/molecules/jl-alert.d.ts +1 -0
  27. package/dist/molecules/jl-alert.js +3 -1
  28. package/dist/molecules/jl-date-picker.d.ts +10 -4
  29. package/dist/molecules/jl-date-picker.js +21 -8
  30. package/dist/molecules/jl-search.d.ts +3 -1
  31. package/dist/molecules/jl-search.js +8 -6
  32. package/dist/molecules/jl-segmented.css_raw.js +1 -1
  33. package/dist/molecules/jl-segmented.js +14 -7
  34. package/dist/molecules/jl-stat.css_raw.js +1 -1
  35. package/dist/molecules/jl-stat.d.ts +6 -0
  36. package/dist/molecules/jl-stat.js +6 -0
  37. package/dist/molecules/jl-steps.css_raw.js +1 -1
  38. package/dist/molecules/jl-timeline.css_raw.js +1 -1
  39. package/dist/molecules/jl-timeline.d.ts +2 -1
  40. package/dist/molecules/jl-timeline.js +18 -16
  41. package/dist/molecules/jl-toast.css_raw.js +1 -1
  42. package/dist/molecules/jl-toast.d.ts +1 -0
  43. package/dist/molecules/jl-toast.js +3 -1
  44. package/dist/organisms/jl-flow.css_raw.js +3 -0
  45. package/dist/organisms/jl-flow.d.ts +109 -0
  46. package/dist/organisms/jl-flow.js +755 -0
  47. package/dist/types/calendar.types.d.ts +2 -0
  48. package/dist/types/jl-flow.types.d.ts +94 -0
  49. package/dist/types/jl-segmented.types.d.ts +2 -0
  50. package/package.json +1 -1
@@ -9,3 +9,5 @@ export type CalendarDate = {
9
9
  export type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
10
10
  /** How long the name of a weekday is: `Monday`, `Mon` or `M`. */
11
11
  export type WeekdayWidth = 'long' | 'short' | 'narrow';
12
+ /** A part of a date as it is written: the day, the month or the year. */
13
+ export type DatePart = 'day' | 'month' | 'year';
@@ -0,0 +1,94 @@
1
+ import type { Tone } from './options.types';
2
+ /** A point in the flow's own pixels, which the view moves and zooms. */
3
+ export type FlowPoint = {
4
+ x: number;
5
+ y: number;
6
+ };
7
+ /** An exit of a node, along its bottom edge. Its edges take its tone: `danger` ones are dashed. */
8
+ export type FlowPort = {
9
+ id: string;
10
+ label?: string;
11
+ tone?: Tone;
12
+ };
13
+ /** How a node did in a run, shown on it: at work, finished, waiting for someone, or failed. */
14
+ export type FlowNodeStatus = 'running' | 'done' | 'waiting' | 'failed';
15
+ export type FlowNode = {
16
+ id: string;
17
+ label: string;
18
+ /** The node's top left corner. */
19
+ position: FlowPoint;
20
+ /** A second, quieter line under the label. */
21
+ description?: string;
22
+ /** A third line, under a dashed rule: what the node is set to do. The node is taller with it. */
23
+ detail?: string;
24
+ icon?: string;
25
+ /** The colour of the icon: `accent` by default. */
26
+ tone?: Tone;
27
+ /** The icon's colour as any CSS colour, for kinds the tones do not cover (`var(--my-ai)`); wins over `tone`. */
28
+ color?: string;
29
+ /** How it did in a run. */
30
+ status?: FlowNodeStatus;
31
+ /** The exit a run left it by: that exit, and its edges to nodes with a status, stand out. */
32
+ taken?: string;
33
+ /** Something to fix before the flow can run: a mark on the node, with this text as its explanation. */
34
+ problem?: string;
35
+ /** The exits. Absent, the node has one without a name; empty, it has none (it ends the flow). */
36
+ ports?: FlowPort[];
37
+ /** A start takes no incoming edge. */
38
+ start?: boolean;
39
+ };
40
+ export type FlowEdge = {
41
+ id: string;
42
+ from: string;
43
+ /** The exit of `from` it leaves by; absent, the first one. */
44
+ port?: string;
45
+ to: string;
46
+ };
47
+ export type FlowGraph = {
48
+ nodes: FlowNode[];
49
+ edges: FlowEdge[];
50
+ };
51
+ /** Asks the page for a node after an exit: where to put it, and what to connect it to. */
52
+ export type FlowAddRequest = {
53
+ from: string;
54
+ port: string;
55
+ position: FlowPoint;
56
+ };
57
+ /** Asks for a node where something was dropped: what it carried, and where to put the node. */
58
+ export type FlowDropRequest = {
59
+ data: string;
60
+ position: FlowPoint;
61
+ };
62
+ /** How far the view is moved, and how much it is zoomed. */
63
+ export type FlowViewport = {
64
+ x: number;
65
+ y: number;
66
+ zoom: number;
67
+ };
68
+ /** Where an edge starts and ends, and the tone of the exit it leaves by. */
69
+ export type FlowEdgeEnds = {
70
+ from: FlowPoint;
71
+ to: FlowPoint;
72
+ tone: Tone;
73
+ };
74
+ /** What a press on the canvas is doing: moving the view, moving a node, or drawing an edge from an exit. */
75
+ export type FlowGesture = {
76
+ kind: 'idle';
77
+ } | {
78
+ kind: 'pan';
79
+ start: FlowPoint;
80
+ origin: FlowViewport;
81
+ moved: boolean;
82
+ edge: string;
83
+ } | {
84
+ kind: 'drag';
85
+ node: string;
86
+ offset: FlowPoint;
87
+ start: FlowPoint;
88
+ moved: boolean;
89
+ } | {
90
+ kind: 'connect';
91
+ node: string;
92
+ port: string;
93
+ start: FlowPoint;
94
+ };
@@ -3,5 +3,7 @@ export type SegmentedOption = {
3
3
  value: string;
4
4
  label?: string;
5
5
  icon?: string;
6
+ /** A count or a short word after the label: what waits behind the choice. */
7
+ badge?: string | number;
6
8
  disabled?: boolean;
7
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syware/jlib",
3
- "version": "0.1.3",
3
+ "version": "0.3.0",
4
4
  "description": "A tree-shakeable component library on Jadis and native Web Components, organised in atomic design",
5
5
  "keywords": [
6
6
  "web-components",