cclkit4svelte 4.0.0 → 4.0.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/README.md +1 -1
- package/dist/Pagination.svelte +41 -23
- package/dist/PrismaticBookCard.svelte +27 -1
- package/dist/PrismaticBookCard.svelte.d.ts +3 -0
- package/dist/PrismaticSiteFooter.svelte +79 -13
- package/dist/PrismaticSiteFooter.svelte.d.ts +7 -0
- package/dist/PrismaticSiteHeader.svelte +31 -14
- package/dist/PrismaticSiteHeader.svelte.d.ts +12 -1
- package/dist/PrismaticStoryCard.svelte +3 -1
- package/dist/PrismaticStoryCard.svelte.d.ts +2 -0
- package/dist/PrismaticWorkCard.svelte +28 -1
- package/dist/PrismaticWorkCard.svelte.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# ccl-component-kit4svelte
|
|
2
2
|
|
|
3
3
|
[](https://github.com/reiji1020/ccl-component-kit4svelte/actions/workflows/storybook-release.yaml)
|
|
4
|
-
[](https://github.com/reiji1020/ccl-component-kit4svelte/actions/workflows/publish-package.yaml)
|
|
5
5
|
|
|
6
6
|

|
|
7
7
|
|
package/dist/Pagination.svelte
CHANGED
|
@@ -17,21 +17,26 @@
|
|
|
17
17
|
const dispatch = createEventDispatcher<{ change: { page: number } }>();
|
|
18
18
|
|
|
19
19
|
// normalize and clamp helpers
|
|
20
|
-
function getPageCount(
|
|
21
|
-
|
|
20
|
+
function getPageCount(
|
|
21
|
+
pageCountValue: number | undefined,
|
|
22
|
+
totalValue: number | undefined,
|
|
23
|
+
perPageValue: number
|
|
24
|
+
): number {
|
|
25
|
+
const count =
|
|
26
|
+
pageCountValue ?? (totalValue && perPageValue ? Math.ceil(totalValue / perPageValue) : 1);
|
|
22
27
|
return Math.max(1, count || 1);
|
|
23
28
|
}
|
|
24
29
|
|
|
25
|
-
function clampPage(p: number): number {
|
|
26
|
-
|
|
27
|
-
return Math.min(Math.max(1, Math.trunc(p || 1)), max);
|
|
30
|
+
function clampPage(p: number, totalPages: number): number {
|
|
31
|
+
return Math.min(Math.max(1, Math.trunc(p || 1)), totalPages);
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
$:
|
|
34
|
+
$: totalPages = getPageCount(pageCount, total, perPage);
|
|
35
|
+
$: page = clampPage(page, totalPages);
|
|
31
36
|
|
|
32
37
|
function goTo(p: number) {
|
|
33
38
|
if (disabled) return;
|
|
34
|
-
const next = clampPage(p);
|
|
39
|
+
const next = clampPage(p, totalPages);
|
|
35
40
|
if (next !== page) {
|
|
36
41
|
page = next;
|
|
37
42
|
dispatch('change', { page });
|
|
@@ -44,37 +49,50 @@
|
|
|
44
49
|
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
45
50
|
}
|
|
46
51
|
|
|
47
|
-
function usePagination(
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
function usePagination(
|
|
53
|
+
currentPage: number,
|
|
54
|
+
totalPages: number,
|
|
55
|
+
currentBoundaryCount: number,
|
|
56
|
+
currentSiblingCount: number
|
|
57
|
+
): Item[] {
|
|
50
58
|
// total pages small enough to show all
|
|
51
|
-
const totalNumbers =
|
|
59
|
+
const totalNumbers = currentBoundaryCount * 2 + currentSiblingCount * 2 + 3; // first + last + current
|
|
52
60
|
const totalBlocks = totalNumbers + 2; // with two ellipses
|
|
53
61
|
|
|
54
62
|
if (totalPages <= totalBlocks) {
|
|
55
63
|
return range(1, totalPages);
|
|
56
64
|
}
|
|
57
65
|
|
|
58
|
-
const startPages = range(1, Math.min(
|
|
66
|
+
const startPages = range(1, Math.min(currentBoundaryCount, totalPages));
|
|
59
67
|
const endPages = range(
|
|
60
|
-
Math.max(totalPages -
|
|
68
|
+
Math.max(totalPages - currentBoundaryCount + 1, currentBoundaryCount + 1),
|
|
61
69
|
totalPages
|
|
62
70
|
);
|
|
63
71
|
|
|
64
72
|
const siblingsStart = Math.max(
|
|
65
|
-
Math.min(
|
|
66
|
-
|
|
73
|
+
Math.min(
|
|
74
|
+
currentPage - currentSiblingCount,
|
|
75
|
+
totalPages - currentBoundaryCount - currentSiblingCount * 2 - 1
|
|
76
|
+
),
|
|
77
|
+
currentBoundaryCount + 2
|
|
67
78
|
);
|
|
68
79
|
const siblingsEnd = Math.min(
|
|
69
|
-
Math.max(
|
|
80
|
+
Math.max(
|
|
81
|
+
currentPage + currentSiblingCount,
|
|
82
|
+
currentBoundaryCount + currentSiblingCount * 2 + 2
|
|
83
|
+
),
|
|
70
84
|
endPages[0] - 2
|
|
71
85
|
);
|
|
72
86
|
|
|
73
87
|
const items: Item[] = [
|
|
74
88
|
...startPages,
|
|
75
|
-
siblingsStart >
|
|
89
|
+
siblingsStart > currentBoundaryCount + 2
|
|
90
|
+
? 'ellipsis'
|
|
91
|
+
: ((currentBoundaryCount + 1) as unknown as Item),
|
|
76
92
|
...range(siblingsStart, siblingsEnd),
|
|
77
|
-
siblingsEnd < totalPages -
|
|
93
|
+
siblingsEnd < totalPages - currentBoundaryCount - 1
|
|
94
|
+
? 'ellipsis'
|
|
95
|
+
: ((totalPages - currentBoundaryCount) as unknown as Item),
|
|
78
96
|
...endPages
|
|
79
97
|
];
|
|
80
98
|
|
|
@@ -92,11 +110,11 @@
|
|
|
92
110
|
return normalized;
|
|
93
111
|
}
|
|
94
112
|
|
|
95
|
-
$: items = usePagination();
|
|
113
|
+
$: items = usePagination(page, totalPages, boundaryCount, siblingCount);
|
|
96
114
|
|
|
97
115
|
onMount(() => {
|
|
98
116
|
// Ensure initial page is clamped and consumers can react if needed
|
|
99
|
-
const normalized = clampPage(page);
|
|
117
|
+
const normalized = clampPage(page, totalPages);
|
|
100
118
|
if (normalized !== page) {
|
|
101
119
|
page = normalized;
|
|
102
120
|
dispatch('change', { page });
|
|
@@ -152,7 +170,7 @@
|
|
|
152
170
|
<button
|
|
153
171
|
class="ccl-pagination__control"
|
|
154
172
|
on:click={() => goTo(page + 1)}
|
|
155
|
-
disabled={disabled || page ===
|
|
173
|
+
disabled={disabled || page === totalPages}
|
|
156
174
|
aria-label="go to next page"
|
|
157
175
|
type="button"
|
|
158
176
|
>›</button>
|
|
@@ -162,8 +180,8 @@
|
|
|
162
180
|
<li>
|
|
163
181
|
<button
|
|
164
182
|
class="ccl-pagination__control"
|
|
165
|
-
on:click={() => goTo(
|
|
166
|
-
disabled={disabled || page ===
|
|
183
|
+
on:click={() => goTo(totalPages)}
|
|
184
|
+
disabled={disabled || page === totalPages}
|
|
167
185
|
aria-label="go to last page"
|
|
168
186
|
type="button"
|
|
169
187
|
>»</button>
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
| '--grape-purple'
|
|
8
8
|
| '--wrap-grey';
|
|
9
9
|
|
|
10
|
+
export type PrismaticBookCardSize = 'default' | 'large';
|
|
11
|
+
|
|
10
12
|
export type PrismaticBookCardProps = {
|
|
11
13
|
href?: string;
|
|
12
14
|
linkLabel?: string;
|
|
13
15
|
imageUrl?: string;
|
|
14
16
|
imageAlt?: string;
|
|
17
|
+
size?: PrismaticBookCardSize;
|
|
15
18
|
tone?: PrismaticBookCardTone;
|
|
16
19
|
};
|
|
17
20
|
</script>
|
|
@@ -24,6 +27,7 @@
|
|
|
24
27
|
export let linkLabel: string = 'READ MORE';
|
|
25
28
|
export let imageUrl: string | undefined = undefined;
|
|
26
29
|
export let imageAlt: string = '';
|
|
30
|
+
export let size: PrismaticBookCardSize = 'default';
|
|
27
31
|
export let tone: PrismaticBookCardTone = CCLVividColor.STRAWBERRY_PINK;
|
|
28
32
|
|
|
29
33
|
const gradientEndColors: Record<string, ColorVar> = {
|
|
@@ -42,7 +46,7 @@
|
|
|
42
46
|
</script>
|
|
43
47
|
|
|
44
48
|
<article
|
|
45
|
-
class="prismatic-book-card"
|
|
49
|
+
class="prismatic-book-card size-{size}"
|
|
46
50
|
style="--gradient-start: {gradientStart}; --gradient-end: {gradientEnd}; --accent-color: {accentColor};"
|
|
47
51
|
>
|
|
48
52
|
<div class="cover-slot" aria-label={imageUrl ? undefined : imageAlt || undefined}>
|
|
@@ -97,6 +101,13 @@
|
|
|
97
101
|
letter-spacing: 0;
|
|
98
102
|
}
|
|
99
103
|
|
|
104
|
+
.size-large {
|
|
105
|
+
gap: 24px;
|
|
106
|
+
width: min(100%, 370px);
|
|
107
|
+
height: 590px;
|
|
108
|
+
padding: 28px;
|
|
109
|
+
}
|
|
110
|
+
|
|
100
111
|
.cover-slot {
|
|
101
112
|
position: relative;
|
|
102
113
|
display: flex;
|
|
@@ -109,6 +120,12 @@
|
|
|
109
120
|
background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
|
|
110
121
|
}
|
|
111
122
|
|
|
123
|
+
.size-large .cover-slot {
|
|
124
|
+
height: auto;
|
|
125
|
+
aspect-ratio: 156 / 221;
|
|
126
|
+
border-radius: 22px;
|
|
127
|
+
}
|
|
128
|
+
|
|
112
129
|
.cover-image,
|
|
113
130
|
.cover-fallback {
|
|
114
131
|
display: block;
|
|
@@ -140,6 +157,11 @@
|
|
|
140
157
|
overflow-wrap: anywhere;
|
|
141
158
|
}
|
|
142
159
|
|
|
160
|
+
.size-large .link,
|
|
161
|
+
.size-large .link-label {
|
|
162
|
+
font-size: 14px;
|
|
163
|
+
}
|
|
164
|
+
|
|
143
165
|
.link-icon {
|
|
144
166
|
display: block;
|
|
145
167
|
flex: 0 0 16px;
|
|
@@ -167,6 +189,10 @@
|
|
|
167
189
|
min-height: 500px;
|
|
168
190
|
}
|
|
169
191
|
|
|
192
|
+
.size-large {
|
|
193
|
+
min-height: 590px;
|
|
194
|
+
}
|
|
195
|
+
|
|
170
196
|
.cover-slot {
|
|
171
197
|
height: auto;
|
|
172
198
|
aspect-ratio: 7 / 10;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export type PrismaticBookCardTone = '--strawberry-pink' | '--pineapple-yellow' | '--soda-blue' | '--melon-green' | '--grape-purple' | '--wrap-grey';
|
|
2
|
+
export type PrismaticBookCardSize = 'default' | 'large';
|
|
2
3
|
export type PrismaticBookCardProps = {
|
|
3
4
|
href?: string;
|
|
4
5
|
linkLabel?: string;
|
|
5
6
|
imageUrl?: string;
|
|
6
7
|
imageAlt?: string;
|
|
8
|
+
size?: PrismaticBookCardSize;
|
|
7
9
|
tone?: PrismaticBookCardTone;
|
|
8
10
|
};
|
|
9
11
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
@@ -24,6 +26,7 @@ declare const PrismaticBookCard: $$__sveltets_2_IsomorphicComponent<{
|
|
|
24
26
|
linkLabel?: string;
|
|
25
27
|
imageUrl?: string | undefined;
|
|
26
28
|
imageAlt?: string;
|
|
29
|
+
size?: PrismaticBookCardSize;
|
|
27
30
|
tone?: PrismaticBookCardTone;
|
|
28
31
|
}, {
|
|
29
32
|
[evt: string]: CustomEvent<any>;
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
href: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
export type PrismaticSiteFooterDensity = 'default' | 'compact' | 'studio';
|
|
16
|
+
|
|
15
17
|
export type PrismaticSiteFooterProps = {
|
|
16
18
|
brand?: string;
|
|
17
19
|
brandHref?: string;
|
|
@@ -21,6 +23,9 @@
|
|
|
21
23
|
links?: PrismaticSiteFooterLink[];
|
|
22
24
|
copyright?: string;
|
|
23
25
|
ariaLabel?: string;
|
|
26
|
+
density?: PrismaticSiteFooterDensity;
|
|
27
|
+
studioGradientStart?: PrismaticSiteFooterTone;
|
|
28
|
+
studioGradientLast?: PrismaticSiteFooterTone;
|
|
24
29
|
tone?: PrismaticSiteFooterTone;
|
|
25
30
|
};
|
|
26
31
|
</script>
|
|
@@ -34,6 +39,20 @@
|
|
|
34
39
|
];
|
|
35
40
|
|
|
36
41
|
const year = new Date().getFullYear();
|
|
42
|
+
const darkTextTones: PrismaticSiteFooterTone[] = [
|
|
43
|
+
CCLVividColor.STRAWBERRY_PINK,
|
|
44
|
+
CCLVividColor.PINEAPPLE_YELLOW,
|
|
45
|
+
CCLVividColor.SODA_BLUE,
|
|
46
|
+
CCLVividColor.MELON_GREEN
|
|
47
|
+
];
|
|
48
|
+
const darkTextColor =
|
|
49
|
+
'color-mix(in srgb, var(--palette-grape-900) 70%, black)';
|
|
50
|
+
|
|
51
|
+
function getTextColor(tone: PrismaticSiteFooterTone | undefined): string {
|
|
52
|
+
return tone && darkTextTones.includes(tone)
|
|
53
|
+
? darkTextColor
|
|
54
|
+
: 'var(--color-surface-glass)';
|
|
55
|
+
}
|
|
37
56
|
|
|
38
57
|
export let brand: string = 'CANDY CHUPS Lab.';
|
|
39
58
|
export let brandHref: string | undefined = undefined;
|
|
@@ -43,6 +62,9 @@
|
|
|
43
62
|
export let links: PrismaticSiteFooterLink[] = defaultLinks;
|
|
44
63
|
export let copyright: string = `Copyright © ${year} CANDY CHUPS Lab. All Rights Reserved.`;
|
|
45
64
|
export let ariaLabel: string = 'フッターナビゲーション';
|
|
65
|
+
export let density: PrismaticSiteFooterDensity = 'default';
|
|
66
|
+
export let studioGradientStart: PrismaticSiteFooterTone | undefined = undefined;
|
|
67
|
+
export let studioGradientLast: PrismaticSiteFooterTone | undefined = undefined;
|
|
46
68
|
export let tone: PrismaticSiteFooterTone = CCLVividColor.STRAWBERRY_PINK;
|
|
47
69
|
|
|
48
70
|
function toCssUrl(value: string): string {
|
|
@@ -58,11 +80,21 @@
|
|
|
58
80
|
}
|
|
59
81
|
|
|
60
82
|
$: accentColor = `var(${tone})`;
|
|
83
|
+
$: studioGradientStartColor = studioGradientStart
|
|
84
|
+
? `var(${studioGradientStart})`
|
|
85
|
+
: 'var(--palette-grape-900)';
|
|
86
|
+
$: startTextColor = getTextColor(studioGradientStart);
|
|
87
|
+
$: lastTone = studioGradientLast ?? tone;
|
|
88
|
+
$: studioGradientLastColor = `var(${lastTone})`;
|
|
89
|
+
$: lastTextColor = getTextColor(lastTone);
|
|
61
90
|
$: logoImage = logoUrl ? toCssUrl(logoUrl) : 'none';
|
|
62
91
|
$: logoLabel = logoAlt?.trim() || brand;
|
|
63
92
|
</script>
|
|
64
93
|
|
|
65
|
-
<footer
|
|
94
|
+
<footer
|
|
95
|
+
class="prismatic-site-footer density-{density}"
|
|
96
|
+
style="--accent-color: {accentColor}; --studio-gradient-start: {studioGradientStartColor}; --studio-gradient-last: {studioGradientLastColor}; --footer-start-text-color: {startTextColor}; --footer-last-text-color: {lastTextColor};"
|
|
97
|
+
>
|
|
66
98
|
<div class="footer-main">
|
|
67
99
|
{#if brandHref}
|
|
68
100
|
<a class="brand" href={brandHref}>
|
|
@@ -110,29 +142,45 @@
|
|
|
110
142
|
|
|
111
143
|
<style>
|
|
112
144
|
.prismatic-site-footer {
|
|
145
|
+
--footer-gap: 32px;
|
|
146
|
+
--footer-min-height: 180px;
|
|
147
|
+
--footer-padding: 40px 48px 32px;
|
|
148
|
+
|
|
113
149
|
display: flex;
|
|
114
150
|
flex-direction: column;
|
|
115
151
|
justify-content: space-between;
|
|
116
|
-
gap:
|
|
152
|
+
gap: var(--footer-gap);
|
|
117
153
|
width: min(100%, 1300px);
|
|
118
|
-
min-height:
|
|
154
|
+
min-height: var(--footer-min-height);
|
|
119
155
|
box-sizing: border-box;
|
|
120
|
-
padding:
|
|
121
|
-
border: 1.5px solid color-mix(in srgb, var(--accent-color)
|
|
156
|
+
padding: var(--footer-padding);
|
|
157
|
+
border: 1.5px solid color-mix(in srgb, var(--accent-color) 64%, var(--palette-grape-900));
|
|
122
158
|
border-radius: 34px;
|
|
123
159
|
background: linear-gradient(
|
|
124
160
|
112deg,
|
|
125
|
-
|
|
126
|
-
color-mix(in srgb, var(--
|
|
127
|
-
|
|
161
|
+
var(--studio-gradient-start) 0%,
|
|
162
|
+
color-mix(in srgb, var(--studio-gradient-start) 68%, var(--studio-gradient-last)) 54%,
|
|
163
|
+
var(--studio-gradient-last) 100%
|
|
128
164
|
);
|
|
129
165
|
box-shadow: 0 16px 20px color-mix(in srgb, var(--palette-grape-900) 18%, transparent);
|
|
130
|
-
color: var(--
|
|
166
|
+
color: var(--footer-start-text-color);
|
|
131
167
|
font-family: Inter, sans-serif;
|
|
132
168
|
line-height: normal;
|
|
133
169
|
letter-spacing: 0;
|
|
134
170
|
}
|
|
135
171
|
|
|
172
|
+
.density-compact {
|
|
173
|
+
--footer-gap: 20px;
|
|
174
|
+
--footer-min-height: 132px;
|
|
175
|
+
--footer-padding: 28px 36px 24px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.density-studio {
|
|
179
|
+
--footer-gap: 40px;
|
|
180
|
+
--footer-min-height: 240px;
|
|
181
|
+
--footer-padding: 52px 56px 40px;
|
|
182
|
+
}
|
|
183
|
+
|
|
136
184
|
.footer-main {
|
|
137
185
|
display: flex;
|
|
138
186
|
align-items: flex-start;
|
|
@@ -154,12 +202,13 @@
|
|
|
154
202
|
display: block;
|
|
155
203
|
width: min(300px, 48vw);
|
|
156
204
|
height: var(--logo-height);
|
|
157
|
-
background:
|
|
205
|
+
background: currentColor;
|
|
158
206
|
-webkit-mask: var(--logo-image) left center / contain no-repeat;
|
|
159
207
|
mask: var(--logo-image) left center / contain no-repeat;
|
|
160
208
|
}
|
|
161
209
|
|
|
162
210
|
nav {
|
|
211
|
+
color: var(--footer-last-text-color);
|
|
163
212
|
min-width: 0;
|
|
164
213
|
}
|
|
165
214
|
|
|
@@ -198,17 +247,34 @@
|
|
|
198
247
|
|
|
199
248
|
@media (max-width: 640px) {
|
|
200
249
|
.prismatic-site-footer {
|
|
201
|
-
gap: 28px;
|
|
202
|
-
min-height: 220px;
|
|
203
|
-
padding: 32px 28px 28px;
|
|
250
|
+
--footer-gap: 28px;
|
|
251
|
+
--footer-min-height: 220px;
|
|
252
|
+
--footer-padding: 32px 28px 28px;
|
|
253
|
+
|
|
204
254
|
border-radius: 28px;
|
|
205
255
|
}
|
|
206
256
|
|
|
257
|
+
.density-compact {
|
|
258
|
+
--footer-gap: 20px;
|
|
259
|
+
--footer-min-height: 132px;
|
|
260
|
+
--footer-padding: 28px 28px 24px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.density-studio {
|
|
264
|
+
--footer-gap: 40px;
|
|
265
|
+
--footer-min-height: 240px;
|
|
266
|
+
--footer-padding: 52px 28px 40px;
|
|
267
|
+
}
|
|
268
|
+
|
|
207
269
|
.footer-main {
|
|
208
270
|
flex-direction: column;
|
|
209
271
|
gap: 24px;
|
|
210
272
|
}
|
|
211
273
|
|
|
274
|
+
nav {
|
|
275
|
+
color: var(--footer-start-text-color);
|
|
276
|
+
}
|
|
277
|
+
|
|
212
278
|
ul {
|
|
213
279
|
justify-content: flex-start;
|
|
214
280
|
}
|
|
@@ -3,6 +3,7 @@ export type PrismaticSiteFooterLink = {
|
|
|
3
3
|
label: string;
|
|
4
4
|
href: string;
|
|
5
5
|
};
|
|
6
|
+
export type PrismaticSiteFooterDensity = 'default' | 'compact' | 'studio';
|
|
6
7
|
export type PrismaticSiteFooterProps = {
|
|
7
8
|
brand?: string;
|
|
8
9
|
brandHref?: string;
|
|
@@ -12,6 +13,9 @@ export type PrismaticSiteFooterProps = {
|
|
|
12
13
|
links?: PrismaticSiteFooterLink[];
|
|
13
14
|
copyright?: string;
|
|
14
15
|
ariaLabel?: string;
|
|
16
|
+
density?: PrismaticSiteFooterDensity;
|
|
17
|
+
studioGradientStart?: PrismaticSiteFooterTone;
|
|
18
|
+
studioGradientLast?: PrismaticSiteFooterTone;
|
|
15
19
|
tone?: PrismaticSiteFooterTone;
|
|
16
20
|
};
|
|
17
21
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
@@ -36,6 +40,9 @@ declare const PrismaticSiteFooter: $$__sveltets_2_IsomorphicComponent<{
|
|
|
36
40
|
links?: PrismaticSiteFooterLink[];
|
|
37
41
|
copyright?: string;
|
|
38
42
|
ariaLabel?: string;
|
|
43
|
+
density?: PrismaticSiteFooterDensity;
|
|
44
|
+
studioGradientStart?: PrismaticSiteFooterTone | undefined;
|
|
45
|
+
studioGradientLast?: PrismaticSiteFooterTone | undefined;
|
|
39
46
|
tone?: PrismaticSiteFooterTone;
|
|
40
47
|
}, {
|
|
41
48
|
[evt: string]: CustomEvent<any>;
|
|
@@ -13,12 +13,18 @@
|
|
|
13
13
|
active?: boolean;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
export type PrismaticSiteHeaderLogoFit = 'contain' | 'cover';
|
|
17
|
+
|
|
16
18
|
export type PrismaticSiteHeaderProps = {
|
|
17
19
|
brand?: string;
|
|
18
20
|
brandHref?: string;
|
|
19
21
|
logoUrl?: string;
|
|
20
22
|
logoAlt?: string;
|
|
21
23
|
logoHeight?: string;
|
|
24
|
+
logoWidth?: string;
|
|
25
|
+
logoFit?: PrismaticSiteHeaderLogoFit;
|
|
26
|
+
padding?: string;
|
|
27
|
+
minHeight?: string;
|
|
22
28
|
navigation?: PrismaticSiteHeaderItem[];
|
|
23
29
|
ariaLabel?: string;
|
|
24
30
|
tone?: PrismaticSiteHeaderTone;
|
|
@@ -41,6 +47,10 @@
|
|
|
41
47
|
export let logoUrl: string | undefined = undefined;
|
|
42
48
|
export let logoAlt: string | undefined = undefined;
|
|
43
49
|
export let logoHeight: string = '40px';
|
|
50
|
+
export let logoWidth: string = 'min(260px, 40vw)';
|
|
51
|
+
export let logoFit: PrismaticSiteHeaderLogoFit = 'contain';
|
|
52
|
+
export let padding: string | undefined = undefined;
|
|
53
|
+
export let minHeight: string | undefined = undefined;
|
|
44
54
|
export let navigation: PrismaticSiteHeaderItem[] = defaultNavigation;
|
|
45
55
|
export let ariaLabel: string = 'メインナビゲーション';
|
|
46
56
|
export let tone: PrismaticSiteHeaderTone = CCLVividColor.STRAWBERRY_PINK;
|
|
@@ -60,11 +70,18 @@
|
|
|
60
70
|
}
|
|
61
71
|
|
|
62
72
|
$: accentColor = `var(${tone})`;
|
|
73
|
+
$: headerPadding = padding ?? '24px 35px';
|
|
74
|
+
$: headerMobilePadding = padding ?? '22px 28px';
|
|
75
|
+
$: headerSmallPadding = padding ?? '20px 22px';
|
|
76
|
+
$: headerMinHeight = minHeight ?? '104px';
|
|
63
77
|
$: logoImage = logoUrl ? toCssUrl(logoUrl) : 'none';
|
|
64
78
|
$: logoLabel = logoAlt?.trim() || brand;
|
|
65
79
|
</script>
|
|
66
80
|
|
|
67
|
-
<header
|
|
81
|
+
<header
|
|
82
|
+
class="prismatic-site-header"
|
|
83
|
+
style="--accent-color: {accentColor}; --header-padding: {headerPadding}; --header-mobile-padding: {headerMobilePadding}; --header-small-padding: {headerSmallPadding}; --header-min-height: {headerMinHeight};"
|
|
84
|
+
>
|
|
68
85
|
{#if brandHref}
|
|
69
86
|
<svelte:element this={brandLinkElement} class="brand" href={brandHref}>
|
|
70
87
|
{#if logoUrl}
|
|
@@ -73,10 +90,10 @@
|
|
|
73
90
|
role="img"
|
|
74
91
|
aria-label={logoLabel}
|
|
75
92
|
data-logo-url={logoUrl}
|
|
76
|
-
style="--logo-height: {logoHeight}; --logo-image: {logoImage};"
|
|
93
|
+
style="--logo-height: {logoHeight}; --logo-width: {logoWidth}; --logo-fit: {logoFit}; --logo-image: {logoImage};"
|
|
77
94
|
></span>
|
|
78
95
|
{:else}
|
|
79
|
-
{brand}
|
|
96
|
+
<slot name="logo">{brand}</slot>
|
|
80
97
|
{/if}
|
|
81
98
|
</svelte:element>
|
|
82
99
|
{:else}
|
|
@@ -87,10 +104,10 @@
|
|
|
87
104
|
role="img"
|
|
88
105
|
aria-label={logoLabel}
|
|
89
106
|
data-logo-url={logoUrl}
|
|
90
|
-
style="--logo-height: {logoHeight}; --logo-image: {logoImage};"
|
|
107
|
+
style="--logo-height: {logoHeight}; --logo-width: {logoWidth}; --logo-fit: {logoFit}; --logo-image: {logoImage};"
|
|
91
108
|
></span>
|
|
92
109
|
{:else}
|
|
93
|
-
{brand}
|
|
110
|
+
<slot name="logo">{brand}</slot>
|
|
94
111
|
{/if}
|
|
95
112
|
</span>
|
|
96
113
|
{/if}
|
|
@@ -119,9 +136,9 @@
|
|
|
119
136
|
justify-content: space-between;
|
|
120
137
|
gap: 32px;
|
|
121
138
|
width: min(100%, 1300px);
|
|
122
|
-
min-height:
|
|
139
|
+
min-height: var(--header-min-height);
|
|
123
140
|
box-sizing: border-box;
|
|
124
|
-
padding:
|
|
141
|
+
padding: var(--header-padding);
|
|
125
142
|
border: 1.5px solid color-mix(in srgb, var(--accent-color) 42%, transparent);
|
|
126
143
|
border-radius: 34px;
|
|
127
144
|
background: color-mix(in srgb, var(--color-surface-glass) 78%, transparent);
|
|
@@ -144,12 +161,12 @@
|
|
|
144
161
|
|
|
145
162
|
.brand-logo {
|
|
146
163
|
display: block;
|
|
147
|
-
width:
|
|
148
|
-
max-width: min(
|
|
164
|
+
width: var(--logo-width);
|
|
165
|
+
max-width: min(100%, 48vw);
|
|
149
166
|
height: var(--logo-height);
|
|
150
167
|
background: var(--accent-color);
|
|
151
|
-
-webkit-mask: var(--logo-image) left center /
|
|
152
|
-
mask: var(--logo-image) left center /
|
|
168
|
+
-webkit-mask: var(--logo-image) left center / var(--logo-fit) no-repeat;
|
|
169
|
+
mask: var(--logo-image) left center / var(--logo-fit) no-repeat;
|
|
153
170
|
}
|
|
154
171
|
|
|
155
172
|
nav {
|
|
@@ -209,8 +226,8 @@
|
|
|
209
226
|
flex-direction: column;
|
|
210
227
|
align-items: flex-start;
|
|
211
228
|
gap: 12px;
|
|
212
|
-
min-height:
|
|
213
|
-
padding:
|
|
229
|
+
min-height: var(--header-min-height);
|
|
230
|
+
padding: var(--header-mobile-padding);
|
|
214
231
|
}
|
|
215
232
|
|
|
216
233
|
nav {
|
|
@@ -228,7 +245,7 @@
|
|
|
228
245
|
|
|
229
246
|
@media (max-width: 480px) {
|
|
230
247
|
.prismatic-site-header {
|
|
231
|
-
padding:
|
|
248
|
+
padding: var(--header-small-padding);
|
|
232
249
|
border-radius: 28px;
|
|
233
250
|
}
|
|
234
251
|
|
|
@@ -4,12 +4,17 @@ export type PrismaticSiteHeaderItem = {
|
|
|
4
4
|
href: string;
|
|
5
5
|
active?: boolean;
|
|
6
6
|
};
|
|
7
|
+
export type PrismaticSiteHeaderLogoFit = 'contain' | 'cover';
|
|
7
8
|
export type PrismaticSiteHeaderProps = {
|
|
8
9
|
brand?: string;
|
|
9
10
|
brandHref?: string;
|
|
10
11
|
logoUrl?: string;
|
|
11
12
|
logoAlt?: string;
|
|
12
13
|
logoHeight?: string;
|
|
14
|
+
logoWidth?: string;
|
|
15
|
+
logoFit?: PrismaticSiteHeaderLogoFit;
|
|
16
|
+
padding?: string;
|
|
17
|
+
minHeight?: string;
|
|
13
18
|
navigation?: PrismaticSiteHeaderItem[];
|
|
14
19
|
ariaLabel?: string;
|
|
15
20
|
tone?: PrismaticSiteHeaderTone;
|
|
@@ -33,11 +38,17 @@ declare const PrismaticSiteHeader: $$__sveltets_2_IsomorphicComponent<{
|
|
|
33
38
|
logoUrl?: string | undefined;
|
|
34
39
|
logoAlt?: string | undefined;
|
|
35
40
|
logoHeight?: string;
|
|
41
|
+
logoWidth?: string;
|
|
42
|
+
logoFit?: PrismaticSiteHeaderLogoFit;
|
|
43
|
+
padding?: string | undefined;
|
|
44
|
+
minHeight?: string | undefined;
|
|
36
45
|
navigation?: PrismaticSiteHeaderItem[];
|
|
37
46
|
ariaLabel?: string;
|
|
38
47
|
tone?: PrismaticSiteHeaderTone;
|
|
39
48
|
}, {
|
|
40
49
|
[evt: string]: CustomEvent<any>;
|
|
41
|
-
}, {
|
|
50
|
+
}, {
|
|
51
|
+
logo: {};
|
|
52
|
+
}, {}, string>;
|
|
42
53
|
type PrismaticSiteHeader = InstanceType<typeof PrismaticSiteHeader>;
|
|
43
54
|
export default PrismaticSiteHeader;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
label?: string;
|
|
14
14
|
href?: string;
|
|
15
15
|
linkLabel?: string;
|
|
16
|
+
showLink?: boolean;
|
|
16
17
|
imageUrl?: string;
|
|
17
18
|
imageAlt?: string;
|
|
18
19
|
squareImage?: boolean;
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
export let label: string | undefined = undefined;
|
|
35
36
|
export let href: string | undefined = undefined;
|
|
36
37
|
export let linkLabel: string = 'Read more';
|
|
38
|
+
export let showLink: boolean = true;
|
|
37
39
|
export let imageUrl: string | undefined = undefined;
|
|
38
40
|
export let imageAlt: string = '';
|
|
39
41
|
export let squareImage: boolean = false;
|
|
@@ -101,7 +103,7 @@
|
|
|
101
103
|
|
|
102
104
|
<h3 class="title">{title}</h3>
|
|
103
105
|
|
|
104
|
-
{#if href}
|
|
106
|
+
{#if href && showLink}
|
|
105
107
|
<svelte:element
|
|
106
108
|
this={linkElement}
|
|
107
109
|
class="link"
|
|
@@ -5,6 +5,7 @@ export type PrismaticStoryCardProps = {
|
|
|
5
5
|
label?: string;
|
|
6
6
|
href?: string;
|
|
7
7
|
linkLabel?: string;
|
|
8
|
+
showLink?: boolean;
|
|
8
9
|
imageUrl?: string;
|
|
9
10
|
imageAlt?: string;
|
|
10
11
|
squareImage?: boolean;
|
|
@@ -29,6 +30,7 @@ declare const PrismaticStoryCard: $$__sveltets_2_IsomorphicComponent<{
|
|
|
29
30
|
label?: string | undefined;
|
|
30
31
|
href?: string | undefined;
|
|
31
32
|
linkLabel?: string;
|
|
33
|
+
showLink?: boolean;
|
|
32
34
|
imageUrl?: string | undefined;
|
|
33
35
|
imageAlt?: string;
|
|
34
36
|
squareImage?: boolean;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
export type PrismaticWorkCardProps = {
|
|
11
11
|
title?: string;
|
|
12
|
+
description?: string;
|
|
12
13
|
href?: string;
|
|
13
14
|
linkLabel?: string;
|
|
14
15
|
imageUrl?: string;
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
import type { ColorVar } from './const/config';
|
|
23
24
|
|
|
24
25
|
export let title: string = 'CCL Component Kit';
|
|
26
|
+
export let description: string | undefined = undefined;
|
|
25
27
|
export let href: string | undefined = undefined;
|
|
26
28
|
export let linkLabel: string = 'VIEW PROJECT';
|
|
27
29
|
export let imageUrl: string | undefined = undefined;
|
|
@@ -57,7 +59,13 @@
|
|
|
57
59
|
</div>
|
|
58
60
|
|
|
59
61
|
<div class="body">
|
|
60
|
-
<
|
|
62
|
+
<div class="copy">
|
|
63
|
+
<h3 class="title">{title}</h3>
|
|
64
|
+
|
|
65
|
+
{#if description}
|
|
66
|
+
<p class="description">{description}</p>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
61
69
|
|
|
62
70
|
{#if href}
|
|
63
71
|
<svelte:element
|
|
@@ -140,6 +148,14 @@
|
|
|
140
148
|
min-width: 0;
|
|
141
149
|
}
|
|
142
150
|
|
|
151
|
+
.copy {
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: column;
|
|
154
|
+
gap: 12px;
|
|
155
|
+
max-width: 100%;
|
|
156
|
+
min-width: 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
143
159
|
.title {
|
|
144
160
|
margin: 0;
|
|
145
161
|
max-width: 100%;
|
|
@@ -151,6 +167,17 @@
|
|
|
151
167
|
word-break: normal;
|
|
152
168
|
}
|
|
153
169
|
|
|
170
|
+
.description {
|
|
171
|
+
margin: 0;
|
|
172
|
+
max-width: 100%;
|
|
173
|
+
color: color-mix(in srgb, var(--palette-grape-900) 34%, var(--palette-wrap-800));
|
|
174
|
+
font-size: 14px;
|
|
175
|
+
font-weight: 500;
|
|
176
|
+
line-height: 1.75;
|
|
177
|
+
overflow-wrap: anywhere;
|
|
178
|
+
word-break: normal;
|
|
179
|
+
}
|
|
180
|
+
|
|
154
181
|
.link,
|
|
155
182
|
.link-label {
|
|
156
183
|
display: inline-flex;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type PrismaticWorkCardTone = '--strawberry-pink' | '--pineapple-yellow' | '--soda-blue' | '--melon-green' | '--grape-purple' | '--wrap-grey';
|
|
2
2
|
export type PrismaticWorkCardProps = {
|
|
3
3
|
title?: string;
|
|
4
|
+
description?: string;
|
|
4
5
|
href?: string;
|
|
5
6
|
linkLabel?: string;
|
|
6
7
|
imageUrl?: string;
|
|
@@ -22,6 +23,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
22
23
|
}
|
|
23
24
|
declare const PrismaticWorkCard: $$__sveltets_2_IsomorphicComponent<{
|
|
24
25
|
title?: string;
|
|
26
|
+
description?: string | undefined;
|
|
25
27
|
href?: string | undefined;
|
|
26
28
|
linkLabel?: string;
|
|
27
29
|
imageUrl?: string | undefined;
|