aural-ui 4.0.1 → 4.2.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 (175) hide show
  1. package/README.md +8 -1
  2. package/dist/components/aspect-ratio/AspectRatio.stories.tsx +290 -1228
  3. package/dist/components/avatar/Avatar.stories.tsx +219 -235
  4. package/dist/components/badge/Badge.stories.tsx +379 -116
  5. package/dist/components/banner/Banner.stories.tsx +445 -391
  6. package/dist/components/breadcrumb/Breadcrumb.stories.tsx +453 -199
  7. package/dist/components/button/Button.stories.tsx +585 -230
  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 -636
  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 +530 -867
  16. package/dist/components/dialog/Dialog.stories.tsx +501 -950
  17. package/dist/components/divider/Divider.stories.tsx +264 -527
  18. package/dist/components/dot-loader/DotLoader.stories.tsx +256 -257
  19. package/dist/components/drawer/Drawer.stories.tsx +659 -1023
  20. package/dist/components/dropdown/Dropdown.stories.tsx +643 -1028
  21. package/dist/components/form/Form.stories.tsx +560 -274
  22. package/dist/components/helper-text/HelperText.stories.tsx +199 -200
  23. package/dist/components/hover-card/HoverCard.stories.tsx +318 -1254
  24. package/dist/components/icon-button/IconButton.stories.tsx +837 -194
  25. package/dist/components/if-else/if-else.stories.tsx +370 -83
  26. package/dist/components/input/Input.stories.tsx +436 -368
  27. package/dist/components/label/Label.stories.tsx +156 -154
  28. package/dist/components/list/List.stories.tsx +484 -835
  29. package/dist/components/marquee/Marquee.stories.tsx +356 -712
  30. package/dist/components/otp-inputs/OtpInputs.stories.tsx +352 -422
  31. package/dist/components/overlay/Overlay.stories.tsx +452 -824
  32. package/dist/components/pagination/Pagination.stories.tsx +721 -210
  33. package/dist/components/popover/Popover.stories.tsx +481 -896
  34. package/dist/components/radio/Radio.stories.tsx +432 -124
  35. package/dist/components/resizable/Resizable.stories.tsx +495 -799
  36. package/dist/components/scroll-area/ScrollArea.stories.tsx +383 -1059
  37. package/dist/components/search/Search.stories.tsx +312 -595
  38. package/dist/components/select/Select.stories.tsx +684 -789
  39. package/dist/components/sheet/Sheet.stories.tsx +671 -950
  40. package/dist/components/skelton/Skelton.stories.tsx +230 -764
  41. package/dist/components/slider/Slider.stories.tsx +383 -760
  42. package/dist/components/stepper/Stepper.stories.tsx +371 -514
  43. package/dist/components/switch/Switch.stories.tsx +461 -208
  44. package/dist/components/switch-case/SwitchCase.stories.tsx +367 -188
  45. package/dist/components/table/Table.stories.tsx +770 -916
  46. package/dist/components/tabs/Tabs.stories.tsx +458 -1455
  47. package/dist/components/tag/Tag.stories.tsx +714 -542
  48. package/dist/components/textarea/TextArea.stories.tsx +621 -562
  49. package/dist/components/thumbnail-tags/ThumbnailTags.stories.tsx +228 -154
  50. package/dist/components/toast/Toast.stories.tsx +452 -1339
  51. package/dist/components/toggle/Toggle.stories.tsx +488 -931
  52. package/dist/components/tooltip/Tooltip.stories.tsx +344 -1388
  53. package/dist/components/typography/Typography.stories.tsx +406 -89
  54. package/dist/hooks/use-change-state/UseChangeState.stories.tsx +309 -606
  55. package/dist/hooks/use-previous/UsePrevious.stories.tsx +367 -917
  56. package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +639 -867
  57. package/dist/icons/Icons.stories.tsx +0 -12
  58. package/dist/icons/ai-avatar-icon/AiAvatarIcon.stories.tsx +223 -1060
  59. package/dist/icons/alert-icon/AlertIcon.stories.tsx +106 -968
  60. package/dist/icons/all-icons.tsx +37 -16
  61. package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +137 -1010
  62. package/dist/icons/apple-logo-icon/AppleLogoIcon.stories.tsx +145 -935
  63. package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +132 -1046
  64. package/dist/icons/arrow-corner-up-left-icon/ArrowCornerUpLeftIcon.stories.tsx +134 -986
  65. package/dist/icons/arrow-corner-up-right-icon/ArrowCornerUpRightIcon.stories.tsx +135 -1028
  66. package/dist/icons/arrow-left-icon/ArrowLeftIcon.stories.tsx +133 -971
  67. package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +145 -1123
  68. package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +143 -1252
  69. package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +123 -632
  70. package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +141 -1223
  71. package/dist/icons/backward-ten-seconds-icon/BackwardTenSecondsIcon.stories.tsx +164 -1018
  72. package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +121 -1236
  73. package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +121 -1213
  74. package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +116 -893
  75. package/dist/icons/camera-icon/CameraIcon.stories.tsx +109 -1254
  76. package/dist/icons/capital-a-letter-icon/CapitalALetterIcon.stories.tsx +114 -975
  77. package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +157 -994
  78. package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +160 -992
  79. package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +140 -970
  80. package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +126 -993
  81. package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +144 -987
  82. package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +141 -1007
  83. package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +147 -1187
  84. package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +110 -476
  85. package/dist/icons/coin-icon/CoinIcon.stories.tsx +120 -1364
  86. package/dist/icons/coin-toons-icon/CoinToonsIcon.stories.tsx +113 -1360
  87. package/dist/icons/column-wide-add-icon/ColumnWideAddIcon.stories.tsx +111 -942
  88. package/dist/icons/command-icon/CommandIcon.stories.tsx +124 -1087
  89. package/dist/icons/copy-icon/CopyIcon.stories.tsx +119 -996
  90. package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +144 -1046
  91. package/dist/icons/cross-icon/CrossIcon.stories.tsx +136 -999
  92. package/dist/icons/download-icon/DownloadIcon.stories.tsx +123 -857
  93. package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +121 -1080
  94. package/dist/icons/email-icon/EmailIcon.stories.tsx +112 -979
  95. package/dist/icons/expand-icon/ExpandIcon.stories.tsx +109 -1146
  96. package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +141 -1068
  97. package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +140 -1081
  98. package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +124 -1050
  99. package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +123 -1091
  100. package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +122 -633
  101. package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +116 -1087
  102. package/dist/icons/forward-ten-seconds-icon/ForwardTenSecondsIcon.stories.tsx +166 -1020
  103. package/dist/icons/git-branch-icon/GitBranchIcon.stories.tsx +112 -1182
  104. package/dist/icons/git-fork-icon/GitForkIcon.stories.tsx +112 -1155
  105. package/dist/icons/globe-icon/GlobeIcon.stories.tsx +127 -325
  106. package/dist/icons/google-logo-icon/GoogleLogoIcon.stories.tsx +142 -985
  107. package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +116 -1217
  108. package/dist/icons/head-icon/HeadIcon.stories.tsx +108 -953
  109. package/dist/icons/heart-icon/HeartIcon.stories.tsx +117 -1060
  110. package/dist/icons/image-avatar-sparkle-icon/ImageAvatarSparkleIcon.stories.tsx +116 -716
  111. package/dist/icons/image-icon/ImageIcon.stories.tsx +102 -1164
  112. package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +108 -1233
  113. package/dist/icons/import-left-arrow-folder-icon/ImportLeftArrowFolderIcon.stories.tsx +133 -1289
  114. package/dist/icons/indian-flag-icon/IndianFlagIcon.stories.tsx +155 -1012
  115. package/dist/icons/instagram-icon/InstagramIcon.stories.tsx +158 -1438
  116. package/dist/icons/layout-column-icon/LayoutColumnIcon.stories.tsx +121 -1011
  117. package/dist/icons/layout-left-icon/LayoutLeftIcon.stories.tsx +116 -981
  118. package/dist/icons/layout-right-icon/LayoutRightIcon.stories.tsx +116 -979
  119. package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +105 -1252
  120. package/dist/icons/linked-in-icon/LinkedInIcon.stories.tsx +151 -1554
  121. package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +107 -1227
  122. package/dist/icons/magic-edit-icon/MagicEditIcon.stories.tsx +116 -707
  123. package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +119 -1226
  124. package/dist/icons/message-icon/MessageIcon.stories.tsx +111 -557
  125. package/dist/icons/minimize-icon/MinimizeIcon.stories.tsx +112 -1198
  126. package/dist/icons/moon-icon/MoonIcon.stories.tsx +117 -557
  127. package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +106 -1235
  128. package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +112 -1185
  129. package/dist/icons/musical-note-icon/MusicalNoteIcon.stories.tsx +116 -1012
  130. package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +108 -1137
  131. package/dist/icons/notes-icon/NotesIcon.stories.tsx +116 -1138
  132. package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +106 -1146
  133. package/dist/icons/page-text-icon/PageTextIcon.stories.tsx +119 -719
  134. package/dist/icons/paint-roll-icon/PaintRollIcon.stories.tsx +110 -999
  135. package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +109 -912
  136. package/dist/icons/pause-icon/PauseIcon.stories.tsx +110 -1041
  137. package/dist/icons/pencil-icon/PencilIcon.stories.tsx +112 -1109
  138. package/dist/icons/phone-icon/PhoneIcon.stories.tsx +112 -1023
  139. package/dist/icons/plus-icon/PlusIcon.stories.tsx +103 -1132
  140. package/dist/icons/pocket-studio-icon/PocketStudioIcon.stories.tsx +104 -870
  141. package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +99 -476
  142. package/dist/icons/search-icon/SearchIcon.stories.tsx +108 -1161
  143. package/dist/icons/setting-icon/SettingIcon.stories.tsx +104 -1009
  144. package/dist/icons/share-icon/ShareIcon.stories.tsx +117 -1064
  145. package/dist/icons/shield-icon/ShieldIcon.stories.tsx +114 -974
  146. package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +134 -1160
  147. package/dist/icons/skip-backward-icon/SkipBackwardIcon.stories.tsx +169 -1017
  148. package/dist/icons/skip-forward-icon/SkipForwardIcon.stories.tsx +161 -1016
  149. package/dist/icons/sparkles-soft-icon/SparklesSoftIcon.stories.tsx +102 -1001
  150. package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +155 -593
  151. package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +155 -608
  152. package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +142 -712
  153. package/dist/icons/star-icon/StarIcon.stories.tsx +120 -946
  154. package/dist/icons/store-coin-icon/StoreCoinIcon.stories.tsx +109 -1013
  155. package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +113 -891
  156. package/dist/icons/sun-icon/SunIcon.stories.tsx +117 -864
  157. package/dist/icons/text-color-icon/TextColorIcon.stories.tsx +113 -989
  158. package/dist/icons/text-indicator-icon/TextIndicatorIcon.stories.tsx +120 -1027
  159. package/dist/icons/threads-icon/ThreadsIcon.stories.tsx +153 -1476
  160. package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +143 -1187
  161. package/dist/icons/tick-icon/TickIcon.stories.tsx +142 -1322
  162. package/dist/icons/trash-icon/TrashIcon.stories.tsx +105 -970
  163. package/dist/icons/twitter-x-icon/TwitterXIcon.stories.tsx +154 -1457
  164. package/dist/icons/upload-icon/UploadIcon.stories.tsx +112 -930
  165. package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +115 -1019
  166. package/dist/icons/video-play-list-icon/VideoPlaylistIcon.stories.tsx +122 -1092
  167. package/dist/icons/voice-playing-icon/VoicePlayingIcon.stories.tsx +120 -1401
  168. package/dist/icons/volume-full-icon/VolumeFullIcon.stories.tsx +107 -1212
  169. package/dist/icons/volume-half-icon/VolumeHalfIcon.stories.tsx +109 -1122
  170. package/dist/icons/volume-off-icon/VolumeOffIcon.stories.tsx +112 -1124
  171. package/dist/icons/warning-icon/WarningIcon.stories.tsx +119 -1083
  172. package/dist/icons/youtube-icon/YoutubeIcon.stories.tsx +158 -983
  173. package/dist/index.cjs +90 -90
  174. package/dist/index.js +90 -90
  175. package/package.json +8 -3
@@ -1,74 +1,38 @@
1
1
  import React from "react"
2
- import { Badge } from "@components/badge"
3
- import { Button } from "@components/button"
4
2
  import type { Meta, StoryObj } from "@storybook/react-vite"
5
3
 
4
+ import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
5
+
6
6
  import { Skeleton } from "."
7
7
 
8
8
  const meta: Meta<typeof Skeleton> = {
9
9
  title: "Components/UI/Skeleton",
10
10
  component: Skeleton,
11
11
  parameters: {
12
- layout: "fullscreen",
13
- backgrounds: {
14
- default: "dark",
15
- values: [
16
- { name: "dark", value: "#0a0a0a" },
17
- { name: "light", value: "#ffffff" },
18
- ],
19
- },
12
+ layout: "centered",
20
13
  docs: {
21
14
  description: {
22
- component: `
23
- # Skeleton Component
24
-
25
- A loading placeholder component that displays animated shimmer effects while content is being loaded. It helps improve perceived performance by showing users that content is loading.
26
-
27
- ## Features
28
-
29
- - **Animated Pulse**: Smooth pulse animation for loading states
30
- - **Flexible Sizing**: Easily customizable with Tailwind classes
31
- - **Accessible**: Uses proper ARIA attributes for screen readers
32
- - **Lightweight**: Simple, performant implementation
33
- - **Customizable**: Override styles with className prop
34
- - **Rounded Corners**: Default rounded styling that can be customized
35
-
36
- ## Usage Examples
37
-
38
- ### Basic Skeleton
39
- \`\`\`tsx
40
- <Skeleton className="h-4 w-full" />
41
- \`\`\`
42
-
43
- ### Text Lines
44
- \`\`\`tsx
45
- <div className="space-y-2">
46
- <Skeleton className="h-4 w-full" />
47
- <Skeleton className="h-4 w-3/4" />
48
- <Skeleton className="h-4 w-1/2" />
49
- </div>
50
- \`\`\`
51
-
52
- ### Avatar Skeleton
53
- \`\`\`tsx
54
- <Skeleton className="h-12 w-12 rounded-full" />
55
- \`\`\`
56
-
57
- ### Card Skeleton
58
- \`\`\`tsx
59
- <div className="space-y-3">
60
- <Skeleton className="h-48 w-full rounded-lg" />
61
- <Skeleton className="h-4 w-2/3" />
62
- <Skeleton className="h-4 w-1/2" />
63
- </div>
64
- \`\`\`
65
-
66
- ### Button Skeleton
67
- \`\`\`tsx
68
- <Skeleton className="h-10 w-24 rounded-md" />
69
- \`\`\`
70
- `,
15
+ component:
16
+ "A loading placeholder that renders an animated pulse in place of content that has not yet loaded. Accepts any className to control size and shape — compose multiple instances to mirror the real UI layout and reduce perceived load time.",
71
17
  },
18
+ page: () => (
19
+ <AuralComponentDocsPage
20
+ features={[
21
+ {
22
+ title: "Animated Pulse",
23
+ description: "CSS shimmer effect",
24
+ },
25
+ {
26
+ title: "Any Shape",
27
+ description: "Size via className",
28
+ },
29
+ {
30
+ title: "Composable",
31
+ description: "Mirror real UI layout",
32
+ },
33
+ ]}
34
+ />
35
+ ),
72
36
  },
73
37
  },
74
38
  tags: ["autodocs"],
@@ -77,176 +41,160 @@ A loading placeholder component that displays animated shimmer effects while con
77
41
  export default meta
78
42
  type Story = StoryObj<typeof Skeleton>
79
43
 
80
- // 1. Basic Skeleton Sizes
81
- export const BasicSizes: Story = {
82
- render: () => (
83
- <div className="space-y-8 p-8">
84
- <div className="space-y-4">
85
- <h3 className="text-lg font-medium text-white">Basic Skeleton Sizes</h3>
44
+ // ─── 1. Configurations ────────────────────────────────────────────────────────
86
45
 
87
- {/* Small elements */}
88
- <div className="space-y-3">
89
- <h4 className="text-sm font-medium text-white/70">Small Elements</h4>
90
- <div className="space-y-2">
91
- <div className="flex items-center gap-2">
92
- <span className="w-16 text-xs text-white/60">Badge:</span>
93
- <Skeleton className="h-5 w-16" />
94
- </div>
95
- <div className="flex items-center gap-2">
96
- <span className="w-16 text-xs text-white/60">Tag:</span>
97
- <Skeleton className="h-6 w-20" />
98
- </div>
99
- <div className="flex items-center gap-2">
100
- <span className="w-16 text-xs text-white/60">Icon:</span>
101
- <Skeleton className="h-4 w-4" />
102
- </div>
46
+ export const Configurations: Story = {
47
+ render: () => (
48
+ <div className="space-y-8">
49
+ {/* Single line */}
50
+ <div>
51
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
52
+ Single Line
53
+ </h4>
54
+ <div className="flex flex-wrap gap-4">
55
+ <div className="space-y-2 text-center">
56
+ <Skeleton className="bg-fm-surface-secondary h-4 w-48" />
57
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
58
+ Body text
59
+ </p>
103
60
  </div>
104
- </div>
105
-
106
- {/* Text elements */}
107
- <div className="space-y-3">
108
- <h4 className="text-sm font-medium text-white/70">Text Elements</h4>
109
- <div className="space-y-2">
110
- <div className="flex items-center gap-2">
111
- <span className="w-16 text-xs text-white/60">Line:</span>
112
- <Skeleton className="h-4 w-full" />
113
- </div>
114
- <div className="flex items-center gap-2">
115
- <span className="w-16 text-xs text-white/60">Short:</span>
116
- <Skeleton className="h-4 w-3/4" />
117
- </div>
118
- <div className="flex items-center gap-2">
119
- <span className="w-16 text-xs text-white/60">Word:</span>
120
- <Skeleton className="h-4 w-1/2" />
121
- </div>
122
- <div className="flex items-center gap-2">
123
- <span className="w-16 text-xs text-white/60">Title:</span>
124
- <Skeleton className="h-6 w-2/3" />
125
- </div>
126
- <div className="flex items-center gap-2">
127
- <span className="w-16 text-xs text-white/60">Heading:</span>
128
- <Skeleton className="h-8 w-1/2" />
129
- </div>
61
+ <div className="space-y-2 text-center">
62
+ <Skeleton className="bg-fm-surface-secondary h-5 w-32" />
63
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
64
+ Subtitle
65
+ </p>
130
66
  </div>
131
- </div>
132
-
133
- {/* Interactive elements */}
134
- <div className="space-y-3">
135
- <h4 className="text-sm font-medium text-white/70">
136
- Interactive Elements
137
- </h4>
138
- <div className="space-y-2">
139
- <div className="flex items-center gap-2">
140
- <span className="w-16 text-xs text-white/60">Button:</span>
141
- <Skeleton className="h-10 w-24" />
142
- </div>
143
- <div className="flex items-center gap-2">
144
- <span className="w-16 text-xs text-white/60">Input:</span>
145
- <Skeleton className="h-10 w-64" />
146
- </div>
147
- <div className="flex items-center gap-2">
148
- <span className="w-16 text-xs text-white/60">Select:</span>
149
- <Skeleton className="h-10 w-48" />
150
- </div>
67
+ <div className="space-y-2 text-center">
68
+ <Skeleton className="bg-fm-surface-secondary h-7 w-40" />
69
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
70
+ Heading
71
+ </p>
72
+ </div>
73
+ <div className="space-y-2 text-center">
74
+ <Skeleton className="bg-fm-surface-secondary h-4 w-16" />
75
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
76
+ Metadata
77
+ </p>
151
78
  </div>
152
79
  </div>
80
+ </div>
153
81
 
154
- {/* Shape variations */}
155
- <div className="space-y-3">
156
- <h4 className="text-sm font-medium text-white/70">
157
- Shape Variations
158
- </h4>
159
- <div className="flex items-center gap-4">
160
- <div className="text-center">
161
- <Skeleton className="h-12 w-12 rounded-full" />
162
- <p className="mt-1 text-xs text-white/60">Circle</p>
163
- </div>
164
- <div className="text-center">
165
- <Skeleton className="h-12 w-12 rounded-none" />
166
- <p className="mt-1 text-xs text-white/60">Square</p>
167
- </div>
168
- <div className="text-center">
169
- <Skeleton className="h-12 w-16 rounded-lg" />
170
- <p className="mt-1 text-xs text-white/60">Rounded</p>
171
- </div>
172
- <div className="text-center">
173
- <Skeleton className="h-6 w-32 rounded-full" />
174
- <p className="mt-1 text-xs text-white/60">Pill</p>
82
+ {/* Multi-line text block */}
83
+ <div>
84
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
85
+ Multi-line Text
86
+ </h4>
87
+ <div className="flex flex-wrap gap-8">
88
+ <div className="space-y-2 text-center">
89
+ <div className="w-64 space-y-2">
90
+ <Skeleton className="bg-fm-surface-secondary h-4 w-full" />
91
+ <Skeleton className="bg-fm-surface-secondary h-4 w-full" />
92
+ <Skeleton className="bg-fm-surface-secondary h-4 w-3/4" />
93
+ </div>
94
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
95
+ Paragraph (3 lines)
96
+ </p>
97
+ </div>
98
+ <div className="space-y-2 text-center">
99
+ <div className="w-64 space-y-2">
100
+ <Skeleton className="bg-fm-surface-secondary h-6 w-3/4" />
101
+ <Skeleton className="bg-fm-surface-secondary h-4 w-1/3" />
102
+ <div className="space-y-1.5 pt-1">
103
+ <Skeleton className="bg-fm-surface-secondary h-4 w-full" />
104
+ <Skeleton className="bg-fm-surface-secondary h-4 w-5/6" />
105
+ <Skeleton className="bg-fm-surface-secondary h-4 w-4/5" />
106
+ </div>
175
107
  </div>
108
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
109
+ Article (title + meta + body)
110
+ </p>
176
111
  </div>
177
112
  </div>
178
113
  </div>
179
- </div>
180
- ),
181
- parameters: {
182
- docs: {
183
- description: {
184
- story:
185
- "Various skeleton sizes and shapes for different UI elements including text, buttons, inputs, and icons with different border radius options.",
186
- },
187
- },
188
- },
189
- }
190
-
191
- // 2. Text Content Skeletons
192
- export const TextContentSkeletons: Story = {
193
- render: () => (
194
- <div className="space-y-8 p-8">
195
- <h3 className="text-lg font-medium text-white">Text Content Skeletons</h3>
196
114
 
197
- {/* Paragraph skeleton */}
198
- <div className="space-y-4">
199
- <h4 className="text-sm font-medium text-white/70">Paragraph</h4>
200
- <div className="space-y-2">
201
- <Skeleton className="h-4 w-full" />
202
- <Skeleton className="h-4 w-full" />
203
- <Skeleton className="h-4 w-3/4" />
115
+ {/* Avatar circle */}
116
+ <div>
117
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
118
+ Avatar Circle
119
+ </h4>
120
+ <div className="flex flex-wrap items-end gap-6">
121
+ <div className="space-y-2 text-center">
122
+ <Skeleton className="bg-fm-surface-secondary h-8 w-8 rounded-full" />
123
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
124
+ XS (32px)
125
+ </p>
126
+ </div>
127
+ <div className="space-y-2 text-center">
128
+ <Skeleton className="bg-fm-surface-secondary h-10 w-10 rounded-full" />
129
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
130
+ SM (40px)
131
+ </p>
132
+ </div>
133
+ <div className="space-y-2 text-center">
134
+ <Skeleton className="bg-fm-surface-secondary h-12 w-12 rounded-full" />
135
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
136
+ MD (48px)
137
+ </p>
138
+ </div>
139
+ <div className="space-y-2 text-center">
140
+ <Skeleton className="bg-fm-surface-secondary h-16 w-16 rounded-full" />
141
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
142
+ LG (64px)
143
+ </p>
144
+ </div>
204
145
  </div>
205
146
  </div>
206
147
 
207
- {/* Article skeleton */}
208
- <div className="space-y-4">
209
- <h4 className="text-sm font-medium text-white/70">Article</h4>
210
- <div className="space-y-3">
211
- <Skeleton className="h-8 w-2/3" /> {/* Title */}
212
- <Skeleton className="h-4 w-1/3" /> {/* Meta info */}
213
- <div className="space-y-2">
214
- <Skeleton className="h-4 w-full" />
215
- <Skeleton className="h-4 w-full" />
216
- <Skeleton className="h-4 w-5/6" />
148
+ {/* Card layout */}
149
+ <div>
150
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
151
+ Card Layout
152
+ </h4>
153
+ <div className="flex flex-wrap gap-6">
154
+ <div className="space-y-2 text-center">
155
+ <div className="w-48 space-y-3">
156
+ <Skeleton className="bg-fm-surface-secondary h-28 w-full rounded-lg" />
157
+ <Skeleton className="bg-fm-surface-secondary h-4 w-3/4" />
158
+ <Skeleton className="bg-fm-surface-secondary h-3 w-1/2" />
159
+ </div>
160
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
161
+ Media card
162
+ </p>
217
163
  </div>
218
- <div className="space-y-2">
219
- <Skeleton className="h-4 w-full" />
220
- <Skeleton className="h-4 w-4/5" />
164
+ <div className="space-y-2 text-center">
165
+ <div className="w-48 space-y-3">
166
+ <div className="flex items-center gap-2">
167
+ <Skeleton className="bg-fm-surface-secondary h-10 w-10 rounded-full" />
168
+ <div className="flex-1 space-y-1.5">
169
+ <Skeleton className="bg-fm-surface-secondary h-3.5 w-full" />
170
+ <Skeleton className="bg-fm-surface-secondary h-3 w-3/4" />
171
+ </div>
172
+ </div>
173
+ <Skeleton className="bg-fm-surface-secondary h-4 w-full" />
174
+ <Skeleton className="bg-fm-surface-secondary h-4 w-4/5" />
175
+ <Skeleton className="bg-fm-surface-secondary h-8 w-24 rounded-md" />
176
+ </div>
177
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
178
+ Profile card
179
+ </p>
221
180
  </div>
222
181
  </div>
223
182
  </div>
224
183
 
225
- {/* List skeleton */}
226
- <div className="space-y-4">
227
- <h4 className="text-sm font-medium text-white/70">List Items</h4>
228
- <div className="space-y-3">
184
+ {/* List item */}
185
+ <div>
186
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
187
+ List Item
188
+ </h4>
189
+ <div className="w-72 space-y-2">
229
190
  {Array.from({ length: 4 }, (_, i) => (
230
191
  <div key={i} className="flex items-center gap-3">
231
- <Skeleton className="h-2 w-2 rounded-full" />
232
- <Skeleton className="h-4 flex-1" />
233
- </div>
234
- ))}
235
- </div>
236
- </div>
237
-
238
- {/* Comments skeleton */}
239
- <div className="space-y-4">
240
- <h4 className="text-sm font-medium text-white/70">Comments</h4>
241
- <div className="space-y-4">
242
- {Array.from({ length: 3 }, (_, i) => (
243
- <div key={i} className="flex gap-3">
244
- <Skeleton className="h-8 w-8 rounded-full" />
245
- <div className="flex-1 space-y-2">
246
- <Skeleton className="h-3 w-24" />
247
- <Skeleton className="h-4 w-full" />
248
- <Skeleton className="h-4 w-3/4" />
192
+ <Skeleton className="bg-fm-surface-secondary h-10 w-10 rounded-md" />
193
+ <div className="flex-1 space-y-1.5">
194
+ <Skeleton className="bg-fm-surface-secondary h-3.5 w-3/4" />
195
+ <Skeleton className="bg-fm-surface-secondary h-3 w-1/2" />
249
196
  </div>
197
+ <Skeleton className="bg-fm-surface-secondary h-3 w-8" />
250
198
  </div>
251
199
  ))}
252
200
  </div>
@@ -257,592 +205,110 @@ export const TextContentSkeletons: Story = {
257
205
  docs: {
258
206
  description: {
259
207
  story:
260
- "Skeleton layouts for various text content including paragraphs, articles, lists, and comment sections.",
208
+ "All foundational skeleton shapes used across the audio app: single lines at various text sizes, multi-line text blocks, avatar circles in four sizes, media and profile card layouts, and a repeating list item row.",
261
209
  },
262
210
  },
263
211
  },
264
212
  }
265
213
 
266
- // 3. Card Layout Skeletons
267
- export const CardLayoutSkeletons: Story = {
268
- render: () => (
269
- <div className="space-y-8 p-8">
270
- <h3 className="text-lg font-medium text-white">Card Layout Skeletons</h3>
214
+ // ─── 2. UseCases ──────────────────────────────────────────────────────────────
271
215
 
272
- <div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
273
- {/* Basic card */}
274
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
275
- <div className="space-y-3">
276
- <Skeleton className="h-32 w-full rounded-md" />
277
- <Skeleton className="h-5 w-3/4" />
216
+ export const UseCases: Story = {
217
+ render: () => (
218
+ <div className="mx-auto max-w-3xl space-y-8 p-8">
219
+ {/* Track card skeleton */}
220
+ <div>
221
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
222
+ Track Card Skeleton
223
+ </h4>
224
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary flex gap-4 rounded-xl border p-4">
225
+ <Skeleton className="bg-fm-surface-primary h-24 w-24 flex-none rounded-lg" />
226
+ <div className="flex flex-1 flex-col justify-between py-0.5">
278
227
  <div className="space-y-2">
279
- <Skeleton className="h-4 w-full" />
280
- <Skeleton className="h-4 w-2/3" />
228
+ <Skeleton className="bg-fm-surface-primary h-5 w-3/4" />
229
+ <Skeleton className="bg-fm-surface-primary h-4 w-1/2" />
230
+ <Skeleton className="bg-fm-surface-primary h-3.5 w-1/3" />
281
231
  </div>
282
- <Skeleton className="h-9 w-20" />
283
- </div>
284
- </div>
285
-
286
- {/* Profile card */}
287
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
288
- <div className="space-y-4">
289
232
  <div className="flex items-center gap-3">
290
- <Skeleton className="h-12 w-12 rounded-full" />
291
- <div className="space-y-2">
292
- <Skeleton className="h-4 w-24" />
293
- <Skeleton className="h-3 w-16" />
294
- </div>
295
- </div>
296
- <div className="space-y-2">
297
- <Skeleton className="h-4 w-full" />
298
- <Skeleton className="h-4 w-3/4" />
299
- </div>
300
- <div className="flex gap-2">
301
- <Skeleton className="h-8 w-16" />
302
- <Skeleton className="h-8 w-20" />
303
- </div>
304
- </div>
305
- </div>
306
-
307
- {/* Product card */}
308
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
309
- <div className="space-y-3">
310
- <Skeleton className="h-40 w-full rounded-md" />
311
- <div className="space-y-2">
312
- <Skeleton className="h-5 w-full" />
313
- <div className="flex items-center justify-between">
314
- <Skeleton className="h-6 w-16" />
315
- <Skeleton className="h-4 w-12" />
316
- </div>
317
- </div>
318
- <div className="flex gap-2">
319
- <Skeleton className="h-9 flex-1" />
320
- <Skeleton className="h-9 w-9" />
233
+ <Skeleton className="bg-fm-surface-primary h-8 w-8 rounded-full" />
234
+ <Skeleton className="bg-fm-surface-primary h-1.5 flex-1 rounded-full" />
235
+ <Skeleton className="bg-fm-surface-primary h-3.5 w-10" />
321
236
  </div>
322
237
  </div>
323
238
  </div>
239
+ </div>
324
240
 
325
- {/* Stats card */}
326
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
327
- <div className="space-y-4">
328
- <div className="flex items-center justify-between">
329
- <Skeleton className="h-5 w-24" />
330
- <Skeleton className="h-6 w-6 rounded-md" />
331
- </div>
332
- <Skeleton className="h-8 w-16" />
333
- <div className="space-y-2">
334
- <div className="flex justify-between">
335
- <Skeleton className="h-3 w-12" />
336
- <Skeleton className="h-3 w-8" />
241
+ {/* Profile skeleton */}
242
+ <div>
243
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
244
+ Artist Profile Skeleton
245
+ </h4>
246
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-xl border">
247
+ {/* Hero banner */}
248
+ <Skeleton className="bg-fm-surface-primary h-32 w-full rounded-t-xl" />
249
+ {/* Profile info */}
250
+ <div className="space-y-4 p-5">
251
+ <div className="flex items-end gap-4">
252
+ <Skeleton className="bg-fm-surface-primary -mt-10 h-20 w-20 flex-none rounded-full" />
253
+ <div className="flex-1 space-y-2 pb-1">
254
+ <Skeleton className="bg-fm-surface-primary h-5 w-40" />
255
+ <Skeleton className="bg-fm-surface-primary h-3.5 w-24" />
337
256
  </div>
338
- <Skeleton className="h-2 w-full rounded-full" />
257
+ <Skeleton className="bg-fm-surface-primary h-9 w-24 rounded-full" />
339
258
  </div>
340
- </div>
341
- </div>
342
-
343
- {/* Media card */}
344
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
345
- <div className="space-y-3">
346
- <div className="flex items-center gap-3">
347
- <Skeleton className="h-10 w-10 rounded-full" />
259
+ <Skeleton className="bg-fm-surface-primary h-4 w-full" />
260
+ <Skeleton className="bg-fm-surface-primary h-4 w-5/6" />
261
+ <div className="flex gap-6 pt-1">
348
262
  <div className="space-y-1">
349
- <Skeleton className="h-4 w-20" />
350
- <Skeleton className="h-3 w-16" />
263
+ <Skeleton className="bg-fm-surface-primary h-5 w-12" />
264
+ <Skeleton className="bg-fm-surface-primary h-3 w-16" />
351
265
  </div>
352
- </div>
353
- <Skeleton className="h-48 w-full rounded-md" />
354
- <div className="space-y-2">
355
- <Skeleton className="h-4 w-full" />
356
- <Skeleton className="h-4 w-1/2" />
357
- </div>
358
- <div className="flex justify-between">
359
- <div className="flex gap-2">
360
- <Skeleton className="h-8 w-12" />
361
- <Skeleton className="h-8 w-12" />
362
- </div>
363
- <Skeleton className="h-8 w-8" />
364
- </div>
365
- </div>
366
- </div>
367
-
368
- {/* Dashboard widget */}
369
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
370
- <div className="space-y-4">
371
- <div className="flex items-center justify-between">
372
- <Skeleton className="h-5 w-32" />
373
- <Skeleton className="h-6 w-16 rounded-full" />
374
- </div>
375
- <div className="grid grid-cols-2 gap-4">
376
266
  <div className="space-y-1">
377
- <Skeleton className="h-6 w-12" />
378
- <Skeleton className="h-3 w-16" />
267
+ <Skeleton className="bg-fm-surface-primary h-5 w-10" />
268
+ <Skeleton className="bg-fm-surface-primary h-3 w-14" />
379
269
  </div>
380
270
  <div className="space-y-1">
381
- <Skeleton className="h-6 w-16" />
382
- <Skeleton className="h-3 w-12" />
271
+ <Skeleton className="bg-fm-surface-primary h-5 w-14" />
272
+ <Skeleton className="bg-fm-surface-primary h-3 w-16" />
383
273
  </div>
384
274
  </div>
385
- <Skeleton className="h-24 w-full rounded-md" />
386
275
  </div>
387
276
  </div>
388
277
  </div>
389
- </div>
390
- ),
391
- parameters: {
392
- docs: {
393
- description: {
394
- story:
395
- "Comprehensive card layout skeletons for different content types including basic cards, profiles, products, stats, media, and dashboard widgets.",
396
- },
397
- },
398
- },
399
- }
400
-
401
- // 4. Table Skeleton
402
- export const TableSkeleton: Story = {
403
- render: () => (
404
- <div className="space-y-8 p-8">
405
- <h3 className="text-lg font-medium text-white">Table Skeleton</h3>
406
-
407
- <div className="space-y-4">
408
- {/* Table header */}
409
- <div className="grid grid-cols-4 gap-4 border-b border-white/10 pb-3">
410
- <Skeleton className="h-4 w-16" />
411
- <Skeleton className="h-4 w-20" />
412
- <Skeleton className="h-4 w-12" />
413
- <Skeleton className="h-4 w-14" />
414
- </div>
415
278
 
416
- {/* Table rows */}
417
- {Array.from({ length: 6 }, (_, i) => (
418
- <div key={i} className="grid grid-cols-4 gap-4 py-3">
419
- <div className="flex items-center gap-2">
420
- <Skeleton className="h-8 w-8 rounded-full" />
421
- <Skeleton className="h-4 w-24" />
422
- </div>
423
- <Skeleton className="h-4 w-32" />
424
- <Skeleton className="h-6 w-16 rounded-full" />
425
- <div className="flex gap-1">
426
- <Skeleton className="h-8 w-8" />
427
- <Skeleton className="h-8 w-8" />
428
- </div>
429
- </div>
430
- ))}
431
- </div>
432
-
433
- {/* Pagination skeleton */}
434
- <div className="flex items-center justify-between border-t border-white/10 pt-4">
435
- <Skeleton className="h-4 w-32" />
436
- <div className="flex gap-1">
437
- <Skeleton className="h-8 w-8" />
438
- <Skeleton className="h-8 w-8" />
439
- <Skeleton className="h-8 w-8" />
440
- <Skeleton className="h-8 w-12" />
441
- </div>
442
- </div>
443
- </div>
444
- ),
445
- parameters: {
446
- docs: {
447
- description: {
448
- story:
449
- "Table skeleton with headers, rows containing avatars, text, badges, and action buttons, plus pagination controls.",
450
- },
451
- },
452
- },
453
- }
454
-
455
- // 5. Form Skeleton
456
- export const FormSkeleton: Story = {
457
- render: () => (
458
- <div className="space-y-8 p-8">
459
- <h3 className="text-lg font-medium text-white">Form Skeleton</h3>
460
-
461
- <div className="mx-auto max-w-md space-y-6">
462
- {/* Form header */}
463
- <div className="space-y-2">
464
- <Skeleton className="h-8 w-48" />
465
- <Skeleton className="h-4 w-full" />
466
- </div>
467
-
468
- {/* Form fields */}
469
- <div className="space-y-4">
470
- {/* Text input */}
471
- <div className="space-y-2">
472
- <Skeleton className="h-4 w-16" />
473
- <Skeleton className="h-10 w-full" />
474
- </div>
475
-
476
- {/* Email input */}
477
- <div className="space-y-2">
478
- <Skeleton className="h-4 w-12" />
479
- <Skeleton className="h-10 w-full" />
279
+ {/* Feed skeleton */}
280
+ <div>
281
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md mb-4 font-medium">
282
+ Discover Feed Skeleton
283
+ </h4>
284
+ <div className="space-y-3">
285
+ {/* Featured row — large cards */}
286
+ <div className="grid grid-cols-2 gap-3 sm:grid-cols-3">
287
+ {Array.from({ length: 3 }, (_, i) => (
288
+ <div key={i} className="space-y-2">
289
+ <Skeleton className="bg-fm-surface-secondary aspect-square w-full rounded-xl" />
290
+ <Skeleton className="bg-fm-surface-secondary h-4 w-3/4" />
291
+ <Skeleton className="bg-fm-surface-secondary h-3.5 w-1/2" />
292
+ </div>
293
+ ))}
480
294
  </div>
481
-
482
- {/* Select */}
483
- <div className="space-y-2">
484
- <Skeleton className="h-4 w-20" />
485
- <Skeleton className="h-10 w-full" />
295
+ {/* Section header */}
296
+ <div className="flex items-center justify-between pt-2">
297
+ <Skeleton className="bg-fm-surface-secondary h-5 w-32" />
298
+ <Skeleton className="bg-fm-surface-secondary h-4 w-16" />
486
299
  </div>
487
-
488
- {/* Textarea */}
300
+ {/* List rows */}
489
301
  <div className="space-y-2">
490
- <Skeleton className="h-4 w-18" />
491
- <Skeleton className="h-24 w-full" />
492
- </div>
493
-
494
- {/* Checkbox group */}
495
- <div className="space-y-3">
496
- <Skeleton className="h-4 w-24" />
497
- <div className="space-y-2">
498
- {Array.from({ length: 3 }, (_, i) => (
499
- <div key={i} className="flex items-center gap-2">
500
- <Skeleton className="h-4 w-4" />
501
- <Skeleton className="h-4 w-32" />
302
+ {Array.from({ length: 4 }, (_, i) => (
303
+ <div key={i} className="flex items-center gap-3">
304
+ <Skeleton className="bg-fm-surface-secondary h-12 w-12 flex-none rounded-lg" />
305
+ <div className="flex-1 space-y-1.5">
306
+ <Skeleton className="bg-fm-surface-secondary h-4 w-2/3" />
307
+ <Skeleton className="bg-fm-surface-secondary h-3 w-2/5" />
502
308
  </div>
503
- ))}
504
- </div>
505
- </div>
506
-
507
- {/* Radio group */}
508
- <div className="space-y-3">
509
- <Skeleton className="h-4 w-20" />
510
- <div className="space-y-2">
511
- {Array.from({ length: 2 }, (_, i) => (
512
- <div key={i} className="flex items-center gap-2">
513
- <Skeleton className="h-4 w-4 rounded-full" />
514
- <Skeleton className="h-4 w-28" />
515
- </div>
516
- ))}
517
- </div>
518
- </div>
519
- </div>
520
-
521
- {/* Form actions */}
522
- <div className="flex gap-3 pt-4">
523
- <Skeleton className="h-10 flex-1" />
524
- <Skeleton className="h-10 w-20" />
525
- </div>
526
- </div>
527
- </div>
528
- ),
529
- parameters: {
530
- docs: {
531
- description: {
532
- story:
533
- "Complete form skeleton with various input types including text fields, selects, textareas, checkboxes, radio buttons, and action buttons.",
534
- },
535
- },
536
- },
537
- }
538
-
539
- // 6. Loading States Simulation
540
- export const LoadingStatesSimulation: Story = {
541
- render: () => {
542
- const [loadingStates, setLoadingStates] = React.useState({
543
- profile: true,
544
- content: true,
545
- cards: true,
546
- table: true,
547
- })
548
-
549
- React.useEffect(() => {
550
- // Simulate different loading times
551
- const timers = [
552
- setTimeout(
553
- () => setLoadingStates((prev) => ({ ...prev, profile: false })),
554
- 1000
555
- ),
556
- setTimeout(
557
- () => setLoadingStates((prev) => ({ ...prev, content: false })),
558
- 2000
559
- ),
560
- setTimeout(
561
- () => setLoadingStates((prev) => ({ ...prev, cards: false })),
562
- 3000
563
- ),
564
- setTimeout(
565
- () => setLoadingStates((prev) => ({ ...prev, table: false })),
566
- 4000
567
- ),
568
- ]
569
-
570
- return () => timers.forEach(clearTimeout)
571
- }, [])
572
-
573
- const resetLoadingStates = () => {
574
- setLoadingStates({
575
- profile: true,
576
- content: true,
577
- cards: true,
578
- table: true,
579
- })
580
- }
581
-
582
- return (
583
- <div className="space-y-8 p-8">
584
- <div className="flex items-center justify-between">
585
- <h3 className="text-lg font-medium text-white">
586
- Loading States Simulation
587
- </h3>
588
- <Button onClick={resetLoadingStates} size="sm">
589
- Reset Loading
590
- </Button>
591
- </div>
592
-
593
- <div className="grid grid-cols-1 gap-6 lg:grid-cols-2">
594
- {/* Profile section */}
595
- <div className="space-y-4">
596
- <h4 className="text-sm font-medium text-white/70">
597
- Profile Section
598
- </h4>
599
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
600
- {loadingStates.profile ? (
601
- <div className="flex items-center gap-4">
602
- <Skeleton className="h-16 w-16 rounded-full" />
603
- <div className="space-y-2">
604
- <Skeleton className="h-6 w-32" />
605
- <Skeleton className="h-4 w-24" />
606
- <Skeleton className="h-4 w-40" />
607
- </div>
608
- </div>
609
- ) : (
610
- <div className="flex items-center gap-4">
611
- <div className="h-16 w-16 rounded-full bg-gradient-to-r from-blue-500 to-purple-500" />
612
- <div>
613
- <h3 className="text-lg font-medium text-white">John Doe</h3>
614
- <p className="text-sm text-white/60">Software Engineer</p>
615
- <p className="text-sm text-white/80">
616
- Building amazing user experiences
617
- </p>
618
- </div>
619
- </div>
620
- )}
621
- </div>
622
- </div>
623
-
624
- {/* Content section */}
625
- <div className="space-y-4">
626
- <h4 className="text-sm font-medium text-white/70">
627
- Content Section
628
- </h4>
629
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
630
- {loadingStates.content ? (
631
- <div className="space-y-3">
632
- <Skeleton className="h-6 w-3/4" />
633
- <div className="space-y-2">
634
- <Skeleton className="h-4 w-full" />
635
- <Skeleton className="h-4 w-full" />
636
- <Skeleton className="h-4 w-2/3" />
637
- </div>
638
- </div>
639
- ) : (
640
- <div className="space-y-3">
641
- <h3 className="text-lg font-medium text-white">
642
- Article Title
643
- </h3>
644
- <p className="text-sm text-white/80">
645
- This is the actual content that was loading. It demonstrates
646
- how the skeleton transforms into real content seamlessly.
647
- </p>
648
- </div>
649
- )}
650
- </div>
651
- </div>
652
-
653
- {/* Cards section */}
654
- <div className="space-y-4 lg:col-span-2">
655
- <h4 className="text-sm font-medium text-white/70">Cards Grid</h4>
656
- <div className="grid grid-cols-1 gap-4 md:grid-cols-3">
657
- {Array.from({ length: 3 }, (_, i) => (
658
- <div
659
- key={i}
660
- className="rounded-lg border border-white/10 bg-white/5 p-4"
661
- >
662
- {loadingStates.cards ? (
663
- <div className="space-y-3">
664
- <Skeleton className="h-24 w-full rounded-md" />
665
- <Skeleton className="h-5 w-3/4" />
666
- <Skeleton className="h-4 w-1/2" />
667
- <Skeleton className="h-9 w-20" />
668
- </div>
669
- ) : (
670
- <div className="space-y-3">
671
- <div className="h-24 w-full rounded-md bg-gradient-to-r from-green-400 to-blue-500" />
672
- <h3 className="font-medium text-white">Card {i + 1}</h3>
673
- <p className="text-sm text-white/60">Description text</p>
674
- <Badge color="neutral">Active</Badge>
675
- </div>
676
- )}
677
- </div>
678
- ))}
679
- </div>
680
- </div>
681
-
682
- {/* Table section */}
683
- <div className="space-y-4 lg:col-span-2">
684
- <h4 className="text-sm font-medium text-white/70">Data Table</h4>
685
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
686
- {loadingStates.table ? (
687
- <div className="space-y-3">
688
- <div className="grid grid-cols-3 gap-4">
689
- <Skeleton className="h-4 w-16" />
690
- <Skeleton className="h-4 w-20" />
691
- <Skeleton className="h-4 w-12" />
692
- </div>
693
- {Array.from({ length: 3 }, (_, i) => (
694
- <div key={i} className="grid grid-cols-3 gap-4">
695
- <Skeleton className="h-4 w-24" />
696
- <Skeleton className="h-4 w-32" />
697
- <Skeleton className="h-4 w-16" />
698
- </div>
699
- ))}
700
- </div>
701
- ) : (
702
- <div className="space-y-3">
703
- <div className="grid grid-cols-3 gap-4 font-medium text-white">
704
- <div>Name</div>
705
- <div>Email</div>
706
- <div>Status</div>
707
- </div>
708
- {[
709
- {
710
- name: "Alice Johnson",
711
- email: "alice@example.com",
712
- status: "Active",
713
- },
714
- {
715
- name: "Bob Smith",
716
- email: "bob@example.com",
717
- status: "Inactive",
718
- },
719
- {
720
- name: "Carol Williams",
721
- email: "carol@example.com",
722
- status: "Active",
723
- },
724
- ].map((row, i) => (
725
- <div
726
- key={i}
727
- className="grid grid-cols-3 gap-4 text-white/80"
728
- >
729
- <div>{row.name}</div>
730
- <div>{row.email}</div>
731
- <div>
732
- <Badge
733
- color={
734
- row.status === "Active" ? "positive" : "neutral"
735
- }
736
- >
737
- {row.status}
738
- </Badge>
739
- </div>
740
- </div>
741
- ))}
742
- </div>
743
- )}
744
- </div>
745
- </div>
746
- </div>
747
- </div>
748
- )
749
- },
750
- parameters: {
751
- docs: {
752
- description: {
753
- story:
754
- "Interactive demonstration of loading states with timed transitions from skeleton to real content, showing how skeletons improve perceived performance.",
755
- },
756
- },
757
- },
758
- }
759
-
760
- // 7. Custom Styling
761
- export const CustomStyling: Story = {
762
- render: () => (
763
- <div className="space-y-8 p-8">
764
- <h3 className="text-lg font-medium text-white">
765
- Custom Styling Examples
766
- </h3>
767
-
768
- <div className="grid grid-cols-1 gap-6 md:grid-cols-2">
769
- {/* Different colors */}
770
- <div className="space-y-4">
771
- <h4 className="text-sm font-medium text-white/70">
772
- Color Variations
773
- </h4>
774
- <div className="space-y-3">
775
- <div className="flex items-center gap-2">
776
- <span className="w-16 text-xs text-white/60">Default:</span>
777
- <Skeleton className="h-4 flex-1" />
778
- </div>
779
- <div className="flex items-center gap-2">
780
- <span className="w-16 text-xs text-white/60">Blue:</span>
781
- <Skeleton className="h-4 flex-1 bg-blue-500/20" />
782
- </div>
783
- <div className="flex items-center gap-2">
784
- <span className="w-16 text-xs text-white/60">Green:</span>
785
- <Skeleton className="h-4 flex-1 bg-green-500/20" />
786
- </div>
787
- <div className="flex items-center gap-2">
788
- <span className="w-16 text-xs text-white/60">Purple:</span>
789
- <Skeleton className="h-4 flex-1 bg-purple-500/20" />
790
- </div>
791
- </div>
792
- </div>
793
-
794
- {/* Different animations */}
795
- <div className="space-y-4">
796
- <h4 className="text-sm font-medium text-white/70">
797
- Animation Variations
798
- </h4>
799
- <div className="space-y-3">
800
- <div className="flex items-center gap-2">
801
- <span className="w-16 text-xs text-white/60">Pulse:</span>
802
- <Skeleton className="h-4 flex-1" />
803
- </div>
804
- <div className="flex items-center gap-2">
805
- <span className="w-16 text-xs text-white/60">Bounce:</span>
806
- <Skeleton className="h-4 flex-1 animate-bounce" />
807
- </div>
808
- <div className="flex items-center gap-2">
809
- <span className="w-16 text-xs text-white/60">Ping:</span>
810
- <Skeleton className="h-4 flex-1 animate-ping" />
811
- </div>
812
- <div className="flex items-center gap-2">
813
- <span className="w-16 text-xs text-white/60">None:</span>
814
- <Skeleton className="h-4 flex-1 animate-none" />
815
- </div>
816
- </div>
817
- </div>
818
-
819
- {/* Complex layouts */}
820
- <div className="space-y-4 md:col-span-2">
821
- <h4 className="text-sm font-medium text-white/70">Complex Layout</h4>
822
- <div className="grid grid-cols-12 gap-4">
823
- <div className="col-span-2">
824
- <Skeleton className="h-12 w-full rounded-full" />
825
- </div>
826
- <div className="col-span-8 space-y-2">
827
- <Skeleton className="h-3 w-full" />
828
- <Skeleton className="h-3 w-3/4" />
829
- <Skeleton className="h-3 w-1/2" />
830
- </div>
831
- <div className="col-span-2">
832
- <Skeleton className="h-12 w-full" />
833
- </div>
834
- </div>
835
- </div>
836
-
837
- {/* Gradient skeletons */}
838
- <div className="space-y-4 md:col-span-2">
839
- <h4 className="text-sm font-medium text-white/70">
840
- Gradient Backgrounds
841
- </h4>
842
- <div className="space-y-3">
843
- <Skeleton className="h-4 w-full bg-gradient-to-r from-blue-500/20 to-purple-500/20" />
844
- <Skeleton className="h-4 w-3/4 bg-gradient-to-r from-green-500/20 to-blue-500/20" />
845
- <Skeleton className="h-4 w-1/2 bg-gradient-to-r from-pink-500/20 to-yellow-500/20" />
309
+ <Skeleton className="bg-fm-surface-secondary h-7 w-7 rounded-full" />
310
+ </div>
311
+ ))}
846
312
  </div>
847
313
  </div>
848
314
  </div>
@@ -852,7 +318,7 @@ export const CustomStyling: Story = {
852
318
  docs: {
853
319
  description: {
854
320
  story:
855
- "Custom styling options for skeleton components including different colors, animations, gradient backgrounds, and complex layouts.",
321
+ "Full skeleton screens for three core audio app surfaces: a now-playing track card with progress bar, an artist profile page with hero banner and stats, and a discover feed combining an album grid with a list section.",
856
322
  },
857
323
  },
858
324
  },