@kids-reporter/routing-ui 0.1.0-alpha.1

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 (129) hide show
  1. package/.prettierignore +17 -0
  2. package/babel.config.cjs +31 -0
  3. package/dist/components/button.d.ts +23 -0
  4. package/dist/components/button.d.ts.map +1 -0
  5. package/dist/components/button.js +82 -0
  6. package/dist/components/button.js.map +1 -0
  7. package/dist/components/index.d.ts +3 -0
  8. package/dist/components/index.d.ts.map +1 -0
  9. package/dist/components/index.js +21 -0
  10. package/dist/components/index.js.map +1 -0
  11. package/dist/components/input.d.ts +20 -0
  12. package/dist/components/input.d.ts.map +1 -0
  13. package/dist/components/input.js +143 -0
  14. package/dist/components/input.js.map +1 -0
  15. package/dist/constants/default-values.d.ts +12 -0
  16. package/dist/constants/default-values.d.ts.map +1 -0
  17. package/dist/constants/default-values.js +148 -0
  18. package/dist/constants/default-values.js.map +1 -0
  19. package/dist/footer.d.ts +10 -0
  20. package/dist/footer.d.ts.map +1 -0
  21. package/dist/footer.js +144 -0
  22. package/dist/footer.js.map +1 -0
  23. package/dist/header/desktop-header.d.ts +14 -0
  24. package/dist/header/desktop-header.d.ts.map +1 -0
  25. package/dist/header/desktop-header.js +85 -0
  26. package/dist/header/desktop-header.js.map +1 -0
  27. package/dist/header/header-context.d.ts +16 -0
  28. package/dist/header/header-context.d.ts.map +1 -0
  29. package/dist/header/header-context.js +37 -0
  30. package/dist/header/header-context.js.map +1 -0
  31. package/dist/header/index.d.ts +12 -0
  32. package/dist/header/index.d.ts.map +1 -0
  33. package/dist/header/index.js +72 -0
  34. package/dist/header/index.js.map +1 -0
  35. package/dist/header/menu/header-menu-item-group.d.ts +7 -0
  36. package/dist/header/menu/header-menu-item-group.d.ts.map +1 -0
  37. package/dist/header/menu/header-menu-item-group.js +31 -0
  38. package/dist/header/menu/header-menu-item-group.js.map +1 -0
  39. package/dist/header/menu/header-menu-item.d.ts +9 -0
  40. package/dist/header/menu/header-menu-item.d.ts.map +1 -0
  41. package/dist/header/menu/header-menu-item.js +92 -0
  42. package/dist/header/menu/header-menu-item.js.map +1 -0
  43. package/dist/header/menu/index.d.ts +15 -0
  44. package/dist/header/menu/index.d.ts.map +1 -0
  45. package/dist/header/menu/index.js +170 -0
  46. package/dist/header/menu/index.js.map +1 -0
  47. package/dist/header/mobile-header.d.ts +9 -0
  48. package/dist/header/mobile-header.d.ts.map +1 -0
  49. package/dist/header/mobile-header.js +46 -0
  50. package/dist/header/mobile-header.js.map +1 -0
  51. package/dist/header/post-title-setter.d.ts +6 -0
  52. package/dist/header/post-title-setter.d.ts.map +1 -0
  53. package/dist/header/post-title-setter.js +22 -0
  54. package/dist/header/post-title-setter.js.map +1 -0
  55. package/dist/header/shared-components.d.ts +31 -0
  56. package/dist/header/shared-components.d.ts.map +1 -0
  57. package/dist/header/shared-components.js +256 -0
  58. package/dist/header/shared-components.js.map +1 -0
  59. package/dist/hooks/index.d.ts +4 -0
  60. package/dist/hooks/index.d.ts.map +1 -0
  61. package/dist/hooks/index.js +36 -0
  62. package/dist/hooks/index.js.map +1 -0
  63. package/dist/hooks/use-is-at-top.d.ts +3 -0
  64. package/dist/hooks/use-is-at-top.d.ts.map +1 -0
  65. package/dist/hooks/use-is-at-top.js +26 -0
  66. package/dist/hooks/use-is-at-top.js.map +1 -0
  67. package/dist/hooks/use-media-query.d.ts +7 -0
  68. package/dist/hooks/use-media-query.d.ts.map +1 -0
  69. package/dist/hooks/use-media-query.js +47 -0
  70. package/dist/hooks/use-media-query.js.map +1 -0
  71. package/dist/hooks/use-scroll-level.d.ts +11 -0
  72. package/dist/hooks/use-scroll-level.d.ts.map +1 -0
  73. package/dist/hooks/use-scroll-level.js +53 -0
  74. package/dist/hooks/use-scroll-level.js.map +1 -0
  75. package/dist/icons/index.d.ts +17 -0
  76. package/dist/icons/index.d.ts.map +1 -0
  77. package/dist/icons/index.js +341 -0
  78. package/dist/icons/index.js.map +1 -0
  79. package/dist/index.d.ts +10 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +101 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/styles.css +475 -0
  84. package/dist/types/index.d.ts +10 -0
  85. package/dist/types/index.d.ts.map +1 -0
  86. package/dist/types/index.js +6 -0
  87. package/dist/types/index.js.map +1 -0
  88. package/dist/utils/cn.d.ts +8 -0
  89. package/dist/utils/cn.d.ts.map +1 -0
  90. package/dist/utils/cn.js +27 -0
  91. package/dist/utils/cn.js.map +1 -0
  92. package/dist/utils/generate-social-media-config.d.ts +9 -0
  93. package/dist/utils/generate-social-media-config.d.ts.map +1 -0
  94. package/dist/utils/generate-social-media-config.js +55 -0
  95. package/dist/utils/generate-social-media-config.js.map +1 -0
  96. package/dist/utils/index.d.ts +3 -0
  97. package/dist/utils/index.d.ts.map +1 -0
  98. package/dist/utils/index.js +28 -0
  99. package/dist/utils/index.js.map +1 -0
  100. package/eslint.config.mjs +55 -0
  101. package/package.json +51 -0
  102. package/prettier.config.mjs +13 -0
  103. package/scripts/build.sh +18 -0
  104. package/src/components/button.tsx +108 -0
  105. package/src/components/index.tsx +2 -0
  106. package/src/components/input.tsx +171 -0
  107. package/src/constants/default-values.tsx +153 -0
  108. package/src/footer.tsx +151 -0
  109. package/src/header/desktop-header.tsx +128 -0
  110. package/src/header/header-context.tsx +56 -0
  111. package/src/header/index.tsx +96 -0
  112. package/src/header/menu/header-menu-item-group.tsx +37 -0
  113. package/src/header/menu/header-menu-item.tsx +132 -0
  114. package/src/header/menu/index.tsx +206 -0
  115. package/src/header/mobile-header.tsx +61 -0
  116. package/src/header/post-title-setter.tsx +22 -0
  117. package/src/header/shared-components.tsx +326 -0
  118. package/src/hooks/index.ts +3 -0
  119. package/src/hooks/use-is-at-top.ts +23 -0
  120. package/src/hooks/use-media-query.ts +57 -0
  121. package/src/hooks/use-scroll-level.ts +52 -0
  122. package/src/icons/index.tsx +358 -0
  123. package/src/index.ts +9 -0
  124. package/src/styles.css +475 -0
  125. package/src/types/index.ts +10 -0
  126. package/src/utils/cn.ts +41 -0
  127. package/src/utils/generate-social-media-config.ts +75 -0
  128. package/src/utils/index.ts +2 -0
  129. package/tsconfig.json +33 -0
@@ -0,0 +1,17 @@
1
+ # Build outputs
2
+ dist/
3
+ lib/
4
+ .next/
5
+
6
+ # Generated files
7
+ *.tsbuildinfo
8
+
9
+ # Cache
10
+ .eslintcache
11
+
12
+ # OS
13
+ .DS_Store
14
+
15
+ # Environment
16
+ .env*.local
17
+ .env
@@ -0,0 +1,31 @@
1
+ module.exports = {
2
+ presets: [
3
+ [
4
+ '@babel/preset-env',
5
+ {
6
+ targets: {
7
+ node: '18',
8
+ browsers: ['> 1%', 'last 2 versions', 'not dead'],
9
+ },
10
+ modules: 'commonjs', // Build CommonJS modules
11
+ },
12
+ ],
13
+ [
14
+ '@babel/preset-react',
15
+ {
16
+ runtime: 'automatic',
17
+ development: process.env.NODE_ENV === 'development',
18
+ pragma: undefined, // Use automatic runtime
19
+ pragmaFrag: undefined, // Use automatic runtime
20
+ },
21
+ ],
22
+ [
23
+ '@babel/preset-typescript',
24
+ {
25
+ isTSX: true,
26
+ allExtensions: true,
27
+ },
28
+ ],
29
+ ],
30
+ plugins: ['@babel/plugin-transform-runtime'],
31
+ }
@@ -0,0 +1,23 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import React from 'react';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "primary" | "secondary" | null | undefined;
5
+ size?: 44 | 36 | 32 | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export type ButtonProps = {
8
+ isLoading?: boolean;
9
+ disabled?: boolean;
10
+ asChild?: boolean;
11
+ children: React.ReactNode;
12
+ } & VariantProps<typeof buttonVariants> & React.ButtonHTMLAttributes<HTMLButtonElement>;
13
+ declare const Button: React.ForwardRefExoticComponent<{
14
+ isLoading?: boolean;
15
+ disabled?: boolean;
16
+ asChild?: boolean;
17
+ children: React.ReactNode;
18
+ } & VariantProps<(props?: ({
19
+ variant?: "primary" | "secondary" | null | undefined;
20
+ size?: 44 | 36 | 32 | null | undefined;
21
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
22
+ export default Button;
23
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,QAAA,MAAM,cAAc;;;8EA8BnB,CAAA;AAwBD,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,GACrC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;AAE/C,QAAA,MAAM,MAAM;gBAPE,OAAO;eACR,OAAO;cACR,OAAO;cACP,KAAK,CAAC,SAAS;;;;yKAuC1B,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _reactSlot = require("@radix-ui/react-slot");
10
+ var _classVarianceAuthority = require("class-variance-authority");
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var _cn = require("../utils/cn");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ const buttonVariants = (0, _classVarianceAuthority.cva)(
15
+ // Base styles
16
+ 'font-noto gap-2.5 font-bold inline-flex cursor-pointer items-center justify-center rounded-full transition-colors duration-200', {
17
+ variants: {
18
+ variant: {
19
+ primary: ['text-white border-0 bg-red-400', 'hover:bg-red-500', 'active:bg-red-600', 'disabled:bg-gray-400 disabled:text-white disabled:cursor-default'],
20
+ secondary: ['bg-white text-gray-900 border-2 border-red-400', 'hover:text-white hover:border-red-500 hover:bg-red-500', 'active:text-white active:border-red-600 active:bg-red-600', 'disabled:border-gray-400 disabled:bg-white disabled:text-gray-400 disabled:cursor-default']
21
+ },
22
+ size: {
23
+ 44: 'h-11 px-5 py-2 text-base',
24
+ // 44px height, 16px font size
25
+ 36: 'h-9 px-4 py-2 text-sm',
26
+ // 36px height, 14px font size
27
+ 32: 'h-8 px-3 py-1 text-sm' // 32px height, 14px font size
28
+ }
29
+ },
30
+ defaultVariants: {
31
+ variant: 'primary',
32
+ size: 44
33
+ }
34
+ });
35
+
36
+ // Loading spinner icon component
37
+ const LoadingSpinner = ({
38
+ size = 20
39
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
40
+ width: size,
41
+ height: size,
42
+ viewBox: "0 0 25 24",
43
+ fill: "none",
44
+ className: "animate-spin",
45
+ xmlns: "http://www.w3.org/2000/svg",
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
47
+ opacity: "0.5",
48
+ d: "M12.5 2C10.5222 2 8.58879 2.58649 6.9443 3.6853C5.29981 4.78412 4.01809 6.3459 3.26121 8.17317C2.50433 10.0004 2.3063 12.0111 2.69215 13.9509C3.078 15.8907 4.03041 17.6725 5.42894 19.0711C6.82746 20.4696 8.60929 21.422 10.5491 21.8079C12.4889 22.1937 14.4996 21.9957 16.3268 21.2388C18.1541 20.4819 19.7159 19.2002 20.8147 17.5557C21.9135 15.9112 22.5 13.9778 22.5 12C22.5 10.6868 22.2413 9.38642 21.7388 8.17317C21.2363 6.95991 20.4997 5.85752 19.5711 4.92893C18.6425 4.00035 17.5401 3.26375 16.3268 2.7612C15.1136 2.25866 13.8132 2 12.5 2ZM12.5 20C10.9178 20 9.37104 19.5308 8.05544 18.6518C6.73985 17.7727 5.71447 16.5233 5.10897 15.0615C4.50347 13.5997 4.34504 11.9911 4.65372 10.4393C4.9624 8.88743 5.72433 7.46197 6.84315 6.34315C7.96197 5.22433 9.38743 4.4624 10.9393 4.15372C12.4911 3.84504 14.0997 4.00346 15.5615 4.60896C17.0233 5.21447 18.2727 6.23984 19.1518 7.55544C20.0308 8.87103 20.5 10.4177 20.5 12C20.5 14.1217 19.6572 16.1566 18.1569 17.6569C16.6566 19.1571 14.6217 20 12.5 20Z",
49
+ fill: "currentColor"
50
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
51
+ d: "M20.5 12H22.5C22.5 10.6868 22.2413 9.38642 21.7388 8.17317C21.2362 6.95991 20.4997 5.85752 19.5711 4.92893C18.6425 4.00035 17.5401 3.26375 16.3268 2.7612C15.1136 2.25866 13.8132 2 12.5 2V4C14.6217 4 16.6566 4.84285 18.1569 6.34315C19.6571 7.84344 20.5 9.87827 20.5 12Z",
52
+ fill: "currentColor"
53
+ })]
54
+ });
55
+ const Button = /*#__PURE__*/_react.default.forwardRef(({
56
+ isLoading = false,
57
+ disabled = false,
58
+ asChild = false,
59
+ size,
60
+ variant,
61
+ className,
62
+ children,
63
+ ...props
64
+ }, ref) => {
65
+ const isDisabled = disabled || isLoading;
66
+ const buttonClasses = (0, _cn.cn)(buttonVariants({
67
+ variant,
68
+ size
69
+ }), className);
70
+ const Comp = asChild ? _reactSlot.Slot : 'button';
71
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
72
+ ref: ref,
73
+ className: buttonClasses,
74
+ disabled: isDisabled,
75
+ ...props,
76
+ children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LoadingSpinner, {
77
+ size: size === 32 ? 16 : size === 36 ? 18 : 20
78
+ }) : children
79
+ });
80
+ });
81
+ var _default = exports.default = Button;
82
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","names":["_interopRequireDefault","require","Object","defineProperty","exports","value","default","_reactSlot","_classVarianceAuthority","_react","_cn","_jsxRuntime","buttonVariants","cva","variants","variant","primary","secondary","size","defaultVariants","LoadingSpinner","jsxs","width","height","viewBox","fill","className","xmlns","children","jsx","opacity","d","Button","React","forwardRef","isLoading","disabled","asChild","props","ref","isDisabled","buttonClasses","cn","Comp","Slot","_default"],"sources":["../../src/components/button.tsx"],"sourcesContent":["'use client'\n\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport React from 'react'\n\nimport { cn } from '../utils/cn'\n\nconst buttonVariants = cva(\n // Base styles\n 'font-noto gap-2.5 font-bold inline-flex cursor-pointer items-center justify-center rounded-full transition-colors duration-200',\n {\n variants: {\n variant: {\n primary: [\n 'text-white border-0 bg-red-400',\n 'hover:bg-red-500',\n 'active:bg-red-600',\n 'disabled:bg-gray-400 disabled:text-white disabled:cursor-default',\n ],\n secondary: [\n 'bg-white text-gray-900 border-2 border-red-400',\n 'hover:text-white hover:border-red-500 hover:bg-red-500',\n 'active:text-white active:border-red-600 active:bg-red-600',\n 'disabled:border-gray-400 disabled:bg-white disabled:text-gray-400 disabled:cursor-default',\n ],\n },\n size: {\n 44: 'h-11 px-5 py-2 text-base', // 44px height, 16px font size\n 36: 'h-9 px-4 py-2 text-sm', // 36px height, 14px font size\n 32: 'h-8 px-3 py-1 text-sm', // 32px height, 14px font size\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 44,\n },\n }\n)\n\n// Loading spinner icon component\nconst LoadingSpinner = ({ size = 20 }: { size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 25 24\"\n fill=\"none\"\n className=\"animate-spin\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n opacity=\"0.5\"\n d=\"M12.5 2C10.5222 2 8.58879 2.58649 6.9443 3.6853C5.29981 4.78412 4.01809 6.3459 3.26121 8.17317C2.50433 10.0004 2.3063 12.0111 2.69215 13.9509C3.078 15.8907 4.03041 17.6725 5.42894 19.0711C6.82746 20.4696 8.60929 21.422 10.5491 21.8079C12.4889 22.1937 14.4996 21.9957 16.3268 21.2388C18.1541 20.4819 19.7159 19.2002 20.8147 17.5557C21.9135 15.9112 22.5 13.9778 22.5 12C22.5 10.6868 22.2413 9.38642 21.7388 8.17317C21.2363 6.95991 20.4997 5.85752 19.5711 4.92893C18.6425 4.00035 17.5401 3.26375 16.3268 2.7612C15.1136 2.25866 13.8132 2 12.5 2ZM12.5 20C10.9178 20 9.37104 19.5308 8.05544 18.6518C6.73985 17.7727 5.71447 16.5233 5.10897 15.0615C4.50347 13.5997 4.34504 11.9911 4.65372 10.4393C4.9624 8.88743 5.72433 7.46197 6.84315 6.34315C7.96197 5.22433 9.38743 4.4624 10.9393 4.15372C12.4911 3.84504 14.0997 4.00346 15.5615 4.60896C17.0233 5.21447 18.2727 6.23984 19.1518 7.55544C20.0308 8.87103 20.5 10.4177 20.5 12C20.5 14.1217 19.6572 16.1566 18.1569 17.6569C16.6566 19.1571 14.6217 20 12.5 20Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M20.5 12H22.5C22.5 10.6868 22.2413 9.38642 21.7388 8.17317C21.2362 6.95991 20.4997 5.85752 19.5711 4.92893C18.6425 4.00035 17.5401 3.26375 16.3268 2.7612C15.1136 2.25866 13.8132 2 12.5 2V4C14.6217 4 16.6566 4.84285 18.1569 6.34315C19.6571 7.84344 20.5 9.87827 20.5 12Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nexport type ButtonProps = {\n isLoading?: boolean\n disabled?: boolean\n asChild?: boolean\n children: React.ReactNode\n} & VariantProps<typeof buttonVariants> &\n React.ButtonHTMLAttributes<HTMLButtonElement>\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n isLoading = false,\n disabled = false,\n asChild = false,\n size,\n variant,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const isDisabled = disabled || isLoading\n\n const buttonClasses = cn(buttonVariants({ variant, size }), className)\n\n const Comp = asChild ? Slot : 'button'\n\n return (\n <Comp\n ref={ref}\n className={buttonClasses}\n disabled={isDisabled}\n {...props}\n >\n {isLoading ? (\n <LoadingSpinner size={size === 32 ? 16 : size === 36 ? 18 : 20} />\n ) : (\n children\n )}\n </Comp>\n )\n }\n)\n\nexport default Button\n"],"mappings":";AAAA,YAAY;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,KAAA;AAAA;AAAAD,OAAA,CAAAE,OAAA;AAEZ,IAAAC,UAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,IAAAS,GAAA,GAAAT,OAAA;AAAgC,IAAAU,WAAA,GAAAV,OAAA;AAEhC,MAAMW,cAAc,GAAG,IAAAC,2BAAG;AACxB;AACA,gIAAgI,EAChI;EACEC,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,OAAO,EAAE,CACP,gCAAgC,EAChC,kBAAkB,EAClB,mBAAmB,EACnB,kEAAkE,CACnE;MACDC,SAAS,EAAE,CACT,gDAAgD,EAChD,wDAAwD,EACxD,2DAA2D,EAC3D,2FAA2F;IAE/F,CAAC;IACDC,IAAI,EAAE;MACJ,EAAE,EAAE,0BAA0B;MAAE;MAChC,EAAE,EAAE,uBAAuB;MAAE;MAC7B,EAAE,EAAE,uBAAuB,CAAE;IAC/B;EACF,CAAC;EACDC,eAAe,EAAE;IACfJ,OAAO,EAAE,SAAS;IAClBG,IAAI,EAAE;EACR;AACF,CACF,CAAC;;AAED;AACA,MAAME,cAAc,GAAGA,CAAC;EAAEF,IAAI,GAAG;AAAsB,CAAC,kBACtD,IAAAP,WAAA,CAAAU,IAAA;EACEC,KAAK,EAAEJ,IAAK;EACZK,MAAM,EAAEL,IAAK;EACbM,OAAO,EAAC,WAAW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1,3 @@
1
+ export { default as Button } from './button';
2
+ export { default as Input } from './input';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "Button", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _button.default;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "Input", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _input.default;
17
+ }
18
+ });
19
+ var _button = _interopRequireDefault(require("./button"));
20
+ var _input = _interopRequireDefault(require("./input"));
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_button","_interopRequireDefault","require","_input"],"sources":["../../src/components/index.tsx"],"sourcesContent":["export { default as Button } from './button'\nexport { default as Input } from './input'\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA"}
@@ -0,0 +1,20 @@
1
+ export type InputProps = {
2
+ placeholder?: string;
3
+ value?: string;
4
+ onChange?: (value: string) => void;
5
+ onClear?: () => void;
6
+ showClearButton?: boolean;
7
+ children?: React.ReactNode;
8
+ inputRef?: React.RefObject<HTMLInputElement>;
9
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'>;
10
+ declare const Input: import("react").ForwardRefExoticComponent<{
11
+ placeholder?: string;
12
+ value?: string;
13
+ onChange?: (value: string) => void;
14
+ onClear?: () => void;
15
+ showClearButton?: boolean;
16
+ children?: React.ReactNode;
17
+ inputRef?: React.RefObject<HTMLInputElement>;
18
+ } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> & import("react").RefAttributes<HTMLInputElement>>;
19
+ export default Input;
20
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAiDA,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;CAC7C,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAA;AAE3E,QAAA,MAAM,KAAK;kBATK,MAAM;YACZ,MAAM;eACH,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;cACxB,MAAM,IAAI;sBACF,OAAO;eACd,KAAK,CAAC,SAAS;eACf,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC;wIAgH7C,CAAA;AAED,eAAe,KAAK,CAAA"}
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _classVarianceAuthority = require("class-variance-authority");
9
+ var _react = require("react");
10
+ var _icons = require("../icons");
11
+ var _cn = require("../utils/cn");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ // Close icon component
14
+ const CloseIcon = ({
15
+ className
16
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
17
+ width: "20",
18
+ height: "20",
19
+ viewBox: "0 0 20 20",
20
+ fill: "none",
21
+ className: className,
22
+ xmlns: "http://www.w3.org/2000/svg",
23
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
24
+ cx: "10",
25
+ cy: "10",
26
+ r: "10",
27
+ fill: "currentColor"
28
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
29
+ d: "M7 7l6 6M13 7l-6 6",
30
+ stroke: "white",
31
+ strokeWidth: "1.5",
32
+ strokeLinecap: "round",
33
+ strokeLinejoin: "round"
34
+ })]
35
+ });
36
+ const inputVariants = (0, _classVarianceAuthority.cva)(
37
+ // Base styles
38
+ 'prose-p1 desktop:bg-white! px-4 py-1.5 h-11 flex items-center rounded-full border border-transparent bg-neutral-100 transition-colors duration-200 hover:border-neutral-600', {
39
+ variants: {
40
+ state: {
41
+ default: 'border-transparent',
42
+ hover: 'border-neutral-600',
43
+ focus: 'border-neutral-600',
44
+ active: 'border-neutral-600',
45
+ unfocus: 'border-transparent',
46
+ error: 'border-red-600'
47
+ }
48
+ },
49
+ defaultVariants: {
50
+ state: 'default'
51
+ }
52
+ });
53
+ const Input = /*#__PURE__*/(0, _react.forwardRef)(({
54
+ placeholder = '搜尋更多新聞、議題',
55
+ value,
56
+ onChange,
57
+ onClear,
58
+ showClearButton = true,
59
+ className,
60
+ onFocus,
61
+ onBlur,
62
+ inputRef,
63
+ ...props
64
+ }, ref) => {
65
+ const [internalValue, setInternalValue] = (0, _react.useState)('');
66
+ const [isFocused, setIsFocused] = (0, _react.useState)(false);
67
+ const [isActive, setIsActive] = (0, _react.useState)(false);
68
+ const innerInputRef = (0, _react.useRef)(null);
69
+ const currentValue = value !== undefined ? value : internalValue;
70
+ const hasValue = currentValue.length > 0;
71
+
72
+ // Determine current state
73
+ const currentState = isFocused ? 'focus' : hasValue ? isActive ? 'active' : 'unfocus' : 'default';
74
+ const handleChange = e => {
75
+ const newValue = e.target.value;
76
+ if (onChange) {
77
+ onChange(newValue);
78
+ } else {
79
+ setInternalValue(newValue);
80
+ }
81
+ setIsActive(true);
82
+ };
83
+ const handleFocus = e => {
84
+ if (onFocus) {
85
+ onFocus(e);
86
+ }
87
+ setIsFocused(true);
88
+ setIsActive(true);
89
+ };
90
+ const handleBlur = e => {
91
+ if (onBlur) {
92
+ onBlur(e);
93
+ }
94
+ setIsFocused(false);
95
+ setIsActive(false);
96
+ };
97
+ const handleClear = e => {
98
+ e.preventDefault();
99
+ e.stopPropagation();
100
+ if (onChange) {
101
+ onChange('');
102
+ } else {
103
+ setInternalValue('');
104
+ }
105
+ if (onClear) {
106
+ onClear();
107
+ }
108
+ const currentRef = inputRef ?? innerInputRef;
109
+ currentRef.current?.focus();
110
+ };
111
+ const inputClasses = (0, _cn.cn)(inputVariants({
112
+ state: currentState
113
+ }), className);
114
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
115
+ className: "gap-2 flex flex-col",
116
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
117
+ className: inputClasses,
118
+ ref: ref,
119
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
120
+ className: "text-neutral-600",
121
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SearchIconSmall, {})
122
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
123
+ type: "text",
124
+ value: currentValue,
125
+ onChange: handleChange,
126
+ onFocus: handleFocus,
127
+ onBlur: handleBlur,
128
+ placeholder: placeholder,
129
+ className: "placeholder:font-medium ml-2 max-w-[72%] flex-1 flex-shrink-1 bg-transparent text-neutral-900 placeholder:text-neutral-400 focus:outline-none",
130
+ ref: inputRef ?? innerInputRef,
131
+ ...props
132
+ }), showClearButton && hasValue && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
133
+ type: "button",
134
+ onClick: handleClear,
135
+ className: "p-1/2 ml-auto flex-shrink-0 cursor-pointer rounded-full text-neutral-400 transition-colors hover:text-neutral-600 active:bg-neutral-200",
136
+ "aria-label": "Clear input",
137
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseIcon, {})
138
+ })]
139
+ })
140
+ });
141
+ });
142
+ var _default = exports.default = Input;
143
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","names":["Object","defineProperty","exports","value","default","_classVarianceAuthority","require","_react","_icons","_cn","_jsxRuntime","CloseIcon","className","jsxs","width","height","viewBox","fill","xmlns","children","jsx","cx","cy","r","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","inputVariants","cva","variants","state","hover","focus","active","unfocus","error","defaultVariants","Input","forwardRef","placeholder","onChange","onClear","showClearButton","onFocus","onBlur","inputRef","props","ref","internalValue","setInternalValue","useState","isFocused","setIsFocused","isActive","setIsActive","innerInputRef","useRef","currentValue","undefined","hasValue","length","currentState","handleChange","e","newValue","target","handleFocus","handleBlur","handleClear","preventDefault","stopPropagation","currentRef","current","inputClasses","cn","SearchIconSmall","type","onClick","_default"],"sources":["../../src/components/input.tsx"],"sourcesContent":["'use client'\n\nimport { cva } from 'class-variance-authority'\nimport { forwardRef, useRef, useState } from 'react'\n\nimport { SearchIconSmall } from '../icons'\nimport { cn } from '../utils/cn'\n\n// Close icon component\nconst CloseIcon = ({ className }: { className?: string }) => (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"10\" cy=\"10\" r=\"10\" fill=\"currentColor\" />\n <path\n d=\"M7 7l6 6M13 7l-6 6\"\n stroke=\"white\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n)\n\nconst inputVariants = cva(\n // Base styles\n 'prose-p1 desktop:bg-white! px-4 py-1.5 h-11 flex items-center rounded-full border border-transparent bg-neutral-100 transition-colors duration-200 hover:border-neutral-600',\n {\n variants: {\n state: {\n default: 'border-transparent',\n hover: 'border-neutral-600',\n focus: 'border-neutral-600',\n active: 'border-neutral-600',\n unfocus: 'border-transparent',\n error: 'border-red-600',\n },\n },\n defaultVariants: {\n state: 'default',\n },\n }\n)\n\nexport type InputProps = {\n placeholder?: string\n value?: string\n onChange?: (value: string) => void\n onClear?: () => void\n showClearButton?: boolean\n children?: React.ReactNode\n inputRef?: React.RefObject<HTMLInputElement>\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'>\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n placeholder = '搜尋更多新聞、議題',\n value,\n onChange,\n onClear,\n showClearButton = true,\n className,\n onFocus,\n onBlur,\n inputRef,\n ...props\n },\n ref\n ) => {\n const [internalValue, setInternalValue] = useState('')\n const [isFocused, setIsFocused] = useState(false)\n const [isActive, setIsActive] = useState(false)\n const innerInputRef = useRef<HTMLInputElement>(null)\n const currentValue = value !== undefined ? value : internalValue\n const hasValue = currentValue.length > 0\n\n // Determine current state\n const currentState = isFocused\n ? 'focus'\n : hasValue\n ? isActive\n ? 'active'\n : 'unfocus'\n : 'default'\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value\n if (onChange) {\n onChange(newValue)\n } else {\n setInternalValue(newValue)\n }\n setIsActive(true)\n }\n\n const handleFocus = (e: React.FocusEvent<HTMLInputElement>) => {\n if (onFocus) {\n onFocus(e)\n }\n setIsFocused(true)\n setIsActive(true)\n }\n\n const handleBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n if (onBlur) {\n onBlur(e)\n }\n setIsFocused(false)\n setIsActive(false)\n }\n\n const handleClear = (e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n\n if (onChange) {\n onChange('')\n } else {\n setInternalValue('')\n }\n if (onClear) {\n onClear()\n }\n\n const currentRef = inputRef ?? innerInputRef\n currentRef.current?.focus()\n }\n\n const inputClasses = cn(inputVariants({ state: currentState }), className)\n\n return (\n <div className=\"gap-2 flex flex-col\">\n <div className={inputClasses} ref={ref}>\n <div className=\"text-neutral-600\">\n <SearchIconSmall />\n </div>\n <input\n type=\"text\"\n value={currentValue}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n placeholder={placeholder}\n className=\"placeholder:font-medium ml-2 max-w-[72%] flex-1 flex-shrink-1 bg-transparent text-neutral-900 placeholder:text-neutral-400 focus:outline-none\"\n ref={inputRef ?? innerInputRef}\n {...props}\n />\n\n {showClearButton && hasValue && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"p-1/2 ml-auto flex-shrink-0 cursor-pointer rounded-full text-neutral-400 transition-colors hover:text-neutral-600 active:bg-neutral-200\"\n aria-label=\"Clear input\"\n >\n <CloseIcon />\n </button>\n )}\n </div>\n </div>\n )\n }\n)\n\nexport default Input\n"],"mappings":";AAAA,YAAY;;AAAAA,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,KAAA;AAAA;AAAAD,OAAA,CAAAE,OAAA;AAEZ,IAAAC,uBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,GAAA,GAAAH,OAAA;AAAgC,IAAAI,WAAA,GAAAJ,OAAA;AAEhC;AACA,MAAMK,SAAS,GAAGA,CAAC;EAAEC;AAAkC,CAAC,kBACtD,IAAAF,WAAA,CAAAG,IAAA;EACEC,KAAK,EAAC,IAAI;EACVC,MAAM,EAAC,IAAI;EACXC,OAAO,EAAC,WAAW;EACnBC,IAAI,EAAC,MAAM;EACXL,SAAS,EAAEA,SAAU;EACrBM,KAAK,EAAC,4BAA4B;EAAAC,QAAA,gBAElC,IAAAT,WAAA,CAAAU,GAAA;IAAQC,EAAE,EAAC,IAAI;IAACC,EAAE,EAAC,IAAI;IAACC,CAAC,EAAC,IAAI;IAACN,IAAI,EAAC;EAA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AE1E,oBACE,IAAAF,WAAA,CAAAU,GAAA;IAAKR,SAAS,EAAC,qBAAqB;IAAAO,QAAA,eAClC,IAAAT,WAAA,CAAAG,IAAA;MAAKD,SAAS,EAAE+D,YAAa;MAAC1B,GAAG,EAAEA,GAAI;MAAA9B,QAAA,gBACrC,IAAAT,WAAA,CAAAU,GAAA;QAAKR,SAAS,EAAC,kBAAkB;QAAAO,QAAA,eAC/B,IAAAT,WAAA,CAAAU,GAAA,EAACZ,MAAA,CAAAqE,eAAe,IAAE;MAAC,CAChB,CAAC,eACN,IAAAnE,WAAA,CAAAU,GAAA;QACE0D,IAAI,EAAC,MAAM;QACX3E,KAAK,EAAEwD,YAAa;QACpBjB,QAAQ,EAAEsB,YAAa;QACvBnB,OAAO,EAAEuB,WAAY;QACrBtB,MAAM,EAAEuB,UAAW;QACnB5B,WAAW,EAAEA,WAAY;QACzB7B,SAAS,EAAC,+IAA+I;QACzJqC,GAAG,EAAEF,QAAQ,IAAIU,aAAc;QAAA,GAC3BT;MAAK,CACV,CAAC,EAEDJ,eAAe,IAAIiB,QAAQ,iBAC1B,IAAAnD,WAAA,CAAAU,GAAA;QACE0D,IAAI,EAAC,QAAQ;QACbC,OAAO,EAAET,WAAY;QACrB1D,SAAS,EAAC,yIAAyI;QACnJ,cAAW,aAAa;QAAAO,QAAA,eAExB,IAAAT,WAAA,CAAAU,GAAA,EAACT,SAAS,IAAE;MAAC,CACP,CACT;IAAA,CACE;EAAC,CACH,CAAC;AAEV,CACF,CAAC;AAAA,IAAAqE,QAAA,GAAA9E,OAAA,CAAAE,OAAA,GAEcmC,KAAK"}
@@ -0,0 +1,12 @@
1
+ import { MenuItem } from '../types';
2
+ export declare const SUBSCRIBE_URL = "https://solink.soundon.fm/kidstwreporter";
3
+ export declare const DONATE_URL = "https://support.twreporter.org/";
4
+ export declare const PRIVACY_POLICY = "https://www.twreporter.org/a/privacy-policy";
5
+ export declare const SEARCH_PLACEHOLDER = "\u641C\u5C0B\u66F4\u591A\u65B0\u805E\u3001\u8B70\u984C";
6
+ export declare const MENU_ITEMS: MenuItem[];
7
+ export declare const ADDITIONAL_MENU_ITEMS: MenuItem[];
8
+ export declare const SOCIAL_MEDIA_ITEMS: {
9
+ label: string;
10
+ href: string;
11
+ }[];
12
+ //# sourceMappingURL=default-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-values.d.ts","sourceRoot":"","sources":["../../src/constants/default-values.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,eAAO,MAAM,aAAa,6CAA6C,CAAA;AACvE,eAAO,MAAM,UAAU,oCAAoC,CAAA;AAC3D,eAAO,MAAM,cAAc,gDAAgD,CAAA;AAC3E,eAAO,MAAM,kBAAkB,2DAAc,CAAA;AAE7C,eAAO,MAAM,UAAU,EAAE,QAAQ,EAoEhC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,QAAQ,EA+C3C,CAAA;AAED,eAAO,MAAM,kBAAkB;;;GAyB9B,CAAA"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SUBSCRIBE_URL = exports.SOCIAL_MEDIA_ITEMS = exports.SEARCH_PLACEHOLDER = exports.PRIVACY_POLICY = exports.MENU_ITEMS = exports.DONATE_URL = exports.ADDITIONAL_MENU_ITEMS = void 0;
7
+ var _icons = require("../icons");
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ const SUBSCRIBE_URL = exports.SUBSCRIBE_URL = 'https://solink.soundon.fm/kidstwreporter';
10
+ const DONATE_URL = exports.DONATE_URL = 'https://support.twreporter.org/';
11
+ const PRIVACY_POLICY = exports.PRIVACY_POLICY = 'https://www.twreporter.org/a/privacy-policy';
12
+ const SEARCH_PLACEHOLDER = exports.SEARCH_PLACEHOLDER = '搜尋更多新聞、議題';
13
+ const MENU_ITEMS = exports.MENU_ITEMS = [{
14
+ label: '最新',
15
+ href: '/all',
16
+ subItems: []
17
+ }, {
18
+ label: '專題',
19
+ href: '/topic/page',
20
+ subItems: []
21
+ }, {
22
+ label: '新聞',
23
+ href: '/category/news',
24
+ subItems: [{
25
+ label: '焦點新聞',
26
+ href: '/category/news/times'
27
+ }, {
28
+ label: '真的假的',
29
+ href: '/category/news/knowledge'
30
+ }, {
31
+ label: '人物故事',
32
+ href: '/category/news/story'
33
+ }, {
34
+ label: '文化報導',
35
+ href: '/category/news/explore'
36
+ }, {
37
+ label: '專欄',
38
+ href: '/category/news/column'
39
+ }, {
40
+ label: '英文新聞',
41
+ href: '/categories/news/english-version'
42
+ }]
43
+ }, {
44
+ label: '多媒體',
45
+ href: '/category/comics',
46
+ subItems: [{
47
+ label: '圖解新聞',
48
+ href: '/category/comics/times'
49
+ }, {
50
+ label: '新聞遊戲',
51
+ href: '/category/comics/test-news'
52
+ }, {
53
+ label: '圖文故事',
54
+ href: '/category/comics/graphic-story'
55
+ }]
56
+ }, {
57
+ label: '校園',
58
+ href: '/category/campus/news-classroom',
59
+ subItems: [{
60
+ label: '校園寶可夢',
61
+ href: '/category/campus/campus-pokemon'
62
+ }, {
63
+ label: '上課好好玩',
64
+ href: '/category/campus/teaching'
65
+ }, {
66
+ label: '小讀者連線',
67
+ href: '/category/campus/joining'
68
+ }]
69
+ }, {
70
+ label: 'Podcast',
71
+ href: '/category/listening-news',
72
+ subItems: [{
73
+ label: '小記者,問什麼?',
74
+ href: '/category/listening-news/kids-reporter-ask'
75
+ }, {
76
+ label: '新聞讀報',
77
+ href: '/category/listening-news/multilingual-listening-news'
78
+ }, {
79
+ label: '新聞關鍵字',
80
+ href: '/category/listening-news/listening-news-keywords'
81
+ }, {
82
+ label: '文化關鍵字',
83
+ href: '/category/listening-news/listening-news-culture-keywords'
84
+ }]
85
+ }, {
86
+ label: '教案',
87
+ href: '/category/classroom',
88
+ subItems: []
89
+ }];
90
+ const ADDITIONAL_MENU_ITEMS = exports.ADDITIONAL_MENU_ITEMS = [{
91
+ label: '閱讀探索設定',
92
+ href: '/reading-settings',
93
+ subItems: [],
94
+ showIcon: true,
95
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SettingsIconSmall, {})
96
+ }, {
97
+ label: '關於我們',
98
+ href: '/about',
99
+ subItems: []
100
+ }, {
101
+ label: '呼叫報導仔流程',
102
+ href: '/about#callkidsreporter',
103
+ subItems: []
104
+ }, {
105
+ label: '投稿專區',
106
+ href: 'https://forms.gle/49AEG8kFj7QWjgij8',
107
+ subItems: [],
108
+ external: true
109
+ }, {
110
+ label: '加入小記者',
111
+ href: 'https://forms.gle/eGq5jagNTwriwSCX6',
112
+ subItems: [],
113
+ external: true
114
+ }, {
115
+ label: '訂閱Podcast',
116
+ href: 'https://solink.soundon.fm/kidstwreporter',
117
+ subItems: [],
118
+ external: true
119
+ }, {
120
+ label: '聯絡我們',
121
+ href: '/about#mail',
122
+ subItems: []
123
+ }, {
124
+ label: '前往《報導者》',
125
+ href: 'https://www.twreporter.org/',
126
+ subItems: [],
127
+ external: true
128
+ }];
129
+ const SOCIAL_MEDIA_ITEMS = exports.SOCIAL_MEDIA_ITEMS = [{
130
+ label: 'Facebook',
131
+ href: 'https://www.facebook.com/twreporter/'
132
+ }, {
133
+ label: 'Instagram',
134
+ href: 'https://www.instagram.com/twreporter/'
135
+ }, {
136
+ label: 'YouTube',
137
+ href: 'https://www.youtube.com/@TwreporterOrg'
138
+ }, {
139
+ label: 'Threads',
140
+ href: 'https://www.threads.com/@twreporter'
141
+ }, {
142
+ label: 'Medium',
143
+ href: 'https://medium.com/twreporter'
144
+ }, {
145
+ label: 'RSS',
146
+ href: 'https://kids-storage.twreporter.org/rss/rss.xml'
147
+ }];
148
+ //# sourceMappingURL=default-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-values.js","names":["_icons","require","_jsxRuntime","SUBSCRIBE_URL","exports","DONATE_URL","PRIVACY_POLICY","SEARCH_PLACEHOLDER","MENU_ITEMS","label","href","subItems","ADDITIONAL_MENU_ITEMS","showIcon","icon","jsx","SettingsIconSmall","external","SOCIAL_MEDIA_ITEMS"],"sources":["../../src/constants/default-values.tsx"],"sourcesContent":["import { SettingsIconSmall } from '../icons'\nimport { MenuItem } from '../types'\n\nexport const SUBSCRIBE_URL = 'https://solink.soundon.fm/kidstwreporter'\nexport const DONATE_URL = 'https://support.twreporter.org/'\nexport const PRIVACY_POLICY = 'https://www.twreporter.org/a/privacy-policy'\nexport const SEARCH_PLACEHOLDER = '搜尋更多新聞、議題'\n\nexport const MENU_ITEMS: MenuItem[] = [\n {\n label: '最新',\n href: '/all',\n subItems: [],\n },\n {\n label: '專題',\n href: '/topic/page',\n subItems: [],\n },\n {\n label: '新聞',\n href: '/category/news',\n subItems: [\n { label: '焦點新聞', href: '/category/news/times' },\n { label: '真的假的', href: '/category/news/knowledge' },\n { label: '人物故事', href: '/category/news/story' },\n { label: '文化報導', href: '/category/news/explore' },\n { label: '專欄', href: '/category/news/column' },\n { label: '英文新聞', href: '/categories/news/english-version' },\n ],\n },\n {\n label: '多媒體',\n href: '/category/comics',\n subItems: [\n { label: '圖解新聞', href: '/category/comics/times' },\n { label: '新聞遊戲', href: '/category/comics/test-news' },\n { label: '圖文故事', href: '/category/comics/graphic-story' },\n ],\n },\n {\n label: '校園',\n href: '/category/campus/news-classroom',\n subItems: [\n { label: '校園寶可夢', href: '/category/campus/campus-pokemon' },\n { label: '上課好好玩', href: '/category/campus/teaching' },\n { label: '小讀者連線', href: '/category/campus/joining' },\n ],\n },\n {\n label: 'Podcast',\n href: '/category/listening-news',\n subItems: [\n {\n label: '小記者,問什麼?',\n href: '/category/listening-news/kids-reporter-ask',\n },\n {\n label: '新聞讀報',\n href: '/category/listening-news/multilingual-listening-news',\n },\n {\n label: '新聞關鍵字',\n href: '/category/listening-news/listening-news-keywords',\n },\n {\n label: '文化關鍵字',\n href: '/category/listening-news/listening-news-culture-keywords',\n },\n ],\n },\n {\n label: '教案',\n href: '/category/classroom',\n subItems: [],\n },\n]\n\nexport const ADDITIONAL_MENU_ITEMS: MenuItem[] = [\n {\n label: '閱讀探索設定',\n href: '/reading-settings',\n subItems: [],\n showIcon: true,\n icon: <SettingsIconSmall />,\n },\n {\n label: '關於我們',\n href: '/about',\n subItems: [],\n },\n {\n label: '呼叫報導仔流程',\n href: '/about#callkidsreporter',\n subItems: [],\n },\n {\n label: '投稿專區',\n href: 'https://forms.gle/49AEG8kFj7QWjgij8',\n subItems: [],\n external: true,\n },\n {\n label: '加入小記者',\n href: 'https://forms.gle/eGq5jagNTwriwSCX6',\n subItems: [],\n external: true,\n },\n {\n label: '訂閱Podcast',\n href: 'https://solink.soundon.fm/kidstwreporter',\n subItems: [],\n external: true,\n },\n {\n label: '聯絡我們',\n href: '/about#mail',\n subItems: [],\n },\n {\n label: '前往《報導者》',\n href: 'https://www.twreporter.org/',\n subItems: [],\n external: true,\n },\n]\n\nexport const SOCIAL_MEDIA_ITEMS = [\n {\n label: 'Facebook',\n href: 'https://www.facebook.com/twreporter/',\n },\n {\n label: 'Instagram',\n href: 'https://www.instagram.com/twreporter/',\n },\n {\n label: 'YouTube',\n href: 'https://www.youtube.com/@TwreporterOrg',\n },\n {\n label: 'Threads',\n href: 'https://www.threads.com/@twreporter',\n },\n {\n label: 'Medium',\n href: 'https://medium.com/twreporter',\n },\n {\n label: 'RSS',\n href: 'https://kids-storage.twreporter.org/rss/rss.xml',\n },\n]\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAA4C,IAAAC,WAAA,GAAAD,OAAA;AAGrC,MAAME,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,0CAA0C;AAChE,MAAME,UAAU,GAAAD,OAAA,CAAAC,UAAA,GAAG,iCAAiC;AACpD,MAAMC,cAAc,GAAAF,OAAA,CAAAE,cAAA,GAAG,6CAA6C;AACpE,MAAMC,kBAAkB,GAAAH,OAAA,CAAAG,kBAAA,GAAG,WAAW;AAEtC,MAAMC,UAAsB,GAAAJ,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Q,EAAE;AACZ,CAAC,EACD;EACEF,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE,6BAA6B;EACnCC,QAAQ,EAAE,EAAE;EACZM,QAAQ,EAAE;AACZ,CAAC,CACF;AAEM,MAAMC,kBAAkB,GAAAd,OAAA,CAAAc,kBAAA,GAAG,CAChC;EACET,KAAK,EAAE,UAAU;EACjBC,IAAI,EAAE;AACR,CAAC,EACD;EACED,KAAK,EAAE,WAAW;EAClBC,IAAI,EAAE;AACR,CAAC,EACD;EACED,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE;AACR,CAAC,EACD;EACED,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE;AACR,CAAC,EACD;EACED,KAAK,EAAE,QAAQ;EACfC,IAAI,EAAE;AACR,CAAC,EACD;EACED,KAAK,EAAE,KAAK;EACZC,IAAI,EAAE;AACR,CAAC,CACF"}
@@ -0,0 +1,10 @@
1
+ import { MenuItem, SocialMediaHrefs } from './types';
2
+ type FooterProps = {
3
+ socialMediaHrefs?: SocialMediaHrefs;
4
+ additionalMenuItems?: MenuItem[];
5
+ donateUrl?: string;
6
+ privacyPolicyUrl?: string;
7
+ };
8
+ declare const Footer: ({ socialMediaHrefs, additionalMenuItems, donateUrl, privacyPolicyUrl, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default Footer;
10
+ //# sourceMappingURL=footer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAGpD,KAAK,WAAW,GAAG;IACjB,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,mBAAmB,CAAC,EAAE,QAAQ,EAAE,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,QAAA,MAAM,MAAM,GAAI,yEAKb,WAAW,4CA0Hb,CAAA;AAED,eAAe,MAAM,CAAA"}