spoko-design-system 1.12.1 → 1.13.1
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [1.13.1](https://github.com/polo-blue/sds/compare/v1.13.0...v1.13.1) (2025-12-06)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **jumbotron:** remove ml-auto from split-content and add align prop docs ([43b4924](https://github.com/polo-blue/sds/commit/43b49244843d3cd9bb202ead0330d7f76737c120))
|
|
6
|
+
|
|
7
|
+
## [1.13.0](https://github.com/polo-blue/sds/compare/v1.12.1...v1.13.0) (2025-12-06)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **jumbotron:** add align prop to PostSplit variant ([b3bd696](https://github.com/polo-blue/sds/commit/b3bd6967fca48eea0ca11d225c320e210bcf749e))
|
|
12
|
+
|
|
1
13
|
## [1.12.1](https://github.com/polo-blue/sds/compare/v1.12.0...v1.12.1) (2025-12-06)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ interface Props {
|
|
|
20
20
|
backgroundClass?: string;
|
|
21
21
|
lang?: string;
|
|
22
22
|
fullWidth?: boolean;
|
|
23
|
+
align?: 'left' | 'center' | 'right';
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
const {
|
|
@@ -37,6 +38,7 @@ const {
|
|
|
37
38
|
backgroundClass = 'bg-blue-darker',
|
|
38
39
|
lang = 'en',
|
|
39
40
|
fullWidth = false,
|
|
41
|
+
align = 'left',
|
|
40
42
|
} = Astro.props;
|
|
41
43
|
|
|
42
44
|
// Helper (function to check if a slot has content)
|
|
@@ -92,6 +94,7 @@ const commonProps = {
|
|
|
92
94
|
imageWidth={imageWidth}
|
|
93
95
|
imageHeight={imageHeight}
|
|
94
96
|
fullWidth={fullWidth}
|
|
97
|
+
align={align}
|
|
95
98
|
/>
|
|
96
99
|
)
|
|
97
100
|
}
|
|
@@ -16,6 +16,7 @@ interface Props {
|
|
|
16
16
|
hasCategories: boolean;
|
|
17
17
|
lang: string;
|
|
18
18
|
fullWidth?: boolean;
|
|
19
|
+
align?: 'left' | 'center' | 'right';
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const {
|
|
@@ -30,8 +31,17 @@ const {
|
|
|
30
31
|
hasCategories,
|
|
31
32
|
lang = 'en',
|
|
32
33
|
fullWidth = false,
|
|
34
|
+
align = 'left',
|
|
33
35
|
} = Astro.props;
|
|
34
36
|
|
|
37
|
+
// Alignment class mapping
|
|
38
|
+
const alignmentClasses = {
|
|
39
|
+
left: 'justify-start',
|
|
40
|
+
center: 'justify-center',
|
|
41
|
+
right: 'justify-end',
|
|
42
|
+
};
|
|
43
|
+
const alignmentClass = alignmentClasses[align];
|
|
44
|
+
|
|
35
45
|
// Helper function to remove HTML tags
|
|
36
46
|
const stripHtml = (html: string) => {
|
|
37
47
|
return html.replace(/<[^>]*>/g, '');
|
|
@@ -45,7 +55,10 @@ const cleanTitle = stripHtml(title);
|
|
|
45
55
|
<div class="jumbotron-split-container">
|
|
46
56
|
<header class="jumbotron-split-header">
|
|
47
57
|
<div
|
|
48
|
-
class=
|
|
58
|
+
class:list={[
|
|
59
|
+
'heading flex flex-wrap text-white relative items-center mt-auto w-full z-[2]',
|
|
60
|
+
alignmentClass,
|
|
61
|
+
]}
|
|
49
62
|
>
|
|
50
63
|
<div class="jumbotron-split-content">
|
|
51
64
|
<h1 class="jumbotron-split-title" set:html={title} />
|
|
@@ -326,6 +326,45 @@ Use `fullWidth` prop to make the jumbotron span the full viewport width, useful
|
|
|
326
326
|
/>
|
|
327
327
|
```
|
|
328
328
|
|
|
329
|
+
### Post Split with Text Alignment
|
|
330
|
+
Use the `align` prop to control text alignment within the content area. Available options: `left` (default), `center`, `right`.
|
|
331
|
+
|
|
332
|
+
<div class="component-preview pb-0 !block">
|
|
333
|
+
<Jumbotron
|
|
334
|
+
variant="post-split"
|
|
335
|
+
title="Left Aligned Content"
|
|
336
|
+
image="https://img.freepik.com/premium-photo/tranquil-scene-nature-beauty-tropical-rainforest-adventure-generated-by-artificial-intelligence_188544-83820.jpg?w=1200&h=675&f=webp"
|
|
337
|
+
align="left"
|
|
338
|
+
/>
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
```js
|
|
342
|
+
<Jumbotron
|
|
343
|
+
variant="post-split"
|
|
344
|
+
title="Left Aligned Content"
|
|
345
|
+
image="path/to/image.jpg"
|
|
346
|
+
align="left"
|
|
347
|
+
/>
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
<div class="component-preview pb-0 !block">
|
|
351
|
+
<Jumbotron
|
|
352
|
+
variant="post-split"
|
|
353
|
+
title="Center Aligned Content"
|
|
354
|
+
image="https://img.freepik.com/premium-photo/tranquil-scene-nature-beauty-tropical-rainforest-adventure-generated-by-artificial-intelligence_188544-83820.jpg?w=1200&h=675&f=webp"
|
|
355
|
+
align="center"
|
|
356
|
+
/>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
```js
|
|
360
|
+
<Jumbotron
|
|
361
|
+
variant="post-split"
|
|
362
|
+
title="Center Aligned Content"
|
|
363
|
+
image="path/to/image.jpg"
|
|
364
|
+
align="center"
|
|
365
|
+
/>
|
|
366
|
+
```
|
|
367
|
+
|
|
329
368
|
## Custom Intro Slot Example
|
|
330
369
|
Shows how to fully customize the header section using the intro slot. Useful for complex layouts or custom styling.
|
|
331
370
|
|
|
@@ -379,6 +418,7 @@ Shows how to fully customize the header section using the intro slot. Useful for
|
|
|
379
418
|
- `imageWidth`: Custom image width in pixels (default: 768)
|
|
380
419
|
- `imageHeight`: Custom image height in pixels (default: 432)
|
|
381
420
|
- `fullWidth`: When true, adds `full-width-block` class for full viewport width
|
|
421
|
+
- `align`: Text alignment within content area ('left' | 'center' | 'right', default: 'left')
|
|
382
422
|
|
|
383
423
|
### Slots
|
|
384
424
|
- `intro`: Replaces the default title with custom content. Useful for complex headings or custom markup.
|
|
@@ -1,48 +1,66 @@
|
|
|
1
|
-
// shortcuts/jumbotron.ts
|
|
2
|
-
// import { COLORS, LAYOUT, TRANSITIONS, IMAGE_STYLES } from './constants'
|
|
3
|
-
import { breakpoints } from './../breakpoints';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
['jumbotron-cta-wrapper', 'mt-5 sm:(mt-8 flex justify-center)'],
|
|
15
|
-
|
|
16
|
-
// Hero variant
|
|
17
|
-
['jumbotron-hero-wrapper', 'relative w-full'],
|
|
18
|
-
['jumbotron-hero-image', 'absolute inset-0 w-full h-full'],
|
|
19
|
-
['jumbotron-hero-overlay', 'absolute inset-0 bg-gradient-to-r from-blue-900 to-transparent opacity-90 z-1'],
|
|
20
|
-
[
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
[
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
['jumbotron-
|
|
32
|
-
[
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
[
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
[
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
['jumbotron-
|
|
47
|
-
['jumbotron-
|
|
48
|
-
|
|
1
|
+
// shortcuts/jumbotron.ts
|
|
2
|
+
// import { COLORS, LAYOUT, TRANSITIONS, IMAGE_STYLES } from './constants'
|
|
3
|
+
import { breakpoints } from './../breakpoints';
|
|
4
|
+
|
|
5
|
+
export const jumbotronShortcuts = [
|
|
6
|
+
// Default variant
|
|
7
|
+
['jumbotron-header-base', 'relative mx-auto my-auto w-full text-center py-8'],
|
|
8
|
+
['jumbotron-container-small', 'md:min-h-xs sm:py-12 md:py-14 lg:py-16 xl:py-20'],
|
|
9
|
+
['jumbotron-container-large', 'md:min-h-md sm:py-16 md:py-20 lg:py-28 xl:py-32'],
|
|
10
|
+
[
|
|
11
|
+
'jumbotron-title-default',
|
|
12
|
+
'text-3xl headline-light text-white sm:(text-4xl pt-0) md:text-5xl lg:text-6xl',
|
|
13
|
+
],
|
|
14
|
+
['jumbotron-cta-wrapper', 'mt-5 sm:(mt-8 flex justify-center)'],
|
|
15
|
+
|
|
16
|
+
// Hero variant
|
|
17
|
+
['jumbotron-hero-wrapper', 'relative w-full'],
|
|
18
|
+
['jumbotron-hero-image', 'absolute inset-0 w-full h-full'],
|
|
19
|
+
['jumbotron-hero-overlay', 'absolute inset-0 bg-gradient-to-r from-blue-900 to-transparent opacity-90 z-1'],
|
|
20
|
+
[
|
|
21
|
+
'jumbotron-hero-container',
|
|
22
|
+
'xl:container mx-auto px-3.5 md:px-8 py-8 h-56 sm:h-72 md:max-h-72 items-center flex',
|
|
23
|
+
],
|
|
24
|
+
['jumbotron-hero-header', 'relative z-10 text-white'],
|
|
25
|
+
[
|
|
26
|
+
'jumbotron-hero-title',
|
|
27
|
+
'font-headlight text-3xl sm:text-4xl md:text-5xl xl:text-6xl mt-1 line-clamp-3 leading-tight',
|
|
28
|
+
],
|
|
29
|
+
|
|
30
|
+
// Post variant
|
|
31
|
+
['jumbotron-post-header', 'post-header pt-11 w-full justify-center text-white z-2 relative'],
|
|
32
|
+
[
|
|
33
|
+
'jumbotron-post-heading',
|
|
34
|
+
'heading text-white relative flex items-center justify-center mt-auto w-full z-[2]',
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
'jumbotron-post-container',
|
|
38
|
+
`w-full sm:max-w-[${breakpoints.sm}] md:max-w-3xl lg:max-w-5xl xl:max-w-7xl 2xl:max-w-[${breakpoints['2xl']}] px-4 py-5 flex flex-col flex-wrap`,
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
'jumbotron-post-title',
|
|
42
|
+
'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',
|
|
43
|
+
],
|
|
44
|
+
|
|
45
|
+
// Metadata and categories
|
|
46
|
+
['jumbotron-meta', 'order-3 flex items-center text-gray-100'],
|
|
47
|
+
['jumbotron-categories', 'order-1 mt-4'],
|
|
48
|
+
|
|
49
|
+
// Content styles
|
|
50
|
+
['jumbotron-description', 'mb-1 line-clamp-3 text-base sm:text-lg leading-none mt-4'],
|
|
51
|
+
['jumbotron-info', 'font-medium mb-4 line-clamp-1 text-base sm:text-lg mt-2'],
|
|
52
|
+
|
|
53
|
+
// Post Split variant
|
|
54
|
+
['jumbotron-split-wrapper', 'w-full'],
|
|
55
|
+
['jumbotron-split-container', 'xl:container mx-auto px-3.5 md:px-0'],
|
|
56
|
+
['jumbotron-split-header', 'w-full justify-center text-white z-2 mt-auto md:(grid grid-cols-2) pb-4 mb-8'],
|
|
57
|
+
['jumbotron-split-content', 'pl-4 pr-8 py-5 xl:(py-0 pl-0) flex flex-wrap'],
|
|
58
|
+
[
|
|
59
|
+
'jumbotron-split-title',
|
|
60
|
+
'font-headlight text-3xl md:(text-4xl mb-3) xl:text-11 mt-1 order-2 line-clamp-3 pb-1 w-full',
|
|
61
|
+
],
|
|
62
|
+
['jumbotron-split-meta', 'order-3 flex items-center text-gray-100'],
|
|
63
|
+
['jumbotron-split-image-wrapper', 'relative -mb-8 md:(mt-4 -ml-4 mr-4) xl:(ml-0 mr-0)'],
|
|
64
|
+
['jumbotron-split-image', 'relative shadow-xl md:max-h-112 overflow-hidden md:ml-auto'],
|
|
65
|
+
['jumbotron-split-img', 'object-cover'],
|
|
66
|
+
];
|