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.
- package/.astro/icon.d.ts +10291 -2199
- package/.vscode/extensions.json +2 -1
- package/.vscode/settings.json +6 -0
- package/Layout/Header.astro +3 -3
- package/README.md +38 -13
- package/astro.config.mjs +24 -18
- package/package.json +79 -75
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +0 -0
- package/public/locales/en/translation.json +5 -2
- package/public/locales/pl/translation.json +5 -2
- package/src/components/Badge.vue +1 -1
- package/src/components/Badges.vue +1 -1
- package/src/components/Button.vue +17 -8
- package/src/components/ButtonCopy.vue +52 -0
- package/src/components/Card.astro +25 -0
- package/src/components/HandDrive.astro +0 -1
- package/src/components/Header/Header.astro +1 -1
- package/src/components/Headline.vue +37 -5
- package/src/components/Image.astro +30 -0
- package/src/components/Jumbatron.vue +23 -8
- package/src/components/LeftSidebar.astro +9 -8
- package/src/components/PrCode.vue +156 -0
- package/src/components/ProductNumber.astro +117 -0
- package/src/components/ProductTile.astro +54 -0
- package/src/components/layout/Header.astro +1 -1
- package/src/config.ts +5 -1
- package/src/layouts/Layout.astro +0 -8
- package/src/layouts/MainLayout.astro +6 -14
- package/src/pages/components/badges.mdx +39 -7
- package/src/pages/components/breadcrumbs.mdx +37 -1
- package/src/pages/components/buttons.mdx +92 -11
- package/src/pages/components/card.mdx +40 -0
- package/src/pages/components/hand-drive.mdx +6 -1
- package/src/pages/components/headline.mdx +22 -3
- package/src/pages/components/icons.astro +23 -21
- package/src/pages/components/image.mdx +502 -0
- package/src/pages/components/jumbatron.mdx +33 -10
- package/src/pages/components/modal.mdx +8 -2
- package/src/pages/components/post-header.mdx +24 -2
- package/src/pages/components/pr-code.mdx +41 -0
- package/src/pages/components/product-number.mdx +65 -0
- package/src/pages/components/product-tile.mdx +39 -0
- package/src/pages/components/table.mdx +19 -0
- package/src/pages/core/introduction.mdx +3 -3
- package/src/pages/index.astro +25 -22
- package/src/styles/base/_base.scss +8 -0
- package/src/styles/content.scss +17 -1
- package/uno.config.ts +26 -7
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "ProductNumber"
|
|
3
|
+
layout: "../../layouts/MainLayout.astro"
|
|
4
|
+
---
|
|
5
|
+
import ProductNumber from '../../components/ProductNumber.astro'
|
|
6
|
+
|
|
7
|
+
## ProductNumber
|
|
8
|
+
|
|
9
|
+
ProductNumber - with additional formatting adding spacing for Volkswagen product numbers + additional copy button for easier copying.
|
|
10
|
+
|
|
11
|
+
<div class="component-preview">
|
|
12
|
+
<div class="grid grid-cols-2 lg:grid-cols-4 gap-4 w-full bg-white p-y-5 px-4">
|
|
13
|
+
<ProductNumber
|
|
14
|
+
big
|
|
15
|
+
productNumber="6R0920870F"
|
|
16
|
+
class="mb-2"
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<ProductNumber
|
|
20
|
+
big
|
|
21
|
+
isPdp
|
|
22
|
+
productNumber="000051443F"
|
|
23
|
+
class="mb-2"
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
<ProductNumber
|
|
27
|
+
isPdp
|
|
28
|
+
productNumber="WHT005227"
|
|
29
|
+
class="mb-2"
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<ProductNumber
|
|
33
|
+
isPdp
|
|
34
|
+
productNumber="N0385491"
|
|
35
|
+
class="mb-2"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
<ProductNumber
|
|
42
|
+
big
|
|
43
|
+
productNumber="6R0920870F"
|
|
44
|
+
class="mb-2"
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<ProductNumber
|
|
48
|
+
big
|
|
49
|
+
isPdp
|
|
50
|
+
productNumber="000051443F"
|
|
51
|
+
class="mb-2"
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
<ProductNumber
|
|
55
|
+
isPdp
|
|
56
|
+
productNumber="WHT005227"
|
|
57
|
+
class="mb-2"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<ProductNumber
|
|
61
|
+
isPdp
|
|
62
|
+
productNumber="N0385491"
|
|
63
|
+
class="mb-2"
|
|
64
|
+
/>
|
|
65
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "ProductTile"
|
|
3
|
+
layout: "../../layouts/MainLayout.astro"
|
|
4
|
+
---
|
|
5
|
+
import ProductTile from '../../components/ProductTile.astro'
|
|
6
|
+
|
|
7
|
+
export const productObject = {
|
|
8
|
+
name: 'Combi-instrument MFA+',
|
|
9
|
+
url: 'https://google.com',
|
|
10
|
+
number: '6R0920870F',
|
|
11
|
+
photo: 'https://img.freepik.com/darmowe-wektory/tlo-retro-modeli-geometrycznych_52683-17902.jpg?w=1380&t=st=1706311337'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
## ProductTile
|
|
15
|
+
|
|
16
|
+
ProductTile - product link component which can be used for carousels, section with related products, recently added etc.
|
|
17
|
+
|
|
18
|
+
<div class="component-preview">
|
|
19
|
+
<div class="flex flex-wrap bg-white w-full p-4 pb-0">
|
|
20
|
+
|
|
21
|
+
<ProductTile productObject={productObject} />
|
|
22
|
+
<ProductTile productObject={productObject} />
|
|
23
|
+
<ProductTile productObject={productObject} />
|
|
24
|
+
<ProductTile productObject={productObject} />
|
|
25
|
+
<ProductTile productObjec={productObject}t />
|
|
26
|
+
<ProductTile productObject={productObject} />
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
export const productObject = {
|
|
32
|
+
name: 'Combi-instrument MFA+',
|
|
33
|
+
url: 'https://google.com',
|
|
34
|
+
number: '6R0920870F',
|
|
35
|
+
photo: 'https://img.freepik.com/darmowe-wektory/tlo-retro-modeli-geometrycznych_52683-17902.jpg?w=1380&t=st=1706311337'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
<ProductTile productObject={productObject} />
|
|
39
|
+
```
|
|
@@ -16,5 +16,24 @@ import MainTable from '../../components/MainTable.vue'
|
|
|
16
16
|
### Code
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
|
+
const tableData = [
|
|
20
|
+
{
|
|
21
|
+
id: 1,
|
|
22
|
+
name: "Lorem Ipsum",
|
|
23
|
+
email: "lorem@email.com",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 2,
|
|
27
|
+
name: "Chuck Norris",
|
|
28
|
+
email: "ipsum@email.com",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 3,
|
|
32
|
+
name: "Ipsum Lorem",
|
|
33
|
+
email: "lorem@email.com",
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
|
|
19
38
|
<MainTable :data="data"></MainTable>
|
|
20
39
|
```
|
|
@@ -3,6 +3,7 @@ title: Introduction
|
|
|
3
3
|
description: Docs intro
|
|
4
4
|
layout: ../../layouts/MainLayout.astro
|
|
5
5
|
---
|
|
6
|
+
import Button from '../../components/Button.vue'
|
|
6
7
|
|
|
7
8
|
# Spoko Design System Theme
|
|
8
9
|
|
|
@@ -11,7 +12,6 @@ Since Astro is compatible with many frameworks, we can import components and doc
|
|
|
11
12
|
|
|
12
13
|
The project is still in the development phase, use at your own risk ;-)
|
|
13
14
|
|
|
14
|
-
The project is still in the development phase, use at your own risk ;-)
|
|
15
15
|
|
|
16
16
|
## Getting started
|
|
17
17
|
|
|
@@ -38,7 +38,7 @@ export const SIDEBAR = [
|
|
|
38
38
|
|
|
39
39
|
### Adding new pages
|
|
40
40
|
|
|
41
|
-
To add new pages just create an .astro or markdown file in `src/pages/[section]/my-page.
|
|
41
|
+
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.
|
|
42
42
|
|
|
43
43
|
You're free to organize the pages however you want.
|
|
44
44
|
|
|
@@ -66,7 +66,7 @@ You can import your component library or create your own and document it easily.
|
|
|
66
66
|
There's a class called `.component-preview` that you can use to wrap your component in a grid, and it will look like this:
|
|
67
67
|
|
|
68
68
|
<div class="component-preview">
|
|
69
|
-
<
|
|
69
|
+
<Button primary>Your component</Button>
|
|
70
70
|
</div>
|
|
71
71
|
|
|
72
72
|
### Have fun!
|
package/src/pages/index.astro
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
---
|
|
2
|
+
import { changeLanguage } from "i18next";
|
|
2
3
|
import { Icon } from "astro-icon/components";
|
|
3
4
|
import { SITE } from "../config";
|
|
4
5
|
import Jumbatron from "../components/Jumbatron.vue";
|
|
5
|
-
import Layout from
|
|
6
|
+
import Layout from "../layouts/Layout.astro";
|
|
6
7
|
import Headline from "../components/Headline.vue";
|
|
8
|
+
import Button from "../components/Button.vue";
|
|
9
|
+
|
|
7
10
|
const navItems = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
{
|
|
12
|
+
title: "Core",
|
|
13
|
+
description: "Base colors, typography, shadows, and more.",
|
|
14
|
+
url: "/core/introduction",
|
|
15
|
+
icon: "ant-design:cluster-outlined"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: "Components",
|
|
19
|
+
description: "The building blocks for our UI.",
|
|
20
|
+
url: "/components/buttons",
|
|
21
|
+
icon: "ant-design:build-twotone"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: "Patterns",
|
|
25
|
+
description: "Common patterns for building interfaces.",
|
|
26
|
+
url: "/patterns/introduction",
|
|
27
|
+
icon: "ant-design:audit-outlined"
|
|
28
|
+
},
|
|
26
29
|
];
|
|
27
30
|
---
|
|
28
31
|
<Layout>
|
|
@@ -38,9 +41,9 @@ const navItems = [
|
|
|
38
41
|
|
|
39
42
|
<Button slot="cta"
|
|
40
43
|
href="/core/introduction/"
|
|
41
|
-
title="
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
title="Spoko Design System"
|
|
45
|
+
primary
|
|
46
|
+
>
|
|
44
47
|
Read More
|
|
45
48
|
</Button>
|
|
46
49
|
</Jumbatron>
|
package/src/styles/content.scss
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.component-preview {
|
|
39
|
-
@apply bg-blue-600 bg-opacity-5 px-0 mx-0 sm:(p-8) flex items-center;
|
|
39
|
+
@apply bg-blue-600 bg-opacity-5 px-0 py-4 mx-0 sm:(p-8) flex items-center;
|
|
40
40
|
gap: 1rem;
|
|
41
41
|
border-radius: 0.33rem;
|
|
42
42
|
border: 1px solid theme("colors.slate.200");
|
|
@@ -49,3 +49,19 @@
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
|
|
53
|
+
table {
|
|
54
|
+
@apply table-auto text-left border bg-white shadow-md;
|
|
55
|
+
|
|
56
|
+
tr {
|
|
57
|
+
@apply border;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
td, th {
|
|
61
|
+
@apply px-4 py-2;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
thead {
|
|
65
|
+
@apply bg-gray-100;
|
|
66
|
+
}
|
|
67
|
+
}
|
package/uno.config.ts
CHANGED
|
@@ -28,6 +28,30 @@ export default defineConfig({
|
|
|
28
28
|
transformerVariantGroup(),
|
|
29
29
|
],
|
|
30
30
|
shortcuts: [
|
|
31
|
+
['headline','font-headlight font-bold '],
|
|
32
|
+
['badge', 'px-1.5 py-px text-white text-xs mb-1 max-w-fit'],
|
|
33
|
+
['img--overlay','after:(content-empty bg-black bg-opacity-[.03] absolute w-full h-full top-0)'],
|
|
34
|
+
['img--4/3', 'aspect-[4/3] relative object-cover bg-gray-100 h-auto max-w-full'],
|
|
35
|
+
['img--3/4', 'aspect-[3/4] relative object-cover bg-gray-100 h-auto max-w-full'],
|
|
36
|
+
['img--1/1', 'aspect-square relative object-cover bg-gray-100 h-auto max-w-full'],
|
|
37
|
+
['img--3/2', 'aspect-[3/2] relative object-cover bg-gray-100 h-auto max-w-full'],
|
|
38
|
+
['img--2/3', 'aspect-[2/3] relative object-cover bg-gray-100 h-auto max-w-full'],
|
|
39
|
+
['img--3/1', 'aspect-[3/1] relative object-cover bg-gray-100 h-auto max-w-full'],
|
|
40
|
+
['img--16/9', 'aspect-video relative object-cover bg-gray-100 h-auto max-w-full'],
|
|
41
|
+
['img--small', 'w-60 sm:(w-22) xl:(w-30)'],
|
|
42
|
+
['img--medium', 'w-60'],
|
|
43
|
+
|
|
44
|
+
['btn-primary', 'bg-lightBlue-500 border border-transparent font-medium hover:bg-lightBlue-600 inline-flex items-center justify-center rounded-full shadow text-base text-white'],
|
|
45
|
+
['btn-secondary', 'bg-gray-500 border border-transparent font-medium hover:bg-gray-600 inline-flex items-center justify-center rounded-full shadow text-base text-white'],
|
|
46
|
+
['btn-tertiary', 'inline-flex items-center font-medium text-center text-white bg-blue-700 rounded-full hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800'],
|
|
47
|
+
['btn-text', 'text-gray-400 hover:bg-blue-700 hover:text-white rounded-full'],
|
|
48
|
+
['btn-tag', 'bg-blue-100 text-blue-800 text-xs font-medium mr-2 px-2.5 py-0.5 rounded-full dark:bg-gray-700 dark:text-blue-400 border border-blue-400 hover:border-blue-600'],
|
|
49
|
+
|
|
50
|
+
['btn-normal', 'md:px-10 md:py-2 md:text-lg px-8 py-3'],
|
|
51
|
+
['btn-sm', 'px-6 py-2 text-sm'],
|
|
52
|
+
['btn-xs', 'px-4 py-1 text-sm font-medium'],
|
|
53
|
+
|
|
54
|
+
['product-number','font-mono content-center flex flex-wrap flex-col content-start pr-5 bg-white'],
|
|
31
55
|
['main','text-gray-700 dark:text-gray-200 dark:bg-blue-700 pt-24 sm:pt-14 relative'],
|
|
32
56
|
['nav','bg-white dark:bg-black absolute sm:fixed w-full top-0 z-40 sm:z-30 max-w-screen'],
|
|
33
57
|
['cat-menu','fixed bottom-[-4px] w-full z-10 border-t-1 border-gray-300 bg-white dark:bg-blue-900 text-center sm:(static z-auto border-t-none) sm:min-h-32'],
|
|
@@ -43,8 +67,6 @@ export default defineConfig({
|
|
|
43
67
|
['detail-row','text-sm mt-1 md:mt-4 mb-4 grid grid-cols-2 gap-4 sm:(grid-cols-details-desktop grid-flow-col auto-cols-max)'],
|
|
44
68
|
['product-thumb', 'h-full w-full object-cover object-center transform scale-100 group-hover:scale-110 absolute inset-0 will-change-transform bg-gray-100'],
|
|
45
69
|
['product-thumb--plp','aspect-ratio-[4/3] flex items-center flex justify-center mb-3 sm:mb-0 after:(content-empty bg-black bg-opacity-[.03] absolute w-full h-full top-0)'], //filter drop-shadow-sm
|
|
46
|
-
['product-thumb--related', 'w-22 min-w-22 xl:w-30 xl:min-w-30 h-auto object-contain object-top bg-gray-100 aspect-[4/3] relative'],
|
|
47
|
-
['product-thumb--carousel', 'w-60 min-w-60 sm:w-22 sm:min-w-22 xl:w-30 xl:min-w-30 h-auto object-contain object-top bg-gray-100 aspect-[4/3] relative'],
|
|
48
70
|
['product-link--related', 'relative flex w-full bg-white dark:bg-blue-901 after:absolute after:bg-lightBlue-500 after:w-full after:left-0 after:h-px after:-bottom-2 after:content-empty after:scale-x-0 after:transition-transform-300 after:origin-top-right hover:after:origin-top-left hover:after:scale-x-100'],
|
|
49
71
|
['btn', 'px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
|
|
50
72
|
['icon-btn', 'text-[0.9em] inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:(opacity-100 text-teal-600)'],
|
|
@@ -67,7 +89,6 @@ export default defineConfig({
|
|
|
67
89
|
['cat-link','whitespace-nowrap cursor-pointer text-blue-901 dark:text-white hover:text-lightBlue-400 font-light uppercase py-2 md:py-0'],
|
|
68
90
|
['plp-name','flex items-center leading-none font-headregular cursor-pointer sm:pr-6 md:pr-12'],
|
|
69
91
|
['plp-replacements','col-span-3 md:col-span-1 md:col-start-2 text-xs mt-3 md:mt-4'],
|
|
70
|
-
['product-number','font-mono content-center flex flex-wrap flex-col content-start'],
|
|
71
92
|
['product-code','text-blue-500 dark:text-lightBlue-500 mr-1 leading-none tracking-wide select-all'],
|
|
72
93
|
['code-formatted','leading-none mt-0 relative text-xs'],
|
|
73
94
|
['btn-copy', 'leading-none opacity-10 hover:opacity-80 ml-auto w-6 h-6 -right-7 sm:(h-4 w-4 -right-5) absolute'],
|
|
@@ -76,17 +97,15 @@ export default defineConfig({
|
|
|
76
97
|
['plp-desc','hidden sm:block col-span-3 md:col-span-1 md:col-start-3 relative px-2 sm:px-0'],
|
|
77
98
|
['plp-materials', 'text-xs md:text-sm text-gray-900 dark:text-gray-300 leading-tight font-textlight md:font-textregular whitespace-normal md:whitespace-pre-wrap'],
|
|
78
99
|
['plp-b-desc','whitespace-pre-wrap text-xs md:text-sm font-textlight leading-4 md:leading-5'],
|
|
79
|
-
['category-tile', 'flex-wrap sm:flex-nowrap content-between w-64 min-w-64 lg:(w-28.57% min-w-28.57%) 2xl:(w-24.09% min-w-24.09%) 3xl:(w-19.60% min-w-19.60%) flex ml-1 lg:ml-1.5'],
|
|
80
100
|
['carousel-tile', 'w-52 min-w-52 flex ml-1 lg:ml-1.5'],
|
|
81
101
|
['category-carousel__link', 'uppercase ml-auto px-4 text-xs flex items-center mt-3 hover:underline'],
|
|
82
102
|
['adsbygoogle', 'w-full text-center'],
|
|
83
103
|
['search-container', 'mb-2 sm:mb-0'],
|
|
84
104
|
['l-main', 'text-gray-700 dark:text-gray-200 pt-24 sm:pt-14 bg-white dark:bg-blue-901'],
|
|
85
|
-
['product-link', 'relative flex w-full bg-white pb-1 dark:bg-blue-901 after:absolute after:bg-lightBlue-500 after:w-[calc(100%-1rem)] after:left-0 after:h-px after:top-[calc(100%-1px)] after:bottom-1 after:content-empty after:scale-x-0 after:transition-transform-300 after:origin-top-right hover:after:origin-top-left hover:after:scale-x-100'],
|
|
86
105
|
['category-section', 'pb-4 w-full bg-white mb-4 overflow-x-hidden flex flex-wrap max-w-full'],
|
|
87
106
|
['number-secondary', 'block absolute inset-0 text-gray-400 select-all bg-white dark:bg-blue-901'],
|
|
88
|
-
['product-list', 'flex flex-wrap sm:block bg-white dark:bg-blue-901 sm:divide-y-1 sm:divide-solid divide-gray-200 dark:divide-white dark:divide-opacity-10 md:px-2 md:pl-4 mb-4 w-full bg-gray-100 dark:bg-gray-700 mb-auto']
|
|
89
|
-
|
|
107
|
+
['product-list', 'flex flex-wrap sm:block bg-white dark:bg-blue-901 sm:divide-y-1 sm:divide-solid divide-gray-200 dark:divide-white dark:divide-opacity-10 md:px-2 md:pl-4 mb-4 w-full bg-gray-100 dark:bg-gray-700 mb-auto'],
|
|
108
|
+
['btn-prcode', 'relative inline-block text-center leading-none px-1 py-0.5 mr-1 cursor-pointer font-mono border-solid border-1 border-gray-200 select-none text-gray-500 last:mr-0 not-last:mr-2 not-last:after:content-[+] after:(text-blue-700 absolute w-4 pl-0.5)']
|
|
90
109
|
],
|
|
91
110
|
theme: {
|
|
92
111
|
colors: {
|