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,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;
@@ -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;