spoko-design-system 0.2.42 → 0.2.44

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/index.ts CHANGED
@@ -1,13 +1,6 @@
1
1
  // Do not write code directly here, instead use the `src` folder!
2
2
  // Then, use this file to export everything you want your user to access.
3
3
 
4
- // import MyComponent from './src/src/MyComponent.astro';
5
-
6
-
7
-
8
- // export default MyComponent;
9
-
10
-
11
4
  // src/index.ts
12
5
 
13
6
  // Vue Components
@@ -29,7 +22,7 @@ export { default as CategorySidebarToggler } from './src/components/Category/Cat
29
22
  export { default as SubCategoryLink } from './src/components/Category/SubCategoryLink.vue';
30
23
 
31
24
  // Astro Components
32
- export { default as Copyright } from './src/components/Copyright.astro';
25
+ export { default as Copyright } from './src/components/Copyright.astro'; ///src/components/Copyright.astro';
33
26
  export { default as HandDrive } from './src/components/HandDrive.astro';
34
27
  export { default as Faq } from './src/components/Faq.astro';
35
28
  export { default as FaqItem } from './src/components/FaqItem.astro';
@@ -40,6 +33,8 @@ export { default as ProductImage } from './src/components/Product/ProductImage.a
40
33
  // export { default as CategoriesSidebar } from './src/components/Category/CategoriesSidebar.astro';
41
34
  export { default as CategoryDetails } from './src/components/Category/CategoryDetails.astro';
42
35
  export { default as CategorySection } from './src/components/Category/CategorySection.astro';
36
+ export { default as CategoryTile } from './src/components/Category/CategoryTile.astro';
37
+
43
38
 
44
39
  // Utils: Product
45
40
  export { default as getPriceFormatted } from './src/utils/product/getPriceFormatted';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoko-design-system",
3
- "version": "0.2.42",
3
+ "version": "0.2.44",
4
4
  "private": false,
5
5
  "main": "./index.ts",
6
6
  "module": "./index.ts",
@@ -41,6 +41,7 @@
41
41
  "@astrojs/mdx": "^3.1.9",
42
42
  "@astrojs/node": "^8.3.4",
43
43
  "@astrojs/sitemap": "^3.2.1",
44
+ "@astrojs/ts-plugin": "^1.10.4",
44
45
  "@astrojs/vue": "^4.5.2",
45
46
  "@docsearch/css": "^3.7.0",
46
47
  "@iconify-json/ant-design": "^1.2.2",
@@ -61,7 +62,7 @@
61
62
  "@iconify-json/ph": "^1.2.1",
62
63
  "@iconify-json/simple-icons": "^1.2.11",
63
64
  "@iconify-json/uil": "^1.2.1",
64
- "@iconify/json": "^2.2.268",
65
+ "@iconify/json": "^2.2.269",
65
66
  "@iconify/vue": "^4.1.2",
66
67
  "@playform/compress": "^0.1.6",
67
68
  "@playform/inline": "github:playform/inline",
@@ -0,0 +1,42 @@
1
+ ---
2
+ import getTranslatedLink from "@utils/text/getTranslatedLink";
3
+ import { Image } from "astro:assets";
4
+
5
+ interface CategoryObject {
6
+ photo: string;
7
+ desc: string;
8
+ alt: string;
9
+ name: string;
10
+ slug: string;
11
+ height?: number;
12
+ width?: number;
13
+ class?: string;
14
+ }
15
+
16
+ let inputProps = {};
17
+ const { CategoryObject } = Astro.props as { CategoryObject: CategoryObject };
18
+ CategoryObject.height = CategoryObject.height ?? 70;
19
+ CategoryObject.width = CategoryObject.width ?? 70;
20
+ ---
21
+
22
+ <a
23
+ href={getTranslatedLink(`/${CategoryObject.slug}/`)}
24
+ class="carousel-item"
25
+ {...inputProps}
26
+ >
27
+ <Image
28
+ src={`${CategoryObject.photo}`}
29
+ alt={CategoryObject.alt}
30
+ height={CategoryObject.height}
31
+ width={CategoryObject.height}
32
+ format="avif"
33
+ loading="eager"
34
+ onerror="this.style.display='none';"
35
+ class="cats-img"
36
+ />
37
+ <div class="swiper-lazy-preloader"></div>
38
+
39
+ <div class="cat-name" itemprop="name">
40
+ {CategoryObject.name}
41
+ </div>
42
+ </a>
@@ -1,5 +1,4 @@
1
-
2
1
  declare module '*.astro' {
3
- const component: any;
4
- export default component;
5
- }
2
+ const component: any;
3
+ export default component;
4
+ }
@@ -11,4 +11,6 @@ export const getPriceFormatted = (product: any) => {
11
11
  return 'no price'
12
12
  }
13
13
  }
14
-
14
+
15
+
16
+ export default getPriceFormatted;
@@ -13,3 +13,5 @@ export const getProductCheckList = (productDetails) => {
13
13
 
14
14
  return list.map(detail => t(`detail.value.${detail.value}`));
15
15
  }
16
+
17
+ export default getProductCheckList;
@@ -10,3 +10,5 @@ export const getShorterDescription = (description: string | null, limit = MAX_DE
10
10
  return description ? cutString(description, limit) || '' : '';
11
11
 
12
12
  }
13
+
14
+ export default getShorterDescription;
@@ -1,6 +1,6 @@
1
1
  /* Format date */
2
2
 
3
3
 
4
- export function formatDate(date: Date ) {
4
+ export default function formatDate(date: Date ) {
5
5
  return new Date(date);
6
6
  }
@@ -2,6 +2,6 @@
2
2
 
3
3
  import i18next from "i18next";
4
4
 
5
- export function formatLocaleNumber(number: number ) {
5
+ export default function formatLocaleNumber(number: number ) {
6
6
  return i18next.language === 'en' ? String(number).replace(/,/g, '.') : String(number);
7
7
  }
@@ -2,6 +2,7 @@ export const formatPad = (num: number, size: number) => {
2
2
  return String(num).padStart(size, '0');
3
3
  }
4
4
 
5
+ export default formatPad;
5
6
  // export const formatPad = (num: number, size: number) => {
6
7
  // let productId = String(num)
7
8
 
@@ -12,6 +12,7 @@ export const getNumberFormatted = (num, digits) => {
12
12
  return (num / item.value).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, "$1") + item.symbol;
13
13
  }
14
14
 
15
+ export default getNumberFormatted;
15
16
  /*
16
17
  * Tests
17
18
  */
@@ -2,4 +2,6 @@ import i18next from "i18next";
2
2
 
3
3
  export const getTranslatedLink = ( link:string ) => {
4
4
  return i18next.language === 'en' ? link : `/pl${link}`
5
- }
5
+ }
6
+
7
+ export default getTranslatedLink;
package/tsconfig.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "moduleResolution": "node",
19
19
  "jsx": "preserve",
20
20
  "allowJs": true,
21
- "types": ["vitest, vite/client", "@astrojs/ts","unplugin-vue-macros/macros-global", "unplugin-icons/types/astro"],
21
+ "types": ["vitest, vite/client", "@astrojs/ts","unplugin-vue-macros/macros-global", "unplugin-icons/types/astro", "src/types/astro.d.ts", "@astrojs/ts-plugin"],
22
22
  "paths": {
23
23
  "@components/*": ["components/*"],
24
24
  "@utils/*": ["utils/*"],