spoko-design-system 0.3.3 → 0.3.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.
@@ -2,7 +2,7 @@
2
2
  import { changeLanguage } from "i18next";
3
3
  import { Icon } from "astro-icon/components";
4
4
  import { SITE } from "../config";
5
- import Jumbatron from "../components/Jumbatron.vue";
5
+ import Jumbotron from "../components/Jumbotron.astro";
6
6
  import Layout from "../layouts/Layout.astro";
7
7
  import Headline from "../components/Headline.vue";
8
8
  import Button from "../components/Button.vue";
@@ -33,7 +33,7 @@ const navItems = [
33
33
 
34
34
  <Layout>
35
35
  <div class="bg-slate-100 min-h-screen text-center">
36
- <Jumbatron class="w-full" intro={SITE.title}>
36
+ <Jumbotron title={SITE.title}>
37
37
  <p
38
38
  slot="subtitle"
39
39
  class="mt-3 text-base text-gray-200 sm:mt-5 text-lg md:text-xl lg:mx-0 md:mt-5"
@@ -41,7 +41,7 @@ const navItems = [
41
41
  />
42
42
 
43
43
  <Button
44
- slot="cta"
44
+ slot="cta-content"
45
45
  href="/core/introduction/"
46
46
  title="Spoko Design System"
47
47
  primary
@@ -49,7 +49,7 @@ const navItems = [
49
49
  >
50
50
  Read More
51
51
  </Button>
52
- </Jumbatron>
52
+ </Jumbotron>
53
53
  <nav>
54
54
  <div
55
55
  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)"
@@ -105,16 +105,16 @@ const navItems = [
105
105
  <Headline underline as="div" class="mx-auto text-gray-900" textSize="3xl">Examples:</Headline>
106
106
  <ul class="grid text-2xl pt-6 lg:(auto-cols-max grid-flow-col py-6) text-left">
107
107
  <li class="leading-5 me-6 mb-4 lg:mb-0">
108
- <a href="https://catalog.polo.blue" class="transition ease-in-out delay-200 duration-300 text-blue-medium hover:(text-accent-light decoration-blue-medium) underline decoration-white" target="_blank"> catalog.polo.blue</a>
108
+ <a href="https://catalog.polo.blue" class="example-link" target="_blank"> catalog.polo.blue</a>
109
109
  </li>
110
110
  <li class="leading-5 me-6 mb-4 lg:mb-0">
111
- <a href="https://polo.blue" class="transition ease-in-out delay-200 duration-300 text-blue-medium hover:(text-accent-light decoration-blue-medium) underline decoration-white" target="_blank"> polo.blue</a>
111
+ <a href="https://polo.blue" class="example-link" target="_blank"> polo.blue</a>
112
112
  </li>
113
113
  <li class="leading-5 me-6 mb-4 lg:mb-0">
114
- <a href="https://spoko.space" class="transition ease-in-out delay-200 duration-300 text-blue-medium hover:(text-accent-light decoration-blue-medium) underline decoration-white" target="_blank"> spoko.space</a>
114
+ <a href="https://spoko.space" class="example-link" target="_blank"> spoko.space</a>
115
115
  </li>
116
116
  <li class="leading-5 me-6 mb-4 lg:mb-0">
117
- <a href="https://sale.polo.blue/" class="transition ease-in-out delay-200 duration-300 text-blue-medium hover:(text-accent-light decoration-blue-medium) underline decoration-white" target="_blank">sale.polo.blue</a>
117
+ <a href="https://sale.polo.blue/" class="example-link" target="_blank">sale.polo.blue</a>
118
118
  </li>
119
119
  </ul>
120
120
  </div>
@@ -124,3 +124,8 @@ const navItems = [
124
124
  </div>
125
125
  <script is:inline></script>
126
126
  </Layout>
127
+ <style>
128
+ .example-link {
129
+ @apply transition ease-in-out delay-200 duration-300 text-blue-medium hover:(text-accent-light decoration-blue-medium) underline decoration-white;
130
+ }
131
+ </style>
@@ -20,7 +20,6 @@ export const colors = {
20
20
 
21
21
  // Secondary colors - accent palette
22
22
  accent: {
23
- lightest: '#00b0f0',
24
23
  light: '#0099da',
25
24
  default: '#0087c1', // Default accent
26
25
  dark: '#006ea6',
@@ -36,7 +35,6 @@ export const colors = {
36
35
  default: '#9ca3af', // Base gray
37
36
  dark: '#6a767d',
38
37
  darker: '#4b5563',
39
- black: '#000000', // Pure black
40
38
  },
41
39
 
42
40
  // Slate colors - gray-blue palette
@@ -0,0 +1,25 @@
1
+ // uno-config/theme/container.ts
2
+ import { breakpoints } from './breakpoints';
3
+
4
+ export const container = {
5
+ center: true,
6
+ padding: {
7
+ sm: '1rem',
8
+ md: '2rem',
9
+ lg: '3rem',
10
+ xl: '4rem',
11
+ '2xl': '5rem',
12
+ '3xl': '5rem',
13
+ '4xl': '5rem',
14
+ },
15
+ maxWidth: {
16
+ sm: breakpoints.sm,
17
+ md: breakpoints.md,
18
+ lg: breakpoints.lg,
19
+ xl: breakpoints.xl,
20
+ '2xl': breakpoints['2xl'],
21
+ // For larger breakpoints, keep the 2xl width
22
+ '3xl': breakpoints['2xl'],
23
+ '4xl': breakpoints['2xl'],
24
+ },
25
+ };
@@ -5,6 +5,7 @@ import { breakpoints } from './breakpoints';
5
5
  import { dimensions } from './dimensions';
6
6
  import { effects } from './effects';
7
7
  import { gridTemplates } from './grid';
8
+ import { container } from './container';
8
9
 
9
10
  export const theme = {
10
11
  colors,
@@ -14,6 +15,7 @@ export const theme = {
14
15
  gridTemplateColumn: gridTemplates.columns,
15
16
  breakpoints,
16
17
  screens: breakpoints,
18
+ container,
17
19
  };
18
20
 
19
21
  export {
@@ -23,4 +25,5 @@ export {
23
25
  dimensions,
24
26
  effects,
25
27
  gridTemplates,
28
+ container,
26
29
  };
@@ -34,7 +34,7 @@ export const componentShortcuts = [
34
34
  // Category related
35
35
  ['category-section', `pb-4 w-full ${COLORS.bgWhite} mb-4 overflow-x-hidden ${LAYOUT.flex.wrap} max-w-full`],
36
36
  ['category-tile', `${LAYOUT.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 first:ml-4`],
37
- ['category-toggler', `sm:bg-opacity-20 pt-1 ${LAYOUT.flex.center} hover:text-accent-light text-neutral-light hover:text-blue-lightest px-4 leading-7 pb-0.5 md:pl-0`],
37
+ ['category-toggler', `w-8 sm:bg-opacity-20 pt-1 ${LAYOUT.flex.center} hover:text-accent-light text-neutral-light hover:text-blue-lightest px-4 leading-7 pb-0.5 md:pl-0`],
38
38
  ['category-link', 'w-full sm:w-auto text-neutral-default hover:(bg-gray-50 sm:bg-inherit) py-2 sm:py-0 text-lg font-medium text-left px-3 block sm:(text-base leading-4 mb-1.5) md:(px-4 py-1 table-cell)'],
39
39
  ['category-carousel__link', `uppercase ml-auto px-4 text-xs ${LAYOUT.flex.alignCenter} mt-3 hover:underline`],
40
40
 
@@ -4,6 +4,7 @@ import { buttonShortcuts } from './buttons';
4
4
  import { layoutShortcuts } from './layout';
5
5
  import { componentShortcuts } from './components';
6
6
  import { productShortcuts } from './product';
7
+ import { jumbotronShortcuts } from './jumbotron';
7
8
 
8
9
  const convertToShortcuts = (shortcuts: string[][]): UserShortcuts => {
9
10
  return Object.fromEntries(shortcuts.map(([name, value]) => [name, value]));
@@ -13,5 +14,6 @@ export const shortcuts: UserShortcuts = {
13
14
  ...convertToShortcuts(buttonShortcuts),
14
15
  ...convertToShortcuts(layoutShortcuts),
15
16
  ...convertToShortcuts(componentShortcuts),
16
- ...convertToShortcuts(productShortcuts)
17
+ ...convertToShortcuts(productShortcuts),
18
+ ...convertToShortcuts(jumbotronShortcuts),
17
19
  };
@@ -0,0 +1,44 @@
1
+ // shortcuts/jumbotron.ts
2
+ import { COLORS, LAYOUT, TRANSITIONS, IMAGE_STYLES } from './constants'
3
+
4
+ export const jumbotronShortcuts = [
5
+ // Default variant
6
+ ['jumbotron-header-base', 'relative mx-auto my-auto lg:w-full text-center py-8'],
7
+ ['jumbotron-container-small', 'md:min-h-xs sm:py-12 md:py-14 lg:py-16 xl:py-20'],
8
+ ['jumbotron-container-large', 'md:min-h-md sm:py-16 md:py-20 lg:py-28 xl:py-32'],
9
+ ['jumbotron-title-default', 'text-3xl headline-light text-white sm:(text-4xl pt-0) md:text-5xl lg:text-6xl'],
10
+ ['jumbotron-cta-wrapper', 'mt-5 sm:(mt-8 flex justify-center)'],
11
+
12
+ // Hero variant
13
+ ['jumbotron-hero-wrapper', 'relative w-full'],
14
+ ['jumbotron-hero-image', 'absolute inset-0 w-full h-full'],
15
+ ['jumbotron-hero-overlay', 'absolute inset-0 bg-gradient-to-r from-blue-900 to-transparent opacity-90 z-1'],
16
+ ['jumbotron-hero-container', 'xl:container mx-auto px-3.5 md:px-8 py-8 h-56 sm:h-72 md:max-h-72 items-center flex'],
17
+ ['jumbotron-hero-header', 'relative z-10 text-white'],
18
+ ['jumbotron-hero-title', 'font-headlight text-3xl sm:text-4xl md:text-5xl xl:text-6xl mt-1 line-clamp-3 leading-tight'],
19
+
20
+ // Post variant
21
+ ['jumbotron-post-header', 'post-header pt-11 w-full justify-center text-white z-2 relative'],
22
+ ['jumbotron-post-heading', 'heading text-white relative flex items-center justify-center mt-auto w-full z-[2]'],
23
+ ['jumbotron-post-container', 'w-full sm:max-w-[640px] md:max-w-3xl lg:max-w-5xl xl:max-w-7xl 2xl:max-w-[1536px] px-4 py-5 flex flex-col flex-wrap'],
24
+ ['jumbotron-post-title', 'font-headlight text-2xl mb-1 sm:text-3xl md:(text-4xl mb-3) xl:text-6xl mt-1 order-2 line-clamp-3 pb-1'],
25
+
26
+ // Metadata and categories
27
+ ['jumbotron-meta', 'order-3 flex items-center text-gray-100'],
28
+ ['jumbotron-categories', 'order-1'],
29
+
30
+ // Content styles
31
+ ['jumbotron-description', 'mb-1 line-clamp-3 text-base sm:text-lg leading-none mt-4'],
32
+ ['jumbotron-info', 'font-medium mb-4 line-clamp-1 text-base sm:text-lg mt-2'],
33
+
34
+ // Post Split variant
35
+ ['jumbotron-split-wrapper', 'w-full'],
36
+ ['jumbotron-split-container', 'xl:container mx-auto px-3.5 md:px-0'],
37
+ ['jumbotron-split-header', 'w-full justify-center text-white z-2 mt-auto md:(grid grid-cols-2) pb-4 mb-8'],
38
+ ['jumbotron-split-content', 'container px-3.5 py-5 md:py-0 flex flex-wrap'],
39
+ ['jumbotron-split-title', 'font-headlight text-3xl md:(text-4xl mb-3) xl:text-11 mt-1 order-2 line-clamp-3 pb-1 w-full'],
40
+ ['jumbotron-split-meta', 'order-3 flex items-center text-gray-100'],
41
+ ['jumbotron-split-image-wrapper', 'relative -mb-8 md:(mt-4 -ml-4 mr-4)'],
42
+ ['jumbotron-split-image', 'relative shadow-xl md:max-h-112'],
43
+ ['jumbotron-split-img', 'aspect-video'] // border-white border-4
44
+ ];
@@ -1,41 +0,0 @@
1
- <script setup lang="ts">
2
- import { useSlots } from 'vue';
3
-
4
- const slots = useSlots()
5
- const hasSlot = (name) => {
6
- return !!slots[name];
7
- }
8
- const props = defineProps({
9
- small: {
10
- type: Boolean,
11
- default: null,
12
- required: false,
13
- },
14
- intro: {
15
- type: String,
16
- default: '',
17
- required: false,
18
- }
19
- })
20
- </script>
21
-
22
- <template>
23
- <header class="relative flow content-grid bg-vw mx-auto my-auto py-8 lg:w-full text-center" :class="props.small ? 'md:min-h-xs sm:py-12 md:py-14 lg:py-16 xl:py-20' : 'md:min-h-md sm:py-16 md:py-20 lg:py-28 xl:py-32'">
24
-
25
- <slot name="intro">
26
- <h1 class="text-3xl headline-light text-white sm:(text-4xl pt-0) md:text-5xl lg:text-6xl " v-html="props.intro" />
27
- </slot>
28
-
29
- <slot name="subtitle" />
30
- <div class="mt-5 sm:(mt-8 flex justify-center)" v-if="hasSlot('cta')">
31
- <slot name="cta" />
32
- </div>
33
- </header>
34
- </template>
35
- <style>
36
- .bg-vw {
37
- background: radial-gradient(circle at 50% 85%,
38
- #00437A 0%,
39
- #001E50 100%)
40
- }
41
- </style>
@@ -1,95 +0,0 @@
1
- ---
2
- title: "Jumbatron"
3
- layout: "../../layouts/MainLayout.astro"
4
- ---
5
- import Jumbatron from '../../components/Jumbatron.vue'
6
- import Button from '../../components/Button.vue'
7
-
8
- # Jumbatron
9
-
10
- A jumbotron indicates a big box for calling extra attention to some special content or information.
11
-
12
- Find the code for this page in the `src/pages/components/jumbatron.mdx` file.
13
-
14
- ## Jumbatron - classic
15
- <div class="component-preview">
16
- <Jumbatron class="w-full" intro={`Lorem ipsum dolor sit amet, <span class=\"text-accent-light\">consectetur</span> adipiscing elit.`}>
17
- <p slot="subtitle"
18
- class="mt-3 text-base text-gray-200 sm:mt-5 text-lg md:text-xl lg:mx-0 md:mt-5"
19
- set:html="Nunc posuere massa eget turpis laoreet ultrices eget vel massa."
20
- />
21
- <Button primary slot="cta" rounded
22
- href="#"
23
- title="short text"
24
- >
25
- Read More
26
- </Button>
27
- </Jumbatron>
28
- </div>
29
-
30
- ```js
31
- <Jumbatron intro={`Lorem ipsum dolor sit amet, <span class=\"text-accent-light\">consectetur</span> adipiscing elit.`}>
32
- <span slot="intro" set:html= />
33
- <p slot="subtitle"
34
- class="mt-3 text-base text-gray-200 sm:mt-5 text-lg md:text-xl lg:mx-0 md:mt-5"
35
- set:html="subtitle"
36
- />
37
- <Button primary slot="cta" rounded
38
- href="#"
39
- title="short text"
40
- >
41
- Read More
42
- </Button>
43
- </Jumbatron>
44
- ```
45
-
46
- ## Small Jumbatron
47
-
48
- <div class="component-preview">
49
- <Jumbatron class="w-full" small intro={`Lorem ipsum dolor sit amet, <span class=\"text-accent-light\">consectetur</span> adipiscing elit.`}>
50
- <p slot="subtitle"
51
- class="mt-5 sm:mt-8 sm:flex sm:justify-center"
52
- set:html="Nunc posuere massa eget turpis laoreet ultrices eget vel massa."
53
- />
54
- </Jumbatron>
55
- </div>
56
-
57
- ```js
58
- <Jumbatron small intro={`Lorem ipsum dolor sit amet, <span class=\"text-accent-light\">consectetur</span> adipiscing elit.`}>
59
-
60
- <p slot="subtitle"
61
- class="mt-5 sm:mt-8 sm:flex sm:justify-center"
62
- set:html="subtitle"
63
- />
64
- <Button primary slot="cta"
65
- href="#"
66
- title="short text"
67
- >
68
- Read More
69
- </Button>
70
- </Jumbatron>
71
- ```
72
-
73
-
74
- ## Small Jumbatron - custom slot intro instead of prop
75
- <div class="component-preview">
76
- <Jumbatron class="w-full" small >
77
- <h2 slot="intro" class="text-3xl text-white sm:(text-3xl pt-0) md:text-4xl lg:text-5xl font-light font-headbold">Lorem ipsum dolor sit amet, <span class="text-accent-light">consectetur</span> adipiscing elit.</h2>
78
- <p slot="subtitle"
79
- class="mt-5 sm:mt-8 sm:flex sm:justify-center"
80
- set:html="Nunc posuere massa eget turpis laoreet ultrices eget vel massa."
81
- />
82
- </Jumbatron>
83
- </div>
84
-
85
- ```js
86
- <Jumbatron class="w-full" small >
87
- <h2 slot="intro" class="text-3xl text-white sm:(text-3xl pt-0) md:text-4xl lg:text-5xl font-light font-headbold">
88
- Lorem ipsum dolor sit amet, <span class="text-accent-light">consectetur</span> adipiscing elit.
89
- </h2>
90
- <p slot="subtitle"
91
- class="mt-5 sm:mt-8 sm:flex sm:justify-center"
92
- set:html="Nunc posuere massa eget turpis laoreet ultrices eget vel massa."
93
- />
94
- </Jumbatron>
95
- ```