starlight-theme-bejamas 0.1.0 → 0.1.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # starlight-theme-bejamas
2
+
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#6](https://github.com/bejamas/ui/pull/6) [`fcca220`](https://github.com/bejamas/ui/commit/fcca220c0d4760edbaaefbfe2ce0af512bfadc26) Thanks [@thomkrupa](https://github.com/thomkrupa)! - convert component names to PascalCase for barrel import
8
+
9
+ - [#6](https://github.com/bejamas/ui/pull/6) [`41d9e97`](https://github.com/bejamas/ui/commit/41d9e97f7cee67e95d9c9eeb112762d1487d4e4f) Thanks [@thomkrupa](https://github.com/thomkrupa)! - change imports of bejamas/ui components
10
+
11
+ ## 0.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - fix search position on tablet screen size
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "starlight-theme-bejamas",
3
3
  "author": "Bejamas",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "license": "MIT",
6
6
  "description": "A Starlight theme using bejamas/ui",
7
7
  "type": "module",
package/src/lib/vite.ts CHANGED
@@ -27,6 +27,17 @@ export function vitePluginStarlightThemeBejamas(
27
27
  return `export default (()=>{ throw new Error(\"starlight-theme-bejamas: No component mapping found for '${componentName}'. Add it under 'components' in your starlightThemeBejamas config.\"); })()`;
28
28
  }
29
29
 
30
+ // Check if target is a barrel import (no .astro extension) or old-style file import
31
+ const isBarrelImport = !target.endsWith(".astro");
32
+
33
+ if (isBarrelImport) {
34
+ // For barrel imports, the component is exported as a named export in PascalCase
35
+ // Convert componentName (e.g., 'button') to PascalCase (e.g., 'Button')
36
+ const pascalCaseName = componentName.charAt(0).toUpperCase() + componentName.slice(1);
37
+ return `export { ${pascalCaseName} as default, ${pascalCaseName} } from "${target}"; export * from "${target}";`;
38
+ }
39
+
40
+ // Old pattern: .astro file with default export
30
41
  return `export { default } from "${target}"; export * from "${target}";`;
31
42
  }
32
43
 
@@ -5,37 +5,39 @@ import Pagination from "virtual:starlight/components/Pagination";
5
5
  import config from "virtual:starlight/user-config";
6
6
  ---
7
7
 
8
- <footer class="sl-flex">
8
+ <footer class="sl-flex footer-wide">
9
9
  <div class="meta sl-flex">
10
10
  <EditLink />
11
11
  <LastUpdated />
12
12
  </div>
13
13
  <Pagination />
14
-
15
- {
16
- config.credits && (
17
- <a class="kudos sl-flex" href="https://bejamas.com">
18
- Built at Bejamas
19
- </a>
20
- )
21
- }
22
-
23
14
  <div class="fade"></div>
24
15
  </footer>
25
16
 
17
+ {
18
+ config.credits && (
19
+ <a class="kudos sl-flex footer-wide" href="https://ui.bejamas.com">
20
+ Built at Bejamas
21
+ </a>
22
+ )
23
+ }
24
+
26
25
  <style>
27
26
  @layer starlight.core {
27
+ .footer-wide {
28
+ width: calc(
29
+ 100% + calc(var(--sl-content-pad-x) * 2) + calc(var(--spacing) * 2)
30
+ );
31
+ margin-inline: calc(var(--spacing) * -1 - var(--sl-content-pad-x));
32
+ padding-inline: calc(var(--sl-content-pad-x) + var(--spacing));
33
+ }
34
+
28
35
  footer {
29
36
  flex-direction: column;
30
37
  gap: 1.5rem;
31
38
  position: sticky;
32
39
  bottom: 0;
33
- width: calc(
34
- 100% + calc(var(--sl-content-pad-x) * 2) + calc(var(--spacing) * 2)
35
- );
36
- margin-inline: calc(var(--spacing) * -1 - var(--sl-content-pad-x));
37
40
  background: linear-gradient(to top, var(--background), transparent);
38
- padding-inline: calc(var(--sl-content-pad-x) + var(--spacing));
39
41
  padding-block: calc(var(--spacing) * 3);
40
42
  z-index: 10;
41
43
  }
@@ -48,6 +50,9 @@ import config from "virtual:starlight/user-config";
48
50
  .meta {
49
51
  display: flex;
50
52
  }
53
+ .kudos {
54
+ margin-bottom: calc(var(--spacing) * -10);
55
+ }
51
56
  }
52
57
 
53
58
  .meta {
@@ -67,20 +72,31 @@ import config from "virtual:starlight/user-config";
67
72
  .kudos {
68
73
  align-items: center;
69
74
  gap: 0.5em;
70
- margin: 1.5rem auto;
75
+ margin-block: 0;
71
76
  font-size: var(--sl-text-xs);
72
77
  text-decoration: none;
73
- color: var(--sl-color-gray-3);
78
+ color: var(--muted-foreground);
79
+ justify-content: center;
80
+ padding-top: calc(var(--spacing) * 12);
81
+ padding-bottom: calc(var(--spacing) * 10);
82
+ background-color: var(--background);
83
+ justify-content: center;
74
84
  }
75
85
  .kudos:hover {
76
- color: var(--sl-color-white);
86
+ color: var(--foreground);
87
+ }
88
+
89
+ @media (min-width: 50rem) {
90
+ .kudos {
91
+ background-color: transparent;
92
+ }
77
93
  }
78
94
 
79
95
  .fade {
80
96
  --blur: 4px;
81
97
  --stop: 50%;
82
98
  --height: 72px;
83
- position: fixed;
99
+ position: absolute;
84
100
  pointer-events: none;
85
101
  width: 100%;
86
102
  height: var(--height);
@@ -9,7 +9,7 @@ import ThemeSelect from "virtual:starlight/components/ThemeSelect";
9
9
 
10
10
  import options from "virtual:starlight-theme-bejamas/user-config";
11
11
 
12
- import Button from "virtual:starlight-theme-bejamas/components/Button.astro";
12
+ import { Button } from "virtual:starlight-theme-bejamas/components/button";
13
13
  /**
14
14
  * Render the `Search` component if Pagefind is enabled or the default search component has been overridden.
15
15
  */
@@ -43,7 +43,7 @@ const shouldRenderNav = options.nav && options.nav.length > 0;
43
43
  )
44
44
  }
45
45
  </div>
46
- <div class="sl-flex sl-justify-end print:hidden">
46
+ <div class="sl-flex sl-bejamas-header-search sl-justify-end print:hidden">
47
47
  {shouldRenderSearch && <Search />}
48
48
  </div>
49
49
  <div class="sl-hidden md:sl-flex print:hidden right-group">
@@ -62,8 +62,11 @@ const shouldRenderNav = options.nav && options.nav.length > 0;
62
62
  align-items: center;
63
63
  gap: 1.25rem;
64
64
  }
65
- }
66
- @layer bejamas {
65
+
66
+ .sl-bejamas-header-search {
67
+ margin-left: auto;
68
+ }
69
+
67
70
  .header {
68
71
  display: flex;
69
72
  gap: var(--sl-nav-gap);
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import { Image } from "astro:assets";
3
- import Button from "virtual:starlight-theme-bejamas/components/Button.astro";
3
+ import { Button } from "virtual:starlight-theme-bejamas/components/button";
4
4
 
5
5
  const { data } = Astro.locals.starlightRoute.entry;
6
6
  const { title = data.title, tagline, image, actions = [] } = data.hero || {};
@@ -1,5 +1,5 @@
1
1
  ---
2
- import Button from "virtual:starlight-theme-bejamas/components/Button.astro";
2
+ import { Button } from "virtual:starlight-theme-bejamas/components/button";
3
3
 
4
4
  import { ArrowRight, ArrowLeft, ArrowUpRight } from "@lucide/astro";
5
5
 
@@ -1,6 +1,5 @@
1
1
  ---
2
- // import { Icon } from "@astrojs/starlight/components";
3
- import Button from "virtual:starlight-theme-bejamas/components/Button.astro";
2
+ import { Button } from "virtual:starlight-theme-bejamas/components/button";
4
3
  import { ArrowRight, ArrowLeft } from "@lucide/astro";
5
4
 
6
5
  const { dir, pagination } = Astro.locals.starlightRoute;
@@ -27,14 +26,6 @@ const isRtl = dir === "rtl";
27
26
  }
28
27
  </div>
29
28
 
30
- <!-- <div class="text-center text-sm text-muted-foreground page-footer">
31
- <p>
32
- Built at <a href="https://bejamas.com" class="underline underline-offset-4"
33
- >Bejamas</a
34
- >.
35
- </p>
36
- </div> -->
37
-
38
29
  <style>
39
30
  @layer starlight.core {
40
31
  .pagination-links {
@@ -1,5 +1,10 @@
1
1
  ---
2
- import Select from "virtual:starlight-theme-bejamas/components/Select.astro";
2
+ import {
3
+ Select,
4
+ SelectControl,
5
+ SelectIndicator,
6
+ SelectOption,
7
+ } from "virtual:starlight-theme-bejamas/components/select";
3
8
 
4
9
  import { SunIcon, MoonIcon, LaptopIcon } from "@lucide/astro";
5
10
  ---
@@ -12,22 +17,21 @@ import { SunIcon, MoonIcon, LaptopIcon } from "@lucide/astro";
12
17
  <LaptopIcon class="theme-icon theme-icon-auto size-4" />
13
18
  </div>
14
19
  <Select showCheckmark={false}>
15
- <Select part="indicator" />
16
- <Select
17
- part="control"
20
+ <SelectIndicator />
21
+ <SelectControl
18
22
  showCheckmark={false}
19
23
  class="sl-bejamas-theme-select-control"
20
24
  >
21
- <Select part="option" value="light"
22
- ><SunIcon class="size-4" /> Light</Select
25
+ <SelectOption value="light"
26
+ ><SunIcon class="size-4" /> Light</SelectOption
23
27
  >
24
- <Select part="option" value="dark"
25
- ><MoonIcon class="size-4" /> Dark</Select
28
+ <SelectOption value="dark"
29
+ ><MoonIcon class="size-4" /> Dark</SelectOption
26
30
  >
27
- <Select part="option" value="auto"
28
- ><LaptopIcon class="size-4" /> Auto</Select
31
+ <SelectOption value="auto"
32
+ ><LaptopIcon class="size-4" /> Auto</SelectOption
29
33
  >
30
- </Select>
34
+ </SelectControl>
31
35
  </Select>
32
36
  </div>
33
37
  </starlight-theme-select>