oneslash-design-system 2.20.0 → 2.21.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 +34 -1
- package/dist/cases/about-page/profile.d.ts +1 -0
- package/dist/cases/about-page/profile.jsx +64 -0
- package/dist/cases/about-page.md +114 -0
- package/dist/cases/admin-inbox/list.d.ts +1 -0
- package/dist/cases/admin-inbox/list.jsx +104 -0
- package/dist/cases/admin-inbox/split.d.ts +1 -0
- package/dist/cases/admin-inbox/split.jsx +68 -0
- package/dist/cases/admin-inbox.md +254 -0
- package/dist/cases/api-keys.md +1 -1
- package/dist/cases/blog-index/cards.d.ts +1 -0
- package/dist/cases/blog-index/cards.jsx +45 -0
- package/dist/cases/blog-index/list.d.ts +1 -0
- package/dist/cases/blog-index/list.jsx +46 -0
- package/dist/cases/blog-index.md +160 -0
- package/dist/cases/changelog/by-month.d.ts +1 -0
- package/dist/cases/changelog/by-month.jsx +70 -0
- package/dist/cases/changelog/one-page.d.ts +1 -0
- package/dist/cases/changelog/one-page.jsx +70 -0
- package/dist/cases/changelog.md +200 -0
- package/dist/cases/code-sample/block.d.ts +1 -0
- package/dist/cases/code-sample/block.jsx +19 -0
- package/dist/cases/code-sample/command.d.ts +1 -0
- package/dist/cases/code-sample/command.jsx +17 -0
- package/dist/cases/code-sample.md +96 -0
- package/dist/cases/contact-page/form.d.ts +1 -0
- package/dist/cases/contact-page/form.jsx +83 -0
- package/dist/cases/contact-page/links.d.ts +1 -0
- package/dist/cases/contact-page/links.jsx +19 -0
- package/dist/cases/contact-page.md +142 -0
- package/dist/cases/docs-component-page/reference.d.ts +1 -0
- package/dist/cases/docs-component-page/reference.jsx +93 -0
- package/dist/cases/docs-component-page.md +144 -0
- package/dist/cases/faq/accordion.d.ts +1 -0
- package/dist/cases/faq/accordion.jsx +25 -0
- package/dist/cases/faq/open-list.d.ts +1 -0
- package/dist/cases/faq/open-list.jsx +27 -0
- package/dist/cases/faq.md +110 -0
- package/dist/cases/feature-grid/cards.d.ts +1 -0
- package/dist/cases/feature-grid/cards.jsx +33 -0
- package/dist/cases/feature-grid/rows.d.ts +1 -0
- package/dist/cases/feature-grid/rows.jsx +30 -0
- package/dist/cases/feature-grid.md +132 -0
- package/dist/cases/image-viewer/gallery.d.ts +1 -0
- package/dist/cases/image-viewer/gallery.jsx +32 -0
- package/dist/cases/image-viewer/single.d.ts +1 -0
- package/dist/cases/image-viewer/single.jsx +25 -0
- package/dist/cases/image-viewer.md +123 -0
- package/dist/cases/landing-hero/centered.d.ts +1 -0
- package/dist/cases/landing-hero/centered.jsx +22 -0
- package/dist/cases/landing-hero/split.d.ts +1 -0
- package/dist/cases/landing-hero/split.jsx +30 -0
- package/dist/cases/landing-hero.md +114 -0
- package/dist/cases/legal-page/sections.d.ts +1 -0
- package/dist/cases/legal-page/sections.jsx +61 -0
- package/dist/cases/legal-page.md +96 -0
- package/dist/cases/long-form-page/article.d.ts +1 -0
- package/dist/cases/long-form-page/article.jsx +58 -0
- package/dist/cases/long-form-page/with-contents.d.ts +1 -0
- package/dist/cases/long-form-page/with-contents.jsx +41 -0
- package/dist/cases/long-form-page.md +170 -0
- package/dist/cases/message-actions/hover-toolbar.jsx +11 -8
- package/dist/cases/message-actions/menu.jsx +10 -7
- package/dist/cases/message-actions.md +19 -13
- package/dist/cases/message-attachments/in-composer.jsx +2 -2
- package/dist/cases/message-attachments/in-message.jsx +16 -11
- package/dist/cases/message-attachments.md +29 -17
- package/dist/cases/one-main-action.md +33 -0
- package/dist/cases/overflow-menu/in-a-header.jsx +9 -6
- package/dist/cases/overflow-menu/on-a-row.jsx +9 -6
- package/dist/cases/overflow-menu.md +16 -10
- package/dist/cases/page-end/cta-band.d.ts +1 -0
- package/dist/cases/page-end/cta-band.jsx +24 -0
- package/dist/cases/page-end/next-link.d.ts +1 -0
- package/dist/cases/page-end/next-link.jsx +18 -0
- package/dist/cases/page-end.md +88 -0
- package/dist/cases/password-gate/inline.d.ts +1 -0
- package/dist/cases/password-gate/inline.jsx +94 -0
- package/dist/cases/password-gate/modal.d.ts +1 -0
- package/dist/cases/password-gate/modal.jsx +81 -0
- package/dist/cases/password-gate/page.d.ts +1 -0
- package/dist/cases/password-gate/page.jsx +82 -0
- package/dist/cases/password-gate.md +351 -0
- package/dist/cases/pricing-section/cards.d.ts +1 -0
- package/dist/cases/pricing-section/cards.jsx +40 -0
- package/dist/cases/pricing-section.md +85 -0
- package/dist/cases/product-cards/grid.d.ts +1 -0
- package/dist/cases/product-cards/grid.jsx +20 -0
- package/dist/cases/product-cards.md +71 -0
- package/dist/cases/reply-feedback/thumbs.jsx +11 -8
- package/dist/cases/reply-feedback/with-reason.jsx +11 -8
- package/dist/cases/reply-feedback.md +20 -14
- package/dist/cases/section-index/cards.d.ts +1 -0
- package/dist/cases/section-index/cards.jsx +25 -0
- package/dist/cases/section-index/list.d.ts +1 -0
- package/dist/cases/section-index/list.jsx +56 -0
- package/dist/cases/section-index.md +140 -0
- package/dist/cases/site-header.md +1 -1
- package/dist/cases/site-search/dialog.d.ts +1 -0
- package/dist/cases/site-search/dialog.jsx +131 -0
- package/dist/cases/site-search.md +176 -0
- package/dist/cases/tabbed-panels/tabs.d.ts +1 -0
- package/dist/cases/tabbed-panels/tabs.jsx +40 -0
- package/dist/cases/tabbed-panels.md +81 -0
- package/dist/cases.json +1173 -29
- package/dist/components/accordion.d.ts +31 -0
- package/dist/components/accordion.jsx +103 -0
- package/dist/components/codeBlock.d.ts +26 -0
- package/dist/components/codeBlock.jsx +101 -0
- package/dist/components/lightbox.d.ts +31 -0
- package/dist/components/lightbox.jsx +161 -0
- package/dist/components/linkCard.d.ts +10 -1
- package/dist/components/linkCard.jsx +32 -6
- package/dist/components/modal.d.ts +10 -2
- package/dist/components/modal.jsx +17 -12
- package/dist/components/pageHeader.jsx +1 -1
- package/dist/components/searchDialog.d.ts +44 -0
- package/dist/components/searchDialog.jsx +152 -0
- package/dist/components/tab.d.ts +5 -1
- package/dist/components/tab.jsx +2 -2
- package/dist/components/tabPanel.d.ts +16 -0
- package/dist/components/tabPanel.jsx +12 -0
- package/dist/components/tabsContainer.d.ts +5 -1
- package/dist/components/tabsContainer.jsx +2 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/internal/accordion.d.ts +4 -0
- package/dist/internal/accordion.js +53 -0
- package/dist/internal/combobox.d.ts +20 -0
- package/dist/internal/combobox.js +28 -0
- package/dist/internal/highlight.d.ts +5 -0
- package/dist/internal/highlight.js +18 -0
- package/dist/native-mapping.json +31 -1
- package/dist/stories/Accordion.stories.d.ts +11 -0
- package/dist/stories/Accordion.stories.jsx +93 -0
- package/dist/stories/Cases.generated.stories.d.ts +34 -0
- package/dist/stories/Cases.generated.stories.jsx +68 -0
- package/dist/stories/CodeBlock.stories.d.ts +12 -0
- package/dist/stories/CodeBlock.stories.jsx +65 -0
- package/dist/stories/Lightbox.stories.d.ts +8 -0
- package/dist/stories/Lightbox.stories.jsx +40 -0
- package/dist/stories/LinkCard.stories.d.ts +6 -0
- package/dist/stories/LinkCard.stories.jsx +17 -0
- package/dist/stories/PageHeader.stories.d.ts +2 -0
- package/dist/stories/PageHeader.stories.jsx +13 -0
- package/dist/stories/SearchDialog.stories.d.ts +17 -0
- package/dist/stories/SearchDialog.stories.jsx +111 -0
- package/dist/stories/TabPanel.stories.d.ts +7 -0
- package/dist/stories/TabPanel.stories.jsx +31 -0
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Tabbed panels
|
|
2
|
+
|
|
3
|
+
A page shows several views of one thing, and a visitor reads one of them at a time.
|
|
4
|
+
|
|
5
|
+
## Do
|
|
6
|
+
|
|
7
|
+
- Put the section's name in `SectionIntro`, so the section has a level 2 heading. Give the panel's title a level 3 `Heading`.
|
|
8
|
+
- Use `TabsContainer` with one `Tab` for each view. Write each label in Title Case, as one short word, and use `size="small"` so four fit on a phone.
|
|
9
|
+
- Give each `Tab` an `id` and `controls`, and put each view in a `TabPanel` named by its Tab. Every panel is in the page; only the selected one shows. Name the tablist with `aria-labelledby` on `TabsContainer`.
|
|
10
|
+
- Keep the selected tab in state. Put the view most visitors need first.
|
|
11
|
+
- Keep two to five tabs, and four when you can: they fit on a phone. A fifth scrolls inside the row and the page does not.
|
|
12
|
+
- Give every panel the same shape: a title, a line and a short `List`, so the page does not jump when a visitor changes tab.
|
|
13
|
+
- Use stacked sections, each with its own level 2 heading, for more than five views or for views everyone must read.
|
|
14
|
+
- Use `SegmentedControl` instead when the choice changes a value, as the case 'Range switch' says.
|
|
15
|
+
|
|
16
|
+
## Don't
|
|
17
|
+
|
|
18
|
+
- Do not hide something a visitor must read behind a tab.
|
|
19
|
+
- Do not use these tabs for a site's sections or an app's areas. Those are `Tab`s with `href`, as the cases 'Site header' and 'Settings page' say.
|
|
20
|
+
- Do not give a tab an icon or a long label. It will not fit on a phone.
|
|
21
|
+
- Do not change the tab on a timer.
|
|
22
|
+
- Do not nest tabs inside a panel.
|
|
23
|
+
|
|
24
|
+
## Example: Tabs over one panel
|
|
25
|
+
|
|
26
|
+
Uses: `Heading`, `List`, `PageSection`, `PageShell`, `Paragraph`, `SectionIntro`, `Stack`, `Tab`, `TabPanel`, `TabsContainer`
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
'use client';
|
|
30
|
+
import { useState } from 'react';
|
|
31
|
+
import PageShell from 'oneslash-design-system/components/pageShell';
|
|
32
|
+
import SectionIntro from 'oneslash-design-system/components/sectionIntro';
|
|
33
|
+
import TabsContainer from 'oneslash-design-system/components/tabsContainer';
|
|
34
|
+
import Tab from 'oneslash-design-system/components/tab';
|
|
35
|
+
import TabPanel from 'oneslash-design-system/components/tabPanel';
|
|
36
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
37
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
38
|
+
import List from 'oneslash-design-system/components/list';
|
|
39
|
+
import { PageSection, Stack } from 'oneslash-design-system/components/layout';
|
|
40
|
+
|
|
41
|
+
// Four views of one thing, and a visitor reads one. The first is the one most visitors need.
|
|
42
|
+
const views = [
|
|
43
|
+
{ id: 'channels', label: 'Channels', title: 'One place for each subject', line: 'A channel holds the talk about one team or project.', points: ['Everyone in a channel sees every message.', 'Pin the messages people need again.', 'Turn a message into a task when it needs an owner.'] },
|
|
44
|
+
{ id: 'tasks', label: 'Tasks', title: 'A task and its talk together', line: 'A task keeps its owner, its status and its talk together.', points: ['Give a task one owner and one due date.', 'Reply in the task, not in the channel.', 'Close the task when the work is done.'] },
|
|
45
|
+
{ id: 'notes', label: 'Notes', title: 'Notes the whole team can search', line: 'Write a decision once and find it later.', points: ['Link a note to the task it came from.', 'Search every note from one box.', 'Export a note to PDF on Pro and Business.'] },
|
|
46
|
+
{ id: 'agent', label: 'Agent', title: 'Answers with their sources', line: 'Ask the agent a question in any channel or task.', points: ['It says which notes and messages it used.', 'It never reads a channel you are not in.', 'Each reply counts as one AI agent response.'] },
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
export default function TabbedPanelsTabs() {
|
|
50
|
+
const [selected, setSelected] = useState('channels');
|
|
51
|
+
return (
|
|
52
|
+
<PageShell>
|
|
53
|
+
<PageSection gap="xxlarge">
|
|
54
|
+
<SectionIntro id="how-it-works" name="How it works" statement="Four parts, each for one kind of work." />
|
|
55
|
+
<Stack gap="xlarge">
|
|
56
|
+
{/* Title Case, one short word each. The tablist is named by the section's heading, and each Tab controls its panel. */}
|
|
57
|
+
<TabsContainer aria-labelledby="how-it-works">
|
|
58
|
+
{views.map((v) => (
|
|
59
|
+
<Tab key={v.id} id={`tabbed-panels-tab-${v.id}`} controls={`tabbed-panels-panel-${v.id}`} size="small" label={v.label} isSelected={v.id === selected} onClickTab={() => setSelected(v.id)} />
|
|
60
|
+
))}
|
|
61
|
+
</TabsContainer>
|
|
62
|
+
{/* Every panel is in the page. Only the selected one shows. */}
|
|
63
|
+
{views.map((v) => (
|
|
64
|
+
<TabPanel key={v.id} id={`tabbed-panels-panel-${v.id}`} labelledBy={`tabbed-panels-tab-${v.id}`} selected={v.id === selected}>
|
|
65
|
+
<Stack gap="medium">
|
|
66
|
+
<Heading level={3} size="h5">{v.title}</Heading>
|
|
67
|
+
<Paragraph tone="secondary" measure="none">{v.line}</Paragraph>
|
|
68
|
+
<List items={v.points} marker="dot" />
|
|
69
|
+
</Stack>
|
|
70
|
+
</TabPanel>
|
|
71
|
+
))}
|
|
72
|
+
</Stack>
|
|
73
|
+
</PageSection>
|
|
74
|
+
</PageShell>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Native
|
|
80
|
+
|
|
81
|
+
On Apple use a segmented `Picker` for two to five views, and a `TabView` only for the app's own areas. On Android use a `TabRow`.
|