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,6 +1,19 @@
1
1
  import React from "react"
2
+ import {
3
+ AlertIcon,
4
+ HeartIcon,
5
+ MusicalNoteIcon,
6
+ PauseIcon,
7
+ SearchIcon,
8
+ SettingIcon,
9
+ SkipBackwardIcon,
10
+ SkipForwardIcon,
11
+ VolumeFullIcon,
12
+ } from "@icons/index"
2
13
  import type { Meta, StoryObj } from "@storybook/react-vite"
3
14
 
15
+ import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
16
+
4
17
  import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "."
5
18
 
6
19
  const meta: Meta<typeof ResizablePanelGroup> = {
@@ -17,111 +30,27 @@ const meta: Meta<typeof ResizablePanelGroup> = {
17
30
  },
18
31
  docs: {
19
32
  description: {
20
- component: `
21
- # Resizable Component
22
-
23
- A flexible resizable panel system built on top of react-resizable-panels, providing smooth panel resizing with customizable handles and layouts.
24
-
25
- ## Components
26
-
27
- ### Core Components
28
- - **ResizablePanelGroup**: Container that manages the resizable layout and direction
29
- - **ResizablePanel**: Individual panel that can be resized
30
- - **ResizableHandle**: The draggable handle between panels with optional visual indicator
31
-
32
- ## Features
33
-
34
- - **Bi-directional**: Supports both horizontal and vertical panel layouts
35
- - **Smooth Resizing**: Fluid drag-to-resize interactions
36
- - **Visual Handles**: Optional drag handles with move icons
37
- - **Keyboard Accessible**: Full keyboard navigation support
38
- - **Flexible Sizing**: Supports percentage-based and minimum size constraints
39
- - **Auto-rotation**: Icons automatically rotate for vertical layouts
40
- - **Design System**: Integrated with design tokens for consistent styling
41
- - **Focus Management**: Proper focus indicators and keyboard navigation
42
-
43
- ## Usage Examples
44
-
45
- ### Basic Horizontal Layout
46
- \`\`\`tsx
47
- <ResizablePanelGroup direction="horizontal">
48
- <ResizablePanel defaultSize={50}>
49
- Left Panel Content
50
- </ResizablePanel>
51
- <ResizableHandle />
52
- <ResizablePanel defaultSize={50}>
53
- Right Panel Content
54
- </ResizablePanel>
55
- </ResizablePanelGroup>
56
- \`\`\`
57
-
58
- ### Vertical Layout with Handles
59
- \`\`\`tsx
60
- <ResizablePanelGroup direction="vertical" className="h-96">
61
- <ResizablePanel defaultSize={30}>
62
- Top Panel
63
- </ResizablePanel>
64
- <ResizableHandle withHandle />
65
- <ResizablePanel defaultSize={70}>
66
- Bottom Panel
67
- </ResizablePanel>
68
- </ResizablePanelGroup>
69
- \`\`\`
70
-
71
- ### Three Panel Layout
72
- \`\`\`tsx
73
- <ResizablePanelGroup direction="horizontal">
74
- <ResizablePanel defaultSize={25} minSize={20}>
75
- Sidebar
76
- </ResizablePanel>
77
- <ResizableHandle withHandle />
78
- <ResizablePanel defaultSize={50}>
79
- Main Content
80
- </ResizablePanel>
81
- <ResizableHandle withHandle />
82
- <ResizablePanel defaultSize={25} minSize={15}>
83
- Right Panel
84
- </ResizablePanel>
85
- </ResizablePanelGroup>
86
- \`\`\`
87
-
88
- ### Nested Resizable Layouts
89
- \`\`\`tsx
90
- <ResizablePanelGroup direction="horizontal">
91
- <ResizablePanel defaultSize={30}>
92
- Sidebar Content
93
- </ResizablePanel>
94
- <ResizableHandle withHandle />
95
- <ResizablePanel defaultSize={70}>
96
- <ResizablePanelGroup direction="vertical">
97
- <ResizablePanel defaultSize={60}>
98
- Main Content
99
- </ResizablePanel>
100
- <ResizableHandle withHandle />
101
- <ResizablePanel defaultSize={40}>
102
- Bottom Panel
103
- </ResizablePanel>
104
- </ResizablePanelGroup>
105
- </ResizablePanel>
106
- </ResizablePanelGroup>
107
- \`\`\`
108
-
109
- ## Accessibility
110
-
111
- - **Keyboard Navigation**: Handles can be focused and adjusted with arrow keys
112
- - **ARIA Support**: Proper ARIA roles and attributes for screen readers
113
- - **Focus Indicators**: Clear focus rings following design system patterns
114
- - **Semantic Structure**: Proper DOM structure for assistive technologies
115
-
116
- ## Design Tokens
117
-
118
- The component uses design system tokens:
119
- - \`--color-fm-button-fill-secondary\`: Handle background color
120
- - \`--color-fm-primary\`: Focus ring color
121
- - \`--color-fm-contrast\`: Focus ring offset color
122
- - \`--radius-fm-xs\`: Handle border radius
123
- `,
33
+ component:
34
+ "A layout primitive built on react-resizable-panels providing fluid drag-to-resize behaviour. Composed of three parts: ResizablePanelGroup (sets direction and manages layout), ResizablePanel (individual resizable area with optional min/default sizes), and ResizableHandle (the draggable divider with an optional visual grip). Supports horizontal and vertical directions and arbitrary nesting.",
124
35
  },
36
+ page: () => (
37
+ <AuralComponentDocsPage
38
+ features={[
39
+ {
40
+ title: "Drag to Resize",
41
+ description: "Fluid panel splitting",
42
+ },
43
+ {
44
+ title: "H & V Directions",
45
+ description: "Horizontal or vertical",
46
+ },
47
+ {
48
+ title: "Nestable",
49
+ description: "Groups within groups",
50
+ },
51
+ ]}
52
+ />
53
+ ),
125
54
  },
126
55
  },
127
56
  tags: ["autodocs"],
@@ -129,11 +58,7 @@ The component uses design system tokens:
129
58
  direction: {
130
59
  control: "select",
131
60
  options: ["horizontal", "vertical"],
132
- description: "Direction of the panel group layout",
133
- },
134
- className: {
135
- control: "text",
136
- description: "Additional CSS classes",
61
+ description: "Layout direction for the panel group",
137
62
  },
138
63
  },
139
64
  }
@@ -141,513 +66,238 @@ The component uses design system tokens:
141
66
  export default meta
142
67
  type Story = StoryObj<typeof ResizablePanelGroup>
143
68
 
144
- // 1. Basic Horizontal Layout
145
- export const BasicHorizontal: Story = {
146
- args: {
147
- direction: "horizontal",
148
- },
149
- render: (args) => (
150
- <div className="h-96 w-full p-8">
151
- <h3 className="mb-4 text-lg font-medium text-white">
152
- Basic Horizontal Layout
153
- </h3>
154
- <ResizablePanelGroup
155
- {...args}
156
- className="overflow-hidden rounded-lg border border-white/10"
157
- >
158
- <ResizablePanel defaultSize={50}>
159
- <div className="flex h-full items-center justify-center bg-blue-500/10 p-4">
160
- <div className="text-center">
161
- <h4 className="text-lg font-medium text-white">Left Panel</h4>
162
- <p className="text-sm text-white/60">Resize me!</p>
163
- </div>
164
- </div>
165
- </ResizablePanel>
166
- <ResizableHandle />
167
- <ResizablePanel defaultSize={50}>
168
- <div className="flex h-full items-center justify-center bg-purple-500/10 p-4">
169
- <div className="text-center">
170
- <h4 className="text-lg font-medium text-white">Right Panel</h4>
171
- <p className="text-sm text-white/60">I resize too!</p>
172
- </div>
173
- </div>
174
- </ResizablePanel>
175
- </ResizablePanelGroup>
176
- </div>
177
- ),
178
- parameters: {
179
- docs: {
180
- description: {
181
- story:
182
- "Basic two-panel horizontal layout with a simple resize handle between panels.",
183
- },
184
- },
185
- },
186
- }
187
-
188
- // 2. Vertical Layout with Handles
189
- export const VerticalWithHandles: Story = {
190
- render: () => (
191
- <div className="h-96 w-full p-8">
192
- <h3 className="mb-4 text-lg font-medium text-white">
193
- Vertical Layout with Visual Handles
194
- </h3>
195
- <ResizablePanelGroup
196
- direction="vertical"
197
- className="overflow-hidden rounded-lg border border-white/10"
198
- >
199
- <ResizablePanel defaultSize={40}>
200
- <div className="flex h-full items-center justify-center bg-green-500/10 p-4">
201
- <div className="text-center">
202
- <h4 className="text-lg font-medium text-white">Top Panel</h4>
203
- <p className="text-sm text-white/60">40% default size</p>
204
- </div>
205
- </div>
206
- </ResizablePanel>
207
- <ResizableHandle withHandle />
208
- <ResizablePanel defaultSize={60}>
209
- <div className="flex h-full items-center justify-center bg-orange-500/10 p-4">
210
- <div className="text-center">
211
- <h4 className="text-lg font-medium text-white">Bottom Panel</h4>
212
- <p className="text-sm text-white/60">60% default size</p>
213
- <p className="mt-2 text-xs text-white/40">
214
- Notice the rotated handle icon
215
- </p>
216
- </div>
217
- </div>
218
- </ResizablePanel>
219
- </ResizablePanelGroup>
220
- </div>
221
- ),
222
- parameters: {
223
- docs: {
224
- description: {
225
- story:
226
- "Vertical panel layout with visual drag handles. Notice how the move icon automatically rotates for vertical orientation.",
227
- },
228
- },
229
- },
230
- }
231
-
232
- // 3. Three Panel Layout
233
- export const ThreePanel: Story = {
234
- render: () => (
235
- <div className="h-96 w-full p-8">
236
- <h3 className="mb-4 text-lg font-medium text-white">
237
- Three Panel Layout
238
- </h3>
239
- <ResizablePanelGroup
240
- direction="horizontal"
241
- className="overflow-hidden rounded-lg border border-white/10"
242
- >
243
- <ResizablePanel defaultSize={25} minSize={15}>
244
- <div className="flex h-full flex-col justify-center bg-red-500/10 p-4">
245
- <h4 className="text-sm font-medium text-white">Sidebar</h4>
246
- <p className="mt-1 text-xs text-white/60">25% default</p>
247
- <p className="mt-1 text-xs text-white/40">15% minimum</p>
248
- </div>
249
- </ResizablePanel>
250
- <ResizableHandle withHandle />
251
- <ResizablePanel defaultSize={50}>
252
- <div className="flex h-full items-center justify-center bg-blue-500/10 p-4">
253
- <div className="text-center">
254
- <h4 className="text-lg font-medium text-white">Main Content</h4>
255
- <p className="text-sm text-white/60">50% default size</p>
256
- <p className="mt-2 text-xs text-white/40">Primary content area</p>
257
- </div>
258
- </div>
259
- </ResizablePanel>
260
- <ResizableHandle withHandle />
261
- <ResizablePanel defaultSize={25} minSize={20}>
262
- <div className="flex h-full flex-col justify-center bg-purple-500/10 p-4">
263
- <h4 className="text-sm font-medium text-white">Right Panel</h4>
264
- <p className="mt-1 text-xs text-white/60">25% default</p>
265
- <p className="mt-1 text-xs text-white/40">20% minimum</p>
266
- </div>
267
- </ResizablePanel>
268
- </ResizablePanelGroup>
269
- </div>
270
- ),
271
- parameters: {
272
- docs: {
273
- description: {
274
- story:
275
- "Three-panel layout with minimum size constraints and visual drag handles between each panel.",
276
- },
277
- },
278
- },
279
- }
69
+ // ─── Configurations ───────────────────────────────────────────────────────────
280
70
 
281
- // 4. Nested Layouts
282
- export const NestedLayouts: Story = {
71
+ export const Configurations: Story = {
283
72
  render: () => (
284
- <div className="h-96 w-full p-8">
285
- <h3 className="mb-4 text-lg font-medium text-white">
286
- Nested Resizable Layouts
287
- </h3>
288
- <ResizablePanelGroup
289
- direction="horizontal"
290
- className="overflow-hidden rounded-lg border border-white/10"
291
- >
292
- <ResizablePanel defaultSize={30} minSize={25}>
293
- <div className="flex h-full flex-col justify-center bg-indigo-500/10 p-4">
294
- <h4 className="text-sm font-medium text-white">Sidebar</h4>
295
- <p className="mt-1 text-xs text-white/60">Navigation & Tools</p>
296
- <div className="mt-4 space-y-2">
297
- <div className="h-2 rounded bg-white/10"></div>
298
- <div className="h-2 rounded bg-white/5"></div>
299
- <div className="h-2 rounded bg-white/5"></div>
300
- </div>
301
- </div>
302
- </ResizablePanel>
303
- <ResizableHandle withHandle />
304
- <ResizablePanel defaultSize={70}>
305
- <ResizablePanelGroup direction="vertical">
306
- <ResizablePanel defaultSize={65}>
307
- <div className="flex h-full items-center justify-center bg-green-500/10 p-4">
308
- <div className="text-center">
309
- <h4 className="text-lg font-medium text-white">
310
- Main Content Area
311
- </h4>
312
- <p className="text-sm text-white/60">Primary workspace</p>
313
- <p className="mt-2 text-xs text-white/40">
314
- This panel can be resized vertically
73
+ <div className="space-y-8 p-8">
74
+ {/* Horizontal split */}
75
+ <div className="space-y-3">
76
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
77
+ Horizontal Split
78
+ </h4>
79
+ <div className="border-fm-divider-secondary h-48 overflow-hidden rounded-lg border">
80
+ <ResizablePanelGroup direction="horizontal">
81
+ <ResizablePanel defaultSize={50}>
82
+ <div className="bg-fm-surface-secondary flex h-full items-center justify-center p-4">
83
+ <div className="space-y-1 text-center">
84
+ <p className="text-fm-primary font-fm-text text-fm-md leading-fm-md font-medium">
85
+ Left Panel
86
+ </p>
87
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
88
+ 50% default
315
89
  </p>
316
90
  </div>
317
91
  </div>
318
92
  </ResizablePanel>
319
93
  <ResizableHandle withHandle />
320
- <ResizablePanel defaultSize={35} minSize={25}>
321
- <div className="flex h-full items-center justify-center bg-orange-500/10 p-4">
322
- <div className="text-center">
323
- <h4 className="text-md font-medium text-white">
324
- Bottom Panel
325
- </h4>
326
- <p className="text-sm text-white/60">Console / Terminal</p>
327
- <p className="mt-2 text-xs text-white/40">
328
- Nested vertical layout
94
+ <ResizablePanel defaultSize={50}>
95
+ <div className="bg-fm-surface-primary flex h-full items-center justify-center p-4">
96
+ <div className="space-y-1 text-center">
97
+ <p className="text-fm-primary font-fm-text text-fm-md leading-fm-md font-medium">
98
+ Right Panel
99
+ </p>
100
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
101
+ 50% default
329
102
  </p>
330
103
  </div>
331
104
  </div>
332
105
  </ResizablePanel>
333
106
  </ResizablePanelGroup>
334
- </ResizablePanel>
335
- </ResizablePanelGroup>
336
- </div>
337
- ),
338
- parameters: {
339
- docs: {
340
- description: {
341
- story:
342
- "Complex nested layout demonstrating horizontal and vertical resizable panels within each other, similar to IDE layouts.",
343
- },
344
- },
345
- },
346
- }
347
-
348
- // 5. Handle Variations
349
- export const HandleVariations: Story = {
350
- render: () => (
351
- <div className="space-y-8 p-8">
352
- <h3 className="text-center text-lg font-medium text-white">
353
- Handle Variations
354
- </h3>
355
-
356
- <div className="space-y-6">
357
- {/* Without Visual Handle */}
358
- <div className="space-y-2">
359
- <h4 className="text-sm font-medium text-white/70">
360
- Without Visual Handle
361
- </h4>
362
- <div className="h-32">
363
- <ResizablePanelGroup
364
- direction="horizontal"
365
- className="overflow-hidden rounded-lg border border-white/10"
366
- >
367
- <ResizablePanel defaultSize={50}>
368
- <div className="flex h-full items-center justify-center bg-blue-500/10 p-4">
369
- <span className="text-sm text-white">Minimal Handle</span>
370
- </div>
371
- </ResizablePanel>
372
- <ResizableHandle />
373
- <ResizablePanel defaultSize={50}>
374
- <div className="flex h-full items-center justify-center bg-purple-500/10 p-4">
375
- <span className="text-sm text-white">Clean Look</span>
376
- </div>
377
- </ResizablePanel>
378
- </ResizablePanelGroup>
379
- </div>
380
107
  </div>
108
+ </div>
381
109
 
382
- {/* With Visual Handle */}
383
- <div className="space-y-2">
384
- <h4 className="text-sm font-medium text-white/70">
385
- With Visual Handle
386
- </h4>
387
- <div className="h-32">
388
- <ResizablePanelGroup
389
- direction="horizontal"
390
- className="overflow-hidden rounded-lg border border-white/10"
391
- >
392
- <ResizablePanel defaultSize={50}>
393
- <div className="flex h-full items-center justify-center bg-green-500/10 p-4">
394
- <span className="text-sm text-white">Clear Affordance</span>
110
+ {/* Vertical split */}
111
+ <div className="space-y-3">
112
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
113
+ Vertical Split
114
+ </h4>
115
+ <div className="border-fm-divider-secondary h-48 overflow-hidden rounded-lg border">
116
+ <ResizablePanelGroup direction="vertical">
117
+ <ResizablePanel defaultSize={40}>
118
+ <div className="bg-fm-surface-secondary flex h-full items-center justify-center p-4">
119
+ <div className="space-y-1 text-center">
120
+ <p className="text-fm-primary font-fm-text text-fm-md leading-fm-md font-medium">
121
+ Top Panel
122
+ </p>
123
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
124
+ 40% default
125
+ </p>
395
126
  </div>
396
- </ResizablePanel>
397
- <ResizableHandle withHandle />
398
- <ResizablePanel defaultSize={50}>
399
- <div className="flex h-full items-center justify-center bg-orange-500/10 p-4">
400
- <span className="text-sm text-white">Easy to Spot</span>
127
+ </div>
128
+ </ResizablePanel>
129
+ <ResizableHandle withHandle />
130
+ <ResizablePanel defaultSize={60}>
131
+ <div className="bg-fm-surface-primary flex h-full items-center justify-center p-4">
132
+ <div className="space-y-1 text-center">
133
+ <p className="text-fm-primary font-fm-text text-fm-md leading-fm-md font-medium">
134
+ Bottom Panel
135
+ </p>
136
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
137
+ 60% default — handle icon rotates automatically
138
+ </p>
401
139
  </div>
402
- </ResizablePanel>
403
- </ResizablePanelGroup>
404
- </div>
140
+ </div>
141
+ </ResizablePanel>
142
+ </ResizablePanelGroup>
405
143
  </div>
144
+ </div>
406
145
 
407
- {/* Custom Styled Handle */}
408
- <div className="space-y-2">
409
- <h4 className="text-sm font-medium text-white/70">
410
- Custom Styled Handle
411
- </h4>
412
- <div className="h-32">
413
- <ResizablePanelGroup
414
- direction="horizontal"
415
- className="overflow-hidden rounded-lg border border-white/10"
416
- >
417
- <ResizablePanel defaultSize={50}>
418
- <div className="flex h-full items-center justify-center bg-red-500/10 p-4">
419
- <span className="text-sm text-white">Custom Styling</span>
420
- </div>
421
- </ResizablePanel>
422
- <ResizableHandle
423
- withHandle
424
- className="bg-blue-500/20 transition-colors hover:bg-blue-500/30"
425
- />
426
- <ResizablePanel defaultSize={50}>
427
- <div className="flex h-full items-center justify-center bg-indigo-500/10 p-4">
428
- <span className="text-sm text-white">Themed Handle</span>
146
+ {/* Three-panel layout */}
147
+ <div className="space-y-3">
148
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
149
+ Three-Panel Layout
150
+ </h4>
151
+ <div className="border-fm-divider-secondary h-48 overflow-hidden rounded-lg border">
152
+ <ResizablePanelGroup direction="horizontal">
153
+ <ResizablePanel defaultSize={25} minSize={15}>
154
+ <div className="bg-fm-surface-info-sec flex h-full flex-col justify-center space-y-1 p-4">
155
+ <p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm font-medium">
156
+ Sidebar
157
+ </p>
158
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
159
+ 25% · min 15%
160
+ </p>
161
+ </div>
162
+ </ResizablePanel>
163
+ <ResizableHandle withHandle />
164
+ <ResizablePanel defaultSize={50}>
165
+ <div className="bg-fm-surface-secondary flex h-full items-center justify-center p-4">
166
+ <div className="space-y-1 text-center">
167
+ <p className="text-fm-primary font-fm-text text-fm-md leading-fm-md font-medium">
168
+ Main Content
169
+ </p>
170
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
171
+ 50% default
172
+ </p>
429
173
  </div>
430
- </ResizablePanel>
431
- </ResizablePanelGroup>
432
- </div>
174
+ </div>
175
+ </ResizablePanel>
176
+ <ResizableHandle withHandle />
177
+ <ResizablePanel defaultSize={25} minSize={15}>
178
+ <div className="bg-fm-surface-positive-sec flex h-full flex-col justify-center space-y-1 p-4">
179
+ <p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm font-medium">
180
+ Inspector
181
+ </p>
182
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
183
+ 25% · min 15%
184
+ </p>
185
+ </div>
186
+ </ResizablePanel>
187
+ </ResizablePanelGroup>
433
188
  </div>
434
189
  </div>
435
- </div>
436
- ),
437
- parameters: {
438
- docs: {
439
- description: {
440
- story:
441
- "Different handle variations showing minimal handles, visual handles with icons, and custom styled handles.",
442
- },
443
- },
444
- },
445
- }
446
-
447
- // 6. Real-world Examples
448
- export const RealWorldExamples: Story = {
449
- render: () => (
450
- <div className="space-y-8 p-8">
451
- <h3 className="text-center text-lg font-medium text-white">
452
- Real-world Examples
453
- </h3>
454
190
 
455
- <div className="space-y-8">
456
- {/* IDE Layout */}
457
- <div className="space-y-4">
458
- <h4 className="text-sm font-medium text-white/70">
459
- IDE / Code Editor Layout
460
- </h4>
461
- <div className="h-80">
462
- <ResizablePanelGroup
463
- direction="horizontal"
464
- className="overflow-hidden rounded-lg border border-white/10"
465
- >
466
- {/* File Explorer */}
467
- <ResizablePanel defaultSize={20} minSize={15}>
468
- <div className="h-full bg-gray-900/50 p-3">
469
- <h5 className="mb-3 text-xs font-medium text-white">
470
- EXPLORER
471
- </h5>
472
- <div className="space-y-1 text-xs text-white/60">
473
- <div className="flex items-center gap-1">
474
- <span>📁</span> src
475
- </div>
476
- <div className="ml-3 flex items-center gap-1">
477
- <span>📄</span> index.tsx
478
- </div>
479
- <div className="ml-3 flex items-center gap-1">
480
- <span>📄</span> App.tsx
481
- </div>
482
- <div className="flex items-center gap-1">
483
- <span>📁</span> components
484
- </div>
485
- </div>
191
+ {/* Nested layouts */}
192
+ <div className="space-y-3">
193
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
194
+ Nested Layouts (horizontal + vertical)
195
+ </h4>
196
+ <div className="border-fm-divider-secondary h-64 overflow-hidden rounded-lg border">
197
+ <ResizablePanelGroup direction="horizontal">
198
+ <ResizablePanel defaultSize={28} minSize={20}>
199
+ <div className="bg-fm-surface-secondary flex h-full flex-col justify-center space-y-2 p-4">
200
+ <p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm font-medium">
201
+ Sidebar
202
+ </p>
203
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
204
+ Navigation & tools
205
+ </p>
206
+ <div className="mt-3 space-y-2">
207
+ <div className="bg-fm-surface-primary h-2 rounded" />
208
+ <div className="bg-fm-surface-primary h-2 rounded" />
209
+ <div className="bg-fm-surface-primary h-2 w-2/3 rounded" />
486
210
  </div>
487
- </ResizablePanel>
488
- <ResizableHandle withHandle />
489
-
490
- {/* Main Content */}
491
- <ResizablePanel defaultSize={60}>
492
- <ResizablePanelGroup direction="vertical">
493
- {/* Editor */}
494
- <ResizablePanel defaultSize={70}>
495
- <div className="h-full bg-gray-900/30 p-4">
496
- <div className="mb-4 flex items-center gap-2 border-b border-white/10 pb-2">
497
- <span className="text-xs text-white/60">App.tsx</span>
498
- <span className="text-xs text-white/40">×</span>
499
- </div>
500
- <div className="space-y-2 font-mono text-xs text-white/70">
501
- <div>
502
- <span className="text-purple-400">import</span> React{" "}
503
- <span className="text-purple-400">from</span>{" "}
504
- <span className="text-green-400">'react'</span>
505
- </div>
506
- <div></div>
507
- <div>
508
- <span className="text-purple-400">function</span>{" "}
509
- <span className="text-blue-400">App</span>() {"{"}
510
- </div>
511
- <div className="ml-4">
512
- <span className="text-purple-400">return</span> (
513
- </div>
514
- <div className="ml-8">
515
- &lt;<span className="text-red-400">div</span>&gt;Hello
516
- World&lt;/<span className="text-red-400">div</span>
517
- &gt;
518
- </div>
519
- <div className="ml-4">)</div>
520
- <div>{"}"}</div>
521
- </div>
211
+ </div>
212
+ </ResizablePanel>
213
+ <ResizableHandle withHandle />
214
+ <ResizablePanel defaultSize={72}>
215
+ <ResizablePanelGroup direction="vertical">
216
+ <ResizablePanel defaultSize={65}>
217
+ <div className="bg-fm-surface-primary flex h-full items-center justify-center p-4">
218
+ <div className="space-y-1 text-center">
219
+ <p className="text-fm-primary font-fm-text text-fm-md leading-fm-md font-medium">
220
+ Main Workspace
221
+ </p>
222
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
223
+ Primary content area — resizes vertically
224
+ </p>
522
225
  </div>
523
- </ResizablePanel>
524
- <ResizableHandle withHandle />
525
-
526
- {/* Terminal */}
527
- <ResizablePanel defaultSize={30} minSize={20}>
528
- <div className="h-full bg-black/50 p-3">
529
- <div className="mb-2 flex items-center gap-2">
530
- <h5 className="text-xs font-medium text-white">
531
- TERMINAL
532
- </h5>
533
- <span className="text-xs text-white/40">bash</span>
534
- </div>
535
- <div className="font-mono text-xs text-green-400">
536
- <div>$ npm start</div>
537
- <div className="text-white/60">
538
- Starting development server...
539
- </div>
540
- <div className="text-white/60">
541
- Local: http://localhost:3000
542
- </div>
543
- <div className="text-green-400">
544
- ✓ Compiled successfully!
545
- </div>
546
- </div>
226
+ </div>
227
+ </ResizablePanel>
228
+ <ResizableHandle withHandle />
229
+ <ResizablePanel defaultSize={35} minSize={20}>
230
+ <div className="bg-fm-surface-secondary flex h-full items-center justify-center p-4">
231
+ <div className="space-y-1 text-center">
232
+ <p className="text-fm-primary font-fm-text text-fm-md leading-fm-md font-medium">
233
+ Console / Details
234
+ </p>
235
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
236
+ Nested vertical panel · min 20%
237
+ </p>
547
238
  </div>
548
- </ResizablePanel>
549
- </ResizablePanelGroup>
550
- </ResizablePanel>
551
- <ResizableHandle withHandle />
552
-
553
- {/* Right Sidebar */}
554
- <ResizablePanel defaultSize={20} minSize={15}>
555
- <div className="h-full bg-gray-900/50 p-3">
556
- <h5 className="mb-3 text-xs font-medium text-white">
557
- OUTLINE
558
- </h5>
559
- <div className="space-y-1 text-xs text-white/60">
560
- <div>📋 Components</div>
561
- <div className="ml-3">⚛️ App</div>
562
- <div className="ml-3">🎨 Header</div>
563
- <div className="ml-3">📝 Content</div>
564
- <div>🎯 Hooks</div>
565
- <div className="ml-3">🔄 useState</div>
566
239
  </div>
567
- </div>
568
- </ResizablePanel>
569
- </ResizablePanelGroup>
570
- </div>
240
+ </ResizablePanel>
241
+ </ResizablePanelGroup>
242
+ </ResizablePanel>
243
+ </ResizablePanelGroup>
571
244
  </div>
245
+ </div>
572
246
 
573
- {/* Dashboard Layout */}
247
+ {/* Handle variations */}
248
+ <div className="space-y-3">
249
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
250
+ Handle Variations
251
+ </h4>
574
252
  <div className="space-y-4">
575
- <h4 className="text-sm font-medium text-white/70">
576
- Dashboard Layout
577
- </h4>
578
- <div className="h-64">
579
- <ResizablePanelGroup
580
- direction="horizontal"
581
- className="overflow-hidden rounded-lg border border-white/10"
582
- >
583
- {/* Sidebar */}
584
- <ResizablePanel defaultSize={25} minSize={20}>
585
- <div className="h-full bg-blue-900/20 p-4">
586
- <h5 className="mb-4 text-sm font-medium text-white">
587
- Navigation
588
- </h5>
589
- <div className="space-y-3">
590
- <div className="flex items-center gap-2 text-sm text-white/80">
591
- <span>📊</span> Dashboard
592
- </div>
593
- <div className="flex items-center gap-2 text-sm text-white/60">
594
- <span>👥</span> Users
595
- </div>
596
- <div className="flex items-center gap-2 text-sm text-white/60">
597
- <span>⚙️</span> Settings
598
- </div>
253
+ <div className="space-y-1">
254
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
255
+ Without visual handle (minimal)
256
+ </p>
257
+ <div className="border-fm-divider-secondary h-24 overflow-hidden rounded-lg border">
258
+ <ResizablePanelGroup direction="horizontal">
259
+ <ResizablePanel defaultSize={50}>
260
+ <div className="bg-fm-surface-secondary flex h-full items-center justify-center p-4">
261
+ <span className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
262
+ Minimal handle
263
+ </span>
599
264
  </div>
600
- </div>
601
- </ResizablePanel>
602
- <ResizableHandle withHandle />
603
-
604
- {/* Main Dashboard */}
605
- <ResizablePanel defaultSize={75}>
606
- <ResizablePanelGroup direction="vertical">
607
- {/* Top Metrics */}
608
- <ResizablePanel defaultSize={40}>
609
- <div className="h-full bg-green-900/20 p-4">
610
- <h5 className="mb-3 text-sm font-medium text-white">
611
- Key Metrics
612
- </h5>
613
- <div className="grid h-20 grid-cols-3 gap-4">
614
- <div className="rounded bg-white/5 p-3 text-center">
615
- <div className="text-lg font-bold text-white">
616
- 1,234
617
- </div>
618
- <div className="text-xs text-white/60">Users</div>
619
- </div>
620
- <div className="rounded bg-white/5 p-3 text-center">
621
- <div className="text-lg font-bold text-white">
622
- $12.3k
623
- </div>
624
- <div className="text-xs text-white/60">Revenue</div>
625
- </div>
626
- <div className="rounded bg-white/5 p-3 text-center">
627
- <div className="text-lg font-bold text-white">
628
- 98.5%
629
- </div>
630
- <div className="text-xs text-white/60">Uptime</div>
631
- </div>
632
- </div>
633
- </div>
634
- </ResizablePanel>
635
- <ResizableHandle withHandle />
265
+ </ResizablePanel>
266
+ <ResizableHandle />
267
+ <ResizablePanel defaultSize={50}>
268
+ <div className="bg-fm-surface-primary flex h-full items-center justify-center p-4">
269
+ <span className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
270
+ Clean divider
271
+ </span>
272
+ </div>
273
+ </ResizablePanel>
274
+ </ResizablePanelGroup>
275
+ </div>
276
+ </div>
636
277
 
637
- {/* Bottom Charts */}
638
- <ResizablePanel defaultSize={60}>
639
- <div className="h-full bg-purple-900/20 p-4">
640
- <h5 className="mb-3 text-sm font-medium text-white">
641
- Analytics
642
- </h5>
643
- <div className="flex h-full items-center justify-center rounded bg-white/5 p-4">
644
- <span className="text-white/60">📈 Chart Area</span>
645
- </div>
646
- </div>
647
- </ResizablePanel>
648
- </ResizablePanelGroup>
649
- </ResizablePanel>
650
- </ResizablePanelGroup>
278
+ <div className="space-y-1">
279
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
280
+ With visual handle (grip icon)
281
+ </p>
282
+ <div className="border-fm-divider-secondary h-24 overflow-hidden rounded-lg border">
283
+ <ResizablePanelGroup direction="horizontal">
284
+ <ResizablePanel defaultSize={50}>
285
+ <div className="bg-fm-surface-secondary flex h-full items-center justify-center p-4">
286
+ <span className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
287
+ Clear affordance
288
+ </span>
289
+ </div>
290
+ </ResizablePanel>
291
+ <ResizableHandle withHandle />
292
+ <ResizablePanel defaultSize={50}>
293
+ <div className="bg-fm-surface-primary flex h-full items-center justify-center p-4">
294
+ <span className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
295
+ Grip visible
296
+ </span>
297
+ </div>
298
+ </ResizablePanel>
299
+ </ResizablePanelGroup>
300
+ </div>
651
301
  </div>
652
302
  </div>
653
303
  </div>
@@ -657,209 +307,303 @@ export const RealWorldExamples: Story = {
657
307
  docs: {
658
308
  description: {
659
309
  story:
660
- "Real-world application layouts including IDE/code editor interface and dashboard layout with multiple nested panels.",
310
+ "All layout configurations: horizontal split, vertical split, three-panel with minimum sizes, nested horizontal+vertical layouts, and both handle variants (minimal vs. grip icon).",
661
311
  },
662
312
  },
663
313
  },
664
314
  }
665
315
 
666
- // 7. Accessibility Demo
667
- export const AccessibilityDemo: Story = {
668
- render: () => (
669
- <div className="space-y-6 p-8">
670
- <h3 className="text-center text-lg font-medium text-white">
671
- Accessibility Features
672
- </h3>
673
-
674
- <div className="space-y-4">
675
- <div className="rounded-lg border border-blue-500/30 bg-blue-900/10 p-4">
676
- <h4 className="mb-2 text-sm font-medium text-blue-300">
677
- Keyboard Navigation
678
- </h4>
679
- <p className="mb-2 text-xs text-blue-200/70">
680
- Try these keyboard interactions:
681
- </p>
682
- <ul className="space-y-1 text-xs text-blue-200/70">
683
- <li>
684
- • <kbd className="rounded bg-white/10 px-1">Tab</kbd> to focus
685
- resize handles
686
- </li>
687
- <li>
688
- • <kbd className="rounded bg-white/10 px-1">Arrow Keys</kbd> to
689
- resize panels
690
- </li>
691
- <li>
692
- • <kbd className="rounded bg-white/10 px-1">Enter</kbd> to
693
- activate resize mode
694
- </li>
695
- <li>
696
- • <kbd className="rounded bg-white/10 px-1">Escape</kbd> to exit
697
- resize mode
698
- </li>
699
- </ul>
700
- </div>
316
+ // ─── UseCases ─────────────────────────────────────────────────────────────────
701
317
 
702
- <div className="h-48">
703
- <h4 className="mb-2 text-sm font-medium text-white/70">
704
- Keyboard Accessible Resizing
705
- </h4>
706
- <ResizablePanelGroup
707
- direction="horizontal"
708
- className="overflow-hidden rounded-lg border border-white/10"
709
- >
710
- <ResizablePanel defaultSize={40}>
711
- <div className="flex h-full items-center justify-center bg-blue-500/10 p-4">
712
- <div className="text-center">
713
- <h5 className="text-md font-medium text-white">Left Panel</h5>
714
- <p className="mt-1 text-xs text-white/60">
715
- Tab to the handle and use arrow keys
318
+ export const UseCases: Story = {
319
+ render: () => (
320
+ <div className="mx-auto max-w-3xl space-y-8 p-8">
321
+ {/* Sidebar + Main — library browser */}
322
+ <div className="space-y-3">
323
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
324
+ Sidebar + Main Content
325
+ </h4>
326
+ <div className="border-fm-divider-secondary h-72 overflow-hidden rounded-xl border">
327
+ <ResizablePanelGroup direction="horizontal">
328
+ {/* Sidebar */}
329
+ <ResizablePanel defaultSize={28} minSize={18}>
330
+ <div className="bg-fm-surface-secondary flex h-full flex-col">
331
+ <div className="border-fm-divider-secondary border-b px-4 py-3">
332
+ <p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
333
+ Library
716
334
  </p>
717
335
  </div>
336
+ <nav className="flex-1 space-y-1 p-3">
337
+ {[
338
+ { icon: MusicalNoteIcon, label: "Songs" },
339
+ { icon: HeartIcon, label: "Favorites" },
340
+ { icon: SearchIcon, label: "Discover" },
341
+ { icon: SettingIcon, label: "Settings" },
342
+ ].map(({ icon: Icon, label }) => (
343
+ <button
344
+ key={label}
345
+ className="text-fm-secondary hover:text-fm-primary hover:bg-fm-surface-primary font-fm-text text-fm-sm leading-fm-sm flex w-full items-center gap-2 rounded-lg px-3 py-2 transition-colors"
346
+ >
347
+ <Icon className="h-4 w-4 shrink-0" />
348
+ {label}
349
+ </button>
350
+ ))}
351
+ </nav>
718
352
  </div>
719
353
  </ResizablePanel>
720
354
  <ResizableHandle withHandle />
721
- <ResizablePanel defaultSize={60}>
722
- <div className="flex h-full items-center justify-center bg-purple-500/10 p-4">
723
- <div className="text-center">
724
- <h5 className="text-md font-medium text-white">
725
- Right Panel
726
- </h5>
727
- <p className="mt-1 text-xs text-white/60">
728
- Focus ring visible when handle is focused
355
+ {/* Main content */}
356
+ <ResizablePanel defaultSize={72}>
357
+ <div className="bg-fm-surface-primary flex h-full flex-col">
358
+ <div className="border-fm-divider-secondary border-b px-4 py-3">
359
+ <p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
360
+ Songs
729
361
  </p>
730
362
  </div>
363
+ <div className="flex-1 space-y-1 overflow-auto p-3">
364
+ {[
365
+ {
366
+ title: "Midnight Drive",
367
+ artist: "Nova Wave",
368
+ duration: "3:42",
369
+ },
370
+ {
371
+ title: "Electric Haze",
372
+ artist: "The Circuits",
373
+ duration: "4:15",
374
+ },
375
+ {
376
+ title: "Neon Pulse",
377
+ artist: "Synthcore",
378
+ duration: "3:58",
379
+ },
380
+ {
381
+ title: "Deep Current",
382
+ artist: "Ocean Mind",
383
+ duration: "5:02",
384
+ },
385
+ ].map((song) => (
386
+ <div
387
+ key={song.title}
388
+ className="hover:bg-fm-surface-secondary flex items-center justify-between rounded-lg px-3 py-2 transition-colors"
389
+ >
390
+ <div className="flex items-center gap-3">
391
+ <div className="bg-fm-surface-secondary border-fm-divider-secondary flex h-8 w-8 shrink-0 items-center justify-center rounded-md border">
392
+ <MusicalNoteIcon className="text-fm-tertiary h-4 w-4" />
393
+ </div>
394
+ <div>
395
+ <p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
396
+ {song.title}
397
+ </p>
398
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
399
+ {song.artist}
400
+ </p>
401
+ </div>
402
+ </div>
403
+ <span className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
404
+ {song.duration}
405
+ </span>
406
+ </div>
407
+ ))}
408
+ </div>
731
409
  </div>
732
410
  </ResizablePanel>
733
411
  </ResizablePanelGroup>
734
412
  </div>
735
-
736
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
737
- <h4 className="mb-3 text-sm font-medium text-white/70">
738
- Screen Reader Support
739
- </h4>
740
- <div className="space-y-1 text-xs text-white/60">
741
- <p>• Resize handles have proper ARIA labels</p>
742
- <p>• Panel relationships are properly communicated</p>
743
- <p>• Size changes are announced to screen readers</p>
744
- <p>• Keyboard instructions are provided contextually</p>
745
- </div>
746
- </div>
747
413
  </div>
748
- </div>
749
- ),
750
- parameters: {
751
- docs: {
752
- description: {
753
- story:
754
- "Demonstration of accessibility features including keyboard navigation, focus management, and screen reader support.",
755
- },
756
- },
757
- },
758
- }
759
-
760
- // 8. Interactive Playground
761
- export const InteractivePlayground: Story = {
762
- render: () => {
763
- const [sizes, setSizes] = React.useState([25, 50, 25])
764
-
765
- return (
766
- <div className="space-y-6 p-8">
767
- <h3 className="text-center text-lg font-medium text-white">
768
- Interactive Playground
769
- </h3>
770
-
771
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
772
- <h4 className="mb-2 text-sm font-medium text-white/70">
773
- Current Panel Sizes
774
- </h4>
775
- <div className="grid grid-cols-3 gap-4 text-xs">
776
- <div className="text-center">
777
- <div className="text-white">Left Panel</div>
778
- <div className="font-mono text-blue-400">
779
- {sizes[0].toFixed(1)}%
780
- </div>
781
- </div>
782
- <div className="text-center">
783
- <div className="text-white">Center Panel</div>
784
- <div className="font-mono text-green-400">
785
- {sizes[1].toFixed(1)}%
786
- </div>
787
- </div>
788
- <div className="text-center">
789
- <div className="text-white">Right Panel</div>
790
- <div className="font-mono text-purple-400">
791
- {sizes[2].toFixed(1)}%
792
- </div>
793
- </div>
794
- </div>
795
- </div>
796
414
 
797
- <div className="h-64">
798
- <ResizablePanelGroup
799
- direction="horizontal"
800
- className="overflow-hidden rounded-lg border border-white/10"
801
- onLayout={(newSizes) => setSizes(newSizes)}
802
- >
803
- <ResizablePanel defaultSize={25} minSize={15}>
804
- <div className="flex h-full items-center justify-center bg-blue-500/10 p-4">
805
- <div className="text-center">
806
- <h5 className="text-md font-medium text-white">Panel 1</h5>
807
- <p className="mt-1 text-xs text-white/60">Min: 15%</p>
808
- <div className="mx-auto mt-3 flex h-16 w-16 items-center justify-center rounded-full bg-blue-500/20">
809
- <span className="font-mono text-xs text-blue-300">
810
- {sizes[0]?.toFixed(0)}%
811
- </span>
812
- </div>
415
+ {/* Inspector panel — track detail */}
416
+ <div className="space-y-3">
417
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
418
+ Inspector Panel
419
+ </h4>
420
+ <div className="border-fm-divider-secondary h-64 overflow-hidden rounded-xl border">
421
+ <ResizablePanelGroup direction="horizontal">
422
+ {/* Track list */}
423
+ <ResizablePanel defaultSize={55}>
424
+ <div className="bg-fm-surface-primary flex h-full flex-col">
425
+ <div className="border-fm-divider-secondary border-b px-4 py-3">
426
+ <p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
427
+ Track List
428
+ </p>
813
429
  </div>
814
- </div>
815
- </ResizablePanel>
816
- <ResizableHandle withHandle />
817
-
818
- <ResizablePanel defaultSize={50}>
819
- <div className="flex h-full items-center justify-center bg-green-500/10 p-4">
820
- <div className="text-center">
821
- <h5 className="text-md font-medium text-white">Panel 2</h5>
822
- <p className="mt-1 text-xs text-white/60">Flexible</p>
823
- <div className="mx-auto mt-3 flex h-16 w-16 items-center justify-center rounded-full bg-green-500/20">
824
- <span className="font-mono text-xs text-green-300">
825
- {sizes[1]?.toFixed(0)}%
826
- </span>
827
- </div>
430
+ <div className="flex-1 space-y-1 p-3">
431
+ {["Midnight Drive", "Electric Haze", "Neon Pulse"].map(
432
+ (title, i) => (
433
+ <div
434
+ key={title}
435
+ className={`flex items-center gap-3 rounded-lg px-3 py-2 transition-colors ${i === 0 ? "bg-fm-surface-secondary" : "hover:bg-fm-surface-secondary"}`}
436
+ >
437
+ <span className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm w-4">
438
+ {i + 1}
439
+ </span>
440
+ <p
441
+ className={`font-fm-text text-fm-sm leading-fm-sm ${i === 0 ? "text-fm-primary" : "text-fm-secondary"}`}
442
+ >
443
+ {title}
444
+ </p>
445
+ </div>
446
+ )
447
+ )}
828
448
  </div>
829
449
  </div>
830
450
  </ResizablePanel>
831
451
  <ResizableHandle withHandle />
832
-
833
- <ResizablePanel defaultSize={25} minSize={20}>
834
- <div className="flex h-full items-center justify-center bg-purple-500/10 p-4">
835
- <div className="text-center">
836
- <h5 className="text-md font-medium text-white">Panel 3</h5>
837
- <p className="mt-1 text-xs text-white/60">Min: 20%</p>
838
- <div className="mx-auto mt-3 flex h-16 w-16 items-center justify-center rounded-full bg-purple-500/20">
839
- <span className="font-mono text-xs text-purple-300">
840
- {sizes[2]?.toFixed(0)}%
841
- </span>
842
- </div>
452
+ {/* Inspector */}
453
+ <ResizablePanel defaultSize={45} minSize={30}>
454
+ <div className="bg-fm-surface-secondary flex h-full flex-col">
455
+ <div className="border-fm-divider-secondary border-b px-4 py-3">
456
+ <p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
457
+ Inspector
458
+ </p>
459
+ </div>
460
+ <div className="flex-1 space-y-3 p-4">
461
+ {[
462
+ { label: "Title", value: "Midnight Drive" },
463
+ { label: "Artist", value: "Nova Wave" },
464
+ { label: "Duration", value: "3:42" },
465
+ { label: "BPM", value: "128" },
466
+ { label: "Key", value: "A minor" },
467
+ ].map(({ label, value }) => (
468
+ <div
469
+ key={label}
470
+ className="flex items-center justify-between"
471
+ >
472
+ <span className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
473
+ {label}
474
+ </span>
475
+ <span className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
476
+ {value}
477
+ </span>
478
+ </div>
479
+ ))}
843
480
  </div>
844
481
  </div>
845
482
  </ResizablePanel>
846
483
  </ResizablePanelGroup>
847
484
  </div>
485
+ </div>
848
486
 
849
- <div className="text-center text-xs text-white/60">
850
- <p>
851
- Drag the handles to resize panels and see the live size updates
852
- above!
853
- </p>
487
+ {/* Waveform editor layout */}
488
+ <div className="space-y-3">
489
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
490
+ Waveform Editor Layout
491
+ </h4>
492
+ <div className="border-fm-divider-secondary h-80 overflow-hidden rounded-xl border">
493
+ <ResizablePanelGroup direction="horizontal">
494
+ {/* Tools sidebar */}
495
+ <ResizablePanel defaultSize={20} minSize={15}>
496
+ <div className="bg-fm-surface-secondary flex h-full flex-col items-center gap-3 px-2 py-4">
497
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm writing-mode-vertical-lr hidden rotate-180">
498
+ Tools
499
+ </p>
500
+ {[MusicalNoteIcon, HeartIcon, AlertIcon, SettingIcon].map(
501
+ (Icon, i) => (
502
+ <button
503
+ key={i}
504
+ className="text-fm-secondary hover:text-fm-primary hover:bg-fm-surface-primary rounded-lg p-2 transition-colors"
505
+ >
506
+ <Icon className="h-4 w-4" />
507
+ </button>
508
+ )
509
+ )}
510
+ </div>
511
+ </ResizablePanel>
512
+ <ResizableHandle withHandle />
513
+ {/* Main editor area */}
514
+ <ResizablePanel defaultSize={80}>
515
+ <ResizablePanelGroup direction="vertical">
516
+ {/* Waveform */}
517
+ <ResizablePanel defaultSize={60}>
518
+ <div className="bg-fm-surface-primary flex h-full flex-col">
519
+ <div className="border-fm-divider-secondary flex items-center gap-3 border-b px-4 py-2">
520
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
521
+ Waveform — Midnight Drive.flac
522
+ </p>
523
+ </div>
524
+ <div className="flex flex-1 items-center justify-center gap-1 px-6">
525
+ {Array.from({ length: 48 }, (_, i) => {
526
+ const h = 20 + Math.abs(Math.sin(i * 0.4 + 1) * 60)
527
+ return (
528
+ <div
529
+ key={i}
530
+ className="bg-fm-surface-info-sec w-1 shrink-0 rounded-full"
531
+ style={{ height: `${h}%` }}
532
+ />
533
+ )
534
+ })}
535
+ </div>
536
+ {/* Transport bar */}
537
+ <div className="border-fm-divider-secondary flex items-center justify-center gap-4 border-t px-4 py-2">
538
+ <button className="text-fm-secondary hover:text-fm-primary transition-colors outline-none">
539
+ <SkipBackwardIcon className="h-4 w-4" />
540
+ </button>
541
+ <button className="text-fm-primary hover:text-fm-secondary transition-colors outline-none">
542
+ <PauseIcon className="h-4 w-4" />
543
+ </button>
544
+ <button className="text-fm-secondary hover:text-fm-primary transition-colors outline-none">
545
+ <SkipForwardIcon className="h-4 w-4" />
546
+ </button>
547
+ <button className="text-fm-secondary hover:text-fm-primary transition-colors outline-none">
548
+ <VolumeFullIcon className="h-4 w-4" />
549
+ </button>
550
+ </div>
551
+ </div>
552
+ </ResizablePanel>
553
+ <ResizableHandle withHandle />
554
+ {/* Timeline / markers */}
555
+ <ResizablePanel defaultSize={40} minSize={20}>
556
+ <div className="bg-fm-surface-secondary flex h-full flex-col">
557
+ <div className="border-fm-divider-secondary border-b px-4 py-2">
558
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
559
+ Markers &amp; Regions
560
+ </p>
561
+ </div>
562
+ <div className="flex-1 space-y-2 p-4">
563
+ {[
564
+ {
565
+ label: "Intro",
566
+ time: "0:00",
567
+ color: "bg-fm-surface-info-sec",
568
+ },
569
+ {
570
+ label: "Verse",
571
+ time: "0:32",
572
+ color: "bg-fm-surface-positive-sec",
573
+ },
574
+ {
575
+ label: "Chorus",
576
+ time: "1:12",
577
+ color: "bg-fm-surface-warning-sec",
578
+ },
579
+ ].map(({ label, time, color }) => (
580
+ <div key={label} className="flex items-center gap-3">
581
+ <div
582
+ className={`h-3 w-3 rounded-sm ${color} shrink-0`}
583
+ />
584
+ <span className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
585
+ {label}
586
+ </span>
587
+ <span className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm ml-auto">
588
+ {time}
589
+ </span>
590
+ </div>
591
+ ))}
592
+ </div>
593
+ </div>
594
+ </ResizablePanel>
595
+ </ResizablePanelGroup>
596
+ </ResizablePanel>
597
+ </ResizablePanelGroup>
854
598
  </div>
855
599
  </div>
856
- )
857
- },
600
+ </div>
601
+ ),
858
602
  parameters: {
859
603
  docs: {
860
604
  description: {
861
605
  story:
862
- "Interactive playground showing real-time panel size updates and demonstrating the onLayout callback functionality.",
606
+ "Real audio app split views: a collapsible sidebar + main library browser, a track list + inspector panel pair, and a waveform editor with tool sidebar, waveform canvas, transport controls, and a resizable marker region below.",
863
607
  },
864
608
  },
865
609
  },