@crewlethq/ui 0.65.1 → 0.66.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 (43) hide show
  1. package/README.md +8 -0
  2. package/dist/AppShell/index.js +1 -1
  3. package/dist/{AppShell-LZQA3XU4.css → AppShell-2IBUS4TH.css} +6 -1
  4. package/dist/ArtifactCard/index.js +3 -3
  5. package/dist/ChatThread/ChatThread.d.ts +9 -0
  6. package/dist/ChatThread/index.js +1 -1
  7. package/dist/{ChatThread-FGXVDLI2.css → ChatThread-2KO3FZKQ.css} +12 -9
  8. package/dist/CommentThread/index.js +2 -2
  9. package/dist/DataView/index.js +2 -2
  10. package/dist/DatasetSource/index.js +2 -2
  11. package/dist/EditingStatus/index.js +2 -2
  12. package/dist/InlineEditor/index.js +3 -3
  13. package/dist/ProposalCard/ProposalCard.d.ts +58 -1
  14. package/dist/ProposalCard/index.d.ts +2 -2
  15. package/dist/ProposalCard/index.js +8 -1
  16. package/dist/{ProposalCard-VTTCDXYK.css → ProposalCard-SF332W4E.css} +22 -0
  17. package/dist/RelativeTime/index.js +1 -1
  18. package/dist/RichEditor/index.js +1 -1
  19. package/dist/SetupWizard/index.js +2 -2
  20. package/dist/StatusCard/StatusCard.d.ts +10 -3
  21. package/dist/TableCells/index.js +2 -2
  22. package/dist/VersionTimeline/index.js +2 -2
  23. package/dist/WidgetFrame/index.js +2 -2
  24. package/dist/{chunk-FZUDUNCK.js → chunk-2AQMXGWA.js} +63 -6
  25. package/dist/{chunk-UBIPDEFV.js → chunk-3EETQFAM.js} +2 -2
  26. package/dist/{chunk-DS5NBENV.js → chunk-BVNFNFA6.js} +1 -1
  27. package/dist/{chunk-F2IYVVA3.js → chunk-D2ZXIQ23.js} +31 -4
  28. package/dist/{chunk-L6NG7CUA.js → chunk-EJNJMHQG.js} +1 -1
  29. package/dist/{chunk-E55DKVY7.js → chunk-GJ7VIQWL.js} +1 -1
  30. package/dist/{chunk-NWTHGZBH.js → chunk-GNDKUSCG.js} +1 -1
  31. package/dist/{chunk-XGBGEI6V.js → chunk-J5BIKMQY.js} +1 -1
  32. package/dist/{chunk-VVOFJFRT.js → chunk-QBWNGNF7.js} +1 -1
  33. package/dist/{chunk-VRG2ZXNK.js → chunk-R6K62EXV.js} +1 -1
  34. package/dist/{chunk-4EDSEX7U.js → chunk-S5QJZOPL.js} +1 -1
  35. package/dist/{chunk-DKJJ434E.js → chunk-UBJ32EO2.js} +1 -1
  36. package/dist/{chunk-B76OKJMX.js → chunk-VLGGLLKH.js} +1 -1
  37. package/dist/{chunk-SRSE7FGL.js → chunk-WPMZKZUH.js} +1 -1
  38. package/dist/generated/index.js +32 -32
  39. package/dist/index.js +32 -32
  40. package/dist/styles.css +43 -13
  41. package/package.json +3 -3
  42. package/dist/{Editor-NZRUKWB4.js → Editor-URGZOK2S.js} +1 -1
  43. package/dist/{chunk-R2YHKVWN.js → chunk-SBHAKX2T.js} +1 -1
package/README.md CHANGED
@@ -205,6 +205,14 @@ places:
205
205
  - A surface that pans or zooms dispatches `LAYER_REPOSITION_EVENT` on its host
206
206
  when the content beneath it moves, and every panel anchored inside follows.
207
207
 
208
+ ## Changes in 0.65.0
209
+
210
+ **`ProposalCard` takes `tone`, `confirmation` and `details`.** `tone="danger"` (`ProposalTone`, `PROPOSAL_TONES`) marks a change that removes or discards something: while the card waits on the person or carries the change out, Card's danger rail runs down its leading edge, the title is set in the danger ink (AA in both palettes) and the primary is the danger button. A settled card steps back with no tone, and the Tag keeps saying the state. `confirmation` (`{ label }`, `ProposalConfirmation`) draws a `Checkbox` above the decision: the primary is held soft disabled, described by `labels.confirmationNeeded` ("Check the confirmation above first"), until it is ticked. The tick clears when the card settles or is handed another proposal in place (another `title` or `approveLabel`), and `approveBlocked` still outranks it. `details` is the precise request behind the change, in a compact `Disclosure` titled `labels.details` ("Technical details"), collapsed by default and mounted only once opened, at the foot of the body above the note.
211
+
212
+ **A `ProposalCard` primary that has just appeared takes no pointer for 500ms**: when the card arrives, when it is handed another proposal and when it returns to a decision (a step-up, a refused approval). A press meant for the card it replaced, such as the second press of a double click, can no longer approve it, and it shows no hover until then. Focus and the keyboard reach it at once, and it is never drawn or announced as disabled. The button carries `data-arming` while it arms.
213
+
214
+ **`StatusCard` takes `rail`**, Card's own rail down the leading edge, for a risk the Tag does not carry.
215
+
208
216
  ## Changes in 0.62.0
209
217
 
210
218
  **`ValueField`, a labelled value with the control its kind needs.** `FormField` with the control and the rules every form holding configuration values otherwise rewrites, in one component (`ValueField`, `ValueFieldKind`, `ValueFieldChoice`, `ValueFieldLabels`, `ValueFieldProps`). `kind` picks the control: `text`, `id`, `email` and `url` are a text field, `secret` a password field, `multiline` a `Textarea`, and `choice` and `handle` the `Select` listbox. A `secret` is masked unless its value is exactly one `${NAME}` reference, which reads as a name in the `reference` appearance. Typing `$` in a one-line field offers the names in `references`, ranked closest first and written in as a whole `${NAME}` (`onReferencesNeeded` is called as the list opens, so a caller can refresh it). A `url` wears an `https://` `InputAffix`, read as part of the value, which steps aside for `http://` and for a reference. `url`, `id` and `email` drop whitespace; no kind sets `type="email"`, so a reference is never refused by the browser. Required is the unmarked default: `required={false}` says "(optional)", and `markRequired` says "(required)" where it is news. A choice's `hint` is drawn under its option and joins the help line once chosen, and a stored answer the list no longer offers keeps a row of its own. `isReference` replaces the default `${NAME}` grammar, `mark` draws a logo before the label, `helperOnFocus` is passed to `FormField`, and `labels` replaces the list's name ("Secrets") and the choice placeholder ("Choose one").
@@ -1,4 +1,4 @@
1
- export { APP_SHELL_ASIDE_WIDTH, AccountRow, AppShell, AppShellRail, AppShellRailRow, AppShellRailStatus, AppShellToggle, AppShellTopbar, readStoredWidth, useAppShell, useScreenBelow, useScreenWidth, useStoredWidth } from '../chunk-E55DKVY7.js';
1
+ export { APP_SHELL_ASIDE_WIDTH, AccountRow, AppShell, AppShellRail, AppShellRailRow, AppShellRailStatus, AppShellToggle, AppShellTopbar, readStoredWidth, useAppShell, useScreenBelow, useScreenWidth, useStoredWidth } from '../chunk-GJ7VIQWL.js';
2
2
  import '../chunk-RTPQDNW3.js';
3
3
  import '../chunk-T73DMDU4.js';
4
4
  export { RESIZE_HANDLE_LARGE_STEP, RESIZE_HANDLE_STEP, ResizeHandle, clampSize, useAppShellAside, useAppShellPeek } from '../chunk-PIYJNCN7.js';
@@ -59,7 +59,12 @@
59
59
  past it. A page that can also scroll as a whole carries the rail off the
60
60
  top of the window. */
61
61
  height: 100dvh;
62
- overflow: hidden;
62
+ /* CLIPPED, NOT SCROLLABLE. `overflow: hidden` is still a scroll container:
63
+ a focus or a scrollIntoView on anything that reaches past the viewport
64
+ scrolled the whole shell up, the frame showing as a band under it, and
65
+ nothing a reader could do scrolled it back. `clip` cuts the same edge
66
+ and offers nothing to scroll (SidePanel's flush body, the same rule). */
67
+ overflow: clip;
63
68
  /* The FRAME, the lowest rung: what the rail stands on and what shows round
64
69
  the sheet's inset. */
65
70
  background: var(--color-surface-frame);
@@ -1,15 +1,15 @@
1
- export { ArtifactCard, ArtifactCardSkeleton, ArtifactPreviewGlyph } from '../chunk-UBIPDEFV.js';
1
+ export { ArtifactCard, ArtifactCardSkeleton, ArtifactPreviewGlyph } from '../chunk-3EETQFAM.js';
2
2
  import '../chunk-BRLZXYPA.js';
3
3
  import '../chunk-CI3VPIJN.js';
4
- import '../chunk-L6NG7CUA.js';
4
+ import '../chunk-EJNJMHQG.js';
5
5
  import '../chunk-RE3FBGQQ.js';
6
6
  import '../chunk-4AUTALJA.js';
7
7
  import '../chunk-AV2DXAEL.js';
8
8
  import '../chunk-BKP6XCAJ.js';
9
9
  import '../chunk-PZKHBB7D.js';
10
10
  import '../chunk-NHLNHH4J.js';
11
- import '../chunk-DOY3KC6I.js';
12
11
  import '../chunk-PBCNINMB.js';
12
+ import '../chunk-DOY3KC6I.js';
13
13
  export { ARTIFACT_KINDS, ArtifactKindGlyph } from '../chunk-RSKW25Y5.js';
14
14
  import '../chunk-ETSF7SU6.js';
15
15
  import '../chunk-PGCLHYVP.js';
@@ -49,5 +49,14 @@ export interface ChatThreadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'r
49
49
  * latest" pill counts what arrived since. The browser's own scroll anchoring
50
50
  * is turned off (it fights a last child that keeps growing), and the
51
51
  * anchoring is done here instead.
52
+ *
53
+ * A JUMP HOLDS UNTIL IT LANDS. A smooth scroll passes through positions short
54
+ * of the end, and each one read as the reader leaving: the pill came back and
55
+ * following stopped, so an answer still growing left the jump short and the
56
+ * first press did nothing. While the jump runs, those positions are ignored
57
+ * and growth is followed; the reader's own wheel, touch or key ends it.
58
+ *
59
+ * THE PILL COVERS NOTHING: it sits under the log, in the thread's own column,
60
+ * rather than over the last lines of whatever is being read.
52
61
  */
53
62
  export declare const ChatThread: import("react").ForwardRefExoticComponent<ChatThreadProps & import("react").RefAttributes<ChatThreadHandle>>;
@@ -1,4 +1,4 @@
1
- export { CHAT_THREAD_FOLLOW_WITHIN, CHAT_THREAD_LABELS, ChatThread } from '../chunk-F2IYVVA3.js';
1
+ export { CHAT_THREAD_FOLLOW_WITHIN, CHAT_THREAD_LABELS, ChatThread } from '../chunk-D2ZXIQ23.js';
2
2
  import '../chunk-RTPQDNW3.js';
3
3
  import '../chunk-7QTPJDRF.js';
4
4
  import '../chunk-XSPCITPN.js';
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * A conversation as it grows: the scroller, the items a spacing step and a
3
- * half apart on the panel's 16px inset, and the Jump to latest pill floating
4
- * over its foot.
3
+ * half apart on the panel's 16px inset, and the Jump to latest pill in a row
4
+ * of its own under it.
5
5
  */
6
6
  .crewlet-chat-thread {
7
7
  position: relative;
@@ -53,14 +53,17 @@
53
53
  flex: none;
54
54
  }
55
55
 
56
- /* The pill, centred a step above the thread's foot. */
56
+ /*
57
+ * The pill, centred in a row of its own under the log. IN FLOW, NOT FLOATING:
58
+ * laid over the scroller it covered the last lines of whatever was being read,
59
+ * a table's rows or an answer's text. Here the log gives up the row while the
60
+ * pill shows, and nothing it holds is hidden under it.
61
+ */
57
62
  .crewlet-chat-thread__jump {
58
- position: absolute;
59
- bottom: var(--spacing-3);
60
- left: 50%;
61
- transform: translateX(-50%);
62
- box-shadow: var(--shadow-md);
63
- border-radius: var(--radius-pill);
63
+ display: flex;
64
+ flex: none;
65
+ justify-content: center;
66
+ padding: var(--spacing-2) var(--spacing-4);
64
67
  }
65
68
 
66
69
  .crewlet-chat-thread__fresh {
@@ -1,6 +1,6 @@
1
- export { COMMENT_THREAD_LABELS, CommentThread } from '../chunk-DKJJ434E.js';
1
+ export { COMMENT_THREAD_LABELS, CommentThread } from '../chunk-UBJ32EO2.js';
2
2
  import '../chunk-CI3VPIJN.js';
3
- import '../chunk-L6NG7CUA.js';
3
+ import '../chunk-EJNJMHQG.js';
4
4
  import '../chunk-RE3FBGQQ.js';
5
5
  import '../chunk-BKP6XCAJ.js';
6
6
  import '../chunk-PZKHBB7D.js';
@@ -1,4 +1,4 @@
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-XGBGEI6V.js';
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-J5BIKMQY.js';
2
2
  import '../chunk-FPDIHEM4.js';
3
3
  import '../chunk-CFY257ND.js';
4
4
  import '../chunk-PX54PALQ.js';
@@ -9,7 +9,7 @@ import '../chunk-7KHM2FZH.js';
9
9
  import '../chunk-EE3DJMSQ.js';
10
10
  import '../chunk-NR4CPM4T.js';
11
11
  import '../chunk-KHJIEPZV.js';
12
- import '../chunk-L6NG7CUA.js';
12
+ import '../chunk-EJNJMHQG.js';
13
13
  import '../chunk-RE3FBGQQ.js';
14
14
  import '../chunk-AV2DXAEL.js';
15
15
  import '../chunk-PBCNINMB.js';
@@ -1,7 +1,7 @@
1
- export { DATASET_SOURCE_KINDS, DatasetSource, DatasetSourceList } from '../chunk-VRG2ZXNK.js';
1
+ export { DATASET_SOURCE_KINDS, DatasetSource, DatasetSourceList } from '../chunk-R6K62EXV.js';
2
2
  import '../chunk-I5OIKDX2.js';
3
3
  import '../chunk-WIATRXEJ.js';
4
- import '../chunk-L6NG7CUA.js';
4
+ import '../chunk-EJNJMHQG.js';
5
5
  import '../chunk-RE3FBGQQ.js';
6
6
  import '../chunk-2YTOOH3A.js';
7
7
  import '../chunk-UT6CW3C7.js';
@@ -1,6 +1,6 @@
1
- export { EditingStatus } from '../chunk-B76OKJMX.js';
1
+ export { EditingStatus } from '../chunk-VLGGLLKH.js';
2
2
  import '../chunk-WIATRXEJ.js';
3
- import '../chunk-L6NG7CUA.js';
3
+ import '../chunk-EJNJMHQG.js';
4
4
  import '../chunk-RE3FBGQQ.js';
5
5
  import '../chunk-UT6CW3C7.js';
6
6
  import '../chunk-ODEQTPFM.js';
@@ -1,7 +1,7 @@
1
- export { INLINE_EDITOR_LABELS, InlineEditor } from '../chunk-VVOFJFRT.js';
2
- import '../chunk-B76OKJMX.js';
1
+ export { INLINE_EDITOR_LABELS, InlineEditor } from '../chunk-QBWNGNF7.js';
2
+ import '../chunk-VLGGLLKH.js';
3
3
  import '../chunk-WIATRXEJ.js';
4
- import '../chunk-L6NG7CUA.js';
4
+ import '../chunk-EJNJMHQG.js';
5
5
  import '../chunk-RE3FBGQQ.js';
6
6
  import '../chunk-ANTAQAR4.js';
7
7
  import '../chunk-7QTPJDRF.js';
@@ -26,6 +26,26 @@ export type ProposalKind = 'change' | 'create';
26
26
  */
27
27
  export type ProposalFailureOutcome = 'unchanged' | 'unknown';
28
28
  export declare const PROPOSAL_FAILURE_OUTCOMES: readonly ["unchanged", "unknown"];
29
+ /**
30
+ * How much the decision weighs: `default`, or `danger` for a change that
31
+ * removes, discards or overwrites something (removing a seat, deleting a
32
+ * record). Danger draws the card's leading edge and its title in the danger
33
+ * ink and the primary as the danger button, while the card waits on the
34
+ * person or carries the change out.
35
+ */
36
+ export type ProposalTone = 'default' | 'danger';
37
+ export declare const PROPOSAL_TONES: readonly ["default", "danger"];
38
+ /**
39
+ * A deliberate confirmation: a checkbox the person ticks before the primary
40
+ * can be pressed, for a change whose consequence has to be acknowledged.
41
+ */
42
+ export interface ProposalConfirmation {
43
+ /**
44
+ * What the person confirms, as the checkbox's name: "I understand the QA
45
+ * Engineer seat and its history are removed."
46
+ */
47
+ label: ReactNode;
48
+ }
29
49
  /**
30
50
  * Why the person's own decision was refused while the card stays open to
31
51
  * another one: the approval was turned down (a fresh sign-in, a change that
@@ -68,6 +88,10 @@ export interface ProposalCardLabels {
68
88
  unknownNotice: string;
69
89
  /** Why Decline is held while the approved change is carried out. */
70
90
  busy: string;
91
+ /** Why the primary is held until the `confirmation` is ticked, said as its description. */
92
+ confirmationNeeded: string;
93
+ /** The title of the collapsed `details` section. */
94
+ details: string;
71
95
  }
72
96
  export declare const PROPOSAL_CARD_LABELS: ProposalCardLabels;
73
97
  export interface ProposalCardProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
@@ -88,6 +112,25 @@ export interface ProposalCardProps extends Omit<HTMLAttributes<HTMLElement>, 'ti
88
112
  changesHeading?: ReactNode;
89
113
  /** The consequence, in one sentence, under the list. */
90
114
  note?: ReactNode;
115
+ /**
116
+ * The precise request behind the change (a method, a path, a body) for a
117
+ * reader who wants it: a collapsed `Disclosure` at the foot of the body,
118
+ * above the note, titled `labels.details`, whose content mounts only once
119
+ * it is opened. Never where the change itself is said: the list is.
120
+ */
121
+ details?: ReactNode;
122
+ /** `default`, or `danger` for a change that removes or discards something; see `ProposalTone`. */
123
+ tone?: ProposalTone | undefined;
124
+ /**
125
+ * A checkbox above the decision that the person ticks before the primary
126
+ * can be pressed. Until then the primary is held soft disabled and
127
+ * described by `labels.confirmationNeeded`, as `approveBlocked` holds it.
128
+ * The tick belongs to the proposal it was given for: it clears when the
129
+ * card settles, and when the card is handed a different proposal (another
130
+ * `title` or `approveLabel`) in place. Drawn while the card waits on the
131
+ * person and while the approved change is carried out.
132
+ */
133
+ confirmation?: ProposalConfirmation | undefined;
91
134
  /** The primary action, named for its effect: "Apply to this list", "Create task". Never a bare "OK". */
92
135
  approveLabel: string;
93
136
  /**
@@ -184,5 +227,19 @@ export interface ProposalCardProps extends Omit<HTMLAttributes<HTMLElement>, 'ti
184
227
  * "NOTHING CHANGED." ONLY WHEN IT IS TRUE. A failure whose outcome nobody
185
228
  * could confirm (`failureOutcome="unknown"`) may have landed, so the card
186
229
  * says "Not confirmed" and never adds the reassurance.
230
+ *
231
+ * A DESTRUCTIVE CHANGE LOOKS LIKE ONE (`tone="danger"`): the danger rail down
232
+ * the leading edge, the title in the danger ink and the danger primary. The
233
+ * colour only adds weight; the title, the summary and the confirmation say
234
+ * what is lost in words. With `confirmation`, the primary waits on a ticked
235
+ * checkbox, so the decision is a deliberate act rather than a single press.
236
+ *
237
+ * A PRIMARY THAT HAS JUST APPEARED IS NOT YET UNDER THE POINTER. For half a
238
+ * second after the card arrives (or returns to a decision) its primary takes
239
+ * no pointer, so a press meant for the card it replaced cannot approve this
240
+ * one. The keyboard is never held.
241
+ *
242
+ * THE PRECISE REQUEST IS THERE, FOLDED (`details`): a compact disclosure,
243
+ * collapsed by default, for a reader who wants the method, path and body.
187
244
  */
188
- export declare function ProposalCard({ title, subtitle, state, scope, kind, summary, changes, changesHeading, note, approveLabel, onApprove, onDecline, onPrepareAgain, onRetry, receipt, failure, failureOutcome, failureHint, approveBlocked, decisionRefusal, notice, labels: overrides, changeLabels, diffLabels, className, ...rest }: ProposalCardProps): import("react").JSX.Element;
245
+ export declare function ProposalCard({ title, subtitle, state, scope, kind, summary, changes, changesHeading, note, details, tone, confirmation, approveLabel, onApprove, onDecline, onPrepareAgain, onRetry, receipt, failure, failureOutcome, failureHint, approveBlocked, decisionRefusal, notice, labels: overrides, changeLabels, diffLabels, className, ...rest }: ProposalCardProps): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import '../VisuallyHidden/VisuallyHidden.css';
2
2
  import './ProposalCard.css';
3
- export { PROPOSAL_CARD_LABELS, PROPOSAL_FAILURE_OUTCOMES, PROPOSAL_STATES, ProposalCard } from './ProposalCard.js';
4
- export type { ProposalCardLabels, ProposalCardProps, ProposalDecisionRefusal, ProposalFailureOutcome, ProposalKind, ProposalScope, ProposalState, } from './ProposalCard.js';
3
+ export { PROPOSAL_CARD_LABELS, PROPOSAL_FAILURE_OUTCOMES, PROPOSAL_STATES, PROPOSAL_TONES, ProposalCard } from './ProposalCard.js';
4
+ export type { ProposalCardLabels, ProposalCardProps, ProposalConfirmation, ProposalDecisionRefusal, ProposalFailureOutcome, ProposalKind, ProposalScope, ProposalState, ProposalTone, } from './ProposalCard.js';
@@ -1,4 +1,4 @@
1
- export { PROPOSAL_CARD_LABELS, PROPOSAL_FAILURE_OUTCOMES, PROPOSAL_STATES, ProposalCard } from '../chunk-FZUDUNCK.js';
1
+ export { PROPOSAL_CARD_LABELS, PROPOSAL_FAILURE_OUTCOMES, PROPOSAL_STATES, PROPOSAL_TONES, ProposalCard } from '../chunk-2AQMXGWA.js';
2
2
  import '../chunk-M25IV5MH.js';
3
3
  import '../chunk-NTQPJJAN.js';
4
4
  import '../chunk-WQRSZMN4.js';
@@ -7,11 +7,18 @@ import '../chunk-I5OIKDX2.js';
7
7
  import '../chunk-WIATRXEJ.js';
8
8
  import '../chunk-4AUTALJA.js';
9
9
  import '../chunk-AV2DXAEL.js';
10
+ import '../chunk-PBCNINMB.js';
10
11
  import '../chunk-222VILSP.js';
12
+ import '../chunk-ETSF7SU6.js';
13
+ import '../chunk-PGCLHYVP.js';
11
14
  import '../chunk-IVTQWOXV.js';
12
15
  import '../chunk-MLDTLZAO.js';
13
16
  import '../chunk-PQADV6P6.js';
17
+ import '../chunk-2G355KDJ.js';
14
18
  import '../chunk-7QTPJDRF.js';
15
19
  import '../chunk-XSPCITPN.js';
20
+ import '../chunk-H5XTJ7GJ.js';
21
+ import '../chunk-UAUP6XGK.js';
22
+ import '../chunk-NUZHC6MM.js';
16
23
  import '../chunk-UT6CW3C7.js';
17
24
  import '../chunk-ODEQTPFM.js';
@@ -18,6 +18,28 @@
18
18
  text-align: end;
19
19
  }
20
20
 
21
+ /* THE DELIBERATE CONFIRMATION, on a row of its own above the decision. It
22
+ starts at the foot's start edge, unlike the one-line reasons around it: a
23
+ checkbox's sentence wraps under its own first line, and set at the end its
24
+ lines would start in a different place each. */
25
+ .crewlet-proposal-card__confirmation {
26
+ flex: 1 1 100%;
27
+ }
28
+
29
+ /* A PRIMARY THAT HAS JUST APPEARED takes no pointer for a moment (ARMING_MS
30
+ in ProposalCard.tsx): no hover, and no press from a pointer that was
31
+ already resting where it landed. Focus and the keyboard still reach it. */
32
+ .crewlet-proposal-card__approve[data-arming] {
33
+ pointer-events: none;
34
+ }
35
+
36
+ /* THE DANGER TONE, while the decision is open: Card's rail (passed through
37
+ StatusCard) and the title in the danger ink, the step the tokens measure as
38
+ text, so it holds AA in every palette. The Tag keeps the state. */
39
+ .crewlet-proposal-card--danger .crewlet-card__title {
40
+ color: var(--color-feedback-danger-ink);
41
+ }
42
+
21
43
  /* WHY THE LAST DECISION WAS REFUSED, on a line of its own above the
22
44
  decision and at its end, as the held primary's reason is: the refusal
23
45
  strip's own inline drawing, which wraps rather than widening the row. */
@@ -1,4 +1,4 @@
1
- export { RelativeTime, currentNow, formatElapsed, formatExact, formatRelative, formatUntil, toISO, toInstant, useNow } from '../chunk-L6NG7CUA.js';
1
+ export { RelativeTime, currentNow, formatElapsed, formatExact, formatRelative, formatUntil, toISO, toInstant, useNow } from '../chunk-EJNJMHQG.js';
2
2
  import '../chunk-RE3FBGQQ.js';
3
3
  import '../chunk-UT6CW3C7.js';
4
4
  import '../chunk-ODEQTPFM.js';
@@ -1,4 +1,4 @@
1
- export { RichEditor, preloadRichEditor } from '../chunk-DS5NBENV.js';
1
+ export { RichEditor, preloadRichEditor } from '../chunk-BVNFNFA6.js';
2
2
  export { RICH_EDITOR_LABELS, richEditorLabels } from '../chunk-CSQTDGTS.js';
3
3
  import '../chunk-BAKPMH3S.js';
4
4
  import '../chunk-BPCY7ZID.js';
@@ -1,6 +1,6 @@
1
- export { SetupWizard } from '../chunk-R2YHKVWN.js';
2
- import '../chunk-FPDIHEM4.js';
1
+ export { SetupWizard } from '../chunk-SBHAKX2T.js';
3
2
  import '../chunk-HJBHP66O.js';
3
+ import '../chunk-FPDIHEM4.js';
4
4
  import '../chunk-WIATRXEJ.js';
5
5
  import '../chunk-222VILSP.js';
6
6
  import '../chunk-IVTQWOXV.js';
@@ -1,5 +1,5 @@
1
1
  import { type HTMLAttributes, type ReactNode } from 'react';
2
- import { type CardSectionPadding } from '../Card/index.js';
2
+ import { type CardRail, type CardSectionPadding } from '../Card/index.js';
3
3
  import { type TagVariant } from '../Tag/index.js';
4
4
  /** A card's state, drawn as a `Tag` at the end of its head. */
5
5
  export interface StatusCardStatus {
@@ -58,6 +58,12 @@ export interface StatusCardProps extends Omit<HTMLAttributes<HTMLElement>, 'titl
58
58
  * stays legible.
59
59
  */
60
60
  settled?: boolean | undefined;
61
+ /**
62
+ * A risk down the card's leading edge, Card's own rail: what the reader
63
+ * has to weigh before acting, such as a proposal that removes something.
64
+ * Never the state, which the Tag already says in words.
65
+ */
66
+ rail?: CardRail | undefined;
61
67
  /** The body's inset. `md` by default; `none` lets a table run to the card's edges. */
62
68
  bodyPadding?: CardSectionPadding | undefined;
63
69
  /** What happened, as a `ReceiptStrip` at the card's foot, above any actions. */
@@ -72,8 +78,9 @@ export interface StatusCardProps extends Omit<HTMLAttributes<HTMLElement>, 'titl
72
78
  * A record with a state, as the product's own card: the default `Card`, one
73
79
  * hairline, a sentence-case title over the head's rule, the state as a `Tag`
74
80
  * at the end of the head, and what happened as a strip at the foot. No tone
75
- * rail and no tinted head: the Tag says the state in words, and a rail beside
76
- * it only repeated it in colour.
81
+ * rail for the state and no tinted head: the Tag says the state in words, and
82
+ * a rail beside it only repeated it in colour. A rail is drawn only for a
83
+ * risk the Tag does not carry (`rail`).
77
84
  *
78
85
  * A SECTION NAMED BY ITS TITLE AND ITS STATE ("Create task, Needs your
79
86
  * approval"), so a reader moving by region hears both before reading the
@@ -1,8 +1,8 @@
1
- export { TABLE_TAGS_CELL_LABELS, TableDateCell, TableEntityCell, TableKeyCell, TableNumberCell, TableStatusCell, TableTagsCell, TableTextCell } from '../chunk-NWTHGZBH.js';
1
+ export { TABLE_TAGS_CELL_LABELS, TableDateCell, TableEntityCell, TableKeyCell, TableNumberCell, TableStatusCell, TableTagsCell, TableTextCell } from '../chunk-GNDKUSCG.js';
2
2
  import '../chunk-QF5UNP4T.js';
3
3
  import '../chunk-I5OIKDX2.js';
4
4
  import '../chunk-WIATRXEJ.js';
5
- import '../chunk-L6NG7CUA.js';
5
+ import '../chunk-EJNJMHQG.js';
6
6
  import '../chunk-RE3FBGQQ.js';
7
7
  import '../chunk-BKP6XCAJ.js';
8
8
  import '../chunk-PZKHBB7D.js';
@@ -1,6 +1,6 @@
1
- export { VersionTimeline } from '../chunk-SRSE7FGL.js';
1
+ export { VersionTimeline } from '../chunk-WPMZKZUH.js';
2
2
  import '../chunk-CI3VPIJN.js';
3
- import '../chunk-L6NG7CUA.js';
3
+ import '../chunk-EJNJMHQG.js';
4
4
  import '../chunk-RE3FBGQQ.js';
5
5
  import '../chunk-BKP6XCAJ.js';
6
6
  import '../chunk-PZKHBB7D.js';
@@ -1,6 +1,6 @@
1
- export { WidgetFrame } from '../chunk-4EDSEX7U.js';
1
+ export { WidgetFrame } from '../chunk-S5QJZOPL.js';
2
2
  import '../chunk-BRLZXYPA.js';
3
- import '../chunk-L6NG7CUA.js';
3
+ import '../chunk-EJNJMHQG.js';
4
4
  import '../chunk-RE3FBGQQ.js';
5
5
  import '../chunk-UT6CW3C7.js';
6
6
  import '../chunk-ODEQTPFM.js';
@@ -1,12 +1,14 @@
1
1
  import { RefusalStrip, ReceiptStrip } from './chunk-M25IV5MH.js';
2
2
  import { StatusCard } from './chunk-NTQPJJAN.js';
3
3
  import { ChangeList } from './chunk-WQRSZMN4.js';
4
+ import { Checkbox } from './chunk-PBCNINMB.js';
5
+ import { Disclosure } from './chunk-222VILSP.js';
4
6
  import { Button } from './chunk-7QTPJDRF.js';
5
7
  import { Spinner } from './chunk-XSPCITPN.js';
6
8
  import { cx } from './chunk-ODEQTPFM.js';
7
9
  import './VisuallyHidden-AOEXU5EB.css';
8
- import './ProposalCard-VTTCDXYK.css';
9
- import { useId, useRef, useLayoutEffect } from 'react';
10
+ import './ProposalCard-SF332W4E.css';
11
+ import { useId, useRef, useLayoutEffect, useState, useEffect } from 'react';
10
12
  import { RefreshCwGlyph, LockGlyph, BanGlyph, ClockGlyph, CircleAlertGlyph, CircleCheckGlyph } from '@crewlethq/icons/glyphs';
11
13
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
12
14
 
@@ -21,6 +23,7 @@ var PROPOSAL_STATES = [
21
23
  "failed"
22
24
  ];
23
25
  var PROPOSAL_FAILURE_OUTCOMES = ["unchanged", "unknown"];
26
+ var PROPOSAL_TONES = ["default", "danger"];
24
27
  var PROPOSAL_CARD_LABELS = {
25
28
  needsApproval: "Needs your approval",
26
29
  needsSignIn: "Needs sign-in",
@@ -48,9 +51,12 @@ var PROPOSAL_CARD_LABELS = {
48
51
  staleNotice: "What this would change moved after it was prepared, so it was not applied. Nothing changed.",
49
52
  nothingChanged: "Nothing changed.",
50
53
  unknownNotice: "Could not confirm whether this was applied. It may have landed.",
51
- busy: "The approved change is being carried out"
54
+ busy: "The approved change is being carried out",
55
+ confirmationNeeded: "Check the confirmation above first",
56
+ details: "Technical details"
52
57
  };
53
58
  var SETTLED = /* @__PURE__ */ new Set(["applied", "declined", "expired", "stale", "failed"]);
59
+ var ARMING_MS = 500;
54
60
  function statusOf(state, scope, outcome, labels) {
55
61
  switch (state) {
56
62
  case "pending":
@@ -90,6 +96,9 @@ function ProposalCard({
90
96
  changes,
91
97
  changesHeading,
92
98
  note,
99
+ details,
100
+ tone = "default",
101
+ confirmation,
93
102
  approveLabel,
94
103
  onApprove,
95
104
  onDecline,
@@ -132,6 +141,23 @@ function ProposalCard({
132
141
  const deciding = state === "pending" || state === "stepup";
133
142
  const blocked = deciding && approveBlocked ? approveBlocked : void 0;
134
143
  const refusal = deciding ? decisionRefusal : void 0;
144
+ const danger = tone === "danger" && !settled;
145
+ const identity = `${title}\0${approveLabel}`;
146
+ const [tickedFor, setTickedFor] = useState(void 0);
147
+ if (settled && tickedFor !== void 0) setTickedFor(void 0);
148
+ const unconfirmed = deciding && confirmation !== void 0 && tickedFor !== identity ? labels.confirmationNeeded : void 0;
149
+ const armKey = deciding ? `${state}\0${identity}` : void 0;
150
+ const [arm, setArm] = useState({ key: armKey, armed: false });
151
+ if (arm.key !== armKey) setArm({ key: armKey, armed: false });
152
+ useEffect(() => {
153
+ if (armKey === void 0) return;
154
+ const timer = setTimeout(
155
+ () => setArm((current) => current.key === armKey ? { key: armKey, armed: true } : current),
156
+ ARMING_MS
157
+ );
158
+ return () => clearTimeout(timer);
159
+ }, [armKey]);
160
+ const arming = armKey !== void 0 && !(arm.key === armKey && arm.armed);
135
161
  const decision = deciding || state === "applying" ? /* @__PURE__ */ jsxs(Fragment, { children: [
136
162
  /* @__PURE__ */ jsx(
137
163
  "div",
@@ -142,6 +168,18 @@ function ProposalCard({
142
168
  }
143
169
  ),
144
170
  blocked === void 0 ? null : /* @__PURE__ */ jsx("p", { className: "crewlet-proposal-card__blocked", "aria-hidden": "true", children: blocked }),
171
+ confirmation === void 0 ? null : /* @__PURE__ */ jsx(
172
+ Checkbox,
173
+ {
174
+ className: "crewlet-proposal-card__confirmation",
175
+ size: "sm",
176
+ tone: danger ? "danger" : "default",
177
+ label: confirmation.label,
178
+ checked: tickedFor === identity,
179
+ disabled: state === "applying",
180
+ onCheckedChange: (checked) => setTickedFor(checked ? identity : void 0)
181
+ }
182
+ ),
145
183
  /* @__PURE__ */ jsx(
146
184
  Button,
147
185
  {
@@ -151,7 +189,18 @@ function ProposalCard({
151
189
  children: labels.decline
152
190
  }
153
191
  ),
154
- /* @__PURE__ */ jsx(Button, { variant: "primary", loading: state === "applying", disabledReason: blocked, onClick: onApprove, children: state === "stepup" ? labels.confirmIdentity : approveLabel })
192
+ /* @__PURE__ */ jsx(
193
+ Button,
194
+ {
195
+ variant: danger ? "danger" : "primary",
196
+ className: "crewlet-proposal-card__approve",
197
+ loading: state === "applying",
198
+ disabledReason: blocked ?? unconfirmed,
199
+ "data-arming": arming || void 0,
200
+ onClick: onApprove,
201
+ children: state === "stepup" ? labels.confirmIdentity : approveLabel
202
+ }
203
+ )
155
204
  ] }) : void 0;
156
205
  const again = (state === "expired" || state === "stale") && onPrepareAgain ? /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "small", leadingIcon: /* @__PURE__ */ jsx(RefreshCwGlyph, {}), onClick: onPrepareAgain, children: labels.prepareAgain }) : void 0;
157
206
  const strip = state === "stepup" ? /* @__PURE__ */ jsx(ReceiptStrip, { tone: "neutral", icon: /* @__PURE__ */ jsx(LockGlyph, { size: "md" }), children: notice ?? labels.stepUpNotice }) : state === "applied" && receipt !== void 0 ? /* @__PURE__ */ jsx(ReceiptStrip, { ...landing, tone: "success", children: receipt }) : state === "declined" ? /* @__PURE__ */ jsx(ReceiptStrip, { ...landing, tone: "neutral", icon: /* @__PURE__ */ jsx(BanGlyph, { size: "md" }), children: notice ?? labels.declinedNotice }) : state === "expired" ? /* @__PURE__ */ jsx(ReceiptStrip, { ...landing, tone: "neutral", icon: /* @__PURE__ */ jsx(ClockGlyph, { size: "md" }), children: notice ?? labels.expiredNotice }) : state === "stale" ? /* @__PURE__ */ jsx(ReceiptStrip, { ...landing, tone: "neutral", icon: /* @__PURE__ */ jsx(ClockGlyph, { size: "md" }), children: notice ?? labels.staleNotice }) : state === "failed" ? /* @__PURE__ */ jsx(
@@ -182,8 +231,15 @@ function ProposalCard({
182
231
  strip,
183
232
  actions: decision ?? again,
184
233
  actionsAlign: decision ? "end" : "start",
185
- className: cx("crewlet-proposal-card", `crewlet-proposal-card--${state}`, className),
234
+ rail: danger ? "danger" : void 0,
235
+ className: cx(
236
+ "crewlet-proposal-card",
237
+ `crewlet-proposal-card--${state}`,
238
+ danger && "crewlet-proposal-card--danger",
239
+ className
240
+ ),
186
241
  "data-state": state,
242
+ "data-tone": danger ? "danger" : void 0,
187
243
  "data-outcome": state === "failed" ? failureOutcome : void 0,
188
244
  children: [
189
245
  summary === void 0 || summary === null ? null : /* @__PURE__ */ jsx("p", { className: "crewlet-proposal-card__summary", children: summary }),
@@ -197,10 +253,11 @@ function ProposalCard({
197
253
  diffLabels
198
254
  }
199
255
  ),
256
+ details === void 0 || details === null ? null : /* @__PURE__ */ jsx(Disclosure, { className: "crewlet-proposal-card__details", title: labels.details, size: "compact", lazy: true, children: details }),
200
257
  note === void 0 || note === null ? null : /* @__PURE__ */ jsx("p", { className: "crewlet-proposal-card__note", children: note })
201
258
  ]
202
259
  }
203
260
  );
204
261
  }
205
262
 
206
- export { PROPOSAL_CARD_LABELS, PROPOSAL_FAILURE_OUTCOMES, PROPOSAL_STATES, ProposalCard };
263
+ export { PROPOSAL_CARD_LABELS, PROPOSAL_FAILURE_OUTCOMES, PROPOSAL_STATES, PROPOSAL_TONES, ProposalCard };
@@ -1,11 +1,11 @@
1
1
  import { Skeleton } from './chunk-BRLZXYPA.js';
2
2
  import { PrincipalAvatar } from './chunk-CI3VPIJN.js';
3
- import { RelativeTime } from './chunk-L6NG7CUA.js';
3
+ import { RelativeTime } from './chunk-EJNJMHQG.js';
4
4
  import { Card } from './chunk-4AUTALJA.js';
5
5
  import { AvatarStack } from './chunk-BKP6XCAJ.js';
6
6
  import { ArtifactKindGround } from './chunk-NHLNHH4J.js';
7
- import { ArtifactAccessGlyph } from './chunk-DOY3KC6I.js';
8
7
  import { Checkbox } from './chunk-PBCNINMB.js';
8
+ import { ArtifactAccessGlyph } from './chunk-DOY3KC6I.js';
9
9
  import { ArtifactKindGlyph } from './chunk-RSKW25Y5.js';
10
10
  import { VisuallyHidden } from './chunk-UT6CW3C7.js';
11
11
  import { cx } from './chunk-ODEQTPFM.js';
@@ -9,7 +9,7 @@ import { jsx } from 'react/jsx-runtime';
9
9
  var engine = null;
10
10
  var loading = null;
11
11
  function loadEngine() {
12
- loading ??= import('./Editor-NZRUKWB4.js').then(
12
+ loading ??= import('./Editor-URGZOK2S.js').then(
13
13
  (module) => {
14
14
  engine = module.Editor;
15
15
  return engine;