@kids-reporter/routing-ui 0.1.0-alpha.5 → 0.1.0-alpha.7

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 (42) hide show
  1. package/dist/components/input.d.ts +6 -2
  2. package/dist/components/input.d.ts.map +1 -1
  3. package/dist/components/input.js +30 -9
  4. package/dist/components/input.js.map +1 -1
  5. package/dist/header/shared-components.d.ts.map +1 -1
  6. package/dist/header/shared-components.js +2 -1
  7. package/dist/header/shared-components.js.map +1 -1
  8. package/dist/styles.css +11 -0
  9. package/package.json +6 -5
  10. package/.prettierignore +0 -17
  11. package/babel.config.cjs +0 -31
  12. package/eslint.config.mjs +0 -56
  13. package/prettier.config.mjs +0 -13
  14. package/scripts/build.sh +0 -18
  15. package/src/components/button.tsx +0 -108
  16. package/src/components/index.tsx +0 -2
  17. package/src/components/input.tsx +0 -171
  18. package/src/constants/default-values.tsx +0 -153
  19. package/src/footer.tsx +0 -149
  20. package/src/header/desktop-header.tsx +0 -132
  21. package/src/header/header-context.tsx +0 -82
  22. package/src/header/index.tsx +0 -104
  23. package/src/header/is-logged-in-setter.tsx +0 -27
  24. package/src/header/menu/header-menu-item-group.tsx +0 -37
  25. package/src/header/menu/header-menu-item.tsx +0 -132
  26. package/src/header/menu/index.tsx +0 -205
  27. package/src/header/mobile-back-button-href-setter.tsx +0 -22
  28. package/src/header/mobile-header.tsx +0 -77
  29. package/src/header/post-title-setter.tsx +0 -22
  30. package/src/header/shared-components.tsx +0 -325
  31. package/src/hooks/index.ts +0 -3
  32. package/src/hooks/use-is-at-top.ts +0 -23
  33. package/src/hooks/use-media-query.ts +0 -57
  34. package/src/hooks/use-scroll-level.ts +0 -52
  35. package/src/icons/index.tsx +0 -378
  36. package/src/index.ts +0 -11
  37. package/src/styles.css +0 -354
  38. package/src/types/index.ts +0 -10
  39. package/src/utils/cn.ts +0 -41
  40. package/src/utils/generate-social-media-config.ts +0 -75
  41. package/src/utils/index.ts +0 -2
  42. package/tsconfig.json +0 -33
package/src/styles.css DELETED
@@ -1,354 +0,0 @@
1
- /* Tailwind v4 Theme Configuration */
2
- @theme {
3
- /* Colors - Neutral */
4
- --color-neutral-white: #ffffff;
5
- --color-neutral-100: #f8f8f8;
6
- --color-neutral-200: #eaeaea;
7
- --color-neutral-300: #d9d9d9;
8
- --color-neutral-400: #c6c6c6;
9
- --color-neutral-500: #a3a3a3;
10
- --color-neutral-600: #8e8e8e;
11
- --color-neutral-700: #575757;
12
- --color-neutral-800: #3b3b3b;
13
- --color-neutral-900: #232323;
14
- --color-neutral-black: #000000;
15
- --color-neutral-border: #00000026;
16
-
17
- /* Colors - Brand Red */
18
- --color-red-100: #fff0f2;
19
- --color-red-200: #ffc4ca;
20
- --color-red-300: #ff98a2;
21
- --color-red-400: #f76977;
22
- --color-red-500: #bd4450;
23
- --color-red-600: #a0343e;
24
- --color-red-700: #82262f;
25
- --color-red-800: #651a22;
26
-
27
- /* Colors - Brand Blue */
28
- --color-blue-100: #e9f8ff;
29
- --color-blue-200: #b9e8ff;
30
- --color-blue-300: #89d9ff;
31
- --color-blue-400: #27b3f5;
32
- --color-blue-500: #1696d3;
33
- --color-blue-600: #087bb1;
34
- --color-blue-700: #00618f;
35
- --color-blue-800: #004a6d;
36
-
37
- /* Colors - Brand Yellow */
38
- --color-yellow-100: #fff9ec;
39
- --color-yellow-200: #ffedc2;
40
- --color-yellow-300: #ffe197;
41
- --color-yellow-400: #f8c341;
42
- --color-yellow-500: #d6a52d;
43
- --color-yellow-600: #b4881d;
44
- --color-yellow-700: #926c10;
45
- --color-yellow-800: #705207;
46
-
47
- /* Typography - Font Families */
48
- --font-family-noto: 'Noto Sans TC', sans-serif;
49
-
50
- /* Typography - Font Sizes */
51
- --font-size-h1-large: 48px;
52
- --font-size-h2-large: 40px;
53
- --font-size-h3-large: 32px;
54
- --font-size-h4-large: 28px;
55
- --font-size-h5-large: 22px;
56
- --font-size-h6-large: 18px;
57
-
58
- --font-size-h1-small: 32px;
59
- --font-size-h2-small: 28px;
60
- --font-size-h3-small: 24px;
61
- --font-size-h4-small: 22px;
62
- --font-size-h5-small: 20px;
63
- --font-size-h6-small: 18px;
64
-
65
- --font-size-p1: 16px;
66
- --font-size-p2: 14px;
67
- --font-size-p3: 12px;
68
- --font-size-p4: 10px;
69
-
70
- /* Typography - Line Heights */
71
- --line-height-tight: 1.25;
72
- --line-height-normal: 1.6;
73
- --line-height-relaxed: 1.75;
74
-
75
- /* Typography - Letter Spacing */
76
- --letter-spacing-wide: 0.05em;
77
-
78
- /* Spacing - Grid System */
79
- --spacing-grid-xs: 4px;
80
- --spacing-grid-sm: 8px;
81
- --spacing-grid-md: 16px;
82
- --spacing-grid-lg: 24px;
83
- --spacing-grid-xl: 32px;
84
- --spacing-grid-2xl: 48px;
85
- --spacing-grid-3xl: 64px;
86
- --spacing-grid-4xl: 96px;
87
- --spacing-grid-5xl: 128px;
88
-
89
- /* Container Widths */
90
- --container-mobile: 375px;
91
- --container-tablet: 768px;
92
- --container-desktop: 1024px;
93
- --container-hd: 1440px;
94
-
95
- /* Grid Gutters */
96
- --gutter-mobile: 16px;
97
- --gutter-tablet: 24px;
98
- --gutter-desktop: 32px;
99
- --gutter-hd: 32px;
100
-
101
- /* Margins */
102
- --margin-mobile: 24px;
103
- --margin-tablet: 32px;
104
- --margin-desktop: 48px;
105
- --margin-hd: 120px;
106
-
107
- /* Responsive Breakpoints */
108
- --breakpoint-mobile: 375px;
109
- --breakpoint-tablet: 768px;
110
- --breakpoint-desktop: 1024px;
111
- --breakpoint-hd: 1440px;
112
-
113
- /* Header */
114
- --mobile-header-height: 64px;
115
-
116
- /* Legacy variables for backward compatibility */
117
- --fontFamily: var(--font-family-noto);
118
- --max-width: 1100px;
119
- --border-radius: 12px;
120
-
121
- /* Updated color palette using design system */
122
- --paletteColor1: var(--color-blue-400);
123
- --paletteColor2: var(--color-blue-600);
124
- --paletteColor3: var(--color-neutral-700);
125
- --paletteColor4: var(--color-neutral-900);
126
- --paletteColor5: var(--color-red-400);
127
- --paletteColor6: var(--color-yellow-400);
128
- --paletteColor7: var(--color-neutral-200);
129
- --paletteColor8: var(--color-neutral-white);
130
- --color: var(--paletteColor3);
131
- }
132
-
133
- /* Design System CSS Variables for compatibility */
134
- @layer base {
135
- :root {
136
- /* Legacy variables for backward compatibility */
137
- --fontFamily: var(--font-family-noto);
138
- --max-width: 1100px;
139
- --border-radius: 12px;
140
-
141
- /* Updated color palette using design system */
142
- --paletteColor1: var(--color-blue-400);
143
- --paletteColor2: var(--color-blue-600);
144
- --paletteColor3: var(--color-neutral-700);
145
- --paletteColor4: var(--color-neutral-900);
146
- --paletteColor5: var(--color-red-400);
147
- --paletteColor6: var(--color-yellow-400);
148
- --paletteColor7: var(--color-neutral-200);
149
- --paletteColor8: var(--color-neutral-white);
150
- --color: var(--paletteColor3);
151
- }
152
- }
153
-
154
- @layer utilities {
155
- body.no-scroll {
156
- overflow: hidden;
157
- }
158
- }
159
-
160
- /* Typography Utilities - Headlines Large */
161
- @utility prose-h1-large {
162
- font-family: var(--font-family-noto);
163
- font-size: var(--font-size-h1-large);
164
- font-weight: 700;
165
- line-height: var(--line-height-normal);
166
- letter-spacing: 2.4px;
167
- }
168
-
169
- @utility prose-h2-large {
170
- font-family: var(--font-family-noto);
171
- font-size: var(--font-size-h2-large);
172
- font-weight: 700;
173
- line-height: var(--line-height-normal);
174
- letter-spacing: 2px;
175
- }
176
-
177
- @utility prose-h3-large {
178
- font-family: var(--font-family-noto);
179
- font-size: var(--font-size-h3-large);
180
- font-weight: 700;
181
- line-height: var(--line-height-normal);
182
- letter-spacing: 1.6px;
183
- }
184
-
185
- @utility prose-h4-large {
186
- font-family: var(--font-family-noto);
187
- font-size: var(--font-size-h4-large);
188
- font-weight: 700;
189
- line-height: var(--line-height-normal);
190
- letter-spacing: 1.4px;
191
- }
192
-
193
- @utility prose-h5-large {
194
- font-family: var(--font-family-noto);
195
- font-size: var(--font-size-h5-large);
196
- font-weight: 700;
197
- line-height: var(--line-height-normal);
198
- letter-spacing: 1.1px;
199
- }
200
-
201
- @utility prose-h6-large {
202
- font-family: var(--font-family-noto);
203
- font-size: var(--font-size-h6-large);
204
- font-weight: 700;
205
- line-height: var(--line-height-normal);
206
- letter-spacing: 0.9px;
207
- }
208
-
209
- /* Typography Utilities - Headlines Small */
210
- @utility prose-h1-small {
211
- font-family: var(--font-family-noto);
212
- font-size: var(--font-size-h1-small);
213
- font-weight: 700;
214
- line-height: var(--line-height-normal);
215
- letter-spacing: 1.6px;
216
- }
217
-
218
- @utility prose-h2-small {
219
- font-family: var(--font-family-noto);
220
- font-size: var(--font-size-h2-small);
221
- font-weight: 700;
222
- line-height: var(--line-height-normal);
223
- letter-spacing: 1.4px;
224
- }
225
-
226
- @utility prose-h3-small {
227
- font-family: var(--font-family-noto);
228
- font-size: var(--font-size-h3-small);
229
- font-weight: 700;
230
- line-height: var(--line-height-normal);
231
- letter-spacing: 1.2px;
232
- }
233
-
234
- @utility prose-h4-small {
235
- font-family: var(--font-family-noto);
236
- font-size: var(--font-size-h4-small);
237
- font-weight: 700;
238
- line-height: var(--line-height-normal);
239
- letter-spacing: 1.1px;
240
- }
241
-
242
- @utility prose-h5-small {
243
- font-family: var(--font-family-noto);
244
- font-size: var(--font-size-h5-small);
245
- font-weight: 700;
246
- line-height: var(--line-height-normal);
247
- letter-spacing: 1px;
248
- }
249
-
250
- @utility prose-h6-small {
251
- font-family: var(--font-family-noto);
252
- font-size: var(--font-size-h6-small);
253
- font-weight: 700;
254
- line-height: var(--line-height-normal);
255
- letter-spacing: 0.9px;
256
- }
257
-
258
- /* Typography Utilities - Paragraphs */
259
- @utility prose-p1 {
260
- font-family: var(--font-family-noto);
261
- font-size: var(--font-size-p1);
262
- font-weight: 500;
263
- line-height: var(--line-height-normal);
264
- letter-spacing: 0.8px;
265
- }
266
-
267
- @utility prose-p1-bold {
268
- font-family: var(--font-family-noto);
269
- font-size: var(--font-size-p1);
270
- font-weight: 700;
271
- line-height: var(--line-height-normal);
272
- letter-spacing: 0.8px;
273
- }
274
-
275
- @utility prose-p2 {
276
- font-family: var(--font-family-noto);
277
- font-size: var(--font-size-p2);
278
- font-weight: 500;
279
- line-height: var(--line-height-normal);
280
- letter-spacing: 0.7px;
281
- }
282
-
283
- @utility prose-p2-bold {
284
- font-family: var(--font-family-noto);
285
- font-size: var(--font-size-p2);
286
- font-weight: 700;
287
- line-height: var(--line-height-normal);
288
- letter-spacing: 0.7px;
289
- }
290
-
291
- @utility prose-p3 {
292
- font-family: var(--font-family-noto);
293
- font-size: var(--font-size-p3);
294
- font-weight: 500;
295
- line-height: var(--line-height-normal);
296
- letter-spacing: 0.6px;
297
- }
298
-
299
- @utility prose-p3-bold {
300
- font-family: var(--font-family-noto);
301
- font-size: var(--font-size-p3);
302
- font-weight: 700;
303
- line-height: var(--line-height-normal);
304
- letter-spacing: 0.6px;
305
- }
306
-
307
- @utility prose-p4 {
308
- font-family: var(--font-family-noto);
309
- font-size: var(--font-size-p4);
310
- font-weight: 500;
311
- line-height: var(--line-height-normal);
312
- letter-spacing: 0.5px;
313
- }
314
-
315
- @utility prose-p4-bold {
316
- font-family: var(--font-family-noto);
317
- font-size: var(--font-size-p4);
318
- font-weight: 700;
319
- line-height: var(--line-height-normal);
320
- letter-spacing: 0.5px;
321
- }
322
-
323
- @utility scrollbar-thin {
324
- scrollbar-width: thin;
325
- scrollbar-color: var(--color-neutral-300) transparent;
326
-
327
- &::-webkit-scrollbar {
328
- width: 6px;
329
- }
330
-
331
- &::-webkit-scrollbar-track {
332
- background: transparent;
333
- }
334
-
335
- &::-webkit-scrollbar-thumb {
336
- background: transparent;
337
- border-radius: 3px;
338
- }
339
-
340
- &::-webkit-scrollbar-thumb:hover {
341
- background: transparent;
342
- }
343
- }
344
-
345
- /* Theme Color Utilities */
346
- @utility theme-red {
347
- --theme-color: var(--color-red-400);
348
- }
349
- @utility theme-yellow {
350
- --theme-color: var(--color-yellow-400);
351
- }
352
- @utility theme-blue {
353
- --theme-color: var(--color-blue-400);
354
- }
@@ -1,10 +0,0 @@
1
- export type MenuItem = {
2
- label: string
3
- href: string
4
- subItems?: MenuItem[]
5
- external?: boolean
6
- showIcon?: boolean
7
- icon?: React.ReactNode
8
- }
9
-
10
- export type SocialMediaHrefs = readonly string[]
package/src/utils/cn.ts DELETED
@@ -1,41 +0,0 @@
1
- import { ClassValue, clsx } from 'clsx'
2
- import { extendTailwindMerge } from 'tailwind-merge'
3
-
4
- const twMerge = extendTailwindMerge({
5
- extend: {
6
- classGroups: {
7
- // Add custom prose classes in font-size group since we follow the design system
8
- 'font-size': [
9
- 'prose-p1',
10
- 'prose-p1-bold',
11
- 'prose-p2',
12
- 'prose-p2-bold',
13
- 'prose-p3',
14
- 'prose-p3-bold',
15
- 'prose-p4',
16
- 'prose-p4-bold',
17
- 'prose-h1-large',
18
- 'prose-h2-large',
19
- 'prose-h3-large',
20
- 'prose-h4-large',
21
- 'prose-h5-large',
22
- 'prose-h6-large',
23
- 'prose-h1-small',
24
- 'prose-h2-small',
25
- 'prose-h3-small',
26
- 'prose-h4-small',
27
- 'prose-h5-small',
28
- 'prose-h6-small',
29
- ],
30
- },
31
- },
32
- })
33
-
34
- /**
35
- * Combines clsx and tailwind-merge for optimal class merging.
36
- * @param inputs - Class names or conditional class values.
37
- * @returns A single string with merged class names.
38
- */
39
- export const cn = (...inputs: ClassValue[]): string => {
40
- return twMerge(clsx(inputs))
41
- }
@@ -1,75 +0,0 @@
1
- import { JSX } from 'react'
2
-
3
- import {
4
- FBIcon,
5
- IGIcon,
6
- MediumIcon,
7
- RSSIcon,
8
- ThreadsIcon,
9
- YouTubeIcon,
10
- } from '../icons'
11
- import { SocialMediaHrefs } from '../types'
12
-
13
- export type SocialMediaConfig = {
14
- label: string
15
- href: string
16
- icon: (() => JSX.Element) | null
17
- }
18
-
19
- export function generateSocialMediaConfig(
20
- socialMediaHrefs: SocialMediaHrefs
21
- ): SocialMediaConfig[] {
22
- return socialMediaHrefs.map((href) => {
23
- // Extract domain from URL to determine the social media platform
24
- let label = 'Unknown'
25
- let icon = null
26
- try {
27
- const url = new URL(href)
28
- const hostname = url.hostname.toLowerCase()
29
-
30
- // Check for specific patterns
31
- if (hostname.includes('facebook.com')) {
32
- label = 'Facebook'
33
- icon = FBIcon
34
- } else if (hostname.includes('instagram.com')) {
35
- label = 'Instagram'
36
- icon = IGIcon
37
- } else if (
38
- hostname.includes('youtube.com') ||
39
- hostname.includes('youtu.be')
40
- ) {
41
- label = 'YouTube'
42
- icon = YouTubeIcon
43
- } else if (
44
- hostname.includes('threads.net') ||
45
- hostname.includes('threads.com')
46
- ) {
47
- label = 'Threads'
48
- icon = ThreadsIcon
49
- } else if (hostname.includes('medium.com')) {
50
- label = 'Medium'
51
- icon = MediumIcon
52
- } else if (href.includes('rss.xml') || href.includes('rss')) {
53
- label = 'RSS'
54
- icon = RSSIcon
55
- }
56
- } catch {
57
- console.warn(`Invalid URL provided: ${href}`)
58
- }
59
-
60
- if (!icon) {
61
- console.warn(`No icon found for social media platform: ${label}`)
62
- return {
63
- label,
64
- href,
65
- icon: null, // or a default icon component
66
- }
67
- }
68
-
69
- return {
70
- label,
71
- href,
72
- icon,
73
- }
74
- })
75
- }
@@ -1,2 +0,0 @@
1
- export * from './cn'
2
- export * from './generate-social-media-config'
package/tsconfig.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "lib": ["DOM", "DOM.Iterable", "ES6"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strict": true,
8
- "noEmit": false,
9
- "esModuleInterop": true,
10
- "module": "esnext",
11
- "moduleResolution": "bundler",
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "jsx": "react-jsx",
15
- "plugins": [
16
- {
17
- "name": "next"
18
- }
19
- ],
20
- "baseUrl": ".",
21
- "paths": {
22
- "@/*": ["./src/*"]
23
- },
24
- "outDir": "./dist",
25
- "rootDir": "./src",
26
- "declaration": true,
27
- "declarationMap": true,
28
- "sourceMap": true,
29
- "emitDeclarationOnly": true
30
- },
31
- "include": ["src/**/*"],
32
- "exclude": ["node_modules", "dist"]
33
- }