@robr0/design-system 0.4.0 → 0.5.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 +2 -2
- package/components/AgentStatus/AgentStatus.css +82 -22
- package/components/AgentStatus/AgentStatus.d.ts +6 -2
- package/components/AgentStatus/AgentStatus.js +38 -6
- package/components/AiButton/AiButton.css +163 -0
- package/components/AiButton/AiButton.d.ts +36 -0
- package/components/AiButton/AiButton.js +58 -0
- package/components/ChatHeader/ChatHeader.css +35 -0
- package/components/ChatHeader/ChatHeader.d.ts +30 -0
- package/components/ChatHeader/ChatHeader.js +17 -0
- package/components/ChatMarker/ChatMarker.css +52 -0
- package/components/ChatMarker/ChatMarker.d.ts +22 -0
- package/components/ChatMarker/ChatMarker.js +18 -0
- package/components/ChatMessage/ChatMessage.css +304 -0
- package/components/ChatMessage/ChatMessage.d.ts +68 -0
- package/components/ChatMessage/ChatMessage.js +69 -0
- package/components/ChatThread/ChatThread.css +171 -0
- package/components/ChatThread/ChatThread.d.ts +41 -0
- package/components/ChatThread/ChatThread.js +174 -0
- package/components/Chip/Chip.css +27 -0
- package/components/Chip/Chip.d.ts +2 -2
- package/components/CircularButton/CircularButton.d.ts +23 -8
- package/components/CircularButton/CircularButton.js +54 -52
- package/components/CodeBlock/CodeBlock.css +2 -2
- package/components/Composer/Composer.css +164 -0
- package/components/Composer/Composer.d.ts +67 -0
- package/components/Composer/Composer.js +120 -0
- package/components/DocumentChip/DocumentChip.css +181 -0
- package/components/DocumentChip/DocumentChip.d.ts +41 -0
- package/components/DocumentChip/DocumentChip.js +78 -0
- package/components/InterruptCard/InterruptCard.css +164 -0
- package/components/InterruptCard/InterruptCard.d.ts +55 -0
- package/components/InterruptCard/InterruptCard.js +57 -0
- package/components/MessageActions/MessageActions.css +76 -0
- package/components/MessageActions/MessageActions.d.ts +38 -0
- package/components/MessageActions/MessageActions.js +33 -0
- package/components/MessageCard/MessageCard.css +112 -0
- package/components/MessageCard/MessageCard.d.ts +35 -0
- package/components/MessageCard/MessageCard.js +28 -0
- package/components/NavList/NavList.css +155 -0
- package/components/NavList/NavList.d.ts +56 -0
- package/components/NavList/NavList.js +99 -0
- package/components/PromptSuggestions/PromptSuggestions.css +87 -0
- package/components/PromptSuggestions/PromptSuggestions.d.ts +51 -0
- package/components/PromptSuggestions/PromptSuggestions.js +34 -0
- package/components/Prose/Prose.css +252 -0
- package/components/Prose/Prose.d.ts +21 -0
- package/components/Prose/Prose.js +14 -0
- package/components/Reasoning/Reasoning.css +149 -25
- package/components/Reasoning/Reasoning.d.ts +19 -0
- package/components/Reasoning/Reasoning.js +32 -3
- package/components/SourceChip/SourceChip.css +102 -0
- package/components/SourceChip/SourceChip.d.ts +32 -0
- package/components/SourceChip/SourceChip.js +31 -0
- package/components/Stat/Stat.css +2 -2
- package/components/ToolCall/ToolCall.css +3 -3
- package/components/registry.json +113 -1
- package/components/registry.json.d.ts +113 -1
- package/components/registry.json.js +1 -1
- package/index.d.ts +14 -0
- package/index.js +28 -0
- package/package.json +1 -1
- package/tokens/registry.json +12 -0
- package/tokens/registry.json.d.ts +12 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +13 -0
- package/tokens/tokens-light.css +42 -0
- package/tokens/tokens-typography.css +24 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
PROMPT SUGGESTIONS COMPONENT
|
|
3
|
+
Horizontal row of tappable prompt chips.
|
|
4
|
+
Scrolls with pure-CSS edge fades by default;
|
|
5
|
+
wraps for empty-state hero placements.
|
|
6
|
+
============================================ */
|
|
7
|
+
|
|
8
|
+
.ds-prompt-suggestions {
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: var(--gap-sm);
|
|
11
|
+
/* Breathing room so chip focus rings aren't clipped by the scroll box */
|
|
12
|
+
padding-block: var(--padding-xxxs);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* ============================================
|
|
16
|
+
SIZE
|
|
17
|
+
The pill scale itself is Chip's — the row only
|
|
18
|
+
picks which size to ask for. What belongs here
|
|
19
|
+
is the gutter between pills, which opens up a
|
|
20
|
+
step at the larger size.
|
|
21
|
+
============================================ */
|
|
22
|
+
|
|
23
|
+
.ds-prompt-suggestions--default {
|
|
24
|
+
gap: var(--gap-sm-md);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ds-prompt-suggestions--compact {
|
|
28
|
+
/* Base gap applies. */
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* ============================================
|
|
32
|
+
SCROLL — one line, overflow hinted by fades
|
|
33
|
+
============================================ */
|
|
34
|
+
|
|
35
|
+
/* Edge fades — scroll layout only, which is why the layout is named on the
|
|
36
|
+
element rather than inferred: content near either edge fades out, hinting
|
|
37
|
+
there is more to scroll. A CSS mask, not a scroll listener.
|
|
38
|
+
ds-allow(color): mask alpha keywords (black/transparent), not palette colours */
|
|
39
|
+
.ds-prompt-suggestions--scroll {
|
|
40
|
+
overflow-x: auto;
|
|
41
|
+
-webkit-mask-image: linear-gradient(
|
|
42
|
+
to right,
|
|
43
|
+
transparent,
|
|
44
|
+
black var(--gap-lg),
|
|
45
|
+
black calc(100% - var(--gap-lg)),
|
|
46
|
+
transparent
|
|
47
|
+
);
|
|
48
|
+
mask-image: linear-gradient(
|
|
49
|
+
to right,
|
|
50
|
+
transparent,
|
|
51
|
+
black var(--gap-lg),
|
|
52
|
+
black calc(100% - var(--gap-lg)),
|
|
53
|
+
transparent
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ============================================
|
|
58
|
+
WRAP — multi-line hero variant, no fades
|
|
59
|
+
============================================ */
|
|
60
|
+
|
|
61
|
+
.ds-prompt-suggestions--wrap {
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ============================================
|
|
66
|
+
STACK — one suggestion per line
|
|
67
|
+
For narrow columns, where a wrapped row breaks
|
|
68
|
+
wherever the labels happen to run out of room
|
|
69
|
+
and the ragged right edge reads as an accident.
|
|
70
|
+
Pills still hug their labels: stretching them
|
|
71
|
+
to a shared width would make a set of prompts
|
|
72
|
+
look like a set of buttons.
|
|
73
|
+
============================================ */
|
|
74
|
+
|
|
75
|
+
.ds-prompt-suggestions--stack {
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
align-items: flex-start;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* ============================================
|
|
81
|
+
ITEMS
|
|
82
|
+
============================================ */
|
|
83
|
+
|
|
84
|
+
.ds-prompt-suggestions__item {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** One tappable suggestion in the row. */
|
|
3
|
+
export interface PromptSuggestion {
|
|
4
|
+
/** Stable identifier passed to `onValueChange`. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** The suggestion text shown in the chip. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Optional leading Material Symbol name. */
|
|
9
|
+
icon?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Props owned by PromptSuggestions itself — everything else falls through to the root element. */
|
|
12
|
+
type PromptSuggestionsOwnProps = {
|
|
13
|
+
/** The suggestions to render, in order. */
|
|
14
|
+
suggestions: PromptSuggestion[];
|
|
15
|
+
/** Fires with the tapped suggestion's `id`. */
|
|
16
|
+
onValueChange?: (id: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* How the suggestions are arranged. `scroll` is one line that scrolls
|
|
19
|
+
* sideways behind edge fades. `wrap` runs them across as many lines as
|
|
20
|
+
* they need, for empty-state hero placements. `stack` gives each one its
|
|
21
|
+
* own line, for narrow columns where a wrapped row breaks unevenly and
|
|
22
|
+
* the ragged right edge reads as an accident.
|
|
23
|
+
*/
|
|
24
|
+
layout?: 'scroll' | 'wrap' | 'stack';
|
|
25
|
+
/**
|
|
26
|
+
* Legacy alias for `layout="wrap"`; ignored when `layout` is set.
|
|
27
|
+
* @deprecated Use `layout` instead, which also covers `stack`.
|
|
28
|
+
*/
|
|
29
|
+
wrap?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Row scale. `default` sits at the body-paragraph scale, so a suggestion
|
|
32
|
+
* reads at the same weight as the messages it will become; `compact` is
|
|
33
|
+
* the quieter row for placements alongside a live conversation.
|
|
34
|
+
*/
|
|
35
|
+
size?: 'default' | 'compact';
|
|
36
|
+
/** Accessible name for the list. */
|
|
37
|
+
ariaLabel?: string;
|
|
38
|
+
/** Additional CSS classes */
|
|
39
|
+
className?: string;
|
|
40
|
+
};
|
|
41
|
+
export interface PromptSuggestionsProps extends PromptSuggestionsOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof PromptSuggestionsOwnProps> {
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* PromptSuggestions is a horizontal row of tappable prompts for starting or
|
|
45
|
+
* steering a conversation. Each suggestion renders as a clickable Chip, so
|
|
46
|
+
* one component owns the pill look; the row scrolls horizontally with pure
|
|
47
|
+
* CSS edge fades — no scroll listeners, no measurement — or wraps for
|
|
48
|
+
* empty-state hero placements.
|
|
49
|
+
*/
|
|
50
|
+
export declare const PromptSuggestions: React.ForwardRefExoticComponent<PromptSuggestionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Chip } from "../Chip/Chip.js";
|
|
4
|
+
import "./PromptSuggestions.css";
|
|
5
|
+
const PromptSuggestions = React.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
suggestions,
|
|
8
|
+
onValueChange,
|
|
9
|
+
layout,
|
|
10
|
+
wrap = false,
|
|
11
|
+
size = "default",
|
|
12
|
+
ariaLabel = "Suggested prompts",
|
|
13
|
+
className = "",
|
|
14
|
+
...rest
|
|
15
|
+
}, ref) => {
|
|
16
|
+
const baseClass = "ds-prompt-suggestions";
|
|
17
|
+
const arrangement = layout ?? (wrap ? "wrap" : "scroll");
|
|
18
|
+
const chipSize = size === "compact" ? "default" : "large";
|
|
19
|
+
const classes = [baseClass, `${baseClass}--${size}`, `${baseClass}--${arrangement}`, className].filter(Boolean).join(" ");
|
|
20
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: classes, role: "list", "aria-label": ariaLabel, children: suggestions.map((suggestion) => /* @__PURE__ */ jsx("div", { role: "listitem", className: `${baseClass}__item`, children: /* @__PURE__ */ jsx(
|
|
21
|
+
Chip,
|
|
22
|
+
{
|
|
23
|
+
label: suggestion.label,
|
|
24
|
+
icon: suggestion.icon,
|
|
25
|
+
size: chipSize,
|
|
26
|
+
onClick: () => onValueChange?.(suggestion.id)
|
|
27
|
+
}
|
|
28
|
+
) }, suggestion.id)) });
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
PromptSuggestions.displayName = "PromptSuggestions";
|
|
32
|
+
export {
|
|
33
|
+
PromptSuggestions
|
|
34
|
+
};
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
PROSE COMPONENT
|
|
3
|
+
Token-styled typography for rendered markdown
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-prose {
|
|
7
|
+
font-family: var(--font-paragraph-family);
|
|
8
|
+
font-size: var(--font-paragraph-size);
|
|
9
|
+
font-weight: var(--font-paragraph-weight);
|
|
10
|
+
line-height: var(--font-paragraph-line-height);
|
|
11
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
12
|
+
color: var(--color-text-primary);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Block rhythm — every block owns its bottom margin; the edges are
|
|
16
|
+
trimmed so Prose slots into bubbles and cards cleanly */
|
|
17
|
+
.ds-prose p,
|
|
18
|
+
.ds-prose ul,
|
|
19
|
+
.ds-prose ol,
|
|
20
|
+
.ds-prose pre,
|
|
21
|
+
.ds-prose blockquote,
|
|
22
|
+
.ds-prose table,
|
|
23
|
+
.ds-prose hr,
|
|
24
|
+
.ds-prose img {
|
|
25
|
+
margin: 0;
|
|
26
|
+
margin-block-end: var(--gap-md);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ds-prose > :first-child {
|
|
30
|
+
margin-block-start: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ds-prose > :last-child {
|
|
34
|
+
margin-block-end: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* ============================================
|
|
38
|
+
PARAGRAPHS
|
|
39
|
+
============================================ */
|
|
40
|
+
|
|
41
|
+
.ds-prose p {
|
|
42
|
+
font-family: var(--font-paragraph-family);
|
|
43
|
+
font-size: var(--font-paragraph-size);
|
|
44
|
+
font-weight: var(--font-paragraph-weight);
|
|
45
|
+
line-height: var(--font-paragraph-line-height);
|
|
46
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
47
|
+
color: var(--color-text-primary);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* ============================================
|
|
51
|
+
HEADINGS
|
|
52
|
+
Hierarchy carried by the token scale; the
|
|
53
|
+
weight contrast is encoded in the tokens
|
|
54
|
+
============================================ */
|
|
55
|
+
|
|
56
|
+
.ds-prose h1,
|
|
57
|
+
.ds-prose h2,
|
|
58
|
+
.ds-prose h3,
|
|
59
|
+
.ds-prose h4 {
|
|
60
|
+
margin: 0;
|
|
61
|
+
margin-block-start: var(--gap-lg);
|
|
62
|
+
margin-block-end: var(--gap-sm-md);
|
|
63
|
+
color: var(--color-text-primary);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ds-prose h1 {
|
|
67
|
+
font-family: var(--font-heading-1-family);
|
|
68
|
+
font-size: var(--font-heading-1-size);
|
|
69
|
+
font-weight: var(--font-heading-1-weight);
|
|
70
|
+
line-height: var(--font-heading-1-line-height);
|
|
71
|
+
letter-spacing: var(--font-heading-1-letter-spacing);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ds-prose h2 {
|
|
75
|
+
font-family: var(--font-heading-2-family);
|
|
76
|
+
font-size: var(--font-heading-2-size);
|
|
77
|
+
font-weight: var(--font-heading-2-weight);
|
|
78
|
+
line-height: var(--font-heading-2-line-height);
|
|
79
|
+
letter-spacing: var(--font-heading-2-letter-spacing);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ds-prose h3 {
|
|
83
|
+
font-family: var(--font-heading-3-family);
|
|
84
|
+
font-size: var(--font-heading-3-size);
|
|
85
|
+
font-weight: var(--font-heading-3-weight);
|
|
86
|
+
line-height: var(--font-heading-3-line-height);
|
|
87
|
+
letter-spacing: var(--font-heading-3-letter-spacing);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ds-prose h4 {
|
|
91
|
+
font-family: var(--font-title-body-family);
|
|
92
|
+
font-size: var(--font-title-body-size);
|
|
93
|
+
font-weight: var(--font-title-body-weight);
|
|
94
|
+
line-height: var(--font-title-body-line-height);
|
|
95
|
+
letter-spacing: var(--font-title-body-letter-spacing);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ============================================
|
|
99
|
+
LISTS
|
|
100
|
+
============================================ */
|
|
101
|
+
|
|
102
|
+
.ds-prose ul,
|
|
103
|
+
.ds-prose ol {
|
|
104
|
+
padding-inline-start: var(--padding-md);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ds-prose li {
|
|
108
|
+
font-family: var(--font-paragraph-family);
|
|
109
|
+
font-size: var(--font-paragraph-size);
|
|
110
|
+
font-weight: var(--font-paragraph-weight);
|
|
111
|
+
line-height: var(--font-paragraph-line-height);
|
|
112
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
113
|
+
color: var(--color-text-primary);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ds-prose li + li {
|
|
117
|
+
margin-block-start: var(--gap-xs);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Nested lists sit tight under their parent item */
|
|
121
|
+
.ds-prose li > ul,
|
|
122
|
+
.ds-prose li > ol {
|
|
123
|
+
margin-block-start: var(--gap-xs);
|
|
124
|
+
margin-block-end: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* ============================================
|
|
128
|
+
INLINE ELEMENTS
|
|
129
|
+
============================================ */
|
|
130
|
+
|
|
131
|
+
.ds-prose a {
|
|
132
|
+
color: var(--color-action-primary-text-tertiary);
|
|
133
|
+
text-decoration: underline;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.ds-prose strong {
|
|
137
|
+
font-weight: var(--font-paragraph-em-weight);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ds-prose em {
|
|
141
|
+
font-style: italic;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ds-prose code {
|
|
145
|
+
font-family: var(--font-family-code);
|
|
146
|
+
font-size: var(--font-paragraph-sm-size);
|
|
147
|
+
background-color: var(--color-bg-container-secondary);
|
|
148
|
+
border-radius: var(--radius-xxs);
|
|
149
|
+
padding-inline: var(--padding-xxxs);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* ============================================
|
|
153
|
+
CODE BLOCKS
|
|
154
|
+
The plain fallback — CodeBlock is the richer
|
|
155
|
+
choice for standalone code
|
|
156
|
+
============================================ */
|
|
157
|
+
|
|
158
|
+
.ds-prose pre {
|
|
159
|
+
font-family: var(--font-family-code);
|
|
160
|
+
font-size: var(--font-paragraph-sm-size);
|
|
161
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
162
|
+
background-color: var(--color-bg-container-primary);
|
|
163
|
+
border: var(--border-xs) solid var(--color-bg-container-border);
|
|
164
|
+
border-radius: var(--radius-md);
|
|
165
|
+
padding: var(--padding-md);
|
|
166
|
+
overflow-x: auto;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.ds-prose pre code {
|
|
170
|
+
background-color: transparent;
|
|
171
|
+
border-radius: 0;
|
|
172
|
+
padding-inline: 0;
|
|
173
|
+
font-size: inherit;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* ============================================
|
|
177
|
+
BLOCKQUOTES
|
|
178
|
+
Mirrors Reasoning's trace rail
|
|
179
|
+
============================================ */
|
|
180
|
+
|
|
181
|
+
.ds-prose blockquote {
|
|
182
|
+
border-inline-start: var(--border-md) solid var(--color-divider);
|
|
183
|
+
padding-inline-start: var(--padding-md);
|
|
184
|
+
color: var(--color-text-secondary);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.ds-prose blockquote p {
|
|
188
|
+
color: var(--color-text-secondary);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* ============================================
|
|
192
|
+
TABLES
|
|
193
|
+
============================================ */
|
|
194
|
+
|
|
195
|
+
.ds-prose table {
|
|
196
|
+
width: 100%;
|
|
197
|
+
border-collapse: collapse;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.ds-prose th {
|
|
201
|
+
font-family: var(--font-title-body-family);
|
|
202
|
+
font-size: var(--font-paragraph-sm-size);
|
|
203
|
+
font-weight: var(--font-title-body-weight);
|
|
204
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
205
|
+
letter-spacing: var(--font-title-body-letter-spacing);
|
|
206
|
+
background-color: var(--color-bg-container-secondary);
|
|
207
|
+
text-align: start;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.ds-prose th,
|
|
211
|
+
.ds-prose td {
|
|
212
|
+
padding: var(--padding-xs) var(--padding-sm-md);
|
|
213
|
+
border-block-end: var(--border-xs) solid var(--color-divider);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* ============================================
|
|
217
|
+
RULES AND MEDIA
|
|
218
|
+
============================================ */
|
|
219
|
+
|
|
220
|
+
.ds-prose hr {
|
|
221
|
+
border: none;
|
|
222
|
+
border-block-start: var(--border-xs) solid var(--color-divider);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.ds-prose img {
|
|
226
|
+
max-width: 100%;
|
|
227
|
+
border-radius: var(--radius-md);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* ============================================
|
|
231
|
+
SMALL SIZE
|
|
232
|
+
Dense chat contexts — body scale drops to the
|
|
233
|
+
small paragraph tokens; headings keep their tiers
|
|
234
|
+
============================================ */
|
|
235
|
+
|
|
236
|
+
.ds-prose--sm,
|
|
237
|
+
.ds-prose--sm p,
|
|
238
|
+
.ds-prose--sm li {
|
|
239
|
+
font-family: var(--font-paragraph-sm-family);
|
|
240
|
+
font-size: var(--font-paragraph-sm-size);
|
|
241
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
242
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
243
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.ds-prose--sm strong {
|
|
247
|
+
font-weight: var(--font-paragraph-sm-em-weight);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.ds-prose--sm code {
|
|
251
|
+
font-size: var(--font-paragraph-sm-size);
|
|
252
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Props owned by Prose itself — everything else falls through to the root element. */
|
|
3
|
+
type ProseOwnProps = {
|
|
4
|
+
/** Body scale. `sm` maps paragraphs, lists and code to the small paragraph tokens for dense chat contexts. */
|
|
5
|
+
size?: 'default' | 'sm';
|
|
6
|
+
/** Additional CSS classes */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** The rendered markup to style — the output of whatever markdown renderer the consumer uses. */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export interface ProseProps extends ProseOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof ProseOwnProps> {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Prose is the typography kit for rendered markdown and rich agent output.
|
|
15
|
+
* The package ships no markdown renderer: consumers render markdown with
|
|
16
|
+
* whatever library they already use and wrap the result in Prose, which
|
|
17
|
+
* styles the descendant elements — headings, paragraphs, lists, links,
|
|
18
|
+
* code, quotes, tables — with the token scale.
|
|
19
|
+
*/
|
|
20
|
+
export declare const Prose: React.ForwardRefExoticComponent<ProseProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./Prose.css";
|
|
4
|
+
const Prose = React.forwardRef(
|
|
5
|
+
({ size = "default", className = "", children, ...rest }, ref) => {
|
|
6
|
+
const baseClass = "ds-prose";
|
|
7
|
+
const classes = [baseClass, size === "sm" ? `${baseClass}--sm` : "", className].filter(Boolean).join(" ");
|
|
8
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: classes, children });
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
Prose.displayName = "Prose";
|
|
12
|
+
export {
|
|
13
|
+
Prose
|
|
14
|
+
};
|