cclkit4svelte 3.0.0 → 3.1.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/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/const/config.d.ts +153 -14
- package/dist/const/config.js +140 -1
- package/dist/const/variables.css +139 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -1
- package/package.json +7 -2
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
export type PrismaticAmbientGlowTone =
|
|
3
|
+
| '--peach-pink'
|
|
4
|
+
| '--sugar-blue'
|
|
5
|
+
| '--lemon-yellow'
|
|
6
|
+
| '--akebi-purple';
|
|
7
|
+
|
|
8
|
+
export type PrismaticAmbientGlowSize = 'small' | 'medium' | 'large';
|
|
9
|
+
export type PrismaticAmbientGlowOpacity = 'subtle' | 'standard' | 'strong';
|
|
10
|
+
export type PrismaticAmbientGlowBlur = 'soft' | 'medium' | 'diffuse';
|
|
11
|
+
export type PrismaticAmbientGlowPosition =
|
|
12
|
+
| 'top-left'
|
|
13
|
+
| 'top-right'
|
|
14
|
+
| 'center'
|
|
15
|
+
| 'bottom-left'
|
|
16
|
+
| 'bottom-right';
|
|
17
|
+
|
|
18
|
+
export type PrismaticAmbientGlowProps = {
|
|
19
|
+
tone?: PrismaticAmbientGlowTone;
|
|
20
|
+
size?: PrismaticAmbientGlowSize;
|
|
21
|
+
opacity?: PrismaticAmbientGlowOpacity;
|
|
22
|
+
blur?: PrismaticAmbientGlowBlur;
|
|
23
|
+
position?: PrismaticAmbientGlowPosition;
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import { CCLPastelColor } from './const/config';
|
|
29
|
+
|
|
30
|
+
const sizes: Record<PrismaticAmbientGlowSize, string> = {
|
|
31
|
+
small: '220px',
|
|
32
|
+
medium: '380px',
|
|
33
|
+
large: '620px'
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const opacities: Record<PrismaticAmbientGlowOpacity, string> = {
|
|
37
|
+
subtle: '0.28',
|
|
38
|
+
standard: '0.48',
|
|
39
|
+
strong: '0.68'
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const blurs: Record<PrismaticAmbientGlowBlur, string> = {
|
|
43
|
+
soft: '44px',
|
|
44
|
+
medium: '76px',
|
|
45
|
+
diffuse: '112px'
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export let tone: PrismaticAmbientGlowTone = CCLPastelColor.PEACH_PINK;
|
|
49
|
+
export let size: PrismaticAmbientGlowSize = 'medium';
|
|
50
|
+
export let opacity: PrismaticAmbientGlowOpacity = 'standard';
|
|
51
|
+
export let blur: PrismaticAmbientGlowBlur = 'medium';
|
|
52
|
+
export let position: PrismaticAmbientGlowPosition = 'center';
|
|
53
|
+
|
|
54
|
+
$: glowSize = sizes[size];
|
|
55
|
+
$: glowOpacity = opacities[opacity];
|
|
56
|
+
$: glowBlur = blurs[blur];
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<!-- The containing block should use position: relative and isolation: isolate. -->
|
|
60
|
+
<span
|
|
61
|
+
class="ambient-glow {position}"
|
|
62
|
+
aria-hidden="true"
|
|
63
|
+
data-testid="prismatic-ambient-glow"
|
|
64
|
+
data-tone={tone}
|
|
65
|
+
data-size={size}
|
|
66
|
+
data-opacity={opacity}
|
|
67
|
+
data-blur={blur}
|
|
68
|
+
data-position={position}
|
|
69
|
+
style="--glow-color: var({tone}); --glow-size: {glowSize}; --glow-opacity: {glowOpacity}; --glow-blur: {glowBlur};"
|
|
70
|
+
></span>
|
|
71
|
+
|
|
72
|
+
<style>
|
|
73
|
+
.ambient-glow {
|
|
74
|
+
position: absolute;
|
|
75
|
+
z-index: -1;
|
|
76
|
+
display: block;
|
|
77
|
+
width: var(--glow-size);
|
|
78
|
+
height: var(--glow-size);
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
background: var(--glow-color);
|
|
81
|
+
filter: blur(var(--glow-blur));
|
|
82
|
+
opacity: var(--glow-opacity);
|
|
83
|
+
pointer-events: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.top-left {
|
|
87
|
+
top: 0;
|
|
88
|
+
left: 0;
|
|
89
|
+
transform: translate(-35%, -35%);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.top-right {
|
|
93
|
+
top: 0;
|
|
94
|
+
right: 0;
|
|
95
|
+
transform: translate(35%, -35%);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.center {
|
|
99
|
+
top: 50%;
|
|
100
|
+
left: 50%;
|
|
101
|
+
transform: translate(-50%, -50%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bottom-left {
|
|
105
|
+
bottom: 0;
|
|
106
|
+
left: 0;
|
|
107
|
+
transform: translate(-35%, 35%);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.bottom-right {
|
|
111
|
+
right: 0;
|
|
112
|
+
bottom: 0;
|
|
113
|
+
transform: translate(35%, 35%);
|
|
114
|
+
}
|
|
115
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type PrismaticAmbientGlowTone = '--peach-pink' | '--sugar-blue' | '--lemon-yellow' | '--akebi-purple';
|
|
2
|
+
export type PrismaticAmbientGlowSize = 'small' | 'medium' | 'large';
|
|
3
|
+
export type PrismaticAmbientGlowOpacity = 'subtle' | 'standard' | 'strong';
|
|
4
|
+
export type PrismaticAmbientGlowBlur = 'soft' | 'medium' | 'diffuse';
|
|
5
|
+
export type PrismaticAmbientGlowPosition = 'top-left' | 'top-right' | 'center' | 'bottom-left' | 'bottom-right';
|
|
6
|
+
export type PrismaticAmbientGlowProps = {
|
|
7
|
+
tone?: PrismaticAmbientGlowTone;
|
|
8
|
+
size?: PrismaticAmbientGlowSize;
|
|
9
|
+
opacity?: PrismaticAmbientGlowOpacity;
|
|
10
|
+
blur?: PrismaticAmbientGlowBlur;
|
|
11
|
+
position?: PrismaticAmbientGlowPosition;
|
|
12
|
+
};
|
|
13
|
+
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> {
|
|
14
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
15
|
+
$$bindings?: Bindings;
|
|
16
|
+
} & Exports;
|
|
17
|
+
(internal: unknown, props: Props & {
|
|
18
|
+
$$events?: Events;
|
|
19
|
+
$$slots?: Slots;
|
|
20
|
+
}): Exports & {
|
|
21
|
+
$set?: any;
|
|
22
|
+
$on?: any;
|
|
23
|
+
};
|
|
24
|
+
z_$$bindings?: Bindings;
|
|
25
|
+
}
|
|
26
|
+
declare const PrismaticAmbientGlow: $$__sveltets_2_IsomorphicComponent<{
|
|
27
|
+
tone?: PrismaticAmbientGlowTone;
|
|
28
|
+
size?: PrismaticAmbientGlowSize;
|
|
29
|
+
opacity?: PrismaticAmbientGlowOpacity;
|
|
30
|
+
blur?: PrismaticAmbientGlowBlur;
|
|
31
|
+
position?: PrismaticAmbientGlowPosition;
|
|
32
|
+
}, {
|
|
33
|
+
[evt: string]: CustomEvent<any>;
|
|
34
|
+
}, {}, {}, string>;
|
|
35
|
+
type PrismaticAmbientGlow = InstanceType<typeof PrismaticAmbientGlow>;
|
|
36
|
+
export default PrismaticAmbientGlow;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
export type PrismaticBookCardTone =
|
|
3
|
+
| '--strawberry-pink'
|
|
4
|
+
| '--pineapple-yellow'
|
|
5
|
+
| '--soda-blue'
|
|
6
|
+
| '--melon-green'
|
|
7
|
+
| '--grape-purple'
|
|
8
|
+
| '--wrap-grey';
|
|
9
|
+
|
|
10
|
+
export type PrismaticBookCardProps = {
|
|
11
|
+
href?: string;
|
|
12
|
+
linkLabel?: string;
|
|
13
|
+
imageUrl?: string;
|
|
14
|
+
imageAlt?: string;
|
|
15
|
+
tone?: PrismaticBookCardTone;
|
|
16
|
+
};
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import { CCLPastelColor, CCLVividColor } from './const/config';
|
|
21
|
+
import type { ColorVar } from './const/config';
|
|
22
|
+
|
|
23
|
+
export let href: string | undefined = undefined;
|
|
24
|
+
export let linkLabel: string = 'READ MORE';
|
|
25
|
+
export let imageUrl: string | undefined = undefined;
|
|
26
|
+
export let imageAlt: string = '';
|
|
27
|
+
export let tone: PrismaticBookCardTone = CCLVividColor.STRAWBERRY_PINK;
|
|
28
|
+
|
|
29
|
+
const gradientEndColors: Record<string, ColorVar> = {
|
|
30
|
+
[CCLVividColor.STRAWBERRY_PINK]: CCLPastelColor.LEMON_YELLOW,
|
|
31
|
+
[CCLVividColor.PINEAPPLE_YELLOW]: CCLPastelColor.PEACH_PINK,
|
|
32
|
+
[CCLVividColor.SODA_BLUE]: CCLPastelColor.AKEBI_PURPLE,
|
|
33
|
+
[CCLVividColor.MELON_GREEN]: CCLPastelColor.SUGAR_BLUE,
|
|
34
|
+
[CCLVividColor.GRAPE_PURPLE]: CCLPastelColor.LEMON_YELLOW,
|
|
35
|
+
[CCLVividColor.WRAP_GREY]: CCLPastelColor.SUGAR_BLUE
|
|
36
|
+
};
|
|
37
|
+
const linkElement = 'a';
|
|
38
|
+
|
|
39
|
+
$: gradientStart = `var(${tone})`;
|
|
40
|
+
$: gradientEnd = `var(${gradientEndColors[tone] ?? CCLPastelColor.LEMON_YELLOW})`;
|
|
41
|
+
$: accentColor = `var(${tone})`;
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<article
|
|
45
|
+
class="prismatic-book-card"
|
|
46
|
+
style="--gradient-start: {gradientStart}; --gradient-end: {gradientEnd}; --accent-color: {accentColor};"
|
|
47
|
+
>
|
|
48
|
+
<div class="cover-slot" aria-label={imageUrl ? undefined : imageAlt || undefined}>
|
|
49
|
+
{#if imageUrl}
|
|
50
|
+
<img class="cover-image" src={imageUrl} alt={imageAlt} />
|
|
51
|
+
{:else}
|
|
52
|
+
<slot name="image">
|
|
53
|
+
<span class="cover-fallback" aria-hidden="true"></span>
|
|
54
|
+
</slot>
|
|
55
|
+
{/if}
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
{#if href}
|
|
59
|
+
<svelte:element
|
|
60
|
+
this={linkElement}
|
|
61
|
+
class="link"
|
|
62
|
+
{href}
|
|
63
|
+
target="_blank"
|
|
64
|
+
rel="noopener noreferrer"
|
|
65
|
+
>
|
|
66
|
+
<span>{linkLabel}</span>
|
|
67
|
+
<svg class="link-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
68
|
+
<path d="M5 3.5L9.5 8L5 12.5" />
|
|
69
|
+
<path d="M9 8H2.5" />
|
|
70
|
+
</svg>
|
|
71
|
+
</svelte:element>
|
|
72
|
+
{:else}
|
|
73
|
+
<span class="link-label">
|
|
74
|
+
<span>{linkLabel}</span>
|
|
75
|
+
<svg class="link-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
76
|
+
<path d="M5 3.5L9.5 8L5 12.5" />
|
|
77
|
+
<path d="M9 8H2.5" />
|
|
78
|
+
</svg>
|
|
79
|
+
</span>
|
|
80
|
+
{/if}
|
|
81
|
+
</article>
|
|
82
|
+
|
|
83
|
+
<style>
|
|
84
|
+
.prismatic-book-card {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
align-items: flex-start;
|
|
88
|
+
gap: 20px;
|
|
89
|
+
width: min(100%, 300px);
|
|
90
|
+
height: 500px;
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
padding: 24px;
|
|
93
|
+
border: 1.5px solid color-mix(in srgb, var(--gradient-end) 60%, transparent);
|
|
94
|
+
border-radius: 34px;
|
|
95
|
+
background: color-mix(in srgb, var(--color-surface-glass) 82%, transparent);
|
|
96
|
+
font-family: Inter, sans-serif;
|
|
97
|
+
letter-spacing: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.cover-slot {
|
|
101
|
+
position: relative;
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
width: 100%;
|
|
106
|
+
height: 360px;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
border-radius: 18px;
|
|
109
|
+
background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.cover-image,
|
|
113
|
+
.cover-fallback {
|
|
114
|
+
display: block;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.cover-image,
|
|
120
|
+
.cover-slot :global(img),
|
|
121
|
+
.cover-slot :global(video) {
|
|
122
|
+
display: block;
|
|
123
|
+
width: 100%;
|
|
124
|
+
height: 100%;
|
|
125
|
+
object-fit: cover;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.link,
|
|
129
|
+
.link-label {
|
|
130
|
+
display: inline-flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: 6px;
|
|
133
|
+
width: fit-content;
|
|
134
|
+
max-width: 100%;
|
|
135
|
+
color: var(--accent-color);
|
|
136
|
+
font-size: 13px;
|
|
137
|
+
font-weight: 700;
|
|
138
|
+
line-height: normal;
|
|
139
|
+
text-decoration: none;
|
|
140
|
+
overflow-wrap: anywhere;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.link-icon {
|
|
144
|
+
display: block;
|
|
145
|
+
flex: 0 0 16px;
|
|
146
|
+
width: 16px;
|
|
147
|
+
height: 16px;
|
|
148
|
+
fill: none;
|
|
149
|
+
stroke: currentColor;
|
|
150
|
+
stroke-width: 1.8;
|
|
151
|
+
stroke-linecap: round;
|
|
152
|
+
stroke-linejoin: round;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.link:hover {
|
|
156
|
+
text-decoration: underline;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.link:focus-visible {
|
|
160
|
+
outline: 3px solid color-mix(in srgb, var(--accent-color) 42%, Canvas);
|
|
161
|
+
outline-offset: 4px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@media (max-width: 320px) {
|
|
165
|
+
.prismatic-book-card {
|
|
166
|
+
height: auto;
|
|
167
|
+
min-height: 500px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.cover-slot {
|
|
171
|
+
height: auto;
|
|
172
|
+
aspect-ratio: 7 / 10;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type PrismaticBookCardTone = '--strawberry-pink' | '--pineapple-yellow' | '--soda-blue' | '--melon-green' | '--grape-purple' | '--wrap-grey';
|
|
2
|
+
export type PrismaticBookCardProps = {
|
|
3
|
+
href?: string;
|
|
4
|
+
linkLabel?: string;
|
|
5
|
+
imageUrl?: string;
|
|
6
|
+
imageAlt?: string;
|
|
7
|
+
tone?: PrismaticBookCardTone;
|
|
8
|
+
};
|
|
9
|
+
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> {
|
|
10
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
11
|
+
$$bindings?: Bindings;
|
|
12
|
+
} & Exports;
|
|
13
|
+
(internal: unknown, props: Props & {
|
|
14
|
+
$$events?: Events;
|
|
15
|
+
$$slots?: Slots;
|
|
16
|
+
}): Exports & {
|
|
17
|
+
$set?: any;
|
|
18
|
+
$on?: any;
|
|
19
|
+
};
|
|
20
|
+
z_$$bindings?: Bindings;
|
|
21
|
+
}
|
|
22
|
+
declare const PrismaticBookCard: $$__sveltets_2_IsomorphicComponent<{
|
|
23
|
+
href?: string | undefined;
|
|
24
|
+
linkLabel?: string;
|
|
25
|
+
imageUrl?: string | undefined;
|
|
26
|
+
imageAlt?: string;
|
|
27
|
+
tone?: PrismaticBookCardTone;
|
|
28
|
+
}, {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {
|
|
31
|
+
image: {};
|
|
32
|
+
}, {}, string>;
|
|
33
|
+
type PrismaticBookCard = InstanceType<typeof PrismaticBookCard>;
|
|
34
|
+
export default PrismaticBookCard;
|
|
@@ -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>
|