@yatoday/astro-ui 0.8.4 → 0.9.0
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.d.ts +6 -0
- package/astro.js +4 -0
- package/components/Card0/Card0.astro +0 -1
- package/components/Card0/types.ts +3 -0
- package/components/Card6/Card6.astro +115 -0
- package/components/Card6/Card6.svelte +3 -0
- package/components/Card6/types.ts +11 -0
- package/components/DarkMode/__tests__/DarkMode.test.ts +65 -0
- package/components/DarkMode/global.d.ts +4 -0
- package/components/ItemGrid1/ItemGrid1.astro +69 -0
- package/components/ItemGrid1/ItemGrid1.svelte +3 -0
- package/components/ItemGrid1/types.ts +3 -0
- package/components/WidgetWrapper/WidgetWrapper.astro +5 -3
- package/components/WidgetWrapper/types.ts +1 -0
- package/package.json +1 -1
- package/styles/styles.css +122 -0
- package/svelte.d.ts +6 -0
- package/svelte.js +4 -0
package/astro.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { Card2Props as YtCard2Props } from './components/Card2/types'
|
|
|
11
11
|
import type { Card3Props as YtCard3Props } from './components/Card3/types'
|
|
12
12
|
import type { Card4Props as YtCard4Props } from './components/Card4/types'
|
|
13
13
|
import type { Card5Props as YtCard5Props } from './components/Card5/types'
|
|
14
|
+
import type { Card6Props as YtCard6Props } from './components/Card6/types'
|
|
14
15
|
import type { ConditionalWrapperProps as YtConditionalWrapperProps } from './components/ConditionalWrapper/types'
|
|
15
16
|
import type { CopyToClipboardProps as YtCopyToClipboardProps } from './components/CopyToClipboard/types'
|
|
16
17
|
import type { DarkModeProps as YtDarkModeProps } from './components/DarkMode/types'
|
|
@@ -19,6 +20,7 @@ import type { HeroSectionProps as YtHeroSectionProps } from './components/HeroSe
|
|
|
19
20
|
import type { ImageProps as YtImageProps } from './components/Image/types'
|
|
20
21
|
import type { ImageGalleryIkeaProps as YtImageGalleryIkeaProps } from './components/ImageGalleryIkea/types'
|
|
21
22
|
import type { ItemGrid0Props as YtItemGrid0Props } from './components/ItemGrid0/types'
|
|
23
|
+
import type { ItemGrid1Props as YtItemGrid1Props } from './components/ItemGrid1/types'
|
|
22
24
|
import type { LayoutProps as YtLayoutProps } from './components/Layout/types'
|
|
23
25
|
import type { MetadataProps as YtMetadataProps } from './components/Metadata/types'
|
|
24
26
|
import type { QuantitySwitchProps as YtQuantitySwitchProps } from './components/QuantitySwitch/types'
|
|
@@ -61,6 +63,7 @@ declare module '@yatoday/astro-ui/astro' {
|
|
|
61
63
|
export function Card3(_props: YtCard3Props): any
|
|
62
64
|
export function Card4(_props: YtCard4Props): any
|
|
63
65
|
export function Card5(_props: YtCard5Props): any
|
|
66
|
+
export function Card6(_props: YtCard6Props): any
|
|
64
67
|
export function ConditionalWrapper(_props: YtConditionalWrapperProps): any
|
|
65
68
|
export function CopyToClipboard(_props: YtCopyToClipboardProps): any
|
|
66
69
|
export function DarkMode(_props: YtDarkModeProps): any
|
|
@@ -69,6 +72,7 @@ declare module '@yatoday/astro-ui/astro' {
|
|
|
69
72
|
export function Image(_props: YtImageProps): any
|
|
70
73
|
export function ImageGalleryIkea(_props: YtImageGalleryIkeaProps): any
|
|
71
74
|
export function ItemGrid0(_props: YtItemGrid0Props): any
|
|
75
|
+
export function ItemGrid1(_props: YtItemGrid1Props): any
|
|
72
76
|
export function Layout(_props: YtLayoutProps): any
|
|
73
77
|
export function Metadata(_props: YtMetadataProps): any
|
|
74
78
|
export function QuantitySwitch(_props: YtQuantitySwitchProps): any
|
|
@@ -110,6 +114,7 @@ declare module '@yatoday/astro-ui/astro' {
|
|
|
110
114
|
export type Card3Props = YtCard3Props
|
|
111
115
|
export type Card4Props = YtCard4Props
|
|
112
116
|
export type Card5Props = YtCard5Props
|
|
117
|
+
export type Card6Props = YtCard6Props
|
|
113
118
|
export type ConditionalWrapperProps = YtConditionalWrapperProps
|
|
114
119
|
export type CopyToClipboardProps = YtCopyToClipboardProps
|
|
115
120
|
export type DarkModeProps = YtDarkModeProps
|
|
@@ -118,6 +123,7 @@ declare module '@yatoday/astro-ui/astro' {
|
|
|
118
123
|
export type ImageProps = YtImageProps
|
|
119
124
|
export type ImageGalleryIkeaProps = YtImageGalleryIkeaProps
|
|
120
125
|
export type ItemGrid0Props = YtItemGrid0Props
|
|
126
|
+
export type ItemGrid1Props = YtItemGrid1Props
|
|
121
127
|
export type LayoutProps = YtLayoutProps
|
|
122
128
|
export type MetadataProps = YtMetadataProps
|
|
123
129
|
export type QuantitySwitchProps = YtQuantitySwitchProps
|
package/astro.js
CHANGED
|
@@ -11,6 +11,7 @@ import Card2Component from './components/Card2/Card2.astro'
|
|
|
11
11
|
import Card3Component from './components/Card3/Card3.astro'
|
|
12
12
|
import Card4Component from './components/Card4/Card4.astro'
|
|
13
13
|
import Card5Component from './components/Card5/Card5.astro'
|
|
14
|
+
import Card6Component from './components/Card6/Card6.astro'
|
|
14
15
|
import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.astro'
|
|
15
16
|
import CopyToClipboardComponent from './components/CopyToClipboard/CopyToClipboard.astro'
|
|
16
17
|
import DarkModeComponent from './components/DarkMode/DarkMode.astro'
|
|
@@ -19,6 +20,7 @@ import HeroSectionComponent from './components/HeroSection/HeroSection.astro'
|
|
|
19
20
|
import ImageComponent from './components/Image/Image.astro'
|
|
20
21
|
import ImageGalleryIkeaComponent from './components/ImageGalleryIkea/ImageGalleryIkea.astro'
|
|
21
22
|
import ItemGrid0Component from './components/ItemGrid0/ItemGrid0.astro'
|
|
23
|
+
import ItemGrid1Component from './components/ItemGrid1/ItemGrid1.astro'
|
|
22
24
|
import LayoutComponent from './components/Layout/Layout.astro'
|
|
23
25
|
import MetadataComponent from './components/Metadata/Metadata.astro'
|
|
24
26
|
import QuantitySwitchComponent from './components/QuantitySwitch/QuantitySwitch.astro'
|
|
@@ -60,6 +62,7 @@ export const Card2 = Card2Component
|
|
|
60
62
|
export const Card3 = Card3Component
|
|
61
63
|
export const Card4 = Card4Component
|
|
62
64
|
export const Card5 = Card5Component
|
|
65
|
+
export const Card6 = Card6Component
|
|
63
66
|
export const ConditionalWrapper = ConditionalWrapperComponent
|
|
64
67
|
export const CopyToClipboard = CopyToClipboardComponent
|
|
65
68
|
export const DarkMode = DarkModeComponent
|
|
@@ -68,6 +71,7 @@ export const HeroSection = HeroSectionComponent
|
|
|
68
71
|
export const Image = ImageComponent
|
|
69
72
|
export const ImageGalleryIkea = ImageGalleryIkeaComponent
|
|
70
73
|
export const ItemGrid0 = ItemGrid0Component
|
|
74
|
+
export const ItemGrid1 = ItemGrid1Component
|
|
71
75
|
export const Layout = LayoutComponent
|
|
72
76
|
export const Metadata = MetadataComponent
|
|
73
77
|
export const QuantitySwitch = QuantitySwitchComponent
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type {Card6Props as Props} from './types';
|
|
3
|
+
import {Icon} from "astro-icon/components";
|
|
4
|
+
import {twMerge} from 'tailwind-merge';
|
|
5
|
+
import Card0 from '../Card0/Card0.astro';
|
|
6
|
+
import Image from '../Image/Image.astro';
|
|
7
|
+
import {cn} from '../../utils';
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
title = await Astro.slots.render('title'),
|
|
11
|
+
description,
|
|
12
|
+
callToAction = await Astro.slots.render('actions'),
|
|
13
|
+
image = await Astro.slots.render('image'),
|
|
14
|
+
classes = {},
|
|
15
|
+
as = 'article',
|
|
16
|
+
asHeader = 'h3',
|
|
17
|
+
badge = await Astro.slots.render('badge'),
|
|
18
|
+
widths = [800, 1600],
|
|
19
|
+
size = 800,
|
|
20
|
+
sizes = '(max-width: 1600px) 800px, 1600px'
|
|
21
|
+
} = Astro.props;
|
|
22
|
+
|
|
23
|
+
const WrapperHeaderTag = asHeader;
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
container: containerClass = '',
|
|
27
|
+
content: contentClass = 'bg-gradient-to-b from-transparent to-black/80',
|
|
28
|
+
title: titleClass = '',
|
|
29
|
+
description: descriptionClass = '',
|
|
30
|
+
image: imageClass = '',
|
|
31
|
+
badge: badgeClass = 'top-2 left-2',
|
|
32
|
+
aspect: aspectClass = 'pb-[100%]',
|
|
33
|
+
} = classes;
|
|
34
|
+
|
|
35
|
+
const urlForImage = Array.isArray(callToAction)
|
|
36
|
+
? typeof callToAction[0] === 'string'
|
|
37
|
+
? callToAction[0]
|
|
38
|
+
: (callToAction[0] as { href?: string })?.href
|
|
39
|
+
: typeof callToAction === 'string'
|
|
40
|
+
? callToAction
|
|
41
|
+
: (callToAction as { href?: string })?.href;
|
|
42
|
+
|
|
43
|
+
const LinkWrapperTag = urlForImage ? 'a' : 'div';
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
<Card0
|
|
47
|
+
as={as}
|
|
48
|
+
classes={{
|
|
49
|
+
container: cn('relative h-full bg-gray-200 dark:bg-zinc-700 border-transparent text-inherit justify-start py-0 @container', containerClass),
|
|
50
|
+
badge: badgeClass,
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<!-- Content & link -->
|
|
54
|
+
<LinkWrapperTag href={urlForImage} class={cn("flex flex-col gap-y-2 absolute top-0 right-0 bottom-0 left-0 z-10", image ? 'justify-end' : 'justify-center')}>
|
|
55
|
+
<div class={cn("p-6 @2xl:p-10 pt-8 @2xl:pt-12", contentClass, !image && 'bg-transparent')}>
|
|
56
|
+
{badge && (
|
|
57
|
+
<div class="" set:html={badge}></div>)}
|
|
58
|
+
|
|
59
|
+
<WrapperHeaderTag
|
|
60
|
+
class={cn('font-bold text-lg @lg:text-xl @2xl:text-2xl ', urlForImage && 'group-hover:underline', titleClass)}>
|
|
61
|
+
{title}
|
|
62
|
+
</WrapperHeaderTag>
|
|
63
|
+
|
|
64
|
+
<div class={cn('text-sm @lg:text-base @2xl:text-lg mt-2 ', descriptionClass)}>
|
|
65
|
+
<slot/>
|
|
66
|
+
{description}
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
{urlForImage && (
|
|
70
|
+
<div class="size-6 overflow-hidden mt-4 ">
|
|
71
|
+
<div
|
|
72
|
+
class="grid grid-cols-2 w-12 gap-2 duration-400 transition-transform -translate-x-7 group-hover:translate-x-0">
|
|
73
|
+
<Icon name="tabler:arrow-right" class="size-6"/>
|
|
74
|
+
<Icon name="tabler:arrow-right" class="size-6"/>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
</div>
|
|
79
|
+
</LinkWrapperTag>
|
|
80
|
+
|
|
81
|
+
<!-- Image -->
|
|
82
|
+
<div class="relative flex w-full h-full overflow-hidden">
|
|
83
|
+
|
|
84
|
+
<!--
|
|
85
|
+
16/9: pb-[56%]
|
|
86
|
+
4/3: pb-[75%]
|
|
87
|
+
1/1: pb-[100%] - default
|
|
88
|
+
6/7: pb-[116%]
|
|
89
|
+
4/5: pb-[125%]
|
|
90
|
+
3/4: pb-[133%]
|
|
91
|
+
9/16: pb-[177%]
|
|
92
|
+
-->
|
|
93
|
+
<div class={cn("relative w-full h-auto", aspectClass)}>
|
|
94
|
+
{image && (
|
|
95
|
+
<Fragment>
|
|
96
|
+
{typeof image === 'string' ? (
|
|
97
|
+
<Fragment set:html={image}/>
|
|
98
|
+
) : (
|
|
99
|
+
<Image
|
|
100
|
+
class={cn('w-full h-full absolute left-0 top-0 p-0', imageClass)}
|
|
101
|
+
widths={widths}
|
|
102
|
+
width={size}
|
|
103
|
+
height={size}
|
|
104
|
+
sizes={sizes}
|
|
105
|
+
layout="cover"
|
|
106
|
+
loading="lazy"
|
|
107
|
+
decoding="async"
|
|
108
|
+
{...image}
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
111
|
+
</Fragment>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</Card0>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLTag } from 'astro/types';
|
|
2
|
+
import type { Card0Props } from '../Card0/types';
|
|
3
|
+
import type { ToAction } from '../../types';
|
|
4
|
+
|
|
5
|
+
export type Card6Props = {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
asHeader?: HTMLTag;
|
|
9
|
+
badge?: string;
|
|
10
|
+
callToAction?: string | ToAction | Array<string | ToAction>;
|
|
11
|
+
} & Card0Props;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
// Since we can't directly test Svelte 5 components due to the server-side rendering approach,
|
|
5
|
+
// we'll test the utility aspects of the component instead.
|
|
6
|
+
|
|
7
|
+
describe('DarkMode Component', () => {
|
|
8
|
+
// Mock document and window objects
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
// Mock document.documentElement
|
|
11
|
+
Object.defineProperty(document, 'documentElement', {
|
|
12
|
+
value: {
|
|
13
|
+
classList: {
|
|
14
|
+
add: vi.fn(),
|
|
15
|
+
remove: vi.fn(),
|
|
16
|
+
toggle: vi.fn(),
|
|
17
|
+
contains: vi.fn().mockReturnValue(true)
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
writable: true
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Mock localStorage
|
|
24
|
+
Object.defineProperty(window, 'localStorage', {
|
|
25
|
+
value: {
|
|
26
|
+
theme: null,
|
|
27
|
+
getItem: vi.fn(),
|
|
28
|
+
setItem: vi.fn()
|
|
29
|
+
},
|
|
30
|
+
writable: true
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Mock matchMedia
|
|
34
|
+
Object.defineProperty(window, 'matchMedia', {
|
|
35
|
+
value: vi.fn().mockImplementation(query => ({
|
|
36
|
+
matches: false,
|
|
37
|
+
media: query,
|
|
38
|
+
onchange: null,
|
|
39
|
+
addListener: vi.fn(),
|
|
40
|
+
removeListener: vi.fn(),
|
|
41
|
+
addEventListener: vi.fn(),
|
|
42
|
+
removeEventListener: vi.fn(),
|
|
43
|
+
dispatchEvent: vi.fn(),
|
|
44
|
+
})),
|
|
45
|
+
writable: true
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Reset darkModeInitialized
|
|
49
|
+
window.darkModeInitialized = false;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Test toggle functionality
|
|
53
|
+
it('toggles dark mode correctly', () => {
|
|
54
|
+
const root = document.documentElement;
|
|
55
|
+
|
|
56
|
+
// Simulate toggle
|
|
57
|
+
root.classList.toggle('dark');
|
|
58
|
+
localStorage.theme = root.classList.contains('dark') ? 'dark' : 'light';
|
|
59
|
+
|
|
60
|
+
// Check that classList.toggle was called with 'dark'
|
|
61
|
+
expect(root.classList.toggle).toHaveBeenCalledWith('dark');
|
|
62
|
+
// Check that localStorage.theme was set to 'dark' (since contains returns true)
|
|
63
|
+
expect(localStorage.theme).toBe('dark');
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ItemGrid1Props as Props } from './types';
|
|
3
|
+
|
|
4
|
+
import {cn} from "../../utils";
|
|
5
|
+
|
|
6
|
+
const { class: classNames } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<style is:global>
|
|
10
|
+
.item-grid > :nth-child(1) { grid-area: a }
|
|
11
|
+
.item-grid > :nth-child(2) { grid-area: b }
|
|
12
|
+
.item-grid > :nth-child(3) { grid-area: c }
|
|
13
|
+
.item-grid > :nth-child(4) { grid-area: d }
|
|
14
|
+
.item-grid > :nth-child(5) { grid-area: e }
|
|
15
|
+
|
|
16
|
+
/* Dynamic grid layouts based on number of children */
|
|
17
|
+
.item-grid:has(>:nth-child(4):last-child) {
|
|
18
|
+
grid-template-areas: "a a" "b c" "d d";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@media screen and (min-width: 56.25em) {
|
|
22
|
+
.item-grid:has(>:nth-child(4):last-child) {
|
|
23
|
+
grid-template-areas: "a a b c" "a a d d";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/* 5 items */
|
|
27
|
+
.item-grid:has(>:nth-child(5):last-child) {
|
|
28
|
+
grid-template-areas: "a a" "b c" "d c" "d e";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media screen and (min-width: 56.25em) {
|
|
32
|
+
.item-grid:has(>:nth-child(5):last-child) {
|
|
33
|
+
grid-template-areas: "a a b c" "a a d c" "a a d e";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* 3 items */
|
|
38
|
+
.item-grid:has(>:nth-child(3):last-child) {
|
|
39
|
+
grid-template-areas: "a a" "b c";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media screen and (min-width: 56.25em) {
|
|
43
|
+
.item-grid:has(>:nth-child(3):last-child) {
|
|
44
|
+
grid-template-areas: "a a b b" "a a c c";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* 2 items */
|
|
49
|
+
.item-grid:has(>:nth-child(2):last-child) {
|
|
50
|
+
grid-template-areas: "a" "b";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media screen and (min-width: 56.25em) {
|
|
54
|
+
.item-grid:has(>:nth-child(2):last-child) {
|
|
55
|
+
grid-template-areas: "a b";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* 1 item */
|
|
60
|
+
.item-grid:has(>:nth-child(1):last-child) {
|
|
61
|
+
grid-template-areas: "a";
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
64
|
+
|
|
65
|
+
<div class="@container">
|
|
66
|
+
<div class={cn(`item-grid grid gap-4`, classNames)}>
|
|
67
|
+
<slot />
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
3
|
import type { WidgetWrapperProps as Props } from './types';
|
|
4
4
|
import Background from '../Background/Background.astro';
|
|
5
|
+
import {cn} from "../../utils";
|
|
5
6
|
|
|
6
|
-
const { id, isDark = false, class: className = '', containerClass = '', bg, as = 'section', ...rest } = Astro.props;
|
|
7
|
+
const { id, isDark = false, class: className = '', containerClass = '', bg, as = 'section', isAfterContent = false, ...rest } = Astro.props;
|
|
7
8
|
|
|
8
9
|
const WrapperTag = as;
|
|
9
10
|
---
|
|
@@ -19,8 +20,9 @@ const WrapperTag = as;
|
|
|
19
20
|
<!-- WrapperTag: content -->
|
|
20
21
|
<div
|
|
21
22
|
class:list={[
|
|
22
|
-
|
|
23
|
-
'relative mx-auto max-w-7xl 2xl:max-w-[96rem] px-4 md:px-6
|
|
23
|
+
cn(
|
|
24
|
+
'relative mx-auto max-w-7xl 2xl:max-w-[96rem] px-4 md:px-6 text-default',
|
|
25
|
+
isAfterContent ? 'py-6 md:py-8' : 'py-12 md:py-16 lg:py-20',
|
|
24
26
|
containerClass
|
|
25
27
|
),
|
|
26
28
|
{ dark: isDark },
|
package/package.json
CHANGED
package/styles/styles.css
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
--color-violet-500: oklch(0.606 0.25 292.717);
|
|
15
15
|
--color-purple-500: oklch(0.627 0.265 303.9);
|
|
16
16
|
--color-purple-800: oklch(0.438 0.218 303.724);
|
|
17
|
+
--color-fuchsia-200: oklch(0.903 0.076 319.62);
|
|
18
|
+
--color-fuchsia-800: oklch(0.452 0.211 324.591);
|
|
17
19
|
--color-pink-500: oklch(0.656 0.241 354.308);
|
|
18
20
|
--color-slate-50: oklch(0.984 0.003 247.858);
|
|
19
21
|
--color-slate-100: oklch(0.968 0.007 247.896);
|
|
@@ -21,6 +23,7 @@
|
|
|
21
23
|
--color-slate-300: oklch(0.869 0.022 252.894);
|
|
22
24
|
--color-slate-400: oklch(0.704 0.04 256.788);
|
|
23
25
|
--color-slate-700: oklch(0.372 0.044 257.287);
|
|
26
|
+
--color-slate-800: oklch(0.279 0.041 260.031);
|
|
24
27
|
--color-gray-50: oklch(0.985 0.002 247.839);
|
|
25
28
|
--color-gray-100: oklch(0.967 0.003 264.542);
|
|
26
29
|
--color-gray-200: oklch(0.928 0.006 264.531);
|
|
@@ -306,6 +309,9 @@
|
|
|
306
309
|
.-right-5 {
|
|
307
310
|
right: calc(var(--spacing) * -5);
|
|
308
311
|
}
|
|
312
|
+
.right-0 {
|
|
313
|
+
right: calc(var(--spacing) * 0);
|
|
314
|
+
}
|
|
309
315
|
.right-5 {
|
|
310
316
|
right: calc(var(--spacing) * 5);
|
|
311
317
|
}
|
|
@@ -728,6 +734,10 @@
|
|
|
728
734
|
--tw-translate-x: calc(calc(1/2 * 100%) * -1);
|
|
729
735
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
730
736
|
}
|
|
737
|
+
.-translate-x-7 {
|
|
738
|
+
--tw-translate-x: calc(var(--spacing) * -7);
|
|
739
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
740
|
+
}
|
|
731
741
|
.-translate-x-full {
|
|
732
742
|
--tw-translate-x: -100%;
|
|
733
743
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
@@ -781,6 +791,9 @@
|
|
|
781
791
|
.grid-cols-1 {
|
|
782
792
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
783
793
|
}
|
|
794
|
+
.grid-cols-2 {
|
|
795
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
796
|
+
}
|
|
784
797
|
.grid-cols-3 {
|
|
785
798
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
786
799
|
}
|
|
@@ -802,6 +815,9 @@
|
|
|
802
815
|
.flex-wrap {
|
|
803
816
|
flex-wrap: wrap;
|
|
804
817
|
}
|
|
818
|
+
.place-content-center {
|
|
819
|
+
place-content: center;
|
|
820
|
+
}
|
|
805
821
|
.items-center {
|
|
806
822
|
align-items: center;
|
|
807
823
|
}
|
|
@@ -874,6 +890,9 @@
|
|
|
874
890
|
.gap-x-8 {
|
|
875
891
|
column-gap: calc(var(--spacing) * 8);
|
|
876
892
|
}
|
|
893
|
+
.gap-y-2 {
|
|
894
|
+
row-gap: calc(var(--spacing) * 2);
|
|
895
|
+
}
|
|
877
896
|
.gap-y-6 {
|
|
878
897
|
row-gap: calc(var(--spacing) * 6);
|
|
879
898
|
}
|
|
@@ -988,6 +1007,12 @@
|
|
|
988
1007
|
.bg-black\/10 {
|
|
989
1008
|
background-color: color-mix(in oklab, var(--color-black) 10%, transparent);
|
|
990
1009
|
}
|
|
1010
|
+
.bg-fuchsia-200 {
|
|
1011
|
+
background-color: var(--color-fuchsia-200);
|
|
1012
|
+
}
|
|
1013
|
+
.bg-gray-200 {
|
|
1014
|
+
background-color: var(--color-gray-200);
|
|
1015
|
+
}
|
|
991
1016
|
.bg-gray-400 {
|
|
992
1017
|
background-color: var(--color-gray-400);
|
|
993
1018
|
}
|
|
@@ -1030,6 +1055,10 @@
|
|
|
1030
1055
|
.bg-zinc-700 {
|
|
1031
1056
|
background-color: var(--color-zinc-700);
|
|
1032
1057
|
}
|
|
1058
|
+
.bg-gradient-to-b {
|
|
1059
|
+
--tw-gradient-position: to bottom in oklab;
|
|
1060
|
+
background-image: linear-gradient(var(--tw-gradient-stops));
|
|
1061
|
+
}
|
|
1033
1062
|
.bg-gradient-to-r {
|
|
1034
1063
|
--tw-gradient-position: to right in oklab;
|
|
1035
1064
|
background-image: linear-gradient(var(--tw-gradient-stops));
|
|
@@ -1058,10 +1087,18 @@
|
|
|
1058
1087
|
--tw-gradient-from: var(--color-pink-500);
|
|
1059
1088
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
1060
1089
|
}
|
|
1090
|
+
.from-transparent {
|
|
1091
|
+
--tw-gradient-from: transparent;
|
|
1092
|
+
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
1093
|
+
}
|
|
1061
1094
|
.to-\[\#776fff\] {
|
|
1062
1095
|
--tw-gradient-to: #776fff;
|
|
1063
1096
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
1064
1097
|
}
|
|
1098
|
+
.to-black\/80 {
|
|
1099
|
+
--tw-gradient-to: color-mix(in oklab, var(--color-black) 80%, transparent);
|
|
1100
|
+
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
1101
|
+
}
|
|
1065
1102
|
.to-gray-600 {
|
|
1066
1103
|
--tw-gradient-to: var(--color-gray-600);
|
|
1067
1104
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
@@ -1173,6 +1210,9 @@
|
|
|
1173
1210
|
.pt-4 {
|
|
1174
1211
|
padding-top: calc(var(--spacing) * 4);
|
|
1175
1212
|
}
|
|
1213
|
+
.pt-8 {
|
|
1214
|
+
padding-top: calc(var(--spacing) * 8);
|
|
1215
|
+
}
|
|
1176
1216
|
.pr-4 {
|
|
1177
1217
|
padding-right: calc(var(--spacing) * 4);
|
|
1178
1218
|
}
|
|
@@ -1185,6 +1225,27 @@
|
|
|
1185
1225
|
.pb-8 {
|
|
1186
1226
|
padding-bottom: calc(var(--spacing) * 8);
|
|
1187
1227
|
}
|
|
1228
|
+
.pb-\[56\%\] {
|
|
1229
|
+
padding-bottom: 56%;
|
|
1230
|
+
}
|
|
1231
|
+
.pb-\[75\%\] {
|
|
1232
|
+
padding-bottom: 75%;
|
|
1233
|
+
}
|
|
1234
|
+
.pb-\[100\%\] {
|
|
1235
|
+
padding-bottom: 100%;
|
|
1236
|
+
}
|
|
1237
|
+
.pb-\[116\%\] {
|
|
1238
|
+
padding-bottom: 116%;
|
|
1239
|
+
}
|
|
1240
|
+
.pb-\[125\%\] {
|
|
1241
|
+
padding-bottom: 125%;
|
|
1242
|
+
}
|
|
1243
|
+
.pb-\[133\%\] {
|
|
1244
|
+
padding-bottom: 133%;
|
|
1245
|
+
}
|
|
1246
|
+
.pb-\[177\%\] {
|
|
1247
|
+
padding-bottom: 177%;
|
|
1248
|
+
}
|
|
1188
1249
|
.pl-0 {
|
|
1189
1250
|
padding-left: calc(var(--spacing) * 0);
|
|
1190
1251
|
}
|
|
@@ -1342,6 +1403,9 @@
|
|
|
1342
1403
|
.text-red-500 {
|
|
1343
1404
|
color: var(--color-red-500);
|
|
1344
1405
|
}
|
|
1406
|
+
.text-slate-800 {
|
|
1407
|
+
color: var(--color-slate-800);
|
|
1408
|
+
}
|
|
1345
1409
|
.text-transparent {
|
|
1346
1410
|
color: transparent;
|
|
1347
1411
|
}
|
|
@@ -1457,6 +1521,10 @@
|
|
|
1457
1521
|
--tw-duration: 300ms;
|
|
1458
1522
|
transition-duration: 300ms;
|
|
1459
1523
|
}
|
|
1524
|
+
.duration-400 {
|
|
1525
|
+
--tw-duration: 400ms;
|
|
1526
|
+
transition-duration: 400ms;
|
|
1527
|
+
}
|
|
1460
1528
|
.ease-in-out {
|
|
1461
1529
|
--tw-ease: var(--ease-in-out);
|
|
1462
1530
|
transition-timing-function: var(--ease-in-out);
|
|
@@ -1465,6 +1533,14 @@
|
|
|
1465
1533
|
-webkit-user-select: none;
|
|
1466
1534
|
user-select: none;
|
|
1467
1535
|
}
|
|
1536
|
+
.group-hover\:translate-x-0 {
|
|
1537
|
+
&:is(:where(.group):hover *) {
|
|
1538
|
+
@media (hover: hover) {
|
|
1539
|
+
--tw-translate-x: calc(var(--spacing) * 0);
|
|
1540
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1468
1544
|
.group-hover\:scale-105 {
|
|
1469
1545
|
&:is(:where(.group):hover *) {
|
|
1470
1546
|
@media (hover: hover) {
|
|
@@ -1475,6 +1551,13 @@
|
|
|
1475
1551
|
}
|
|
1476
1552
|
}
|
|
1477
1553
|
}
|
|
1554
|
+
.group-hover\:underline {
|
|
1555
|
+
&:is(:where(.group):hover *) {
|
|
1556
|
+
@media (hover: hover) {
|
|
1557
|
+
text-decoration-line: underline;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1478
1561
|
.group-hover\:opacity-100 {
|
|
1479
1562
|
&:is(:where(.group):hover *) {
|
|
1480
1563
|
@media (hover: hover) {
|
|
@@ -2402,6 +2485,40 @@
|
|
|
2402
2485
|
display: flex;
|
|
2403
2486
|
}
|
|
2404
2487
|
}
|
|
2488
|
+
.\@lg\:text-base {
|
|
2489
|
+
@container (width >= 32rem) {
|
|
2490
|
+
font-size: var(--text-base);
|
|
2491
|
+
line-height: var(--tw-leading, var(--text-base--line-height));
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
.\@lg\:text-xl {
|
|
2495
|
+
@container (width >= 32rem) {
|
|
2496
|
+
font-size: var(--text-xl);
|
|
2497
|
+
line-height: var(--tw-leading, var(--text-xl--line-height));
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
.\@2xl\:p-10 {
|
|
2501
|
+
@container (width >= 42rem) {
|
|
2502
|
+
padding: calc(var(--spacing) * 10);
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
.\@2xl\:pt-12 {
|
|
2506
|
+
@container (width >= 42rem) {
|
|
2507
|
+
padding-top: calc(var(--spacing) * 12);
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
.\@2xl\:text-2xl {
|
|
2511
|
+
@container (width >= 42rem) {
|
|
2512
|
+
font-size: var(--text-2xl);
|
|
2513
|
+
line-height: var(--tw-leading, var(--text-2xl--line-height));
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
.\@2xl\:text-lg {
|
|
2517
|
+
@container (width >= 42rem) {
|
|
2518
|
+
font-size: var(--text-lg);
|
|
2519
|
+
line-height: var(--tw-leading, var(--text-lg--line-height));
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2405
2522
|
.\@3xl\:grid-cols-3 {
|
|
2406
2523
|
@container (width >= 48rem) {
|
|
2407
2524
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
@@ -2552,6 +2669,11 @@
|
|
|
2552
2669
|
border-color: var(--color-zinc-700);
|
|
2553
2670
|
}
|
|
2554
2671
|
}
|
|
2672
|
+
.dark\:bg-fuchsia-800 {
|
|
2673
|
+
&:where(.dark, .dark *) {
|
|
2674
|
+
background-color: var(--color-fuchsia-800);
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2555
2677
|
.dark\:bg-green-700 {
|
|
2556
2678
|
&:where(.dark, .dark *) {
|
|
2557
2679
|
background-color: var(--color-green-700);
|
package/svelte.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { SvelteCard2Props as YtSvelteCard2Props } from './components/Card2/
|
|
|
12
12
|
import type { SvelteCard3Props as YtSvelteCard3Props } from './components/Card3/types'
|
|
13
13
|
import type { SvelteCard4Props as YtSvelteCard4Props } from './components/Card4/types'
|
|
14
14
|
import type { SvelteCard5Props as YtSvelteCard5Props } from './components/Card5/types'
|
|
15
|
+
import type { SvelteCard6Props as YtSvelteCard6Props } from './components/Card6/types'
|
|
15
16
|
import type { SvelteConditionalWrapperProps as YtSvelteConditionalWrapperProps } from './components/ConditionalWrapper/types'
|
|
16
17
|
import type { SvelteCopyToClipboardProps as YtSvelteCopyToClipboardProps } from './components/CopyToClipboard/types'
|
|
17
18
|
import type { SvelteDarkModeProps as YtSvelteDarkModeProps } from './components/DarkMode/types'
|
|
@@ -20,6 +21,7 @@ import type { SvelteHeroSectionProps as YtSvelteHeroSectionProps } from './compo
|
|
|
20
21
|
import type { SvelteImageProps as YtSvelteImageProps } from './components/Image/types'
|
|
21
22
|
import type { SvelteImageGalleryIkeaProps as YtSvelteImageGalleryIkeaProps } from './components/ImageGalleryIkea/types'
|
|
22
23
|
import type { SvelteItemGrid0Props as YtSvelteItemGrid0Props } from './components/ItemGrid0/types'
|
|
24
|
+
import type { SvelteItemGrid1Props as YtSvelteItemGrid1Props } from './components/ItemGrid1/types'
|
|
23
25
|
import type { SvelteLayoutProps as YtSvelteLayoutProps } from './components/Layout/types'
|
|
24
26
|
import type { SvelteMetadataProps as YtSvelteMetadataProps } from './components/Metadata/types'
|
|
25
27
|
import type { SvelteQuantitySwitchProps as YtSvelteQuantitySwitchProps } from './components/QuantitySwitch/types'
|
|
@@ -62,6 +64,7 @@ declare module '@yatoday/astro-ui/svelte' {
|
|
|
62
64
|
export const Card3: Component<YtSvelteCard3Props>
|
|
63
65
|
export const Card4: Component<YtSvelteCard4Props>
|
|
64
66
|
export const Card5: Component<YtSvelteCard5Props>
|
|
67
|
+
export const Card6: Component<YtSvelteCard6Props>
|
|
65
68
|
export const ConditionalWrapper: Component<YtSvelteConditionalWrapperProps>
|
|
66
69
|
export const CopyToClipboard: Component<YtSvelteCopyToClipboardProps>
|
|
67
70
|
export const DarkMode: Component<YtSvelteDarkModeProps>
|
|
@@ -70,6 +73,7 @@ declare module '@yatoday/astro-ui/svelte' {
|
|
|
70
73
|
export const Image: Component<YtSvelteImageProps>
|
|
71
74
|
export const ImageGalleryIkea: Component<YtSvelteImageGalleryIkeaProps>
|
|
72
75
|
export const ItemGrid0: Component<YtSvelteItemGrid0Props>
|
|
76
|
+
export const ItemGrid1: Component<YtSvelteItemGrid1Props>
|
|
73
77
|
export const Layout: Component<YtSvelteLayoutProps>
|
|
74
78
|
export const Metadata: Component<YtSvelteMetadataProps>
|
|
75
79
|
export const QuantitySwitch: Component<YtSvelteQuantitySwitchProps>
|
|
@@ -111,6 +115,7 @@ declare module '@yatoday/astro-ui/svelte' {
|
|
|
111
115
|
export type Card3Props = YtSvelteCard3Props
|
|
112
116
|
export type Card4Props = YtSvelteCard4Props
|
|
113
117
|
export type Card5Props = YtSvelteCard5Props
|
|
118
|
+
export type Card6Props = YtSvelteCard6Props
|
|
114
119
|
export type ConditionalWrapperProps = YtSvelteConditionalWrapperProps
|
|
115
120
|
export type CopyToClipboardProps = YtSvelteCopyToClipboardProps
|
|
116
121
|
export type DarkModeProps = YtSvelteDarkModeProps
|
|
@@ -119,6 +124,7 @@ declare module '@yatoday/astro-ui/svelte' {
|
|
|
119
124
|
export type ImageProps = YtSvelteImageProps
|
|
120
125
|
export type ImageGalleryIkeaProps = YtSvelteImageGalleryIkeaProps
|
|
121
126
|
export type ItemGrid0Props = YtSvelteItemGrid0Props
|
|
127
|
+
export type ItemGrid1Props = YtSvelteItemGrid1Props
|
|
122
128
|
export type LayoutProps = YtSvelteLayoutProps
|
|
123
129
|
export type MetadataProps = YtSvelteMetadataProps
|
|
124
130
|
export type QuantitySwitchProps = YtSvelteQuantitySwitchProps
|
package/svelte.js
CHANGED
|
@@ -11,6 +11,7 @@ import Card2Component from './components/Card2/Card2.svelte'
|
|
|
11
11
|
import Card3Component from './components/Card3/Card3.svelte'
|
|
12
12
|
import Card4Component from './components/Card4/Card4.svelte'
|
|
13
13
|
import Card5Component from './components/Card5/Card5.svelte'
|
|
14
|
+
import Card6Component from './components/Card6/Card6.svelte'
|
|
14
15
|
import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.svelte'
|
|
15
16
|
import CopyToClipboardComponent from './components/CopyToClipboard/CopyToClipboard.svelte'
|
|
16
17
|
import DarkModeComponent from './components/DarkMode/DarkMode.svelte'
|
|
@@ -19,6 +20,7 @@ import HeroSectionComponent from './components/HeroSection/HeroSection.svelte'
|
|
|
19
20
|
import ImageComponent from './components/Image/Image.svelte'
|
|
20
21
|
import ImageGalleryIkeaComponent from './components/ImageGalleryIkea/ImageGalleryIkea.svelte'
|
|
21
22
|
import ItemGrid0Component from './components/ItemGrid0/ItemGrid0.svelte'
|
|
23
|
+
import ItemGrid1Component from './components/ItemGrid1/ItemGrid1.svelte'
|
|
22
24
|
import LayoutComponent from './components/Layout/Layout.svelte'
|
|
23
25
|
import MetadataComponent from './components/Metadata/Metadata.svelte'
|
|
24
26
|
import QuantitySwitchComponent from './components/QuantitySwitch/QuantitySwitch.svelte'
|
|
@@ -60,6 +62,7 @@ export const Card2 = Card2Component
|
|
|
60
62
|
export const Card3 = Card3Component
|
|
61
63
|
export const Card4 = Card4Component
|
|
62
64
|
export const Card5 = Card5Component
|
|
65
|
+
export const Card6 = Card6Component
|
|
63
66
|
export const ConditionalWrapper = ConditionalWrapperComponent
|
|
64
67
|
export const CopyToClipboard = CopyToClipboardComponent
|
|
65
68
|
export const DarkMode = DarkModeComponent
|
|
@@ -68,6 +71,7 @@ export const HeroSection = HeroSectionComponent
|
|
|
68
71
|
export const Image = ImageComponent
|
|
69
72
|
export const ImageGalleryIkea = ImageGalleryIkeaComponent
|
|
70
73
|
export const ItemGrid0 = ItemGrid0Component
|
|
74
|
+
export const ItemGrid1 = ItemGrid1Component
|
|
71
75
|
export const Layout = LayoutComponent
|
|
72
76
|
export const Metadata = MetadataComponent
|
|
73
77
|
export const QuantitySwitch = QuantitySwitchComponent
|