oneslash-design-system 2.23.1 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +1 -1
  2. package/dist/DESIGN.md +20 -5
  3. package/dist/cases/activity-timeline/activity.d.ts +1 -0
  4. package/dist/cases/activity-timeline/activity.jsx +43 -0
  5. package/dist/cases/activity-timeline/versions.d.ts +1 -0
  6. package/dist/cases/activity-timeline/versions.jsx +130 -0
  7. package/dist/cases/activity-timeline.md +315 -0
  8. package/dist/cases/agent-plan-proposal.md +1 -0
  9. package/dist/cases/ask-page/answered.d.ts +1 -0
  10. package/dist/cases/ask-page/answered.jsx +248 -0
  11. package/dist/cases/ask-page/first-visit.d.ts +1 -0
  12. package/dist/cases/ask-page/first-visit.jsx +118 -0
  13. package/dist/cases/ask-page.md +551 -0
  14. package/dist/cases/billing-page/self-serve.jsx +4 -4
  15. package/dist/cases/billing-page/trial.d.ts +1 -0
  16. package/dist/cases/billing-page/trial.jsx +115 -0
  17. package/dist/cases/billing-page.md +166 -5
  18. package/dist/cases/chart/bars.d.ts +1 -0
  19. package/dist/cases/chart/bars.jsx +83 -0
  20. package/dist/cases/chart/lines.d.ts +1 -0
  21. package/dist/cases/chart/lines.jsx +71 -0
  22. package/dist/cases/chart.md +258 -0
  23. package/dist/cases/collapsible-search/popover.jsx +1 -1
  24. package/dist/cases/collapsible-search.md +2 -2
  25. package/dist/cases/comment-thread/card.d.ts +1 -0
  26. package/dist/cases/comment-thread/card.jsx +141 -0
  27. package/dist/cases/comment-thread/thread.d.ts +1 -0
  28. package/dist/cases/comment-thread/thread.jsx +87 -0
  29. package/dist/cases/comment-thread.md +349 -0
  30. package/dist/cases/cookie-choice/banner.d.ts +1 -0
  31. package/dist/cases/cookie-choice/banner.jsx +82 -0
  32. package/dist/cases/cookie-choice/settings.d.ts +1 -0
  33. package/dist/cases/cookie-choice/settings.jsx +75 -0
  34. package/dist/cases/cookie-choice.md +234 -0
  35. package/dist/cases/dashboard/numbers-first.jsx +63 -2
  36. package/dist/cases/dashboard/work-first.jsx +1 -1
  37. package/dist/cases/dashboard.md +77 -5
  38. package/dist/cases/data-table-page/all-rows.jsx +1 -1
  39. package/dist/cases/data-table-page/paged.jsx +1 -1
  40. package/dist/cases/data-table-page.md +2 -2
  41. package/dist/cases/invoice-list/table.jsx +21 -9
  42. package/dist/cases/invoice-list.md +27 -12
  43. package/dist/cases/leaderboard/ranked.d.ts +1 -0
  44. package/dist/cases/leaderboard/ranked.jsx +44 -0
  45. package/dist/cases/leaderboard/table.d.ts +1 -0
  46. package/dist/cases/leaderboard/table.jsx +87 -0
  47. package/dist/cases/leaderboard.md +177 -0
  48. package/dist/cases/message-reactions/picker.jsx +1 -1
  49. package/dist/cases/message-reactions.md +2 -2
  50. package/dist/cases/message-row.md +2 -1
  51. package/dist/cases/newsletter-signup/inline.d.ts +1 -0
  52. package/dist/cases/newsletter-signup/inline.jsx +72 -0
  53. package/dist/cases/newsletter-signup/section.d.ts +1 -0
  54. package/dist/cases/newsletter-signup/section.jsx +72 -0
  55. package/dist/cases/newsletter-signup.md +234 -0
  56. package/dist/cases/number-format.md +9 -3
  57. package/dist/cases/onboarding/checklist.d.ts +1 -0
  58. package/dist/cases/onboarding/checklist.jsx +92 -0
  59. package/dist/cases/onboarding/steps.d.ts +3 -0
  60. package/dist/cases/onboarding/steps.jsx +177 -0
  61. package/dist/cases/onboarding.md +368 -0
  62. package/dist/cases/people-row/stack.jsx +1 -1
  63. package/dist/cases/people-row.md +2 -2
  64. package/dist/cases/plan-comparison/table.d.ts +1 -0
  65. package/dist/cases/plan-comparison/table.jsx +47 -0
  66. package/dist/cases/plan-comparison.md +94 -0
  67. package/dist/cases/plan-picker.md +1 -0
  68. package/dist/cases/plan-sign-off/one-approver.d.ts +1 -0
  69. package/dist/cases/plan-sign-off/one-approver.jsx +129 -0
  70. package/dist/cases/plan-sign-off/team.d.ts +1 -0
  71. package/dist/cases/plan-sign-off/team.jsx +213 -0
  72. package/dist/cases/plan-sign-off.md +541 -0
  73. package/dist/cases/pricing-section.md +1 -1
  74. package/dist/cases/site-footer/columns.jsx +2 -1
  75. package/dist/cases/site-footer.md +3 -1
  76. package/dist/cases/stat-row/tiles.jsx +2 -1
  77. package/dist/cases/stat-row.md +5 -2
  78. package/dist/cases/task-header/agent-sets-status.d.ts +1 -0
  79. package/dist/cases/task-header/agent-sets-status.jsx +164 -0
  80. package/dist/cases/task-header/people-change-status.d.ts +1 -0
  81. package/dist/cases/task-header/people-change-status.jsx +175 -0
  82. package/dist/cases/task-header.md +576 -0
  83. package/dist/cases.json +883 -30
  84. package/dist/components/alert.d.ts +3 -1
  85. package/dist/components/alert.jsx +5 -5
  86. package/dist/components/barChart.d.ts +35 -0
  87. package/dist/components/barChart.jsx +92 -0
  88. package/dist/components/dateField.jsx +1 -1
  89. package/dist/components/formatNumber.d.ts +10 -2
  90. package/dist/components/formatNumber.js +44 -9
  91. package/dist/components/heading.d.ts +2 -2
  92. package/dist/components/heading.jsx +5 -3
  93. package/dist/components/layout.d.ts +4 -2
  94. package/dist/components/layout.jsx +13 -2
  95. package/dist/components/lineChart.d.ts +39 -0
  96. package/dist/components/lineChart.jsx +128 -0
  97. package/dist/components/markdown.d.ts +24 -0
  98. package/dist/components/markdown.jsx +81 -0
  99. package/dist/components/pageShell.d.ts +3 -3
  100. package/dist/components/pageShell.jsx +6 -5
  101. package/dist/components/popover.d.ts +5 -1
  102. package/dist/components/popover.jsx +3 -2
  103. package/dist/components/progress.jsx +1 -1
  104. package/dist/components/select.jsx +5 -2
  105. package/dist/components/statTile.d.ts +1 -1
  106. package/dist/components/statTile.jsx +7 -2
  107. package/dist/components/tableCell.d.ts +4 -3
  108. package/dist/components/tableCell.jsx +2 -2
  109. package/dist/components/timeline.d.ts +32 -0
  110. package/dist/components/timeline.jsx +54 -0
  111. package/dist/components/titleBar.d.ts +3 -1
  112. package/dist/components/titleBar.jsx +9 -4
  113. package/dist/components/toaster.jsx +81 -11
  114. package/dist/index.d.ts +1 -0
  115. package/dist/index.js +1 -0
  116. package/dist/internal/chart.d.ts +39 -0
  117. package/dist/internal/chart.js +110 -0
  118. package/dist/internal/chartFrame.d.ts +29 -0
  119. package/dist/internal/chartFrame.jsx +57 -0
  120. package/dist/internal/markdown.d.ts +40 -0
  121. package/dist/internal/markdown.js +577 -0
  122. package/dist/internal/toaster.d.ts +2 -0
  123. package/dist/internal/toaster.js +8 -0
  124. package/dist/native-mapping.json +28 -4
  125. package/dist/stories/BarChart.stories.d.ts +10 -0
  126. package/dist/stories/BarChart.stories.jsx +104 -0
  127. package/dist/stories/Cases.generated.stories.d.ts +22 -0
  128. package/dist/stories/Cases.generated.stories.jsx +44 -0
  129. package/dist/stories/Heading.stories.d.ts +1 -0
  130. package/dist/stories/Heading.stories.jsx +17 -0
  131. package/dist/stories/LineChart.stories.d.ts +9 -0
  132. package/dist/stories/LineChart.stories.jsx +34 -0
  133. package/dist/stories/Markdown.stories.d.ts +9 -0
  134. package/dist/stories/Markdown.stories.jsx +66 -0
  135. package/dist/stories/Onboarding.probe.stories.d.ts +6 -0
  136. package/dist/stories/Onboarding.probe.stories.jsx +12 -0
  137. package/dist/stories/Popover.stories.d.ts +2 -0
  138. package/dist/stories/Popover.stories.jsx +33 -0
  139. package/dist/stories/StatTile.stories.d.ts +4 -0
  140. package/dist/stories/StatTile.stories.jsx +47 -2
  141. package/dist/stories/Timeline.stories.d.ts +8 -0
  142. package/dist/stories/Timeline.stories.jsx +49 -0
  143. package/dist/stories/TitleBar.stories.d.ts +1 -0
  144. package/dist/stories/TitleBar.stories.jsx +13 -0
  145. package/dist/stories/Toaster.stories.d.ts +4 -0
  146. package/dist/stories/Toaster.stories.jsx +30 -0
  147. package/package.json +1 -1
package/README.md CHANGED
@@ -70,7 +70,7 @@ import SectionIntro from 'oneslash-design-system/components/sectionIntro';
70
70
 
71
71
  ## Design cases
72
72
 
73
- A case is one design situation with oneSlash's answer to it. A rule case has one answer, such as "an agent asks before a risky action". A design case has one to four options, each with a line on when to use it and a working example built only from this package. 2.23.0 has 123: fourteen rules and 109 design cases for auth pages, confirms and modals, states, chat and agent interfaces, settings and menus, shells and navigation, dashboards and billing, marketing and content pages, forms with dates and files.
73
+ A case is one design situation with oneSlash's answer to it. A rule case has one answer, such as "an agent asks before a risky action". A design case has one to four options, each with a line on when to use it and a working example built only from this package. 2.25.0 has 134: fourteen rules and 120 design cases for auth pages, confirms and modals, states, chat and agent interfaces, settings and menus, shells and navigation, dashboards and billing, marketing and content pages, forms with dates and files, onboarding, history and charts, cookies, newsletters and plan comparison.
74
74
 
75
75
  - `oneslash-design-system/cases.json` lists every case with its rule text, options, Do and Don't lines, and the source of each example.
76
76
  - `oneslash-design-system/cases/<id>.md` is one case as text, and `oneslash-design-system/cases/<id>/<option>.jsx` is the example itself.
package/dist/DESIGN.md CHANGED
@@ -295,6 +295,7 @@ For each web component, the table gives the native control to use. System contro
295
295
  | alert | `ODSBanner` for an inline message; `.alert` for one that needs a decision | `OdsBanner` for an inline message; `AlertDialog` for one that needs a decision | ODS has no native toast: on Android use `Snackbar` in a `SnackbarHost`. |
296
296
  | appShell | `NavigationSplitView` with the sidebar, the content and an `.inspector`; on iPhone a `NavigationStack`, or a `TabView` of five places or fewer | `NavigationSuiteScaffold`; on a phone a `ModalNavigationDrawer` around a `Scaffold` | The split view collapses to a stack on iPhone and shows and hides the sidebar itself. The skip link is web only. |
297
297
  | avatarStack | An `HStack(spacing: -8)` of avatars, each with a ring in the background color and a count `Text` in a circle past the limit, with `.accessibilityElement(children: .combine)` and a label naming the people | A `Row` with `Arrangement.spacedBy((-8).dp)` of avatars and a count circle, with `semantics(mergeDescendants = true)` and a label naming the people | To list everyone, make the stack a `Button` that opens a popover (iPad, Mac) or a sheet (iPhone) / a `DropdownMenu` or `ModalBottomSheet`. |
298
+ | barChart | Swift Charts `Chart` of `BarMark`s with `.accessibilityLabel` and `.accessibilityValue` per mark | No system chart: draw the bars on a `Canvas` with `semantics` per bar, or show the table | Bars in `primary.main`, the highlighted one in `text.primary`, gridlines in `misc.divider`. The y axis starts at 0; ticks are short (`.compact`), the value and the table exact. A missing day draws no bar and reads "No data". Keep a way to show the values as a table. |
298
299
  | button | `Button` with `.odsProminentButton()` for accent (`.odsProminentButton(.glass)` for the glass style), `.bordered` for primary | `Button`, `OutlinedButton` | Tertiary and text-only: `.borderless` / `TextButton`. On Apple, apply `.odsProminentButton()` to every prominent button. Under `odsTheme` the label of a `.borderedProminent` or `.glassProminent` button takes `text.primary`, not the system white, which is below 4.5:1 on the accent in default dark, forest light, forest dark, clay dark, indigo light, indigo dark, wine light, wine dark. In forest light it is the same color as the fill, so the label cannot be seen. The modifier keeps the system style and sets the label to `accent.contrast`. Compose needs nothing: `onPrimary` is `accent.contrast`. |
299
300
  | brandIcon | the provider's own button where one exists (`SignInWithAppleButton`), else an asset in the app | an asset in the app | |
300
301
  | breadcrumb | Not applicable: web page pattern | Not applicable: web page pattern | The system back button and the navigation title say where the person is. |
@@ -321,10 +322,12 @@ For each web component, the table gives the native control to use. System contro
321
322
  | layout | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: `VStack` / `HStack` / `Grid`; Compose `Column` / `Row` / `LazyVerticalGrid`. `Center` and `Split` are for web pages; a native screen is already one column. |
322
323
  | lightbox | `.fullScreenCover` holding a `TabView` with `.tabViewStyle(.page)`, one page per image; a `VideoPlayer` (AVKit) on a video page | A full-width `Dialog` (`usePlatformDefaultWidth = false`) holding a `HorizontalPager`; a Media3 `PlayerView` with subtitles on a video page | The system pager gives the swipe; keep a Close button and say "2 of 5" in the title. A video uses the system player and its captions, never starts by itself, and pauses when its page is left or the viewer closes. |
323
324
  | line | `Divider` | `HorizontalDivider`, `VerticalDivider` | |
325
+ | lineChart | Swift Charts `Chart` of `LineMark`s, the second series told apart by `.lineStyle(StrokeStyle(dash:))` in place of `.foregroundStyle(by:)`, with an `AXChartDescriptor` | No system chart: draw each line as a `Path` on a `Canvas` with `semantics` per point, or show the table | One or two series: the first solid in `primary.main`, the second dashed in `text.secondary`, with a legend. A missing day breaks the line and reads "No data"; never draw it as 0. The y axis starts at 0; ticks are short (`.compact`), the readout and the table exact. Keep a way to show the values as a table. |
324
326
  | link | `Link` | `Text` with a `LinkAnnotation.Url` in its `AnnotatedString` | |
325
327
  | linkCard | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: a `NavigationLink` row in a `List` / a clickable `ListItem`. |
326
328
  | list | `List` | `LazyColumn` of `ListItem` | A short bulleted passage inside text stays `Text` lines. |
327
329
  | loadingScreen | `ProgressView` | `CircularProgressIndicator` | |
330
+ | markdown | A `VStack` of the same subset of blocks, each line of text a `Text(AttributedString(markdown:options: .init(interpretedSyntax: .inlineOnlyPreservingWhitespace)))`, code in `codeBlock` | A `Column` of the same subset, parsed by hand (Compose has no system markdown), each line of text a `Text` with an `AnnotatedString` whose links are `LinkAnnotation.Url` | Headings to three levels, lists one level deep, fenced code, rules, bold, italic, inline code and links. Only http, https and mailto links open; a table shows as code and an image as its alt text. |
328
331
  | menu | `Menu` or `.contextMenu` | `DropdownMenu` | |
329
332
  | menuItem | `Button` inside a `Menu` | `DropdownMenuItem` | In a sidebar: a `List` row / `NavigationDrawerItem`. |
330
333
  | message | An `HStack` with `ODSAvatar` and a `VStack` of the header and the body | A `Row` with `OdsAvatar` and a `Column` of the header and the body | SwiftUI and Compose have no message row. Mark an agent with `ODSTag` / `OdsTag` after its name. |
@@ -352,10 +355,10 @@ For each web component, the table gives the native control to use. System contro
352
355
  | stepList | A `List` of `Label`s with an SF Symbol per status (`circle`, `checkmark.circle.fill`, `xmark.circle.fill`, `minus.circle`); `ProgressView` for the running one | A `Column` of `ListItem`s with an `Icon` per status; `CircularProgressIndicator` for the running one | Give each row a status text for VoiceOver / TalkBack, not color alone. |
353
356
  | surface | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: a `Form` section or `GroupBox` / `Card`. |
354
357
  | switch | `Toggle` in a `Form` row (`.toggleStyle(.switch)`); the description is the row's secondary line | `Switch` in a `ListItem` with `trailingContent` | While a change saves, disable the control or show a `ProgressView` / `CircularProgressIndicator` beside it and put the value back if it fails. |
355
- | statTile | A `VStack` of `Text`s with `.accessibilityElement(children: .combine)` | A `Column` with `Modifier.semantics(mergeDescendants = true)` | Not colored by good or bad. Numbers: `.number.notation(.compactName)` / `.currency(code:)` on Apple; `CompactDecimalFormat` / `NumberFormat.getCurrencyInstance` on Android. Loading: `.redacted(reason: .placeholder)`. |
358
+ | statTile | A `VStack` of `Text`s with `.accessibilityElement(children: .combine)` | A `Column` with `Modifier.semantics(mergeDescendants = true)` | Not colored by good or bad. A percent's change is in points ('Up 3 pts'), not a percent of a percent, and its accessibility label says 'percentage points'. Money uses the currency's own decimals. Numbers: `.number.notation(.compactName)` / `.currency(code:)` on Apple; `CompactDecimalFormat` / `NumberFormat.getCurrencyInstance` on Android. Loading: `.redacted(reason: .placeholder)`. |
356
359
  | tab | `TabView` or segmented `Picker` | `PrimaryTabRow` | One `Tab` inside `TabView` or one segment / one `Tab`. `TabRow` is deprecated in Material 3. |
357
360
  | tabPanel | The content view of a `TabView` page, or the view under a segmented `Picker` | The content under a `PrimaryTabRow`, shown for the selected index | The system tab views already pair a tab with its content and name it for VoiceOver / TalkBack. On the web it adds `role="tabpanel"`. |
358
- | tableCell | A `TableColumn` content view | `Text` in a `Row` with `Modifier.weight` | Material 3 has no table. |
361
+ | tableCell | A `TableColumn` content view | `Text` in a `Row` with `Modifier.weight` | Material 3 has no table. `rowHeader` makes the first cell name its row: the first `TableColumn` on Apple, and `semantics { heading() }` on that cell on Android. |
359
362
  | tableContainer | `Table` | `LazyColumn` of `Row`s | Material 3 has no table. A compact-width iPhone `Table` shows only its first column. `aria-label` names it: `.accessibilityLabel`. `minWidth` makes it scroll sideways inside its region: a horizontal `ScrollView` / `Modifier.horizontalScroll`. A sorted column uses `TableColumn(…, sortUsing:)` / `semantics { stateDescription }`. |
360
363
  | tableHeader | The `Table` column headers (`TableColumn` titles) | A header `Row` as the first `LazyColumn` item | Material 3 has no table. |
361
364
  | tableHeaderCell | A `TableColumn` title | `Text` in the header `Row` | Material 3 has no table. `sort`: `TableColumn(…, sortUsing:)` with a `KeyPathComparator`; on Android a clickable header `Text` with `semantics { stateDescription = "Sorted ascending" }`. |
@@ -365,8 +368,9 @@ For each web component, the table gives the native control to use. System contro
365
368
  | textarea | `TextField(_:text:axis: .vertical)` or `TextEditor` | `OutlinedTextField` with `minLines` | |
366
369
  | textField | `TextField` (`SecureField` for passwords) | `OutlinedTextField` or `TextField` | |
367
370
  | timeStamp | `Text(_:style:)` (`.relative`) or `Text(_:format:)` (`.dateTime`) | `Text` with `DateUtils.getRelativeTimeSpanString` or `DateTimeFormatter.ofLocalizedDateTime` | |
368
- | titleBar | `.navigationTitle` with `.toolbar` items | `TopAppBar` with `navigationIcon` and `actions` | The main action stays in the toolbar; the rest go in a `Menu` / an overflow `DropdownMenu`. |
369
- | toaster | `ODSBanner` for an inline message; a system banner (a local notification) when the app is not in front | `Snackbar` in a `SnackbarHost` | SwiftUI has no toast, so ODS adds none: show the message in the screen. |
371
+ | timeline | A `List` of rows with a leading `Circle` and a connecting `Rectangle` in an `.overlay`; a selectable row is a `Button` | A `LazyColumn` of rows with the dot and the connecting line drawn in `Modifier.drawBehind`; a selectable row is `Modifier.clickable` | The dot is the same for every row: color carries nothing. No line after the last row. Mark the selected row with `.accessibilityAddTraits(.isSelected)` / `semantics { selected = true }`. Format the time with `Text(_:format:)` / `DateTimeFormatter.ofLocalizedDateTime`. |
372
+ | titleBar | `.navigationTitle` with `.toolbar` items | `TopAppBar` with `navigationIcon` and `actions` | The main action stays in the toolbar; the rest go in a `Menu` / an overflow `DropdownMenu`. The `meta` line is a `.navigationSubtitle` on Mac and a toolbar `principal` item on iPhone; on Android a second `Text` in the top bar's `title` slot. |
373
+ | toaster | `ODSBanner` for an inline message; a system banner (a local notification) when the app is not in front | `Snackbar` in a `SnackbarHost` | SwiftUI has no toast, so ODS adds none: show the message in the screen. SwiftUI posts `AccessibilityNotification.Announcement`; Compose sets `liveRegion` on the snackbar host. |
370
374
  | tooltip | `.help` | `TooltipBox` | `.help` shows on pointer hover only. `TooltipBox` needs `@OptIn(ExperimentalMaterial3Api::class)`. |
371
375
  | userImage | `ODSAvatar` | `OdsAvatar` | Load the picture yourself and pass it as an `Image` / a `Painter`. |
372
376
 
@@ -487,7 +491,7 @@ File: cases/form-errors.md
487
491
 
488
492
  A page shows counts, money, sizes, shares or changes.
489
493
 
490
- Answer: Use the helpers in `formatNumber` (`formatCount`, `formatMoney`, `formatPercent`, `formatBytes`, `formatDuration`), `StatTile` and `Progress`. A count is whole and grouped: '1,240'. In a tile, a count or an amount from 10,000 up shows its short form: '12.4K', '$12.4K'. A table shows the exact number, right-aligned. Money has its symbol and two decimals: '$1,240.00'. A cost under a cent reads '< $0.01'. A share is a whole percent, and a small one reads '< 1%'. A size is base 1024: '52 MB', '1.2 GB'. A time reads '340 ms', '1.2 s', '2 h 24 min'. The unit is in the label or after the number in words: 'Responses', '7 of 8 seats', '340 responses, no limit'. A bare number is never shown, and a unit is never only in a tooltip. A change says its direction, its size and what it compares with: 'Up 12% from last week'. It reads 'New this week' when there was nothing before. It has no color, because more is not good or bad by itself. Unknown is never 0. `formatNumber` shows '–' for a value it cannot read. `StatTile` shows 'No data yet'. While a number loads, a `Skeleton` holds its place. On a failure, show the case 'Load failure'. A limit is a `Progress`, which says 'Limit reached' in words.
494
+ Answer: Use the helpers in `formatNumber` (`formatCount`, `formatMoney`, `formatPercent`, `formatBytes`, `formatDuration`), `StatTile` and `Progress`. A count is whole and grouped: '1,240'. In a tile, a count or an amount from 10,000 up shows its short form: '12.4K', '$12.4K'. A table shows the exact number, right-aligned. On a chart's axis, a number from 10,000 up shows its short form too: '12.4K'. The chart's readout and its table show the exact number. Money has its symbol and its currency's decimals: '$1,240.00', '¥1,240', 'KWD 1,240.000'. A cost under the smallest unit reads '< $0.01'. A share is a whole percent, and a small one reads '< 1%'. A size is base 1024: '52 MB', '1.2 GB'. A time reads '340 ms', '1.2 s', '2 h 24 min'. The unit is in the label or after the number in words: 'Responses', '7 of 8 seats', '340 responses, no limit'. A bare number is never shown, and a unit is never only in a tooltip. A change says its direction, its size and what it compares with: 'Up 12% from last week'. It reads 'New this week' when there was nothing before. A change in a percent is in points: 'Up 3 pts from last week'. A refund in a list of charges has a minus: '-$12.00'. In a sentence, say the word: 'Refunded $12.00'. A change has no color, because more is not good or bad by itself. Unknown is never 0. `formatNumber` shows '–' for a value it cannot read. `StatTile` shows 'No data yet'. While a number loads, a `Skeleton` holds its place. On a failure, show the case 'Load failure'. A limit is a `Progress`, which says 'Limit reached' in words.
491
495
 
492
496
  File: cases/number-format.md
493
497
 
@@ -528,6 +532,7 @@ File: cases/success-feedback.md
528
532
  | About page | A visitor wants to know who is behind the work and whether to get in touch. | cases/about-page.md |
529
533
  | Invite link page | A person opens an invite link to join a workspace. | cases/accept-invite.md |
530
534
  | Account menu | A person opens a menu for their own account to change settings, get help or log out. | cases/account-menu.md |
535
+ | History and activity | A person reads what happened on a task, or opens an older version of a document and brings it back. | cases/activity-timeline.md |
531
536
  | Admin inbox | The owner of a site reads the messages that visitors sent through its contact form. | cases/admin-inbox.md |
532
537
  | Agent options | The agent sees two to four ways forward and needs the person to pick one. These are ways forward for the agent's own work. For a fact or a decision only the person has, see the case 'Agent question'. | cases/agent-options.md |
533
538
  | Agent at work | The agent is working on a request in the thread, and its reply is not ready yet. | cases/agent-pending-reply.md |
@@ -537,19 +542,23 @@ File: cases/success-feedback.md
537
542
  | API keys | A person makes keys that let a script or a service use the product as them, and revokes keys they no longer use. | cases/api-keys.md |
538
543
  | App shell | A person opens the product and moves between its places, such as Inbox, Tasks and Settings, from every page. | cases/app-shell.md |
539
544
  | Document card | The agent made a document for the person, such as a plan or a report. | cases/artifact-card.md |
545
+ | Ask page | A page where a person asks the agent about their work across one or more workspaces, and reads the answers with their sources. | cases/ask-page.md |
540
546
  | Login check loading | The app is checking whether the person is logged in, or running a step such as checking an invite, before it knows what to show. | cases/auth-gate-loading.md |
541
547
  | Billing page | A workspace pays for a plan. One page says what it pays for, what it has used, how it pays and what it has paid. | cases/billing-page.md |
542
548
  | Blog index | A visitor opens the blog to see what was written lately and to pick a post to read. | cases/blog-index.md |
543
549
  | Breadcrumb | A page on a site sits under other pages, and the person needs to see where it is and go back up. | cases/breadcrumb.md |
544
550
  | Breakdown of a total | A page shows how a total splits into parts, such as responses by model or comments by project. | cases/breakdown-list.md |
545
551
  | Changelog | A visitor or a customer wants to know what changed in the product lately, and may be sent to one change from a message. | cases/changelog.md |
552
+ | Chart | A dashboard shows how a count moved over its range, day by day or week by week. | cases/chart.md |
546
553
  | Check your email | A person signed up, and the product sent a link to confirm their email. | cases/check-your-email.md |
547
554
  | Code sample | A page shows code that a person reads, or copies to run. | cases/code-sample.md |
548
555
  | Collapsible search | A person filters a list by a word, and the list should keep its room when they are not typing. | cases/collapsible-search.md |
556
+ | Comment and thread | A person reads comments left on a piece of work, opens one, and reads and answers its thread. | cases/comment-thread.md |
549
557
  | Composer at a limit | The agent cannot be called from the composer because the workspace reached a limit, such as its AI agent responses for the month. | cases/composer-limit.md |
550
558
  | Delete confirm | A person asks to delete or remove something, and it cannot be undone. | cases/confirm-destructive-action.md |
551
559
  | Contact page | A visitor wants to reach the person behind a site. | cases/contact-page.md |
552
560
  | Conversation starters | A thread has no messages yet, and the person may not know what to write first. | cases/conversation-starters.md |
561
+ | Cookie choice | A site sets cookies it does not need to run, and asks the visitor whether it may. | cases/cookie-choice.md |
553
562
  | Create modal | A person creates something new, such as a project or a task, and it needs a name before it exists. | cases/create-modal.md |
554
563
  | Danger zone | A settings page offers actions that are hard or impossible to undo, such as deleting an account or a workspace, or leaving one. | cases/danger-zone.md |
555
564
  | Dashboard | A page that opens an app and says how things are going and what waits on the person. | cases/dashboard.md |
@@ -575,6 +584,7 @@ File: cases/success-feedback.md
575
584
  | Member invite | A person invites someone to join a workspace. | cases/invite-member.md |
576
585
  | Invoices | A billing page lists what the workspace has paid, so an admin can find an invoice, check an amount and keep a copy. | cases/invoice-list.md |
577
586
  | Hero | A marketing page opens by saying what the product is and asking for one thing. | cases/landing-hero.md |
587
+ | Leaderboard | A dashboard shows who did the most of something over its range, such as who left the most comments this week. | cases/leaderboard.md |
578
588
  | Legal page | A person reads the terms or the privacy policy to find one answer in it, or reads all of it before they agree. | cases/legal-page.md |
579
589
  | Load failure | A list or a section could not load. | cases/load-failure.md |
580
590
  | Log-out confirm | A person chooses Log Out. | cases/log-out-confirm.md |
@@ -590,11 +600,13 @@ File: cases/success-feedback.md
590
600
  | Reactions | People answer a message with an emoji instead of a reply. | cases/message-reactions.md |
591
601
  | Message row | A thread shows messages from people, and sometimes from an agent. | cases/message-row.md |
592
602
  | Menu on a phone | A site's links and actions do not fit in the bar on a phone, and the person still needs to reach every one. | cases/mobile-menu.md |
603
+ | Newsletter sign-up | A reader of the public site wants to hear about the product by email, without making an account. | cases/newsletter-signup.md |
593
604
  | Page not found | A person opens a link to a page that does not exist. | cases/not-found-page.md |
594
605
  | Notification setting | A person chooses how much a channel or a thread notifies them. | cases/notification-menu.md |
595
606
  | OAuth consent | Another app, such as a CLI or an MCP client, asks to act for a person who is logged in, and the person must allow it. | cases/oauth-consent.md |
596
607
  | On and off settings | A person turns things on and off, such as which notifications they get. | cases/on-off-settings.md |
597
608
  | On this page | A person reads a long page and wants to see its sections, jump to one and know which one they are in. | cases/on-this-page.md |
609
+ | First-run setup | A person has just signed up, and the app needs a few things from them before it works or before it is fully set up. | cases/onboarding.md |
598
610
  | More menu | A person opens a menu of less common actions, behind one button, for a thing or for the page. | cases/overflow-menu.md |
599
611
  | Page end | A page has said what it had to say, and its last block decides what the visitor does next. | cases/page-end.md |
600
612
  | Page header with actions | A page names itself at the top and offers what the person can do with it. | cases/page-header.md |
@@ -603,7 +615,9 @@ File: cases/success-feedback.md
603
615
  | Payment method | A workspace pays by card. The admin sees which card, changes it or removes it. | cases/payment-method.md |
604
616
  | People on an item | A thread or a task shows who is on it, and the person can find out who they all are. | cases/people-row.md |
605
617
  | Plan change confirm | An admin chose another plan. Before anything changes they need to know what it costs and when it starts. | cases/plan-change-confirm.md |
618
+ | Plan comparison | A visitor to the public site wants to see every limit of every plan side by side before signing up. | cases/plan-comparison.md |
606
619
  | Plan picker | An admin compares the plans a workspace can be on and chooses one. | cases/plan-picker.md |
620
+ | Plan sign-off | The agent wrote a plan for a task, and people approve it before the agent starts the work. | cases/plan-sign-off.md |
607
621
  | Pricing section | A visitor to the public site compares the plans and signs up for one. | cases/pricing-section.md |
608
622
  | Product cards | A maker lists its products on one page, and each product has its own site. | cases/product-cards.md |
609
623
  | Profile | A person changes how they appear and how they sign in: their picture, their name and their password. | cases/profile-form.md |
@@ -628,6 +642,7 @@ File: cases/success-feedback.md
628
642
  | Status in a row | A row in a table or a list says what state its thing is in, such as an invoice, a plan or a connection. ODS has no separate Badge part, because `Tag` does a Badge's job. | cases/status-label.md |
629
643
  | Tabbed panels | A page shows several views of one thing, and a visitor reads one of them at a time. | cases/tabbed-panels.md |
630
644
  | Tag filter | A person filters a list by a tag, and adds, renames and deletes the tags themselves. | cases/tag-filter.md |
645
+ | Task header | A task page shows its name, its state, who is on it and when it is due, with the panes and actions for it. | cases/task-header.md |
631
646
  | Theme switcher | A person chooses between a light page, a dark page, or the one their device uses. | cases/theme-switcher.md |
632
647
  | Type to confirm | A person asks to delete something large that cannot be brought back, such as a workspace or an account. | cases/type-to-confirm.md |
633
648
  | Typing line | Other people in the thread are writing a message that has not arrived yet. | cases/typing-and-status.md |
@@ -0,0 +1 @@
1
+ export default function ActivityTimelineActivity(): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ 'use client';
2
+ import { useRef, useState } from 'react';
3
+ import AppShell from '../../components/appShell';
4
+ import SidePane from '../../components/sidePane';
5
+ import Navigation from '../../components/navigation';
6
+ import MenuItem from '../../components/menuItem';
7
+ import TitleBar from '../../components/titleBar';
8
+ import IconButton from '../../components/iconButton';
9
+ import Tooltip from '../../components/tooltip';
10
+ import Timeline from '../../components/timeline';
11
+ import Paragraph from '../../components/paragraph';
12
+ import { Stack } from '../../components/layout';
13
+ var task = 'Launch checklist';
14
+ // Newest first. Each title says who did what, and each time is written in full.
15
+ var events = [
16
+ { id: 'e6', title: 'Check failed', when: 'Nov 16, 2026, 3:05 PM', dateTime: '2026-11-16T15:05', detail: 'The sign-up form test failed on a phone.', tag: { label: 'Needs fixing', color: 'warning' } },
17
+ { id: 'e5', title: 'Acme Agent opened a pull request', when: 'Nov 16, 2026, 2:58 PM', dateTime: '2026-11-16T14:58', actor: { name: 'Acme Agent', agent: true }, detail: 'Updates the home page and its tests', href: '/pulls/42' },
18
+ { id: 'e4', title: 'Dana Lee approved the plan', when: 'Nov 16, 2026, 2:52 PM', dateTime: '2026-11-16T14:52', actor: { name: 'Dana Lee' } },
19
+ { id: 'e3', title: 'Acme Agent wrote the plan', when: 'Nov 16, 2026, 2:40 PM', dateTime: '2026-11-16T14:40', actor: { name: 'Acme Agent', agent: true } },
20
+ { id: 'e2', title: 'Ben Carter added Omar Reyes to the task', when: 'Nov 15, 2026, 4:10 PM', dateTime: '2026-11-15T16:10', actor: { name: 'Ben Carter' } },
21
+ { id: 'e1', title: 'Ben Carter created the task', when: 'Nov 15, 2026, 4:02 PM', dateTime: '2026-11-15T16:02', actor: { name: 'Ben Carter' } },
22
+ ];
23
+ // The places. A real app lets each link go to its page.
24
+ var sidebar = (<Navigation aria-label="Main">
25
+ <MenuItem size="small" label="Tasks" iconName="ListChecks" href="/tasks" isSelected aria-current="page" onClick={function (event) { return event.preventDefault(); }}/>
26
+ </Navigation>);
27
+ export default function ActivityTimelineActivity() {
28
+ var _a = useState(false), navOpen = _a[0], setNavOpen = _a[1];
29
+ // The person opened the history from the task header. The example starts with the pane open.
30
+ var _b = useState(true), open = _b[0], setOpen = _b[1];
31
+ var pane = useRef(null);
32
+ return (<AppShell title="Tasks" navOpen={navOpen} onNavOpenChange={setNavOpen} sidebar={sidebar} pane={open && (<SidePane ref={pane} title="History" onClose={function () { return setOpen(false); }}>
33
+ {/* A real app shows Skeleton rows while it loads, the case 'Load failure' if it fails, and EmptyBox when there is nothing yet. */}
34
+ <Timeline id="activity-timeline-events" aria-label={"History of ".concat(task)} items={events}/>
35
+ </SidePane>)}>
36
+ <Stack gap="large">
37
+ <TitleBar title={task} actions={<Tooltip title="History">
38
+ <IconButton color="iconOnly" state={open ? 'selected' : 'enabled'} size="medium" iconName="History" ariaLabel={"Show the history of ".concat(task)} aria-expanded={open} onClick={function () { var _a; return (open ? (_a = pane.current) === null || _a === void 0 ? void 0 : _a.focus() : setOpen(true)); }}/>
39
+ </Tooltip>}/>
40
+ <Paragraph tone="secondary" measure="none">Acme Agent opened a pull request for the new home page. One check failed.</Paragraph>
41
+ </Stack>
42
+ </AppShell>);
43
+ }
@@ -0,0 +1 @@
1
+ export default function ActivityTimelineVersions(): import("react").JSX.Element;
@@ -0,0 +1,130 @@
1
+ 'use client';
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
+ if (ar || !(i in from)) {
16
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
+ ar[i] = from[i];
18
+ }
19
+ }
20
+ return to.concat(ar || Array.prototype.slice.call(from));
21
+ };
22
+ import { useEffect, useRef, useState } from 'react';
23
+ import AppShell from '../../components/appShell';
24
+ import SidePane from '../../components/sidePane';
25
+ import Navigation from '../../components/navigation';
26
+ import MenuItem from '../../components/menuItem';
27
+ import TitleBar from '../../components/titleBar';
28
+ import IconButton from '../../components/iconButton';
29
+ import Tooltip from '../../components/tooltip';
30
+ import Timeline from '../../components/timeline';
31
+ import Heading from '../../components/heading';
32
+ import Paragraph from '../../components/paragraph';
33
+ import List from '../../components/list';
34
+ import Line from '../../components/line';
35
+ import Button from '../../components/button';
36
+ import Modal from '../../components/modal';
37
+ import Alert from '../../components/alert';
38
+ import { Cluster, Stack } from '../../components/layout';
39
+ var task = 'Launch checklist';
40
+ // The plan's saved versions, newest first. The newest is the current plan.
41
+ var firstVersions = [
42
+ { id: 'v5', title: 'Moved the launch to Nov 20, 2026', when: 'Nov 16, 2026, 2:40 PM', dateTime: '2026-11-16T14:40', by: 'Dana Lee', steps: ['Update the home page and its tests.', 'Write the new copy.', 'Check the screens on a phone.', 'Merge on Nov 20, 2026.'] },
43
+ { id: 'v4', title: 'Added a check on a phone', when: 'Nov 16, 2026, 9:10 AM', dateTime: '2026-11-16T09:10', by: 'Acme Agent', agent: true, steps: ['Update the home page and its tests.', 'Write the new copy.', 'Check the screens on a phone.', 'Merge on Nov 18, 2026.'] },
44
+ { id: 'v3', title: 'Gave the copy to Omar Reyes', when: 'Nov 15, 2026, 5:45 PM', dateTime: '2026-11-15T17:45', by: 'Ben Carter', steps: ['Update the home page and its tests.', 'Write the new copy.', 'Merge on Nov 18, 2026.'] },
45
+ { id: 'v2', title: 'Split the release into two steps', when: 'Nov 15, 2026, 1:00 PM', dateTime: '2026-11-15T13:00', by: 'Acme Agent', agent: true, steps: ['Update the home page.', 'Merge on Nov 18, 2026.'] },
46
+ { id: 'v1', title: 'Wrote the first plan', when: 'Nov 14, 2026, 10:20 AM', dateTime: '2026-11-14T10:20', by: 'Acme Agent', agent: true, steps: ['Update the home page and merge it.'] },
47
+ ];
48
+ // The places. A real app lets each link go to its page.
49
+ var sidebar = (<Navigation aria-label="Main">
50
+ <MenuItem size="small" label="Tasks" iconName="ListChecks" href="/tasks" isSelected aria-current="page" onClick={function (event) { return event.preventDefault(); }}/>
51
+ </Navigation>);
52
+ export default function ActivityTimelineVersions() {
53
+ var _a;
54
+ var _b = useState(false), navOpen = _b[0], setNavOpen = _b[1];
55
+ // The person opened the history from the task header and chose a version. The example starts there.
56
+ var _c = useState(true), open = _c[0], setOpen = _c[1];
57
+ var _d = useState(firstVersions), versions = _d[0], setVersions = _d[1];
58
+ var _e = useState('v4'), selectedId = _e[0], setSelectedId = _e[1];
59
+ var _f = useState(false), confirming = _f[0], setConfirming = _f[1];
60
+ var _g = useState(false), restoring = _g[0], setRestoring = _g[1];
61
+ var _h = useState(null), restored = _h[0], setRestored = _h[1];
62
+ var pane = useRef(null);
63
+ var timer = useRef();
64
+ // On unmount it stops the request.
65
+ useEffect(function () { return function () { return clearTimeout(timer.current); }; }, []);
66
+ var current = versions[0];
67
+ var chosen = (_a = versions.find(function (v) { return v.id === selectedId; })) !== null && _a !== void 0 ? _a : current;
68
+ // While the request runs, Escape and Cancel do nothing.
69
+ function keepCurrent() {
70
+ if (restoring)
71
+ return;
72
+ setConfirming(false);
73
+ }
74
+ // The current plan stays as a version. The restore is a new version on top, marked Current.
75
+ // The Modal gives focus back to 'Restore This Version', which stays: the chosen version is not the current one.
76
+ function restore() {
77
+ if (restoring)
78
+ return;
79
+ setRestoring(true);
80
+ // Stands in for the request to the server.
81
+ timer.current = setTimeout(function () {
82
+ setRestoring(false);
83
+ setConfirming(false);
84
+ setVersions(function (list) { return __spreadArray([
85
+ __assign(__assign({}, chosen), { id: "v".concat(list.length + 1), title: "Restored the version from ".concat(chosen.when), when: 'Nov 16, 2026, 2:55 PM', dateTime: '2026-11-16T14:55', by: 'Dana Lee', agent: false })
86
+ ], list, true); });
87
+ setRestored(chosen.when);
88
+ }, 1200);
89
+ }
90
+ return (<AppShell title="Tasks" navOpen={navOpen} onNavOpenChange={setNavOpen} sidebar={sidebar} pane={open && (<SidePane ref={pane} title="History" onClose={function () { return setOpen(false); }}>
91
+ <Stack gap="large">
92
+ {restored && (
93
+ // An inline Alert is a polite status, so a screen reader hears it.
94
+ <Alert variant="inline" type="success" autoDismiss={false} message={"Restored the version from ".concat(restored, ".")}/>)}
95
+ <Timeline id="activity-timeline-versions" aria-label={"Versions of the plan for ".concat(task)} items={versions.map(function (v, i) { return ({
96
+ id: v.id,
97
+ title: v.title,
98
+ when: v.when,
99
+ dateTime: v.dateTime,
100
+ actor: { name: v.by, agent: v.agent },
101
+ tag: i === 0 ? { label: 'Current' } : undefined,
102
+ }); })} selectedId={chosen.id} onSelect={setSelectedId}/>
103
+ <Line />
104
+ {/* The chosen version, under the list. */}
105
+ <Stack gap="medium">
106
+ <Stack gap="small">
107
+ <Heading level={3} size="subtitle1">{chosen.title}</Heading>
108
+ <Paragraph size="body2" tone="secondary" measure="none">Saved by {chosen.by}, {chosen.when}</Paragraph>
109
+ </Stack>
110
+ <List marker="number" items={chosen.steps}/>
111
+ {chosen.id !== current.id && (<Cluster>
112
+ <Button size="small" type="secondary" state="enabled" label="Restore This Version" onClickButton={function () { return setConfirming(true); }}/>
113
+ </Cluster>)}
114
+ </Stack>
115
+ </Stack>
116
+ </SidePane>)}>
117
+ <Stack gap="large">
118
+ <TitleBar title={task} actions={<Tooltip title="History">
119
+ <IconButton color="iconOnly" state={open ? 'selected' : 'enabled'} size="medium" iconName="History" ariaLabel={"Show the history of ".concat(task)} aria-expanded={open} onClick={function () { var _a; return (open ? (_a = pane.current) === null || _a === void 0 ? void 0 : _a.focus() : setOpen(true)); }}/>
120
+ </Tooltip>}/>
121
+ <Paragraph tone="secondary" measure="none">The plan for this task has {versions.length} saved versions.</Paragraph>
122
+ </Stack>
123
+ <Modal isOpen={confirming} size="small" title="Restore Version" onClose={keepCurrent} actions={<>
124
+ <Button size="small" type="tertiary" state={restoring ? 'disabled' : 'enabled'} label="Cancel" onClickButton={keepCurrent}/>
125
+ <Button size="small" type="primary" state="enabled" label="Restore" loading={restoring} onClickButton={restore}/>
126
+ </>}>
127
+ <Paragraph measure="none">This makes the version from {chosen.when} the current plan, and everyone signs it off again. Your current plan is kept as a version.</Paragraph>
128
+ </Modal>
129
+ </AppShell>);
130
+ }