cclkit4svelte 3.0.0 → 4.0.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/README.md +5 -0
- 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/PrismaticAmbientGlow.svelte +115 -0
- package/dist/PrismaticAmbientGlow.svelte.d.ts +36 -0
- package/dist/PrismaticBookCard.svelte +175 -0
- package/dist/PrismaticBookCard.svelte.d.ts +34 -0
- package/dist/PrismaticGradientButton.svelte +211 -0
- package/dist/PrismaticGradientButton.svelte.d.ts +51 -0
- package/dist/PrismaticSectionHeading.svelte +70 -0
- package/dist/PrismaticSectionHeading.svelte.d.ts +28 -0
- package/dist/PrismaticSiteFooter.svelte +216 -0
- package/dist/PrismaticSiteFooter.svelte.d.ts +44 -0
- package/dist/PrismaticSiteHeader.svelte +239 -0
- package/dist/PrismaticSiteHeader.svelte.d.ts +43 -0
- package/dist/PrismaticStoryCard.svelte +264 -0
- package/dist/PrismaticStoryCard.svelte.d.ts +43 -0
- package/dist/PrismaticWorkCard.svelte +228 -0
- package/dist/PrismaticWorkCard.svelte.d.ts +36 -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.d.ts +153 -14
- package/dist/const/config.js +146 -16
- package/dist/const/variables.css +139 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -1
- 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 +9 -3
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
export type PrismaticGradientButtonTone = 'primary' | 'secondary';
|
|
3
|
+
export type PrismaticGradientButtonSize = 'large' | 'medium';
|
|
4
|
+
export type PrismaticGradientButtonType = 'button' | 'submit' | 'reset';
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { CCLPastelColor, CCLVividColor } from './const/config';
|
|
9
|
+
import type { ColorVar } from './const/config';
|
|
10
|
+
|
|
11
|
+
type GradientStops = {
|
|
12
|
+
primaryStart: ColorVar;
|
|
13
|
+
primaryEnd: ColorVar;
|
|
14
|
+
secondaryStart: ColorVar;
|
|
15
|
+
secondaryEnd: ColorVar;
|
|
16
|
+
disabledStart: ColorVar;
|
|
17
|
+
disabledEnd: ColorVar;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* ボタン内に表示するラベル
|
|
22
|
+
* @default Explore the Lab
|
|
23
|
+
*/
|
|
24
|
+
export let label: string = 'Explore the Lab';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* ボタンの視覚的な強さ
|
|
28
|
+
* @default primary
|
|
29
|
+
*/
|
|
30
|
+
export let tone: PrismaticGradientButtonTone = 'primary';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* ボタンサイズ
|
|
34
|
+
* @default large
|
|
35
|
+
*/
|
|
36
|
+
export let size: PrismaticGradientButtonSize = 'large';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* グラデーションの基準色
|
|
40
|
+
* @default --strawberry-pink
|
|
41
|
+
*/
|
|
42
|
+
export let color: ColorVar = CCLVividColor.STRAWBERRY_PINK;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* ボタンの非活性状態
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
export let disabled: boolean = false;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* button要素のtype属性
|
|
52
|
+
* @default button
|
|
53
|
+
*/
|
|
54
|
+
export let type: PrismaticGradientButtonType = 'button';
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* クリックイベントハンドラ
|
|
58
|
+
* @default () => {}
|
|
59
|
+
*/
|
|
60
|
+
export let onClick: () => void = () => {};
|
|
61
|
+
|
|
62
|
+
const fallbackStops: GradientStops = {
|
|
63
|
+
primaryStart: CCLVividColor.STRAWBERRY_PINK,
|
|
64
|
+
primaryEnd: CCLVividColor.SODA_BLUE,
|
|
65
|
+
secondaryStart: CCLPastelColor.PEACH_PINK,
|
|
66
|
+
secondaryEnd: CCLVividColor.STRAWBERRY_PINK,
|
|
67
|
+
disabledStart: CCLPastelColor.LEMON_YELLOW,
|
|
68
|
+
disabledEnd: CCLPastelColor.PEACH_PINK
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const gradientStops: Record<string, GradientStops> = {
|
|
72
|
+
[CCLVividColor.STRAWBERRY_PINK]: fallbackStops,
|
|
73
|
+
[CCLVividColor.PINEAPPLE_YELLOW]: {
|
|
74
|
+
primaryStart: CCLVividColor.PINEAPPLE_YELLOW,
|
|
75
|
+
primaryEnd: CCLVividColor.MELON_GREEN,
|
|
76
|
+
secondaryStart: CCLPastelColor.LEMON_YELLOW,
|
|
77
|
+
secondaryEnd: CCLVividColor.PINEAPPLE_YELLOW,
|
|
78
|
+
disabledStart: CCLPastelColor.LEMON_YELLOW,
|
|
79
|
+
disabledEnd: CCLPastelColor.PEACH_PINK
|
|
80
|
+
},
|
|
81
|
+
[CCLVividColor.SODA_BLUE]: {
|
|
82
|
+
primaryStart: CCLVividColor.SODA_BLUE,
|
|
83
|
+
primaryEnd: CCLVividColor.GRAPE_PURPLE,
|
|
84
|
+
secondaryStart: CCLPastelColor.SUGAR_BLUE,
|
|
85
|
+
secondaryEnd: CCLVividColor.SODA_BLUE,
|
|
86
|
+
disabledStart: CCLPastelColor.SUGAR_BLUE,
|
|
87
|
+
disabledEnd: CCLPastelColor.CLOUD_GREY
|
|
88
|
+
},
|
|
89
|
+
[CCLVividColor.MELON_GREEN]: {
|
|
90
|
+
primaryStart: CCLVividColor.MELON_GREEN,
|
|
91
|
+
primaryEnd: CCLVividColor.SODA_BLUE,
|
|
92
|
+
secondaryStart: CCLPastelColor.MATCHA_GREEN,
|
|
93
|
+
secondaryEnd: CCLVividColor.MELON_GREEN,
|
|
94
|
+
disabledStart: CCLPastelColor.MATCHA_GREEN,
|
|
95
|
+
disabledEnd: CCLPastelColor.CLOUD_GREY
|
|
96
|
+
},
|
|
97
|
+
[CCLVividColor.GRAPE_PURPLE]: {
|
|
98
|
+
primaryStart: CCLVividColor.GRAPE_PURPLE,
|
|
99
|
+
primaryEnd: CCLVividColor.PINEAPPLE_YELLOW,
|
|
100
|
+
secondaryStart: CCLPastelColor.AKEBI_PURPLE,
|
|
101
|
+
secondaryEnd: CCLVividColor.GRAPE_PURPLE,
|
|
102
|
+
disabledStart: CCLPastelColor.AKEBI_PURPLE,
|
|
103
|
+
disabledEnd: CCLPastelColor.CLOUD_GREY
|
|
104
|
+
},
|
|
105
|
+
[CCLVividColor.WRAP_GREY]: {
|
|
106
|
+
primaryStart: CCLVividColor.WRAP_GREY,
|
|
107
|
+
primaryEnd: CCLVividColor.PINEAPPLE_YELLOW,
|
|
108
|
+
secondaryStart: CCLPastelColor.CLOUD_GREY,
|
|
109
|
+
secondaryEnd: CCLVividColor.WRAP_GREY,
|
|
110
|
+
disabledStart: CCLPastelColor.CLOUD_GREY,
|
|
111
|
+
disabledEnd: CCLPastelColor.CLOUD_GREY
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
$: stops = gradientStops[color] ?? fallbackStops;
|
|
116
|
+
$: gradientStart = disabled
|
|
117
|
+
? stops.disabledStart
|
|
118
|
+
: tone === 'secondary'
|
|
119
|
+
? stops.secondaryStart
|
|
120
|
+
: stops.primaryStart;
|
|
121
|
+
$: gradientEnd = disabled
|
|
122
|
+
? stops.disabledEnd
|
|
123
|
+
: tone === 'secondary'
|
|
124
|
+
? stops.secondaryEnd
|
|
125
|
+
: stops.primaryEnd;
|
|
126
|
+
$: gradientStartValue = `var(${gradientStart})`;
|
|
127
|
+
$: gradientEndValue =
|
|
128
|
+
color === CCLVividColor.WRAP_GREY && !disabled
|
|
129
|
+
? `color-mix(in srgb, var(${CCLVividColor.WRAP_GREY}) 14%, Canvas)`
|
|
130
|
+
: `var(${gradientEnd})`;
|
|
131
|
+
$: labelColor = disabled
|
|
132
|
+
? `var(${CCLVividColor.WRAP_GREY})`
|
|
133
|
+
: 'var(--prismatic-gradient-button-primary-fg, Canvas)';
|
|
134
|
+
</script>
|
|
135
|
+
|
|
136
|
+
<button
|
|
137
|
+
class="prismatic-gradient-button tone-{tone} size-{size}"
|
|
138
|
+
style="--gradient-start: {gradientStartValue}; --gradient-end: {gradientEndValue}; --label-color: {labelColor};"
|
|
139
|
+
on:click={onClick}
|
|
140
|
+
{disabled}
|
|
141
|
+
{type}
|
|
142
|
+
>
|
|
143
|
+
<span class="label">{label}</span>
|
|
144
|
+
</button>
|
|
145
|
+
|
|
146
|
+
<style>
|
|
147
|
+
.prismatic-gradient-button {
|
|
148
|
+
display: inline-flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: center;
|
|
151
|
+
gap: 8px;
|
|
152
|
+
width: fit-content;
|
|
153
|
+
min-width: 156px;
|
|
154
|
+
border: 0;
|
|
155
|
+
border-radius: 999px;
|
|
156
|
+
background: linear-gradient(105deg, var(--gradient-start), var(--gradient-end));
|
|
157
|
+
color: var(--label-color);
|
|
158
|
+
font-family: inherit;
|
|
159
|
+
font-weight: 700;
|
|
160
|
+
line-height: 1;
|
|
161
|
+
letter-spacing: 0;
|
|
162
|
+
white-space: nowrap;
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
transition:
|
|
165
|
+
transform 160ms ease,
|
|
166
|
+
filter 160ms ease,
|
|
167
|
+
opacity 160ms ease;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.size-large {
|
|
171
|
+
min-height: 48px;
|
|
172
|
+
padding: 0 28px;
|
|
173
|
+
font-size: 14px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.size-medium {
|
|
177
|
+
min-height: 40px;
|
|
178
|
+
min-width: 132px;
|
|
179
|
+
padding: 0 22px;
|
|
180
|
+
font-size: 12px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.tone-secondary {
|
|
184
|
+
color: var(--label-color);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.prismatic-gradient-button:hover:not(:disabled) {
|
|
188
|
+
filter: saturate(1.08) brightness(1.02);
|
|
189
|
+
transform: translateY(-1px);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.prismatic-gradient-button:active:not(:disabled) {
|
|
193
|
+
filter: saturate(1.02) brightness(0.96);
|
|
194
|
+
transform: translateY(0);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.prismatic-gradient-button:focus-visible {
|
|
198
|
+
outline: 3px solid color-mix(in srgb, var(--gradient-end) 48%, Canvas);
|
|
199
|
+
outline-offset: 3px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.prismatic-gradient-button:disabled {
|
|
203
|
+
cursor: not-allowed;
|
|
204
|
+
opacity: 0.68;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.label {
|
|
208
|
+
display: inline-flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
}
|
|
211
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type PrismaticGradientButtonTone = 'primary' | 'secondary';
|
|
2
|
+
export type PrismaticGradientButtonSize = 'large' | 'medium';
|
|
3
|
+
export type PrismaticGradientButtonType = 'button' | 'submit' | 'reset';
|
|
4
|
+
import type { ColorVar } from './const/config';
|
|
5
|
+
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> {
|
|
6
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
7
|
+
$$bindings?: Bindings;
|
|
8
|
+
} & Exports;
|
|
9
|
+
(internal: unknown, props: Props & {
|
|
10
|
+
$$events?: Events;
|
|
11
|
+
$$slots?: Slots;
|
|
12
|
+
}): Exports & {
|
|
13
|
+
$set?: any;
|
|
14
|
+
$on?: any;
|
|
15
|
+
};
|
|
16
|
+
z_$$bindings?: Bindings;
|
|
17
|
+
}
|
|
18
|
+
declare const PrismaticGradientButton: $$__sveltets_2_IsomorphicComponent<{
|
|
19
|
+
/**
|
|
20
|
+
* ボタン内に表示するラベル
|
|
21
|
+
* @default Explore the Lab
|
|
22
|
+
*/ label?: string;
|
|
23
|
+
/**
|
|
24
|
+
* ボタンの視覚的な強さ
|
|
25
|
+
* @default primary
|
|
26
|
+
*/ tone?: PrismaticGradientButtonTone;
|
|
27
|
+
/**
|
|
28
|
+
* ボタンサイズ
|
|
29
|
+
* @default large
|
|
30
|
+
*/ size?: PrismaticGradientButtonSize;
|
|
31
|
+
/**
|
|
32
|
+
* グラデーションの基準色
|
|
33
|
+
* @default --strawberry-pink
|
|
34
|
+
*/ color?: ColorVar;
|
|
35
|
+
/**
|
|
36
|
+
* ボタンの非活性状態
|
|
37
|
+
* @default false
|
|
38
|
+
*/ disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* button要素のtype属性
|
|
41
|
+
* @default button
|
|
42
|
+
*/ type?: PrismaticGradientButtonType;
|
|
43
|
+
/**
|
|
44
|
+
* クリックイベントハンドラ
|
|
45
|
+
* @default () => {}
|
|
46
|
+
*/ onClick?: () => void;
|
|
47
|
+
}, {
|
|
48
|
+
[evt: string]: CustomEvent<any>;
|
|
49
|
+
}, {}, {}, string>;
|
|
50
|
+
type PrismaticGradientButton = InstanceType<typeof PrismaticGradientButton>;
|
|
51
|
+
export default PrismaticGradientButton;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
export type PrismaticSectionHeadingTone =
|
|
3
|
+
| '--strawberry-pink'
|
|
4
|
+
| '--pineapple-yellow'
|
|
5
|
+
| '--soda-blue'
|
|
6
|
+
| '--melon-green'
|
|
7
|
+
| '--grape-purple'
|
|
8
|
+
| '--wrap-grey';
|
|
9
|
+
|
|
10
|
+
export type PrismaticSectionHeadingProps = {
|
|
11
|
+
eyebrow?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
tone?: PrismaticSectionHeadingTone;
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import { CCLVividColor } from './const/config';
|
|
19
|
+
|
|
20
|
+
export let eyebrow: string = 'LATEST';
|
|
21
|
+
export let title: string = 'Latest Stories';
|
|
22
|
+
export let tone: PrismaticSectionHeadingTone = CCLVividColor.STRAWBERRY_PINK;
|
|
23
|
+
|
|
24
|
+
$: toneValue = `var(${tone})`;
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div class="prismatic-section-heading" style="--eyebrow-color: {toneValue};">
|
|
28
|
+
<p class="eyebrow">{eyebrow}</p>
|
|
29
|
+
<h2 class="title">{title}</h2>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<style>
|
|
33
|
+
@import url('https://fonts.googleapis.com/css2?family=DotGothic16&display=swap');
|
|
34
|
+
|
|
35
|
+
.prismatic-section-heading {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: flex-start;
|
|
39
|
+
gap: 8px;
|
|
40
|
+
width: min(100%, 600px);
|
|
41
|
+
min-height: 80px;
|
|
42
|
+
color: color-mix(in srgb, var(--palette-grape-900) 42%, var(--palette-wrap-900));
|
|
43
|
+
font-family: 'DotGothic16', sans-serif;
|
|
44
|
+
font-weight: 400;
|
|
45
|
+
line-height: normal;
|
|
46
|
+
letter-spacing: 0;
|
|
47
|
+
overflow-wrap: anywhere;
|
|
48
|
+
word-break: normal;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.eyebrow,
|
|
52
|
+
.title {
|
|
53
|
+
margin: 0;
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
font-weight: 400;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.eyebrow {
|
|
59
|
+
color: var(--eyebrow-color);
|
|
60
|
+
font-size: 12px;
|
|
61
|
+
line-height: 1.25;
|
|
62
|
+
text-transform: uppercase;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.title {
|
|
66
|
+
color: inherit;
|
|
67
|
+
font-size: 42px;
|
|
68
|
+
line-height: 1.05;
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type PrismaticSectionHeadingTone = '--strawberry-pink' | '--pineapple-yellow' | '--soda-blue' | '--melon-green' | '--grape-purple' | '--wrap-grey';
|
|
2
|
+
export type PrismaticSectionHeadingProps = {
|
|
3
|
+
eyebrow?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
tone?: PrismaticSectionHeadingTone;
|
|
6
|
+
};
|
|
7
|
+
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> {
|
|
8
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
9
|
+
$$bindings?: Bindings;
|
|
10
|
+
} & Exports;
|
|
11
|
+
(internal: unknown, props: Props & {
|
|
12
|
+
$$events?: Events;
|
|
13
|
+
$$slots?: Slots;
|
|
14
|
+
}): Exports & {
|
|
15
|
+
$set?: any;
|
|
16
|
+
$on?: any;
|
|
17
|
+
};
|
|
18
|
+
z_$$bindings?: Bindings;
|
|
19
|
+
}
|
|
20
|
+
declare const PrismaticSectionHeading: $$__sveltets_2_IsomorphicComponent<{
|
|
21
|
+
eyebrow?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
tone?: PrismaticSectionHeadingTone;
|
|
24
|
+
}, {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
}, {}, {}, string>;
|
|
27
|
+
type PrismaticSectionHeading = InstanceType<typeof PrismaticSectionHeading>;
|
|
28
|
+
export default PrismaticSectionHeading;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
export type PrismaticSiteFooterTone =
|
|
3
|
+
| '--strawberry-pink'
|
|
4
|
+
| '--pineapple-yellow'
|
|
5
|
+
| '--soda-blue'
|
|
6
|
+
| '--melon-green'
|
|
7
|
+
| '--grape-purple'
|
|
8
|
+
| '--wrap-grey';
|
|
9
|
+
|
|
10
|
+
export type PrismaticSiteFooterLink = {
|
|
11
|
+
label: string;
|
|
12
|
+
href: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type PrismaticSiteFooterProps = {
|
|
16
|
+
brand?: string;
|
|
17
|
+
brandHref?: string;
|
|
18
|
+
logoUrl?: string;
|
|
19
|
+
logoAlt?: string;
|
|
20
|
+
logoHeight?: string;
|
|
21
|
+
links?: PrismaticSiteFooterLink[];
|
|
22
|
+
copyright?: string;
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
tone?: PrismaticSiteFooterTone;
|
|
25
|
+
};
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { CCLVividColor } from './const/config';
|
|
30
|
+
|
|
31
|
+
const defaultLinks: PrismaticSiteFooterLink[] = [
|
|
32
|
+
{ label: 'PRIVACY', href: '#privacy' },
|
|
33
|
+
{ label: 'CONTACT', href: '#contact' }
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const year = new Date().getFullYear();
|
|
37
|
+
|
|
38
|
+
export let brand: string = 'CANDY CHUPS Lab.';
|
|
39
|
+
export let brandHref: string | undefined = undefined;
|
|
40
|
+
export let logoUrl: string | undefined = undefined;
|
|
41
|
+
export let logoAlt: string | undefined = undefined;
|
|
42
|
+
export let logoHeight: string = '40px';
|
|
43
|
+
export let links: PrismaticSiteFooterLink[] = defaultLinks;
|
|
44
|
+
export let copyright: string = `Copyright © ${year} CANDY CHUPS Lab. All Rights Reserved.`;
|
|
45
|
+
export let ariaLabel: string = 'フッターナビゲーション';
|
|
46
|
+
export let tone: PrismaticSiteFooterTone = CCLVividColor.STRAWBERRY_PINK;
|
|
47
|
+
|
|
48
|
+
function toCssUrl(value: string): string {
|
|
49
|
+
const escaped = value
|
|
50
|
+
.replace(/\0/g, '\uFFFD')
|
|
51
|
+
.replace(/\\/g, '\\\\')
|
|
52
|
+
.replace(/"/g, '\\"')
|
|
53
|
+
.replace(/\n/g, '\\a ')
|
|
54
|
+
.replace(/\r/g, '\\d ')
|
|
55
|
+
.replace(/\f/g, '\\c ');
|
|
56
|
+
|
|
57
|
+
return `url("${escaped}")`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
$: accentColor = `var(${tone})`;
|
|
61
|
+
$: logoImage = logoUrl ? toCssUrl(logoUrl) : 'none';
|
|
62
|
+
$: logoLabel = logoAlt?.trim() || brand;
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<footer class="prismatic-site-footer" style="--accent-color: {accentColor};">
|
|
66
|
+
<div class="footer-main">
|
|
67
|
+
{#if brandHref}
|
|
68
|
+
<a class="brand" href={brandHref}>
|
|
69
|
+
{#if logoUrl}
|
|
70
|
+
<span
|
|
71
|
+
class="brand-logo"
|
|
72
|
+
role="img"
|
|
73
|
+
aria-label={logoLabel}
|
|
74
|
+
data-logo-url={logoUrl}
|
|
75
|
+
style="--logo-height: {logoHeight}; --logo-image: {logoImage};"
|
|
76
|
+
></span>
|
|
77
|
+
{:else}
|
|
78
|
+
{brand}
|
|
79
|
+
{/if}
|
|
80
|
+
</a>
|
|
81
|
+
{:else}
|
|
82
|
+
<span class="brand">
|
|
83
|
+
{#if logoUrl}
|
|
84
|
+
<span
|
|
85
|
+
class="brand-logo"
|
|
86
|
+
role="img"
|
|
87
|
+
aria-label={logoLabel}
|
|
88
|
+
data-logo-url={logoUrl}
|
|
89
|
+
style="--logo-height: {logoHeight}; --logo-image: {logoImage};"
|
|
90
|
+
></span>
|
|
91
|
+
{:else}
|
|
92
|
+
{brand}
|
|
93
|
+
{/if}
|
|
94
|
+
</span>
|
|
95
|
+
{/if}
|
|
96
|
+
|
|
97
|
+
{#if links.length > 0}
|
|
98
|
+
<nav aria-label={ariaLabel}>
|
|
99
|
+
<ul>
|
|
100
|
+
{#each links as item (item.href + item.label)}
|
|
101
|
+
<li><a href={item.href}>{item.label}</a></li>
|
|
102
|
+
{/each}
|
|
103
|
+
</ul>
|
|
104
|
+
</nav>
|
|
105
|
+
{/if}
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<small>{copyright}</small>
|
|
109
|
+
</footer>
|
|
110
|
+
|
|
111
|
+
<style>
|
|
112
|
+
.prismatic-site-footer {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
gap: 32px;
|
|
117
|
+
width: min(100%, 1300px);
|
|
118
|
+
min-height: 180px;
|
|
119
|
+
box-sizing: border-box;
|
|
120
|
+
padding: 40px 48px 32px;
|
|
121
|
+
border: 1.5px solid color-mix(in srgb, var(--accent-color) 52%, transparent);
|
|
122
|
+
border-radius: 34px;
|
|
123
|
+
background: linear-gradient(
|
|
124
|
+
112deg,
|
|
125
|
+
color-mix(in srgb, var(--accent-color) 78%, var(--color-surface-glass)) 0%,
|
|
126
|
+
color-mix(in srgb, var(--accent-color) 42%, var(--color-surface-glass)) 58%,
|
|
127
|
+
color-mix(in srgb, var(--accent-color) 18%, var(--color-surface-glass)) 100%
|
|
128
|
+
);
|
|
129
|
+
box-shadow: 0 16px 20px color-mix(in srgb, var(--palette-grape-900) 18%, transparent);
|
|
130
|
+
color: var(--palette-grape-900);
|
|
131
|
+
font-family: Inter, sans-serif;
|
|
132
|
+
line-height: normal;
|
|
133
|
+
letter-spacing: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.footer-main {
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: flex-start;
|
|
139
|
+
justify-content: space-between;
|
|
140
|
+
gap: 32px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.brand {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
color: inherit;
|
|
147
|
+
font-size: 22px;
|
|
148
|
+
font-weight: 700;
|
|
149
|
+
text-decoration: none;
|
|
150
|
+
white-space: nowrap;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.brand-logo {
|
|
154
|
+
display: block;
|
|
155
|
+
width: min(300px, 48vw);
|
|
156
|
+
height: var(--logo-height);
|
|
157
|
+
background: var(--color-surface-glass);
|
|
158
|
+
-webkit-mask: var(--logo-image) left center / contain no-repeat;
|
|
159
|
+
mask: var(--logo-image) left center / contain no-repeat;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
nav {
|
|
163
|
+
min-width: 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
ul {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-wrap: wrap;
|
|
169
|
+
justify-content: flex-end;
|
|
170
|
+
gap: 12px 24px;
|
|
171
|
+
margin: 0;
|
|
172
|
+
padding: 0;
|
|
173
|
+
list-style: none;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
li a {
|
|
177
|
+
color: inherit;
|
|
178
|
+
font-size: 13px;
|
|
179
|
+
font-weight: 700;
|
|
180
|
+
text-decoration-thickness: 1px;
|
|
181
|
+
text-underline-offset: 5px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
li a:hover,
|
|
185
|
+
li a:focus-visible {
|
|
186
|
+
text-decoration-line: underline;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
a:focus-visible {
|
|
190
|
+
outline: 3px solid color-mix(in srgb, var(--accent-color) 42%, Canvas);
|
|
191
|
+
outline-offset: 4px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
small {
|
|
195
|
+
font-size: 10px;
|
|
196
|
+
font-weight: 500;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@media (max-width: 640px) {
|
|
200
|
+
.prismatic-site-footer {
|
|
201
|
+
gap: 28px;
|
|
202
|
+
min-height: 220px;
|
|
203
|
+
padding: 32px 28px 28px;
|
|
204
|
+
border-radius: 28px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.footer-main {
|
|
208
|
+
flex-direction: column;
|
|
209
|
+
gap: 24px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
ul {
|
|
213
|
+
justify-content: flex-start;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type PrismaticSiteFooterTone = '--strawberry-pink' | '--pineapple-yellow' | '--soda-blue' | '--melon-green' | '--grape-purple' | '--wrap-grey';
|
|
2
|
+
export type PrismaticSiteFooterLink = {
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
};
|
|
6
|
+
export type PrismaticSiteFooterProps = {
|
|
7
|
+
brand?: string;
|
|
8
|
+
brandHref?: string;
|
|
9
|
+
logoUrl?: string;
|
|
10
|
+
logoAlt?: string;
|
|
11
|
+
logoHeight?: string;
|
|
12
|
+
links?: PrismaticSiteFooterLink[];
|
|
13
|
+
copyright?: string;
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
tone?: PrismaticSiteFooterTone;
|
|
16
|
+
};
|
|
17
|
+
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> {
|
|
18
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
19
|
+
$$bindings?: Bindings;
|
|
20
|
+
} & Exports;
|
|
21
|
+
(internal: unknown, props: Props & {
|
|
22
|
+
$$events?: Events;
|
|
23
|
+
$$slots?: Slots;
|
|
24
|
+
}): Exports & {
|
|
25
|
+
$set?: any;
|
|
26
|
+
$on?: any;
|
|
27
|
+
};
|
|
28
|
+
z_$$bindings?: Bindings;
|
|
29
|
+
}
|
|
30
|
+
declare const PrismaticSiteFooter: $$__sveltets_2_IsomorphicComponent<{
|
|
31
|
+
brand?: string;
|
|
32
|
+
brandHref?: string | undefined;
|
|
33
|
+
logoUrl?: string | undefined;
|
|
34
|
+
logoAlt?: string | undefined;
|
|
35
|
+
logoHeight?: string;
|
|
36
|
+
links?: PrismaticSiteFooterLink[];
|
|
37
|
+
copyright?: string;
|
|
38
|
+
ariaLabel?: string;
|
|
39
|
+
tone?: PrismaticSiteFooterTone;
|
|
40
|
+
}, {
|
|
41
|
+
[evt: string]: CustomEvent<any>;
|
|
42
|
+
}, {}, {}, string>;
|
|
43
|
+
type PrismaticSiteFooter = InstanceType<typeof PrismaticSiteFooter>;
|
|
44
|
+
export default PrismaticSiteFooter;
|