@crewlethq/ui 0.60.0 → 0.62.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 (35) hide show
  1. package/README.md +8 -0
  2. package/dist/Combobox/index.js +1 -1
  3. package/dist/PrincipalPicker/index.js +2 -2
  4. package/dist/Prose/Prose.d.ts +5 -2
  5. package/dist/Prose/index.js +1 -1
  6. package/dist/{Prose-BTXNFT2Q.css → Prose-OMV2T6NT.css} +19 -2
  7. package/dist/RichEditor/index.js +1 -1
  8. package/dist/SendButton/SendButton.d.ts +25 -11
  9. package/dist/SendButton/index.d.ts +1 -0
  10. package/dist/SendButton/index.js +1 -1
  11. package/dist/SendButton-L4UX54XS.css +173 -0
  12. package/dist/ThinkingIndicator/ThinkingIndicator.d.ts +37 -0
  13. package/dist/ThinkingIndicator/index.d.ts +3 -0
  14. package/dist/ThinkingIndicator/index.js +3 -0
  15. package/dist/ThinkingIndicator-QJMX2TXC.css +122 -0
  16. package/dist/ValueField/ValueField.d.ts +117 -0
  17. package/dist/ValueField/index.d.ts +10 -0
  18. package/dist/ValueField/index.js +15 -0
  19. package/dist/ValueField/references.d.ts +66 -0
  20. package/dist/ValueField-EIBD6RYS.css +13 -0
  21. package/dist/{chunk-V57TGM2L.js → chunk-5MN2HISF.js} +1 -1
  22. package/dist/{chunk-JCSA3XVH.js → chunk-DVVP27OD.js} +1 -1
  23. package/dist/chunk-E2MIUNUU.js +19 -0
  24. package/dist/{chunk-RPHQNXE5.js → chunk-IOZFPFQS.js} +1 -1
  25. package/dist/chunk-OD3Z6QKN.js +237 -0
  26. package/dist/chunk-PBR5C5MX.js +33 -0
  27. package/dist/{chunk-VC2M2E7N.js → chunk-PK2P2QH6.js} +4 -3
  28. package/dist/generated/index.d.ts +2 -0
  29. package/dist/generated/index.js +15 -13
  30. package/dist/index.js +15 -13
  31. package/dist/styles.css +337 -3
  32. package/package.json +3 -3
  33. package/dist/chunk-XN5L5E5D.js +0 -27
  34. package/dist/{Editor-EQBOZPXS.js → Editor-DM7X24B7.js} +1 -1
  35. /package/dist/{chunk-DJV2FVD2.js → chunk-UOTNQV6D.js} +0 -0
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.62.0
209
+
210
+ **`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").
211
+
212
+ **The completion helpers are exported with it**: `referenceAt`, `rankReferences`, `completeReference`, `isWholeReference`, `urlSchemeOf`, `REFERENCE_NAME_PATTERN` and the `ReferenceQuery` type, for a field that completes references in a control of its own.
213
+
214
+ **`Combobox` on a password field is a combobox only while its list is open.** HTML allows no ARIA role on `type="password"`, so a masked field carried an invalid `role="combobox"` (and `aria-autocomplete` and `aria-expanded`) at rest. It now takes those only while it has options to show. Every other field is unchanged.
215
+
208
216
  ## Changes in 0.58.0
209
217
 
210
218
  **`Spinner` turns at a calm pace, and its arc breathes.** It turned once per `--motion-duration-slow` (300ms), a transition step, so every running mark (a pending `Button`, `RunChip` while it thinks or works, a running step in `StepList`, `StepStateMark`) spun more than three times a second and read as alarm rather than as work. It now turns once a second (`--motion-duration-turn`, linear) while its arc eases between a quarter and three quarters of the ring on a slower cycle (`--motion-duration-sweep`, 1.5s), with soft ends. The stroke is still one 2px border in the current ink at every size (`em`, `xs`, `sm`, `md`); the arc is cut by a mask, so no side of the border is transparent any more. Under reduced motion it stops as before and keeps its open quarter. The arc's length is a registered custom property (`@property --crewlet-spinner-arc`); a browser without `@property` support steps between the two lengths rather than easing.
@@ -1,4 +1,4 @@
1
- export { Combobox } from '../chunk-VC2M2E7N.js';
1
+ export { Combobox } from '../chunk-PK2P2QH6.js';
2
2
  import '../chunk-7KHM2FZH.js';
3
3
  import '../chunk-TLIJG4TP.js';
4
4
  import '../chunk-PGCLHYVP.js';
@@ -1,5 +1,5 @@
1
- export { PrincipalPicker } from '../chunk-RPHQNXE5.js';
2
- import '../chunk-VC2M2E7N.js';
1
+ export { PrincipalPicker } from '../chunk-IOZFPFQS.js';
2
+ import '../chunk-PK2P2QH6.js';
3
3
  import '../chunk-7KHM2FZH.js';
4
4
  import '../chunk-CI3VPIJN.js';
5
5
  import '../chunk-5AQBPHZD.js';
@@ -5,8 +5,11 @@ export interface ProseProps extends HTMLAttributes<HTMLElement> {
5
5
  as?: ElementType | undefined;
6
6
  tone?: ProseTone | undefined;
7
7
  /**
8
- * The text is still arriving. It draws a caret after the last character, and
9
- * the caret holds still under a reduced-motion preference.
8
+ * The text is still arriving. It draws a caret at the end of the last line
9
+ * of text (after the last paragraph or heading of rendered Markdown, and
10
+ * none on an empty block), and the caret holds still under a reduced-motion
11
+ * preference. A chat answer draws `ThinkingIndicator` after its prose
12
+ * instead, which never sits inside the words.
10
13
  */
11
14
  streaming?: boolean | undefined;
12
15
  /**
@@ -1,2 +1,2 @@
1
- export { Prose } from '../chunk-JCSA3XVH.js';
1
+ export { Prose } from '../chunk-DVVP27OD.js';
2
2
  import '../chunk-ODEQTPFM.js';
@@ -61,7 +61,23 @@
61
61
  transition: color var(--motion-duration-slow) var(--motion-easing-default);
62
62
  }
63
63
 
64
- .crewlet-prose--streaming::after {
64
+ /*
65
+ * THE CARET ENDS THE LAST LINE OF TEXT, never a line of its own. On a block
66
+ * that holds rendered Markdown, the block's own ::after came after its last
67
+ * paragraph or list, so the caret stood alone on a new line; and on a reply
68
+ * with no words yet it stood alone at the start. So: no caret on an empty
69
+ * block, none on the block itself when its children are blocks, and the caret
70
+ * after the last child instead when that child is a paragraph or a heading,
71
+ * whose last line it then ends. A list, a table or code last draws none: a
72
+ * caret after its final row reads as a stray mark, not as the end of a line.
73
+ */
74
+ .crewlet-prose--streaming:empty::after,
75
+ .crewlet-prose--streaming:has(> :is(p, div, ul, ol, pre, table, blockquote, h1, h2, h3, h4, h5, h6))::after {
76
+ content: none;
77
+ }
78
+
79
+ .crewlet-prose--streaming::after,
80
+ .crewlet-prose--streaming > :is(p, h1, h2, h3, h4, h5, h6):last-child::after {
65
81
  content: '';
66
82
  display: inline-block;
67
83
  width: 2px;
@@ -93,7 +109,8 @@
93
109
  transition: none;
94
110
  }
95
111
 
96
- .crewlet-prose--streaming::after {
112
+ .crewlet-prose--streaming::after,
113
+ .crewlet-prose--streaming > :is(p, h1, h2, h3, h4, h5, h6):last-child::after {
97
114
  animation: none;
98
115
  }
99
116
  }
@@ -1,4 +1,4 @@
1
- export { RichEditor, preloadRichEditor } from '../chunk-V57TGM2L.js';
1
+ export { RichEditor, preloadRichEditor } from '../chunk-5MN2HISF.js';
2
2
  export { RICH_EDITOR_LABELS, richEditorLabels } from '../chunk-CSQTDGTS.js';
3
3
  import '../chunk-BAKPMH3S.js';
4
4
  import '../chunk-BPCY7ZID.js';
@@ -2,9 +2,9 @@ import { type IconButtonProps } from '../IconButton/index.js';
2
2
  /** Whether the button sends the message or stops the request already running. */
3
3
  export type SendButtonMode = 'send' | 'stop';
4
4
  export interface SendButtonLabels {
5
- /** The send button's name and tooltip. */
5
+ /** The send button's name. */
6
6
  send: string;
7
- /** The stop button's name and tooltip. */
7
+ /** The stop button's name. */
8
8
  stop: string;
9
9
  }
10
10
  export declare const SEND_BUTTON_LABELS: SendButtonLabels;
@@ -14,10 +14,14 @@ export interface SendButtonProps extends Omit<IconButtonProps, 'label' | 'icon'
14
14
  /** Called on a press in either mode: the caller sends, or stops what is running. */
15
15
  onPress: () => void;
16
16
  /**
17
- * Why it cannot send right now ("Write a question first", "Offline"). Soft
18
- * disabled, as every disabled control here is: it keeps its place in the
19
- * tab order and says why. Ignored while stopping, because Stop is always
20
- * available while something runs.
17
+ * Why it cannot be pressed right now, in a few words. Soft disabled, as
18
+ * every disabled control here is: it keeps its place in the tab order, a
19
+ * screen reader is told the reason, and the pointer's tooltip says it.
20
+ *
21
+ * In `send` mode it is why there is nothing to send ("Type a question
22
+ * first", "Offline"). In `stop` mode it is a stop already under way
23
+ * ("Stopping"), which a second press could not hurry; leave it out while
24
+ * the request runs and Stop is always available.
21
25
  */
22
26
  disabledReason?: string | undefined;
23
27
  labels?: Partial<SendButtonLabels> | undefined;
@@ -27,12 +31,22 @@ export interface SendButtonProps extends Omit<IconButtonProps, 'label' | 'icon'
27
31
  *
28
32
  * ONE ELEMENT IN BOTH MODES, so the button a keyboard reader is on stays
29
33
  * focused when the request starts or ends: it changes what it says ("Send",
30
- * "Stop") and how it looks, never which element it is.
34
+ * "Stop") and how it looks, never which element it is. Both glyphs are drawn
35
+ * in one cell and the one not in use is faded and scaled away, so the change
36
+ * is a short cross fade in place rather than a swap.
37
+ *
38
+ * SEND is the accent square with the arrow, the one decision in the composer.
39
+ * With nothing to send it is not a faded accent, which read as a muddy block
40
+ * on the dark ground: it is the accent's soft tint with the arrow in the
41
+ * tertiary ink, and it lights up in the accent the moment there is something
42
+ * to send.
43
+ *
44
+ * STOP is the bordered square with a small filled square in the primary ink,
45
+ * the mark every media control uses for "stop", and an accent arc travelling
46
+ * round its edge while the request runs: the button says both that something
47
+ * is under way and how to end it. Stop is quieter than Send on purpose, a way
48
+ * out rather than the decision.
31
49
  *
32
- * SEND is the accent square (IconButton `primary`) with the arrow; STOP is the
33
- * bordered square (IconButton `secondary`) with a filled square in the primary
34
- * ink. Stop is quieter than Send on purpose: an inverse block was the loudest
35
- * thing on the panel in dark mode, and Stop is a way out, not the decision.
36
50
  * Inside a `Composer`'s `trailing` slot its corner nests in the composer's.
37
51
  */
38
52
  export declare const SendButton: import("react").ForwardRefExoticComponent<SendButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,2 +1,3 @@
1
+ import './SendButton.css';
1
2
  export { SEND_BUTTON_LABELS, SendButton } from './SendButton.js';
2
3
  export type { SendButtonLabels, SendButtonMode, SendButtonProps } from './SendButton.js';
@@ -1,4 +1,4 @@
1
- export { SEND_BUTTON_LABELS, SendButton } from '../chunk-XN5L5E5D.js';
1
+ export { SEND_BUTTON_LABELS, SendButton } from '../chunk-PBR5C5MX.js';
2
2
  import '../chunk-2XWFWNDT.js';
3
3
  import '../chunk-UT6CW3C7.js';
4
4
  import '../chunk-ODEQTPFM.js';
@@ -0,0 +1,173 @@
1
+ /*
2
+ * A chat composer's Send, which becomes Stop. See SendButton.tsx for what each
3
+ * state says. The surfaces, edges and hover and press inks are IconButton's
4
+ * primary and secondary squares; this sheet adds the glyph cross fade, the
5
+ * quiet held state, the press and the running arc.
6
+ */
7
+
8
+ /*
9
+ * THE ARC'S ANGLE, registered so it can turn. An unregistered custom property
10
+ * animates in one step at the halfway point, which would make the arc jump
11
+ * between two places rather than travel.
12
+ */
13
+ @property --crewlet-send-button-arc {
14
+ syntax: '<angle>';
15
+ inherits: false;
16
+ initial-value: 0deg;
17
+ }
18
+
19
+ .crewlet-send-button {
20
+ position: relative;
21
+ transition:
22
+ background var(--motion-duration-fast) var(--motion-easing-default),
23
+ border-color var(--motion-duration-fast) var(--motion-easing-default),
24
+ color var(--motion-duration-fast) var(--motion-easing-default),
25
+ transform var(--motion-duration-instant) var(--motion-easing-out);
26
+ }
27
+
28
+ /* A press sinks the square a little, so the pointer feels it land. */
29
+ .crewlet-send-button:active:not([aria-disabled='true']) {
30
+ transform: scale(0.94);
31
+ }
32
+
33
+ /*
34
+ * BOTH GLYPHS IN ONE CELL. The one in use stands at full size; the other is
35
+ * faded and scaled to half, and the two trade places on the base step with
36
+ * the entering surface's ease, so Send turning into Stop reads as one control
37
+ * changing its mind rather than as two buttons swapping.
38
+ */
39
+ .crewlet-send-button__glyphs {
40
+ display: grid;
41
+ place-items: center;
42
+ }
43
+
44
+ .crewlet-send-button__glyph {
45
+ grid-area: 1 / 1;
46
+ transition:
47
+ opacity var(--motion-duration-base) var(--motion-easing-default),
48
+ transform var(--motion-duration-base) var(--motion-easing-emphasized);
49
+ }
50
+
51
+ .crewlet-send-button--send .crewlet-send-button__glyph--stop,
52
+ .crewlet-send-button--stop .crewlet-send-button__glyph--send {
53
+ opacity: 0;
54
+ transform: scale(0.5);
55
+ }
56
+
57
+ /*
58
+ * THE STOP SQUARE IS SMALLER THAN THE ARROW: a filled block at the arrow's
59
+ * 14px was the heaviest mark on the panel. At the 12px step its square is
60
+ * nine pixels, crisp on the pixel grid and the weight of the arrow's stroke.
61
+ */
62
+ .crewlet-send-button.crewlet-icon-btn--md .crewlet-send-button__glyph--stop {
63
+ width: var(--font-size-xs);
64
+ height: var(--font-size-xs);
65
+ }
66
+
67
+ /*
68
+ * HELD, AT FULL OPACITY, with the glyph in the tertiary ink. A faded accent
69
+ * block read as a muddy, broken button on the dark ground, and the composer's
70
+ * own fade multiplied it further. Send held is the accent's soft tint, so it
71
+ * is still the purple control that lights up the moment there is something
72
+ * to send; Stop held (a stop already under way) is the neutral hover overlay,
73
+ * since nothing about it is waiting to light up.
74
+ */
75
+ .crewlet-send-button.crewlet-icon-btn[aria-disabled='true'] {
76
+ opacity: 1;
77
+ border-color: transparent;
78
+ color: var(--color-text-tertiary);
79
+ }
80
+
81
+ .crewlet-send-button--send.crewlet-icon-btn[aria-disabled='true'] {
82
+ background: var(--color-brand-accent-soft);
83
+ }
84
+
85
+ .crewlet-send-button--stop.crewlet-icon-btn[aria-disabled='true'] {
86
+ background: var(--color-surface-hover);
87
+ }
88
+
89
+ /*
90
+ * THE RUNNING ARC: a band of the accent travelling round Stop's edge, over its
91
+ * own 1px border, with a tail that fades behind it. The band is a conic
92
+ * gradient cut to a 2px ring by a mask (a mask reads only alpha, so its black
93
+ * is opacity rather than a colour), so it follows the rounded corner exactly.
94
+ * One round is the working ring's sweep period, and it fades in on the
95
+ * moderate step as Stop arrives.
96
+ */
97
+ .crewlet-send-button--stop::before {
98
+ content: '';
99
+ position: absolute;
100
+ inset: -1px;
101
+ padding: 2px;
102
+ border-radius: inherit;
103
+ background: conic-gradient(
104
+ from var(--crewlet-send-button-arc),
105
+ transparent 0turn,
106
+ transparent 0.55turn,
107
+ var(--color-brand-accent) 1turn
108
+ );
109
+ -webkit-mask:
110
+ linear-gradient(#000 0 0) content-box,
111
+ linear-gradient(#000 0 0);
112
+ -webkit-mask-composite: xor;
113
+ mask:
114
+ linear-gradient(#000 0 0) content-box exclude,
115
+ linear-gradient(#000 0 0);
116
+ /* Paint, never a target. */
117
+ pointer-events: none;
118
+ animation:
119
+ crewlet-send-button-arc var(--motion-duration-sweep) linear infinite,
120
+ crewlet-send-button-arc-in var(--motion-duration-moderate) var(--motion-easing-out);
121
+ }
122
+
123
+ /* A stop already under way has nothing left to show running. */
124
+ .crewlet-send-button--stop[aria-disabled='true']::before {
125
+ display: none;
126
+ }
127
+
128
+ @keyframes crewlet-send-button-arc {
129
+ to {
130
+ --crewlet-send-button-arc: 360deg;
131
+ }
132
+ }
133
+
134
+ @keyframes crewlet-send-button-arc-in {
135
+ from {
136
+ opacity: 0;
137
+ }
138
+
139
+ to {
140
+ opacity: 1;
141
+ }
142
+ }
143
+
144
+ /*
145
+ * UNDER REDUCED MOTION nothing travels or scales: the glyphs change in place,
146
+ * and the arc becomes the whole edge in the accent, still and still saying
147
+ * that something runs.
148
+ */
149
+ @media (prefers-reduced-motion: reduce) {
150
+ .crewlet-send-button {
151
+ transition: none;
152
+ }
153
+
154
+ .crewlet-send-button:active:not([aria-disabled='true']) {
155
+ transform: none;
156
+ }
157
+
158
+ .crewlet-send-button__glyph {
159
+ transition: none;
160
+ }
161
+
162
+ .crewlet-send-button--stop::before {
163
+ background: var(--color-brand-accent);
164
+ animation: none;
165
+ }
166
+ }
167
+
168
+ /* The system draws its own edge; a masked gradient is not repainted there. */
169
+ @media (forced-colors: active) {
170
+ .crewlet-send-button--stop::before {
171
+ display: none;
172
+ }
173
+ }
@@ -0,0 +1,37 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export interface ThinkingIndicatorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
3
+ /**
4
+ * What the assistant is doing now, beside the mark, under a slow shimmer:
5
+ * "Thinking", then the step that runs ("Listing the agents"). Left out, the
6
+ * mark stands alone, as it does while an answer's words arrive.
7
+ */
8
+ status?: string | undefined;
9
+ /**
10
+ * What a screen reader is told, once, when the indicator appears.
11
+ * "Thinking" by default. It never changes with `status`, so a reader is not
12
+ * told every step the assistant takes while they read.
13
+ */
14
+ label?: string | undefined;
15
+ }
16
+ /**
17
+ * The assistant at work, drawn where its answer will be: the Assistant's mark
18
+ * with its four blades turning a quarter at a time around a still core, and,
19
+ * while nothing of the answer is on screen yet, a line saying what it is doing
20
+ * under a slow shimmer.
21
+ *
22
+ * IN PLACE OF A CARET. A blinking bar after streamed text lands wherever the
23
+ * last block ends, on a line of its own under a list or at the start of an
24
+ * empty reply. The mark is a block of its own after the answer, one line of
25
+ * prose tall, so it never sits inside the words, and nothing moves when the
26
+ * first of them arrive: they are written above it, and it keeps its height.
27
+ *
28
+ * ONE ANNOUNCEMENT. `label` is said once, through a status region that keeps
29
+ * the same words for as long as the indicator stands; the visible line, which
30
+ * changes with every step, is hidden from assistive technology, where the
31
+ * steps are read from their own list.
32
+ *
33
+ * UNDER REDUCED MOTION the blades hold still and the line is drawn in the
34
+ * secondary ink without the shimmer: the mark and the words still say that
35
+ * work is under way.
36
+ */
37
+ export declare function ThinkingIndicator({ status, label, className, ...rest }: ThinkingIndicatorProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import './ThinkingIndicator.css';
2
+ export { ThinkingIndicator } from './ThinkingIndicator.js';
3
+ export type { ThinkingIndicatorProps } from './ThinkingIndicator.js';
@@ -0,0 +1,3 @@
1
+ export { ThinkingIndicator } from '../chunk-E2MIUNUU.js';
2
+ import '../chunk-UT6CW3C7.js';
3
+ import '../chunk-ODEQTPFM.js';
@@ -0,0 +1,122 @@
1
+ /*
2
+ * The assistant at work: the Assistant's mark, its blades turning, and a line
3
+ * of status under a shimmer. See ThinkingIndicator.tsx for why it replaces a
4
+ * caret and how it is announced.
5
+ */
6
+
7
+ /*
8
+ * ONE LINE OF PROSE TALL, at every state: the mark alone, the mark with a
9
+ * status line, and the line changing from one step to the next all keep the
10
+ * same height, so the thread never moves while the assistant works.
11
+ */
12
+ .crewlet-thinking {
13
+ display: flex;
14
+ align-items: center;
15
+ gap: var(--spacing-2);
16
+ min-width: 0;
17
+ min-height: calc(var(--font-size-compact) * var(--font-line-height-relaxed));
18
+ font-family: var(--font-family-sans);
19
+ font-size: var(--font-size-compact);
20
+ line-height: var(--font-line-height-relaxed);
21
+ }
22
+
23
+ /*
24
+ * THE BLADES TURN A QUARTER, THEN REST. The figure is four blades around a
25
+ * core, the same after a quarter turn, so each round ends where the next
26
+ * begins and the loop never shows a seam. One round is the breath period
27
+ * (2.2s): the turn takes its first half on the in-out ease and the second
28
+ * half is still, which reads as steady thought rather than as a spinner. The
29
+ * core holds still, as the mark's own description promises.
30
+ */
31
+ .crewlet-thinking__mark [data-motion='turn'] {
32
+ transform-box: view-box;
33
+ transform-origin: 50% 50%;
34
+ animation: crewlet-thinking-turn var(--motion-duration-breath) var(--motion-easing-in-out) infinite;
35
+ }
36
+
37
+ @keyframes crewlet-thinking-turn {
38
+ 0% {
39
+ transform: rotate(0deg);
40
+ }
41
+
42
+ 50%,
43
+ 100% {
44
+ transform: rotate(90deg);
45
+ }
46
+ }
47
+
48
+ /*
49
+ * THE SHIMMER IS A LIGHTER BAND CROSSING THE WORDS, the band Skeleton sweeps
50
+ * across a placeholder, set in ink rather than in surface: the words are the
51
+ * secondary ink at rest, so they read at every point of the sweep, and the
52
+ * band is the primary ink. The gradient is clipped to the glyphs and is three
53
+ * times the line's width, so the band crosses it rather than standing in it.
54
+ */
55
+ .crewlet-thinking__status {
56
+ min-width: 0;
57
+ overflow: hidden;
58
+ color: var(--color-text-secondary);
59
+ text-overflow: ellipsis;
60
+ white-space: nowrap;
61
+ animation: crewlet-thinking-enter var(--motion-duration-moderate) var(--motion-easing-out);
62
+ }
63
+
64
+ @supports (background-clip: text) or (-webkit-background-clip: text) {
65
+ .crewlet-thinking__status {
66
+ background-image: linear-gradient(
67
+ 90deg,
68
+ var(--color-text-secondary) 0%,
69
+ var(--color-text-secondary) 40%,
70
+ var(--color-text-primary) 50%,
71
+ var(--color-text-secondary) 60%,
72
+ var(--color-text-secondary) 100%
73
+ );
74
+ background-size: 300% 100%;
75
+ -webkit-background-clip: text;
76
+ background-clip: text;
77
+ color: transparent;
78
+ animation:
79
+ crewlet-thinking-enter var(--motion-duration-moderate) var(--motion-easing-out),
80
+ crewlet-thinking-shimmer var(--motion-duration-breath) linear infinite;
81
+ }
82
+ }
83
+
84
+ @keyframes crewlet-thinking-shimmer {
85
+ from {
86
+ background-position: 100% 50%;
87
+ }
88
+
89
+ to {
90
+ background-position: 0 50%;
91
+ }
92
+ }
93
+
94
+ @keyframes crewlet-thinking-enter {
95
+ from {
96
+ opacity: 0;
97
+ }
98
+
99
+ to {
100
+ opacity: 1;
101
+ }
102
+ }
103
+
104
+ @media (prefers-reduced-motion: reduce) {
105
+ .crewlet-thinking__mark [data-motion='turn'] {
106
+ animation: none;
107
+ }
108
+
109
+ .crewlet-thinking__status {
110
+ background-image: none;
111
+ color: var(--color-text-secondary);
112
+ animation: none;
113
+ }
114
+ }
115
+
116
+ /* The system's own ink: a gradient clipped to text is dropped there. */
117
+ @media (forced-colors: active) {
118
+ .crewlet-thinking__status {
119
+ background-image: none;
120
+ color: CanvasText;
121
+ }
122
+ }
@@ -0,0 +1,117 @@
1
+ import { type ReactNode } from 'react';
2
+ /**
3
+ * What a value field holds, which decides its control and what it does to a
4
+ * value on its way through.
5
+ *
6
+ * - `text`: free text, spaces kept.
7
+ * - `multiline`: prose in a textarea, every space and newline kept, spell check on.
8
+ * - `secret`: a credential, masked unless the value is a whole reference.
9
+ * - `url`: an address, wearing an `https://` affix, whitespace dropped.
10
+ * - `id` and `email`: one token, whitespace dropped.
11
+ * - `choice` and `handle`: one of `choices`, picked from a listbox.
12
+ */
13
+ export type ValueFieldKind = 'text' | 'multiline' | 'secret' | 'url' | 'id' | 'choice' | 'handle' | 'email';
14
+ /** One option of a `choice` or `handle` field. */
15
+ export interface ValueFieldChoice {
16
+ value: string;
17
+ label: string;
18
+ /** A sentence saying what picking this one does: drawn under the option, and on the help line once chosen. */
19
+ hint?: string | undefined;
20
+ }
21
+ /** The words a value field draws itself. */
22
+ export interface ValueFieldLabels {
23
+ /** Names the completion list. "Secrets" by default. */
24
+ references: string;
25
+ /** The choice placeholder while nothing is chosen. "Choose one" by default. */
26
+ choose: string;
27
+ }
28
+ export interface ValueFieldProps {
29
+ label: string;
30
+ /** A mark drawn before the label, such as a third party's own logo. */
31
+ mark?: ReactNode;
32
+ kind?: ValueFieldKind | undefined;
33
+ value: string;
34
+ onChange: (value: string) => void;
35
+ /** Where the value comes from, or what shape it takes. */
36
+ help?: ReactNode;
37
+ /** Why the last value was refused. */
38
+ error?: ReactNode;
39
+ placeholder?: string | undefined;
40
+ /** What a `choice` or `handle` field offers; ignored by every other kind. */
41
+ choices?: readonly ValueFieldChoice[] | undefined;
42
+ disabled?: boolean | undefined;
43
+ /**
44
+ * Whether an answer is required. REQUIRED IS THE UNMARKED DEFAULT: `false`
45
+ * says "(optional)" beside the label, `true` sets `aria-required` and draws
46
+ * nothing unless `markRequired` says the requiredness is news. Most fields
47
+ * on a form are required, and marking them all is noise that teaches a
48
+ * reader to skip the note.
49
+ */
50
+ required?: boolean | undefined;
51
+ /**
52
+ * Says "(required)" beside the label, for a field whose requiredness is
53
+ * NEWS: one that appeared because of an answer above it. Read only with
54
+ * `required`.
55
+ */
56
+ markRequired?: boolean | undefined;
57
+ autoFocus?: boolean | undefined;
58
+ /**
59
+ * The stored entry names offered when somebody types `$`, completed into a
60
+ * whole `${NAME}`. NAMES ONLY: a value never reaches the field, so a list
61
+ * that could not be assembled leaves the field exactly as it was.
62
+ */
63
+ references?: readonly string[] | undefined;
64
+ /**
65
+ * Called as the completion list is about to open, so the caller can make
66
+ * sure the names are current. On the way in only, never per keystroke.
67
+ */
68
+ onReferencesNeeded?: (() => void) | undefined;
69
+ /**
70
+ * Whether a value is exactly one reference, which keeps a `secret` field
71
+ * readable and lets a `url` field's affix step aside. [isWholeReference]
72
+ * by default; a product with its own reference grammar passes it here.
73
+ */
74
+ isReference?: ((value: string) => boolean) | undefined;
75
+ /** How many lines a `multiline` field shows before it scrolls. Three by default. */
76
+ rows?: number | undefined;
77
+ /** Show the help line only while the field has focus. See [FormField]. */
78
+ helperOnFocus?: boolean | undefined;
79
+ labels?: Partial<ValueFieldLabels> | undefined;
80
+ className?: string | undefined;
81
+ }
82
+ /**
83
+ * A labelled value: [FormField] with the control a kind of value needs, and
84
+ * the rules every form holding such values otherwise rewrites.
85
+ *
86
+ * A SECRET FIELD IS A PASSWORD FIELD, and that is not decoration: `type` is
87
+ * what keeps the value out of an autofill store, out of a screenshot and out
88
+ * of the accessibility tree as text.
89
+ *
90
+ * A REFERENCE IS NOT A CREDENTIAL, so it is not masked. A secret whose value
91
+ * is wholly a `${NAME}` holds the NAME of a stored entry, and the reader has
92
+ * to be able to see which entry it points at. Typing over it masks again the
93
+ * moment it stops being a whole reference, so a credential is never on screen.
94
+ *
95
+ * TYPING `$` OFFERS THE STORED ENTRIES, from `references`, ranked closest
96
+ * first and written in as a whole `${NAME}` with the caret after it. Tab and
97
+ * Enter take the highlighted name, Escape closes the list and keeps what was
98
+ * typed, and a press outside closes only the list.
99
+ *
100
+ * A URL FIELD WEARS ITS SCHEME. An `https://` affix sits inside the box, is
101
+ * read once as part of the value, and is written into it. It steps aside for
102
+ * a value that carries `http://` and for one starting with `$` (a reference
103
+ * carries its own scheme once it resolves), and a pasted `https://` is not
104
+ * doubled onto it.
105
+ *
106
+ * A SINGLE TOKEN TAKES NO WHITESPACE. A `url`, `id` or `email` drops it as it
107
+ * is typed or pasted: a space around one is invisible in the box and fatal
108
+ * wherever it is used. No field asserts `type="email"`, because the browser
109
+ * would refuse a reference for having no "@" in it; `inputMode` still offers
110
+ * the right keyboard.
111
+ *
112
+ * A CHOICE IS THE LISTBOX, which can draw each choice's hint under it. The
113
+ * chosen one's hint also joins the help line, and a stored answer the list
114
+ * no longer offers keeps a row of its own rather than vanishing into a
115
+ * different selection.
116
+ */
117
+ export declare function ValueField({ label, mark, kind, value, onChange, help, error, placeholder, choices, disabled, required, markRequired, autoFocus, references, onReferencesNeeded, isReference, rows, helperOnFocus, labels, className, }: ValueFieldProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import '../Input/Input.css';
2
+ import '../VisuallyHidden/VisuallyHidden.css';
3
+ import '../HitArea/HitArea.css';
4
+ import '../Combobox/Combobox.css';
5
+ import '../Select/Select.css';
6
+ import './ValueField.css';
7
+ export { ValueField } from './ValueField.js';
8
+ export type { ValueFieldChoice, ValueFieldKind, ValueFieldLabels, ValueFieldProps } from './ValueField.js';
9
+ export { REFERENCE_NAME_PATTERN, completeReference, isWholeReference, rankReferences, referenceAt, urlSchemeOf, } from './references.js';
10
+ export type { ReferenceQuery } from './references.js';
@@ -0,0 +1,15 @@
1
+ export { REFERENCE_NAME_PATTERN, ValueField, completeReference, isWholeReference, rankReferences, referenceAt, urlSchemeOf } from '../chunk-OD3Z6QKN.js';
2
+ import '../chunk-XQZ6EWOE.js';
3
+ import '../chunk-PK2P2QH6.js';
4
+ import '../chunk-7KHM2FZH.js';
5
+ import '../chunk-TLIJG4TP.js';
6
+ import '../chunk-PGCLHYVP.js';
7
+ import '../chunk-PQADV6P6.js';
8
+ import '../chunk-2G355KDJ.js';
9
+ import '../chunk-OMV5W53A.js';
10
+ import '../chunk-2YTOOH3A.js';
11
+ import '../chunk-H5XTJ7GJ.js';
12
+ import '../chunk-2XWFWNDT.js';
13
+ import '../chunk-NUZHC6MM.js';
14
+ import '../chunk-UT6CW3C7.js';
15
+ import '../chunk-ODEQTPFM.js';