@skipleague/design 0.8.0 → 0.9.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 CHANGED
@@ -49,7 +49,7 @@ SkipToday/SkipEvolve launch), update `src/apps.ts` — every app's menu follows.
49
49
 
50
50
  ## Exports
51
51
 
52
- - `ProfileMenu`, `AppBadge`, `AppLogo`, `TopBar`, `TopBarIconButton`, `ShareMenu`
52
+ - `ProfileMenu`, `AppBadge`, `AppLogo`, `TopBar`, `TopBarIconButton`, `TopBarBackButton`, `ShareMenu`
53
53
  - `Button`, `Card`, `Field`, `Input`, `Select`
54
54
  - `SKIPLEAGUE_APPS`, `SKIPLEAGUE_ACCOUNT_URL`, type `AppLink`
55
55
  - `@skipleague/design/tokens.css` — the design tokens (CSS variables)
@@ -49,6 +49,11 @@ const CSS = `
49
49
  grid-template-columns: 236px 1fr 340px;
50
50
  grid-template-areas: "top top top" "nav main detail";
51
51
  }
52
+ /* Views without a detail panel: drop the docked column (sidebar + content only). */
53
+ .skl-shell--no-detail {
54
+ grid-template-columns: 236px 1fr;
55
+ grid-template-areas: "top top" "nav main";
56
+ }
52
57
  .skl-shell__rail { display: none; }
53
58
  .skl-shell__sidebar { grid-area: nav; display: block; border-right: 1px solid var(--skl-color-border); }
54
59
  .skl-shell__detail {
@@ -77,5 +82,5 @@ const CSS = `
77
82
  * scrolls internally.
78
83
  */
79
84
  export function ResponsiveShell({ topBar, main, bottomNav, rail, sidebar, detail, detailOpen = false, id, }) {
80
- return (_jsxs("div", { className: "skl-shell", id: id, children: [_jsx("style", { children: CSS }), _jsx("div", { className: "skl-shell__top", children: topBar }), sidebar && _jsx("div", { className: "skl-shell__sidebar", children: sidebar }), rail && _jsx("div", { className: "skl-shell__rail", children: rail }), _jsx("div", { className: "skl-shell__main", children: main }), detail && _jsx("div", { className: `skl-shell__detail${detailOpen ? " is-open" : ""}`, children: detail }), bottomNav && _jsx("div", { className: "skl-shell__bottom", children: bottomNav })] }));
85
+ return (_jsxs("div", { className: `skl-shell${detail ? "" : " skl-shell--no-detail"}`, id: id, children: [_jsx("style", { children: CSS }), _jsx("div", { className: "skl-shell__top", children: topBar }), sidebar && _jsx("div", { className: "skl-shell__sidebar", children: sidebar }), rail && _jsx("div", { className: "skl-shell__rail", children: rail }), _jsx("div", { className: "skl-shell__main", children: main }), detail && _jsx("div", { className: `skl-shell__detail${detailOpen ? " is-open" : ""}`, children: detail }), bottomNav && _jsx("div", { className: "skl-shell__bottom", children: bottomNav })] }));
81
86
  }
package/dist/TopBar.d.ts CHANGED
@@ -54,6 +54,23 @@ export declare function TopBarIconButton({ tone, compact, style, children, ...pr
54
54
  tone?: TopBarTone;
55
55
  compact?: boolean;
56
56
  }): import("react").JSX.Element;
57
+ /**
58
+ * The Back affordance for a drill-in / detail screen's app bar — a
59
+ * {@link TopBarIconButton} carrying a left chevron, so every app's back button
60
+ * looks and behaves identically (same tone-aware ghost styling as Search,
61
+ * Share, ProfileMenu, etc.). Pair it with the app's router, e.g.
62
+ * `<TopBarBackButton onClick={() => navigate(-1)} />`.
63
+ *
64
+ * Works on both a full {@link TopBar} (pass it via `actions`, though back
65
+ * usually sits on the LEFT — apps that build a contextual detail header place it
66
+ * directly) and a bespoke contextual header.
67
+ */
68
+ export declare function TopBarBackButton({ tone, compact, label, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
69
+ tone?: TopBarTone;
70
+ compact?: boolean;
71
+ /** Accessible label + tooltip (default "Back"). */
72
+ label?: string;
73
+ }): import("react").JSX.Element;
57
74
  /**
58
75
  * Alias for {@link TopBar} under its platform-app-bar name. Same component,
59
76
  * same props — use whichever import name the app standardizes on.
package/dist/TopBar.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
- import { Inbox, MoreHorizontal, Search, Upload, Users } from "lucide-react";
3
+ import { ChevronLeft, Inbox, MoreHorizontal, Search, Upload, Users } from "lucide-react";
4
4
  import { AppLogo } from "./AppLogo.js";
5
5
  import { ProfileMenu } from "./ProfileMenu.js";
6
6
  /**
@@ -92,6 +92,20 @@ export function TopBarIconButton({ tone = "dark", compact = false, style, childr
92
92
  ...style,
93
93
  }, ...props, children: children }));
94
94
  }
95
+ /**
96
+ * The Back affordance for a drill-in / detail screen's app bar — a
97
+ * {@link TopBarIconButton} carrying a left chevron, so every app's back button
98
+ * looks and behaves identically (same tone-aware ghost styling as Search,
99
+ * Share, ProfileMenu, etc.). Pair it with the app's router, e.g.
100
+ * `<TopBarBackButton onClick={() => navigate(-1)} />`.
101
+ *
102
+ * Works on both a full {@link TopBar} (pass it via `actions`, though back
103
+ * usually sits on the LEFT — apps that build a contextual detail header place it
104
+ * directly) and a bespoke contextual header.
105
+ */
106
+ export function TopBarBackButton({ tone = "dark", compact = false, label = "Back", ...props }) {
107
+ return (_jsx(TopBarIconButton, { tone: tone, compact: compact, "aria-label": label, title: label, ...props, children: _jsx(ChevronLeft, { size: 20 }) }));
108
+ }
95
109
  /**
96
110
  * Alias for {@link TopBar} under its platform-app-bar name. Same component,
97
111
  * same props — use whichever import name the app standardizes on.
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export type { ProfileMenuProps, ProfileMenuUser, ProfileMenuLinkArgs } from "./P
3
3
  export { AppBadge } from "./AppBadge.js";
4
4
  export { AppLogo, APP_GLYPHS, appGlyphForSlug } from "./AppLogo.js";
5
5
  export type { AppGlyph } from "./AppLogo.js";
6
- export { TopBar, TopBarIconButton, DesktopActionBar } from "./TopBar.js";
6
+ export { TopBar, TopBarIconButton, TopBarBackButton, DesktopActionBar } from "./TopBar.js";
7
7
  export type { TopBarTone } from "./TopBar.js";
8
8
  export { SidebarNav } from "./SidebarNav.js";
9
9
  export type { SidebarNavProps, SidebarNavSection, SidebarNavItem, SidebarNavLinkArgs } from "./SidebarNav.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { ProfileMenu } from "./ProfileMenu.js";
2
2
  export { AppBadge } from "./AppBadge.js";
3
3
  export { AppLogo, APP_GLYPHS, appGlyphForSlug } from "./AppLogo.js";
4
- export { TopBar, TopBarIconButton, DesktopActionBar } from "./TopBar.js";
4
+ export { TopBar, TopBarIconButton, TopBarBackButton, DesktopActionBar } from "./TopBar.js";
5
5
  export { SidebarNav } from "./SidebarNav.js";
6
6
  export { IconRail } from "./IconRail.js";
7
7
  export { ResponsiveShell, RESPONSIVE_SHELL_DETAIL_BACK_CLASS } from "./ResponsiveShell.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skipleague/design",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "SkipUI — the SkipLeague design system: shared tokens and React components for every SkipLeague app.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -70,6 +70,11 @@ const CSS = `
70
70
  grid-template-columns: 236px 1fr 340px;
71
71
  grid-template-areas: "top top top" "nav main detail";
72
72
  }
73
+ /* Views without a detail panel: drop the docked column (sidebar + content only). */
74
+ .skl-shell--no-detail {
75
+ grid-template-columns: 236px 1fr;
76
+ grid-template-areas: "top top" "nav main";
77
+ }
73
78
  .skl-shell__rail { display: none; }
74
79
  .skl-shell__sidebar { grid-area: nav; display: block; border-right: 1px solid var(--skl-color-border); }
75
80
  .skl-shell__detail {
@@ -109,7 +114,7 @@ export function ResponsiveShell({
109
114
  id,
110
115
  }: ResponsiveShellProps) {
111
116
  return (
112
- <div className="skl-shell" id={id}>
117
+ <div className={`skl-shell${detail ? "" : " skl-shell--no-detail"}`} id={id}>
113
118
  <style>{CSS}</style>
114
119
  <div className="skl-shell__top">{topBar}</div>
115
120
  {sidebar && <div className="skl-shell__sidebar">{sidebar}</div>}
package/src/TopBar.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useState, type ButtonHTMLAttributes, type CSSProperties, type ReactNode } from "react";
2
- import { Inbox, MoreHorizontal, Search, Upload, Users, type LucideIcon } from "lucide-react";
2
+ import { ChevronLeft, Inbox, MoreHorizontal, Search, Upload, Users, type LucideIcon } from "lucide-react";
3
3
 
4
4
  import { AppLogo, type AppGlyph } from "./AppLogo.js";
5
5
  import { ProfileMenu, type ProfileMenuProps } from "./ProfileMenu.js";
@@ -184,6 +184,41 @@ export function TopBarIconButton({
184
184
  );
185
185
  }
186
186
 
187
+ /**
188
+ * The Back affordance for a drill-in / detail screen's app bar — a
189
+ * {@link TopBarIconButton} carrying a left chevron, so every app's back button
190
+ * looks and behaves identically (same tone-aware ghost styling as Search,
191
+ * Share, ProfileMenu, etc.). Pair it with the app's router, e.g.
192
+ * `<TopBarBackButton onClick={() => navigate(-1)} />`.
193
+ *
194
+ * Works on both a full {@link TopBar} (pass it via `actions`, though back
195
+ * usually sits on the LEFT — apps that build a contextual detail header place it
196
+ * directly) and a bespoke contextual header.
197
+ */
198
+ export function TopBarBackButton({
199
+ tone = "dark",
200
+ compact = false,
201
+ label = "Back",
202
+ ...props
203
+ }: ButtonHTMLAttributes<HTMLButtonElement> & {
204
+ tone?: TopBarTone;
205
+ compact?: boolean;
206
+ /** Accessible label + tooltip (default "Back"). */
207
+ label?: string;
208
+ }) {
209
+ return (
210
+ <TopBarIconButton
211
+ tone={tone}
212
+ compact={compact}
213
+ aria-label={label}
214
+ title={label}
215
+ {...props}
216
+ >
217
+ <ChevronLeft size={20} />
218
+ </TopBarIconButton>
219
+ );
220
+ }
221
+
187
222
  /**
188
223
  * Alias for {@link TopBar} under its platform-app-bar name. Same component,
189
224
  * same props — use whichever import name the app standardizes on.
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@ export type { ProfileMenuProps, ProfileMenuUser, ProfileMenuLinkArgs } from "./P
3
3
  export { AppBadge } from "./AppBadge.js";
4
4
  export { AppLogo, APP_GLYPHS, appGlyphForSlug } from "./AppLogo.js";
5
5
  export type { AppGlyph } from "./AppLogo.js";
6
- export { TopBar, TopBarIconButton, DesktopActionBar } from "./TopBar.js";
6
+ export { TopBar, TopBarIconButton, TopBarBackButton, DesktopActionBar } from "./TopBar.js";
7
7
  export type { TopBarTone } from "./TopBar.js";
8
8
  export { SidebarNav } from "./SidebarNav.js";
9
9
  export type { SidebarNavProps, SidebarNavSection, SidebarNavItem, SidebarNavLinkArgs } from "./SidebarNav.js";