spoko-design-system 0.0.1 → 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 (113) hide show
  1. package/.astro/icon.d.ts +8109 -10
  2. package/.github/workflows/deploy.yml +39 -39
  3. package/.stackblitzrc +5 -5
  4. package/.vscode/extensions.json +5 -4
  5. package/.vscode/launch.json +11 -11
  6. package/.vscode/settings.json +6 -0
  7. package/LICENSE +21 -21
  8. package/Layout/Header.astro +111 -89
  9. package/README.md +94 -69
  10. package/astro-i18next.config.mjs +17 -17
  11. package/astro-i18next.config.ts +10 -10
  12. package/astro.config.mjs +51 -42
  13. package/index.ts +6 -6
  14. package/package.json +25 -17
  15. package/public/astro-design-system-logo.svg +10 -10
  16. package/public/favicon.ico +0 -0
  17. package/public/favicon.svg +0 -0
  18. package/public/fonts/lg.svg +53 -53
  19. package/public/fonts/vwhead-bold-demo.html +549 -549
  20. package/public/fonts/vwhead-regular-demo.html +549 -549
  21. package/public/fonts/vwtext-bold-demo.html +549 -549
  22. package/public/fonts/vwtext-regular-demo.html +549 -549
  23. package/public/github.svg +3 -3
  24. package/public/grid_dot.svg +4 -4
  25. package/public/linkedin.svg +44 -44
  26. package/public/locales/en/translation.json +8 -5
  27. package/public/locales/pl/translation.json +8 -5
  28. package/public/make-scrollable-code-focusable.js +3 -3
  29. package/public/polo.blue.svg +29 -0
  30. package/public/spoko.space.svg +71 -0
  31. package/public/twitter.svg +46 -46
  32. package/sandbox.config.json +11 -11
  33. package/src/MyComponent.astro +8 -8
  34. package/src/components/Badge.vue +19 -19
  35. package/src/components/Badges.vue +24 -23
  36. package/src/components/Breadcrumbs.vue +108 -111
  37. package/src/components/Button.vue +37 -0
  38. package/src/components/ButtonCopy.vue +52 -0
  39. package/src/components/Card.astro +25 -0
  40. package/src/components/CategoryLink.astro +18 -0
  41. package/src/components/Copyright.astro +11 -11
  42. package/src/components/Date.astro +7 -0
  43. package/src/components/FuckRussia.vue +65 -65
  44. package/src/components/HandDrive.astro +29 -30
  45. package/src/components/HeadCommon.astro +40 -40
  46. package/src/components/HeadSEO.astro +41 -41
  47. package/src/components/Header/AstroLogo.astro +7 -27
  48. package/src/components/Header/Header.astro +44 -48
  49. package/src/components/Header/SkipToContent.astro +1 -1
  50. package/src/components/Headline.vue +60 -0
  51. package/src/components/Image.astro +30 -0
  52. package/src/components/Jumbatron.vue +46 -31
  53. package/src/components/LeftSidebar.astro +45 -44
  54. package/src/components/MainColors.vue +29 -29
  55. package/src/components/MainInput.vue +18 -18
  56. package/src/components/MainTable.vue +40 -45
  57. package/src/components/Modal.astro +30 -0
  58. package/src/components/PageContent.astro +14 -14
  59. package/src/components/PostHeader.astro +104 -0
  60. package/src/components/PrCode.vue +156 -0
  61. package/src/components/ProductNumber.astro +117 -0
  62. package/src/components/ProductTile.astro +54 -0
  63. package/src/components/RightSidebar.astro +15 -11
  64. package/src/components/SlimBanner.vue +59 -59
  65. package/src/components/TableOfContents.astro +11 -11
  66. package/src/components/Translations.vue +27 -0
  67. package/src/components/flags/FlagPL.vue +2 -2
  68. package/src/components/flags/FlagUA.vue +2 -2
  69. package/src/components/layout/Header.astro +50 -69
  70. package/src/config.ts +51 -42
  71. package/src/design.config.ts +73 -92
  72. package/src/env.d.ts +1 -1
  73. package/src/flag-poland.svg +1 -0
  74. package/src/flag-uk.svg +1 -0
  75. package/src/layouts/Layout.astro +43 -0
  76. package/src/layouts/MainLayout.astro +60 -50
  77. package/src/pages/components/badges.mdx +69 -35
  78. package/src/pages/components/breadcrumbs.mdx +136 -103
  79. package/src/pages/components/buttons.mdx +143 -60
  80. package/src/pages/components/card.mdx +40 -0
  81. package/src/pages/components/copyright.mdx +41 -24
  82. package/src/pages/components/flags.mdx +40 -26
  83. package/src/pages/components/fuck-russia.mdx +39 -16
  84. package/src/pages/components/hand-drive.mdx +38 -27
  85. package/src/pages/components/headline.mdx +148 -0
  86. package/src/pages/components/icons.astro +54 -45
  87. package/src/pages/components/image.mdx +502 -0
  88. package/src/pages/components/input.mdx +45 -14
  89. package/src/pages/components/jumbatron.mdx +71 -48
  90. package/src/pages/components/modal.mdx +64 -0
  91. package/src/pages/components/post-header.mdx +58 -0
  92. package/src/pages/components/pr-code.mdx +41 -0
  93. package/src/pages/components/product-number.mdx +65 -0
  94. package/src/pages/components/product-tile.mdx +39 -0
  95. package/src/pages/components/slimbanner.mdx +29 -27
  96. package/src/pages/components/table.mdx +39 -20
  97. package/src/pages/core/colors.mdx +8 -8
  98. package/src/pages/core/introduction.mdx +74 -68
  99. package/src/pages/core/shadows.astro +20 -20
  100. package/src/pages/core/typography.astro +46 -46
  101. package/src/pages/index.astro +70 -52
  102. package/src/pages/patterns/introduction.mdx +60 -61
  103. package/src/styles/_variables.scss +75 -75
  104. package/src/styles/base/_base.scss +166 -158
  105. package/src/styles/base/_typography.scss +147 -147
  106. package/src/styles/content.scss +66 -71
  107. package/src/styles/main.scss +22 -22
  108. package/tailwind.config.cjs +8 -8
  109. package/tsconfig.json +11 -11
  110. package/uno.config.ts +246 -227
  111. package/src/components/MainButton.vue +0 -26
  112. package/src/components/MainStatusPill.vue +0 -32
  113. package/src/pages/components/status-pill.mdx +0 -22
@@ -1,111 +1,108 @@
1
- <script setup lang="ts">
2
-
3
- export interface Breadcrumb {
4
- name: string,
5
- path: string
6
- }
7
-
8
- import type { PropType } from 'vue'
9
-
10
- const props = defineProps({
11
- showBack: {
12
- type: Boolean,
13
- required: false,
14
- },
15
- textBack: {
16
- type: String,
17
- required: false,
18
- default: 'Back'
19
- },
20
- showHome: {
21
- type: Boolean,
22
- required: false,
23
- },
24
- breadcrumbs: {
25
- type: Object as PropType<Breadcrumb[]>,
26
- required: true
27
- },
28
- locale: {
29
- type: String,
30
- required: false,
31
- default: 'en'
32
- },
33
- productNumber: {
34
- type: String,
35
- required: false,
36
- default: null
37
- }
38
-
39
- })
40
-
41
- const isLast = (index: Number) => {
42
- return index === props.breadcrumbs.length - 1
43
- }
44
- </script>
45
-
46
- <template>
47
- <nav>
48
- <ul class="breadcrumbs flex items-center p-0 leading-none ">
49
- <li v-if="props.showBack" class="breadcrumb-item flex">
50
- <button class="breadcrumb-link flex items-center px-0 py-2 sm:py-1 hover:text-lightBlue-500 whitespace-nowrap px-3 my-auto"
51
- :title="props.textBack" onclick="history.back()"
52
- i-bx-bx-arrow-back />
53
- </li>
54
- </ul>
55
- <ul class="breadcrumbs flex items-center p-0 overflow-x-auto overflow-y-hidden sm:mr-12 leading-none " itemscope
56
- itemtype="https://schema.org/BreadcrumbList">
57
- <li v-if="props.showHome" class="breadcrumb-item flex">
58
- <a href="/" class="breadcrumb-link flex items-center px-0 py-2 sm:py-1 hover:text-lightBlue-400 whitespace-nowrap translate-y-0 text-sm my-auto px-3"
59
- title="t('button.home')" itemprop="item" i-carbon-home>
60
- </a>
61
- <meta itemprop="position" content="1">
62
- </li>
63
- <li v-for="(crumb, index) in breadcrumbs" :key="index" class="breadcrumb-item flex" itemprop="itemListElement"
64
- itemscope itemtype="https://schema.org/ListItem">
65
- <a v-if="!isLast(index)" :href="crumb.path" class="breadcrumb-link whitespace-nowrap py-2 sm:py-1 px-1" itemprop="item" :title="`Polo 6R ${crumb.name}`">
66
- <strong class="font-normal" itemprop="name">{{ crumb.name }}</strong>
67
- </a>
68
- <a v-else :href="crumb.path"
69
- class="breadcrumb-link breadcrumb-link--disabled whitespace-nowrap pointer-events-none py-2 sm:py-1 px-1" :title="`Polo 6R ${crumb.name} ${productNumber}`">
70
- <strong class="font-normal" itemprop="name" v-html="crumb.name" /> <b>{{ productNumber }}</b>
71
- </a>
72
- <meta itemprop="position" :content="String(props.showHome ? index + 2 : index + 1)">
73
- </li>
74
- </ul>
75
- </nav>
76
- </template>
77
-
78
- <style lang="scss" scoped>
79
- .breadcrumbs {
80
- list-style: none;
81
- font-size: 0.875rem;
82
- }
83
-
84
- .breadcrumb-item {
85
-
86
- &+.breadcrumb-item:before {
87
- @apply py-2 sm:py-1 px-1;
88
- display: inline-block;
89
- padding-right: .5rem;
90
- color: #bdbdbd;
91
- content: "/";
92
- }
93
-
94
- b {
95
- @apply hidden sm:inline font-normal;
96
- }
97
- }
98
-
99
- .breadcrumb-link {
100
- border: 0;
101
- cursor: pointer;
102
-
103
- &--disabled {
104
- cursor: default;
105
-
106
- &:hover {
107
- color: inherit;
108
- }
109
- }
110
- }
111
- </style>
1
+ <script setup lang="ts">
2
+
3
+ export interface Breadcrumb {
4
+ name: string,
5
+ path: string
6
+ }
7
+
8
+ import type { PropType } from 'vue'
9
+
10
+ const props = defineProps({
11
+ showBack: {
12
+ type: Boolean,
13
+ required: false,
14
+ },
15
+ textBack: {
16
+ type: String,
17
+ required: false,
18
+ default: 'Back'
19
+ },
20
+ showHome: {
21
+ type: Boolean,
22
+ required: false,
23
+ },
24
+ breadcrumbs: {
25
+ type: Object as PropType<Breadcrumb[]>,
26
+ required: true
27
+ },
28
+ productNumber: {
29
+ type: String,
30
+ required: false,
31
+ default: null
32
+ }
33
+
34
+ })
35
+
36
+ const isLast = (index: Number) => {
37
+ return index === props.breadcrumbs.length - 1
38
+ }
39
+ </script>
40
+
41
+ <template>
42
+ <nav>
43
+ <ul class="breadcrumbs flex items-center p-0 leading-none ">
44
+ <li v-if="props.showBack" class="breadcrumb-item flex">
45
+ <button
46
+ class="breadcrumb-link flex items-center px-0 py-2 sm:py-1 hover:text-lightBlue-500 whitespace-nowrap px-3 my-auto"
47
+ :title="props.textBack" onclick="history.back()" i-bx-bx-arrow-back />
48
+ </li>
49
+ </ul>
50
+ <ul class="breadcrumbs flex items-center p-0 overflow-x-auto overflow-y-hidden sm:mr-12 leading-none " itemscope
51
+ itemtype="https://schema.org/BreadcrumbList">
52
+ <li v-if="props.showHome" class="breadcrumb-item flex">
53
+ <a href="/"
54
+ class="breadcrumb-link flex items-center px-0 py-2 sm:py-1 hover:text-lightBlue-400 whitespace-nowrap translate-y-0 text-sm my-auto px-3"
55
+ :title="textBack" itemprop="item" i-carbon-home>
56
+ </a>
57
+ <meta itemprop="position" content="1">
58
+ </li>
59
+ <li v-for="(crumb, index) in breadcrumbs" :key="index" class="breadcrumb-item flex" itemprop="itemListElement"
60
+ itemscope itemtype="https://schema.org/ListItem">
61
+ <a v-if="!isLast(index)" :href="crumb.path" class="breadcrumb-link whitespace-nowrap py-2 sm:py-1 px-1"
62
+ itemprop="item" :title="`Polo 6R ${crumb.name}`">
63
+ <strong class="font-normal" itemprop="name">{{ crumb.name }}</strong>
64
+ </a>
65
+ <a v-else :href="crumb.path"
66
+ class="breadcrumb-link breadcrumb-link--disabled whitespace-nowrap pointer-events-none py-2 sm:py-1 px-1"
67
+ :title="`Polo 6R ${crumb.name} ${productNumber}`">
68
+ <strong class="font-normal" itemprop="name" v-html="crumb.name" /> <b>{{ productNumber }}</b>
69
+ </a>
70
+ <meta itemprop="position" :content="String(props.showHome ? index + 2 : index + 1)">
71
+ </li>
72
+ </ul>
73
+ </nav>
74
+ </template>
75
+
76
+ <style lang="scss" scoped>
77
+ .breadcrumbs {
78
+ list-style: none;
79
+ font-size: 0.875rem;
80
+ }
81
+
82
+ .breadcrumb-item {
83
+
84
+ &+.breadcrumb-item:before {
85
+ @apply py-2 sm:py-1 px-1;
86
+ display: inline-block;
87
+ padding-right: .5rem;
88
+ color: #bdbdbd;
89
+ content: "/";
90
+ }
91
+
92
+ b {
93
+ @apply hidden sm:inline font-normal;
94
+ }
95
+ }
96
+
97
+ .breadcrumb-link {
98
+ border: 0;
99
+ cursor: pointer;
100
+
101
+ &--disabled {
102
+ cursor: default;
103
+
104
+ &:hover {
105
+ color: inherit;
106
+ }
107
+ }
108
+ }</style>
@@ -0,0 +1,37 @@
1
+ <script setup lang="ts">
2
+ import { defineProps } from "vue";
3
+
4
+ const props = defineProps<{
5
+ href?: string;
6
+ title?: string;
7
+ primary?: boolean;
8
+ tertiary?: boolean;
9
+ secondary?: boolean;
10
+ text?: boolean;
11
+ tag?: boolean;
12
+ small?: boolean;
13
+ medium?: boolean;
14
+ }>();
15
+
16
+ const tag = props.href && props.href.length ? 'a' : 'button'
17
+
18
+ const classes = {
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
27
+ };
28
+
29
+
30
+ </script>
31
+
32
+
33
+ <template>
34
+ <component :is="tag" :class="classes" :href="props.href" :title="props.title ? props.title : null">
35
+ <slot></slot>
36
+ </component>
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>
@@ -0,0 +1,18 @@
1
+ ---
2
+ const { categories } = Astro.props;
3
+ ---
4
+
5
+ <div class="text-light-blue-400 uppercase text-base z-3 relative w-full">
6
+ {
7
+ categories
8
+ ? categories.map((category) => (
9
+ <a
10
+ class="term-link text-sm sm:text-base not-first:(before:content-empty) before:(w-px h-2.5 bg-gray-300 mx-2.5 inline-block relative)"
11
+ href={category.uri}
12
+ >
13
+ {category.name}
14
+ </a>
15
+ ))
16
+ : null
17
+ }
18
+ </div>
@@ -1,12 +1,12 @@
1
- ---
2
- const { class: className } = Astro.props
3
- ---
4
-
5
- <div class="bg-vw h-11 flex items-center font-headlight justify-between px-4" class:list={[className]}>
6
- <slot name="left-item"/>
7
- <slot name="middle-item"/>
8
- <slot name="right-item"/>
9
- </div>
10
-
11
-
1
+ ---
2
+ const { class: className } = Astro.props
3
+ ---
4
+
5
+ <div class="bg-vw h-11 flex items-center font-headlight justify-between px-4" class:list={[className]}>
6
+ <slot name="left-item"/>
7
+ <slot name="middle-item"/>
8
+ <slot name="right-item"/>
9
+ </div>
10
+
11
+
12
12
 
@@ -0,0 +1,7 @@
1
+ ---
2
+ const { date } = Astro.props;
3
+ ---
4
+
5
+ <time class="text-sm flex items-center mr-2" datetime={date}>
6
+ {new Date(date).toLocaleDateString()}
7
+ </time>
@@ -1,65 +1,65 @@
1
- <template>
2
- <div class="relative" title="FUCK PUTIN! FUCK RUZZIA!">
3
- <div i-mdi:tank class="inline-block bg-ukraine mr-1 mt-0.5" />
4
- <div i-mdi:tank class="inline-block bg-ukraine mr-1 mt-0.5" />
5
- <div i-mdi:tank class="inline-block bg-ukraine mr-5 mt-0.5" />
6
- <div class="relative">
7
- <div class="inline-block absolute" i-noto-v1:flag-for-flag-russia />
8
- <div i-emojione:fire class="inline-block absolute -mt-1 animate-ping animate-pulseR" />
9
- </div>
10
- <div class="absolute left-0 animate-bull animate-bull--1 -mt-1">
11
- <div i-mdi:bullet class="rotate-90 inline-block bg-yellow " />
12
- </div>
13
- <div class="absolute left-0 animate-bull animate-bull animate-bull--2 -mt-1">
14
- <div i-mdi:bullet class="rotate-90 inline-block bg-yellow " />
15
- </div>
16
- <div class="absolute left-0 animate-bull animate-bull--3 -mt-1">
17
- <div i-mdi:bullet class="rotate-90 inline-block bg-yellow " />
18
- </div>
19
- </div>
20
- </template>
21
-
22
- <style lang="scss">
23
- .bg-ukraine {
24
- background: linear-gradient(180deg, #0066cc 56%, rgba(255,204,0,1) 44%);
25
- }
26
-
27
- .animate-bull {
28
- top: -2px;
29
- // @apply rotate-90;
30
-
31
- animation-iteration-count: infinite;
32
-
33
- &--1 {
34
- animation-duration: 2s;
35
- animation-name: AnimateBull1;
36
- }
37
-
38
- &--2 {
39
- animation-duration: 1.332s;
40
- animation-name: AnimateBull2;
41
- animation-delay: 1s;
42
- }
43
-
44
- &--3 {
45
- animation-duration: 0.666s;
46
- animation-name: AnimateBull3;
47
- animation-delay: 2s;
48
- }
49
- }
50
-
51
- @keyframes AnimateBull1 {
52
- 0% {transform: translate(14px,0px);}
53
- 100% {transform: translate(86px,0px);}
54
- }
55
-
56
- @keyframes AnimateBull2 {
57
- 0% {transform: translate(38px,0px);}
58
- 100% {transform: translate(80px,0px);}
59
- }
60
-
61
- @keyframes AnimateBull3 {
62
- 0% {transform: translate(62px,0px);}
63
- 100% {transform: translate(88px,0px);}
64
- }
65
- </style>
1
+ <template>
2
+ <div class="relative flex" title="FUCK PUTIN! FUCK RUZZIA!">
3
+ <div i-mdi:tank class="inline-block bg-ukraine mr-1 mt-0.5" />
4
+ <div i-mdi:tank class="inline-block bg-ukraine mr-1 mt-0.5" />
5
+ <div i-mdi:tank class="inline-block bg-ukraine mr-5 mt-0.5" />
6
+ <div class="relative">
7
+ <div class="inline-block absolute" i-noto-v1:flag-for-flag-russia />
8
+ <div i-emojione:fire class="inline-block absolute -mt-1 animate-ping animate-pulseR" />
9
+ </div>
10
+ <div class="absolute left-0 animate-bull animate-bull--1 -mt-1">
11
+ <div i-mdi:bullet class="rotate-90 inline-block bg-yellow " />
12
+ </div>
13
+ <div class="absolute left-0 animate-bull animate-bull animate-bull--2 -mt-1">
14
+ <div i-mdi:bullet class="rotate-90 inline-block bg-yellow " />
15
+ </div>
16
+ <div class="absolute left-0 animate-bull animate-bull--3 -mt-1">
17
+ <div i-mdi:bullet class="rotate-90 inline-block bg-yellow " />
18
+ </div>
19
+ </div>
20
+ </template>
21
+
22
+ <style lang="scss">
23
+ .bg-ukraine {
24
+ background: linear-gradient(180deg, #0066cc 56%, rgba(255,204,0,1) 44%);
25
+ }
26
+
27
+ .animate-bull {
28
+ top: -2px;
29
+ // @apply rotate-90;
30
+
31
+ animation-iteration-count: infinite;
32
+
33
+ &--1 {
34
+ animation-duration: 2s;
35
+ animation-name: AnimateBull1;
36
+ }
37
+
38
+ &--2 {
39
+ animation-duration: 1.332s;
40
+ animation-name: AnimateBull2;
41
+ animation-delay: 1s;
42
+ }
43
+
44
+ &--3 {
45
+ animation-duration: 0.666s;
46
+ animation-name: AnimateBull3;
47
+ animation-delay: 2s;
48
+ }
49
+ }
50
+
51
+ @keyframes AnimateBull1 {
52
+ 0% {transform: translate(14px,0px);}
53
+ 100% {transform: translate(86px,0px);}
54
+ }
55
+
56
+ @keyframes AnimateBull2 {
57
+ 0% {transform: translate(38px,0px);}
58
+ 100% {transform: translate(80px,0px);}
59
+ }
60
+
61
+ @keyframes AnimateBull3 {
62
+ 0% {transform: translate(62px,0px);}
63
+ 100% {transform: translate(88px,0px);}
64
+ }
65
+ </style>
@@ -1,31 +1,30 @@
1
- ---
2
-
3
- const { class: className, handDrive, biggerText } = Astro.props;
4
- // import { t, locale} from "i18next";
5
- import { t } from "i18next";
6
- import { Image } from 'astro:assets';
7
- import handDriveImage from "../assets/hand-drive.svg";
8
-
9
- const getHandDriveName = (value: number) => {
10
- if (value === 1)
11
- return 'lhd'
12
-
13
- else
14
- return 'rhd'
15
- }
16
-
17
- const handDriveName = getHandDriveName(handDrive)
18
- ---
19
- <div title={handDriveName.toUpperCase()} class="flex items-center" class:list={className}>
20
- <Image src={handDriveImage} alt="infoObject.product.hand_drive" width={48} height={34} class={handDriveName} />
21
- <div data-pagefind-filter={`${t('part.sw-position')}:${handDriveName.toUpperCase()}`}
22
- class={`sm:ml-2 order-0 ${!biggerText ? 'text-xxs md:text-xs' : 'order-0'}`}
23
- set:html={t(`part.for-${handDriveName}`)}
24
- />
25
- </div>
26
-
27
- <style lang="scss">
28
- .rhd {
29
- transform: scaleX(-1);
30
- }
1
+ ---
2
+
3
+ const { class: className, handDrive, biggerText } = Astro.props;
4
+ import { t } from "i18next";
5
+ import { Image } from 'astro:assets';
6
+ import handDriveImage from "../assets/hand-drive.svg";
7
+
8
+ const getHandDriveName = (value: number) => {
9
+ if (value === 1)
10
+ return 'lhd'
11
+
12
+ else
13
+ return 'rhd'
14
+ }
15
+
16
+ const handDriveName = getHandDriveName(handDrive)
17
+ ---
18
+ <div title={handDriveName.toUpperCase()} class="flex items-center" class:list={className}>
19
+ <Image src={handDriveImage} alt="infoObject.product.hand_drive" width={48} height={34} class={handDriveName} />
20
+ <div data-pagefind-filter={`${t('part.sw-position')}:${handDriveName.toUpperCase()}`}
21
+ class={`sm:ml-2 order-0 ${!biggerText ? 'text-xxs md:text-xs' : 'order-0'}`}
22
+ set:html={t(`part.for-${handDriveName}`)}
23
+ />
24
+ </div>
25
+
26
+ <style lang="scss">
27
+ .rhd {
28
+ transform: scaleX(-1);
29
+ }
31
30
  </style>