@crewlethq/ui 0.19.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/README.md +32 -3
- package/dist/AppShell/AccountRow.d.ts +24 -2
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +3 -1
- package/dist/{AppShell-RUNVM4WH.css → AppShell-APHZKJYH.css} +25 -3
- package/dist/CommandPalette/index.js +3 -3
- package/dist/CommentThread/CommentThread.d.ts +85 -0
- package/dist/CommentThread/index.d.ts +3 -0
- package/dist/CommentThread/index.js +16 -0
- package/dist/CommentThread-7VXOFTZO.css +90 -0
- package/dist/ConflictNote/ConflictNote.d.ts +42 -0
- package/dist/ConflictNote/index.d.ts +3 -0
- package/dist/ConflictNote/index.js +4 -0
- package/dist/ConflictNote-DH77PYF7.css +27 -0
- package/dist/DataTable/index.js +4 -4
- package/dist/DataView/index.js +6 -6
- package/dist/DateTimePicker/index.js +2 -2
- package/dist/DiffView/DiffView.d.ts +59 -0
- package/dist/DiffView/diff.d.ts +97 -0
- package/dist/DiffView/index.d.ts +5 -0
- package/dist/DiffView/index.js +3 -0
- package/dist/DiffView-RVLIHTKG.css +91 -0
- package/dist/LinkInterstitial/index.js +3 -3
- package/dist/Menu/Menu.d.ts +28 -2
- package/dist/Menu/index.d.ts +1 -1
- package/dist/Menu/index.js +1 -1
- package/dist/{Menu-BT5PMFJI.css → Menu-XIJ4LQUT.css} +15 -0
- package/dist/Modal/index.js +2 -2
- package/dist/PeopleRail/PeopleRail.d.ts +52 -0
- package/dist/PeopleRail/index.d.ts +3 -0
- package/dist/PeopleRail/index.js +11 -0
- package/dist/PeopleRail-R64WVOSH.css +75 -0
- package/dist/ShareDialog/index.js +3 -3
- package/dist/SheetGrid/index.js +3 -3
- package/dist/Switcher/index.js +3 -3
- package/dist/TableCells/TableCells.d.ts +153 -0
- package/dist/TableCells/index.d.ts +3 -0
- package/dist/TableCells/index.js +10 -0
- package/dist/TableCells-3VN5N2M3.css +104 -0
- package/dist/TimeWindowPicker/index.js +2 -2
- package/dist/VersionCompare/VersionCompare.d.ts +70 -0
- package/dist/VersionCompare/index.d.ts +3 -0
- package/dist/VersionCompare/index.js +11 -0
- package/dist/VersionCompare-UUZOPTQO.css +68 -0
- package/dist/VersionTimeline/index.js +2 -2
- package/dist/{chunk-UXELEORU.js → chunk-4HRB62EA.js} +1 -1
- package/dist/{chunk-JULMZNGT.js → chunk-4MIM356A.js} +18 -7
- package/dist/chunk-73QBUUYX.js +102 -0
- package/dist/{chunk-7FQEUNHX.js → chunk-7X5WOECO.js} +1 -1
- package/dist/{chunk-OIMAK5AE.js → chunk-AV6YX4GZ.js} +4 -4
- package/dist/chunk-BVWSLXTY.js +187 -0
- package/dist/{chunk-EDGCPVVD.js → chunk-G5TAKMEA.js} +27 -3
- package/dist/chunk-IC64IWOO.js +176 -0
- package/dist/chunk-J4OKGJQ6.js +96 -0
- package/dist/{chunk-AJESMWJS.js → chunk-LG244LY7.js} +3 -3
- package/dist/chunk-MUGM7SEG.js +88 -0
- package/dist/chunk-UO7JZVCO.js +35 -0
- package/dist/{chunk-HTCJSUIZ.js → chunk-XMGB3ZAT.js} +2 -2
- package/dist/{chunk-RT323I4I.js → chunk-ZM7HLFOA.js} +1 -1
- package/dist/generated/index.d.ts +6 -0
- package/dist/generated/index.js +52 -46
- package/dist/index.js +52 -46
- package/dist/styles.css +515 -5
- package/package.json +3 -3
- package/dist/{chunk-PUQY4WXR.js → chunk-36CWC2NH.js} +1 -1
- package/dist/{chunk-7IJARUIF.js → chunk-F4DPAJCN.js} +1 -1
- package/dist/{chunk-4Z7PW3L6.js → chunk-MSSZHDZI.js} +0 -0
- package/dist/{chunk-EIGEIT4O.js → chunk-NUZC6PJX.js} +1 -1
- package/dist/{chunk-L4H7SSWF.js → chunk-RE6ED5TO.js} +1 -1
- package/dist/{chunk-WXAULPBH.js → chunk-UNZ7TVV5.js} +1 -1
package/README.md
CHANGED
|
@@ -43,9 +43,10 @@ import { Button } from '@crewlethq/ui/Button'; // 8 KB of CSS, not 182 KB
|
|
|
43
43
|
| Actions | `Button` and `ButtonLink` (variants `primary`, `secondary`, `outline`, `ghost`, `accent`, `danger`; sizes `small`, `medium`, `large`; shapes `square`, `pill`), `IconButton`, `Menu`, `Link`, `Copyable`, `CopyButton`, `DownloadButton`, `Kbd` |
|
|
44
44
|
| Content and text | `Text` (the eight registers and `inherit`), `Prose`, `Document` and `DocumentTitle`, `Highlight`, `InlineCode`, `List` and `ListItem`, `DescriptionList`, `Timeline`, `RelativeTime`, `Note`, `Divider` |
|
|
45
45
|
| Forms | `Input`, `Textarea`, `Label`, `FormField`, `FormRow`, `Checkbox`, `CheckboxGroup`, `ConfirmField`, `Select`, `Tag`, `TagsInput`, `DateTimePicker`, `TimeWindowPicker`, `ImageUpload`, `CharacterPicker`, `HuePicker`, `AvatarPicker`, `FactList`, `ChoiceList`, `Composer`, `MarkdownEditor` |
|
|
46
|
-
| Data display | `DataTable`, `CopyableCell`, `Table`, `StatCard`, `Meter`, `SegmentedMeter`, `Stepper`, `PricingCard`, `Avatar`, `AvatarStack`, `EntityChip`, `CodeBlock`, `QrCode`, `ObjectHeader`, `FactLine`, `SetByLine`, `Skeleton`, `Eyebrow`, `StatGroup`, `PinTile`, `IconTile` |
|
|
46
|
+
| Data display | `DataTable`, `CopyableCell`, `Table`, the read-only table cells (`TableKeyCell`, `TableNumberCell`, `TableDateCell`, `TableEntityCell`, `TableStatusCell`, `TableTagsCell`, `TableTextCell`), `StatCard`, `Meter`, `SegmentedMeter`, `Stepper`, `PricingCard`, `Avatar`, `AvatarStack`, `EntityChip`, `CodeBlock`, `QrCode`, `ObjectHeader`, `FactLine`, `SetByLine`, `Skeleton`, `Eyebrow`, `StatGroup`, `PinTile`, `IconTile` |
|
|
47
47
|
| List screens | `DataView`, and its parts on their own: `DataViewToolbar`, `FilterAxisBar`, `FilterAxisChip`, plus the filter model (`filterDefsFromColumns`, `applyColumnFilters`, `filterPredicate`, `blankFilterValue`) |
|
|
48
|
-
| Feedback and overlays | `Callout`, `Toaster`, `Modal` (with `variant="sheet"`), `ConfirmModal`, `CommandPalette`, `Tooltip`, `Popover`, `Announcer` |
|
|
48
|
+
| Feedback and overlays | `Callout`, `ConflictNote`, `Toaster`, `Modal` (with `variant="sheet"`), `ConfirmModal`, `CommandPalette`, `Tooltip`, `Popover`, `Announcer` |
|
|
49
|
+
| Documents and review | `DiffView` and `DiffSummary` with the line diff they draw (`diffLines`, `diffStat`, `collapseDiff`, `firstChangedLines`, `splitLines`, `MAX_DIFF_LINES`, with no React in it), `DiffList`, `VersionCompare`, `CommentThread` |
|
|
49
50
|
| Charts | `Legend`, `BarList`, `StackedBar`, `StackedColumns`, `ActivityStrip`, `TimeSeries`, `Sparkline`, the reading layer they share (`ChartTooltip`, `useChartHover`), and the ramp (`DATA_COLORS`, `DATA_COLOR_OTHER`, `dataColor`) |
|
|
50
51
|
| Marks | `Count`, `StatusDot`, `EmptyValue`, `VisuallyHidden` |
|
|
51
52
|
| Hooks and seams | `useModalLayer`, `usePopupLayer`, `LayerHost`, `useListbox`, `useOptionKeys`, `useHighlightRest` and `HIGHLIGHT_REST_MS`, `useClipboard`, `useDownload`, `downloadText`, `safeFilename`, `useOutcome`, `useAnnouncer`, `useNow`, `formatRelative`, `HeadingLevelProvider`, `cx`, the node hues (`NODE_HUES`, `NODE_HUE_NAMES`, `isNodeHue`) |
|
|
@@ -55,7 +56,7 @@ import { Button } from '@crewlethq/ui/Button'; // 8 KB of CSS, not 182 KB
|
|
|
55
56
|
| Preferences | `ThemeToggle`, `ThemeSwitcher`, `DensitySwitcher`, `ThemeGallery`, `ThemeSwatch`, `useThemePreference`, `useDensityPreference`, `useSystemTheme`, `resolveTheme`, `applyStoredPreferences`, and the framework-free `applyTheme`, `applyPalette`, `applyDensity` with `THEME_PREFERENCES`, `DENSITY_PREFERENCES` and their guards |
|
|
56
57
|
| Artifacts | `SandboxedFrame`, `LinkInterstitial` and `openExternal`, `VersionTimeline`, `ShareDialog` with the role ladder (`ARTIFACT_ROLES`, `SHAREABLE_ROLES`, `roleAtLeast`), `PrincipalPicker`, `Principal` and `PrincipalAvatar`, `ArtifactCard` and `ArtifactKindGlyph`, `AccessDeniedCard`, and `FrameProtocol` (the wire between a host page and an embedded artifact, with no React in it) |
|
|
57
58
|
| Sheets | `SheetGrid`, the cells on their own (`CheckboxCell`, `TextCell`, `LongTextCell`, `NumberCell`, `SelectCell`, `MultiSelectCell`, `PersonCell`, `StatusCell`, `DateCell`, `UrlCell`, `RatingCell`, and `SheetCell` for any type), `ChangeMark`, and `SheetModel` (every rule a sheet is drawn from, with no React in it: values, parsing, the keyboard model, TSV, the pending edits of D23) |
|
|
58
|
-
| Presence | `PresenceStack`, `PresenceRing` and `presenceHueClass`, `CursorFlag`, `LiveCursor`, `FollowBanner`, and `PresenceModel` (the roster order, one entry per person, the session hues, with no React in it) |
|
|
59
|
+
| Presence | `PresenceStack`, `PresenceRing` and `presenceHueClass`, `CursorFlag`, `LiveCursor`, `FollowBanner`, `PeopleRail` (with `peopleRailKey`), and `PresenceModel` (the roster order, one entry per person, the session hues, with no React in it) |
|
|
59
60
|
|
|
60
61
|
Storybook stories live under `apps/storybook/src/stories`.
|
|
61
62
|
|
|
@@ -202,6 +203,34 @@ places:
|
|
|
202
203
|
- A surface that pans or zooms dispatches `LAYER_REPOSITION_EVENT` on its host
|
|
203
204
|
when the content beneath it moves, and every panel anchored inside follows.
|
|
204
205
|
|
|
206
|
+
## Changes in 0.21.0
|
|
207
|
+
|
|
208
|
+
**`AppShell.AccountRow` takes `menu`** (`AccountRowMenu`: `label`, `header`, `items`): pressing who you are opens the reader's own menu instead of linking anywhere, which is where a reader looks for their account and for signing out. The row becomes the menu button, ending in the up-and-down chevron a menu's trigger draws, keeps the account page's current-row lift (`data-current`), and the menu's header holds the facts the row does not already say, such as the reader's access. Given, `menu` takes the place of `href`.
|
|
209
|
+
|
|
210
|
+
**`Menu` takes `header` and `renderTrigger`.** `header` is a line of facts above the items: never an item, so the arrows never stop on it, and the menu's description, so a screen reader hears it when the menu opens. `renderTrigger` makes the caller's own element the trigger, given the props it spreads (`MenuTriggerProps`), keeping every rule of the menu's button, focus coming back to it included.
|
|
211
|
+
|
|
212
|
+
**`@crewlethq/icons` vendors `log-out` and `log-in`**, for signing out and in from that menu.
|
|
213
|
+
|
|
214
|
+
What to change: nothing. Everything is new.
|
|
215
|
+
|
|
216
|
+
## Changes in 0.20.0
|
|
217
|
+
|
|
218
|
+
0.20.0 adds the review surfaces the engine dashboard drew for itself: a line diff, two versions compared, a document's comment thread, the note a lost edit race leaves, the People rail beside a shared document, and the read-only cells its tables share. Each takes its data and its callbacks as props, so nothing in it fetches or knows a route.
|
|
219
|
+
|
|
220
|
+
**`DiffView`** draws a line diff as the document it is: monospace, numbered on both sides, a row that says how many unchanged lines a gap stands for, and on every changed line a tint, a mark and the word "Added" or "Removed" read in the mark's place. **`DiffSummary`** is the line above it, `+3 −1 against version 4`, read as a sentence. The diff itself is pure and exported with them: `diffLines` (the longest common subsequence over lines, a removal above its addition, a whole replacement past `MAX_DIFF_LINES`), `diffStat`, `collapseDiff` (context either side of each change, the gap counted), `firstChangedLines` (a preview with the count of what it left out) and `splitLines`.
|
|
221
|
+
|
|
222
|
+
**`VersionCompare`** is two versions of a document compared: the changes lens draws a `DiffView` of two texts with its summary, or a comparison the host draws in `changes` (a `DiffList` of files, say), and the versions lens draws the two side by side, older first, stacking where the panes are narrow. Two identical texts are said in words, a lens with nothing to draw is not offered, and `labels` renames the lenses ("Full text").
|
|
223
|
+
|
|
224
|
+
**`CommentThread`** is a document's remarks in order, each with its author (`Principal`), when it was written and edited, and whom it answers, then a `Composer` to add one. Reply moves focus to the field, which names whom it answers. The post is one at a time and the draft is cleared only once `onSubmit` says it landed; a standing `disabledReason` is said in the open. Without `onSubmit` the thread is read-only.
|
|
225
|
+
|
|
226
|
+
**`ConflictNote`** is the refusal of a lost race, an alert that names whoever changed the record (`changedBy`) once the host knows, the server's sentence until then, with Dismiss and any controls of the host's.
|
|
227
|
+
|
|
228
|
+
**`PeopleRail`** lists everybody present in words, one entry a seat, in the order `PresenceStack` draws them, each with what they are doing and where, Follow as a toggle that names whom it follows, and a slot for the host's own controls ("Open turn"). **`peopleRailKey`** is the key `following` is compared with.
|
|
229
|
+
|
|
230
|
+
**The read-only table cells** draw one kind of value the same in every table: `TableKeyCell` (an identifier on one line, its whole value on the title, optionally a link), `TableNumberCell` (tabular, the host's formatter, absent never drawn as zero), `TableDateCell` (relative, exact on hover), `TableEntityCell` (a badge and a name, optionally a link), `TableStatusCell` (the caller's mark with its word and tone), `TableTagsCell` (capped, the rest counted in words) and `TableTextCell` (a column's decorative icon or a row's own mark). They are prefixed `Table` because `SheetGrid`'s editable cells own the bare names.
|
|
231
|
+
|
|
232
|
+
What to change: nothing. Every addition is new.
|
|
233
|
+
|
|
205
234
|
## Changes in 0.19.0
|
|
206
235
|
|
|
207
236
|
0.19.0 adds what a page needs to be arranged by its reader: blocks they move, resize and group on a board, the layout pieces they add between them, and the tray those come from. The engine console's Home is built from it.
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import { type MenuEntry } from '../Menu/index.js';
|
|
3
|
+
/** The menu the row opens (`AccountRowProps.menu`). */
|
|
4
|
+
export interface AccountRowMenu {
|
|
5
|
+
/** The menu's name. Defaults to "Your account". */
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
/** Facts above the items that the row does not already say: the reader's access. */
|
|
8
|
+
header?: ReactNode;
|
|
9
|
+
/** The reader's own actions: their account, signing out. */
|
|
10
|
+
items: readonly MenuEntry[];
|
|
11
|
+
}
|
|
2
12
|
export interface AccountRowProps {
|
|
3
13
|
/** The reader's badge, drawn decorative: the name beside it says who it is. */
|
|
4
14
|
avatar: ReactNode;
|
|
@@ -6,8 +16,14 @@ export interface AccountRowProps {
|
|
|
6
16
|
name: ReactNode;
|
|
7
17
|
/** The line under the name: a login, a seat. Left out where it would repeat the name. */
|
|
8
18
|
detail?: ReactNode;
|
|
9
|
-
/** The reader's account page. Without it the row states who is signed in and goes nowhere. */
|
|
19
|
+
/** The reader's account page. Without it (or `menu`) the row states who is signed in and goes nowhere. */
|
|
10
20
|
href?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The reader's own menu, which the row OPENS rather than linking anywhere:
|
|
23
|
+
* their account among its items, and signing out. Given, it takes the place
|
|
24
|
+
* of `href`.
|
|
25
|
+
*/
|
|
26
|
+
menu?: AccountRowMenu | undefined;
|
|
11
27
|
/** Whether the reader is on that page, which marks the row as the rail marks its current row. */
|
|
12
28
|
current?: boolean | undefined;
|
|
13
29
|
/** What the link opens, as its tooltip. */
|
|
@@ -36,5 +52,11 @@ export interface AccountRowProps {
|
|
|
36
52
|
*
|
|
37
53
|
* The controls are siblings of the link, never inside it, so each keeps its
|
|
38
54
|
* own name and the link's name stays the reader's.
|
|
55
|
+
*
|
|
56
|
+
* OR THE ROW OPENS THE READER'S MENU (`menu`): pressing who you are is where a
|
|
57
|
+
* reader looks for their account and for signing out, so the row is the menu
|
|
58
|
+
* button, ending in the up-and-down chevron a menu's trigger draws, and the
|
|
59
|
+
* account is one item of it. The menu says only what the row does not, in its
|
|
60
|
+
* header (their access), above the actions.
|
|
39
61
|
*/
|
|
40
|
-
export declare function AccountRow({ avatar, name, detail, href, current, title, linkSuffix, actions, className, }: AccountRowProps): import("react").JSX.Element;
|
|
62
|
+
export declare function AccountRow({ avatar, name, detail, href, menu, current, title, linkSuffix, actions, className, }: AccountRowProps): import("react").JSX.Element;
|
package/dist/AppShell/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './AppShell.css';
|
|
2
2
|
export { AppShell, AppShellRail, AppShellRailRow, AppShellToggle, AppShellTopbar, useAppShell } from './AppShell.js';
|
|
3
3
|
export { AccountRow } from './AccountRow.js';
|
|
4
|
-
export type { AccountRowProps } from './AccountRow.js';
|
|
4
|
+
export type { AccountRowMenu, AccountRowProps } from './AccountRow.js';
|
|
5
5
|
export type { ActionRailRowProps, AppShellContextValue, AppShellProps, AppShellRailProps, AppShellRailRowProps, AppShellToggleProps, AppShellTopbarProps, RailRowCount, StaticRailRowProps, } from './AppShell.js';
|
package/dist/AppShell/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { AccountRow, AppShell, AppShellRail, AppShellRailRow, AppShellToggle, AppShellTopbar, useAppShell } from '../chunk-
|
|
1
|
+
export { AccountRow, AppShell, AppShellRail, AppShellRailRow, AppShellToggle, AppShellTopbar, useAppShell } from '../chunk-G5TAKMEA.js';
|
|
2
2
|
import '../chunk-IG75YMUN.js';
|
|
3
|
+
import '../chunk-4MIM356A.js';
|
|
4
|
+
import '../chunk-OG6CL3EB.js';
|
|
3
5
|
import '../chunk-HMPFGIWM.js';
|
|
4
6
|
import '../chunk-R25RGPUB.js';
|
|
5
7
|
import '../chunk-4FQT6ZAY.js';
|
|
@@ -651,18 +651,40 @@
|
|
|
651
651
|
transition: background var(--motion-duration-fast) var(--motion-easing-default);
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
-
a.
|
|
654
|
+
/* The row as the reader's menu button: a button drawn as the link is. */
|
|
655
|
+
button.crewlet-account-row__who {
|
|
656
|
+
width: 100%;
|
|
657
|
+
margin: 0;
|
|
658
|
+
border: 0;
|
|
659
|
+
background: none;
|
|
660
|
+
font: inherit;
|
|
661
|
+
text-align: start;
|
|
662
|
+
cursor: pointer;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/* A row that opens a menu fills the row as the link does. */
|
|
666
|
+
.crewlet-account-row > .crewlet-menu-anchor {
|
|
667
|
+
display: flex;
|
|
668
|
+
flex: 1 1 auto;
|
|
669
|
+
min-width: 0;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
a.crewlet-account-row__who:hover,
|
|
673
|
+
button.crewlet-account-row__who:hover,
|
|
674
|
+
button.crewlet-account-row__who[aria-expanded='true'] {
|
|
655
675
|
background: var(--color-surface-hover);
|
|
656
676
|
}
|
|
657
677
|
|
|
658
678
|
/* After :hover, so the current row shows the lift rather than the overlay. */
|
|
659
|
-
a.crewlet-account-row__who[aria-current='page']
|
|
679
|
+
a.crewlet-account-row__who[aria-current='page'],
|
|
680
|
+
button.crewlet-account-row__who[data-current] {
|
|
660
681
|
background: var(--color-surface-elevated);
|
|
661
682
|
outline: 1px solid var(--color-border-default);
|
|
662
683
|
outline-offset: -1px;
|
|
663
684
|
}
|
|
664
685
|
|
|
665
|
-
a.crewlet-account-row__who:focus-visible
|
|
686
|
+
a.crewlet-account-row__who:focus-visible,
|
|
687
|
+
button.crewlet-account-row__who:focus-visible {
|
|
666
688
|
outline: 2px solid var(--color-focus);
|
|
667
689
|
outline-offset: var(--size-focus-ring-inset-offset);
|
|
668
690
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { CommandPalette } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { CommandPalette } from '../chunk-4HRB62EA.js';
|
|
2
|
+
import '../chunk-F4DPAJCN.js';
|
|
3
3
|
import '../chunk-F73MC7EZ.js';
|
|
4
4
|
import '../chunk-SMBKXWML.js';
|
|
5
|
-
import '../chunk-OG6CL3EB.js';
|
|
6
5
|
import '../chunk-Q55TXPA3.js';
|
|
7
6
|
import '../chunk-PQADV6P6.js';
|
|
8
7
|
import '../chunk-BHHIIK3M.js';
|
|
8
|
+
import '../chunk-OG6CL3EB.js';
|
|
9
9
|
import '../chunk-HMPFGIWM.js';
|
|
10
10
|
import '../chunk-R25RGPUB.js';
|
|
11
11
|
import '../chunk-4FQT6ZAY.js';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type Principal } from '../Principal/index.js';
|
|
3
|
+
import { type TimeValue } from '../RelativeTime/index.js';
|
|
4
|
+
/** One remark in a thread. */
|
|
5
|
+
export interface CommentThreadComment {
|
|
6
|
+
/** Stable across edits: what a reply points at. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Who wrote it. Absent, the remark is the system's, named by `labels.system`. */
|
|
9
|
+
author?: Principal | null | undefined;
|
|
10
|
+
/** The remark, already rendered by the host: markdown turned into elements, or plain text. */
|
|
11
|
+
body: ReactNode;
|
|
12
|
+
createdAt: TimeValue;
|
|
13
|
+
/** When it was last edited. "(edited)" is shown when it differs from `createdAt`. */
|
|
14
|
+
editedAt?: TimeValue | undefined;
|
|
15
|
+
/** The id of the remark this one answers. */
|
|
16
|
+
replyTo?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* What a submit answers. `false` keeps the draft and the reply target, for a
|
|
20
|
+
* write the server refused; anything else clears them.
|
|
21
|
+
*/
|
|
22
|
+
export type CommentThreadSubmitResult = boolean | void;
|
|
23
|
+
export interface CommentThreadLabels {
|
|
24
|
+
heading: string;
|
|
25
|
+
empty: string;
|
|
26
|
+
/** The author of a remark that names nobody. */
|
|
27
|
+
system: string;
|
|
28
|
+
edited: string;
|
|
29
|
+
inReplyTo: (name: string) => string;
|
|
30
|
+
/** The Reply control's accessible name, which names whose remark it answers. */
|
|
31
|
+
replyTo: (name: string) => string;
|
|
32
|
+
reply: string;
|
|
33
|
+
replying: (name: string) => string;
|
|
34
|
+
stopReplying: string;
|
|
35
|
+
/** The field's accessible name. `subject` is the document commented on, when the host names one. */
|
|
36
|
+
field: (subject: string | undefined, replyingTo: string | undefined) => string;
|
|
37
|
+
placeholder: string;
|
|
38
|
+
submit: string;
|
|
39
|
+
submitReply: string;
|
|
40
|
+
/** Why the submit control waits while the field is empty. */
|
|
41
|
+
emptyDraft: string;
|
|
42
|
+
}
|
|
43
|
+
export declare const COMMENT_THREAD_LABELS: CommentThreadLabels;
|
|
44
|
+
export interface CommentThreadProps {
|
|
45
|
+
comments: readonly CommentThreadComment[];
|
|
46
|
+
/** The document commented on, named in the field's label: Comment on "Onboarding". */
|
|
47
|
+
subject?: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Posts a remark, or a reply when `replyTo` is set. Without it the thread is
|
|
50
|
+
* read-only: no field and no Reply controls. Resolve to `false` to keep the
|
|
51
|
+
* draft, such as when the server refused the write.
|
|
52
|
+
*/
|
|
53
|
+
onSubmit?: ((body: string, replyTo: CommentThreadComment | null) => CommentThreadSubmitResult | Promise<CommentThreadSubmitResult>) | undefined;
|
|
54
|
+
/** Why the reader cannot post right now. The submit control is disabled and the reason is shown under it. */
|
|
55
|
+
disabledReason?: string | undefined;
|
|
56
|
+
/** A post in flight that the host is tracking. The thread also tracks its own. */
|
|
57
|
+
busy?: boolean | undefined;
|
|
58
|
+
/** A line beside the submit control: who is told, how the remark is shared. */
|
|
59
|
+
hint?: ReactNode;
|
|
60
|
+
/** Under the field: the server's refusal of the last post, as the host words it. */
|
|
61
|
+
notice?: ReactNode;
|
|
62
|
+
/** Whether the thread draws its own heading. On by default; off where the host already titles the section. */
|
|
63
|
+
heading?: boolean | undefined;
|
|
64
|
+
/** Overrides the shared clock, for a story or a suite. */
|
|
65
|
+
now?: number | undefined;
|
|
66
|
+
labels?: Partial<CommentThreadLabels> | undefined;
|
|
67
|
+
className?: string | undefined;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A document's comments, oldest first, and a field to add one.
|
|
71
|
+
*
|
|
72
|
+
* A REPLY NAMES WHAT IT ANSWERS in words ("in reply to Maya"), so the thread
|
|
73
|
+
* stays flat and readable in order while each answer still points at its
|
|
74
|
+
* question. Pressing Reply moves focus into the field, which names whom it
|
|
75
|
+
* answers, and the reply can be abandoned from beside it.
|
|
76
|
+
*
|
|
77
|
+
* THE BODY IS THE HOST'S. A remark arrives already rendered (markdown into
|
|
78
|
+
* elements), so this draws it in the kit's document type at the size a remark
|
|
79
|
+
* read beside other things takes, and never parses anything itself.
|
|
80
|
+
*
|
|
81
|
+
* A SUBMIT IS ONE AT A TIME. The submit control is disabled while a post is in
|
|
82
|
+
* flight, so a second press cannot send the same remark twice, and the draft
|
|
83
|
+
* is cleared only once the host says the post landed.
|
|
84
|
+
*/
|
|
85
|
+
export declare function CommentThread({ comments, subject, onSubmit, disabledReason, busy, hint, notice, heading, now, labels: overrides, className, }: CommentThreadProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { COMMENT_THREAD_LABELS, CommentThread } from '../chunk-IC64IWOO.js';
|
|
2
|
+
import '../chunk-WI6K5M5X.js';
|
|
3
|
+
import '../chunk-VJLYGPPE.js';
|
|
4
|
+
import '../chunk-SMBKXWML.js';
|
|
5
|
+
import '../chunk-Q55TXPA3.js';
|
|
6
|
+
import '../chunk-4KP4RC3O.js';
|
|
7
|
+
import '../chunk-3CZ7XAVY.js';
|
|
8
|
+
import '../chunk-EUCC37WY.js';
|
|
9
|
+
import '../chunk-UAN5NE7M.js';
|
|
10
|
+
import '../chunk-5OM447RW.js';
|
|
11
|
+
import '../chunk-PQADV6P6.js';
|
|
12
|
+
import '../chunk-BHHIIK3M.js';
|
|
13
|
+
import '../chunk-OG6CL3EB.js';
|
|
14
|
+
import '../chunk-4FQT6ZAY.js';
|
|
15
|
+
import '../chunk-BZFWDIV6.js';
|
|
16
|
+
import '../chunk-ODEQTPFM.js';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* CommentThread: a document's remarks, one per row with a hairline between,
|
|
2
|
+
then the field to add one. */
|
|
3
|
+
.crewlet-comment-thread {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--spacing-3);
|
|
7
|
+
min-width: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.crewlet-comment-thread__heading {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--spacing-2);
|
|
14
|
+
margin: 0;
|
|
15
|
+
color: var(--color-text-primary);
|
|
16
|
+
font-size: var(--font-size-sm);
|
|
17
|
+
font-weight: var(--font-weight-semibold);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.crewlet-comment-thread__empty,
|
|
21
|
+
.crewlet-comment-thread__hint {
|
|
22
|
+
margin: 0;
|
|
23
|
+
color: var(--color-text-tertiary);
|
|
24
|
+
font-size: var(--font-size-compact);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.crewlet-comment-thread__list {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 0;
|
|
32
|
+
list-style: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.crewlet-comment-thread__comment {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: var(--spacing-2);
|
|
39
|
+
min-width: 0;
|
|
40
|
+
padding: var(--spacing-3) 0;
|
|
41
|
+
border-bottom: 1px solid var(--color-border-default);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.crewlet-comment-thread__head {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-wrap: wrap;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: var(--spacing-2);
|
|
49
|
+
min-width: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.crewlet-comment-thread__author {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: var(--spacing-2);
|
|
56
|
+
min-width: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.crewlet-comment-thread__name {
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
color: var(--color-text-primary);
|
|
62
|
+
font-weight: var(--font-weight-semibold);
|
|
63
|
+
text-overflow: ellipsis;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.crewlet-comment-thread__meta {
|
|
68
|
+
color: var(--color-text-tertiary);
|
|
69
|
+
font-size: var(--font-size-xs);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Reply sits at the row's far end, wherever the head wraps. */
|
|
73
|
+
.crewlet-comment-thread__reply {
|
|
74
|
+
margin-inline-start: auto;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.crewlet-comment-thread__compose {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
gap: var(--spacing-2);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.crewlet-comment-thread__replying {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-wrap: wrap;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: var(--spacing-2);
|
|
88
|
+
color: var(--color-text-tertiary);
|
|
89
|
+
font-size: var(--font-size-xs);
|
|
90
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ConflictNoteLabels {
|
|
3
|
+
/** The sentence once the host knows who won the race. */
|
|
4
|
+
changedBy: (subject: string, name: string) => string;
|
|
5
|
+
/** The sentence while it does not, or when nobody can be named. */
|
|
6
|
+
changed: (subject: string) => string;
|
|
7
|
+
dismiss: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const CONFLICT_NOTE_LABELS: ConflictNoteLabels;
|
|
10
|
+
export interface ConflictNoteProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role'> {
|
|
11
|
+
/** What the sentence calls the record the reader tried to change: a key, a title. */
|
|
12
|
+
subject: string;
|
|
13
|
+
/**
|
|
14
|
+
* Who changed it in the meantime, once the host has looked it up. Without
|
|
15
|
+
* it the note says the record changed and names nobody, or says `message`.
|
|
16
|
+
*/
|
|
17
|
+
changedBy?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The sentence to say while nobody can be named, in place of the default:
|
|
20
|
+
* usually the server's own refusal.
|
|
21
|
+
*/
|
|
22
|
+
message?: ReactNode;
|
|
23
|
+
/** Takes the note down. Without it the note offers no Dismiss control. */
|
|
24
|
+
onDismiss?: (() => void) | undefined;
|
|
25
|
+
/** Controls beside Dismiss: "Reload", "Keep mine". */
|
|
26
|
+
actions?: ReactNode;
|
|
27
|
+
labels?: Partial<ConflictNoteLabels> | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The refusal of a lost race: somebody changed a record between the reader's
|
|
31
|
+
* read and their write, and the write was refused.
|
|
32
|
+
*
|
|
33
|
+
* IT NAMES WHO WON, when the host can say, because "changed by Maya since you
|
|
34
|
+
* opened it" names the person to talk to where "somebody else" names nobody.
|
|
35
|
+
* Until the host knows, it says the record changed, or the server's own
|
|
36
|
+
* sentence.
|
|
37
|
+
*
|
|
38
|
+
* AN ALERT, because it answers a press the reader just made and they need to
|
|
39
|
+
* hear that the change did not land. The glyph is drawn beside the words so
|
|
40
|
+
* the danger ink is never the only carrier.
|
|
41
|
+
*/
|
|
42
|
+
export declare function ConflictNote({ subject, changedBy, message, onDismiss, actions, labels: overrides, className, ...rest }: ConflictNoteProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* ConflictNote: a refused write's sentence in the danger ink, with its glyph
|
|
2
|
+
so the colour is never the only carrier, and its controls beside it. */
|
|
3
|
+
.crewlet-conflict-note {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: var(--spacing-1) var(--spacing-2);
|
|
8
|
+
max-width: 40rem;
|
|
9
|
+
color: var(--color-feedback-danger-ink);
|
|
10
|
+
font-size: var(--font-size-compact);
|
|
11
|
+
overflow-wrap: anywhere;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.crewlet-conflict-note__glyph {
|
|
15
|
+
flex: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.crewlet-conflict-note__text {
|
|
19
|
+
flex: 1 1 16rem;
|
|
20
|
+
min-width: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.crewlet-conflict-note__actions {
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
flex-wrap: wrap;
|
|
26
|
+
gap: var(--spacing-1);
|
|
27
|
+
}
|
package/dist/DataTable/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from '../chunk-
|
|
2
|
-
import '../chunk-JULMZNGT.js';
|
|
1
|
+
export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from '../chunk-LG244LY7.js';
|
|
3
2
|
import '../chunk-STJ7QBC3.js';
|
|
4
3
|
import '../chunk-DTIW4CHZ.js';
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-OG6CL3EB.js';
|
|
4
|
+
import '../chunk-F4DPAJCN.js';
|
|
7
5
|
import '../chunk-I6NZKJGK.js';
|
|
8
6
|
import '../chunk-Q55TXPA3.js';
|
|
9
7
|
import '../chunk-EUCC37WY.js';
|
|
10
8
|
import '../chunk-AV2DXAEL.js';
|
|
11
9
|
import '../chunk-PQADV6P6.js';
|
|
10
|
+
import '../chunk-4MIM356A.js';
|
|
11
|
+
import '../chunk-OG6CL3EB.js';
|
|
12
12
|
import '../chunk-HMPFGIWM.js';
|
|
13
13
|
import '../chunk-R25RGPUB.js';
|
|
14
14
|
import '../chunk-4FQT6ZAY.js';
|
package/dist/DataView/index.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-
|
|
1
|
+
export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-AV6YX4GZ.js';
|
|
2
2
|
import '../chunk-HOXGBLEY.js';
|
|
3
3
|
import '../chunk-PGRPNDWM.js';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-L4H7SSWF.js';
|
|
4
|
+
import '../chunk-RE6ED5TO.js';
|
|
5
|
+
import '../chunk-LG244LY7.js';
|
|
7
6
|
import '../chunk-STJ7QBC3.js';
|
|
8
7
|
import '../chunk-DTIW4CHZ.js';
|
|
9
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-F4DPAJCN.js';
|
|
10
9
|
import '../chunk-F73MC7EZ.js';
|
|
11
10
|
import '../chunk-SMBKXWML.js';
|
|
12
11
|
import '../chunk-GXQ3B46I.js';
|
|
13
|
-
import '../chunk-OG6CL3EB.js';
|
|
14
12
|
import '../chunk-I6NZKJGK.js';
|
|
15
13
|
import '../chunk-Q55TXPA3.js';
|
|
16
14
|
import '../chunk-3CZ7XAVY.js';
|
|
@@ -19,6 +17,8 @@ import '../chunk-BWRGFKJP.js';
|
|
|
19
17
|
import '../chunk-AV2DXAEL.js';
|
|
20
18
|
import '../chunk-PQADV6P6.js';
|
|
21
19
|
import '../chunk-BHHIIK3M.js';
|
|
20
|
+
import '../chunk-4MIM356A.js';
|
|
21
|
+
import '../chunk-OG6CL3EB.js';
|
|
22
22
|
import '../chunk-HMPFGIWM.js';
|
|
23
23
|
import '../chunk-R25RGPUB.js';
|
|
24
24
|
import '../chunk-4FQT6ZAY.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { DEFAULT_DATE_TIME_PICKER_LABELS, DateTimePicker } from '../chunk-
|
|
1
|
+
export { DEFAULT_DATE_TIME_PICKER_LABELS, DateTimePicker } from '../chunk-RE6ED5TO.js';
|
|
2
2
|
import '../chunk-GXQ3B46I.js';
|
|
3
|
-
import '../chunk-OG6CL3EB.js';
|
|
4
3
|
import '../chunk-BWRGFKJP.js';
|
|
4
|
+
import '../chunk-OG6CL3EB.js';
|
|
5
5
|
import '../chunk-HMPFGIWM.js';
|
|
6
6
|
import '../chunk-R25RGPUB.js';
|
|
7
7
|
import '../chunk-4FQT6ZAY.js';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { DiffSection } from './diff.js';
|
|
3
|
+
export interface DiffViewLabels {
|
|
4
|
+
/** The row a dropped run of unchanged lines is drawn as: "12 unchanged lines". */
|
|
5
|
+
skipped: (count: number) => string;
|
|
6
|
+
/** Read in place of the `+` mark on an added line. */
|
|
7
|
+
added: string;
|
|
8
|
+
/** Read in place of the minus mark on a removed line. */
|
|
9
|
+
removed: string;
|
|
10
|
+
/** The region's accessible name when the caller gives none. */
|
|
11
|
+
region: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const DIFF_VIEW_LABELS: DiffViewLabels;
|
|
14
|
+
export interface DiffViewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
15
|
+
/**
|
|
16
|
+
* The lines to draw, grouped into sections with the count of unchanged
|
|
17
|
+
* lines dropped before each: `collapseDiff(diffLines(before, after))`, or
|
|
18
|
+
* sections a host computed some other way.
|
|
19
|
+
*/
|
|
20
|
+
sections: readonly DiffSection[];
|
|
21
|
+
labels?: Partial<DiffViewLabels> | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A line diff, rendered as the document it is.
|
|
25
|
+
*
|
|
26
|
+
* MONOSPACE AND LINE-NUMBERED on both sides, because the two numbers are what
|
|
27
|
+
* a reader uses to find the paragraph in the version beside it. A skipped run
|
|
28
|
+
* is a row of its own saying how many lines it stands for: a gap silently
|
|
29
|
+
* closed makes a document edited at both ends look like one rewritten in the
|
|
30
|
+
* middle.
|
|
31
|
+
*
|
|
32
|
+
* COLOUR IS NEVER THE ONLY SIGNAL. An added or removed line carries a tint, a
|
|
33
|
+
* drawn mark and a word: the mark is hidden from assistive technology and the
|
|
34
|
+
* word ("Added", "Removed") is read in its place, because a minus sign is
|
|
35
|
+
* announced as anything from "minus" to nothing at all.
|
|
36
|
+
*/
|
|
37
|
+
export declare function DiffView({ sections, labels: overrides, className, 'aria-label': ariaLabel, ...rest }: DiffViewProps): import("react").JSX.Element;
|
|
38
|
+
export interface DiffSummaryLabels {
|
|
39
|
+
/** Read in place of the drawn counts: "3 lines added, 1 removed". */
|
|
40
|
+
spoken: (added: number, removed: number) => string;
|
|
41
|
+
/** What the counts are measured against: "against version 4". */
|
|
42
|
+
against: (what: string) => string;
|
|
43
|
+
}
|
|
44
|
+
export declare const DIFF_SUMMARY_LABELS: DiffSummaryLabels;
|
|
45
|
+
export interface DiffSummaryProps extends Omit<HTMLAttributes<HTMLParagraphElement>, 'children'> {
|
|
46
|
+
added: number;
|
|
47
|
+
removed: number;
|
|
48
|
+
/** What the diff is measured against, named the way the reader knows it: "version 4", "rev 12". */
|
|
49
|
+
against?: string | undefined;
|
|
50
|
+
labels?: Partial<DiffSummaryLabels> | undefined;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The one line above a diff that says how big it is: `+3 −1 against version 4`.
|
|
54
|
+
*
|
|
55
|
+
* The drawn counts are tinted with the same inks as the lines they count, and
|
|
56
|
+
* a sentence is read in their place, so the size of the change never rests on
|
|
57
|
+
* a plus sign and a colour.
|
|
58
|
+
*/
|
|
59
|
+
export declare function DiffSummary({ added, removed, against, labels: overrides, className, ...rest }: DiffSummaryProps): import("react").JSX.Element;
|