oneslash-design-system 2.18.0 → 2.19.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 (118) hide show
  1. package/README.md +1 -1
  2. package/dist/DESIGN.md +26 -1
  3. package/dist/cases/app-shell/sidebar.d.ts +1 -0
  4. package/dist/cases/app-shell/sidebar.jsx +124 -0
  5. package/dist/cases/app-shell/top-tabs.d.ts +1 -0
  6. package/dist/cases/app-shell/top-tabs.jsx +106 -0
  7. package/dist/cases/app-shell.md +364 -0
  8. package/dist/cases/artifact-card/card.jsx +32 -6
  9. package/dist/cases/artifact-card.md +55 -7
  10. package/dist/cases/error-page/in-shell.jsx +26 -17
  11. package/dist/cases/error-page.md +42 -21
  12. package/dist/cases/master-detail/list-then-page.d.ts +1 -0
  13. package/dist/cases/master-detail/list-then-page.jsx +65 -0
  14. package/dist/cases/master-detail/split.d.ts +1 -0
  15. package/dist/cases/master-detail/split.jsx +49 -0
  16. package/dist/cases/master-detail.md +213 -0
  17. package/dist/cases/mobile-menu/links.d.ts +1 -0
  18. package/dist/cases/mobile-menu/links.jsx +24 -0
  19. package/dist/cases/mobile-menu/sections.d.ts +1 -0
  20. package/dist/cases/mobile-menu/sections.jsx +61 -0
  21. package/dist/cases/mobile-menu.md +170 -0
  22. package/dist/cases/not-found-page/in-shell.jsx +26 -17
  23. package/dist/cases/not-found-page.md +41 -20
  24. package/dist/cases/on-this-page/aside.d.ts +1 -0
  25. package/dist/cases/on-this-page/aside.jsx +39 -0
  26. package/dist/cases/on-this-page.md +80 -0
  27. package/dist/cases/page-header/actions.d.ts +1 -0
  28. package/dist/cases/page-header/actions.jsx +65 -0
  29. package/dist/cases/page-header/sub-page.d.ts +1 -0
  30. package/dist/cases/page-header/sub-page.jsx +37 -0
  31. package/dist/cases/page-header.md +195 -0
  32. package/dist/cases/phone-navigation.md +32 -0
  33. package/dist/cases/route-loading/region.jsx +27 -18
  34. package/dist/cases/route-loading.md +42 -21
  35. package/dist/cases/side-pane/beside.d.ts +1 -0
  36. package/dist/cases/side-pane/beside.jsx +79 -0
  37. package/dist/cases/side-pane/over.d.ts +1 -0
  38. package/dist/cases/side-pane/over.jsx +58 -0
  39. package/dist/cases/side-pane.md +238 -0
  40. package/dist/cases/sidebar-nav/flat.d.ts +1 -0
  41. package/dist/cases/sidebar-nav/flat.jsx +81 -0
  42. package/dist/cases/sidebar-nav/nested.d.ts +1 -0
  43. package/dist/cases/sidebar-nav/nested.jsx +122 -0
  44. package/dist/cases/sidebar-nav.md +261 -0
  45. package/dist/cases/site-footer/columns.d.ts +1 -0
  46. package/dist/cases/site-footer/columns.jsx +51 -0
  47. package/dist/cases/site-footer/simple.d.ts +1 -0
  48. package/dist/cases/site-footer/simple.jsx +24 -0
  49. package/dist/cases/site-footer.md +133 -0
  50. package/dist/cases/site-header/links.d.ts +1 -0
  51. package/dist/cases/site-header/links.jsx +26 -0
  52. package/dist/cases/site-header/sections.d.ts +1 -0
  53. package/dist/cases/site-header/sections.jsx +64 -0
  54. package/dist/cases/site-header.md +183 -0
  55. package/dist/cases/theme-switcher/menu.d.ts +1 -0
  56. package/dist/cases/theme-switcher/menu.jsx +47 -0
  57. package/dist/cases/theme-switcher/segmented.d.ts +1 -0
  58. package/dist/cases/theme-switcher/segmented.jsx +26 -0
  59. package/dist/cases/theme-switcher.md +149 -0
  60. package/dist/cases.json +666 -19
  61. package/dist/components/appShell.d.ts +44 -0
  62. package/dist/components/appShell.jsx +121 -0
  63. package/dist/components/drawer.d.ts +31 -0
  64. package/dist/components/drawer.jsx +121 -0
  65. package/dist/components/heading.d.ts +3 -1
  66. package/dist/components/heading.jsx +2 -2
  67. package/dist/components/link.d.ts +6 -1
  68. package/dist/components/link.jsx +11 -3
  69. package/dist/components/menuItem.d.ts +7 -1
  70. package/dist/components/menuItem.jsx +4 -3
  71. package/dist/components/modal.jsx +12 -23
  72. package/dist/components/onThisPage.d.ts +29 -0
  73. package/dist/components/onThisPage.jsx +151 -0
  74. package/dist/components/pageShell.d.ts +7 -1
  75. package/dist/components/pageShell.jsx +14 -1
  76. package/dist/components/popover.jsx +4 -0
  77. package/dist/components/settingsSection.d.ts +6 -1
  78. package/dist/components/settingsSection.jsx +10 -3
  79. package/dist/components/sidePane.d.ts +32 -0
  80. package/dist/components/sidePane.jsx +128 -0
  81. package/dist/components/siteFooter.d.ts +24 -0
  82. package/dist/components/siteFooter.jsx +48 -0
  83. package/dist/components/siteHeader.d.ts +55 -0
  84. package/dist/components/siteHeader.jsx +125 -0
  85. package/dist/components/titleBar.d.ts +17 -0
  86. package/dist/components/titleBar.jsx +17 -0
  87. package/dist/index.d.ts +7 -0
  88. package/dist/index.js +7 -0
  89. package/dist/internal/overlayStack.d.ts +24 -0
  90. package/dist/internal/overlayStack.js +71 -0
  91. package/dist/internal/resize.d.ts +9 -0
  92. package/dist/internal/resize.js +31 -0
  93. package/dist/internal/scrollSpy.d.ts +24 -0
  94. package/dist/internal/scrollSpy.js +53 -0
  95. package/dist/internal/siteBrand.d.ts +6 -0
  96. package/dist/internal/siteBrand.jsx +11 -0
  97. package/dist/native-mapping.json +43 -1
  98. package/dist/stories/AppShell.stories.d.ts +15 -0
  99. package/dist/stories/AppShell.stories.jsx +137 -0
  100. package/dist/stories/Cases.generated.stories.d.ts +19 -0
  101. package/dist/stories/Cases.generated.stories.jsx +38 -0
  102. package/dist/stories/Drawer.stories.d.ts +10 -0
  103. package/dist/stories/Drawer.stories.jsx +123 -0
  104. package/dist/stories/Link.stories.d.ts +1 -0
  105. package/dist/stories/Link.stories.jsx +8 -0
  106. package/dist/stories/OnThisPage.stories.d.ts +10 -0
  107. package/dist/stories/OnThisPage.stories.jsx +105 -0
  108. package/dist/stories/SettingsSection.stories.d.ts +1 -0
  109. package/dist/stories/SettingsSection.stories.jsx +27 -0
  110. package/dist/stories/SidePane.stories.d.ts +6 -0
  111. package/dist/stories/SidePane.stories.jsx +37 -0
  112. package/dist/stories/SiteFooter.stories.d.ts +7 -0
  113. package/dist/stories/SiteFooter.stories.jsx +63 -0
  114. package/dist/stories/SiteHeader.stories.d.ts +10 -0
  115. package/dist/stories/SiteHeader.stories.jsx +94 -0
  116. package/dist/stories/TitleBar.stories.d.ts +6 -0
  117. package/dist/stories/TitleBar.stories.jsx +34 -0
  118. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import SidePane from "../components/sidePane";
3
+ declare const meta: Meta<typeof SidePane>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SidePane>;
6
+ export declare const Resizable: Story;
@@ -0,0 +1,37 @@
1
+ import React, { useState } from "react";
2
+ import SidePane from "../components/sidePane";
3
+ import IconButton from "../components/iconButton";
4
+ import Paragraph from "../components/paragraph";
5
+ import TitleBar from "../components/titleBar";
6
+ var meta = {
7
+ title: "Components/SidePane",
8
+ component: SidePane,
9
+ parameters: { layout: "fullscreen" },
10
+ };
11
+ export default meta;
12
+ // A page with a document open beside it. From lg up the pane's start edge is a handle: drag it, or
13
+ // focus it and press the arrow keys (16px a step), Home and End.
14
+ function ResizableBox() {
15
+ var _a = useState(true), open = _a[0], setOpen = _a[1];
16
+ var _b = useState(448), width = _b[0], setWidth = _b[1];
17
+ return (<div style={{ margin: "-1rem", display: "flex", height: "100dvh" }}>
18
+ {/* Below lg the open pane takes the page's place, as in AppShell */}
19
+ <div style={{ flex: 1, minWidth: 0, padding: "24px" }} className={open ? "hidden lg:block" : undefined}>
20
+ <TitleBar title="Launch plan" actions={<IconButton color="iconOnly" state={open ? "selected" : "enabled"} size="medium" iconName="FileText" ariaLabel="Brief" aria-expanded={open} onClick={function () { return setOpen(true); }}/>}/>
21
+ <div style={{ marginTop: "16px" }}>
22
+ <Paragraph tone="secondary">Ben Carter: the brief is in the pane. Leave notes on anything that needs a change.</Paragraph>
23
+ </div>
24
+ </div>
25
+ {open && (<SidePane title="Brief" onClose={function () { return setOpen(false); }} width={width} onWidthChange={setWidth}>
26
+ <div style={{ display: "flex", flexDirection: "column", gap: "12px" }}>
27
+ <Paragraph measure="none">Acme ships the new home page on Friday. Omar Reyes owns the copy and Dana Lee the screens.</Paragraph>
28
+ <Paragraph measure="none" tone="secondary">The pane stays beside the page, so the thread and the brief read together.</Paragraph>
29
+ </div>
30
+ </SidePane>)}
31
+ </div>);
32
+ }
33
+ // Also shot at 375px by tests/stories.spec.ts (the "shell" tag): there the pane takes the whole width
34
+ export var Resizable = {
35
+ tags: ["shell"],
36
+ render: function () { return <ResizableBox />; },
37
+ };
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import SiteFooter from "../components/siteFooter";
3
+ declare const meta: Meta<typeof SiteFooter>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SiteFooter>;
6
+ export declare const Columns: Story;
7
+ export declare const Simple: Story;
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import SiteFooter from "../components/siteFooter";
3
+ var meta = {
4
+ title: "Components/SiteFooter",
5
+ component: SiteFooter,
6
+ parameters: { layout: "fullscreen" },
7
+ };
8
+ export default meta;
9
+ var Bleed = function (_a) {
10
+ var children = _a.children;
11
+ return <div style={{ margin: "-1rem" }}>{children}</div>;
12
+ };
13
+ var brand = { href: "/", name: "Acme" };
14
+ var columns = [
15
+ {
16
+ title: "Product",
17
+ links: [
18
+ { label: "Features", href: "#features" },
19
+ { label: "Pricing", href: "#pricing" },
20
+ { label: "Changelog", href: "#changelog" },
21
+ ],
22
+ },
23
+ {
24
+ title: "Company",
25
+ links: [
26
+ { label: "About", href: "#about" },
27
+ { label: "Careers", href: "#careers" },
28
+ { label: "Contact", href: "#contact" },
29
+ ],
30
+ },
31
+ {
32
+ title: "Resources",
33
+ links: [
34
+ { label: "Documentation", href: "#documentation" },
35
+ { label: "Status", href: "https://status.example.com", external: true },
36
+ ],
37
+ },
38
+ {
39
+ title: "Legal",
40
+ links: [
41
+ { label: "Privacy", href: "#privacy" },
42
+ { label: "Terms of Use", href: "#terms" },
43
+ ],
44
+ },
45
+ ];
46
+ // Also shot at 375px by tests/stories.spec.ts (the "shell" tag): two columns across
47
+ export var Columns = {
48
+ tags: ["shell"],
49
+ render: function () { return (<Bleed>
50
+ <SiteFooter brand={brand} columns={columns} legal="© 2026 Acme"/>
51
+ </Bleed>); },
52
+ };
53
+ export var Simple = {
54
+ tags: ["shell"],
55
+ render: function () { return (<Bleed>
56
+ <SiteFooter links={[
57
+ { label: "Privacy", href: "#privacy" },
58
+ { label: "Terms of Use", href: "#terms" },
59
+ { label: "Status", href: "https://status.example.com", external: true },
60
+ { label: "Contact", href: "#contact" },
61
+ ]} legal="© 2026 Acme"/>
62
+ </Bleed>); },
63
+ };
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import SiteHeader from "../components/siteHeader";
3
+ declare const meta: Meta<typeof SiteHeader>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SiteHeader>;
6
+ export declare const Links: Story;
7
+ export declare const Phone: Story;
8
+ export declare const LongLabels: Story;
9
+ export declare const Probe: Story;
10
+ export declare const UnmountProbe: Story;
@@ -0,0 +1,94 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import SiteHeader from "../components/siteHeader";
3
+ import Button from "../components/button";
4
+ import Paragraph from "../components/paragraph";
5
+ var meta = {
6
+ title: "Components/SiteHeader",
7
+ component: SiteHeader,
8
+ parameters: { layout: "fullscreen" },
9
+ };
10
+ export default meta;
11
+ // The story frame pads its content; a site header is the top of a page, so it takes the padding back
12
+ var Bleed = function (_a) {
13
+ var children = _a.children;
14
+ return <div style={{ margin: "-1rem" }}>{children}</div>;
15
+ };
16
+ // A square mark for Acme, inline so the story needs no network
17
+ var logo = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='28' viewBox='0 0 96 28'%3E%3Crect width='28' height='28' rx='7' fill='%23336' /%3E%3Ctext x='36' y='21' font-family='sans-serif' font-size='18' font-weight='700' fill='%23336'%3EAcme%3C/text%3E%3C/svg%3E";
18
+ var brand = { href: "/", name: "Acme", src: logo, width: 96, height: 28 };
19
+ var links = [
20
+ { label: "Features", href: "#features", current: true },
21
+ { label: "Pricing", href: "#pricing" },
22
+ { label: "Documentation", href: "#documentation" },
23
+ { label: "Changelog", href: "#changelog" },
24
+ { label: "Company", href: "#company" },
25
+ ];
26
+ // Log In is secondary: in the menu below md. Sign Up is the main action: in the bar at every width.
27
+ var actions = <Button size="medium" type="tertiary" state="enabled" label="Log In" href="#log-in"/>;
28
+ var phoneAction = <Button size="medium" type="primary" state="enabled" label="Sign Up" href="#sign-up"/>;
29
+ var longLinks = [
30
+ { label: "Product Features", href: "#features", current: true },
31
+ { label: "Pricing and Plans", href: "#pricing" },
32
+ { label: "Documentation", href: "#documentation" },
33
+ { label: "Release Changelog", href: "#changelog" },
34
+ { label: "About the Company", href: "#company" },
35
+ ];
36
+ var Page = function () { return (<div style={{ padding: "24px", display: "flex", flexDirection: "column", gap: "12px" }}>
37
+ <Paragraph tone="secondary">Ship the launch plan this week. Ben Carter has the new screens.</Paragraph>
38
+ </div>); };
39
+ // Also shot at 375px by tests/stories.spec.ts (the "shell" tag): the brand, Menu and one action in the bar
40
+ export var Links = {
41
+ tags: ["shell"],
42
+ render: function () { return (<Bleed>
43
+ <SiteHeader brand={brand} links={links} actions={actions} phoneAction={phoneAction}/>
44
+ <Page />
45
+ </Bleed>); },
46
+ };
47
+ // Opens the menu once the page is up, so the story shows it
48
+ var OpenMenu = function (_a) {
49
+ var children = _a.children;
50
+ useEffect(function () {
51
+ var _a;
52
+ (_a = document.querySelector('button[aria-label="Menu"]')) === null || _a === void 0 ? void 0 : _a.click();
53
+ }, []);
54
+ return <>{children}</>;
55
+ };
56
+ // Shot at 375px only (the "phone" tag): the menu open, with the links and the other action
57
+ export var Phone = {
58
+ tags: ["phone"],
59
+ render: function () { return (<Bleed>
60
+ <OpenMenu>
61
+ <SiteHeader brand={brand} links={links} actions={actions} phoneAction={phoneAction}/>
62
+ <Page />
63
+ </OpenMenu>
64
+ </Bleed>); },
65
+ };
66
+ // Shot at 768px only (the "tablet" tag): the full bar from md, with long labels
67
+ export var LongLabels = {
68
+ tags: ["tablet"],
69
+ render: function () { return (<Bleed>
70
+ <SiteHeader brand={brand} links={longLinks} actions={actions} phoneAction={phoneAction}/>
71
+ <Page />
72
+ </Bleed>); },
73
+ };
74
+ // For tests/interactions.spec.ts only: five links with long labels and two actions, checked at 375px and 768px
75
+ export var Probe = {
76
+ tags: ["!dev", "!autodocs", "test-only"],
77
+ render: function () { return (<Bleed>
78
+ <SiteHeader brand={brand} links={longLinks} actions={actions} phoneAction={phoneAction}/>
79
+ <main id="main" tabIndex={-1}>
80
+ <Page />
81
+ </main>
82
+ </Bleed>); },
83
+ };
84
+ // For tests/interactions.spec.ts only: a Button that removes the header, so the test sees --os-header-offset go with it
85
+ export var UnmountProbe = {
86
+ tags: ["!dev", "!autodocs", "test-only"],
87
+ render: function Render() {
88
+ var _a = useState(true), shown = _a[0], setShown = _a[1];
89
+ return (<Bleed>
90
+ {shown && <SiteHeader brand={brand} links={links}/>}
91
+ <Button size="medium" type="secondary" state="enabled" label="Remove Header" onClickButton={function () { return setShown(false); }}/>
92
+ </Bleed>);
93
+ },
94
+ };
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import TitleBar from "../components/titleBar";
3
+ declare const meta: Meta<typeof TitleBar>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof TitleBar>;
6
+ export declare const Actions: Story;
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import TitleBar from "../components/titleBar";
3
+ import Button from "../components/button";
4
+ import IconButton from "../components/iconButton";
5
+ import Tooltip from "../components/tooltip";
6
+ var meta = {
7
+ title: "Components/TitleBar",
8
+ component: TitleBar,
9
+ };
10
+ export default meta;
11
+ var more = <IconButton color="iconOnly" state="enabled" size="medium" iconName="MoreHorizontal" ariaLabel="More" aria-haspopup="menu"/>;
12
+ var newTask = <Button size="medium" type="primary" state="enabled" label="New Task" decoIcon="Plus"/>;
13
+ // A page's own actions: the primary Button, icon buttons with Tooltips, More last. Below md
14
+ // phoneActions keep the primary and fold the rest into More. A sub-page has Back, and a long title wraps.
15
+ // Also shot at 375px by tests/stories.spec.ts (the "shell" tag).
16
+ export var Actions = {
17
+ tags: ["shell"],
18
+ render: function () { return (<div style={{ display: "flex", flexDirection: "column", gap: "32px", maxWidth: 880 }}>
19
+ <TitleBar title="Website" actions={<>
20
+ {newTask}
21
+ <Tooltip title="Search">
22
+ <IconButton color="iconOnly" state="enabled" size="medium" iconName="Search" ariaLabel="Search"/>
23
+ </Tooltip>
24
+ <Tooltip title="Filter">
25
+ <IconButton color="iconOnly" state="enabled" size="medium" iconName="Filter" ariaLabel="Filter"/>
26
+ </Tooltip>
27
+ {more}
28
+ </>} phoneActions={<>
29
+ {newTask}
30
+ {more}
31
+ </>}/>
32
+ <TitleBar title="Move the sign-up form above the pricing table on the home page" back={<Button size="small" type="tertiary" state="enabled" label="Back to Website" decoIcon="ChevronLeft"/>} actions={more}/>
33
+ </div>); },
34
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oneslash-design-system",
3
3
  "description": "A design system for the Oneslash projects",
4
- "version": "2.18.0",
4
+ "version": "2.19.0",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "./dist/index.js",