spoko-design-system 0.0.7 → 0.0.8

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/README.md CHANGED
@@ -46,6 +46,7 @@ Most of the components from this repository can be seen in my projects:
46
46
  - 🗒 [astrojs/mdx](https://github.com/withastro/astro/tree/main/packages/integrations/mdx/) - markdown support
47
47
  - 📦 [astro-compress](https://github.com/astro-community/AstroCompress) - compression utilities to your Astro project
48
48
  - 🖨 Static-site generation (SSG)
49
+ - 🎡 [Swiper](https://github.com/nolimits4web/swiper) - modern mobile touch slider with hardware accelerated transitions and amazing native behavior
49
50
  - 🌠 [View Transitions API](https://docs.astro.build/en/guides/view-transitions/#full-site-view-transitions-spa-mode) - [View Transition API](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) - makes it easy to change the DOM in a single step, while creating an animated transition between the two states. It's available in Chrome 111+ ([more details](https://developer.chrome.com/docs/web-platform/view-transitions?hl=en))
50
51
  - ☁️ Deploy on Netlify
51
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoko-design-system",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "astro dev",
@@ -77,7 +77,8 @@
77
77
  "sass": "^1.70.0",
78
78
  "unocss": "^0.57.7",
79
79
  "vite": "^5.0.12",
80
- "vue": "^3.4.15"
80
+ "vue": "^3.4.15",
81
+ "swiper": "^11.0.5"
81
82
  },
82
83
  "devDependencies": {
83
84
  "@unocss/transformer-variant-group": "^0.58.4",
@@ -0,0 +1,41 @@
1
+ ---
2
+
3
+ ---
4
+ <script>
5
+ import { register } from "swiper/element/bundle";
6
+
7
+ document.addEventListener("astro:page-load", () => {
8
+ //"DOMContentLoaded"
9
+ // register Swiper custom elements
10
+ register();
11
+ })
12
+
13
+ </script>
14
+
15
+ <swiper-container
16
+ class="max-w=full w-full flex"
17
+ grid-rows="1"
18
+ mousewheel-force-to-axis="true"
19
+ navigation="true"
20
+ pagination-type="fraction"
21
+ scrollbar="false"
22
+ slides-per-view="auto"
23
+ space-between="0"
24
+ >
25
+ <swiper-slide class="bg-blue-50 p-12 border-1">
26
+ A
27
+ </swiper-slide>
28
+ <swiper-slide class="bg-blue-100 p-12 border-1">
29
+ B
30
+ </swiper-slide>
31
+ <swiper-slide class="bg-blue-200 p-12 border-1">
32
+ C
33
+ </swiper-slide>
34
+ <swiper-slide class="bg-blue-300 p-12 border-1">
35
+ D
36
+ </swiper-slide>
37
+ <swiper-slide class="bg-blue-400 p-12 border-1">
38
+ A
39
+ </swiper-slide>
40
+
41
+ </swiper-container>
@@ -9,12 +9,12 @@
9
9
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
10
10
  <link rel="alternate icon" type="image/x-icon" href="/favicon.ico" />
11
11
 
12
- <link rel="sitemap" href="/sitemap.xml" />
12
+ <link rel="sitemap" href="/sitemap-index.xml" />
13
13
 
14
14
  <!-- Preload Fonts -->
15
- <link rel="preconnect" href="https://fonts.googleapis.com" />
15
+ <!-- <link rel="preconnect" href="https://fonts.googleapis.com" />
16
16
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
17
- <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital@0;1&display=swap" rel="stylesheet" />
17
+ <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital@0;1&display=swap" rel="stylesheet" /> -->
18
18
 
19
19
  <!-- Scrollable a11y code helper -->
20
20
  <script src="/make-scrollable-code-focusable.js" is:inline></script>
@@ -61,8 +61,7 @@ import Search from "astro-pagefind/components/Search";
61
61
 
62
62
  &.search-container {
63
63
  box-sizing: border-box;
64
- @apply h-10;
65
- @apply h-10 border-0 border-gray-800 rounded-3xl;
64
+ @apply h-10 border-0 border-gray-800 rounded-3xl hidden md:block;
66
65
  }
67
66
  .pagefind-ui {
68
67
 
@@ -0,0 +1,20 @@
1
+ ---
2
+ title: "Carousel"
3
+ layout: "../../layouts/MainLayout.astro"
4
+ ---
5
+ import Carousel from '../../components/Carousel.astro'
6
+
7
+ # Carousel
8
+
9
+ Carousel - modern carousel based on Swiper Element (Web Component)
10
+
11
+ <div class="component-preview">
12
+ <Carousel />
13
+ </div>
14
+
15
+ ```js
16
+ <Carousel />
17
+ ```
18
+ #
19
+
20
+ Find the code for this page in the `src/pages/components/carousel.mdx` file.
@@ -41,6 +41,8 @@ export const tableDataSecondary = [
41
41
 
42
42
  # Table
43
43
 
44
+ Simple table based on JSON data object.
45
+
44
46
  <div class="component-preview">
45
47
  <MainTable data={tableData}></MainTable>
46
48
  </div>
@@ -5,4 +5,6 @@ layout: ../../layouts/MainLayout.astro
5
5
  import MainColors from '../../components/MainColors.vue';
6
6
 
7
7
  <h1>Colors</h1>
8
- <MainColors />
8
+ <p>Base colors.</p>
9
+
10
+ <MainColors class="mt-8" />
@@ -10,7 +10,7 @@ import Button from "../components/Button.vue";
10
10
  const navItems = [
11
11
  {
12
12
  title: "Core",
13
- description: "Base colors, typography, shadows, and more.",
13
+ description: "Base colors, typography, shadows etc.",
14
14
  url: "/core/introduction",
15
15
  icon: "ant-design:cluster-outlined"
16
16
  },
@@ -49,18 +49,19 @@ const navItems = [
49
49
  </Button>
50
50
  </Jumbatron>
51
51
  <nav>
52
- <ul class="flex gap-4 max-w-5xl mx-auto text-left mt-12">
52
+ <ul class="px-4 flex-col flex flex-wrap md:flex-nowrap gap-4 max-w-5xl mx-auto text-left mt-12 md:(px-0 flex-row) ">
53
53
  {
54
54
  navItems.map(({ title, description, url, icon }) => (
55
55
  <a
56
56
  href={url}
57
- class="flex flex-col bg-white rounded-md hover:-translate-y-1 hover:shadow-lg transition-all flex-1 items-center py-10 px-4 text-center"
57
+ title={description}
58
+ class="flex w-full flex-wrap bg-white rounded-md hover:-translate-y-1 hover:shadow-lg transition-all flex-1 items-center py-10 px-4 md:(flex-col w-auto flex-nowrap text-center)"
58
59
  >
59
- <Headline as="h2" textSize="2xl">
60
- <Icon name={icon} aria-hidden="true" class="text-blue-wrc mr-2" />
60
+ <Headline as="h2" textSize="2xl" underline={false}>
61
+ <Icon name={icon} aria-hidden="true" class="text-blue-b mr-2" />
61
62
  {title}
62
63
  </Headline>
63
- <p class="text-slate-500">{description}</p>
64
+ <p class="text-slate-500 w-full">{description}</p>
64
65
  </a>
65
66
  ))
66
67
  }
@@ -34,7 +34,7 @@
34
34
  }
35
35
 
36
36
  .component-preview {
37
- @apply bg-blue-600 bg-opacity-5 px-0 py-4 mx-0 flex items-center sm:(p-8);
37
+ @apply bg-blue-600 bg-opacity-5 px-4 py-4 mx-0 flex items-center overflow-x-auto sm:(p-8);
38
38
  gap: 1rem;
39
39
  border-radius: 0.33rem;
40
40
  border: 1px solid theme("colors.slate.200");