spoko-design-system 0.1.8 → 0.2.0

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.1.8",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "astro dev",
@@ -61,6 +61,7 @@
61
61
  "@unocss/preset-web-fonts": "^0.58.4",
62
62
  "@unocss/preset-wind": "^0.58.4",
63
63
  "@unocss/reset": "^0.58.4",
64
+ "@vite-pwa/astro": "^0.2.0",
64
65
  "@vueuse/core": "^10.7.2",
65
66
  "astro-compress": "^2.2.9",
66
67
  "astro-i18next": "1.0.0-beta.21",
Binary file
Binary file
@@ -17,7 +17,7 @@ const props = defineProps({
17
17
  </script>
18
18
 
19
19
  <template>
20
- <h2 class="font-headregular mb-2 font-medium text-lg colon-after" v-if="props.caption">{{ props.caption }}</h2>
20
+ <h2 class="mb-2 colon-after text-xl font-textbold block leading-none" v-if="props.caption">{{ props.caption }}</h2>
21
21
  <ul class="mb-6">
22
22
  <li v-for="item in props.items" class="leading-5">
23
23
  {{ item }}
@@ -3,7 +3,7 @@ import { PropType } from "vue";
3
3
  import ProductDetailName from "./ProductDetailName.vue";
4
4
 
5
5
  interface TableItem {
6
- slug: string,
6
+ id: string,
7
7
  name: string
8
8
  value: unknown
9
9
  }
@@ -29,7 +29,7 @@ const props = defineProps({
29
29
  <ProductDetailName as="th" :text="row.name" />
30
30
  <td>
31
31
  <slot
32
- :name="row.slug"
32
+ :name="row.id"
33
33
  >
34
34
  {{ row.value }}
35
35
  </slot>
@@ -48,7 +48,7 @@ const props = defineProps({
48
48
  tr,
49
49
  th {
50
50
  border: none;
51
- @apply leading-4 text-sm;
51
+ @apply leading-4 text-sm py-2;
52
52
  }
53
53
 
54
54
  th {
@@ -0,0 +1,23 @@
1
+ <script setup lang="ts">
2
+ import { PropType } from 'vue';
3
+
4
+ const props = defineProps({
5
+ as: {
6
+ type: String as PropType<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span'>,
7
+ default: 'div',
8
+ required: false,
9
+ },
10
+ text: {
11
+ type: String,
12
+ default: '',
13
+ required: false,
14
+ }
15
+ })
16
+ </script>
17
+
18
+ <template>
19
+ <component :is="props.as"
20
+ class="px-8 sm:px-8 mx-4 sm:mx-6 lg:max-w-4xl drop-shadow-primary text-2xl md:text-4xl lg:text-4.5xl relative font-light after:left-0 after:content-empty after:rounded-3xl after:top-0 after:absolute after:h-full after:border-solid after:border-[var(--primary)] after:border-l-3 after:z-0">
21
+ <slot>{{ props.text }}</slot>
22
+ </component>
23
+ </template>
@@ -0,0 +1,51 @@
1
+ <script src="./../pwa.ts"></script>
2
+ <div
3
+ id="pwa-toast"
4
+ role="alert"
5
+ aria-labelledby="toast-message"
6
+ >
7
+ <div class="message">
8
+ <span id="toast-message"></span>
9
+ </div>
10
+ <button id="pwa-refresh">
11
+ Reload
12
+ </button>
13
+ <button id="pwa-close">
14
+ Close
15
+ </button>
16
+ </div>
17
+
18
+ <style>
19
+ #pwa-toast {
20
+ visibility: hidden;
21
+ position: fixed;
22
+ right: 0;
23
+ bottom: 0;
24
+ margin: 16px;
25
+ padding: 12px;
26
+ border: 1px solid #8885;
27
+ border-radius: 4px;
28
+ z-index: 1;
29
+ text-align: left;
30
+ box-shadow: 3px 4px 5px 0 #8885;
31
+ }
32
+ #pwa-toast .message {
33
+ margin-bottom: 8px;
34
+ }
35
+ #pwa-toast button {
36
+ border: 1px solid #8885;
37
+ outline: none;
38
+ margin-right: 5px;
39
+ border-radius: 2px;
40
+ padding: 3px 10px;
41
+ }
42
+ #pwa-toast.show {
43
+ visibility: visible;
44
+ }
45
+ button#pwa-refresh {
46
+ display: none;
47
+ }
48
+ #pwa-toast.show.refresh button#pwa-refresh {
49
+ display: inline-block;
50
+ }
51
+ </style>
package/src/config.ts CHANGED
@@ -43,6 +43,7 @@ export const SIDEBAR = [
43
43
  { text: "Product Number", link: "/components/product-number/" },
44
44
  { text: "Product Tile", link: "/components/product-tile/" },
45
45
  { text: "Table", link: "/components/table/" },
46
+ { text: "Quote", link: "/components/quote/" },
46
47
 
47
48
  { text: "Extras", header: true },
48
49
  { text: "Flags", link: "/components/flags/" },
@@ -1,5 +1,6 @@
1
1
  ---
2
- import HeadCommon from "../components/HeadCommon.astro";
2
+ import HeadCommon from "./partials/HeadCommon.astro";
3
+ import FooterCommon from "./partials/FooterCommon.astro";
3
4
  import HeadSEO from "../components/HeadSEO.astro";
4
5
  import * as CONFIG from "../config";
5
6
  import { t, changeLanguage } from "i18next";
@@ -53,6 +54,7 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site).toString();
53
54
  />
54
55
  </a>
55
56
  </Copyright>
57
+ <FooterCommon />
56
58
  </footer>
57
59
  </body>
58
60
  </html>
@@ -1,6 +1,5 @@
1
1
  ---
2
- import { ViewTransitions } from "astro:transitions";
3
- import HeadCommon from "../components/HeadCommon.astro";
2
+ import HeadCommon from "./partials/HeadCommon.astro";
4
3
  import HeadSEO from "../components/HeadSEO.astro";
5
4
  import Header from "../components/Header/Header.astro";
6
5
  import PageContent from "../components/PageContent.astro";
@@ -35,7 +34,6 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site).toString();
35
34
  : CONFIG.SITE.title
36
35
  }
37
36
  </title>
38
- <ViewTransitions />
39
37
  </head>
40
38
 
41
39
  <body class="bg-blue-50">
@@ -0,0 +1,5 @@
1
+ ---
2
+ import ReloadPrompt from "../../components/ReloadPrompt.astro";
3
+ ---
4
+
5
+ <ReloadPrompt />
@@ -1,5 +1,6 @@
1
1
  ---
2
-
2
+ import { ViewTransitions } from "astro:transitions";
3
+ import { pwaInfo } from 'virtual:pwa-info';
3
4
  ---
4
5
 
5
6
  <!-- Global Metadata -->
@@ -38,3 +39,6 @@
38
39
  gtag('js', new Date());
39
40
  gtag('config', '');
40
41
  </script> -->
42
+
43
+ <ViewTransitions />
44
+ { pwaInfo && <Fragment set:html={pwaInfo.webManifest.linkTag} /> }
@@ -11,32 +11,32 @@ export const prcodesArray = ["PJ4", "CA2", "C4E", "2JZ"]
11
11
 
12
12
  export const tableItems = [
13
13
  {
14
- slug: "number",
14
+ id: "number",
15
15
  name: "Part number",
16
16
  value: "6R0071609GRU",
17
17
  },
18
18
  {
19
- slug: "prcodes",
19
+ id: "prcodes",
20
20
  name: "PR-Codes",
21
21
  value: ["PJ4", "CA2", "C4E", "2JZ"],
22
22
  },
23
23
  {
24
- slug: "color",
24
+ id: "color",
25
25
  name: "Color",
26
26
  value: "Black",
27
27
  },
28
28
  {
29
- slug: "position",
29
+ id: "position",
30
30
  name: "Fitting position",
31
31
  value: "Front axle",
32
32
  },
33
33
  {
34
- slug: "brake-disck-thicnkess",
34
+ id: "brake-disck-thicnkess",
35
35
  name: "Brake disc thicknes",
36
36
  value: "22 mm",
37
37
  },
38
38
  {
39
- slug: "weight",
39
+ id: "weight",
40
40
  name: "Weight",
41
41
  value: "5.185 kg"
42
42
  }
@@ -56,32 +56,32 @@ export const tableItems = [
56
56
  ```ts
57
57
  const tableItems = [
58
58
  {
59
- slug: "number",
59
+ id: "number",
60
60
  name: "Part number",
61
61
  value: "6R0071609GRU",
62
62
  },
63
63
  {
64
- slug: "prcodes",
64
+ id: "prcodes",
65
65
  name: "PR-Codes",
66
66
  value: ["PJ4", "CA2", "C4E"]
67
67
  },
68
68
  {
69
- slug: "color",
69
+ id: "color",
70
70
  name: "Color",
71
71
  value: "Black",
72
72
  },
73
73
  {
74
- slug: "position",
74
+ id: "position",
75
75
  name: "Fitting position",
76
76
  value: "Front axle",
77
77
  },
78
78
  {
79
- slug: "brake-disck-thicnkess",
79
+ id: "brake-disck-thicnkess",
80
80
  name: "Brake disc thicknes",
81
81
  value: "22 mm",
82
82
  },
83
83
  {
84
- slug: "weight",
84
+ id: "weight",
85
85
  name: "Weight",
86
86
  value: "5.185 kg"
87
87
  }
@@ -1,5 +1,4 @@
1
1
  ---
2
- import { changeLanguage } from "i18next";
3
2
  import MainLayout from "../../layouts/MainLayout.astro";
4
3
  import { Icon } from "astro-icon/components";
5
4
 
@@ -28,27 +27,22 @@ const ICONS = {
28
27
 
29
28
  <pre class="mt-6 astro-code bg-slate-800 text-white">import &#123; Icon &#125; from 'astro-icon/components';</pre>
30
29
  <div class="">
31
- {Object.keys(ICONS).map((key) => (
32
- <h2 class="mt-6 mx-2">
33
- <a href={`${iconifyUrl}${key}/`} target="_blank">
34
- {key}
35
- </a>
36
- </h2>
37
- <div class="inline-grid grid-cols-2 md:grid-cols-4 gap-0 w-full">
30
+ {Object.keys(ICONS).map((key) => (
31
+ <h2 class="mt-6 mx-2">
32
+ <a href={`${iconifyUrl}${key}/`} target="_blank">
33
+ {key}
34
+ </a>
35
+ </h2>
36
+ <div class="inline-grid grid-cols-2 md:grid-cols-4 gap-0 w-full">
38
37
  {ICONS[key].map((value) => (
39
- <div class="mx-1 mb-2">
38
+ <div class="mx-1 mb-2">
40
39
  <div class="component-preview ">
41
- <Icon name={`${key}:${value}`} class="text-3xl mx-auto text-light-blue-400" />
40
+ <Icon name={`${key}:${value}`} class="text-3xl mx-auto text-light-blue-400" />
42
41
  </div>
43
42
  <pre class="astro-code bg-slate-800 text-white text-sm text-center">&lt;Icon name={`"${key}:${value}"`} /&gt;</pre>
44
- </div>
43
+ </div>
45
44
  ))}
46
- </div>
47
- ))}
45
+ </div>
46
+ ))}
48
47
  </div>
49
-
50
-
51
-
52
48
  </MainLayout>
53
-
54
-
@@ -10,7 +10,7 @@ ProductNumber - with additional formatting adding spacing for Volkswagen product
10
10
 
11
11
  #
12
12
  <div class="component-preview">
13
- <div class="grid grid-cols-2 lg:grid-cols-4 gap-4 w-full bg-white p-y-5 px-4">
13
+ <div class="grid grid-cols-2 lg:grid-cols-4 gap-x-4 w-full bg-white p-y-5 px-4">
14
14
  <ProductNumber
15
15
  big
16
16
  productNumber="6R0920870F"
@@ -0,0 +1,33 @@
1
+ ---
2
+ title: "Quote"
3
+ layout: "../../layouts/MainLayout.astro"
4
+
5
+ ---
6
+
7
+ import Quote from '../../components/Quote.vue'
8
+
9
+
10
+ # Quote
11
+
12
+ Simple Quote component with left border in primary color.
13
+
14
+ <div class="component-preview">
15
+ <Quote text="Est adipisicing officia eiusmod consequat aliqua qui amet sunt magna in." />
16
+ </div>
17
+
18
+
19
+ ```html
20
+ <Quote text="Est adipisicing officia eiusmod consequat aliqua qui amet sunt magna in." />
21
+ ```
22
+
23
+ #
24
+
25
+
26
+ <div class="component-preview">
27
+ <Quote class="font-headlight text-center" text="Est adipisicing officia eiusmod consequat aliqua qui amet sunt magna in." />
28
+ </div>
29
+
30
+
31
+ ```html
32
+ <Quote class="font-headlight text-center" text="Est adipisicing officia eiusmod consequat aliqua qui amet sunt magna in." />
33
+ ```
@@ -32,7 +32,8 @@
32
32
  {FONTS.types.map(({name, value}) => (
33
33
  <div class="w-full">
34
34
  <div class={`${value} text-3xl`} >Lorem Ipsum</div>
35
- <div class="">{name}</div>
35
+ <div class="">{name}</div>
36
+ <code>{value}</code>
36
37
  </div>
37
38
  ))}
38
39
  </div>
@@ -6,6 +6,7 @@ import Jumbatron from "../components/Jumbatron.vue";
6
6
  import Layout from "../layouts/Layout.astro";
7
7
  import Headline from "../components/Headline.vue";
8
8
  import Button from "../components/Button.vue";
9
+ import Quote from "../components/Quote.vue";
9
10
 
10
11
  const navItems = [
11
12
  {
@@ -67,6 +68,14 @@ const navItems = [
67
68
  }
68
69
  </div>
69
70
  </nav>
71
+ <div class="my-12 py-20 bg-blue-700 bg-vw text-white flex items-center justify-center relative">
72
+ <Quote>
73
+ <blockquote>
74
+ Well done is better than well said.
75
+ <small class="block">-Benjamin Franklin</small>
76
+ </blockquote></Quote>
77
+ </div>
78
+
70
79
  </div>
71
80
  </Layout>
72
81
  <script is:inline></script>
package/src/pwa.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { registerSW } from 'virtual:pwa-register'
2
+
3
+ registerSW({
4
+ immediate: true,
5
+ onRegisteredSW(swScriptUrl) {
6
+ // eslint-disable-next-line no-console
7
+ console.log('SW registered: ', swScriptUrl)
8
+ },
9
+ onOfflineReady() {
10
+ // eslint-disable-next-line no-console
11
+ console.log('PWA application ready to work offline')
12
+ },
13
+ })
@@ -101,12 +101,6 @@ html {
101
101
  opacity: 0;
102
102
  }
103
103
 
104
- .colon-after {
105
- &:after {
106
- content: ':'
107
- }
108
- }
109
-
110
104
  .items {
111
105
  &>.item {
112
106
  &:not(:last-child) {
package/uno.config.ts CHANGED
@@ -28,6 +28,7 @@ export default defineConfig({
28
28
  transformerVariantGroup(),
29
29
  ],
30
30
  shortcuts: [
31
+ ['colon-after', 'after:content-[":"]'],
31
32
  ['headline','font-headlight font-bold '],
32
33
  ['badge', 'px-1.5 py-px text-white text-xs mb-1 max-w-fit whitespace-nowrap'],
33
34
  ['img--overlay','after:(content-empty bg-black bg-opacity-[.03] absolute w-full h-full top-0)'],
@@ -1,10 +0,0 @@
1
- <svg width="70" height="70" viewBox="0 0 70 70" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M59.4008 23.9454C59.3085 24.7845 58.8705 25.6033 57.9945 27.2409L38.8579 63.0169C37.3849 58.3378 35.1972 53.8377 32.2944 49.6873L45.2674 25.8805C45.4797 25.4909 45.411 25.0094 45.0987 24.6971C44.7855 24.3839 44.3024 24.3158 43.9125 24.5298L20.1826 37.557C16.0187 34.6351 11.5013 32.4342 6.80319 30.9539L42.6221 11.8558C44.2588 10.9832 45.0772 10.5469 45.9154 10.4555C46.6555 10.3747 47.403 10.4848 48.0867 10.7752C48.8612 11.1042 49.5142 11.7571 50.8202 13.0632L56.7917 19.0346C58.0994 20.3423 58.7532 20.9962 59.0822 21.7716C59.3726 22.4562 59.4823 23.2046 59.4008 23.9454Z" fill="white"/>
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M29.2823 56.055C26.7326 55.8617 23.1916 53.9277 20.0384 50.7745C16.1682 46.9043 14.1348 42.4501 14.902 39.9615C13.6613 40.5867 12.5245 41.5855 11.8424 42.2676C11.8424 42.2676 8.29031 45.4142 8.27954 50.0626C9.48919 48.853 11.4459 48.8485 12.6499 50.0525C14.7137 52.1163 12.9026 53.9228 11.4331 55.3885C11.3891 55.4324 11.3454 55.476 11.3021 55.5193C9.07462 57.7468 8.52027 61.0113 9.64259 63.7433C9.94951 62.8607 10.4559 62.0314 11.1618 61.3255C13.2862 59.2011 15.3186 59.6516 17.6808 60.1751C19.5603 60.5917 21.6485 61.0546 24.1578 60.3034C25.467 59.9114 26.7017 59.1976 27.737 58.1622C28.3738 57.5255 28.8889 56.8135 29.2823 56.055Z" fill="url(#paint0_linear_27_26)"/>
4
- <defs>
5
- <linearGradient id="paint0_linear_27_26" x1="21.1464" y1="43.106" x2="1.62677" y2="74.0121" gradientUnits="userSpaceOnUse">
6
- <stop stop-color="#8B90FF"/>
7
- <stop offset="1" stop-color="#0711FF"/>
8
- </linearGradient>
9
- </defs>
10
- </svg>