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.
@@ -0,0 +1,264 @@
1
+ <script context="module" lang="ts">
2
+ export type PrismaticStoryCardSize = 'featured' | 'default';
3
+ export type PrismaticStoryCardTone =
4
+ | '--strawberry-pink'
5
+ | '--pineapple-yellow'
6
+ | '--soda-blue'
7
+ | '--melon-green'
8
+ | '--grape-purple'
9
+ | '--wrap-grey';
10
+
11
+ export type PrismaticStoryCardProps = {
12
+ title?: string;
13
+ label?: string;
14
+ href?: string;
15
+ linkLabel?: string;
16
+ imageUrl?: string;
17
+ imageAlt?: string;
18
+ squareImage?: boolean;
19
+ size?: PrismaticStoryCardSize;
20
+ tone?: PrismaticStoryCardTone;
21
+ };
22
+ </script>
23
+
24
+ <script lang="ts">
25
+ import { CCLPastelColor, CCLVividColor } from './const/config';
26
+ import type { ColorVar } from './const/config';
27
+
28
+ type GradientStops = {
29
+ start: ColorVar;
30
+ end: ColorVar;
31
+ };
32
+
33
+ export let title: string = '技術書典20・新刊のお知らせ';
34
+ export let label: string | undefined = undefined;
35
+ export let href: string | undefined = undefined;
36
+ export let linkLabel: string = 'Read more';
37
+ export let imageUrl: string | undefined = undefined;
38
+ export let imageAlt: string = '';
39
+ export let squareImage: boolean = false;
40
+ export let size: PrismaticStoryCardSize = 'featured';
41
+ export let tone: PrismaticStoryCardTone = CCLVividColor.STRAWBERRY_PINK;
42
+
43
+ const fallbackStops: GradientStops = {
44
+ start: CCLPastelColor.PEACH_PINK,
45
+ end: CCLPastelColor.SUGAR_BLUE
46
+ };
47
+
48
+ const gradientStops: Record<string, GradientStops> = {
49
+ [CCLVividColor.STRAWBERRY_PINK]: fallbackStops,
50
+ [CCLVividColor.PINEAPPLE_YELLOW]: {
51
+ start: CCLPastelColor.LEMON_YELLOW,
52
+ end: CCLPastelColor.PEACH_PINK
53
+ },
54
+ [CCLVividColor.SODA_BLUE]: {
55
+ start: CCLPastelColor.SUGAR_BLUE,
56
+ end: CCLPastelColor.AKEBI_PURPLE
57
+ },
58
+ [CCLVividColor.MELON_GREEN]: {
59
+ start: CCLPastelColor.MATCHA_GREEN,
60
+ end: CCLPastelColor.SUGAR_BLUE
61
+ },
62
+ [CCLVividColor.GRAPE_PURPLE]: {
63
+ start: CCLPastelColor.AKEBI_PURPLE,
64
+ end: CCLPastelColor.LEMON_YELLOW
65
+ },
66
+ [CCLVividColor.WRAP_GREY]: {
67
+ start: CCLPastelColor.CLOUD_GREY,
68
+ end: CCLPastelColor.SUGAR_BLUE
69
+ }
70
+ };
71
+ const linkElement = 'a';
72
+
73
+ $: stops = gradientStops[tone] ?? fallbackStops;
74
+ $: gradientStart = `var(${stops.start})`;
75
+ $: gradientEnd = `var(${stops.end})`;
76
+ $: accentColor = `var(${tone})`;
77
+ </script>
78
+
79
+ <article
80
+ class="prismatic-story-card size-{size}"
81
+ style="--gradient-start: {gradientStart}; --gradient-end: {gradientEnd}; --accent-color: {accentColor};"
82
+ >
83
+ <div
84
+ class="image-slot"
85
+ class:square-image={squareImage}
86
+ aria-label={imageUrl ? undefined : imageAlt || undefined}
87
+ >
88
+ {#if imageUrl}
89
+ <img class="image" src={imageUrl} alt={imageAlt} />
90
+ {:else}
91
+ <slot name="image">
92
+ <span class="image-fallback" aria-hidden="true"></span>
93
+ </slot>
94
+ {/if}
95
+ </div>
96
+
97
+ <div class="body">
98
+ {#if label}
99
+ <p class="label">{label}</p>
100
+ {/if}
101
+
102
+ <h3 class="title">{title}</h3>
103
+
104
+ {#if href}
105
+ <svelte:element
106
+ this={linkElement}
107
+ class="link"
108
+ {href}
109
+ target="_blank"
110
+ rel="noopener noreferrer"
111
+ >
112
+ {linkLabel}
113
+ </svelte:element>
114
+ {/if}
115
+ </div>
116
+ </article>
117
+
118
+ <style>
119
+ .prismatic-story-card {
120
+ display: flex;
121
+ flex-direction: column;
122
+ overflow: hidden;
123
+ border: 1.5px solid color-mix(in srgb, var(--gradient-start) 52%, transparent);
124
+ border-radius: 34px;
125
+ background: color-mix(in srgb, var(--color-surface-glass) 82%, transparent);
126
+ box-shadow: 0 18px 38px color-mix(in srgb, var(--palette-grape-900) 16%, transparent);
127
+ color: color-mix(in srgb, var(--palette-grape-900) 42%, var(--palette-wrap-900));
128
+ font-family: Inter, sans-serif;
129
+ letter-spacing: 0;
130
+ }
131
+
132
+ .size-featured {
133
+ width: min(100%, 600px);
134
+ min-height: 430px;
135
+ }
136
+
137
+ .size-default {
138
+ width: 300px;
139
+ min-height: 360px;
140
+ }
141
+
142
+ .image-slot {
143
+ position: relative;
144
+ display: flex;
145
+ align-items: center;
146
+ justify-content: center;
147
+ flex: 0 0 auto;
148
+ width: 100%;
149
+ overflow: hidden;
150
+ background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
151
+ }
152
+
153
+ .size-featured .image-slot {
154
+ height: 300px;
155
+ }
156
+
157
+ .size-default .image-slot {
158
+ height: 230px;
159
+ }
160
+
161
+ .image,
162
+ .image-fallback {
163
+ display: block;
164
+ width: 100%;
165
+ height: 100%;
166
+ }
167
+
168
+ .image,
169
+ .image-slot :global(img),
170
+ .image-slot :global(video) {
171
+ display: block;
172
+ width: 100%;
173
+ height: 100%;
174
+ object-fit: cover;
175
+ }
176
+
177
+ .square-image .image,
178
+ .square-image :global(img),
179
+ .square-image :global(video) {
180
+ display: block;
181
+ width: auto;
182
+ max-width: 100%;
183
+ aspect-ratio: 1 / 1;
184
+ object-fit: contain;
185
+ }
186
+
187
+ .size-featured .square-image .image,
188
+ .size-featured .square-image :global(img),
189
+ .size-featured .square-image :global(video) {
190
+ height: 300px;
191
+ }
192
+
193
+ .size-default .square-image .image,
194
+ .size-default .square-image :global(img),
195
+ .size-default .square-image :global(video) {
196
+ height: 230px;
197
+ }
198
+
199
+ .body {
200
+ display: flex;
201
+ flex: 1 1 auto;
202
+ flex-direction: column;
203
+ align-items: flex-start;
204
+ justify-content: flex-start;
205
+ gap: 8px;
206
+ min-width: 0;
207
+ }
208
+
209
+ .size-featured .body {
210
+ padding: 21px 20px 20px;
211
+ }
212
+
213
+ .size-default .body {
214
+ padding: 20px;
215
+ }
216
+
217
+ .label,
218
+ .title {
219
+ margin: 0;
220
+ max-width: 100%;
221
+ overflow-wrap: anywhere;
222
+ word-break: normal;
223
+ }
224
+
225
+ .label {
226
+ color: var(--accent-color);
227
+ font-size: 12px;
228
+ font-weight: 700;
229
+ line-height: 1.25;
230
+ text-transform: uppercase;
231
+ }
232
+
233
+ .title {
234
+ color: inherit;
235
+ font-weight: 400;
236
+ line-height: normal;
237
+ }
238
+
239
+ .size-featured .title {
240
+ font-size: 24px;
241
+ }
242
+
243
+ .size-default .title {
244
+ font-size: 18px;
245
+ }
246
+
247
+ .link {
248
+ margin-top: auto;
249
+ color: var(--accent-color);
250
+ font-size: 13px;
251
+ font-weight: 700;
252
+ line-height: 1.4;
253
+ text-decoration: none;
254
+ }
255
+
256
+ .link:hover {
257
+ text-decoration: underline;
258
+ }
259
+
260
+ .link:focus-visible {
261
+ outline: 3px solid color-mix(in srgb, var(--accent-color) 42%, Canvas);
262
+ outline-offset: 4px;
263
+ }
264
+ </style>
@@ -0,0 +1,43 @@
1
+ export type PrismaticStoryCardSize = 'featured' | 'default';
2
+ export type PrismaticStoryCardTone = '--strawberry-pink' | '--pineapple-yellow' | '--soda-blue' | '--melon-green' | '--grape-purple' | '--wrap-grey';
3
+ export type PrismaticStoryCardProps = {
4
+ title?: string;
5
+ label?: string;
6
+ href?: string;
7
+ linkLabel?: string;
8
+ imageUrl?: string;
9
+ imageAlt?: string;
10
+ squareImage?: boolean;
11
+ size?: PrismaticStoryCardSize;
12
+ tone?: PrismaticStoryCardTone;
13
+ };
14
+ 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> {
15
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
16
+ $$bindings?: Bindings;
17
+ } & Exports;
18
+ (internal: unknown, props: Props & {
19
+ $$events?: Events;
20
+ $$slots?: Slots;
21
+ }): Exports & {
22
+ $set?: any;
23
+ $on?: any;
24
+ };
25
+ z_$$bindings?: Bindings;
26
+ }
27
+ declare const PrismaticStoryCard: $$__sveltets_2_IsomorphicComponent<{
28
+ title?: string;
29
+ label?: string | undefined;
30
+ href?: string | undefined;
31
+ linkLabel?: string;
32
+ imageUrl?: string | undefined;
33
+ imageAlt?: string;
34
+ squareImage?: boolean;
35
+ size?: PrismaticStoryCardSize;
36
+ tone?: PrismaticStoryCardTone;
37
+ }, {
38
+ [evt: string]: CustomEvent<any>;
39
+ }, {
40
+ image: {};
41
+ }, {}, string>;
42
+ type PrismaticStoryCard = InstanceType<typeof PrismaticStoryCard>;
43
+ export default PrismaticStoryCard;
@@ -0,0 +1,228 @@
1
+ <script context="module" lang="ts">
2
+ export type PrismaticWorkCardTone =
3
+ | '--strawberry-pink'
4
+ | '--pineapple-yellow'
5
+ | '--soda-blue'
6
+ | '--melon-green'
7
+ | '--grape-purple'
8
+ | '--wrap-grey';
9
+
10
+ export type PrismaticWorkCardProps = {
11
+ title?: string;
12
+ href?: string;
13
+ linkLabel?: string;
14
+ imageUrl?: string;
15
+ imageAlt?: string;
16
+ tone?: PrismaticWorkCardTone;
17
+ };
18
+ </script>
19
+
20
+ <script lang="ts">
21
+ import { CCLPastelColor, CCLVividColor } from './const/config';
22
+ import type { ColorVar } from './const/config';
23
+
24
+ export let title: string = 'CCL Component Kit';
25
+ export let href: string | undefined = undefined;
26
+ export let linkLabel: string = 'VIEW PROJECT';
27
+ export let imageUrl: string | undefined = undefined;
28
+ export let imageAlt: string = '';
29
+ export let tone: PrismaticWorkCardTone = CCLVividColor.STRAWBERRY_PINK;
30
+
31
+ const imageColors: Record<string, ColorVar> = {
32
+ [CCLVividColor.STRAWBERRY_PINK]: CCLPastelColor.PEACH_PINK,
33
+ [CCLVividColor.PINEAPPLE_YELLOW]: CCLPastelColor.LEMON_YELLOW,
34
+ [CCLVividColor.SODA_BLUE]: CCLPastelColor.SUGAR_BLUE,
35
+ [CCLVividColor.MELON_GREEN]: CCLPastelColor.MATCHA_GREEN,
36
+ [CCLVividColor.GRAPE_PURPLE]: CCLPastelColor.AKEBI_PURPLE,
37
+ [CCLVividColor.WRAP_GREY]: CCLPastelColor.CLOUD_GREY
38
+ };
39
+ const linkElement = 'a';
40
+
41
+ $: accentColor = `var(${tone})`;
42
+ $: imageColor = `var(${imageColors[tone] ?? CCLPastelColor.PEACH_PINK})`;
43
+ </script>
44
+
45
+ <article
46
+ class="prismatic-work-card"
47
+ style="--accent-color: {accentColor}; --image-color: {imageColor};"
48
+ >
49
+ <div class="image-slot" aria-label={imageUrl ? undefined : imageAlt || undefined}>
50
+ {#if imageUrl}
51
+ <img class="image" src={imageUrl} alt={imageAlt} />
52
+ {:else}
53
+ <slot name="image">
54
+ <span class="image-fallback" aria-hidden="true"></span>
55
+ </slot>
56
+ {/if}
57
+ </div>
58
+
59
+ <div class="body">
60
+ <h3 class="title">{title}</h3>
61
+
62
+ {#if href}
63
+ <svelte:element
64
+ this={linkElement}
65
+ class="link"
66
+ {href}
67
+ target="_blank"
68
+ rel="noopener noreferrer"
69
+ >
70
+ <span>{linkLabel}</span>
71
+ <svg class="link-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
72
+ <path d="M5 3.5L9.5 8L5 12.5" />
73
+ <path d="M9 8H2.5" />
74
+ </svg>
75
+ </svelte:element>
76
+ {:else}
77
+ <span class="link-label">
78
+ <span>{linkLabel}</span>
79
+ <svg class="link-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
80
+ <path d="M5 3.5L9.5 8L5 12.5" />
81
+ <path d="M9 8H2.5" />
82
+ </svg>
83
+ </span>
84
+ {/if}
85
+ </div>
86
+ </article>
87
+
88
+ <style>
89
+ .prismatic-work-card {
90
+ display: flex;
91
+ align-items: center;
92
+ gap: 44px;
93
+ width: min(100%, 620px);
94
+ min-height: 250px;
95
+ box-sizing: border-box;
96
+ padding: 38px 32px;
97
+ border: 1.5px solid color-mix(in srgb, var(--accent-color) 52%, transparent);
98
+ border-radius: 34px;
99
+ background: color-mix(in srgb, var(--color-surface-glass) 72%, transparent);
100
+ color: color-mix(in srgb, var(--palette-grape-900) 42%, var(--palette-wrap-900));
101
+ font-family: Inter, sans-serif;
102
+ letter-spacing: 0;
103
+ }
104
+
105
+ .image-slot {
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ flex: 0 0 170px;
110
+ width: 170px;
111
+ height: 170px;
112
+ overflow: hidden;
113
+ border-radius: 24px;
114
+ background: var(--image-color);
115
+ }
116
+
117
+ .image,
118
+ .image-fallback {
119
+ display: block;
120
+ width: 100%;
121
+ height: 100%;
122
+ }
123
+
124
+ .image,
125
+ .image-slot :global(img),
126
+ .image-slot :global(video) {
127
+ display: block;
128
+ width: 100%;
129
+ height: 100%;
130
+ object-fit: cover;
131
+ }
132
+
133
+ .body {
134
+ display: flex;
135
+ flex: 1 1 auto;
136
+ flex-direction: column;
137
+ align-items: flex-start;
138
+ justify-content: center;
139
+ gap: 58px;
140
+ min-width: 0;
141
+ }
142
+
143
+ .title {
144
+ margin: 0;
145
+ max-width: 100%;
146
+ color: inherit;
147
+ font-size: 26px;
148
+ font-weight: 700;
149
+ line-height: normal;
150
+ overflow-wrap: anywhere;
151
+ word-break: normal;
152
+ }
153
+
154
+ .link,
155
+ .link-label {
156
+ display: inline-flex;
157
+ align-items: center;
158
+ gap: 8px;
159
+ width: fit-content;
160
+ color: var(--accent-color);
161
+ font-size: 15px;
162
+ font-weight: 700;
163
+ line-height: normal;
164
+ text-decoration: none;
165
+ }
166
+
167
+ .link-icon {
168
+ display: block;
169
+ flex: 0 0 16px;
170
+ width: 16px;
171
+ height: 16px;
172
+ fill: none;
173
+ stroke: currentColor;
174
+ stroke-width: 1.8;
175
+ stroke-linecap: round;
176
+ stroke-linejoin: round;
177
+ }
178
+
179
+ .link:hover {
180
+ text-decoration: underline;
181
+ }
182
+
183
+ .link:focus-visible {
184
+ outline: 3px solid color-mix(in srgb, var(--accent-color) 42%, Canvas);
185
+ outline-offset: 4px;
186
+ }
187
+
188
+ @media (max-width: 640px) {
189
+ .prismatic-work-card {
190
+ align-items: flex-start;
191
+ gap: 24px;
192
+ min-height: auto;
193
+ padding: 24px;
194
+ }
195
+
196
+ .image-slot {
197
+ flex-basis: 132px;
198
+ width: 132px;
199
+ height: 132px;
200
+ border-radius: 20px;
201
+ }
202
+
203
+ .body {
204
+ gap: 32px;
205
+ min-height: 132px;
206
+ }
207
+
208
+ .title {
209
+ font-size: 22px;
210
+ }
211
+ }
212
+
213
+ @media (max-width: 480px) {
214
+ .prismatic-work-card {
215
+ flex-direction: column;
216
+ }
217
+
218
+ .image-slot {
219
+ width: min(100%, 170px);
220
+ height: auto;
221
+ aspect-ratio: 1 / 1;
222
+ }
223
+
224
+ .body {
225
+ min-height: auto;
226
+ }
227
+ }
228
+ </style>
@@ -0,0 +1,36 @@
1
+ export type PrismaticWorkCardTone = '--strawberry-pink' | '--pineapple-yellow' | '--soda-blue' | '--melon-green' | '--grape-purple' | '--wrap-grey';
2
+ export type PrismaticWorkCardProps = {
3
+ title?: string;
4
+ href?: string;
5
+ linkLabel?: string;
6
+ imageUrl?: string;
7
+ imageAlt?: string;
8
+ tone?: PrismaticWorkCardTone;
9
+ };
10
+ 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> {
11
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
12
+ $$bindings?: Bindings;
13
+ } & Exports;
14
+ (internal: unknown, props: Props & {
15
+ $$events?: Events;
16
+ $$slots?: Slots;
17
+ }): Exports & {
18
+ $set?: any;
19
+ $on?: any;
20
+ };
21
+ z_$$bindings?: Bindings;
22
+ }
23
+ declare const PrismaticWorkCard: $$__sveltets_2_IsomorphicComponent<{
24
+ title?: string;
25
+ href?: string | undefined;
26
+ linkLabel?: string;
27
+ imageUrl?: string | undefined;
28
+ imageAlt?: string;
29
+ tone?: PrismaticWorkCardTone;
30
+ }, {
31
+ [evt: string]: CustomEvent<any>;
32
+ }, {
33
+ image: {};
34
+ }, {}, string>;
35
+ type PrismaticWorkCard = InstanceType<typeof PrismaticWorkCard>;
36
+ export default PrismaticWorkCard;