@skipleague/design 0.4.5 → 0.4.7
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/dist/AppLogo.d.ts +1 -1
- package/dist/AppLogo.js +9 -0
- package/dist/ProfileMenu.d.ts +5 -3
- package/dist/ProfileMenu.js +1 -1
- package/package.json +1 -1
- package/src/AppLogo.tsx +35 -1
- package/src/ProfileMenu.tsx +9 -6
package/dist/AppLogo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** A SkipLeague app's logo glyph (monoline, drawn on the brand tile). */
|
|
2
|
-
export type AppGlyph = "lists" | "racquetball" | "trips";
|
|
2
|
+
export type AppGlyph = "lists" | "racquetball" | "trips" | "gifts" | "reading" | "today";
|
|
3
3
|
/**
|
|
4
4
|
* The per-app logo mark — a brand-green rounded tile holding a white monoline
|
|
5
5
|
* glyph. Replaces the single-letter {@link AppBadge}; gives each SkipLeague app a
|
package/dist/AppLogo.js
CHANGED
|
@@ -9,6 +9,15 @@ function glyphPaths(app, color) {
|
|
|
9
9
|
return (_jsxs(_Fragment, { children: [_jsx("ellipse", { cx: "10", cy: "9", rx: "5.4", ry: "6.6", transform: "rotate(-34 10 9)" }), _jsx("path", { d: "M6.6 14.2L3.4 19.4" }), _jsx("circle", { cx: "18", cy: "17.4", r: "2.3", fill: color, stroke: "none" })] }));
|
|
10
10
|
case "trips":
|
|
11
11
|
return (_jsxs(_Fragment, { children: [_jsx("path", { d: "M12 21.5s6.6-5.8 6.6-10.5a6.6 6.6 0 1 0-13.2 0c0 4.7 6.6 10.5 6.6 10.5z" }), _jsx("circle", { cx: "12", cy: "10.8", r: "2.4" })] }));
|
|
12
|
+
case "gifts":
|
|
13
|
+
// Gift box: lid band, body, vertical ribbon, and a two-loop bow.
|
|
14
|
+
return (_jsxs(_Fragment, { children: [_jsx("rect", { x: "3.5", y: "8", width: "17", height: "4.5", rx: "1" }), _jsx("path", { d: "M5 12.5V20h14v-7.5" }), _jsx("path", { d: "M12 8v12" }), _jsx("path", { d: "M12 8C11 5.5 9.5 4.2 8.2 4.9 6.9 5.6 8 8 12 8Z" }), _jsx("path", { d: "M12 8c1-2.5 2.5-3.8 3.8-3.1C17.1 5.6 16 8 12 8Z" })] }));
|
|
15
|
+
case "reading":
|
|
16
|
+
// Open book: two pages meeting at a center spine.
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx("path", { d: "M12 6.5C9.8 5.1 6.4 4.6 4 5.3v12.6c2.4-.7 5.8-.2 8 1.2 2.2-1.4 5.6-1.9 8-1.2V5.3C17.6 4.6 14.2 5.1 12 6.5Z" }), _jsx("path", { d: "M12 6.5V19.3" })] }));
|
|
18
|
+
case "today":
|
|
19
|
+
// Sun = "today" / the day.
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "3.8" }), _jsx("path", { d: "M12 2.6V5" }), _jsx("path", { d: "M12 19V21.4" }), _jsx("path", { d: "M2.6 12H5" }), _jsx("path", { d: "M19 12H21.4" }), _jsx("path", { d: "M5.2 5.2 6.9 6.9" }), _jsx("path", { d: "M17.1 17.1 18.8 18.8" }), _jsx("path", { d: "M18.8 5.2 17.1 6.9" }), _jsx("path", { d: "M6.9 17.1 5.2 18.8" })] }));
|
|
12
21
|
}
|
|
13
22
|
}
|
|
14
23
|
/**
|
package/dist/ProfileMenu.d.ts
CHANGED
|
@@ -23,9 +23,11 @@ export interface ProfileMenuProps {
|
|
|
23
23
|
apps?: AppLink[];
|
|
24
24
|
/**
|
|
25
25
|
* Slugs of the apps THIS user has enabled (e.g. the platform's `app_slugs`).
|
|
26
|
-
* When provided, the switcher shows only those apps (the current
|
|
27
|
-
* kept), so every app shows the same "your apps" set without each
|
|
28
|
-
* re-implementing the filter. Omit to list every
|
|
26
|
+
* When provided and non-empty, the switcher shows only those apps (the current
|
|
27
|
+
* app is always kept), so every app shows the same "your apps" set without each
|
|
28
|
+
* one re-implementing the filter. Omit — or pass an EMPTY array — to list every
|
|
29
|
+
* app in `apps`. (Empty is treated as "show all" so super-admins, who are
|
|
30
|
+
* authorized without per-app slugs, don't get an empty switcher.)
|
|
29
31
|
*/
|
|
30
32
|
enabledSlugs?: string[];
|
|
31
33
|
/** Target of the "Manage account" link. Defaults to the platform account page. */
|
package/dist/ProfileMenu.js
CHANGED
|
@@ -37,7 +37,7 @@ export function ProfileMenu({ user, currentSlug, apps = SKIPLEAGUE_APPS, enabled
|
|
|
37
37
|
}, [open]);
|
|
38
38
|
// Show only the apps this user has enabled (always keeping the current app),
|
|
39
39
|
// when the caller passes the user's enabled slugs. Otherwise list every app.
|
|
40
|
-
const visibleApps = enabledSlugs
|
|
40
|
+
const visibleApps = enabledSlugs && enabledSlugs.length > 0
|
|
41
41
|
? apps.filter((a) => a.slug === currentSlug || enabledSlugs.includes(a.slug))
|
|
42
42
|
: apps;
|
|
43
43
|
const signedIn = !!(user?.displayName || user?.email);
|
package/package.json
CHANGED
package/src/AppLogo.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
/** A SkipLeague app's logo glyph (monoline, drawn on the brand tile). */
|
|
4
|
-
export type AppGlyph = "lists" | "racquetball" | "trips";
|
|
4
|
+
export type AppGlyph = "lists" | "racquetball" | "trips" | "gifts" | "reading" | "today";
|
|
5
5
|
|
|
6
6
|
// Exact 24×24 glyph paths (design_handoff_top_bar). `color` only matters for the
|
|
7
7
|
// racquetball ball, which is filled rather than stroked.
|
|
@@ -31,6 +31,40 @@ function glyphPaths(app: AppGlyph, color: string): ReactNode {
|
|
|
31
31
|
<circle cx="12" cy="10.8" r="2.4" />
|
|
32
32
|
</>
|
|
33
33
|
);
|
|
34
|
+
case "gifts":
|
|
35
|
+
// Gift box: lid band, body, vertical ribbon, and a two-loop bow.
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<rect x="3.5" y="8" width="17" height="4.5" rx="1" />
|
|
39
|
+
<path d="M5 12.5V20h14v-7.5" />
|
|
40
|
+
<path d="M12 8v12" />
|
|
41
|
+
<path d="M12 8C11 5.5 9.5 4.2 8.2 4.9 6.9 5.6 8 8 12 8Z" />
|
|
42
|
+
<path d="M12 8c1-2.5 2.5-3.8 3.8-3.1C17.1 5.6 16 8 12 8Z" />
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
case "reading":
|
|
46
|
+
// Open book: two pages meeting at a center spine.
|
|
47
|
+
return (
|
|
48
|
+
<>
|
|
49
|
+
<path d="M12 6.5C9.8 5.1 6.4 4.6 4 5.3v12.6c2.4-.7 5.8-.2 8 1.2 2.2-1.4 5.6-1.9 8-1.2V5.3C17.6 4.6 14.2 5.1 12 6.5Z" />
|
|
50
|
+
<path d="M12 6.5V19.3" />
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
case "today":
|
|
54
|
+
// Sun = "today" / the day.
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<circle cx="12" cy="12" r="3.8" />
|
|
58
|
+
<path d="M12 2.6V5" />
|
|
59
|
+
<path d="M12 19V21.4" />
|
|
60
|
+
<path d="M2.6 12H5" />
|
|
61
|
+
<path d="M19 12H21.4" />
|
|
62
|
+
<path d="M5.2 5.2 6.9 6.9" />
|
|
63
|
+
<path d="M17.1 17.1 18.8 18.8" />
|
|
64
|
+
<path d="M18.8 5.2 17.1 6.9" />
|
|
65
|
+
<path d="M6.9 17.1 5.2 18.8" />
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
34
68
|
}
|
|
35
69
|
}
|
|
36
70
|
|
package/src/ProfileMenu.tsx
CHANGED
|
@@ -28,9 +28,11 @@ export interface ProfileMenuProps {
|
|
|
28
28
|
apps?: AppLink[];
|
|
29
29
|
/**
|
|
30
30
|
* Slugs of the apps THIS user has enabled (e.g. the platform's `app_slugs`).
|
|
31
|
-
* When provided, the switcher shows only those apps (the current
|
|
32
|
-
* kept), so every app shows the same "your apps" set without each
|
|
33
|
-
* re-implementing the filter. Omit to list every
|
|
31
|
+
* When provided and non-empty, the switcher shows only those apps (the current
|
|
32
|
+
* app is always kept), so every app shows the same "your apps" set without each
|
|
33
|
+
* one re-implementing the filter. Omit — or pass an EMPTY array — to list every
|
|
34
|
+
* app in `apps`. (Empty is treated as "show all" so super-admins, who are
|
|
35
|
+
* authorized without per-app slugs, don't get an empty switcher.)
|
|
34
36
|
*/
|
|
35
37
|
enabledSlugs?: string[];
|
|
36
38
|
/** Target of the "Manage account" link. Defaults to the platform account page. */
|
|
@@ -110,9 +112,10 @@ export function ProfileMenu({
|
|
|
110
112
|
|
|
111
113
|
// Show only the apps this user has enabled (always keeping the current app),
|
|
112
114
|
// when the caller passes the user's enabled slugs. Otherwise list every app.
|
|
113
|
-
const visibleApps =
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
const visibleApps =
|
|
116
|
+
enabledSlugs && enabledSlugs.length > 0
|
|
117
|
+
? apps.filter((a) => a.slug === currentSlug || enabledSlugs.includes(a.slug))
|
|
118
|
+
: apps;
|
|
116
119
|
|
|
117
120
|
const signedIn = !!(user?.displayName || user?.email);
|
|
118
121
|
// Signed-out menu only when a sign-in handler is supplied — otherwise keep the
|