@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.1.4 → 0.1.6
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/CHANGELOG.md +1 -1
- package/dist/index.d.ts +131 -131
- package/dist/index.esm.js +148 -148
- package/dist/index.js +148 -148
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/accessibility-demo.tsx +271 -0
- package/src/components/ui/advanced-component-architecture-demo.tsx +916 -0
- package/src/components/ui/advanced-transition-system-demo.tsx +670 -0
- package/src/components/ui/advanced-transition-system.tsx +395 -0
- package/src/components/ui/animation/animated-container.tsx +166 -0
- package/src/components/ui/animation/index.ts +19 -0
- package/src/components/ui/animation/staggered-container.tsx +68 -0
- package/src/components/ui/animation-demo.tsx +250 -0
- package/src/components/ui/badge.tsx +33 -0
- package/src/components/ui/battery-conscious-animation-demo.tsx +568 -0
- package/src/components/ui/border-radius-shadow-demo.tsx +187 -0
- package/src/components/ui/button.tsx +36 -0
- package/src/components/ui/card.tsx +207 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/color-preview.tsx +411 -0
- package/src/components/ui/data-display/chart.tsx +653 -0
- package/src/components/ui/data-display/data-grid-simple.tsx +76 -0
- package/src/components/ui/data-display/data-grid.tsx +680 -0
- package/src/components/ui/data-display/list.tsx +456 -0
- package/src/components/ui/data-display/table.tsx +482 -0
- package/src/components/ui/data-display/timeline.tsx +441 -0
- package/src/components/ui/data-display/tree.tsx +602 -0
- package/src/components/ui/data-display/types.ts +536 -0
- package/src/components/ui/enterprise-mobile-experience-demo.tsx +749 -0
- package/src/components/ui/enterprise-mobile-experience.tsx +464 -0
- package/src/components/ui/feedback/alert.tsx +157 -0
- package/src/components/ui/feedback/progress.tsx +292 -0
- package/src/components/ui/feedback/skeleton.tsx +185 -0
- package/src/components/ui/feedback/toast.tsx +280 -0
- package/src/components/ui/feedback/types.ts +125 -0
- package/src/components/ui/font-preview.tsx +288 -0
- package/src/components/ui/form-demo.tsx +553 -0
- package/src/components/ui/hardware-acceleration-demo.tsx +547 -0
- package/src/components/ui/input.tsx +35 -0
- package/src/components/ui/label.tsx +16 -0
- package/src/components/ui/layout-demo.tsx +367 -0
- package/src/components/ui/layouts/adaptive-layout.tsx +139 -0
- package/src/components/ui/layouts/desktop-layout.tsx +224 -0
- package/src/components/ui/layouts/index.ts +10 -0
- package/src/components/ui/layouts/mobile-layout.tsx +162 -0
- package/src/components/ui/layouts/tablet-layout.tsx +197 -0
- package/src/components/ui/mobile-form-validation.tsx +451 -0
- package/src/components/ui/mobile-input-demo.tsx +201 -0
- package/src/components/ui/mobile-input.tsx +281 -0
- package/src/components/ui/mobile-skeleton-loading-demo.tsx +638 -0
- package/src/components/ui/navigation/breadcrumb.tsx +158 -0
- package/src/components/ui/navigation/index.ts +36 -0
- package/src/components/ui/navigation/menu.tsx +374 -0
- package/src/components/ui/navigation/navigation-demo.tsx +324 -0
- package/src/components/ui/navigation/pagination.tsx +272 -0
- package/src/components/ui/navigation/sidebar.tsx +383 -0
- package/src/components/ui/navigation/stepper.tsx +303 -0
- package/src/components/ui/navigation/tabs.tsx +205 -0
- package/src/components/ui/navigation/types.ts +299 -0
- package/src/components/ui/overlay/backdrop.tsx +81 -0
- package/src/components/ui/overlay/focus-manager.tsx +143 -0
- package/src/components/ui/overlay/index.ts +36 -0
- package/src/components/ui/overlay/modal.tsx +270 -0
- package/src/components/ui/overlay/overlay-manager.tsx +110 -0
- package/src/components/ui/overlay/popover.tsx +462 -0
- package/src/components/ui/overlay/portal.tsx +79 -0
- package/src/components/ui/overlay/tooltip.tsx +303 -0
- package/src/components/ui/overlay/types.ts +196 -0
- package/src/components/ui/performance-demo.tsx +596 -0
- package/src/components/ui/semantic-input-system-demo.tsx +502 -0
- package/src/components/ui/semantic-input-system-demo.tsx.disabled +873 -0
- package/src/components/ui/tablet-layout.tsx +192 -0
- package/src/components/ui/theme-customizer.tsx +386 -0
- package/src/components/ui/theme-preview.tsx +310 -0
- package/src/components/ui/theme-switcher.tsx +264 -0
- package/src/components/ui/theme-toggle.tsx +38 -0
- package/src/components/ui/token-demo.tsx +195 -0
- package/src/components/ui/touch-demo.tsx +462 -0
- package/src/components/ui/touch-friendly-interface-demo.tsx +519 -0
- package/src/components/ui/touch-friendly-interface.tsx +296 -0
- package/src/hooks/index.ts +190 -0
- package/src/hooks/use-accessibility-support.ts +518 -0
- package/src/hooks/use-adaptive-layout.ts +289 -0
- package/src/hooks/use-advanced-patterns.ts +294 -0
- package/src/hooks/use-advanced-transition-system.ts +393 -0
- package/src/hooks/use-animation-profile.ts +288 -0
- package/src/hooks/use-battery-animations.ts +384 -0
- package/src/hooks/use-battery-conscious-loading.ts +475 -0
- package/src/hooks/use-battery-optimization.ts +330 -0
- package/src/hooks/use-battery-status.ts +299 -0
- package/src/hooks/use-component-performance.ts +344 -0
- package/src/hooks/use-device-loading-states.ts +459 -0
- package/src/hooks/use-device.tsx +110 -0
- package/src/hooks/use-enterprise-mobile-experience.ts +488 -0
- package/src/hooks/use-form-feedback.ts +403 -0
- package/src/hooks/use-form-performance.ts +513 -0
- package/src/hooks/use-frame-rate.ts +251 -0
- package/src/hooks/use-gestures.ts +338 -0
- package/src/hooks/use-hardware-acceleration.ts +341 -0
- package/src/hooks/use-input-accessibility.ts +455 -0
- package/src/hooks/use-input-performance.ts +506 -0
- package/src/hooks/use-layout-performance.ts +319 -0
- package/src/hooks/use-loading-accessibility.ts +535 -0
- package/src/hooks/use-loading-performance.ts +473 -0
- package/src/hooks/use-memory-usage.ts +287 -0
- package/src/hooks/use-mobile-form-layout.ts +464 -0
- package/src/hooks/use-mobile-form-validation.ts +518 -0
- package/src/hooks/use-mobile-keyboard-optimization.ts +472 -0
- package/src/hooks/use-mobile-layout.ts +302 -0
- package/src/hooks/use-mobile-optimization.ts +406 -0
- package/src/hooks/use-mobile-skeleton.ts +402 -0
- package/src/hooks/use-mobile-touch.ts +414 -0
- package/src/hooks/use-performance-throttling.ts +348 -0
- package/src/hooks/use-performance.ts +316 -0
- package/src/hooks/use-reusable-architecture.ts +414 -0
- package/src/hooks/use-semantic-input-types.ts +357 -0
- package/src/hooks/use-semantic-input.ts +565 -0
- package/src/hooks/use-tablet-layout.ts +384 -0
- package/src/hooks/use-touch-friendly-input.ts +524 -0
- package/src/hooks/use-touch-friendly-interface.ts +331 -0
- package/src/hooks/use-touch-optimization.ts +375 -0
- package/src/index.ts +279 -279
- package/src/lib/utils.ts +6 -0
- package/src/themes/README.md +272 -0
- package/src/themes/ThemeContext.tsx +31 -0
- package/src/themes/ThemeProvider.tsx +232 -0
- package/src/themes/accessibility/index.ts +27 -0
- package/src/themes/accessibility.ts +259 -0
- package/src/themes/aria-patterns.ts +420 -0
- package/src/themes/base-themes.ts +55 -0
- package/src/themes/colorManager.ts +380 -0
- package/src/themes/examples/dark-theme.ts +154 -0
- package/src/themes/examples/minimal-theme.ts +108 -0
- package/src/themes/focus-management.ts +701 -0
- package/src/themes/fontLoader.ts +201 -0
- package/src/themes/high-contrast.ts +621 -0
- package/src/themes/index.ts +19 -0
- package/src/themes/inheritance.ts +227 -0
- package/src/themes/keyboard-navigation.ts +550 -0
- package/src/themes/motion-reduction.ts +662 -0
- package/src/themes/navigation.ts +238 -0
- package/src/themes/screen-reader.ts +645 -0
- package/src/themes/systemThemeDetector.ts +182 -0
- package/src/themes/themeCSSUpdater.ts +262 -0
- package/src/themes/themePersistence.ts +238 -0
- package/src/themes/themes/default.ts +586 -0
- package/src/themes/themes/harvey.ts +554 -0
- package/src/themes/themes/stan-design.ts +683 -0
- package/src/themes/types.ts +460 -0
- package/src/themes/useSystemTheme.ts +48 -0
- package/src/themes/useTheme.ts +87 -0
- package/src/themes/validation.ts +462 -0
- package/src/tokens/index.ts +34 -0
- package/src/tokens/tokenExporter.ts +397 -0
- package/src/tokens/tokenGenerator.ts +276 -0
- package/src/tokens/tokenManager.ts +248 -0
- package/src/tokens/tokenValidator.ts +543 -0
- package/src/tokens/types.ts +78 -0
- package/src/utils/bundle-analyzer.ts +260 -0
- package/src/utils/bundle-splitting.ts +483 -0
- package/src/utils/lazy-loading.ts +441 -0
- package/src/utils/performance-monitor.ts +513 -0
- package/src/utils/tree-shaking.ts +274 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Card } from './card';
|
|
3
|
+
import { Button } from './button';
|
|
4
|
+
|
|
5
|
+
export const BorderRadiusShadowDemo: React.FC = () => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="space-y-6">
|
|
8
|
+
<div className="text-center">
|
|
9
|
+
<h2 className="text-2xl font-bold text-cs-text-primary mb-2">
|
|
10
|
+
Advanced Border Radius & Shadow System
|
|
11
|
+
</h2>
|
|
12
|
+
<p className="text-cs-text-secondary">
|
|
13
|
+
Sophisticated visual polish with calculated variants and multiple depth levels
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
{/* Border Radius System */}
|
|
18
|
+
<Card className="p-6">
|
|
19
|
+
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
20
|
+
Border Radius System
|
|
21
|
+
</h3>
|
|
22
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
23
|
+
<div className="space-y-2">
|
|
24
|
+
<div className="h-20 bg-cs-primary rounded-sm flex items-center justify-center text-white font-medium">
|
|
25
|
+
rounded-sm
|
|
26
|
+
</div>
|
|
27
|
+
<p className="text-xs text-cs-text-muted text-center">--radius-sm (calc(var(--radius) - 4px))</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div className="space-y-2">
|
|
31
|
+
<div className="h-20 bg-cs-primary rounded-md flex items-center justify-center text-white font-medium">
|
|
32
|
+
rounded-md
|
|
33
|
+
</div>
|
|
34
|
+
<p className="text-xs text-cs-text-muted text-center">--radius-md (calc(var(--radius) - 2px))</p>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div className="space-y-2">
|
|
38
|
+
<div className="h-20 bg-cs-primary rounded-lg flex items-center justify-center text-white font-medium">
|
|
39
|
+
rounded-lg
|
|
40
|
+
</div>
|
|
41
|
+
<p className="text-xs text-cs-text-muted text-center">--radius-lg (var(--radius))</p>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div className="space-y-2">
|
|
45
|
+
<div className="h-20 bg-cs-primary rounded-xl flex items-center justify-center text-white font-medium">
|
|
46
|
+
rounded-xl
|
|
47
|
+
</div>
|
|
48
|
+
<p className="text-xs text-cs-text-muted text-center">--radius-xl (calc(var(--radius) + 2px))</p>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div className="space-y-2">
|
|
52
|
+
<div className="h-20 bg-cs-primary rounded-2xl flex items-center justify-center text-white font-medium">
|
|
53
|
+
rounded-2xl
|
|
54
|
+
</div>
|
|
55
|
+
<p className="text-xs text-cs-text-muted text-center">--radius-2xl (calc(var(--radius) + 4px))</p>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div className="space-y-2">
|
|
59
|
+
<div className="h-20 bg-cs-primary rounded-full flex items-center justify-center text-white font-medium">
|
|
60
|
+
rounded-full
|
|
61
|
+
</div>
|
|
62
|
+
<p className="text-xs text-cs-text-muted text-center">Native Tailwind (50%)</p>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</Card>
|
|
66
|
+
|
|
67
|
+
{/* Shadow System */}
|
|
68
|
+
<Card className="p-6">
|
|
69
|
+
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
70
|
+
Shadow System
|
|
71
|
+
</h3>
|
|
72
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
73
|
+
<div className="space-y-2">
|
|
74
|
+
<div className="h-20 bg-white rounded-lg shadow-sm flex items-center justify-center text-cs-text-primary font-medium border">
|
|
75
|
+
shadow-sm
|
|
76
|
+
</div>
|
|
77
|
+
<p className="text-xs text-cs-text-muted text-center">Subtle elevation</p>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div className="space-y-2">
|
|
81
|
+
<div className="h-20 bg-white rounded-lg shadow flex items-center justify-center text-cs-text-primary font-medium border">
|
|
82
|
+
shadow
|
|
83
|
+
</div>
|
|
84
|
+
<p className="text-xs text-cs-text-muted text-center">Default shadow</p>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div className="space-y-2">
|
|
88
|
+
<div className="h-20 bg-white rounded-lg shadow-md flex items-center justify-center text-cs-text-primary font-medium border">
|
|
89
|
+
shadow-md
|
|
90
|
+
</div>
|
|
91
|
+
<p className="text-xs text-cs-text-muted text-center">Medium elevation</p>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div className="space-y-2">
|
|
95
|
+
<div className="h-20 bg-white rounded-lg shadow-lg flex items-center justify-center text-cs-text-primary font-medium border">
|
|
96
|
+
shadow-lg
|
|
97
|
+
</div>
|
|
98
|
+
<p className="text-xs text-cs-text-muted text-center">Large elevation</p>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div className="space-y-2">
|
|
102
|
+
<div className="h-20 bg-white rounded-lg shadow-xl flex items-center justify-center text-cs-text-primary font-medium border">
|
|
103
|
+
shadow-xl
|
|
104
|
+
</div>
|
|
105
|
+
<p className="text-xs text-cs-text-muted text-center">Extra large elevation</p>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div className="space-y-2">
|
|
109
|
+
<div className="h-20 bg-white rounded-lg shadow-2xl flex items-center justify-center text-cs-text-primary font-medium border">
|
|
110
|
+
shadow-2xl
|
|
111
|
+
</div>
|
|
112
|
+
<p className="text-xs text-cs-text-muted text-center">Maximum elevation</p>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</Card>
|
|
116
|
+
|
|
117
|
+
{/* Component Integration */}
|
|
118
|
+
<Card className="p-6">
|
|
119
|
+
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
120
|
+
Component Integration
|
|
121
|
+
</h3>
|
|
122
|
+
<div className="space-y-4">
|
|
123
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
124
|
+
<Button variant="default" className="w-full">
|
|
125
|
+
Default Button
|
|
126
|
+
</Button>
|
|
127
|
+
<Button variant="outline" className="w-full">
|
|
128
|
+
Outline Button
|
|
129
|
+
</Button>
|
|
130
|
+
<Button variant="secondary" className="w-full">
|
|
131
|
+
Secondary Button
|
|
132
|
+
</Button>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
136
|
+
<div className="space-y-2">
|
|
137
|
+
<label className="text-sm font-medium text-cs-text-secondary">Input Field</label>
|
|
138
|
+
<input
|
|
139
|
+
type="text"
|
|
140
|
+
placeholder="Type something..."
|
|
141
|
+
className="w-full h-11 rounded-md border border-cs-border bg-cs-surface-bg px-3 py-2 text-cs-text-primary focus:outline-none focus:ring-2 focus:ring-cs-primary focus:ring-offset-2"
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<div className="space-y-2">
|
|
146
|
+
<label className="text-sm font-medium text-cs-text-secondary">Card Example</label>
|
|
147
|
+
<div className="p-4 rounded-lg border border-cs-border bg-cs-surface-bg shadow-sm">
|
|
148
|
+
<p className="text-sm text-cs-text-secondary">This card uses rounded-lg and shadow-sm</p>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</Card>
|
|
154
|
+
|
|
155
|
+
{/* Technical Details */}
|
|
156
|
+
<Card className="p-6">
|
|
157
|
+
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
158
|
+
Technical Implementation
|
|
159
|
+
</h3>
|
|
160
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
161
|
+
<div>
|
|
162
|
+
<h4 className="font-medium text-cs-text-primary mb-2">CSS Custom Properties</h4>
|
|
163
|
+
<div className="bg-cs-surface-bg p-3 rounded-md text-xs font-mono text-cs-text-secondary overflow-auto">
|
|
164
|
+
<p>--radius: 0.5rem</p>
|
|
165
|
+
<p>--radius-sm: calc(var(--radius) - 4px)</p>
|
|
166
|
+
<p>--radius-md: calc(var(--radius) - 2px)</p>
|
|
167
|
+
<p>--radius-lg: var(--radius)</p>
|
|
168
|
+
<p>--radius-xl: calc(var(--radius) + 2px)</p>
|
|
169
|
+
<p>--radius-2xl: calc(var(--radius) + 4px)</p>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<div>
|
|
174
|
+
<h4 className="font-medium text-cs-text-primary mb-2">Tailwind Classes</h4>
|
|
175
|
+
<div className="bg-cs-surface-bg p-3 rounded-md text-xs font-mono text-cs-text-secondary">
|
|
176
|
+
<p>rounded-sm → var(--radius-sm)</p>
|
|
177
|
+
<p>rounded-md → var(--radius-md)</p>
|
|
178
|
+
<p>rounded-lg → var(--radius-lg)</p>
|
|
179
|
+
<p>rounded-xl → var(--radius-xl)</p>
|
|
180
|
+
<p>rounded-2xl → var(--radius-2xl)</p>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
</Card>
|
|
185
|
+
</div>
|
|
186
|
+
);
|
|
187
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
|
|
4
|
+
export interface ButtonProps
|
|
5
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'
|
|
7
|
+
size?: 'default' | 'sm' | 'lg' | 'icon' | 'mobile'
|
|
8
|
+
asChild?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
12
|
+
({ className, variant = 'default', size = 'default', asChild = false, ...props }, ref) => {
|
|
13
|
+
const Comp = asChild ? Slot : "button"
|
|
14
|
+
|
|
15
|
+
// Build semantic CSS classes using BEM methodology
|
|
16
|
+
const baseClass = 'button'
|
|
17
|
+
const variantClass = `button--variant-${variant}`
|
|
18
|
+
const sizeClass = `button--size-${size}`
|
|
19
|
+
|
|
20
|
+
// Combine classes
|
|
21
|
+
const buttonClasses = [baseClass, variantClass, sizeClass, className]
|
|
22
|
+
.filter(Boolean)
|
|
23
|
+
.join(' ')
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Comp
|
|
27
|
+
className={buttonClasses}
|
|
28
|
+
ref={ref}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
Button.displayName = "Button"
|
|
35
|
+
|
|
36
|
+
export { Button }
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
variant?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error'
|
|
5
|
+
elevation?: 'base' | 'elevated' | 'interactive'
|
|
6
|
+
size?: 'compact' | 'normal' | 'spacious'
|
|
7
|
+
interactive?: boolean
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
loading?: boolean
|
|
10
|
+
fullWidth?: boolean
|
|
11
|
+
centered?: boolean
|
|
12
|
+
textAlign?: 'left' | 'center' | 'right'
|
|
13
|
+
animateIn?: boolean
|
|
14
|
+
animateOut?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Card = React.forwardRef<HTMLDivElement, CardProps>(
|
|
18
|
+
({
|
|
19
|
+
className,
|
|
20
|
+
variant = 'default',
|
|
21
|
+
elevation = 'base',
|
|
22
|
+
size = 'normal',
|
|
23
|
+
interactive = false,
|
|
24
|
+
disabled = false,
|
|
25
|
+
loading = false,
|
|
26
|
+
fullWidth = false,
|
|
27
|
+
centered = false,
|
|
28
|
+
textAlign = 'left',
|
|
29
|
+
animateIn = false,
|
|
30
|
+
animateOut = false,
|
|
31
|
+
...props
|
|
32
|
+
}, ref) => {
|
|
33
|
+
// Build semantic CSS classes using BEM methodology
|
|
34
|
+
const baseClass = 'card'
|
|
35
|
+
const variantClass = `card--variant-${variant}`
|
|
36
|
+
const elevationClass = `card--elevation-${elevation}`
|
|
37
|
+
const sizeClass = `card--size-${size}`
|
|
38
|
+
const interactiveClass = interactive ? 'card--interactive' : ''
|
|
39
|
+
const disabledClass = disabled ? 'card--disabled' : ''
|
|
40
|
+
const loadingClass = loading ? 'card--loading' : ''
|
|
41
|
+
const fullWidthClass = fullWidth ? 'card--full-width' : ''
|
|
42
|
+
const centeredClass = centered ? 'card--centered' : ''
|
|
43
|
+
const textAlignClass = `card--text-${textAlign}`
|
|
44
|
+
const animateInClass = animateIn ? 'card--animate-in' : ''
|
|
45
|
+
const animateOutClass = animateOut ? 'card--animate-out' : ''
|
|
46
|
+
|
|
47
|
+
// Combine classes
|
|
48
|
+
const cardClasses = [
|
|
49
|
+
baseClass,
|
|
50
|
+
variantClass,
|
|
51
|
+
elevationClass,
|
|
52
|
+
sizeClass,
|
|
53
|
+
interactiveClass,
|
|
54
|
+
disabledClass,
|
|
55
|
+
loadingClass,
|
|
56
|
+
fullWidthClass,
|
|
57
|
+
centeredClass,
|
|
58
|
+
textAlignClass,
|
|
59
|
+
animateInClass,
|
|
60
|
+
animateOutClass,
|
|
61
|
+
className
|
|
62
|
+
]
|
|
63
|
+
.filter(Boolean)
|
|
64
|
+
.join(' ')
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
ref={ref}
|
|
69
|
+
className={cardClasses}
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
Card.displayName = "Card"
|
|
76
|
+
|
|
77
|
+
export interface CardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
78
|
+
spacing?: 'compact' | 'normal' | 'spacious'
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(
|
|
82
|
+
({ className, spacing = 'normal', ...props }, ref) => {
|
|
83
|
+
// Build semantic CSS classes
|
|
84
|
+
const baseClass = 'card__header'
|
|
85
|
+
const spacingClass = `card__header--spacing-${spacing}`
|
|
86
|
+
|
|
87
|
+
// Combine classes
|
|
88
|
+
const headerClasses = [baseClass, spacingClass, className]
|
|
89
|
+
.filter(Boolean)
|
|
90
|
+
.join(' ')
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<div
|
|
94
|
+
ref={ref}
|
|
95
|
+
className={headerClasses}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
CardHeader.displayName = "CardHeader"
|
|
102
|
+
|
|
103
|
+
export interface CardTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
104
|
+
size?: 'small' | 'normal' | 'large'
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const CardTitle = React.forwardRef<HTMLHeadingElement, CardTitleProps>(
|
|
108
|
+
({ className, size = 'normal', ...props }, ref) => {
|
|
109
|
+
// Build semantic CSS classes
|
|
110
|
+
const baseClass = 'card__title'
|
|
111
|
+
const sizeClass = `card__title--size-${size}`
|
|
112
|
+
|
|
113
|
+
// Combine classes
|
|
114
|
+
const titleClasses = [baseClass, sizeClass, className]
|
|
115
|
+
.filter(Boolean)
|
|
116
|
+
.join(' ')
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<h3
|
|
120
|
+
ref={ref}
|
|
121
|
+
className={titleClasses}
|
|
122
|
+
{...props}
|
|
123
|
+
/>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
CardTitle.displayName = "CardTitle"
|
|
128
|
+
|
|
129
|
+
export interface CardDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
130
|
+
size?: 'small' | 'normal'
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const CardDescription = React.forwardRef<HTMLParagraphElement, CardDescriptionProps>(
|
|
134
|
+
({ className, size = 'normal', ...props }, ref) => {
|
|
135
|
+
// Build semantic CSS classes
|
|
136
|
+
const baseClass = 'card__description'
|
|
137
|
+
const sizeClass = `card__description--size-${size}`
|
|
138
|
+
|
|
139
|
+
// Combine classes
|
|
140
|
+
const descriptionClasses = [baseClass, sizeClass, className]
|
|
141
|
+
.filter(Boolean)
|
|
142
|
+
.join(' ')
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<p
|
|
146
|
+
className={descriptionClasses}
|
|
147
|
+
ref={ref}
|
|
148
|
+
{...props}
|
|
149
|
+
/>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
CardDescription.displayName = "CardDescription"
|
|
154
|
+
|
|
155
|
+
export interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
156
|
+
spacing?: 'compact' | 'normal' | 'spacious'
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const CardContent = React.forwardRef<HTMLDivElement, CardContentProps>(
|
|
160
|
+
({ className, spacing = 'normal', ...props }, ref) => {
|
|
161
|
+
// Build semantic CSS classes
|
|
162
|
+
const baseClass = 'card__content'
|
|
163
|
+
const spacingClass = `card__content--spacing-${spacing}`
|
|
164
|
+
|
|
165
|
+
// Combine classes
|
|
166
|
+
const contentClasses = [baseClass, spacingClass, className]
|
|
167
|
+
.filter(Boolean)
|
|
168
|
+
.join(' ')
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<div
|
|
172
|
+
ref={ref}
|
|
173
|
+
className={contentClasses}
|
|
174
|
+
{...props}
|
|
175
|
+
/>
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
CardContent.displayName = "CardContent"
|
|
180
|
+
|
|
181
|
+
export interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
182
|
+
layout?: 'horizontal' | 'vertical' | 'stacked' | 'justified' | 'centered'
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const CardFooter = React.forwardRef<HTMLDivElement, CardFooterProps>(
|
|
186
|
+
({ className, layout = 'horizontal', ...props }, ref) => {
|
|
187
|
+
// Build semantic CSS classes
|
|
188
|
+
const baseClass = 'card__footer'
|
|
189
|
+
const layoutClass = `card__footer--layout-${layout}`
|
|
190
|
+
|
|
191
|
+
// Combine classes
|
|
192
|
+
const footerClasses = [baseClass, layoutClass, className]
|
|
193
|
+
.filter(Boolean)
|
|
194
|
+
.join(' ')
|
|
195
|
+
|
|
196
|
+
return (
|
|
197
|
+
<div
|
|
198
|
+
ref={ref}
|
|
199
|
+
className={footerClasses}
|
|
200
|
+
{...props}
|
|
201
|
+
/>
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
CardFooter.displayName = "CardFooter"
|
|
206
|
+
|
|
207
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
|
|
3
|
+
import { Check } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
export interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
6
|
+
size?: 'small' | 'default' | 'large';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Checkbox = React.forwardRef<
|
|
10
|
+
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
11
|
+
CheckboxProps
|
|
12
|
+
>(({ className, size = 'default', ...props }, ref) => {
|
|
13
|
+
const sizeClass = size !== 'default' ? `checkbox--size-${size}` : '';
|
|
14
|
+
const checkmarkSize = size === 'small' ? 'h-3 w-3' : size === 'large' ? 'h-5 w-5' : 'h-4 w-4';
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<CheckboxPrimitive.Root
|
|
18
|
+
ref={ref}
|
|
19
|
+
className={`checkbox ${sizeClass} ${className || ''}`}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
<CheckboxPrimitive.Indicator className="checkbox__indicator">
|
|
23
|
+
<Check className={`checkbox__checkmark ${checkmarkSize}`} />
|
|
24
|
+
</CheckboxPrimitive.Indicator>
|
|
25
|
+
</CheckboxPrimitive.Root>
|
|
26
|
+
)
|
|
27
|
+
})
|
|
28
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName
|
|
29
|
+
|
|
30
|
+
export { Checkbox }
|