omnira-ui 0.4.1 → 0.6.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 (55) hide show
  1. package/components/ui/Alert/Alert.module.css +224 -0
  2. package/components/ui/Alert/Alert.tsx +138 -0
  3. package/components/ui/Alert/index.ts +2 -0
  4. package/components/ui/AuthPage/AuthPage.module.css +554 -0
  5. package/components/ui/AuthPage/AuthPage.tsx +376 -0
  6. package/components/ui/AuthPage/index.ts +2 -0
  7. package/components/ui/Breadcrumbs/Breadcrumbs.module.css +134 -0
  8. package/components/ui/Breadcrumbs/Breadcrumbs.tsx +139 -0
  9. package/components/ui/Breadcrumbs/index.ts +2 -0
  10. package/components/ui/Calendar/Calendar.module.css +235 -6
  11. package/components/ui/Calendar/Calendar.tsx +212 -11
  12. package/components/ui/Calendar/config.ts +54 -4
  13. package/components/ui/CodeSnippet/CodeSnippet.module.css +158 -0
  14. package/components/ui/CodeSnippet/CodeSnippet.tsx +106 -0
  15. package/components/ui/CodeSnippet/index.ts +2 -0
  16. package/components/ui/ContentDivider/ContentDivider.module.css +214 -0
  17. package/components/ui/ContentDivider/ContentDivider.tsx +197 -0
  18. package/components/ui/ContentDivider/index.ts +10 -0
  19. package/components/ui/DatePicker/DatePicker.module.css +319 -0
  20. package/components/ui/DatePicker/DatePicker.tsx +614 -0
  21. package/components/ui/DatePicker/index.ts +14 -0
  22. package/components/ui/FileUpload/FileUpload.module.css +322 -0
  23. package/components/ui/FileUpload/FileUpload.tsx +413 -0
  24. package/components/ui/FileUpload/index.ts +8 -0
  25. package/components/ui/LoadingIndicator/LoadingIndicator.module.css +381 -0
  26. package/components/ui/LoadingIndicator/LoadingIndicator.tsx +226 -0
  27. package/components/ui/LoadingIndicator/index.ts +8 -0
  28. package/components/ui/LoginCardSeparated/LoginCardSeparated.module.css +341 -0
  29. package/components/ui/LoginCardSeparated/LoginCardSeparated.tsx +293 -0
  30. package/components/ui/LoginCardSeparated/index.ts +2 -0
  31. package/components/ui/LoginSimple/LoginSimple.module.css +342 -0
  32. package/components/ui/LoginSimple/LoginSimple.tsx +213 -0
  33. package/components/ui/LoginSimple/index.ts +2 -0
  34. package/components/ui/LoginSplitImage/LoginSplitImage.module.css +395 -0
  35. package/components/ui/LoginSplitImage/LoginSplitImage.tsx +199 -0
  36. package/components/ui/LoginSplitImage/index.ts +2 -0
  37. package/components/ui/LoginSplitQuote/LoginSplitQuote.module.css +416 -0
  38. package/components/ui/LoginSplitQuote/LoginSplitQuote.tsx +224 -0
  39. package/components/ui/LoginSplitQuote/index.ts +2 -0
  40. package/components/ui/SignUpCardSeparated/SignUpCardSeparated.module.css +342 -0
  41. package/components/ui/SignUpCardSeparated/SignUpCardSeparated.tsx +214 -0
  42. package/components/ui/SignUpCardSeparated/index.ts +2 -0
  43. package/components/ui/SignUpSimple/SignUpSimple.module.css +330 -0
  44. package/components/ui/SignUpSimple/SignUpSimple.tsx +225 -0
  45. package/components/ui/SignUpSimple/index.ts +2 -0
  46. package/components/ui/SignUpSplitImage/SignUpSplitImage.module.css +399 -0
  47. package/components/ui/SignUpSplitImage/SignUpSplitImage.tsx +235 -0
  48. package/components/ui/SignUpSplitImage/index.ts +2 -0
  49. package/components/ui/SignUpSplitQuote/SignUpSplitQuote.module.css +430 -0
  50. package/components/ui/SignUpSplitQuote/SignUpSplitQuote.tsx +260 -0
  51. package/components/ui/SignUpSplitQuote/index.ts +2 -0
  52. package/components/ui/Tabs/Tabs.module.css +257 -0
  53. package/components/ui/Tabs/Tabs.tsx +149 -0
  54. package/components/ui/Tabs/index.ts +2 -0
  55. package/package.json +1 -1
@@ -0,0 +1,224 @@
1
+ /* ============================================
2
+ Alert — Glassmorphism Styles
3
+ ============================================ */
4
+
5
+ /* ── Base ── */
6
+
7
+ .alert {
8
+ display: flex;
9
+ align-items: flex-start;
10
+ gap: 12px;
11
+ padding: 16px;
12
+ border-radius: var(--radius-xl);
13
+ border: 1px solid var(--color-border-subtle);
14
+ background: var(--color-bg-card);
15
+ position: relative;
16
+ }
17
+
18
+ /* ── Full Width ── */
19
+
20
+ .fullWidth {
21
+ border-radius: 0;
22
+ border-left: none;
23
+ border-right: none;
24
+ width: 100%;
25
+ }
26
+
27
+ /* ── Icon ── */
28
+
29
+ .iconWrap {
30
+ width: 20px;
31
+ height: 20px;
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ flex-shrink: 0;
36
+ margin-top: 1px;
37
+ }
38
+
39
+ /* ── Content ── */
40
+
41
+ .content {
42
+ flex: 1;
43
+ min-width: 0;
44
+ display: flex;
45
+ flex-direction: column;
46
+ gap: 4px;
47
+ }
48
+
49
+ .title {
50
+ font-family: var(--font-body);
51
+ font-size: 14px;
52
+ font-weight: 600;
53
+ color: var(--color-text-primary);
54
+ line-height: 1.4;
55
+ }
56
+
57
+ .description {
58
+ font-family: var(--font-body);
59
+ font-size: 13px;
60
+ color: var(--color-text-secondary);
61
+ line-height: 1.5;
62
+ }
63
+
64
+ /* ── Actions ── */
65
+
66
+ .actions {
67
+ display: flex;
68
+ align-items: center;
69
+ gap: 8px;
70
+ margin-top: 8px;
71
+ }
72
+
73
+ .actionBtn {
74
+ font-family: var(--font-body);
75
+ font-size: 13px;
76
+ font-weight: 600;
77
+ padding: 6px 12px;
78
+ border-radius: var(--radius-md);
79
+ border: none;
80
+ cursor: pointer;
81
+ transition: all 0.15s;
82
+ }
83
+
84
+ .actionPrimary {
85
+ background: var(--color-lime);
86
+ color: var(--color-bg-primary);
87
+ }
88
+
89
+ .actionPrimary:hover {
90
+ opacity: 0.9;
91
+ }
92
+
93
+ .actionSecondary {
94
+ background: transparent;
95
+ color: var(--color-text-secondary);
96
+ border: 1px solid var(--color-border-subtle);
97
+ }
98
+
99
+ .actionSecondary:hover {
100
+ background: var(--color-bg-hover);
101
+ }
102
+
103
+ /* ── Close Button ── */
104
+
105
+ .closeBtn {
106
+ width: 24px;
107
+ height: 24px;
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ border-radius: var(--radius-md);
112
+ border: none;
113
+ background: transparent;
114
+ color: var(--color-text-tertiary);
115
+ cursor: pointer;
116
+ flex-shrink: 0;
117
+ padding: 0;
118
+ transition: all 0.15s;
119
+ }
120
+
121
+ .closeBtn:hover {
122
+ background: var(--color-bg-hover);
123
+ color: var(--color-text-primary);
124
+ }
125
+
126
+ /* ══════════════════════════════════════════════
127
+ Color Variants
128
+ ══════════════════════════════════════════════ */
129
+
130
+ /* Default */
131
+ .colorDefault {
132
+ border-color: var(--color-border-subtle);
133
+ background: var(--color-bg-card);
134
+ }
135
+
136
+ .colorDefault .iconWrap {
137
+ color: var(--color-text-tertiary);
138
+ }
139
+
140
+ /* Brand */
141
+ .colorBrand {
142
+ border-color: var(--color-lime);
143
+ background: var(--color-bg-lime-subtle);
144
+ }
145
+
146
+ .colorBrand .iconWrap {
147
+ color: var(--color-lime);
148
+ }
149
+
150
+ .colorBrand .title {
151
+ color: var(--color-lime);
152
+ }
153
+
154
+ .colorBrand .actionPrimary {
155
+ background: var(--color-lime);
156
+ color: var(--color-bg-primary);
157
+ }
158
+
159
+ /* Gray */
160
+ .colorGray {
161
+ border-color: var(--color-border-medium);
162
+ background: var(--color-bg-elevated);
163
+ }
164
+
165
+ .colorGray .iconWrap {
166
+ color: var(--color-text-tertiary);
167
+ }
168
+
169
+ /* Error */
170
+ .colorError {
171
+ border-color: var(--color-error);
172
+ background: var(--color-error-bg);
173
+ }
174
+
175
+ .colorError .iconWrap {
176
+ color: var(--color-error);
177
+ }
178
+
179
+ .colorError .title {
180
+ color: var(--color-error);
181
+ }
182
+
183
+ .colorError .actionPrimary {
184
+ background: var(--color-error);
185
+ color: #fff;
186
+ }
187
+
188
+ /* Warning */
189
+ .colorWarning {
190
+ border-color: var(--color-warning);
191
+ background: var(--color-warning-bg);
192
+ }
193
+
194
+ .colorWarning .iconWrap {
195
+ color: var(--color-warning);
196
+ }
197
+
198
+ .colorWarning .title {
199
+ color: var(--color-warning);
200
+ }
201
+
202
+ .colorWarning .actionPrimary {
203
+ background: var(--color-warning);
204
+ color: var(--color-bg-primary);
205
+ }
206
+
207
+ /* Success */
208
+ .colorSuccess {
209
+ border-color: var(--color-success);
210
+ background: var(--color-success-bg);
211
+ }
212
+
213
+ .colorSuccess .iconWrap {
214
+ color: var(--color-success);
215
+ }
216
+
217
+ .colorSuccess .title {
218
+ color: var(--color-success);
219
+ }
220
+
221
+ .colorSuccess .actionPrimary {
222
+ background: var(--color-success);
223
+ color: #fff;
224
+ }
@@ -0,0 +1,138 @@
1
+ "use client";
2
+
3
+ import React, { useState } from "react";
4
+ import { InfoCircle, TickCircle, Danger, Warning2, CloseCircle } from "iconsax-react";
5
+ import { cn } from "@/lib/cn";
6
+ import s from "./Alert.module.css";
7
+
8
+ /* ══════════════════════════════════════════════
9
+ Types
10
+ ══════════════════════════════════════════════ */
11
+
12
+ export type AlertColor = "default" | "brand" | "gray" | "error" | "warning" | "success";
13
+ export type AlertVariant = "floating" | "fullWidth";
14
+
15
+ export interface AlertAction {
16
+ label: string;
17
+ onClick?: () => void;
18
+ variant?: "primary" | "secondary";
19
+ }
20
+
21
+ export interface AlertProps {
22
+ /** Alert title */
23
+ title: string;
24
+ /** Alert description */
25
+ description?: string;
26
+ /** Color theme */
27
+ color?: AlertColor;
28
+ /** Layout variant */
29
+ variant?: AlertVariant;
30
+ /** Custom icon element. Pass null to hide the icon. */
31
+ icon?: React.ReactNode | null;
32
+ /** Action buttons */
33
+ actions?: AlertAction[];
34
+ /** Show close button */
35
+ dismissible?: boolean;
36
+ /** Callback when dismissed */
37
+ onDismiss?: () => void;
38
+ /** Additional CSS class */
39
+ className?: string;
40
+ /** Children rendered after description */
41
+ children?: React.ReactNode;
42
+ }
43
+
44
+ /* ══════════════════════════════════════════════
45
+ Helpers
46
+ ══════════════════════════════════════════════ */
47
+
48
+ function getDefaultIcon(color: AlertColor) {
49
+ switch (color) {
50
+ case "error": return <Danger size={20} variant="Bulk" color="currentColor" />;
51
+ case "warning": return <Warning2 size={20} variant="Bulk" color="currentColor" />;
52
+ case "success": return <TickCircle size={20} variant="Bulk" color="currentColor" />;
53
+ default: return <InfoCircle size={20} variant="Bulk" color="currentColor" />;
54
+ }
55
+ }
56
+
57
+ function getColorCls(color: AlertColor) {
58
+ switch (color) {
59
+ case "brand": return s.colorBrand;
60
+ case "gray": return s.colorGray;
61
+ case "error": return s.colorError;
62
+ case "warning": return s.colorWarning;
63
+ case "success": return s.colorSuccess;
64
+ default: return s.colorDefault;
65
+ }
66
+ }
67
+
68
+ /* ══════════════════════════════════════════════
69
+ Alert
70
+ ══════════════════════════════════════════════ */
71
+
72
+ export function Alert({
73
+ title,
74
+ description,
75
+ color = "default",
76
+ variant = "floating",
77
+ icon,
78
+ actions,
79
+ dismissible = false,
80
+ onDismiss,
81
+ className,
82
+ children,
83
+ }: AlertProps) {
84
+ const [visible, setVisible] = useState(true);
85
+
86
+ if (!visible) return null;
87
+
88
+ const handleDismiss = () => {
89
+ setVisible(false);
90
+ onDismiss?.();
91
+ };
92
+
93
+ const showIcon = icon !== null;
94
+ const iconElement = icon ?? getDefaultIcon(color);
95
+
96
+ return (
97
+ <div
98
+ className={cn(
99
+ s.alert,
100
+ variant === "fullWidth" && s.fullWidth,
101
+ getColorCls(color),
102
+ className,
103
+ )}
104
+ role="alert"
105
+ >
106
+ {showIcon && <div className={s.iconWrap}>{iconElement}</div>}
107
+
108
+ <div className={s.content}>
109
+ <div className={s.title}>{title}</div>
110
+ {description && <div className={s.description}>{description}</div>}
111
+ {children}
112
+ {actions && actions.length > 0 && (
113
+ <div className={s.actions}>
114
+ {actions.map((action, i) => (
115
+ <button
116
+ key={i}
117
+ type="button"
118
+ className={cn(
119
+ s.actionBtn,
120
+ action.variant === "secondary" ? s.actionSecondary : s.actionPrimary,
121
+ )}
122
+ onClick={action.onClick}
123
+ >
124
+ {action.label}
125
+ </button>
126
+ ))}
127
+ </div>
128
+ )}
129
+ </div>
130
+
131
+ {dismissible && (
132
+ <button type="button" className={s.closeBtn} onClick={handleDismiss} aria-label="Dismiss">
133
+ <CloseCircle size={16} variant="Linear" color="currentColor" />
134
+ </button>
135
+ )}
136
+ </div>
137
+ );
138
+ }
@@ -0,0 +1,2 @@
1
+ export { Alert } from "./Alert";
2
+ export type { AlertProps, AlertAction, AlertColor, AlertVariant } from "./Alert";