aural-ui 3.0.6 → 4.0.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.
- package/dist/components/aspect-ratio/AspectRatio.stories.tsx +271 -242
- package/dist/components/avatar/Avatar.stories.tsx +84 -70
- package/dist/components/button/Button.stories.tsx +7 -7
- package/dist/components/button/index.tsx +7 -7
- package/dist/components/card/Card.stories.tsx +3 -3
- package/dist/components/char-count/CharCount.stories.tsx +9 -9
- package/dist/components/circular-loader/CircularLoader.stories.tsx +109 -93
- package/dist/components/clamp-lines/ClampLines.stories.tsx +25 -0
- package/dist/components/clamp-lines/index.tsx +6 -1
- package/dist/components/collapsible/Collapsible.stories.tsx +1 -1
- package/dist/components/command/Command.stories.tsx +52 -38
- package/dist/components/dialog/Dialog.stories.tsx +89 -84
- package/dist/components/divider/Divider.stories.tsx +86 -60
- package/dist/components/dot-loader/DotLoader.stories.tsx +12 -12
- package/dist/components/drawer/Drawer.stories.tsx +74 -44
- package/dist/components/drawer/index.tsx +3 -3
- package/dist/components/dropdown/Dropdown.stories.tsx +42 -32
- package/dist/components/helper-text/HelperText.stories.tsx +2 -2
- package/dist/components/hover-card/HoverCard.stories.tsx +211 -178
- package/dist/components/input/Input.stories.tsx +2 -2
- package/dist/components/input/index.tsx +2 -0
- package/dist/components/label/Label.stories.tsx +10 -10
- package/dist/components/list/List.stories.tsx +58 -44
- package/dist/components/marquee/Marquee.stories.tsx +131 -113
- package/dist/components/otp-inputs/OtpInputs.stories.tsx +47 -35
- package/dist/components/overlay/Overlay.stories.tsx +98 -92
- package/dist/components/overlay/index.tsx +4 -4
- package/dist/components/popover/Popover.stories.tsx +132 -106
- package/dist/components/radio/Radio.stories.tsx +2 -2
- package/dist/components/resizable/Resizable.stories.tsx +186 -138
- package/dist/components/scroll-area/ScrollArea.stories.tsx +174 -120
- package/dist/components/search/Search.stories.tsx +81 -59
- package/dist/components/select/Select.stories.tsx +3 -1
- package/dist/components/sheet/Sheet.stories.tsx +68 -54
- package/dist/components/slider/Slider.stories.tsx +71 -47
- package/dist/components/stepper/Stepper.stories.tsx +16 -16
- package/dist/components/switch/Switch.stories.tsx +12 -12
- package/dist/components/table/Table.stories.tsx +8 -6
- package/dist/components/tabs/Tabs.stories.tsx +324 -268
- package/dist/components/textarea/TextArea.stories.tsx +1 -1
- package/dist/components/thumbnail-tags/ThumbnailTags.stories.tsx +16 -10
- package/dist/components/toast/Toast.stories.tsx +51 -45
- package/dist/components/toggle/Toggle.stories.tsx +111 -89
- package/dist/components/tooltip/Tooltip.stories.tsx +160 -144
- package/dist/icons/Icons.stories.tsx +2 -2
- package/dist/icons/ai-avatar-icon/AiAvatarIcon.stories.tsx +287 -237
- package/dist/icons/alert-icon/AlertIcon.stories.tsx +290 -248
- package/dist/icons/all-icons.tsx +97 -81
- package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +312 -270
- package/dist/icons/apple-logo-icon/AppleLogoIcon.stories.tsx +294 -244
- package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +309 -279
- package/dist/icons/arrow-corner-up-left-icon/ArrowCornerUpLeftIcon.stories.tsx +294 -258
- package/dist/icons/arrow-corner-up-right-icon/ArrowCornerUpRightIcon.stories.tsx +289 -255
- package/dist/icons/arrow-left-icon/ArrowLeftIcon.stories.tsx +288 -256
- package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +322 -288
- package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +340 -296
- package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +197 -177
- package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +390 -328
- package/dist/icons/backward-ten-seconds-icon/BackwardTenSecondsIcon.stories.tsx +313 -277
- package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +367 -309
- package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +356 -308
- package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +280 -234
- package/dist/icons/camera-icon/CameraIcon.stories.tsx +370 -326
- package/dist/icons/capital-a-letter-icon/CapitalALetterIcon.stories.tsx +300 -256
- package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +298 -262
- package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +294 -260
- package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +291 -259
- package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +286 -256
- package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +282 -256
- package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +292 -256
- package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +338 -290
- package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +167 -148
- package/dist/icons/coin-icon/CoinIcon.stories.tsx +342 -296
- package/dist/icons/coin-toons-icon/CoinToonsIcon.stories.tsx +342 -296
- package/dist/icons/column-wide-add-icon/ColumnWideAddIcon.stories.tsx +280 -238
- package/dist/icons/command-icon/CommandIcon.stories.tsx +328 -280
- package/dist/icons/copy-icon/CopyIcon.stories.tsx +294 -256
- package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +285 -235
- package/dist/icons/cross-icon/CrossIcon.stories.tsx +308 -266
- package/dist/icons/download-icon/DownloadIcon.stories.tsx +271 -231
- package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +330 -278
- package/dist/icons/email-icon/EmailIcon.stories.tsx +303 -257
- package/dist/icons/expand-icon/ExpandIcon.stories.tsx +324 -286
- package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +317 -271
- package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +320 -272
- package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +322 -280
- package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +315 -277
- package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +199 -177
- package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +304 -264
- package/dist/icons/forward-ten-seconds-icon/ForwardTenSecondsIcon.stories.tsx +311 -277
- package/dist/icons/git-branch-icon/GitBranchIcon.stories.tsx +327 -287
- package/dist/icons/git-fork-icon/GitForkIcon.stories.tsx +314 -278
- package/dist/icons/globe-icon/GlobeIcon.stories.tsx +113 -98
- package/dist/icons/google-logo-icon/GoogleLogoIcon.stories.tsx +274 -226
- package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +349 -303
- package/dist/icons/head-icon/HeadIcon.stories.tsx +286 -246
- package/dist/icons/heart-icon/HeartIcon.stories.tsx +312 -268
- package/dist/icons/image-avatar-sparkle-icon/ImageAvatarSparkleIcon.stories.tsx +246 -210
- package/dist/icons/image-icon/ImageIcon.stories.tsx +330 -284
- package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +326 -282
- package/dist/icons/import-left-arrow-folder-icon/ImportLeftArrowFolderIcon.stories.tsx +330 -294
- package/dist/icons/indian-flag-icon/IndianFlagIcon.stories.tsx +288 -234
- package/dist/icons/instagram-icon/InstagramIcon.stories.tsx +386 -330
- package/dist/icons/layout-column-icon/LayoutColumnIcon.stories.tsx +305 -263
- package/dist/icons/layout-left-icon/LayoutLeftIcon.stories.tsx +295 -259
- package/dist/icons/layout-right-icon/LayoutRightIcon.stories.tsx +296 -256
- package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +322 -282
- package/dist/icons/linked-in-icon/LinkedInIcon.stories.tsx +399 -359
- package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +314 -272
- package/dist/icons/magic-edit-icon/MagicEditIcon.stories.tsx +238 -206
- package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +322 -276
- package/dist/icons/message-icon/MessageIcon.stories.tsx +192 -170
- package/dist/icons/minimize-icon/MinimizeIcon.stories.tsx +348 -304
- package/dist/icons/moon-icon/MoonIcon.stories.tsx +191 -167
- package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +380 -326
- package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +345 -291
- package/dist/icons/musical-note-icon/MusicalNoteIcon.stories.tsx +310 -266
- package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +311 -271
- package/dist/icons/notes-icon/NotesIcon.stories.tsx +311 -271
- package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +309 -271
- package/dist/icons/page-text-icon/PageTextIcon.stories.tsx +248 -210
- package/dist/icons/paint-roll-icon/PaintRollIcon.stories.tsx +310 -262
- package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +274 -236
- package/dist/icons/pause-icon/PauseIcon.stories.tsx +324 -280
- package/dist/icons/pencil-icon/PencilIcon.stories.tsx +323 -281
- package/dist/icons/phone-icon/PhoneIcon.stories.tsx +288 -240
- package/dist/icons/plus-icon/PlusIcon.stories.tsx +315 -273
- package/dist/icons/pocket-studio-icon/PocketStudioIcon.stories.tsx +278 -234
- package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +161 -151
- package/dist/icons/search-icon/SearchIcon.stories.tsx +324 -284
- package/dist/icons/setting-icon/SettingIcon.stories.tsx +306 -264
- package/dist/icons/share-icon/ShareIcon.stories.tsx +314 -272
- package/dist/icons/shield-icon/ShieldIcon.stories.tsx +281 -235
- package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +309 -250
- package/dist/icons/skip-backward-icon/SkipBackwardIcon.stories.tsx +317 -279
- package/dist/icons/skip-forward-icon/SkipForwardIcon.stories.tsx +315 -279
- package/dist/icons/sparkles-soft-icon/SparklesSoftIcon.stories.tsx +299 -253
- package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +185 -169
- package/dist/icons/spinner-gradient-icon/index.tsx +6 -1
- package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +192 -168
- package/dist/icons/spinner-solid-icon/index.tsx +6 -1
- package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +212 -178
- package/dist/icons/spinner-solid-neutral-icon/index.tsx +1 -1
- package/dist/icons/star-icon/StarIcon.stories.tsx +290 -244
- package/dist/icons/store-coin-icon/StoreCoinIcon.stories.tsx +286 -234
- package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +272 -230
- package/dist/icons/sun-icon/SunIcon.stories.tsx +262 -226
- package/dist/icons/text-color-icon/TextColorIcon.stories.tsx +321 -279
- package/dist/icons/text-indicator-icon/TextIndicatorIcon.stories.tsx +332 -282
- package/dist/icons/threads-icon/ThreadsIcon.stories.tsx +394 -342
- package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +338 -290
- package/dist/icons/tick-icon/TickIcon.stories.tsx +364 -315
- package/dist/icons/trash-icon/TrashIcon.stories.tsx +293 -253
- package/dist/icons/twitter-x-icon/TwitterXIcon.stories.tsx +396 -338
- package/dist/icons/upload-icon/UploadIcon.stories.tsx +291 -247
- package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +309 -271
- package/dist/icons/video-play-list-icon/VideoPlaylistIcon.stories.tsx +336 -290
- package/dist/icons/voice-playing-icon/VoicePlayingIcon.stories.tsx +382 -334
- package/dist/icons/volume-full-icon/VolumeFullIcon.stories.tsx +349 -305
- package/dist/icons/volume-half-icon/VolumeHalfIcon.stories.tsx +327 -295
- package/dist/icons/volume-off-icon/VolumeOffIcon.stories.tsx +336 -296
- package/dist/icons/warning-icon/WarningIcon.stories.tsx +314 -274
- package/dist/icons/youtube-icon/YoutubeIcon.stories.tsx +311 -261
- package/dist/index.cjs +84 -84
- package/dist/index.js +84 -84
- package/dist/styles/aural-all-theme.css +1222 -0
- package/dist/styles/{aural-theme.css → aural-dark-theme.css} +15 -3
- package/dist/styles/aural-light-theme.css +1047 -0
- package/package.json +1 -1
|
@@ -40,54 +40,54 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
40
40
|
background: transparent !important;
|
|
41
41
|
}
|
|
42
42
|
body {
|
|
43
|
-
background:
|
|
43
|
+
background: var(--color-fm-surface-primary) !important;
|
|
44
44
|
}
|
|
45
45
|
#storybook-docs {
|
|
46
|
-
background:
|
|
46
|
+
background: var(--color-fm-surface-primary) !important;
|
|
47
47
|
}
|
|
48
48
|
.sbdocs-preview {
|
|
49
49
|
background: transparent !important;
|
|
50
50
|
border: none !important;
|
|
51
51
|
}
|
|
52
52
|
.sbdocs-h1, .sbdocs-h2, .sbdocs-h3, .sbdocs-h4, .sbdocs-h5, .sbdocs-h6 {
|
|
53
|
-
color:
|
|
53
|
+
color: var(--color-fm-icon-active) !important;
|
|
54
54
|
}
|
|
55
55
|
.sbdocs-p, .sbdocs-li {
|
|
56
|
-
color:
|
|
56
|
+
color: var(--color-fm-secondary) !important;
|
|
57
57
|
}
|
|
58
58
|
.sbdocs-code {
|
|
59
|
-
background:
|
|
60
|
-
color:
|
|
61
|
-
border: 1px solid
|
|
59
|
+
background: var(--color-fm-surface-secondary) !important;
|
|
60
|
+
color: var(--color-fm-secondary-500) !important;
|
|
61
|
+
border: 1px solid var(--color-fm-divider-secondary) !important;
|
|
62
62
|
}
|
|
63
63
|
.sbdocs-pre {
|
|
64
|
-
background:
|
|
65
|
-
border: 1px solid
|
|
64
|
+
background: var(--color-fm-surface-secondary) !important;
|
|
65
|
+
border: 1px solid var(--color-fm-divider-secondary) !important;
|
|
66
66
|
}
|
|
67
67
|
.sbdocs-table {
|
|
68
|
-
background:
|
|
69
|
-
border: 1px solid
|
|
68
|
+
background: var(--color-fm-surface-secondary) !important;
|
|
69
|
+
border: 1px solid var(--color-fm-divider-secondary) !important;
|
|
70
70
|
}
|
|
71
71
|
.sbdocs-table th {
|
|
72
|
-
background:
|
|
73
|
-
color:
|
|
74
|
-
border-bottom: 1px solid
|
|
72
|
+
background: var(--color-fm-surface-secondary) !important;
|
|
73
|
+
color: var(--color-fm-icon-active) !important;
|
|
74
|
+
border-bottom: 1px solid var(--color-fm-divider-secondary) !important;
|
|
75
75
|
}
|
|
76
76
|
.sbdocs-table td {
|
|
77
|
-
color:
|
|
78
|
-
border-bottom: 1px solid
|
|
77
|
+
color: var(--color-fm-secondary) !important;
|
|
78
|
+
border-bottom: 1px solid var(--color-fm-divider-tertiary) !important;
|
|
79
79
|
}
|
|
80
80
|
`}
|
|
81
81
|
</style>
|
|
82
82
|
|
|
83
|
-
<div className="
|
|
83
|
+
<div className="bg-fm-surface-primary min-h-screen">
|
|
84
84
|
{/* Header */}
|
|
85
|
-
<div className="relative overflow-hidden border-b
|
|
86
|
-
<div className="absolute inset-0 bg-gradient-to-r
|
|
85
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary/50 relative overflow-hidden border-b backdrop-blur-xl">
|
|
86
|
+
<div className="from-fm-secondary-500/10 to-fm-blue-500/10 absolute inset-0 bg-gradient-to-r via-transparent" />
|
|
87
87
|
<div className="relative !mx-auto max-w-7xl px-6 py-16">
|
|
88
88
|
<div className="!space-y-6 text-center">
|
|
89
|
-
<h1 className="!text-
|
|
90
|
-
<p className="!mx-auto max-w-3xl text-xl leading-relaxed
|
|
89
|
+
<h1 className="!text-fm-primary">AspectRatio</h1>
|
|
90
|
+
<p className="!text-fm-primary !mx-auto max-w-3xl text-xl leading-relaxed">
|
|
91
91
|
A utility component for maintaining consistent aspect ratios
|
|
92
92
|
across different content types and screen sizes. Built on
|
|
93
93
|
Radix UI primitives for reliability and accessibility.
|
|
@@ -96,28 +96,28 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
96
96
|
{/* Stats */}
|
|
97
97
|
<div className="flex items-center justify-center gap-8 pt-8">
|
|
98
98
|
<div className="text-center">
|
|
99
|
-
<div className="text-3xl font-bold
|
|
99
|
+
<div className="text-fm-icon-brand-secondary text-3xl font-bold">
|
|
100
100
|
Responsive
|
|
101
101
|
</div>
|
|
102
|
-
<div className="text-
|
|
102
|
+
<div className="text-fm-tertiary text-sm">
|
|
103
103
|
Adapts to container
|
|
104
104
|
</div>
|
|
105
105
|
</div>
|
|
106
|
-
<div className="h-8 w-px
|
|
106
|
+
<div className="bg-fm-surface-tertiary h-8 w-px" />
|
|
107
107
|
<div className="text-center">
|
|
108
|
-
<div className="text-3xl font-bold
|
|
108
|
+
<div className="text-fm-info text-3xl font-bold">
|
|
109
109
|
Flexible
|
|
110
110
|
</div>
|
|
111
|
-
<div className="text-
|
|
111
|
+
<div className="text-fm-tertiary text-sm">
|
|
112
112
|
Any content type
|
|
113
113
|
</div>
|
|
114
114
|
</div>
|
|
115
|
-
<div className="h-8 w-px
|
|
115
|
+
<div className="bg-fm-surface-tertiary h-8 w-px" />
|
|
116
116
|
<div className="text-center">
|
|
117
|
-
<div className="text-3xl font-bold
|
|
117
|
+
<div className="text-fm-positive text-3xl font-bold">
|
|
118
118
|
Consistent
|
|
119
119
|
</div>
|
|
120
|
-
<div className="text-
|
|
120
|
+
<div className="text-fm-tertiary text-sm">
|
|
121
121
|
Maintains ratio
|
|
122
122
|
</div>
|
|
123
123
|
</div>
|
|
@@ -130,35 +130,35 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
130
130
|
<div className="!mx-auto max-w-7xl !space-y-16 px-6 py-12">
|
|
131
131
|
{/* Features */}
|
|
132
132
|
<div className="!space-y-8">
|
|
133
|
-
<h3 className="text-center text-2xl font-bold
|
|
133
|
+
<h3 className="!text-fm-primary text-center text-2xl font-bold">
|
|
134
134
|
Key Features
|
|
135
135
|
</h3>
|
|
136
136
|
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
|
|
137
|
-
<div className="space-y-4 rounded-lg border
|
|
137
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-4 rounded-lg border p-6">
|
|
138
138
|
<div className="text-3xl">📐</div>
|
|
139
|
-
<h4 className="text-lg font-semibold
|
|
139
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
140
140
|
Consistent Ratios
|
|
141
141
|
</h4>
|
|
142
|
-
<p className="text-
|
|
142
|
+
<p className="!text-fm-tertiary text-sm">
|
|
143
143
|
Maintains specified aspect ratios regardless of container
|
|
144
144
|
size changes
|
|
145
145
|
</p>
|
|
146
146
|
</div>
|
|
147
|
-
<div className="space-y-4 rounded-lg border
|
|
147
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-4 rounded-lg border p-6">
|
|
148
148
|
<div className="text-3xl">📱</div>
|
|
149
|
-
<h4 className="text-lg font-semibold
|
|
149
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
150
150
|
Responsive Design
|
|
151
151
|
</h4>
|
|
152
|
-
<p className="text-
|
|
152
|
+
<p className="!text-fm-tertiary text-sm">
|
|
153
153
|
Adapts to parent container while preserving aspect ratio
|
|
154
154
|
</p>
|
|
155
155
|
</div>
|
|
156
|
-
<div className="space-y-4 rounded-lg border
|
|
156
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-4 rounded-lg border p-6">
|
|
157
157
|
<div className="text-3xl">🎨</div>
|
|
158
|
-
<h4 className="text-lg font-semibold
|
|
158
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
159
159
|
Flexible Content
|
|
160
160
|
</h4>
|
|
161
|
-
<p className="text-
|
|
161
|
+
<p className="!text-fm-tertiary text-sm">
|
|
162
162
|
Works with images, videos, iframes, and any custom content
|
|
163
163
|
</p>
|
|
164
164
|
</div>
|
|
@@ -167,17 +167,17 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
167
167
|
|
|
168
168
|
{/* API Reference */}
|
|
169
169
|
<div className="!space-y-8">
|
|
170
|
-
<h3 className="text-center text-2xl font-bold
|
|
170
|
+
<h3 className="!text-fm-primary text-center text-2xl font-bold">
|
|
171
171
|
API Reference
|
|
172
172
|
</h3>
|
|
173
173
|
|
|
174
174
|
{/* Component Signature */}
|
|
175
|
-
<div className="rounded-lg border
|
|
176
|
-
<h4 className="mb-4 text-lg font-semibold
|
|
175
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-6">
|
|
176
|
+
<h4 className="!text-fm-icon-brand-secondary mb-4 text-lg font-semibold">
|
|
177
177
|
Component Signature
|
|
178
178
|
</h4>
|
|
179
|
-
<div className="rounded-lg
|
|
180
|
-
<pre className="text-
|
|
179
|
+
<div className="bg-fm-surface-secondary rounded-lg p-4">
|
|
180
|
+
<pre className="!text-fm-info text-sm">
|
|
181
181
|
{`import { AspectRatio } from "@/components/ui/aspect-ratio"
|
|
182
182
|
|
|
183
183
|
<AspectRatio ratio={16 / 9}>
|
|
@@ -188,61 +188,69 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
188
188
|
</div>
|
|
189
189
|
|
|
190
190
|
{/* Props Table */}
|
|
191
|
-
<div className="overflow-hidden rounded-lg border
|
|
192
|
-
<div className="bg-
|
|
193
|
-
<h4 className="text-lg font-semibold
|
|
191
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary overflow-hidden rounded-lg border">
|
|
192
|
+
<div className="bg-fm-surface-secondary p-4">
|
|
193
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
194
|
+
Props
|
|
195
|
+
</h4>
|
|
194
196
|
</div>
|
|
195
197
|
<table className="!my-0 w-full">
|
|
196
|
-
<thead className="bg-
|
|
197
|
-
<tr className="border-
|
|
198
|
-
<th className="px-6 py-4 text-left text-sm font-semibold
|
|
198
|
+
<thead className="bg-fm-surface-secondary">
|
|
199
|
+
<tr className="border-fm-divider-secondary border-b">
|
|
200
|
+
<th className="!text-fm-primary px-6 py-4 text-left text-sm font-semibold">
|
|
199
201
|
Prop
|
|
200
202
|
</th>
|
|
201
|
-
<th className="px-6 py-4 text-left text-sm font-semibold
|
|
203
|
+
<th className="!text-fm-primary px-6 py-4 text-left text-sm font-semibold">
|
|
202
204
|
Type
|
|
203
205
|
</th>
|
|
204
|
-
<th className="px-6 py-4 text-left text-sm font-semibold
|
|
206
|
+
<th className="!text-fm-primary px-6 py-4 text-left text-sm font-semibold">
|
|
205
207
|
Default
|
|
206
208
|
</th>
|
|
207
|
-
<th className="px-6 py-4 text-left text-sm font-semibold
|
|
209
|
+
<th className="!text-fm-primary px-6 py-4 text-left text-sm font-semibold">
|
|
208
210
|
Description
|
|
209
211
|
</th>
|
|
210
212
|
</tr>
|
|
211
213
|
</thead>
|
|
212
214
|
<tbody>
|
|
213
|
-
<tr className="border-
|
|
214
|
-
<td className="px-6 py-4 font-mono text-sm
|
|
215
|
+
<tr className="border-fm-divider-secondary border-b">
|
|
216
|
+
<td className="!text-fm-icon-brand-secondary px-6 py-4 font-mono text-sm">
|
|
215
217
|
ratio
|
|
216
218
|
</td>
|
|
217
|
-
<td className="px-6 py-4 text-sm
|
|
219
|
+
<td className="!text-fm-tertiary px-6 py-4 text-sm">
|
|
218
220
|
number
|
|
219
221
|
</td>
|
|
220
|
-
<td className="px-6 py-4 text-sm
|
|
221
|
-
|
|
222
|
+
<td className="!text-fm-secondary px-6 py-4 text-sm">
|
|
223
|
+
1
|
|
224
|
+
</td>
|
|
225
|
+
<td className="!text-fm-tertiary px-6 py-4 text-sm">
|
|
222
226
|
The desired aspect ratio (width / height)
|
|
223
227
|
</td>
|
|
224
228
|
</tr>
|
|
225
|
-
<tr className="border-
|
|
226
|
-
<td className="px-6 py-4 font-mono text-sm
|
|
229
|
+
<tr className="border-fm-divider-secondary border-b !bg-transparent">
|
|
230
|
+
<td className="!text-fm-icon-brand-secondary px-6 py-4 font-mono text-sm">
|
|
227
231
|
children
|
|
228
232
|
</td>
|
|
229
|
-
<td className="px-6 py-4 text-sm
|
|
233
|
+
<td className="!text-fm-tertiary px-6 py-4 text-sm">
|
|
230
234
|
ReactNode
|
|
231
235
|
</td>
|
|
232
|
-
<td className="px-6 py-4 text-sm
|
|
233
|
-
|
|
236
|
+
<td className="!text-fm-secondary px-6 py-4 text-sm">
|
|
237
|
+
-
|
|
238
|
+
</td>
|
|
239
|
+
<td className="!text-fm-tertiary px-6 py-4 text-sm">
|
|
234
240
|
Content to maintain aspect ratio for
|
|
235
241
|
</td>
|
|
236
242
|
</tr>
|
|
237
243
|
<tr>
|
|
238
|
-
<td className="px-6 py-4 font-mono text-sm
|
|
244
|
+
<td className="!text-fm-icon-brand-secondary px-6 py-4 font-mono text-sm">
|
|
239
245
|
className
|
|
240
246
|
</td>
|
|
241
|
-
<td className="px-6 py-4 text-sm
|
|
247
|
+
<td className="!text-fm-tertiary px-6 py-4 text-sm">
|
|
242
248
|
string
|
|
243
249
|
</td>
|
|
244
|
-
<td className="px-6 py-4 text-sm
|
|
245
|
-
|
|
250
|
+
<td className="!text-fm-secondary px-6 py-4 text-sm">
|
|
251
|
+
-
|
|
252
|
+
</td>
|
|
253
|
+
<td className="!text-fm-tertiary px-6 py-4 text-sm">
|
|
246
254
|
Additional CSS classes
|
|
247
255
|
</td>
|
|
248
256
|
</tr>
|
|
@@ -253,17 +261,17 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
253
261
|
|
|
254
262
|
{/* Usage Examples */}
|
|
255
263
|
<div className="!space-y-8">
|
|
256
|
-
<h3 className="text-center text-2xl font-bold
|
|
264
|
+
<h3 className="!text-fm-primary text-center text-2xl font-bold">
|
|
257
265
|
Usage Examples
|
|
258
266
|
</h3>
|
|
259
267
|
|
|
260
268
|
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
261
269
|
<div className="space-y-4">
|
|
262
|
-
<h4 className="text-lg font-semibold
|
|
270
|
+
<h4 className="!text-fm-icon-brand-secondary text-lg font-semibold">
|
|
263
271
|
Basic Image
|
|
264
272
|
</h4>
|
|
265
|
-
<div className="rounded-lg
|
|
266
|
-
<pre className="overflow-x-auto text-sm
|
|
273
|
+
<div className="bg-fm-surface-secondary rounded-lg p-4">
|
|
274
|
+
<pre className="!text-fm-positive overflow-x-auto text-sm">
|
|
267
275
|
{`<AspectRatio ratio={16 / 9}>
|
|
268
276
|
<img
|
|
269
277
|
src="/image.jpg"
|
|
@@ -276,11 +284,11 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
276
284
|
</div>
|
|
277
285
|
|
|
278
286
|
<div className="space-y-4">
|
|
279
|
-
<h4 className="text-lg font-semibold
|
|
287
|
+
<h4 className="!text-fm-icon-brand-secondary text-lg font-semibold">
|
|
280
288
|
Video Embed
|
|
281
289
|
</h4>
|
|
282
|
-
<div className="rounded-lg
|
|
283
|
-
<pre className="overflow-x-auto text-sm
|
|
290
|
+
<div className="bg-fm-surface-secondary rounded-lg p-4">
|
|
291
|
+
<pre className="!text-fm-info overflow-x-auto text-sm">
|
|
284
292
|
{`<AspectRatio ratio={16 / 9}>
|
|
285
293
|
<iframe
|
|
286
294
|
src="https://www.youtube.com/embed/..."
|
|
@@ -292,11 +300,11 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
292
300
|
</div>
|
|
293
301
|
|
|
294
302
|
<div className="space-y-4">
|
|
295
|
-
<h4 className="text-lg font-semibold
|
|
303
|
+
<h4 className="!text-fm-icon-brand-secondary text-lg font-semibold">
|
|
296
304
|
Custom Content
|
|
297
305
|
</h4>
|
|
298
|
-
<div className="rounded-lg
|
|
299
|
-
<pre className="overflow-x-auto text-sm
|
|
306
|
+
<div className="bg-fm-surface-secondary rounded-lg p-4">
|
|
307
|
+
<pre className="!text-fm-warning overflow-x-auto text-sm">
|
|
300
308
|
{`<AspectRatio ratio={1}>
|
|
301
309
|
<div className="flex h-full w-full items-center
|
|
302
310
|
justify-center bg-gradient-to-br
|
|
@@ -309,11 +317,11 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
309
317
|
</div>
|
|
310
318
|
|
|
311
319
|
<div className="space-y-4">
|
|
312
|
-
<h4 className="text-lg font-semibold
|
|
320
|
+
<h4 className="!text-fm-icon-brand-secondary text-lg font-semibold">
|
|
313
321
|
Common Ratios
|
|
314
322
|
</h4>
|
|
315
|
-
<div className="rounded-lg
|
|
316
|
-
<pre className="overflow-x-auto text-sm
|
|
323
|
+
<div className="bg-fm-surface-secondary rounded-lg p-4">
|
|
324
|
+
<pre className="!text-fm-secondary overflow-x-auto text-sm">
|
|
317
325
|
{`// Common aspect ratios
|
|
318
326
|
16/9 // Widescreen, video
|
|
319
327
|
4/3 // Traditional, photo
|
|
@@ -329,7 +337,7 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
329
337
|
|
|
330
338
|
{/* Common Ratios Visual Guide */}
|
|
331
339
|
<div className="!space-y-8">
|
|
332
|
-
<h3 className="text-center text-2xl font-bold
|
|
340
|
+
<h3 className="!text-fm-primary text-center text-2xl font-bold">
|
|
333
341
|
Common Aspect Ratios
|
|
334
342
|
</h3>
|
|
335
343
|
<div className="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6">
|
|
@@ -374,7 +382,7 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
374
382
|
<div key={item.label} className="space-y-3">
|
|
375
383
|
<AspectRatio ratio={item.ratio}>
|
|
376
384
|
<div
|
|
377
|
-
className={`flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br ${item.color} text-
|
|
385
|
+
className={`flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br ${item.color} text-fm-primary shadow-lg`}
|
|
378
386
|
>
|
|
379
387
|
<div className="text-center">
|
|
380
388
|
<div className="text-sm font-bold">
|
|
@@ -384,10 +392,10 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
384
392
|
</div>
|
|
385
393
|
</AspectRatio>
|
|
386
394
|
<div className="text-center">
|
|
387
|
-
<div className="text-sm font-medium
|
|
395
|
+
<div className="text-fm-primary text-sm font-medium">
|
|
388
396
|
{item.name}
|
|
389
397
|
</div>
|
|
390
|
-
<div className="text-
|
|
398
|
+
<div className="text-fm-secondary text-xs">
|
|
391
399
|
{item.label}
|
|
392
400
|
</div>
|
|
393
401
|
</div>
|
|
@@ -398,62 +406,62 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
398
406
|
|
|
399
407
|
{/* Use Cases */}
|
|
400
408
|
<div className="!space-y-8">
|
|
401
|
-
<h3 className="text-center text-2xl font-bold
|
|
409
|
+
<h3 className="!text-fm-primary text-center text-2xl font-bold">
|
|
402
410
|
Common Use Cases
|
|
403
411
|
</h3>
|
|
404
412
|
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
|
|
405
|
-
<div className="space-y-3 rounded-lg border
|
|
413
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-3 rounded-lg border p-6">
|
|
406
414
|
<div className="text-2xl">🖼️</div>
|
|
407
|
-
<h4 className="text-lg font-semibold
|
|
415
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
408
416
|
Image Galleries
|
|
409
417
|
</h4>
|
|
410
|
-
<p className="text-
|
|
418
|
+
<p className="!text-fm-tertiary text-sm">
|
|
411
419
|
Consistent thumbnail sizes across different image
|
|
412
420
|
dimensions
|
|
413
421
|
</p>
|
|
414
422
|
</div>
|
|
415
|
-
<div className="space-y-3 rounded-lg border
|
|
423
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-3 rounded-lg border p-6">
|
|
416
424
|
<div className="text-2xl">🎬</div>
|
|
417
|
-
<h4 className="text-lg font-semibold
|
|
425
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
418
426
|
Video Players
|
|
419
427
|
</h4>
|
|
420
|
-
<p className="text-
|
|
428
|
+
<p className="!text-fm-tertiary text-sm">
|
|
421
429
|
Standard video aspect ratios like 16:9 and 4:3
|
|
422
430
|
</p>
|
|
423
431
|
</div>
|
|
424
|
-
<div className="space-y-3 rounded-lg border
|
|
432
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-3 rounded-lg border p-6">
|
|
425
433
|
<div className="text-2xl">🃏</div>
|
|
426
|
-
<h4 className="text-lg font-semibold
|
|
434
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
427
435
|
Card Layouts
|
|
428
436
|
</h4>
|
|
429
|
-
<p className="text-
|
|
437
|
+
<p className="!text-fm-tertiary text-sm">
|
|
430
438
|
Uniform card dimensions for consistent grid layouts
|
|
431
439
|
</p>
|
|
432
440
|
</div>
|
|
433
|
-
<div className="space-y-3 rounded-lg border
|
|
441
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-3 rounded-lg border p-6">
|
|
434
442
|
<div className="text-2xl">📺</div>
|
|
435
|
-
<h4 className="text-lg font-semibold
|
|
443
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
436
444
|
Media Embeds
|
|
437
445
|
</h4>
|
|
438
|
-
<p className="text-
|
|
446
|
+
<p className="!text-fm-tertiary text-sm">
|
|
439
447
|
YouTube, Vimeo, and social media embeds
|
|
440
448
|
</p>
|
|
441
449
|
</div>
|
|
442
|
-
<div className="space-y-3 rounded-lg border
|
|
450
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-3 rounded-lg border p-6">
|
|
443
451
|
<div className="text-2xl">🛍️</div>
|
|
444
|
-
<h4 className="text-lg font-semibold
|
|
452
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
445
453
|
Product Images
|
|
446
454
|
</h4>
|
|
447
|
-
<p className="text-
|
|
455
|
+
<p className="!text-fm-tertiary text-sm">
|
|
448
456
|
E-commerce product displays with consistent sizing
|
|
449
457
|
</p>
|
|
450
458
|
</div>
|
|
451
|
-
<div className="space-y-3 rounded-lg border
|
|
459
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-3 rounded-lg border p-6">
|
|
452
460
|
<div className="text-2xl">👤</div>
|
|
453
|
-
<h4 className="text-lg font-semibold
|
|
461
|
+
<h4 className="!text-fm-primary text-lg font-semibold">
|
|
454
462
|
Profile Pictures
|
|
455
463
|
</h4>
|
|
456
|
-
<p className="text-
|
|
464
|
+
<p className="!text-fm-tertiary text-sm">
|
|
457
465
|
Square avatar containers for user profiles
|
|
458
466
|
</p>
|
|
459
467
|
</div>
|
|
@@ -462,52 +470,52 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
462
470
|
|
|
463
471
|
{/* Best Practices */}
|
|
464
472
|
<div className="!space-y-8">
|
|
465
|
-
<h3 className="text-center text-2xl font-bold
|
|
473
|
+
<h3 className="!text-fm-primary text-center text-2xl font-bold">
|
|
466
474
|
Best Practices
|
|
467
475
|
</h3>
|
|
468
476
|
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
469
|
-
<div className="space-y-4 rounded-lg border
|
|
470
|
-
<h4 className="text-lg font-semibold
|
|
477
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-4 rounded-lg border p-6">
|
|
478
|
+
<h4 className="!text-fm-positive text-lg font-semibold">
|
|
471
479
|
✅ Do
|
|
472
480
|
</h4>
|
|
473
|
-
<ul className="space-y-2 text-sm
|
|
474
|
-
<li className="!text-
|
|
481
|
+
<ul className="!text-fm-tertiary space-y-2 text-sm">
|
|
482
|
+
<li className="!text-fm-tertiary">
|
|
475
483
|
Use consistent ratios across similar content types
|
|
476
484
|
</li>
|
|
477
|
-
<li className="!text-
|
|
485
|
+
<li className="!text-fm-tertiary">
|
|
478
486
|
Choose ratios that match your content's natural
|
|
479
487
|
proportions
|
|
480
488
|
</li>
|
|
481
|
-
<li className="!text-
|
|
489
|
+
<li className="!text-fm-tertiary">
|
|
482
490
|
Apply object-fit: cover for images to maintain quality
|
|
483
491
|
</li>
|
|
484
|
-
<li className="!text-
|
|
492
|
+
<li className="!text-fm-tertiary">
|
|
485
493
|
Test ratios across different screen sizes
|
|
486
494
|
</li>
|
|
487
|
-
<li className="!text-
|
|
495
|
+
<li className="!text-fm-tertiary">
|
|
488
496
|
Use semantic aspect ratios (16:9 for video, 1:1 for
|
|
489
497
|
avatars)
|
|
490
498
|
</li>
|
|
491
499
|
</ul>
|
|
492
500
|
</div>
|
|
493
|
-
<div className="space-y-4 rounded-lg border
|
|
494
|
-
<h4 className="text-lg font-semibold
|
|
501
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-4 rounded-lg border p-6">
|
|
502
|
+
<h4 className="!text-fm-negative text-lg font-semibold">
|
|
495
503
|
❌ Don't
|
|
496
504
|
</h4>
|
|
497
|
-
<ul className="space-y-2 text-sm
|
|
498
|
-
<li className="!text-
|
|
505
|
+
<ul className="!text-fm-tertiary space-y-2 text-sm">
|
|
506
|
+
<li className="!text-fm-tertiary">
|
|
499
507
|
Mix different ratios in the same content grid
|
|
500
508
|
</li>
|
|
501
|
-
<li className="!text-
|
|
509
|
+
<li className="!text-fm-tertiary">
|
|
502
510
|
Use extreme ratios that distort content
|
|
503
511
|
</li>
|
|
504
|
-
<li className="!text-
|
|
512
|
+
<li className="!text-fm-tertiary">
|
|
505
513
|
Forget to handle different content types gracefully
|
|
506
514
|
</li>
|
|
507
|
-
<li className="!text-
|
|
515
|
+
<li className="!text-fm-tertiary">
|
|
508
516
|
Ignore responsive behavior on mobile devices
|
|
509
517
|
</li>
|
|
510
|
-
<li className="!text-
|
|
518
|
+
<li className="!text-fm-tertiary">
|
|
511
519
|
Use ratios that don't match platform conventions
|
|
512
520
|
</li>
|
|
513
521
|
</ul>
|
|
@@ -517,14 +525,14 @@ const meta: Meta<typeof AspectRatio> = {
|
|
|
517
525
|
</div>
|
|
518
526
|
|
|
519
527
|
{/* Footer */}
|
|
520
|
-
<div className="border-
|
|
528
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary/50 border-t backdrop-blur-xl">
|
|
521
529
|
<div className="!mx-auto max-w-7xl px-6 py-8">
|
|
522
530
|
<div className="space-y-4 text-center">
|
|
523
|
-
<p className="!text-
|
|
531
|
+
<p className="!text-fm-secondary">
|
|
524
532
|
AspectRatio component built on Radix UI primitives for
|
|
525
533
|
reliability and accessibility.
|
|
526
534
|
</p>
|
|
527
|
-
<p className="text-
|
|
535
|
+
<p className="!text-fm-tertiary text-sm">
|
|
528
536
|
Maintains consistent aspect ratios while being fully
|
|
529
537
|
responsive and flexible.
|
|
530
538
|
</p>
|
|
@@ -547,8 +555,8 @@ const storyParameters = {
|
|
|
547
555
|
backgrounds: {
|
|
548
556
|
default: "dark",
|
|
549
557
|
values: [
|
|
550
|
-
{ name: "dark", value: "
|
|
551
|
-
{ name: "darker", value: "
|
|
558
|
+
{ name: "dark", value: "var(--color-fm-surface-primary)" },
|
|
559
|
+
{ name: "darker", value: "var(--color-fm-neutral-0)" },
|
|
552
560
|
],
|
|
553
561
|
},
|
|
554
562
|
}
|
|
@@ -556,13 +564,13 @@ const storyParameters = {
|
|
|
556
564
|
// 1. Common Aspect Ratios
|
|
557
565
|
export const CommonRatios: Story = {
|
|
558
566
|
render: () => (
|
|
559
|
-
<div className="
|
|
567
|
+
<div className="from-fm-surface-primary via-fm-secondary-50/10 to-fm-surface-primary min-h-screen bg-linear-to-br p-8">
|
|
560
568
|
<div className="mx-auto max-w-7xl space-y-12">
|
|
561
569
|
<div className="text-center">
|
|
562
|
-
<h3 className="
|
|
570
|
+
<h3 className="from-fm-primary via-fm-icon-brand-secondary to-fm-primary mb-4 bg-linear-to-r bg-clip-text text-3xl font-bold text-transparent">
|
|
563
571
|
Common Aspect Ratios
|
|
564
572
|
</h3>
|
|
565
|
-
<p className="mx-auto max-w-2xl text-lg
|
|
573
|
+
<p className="text-fm-tertiary mx-auto max-w-2xl text-lg">
|
|
566
574
|
Standard aspect ratios for different content types, each optimized
|
|
567
575
|
for specific use cases
|
|
568
576
|
</p>
|
|
@@ -573,7 +581,7 @@ export const CommonRatios: Story = {
|
|
|
573
581
|
<div className="group space-y-4">
|
|
574
582
|
<div className="mx-auto w-full max-w-sm">
|
|
575
583
|
<AspectRatio ratio={1}>
|
|
576
|
-
<div className="flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-purple-500 to-pink-500
|
|
584
|
+
<div className="text-fm-primary flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-purple-500 to-pink-500 shadow-xl transition-transform duration-300 group-hover:scale-105">
|
|
577
585
|
<div className="text-center">
|
|
578
586
|
<div className="text-2xl font-bold">1:1</div>
|
|
579
587
|
<div className="text-sm opacity-80">Square</div>
|
|
@@ -582,8 +590,10 @@ export const CommonRatios: Story = {
|
|
|
582
590
|
</AspectRatio>
|
|
583
591
|
</div>
|
|
584
592
|
<div className="text-center">
|
|
585
|
-
<h4 className="text-lg font-semibold
|
|
586
|
-
|
|
593
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
594
|
+
Square (1:1)
|
|
595
|
+
</h4>
|
|
596
|
+
<p className="text-fm-secondary text-sm">
|
|
587
597
|
Profile pictures, avatars, social media posts
|
|
588
598
|
</p>
|
|
589
599
|
</div>
|
|
@@ -593,7 +603,7 @@ export const CommonRatios: Story = {
|
|
|
593
603
|
<div className="group space-y-4">
|
|
594
604
|
<div className="mx-auto w-full max-w-sm">
|
|
595
605
|
<AspectRatio ratio={16 / 9}>
|
|
596
|
-
<div className="flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-blue-500 to-cyan-500
|
|
606
|
+
<div className="text-fm-primary flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-blue-500 to-cyan-500 shadow-xl transition-transform duration-300 group-hover:scale-105">
|
|
597
607
|
<div className="text-center">
|
|
598
608
|
<div className="text-2xl font-bold">16:9</div>
|
|
599
609
|
<div className="text-sm opacity-80">Widescreen</div>
|
|
@@ -602,10 +612,10 @@ export const CommonRatios: Story = {
|
|
|
602
612
|
</AspectRatio>
|
|
603
613
|
</div>
|
|
604
614
|
<div className="text-center">
|
|
605
|
-
<h4 className="text-lg font-semibold
|
|
615
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
606
616
|
Widescreen (16:9)
|
|
607
617
|
</h4>
|
|
608
|
-
<p className="text-
|
|
618
|
+
<p className="text-fm-secondary text-sm">
|
|
609
619
|
Videos, presentations, modern displays
|
|
610
620
|
</p>
|
|
611
621
|
</div>
|
|
@@ -615,7 +625,7 @@ export const CommonRatios: Story = {
|
|
|
615
625
|
<div className="group space-y-4">
|
|
616
626
|
<div className="mx-auto w-full max-w-sm">
|
|
617
627
|
<AspectRatio ratio={4 / 3}>
|
|
618
|
-
<div className="flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-green-500 to-emerald-500
|
|
628
|
+
<div className="text-fm-primary flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-green-500 to-emerald-500 shadow-xl transition-transform duration-300 group-hover:scale-105">
|
|
619
629
|
<div className="text-center">
|
|
620
630
|
<div className="text-2xl font-bold">4:3</div>
|
|
621
631
|
<div className="text-sm opacity-80">Traditional</div>
|
|
@@ -624,10 +634,10 @@ export const CommonRatios: Story = {
|
|
|
624
634
|
</AspectRatio>
|
|
625
635
|
</div>
|
|
626
636
|
<div className="text-center">
|
|
627
|
-
<h4 className="text-lg font-semibold
|
|
637
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
628
638
|
Traditional (4:3)
|
|
629
639
|
</h4>
|
|
630
|
-
<p className="text-
|
|
640
|
+
<p className="text-fm-secondary text-sm">
|
|
631
641
|
Classic photos, old TV format
|
|
632
642
|
</p>
|
|
633
643
|
</div>
|
|
@@ -637,7 +647,7 @@ export const CommonRatios: Story = {
|
|
|
637
647
|
<div className="group space-y-4">
|
|
638
648
|
<div className="mx-auto w-full max-w-sm">
|
|
639
649
|
<AspectRatio ratio={3 / 2}>
|
|
640
|
-
<div className="flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-orange-500 to-red-500
|
|
650
|
+
<div className="text-fm-primary flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-orange-500 to-red-500 shadow-xl transition-transform duration-300 group-hover:scale-105">
|
|
641
651
|
<div className="text-center">
|
|
642
652
|
<div className="text-2xl font-bold">3:2</div>
|
|
643
653
|
<div className="text-sm opacity-80">Photography</div>
|
|
@@ -646,10 +656,12 @@ export const CommonRatios: Story = {
|
|
|
646
656
|
</AspectRatio>
|
|
647
657
|
</div>
|
|
648
658
|
<div className="text-center">
|
|
649
|
-
<h4 className="text-lg font-semibold
|
|
659
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
650
660
|
Photography (3:2)
|
|
651
661
|
</h4>
|
|
652
|
-
<p className="text-
|
|
662
|
+
<p className="text-fm-secondary text-sm">
|
|
663
|
+
35mm film, DSLR cameras
|
|
664
|
+
</p>
|
|
653
665
|
</div>
|
|
654
666
|
</div>
|
|
655
667
|
|
|
@@ -657,7 +669,7 @@ export const CommonRatios: Story = {
|
|
|
657
669
|
<div className="group space-y-4">
|
|
658
670
|
<div className="mx-auto w-full max-w-sm">
|
|
659
671
|
<AspectRatio ratio={21 / 9}>
|
|
660
|
-
<div className="flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-indigo-500 to-purple-500
|
|
672
|
+
<div className="text-fm-primary flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-indigo-500 to-purple-500 shadow-xl transition-transform duration-300 group-hover:scale-105">
|
|
661
673
|
<div className="text-center">
|
|
662
674
|
<div className="text-2xl font-bold">21:9</div>
|
|
663
675
|
<div className="text-sm opacity-80">Ultra-wide</div>
|
|
@@ -666,10 +678,10 @@ export const CommonRatios: Story = {
|
|
|
666
678
|
</AspectRatio>
|
|
667
679
|
</div>
|
|
668
680
|
<div className="text-center">
|
|
669
|
-
<h4 className="text-lg font-semibold
|
|
681
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
670
682
|
Ultra-wide (21:9)
|
|
671
683
|
</h4>
|
|
672
|
-
<p className="text-
|
|
684
|
+
<p className="text-fm-secondary text-sm">
|
|
673
685
|
Cinematic, gaming monitors
|
|
674
686
|
</p>
|
|
675
687
|
</div>
|
|
@@ -679,7 +691,7 @@ export const CommonRatios: Story = {
|
|
|
679
691
|
<div className="group space-y-4">
|
|
680
692
|
<div className="mx-auto w-full max-w-sm">
|
|
681
693
|
<AspectRatio ratio={9 / 16}>
|
|
682
|
-
<div className="flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-pink-500 to-rose-500
|
|
694
|
+
<div className="text-fm-primary flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-pink-500 to-rose-500 shadow-xl transition-transform duration-300 group-hover:scale-105">
|
|
683
695
|
<div className="text-center">
|
|
684
696
|
<div className="text-2xl font-bold">9:16</div>
|
|
685
697
|
<div className="text-sm opacity-80">Portrait</div>
|
|
@@ -688,10 +700,10 @@ export const CommonRatios: Story = {
|
|
|
688
700
|
</AspectRatio>
|
|
689
701
|
</div>
|
|
690
702
|
<div className="text-center">
|
|
691
|
-
<h4 className="text-lg font-semibold
|
|
703
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
692
704
|
Portrait (9:16)
|
|
693
705
|
</h4>
|
|
694
|
-
<p className="text-
|
|
706
|
+
<p className="text-fm-secondary text-sm">
|
|
695
707
|
Mobile screens, stories, reels
|
|
696
708
|
</p>
|
|
697
709
|
</div>
|
|
@@ -714,13 +726,13 @@ export const CommonRatios: Story = {
|
|
|
714
726
|
// 2. Image Gallery Example
|
|
715
727
|
export const ImageGallery: Story = {
|
|
716
728
|
render: () => (
|
|
717
|
-
<div className="
|
|
729
|
+
<div className="from-fm-surface-primary via-fm-secondary-50/10 to-fm-surface-primary min-h-screen bg-linear-to-br p-8">
|
|
718
730
|
<div className="mx-auto max-w-7xl space-y-8">
|
|
719
731
|
<div className="text-center">
|
|
720
|
-
<h3 className="
|
|
732
|
+
<h3 className="from-fm-primary via-fm-icon-brand-secondary to-fm-primary mb-4 bg-linear-to-r bg-clip-text text-3xl font-bold text-transparent">
|
|
721
733
|
Image Gallery
|
|
722
734
|
</h3>
|
|
723
|
-
<p className="mx-auto max-w-2xl text-lg
|
|
735
|
+
<p className="text-fm-tertiary mx-auto max-w-2xl text-lg">
|
|
724
736
|
Consistent image thumbnails using AspectRatio for a clean gallery
|
|
725
737
|
layout
|
|
726
738
|
</p>
|
|
@@ -730,7 +742,7 @@ export const ImageGallery: Story = {
|
|
|
730
742
|
{Array.from({ length: 12 }).map((_, i) => (
|
|
731
743
|
<div key={i} className="group cursor-pointer">
|
|
732
744
|
<AspectRatio ratio={1}>
|
|
733
|
-
<div className="relative h-full w-full overflow-hidden rounded-lg bg-
|
|
745
|
+
<div className="from-fm-surface-secondary to-fm-surface-primary relative h-full w-full overflow-hidden rounded-lg bg-linear-to-br transition-transform duration-300 group-hover:scale-105">
|
|
734
746
|
<div
|
|
735
747
|
className={`absolute inset-0 bg-gradient-to-br ${
|
|
736
748
|
[
|
|
@@ -743,7 +755,7 @@ export const ImageGallery: Story = {
|
|
|
743
755
|
][i % 6]
|
|
744
756
|
} opacity-80`}
|
|
745
757
|
/>
|
|
746
|
-
<div className="absolute inset-0 flex items-center justify-center
|
|
758
|
+
<div className="text-fm-primary absolute inset-0 flex items-center justify-center">
|
|
747
759
|
<div className="text-center">
|
|
748
760
|
<div className="text-lg font-semibold">Image {i + 1}</div>
|
|
749
761
|
<div className="text-sm opacity-75">1:1 Ratio</div>
|
|
@@ -772,13 +784,13 @@ export const ImageGallery: Story = {
|
|
|
772
784
|
// 3. Video Players
|
|
773
785
|
export const VideoPlayers: Story = {
|
|
774
786
|
render: () => (
|
|
775
|
-
<div className="
|
|
787
|
+
<div className="from-fm-surface-primary via-fm-secondary-50/10 to-fm-surface-primary min-h-screen bg-linear-to-br p-8">
|
|
776
788
|
<div className="mx-auto max-w-7xl space-y-12">
|
|
777
789
|
<div className="text-center">
|
|
778
|
-
<h3 className="
|
|
790
|
+
<h3 className="from-fm-primary via-fm-icon-brand-secondary to-fm-primary mb-4 bg-linear-to-r bg-clip-text text-3xl font-bold text-transparent">
|
|
779
791
|
Video Players
|
|
780
792
|
</h3>
|
|
781
|
-
<p className="mx-auto max-w-2xl text-lg
|
|
793
|
+
<p className="text-fm-tertiary mx-auto max-w-2xl text-lg">
|
|
782
794
|
Standard video aspect ratios for different video content types
|
|
783
795
|
</p>
|
|
784
796
|
</div>
|
|
@@ -786,15 +798,15 @@ export const VideoPlayers: Story = {
|
|
|
786
798
|
<div className="space-y-8">
|
|
787
799
|
{/* Widescreen Video */}
|
|
788
800
|
<div className="space-y-4">
|
|
789
|
-
<h4 className="text-xl font-semibold
|
|
801
|
+
<h4 className="text-fm-primary text-xl font-semibold">
|
|
790
802
|
Widescreen Video (16:9)
|
|
791
803
|
</h4>
|
|
792
804
|
<div className="mx-auto max-w-4xl">
|
|
793
805
|
<AspectRatio ratio={16 / 9}>
|
|
794
|
-
<div className="relative h-full w-full overflow-hidden rounded-lg
|
|
795
|
-
<div className="absolute inset-0 bg-
|
|
806
|
+
<div className="bg-fm-surface-primary relative h-full w-full overflow-hidden rounded-lg shadow-2xl">
|
|
807
|
+
<div className="from-fm-surface-secondary to-fm-surface-primary absolute inset-0 bg-linear-to-br" />
|
|
796
808
|
<div className="absolute inset-0 flex items-center justify-center">
|
|
797
|
-
<div className="text-
|
|
809
|
+
<div className="text-fm-primary text-center">
|
|
798
810
|
<div className="mb-4 text-6xl">▶️</div>
|
|
799
811
|
<div className="text-xl font-semibold">Video Player</div>
|
|
800
812
|
<div className="text-sm opacity-75">
|
|
@@ -805,11 +817,13 @@ export const VideoPlayers: Story = {
|
|
|
805
817
|
{/* Mock video controls */}
|
|
806
818
|
<div className="absolute right-0 bottom-0 left-0 bg-gradient-to-t from-black/80 to-transparent p-4">
|
|
807
819
|
<div className="flex items-center gap-4">
|
|
808
|
-
<button className="text-
|
|
809
|
-
<div className="h-1 flex-1 rounded-full
|
|
820
|
+
<button className="text-fm-primary">⏸️</button>
|
|
821
|
+
<div className="bg-fm-surface-tertiary h-1 flex-1 rounded-full">
|
|
810
822
|
<div className="h-full w-1/3 rounded-full bg-red-500" />
|
|
811
823
|
</div>
|
|
812
|
-
<span className="text-
|
|
824
|
+
<span className="text-fm-secondary text-sm">
|
|
825
|
+
1:23 / 4:56
|
|
826
|
+
</span>
|
|
813
827
|
</div>
|
|
814
828
|
</div>
|
|
815
829
|
</div>
|
|
@@ -819,15 +833,15 @@ export const VideoPlayers: Story = {
|
|
|
819
833
|
|
|
820
834
|
{/* Traditional Video */}
|
|
821
835
|
<div className="space-y-4">
|
|
822
|
-
<h4 className="text-xl font-semibold
|
|
836
|
+
<h4 className="text-fm-primary text-xl font-semibold">
|
|
823
837
|
Traditional Video (4:3)
|
|
824
838
|
</h4>
|
|
825
839
|
<div className="mx-auto max-w-2xl">
|
|
826
840
|
<AspectRatio ratio={4 / 3}>
|
|
827
|
-
<div className="relative h-full w-full overflow-hidden rounded-lg
|
|
828
|
-
<div className="absolute inset-0 bg-
|
|
841
|
+
<div className="bg-fm-surface-primary relative h-full w-full overflow-hidden rounded-lg shadow-2xl">
|
|
842
|
+
<div className="from-fm-surface-secondary to-fm-surface-primary absolute inset-0 bg-linear-to-br" />
|
|
829
843
|
<div className="absolute inset-0 flex items-center justify-center">
|
|
830
|
-
<div className="text-
|
|
844
|
+
<div className="text-fm-primary text-center">
|
|
831
845
|
<div className="mb-4 text-5xl">📺</div>
|
|
832
846
|
<div className="text-lg font-semibold">
|
|
833
847
|
Classic TV Format
|
|
@@ -842,15 +856,15 @@ export const VideoPlayers: Story = {
|
|
|
842
856
|
|
|
843
857
|
{/* Mobile Video */}
|
|
844
858
|
<div className="space-y-4">
|
|
845
|
-
<h4 className="text-xl font-semibold
|
|
859
|
+
<h4 className="text-fm-primary text-xl font-semibold">
|
|
846
860
|
Mobile Video (9:16)
|
|
847
861
|
</h4>
|
|
848
862
|
<div className="mx-auto max-w-sm">
|
|
849
863
|
<AspectRatio ratio={9 / 16}>
|
|
850
|
-
<div className="relative h-full w-full overflow-hidden rounded-lg
|
|
851
|
-
<div className="absolute inset-0 bg-
|
|
864
|
+
<div className="bg-fm-surface-primary relative h-full w-full overflow-hidden rounded-lg shadow-2xl">
|
|
865
|
+
<div className="from-fm-surface-secondary to-fm-surface-primary absolute inset-0 bg-linear-to-br" />
|
|
852
866
|
<div className="absolute inset-0 flex items-center justify-center">
|
|
853
|
-
<div className="text-
|
|
867
|
+
<div className="text-fm-primary text-center">
|
|
854
868
|
<div className="mb-4 text-4xl">📱</div>
|
|
855
869
|
<div className="text-lg font-semibold">
|
|
856
870
|
Stories & Reels
|
|
@@ -882,13 +896,13 @@ export const VideoPlayers: Story = {
|
|
|
882
896
|
// 4. Card Layouts
|
|
883
897
|
export const CardLayouts: Story = {
|
|
884
898
|
render: () => (
|
|
885
|
-
<div className="
|
|
899
|
+
<div className="from-fm-surface-primary via-fm-secondary-50/10 to-fm-surface-primary min-h-screen bg-linear-to-br p-8">
|
|
886
900
|
<div className="mx-auto max-w-7xl space-y-8">
|
|
887
901
|
<div className="text-center">
|
|
888
|
-
<h3 className="
|
|
902
|
+
<h3 className="from-fm-primary via-fm-icon-brand-secondary to-fm-primary mb-4 bg-linear-to-r bg-clip-text text-3xl font-bold text-transparent">
|
|
889
903
|
Card Layouts
|
|
890
904
|
</h3>
|
|
891
|
-
<p className="mx-auto max-w-2xl text-lg
|
|
905
|
+
<p className="text-fm-tertiary mx-auto max-w-2xl text-lg">
|
|
892
906
|
Consistent card designs using AspectRatio for uniform layouts
|
|
893
907
|
</p>
|
|
894
908
|
</div>
|
|
@@ -934,22 +948,22 @@ export const CardLayouts: Story = {
|
|
|
934
948
|
].map((card, i) => (
|
|
935
949
|
<div
|
|
936
950
|
key={i}
|
|
937
|
-
className="group cursor-pointer overflow-hidden rounded-xl border
|
|
951
|
+
className="group border-fm-divider-secondary bg-fm-surface-secondary hover:border-fm-divider-contrast hover:bg-fm-surface-frosted/15 cursor-pointer overflow-hidden rounded-xl border transition-all duration-300 hover:scale-105"
|
|
938
952
|
>
|
|
939
953
|
<AspectRatio ratio={card.ratio}>
|
|
940
954
|
<div
|
|
941
955
|
className={`relative h-full w-full bg-gradient-to-br ${
|
|
942
956
|
[
|
|
943
|
-
"from-blue-500 to-
|
|
944
|
-
"from-green-500 to-
|
|
945
|
-
"from-
|
|
946
|
-
"from-
|
|
947
|
-
"from-
|
|
948
|
-
"from-
|
|
957
|
+
"from-fm-blue-500 to-fm-secondary-600",
|
|
958
|
+
"from-fm-green-500 to-fm-emerald-600",
|
|
959
|
+
"from-fm-red-500 to-fm-red-600",
|
|
960
|
+
"from-fm-secondary-500 to-fm-hotpink-600",
|
|
961
|
+
"from-fm-electricblue-500 to-fm-blue-600",
|
|
962
|
+
"from-fm-hotpink-500 to-fm-red-600",
|
|
949
963
|
][i % 6]
|
|
950
964
|
}`}
|
|
951
965
|
>
|
|
952
|
-
<div className="absolute inset-0 flex items-center justify-center
|
|
966
|
+
<div className="text-fm-primary absolute inset-0 flex items-center justify-center">
|
|
953
967
|
<div className="text-center">
|
|
954
968
|
<div className="mb-2 text-4xl">{card.icon}</div>
|
|
955
969
|
<div className="text-lg font-semibold">{card.title}</div>
|
|
@@ -959,9 +973,9 @@ export const CardLayouts: Story = {
|
|
|
959
973
|
</div>
|
|
960
974
|
</AspectRatio>
|
|
961
975
|
<div className="p-4">
|
|
962
|
-
<h4 className="font-semibold
|
|
963
|
-
<p className="text-
|
|
964
|
-
<div className="mt-2 text-xs
|
|
976
|
+
<h4 className="text-fm-primary font-semibold">{card.title}</h4>
|
|
977
|
+
<p className="text-fm-secondary text-sm">{card.desc}</p>
|
|
978
|
+
<div className="text-fm-icon-brand-secondary mt-2 text-xs">
|
|
965
979
|
Ratio: {card.ratio.toFixed(2)}
|
|
966
980
|
</div>
|
|
967
981
|
</div>
|
|
@@ -1004,13 +1018,13 @@ export const InteractivePlayground: Story = {
|
|
|
1004
1018
|
selectedRatio === "custom" ? customWidth / customHeight : selectedRatio
|
|
1005
1019
|
|
|
1006
1020
|
return (
|
|
1007
|
-
<div className="
|
|
1021
|
+
<div className="from-fm-surface-primary via-fm-secondary-50/10 to-fm-surface-primary min-h-screen bg-linear-to-br p-8">
|
|
1008
1022
|
<div className="mx-auto max-w-7xl space-y-8">
|
|
1009
1023
|
<div className="text-center">
|
|
1010
|
-
<h3 className="
|
|
1024
|
+
<h3 className="from-fm-primary via-fm-icon-brand-secondary to-fm-primary mb-4 bg-linear-to-r bg-clip-text text-3xl font-bold text-transparent">
|
|
1011
1025
|
Interactive Playground
|
|
1012
1026
|
</h3>
|
|
1013
|
-
<p className="mx-auto max-w-2xl text-lg
|
|
1027
|
+
<p className="text-fm-tertiary mx-auto max-w-2xl text-lg">
|
|
1014
1028
|
Experiment with different aspect ratios and see how they affect
|
|
1015
1029
|
content layout
|
|
1016
1030
|
</p>
|
|
@@ -1018,12 +1032,14 @@ export const InteractivePlayground: Story = {
|
|
|
1018
1032
|
|
|
1019
1033
|
<div className="grid grid-cols-1 gap-8 lg:grid-cols-3">
|
|
1020
1034
|
{/* Controls */}
|
|
1021
|
-
<div className="space-y-6 rounded-xl border
|
|
1022
|
-
<h4 className="text-lg font-semibold
|
|
1035
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-6 rounded-xl border p-6">
|
|
1036
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
1037
|
+
Controls
|
|
1038
|
+
</h4>
|
|
1023
1039
|
|
|
1024
1040
|
{/* Preset Ratios */}
|
|
1025
1041
|
<div className="space-y-3">
|
|
1026
|
-
<label className="text-sm font-medium
|
|
1042
|
+
<label className="text-fm-primary text-sm font-medium">
|
|
1027
1043
|
Preset Ratios
|
|
1028
1044
|
</label>
|
|
1029
1045
|
<div className="grid grid-cols-2 gap-2">
|
|
@@ -1033,8 +1049,8 @@ export const InteractivePlayground: Story = {
|
|
|
1033
1049
|
onClick={() => setSelectedRatio(preset.value)}
|
|
1034
1050
|
className={`rounded-lg px-3 py-2 text-sm transition-colors ${
|
|
1035
1051
|
selectedRatio === preset.value
|
|
1036
|
-
? "bg-
|
|
1037
|
-
: "bg-
|
|
1052
|
+
? "text-fm-primary bg-fm-secondary-500"
|
|
1053
|
+
: "bg-fm-surface-secondary text-fm-tertiary hover:bg-fm-surface-tertiary"
|
|
1038
1054
|
}`}
|
|
1039
1055
|
>
|
|
1040
1056
|
{preset.label}
|
|
@@ -1045,7 +1061,7 @@ export const InteractivePlayground: Story = {
|
|
|
1045
1061
|
|
|
1046
1062
|
{/* Custom Ratio */}
|
|
1047
1063
|
<div className="space-y-3">
|
|
1048
|
-
<label className="text-sm font-medium
|
|
1064
|
+
<label className="text-fm-primary text-sm font-medium">
|
|
1049
1065
|
Custom Ratio
|
|
1050
1066
|
</label>
|
|
1051
1067
|
<div className="flex items-center gap-2">
|
|
@@ -1058,9 +1074,9 @@ export const InteractivePlayground: Story = {
|
|
|
1058
1074
|
setCustomWidth(Number(e.target.value))
|
|
1059
1075
|
setSelectedRatio("custom")
|
|
1060
1076
|
}}
|
|
1061
|
-
className="w-20 rounded-lg border
|
|
1077
|
+
className="border-fm-divider-secondary bg-fm-surface-secondary text-fm-primary placeholder-fm-tertiary w-20 rounded-lg border px-3 py-2 text-sm"
|
|
1062
1078
|
/>
|
|
1063
|
-
<span className="text-
|
|
1079
|
+
<span className="text-fm-primary">:</span>
|
|
1064
1080
|
<input
|
|
1065
1081
|
type="number"
|
|
1066
1082
|
min="1"
|
|
@@ -1070,26 +1086,26 @@ export const InteractivePlayground: Story = {
|
|
|
1070
1086
|
setCustomHeight(Number(e.target.value))
|
|
1071
1087
|
setSelectedRatio("custom")
|
|
1072
1088
|
}}
|
|
1073
|
-
className="w-20 rounded-lg border
|
|
1089
|
+
className="border-fm-divider-secondary bg-fm-surface-secondary text-fm-primary placeholder-fm-tertiary w-20 rounded-lg border px-3 py-2 text-sm"
|
|
1074
1090
|
/>
|
|
1075
1091
|
</div>
|
|
1076
1092
|
<button
|
|
1077
1093
|
onClick={() => setSelectedRatio(customWidth / customHeight)}
|
|
1078
|
-
className="
|
|
1094
|
+
className="bg-fm-secondary-500/20 hover:bg-fm-secondary-500/30 text-fm-icon-brand-secondary w-full rounded-lg px-3 py-2 text-sm transition-colors"
|
|
1079
1095
|
>
|
|
1080
1096
|
Apply Custom ({customWidth}:{customHeight})
|
|
1081
1097
|
</button>
|
|
1082
1098
|
</div>
|
|
1083
1099
|
|
|
1084
1100
|
{/* Current Info */}
|
|
1085
|
-
<div className="space-y-2 rounded-lg
|
|
1086
|
-
<div className="text-sm font-medium
|
|
1101
|
+
<div className="bg-fm-surface-secondary space-y-2 rounded-lg p-4">
|
|
1102
|
+
<div className="text-fm-primary text-sm font-medium">
|
|
1087
1103
|
Current Ratio
|
|
1088
1104
|
</div>
|
|
1089
|
-
<div className="text-lg font-bold
|
|
1105
|
+
<div className="text-fm-icon-brand-secondary text-lg font-bold">
|
|
1090
1106
|
{currentRatio.toFixed(3)}
|
|
1091
1107
|
</div>
|
|
1092
|
-
<div className="text-
|
|
1108
|
+
<div className="text-fm-secondary text-xs">
|
|
1093
1109
|
{selectedRatio === "custom"
|
|
1094
1110
|
? `${customWidth}:${customHeight}`
|
|
1095
1111
|
: presetRatios.find((p) => p.value === selectedRatio)
|
|
@@ -1100,12 +1116,14 @@ export const InteractivePlayground: Story = {
|
|
|
1100
1116
|
|
|
1101
1117
|
{/* Preview */}
|
|
1102
1118
|
<div className="lg:col-span-2">
|
|
1103
|
-
<div className="space-y-4 rounded-xl border
|
|
1104
|
-
<h4 className="text-lg font-semibold
|
|
1119
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-4 rounded-xl border p-6">
|
|
1120
|
+
<h4 className="text-fm-primary text-lg font-semibold">
|
|
1121
|
+
Preview
|
|
1122
|
+
</h4>
|
|
1105
1123
|
<div className="mx-auto max-w-lg">
|
|
1106
1124
|
<AspectRatio ratio={currentRatio}>
|
|
1107
1125
|
<div className="relative h-full w-full overflow-hidden rounded-lg bg-gradient-to-br from-blue-500 via-purple-500 to-pink-500 shadow-xl">
|
|
1108
|
-
<div className="absolute inset-0 flex items-center justify-center
|
|
1126
|
+
<div className="text-fm-primary absolute inset-0 flex items-center justify-center">
|
|
1109
1127
|
<div className="text-center">
|
|
1110
1128
|
<div className="text-2xl font-bold">
|
|
1111
1129
|
{selectedRatio === "custom"
|
|
@@ -1124,7 +1142,10 @@ export const InteractivePlayground: Story = {
|
|
|
1124
1142
|
<div className="absolute inset-0 opacity-20">
|
|
1125
1143
|
<div className="grid h-full w-full grid-cols-3 grid-rows-3 gap-px">
|
|
1126
1144
|
{Array.from({ length: 9 }).map((_, i) => (
|
|
1127
|
-
<div
|
|
1145
|
+
<div
|
|
1146
|
+
key={i}
|
|
1147
|
+
className="border-fm-divider-secondary border"
|
|
1148
|
+
/>
|
|
1128
1149
|
))}
|
|
1129
1150
|
</div>
|
|
1130
1151
|
</div>
|
|
@@ -1134,9 +1155,11 @@ export const InteractivePlayground: Story = {
|
|
|
1134
1155
|
|
|
1135
1156
|
{/* Code Example */}
|
|
1136
1157
|
<div className="space-y-2">
|
|
1137
|
-
<label className="text-sm font-medium
|
|
1138
|
-
|
|
1139
|
-
|
|
1158
|
+
<label className="text-fm-primary text-sm font-medium">
|
|
1159
|
+
Code
|
|
1160
|
+
</label>
|
|
1161
|
+
<div className="bg-fm-surface-secondary rounded-lg p-4">
|
|
1162
|
+
<pre className="text-fm-positive text-sm">
|
|
1140
1163
|
{`<AspectRatio ratio={${currentRatio.toFixed(3)}}>
|
|
1141
1164
|
<div className="h-full w-full bg-gradient-to-br
|
|
1142
1165
|
from-blue-500 to-purple-500">
|
|
@@ -1167,42 +1190,42 @@ export const InteractivePlayground: Story = {
|
|
|
1167
1190
|
// 6. Real World Examples
|
|
1168
1191
|
export const RealWorldExamples: Story = {
|
|
1169
1192
|
render: () => (
|
|
1170
|
-
<div className="
|
|
1193
|
+
<div className="from-fm-surface-primary via-fm-secondary-50/10 to-fm-surface-primary min-h-screen bg-linear-to-br p-8">
|
|
1171
1194
|
<div className="mx-auto max-w-7xl space-y-12">
|
|
1172
1195
|
<div className="text-center">
|
|
1173
|
-
<h3 className="
|
|
1196
|
+
<h3 className="from-fm-primary via-fm-icon-brand-secondary to-fm-primary mb-4 bg-linear-to-r bg-clip-text text-3xl font-bold text-transparent">
|
|
1174
1197
|
Real World Examples
|
|
1175
1198
|
</h3>
|
|
1176
|
-
<p className="mx-auto max-w-2xl text-lg
|
|
1199
|
+
<p className="text-fm-tertiary mx-auto max-w-2xl text-lg">
|
|
1177
1200
|
Practical implementations of AspectRatio in common UI patterns
|
|
1178
1201
|
</p>
|
|
1179
1202
|
</div>
|
|
1180
1203
|
|
|
1181
1204
|
{/* Social Media Feed */}
|
|
1182
1205
|
<div className="space-y-6">
|
|
1183
|
-
<h4 className="text-xl font-semibold
|
|
1206
|
+
<h4 className="text-fm-primary text-xl font-semibold">
|
|
1184
1207
|
Social Media Feed
|
|
1185
1208
|
</h4>
|
|
1186
1209
|
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
|
|
1187
1210
|
{Array.from({ length: 6 }).map((_, i) => (
|
|
1188
1211
|
<div
|
|
1189
1212
|
key={i}
|
|
1190
|
-
className="overflow-hidden rounded-xl border
|
|
1213
|
+
className="border-fm-divider-secondary bg-fm-surface-secondary overflow-hidden rounded-xl border"
|
|
1191
1214
|
>
|
|
1192
1215
|
<AspectRatio ratio={1}>
|
|
1193
1216
|
<div
|
|
1194
1217
|
className={`relative h-full w-full bg-gradient-to-br ${
|
|
1195
1218
|
[
|
|
1196
|
-
"from-
|
|
1197
|
-
"from-blue-500 to-
|
|
1198
|
-
"from-green-500 to-emerald-500",
|
|
1199
|
-
"from-
|
|
1200
|
-
"from-
|
|
1201
|
-
"from-
|
|
1219
|
+
"from-fm-hotpink-500 to-fm-primary-500",
|
|
1220
|
+
"from-fm-blue-500 to-fm-electricblue-500",
|
|
1221
|
+
"from-fm-green-500 to-fm-emerald-500",
|
|
1222
|
+
"from-fm-secondary-500 to-fm-hotpink-500",
|
|
1223
|
+
"from-fm-red-500 to-fm-yellow-500",
|
|
1224
|
+
"from-fm-blue-400 to-fm-blue-500",
|
|
1202
1225
|
][i % 6]
|
|
1203
1226
|
}`}
|
|
1204
1227
|
>
|
|
1205
|
-
<div className="absolute inset-0 flex items-center justify-center
|
|
1228
|
+
<div className="text-fm-primary absolute inset-0 flex items-center justify-center">
|
|
1206
1229
|
<div className="text-4xl">
|
|
1207
1230
|
{["🌟", "🎨", "🚀", "💎", "🔥", "⚡"][i % 6]}
|
|
1208
1231
|
</div>
|
|
@@ -1211,15 +1234,17 @@ export const RealWorldExamples: Story = {
|
|
|
1211
1234
|
</AspectRatio>
|
|
1212
1235
|
<div className="p-4">
|
|
1213
1236
|
<div className="flex items-center gap-3">
|
|
1214
|
-
<div className="h-8 w-8 rounded-full bg-
|
|
1237
|
+
<div className="from-fm-surface-tertiary to-fm-surface-secondary h-8 w-8 rounded-full bg-linear-to-br" />
|
|
1215
1238
|
<div>
|
|
1216
|
-
<div className="text-sm font-medium
|
|
1239
|
+
<div className="text-fm-primary text-sm font-medium">
|
|
1217
1240
|
@user{i + 1}
|
|
1218
1241
|
</div>
|
|
1219
|
-
<div className="text-
|
|
1242
|
+
<div className="text-fm-secondary text-xs">
|
|
1243
|
+
2 hours ago
|
|
1244
|
+
</div>
|
|
1220
1245
|
</div>
|
|
1221
1246
|
</div>
|
|
1222
|
-
<p className="mt-2 text-sm
|
|
1247
|
+
<p className="text-fm-tertiary mt-2 text-sm">
|
|
1223
1248
|
Beautiful post content with perfect aspect ratio!
|
|
1224
1249
|
#photography
|
|
1225
1250
|
</p>
|
|
@@ -1231,18 +1256,18 @@ export const RealWorldExamples: Story = {
|
|
|
1231
1256
|
|
|
1232
1257
|
{/* E-commerce Grid */}
|
|
1233
1258
|
<div className="space-y-6">
|
|
1234
|
-
<h4 className="text-xl font-semibold
|
|
1259
|
+
<h4 className="text-fm-primary text-xl font-semibold">
|
|
1235
1260
|
E-commerce Product Grid
|
|
1236
1261
|
</h4>
|
|
1237
1262
|
<div className="grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-4">
|
|
1238
1263
|
{Array.from({ length: 8 }).map((_, i) => (
|
|
1239
1264
|
<div
|
|
1240
1265
|
key={i}
|
|
1241
|
-
className="group cursor-pointer overflow-hidden rounded-lg border
|
|
1266
|
+
className="group border-fm-divider-secondary bg-fm-surface-secondary cursor-pointer overflow-hidden rounded-lg border transition-transform duration-200 hover:scale-105"
|
|
1242
1267
|
>
|
|
1243
1268
|
<AspectRatio ratio={1}>
|
|
1244
|
-
<div className="relative h-full w-full bg-
|
|
1245
|
-
<div className="absolute inset-0 flex items-center justify-center
|
|
1269
|
+
<div className="from-fm-surface-secondary to-fm-surface-primary relative h-full w-full bg-linear-to-br">
|
|
1270
|
+
<div className="text-fm-primary absolute inset-0 flex items-center justify-center">
|
|
1246
1271
|
<div className="text-center">
|
|
1247
1272
|
<div className="mb-2 text-2xl">
|
|
1248
1273
|
{["👟", "👕", "⌚", "🎧", "📱", "💻", "🎒", "📷"][i]}
|
|
@@ -1253,17 +1278,19 @@ export const RealWorldExamples: Story = {
|
|
|
1253
1278
|
</div>
|
|
1254
1279
|
</div>
|
|
1255
1280
|
<div className="absolute top-2 right-2">
|
|
1256
|
-
<div className="rounded-full bg-red-500 px-2 py-1 text-xs
|
|
1281
|
+
<div className="text-fm-primary rounded-full bg-red-500 px-2 py-1 text-xs">
|
|
1257
1282
|
Sale
|
|
1258
1283
|
</div>
|
|
1259
1284
|
</div>
|
|
1260
1285
|
</div>
|
|
1261
1286
|
</AspectRatio>
|
|
1262
1287
|
<div className="p-3">
|
|
1263
|
-
<h5 className="text-sm font-medium
|
|
1288
|
+
<h5 className="text-fm-primary text-sm font-medium">
|
|
1264
1289
|
Product Name
|
|
1265
1290
|
</h5>
|
|
1266
|
-
<p className="text-lg font-bold
|
|
1291
|
+
<p className="text-fm-icon-brand-secondary text-lg font-bold">
|
|
1292
|
+
$99.99
|
|
1293
|
+
</p>
|
|
1267
1294
|
</div>
|
|
1268
1295
|
</div>
|
|
1269
1296
|
))}
|
|
@@ -1272,39 +1299,41 @@ export const RealWorldExamples: Story = {
|
|
|
1272
1299
|
|
|
1273
1300
|
{/* Video Thumbnails */}
|
|
1274
1301
|
<div className="space-y-6">
|
|
1275
|
-
<h4 className="text-xl font-semibold
|
|
1302
|
+
<h4 className="text-fm-primary text-xl font-semibold">
|
|
1303
|
+
Video Thumbnails
|
|
1304
|
+
</h4>
|
|
1276
1305
|
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
|
|
1277
1306
|
{Array.from({ length: 6 }).map((_, i) => (
|
|
1278
1307
|
<div key={i} className="group cursor-pointer space-y-3">
|
|
1279
1308
|
<AspectRatio ratio={16 / 9}>
|
|
1280
|
-
<div className="relative h-full w-full overflow-hidden rounded-lg bg-
|
|
1309
|
+
<div className="from-fm-surface-secondary to-fm-surface-primary relative h-full w-full overflow-hidden rounded-lg bg-linear-to-br">
|
|
1281
1310
|
<div className="absolute inset-0 flex items-center justify-center">
|
|
1282
|
-
<div className="flex h-16 w-16 items-center justify-center rounded-full
|
|
1311
|
+
<div className="bg-fm-surface-tertiary text-fm-primary flex h-16 w-16 items-center justify-center rounded-full backdrop-blur-sm transition-transform group-hover:scale-110">
|
|
1283
1312
|
<div className="text-2xl">▶️</div>
|
|
1284
1313
|
</div>
|
|
1285
1314
|
</div>
|
|
1286
|
-
<div className="absolute right-2 bottom-2 rounded
|
|
1315
|
+
<div className="bg-fm-surface-primary/80 text-fm-primary absolute right-2 bottom-2 rounded px-2 py-1 text-xs">
|
|
1287
1316
|
{["12:34", "8:45", "15:22", "6:18", "20:15", "4:32"][i]}
|
|
1288
1317
|
</div>
|
|
1289
1318
|
<div
|
|
1290
1319
|
className={`absolute inset-0 bg-gradient-to-br opacity-60 ${
|
|
1291
1320
|
[
|
|
1292
|
-
"from-red-500 to-
|
|
1293
|
-
"from-blue-500 to-
|
|
1294
|
-
"from-green-500 to-
|
|
1295
|
-
"from-
|
|
1296
|
-
"from-
|
|
1297
|
-
"from-
|
|
1321
|
+
"from-fm-red-500 to-fm-hotpink-500",
|
|
1322
|
+
"from-fm-blue-500 to-fm-blue-400",
|
|
1323
|
+
"from-fm-green-500 to-fm-emerald-500",
|
|
1324
|
+
"from-fm-secondary-500 to-fm-electricblue-500",
|
|
1325
|
+
"from-fm-red-500 to-fm-yellow-500",
|
|
1326
|
+
"from-fm-electricblue-500 to-fm-secondary-500",
|
|
1298
1327
|
][i % 6]
|
|
1299
1328
|
}`}
|
|
1300
1329
|
/>
|
|
1301
1330
|
</div>
|
|
1302
1331
|
</AspectRatio>
|
|
1303
1332
|
<div>
|
|
1304
|
-
<h5 className="text-sm font-medium
|
|
1333
|
+
<h5 className="text-fm-primary text-sm font-medium">
|
|
1305
1334
|
Video Title: Amazing Content #{i + 1}
|
|
1306
1335
|
</h5>
|
|
1307
|
-
<p className="text-
|
|
1336
|
+
<p className="text-fm-secondary text-xs">
|
|
1308
1337
|
Channel Name • 1.2M views • 2 days ago
|
|
1309
1338
|
</p>
|
|
1310
1339
|
</div>
|