@yamatozhen/design_system 1.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 (87) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +101 -0
  3. package/package.json +49 -0
  4. package/scripts/postinstall.js +105 -0
  5. package/template/app/ClientNav.tsx +310 -0
  6. package/template/app/globals.css +167 -0
  7. package/template/app/layout.tsx +128 -0
  8. package/template/app/themes/dark-mc.css +51 -0
  9. package/template/app/themes/dark.css +51 -0
  10. package/template/app/themes/light-mc.css +51 -0
  11. package/template/app/themes/light.css +51 -0
  12. package/template/app/themes/theme.css +82 -0
  13. package/template/components/layout/Lightbox/LightboxCard.tsx +100 -0
  14. package/template/components/layout/Lightbox/LightboxGallery.module.css +249 -0
  15. package/template/components/layout/Lightbox/LightboxGallery.tsx +72 -0
  16. package/template/components/layout/Lightbox/LightboxGrid.tsx +186 -0
  17. package/template/components/layout/Lightbox/LightboxModal.module.css +395 -0
  18. package/template/components/layout/Lightbox/LightboxModal.tsx +500 -0
  19. package/template/components/layout/Lightbox/demo.tsx +412 -0
  20. package/template/components/layout/Lightbox/index.ts +30 -0
  21. package/template/components/layout/Lightbox/types.ts +113 -0
  22. package/template/components/layout/Lightbox/useLightboxFilters.ts +140 -0
  23. package/template/components/layout/accordion/Accordion.module.css +149 -0
  24. package/template/components/layout/accordion/Accordion.tsx +114 -0
  25. package/template/components/layout/button/Button.module.css +305 -0
  26. package/template/components/layout/button/ButtonGroup.tsx +503 -0
  27. package/template/components/layout/button/FAB.tsx +118 -0
  28. package/template/components/layout/button/button.tsx +128 -0
  29. package/template/components/layout/button/drop.module.css +229 -0
  30. package/template/components/layout/button/drop.tsx +516 -0
  31. package/template/components/layout/hero/v1/heroSlideshow.module.css +107 -0
  32. package/template/components/layout/hero/v1/heroSlideshow.tsx +233 -0
  33. package/template/components/layout/modals/accessibilityModal/AccessibilityModal.module.css +126 -0
  34. package/template/components/layout/modals/accessibilityModal/AccessibilityModal.tsx +290 -0
  35. package/template/components/layout/modals/alert/Alert.tsx +188 -0
  36. package/template/components/layout/navigation/MioCard.module.css +88 -0
  37. package/template/components/layout/navigation/MioCard.tsx +266 -0
  38. package/template/components/layout/navigation/Wrap.tsx +41 -0
  39. package/template/components/layout/navigation/nav/Nav.module.css +508 -0
  40. package/template/components/layout/navigation/nav/Nav.tsx +167 -0
  41. package/template/components/layout/navigation/nav/NavBar.tsx +419 -0
  42. package/template/components/layout/navigation/nav/NavContext.tsx +259 -0
  43. package/template/components/layout/navigation/nav/NavItem.tsx +173 -0
  44. package/template/components/layout/navigation/nav/NavNew.module.css +373 -0
  45. package/template/components/layout/navigation/nav/NavRail.tsx +315 -0
  46. package/template/components/layout/navigation/nav/NavSection.tsx +102 -0
  47. package/template/components/layout/navigation/nav/NavTab.tsx +25 -0
  48. package/template/components/layout/navigation/nav/navftb/NavFTB.module.css +252 -0
  49. package/template/components/layout/navigation/nav/navftb/NavFTB.tsx +399 -0
  50. package/template/components/layout/navigation/nav/navftb/useTabIndicator.ts +484 -0
  51. package/template/components/layout/navigation/nav/navheader/NavHeader.module.css +59 -0
  52. package/template/components/layout/navigation/nav/navheader/NavHeader.tsx +478 -0
  53. package/template/components/layout/pages/loadingScreen.tsx +102 -0
  54. package/template/components/layout/pages/maintenance/Maintenance.tsx +53 -0
  55. package/template/components/layout/pages/maintenance/maintenance.module.css +163 -0
  56. package/template/components/layout/switch/Switch.module.css +102 -0
  57. package/template/components/layout/switch/Switch.tsx +48 -0
  58. package/template/components/tools/Divider.tsx +11 -0
  59. package/template/components/tools/ProgressiveBlur.tsx +73 -0
  60. package/template/components/tools/ReduceMotionContext.tsx +5 -0
  61. package/template/components/tools/Sinewave.tsx +199 -0
  62. package/template/components/tools/SinewaveProgress.tsx +135 -0
  63. package/template/components/tools/badge/Badge.tsx +28 -0
  64. package/template/components/tools/flubber.d.ts +7 -0
  65. package/template/components/tools/icon/SocialIcons.tsx +88 -0
  66. package/template/components/tools/icon/icon.module.css +0 -0
  67. package/template/components/tools/icon/icon.tsx +125 -0
  68. package/template/components/tools/mobileViewProvider.tsx +58 -0
  69. package/template/components/tools/react-bits/ClickSpark.tsx +177 -0
  70. package/template/components/tools/react-bits/FadeContent.tsx +90 -0
  71. package/template/components/tools/react-bits/GlareHover.tsx +73 -0
  72. package/template/components/tools/react-bits/GradientText/GradientText.css +70 -0
  73. package/template/components/tools/react-bits/GradientText/GradientText.tsx +44 -0
  74. package/template/components/tools/react-bits/Magnet.tsx +118 -0
  75. package/template/components/tools/react-bits/Stepper/Stepper.css +134 -0
  76. package/template/components/tools/react-bits/Stepper/Stepper.tsx +412 -0
  77. package/template/components/tools/ripple/ripple.css +41 -0
  78. package/template/components/tools/ripple/ripple.tsx +53 -0
  79. package/template/components/tools/shape/ShapeLoader.tsx +101 -0
  80. package/template/components/tools/shape/ShapeMorph.tsx +190 -0
  81. package/template/components/tools/shape/ShapePaths.ts +116 -0
  82. package/template/components/tools/switch/Switch.module.css +102 -0
  83. package/template/components/tools/switch/Switch.tsx +48 -0
  84. package/template/components/tools/useBodyScrollLock.tsx +27 -0
  85. package/template/components/tools/useImageColor.ts +47 -0
  86. package/template/components/tools/useNavSheetDrag.tsx +196 -0
  87. package/template/public/fonts/material-symbols/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.woff2 +0 -0
@@ -0,0 +1,90 @@
1
+ import { useRef, useEffect, useState, ReactNode } from "react";
2
+ import { useReduceMotion } from "@/components/tools/ReduceMotionContext";
3
+
4
+ interface FadeContentProps {
5
+ children: ReactNode;
6
+ blur?: boolean;
7
+ duration?: number;
8
+ easing?: string;
9
+ delay?: number;
10
+ threshold?: number;
11
+ initialOpacity?: number;
12
+ className?: string;
13
+ fadeFrom?: "top" | "bottom" | "left" | "right";
14
+ style?: React.CSSProperties;
15
+ }
16
+
17
+ const FadeContent: React.FC<FadeContentProps> = ({
18
+ fadeFrom = "bottom",
19
+ children,
20
+ blur = false,
21
+ duration = 1000,
22
+ easing = "ease-out",
23
+ delay = 0,
24
+ threshold = 0.1,
25
+ initialOpacity = 0,
26
+ className = "",
27
+ style,
28
+ }) => {
29
+ const [inView, setInView] = useState(false);
30
+ const ref = useRef<HTMLDivElement | null>(null);
31
+ const rm = useReduceMotion();
32
+
33
+ useEffect(() => {
34
+ if (rm) {
35
+ setInView(true);
36
+ return;
37
+ }
38
+
39
+ const element = ref.current;
40
+ if (!element) return;
41
+
42
+ const observer = new IntersectionObserver(
43
+ ([entry]) => {
44
+ if (entry.isIntersecting) {
45
+ observer.unobserve(element);
46
+ setTimeout(() => {
47
+ setInView(true);
48
+ }, delay);
49
+ }
50
+ },
51
+ { threshold },
52
+ );
53
+
54
+ observer.observe(element);
55
+
56
+ return () => observer.disconnect();
57
+ }, [threshold, delay, rm]);
58
+
59
+ return (
60
+ <div
61
+ ref={ref}
62
+ className={className}
63
+ style={{
64
+ display: "flex",
65
+ flexDirection: "column",
66
+ alignItems: "center",
67
+ width: "100%",
68
+ gap: "12px",
69
+ opacity: inView ? 1 : initialOpacity,
70
+ transition: `opacity ${rm ? 0 : duration}ms ${easing}, filter ${rm ? 0 : duration}ms ${easing}, transform ${rm ? 0 : duration}ms ${easing}`,
71
+ transform: inView
72
+ ? "none"
73
+ : fadeFrom === "top"
74
+ ? "translateY(-40px)"
75
+ : fadeFrom === "bottom"
76
+ ? "translateY(40px)"
77
+ : fadeFrom === "left"
78
+ ? "translateX(-40px)"
79
+ : "translateX(40px)",
80
+ filter: blur ? (inView ? "blur(0px)" : "blur(10px)") : "none",
81
+
82
+ ...style,
83
+ }}
84
+ >
85
+ {children}
86
+ </div>
87
+ );
88
+ };
89
+
90
+ export default FadeContent;
@@ -0,0 +1,73 @@
1
+ import React from "react";
2
+ import "./GlareHover.css";
3
+
4
+ interface GlareHoverProps {
5
+ width?: string;
6
+ height?: string;
7
+ background?: string;
8
+ borderRadius?: string;
9
+ borderColor?: string;
10
+ children?: React.ReactNode;
11
+ glareColor?: string;
12
+ glareOpacity?: number;
13
+ glareAngle?: number;
14
+ glareSize?: number;
15
+ transitionDuration?: number;
16
+ playOnce?: boolean;
17
+ className?: string;
18
+ style?: React.CSSProperties;
19
+ }
20
+
21
+ const GlareHover: React.FC<GlareHoverProps> = ({
22
+ width = "500px",
23
+ height = "500px",
24
+ background = "#000",
25
+ borderRadius = "10px",
26
+ borderColor = "#333",
27
+ children,
28
+ glareColor = "#ffffff",
29
+ glareOpacity = 0.5,
30
+ glareAngle = -45,
31
+ glareSize = 250,
32
+ transitionDuration = 650,
33
+ playOnce = false,
34
+ className = "",
35
+ style = {},
36
+ }) => {
37
+ const hex = glareColor.replace("#", "");
38
+ let rgba = glareColor;
39
+ if (/^[0-9A-Fa-f]{6}$/.test(hex)) {
40
+ const r = parseInt(hex.slice(0, 2), 16);
41
+ const g = parseInt(hex.slice(2, 4), 16);
42
+ const b = parseInt(hex.slice(4, 6), 16);
43
+ rgba = `rgba(${r}, ${g}, ${b}, ${glareOpacity})`;
44
+ } else if (/^[0-9A-Fa-f]{3}$/.test(hex)) {
45
+ const r = parseInt(hex[0] + hex[0], 16);
46
+ const g = parseInt(hex[1] + hex[1], 16);
47
+ const b = parseInt(hex[2] + hex[2], 16);
48
+ rgba = `rgba(${r}, ${g}, ${b}, ${glareOpacity})`;
49
+ }
50
+
51
+ const vars: React.CSSProperties & { [k: string]: string } = {
52
+ "--gh-width": width,
53
+ "--gh-height": height,
54
+ "--gh-bg": background,
55
+ "--gh-br": borderRadius,
56
+ "--gh-angle": `${glareAngle}deg`,
57
+ "--gh-duration": `${transitionDuration}ms`,
58
+ "--gh-size": `${glareSize}%`,
59
+ "--gh-rgba": rgba,
60
+ "--gh-border": borderColor,
61
+ };
62
+
63
+ return (
64
+ <div
65
+ className={`glare-hover ${playOnce ? 'glare-hover--play-once' : ''} ${className}`}
66
+ style={{ ...vars, ...style } as React.CSSProperties}
67
+ >
68
+ {children}
69
+ </div>
70
+ );
71
+ };
72
+
73
+ export default GlareHover;
@@ -0,0 +1,70 @@
1
+ .animated-gradient-text {
2
+ position: relative;
3
+ margin: 0 8px;
4
+ display: flex;
5
+ min-width: min-content;
6
+ max-width: max-content;
7
+ width: 100%;
8
+ flex-direction: row;
9
+ align-items: center;
10
+ justify-content: center;
11
+ border-radius: 0;
12
+ font-weight: 500;
13
+ backdrop-filter: blur(10px);
14
+ transition: box-shadow 0.5s ease-out;
15
+ overflow: hidden;
16
+ cursor: pointer;
17
+ }
18
+
19
+ .gradient-overlay {
20
+ position: absolute;
21
+ top: 0;
22
+ left: 0;
23
+ right: 0;
24
+ bottom: 0;
25
+ background-size: 300% 100%;
26
+ animation: gradient 2s linear infinite;
27
+ border-radius: inherit;
28
+ z-index: 0;
29
+ pointer-events: none;
30
+ }
31
+
32
+ .gradient-overlay::before {
33
+ content: "";
34
+ position: absolute;
35
+ left: 0;
36
+ top: 0;
37
+ border-radius: inherit;
38
+ width: calc(100%);
39
+ height: calc(100%);
40
+ left: 50%;
41
+ top: 50%;
42
+ transform: translate(-50%, -50%);
43
+ background-color: var(--sys-background);
44
+ z-index: -1;
45
+ }
46
+
47
+ @keyframes gradient {
48
+ 0% {
49
+ background-position: 0% 50%;
50
+ }
51
+
52
+ 50% {
53
+ background-position: 50% 50%;
54
+ }
55
+
56
+ 100% {
57
+ background-position: 100% 50%;
58
+ }
59
+ }
60
+
61
+ .text-content {
62
+ display: inline-block;
63
+ position: relative;
64
+ z-index: 2;
65
+ background-size: 300% 100%;
66
+ background-clip: text;
67
+ -webkit-background-clip: text;
68
+ color: transparent;
69
+ animation: gradient 2s linear infinite;
70
+ }
@@ -0,0 +1,44 @@
1
+ import "./GradientText.css";
2
+ import { ReactNode } from "react";
3
+
4
+ interface GradientTextProps {
5
+ children: ReactNode;
6
+ className?: string;
7
+ animationSpeed?: number;
8
+ showBorder?: boolean;
9
+ fontSize?: string;
10
+ }
11
+
12
+ export default function GradientText({
13
+ fontSize = "",
14
+ children,
15
+ className = "",
16
+ animationSpeed = 8,
17
+ showBorder = false,
18
+ }: GradientTextProps) {
19
+ const colors = [
20
+ "var(--md-sys-color-surface-tint)",
21
+ "var(--md-sys-color-secondary)",
22
+ "var(--md-sys-color-tertiary)",
23
+ "var(--md-sys-color-secondary)",
24
+ "var(--md-sys-color-primary)",
25
+ "var(--md-sys-color-secondary)",
26
+ "var(--md-sys-color-tertiary)",
27
+ ];
28
+ const gradientStyle = {
29
+ fontSize: `${fontSize}`,
30
+ backgroundImage: `linear-gradient(to right, ${colors.join(", ")})`,
31
+ animationDuration: `${animationSpeed}s`,
32
+ };
33
+
34
+ return (
35
+ <div className={`animated-gradient-text ${className}`}>
36
+ {showBorder && (
37
+ <div className="gradient-overlay" style={gradientStyle}></div>
38
+ )}
39
+ <div className="text-content" style={gradientStyle}>
40
+ {children}
41
+ </div>
42
+ </div>
43
+ );
44
+ }
@@ -0,0 +1,118 @@
1
+ import React, {
2
+ useEffect,
3
+ useRef,
4
+ ReactNode,
5
+ HTMLAttributes,
6
+ } from "react";
7
+
8
+ interface MagnetProps extends HTMLAttributes<HTMLDivElement> {
9
+ children: ReactNode;
10
+ padding?: number;
11
+ disabled?: boolean;
12
+ magnetStrength?: number;
13
+ activeTransition?: string;
14
+ inactiveTransition?: string;
15
+ wrapperClassName?: string;
16
+ innerClassName?: string;
17
+ style?: React.CSSProperties;
18
+ }
19
+
20
+ const Magnet: React.FC<MagnetProps> = ({
21
+ children,
22
+ padding = 100,
23
+ disabled = false,
24
+ magnetStrength = 2,
25
+ activeTransition = "transform 0.5s ease-out",
26
+ inactiveTransition = "transform 0.5s ease-in-out",
27
+ wrapperClassName = "",
28
+ innerClassName = "",
29
+ style = {},
30
+ ...props
31
+ }) => {
32
+ const magnetRef = useRef<HTMLDivElement>(null);
33
+ const innerRef = useRef<HTMLDivElement>(null);
34
+ // Cached rect — kept fresh by ResizeObserver, never read inside mousemove
35
+ const rectRef = useRef<DOMRect | null>(null);
36
+ const isActiveRef = useRef(false);
37
+
38
+ useEffect(() => {
39
+ const el = magnetRef.current;
40
+ const inner = innerRef.current;
41
+ if (!el || !inner) return;
42
+
43
+ const ro = new ResizeObserver(() => {
44
+ rectRef.current = el.getBoundingClientRect();
45
+ });
46
+ ro.observe(el);
47
+ rectRef.current = el.getBoundingClientRect();
48
+
49
+ // Viewport position changes on scroll — keep the cache current
50
+ const handleScroll = () => {
51
+ rectRef.current = el.getBoundingClientRect();
52
+ };
53
+ window.addEventListener("scroll", handleScroll, { passive: true });
54
+
55
+ const handleMouseMove = (e: MouseEvent) => {
56
+ if (disabled) return;
57
+ const rect = rectRef.current;
58
+ if (!rect) return;
59
+
60
+ const centerX = rect.left + rect.width / 2;
61
+ const centerY = rect.top + rect.height / 2;
62
+ const distX = Math.abs(centerX - e.clientX);
63
+ const distY = Math.abs(centerY - e.clientY);
64
+
65
+ if (distX < rect.width / 2 + padding && distY < rect.height / 2 + padding) {
66
+ const offsetX = (e.clientX - centerX) / magnetStrength;
67
+ const offsetY = (e.clientY - centerY) / magnetStrength;
68
+ if (!isActiveRef.current) {
69
+ isActiveRef.current = true;
70
+ inner.style.transition = activeTransition;
71
+ }
72
+ inner.style.transform = `translate3d(${offsetX}px, ${offsetY}px, 0)`;
73
+ } else if (isActiveRef.current) {
74
+ isActiveRef.current = false;
75
+ inner.style.transition = inactiveTransition;
76
+ inner.style.transform = `translate3d(0px, 0px, 0)`;
77
+ }
78
+ };
79
+
80
+ window.addEventListener("mousemove", handleMouseMove);
81
+ return () => {
82
+ ro.disconnect();
83
+ window.removeEventListener("scroll", handleScroll);
84
+ window.removeEventListener("mousemove", handleMouseMove);
85
+ };
86
+ }, [padding, disabled, magnetStrength, activeTransition, inactiveTransition]);
87
+
88
+ // Reset when disabled
89
+ useEffect(() => {
90
+ if (disabled && innerRef.current) {
91
+ innerRef.current.style.transition = inactiveTransition;
92
+ innerRef.current.style.transform = `translate3d(0px, 0px, 0)`;
93
+ }
94
+ }, [disabled, inactiveTransition]);
95
+
96
+ return (
97
+ <div
98
+ ref={magnetRef}
99
+ className={wrapperClassName}
100
+ style={{ position: "fixed", display: "block", ...style }}
101
+ {...props}
102
+ >
103
+ <div
104
+ ref={innerRef}
105
+ className={innerClassName}
106
+ style={{
107
+ transform: "translate3d(0px, 0px, 0)",
108
+ transition: inactiveTransition,
109
+ willChange: "transform",
110
+ }}
111
+ >
112
+ {children}
113
+ </div>
114
+ </div>
115
+ );
116
+ };
117
+
118
+ export default Magnet;
@@ -0,0 +1,134 @@
1
+ .outer-container {
2
+ display: flex;
3
+ min-height: 100%;
4
+ min-width: 400px;
5
+ flex: 1 1 0%;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ justify-content: center;
9
+ padding: 1rem;
10
+ }
11
+
12
+ @media (min-width: 640px) {
13
+ .outer-container {
14
+ aspect-ratio: 4 / 3;
15
+ }
16
+ }
17
+
18
+ @media (min-width: 768px) {
19
+ .outer-container {
20
+ aspect-ratio: 2 / 1;
21
+ }
22
+ }
23
+
24
+ .step-circle-container {
25
+ margin-left: auto;
26
+ margin-right: auto;
27
+ width: 100%;
28
+ max-width: 28rem;
29
+ border-radius: 2rem;
30
+ font-size: 16px;
31
+ background-color: var(--md-sys-color-surface-container-low);
32
+ }
33
+
34
+ /* ── Accessibility: Show Borders ──────────────────────────────────────────── */
35
+ [data-show-borders="true"] .step-circle-container {
36
+ border: var(--a11y-border);
37
+ }
38
+
39
+ .step-indicator-row {
40
+ display: flex;
41
+ width: 100%;
42
+ align-items: center;
43
+ padding: 2rem;
44
+ }
45
+
46
+ .step-content-default {
47
+ min-height: 5em;
48
+ height: auto;
49
+ position: relative;
50
+ overflow: hidden;
51
+ }
52
+
53
+ .step-default {
54
+ min-height: 5em;
55
+ position: relative;
56
+ color: var(--md-sys-color-on-surface);
57
+ padding-left: 2rem;
58
+ padding-right: 2rem;
59
+ p {
60
+ color: var(--md-sys-color-on-surface-variant);
61
+ }
62
+ }
63
+
64
+ .footer-container {
65
+ padding-left: 1rem;
66
+ padding-right: 1rem;
67
+ padding-bottom: 1rem;
68
+ }
69
+
70
+ .footer-nav {
71
+ margin-top: 2rem;
72
+ display: flex;
73
+ }
74
+
75
+ .footer-nav.spread {
76
+ justify-content: space-between;
77
+ }
78
+
79
+ .footer-nav.end {
80
+ justify-content: flex-end;
81
+ }
82
+ .next-button {
83
+ right: 0;
84
+ }
85
+ .step-indicator {
86
+ position: relative;
87
+ cursor: pointer;
88
+ outline: none;
89
+ }
90
+
91
+ .step-indicator-inner {
92
+ display: flex;
93
+ height: 2rem;
94
+ width: 2rem;
95
+ align-items: center;
96
+ justify-content: center;
97
+ border-radius: 9999px;
98
+ font-weight: 600;
99
+ }
100
+
101
+ .active-dot {
102
+ height: 0.75rem;
103
+ width: 0.75rem;
104
+ border-radius: 9999px;
105
+ background-color: var(--md-sys-color-on-primary);
106
+ }
107
+
108
+ .step-number {
109
+ font-size: 0.875rem;
110
+ }
111
+
112
+ .step-connector {
113
+ position: relative;
114
+ margin-left: 0.5rem;
115
+ margin-right: 0.5rem;
116
+ height: 0.125rem;
117
+ flex: 1;
118
+ overflow: hidden;
119
+ border-radius: 0.25rem;
120
+ background-color: var(--md-sys-color-surface-container);
121
+ }
122
+
123
+ .step-connector-inner {
124
+ position: absolute;
125
+ left: 0;
126
+ top: 0;
127
+ height: 100%;
128
+ }
129
+
130
+ .check-icon {
131
+ height: 1rem;
132
+ width: 1rem;
133
+ color: var(--md-sys-color-on-primary);
134
+ }