oneslash-design-system 2.28.1 → 2.29.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 +1 -1
- package/dist/DESIGN.md +31 -1
- package/dist/cases/about-page.md +2 -0
- package/dist/cases/accept-invite.md +2 -0
- package/dist/cases/account-menu.md +2 -0
- package/dist/cases/activity-timeline.md +2 -0
- package/dist/cases/admin-inbox.md +2 -0
- package/dist/cases/agent-asks-before-risky-action.md +3 -1
- package/dist/cases/agent-cancels-when-unanswered.md +2 -0
- package/dist/cases/agent-changes-review/all-at-once.d.ts +1 -0
- package/dist/cases/agent-changes-review/all-at-once.jsx +238 -0
- package/dist/cases/agent-changes-review/per-change.d.ts +1 -0
- package/dist/cases/agent-changes-review/per-change.jsx +203 -0
- package/dist/cases/agent-changes-review.md +585 -0
- package/dist/cases/agent-handoff/to-agent.d.ts +1 -0
- package/dist/cases/agent-handoff/to-agent.jsx +53 -0
- package/dist/cases/agent-handoff/to-person.d.ts +1 -0
- package/dist/cases/agent-handoff/to-person.jsx +84 -0
- package/dist/cases/agent-handoff.md +231 -0
- package/dist/cases/agent-memory/list.d.ts +1 -0
- package/dist/cases/agent-memory/list.jsx +256 -0
- package/dist/cases/agent-memory.md +354 -0
- package/dist/cases/agent-options.md +2 -0
- package/dist/cases/agent-pending-reply/steps.jsx +70 -21
- package/dist/cases/agent-pending-reply.md +74 -27
- package/dist/cases/agent-permissions/levels.d.ts +3 -0
- package/dist/cases/agent-permissions/levels.jsx +49 -0
- package/dist/cases/agent-permissions/per-tool.d.ts +3 -0
- package/dist/cases/agent-permissions/per-tool.jsx +178 -0
- package/dist/cases/agent-permissions.md +314 -0
- package/dist/cases/agent-plan-proposal/changes.jsx +18 -11
- package/dist/cases/agent-plan-proposal/steps.jsx +11 -4
- package/dist/cases/agent-plan-proposal.md +36 -21
- package/dist/cases/agent-question.md +2 -0
- package/dist/cases/agent-refuses-clearly.md +2 -0
- package/dist/cases/agent-run-failure/limit-reached.d.ts +1 -0
- package/dist/cases/agent-run-failure/limit-reached.jsx +172 -0
- package/dist/cases/agent-run-failure/step-failed.d.ts +3 -0
- package/dist/cases/agent-run-failure/step-failed.jsx +187 -0
- package/dist/cases/agent-run-failure.md +500 -0
- package/dist/cases/agent-says-what-it-is.md +2 -0
- package/dist/cases/agent-says-where-it-stopped.md +27 -0
- package/dist/cases/agent-settings.md +2 -0
- package/dist/cases/agent-shows-progress.md +2 -0
- package/dist/cases/agent-shows-sources.md +2 -0
- package/dist/cases/api-keys.md +2 -0
- package/dist/cases/app-shell.md +2 -0
- package/dist/cases/artifact-card.md +2 -0
- package/dist/cases/ask-page.md +2 -0
- package/dist/cases/auth-gate-loading.md +2 -0
- package/dist/cases/billing-page.md +2 -0
- package/dist/cases/blog-index.md +2 -0
- package/dist/cases/breadcrumb.md +2 -0
- package/dist/cases/breakdown-list.md +2 -0
- package/dist/cases/bulk-actions/list.d.ts +1 -0
- package/dist/cases/bulk-actions/list.jsx +209 -0
- package/dist/cases/bulk-actions/paged-table.d.ts +1 -0
- package/dist/cases/bulk-actions/paged-table.jsx +246 -0
- package/dist/cases/bulk-actions.md +559 -0
- package/dist/cases/changelog.md +2 -0
- package/dist/cases/chart.md +2 -0
- package/dist/cases/check-your-email.md +2 -0
- package/dist/cases/code-sample.md +2 -0
- package/dist/cases/collapsible-search.md +2 -0
- package/dist/cases/comment-thread.md +2 -0
- package/dist/cases/comparison-page/table.d.ts +1 -0
- package/dist/cases/comparison-page/table.jsx +97 -0
- package/dist/cases/comparison-page.md +156 -0
- package/dist/cases/composer-limit.md +2 -0
- package/dist/cases/confirm-destructive-action.md +2 -0
- package/dist/cases/confirm-dialogs.md +2 -0
- package/dist/cases/connection-status/card.d.ts +1 -0
- package/dist/cases/connection-status/card.jsx +97 -0
- package/dist/cases/connection-status/row.d.ts +1 -0
- package/dist/cases/connection-status/row.jsx +120 -0
- package/dist/cases/connection-status.md +330 -0
- package/dist/cases/contact-page.md +2 -0
- package/dist/cases/conversation-starters.md +2 -0
- package/dist/cases/cookie-choice.md +2 -0
- package/dist/cases/create-modal.md +2 -0
- package/dist/cases/danger-zone.md +2 -0
- package/dist/cases/dashboard.md +2 -0
- package/dist/cases/data-table-page.md +2 -0
- package/dist/cases/date-field.md +2 -0
- package/dist/cases/device-login.md +2 -0
- package/dist/cases/docs-component-page.md +2 -0
- package/dist/cases/email-confirmed.md +2 -0
- package/dist/cases/empty-list.md +2 -0
- package/dist/cases/empty-lists.md +2 -0
- package/dist/cases/empty-not-set-up.md +2 -0
- package/dist/cases/empty-search.md +2 -0
- package/dist/cases/error-page.md +2 -0
- package/dist/cases/faq.md +2 -0
- package/dist/cases/feature-grid.md +2 -0
- package/dist/cases/feedback-form.md +2 -0
- package/dist/cases/file-upload.md +2 -0
- package/dist/cases/filter-menu.md +2 -0
- package/dist/cases/forgot-password.md +2 -0
- package/dist/cases/form-errors.md +2 -0
- package/dist/cases/image-viewer.md +2 -0
- package/dist/cases/import-checklist.md +2 -0
- package/dist/cases/inline-form-feedback.md +2 -0
- package/dist/cases/integrations-list/nested.jsx +1 -1
- package/dist/cases/integrations-list/rows.jsx +1 -1
- package/dist/cases/integrations-list.md +6 -4
- package/dist/cases/invite-member.md +2 -0
- package/dist/cases/invoice-list.md +2 -0
- package/dist/cases/landing-hero.md +2 -0
- package/dist/cases/leaderboard.md +2 -0
- package/dist/cases/legal-page.md +2 -0
- package/dist/cases/load-failure.md +2 -0
- package/dist/cases/log-out-confirm.md +2 -0
- package/dist/cases/login-page.md +2 -0
- package/dist/cases/long-form-page.md +2 -0
- package/dist/cases/master-detail.md +2 -0
- package/dist/cases/members-list.md +2 -0
- package/dist/cases/mention-list.md +2 -0
- package/dist/cases/message-actions.md +2 -0
- package/dist/cases/message-attachments.md +2 -0
- package/dist/cases/message-composer/with-tools.jsx +17 -7
- package/dist/cases/message-composer.md +28 -11
- package/dist/cases/message-edit.md +2 -0
- package/dist/cases/message-reactions.md +2 -0
- package/dist/cases/message-row.md +2 -0
- package/dist/cases/message-send-failure/needs-a-person.d.ts +1 -0
- package/dist/cases/message-send-failure/needs-a-person.jsx +116 -0
- package/dist/cases/message-send-failure/retrying.d.ts +1 -0
- package/dist/cases/message-send-failure/retrying.jsx +116 -0
- package/dist/cases/message-send-failure.md +308 -0
- package/dist/cases/mobile-menu.md +2 -0
- package/dist/cases/newsletter-signup.md +2 -0
- package/dist/cases/no-access/page.d.ts +1 -0
- package/dist/cases/no-access/page.jsx +37 -0
- package/dist/cases/no-access/read-only.d.ts +1 -0
- package/dist/cases/no-access/read-only.jsx +33 -0
- package/dist/cases/no-access.md +147 -0
- package/dist/cases/not-found-page.md +2 -0
- package/dist/cases/notification-menu.md +2 -0
- package/dist/cases/number-format.md +2 -0
- package/dist/cases/oauth-consent.md +2 -0
- package/dist/cases/on-off-settings.md +2 -0
- package/dist/cases/on-this-page.md +2 -0
- package/dist/cases/onboarding.md +2 -0
- package/dist/cases/one-main-action.md +2 -0
- package/dist/cases/overflow-menu.md +2 -0
- package/dist/cases/page-end.md +2 -0
- package/dist/cases/page-header.md +2 -0
- package/dist/cases/paged-card.md +2 -0
- package/dist/cases/password-gate.md +2 -0
- package/dist/cases/payment-method.md +2 -0
- package/dist/cases/people-row.md +2 -0
- package/dist/cases/phone-navigation.md +2 -0
- package/dist/cases/plan-change-confirm.md +2 -0
- package/dist/cases/plan-comparison.md +3 -1
- package/dist/cases/plan-picker.md +4 -1
- package/dist/cases/plan-sign-off.md +2 -0
- package/dist/cases/pricing-section.md +5 -1
- package/dist/cases/product-cards.md +2 -0
- package/dist/cases/product-demo/scripted.d.ts +3 -0
- package/dist/cases/product-demo/scripted.jsx +95 -0
- package/dist/cases/product-demo/still.d.ts +1 -0
- package/dist/cases/product-demo/still.jsx +20 -0
- package/dist/cases/product-demo.md +221 -0
- package/dist/cases/profile-form.md +2 -0
- package/dist/cases/quick-switcher.md +2 -0
- package/dist/cases/range-switch.md +2 -0
- package/dist/cases/rename.md +2 -0
- package/dist/cases/reply-feedback.md +2 -0
- package/dist/cases/reply-sources.md +2 -0
- package/dist/cases/route-loading.md +2 -0
- package/dist/cases/scope-picker.md +2 -0
- package/dist/cases/section-index.md +2 -0
- package/dist/cases/session-expired/in-place.d.ts +1 -0
- package/dist/cases/session-expired/in-place.jsx +63 -0
- package/dist/cases/session-expired/redirect.d.ts +1 -0
- package/dist/cases/session-expired/redirect.jsx +62 -0
- package/dist/cases/session-expired.md +204 -0
- package/dist/cases/set-new-password.md +2 -0
- package/dist/cases/settings-page.md +2 -0
- package/dist/cases/settings-save.md +2 -0
- package/dist/cases/side-pane.md +2 -0
- package/dist/cases/sidebar-nav.md +2 -0
- package/dist/cases/sign-up-page.md +3 -0
- package/dist/cases/signup-from-site/plain.d.ts +1 -0
- package/dist/cases/signup-from-site/plain.jsx +125 -0
- package/dist/cases/signup-from-site/with-plan.d.ts +4 -0
- package/dist/cases/signup-from-site/with-plan.jsx +151 -0
- package/dist/cases/signup-from-site.md +351 -0
- package/dist/cases/site-footer.md +2 -0
- package/dist/cases/site-header/links.d.ts +3 -1
- package/dist/cases/site-header/links.jsx +6 -2
- package/dist/cases/site-header.md +11 -3
- package/dist/cases/site-matches-app.md +32 -0
- package/dist/cases/site-search.md +2 -0
- package/dist/cases/slash-command-list.md +2 -0
- package/dist/cases/stat-row.md +2 -0
- package/dist/cases/status-label.md +3 -1
- package/dist/cases/success-feedback.md +2 -0
- package/dist/cases/tabbed-panels.md +2 -0
- package/dist/cases/tag-filter.md +2 -0
- package/dist/cases/task-header.md +2 -0
- package/dist/cases/theme-switcher.md +2 -0
- package/dist/cases/type-to-confirm.md +2 -0
- package/dist/cases/typing-and-status.md +2 -0
- package/dist/cases/unsaved-changes-guard.md +2 -0
- package/dist/cases/upgrade-prompt.md +2 -0
- package/dist/cases/usage-meters.md +2 -0
- package/dist/cases.json +1489 -39
- package/dist/components/checkBox.d.ts +5 -1
- package/dist/components/checkBox.jsx +23 -9
- package/dist/components/diff.d.ts +29 -0
- package/dist/components/diff.jsx +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/diff.d.ts +17 -0
- package/dist/internal/diff.js +44 -0
- package/dist/native-mapping.json +9 -2
- package/dist/stories/AgentPermissions.probe.stories.d.ts +7 -0
- package/dist/stories/AgentPermissions.probe.stories.jsx +18 -0
- package/dist/stories/AgentRunFailure.probe.stories.d.ts +6 -0
- package/dist/stories/AgentRunFailure.probe.stories.jsx +12 -0
- package/dist/stories/Cases.generated.stories.d.ts +24 -0
- package/dist/stories/Cases.generated.stories.jsx +48 -0
- package/dist/stories/Checkbox.stories.d.ts +2 -0
- package/dist/stories/Checkbox.stories.jsx +18 -0
- package/dist/stories/Diff.stories.d.ts +9 -0
- package/dist/stories/Diff.stories.jsx +40 -0
- package/dist/stories/ProductDemo.probe.stories.d.ts +6 -0
- package/dist/stories/ProductDemo.probe.stories.jsx +12 -0
- package/dist/stories/SignupFromSite.probe.stories.d.ts +7 -0
- package/dist/stories/SignupFromSite.probe.stories.jsx +17 -0
- package/dist/stories/SiteHeader.probe.stories.d.ts +6 -0
- package/dist/stories/SiteHeader.probe.stories.jsx +13 -0
- package/package.json +1 -1
package/dist/cases/paged-card.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Some work is private. A visitor needs the password to read it, and someone who does not have it needs to know how to ask.
|
|
4
4
|
|
|
5
|
+
For: a marketing site
|
|
6
|
+
|
|
5
7
|
## Do
|
|
6
8
|
|
|
7
9
|
- Put the gate in a `Surface` with a heading that says what is behind it: 'This case study needs a password'. It is the h1 on a whole page and an h2 inside a page.
|
package/dist/cases/people-row.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A layout with a sidebar, a list beside its detail, or a side pane meets a phone screen.
|
|
4
4
|
|
|
5
|
+
For: a marketing site, an app
|
|
6
|
+
|
|
5
7
|
## Answer
|
|
6
8
|
|
|
7
9
|
An app's sidebar opens in a `Drawer` from the start side, from a 'Menu' `IconButton` at the start of a top bar that names the place. `AppShell` does this. The Drawer closes on a choice, on Close, on Escape, on the scrim and when the window widens. A list beside its detail becomes two screens: the list, then the detail with a Back Button named for the list, as `SettingsLayout` does. A settings nav is such a list. A side pane takes the whole content area and has Close. It is never squeezed beside the content. A site's links go into the same kind of menu, and one main action may stay in the bar. Nothing is hidden on a phone without a way to reach it. There is no bottom tab bar on the web.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A visitor to the public site wants to see every limit of every plan side by side before signing up.
|
|
4
4
|
|
|
5
|
+
For: a marketing site
|
|
6
|
+
|
|
5
7
|
## Do
|
|
6
8
|
|
|
7
9
|
- Follow the rule 'A number shows its unit and never shows 0 for unknown'.
|
|
@@ -19,7 +21,7 @@ A visitor to the public site wants to see every limit of every plan side by side
|
|
|
19
21
|
- Do not build the table from a grid of boxes. A screen reader cannot read it as a table.
|
|
20
22
|
- Do not hide the header row on a phone. Let the table scroll sideways in its region.
|
|
21
23
|
- Do not put a Button in every column.
|
|
22
|
-
- Do not change a price or a limit here without changing it in the cases 'Plan picker'
|
|
24
|
+
- Do not change a price or a limit here without changing it in the cases 'Plan picker', 'Pricing section', 'Comparison with another product' and 'Sign-up from the site' too.
|
|
23
25
|
- Do not dim the other columns with tabs. Every plan stays in view.
|
|
24
26
|
|
|
25
27
|
## Example: Table under the plan cards
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
An admin compares the plans a workspace can be on and chooses one.
|
|
4
4
|
|
|
5
|
+
For: an app
|
|
6
|
+
|
|
5
7
|
## Do
|
|
6
8
|
|
|
7
9
|
- Follow the rule 'A number shows its unit and never shows 0 for unknown'.
|
|
@@ -12,6 +14,7 @@ An admin compares the plans a workspace can be on and chooses one.
|
|
|
12
14
|
- Say a change that starts later with a Tag 'Starts Dec 1' on the new plan, and a line under the heading: 'Acme is on Pro until Dec 1, 2026, then Free.'
|
|
13
15
|
- Open the picker from 'Change Plan' on the case 'Billing page'. Show it only to a person who can change the plan.
|
|
14
16
|
- Add a `SegmentedControl` as the case 'Range switch' says once the plans bill by the year too. Leave it out while every plan bills monthly.
|
|
17
|
+
- Use the same plan names, prices and limits on the site and in the app, as the rule 'A site promises only what the app does, in the app's words' says.
|
|
15
18
|
|
|
16
19
|
## Don't
|
|
17
20
|
|
|
@@ -21,7 +24,7 @@ An admin compares the plans a workspace can be on and chooses one.
|
|
|
21
24
|
- Do not add a monthly and yearly switch when no plan bills yearly.
|
|
22
25
|
- Do not change a Button label to show it is busy, such as to 'Checking...'.
|
|
23
26
|
- Do not charge or change the plan from this page. The confirm does that.
|
|
24
|
-
- Do not change a price or a limit here without changing it in the cases 'Pricing section'
|
|
27
|
+
- Do not change a price or a limit here without changing it in the cases 'Pricing section', 'Plan comparison', 'Comparison with another product' and 'Sign-up from the site' too.
|
|
25
28
|
|
|
26
29
|
## Option: Cards side by side
|
|
27
30
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A visitor to the public site compares the plans and signs up for one.
|
|
4
4
|
|
|
5
|
+
For: a marketing site
|
|
6
|
+
|
|
5
7
|
## Do
|
|
6
8
|
|
|
7
9
|
- Follow the rule 'A marketing page asks for one main action, in the same words everywhere'.
|
|
@@ -12,13 +14,15 @@ A visitor to the public site compares the plans and signs up for one.
|
|
|
12
14
|
- Put the section's name in `SectionIntro`, so the section has a level 2 heading and a link of its own.
|
|
13
15
|
- Put one line under the cards that says what the prices are in and who pays: 'Prices in USD. Pro and Business bill each member monthly.'
|
|
14
16
|
- Add a `SegmentedControl` for monthly and yearly as the case 'Range switch' says once a plan bills by the year. Leave it out while every plan bills monthly.
|
|
17
|
+
- Use the same plan names, prices and limits on the site and in the app, as the rule 'A site promises only what the app does, in the app's words' says.
|
|
18
|
+
- Send a paid plan's Button to sign-up with that plan, as the case 'Sign-up from the site' says.
|
|
15
19
|
|
|
16
20
|
## Don't
|
|
17
21
|
|
|
18
22
|
- Do not name a Button 'Get Started', 'Choose' or 'Select'. Name the plan it signs up for.
|
|
19
23
|
- Do not open the sign-up page in a new tab.
|
|
20
24
|
- Do not give two plans a primary Button.
|
|
21
|
-
- Do not change a price or a limit here without changing it in the cases 'Plan picker'
|
|
25
|
+
- Do not change a price or a limit here without changing it in the cases 'Plan picker', 'Plan comparison', 'Comparison with another product' and 'Sign-up from the site' too. A visitor sees one set of plans.
|
|
22
26
|
- Do not make a card clickable as a whole. Its Button is the one control.
|
|
23
27
|
|
|
24
28
|
## Example: Plan cards side by side
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A maker lists its products on one page, and each product has its own site.
|
|
4
4
|
|
|
5
|
+
For: a marketing site
|
|
6
|
+
|
|
5
7
|
## Do
|
|
6
8
|
|
|
7
9
|
- Follow the rule 'A marketing page asks for one main action, in the same words everywhere'. A list of products has no main action of its own: each card is a link, not a Button.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { BookOpen, Bot, MessageSquare } from 'lucide-react';
|
|
4
|
+
import PageShell from '../../components/pageShell';
|
|
5
|
+
import SectionIntro from '../../components/sectionIntro';
|
|
6
|
+
import Surface from '../../components/surface';
|
|
7
|
+
import Message from '../../components/message';
|
|
8
|
+
import UserImage from '../../components/userImage';
|
|
9
|
+
import Tag from '../../components/tag';
|
|
10
|
+
import TimeStamp from '../../components/timeStamp';
|
|
11
|
+
import Paragraph from '../../components/paragraph';
|
|
12
|
+
import Button from '../../components/button';
|
|
13
|
+
import SegmentedControl from '../../components/segmentedControl';
|
|
14
|
+
import StepList from '../../components/stepList';
|
|
15
|
+
import SourceCard from '../../components/sourceCard';
|
|
16
|
+
import { Cluster, Grid, PageSection, Stack } from '../../components/layout';
|
|
17
|
+
var agentName = 'Acme Agent';
|
|
18
|
+
// A made-up thread. Every label in it is one the app has: the agent's marks, its steps and its source cards.
|
|
19
|
+
var request = { from: 'Dana Lee', at: new Date('2026-11-16T14:30:00Z'), text: 'When does the new pricing page go live?' };
|
|
20
|
+
var repliedAt = new Date('2026-11-16T14:31:00Z');
|
|
21
|
+
var reply = 'The new pricing page goes live on Nov 20, 2026. Ben moved it two days to finish the plan table.';
|
|
22
|
+
var scenes = [
|
|
23
|
+
{ value: 'ask', label: 'Ask' },
|
|
24
|
+
{ value: 'work', label: 'Work' },
|
|
25
|
+
{ value: 'answer', label: 'Answer' },
|
|
26
|
+
];
|
|
27
|
+
// Long enough to read each scene.
|
|
28
|
+
var sceneTime = 6000;
|
|
29
|
+
// The agent's marks, as the rule 'An agent says what it is' says.
|
|
30
|
+
function agentMeta(at) {
|
|
31
|
+
return (<>
|
|
32
|
+
<Tag variant="contained" size="small" label="Agent"/>
|
|
33
|
+
<TimeStamp createdAt={at} dateFormat="absolute" data="time"/>
|
|
34
|
+
<Paragraph size="caption" tone="secondary" measure="none">Model name</Paragraph>
|
|
35
|
+
</>);
|
|
36
|
+
}
|
|
37
|
+
// `autoPlay` starts the scenes when the page opens. A real site passes it only when the visitor has not asked for
|
|
38
|
+
// reduced motion, from `matchMedia('(prefers-reduced-motion: reduce)')`. Left out, the demo waits for the visitor.
|
|
39
|
+
export default function ProductDemoScripted(_a) {
|
|
40
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.autoPlay, autoPlay = _c === void 0 ? false : _c;
|
|
41
|
+
var _d = useState(autoPlay ? 'ask' : 'answer'), scene = _d[0], setScene = _d[1];
|
|
42
|
+
var _e = useState(!autoPlay), paused = _e[0], setPaused = _e[1];
|
|
43
|
+
var timer = useRef();
|
|
44
|
+
// Moves to the next scene while the demo plays, and stops when it is paused or leaves the page.
|
|
45
|
+
useEffect(function () {
|
|
46
|
+
if (paused)
|
|
47
|
+
return undefined;
|
|
48
|
+
timer.current = setInterval(function () {
|
|
49
|
+
setScene(function (s) { return scenes[(scenes.findIndex(function (x) { return x.value === s; }) + 1) % scenes.length].value; });
|
|
50
|
+
}, sceneTime);
|
|
51
|
+
return function () { return clearInterval(timer.current); };
|
|
52
|
+
}, [paused]);
|
|
53
|
+
var at = scenes.findIndex(function (x) { return x.value === scene; });
|
|
54
|
+
return (<PageShell>
|
|
55
|
+
<PageSection gap="xxlarge">
|
|
56
|
+
<SectionIntro id="product-demo-scripted" name="Ask the agent in the thread" statement="Acme Agent reads the thread and the docs, then answers with its sources."/>
|
|
57
|
+
{/* No live region: a screen reader is not read each scene as it changes. */}
|
|
58
|
+
<Surface padding="medium">
|
|
59
|
+
<Stack gap="large">
|
|
60
|
+
{/* Play or Pause comes first, so a keyboard reaches it before anything moves. It is one Button whose label
|
|
61
|
+
says what pressing it does, so focus stays on it when the label changes. Picking a scene pauses too. */}
|
|
62
|
+
<Cluster justify="between">
|
|
63
|
+
<Cluster gap="xlarge">
|
|
64
|
+
<Button size="small" type="secondary" state="enabled" label={paused ? 'Play' : 'Pause'} onClickButton={function () { return setPaused(function (p) { return !p; }); }}/>
|
|
65
|
+
<SegmentedControl size="small" width="fit" aria-label="Scene" options={scenes} value={scene} onChange={function (value) {
|
|
66
|
+
setPaused(true);
|
|
67
|
+
setScene(value);
|
|
68
|
+
}}/>
|
|
69
|
+
</Cluster>
|
|
70
|
+
<Tag variant="textOnly" size="small" label="Example"/>
|
|
71
|
+
</Cluster>
|
|
72
|
+
<Stack gap="small">
|
|
73
|
+
<Message aria-label={request.from} avatar={<UserImage userHandle={request.from} decorative/>} name={request.from} meta={<TimeStamp createdAt={request.at} dateFormat="absolute" data="time"/>}>
|
|
74
|
+
<Paragraph measure="none">{request.text}</Paragraph>
|
|
75
|
+
</Message>
|
|
76
|
+
{at >= 1 && (<Message aria-label={"".concat(agentName, ", agent")} avatar={<UserImage userHandle={agentName} icon={Bot} decorative/>} name={agentName} meta={agentMeta(repliedAt)} footer={at === 2 ? (
|
|
77
|
+
// Plain cards: a demo on the site opens nothing.
|
|
78
|
+
<Grid columns={2} gap="medium">
|
|
79
|
+
<SourceCard icon={BookOpen} title="Launch plan" meta="Docs · Nov 14, 2026"/>
|
|
80
|
+
<SourceCard icon={MessageSquare} title="Pricing page date" meta="#launch · Nov 15, 2026"/>
|
|
81
|
+
</Grid>) : undefined}>
|
|
82
|
+
{at === 2 ? (<Paragraph measure="none">{reply}</Paragraph>) : (<Stack gap="medium">
|
|
83
|
+
<Paragraph size="caption" tone="secondary" measure="none">Working for 4 seconds</Paragraph>
|
|
84
|
+
<StepList aria-label="Acme Agent's steps" steps={[
|
|
85
|
+
{ label: 'Read the thread in #launch', status: 'done' },
|
|
86
|
+
{ label: 'Read the launch plan', status: 'running' },
|
|
87
|
+
]}/>
|
|
88
|
+
</Stack>)}
|
|
89
|
+
</Message>)}
|
|
90
|
+
</Stack>
|
|
91
|
+
</Stack>
|
|
92
|
+
</Surface>
|
|
93
|
+
</PageSection>
|
|
94
|
+
</PageShell>);
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ProductDemoStill(): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import PageShell from '../../components/pageShell';
|
|
3
|
+
import SectionIntro from '../../components/sectionIntro';
|
|
4
|
+
import Figure from '../../components/figure';
|
|
5
|
+
import Image from '../../components/image';
|
|
6
|
+
import { PageSection } from '../../components/layout';
|
|
7
|
+
// A stand-in for a screenshot of the app: a thread with a question, the agent's reply and two source cards.
|
|
8
|
+
// A real page passes a screenshot of the app as it is today, with made-up people and work in it.
|
|
9
|
+
var threadPicture = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 400'%3E%3Crect width='640' height='400' fill='%23eef2f6'/%3E%3Crect width='150' height='400' fill='%23dfe7ef'/%3E%3Crect x='20' y='28' width='80' height='12' rx='6' fill='%23aab8c6'/%3E%3Crect x='20' y='68' width='100' height='10' rx='5' fill='%23c2cfdb'/%3E%3Crect x='20' y='94' width='90' height='10' rx='5' fill='%23c2cfdb'/%3E%3Ccircle cx='190' cy='52' r='12' fill='%23aab8c6'/%3E%3Crect x='212' y='44' width='120' height='10' rx='5' fill='%23aab8c6'/%3E%3Crect x='212' y='64' width='300' height='10' rx='5' fill='%23c2cfdb'/%3E%3Ccircle cx='190' cy='132' r='12' fill='%232f6b4f'/%3E%3Crect x='212' y='124' width='100' height='10' rx='5' fill='%232f6b4f'/%3E%3Crect x='212' y='144' width='360' height='10' rx='5' fill='%23c2cfdb'/%3E%3Crect x='212' y='164' width='280' height='10' rx='5' fill='%23c2cfdb'/%3E%3Crect x='212' y='192' width='170' height='48' rx='10' fill='%23ffffff'/%3E%3Crect x='392' y='192' width='170' height='48' rx='10' fill='%23ffffff'/%3E%3Crect x='170' y='336' width='440' height='40' rx='10' fill='%23ffffff'/%3E%3C/svg%3E";
|
|
10
|
+
export default function ProductDemoStill() {
|
|
11
|
+
return (<PageShell>
|
|
12
|
+
<PageSection gap="xxlarge">
|
|
13
|
+
<SectionIntro id="product-demo-still" name="Ask the agent in the thread" statement="Acme Agent reads the thread and the docs, then answers with its sources."/>
|
|
14
|
+
{/* The caption says what the picture shows and that it is an example. The alt says it for a screen reader. */}
|
|
15
|
+
<Figure crop={16 / 10} caption="Example: Dana asks when the pricing page goes live, and Acme Agent answers with two sources. The names are made up.">
|
|
16
|
+
<Image src={threadPicture} alt="A thread in Acme. Dana Lee asks when the new pricing page goes live. Acme Agent answers Nov 20, 2026, and links the launch plan and a message in the launch channel." width={640} height={400}/>
|
|
17
|
+
</Figure>
|
|
18
|
+
</PageSection>
|
|
19
|
+
</PageShell>);
|
|
20
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Product demo on a site
|
|
2
|
+
|
|
3
|
+
A page on the public site shows the product at work, so a visitor sees what it does before they sign up.
|
|
4
|
+
|
|
5
|
+
For: a marketing site
|
|
6
|
+
|
|
7
|
+
## Do
|
|
8
|
+
|
|
9
|
+
- Follow the rule 'A site promises only what the app does, in the app's words': show only the controls, labels and features the app has.
|
|
10
|
+
- Mark the demo as an example. Put a `Tag` 'Example' on a scripted demo, and say it in the caption of a picture.
|
|
11
|
+
- Use made-up people and made-up work in the demo, never a real customer.
|
|
12
|
+
- Put a picture in a `Figure` with a caption that says what it shows. Give the `Image` an `alt` that says the same for a screen reader.
|
|
13
|
+
- Build a scripted demo from the real parts, such as `Message`, `StepList` and `SourceCard`, in a `Surface`. Then it looks like the app and changes with it.
|
|
14
|
+
- Put one Button first, before the scenes and apart from them. It reads 'Pause' while the demo plays and 'Play' while it does not. This label says what a press does next, as 'Show Danger Zone' does. It is not a status, so it may change.
|
|
15
|
+
- Keep it the same Button when its label changes, so focus stays on it.
|
|
16
|
+
- Let the visitor pick a scene with a `SegmentedControl`. Picking a scene pauses the demo.
|
|
17
|
+
- Start a scripted demo stopped, with 'Play', when the visitor asks for reduced motion. It plays only when they press 'Play'.
|
|
18
|
+
- Show each scene for at least 6 seconds, so a visitor can read it.
|
|
19
|
+
- Keep the demo out of live regions, so a screen reader is not read each scene as it changes.
|
|
20
|
+
- Stop the timers when the demo leaves the page.
|
|
21
|
+
|
|
22
|
+
## Don't
|
|
23
|
+
|
|
24
|
+
- Do not pause the demo on hover only. A keyboard or touch visitor cannot hover.
|
|
25
|
+
- Do not rotate words in the page's h1.
|
|
26
|
+
- Do not show a control, a label or a plan the app does not have.
|
|
27
|
+
- Do not add a message box or other field a visitor might try to type into.
|
|
28
|
+
|
|
29
|
+
## Option: One picture
|
|
30
|
+
|
|
31
|
+
Use when: One picture of the product says enough.
|
|
32
|
+
|
|
33
|
+
Uses: `Figure`, `Image`, `PageSection`, `PageShell`, `SectionIntro`
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
'use client';
|
|
37
|
+
import PageShell from 'oneslash-design-system/components/pageShell';
|
|
38
|
+
import SectionIntro from 'oneslash-design-system/components/sectionIntro';
|
|
39
|
+
import Figure from 'oneslash-design-system/components/figure';
|
|
40
|
+
import Image from 'oneslash-design-system/components/image';
|
|
41
|
+
import { PageSection } from 'oneslash-design-system/components/layout';
|
|
42
|
+
|
|
43
|
+
// A stand-in for a screenshot of the app: a thread with a question, the agent's reply and two source cards.
|
|
44
|
+
// A real page passes a screenshot of the app as it is today, with made-up people and work in it.
|
|
45
|
+
const threadPicture =
|
|
46
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 400'%3E%3Crect width='640' height='400' fill='%23eef2f6'/%3E%3Crect width='150' height='400' fill='%23dfe7ef'/%3E%3Crect x='20' y='28' width='80' height='12' rx='6' fill='%23aab8c6'/%3E%3Crect x='20' y='68' width='100' height='10' rx='5' fill='%23c2cfdb'/%3E%3Crect x='20' y='94' width='90' height='10' rx='5' fill='%23c2cfdb'/%3E%3Ccircle cx='190' cy='52' r='12' fill='%23aab8c6'/%3E%3Crect x='212' y='44' width='120' height='10' rx='5' fill='%23aab8c6'/%3E%3Crect x='212' y='64' width='300' height='10' rx='5' fill='%23c2cfdb'/%3E%3Ccircle cx='190' cy='132' r='12' fill='%232f6b4f'/%3E%3Crect x='212' y='124' width='100' height='10' rx='5' fill='%232f6b4f'/%3E%3Crect x='212' y='144' width='360' height='10' rx='5' fill='%23c2cfdb'/%3E%3Crect x='212' y='164' width='280' height='10' rx='5' fill='%23c2cfdb'/%3E%3Crect x='212' y='192' width='170' height='48' rx='10' fill='%23ffffff'/%3E%3Crect x='392' y='192' width='170' height='48' rx='10' fill='%23ffffff'/%3E%3Crect x='170' y='336' width='440' height='40' rx='10' fill='%23ffffff'/%3E%3C/svg%3E";
|
|
47
|
+
|
|
48
|
+
export default function ProductDemoStill() {
|
|
49
|
+
return (
|
|
50
|
+
<PageShell>
|
|
51
|
+
<PageSection gap="xxlarge">
|
|
52
|
+
<SectionIntro id="product-demo-still" name="Ask the agent in the thread" statement="Acme Agent reads the thread and the docs, then answers with its sources." />
|
|
53
|
+
{/* The caption says what the picture shows and that it is an example. The alt says it for a screen reader. */}
|
|
54
|
+
<Figure crop={16 / 10} caption="Example: Dana asks when the pricing page goes live, and Acme Agent answers with two sources. The names are made up.">
|
|
55
|
+
<Image
|
|
56
|
+
src={threadPicture}
|
|
57
|
+
alt="A thread in Acme. Dana Lee asks when the new pricing page goes live. Acme Agent answers Nov 20, 2026, and links the launch plan and a message in the launch channel."
|
|
58
|
+
width={640}
|
|
59
|
+
height={400}
|
|
60
|
+
/>
|
|
61
|
+
</Figure>
|
|
62
|
+
</PageSection>
|
|
63
|
+
</PageShell>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Option: Scripted scenes
|
|
69
|
+
|
|
70
|
+
Use when: The product is about a flow, such as asking an agent and getting an answer.
|
|
71
|
+
|
|
72
|
+
Uses: `Button`, `Cluster`, `Grid`, `Message`, `PageSection`, `PageShell`, `Paragraph`, `SectionIntro`, `SegmentedControl`, `SourceCard`, `Stack`, `StepList`, `Surface`, `Tag`, `TimeStamp`, `UserImage`
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
'use client';
|
|
76
|
+
import { useEffect, useRef, useState } from 'react';
|
|
77
|
+
import { BookOpen, Bot, MessageSquare } from 'lucide-react';
|
|
78
|
+
import PageShell from 'oneslash-design-system/components/pageShell';
|
|
79
|
+
import SectionIntro from 'oneslash-design-system/components/sectionIntro';
|
|
80
|
+
import Surface from 'oneslash-design-system/components/surface';
|
|
81
|
+
import Message from 'oneslash-design-system/components/message';
|
|
82
|
+
import UserImage from 'oneslash-design-system/components/userImage';
|
|
83
|
+
import Tag from 'oneslash-design-system/components/tag';
|
|
84
|
+
import TimeStamp from 'oneslash-design-system/components/timeStamp';
|
|
85
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
86
|
+
import Button from 'oneslash-design-system/components/button';
|
|
87
|
+
import SegmentedControl from 'oneslash-design-system/components/segmentedControl';
|
|
88
|
+
import StepList from 'oneslash-design-system/components/stepList';
|
|
89
|
+
import SourceCard from 'oneslash-design-system/components/sourceCard';
|
|
90
|
+
import { Cluster, Grid, PageSection, Stack } from 'oneslash-design-system/components/layout';
|
|
91
|
+
|
|
92
|
+
const agentName = 'Acme Agent';
|
|
93
|
+
|
|
94
|
+
// A made-up thread. Every label in it is one the app has: the agent's marks, its steps and its source cards.
|
|
95
|
+
const request = { from: 'Dana Lee', at: new Date('2026-11-16T14:30:00Z'), text: 'When does the new pricing page go live?' };
|
|
96
|
+
const repliedAt = new Date('2026-11-16T14:31:00Z');
|
|
97
|
+
const reply = 'The new pricing page goes live on Nov 20, 2026. Ben moved it two days to finish the plan table.';
|
|
98
|
+
|
|
99
|
+
const scenes = [
|
|
100
|
+
{ value: 'ask', label: 'Ask' },
|
|
101
|
+
{ value: 'work', label: 'Work' },
|
|
102
|
+
{ value: 'answer', label: 'Answer' },
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
// Long enough to read each scene.
|
|
106
|
+
const sceneTime = 6000;
|
|
107
|
+
|
|
108
|
+
// The agent's marks, as the rule 'An agent says what it is' says.
|
|
109
|
+
function agentMeta(at: Date) {
|
|
110
|
+
return (
|
|
111
|
+
<>
|
|
112
|
+
<Tag variant="contained" size="small" label="Agent" />
|
|
113
|
+
<TimeStamp createdAt={at} dateFormat="absolute" data="time" />
|
|
114
|
+
<Paragraph size="caption" tone="secondary" measure="none">Model name</Paragraph>
|
|
115
|
+
</>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// `autoPlay` starts the scenes when the page opens. A real site passes it only when the visitor has not asked for
|
|
120
|
+
// reduced motion, from `matchMedia('(prefers-reduced-motion: reduce)')`. Left out, the demo waits for the visitor.
|
|
121
|
+
export default function ProductDemoScripted({ autoPlay = false }: { autoPlay?: boolean } = {}) {
|
|
122
|
+
const [scene, setScene] = useState(autoPlay ? 'ask' : 'answer');
|
|
123
|
+
const [paused, setPaused] = useState(!autoPlay);
|
|
124
|
+
const timer = useRef<ReturnType<typeof setInterval>>();
|
|
125
|
+
|
|
126
|
+
// Moves to the next scene while the demo plays, and stops when it is paused or leaves the page.
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (paused) return undefined;
|
|
129
|
+
timer.current = setInterval(() => {
|
|
130
|
+
setScene((s) => scenes[(scenes.findIndex((x) => x.value === s) + 1) % scenes.length].value);
|
|
131
|
+
}, sceneTime);
|
|
132
|
+
return () => clearInterval(timer.current);
|
|
133
|
+
}, [paused]);
|
|
134
|
+
|
|
135
|
+
const at = scenes.findIndex((x) => x.value === scene);
|
|
136
|
+
|
|
137
|
+
return (
|
|
138
|
+
<PageShell>
|
|
139
|
+
<PageSection gap="xxlarge">
|
|
140
|
+
<SectionIntro id="product-demo-scripted" name="Ask the agent in the thread" statement="Acme Agent reads the thread and the docs, then answers with its sources." />
|
|
141
|
+
{/* No live region: a screen reader is not read each scene as it changes. */}
|
|
142
|
+
<Surface padding="medium">
|
|
143
|
+
<Stack gap="large">
|
|
144
|
+
{/* Play or Pause comes first, so a keyboard reaches it before anything moves. It is one Button whose label
|
|
145
|
+
says what pressing it does, so focus stays on it when the label changes. Picking a scene pauses too. */}
|
|
146
|
+
<Cluster justify="between">
|
|
147
|
+
<Cluster gap="xlarge">
|
|
148
|
+
<Button
|
|
149
|
+
size="small"
|
|
150
|
+
type="secondary"
|
|
151
|
+
state="enabled"
|
|
152
|
+
label={paused ? 'Play' : 'Pause'}
|
|
153
|
+
onClickButton={() => setPaused((p) => !p)}
|
|
154
|
+
/>
|
|
155
|
+
<SegmentedControl
|
|
156
|
+
size="small"
|
|
157
|
+
width="fit"
|
|
158
|
+
aria-label="Scene"
|
|
159
|
+
options={scenes}
|
|
160
|
+
value={scene}
|
|
161
|
+
onChange={(value) => {
|
|
162
|
+
setPaused(true);
|
|
163
|
+
setScene(value);
|
|
164
|
+
}}
|
|
165
|
+
/>
|
|
166
|
+
</Cluster>
|
|
167
|
+
<Tag variant="textOnly" size="small" label="Example" />
|
|
168
|
+
</Cluster>
|
|
169
|
+
<Stack gap="small">
|
|
170
|
+
<Message
|
|
171
|
+
aria-label={request.from}
|
|
172
|
+
avatar={<UserImage userHandle={request.from} decorative />}
|
|
173
|
+
name={request.from}
|
|
174
|
+
meta={<TimeStamp createdAt={request.at} dateFormat="absolute" data="time" />}
|
|
175
|
+
>
|
|
176
|
+
<Paragraph measure="none">{request.text}</Paragraph>
|
|
177
|
+
</Message>
|
|
178
|
+
{at >= 1 && (
|
|
179
|
+
<Message
|
|
180
|
+
aria-label={`${agentName}, agent`}
|
|
181
|
+
avatar={<UserImage userHandle={agentName} icon={Bot} decorative />}
|
|
182
|
+
name={agentName}
|
|
183
|
+
meta={agentMeta(repliedAt)}
|
|
184
|
+
footer={
|
|
185
|
+
at === 2 ? (
|
|
186
|
+
// Plain cards: a demo on the site opens nothing.
|
|
187
|
+
<Grid columns={2} gap="medium">
|
|
188
|
+
<SourceCard icon={BookOpen} title="Launch plan" meta="Docs · Nov 14, 2026" />
|
|
189
|
+
<SourceCard icon={MessageSquare} title="Pricing page date" meta="#launch · Nov 15, 2026" />
|
|
190
|
+
</Grid>
|
|
191
|
+
) : undefined
|
|
192
|
+
}
|
|
193
|
+
>
|
|
194
|
+
{at === 2 ? (
|
|
195
|
+
<Paragraph measure="none">{reply}</Paragraph>
|
|
196
|
+
) : (
|
|
197
|
+
<Stack gap="medium">
|
|
198
|
+
<Paragraph size="caption" tone="secondary" measure="none">Working for 4 seconds</Paragraph>
|
|
199
|
+
<StepList
|
|
200
|
+
aria-label="Acme Agent's steps"
|
|
201
|
+
steps={[
|
|
202
|
+
{ label: 'Read the thread in #launch', status: 'done' },
|
|
203
|
+
{ label: 'Read the launch plan', status: 'running' },
|
|
204
|
+
]}
|
|
205
|
+
/>
|
|
206
|
+
</Stack>
|
|
207
|
+
)}
|
|
208
|
+
</Message>
|
|
209
|
+
)}
|
|
210
|
+
</Stack>
|
|
211
|
+
</Stack>
|
|
212
|
+
</Surface>
|
|
213
|
+
</PageSection>
|
|
214
|
+
</PageShell>
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Native
|
|
220
|
+
|
|
221
|
+
On Apple and Android an app has no product demo. The store page shows screenshots and an app preview video, with only what the app has.
|
package/dist/cases/rename.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A section of a site, such as the guides, has its own first page that shows the places inside it, so a person can pick one.
|
|
4
4
|
|
|
5
|
+
For: a marketing site
|
|
6
|
+
|
|
5
7
|
## Do
|
|
6
8
|
|
|
7
9
|
- Use `PageHeader` with `level={1}`: the section's name is the one level 1 heading, with a `lede` of one sentence.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function SessionExpiredInPlace(): import("react").JSX.Element;
|