@ansiversa/components 0.0.131 → 0.0.132

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ansiversa/components",
3
- "version": "0.0.131",
3
+ "version": "0.0.132",
4
4
  "description": "Shared UI components and layouts for the Ansiversa ecosystem",
5
5
  "type": "module",
6
6
  "exports": {
@@ -0,0 +1,33 @@
1
+ ---
2
+ import AppLogoDefault from "./logos/AppLogoDefault.astro";
3
+ import AppLogoFlashNote from "./logos/AppLogoFlashNote.astro";
4
+ import AppLogoPortfolioCreator from "./logos/AppLogoPortfolioCreator.astro";
5
+ import AppLogoQuiz from "./logos/AppLogoQuiz.astro";
6
+ import AppLogoResumeBuilder from "./logos/AppLogoResumeBuilder.astro";
7
+
8
+ export type AppLogoProps = {
9
+ appId: string;
10
+ size?: "xs" | "sm" | "md";
11
+ class?: string;
12
+ title?: string;
13
+ };
14
+
15
+ const { appId, size = "sm", class: className, title } = Astro.props as AppLogoProps;
16
+
17
+ const sizeMap: Record<NonNullable<AppLogoProps["size"]>, number> = {
18
+ xs: 16,
19
+ sm: 18,
20
+ md: 20,
21
+ };
22
+
23
+ const logoRegistry = {
24
+ quiz: AppLogoQuiz,
25
+ "resume-builder": AppLogoResumeBuilder,
26
+ "portfolio-creator": AppLogoPortfolioCreator,
27
+ flashnote: AppLogoFlashNote,
28
+ } as const;
29
+
30
+ const Logo = logoRegistry[appId as keyof typeof logoRegistry] ?? AppLogoDefault;
31
+ ---
32
+
33
+ <Logo size={sizeMap[size]} class={className} title={title} />
package/src/Logo/index.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { default as AppLogo } from "./AppLogo";
2
- export { default as AppLogoDefault } from "./logos/AppLogoDefault";
3
- export { default as AppLogoFlashNote } from "./logos/AppLogoFlashNote";
4
- export { default as AppLogoPortfolioCreator } from "./logos/AppLogoPortfolioCreator";
5
- export { default as AppLogoQuiz } from "./logos/AppLogoQuiz";
6
- export { default as AppLogoResumeBuilder } from "./logos/AppLogoResumeBuilder";
7
- export type { AppLogoProps } from "./AppLogo";
1
+ export { default as AppLogo } from "./AppLogo.astro";
2
+ export { default as AppLogoDefault } from "./logos/AppLogoDefault.astro";
3
+ export { default as AppLogoFlashNote } from "./logos/AppLogoFlashNote.astro";
4
+ export { default as AppLogoPortfolioCreator } from "./logos/AppLogoPortfolioCreator.astro";
5
+ export { default as AppLogoQuiz } from "./logos/AppLogoQuiz.astro";
6
+ export { default as AppLogoResumeBuilder } from "./logos/AppLogoResumeBuilder.astro";
7
+ export type { AppLogoProps } from "./AppLogo.astro";
@@ -0,0 +1,25 @@
1
+ ---
2
+ import type { AppLogoGlyphProps } from "./AppLogoQuiz.astro";
3
+
4
+ const { size = 18, class: className, title } = Astro.props as AppLogoGlyphProps;
5
+ ---
6
+
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 24 24"
10
+ width={size}
11
+ height={size}
12
+ fill="none"
13
+ stroke="currentColor"
14
+ stroke-width="1.75"
15
+ stroke-linecap="round"
16
+ stroke-linejoin="round"
17
+ class={className}
18
+ aria-hidden={title ? undefined : "true"}
19
+ role={title ? "img" : "presentation"}
20
+ >
21
+ {title ? <title>{title}</title> : null}
22
+ <circle cx="12" cy="12" r="9" />
23
+ <path d="M12 8v8" />
24
+ <path d="M8 12h8" />
25
+ </svg>
@@ -0,0 +1,23 @@
1
+ ---
2
+ import type { AppLogoGlyphProps } from "./AppLogoQuiz.astro";
3
+
4
+ const { size = 18, class: className, title } = Astro.props as AppLogoGlyphProps;
5
+ ---
6
+
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 24 24"
10
+ width={size}
11
+ height={size}
12
+ fill="none"
13
+ stroke="currentColor"
14
+ stroke-width="1.75"
15
+ stroke-linecap="round"
16
+ stroke-linejoin="round"
17
+ class={className}
18
+ aria-hidden={title ? undefined : "true"}
19
+ role={title ? "img" : "presentation"}
20
+ >
21
+ {title ? <title>{title}</title> : null}
22
+ <path d="M12 2.8L4.5 12H10l-1 9.2L19.5 10H14l1-7.2Z" />
23
+ </svg>
@@ -0,0 +1,26 @@
1
+ ---
2
+ import type { AppLogoGlyphProps } from "./AppLogoQuiz.astro";
3
+
4
+ const { size = 18, class: className, title } = Astro.props as AppLogoGlyphProps;
5
+ ---
6
+
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 24 24"
10
+ width={size}
11
+ height={size}
12
+ fill="none"
13
+ stroke="currentColor"
14
+ stroke-width="1.75"
15
+ stroke-linecap="round"
16
+ stroke-linejoin="round"
17
+ class={className}
18
+ aria-hidden={title ? undefined : "true"}
19
+ role={title ? "img" : "presentation"}
20
+ >
21
+ {title ? <title>{title}</title> : null}
22
+ <rect x="3" y="5" width="18" height="14" rx="2.5" />
23
+ <path d="M8.5 5V4a1.5 1.5 0 0 1 1.5-1.5h4A1.5 1.5 0 0 1 15.5 4v1" />
24
+ <path d="M3 11h18" />
25
+ <path d="M11 14.5h2" />
26
+ </svg>
@@ -0,0 +1,30 @@
1
+ ---
2
+ export type AppLogoGlyphProps = {
3
+ size: number;
4
+ class?: string;
5
+ title?: string;
6
+ };
7
+
8
+ const { size = 18, class: className, title } = Astro.props as AppLogoGlyphProps;
9
+ ---
10
+
11
+ <svg
12
+ xmlns="http://www.w3.org/2000/svg"
13
+ viewBox="0 0 24 24"
14
+ width={size}
15
+ height={size}
16
+ fill="none"
17
+ stroke="currentColor"
18
+ stroke-width="1.75"
19
+ stroke-linecap="round"
20
+ stroke-linejoin="round"
21
+ class={className}
22
+ aria-hidden={title ? undefined : "true"}
23
+ role={title ? "img" : "presentation"}
24
+ >
25
+ {title ? <title>{title}</title> : null}
26
+ <circle cx="11" cy="11" r="7" />
27
+ <path d="M21 21l-4.2-4.2" />
28
+ <path d="M8.6 9.2a2.6 2.6 0 1 1 4.8 1.3c-.7.8-1.8 1.4-1.8 2.4" />
29
+ <path d="M11.5 16h0" />
30
+ </svg>
@@ -0,0 +1,26 @@
1
+ ---
2
+ import type { AppLogoGlyphProps } from "./AppLogoQuiz.astro";
3
+
4
+ const { size = 18, class: className, title } = Astro.props as AppLogoGlyphProps;
5
+ ---
6
+
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 24 24"
10
+ width={size}
11
+ height={size}
12
+ fill="none"
13
+ stroke="currentColor"
14
+ stroke-width="1.75"
15
+ stroke-linecap="round"
16
+ stroke-linejoin="round"
17
+ class={className}
18
+ aria-hidden={title ? undefined : "true"}
19
+ role={title ? "img" : "presentation"}
20
+ >
21
+ {title ? <title>{title}</title> : null}
22
+ <rect x="4" y="3.5" width="16" height="17" rx="2.5" />
23
+ <path d="M8 8.5h8" />
24
+ <path d="M8 12h8" />
25
+ <path d="M8 15.5h5" />
26
+ </svg>
@@ -1,39 +0,0 @@
1
- import type { JSX } from "astro/jsx-runtime";
2
- import AppLogoDefault from "./logos/AppLogoDefault";
3
- import AppLogoFlashNote from "./logos/AppLogoFlashNote";
4
- import AppLogoPortfolioCreator from "./logos/AppLogoPortfolioCreator";
5
- import AppLogoQuiz from "./logos/AppLogoQuiz";
6
- import AppLogoResumeBuilder from "./logos/AppLogoResumeBuilder";
7
-
8
- type LogoComponentProps = {
9
- size: number;
10
- class?: string;
11
- title?: string;
12
- };
13
-
14
- type LogoComponent = (props: LogoComponentProps) => JSX.Element;
15
-
16
- export type AppLogoProps = {
17
- appId: string;
18
- size?: "xs" | "sm" | "md";
19
- class?: string;
20
- title?: string;
21
- };
22
-
23
- const SIZE_MAP: Record<NonNullable<AppLogoProps["size"]>, number> = {
24
- xs: 16,
25
- sm: 18,
26
- md: 20,
27
- };
28
-
29
- const LOGO_REGISTRY: Record<string, LogoComponent> = {
30
- quiz: AppLogoQuiz,
31
- "resume-builder": AppLogoResumeBuilder,
32
- "portfolio-creator": AppLogoPortfolioCreator,
33
- flashnote: AppLogoFlashNote,
34
- };
35
-
36
- export default function AppLogo({ appId, size = "sm", class: className, title }: AppLogoProps) {
37
- const Logo = LOGO_REGISTRY[appId] ?? AppLogoDefault;
38
- return <Logo size={SIZE_MAP[size]} class={className} title={title} />;
39
- }
@@ -1,25 +0,0 @@
1
- import type { AppLogoGlyphProps } from "./AppLogoQuiz";
2
-
3
- export default function AppLogoDefault({ size, class: className, title }: AppLogoGlyphProps) {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- viewBox="0 0 24 24"
8
- width={size}
9
- height={size}
10
- fill="none"
11
- stroke="currentColor"
12
- stroke-width="1.75"
13
- stroke-linecap="round"
14
- stroke-linejoin="round"
15
- class={className}
16
- aria-hidden={title ? undefined : "true"}
17
- role={title ? "img" : "presentation"}
18
- >
19
- {title ? <title>{title}</title> : null}
20
- <circle cx="12" cy="12" r="9" />
21
- <path d="M12 8v8" />
22
- <path d="M8 12h8" />
23
- </svg>
24
- );
25
- }
@@ -1,23 +0,0 @@
1
- import type { AppLogoGlyphProps } from "./AppLogoQuiz";
2
-
3
- export default function AppLogoFlashNote({ size, class: className, title }: AppLogoGlyphProps) {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- viewBox="0 0 24 24"
8
- width={size}
9
- height={size}
10
- fill="none"
11
- stroke="currentColor"
12
- stroke-width="1.75"
13
- stroke-linecap="round"
14
- stroke-linejoin="round"
15
- class={className}
16
- aria-hidden={title ? undefined : "true"}
17
- role={title ? "img" : "presentation"}
18
- >
19
- {title ? <title>{title}</title> : null}
20
- <path d="M12 2.8L4.5 12H10l-1 9.2L19.5 10H14l1-7.2Z" />
21
- </svg>
22
- );
23
- }
@@ -1,26 +0,0 @@
1
- import type { AppLogoGlyphProps } from "./AppLogoQuiz";
2
-
3
- export default function AppLogoPortfolioCreator({ size, class: className, title }: AppLogoGlyphProps) {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- viewBox="0 0 24 24"
8
- width={size}
9
- height={size}
10
- fill="none"
11
- stroke="currentColor"
12
- stroke-width="1.75"
13
- stroke-linecap="round"
14
- stroke-linejoin="round"
15
- class={className}
16
- aria-hidden={title ? undefined : "true"}
17
- role={title ? "img" : "presentation"}
18
- >
19
- {title ? <title>{title}</title> : null}
20
- <rect x="3" y="5" width="18" height="14" rx="2.5" />
21
- <path d="M8.5 5V4a1.5 1.5 0 0 1 1.5-1.5h4A1.5 1.5 0 0 1 15.5 4v1" />
22
- <path d="M3 11h18" />
23
- <path d="M11 14.5h2" />
24
- </svg>
25
- );
26
- }
@@ -1,30 +0,0 @@
1
- export type AppLogoGlyphProps = {
2
- size: number;
3
- class?: string;
4
- title?: string;
5
- };
6
-
7
- export default function AppLogoQuiz({ size, class: className, title }: AppLogoGlyphProps) {
8
- return (
9
- <svg
10
- xmlns="http://www.w3.org/2000/svg"
11
- viewBox="0 0 24 24"
12
- width={size}
13
- height={size}
14
- fill="none"
15
- stroke="currentColor"
16
- stroke-width="1.75"
17
- stroke-linecap="round"
18
- stroke-linejoin="round"
19
- class={className}
20
- aria-hidden={title ? undefined : "true"}
21
- role={title ? "img" : "presentation"}
22
- >
23
- {title ? <title>{title}</title> : null}
24
- <circle cx="11" cy="11" r="7" />
25
- <path d="M21 21l-4.2-4.2" />
26
- <path d="M8.6 9.2a2.6 2.6 0 1 1 4.8 1.3c-.7.8-1.8 1.4-1.8 2.4" />
27
- <path d="M11.5 16h0" />
28
- </svg>
29
- );
30
- }
@@ -1,26 +0,0 @@
1
- import type { AppLogoGlyphProps } from "./AppLogoQuiz";
2
-
3
- export default function AppLogoResumeBuilder({ size, class: className, title }: AppLogoGlyphProps) {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- viewBox="0 0 24 24"
8
- width={size}
9
- height={size}
10
- fill="none"
11
- stroke="currentColor"
12
- stroke-width="1.75"
13
- stroke-linecap="round"
14
- stroke-linejoin="round"
15
- class={className}
16
- aria-hidden={title ? undefined : "true"}
17
- role={title ? "img" : "presentation"}
18
- >
19
- {title ? <title>{title}</title> : null}
20
- <rect x="4" y="3.5" width="16" height="17" rx="2.5" />
21
- <path d="M8 8.5h8" />
22
- <path d="M8 12h8" />
23
- <path d="M8 15.5h5" />
24
- </svg>
25
- );
26
- }