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,21 @@
1
1
  import React from "react"
2
2
  import type { Meta, StoryObj } from "@storybook/react-vite"
3
3
 
4
+ import { CrossCircleIcon } from "src/ui/icons/cross-circle-icon"
5
+ import { PlusIcon } from "src/ui/icons/plus-icon"
6
+ import { TickCircleIcon } from "src/ui/icons/tick-circle-icon"
7
+ import { TickIcon } from "src/ui/icons/tick-icon"
8
+ import {
9
+ IconColorVariations,
10
+ IconDefaultCanvas,
11
+ IconInteractiveStates,
12
+ IconPlaygroundCanvas,
13
+ IconSizeVariations,
14
+ IconUsageCanvas,
15
+ IconUsageSection,
16
+ } from "src/ui/story-spec/icons/icon-story-canvas"
17
+ import { AuralIconDocsPage } from "src/ui/story-spec/icons/icon-story-docs-page"
18
+
4
19
  import { CrossIcon } from "."
5
20
 
6
21
  const meta: Meta<typeof CrossIcon> = {
@@ -11,825 +26,75 @@ const meta: Meta<typeof CrossIcon> = {
11
26
  backgrounds: {
12
27
  default: "dark",
13
28
  values: [
14
- { name: "dark", value: "#0a0a0a" },
15
- { name: "darker", value: "#000000" },
16
- { name: "light", value: "#ffffff" },
29
+ { name: "dark", value: "var(--color-fm-surface-primary)" },
30
+ { name: "darker", value: "var(--color-fm-neutral-0)" },
31
+ { name: "light", value: "var(--color-fm-neutral-1100)" },
17
32
  ],
18
33
  },
19
34
  docs: {
20
35
  page: () => (
21
- <>
22
- {/* Override default docs styling */}
23
- <style>
24
- {`
25
- .sbdocs-wrapper {
26
- padding: 0 ;
27
- max-width: none ;
28
- background: transparent ;
29
- }
30
- .sbdocs-content {
31
- max-width: none ;
32
- padding: 0 ;
33
- margin: 0 ;
34
- background: transparent ;
35
- }
36
- .docs-story {
37
- background: transparent ;
38
- }
39
- .sbdocs {
40
- background: transparent ;
41
- }
42
- body {
43
- background: #0a0a0a ;
44
- }
45
- #storybook-docs {
46
- background: #0a0a0a ;
47
- }
48
- .sbdocs-preview {
49
- background: transparent ;
50
- border: none ;
51
- }
52
- .sbdocs-h1, .sbdocs-h2, .sbdocs-h3, .sbdocs-h4, .sbdocs-h5, .sbdocs-h6 {
53
- color: white ;
54
- }
55
- .sbdocs-p, .sbdocs-li {
56
- color: rgba(255, 255, 255, 0.7) ;
57
- }
58
- .sbdocs-code {
59
- background: rgba(255, 255, 255, 0.1) ;
60
- color: rgba(168, 85, 247, 1) ;
61
- border: 1px solid rgba(255, 255, 255, 0.1) ;
62
- }
63
- .sbdocs-pre {
64
- background: rgba(0, 0, 0, 0.4) ;
65
- border: 1px solid rgba(255, 255, 255, 0.1) ;
66
- }
67
- .sbdocs-table {
68
- background: rgba(255, 255, 255, 0.05) ;
69
- border: 1px solid rgba(255, 255, 255, 0.1) ;
70
- }
71
- .sbdocs-table th {
72
- background: rgba(255, 255, 255, 0.05) ;
73
- color: white ;
74
- border-bottom: 1px solid rgba(255, 255, 255, 0.1) ;
75
- }
76
- .sbdocs-table td {
77
- color: rgba(255, 255, 255, 0.7) ;
78
- border-bottom: 1px solid rgba(255, 255, 255, 0.05) ;
79
- }
80
- `}
81
- </style>
82
-
83
- <div className="min-h-screen bg-gradient-to-br from-gray-900 via-purple-900/20 to-gray-900">
84
- {/* Header */}
85
- <div className="relative overflow-hidden border-b border-white/10 bg-black/20 backdrop-blur-xl">
86
- <div className="absolute inset-0 bg-gradient-to-r from-slate-500/10 via-transparent to-gray-500/10" />
87
- <div className="relative !mx-auto max-w-7xl px-6 py-16">
88
- <div className="!space-y-6 text-center">
89
- <div className="!mx-auto flex h-24 w-24 items-center justify-center rounded-2xl border border-gray-500/30 bg-gradient-to-br from-gray-500/20 to-slate-500/20">
90
- <CrossIcon className="h-12 w-12 text-gray-400" />
91
- </div>
92
- <h1 className="!text-fm-primary text-5xl font-bold">
93
- CrossIcon
94
- </h1>
95
- <p className="!mx-auto max-w-3xl text-xl leading-relaxed !text-white/70">
96
- A clean and minimal cross icon for close buttons, modal
97
- dismissals, and general cancellation actions. Features a
98
- simple stroke design that works perfectly at any size. Built
99
- with accessibility in mind using Radix UI's AccessibleIcon
100
- wrapper.
101
- </p>
102
-
103
- {/* Stats */}
104
- <div className="flex items-center justify-center gap-8 pt-8">
105
- <div className="text-center">
106
- <div className="text-3xl font-bold text-gray-300">
107
- Accessible
108
- </div>
109
- <div className="text-sm text-white/60">
110
- Screen reader friendly
111
- </div>
112
- </div>
113
- <div className="h-8 w-px bg-white/20" />
114
- <div className="text-center">
115
- <div className="text-3xl font-bold text-slate-300">
116
- Minimal
117
- </div>
118
- <div className="text-sm text-white/60">
119
- Clean stroke design
120
- </div>
121
- </div>
122
- <div className="h-8 w-px bg-white/20" />
123
- <div className="text-center">
124
- <div className="text-3xl font-bold text-zinc-300">
125
- Versatile
126
- </div>
127
- <div className="text-sm text-white/60">
128
- Perfect at any size
129
- </div>
130
- </div>
131
- </div>
132
- </div>
133
- </div>
134
- </div>
135
-
136
- {/* Content */}
137
- <div className="!mx-auto max-w-7xl !space-y-16 px-6 py-12">
138
- {/* Quick Usage */}
139
- <div className="!space-y-8">
140
- <h2 className="text-center text-3xl font-bold !text-white">
141
- Quick Start
142
- </h2>
143
- <div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
144
- <div className="!space-y-4">
145
- <h3 className="text-xl font-semibold !text-gray-300">
146
- Basic Usage
147
- </h3>
148
- <div className="rounded-lg bg-black/40 p-4">
149
- <pre className="overflow-x-auto text-sm !text-green-300">
150
- {`import { CrossIcon } from "@icons/cross-icon"
36
+ <AuralIconDocsPage
37
+ accentToken="negative"
38
+ features={[
39
+ { title: "Close / Dismiss", description: "Remove or cancel items" },
40
+ { title: "currentColor", description: "Responds to text tokens" },
41
+ { title: "Accessible", description: "ARIA-ready by default" },
42
+ ]}
43
+ quickStart={{
44
+ codeExample: `import { CrossIcon } from "src/ui/icons/cross-icon"
151
45
 
152
46
  function CloseButton() {
153
47
  return (
154
- <button className="p-2 hover:bg-white/10 rounded-lg">
155
- <CrossIcon className="h-5 w-5 text-gray-400 " />
48
+ <button aria-label="Close">
49
+ <CrossIcon className="h-5 w-5 text-fm-icon-active" />
156
50
  </button>
157
51
  )
158
- }`}
159
- </pre>
160
- </div>
161
- </div>
162
-
163
- <div className="!space-y-4">
164
- <h3 className="text-xl font-semibold !text-gray-300">
165
- Live Preview
166
- </h3>
167
- <div className="flex h-32 items-center justify-center rounded-lg border border-white/10 bg-white/5">
168
- <button className="rounded-lg border border-white/20 bg-white/5 p-3 transition-colors hover:bg-white/10">
169
- <CrossIcon className="h-6 w-6 text-gray-300" />
170
- </button>
171
- </div>
172
- </div>
173
- </div>
174
- </div>
175
-
176
- {/* Props Documentation */}
177
- <div className="!space-y-8">
178
- <h2 className="text-center text-3xl font-bold !text-white">
179
- Props & Configuration
180
- </h2>
181
-
182
- <div className="overflow-hidden rounded-lg border border-white/10 bg-white/5">
183
- <div className="bg-white/5 p-4">
184
- <h3 className="text-xl font-semibold !text-white">Props</h3>
185
- </div>
186
- <table className="!my-0 w-full">
187
- <thead className="bg-white/5">
188
- <tr className="border-b border-white/10">
189
- <th className="px-6 py-4 text-left text-sm font-semibold !text-white">
190
- Prop
191
- </th>
192
- <th className="px-6 py-4 text-left text-sm font-semibold !text-white">
193
- Type
194
- </th>
195
- <th className="px-6 py-4 text-left text-sm font-semibold !text-white">
196
- Default
197
- </th>
198
- <th className="px-6 py-4 text-left text-sm font-semibold !text-white">
199
- Description
200
- </th>
201
- </tr>
202
- </thead>
203
- <tbody>
204
- {" "}
205
- <tr className="!bg-black/10">
206
- <td className="px-6 py-4 font-mono text-sm !text-blue-300">
207
- withAccessibility
208
- </td>
209
- <td className="px-6 py-4 text-sm !text-white/70">
210
- boolean
211
- </td>
212
- <td className="px-6 py-4 text-sm !text-white/50">
213
- true
214
- </td>
215
- <td className="px-6 py-4 text-sm !text-white/70">
216
- Whether to wrap the icon with accessibility feature
217
- </td>
218
- </tr>
219
- <tr className="border-b border-white/5 !bg-black/10">
220
- <td className="px-6 py-4 font-mono text-sm !text-gray-300">
221
- height
222
- </td>
223
- <td className="px-6 py-4 text-sm !text-white/70">
224
- number | string
225
- </td>
226
- <td className="px-6 py-4 text-sm !text-white/50">20</td>
227
- <td className="px-6 py-4 text-sm !text-white/70">
228
- Height of the icon in pixels
229
- </td>
230
- </tr>
231
- <tr className="border-b border-white/5">
232
- <td className="px-6 py-4 font-mono text-sm !text-gray-300">
233
- stroke
234
- </td>
235
- <td className="px-6 py-4 text-sm !text-white/70">
236
- string
237
- </td>
238
- <td className="px-6 py-4 text-sm !text-white/50">
239
- currentColor
240
- </td>
241
- <td className="px-6 py-4 text-sm !text-white/70">
242
- Stroke color of the icon
243
- </td>
244
- </tr>
245
- <tr className="border-b border-white/5 !bg-black/10">
246
- <td className="px-6 py-4 font-mono text-sm !text-gray-300">
247
- strokeWidth
248
- </td>
249
- <td className="px-6 py-4 text-sm !text-white/70">
250
- string | number
251
- </td>
252
- <td className="px-6 py-4 text-sm !text-white/50">
253
- 1.5
254
- </td>
255
- <td className="px-6 py-4 text-sm !text-white/70">
256
- Width of the stroke
257
- </td>
258
- </tr>
259
- <tr className="border-b border-white/5">
260
- <td className="px-6 py-4 font-mono text-sm !text-gray-300">
261
- className
262
- </td>
263
- <td className="px-6 py-4 text-sm !text-white/70">
264
- string
265
- </td>
266
- <td className="px-6 py-4 text-sm !text-white/50">-</td>
267
- <td className="px-6 py-4 text-sm !text-white/70">
268
- CSS classes for styling (use for overrides)
269
- </td>
270
- </tr>
271
- <tr className="!bg-black/10">
272
- <td className="px-6 py-4 font-mono text-sm !text-gray-300">
273
- ...svgProps
274
- </td>
275
- <td className="px-6 py-4 text-sm !text-white/70">
276
- SVGProps
277
- </td>
278
- <td className="px-6 py-4 text-sm !text-white/50">-</td>
279
- <td className="px-6 py-4 text-sm !text-white/70">
280
- All standard SVG element props
281
- </td>
282
- </tr>
283
- </tbody>
284
- </table>
285
- </div>
286
- </div>
287
-
288
- {/* Size Variations */}
289
- <div className="!space-y-8">
290
- <h2 className="text-center text-3xl font-bold !text-white">
291
- Size Variations
292
- </h2>
293
- <div className="rounded-lg border border-white/10 bg-white/5 p-8">
294
- <div className="!space-y-6">
295
- <div className="grid grid-cols-1 gap-8 md:grid-cols-2">
296
- <div className="!space-y-4">
297
- <h3 className="text-lg font-semibold !text-gray-300">
298
- Standard Sizes
299
- </h3>
300
- <div className="flex items-end gap-6 rounded-lg bg-black/20 p-6">
301
- <div className="text-center">
302
- <CrossIcon className="!mx-auto mb-2 h-3 w-3 text-gray-400" />
303
- <span className="text-xs text-white/60">12px</span>
304
- </div>
305
- <div className="text-center">
306
- <CrossIcon className="!mx-auto mb-2 h-4 w-4 text-gray-400" />
307
- <span className="text-xs text-white/60">16px</span>
308
- </div>
309
- <div className="text-center">
310
- <CrossIcon className="!mx-auto mb-2 h-5 w-5 text-gray-400" />
311
- <span className="text-xs text-white/60">20px</span>
312
- </div>
313
- <div className="text-center">
314
- <CrossIcon className="!mx-auto mb-2 h-6 w-6 text-gray-400" />
315
- <span className="text-xs text-white/60">24px</span>
316
- </div>
317
- <div className="text-center">
318
- <CrossIcon className="!mx-auto mb-2 h-8 w-8 text-gray-400" />
319
- <span className="text-xs text-white/60">32px</span>
320
- </div>
321
- <div className="text-center">
322
- <CrossIcon className="!mx-auto mb-2 h-12 w-12 text-gray-400" />
323
- <span className="text-xs text-white/60">48px</span>
324
- </div>
325
- </div>
326
- </div>
327
-
328
- <div className="!space-y-4">
329
- <h3 className="text-lg font-semibold !text-gray-300">
330
- Code Example
331
- </h3>
332
- <div className="rounded-lg bg-black/40 p-4">
333
- <pre className="overflow-x-auto text-sm !text-cyan-300">
334
- {`// Small (16px)
335
- <CrossIcon className="h-4 w-4 " />
336
-
337
- // Medium (24px)
338
- <CrossIcon className="h-6 w-6 " />
339
-
340
- // Large (32px)
341
- <CrossIcon className="h-8 w-8 " />
342
-
343
- // Custom size
344
- <CrossIcon width={40} height={40} />`}
345
- </pre>
346
- </div>
347
- </div>
348
- </div>
349
- </div>
350
- </div>
351
- </div>
352
-
353
- {/* Color Variations */}
354
- <div className="!space-y-8">
355
- <h2 className="text-center text-3xl font-bold !text-white">
356
- Color Variations
357
- </h2>
358
- <div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
359
- <div className="!space-y-4">
360
- <h3 className="text-lg font-semibold !text-gray-300">
361
- Semantic Colors
362
- </h3>
363
- <div className="!space-y-4 rounded-lg border border-white/10 bg-white/5 p-6">
364
- <div className="flex items-center gap-4">
365
- <CrossIcon className="h-6 w-6 text-gray-400" />
366
- <div>
367
- <div className="text-sm font-medium text-white">
368
- Default / Neutral
369
- </div>
370
- <div className="text-xs text-white/60">
371
- text-gray-400
372
- </div>
373
- </div>
374
- </div>
375
- <div className="flex items-center gap-4">
376
- <CrossIcon className="h-6 w-6 text-red-400" />
377
- <div>
378
- <div className="text-sm font-medium text-white">
379
- Close / Error
380
- </div>
381
- <div className="text-xs text-white/60">
382
- text-red-400
383
- </div>
384
- </div>
385
- </div>
386
- <div className="flex items-center gap-4">
387
- <CrossIcon className="h-6 w-6 text-white/60" />
388
- <div>
389
- <div className="text-sm font-medium text-white">
390
- Muted
391
- </div>
392
- <div className="text-xs text-white/60">
393
- text-white/60
394
- </div>
395
- </div>
396
- </div>
397
- <div className="flex items-center gap-4">
398
- <CrossIcon className="h-6 w-6 text-slate-300" />
399
- <div>
400
- <div className="text-sm font-medium text-white">
401
- Light
402
- </div>
403
- <div className="text-xs text-white/60">
404
- text-slate-300
405
- </div>
406
- </div>
407
- </div>
408
- </div>
409
- </div>
410
-
411
- <div className="!space-y-4">
412
- <h3 className="text-lg font-semibold !text-gray-300">
413
- Custom Colors
414
- </h3>
415
- <div className="rounded-lg bg-black/40 p-4">
416
- <pre className="overflow-x-auto text-sm !text-green-300">
417
- {`// Using Tailwind classes with
418
- <CrossIcon className="h-6 w-6 text-gray-400 " />
419
- <CrossIcon className="h-6 w-6 text-red-500 " />
420
-
421
- // Using CSS custom properties
422
- <CrossIcon
423
- className="h-6 w-6 "
424
- style={{ color: 'var(--color-text-secondary)' }}
425
- />
426
-
427
- // Direct stroke prop
428
- <CrossIcon
429
- width={24}
430
- height={24}
431
- stroke="#6b7280"
432
- />`}
433
- </pre>
434
- </div>
435
- </div>
436
- </div>
437
- </div>
438
-
439
- {/* Usage Examples */}
440
- <div className="!space-y-8">
441
- <h2 className="text-center text-3xl font-bold !text-white">
442
- Usage Examples
443
- </h2>
444
-
445
- <div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
446
- {/* Modal Close Button */}
447
- <div className="!space-y-4">
448
- <h3 className="text-lg font-semibold !text-gray-300">
449
- Modal Close Button
450
- </h3>
451
- <div className="!space-y-4">
452
- <div className="rounded-lg border border-white/10 bg-white/5 p-6">
453
- <div className="mb-4 flex items-center justify-between">
454
- <h3 className="text-lg font-semibold !text-white">
455
- Settings
456
- </h3>
457
- <button className="rounded-lg p-2 transition-colors hover:bg-white/10">
458
- <CrossIcon className="h-5 w-5 text-gray-400" />
459
- </button>
460
- </div>
461
- <p className="mb-4 !text-white/70">
462
- Configure your application preferences and settings.
463
- </p>
464
- <div className="flex gap-3">
465
- <button className="rounded-lg border border-blue-500/30 bg-blue-500/20 px-4 py-2 text-blue-200">
466
- Save Changes
467
- </button>
468
- <button className="rounded-lg border border-white/20 bg-white/10 px-4 py-2 text-white">
469
- Cancel
470
- </button>
471
- </div>
472
- </div>
473
- <div className="rounded-lg bg-black/40 p-4">
474
- <pre className="overflow-x-auto text-sm !text-green-300">
475
- {`// Modal header with close button
476
- <div className="flex items-center justify-between mb-4">
477
- <h3 className="text-lg font-semibold text-white">Settings</h3>
478
- <button
479
- className="p-2 hover:bg-white/10 rounded-lg transition-colors"
480
- onClick={onClose}
481
- >
482
- <CrossIcon className="h-5 w-5 text-gray-400 " />
483
- </button>
484
- </div>`}
485
- </pre>
486
- </div>
487
- </div>
488
- </div>
489
-
490
- {/* Navigation Menu Close */}
491
- <div className="!space-y-4">
492
- <h3 className="text-lg font-semibold !text-gray-300">
493
- Navigation Menu Close
494
- </h3>
495
- <div className="!space-y-4">
496
- <div className="rounded-lg border border-white/10 bg-white/5 p-4">
497
- <div className="mb-4 flex items-center justify-between border-b border-white/10 pb-4">
498
- <h4 className="font-medium !text-white">Menu</h4>
499
- <button className="rounded p-1.5 hover:bg-white/10">
500
- <CrossIcon className="h-4 w-4 text-gray-300" />
501
- </button>
502
- </div>
503
- <nav className="space-y-2">
504
- <a
505
- href="#"
506
- className="block rounded px-3 py-2 text-white hover:bg-white/10"
507
- >
508
- Dashboard
509
- </a>
510
- <a
511
- href="#"
512
- className="block rounded px-3 py-2 text-white hover:bg-white/10"
513
- >
514
- Profile
515
- </a>
516
- <a
517
- href="#"
518
- className="block rounded px-3 py-2 text-white hover:bg-white/10"
519
- >
520
- Settings
521
- </a>
522
- </nav>
523
- </div>
524
- <div className="rounded-lg bg-black/40 p-4">
525
- <pre className="overflow-x-auto text-sm !text-green-300">
526
- {`// Mobile menu with close button
527
- <div className="flex items-center justify-between border-b pb-4 mb-4">
528
- <h4 className="font-medium text-white">Menu</h4>
529
- <button
530
- className="p-1.5 hover:bg-white/10 rounded"
531
- onClick={closeMenu}
532
- >
533
- <CrossIcon className="h-4 w-4 text-gray-300 " />
534
- </button>
535
- </div>`}
536
- </pre>
537
- </div>
538
- </div>
539
- </div>
540
-
541
- {/* Search Clear Button */}
542
- <div className="!space-y-4">
543
- <h3 className="text-lg font-semibold !text-gray-300">
544
- Search Clear Button
545
- </h3>
546
- <div className="!space-y-4">
547
- <div className="!space-y-2">
548
- <label className="text-sm font-medium !text-white">
549
- Search
550
- </label>
551
- <div className="relative">
552
- <input
553
- type="text"
554
- className="w-full rounded-lg border border-white/20 bg-white/5 px-3 py-2 pr-10 !text-white placeholder-white/50 focus:border-gray-400 focus:ring-2 focus:ring-gray-400/20"
555
- placeholder="Search..."
556
- defaultValue="Sample query"
557
- />
558
- <button className="absolute top-1/2 right-3 -translate-y-1/2 rounded p-0.5 hover:bg-white/10">
559
- <CrossIcon className="h-4 w-4 text-gray-400" />
560
- </button>
561
- </div>
562
- </div>
563
- <div className="rounded-lg bg-black/40 p-4">
564
- <pre className="overflow-x-auto text-sm !text-green-300">
565
- {`// Search input with clear button
566
- <div className="relative">
567
- <input
568
- type="text"
569
- className="w-full pr-10 border border-white/20 bg-white/5 px-3 py-2 rounded-lg"
570
- placeholder="Search..."
571
- value={searchQuery}
572
- onChange={(e) => setSearchQuery(e.target.value)}
573
- />
574
- <button
575
- className="absolute right-3 top-1/2 -translate-y-1/2 p-0.5 hover:bg-white/10 rounded"
576
- onClick={() => setSearchQuery('')}
577
- >
578
- <CrossIcon className="h-4 w-4 text-gray-400 " />
579
- </button>
580
- </div>`}
581
- </pre>
582
- </div>
583
- </div>
584
- </div>
585
-
586
- {/* Tab Close Button */}
587
- <div className="!space-y-4">
588
- <h3 className="text-lg font-semibold !text-gray-300">
589
- Tab Close Button
590
- </h3>
591
- <div className="!space-y-4">
592
- <div className="flex border-b border-white/10">
593
- <div className="flex items-center gap-2 border-b-2 border-blue-400 px-4 py-2 text-blue-200">
594
- <span>Component.tsx</span>
595
- <button className="rounded p-0.5 hover:bg-blue-500/20">
596
- <CrossIcon className="h-3 w-3 text-blue-300" />
597
- </button>
598
- </div>
599
- <div className="flex items-center gap-2 px-4 py-2 text-white/60 hover:text-white">
600
- <span>utils.ts</span>
601
- <button className="rounded p-0.5 opacity-0 group-hover:opacity-100 hover:bg-white/10">
602
- <CrossIcon className="h-3 w-3 text-gray-400" />
603
- </button>
604
- </div>
605
- </div>
606
- <div className="rounded-lg bg-black/40 p-4">
607
- <pre className="overflow-x-auto text-sm !text-green-300">
608
- {`// Closable tab component
609
- <div className="flex items-center gap-2 border-b-2 border-blue-400 px-4 py-2">
610
- <span>Component.tsx</span>
611
- <button
612
- className="p-0.5 hover:bg-blue-500/20 rounded"
613
- onClick={() => closeTab(tabId)}
614
- >
615
- <CrossIcon className="h-3 w-3 text-blue-300 " />
616
- </button>
617
- </div>`}
618
- </pre>
619
- </div>
620
- </div>
621
- </div>
622
- </div>
623
- </div>
624
-
625
- {/* Accessibility */}
626
- <div className="!space-y-8">
627
- <h2 className="text-center text-3xl font-bold !text-white">
628
- Accessibility Features
629
- </h2>
630
- <div className="grid grid-cols-1 gap-8 md:grid-cols-2">
631
- <div className="!space-y-4 rounded-lg border border-white/10 bg-white/5 p-6">
632
- <h3 className="text-lg font-semibold !text-green-300">
633
- ✅ Built-in Features
634
- </h3>
635
- <ul className="!space-y-2 text-sm !text-white/70">
636
- <li className="!text-white/70">
637
- Uses Radix UI AccessibleIcon wrapper
638
- </li>
639
- <li className="!text-white/70">
640
- Provides screen reader label "Cross icon"
641
- </li>
642
- <li className="!text-white/70">
643
- Supports keyboard navigation when interactive
644
- </li>
645
- <li className="!text-white/70">
646
- Maintains proper color contrast ratios
647
- </li>
648
- <li className="!text-white/70">
649
- Scales with user's font size preferences
650
- </li>
651
- </ul>
652
- </div>
653
-
654
- <div className="!space-y-4 rounded-lg border border-white/10 bg-white/5 p-6">
655
- <h3 className="text-lg font-semibold !text-gray-300">
656
- 💡 Best Practices
657
- </h3>
658
- <ul className="!space-y-2 text-sm text-white/70">
659
- <li className="!text-white/70">
660
- Always provide proper button labels for close actions
661
- </li>
662
- <li className="!text-white/70">
663
- Use consistent placement for close buttons
664
- </li>
665
- <li className="!text-white/70">
666
- Ensure sufficient touch target size (44px minimum)
667
- </li>
668
- <li className="!text-white/70">
669
- Provide visible focus states for keyboard users
670
- </li>
671
- <li className="!text-white/70">
672
- Consider escape key functionality for modals
673
- </li>
674
- </ul>
675
- </div>
676
- </div>
677
-
678
- <div className="rounded-lg border border-white/10 bg-white/5 p-6">
679
- <h3 className="mb-4 text-lg font-semibold !text-purple-300">
680
- Proper ARIA Implementation
681
- </h3>
682
- <div className="grid grid-cols-1 gap-6 lg:grid-cols-2">
683
- <div className="rounded-lg bg-black/40 p-4">
684
- <pre className="overflow-x-auto text-sm !text-cyan-300">
685
- {`// Close button with proper ARIA
686
- <button
687
- aria-label="Close modal"
688
- className="p-2 hover:bg-white/10 rounded"
689
- onClick={onClose}
690
- >
691
- <CrossIcon className="h-5 w-5 text-gray-400 " />
692
- </button>
693
-
694
- // Clear input with ARIA
695
- <button
696
- aria-label="Clear search"
697
- className="absolute right-3 top-1/2 -translate-y-1/2"
698
- onClick={clearSearch}
699
- >
700
- <CrossIcon className="h-4 w-4 text-gray-400 " />
701
- </button>
702
-
703
- // Tab close with ARIA
704
- <button
705
- aria-label={\`Close \${tabName} tab\`}
706
- onClick={() => closeTab(tabId)}
707
- >
708
- <CrossIcon className="h-3 w-3 text-gray-400 " />
709
- </button>`}
710
- </pre>
711
- </div>
712
- <div className="!space-y-4">
713
- <p className="text-sm !text-white/70">
714
- When using CrossIcon for interactive elements, always
715
- provide descriptive aria-label attributes that explain
716
- the specific action being performed.
717
- </p>
718
- <div className="rounded-lg border border-gray-500/20 bg-gray-500/10 p-4">
719
- <div className="flex items-center gap-2 text-sm text-gray-200">
720
- <CrossIcon className="h-4 w-4" />
721
- <span>
722
- Screen readers need context about what will be
723
- closed
724
- </span>
725
- </div>
726
- </div>
727
- </div>
728
- </div>
729
- </div>
730
- </div>
731
-
732
- {/* Related Icons */}
733
- <div className="!space-y-8">
734
- <h2 className="text-center text-3xl font-bold !text-white">
735
- Related Icons
736
- </h2>
737
- <div className="grid grid-cols-2 gap-6 md:grid-cols-4">
738
- <div className="!space-y-3 rounded-lg border border-white/10 bg-white/5 p-4 text-center">
739
- <div className="!mx-auto flex h-12 w-12 items-center justify-center rounded-lg bg-red-500/20">
740
- <span className="!text-2xl !text-white">⊗</span>
741
- </div>
742
- <div>
743
- <div className="font-medium text-white">
744
- CrossCircleIcon
745
- </div>
746
- <div className="text-xs text-white/60">
747
- Cross with circle
748
- </div>
749
- </div>
750
- </div>
751
- <div className="!space-y-3 rounded-lg border border-white/10 bg-white/5 p-4 text-center">
752
- <div className="!mx-auto flex h-12 w-12 items-center justify-center rounded-lg bg-gray-500/20">
753
- <span className="!text-2xl !text-white">−</span>
754
- </div>
755
- <div>
756
- <div className="font-medium text-white">MinusIcon</div>
757
- <div className="text-xs text-white/60">Minimize</div>
758
- </div>
759
- </div>
760
- <div className="!space-y-3 rounded-lg border border-white/10 bg-white/5 p-4 text-center">
761
- <div className="!mx-auto flex h-12 w-12 items-center justify-center rounded-lg bg-orange-500/20">
762
- <span className="!text-2xl !text-white">⚠</span>
763
- </div>
764
- <div>
765
- <div className="font-medium text-white">AlertIcon</div>
766
- <div className="text-xs text-white/60">
767
- Warning states
768
- </div>
769
- </div>
770
- </div>
771
- <div className="!space-y-3 rounded-lg border border-white/10 bg-white/5 p-4 text-center">
772
- <div className="!mx-auto flex h-12 w-12 items-center justify-center rounded-lg bg-blue-500/20">
773
- <span className="!text-2xl !text-white">ℹ</span>
774
- </div>
775
- <div>
776
- <div className="font-medium text-white">InfoIcon</div>
777
- <div className="text-xs text-white/60">Information</div>
778
- </div>
779
- </div>
780
- </div>
781
- </div>
782
- </div>
783
-
784
- {/* Footer */}
785
- <div className="border-t border-white/10 bg-black/20 backdrop-blur-xl">
786
- <div className="!mx-auto max-w-7xl px-6 py-8">
787
- <div className="!space-y-4 text-center">
788
- <p className="!text-white/60">
789
- CrossIcon is part of the Aural UI icon library, built with
790
- simplicity and accessibility in mind.
791
- </p>
792
- <p className="text-sm !text-white/40">
793
- All icons use Radix UI's AccessibleIcon for screen reader
794
- compatibility and follow WCAG guidelines.
795
- </p>
796
- </div>
797
- </div>
798
- </div>
799
- </div>
800
- </>
52
+ }`,
53
+ livePreview: (
54
+ <button className="bg-fm-surface-secondary border-fm-divider-secondary rounded-lg border p-2">
55
+ <CrossIcon className="text-fm-icon-active h-5 w-5" />
56
+ </button>
57
+ ),
58
+ }}
59
+ relatedIcons={[
60
+ {
61
+ name: "CrossCircleIcon",
62
+ description: "Filled cross circle",
63
+ icon: CrossCircleIcon,
64
+ accentToken: "negative",
65
+ },
66
+ {
67
+ name: "TickIcon",
68
+ description: "Confirm action",
69
+ icon: TickIcon,
70
+ accentToken: "positive",
71
+ },
72
+ {
73
+ name: "TickCircleIcon",
74
+ description: "Filled tick circle",
75
+ icon: TickCircleIcon,
76
+ accentToken: "info",
77
+ },
78
+ {
79
+ name: "PlusIcon",
80
+ description: "Add new item",
81
+ icon: PlusIcon,
82
+ accentToken: "warning",
83
+ },
84
+ ]}
85
+ />
801
86
  ),
802
87
  },
803
88
  },
804
89
  tags: ["autodocs"],
805
90
  argTypes: {
806
- width: {
807
- control: { type: "range", min: 8, max: 96, step: 2 },
808
- description: "Width of the icon in pixels",
809
- },
810
- withAccessibility: {
811
- control: "boolean",
812
- description: "Whether to wrap the icon with accessibility features",
813
- },
814
- height: {
815
- control: { type: "range", min: 8, max: 96, step: 2 },
816
- description: "Height of the icon in pixels",
817
- },
818
- stroke: {
819
- control: "color",
820
- description: "Stroke color of the icon",
821
- },
822
- strokeWidth: {
823
- control: { type: "range", min: 0.5, max: 4, step: 0.5 },
824
- description: "Width of the stroke",
825
- },
826
91
  className: {
827
92
  control: "text",
828
- description: "CSS classes for styling (use for overrides)",
93
+ description: "CSS classes including color token",
829
94
  },
830
- onClick: {
831
- action: "clicked",
832
- description: "Click handler for interactive use",
95
+ withAccessibility: {
96
+ control: "boolean",
97
+ description: "Wrap with accessibility label",
833
98
  },
834
99
  },
835
100
  }
@@ -837,199 +102,113 @@ function CloseButton() {
837
102
  export default meta
838
103
  type Story = StoryObj<typeof CrossIcon>
839
104
 
840
- // Story parameters for consistent dark theme
841
- const storyParameters = {
842
- backgrounds: {
843
- default: "dark",
844
- values: [
845
- { name: "dark", value: "#0a0a0a" },
846
- { name: "darker", value: "#000000" },
847
- ],
848
- },
849
- }
850
-
851
105
  export const Default: Story = {
852
106
  args: {
853
- className: "h-6 w-6 text-gray-400 ",
107
+ className: "h-6 w-6 text-fm-icon-active",
854
108
  withAccessibility: true,
855
109
  },
856
- parameters: storyParameters,
857
110
  render: (args) => (
858
- <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>
859
112
  <CrossIcon {...args} />
860
- </div>
113
+ </IconDefaultCanvas>
861
114
  ),
862
115
  }
863
116
 
864
117
  export const SizeVariations: Story = {
865
- parameters: {
866
- ...storyParameters,
867
- docs: {
868
- description: {
869
- story:
870
- "CrossIcon in different sizes, from small UI elements to large displays.",
871
- },
872
- },
873
- },
874
- render: () => (
875
- <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">
876
- <div className="text-center">
877
- <CrossIcon className="!mx-auto mb-2 h-3 w-3 text-gray-400" />
878
- <span className="text-xs text-white/60">12px</span>
879
- </div>
880
- <div className="text-center">
881
- <CrossIcon className="!mx-auto mb-2 h-4 w-4 text-gray-400" />
882
- <span className="text-xs text-white/60">16px</span>
883
- </div>
884
- <div className="text-center">
885
- <CrossIcon className="!mx-auto mb-2 h-5 w-5 text-gray-400" />
886
- <span className="text-xs text-white/60">20px</span>
887
- </div>
888
- <div className="text-center">
889
- <CrossIcon className="!mx-auto mb-2 h-6 w-6 text-gray-400" />
890
- <span className="text-xs text-white/60">24px</span>
891
- </div>
892
- <div className="text-center">
893
- <CrossIcon className="!mx-auto mb-2 h-8 w-8 text-gray-400" />
894
- <span className="text-xs text-white/60">32px</span>
895
- </div>
896
- <div className="text-center">
897
- <CrossIcon className="!mx-auto mb-2 h-12 w-12 text-gray-400" />
898
- <span className="text-xs text-white/60">48px</span>
899
- </div>
900
- </div>
901
- ),
118
+ render: () => <IconSizeVariations icon={CrossIcon} />,
902
119
  }
903
120
 
904
121
  export const ColorVariations: Story = {
905
- parameters: {
906
- ...storyParameters,
907
- docs: {
908
- description: {
909
- story: "CrossIcon in different semantic colors for various use cases.",
910
- },
911
- },
912
- },
122
+ render: () => <IconColorVariations icon={CrossIcon} />,
123
+ }
124
+
125
+ export const InteractiveStates: Story = {
913
126
  render: () => (
914
- <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">
915
- <div className="text-center">
916
- <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">
917
- <CrossIcon className="h-8 w-8 text-gray-400" />
918
- </div>
919
- <div className="text-sm font-medium text-white">Default</div>
920
- <div className="text-xs text-gray-400">text-gray-400</div>
921
- </div>
922
- <div className="text-center">
923
- <div className="!mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border border-red-500/30 bg-red-500/20">
924
- <CrossIcon className="h-8 w-8 text-red-400" />
925
- </div>
926
- <div className="text-sm font-medium text-white">Close/Error</div>
927
- <div className="text-xs text-red-400">text-red-400</div>
928
- </div>
929
- <div className="text-center">
930
- <div className="!mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border border-white/10 bg-white/5">
931
- <CrossIcon className="h-8 w-8 text-white/60" />
932
- </div>
933
- <div className="text-sm font-medium text-white">Muted</div>
934
- <div className="text-xs text-white/60">text-white/60</div>
935
- </div>
936
- <div className="text-center">
937
- <div className="!mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border border-slate-500/30 bg-slate-500/20">
938
- <CrossIcon className="h-8 w-8 text-slate-300" />
939
- </div>
940
- <div className="text-sm font-medium text-white">Light</div>
941
- <div className="text-xs text-slate-300">text-slate-300</div>
942
- </div>
943
- </div>
127
+ <IconInteractiveStates
128
+ icon={CrossIcon}
129
+ states={[
130
+ {
131
+ label: "Active",
132
+ className: "h-8 w-8 text-fm-icon-active",
133
+ description: "Default close",
134
+ },
135
+ {
136
+ label: "Negative",
137
+ className: "h-8 w-8 text-fm-icon-negative",
138
+ description: "Destructive action",
139
+ },
140
+ {
141
+ label: "Inactive",
142
+ className: "h-8 w-8 text-fm-icon-inactive",
143
+ description: "Disabled state",
144
+ },
145
+ ]}
146
+ />
944
147
  ),
945
148
  }
946
149
 
947
150
  export const UsageExamples: Story = {
948
- parameters: {
949
- ...storyParameters,
950
- docs: {
951
- description: {
952
- story:
953
- "Real-world usage examples showing CrossIcon in different UI contexts.",
954
- },
955
- },
956
- },
957
151
  render: () => (
958
- <div className="min-h-dvh !space-y-8 rounded-lg bg-gradient-to-br from-gray-900 to-gray-800 p-8">
959
- {/* Modal Close Button */}
960
- <div className="!space-y-2">
961
- <h3 className="text-sm font-medium text-white">Modal Close Button</h3>
962
- <div className="rounded-lg border border-white/10 bg-white/5 p-6">
963
- <div className="mb-4 flex items-center justify-between">
964
- <h3 className="text-lg font-semibold text-white">Settings</h3>
965
- <button className="rounded-lg p-2 transition-colors hover:bg-white/10">
966
- <CrossIcon className="h-5 w-5 text-gray-400" />
152
+ <IconUsageCanvas>
153
+ <IconUsageSection title="Modal Close Button">
154
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary w-full max-w-sm rounded-xl border p-4">
155
+ <div className="flex items-center justify-between">
156
+ <span className="text-fm-primary font-fm-text text-sm font-medium">
157
+ Dialog title
158
+ </span>
159
+ <button
160
+ className="hover:bg-fm-surface-secondary rounded-lg p-1"
161
+ aria-label="Close dialog"
162
+ >
163
+ <CrossIcon className="text-fm-icon-active h-5 w-5" />
967
164
  </button>
968
165
  </div>
969
- <p className="text-white/70">
970
- Configure your application preferences and settings.
166
+ <p className="text-fm-secondary font-fm-text mt-2 text-sm">
167
+ Dialog content goes here.
971
168
  </p>
972
169
  </div>
973
- </div>
170
+ </IconUsageSection>
171
+
172
+ <IconUsageSection title="Dismissible Tag">
173
+ <div className="flex flex-wrap gap-2">
174
+ {["Design", "Audio", "Podcast"].map((tag) => (
175
+ <div
176
+ key={tag}
177
+ className="border-fm-divider-secondary bg-fm-surface-secondary font-fm-text flex items-center gap-1.5 rounded-full border px-3 py-1 text-sm"
178
+ >
179
+ <span className="text-fm-primary">{tag}</span>
180
+ <button aria-label={`Remove ${tag}`}>
181
+ <CrossIcon className="text-fm-icon-inactive h-3 w-3" />
182
+ </button>
183
+ </div>
184
+ ))}
185
+ </div>
186
+ </IconUsageSection>
974
187
 
975
- {/* Search Clear Button */}
976
- <div className="!space-y-2">
977
- <h3 className="text-sm font-medium text-white">Search Clear Button</h3>
978
- <div className="relative">
188
+ <IconUsageSection title="Clear Input">
189
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary flex w-full max-w-sm items-center gap-2 rounded-xl border px-4 py-3">
979
190
  <input
980
191
  type="text"
981
- className="w-full rounded-lg border border-white/20 bg-white/5 px-3 py-2 pr-10 text-white placeholder-white/50 focus:border-gray-400 focus:ring-2 focus:ring-gray-400/20"
982
- placeholder="Search..."
983
- defaultValue="Sample query"
192
+ defaultValue="Search query..."
193
+ className="text-fm-primary font-fm-text flex-1 bg-transparent text-sm outline-none"
984
194
  />
985
- <button className="absolute top-1/2 right-3 -translate-y-1/2 rounded p-0.5 hover:bg-white/10">
986
- <CrossIcon className="h-4 w-4 text-gray-400" />
195
+ <button aria-label="Clear search">
196
+ <CrossIcon className="text-fm-icon-inactive h-4 w-4" />
987
197
  </button>
988
198
  </div>
989
- </div>
990
-
991
- {/* Tab Close Button */}
992
- <div className="!space-y-2">
993
- <h3 className="text-sm font-medium text-white">Tab Close Button</h3>
994
- <div className="flex border-b border-white/10">
995
- <div className="flex items-center gap-2 border-b-2 border-blue-400 px-4 py-2 text-blue-200">
996
- <span>Component.tsx</span>
997
- <button className="rounded p-0.5 hover:bg-blue-500/20">
998
- <CrossIcon className="h-3 w-3 text-blue-300" />
999
- </button>
1000
- </div>
1001
- <div className="flex items-center gap-2 px-4 py-2 text-white/60 hover:text-white">
1002
- <span>utils.ts</span>
1003
- <button className="rounded p-0.5 opacity-60 hover:bg-white/10 hover:opacity-100">
1004
- <CrossIcon className="h-3 w-3 text-gray-400" />
1005
- </button>
1006
- </div>
1007
- </div>
1008
- </div>
1009
- </div>
199
+ </IconUsageSection>
200
+ </IconUsageCanvas>
1010
201
  ),
1011
202
  }
1012
203
 
1013
204
  export const Playground: Story = {
1014
- parameters: {
1015
- ...storyParameters,
1016
- docs: {
1017
- description: {
1018
- story:
1019
- "Interactive playground to experiment with different CrossIcon configurations.",
1020
- },
1021
- },
1022
- },
1023
205
  args: {
1024
- width: 32,
1025
- height: 32,
1026
- className: "text-gray-400 ",
206
+ className: "h-8 w-8 text-fm-icon-active",
207
+ withAccessibility: true,
1027
208
  },
1028
209
  render: (args) => (
1029
- <div className="flex h-64 min-h-dvh items-center justify-center rounded-lg bg-gradient-to-br from-gray-900 to-gray-800">
1030
- <div className="rounded-lg border border-white/10 bg-white/5 p-8">
1031
- <CrossIcon {...args} />
1032
- </div>
1033
- </div>
210
+ <IconPlaygroundCanvas>
211
+ <CrossIcon {...args} />
212
+ </IconPlaygroundCanvas>
1034
213
  ),
1035
214
  }