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.
Files changed (40) hide show
  1. package/README.md +5 -0
  2. package/dist/BookCard.svelte +7 -2
  3. package/dist/Carousel.svelte +3 -3
  4. package/dist/ChangeHistory.svelte +14 -9
  5. package/dist/ChangeHistory.svelte.d.ts +11 -0
  6. package/dist/DatePicker.svelte +7 -2
  7. package/dist/Dialog.svelte.d.ts +1 -1
  8. package/dist/PrismaticAmbientGlow.svelte +115 -0
  9. package/dist/PrismaticAmbientGlow.svelte.d.ts +36 -0
  10. package/dist/PrismaticBookCard.svelte +175 -0
  11. package/dist/PrismaticBookCard.svelte.d.ts +34 -0
  12. package/dist/PrismaticGradientButton.svelte +211 -0
  13. package/dist/PrismaticGradientButton.svelte.d.ts +51 -0
  14. package/dist/PrismaticSectionHeading.svelte +70 -0
  15. package/dist/PrismaticSectionHeading.svelte.d.ts +28 -0
  16. package/dist/PrismaticSiteFooter.svelte +216 -0
  17. package/dist/PrismaticSiteFooter.svelte.d.ts +44 -0
  18. package/dist/PrismaticSiteHeader.svelte +239 -0
  19. package/dist/PrismaticSiteHeader.svelte.d.ts +43 -0
  20. package/dist/PrismaticStoryCard.svelte +264 -0
  21. package/dist/PrismaticStoryCard.svelte.d.ts +43 -0
  22. package/dist/PrismaticWorkCard.svelte +228 -0
  23. package/dist/PrismaticWorkCard.svelte.d.ts +36 -0
  24. package/dist/Select.svelte +5 -3
  25. package/dist/Select.svelte.d.ts +8 -4
  26. package/dist/TabPanel.svelte +2 -1
  27. package/dist/Tabs.svelte +3 -2
  28. package/dist/const/colorMap.js +8 -9
  29. package/dist/const/config.d.ts +153 -14
  30. package/dist/const/config.js +146 -16
  31. package/dist/const/variables.css +139 -0
  32. package/dist/index.d.ts +9 -1
  33. package/dist/index.js +9 -1
  34. package/dist/scripts/accordionContext.d.ts +1 -1
  35. package/dist/scripts/accordionContext.js +1 -1
  36. package/dist/scripts/date.js +1 -1
  37. package/dist/scripts/tabsContext.d.ts +11 -1
  38. package/dist/scripts/tabsContext.js +1 -1
  39. package/dist/toast.js +23 -37
  40. package/package.json +9 -3
@@ -0,0 +1,239 @@
1
+ <script context="module" lang="ts">
2
+ export type PrismaticSiteHeaderTone =
3
+ | '--strawberry-pink'
4
+ | '--pineapple-yellow'
5
+ | '--soda-blue'
6
+ | '--melon-green'
7
+ | '--grape-purple'
8
+ | '--wrap-grey';
9
+
10
+ export type PrismaticSiteHeaderItem = {
11
+ label: string;
12
+ href: string;
13
+ active?: boolean;
14
+ };
15
+
16
+ export type PrismaticSiteHeaderProps = {
17
+ brand?: string;
18
+ brandHref?: string;
19
+ logoUrl?: string;
20
+ logoAlt?: string;
21
+ logoHeight?: string;
22
+ navigation?: PrismaticSiteHeaderItem[];
23
+ ariaLabel?: string;
24
+ tone?: PrismaticSiteHeaderTone;
25
+ };
26
+ </script>
27
+
28
+ <script lang="ts">
29
+ import { CCLVividColor } from './const/config';
30
+
31
+ const defaultNavigation: PrismaticSiteHeaderItem[] = [
32
+ { label: 'DISCOVER', href: '#discover', active: true },
33
+ { label: 'WORKS', href: '#works' },
34
+ { label: 'BOOKS', href: '#books' },
35
+ { label: 'ABOUT', href: '#about' },
36
+ { label: 'SHOP', href: '#shop' }
37
+ ];
38
+
39
+ export let brand: string = 'CANDY CHUPS Lab.';
40
+ export let brandHref: string | undefined = undefined;
41
+ export let logoUrl: string | undefined = undefined;
42
+ export let logoAlt: string | undefined = undefined;
43
+ export let logoHeight: string = '40px';
44
+ export let navigation: PrismaticSiteHeaderItem[] = defaultNavigation;
45
+ export let ariaLabel: string = 'メインナビゲーション';
46
+ export let tone: PrismaticSiteHeaderTone = CCLVividColor.STRAWBERRY_PINK;
47
+
48
+ const brandLinkElement = 'a';
49
+
50
+ function toCssUrl(value: string): string {
51
+ const escaped = value
52
+ .replace(/\0/g, '\uFFFD')
53
+ .replace(/\\/g, '\\\\')
54
+ .replace(/"/g, '\\"')
55
+ .replace(/\n/g, '\\a ')
56
+ .replace(/\r/g, '\\d ')
57
+ .replace(/\f/g, '\\c ');
58
+
59
+ return `url("${escaped}")`;
60
+ }
61
+
62
+ $: accentColor = `var(${tone})`;
63
+ $: logoImage = logoUrl ? toCssUrl(logoUrl) : 'none';
64
+ $: logoLabel = logoAlt?.trim() || brand;
65
+ </script>
66
+
67
+ <header class="prismatic-site-header" style="--accent-color: {accentColor};">
68
+ {#if brandHref}
69
+ <svelte:element this={brandLinkElement} class="brand" href={brandHref}>
70
+ {#if logoUrl}
71
+ <span
72
+ class="brand-logo"
73
+ role="img"
74
+ aria-label={logoLabel}
75
+ data-logo-url={logoUrl}
76
+ style="--logo-height: {logoHeight}; --logo-image: {logoImage};"
77
+ ></span>
78
+ {:else}
79
+ {brand}
80
+ {/if}
81
+ </svelte:element>
82
+ {:else}
83
+ <span class="brand">
84
+ {#if logoUrl}
85
+ <span
86
+ class="brand-logo"
87
+ role="img"
88
+ aria-label={logoLabel}
89
+ data-logo-url={logoUrl}
90
+ style="--logo-height: {logoHeight}; --logo-image: {logoImage};"
91
+ ></span>
92
+ {:else}
93
+ {brand}
94
+ {/if}
95
+ </span>
96
+ {/if}
97
+
98
+ <nav aria-label={ariaLabel}>
99
+ <ul>
100
+ {#each navigation as item (item.href + item.label)}
101
+ <li>
102
+ <a
103
+ class:active={item.active}
104
+ href={item.href}
105
+ aria-current={item.active ? 'page' : undefined}
106
+ >
107
+ {item.label}
108
+ </a>
109
+ </li>
110
+ {/each}
111
+ </ul>
112
+ </nav>
113
+ </header>
114
+
115
+ <style>
116
+ .prismatic-site-header {
117
+ display: flex;
118
+ align-items: center;
119
+ justify-content: space-between;
120
+ gap: 32px;
121
+ width: min(100%, 1300px);
122
+ min-height: 104px;
123
+ box-sizing: border-box;
124
+ padding: 24px 35px;
125
+ border: 1.5px solid color-mix(in srgb, var(--accent-color) 42%, transparent);
126
+ border-radius: 34px;
127
+ background: color-mix(in srgb, var(--color-surface-glass) 78%, transparent);
128
+ box-shadow: 0 16px 20px color-mix(in srgb, var(--palette-grape-900) 18%, transparent);
129
+ font-family: Inter, sans-serif;
130
+ font-weight: 700;
131
+ line-height: normal;
132
+ letter-spacing: 0;
133
+ }
134
+
135
+ .brand {
136
+ display: flex;
137
+ align-items: center;
138
+ flex: 0 0 auto;
139
+ color: var(--accent-color);
140
+ font-size: 18px;
141
+ text-decoration: none;
142
+ white-space: nowrap;
143
+ }
144
+
145
+ .brand-logo {
146
+ display: block;
147
+ width: min(260px, 40vw);
148
+ max-width: min(260px, 40vw);
149
+ height: var(--logo-height);
150
+ background: var(--accent-color);
151
+ -webkit-mask: var(--logo-image) left center / contain no-repeat;
152
+ mask: var(--logo-image) left center / contain no-repeat;
153
+ }
154
+
155
+ nav {
156
+ min-width: 0;
157
+ }
158
+
159
+ ul {
160
+ display: flex;
161
+ align-items: center;
162
+ justify-content: flex-end;
163
+ gap: 20px;
164
+ margin: 0;
165
+ padding: 0;
166
+ list-style: none;
167
+ }
168
+
169
+ a:not(.brand) {
170
+ position: relative;
171
+ display: block;
172
+ padding: 8px 0;
173
+ color: color-mix(in srgb, var(--palette-grape-900) 42%, var(--palette-wrap-900));
174
+ font-size: 14px;
175
+ text-decoration: none;
176
+ white-space: nowrap;
177
+ }
178
+
179
+ a:not(.brand)::after {
180
+ position: absolute;
181
+ right: 0;
182
+ bottom: 2px;
183
+ left: 0;
184
+ height: 2px;
185
+ border-radius: 2px;
186
+ background: var(--accent-color);
187
+ content: '';
188
+ opacity: 0;
189
+ transform: scaleX(0.4);
190
+ transition:
191
+ opacity 160ms ease,
192
+ transform 160ms ease;
193
+ }
194
+
195
+ a:not(.brand):hover::after,
196
+ a:not(.brand):focus-visible::after,
197
+ a:not(.brand).active::after {
198
+ opacity: 1;
199
+ transform: scaleX(1);
200
+ }
201
+
202
+ a:focus-visible {
203
+ outline: 3px solid color-mix(in srgb, var(--accent-color) 42%, Canvas);
204
+ outline-offset: 4px;
205
+ }
206
+
207
+ @media (max-width: 760px) {
208
+ .prismatic-site-header {
209
+ flex-direction: column;
210
+ align-items: flex-start;
211
+ gap: 12px;
212
+ min-height: 104px;
213
+ padding: 22px 28px;
214
+ }
215
+
216
+ nav {
217
+ width: 100%;
218
+ overflow-x: auto;
219
+ scrollbar-width: thin;
220
+ }
221
+
222
+ ul {
223
+ justify-content: flex-start;
224
+ width: max-content;
225
+ min-width: 100%;
226
+ }
227
+ }
228
+
229
+ @media (max-width: 480px) {
230
+ .prismatic-site-header {
231
+ padding: 20px 22px;
232
+ border-radius: 28px;
233
+ }
234
+
235
+ ul {
236
+ gap: 16px;
237
+ }
238
+ }
239
+ </style>
@@ -0,0 +1,43 @@
1
+ export type PrismaticSiteHeaderTone = '--strawberry-pink' | '--pineapple-yellow' | '--soda-blue' | '--melon-green' | '--grape-purple' | '--wrap-grey';
2
+ export type PrismaticSiteHeaderItem = {
3
+ label: string;
4
+ href: string;
5
+ active?: boolean;
6
+ };
7
+ export type PrismaticSiteHeaderProps = {
8
+ brand?: string;
9
+ brandHref?: string;
10
+ logoUrl?: string;
11
+ logoAlt?: string;
12
+ logoHeight?: string;
13
+ navigation?: PrismaticSiteHeaderItem[];
14
+ ariaLabel?: string;
15
+ tone?: PrismaticSiteHeaderTone;
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 PrismaticSiteHeader: $$__sveltets_2_IsomorphicComponent<{
31
+ brand?: string;
32
+ brandHref?: string | undefined;
33
+ logoUrl?: string | undefined;
34
+ logoAlt?: string | undefined;
35
+ logoHeight?: string;
36
+ navigation?: PrismaticSiteHeaderItem[];
37
+ ariaLabel?: string;
38
+ tone?: PrismaticSiteHeaderTone;
39
+ }, {
40
+ [evt: string]: CustomEvent<any>;
41
+ }, {}, {}, string>;
42
+ type PrismaticSiteHeader = InstanceType<typeof PrismaticSiteHeader>;
43
+ export default PrismaticSiteHeader;
@@ -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;