cclkit4svelte 3.1.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 +6 -1
- package/dist/BookCard.svelte +7 -2
- package/dist/Carousel.svelte +3 -3
- package/dist/ChangeHistory.svelte +14 -9
- package/dist/ChangeHistory.svelte.d.ts +11 -0
- package/dist/DatePicker.svelte +7 -2
- package/dist/Dialog.svelte.d.ts +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/dist/Select.svelte +5 -3
- package/dist/Select.svelte.d.ts +8 -4
- package/dist/TabPanel.svelte +2 -1
- package/dist/Tabs.svelte +3 -2
- package/dist/const/colorMap.js +8 -9
- package/dist/const/config.js +8 -17
- package/dist/scripts/accordionContext.d.ts +1 -1
- package/dist/scripts/accordionContext.js +1 -1
- package/dist/scripts/date.js +1 -1
- package/dist/scripts/tabsContext.d.ts +11 -1
- package/dist/scripts/tabsContext.js +1 -1
- package/dist/toast.js +23 -37
- package/package.json +3 -2
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
|
|
|
@@ -10,6 +10,11 @@ CANDY CHUPS Labのサイトで使うコンポーネントのキットです。
|
|
|
10
10
|
|
|
11
11
|
このライブラリの開発を行うにはSvelteの導入が必要です。
|
|
12
12
|
|
|
13
|
+
## Svelte互換性
|
|
14
|
+
|
|
15
|
+
`cclkit4svelte` 4.x はSvelte 5専用です。Svelte 4はサポート対象外です。
|
|
16
|
+
実装方針と段階的な移行ルールは[docs/SVELTE_5_MIGRATION.md](docs/SVELTE_5_MIGRATION.md)を参照してください。
|
|
17
|
+
|
|
13
18
|
## Figma
|
|
14
19
|
|
|
15
20
|
[Figma](https://www.figma.com/file/RWLq3IaUeF0soEH666sXQC/Common-Component?type=design&node-id=0%3A1&mode=design&t=ESVNyUtQevAFIe3o-1)
|
package/dist/BookCard.svelte
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Button from './Button.svelte';
|
|
3
|
+
import { CCLVividColor } from './const/config';
|
|
4
|
+
import type { ColorVar } from './const/config';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* 書籍のタイトル
|
|
@@ -43,7 +45,10 @@
|
|
|
43
45
|
* @default --strawberry-pink
|
|
44
46
|
* @type string
|
|
45
47
|
*/
|
|
46
|
-
export let borderColor: string =
|
|
48
|
+
export let borderColor: string = CCLVividColor.STRAWBERRY_PINK;
|
|
49
|
+
let buttonColor: ColorVar;
|
|
50
|
+
// Preserve support for consumer-defined CSS custom properties at the public boundary.
|
|
51
|
+
$: buttonColor = borderColor as ColorVar;
|
|
47
52
|
|
|
48
53
|
function handleLinkClick() {
|
|
49
54
|
if (linkUrl) {
|
|
@@ -63,7 +68,7 @@
|
|
|
63
68
|
</div>
|
|
64
69
|
{#if linkUrl}
|
|
65
70
|
<div class="BookCardLinkWrapper">
|
|
66
|
-
<Button label={linkText} bgColor={
|
|
71
|
+
<Button label={linkText} bgColor={buttonColor} onClick={handleLinkClick} />
|
|
67
72
|
</div>
|
|
68
73
|
{/if}
|
|
69
74
|
</div>
|
package/dist/Carousel.svelte
CHANGED
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
>
|
|
45
45
|
<div class="slides">
|
|
46
46
|
{#each src as item, index}
|
|
47
|
-
<img class="slide" src={item.src} alt={item.alt} />
|
|
47
|
+
<img class="slide" src={item.src} alt={item.alt} aria-hidden={index !== currentIndex} />
|
|
48
48
|
{/each}
|
|
49
49
|
</div>
|
|
50
50
|
<div class="buttons">
|
|
51
|
-
<button on:click={prevSlide}>❮</button>
|
|
52
|
-
<button on:click={nextSlide}>❯</button>
|
|
51
|
+
<button type="button" aria-label="前のスライドへ" on:click={prevSlide}>❮</button>
|
|
52
|
+
<button type="button" aria-label="次のスライドへ" on:click={nextSlide}>❯</button>
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
55
|
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* 更新履歴の表示項目
|
|
4
|
+
*/
|
|
5
|
+
export interface HistoryItem {
|
|
6
|
+
date: string;
|
|
7
|
+
title: string;
|
|
8
|
+
tag?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
details?: string[];
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
1
15
|
<script lang="ts">
|
|
2
16
|
import { CCLVividColor, CCLPastelColor } from './const/config';
|
|
3
17
|
|
|
@@ -10,15 +24,6 @@
|
|
|
10
24
|
* @property {string} [version] - バージョン番号 (例: "v1.1.0")。省略可能
|
|
11
25
|
* @property {string[]} [details] - 更新内容の詳細なリスト。省略可能
|
|
12
26
|
*/
|
|
13
|
-
export interface HistoryItem {
|
|
14
|
-
date: string;
|
|
15
|
-
title: string;
|
|
16
|
-
tag?: string;
|
|
17
|
-
color?: string;
|
|
18
|
-
version?: string;
|
|
19
|
-
details?: string[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
27
|
/**
|
|
23
28
|
* 表示する更新履歴の配列
|
|
24
29
|
* @type {HistoryItem[]}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 更新履歴の表示項目
|
|
3
|
+
*/
|
|
4
|
+
export interface HistoryItem {
|
|
5
|
+
date: string;
|
|
6
|
+
title: string;
|
|
7
|
+
tag?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
version?: string;
|
|
10
|
+
details?: string[];
|
|
11
|
+
}
|
|
1
12
|
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> {
|
|
2
13
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
14
|
$$bindings?: Bindings;
|
package/dist/DatePicker.svelte
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { createEventDispatcher } from 'svelte';
|
|
3
|
+
import type { Action } from 'svelte/action';
|
|
3
4
|
import { DateTime } from 'luxon';
|
|
4
5
|
|
|
5
6
|
const dispatch = createEventDispatcher();
|
|
@@ -89,7 +90,11 @@
|
|
|
89
90
|
* Svelte Action to detect clicks outside an element.
|
|
90
91
|
* @param {HTMLElement} node
|
|
91
92
|
*/
|
|
92
|
-
|
|
93
|
+
const clickOutside: Action<
|
|
94
|
+
HTMLElement,
|
|
95
|
+
undefined,
|
|
96
|
+
{ 'on:click_outside': (event: CustomEvent<void>) => void }
|
|
97
|
+
> = (node) => {
|
|
93
98
|
const handleClick = (event: MouseEvent) => {
|
|
94
99
|
if (node && !node.contains(event.target as Node) && !event.defaultPrevented) {
|
|
95
100
|
// 'click_outside' というカスタムイベントを発行
|
|
@@ -104,7 +109,7 @@
|
|
|
104
109
|
document.removeEventListener('click', handleClick, true);
|
|
105
110
|
}
|
|
106
111
|
};
|
|
107
|
-
}
|
|
112
|
+
};
|
|
108
113
|
|
|
109
114
|
$: daysInMonth = getDaysInMonth(currentMonth);
|
|
110
115
|
</script>
|
package/dist/Dialog.svelte.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare const Dialog: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWit
|
|
|
31
31
|
*/ closeOnOutside?: boolean;
|
|
32
32
|
/**
|
|
33
33
|
* アクセント色(境界線やタイトルに使用)
|
|
34
|
-
*/ borderColor?:
|
|
34
|
+
*/ borderColor?: "--strawberry-pink" | "--pineapple-yellow" | "--soda-blue" | "--melon-green" | "--grape-purple" | "--wrap-grey";
|
|
35
35
|
}, {
|
|
36
36
|
title: {};
|
|
37
37
|
default: {};
|
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;
|
package/dist/Select.svelte
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { CCLVividColor } from './const/config';
|
|
3
|
-
|
|
1
|
+
<script context="module" lang="ts">
|
|
4
2
|
/**
|
|
5
3
|
* オプションの型定義
|
|
6
4
|
*/
|
|
7
5
|
export type SelectOption = { value: string; label: string };
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { CCLVividColor } from './const/config';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* ラベルのテキスト
|
package/dist/Select.svelte.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* オプションの型定義
|
|
3
|
+
*/
|
|
4
|
+
export type SelectOption = {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
1
8
|
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> {
|
|
2
9
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
10
|
$$bindings?: Bindings;
|
|
@@ -20,10 +27,7 @@ declare const Select: $$__sveltets_2_IsomorphicComponent<{
|
|
|
20
27
|
/**
|
|
21
28
|
* 選択肢のリスト
|
|
22
29
|
* @type SelectOption[]
|
|
23
|
-
*/ options?:
|
|
24
|
-
value: string;
|
|
25
|
-
label: string;
|
|
26
|
-
}[];
|
|
30
|
+
*/ options?: SelectOption[];
|
|
27
31
|
/**
|
|
28
32
|
* 選択された値
|
|
29
33
|
* @default ''
|
package/dist/TabPanel.svelte
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
export let disabled: boolean = false;
|
|
23
23
|
|
|
24
24
|
import { TABS_CONTEXT_KEY } from './scripts/tabsContext';
|
|
25
|
-
|
|
25
|
+
import type { TabsContext } from './scripts/tabsContext';
|
|
26
|
+
const { addTab, activeTabLabel } = getContext<TabsContext>(TABS_CONTEXT_KEY);
|
|
26
27
|
|
|
27
28
|
onMount(() => {
|
|
28
29
|
addTab({ label, color, disabled });
|
package/dist/Tabs.svelte
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
import { writable } from 'svelte/store';
|
|
4
4
|
|
|
5
5
|
import { TABS_CONTEXT_KEY } from './scripts/tabsContext';
|
|
6
|
+
import type { TabData, TabsContext } from './scripts/tabsContext';
|
|
6
7
|
|
|
7
|
-
const tabData = writable([]);
|
|
8
|
+
const tabData = writable<TabData[]>([]);
|
|
8
9
|
const activeTabLabel = writable('');
|
|
9
10
|
|
|
10
|
-
setContext(TABS_CONTEXT_KEY, {
|
|
11
|
+
setContext<TabsContext>(TABS_CONTEXT_KEY, {
|
|
11
12
|
addTab: (tab) => {
|
|
12
13
|
tabData.update((currentTabs) => {
|
|
13
14
|
const newTabs = [...currentTabs, tab];
|
package/dist/const/colorMap.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
var _a;
|
|
2
1
|
import { CCLPastelColor, CCLVividColor } from './config';
|
|
3
2
|
// Pastel -> Vivid CSS variable mapping
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
export const pastelToVividMap = {
|
|
4
|
+
[CCLPastelColor.PEACH_PINK]: CCLVividColor.STRAWBERRY_PINK,
|
|
5
|
+
[CCLPastelColor.LEMON_YELLOW]: CCLVividColor.PINEAPPLE_YELLOW,
|
|
6
|
+
[CCLPastelColor.SUGAR_BLUE]: CCLVividColor.SODA_BLUE,
|
|
7
|
+
[CCLPastelColor.MATCHA_GREEN]: CCLVividColor.MELON_GREEN,
|
|
8
|
+
[CCLPastelColor.AKEBI_PURPLE]: CCLVividColor.GRAPE_PURPLE,
|
|
9
|
+
[CCLPastelColor.CLOUD_GREY]: CCLVividColor.WRAP_GREY
|
|
10
|
+
};
|
|
12
11
|
/** Returns the vivid counterpart for a given color var if it's pastel; otherwise undefined. */
|
|
13
12
|
export function vividFor(colorVar) {
|
|
14
13
|
if (!colorVar)
|
package/dist/const/config.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var CCLVividColor = {
|
|
1
|
+
const CCLVividColor = {
|
|
13
2
|
STRAWBERRY_PINK: '--strawberry-pink',
|
|
14
3
|
PINEAPPLE_YELLOW: '--pineapple-yellow',
|
|
15
4
|
SODA_BLUE: '--soda-blue',
|
|
@@ -17,7 +6,7 @@ var CCLVividColor = {
|
|
|
17
6
|
GRAPE_PURPLE: '--grape-purple',
|
|
18
7
|
WRAP_GREY: '--wrap-grey'
|
|
19
8
|
};
|
|
20
|
-
|
|
9
|
+
const CCLPastelColorBase = {
|
|
21
10
|
PEACH_PINK: '--peach-pink',
|
|
22
11
|
LEMON_YELLOW: '--lemon-yellow',
|
|
23
12
|
SUGAR_BLUE: '--sugar-blue',
|
|
@@ -25,8 +14,10 @@ var CCLPastelColorBase = {
|
|
|
25
14
|
AKEBI_PURPLE: '--akebi-purple',
|
|
26
15
|
CLOUD_GREY: '--cloud-grey'
|
|
27
16
|
};
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
const CCLPastelColor = {
|
|
18
|
+
...CCLPastelColorBase
|
|
19
|
+
};
|
|
20
|
+
const CCLPaletteColor = {
|
|
30
21
|
STRAWBERRY_50: '--palette-strawberry-50',
|
|
31
22
|
STRAWBERRY_100: '--palette-strawberry-100',
|
|
32
23
|
STRAWBERRY_200: '--palette-strawberry-200',
|
|
@@ -148,7 +139,7 @@ var CCLPaletteColor = {
|
|
|
148
139
|
CLOUD_800: '--palette-cloud-800',
|
|
149
140
|
CLOUD_900: '--palette-cloud-900'
|
|
150
141
|
};
|
|
151
|
-
|
|
142
|
+
const CCLSemanticColor = {
|
|
152
143
|
SURFACE_GLASS: '--color-surface-glass',
|
|
153
144
|
ACTION_PRIMARY_DEFAULT: '--color-action-primary-default',
|
|
154
145
|
ACTION_PRIMARY_HOVER: '--color-action-primary-hover',
|
|
@@ -171,7 +162,7 @@ export var ProgressBarHeight;
|
|
|
171
162
|
ProgressBarHeight["DEFAULT"] = "10px";
|
|
172
163
|
ProgressBarHeight["WIDE"] = "20px";
|
|
173
164
|
})(ProgressBarHeight || (ProgressBarHeight = {}));
|
|
174
|
-
|
|
165
|
+
const HeaderHeight = {
|
|
175
166
|
WIDE: '--hd-wide',
|
|
176
167
|
NORMAL: '--hd-normal',
|
|
177
168
|
NALLOW: '--hd-nallow'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ACCORDION_CONTEXT_KEY:
|
|
1
|
+
export declare const ACCORDION_CONTEXT_KEY: unique symbol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const ACCORDION_CONTEXT_KEY = Symbol('accordion-context');
|
package/dist/scripts/date.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Writable } from 'svelte/store';
|
|
2
|
+
export type TabData = {
|
|
3
|
+
label: string;
|
|
4
|
+
color: string;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type TabsContext = {
|
|
8
|
+
addTab: (tab: TabData) => void;
|
|
9
|
+
activeTabLabel: Writable<string>;
|
|
10
|
+
};
|
|
11
|
+
export declare const TABS_CONTEXT_KEY: unique symbol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const TABS_CONTEXT_KEY = Symbol('tabs-context');
|
package/dist/toast.js
CHANGED
|
@@ -1,64 +1,50 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
1
|
import { writable } from 'svelte/store';
|
|
11
2
|
import { CCLVividColor } from './const/config';
|
|
12
|
-
export
|
|
3
|
+
export const toasts = writable([]);
|
|
13
4
|
function genId() {
|
|
14
5
|
return Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
15
6
|
}
|
|
16
7
|
// Default auto-dismiss duration held internally
|
|
17
|
-
|
|
8
|
+
const DEFAULT_DURATION = 3000;
|
|
18
9
|
export function show(opts) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
id: id,
|
|
10
|
+
const id = genId();
|
|
11
|
+
const item = {
|
|
12
|
+
id,
|
|
23
13
|
title: opts.title,
|
|
24
14
|
message: opts.message,
|
|
25
|
-
variant:
|
|
26
|
-
duration:
|
|
15
|
+
variant: opts.variant ?? 'info',
|
|
16
|
+
duration: opts.duration ?? DEFAULT_DURATION
|
|
27
17
|
};
|
|
28
|
-
toasts.update(
|
|
18
|
+
toasts.update((list) => [item, ...list].slice(0, 50));
|
|
29
19
|
if (typeof window !== 'undefined' && item.duration > 0) {
|
|
30
|
-
window.setTimeout(
|
|
20
|
+
window.setTimeout(() => dismiss(id), item.duration);
|
|
31
21
|
}
|
|
32
22
|
return id;
|
|
33
23
|
}
|
|
34
24
|
export function dismiss(id) {
|
|
35
|
-
toasts.update(
|
|
25
|
+
toasts.update((list) => list.filter((t) => t.id !== id));
|
|
36
26
|
}
|
|
37
27
|
export function clear() {
|
|
38
28
|
toasts.set([]);
|
|
39
29
|
}
|
|
40
|
-
export
|
|
41
|
-
show
|
|
42
|
-
success
|
|
43
|
-
|
|
44
|
-
return show({ message: message, title: title, variant: 'success', duration: duration });
|
|
30
|
+
export const toast = {
|
|
31
|
+
show,
|
|
32
|
+
success(message, title = 'Success', duration) {
|
|
33
|
+
return show({ message, title, variant: 'success', duration });
|
|
45
34
|
},
|
|
46
|
-
error
|
|
47
|
-
|
|
48
|
-
return show({ message: message, title: title, variant: 'error', duration: duration });
|
|
35
|
+
error(message, title = 'Error', duration) {
|
|
36
|
+
return show({ message, title, variant: 'error', duration });
|
|
49
37
|
},
|
|
50
|
-
warning
|
|
51
|
-
|
|
52
|
-
return show({ message: message, title: title, variant: 'warning', duration: duration });
|
|
38
|
+
warning(message, title = 'Warning', duration) {
|
|
39
|
+
return show({ message, title, variant: 'warning', duration });
|
|
53
40
|
},
|
|
54
|
-
info
|
|
55
|
-
|
|
56
|
-
return show({ message: message, title: title, variant: 'info', duration: duration });
|
|
41
|
+
info(message, title = 'Info', duration) {
|
|
42
|
+
return show({ message, title, variant: 'info', duration });
|
|
57
43
|
},
|
|
58
|
-
dismiss
|
|
59
|
-
clear
|
|
44
|
+
dismiss,
|
|
45
|
+
clear
|
|
60
46
|
};
|
|
61
|
-
export
|
|
47
|
+
export const variantColor = {
|
|
62
48
|
success: CCLVividColor.MELON_GREEN,
|
|
63
49
|
error: CCLVividColor.STRAWBERRY_PINK,
|
|
64
50
|
warning: CCLVividColor.PINEAPPLE_YELLOW,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cclkit4svelte",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"author": "reiji1020 <sk@reiji1020.info>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"preinstall": "node -e \"if (!/pnpm/.test(process.env.npm_execpath || '')) { console.error('Use pnpm to install dependencies.'); process.exit(1); }\"",
|
|
24
|
+
"prepare": "svelte-kit sync",
|
|
24
25
|
"dev": "vite dev",
|
|
25
26
|
"build": "vite build",
|
|
26
27
|
"preview": "vite preview",
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
"vite": "^5.4.20"
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|
|
88
|
-
"svelte": "^
|
|
89
|
+
"svelte": "^5.0.0"
|
|
89
90
|
},
|
|
90
91
|
"volta": {
|
|
91
92
|
"node": "20.11.1",
|