aural-ui 4.0.1 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/README.md +8 -1
  2. package/dist/components/aspect-ratio/AspectRatio.stories.tsx +290 -1228
  3. package/dist/components/avatar/Avatar.stories.tsx +219 -235
  4. package/dist/components/badge/Badge.stories.tsx +379 -116
  5. package/dist/components/banner/Banner.stories.tsx +445 -391
  6. package/dist/components/breadcrumb/Breadcrumb.stories.tsx +453 -199
  7. package/dist/components/button/Button.stories.tsx +585 -230
  8. package/dist/components/card/Card.stories.tsx +619 -301
  9. package/dist/components/char-count/CharCount.stories.tsx +350 -248
  10. package/dist/components/checkbox/Checkbox.stories.tsx +309 -167
  11. package/dist/components/chip/Chip.stories.tsx +362 -168
  12. package/dist/components/circular-loader/CircularLoader.stories.tsx +221 -636
  13. package/dist/components/clamp-lines/ClampLines.stories.tsx +246 -117
  14. package/dist/components/collapsible/Collapsible.stories.tsx +391 -252
  15. package/dist/components/command/Command.stories.tsx +530 -867
  16. package/dist/components/dialog/Dialog.stories.tsx +501 -950
  17. package/dist/components/divider/Divider.stories.tsx +264 -527
  18. package/dist/components/dot-loader/DotLoader.stories.tsx +256 -257
  19. package/dist/components/drawer/Drawer.stories.tsx +659 -1023
  20. package/dist/components/dropdown/Dropdown.stories.tsx +643 -1028
  21. package/dist/components/form/Form.stories.tsx +560 -274
  22. package/dist/components/helper-text/HelperText.stories.tsx +199 -200
  23. package/dist/components/hover-card/HoverCard.stories.tsx +318 -1254
  24. package/dist/components/icon-button/IconButton.stories.tsx +837 -194
  25. package/dist/components/if-else/if-else.stories.tsx +370 -83
  26. package/dist/components/input/Input.stories.tsx +436 -368
  27. package/dist/components/label/Label.stories.tsx +156 -154
  28. package/dist/components/list/List.stories.tsx +484 -835
  29. package/dist/components/marquee/Marquee.stories.tsx +356 -712
  30. package/dist/components/otp-inputs/OtpInputs.stories.tsx +352 -422
  31. package/dist/components/overlay/Overlay.stories.tsx +452 -824
  32. package/dist/components/pagination/Pagination.stories.tsx +721 -210
  33. package/dist/components/popover/Popover.stories.tsx +481 -896
  34. package/dist/components/radio/Radio.stories.tsx +432 -124
  35. package/dist/components/resizable/Resizable.stories.tsx +495 -799
  36. package/dist/components/scroll-area/ScrollArea.stories.tsx +383 -1059
  37. package/dist/components/search/Search.stories.tsx +312 -595
  38. package/dist/components/select/Select.stories.tsx +684 -789
  39. package/dist/components/sheet/Sheet.stories.tsx +671 -950
  40. package/dist/components/skelton/Skelton.stories.tsx +230 -764
  41. package/dist/components/slider/Slider.stories.tsx +383 -760
  42. package/dist/components/stepper/Stepper.stories.tsx +371 -514
  43. package/dist/components/switch/Switch.stories.tsx +461 -208
  44. package/dist/components/switch-case/SwitchCase.stories.tsx +367 -188
  45. package/dist/components/table/Table.stories.tsx +770 -916
  46. package/dist/components/tabs/Tabs.stories.tsx +458 -1455
  47. package/dist/components/tag/Tag.stories.tsx +714 -542
  48. package/dist/components/textarea/TextArea.stories.tsx +621 -562
  49. package/dist/components/thumbnail-tags/ThumbnailTags.stories.tsx +228 -154
  50. package/dist/components/toast/Toast.stories.tsx +452 -1339
  51. package/dist/components/toggle/Toggle.stories.tsx +488 -931
  52. package/dist/components/tooltip/Tooltip.stories.tsx +344 -1388
  53. package/dist/components/typography/Typography.stories.tsx +406 -89
  54. package/dist/hooks/use-change-state/UseChangeState.stories.tsx +309 -606
  55. package/dist/hooks/use-previous/UsePrevious.stories.tsx +367 -917
  56. package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +639 -867
  57. package/dist/icons/Icons.stories.tsx +0 -12
  58. package/dist/icons/ai-avatar-icon/AiAvatarIcon.stories.tsx +223 -1060
  59. package/dist/icons/alert-icon/AlertIcon.stories.tsx +106 -968
  60. package/dist/icons/all-icons.tsx +37 -16
  61. package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +137 -1010
  62. package/dist/icons/apple-logo-icon/AppleLogoIcon.stories.tsx +145 -935
  63. package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +132 -1046
  64. package/dist/icons/arrow-corner-up-left-icon/ArrowCornerUpLeftIcon.stories.tsx +134 -986
  65. package/dist/icons/arrow-corner-up-right-icon/ArrowCornerUpRightIcon.stories.tsx +135 -1028
  66. package/dist/icons/arrow-left-icon/ArrowLeftIcon.stories.tsx +133 -971
  67. package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +145 -1123
  68. package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +143 -1252
  69. package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +123 -632
  70. package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +141 -1223
  71. package/dist/icons/backward-ten-seconds-icon/BackwardTenSecondsIcon.stories.tsx +164 -1018
  72. package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +121 -1236
  73. package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +121 -1213
  74. package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +116 -893
  75. package/dist/icons/camera-icon/CameraIcon.stories.tsx +109 -1254
  76. package/dist/icons/capital-a-letter-icon/CapitalALetterIcon.stories.tsx +114 -975
  77. package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +157 -994
  78. package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +160 -992
  79. package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +140 -970
  80. package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +126 -993
  81. package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +144 -987
  82. package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +141 -1007
  83. package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +147 -1187
  84. package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +110 -476
  85. package/dist/icons/coin-icon/CoinIcon.stories.tsx +120 -1364
  86. package/dist/icons/coin-toons-icon/CoinToonsIcon.stories.tsx +113 -1360
  87. package/dist/icons/column-wide-add-icon/ColumnWideAddIcon.stories.tsx +111 -942
  88. package/dist/icons/command-icon/CommandIcon.stories.tsx +124 -1087
  89. package/dist/icons/copy-icon/CopyIcon.stories.tsx +119 -996
  90. package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +144 -1046
  91. package/dist/icons/cross-icon/CrossIcon.stories.tsx +136 -999
  92. package/dist/icons/download-icon/DownloadIcon.stories.tsx +123 -857
  93. package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +121 -1080
  94. package/dist/icons/email-icon/EmailIcon.stories.tsx +112 -979
  95. package/dist/icons/expand-icon/ExpandIcon.stories.tsx +109 -1146
  96. package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +141 -1068
  97. package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +140 -1081
  98. package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +124 -1050
  99. package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +123 -1091
  100. package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +122 -633
  101. package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +116 -1087
  102. package/dist/icons/forward-ten-seconds-icon/ForwardTenSecondsIcon.stories.tsx +166 -1020
  103. package/dist/icons/git-branch-icon/GitBranchIcon.stories.tsx +112 -1182
  104. package/dist/icons/git-fork-icon/GitForkIcon.stories.tsx +112 -1155
  105. package/dist/icons/globe-icon/GlobeIcon.stories.tsx +127 -325
  106. package/dist/icons/google-logo-icon/GoogleLogoIcon.stories.tsx +142 -985
  107. package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +116 -1217
  108. package/dist/icons/head-icon/HeadIcon.stories.tsx +108 -953
  109. package/dist/icons/heart-icon/HeartIcon.stories.tsx +117 -1060
  110. package/dist/icons/image-avatar-sparkle-icon/ImageAvatarSparkleIcon.stories.tsx +116 -716
  111. package/dist/icons/image-icon/ImageIcon.stories.tsx +102 -1164
  112. package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +108 -1233
  113. package/dist/icons/import-left-arrow-folder-icon/ImportLeftArrowFolderIcon.stories.tsx +133 -1289
  114. package/dist/icons/indian-flag-icon/IndianFlagIcon.stories.tsx +155 -1012
  115. package/dist/icons/instagram-icon/InstagramIcon.stories.tsx +158 -1438
  116. package/dist/icons/layout-column-icon/LayoutColumnIcon.stories.tsx +121 -1011
  117. package/dist/icons/layout-left-icon/LayoutLeftIcon.stories.tsx +116 -981
  118. package/dist/icons/layout-right-icon/LayoutRightIcon.stories.tsx +116 -979
  119. package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +105 -1252
  120. package/dist/icons/linked-in-icon/LinkedInIcon.stories.tsx +151 -1554
  121. package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +107 -1227
  122. package/dist/icons/magic-edit-icon/MagicEditIcon.stories.tsx +116 -707
  123. package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +119 -1226
  124. package/dist/icons/message-icon/MessageIcon.stories.tsx +111 -557
  125. package/dist/icons/minimize-icon/MinimizeIcon.stories.tsx +112 -1198
  126. package/dist/icons/moon-icon/MoonIcon.stories.tsx +117 -557
  127. package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +106 -1235
  128. package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +112 -1185
  129. package/dist/icons/musical-note-icon/MusicalNoteIcon.stories.tsx +116 -1012
  130. package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +108 -1137
  131. package/dist/icons/notes-icon/NotesIcon.stories.tsx +116 -1138
  132. package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +106 -1146
  133. package/dist/icons/page-text-icon/PageTextIcon.stories.tsx +119 -719
  134. package/dist/icons/paint-roll-icon/PaintRollIcon.stories.tsx +110 -999
  135. package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +109 -912
  136. package/dist/icons/pause-icon/PauseIcon.stories.tsx +110 -1041
  137. package/dist/icons/pencil-icon/PencilIcon.stories.tsx +112 -1109
  138. package/dist/icons/phone-icon/PhoneIcon.stories.tsx +112 -1023
  139. package/dist/icons/plus-icon/PlusIcon.stories.tsx +103 -1132
  140. package/dist/icons/pocket-studio-icon/PocketStudioIcon.stories.tsx +104 -870
  141. package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +99 -476
  142. package/dist/icons/search-icon/SearchIcon.stories.tsx +108 -1161
  143. package/dist/icons/setting-icon/SettingIcon.stories.tsx +104 -1009
  144. package/dist/icons/share-icon/ShareIcon.stories.tsx +117 -1064
  145. package/dist/icons/shield-icon/ShieldIcon.stories.tsx +114 -974
  146. package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +134 -1160
  147. package/dist/icons/skip-backward-icon/SkipBackwardIcon.stories.tsx +169 -1017
  148. package/dist/icons/skip-forward-icon/SkipForwardIcon.stories.tsx +161 -1016
  149. package/dist/icons/sparkles-soft-icon/SparklesSoftIcon.stories.tsx +102 -1001
  150. package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +155 -593
  151. package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +155 -608
  152. package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +142 -712
  153. package/dist/icons/star-icon/StarIcon.stories.tsx +120 -946
  154. package/dist/icons/store-coin-icon/StoreCoinIcon.stories.tsx +109 -1013
  155. package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +113 -891
  156. package/dist/icons/sun-icon/SunIcon.stories.tsx +117 -864
  157. package/dist/icons/text-color-icon/TextColorIcon.stories.tsx +113 -989
  158. package/dist/icons/text-indicator-icon/TextIndicatorIcon.stories.tsx +120 -1027
  159. package/dist/icons/threads-icon/ThreadsIcon.stories.tsx +153 -1476
  160. package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +143 -1187
  161. package/dist/icons/tick-icon/TickIcon.stories.tsx +142 -1322
  162. package/dist/icons/trash-icon/TrashIcon.stories.tsx +105 -970
  163. package/dist/icons/twitter-x-icon/TwitterXIcon.stories.tsx +154 -1457
  164. package/dist/icons/upload-icon/UploadIcon.stories.tsx +112 -930
  165. package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +115 -1019
  166. package/dist/icons/video-play-list-icon/VideoPlaylistIcon.stories.tsx +122 -1092
  167. package/dist/icons/voice-playing-icon/VoicePlayingIcon.stories.tsx +120 -1401
  168. package/dist/icons/volume-full-icon/VolumeFullIcon.stories.tsx +107 -1212
  169. package/dist/icons/volume-half-icon/VolumeHalfIcon.stories.tsx +109 -1122
  170. package/dist/icons/volume-off-icon/VolumeOffIcon.stories.tsx +112 -1124
  171. package/dist/icons/warning-icon/WarningIcon.stories.tsx +119 -1083
  172. package/dist/icons/youtube-icon/YoutubeIcon.stories.tsx +158 -983
  173. package/dist/index.cjs +90 -90
  174. package/dist/index.js +90 -90
  175. package/package.json +8 -3
@@ -1,6 +1,8 @@
1
1
  import React from "react"
2
2
  import type { Meta, StoryObj } from "@storybook/react-vite"
3
3
 
4
+ import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
5
+
4
6
  import DotLoader from "."
5
7
 
6
8
  const meta: Meta<typeof DotLoader> = {
@@ -10,77 +12,44 @@ const meta: Meta<typeof DotLoader> = {
10
12
  layout: "centered",
11
13
  docs: {
12
14
  description: {
13
- component: `
14
- # DotLoader
15
-
16
- A customizable animated dot loader component with three dots that pulse in sequence, built with accessibility in mind.
17
-
18
- ## Features
19
- - Smooth pulsing animation with CSS custom properties
20
- - Customizable colors for normal and active states
21
- - Optional text label with flexible content support
22
- - Comprehensive accessibility features (ARIA attributes, screen reader support)
23
- - Flexible styling with custom classes
24
- - Dark theme optimized
25
- - Screen reader announcements with configurable messages
26
-
27
- ## Accessibility Features
28
- - \`role="status"\` for proper semantic meaning
29
- - \`aria-live="polite"\` for non-intrusive screen reader announcements
30
- - \`aria-busy="true"\` to indicate loading state
31
- - Hidden descriptive text for screen readers
32
- - Configurable ARIA labels and loading messages
33
- - Decorative elements properly hidden from assistive technology
34
-
35
- ## Usage
36
- \`\`\`tsx
37
- import DotLoader from '@/ui/components/dot-loader'
38
-
39
- // Basic usage
40
- <DotLoader />
41
-
42
- // With text
43
- <DotLoader text="Loading..." />
44
-
45
- // Custom colors and accessibility
46
- <DotLoader
47
- color="var(--color-blue-500)"
48
- activeDotColor="var(--color-blue-300)"
49
- text="Processing..."
50
- ariaLabel="Processing user data"
51
- loadingMessage="User data is being processed, please wait"
52
- />
53
-
54
- // Silent loading (no screen reader announcements)
55
- <DotLoader
56
- text="Background sync"
57
- announceToScreenReader={false}
58
- />
59
- \`\`\`
60
- `,
15
+ component:
16
+ "An animated three-dot loading indicator that pulses in sequence. Supports optional visible text, custom dot colors via design tokens, and comprehensive ARIA attributes for screen reader compatibility.",
61
17
  },
62
- },
63
- backgrounds: {
64
- default: "dark",
65
- values: [
66
- { name: "dark", value: "#1a1a1a" },
67
- { name: "light", value: "#ffffff" },
68
- ],
18
+ page: () => (
19
+ <AuralComponentDocsPage
20
+ features={[
21
+ {
22
+ title: "Pulsing Animation",
23
+ description: "Sequenced dot animation",
24
+ },
25
+ {
26
+ title: "Token Colors",
27
+ description: "Active & inactive dots",
28
+ },
29
+ {
30
+ title: "ARIA Support",
31
+ description: "aria-live and role built in",
32
+ },
33
+ ]}
34
+ />
35
+ ),
69
36
  },
70
37
  },
38
+ tags: ["autodocs"],
71
39
  argTypes: {
72
40
  text: {
73
41
  control: "text",
74
- description:
75
- "Optional text to display below the loader (supports React nodes)",
42
+ description: "Optional visible text displayed below the dots",
76
43
  },
77
44
  color: {
78
- control: "color",
79
- description: "Color of the inactive dots",
45
+ control: "text",
46
+ description:
47
+ "CSS value for the inactive dot color (use design token var() references)",
80
48
  },
81
49
  activeDotColor: {
82
- control: "color",
83
- description: "Color of the active/pulsing dot",
50
+ control: "text",
51
+ description:
52
+ "CSS value for the active/pulsing dot color (use design token var() references)",
84
53
  },
85
54
  className: {
86
55
  control: "text",
@@ -93,143 +62,187 @@ import DotLoader from '@/ui/components/dot-loader'
93
62
  },
94
63
  ariaLabel: {
95
64
  control: "text",
96
- description: "Accessible label for screen readers",
65
+ description: "Accessible label announced by screen readers",
97
66
  },
98
67
  announceToScreenReader: {
99
68
  control: "boolean",
100
- description: "Whether to announce loading state to screen readers",
69
+ description:
70
+ "Whether to add aria-live='polite' for screen reader announcements",
101
71
  },
102
72
  loadingMessage: {
103
73
  control: "text",
104
- description: "Custom loading message for screen readers",
74
+ description: "Hidden descriptive message read by screen readers",
105
75
  },
106
76
  },
107
- tags: ["autodocs"],
108
77
  }
109
78
 
110
79
  export default meta
111
80
  type Story = StoryObj<typeof meta>
112
81
 
113
- // Default story
114
- export const Default: Story = {
115
- args: {},
116
- }
82
+ // ─── 1. Playground ────────────────────────────────────────────────────────────
117
83
 
118
- // With text
119
- export const WithText: Story = {
84
+ export const Playground: Story = {
120
85
  args: {
121
86
  text: "Loading...",
122
- },
123
- }
124
-
125
- // Custom colors
126
- export const CustomColors: Story = {
127
- args: {
128
- text: "Processing...",
129
- color: "#64748b",
130
- activeDotColor: "#3b82f6",
131
- },
132
- }
133
-
134
- // Brand colors
135
- export const BrandColors: Story = {
136
- args: {
137
- text: "Please wait",
138
87
  color: "var(--color-fm-secondary-800)",
139
88
  activeDotColor: "var(--color-fm-secondary-500)",
140
- },
141
- }
142
-
143
- // Accessibility focused story
144
- export const AccessibilityFeatures: Story = {
145
- args: {
146
- text: "Loading user profile",
147
- ariaLabel: "Loading user profile data",
148
- loadingMessage: "User profile data is being loaded, please wait",
89
+ ariaLabel: "Loading",
149
90
  announceToScreenReader: true,
91
+ loadingMessage: "Content is loading, please wait",
150
92
  },
93
+ render: (args) => (
94
+ <div className="w-full max-w-sm space-y-4">
95
+ <div className="flex justify-center py-4">
96
+ <DotLoader {...args} />
97
+ </div>
98
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border px-4 py-3">
99
+ <code className="text-fm-secondary text-fm-md leading-fm-md font-(--font-fm-mono)">
100
+ {`<DotLoader${args.text ? ` text="${args.text}"` : ""}${args.ariaLabel ? ` ariaLabel="${args.ariaLabel}"` : ""} />`}
101
+ </code>
102
+ </div>
103
+ </div>
104
+ ),
151
105
  parameters: {
152
106
  docs: {
153
107
  description: {
154
108
  story:
155
- "Demonstrates accessibility features with custom ARIA labels and screen reader messages.",
109
+ "Adjust text, dot colors, and accessibility props using the controls panel in the sidebar.",
156
110
  },
157
111
  },
158
112
  },
159
113
  }
160
114
 
161
- // Silent loading (no screen reader announcements)
162
- export const SilentLoading: Story = {
163
- args: {
164
- text: "Background sync",
165
- announceToScreenReader: false,
166
- ariaLabel: "Background synchronization",
167
- },
168
- parameters: {
169
- docs: {
170
- description: {
171
- story:
172
- "Example of a loader that doesn't announce to screen readers, useful for background processes.",
173
- },
174
- },
175
- },
176
- }
115
+ // ─── 2. Configurations ────────────────────────────────────────────────────────
177
116
 
178
- // Large with custom styling
179
- export const CustomStyling: Story = {
180
- args: {
181
- text: "Loading your content...",
182
- className: "p-8",
183
- classes: {
184
- root: "bg-slate-800 rounded-lg p-6",
185
- dot: "scale-150",
186
- text: "text-slate-300 text-lg font-semibold",
187
- },
188
- ariaLabel: "Loading content",
189
- loadingMessage: "Content is being loaded with custom styling",
190
- },
191
- }
192
-
193
- // Different color variations
194
- export const ColorVariations: Story = {
117
+ export const Configurations: Story = {
195
118
  render: () => (
196
- <div className="flex flex-col gap-8">
197
- <div className="text-center">
198
- <h3 className="text-fm-primary mb-4 text-lg">Default Theme</h3>
199
- <DotLoader text="Loading..." ariaLabel="Loading default content" />
119
+ <div className="space-y-8">
120
+ <div className="space-y-4">
121
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
122
+ Text Options
123
+ </h4>
124
+ <div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
125
+ <div className="space-y-3 text-center">
126
+ <div className="flex min-h-24 items-center justify-center">
127
+ <DotLoader ariaLabel="Loading" />
128
+ </div>
129
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
130
+ No Text
131
+ </p>
132
+ </div>
133
+ <div className="space-y-3 text-center">
134
+ <div className="flex min-h-24 items-center justify-center">
135
+ <DotLoader text="Loading..." ariaLabel="Loading content" />
136
+ </div>
137
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
138
+ With Text
139
+ </p>
140
+ </div>
141
+ <div className="space-y-3 text-center">
142
+ <div className="flex min-h-24 items-center justify-center">
143
+ <DotLoader
144
+ text="Uploading your files..."
145
+ ariaLabel="Uploading files"
146
+ />
147
+ </div>
148
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
149
+ Longer Text
150
+ </p>
151
+ </div>
152
+ </div>
200
153
  </div>
201
154
 
202
- <div className="text-center">
203
- <h3 className="text-fm-primary mb-4 text-lg">Blue Theme</h3>
204
- <DotLoader
205
- text="Processing..."
206
- color="#1e293b"
207
- activeDotColor="#3b82f6"
208
- ariaLabel="Processing data"
209
- loadingMessage="Data processing in progress"
210
- />
155
+ <div className="space-y-4">
156
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
157
+ Custom Colors (Design Tokens)
158
+ </h4>
159
+ <div className="grid gap-6 sm:grid-cols-2 xl:grid-cols-4">
160
+ <div className="space-y-3 text-center">
161
+ <div className="flex min-h-24 items-center justify-center">
162
+ <DotLoader
163
+ text="Default"
164
+ color="var(--color-fm-secondary-800)"
165
+ activeDotColor="var(--color-fm-secondary-500)"
166
+ ariaLabel="Loading with brand colors"
167
+ />
168
+ </div>
169
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
170
+ Brand (Secondary)
171
+ </p>
172
+ </div>
173
+ <div className="space-y-3 text-center">
174
+ <div className="flex min-h-24 items-center justify-center">
175
+ <DotLoader
176
+ text="Positive"
177
+ color="var(--color-fm-green-900)"
178
+ activeDotColor="var(--color-fm-green-500)"
179
+ ariaLabel="Loading with positive indicator"
180
+ />
181
+ </div>
182
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
183
+ Positive
184
+ </p>
185
+ </div>
186
+ <div className="space-y-3 text-center">
187
+ <div className="flex min-h-24 items-center justify-center">
188
+ <DotLoader
189
+ text="Info"
190
+ color="var(--color-fm-blue-900)"
191
+ activeDotColor="var(--color-fm-blue-500)"
192
+ ariaLabel="Loading with info indicator"
193
+ />
194
+ </div>
195
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
196
+ Info
197
+ </p>
198
+ </div>
199
+ <div className="space-y-3 text-center">
200
+ <div className="flex min-h-24 items-center justify-center">
201
+ <DotLoader
202
+ text="Warning"
203
+ color="var(--color-fm-yellow-800)"
204
+ activeDotColor="var(--color-fm-yellow-500)"
205
+ ariaLabel="Loading with warning indicator"
206
+ />
207
+ </div>
208
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
209
+ Warning
210
+ </p>
211
+ </div>
212
+ </div>
211
213
  </div>
212
214
 
213
- <div className="text-center">
214
- <h3 className="text-fm-primary mb-4 text-lg">Green Theme</h3>
215
- <DotLoader
216
- text="Uploading..."
217
- color="#1f2937"
218
- activeDotColor="#10b981"
219
- ariaLabel="Uploading files"
220
- loadingMessage="Files are being uploaded"
221
- />
222
- </div>
223
-
224
- <div className="text-center">
225
- <h3 className="text-fm-primary mb-4 text-lg">Red Theme</h3>
226
- <DotLoader
227
- text="Deleting..."
228
- color="#1f2937"
229
- activeDotColor="#ef4444"
230
- ariaLabel="Deleting items"
231
- loadingMessage="Items are being deleted"
232
- />
215
+ <div className="space-y-4">
216
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
217
+ Screen Reader Announcement Mode
218
+ </h4>
219
+ <div className="grid gap-6 sm:grid-cols-2">
220
+ <div className="space-y-3 text-center">
221
+ <div className="flex min-h-24 items-center justify-center">
222
+ <DotLoader
223
+ text="Syncing..."
224
+ announceToScreenReader={true}
225
+ ariaLabel="Syncing data"
226
+ loadingMessage="Data is being synced with the server, please wait"
227
+ />
228
+ </div>
229
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
230
+ Announced (aria-live)
231
+ </p>
232
+ </div>
233
+ <div className="space-y-3 text-center">
234
+ <div className="flex min-h-24 items-center justify-center">
235
+ <DotLoader
236
+ text="Background sync"
237
+ announceToScreenReader={false}
238
+ ariaLabel="Background synchronization"
239
+ />
240
+ </div>
241
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
242
+ Silent (no aria-live)
243
+ </p>
244
+ </div>
245
+ </div>
233
246
  </div>
234
247
  </div>
235
248
  ),
@@ -237,58 +250,93 @@ export const ColorVariations: Story = {
237
250
  docs: {
238
251
  description: {
239
252
  story:
240
- "Examples of different color combinations for various use cases, each with appropriate accessibility labels.",
253
+ "Configuration options: text presence, custom dot colors using design token CSS variables, and screen reader announcement mode.",
241
254
  },
242
255
  },
243
256
  },
244
257
  }
245
258
 
246
- // Loading states simulation
247
- export const LoadingStates: Story = {
248
- render: () => (
249
- <div className="grid grid-cols-2 gap-8">
250
- <div className="bg-fm-surface-secondary rounded-lg p-6 text-center">
251
- <h4 className="text-fm-primary mb-4 text-sm">File Upload</h4>
252
- <DotLoader
253
- text="Uploading files..."
254
- color="#374151"
255
- activeDotColor="#06b6d4"
256
- ariaLabel="File upload in progress"
257
- loadingMessage="Files are being uploaded to the server"
258
- />
259
- </div>
259
+ // ─── 3. Accessibility ─────────────────────────────────────────────────────────
260
260
 
261
- <div className="bg-fm-surface-secondary rounded-lg p-6 text-center">
262
- <h4 className="text-fm-primary mb-4 text-sm">Data Processing</h4>
263
- <DotLoader
264
- text="Processing data..."
265
- color="#374151"
266
- activeDotColor="#8b5cf6"
267
- ariaLabel="Data processing"
268
- loadingMessage="Your data is being processed"
269
- />
270
- </div>
271
-
272
- <div className="bg-fm-surface-secondary rounded-lg p-6 text-center">
273
- <h4 className="text-fm-primary mb-4 text-sm">Authentication</h4>
274
- <DotLoader
275
- text="Signing in..."
276
- color="#374151"
277
- activeDotColor="#f59e0b"
278
- ariaLabel="Authentication in progress"
279
- loadingMessage="Please wait while we sign you in"
280
- />
261
+ export const Accessibility: Story = {
262
+ render: () => (
263
+ <div className="space-y-8">
264
+ <div className="space-y-4">
265
+ <h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
266
+ ARIA Attribute Examples
267
+ </h4>
268
+ <div className="flex flex-wrap items-start gap-8">
269
+ <div className="space-y-2 text-center">
270
+ <DotLoader
271
+ text="Loading user profile"
272
+ ariaLabel="Loading user profile data"
273
+ loadingMessage="User profile data is being loaded, please wait"
274
+ announceToScreenReader={true}
275
+ />
276
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
277
+ Visual + SR message
278
+ </p>
279
+ </div>
280
+ <div className="space-y-2 text-center">
281
+ <DotLoader
282
+ ariaLabel="Authenticating your account"
283
+ loadingMessage="Authentication is in progress, please wait"
284
+ announceToScreenReader={true}
285
+ />
286
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
287
+ SR label only (no text)
288
+ </p>
289
+ </div>
290
+ <div className="space-y-2 text-center">
291
+ <DotLoader
292
+ text="Saving changes"
293
+ announceToScreenReader={false}
294
+ ariaLabel="Saving document changes silently"
295
+ />
296
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
297
+ Silent background task
298
+ </p>
299
+ </div>
300
+ </div>
281
301
  </div>
282
302
 
283
- <div className="bg-fm-surface-secondary rounded-lg p-6 text-center">
284
- <h4 className="text-fm-primary mb-4 text-sm">Content Loading</h4>
285
- <DotLoader
286
- text="Loading content..."
287
- color="#374151"
288
- activeDotColor="#10b981"
289
- ariaLabel="Content loading"
290
- loadingMessage="Page content is being loaded"
291
- />
303
+ <div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
304
+ <p className="text-fm-secondary font-fm-text text-fm-md leading-fm-xl">
305
+ <strong className="text-fm-primary">Best practices:</strong>
306
+ </p>
307
+ <ul className="mt-2 space-y-1">
308
+ <li>
309
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
310
+ Always provide <code>ariaLabel</code> or <code>text</code> so
311
+ screen readers have context about what is loading.
312
+ </p>
313
+ </li>
314
+ <li>
315
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
316
+ • Use <code>loadingMessage</code> to supply a more detailed
317
+ description than the visible text, if they differ.
318
+ </p>
319
+ </li>
320
+ <li>
321
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
322
+ • Set <code>announceToScreenReader=false</code> for silent
323
+ background tasks that should not interrupt the user.
324
+ </p>
325
+ </li>
326
+ <li>
327
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
328
+ • The component uses <code>role="status"</code> and{" "}
329
+ <code>aria-busy="true"</code> automatically — no extra markup
330
+ needed.
331
+ </p>
332
+ </li>
333
+ <li>
334
+ <p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
335
+ • Decorative dot elements are hidden from assistive technology via{" "}
336
+ <code>aria-hidden="true"</code>.
337
+ </p>
338
+ </li>
339
+ </ul>
292
340
  </div>
293
341
  </div>
294
342
  ),
@@ -296,56 +344,7 @@ export const LoadingStates: Story = {
296
344
  docs: {
297
345
  description: {
298
346
  story:
299
- "Real-world examples of how the loader might be used in different contexts with appropriate accessibility descriptions.",
300
- },
301
- },
302
- },
303
- }
304
-
305
- // Complex content example
306
- export const ComplexContent: Story = {
307
- args: {
308
- text: (
309
- <div className="flex items-center gap-2">
310
- <span>Loading</span>
311
- <span className="font-bold text-blue-400">premium</span>
312
- <span>content...</span>
313
- </div>
314
- ),
315
- ariaLabel: "Loading premium content",
316
- loadingMessage: "Premium content is being loaded for your account",
317
- },
318
- parameters: {
319
- docs: {
320
- description: {
321
- story:
322
- "Example with complex React node content while maintaining accessibility.",
323
- },
324
- },
325
- },
326
- }
327
-
328
- // Playground story for interactive testing
329
- export const Playground: Story = {
330
- args: {
331
- text: "Loading...",
332
- color: "#64748b",
333
- activeDotColor: "#3b82f6",
334
- className: "",
335
- classes: {
336
- root: "",
337
- dot: "",
338
- text: "",
339
- },
340
- ariaLabel: "Loading",
341
- announceToScreenReader: true,
342
- loadingMessage: "Content is loading, please wait",
343
- },
344
- parameters: {
345
- docs: {
346
- description: {
347
- story:
348
- "Interactive playground to test all component props including accessibility features.",
347
+ "Proper ARIA attribute usage patterns for DotLoader covering visible-text loaders, screen-reader-only labels, and silent background tasks, with a best-practices reference at the bottom.",
349
348
  },
350
349
  },
351
350
  },