aural-ui 3.0.7 → 4.1.0

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