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,10 +1,22 @@
1
1
  import React from "react"
2
- import { CrossIcon } from "@icons/cross-icon"
3
- import { FeatureShineIcon } from "@icons/feature-shine-icon"
4
- import { SearchIcon } from "@icons/search-icon"
5
- import { type Meta, type StoryObj } from "@storybook/react-vite"
2
+ import {
3
+ CircularPlayIcon,
4
+ CrossIcon,
5
+ HeartIcon,
6
+ MusicalNoteIcon,
7
+ PauseIcon,
8
+ SearchIcon,
9
+ SettingIcon,
10
+ ShareIcon,
11
+ SkipBackwardIcon,
12
+ SkipForwardIcon,
13
+ TrashIcon,
14
+ VerticalMenuIcon,
15
+ VolumeFullIcon,
16
+ } from "@icons/index"
17
+ import type { Meta, StoryObj } from "@storybook/react-vite"
6
18
 
7
- import { NotepadIcon } from "src/ui/icons"
19
+ import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
8
20
 
9
21
  import { IconButton } from "."
10
22
 
@@ -13,12 +25,29 @@ const meta: Meta<typeof IconButton> = {
13
25
  component: IconButton,
14
26
  parameters: {
15
27
  layout: "centered",
16
- backgrounds: {
17
- default: "dark",
18
- values: [
19
- { name: "dark", value: "#0a0a0a" },
20
- { name: "light", value: "#ffffff" },
21
- ],
28
+ docs: {
29
+ description: {
30
+ component:
31
+ "A compact button that renders a single icon. Supports three variants (background, ghost, outlined), three sizes (small, medium, large), and two shapes (circle, square). Accessible via a required label prop that populates aria-label, with optional tooltip support.",
32
+ },
33
+ page: () => (
34
+ <AuralComponentDocsPage
35
+ features={[
36
+ {
37
+ title: "3 Variants",
38
+ description: "Background, ghost, outlined",
39
+ },
40
+ {
41
+ title: "Circle & Square",
42
+ description: "Two shape options",
43
+ },
44
+ {
45
+ title: "Accessible",
46
+ description: "Required label for ARIA",
47
+ },
48
+ ]}
49
+ />
50
+ ),
22
51
  },
23
52
  },
24
53
  tags: ["autodocs"],
@@ -48,257 +77,871 @@ const meta: Meta<typeof IconButton> = {
48
77
  export default meta
49
78
  type Story = StoryObj<typeof IconButton>
50
79
 
51
- export const Default: Story = {
52
- args: {
53
- label: "Search",
54
- icon: <SearchIcon />,
55
- },
56
- }
80
+ // ─── 1. Playground ────────────────────────────────────────────────────────────
57
81
 
58
- export const WithBackground: Story = {
82
+ export const Playground: Story = {
59
83
  args: {
60
- label: "Search",
61
- icon: <SearchIcon />,
62
84
  variant: "background",
85
+ size: "medium",
86
+ shape: "circle",
87
+ disabled: false,
88
+ icon: <SearchIcon />,
89
+ label: "Search",
63
90
  },
64
91
  render: (args) => (
65
- <div className="bg-fm-neutral-0 flex flex-col space-y-6 rounded p-8">
66
- <h2 className="text-fm-yellow-500 text-sm font-bold">WITH BACKGROUND</h2>
92
+ <div className="flex w-full max-w-sm flex-col items-center space-y-4">
93
+ <IconButton {...args} />
94
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary w-full rounded-lg border px-4 py-3">
95
+ <code className="text-fm-secondary text-fm-md leading-fm-md font-(--font-fm-mono)">{`<IconButton variant="${args.variant}" size="${args.size}" shape="${args.shape}"${args.disabled ? " disabled" : ""} label="${args.label}" />`}</code>
96
+ </div>
97
+ </div>
98
+ ),
99
+ parameters: {
100
+ docs: {
101
+ description: {
102
+ story:
103
+ "Use the controls panel in the sidebar to explore all IconButton props. The code snippet below updates live to reflect the current configuration.",
104
+ },
105
+ },
106
+ },
107
+ }
67
108
 
68
- <div className="flex flex-col space-y-4">
69
- <div>
70
- <h3 className="text-fm-primary mb-2">SMALL</h3>
71
- <div className="flex space-x-4">
72
- <IconButton {...args} size="small" label="Default" />
73
- <IconButton {...args} size="small" disabled label="Disabled" />
74
- </div>
75
- </div>
109
+ // ─── 2. All Variants ──────────────────────────────────────────────────────────
76
110
 
77
- <div>
78
- <h3 className="text-fm-primary mb-2">MEDIUM</h3>
79
- <div className="flex space-x-4">
80
- <IconButton {...args} size="medium" label="Default" />
81
- <IconButton {...args} size="medium" disabled label="Disabled" />
111
+ export const AllVariants: Story = {
112
+ render: () => (
113
+ <div className="space-y-8">
114
+ <div className="space-y-4">
115
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
116
+ Variant × Shape Matrix
117
+ </h4>
118
+ <div className="grid grid-cols-3 gap-8">
119
+ {/* Column headers */}
120
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm text-center">
121
+ Background
122
+ </p>
123
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm text-center">
124
+ Ghost
125
+ </p>
126
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm text-center">
127
+ Outlined
128
+ </p>
129
+
130
+ {/* Circle row */}
131
+ <div className="space-y-2 text-center">
132
+ <IconButton
133
+ variant="background"
134
+ shape="circle"
135
+ icon={<SearchIcon />}
136
+ label="Search"
137
+ />
138
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
139
+ Circle
140
+ </p>
141
+ </div>
142
+ <div className="space-y-2 text-center">
143
+ <IconButton
144
+ variant="ghost"
145
+ shape="circle"
146
+ icon={<SearchIcon />}
147
+ label="Search"
148
+ />
149
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
150
+ Circle
151
+ </p>
152
+ </div>
153
+ <div className="space-y-2 text-center">
154
+ <IconButton
155
+ variant="outlined"
156
+ shape="circle"
157
+ icon={<SearchIcon />}
158
+ label="Search"
159
+ />
160
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
161
+ Circle
162
+ </p>
82
163
  </div>
83
- </div>
84
164
 
85
- <div>
86
- <h3 className="text-fm-primary mb-2">LARGE</h3>
87
- <div className="flex space-x-4">
88
- <IconButton {...args} size="large" label="Default" />
89
- <IconButton {...args} size="large" disabled label="Disabled" />
165
+ {/* Square row */}
166
+ <div className="space-y-2 text-center">
167
+ <IconButton
168
+ variant="background"
169
+ shape="square"
170
+ icon={<SearchIcon />}
171
+ label="Search"
172
+ />
173
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
174
+ Square
175
+ </p>
176
+ </div>
177
+ <div className="space-y-2 text-center">
178
+ <IconButton
179
+ variant="ghost"
180
+ shape="square"
181
+ icon={<SearchIcon />}
182
+ label="Search"
183
+ />
184
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
185
+ Square
186
+ </p>
187
+ </div>
188
+ <div className="space-y-2 text-center">
189
+ <IconButton
190
+ variant="outlined"
191
+ shape="square"
192
+ icon={<SearchIcon />}
193
+ label="Search"
194
+ />
195
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
196
+ Square
197
+ </p>
90
198
  </div>
91
199
  </div>
92
200
  </div>
93
201
  </div>
94
202
  ),
203
+ parameters: {
204
+ docs: {
205
+ description: {
206
+ story:
207
+ "Full variant × shape matrix: all three variants (background, ghost, outlined) crossed with both shapes (circle, square).",
208
+ },
209
+ },
210
+ },
95
211
  }
96
212
 
97
- export const WithoutBackground: Story = {
98
- args: {
99
- label: "Search",
100
- icon: <SearchIcon />,
101
- variant: "ghost",
102
- },
103
- render: (args) => (
104
- <div className="bg-fm-neutral-0 flex flex-col space-y-6 rounded p-8">
105
- <h2 className="text-fm-yellow-500 text-sm font-bold">
106
- WITHOUT BACKGROUND
107
- </h2>
213
+ // ─── 3. Sizes ─────────────────────────────────────────────────────────────────
108
214
 
109
- <div className="flex flex-col space-y-4">
110
- <div>
111
- <h3 className="text-fm-primary mb-2">SMALL</h3>
112
- <div className="flex space-x-4">
113
- <IconButton {...args} size="small" label="Default" />
114
- <IconButton {...args} size="small" disabled label="Disabled" />
215
+ export const Sizes: Story = {
216
+ render: () => (
217
+ <div className="space-y-8">
218
+ <div className="space-y-4">
219
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
220
+ Background Variant
221
+ </h4>
222
+ <div className="flex flex-wrap items-end gap-6">
223
+ <div className="space-y-2 text-center">
224
+ <IconButton
225
+ variant="background"
226
+ size="small"
227
+ icon={<SearchIcon />}
228
+ label="Search small"
229
+ />
230
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
231
+ Small (32px)
232
+ </p>
233
+ </div>
234
+ <div className="space-y-2 text-center">
235
+ <IconButton
236
+ variant="background"
237
+ size="medium"
238
+ icon={<SearchIcon />}
239
+ label="Search medium"
240
+ />
241
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
242
+ Medium (44px)
243
+ </p>
244
+ </div>
245
+ <div className="space-y-2 text-center">
246
+ <IconButton
247
+ variant="background"
248
+ size="large"
249
+ icon={<SearchIcon />}
250
+ label="Search large"
251
+ />
252
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
253
+ Large (56px)
254
+ </p>
115
255
  </div>
116
256
  </div>
257
+ </div>
117
258
 
118
- <div>
119
- <h3 className="text-fm-primary mb-2">MEDIUM</h3>
120
- <div className="flex space-x-4">
121
- <IconButton {...args} size="medium" label="Default" />
122
- <IconButton {...args} size="medium" disabled label="Disabled" />
259
+ <div className="space-y-4">
260
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
261
+ Ghost Variant
262
+ </h4>
263
+ <div className="flex flex-wrap items-end gap-6">
264
+ <div className="space-y-2 text-center">
265
+ <IconButton
266
+ variant="ghost"
267
+ size="small"
268
+ icon={<HeartIcon />}
269
+ label="Like small"
270
+ />
271
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
272
+ Small (32px)
273
+ </p>
274
+ </div>
275
+ <div className="space-y-2 text-center">
276
+ <IconButton
277
+ variant="ghost"
278
+ size="medium"
279
+ icon={<HeartIcon />}
280
+ label="Like medium"
281
+ />
282
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
283
+ Medium (44px)
284
+ </p>
285
+ </div>
286
+ <div className="space-y-2 text-center">
287
+ <IconButton
288
+ variant="ghost"
289
+ size="large"
290
+ icon={<HeartIcon />}
291
+ label="Like large"
292
+ />
293
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
294
+ Large (56px)
295
+ </p>
123
296
  </div>
124
297
  </div>
298
+ </div>
125
299
 
126
- <div>
127
- <h3 className="text-fm-primary mb-2">LARGE</h3>
128
- <div className="flex space-x-4">
129
- <IconButton {...args} size="large" label="Default" />
130
- <IconButton {...args} size="large" disabled label="Disabled" />
300
+ <div className="space-y-4">
301
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
302
+ Outlined Variant
303
+ </h4>
304
+ <div className="flex flex-wrap items-end gap-6">
305
+ <div className="space-y-2 text-center">
306
+ <IconButton
307
+ variant="outlined"
308
+ size="small"
309
+ icon={<ShareIcon />}
310
+ label="Share small"
311
+ />
312
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
313
+ Small (32px)
314
+ </p>
315
+ </div>
316
+ <div className="space-y-2 text-center">
317
+ <IconButton
318
+ variant="outlined"
319
+ size="medium"
320
+ icon={<ShareIcon />}
321
+ label="Share medium"
322
+ />
323
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
324
+ Medium (44px)
325
+ </p>
326
+ </div>
327
+ <div className="space-y-2 text-center">
328
+ <IconButton
329
+ variant="outlined"
330
+ size="large"
331
+ icon={<ShareIcon />}
332
+ label="Share large"
333
+ />
334
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
335
+ Large (56px)
336
+ </p>
131
337
  </div>
132
338
  </div>
133
339
  </div>
134
340
  </div>
135
341
  ),
342
+ parameters: {
343
+ docs: {
344
+ description: {
345
+ story:
346
+ "Side-by-side size comparison (small 32px, medium 44px, large 56px) for each of the three variants.",
347
+ },
348
+ },
349
+ },
136
350
  }
137
351
 
138
- export const WithToolTip: Story = {
139
- render: () => (
140
- <div className="bg-fm-neutral-0 flex flex-col space-y-6 rounded p-8">
141
- <h2 className="text-fm-yellow-500 text-sm font-bold">
142
- With ToolTip EXAMPLES
143
- </h2>
144
-
145
- <div className="flex space-x-4">
146
- <IconButton
147
- variant="background"
148
- icon={<SearchIcon />}
149
- label="Search"
150
- onClick={() => alert("Search clicked")}
151
- tooltip="Search Items"
152
- tooltipContentProps={{
153
- align: "center",
154
- side: "bottom",
155
- }}
156
- />
157
- <IconButton
158
- variant="ghost"
159
- icon={<CrossIcon />}
160
- label="Close"
161
- onClick={() => alert("Close clicked")}
162
- tooltip="Cancel"
163
- tooltipContentProps={{
164
- align: "center",
165
- side: "bottom",
166
- }}
167
- />
168
- <IconButton
169
- variant="outlined"
170
- icon={<NotepadIcon />}
171
- label="Add"
172
- onClick={() => alert("Add clicked")}
173
- tooltip="Notes"
174
- tooltipContentProps={{
175
- align: "center",
176
- side: "bottom",
177
- }}
178
- />
179
- </div>
180
- </div>
181
- ),
182
- }
352
+ // ─── 4. States ────────────────────────────────────────────────────────────────
183
353
 
184
- export const Outlined: Story = {
185
- args: {
186
- label: "Search",
187
- icon: <SearchIcon />,
188
- variant: "outlined",
189
- },
190
- render: (args) => (
191
- <div className="bg-fm-neutral-0 flex flex-col space-y-6 rounded p-8">
192
- <h2 className="text-fm-yellow-500 text-sm font-bold">OUTLINED</h2>
193
-
194
- <div className="flex flex-col space-y-4">
195
- <div>
196
- <h3 className="text-fm-primary mb-2">SMALL</h3>
197
- <div className="flex space-x-4">
198
- <IconButton {...args} size="small" label="Default" />
199
- <IconButton {...args} size="small" disabled label="Disabled" />
354
+ export const States: Story = {
355
+ render: () => (
356
+ <div className="space-y-8">
357
+ <div className="space-y-4">
358
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
359
+ Background — Enabled vs Disabled
360
+ </h4>
361
+ <div className="flex flex-wrap items-end gap-6">
362
+ <div className="space-y-2 text-center">
363
+ <IconButton
364
+ variant="background"
365
+ shape="circle"
366
+ icon={<SearchIcon />}
367
+ label="Search"
368
+ />
369
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
370
+ Circle enabled
371
+ </p>
372
+ </div>
373
+ <div className="space-y-2 text-center">
374
+ <IconButton
375
+ variant="background"
376
+ shape="circle"
377
+ icon={<SearchIcon />}
378
+ label="Search disabled"
379
+ disabled
380
+ />
381
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
382
+ Circle disabled
383
+ </p>
384
+ </div>
385
+ <div className="space-y-2 text-center">
386
+ <IconButton
387
+ variant="background"
388
+ shape="square"
389
+ icon={<SearchIcon />}
390
+ label="Search"
391
+ />
392
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
393
+ Square enabled
394
+ </p>
395
+ </div>
396
+ <div className="space-y-2 text-center">
397
+ <IconButton
398
+ variant="background"
399
+ shape="square"
400
+ icon={<SearchIcon />}
401
+ label="Search disabled"
402
+ disabled
403
+ />
404
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
405
+ Square disabled
406
+ </p>
200
407
  </div>
201
408
  </div>
409
+ </div>
202
410
 
203
- <div>
204
- <h3 className="text-fm-primary mb-2">MEDIUM</h3>
205
- <div className="flex space-x-4">
206
- <IconButton {...args} size="medium" label="Default" />
207
- <IconButton {...args} size="medium" disabled label="Disabled" />
411
+ <div className="space-y-4">
412
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
413
+ Ghost Enabled vs Disabled
414
+ </h4>
415
+ <div className="flex flex-wrap items-end gap-6">
416
+ <div className="space-y-2 text-center">
417
+ <IconButton
418
+ variant="ghost"
419
+ shape="circle"
420
+ icon={<HeartIcon />}
421
+ label="Like"
422
+ />
423
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
424
+ Circle enabled
425
+ </p>
426
+ </div>
427
+ <div className="space-y-2 text-center">
428
+ <IconButton
429
+ variant="ghost"
430
+ shape="circle"
431
+ icon={<HeartIcon />}
432
+ label="Like disabled"
433
+ disabled
434
+ />
435
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
436
+ Circle disabled
437
+ </p>
438
+ </div>
439
+ <div className="space-y-2 text-center">
440
+ <IconButton
441
+ variant="ghost"
442
+ shape="square"
443
+ icon={<HeartIcon />}
444
+ label="Like"
445
+ />
446
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
447
+ Square enabled
448
+ </p>
449
+ </div>
450
+ <div className="space-y-2 text-center">
451
+ <IconButton
452
+ variant="ghost"
453
+ shape="square"
454
+ icon={<HeartIcon />}
455
+ label="Like disabled"
456
+ disabled
457
+ />
458
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
459
+ Square disabled
460
+ </p>
208
461
  </div>
209
462
  </div>
463
+ </div>
210
464
 
211
- <div>
212
- <h3 className="text-fm-primary mb-2">LARGE</h3>
213
- <div className="flex space-x-4">
214
- <IconButton {...args} size="large" label="Default" />
215
- <IconButton {...args} size="large" disabled label="Disabled" />
465
+ <div className="space-y-4">
466
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
467
+ Outlined Enabled vs Disabled
468
+ </h4>
469
+ <div className="flex flex-wrap items-end gap-6">
470
+ <div className="space-y-2 text-center">
471
+ <IconButton
472
+ variant="outlined"
473
+ shape="circle"
474
+ icon={<ShareIcon />}
475
+ label="Share"
476
+ />
477
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
478
+ Circle enabled
479
+ </p>
480
+ </div>
481
+ <div className="space-y-2 text-center">
482
+ <IconButton
483
+ variant="outlined"
484
+ shape="circle"
485
+ icon={<ShareIcon />}
486
+ label="Share disabled"
487
+ disabled
488
+ />
489
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
490
+ Circle disabled
491
+ </p>
492
+ </div>
493
+ <div className="space-y-2 text-center">
494
+ <IconButton
495
+ variant="outlined"
496
+ shape="square"
497
+ icon={<ShareIcon />}
498
+ label="Share"
499
+ />
500
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
501
+ Square enabled
502
+ </p>
503
+ </div>
504
+ <div className="space-y-2 text-center">
505
+ <IconButton
506
+ variant="outlined"
507
+ shape="square"
508
+ icon={<ShareIcon />}
509
+ label="Share disabled"
510
+ disabled
511
+ />
512
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
513
+ Square disabled
514
+ </p>
216
515
  </div>
217
516
  </div>
218
517
  </div>
219
518
  </div>
220
519
  ),
520
+ parameters: {
521
+ docs: {
522
+ description: {
523
+ story:
524
+ "Enabled and disabled states for each variant/shape combination. Disabled buttons apply reduced opacity to the icon and prevent interaction.",
525
+ },
526
+ },
527
+ },
221
528
  }
222
529
 
223
- export const DifferentIcons: Story = {
530
+ // ─── 5. Use Cases ─────────────────────────────────────────────────────────────
531
+
532
+ export const UseCases: Story = {
224
533
  render: () => (
225
- <div className="bg-fm-neutral-0 flex flex-col space-y-6 rounded p-8">
226
- <h2 className="text-fm-yellow-500 text-sm font-bold">ICON VARIATIONS</h2>
534
+ <div className="mx-auto max-w-3xl space-y-8 p-8">
535
+ <div className="space-y-4">
536
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
537
+ Audio Player Controls
538
+ </h4>
539
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary flex flex-wrap items-center justify-center gap-3 rounded-xl border p-6">
540
+ <IconButton
541
+ variant="ghost"
542
+ size="small"
543
+ shape="circle"
544
+ icon={<SkipBackwardIcon />}
545
+ label="Previous track"
546
+ tooltip="Previous"
547
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
548
+ />
549
+ <IconButton
550
+ variant="background"
551
+ size="large"
552
+ shape="circle"
553
+ icon={<CircularPlayIcon />}
554
+ label="Play"
555
+ tooltip="Play"
556
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
557
+ />
558
+ <IconButton
559
+ variant="ghost"
560
+ size="small"
561
+ shape="circle"
562
+ icon={<SkipForwardIcon />}
563
+ label="Next track"
564
+ tooltip="Next"
565
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
566
+ />
567
+ <IconButton
568
+ variant="ghost"
569
+ size="small"
570
+ shape="circle"
571
+ icon={<VolumeFullIcon />}
572
+ label="Volume"
573
+ tooltip="Volume"
574
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
575
+ />
576
+ <IconButton
577
+ variant="ghost"
578
+ size="small"
579
+ shape="circle"
580
+ icon={<HeartIcon />}
581
+ label="Add to favourites"
582
+ tooltip="Favourite"
583
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
584
+ />
585
+ </div>
586
+ </div>
227
587
 
228
- <div className="flex space-x-4">
229
- <IconButton variant="background" icon={<SearchIcon />} label="Search" />
230
- <IconButton variant="background" icon={<CrossIcon />} label="Close" />
231
- <IconButton
232
- variant="background"
233
- icon={<FeatureShineIcon />}
234
- label="Add"
235
- />
588
+ <div className="space-y-4">
589
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
590
+ Track List Row Actions
591
+ </h4>
592
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary mx-auto max-w-md rounded-xl border">
593
+ {[
594
+ { title: "Midnight Dreams", artist: "Lunar Waves" },
595
+ { title: "Electric Sunrise", artist: "Neon Drift" },
596
+ { title: "Echoes in Rain", artist: "The Resonants" },
597
+ ].map(({ title, artist }) => (
598
+ <div
599
+ key={title}
600
+ className="border-fm-divider-secondary flex items-center justify-between border-b p-4 last:border-b-0"
601
+ >
602
+ <div className="space-y-0.5">
603
+ <p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm font-medium">
604
+ {title}
605
+ </p>
606
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
607
+ {artist}
608
+ </p>
609
+ </div>
610
+ <div className="flex items-center gap-1">
611
+ <IconButton
612
+ variant="ghost"
613
+ size="small"
614
+ shape="circle"
615
+ icon={<HeartIcon />}
616
+ label={`Add ${title} to favourites`}
617
+ />
618
+ <IconButton
619
+ variant="ghost"
620
+ size="small"
621
+ shape="circle"
622
+ icon={<VerticalMenuIcon />}
623
+ label={`More options for ${title}`}
624
+ />
625
+ </div>
626
+ </div>
627
+ ))}
628
+ </div>
629
+ </div>
630
+
631
+ <div className="space-y-4">
632
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
633
+ Panel Header Actions
634
+ </h4>
635
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary mx-auto max-w-md rounded-xl border p-5">
636
+ <div className="mb-4 flex items-center justify-between">
637
+ <p className="text-fm-primary font-fm-brand text-fm-md leading-fm-md font-semibold">
638
+ Now Playing
639
+ </p>
640
+ <div className="flex items-center gap-1">
641
+ <IconButton
642
+ variant="ghost"
643
+ size="small"
644
+ shape="square"
645
+ icon={<ShareIcon />}
646
+ label="Share track"
647
+ tooltip="Share"
648
+ tooltipContentProps={{ side: "bottom", sideOffset: 8 }}
649
+ />
650
+ <IconButton
651
+ variant="ghost"
652
+ size="small"
653
+ shape="square"
654
+ icon={<SettingIcon />}
655
+ label="Open settings"
656
+ tooltip="Settings"
657
+ tooltipContentProps={{ side: "bottom", sideOffset: 8 }}
658
+ />
659
+ <IconButton
660
+ variant="outlined"
661
+ size="small"
662
+ shape="square"
663
+ icon={<CrossIcon />}
664
+ label="Close panel"
665
+ tooltip="Close"
666
+ tooltipContentProps={{ side: "bottom", sideOffset: 8 }}
667
+ />
668
+ </div>
669
+ </div>
670
+ <div className="border-fm-divider-secondary flex items-center gap-4 rounded-lg border p-4">
671
+ <div className="bg-fm-surface-secondary size-12 rounded-lg" />
672
+ <div className="space-y-0.5">
673
+ <p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm font-medium">
674
+ Midnight Dreams
675
+ </p>
676
+ <p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
677
+ Lunar Waves
678
+ </p>
679
+ </div>
680
+ <div className="ml-auto">
681
+ <IconButton
682
+ variant="background"
683
+ size="medium"
684
+ shape="circle"
685
+ icon={<PauseIcon />}
686
+ label="Pause"
687
+ />
688
+ </div>
689
+ </div>
690
+ </div>
691
+ </div>
692
+
693
+ <div className="space-y-4">
694
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
695
+ Library Management
696
+ </h4>
697
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary mx-auto max-w-md rounded-xl border p-5">
698
+ <div className="flex flex-wrap items-center justify-between gap-3">
699
+ <p className="text-fm-primary font-fm-brand text-fm-md leading-fm-md font-semibold">
700
+ My Library
701
+ </p>
702
+ <div className="flex items-center gap-2">
703
+ <IconButton
704
+ variant="background"
705
+ size="small"
706
+ shape="square"
707
+ icon={<SearchIcon />}
708
+ label="Search library"
709
+ tooltip="Search"
710
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
711
+ />
712
+ <IconButton
713
+ variant="background"
714
+ size="small"
715
+ shape="square"
716
+ icon={<MusicalNoteIcon />}
717
+ label="Add track"
718
+ tooltip="Add track"
719
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
720
+ />
721
+ <IconButton
722
+ variant="ghost"
723
+ size="small"
724
+ shape="square"
725
+ icon={<TrashIcon />}
726
+ label="Delete selected"
727
+ tooltip="Delete"
728
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
729
+ />
730
+ </div>
731
+ </div>
732
+ </div>
236
733
  </div>
237
734
  </div>
238
735
  ),
736
+ parameters: {
737
+ layout: "fullscreen",
738
+ docs: {
739
+ description: {
740
+ story:
741
+ "Real-world audio app scenarios: player playback controls, track list row actions, panel header controls, and library management toolbar.",
742
+ },
743
+ },
744
+ },
239
745
  }
240
746
 
241
- export const Shapes: Story = {
242
- render: () => (
243
- <div className="bg-fm-neutral-0 flex flex-col space-y-6 rounded p-8">
244
- <h2 className="text-fm-yellow-500 text-sm font-bold">SHAPES</h2>
747
+ // ─── 6. Accessibility ─────────────────────────────────────────────────────────
245
748
 
246
- <div className="flex flex-col space-y-4">
247
- <div>
248
- <h3 className="text-fm-primary mb-2">CIRCLE</h3>
249
- <div className="flex space-x-4">
749
+ export const Accessibility: Story = {
750
+ render: () => (
751
+ <div className="space-y-8">
752
+ <div className="space-y-4">
753
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
754
+ Required label prop (aria-label)
755
+ </h4>
756
+ <div className="flex flex-wrap items-end gap-6">
757
+ <div className="space-y-2 text-center">
250
758
  <IconButton
251
759
  variant="background"
252
760
  icon={<SearchIcon />}
253
- label="Search"
254
- shape="circle"
761
+ label="Search tracks"
255
762
  />
763
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
764
+ label="Search tracks"
765
+ </p>
766
+ </div>
767
+ <div className="space-y-2 text-center">
768
+ <IconButton
769
+ variant="background"
770
+ icon={<HeartIcon />}
771
+ label="Add to favourites"
772
+ />
773
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
774
+ label="Add to favourites"
775
+ </p>
776
+ </div>
777
+ <div className="space-y-2 text-center">
778
+ <IconButton
779
+ variant="background"
780
+ icon={<TrashIcon />}
781
+ label="Delete track"
782
+ />
783
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
784
+ label="Delete track"
785
+ </p>
256
786
  </div>
257
787
  </div>
788
+ </div>
258
789
 
259
- <div>
260
- <h3 className="text-fm-primary mb-2">SQUARE</h3>
261
- <div className="flex space-x-4">
790
+ <div className="space-y-4">
791
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
792
+ Tooltip for visible context
793
+ </h4>
794
+ <div className="flex flex-wrap items-center gap-6 pb-8">
795
+ <div className="space-y-2 text-center">
262
796
  <IconButton
263
797
  variant="background"
264
- icon={<SearchIcon />}
265
- label="Search"
266
- shape="square"
798
+ icon={<SettingIcon />}
799
+ label="Open settings"
800
+ tooltip="Settings"
801
+ tooltipContentProps={{ side: "bottom", sideOffset: 8 }}
802
+ />
803
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
804
+ With tooltip
805
+ </p>
806
+ </div>
807
+ <div className="space-y-2 text-center">
808
+ <IconButton
809
+ variant="outlined"
810
+ icon={<CrossIcon />}
811
+ label="Close panel"
812
+ tooltip="Close"
813
+ tooltipContentProps={{ side: "bottom", sideOffset: 8 }}
814
+ />
815
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
816
+ With tooltip
817
+ </p>
818
+ </div>
819
+ <div className="space-y-2 text-center">
820
+ <IconButton
821
+ variant="ghost"
822
+ icon={<VerticalMenuIcon />}
823
+ label="More options"
824
+ tooltip="More options"
825
+ tooltipContentProps={{ side: "bottom", sideOffset: 8 }}
267
826
  />
827
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
828
+ With tooltip
829
+ </p>
268
830
  </div>
269
831
  </div>
270
832
  </div>
271
- </div>
272
- ),
273
- }
274
833
 
275
- export const Interactive: Story = {
276
- render: () => (
277
- <div className="bg-fm-neutral-0 flex flex-col space-y-6 rounded p-8">
278
- <h2 className="text-fm-yellow-500 text-sm font-bold">
279
- INTERACTIVE EXAMPLES
280
- </h2>
834
+ <div className="space-y-4">
835
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
836
+ Player controls in context
837
+ </h4>
838
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary flex flex-wrap items-center justify-center gap-3 rounded-xl border p-6">
839
+ <IconButton
840
+ variant="ghost"
841
+ size="small"
842
+ shape="circle"
843
+ icon={<SkipBackwardIcon />}
844
+ label="Skip backward"
845
+ tooltip="Previous track"
846
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
847
+ />
848
+ <IconButton
849
+ variant="background"
850
+ size="large"
851
+ shape="circle"
852
+ icon={<CircularPlayIcon />}
853
+ label="Play"
854
+ tooltip="Play"
855
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
856
+ />
857
+ <IconButton
858
+ variant="ghost"
859
+ size="small"
860
+ shape="circle"
861
+ icon={<SkipForwardIcon />}
862
+ label="Skip forward"
863
+ tooltip="Next track"
864
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
865
+ />
866
+ <IconButton
867
+ variant="ghost"
868
+ size="small"
869
+ shape="circle"
870
+ icon={<VolumeFullIcon />}
871
+ label="Volume"
872
+ tooltip="Volume"
873
+ tooltipContentProps={{ side: "top", sideOffset: 8 }}
874
+ />
875
+ </div>
876
+ </div>
281
877
 
282
- <div className="flex space-x-4">
283
- <IconButton
284
- variant="background"
285
- icon={<SearchIcon />}
286
- label="Search"
287
- onClick={() => alert("Search clicked")}
288
- />
289
- <IconButton
290
- variant="ghost"
291
- icon={<CrossIcon />}
292
- label="Close"
293
- onClick={() => alert("Close clicked")}
294
- />
295
- <IconButton
296
- variant="outlined"
297
- icon={<FeatureShineIcon />}
298
- label="Add"
299
- onClick={() => alert("Add clicked")}
300
- />
878
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
879
+ <ul className="space-y-2">
880
+ <li>
881
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
882
+ Always provide a descriptive{" "}
883
+ <code className="text-fm-primary font-fm-text text-fm-sm">
884
+ label
885
+ </code>{" "}
886
+ prop — it populates both{" "}
887
+ <code className="text-fm-primary font-fm-text text-fm-sm">
888
+ aria-label
889
+ </code>{" "}
890
+ and the inner AccessibleIcon, ensuring screen readers announce the
891
+ button's purpose.
892
+ </p>
893
+ </li>
894
+ <li>
895
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
896
+ Use the{" "}
897
+ <code className="text-fm-primary font-fm-text text-fm-sm">
898
+ tooltip
899
+ </code>{" "}
900
+ prop to surface a visible label on hover — useful when icon
901
+ meaning is not immediately obvious to sighted users.
902
+ </p>
903
+ </li>
904
+ <li>
905
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
906
+ Keyboard focus is handled via the native{" "}
907
+ <code className="text-fm-primary font-fm-text text-fm-sm">
908
+ button
909
+ </code>{" "}
910
+ element and visible ring tokens — no custom focus management
911
+ required.
912
+ </p>
913
+ </li>
914
+ <li>
915
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
916
+ Prefer descriptive labels over generic ones: use "Delete track"
917
+ not "Delete", "Add to favourites" not "Heart", so announcements
918
+ are unambiguous out of context.
919
+ </p>
920
+ </li>
921
+ <li>
922
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
923
+ The{" "}
924
+ <code className="text-fm-primary font-fm-text text-fm-sm">
925
+ disabled
926
+ </code>{" "}
927
+ prop sets the native{" "}
928
+ <code className="text-fm-primary font-fm-text text-fm-sm">
929
+ disabled
930
+ </code>{" "}
931
+ attribute — the button is removed from the tab order
932
+ automatically.
933
+ </p>
934
+ </li>
935
+ </ul>
301
936
  </div>
302
937
  </div>
303
938
  ),
939
+ parameters: {
940
+ docs: {
941
+ description: {
942
+ story:
943
+ "Accessibility-focused examples covering the required label prop (aria-label), tooltip for visible context, and a realistic player controls composition. Best practices are listed in the info box.",
944
+ },
945
+ },
946
+ },
304
947
  }