omnira-ui 0.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.
- package/LICENSE +21 -0
- package/README.md +145 -0
- package/cli/omnira-init.mjs +260 -0
- package/cli/presets.mjs +386 -0
- package/components/ui/AppStoreButton/AppStoreButton.module.css +87 -0
- package/components/ui/AppStoreButton/AppStoreButton.tsx +114 -0
- package/components/ui/AppStoreButton/index.ts +2 -0
- package/components/ui/Avatar/Avatar.module.css +76 -0
- package/components/ui/Avatar/Avatar.tsx +102 -0
- package/components/ui/Avatar/index.ts +2 -0
- package/components/ui/Badge/Badge.module.css +120 -0
- package/components/ui/Badge/Badge.tsx +25 -0
- package/components/ui/Badge/index.ts +2 -0
- package/components/ui/BadgeGroup/BadgeGroup.module.css +214 -0
- package/components/ui/BadgeGroup/BadgeGroup.tsx +88 -0
- package/components/ui/BadgeGroup/index.ts +2 -0
- package/components/ui/Browser/Browser.module.css +105 -0
- package/components/ui/Browser/Browser.tsx +54 -0
- package/components/ui/Browser/index.ts +2 -0
- package/components/ui/Button/Button.module.css +188 -0
- package/components/ui/Button/Button.tsx +74 -0
- package/components/ui/Button/index.ts +2 -0
- package/components/ui/ButtonUtility/ButtonUtility.module.css +154 -0
- package/components/ui/ButtonUtility/ButtonUtility.tsx +65 -0
- package/components/ui/ButtonUtility/index.ts +2 -0
- package/components/ui/Card/Card.module.css +80 -0
- package/components/ui/Card/Card.tsx +39 -0
- package/components/ui/Card/index.ts +2 -0
- package/components/ui/Checkbox/Checkbox.module.css +92 -0
- package/components/ui/Checkbox/Checkbox.tsx +95 -0
- package/components/ui/Checkbox/index.ts +2 -0
- package/components/ui/Collapse/Collapse.module.css +60 -0
- package/components/ui/Collapse/Collapse.tsx +100 -0
- package/components/ui/Collapse/index.ts +2 -0
- package/components/ui/CreditCard/CreditCard.module.css +117 -0
- package/components/ui/CreditCard/CreditCard.tsx +86 -0
- package/components/ui/CreditCard/index.ts +2 -0
- package/components/ui/Dropdown/Dropdown.module.css +269 -0
- package/components/ui/Dropdown/Dropdown.tsx +419 -0
- package/components/ui/Dropdown/index.ts +31 -0
- package/components/ui/GridLines/GridLines.module.css +95 -0
- package/components/ui/GridLines/GridLines.tsx +10 -0
- package/components/ui/GridLines/index.ts +1 -0
- package/components/ui/Illustration/Illustration.module.css +10 -0
- package/components/ui/Illustration/Illustration.tsx +96 -0
- package/components/ui/Illustration/index.ts +2 -0
- package/components/ui/Input/Input.module.css +217 -0
- package/components/ui/Input/Input.tsx +93 -0
- package/components/ui/Input/index.ts +2 -0
- package/components/ui/Phone/Phone.module.css +104 -0
- package/components/ui/Phone/Phone.tsx +54 -0
- package/components/ui/Phone/index.ts +2 -0
- package/components/ui/PinInput/PinInput.module.css +104 -0
- package/components/ui/PinInput/PinInput.tsx +210 -0
- package/components/ui/PinInput/index.ts +1 -0
- package/components/ui/ProgressBar/ProgressBar.module.css +180 -0
- package/components/ui/ProgressBar/ProgressBar.tsx +206 -0
- package/components/ui/ProgressBar/index.ts +2 -0
- package/components/ui/QRCode/QRCode.module.css +13 -0
- package/components/ui/QRCode/QRCode.tsx +128 -0
- package/components/ui/QRCode/index.ts +2 -0
- package/components/ui/RadioButton/RadioButton.module.css +92 -0
- package/components/ui/RadioButton/RadioButton.tsx +134 -0
- package/components/ui/RadioButton/index.ts +2 -0
- package/components/ui/RadioGroup/RadioGroup.module.css +382 -0
- package/components/ui/RadioGroup/RadioGroup.tsx +292 -0
- package/components/ui/RadioGroup/index.ts +1 -0
- package/components/ui/Rating/Rating.module.css +99 -0
- package/components/ui/Rating/Rating.tsx +123 -0
- package/components/ui/Rating/index.ts +2 -0
- package/components/ui/Select/Select.module.css +371 -0
- package/components/ui/Select/Select.tsx +507 -0
- package/components/ui/Select/index.ts +2 -0
- package/components/ui/SidebarNavigation/SidebarDual.tsx +71 -0
- package/components/ui/SidebarNavigation/SidebarFeatureCard.module.css +351 -0
- package/components/ui/SidebarNavigation/SidebarFeatureCard.tsx +388 -0
- package/components/ui/SidebarNavigation/SidebarNavigation.module.css +610 -0
- package/components/ui/SidebarNavigation/SidebarParts.tsx +215 -0
- package/components/ui/SidebarNavigation/SidebarSectionDividers.tsx +46 -0
- package/components/ui/SidebarNavigation/SidebarSectionHeadings.tsx +52 -0
- package/components/ui/SidebarNavigation/SidebarSimple.tsx +46 -0
- package/components/ui/SidebarNavigation/SidebarSlim.tsx +48 -0
- package/components/ui/SidebarNavigation/index.ts +29 -0
- package/components/ui/SidebarNavigation/types.ts +27 -0
- package/components/ui/Slider/Slider.module.css +93 -0
- package/components/ui/Slider/Slider.tsx +118 -0
- package/components/ui/Slider/index.ts +2 -0
- package/components/ui/SocialButton/SocialButton.module.css +223 -0
- package/components/ui/SocialButton/SocialButton.tsx +185 -0
- package/components/ui/SocialButton/index.ts +2 -0
- package/components/ui/Tag/Tag.module.css +203 -0
- package/components/ui/Tag/Tag.tsx +161 -0
- package/components/ui/Tag/index.ts +2 -0
- package/components/ui/TextEditor/TextEditor.module.css +182 -0
- package/components/ui/TextEditor/TextEditor.tsx +323 -0
- package/components/ui/TextEditor/index.ts +1 -0
- package/components/ui/Textarea/Textarea.module.css +75 -0
- package/components/ui/Textarea/Textarea.tsx +59 -0
- package/components/ui/Textarea/index.ts +2 -0
- package/components/ui/Toggle/Toggle.module.css +118 -0
- package/components/ui/Toggle/Toggle.tsx +77 -0
- package/components/ui/Toggle/index.ts +2 -0
- package/components/ui/Tooltip/Tooltip.module.css +95 -0
- package/components/ui/Tooltip/Tooltip.tsx +55 -0
- package/components/ui/Tooltip/index.ts +2 -0
- package/components/ui/VideoPlayer/VideoPlayer.module.css +120 -0
- package/components/ui/VideoPlayer/VideoPlayer.tsx +229 -0
- package/components/ui/VideoPlayer/index.ts +2 -0
- package/lib/cn.ts +3 -0
- package/lib/copy-to-clipboard.ts +21 -0
- package/package.json +61 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.lines {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 0;
|
|
4
|
+
bottom: 0;
|
|
5
|
+
left: 50%;
|
|
6
|
+
transform: translateX(-50%);
|
|
7
|
+
width: 100%;
|
|
8
|
+
max-width: 1200px;
|
|
9
|
+
padding: 0 40px;
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
z-index: 0;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* ── Vertical lines (left + right rails) ── */
|
|
18
|
+
.lines span {
|
|
19
|
+
width: 1px;
|
|
20
|
+
height: 100%;
|
|
21
|
+
background: var(--color-grid-line);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* ── Top horizontal line ── */
|
|
25
|
+
.lines::before {
|
|
26
|
+
content: "";
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: 0;
|
|
29
|
+
left: -100vw;
|
|
30
|
+
right: -100vw;
|
|
31
|
+
height: 1px;
|
|
32
|
+
background: var(--color-grid-line);
|
|
33
|
+
mask-image: linear-gradient(
|
|
34
|
+
to right,
|
|
35
|
+
transparent 0%,
|
|
36
|
+
rgba(0, 0, 0, 0.15) 20%,
|
|
37
|
+
black 35%,
|
|
38
|
+
black 65%,
|
|
39
|
+
rgba(0, 0, 0, 0.15) 80%,
|
|
40
|
+
transparent 100%
|
|
41
|
+
);
|
|
42
|
+
-webkit-mask-image: linear-gradient(
|
|
43
|
+
to right,
|
|
44
|
+
transparent 0%,
|
|
45
|
+
rgba(0, 0, 0, 0.15) 20%,
|
|
46
|
+
black 35%,
|
|
47
|
+
black 65%,
|
|
48
|
+
rgba(0, 0, 0, 0.15) 80%,
|
|
49
|
+
transparent 100%
|
|
50
|
+
);
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* ── Bottom horizontal line ── */
|
|
55
|
+
.lines::after {
|
|
56
|
+
content: "";
|
|
57
|
+
position: absolute;
|
|
58
|
+
bottom: 0;
|
|
59
|
+
left: -100vw;
|
|
60
|
+
right: -100vw;
|
|
61
|
+
height: 1px;
|
|
62
|
+
background: var(--color-grid-line);
|
|
63
|
+
mask-image: linear-gradient(
|
|
64
|
+
to right,
|
|
65
|
+
transparent 0%,
|
|
66
|
+
rgba(0, 0, 0, 0.15) 20%,
|
|
67
|
+
black 35%,
|
|
68
|
+
black 65%,
|
|
69
|
+
rgba(0, 0, 0, 0.15) 80%,
|
|
70
|
+
transparent 100%
|
|
71
|
+
);
|
|
72
|
+
-webkit-mask-image: linear-gradient(
|
|
73
|
+
to right,
|
|
74
|
+
transparent 0%,
|
|
75
|
+
rgba(0, 0, 0, 0.15) 20%,
|
|
76
|
+
black 35%,
|
|
77
|
+
black 65%,
|
|
78
|
+
rgba(0, 0, 0, 0.15) 80%,
|
|
79
|
+
transparent 100%
|
|
80
|
+
);
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* ── Responsive ── */
|
|
85
|
+
@media (max-width: 1023px) {
|
|
86
|
+
.lines {
|
|
87
|
+
padding: 0 32px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (max-width: 767px) {
|
|
92
|
+
.lines {
|
|
93
|
+
padding: 0 20px;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GridLines } from "./GridLines";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { cn } from "@/lib/cn";
|
|
5
|
+
import styles from "./Illustration.module.css";
|
|
6
|
+
|
|
7
|
+
export interface IllustrationProps {
|
|
8
|
+
type?: "cloud" | "empty" | "error" | "success" | "search" | "lock";
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const sizeDims: Record<string, number> = {
|
|
14
|
+
sm: 120,
|
|
15
|
+
md: 200,
|
|
16
|
+
lg: 280,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Illustration = forwardRef<HTMLDivElement, IllustrationProps>(
|
|
20
|
+
({ type = "cloud", size = "md", className }, ref) => {
|
|
21
|
+
const dim = sizeDims[size];
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
ref={ref}
|
|
26
|
+
className={cn(styles.wrap, className)}
|
|
27
|
+
style={{ width: dim, height: dim }}
|
|
28
|
+
>
|
|
29
|
+
<svg
|
|
30
|
+
width={dim}
|
|
31
|
+
height={dim}
|
|
32
|
+
viewBox="0 0 200 200"
|
|
33
|
+
fill="none"
|
|
34
|
+
className={styles.svg}
|
|
35
|
+
>
|
|
36
|
+
{illustrationPaths[type]}
|
|
37
|
+
</svg>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
Illustration.displayName = "Illustration";
|
|
44
|
+
|
|
45
|
+
const illustrationPaths: Record<string, React.ReactNode> = {
|
|
46
|
+
cloud: (
|
|
47
|
+
<>
|
|
48
|
+
<circle cx="100" cy="130" r="50" className="illustrationBg" fill="var(--color-bg-elevated)" />
|
|
49
|
+
<path d="M60 120C60 98 78 80 100 80C118 80 133 92 137 108C137 108 155 110 155 128C155 142 144 150 132 150H68C56 150 48 140 48 130C48 120 56 112 66 112" className="illustrationStroke" stroke="var(--color-lime)" strokeWidth="4" strokeLinecap="round" fill="none" />
|
|
50
|
+
<path d="M90 125L100 115L110 125" stroke="var(--color-lime)" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" />
|
|
51
|
+
<line x1="100" y1="115" x2="100" y2="140" stroke="var(--color-lime)" strokeWidth="3" strokeLinecap="round" />
|
|
52
|
+
</>
|
|
53
|
+
),
|
|
54
|
+
empty: (
|
|
55
|
+
<>
|
|
56
|
+
<circle cx="100" cy="110" r="60" fill="var(--color-bg-elevated)" />
|
|
57
|
+
<rect x="70" y="75" width="60" height="70" rx="6" stroke="var(--color-text-tertiary)" strokeWidth="3" fill="none" />
|
|
58
|
+
<line x1="82" y1="95" x2="118" y2="95" stroke="var(--color-text-tertiary)" strokeWidth="2.5" strokeLinecap="round" />
|
|
59
|
+
<line x1="82" y1="105" x2="110" y2="105" stroke="var(--color-text-tertiary)" strokeWidth="2.5" strokeLinecap="round" />
|
|
60
|
+
<line x1="82" y1="115" x2="100" y2="115" stroke="var(--color-text-tertiary)" strokeWidth="2.5" strokeLinecap="round" />
|
|
61
|
+
<circle cx="100" cy="160" r="4" fill="var(--color-text-tertiary)" opacity="0.4" />
|
|
62
|
+
<circle cx="115" cy="165" r="2.5" fill="var(--color-text-tertiary)" opacity="0.3" />
|
|
63
|
+
<circle cx="85" cy="163" r="3" fill="var(--color-text-tertiary)" opacity="0.25" />
|
|
64
|
+
</>
|
|
65
|
+
),
|
|
66
|
+
error: (
|
|
67
|
+
<>
|
|
68
|
+
<circle cx="100" cy="110" r="60" fill="var(--color-bg-elevated)" />
|
|
69
|
+
<circle cx="100" cy="105" r="35" stroke="#ef4444" strokeWidth="4" fill="none" />
|
|
70
|
+
<line x1="100" y1="88" x2="100" y2="108" stroke="#ef4444" strokeWidth="4" strokeLinecap="round" />
|
|
71
|
+
<circle cx="100" cy="118" r="2.5" fill="#ef4444" />
|
|
72
|
+
</>
|
|
73
|
+
),
|
|
74
|
+
success: (
|
|
75
|
+
<>
|
|
76
|
+
<circle cx="100" cy="110" r="60" fill="var(--color-bg-elevated)" />
|
|
77
|
+
<circle cx="100" cy="105" r="35" stroke="var(--color-lime)" strokeWidth="4" fill="none" />
|
|
78
|
+
<path d="M85 105L95 115L115 95" stroke="var(--color-lime)" strokeWidth="4" strokeLinecap="round" strokeLinejoin="round" />
|
|
79
|
+
</>
|
|
80
|
+
),
|
|
81
|
+
search: (
|
|
82
|
+
<>
|
|
83
|
+
<circle cx="100" cy="110" r="60" fill="var(--color-bg-elevated)" />
|
|
84
|
+
<circle cx="95" cy="100" r="25" stroke="var(--color-text-tertiary)" strokeWidth="4" fill="none" />
|
|
85
|
+
<line x1="113" y1="118" x2="128" y2="133" stroke="var(--color-text-tertiary)" strokeWidth="4" strokeLinecap="round" />
|
|
86
|
+
</>
|
|
87
|
+
),
|
|
88
|
+
lock: (
|
|
89
|
+
<>
|
|
90
|
+
<circle cx="100" cy="110" r="60" fill="var(--color-bg-elevated)" />
|
|
91
|
+
<rect x="80" y="100" width="40" height="32" rx="4" stroke="var(--color-text-tertiary)" strokeWidth="3.5" fill="none" />
|
|
92
|
+
<path d="M88 100V92C88 85 93 80 100 80C107 80 112 85 112 92V100" stroke="var(--color-text-tertiary)" strokeWidth="3.5" strokeLinecap="round" fill="none" />
|
|
93
|
+
<circle cx="100" cy="114" r="3" fill="var(--color-text-tertiary)" />
|
|
94
|
+
</>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/* ── Wrapper ── */
|
|
2
|
+
.wrapper {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 6px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* ── Label ── */
|
|
10
|
+
.label {
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
text-transform: uppercase;
|
|
14
|
+
letter-spacing: 0.06em;
|
|
15
|
+
color: var(--color-text-tertiary);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.required {
|
|
19
|
+
color: var(--color-error);
|
|
20
|
+
margin-left: 2px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* ── Input Container ── */
|
|
24
|
+
.inputContainer {
|
|
25
|
+
position: relative;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
border-radius: var(--radius-md);
|
|
29
|
+
background: var(--color-bg-input);
|
|
30
|
+
border: 1px solid var(--color-border-standard);
|
|
31
|
+
transition: all 0.25s;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.inputContainer:focus-within {
|
|
35
|
+
border-color: var(--color-border-lime-strong);
|
|
36
|
+
background: var(--color-bg-elevated);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.containerError {
|
|
40
|
+
border-color: var(--color-error-border);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.containerError:focus-within {
|
|
44
|
+
border-color: var(--color-error);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.containerDisabled {
|
|
48
|
+
opacity: 0.5;
|
|
49
|
+
cursor: not-allowed;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ── Sizes (on container) ── */
|
|
54
|
+
.sm {
|
|
55
|
+
height: 36px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.sm .input {
|
|
59
|
+
font-size: 13px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.md {
|
|
63
|
+
height: 44px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.md .input {
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.lg {
|
|
71
|
+
height: 52px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.lg .input {
|
|
75
|
+
font-size: 16px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* ── Input ── */
|
|
79
|
+
.input {
|
|
80
|
+
flex: 1;
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 100%;
|
|
83
|
+
padding: 0 14px;
|
|
84
|
+
background: transparent;
|
|
85
|
+
border: none;
|
|
86
|
+
font-family: inherit;
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
color: var(--color-text-primary);
|
|
89
|
+
outline: none;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.input::placeholder {
|
|
94
|
+
color: var(--color-text-tertiary);
|
|
95
|
+
opacity: 0.5;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.input:-webkit-autofill,
|
|
99
|
+
.input:-webkit-autofill:hover,
|
|
100
|
+
.input:-webkit-autofill:focus {
|
|
101
|
+
-webkit-box-shadow: 0 0 0 1000px var(--color-bg-input) inset;
|
|
102
|
+
-webkit-text-fill-color: var(--color-text-primary);
|
|
103
|
+
caret-color: var(--color-text-primary);
|
|
104
|
+
transition: background-color 5000s ease-in-out 0s;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.input:disabled {
|
|
108
|
+
cursor: not-allowed;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ── Leading / Trailing addons ── */
|
|
112
|
+
.hasLeadingAddon {
|
|
113
|
+
padding-left: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.hasTrailingAddon {
|
|
117
|
+
padding-right: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.hasLeadingIcon {
|
|
121
|
+
padding-left: 32px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.hasTrailingIcon {
|
|
125
|
+
padding-right: 32px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* ── Icons ── */
|
|
129
|
+
.leadingIcon {
|
|
130
|
+
position: absolute;
|
|
131
|
+
left: 12px;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
pointer-events: none;
|
|
135
|
+
color: var(--color-text-tertiary);
|
|
136
|
+
z-index: 1;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.trailingIcon {
|
|
140
|
+
position: absolute;
|
|
141
|
+
right: 12px;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
color: var(--color-text-tertiary);
|
|
145
|
+
z-index: 1;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* ── Leading Dropdown ── */
|
|
149
|
+
.leadingDropdown {
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
height: 100%;
|
|
153
|
+
padding: 0 4px 0 10px;
|
|
154
|
+
border-right: 1px solid var(--color-border-subtle);
|
|
155
|
+
flex-shrink: 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* ── Trailing Dropdown ── */
|
|
159
|
+
.trailingDropdown {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
height: 100%;
|
|
163
|
+
padding: 0 10px 0 4px;
|
|
164
|
+
border-left: 1px solid var(--color-border-subtle);
|
|
165
|
+
flex-shrink: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* ── Leading Text ── */
|
|
169
|
+
.leadingText {
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
height: 100%;
|
|
173
|
+
padding: 0 0 0 14px;
|
|
174
|
+
font-size: 14px;
|
|
175
|
+
font-weight: 500;
|
|
176
|
+
color: var(--color-text-tertiary);
|
|
177
|
+
white-space: nowrap;
|
|
178
|
+
flex-shrink: 0;
|
|
179
|
+
user-select: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* ── Trailing Button ── */
|
|
183
|
+
.trailingButton {
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
height: 100%;
|
|
187
|
+
flex-shrink: 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.trailingButton > button,
|
|
191
|
+
.trailingButton > a {
|
|
192
|
+
height: 100%;
|
|
193
|
+
border-radius: 0 var(--radius-md) var(--radius-md) 0;
|
|
194
|
+
border: none;
|
|
195
|
+
border-left: 1px solid var(--color-border-subtle);
|
|
196
|
+
padding: 0 16px;
|
|
197
|
+
font-family: inherit;
|
|
198
|
+
font-size: 13px;
|
|
199
|
+
font-weight: 600;
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
transition: all 0.2s;
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
gap: 6px;
|
|
205
|
+
white-space: nowrap;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* ── Helper / Error ── */
|
|
209
|
+
.errorText {
|
|
210
|
+
font-size: 12px;
|
|
211
|
+
color: var(--color-error);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.helperText {
|
|
215
|
+
font-size: 12px;
|
|
216
|
+
color: var(--color-text-tertiary);
|
|
217
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { cn } from "@/lib/cn";
|
|
5
|
+
import styles from "./Input.module.css";
|
|
6
|
+
|
|
7
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
8
|
+
label?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
hint?: string;
|
|
12
|
+
inputSize?: "sm" | "md" | "lg";
|
|
13
|
+
required?: boolean;
|
|
14
|
+
leadingIcon?: React.ReactNode;
|
|
15
|
+
trailingIcon?: React.ReactNode;
|
|
16
|
+
leadingDropdown?: React.ReactNode;
|
|
17
|
+
trailingDropdown?: React.ReactNode;
|
|
18
|
+
leadingText?: string;
|
|
19
|
+
trailingButton?: React.ReactNode;
|
|
20
|
+
wrapperClassName?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
24
|
+
(
|
|
25
|
+
{
|
|
26
|
+
label,
|
|
27
|
+
error,
|
|
28
|
+
helperText,
|
|
29
|
+
hint,
|
|
30
|
+
inputSize = "md",
|
|
31
|
+
required = false,
|
|
32
|
+
leadingIcon,
|
|
33
|
+
trailingIcon,
|
|
34
|
+
leadingDropdown,
|
|
35
|
+
trailingDropdown,
|
|
36
|
+
leadingText,
|
|
37
|
+
trailingButton,
|
|
38
|
+
wrapperClassName,
|
|
39
|
+
className,
|
|
40
|
+
disabled,
|
|
41
|
+
...props
|
|
42
|
+
},
|
|
43
|
+
ref,
|
|
44
|
+
) => {
|
|
45
|
+
const hasLeadingAddon = !!(leadingIcon || leadingDropdown || leadingText);
|
|
46
|
+
const hasTrailingAddon = !!(trailingIcon || trailingDropdown || trailingButton);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div className={cn(styles.wrapper, wrapperClassName)}>
|
|
50
|
+
{label && (
|
|
51
|
+
<label className={styles.label}>
|
|
52
|
+
{label}
|
|
53
|
+
{required && <span className={styles.required}>*</span>}
|
|
54
|
+
</label>
|
|
55
|
+
)}
|
|
56
|
+
<div
|
|
57
|
+
className={cn(
|
|
58
|
+
styles.inputContainer,
|
|
59
|
+
styles[inputSize],
|
|
60
|
+
error && styles.containerError,
|
|
61
|
+
disabled && styles.containerDisabled,
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
{leadingIcon && <span className={styles.leadingIcon}>{leadingIcon}</span>}
|
|
65
|
+
{leadingDropdown && <span className={styles.leadingDropdown}>{leadingDropdown}</span>}
|
|
66
|
+
{leadingText && <span className={styles.leadingText}>{leadingText}</span>}
|
|
67
|
+
<input
|
|
68
|
+
ref={ref}
|
|
69
|
+
className={cn(
|
|
70
|
+
styles.input,
|
|
71
|
+
hasLeadingAddon ? styles.hasLeadingAddon : undefined,
|
|
72
|
+
hasTrailingAddon ? styles.hasTrailingAddon : undefined,
|
|
73
|
+
leadingIcon ? styles.hasLeadingIcon : undefined,
|
|
74
|
+
trailingIcon ? styles.hasTrailingIcon : undefined,
|
|
75
|
+
className,
|
|
76
|
+
)}
|
|
77
|
+
disabled={disabled}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
{trailingIcon && <span className={styles.trailingIcon}>{trailingIcon}</span>}
|
|
81
|
+
{trailingDropdown && <span className={styles.trailingDropdown}>{trailingDropdown}</span>}
|
|
82
|
+
{trailingButton && <span className={styles.trailingButton}>{trailingButton}</span>}
|
|
83
|
+
</div>
|
|
84
|
+
{error && <span className={styles.errorText}>{error}</span>}
|
|
85
|
+
{(hint || helperText) && !error && (
|
|
86
|
+
<span className={styles.helperText}>{hint || helperText}</span>
|
|
87
|
+
)}
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
Input.displayName = "Input";
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
.phone {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.frame {
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 280px;
|
|
9
|
+
border-radius: 40px;
|
|
10
|
+
border: 6px solid var(--color-text-primary);
|
|
11
|
+
background: var(--color-bg-secondary);
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25),
|
|
14
|
+
inset 0 0 0 2px rgba(255, 255, 255, 0.06);
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* ── Notch / Dynamic Island ── */
|
|
20
|
+
.notch {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
padding: 10px 0 0;
|
|
24
|
+
position: relative;
|
|
25
|
+
z-index: 2;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.notchPill {
|
|
29
|
+
width: 80px;
|
|
30
|
+
height: 22px;
|
|
31
|
+
border-radius: 20px;
|
|
32
|
+
background: var(--color-text-primary);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ── Screen ── */
|
|
36
|
+
.screen {
|
|
37
|
+
flex: 1;
|
|
38
|
+
min-height: 420px;
|
|
39
|
+
background: var(--color-bg-secondary);
|
|
40
|
+
position: relative;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ── Bottom bar ── */
|
|
44
|
+
.bottomBar {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: 8px;
|
|
48
|
+
padding: 8px 12px;
|
|
49
|
+
background: rgba(128, 128, 128, 0.15);
|
|
50
|
+
backdrop-filter: blur(12px);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.bottomNavBtn {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
width: 32px;
|
|
58
|
+
height: 32px;
|
|
59
|
+
border: none;
|
|
60
|
+
background: rgba(128, 128, 128, 0.2);
|
|
61
|
+
color: var(--color-text-secondary);
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
border-radius: 50%;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
transition: background 0.15s;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.bottomNavBtn:hover {
|
|
69
|
+
background: rgba(128, 128, 128, 0.35);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.addressPill {
|
|
73
|
+
flex: 1;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
height: 32px;
|
|
78
|
+
border-radius: var(--radius-full);
|
|
79
|
+
background: rgba(128, 128, 128, 0.2);
|
|
80
|
+
padding: 0 16px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.addressText {
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
color: var(--color-text-secondary);
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
text-overflow: ellipsis;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ── Home indicator ── */
|
|
93
|
+
.homeIndicator {
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
padding: 8px 0 6px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.homeBar {
|
|
100
|
+
width: 100px;
|
|
101
|
+
height: 4px;
|
|
102
|
+
border-radius: 999px;
|
|
103
|
+
background: var(--color-text-tertiary);
|
|
104
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { cn } from "@/lib/cn";
|
|
5
|
+
import styles from "./Phone.module.css";
|
|
6
|
+
|
|
7
|
+
export interface PhoneProps {
|
|
8
|
+
address?: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Phone = forwardRef<HTMLDivElement, PhoneProps>(
|
|
14
|
+
({ address, children, className }, ref) => {
|
|
15
|
+
return (
|
|
16
|
+
<div ref={ref} className={cn(styles.phone, className)}>
|
|
17
|
+
{/* Frame */}
|
|
18
|
+
<div className={styles.frame}>
|
|
19
|
+
{/* Notch / Dynamic Island */}
|
|
20
|
+
<div className={styles.notch}>
|
|
21
|
+
<div className={styles.notchPill} />
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
{/* Screen */}
|
|
25
|
+
<div className={styles.screen}>
|
|
26
|
+
{children}
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
{/* Bottom bar with address */}
|
|
30
|
+
{address && (
|
|
31
|
+
<div className={styles.bottomBar}>
|
|
32
|
+
<button className={styles.bottomNavBtn} aria-label="Back">
|
|
33
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M10 3L5 8L10 13" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/></svg>
|
|
34
|
+
</button>
|
|
35
|
+
<div className={styles.addressPill}>
|
|
36
|
+
<span className={styles.addressText}>{address}</span>
|
|
37
|
+
</div>
|
|
38
|
+
<button className={styles.bottomNavBtn} aria-label="More">
|
|
39
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><circle cx="4" cy="8" r="1.2" fill="currentColor"/><circle cx="8" cy="8" r="1.2" fill="currentColor"/><circle cx="12" cy="8" r="1.2" fill="currentColor"/></svg>
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
|
|
44
|
+
{/* Home indicator */}
|
|
45
|
+
<div className={styles.homeIndicator}>
|
|
46
|
+
<div className={styles.homeBar} />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
Phone.displayName = "Phone";
|