@skipleague/design 0.8.1 → 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 +1 -1
- package/dist/TopBar.d.ts +17 -0
- package/dist/TopBar.js +15 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/TopBar.tsx +36 -1
- package/src/index.ts +1 -1
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)
|
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
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";
|