aural-ui 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/components/aspect-ratio/AspectRatio.stories.tsx +290 -1228
  2. package/dist/components/avatar/Avatar.stories.tsx +219 -235
  3. package/dist/components/badge/Badge.stories.tsx +379 -116
  4. package/dist/components/banner/Banner.stories.tsx +445 -391
  5. package/dist/components/breadcrumb/Breadcrumb.stories.tsx +453 -199
  6. package/dist/components/button/Button.stories.tsx +585 -230
  7. package/dist/components/card/Card.stories.tsx +619 -301
  8. package/dist/components/char-count/CharCount.stories.tsx +350 -248
  9. package/dist/components/checkbox/Checkbox.stories.tsx +309 -167
  10. package/dist/components/chip/Chip.stories.tsx +362 -168
  11. package/dist/components/circular-loader/CircularLoader.stories.tsx +221 -636
  12. package/dist/components/clamp-lines/ClampLines.stories.tsx +246 -117
  13. package/dist/components/collapsible/Collapsible.stories.tsx +391 -252
  14. package/dist/components/command/Command.stories.tsx +530 -867
  15. package/dist/components/dialog/Dialog.stories.tsx +501 -950
  16. package/dist/components/divider/Divider.stories.tsx +264 -527
  17. package/dist/components/dot-loader/DotLoader.stories.tsx +256 -257
  18. package/dist/components/drawer/Drawer.stories.tsx +659 -1023
  19. package/dist/components/dropdown/Dropdown.stories.tsx +643 -1028
  20. package/dist/components/form/Form.stories.tsx +560 -274
  21. package/dist/components/helper-text/HelperText.stories.tsx +199 -200
  22. package/dist/components/hover-card/HoverCard.stories.tsx +318 -1254
  23. package/dist/components/icon-button/IconButton.stories.tsx +837 -194
  24. package/dist/components/if-else/if-else.stories.tsx +370 -83
  25. package/dist/components/input/Input.stories.tsx +436 -368
  26. package/dist/components/label/Label.stories.tsx +156 -154
  27. package/dist/components/list/List.stories.tsx +484 -835
  28. package/dist/components/marquee/Marquee.stories.tsx +356 -712
  29. package/dist/components/otp-inputs/OtpInputs.stories.tsx +352 -422
  30. package/dist/components/overlay/Overlay.stories.tsx +452 -824
  31. package/dist/components/pagination/Pagination.stories.tsx +721 -210
  32. package/dist/components/popover/Popover.stories.tsx +481 -896
  33. package/dist/components/radio/Radio.stories.tsx +432 -124
  34. package/dist/components/resizable/Resizable.stories.tsx +495 -799
  35. package/dist/components/scroll-area/ScrollArea.stories.tsx +383 -1059
  36. package/dist/components/search/Search.stories.tsx +312 -595
  37. package/dist/components/select/Select.stories.tsx +684 -789
  38. package/dist/components/sheet/Sheet.stories.tsx +671 -950
  39. package/dist/components/skelton/Skelton.stories.tsx +230 -764
  40. package/dist/components/slider/Slider.stories.tsx +383 -760
  41. package/dist/components/stepper/Stepper.stories.tsx +371 -514
  42. package/dist/components/switch/Switch.stories.tsx +461 -208
  43. package/dist/components/switch-case/SwitchCase.stories.tsx +367 -188
  44. package/dist/components/table/Table.stories.tsx +770 -916
  45. package/dist/components/tabs/Tabs.stories.tsx +458 -1455
  46. package/dist/components/tag/Tag.stories.tsx +714 -542
  47. package/dist/components/textarea/TextArea.stories.tsx +621 -562
  48. package/dist/components/thumbnail-tags/ThumbnailTags.stories.tsx +228 -154
  49. package/dist/components/toast/Toast.stories.tsx +452 -1339
  50. package/dist/components/toggle/Toggle.stories.tsx +488 -931
  51. package/dist/components/tooltip/Tooltip.stories.tsx +344 -1388
  52. package/dist/components/typography/Typography.stories.tsx +406 -89
  53. package/dist/hooks/use-change-state/UseChangeState.stories.tsx +309 -606
  54. package/dist/hooks/use-previous/UsePrevious.stories.tsx +367 -917
  55. package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +639 -867
  56. package/dist/icons/Icons.stories.tsx +0 -12
  57. package/dist/icons/ai-avatar-icon/AiAvatarIcon.stories.tsx +223 -1060
  58. package/dist/icons/alert-icon/AlertIcon.stories.tsx +106 -968
  59. package/dist/icons/all-icons.tsx +37 -16
  60. package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +137 -1010
  61. package/dist/icons/apple-logo-icon/AppleLogoIcon.stories.tsx +145 -935
  62. package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +132 -1046
  63. package/dist/icons/arrow-corner-up-left-icon/ArrowCornerUpLeftIcon.stories.tsx +134 -986
  64. package/dist/icons/arrow-corner-up-right-icon/ArrowCornerUpRightIcon.stories.tsx +135 -1028
  65. package/dist/icons/arrow-left-icon/ArrowLeftIcon.stories.tsx +133 -971
  66. package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +145 -1123
  67. package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +143 -1252
  68. package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +123 -632
  69. package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +141 -1223
  70. package/dist/icons/backward-ten-seconds-icon/BackwardTenSecondsIcon.stories.tsx +164 -1018
  71. package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +121 -1236
  72. package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +121 -1213
  73. package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +116 -893
  74. package/dist/icons/camera-icon/CameraIcon.stories.tsx +109 -1254
  75. package/dist/icons/capital-a-letter-icon/CapitalALetterIcon.stories.tsx +114 -975
  76. package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +157 -994
  77. package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +160 -992
  78. package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +140 -970
  79. package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +126 -993
  80. package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +144 -987
  81. package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +141 -1007
  82. package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +147 -1187
  83. package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +110 -476
  84. package/dist/icons/coin-icon/CoinIcon.stories.tsx +120 -1364
  85. package/dist/icons/coin-toons-icon/CoinToonsIcon.stories.tsx +113 -1360
  86. package/dist/icons/column-wide-add-icon/ColumnWideAddIcon.stories.tsx +111 -942
  87. package/dist/icons/command-icon/CommandIcon.stories.tsx +124 -1087
  88. package/dist/icons/copy-icon/CopyIcon.stories.tsx +119 -996
  89. package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +144 -1046
  90. package/dist/icons/cross-icon/CrossIcon.stories.tsx +136 -999
  91. package/dist/icons/download-icon/DownloadIcon.stories.tsx +123 -857
  92. package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +121 -1080
  93. package/dist/icons/email-icon/EmailIcon.stories.tsx +112 -979
  94. package/dist/icons/expand-icon/ExpandIcon.stories.tsx +109 -1146
  95. package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +141 -1068
  96. package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +140 -1081
  97. package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +124 -1050
  98. package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +123 -1091
  99. package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +122 -633
  100. package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +116 -1087
  101. package/dist/icons/forward-ten-seconds-icon/ForwardTenSecondsIcon.stories.tsx +166 -1020
  102. package/dist/icons/git-branch-icon/GitBranchIcon.stories.tsx +112 -1182
  103. package/dist/icons/git-fork-icon/GitForkIcon.stories.tsx +112 -1155
  104. package/dist/icons/globe-icon/GlobeIcon.stories.tsx +127 -325
  105. package/dist/icons/google-logo-icon/GoogleLogoIcon.stories.tsx +142 -985
  106. package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +116 -1217
  107. package/dist/icons/head-icon/HeadIcon.stories.tsx +108 -953
  108. package/dist/icons/heart-icon/HeartIcon.stories.tsx +117 -1060
  109. package/dist/icons/image-avatar-sparkle-icon/ImageAvatarSparkleIcon.stories.tsx +116 -716
  110. package/dist/icons/image-icon/ImageIcon.stories.tsx +102 -1164
  111. package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +108 -1233
  112. package/dist/icons/import-left-arrow-folder-icon/ImportLeftArrowFolderIcon.stories.tsx +133 -1289
  113. package/dist/icons/indian-flag-icon/IndianFlagIcon.stories.tsx +155 -1012
  114. package/dist/icons/instagram-icon/InstagramIcon.stories.tsx +158 -1438
  115. package/dist/icons/layout-column-icon/LayoutColumnIcon.stories.tsx +121 -1011
  116. package/dist/icons/layout-left-icon/LayoutLeftIcon.stories.tsx +116 -981
  117. package/dist/icons/layout-right-icon/LayoutRightIcon.stories.tsx +116 -979
  118. package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +105 -1252
  119. package/dist/icons/linked-in-icon/LinkedInIcon.stories.tsx +151 -1554
  120. package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +107 -1227
  121. package/dist/icons/magic-edit-icon/MagicEditIcon.stories.tsx +116 -707
  122. package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +119 -1226
  123. package/dist/icons/message-icon/MessageIcon.stories.tsx +111 -557
  124. package/dist/icons/minimize-icon/MinimizeIcon.stories.tsx +112 -1198
  125. package/dist/icons/moon-icon/MoonIcon.stories.tsx +117 -557
  126. package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +106 -1235
  127. package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +112 -1185
  128. package/dist/icons/musical-note-icon/MusicalNoteIcon.stories.tsx +116 -1012
  129. package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +108 -1137
  130. package/dist/icons/notes-icon/NotesIcon.stories.tsx +116 -1138
  131. package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +106 -1146
  132. package/dist/icons/page-text-icon/PageTextIcon.stories.tsx +119 -719
  133. package/dist/icons/paint-roll-icon/PaintRollIcon.stories.tsx +110 -999
  134. package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +109 -912
  135. package/dist/icons/pause-icon/PauseIcon.stories.tsx +110 -1041
  136. package/dist/icons/pencil-icon/PencilIcon.stories.tsx +112 -1109
  137. package/dist/icons/phone-icon/PhoneIcon.stories.tsx +112 -1023
  138. package/dist/icons/plus-icon/PlusIcon.stories.tsx +103 -1132
  139. package/dist/icons/pocket-studio-icon/PocketStudioIcon.stories.tsx +104 -870
  140. package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +99 -476
  141. package/dist/icons/search-icon/SearchIcon.stories.tsx +108 -1161
  142. package/dist/icons/setting-icon/SettingIcon.stories.tsx +104 -1009
  143. package/dist/icons/share-icon/ShareIcon.stories.tsx +117 -1064
  144. package/dist/icons/shield-icon/ShieldIcon.stories.tsx +114 -974
  145. package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +134 -1160
  146. package/dist/icons/skip-backward-icon/SkipBackwardIcon.stories.tsx +169 -1017
  147. package/dist/icons/skip-forward-icon/SkipForwardIcon.stories.tsx +161 -1016
  148. package/dist/icons/sparkles-soft-icon/SparklesSoftIcon.stories.tsx +102 -1001
  149. package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +155 -593
  150. package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +155 -608
  151. package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +142 -712
  152. package/dist/icons/star-icon/StarIcon.stories.tsx +120 -946
  153. package/dist/icons/store-coin-icon/StoreCoinIcon.stories.tsx +109 -1013
  154. package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +113 -891
  155. package/dist/icons/sun-icon/SunIcon.stories.tsx +117 -864
  156. package/dist/icons/text-color-icon/TextColorIcon.stories.tsx +113 -989
  157. package/dist/icons/text-indicator-icon/TextIndicatorIcon.stories.tsx +120 -1027
  158. package/dist/icons/threads-icon/ThreadsIcon.stories.tsx +153 -1476
  159. package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +143 -1187
  160. package/dist/icons/tick-icon/TickIcon.stories.tsx +142 -1322
  161. package/dist/icons/trash-icon/TrashIcon.stories.tsx +105 -970
  162. package/dist/icons/twitter-x-icon/TwitterXIcon.stories.tsx +154 -1457
  163. package/dist/icons/upload-icon/UploadIcon.stories.tsx +112 -930
  164. package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +115 -1019
  165. package/dist/icons/video-play-list-icon/VideoPlaylistIcon.stories.tsx +122 -1092
  166. package/dist/icons/voice-playing-icon/VoicePlayingIcon.stories.tsx +120 -1401
  167. package/dist/icons/volume-full-icon/VolumeFullIcon.stories.tsx +107 -1212
  168. package/dist/icons/volume-half-icon/VolumeHalfIcon.stories.tsx +109 -1122
  169. package/dist/icons/volume-off-icon/VolumeOffIcon.stories.tsx +112 -1124
  170. package/dist/icons/warning-icon/WarningIcon.stories.tsx +119 -1083
  171. package/dist/icons/youtube-icon/YoutubeIcon.stories.tsx +158 -983
  172. package/dist/index.cjs +1 -1
  173. package/dist/index.js +1 -1
  174. package/package.json +1 -1
@@ -1,6 +1,20 @@
1
1
  import React from "react"
2
2
  import type { Meta, StoryObj } from "@storybook/react-vite"
3
3
 
4
+ import { CoinIcon } from "src/ui/icons/coin-icon"
5
+ import { FeatureShineIcon } from "src/ui/icons/feature-shine-icon"
6
+ import { HeartIcon } from "src/ui/icons/heart-icon"
7
+ import { ShareIcon } from "src/ui/icons/share-icon"
8
+ import {
9
+ IconColorVariations,
10
+ IconDefaultCanvas,
11
+ IconPlaygroundCanvas,
12
+ IconSizeVariations,
13
+ IconUsageCanvas,
14
+ IconUsageSection,
15
+ } from "src/ui/story-spec/icons/icon-story-canvas"
16
+ import { AuralIconDocsPage } from "src/ui/story-spec/icons/icon-story-docs-page"
17
+
4
18
  import { StarIcon } from "."
5
19
 
6
20
  const meta: Meta<typeof StarIcon> = {
@@ -18,792 +32,69 @@ const meta: Meta<typeof StarIcon> = {
18
32
  },
19
33
  docs: {
20
34
  page: () => (
21
- <>
22
- <style>
23
- {`
24
- .sbdocs-wrapper {
25
- padding: 0 !important;
26
- max-width: none !important;
27
- background: transparent !important;
28
- }
29
- .sbdocs-content {
30
- max-width: none !important;
31
- padding: 0 !important;
32
- margin: 0 !important;
33
- background: transparent !important;
34
- }
35
- .docs-story {
36
- background: transparent !important;
37
- }
38
- .sbdocs {
39
- background: transparent !important;
40
- }
41
- body {
42
- background: var(--color-fm-surface-primary) !important;
43
- }
44
- #storybook-docs {
45
- background: var(--color-fm-surface-primary) !important;
46
- }
47
- .sbdocs-preview {
48
- background: transparent !important;
49
- border: none !important;
50
- }
51
- .sbdocs-h1, .sbdocs-h2, .sbdocs-h3, .sbdocs-h4, .sbdocs-h5, .sbdocs-h6 {
52
- color: var(--color-fm-icon-active) !important;
53
- }
54
- .sbdocs-p, .sbdocs-li {
55
- color: var(--color-fm-secondary) !important;
56
- }
57
- .sbdocs-code {
58
- background: var(--color-fm-surface-secondary) !important;
59
- color: var(--color-fm-secondary-500) !important;
60
- border: 1px solid var(--color-fm-divider-secondary) !important;
61
- }
62
- .sbdocs-pre {
63
- background: var(--color-fm-surface-secondary) !important;
64
- border: 1px solid var(--color-fm-divider-secondary) !important;
65
- }
66
- .sbdocs-table {
67
- background: var(--color-fm-surface-secondary) !important;
68
- border: 1px solid var(--color-fm-divider-secondary) !important;
69
- }
70
- .sbdocs-table th {
71
- background: var(--color-fm-surface-secondary) !important;
72
- color: var(--color-fm-icon-active) !important;
73
- border-bottom: 1px solid var(--color-fm-divider-secondary) !important;
74
- }
75
- .sbdocs-table td {
76
- color: var(--color-fm-secondary) !important;
77
- border-bottom: 1px solid var(--color-fm-divider-tertiary) !important;
78
- }
79
- `}
80
- </style>
81
-
82
- <div className="from-fm-surface-primary via-fm-icon-warning/5 to-fm-surface-primary min-h-screen bg-linear-to-br">
83
- {/* Header */}
84
- <div className="border-fm-divider-secondary bg-fm-surface-secondary relative overflow-hidden border-b backdrop-blur-xl">
85
- <div className="from-fm-icon-warning/10 to-fm-icon-warning/10 absolute inset-0 bg-linear-to-r via-transparent" />
86
- <div className="relative !mx-auto max-w-7xl px-6 py-16">
87
- <div className="!space-y-6 text-center">
88
- <div className="border-fm-icon-warning/30 from-fm-icon-warning/20 to-fm-icon-warning/20 !mx-auto flex h-24 w-24 items-center justify-center rounded-2xl border bg-linear-to-br">
89
- <StarIcon className="text-fm-icon-warning h-12 w-12" />
90
- </div>
91
- <h1 className="!text-fm-primary text-5xl font-bold">
92
- StarIcon
93
- </h1>
94
- <p className="text-fm-secondary! !mx-auto max-w-3xl text-xl leading-relaxed">
95
- A classic star icon for ratings, favorites, bookmarks, and
96
- highlighting important content. Perfect for review systems,
97
- wishlists, and premium features. Built with accessibility in
98
- mind using Radix UI's AccessibleIcon wrapper.
99
- </p>
100
-
101
- {/* Stats */}
102
- <div className="flex items-center justify-center gap-8 pt-8">
103
- <div className="text-center">
104
- <div className="text-fm-icon-warning text-3xl font-bold">
105
- Rate
106
- </div>
107
- <div className="text-fm-tertiary text-sm">
108
- Reviews & ratings
109
- </div>
110
- </div>
111
- <div className="bg-fm-divider-primary h-8 w-px" />
112
- <div className="text-center">
113
- <div className="text-fm-icon-warning text-3xl font-bold">
114
- Favorite
115
- </div>
116
- <div className="text-fm-tertiary text-sm">
117
- Save & bookmark
118
- </div>
119
- </div>
120
- <div className="bg-fm-divider-primary h-8 w-px" />
121
- <div className="text-center">
122
- <div className="text-fm-icon-warning text-3xl font-bold">
123
- Premium
124
- </div>
125
- <div className="text-fm-tertiary text-sm">
126
- Highlight features
127
- </div>
128
- </div>
129
- </div>
130
- </div>
131
- </div>
132
- </div>
133
-
134
- {/* Content */}
135
- <div className="!mx-auto max-w-7xl !space-y-16 px-6 py-12">
136
- {/* Quick Usage */}
137
- <div className="!space-y-8">
138
- <h2 className="text-fm-icon-active! text-center text-3xl font-bold">
139
- Quick Start
140
- </h2>
141
- <div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
142
- <div className="!space-y-4">
143
- <h3 className="text-fm-icon-warning! text-xl font-semibold">
144
- Basic Usage
145
- </h3>
146
- <div className="bg-fm-surface-secondary rounded-lg p-4">
147
- <pre className="text-fm-icon-positive! overflow-x-auto text-sm">
148
- {`import { StarIcon } from "@icons/star-icon"
149
-
150
- function RatingStar() {
35
+ <AuralIconDocsPage
36
+ accentToken="warning"
37
+ features={[
38
+ { title: "Rating", description: "Star rating or score" },
39
+ { title: "Favourite", description: "Save to favourites" },
40
+ { title: "Accessible", description: "ARIA-ready by default" },
41
+ ]}
42
+ quickStart={{
43
+ codeExample: `import { StarIcon } from "src/ui/icons/star-icon"
44
+
45
+ function RatingBadge() {
151
46
  return (
152
- <button className="p-1 hover:scale-110 transition-transform">
153
- <StarIcon className="h-5 w-5 text-yellow-400" />
154
- </button>
47
+ <div className="flex items-center gap-1">
48
+ <StarIcon className="h-4 w-4 text-fm-icon-warning" />
49
+ <span>4.8</span>
50
+ </div>
155
51
  )
156
- }`}
157
- </pre>
158
- </div>
159
- </div>
160
-
161
- <div className="!space-y-4">
162
- <h3 className="text-fm-icon-warning! text-xl font-semibold">
163
- Live Preview
164
- </h3>
165
- <div className="border-fm-divider-secondary bg-fm-surface-secondary flex h-32 items-center justify-center rounded-lg border">
166
- <button className="border-fm-icon-warning/20 bg-fm-icon-warning/10 hover:bg-fm-icon-warning/20 rounded-lg border p-3 transition-colors">
167
- <StarIcon className="text-fm-icon-warning h-6 w-6" />
168
- </button>
169
- </div>
170
- </div>
171
- </div>
172
- </div>
173
-
174
- {/* Props Documentation */}
175
- <div className="!space-y-8">
176
- <h2 className="text-fm-icon-active! text-center text-3xl font-bold">
177
- Props & Configuration
178
- </h2>
179
-
180
- <div className="border-fm-divider-secondary bg-fm-surface-secondary overflow-hidden rounded-lg border">
181
- <div className="bg-fm-surface-secondary p-4">
182
- <h3 className="text-fm-icon-active! text-xl font-semibold">
183
- Props
184
- </h3>
185
- </div>
186
- <table className="!my-0 w-full">
187
- <thead className="bg-fm-surface-secondary">
188
- <tr className="border-fm-divider-secondary border-b">
189
- <th className="text-fm-icon-active! px-6 py-4 text-left text-sm font-semibold">
190
- Prop
191
- </th>
192
- <th className="text-fm-icon-active! px-6 py-4 text-left text-sm font-semibold">
193
- Type
194
- </th>
195
- <th className="text-fm-icon-active! px-6 py-4 text-left text-sm font-semibold">
196
- Default
197
- </th>
198
- <th className="text-fm-icon-active! px-6 py-4 text-left text-sm font-semibold">
199
- Description
200
- </th>
201
- </tr>
202
- </thead>
203
- <tbody>
204
- {" "}
205
- <tr className="bg-fm-surface-secondary!">
206
- <td className="text-fm-icon-info! px-6 py-4 font-mono text-sm">
207
- withAccessibility
208
- </td>
209
- <td className="text-fm-secondary! px-6 py-4 text-sm">
210
- boolean
211
- </td>
212
- <td className="text-fm-placeholder! px-6 py-4 text-sm">
213
- true
214
- </td>
215
- <td className="text-fm-secondary! px-6 py-4 text-sm">
216
- Whether to wrap the icon with accessibility feature
217
- </td>
218
- </tr>
219
- <tr className="border-fm-divider-tertiary bg-fm-surface-secondary! border-b">
220
- <td className="text-fm-icon-warning! px-6 py-4 font-mono text-sm">
221
- height
222
- </td>
223
- <td className="text-fm-secondary! px-6 py-4 text-sm">
224
- number | string
225
- </td>
226
- <td className="text-fm-placeholder! px-6 py-4 text-sm">
227
- 24
228
- </td>
229
- <td className="text-fm-secondary! px-6 py-4 text-sm">
230
- Height of the icon in pixels
231
- </td>
232
- </tr>
233
- <tr className="border-fm-divider-tertiary border-b">
234
- <td className="text-fm-icon-warning! px-6 py-4 font-mono text-sm">
235
- stroke
236
- </td>
237
- <td className="text-fm-secondary! px-6 py-4 text-sm">
238
- string
239
- </td>
240
- <td className="text-fm-placeholder! px-6 py-4 text-sm">
241
- currentColor
242
- </td>
243
- <td className="text-fm-secondary! px-6 py-4 text-sm">
244
- Stroke color of the star
245
- </td>
246
- </tr>
247
- <tr className="border-fm-divider-tertiary bg-fm-surface-secondary! border-b">
248
- <td className="text-fm-icon-warning! px-6 py-4 font-mono text-sm">
249
- strokeWidth
250
- </td>
251
- <td className="text-fm-secondary! px-6 py-4 text-sm">
252
- string | number
253
- </td>
254
- <td className="text-fm-placeholder! px-6 py-4 text-sm">
255
- 1.5
256
- </td>
257
- <td className="text-fm-secondary! px-6 py-4 text-sm">
258
- Width of the stroke
259
- </td>
260
- </tr>
261
- <tr className="border-fm-divider-tertiary border-b">
262
- <td className="text-fm-icon-warning! px-6 py-4 font-mono text-sm">
263
- className
264
- </td>
265
- <td className="text-fm-secondary! px-6 py-4 text-sm">
266
- string
267
- </td>
268
- <td className="text-fm-placeholder! px-6 py-4 text-sm">
269
- -
270
- </td>
271
- <td className="text-fm-secondary! px-6 py-4 text-sm">
272
- CSS classes for styling
273
- </td>
274
- </tr>
275
- <tr className="bg-fm-surface-secondary!">
276
- <td className="text-fm-icon-warning! px-6 py-4 font-mono text-sm">
277
- ...svgProps
278
- </td>
279
- <td className="text-fm-secondary! px-6 py-4 text-sm">
280
- SVGProps
281
- </td>
282
- <td className="text-fm-placeholder! px-6 py-4 text-sm">
283
- -
284
- </td>
285
- <td className="text-fm-secondary! px-6 py-4 text-sm">
286
- All standard SVG element props
287
- </td>
288
- </tr>
289
- </tbody>
290
- </table>
291
- </div>
292
- </div>
293
-
294
- {/* Size Variations */}
295
- <div className="!space-y-8">
296
- <h2 className="text-fm-icon-active! text-center text-3xl font-bold">
297
- Size Variations
298
- </h2>
299
- <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-8">
300
- <div className="!space-y-6">
301
- <div className="grid grid-cols-1 gap-8 md:grid-cols-2">
302
- <div className="!space-y-4">
303
- <h3 className="text-fm-icon-warning! text-lg font-semibold">
304
- Standard Sizes
305
- </h3>
306
- <div className="bg-fm-surface-secondary flex items-end gap-6 rounded-lg p-6">
307
- <div className="text-center">
308
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-3 w-3" />
309
- <span className="text-fm-tertiary text-xs">
310
- 12px
311
- </span>
312
- </div>
313
- <div className="text-center">
314
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-4 w-4" />
315
- <span className="text-fm-tertiary text-xs">
316
- 16px
317
- </span>
318
- </div>
319
- <div className="text-center">
320
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-5 w-5" />
321
- <span className="text-fm-tertiary text-xs">
322
- 20px
323
- </span>
324
- </div>
325
- <div className="text-center">
326
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-6 w-6" />
327
- <span className="text-fm-tertiary text-xs">
328
- 24px
329
- </span>
330
- </div>
331
- <div className="text-center">
332
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-8 w-8" />
333
- <span className="text-fm-tertiary text-xs">
334
- 32px
335
- </span>
336
- </div>
337
- <div className="text-center">
338
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-12 w-12" />
339
- <span className="text-fm-tertiary text-xs">
340
- 48px
341
- </span>
342
- </div>
343
- </div>
344
- </div>
345
-
346
- <div className="!space-y-4">
347
- <h3 className="text-fm-icon-warning! text-lg font-semibold">
348
- Code Example
349
- </h3>
350
- <div className="bg-fm-surface-secondary rounded-lg p-4">
351
- <pre className="text-fm-icon-info! overflow-x-auto text-sm">
352
- {`// Small (16px)
353
- <StarIcon className="h-4 w-4" />
354
-
355
- // Medium (24px)
356
- <StarIcon className="h-6 w-6" />
357
-
358
- // Large (32px)
359
- <StarIcon className="h-8 w-8" />
360
-
361
- // Custom size
362
- <StarIcon width={40} height={40} />`}
363
- </pre>
364
- </div>
365
- </div>
366
- </div>
367
- </div>
368
- </div>
369
- </div>
370
-
371
- {/* Color Variations */}
372
- <div className="!space-y-8">
373
- <h2 className="text-fm-icon-active! text-center text-3xl font-bold">
374
- Color Variations
375
- </h2>
376
- <div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
377
- <div className="!space-y-4">
378
- <h3 className="text-fm-icon-warning! text-lg font-semibold">
379
- Semantic Colors
380
- </h3>
381
- <div className="border-fm-divider-secondary bg-fm-surface-secondary !space-y-4 rounded-lg border p-6">
382
- <div className="flex items-center gap-4">
383
- <StarIcon className="text-fm-icon-warning h-6 w-6" />
384
- <div>
385
- <div className="text-fm-icon-active text-sm font-medium">
386
- Rating/Favorite
387
- </div>
388
- <div className="text-fm-tertiary text-xs">
389
- text-fm-icon-warning
390
- </div>
391
- </div>
392
- </div>
393
- <div className="flex items-center gap-4">
394
- <StarIcon className="text-fm-icon-warning h-6 w-6" />
395
- <div>
396
- <div className="text-fm-icon-active text-sm font-medium">
397
- Premium/Highlight
398
- </div>
399
- <div className="text-fm-tertiary text-xs">
400
- text-fm-icon-warning
401
- </div>
402
- </div>
403
- </div>
404
- <div className="flex items-center gap-4">
405
- <StarIcon className="text-fm-placeholder h-6 w-6" />
406
- <div>
407
- <div className="text-fm-icon-active text-sm font-medium">
408
- Inactive/Empty
409
- </div>
410
- <div className="text-fm-tertiary text-xs">
411
- text-fm-placeholder
412
- </div>
413
- </div>
414
- </div>
415
- <div className="flex items-center gap-4">
416
- <StarIcon className="text-fm-tertiary h-6 w-6" />
417
- <div>
418
- <div className="text-fm-icon-active text-sm font-medium">
419
- Muted
420
- </div>
421
- <div className="text-fm-tertiary text-xs">
422
- text-fm-tertiary
423
- </div>
424
- </div>
425
- </div>
426
- </div>
427
- </div>
428
-
429
- <div className="!space-y-4">
430
- <h3 className="text-fm-icon-warning! text-lg font-semibold">
431
- Custom Colors
432
- </h3>
433
- <div className="bg-fm-surface-secondary rounded-lg p-4">
434
- <pre className="text-fm-icon-positive! overflow-x-auto text-sm">
435
- {`// Using Tailwind classes
436
- <StarIcon className="h-6 w-6 text-yellow-400" />
437
- <StarIcon className="h-6 w-6 text-orange-500" />
438
-
439
- // Using CSS custom properties
440
- <StarIcon
441
- className="h-6 w-6"
442
- style={{ color: 'var(--color-star)' }}
443
- />
444
-
445
- // Direct stroke prop
446
- <StarIcon
447
- width={24}
448
- height={24}
449
- stroke="#fbbf24"
450
- />`}
451
- </pre>
452
- </div>
453
- </div>
454
- </div>
455
- </div>
456
-
457
- {/* Usage Examples */}
458
- <div className="!space-y-8">
459
- <h2 className="text-fm-icon-active! text-center text-3xl font-bold">
460
- Usage Examples
461
- </h2>
462
-
463
- <div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
464
- {/* Rating System */}
465
- <div className="!space-y-4">
466
- <h3 className="text-fm-icon-warning! text-lg font-semibold">
467
- Rating System
468
- </h3>
469
- <div className="!space-y-4">
470
- <div className="flex gap-1">
471
- {[1, 2, 3, 4, 5].map((star) => (
472
- <button
473
- key={star}
474
- className="p-1 transition-transform hover:scale-110"
475
- >
476
- <StarIcon className="text-fm-icon-warning h-5 w-5" />
477
- </button>
478
- ))}
479
- </div>
480
- <div className="bg-fm-surface-secondary rounded-lg p-4">
481
- <pre className="text-fm-icon-positive! overflow-x-auto text-sm">
482
- {`// 5-star rating system
483
- {[1, 2, 3, 4, 5].map((star) => (
484
- <button key={star} className="p-1 hover:scale-110 transition-transform">
485
- <StarIcon className="h-5 w-5 text-yellow-400" />
486
- </button>
487
- ))}`}
488
- </pre>
489
- </div>
490
- </div>
491
- </div>
492
-
493
- {/* Favorite Button */}
494
- <div className="!space-y-4">
495
- <h3 className="text-fm-icon-warning! text-lg font-semibold">
496
- Favorite Button
497
- </h3>
498
- <div className="!space-y-4">
499
- <div className="flex gap-4">
500
- <button className="border-fm-icon-warning/30 bg-fm-icon-warning/20 text-fm-icon-warning hover:bg-fm-icon-warning/30 flex items-center gap-2 rounded-lg border px-4 py-2 transition-colors">
501
- <StarIcon className="h-4 w-4" />
502
- Add to Favorites
503
- </button>
504
- <button className="hover:bg-fm-surface-secondary rounded-lg p-2 transition-colors">
505
- <StarIcon className="text-fm-icon-warning h-5 w-5" />
506
- </button>
507
- </div>
508
- <div className="bg-fm-surface-secondary rounded-lg p-4">
509
- <pre className="text-fm-icon-positive! overflow-x-auto text-sm">
510
- {`// Favorite button with text
511
- <button className="flex items-center gap-2 bg-yellow-500/20 border border-yellow-500/30 px-4 py-2 rounded-lg">
512
- <StarIcon className="h-4 w-4" />
513
- Add to Favorites
514
- </button>
515
-
516
- // Icon-only favorite button
517
- <button className="p-2 hover:bg-white/10 rounded-lg transition-colors">
518
- <StarIcon className="h-5 w-5 text-yellow-400" />
519
- </button>`}
520
- </pre>
521
- </div>
522
- </div>
523
- </div>
524
-
525
- {/* Premium Feature */}
526
- <div className="!space-y-4">
527
- <h3 className="text-fm-icon-warning! text-lg font-semibold">
528
- Premium Feature
529
- </h3>
530
- <div className="!space-y-4">
531
- <div className="border-fm-icon-warning/30 bg-fm-icon-warning/10 rounded-lg border p-4">
532
- <div className="flex items-center gap-3">
533
- <StarIcon className="text-fm-icon-warning h-5 w-5" />
534
- <div>
535
- <h4 className="text-fm-icon-active font-medium">
536
- Premium Feature
537
- </h4>
538
- <p className="text-fm-secondary text-sm">
539
- Unlock advanced analytics
540
- </p>
541
- </div>
542
- </div>
543
- </div>
544
- <div className="bg-fm-surface-secondary rounded-lg p-4">
545
- <pre className="text-fm-icon-positive! overflow-x-auto text-sm">
546
- {`// Premium feature indicator
547
- <div className="flex items-center gap-3 border border-orange-500/30 bg-orange-500/10 p-4 rounded-lg">
548
- <StarIcon className="h-5 w-5 text-orange-400" />
549
- <div>
550
- <h4 className="font-medium text-white">Premium Feature</h4>
551
- <p className="text-sm text-white/70">Unlock advanced analytics</p>
552
- </div>
553
- </div>`}
554
- </pre>
555
- </div>
556
- </div>
557
- </div>
558
-
559
- {/* Bookmark */}
560
- <div className="!space-y-4">
561
- <h3 className="text-fm-icon-warning! text-lg font-semibold">
562
- Bookmark
563
- </h3>
564
- <div className="!space-y-4">
565
- <div className="border-fm-divider-secondary bg-fm-surface-secondary flex items-center justify-between rounded-lg border p-4">
566
- <div>
567
- <h4 className="text-fm-icon-active font-medium">
568
- Article Title
569
- </h4>
570
- <p className="text-fm-secondary text-sm">
571
- Brief description...
572
- </p>
573
- </div>
574
- <button className="text-fm-tertiary hover:bg-fm-surface-secondary hover:text-fm-icon-warning rounded p-1">
575
- <StarIcon className="h-4 w-4" />
576
- </button>
577
- </div>
578
- <div className="bg-fm-surface-secondary rounded-lg p-4">
579
- <pre className="text-fm-icon-positive! overflow-x-auto text-sm">
580
- {`// Bookmark button in list item
581
- <div className="flex items-center justify-between border border-white/10 bg-white/5 p-4 rounded-lg">
582
- <div>
583
- <h4 className="font-medium text-white">Article Title</h4>
584
- <p className="text-sm text-white/70">Brief description...</p>
585
- </div>
586
- <button className="rounded p-1 text-white/60 hover:bg-white/10 hover:text-yellow-400">
587
- <StarIcon className="h-4 w-4" />
588
- </button>
589
- </div>`}
590
- </pre>
591
- </div>
592
- </div>
593
- </div>
594
- </div>
595
- </div>
596
-
597
- {/* Accessibility */}
598
- <div className="!space-y-8">
599
- <h2 className="text-fm-icon-active! text-center text-3xl font-bold">
600
- Accessibility Features
601
- </h2>
602
- <div className="grid grid-cols-1 gap-8 md:grid-cols-2">
603
- <div className="border-fm-divider-secondary bg-fm-surface-secondary !space-y-4 rounded-lg border p-6">
604
- <h3 className="text-fm-icon-positive! text-lg font-semibold">
605
- ✅ Built-in Features
606
- </h3>
607
- <ul className="text-fm-secondary! !space-y-2 text-sm">
608
- <li className="text-fm-secondary!">
609
- Uses Radix UI AccessibleIcon wrapper
610
- </li>
611
- <li className="text-fm-secondary!">
612
- Provides screen reader label "Star icon"
613
- </li>
614
- <li className="text-fm-secondary!">
615
- Supports keyboard navigation when interactive
616
- </li>
617
- <li className="text-fm-secondary!">
618
- Maintains proper color contrast ratios
619
- </li>
620
- <li className="text-fm-secondary!">
621
- Scales with user's font size preferences
622
- </li>
623
- </ul>
624
- </div>
625
-
626
- <div className="border-fm-divider-secondary bg-fm-surface-secondary !space-y-4 rounded-lg border p-6">
627
- <h3 className="text-fm-icon-warning! text-lg font-semibold">
628
- 💡 Best Practices
629
- </h3>
630
- <ul className="text-fm-secondary! !space-y-2 text-sm">
631
- <li className="text-fm-secondary!">
632
- Always provide descriptive button labels for star
633
- actions
634
- </li>
635
- <li className="text-fm-secondary!">
636
- Use consistent placement for rating and favorite buttons
637
- </li>
638
- <li className="text-fm-secondary!">
639
- Ensure sufficient touch target size (44px minimum)
640
- </li>
641
- <li className="text-fm-secondary!">
642
- Provide visible focus states for keyboard users
643
- </li>
644
- <li className="text-fm-secondary!">
645
- Consider color-blind users with alternative indicators
646
- </li>
647
- </ul>
648
- </div>
649
- </div>
650
-
651
- <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-6">
652
- <h3 className="text-fm-secondary-600! mb-4 text-lg font-semibold">
653
- Proper ARIA Implementation
654
- </h3>
655
- <div className="grid grid-cols-1 gap-6 lg:grid-cols-2">
656
- <div className="bg-fm-surface-secondary rounded-lg p-4">
657
- <pre className="text-fm-icon-info! overflow-x-auto text-sm">
658
- {`// Rating star with ARIA
659
- <button
660
- aria-label="Rate 4 stars"
661
- className="p-1 hover:scale-110 transition-transform"
662
- >
663
- <StarIcon className="h-5 w-5 text-yellow-400" />
664
- </button>
665
-
666
- // Favorite button with ARIA
667
- <button
668
- aria-label="Add to favorites"
669
- aria-pressed="false"
670
- className="p-2 hover:bg-white/10 rounded-lg"
671
- >
672
- <StarIcon className="h-5 w-5 text-yellow-400" />
673
- </button>
674
-
675
- // Premium indicator with ARIA
676
- <div role="status" aria-label="Premium feature">
677
- <StarIcon className="h-5 w-5 text-orange-400" />
678
- <span className="sr-only">Premium feature</span>
679
- </div>`}
680
- </pre>
681
- </div>
682
- <div className="!space-y-4">
683
- <p className="text-fm-secondary! text-sm">
684
- When using StarIcon for interactive elements, provide
685
- clear context about the rating level or action being
686
- performed.
687
- </p>
688
- <div className="border-fm-icon-warning/20 bg-fm-icon-warning/10 rounded-lg border p-4">
689
- <div className="text-fm-icon-warning flex items-center gap-2 text-sm">
690
- <StarIcon className="h-4 w-4" />
691
- <span>
692
- Screen readers need context about rating levels and
693
- favorite states
694
- </span>
695
- </div>
696
- </div>
697
- </div>
698
- </div>
699
- </div>
700
- </div>
701
-
702
- {/* Related Icons */}
703
- <div className="!space-y-8">
704
- <h2 className="text-fm-icon-active! text-center text-3xl font-bold">
705
- Related Icons
706
- </h2>
707
- <div className="grid grid-cols-2 gap-6 md:grid-cols-4">
708
- <div className="border-fm-divider-secondary bg-fm-surface-secondary !space-y-3 rounded-lg border p-4 text-center">
709
- <div className="bg-fm-icon-info/20 !mx-auto flex h-12 w-12 items-center justify-center rounded-lg">
710
- <span className="text-fm-icon-active! !text-2xl">❤️</span>
711
- </div>
712
- <div>
713
- <div className="text-fm-icon-active font-medium">
714
- HeartIcon
715
- </div>
716
- <div className="text-fm-tertiary text-xs">Like/Love</div>
717
- </div>
718
- </div>
719
- <div className="border-fm-divider-secondary bg-fm-surface-secondary !space-y-3 rounded-lg border p-4 text-center">
720
- <div className="bg-fm-icon-positive/20 !mx-auto flex h-12 w-12 items-center justify-center rounded-lg">
721
- <span className="text-fm-icon-active! !text-2xl">✓</span>
722
- </div>
723
- <div>
724
- <div className="text-fm-icon-active font-medium">
725
- CheckIcon
726
- </div>
727
- <div className="text-fm-tertiary text-xs">Complete</div>
728
- </div>
729
- </div>
730
- <div className="border-fm-divider-secondary bg-fm-surface-secondary !space-y-3 rounded-lg border p-4 text-center">
731
- <div className="bg-fm-secondary-500/20 !mx-auto flex h-12 w-12 items-center justify-center rounded-lg">
732
- <span className="text-fm-icon-active! !text-2xl">🔖</span>
733
- </div>
734
- <div>
735
- <div className="text-fm-icon-active font-medium">
736
- BookmarkIcon
737
- </div>
738
- <div className="text-fm-tertiary text-xs">Save page</div>
739
- </div>
740
- </div>
741
- <div className="border-fm-divider-secondary bg-fm-surface-secondary !space-y-3 rounded-lg border p-4 text-center">
742
- <div className="bg-fm-icon-negative/20 !mx-auto flex h-12 w-12 items-center justify-center rounded-lg">
743
- <span className="text-fm-icon-active! !text-2xl">✖️</span>
744
- </div>
745
- <div>
746
- <div className="text-fm-icon-active font-medium">
747
- CrossIcon
748
- </div>
749
- <div className="text-fm-tertiary text-xs">
750
- Close/Remove
751
- </div>
752
- </div>
753
- </div>
754
- </div>
52
+ }`,
53
+ livePreview: (
54
+ <div className="flex items-center gap-1">
55
+ <StarIcon className="text-fm-icon-warning h-5 w-5" />
755
56
  </div>
756
- </div>
757
-
758
- {/* Footer */}
759
- <div className="border-fm-divider-secondary bg-fm-surface-secondary border-t backdrop-blur-xl">
760
- <div className="!mx-auto max-w-7xl px-6 py-8">
761
- <div className="!space-y-4 text-center">
762
- <p className="text-fm-tertiary!">
763
- StarIcon is part of the Aural UI icon library, built for
764
- ratings, favorites, and premium features.
765
- </p>
766
- <p className="text-fm-placeholder! text-sm">
767
- All icons use Radix UI's AccessibleIcon for screen reader
768
- compatibility and follow WCAG guidelines.
769
- </p>
770
- </div>
771
- </div>
772
- </div>
773
- </div>
774
- </>
57
+ ),
58
+ }}
59
+ relatedIcons={[
60
+ {
61
+ name: "FeatureShineIcon",
62
+ description: "Feature highlight / shine icon",
63
+ icon: FeatureShineIcon,
64
+ accentToken: "info",
65
+ },
66
+ {
67
+ name: "HeartIcon",
68
+ description: "Like / favourite icon",
69
+ icon: HeartIcon,
70
+ accentToken: "positive",
71
+ },
72
+ {
73
+ name: "ShareIcon",
74
+ description: "Share content icon",
75
+ icon: ShareIcon,
76
+ accentToken: "warning",
77
+ },
78
+ {
79
+ name: "CoinIcon",
80
+ description: "In-app coin / token icon",
81
+ icon: CoinIcon,
82
+ accentToken: "negative",
83
+ },
84
+ ]}
85
+ />
775
86
  ),
776
87
  },
777
88
  },
778
89
  tags: ["autodocs"],
779
90
  argTypes: {
780
- width: {
781
- control: { type: "range", min: 8, max: 96, step: 2 },
782
- description: "Width of the icon in pixels",
783
- },
784
- withAccessibility: {
785
- control: "boolean",
786
- description: "Whether to wrap the icon with accessibility features",
787
- },
788
- height: {
789
- control: { type: "range", min: 8, max: 96, step: 2 },
790
- description: "Height of the icon in pixels",
791
- },
792
- stroke: {
793
- control: "color",
794
- description: "Stroke color of the star",
795
- },
796
- strokeWidth: {
797
- control: { type: "range", min: 0.5, max: 4, step: 0.5 },
798
- description: "Width of the stroke",
799
- },
800
91
  className: {
801
92
  control: "text",
802
- description: "CSS classes for styling",
93
+ description: "CSS classes including color token",
803
94
  },
804
- onClick: {
805
- action: "clicked",
806
- description: "Click handler for interactive use",
95
+ withAccessibility: {
96
+ control: "boolean",
97
+ description: "Wrap with accessibility label",
807
98
  },
808
99
  },
809
100
  }
@@ -811,207 +102,90 @@ function RatingStar() {
811
102
  export default meta
812
103
  type Story = StoryObj<typeof StarIcon>
813
104
 
814
- // Story parameters for consistent dark theme
815
- const storyParameters = {
816
- backgrounds: {
817
- default: "dark",
818
- values: [
819
- { name: "dark", value: "var(--color-fm-surface-primary)" },
820
- { name: "darker", value: "var(--color-fm-neutral-0)" },
821
- ],
822
- },
823
- }
824
-
825
105
  export const Default: Story = {
826
106
  args: {
827
107
  className: "h-6 w-6 text-fm-icon-warning",
828
108
  withAccessibility: true,
829
109
  },
830
- parameters: storyParameters,
831
110
  render: (args) => (
832
- <div className="from-fm-surface-primary to-fm-surface-secondary flex h-32 min-h-dvh items-center justify-center rounded-lg bg-linear-to-br">
111
+ <IconDefaultCanvas>
833
112
  <StarIcon {...args} />
834
- </div>
113
+ </IconDefaultCanvas>
835
114
  ),
836
115
  }
837
116
 
838
117
  export const SizeVariations: Story = {
839
- parameters: {
840
- ...storyParameters,
841
- docs: {
842
- description: {
843
- story:
844
- "StarIcon in different sizes, from small rating indicators to large action buttons.",
845
- },
846
- },
847
- },
848
- render: () => (
849
- <div className="from-fm-surface-primary to-fm-surface-secondary flex h-64 min-h-dvh items-center justify-center gap-8 rounded-lg bg-linear-to-br p-8">
850
- <div className="text-center">
851
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-3 w-3" />
852
- <span className="text-fm-tertiary text-xs">12px</span>
853
- </div>
854
- <div className="text-center">
855
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-4 w-4" />
856
- <span className="text-fm-tertiary text-xs">16px</span>
857
- </div>
858
- <div className="text-center">
859
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-5 w-5" />
860
- <span className="text-fm-tertiary text-xs">20px</span>
861
- </div>
862
- <div className="text-center">
863
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-6 w-6" />
864
- <span className="text-fm-tertiary text-xs">24px</span>
865
- </div>
866
- <div className="text-center">
867
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-8 w-8" />
868
- <span className="text-fm-tertiary text-xs">32px</span>
869
- </div>
870
- <div className="text-center">
871
- <StarIcon className="text-fm-icon-warning !mx-auto mb-2 h-12 w-12" />
872
- <span className="text-fm-tertiary text-xs">48px</span>
873
- </div>
874
- </div>
875
- ),
118
+ render: () => <IconSizeVariations icon={StarIcon} />,
876
119
  }
877
120
 
878
121
  export const ColorVariations: Story = {
879
- parameters: {
880
- ...storyParameters,
881
- docs: {
882
- description: {
883
- story: "StarIcon in different semantic colors for various use cases.",
884
- },
885
- },
886
- },
887
- render: () => (
888
- <div className="from-fm-surface-primary to-fm-surface-secondary grid min-h-dvh grid-cols-2 items-center justify-center gap-6 rounded-lg bg-linear-to-br p-8 md:grid-cols-4">
889
- <div className="text-center">
890
- <div className="border-fm-icon-warning/30 bg-fm-icon-warning/20 !mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border">
891
- <StarIcon className="text-fm-icon-warning h-8 w-8" />
892
- </div>
893
- <div className="text-fm-icon-active text-sm font-medium">
894
- Rating/Favorite
895
- </div>
896
- <div className="text-fm-icon-warning text-xs">text-fm-icon-warning</div>
897
- </div>
898
- <div className="text-center">
899
- <div className="border-fm-icon-warning/30 bg-fm-icon-warning/20 !mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border">
900
- <StarIcon className="text-fm-icon-warning h-8 w-8" />
901
- </div>
902
- <div className="text-fm-icon-active text-sm font-medium">
903
- Premium/Highlight
904
- </div>
905
- <div className="text-fm-icon-warning text-xs">text-fm-icon-warning</div>
906
- </div>
907
- <div className="text-center">
908
- <div className="border-fm-divider-primary bg-fm-surface-tertiary/20 !mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border">
909
- <StarIcon className="text-fm-placeholder h-8 w-8" />
910
- </div>
911
- <div className="text-fm-icon-active text-sm font-medium">
912
- Inactive/Empty
913
- </div>
914
- <div className="text-fm-placeholder text-xs">text-fm-placeholder</div>
915
- </div>
916
- <div className="text-center">
917
- <div className="border-fm-divider-secondary bg-fm-surface-secondary !mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border">
918
- <StarIcon className="text-fm-tertiary h-8 w-8" />
919
- </div>
920
- <div className="text-fm-icon-active text-sm font-medium">Muted</div>
921
- <div className="text-fm-tertiary text-xs">text-fm-tertiary</div>
922
- </div>
923
- </div>
924
- ),
122
+ render: () => <IconColorVariations icon={StarIcon} />,
925
123
  }
926
124
 
927
125
  export const UsageExamples: Story = {
928
- parameters: {
929
- ...storyParameters,
930
- docs: {
931
- description: {
932
- story:
933
- "Real-world usage examples showing StarIcon in different UI contexts.",
934
- },
935
- },
936
- },
937
126
  render: () => (
938
- <div className="from-fm-surface-primary to-fm-surface-secondary min-h-dvh !space-y-8 rounded-lg bg-linear-to-br p-8">
939
- {/* Rating System */}
940
- <div className="!space-y-2">
941
- <h3 className="text-fm-icon-active text-sm font-medium">
942
- Rating System
943
- </h3>
944
- <div className="flex gap-1">
945
- {[1, 2, 3, 4, 5].map((star) => (
946
- <button
947
- key={star}
948
- className="p-1 transition-transform hover:scale-110"
949
- >
950
- <StarIcon className="text-fm-icon-warning h-5 w-5" />
951
- </button>
952
- ))}
127
+ <IconUsageCanvas>
128
+ <IconUsageSection title="Rating Badge">
129
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary flex items-center gap-1.5 rounded-full border px-3 py-1">
130
+ <StarIcon className="text-fm-icon-warning h-3.5 w-3.5" />
131
+ <span className="text-fm-primary font-fm-text text-sm font-medium">
132
+ 4.8
133
+ </span>
953
134
  </div>
954
- </div>
135
+ </IconUsageSection>
955
136
 
956
- {/* Favorite Button */}
957
- <div className="!space-y-2">
958
- <h3 className="text-fm-icon-active text-sm font-medium">
959
- Favorite Button
960
- </h3>
961
- <div className="flex gap-4">
962
- <button className="border-fm-icon-warning/30 bg-fm-icon-warning/20 text-fm-icon-warning hover:bg-fm-icon-warning/30 flex items-center gap-2 rounded-lg border px-4 py-2 transition-colors">
963
- <StarIcon className="h-4 w-4" />
964
- Add to Favorites
965
- </button>
966
- <button className="hover:bg-fm-surface-secondary rounded-lg p-2 transition-colors">
967
- <StarIcon className="text-fm-icon-warning h-5 w-5" />
968
- </button>
969
- </div>
970
- </div>
971
-
972
- {/* Premium Feature */}
973
- <div className="!space-y-2">
974
- <h3 className="text-fm-icon-active text-sm font-medium">
975
- Premium Feature
976
- </h3>
977
- <div className="border-fm-icon-warning/30 bg-fm-icon-warning/10 rounded-lg border p-4">
137
+ <IconUsageSection title="Story Card Rating">
138
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary w-full max-w-sm rounded-xl border p-4">
978
139
  <div className="flex items-center gap-3">
979
- <StarIcon className="text-fm-icon-warning h-5 w-5" />
980
- <div>
981
- <h4 className="text-fm-icon-active font-medium">
982
- Premium Feature
983
- </h4>
984
- <p className="text-fm-secondary text-sm">
985
- Unlock advanced analytics
986
- </p>
140
+ <div className="bg-fm-divider-secondary h-14 w-14 shrink-0 rounded-xl" />
141
+ <div className="flex-1">
142
+ <div className="text-fm-primary font-fm-text text-sm font-medium">
143
+ The Crimson Throne
144
+ </div>
145
+ <div className="mt-1 flex items-center gap-1">
146
+ {[1, 2, 3, 4, 5].map((i) => (
147
+ <StarIcon
148
+ key={i}
149
+ className={`h-3 w-3 ${i <= 4 ? "text-fm-icon-warning" : "text-fm-icon-inactive"}`}
150
+ />
151
+ ))}
152
+ <span className="text-fm-secondary font-fm-text ml-1 text-xs">
153
+ 4.0
154
+ </span>
155
+ </div>
987
156
  </div>
988
157
  </div>
989
158
  </div>
990
- </div>
991
- </div>
159
+ </IconUsageSection>
160
+
161
+ <IconUsageSection title="Filled vs Empty">
162
+ <div className="flex gap-4">
163
+ <div className="flex flex-col items-center gap-1">
164
+ <StarIcon className="text-fm-icon-warning h-6 w-6" />
165
+ <span className="text-fm-secondary font-fm-text text-xs">
166
+ Rated
167
+ </span>
168
+ </div>
169
+ <div className="flex flex-col items-center gap-1">
170
+ <StarIcon className="text-fm-icon-inactive h-6 w-6" />
171
+ <span className="text-fm-secondary font-fm-text text-xs">
172
+ Unrated
173
+ </span>
174
+ </div>
175
+ </div>
176
+ </IconUsageSection>
177
+ </IconUsageCanvas>
992
178
  ),
993
179
  }
994
180
 
995
181
  export const Playground: Story = {
996
- parameters: {
997
- ...storyParameters,
998
- docs: {
999
- description: {
1000
- story:
1001
- "Interactive playground to experiment with different StarIcon configurations.",
1002
- },
1003
- },
1004
- },
1005
182
  args: {
1006
- width: 32,
1007
- height: 32,
1008
- className: "text-fm-icon-warning",
183
+ className: "h-8 w-8 text-fm-icon-warning",
184
+ withAccessibility: true,
1009
185
  },
1010
186
  render: (args) => (
1011
- <div className="from-fm-surface-primary to-fm-surface-secondary flex h-64 min-h-dvh items-center justify-center rounded-lg bg-linear-to-br">
1012
- <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-8">
1013
- <StarIcon {...args} />
1014
- </div>
1015
- </div>
187
+ <IconPlaygroundCanvas>
188
+ <StarIcon {...args} />
189
+ </IconPlaygroundCanvas>
1016
190
  ),
1017
191
  }