spoko-design-system 0.0.2 → 0.0.5

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.
Files changed (49) hide show
  1. package/.astro/icon.d.ts +10291 -2199
  2. package/.vscode/extensions.json +2 -1
  3. package/.vscode/settings.json +6 -0
  4. package/Layout/Header.astro +3 -3
  5. package/README.md +38 -13
  6. package/astro.config.mjs +24 -18
  7. package/package.json +79 -75
  8. package/public/favicon.ico +0 -0
  9. package/public/favicon.svg +0 -0
  10. package/public/locales/en/translation.json +5 -2
  11. package/public/locales/pl/translation.json +5 -2
  12. package/src/components/Badge.vue +1 -1
  13. package/src/components/Badges.vue +1 -1
  14. package/src/components/Button.vue +17 -8
  15. package/src/components/ButtonCopy.vue +52 -0
  16. package/src/components/Card.astro +25 -0
  17. package/src/components/HandDrive.astro +0 -1
  18. package/src/components/Header/Header.astro +1 -1
  19. package/src/components/Headline.vue +37 -5
  20. package/src/components/Image.astro +30 -0
  21. package/src/components/Jumbatron.vue +23 -8
  22. package/src/components/LeftSidebar.astro +9 -8
  23. package/src/components/PrCode.vue +156 -0
  24. package/src/components/ProductNumber.astro +117 -0
  25. package/src/components/ProductTile.astro +54 -0
  26. package/src/components/layout/Header.astro +1 -1
  27. package/src/config.ts +5 -1
  28. package/src/layouts/Layout.astro +0 -8
  29. package/src/layouts/MainLayout.astro +6 -14
  30. package/src/pages/components/badges.mdx +39 -7
  31. package/src/pages/components/breadcrumbs.mdx +37 -1
  32. package/src/pages/components/buttons.mdx +92 -11
  33. package/src/pages/components/card.mdx +40 -0
  34. package/src/pages/components/hand-drive.mdx +6 -1
  35. package/src/pages/components/headline.mdx +22 -3
  36. package/src/pages/components/icons.astro +23 -21
  37. package/src/pages/components/image.mdx +502 -0
  38. package/src/pages/components/jumbatron.mdx +33 -10
  39. package/src/pages/components/modal.mdx +8 -2
  40. package/src/pages/components/post-header.mdx +24 -2
  41. package/src/pages/components/pr-code.mdx +41 -0
  42. package/src/pages/components/product-number.mdx +65 -0
  43. package/src/pages/components/product-tile.mdx +39 -0
  44. package/src/pages/components/table.mdx +19 -0
  45. package/src/pages/core/introduction.mdx +3 -3
  46. package/src/pages/index.astro +25 -22
  47. package/src/styles/base/_base.scss +8 -0
  48. package/src/styles/content.scss +17 -1
  49. package/uno.config.ts +26 -7
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "recommendations": ["astro-build.astro-vscode"],
3
- "unwantedRecommendations": []
3
+ "unwantedRecommendations": [],
4
+ "lokalise.i18n-ally"
4
5
  }
@@ -0,0 +1,6 @@
1
+ {
2
+ "i18n-ally.sourceLanguage": "en",
3
+ "i18n-ally.keystyle": "nested",
4
+ "i18n-ally.localesPaths": "public/locales",
5
+ "i18n-ally.sortKeys": true,
6
+ }
@@ -42,7 +42,7 @@ const likes = {
42
42
  </span>
43
43
  </a>
44
44
  </div>
45
- <div class="hidden sm:block sm:ml-6">
45
+ <div class="hidden sm:(block ml-6)">
46
46
  <div class="flex space-x-4" itemprop="hasPart">
47
47
  <a
48
48
  href={`https://polo.blue${locale === "pl" ? "/pl" : ""}`}
@@ -55,7 +55,7 @@ const likes = {
55
55
  </div>
56
56
 
57
57
  <div
58
- class="relative md:block sm:ml-4 w-full sm:w-64 sm:mr-auto order-4 sm:order-2 h-10"
58
+ class="relative w-full order-4 h-10 md:(w-64 ml-4 mr-auto order-2 block)"
59
59
  >
60
60
  <Search
61
61
  id="search"
@@ -84,7 +84,7 @@ const likes = {
84
84
  </div>
85
85
 
86
86
  <div
87
- class="flex items-center pr-0 sm:static sm:inset-auto ml-auto sm:ml-6 -mr-2 dark:text-gray-400 print:hidden order-3 sm:order-3 w-20 justify-end"
87
+ class="flex items-center pr-0 ml-auto sm:ml-6 -mr-2 dark:text-gray-400 print:hidden order-3 w-20 justify-end md:(static inset-auto order-3)"
88
88
  itemprop="hasPart"
89
89
  itemscope
90
90
  itemtype="http://schema.org/SiteNavigationElement"
package/README.md CHANGED
@@ -1,23 +1,48 @@
1
- ---
2
- title: Introduction
3
- description: Docs intro
4
- layout: ../../layouts/MainLayout.astro
5
- ---
6
-
7
1
  # Spoko Design System
8
2
 
9
- Astro Design System is the easiest way to start your our design system. Since Astro is compatible with many frameworks, you can import your components and document them right in the markdown files.
3
+ SDS is the easiest way to start websites with simple design system. Since Astro is compatible with many frameworks, you can import your components and document them right in the markdown files.
4
+ The project is still in the development phase, use at your own risk ;-)
5
+ #
6
+ Please feel free to fork it, edit it and let me know what do you think about it.
7
+
8
+
9
+
10
+ | title | Introduction |
11
+ |-------------|--------------------------------|
12
+ | description | Docs intro |
13
+ | layout | ../../layouts/MainLayout.astro |
14
+
10
15
 
11
16
  ## Getting started
12
17
 
18
+ ### Installation
19
+
20
+ ```js
21
+ pnpm add spoko-design-system
22
+ ```
23
+
24
+ or just clone the repository.
25
+
26
+
27
+
28
+ Example:
29
+ - https://spoko-design-system.netlify.app/
30
+
31
+ #
32
+
33
+ Most of the components from this repository can be seen in my projects:
34
+
35
+ - http://catalog.polo.blue/
36
+ - https://polo.blue
37
+
38
+
39
+
13
40
  ### Adding new sections
14
41
 
15
42
  Although it's not required, you can create folders for new sections.
16
43
 
17
44
  To show the section on the left side navigation, add it to the navigation config file at `src/config.ts`.
18
45
 
19
- Example:
20
- https://spoko-design-system.netlify.app/
21
46
 
22
47
  ```js
23
48
  export const SIDEBAR = [
@@ -34,13 +59,13 @@ export const SIDEBAR = [
34
59
 
35
60
  ### Adding new pages
36
61
 
37
- To add new pages just create an .astro or markdown file in `src/pages/[section]/my-page.md`. Remember to add it to the navigation config in `src/config.ts` so it shows up in the left side navigation.
62
+ To add new pages just create an .astro or markdown file in `src/pages/[section]/my-page.mdx`. Remember to add it to the navigation config in `src/config.ts` so it shows up in the left side navigation.
38
63
 
39
64
  You're free to organize the pages however you want.
40
65
 
41
66
  ### Customizing Core section (colors, typography, shadows...)
42
67
 
43
- If you want to customize the default colors, typography or shadows you can find the configuration file at `src/config/design.config.ts`.
68
+ If you want to customize the default colors, typography or shadows you can find the configuration file at `src/config/design.config.ts`. I think I have prepared enough shades of blue ;-)
44
69
 
45
70
  Feel free to add new pages to the Core section
46
71
 
@@ -52,7 +77,7 @@ You can find the css for the pages in `src/styles/content.scss`.
52
77
 
53
78
  Astro is great for design systems because it allows you to import components from different frameworks like react, vue or svelte.
54
79
 
55
- To get started check how the `MainButton` component is used in the `src/pages/en/buttons.md` file.
80
+ To get started check how the `MainButton` component is used in the `src/pages/buttons.mdx` file.
56
81
 
57
82
  You can import your component library or create your own and document it easily.
58
83
 
@@ -66,4 +91,4 @@ There's a class called `.component-preview` that you can use to wrap your compon
66
91
 
67
92
  ### Have fun!
68
93
 
69
- Spoko Design System template was made by **[@spoko.space](https://spoko.space)** for personal and commercial use.
94
+ Spoko Design System template was made in Poland by **[@spoko.space](https://spoko.space)** for personal and commercial use.
package/astro.config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineConfig } from "astro/config";
1
+ import { defineConfig, sharpImageService } from "astro/config";
2
2
  // import tailwind from "@astrojs/tailwind";
3
3
  import vue from "@astrojs/vue";
4
4
  import mdx from '@astrojs/mdx';
@@ -15,31 +15,37 @@ export default defineConfig({
15
15
  server: {
16
16
  port: 1234
17
17
  },
18
+ image: {
19
+ service: sharpImageService(),
20
+ domains: ["api.polo.blue", "polo.blue", "media.istockphoto.com", "img.freepik.com"]
21
+ },
18
22
  integrations: [
19
- // Enable Preact to support Preact JSX components.
23
+ // Enable Vue to support Vue3 components.
20
24
  vue(),
21
- // tailwind(),
22
- mdx(), astroI18next(), UnoCSS({
25
+ mdx(),
26
+ astroI18next(),
27
+ // tailwind(), // sorry - Uno is better ;-P
28
+ UnoCSS({
23
29
  injectReset: true
24
30
  }), icon(
25
31
  {
26
32
  include: {
27
33
  // mdi: ["*"], // (Default) Loads entire Material Design Icon set
28
- mdi: ["facebook", "instagram", "post-it-note-edit-outline"], // Loads only Material Design Icon's "account" SVG
29
- 'ant-design': ["menu-fold-outlined", "menu-unfold-outlined", "menu-outlined", "cluster-outlined", "audit-outlined", "build-twotone" ],
30
- bi: ["envelope-open", "credit-card"],
31
- bx: ["arrow-back"],
32
- 'noto-1': ["letter-s"],
34
+ mdi: ["facebook", "instagram", "post-it-note-edit-outline", "car-hatchback", "car-door", "car-side", "car-windshield-outline", "car-light-alert", "car-tire-alert", "car-light-dimmed", "car-light-fog", "car-light-high", "car-parking-lights", "car-esp", "car-brake-abs", "car-horn", "engine-outline", "fan", "fan-off", "air-conditioner", "coolant-temperature", "car-brake-alert", "car-traction-control", "card-text-outline", "fuel", "oil", "hazard-lights", "credit-card-outline"],
35
+ "ant-design": ["menu-fold-outlined", "menu-unfold-outlined", "menu-outlined", "cluster-outlined", "audit-outlined", "build-twotone", "home-outlined", "close-outlined"],
36
+ bi: ["envelope-open", "credit-card", "qr-code", "list-check", "list-task", "text-indent-left", "text-indent-right", "tag", "tags", "x" ],
37
+ bx: ["arrow-back", "check", "detail", "file", "car", "credit-card", "barcode", "qr"],
33
38
  carbon: ["language", "checkmark", "home", "dicom-overlay"],
34
- el: ["star-empty", "star"],
35
- 'eos-icons': ["three-dots-loading"],
36
- fluent: ["share-android-24-regular"],
37
- 'fluent-emoji': ["cookie"],
38
- la: ["arrow-right", "arrow-left"],
39
- octicon: ["chevron-left-24", "x-24"],
40
- uil: ["map-marker", "envelope", "phone"],
41
- 'circle-flags': ["uk", "pl", "ua" ],
42
- ph: ["cat-thin"]
39
+ el: ["star-empty", "star", "heart-empty", "heart", "map-marker", "fire", "quote-right", "qrcode", "car", "indent-left", "indent-right", "ok"],
40
+ 'eos-icons': ["three-dots-loading", "bubble-loading", "loading", "installing"],
41
+ fluent: ["share-android-24-regular", "checkmark-24-filled", "tag-24-regular", "tag-multiple-24-regular" ],
42
+ "fluent-emoji": ["cookie", "construction", "warning", "wrench"],
43
+ la: ["arrow-right", "arrow-left", "car", "car-side"],
44
+ octicon: ["chevron-left-24", "x-24", "alert-24", "graph-24", "comment-24", "comment-discussion-24", "clock-24", "star-24", "star-fill-24", "file-media-24", "heart-24", "heart-fill-24", "project-roadmap-24", "location-24", "info-24", "mark-github-16"],
45
+ uil: ["map-marker", "envelope", "phone", "tag-alt"],
46
+ "simple-icons": ["ebay", "allegro", "volkswagen", "audi", "skoda", "seat", "whatsapp", "x", "facebook", "messenger", "instagram", "telegram"],
47
+ "icon-park-outline": ["shopping-bag", "comment", "comments", "tag-one"],
48
+ flowbite: ["arrow-left-outline", "arrow-right-outline", "angle-left-outline", "angle-right-outline", "chevron-left-outline", "chevron-right-outline","map-location-outline", "map-pin-alt-solid", "x-outline", "messages-outline", "arrow-down-to-bracket-outline", "check-outline"]
43
49
  }
44
50
  }
45
51
  )]
package/package.json CHANGED
@@ -1,75 +1,79 @@
1
- {
2
- "name": "spoko-design-system",
3
- "version": "0.0.2",
4
- "private": false,
5
- "scripts": {
6
- "dev": "astro dev",
7
- "start": "astro dev",
8
- "build": "astro build",
9
- "preview": "astro preview"
10
- },
11
- "dependencies": {
12
- "@algolia/client-search": "^4.22.1",
13
- "@astrojs/mdx": "^2.1.0",
14
- "@astrojs/node": "^7.0.4",
15
- "@astrojs/vue": "^4.0.8",
16
- "@docsearch/css": "^3.5.2",
17
- "@docsearch/react": "^3.5.2",
18
- "@iconify-json/ant-design": "^1.1.14",
19
- "@iconify-json/bi": "^1.1.23",
20
- "@iconify-json/bx": "^1.1.10",
21
- "@iconify-json/carbon": "^1.1.28",
22
- "@iconify-json/circle-flags": "^1.1.46",
23
- "@iconify-json/el": "^1.1.8",
24
- "@iconify-json/eos-icons": "^1.1.10",
25
- "@iconify-json/fluent": "^1.1.46",
26
- "@iconify-json/fluent-emoji": "1.1.18",
27
- "@iconify-json/la": "^1.1.8",
28
- "@iconify-json/mdi": "^1.1.64",
29
- "@iconify-json/noto-v1": "^1.1.11",
30
- "@iconify-json/octicon": "^1.1.52",
31
- "@iconify-json/ph": "^1.1.10",
32
- "@iconify-json/uil": "^1.1.8",
33
- "@iconify/json": "^2.2.175",
34
- "@iconify/vue": "^4.1.1",
35
- "@types/node": "^20.11.7",
36
- "@types/react": "^18.2.48",
37
- "@unocss/astro": "^0.58.4",
38
- "@unocss/preset-attributify": "^0.58.4",
39
- "@unocss/preset-typography": "^0.58.4",
40
- "@unocss/preset-uno": "^0.58.4",
41
- "@unocss/preset-web-fonts": "^0.58.4",
42
- "@unocss/preset-wind": "^0.58.4",
43
- "@unocss/reset": "^0.58.4",
44
- "astro-i18next": "1.0.0-beta.21",
45
- "astro-icon": "^1.0.2",
46
- "astro-navbar": "^2.3.0",
47
- "astro-pagefind": "^1.4.0",
48
- "i18next": "^23.7.19",
49
- "i18next-browser-languagedetector": "^7.2.0",
50
- "i18next-fs-backend": "^2.3.1",
51
- "i18next-http-backend": "^2.4.2",
52
- "i18next-vue": "^3.0.0",
53
- "preact": "^10.19.3",
54
- "react": "^18.2.0",
55
- "react-dom": "^18.2.0",
56
- "sass": "^1.70.0",
57
- "unocss": "^0.57.7",
58
- "vite": "^5.0.12",
59
- "vue": "^3.4.15"
60
- },
61
- "devDependencies": {
62
- "@astrojs/preact": "^3.1.0",
63
- "@astrojs/react": "^3.0.9",
64
- "@astrojs/tailwind": "^5.1.0",
65
- "@unocss/transformer-variant-group": "^0.58.4",
66
- "astro": "^4.2.4",
67
- "unocss": "^0.58.3"
68
- },
69
- "pnpm": {
70
- "overrides": {
71
- "file-type@>=17.0.0 <17.1.3": ">=17.1.3",
72
- "sharp@<0.30.5": ">=0.30.5"
73
- }
74
- }
75
- }
1
+ {
2
+ "name": "spoko-design-system",
3
+ "version": "0.0.5",
4
+ "private": false,
5
+ "scripts": {
6
+ "dev": "astro dev",
7
+ "start": "astro dev",
8
+ "build": "astro build",
9
+ "preview": "astro preview"
10
+ },
11
+ "dependencies": {
12
+ "@algolia/client-search": "^4.22.1",
13
+ "@astrojs/mdx": "^2.1.0",
14
+ "@astrojs/node": "^7.0.4",
15
+ "@astrojs/vue": "^4.0.8",
16
+ "@docsearch/css": "^3.5.2",
17
+ "@docsearch/react": "^3.5.2",
18
+ "@iconify-json/ant-design": "^1.1.14",
19
+ "@iconify-json/bi": "^1.1.23",
20
+ "@iconify-json/bx": "^1.1.10",
21
+ "@iconify-json/carbon": "^1.1.28",
22
+ "@iconify-json/circle-flags": "^1.1.46",
23
+ "@iconify-json/el": "^1.1.8",
24
+ "@iconify-json/eos-icons": "^1.1.10",
25
+ "@iconify-json/flowbite": "^1.1.0",
26
+ "@iconify-json/fluent": "^1.1.46",
27
+ "@iconify-json/fluent-emoji": "1.1.18",
28
+ "@iconify-json/icon-park-outline": "^1.1.15",
29
+ "@iconify-json/la": "^1.1.8",
30
+ "@iconify-json/mdi": "^1.1.64",
31
+ "@iconify-json/noto-v1": "^1.1.11",
32
+ "@iconify-json/octicon": "^1.1.52",
33
+ "@iconify-json/ph": "^1.1.10",
34
+ "@iconify-json/simple-icons": "^1.0.5",
35
+ "@iconify-json/uil": "^1.1.8",
36
+ "@iconify/json": "^2.2.175",
37
+ "@iconify/vue": "^4.1.1",
38
+ "@types/node": "^20.11.7",
39
+ "@types/react": "^18.2.48",
40
+ "@unocss/astro": "^0.58.4",
41
+ "@unocss/preset-attributify": "^0.58.4",
42
+ "@unocss/preset-typography": "^0.58.4",
43
+ "@unocss/preset-uno": "^0.58.4",
44
+ "@unocss/preset-web-fonts": "^0.58.4",
45
+ "@unocss/preset-wind": "^0.58.4",
46
+ "@unocss/reset": "^0.58.4",
47
+ "@vueuse/core": "^10.7.2",
48
+ "astro-i18next": "1.0.0-beta.21",
49
+ "astro-icon": "^1.0.2",
50
+ "astro-navbar": "^2.3.0",
51
+ "astro-pagefind": "^1.4.0",
52
+ "i18next": "^23.7.20",
53
+ "i18next-browser-languagedetector": "^7.2.0",
54
+ "i18next-fs-backend": "^2.3.1",
55
+ "i18next-http-backend": "^2.4.2",
56
+ "i18next-vue": "^3.0.0",
57
+ "preact": "^10.19.3",
58
+ "react": "^18.2.0",
59
+ "react-dom": "^18.2.0",
60
+ "sass": "^1.70.0",
61
+ "unocss": "^0.57.7",
62
+ "vite": "^5.0.12",
63
+ "vue": "^3.4.15"
64
+ },
65
+ "devDependencies": {
66
+ "@astrojs/preact": "^3.1.0",
67
+ "@astrojs/react": "^3.0.9",
68
+ "@astrojs/tailwind": "^5.1.0",
69
+ "@unocss/transformer-variant-group": "^0.58.4",
70
+ "astro": "^4.2.4",
71
+ "unocss": "^0.58.3"
72
+ },
73
+ "pnpm": {
74
+ "overrides": {
75
+ "file-type@>=17.0.0 <17.1.3": ">=17.1.3",
76
+ "sharp@<0.30.5": ">=0.30.5"
77
+ }
78
+ }
79
+ }
Binary file
Binary file
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "part": {
3
3
  "for-lhd": "For LHD cars (left-hand drive)",
4
- "for-rhd": "For RHD cars (right-hand drive)"
5
- }
4
+ "for-rhd": "For RHD cars (right-hand drive)",
5
+ "sw-position":"Steering wheel position"
6
+ },
7
+ "copied": "Copied",
8
+ "copy": "Copy product code"
6
9
  }
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "part": {
3
3
  "for-lhd": "Do pojazdów LHD (z kierownicą z lewej strony)",
4
- "for-rhd": "Do pojazdów RHD (z kierownicą z prawej strony)"
5
- }
4
+ "for-rhd": "Do pojazdów RHD (z kierownicą z prawej strony)",
5
+ "sw-position":"Pozycja kierownicy",
6
+ },
7
+ "copied": "Skopiowano",
8
+ "copy": "Skopiuj numer produktu"
6
9
  }
@@ -14,7 +14,7 @@ const props = defineProps({
14
14
  </script>
15
15
 
16
16
  <template>
17
- <div class="px-1.5 py-px text-white text-xs" :class="props.class">
17
+ <div class="badge" :class="props.class">
18
18
  {{ props.badge }}
19
19
  </div>
20
20
  </template>
@@ -18,7 +18,7 @@ const props = defineProps({
18
18
  <Badge
19
19
  v-for="(badge, index) in props.badges" :key="index"
20
20
  :badge="badge"
21
- :class="(badge.toLocaleLowerCase().includes('gti') ? 'bg-red-600' : '') || (badge.toLocaleLowerCase().includes('motorsport') ? 'bg-blue-600' : '')"
21
+ :class="(badge.toLocaleLowerCase().includes('gti') ? 'bg-red-600' : badge.toLocaleLowerCase().includes('motorsport') ? 'bg-blue-600' : 'bg-black')"
22
22
  />
23
23
  </div>
24
24
  </template>
@@ -1,28 +1,37 @@
1
1
  <script setup lang="ts">
2
- import { url } from "inspector";
3
2
  import { defineProps } from "vue";
4
3
 
5
4
  const props = defineProps<{
6
- url?: string;
5
+ href?: string;
6
+ title?: string;
7
7
  primary?: boolean;
8
+ tertiary?: boolean;
8
9
  secondary?: boolean;
9
10
  text?: boolean;
10
11
  tag?: boolean;
12
+ small?: boolean;
13
+ medium?: boolean;
11
14
  }>();
12
15
 
13
- const tag = url && url.length ? 'a' : 'button'
16
+ const tag = props.href && props.href.length ? 'a' : 'button'
14
17
 
15
18
  const classes = {
16
- "bg-lightBlue-500 border border-transparent font-medium hover:bg-lightBlue-600 inline-flex items-center justify-center md:px-10 md:py-2 md:text-lg px-8 py-3 rounded-full shadow text-base text-white": props.primary,
17
- "px-4 py-2 rounded-md transition-all shadow-sm hover:bg-opacity-80 font-medium text-blue-600 border-blue-500 border": props.secondary,
18
- "px-4 py-2 rounded-md transition-all shadow-sm hover:bg-opacity-80 font-medium text-blue-500 hover:bg-opacity-80 shadow-md": props.text,
19
- "bg-blue-100 text-blue-800 text-xs font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-blue-400 border border-blue-400 hover:border-blue-600": props.tag
19
+ "btn-primary": props.primary,
20
+ "btn-secondary": props.secondary,
21
+ "btn-tertiary": props.tertiary,
22
+ "btn-text": props.text,
23
+ "btn-tag": props.tag,
24
+ "btn-sm": props.medium,
25
+ "btn-xs": props.small,
26
+ "btn-normal": !props.small && !props.medium
20
27
  };
28
+
29
+
21
30
  </script>
22
31
 
23
32
 
24
33
  <template>
25
- <component :is="tag" :class="classes" :href="props.url">
34
+ <component :is="tag" :class="classes" :href="props.href" :title="props.title ? props.title : null">
26
35
  <slot></slot>
27
36
  </component>
28
37
  </template>
@@ -0,0 +1,52 @@
1
+ <script lang="ts" setup>
2
+
3
+ import { useClipboard } from "@vueuse/core";
4
+
5
+ import { Icon } from "@iconify/vue";
6
+ import { PropType } from "vue";
7
+
8
+ const props = defineProps({
9
+ productNumber: {
10
+ type: String,
11
+ default: '',
12
+ required: true,
13
+ },
14
+ tooltipClasses: {
15
+ type: String,
16
+ required: false,
17
+ default: '',
18
+ },
19
+ texts: {
20
+ type: Object as PropType<{ copy: String, copied: String }>,
21
+ required: true,
22
+ default: {
23
+ copy: 'copy',
24
+ copied: 'copied',
25
+ }
26
+ }
27
+ })
28
+ const source = props.productNumber;
29
+ const { copy, copied, isSupported } = useClipboard({ source });
30
+
31
+ </script>
32
+
33
+
34
+ <template>
35
+ <button v-if="isSupported" :aria-label="String(texts.copy)"
36
+ class="btn-copy has-tooltip" @click="copy()">
37
+ <span :class="`tooltip rounded-full btn-copy-text ${tooltipClasses}`" :data-text="!copied ? texts.copy : texts.copied" />
38
+ <Icon icon="ph-copy-simple-light" class="leading-none w-full h-full" />
39
+ </button>
40
+ </template>
41
+
42
+ <style>
43
+
44
+ .tooltip {
45
+ @apply invisible absolute;
46
+ }
47
+
48
+ .has-tooltip:hover .tooltip {
49
+ @apply visible z-50;
50
+ }
51
+
52
+ </style>
@@ -0,0 +1,25 @@
1
+ ---
2
+ const { class: className, imgSrc, imgAlt } = Astro.props;
3
+
4
+ import Image from '../components/Image.astro'
5
+ ---
6
+
7
+ <div class="bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700 overflow-hidden">
8
+ <a href="#" class="aspect-ratio-video block relative">
9
+ { imgSrc && (
10
+ <Image
11
+ imageObject={
12
+ {
13
+ src: imgSrc,
14
+ alt: imgAlt,
15
+ height: '405',
16
+ width: '720',
17
+ }
18
+ }
19
+ />
20
+ )}
21
+ </a>
22
+ <div class="p-5">
23
+ <slot />
24
+ </div>
25
+ </div>
@@ -1,7 +1,6 @@
1
1
  ---
2
2
 
3
3
  const { class: className, handDrive, biggerText } = Astro.props;
4
- // import { t, locale} from "i18next";
5
4
  import { t } from "i18next";
6
5
  import { Image } from 'astro:assets';
7
6
  import handDriveImage from "../assets/hand-drive.svg";
@@ -13,7 +13,7 @@ import { MenuIcon } from "astro-navbar";
13
13
  class="mx-auto flex justify-between items-center px-4"
14
14
  >
15
15
  <div class="flex flex-nowrap">
16
- <MenuIcon class="w-4 h-4 text-gray-800 sm:hidden mr-4" />
16
+ <MenuIcon class="w-4 h-4 text-gray-800 lg:hidden mr-4" />
17
17
  <a class="text-2xl font-medium block font-textbold" href="/"> SDS</a>
18
18
  </div>
19
19
  <div class="flex gap-2">
@@ -9,20 +9,52 @@ const props = defineProps({
9
9
  required: true,
10
10
  },
11
11
  textSize: {
12
- type: String as PropType<'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl'>,
12
+ type: String as PropType<'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl'>,
13
13
  required: false,
14
14
  default: null
15
+ },
16
+ underline: {
17
+ type: Boolean,
18
+ required: false,
19
+ default: false
15
20
  }
16
21
  })
17
22
 
18
23
  </script>
19
24
 
20
25
  <template>
21
- <component
22
- :is="props.as" class="mb-2.5 flex sm:block md:flex items-center leading-none" :class="props.textSize ? `text-${props.textSize}` : 'text-xl'"
23
- >
26
+ <component :is="props.as" class="mb-2.5 flex sm:block md:flex items-center leading-none"
27
+ :class="`headline ${props.textSize ? `text-${props.textSize}` : 'text-xl'} ${props.underline ? 'headline--underline' : ''}`">
24
28
  <!-- default -->
25
29
  <slot />
26
30
 
27
31
  </component>
28
- </template>
32
+ </template>
33
+
34
+ <style lang="scss">
35
+
36
+ .headline--underline {
37
+ @apply relative pb-4;
38
+
39
+ &:after {
40
+ content: "";
41
+ position: absolute;
42
+ left: 0;
43
+ bottom: 0;
44
+ height: 3px;
45
+ width: 55px;
46
+ background-color: var(--primary);
47
+ }
48
+
49
+ &:before {
50
+ content: "";
51
+ position: absolute;
52
+ left: 0;
53
+ bottom: 1px;
54
+ height: 1px;
55
+ width: 95%;
56
+ max-width: 255px;
57
+ background-color: #64748b
58
+ }
59
+ }
60
+ </style>
@@ -0,0 +1,30 @@
1
+ ---
2
+ import { Image } from 'astro:assets'
3
+
4
+ const { imageObject } = Astro.props;
5
+
6
+ let inputProps = {};
7
+
8
+
9
+ if (imageObject.index && imageObject.index === 1) {
10
+ inputProps['data-pagefind-meta'] = 'image[src], image_alt[alt]';
11
+ inputProps['loading'] = 'eager'
12
+ }
13
+
14
+ if (imageObject.srcset && imageObject.srcset.length) {
15
+ inputProps['widths'] = imageObject.srcset
16
+ }
17
+
18
+ ---
19
+ <Image
20
+ src={imageObject.src}
21
+ alt={imageObject.alt}
22
+ height={imageObject.height}
23
+ width={imageObject.width}
24
+ itemprop="image"
25
+ format="avif"
26
+ data-pagefind-index-attrs="alt"
27
+ onerror="this.style.display='none';"
28
+ class={`h-full w-full select-none pointer-none ${imageObject.class || 'object-cover'}`}
29
+ { ...inputProps}
30
+ />