starlight-theme-bejamas 0.1.1 → 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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # starlight-theme-bejamas
2
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
+
3
11
  ## 0.1.1
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "starlight-theme-bejamas",
3
3
  "author": "Bejamas",
4
- "version": "0.1.1",
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
 
@@ -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
  */
@@ -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>