spoko-design-system 0.6.6 → 0.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoko-design-system",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "private": false,
5
5
  "main": "./index.ts",
6
6
  "module": "./index.ts",
@@ -16,6 +16,7 @@ interface Props {
16
16
  author?: Author;
17
17
  categories?: Category[];
18
18
  backgroundClass?: string;
19
+ lang?: string;
19
20
  }
20
21
 
21
22
  const {
@@ -28,7 +29,8 @@ const {
28
29
  date,
29
30
  author,
30
31
  categories = [],
31
- backgroundClass = 'bg-blue-darker'
32
+ backgroundClass = 'bg-blue-darker',
33
+ lang = 'en'
32
34
  } = Astro.props;
33
35
 
34
36
  // Helper (function to check if a slot has content)
@@ -56,6 +58,7 @@ const commonProps = {
56
58
  hasMetadata,
57
59
  hasCategories,
58
60
  backgroundClass,
61
+ lang,
59
62
  };
60
63
  ---
61
64
 
@@ -12,6 +12,7 @@ interface Props {
12
12
  categories?: Category[];
13
13
  hasMetadata: boolean;
14
14
  hasCategories: boolean;
15
+ lang?: string;
15
16
  }
16
17
 
17
18
  const {
@@ -22,6 +23,7 @@ const {
22
23
  categories = [],
23
24
  hasMetadata,
24
25
  hasCategories,
26
+ lang = 'en'
25
27
  } = Astro.props;
26
28
  ---
27
29
 
@@ -34,7 +36,7 @@ const {
34
36
 
35
37
  {hasCategories && (
36
38
  <div class="order-1">
37
- <PostCategories categories={categories} />
39
+ <PostCategories categories={categories} lang={lang} />
38
40
  </div>
39
41
  )}
40
42
 
@@ -12,6 +12,7 @@ interface Props {
12
12
  categories?: Category[];
13
13
  hasMetadata: boolean;
14
14
  hasCategories: boolean;
15
+ lang: string;
15
16
  }
16
17
 
17
18
  const {
@@ -22,6 +23,7 @@ const {
22
23
  categories = [],
23
24
  hasMetadata,
24
25
  hasCategories,
26
+ lang='en'
25
27
  } = Astro.props;
26
28
 
27
29
  // Helper function to remove HTML tags
@@ -42,7 +44,7 @@ const cleanTitle = stripHtml(title);
42
44
 
43
45
  {hasCategories && (
44
46
  <div class="jumbotron-categories">
45
- <PostCategories categories={categories} />
47
+ <PostCategories categories={categories} lang={lang} />
46
48
  </div>
47
49
  )}
48
50
 
@@ -11,9 +11,13 @@ interface Category {
11
11
 
12
12
  interface Props {
13
13
  categories: Category[];
14
+ lang?: string;
14
15
  }
15
16
 
16
- const { categories } = Astro.props;
17
+ const { categories, lang = 'en' } = Astro.props;
18
+
19
+ // Determine the category label based on language
20
+ const categoryLabel = lang === 'pl' ? 'Kategoria' : 'Category';
17
21
  ---
18
22
 
19
23
  <div class="text-brand-secondary uppercase text-base z-3 relative w-full">
@@ -25,8 +29,8 @@ const { categories } = Astro.props;
25
29
  <span class="w-px h-2.5 bg-gray-300 mx-2.5 inline-block relative" />
26
30
  )}
27
31
  <a
28
- class="term-link text-sm sm:text-base hover:text-light-blue-400
29
- "
32
+ class="term-link text-sm sm:text-base hover:text-light-blue-400"
33
+ data-pagefind-filter={`${categoryLabel}:${category.name}`}
30
34
  href={category.link}
31
35
  >
32
36
  {category.name}
@@ -16,7 +16,7 @@ interface Props {
16
16
  }[];
17
17
  }
18
18
 
19
- const { image, title, categories, date, author } = Astro.props;
19
+ const { image, title, categories, date, author, lang } = Astro.props;
20
20
  import PostCategories from "./Post/PostCategories.astro";
21
21
  import Date from "./Date.astro";
22
22
  ---
@@ -33,7 +33,7 @@ import Date from "./Date.astro";
33
33
  >
34
34
  {title}
35
35
  </h1>
36
- <PostCategories categories={categories} />
36
+ <PostCategories categories={categories} lang={lang} />
37
37
  <div class="order-3 flex items-center text-gray-1 00">
38
38
  {
39
39
  author && (
@@ -18,6 +18,7 @@ WordPress PostHeader - post top component for WordPress Single Post template dat
18
18
  <div class="relative w-full">
19
19
  <PostHeader
20
20
  author={author}
21
+ lang="en"
21
22
  categories={categories}
22
23
  title="Lorem Ipsum"
23
24
  date={date}
@@ -30,6 +31,7 @@ WordPress PostHeader - post top component for WordPress Single Post template dat
30
31
  <div class="relative">
31
32
  <PostHeader
32
33
  author={ { firstName: 'Szymon', name: 'CNK' } }
34
+ lang="en"
33
35
  categories={ [{"name":"Tools & garage accessories","uri":"/category/garage/tools-garage-accessories/"}, , {"name":"Lorem Ipsum","uri":"#"}] }
34
36
  title="Lorem Ipsum"
35
37
  date="2023-07-13T01:35:03"
@@ -45,6 +47,7 @@ WordPress PostHeader - post top component for WordPress Single Post template dat
45
47
  <div class="relative w-full">
46
48
  <PostHeader
47
49
  title="Lorem Ipsum"
50
+ lang="en"
48
51
  image="https://img.freepik.com/free-photo/painting-mountain-lake-with-mountain-background_188544-9126.jpg?w=1380&t=st=1706297408~exp=1706298008~hmac=34fe549db6a665d24269d38a8ecdd7eb3f82cfea6346c8a4039ee3c03b62aad8"
49
52
  />
50
53
  </div>
@@ -54,6 +57,7 @@ WordPress PostHeader - post top component for WordPress Single Post template dat
54
57
  <div class="relative">
55
58
  <PostHeader
56
59
  title="Lorem Ipsum"
60
+ lang="en"
57
61
  image="https://img.freepik.com/free-photo/painting-mountain-lake-with-mountain-background_188544-9126.jpg?w=1380&t=st=1706297408~exp=1706298008~hmac=34fe549db6a665d24269d38a8ecdd7eb3f82cfea6346c8a4039ee3c03b62aad8"
58
62
  />
59
63
  </div>