aural-ui 3.0.7 → 4.1.0

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