rift-ds 1.33.0 → 1.35.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 +3 -3
- package/behaviors/chat-card.css +11 -6
- package/behaviors/locale.d.ts +9 -0
- package/behaviors/locale.js +2 -0
- package/bin/templates/blocks/app/dashboard/page.tsx +1 -1
- package/bin/templates/blocks/components/blocks/AppShell.module.css +10 -6
- package/chat/AssistantTurn.d.ts +2 -0
- package/chat/AssistantTurn.js +18 -7
- package/chat/ChatProvider.js +14 -0
- package/chat/ChatTabs.js +1 -1
- package/chat/ChatWidget.css +10 -0
- package/chat/ChatWidget.d.ts +9 -5
- package/chat/ChatWidget.js +7 -4
- package/chat/DemoWelcome.js +2 -2
- package/chat/FollowupSuggestions.js +1 -1
- package/chat/agentState.d.ts +2 -1
- package/chat/agentState.js +4 -1
- package/chat/awaiting.d.ts +19 -0
- package/chat/awaiting.js +21 -0
- package/chat/context.d.ts +4 -0
- package/chat/index.d.ts +1 -0
- package/chat/index.js +3 -1
- package/chat/server.d.ts +8 -3
- package/chat/server.js +1 -1
- package/components/ActionBar/ActionBar.css +78 -0
- package/components/ActionBar/ActionBar.d.ts +40 -0
- package/components/ActionBar/ActionBar.js +29 -0
- package/components/ActionCard/ActionCard.css +3 -3
- package/components/AgentStatus/AgentStatus.css +114 -22
- package/components/AgentStatus/AgentStatus.d.ts +10 -7
- package/components/AgentStatus/AgentStatus.js +10 -0
- package/components/AiButton/AiButton.d.ts +3 -3
- package/components/AiButton/AiButton.js +1 -1
- package/components/Alert/Alert.css +16 -0
- package/components/Alert/Alert.d.ts +2 -2
- package/components/Alert/Alert.js +3 -1
- package/components/AppSidebar/AppSidebar.css +140 -4
- package/components/AppSidebar/AppSidebar.d.ts +12 -0
- package/components/AppSidebar/AppSidebar.js +7 -3
- package/components/ChatThread/ChatThread.d.ts +5 -1
- package/components/ChatThread/ChatThread.js +1 -1
- package/components/Composer/Composer.css +14 -9
- package/components/Composer/Composer.d.ts +10 -8
- package/components/Composer/Composer.js +2 -1
- package/components/ContextMenu/ContextMenu.d.ts +5 -1
- package/components/ContextMenu/ContextMenu.js +2 -1
- package/components/ContributionGraph/ContributionGraph.d.ts +7 -1
- package/components/ContributionGraph/ContributionGraph.js +4 -18
- package/components/ContributionGraph/weeks.d.ts +8 -0
- package/components/ContributionGraph/weeks.js +25 -0
- package/components/DataTable/DataTable.js +1 -1
- package/components/DocumentChip/DocumentChip.js +1 -1
- package/components/EntitySwitcher/EntitySwitcher.css +11 -3
- package/components/EntitySwitcher/EntitySwitcher.js +1 -1
- package/components/EventCalendar/EventCalendar.css +152 -0
- package/components/EventCalendar/EventCalendar.d.ts +50 -4
- package/components/EventCalendar/EventCalendar.js +154 -23
- package/components/EventCalendar/eventTime.d.ts +31 -0
- package/components/EventCalendar/eventTime.js +42 -0
- package/components/FileInput/FileInput.d.ts +12 -4
- package/components/FileInput/FileInput.js +27 -4
- package/components/Input/Input.css +30 -0
- package/components/Input/Input.d.ts +8 -0
- package/components/Input/Input.js +3 -0
- package/components/MessageCard/MessageCard.css +1 -1
- package/components/Popover/Popover.d.ts +5 -1
- package/components/Popover/Popover.js +3 -1
- package/components/ProgressBar/ProgressBar.d.ts +5 -1
- package/components/ProgressBar/ProgressBar.js +1 -1
- package/components/PromptSuggestions/PromptSuggestions.d.ts +5 -1
- package/components/PromptSuggestions/PromptSuggestions.js +1 -1
- package/components/ResourceTimeline/ResourceTimeline.js +2 -2
- package/components/SegmentedControl/SegmentedControl.css +120 -3
- package/components/SegmentedControl/SegmentedControl.d.ts +9 -0
- package/components/SegmentedControl/SegmentedControl.js +11 -1
- package/components/ShaderScene/ShaderScene.d.ts +3 -3
- package/components/ShaderScene/scenes.d.ts +17 -0
- package/components/ShaderScene/scenes.js +175 -1
- package/components/SourceTrail/SourceTrail.css +1 -1
- package/components/Stat/Stat.css +12 -0
- package/components/Stat/Stat.d.ts +5 -0
- package/components/Stat/Stat.js +9 -3
- package/components/TableToolbar/TableToolbar.js +2 -2
- package/components/ThemeToggle/ThemeToggle.d.ts +1 -1
- package/components/ThreadTabs/ThreadTabs.d.ts +5 -1
- package/components/ThreadTabs/ThreadTabs.js +2 -1
- package/components/ToggleGroup/ToggleGroup.d.ts +5 -1
- package/components/ToolCall/ToolCall.css +2 -2
- package/components/UsageCard/UsageCard.css +4 -3
- package/components/registry.json +21 -4
- package/components/registry.json.d.ts +21 -4
- package/components/registry.json.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/package.json +1 -1
|
@@ -12,7 +12,9 @@ const FileInput = React.forwardRef(
|
|
|
12
12
|
placeholder = "Drag and drop, or click to browse",
|
|
13
13
|
accept,
|
|
14
14
|
multiple = false,
|
|
15
|
-
files
|
|
15
|
+
files: controlledFiles,
|
|
16
|
+
defaultFiles,
|
|
17
|
+
onFilesChange,
|
|
16
18
|
size = "default",
|
|
17
19
|
disabled = false,
|
|
18
20
|
required = false,
|
|
@@ -33,6 +35,10 @@ const FileInput = React.forwardRef(
|
|
|
33
35
|
}, ref) => {
|
|
34
36
|
const locale = useLocale(localeProp);
|
|
35
37
|
const [isDragging, setIsDragging] = useState(false);
|
|
38
|
+
const isControlled = controlledFiles !== void 0;
|
|
39
|
+
const [internalFiles, setInternalFiles] = useState(defaultFiles ?? []);
|
|
40
|
+
const files = isControlled ? controlledFiles : internalFiles;
|
|
41
|
+
const nextEntryId = useRef(0);
|
|
36
42
|
const inputRef = useRef(null);
|
|
37
43
|
const generatedId = useId();
|
|
38
44
|
const inputId = id || name || generatedId;
|
|
@@ -42,10 +48,27 @@ const FileInput = React.forwardRef(
|
|
|
42
48
|
if (typeof ref === "function") ref(node);
|
|
43
49
|
else if (ref) ref.current = node;
|
|
44
50
|
};
|
|
51
|
+
const commitFiles = (next) => {
|
|
52
|
+
if (!isControlled) setInternalFiles(next);
|
|
53
|
+
onFilesChange?.(next);
|
|
54
|
+
};
|
|
45
55
|
const emitFiles = (fileList) => {
|
|
46
56
|
if (!fileList || fileList.length === 0) return;
|
|
47
|
-
|
|
57
|
+
const picked = Array.from(fileList);
|
|
58
|
+
onFilesSelected?.(picked);
|
|
59
|
+
const entries = picked.map((file) => ({
|
|
60
|
+
id: `${generatedId}-file-${nextEntryId.current += 1}`,
|
|
61
|
+
name: file.name,
|
|
62
|
+
size: file.size,
|
|
63
|
+
file
|
|
64
|
+
}));
|
|
65
|
+
commitFiles(multiple ? [...files, ...entries] : entries);
|
|
66
|
+
};
|
|
67
|
+
const removeFile = (fileId) => {
|
|
68
|
+
onFileRemove?.(fileId);
|
|
69
|
+
commitFiles(files.filter((entry) => entry.id !== fileId));
|
|
48
70
|
};
|
|
71
|
+
const canRemove = Boolean(onFileRemove || onFilesChange || !isControlled);
|
|
49
72
|
const handleChange = (e) => {
|
|
50
73
|
onChange?.(e);
|
|
51
74
|
emitFiles(e.target.files);
|
|
@@ -176,12 +199,12 @@ const FileInput = React.forwardRef(
|
|
|
176
199
|
}
|
|
177
200
|
)
|
|
178
201
|
] }),
|
|
179
|
-
|
|
202
|
+
canRemove && /* @__PURE__ */ jsx(
|
|
180
203
|
"button",
|
|
181
204
|
{
|
|
182
205
|
type: "button",
|
|
183
206
|
className: `${baseClass}__file-remove`,
|
|
184
|
-
onClick: () =>
|
|
207
|
+
onClick: () => removeFile(file.id),
|
|
185
208
|
disabled,
|
|
186
209
|
"aria-label": removeLabel(file.name),
|
|
187
210
|
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", "aria-hidden": "true", children: "close" })
|
|
@@ -327,3 +327,33 @@
|
|
|
327
327
|
.ds-input--affixed.ds-input--compact.ds-input--has-icon-right .ds-input__field-wrapper {
|
|
328
328
|
padding-inline-end: var(--padding-200);
|
|
329
329
|
}
|
|
330
|
+
|
|
331
|
+
/* ============================================
|
|
332
|
+
QUIET
|
|
333
|
+
At rest the field draws no border and no fill,
|
|
334
|
+
only its leading icon and placeholder. The
|
|
335
|
+
border stays, transparent, so revealing it
|
|
336
|
+
moves nothing. The rest rule names every
|
|
337
|
+
condition that reveals the field, so a
|
|
338
|
+
revealed field is simply the default one,
|
|
339
|
+
with its own hover, focus and error states:
|
|
340
|
+
the field hovered or focused, a value in it,
|
|
341
|
+
an error, disabled, or the nearest
|
|
342
|
+
[data-quiet-host] ancestor (a list row)
|
|
343
|
+
hovered.
|
|
344
|
+
============================================ */
|
|
345
|
+
|
|
346
|
+
.ds-input--quiet:not(.ds-input--filled, .ds-input--error, .ds-input--disabled):not(:where([data-quiet-host]:hover) *):not(.ds-input--affixed) .ds-input__field:not(:hover, :focus),
|
|
347
|
+
.ds-input--quiet.ds-input--affixed:not(.ds-input--filled, .ds-input--error, .ds-input--disabled):not(:where([data-quiet-host]:hover) *) .ds-input__field-wrapper:not(:hover, :focus-within) {
|
|
348
|
+
border-color: transparent;
|
|
349
|
+
background-color: transparent;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* Forced colors flatten every fill, so the border is all that marks the
|
|
353
|
+
field out: keep it at rest. */
|
|
354
|
+
@media (forced-colors: active) {
|
|
355
|
+
.ds-input--quiet:not(.ds-input--filled, .ds-input--error, .ds-input--disabled):not(:where([data-quiet-host]:hover) *):not(.ds-input--affixed) .ds-input__field:not(:hover, :focus),
|
|
356
|
+
.ds-input--quiet.ds-input--affixed:not(.ds-input--filled, .ds-input--error, .ds-input--disabled):not(:where([data-quiet-host]:hover) *) .ds-input__field-wrapper:not(:hover, :focus-within) {
|
|
357
|
+
border-color: var(--color-input-border-primary);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
@@ -9,6 +9,14 @@ type InputOwnProps = {
|
|
|
9
9
|
type?: 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url';
|
|
10
10
|
/** Component size (not the native character-width `size` attribute) */
|
|
11
11
|
size?: 'default' | 'compact';
|
|
12
|
+
/**
|
|
13
|
+
* The field's form. `quiet` draws no border or fill at rest, only the
|
|
14
|
+
* leading icon and the placeholder, and reveals the full field while it is
|
|
15
|
+
* hovered, focused or holds a value, or while the nearest ancestor marked
|
|
16
|
+
* `data-quiet-host` (a list row) is hovered. For a list where every row can
|
|
17
|
+
* take an optional entry. An error always shows the full field.
|
|
18
|
+
*/
|
|
19
|
+
variant?: 'default' | 'quiet';
|
|
12
20
|
/** Error state — shows error styling and message */
|
|
13
21
|
error?: boolean;
|
|
14
22
|
/** Helper text displayed below the input. With the older `error` flag and no `errorText`, it doubles as the error message. */
|
|
@@ -13,6 +13,7 @@ const Input = React.forwardRef(
|
|
|
13
13
|
value,
|
|
14
14
|
type = "text",
|
|
15
15
|
size = "default",
|
|
16
|
+
variant = "default",
|
|
16
17
|
disabled = false,
|
|
17
18
|
required = false,
|
|
18
19
|
error = false,
|
|
@@ -57,6 +58,8 @@ const Input = React.forwardRef(
|
|
|
57
58
|
const classes = [
|
|
58
59
|
baseClass,
|
|
59
60
|
size === "compact" ? `${baseClass}--compact` : "",
|
|
61
|
+
variant === "quiet" ? `${baseClass}--quiet` : "",
|
|
62
|
+
variant === "quiet" && filled ? `${baseClass}--filled` : "",
|
|
60
63
|
invalid ? `${baseClass}--error` : "",
|
|
61
64
|
affixed ? `${baseClass}--affixed` : "",
|
|
62
65
|
disabled ? `${baseClass}--disabled` : "",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
padding: var(--padding-400) var(--ds-chat-card-inset) var(--padding-200);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
/* Without media the body opens the card, at the chat cards'
|
|
89
|
+
/* Without media the body opens the card, at the chat cards' edge. */
|
|
90
90
|
.ds-message-card__body:first-child {
|
|
91
91
|
padding-top: var(--ds-chat-card-edge);
|
|
92
92
|
}
|
|
@@ -29,7 +29,11 @@ type PopoverOwnProps = {
|
|
|
29
29
|
defaultOpen?: boolean;
|
|
30
30
|
/** Callback when open state changes */
|
|
31
31
|
onOpenChange?: (open: boolean) => void;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Legacy accessible-name prop for the trigger and the panel. A native `aria-label` wins when both are passed, and names those two rather than the wrapper; with neither, the panel is named "Popover".
|
|
34
|
+
*
|
|
35
|
+
* @deprecated Pass the native `aria-label` attribute instead.
|
|
36
|
+
*/
|
|
33
37
|
ariaLabel?: string;
|
|
34
38
|
/** Additional CSS classes for the popover's root wrapper, which holds the trigger and the panel */
|
|
35
39
|
className?: string;
|
|
@@ -19,12 +19,14 @@ const Popover = React.forwardRef(
|
|
|
19
19
|
open: controlledOpen,
|
|
20
20
|
defaultOpen = false,
|
|
21
21
|
onOpenChange,
|
|
22
|
-
ariaLabel,
|
|
22
|
+
ariaLabel: legacyAriaLabel,
|
|
23
|
+
"aria-label": nativeAriaLabel,
|
|
23
24
|
className = "",
|
|
24
25
|
onMouseEnter,
|
|
25
26
|
onMouseLeave,
|
|
26
27
|
...rest
|
|
27
28
|
}, ref) => {
|
|
29
|
+
const ariaLabel = nativeAriaLabel ?? legacyAriaLabel;
|
|
28
30
|
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
29
31
|
const containerRef = useRef(null);
|
|
30
32
|
const triggerRef = useRef(null);
|
|
@@ -7,7 +7,11 @@ type ProgressBarOwnProps = {
|
|
|
7
7
|
size?: 'default' | 'compact';
|
|
8
8
|
/** Show percentage label */
|
|
9
9
|
showLabel?: boolean;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Legacy accessible-name prop for the bar, saying what is loading. A native `aria-label` wins when both are passed; with neither, the bar is named "Progress".
|
|
12
|
+
*
|
|
13
|
+
* @deprecated Pass the native `aria-label` attribute instead.
|
|
14
|
+
*/
|
|
11
15
|
ariaLabel?: string;
|
|
12
16
|
/** The BCP 47 locale the percentage label is written in, such as `ar-EG`. Defaults to `en-US`. This component can render from a Server Component, so it takes the prop alone and reads no LocaleProvider. */
|
|
13
17
|
locale?: string;
|
|
@@ -22,7 +22,7 @@ const ProgressBar = React.forwardRef(
|
|
|
22
22
|
"aria-valuenow": clamped,
|
|
23
23
|
"aria-valuemin": 0,
|
|
24
24
|
"aria-valuemax": 100,
|
|
25
|
-
"aria-label":
|
|
25
|
+
"aria-label": restAriaLabel ?? ariaLabel ?? "Progress",
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ jsx("div", { className: `${baseClass}__track`, children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__fill`, style: { width: `${clamped}%` } }) }),
|
|
28
28
|
showLabel && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: formatPercent(clamped, locale) })
|
|
@@ -67,7 +67,11 @@ type PromptSuggestionsOwnProps = {
|
|
|
67
67
|
value?: string;
|
|
68
68
|
/** Visually hidden text read after the taken suggestion once `value` is set. Defaults to "(chosen)". */
|
|
69
69
|
chosenLabel?: string;
|
|
70
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Legacy accessible-name prop for the list. Defaults to "Suggested prompts"; a native `aria-label` wins when both are passed.
|
|
72
|
+
*
|
|
73
|
+
* @deprecated Pass the native `aria-label` attribute instead.
|
|
74
|
+
*/
|
|
71
75
|
ariaLabel?: string;
|
|
72
76
|
/** Additional CSS classes */
|
|
73
77
|
className?: string;
|
|
@@ -62,7 +62,7 @@ const PromptSuggestions = React.forwardRef(
|
|
|
62
62
|
ref,
|
|
63
63
|
className: classes,
|
|
64
64
|
role: "list",
|
|
65
|
-
"aria-label": ariaLabel,
|
|
65
|
+
"aria-label": rest["aria-label"] ?? ariaLabel,
|
|
66
66
|
"aria-busy": pending || void 0,
|
|
67
67
|
"data-pending": pending || void 0,
|
|
68
68
|
children: pending ? Array.from({ length: pendingCount }, (_, index) => /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: `${baseClass}__item`, children: block ? (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { DEFAULT_LOCALE } from "../../behaviors/locale.js";
|
|
3
|
+
import { DEFAULT_LOCALE, plainSpaces } from "../../behaviors/locale.js";
|
|
4
4
|
import { ScrollRegion } from "../../behaviors/ScrollRegion.js";
|
|
5
5
|
import "../../behaviors/visually-hidden.css";
|
|
6
6
|
import "../../behaviors/direction.css";
|
|
@@ -34,7 +34,7 @@ function ResourceTimeline({
|
|
|
34
34
|
minute: "2-digit"
|
|
35
35
|
});
|
|
36
36
|
const asDate = (minutes) => new Date(2e3, 0, 1, Math.floor(minutes / 60), minutes % 60);
|
|
37
|
-
const range = (start, end) => timeFormat.formatRange(asDate(start), asDate(end));
|
|
37
|
+
const range = (start, end) => plainSpaces(timeFormat.formatRange(asDate(start), asDate(end)));
|
|
38
38
|
const hours = [];
|
|
39
39
|
for (let h = from / 60; h <= to / 60; h++) hours.push(h);
|
|
40
40
|
const nowMinutes = now ? minutesOf(now) : null;
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
left: 0; /* ds-allow(physical): the pill slides by the segment's measured offsetLeft, which is a screen offset in either direction */
|
|
39
39
|
width: 0;
|
|
40
40
|
height: 0;
|
|
41
|
+
box-sizing: border-box; /* a status pill's hairline sits inside the measured box */
|
|
41
42
|
border-radius: var(--radius-pill);
|
|
42
43
|
background-color: var(--color-action-primary-bg);
|
|
43
44
|
opacity: 0;
|
|
@@ -46,7 +47,8 @@
|
|
|
46
47
|
transition:
|
|
47
48
|
transform var(--motion-duration-base) var(--motion-ease-entrance),
|
|
48
49
|
width var(--motion-duration-base) var(--motion-ease-entrance),
|
|
49
|
-
background-color var(--motion-duration-base) var(--motion-ease-standard)
|
|
50
|
+
background-color var(--motion-duration-base) var(--motion-ease-standard),
|
|
51
|
+
border-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
.ds-segmented-control--pill-ready .ds-segmented-control__pill {
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
|
|
65
67
|
/* Hovering the active segment darkens the pill, mirroring the retired
|
|
66
68
|
per-segment hover fill. */
|
|
67
|
-
.ds-segmented-control--pill-ready:has(.ds-segmented-control__segment--active:hover) .ds-segmented-control__pill {
|
|
69
|
+
.ds-segmented-control--pill-ready:not(.ds-segmented-control--status):has(.ds-segmented-control__segment--active:hover) .ds-segmented-control__pill {
|
|
68
70
|
background-color: var(--color-action-primary-bg-hover);
|
|
69
71
|
}
|
|
70
72
|
|
|
@@ -72,7 +74,7 @@
|
|
|
72
74
|
background-color: var(--color-action-neutral-bg);
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
.ds-segmented-control--pill-ready.ds-segmented-control--neutral:has(.ds-segmented-control__segment--active:hover) .ds-segmented-control__pill {
|
|
77
|
+
.ds-segmented-control--pill-ready.ds-segmented-control--neutral:not(.ds-segmented-control--status):has(.ds-segmented-control__segment--active:hover) .ds-segmented-control__pill {
|
|
76
78
|
background-color: var(--color-action-neutral-bg-hover);
|
|
77
79
|
}
|
|
78
80
|
|
|
@@ -191,6 +193,121 @@
|
|
|
191
193
|
background-color: var(--color-action-neutral-bg-hover);
|
|
192
194
|
}
|
|
193
195
|
|
|
196
|
+
/* ============================================
|
|
197
|
+
STATUS SEGMENTS (Segment.status)
|
|
198
|
+
A selected segment whose choice is a status
|
|
199
|
+
(Present, Late, Absent) wears that status in
|
|
200
|
+
place of the action colour or the neutral
|
|
201
|
+
tone: the status surface Alert and Toast draw,
|
|
202
|
+
its tinted fill and border with the status
|
|
203
|
+
text on it. The pill keeps sliding, and its
|
|
204
|
+
colours tween with it. Idle segments, hover
|
|
205
|
+
and the focus ring are the control's own; the
|
|
206
|
+
status has no hover step, so hovering the
|
|
207
|
+
selected segment holds its fill.
|
|
208
|
+
============================================ */
|
|
209
|
+
|
|
210
|
+
.ds-segmented-control__pill--positive,
|
|
211
|
+
.ds-segmented-control__segment--positive {
|
|
212
|
+
--ds-segmented-status-bg: var(--color-status-positive-bg);
|
|
213
|
+
--ds-segmented-status-border: var(--color-status-positive-border);
|
|
214
|
+
--ds-segmented-status-text: var(--color-status-positive-text);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ds-segmented-control__pill--warning,
|
|
218
|
+
.ds-segmented-control__segment--warning {
|
|
219
|
+
--ds-segmented-status-bg: var(--color-status-warning-bg);
|
|
220
|
+
--ds-segmented-status-border: var(--color-status-warning-border);
|
|
221
|
+
--ds-segmented-status-text: var(--color-status-warning-text);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.ds-segmented-control__pill--error,
|
|
225
|
+
.ds-segmented-control__segment--error {
|
|
226
|
+
--ds-segmented-status-bg: var(--color-status-error-bg);
|
|
227
|
+
--ds-segmented-status-border: var(--color-status-error-border);
|
|
228
|
+
--ds-segmented-status-text: var(--color-status-error-text);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.ds-segmented-control__pill--info,
|
|
232
|
+
.ds-segmented-control__segment--info {
|
|
233
|
+
--ds-segmented-status-bg: var(--color-status-info-bg);
|
|
234
|
+
--ds-segmented-status-border: var(--color-status-info-border);
|
|
235
|
+
--ds-segmented-status-text: var(--color-status-info-text);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.ds-segmented-control .ds-segmented-control__pill:is(
|
|
239
|
+
.ds-segmented-control__pill--positive,
|
|
240
|
+
.ds-segmented-control__pill--warning,
|
|
241
|
+
.ds-segmented-control__pill--error,
|
|
242
|
+
.ds-segmented-control__pill--info
|
|
243
|
+
) {
|
|
244
|
+
background-color: var(--ds-segmented-status-bg);
|
|
245
|
+
border: var(--border-025) solid var(--ds-segmented-status-border);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Before the pill is measured, the selected segment paints the status
|
|
249
|
+
itself, as it paints the action colour. */
|
|
250
|
+
.ds-segmented-control:not(.ds-segmented-control--pill-ready) .ds-segmented-control__segment--active:is(
|
|
251
|
+
.ds-segmented-control__segment--positive,
|
|
252
|
+
.ds-segmented-control__segment--warning,
|
|
253
|
+
.ds-segmented-control__segment--error,
|
|
254
|
+
.ds-segmented-control__segment--info
|
|
255
|
+
),
|
|
256
|
+
.ds-segmented-control:not(.ds-segmented-control--pill-ready) .ds-segmented-control__segment--active:is(
|
|
257
|
+
.ds-segmented-control__segment--positive,
|
|
258
|
+
.ds-segmented-control__segment--warning,
|
|
259
|
+
.ds-segmented-control__segment--error,
|
|
260
|
+
.ds-segmented-control__segment--info
|
|
261
|
+
):hover {
|
|
262
|
+
background-color: var(--ds-segmented-status-bg);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.ds-segmented-control .ds-segmented-control__segment--active:is(
|
|
266
|
+
.ds-segmented-control__segment--positive,
|
|
267
|
+
.ds-segmented-control__segment--warning,
|
|
268
|
+
.ds-segmented-control__segment--error,
|
|
269
|
+
.ds-segmented-control__segment--info
|
|
270
|
+
) :is(.ds-segmented-control__label:not(.ds-segmented-control__label--tip), .ds-segmented-control__icon) {
|
|
271
|
+
color: var(--ds-segmented-status-text);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* Forced colours flatten the status fill to the page, so a selected status
|
|
275
|
+
segment keeps the system highlight every selection wears there. */
|
|
276
|
+
@media (forced-colors: active) {
|
|
277
|
+
.ds-segmented-control .ds-segmented-control__pill:is(
|
|
278
|
+
.ds-segmented-control__pill--positive,
|
|
279
|
+
.ds-segmented-control__pill--warning,
|
|
280
|
+
.ds-segmented-control__pill--error,
|
|
281
|
+
.ds-segmented-control__pill--info
|
|
282
|
+
),
|
|
283
|
+
.ds-segmented-control:not(.ds-segmented-control--pill-ready) .ds-segmented-control__segment--active:is(
|
|
284
|
+
.ds-segmented-control__segment--positive,
|
|
285
|
+
.ds-segmented-control__segment--warning,
|
|
286
|
+
.ds-segmented-control__segment--error,
|
|
287
|
+
.ds-segmented-control__segment--info
|
|
288
|
+
) {
|
|
289
|
+
background-color: var(--color-action-primary-bg);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.ds-segmented-control .ds-segmented-control__pill:is(
|
|
293
|
+
.ds-segmented-control__pill--positive,
|
|
294
|
+
.ds-segmented-control__pill--warning,
|
|
295
|
+
.ds-segmented-control__pill--error,
|
|
296
|
+
.ds-segmented-control__pill--info
|
|
297
|
+
) {
|
|
298
|
+
border-color: var(--color-action-primary-bg);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.ds-segmented-control .ds-segmented-control__segment--active:is(
|
|
302
|
+
.ds-segmented-control__segment--positive,
|
|
303
|
+
.ds-segmented-control__segment--warning,
|
|
304
|
+
.ds-segmented-control__segment--error,
|
|
305
|
+
.ds-segmented-control__segment--info
|
|
306
|
+
) :is(.ds-segmented-control__label:not(.ds-segmented-control__label--tip), .ds-segmented-control__icon) {
|
|
307
|
+
color: var(--color-action-primary-text);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
194
311
|
/* ============================================
|
|
195
312
|
DISABLED STATE
|
|
196
313
|
============================================ */
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/** The status roles a segment can mean (see `Segment.status`). */
|
|
3
|
+
export type SegmentStatus = 'positive' | 'warning' | 'error' | 'info';
|
|
2
4
|
export interface Segment {
|
|
3
5
|
/** Unique value for this segment */
|
|
4
6
|
value: string;
|
|
@@ -8,6 +10,13 @@ export interface Segment {
|
|
|
8
10
|
icon?: string | React.ReactNode;
|
|
9
11
|
/** Whether disabled */
|
|
10
12
|
disabled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* A status the choice itself means. When this segment is selected, the pill
|
|
15
|
+
* takes that status's colours (`--color-status-*`) in place of the action
|
|
16
|
+
* colour, for a set whose options are statuses (Present, Late, Absent).
|
|
17
|
+
* Idle segments, hover and the focus ring are unchanged.
|
|
18
|
+
*/
|
|
19
|
+
status?: SegmentStatus;
|
|
11
20
|
/** The id of the `role="tabpanel"` element this segment shows, written as its `aria-controls`. The consumer renders the panels. */
|
|
12
21
|
panelId?: string;
|
|
13
22
|
}
|
|
@@ -77,12 +77,14 @@ const SegmentedControl = React.forwardRef(
|
|
|
77
77
|
setCollapseState({ key: collapseKey, mode: "full" });
|
|
78
78
|
}
|
|
79
79
|
const collapseMode = !showLabels ? "icons" : collapseState.key === collapseKey ? collapseState.mode : "full";
|
|
80
|
+
const activeStatus = segments.find((segment) => segment.value === activeSegment)?.status;
|
|
80
81
|
const classes = [
|
|
81
82
|
baseClass,
|
|
82
83
|
sizeClass,
|
|
83
84
|
variantClass,
|
|
84
85
|
fullWidthClass,
|
|
85
86
|
pillReady ? `${baseClass}--pill-ready` : "",
|
|
87
|
+
activeStatus ? `${baseClass}--status` : "",
|
|
86
88
|
!showLabels ? `${baseClass}--icons` : "",
|
|
87
89
|
className
|
|
88
90
|
].filter(Boolean).join(" ");
|
|
@@ -298,12 +300,20 @@ const SegmentedControl = React.forwardRef(
|
|
|
298
300
|
showTip(event.target);
|
|
299
301
|
},
|
|
300
302
|
children: [
|
|
301
|
-
/* @__PURE__ */ jsx(
|
|
303
|
+
/* @__PURE__ */ jsx(
|
|
304
|
+
"span",
|
|
305
|
+
{
|
|
306
|
+
className: `${baseClass}__pill${activeStatus ? ` ${baseClass}__pill--${activeStatus}` : ""}`,
|
|
307
|
+
"aria-hidden": "true",
|
|
308
|
+
ref: pillRef
|
|
309
|
+
}
|
|
310
|
+
),
|
|
302
311
|
segments.map((segment, idx) => {
|
|
303
312
|
const isActive = segment.value === activeSegment;
|
|
304
313
|
const btnClasses = [
|
|
305
314
|
`${baseClass}__segment`,
|
|
306
315
|
isActive ? `${baseClass}__segment--active` : "",
|
|
316
|
+
isActive && segment.status ? `${baseClass}__segment--${segment.status}` : "",
|
|
307
317
|
segment.disabled ? `${baseClass}__segment--disabled` : "",
|
|
308
318
|
// Icon and label both on screen: the icon's edge takes a step
|
|
309
319
|
// less padding (design.md, SegmentedControl).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ShaderSceneSource, Values } from './types';
|
|
3
3
|
/** The scenes the library ships, picked by id. */
|
|
4
|
-
export type ShaderSceneId = 'horizon' | 'rift' | 'glyphs' | 'prism' | 'meteors' | 'waves' | 'aurora' | 'highway' | 'ocean' | 'sky' | 'galaxy';
|
|
4
|
+
export type ShaderSceneId = 'horizon' | 'rift' | 'glyphs' | 'prism' | 'meteors' | 'waves' | 'aurora' | 'highway' | 'ocean' | 'sky' | 'galaxy' | 'tide';
|
|
5
5
|
/**
|
|
6
6
|
* How the scene resolved, the same three states ShaderField reports.
|
|
7
7
|
* `pending` while the GL context comes up (bounded by a watchdog), `active`
|
|
@@ -23,7 +23,7 @@ type ShaderSceneOwnProps = {
|
|
|
23
23
|
/**
|
|
24
24
|
* The scene to paint: one of the library's by id, or a scene of your own as
|
|
25
25
|
* a `ShaderSceneSource` (its colour roles, its settings and the GLSL that
|
|
26
|
-
* paints it). The library's are `horizon`, a planet's limb at night, `rift`, a glowing tear, `glyphs`, soft light printed in type, `prism`, beams of light split into a spectrum, `meteors`, a shower over a planet's edge, `waves`, a rolling sea of points, `highway`, a straight highway at night drawn in light trails, `aurora`, ribbons of colour round a void, `ocean`, open water from above with sea life drawn in type, turquoise on a light page and moonlit on a dark one, `sky`, cloud massed overhead and burning with a low sun, a golden hour on a light page and the last of a sunset under a night sky on a dark one,
|
|
26
|
+
* paints it). The library's are `horizon`, a planet's limb at night, `rift`, a glowing tear, `glyphs`, soft light printed in type, `prism`, beams of light split into a spectrum, `meteors`, a shower over a planet's edge, `waves`, a rolling sea of points, `highway`, a straight highway at night drawn in light trails, `aurora`, ribbons of colour round a void, `ocean`, open water from above with sea life drawn in type, turquoise on a light page and moonlit on a dark one, `sky`, cloud massed overhead and burning with a low sun, a golden hour on a light page and the last of a sunset under a night sky on a dark one, `galaxy`, a spiral galaxy seen at a slant, deep in a field of stars, and `tide`, dusk over still water smeared like a long exposure, a periwinkle evening on a light page and the last of the light on a dark one. A scene of your own is compared by content, so
|
|
27
27
|
* an object written inline rebuilds nothing until what it says changes.
|
|
28
28
|
*/
|
|
29
29
|
scene?: ShaderSceneId | ShaderSceneSource;
|
|
@@ -74,7 +74,7 @@ export interface ShaderSceneProps extends ShaderSceneOwnProps, Omit<React.Compon
|
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* ShaderScene paints one of the system's shader scenes, a horizon, a rift,
|
|
77
|
-
* a field of glyphs, a prism, a meteor shower, a sea of points, an aurora, a night highway, an ocean seen from above, a sky of burning cloud
|
|
77
|
+
* a field of glyphs, a prism, a meteor shower, a sea of points, an aurora, a night highway, an ocean seen from above, a sky of burning cloud, a spiral galaxy or dusk over still water, in WebGL2, with finishing passes over it (a scrim, a vignette, top and
|
|
78
78
|
* bottom fades to the page, film grain). Its colours are the background
|
|
79
79
|
* field's roles (`--color-ambient-*`) read from the live cascade at the
|
|
80
80
|
* scene, so it re-themes with `data-theme`, a preset or any scoped override,
|
|
@@ -151,4 +151,21 @@ export declare const sky: Scene;
|
|
|
151
151
|
* at up to two pixels per CSS pixel and sizes everything in CSS pixels.
|
|
152
152
|
*/
|
|
153
153
|
export declare const galaxy: Scene;
|
|
154
|
+
/**
|
|
155
|
+
* The tide: dusk over still water, painted as if the camera were dragged
|
|
156
|
+
* sideways through a long exposure, so every shape is a horizontal smear.
|
|
157
|
+
* Night comes down from the top of the sky, which clears to a cold band
|
|
158
|
+
* near the water; a band of fire lies right on the horizon with a hot line
|
|
159
|
+
* along it, a dark smear of cloud hangs above the fire and burns along its
|
|
160
|
+
* underside, and a low spit of land runs out on the right. The water below
|
|
161
|
+
* mirrors the sky, broken into streaks that close up as they run off to the
|
|
162
|
+
* horizon, with the fire laid in it and glints under the sun. Like the sky
|
|
163
|
+
* it has a day of its own, told from the page ground: on a light page a
|
|
164
|
+
* periwinkle evening over pale water, on a dark one the last of the light
|
|
165
|
+
* under a night sky. It reads the whole ambient set and casts it by
|
|
166
|
+
* temperature, since a theme's slots carry no fixed hue: the coolest tone
|
|
167
|
+
* is the sky and the water, the warmest the fire and the next warmest its
|
|
168
|
+
* second tone, so a theme recolours it and it still reads as a sunset.
|
|
169
|
+
*/
|
|
170
|
+
export declare const tide: Scene;
|
|
154
171
|
export declare const SCENES: Scene[];
|