@nanisoft/prism-ui 0.16.1 → 1.0.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/dist/.tsbuildinfo +1 -1
- package/dist/blocks/activity-feed-01/activity-feed-01.d.ts +120 -190
- package/dist/blocks/activity-feed-01/activity-feed-01.d.ts.map +1 -1
- package/dist/blocks/activity-feed-01/activity-feed-01.js +107 -97
- package/dist/blocks/activity-feed-01/index.d.ts +1 -1
- package/dist/blocks/activity-feed-01/index.d.ts.map +1 -1
- package/dist/blocks/auth-form-01/auth-form.d.ts +86 -53
- package/dist/blocks/auth-form-01/auth-form.d.ts.map +1 -1
- package/dist/blocks/auth-form-01/auth-form.js +95 -31
- package/dist/blocks/auth-form-01/index.d.ts +1 -1
- package/dist/blocks/auth-form-01/index.d.ts.map +1 -1
- package/dist/blocks/calendar-01/calendar.d.ts +28 -0
- package/dist/blocks/calendar-01/calendar.d.ts.map +1 -1
- package/dist/blocks/calendar-01/calendar.js +15 -1
- package/dist/blocks/card-index-01/card-index.d.ts +225 -0
- package/dist/blocks/card-index-01/card-index.d.ts.map +1 -0
- package/dist/blocks/card-index-01/card-index.js +154 -0
- package/dist/blocks/card-index-01/index.d.ts +3 -0
- package/dist/blocks/card-index-01/index.d.ts.map +1 -0
- package/dist/blocks/card-index-01/index.js +1 -0
- package/dist/blocks/chart-card-01/chart-card-01.d.ts +23 -21
- package/dist/blocks/chart-card-01/chart-card-01.d.ts.map +1 -1
- package/dist/blocks/chart-card-01/chart-card-01.js +46 -1
- package/dist/blocks/chart-card-01/index.d.ts +1 -1
- package/dist/blocks/chart-card-01/index.d.ts.map +1 -1
- package/dist/blocks/chart-group-01/chart-group-01.d.ts +3 -3
- package/dist/blocks/chart-group-01/chart-group-01.d.ts.map +1 -1
- package/dist/blocks/contact-01/contact.d.ts +30 -82
- package/dist/blocks/contact-01/contact.d.ts.map +1 -1
- package/dist/blocks/contact-01/contact.js +59 -30
- package/dist/blocks/contact-01/index.d.ts +1 -1
- package/dist/blocks/contact-01/index.d.ts.map +1 -1
- package/dist/blocks/dashboard-01/dashboard-01.d.ts +26 -71
- package/dist/blocks/dashboard-01/dashboard-01.d.ts.map +1 -1
- package/dist/blocks/dashboard-01/dashboard-01.js +34 -23
- package/dist/blocks/dashboard-01/index.d.ts +1 -1
- package/dist/blocks/dashboard-01/index.d.ts.map +1 -1
- package/dist/blocks/data-table-01/data-table.d.ts +276 -59
- package/dist/blocks/data-table-01/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table-01/data-table.js +217 -35
- package/dist/blocks/data-table-01/index.d.ts +1 -1
- package/dist/blocks/data-table-01/index.d.ts.map +1 -1
- package/dist/blocks/directory-01/directory-01.d.ts +23 -2
- package/dist/blocks/directory-01/directory-01.d.ts.map +1 -1
- package/dist/blocks/directory-01/directory-01.js +3 -3
- package/dist/blocks/empty-state-01/empty-state.d.ts +60 -21
- package/dist/blocks/empty-state-01/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state-01/empty-state.js +52 -17
- package/dist/blocks/index-detail-01/index-detail.d.ts +85 -0
- package/dist/blocks/index-detail-01/index-detail.d.ts.map +1 -0
- package/dist/blocks/index-detail-01/index-detail.js +58 -0
- package/dist/blocks/index-detail-01/index.d.ts +3 -0
- package/dist/blocks/index-detail-01/index.d.ts.map +1 -0
- package/dist/blocks/index-detail-01/index.js +1 -0
- package/dist/blocks/index.d.ts +20 -8
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/blocks/index.js +7 -0
- package/dist/blocks/issue-detail-01/issue-detail.d.ts +18 -0
- package/dist/blocks/issue-detail-01/issue-detail.d.ts.map +1 -1
- package/dist/blocks/issue-detail-01/issue-detail.js +18 -0
- package/dist/blocks/nothing-chosen-01/index.d.ts +3 -0
- package/dist/blocks/nothing-chosen-01/index.d.ts.map +1 -0
- package/dist/blocks/nothing-chosen-01/index.js +1 -0
- package/dist/blocks/nothing-chosen-01/nothing-chosen.d.ts +119 -0
- package/dist/blocks/nothing-chosen-01/nothing-chosen.d.ts.map +1 -0
- package/dist/blocks/nothing-chosen-01/nothing-chosen.js +79 -0
- package/dist/blocks/project-dashboard-01/index.d.ts +1 -1
- package/dist/blocks/project-dashboard-01/index.d.ts.map +1 -1
- package/dist/blocks/project-dashboard-01/project-dashboard.d.ts +21 -27
- package/dist/blocks/project-dashboard-01/project-dashboard.d.ts.map +1 -1
- package/dist/blocks/project-dashboard-01/project-dashboard.js +45 -5
- package/dist/blocks/provisioning-01/index.d.ts +1 -1
- package/dist/blocks/provisioning-01/index.d.ts.map +1 -1
- package/dist/blocks/provisioning-01/provisioning.d.ts +9 -97
- package/dist/blocks/provisioning-01/provisioning.d.ts.map +1 -1
- package/dist/blocks/provisioning-01/provisioning.js +26 -13
- package/dist/blocks/record-detail-01/index.d.ts +3 -0
- package/dist/blocks/record-detail-01/index.d.ts.map +1 -0
- package/dist/blocks/record-detail-01/index.js +1 -0
- package/dist/blocks/record-detail-01/record-detail.d.ts +239 -0
- package/dist/blocks/record-detail-01/record-detail.d.ts.map +1 -0
- package/dist/blocks/record-detail-01/record-detail.js +150 -0
- package/dist/blocks/record-form-01/index.d.ts +3 -0
- package/dist/blocks/record-form-01/index.d.ts.map +1 -0
- package/dist/blocks/record-form-01/index.js +1 -0
- package/dist/blocks/record-form-01/record-form.d.ts +148 -0
- package/dist/blocks/record-form-01/record-form.d.ts.map +1 -0
- package/dist/blocks/record-form-01/record-form.js +107 -0
- package/dist/blocks/record-grid-01/index.d.ts +3 -0
- package/dist/blocks/record-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/record-grid-01/index.js +1 -0
- package/dist/blocks/record-grid-01/record-grid.d.ts +145 -0
- package/dist/blocks/record-grid-01/record-grid.d.ts.map +1 -0
- package/dist/blocks/record-grid-01/record-grid.js +114 -0
- package/dist/blocks/record-wizard-01/index.d.ts +3 -0
- package/dist/blocks/record-wizard-01/index.d.ts.map +1 -0
- package/dist/blocks/record-wizard-01/index.js +1 -0
- package/dist/blocks/record-wizard-01/record-wizard.d.ts +152 -0
- package/dist/blocks/record-wizard-01/record-wizard.d.ts.map +1 -0
- package/dist/blocks/record-wizard-01/record-wizard.js +144 -0
- package/dist/blocks/settings-members-01/settings-members.d.ts +2 -1
- package/dist/blocks/settings-members-01/settings-members.d.ts.map +1 -1
- package/dist/blocks/settings-panel-01/index.d.ts +1 -1
- package/dist/blocks/settings-panel-01/index.d.ts.map +1 -1
- package/dist/blocks/settings-panel-01/settings-panel.d.ts +165 -67
- package/dist/blocks/settings-panel-01/settings-panel.d.ts.map +1 -1
- package/dist/blocks/settings-panel-01/settings-panel.js +92 -33
- package/dist/blocks/signup-01/index.d.ts +1 -1
- package/dist/blocks/signup-01/index.d.ts.map +1 -1
- package/dist/blocks/signup-01/signup-01.d.ts +10 -84
- package/dist/blocks/signup-01/signup-01.d.ts.map +1 -1
- package/dist/blocks/signup-01/signup-01.js +41 -23
- package/dist/blocks/stats-01/index.d.ts +5 -5
- package/dist/blocks/stats-01/index.d.ts.map +1 -1
- package/dist/blocks/stats-01/index.js +4 -4
- package/dist/blocks/stats-01/stats.d.ts +49 -14
- package/dist/blocks/stats-01/stats.d.ts.map +1 -1
- package/dist/blocks/stats-01/stats.js +65 -15
- package/dist/blocks/trend-01/index.d.ts +1 -1
- package/dist/blocks/trend-01/index.d.ts.map +1 -1
- package/dist/blocks/trend-01/trend.d.ts +26 -73
- package/dist/blocks/trend-01/trend.d.ts.map +1 -1
- package/dist/blocks/trend-01/trend.js +47 -30
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +93 -3
- package/dist/components/ui/metric.d.ts +4 -2
- package/dist/components/ui/metric.d.ts.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/lib/field-render.d.ts +107 -0
- package/dist/lib/field-render.d.ts.map +1 -0
- package/dist/lib/field-render.js +251 -0
- package/dist/lib/spec.d.ts +609 -0
- package/dist/lib/spec.d.ts.map +1 -0
- package/dist/lib/spec.js +1 -0
- package/dist/live/index.d.ts +2 -0
- package/dist/live/index.d.ts.map +1 -1
- package/dist/live/index.js +6 -0
- package/dist/live/message-thread-01/index.d.ts +3 -0
- package/dist/live/message-thread-01/index.d.ts.map +1 -0
- package/dist/live/message-thread-01/index.js +1 -0
- package/dist/live/message-thread-01/message-thread.d.ts +282 -0
- package/dist/live/message-thread-01/message-thread.d.ts.map +1 -0
- package/dist/live/message-thread-01/message-thread.js +221 -0
- package/dist/live/run-stream-01/run-stream.d.ts +2 -1
- package/dist/live/run-stream-01/run-stream.d.ts.map +1 -1
- package/dist/live/run-stream-01/run-stream.js +1 -7
- package/dist/live/status.d.ts +27 -0
- package/dist/live/status.d.ts.map +1 -0
- package/dist/live/status.js +15 -0
- package/dist/live/tool-call-row.d.ts +26 -0
- package/dist/live/tool-call-row.d.ts.map +1 -0
- package/dist/live/tool-call-row.js +60 -0
- package/dist/live/tool-ledger-01/tool-ledger.d.ts.map +1 -1
- package/dist/live/tool-ledger-01/tool-ledger.js +2 -42
- package/dist/pages/contact-page/index.d.ts +7 -7
- package/dist/pages/contact-page/index.d.ts.map +1 -1
- package/dist/pages/contact-page/index.js +17 -5
- package/dist/pages/document-page/document-page.d.ts +146 -0
- package/dist/pages/document-page/document-page.d.ts.map +1 -0
- package/dist/pages/document-page/document-page.js +80 -0
- package/dist/pages/document-page/index.d.ts +3 -0
- package/dist/pages/document-page/index.d.ts.map +1 -0
- package/dist/pages/document-page/index.js +1 -0
- package/dist/pages/index.d.ts +2 -0
- package/dist/pages/index.d.ts.map +1 -1
- package/dist/pages/index.js +6 -0
- package/dist/styles.css +35 -3
- package/package.json +7 -2
|
@@ -1,104 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type HeadingLevel } from '../../components/ui/section.js';
|
|
3
|
-
import {
|
|
4
|
-
/**
|
|
5
|
-
* One thing that happened: who did it, what they did, to what, and when.
|
|
6
|
-
*
|
|
7
|
-
* **`actor`, `action`, `target` and `at` are four fields because a record of what
|
|
8
|
-
* happened has four parts and no others.** Every other surface in this repository
|
|
9
|
-
* that shows a record of an event has arrived at the same four by a different route,
|
|
10
|
-
* and each has added a fifth: a source, a category, a severity, a free text field. A
|
|
11
|
-
* fifth field is a claim about the reader's product, because a Block cannot know
|
|
12
|
-
* whether a fifth thing is required, and a caller who has one composes it in
|
|
13
|
-
* `detail`, which is a node. So the shape is closed at four and the rest is a slot.
|
|
14
|
-
*
|
|
15
|
-
* `id` is a key and is never rendered, for the reason `ContentGrid01Entry`'s id is: a
|
|
16
|
-
* feed is reordered by a consumer as often as it is read, and a key made of the
|
|
17
|
-
* words means a rename in the copy is a rename in the key.
|
|
18
|
-
*/
|
|
19
|
-
export type ActivityFeed01Event = {
|
|
20
|
-
/** A key unique within the feed, carried on the markup as `data-event`. */
|
|
21
|
-
id: string;
|
|
22
|
-
/**
|
|
23
|
-
* Who did it, in the words a reader would use for them.
|
|
24
|
-
*
|
|
25
|
-
* A `string` rather than a node because a feed is scanned down this edge and a
|
|
26
|
-
* column that wraps is a column that does not line up. A caller whose actor is a
|
|
27
|
-
* person with an avatar composes the avatar into `detail` instead.
|
|
28
|
-
*/
|
|
29
|
-
actor: string;
|
|
30
|
-
/**
|
|
31
|
-
* What they did, in the product's own verb.
|
|
32
|
-
*
|
|
33
|
-
* A verb and not a sentence, because the three fields are drawn as one run of
|
|
34
|
-
* words: the actor, then this, then the target. A caller whose event needs a full
|
|
35
|
-
* clause writes the clause here and the run reads as one, which is the same thing
|
|
36
|
-
* with a different boundary.
|
|
37
|
-
*/
|
|
38
|
-
action: string;
|
|
39
|
-
/**
|
|
40
|
-
* What they did it to: a run, a document, a setting, a person.
|
|
41
|
-
*
|
|
42
|
-
* Optional because a record of what happened sometimes has nothing to point at: a
|
|
43
|
-
* sign-in, a logout, a nightly job that names no document. A caller with a target
|
|
44
|
-
* passes one; a caller whose target is a node composes it into `detail`.
|
|
45
|
-
*/
|
|
46
|
-
target?: string;
|
|
47
|
-
/**
|
|
48
|
-
* When it happened, printed exactly as passed.
|
|
49
|
-
*
|
|
50
|
-
* A `number` or a `string` and never a `Date`, and the reason is the one
|
|
51
|
-
* `ContentGrid01Entry`'s `at` gives: a Block ships no formatting, so the reading a
|
|
52
|
-
* reader should see is the caller's own. A number is epoch milliseconds and is
|
|
53
|
-
* printed as a number, which is honest and almost never what was wanted; a string
|
|
54
|
-
* is printed as written, so `2026-09-30`, `30 September` and `Q3` are all readings
|
|
55
|
-
* a caller writes and this Block parses none of them. The machine value is still
|
|
56
|
-
* there, on the `time` element's `dateTime`, so a crawler and a screen reader get a
|
|
57
|
-
* timestamp whatever the visible reading says.
|
|
58
|
-
*
|
|
59
|
-
* A caller who wants a localised reading and a relative phrase composes
|
|
60
|
-
* `relative-time` beside it and passes the node in `detail`, which is the one node
|
|
61
|
-
* slot a row has, so the reading sits under the record rather than inside it. See
|
|
62
|
-
* the Block's JSDoc for the whole of that argument.
|
|
63
|
-
*/
|
|
64
|
-
at: number | string;
|
|
65
|
-
/**
|
|
66
|
-
* The line under the record, for whatever the caller wants said about it: the
|
|
67
|
-
* reason, the payload, the diff, a composed `relative-time` reading.
|
|
68
|
-
*
|
|
69
|
-
* A node rather than a `string` for exactly that last reason. A caller with four
|
|
70
|
-
* words of context passes four words; a caller with a table, a code block or a
|
|
71
|
-
* timestamp passes the Component.
|
|
72
|
-
*/
|
|
73
|
-
detail?: ReactNode;
|
|
74
|
-
/**
|
|
75
|
-
* The tone of the event, drawn as a `Status` beside the record.
|
|
76
|
-
*
|
|
77
|
-
* See the Block's JSDoc for why a tone arrives without a label: the label this
|
|
78
|
-
* Block draws is the machine value itself, which is what `Changelog01` does with a
|
|
79
|
-
* change's kind, and the alternative is a coloured dot with nothing beside it,
|
|
80
|
-
* which is a mark only a reader who can separate the tones can see.
|
|
81
|
-
*/
|
|
82
|
-
tone?: StatusTone;
|
|
83
|
-
/** Where the record is kept. Its presence puts a link on the row. */
|
|
84
|
-
href?: string;
|
|
85
|
-
/**
|
|
86
|
-
* The words on the link, and required whenever `href` is.
|
|
87
|
-
*
|
|
88
|
-
* A link whose only words are the record's own three fields tells a reader nothing
|
|
89
|
-
* about what following it does, and a feed of ten links all reading "Open" is ten
|
|
90
|
-
* identical controls.
|
|
91
|
-
*/
|
|
92
|
-
hrefLabel?: string;
|
|
93
|
-
};
|
|
3
|
+
import type { EventSpec } from '../../lib/spec.js';
|
|
94
4
|
/**
|
|
95
5
|
* The props an ActivityFeed01 takes, as a union over whether the feed is grouped.
|
|
96
6
|
*
|
|
97
7
|
* A union rather than an optional `dayLabel` beside an optional `groupBy`, for the
|
|
98
|
-
* reason `HeroAction` is the reference: a `dayLabel` that is optional in the
|
|
99
|
-
* arm and required in the grouped one is a prop whose absence is
|
|
100
|
-
* and sometimes a decision, and a caller who writes
|
|
101
|
-
* label should not compile.
|
|
8
|
+
* reason `HeroAction` is the reference: a `dayLabel` that is optional in the
|
|
9
|
+
* ungrouped arm and required in the grouped one is a prop whose absence is
|
|
10
|
+
* sometimes a mistake and sometimes a decision, and a caller who writes
|
|
11
|
+
* `groupBy="day"` and forgets the label should not compile.
|
|
102
12
|
*/
|
|
103
13
|
export type ActivityFeed01Props = {
|
|
104
14
|
/** Optional label above the section title. See the No-Default-Eyebrow Rule. */
|
|
@@ -108,41 +18,57 @@ export type ActivityFeed01Props = {
|
|
|
108
18
|
/** One or two sentences under the title. */
|
|
109
19
|
description?: string;
|
|
110
20
|
/**
|
|
111
|
-
* The events, newest first unless the
|
|
21
|
+
* The events, from the shared event specification, newest first unless the
|
|
22
|
+
* product says otherwise.
|
|
23
|
+
*
|
|
24
|
+
* The entries are `EventSpec` from `@nanisoft/prism-ui/spec`, which is the one
|
|
25
|
+
* declaration of a dated attributed occurrence every Block in this package
|
|
26
|
+
* takes, so a shipment scan, a sign in and a permission change are one shape and
|
|
27
|
+
* no second event type is minted here. Each entry carries a stable `key`, a
|
|
28
|
+
* moment printed exactly as passed, a required `actor` and `action`, an optional
|
|
29
|
+
* `target`, an optional `detail` node, a `tone` with its required `toneLabel`,
|
|
30
|
+
* and an `href` with its required `hrefLabel`.
|
|
31
|
+
*
|
|
32
|
+
* **It names no vocabulary of what happened.** There is no `kind` member,
|
|
33
|
+
* because an event's kind would name what somebody's product calls a thing that
|
|
34
|
+
* happened, and no enumeration of those is this package's to publish: a caller
|
|
35
|
+
* needing one puts the word in `action` or composes a status into `detail`. It
|
|
36
|
+
* carries no progress figure, no severity, no duration and no role, each refused
|
|
37
|
+
* for a reason rather than left out. See the specification module's own JSDoc.
|
|
112
38
|
*
|
|
113
|
-
* The Block does not sort, and the reason is the one `StatusLedger01` gives for
|
|
114
|
-
* rows: order is a claim about what happened first, and a feed that sorted
|
|
115
|
-
* would be making that claim on the caller's behalf. A caller's order is
|
|
116
|
-
* only order that can express the exceptions, because a feed is where a
|
|
117
|
-
* record lives and a Block cannot know an event is pinned.
|
|
39
|
+
* The Block does not sort, and the reason is the one `StatusLedger01` gives for
|
|
40
|
+
* its rows: order is a claim about what happened first, and a feed that sorted
|
|
41
|
+
* itself would be making that claim on the caller's behalf. A caller's order is
|
|
42
|
+
* also the only order that can express the exceptions, because a feed is where a
|
|
43
|
+
* pinned record lives and a Block cannot know an event is pinned.
|
|
118
44
|
*/
|
|
119
|
-
events:
|
|
45
|
+
events: EventSpec[];
|
|
120
46
|
/**
|
|
121
|
-
* Called with an event's
|
|
122
|
-
* a control at all.
|
|
47
|
+
* Called with an event's key when its row is activated, and the only reason a row
|
|
48
|
+
* is a control at all.
|
|
123
49
|
*
|
|
124
|
-
* A row with no handler is a `li`, which is a record a reader reads; a row with
|
|
125
|
-
* is a `button`, which is a thing a reader does. That is the whole of the
|
|
126
|
-
* it is why a feed is a list first and a set of controls second. The
|
|
127
|
-
* was to make every row a button, which is a feed of forty tab stops
|
|
128
|
-
* tabbing through the page lands on the fortieth record before
|
|
129
|
-
* after the feed.
|
|
50
|
+
* A row with no handler is a `li`, which is a record a reader reads; a row with
|
|
51
|
+
* one is a `button`, which is a thing a reader does. That is the whole of the
|
|
52
|
+
* rule, and it is why a feed is a list first and a set of controls second. The
|
|
53
|
+
* alternative was to make every row a button, which is a feed of forty tab stops
|
|
54
|
+
* where a reader tabbing through the page lands on the fortieth record before
|
|
55
|
+
* reaching anything after the feed.
|
|
130
56
|
*
|
|
131
57
|
* An event's destination is a separate control with the caller's own words, so a
|
|
132
58
|
* row can be selectable and linked at once, and that is the arrangement a feed
|
|
133
59
|
* actually wants: a reader activates the row to open the thing and the caller
|
|
134
60
|
* marks it read on the way past.
|
|
135
61
|
*/
|
|
136
|
-
onSelect?: (
|
|
62
|
+
onSelect?: (key: string) => void;
|
|
137
63
|
/**
|
|
138
64
|
* How many of the events to draw.
|
|
139
65
|
*
|
|
140
|
-
* Optional, and the cost is the honest one: a capped feed that says nothing
|
|
141
|
-
* what it left out is a feed a reader believes is complete. So the words
|
|
142
|
-
* say it are the caller's, and the caller's way of saying them is to
|
|
143
|
-
* can stand behind and put the rest behind its own link. The
|
|
144
|
-
* `truncatedLabel` prop beside this one, which is a sentence
|
|
145
|
-
* every consumer's product.
|
|
66
|
+
* Optional, and the cost is the honest one: a capped feed that says nothing
|
|
67
|
+
* about what it left out is a feed a reader believes is complete. So the words
|
|
68
|
+
* that would say it are the caller's, and the caller's way of saying them is to
|
|
69
|
+
* pass a limit it can stand behind and put the rest behind its own link. The
|
|
70
|
+
* alternative was a `truncatedLabel` prop beside this one, which is a sentence
|
|
71
|
+
* Prism would ship into every consumer's product.
|
|
146
72
|
*/
|
|
147
73
|
limit?: number;
|
|
148
74
|
/**
|
|
@@ -150,8 +76,8 @@ export type ActivityFeed01Props = {
|
|
|
150
76
|
*
|
|
151
77
|
* Required, and it is the one line a reader with a question and no answer is
|
|
152
78
|
* guaranteed to read. It is also the sentence Prism is least entitled to write:
|
|
153
|
-
* "Nothing has happened yet" is a claim about a product and a period, and both
|
|
154
|
-
* the caller's.
|
|
79
|
+
* "Nothing has happened yet" is a claim about a product and a period, and both
|
|
80
|
+
* are the caller's.
|
|
155
81
|
*/
|
|
156
82
|
empty: ReactNode;
|
|
157
83
|
/** Heading level for the section title. See `HeadingLevel`. */
|
|
@@ -165,20 +91,21 @@ export type ActivityFeed01Props = {
|
|
|
165
91
|
/**
|
|
166
92
|
* Group the events under a heading per day.
|
|
167
93
|
*
|
|
168
|
-
* A day heading is a heading and not a divider, because a reader who
|
|
169
|
-
* by heading is looking for the day they want and a rule between
|
|
170
|
-
* invisible to them.
|
|
94
|
+
* A day heading is a heading and not a divider, because a reader who
|
|
95
|
+
* navigates by heading is looking for the day they want and a rule between
|
|
96
|
+
* two groups is invisible to them.
|
|
171
97
|
*/
|
|
172
98
|
groupBy: 'day';
|
|
173
99
|
/**
|
|
174
100
|
* The words for a day, given the day.
|
|
175
101
|
*
|
|
176
102
|
* Required in this arm, and a function rather than a string, because "Today",
|
|
177
|
-
* "Yesterday" and "Tuesday" are the product's sentences and the key is a
|
|
178
|
-
* The key is an ISO calendar date in the runtime's own zone, so a
|
|
179
|
-
* it to `Intl.DateTimeFormat` and gets their locale's reading of
|
|
180
|
-
* their own. The rejected alternative was the Block calling
|
|
181
|
-
* would put a locale this package does not own into
|
|
103
|
+
* "Yesterday" and "Tuesday" are the product's sentences and the key is a
|
|
104
|
+
* fact. The key is an ISO calendar date in the runtime's own zone, so a
|
|
105
|
+
* caller hands it to `Intl.DateTimeFormat` and gets their locale's reading of
|
|
106
|
+
* it, or writes their own. The rejected alternative was the Block calling
|
|
107
|
+
* `Intl` itself, which would put a locale this package does not own into
|
|
108
|
+
* every consumer's feed.
|
|
182
109
|
*/
|
|
183
110
|
dayLabel: (key: string) => string;
|
|
184
111
|
} | {
|
|
@@ -188,83 +115,86 @@ export type ActivityFeed01Props = {
|
|
|
188
115
|
dayLabel?: never;
|
|
189
116
|
});
|
|
190
117
|
/**
|
|
191
|
-
* A chronological list of what happened:
|
|
192
|
-
*
|
|
118
|
+
* A chronological list of what happened: the shared event specification, one record
|
|
119
|
+
* per entry, with an optional line under each.
|
|
193
120
|
*
|
|
194
|
-
* **The
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
121
|
+
* **The trail's entry declaration is `EventSpec`, and this Block mints no second
|
|
122
|
+
* event shape beside it.** `@nanisoft/prism-ui/spec` is the one declaration of a
|
|
123
|
+
* dated attributed occurrence in this package, so a shipment scan, a sign in and a
|
|
124
|
+
* permission change are one type and the vocabulary a consumer learns on this Block
|
|
125
|
+
* is the vocabulary everywhere an occurrence is drawn. An event carries a stable
|
|
126
|
+
* `key` that is never the words of a label, a moment printed exactly as the caller
|
|
127
|
+
* passed it with the machine value on the element, a required `actor` and `action`,
|
|
128
|
+
* an optional `target`, an optional `detail` node for the diff, the payload or the
|
|
129
|
+
* composed reading that four fields cannot hold, a `tone` whose label is required
|
|
130
|
+
* wherever the tone is set, and a destination whose words are required wherever it
|
|
131
|
+
* is set.
|
|
203
132
|
*
|
|
204
|
-
* **
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
133
|
+
* **It names no vocabulary of what happened, and there is no `kind` member.** An
|
|
134
|
+
* event's kind would name what somebody's product calls a thing that happened, and
|
|
135
|
+
* no enumeration of those is this package's to publish: a member on a Prism type
|
|
136
|
+
* would be promising that every consumer's world is this one. A caller needing one
|
|
137
|
+
* puts the word in `action` or composes a `Status` into `detail`. It carries no
|
|
138
|
+
* `progress`, no `severity`, no `duration` and no `role`, each refused for a reason
|
|
139
|
+
* rather than left out, and the specification module's own JSDoc is the whole of
|
|
140
|
+
* that argument.
|
|
141
|
+
*
|
|
142
|
+
* **The words are the caller's and the shape is Prism's.** A feed that composed the
|
|
143
|
+
* sentence would ship English into every consumer's product: "Ada published a
|
|
144
|
+
* release four hours ago" is a word order, an article, an inflected verb and a
|
|
145
|
+
* relative phrase, and a Block that assembled it would have assembled the English
|
|
146
|
+
* one and given the consumer no way to translate it, inflect it or reorder it. So
|
|
147
|
+
* this Block takes the parts as the caller's own nodes and draws them as one run of
|
|
148
|
+
* words, which is the most a design system can do without writing a sentence.
|
|
211
149
|
*
|
|
212
150
|
* **`at` is printed exactly as passed, and the Block formats no moment.** A Block
|
|
213
151
|
* that formatted one would have to pick a locale, a calendar and a granularity, and
|
|
214
|
-
* `relative-time` already holds that decision
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
152
|
+
* `relative-time` already holds that decision: it formats the absolute reading with
|
|
153
|
+
* the platform and hands the sentence back. So this Block prints the caller's value,
|
|
154
|
+
* puts the ISO form on the `time` element's `dateTime` so a crawler and a screen
|
|
155
|
+
* reader get a timestamp whatever the visible reading says, and a caller who wants a
|
|
156
|
+
* relative phrase composes the node beside the record in `detail`.
|
|
157
|
+
*
|
|
158
|
+
* **A vertical arrangement's only spatial claim is order, and this Block draws no
|
|
159
|
+
* length.** There is no scale, no range, no bar and no axis: a bar's length is a
|
|
160
|
+
* claim about a difference between two caller moments, and time as an axis belongs
|
|
161
|
+
* to a screen that composes `Gantt01` or `Calendar01` instead. Append only is a
|
|
162
|
+
* rendering fact and nothing more: what is rendered is the entries it was handed, in
|
|
163
|
+
* the order it was handed, with no control that edits one, removes one or reorders
|
|
164
|
+
* one, and that absence is what append only means. What the Block cannot render is
|
|
165
|
+
* that the record is immutable, tamper evident, signed, sealed or retained, because
|
|
166
|
+
* a Block has no authority over the store behind it: so there is no `immutable`
|
|
167
|
+
* prop, no seal glyph and no verification mark, and no retention window, archive,
|
|
168
|
+
* purge, legal hold, export, freshness or as-of clock. A consumer whose domain
|
|
169
|
+
* requires one enforces it in its own store and shows what the store says.
|
|
223
170
|
*
|
|
224
|
-
* **A row is a control only when there is something for it to do.** An event with
|
|
225
|
-
* handler renders as a `li`, which is a record a reader reads and not a thing
|
|
226
|
-
* act on. The destination is a separate control carrying the caller's own
|
|
227
|
-
* row can be selectable and linked at once, which is the arrangement a
|
|
228
|
-
* wants: a reader activates the row to open the thing, and the caller
|
|
229
|
-
* the way past.
|
|
230
|
-
* links is a page where the tab order runs down the whole feed before it reaches
|
|
231
|
-
* anything after it.
|
|
171
|
+
* **A row is a control only when there is something for it to do.** An event with
|
|
172
|
+
* no handler renders as a `li`, which is a record a reader reads and not a thing
|
|
173
|
+
* they act on. The destination is a separate control carrying the caller's own
|
|
174
|
+
* words, so a row can be selectable and linked at once, which is the arrangement a
|
|
175
|
+
* feed actually wants: a reader activates the row to open the thing, and the caller
|
|
176
|
+
* marks it read on the way past.
|
|
232
177
|
*
|
|
233
178
|
* **A day group is a list item holding a heading and a nested list, and not a merged
|
|
234
179
|
* row.** The structure is an `ol` of `li` and each `li` is a heading plus its own
|
|
235
180
|
* `ol`, because a reader moving by list item should hear how many days there are and
|
|
236
|
-
* then how many records are in the day they are reading. The
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* outline with it, and the day groups themselves are not headings at the same level,
|
|
241
|
-
* which is what makes a list of days a list rather than a flat run of headings.
|
|
242
|
-
*
|
|
243
|
-
* **The order is the caller's and the Block never sorts.** A feed is the surface
|
|
244
|
-
* where the exceptions live: a pinned event, a run that arrived late, a record the
|
|
245
|
-
* caller wants beside its own retry. A Block that sorted by moment would move the
|
|
246
|
-
* pin, and the caller would have to add a flag and this Block would have to know what
|
|
247
|
-
* the flag meant. The groups follow the order the days first appear, so a pinned
|
|
248
|
-
* event from yesterday puts yesterday first, which is the only arrangement that
|
|
249
|
-
* survives a pin.
|
|
181
|
+
* then how many records are in the day they are reading. The day heading is at
|
|
182
|
+
* `childLevel(headingLevel)`, so a feed embedded one level deeper carries its outline
|
|
183
|
+
* with it, and the groups follow the order the days first appear, so a pinned event
|
|
184
|
+
* from yesterday keeps yesterday where the caller put it.
|
|
250
185
|
*
|
|
251
|
-
* **The
|
|
252
|
-
* feed is
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
* differently composes its own mark into `detail` and leaves `tone` unset. That is
|
|
260
|
-
* the cost of the split, stated rather than hidden.
|
|
186
|
+
* **The order is the caller's and the Block never sorts, groups or aggregates.** A
|
|
187
|
+
* feed is the surface where the exceptions live: a pinned event, a run that arrived
|
|
188
|
+
* late, a record the caller wants beside its own retry. The day grouping is content
|
|
189
|
+
* rather than structure, a caller-supplied key with a caller-supplied label, and the
|
|
190
|
+
* Block owns no count, no rate and no elapsed figure. It owns no navigation and no
|
|
191
|
+
* address, so the only route out of an entry is the caller's `href`, and it holds no
|
|
192
|
+
* selection state, because a trail is read and the index holds the set a batch action
|
|
193
|
+
* acts on.
|
|
261
194
|
*
|
|
262
195
|
* It is a client Component, and the reason is the handler rather than the state, as
|
|
263
196
|
* in `data-table-01`: `onSelect` is a function, a function is a piece of state, and
|
|
264
|
-
* state is a client module.
|
|
265
|
-
* `onSelect` is a static list that ships this file's client runtime for nothing, and
|
|
266
|
-
* the fix for a consumer who needs that surface to be static is a `ReactNode` slot of
|
|
267
|
-
* their own rather than a Block that attaches a handler to every row.
|
|
197
|
+
* state is a client module.
|
|
268
198
|
*/
|
|
269
199
|
export declare function ActivityFeed01({ eyebrow, title, description, events, onSelect, limit, empty, groupBy, dayLabel, headingLevel, className, }: ActivityFeed01Props): import("react").JSX.Element;
|
|
270
200
|
export default ActivityFeed01;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-feed-01.d.ts","sourceRoot":"","sources":["../../../src/blocks/activity-feed-01/activity-feed-01.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"activity-feed-01.d.ts","sourceRoot":"","sources":["../../../src/blocks/activity-feed-01/activity-feed-01.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AA4C/C;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;;;OAOG;IACH,KAAK,EAAE,SAAS,CAAA;IAChB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,CACA;IACE;;;;;;OAMG;IACH,OAAO,EAAE,KAAK,CAAA;IACd;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CAClC,GACD;IACE,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CACJ,CAAA;AAiHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,KAAK,EACL,WAAW,EACX,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,EACL,OAAgB,EAChB,QAAQ,EACR,YAAmB,EACnB,SAAS,GACV,EAAE,mBAAmB,+BAkGrB;AAED,eAAe,cAAc,CAAA"}
|